diff --git a/build-profile.json5 b/build-profile.json5 index 660eb033a34..049a2aa08af 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -25,6 +25,18 @@ ] }, "modules": [ + { + "name": "entry_c", + "srcPath": "./framework/examples/ohos-c-demo", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, { "name": "entry_har", "srcPath": "./framework/examples/ohos-har-demo", @@ -52,6 +64,6 @@ { "name": "hippy", "srcPath": "./framework/ohos" - }, + } ] } diff --git a/docs/README.md b/docs/README.md index 3c1970945f2..8da90c58ed3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,7 +4,7 @@ 更新时间:2025-2-14 -SDK介绍:Hippy 是 TDF 腾讯端框架(Tencent Device-oriented Framework)下的开源跨平台应用开发解决方案。Hippy 可以理解为一个精简版的浏览器,从底层做了大量工作,抹平了 iOS 和 Android 双端差异,提供了接近 Web 的开发体验,目前上层支持了 React 和 Vue 两套界面框架,前端开发人员可以通过它,将前端代码转换为终端的原生指令,进行原生终端 App 的开发。同时,Hippy 从底层进行了大量优化,在启动速度、渲染性能、动画速度、内存占用、包体积等方面都提供了业内顶尖的性能表现。 +SDK介绍:Hippy 是 TDF 腾讯端框架(Tencent Device-oriented Framework)下的开源跨平台应用开发解决方案。Hippy 可以理解为一个精简版的浏览器,从底层做了大量工作,抹平了 iOS、Android、Ohos 三端差异,提供了接近 Web 的开发体验,目前上层支持了 React 和 Vue 两套界面框架,前端开发人员可以通过它,将前端代码转换为终端的原生指令,进行原生终端 App 的开发。同时,Hippy 从底层进行了大量优化,在启动速度、渲染性能、动画速度、内存占用、包体积等方面都提供了业内顶尖的性能表现。 更新日志:[Change log](https://github.com/Tencent/Hippy/releases) @@ -27,7 +27,7 @@ SDK介绍:Hippy 是 TDF 腾讯端框架(Tencent Device-oriented Framework) ## 一次开发,多端运行 -使用 Hippy 框架开发后,代码可以同时运行在 Android、iOS、 Web等多个平台。 +使用 Hippy 框架开发后,代码可以同时运行在 Android、iOS、Ohos、Web等多个平台。 ## 出色的性能表现 @@ -72,7 +72,7 @@ DOM Manager 从 Java/OC 抽离到 C++,作为中间枢纽,除了接收处理 ### 渲染层 -* Native Renderer:使用 Android/iOS 原生组件进行渲染, 详见 [Android](architecture/render/android/native-render)、[iOS](architecture/render/ios/native-render)。 +* Native Renderer:使用 Android/iOS/Ohos 原生组件进行渲染, 详见 [Android](architecture/render/android/native-render)、[iOS](architecture/render/ios/native-render)、[Ohos](architecture/render/ohos/native-render)。 * Voltron Renderer:使用 Flutter 渲染, 详见 [Voltron](architecture/render/voltron/voltron-render)。 * Web Renderer:使用 WebView 渲染(Web 同构), 详见 [Web](architecture/render/web/web-render)。 diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 71ff384d59f..2ab52e3483f 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -10,7 +10,7 @@ * 支持 React 和 Vue 两种语法 * 平滑迁移到 Web -* iOS 增量 1MB,Android 增量最小 2.5MB +* iOS 增量 1MB,Android 增量最小 2.5MB,Ohos 增量 1.9MB [GitHub](//github.com/Tencent/Hippy) [快速开始](/README.md) diff --git a/docs/architecture/_sidebar.md b/docs/architecture/_sidebar.md index 2b5a1cfed27..7c68468b242 100644 --- a/docs/architecture/_sidebar.md +++ b/docs/architecture/_sidebar.md @@ -4,6 +4,7 @@ * [HippyCore 架构](architecture/core.md) * [Android 渲染原理](architecture/render/android/native-render.md) * [iOS 渲染原理](architecture/render/ios/native-render.md) +* [Ohos 渲染原理](architecture/render/ohos/native-render.md) * [Voltron/Flutter 渲染原理](architecture/render/voltron/voltron-render.md) * [Web 渲染原理](architecture/render/web/web-render.md) * [排版盒模型](architecture/layout.md) diff --git a/docs/architecture/introduction.md b/docs/architecture/introduction.md index 2a9098dda2f..012905c7c4e 100644 --- a/docs/architecture/introduction.md +++ b/docs/architecture/introduction.md @@ -19,7 +19,7 @@ DOM Manager 从 Java/OC 抽离到 C++,作为中间枢纽,除了接收处理 ## 渲染层 -* Native Renderer:使用 Android/iOS 原生组件进行渲染, 详见 [Android](architecture/render/android/native-render)、[iOS](architecture/render/ios/native-render)。 +* Native Renderer:使用 Android/iOS/Ohos 原生组件进行渲染, 详见 [Android](architecture/render/android/native-render)、[iOS](architecture/render/ios/native-render)、[Ohos](architecture/render/ohos/native-render)。 * Voltron Renderer:使用 Flutter 渲染, 详见 [Voltron](architecture/render/voltron/voltron-render)。 * Web Renderer:使用 WebView 渲染(Web 同构), 详见 [Web](architecture/render/web/web-render)。 diff --git a/docs/architecture/render/ohos/native-render.md b/docs/architecture/render/ohos/native-render.md new file mode 100644 index 00000000000..cc7eb53ad14 --- /dev/null +++ b/docs/architecture/render/ohos/native-render.md @@ -0,0 +1,36 @@ +# Ohos Native Renderer + +--- + +Hippy 渲染器对接了 Ohos 的 ArkUI。ArkUI 提供了声明式 [TS API](https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V13/arkui-api-V13) 和过程式 [C API](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/_ark_u_i___native_module.md),TS API 开发方便,但性能不如 C API。 +Hippy 内部使用 C API 实现 UI 组件的绘制,同时支持业务通过 TS API 来实现自定义组件,也支持通过 C API 来实现自定义组件。 + +Hippy Ohos 整体架构: + +![image](../../../assets/img/ohos_hippy_arch.png) + +其中渲染系统,分两部分: +- C++渲染器:负责几乎所有组件渲染和流程管理。 +- TS渲染器:负责业务接入根组件、自定义组件、Web组件。(Web组件没有C接口) + +## 自定义组件 + +支持两种语言实现自定义组件,TS和C,TS自定义组件开发方便,C自定义组件性能更好。一般页面内少量组件自定义,建议使用TS自定义组件,性能够用,对于极端性能场景,比如自定义Image、Text等基础组件,使用C自定义组件可以获得更好的性能。 + + +TS 语言实现自定义组件原理图: + +![image](../../../assets/img/ohos_custom_ts_comp.png) + +C 语言实现自定义组件原理图: + +![image](../../../assets/img/ohos_custom_c_comp.png) + +## TS 语言和 C 组件 + +迁移老业务页面时,有的业务会在native侧直接操作hippy的组件来实现一些联动。 +设计一套通用的跨语言操作接口给业务调用。接口对齐前端,从而减少业务理解成本。 + +正常前端操作、业务Native侵入操作、鸿蒙兼容方法对比图: + +![image](../../../assets/img/ohos_ts_op_c_comp.png) diff --git a/docs/assets/img/ohos_custom_c_comp.png b/docs/assets/img/ohos_custom_c_comp.png new file mode 100644 index 00000000000..8632a59548f Binary files /dev/null and b/docs/assets/img/ohos_custom_c_comp.png differ diff --git a/docs/assets/img/ohos_custom_ts_comp.png b/docs/assets/img/ohos_custom_ts_comp.png new file mode 100644 index 00000000000..798fcb68970 Binary files /dev/null and b/docs/assets/img/ohos_custom_ts_comp.png differ diff --git a/docs/assets/img/ohos_hippy_arch.png b/docs/assets/img/ohos_hippy_arch.png new file mode 100644 index 00000000000..5d8fe16d2c0 Binary files /dev/null and b/docs/assets/img/ohos_hippy_arch.png differ diff --git a/docs/assets/img/ohos_ts_op_c_comp.png b/docs/assets/img/ohos_ts_op_c_comp.png new file mode 100644 index 00000000000..5fa7708052f Binary files /dev/null and b/docs/assets/img/ohos_ts_op_c_comp.png differ diff --git a/docs/development/_sidebar.md b/docs/development/_sidebar.md index 5f1fef08ef3..37319a5631f 100644 --- a/docs/development/_sidebar.md +++ b/docs/development/_sidebar.md @@ -9,6 +9,7 @@ - [Android 3.x SDK升级指引](development/android-3.0-upgrade-guidelines.md) - [iOS 3.x SDK集成指引](development/ios-3.0-integration-guidelines.md) - [iOS 3.x SDK升级指引](development/ios-3.0-upgrade-guidelines.md) + - [Ohos SDK集成指引](development/ohos-integration-guidelines.md) - [Voltron/Flutter集成指引](development/voltron-flutter-integration-guidelines.md) - [自定义组件](development/native-component.md) - [自定义模块](development/native-module.md) diff --git a/docs/development/debug.md b/docs/development/debug.md index 9f2cda420d7..0128d09a1ec 100644 --- a/docs/development/debug.md +++ b/docs/development/debug.md @@ -61,6 +61,24 @@ Hippy 中运行的 JS 代码可以来源于本地文件(local file),或者远 } ``` +3. **Ohos**: + + ```typescript + // 初始化 hippy 引擎 + let initParams = new EngineInitParams(this.libHippy!, this.abilityContext!, this.getUIContext()) + // 可选:是否设置为 debug 模式,默认为 false。设置 true 为调试模式,所有 jsbundle 都将从 debug server 上下载 + initParams.debugMode = true; + initParams.debugServerHost = "192.168.76.25:38989"; // 这里请设置正确 JS Server 的 IP + ``` + +Hippy鸿蒙版本支持 [JSVM](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/jsvm-introduction-V5) 和 V8 两个JS引擎,JSVM 性能更好所以默认使用JSVM,不过可以自由切换。 +鸿蒙调试目前只适配好了V8,适配JSVM还在开发中,所以调试时需要切换到V8并打开调试代码。 +调试切换到V8的方法,两步: +- Hippy/driver/js/CMakeLists.txt 里:打开 set(JS_ENGINE "V8") 注释 set(JS_ENGINE "JSH") +- Hippy/framework/ohos/build-profile.json5 里 debug 配置下: "arguments": "-DENABLE_INSPECTOR=false",改为true。 (这个是为了打开 ENABLE_INSPECTOR 宏,让调试功能生效) + +另外,鸿蒙调试目前只支持网络调试(手机和JS Server在一个网络内,通过网络下载JS Bundle调试),数据线调试还在开发中。 + # 前端环境准备 1. 安装新一代调试工具: `npm i -D @hippy/debug-server-next@latest` @@ -178,6 +196,10 @@ Android 使用了 [adb](//developer.android.com/studio/command-line/adb) 的端 7. 回到手机上,[粘贴 bundleUrl](development/debug.md#config-bundle) 并启动调试 8. 当 JS 源码文件发生改动时,如已开启 HMR 或 Live-Reload,编译结束后会自动刷新;否则需要按 `Command + R` 或 `Command + D` 键调起 Reload 面板刷新 +## Ohos + +鸿蒙调试目前只支持网络调试(手机和JS Server在一个网络内,通过网络下载JS Bundle调试),数据线调试还在开发中。 + # Elements 可视化审查 > Android SDK 最低支持版本 2.9.0
diff --git a/docs/development/demo.md b/docs/development/demo.md index bb970335588..9f310b7c1c2 100644 --- a/docs/development/demo.md +++ b/docs/development/demo.md @@ -17,7 +17,7 @@ Demo的Native工程代码位于framework/examples目录,前端工程代码位 ### macOS开发环境 -可以在macOS上开发iOS,Android应用,请求根据需要进行环境配置。 +可以在macOS上开发iOS、Android、Ohos应用,请求根据需要进行环境配置。 首先,通过Homebrew包管理工具安装git, git-lfs, node(v16) and npm(v7) @@ -46,6 +46,11 @@ brew install git git-lfs node@16 cmake 通过android开发者平台下载安装[NDK](https://developer.android.com/ndk?hl=en) +#### 编译Ohos Demo环境准备 + +1. DevEco Studio + 通过Ohos开发者平台下载安装[DevEco Studio](https://developer.huawei.com/consumer/cn/download/) + ### Windows开发环境 可以Windows上开发Android应用,请安装以下依赖。 @@ -66,6 +71,7 @@ brew install git git-lfs node@16 cmake 通过指引安装[nodejs和npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm),建议使用Node v16,NPM v7版本 +也可以Windows上开发Ohos应用,请安装DevEco Studio、Git、Node和NPM。 ## 代码拉取 @@ -94,6 +100,12 @@ open HippyDemo.xcworkspace 2. 使用 USB 线连接 Android 设备,并确保设备 USB 调试模式已经开启(电脑 Terminal 执行 `adb devices` 检查手机连接状态)。 3. Android Studio 执行项目构建,并安装 APK运行。 +### 编译运行Ohos Demo + +1. 使用 DevEco Studio 打开根目录 `Ohos Project` 项目。 +2. 使用 USB 线连接 Ohos 设备,并确保设备 USB 调试模式已经开启。 +3. DevEco Studio 选择 Application `entry` 执行项目构建,并安装到手机运行。 + ### 效果预览 Demo运行起来后,可见Demo首页类似 diff --git a/docs/development/native-adapter.md b/docs/development/native-adapter.md index 494e032ea0c..39a189839c3 100644 --- a/docs/development/native-adapter.md +++ b/docs/development/native-adapter.md @@ -1,6 +1,6 @@ # 终端能力适配 -可以把 Native 的一些基础能力接口,抽象为 Adapter,方便业务注入实现。支持 Android、iOS、Flutter、Web(同构) 等平台。 +可以把 Native 的一些基础能力接口,抽象为 Adapter,方便业务注入实现。支持 Android、iOS、Ohos、Flutter、Web(同构) 等平台。
# Android @@ -168,6 +168,27 @@ HIPPY_EXPORT_MODULE() // 全局注册该模块至Hippy +
+
+
+ + +# Ohos + +--- + +Ohos App 开发中存在很多第三方基础库。 + +Hippy SDK 将所有基础能力接口化,抽象为 Adapter,方便业务注入实现,同时大多数基础能力我们也默认实现了一个最简单的方案。 + +Hippy SDK 现在所提供的 Adapter 包括: + +- `HippyHttpAdapter`:Http 请求 Adapter。 +- `HippyExceptionHandlerAdapter`:引擎和 JS 异常处理 Adapter。 +- `HippyStorageAdapter`:数据库(KEY-VALUE)Adapter。 +- `HippyExecutorSupplierAdapter`:线程池 Adapter。 +- `HippyEngineMonitorAdapter`:Hippy 引擎状态监控 Adapter。 +


diff --git a/docs/development/native-component.md b/docs/development/native-component.md index 3d242874b6c..9e6454a2a67 100644 --- a/docs/development/native-component.md +++ b/docs/development/native-component.md @@ -1,6 +1,6 @@ # 自定义组件 -App 开发中有可能使用到大量的UI组件,Hippy SDK 已包括其中常用的部分,如`View`、`Text`、`Image` 等,但这极有可能无法满足你的需求,这就需要对 UI 组件进行扩展封装。支持 Android、iOS、Flutter、Web(同构) 等平台。 +App 开发中有可能使用到大量的UI组件,Hippy SDK 已包括其中常用的部分,如`View`、`Text`、`Image` 等,但这极有可能无法满足你的需求,这就需要对 UI 组件进行扩展封装。支持 Android、iOS、Ohos、Flutter、Web(同构) 等平台。

@@ -313,6 +313,109 @@ HIPPY_EXPORT_METHOD(focus:(nonnull NSNumber *)reactTag callback:(HippyPromiseRes 到此,一个简单的`NativeRenderMyViewManager`与`NativeRenderMyView`创建完成。 +# Ohos + +--- + +## TS 组件扩展 + +我们将以`ExampleViewA`为例,从头介绍如何扩展组件。 +详细代码参考 [Demo](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-demo/src/main/ets/hippy_extend) + +扩展组件包括: + +1. 扩展 `HippyCustomComponentView`,实现组件View `ExampleViewA`,以及组件的属性处理函数 `setProp` 和方法调用函数 `call` +2. 实现组件 `ExampleComponentA` +3. 实现 `Builder` 函数关联组件View和组件,并配置到 `ModuleLoadParams` 参数 +4. 注册组件View `ExampleViewA` + +因为鸿蒙ArkUI是声明式组装组件的,`ExampleViewA` 相当于组件的数据模型,`ExampleComponentA` 是实际的声明式组件,通过 `Builder` 函数来构建组件,通过`@ObjectLink` 装饰器来绑定数据。 + +## 实现组件View + +```typescript +@Observed +export class ExampleViewA extends HippyCustomComponentView { + constructor(ctx: NativeRenderContext) { + super(ctx) + } + + setProp(propKey: string, propValue: HippyAny): boolean { + return super.setProp(propKey, propValue) + } + + call(method: string, params: Array, callback: HippyRenderCallback | null): void { + + } +} +``` + +## 实现组件 + +```typescript +@Component +export struct ExampleComponentA { + @ObjectLink renderView: ExampleViewA + @ObjectLink children: HippyObservedArray + + build() { + Stack() { + Text("This is a custom component A.") + ForEach(this.children, (item: HippyRenderBaseView) => { + buildHippyRenderView(item, null) + }, (item: HippyRenderBaseView) => item.tag + '') + } + .applyRenderViewBaseAttr(this.renderView) + } +} + +``` + +## 实现 `Builder` 函数并配置 + +实现: + +```typescript +@Builder +export function buildCustomRenderView($$: HippyRenderBaseView) { + if ($$ instanceof ExampleViewA) { + ExampleComponentA({ renderView: $$ as ExampleViewA, children: $$.children }) + } +} +``` + +配置: + +```typescript +loadParams.wrappedCustomRenderViewBuilder = wrapBuilder(buildCustomRenderView) +``` + +## 注册组件View + +继承 `HippyAPIProvider` 接口并注册自定义组件View: + +```typescript +export class ExampleAPIProvider implements HippyAPIProvider { + getCustomRenderViewCreatorMap(): Map | null { + let registerMap: Map = + new Map() + registerMap.set("ExampleViewA", + (ctx): HippyRenderBaseView => new ExampleViewA(ctx)) + return registerMap + } +} +``` + +配置 `ExampleAPIProvider` 到 `EngineInitParams` 参数: + +```typescript +params.providers = new Array(new ExampleAPIProvider()) +``` + +## C 组件扩展 + +详细代码参考 [Demo](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-demo/src/main/cpp/hippy_extend) + # Voltron diff --git a/docs/development/native-integration.md b/docs/development/native-integration.md index 1f343f07c26..259dcf1cd55 100644 --- a/docs/development/native-integration.md +++ b/docs/development/native-integration.md @@ -284,9 +284,10 @@ ENV['layout_engine'] = 'Yoga' ## Demo 体验 -Ohos Har Demo:Har 包方式依赖 Hippy。 体验方法:DevEco 打开 hippy 项目根目录运行 entry_har。 +- Ohos Har Demo:Har 包方式依赖 Hippy。 体验方法:DevEco 打开 hippy 项目根目录运行 entry_har。 +- Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目录直接运行 entry。 -Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目录直接运行 entry。 +> 注:一定是打开 Hippy 项目根目录,不是 Demo 的根目录 ## 接入方式一:Har包快速接入 @@ -294,20 +295,37 @@ Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目 ### 2. Har 包集成 -- 配置 oh-package.json5 +- 配置 oh-package.json5,依赖 Hippy har 包 + +依赖远程 [ohpm](https://ohpm.openharmony.cn/) 上 Har 包: + + ```json + "dependencies": { + "hippy": "3.3.0" + } + ``` + +或者依赖本地 Har 包: ```json "dependencies": { - "hippy": "1.3.0" + "hippy": "file:./libs/hippy.har" } ``` +- Hippy har包产物构建方法: + - DevEco Studio 打开 Hippy 根目录 + - DevEco Studio 里 Build Mode 选择 release 或 debug + - DevEco Studio 里选择 Hippy 模块下文件,比如选择 /framework/ohos/src/main/cpp/CMakeLists.txt + - DevEco Studio 菜单里 Build - Make Module 'hippy' + - 目录 /framework/ohos/build/default/outputs/default/ 里生成 hippy.har + ### 3. 初始化代码 - 获取 libhippy.so 接口对象和 UIAbility context ```TypeScript - import libHippy from 'libhippy.so' + import libHippy from 'libhippy.so' // libhippy.so下面可能会有红线提示,可忽略 AppStorage.setOrCreate("libHippy", libHippy) AppStorage.setOrCreate("abilityContext", this.context) ``` @@ -315,13 +333,15 @@ Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目 > 注:App 直接集成 Hippy,context 使用 UIAbility context;如果 App 在一个模块里集成 Hippy,js 等资源也集成在模块里,context 使用 getContext().createModuleContext("moduleName"),否则会找不到 js 等资源。 - 创建 HippyEngine、初始化 HippyEngine、加载业务 bundle - + ```TypeScript this.hippyEngine = createHippyEngine(params) this.hippyEngine.initEngine() this.hippyEngine?.loadModule() ``` - + +> 注:loadModule 需要在 initEngine 成功后调用,即回调结果返回 EngineInitStatus.STATUS_OK 后 + - 组装 HippyRoot 组件 ```TypeScript @@ -333,8 +353,10 @@ Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目 }, }) ``` - -具体可以参考 [Har Demo](https://github.com/sohotz/Hippy/tree/main/framework/examples/ohos-har-demo) 工程中 `EntryAbility.ets` `Index.ets` 实现 + +> 注:确保这里 this.hippyEngine 和 this.rootViewWrapper 是有效值 + +具体可以参考 [Har Demo](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-har-demo) 工程中 `EntryAbility.ets` `Index.ets` 实现 ## 接入方式二:源码接入 @@ -344,11 +366,11 @@ Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目 ### 2. Hippy 代码集成 -- 拉取 hippy 代码到项目里(比如:根目录下) +- 拉取 hippy 代码到项目里(比如:根目录下,IDE 限制 Hippy 源代码一定要在依赖 Hippy 的项目/模块的目录或子目录里,否则编译会报ets文件路径无法解决的错误) -> https://github.com/sohotz/Hippy.git,分支:main +> https://github.com/Tencent/Hippy.git,分支:main -- 配置 oh-package.json5 +- 配置 oh-package.json5,依赖 Hippy 文件目录 ```json "dependencies": { @@ -356,7 +378,44 @@ Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目 } ``` -### 3. 初始化代码 +### 3. Hippy C++ 代码编译配置 + +- 如果业务模块没有使用 C++,需 build-profile.json5 里配置使用,如下 + + ```json + "externalNativeOptions": { + "path": "./src/main/cpp/CMakeLists.txt", + "arguments": "", + "cppFlags": "", + }, +``` + +- CMakeLists.txt 内容如下 + + ```cmake +cmake_minimum_required(VERSION 3.14) +project(hippy) + +set(BIZ_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../") +set(HIPPY_ROOT_DIR "${BIZ_ROOT_DIR}/Hippy_src/framework/ohos/") +set(HIPPY_IMPL_CPP_DIR "${HIPPY_ROOT_DIR}/src/main/cpp/impl") + +add_subdirectory("${HIPPY_IMPL_CPP_DIR}" ./hippy_impl) + +add_library(${PROJECT_NAME} SHARED + +) + +target_link_libraries(${PROJECT_NAME} PUBLIC hippy_impl) + +set(SOURCE_SET + ) +set(PUBLIC_SOURCE_SET + ) +target_sources(${PROJECT_NAME} PRIVATE ${SOURCE_SET} PUBLIC ${PUBLIC_SOURCE_SET}) + ``` + +### 4. 初始化代码 - 获取 libhippy.so 接口对象和 UIAbility context @@ -386,11 +445,12 @@ Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目 }) ``` -具体可以参考 [Demo](https://github.com/sohotz/Hippy/tree/main/framework/examples/ohos-demo) 工程中 `EntryAbility.ets` `ExampleHippyPage.ets` 实现 +具体可以参考 [Demo](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-demo) 工程中 `EntryAbility.ets` 等实现 ## 接入方式三:定制场景接入 -- 对于需要直接依赖 hippy c++ 代码编译使用的定制场景,可参考 [Demo](https://github.com/sohotz/Hippy/tree/main/framework/examples/ohos-demo) 工程中 `CMakeLists.txt` 说明 +- 对于需要直接依赖 hippy c++ 代码编译使用的定制场景,可参考 [Demo](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-demo) 工程中 `CMakeLists.txt` 说明 + # Voltron/Flutter diff --git a/docs/development/native-module.md b/docs/development/native-module.md index 1fa924fb13e..2763ac6dd7e 100644 --- a/docs/development/native-module.md +++ b/docs/development/native-module.md @@ -1,6 +1,6 @@ # 自定义终端模块 -很多时候 JS 需要访问对应终端的一些能力模块,比如数据库、下载、网络请求等,这时候就需要使用 Module 来暴露接口给JS使用。Hippy SDK 中默认实现了部分 Module,但这极有可能无法满足你的需求,这就需要你对 Module 进行扩展封装。Hippy支持 Android、iOS、Flutter、Web(同构) 等平台的模块扩展。 +很多时候 JS 需要访问对应终端的一些能力模块,比如数据库、下载、网络请求等,这时候就需要使用 Module 来暴露接口给JS使用。Hippy SDK 中默认实现了部分 Module,但这极有可能无法满足你的需求,这就需要你对 Module 进行扩展封装。Hippy支持 Android、iOS、Ohos、Flutter、Web(同构) 等平台的模块扩展。
@@ -274,23 +274,24 @@ HIPPY_EXPORT_METHOD(click) { @end ``` -# 鸿蒙 +# Ohos -很多时候 `JS` 需要访问对应终端的一些能力模块,比如数据库、下载、网络请求等,这时候就需要使用 `Module` 来暴露接口给JS使用。Voltron SDK 中默认实现了部分 `Module`,但这极有可能无法满足你的需求,这就需要你对 `Module` 进行扩展封装。 +很多时候 `JS` 需要访问对应终端的一些能力模块,比如数据库、下载、网络请求等,这时候就需要使用 `Module` 来暴露接口给JS使用。Ohos SDK 中默认实现了部分 `Module`,但这极有可能无法满足你的需求,这就需要你对 `Module` 进行扩展封装。 --- ## Module扩展 -我们将以 `TestModule` 为例,从头扩展一个 `Module`,这个 `Module` 将展示前端如何调用终端能力,并且把结果返回给前端 +我们将以 `ExampleNativeModule` 为例,从头扩展一个 `Module`,这个 `Module` 将展示前端如何调用终端能力,并且把结果返回给前端。 -终端扩展 `Module` 包括四步: +终端扩展 `Module` 的步骤: -1. 创建 `TestModule` -2. 实现导出给 `JS` 的方法。 -3. 注册 `Module`。 +1. 创建 `HippyNativeModuleBase` 的子类。 +2. 实现导出给 JS 的方法。 +3. 注册 Module。 +4. 注册 HippyAPIProvider。 -## 1. 创建 `TestModule`,并且继承 HippyNativeModuleBase +## 1. 创建 HippyNativeModuleBase 的子类 ```typescript export class ExampleNativeModule extends HippyNativeModuleBase { @@ -350,7 +351,6 @@ export class ExampleNativeModule extends HippyNativeModuleBase { } } - ``` 需要注意的是,这里与Android、iOS有几处不同。 @@ -359,6 +359,32 @@ export class ExampleNativeModule extends HippyNativeModuleBase { 2. 需要实现 call 方法 +## 2. 实现导出给 JS 的方法 + +例子见上一步 call 方法的实现。 + +## 3. 注册 Module + +```typescript +export class ExampleAPIProvider implements HippyAPIProvider { + getCustomNativeModuleCreatorMap(): Map | null { + let registerMap: Map = + new Map() + registerMap.set(ExampleNativeModule.NAME, + (ctx): HippyNativeModuleBase => new ExampleNativeModule(ctx)) + return registerMap; + } +} +``` + +## 4. 注册 HippyAPIProvider + +在 HippyEngine 初始化的 EngineInitParams 参数属性中设置 providers。 + +```typescript +params.providers = new Array(new ExampleAPIProvider()) +``` + ## Turbo Module扩展 和 Module 的扩展一致,不过还需要配置 isTurbo 方法,且不需要实现 call 方法,参考如下: diff --git a/docs/development/ohos-integration-guidelines.md b/docs/development/ohos-integration-guidelines.md new file mode 100644 index 00000000000..56788dfa8df --- /dev/null +++ b/docs/development/ohos-integration-guidelines.md @@ -0,0 +1,188 @@ +# Hippy Ohos SDK集成指引 + +这篇教程,讲述了如何将 Hippy SDK 集成到一个现有的 Ohos 工程。 + +> 注:以下文档都是假设您已经具备一定的 Ohos 开发经验。 + +--- + +## 前期准备 + +- 已经安装 DevEco Studio 最新版本 + +## Demo 体验 + +- Ohos Har Demo:Har 包方式依赖 Hippy。 体验方法:DevEco 打开 hippy 项目根目录运行 entry_har。 +- Ohos Demo:源码依赖 Hippy。体验方法:DevEco 打开 hippy 项目根目录直接运行 entry。 + +> 注:一定是打开 Hippy 项目根目录,不是 Demo 的根目录 + +## 接入方式一:Har包快速接入 + +### 1. 创建一个 Ohos 工程 + +### 2. Har 包集成 + +- 配置 oh-package.json5,依赖 Hippy har 包 + +依赖远程 [ohpm](https://ohpm.openharmony.cn/) 上 Har 包: + + ```json + "dependencies": { + "hippy": "3.3.0" + } + ``` + +或者依赖本地 Har 包: + + ```json + "dependencies": { + "hippy": "file:./libs/hippy.har" + } + ``` + +- Hippy har包产物构建方法: + - DevEco Studio 打开 Hippy 根目录 + - DevEco Studio 里 Build Mode 选择 release 或 debug + - DevEco Studio 里选择 Hippy 模块下文件,比如选择 /framework/ohos/src/main/cpp/CMakeLists.txt + - DevEco Studio 菜单里 Build - Make Module 'hippy' + - 目录 /framework/ohos/build/default/outputs/default/ 里生成 hippy.har + +### 3. 初始化代码 + +- 获取 libhippy.so 接口对象和 UIAbility context + + ```TypeScript + import libHippy from 'libhippy.so' // libhippy.so下面可能会有红线提示,可忽略 + AppStorage.setOrCreate("libHippy", libHippy) + AppStorage.setOrCreate("abilityContext", this.context) + ``` + +> 注:App 直接集成 Hippy,context 使用 UIAbility context;如果 App 在一个模块里集成 Hippy,js 等资源也集成在模块里,context 使用 getContext().createModuleContext("moduleName"),否则会找不到 js 等资源。 + +- 创建 HippyEngine、初始化 HippyEngine、加载业务 bundle + + ```TypeScript + this.hippyEngine = createHippyEngine(params) + this.hippyEngine.initEngine() + this.hippyEngine?.loadModule() + ``` + +> 注:loadModule 需要在 initEngine 成功后调用,即回调结果返回 EngineInitStatus.STATUS_OK 后 + +- 组装 HippyRoot 组件 + + ```TypeScript + HippyRoot({ + hippyEngine: this.hippyEngine, + rootViewWrapper: this.rootViewWrapper, + onRenderException: (exception: HippyException) => { + this.exception = `${exception.message}\n${exception.stack}` + }, + }) + ``` + +> 注:确保这里 this.hippyEngine 和 this.rootViewWrapper 是有效值 + +具体可以参考 [Har Demo](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-har-demo) 工程中 `EntryAbility.ets` `Index.ets` 实现 + +## 接入方式二:源码接入 + +> 源码接入主要为了方便在 App 项目里直接调试 Hippy 代码(c++ 和 ets 代码)。 + +### 1. 创建一个 Ohos 工程 + +### 2. Hippy 代码集成 + +- 拉取 hippy 代码到项目里(比如:根目录下,IDE 限制 Hippy 源代码一定要在依赖 Hippy 的项目/模块的目录或子目录里,否则编译会报ets文件路径无法解决的错误) + +> https://github.com/Tencent/Hippy.git,分支:main + +- 配置 oh-package.json5,依赖 Hippy 文件目录 + + ```json + "dependencies": { + "hippy": "file:../Hippy/framework/ohos/" + } + ``` + +### 3. Hippy C++ 代码编译配置 + +- 如果业务模块没有使用 C++,需 build-profile.json5 里配置使用,如下 + + ```json + "externalNativeOptions": { + "path": "./src/main/cpp/CMakeLists.txt", + "arguments": "", + "cppFlags": "", + }, +``` + +- CMakeLists.txt 内容如下 + + ```cmake +cmake_minimum_required(VERSION 3.14) +project(hippy) + +set(BIZ_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../") +set(HIPPY_ROOT_DIR "${BIZ_ROOT_DIR}/Hippy_src/framework/ohos/") +set(HIPPY_IMPL_CPP_DIR "${HIPPY_ROOT_DIR}/src/main/cpp/impl") + +add_subdirectory("${HIPPY_IMPL_CPP_DIR}" ./hippy_impl) + +add_library(${PROJECT_NAME} SHARED + +) + +target_link_libraries(${PROJECT_NAME} PUBLIC hippy_impl) + +set(SOURCE_SET + ) +set(PUBLIC_SOURCE_SET + ) +target_sources(${PROJECT_NAME} PRIVATE ${SOURCE_SET} PUBLIC ${PUBLIC_SOURCE_SET}) + ``` + +### 4. 初始化代码 + +- 获取 libhippy.so 接口对象和 UIAbility context + + ```TypeScript + import libHippy from 'libhippy.so' + AppStorage.setOrCreate("libHippy", libHippy) + AppStorage.setOrCreate("abilityContext", this.context) + ``` + +- 创建 HippyEngine、初始化 HippyEngine、加载业务 bundle + + ```TypeScript + this.hippyEngine = createHippyEngine(params) + this.hippyEngine.initEngine() + this.hippyEngine?.loadModule() + ``` + +- 组装 HippyRoot 组件 + + ```TypeScript + HippyRoot({ + hippyEngine: this.hippyEngine, + rootViewWrapper: this.rootViewWrapper, + onRenderException: (exception: HippyException) => { + this.exception = `${exception.message}\n${exception.stack}` + }, + }) + ``` + +具体可以参考 [Demo](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-demo) 工程中 `EntryAbility.ets` 等实现 + +## 接入方式三:定制场景接入 + +- 对于需要直接依赖 hippy c++ 代码编译使用的定制场景,可参考 [Demo](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-demo) 工程中 `CMakeLists.txt` 说明 + +## Hippy Har 包大小 + +- 最终集成的 Release Har 包大小为1.9M。 + +> 构建的 Har 包较大说明: +为了方便定位crash,配置了debugSymbol strip为false,构建的har包里so带详细符号,所以size较大,App集成后会自动strip掉符号变小。 +比如:har包有3.8M,其中解压后libhippy.so大小为13.9M,strip符号变小后har包大小为1.9M,解压后so大小为6.2M。 diff --git a/docs/feature/feature2.0/custom-font.md b/docs/feature/feature2.0/custom-font.md index 5c5433c09ed..4459070889c 100644 --- a/docs/feature/feature2.0/custom-font.md +++ b/docs/feature/feature2.0/custom-font.md @@ -66,3 +66,50 @@ Android 只需要在静态资源 `assets` 目录中建立 `fonts` 目录,然 需要注意的是,字体文件名需要和 FontFamily 一致,因为 Android 虽然也可以做字体文件名映射,但是字体和文件名一致无疑是最简单的办法。 > 官方 demo 的字体放在 [res/fonts](https://github.com/Tencent/Hippy/tree/master/examples/android-demo/res) 目录下,是因为编译脚本[将 `res` 目录下的文件直接拷贝到 `assets` 目录](https://github.com/Tencent/Hippy/blob/master/examples/android-demo/build.gradle#L35)下了,所以 `res/assets` 就变成 `assets/assets` 目录,为了让字体目录正确拷贝进 `assets` 静态资源目录,只能让它放在 `res` 下。 + +# Ohos + +## 整合字体文件 + +Ohos 只需要在静态资源 `resfile` 目录中建立 `fonts` 目录,然后把字体文件拷贝进去即可。 +当前其它目录也可以,也可以下载字体文件到某个目录。 + +需要注意的是,字体文件名需要和 FontFamily 一致,因为虽然也可以做字体文件名映射,但是字体和文件名一致无疑是最简单的办法。 + +> 官方 demo 的字体目录参考 [resfile/fonts](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-demo/src/main/resources/resfile/fonts) + +## 注册字体 + +```typescript +let fontPath = this.context.resourceDir + '/fonts/TTTGB.otf' +font.registerFont({ + familyName: 'TTTGB', + familySrc: `file://${fontPath}` +}) +``` + +具体代码可参考 Demo 里 [EntryAbility.ets](https://github.com/Tencent/Hippy/blob/main/framework/examples/ohos-demo/src/main/ets/entryability/EntryAbility.ets) + +## 配置字体路径到 C 层 + +继承 `HippyAPIProvider` 接口并配置自定义字体 familyName 和文件路径: + +```typescript +export class ExampleAPIProvider implements HippyAPIProvider { + // 注册字体路径至hippy测量函数 + getCustomFontPathMap(): Map | null { + let map = new Map(); + // 暂时hardcode路径在此,生产环境应通过Context属性获取字体文件路径 + map.set("TTTGB", "/data/storage/el1/bundle/entry/resources/resfile/fonts/TTTGB.otf"); + return map + } +} +``` + +具体代码可参考 Demo 里 [ExampleAPIProvider.ets](https://github.com/Tencent/Hippy/blob/main/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleAPIProvider.ets) + +配置 `ExampleAPIProvider` 到 `EngineInitParams` 参数: + +```typescript +params.providers = new Array(new ExampleAPIProvider()) +``` diff --git a/docs/feature/feature2.0/jsi.md b/docs/feature/feature2.0/jsi.md index 49298610347..5c478ac738e 100644 --- a/docs/feature/feature2.0/jsi.md +++ b/docs/feature/feature2.0/jsi.md @@ -244,7 +244,7 @@ export class TurboConfig { | napi_object | Object | | NULL | null | -更多示例可参考类[DemoTurboModule](https://github.com/sohotz/Hippy/blob/main/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleNativeTurboModule.ets) +更多示例可参考类[DemoTurboModule](https://github.com/Tencent/Hippy/blob/main/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleNativeTurboModule.ets) * 注册TurboModule模块,跟NativeModule注册方法完全一致 diff --git a/dom/CMakeLists.txt b/dom/CMakeLists.txt index 7cba289b8ae..af4d0ebcb07 100644 --- a/dom/CMakeLists.txt +++ b/dom/CMakeLists.txt @@ -52,6 +52,21 @@ if (NOT DEFINED LAYOUT_ENGINE) endif () if ("${LAYOUT_ENGINE}" STREQUAL "Yoga") + set(USE_YOGA 1) + target_compile_definitions(${PROJECT_NAME} PRIVATE "LAYOUT_ENGINE_YOGA") +elseif ("${LAYOUT_ENGINE}" STREQUAL "Taitank") + set(USE_TAITANK 1) + target_compile_definitions(${PROJECT_NAME} PRIVATE "LAYOUT_ENGINE_TAITANK") +elseif ("${LAYOUT_ENGINE}" STREQUAL "YogaAndTaitank") + set(USE_YOGA 1) + set(USE_TAITANK 1) + target_compile_definitions(${PROJECT_NAME} PRIVATE "LAYOUT_ENGINE_YOGA_AND_TAITANK") +else () + message(FATAL_ERROR "Layout Engine ${LAYOUT_ENGINE} is not supported") +endif () +# endregion + +if (USE_YOGA STREQUAL 1) if (ANDROID) InfraPackage_Add(yoga REMOTE "dom/third_party/yoga/1.19.0/git-repo.tgz" @@ -63,18 +78,16 @@ if ("${LAYOUT_ENGINE}" STREQUAL "Yoga") LOCAL "third_party/yoga" ) endif () - target_compile_definitions(${PROJECT_NAME} PRIVATE "USE_YOGA") target_link_libraries(${PROJECT_NAME} PRIVATE yogacore) -elseif ("${LAYOUT_ENGINE}" STREQUAL "Taitank") +endif () + +if (USE_TAITANK STREQUAL 1) InfraPackage_Add(taitank REMOTE "dom/third_party/taitank/1.0.6/git-repo.tar.gz" LOCAL "third_party/taitank" ) target_link_libraries(${PROJECT_NAME} PRIVATE taitank) -else () - message(FATAL_ERROR "Layout Engine ${LAYOUT_ENGINE} is not supported") endif () -# endregion # region source set set(SOURCE_SET @@ -95,9 +108,10 @@ set(SOURCE_SET src/dom/root_node.cc src/dom/scene.cc src/dom/scene_builder.cc) -if (${LAYOUT_ENGINE} STREQUAL "Yoga") +if (USE_YOGA STREQUAL 1) list(APPEND SOURCE_SET src/dom/yoga_layout_node.cc) -elseif (${LAYOUT_ENGINE} STREQUAL "Taitank") +endif () +if (USE_TAITANK STREQUAL 1) list(APPEND SOURCE_SET src/dom/taitank_layout_node.cc) endif () target_sources(${PROJECT_NAME} PRIVATE ${SOURCE_SET}) diff --git a/dom/include/dom/dom_node.h b/dom/include/dom/dom_node.h index ea9900ed1d2..6489996b312 100644 --- a/dom/include/dom/dom_node.h +++ b/dom/include/dom/dom_node.h @@ -95,9 +95,9 @@ class DomNode : public std::enable_shared_from_this { DomNode(uint32_t id, uint32_t pid, int32_t index, std::string tag_name, std::string view_name, std::shared_ptr>> style_map, std::shared_ptr>> dom_ext_map, - std::weak_ptr weak_root_node); + std::weak_ptr weak_root_node, LayoutEngineType layout_engine_type); - DomNode(uint32_t id, uint32_t pid, std::weak_ptr weak_root_node); + DomNode(uint32_t id, uint32_t pid, std::weak_ptr weak_root_node, LayoutEngineType layout_engine_type); DomNode(); virtual ~DomNode(); diff --git a/dom/include/dom/layout_node.h b/dom/include/dom/layout_node.h index c0234b31c78..0f21b008636 100644 --- a/dom/include/dom/layout_node.h +++ b/dom/include/dom/layout_node.h @@ -131,8 +131,14 @@ class LayoutNode { virtual void ResetLayoutCache() = 0; }; -void InitLayoutConsts(); -std::shared_ptr CreateLayoutNode(); +enum LayoutEngineType { + LayoutEngineDefault = 0, + LayoutEngineTaitank, + LayoutEngineYoga +}; + +void InitLayoutConsts(LayoutEngineType type); +std::shared_ptr CreateLayoutNode(LayoutEngineType type); } // namespace dom } // namespace hippy diff --git a/dom/include/dom/root_node.h b/dom/include/dom/root_node.h index e2a7a79059e..83efe3d0406 100644 --- a/dom/include/dom/root_node.h +++ b/dom/include/dom/root_node.h @@ -71,7 +71,7 @@ class RootNode : public DomNode { using EventCallback = std::function&)>; using EventCallBackRunner = std::function&)>; - RootNode(uint32_t id); + RootNode(uint32_t id, LayoutEngineType layout_engine_type = LayoutEngineDefault); RootNode(); inline std::weak_ptr GetDomManager() { return dom_manager_; } @@ -117,6 +117,8 @@ class RootNode : public DomNode { } std::vector> GetAllTextNodes(); + + LayoutEngineType GetLayoutEngineType() { return layout_engine_type_; } private: static void MarkLayoutNodeDirty(const std::vector>& nodes); @@ -149,6 +151,8 @@ class RootNode : public DomNode { std::unique_ptr style_differ_; bool disable_set_root_size_ { false }; + + LayoutEngineType layout_engine_type_ = LayoutEngineDefault; static footstone::utils::PersistentObjectMap> persistent_map_; }; diff --git a/dom/include/dom/taitank_layout_node.h b/dom/include/dom/taitank_layout_node.h index 14854b71389..a0063030c07 100644 --- a/dom/include/dom/taitank_layout_node.h +++ b/dom/include/dom/taitank_layout_node.h @@ -395,5 +395,9 @@ class TaitankLayoutNode : public LayoutNode, public std::enable_shared_from_this MeasureFunction measure_function_ = nullptr; }; + +void InitLayoutConstsTaitank(); +std::shared_ptr CreateLayoutNodeTaitank(); + } // namespace dom } // namespace hippy diff --git a/dom/include/dom/yoga_layout_node.h b/dom/include/dom/yoga_layout_node.h index 48906156e9c..cfe673eba68 100644 --- a/dom/include/dom/yoga_layout_node.h +++ b/dom/include/dom/yoga_layout_node.h @@ -174,5 +174,8 @@ class YogaLayoutNode : public LayoutNode, public std::enable_shared_from_this CreateLayoutNodeYoga(); + } // namespace dom } // namespace hippy diff --git a/dom/src/dom/dom_node.cc b/dom/src/dom/dom_node.cc index 6c7d68adc90..2d45df8ffd7 100644 --- a/dom/src/dom/dom_node.cc +++ b/dom/src/dom/dom_node.cc @@ -63,7 +63,7 @@ using HippyValueObjectType = footstone::value::HippyValue::HippyValueObjectType; DomNode::DomNode(uint32_t id, uint32_t pid, int32_t index, std::string tag_name, std::string view_name, std::shared_ptr>> style_map, std::shared_ptr>> dom_ext_map, - std::weak_ptr weak_root_node) + std::weak_ptr weak_root_node, LayoutEngineType layout_engine_type) : id_(id), pid_(pid), index_(index), @@ -76,13 +76,13 @@ DomNode::DomNode(uint32_t id, uint32_t pid, int32_t index, std::string tag_name, current_callback_id_(0), func_cb_map_(nullptr), event_listener_map_(nullptr) { - layout_node_ = hippy::dom::CreateLayoutNode(); + layout_node_ = hippy::dom::CreateLayoutNode(layout_engine_type); } -DomNode::DomNode(uint32_t id, uint32_t pid, std::weak_ptr weak_root_node) - : DomNode(id, pid, 0, "", "", nullptr, nullptr, std::move(weak_root_node)) {} +DomNode::DomNode(uint32_t id, uint32_t pid, std::weak_ptr weak_root_node, LayoutEngineType layout_engine_type) + : DomNode(id, pid, 0, "", "", nullptr, nullptr, std::move(weak_root_node), layout_engine_type) {} -DomNode::DomNode() : DomNode(0, 0, {}) {} +DomNode::DomNode() : DomNode(0, 0, {}, LayoutEngineDefault) {} DomNode::~DomNode() = default; diff --git a/dom/src/dom/layout_node.cc b/dom/src/dom/layout_node.cc index f8455b1f026..8700b977b47 100644 --- a/dom/src/dom/layout_node.cc +++ b/dom/src/dom/layout_node.cc @@ -19,6 +19,14 @@ */ #include "dom/layout_node.h" +#if defined(LAYOUT_ENGINE_YOGA) +#include "dom/yoga_layout_node.h" +#elif defined(LAYOUT_ENGINE_TAITANK) +#include "dom/taitank_layout_node.h" +#elif defined(LAYOUT_ENGINE_YOGA_AND_TAITANK) +#include "dom/yoga_layout_node.h" +#include "dom/taitank_layout_node.h" +#endif namespace hippy { inline namespace dom { @@ -27,5 +35,33 @@ LayoutNode::LayoutNode() = default; LayoutNode::~LayoutNode() = default; +void InitLayoutConsts(LayoutEngineType type) { +#if defined(LAYOUT_ENGINE_YOGA) + InitLayoutConstsYoga(); +#elif defined(LAYOUT_ENGINE_TAITANK) + InitLayoutConstsTaitank(); +#elif defined(LAYOUT_ENGINE_YOGA_AND_TAITANK) + if (type == LayoutEngineYoga) { + InitLayoutConstsYoga(); + } else { + InitLayoutConstsTaitank(); + } +#endif +} + +std::shared_ptr CreateLayoutNode(LayoutEngineType type) { +#if defined(LAYOUT_ENGINE_YOGA) + return CreateLayoutNodeYoga(); +#elif defined(LAYOUT_ENGINE_TAITANK) + return CreateLayoutNodeTaitank(); +#elif defined(LAYOUT_ENGINE_YOGA_AND_TAITANK) + if (type == LayoutEngineYoga) { + return CreateLayoutNodeYoga(); + } else { + return CreateLayoutNodeTaitank(); + } +#endif +} + } // namespace dom } // namespace hippy diff --git a/dom/src/dom/root_node.cc b/dom/src/dom/root_node.cc index d3b950748ad..f5c1b836ec0 100644 --- a/dom/src/dom/root_node.cc +++ b/dom/src/dom/root_node.cc @@ -100,8 +100,9 @@ bool DomNodeStyleDiffer::Calculate(const std::shared_ptr& return true; } -RootNode::RootNode(uint32_t id) : DomNode(id, 0, 0, "", "", nullptr, nullptr, {}) { - InitLayoutConsts(); +RootNode::RootNode(uint32_t id, LayoutEngineType layout_engine_type) : DomNode(id, 0, 0, "", "", nullptr, nullptr, {}, layout_engine_type) { + layout_engine_type_ = layout_engine_type; + InitLayoutConsts(layout_engine_type); SetRenderInfo({id, 0, 0}); animation_manager_ = std::make_shared(); interceptors_.push_back(animation_manager_); diff --git a/dom/src/dom/taitank_layout_node.cc b/dom/src/dom/taitank_layout_node.cc index b22a47dbf7b..82929b3ef0b 100644 --- a/dom/src/dom/taitank_layout_node.cc +++ b/dom/src/dom/taitank_layout_node.cc @@ -826,13 +826,13 @@ void TaitankLayoutNode::Deallocate() { engine_node_ = nullptr; } -void InitLayoutConsts() { +void InitLayoutConstsTaitank() { if (global_layout_consts == nullptr) { global_layout_consts = new TaitankLayoutConsts(); } } -std::shared_ptr CreateLayoutNode() { return std::make_shared(); } +std::shared_ptr CreateLayoutNodeTaitank() { return std::make_shared(); } } // namespace dom } // namespace hippy diff --git a/dom/src/dom/yoga_layout_node.cc b/dom/src/dom/yoga_layout_node.cc index 87929a8847c..bf9bd35dc0f 100644 --- a/dom/src/dom/yoga_layout_node.cc +++ b/dom/src/dom/yoga_layout_node.cc @@ -777,8 +777,8 @@ void YogaLayoutNode::Deallocate() { YGConfigFree(yoga_config_); } -void InitLayoutConsts() {} -std::shared_ptr CreateLayoutNode() { return std::make_shared(); } +void InitLayoutConstsYoga() {} +std::shared_ptr CreateLayoutNodeYoga() { return std::make_shared(); } } // namespace dom } // namespace hippy diff --git a/driver/js/src/modules/scene_builder_module.cc b/driver/js/src/modules/scene_builder_module.cc index f60691388a8..aff4ac34dde 100644 --- a/driver/js/src/modules/scene_builder_module.cc +++ b/driver/js/src/modules/scene_builder_module.cc @@ -287,6 +287,8 @@ CreateNode(const std::shared_ptr &context, auto ext = std::make_shared>>( std::move(std::get<3>(props_tuple))); FOOTSTONE_CHECK(!scope->GetDomManager().expired()); + auto root_node = scope->GetRootNode().lock(); + LayoutEngineType layout_type = root_node ? root_node->GetLayoutEngineType() : LayoutEngineDefault; dom_node = std::make_shared(std::get<2>(id_tuple), std::get<2>(pid_tuple), 0, @@ -294,7 +296,8 @@ CreateNode(const std::shared_ptr &context, std::move(u8_view_name), style, ext, - scope->GetRootNode()); + scope->GetRootNode(), + layout_type); return std::make_tuple(true, "", dom_node); } @@ -496,11 +499,14 @@ std::shared_ptr> RegisterSceneBuilder(const std::wea if (length >= 2) { auto ref_info_tuple = CreateRefInfo( context, context->CopyArrayElement(info, 1), scope); + auto root_node = scope->GetRootNode().lock(); + LayoutEngineType layout_type = root_node ? root_node->GetLayoutEngineType() : LayoutEngineDefault; dom_infos.push_back(std::make_shared( std::make_shared( std::get<2>(id_tuple), std::get<2>(pid_tuple), - scope->GetRootNode()), + scope->GetRootNode(), + layout_type), std::get<2>(ref_info_tuple), nullptr)); } @@ -543,11 +549,14 @@ std::shared_ptr> RegisterSceneBuilder(const std::wea return nullptr; } + auto root_node = scope->GetRootNode().lock(); + LayoutEngineType layout_type = root_node ? root_node->GetLayoutEngineType() : LayoutEngineDefault; dom_infos.push_back(std::make_shared( std::make_shared( std::get<2>(id_tuple), std::get<2>(pid_tuple), - scope->GetRootNode()), + scope->GetRootNode(), + layout_type), nullptr, nullptr)); } } diff --git a/framework/examples/ohos-c-demo/.gitignore b/framework/examples/ohos-c-demo/.gitignore new file mode 100644 index 00000000000..e2713a2779c --- /dev/null +++ b/framework/examples/ohos-c-demo/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/build-profile.json5 b/framework/examples/ohos-c-demo/build-profile.json5 new file mode 100644 index 00000000000..10f76b146a6 --- /dev/null +++ b/framework/examples/ohos-c-demo/build-profile.json5 @@ -0,0 +1,39 @@ +{ + "apiType": "stageMode", + "buildOption": { + "externalNativeOptions": { + "path": "./src/main/cpp/CMakeLists.txt", + "arguments": "", + "cppFlags": "", + } + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + }, + "nativeLib": { + "debugSymbol": { + "strip": true, + "exclude": [] + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} diff --git a/framework/examples/ohos-c-demo/hvigorfile.ts b/framework/examples/ohos-c-demo/hvigorfile.ts new file mode 100644 index 00000000000..c6edcd90486 --- /dev/null +++ b/framework/examples/ohos-c-demo/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/framework/examples/ohos-c-demo/obfuscation-rules.txt b/framework/examples/ohos-c-demo/obfuscation-rules.txt new file mode 100644 index 00000000000..c06d2a7bfb6 --- /dev/null +++ b/framework/examples/ohos-c-demo/obfuscation-rules.txt @@ -0,0 +1,43 @@ +# +# Tencent is pleased to support the open source community by making +# Hippy available. +# +# Copyright (C) 2022 THL A29 Limited, a Tencent company. +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation diff --git a/framework/examples/ohos-c-demo/oh-package.json5 b/framework/examples/ohos-c-demo/oh-package.json5 new file mode 100644 index 00000000000..88106fc0820 --- /dev/null +++ b/framework/examples/ohos-c-demo/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "name": "entry_c", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": { + "hippy": "file:../../ohos/", + "libdemo.so": "file:./src/main/cpp/types/libdemo" + } +} diff --git a/framework/examples/ohos-c-demo/src/main/cpp/CMakeLists.txt b/framework/examples/ohos-c-demo/src/main/cpp/CMakeLists.txt new file mode 100644 index 00000000000..1a759cc6ca7 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/cpp/CMakeLists.txt @@ -0,0 +1,38 @@ +# +# Tencent is pleased to support the open source community by making +# Hippy available. +# +# Copyright (C) 2022 THL A29 Limited, a Tencent company. +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +cmake_minimum_required(VERSION 3.5.0) +project(demo) + +set(DEMO_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../") +set(PROJECT_ROOT_DIR "${DEMO_ROOT_DIR}/../../../") +set(HIPPY_ROOT_DIR "${PROJECT_ROOT_DIR}/framework/ohos/") +set(HIPPY_IMPL_CPP_DIR "${HIPPY_ROOT_DIR}/src/main/cpp/impl") + +add_library(demo SHARED + napi_init.cpp + biz_view_manager.cpp +) + +add_subdirectory("${HIPPY_IMPL_CPP_DIR}" ./hippy_impl) + +target_link_libraries(demo PUBLIC + hippy_impl + libace_napi.z.so + libace_ndk.z.so) diff --git a/framework/examples/ohos-c-demo/src/main/cpp/biz_view_manager.cpp b/framework/examples/ohos-c-demo/src/main/cpp/biz_view_manager.cpp new file mode 100644 index 00000000000..9f226770978 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/cpp/biz_view_manager.cpp @@ -0,0 +1,119 @@ +/* + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "biz_view_manager.h" +#include "renderer/api_c/hippy.h" +#include "renderer/utils/hr_pixel_utils.h" +#include +#include +#include + +const uint32_t DEMO_VIEW_A_ID = 1; +const uint32_t DEMO_RENDER_MANAGER_ID = 1; +const uint32_t DEMO_FIRST_DOM_MANAGER_ID = 2; + +ArkUI_NativeNodeAPI_1 *GetNativeNodeAPI() { + static ArkUI_NativeNodeAPI_1 *api = nullptr; + if (api == nullptr) { + api = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + } + return api; +} + +BizViewManager::BizViewManager() { + BuildBizViews(); +} + +BizViewManager::~BizViewManager() { + +} + +std::shared_ptr BizViewManager::GetInstance() { + static std::shared_ptr sp = nullptr; + static std::once_flag flag; + std::call_once(flag, []{ sp = std::make_shared(); }); + return sp; +} + +void BizViewManager::BindBizNativeView(ArkUI_NodeContentHandle contentHandle, uint32_t view_id) { + ArkUI_NodeContentHandle savedHandle = nullptr; + auto it = nodeContentMap_.find(view_id); + if (it != nodeContentMap_.end()) { + savedHandle = it->second; + } + if (contentHandle == savedHandle) { + return; + } + + auto viewIt = viewHandleMap_.find(view_id); + if (viewIt == viewHandleMap_.end()) { + return; + } + auto viewHandle = viewIt->second; + + nodeContentMap_[view_id] = contentHandle; + OH_ArkUI_NodeContent_RegisterCallback(contentHandle, nullptr); + OH_ArkUI_NodeContent_AddNode(contentHandle, viewHandle); +} + +void BizViewManager::UnbindBizNativeView(uint32_t view_id) { + auto it = nodeContentMap_.find(view_id); + if (it == nodeContentMap_.end()) { + return; + } + ArkUI_NodeContentHandle savedHandle = it->second; + auto viewIt = viewHandleMap_.find(view_id); + if (viewIt == viewHandleMap_.end()) { + return; + } + auto viewHandle = viewIt->second; + OH_ArkUI_NodeContent_RemoveNode(savedHandle, viewHandle); + nodeContentMap_.erase(view_id); +} + +void BizViewManager::OnHippyRootViewReady() { +} + +void BizViewManager::BuildBizViews() { + ArkUI_NodeHandle viewHandle = GetNativeNodeAPI()->createNode(ArkUI_NodeType::ARKUI_NODE_STACK); + viewHandleMap_[DEMO_VIEW_A_ID] = viewHandle; + + // 参数说明: + // first_dom_manager_id - 实际由业务从ts层传到c层,ts层获取:hippyEngine.getHippyEngineContext()?.getDomManagerId() + uint32_t rootId = HippyViewProvider_CreateRoot(DEMO_FIRST_DOM_MANAGER_ID, HippyLayoutEngineYoga); + + // 参数说明: + // parent_node_handle - Hippy根节点的父节点 + // render_manager_id - 实际由业务从ts层传到c层,ts层获取:hippyEngine.getNativeRenderProvider().getInstanceId() + // root_id - 根节点id + HippyViewProvider_BindNativeRoot(viewHandle, DEMO_RENDER_MANAGER_ID, rootId); + + // 方法说明: + // 该方法一定在HippyViewProvider_CreateRoot后调用。 + // 参数说明: + // render_manager_id - 实际由业务从ts层传到c层,ts层获取:hippyEngine.getNativeRenderProvider().getInstanceId() + // root_id - 根节点id + // width -宽度 + // height - 高度 + HippyViewProvider_UpdateRootSize(DEMO_RENDER_MANAGER_ID, rootId, 300, 400); +} diff --git a/framework/examples/ohos-c-demo/src/main/cpp/biz_view_manager.h b/framework/examples/ohos-c-demo/src/main/cpp/biz_view_manager.h new file mode 100644 index 00000000000..1897855fb71 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/cpp/biz_view_manager.h @@ -0,0 +1,47 @@ +/* + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include +#include +#include +#include + +class BizViewManager { +public: + BizViewManager(); + ~BizViewManager(); + + static std::shared_ptr GetInstance(); + + void BindBizNativeView(ArkUI_NodeContentHandle contentHandle, uint32_t view_id); + void UnbindBizNativeView(uint32_t view_id); + void OnHippyRootViewReady(); + +private: + + void BuildBizViews(); + + std::unordered_map nodeContentMap_; + std::map viewHandleMap_; +}; diff --git a/framework/examples/ohos-c-demo/src/main/cpp/napi_init.cpp b/framework/examples/ohos-c-demo/src/main/cpp/napi_init.cpp new file mode 100644 index 00000000000..f6bc0a657af --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/cpp/napi_init.cpp @@ -0,0 +1,72 @@ +/* + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "napi/native_api.h" +#include "biz_view_manager.h" +#include +#include +#include +#include "oh_napi/oh_napi_register.h" +#include "oh_napi/ark_ts.h" + +napi_value BindNativeBizView(napi_env env, napi_callback_info info) { + size_t argc = 2; + napi_value args[2] = {nullptr}; + + napi_get_cb_info(env, info, &argc, args , nullptr, nullptr); + + // NodeContent + ArkUI_NodeContentHandle contentHandle = nullptr; + auto code = OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); + if (code != ARKUI_ERROR_CODE_NO_ERROR || !contentHandle) { + return nullptr; + } + + uint32_t biz_view_id = 0; + napi_get_value_uint32(env, args[1], &biz_view_id); + + BizViewManager::GetInstance()->BindBizNativeView(contentHandle, biz_view_id); + + return nullptr; +} + +napi_value UnbindNativeBizView(napi_env env, napi_callback_info info) { + size_t argc = 1; + napi_value args[1] = {nullptr}; + + napi_get_cb_info(env, info, &argc, args , nullptr, nullptr); + + uint32_t biz_view_id = 0; + napi_get_value_uint32(env, args[0], &biz_view_id); + + BizViewManager::GetInstance()->UnbindBizNativeView(biz_view_id); + + return nullptr; +} + +napi_value OnHippyRootViewReady(napi_env env, napi_callback_info info) { + BizViewManager::GetInstance()->OnHippyRootViewReady(); + return nullptr; +} + +REGISTER_OH_NAPI("Demo", "Demo_BindNativeBizView", BindNativeBizView) +REGISTER_OH_NAPI("Demo", "Demo_UnbindNativeBizView", UnbindNativeBizView) +REGISTER_OH_NAPI("Demo", "Demo_OnHippyRootViewReady", OnHippyRootViewReady) diff --git a/framework/examples/ohos-c-demo/src/main/cpp/types/libdemo/Index.d.ts b/framework/examples/ohos-c-demo/src/main/cpp/types/libdemo/Index.d.ts new file mode 100644 index 00000000000..7984ad7fa95 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/cpp/types/libdemo/Index.d.ts @@ -0,0 +1,24 @@ +/* + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +export function Demo_BindNativeBizView(bizSlot: object, bizRootId: number): void; +export function Demo_UnbindNativeBizView(bizRootId: number): void; +export function Demo_OnHippyRootViewReady(): void; diff --git a/framework/examples/ohos-c-demo/src/main/cpp/types/libdemo/oh-package.json5 b/framework/examples/ohos-c-demo/src/main/cpp/types/libdemo/oh-package.json5 new file mode 100644 index 00000000000..02b66156d51 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/cpp/types/libdemo/oh-package.json5 @@ -0,0 +1,6 @@ +{ + "name": "libdemo.so", + "types": "./Index.d.ts", + "version": "1.0.0", + "description": "Please describe the basic information." +} diff --git a/framework/examples/ohos-c-demo/src/main/ets/entryability/EntryAbility.ets b/framework/examples/ohos-c-demo/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 00000000000..e00e0e4766d --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,67 @@ +/* + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import libHippy from 'libdemo.so' + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + + AppStorage.setOrCreate("libHippy", libHippy) + AppStorage.setOrCreate("abilityContext", this.context) + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', + JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +}; diff --git a/framework/examples/ohos-c-demo/src/main/ets/pages/BizView.ets b/framework/examples/ohos-c-demo/src/main/ets/pages/BizView.ets new file mode 100644 index 00000000000..bffeae8e0f3 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/ets/pages/BizView.ets @@ -0,0 +1,48 @@ +/* + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2022 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeContent } from "@kit.ArkUI" +import demoNapi from 'libdemo.so'; + +const DEMO_VIEW_A_ID = 1; + +@Component +export struct BizComponent { + // @StorageLink('libHippy') private demoNapi: object | null = null + bizSlot = new NodeContent() + + aboutToAppear(): void { + demoNapi.Demo_BindNativeBizView(this.bizSlot, DEMO_VIEW_A_ID) + } + + aboutToDisappear(): void { + demoNapi.Demo_UnbindNativeBizView(DEMO_VIEW_A_ID) + } + + build() { + Column() { + ContentSlot(this.bizSlot) + } + .width('100%') + .height('100%') + .onAreaChange((oldValue: Area, newValue: Area) => { + + }) + } +} diff --git a/framework/examples/ohos-c-demo/src/main/ets/pages/Index.ets b/framework/examples/ohos-c-demo/src/main/ets/pages/Index.ets new file mode 100644 index 00000000000..b68a8f5d6ed --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/ets/pages/Index.ets @@ -0,0 +1,129 @@ +/* + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +import { EngineInitParams, + HippyJSModuleCreator, + HippyLibrary, + HippyNativeModuleCreator, HippyRootViewWrapper, + HippyValue, + HRRenderViewCreator } from 'hippy'; +import { HippyAPIProvider } from 'hippy'; +import { createHippyEngine } from 'hippy'; +import { ModuleLoadParams } from 'hippy'; +import { ModuleLoadStatus } from 'hippy'; +import { EngineInitStatus } from 'hippy'; +import { HippyEngine } from 'hippy'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BizComponent } from './BizView'; +import HippyRenderBaseView + from 'hippy/src/main/ets/renderer_native/components/base/HippyRenderBaseView'; +import demoNapi from 'libdemo.so'; + +export class ExampleAPIProvider implements HippyAPIProvider { + getCustomNativeModuleCreatorMap(): Map | null { + return null + } + + getCustomJavaScriptModuleCreatorMap(): Map | null { + return null + } + + getCustomRenderViewCreatorMap(): Map | null { + return null + } + + getCustomMeasureRenderViews(): Array | null { + return null + } + + getCustomMappingRenderViewMap(): Map | null { + return null + } + + getCustomFontPathMap(): Map | null { + return null + } +} + +@Builder +function buildCustomRenderView($$: HippyRenderBaseView) { +} + +@Entry +@Component +struct Index { + @State message: string = 'C接入Hippy根组件'; + @StorageLink('libHippy') private libHippy: HippyLibrary | null = null + @StorageLink('abilityContext') private abilityContext: Context | null = null + @State exception: string = "" + private hippyEngine: HippyEngine | null = null + private rootViewWrapper: HippyRootViewWrapper = new HippyRootViewWrapper() + + aboutToAppear(): void { + let params = new EngineInitParams(this.libHippy!, this.abilityContext!, this.getUIContext()) + params.providers = new Array(new ExampleAPIProvider()) + params.coreJSAssetsPath = "vue2/vendor.ohos.js" + params.enableArkCApi = true + this.hippyEngine = createHippyEngine(params) + this.hippyEngine.initEngine((statusCode: EngineInitStatus, msg: string) => { + if (statusCode == EngineInitStatus.STATUS_OK) { + let loadParams = new ModuleLoadParams( + 'vue2/index.ohos.js', + '', + '', + '', + null, + null, + null, + ) + loadParams.componentName = "Demo" + loadParams.codeCacheTag = "Demo" + loadParams.jsParams = new Map() + loadParams.jsParams.set( + "msgFromNative", + "Hi js developer, I come from ohos native code!" + ) + loadParams.wrappedCustomRenderViewBuilder = wrapBuilder(buildCustomRenderView) + let rootView = this.hippyEngine?.loadModule( + loadParams, + (statusCode: ModuleLoadStatus, msg: string) => { + + }) + if (rootView) { + this.rootViewWrapper.setRootView(rootView) + } + demoNapi.Demo_OnHippyRootViewReady(); + } + }) + } + + build() { + Column() { + Text(this.message) + .fontSize(16) + BizComponent() + .width(300) + .height(400) + .border({width: 1, color: Color.Black}) + } + .width('100%') + } +} diff --git a/framework/examples/ohos-c-demo/src/main/module.json5 b/framework/examples/ohos-c-demo/src/main/module.json5 new file mode 100644 index 00000000000..43727591ebd --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/module.json5 @@ -0,0 +1,28 @@ +{ + "module": { + "name": "entry_c", + "type": "feature", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true + } + ] + } +} diff --git a/framework/examples/ohos-c-demo/src/main/resources/base/element/color.json b/framework/examples/ohos-c-demo/src/main/resources/base/element/color.json new file mode 100644 index 00000000000..162a7b6f4af --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} diff --git a/framework/examples/ohos-c-demo/src/main/resources/base/element/string.json b/framework/examples/ohos-c-demo/src/main/resources/base/element/string.json new file mode 100644 index 00000000000..6bb7db73c8f --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} diff --git a/framework/examples/ohos-c-demo/src/main/resources/base/media/background.png b/framework/examples/ohos-c-demo/src/main/resources/base/media/background.png new file mode 100644 index 00000000000..f939c9fa8cc Binary files /dev/null and b/framework/examples/ohos-c-demo/src/main/resources/base/media/background.png differ diff --git a/framework/examples/ohos-c-demo/src/main/resources/base/media/foreground.png b/framework/examples/ohos-c-demo/src/main/resources/base/media/foreground.png new file mode 100644 index 00000000000..4483ddad1f0 Binary files /dev/null and b/framework/examples/ohos-c-demo/src/main/resources/base/media/foreground.png differ diff --git a/framework/examples/ohos-c-demo/src/main/resources/base/media/layered_image.json b/framework/examples/ohos-c-demo/src/main/resources/base/media/layered_image.json new file mode 100644 index 00000000000..fb49920440f --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/main/resources/base/media/startIcon.png b/framework/examples/ohos-c-demo/src/main/resources/base/media/startIcon.png new file mode 100644 index 00000000000..205ad8b5a8a Binary files /dev/null and b/framework/examples/ohos-c-demo/src/main/resources/base/media/startIcon.png differ diff --git a/framework/examples/ohos-c-demo/src/main/resources/base/profile/main_pages.json b/framework/examples/ohos-c-demo/src/main/resources/base/profile/main_pages.json new file mode 100644 index 00000000000..1898d94f58d --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/assets/defaultSource.jpg b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/assets/defaultSource.jpg new file mode 100644 index 00000000000..833417ea2fb Binary files /dev/null and b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/assets/defaultSource.jpg differ diff --git a/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/assets/hippyLogoWhite.png b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/assets/hippyLogoWhite.png new file mode 100644 index 00000000000..20e428e2fa9 Binary files /dev/null and b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/assets/hippyLogoWhite.png differ diff --git a/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/asyncComponentFromHttp.ohos.js b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/asyncComponentFromHttp.ohos.js new file mode 100644 index 00000000000..c333e755676 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/asyncComponentFromHttp.ohos.js @@ -0,0 +1 @@ +((0,eval)("this").webpackJsonp=(0,eval)("this").webpackJsonp||[]).push([[0],{"./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/dynamicImport/async-component-http.vue?vue&type=style&index=0&lang=css&":function(e,t,o){(function(t){e.exports=(t.__HIPPY_VUE_STYLES__||(t.__HIPPY_VUE_STYLES__=[]),void(t.__HIPPY_VUE_STYLES__=t.__HIPPY_VUE_STYLES__.concat([{hash:"ae6dd57202be2361fda9513416800aa6",selectors:["#asynccomponent"],declarations:[{type:"declaration",property:"display",value:"flex"},{type:"declaration",property:"flexDirection",value:"column"},{type:"declaration",property:"alignItems",value:"center"},{type:"declaration",property:"justifyContent",value:"center"},{type:"declaration",property:"position",value:"relative"},{type:"declaration",property:"height",value:200},{type:"declaration",property:"width",value:300},{type:"declaration",property:"backgroundColor",value:4283484818},{type:"declaration",property:"borderRadius",value:10},{type:"declaration",property:"marginBottom",value:10}]},{hash:"ae6dd57202be2361fda9513416800aa6",selectors:[".async-txt"],declarations:[{type:"declaration",property:"color",value:4278190080}]}])))}).call(this,o("./node_modules/webpack/buildin/global.js"))},"./src/components/demos/dynamicImport/async-component-http.vue":function(e,t,o){"use strict";o.r(t);var a=function(){var e=this.$createElement,t=this._self._c||e;return t("div",{attrs:{id:"asynccomponent"}},[t("text",{staticClass:"async-txt"},[this._v("\n 我是远程异步组件\n ")])])};a._withStripped=!0;var s={data:()=>({})},n=(o("./src/components/demos/dynamicImport/async-component-http.vue?vue&type=style&index=0&lang=css&"),o("../../packages/hippy-vue-loader/lib/runtime/componentNormalizer.js")),p=Object(n.a)(s,a,[],!1,null,null,null);p.options.__file="src/components/demos/dynamicImport/async-component-http.vue";t.default=p.exports},"./src/components/demos/dynamicImport/async-component-http.vue?vue&type=style&index=0&lang=css&":function(e,t,o){"use strict";o("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/dynamicImport/async-component-http.vue?vue&type=style&index=0&lang=css&")}}]); \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/asyncComponentFromLocal.ohos.js b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/asyncComponentFromLocal.ohos.js new file mode 100644 index 00000000000..0db5ed7c6fd --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/asyncComponentFromLocal.ohos.js @@ -0,0 +1 @@ +((0,eval)("this").webpackJsonp=(0,eval)("this").webpackJsonp||[]).push([[1],{"./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/dynamicImport/async-component-local.vue?vue&type=style&index=0&id=ae446280&scoped=true&lang=css&":function(e,o,a){(function(o){e.exports=(o.__HIPPY_VUE_STYLES__||(o.__HIPPY_VUE_STYLES__=[]),void(o.__HIPPY_VUE_STYLES__=o.__HIPPY_VUE_STYLES__.concat([{hash:"82fcdf5614648d0520d4c91dec880b56",selectors:[".vae446280.async-component-local"],declarations:[{type:"declaration",property:"display",value:"flex"},{type:"declaration",property:"flexDirection",value:"column"},{type:"declaration",property:"alignItems",value:"center"},{type:"declaration",property:"justifyContent",value:"center"},{type:"declaration",property:"position",value:"relative"},{type:"declaration",property:"borderRadius",value:10},{type:"declaration",property:"marginBottom",value:10},{type:"declaration",property:"backgroundColor",value:4283484818}]},{hash:"82fcdf5614648d0520d4c91dec880b56",selectors:[".vae446280.async-txt"],declarations:[{type:"declaration",property:"color",value:4278190080}]}])))}).call(this,a("./node_modules/webpack/buildin/global.js"))},"./src/components/demos/dynamicImport/async-component-local.vue":function(e,o,a){"use strict";a.r(o);var t=function(){var e=this.$createElement,o=this._self._c||e;return o("div",{staticClass:"vae446280 async-component-local"},[o("text",{staticClass:"vae446280 async-txt"},[this._v("\n 我是本地异步组件\n ")])])};t._withStripped=!0;var s={data:()=>({})},c=(a("./src/components/demos/dynamicImport/async-component-local.vue?vue&type=style&index=0&id=ae446280&scoped=true&lang=css&"),a("../../packages/hippy-vue-loader/lib/runtime/componentNormalizer.js")),n=Object(c.a)(s,t,[],!1,null,"ae446280",null);n.options.__file="src/components/demos/dynamicImport/async-component-local.vue";o.default=n.exports},"./src/components/demos/dynamicImport/async-component-local.vue?vue&type=style&index=0&id=ae446280&scoped=true&lang=css&":function(e,o,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/dynamicImport/async-component-local.vue?vue&type=style&index=0&id=ae446280&scoped=true&lang=css&")}}]); \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/index.ohos.js b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/index.ohos.js new file mode 100644 index 00000000000..82a339cc750 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/index.ohos.js @@ -0,0 +1,25 @@ +!function(e){function t(t){for(var a,r,s=t[0],i=t[1],n=0,c=[];n0===n.indexOf(e))){var l=n.split("/"),c=l[l.length-1],d=c.split(".")[0];(p=global.__DYNAMIC_LOAD_CUSTOM_PATH_MAP__[d])&&(n=p+c)}else{var p;d=n.split(".")[0];(p=global.__DYNAMIC_LOAD_CUSTOM_PATH_MAP__[d])&&(n=p+n)}onScriptComplete=function(t){if(t instanceof Error){t.message+=", load chunk "+e+" failed, path is "+n;var a=o[e];0!==a&&a&&a[1](t),o[e]=void 0}},global.dynamicLoad(n,onScriptComplete)}return Promise.all(t)},r.m=e,r.c=a,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(a,o,function(t){return e[t]}.bind(null,o));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r.oe=function(e){throw console.error(e),e};var s=(0,eval)("this").webpackJsonp=(0,eval)("this").webpackJsonp||[],i=s.push.bind(s);s.push=t,s=s.slice();for(var n=0;na[e.toLowerCase()]:e=>a[e]}function s(e){let t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}let i;function n(){return i}function l(e){return"[object Function]"===Object.prototype.toString.call(e)}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var o=a.call(e,t||"default");if("object"!==c(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c(t)?t:String(t)}function p(e,t,a){return(t=d(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function u(e){return Object.prototype.toString.call(e).indexOf("Error")>-1}function v(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}a.d(t,"a",(function(){return he})), +/*! + * @hippy/vue-router v3.0.0-alpha.22 + * (Using Vue v2.6.14 and Hippy-Vue v3.0.0-alpha.22) + * Build at: Wed Jul 26 2023 17:59:02 GMT+0800 (中国标准时间) + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.freeze({}),r("slot,component",!0),r("key,ref,slot,slot-scope,is"),e.env.PORT;var y={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render(e,{props:t,children:a,parent:o,data:r}){r.routerView=!0;const s=o.$createElement,{name:i}=t,n=o.$route,l=o._routerViewCache||(o._routerViewCache={});let c=0,d=!1;for(;o&&o._routerRoot!==o;)o.$vnode&&o.$vnode.data.routerView&&(c+=1),o._inactive&&(d=!0),o=o.$parent;if(r.routerViewDepth=c,d)return s(l[i],r,a);const u=n.matched[c];if(!u)return l[i]=null,s();const y=u.components[i];l[i]=y,r.registerRouteInstance=(e,t)=>{const a=u.instances[i];(t&&a!==e||!t&&a===e)&&(u.instances[i]=t)},r.hook||(r.hook={}),r.hook.prepatch=(e,t)=>{u.instances[i]=t.componentInstance};let h=function(e,t){switch(typeof t){case"undefined":return null;case"object":return t;case"function":return t(e);case"boolean":return t?e.params:void 0;default:return null}}(n,u.props&&u.props[i]);if(r.props=h,h){h=function(e){for(var t=1;t{y.props&&t in y.props||(e[t]=h[t],delete h[t])})}return s(y,r,a)}};const h=/[!'()*]/g,f=e=>"%"+e.charCodeAt(0).toString(16),m=/%2C/g,b=e=>encodeURIComponent(e).replace(h,f).replace(m,","),g=decodeURIComponent;function _(e){const t={};return(e=e.trim().replace(/^(\?|#|&)/,""))?(e.split("&").forEach(e=>{const a=e.replace(/\+/g," ").split("="),o=g(a.shift()),r=a.length>0?g(a.join("=")):null;void 0===t[o]?t[o]=r:Array.isArray(t[o])?t[o].push(r):t[o]=[t[o],r]}),t):t}function C(e){const t=e?Object.keys(e).map(t=>{const a=e[t];if(void 0===a)return"";if(null===a)return b(t);if(Array.isArray(a)){const e=[];return a.forEach(a=>{void 0!==a&&(null===a?e.push(b(t)):e.push(`${b(t)}=${b(a)}`))}),e.join("&")}return`${b(t)}=${b(a)}`}).filter(e=>e.length>0).join("&"):null;return t?"?"+t:""}const S=/\/?$/;function x(e){if(Array.isArray(e))return e.map(x);if(e&&"object"==typeof e){const t={};return Object.keys(e).forEach(a=>{t[a]=x(e[a])}),t}return e}function w(e){const t=[];for(;e;)t.unshift(e),e=e.parent;return t}function A({path:e,query:t={},hash:a=""},o){return(e||"/")+(o||C)(t)+a}function k(e={},t={}){if(!e||!t)return e===t;const a=Object.keys(e),o=Object.keys(t);return a.length===o.length&&a.every(a=>{const o=e[a],r=t[a];return"object"==typeof o&&"object"==typeof r?k(o,r):String(o)===String(r)})}function P(e,t,a,o){let r;o&&({stringifyQuery:r}=o.options);let s=t.query||{};try{s=x(s)}catch(e){}const i={name:t.name||e&&e.name,meta:e&&e.meta||{},path:t.path||"/",hash:t.hash||"",query:s,params:t.params||{},fullPath:A(t,r),matched:e?w(e):[]};return a&&(i.redirectedFrom=A(a,r)),Object.freeze(i)}const E=P(null,{path:"/"});function j(e,t){return t===E?e===t:!!t&&(e.path&&t.path?e.path.replace(S,"")===t.path.replace(S,"")&&e.hash===t.hash&&k(e.query,t.query):!(!e.name||!t.name)&&(e.name===t.name&&e.hash===t.hash&&k(e.query,t.query)&&k(e.params,t.params)))}function T(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function V(e){for(var t=1;t{I(e)&&(this.replace?t.replace(o):t.push(o))},h={click:I};Array.isArray(this.event)?this.event.forEach(e=>{h[e]=y}):h[this.event]=y;const f={class:i};if("a"===this.tag)f.on=h,f.attrs={href:s};else{const e=function e(t){return t?t.find(t=>{if("a"===t.tag)return!0;if(t.children){return!!e(t.children)}return!1}):null}(this.$slots.default);if(e){e.isStatic=!1;const t=V({},e.data);e.data=t,t.on=h;const a=V({},e.data.attrs);e.data.attrs=a,a.href=s}else f.on=h}return e(this.tag,f,this.$slots.default)}};var Y={exports:{}},O=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)};Y.exports=$,Y.exports.parse=D,Y.exports.compile=function(e,t){return B(D(e,t),t)},Y.exports.tokensToFunction=B,Y.exports.tokensToRegExp=z;var H=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function D(e,t){for(var a,o=[],r=0,s=0,i="",n=t&&t.delimiter||"/";null!=(a=H.exec(e));){var l=a[0],c=a[1],d=a.index;if(i+=e.slice(s,d),s=d+l.length,c)i+=c[1];else{var p=e[s],u=a[2],v=a[3],y=a[4],h=a[5],f=a[6],m=a[7];i&&(o.push(i),i="");var b=null!=u&&null!=p&&p!==u,g="+"===f||"*"===f,_="?"===f||"*"===f,C=a[2]||n,S=y||h;o.push({name:v||r++,prefix:u||"",delimiter:C,optional:_,repeat:g,partial:b,asterisk:!!m,pattern:S?N(S):m?".*":"[^"+U(C)+"]+?"})}}return s=0&&(t=e.slice(o),e=e.slice(0,o));const r=e.indexOf("?");return r>=0&&(a=e.slice(r+1),e=e.slice(0,r)),{path:e,query:a,hash:t}}(r.path||""),i=t&&t.path||"/",n=s.path?q(s.path,i,a||r.append):i,l=function(e,t={},a){const o=a||_;let r;try{r=o(e||"")}catch(e){0,r={}}return Object.keys(t).forEach(e=>{r[e]=t[e]}),r}(s.query,r.query,o&&o.options.parseQuery);let c=r.hash||s.hash;return c&&"#"!==c.charAt(0)&&(c="#"+c),{_normalized:!0,path:n,query:l,hash:c}}function ee(e,t){return W(e,[],t)}function te(e,t,a,o,r,s){const{path:i,name:n}=o;const l=o.pathToRegexpOptions||{},c=function(e,t,a){return a||(e=e.replace(/\/$/,"")),"/"===e[0]||null==t?e:Q(`${t.path}/${e}`)}(i,r,l.strict);"boolean"==typeof o.caseSensitive&&(l.sensitive=o.caseSensitive);const d={path:c,regex:ee(c,l),components:o.components||{default:o.component},instances:{},name:n,parent:r,matchAs:s,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};if(o.children&&o.children.forEach(o=>{const r=s?Q(`${s}/${o.path}`):void 0;te(e,t,a,o,d,r)}),void 0!==o.alias){(Array.isArray(o.alias)?o.alias:[o.alias]).forEach(s=>{const i={path:s,children:o.children};te(e,t,a,i,r,d.path||"/")})}t[d.path]||(e.push(d.path),t[d.path]=d),n&&(a[n]||(a[n]=d))}function ae(e,t,a,o){const r=t||[],s=a||Object.create(null),i=o||Object.create(null);e.forEach(e=>{te(r,s,i,e)});for(let e=0,t=r.length;e!e.optional).map(e=>e.name);if("object"!=typeof l.params&&(l.params={}),s&&"object"==typeof s.params&&Object.keys(s.params).forEach(e=>{!(e in l.params)&&t.indexOf(e)>-1&&(l.params[e]=s.params[e])}),e)return l.path=G(e.path,l.params),n(e,l,i)}else if(l.path){l.params={};for(let e=0;eo[e])}}}function re(e,t,a){const o=t.match(e);if(!o)return!1;if(!a)return!0;for(let t=1,r=o.length;t{r>=e.length?a():e[r]?t(e[r],()=>{o(r+1)}):o(r+1)};o(0)}const ie="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function ne(e){return Array.prototype.concat.apply([],e)}function le(e,t){return ne(e.map(e=>Object.keys(e.components).map(a=>t(e.components[a],e.instances[a],e,a))))}function ce(e){return(t,a,o)=>{let r=!1,i=0,l=null;le(e,(e,t,a,c)=>{if("function"==typeof e&&void 0===e.cid){r=!0,i+=1;const t=s(t=>{const r=n();var s;((s=t).__esModule||ie&&"Module"===s[Symbol.toStringTag])&&(t=t.default),e.resolved="function"==typeof t?t:r.extend(t),a.components[c]=t,i-=1,i<=0&&o()}),d=s(e=>{const t=`Failed to resolve async component ${c}: ${e}`;l||(l=u(e)?e:new Error(t),o(l))});let p;try{p=e(t,d)}catch(e){d(e)}if(p)if("function"==typeof p.then)p.then(t,d);else{const e=p.component;e&&"function"==typeof e.then&&e.then(t,d)}}}),r||o()}}function de(e,t,a,o){const r=le(e,(e,o,r,s)=>{const i=function(e,t){if("function"!=typeof e){e=n().extend(e)}return e.options[t]}(e,t);return i?Array.isArray(i)?i.map(e=>a(e,o,r,s)):a(i,o,r,s):null});return ne(o?r.reverse():r)}function pe(e,t){return t?function(...a){return e.apply(t,a)}:null}function ue(e,t,a,o,r){return function(s,i,n){return e(s,i,e=>{n(e),"function"==typeof e&&o.push(()=>{!function e(t,a,o,r){a[o]&&!a[o]._isBeingDestroyed?t(a[o]):r()&&setTimeout(()=>{e(t,a,o,r)},16)}(e,t.instances,a,r)})})}}class ve{constructor(e,t="/"){this.router=e,this.base=function(e){return"/"!==e.charAt(0)&&(e="/"+e),e.replace(/\/$/,"")}(t),this.current=E,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[];const a=this.router.match("/",this.current);if(!a)throw new Error("Root router path with / is required");this.stack=[a],this.index=0}push(e,t,a){this.transitionTo(e,e=>{this.stack=this.stack.slice(0,this.index+1).concat(e),this.index+=1,l(t)&&t(e)},a)}replace(e,t,a){this.transitionTo(e,e=>{this.stack=this.stack.slice(0,this.index).concat(e),l(t)&&t(e)},a)}go(e){const t=this.index+e;if(t<0||t>=this.stack.length)return;const a=this.stack[t];this.confirmTransition(a,()=>{this.index=t,this.updateRoute(a),this.stack=this.stack.slice(0,t+1)})}getCurrentLocation(){const e=this.stack[this.stack.length-1];return e?e.fullPath:"/"}ensureURL(){}listen(e){this.cb=e}onReady(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))}onError(e){this.errorCbs.push(e)}transitionTo(e,t,a){const o=this.router.match(e,this.current);this.confirmTransition(o,()=>{this.updateRoute(o),l(t)&&t(o),this.ensureURL(),this.ready||(this.ready=!0,this.readyCbs.forEach(e=>{e(o)}))},e=>{a&&a(e),e&&!this.ready&&(this.ready=!0,this.readyErrorCbs.forEach(t=>{t(e)}))})}confirmTransition(e,t,a){const{current:o}=this,r=e=>{u(e)&&this.errorCbs.length&&this.errorCbs.forEach(t=>{t(e)}),l(a)&&a(e)};if(j(e,o)&&e.matched.length===o.matched.length)return this.ensureURL(),r();const{updated:s,deactivated:i,activated:n}=function(e,t){let a;const o=Math.max(e.length,t.length);for(a=0;ae.beforeEnter),ce(n));this.pending=e;const d=(t,a)=>{if(this.pending!==e)return r();try{return t(e,o,e=>{!1===e||u(e)?(this.ensureURL(!0),r(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(r(),"object"==typeof e&&e.replace?this.replace(e):this.push(e)):a(e)})}catch(e){return r(e)}};return se(c,d,()=>{const a=[];se(function(e,t,a){return de(e,"beforeRouteEnter",(e,o,r,s)=>ue(e,r,s,t,a))}(n,a,()=>this.current===e).concat(this.router.resolveHooks),d,()=>this.pending!==e?r():(this.pending=null,t(e),this.router.app?this.router.app.$nextTick(()=>{a.forEach(e=>{e()})}):null))})}updateRoute(e){const t=this.current;this.current=e,l(this.cb)&&this.cb(e),this.router.afterHooks.forEach(a=>{l(a)&&a(e,t)})}hardwareBackPress(){if(this.stack.length>1)return this.go(-1);const{matched:e}=this.stack[0];if(e.length){const{components:t,instances:a}=e[0];if(t&&t.default&&l(t.default.beforeAppExit))return t.default.beforeAppExit.call(a.default,this.exitApp)}return this.exitApp()}exitApp(){n().Native.callNative("DeviceEventModule","invokeDefaultBackPressHandler")}}function ye(e,t){return e.push(t),()=>{const a=e.indexOf(t);a>-1&&e.splice(a,1)}}class he{constructor(e={}){if(this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=oe(e.routes||[],this),!o.__GLOBAL__||!o.__GLOBAL__.appRegister)throw new Error("Hippy-Vue-Router can\t work without Native environment");this.history=new ve(this,e.base)}match(e,t,a){return this.matcher.match(e,t,a)}get currentRoute(){return this.history&&this.history.current}init(e,t){if(this.apps.push(e),this.app)return;this.app=e;const{history:a}=this;a instanceof ve&&a.transitionTo(a.getCurrentLocation()),a.listen(e=>{this.apps.forEach(t=>{t._route=e})}),"android"===t.Native.Platform&&l(a.hardwareBackPress)&&!this.options.disableAutoBack&&(setTimeout(()=>t.Native.callNative("DeviceEventModule","setListenBackPress",!0),300),e.$on("hardwareBackPress",()=>a.hardwareBackPress()))}beforeEach(e){return ye(this.beforeHooks,e)}beforeResolve(e){return ye(this.resolveHooks,e)}afterEach(e){return ye(this.afterHooks,e)}onReady(e,t){this.history.onReady(e,t)}onError(e){this.history.onError(e)}push(e,t,a){this.history.push(e,t,a)}replace(e,t,a){this.history.replace(e,t,a)}go(e){this.history.go(e)}back(){this.go(-1)}forward(){this.go(1)}getMatchedComponents(e){const t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?t.matched.map(e=>Object.keys(e.components).map(t=>e.components[t])):[]}resolve(e,t,a){const o=Z(e,t||this.history.current,a,this),r=this.match(o,t),s=r.redirectedFrom||r.fullPath,{base:i}=this.history;return{location:o,route:r,href:function(e,t){return e?Q(`${e}/${t}`):t}(i,s),normalizedTo:o,resolved:r}}addRoutes(e){this.matcher.addRoutes(e),this.history.current!==E&&this.history.transitionTo(this.history.getCurrentLocation())}}he.install=function e(t){if(e.installed&&n()===t)return;e.installed=!0,function(e){i=e}(t);const a=e=>void 0!==e,o=(e,t)=>{let o=e.$options._parentVnode;a(o)&&a(o=o.data)&&a(o=o.registerRouteInstance)&&o(e,t)};t.mixin({beforeCreate(){a(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this,t),t.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,o(this,this)},destroyed(){o(this)}}),Object.defineProperty(t.prototype,"$router",{get(){return this._routerRoot._router}}),Object.defineProperty(t.prototype,"$route",{get(){return this._routerRoot._route}}),t.component("RouterView",y),t.component("RouterLink",L);const r=t.config.optionMergeStrategies;r.beforeRouteEnter=r.beforeRouteLeave=r.beforeRouteUpdate=r.created},he.version="2.6.14"}).call(this,a("./node_modules/process/browser.js"),a("./node_modules/webpack/buildin/global.js"))},"./node_modules/@hippy/vue/dist/index.js":function(e,t,a){e.exports=a("dll-reference hippyVueBase")("./node_modules/@hippy/vue/dist/index.js")},"./node_modules/process/browser.js":function(e,t,a){e.exports=a("dll-reference hippyVueBase")("./node_modules/process/browser.js")},"./node_modules/webpack/buildin/global.js":function(e,t,a){e.exports=a("dll-reference hippyVueBase")("./node_modules/webpack/buildin/global.js")},"./src/app.vue":function(e,t,a){"use strict";var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"root"}},[a("div",{attrs:{id:"header"}},[a("div",{staticClass:"left-title"},[a("img",{directives:[{name:"show",rawName:"v-show",value:!["/","/debug","/remote-debug"].includes(e.$router.history.current.path),expression:"!['/', '/debug', '/remote-debug'].includes($router.history.current.path)"}],attrs:{id:"back-btn",src:e.imgs.backButtonImg},on:{click:e.goToHome}}),e._v(" "),["/","/debug","/remote-debug"].includes(e.$router.history.current.path)?a("label",{staticClass:"title"},[e._v("Hippy Vue")]):e._e()]),e._v(" "),a("label",{staticClass:"title"},[e._v(e._s(e.subtitle))])]),e._v(" "),a("div",{staticClass:"body-container",on:{click:function(e){return e.stopPropagation()}}},[a("keep-alive",[a("router-view",{staticClass:"feature-content"})],1)],1),e._v(" "),a("div",{staticClass:"bottom-tabs"},e._l(e.tabs,(function(t,o){return a("div",{key:"tab-"+o,class:["bottom-tab",o===e.activatedTab?"activated":""],on:{click:function(a){return e.navigateTo(a,t,o)}}},[a("span",{staticClass:"bottom-tab-text"},[e._v("\n "+e._s(t.text)+"\n ")])])})),0)])};o._withStripped=!0;var r={name:"App",data:()=>({imgs:{backButtonImg:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAIPUlEQVR4Xu2dT8xeQxTGn1O0GiWEaEJCWJCwQLBo/WnRSqhEJUQT0W60G+1Ku1SS2mlXaqM2KqJSSUlajVb9TViwYEHCQmlCQghRgqKPTHLK7Zfvfd97Zt5535l7z91+58zce57fnfe7d+Y+I/Cj1xWQXl+9XzwcgJ5D4AA4AD2vQM8v30cAB6DnFZjA5ZO8VUTenEBX5i58BDCXzJZA8ikA6wFsFpEttuz80Q5AxhqTfAbA2kYXW0VkU8YuzU07AOaStUsg+RyA1bNEFwWBA9BOz9ZRJOcAeAHAqiFJ20VkQ+tGMwY6AGMsLslTAOwGcE+LZneIyLoWcVlDHIAxlVfFfxXACkOTO0VkjSF+7KEOwJhKSnIfgDuNzf0M4BoR+cqYN7ZwByCxlCTnAtgLYLmxqR8ALBGRz4x5Yw13ABLKSfJ0APsBLDU28x2Am0XkC2Pe2MMdgMiSkjwDwAEAi41NBPEXichhY16WcAcgoqwkzwRwCMD1xvRvANxUivjh3B0Ao4IkzwbwFoCrjalf67B/xJiXNdwBMJSX5LkA3gFwpSEthH6pd/63xrzs4Q5AyxKTPB/AuwAub5lyIuxzvfO/N+ZNJNwBaFFmkhcAeA/ApS3CmyGf6qPej8a8iYU7ACNKTfIivfMvNqryMYBbRCS87Cn2cACGSKPivw/gQqOCQfzwnH/UmDfxcAdgQMlJXqLDvlX8DwHcVoP4/hg4WPzLdNhfaLwlw2hxu4j8ZsybWriPADNKT/IKfdQ7z6jK2wDuEJE/jHlTDXcAGuUneZW+5DnHqMpBAHeJyDFj3tTDHQCVgOR1+nr3LKMqYRp4pYj8bcwrItwBAEBykU7sLDCqsgfAfSLyjzGvmPDeA0ByiU7pzjeqEsS/V0SOG/OKCu81ACSX6WKOeUZVdgF4oHbxe/0YSDIs33oFwGlG8ae+js94vkPDezkCkFypq3dPNRaziJW8xnN2AJoVIHm/rtsPS7gtRzFr+S0nPSq2VyOAiv9ixEKYor7mGSWq5e+9AYDkgwDC51rWa94iIpstRa0p1lqMmq7tv3Ml+RCA8KGm9Xo3isi2Ki+65UlbC9Ky2XLCSD4MYHvEGXVe/M4/BpJ8BMDWCPHXi8jTEXnVpXR2BCD5OIDHjIoQwDoRedaYV214JwEg+SSAjUZVgvhrROR5Y17V4Z0DoGHJYhEmTOaEV7svWZK6ENspAGaxZGmjUZjGDTN64bVw747OADDEkmWYqEH8u0Xktd4prxdcPQAtLVlm0/cvXcjRW/GrfwxU8V9uacnShOBPXcL1Rl/v/BPXXe0IYPTjaer8uy7eDN/49f6oEgCSYRo3/NNm8eMJYv+qy7Y/6L3ytf4PkGDJ8ot+sPGRi/9/BaoaARIsWX7S7/Q+cfFPrkA1ACRYsgTxb5y2GVOp4FUBQIIlSxFOXKWKX8VjYIIlSzFOXA5AZAUSLFmKM2OKLEH2tGJ/AhIsWYo0Y8quZGQHRQKQYMlSrBlTpD7Z04oDIMGSpWgzpuxKRnZQFACJ4t8gIsWaMUXqkz2tGAASLFmKd+LKrmJCB0UAQDLWkqUKJ64EfbKnTh2ABEuWqsyYsisZ2cFUAUiwZKnOjClSn+xpUwMgwZKlSjOm7EpGdlAjAOHuDz58VblxReqTPW1qAIQr85+A7PqO7GCqACgEsb58/k/gSHlHB0wdAIXAHwNHa5UloggAFIJYb15/EZSARjEAKASx1uw+DxAJQVEAKASxmzP4TGAEBMUBoBCE7VnC0m3rDh1hLcBiESlub54IbSaSUiQADQhi9ujxBSEGdIoFQCGI3aXLl4S1hKBoABSC2H36fFFoCwiKB0AhiN2p05eFj4CgCgAUgti9ev2roCEQVAOAQhC7W3f4LjDs4uWfhs2AoSoAFIK5avG+vMVPXDPEPw6dpWDVAaAQ+OfhRvoHhVcJgEIQ3L53R7iDuEFEg4ZqAVAI5qj1+yrjDeEWMVqwqgE4ITrJYAFvhcBNoiLcs4032uTCE2zieusRGNTpxAjQGAmCJfxaI3bBJTTs/uVGkcbCFRnuVrE2WTo1AjRGAjeLbslBJwHQJ4RgFR8s4y2H28VbqlV6rG8YMVqhzo4AjZ8D3zJmCAedB0B/DnzTqAEQ9AIAhSB227gnROTR0YNpnRG9AUAhCLuG+saRXZkLiLnnfOvYk6vWqxGg8Y+hbx7dpcmgyJHAt4/v2lyAFQSSy3R10Txj7i7dZey4Ma+48F7+BDRVILkEwH4A843q7NFJpKoh6D0A+nSwCMABAAsiIAjTyWFGscrDAVDZEjyL9unuY2ELuuoOB6AhWYJlzUHdhexYbQQ4ADMUS/AtrNK9zAGY5ZZNcC6tzr/QARgwZqt3cfAoWGgc1qsyr3IAhqibYGAdPIzDp2hHjfBMPNwBGFHyBAv7KoysHYAW91zCDibFO5g5AC0A0JdFwbcoxrKmaAczB6AlAApBrGVNsQ5mDoABAIUg1rKmSPMqB8AIgEIQa1kTzKuCjd2RiG6zpDgAkWVN2Mu4KAczByASAB0JYi1rinEwcwASAFAIgmXN6wCWGpsqwsHMATCqNiic5F4AK4zNBQeza0XksDFvbOEOwJhKSTLGt2iniKwZ0ylENeMARJVt9iSSFt+iHSKybozdRzXlAESVbXASyTa+RdtFZMOYu45qzgGIKtvopCGWNVtFZNPoFiYT4QBkrDPJmZY1W0Rkc8YuzU07AOaS2RIaljUbRWSbLTt/tAOQv8Zhf8Sw0eWhCXRl7sIBMJesWwkOQLf0NF+NA2AuWbcSHIBu6Wm+GgfAXLJuJTgA3dLTfDX/AlSTmJ/JwwOoAAAAAElFTkSuQmCC"},subtitle:"",activatedTab:0,tabs:[{text:"API",path:"/"},{text:"调试",path:"/remote-debug"}]}),watch:{$route(e){void 0!==e.name?this.subtitle=e.name:this.subtitle=""}},methods:{navigateTo(e,t,a){a!==this.activatedTab&&(e.stopPropagation(),console.log(t),this.activatedTab=a,this.$router.replace({path:t.path}))},goToHome(){this.$router.back()}}},s=(a("./src/app.vue?vue&type=style&index=0&lang=css&"),a("../../packages/hippy-vue-loader/lib/runtime/componentNormalizer.js")),i=Object(s.a)(r,o,[],!1,null,null,null);i.options.__file="src/app.vue";t.a=i.exports},"./src/app.vue?vue&type=style&index=0&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/app.vue?vue&type=style&index=0&lang=css&")},"./src/assets/defaultSource.jpg":function(e,t,a){e.exports=a.p+"assets/defaultSource.jpg"},"./src/assets/hippyLogoWhite.png":function(e,t,a){e.exports=a.p+"assets/hippyLogoWhite.png"},"./src/components/demos/demo-button.vue?vue&type=style&index=0&id=26278b5d&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-button.vue?vue&type=style&index=0&id=26278b5d&scoped=true&lang=css&")},"./src/components/demos/demo-div.vue?vue&type=style&index=0&id=e3dda614&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-div.vue?vue&type=style&index=0&id=e3dda614&scoped=true&lang=css&")},"./src/components/demos/demo-dynamicimport.vue?vue&type=style&index=0&id=2ea31349&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-dynamicimport.vue?vue&type=style&index=0&id=2ea31349&scoped=true&lang=css&")},"./src/components/demos/demo-iframe.vue?vue&type=style&index=0&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-iframe.vue?vue&type=style&index=0&lang=css&")},"./src/components/demos/demo-img.vue?vue&type=style&index=0&id=c6df51b0&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-img.vue?vue&type=style&index=0&id=c6df51b0&scoped=true&lang=css&")},"./src/components/demos/demo-input.vue?vue&type=style&index=0&id=76bc5c6f&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-input.vue?vue&type=style&index=0&id=76bc5c6f&scoped=true&lang=css&")},"./src/components/demos/demo-list.vue?vue&type=style&index=0&id=71b90789&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-list.vue?vue&type=style&index=0&id=71b90789&scoped=true&lang=css&")},"./src/components/demos/demo-p.vue?vue&type=style&index=0&id=36005ed6&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-p.vue?vue&type=style&index=0&id=36005ed6&scoped=true&lang=css&")},"./src/components/demos/demo-set-native-props.vue?vue&type=style&index=0&id=4ffd9eb0&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-set-native-props.vue?vue&type=style&index=0&id=4ffd9eb0&scoped=true&lang=css&")},"./src/components/demos/demo-shadow.vue?vue&type=style&index=0&id=5819936a&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-shadow.vue?vue&type=style&index=0&id=5819936a&scoped=true&lang=css&")},"./src/components/demos/demo-textarea.vue?vue&type=style&index=0&id=6cb502b6&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-textarea.vue?vue&type=style&index=0&id=6cb502b6&scoped=true&lang=css&")},"./src/components/demos/demo-turbo.vue?vue&type=style&index=0&id=14216e7a&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-turbo.vue?vue&type=style&index=0&id=14216e7a&scoped=true&lang=css&")},"./src/components/demos/demo-websocket.vue?vue&type=style&index=0&id=77bce928&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/demos/demo-websocket.vue?vue&type=style&index=0&id=77bce928&scoped=true&lang=css&")},"./src/components/native-demos/animations/color-change.vue?vue&type=style&index=0&id=c3eb3b96&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/animations/color-change.vue?vue&type=style&index=0&id=c3eb3b96&scoped=true&lang=css&")},"./src/components/native-demos/animations/cubic-bezier.vue?vue&type=style&index=0&id=44bf239d&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/animations/cubic-bezier.vue?vue&type=style&index=0&id=44bf239d&scoped=true&lang=css&")},"./src/components/native-demos/animations/loop.vue?vue&type=style&index=0&id=63fc9d7f&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/animations/loop.vue?vue&type=style&index=0&id=63fc9d7f&scoped=true&lang=css&")},"./src/components/native-demos/animations/vote-down.vue?vue&type=style&index=0&id=3adfe95a&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/animations/vote-down.vue?vue&type=style&index=0&id=3adfe95a&scoped=true&lang=css&")},"./src/components/native-demos/animations/vote-up.vue?vue&type=style&index=0&id=ca89125a&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/animations/vote-up.vue?vue&type=style&index=0&id=ca89125a&scoped=true&lang=css&")},"./src/components/native-demos/demo-animation.vue?vue&type=style&index=0&id=1b9933af&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/demo-animation.vue?vue&type=style&index=0&id=1b9933af&scoped=true&lang=css&")},"./src/components/native-demos/demo-dialog.vue?vue&type=style&index=0&id=bdcf35a6&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/demo-dialog.vue?vue&type=style&index=0&id=bdcf35a6&scoped=true&lang=css&")},"./src/components/native-demos/demo-nested-scroll.vue?vue&type=style&index=0&id=3bbacb8e&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/demo-nested-scroll.vue?vue&type=style&index=0&id=3bbacb8e&scoped=true&lang=css&")},"./src/components/native-demos/demo-pull-header-footer.vue?vue&type=style&index=0&id=44ac5390&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/demo-pull-header-footer.vue?vue&type=style&index=0&id=44ac5390&scoped=true&lang=css&")},"./src/components/native-demos/demo-swiper.vue?vue&type=style&index=0&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/demo-swiper.vue?vue&type=style&index=0&lang=css&")},"./src/components/native-demos/demo-vue-native.vue?vue&type=style&index=0&id=864846ba&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/demo-vue-native.vue?vue&type=style&index=0&id=864846ba&scoped=true&lang=css&")},"./src/components/native-demos/demo-waterfall.vue?vue&type=style&index=0&id=782cda3d&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/components/native-demos/demo-waterfall.vue?vue&type=style&index=0&id=782cda3d&scoped=true&lang=css&")},"./src/main-native.js":function(e,t,a){"use strict";a.r(t),function(e){var t=a("./node_modules/@hippy/vue/dist/index.js"),o=a("./node_modules/@hippy/vue-router/dist/index.js"),r=a("./node_modules/@hippy/vue-native-components/dist/index.js"),s=a("./src/app.vue"),i=a("./src/routes.js"),n=a("./src/util.js");t.default.config.productionTip=!1,t.default.config.trimWhitespace=!0,t.default.use(r.default),t.default.use(o.a);const l=new o.a(i.a);e.Hippy.on("uncaughtException",e=>{console.error("uncaughtException error",e.stack,e.message)}),e.Hippy.on("unhandledRejection",e=>{console.error("unhandledRejection reason",e)});const c=new t.default({appName:"Demo",rootView:"#root",render:e=>e(s.a),iPhone:{statusBar:{backgroundColor:4283416717}},router:l});c.$start((e,a)=>{console.log("instance",e,"initialProps",a),t.default.Native.BackAndroid.addListener(()=>(console.log("backAndroid"),!0))}),Object(n.b)(c)}.call(this,a("./node_modules/webpack/buildin/global.js"))},"./src/pages/menu.vue?vue&type=style&index=0&id=4fb46863&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/pages/menu.vue?vue&type=style&index=0&id=4fb46863&scoped=true&lang=css&")},"./src/pages/remote-debug.vue?vue&type=style&index=0&id=66065e90&scoped=true&lang=css&":function(e,t,a){"use strict";a("./node_modules/@hippy/vue-css-loader/dist/css-loader.js!../../packages/hippy-vue-loader/lib/loaders/stylePostLoader.js!../../packages/hippy-vue-loader/lib/index.js?!./src/pages/remote-debug.vue?vue&type=style&index=0&id=66065e90&scoped=true&lang=css&")},"./src/routes.js":function(e,t,a){"use strict";var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",{staticClass:"v4fb46863 feature-list"},[a("li",[a("div",{staticClass:"v4fb46863",attrs:{id:"version-info"}},[a("p",{staticClass:"v4fb46863 feature-title"},[e._v("\n Vue: "+e._s(e.Vue.version)+"\n ")]),e._v(" "),e.Vue.Native?a("p",{staticClass:"v4fb46863 feature-title"},[e._v("\n Hippy-Vue: "+e._s("unspecified"!==e.Vue.Native.version?e.Vue.Native.version:"master")+"\n ")]):e._e()])]),e._v(" "),e._m(0),e._v(" "),e._l(e.featureList,(function(t){return a("li",{key:t.id,staticClass:"v4fb46863 feature-item"},[a("router-link",{staticClass:"v4fb46863 button",attrs:{to:{path:"/demo/"+t.id}}},[e._v("\n "+e._s(t.name)+"\n ")])],1)})),e._v(" "),e.nativeFeatureList.length?a("li",[a("p",{staticClass:"v4fb46863 feature-title",attrs:{paintType:"fcp"}},[e._v("\n 终端组件 Demos\n ")])]):e._e(),e._v(" "),e._l(e.nativeFeatureList,(function(t){return a("li",{key:t.id,staticClass:"v4fb46863 feature-item"},[a("router-link",{staticClass:"v4fb46863 button",attrs:{to:{path:"/demo/"+t.id}}},[e._v("\n "+e._s(t.name)+"\n ")])],1)}))],2)};o._withStripped=!0;var r=a("./node_modules/@hippy/vue/dist/index.js"),s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v26278b5d button-demo"},[a("label",{staticClass:"v26278b5d button-label"},[e._v("按钮和状态绑定")]),e._v(" "),a("button",{staticClass:"v26278b5d button-demo-1",class:{"is-active":e.isClicked,"is-pressing":e.isPressing},on:{touchstart:e.onTouchBtnStart,touchmove:e.onTouchBtnMove,touchend:e.onTouchBtnEnd,click:e.clickView}},[e.isClicked?a("span",{staticClass:"v26278b5d button-text"},[e._v("视图已经被点击了,再点一下恢复")]):a("span",{staticClass:"v26278b5d button-text"},[e._v("视图尚未点击")])]),e._v(" "),a("img",{directives:[{name:"show",rawName:"v-show",value:e.isClicked,expression:"isClicked"}],staticClass:"v26278b5d button-demo-1-image",attrs:{alt:"demo1-image",src:"https://user-images.githubusercontent.com/12878546/148737148-d0b227cb-69c8-4b21-bf92-739fb0c3f3aa.png"}})])};s._withStripped=!0;var i={data:()=>({isClicked:!1,isPressing:!1}),methods:{clickView(){this.isClicked=!this.isClicked},onTouchBtnStart(e){console.log("onBtnTouchDown",e),e.stopPropagation()},onTouchBtnMove(e){console.log("onBtnTouchMove",e),e.stopPropagation(),console.log(e)},onTouchBtnEnd(e){console.log("onBtnTouchEnd",e),e.stopPropagation(),console.log(e)}}},n=(a("./src/components/demos/demo-button.vue?vue&type=style&index=0&id=26278b5d&scoped=true&lang=css&"),a("../../packages/hippy-vue-loader/lib/runtime/componentNormalizer.js")),l=Object(n.a)(i,s,[],!1,null,"26278b5d",null);l.options.__file="src/components/demos/demo-button.vue";var c=l.exports,d=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ve3dda614",attrs:{id:"div-demo"},on:{scroll:e.onOuterScroll}},[a("div",["ios"!==e.Vue.Native.Platform?a("div",[a("label",[e._v("水波纹效果: ")]),e._v(" "),a("div",{staticClass:"ve3dda614",style:Object.assign({},e.imgRectangle,e.imgRectangleExtra)},[a("demo-ripple-div",{staticClass:"ve3dda614",attrs:{"position-y":e.offsetY,"wrapper-style":e.imgRectangle,"native-background-android":{borderless:!0,color:"#666666"}}},[a("p",{staticClass:"ve3dda614",style:{color:"white",maxWidth:200}},[e._v("\n 外层背景图,内层无边框水波纹,受外层影响始终有边框\n ")])])],1),e._v(" "),a("demo-ripple-div",{staticClass:"ve3dda614",attrs:{"position-y":e.offsetY,"wrapper-style":e.circleRipple,"native-background-android":{borderless:!0,color:"#666666",rippleRadius:100}}},[a("p",{staticClass:"ve3dda614",style:{color:"black",textAlign:"center"}},[e._v("\n 无边框圆形水波纹\n ")])]),e._v(" "),a("demo-ripple-div",{staticClass:"ve3dda614",attrs:{"position-y":e.offsetY,"wrapper-style":e.squareRipple,"native-background-android":{borderless:!1,color:"#666666"}}},[a("p",{staticClass:"ve3dda614",style:{color:"#fff"}},[e._v("\n 带背景色水波纹\n ")])])],1):e._e(),e._v(" "),a("label",[e._v("背景图效果:")]),e._v(" "),a("div",{staticClass:"ve3dda614",style:e.demo1Style,attrs:{accessible:!0,"aria-label":"背景图","aria-disabled":!1,"aria-selected":!0,"aria-checked":!1,"aria-expanded":!1,"aria-busy":!0,role:"image","aria-valuemax":10,"aria-valuemin":1,"aria-valuenow":5,"aria-valuetext":"middle"}},[a("p",{staticClass:"ve3dda614 div-demo-1-text"},[e._v("\n Hippy 背景图展示\n ")])]),e._v(" "),a("label",[e._v("渐变色效果:")]),e._v(" "),e._m(0),e._v(" "),a("label",[e._v("Transform")]),e._v(" "),e._m(1),e._v(" "),a("label",[e._v("水平滚动:")]),e._v(" "),a("div",{ref:"demo-2",staticClass:"ve3dda614 div-demo-2",attrs:{bounces:!0,scrollEnabled:!0,pagingEnabled:!1,showsHorizontalScrollIndicator:!1},on:{scroll:e.onScroll,momentumScrollBegin:e.onMomentumScrollBegin,momentumScrollEnd:e.onMomentumScrollEnd,scrollBeginDrag:e.onScrollBeginDrag,scrollEndDrag:e.onScrollEndDrag}},[e._m(2)]),e._v(" "),a("label",[e._v("垂直滚动:")]),e._v(" "),a("div",{staticClass:"ve3dda614 div-demo-3",attrs:{showsVerticalScrollIndicator:!1}},[e._m(3)])])])};d._withStripped=!0;var p=a("./src/assets/defaultSource.jpg"),u=a.n(p),v=function(){var e=this.$createElement;return(this._self._c||e)("div",{ref:"ripple1",style:this.wrapperStyle,attrs:{nativeBackgroundAndroid:Object.assign({},this.nativeBackgroundAndroid)},on:{layout:this.onLayout,touchstart:this.onTouchStart,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}},[this._t("default")],2)};v._withStripped=!0;const y={display:"flex",height:"40px",width:"200px",backgroundImage:""+u.a,backgroundRepeat:"no-repeat",justifyContent:"center",alignItems:"center",marginTop:"10px",marginBottom:"10px"};var h={name:"DemoRippleDiv",props:{nativeBackgroundAndroid:{default:{borderless:!1}},wrapperStyle:{type:Object,default:()=>y},positionY:{default:0}},data(){return{scrollOffsetY:this.positionY,viewX:0,viewY:0,demo1Style:y}},watch:{positionY(e){this.scrollOffsetY=e}},mounted(){this.rippleRef=this.$refs.ripple1},methods:{async onLayout(){const e=await r.default.Native.measureInAppWindow(this.rippleRef);this.viewX=e.left,this.viewY=e.top},onTouchStart(e){const t=e.touches[0];this.rippleRef.setHotspot(t.clientX-this.viewX,t.clientY+this.scrollOffsetY-this.viewY),this.rippleRef.setPressed(!0)},onTouchEnd(){this.rippleRef.setPressed(!1)}}},f=Object(n.a)(h,v,[],!1,null,null,null);f.options.__file="src/components/demos/demo-ripple-div.vue";var m={components:{"demo-ripple-div":f.exports},data:()=>({Vue:r.default,offsetY:0,demo1Style:{display:"flex",height:"40px",width:"200px",backgroundImage:""+u.a,backgroundSize:"cover",backgroundRepeat:"no-repeat",justifyContent:"center",alignItems:"center",marginTop:"10px",marginBottom:"10px"},imgRectangle:{width:"260px",height:"56px",alignItems:"center",justifyContent:"center"},imgRectangleExtra:{marginTop:"20px",backgroundImage:""+u.a,backgroundSize:"cover",backgroundRepeat:"no-repeat"},circleRipple:{marginTop:"30px",width:"150px",height:"56px",alignItems:"center",justifyContent:"center",borderWidth:"3px",borderStyle:"solid",borderColor:"#40b883"},squareRipple:{marginBottom:"20px",alignItems:"center",justifyContent:"center",width:"150px",height:"150px",backgroundColor:"#40b883",marginTop:"30px",borderRadius:"12px",overflow:"hidden"}}),mounted(){this.demon2=this.$refs["demo-2"],setTimeout(()=>{this.demon2.scrollTo(50,0,1e3)},1e3)},methods:{onOuterScroll(e){this.offsetY=e.offsetY},onScroll(e){console.log("onScroll",e)},onMomentumScrollBegin(e){console.log("onMomentumScrollBegin",e)},onMomentumScrollEnd(e){console.log("onMomentumScrollEnd",e)},onScrollBeginDrag(e){console.log("onScrollBeginDrag",e)},onScrollEndDrag(e){console.log("onScrollEndDrag",e)}}},b=(a("./src/components/demos/demo-div.vue?vue&type=style&index=0&id=e3dda614&scoped=true&lang=css&"),Object(n.a)(m,d,[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ve3dda614 div-demo-1-1"},[t("p",{staticClass:"ve3dda614 div-demo-1-text"},[this._v("\n Hippy 背景渐变色展示\n ")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ve3dda614 div-demo-transform"},[t("p",{staticClass:"ve3dda614 div-demo-transform-text"},[this._v("\n Transform\n ")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ve3dda614 display-flex flex-row"},[a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n A\n ")]),e._v(" "),a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n B\n ")]),e._v(" "),a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n C\n ")]),e._v(" "),a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n D\n ")]),e._v(" "),a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n E\n ")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ve3dda614 display-flex flex-column"},[a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n A\n ")]),e._v(" "),a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n B\n ")]),e._v(" "),a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n C\n ")]),e._v(" "),a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n D\n ")]),e._v(" "),a("p",{staticClass:"ve3dda614 text-block"},[e._v("\n E\n ")])])}],!1,null,"e3dda614",null));b.options.__file="src/components/demos/demo-div.vue";var g=b.exports,_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"vc6df51b0",attrs:{id:"demo-img"}},[a("div",{staticClass:"vc6df51b0",attrs:{id:"demo-img-container"}},[a("label",[e._v("Contain:")]),e._v(" "),a("img",{staticClass:"vc6df51b0 image contain",attrs:{src:"https://user-images.githubusercontent.com/12878546/148736102-7cd9525b-aceb-41c6-a905-d3156219ef16.png",placeholder:e.defaultImage},on:{touchstart:e.onTouchStart,touchmove:e.onTouchMove,touchend:e.onTouchEnd}}),e._v(" "),a("label",[e._v("Cover:")]),e._v(" "),a("img",{staticClass:"vc6df51b0 image cover",attrs:{placeholder:e.defaultImage,src:"https://user-images.githubusercontent.com/12878546/148736102-7cd9525b-aceb-41c6-a905-d3156219ef16.png"}}),e._v(" "),a("label",[e._v("Center:")]),e._v(" "),a("img",{staticClass:"vc6df51b0 image center",attrs:{placeholder:e.defaultImage,src:"https://user-images.githubusercontent.com/12878546/148736102-7cd9525b-aceb-41c6-a905-d3156219ef16.png"}}),e._v(" "),a("label",[e._v("CapInsets:")]),e._v(" "),a("img",{staticClass:"vc6df51b0 image cover",attrs:{placeholder:e.defaultImage,src:"https://user-images.githubusercontent.com/12878546/148736102-7cd9525b-aceb-41c6-a905-d3156219ef16.png",capInsets:{top:50,left:50,bottom:50,right:50}}}),e._v(" "),a("label",[e._v("TintColor:")]),e._v(" "),a("img",{staticClass:"vc6df51b0 image center tint-color",attrs:{src:e.hippyLogoImage}}),e._v(" "),a("label",[e._v("Gif:")]),e._v(" "),a("img",{staticClass:"vc6df51b0 image cover",attrs:{placeholder:e.defaultImage,src:"https://user-images.githubusercontent.com/12878546/148736255-7193f89e-9caf-49c0-86b0-548209506bd6.gif"},on:{load:e.onLoad}}),e._v(" "),a("div",{staticClass:"vc6df51b0 img-result"},[a("p",[e._v("Load Result: "+e._s(e.gifLoadResult))])])])])};_._withStripped=!0;var C=a("./src/assets/hippyLogoWhite.png"),S=a.n(C),x={data:()=>({defaultImage:u.a,hippyLogoImage:S.a,gifLoadResult:{}}),methods:{onTouchStart(e){console.log("onTouchDown",e),e.stopPropagation()},onTouchMove(e){console.log("onTouchMove",e),e.stopPropagation(),console.log(e)},onTouchEnd(e){console.log("onTouchEnd",e),e.stopPropagation(),console.log(e)},onLoad(e){console.log("onLoad",e);const{width:t,height:a,url:o}=e;this.gifLoadResult={width:t,height:a,url:o}}}},w=(a("./src/components/demos/demo-img.vue?vue&type=style&index=0&id=c6df51b0&scoped=true&lang=css&"),Object(n.a)(x,_,[],!1,null,"c6df51b0",null));w.options.__file="src/components/demos/demo-img.vue";var A=w.exports,k=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"inputDemo",staticClass:"v76bc5c6f demo-input",on:{click:e.blurAllInput}},[a("label",[e._v("文本:")]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.text,expression:"text"}],ref:"input",staticClass:"v76bc5c6f input",attrs:{placeholder:"Text","caret-color":"yellow","underline-color-android":"grey","placeholder-text-color":"#40b883",editable:!0},domProps:{value:e.text},on:{click:e.stopPropagation,keyboardWillShow:e.onKeyboardWillShow,keyboardWillHide:e.onKeyboardWillHide,blur:e.onBlur,focus:e.onFocus,input:function(t){t.target.composing||(e.text=t.target.value)}}}),e._v(" "),a("div",[a("span",[e._v("文本内容为:")]),e._v(" "),a("span",[e._v(e._s(e.text))])]),e._v(" "),a("div",[a("span",[e._v(e._s("事件: "+e.event+" | isFocused: "+e.isFocused))])]),e._v(" "),a("button",{staticClass:"v76bc5c6f input-button",on:{click:e.clearTextContent}},[a("span",[e._v("清空文本内容")])]),e._v(" "),a("button",{staticClass:"v76bc5c6f input-button",on:{click:e.focus}},[a("span",[e._v("Focus")])]),e._v(" "),a("button",{staticClass:"v76bc5c6f input-button",on:{click:e.blur}},[a("span",[e._v("Blur")])]),e._v(" "),a("label",[e._v("数字:")]),e._v(" "),a("input",{staticClass:"v76bc5c6f input",attrs:{type:"number","caret-color":"yellow","underline-color-android":"grey","placeholder-text-color":"#40b883",placeholder:"Number"},on:{change:e.textChange,click:e.stopPropagation}}),e._v(" "),a("label",[e._v("密码:")]),e._v(" "),a("input",{staticClass:"v76bc5c6f input",attrs:{type:"password","caret-color":"yellow","underline-color-android":"grey","placeholder-text-color":"#40b883",placeholder:"Password"},on:{change:e.textChange,click:e.stopPropagation}}),e._v(" "),a("label",[e._v("文本(限制5个字符):")]),e._v(" "),a("input",{staticClass:"v76bc5c6f input",attrs:{maxlength:5,"caret-color":"yellow","underline-color-android":"grey","placeholder-text-color":"#40b883",placeholder:"5 个字符"},on:{change:e.textChange,click:e.stopPropagation}})])};k._withStripped=!0;var P={data:()=>({text:"",event:void 0,isFocused:void 0}),mounted(){this.getChildNodes(this.$refs.inputDemo.childNodes).find(e=>"input"===e.tagName).focus()},methods:{textChange(e){console.log(e.value)},blurAllInput(){this.getChildNodes(this.$refs.inputDemo.childNodes).filter(e=>"input"===e.tagName).forEach(e=>e.blur())},stopPropagation(e){e.stopPropagation()},clearTextContent(){this.text=""},onKeyboardWillHide(){console.log("onKeyboardWillHide")},onKeyboardWillShow(e){console.log("onKeyboardWillShow",e)},getChildNodes:e=>r.default.Native?e:Array.from(e),focus(e){e.stopPropagation(),this.$refs.input.focus()},blur(e){e.stopPropagation(),this.$refs.input.blur()},async onFocus(){this.isFocused=await this.$refs.input.isFocused(),this.event="onFocus"},async onBlur(){this.isFocused=await this.$refs.input.isFocused(),this.event="onBlur"}}},E=(a("./src/components/demos/demo-input.vue?vue&type=style&index=0&id=76bc5c6f&scoped=true&lang=css&"),Object(n.a)(P,k,[],!1,null,"76bc5c6f",null));E.options.__file="src/components/demos/demo-input.vue";var j=E.exports,T=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v36005ed6 p-demo"},[a("div",[a("label",[e._v("不带样式:")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-content",on:{touchstart:e.onTouchTextStart,touchmove:e.onTouchTextMove,touchend:e.onTouchTextEnd}},[e._v("\n 这是最普通的一行可点击文字\n ")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-content-status"},[e._v("\n 当前touch状态: "+e._s(e.labelTouchStatus)+"\n ")]),e._v(" "),a("label",[e._v("颜色:")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-1 p-demo-content"},[e._v("\n 这行文字改变了颜色\n ")]),e._v(" "),a("label",[e._v("尺寸:")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-2 p-demo-content"},[e._v("\n 这行改变了大小\n ")]),e._v(" "),a("label",[e._v("粗体:")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-3 p-demo-content"},[e._v("\n 这行加粗了\n ")]),e._v(" "),a("label",[e._v("下划线:")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-4 p-demo-content"},[e._v("\n 这里有条下划线\n ")]),e._v(" "),a("label",[e._v("删除线:")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-5 p-demo-content"},[e._v("\n 这里有条删除线\n ")]),e._v(" "),a("label",[e._v("自定义字体:")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-6 p-demo-content"},[e._v("\n 腾讯字体 Hippy\n ")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-6 p-demo-content",staticStyle:{"font-weight":"bold"}},[e._v("\n 腾讯字体 Hippy 粗体\n ")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-6 p-demo-content",staticStyle:{"font-style":"italic"}},[e._v("\n 腾讯字体 Hippy 斜体\n ")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-6 p-demo-content",staticStyle:{"font-weight":"bold","font-style":"italic"}},[e._v("\n 腾讯字体 Hippy 粗斜体\n ")]),e._v(" "),a("label",[e._v("文字阴影:")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-7 p-demo-content",style:e.textShadow,on:{click:e.changeTextShadow}},[e._v("\n 这里是文字灰色阴影,点击可改变颜色\n ")]),e._v(" "),a("label",[e._v("文本字符间距")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-8 p-demo-content",staticStyle:{"margin-bottom":"5px"}},[e._v("\n Text width letter-spacing -1\n ")]),e._v(" "),a("p",{staticClass:"v36005ed6 p-demo-9 p-demo-content",staticStyle:{"margin-top":"5px"}},[e._v("\n Text width letter-spacing 5\n ")]),e._v(" "),a("label",[e._v("字体 style:")]),e._v(" "),e._m(0),e._v(" "),a("label",[e._v("numberOfLines="+e._s(e.textMode.numberOfLines)+" | ellipsizeMode="+e._s(e.textMode.ellipsizeMode))]),e._v(" "),a("div",{staticClass:"v36005ed6 p-demo-content"},[a("p",{staticClass:"v36005ed6",style:{backgroundColor:"#40b883",marginBottom:10,paddingHorizontal:10,paddingVertical:5},attrs:{numberOfLines:e.textMode.numberOfLines,ellipsizeMode:e.textMode.ellipsizeMode}},[a("span",{staticClass:"v36005ed6",staticStyle:{"font-size":"19px",color:"white"}},[e._v("先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。")]),e._v(" "),a("span",[e._v("然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。")])]),e._v(" "),a("p",{staticClass:"v36005ed6",style:{backgroundColor:"#40b883",marginBottom:10,paddingHorizontal:10,paddingVertical:5},attrs:{numberOfLines:e.textMode.numberOfLines,ellipsizeMode:e.textMode.ellipsizeMode}},[e._v("\n "+e._s("line 1\n\nline 3\n\nline 5")+"\n ")]),e._v(" "),a("p",{staticClass:"v36005ed6",style:{backgroundColor:"#40b883",marginBottom:10,paddingHorizontal:10,paddingVertical:5,fontSize:14},attrs:{numberOfLines:e.textMode.numberOfLines,ellipsizeMode:e.textMode.ellipsizeMode}},[a("img",{staticClass:"v36005ed6",style:{width:24,height:24},attrs:{src:e.img1}}),e._v(" "),a("img",{staticClass:"v36005ed6",style:{width:24,height:24},attrs:{src:e.img2}})]),e._v(" "),a("div",{staticClass:"v36005ed6 button-bar"},[a("button",{staticClass:"v36005ed6 button",on:{click:e.incrementLine}},[a("span",[e._v("加一行")])]),e._v(" "),a("button",{staticClass:"v36005ed6 button",on:{click:e.decrementLine}},[a("span",[e._v("减一行")])])]),e._v(" "),a("div",{staticClass:"v36005ed6 button-bar"},[a("button",{staticClass:"v36005ed6 button",on:{click:function(){return e.changeMode("clip")}}},[a("span",[e._v("clip")])]),e._v(" "),a("button",{staticClass:"v36005ed6 button",on:{click:function(){return e.changeMode("head")}}},[a("span",[e._v("head")])]),e._v(" "),a("button",{staticClass:"v36005ed6 button",on:{click:function(){return e.changeMode("middle")}}},[a("span",[e._v("middle")])]),e._v(" "),a("button",{staticClass:"v36005ed6 button",on:{click:function(){return e.changeMode("tail")}}},[a("span",[e._v("tail")])])])]),e._v(" "),"android"===e.Platform?a("label",[e._v("break-strategy="+e._s(e.breakStrategy))]):e._e(),e._v(" "),"android"===e.Platform?a("div",{staticClass:"v36005ed6 p-demo-content"},[a("p",{staticClass:"v36005ed6",staticStyle:{"border-width":"1","border-color":"gray"},attrs:{"break-strategy":e.breakStrategy}},[e._v("\n "+e._s(e.longText)+"\n ")]),e._v(" "),a("div",{staticClass:"v36005ed6 button-bar"},[a("button",{staticClass:"v36005ed6 button",on:{click:function(){return e.changeBreakStrategy("simple")}}},[a("span",[e._v("simple")])]),e._v(" "),a("button",{staticClass:"v36005ed6 button",on:{click:function(){return e.changeBreakStrategy("high_quality")}}},[a("span",[e._v("high_quality")])]),e._v(" "),a("button",{staticClass:"v36005ed6 button",on:{click:function(){return e.changeBreakStrategy("balanced")}}},[a("span",[e._v("balanced")])])])]):e._e(),e._v(" "),a("label",[e._v("vertical-align")]),e._v(" "),a("div",{staticClass:"v36005ed6 p-demo-content"},[a("p",{staticClass:"v36005ed6",staticStyle:{"line-height":"50","background-color":"#40b883","padding-horizontal":"10","padding-vertical":"5"}},[a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-align":"top"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"18",height:"12","vertical-align":"middle"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"12","vertical-align":"baseline"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"36",height:"24","vertical-align":"bottom"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-align":"top"},attrs:{src:e.img3}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"18",height:"12","vertical-align":"middle"},attrs:{src:e.img3}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"12","vertical-align":"baseline"},attrs:{src:e.img3}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"36",height:"24","vertical-align":"bottom"},attrs:{src:e.img3}}),e._v(" "),a("span",{staticClass:"v36005ed6",staticStyle:{"font-size":"16","vertical-align":"top"}},[e._v("字")]),e._v(" "),a("span",{staticClass:"v36005ed6",staticStyle:{"font-size":"16","vertical-align":"middle"}},[e._v("字")]),e._v(" "),a("span",{staticClass:"v36005ed6",staticStyle:{"font-size":"16","vertical-align":"baseline"}},[e._v("字")]),e._v(" "),a("span",{staticClass:"v36005ed6",staticStyle:{"font-size":"16","vertical-align":"bottom"}},[e._v("字")])]),e._v(" "),"android"===e.Platform?a("p",[e._v("\n legacy mode:\n ")]):e._e(),e._v(" "),"android"===e.Platform?a("p",{staticClass:"v36005ed6",staticStyle:{lineHeight:"50","background-color":"#40b883","padding-horizontal":"10","padding-vertical":"5"}},[a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-alignment":"0"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"18",height:"12","vertical-alignment":"1"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"12","vertical-alignment":"2"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"36",height:"24","vertical-alignment":"3"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24",top:"-10"},attrs:{src:e.img3}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"18",height:"12",top:"-5"},attrs:{src:e.img3}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"12"},attrs:{src:e.img3}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"36",height:"24",top:"5"},attrs:{src:e.img3}}),e._v(" "),a("span",{staticClass:"v36005ed6",staticStyle:{"font-size":"16"}},[e._v("字")]),e._v(" "),a("span",{staticClass:"v36005ed6",staticStyle:{"font-size":"16"}},[e._v("字")]),e._v(" "),a("span",{staticClass:"v36005ed6",staticStyle:{"font-size":"16"}},[e._v("字")]),e._v(" "),a("span",{staticClass:"v36005ed6",staticStyle:{"font-size":"16"}},[e._v("字")])]):e._e()]),e._v(" "),a("label",[e._v("tint-color & background-color")]),e._v(" "),a("div",{staticClass:"v36005ed6 p-demo-content"},[a("p",{staticClass:"v36005ed6",staticStyle:{"background-color":"#40b883","padding-horizontal":"10","padding-vertical":"5"}},[a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-align":"middle","tint-color":"orange"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-align":"middle","tint-color":"orange","background-color":"#ccc"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-align":"middle","background-color":"#ccc"},attrs:{src:e.img2}}),e._v(" "),a("span",{staticClass:"v36005ed6",staticStyle:{"vertical-align":"middle","background-color":"#99f"}},[e._v("text")])]),e._v(" "),"android"===e.Platform?a("p",[e._v("\n legacy mode:\n ")]):e._e(),e._v(" "),"android"===e.Platform?a("p",{staticClass:"v36005ed6",staticStyle:{"background-color":"#40b883","padding-horizontal":"10","padding-vertical":"5"}},[a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","tint-color":"orange"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","tint-color":"orange","background-color":"#ccc"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","background-color":"#ccc"},attrs:{src:e.img2}})]):e._e()]),e._v(" "),a("label",[e._v("margin")]),e._v(" "),a("div",{staticClass:"v36005ed6 p-demo-content"},[a("p",{staticClass:"v36005ed6",staticStyle:{"line-height":"50","background-color":"#40b883","padding-horizontal":"10","padding-vertical":"5"}},[a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-align":"top","background-color":"#ccc",margin:"5"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-align":"middle","background-color":"#ccc",margin:"5"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-align":"baseline","background-color":"#ccc",margin:"5"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-align":"bottom","background-color":"#ccc",margin:"5"},attrs:{src:e.img2}})]),e._v(" "),"android"===e.Platform?a("p",[e._v("\n legacy mode:\n ")]):e._e(),e._v(" "),"android"===e.Platform?a("p",{staticClass:"v36005ed6",staticStyle:{"line-height":"50","background-color":"#40b883","padding-horizontal":"10","padding-vertical":"5"}},[a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-alignment":"0","background-color":"#ccc",margin:"5"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-alignment":"1","background-color":"#ccc",margin:"5"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-alignment":"2","background-color":"#ccc",margin:"5"},attrs:{src:e.img2}}),e._v(" "),a("img",{staticClass:"v36005ed6",staticStyle:{width:"24",height:"24","vertical-alignment":"3","background-color":"#ccc",margin:"5"},attrs:{src:e.img2}})]):e._e()])])])};T._withStripped=!0;var V={data:()=>({Platform:r.default.Native.Platform,textShadowIndex:0,isClicked:!1,isPressing:!1,labelTouchStatus:"",textShadow:{textShadowOffset:{x:1,y:1},textShadowRadius:3,textShadowColor:"grey"},textMode:{numberOfLines:2,ellipsizeMode:"tail"},img1:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAANlBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC3dmhyAAAAEXRSTlMA9QlZEMPc2Mmmj2VkLEJ4Rsx+pEgAAAChSURBVCjPjVLtEsMgCDOAdbbaNu//sttVPes+zvGD8wgQCLp/TORbUGMAQtQ3UBeSAMlF7/GV9Cmb5eTJ9R7H1t4bOqLE3rN2UCvvwpLfarhILfDjJL6WRKaXfzxc84nxAgLzCGSGiwKwsZUB8hPorZwUV1s1cnGKw+yAOrnI+7hatNIybl9Q3OkBfzopCw6SmDVJJiJ+yD451OS0/TNM7QnuAAbvCG0TSAAAAABJRU5ErkJggg==",img2:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAANlBMVEUAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC3dmhyAAAAEnRSTlMA/QpX7WQU2m27pi3Ej9KEQXaD5HhjAAAAqklEQVQoz41\n SWxLDIAh0RcFXTHL/yzZSO01LMpP9WJEVUNA9gfdXTioCSKE/kQQTQmf/ArRYva+xAcuPP37seFII2L7FN4BmXdHzlEPIpDHiZ0A7eIViPc\n w2QwqipkvMSdNEFBUE1bmMNOyE7FyFaIkAP4jHhhG80lvgkzBODTKpwhRMcexuR7fXzcp08UDq6GRbootp4oRtO3NNpd4NKtnR9hB6oaefw\n eIFQU0EfnGDRoQAAAAASUVORK5CYII=",img3:"https://user-images.githubusercontent.com/12878546/148736255-7193f89e-9caf-49c0-86b0-548209506bd6.gif",longText:"The 58-letter name Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch is the name of a town on Anglesey, an island of Wales.",breakStrategy:"simple"}),methods:{changeTextShadow(){this.textShadow={textShadowOffsetX:this.textShadowIndex%2==1?10:1,textShadowOffsetY:1,textShadowRadius:3,textShadowColor:this.textShadowIndex%2==1?"red":"grey"},this.textShadowIndex+=1},onTouchTextStart(e){this.labelTouchStatus="touch start",console.log("onTextTouchDown",e),e.stopPropagation()},onTouchTextMove(e){this.labelTouchStatus="touch move",console.log("onTextTouchMove",e),e.stopPropagation(),console.log(e)},onTouchTextEnd(e){this.labelTouchStatus="touch end",console.log("onTextTouchEnd",e),e.stopPropagation(),console.log(e)},incrementLine(){this.textMode.numberOfLines<6&&(this.textMode.numberOfLines+=1)},decrementLine(){this.textMode.numberOfLines>1&&(this.textMode.numberOfLines-=1)},changeMode(e){this.textMode.ellipsizeMode=e},changeBreakStrategy(e){this.breakStrategy=e}}},I=(a("./src/components/demos/demo-p.vue?vue&type=style&index=0&id=36005ed6&scoped=true&lang=css&"),Object(n.a)(V,T,[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v36005ed6 p-demo-content"},[t("p",{staticClass:"v36005ed6",staticStyle:{"font-style":"normal"}},[this._v("\n font-style: normal\n ")]),this._v(" "),t("p",{staticClass:"v36005ed6",staticStyle:{"font-style":"italic"}},[this._v("\n font-style: italic\n ")]),this._v(" "),t("p",[this._v("font-style: [not set]")])])}],!1,null,"36005ed6",null));I.options.__file="src/components/demos/demo-p.vue";var L=I.exports,Y=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v5819936a",attrs:{id:"shadow-demo"}},["android"===e.Platform?a("div",{staticClass:"v5819936a no-offset-shadow-demo-cube-android"},[e._m(0)]):e._e(),e._v(" "),"ios"===e.Platform?a("div",{staticClass:"v5819936a no-offset-shadow-demo-cube-ios"},[e._m(1)]):e._e(),e._v(" "),"ohos"===e.Platform?a("div",{staticClass:"v5819936a no-offset-shadow-demo-cube-ohos"},[e._m(2)]):e._e(),e._v(" "),"android"===e.Platform?a("div",{staticClass:"v5819936a offset-shadow-demo-cube-android"},[e._m(3)]):e._e(),e._v(" "),"ios"===e.Platform?a("div",{staticClass:"v5819936a offset-shadow-demo-cube-ios"},[e._m(4)]):e._e(),e._v(" "),"ohos"===e.Platform?a("div",{staticClass:"v5819936a offset-shadow-demo-cube-ohos"},[e._m(5)]):e._e()])};Y._withStripped=!0;var O={data:()=>({Platform:r.default.Native.Platform}),mounted(){this.Platform=r.default.Native.Platform}},H=(a("./src/components/demos/demo-shadow.vue?vue&type=style&index=0&id=5819936a&scoped=true&lang=css&"),Object(n.a)(O,Y,[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v5819936a no-offset-shadow-demo-content-android"},[t("p",[this._v("没有偏移阴影样式")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v5819936a no-offset-shadow-demo-content-ios"},[t("p",[this._v("没有偏移阴影样式")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v5819936a no-offset-shadow-demo-content-ohos"},[t("p",[this._v("没有偏移阴影样式")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v5819936a offset-shadow-demo-content-android"},[t("p",[this._v("偏移阴影样式")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v5819936a offset-shadow-demo-content-ios"},[t("p",[this._v("偏移阴影样式")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v5819936a offset-shadow-demo-content-ohos"},[t("p",[this._v("偏移阴影样式")])])}],!1,null,"5819936a",null));H.options.__file="src/components/demos/demo-shadow.vue";var D=H.exports,R=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v6cb502b6",attrs:{id:"demo-textarea"}},[a("label",[e._v("多行文本:")]),e._v(" "),a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.content,expression:"content"}],staticClass:"v6cb502b6 textarea",attrs:{rows:10,placeholder:"多行文本编辑器"},domProps:{value:e.content},on:{contentSizeChange:e.contentSizeChange,input:function(t){t.target.composing||(e.content=t.target.value)}}}),e._v(" "),a("div",{staticClass:"v6cb502b6 output-container"},[a("p",{staticClass:"v6cb502b6 output"},[e._v("\n 输入的文本为:"+e._s(e.content)+"\n ")])]),e._v(" "),"android"===e.Platform?a("label",[e._v("break-strategy="+e._s(e.breakStrategy))]):e._e(),e._v(" "),"android"===e.Platform?a("div",[a("textarea",{staticClass:"v6cb502b6 textarea",attrs:{defaultValue:e.longText,"break-strategy":e.breakStrategy}}),e._v(" "),a("div",{staticClass:"v6cb502b6 button-bar"},[a("button",{staticClass:"v6cb502b6 button",on:{click:function(){return e.changeBreakStrategy("simple")}}},[a("span",[e._v("simple")])]),e._v(" "),a("button",{staticClass:"v6cb502b6 button",on:{click:function(){return e.changeBreakStrategy("high_quality")}}},[a("span",[e._v("high_quality")])]),e._v(" "),a("button",{staticClass:"v6cb502b6 button",on:{click:function(){return e.changeBreakStrategy("balanced")}}},[a("span",[e._v("balanced")])])])]):e._e()])};R._withStripped=!0;var B={data:()=>({Platform:r.default.Native.Platform,content:"The quick brown fox jumps over the lazy dog,快灰狐狸跳过了懒 🐕。",longText:"The 58-letter name Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch is the name of a town on Anglesey, an island of Wales.",breakStrategy:"simple"}),methods:{contentSizeChange(e){console.log(e)},changeBreakStrategy(e){this.breakStrategy=e}}},U=(a("./src/components/demos/demo-textarea.vue?vue&type=style&index=0&id=6cb502b6&scoped=true&lang=css&"),Object(n.a)(B,R,[],!1,null,"6cb502b6",null));U.options.__file="src/components/demos/demo-textarea.vue";var N=U.exports,M=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v71b90789",attrs:{id:"demo-list"}},[a("ul",{ref:"list",staticClass:"v71b90789",style:e.horizontal&&{height:50,flex:0},attrs:{id:"list",horizontal:e.horizontal,exposureEventEnabled:!0,delText:e.delText,editable:!0,bounces:!0,rowShouldSticky:!0,overScrollEnabled:!0,scrollEventThrottle:1e3},on:{endReached:e.onEndReached,delete:e.onDelete,scroll:e.onScroll,momentumScrollBegin:e.onMomentumScrollBegin,momentumScrollEnd:e.onMomentumScrollEnd,scrollBeginDrag:e.onScrollBeginDrag,scrollEndDrag:e.onScrollEndDrag}},e._l(e.dataSource,(function(t,o){return a("li",{key:o+"_"+t.style,staticClass:"v71b90789",class:e.horizontal&&"item-horizontal-style",attrs:{type:t.style,sticky:1===o},on:{appear:function(t){return e.onAppear(o)},disappear:function(t){return e.onDisappear(o)},willAppear:function(t){return e.onWillAppear(o)},willDisappear:function(t){return e.onWillDisappear(o)}}},[1===t.style?a("div",{staticClass:"v71b90789 container"},[a("div",{staticClass:"v71b90789 item-container"},[a("p",{staticClass:"v71b90789",attrs:{numberOfLines:1}},[e._v("\n "+e._s(o+": Style 1 UI")+"\n ")])])]):2===t.style?a("div",{staticClass:"v71b90789 container"},[a("div",{staticClass:"v71b90789 item-container"},[a("p",{staticClass:"v71b90789",attrs:{numberOfLines:1}},[e._v("\n "+e._s(o+": Style 2 UI")+"\n ")])])]):5===t.style?a("div",{staticClass:"v71b90789 container"},[a("div",{staticClass:"v71b90789 item-container"},[a("p",{staticClass:"v71b90789",attrs:{numberOfLines:1}},[e._v("\n "+e._s(o+": Style 5 UI")+"\n ")])])]):a("div",{staticClass:"v71b90789 container"},[a("div",{staticClass:"v71b90789 item-container"},[a("p",{staticClass:"v71b90789",attrs:{id:"loading"}},[e._v("\n "+e._s(e.loadingState)+"\n ")])])]),e._v(" "),o!==e.dataSource.length-1?a("div",{staticClass:"v71b90789 separator-line"}):e._e()])})),0),e._v(" "),"android"===e.Vue.Native.Platform?a("div",{staticClass:"v71b90789",style:{position:"absolute",right:20,bottom:20,width:67,height:67,borderRadius:30,boxShadowOpacity:.6,boxShadowRadius:5,boxShadowOffsetX:3,boxShadowOffsetY:3,boxShadowColor:"#40b883"},on:{click:e.changeDirection}},[a("div",{staticClass:"v71b90789",style:{width:60,height:60,borderRadius:30,backgroundColor:"#40b883",display:"flex",justifyContent:"center",alignItems:"center"}},[a("p",{staticClass:"v71b90789",style:{color:"white"}},[e._v("\n 切换方向\n ")])])]):e._e(),e._v(" "),"ohos"===e.Vue.Native.Platform?a("div",{staticClass:"v71b90789",style:{position:"absolute",right:20,bottom:20,width:60,height:60,borderRadius:30,boxShadowOpacity:.6,boxShadowRadius:5,boxShadowOffsetX:3,boxShadowOffsetY:3,boxShadowColor:"#40b883"},on:{click:e.changeDirection}},[a("div",{staticClass:"v71b90789",style:{width:60,height:60,borderRadius:30,backgroundColor:"#40b883",display:"flex",justifyContent:"center",alignItems:"center"}},[a("p",{staticClass:"v71b90789",style:{color:"white"}},[e._v("\n 切换方向\n ")])])]):e._e()])};M._withStripped=!0;const F=[{style:1},{style:2},{style:5},{style:1},{style:2},{style:5},{style:1},{style:2},{style:5},{style:1},{style:2},{style:5},{style:1},{style:2},{style:5},{style:1},{style:2},{style:5},{style:1},{style:2},{style:5},{style:1},{style:2},{style:5},{style:1},{style:2},{style:5},{style:1},{style:2},{style:5}];var z={data:()=>({Vue:r.default,loadingState:"Loading now...",dataSource:[],delText:"Delete",horizontal:void 0}),mounted(){this.isLoading=!1,this.dataSource=F},methods:{changeDirection(){this.horizontal=void 0===this.horizontal||void 0},onAppear(e){console.log("onAppear",e)},onDisappear(e){console.log("onDisappear",e)},onWillAppear(e){console.log("onWillAppear",e)},onWillDisappear(e){console.log("onWillDisappear",e)},mockFetchData:()=>new Promise(e=>{setTimeout(()=>e(F),600)}),onDelete(e){this.dataSource.splice(e.index,1)},async onEndReached(){const{dataSource:e,isLoading:t}=this;if(t)return;this.isLoading=!0,this.dataSource=e.concat([{style:100}]);const a=await this.mockFetchData();this.dataSource=e.concat(a),this.isLoading=!1},onScroll(e){console.log("onScroll",e.offsetY),e.offsetY<=0?this.topReached||(this.topReached=!0,console.log("onTopReached")):this.topReached=!1},onMomentumScrollBegin(e){console.log("momentumScrollBegin",e)},onMomentumScrollEnd(e){console.log("momentumScrollEnd",e)},onScrollBeginDrag(e){console.log("onScrollBeginDrag",e)},onScrollEndDrag(e){console.log("onScrollEndDrag",e)}}},$=(a("./src/components/demos/demo-list.vue?vue&type=style&index=0&id=71b90789&scoped=true&lang=css&"),Object(n.a)(z,M,[],!1,null,"71b90789",null));$.options.__file="src/components/demos/demo-list.vue";var W=$.exports,K=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{style:e.iframeStyle,attrs:{id:"iframe-demo"}},[a("label",[e._v("地址栏:")]),e._v(" "),a("input",{ref:"input",attrs:{id:"address",name:"url",returnKeyType:"go"},domProps:{value:e.displayUrl},on:{endEditing:e.goToUrl,keyup:e.onKeyUp}}),e._v(" "),a("iframe",{ref:"iframe",attrs:{id:"iframe",src:e.url,method:"get"},on:{load:e.onLoad,loadStart:e.onLoadStart,loadEnd:e.onLoadEnd}})])};K._withStripped=!0;var G={data:()=>({url:"https://hippyjs.org",displayUrl:"https://hippyjs.org",iframeStyle:{"min-height":r.default.Native?100:"100vh"}}),methods:{onLoad(e){let{url:t}=e;void 0===t&&(t=this.$refs.iframe.src),t!==this.url&&(this.displayUrl=t)},onLoadStart(e){const{url:t}=e;console.log("onLoadStart",t)},onLoadEnd(e){const{url:t,success:a,error:o}=e;console.log("onLoadEnd",t,a,o)},onKeyUp(e){13===e.keyCode&&(e.preventDefault(),this.goToUrl({value:this.$refs.input.value}))},goToUrl(e){this.url=e.value}}},q=(a("./src/components/demos/demo-iframe.vue?vue&type=style&index=0&lang=css&"),Object(n.a)(G,K,[],!1,null,null,null));q.options.__file="src/components/demos/demo-iframe.vue";var Q=q.exports,X=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v77bce928",attrs:{id:"websocket-demo"}},[a("div",[a("p",{staticClass:"v77bce928 demo-title"},[e._v("\n Url:\n ")]),e._v(" "),a("input",{ref:"inputUrl",staticClass:"v77bce928",attrs:{value:"wss://echo.websocket.org"}}),e._v(" "),a("div",{staticClass:"v77bce928 row"},[a("button",{staticClass:"v77bce928",on:{click:e.connect}},[a("span",[e._v("Connect")])]),e._v(" "),a("button",{staticClass:"v77bce928",on:{click:e.disconnect}},[a("span",[e._v("Disconnect")])])])]),e._v(" "),a("div",[a("p",{staticClass:"v77bce928 demo-title"},[e._v("\n Message:\n ")]),e._v(" "),a("input",{ref:"inputMessage",staticClass:"v77bce928",attrs:{value:"Rock it with Hippy WebSocket"}}),e._v(" "),a("button",{staticClass:"v77bce928",on:{click:e.sendMessage}},[a("span",[e._v("Send")])])]),e._v(" "),a("div",[a("p",{staticClass:"v77bce928 demo-title"},[e._v("\n Log:\n ")]),e._v(" "),a("div",{staticClass:"v77bce928 output fullscreen"},[a("div",e._l(e.output,(function(t,o){return a("p",{key:o,staticClass:"v77bce928"},[e._v("\n "+e._s(t)+"\n ")])})),0)])])])};X._withStripped=!0;var J={data:()=>({output:[]}),methods:{connect(){this.$refs.inputUrl.getValue().then(e=>{this.disconnect();const t=new WebSocket(e);t.onopen=()=>this.appendOutput("[Opened] "+t.url),t.onclose=()=>this.appendOutput("[Closed] "+t.url),t.onerror=e=>this.appendOutput("[Error] "+e.reason),t.onmessage=e=>this.appendOutput("[Received] "+e.data),this.ws=t})},disconnect(){this.ws&&1===this.ws.readyState&&this.ws.close()},appendOutput(e){this.output.unshift(e)},sendMessage(){this.$refs.inputMessage.getValue().then(e=>{this.appendOutput("[Sent] "+e),this.ws.send(e)})}}},Z=(a("./src/components/demos/demo-websocket.vue?vue&type=style&index=0&id=77bce928&scoped=true&lang=css&"),Object(n.a)(J,X,[],!1,null,"77bce928",null));Z.options.__file="src/components/demos/demo-websocket.vue";var ee=Z.exports,te=function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v2ea31349",attrs:{id:"demo-dynamicimport"},on:{click:this.onAsyncComponentLoad}},[this._m(0),this._v(" "),this.loaded?t("div",{staticClass:"v2ea31349 async-com-wrapper"},[t("AsyncComponentFromLocal",{staticClass:"v2ea31349 async-component-outer-local"}),this._v(" "),t("AsyncComponentFromHttp")],1):this._e()])};te._withStripped=!0;var ae={components:{AsyncComponentFromLocal:()=>a.e(1).then(a.bind(null,"./src/components/demos/dynamicImport/async-component-local.vue")).then(e=>e).catch(e=>console.error("import async local component error",e)),AsyncComponentFromHttp:()=>a.e(0).then(a.bind(null,"./src/components/demos/dynamicImport/async-component-http.vue")).then(e=>e).catch(e=>console.error("import async remote component error",e))},data:()=>({loaded:!1}),methods:{onAsyncComponentLoad(){this.loaded=!0}}},oe=(a("./src/components/demos/demo-dynamicimport.vue?vue&type=style&index=0&id=2ea31349&scoped=true&lang=css&"),Object(n.a)(ae,te,[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v2ea31349 import-btn"},[t("p",[this._v("点我异步加载")])])}],!1,null,"2ea31349",null));oe.options.__file="src/components/demos/demo-dynamicimport.vue";var re=oe.exports,se=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v14216e7a demo-turbo"},[a("span",{staticClass:"v14216e7a result"},[e._v(" "+e._s(e.result)+" ")]),e._v(" "),a("ul",{staticClass:"v14216e7a",staticStyle:{flex:"1"}},e._l(e.funList,(function(t){return a("li",{key:t,staticClass:"v14216e7a cell"},[a("div",{staticClass:"v14216e7a contentView"},[a("div",{staticClass:"v14216e7a func-info"},[a("span",{staticClass:"v14216e7a",attrs:{numberOfLines:0}},[e._v("函数名:"+e._s(t))])]),e._v(" "),a("span",{staticClass:"v14216e7a action-button",on:{click:function(a){return a.stopPropagation(),function(){return e.onTurboFunc(t)}.apply(null,arguments)}}},[e._v("运行")])])])})),0)])};se._withStripped=!0;const ie=()=>getTurboModule("demoTurbo").getTurboConfig();var ne={data:()=>({config:null,result:"",funList:["getString","getNum","getBoolean","getMap","getObject","getArray","nativeWithPromise","getTurboConfig","printTurboConfig","getInfo","setInfo"]}),methods:{async onTurboFunc(e){if("nativeWithPromise"===e)this.result=await(async e=>turboPromise(getTurboModule("demoTurbo").nativeWithPromise)(e))("aaa");else if("getTurboConfig"===e)this.config=ie(),this.result="获取到config对象";else if("printTurboConfig"===e)this.result=(t=this.config||ie(),getTurboModule("demoTurbo").printTurboConfig(t));else if("getInfo"===e)this.result=(this.config||ie()).getInfo();else if("setInfo"===e)(this.config||ie()).setInfo("Hello World"),this.result="设置config信息成功";else{const t={getString:()=>{return e="123",getTurboModule("demoTurbo").getString(e);var e},getNum:()=>{return e=1024,getTurboModule("demoTurbo").getNum(e);var e},getBoolean:()=>{return e=!0,getTurboModule("demoTurbo").getBoolean(e);var e},getMap:()=>{return e=new Map([["a","1"],["b",2]]),getTurboModule("demoTurbo").getMap(e);var e},getObject:()=>{return e={c:"3",d:"4"},getTurboModule("demoTurbo").getObject(e);var e},getArray:()=>{return e=["a","b","c"],getTurboModule("demoTurbo").getArray(e);var e}};this.result=t[e]()}var t}}},le=(a("./src/components/demos/demo-turbo.vue?vue&type=style&index=0&id=14216e7a&scoped=true&lang=css&"),Object(n.a)(ne,se,[],!1,null,"14216e7a",null));le.options.__file="src/components/demos/demo-turbo.vue";var ce={demoDiv:{name:"div 组件",component:g},demoShadow:{name:"box-shadow",component:D},demoP:{name:"p 组件",component:L},demoButton:{name:"button 组件",component:c},demoImg:{name:"img 组件",component:A},demoInput:{name:"input 组件",component:j},demoTextarea:{name:"textarea 组件",component:N},demoUl:{name:"ul/li 组件",component:W},demoIFrame:{name:"iframe 组件",component:Q},demoWebSocket:{name:"WebSocket",component:ee},demoDynamicImport:{name:"DynamicImport",component:re},demoTurbo:{name:"Turbo",component:le.exports}},de=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v4ffd9eb0 set-native-props-demo"},[a("label",[e._v("setNativeProps实现拖动效果")]),e._v(" "),a("div",{staticClass:"v4ffd9eb0 native-demo-1-drag",style:{width:e.screenWidth},on:{touchstart:e.onTouchDown1,touchmove:e.onTouchMove1}},[a("div",{ref:"demo-1-point",staticClass:"v4ffd9eb0 native-demo-1-point"})]),e._v(" "),a("div",{staticClass:"v4ffd9eb0 splitter"}),e._v(" "),a("label",[e._v("普通渲染实现拖动效果")]),e._v(" "),a("div",{staticClass:"v4ffd9eb0 native-demo-2-drag",style:{width:e.screenWidth},on:{touchstart:e.onTouchDown2,touchmove:e.onTouchMove2}},[a("div",{ref:"demo-2-point",staticClass:"v4ffd9eb0 native-demo-2-point",style:{left:e.demon2Left+"px"}})])])};de._withStripped=!0;var pe={data:()=>({demon2Left:0,screenWidth:0}),mounted(){this.screenWidth=r.default.Native.Dimensions.screen.width,this.demon1Point=this.$refs["demo-1-point"]},methods:{onTouchDown1(e){e.stopPropagation();const t=e.touches[0].clientX-40;console.log("touchdown x",t,this.screenWidth),this.demon1Point.setNativeProps({style:{left:t}})},onTouchMove1(e){e.stopPropagation();const t=e.touches[0].clientX-40;console.log("touchmove x",t,this.screenWidth),this.demon1Point.setNativeProps({style:{left:t}})},onTouchDown2(e){e.stopPropagation(),this.demon2Left=e.touches[0].clientX-40,console.log("touchdown x",this.demon2Left,this.screenWidth)},onTouchMove2(e){e.stopPropagation(),this.demon2Left=e.touches[0].clientX-40,console.log("touchmove x",this.demon2Left,this.screenWidth)}}},ue=(a("./src/components/demos/demo-set-native-props.vue?vue&type=style&index=0&id=4ffd9eb0&scoped=true&lang=css&"),Object(n.a)(pe,de,[],!1,null,"4ffd9eb0",null));ue.options.__file="src/components/demos/demo-set-native-props.vue";var ve=ue.exports,ye=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"rect",staticClass:"v864846ba",attrs:{id:"demo-vue-native"}},[a("div",[e.Vue.Native.Platform?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Platform")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.Platform))])]):e._e(),e._v(" "),e.Vue.Native.Device?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Device")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.Device))])]):e._e(),e._v(" "),"ios"===e.Vue.Native.Platform?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.isIPhoneX")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.isIPhoneX))])]):e._e(),e._v(" "),"ios"===e.Vue.Native.Platform?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.OSVersion")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.OSVersion||"null"))])]):e._e(),e._v(" "),a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Localization")]),e._v(" "),a("p",[e._v(e._s("国际化相关信息"))]),e._v(" "),a("p",[e._v(e._s("国家 "+e.Vue.Native.Localization.country))]),e._v(" "),a("p",[e._v(e._s("语言 "+e.Vue.Native.Localization.language))]),e._v(" "),a("p",[e._v(e._s("方向 "+(1===e.Vue.Native.Localization.direction?"RTL":"LTR")))])]),e._v(" "),"android"===e.Vue.Native.Platform?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.APILevel")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.APILevel||"null"))])]):e._e(),e._v(" "),a("div",{staticClass:"v864846ba native-block",on:{layout:e.refreshScreenStatus}},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.screenIsVertical")]),e._v(" "),a("p",[e._v(e._s(e.screenIsVertical))])]),e._v(" "),e.Vue.Native.Dimensions.window.width?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Dimensions.window.width")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.Dimensions.window.width))])]):e._e(),e._v(" "),e.Vue.Native.Dimensions.window.height?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Dimensions.window.height")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.Dimensions.window.height))])]):e._e(),e._v(" "),e.Vue.Native.Dimensions.screen.width?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Dimensions.screen.width")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.Dimensions.screen.width))])]):e._e(),e._v(" "),e.Vue.Native.Dimensions.screen.height?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Dimensions.screen.height")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.Dimensions.screen.height))])]):e._e(),e._v(" "),e.Vue.Native.OnePixel?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.OnePixel")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.OnePixel))])]):e._e(),e._v(" "),e.Vue.Native.Dimensions.screen.navigatorBarHeight?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Dimensions.screen.navigatorBarHeight")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.Dimensions.screen.navigatorBarHeight))])]):e._e(),e._v(" "),e.Vue.Native.Dimensions.screen.statusBarHeight?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Dimensions.screen.statusBarHeight")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.Dimensions.screen.statusBarHeight))])]):e._e(),e._v(" "),"android"===e.Vue.Native.Platform&&void 0!==e.Vue.Native.Dimensions.screen.navigatorBarHeight?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.Dimensions.screen.navigatorBarHeight(Android only)")]),e._v(" "),a("p",[e._v(e._s(e.Vue.Native.Dimensions.screen.navigatorBarHeight))])]):e._e(),e._v(" "),e.app?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("App.$options.$superProps")]),e._v(" "),a("p",[e._v(e._s(JSON.stringify(e.app.$options.$superProps)))])]):e._e(),e._v(" "),e.app?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("App event")]),e._v(" "),a("div",[a("button",{staticClass:"v864846ba event-btn",on:{click:e.triggerAppEvent}},[a("span",{staticClass:"v864846ba event-btn-text"},[e._v("Trigger app event")])]),e._v(" "),a("div",{staticClass:"v864846ba event-btn-result"},[a("p",[e._v("Event triggered times: "+e._s(e.eventTriggeredTimes))])])])]):e._e(),e._v(" "),e.Vue.Native.getBoundingClientRect?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Vue.Native.getBoundingClientRect")]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("button",{staticClass:"v864846ba item-button",on:{click:function(){return e.getBoundingClientRect(!1)}}},[a("span",[e._v("relative to App")])]),e._v(" "),a("span",{staticClass:"v864846ba",staticStyle:{"max-width":"200px"}},[e._v(e._s(e.rect1))])]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("button",{staticClass:"v864846ba item-button",on:{click:function(){return e.getBoundingClientRect(!0)}}},[a("span",[e._v("relative to container")])]),e._v(" "),a("span",{staticClass:"v864846ba",staticStyle:{"max-width":"200px"}},[e._v(e._s(e.rect2))])])]):e._e(),e._v(" "),e.Vue.Native.AsyncStorage?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("AsyncStorage 使用")]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("button",{staticClass:"v864846ba item-button",on:{click:e.setItem}},[a("span",[e._v("setItem")])]),e._v(" "),a("span",[e._v(e._s(e.storageSetStatus))])]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("button",{staticClass:"v864846ba item-button",on:{click:e.removeItem}},[a("span",[e._v("removeItem")])]),e._v(" "),a("span",[e._v(e._s(e.storageSetStatus))])]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("button",{staticClass:"v864846ba item-button",on:{click:e.getItem}},[a("span",[e._v("getItem")])]),e._v(" "),a("span",[e._v(e._s(e.storageValue))])])]):e._e(),e._v(" "),e.Vue.Native.ImageLoader?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("ImageLoader 使用")]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("button",{staticClass:"v864846ba item-button",on:{click:e.getSize}},[a("span",[e._v("getSize")])]),e._v(" "),a("span",[e._v(e._s(e.imageSize))])])]):e._e(),e._v(" "),a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Fetch 使用")]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("span",[e._v(e._s(e.fetchText))])])]),e._v(" "),e.Vue.Native.NetInfo?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("NetInfo 使用")]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("span",[e._v(e._s(e.netInfoText))])])]):e._e(),e._v(" "),e.Vue.Native.Cookie?a("div",{staticClass:"v864846ba native-block"},[a("label",{staticClass:"v864846ba vue-native-title"},[e._v("Cookie 使用")]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("button",{staticClass:"v864846ba item-button",on:{click:e.setCookie}},[a("span",[e._v("setCookie")])]),e._v(" "),a("span",[e._v(e._s(e.cookieString))])]),e._v(" "),a("div",{staticClass:"v864846ba item-wrapper"},[a("button",{staticClass:"v864846ba item-button",on:{click:e.getCookie}},[a("span",[e._v("getCookie")])]),e._v(" "),a("span",[e._v(e._s(e.cookiesValue))])])]):e._e()])])};ye._withStripped=!0;var he=a("./src/util.js");var fe={data(){const{screenIsVertical:e}=r.default.Native;return{app:this.app,eventTriggeredTimes:0,rect1:null,rect2:null,Vue:r.default,screenIsVertical:e,storageValue:"",storageSetStatus:"ready to set",imageSize:"",netInfoText:"正在获取...",fetchText:"请求网址中...",cookieString:"ready to set",cookiesValue:"",hasLayout:!1}},async created(){this.storageValue="",this.imageSize="",this.netInfoText="",this.netInfoText=await r.default.Native.NetInfo.fetch(),this.netInfoListener=r.default.Native.NetInfo.addEventListener("change",e=>{this.netInfoText="收到通知: "+e.network_info}),fetch("https://hippyjs.org",{mode:"no-cors"}).then(e=>{this.fetchText="成功状态: "+e.status}).catch(e=>{this.fetchText="收到错误: "+e})},async mounted(){this.app=Object(he.a)(),this.app.$on("testEvent",()=>{this.eventTriggeredTimes+=1})},beforeDestroy(){this.netInfoListener&&r.default.Native.NetInfo.remove("change",this.netInfoListener),this.app.$off("testEvent"),delete this.app},methods:{async getBoundingClientRect(e=!1){try{const t=await r.default.Native.getBoundingClientRect(this.$refs.rect,{relToContainer:e});e?this.rect2=""+JSON.stringify(t):this.rect1=""+JSON.stringify(t)}catch(e){console.error("getBoundingClientRect error",e)}},triggerAppEvent(){this.app.$emit("testEvent")},refreshScreenStatus(){this.screenIsVertical=r.default.Native.screenIsVertical},setItem(){r.default.Native.AsyncStorage.setItem("itemKey","hippy"),this.storageSetStatus='set "hippy" value succeed'},removeItem(){r.default.Native.AsyncStorage.removeItem("itemKey"),this.storageSetStatus='remove "hippy" value succeed'},async getItem(){const e=await r.default.Native.AsyncStorage.getItem("itemKey");this.storageValue=e||"undefined"},async getSize(){const e=await r.default.Native.ImageLoader.getSize("https://hippyjs.org/assets/img/tv.png");console.log("ImageLoader getSize",e),this.imageSize=`${e.width}x${e.height}`},setCookie(){r.default.Native.Cookie.set("https://hippyjs.org","name=hippy;network=mobile"),this.cookieString="'name=hippy;network=mobile' is set"},getCookie(){r.default.Native.Cookie.getAll("https://hippyjs.org").then(e=>{this.cookiesValue=e})}}},me=(a("./src/components/native-demos/demo-vue-native.vue?vue&type=style&index=0&id=864846ba&scoped=true&lang=css&"),Object(n.a)(fe,ye,[],!1,null,"864846ba",null));me.options.__file="src/components/native-demos/demo-vue-native.vue";var be=me.exports,ge=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",{staticClass:"v1b9933af",attrs:{id:"animation-demo"}},[a("li",[a("label",[e._v("控制动画")]),e._v(" "),a("div",{staticClass:"v1b9933af toolbar"},[a("button",{staticClass:"v1b9933af toolbar-btn",on:{click:e.toggleLoopPlaying}},[e.loopPlaying?a("span",[e._v("暂停")]):a("span",[e._v("播放")])]),e._v(" "),a("button",{staticClass:"v1b9933af toolbar-btn",on:{click:e.toggleDirection}},["horizon"===e.direction?a("span",[e._v("切换为纵向")]):a("span",[e._v("切换为横向")])])]),e._v(" "),a("div",{staticClass:"v1b9933af",staticStyle:{height:"150px"}},[a("loop",{staticClass:"v1b9933af",attrs:{playing:e.loopPlaying,direction:e.direction,"on-ref":e.onRef},on:{actionsDidUpdate:e.actionsDidUpdate}},[a("p",[e._v("I'm a looping animation")])])],1)]),e._v(" "),a("li",[a("div",{staticClass:"v1b9933af",staticStyle:{"margin-top":"10px"}}),e._v(" "),a("label",[e._v("点赞笑脸动画:")]),e._v(" "),a("div",{staticClass:"v1b9933af toolbar"},[a("button",{staticClass:"v1b9933af toolbar-btn",on:{click:e.voteUp}},[a("span",[e._v("点赞 👍")])]),e._v(" "),a("button",{staticClass:"v1b9933af toolbar-btn",on:{click:e.voteDown}},[a("span",[e._v("踩 👎")])])]),e._v(" "),a("div",{staticClass:"v1b9933af vote-face-container center"},[a(e.voteComponent,{tag:"component",staticClass:"v1b9933af vote-icon",attrs:{"is-changed":e.isChanged}})],1)]),e._v(" "),a("li",[a("div",{staticClass:"v1b9933af",staticStyle:{"margin-top":"10px"}}),e._v(" "),a("label",[e._v("渐变色动画")]),e._v(" "),a("div",{staticClass:"v1b9933af toolbar"},[a("button",{staticClass:"v1b9933af toolbar-btn",on:{click:e.toggleColorPlaying}},[e.colorPlaying?a("span",[e._v("暂停")]):a("span",[e._v("播放")])])]),e._v(" "),a("div",[a("color-component",{staticClass:"v1b9933af",attrs:{playing:e.colorPlaying}},[a("p",[e._v("背景色渐变")])])],1)]),e._v(" "),a("li",[a("div",{staticClass:"v1b9933af",staticStyle:{"margin-top":"10px"}}),e._v(" "),a("label",[e._v("贝塞尔曲线动画")]),e._v(" "),a("div",{staticClass:"v1b9933af toolbar"},[a("button",{staticClass:"v1b9933af toolbar-btn",on:{click:e.toggleCubicPlaying}},[e.cubicPlaying?a("span",[e._v("暂停")]):a("span",[e._v("播放")])])]),e._v(" "),a("div",[a("cubic-bezier",{staticClass:"v1b9933af",attrs:{playing:e.cubicPlaying}},[a("p",[e._v("cubic-bezier(.45,2.84,.38,.5)")])])],1)])])};ge._withStripped=!0;var _e=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("animation",{ref:"animationLoop",staticClass:"v63fc9d7f loop-green",style:{backgroundColor:"grey"},attrs:{playing:e.playing,actions:e.loopActions},on:{actionsDidUpdate:function(t){return e.$emit("actionsDidUpdate")}}},[a("div",{staticClass:"v63fc9d7f loop-white"},[e._t("default")],2)])],1)};_e._withStripped=!0;const Ce={transform:{translateX:{startValue:0,toValue:200,duration:2e3,repeatCount:-1}}},Se={transform:{translateY:{startValue:0,toValue:50,duration:2e3,repeatCount:-1}}};var xe={props:{playing:Boolean,direction:{validator:e=>["horizon","vertical"].indexOf(e)>-1},onRef:Function},data(){let e;switch(this.$props.direction){case"horizon":e=Ce;break;case"vertical":e=Se;break;default:throw new Error("direction must be defined in props")}return{loopActions:e}},watch:{direction(e){switch(e){case"horizon":this.loopActions=Ce;break;case"vertical":this.loopActions=Se}}},mounted(){this.$props.onRef&&this.$props.onRef(this.$refs.animationLoop)}},we=(a("./src/components/native-demos/animations/loop.vue?vue&type=style&index=0&id=63fc9d7f&scoped=true&lang=css&"),Object(n.a)(xe,_e,[],!1,null,"63fc9d7f",null));we.options.__file="src/components/native-demos/animations/loop.vue";var Ae=we.exports,ke=function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("animation",{ref:"animationView",staticClass:"v44bf239d loop-green",attrs:{playing:this.playing,actions:this.loopActions}},[t("div",{staticClass:"v44bf239d loop-white"},[this._t("default")],2)])],1)};ke._withStripped=!0;const Pe={transform:{translateX:[{startValue:50,toValue:150,duration:1e3,timingFunction:"cubic-bezier(0.45,2.84, 000.38,.5)"},{startValue:150,toValue:50,duration:1e3,repeatCount:-1,timingFunction:"cubic-bezier(0.45,2.84, 000.38,.5)"}]}};var Ee={props:{playing:Boolean,onRef:Function},data:()=>({loopActions:Pe}),mounted(){this.$props.onRef&&this.$props.onRef(this.$refs.animationView)}},je=(a("./src/components/native-demos/animations/cubic-bezier.vue?vue&type=style&index=0&id=44bf239d&scoped=true&lang=css&"),Object(n.a)(Ee,ke,[],!1,null,"44bf239d",null));je.options.__file="src/components/native-demos/animations/cubic-bezier.vue";var Te=je.exports,Ve=function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("animation",{staticClass:"vca89125a vote-face",attrs:{actions:this.animations.face,playing:""}}),this._v(" "),t("animation",{staticClass:"vca89125a vote-up-eye",attrs:{tag:"img",playing:"",props:{src:this.imgs.upVoteEye},actions:this.animations.upVoteEye}}),this._v(" "),t("animation",{staticClass:"vca89125a vote-up-mouth",attrs:{tag:"img",playing:"",props:{src:this.imgs.upVoteMouth},actions:this.animations.upVoteMouth}})],1)};Ve._withStripped=!0;var Ie={data:()=>({imgs:{upVoteEye:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAFCAYAAABIHbx0AAAAAXNSR0IArs4c6QAAAQdJREFUGBljZACCVeVK/L8//m9i/P/flIGR8ZgwD2+9e8+lryA5dLCzRI/77ZfPjQz//1v9Z2Q8zcrPWBfWee8j45mZxqw3z709BdRgANPEyMhwLFIiwZaxoeEfTAxE/29oYFr+YsHh//8ZrJDEL6gbCZsxO8pwJP9nYEhFkgAxZS9/vXxj3Zn3V5DF1TQehwNdUogsBmRLvH/x4zHLv///PRgZGH/9Z2TYzsjAANT4Xxko6c/A8M8DSK9A1sQIFPvPwPibkeH/VmAQXAW6TAWo3hdkBgsTE9Pa/2z/s6In3n8J07SsWE2E4esfexgfRgMt28rBwVEZPOH6c5jYqkJtod/ff7gBAOnFYtdEXHPzAAAAAElFTkSuQmCC",upVoteMouth:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAMAAACLgl7OAAAA4VBMVEUAAACobCawciy0f0OmaSOmaSKlaCCmZyCmaCGpayO2hEmpbiq3hUuweTqscjCmaCGmZyCmZyClaCCmaCCmaSGoaCL///+vdzimaCGmaCKmaSKlZyGmaCGmaCGnaCGnaCGnaCGmaCKscCW/gEDDmmm9j1m6ilSnaSOmaSGqcCylZyGrcCymZyClaCGnaCKmaSCqaiumbyH///+lZyDTtJDawKLLp37XupmyfT/+/v3o18XfybDJo3jBlWP8+vf48+z17uXv49bq3Mv28Ony6N3x59zbwqXSs5DQsIrNqoK5h0+BlvpqAAAAMnRSTlMA/Qv85uChjIMl/f38/Pv4zq6nl04wAfv18tO7tXx0Y1tGEQT+/v3b1q+Ui35sYj8YF964s/kAAADySURBVCjPddLHVsJgEIbhL6QD6Qldqr2bgfTQ7N7/Bckv6omYvItZPWcWcwbTC+f6dqLWcFBNvRsPZekKNeKI1RFMS3JkRZEdyTKFDrEaNACMt3i9TcP3KOLb+g5zepuPoiBMk6elr0mAkPlfBQs253M2F4G/j5OBPl8NNjQGhrSqBCHdAx6lleCkB6AlNqvAho6wa0RJBTjuThmYifVlKUjYApZLWRl41M9/7qtQ+B+sml0V37VsCuID8KwZE+BXKFTPiyB75QQPxVyR+Jf1HsTbvEH2A/42G50Raaf1j7zZIMPyUJJ6Y/d7ojm4dAvf8QkUbUjwOwWDwQAAAABJRU5ErkJggg=="},animations:{face:{transform:{scale:[{startValue:1,toValue:1.2,duration:250,timingFunction:"linear"},{startValue:1.2,toValue:1,duration:250,delay:750,timingFunction:"linear"}]}},upVoteEye:{top:[{startValue:14,toValue:8,delay:250,duration:125},{startValue:8,toValue:14,duration:250},{startValue:14,toValue:8,duration:250},{startValue:8,toValue:14,duration:125}],transform:{scale:[{startValue:1.2,toValue:1.4,duration:250,timingFunction:"linear"},{startValue:1.4,toValue:1.2,delay:750,duration:250,timingFunction:"linear"}]}},upVoteMouth:{bottom:[{startValue:9,toValue:14,delay:250,duration:125},{startValue:14,toValue:9,duration:250},{startValue:9,toValue:14,duration:250},{startValue:14,toValue:9,duration:125}],transform:{scale:[{startValue:1,toValue:1.2,duration:250,timingFunction:"linear"},{startValue:1.2,toValue:1,delay:750,duration:250,timingFunction:"linear"}],scaleY:[{startValue:.725,delay:250,toValue:1.45,duration:125},{startValue:1.45,toValue:.87,duration:250},{startValue:.87,toValue:1.45,duration:250},{startValue:1.45,toValue:1,duration:125}]}}}})},Le=(a("./src/components/native-demos/animations/vote-up.vue?vue&type=style&index=0&id=ca89125a&scoped=true&lang=css&"),Object(n.a)(Ie,Ve,[],!1,null,"ca89125a",null));Le.options.__file="src/components/native-demos/animations/vote-up.vue";var Ye=Le.exports,Oe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("animation",{ref:"animationRef",staticClass:"v3adfe95a vote-face",attrs:{actions:e.animations.face,playing:""},on:{start:e.animationStart,end:e.animationEnd,repeat:e.animationRepeat,cancel:e.animationCancel}}),e._v(" "),a("animation",{staticClass:"v3adfe95a vote-down-face",attrs:{tag:"img",playing:"",props:{src:e.imgs.downVoteFace},actions:e.animations.downVoteFace}})],1)};Oe._withStripped=!0;const He={transform:{scale:[{startValue:1,toValue:1.2,duration:250,timingFunction:"linear"},{startValue:1.2,toValue:1,duration:250,delay:750,timingFunction:"linear"}]}},De={transform:{translateX:[{startValue:10,toValue:1,duration:250,timingFunction:"linear"},{startValue:1,toValue:10,duration:250,delay:750,timingFunction:"linear",repeatCount:-1}]}};var Re={props:["isChanged"],data:()=>({imgs:{downVoteFace:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXVBMVEUAAACmaCCoaSKlZyCmaCCoaiG0byOlZyCmaCGnaSKmaCCmZyClZyCmaCCmaSCybyymZyClaCGlaCGnaCCnaSGnaiOlZyKocCXMmTOmaCKnaCKmaSClZyGoZyClZyDPYmTmAAAAHnRSTlMA6S/QtjYO+FdJ4tyZbWYH7cewgTw5JRQFkHFfXk8vbZ09AAAAiUlEQVQY07WQRxLDMAhFPyq21dxLKvc/ZoSiySTZ+y3g8YcFA5wFcOkHYEi5QDkknparH5EZKS6GExQLs0RzUQUY6VYiK2ayNIapQ6EjNk2xd616Bi5qIh2fn8BqroS1XtPmgYKXxo+y07LuDrH95pm3LBM5FMpHWg2osOOLjRR6hR/WOw780bwASN0IT3NosMcAAAAASUVORK5CYII="},animations:{face:He,downVoteFace:{left:[{startValue:16,toValue:10,delay:250,duration:125},{startValue:10,toValue:24,duration:250},{startValue:24,toValue:10,duration:250},{startValue:10,toValue:16,duration:125}],transform:{scale:[{startValue:1,toValue:1.3,duration:250,timingFunction:"linear"},{startValue:1.3,toValue:1,delay:750,duration:250,timingFunction:"linear"}]}}}}),watch:{isChanged(e,t){!t&&e?(console.log("changed to face2"),this.animations.face=De):t&&!e&&(console.log("changed to face1"),this.animations.face=He),setTimeout(()=>{this.animationRef.start()},10)}},mounted(){this.animationRef=this.$refs.animationRef},methods:{animationStart(){console.log("animation-start callback")},animationEnd(){console.log("animation-end callback")},animationRepeat(){console.log("animation-repeat callback")},animationCancel(){console.log("animation-cancel callback")}}},Be=(a("./src/components/native-demos/animations/vote-down.vue?vue&type=style&index=0&id=3adfe95a&scoped=true&lang=css&"),Object(n.a)(Re,Oe,[],!1,null,"3adfe95a",null));Be.options.__file="src/components/native-demos/animations/vote-down.vue";var Ue=Be.exports,Ne=function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("animation",{ref:"animationView",staticClass:"vc3eb3b96 color-green",attrs:{playing:this.playing,actions:this.colorActions}},[t("div",{staticClass:"vc3eb3b96 color-white"},[this._t("default")],2)])],1)};Ne._withStripped=!0;const Me={backgroundColor:[{startValue:"#40b883",toValue:"yellow",valueType:"color",duration:1e3,delay:0,mode:"timing",timingFunction:"linear"},{startValue:"yellow",toValue:"#40b883",duration:1e3,valueType:"color",delay:0,mode:"timing",timingFunction:"linear",repeatCount:-1}]};var Fe={props:{playing:Boolean,onRef:Function},data:()=>({colorActions:Me})},ze=(a("./src/components/native-demos/animations/color-change.vue?vue&type=style&index=0&id=c3eb3b96&scoped=true&lang=css&"),Object(n.a)(Fe,Ne,[],!1,null,"c3eb3b96",null));ze.options.__file="src/components/native-demos/animations/color-change.vue";var $e=ze.exports,We={components:{Loop:Ae,colorComponent:$e,CubicBezier:Te},data:()=>({loopPlaying:!0,colorPlaying:!0,cubicPlaying:!0,direction:"horizon",voteComponent:Ye,colorComponent:$e,isChanged:!0}),methods:{onRef(e){this.animationRef=e},voteUp(){this.voteComponent=Ye},voteDown(){this.voteComponent=Ue,this.isChanged=!this.isChanged},toggleLoopPlaying(){this.loopPlaying=!this.loopPlaying},toggleColorPlaying(){this.colorPlaying=!this.colorPlaying},toggleCubicPlaying(){this.cubicPlaying=!this.cubicPlaying},toggleDirection(){this.direction="horizon"===this.direction?"vertical":"horizon"},actionsDidUpdate(){console.log("actions updated & startAnimation"),this.animationRef.start()}}},Ke=(a("./src/components/native-demos/demo-animation.vue?vue&type=style&index=0&id=1b9933af&scoped=true&lang=css&"),Object(n.a)(We,ge,[],!1,null,"1b9933af",null));Ke.options.__file="src/components/native-demos/demo-animation.vue";var Ge=Ke.exports,qe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"vbdcf35a6",attrs:{id:"dialog-demo"}},[a("label",[e._v("显示或者隐藏对话框:")]),e._v(" "),a("button",{staticClass:"vbdcf35a6 dialog-demo-button-1",on:{click:function(){return e.clickView("slide")}}},[a("span",{staticClass:"vbdcf35a6 button-text"},[e._v("显示对话框--slide")])]),e._v(" "),a("button",{staticClass:"vbdcf35a6 dialog-demo-button-1",on:{click:function(){return e.clickView("fade")}}},[a("span",{staticClass:"vbdcf35a6 button-text"},[e._v("显示对话框--fade")])]),e._v(" "),a("button",{staticClass:"vbdcf35a6 dialog-demo-button-1",on:{click:function(){return e.clickView("slide_fade")}}},[a("span",{staticClass:"vbdcf35a6 button-text"},[e._v("显示对话框--slide_fade")])]),e._v(" "),a("button",{staticClass:"vbdcf35a6 dialog-demo-button-1",style:[{borderColor:e.autoHideStatusBar?"#FF0000":"#40b883"}],on:{click:function(){return e.clickDialogConfig("hideStatusBar")}}},[a("span",{staticClass:"vbdcf35a6 button-text"},[e._v("隐藏状态栏")])]),e._v(" "),a("button",{staticClass:"vbdcf35a6 dialog-demo-button-1",style:[{borderColor:e.immersionStatusBar?"#FF0000":"#40b883"}],on:{click:function(){return e.clickDialogConfig("immerseStatusBar")}}},[a("span",{staticClass:"vbdcf35a6 button-text"},[e._v("沉浸式状态栏")])]),e._v(" "),a("button",{staticClass:"vbdcf35a6 dialog-demo-button-1",style:[{borderColor:e.autoHideNavigationBar?"#FF0000":"#40b883"}],on:{click:function(){return e.clickDialogConfig("hideNavigationBar")}}},[a("span",{staticClass:"vbdcf35a6 button-text"},[e._v("隐藏导航栏")])]),e._v(" "),e.dialogIsVisible?a("dialog",{staticClass:"vbdcf35a6",attrs:{animationType:e.dialogAnimationType,transparent:!0,supportedOrientations:e.supportedOrientations,immersionStatusBar:e.immersionStatusBar,autoHideStatusBar:e.autoHideStatusBar,autoHideNavigationBar:e.autoHideNavigationBar},on:{show:e.onShow,requestClose:e.onClose}},[a("div",{staticClass:"vbdcf35a6 dialog-demo-wrapper"},[a("div",{staticClass:"vbdcf35a6 fullscreen center row",on:{click:e.clickView}},[a("div",{staticClass:"vbdcf35a6 dialog-demo-close-btn center column",on:{click:e.stopPropagation}},[a("p",{staticClass:"vbdcf35a6 dialog-demo-close-btn-text"},[e._v("\n 点击空白区域关闭\n ")]),e._v(" "),a("button",{staticClass:"vbdcf35a6 dialog-demo-button-2",on:{click:e.clickOpenSecond}},[a("span",{staticClass:"vbdcf35a6 button-text"},[e._v("点击打开二级全屏弹窗")])])]),e._v(" "),e.dialog2IsVisible?a("dialog",{staticClass:"vbdcf35a6",attrs:{animationType:e.dialogAnimationType,transparent:!0,immersionStatusBar:e.immersionStatusBar,autoHideStatusBar:e.autoHideStatusBar,autoHideNavigationBar:e.autoHideNavigationBar},on:{requestClose:e.onClose}},[a("div",{staticClass:"vbdcf35a6 dialog-2-demo-wrapper center column row",on:{click:e.clickOpenSecond}},[a("p",{staticClass:"vbdcf35a6 dialog-demo-close-btn-text",staticStyle:{color:"white"}},[e._v("\n Hello 我是二级全屏弹窗,点击任意位置关闭。\n ")])])]):e._e()])])]):e._e()])};qe._withStripped=!0;var Qe={beforeRouteLeave(e,t,a){this.dialogIsVisible||a()},data:()=>({supportedOrientations:["portrait","portrait-upside-down","landscape","landscape-left","landscape-right"],dialogIsVisible:!1,dialog2IsVisible:!1,dialogAnimationType:"",immersionStatusBar:!1,autoHideStatusBar:!1,autoHideNavigationBar:!1}),methods:{clickView(e=""){this.dialogIsVisible=!this.dialogIsVisible,this.dialogIsVisible&&(this.dialogAnimationType=e)},clickOpenSecond(e){e.stopPropagation(),this.dialog2IsVisible=!this.dialog2IsVisible},clickDialogConfig(e){switch(e){case"hideStatusBar":this.autoHideStatusBar=!this.autoHideStatusBar;break;case"immerseStatusBar":this.immersionStatusBar=!this.immersionStatusBar;break;case"hideNavigationBar":this.autoHideNavigationBar=!this.autoHideNavigationBar}},onShow(){console.log("Dialog is opening")},onClose(e){e.stopPropagation(),this.dialog2IsVisible?this.dialog2IsVisible=!1:this.dialogIsVisible=!1,console.log("Dialog is closing")},stopPropagation(e){e.stopPropagation()}}},Xe=(a("./src/components/native-demos/demo-dialog.vue?vue&type=style&index=0&id=bdcf35a6&scoped=true&lang=css&"),Object(n.a)(Qe,qe,[],!1,null,"bdcf35a6",null));Xe.options.__file="src/components/native-demos/demo-dialog.vue";var Je=Xe.exports,Ze=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"demo-swiper"}},[a("div",{staticClass:"toolbar"},[a("button",{staticClass:"toolbar-btn",on:{click:e.scrollToPrevPage}},[a("span",[e._v("翻到上一页")])]),e._v(" "),a("button",{staticClass:"toolbar-btn",on:{click:e.scrollToNextPage}},[a("span",[e._v("翻到下一页")])]),e._v(" "),a("p",{staticClass:"toolbar-text"},[e._v("\n 当前第 "+e._s(e.currentSlideNum+1)+" 页\n ")])]),e._v(" "),a("swiper",{ref:"swiper",attrs:{id:"swiper","need-animation":"",current:e.currentSlide},on:{dragging:e.onDragging,dropped:e.onDropped,stateChanged:e.onStateChanged}},e._l(e.dataSource,(function(t){return a("swiper-slide",{key:t,style:{backgroundColor:4278222848+100*t}},[a("p",[e._v("I'm Slide "+e._s(t+1))])])})),1),e._v(" "),a("div",{attrs:{id:"swiper-dots"}},e._l(e.dataSource,(function(t){return a("div",{key:t,staticClass:"dot",class:{hightlight:e.currentSlideNum===t}})})),0)],1)};Ze._withStripped=!0;var et={data:()=>({dataSource:new Array(7).fill(0).map((e,t)=>t),currentSlide:2,currentSlideNum:2,state:"idle"}),mounted(){this.$maxSlideIndex=this.$refs.swiper.$el.childNodes.length-1},methods:{scrollToNextPage(){this.currentSlide 如果不需要显示加载情况,可以直接使用 ul 的 onEndReached 实现一直加载\n *\n * 事件:\n * idle: 滑动距离在 pull-footer 区域内触发一次,参数 contentOffset,滑动距离\n * pulling: 滑动距离超出 pull-footer 后触发一次,参数 contentOffset,滑动距离\n * released: 滑动超出距离,松手后触发一次\n */\n "),a("pull-footer",{ref:"pullFooter",staticClass:"v44ac5390 pull-footer",on:{idle:e.onFooterIdle,pulling:e.onFooterPulling,released:e.onEndReached}},[a("p",{staticClass:"v44ac5390 pull-footer-text"},[e._v("\n "+e._s(e.footerRefreshText)+"\n ")])])],2)])};ot._withStripped=!0;const rt="https://user-images.githubusercontent.com/12878546/148736841-59ce5d1c-8010-46dc-8632-01c380159237.jpg",st={style:1,itemBean:{title:"非洲总统出行真大牌,美制武装直升机和中国潜艇为其保驾",picList:[rt,rt,rt],subInfo:["三图评论","11评"]}},it={style:2,itemBean:{title:"彼得·泰尔:认知未来是投资人的谋生之道",picUrl:"https://user-images.githubusercontent.com/12878546/148736850-4fc13304-25d4-4b6a-ada3-cbf0745666f5.jpg",subInfo:["左文右图"]}},nt={style:5,itemBean:{title:"愤怒!美官员扬言:“不让中国拿走南海的岛屿,南海岛礁不属于中国”?",picUrl:"https://user-images.githubusercontent.com/12878546/148736859-29e3a5b2-612a-4fdd-ad21-dc5d29fa538f.jpg",subInfo:["六眼神魔 5234播放"]}};var lt=[nt,st,it,st,it,st,it,nt,st],ct=(r.default.component("StyleOne",{inheritAttrs:!1,props:["itemBean"],template:'\n
\n

\n {{ itemBean.title }}\n

\n
\n \n
\n
\n

\n {{ itemBean.subInfo.join(\'\') }}\n

\n
\n
\n '}),r.default.component("StyleTwo",{inheritAttrs:!1,props:["itemBean"],template:'\n
\n
\n

\n {{ itemBean.title }}\n

\n
\n

\n {{ itemBean.subInfo.join(\'\') }}\n

\n
\n
\n
\n \n
\n
\n '}),r.default.component("StyleFive",{inheritAttrs:!1,props:["itemBean"],template:'\n
\n

\n {{ itemBean.title }}\n

\n
\n \n
\n
\n

\n {{ itemBean.subInfo.join(\' \') }}\n

\n
\n
\n '}),{data:()=>({headerRefreshText:"继续下拉触发刷新",footerRefreshText:"正在加载...",dataSource:[],scrollPos:{top:0,left:0},Vue:r.default}),mounted(){this.loadMoreDataFlag=!1,this.fetchingDataFlag=!1,this.dataSource=[...lt],r.default.Native?(this.$windowHeight=r.default.Native.Dimensions.window.height,console.log("Vue.Native.Dimensions.window",r.default.Native.Dimensions)):this.$windowHeight=window.innerHeight,this.$refs.pullHeader.collapsePullHeader({time:2e3})},methods:{mockFetchData:()=>new Promise(e=>{setTimeout(()=>e(lt),800)}),onHeaderPulling(e){this.fetchingDataFlag||(console.log("onHeaderPulling",e.contentOffset),e.contentOffset>30?this.headerRefreshText="松手,即可触发刷新":this.headerRefreshText="继续下拉,触发刷新")},onFooterPulling(e){console.log("onFooterPulling",e)},onHeaderIdle(){},onFooterIdle(){},onScroll(e){e.stopPropagation(),this.scrollPos={top:e.offsetY,left:e.offsetX}},async onHeaderReleased(){if(this.fetchingDataFlag)return;this.fetchingDataFlag=!0,console.log("onHeaderReleased"),this.headerRefreshText="刷新数据中,请稍等";const e=await this.mockFetchData();this.dataSource=e.reverse(),this.fetchingDataFlag=!1,this.headerRefreshText="2秒后收起",this.$refs.pullHeader.collapsePullHeader({time:2e3})},async onEndReached(){const{dataSource:e}=this;if(this.loadMoreDataFlag)return;this.loadMoreDataFlag=!0,this.footerRefreshText="加载更多...";const t=await this.mockFetchData();0===t.length&&(this.footerRefreshText="没有更多数据"),this.dataSource=[...e,...t],this.loadMoreDataFlag=!1,this.$refs.pullFooter.collapsePullFooter()},scrollToNextPage(){if(!r.default.Native)return void alert("This method is only supported in Native environment.");const{list:e}=this.$refs,{scrollPos:t}=this,a=t.top+this.$windowHeight-200;e.scrollTo({left:t.left,top:a})},scrollToBottom(){if(!r.default.Native)return void alert("This method is only supported in Native environment.");const{list:e}=this.$refs;e.scrollToIndex(0,e.childNodes.length-1)}}}),dt=(a("./src/components/native-demos/demo-pull-header-footer.vue?vue&type=style&index=0&id=44ac5390&scoped=true&lang=css&"),Object(n.a)(ct,ot,[],!1,null,"44ac5390",null));dt.options.__file="src/components/native-demos/demo-pull-header-footer.vue";var pt=dt.exports,ut=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v782cda3d",attrs:{id:"demo-waterfall"}},[a("waterfall",{ref:"gridView",staticClass:"v782cda3d",style:{flex:1},attrs:{"content-inset":e.contentInset,"column-spacing":e.columnSpacing,"contain-banner-view":e.isIos,"contain-pull-footer":!0,"inter-item-spacing":e.interItemSpacing,"number-of-columns":e.numberOfColumns,"preload-item-number":4},on:{endReached:e.onEndReached,scroll:e.onScroll}},[a("pull-header",{ref:"pullHeader",staticClass:"v782cda3d ul-refresh",on:{idle:e.onHeaderIdle,pulling:e.onHeaderPulling,released:e.onHeaderReleased}},[a("p",{staticClass:"v782cda3d ul-refresh-text"},[e._v("\n "+e._s(e.headerRefreshText)+"\n ")])]),e._v(" "),e.isIos?a("div",{staticClass:"v782cda3d banner-view"},[a("span",[e._v("BannerView")])]):e._e(),e._v(" "),e.isOhos?a("div",{staticClass:"v782cda3d banner-view"},[a("span",[e._v("BannerView")])]):e._e(),e._v(" "),e.isAndroid?a("waterfall-item",{staticClass:"v782cda3d banner-view",attrs:{fullSpan:!0,",":""}},[a("span",[e._v("BannerView")])]):e._e(),e._v(" "),e._l(e.dataSource,(function(t,o){return a("waterfall-item",{key:o,staticClass:"v782cda3d",style:{width:e.itemWidth},attrs:{type:t.style},on:{click:function(t){return t.stopPropagation(),function(){return e.onItemClick(o)}.apply(null,arguments)}}},[1===t.style?a("style-one",{staticClass:"v782cda3d",attrs:{"item-bean":t.itemBean}}):e._e(),e._v(" "),2===t.style?a("style-two",{staticClass:"v782cda3d",attrs:{"item-bean":t.itemBean}}):e._e(),e._v(" "),5===t.style?a("style-five",{staticClass:"v782cda3d",attrs:{"item-bean":t.itemBean}}):e._e()],1)})),e._v(" "),a("pull-footer",{ref:"pullFooter",staticClass:"v782cda3d pull-footer",on:{idle:e.onFooterIdle,pulling:e.onFooterPulling,released:e.onEndReached}},[a("p",{staticClass:"v782cda3d pull-footer-text"},[e._v("\n "+e._s(e.footerRefreshText)+"\n ")])])],2)],1)};ut._withStripped=!0;var vt={data:()=>({dataSource:[...lt,...lt,...lt,...lt],isRefreshing:!1,Vue:r.default,STYLE_LOADING:100,headerRefreshText:"继续下拉触发刷新",footerRefreshText:"正在加载...",isLoading:!1,isIos:"ios"===r.default.Native.Platform,isAndroid:"android"===r.default.Native.Platform,isOhos:"ohos"===r.default.Native.Platform}),mounted(){this.loadMoreDataFlag=!1,this.fetchingDataFlag=!1,this.dataSource=[...lt],r.default.Native?(this.$windowHeight=r.default.Native.Dimensions.window.height,console.log("Vue.Native.Dimensions.window",r.default.Native.Dimensions)):this.$windowHeight=window.innerHeight,this.$refs.pullHeader.collapsePullHeader({time:2e3})},computed:{refreshText(){return this.isRefreshing?"正在刷新":"下拉刷新"},itemWidth(){return(r.default.Native.Dimensions.screen.width-this.contentInset.left-this.contentInset.right-(this.numberOfColumns-1)*this.columnSpacing)/this.numberOfColumns},listMargin:()=>5,columnSpacing:()=>6,interItemSpacing:()=>6,numberOfColumns:()=>2,contentInset:()=>({top:0,left:5,bottom:0,right:5})},methods:{mockFetchData(){return new Promise(e=>{setTimeout(()=>(this.fetchTimes+=1,this.fetchTimes>=50?e([]):e([...lt,...lt])),600)})},onHeaderPulling(e){this.fetchingDataFlag||(console.log("onHeaderPulling",e.contentOffset),e.contentOffset>30?this.headerRefreshText="松手,即可触发刷新":this.headerRefreshText="继续下拉,触发刷新")},onFooterPulling(e){console.log("onFooterPulling",e)},onHeaderIdle(){},onFooterIdle(){},async onHeaderReleased(){if(this.fetchingDataFlag)return;this.fetchingDataFlag=!0,console.log("onHeaderReleased"),this.headerRefreshText="刷新数据中,请稍等";await this.mockFetchData();this.fetchingDataFlag=!1,this.headerRefreshText="2秒后收起",this.$refs.pullHeader.collapsePullHeader({time:2e3})},async onRefresh(){this.isRefreshing=!0;const e=await this.mockFetchData();this.isRefreshing=!1,this.dataSource=e.reverse(),this.$refs.header.refreshCompleted()},onScroll(e){console.log("waterfall onScroll",e)},async onEndReached(){const{dataSource:e}=this;if(this.loadMoreDataFlag)return;this.loadMoreDataFlag=!0,this.footerRefreshText="加载更多...";const t=await this.mockFetchData();0===t.length&&(this.footerRefreshText="没有更多数据"),this.dataSource=[...e,...t],this.loadMoreDataFlag=!1,this.$refs.pullFooter.collapsePullFooter()},onItemClick(e){this.$refs.gridView.scrollToIndex({index:e,animation:!0})}}},yt=(a("./src/components/native-demos/demo-waterfall.vue?vue&type=style&index=0&id=782cda3d&scoped=true&lang=css&"),Object(n.a)(vt,ut,[],!1,null,"782cda3d",null));yt.options.__file="src/components/native-demos/demo-waterfall.vue";var ht=yt.exports,ft=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"v3bbacb8e",attrs:{id:"demo-wrap"},on:{layout:e.onLayout}},[a("div",{staticClass:"v3bbacb8e",attrs:{id:"demo-content"}},[a("div",{staticClass:"v3bbacb8e",attrs:{id:"banner"}}),e._v(" "),a("div",{staticClass:"v3bbacb8e",attrs:{id:"tabs"}},e._l(2,(function(t){return a("p",{key:"tab"+t,staticClass:"v3bbacb8e",class:e.currentSlide===t-1?"selected":"",on:{click:function(a){return e.onTabClick(t)}}},[e._v("\n tab "+e._s(t)+" "+e._s(1===t?"(parent first)":"(self first)")+"\n ")])})),0),e._v(" "),a("swiper",{ref:"swiper",staticClass:"v3bbacb8e",style:{height:e.layoutHeight-80},attrs:{id:"swiper","need-animation":"",current:e.currentSlide},on:{dropped:e.onDropped}},[a("swiper-slide",{key:"slide1",staticClass:"v3bbacb8e"},[a("ul",{staticClass:"v3bbacb8e",attrs:{nestedScrollTopPriority:"parent"}},e._l(30,(function(t){return a("li",{key:"item"+t,staticClass:"v3bbacb8e",class:t%2?"item-even":"item-odd"},[a("p",[e._v("Item "+e._s(t))])])})),0)]),e._v(" "),a("swiper-slide",{key:"slide2",staticClass:"v3bbacb8e"},[a("ul",{staticClass:"v3bbacb8e",attrs:{nestedScrollTopPriority:"self"}},e._l(30,(function(t){return a("li",{key:"item"+t,staticClass:"v3bbacb8e",class:t%2?"item-even":"item-odd"},[a("p",[e._v("Item "+e._s(t))])])})),0)])],1)],1)])};ft._withStripped=!0;var mt={data:()=>({layoutHeight:0,currentSlide:0}),methods:{onLayout(e){this.layoutHeight=e.height},onTabClick(e){console.log("onclick",e),this.currentSlide=e-1},onDropped(e){this.currentSlide=e.currentSlide}}},bt=(a("./src/components/native-demos/demo-nested-scroll.vue?vue&type=style&index=0&id=3bbacb8e&scoped=true&lang=css&"),Object(n.a)(mt,ft,[],!1,null,"3bbacb8e",null));bt.options.__file="src/components/native-demos/demo-nested-scroll.vue";var gt=bt.exports;const _t={};r.default.Native&&Object.assign(_t,{demoVueNative:{name:"Vue.Native 能力",component:be},demoAnimation:{name:"animation 组件",component:Ge},demoModal:{name:"dialog 组件",component:Je},demoSwiper:{name:"swiper 组件",component:at},demoPullHeaderFooter:{name:"pull-header/footer 组件",component:pt},demoWaterfall:{name:"waterfall 组件",component:ht},demoNestedScroll:{name:"nested scroll 示例",component:gt},demoSetNativeProps:{name:"setNativeProps",component:ve}});var Ct=_t,St={name:"App",data:()=>({featureList:Object.keys(ce).map(e=>({id:e,name:ce[e].name})),nativeFeatureList:Object.keys(Ct).map(e=>({id:e,name:Ct[e].name})),Vue:r.default}),beforeAppExit(){}},xt=(a("./src/pages/menu.vue?vue&type=style&index=0&id=4fb46863&scoped=true&lang=css&"),Object(n.a)(St,o,[function(){var e=this.$createElement,t=this._self._c||e;return t("li",[t("p",{staticClass:"v4fb46863 feature-title"},[this._v("\n 浏览器组件 Demos\n ")])])}],!1,null,"4fb46863",null));xt.options.__file="src/pages/menu.vue";var wt=xt.exports,At=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"inputDemo",staticClass:"v66065e90 demo-remote-input",on:{click:e.blurInput}},[a("div",{staticClass:"v66065e90 tips-wrap"},e._l(e.tips,(function(t,o){return a("p",{key:o,staticClass:"v66065e90 tips-item",style:e.styles.tipText},[e._v("\n "+e._s(o+1)+". "+e._s(t)+"\n ")])})),0),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.bundleUrl,expression:"bundleUrl"}],ref:"input",staticClass:"v66065e90 remote-input",attrs:{"caret-color":"yellow",placeholder:"please input bundleUrl",multiple:!0,numberOfLines:"4"},domProps:{value:e.bundleUrl},on:{click:e.stopPropagation,input:function(t){t.target.composing||(e.bundleUrl=t.target.value)}}}),e._v(" "),a("div",{staticClass:"v66065e90 buttonContainer",style:e.styles.buttonContainer},[a("button",{staticClass:"v66065e90 input-button",style:e.styles.button,on:{click:e.openBundle}},[a("span",{staticClass:"v66065e90",style:e.styles.buttonText},[e._v("开始")])])])])};At._withStripped=!0;var kt={data:()=>({bundleUrl:"http://127.0.0.1:38989/index.bundle?debugUrl=ws%3A%2F%2F127.0.0.1%3A38989%2Fdebugger-proxy",tips:["安装远程调试依赖: npm i -D @hippy/debug-server-next@latest","修改 webpack 配置,添加远程调试地址","运行 npm run hippy:dev 开始编译,编译结束后打印出 bundleUrl 及调试首页地址","粘贴 bundleUrl 并点击开始按钮","访问调试首页开始远程调试,远程调试支持热更新(HMR)"],styles:{tipText:{color:"#242424",marginBottom:12},button:{width:200,height:40,borderRadius:8,backgroundColor:"#4c9afa",alignItems:"center",justifyContent:"center"},buttonText:{fontSize:16,textAlign:"center",lineHeight:40,color:"#fff"},buttonContainer:{alignItems:"center",justifyContent:"center"}}}),methods:{blurInput(e){e.stopPropagation(),this.$refs.input.blur()},openBundle(){this.bundleUrl&&r.default.Native.callNative("TestModule","remoteDebug",this.$root.$options.rootViewId,this.bundleUrl)},stopPropagation(e){e.stopPropagation()},clearTextContent(){this.bundleUrl=""},getChildNodes:e=>r.default.Native?e:Array.from(e)}},Pt=(a("./src/pages/remote-debug.vue?vue&type=style&index=0&id=66065e90&scoped=true&lang=css&"),Object(n.a)(kt,At,[],!1,null,"66065e90",null));Pt.options.__file="src/pages/remote-debug.vue";var Et=Pt.exports;t.a={disableAutoBack:!1,routes:[{path:"/",component:wt},{path:"/remote-debug",component:Et,name:"调试"},...Object.keys(ce).map(e=>({path:"/demo/"+e,name:ce[e].name,component:ce[e].component})),...Object.keys(Ct).map(e=>({path:"/demo/"+e,name:Ct[e].name,component:Ct[e].component}))]}},"./src/util.js":function(e,t,a){"use strict";let o;function r(e){o=e}function s(){return o}a.d(t,"b",(function(){return r})),a.d(t,"a",(function(){return s}))},0:function(e,t,a){e.exports=a("./src/main-native.js")},"dll-reference hippyVueBase":function(e,t){e.exports=hippyVueBase}}); \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/vendor-manifest.json b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/vendor-manifest.json new file mode 100644 index 00000000000..854853e2dc5 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/vendor-manifest.json @@ -0,0 +1 @@ +{"name":"hippyVueBase","content":{"./node_modules/@hippy/vue-native-components/dist/index.js":{"id":"./node_modules/@hippy/vue-native-components/dist/index.js","buildMeta":{"exportsType":"namespace","providedExports":["AnimationComponent","DialogComponent","ListRefreshComponent","PullsComponents","SwiperComponent","WaterfallComponent","default"]}},"./node_modules/@hippy/vue/dist/index.js":{"id":"./node_modules/@hippy/vue/dist/index.js","buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"./node_modules/process/browser.js":{"id":"./node_modules/process/browser.js","buildMeta":{"providedExports":true}},"./node_modules/setimmediate/setImmediate.js":{"id":"./node_modules/setimmediate/setImmediate.js","buildMeta":{"providedExports":true}},"./node_modules/timers-browserify/main.js":{"id":"./node_modules/timers-browserify/main.js","buildMeta":{"providedExports":true}},"./node_modules/webpack/buildin/global.js":{"id":"./node_modules/webpack/buildin/global.js","buildMeta":{"providedExports":true}},"./scripts/vendor.js":{"id":"./scripts/vendor.js","buildMeta":{"providedExports":true}}}} \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/vendor.ohos.js b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/vendor.ohos.js new file mode 100644 index 00000000000..c2ad80c3cf3 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/main/resources/rawfile/vue2/vendor.ohos.js @@ -0,0 +1,49 @@ +var hippyVueBase=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}({"./node_modules/@hippy/vue-native-components/dist/index.js":function(e,t,n){"use strict";n.r(t),function(e){ +/*! + * @hippy/vue-native-components v3.0.0-alpha.22 + * (Using Vue v2.6.14 and Hippy-Vue v3.0.0-alpha.22) + * Build at: Wed Jul 26 2023 17:59:02 GMT+0800 (中国标准时间) + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}n.d(t,"AnimationComponent",(function(){return p})),n.d(t,"DialogComponent",(function(){return m})),n.d(t,"ListRefreshComponent",(function(){return v})),n.d(t,"PullsComponents",(function(){return w})),n.d(t,"SwiperComponent",(function(){return b})),n.d(t,"WaterfallComponent",(function(){return S})),n.d(t,"default",(function(){return O}));const a=["mode","valueType","startValue","toValue"],c=["transform"],l=["transform"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function d(e){for(var t=1;t=0?t.Native.parseColor(n):n}function r(t){const{mode:r="timing",valueType:c,startValue:l,toValue:u}=t,p=s(t,a),f=d(d({},n),p);void 0!==c&&(f.valueType=t.valueType),f.startValue=o(f.valueType,l),f.toValue=o(f.valueType,u),f.repeatCount=i(f.repeatCount),f.mode=r;const h=new e.Hippy.Animation(f),m=h.getId();return{animation:h,animationId:m}}function i(e){return"loop"===e?-1:e}function u(t,n={}){const o={};return Object.keys(t).forEach(s=>{if(Array.isArray(t[s])){const a=t[s],{repeatCount:c}=a[a.length-1],l=a.map(e=>{const{animationId:t,animation:o}=r(Object.assign({},e,{repeatCount:0}));return Object.assign(n,{[t]:o}),{animationId:t,follow:!0}}),{animationId:u,animation:d}=function(t,n=0){const o=new e.Hippy.AnimationSet({children:t,repeatCount:n}),r=o.getId();return{animation:o,animationId:r}}(l,i(c));o[s]={animationId:u},Object.assign(n,{[u]:d})}else{const e=t[s],{animationId:i,animation:a}=r(e);Object.assign(n,{[i]:a}),o[s]={animationId:i}}}),o}function p(e){const{transform:t}=e,n=s(e,c);let o=Object.keys(n).map(t=>e[t].animationId);if(Array.isArray(t)&&t.length>0){const e=[];t.forEach(t=>Object.keys(t).forEach(n=>{if(t[n]){const{animationId:o}=t[n];"number"==typeof o&&o%1==0&&e.push(o)}})),o=[...o,...e]}return o}t.component("Animation",{inheritAttrs:!1,props:{tag:{type:String,default:"div"},playing:{type:Boolean,default:!1},actions:{type:Object,required:!0},props:Object},data:()=>({style:{},animationIds:[],animationIdsMap:{},animationEventMap:{}}),watch:{playing(e,t){!t&&e?this.start():t&&!e&&this.pause()},actions(){this.destroy(),this.create(),setTimeout(()=>{"function"==typeof this.$listeners.actionsDidUpdate&&this.$listeners.actionsDidUpdate()})}},created(){this.animationEventMap={start:"animationstart",end:"animationend",repeat:"animationrepeat",cancel:"animationcancel"}},beforeMount(){this.create()},mounted(){const{playing:e}=this.$props;e&&setTimeout(()=>{this.start()},0)},beforeDestroy(){this.destroy()},methods:{create(){const e=this.$props,{actions:{transform:t}}=e,n=s(e.actions,l);this.animationIdsMap={};const o=u(n,this.animationIdsMap);if(t){const e=u(t,this.animationIdsMap);o.transform=Object.keys(e).map(t=>({[t]:e[t]}))}this.$alreadyStarted=!1,this.style=o},removeAnimationEvent(){this.animationIds.forEach(e=>{const t=this.animationIdsMap[e];t&&Object.keys(this.animationEventMap).forEach(e=>{if("function"!=typeof this.$listeners[e])return;const n=this.animationEventMap[e];n&&t.removeEventListener(n)})})},addAnimationEvent(){this.animationIds.forEach(e=>{const t=this.animationIdsMap[e];t&&Object.keys(this.animationEventMap).forEach(e=>{if("function"!=typeof this.$listeners[e])return;const n=this.animationEventMap[e];n&&t.addEventListener(n,()=>{this.$emit(e)})})})},reset(){this.$alreadyStarted=!1},start(){this.$alreadyStarted?this.resume():(this.animationIds=p(this.style),this.$alreadyStarted=!0,this.removeAnimationEvent(),this.addAnimationEvent(),this.animationIds.forEach(e=>{const t=this.animationIdsMap[e];t&&t.start()}))},resume(){p(this.style).forEach(e=>{const t=this.animationIdsMap[e];t&&t.resume()})},pause(){if(!this.$alreadyStarted)return;p(this.style).forEach(e=>{const t=this.animationIdsMap[e];t&&t.pause()})},destroy(){this.removeAnimationEvent(),this.$alreadyStarted=!1;p(this.style).forEach(e=>{const t=this.animationIdsMap[e];t&&t.destroy()})}},template:'\n \n \n \n '})}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function h(e){for(var t=1;t{if(Array.isArray(e)){const[n,o]=e;Object.prototype.hasOwnProperty.call(this.$listeners,n)&&(this["on"+y(o)]?t[e]=this["on"+y(o)]:t[e]=e=>this.$emit(n,e))}else Object.prototype.hasOwnProperty.call(this.$listeners,e)&&(this["on"+y(e)]?t[e]=this["on"+y(e)]:t[e]=t=>this.$emit(e,t))}),t}function v(e){e.registerElement("hi-ul-refresh-wrapper",{component:{name:"RefreshWrapper"}}),e.registerElement("hi-refresh-wrapper-item",{component:{name:"RefreshWrapperItemView"}}),e.component("UlRefreshWrapper",{inheritAttrs:!1,props:{bounceTime:{type:Number,defaultValue:100}},methods:{startRefresh(){e.Native.callUIFunction(this.$refs.refreshWrapper,"startRefresh",null)},refreshCompleted(){e.Native.callUIFunction(this.$refs.refreshWrapper,"refreshComplected",null)}},render(e){return e("hi-ul-refresh-wrapper",{on:g.call(this,["refresh"]),ref:"refreshWrapper"},this.$slots.default)}}),e.component("UlRefresh",{inheritAttrs:!1,template:"\n \n
\n \n
\n
\n "})}function b(e){e.registerElement("hi-swiper",{component:{name:"ViewPager",processEventData(e,t,n){switch(t){case"onPageSelected":e.currentSlide=n.position;break;case"onPageScroll":e.nextSlide=n.position,e.offset=n.offset;break;case"onPageScrollStateChanged":e.state=n.pageScrollState}return e}}}),e.registerElement("swiper-slide",{component:{name:"ViewPagerItem",defaultNativeStyle:{position:"absolute",top:0,right:0,bottom:0,left:0}}}),e.component("Swiper",{inheritAttrs:!1,props:{current:{type:Number,defaultValue:0},needAnimation:{type:Boolean,defaultValue:!0}},watch:{current(e){this.$props.needAnimation?this.setSlide(e):this.setSlideWithoutAnimation(e)}},beforeMount(){this.$initialSlide=this.$props.current},methods:{setSlide(t){e.Native.callUIFunction(this.$refs.swiper,"setPage",[t])},setSlideWithoutAnimation(t){e.Native.callUIFunction(this.$refs.swiper,"setPageWithoutAnimation",[t])}},render(e){return e("hi-swiper",{on:g.call(this,[["dropped","pageSelected"],["dragging","pageScroll"],["stateChanged","pageScrollStateChanged"]]),ref:"swiper",attrs:{initialPage:this.$initialSlide}},this.$slots.default)}})}function w(e){const{callUIFunction:t}=e.Native;[["Header","header"],["Footer","footer"]].forEach(([n,o])=>{e.registerElement("hi-pull-"+o,{component:{name:`Pull${n}View`,processEventData(e,t,o){switch(t){case`on${n}Released`:case`on${n}Pulling`:Object.assign(e,o)}return e}}}),e.component("pull-"+o,{methods:{["expandPull"+n](){t(this.$refs.instance,"expandPull"+n)},["collapsePull"+n](e){"Header"===n&&void 0!==e?t(this.$refs.instance,`collapsePull${n}WithOptions`,[e]):t(this.$refs.instance,"collapsePull"+n)},onLayout(e){this.$contentHeight=e.height},[`on${n}Released`](e){this.$emit("released",e)},[`on${n}Pulling`](e){e.contentOffset>this.$contentHeight?"pulling"!==this.$lastEvent&&(this.$lastEvent="pulling",this.$emit("pulling",e)):"idle"!==this.$lastEvent&&(this.$lastEvent="idle",this.$emit("idle",e))}},render(e){const{released:t,pulling:r,idle:i}=this.$listeners,s={layout:this.onLayout};return"function"==typeof t&&(s[o+"Released"]=this[`on${n}Released`]),"function"!=typeof r&&"function"!=typeof i||(s[o+"Pulling"]=this[`on${n}Pulling`]),e("hi-pull-"+o,{on:s,ref:"instance"},this.$slots.default)}})})}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function $(e){for(var t=1;t({top:0,left:0,bottom:0,right:0})},columnSpacing:{type:Number,default:0},interItemSpacing:{type:Number,default:0},preloadItemNumber:{type:Number,default:0},containBannerView:{type:Boolean,default:!1},containPullHeader:{type:Boolean,default:!1},containPullFooter:{type:Boolean,default:!1}},methods:{call(t,n){e.Native.callUIFunction(this.$refs.waterfall,t,n)},startRefresh(){this.call("startRefresh")},startRefreshWithType(e){this.call("startRefreshWithType",[e])},callExposureReport(){this.call("callExposureReport",[])},scrollToIndex({index:e=0,animated:t=!0}){"number"==typeof e&&"boolean"==typeof t&&this.call("scrollToIndex",[e,e,t])},scrollToContentOffset({xOffset:e=0,yOffset:t=0,animated:n=!0}){"number"==typeof e&&"number"==typeof t&&"boolean"==typeof n&&this.call("scrollToContentOffset",[e,t,n])},startLoadMore(){this.call("startLoadMore")}},render(e){return e("hi-waterfall",{on:g.call(this,["headerReleased","headerPulling","endReached","exposureReport","initialListReady","scroll"]),ref:"waterfall",attrs:{numberOfColumns:this.numberOfColumns,contentInset:this.contentInset,columnSpacing:this.columnSpacing,interItemSpacing:this.interItemSpacing,preloadItemNumber:this.preloadItemNumber,containBannerView:this.containBannerView,containPullHeader:this.containPullHeader,containPullFooter:this.containPullFooter}},this.$slots.default)}}),e.component("WaterfallItem",{inheritAttrs:!1,props:{type:{type:[String,Number],default:""}},render(e){return e("hi-waterfall-item",{on:$({},this.$listeners),attrs:{type:this.type}},this.$slots.default)}})}const O={install(e){p(e),m(e),v(e),b(e),w(e),S(e)}}}.call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/@hippy/vue/dist/index.js":function(e,t,n){"use strict";n.r(t),function(e,o,r){n.d(t,"default",(function(){return Qc})); +/*! + * @hippy/vue v3.0.0-alpha.22 + * (Using Vue v2.6.14) + * Build at: Wed Jul 26 2023 17:59:02 GMT+0800 (中国标准时间) + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const i=Object.freeze({});function s(e){return null==e}function a(e){return null!=e}function c(e){return!0===e}function l(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function u(e){return null!==e&&"object"==typeof e}const d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function f(e){return"[object RegExp]"===d.call(e)}function h(e){const t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function m(e){return a(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function y(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===d?JSON.stringify(e,null,2):String(e)}function g(e){const t=parseFloat(e);return isNaN(t)?e:t}function v(e,t){const n=Object.create(null),o=e.split(",");for(let e=0;en[e.toLowerCase()]:e=>n[e]}const b=v("slot,component",!0),w=v("key,ref,slot,slot-scope,is");function _(e,t){if(e.length){const n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}const $=Object.prototype.hasOwnProperty;function S(e,t){return $.call(e,t)}function O(e){const t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}const x=/-(\w)/g,k=O(e=>e.replace(x,(e,t)=>t?t.toUpperCase():"")),E=O(e=>e.charAt(0).toUpperCase()+e.slice(1)),N=/\B([A-Z])/g,C=O(e=>e.replace(N,"-$1").toLowerCase());const I=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){const o=arguments.length;return o?o>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function A(e,t){t=t||0;let n=e.length-t;const o=new Array(n);for(;n--;)o[n]=e[n+t];return o}function P(e,t){for(const n in t)e[n]=t[n];return e}function T(e,t,n){}const j=(e,t,n)=>!1,D=e=>e;function L(e,t){if(e===t)return!0;const n=u(e),o=u(t);if(!n||!o)return!n&&!o&&String(e)===String(t);try{const n=Array.isArray(e),o=Array.isArray(t);if(n&&o)return e.length===t.length&&e.every((e,n)=>L(e,t[n]));if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(n||o)return!1;{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>L(e[n],t[n]))}}catch(e){return!1}}function M(e,t){for(let n=0;n!1,ne=e.__VUE_DEVTOOLS_GLOBAL_HOOK__;function oe(e){return"function"==typeof e&&/native code/.test(e.toString())}const re="undefined"!=typeof Symbol&&oe(Symbol)&&"undefined"!=typeof Reflect&&oe(Reflect.ownKeys);let ie;ie="undefined"!=typeof Set&&oe(Set)?Set:class{constructor(){this.set=Object.create(null)}has(e){return!0===this.set[e]}add(e){this.set[e]=!0}clear(){this.set=Object.create(null)}};let se=T;let ae=0;class ce{constructor(){this.id=ae++,this.subs=[]}addSub(e){this.subs.push(e)}removeSub(e){_(this.subs,e)}depend(){ce.target&&ce.target.addDep(this)}notify(){const e=this.subs.slice();for(let t=0,n=e.length;t{const t=new pe;return t.text=e,t.isComment=!0,t};function he(e){return new pe(void 0,void 0,void 0,String(e))}function me(e){const t=new pe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}const ye=Array.prototype,ge=Object.create(ye);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(e){const t=ye[e];W(ge,e,(function(...n){const o=t.apply(this,n),r=this.__ob__;let i;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&r.observeArray(i),r.dep.notify(),o}))}));const ve=Object.getOwnPropertyNames(ge);let be=!0;function we(e){be=e}class _e{constructor(e){this.value=e,this.dep=new ce,this.vmCount=0,W(e,"__ob__",this),Array.isArray(e)?(Y?function(e,t){e.__proto__=t}(e,ge):function(e,t,n){for(let o=0,r=n.length;o{Ee[e]=Ie}),R.forEach((function(e){Ee[e+"s"]=Ae})),Ee.watch=function(e,t,n,o){if(e===Q&&(e=void 0),t===Q&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;const r={};P(r,e);for(const e in t){let n=r[e];const o=t[e];n&&!Array.isArray(n)&&(n=[n]),r[e]=n?n.concat(o):Array.isArray(o)?o:[o]}return r},Ee.props=Ee.methods=Ee.inject=Ee.computed=function(e,t,n,o){if(!e)return t;const r=Object.create(null);return P(r,e),t&&P(r,t),r},Ee.provide=Ce;const Pe=function(e,t){return void 0===t?e:t};function Te(e,t,n){if("function"==typeof t&&(t=t.options),function(e,t){const n=e.props;if(!n)return;const o={};let r,i,s;if(Array.isArray(n))for(r=n.length;r--;)i=n[r],"string"==typeof i&&(s=k(i),o[s]={type:null});else if(p(n))for(const e in n)i=n[e],s=k(e),o[s]=p(i)?i:{type:i};else 0;e.props=o}(t),function(e,t){const n=e.inject;if(!n)return;const o=e.inject={};if(Array.isArray(n))for(let e=0;e-1)if(i&&!S(r,"default"))s=!1;else if(""===s||s===C(e)){const e=Re(String,r.type);(e<0||aVe(e,o,r+" (Promise/async)")),i._handled=!0)}catch(e){Ve(e,o,r)}return i}function Ue(e,t,n){if(B.errorHandler)try{return B.errorHandler.call(null,e,t,n)}catch(t){t!==e&&He(t,null,"config.errorHandler")}He(e,t,n)}function He(e,t,n){if(!K&&!G||"undefined"==typeof console)throw e;console.error(e)}const We=[];let ze,Ye=!1;function Ke(){Ye=!1;const e=We.slice(0);We.length=0;for(let t=0;t{e.then(Ke),Z&&setTimeout(T)}}else if(J||"undefined"==typeof MutationObserver||!oe(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())ze=void 0!==o&&oe(o)?()=>{o(Ke)}:()=>{setTimeout(Ke,0)};else{let e=1;const t=new MutationObserver(Ke),n=document.createTextNode(String(e));t.observe(n,{characterData:!0}),ze=()=>{e=(e+1)%2,n.data=String(e)}}function Ge(e,t){let n;if(We.push(()=>{if(e)try{e.call(t)}catch(e){Ve(e,t,"nextTick")}else n&&n(t)}),Ye||(Ye=!0,ze()),!e&&"undefined"!=typeof Promise)return new Promise(e=>{n=e})}const qe=new ie;function Xe(e){!function e(t,n){let o,r;const i=Array.isArray(t);if(!i&&!u(t)||Object.isFrozen(t)||t instanceof pe)return;if(t.__ob__){const e=t.__ob__.dep.id;if(n.has(e))return;n.add(e)}if(i)for(o=t.length;o--;)e(t[o],n);else for(r=Object.keys(t),o=r.length;o--;)e(t[r[o]],n)}(e,qe),qe.clear()}const Je=O(e=>{const t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),o="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=o?e.slice(1):e,once:n,capture:o,passive:t}});function Ze(e,t){function n(){const e=n.fns;if(!Array.isArray(e))return Be(e,null,arguments,t,"v-on handler");{const n=e.slice();for(let e=0;e0&&(i=e(i,`${n||""}_${r}`),ot(i[0])&&ot(d)&&(o[u]=he(d.text+i[0].text),i.shift()),o.push.apply(o,i)):l(i)?ot(d)?o[u]=he(d.text+i):""!==i&&o.push(he(i)):ot(i)&&ot(d)?o[u]=he(d.text+i.text):(c(t._isVList)&&a(i.tag)&&s(i.key)&&a(n)&&(i.key=`__vlist${n}_${r}__`),o.push(i)));return o}(e):void 0}function ot(e){return a(e)&&a(e.text)&&!1===e.isComment}function rt(e,t){if(e){const n=Object.create(null),o=re?Reflect.ownKeys(e):Object.keys(e);for(let r=0;r0,s=e?!!e.$stable:!r,a=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&n&&n!==i&&a===n.$key&&!r&&!n.$hasNormal)return n;o={};for(const n in e)e[n]&&"$"!==n[0]&&(o[n]=lt(t,n,e[n]))}else o={};for(const e in t)e in o||(o[e]=ut(t,e));return e&&Object.isExtensible(e)&&(e._normalized=o),W(o,"$stable",s),W(o,"$key",a),W(o,"$hasNormal",r),o}function lt(e,t,n){const o=function(){let e=arguments.length?n.apply(null,arguments):n({});e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:nt(e);let t=e&&e[0];return e&&(!t||1===e.length&&t.isComment&&!at(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:o,enumerable:!0,configurable:!0}),o}function ut(e,t){return()=>e[t]}function dt(e,t){let n,o,r,i,s;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),o=0,r=e.length;o(this.$slots||ct(e.scopedSlots,this.$slots=it(n,o)),this.$slots),Object.defineProperty(this,"scopedSlots",{enumerable:!0,get(){return ct(e.scopedSlots,this.slots())}}),l&&(this.$options=s,this.$slots=this.slots(),this.$scopedSlots=ct(e.scopedSlots,this.$slots)),s._scopeId?this._c=(e,t,n,r)=>{const i=Tt(a,e,t,n,r,u);return i&&!Array.isArray(i)&&(i.fnScopeId=s._scopeId,i.fnContext=o),i}:this._c=(e,t,n,o)=>Tt(a,e,t,n,o,u)}function Et(e,t,n,o,r){const i=me(e);return i.fnContext=n,i.fnOptions=o,t.slot&&((i.data||(i.data={})).slot=t.slot),i}function Nt(e,t){for(const n in t)e[k(n)]=t[n]}xt(kt.prototype);const Ct={init(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){const t=e;Ct.prepatch(t,t)}else{(e.componentInstance=function(e,t){const n={_isComponent:!0,_parentVnode:e,parent:t},o=e.data.inlineTemplate;a(o)&&(n.render=o.render,n.staticRenderFns=o.staticRenderFns);return new e.componentOptions.Ctor(n)}(e,Bt)).$mount(t?e.elm:void 0,t)}},prepatch(e,t){const n=t.componentOptions;!function(e,t,n,o,r){0;const s=o.data.scopedSlots,a=e.$scopedSlots,c=!!(s&&!s.$stable||a!==i&&!a.$stable||s&&e.$scopedSlots.$key!==s.$key||!s&&e.$scopedSlots.$key),l=!!(r||e.$options._renderChildren||c);e.$options._parentVnode=o,e.$vnode=o,e._vnode&&(e._vnode.parent=o);if(e.$options._renderChildren=r,e.$attrs=o.data.attrs||i,e.$listeners=n||i,t&&e.$options.props){we(!1);const n=e._props,o=e.$options._propKeys||[];for(let r=0;r_(o,n));const l=e=>{for(let e=0,t=o.length;e{e.resolved=Lt(n,t),r?o.length=0:l(!0)}),p=F(t=>{a(e.errorComp)&&(e.error=!0,l(!0))}),f=e(d,p);return u(f)&&(m(f)?s(e.resolved)&&f.then(d,p):m(f.component)&&(f.component.then(d,p),a(f.error)&&(e.errorComp=Lt(f.error,t)),a(f.loading)&&(e.loadingComp=Lt(f.loading,t),0===f.delay?e.loading=!0:i=setTimeout(()=>{i=null,s(e.resolved)&&s(e.error)&&(e.loading=!0,l(!1))},f.delay||200)),a(f.timeout)&&(c=setTimeout(()=>{c=null,s(e.resolved)&&p(null)},f.timeout)))),r=!1,e.loading?e.loadingComp:e.resolved}}(d,l))))return function(e,t,n,o,r){const i=fe();return i.asyncFactory=e,i.asyncMeta={data:t,context:n,children:o,tag:r},i}(d,t,n,o,r);t=t||{},un(e),a(t.model)&&function(e,t){const n=e.model&&e.model.prop||"value",o=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[n]=t.model.value;const r=t.on||(t.on={}),i=r[o],s=t.model.callback;a(i)?(Array.isArray(i)?-1===i.indexOf(s):i!==s)&&(r[o]=[s].concat(i)):r[o]=s}(e.options,t);const p=function(e,t,n){const o=t.options.props;if(s(o))return;const r={},{attrs:i,props:c}=e;if(a(i)||a(c))for(const e in o){const t=C(e);0,tt(r,c,e,t,!0)||tt(r,i,e,t,!1)}return r}(t,e);if(c(e.options.functional))return function(e,t,n,o,r){const s=e.options,c={},l=s.props;if(a(l))for(const e in l)c[e]=De(e,l,t||i);else a(n.attrs)&&Nt(c,n.attrs),a(n.props)&&Nt(c,n.props);const u=new kt(n,c,r,o,e),d=s.render.call(null,u._c,u);if(d instanceof pe)return Et(d,n,u.parent,s,u);if(Array.isArray(d)){const e=nt(d)||[],t=new Array(e.length);for(let o=0;o{e(n,o),t(n,o)};return n._merged=!0,n}function Tt(e,t,n,o,r,i){return(Array.isArray(n)||l(n))&&(r=o,o=n,n=void 0),c(i)&&(r=2),function(e,t,n,o,r){if(a(n)&&a(n.__ob__))return fe();a(n)&&a(n.is)&&(t=n.is);if(!t)return fe();0;Array.isArray(o)&&"function"==typeof o[0]&&((n=n||{}).scopedSlots={default:o[0]},o.length=0);2===r?o=nt(o):1===r&&(o=function(e){for(let t=0;tdocument.createEvent("Event").timeStamp&&(Jt=()=>e.now())}function Zt(){let e,t;for(Jt(),qt=!0,zt.sort((e,t)=>e.id-t.id),Xt=0;XtXt&&zt[t].id>e.id;)t--;zt.splice(t+1,0,e)}else zt.push(e);Gt||(Gt=!0,Ge(Zt))}}(this)}run(){if(this.active){const e=this.get();if(e!==this.value||u(e)||this.deep){const t=this.value;if(this.value=e,this.user){const n=`callback for watcher "${this.expression}"`;Be(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}}evaluate(){this.value=this.get(),this.dirty=!1}depend(){let e=this.deps.length;for(;e--;)this.deps[e].depend()}teardown(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);let e=this.deps.length;for(;e--;)this.deps[e].removeSub(this);this.active=!1}}}const tn={enumerable:!0,configurable:!0,get:T,set:T};function nn(e,t,n){tn.get=function(){return this[t][n]},tn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,tn)}function on(e){e._watchers=[];const t=e.$options;t.props&&function(e,t){const n=e.$options.propsData||{},o=e._props={},r=e.$options._propKeys=[];e.$parent&&we(!1);for(const i in t){r.push(i);const s=De(i,t,n,e);Se(o,i,s),i in e||nn(e,"_props",i)}we(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(const n in t)e[n]="function"!=typeof t[n]?T:I(t[n],e)}(e,t.methods),t.data?function(e){let t=e.$options.data;t=e._data="function"==typeof t?function(e,t){ue();try{return e.call(t,t)}catch(e){return Ve(e,t,"data()"),{}}finally{de()}}(t,e):t||{},p(t)||(t={});const n=Object.keys(t),o=e.$options.props;e.$options.methods;let r=n.length;for(;r--;){const t=n[r];0,o&&S(o,t)||H(t)||nn(e,"_data",t)}$e(t,!0)}(e):$e(e._data={},!0),t.computed&&function(e,t){const n=e._computedWatchers=Object.create(null);for(const o in t){const r=t[o],i="function"==typeof r?r:r.get;0,n[o]=new en(e,i||T,T,rn),o in e||sn(e,o,r)}}(e,t.computed),t.watch&&t.watch!==Q&&function(e,t){for(const n in t){const o=t[n];if(Array.isArray(o))for(let t=0;t-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function mn(e,t){const{cache:n,keys:o,_vnode:r}=e;for(const e in n){const i=n[e];if(i){const s=i.name;s&&!t(s)&&yn(n,e,o,r)}}}function yn(e,t,n,o){const r=e[t];!r||o&&r.tag===o.tag||r.componentInstance.$destroy(),e[t]=null,_(n,t)}!function(e){e.prototype._init=function(e){const t=this;t._uid=ln++,t._isVue=!0,e&&e._isComponent?function(e,t){const n=e.$options=Object.create(e.constructor.options),o=t._parentVnode;n.parent=t.parent,n._parentVnode=o;const r=o.componentOptions;n.propsData=r.propsData,n._parentListeners=r.listeners,n._renderChildren=r.children,n._componentTag=r.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Te(un(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){const t=e.$options;let n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;const t=e.$options._parentListeners;t&&Vt(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;const t=e.$options,n=e.$vnode=t._parentVnode,o=n&&n.context;e.$slots=it(t._renderChildren,o),e.$scopedSlots=i,e._c=(t,n,o,r)=>Tt(e,t,n,o,r,!1),e.$createElement=(t,n,o,r)=>Tt(e,t,n,o,r,!0);const r=n&&n.data;Se(e,"$attrs",r&&r.attrs||i,null,!0),Se(e,"$listeners",t._parentListeners||i,null,!0)}(t),Wt(t,"beforeCreate"),function(e){const t=rt(e.$options.inject,e);t&&(we(!1),Object.keys(t).forEach(n=>{Se(e,n,t[n])}),we(!0))}(t),on(t),function(e){const t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(t),Wt(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}(dn),function(e){const t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Oe,e.prototype.$delete=xe,e.prototype.$watch=function(e,t,n){const o=this;if(p(t))return cn(o,e,t,n);(n=n||{}).user=!0;const r=new en(o,e,t,n);if(n.immediate){const e=`callback for immediate watcher "${r.expression}"`;ue(),Be(t,o,[r.value],o,e),de()}return function(){r.teardown()}}}(dn),function(e){const t=/^hook:/;e.prototype.$on=function(e,n){const o=this;if(Array.isArray(e))for(let t=0,r=e.length;t1?A(n):n;const o=A(arguments,1),r=`event handler for "${e}"`;for(let e=0,i=n.length;e{Bt=t}}(n);n._vnode=e,n.$el=r?n.__patch__(r,e):n.__patch__(n.$el,e,t,!1),i(),o&&(o.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){const e=this;e._watcher&&e._watcher.update()},e.prototype.$destroy=function(){const e=this;if(e._isBeingDestroyed)return;Wt(e,"beforeDestroy"),e._isBeingDestroyed=!0;const t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||_(t.$children,e),e._watcher&&e._watcher.teardown();let n=e._watchers.length;for(;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Wt(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}(dn),function(e){xt(e.prototype),e.prototype.$nextTick=function(e){return Ge(e,this)},e.prototype._render=function(){const e=this,{render:t,_parentVnode:n}=e.$options;let o;n&&(e.$scopedSlots=ct(n.data.scopedSlots,e.$slots,e.$scopedSlots)),e.$vnode=n;try{Dt=e,o=t.call(e._renderProxy,e.$createElement)}catch(t){Ve(t,e,"render"),o=e._vnode}finally{Dt=null}return Array.isArray(o)&&1===o.length&&(o=o[0]),o instanceof pe||(o=fe()),o.parent=n,o}}(dn);const gn=[String,RegExp,Array];var vn={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:gn,exclude:gn,max:[String,Number]},methods:{cacheVNode(){const{cache:e,keys:t,vnodeToCache:n,keyToCache:o}=this;if(n){const{tag:r,componentInstance:i,componentOptions:s}=n;e[o]={name:fn(s),tag:r,componentInstance:i},t.push(o),this.max&&t.length>parseInt(this.max)&&yn(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created(){this.cache=Object.create(null),this.keys=[]},destroyed(){for(const e in this.cache)yn(this.cache,e,this.keys)},mounted(){this.cacheVNode(),this.$watch("include",e=>{mn(this,t=>hn(e,t))}),this.$watch("exclude",e=>{mn(this,t=>!hn(e,t))})},updated(){this.cacheVNode()},render(){const e=this.$slots.default,t=function(e){if(Array.isArray(e))for(let t=0;tB};Object.defineProperty(e,"config",t),e.util={warn:se,extend:P,mergeOptions:Te,defineReactive:Se},e.set=Oe,e.delete=xe,e.nextTick=Ge,e.observable=e=>($e(e),e),e.options=Object.create(null),R.forEach(t=>{e.options[t+"s"]=Object.create(null)}),e.options._base=e,P(e.options.components,vn),function(e){e.use=function(e){const t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;const n=A(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Te(this.options,e),this}}(e),pn(e),function(e){R.forEach(t=>{e[t]=function(e,n){return n?("component"===t&&p(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(dn),Object.defineProperty(dn.prototype,"$isServer",{get:te}),Object.defineProperty(dn.prototype,"$ssrContext",{get(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(dn,"FunctionalRenderContext",{value:kt}),dn.version="2.6.14",v("style,class");const bn=v("input,textarea,option,select,progress");function wn(e){let t=e.data,n=e,o=e;for(;a(o.componentInstance);)o=o.componentInstance._vnode,o&&o.data&&(t=_n(o.data,t));for(;a(n=n.parent);)n&&n.data&&(t=_n(t,n.data));return function(e,t){if(a(e)||a(t))return $n(e,Sn(t));return""}(t.staticClass,t.class)}function _n(e,t){return{staticClass:$n(e.staticClass,t.staticClass),class:a(e.class)?[e.class,t.class]:t.class}}function $n(e,t){return e?t?e+" "+t:e:t||""}function Sn(e){return Array.isArray(e)?function(e){let t,n="";for(let o=0,r=e.length;o=0&&(t=e.charAt(n)," "===t);n--);t&&En.test(t)||(l=!0)}}else void 0===r?(f=o+1,r=e.slice(0,o).trim()):h();function h(){(i||(i=[])).push(e.slice(f,o).trim()),f=o+1}if(void 0===r?r=e.slice(0,o).trim():0!==f&&h(),i)for(o=0;o{const t=e[0].replace(An,"\\$&"),n=e[1].replace(An,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});function Tn(e,t){console.error("[Vue compiler]: "+e)}function jn(e,t){return e?e.map(e=>e[t]).filter(e=>e):[]}function Dn(e,t,n,o,r){(e.props||(e.props=[])).push(Wn({name:t,value:n,dynamic:r},o)),e.plain=!1}function Ln(e,t,n,o,r){(r?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Wn({name:t,value:n,dynamic:r},o)),e.plain=!1}function Mn(e,t,n,o){e.attrsMap[t]=n,e.attrsList.push(Wn({name:t,value:n},o))}function Fn(e,t,n,o,r,i,s,a){(e.directives||(e.directives=[])).push(Wn({name:t,rawName:n,value:o,arg:r,isDynamicArg:i,modifiers:s},a)),e.plain=!1}function Rn(e,t,n){return n?`_p(${t},"${e}")`:e+t}function Vn(e,t,n,o,r,s,a,c){let l;(o=o||i).right?c?t=`(${t})==='click'?'contextmenu':(${t})`:"click"===t&&(t="contextmenu",delete o.right):o.middle&&(c?t=`(${t})==='click'?'mouseup':(${t})`:"click"===t&&(t="mouseup")),o.capture&&(delete o.capture,t=Rn("!",t,c)),o.once&&(delete o.once,t=Rn("~",t,c)),o.passive&&(delete o.passive,t=Rn("&",t,c)),o.native?(delete o.native,l=e.nativeEvents||(e.nativeEvents={})):l=e.events||(e.events={});const u=Wn({value:n.trim(),dynamic:c},a);o!==i&&(u.modifiers=o);const d=l[t];Array.isArray(d)?r?d.unshift(u):d.push(u):l[t]=d?r?[u,d]:[d,u]:u,e.plain=!1}function Bn(e,t,n){const o=Un(e,":"+t)||Un(e,"v-bind:"+t);if(null!=o)return Nn(o);if(!1!==n){const n=Un(e,t);if(null!=n)return JSON.stringify(n)}}function Un(e,t,n){let o;if(null!=(o=e.attrsMap[t])){const n=e.attrsList;for(let e=0,o=n.length;e1&&(t[o[0].trim()]=o[1].trim())}})),t}));var Kn={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;const n=Un(e,"style");n&&(e.staticStyle=JSON.stringify(Yn(n)));const o=Bn(e,"style",!1);o&&(e.styleBinding=o)},genData:function(e){let t="";return e.staticStyle&&(t+=`staticStyle:${e.staticStyle},`),e.styleBinding&&(t+=`style:(${e.styleBinding}),`),t}};var Gn=function(e){return e};const qn=v("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Xn=v("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Jn=v("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Zn=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Qn=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,eo=`[a-zA-Z_][\\-\\.0-9_a-zA-Z${U.source}]*`,to=`((?:${eo}\\:)?${eo})`,no=new RegExp("^<"+to),oo=/^\s*(\/?)>/,ro=new RegExp(`^<\\/${to}[^>]*>`),io=/^]+>/i,so=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},po=/&(?:lt|gt|quot|amp|#39);/g,fo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,ho=v("pre,textarea",!0),mo=(e,t)=>e&&ho(e)&&"\n"===t[0];function yo(e,t){const n=t?fo:po;return e.replace(n,e=>uo[e])}function go(e,t,n){const{number:o,trim:r}=n||{};let i="$$v";r&&(i="(typeof $$v === 'string'? $$v.trim(): $$v)"),o&&(i=`_n(${i})`);const s=vo(t,i);e.model={value:`(${t})`,expression:JSON.stringify(t),callback:`function ($$v) {${s}}`}}function vo(e,t){const n=function(e){if(e=e.trim(),bo=e.length,e.indexOf("[")<0||e.lastIndexOf("]")-1?{exp:e.slice(0,$o),key:'"'+e.slice($o+1)+'"'}:{exp:e,key:null};wo=e,$o=So=Oo=0;for(;!ko();)_o=xo(),Eo(_o)?Co(_o):91===_o&&No(_o);return{exp:e.slice(0,So),key:e.slice(So+1,Oo)}}(e);return null===n.key?`${e}=${t}`:`$set(${n.exp}, ${n.key}, ${t})`}let bo,wo,_o,$o,So,Oo;function xo(){return wo.charCodeAt(++$o)}function ko(){return $o>=bo}function Eo(e){return 34===e||39===e}function No(e){let t=1;for(So=$o;!ko();)if(Eo(e=xo()))Co(e);else if(91===e&&t++,93===e&&t--,0===t){Oo=$o;break}}function Co(e){const t=e;for(;!ko()&&(e=xo())!==t;);}const Io=/^@|^v-on:/,Ao=r.env.VBIND_PROP_SHORTHAND?/^v-|^@|^:|^\.|^#/:/^v-|^@|^:|^#/,Po=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,To=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,jo=/^\(|\)$/g,Do=/^\[.*\]$/,Lo=/:(.*)$/,Mo=/^:|^\.|^v-bind:/,Fo=/^\./,Ro=/\.[^.\]]+(?=[^\]]*$)/g,Vo=/^v-slot(:|$)|^#/,Bo=/[\r\n]/,Uo=/[ \f\t\r\n]+/g,Ho=O(Gn);let Wo,zo,Yo,Ko,Go,qo,Xo,Jo,Zo;function Qo(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:sr(t),rawAttrsMap:{},parent:n,children:[]}}function er(e,t){Wo=t.warn||Tn,qo=t.isPreTag||j,Xo=t.mustUseProp||j,Jo=t.getTagNamespace||j;const n=t.isReservedTag||j;Zo=e=>!(!(e.component||e.attrsMap[":is"]||e.attrsMap["v-bind:is"])&&(e.attrsMap.is?n(e.attrsMap.is):n(e.tag))),Yo=jn(t.modules,"transformNode"),Ko=jn(t.modules,"preTransformNode"),Go=jn(t.modules,"postTransformNode"),zo=t.delimiters;const o=[],r=!1!==t.preserveWhitespace,i=t.whitespace;let s,a,c=!1,l=!1;function u(e){if(d(e),c||e.processed||(e=tr(e,t)),o.length||e===s||s.if&&(e.elseif||e.else)&&or(s,{exp:e.elseif,block:e}),a&&!e.forbidden)if(e.elseif||e.else)!function(e,t){const n=function(e){let t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(t.children);n&&n.if&&or(n,{exp:e.elseif,block:e})}(e,a);else{if(e.slotScope){const t=e.slotTarget||'"default"';(a.scopedSlots||(a.scopedSlots={}))[t]=e}a.children.push(e),e.parent=a}e.children=e.children.filter(e=>!e.slotScope),d(e),e.pre&&(c=!1),qo(e.tag)&&(l=!1);for(let n=0;n]*>)","i")),i=e.replace(r,(function(e,r,i){return n=i.length,co(o)||"noscript"===o||(r=r.replace(//g,"$1").replace(//g,"$1")),mo(o,r)&&(r=r.slice(1)),t.chars&&t.chars(r),""}));c+=e.length-i.length,e=i,p(o,c-n,c)}else{let n,o,r,i=e.indexOf("<");if(0===i){if(so.test(e)){const n=e.indexOf("--\x3e");if(n>=0){t.shouldKeepComment&&t.comment(e.substring(4,n),c,c+n+3),l(n+3);continue}}if(ao.test(e)){const t=e.indexOf("]>");if(t>=0){l(t+2);continue}}const n=e.match(io);if(n){l(n[0].length);continue}const o=e.match(ro);if(o){const e=c;l(o[0].length),p(o[1],e,c);continue}const r=u();if(r){d(r),mo(r.tagName,e)&&l(1);continue}}if(i>=0){for(o=e.slice(i);!(ro.test(o)||no.test(o)||so.test(o)||ao.test(o)||(r=o.indexOf("<",1),r<0));)i+=r,o=e.slice(i);n=e.substring(0,i)}i<0&&(n=e),n&&l(n.length),t.chars&&n&&t.chars(n,c-n.length,c)}if(e===s){t.chars&&t.chars(e);break}}function l(t){c+=t,e=e.substring(t)}function u(){const t=e.match(no);if(t){const n={tagName:t[1],attrs:[],start:c};let o,r;for(l(t[0].length);!(o=e.match(oo))&&(r=e.match(Qn)||e.match(Zn));)r.start=c,l(r[0].length),r.end=c,n.attrs.push(r);if(o)return n.unarySlash=o[1],l(o[0].length),n.end=c,n}}function d(e){const s=e.tagName,c=e.unarySlash;o&&("p"===a&&Jn(s)&&p(a),i(s)&&a===s&&p(s));const l=r(s)||!!c,u=e.attrs.length,d=new Array(u);for(let n=0;n=0&&n[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(let e=n.length-1;e>=i;e--)t.end&&t.end(n[e].tag,o,r);n.length=i,a=i&&n[i-1].tag}else"br"===s?t.start&&t.start(e,[],!0,o,r):"p"===s&&(t.start&&t.start(e,[],!1,o,r),t.end&&t.end(e,o,r))}p()}(e,{warn:Wo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start(e,n,r,i,d){const p=a&&a.ns||Jo(e);J&&"svg"===p&&(n=function(e){const t=[];for(let n=0;nc&&(r.push(a=e.slice(c,s)),o.push(JSON.stringify(a)));const t=Nn(i[1].trim());o.push(`_s(${t})`),r.push({"@binding":t}),c=s+i[0].length}return c{if(!e.slotScope)return e.parent=i,!0}),i.slotScope=t.value||"_empty_",e.children=[],e.plain=!1}}}(e),"slot"===(n=e).tag&&(n.slotName=Bn(n,"name")),function(e){let t;(t=Bn(e,"is"))&&(e.component=t);null!=Un(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(let n=0;n{e[t.slice(1)]=!0}),e}}function sr(e){const t={};for(let n=0,o=e.length;n-1`+("true"===i?`:(${t})`:`:_q(${t},${i})`)),Vn(e,"change",`var $$a=${t},$$el=$event.target,$$c=$$el.checked?(${i}):(${s});if(Array.isArray($$a)){var $$v=${o?"_n("+r+")":r},$$i=_i($$a,$$v);if($$el.checked){$$i<0&&(${vo(t,"$$a.concat([$$v])")})}else{$$i>-1&&(${vo(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")})}}else{${vo(t,"$$c")}}`,null,!0)}(e,o,r);else if("input"===i&&"radio"===s)!function(e,t,n){const o=n&&n.number;let r=Bn(e,"value")||"null";r=o?`_n(${r})`:r,Dn(e,"checked",`_q(${t},${r})`),Vn(e,"change",vo(t,r),null,!0)}(e,o,r);else if("input"===i||"textarea"===i)!function(e,t,n){const o=e.attrsMap.type;0;const{lazy:r,number:i,trim:s}=n||{},a=!r&&"range"!==o,c=r?"change":"range"===o?"__r":"input";let l="$event.target.value";s&&(l="$event.target.value.trim()");i&&(l=`_n(${l})`);let u=vo(t,l);a&&(u="if($event.target.composing)return;"+u);Dn(e,"value",`(${t})`),Vn(e,c,u,null,!0),(s||i)&&Vn(e,"blur","$forceUpdate()")}(e,o,r);else{if(!B.isReservedTag(i))return go(e,o,r),!1}return!0},text:function(e,t){t.value&&Dn(e,"textContent",`_s(${t.value})`,t)},html:function(e,t){t.value&&Dn(e,"innerHTML",`_s(${t.value})`,t)}},isPreTag:e=>"pre"===e,isUnaryTag:qn,mustUseProp:(e,t,n)=>"value"===n&&bn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e,canBeLeftOpenTag:Xn,isReservedTag:e=>On(e)||xn(e),getTagNamespace:function(e){return xn(e)?"svg":"math"===e?"math":void 0},staticKeys:function(e){return e.reduce((e,t)=>e.concat(t.staticKeys||[]),[]).join(",")}(ur)};let fr,hr;const mr=O((function(e){return v("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));function yr(e,t){e&&(fr=mr(t.staticKeys||""),hr=t.isReservedTag||j,function e(t){if(t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||b(e.tag)||!hr(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(fr)))}(t),1===t.type){if(!hr(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(let n=0,o=t.children.length;n|^function(?:\s+[\w$]+)?\s*\(/,vr=/\([^)]*?\);*$/,br=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,wr={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},_r={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},$r=e=>`if(${e})return null;`,Sr={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:$r("$event.target !== $event.currentTarget"),ctrl:$r("!$event.ctrlKey"),shift:$r("!$event.shiftKey"),alt:$r("!$event.altKey"),meta:$r("!$event.metaKey"),left:$r("'button' in $event && $event.button !== 0"),middle:$r("'button' in $event && $event.button !== 1"),right:$r("'button' in $event && $event.button !== 2")};function Or(e,t){const n=t?"nativeOn:":"on:";let o="",r="";for(const t in e){const n=xr(e[t]);e[t]&&e[t].dynamic?r+=`${t},${n},`:o+=`"${t}":${n},`}return o=`{${o.slice(0,-1)}}`,r?n+`_d(${o},[${r.slice(0,-1)}])`:n+o}function xr(e){if(!e)return"function(){}";if(Array.isArray(e))return`[${e.map(e=>xr(e)).join(",")}]`;const t=br.test(e.value),n=gr.test(e.value),o=br.test(e.value.replace(vr,""));if(e.modifiers){let r="",i="";const s=[];for(const t in e.modifiers)if(Sr[t])i+=Sr[t],wr[t]&&s.push(t);else if("exact"===t){const t=e.modifiers;i+=$r(["ctrl","shift","alt","meta"].filter(e=>!t[e]).map(e=>`$event.${e}Key`).join("||"))}else s.push(t);s.length&&(r+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(kr).join("&&")+")return null;"}(s)),i&&(r+=i);return`function($event){${r}${t?`return ${e.value}.apply(null, arguments)`:n?`return (${e.value}).apply(null, arguments)`:o?"return "+e.value:e.value}}`}return t||n?e.value:`function($event){${o?"return "+e.value:e.value}}`}function kr(e){const t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;const n=wr[e],o=_r[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(o)+")"}var Er={on:function(e,t){e.wrapListeners=e=>`_g(${e},${t.value})`},bind:function(e,t){e.wrapData=n=>`_b(${n},'${e.tag}',${t.value},${t.modifiers&&t.modifiers.prop?"true":"false"}${t.modifiers&&t.modifiers.sync?",true":""})`},cloak:T};class Nr{constructor(e){this.options=e,this.warn=e.warn||Tn,this.transforms=jn(e.modules,"transformCode"),this.dataGenFns=jn(e.modules,"genData"),this.directives=P(P({},Er),e.directives);const t=e.isReservedTag||j;this.maybeComponent=e=>!!e.component||!t(e.tag),this.onceId=0,this.staticRenderFns=[],this.pre=!1}}function Cr(e,t){const n=new Nr(t);return{render:`with(this){return ${e?"script"===e.tag?"null":Ir(e,n):'_c("div")'}}`,staticRenderFns:n.staticRenderFns}}function Ir(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ar(e,t);if(e.once&&!e.onceProcessed)return Pr(e,t);if(e.for&&!e.forProcessed)return jr(e,t);if(e.if&&!e.ifProcessed)return Tr(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){const n=e.slotName||'"default"',o=Fr(e,t);let r=`_t(${n}${o?`,function(){return ${o}}`:""}`;const i=e.attrs||e.dynamicAttrs?Br((e.attrs||[]).concat(e.dynamicAttrs||[]).map(e=>({name:k(e.name),value:e.value,dynamic:e.dynamic}))):null,s=e.attrsMap["v-bind"];!i&&!s||o||(r+=",null");i&&(r+=","+i);s&&(r+=`${i?"":",null"},${s}`);return r+")"}(e,t);{let n;if(e.component)n=function(e,t,n){const o=t.inlineTemplate?null:Fr(t,n,!0);return`_c(${e},${Dr(t,n)}${o?","+o:""})`}(e.component,e,t);else{let o;(!e.plain||e.pre&&t.maybeComponent(e))&&(o=Dr(e,t));const r=e.inlineTemplate?null:Fr(e,t,!0);n=`_c('${e.tag}'${o?","+o:""}${r?","+r:""})`}for(let o=0;o{const n=t[e];return n.slotTargetDynamic||n.if||n.for||Lr(n)}),r=!!e.if;if(!o){let t=e.parent;for(;t;){if(t.slotScope&&"_empty_"!==t.slotScope||t.for){o=!0;break}t.if&&(r=!0),t=t.parent}}const i=Object.keys(t).map(e=>Mr(t[e],n)).join(",");return`scopedSlots:_u([${i}]${o?",null,true":""}${!o&&r?",null,false,"+function(e){let t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(i):""})`}(e,e.scopedSlots,t)+","),e.model&&(n+=`model:{value:${e.model.value},callback:${e.model.callback},expression:${e.model.expression}},`),e.inlineTemplate){const o=function(e,t){const n=e.children[0];0;if(n&&1===n.type){const e=Cr(n,t.options);return`inlineTemplate:{render:function(){${e.render}},staticRenderFns:[${e.staticRenderFns.map(e=>`function(){${e}}`).join(",")}]}`}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n=`_b(${n},"${e.tag}",${Br(e.dynamicAttrs)})`),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Lr(e){return 1===e.type&&("slot"===e.tag||e.children.some(Lr))}function Mr(e,t){const n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Tr(e,t,Mr,"null");if(e.for&&!e.forProcessed)return jr(e,t,Mr);const o="_empty_"===e.slotScope?"":String(e.slotScope),r=`function(${o}){return ${"template"===e.tag?e.if&&n?`(${e.if})?${Fr(e,t)||"undefined"}:undefined`:Fr(e,t)||"undefined":Ir(e,t)}}`,i=o?"":",proxy:true";return`{key:${e.slotTarget||'"default"'},fn:${r}${i}}`}function Fr(e,t,n,o,r){const i=e.children;if(i.length){const e=i[0];if(1===i.length&&e.for&&"template"!==e.tag&&"slot"!==e.tag){const r=n?t.maybeComponent(e)?",1":",0":"";return`${(o||Ir)(e,t)}${r}`}const s=n?function(e,t){let n=0;for(let o=0;oRr(e.block))){n=2;break}(t(r)||r.ifConditions&&r.ifConditions.some(e=>t(e.block)))&&(n=1)}}return n}(i,t.maybeComponent):0,a=r||Vr;return`[${i.map(e=>a(e,t)).join(",")}]${s?","+s:""}`}}function Rr(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function Vr(e,t){return 1===e.type?Ir(e,t):3===e.type&&e.isComment?function(e){return`_e(${JSON.stringify(e.text)})`}(e):function(e){return`_v(${2===e.type?e.expression:Ur(JSON.stringify(e.text))})`}(e)}function Br(e){let t="",n="";for(let o=0;oHr(e,c)),t[i]=a}}const zr=(Yr=function(e,t){const n=er(e.trim(),t);!1!==t.optimize&&yr(n,t);const o=Cr(n,t);return{ast:n,render:o.render,staticRenderFns:o.staticRenderFns}},function(e){function t(t,n){const o=Object.create(e),r=[],i=[];if(n){n.modules&&(o.modules=(e.modules||[]).concat(n.modules)),n.directives&&(o.directives=P(Object.create(e.directives||null),n.directives));for(const e in n)"modules"!==e&&"directives"!==e&&(o[e]=n[e])}o.warn=(e,t,n)=>{(n?i:r).push(e)};const s=Yr(t.trim(),o);return s.errors=r,s.tips=i,s}return{compile:t,compileToFunctions:Wr(t)}});var Yr;const{compile:Kr,compileToFunctions:Gr}=zr(pr);function qr(e){return(qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xr(e){var t=function(e,t){if("object"!==qr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==qr(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===qr(t)?t:String(t)}function Jr(e,t,n){return(t=Xr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zr=`http://127.0.0.1:${r.env.PORT}/`;let Qr,ei,ti=e=>e,ni=()=>{};function oi(e){Qr=e}function ri(){return Qr}function ii(){return ti}const si=F(()=>{console.log('Hippy-Vue has "Vue.config.silent" to control trace log output, to see output logs if set it to false.')});function ai(...e){ei&&ei.config.silent&&si()}function ci(e){return e.charAt(0).toUpperCase()+e.slice(1)}const li=new RegExp("^(?=.+)[+-]?\\d*\\.?\\d*([Ee][+-]?\\d+)?$");function ui(e){return"[object Function]"===Object.prototype.toString.call(e)}function di(e){let t=e;return/^assets/.test(t)&&(t="hpfile://./"+t),t}function pi(e){return null==e}const fi=Symbol.for("View"),hi=Symbol.for("Image"),mi=Symbol.for("ListView"),yi=Symbol.for("ListViewItem"),gi=Symbol.for("Text"),vi=Symbol.for("TextInput"),bi=Symbol.for("WebView"),wi=Symbol.for("VideoPlayer"),_i={[fi]:"View",[hi]:"Image",[mi]:"ListView",[yi]:"ListViewItem",[gi]:"Text",[vi]:"TextInput",[bi]:"WebView",[wi]:"VideoPlayer"};function $i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Si(e){for(var t=1;t{t[t[e]=n]=e});else{const[n,o]=e;t[t[n]=o]=n}return t}const xi={number:"numeric",text:"default",search:"web-search"},ki={role:"accessibilityRole","aria-label":"accessibilityLabel","aria-disabled":{jointKey:"accessibilityState",name:"disabled"},"aria-selected":{jointKey:"accessibilityState",name:"selected"},"aria-checked":{jointKey:"accessibilityState",name:"checked"},"aria-busy":{jointKey:"accessibilityState",name:"busy"},"aria-expanded":{jointKey:"accessibilityState",name:"expanded"},"aria-valuemin":{jointKey:"accessibilityValue",name:"min"},"aria-valuemax":{jointKey:"accessibilityValue",name:"max"},"aria-valuenow":{jointKey:"accessibilityValue",name:"now"},"aria-valuetext":{jointKey:"accessibilityValue",name:"text"}},Ei={symbol:fi,component:{name:_i[fi],eventNamesMap:Oi([["touchStart","onTouchDown"],["touchstart","onTouchDown"],["touchmove","onTouchMove"],["touchend","onTouchEnd"],["touchcancel","onTouchCancel"]]),attributeMaps:Si({},ki),processEventData(e,t,n){switch(t){case"onScroll":case"onScrollBeginDrag":case"onScrollEndDrag":case"onMomentumScrollBegin":case"onMomentumScrollEnd":e.offsetX=n.contentOffset&&n.contentOffset.x,e.offsetY=n.contentOffset&&n.contentOffset.y;break;case"onTouchDown":case"onTouchMove":case"onTouchEnd":case"onTouchCancel":e.touches={0:{clientX:n.page_x,clientY:n.page_y},length:1};break;case"onFocus":e.isFocused=t.focus}return e}}},Ni={symbol:fi,component:Si(Si({},Ei.component),{},{name:_i[fi],defaultNativeStyle:{}})},Ci={symbol:fi,component:{name:_i[fi]}},Ii={symbol:hi,component:Si(Si({},Ei.component),{},{name:_i[hi],defaultNativeStyle:{backgroundColor:0},attributeMaps:Si({placeholder:{name:"defaultSource",propsValue(e){const t=di(e);return t&&t.indexOf(Zr)<0&&["https://","http://"].some(e=>0===t.indexOf(e)),t}},src:e=>di(e)},ki),processEventData(e,t,n){switch(t){case"onTouchDown":case"onTouchMove":case"onTouchEnd":case"onTouchCancel":e.touches={0:{clientX:n.page_x,clientY:n.page_y},length:1};break;case"onFocus":e.isFocused=t.focus;break;case"onLoad":{const{width:t,height:o,url:r}=n;e.width=t,e.height=o,e.url=r;break}}return e}})},Ai={symbol:mi,component:{name:_i[mi],defaultNativeStyle:{flex:1},attributeMaps:Si({},ki),eventNamesMap:Oi("listReady","initialListReady"),processEventData(e,t,n){switch(t){case"onScroll":case"onScrollBeginDrag":case"onScrollEndDrag":case"onMomentumScrollBegin":case"onMomentumScrollEnd":e.offsetX=n.contentOffset&&n.contentOffset.x,e.offsetY=n.contentOffset&&n.contentOffset.y;break;case"onDelete":e.index=n.index}return e}}},Pi={symbol:yi,component:{name:_i[yi],attributeMaps:Si({},ki),eventNamesMap:Oi([["disappear","onDisappear"]])}},Ti={symbol:fi,component:Si(Si({},Ei.component),{},{name:_i[gi],defaultNativeProps:{text:""},defaultNativeStyle:{color:4278190080}})},ji=Ti,Di=Ti,Li={component:Si(Si({},Ti.component),{},{defaultNativeStyle:{color:4278190318},attributeMaps:{href:{name:"href",propsValue:e=>["//","http://","https://"].filter(t=>0===e.indexOf(t)).length?"":e}}})},Mi={symbol:vi,component:{name:_i[vi],attributeMaps:Si({type:{name:"keyboardType",propsValue(e){const t=xi[e];return t||e}},disabled:{name:"editable",propsValue:e=>!e},value:"defaultValue",maxlength:"maxLength"},ki),nativeProps:{numberOfLines:1,multiline:!1},defaultNativeProps:{underlineColorAndroid:0},defaultNativeStyle:{padding:0,color:4278190080},eventNamesMap:Oi([["change","onChangeText"],["select","onSelectionChange"]]),processEventData(e,t,n){switch(t){case"onChangeText":case"onEndEditing":e.value=n.text;break;case"onSelectionChange":e.start=n.selection.start,e.end=n.selection.end;break;case"onKeyboardWillShow":e.keyboardHeight=n.keyboardHeight;break;case"onContentSizeChange":e.width=n.contentSize.width,e.height=n.contentSize.height}return e}}},Fi={symbol:vi,component:{name:_i[vi],defaultNativeProps:Si(Si({},Mi.component.defaultNativeProps),{},{numberOfLines:5}),attributeMaps:Si(Si({},Mi.component.attributeMaps),{},{rows:"numberOfLines"}),nativeProps:{multiline:!0},defaultNativeStyle:Mi.component.defaultNativeStyle,eventNamesMap:Mi.component.eventNamesMap,processEventData:Mi.component.processEventData}},Ri={symbol:bi,component:{name:_i[bi],defaultNativeProps:{method:"get",userAgent:""},attributeMaps:{src:{name:"source",propsValue:e=>({uri:e})}},processEventData(e,t,n){switch(t){case"onLoad":case"onLoadStart":e.url=n.url;break;case"onLoadEnd":e.url=n.url,e.success=n.success,e.error=n.error}return e}}};var Vi=Object.freeze({__proto__:null,button:Ni,div:Ei,form:Ci,img:Ii,input:Mi,label:ji,li:Pi,p:Di,span:Ti,a:Li,textarea:Fi,ul:Ai,iframe:Ri});function Bi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ui(e){for(var t=1;te(n,t,o)}}(e,o,n)),o.component),o.component.name&&o.component.name===ci(k(e))&&o.component.name;const r={meta:o};return Wi.set(n,r),r}function Gi(e){const t=Yi(e);let n=zi;const o=Wi.get(t);return o&&o.meta&&(n=o.meta),n}function qi(e,t){return(qi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Xi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qi(e,t)}const Ji={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Zi=(...e)=>`\\(\\s*(${e.join(")\\s*,\\s*(")})\\s*\\)`,Qi="[-+]?\\d*\\.?\\d+",es={rgb:new RegExp("rgb"+Zi(Qi,Qi,Qi)),rgba:new RegExp("rgba"+Zi(Qi,Qi,Qi,Qi)),hsl:new RegExp("hsl"+Zi(Qi,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),hsla:new RegExp("hsla"+Zi(Qi,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Qi)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/},ts=e=>{const t=parseInt(e,10);return t<0?0:t>255?255:t},ns=e=>{const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)},os=(e,t,n)=>{let o=n;return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e},rs=(e,t,n)=>{const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,i=os(r,o,e+1/3),s=os(r,o,e),a=os(r,o,e-1/3);return Math.round(255*i)<<24|Math.round(255*s)<<16|Math.round(255*a)<<8},is=e=>(parseFloat(e)%360+360)%360/360,ss=e=>{const t=parseFloat(e,10);return t<0?0:t>100?1:t/100};function as(e){if("string"==typeof e&&-1!==e.indexOf("var("))return e;let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=es.hex6.exec(e),Array.isArray(t)?parseInt(t[1]+"ff",16)>>>0:Object.hasOwnProperty.call(Ji,e)?Ji[e]:(t=es.rgb.exec(e),Array.isArray(t)?(ts(t[1])<<24|ts(t[2])<<16|ts(t[3])<<8|255)>>>0:(t=es.rgba.exec(e),t?(ts(t[1])<<24|ts(t[2])<<16|ts(t[3])<<8|ns(t[4]))>>>0:(t=es.hex3.exec(e),t?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=es.hex8.exec(e),t?parseInt(t[1],16)>>>0:(t=es.hex4.exec(e),t?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=es.hsl.exec(e),t?(255|rs(is(t[1]),ss(t[2]),ss(t[3])))>>>0:(t=es.hsla.exec(e),t?(rs(is(t[1]),ss(t[2]),ss(t[3]))|ns(t[4]))>>>0:null))))))))}(e);if(null===t)throw new Error("Bad color value: "+e);return t=(t<<24|t>>>8)>>>0,t}const cs={textDecoration:"textDecorationLine",boxShadowOffset:"shadowOffset",boxShadowOffsetX:"shadowOffsetX",boxShadowOffsetY:"shadowOffsetY",boxShadowOpacity:"shadowOpacity",boxShadowRadius:"shadowRadius",boxShadowSpread:"shadowSpread",boxShadowColor:"shadowColor",caretColor:"caret-color"},ls=0,us=1,ds={onClick:"click",onLongClick:"longclick",onPressIn:"pressin",onPressOut:"pressout",onTouchDown:"touchstart",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchMove:"touchmove",onTouchCancel:"touchcancel"},ps={NONE:0,CAPTURING_PHASE:1,AT_TARGET:2,BUBBLING_PHASE:3};const fs="addEventListener",hs="removeEventListener";function ms(){const e=Ua.Localization;return!!e&&1===e.direction}const ys=new Map;function gs(e){ys.delete(e)}function vs(e){return ys.get(e)||null}function bs(t){!function(t,n){if(!e.requestIdleCallback)return setTimeout(()=>{t({didTimeout:!1,timeRemaining:()=>1/0})},1);e.requestIdleCallback(t,n)}(e=>{(e.timeRemaining()>0||e.didTimeout)&&function e(t){"number"==typeof t?gs(t):t&&(gs(t.nodeId),t.childNodes&&t.childNodes.forEach(t=>e(t)))}(t)},{timeout:50})}function ws(e=[],t=0){let n=e[t];for(let o=t;o{try{return!!new RegExp("foo","y")}catch(e){return!1}})(),Ss={whiteSpaceRegEx:"\\s*",universalSelectorRegEx:"\\*",simpleIdentifierSelectorRegEx:"(#|\\.|:|\\b)([_-\\w][_-\\w\\d]*)",attributeSelectorRegEx:"\\[\\s*([_-\\w][_-\\w\\d]*)\\s*(?:(=|\\^=|\\$=|\\*=|\\~=|\\|=)\\s*(?:([_-\\w][_-\\w\\d]*)|\"((?:[^\\\\\"]|\\\\(?:\"|n|r|f|\\\\|0-9a-f))*)\"|'((?:[^\\\\']|\\\\(?:'|n|r|f|\\\\|0-9a-f))*)')\\s*)?\\]",combinatorRegEx:"\\s*(\\+|~|>)?\\s*"},Os={};function xs(e,t,n){let o="";$s&&(o="gy"),Os[e]||(Os[e]=new RegExp(Ss[e],o));const r=Os[e];let i;if($s)r.lastIndex=n,i=r.exec(t);else{if(t=t.slice(n,t.length),i=r.exec(t),!i)return{result:null,regexp:r};r.lastIndex=n+i[0].length}return{result:i,regexp:r}}function ks(e,t){return function(e,t){const{result:n,regexp:o}=xs("universalSelectorRegEx",e,t);return n?{value:{type:"*"},start:t,end:o.lastIndex}:null}(e,t)||function(e,t){const{result:n,regexp:o}=xs("simpleIdentifierSelectorRegEx",e,t);if(!n)return null;const r=o.lastIndex;return{value:{type:n[1],identifier:n[2]},start:t,end:r}}(e,t)||function(e,t){const{result:n,regexp:o}=xs("attributeSelectorRegEx",e,t);if(!n)return null;const r=o.lastIndex,i=n[1];if(n[2]){return{value:{type:"[]",property:i,test:n[2],value:n[3]||n[4]||n[5]},start:t,end:r}}return{value:{type:"[]",property:i},start:t,end:r}}(e,t)}function Es(e,t){let n=ks(e,t);if(!n)return null;let{end:o}=n;const r=[];for(;n;)r.push(n.value),({end:o}=n),n=ks(e,o);return{start:t,end:o,value:r}}function Ns(e,t){const{result:n,regexp:o}=xs("combinatorRegEx",e,t);if(!n)return null;let r;r=$s?o.lastIndex:t;return{start:t,end:r,value:n[1]||" "}}function Cs(e){return e?` ${e} `:""}class Is{lookupSort(e,t){e.sortAsUniversal(t||this)}removeSort(e,t){e.removeAsUniversal(t||this)}}class As extends Is{accumulateChanges(e,t){return this.dynamic?!!this.mayMatch(e)&&(this.trackChanges(e,t),!0):this.match(e)}mayMatch(e){return this.match(e)}trackChanges(){return null}}class Ps extends As{constructor(e){super(),this.specificity=e.reduce((e,t)=>t.specificity+e,0),this.head=e.reduce((e,t)=>!e||t.rarity>e.rarity?t:e,null),this.dynamic=e.some(e=>e.dynamic),this.selectors=e}toString(){return`${this.selectors.join("")}${Cs(this.combinator)}`}match(e){return!!e&&this.selectors.every(t=>t.match(e))}mayMatch(e){return!!e&&this.selectors.every(t=>t.mayMatch(e))}trackChanges(e,t){this.selectors.forEach(n=>n.trackChanges(e,t))}lookupSort(e,t){this.head.lookupSort(e,t||this)}removeSort(e,t){this.head.removeSort(e,t||this)}}class Ts extends As{constructor(){super(),this.specificity=0,this.rarity=0,this.dynamic=!1}toString(){return"*"+Cs(this.combinator)}match(){return!0}}class js extends As{constructor(e){super(),this.specificity=65536,this.rarity=3,this.dynamic=!1,this.id=e}toString(){return`#${this.id}${Cs(this.combinator)}`}match(e){return!!e&&e.id===this.id}lookupSort(e,t){e.sortById(this.id,t||this)}removeSort(e,t){e.removeById(this.id,t||this)}}class Ds extends As{constructor(e){super(),this.specificity=1,this.rarity=1,this.dynamic=!1,this.cssType=e}toString(){return`${this.cssType}${Cs(this.combinator)}`}match(e){return!!e&&e.tagName===this.cssType}lookupSort(e,t){e.sortByType(this.cssType,t||this)}removeSort(e,t){e.removeByType(this.cssType,t||this)}}class Ls extends As{constructor(e){super(),this.specificity=256,this.rarity=2,this.dynamic=!1,this.className=e}toString(){return`.${this.className}${Cs(this.combinator)}`}match(e){return!!e&&(e.classList&&e.classList.size&&e.classList.has(this.className))}lookupSort(e,t){e.sortByClass(this.className,t||this)}removeSort(e,t){e.removeByClass(this.className,t||this)}}class Ms extends As{constructor(e){super(),this.specificity=256,this.rarity=0,this.dynamic=!0,this.cssPseudoClass=e}toString(){return`:${this.cssPseudoClass}${Cs(this.combinator)}`}match(e){return!!e&&(e.cssPseudoClasses&&e.cssPseudoClasses.has(this.cssPseudoClass))}mayMatch(){return!0}trackChanges(e,t){t.addPseudoClass(e,this.cssPseudoClass)}}const Fs=(e,t)=>{const n=e.attributes[t];return void 0!==n?n:Array.isArray(e.styleScopeId)&&e.styleScopeId.includes(t)?t:void 0};class Rs extends As{constructor(e,t,n){super(),this.specificity=256,this.rarity=0,this.dynamic=!0,this.attribute=e,this.test=t,this.value=n,this.match=t?n?o=>{if(!o||!o.attributes)return!1;const r=""+Fs(o,e);if("="===t)return r===n;if("^="===t)return r.startsWith(n);if("$="===t)return r.endsWith(n);if("*="===t)return-1!==r.indexOf(n);if("~="===t){const e=r.split(" ");return e&&-1!==e.indexOf(n)}return"|="===t&&(r===n||r.startsWith(n+"-"))}:()=>!1:t=>!(!t||!t.attributes)&&!pi(Fs(t,e))}toString(){return`[${this.attribute}${Cs(this.test)}${this.test&&this.value||""}]${Cs(this.combinator)}`}match(){return!1}mayMatch(){return!0}trackChanges(e,t){t.addAttribute(e,this.attribute)}}class Vs extends As{constructor(e){super(),this.specificity=0,this.rarity=4,this.dynamic=!1,this.combinator=void 0,this.err=e}toString(){return``}match(){return!1}lookupSort(){return null}removeSort(){return null}}class Bs{constructor(e){this.selectors=e,this.dynamic=e.some(e=>e.dynamic)}match(e){if(!e)return!1;return this.selectors.every((t,n)=>(0!==n&&(e=e.parentNode),!!e&&!!t.match(e)))?e:null}mayMatch(e){if(!e)return!1;return this.selectors.every((t,n)=>(0!==n&&(e=e.parentNode),!!e&&!!t.mayMatch(e)))?e:null}trackChanges(e,t){this.selectors.forEach((n,o)=>{0!==o&&(e=e.parentNode),e&&n.trackChanges(e,t)})}}class Us{constructor(e){this.selectors=e,this.dynamic=e.some(e=>e.dynamic)}match(e){if(!e)return!1;return this.selectors.every((t,n)=>(0!==n&&(e=e.nextSibling),!!e&&!!t.match(e)))?e:null}mayMatch(e){if(!e)return!1;return this.selectors.every((t,n)=>(0!==n&&(e=e.nextSibling),!!e&&!!t.mayMatch(e)))?e:null}trackChanges(e,t){this.selectors.forEach((n,o)=>{0!==o&&(e=e.nextSibling),e&&n.trackChanges(e,t)})}}class Hs extends Is{constructor(e){super();const t=[void 0," ",">","+","~"];let n=[],o=[];const r=[],i=[...e],s=i.length-1;this.specificity=0,this.dynamic=!1;for(let e=s;e>=0;e--){const s=i[e];if(-1===t.indexOf(s.combinator))throw console.error(`Unsupported combinator "${s.combinator}".`),new Error(`Unsupported combinator "${s.combinator}".`);void 0!==s.combinator&&" "!==s.combinator||r.push(o=[n=[]]),">"===s.combinator&&o.push(n=[]),this.specificity+=s.specificity,s.dynamic&&(this.dynamic=!0),n.push(s)}this.groups=r.map(e=>new Bs(e.map(e=>new Us(e)))),this.last=i[s]}toString(){return this.selectors.join("")}match(e){return!!e&&this.groups.every((t,n)=>{if(0===n)return!!(e=t.match(e));let o=e;for(;o=o.parentNode;)if(e=t.match(o))return!0;return!1})}lookupSort(e){this.last.lookupSort(e,this)}removeSort(e){this.last.removeSort(e,this)}accumulateChanges(e,t){if(!this.dynamic)return this.match(e);const n=[],o=this.groups.every((t,o)=>{if(0===o){const o=t.mayMatch(e);return n.push({left:e,right:e}),!!(e=o)}let r=e;for(;r=r.parentNode;){const o=t.mayMatch(r);if(o)return n.push({left:r,right:null}),e=o,!0}return!1});if(!o)return!1;if(!t)return o;for(let e=0;e(e.ruleSet=this,null)),this.hash=n,this.selectors=e,this.declarations=t}toString(){return`${this.selectors.join(", ")} {${this.declarations.map((e,t)=>`${0===t?" ":""}${e.property}: ${e.value}`).join("; ")}}`}lookupSort(e){this.selectors.forEach(t=>t.lookupSort(e))}removeSort(e){this.selectors.forEach(t=>t.removeSort(e))}}class zs{constructor(){this.changeMap=new Map}addAttribute(e,t){const n=this.properties(e);n.attributes||(n.attributes=new Set),n.attributes.add(t)}addPseudoClass(e,t){const n=this.properties(e);n.pseudoClasses||(n.pseudoClasses=new Set),n.pseudoClasses.add(t)}properties(e){let t=this.changeMap.get(e);return t||this.changeMap.set(e,t={}),t}}class Ys{constructor(e){this.id={},this.class={},this.type={},this.universal=[],this.position=0,this.ruleSets=e,e.forEach(e=>e.lookupSort(this))}append(e){this.ruleSets=this.ruleSets.concat(e),e.forEach(e=>e.lookupSort(this))}delete(e){const t=[];this.ruleSets=this.ruleSets.filter(n=>n.hash!==e||(t.push(n),!1)),t.forEach(e=>e.removeSort(this))}query(e){const{tagName:t,id:n,classList:o}=e,r=[this.universal,this.id[n],this.type[t]];o.size&&o.forEach(e=>r.push(this.class[e]));const i=r.filter(e=>!!e).reduce((e,t)=>e.concat(t||[]),[]),s=new zs;return s.selectors=i.filter(t=>t.sel.accumulateChanges(e,s)).sort((e,t)=>e.sel.specificity-t.sel.specificity||e.pos-t.pos).map(e=>e.sel),s}sortById(e,t){this.addToMap(this.id,e,t)}sortByClass(e,t){this.addToMap(this.class,e,t)}sortByType(e,t){this.addToMap(this.type,e,t)}removeById(e,t){this.removeFromMap(this.id,e,t)}removeByClass(e,t){this.removeFromMap(this.class,e,t)}removeByType(e,t){this.removeFromMap(this.type,e,t)}sortAsUniversal(e){this.universal.push(this.makeDocSelector(e))}removeAsUniversal(e){const t=this.universal.findIndex(t=>t.sel.ruleSet.hash===e.ruleSet.hash);-1!==t&&this.universal.splice(t)}addToMap(e,t,n){this.position+=1;const o=e[t];o?o.push(this.makeDocSelector(n)):e[t]=[this.makeDocSelector(n)]}removeFromMap(e,t,n){const o=e[t],r=o.findIndex(e=>e.sel.ruleSet.hash===n.ruleSet.hash);-1!==r&&o.splice(r,1)}makeDocSelector(e){return this.position+=1,{sel:e,pos:this.position}}}function Ks(e){return"declaration"===e.type}function Gs(e){switch(e.type){case"*":return new Ts;case"#":return new js(e.identifier);case"":return new Ds(e.identifier.replace(/-/,"").toLowerCase());case".":return new Ls(e.identifier);case":":return new Ms(e.identifier);case"[]":return e.test?new Rs(e.property,e.test,e.value):new Rs(e.property);default:return null}}function qs(e){return 0===e.length?new Vs(new Error("Empty simple selector sequence.")):1===e.length?Gs(e[0]):new Ps(e.map(Gs))}function Xs(e){try{const t=function(e,t){let n=t;const{result:o,regexp:r}=xs("whiteSpaceRegEx",e,t);o&&(n=r.lastIndex);const i=[];let s,a,c=!0,l=[];return a=$s?[e]:e.split(" "),a.forEach(e=>{if(!$s){if(""===e)return;n=0}do{const t=Es(e,n);if(!t){if(c)return null;break}({end:n}=t),s&&(l[1]=s.value),l=[t.value,void 0],i.push(l),s=Ns(e,n),s&&({end:n}=s),c=s&&" "!==s.value}while(s)}),{start:t,end:n,value:i}}(e);return t?function(e){if(0===e.length)return new Vs(new Error("Empty selector."));if(1===e.length)return qs(e[0][0]);const t=[];for(let n=0;ne);const Qs={createNode:Symbol("createNode"),updateNode:Symbol("updateNode"),deleteNode:Symbol("deleteNode"),moveNode:Symbol("moveNode")};let ea,ta=!0,na=[];function oa(e=[],t){e.forEach(e=>{if(e){const{id:n,eventList:o}=e;o.forEach(e=>{const{name:o,type:r,listener:i}=e;let s;s=function(e){return!!ds[e]}(o)?ds[o]:function(e){return e.replace(/^(on)?/g,"").toLocaleLowerCase()}(o),r===us&&t.removeEventListener(n,s,i),r===ls&&(t.removeEventListener(n,s,i),t.addEventListener(n,s,i))})}})}function ra(e,t){0}function ia(t){if(!ta)return;if(ta=!1,0===na.length)return void(ta=!0);const{$nextTick:n,$options:{rootViewId:o}}=t;n(()=>{const t=function(e){const t=[];for(let n=0;n{switch(e.type){case Qs.createNode:ra(e.printedNodes),n.create(e.nodes),oa(e.eventNodes,n);break;case Qs.updateNode:ra(e.printedNodes),n.update(e.nodes),oa(e.eventNodes,n);break;case Qs.deleteNode:ra(e.printedNodes),n.delete(e.nodes);break;case Qs.moveNode:ra(e.printedNodes),n.move(e.nodes)}}),n.build(),ta=!0,na=[]})}function sa(){if(!ea||e.__HIPPY_VUE_STYLES__){const t=function(e=[]){const t=ii();return e.map(e=>{const n=e.declarations.filter(Ks).map(function(e){return t=>{const n=e(t);return n}}(t)),o=e.selectors.map(Xs);return new Ws(o,n,e.hash)})}(e.__HIPPY_VUE_STYLES__);ea?ea.append(t):ea=new Ys(t),e.__HIPPY_VUE_STYLES__=void 0}return e.__HIPPY_VUE_DISPOSE_STYLES__&&(e.__HIPPY_VUE_DISPOSE_STYLES__.forEach(e=>{ea.delete(e)}),e.__HIPPY_VUE_DISPOSE_STYLES__=void 0),ea}function aa(e){const t={};return e.meta.component.defaultNativeProps&&Object.keys(e.meta.component.defaultNativeProps).forEach(n=>{if(void 0!==e.getAttribute(n))return;const o=e.meta.component.defaultNativeProps[n];ui(o)?t[n]=o(e):t[n]=o}),Object.keys(e.attributes).forEach(n=>{let o=e.getAttribute(n);if(!e.meta.component.attributeMaps||!e.meta.component.attributeMaps[n])return void(t[n]=o);const r=e.meta.component.attributeMaps[n];if("string"==typeof r)return void(t[r]=o);if(ui(r))return void(t[n]=r(o));const{name:i,propsValue:s,jointKey:a}=r;ui(s)&&(o=s(o)),a?(t[a]=t[a]||{},Object.assign(t[a],{[i]:o})):t[i]=o}),e.meta.component.nativeProps&&Object.assign(t,e.meta.component.nativeProps),t}function ca(e){const t=Object.create(null);try{sa().query(e).selectors.forEach(n=>{(function(e,t){return!(!t||!e)&&e.match(t)})(n,e)&&n.ruleSet.declarations.forEach(e=>{t[e.property]=e.value})})}catch(e){console.error("getDomCss Error:",e)}return t}function la(e,t,n={}){if(t.meta.skipAddToDom)return[];if(!t.meta.component)throw new Error("Specific tag is not supported yet: "+t.tagName);let o=ca(t);o=Zs(Zs({},o),t.style),ni(t,o),t.meta.component.defaultNativeStyle&&(o=Zs(Zs({},t.meta.component.defaultNativeStyle),o));const r={id:t.nodeId,pId:t.parentNode&&t.parentNode.nodeId||e,name:t.meta.component.name,props:Zs(Zs({},aa(t)),{},{style:o}),tagName:t.tagName};!function(e){if(e.props.__modalFirstChild__){const t=e.props.style;Object.keys(t).some(e=>"position"===e&&"absolute"===t[e]&&(["position","left","right","top","bottom"].forEach(e=>delete t[e]),!0))}}(r),function(e,t,n){"View"===e.meta.component.name&&("scroll"===n.overflowX&&n.overflowY,"scroll"===n.overflowY?t.name="ScrollView":"scroll"===n.overflowX&&(t.name="ScrollView",t.props.horizontal=!0,n.flexDirection=ms()?"row-reverse":"row"),"ScrollView"===t.name&&(e.childNodes.length,e.childNodes.length&&e.childNodes[0].setStyle("collapsable",!1)),n.backgroundImage&&(n.backgroundImage=di(n.backgroundImage)))}(t,r,o),function(e,t){"TextInput"===e.meta.component.name&&ms()&&(t.textAlign||(t.textAlign="right"))}(t,o);const i=function(e){let t=void 0;const n=e.events;if(n){const o=[];Object.keys(n).forEach(e=>{const{name:t,type:r,isCapture:i,listener:s}=n[e];o.push({name:t,type:r,isCapture:i,listener:s})}),t={id:e.nodeId,eventList:o}}return t}(t);let s=void 0;return[[r,n],i,s]}function ua(e,t,n,o={}){const r=[],i=[],s=[];return t.traverseChildren((t,o)=>{const[a,c,l]=la(e,t,o);a&&r.push(a),c&&i.push(c),l&&s.push(l),"function"==typeof n&&n(t)},o),[r,i,s]}function da(e,t,n={}){if(!e||!t)return;if(t.meta.skipAddToDom)return;const o=ri();if(!o)return;const{$options:{rootViewId:r,rootView:i}}=o,s=function(e,t){return 3===e.nodeId||e.id===t.slice(1-t.length)}(e,i)&&!e.isMounted,a=e.isMounted&&!t.isMounted;if(s||a){const[i,a,c]=ua(r,s?e:t,e=>{var t,n;e.isMounted||(e.isMounted=!0),t=e,n=e.nodeId,ys.set(n,t)},n);na.push({type:Qs.createNode,nodes:i,eventNodes:a,printedNodes:c}),ia(o)}}function pa(e){if(!e.isMounted)return;const t=ri(),{$options:{rootViewId:n}}=t,[o,r,i]=la(n,e);o&&(na.push({type:Qs.updateNode,nodes:[o],eventNodes:[r],printedNodes:[]}),ia(t))}function fa(e){if(!e.isMounted)return;const t=ri(),{$options:{rootViewId:n}}=t,[o,r,i]=ua(n,e);na.push({type:Qs.updateNode,nodes:o,eventNodes:r,printedNodes:i}),ia(t)}const ha=new Set;let ma,ya=!1;const ga={exitApp(){Ua.callNative("DeviceEventModule","invokeDefaultBackPressHandler")},addListener:e=>(ya||(ya=!0,ga.initEventListener()),Ua.callNative("DeviceEventModule","setListenBackPress",!0),ha.add(e),{remove(){ga.removeListener(e)}}),removeListener(e){ha.delete(e),0===ha.size&&Ua.callNative("DeviceEventModule","setListenBackPress",!1)},initEventListener(){ma||(ma=ri()),ma.$on("hardwareBackPress",()=>{let e=!0;Array.from(ha).reverse().every(t=>"function"!=typeof t||!t()||(e=!1,!1)),e&&ga.exitApp()})}},va={exitApp(){},addListener:()=>({remove(){}}),removeListener(){},initEventListener(){}},ba="android"===Hippy.device.platform.OS?ga:va;let wa;const _a=new Map;class $a{constructor(e,t){this.eventName=e,this.listener=t}remove(){this.eventName&&this.listener&&(Sa(this.eventName,this.listener),this.listener=void 0)}}function Sa(e,t){if(t instanceof $a)return void t.remove();let n=e;"change"===e&&(n="networkStatusDidChange");const o=_a.get(t);o&&(wa||(wa=ri()),wa.$off(n,o),_a.delete(t),_a.size<1&&Ua.callNative("NetInfo","removeListener",n))}var Oa=Object.freeze({__proto__:null,addEventListener:function(e,t){if("function"!=typeof t)return;let n=e;return"change"===n&&(n="networkStatusDidChange"),0===_a.size&&Ua.callNative("NetInfo","addListener",n),wa||(wa=ri()),wa.$on(n,t),_a.set(t,t),new $a(n,t)},removeEventListener:Sa,fetch:function(){return Ua.callNativeWithPromise("NetInfo","getCurrentConnectivity").then(e=>e.network_info)},NetInfoRevoker:$a});function xa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ka(e){for(var t=1;tMa.callUIFunction(o,t,[],t=>{if(!t||"object"!=typeof t||void 0===o)return e(n);const{x:r,y:i,height:s,width:a}=t;return e({top:i,left:r,width:a,height:s,bottom:i+s,right:r+a})}))},Ua={callNative:Ia,callNativeWithPromise:Aa,callNativeWithCallbackId:Pa,UIManagerModule:Ma,ConsoleModule:e.ConsoleModule||e.console,on:Ea,off:Na,emit:Ca,PixelRatio:Da,Platform:Ta,Localization:ja,version:"3.0.0-alpha.22",Cookie:{getAll(e){if(!e)throw new TypeError("Vue.Native.Cookie.getAll() must have url argument");return Aa.call(this,"network","getCookie",e)},set(e,t,n){if(!e)throw new TypeError("Vue.Native.Cookie.getAll() must have url argument");if("string"!=typeof t)throw new TypeError("Vue.Native.Cookie.getAll() only receive string type of keyValue");let o="";if(n){if(!(n instanceof Date))throw new TypeError("Vue.Native.Cookie.getAll() only receive Date type of expires");o=n.toUTCString()}Ia.call(this,"network","setCookie",e,t,o)}},Clipboard:{getString(){return Aa.call(this,"ClipboardModule","getString")},setString(e){Ia.call(this,"ClipboardModule","setString",e)}},get isIPhoneX(){if(!a(Ra.isIPhoneX)){let e=!1;"ios"===Ua.Platform&&(e=20!==Ua.Dimensions.screen.statusBarHeight),Ra.isIPhoneX=e}return Ra.isIPhoneX},get screenIsVertical(){return Ua.Dimensions.window.widthBa(e,"measureInWindow"),measureInAppWindow:e=>"android"===Ua.Platform?Ba(e,"measureInWindow"):Ba(e,"measureInAppWindow"),getBoundingClientRect(e,t){const{nodeId:n}=e;return new Promise((o,r)=>{if(!e.isMounted||!n)return r(new Error(`getBoundingClientRect cannot get nodeId of ${e} or ${e} is not mounted`));ai(...Va,"UIManagerModule",{nodeId:n,funcName:"getBoundingClientRect",params:t}),Ma.callUIFunction(n,"getBoundingClientRect",[t],e=>{if(!e||e.errMsg)return r(new Error(e&&e.errMsg||"getBoundingClientRect error with no response"));const{x:t,y:n,width:i,height:s}=e;let a=void 0,c=void 0;return"number"==typeof n&&"number"==typeof s&&(a=n+s),"number"==typeof t&&"number"==typeof i&&(c=t+i),o({x:t,y:n,width:i,height:s,bottom:a,right:c,left:t,top:n})})})},parseColor(e,t={platform:Ua.Platform}){if(Number.isInteger(e))return e;const n=Ra.COLOR_PARSER||(Ra.COLOR_PARSER=Object.create(null));return n[e]||(n[e]=as(e)),n[e]},AsyncStorage:e.Hippy.asyncStorage,BackAndroid:ba,ImageLoader:{getSize(e){return Aa.call(this,"ImageLoaderModule","getSize",e)},prefetch(e){Ia.call(this,"ImageLoaderModule","prefetch",e)}},NetInfo:Oa,getElemCss:ca};class Ha{constructor(e){this.type=e,this.bubbles=!0,this.cancelable=!0,this.eventPhase=0,this.originalTarget=null,this.currentTarget=null,this.target=null,this.isCanceled=!1}get canceled(){return this.isCanceled}stopPropagation(){this.bubbles=!1}preventDefault(){this.cancelable&&(this.isCanceled=!0)}initEvent(e,t=!0,n=!0){return this.type=e,!1===t&&(this.bubbles=!1),!1===n&&(this.cancelable=!1),this}}class Wa{constructor(e){this.element=e,this.observers={}}getEventListeners(){return this.observers}addEventListener(e,t,n){if("string"!=typeof e)throw new TypeError("Events name(s) must be string.");if(t&&!ui(t))throw new TypeError("callback must be function.");const o=e.split(",");for(let e=0,r=o.length;e=0&&e.splice(o,1),0===e.length&&(this.observers[r]=void 0)}}else this.observers[r]=void 0}return this.observers}emit(e){const{type:t}=e,n=this.observers[t];if(n)for(let t=n.length-1;t>=0;t-=1){const o=n[t];o.options&&o.options.once&&n.splice(t,1),o.options&&o.options.thisArg?o.callback.apply(o.options.thisArg,[e]):o.callback(e)}}_getEventList(e,t){let n=this.observers[e];return!n&&t&&(n=[],this.observers[e]=n),n}_indexOfListener(e,t,n){return e.findIndex(e=>n?e.callback===t&&L(e.options,n):e.callback===t)}}const za=["%c[event]%c","color: green","color: auto"];const Ya={receiveNativeEvent(e){if(ai(...za,"receiveNativeEvent",e),!e||!Array.isArray(e)||e.length<2)return;const[t,n]=e,o=ri();o&&o.$emit(t,n)},receiveComponentEvent(e,t){if(ai(...za,"receiveComponentEvent",e),!e||!t)return;const{id:n,currentId:o,nativeName:r,originalName:i,params:s={},eventPhase:a}=e,c=vs(o),l=vs(n);if(c&&l)try{if([ps.AT_TARGET,ps.BUBBLING_PHASE].indexOf(a)>-1){const e=new Ha(i);if(Object.assign(e,{eventPhase:a,nativeParams:s||{}}),"onLayout"===r){const{layout:{x:t,y:n,height:o,width:r}}=s;e.top=n,e.left=t,e.bottom=n+o,e.right=t+r,e.width=r,e.height=o}else{const{processEventData:t}=c._meta.component;t&&t(e,r,s)}c.dispatchEvent(function(e,t,n){return function(e){return["onTouchDown","onTouchMove","onTouchEnd","onTouchCancel"].indexOf(e)>=0}(e)&&Object.assign(t,{touches:{0:{clientX:n.page_x,clientY:n.page_y},length:1}}),t}(r,e,s),l,t)}}catch(e){console.error("receiveComponentEvent error",e)}}};e.__GLOBAL__&&(e.__GLOBAL__.jsModuleList.EventDispatcher=Ya);let Ka=0;e.__GLOBAL__&&Number.isInteger(e.__GLOBAL__.nodeId)&&(Ka=e.__GLOBAL__.nodeId);class Ga{constructor(){this._ownerDocument=null,this._meta=null,this._isMounted=!1,this.nodeId=(Ka+=1,Ka%10==0&&(Ka+=1),Ka%10==0&&(Ka+=1),Ka),this.index=0,this.childNodes=[],this.parentNode=null,this.prevSibling=null,this.nextSibling=null}toString(){return this.constructor.name}get firstChild(){return this.childNodes.length?this.childNodes[0]:null}get lastChild(){const e=this.childNodes.length;return e?this.childNodes[e-1]:null}get meta(){return this._meta?this._meta:{}}get ownerDocument(){if(this._ownerDocument)return this._ownerDocument;let e=this;for(;"DocumentNode"!==e.constructor.name&&(e=e.parentNode,e););return this._ownerDocument=e,e}get isMounted(){return this._isMounted}set isMounted(e){this._isMounted=e}insertBefore(e,t){if(!e)throw new Error("Can't insert child.");if(!t)return this.appendChild(e);if(t.parentNode!==this)throw new Error("Can't insert child, because the reference node has a different parent.");if(e.parentNode&&e.parentNode!==this)throw new Error("Can't insert child, because it already has a different parent.");const n=this.childNodes.indexOf(t);let o=t;return t.meta.skipAddToDom&&(o=ws(this.childNodes,n)),e.parentNode=this,e.nextSibling=t,e.prevSibling=this.childNodes[n-1],this.childNodes[n-1]&&(this.childNodes[n-1].nextSibling=e),t.prevSibling=e,this.childNodes.splice(n,0,e),o.meta.skipAddToDom?da(this,e):da(this,e,{refId:o.nodeId,relativeToRef:_s})}moveChild(e,t){if(!e)throw new Error("Can't move child.");if(!t)return this.appendChild(e);if(t.parentNode!==this)throw new Error("Can't move child, because the reference node has a different parent.");if(e.parentNode&&e.parentNode!==this)throw new Error("Can't move child, because it already has a different parent.");const n=this.childNodes.indexOf(e),o=this.childNodes.indexOf(t);let r=t;if(t.meta.skipAddToDom&&(r=ws(this.childNodes,o)),o===n)return e;e.nextSibling=t,e.prevSibling=t.prevSibling,t.prevSibling=e,this.childNodes[o-1]&&(this.childNodes[o-1].nextSibling=e),this.childNodes[o+1]&&(this.childNodes[o+1].prevSibling=e),this.childNodes[n-1]&&(this.childNodes[n-1].nextSibling=this.childNodes[n+1]),this.childNodes[n+1]&&(this.childNodes[n+1].prevSibling=this.childNodes[n-1]),this.childNodes.splice(n,1);const i=this.childNodes.indexOf(t);return this.childNodes.splice(i,0,e),r.meta.skipAddToDom?da(this,e):function(e,t,n={}){if(e&&e.meta&&ui(e.meta.removeChild)&&e.meta.removeChild(e,t),!t||t.meta.skipAddToDom)return;if(n&&n.refId===t.nodeId)return;t.isMounted=!1;const o=ri(),{$options:{rootViewId:r}}=o,i={id:t.nodeId,pId:t.parentNode?t.parentNode.nodeId:r},s=[[i,n]],a=[];na.push({printedNodes:a,type:Qs.moveNode,nodes:s,eventNodes:[]}),ia(o)}(this,e,{refId:r.nodeId,relativeToRef:_s})}appendChild(e){if(!e)throw new Error("Can't append child.");if(e.parentNode&&e.parentNode!==this)throw new Error("Can't append child, because it already has a different parent.");this.lastChild!==e&&(e.isMounted&&this.removeChild(e),e.parentNode=this,this.lastChild&&(e.prevSibling=this.lastChild,this.lastChild.nextSibling=e),this.childNodes.push(e),da(this,e))}removeChild(e){if(!e)throw new Error("Can't remove child.");if(!e.parentNode)throw new Error("Can't remove child, because it has no parent.");if(e.parentNode!==this)throw new Error("Can't remove child, because it has a different parent.");if(e.meta.skipAddToDom)return;e.prevSibling&&(e.prevSibling.nextSibling=e.nextSibling),e.nextSibling&&(e.nextSibling.prevSibling=e.prevSibling),e.prevSibling=null,e.nextSibling=null;const t=this.childNodes.indexOf(e);this.childNodes.splice(t,1),function(e,t){if(!t||t.meta.skipAddToDom)return;t.isMounted=!1;const n=ri(),{$options:{rootViewId:o}}=n,r={id:t.nodeId,pId:t.parentNode?t.parentNode.nodeId:o},i=[[r,{}]],s=[];na.push({printedNodes:s,type:Qs.deleteNode,nodes:i,eventNodes:[]}),ia(n)}(0,e)}findChild(e){if(e(this))return this;if(this.childNodes.length)for(let t=0;t{this.traverseChildren.call(t,e,{})})}}function qa(){qa=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,o,r){var i=new RegExp(e,o);return t.set(i,r||t.get(e)),qi(i,n.prototype)}function o(e,n){var o=t.get(n);return Object.keys(o).reduce((function(t,n){var r=o[n];if("number"==typeof r)t[n]=e[r];else{for(var i=0;void 0===e[r[i]]&&i+1]+)>/g,(function(e,t){var n=i[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof r){var s=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(o(e,s)),r.apply(this,e)}))}return e[Symbol.replace].call(this,n,r)},qa.apply(this,arguments)}const Xa={totop:"0",totopright:"totopright",toright:"90",tobottomright:"tobottomright",tobottom:"180",tobottomleft:"tobottomleft",toleft:"270",totopleft:"totopleft"},Ja="turn",Za="rad",Qa="deg";function ec(e){const t=(e||"").replace(/\s*/g,"").toLowerCase(),n=qa(/^([+-]?(?=(\d+))\2\.?\d*)+(deg|turn|rad)|(to\w+)$/g,{digit:2}).exec(t);if(!Array.isArray(n))return;let o="180";const[r,i,s]=n;return i&&s?o=function(e,t=Qa){const n=parseFloat(e);let o=e||"";const[,r]=e.split(".");switch(r&&r.length>2&&(o=n.toFixed(2)),t){case Ja:o=""+(360*n).toFixed(2);break;case Za:o=""+(180/Math.PI*n).toFixed(2)}return o}(i,s):r&&void 0!==Xa[r]&&(o=Xa[r]),o}function tc(e){const t=(e||"").replace(/\s+/g," ").trim(),[n,o]=t.split(/\s+(?![^(]*?\))/),r=/^([+-]?\d+\.?\d*)%$/g;return!n||r.exec(n)||o?n&&r.exec(o)?{ratio:parseFloat(o.split("%")[0])/100,color:Ua.parseColor(n)}:void 0:{color:Ua.parseColor(n)}}function nc(e,t,n){"backgroundImage"===e&&n.linearGradient&&delete n.linearGradient}const oc={textShadowOffsetX:"width",textShadowOffsetY:"height"};function rc(e,t,n){void 0===t&&(delete n[e],nc(e,0,n),function(e,t,n){"textShadowOffsetX"!==e&&"textShadowOffsetY"!==e||!n.textShadowOffset||(delete n.textShadowOffset[oc[e]],0===Object.keys(n.textShadowOffset).length&&delete n.textShadowOffset)}(e,0,n))}function ic(e,t){if("string"!=typeof e)return;const n=e.split(",");for(let e=0,o=n.length;ee.trim()));if(function(e,t){if(e.size!==t.size)return!1;const n=e.values();let o=n.next().value;for(;o;){if(!t.has(o))return!1;o=n.next().value}return!0}(this.classList,e))return;return this.classList=e,void(!n.notToNative&&fa(this))}case"id":if(r===this.id)return;return this.id=r,void(!n.notToNative&&fa(this));case"text":case"value":case"defaultValue":case"placeholder":if("string"!=typeof r)try{r=r.toString()}catch(e){e.message}n&&n.textUpdate||(r=function(e){return"string"!=typeof e?e:!ei||void 0===ei.config.trimWhitespace||ei.config.trimWhitespace?e.trim().replace(/Â/g," "):e.replace(/Â/g," ")}(r)),r=function(e){return e.replace(/\\u[\dA-F]{4}|\\x[\dA-F]{2}/gi,e=>String.fromCharCode(parseInt(e.replace(/\\u|\\x/g,""),16)))}(r);break;case"numberOfRows":if("ios"!==Ua.Platform)return;break;case"caretColor":case"caret-color":o="caret-color",r=Ua.parseColor(r);break;case"break-strategy":o="breakStrategy";break;case"placeholderTextColor":case"placeholder-text-color":o="placeholderTextColor",r=Ua.parseColor(r);break;case"underlineColorAndroid":case"underline-color-android":o="underlineColorAndroid",r=Ua.parseColor(r);break;case"nativeBackgroundAndroid":{const e=r;void 0!==e.color&&(e.color=Ua.parseColor(e.color)),o="nativeBackgroundAndroid",r=e;break}}if(this.attributes[o]===r)return;this.attributes[o]=r,"function"==typeof this.filterAttribute&&this.filterAttribute(this.attributes),!n.notToNative&&pa(this)}catch(e){0}}removeAttribute(e){delete this.attributes[e]}setStyles(e){e&&"object"==typeof e&&0!==Object.keys(e).length&&(Object.keys(e).forEach(t=>{const n=e[t];this.setStyle(t,n,!0)}),pa(this))}setStyle(e,t,n=!1){let{value:o,property:r}=this.beforeLoadStyle({property:e,value:t});if(void 0===t)return rc(r,o,this.style),void(n||pa(this));switch(r){case"fontWeight":"string"!=typeof o&&(o=o.toString());break;case"backgroundImage":[r,o]=function(e,t,n){delete n[e],nc(e,t,n);let o=t,r=e;if(0===t.indexOf("linear-gradient")){r="linearGradient";const e=t.substring(t.indexOf("(")+1,t.lastIndexOf(")")).split(/,(?![^(]*?\))/),n=[];o={},e.forEach((e,t)=>{if(0===t){const t=ec(e);if(t)o.angle=t;else{o.angle="180";const t=tc(e);t&&n.push(t)}}else{const t=tc(e);t&&n.push(t)}}),o.colorStopList=n}else{const e=/(?:\(['"]?)(.*?)(?:['"]?\))/.exec(t);e&&e.length>1&&([,o]=e)}return[r,o]}(r,o,this.style);break;case"textShadowOffsetX":case"textShadowOffsetY":[r,o]=function(e,t=0,n){return n.textShadowOffset=n.textShadowOffset||{},Object.assign(n.textShadowOffset,{[oc[e]]:t}),["textShadowOffset",n.textShadowOffset]}(r,o,this.style);break;case"textShadowOffset":{const{x:e=0,width:t=0,y:n=0,height:r=0}=o||{};o={width:e||t,height:n||r};break}default:Object.prototype.hasOwnProperty.call(cs,r)&&(r=cs[r]),"string"==typeof o&&(o=o.trim(),o=r.toLowerCase().indexOf("color")>=0?Ua.parseColor(o):function(e,t,n){if(String.prototype.endsWith)return e.endsWith(t,n);let o=n;return(void 0===o||o>e.length)&&(o=e.length),e.slice(o-t.length,o)===t}(o,"px")?parseFloat(o.slice(0,o.length-2)):function(e){if("number"==typeof e)return e;if("string"==typeof e&&li.test(e))try{return parseFloat(e)}catch(e){}return e}(o))}null!=o&&this.style[r]!==o&&(this.style[r]=o,n||pa(this))}setNativeProps(e){if(e){const{style:t}=e;this.setStyles(t)}}repaintWithChildren(){fa(this)}setStyleScope(e){"string"!=typeof e&&(e=e.toString()),e&&!this.scopeIdList.includes(e)&&this.scopeIdList.push(e)}get styleScopeId(){return this.scopeIdList}appendChild(e){e&&e.meta.symbol===gi&&this.setText(e.text,{notToNative:!0}),super.appendChild(e)}insertBefore(e,t){e&&e.meta.symbol===gi&&this.setText(e.text,{notToNative:!0}),super.insertBefore(e,t)}moveChild(e,t){e&&e.meta.symbol===gi&&this.setText(e.text,{notToNative:!0}),super.moveChild(e,t)}removeChild(e){e&&e.meta.symbol===gi&&this.setText("",{notToNative:!0}),super.removeChild(e)}setText(e,t={}){return"textarea"===this.tagName?this.setAttribute("value",e,{notToNative:!!t.notToNative}):this.setAttribute("text",e,{notToNative:!!t.notToNative})}setListenerHandledType(e,t){this.events[e]&&(this.events[e].handledType=t)}isListenerHandled(e,t){return!this.events[e]||t===this.events[e].handledType}getNativeEventName(e){let t="on"+ci(e);if(this.meta.component){const{eventNamesMap:n}=this.meta.component;n&&n[e]&&(t=n[e])}return t}addEventListener(e,t,n){if(this._emitter||(this._emitter=new Wa(this)),"scroll"===e&&!(this.getAttribute("scrollEventThrottle")>0)){const e=200;this.attributes.scrollEventThrottle=e}"function"==typeof this.polyfillNativeEvents&&({eventNames:e,callback:t,options:n}=this.polyfillNativeEvents(fs,e,t,n)),this._emitter.addEventListener(e,t,n),ic(e,e=>{const t=this.getNativeEventName(e);var n,o;this.events[t]?this.events[t]&&this.events[t].type!==ls&&(this.events[t].type=ls):this.events[t]={name:t,type:ls,listener:(n=t,o=e,e=>{const{id:t,currentId:r,params:i,eventPhase:s}=e,a={id:t,nativeName:n,originalName:o,currentId:r,params:i,eventPhase:s};Ya.receiveComponentEvent(a,e)}),isCapture:!1}}),pa(this)}removeEventListener(e,t,n){if(!this._emitter)return null;"function"==typeof this.polyfillNativeEvents&&({eventNames:e,callback:t,options:n}=this.polyfillNativeEvents(hs,e,t,n));const o=this._emitter.removeEventListener(e,t,n);return ic(e,e=>{const t=this.getNativeEventName(e);this.events[t]&&(this.events[t].type=us)}),pa(this),o}dispatchEvent(e,t,n){if(!(e instanceof Ha))throw new Error("dispatchEvent method only accept Event instance");e.currentTarget=this,e.target||(e.target=t||this,"string"==typeof e.value&&(e.target.value=e.value)),this._emitter&&this._emitter.emit(e),!e.bubbles&&n&&n.stopPropagation()}getBoundingClientRect(){return Ua.measureInWindow(this)}scrollToPosition(e=0,t=0,n=1e3){"number"==typeof e&&"number"==typeof t&&(!1===n&&(n=0),Ua.callUIFunction(this,"scrollToWithOptions",[{x:e,y:t,duration:n}]))}scrollTo(e,t,n){let o=n;if("object"==typeof e&&e){const{left:t,top:n,behavior:r="auto"}=e;({duration:o}=e),this.scrollToPosition(t,n,"none"===r?0:o)}else this.scrollToPosition(e,t,n)}setPressed(e){Ua.callUIFunction(this,"setPressed",[e])}setHotspot(e,t){Ua.callUIFunction(this,"setHotspot",[e,t])}}class ac extends sc{constructor(e){super("comment"),this.text=e,this._meta={symbol:gi,skipAddToDom:!0}}}class cc extends Ga{constructor(e){super(),this.text=e,this._meta={symbol:gi,skipAddToDom:!0}}setText(e){this.text=e,"function"==typeof this.parentNode.setText&&this.parentNode.setText(e)}}class lc extends sc{getValue(){return new Promise(e=>Ua.callUIFunction(this,"getValue",t=>e(t.text)))}setValue(e){Ua.callUIFunction(this,"setValue",[e])}focus(){Ua.callUIFunction(this,"focusTextInput",[])}blur(){Ua.callUIFunction(this,"blurTextInput",[])}isFocused(){return new Promise(e=>Ua.callUIFunction(this,"isFocused",t=>e(t.value)))}clear(){Ua.callUIFunction(this,"clear",[])}showInputMethod(){}hideInputMethod(){}}class uc extends sc{scrollToIndex(e=0,t=0,n=!0){"number"==typeof e&&"number"==typeof t&&Ua.callUIFunction(this,"scrollToIndex",[e,t,n])}scrollToPosition(e=0,t=0,n=!0){"number"==typeof e&&"number"==typeof t&&Ua.callUIFunction(this,"scrollToContentOffset",[e,t,n])}}class dc extends Ga{constructor(){super(),this.documentElement=new sc("document"),this.createComment=this.constructor.createComment,this.createElement=this.constructor.createElement,this.createElementNS=this.constructor.createElementNS,this.createTextNode=this.constructor.createTextNode}static createComment(e){return new ac(e)}static createElement(e){switch(e){case"input":case"textarea":return new lc(e);case"ul":return new uc(e);default:return new sc(e)}}static createElementNS(e,t){return new sc(`${e}:${t}`)}static createTextNode(e){return new cc(e)}static createEvent(e){return new Ha(e)}}var pc={create(e,t){fc(t)},update(e,t){e.data.ref!==t.data.ref&&(fc(e,!0),fc(t))},destroy(e){fc(e,!0)}};function fc(e,t){const n=e.data.ref;if(!a(n))return;const o=e.context,r=e.componentInstance||e.elm,i=o.$refs;t?Array.isArray(i[n])?_(i[n],r):i[n]===r&&(i[n]=void 0):e.data.refInFor?Array.isArray(i[n])?i[n].indexOf(r)<0&&i[n].push(r):i[n]=[r]:i[n]=r}const hc=new pe("",{},[]),mc=["create","activate","update","remove","destroy"];function yc(e,t){return e.key===t.key&&e.asyncFactory===t.asyncFactory&&(e.tag===t.tag&&e.isComment===t.isComment&&a(e.data)===a(t.data)&&function(e,t){if("input"!==e.tag)return!0;let n;const o=a(n=e.data)&&a(n=n.attrs)&&n.type,r=a(n=t.data)&&a(n=n.attrs)&&n.type;return o===r||kn(o)&&kn(r)}(e,t)||c(e.isAsyncPlaceholder)&&s(t.asyncFactory.error))}function gc(e,t,n){let o,r;const i={};for(o=t;o<=n;++o)r=e[o].key,a(r)&&(i[r]=o);return i}var vc={create:bc,update:bc,destroy:function(e){bc(e,hc)}};function bc(e,t){(e.data.directives||t.data.directives)&&function(e,t){const n=e===hc,o=t===hc,r=_c(e.data.directives,e.context),i=_c(t.data.directives,t.context),s=[],a=[];let c,l,u;for(c in i)l=r[c],u=i[c],l?(u.oldValue=l.value,u.oldArg=l.arg,Sc(u,"update",t,e),u.def&&u.def.componentUpdated&&a.push(u)):(Sc(u,"bind",t,e),u.def&&u.def.inserted&&s.push(u));if(s.length){const o=()=>{for(let n=0;n{for(let n=0;n{const t=r[e],o=i[e];null!=t&&null==o&&(n[e]=void 0)}),Object.keys(i).forEach(e=>{const t=r[e],o=i[e];t!==o&&(n[e]=o)}),Object.keys(n).forEach(e=>{o.setAttribute(e,n[e])})}var kc={create:xc,update:xc};function Ec(e,t){const{elm:n,data:o}=t,r=e.data;if(!(o.staticClass||o.class||r&&(r.staticClass||r.class)))return;let i=wn(t);const s=n._transitionClasses;s&&(i=$n(i,Sn(s))),i!==n._prevClass&&(n.setAttribute("class",i),n._prevClass=i)}var Nc={create:Ec,update:Ec};let Cc;function Ic(e,t,n,o){(o||Cc).removeEventListener(e)}function Ac(e,t,n,o,r){n||Cc.addEventListener(e,t)}function Pc(e,t,n){const o=Cc;return function(){const n=t(...arguments);null!==n&&Ic(e,0,0,o)}}function Tc(e,t){if(!e.data.on&&!t.data.on)return;const n=t.data.on||{},o=e.data.on||{};Cc=t.elm,Qe(n,o,Ac,Ic,Pc,t.context)}var jc={create:Tc,update:Tc};function Dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Lc(e){for(var t=1;t{const r=e[o],i=t[o];!pi(r)&&pi(i)&&(n[Mc(o)]=void 0)}),Object.keys(t).forEach(o=>{const r=e[o],i=t[o];pi(i)||i===r||(n[Mc(o)]=i)}),n}function Vc(e,t){if(!t.elm||!function(e,t){return!(!e.data&&!t.data)&&!!(e.data.style||t.data.style||e.data.staticStyle||t.data.staticStyle)}(e,t))return;const n=Rc(e.data.staticStyle||{},t.data.staticStyle||{}),o=e.data.style||{};let r=t.data.style||{};const i=r.__ob__;Array.isArray(r)&&(r=Fc(r),t.data.style=r),i&&(r=P({},r),t.data.style=r);const s=Rc(o,r);t.elm.setStyles(Lc(Lc({},n),s))}var Bc=[kc,Nc,jc,{create:Vc,update:Vc}];function Uc(e,t){let n=!1;3===e.nodeId&&(n=!0),n&&(function(e,t,n={}){if(!e||!e.data)return;let{elm:o}=e;if(t&&(o=t),!o)return;let r=e.data&&e.data.attrs||{};r.__ob__&&(r=P({},r),e.data.attrs=r),Object.keys(r).forEach(e=>{o.setAttribute(e,r[e],{notToNative:!!n.notToNative})})}(t,e,{notToNative:!0}),function(e,t,n={}){if(!e||!e.data)return;let{elm:o}=e;if(t&&(o=t),!o)return;const{staticStyle:r}=e.data;r&&Object.keys(r).forEach(e=>{const t=r[e];t&&o.setStyle(Mc(e),t,!!n.notToNative)});let{style:i}=e.data;if(i){const t=i.__ob__;Array.isArray(i)&&(i=Fc(i),e.data.style=i),t&&(i=P({},i),e.data.style=i),Object.keys(i).forEach(e=>{o.setStyle(Mc(e),i[e],!!n.notToNative)})}}(t,e,{notToNative:!0}),function(e,t,n={}){if(!e||!e.data)return;const{data:o}=e;if(!o.staticClass&&!o.class)return;let{elm:r}=e;if(t&&(r=t),!r)return;let i=wn(e);const s=r._transitionClasses;s&&(i=$n(i,Sn(s))),i!==r._prevClass&&(r.setAttribute("class",i,{notToNative:!!n.notToNative}),r._prevClass=i)}(t,e,{notToNative:!0}))}const Hc=function(e){let t,n;const o={},{modules:r,nodeOps:i}=e;for(t=0;tm?(p=s(n[v+1])?null:n[v+1].elm,b(e,p,n,h,v,o)):h>v&&_(t,f,m)}(p,y,g,n,u):a(g)?(a(e.text)&&i.setTextContent(p,""),b(p,null,g,0,g.length-1,n)):a(y)?_(y,0,y.length-1):a(e.text)&&i.setTextContent(p,""):e.text!==t.text&&i.setTextContent(p,t.text),a(h)&&a(f=h.hook)&&a(f=f.postpatch)&&f(e,t)}function x(e,t,n){if(c(n)&&a(e.parent))e.parent.data.pendingInsert=t;else for(let e=0;e=0?e.moveChild(t,n):e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t),bs(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.setText(t)},setAttribute:function(e,t,n){e.setAttribute(t,n)},setStyleScope:function(e,t){e.setStyleScope(t)}}),modules:Bc.concat(Oc)});function Wc(e,t){t!==e.attributes.defaultValue&&(e.attributes.defaultValue=t,e.setAttribute("text",t,{textUpdate:!0}))}let zc=function(e,t,n){t!==n&&e.setAttribute("defaultValue",t,{textUpdate:!0})};const Yc={inserted(e,t){"ios"===Ua.Platform&&zc!==Wc&&(zc=Wc),"TextInput"===e.meta.component.name&&(e._vModifiers=t.modifiers,e.attributes.defaultValue=t.value,t.modifiers.lazy||e.addEventListener("change",({value:t})=>{const n=new Ha("input");n.value=t,e.dispatchEvent(n)}))},update(e,{value:t,oldValue:n}){e.value=t,zc(e,t,n)}};function Kc(e,t,n,o){t?(n.data.show=!0,e.setStyle("display",o)):e.setStyle("display","none")}const Gc={bind(e,{value:t},n){void 0===e.style.display&&(e.style.display="block");const o="none"===e.style.display?"":e.style.display;e.__vOriginalDisplay=o,Kc(e,t,n,o)},update(e,{value:t,oldValue:n},o){!t!=!n&&Kc(e,t,o,e.__vOriginalDisplay)},unbind(e,t,n,o,r){r||(e.style.display=e.__vOriginalDisplay)}};var qc=Object.freeze({__proto__:null,model:Yc,show:Gc});const Xc=['%c[Hippy-Vue "3.0.0-alpha.22"]%c',"color: #4fc08d; font-weight: bold","color: auto; font-weight: auto"],Jc=new dc;dn.$document=Jc,dn.prototype.$document=Jc,dn.$Document=dc,dn.$Event=Ha,dn.config.mustUseProp=function(e,t,n){const o=Gi(e);return!!o.mustUseProp&&o.mustUseProp(t,n)},dn.config.isReservedTag=Hi,dn.config.isUnknownElement=function(e){return t=e,!Wi.has(Yi(t));var t},dn.compile=Gr,dn.registerElement=Ki,P(dn.options.directives,qc),dn.prototype.__patch__=Hc,dn.prototype.$mount=function(e,t){const n=this.$options;if(!n.render){const{template:e}=n;if(e&&"string"!=typeof e)return se("invalid template option: "+e,this),this;if(e){const{render:t,staticRenderFns:o}=Gr(e,{delimiters:n.delimiters,comments:n.comments},this);n.render=t,n.staticRenderFns=o}}return function(e,t,n){let o;return e.$el=t,e.$options.render||(e.$options.render=fe),Wt(e,"beforeMount"),o=()=>{e._update(e._render(),n)},new en(e,o,T,{before(){e._isMounted&&!e._isDestroyed&&Wt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Wt(e,"mounted")),e}(this,e,t)},dn.prototype.$start=function(e,t){var n;oi(this),ui(this.$options.beforeLoadStyle)&&(n=this.$options.beforeLoadStyle,ti=n),Wi.forEach(e=>{dn.component(e.meta.component.name,e.meta.component)}),Fa.regist(this.$options.appName,n=>{const{__instanceId__:o}=n;if(this.$options.$superProps=n,this.$options.rootViewId=o,ai(...Xc,"Start",this.$options.appName,"with rootViewId",o,n),this.$el){this.$destroy();oi(new(dn.extend(this.$options))(this.$options))}if(ui(t)&&t(this,n),this.$mount(),"ios"===Ua.Platform){const e=function(e={}){const{iPhone:t}=e;let n={};if(t&&t.statusBar&&(n=t.statusBar),n.disabled)return null;const o=new sc("div"),{statusBarHeight:r}=Ua.Dimensions.screen;Ua.screenIsVertical?o.setStyle("height",r):o.setStyle("height",0);let i=4282431619;if("number"==typeof n.backgroundColor&&({backgroundColor:i}=n),o.setStyle("backgroundColor",i),"string"==typeof n.backgroundImage){const t=new sc("img");t.setStyle("width",Ua.Dimensions.screen.width),t.setStyle("height",r),t.setAttribute("src",e.statusBarOpts.backgroundImage),o.appendChild(t)}return o.addEventListener("layout",()=>{Ua.screenIsVertical?o.setStyle("height",r):o.setStyle("height",0)}),o}(this.$options);e&&(this.$el.childNodes.length?this.$el.insertBefore(e,this.$el.childNodes[0]):this.$el.appendChild(e))}ui(e)&&e(this,n)})};let Zc=1;dn.component=function(e,t){return t?(p(t)&&(t.name=t.name||e,t=this.options._base.extend(t)),this.options.components[e]=t,t):this.options.components[e]},dn.extend=function(e){e=e||{};const t=this,n=t.cid,o=e._Ctor||(e._Ctor={});if(o[n])return o[n];const r=e.name||t.options.name,i=function(e){this._init(e)};return(i.prototype=Object.create(t.prototype)).constructor=i,Zc+=1,i.cid=Zc,i.options=Te(t.options,e),i.super=t,i.options.props&&function(e){const{props:t}=e.options;Object.keys(t).forEach(t=>nn(e.prototype,"_props",t))}(i),i.options.computed&&function(e){const{computed:t}=e.options;Object.keys(t).forEach(n=>sn(e.prototype,n,t[n]))}(i),i.extend=t.extend,i.mixin=t.mixin,i.use=t.use,R.forEach(e=>{i[e]=t[e]}),r&&(i.options.components[r]=i),i.superOptions=t.options,i.extendOptions=e,i.sealedOptions=P({},i.options),o[n]=i,i},dn.Native=Ua,dn.getApp=ri,dn.use((function(){Object.keys(Vi).forEach(e=>{Ki(e,Vi[e])})})),B.devtools&&ne&&ne.emit("init",dn);dn.config._setBeforeRenderToNative=(e,t)=>{ui(e)&&(1===t?ni=e:console.error("_setBeforeRenderToNative API had changed, the hook function will be ignored!"))};const Qc=new Proxy(dn,{construct(e,t){const n=new e(...t);return n}});function el(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}let tl;e.process=e.process||{},e.process.env=e.process.env||{},e.WebSocket=class{constructor(e,t,n){tl=ri(),this.url=e,this.readyState=0,this.webSocketCallbacks={},this.onWebSocketEvent=this.onWebSocketEvent.bind(this);const o=function(e){for(var t=1;t0?o["Sec-WebSocket-Protocol"]=t.join(","):"string"==typeof t&&(o["Sec-WebSocket-Protocol"]=t);const r={headers:o,url:e};Ua.callNativeWithPromise("websocket","connect",r).then(e=>{e&&0===e.code&&"number"==typeof e.id&&(this.webSocketId=e.id)})}close(e,t){1===this.readyState&&(this.readyState=2,Ua.callNative("websocket","close",{id:this.webSocketId,code:e,reason:t}))}send(e){if(1===this.readyState){if("string"!=typeof e)throw new TypeError("Unsupported websocket data type: "+typeof e);Ua.callNative("websocket","send",{id:this.webSocketId,data:e})}}set onopen(e){this.webSocketCallbacks.onOpen=e}set onclose(e){this.webSocketCallbacks.onClose=e}set onerror(e){this.webSocketCallbacks.onError=e}set onmessage(e){this.webSocketCallbacks.onMessage=e}onWebSocketEvent(e){if("object"!=typeof e||e.id!==this.webSocketId)return;const t=e.type;if("string"!=typeof t)return;"onOpen"===t?this.readyState=1:"onClose"===t&&(this.readyState=3,tl.$off("hippyWebsocketEvents",this.onWebSocketEvent));const n=this.webSocketCallbacks[t];ui(n)&&n(e.data)}},Qc.config.silent=!1,Qc.config.trimWhitespace=!0,function(e){ei=e}(Qc)}.call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/timers-browserify/main.js").setImmediate,n("./node_modules/process/browser.js"))},"./node_modules/process/browser.js":function(e,t){var n,o,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(e){o=s}}();var c,l=[],u=!1,d=-1;function p(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&f())}function f(){if(!u){var e=a(p);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d1)for(var n=1;n=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./scripts/vendor.js":function(e,t,n){n("./node_modules/@hippy/vue/dist/index.js"),n("./node_modules/@hippy/vue-native-components/dist/index.js")},0:function(e,t,n){e.exports=n}}); \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/mock/Libdemo.mock.ets b/framework/examples/ohos-c-demo/src/mock/Libdemo.mock.ets new file mode 100644 index 00000000000..c2171716d04 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/mock/Libdemo.mock.ets @@ -0,0 +1,7 @@ +const NativeMock: Record = { + 'add': (a: number, b: number) => { + return a + b; + }, +}; + +export default NativeMock; \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/mock/mock-config.json5 b/framework/examples/ohos-c-demo/src/mock/mock-config.json5 new file mode 100644 index 00000000000..79e40db92ab --- /dev/null +++ b/framework/examples/ohos-c-demo/src/mock/mock-config.json5 @@ -0,0 +1,5 @@ +{ + "libdemo.so": { + "source": "src/mock/Libdemo.mock.ets" + } +} diff --git a/framework/examples/ohos-c-demo/src/ohosTest/ets/test/Ability.test.ets b/framework/examples/ohos-c-demo/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 00000000000..85c78f67579 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,35 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function abilityTest() { + describe('ActsAbilityTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }) + }) +} \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/ohosTest/ets/test/List.test.ets b/framework/examples/ohos-c-demo/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 00000000000..794c7dc4ed6 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,5 @@ +import abilityTest from './Ability.test'; + +export default function testsuite() { + abilityTest(); +} \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/ohosTest/module.json5 b/framework/examples/ohos-c-demo/src/ohosTest/module.json5 new file mode 100644 index 00000000000..b67f6dffcb3 --- /dev/null +++ b/framework/examples/ohos-c-demo/src/ohosTest/module.json5 @@ -0,0 +1,13 @@ +{ + "module": { + "name": "entry_c_test", + "type": "feature", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false + } +} diff --git a/framework/examples/ohos-c-demo/src/test/List.test.ets b/framework/examples/ohos-c-demo/src/test/List.test.ets new file mode 100644 index 00000000000..bb5b5c3731e --- /dev/null +++ b/framework/examples/ohos-c-demo/src/test/List.test.ets @@ -0,0 +1,5 @@ +import localUnitTest from './LocalUnit.test'; + +export default function testsuite() { + localUnitTest(); +} \ No newline at end of file diff --git a/framework/examples/ohos-c-demo/src/test/LocalUnit.test.ets b/framework/examples/ohos-c-demo/src/test/LocalUnit.test.ets new file mode 100644 index 00000000000..165fc1615ee --- /dev/null +++ b/framework/examples/ohos-c-demo/src/test/LocalUnit.test.ets @@ -0,0 +1,33 @@ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function localUnitTest() { + describe('localUnitTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }); + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }); + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }); + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }); + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }); + }); +} \ No newline at end of file diff --git a/framework/examples/ohos-demo/src/main/ets/entryability/EntryAbility.ets b/framework/examples/ohos-demo/src/main/ets/entryability/EntryAbility.ets index c46a498f2f2..5942841ef18 100644 --- a/framework/examples/ohos-demo/src/main/ets/entryability/EntryAbility.ets +++ b/framework/examples/ohos-demo/src/main/ets/entryability/EntryAbility.ets @@ -53,17 +53,16 @@ export default class EntryAbility extends UIAbility { return; } hilog.info(0x0000, 'DemoTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + + // 注册自定义字体 + let fontPath = this.context.resourceDir + '/fonts/TTTGB.otf' font.registerFont({ familyName: 'TTTGB', - familySrc: '/fonts/TTTGB.otf' // font文件与pages目录同级 + familySrc: `file://${fontPath}` }) hilog.info(0x0000, 'DemoTag', 'resources/resfile的绝对路径 : %{public}s', this.context.resourceDir); - // todo : - // this.context.resourceDir的值是'/data/storage/el1/bundle/entry/resources/resfile' - // 把字体路径告知 c 层需要napi调用: - // OhMeasureText::RegisterFont("TTTGB", this.context.resourceDir + "/fonts/TTTGB.otf") - // 注意:TTTGB.otf 在 src/main/ets/fonts 和 src/main/resources/resfile/fonts 中各需一份拷贝,rawfile/fonts可以删除 - // 建议在 HippyEngine.ets的EngineInitParams 中加一个registerFont的方法,把上面ArkTS的字体注册也一起封装进去 + // this.context.resourceDir 的值是 '/data/storage/el1/bundle/entry/resources/resfile' + // 把字体路径告知 C 层需要实现 HippyAPIProvider 的 getCustomFontPathMap 方法。 }); } diff --git a/framework/examples/ohos-demo/src/main/ets/fonts/TTTGB.otf b/framework/examples/ohos-demo/src/main/ets/fonts/TTTGB.otf deleted file mode 100644 index 97ba4cd2200..00000000000 --- a/framework/examples/ohos-demo/src/main/ets/fonts/TTTGB.otf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6dff84548a2bb4ad7ba30e46e86f2f02bcf896e367b38080b3ae46836ed81be0 -size 2144772 diff --git a/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleAPIProvider.ets b/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleAPIProvider.ets index b41e9911a9f..86c9f759679 100755 --- a/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleAPIProvider.ets +++ b/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleAPIProvider.ets @@ -59,10 +59,8 @@ export class ExampleAPIProvider implements HippyAPIProvider { return null } + // 注册字体路径至hippy测量函数 getCustomFontPathMap(): Map | null { - // 注册字体路径至hippy测量函数 - // map.set("MyTestFont", "test/testA/font.ttf"); - let map = new Map(); // 暂时hardcode路径在此,生产环境应通过Context属性获取字体文件路径 map.set("TTTGB", "/data/storage/el1/bundle/entry/resources/resfile/fonts/TTTGB.otf"); diff --git a/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleViewA.ets b/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleViewA.ets index e42951639ef..b162480c6e2 100644 --- a/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleViewA.ets +++ b/framework/examples/ohos-demo/src/main/ets/hippy_extend/ExampleViewA.ets @@ -35,11 +35,26 @@ export class ExampleViewA extends HippyCustomComponentView { } setProp(propKey: string, propValue: HippyAny): boolean { + if (propKey == "prop1") { + // ... + return true + } else if (propKey == "prop2") { + // ... + return true + } return super.setProp(propKey, propValue) } call(method: string, params: Array, callback: HippyRenderCallback | null): void { - + if (method == "selectItem") { + // ... + } else if (method == "getData") { + // ... + // 如果需要返回值,返回值举例 + if (callback) { + callback("result") + } + } } } diff --git a/framework/examples/ohos-demo/src/main/resources/rawfile/fonts/TTTGB.otf b/framework/examples/ohos-demo/src/main/resources/rawfile/fonts/TTTGB.otf deleted file mode 100644 index 97ba4cd2200..00000000000 --- a/framework/examples/ohos-demo/src/main/resources/rawfile/fonts/TTTGB.otf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6dff84548a2bb4ad7ba30e46e86f2f02bcf896e367b38080b3ae46836ed81be0 -size 2144772 diff --git a/framework/ohos/README.md b/framework/ohos/README.md index af6d396fb4f..5e715433dd8 100644 --- a/framework/ohos/README.md +++ b/framework/ohos/README.md @@ -52,8 +52,8 @@ Install latest DevEco Studio. }) ``` - > More details for [ohos SDK integration](https://github.com/sohotz/Hippy/blob/main/docs/development/native-integration.md). + > More details for [ohos SDK integration](https://github.com/Tencent/Hippy/blob/main/docs/development/native-integration.md). ## 📁 Documentation -To check out [hippy examples](https://github.com/sohotz/Hippy/tree/main/framework/examples/ohos-har-demo) and visit [openhippy.com](https://openhippy.com). +To check out [hippy examples](https://github.com/Tencent/Hippy/tree/main/framework/examples/ohos-har-demo) and visit [openhippy.com](https://openhippy.com). diff --git a/framework/ohos/oh-package.json5 b/framework/ohos/oh-package.json5 index 580a88b7207..3a9171e6fda 100644 --- a/framework/ohos/oh-package.json5 +++ b/framework/ohos/oh-package.json5 @@ -3,10 +3,10 @@ "author": "Tencent", "name": "hippy", "description": "Hippy is a cross-platform development framework.", - "repository": "https://github.com/sohotz/Hippy.git", + "repository": "https://github.com/Tencent/Hippy.git", "homepage": "https://openhippy.com/", "keywords": ["hippy", "cross-platform"], - "version": "1.3.0", + "version": "3.3.0", "dependencies": {}, "devDependencies": {}, } diff --git a/framework/ohos/src/main/cpp/impl/connector/src/dom_manager_napi.cc b/framework/ohos/src/main/cpp/impl/connector/src/dom_manager_napi.cc index 66f74260f9d..03e09c2c71e 100644 --- a/framework/ohos/src/main/cpp/impl/connector/src/dom_manager_napi.cc +++ b/framework/ohos/src/main/cpp/impl/connector/src/dom_manager_napi.cc @@ -119,15 +119,21 @@ static napi_value DestroyDomManager(napi_env env, napi_callback_info info) { static napi_value CreateRoot(napi_env env, napi_callback_info info) { ArkTS arkTs(env); - auto args = arkTs.GetCallbackArgs(info, 2); + auto args = arkTs.GetCallbackArgs(info); uint32_t root_id = static_cast(arkTs.GetInteger(args[0])); double density = arkTs.GetDouble(args[1]); - auto root_node = std::make_shared(root_id); - auto layout = root_node->GetLayoutNode(); - layout->SetScaleFactor(static_cast(density)); + uint32_t layout_engine_type = static_cast(arkTs.GetInteger(args[2])); + + std::shared_ptr saved_root_node; auto& persistent_map = RootNode::PersistentMap(); - auto flag = persistent_map.Insert(root_id, root_node); - FOOTSTONE_DCHECK(flag); + if (!persistent_map.Find(root_id, saved_root_node)) { + auto root_node = std::make_shared(root_id, (LayoutEngineType)layout_engine_type); + auto layout = root_node->GetLayoutNode(); + layout->SetScaleFactor(static_cast(density)); + auto flag = persistent_map.Insert(root_id, root_node); + FOOTSTONE_DCHECK(flag); + } + return arkTs.GetUndefined(); } @@ -136,8 +142,7 @@ static napi_value DestroyRoot(napi_env env, napi_callback_info info) { auto args = arkTs.GetCallbackArgs(info, 1); uint32_t root_id = static_cast(arkTs.GetInteger(args[0])); auto& persistent_map = RootNode::PersistentMap(); - auto flag = persistent_map.Erase(root_id); - FOOTSTONE_DCHECK(flag); + persistent_map.Erase(root_id); return arkTs.GetUndefined(); } diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/CMakeLists.txt b/framework/ohos/src/main/cpp/impl/renderer/native/CMakeLists.txt index 3e69a4473c5..ae6e646732f 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/CMakeLists.txt +++ b/framework/ohos/src/main/cpp/impl/renderer/native/CMakeLists.txt @@ -130,6 +130,7 @@ set(PUBLIC_SOURCE_SET src/native_render_provider_capi.cc src/native_render_provider_napi.cc src/api/hippy_view_provider.cc + src/api_c/hippy.cc ) target_sources(${PROJECT_NAME} PRIVATE ${SOURCE_SET} PUBLIC ${PUBLIC_SOURCE_SET}) # endregion diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/api_c/hippy.h b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/api_c/hippy.h new file mode 100644 index 00000000000..0796aeb598a --- /dev/null +++ b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/api_c/hippy.h @@ -0,0 +1,41 @@ +/* + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#if defined(__cplusplus) +#define HIPPY_EXTERN extern "C" __attribute__((visibility("default"))) +#else +#define HIPPY_EXTERN extern __attribute__((visibility("default"))) +#endif + +typedef enum HippyLayoutEngineType { + HippyLayoutEngineDefault = 0, + HippyLayoutEngineTaitank, + HippyLayoutEngineYoga +} HippyLayoutEngineType; + +HIPPY_EXTERN uint32_t HippyViewProvider_CreateRoot(uint32_t first_dom_manager_id, HippyLayoutEngineType layout_engine_type = HippyLayoutEngineDefault); +HIPPY_EXTERN void HippyViewProvider_DestroyRoot(uint32_t render_manager_id, uint32_t root_id); +HIPPY_EXTERN void HippyViewProvider_BindNativeRoot(void *parent_node_handle, uint32_t render_manager_id, uint32_t root_id); +HIPPY_EXTERN void HippyViewProvider_UnbindNativeRoot(uint32_t render_manager_id, uint32_t root_id); +HIPPY_EXTERN void HippyViewProvider_UpdateRootSize(uint32_t render_manager_id, uint32_t root_id, float width, float height); diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_impl.h b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_impl.h index c78845c3d3c..7feba773a0b 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_impl.h +++ b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_impl.h @@ -45,6 +45,10 @@ class NativeRenderImpl : public NativeRender { void BindNativeRoot(ArkUI_NodeContentHandle contentHandle, uint32_t root_id, uint32_t node_id); void UnbindNativeRoot(uint32_t root_id, uint32_t node_id); + + void BindNativeRootToParent(ArkUI_NodeHandle parentNodeHandle, uint32_t root_id, uint32_t node_id); + void UnbindNativeRootFromParent(uint32_t root_id, uint32_t node_id); + void RegisterCustomTsRenderViews(napi_env ts_env, napi_ref ts_render_provider_ref, std::set &custom_views, std::map &mapping_views); void DestroyRoot(uint32_t root_id); diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_manager.h b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_manager.h index 3cd05213aad..4e938de7400 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_manager.h +++ b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_manager.h @@ -109,6 +109,9 @@ class NativeRenderManager : public RenderManager, public std::enable_shared_from void BindNativeRoot(ArkUI_NodeContentHandle contentHandle, uint32_t root_id, uint32_t node_id); void UnbindNativeRoot(uint32_t root_id, uint32_t node_id); + void BindNativeRootToParent(ArkUI_NodeHandle parentNodeHandle, uint32_t root_id, uint32_t node_id); + void UnbindNativeRootFromParent(uint32_t root_id, uint32_t node_id); + void DestroyRoot(uint32_t root_id); void DoCallbackForCallCustomTsView(uint32_t root_id, uint32_t node_id, uint32_t callback_id, const HippyValue &result); diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_provider.h b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_provider.h index 450711ae971..23e211c6990 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_provider.h +++ b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/native_render_provider.h @@ -47,6 +47,10 @@ class NativeRenderProvider : public std::enable_shared_from_this &custom_views, std::map &mapping_views); void DestroyRoot(uint32_t root_id); diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/uimanager/hr_view_manager.h b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/uimanager/hr_view_manager.h index 6e4e4dbaf66..40b67d4dbc9 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/uimanager/hr_view_manager.h +++ b/framework/ohos/src/main/cpp/impl/renderer/native/include/renderer/uimanager/hr_view_manager.h @@ -23,6 +23,7 @@ #pragma once #include +#include #include #include #include @@ -53,6 +54,9 @@ class HRViewManager { void BindNativeRoot(ArkUI_NodeContentHandle contentHandle, uint32_t node_id); void UnbindNativeRoot(uint32_t node_id); + + void BindNativeRootToParent(ArkUI_NodeHandle parentNodeHandle, uint32_t node_id); + void UnbindNativeRootFromParent(uint32_t node_id); int GetRootTag() { return (int)root_id_; @@ -127,6 +131,7 @@ class HRViewManager { std::shared_ptr ctx_; uint32_t root_id_; std::unordered_map nodeContentMap_; + std::unordered_map parentNodeMap_; std::shared_ptr root_view_; std::map> view_registry_; diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/src/api_c/hippy.cc b/framework/ohos/src/main/cpp/impl/renderer/native/src/api_c/hippy.cc new file mode 100644 index 00000000000..1e4921e29dd --- /dev/null +++ b/framework/ohos/src/main/cpp/impl/renderer/native/src/api_c/hippy.cc @@ -0,0 +1,155 @@ +/* + * + * Tencent is pleased to support the open source community by making + * Hippy available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "renderer/api_c/hippy.h" +#include "oh_napi/data_holder.h" +#include "renderer/native_render_manager.h" +#include "renderer/utils/hr_pixel_utils.h" + +#define ROOT_VIEW_ID_INCREMENT 10 + +static uint32_t sHippyRootIdCounter = 0; + +using namespace hippy; + +static hippy::LayoutEngineType HippyLayoutEngineTypeToInnerType(HippyLayoutEngineType layout_engine_type) { + switch (layout_engine_type) { + case HippyLayoutEngineTaitank: + return hippy::LayoutEngineTaitank; + case HippyLayoutEngineYoga: + return hippy::LayoutEngineYoga; + case HippyLayoutEngineDefault: + return hippy::LayoutEngineDefault; + } + return hippy::LayoutEngineDefault; +} + +uint32_t HippyViewProvider_CreateRoot(uint32_t first_dom_manager_id, HippyLayoutEngineType layout_engine_type) { + sHippyRootIdCounter += ROOT_VIEW_ID_INCREMENT; + uint32_t root_id = sHippyRootIdCounter; + double density = HRPixelUtils::GetDensity(); + hippy::LayoutEngineType layout_type = HippyLayoutEngineTypeToInnerType(layout_engine_type); + + std::shared_ptr saved_root_node; + auto& persistent_map = RootNode::PersistentMap(); + if (!persistent_map.Find(root_id, saved_root_node)) { + auto root_node = std::make_shared(root_id, layout_type); + auto layout = root_node->GetLayoutNode(); + layout->SetScaleFactor(static_cast(density)); + auto flag = persistent_map.Insert(root_id, root_node); + FOOTSTONE_DCHECK(flag); + } + + std::shared_ptr root_node; + auto flag = persistent_map.Find(root_id, root_node); + FOOTSTONE_CHECK(flag); + + if (root_node->GetDomManager().lock()) { + return root_id; + } + + uint32_t next_id = GlobalGetNextDomManagerId(first_dom_manager_id); + + std::any dom_manager; + flag = hippy::global_data_holder.Find(next_id, dom_manager); + FOOTSTONE_CHECK(flag); + auto dom_manager_object = std::any_cast>(dom_manager); + + root_node->SetDomManager(dom_manager_object); + return root_id; +} + +void HippyViewProvider_DestroyRoot(uint32_t render_manager_id, uint32_t root_id) { + auto& persistent_map = RootNode::PersistentMap(); + std::shared_ptr root_node; + auto flag = persistent_map.Find(root_id, root_node); + FOOTSTONE_CHECK(flag); + root_node->ReleaseResources(); + persistent_map.Erase(root_id); + + auto &map = NativeRenderManager::PersistentMap(); + std::shared_ptr render_manager; + bool ret = map.Find(render_manager_id, render_manager); + if (!ret) { + FOOTSTONE_DLOG(WARNING) << "DestroyRoot: render_manager_id invalid"; + return; + } + + render_manager->DestroyRoot(root_id); +} + +void HippyViewProvider_BindNativeRoot(void *parent_node_handle, uint32_t render_manager_id, uint32_t root_id) { + auto &map = NativeRenderManager::PersistentMap(); + std::shared_ptr render_manager; + bool ret = map.Find(render_manager_id, render_manager); + if (!ret) { + FOOTSTONE_DLOG(WARNING) << "BindRoot: render_manager_id invalid"; + return; + } + + render_manager->BindNativeRootToParent((ArkUI_NodeHandle)parent_node_handle, root_id, 0); +} + +void HippyViewProvider_UnbindNativeRoot(uint32_t render_manager_id, uint32_t root_id) { + auto &map = NativeRenderManager::PersistentMap(); + std::shared_ptr render_manager; + bool ret = map.Find(render_manager_id, render_manager); + if (!ret) { + FOOTSTONE_DLOG(WARNING) << "UnbindRoot: render_manager_id invalid"; + return; + } + + render_manager->UnbindNativeRootFromParent(root_id, 0); +} + +void HippyViewProvider_UpdateRootSize(uint32_t render_manager_id, uint32_t root_id, float width, float height) { + auto &map = NativeRenderManager::PersistentMap(); + std::shared_ptr render_manager; + bool ret = map.Find(render_manager_id, render_manager); + if (!ret) { + FOOTSTONE_DLOG(WARNING) << "UpdateRootSize render_manager_id invalid"; + return; + } + + auto &root_map = RootNode::PersistentMap(); + std::shared_ptr root_node; + ret = root_map.Find(root_id, root_node); + if (!ret) { + FOOTSTONE_DLOG(WARNING) << "UpdateRootSize root_node is nullptr"; + return; + } + + std::shared_ptr dom_manager = root_node->GetDomManager().lock(); + if (dom_manager == nullptr) { + FOOTSTONE_DLOG(WARNING) << "UpdateRootSize dom_manager is nullptr"; + return; + } + + std::vector> ops; + ops.emplace_back([dom_manager, root_node, width, height] { + FOOTSTONE_LOG(INFO) << "update root size width = " << width << ", height = " << height << std::endl; + dom_manager->SetRootSize(root_node, width, height); + dom_manager->DoLayout(root_node); + dom_manager->EndBatch(root_node); + }); + dom_manager->PostTask(Scene(std::move(ops))); +} diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_impl.cc b/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_impl.cc index 384298888d7..22fa4131821 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_impl.cc +++ b/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_impl.cc @@ -59,6 +59,24 @@ void NativeRenderImpl::UnbindNativeRoot(uint32_t root_id, uint32_t node_id) { view_manager->UnbindNativeRoot(node_id); } +void NativeRenderImpl::BindNativeRootToParent(ArkUI_NodeHandle parentNodeHandle, uint32_t root_id, uint32_t node_id) { + auto view_manager = hr_manager_->GetViewManager(root_id); + if (!view_manager) { + return; + } + + view_manager->BindNativeRootToParent(parentNodeHandle, node_id); +} + +void NativeRenderImpl::UnbindNativeRootFromParent(uint32_t root_id, uint32_t node_id) { + auto view_manager = hr_manager_->GetViewManager(root_id); + if (!view_manager) { + return; + } + + view_manager->UnbindNativeRootFromParent(node_id); +} + void NativeRenderImpl::RegisterCustomTsRenderViews(napi_env ts_env, napi_ref ts_render_provider_ref, std::set &custom_views, std::map &mapping_views) { hr_manager_->RegisterCustomTsRenderViews(ts_env, ts_render_provider_ref, custom_views, mapping_views); } diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_manager.cc b/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_manager.cc index b8b8fdd4073..e295dbdf2b6 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_manager.cc +++ b/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_manager.cc @@ -1426,6 +1426,18 @@ void NativeRenderManager::UnbindNativeRoot(uint32_t root_id, uint32_t node_id) { } } +void NativeRenderManager::BindNativeRootToParent(ArkUI_NodeHandle parentNodeHandle, uint32_t root_id, uint32_t node_id) { + if (enable_ark_c_api_) { + c_render_provider_->BindNativeRootToParent(parentNodeHandle, root_id, node_id); + } +} + +void NativeRenderManager::UnbindNativeRootFromParent(uint32_t root_id, uint32_t node_id) { + if (enable_ark_c_api_) { + c_render_provider_->UnbindNativeRootFromParent(root_id, node_id); + } +} + void NativeRenderManager::DestroyRoot(uint32_t root_id) { if (enable_ark_c_api_) { c_render_provider_->DestroyRoot(root_id); diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_provider.cc b/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_provider.cc index a5ff443d69b..125f1335ba0 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_provider.cc +++ b/framework/ohos/src/main/cpp/impl/renderer/native/src/native_render_provider.cc @@ -48,6 +48,14 @@ void NativeRenderProvider::UnbindNativeRoot(uint32_t root_id, uint32_t node_id) render_impl_->UnbindNativeRoot(root_id, node_id); } +void NativeRenderProvider::BindNativeRootToParent(ArkUI_NodeHandle parentNodeHandle, uint32_t root_id, uint32_t node_id) { + render_impl_->BindNativeRootToParent(parentNodeHandle, root_id, node_id); +} + +void NativeRenderProvider::UnbindNativeRootFromParent(uint32_t root_id, uint32_t node_id) { + render_impl_->UnbindNativeRootFromParent(root_id, node_id); +} + void NativeRenderProvider::RegisterCustomTsRenderViews(napi_env ts_env, napi_ref ts_render_provider_ref, std::set &custom_views, std::map &mapping_views) { render_impl_->RegisterCustomTsRenderViews(ts_env_, ts_render_provider_ref, custom_views, mapping_views); } diff --git a/framework/ohos/src/main/cpp/impl/renderer/native/src/uimanager/hr_view_manager.cc b/framework/ohos/src/main/cpp/impl/renderer/native/src/uimanager/hr_view_manager.cc index 764881555e8..68285998585 100644 --- a/framework/ohos/src/main/cpp/impl/renderer/native/src/uimanager/hr_view_manager.cc +++ b/framework/ohos/src/main/cpp/impl/renderer/native/src/uimanager/hr_view_manager.cc @@ -27,6 +27,7 @@ #include "oh_napi/oh_napi_object_builder.h" #include "oh_napi/oh_napi_utils.h" #include "renderer/api/hippy_view_provider.h" +#include "renderer/arkui/native_node_api.h" #include "renderer/components/custom_ts_view.h" #include "renderer/components/custom_view.h" #include "renderer/components/hippy_render_view_creator.h" @@ -101,6 +102,45 @@ void HRViewManager::UnbindNativeRoot(uint32_t node_id) { nodeContentMap_.erase(current_id); } +void HRViewManager::BindNativeRootToParent(ArkUI_NodeHandle parentNodeHandle, uint32_t node_id) { + bool isRoot = (node_id == 0); + uint32_t current_id = isRoot ? root_id_ : node_id; + ArkUI_NodeHandle savedHandle = nullptr; + auto it = parentNodeMap_.find(current_id); + if (it != parentNodeMap_.end()) { + savedHandle = it->second; + } + if (parentNodeHandle == savedHandle) { + return; + } + + auto viewIt = view_registry_.find(current_id); + if (viewIt == view_registry_.end()) { + return; + } + auto view = viewIt->second; + + parentNodeMap_[current_id] = parentNodeHandle; + NativeNodeApi::GetInstance()->addChild(parentNodeHandle, view->GetLocalRootArkUINode()->GetArkUINodeHandle()); +} + +void HRViewManager::UnbindNativeRootFromParent(uint32_t node_id) { + bool isRoot = (node_id == 0); + uint32_t current_id = isRoot ? root_id_ : node_id; + auto it = parentNodeMap_.find(current_id); + if (it == parentNodeMap_.end()) { + return; + } + ArkUI_NodeHandle savedHandle = it->second; + auto viewIt = view_registry_.find(current_id); + if (viewIt == view_registry_.end()) { + return; + } + auto view = viewIt->second; + NativeNodeApi::GetInstance()->removeChild(savedHandle, view->GetLocalRootArkUINode()->GetArkUINodeHandle()); + parentNodeMap_.erase(current_id); +} + void HRViewManager::reportFirstViewAdd() { isFirstViewAdd = true; ArkTS arkTs(ts_env_); diff --git a/framework/ohos/src/main/ets/hippy_framework/HippyEngine.ets b/framework/ohos/src/main/ets/hippy_framework/HippyEngine.ets index 4ec64dc6bca..d7a059208af 100644 --- a/framework/ohos/src/main/ets/hippy_framework/HippyEngine.ets +++ b/framework/ohos/src/main/ets/hippy_framework/HippyEngine.ets @@ -224,6 +224,12 @@ export class EngineInitParams { } } +export enum HippyLayoutEngineType { + Default = 0, + Taitank = 1, + Yoga = 2 +} + // Hippy 业务模块jsbundle加载时的参数设置 export class ModuleLoadParams { // 必须参数 @@ -248,6 +254,8 @@ export class ModuleLoadParams { public wrappedCustomRenderViewBuilder: WrappedHippyCustomRenderViewBuilder | null = null; + public layoutEngineType: HippyLayoutEngineType = HippyLayoutEngineType.Default + public constructor( jsAssetsPath = '', jsFilePath = '', diff --git a/framework/ohos/src/main/ets/hippy_framework/HippyEngineContextImpl.ets b/framework/ohos/src/main/ets/hippy_framework/HippyEngineContextImpl.ets index f5622c35575..5f217725ca8 100644 --- a/framework/ohos/src/main/ets/hippy_framework/HippyEngineContextImpl.ets +++ b/framework/ohos/src/main/ets/hippy_framework/HippyEngineContextImpl.ets @@ -10,7 +10,7 @@ import { HippyBridgeManagerImpl } from './bridge/HippyBridgeManagerImpl'; import { DomManager } from './connector/DomManager'; import { JsDriver } from './connector/JsDriver'; import { NativeRenderer } from './connector/NativeRenderer'; -import { EngineInitParams, ModuleLoadParams } from './HippyEngine'; +import { EngineInitParams, HippyLayoutEngineType, ModuleLoadParams } from './HippyEngine'; import { HippyEngineContext } from './HippyEngineContext'; import { HippyGlobalConfigs } from './HippyGlobalConfigs'; import { HippyModuleManagerImpl, HippyNativeModuleCreator } from './modules/HippyModuleManagerImpl'; @@ -225,7 +225,7 @@ export class HippyEngineContextImpl implements HippyEngineContext { attachRootView(rootView: HippyRootView) { if (this.mJsDriver && this.nativeRenderer) { - this.attachDomToRootView(rootView.getRootId()) + this.attachDomToRootView(rootView.getRootId(), rootView.getLayoutEngineType()) this.attachJsToRootView(rootView.getRootId()) if (this.mDevtoolsManager != null) { this.mDevtoolsManager.attachToRoot(rootView.getRootId()); @@ -235,15 +235,16 @@ export class HippyEngineContextImpl implements HippyEngineContext { } createRootView(loadParams: ModuleLoadParams) { - const rootView = this.nativeRenderProvider!.getNativeRenderImpl().createRootView(loadParams.componentName, {}, loadParams.wrappedCustomRenderViewBuilder) + const rootView = this.nativeRenderProvider!.getNativeRenderImpl().createRootView(loadParams.componentName, {}, + loadParams.wrappedCustomRenderViewBuilder, loadParams.layoutEngineType) if (rootView != null) { this.attachRootView(rootView); } return rootView; } - attachDomToRootView(rootId: number): void { - this.mDomManager.createRootNode(rootId, PixelUtil.getDensity()) + attachDomToRootView(rootId: number, layoutEngineType: HippyLayoutEngineType): void { + this.mDomManager.createRootNode(rootId, PixelUtil.getDensity(), layoutEngineType) this.mDomManager.attachToRoot(rootId) } diff --git a/framework/ohos/src/main/ets/hippy_framework/connector/DomManager.ets b/framework/ohos/src/main/ets/hippy_framework/connector/DomManager.ets index a3818ee6238..dbf8b84ae40 100644 --- a/framework/ohos/src/main/ets/hippy_framework/connector/DomManager.ets +++ b/framework/ohos/src/main/ets/hippy_framework/connector/DomManager.ets @@ -17,6 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { HippyLayoutEngineType } from '..'; import { HippyLibrary } from '../../hippy_library/HippyLibrary'; export class DomManager { @@ -50,9 +51,10 @@ export class DomManager { createRootNode( rootId: number, - density: number + density: number, + layoutEngineType: HippyLayoutEngineType ) { - this.libHippy?.DomManager_CreateRoot(rootId, density) + this.libHippy?.DomManager_CreateRoot(rootId, density, layoutEngineType) } destroyRootNode( diff --git a/framework/ohos/src/main/ets/hippy_framework/index.ets b/framework/ohos/src/main/ets/hippy_framework/index.ets index 353bfbc3144..ff732f21496 100644 --- a/framework/ohos/src/main/ets/hippy_framework/index.ets +++ b/framework/ohos/src/main/ets/hippy_framework/index.ets @@ -40,3 +40,4 @@ export * from "./adapter/thirdparty/HippyThirdPartyAdapter" export * from "./bridge/HippyAPIProvider" export * from "./modules/native" +export * from "./modules/HippyModuleManagerImpl" diff --git a/framework/ohos/src/main/ets/hippy_library/HippyLibrary.ets b/framework/ohos/src/main/ets/hippy_library/HippyLibrary.ets index 55800140009..e0035513eeb 100644 --- a/framework/ohos/src/main/ets/hippy_library/HippyLibrary.ets +++ b/framework/ohos/src/main/ets/hippy_library/HippyLibrary.ets @@ -29,6 +29,7 @@ import { FrameNode } from '@kit.ArkUI'; import { TurboModuleManager } from '../hippy_framework/modules/turbo/TurboModuleManager'; import { NodeContent } from '@ohos.arkui.node'; import { HRPosition, HRRect } from '../renderer_native/utils/HRTypes'; +import { HippyLayoutEngineType } from "../hippy_framework"; export interface HippyRenderViewInfo { tag: number @@ -47,7 +48,7 @@ export interface HippyLibrary { DomManager_SetRenderManager(instanceId: number, renderId: number): void; DomManager_CreateDomManager(domManagerNum: number): number; DomManager_DestroyDomManager(domManagerId: number): void; - DomManager_CreateRoot(rootId: number, density: number): void; + DomManager_CreateRoot(rootId: number, density: number, layoutEngineType: HippyLayoutEngineType): void; DomManager_DestroyRoot(rootId: number): void; DomManager_ReleaseRootResources(rootId: number): void; DomManager_SetDomManager(rootId: number, instanceId: number): void; diff --git a/framework/ohos/src/main/ets/renderer_native/HippyRootView.ets b/framework/ohos/src/main/ets/renderer_native/HippyRootView.ets index c67b36aa6b7..e70e38ea486 100644 --- a/framework/ohos/src/main/ets/renderer_native/HippyRootView.ets +++ b/framework/ohos/src/main/ets/renderer_native/HippyRootView.ets @@ -18,7 +18,7 @@ * limitations under the License. */ import window from '@ohos.window'; -import { HippyEngine } from '../hippy_framework'; +import { HippyEngine, HippyLayoutEngineType } from '../hippy_framework'; import { HippyException } from '../support/common/HippyException'; import { HippyRecord } from '../support/common/HippyTypes'; import { LogUtils } from '../support/utils/LogUtils'; @@ -33,6 +33,7 @@ import { NodeContent } from '@ohos.arkui.node'; export class HippyRootView { renderView: HippyRenderView | null = null + layoutEngineType: HippyLayoutEngineType = HippyLayoutEngineType.Default pagerName: string pagerData: HippyRecord rootSlot: NodeContent | null = null @@ -45,10 +46,12 @@ export class HippyRootView { customRenderViewCreatorMap: Map | null, nativeRender: NativeRender, wrappedCustomRenderViewBuilder: WrappedHippyCustomRenderViewBuilder | null, + layoutEngineType: HippyLayoutEngineType, pagerName: string, pagerData: HippyRecord, ) { this.ctx = new NativeRenderContext(instanceId, rootId, customRenderViewCreatorMap, nativeRender, wrappedCustomRenderViewBuilder) + this.layoutEngineType = layoutEngineType this.pagerName = pagerName this.pagerData = pagerData this.initRenderView() @@ -72,6 +75,10 @@ export class HippyRootView { this.rootSlot = rootSlot; } + getLayoutEngineType(): HippyLayoutEngineType { + return this.layoutEngineType + } + onViewSizeChanged(size: HRSize, force = false) { if (!force && this.renderViewSize.width == size.width && this.renderViewSize.height == size.height) { return diff --git a/framework/ohos/src/main/ets/renderer_native/NativeRender.ets b/framework/ohos/src/main/ets/renderer_native/NativeRender.ets index 1409e02db2b..0fe83ed4e5c 100644 --- a/framework/ohos/src/main/ets/renderer_native/NativeRender.ets +++ b/framework/ohos/src/main/ets/renderer_native/NativeRender.ets @@ -18,6 +18,7 @@ * limitations under the License. */ import { HippyRootView } from '.'; +import { HippyLayoutEngineType } from '../hippy_framework'; import { CallResultCallback, EventListenerCallback, HippyRenderViewInfo } from '../hippy_library/HippyLibrary'; @@ -38,7 +39,9 @@ import { HippyEndBatchCallback } from './uimanager/HRViewManager'; import { HRPosition, HRRect } from './utils/HRTypes'; export interface NativeRender { - createRootView(pageName: string, pageData: HippyRecord, wrappedCustomRenderViewBuilder: WrappedHippyCustomRenderViewBuilder | null): HippyRootView + createRootView(pageName: string, pageData: HippyRecord, + wrappedCustomRenderViewBuilder: WrappedHippyCustomRenderViewBuilder | null, + layoutEngineType: HippyLayoutEngineType): HippyRootView destroyRoot(rootId: number): void diff --git a/framework/ohos/src/main/ets/renderer_native/NativeRenderImpl.ets b/framework/ohos/src/main/ets/renderer_native/NativeRenderImpl.ets index c9906b31ac5..46366ceceea 100644 --- a/framework/ohos/src/main/ets/renderer_native/NativeRenderImpl.ets +++ b/framework/ohos/src/main/ets/renderer_native/NativeRenderImpl.ets @@ -73,6 +73,7 @@ import { import { HippyRootViewManager } from './HippyRootViewManager' import { WrappedHippyBizViewBuilder } from './HippyBizViewBuilder' import { PixelUtil } from "../support/utils/PixelUtil" +import { HippyLayoutEngineType } from "../hippy_framework" export class TextMeasurerConfig { textContent: string | null = null @@ -128,11 +129,11 @@ export class NativeRenderImpl implements NativeRender { this.frameworkProxy = proxy } - createRootView(pageName: string, pageData: HippyRecord, wrappedCustomRenderViewBuilder: WrappedHippyCustomRenderViewBuilder | null): HippyRootView { + createRootView(pageName: string, pageData: HippyRecord, wrappedCustomRenderViewBuilder: WrappedHippyCustomRenderViewBuilder | null, layoutEngineType: HippyLayoutEngineType): HippyRootView { NativeRenderImpl.sRootIdCounter += this.ROOT_VIEW_ID_INCREMENT let rootId = NativeRenderImpl.sRootIdCounter let rootView = new HippyRootView(this.instanceId, rootId, this.customRenderViewCreatorMap, this, - wrappedCustomRenderViewBuilder, pageName, pageData) + wrappedCustomRenderViewBuilder, layoutEngineType, pageName, pageData) HippyRootViewManager.addRootView(rootId, rootView) return rootView } diff --git a/framework/ohos/src/main/ets/renderer_native/index.ets b/framework/ohos/src/main/ets/renderer_native/index.ets index 81dee4e41a4..927a57f61f0 100644 --- a/framework/ohos/src/main/ets/renderer_native/index.ets +++ b/framework/ohos/src/main/ets/renderer_native/index.ets @@ -26,5 +26,6 @@ export * from "./NativeRenderContext" export * from "./components/base/HippyRenderBaseView" export * from "./components/custom/HippyCustomComponentView" +export * from "./components/HippyRenderRegisterMap" export * from "./dom_node/HRNodeProps" diff --git a/hippy.podspec b/hippy.podspec index 7d762dfca41..3c035add8a5 100644 --- a/hippy.podspec +++ b/hippy.podspec @@ -265,6 +265,7 @@ Pod::Spec.new do |s| 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17', 'GCC_ENABLE_CPP_EXCEPTIONS' => false, 'GCC_ENABLE_CPP_RTTI' => false, + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) LAYOUT_ENGINE_TAITANK=1', } taitank.libraries = 'c++' puts 'hippy subspec \'Taitank\' read end' @@ -278,6 +279,7 @@ Pod::Spec.new do |s| 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17', 'GCC_ENABLE_CPP_EXCEPTIONS' => false, 'GCC_ENABLE_CPP_RTTI' => false, + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) LAYOUT_ENGINE_YOGA=1', } yoga.libraries = 'c++' puts 'hippy subspec \'yoga\' read end'