@quicktvui/ai 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rules/.clinerules +16 -1
- package/rules/.cursorrules +16 -1
- package/rules/.github/copilot-instructions.md +16 -1
- package/rules/.source/ESADPlayer/package.json +24 -0
- package/rules/.source/ESADPlayer/rollup.config.js +33 -0
- package/rules/.source/ESADPlayer/src/component/ESADPlayerViewComponent.ts +466 -0
- package/rules/.source/ESADPlayer/src/core/ESADType.ts +6 -0
- package/rules/.source/ESADPlayer/src/index.ts +18 -0
- package/rules/.source/ESADPlayer/src/index.vue +963 -0
- package/rules/.source/ESADPlayer/src/typings/shims-vue.d.ts +6 -0
- package/rules/.source/ESADPlayer/tsconfig.json +34 -0
- package/rules/.source/ESAudioPlayer/package.json +23 -0
- package/rules/.source/ESAudioPlayer/rollup.config.js +33 -0
- package/rules/.source/ESAudioPlayer/src/index.ts +10 -0
- package/rules/.source/ESAudioPlayer/src/index.vue +1441 -0
- package/rules/.source/ESAudioPlayer/src/module/ESAudioPlayer.ts +169 -0
- package/rules/.source/ESAudioPlayer/src/module/ESAudioPlayerModule.android.ts +134 -0
- package/rules/.source/ESAudioPlayer/src/module/ESAudioPlayerModule.harmony.ts +139 -0
- package/rules/.source/ESAudioPlayer/src/module/ESAudioPlayerModule.ts +44 -0
- package/rules/.source/ESAudioPlayer/src/typings/shims-vue.d.ts +6 -0
- package/rules/.source/ESAudioPlayer/src/utils/ESAudioPlayerDefinitionUtils.ts +36 -0
- package/rules/.source/ESAudioPlayer/tsconfig.json +34 -0
- package/rules/.source/ESAudioServicePlayer/package.json +23 -0
- package/rules/.source/ESAudioServicePlayer/rollup.config.js +33 -0
- package/rules/.source/ESAudioServicePlayer/src/index.ts +10 -0
- package/rules/.source/ESAudioServicePlayer/src/index.vue +1400 -0
- package/rules/.source/ESAudioServicePlayer/src/module/ESAudioServicePlayer.ts +189 -0
- package/rules/.source/ESAudioServicePlayer/src/module/ESAudioServicePlayerModule.android.ts +155 -0
- package/rules/.source/ESAudioServicePlayer/src/module/ESAudioServicePlayerModule.harmony.ts +163 -0
- package/rules/.source/ESAudioServicePlayer/src/module/ESAudioServicePlayerModule.ts +50 -0
- package/rules/.source/ESAudioServicePlayer/src/typings/shims-vue.d.ts +6 -0
- package/rules/.source/ESAudioServicePlayer/src/utils/ESAudioServicePlayerDefinitionUtils.ts +36 -0
- package/rules/.source/ESAudioServicePlayer/tsconfig.json +34 -0
- package/rules/.source/ESAxios/CHANGELOG.md +1072 -0
- package/rules/.source/ESAxios/LICENSE +7 -0
- package/rules/.source/ESAxios/MIGRATION_GUIDE.md +3 -0
- package/rules/.source/ESAxios/README.md +1673 -0
- package/rules/.source/ESAxios/index.d.cts +549 -0
- package/rules/.source/ESAxios/index.d.ts +766 -0
- package/rules/.source/ESAxios/index.js +43 -0
- package/rules/.source/ESAxios/lib/adapters/README.md +37 -0
- package/rules/.source/ESAxios/lib/adapters/adapters.js +80 -0
- package/rules/.source/ESAxios/lib/adapters/fetch.js +295 -0
- package/rules/.source/ESAxios/lib/axios.js +90 -0
- package/rules/.source/ESAxios/lib/cancel/CancelToken.js +135 -0
- package/rules/.source/ESAxios/lib/cancel/CanceledError.js +31 -0
- package/rules/.source/ESAxios/lib/cancel/isCancel.js +5 -0
- package/rules/.source/ESAxios/lib/core/Axios.js +292 -0
- package/rules/.source/ESAxios/lib/core/AxiosError.js +108 -0
- package/rules/.source/ESAxios/lib/core/AxiosHeaders.js +340 -0
- package/rules/.source/ESAxios/lib/core/InterceptorManager.js +71 -0
- package/rules/.source/ESAxios/lib/core/README.md +8 -0
- package/rules/.source/ESAxios/lib/core/buildFullPath.js +26 -0
- package/rules/.source/ESAxios/lib/core/dispatchRequest.js +81 -0
- package/rules/.source/ESAxios/lib/core/mergeConfig.js +112 -0
- package/rules/.source/ESAxios/lib/core/settle.js +31 -0
- package/rules/.source/ESAxios/lib/core/transformData.js +33 -0
- package/rules/.source/ESAxios/lib/defaults/index.js +182 -0
- package/rules/.source/ESAxios/lib/defaults/transitional.js +7 -0
- package/rules/.source/ESAxios/lib/env/README.md +3 -0
- package/rules/.source/ESAxios/lib/env/classes/FormData.js +2 -0
- package/rules/.source/ESAxios/lib/env/data.js +1 -0
- package/rules/.source/ESAxios/lib/helpers/AxiosTransformStream.js +160 -0
- package/rules/.source/ESAxios/lib/helpers/AxiosURLSearchParams.js +65 -0
- package/rules/.source/ESAxios/lib/helpers/HttpStatusCode.js +71 -0
- package/rules/.source/ESAxios/lib/helpers/README.md +7 -0
- package/rules/.source/ESAxios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
- package/rules/.source/ESAxios/lib/helpers/bind.js +7 -0
- package/rules/.source/ESAxios/lib/helpers/buildURL.js +69 -0
- package/rules/.source/ESAxios/lib/helpers/callbackify.js +18 -0
- package/rules/.source/ESAxios/lib/helpers/combineURLs.js +15 -0
- package/rules/.source/ESAxios/lib/helpers/composeSignals.js +61 -0
- package/rules/.source/ESAxios/lib/helpers/cookies.js +40 -0
- package/rules/.source/ESAxios/lib/helpers/deprecatedMethod.js +31 -0
- package/rules/.source/ESAxios/lib/helpers/formDataToJSON.js +95 -0
- package/rules/.source/ESAxios/lib/helpers/formDataToStream.js +122 -0
- package/rules/.source/ESAxios/lib/helpers/fromDataURI.js +62 -0
- package/rules/.source/ESAxios/lib/helpers/isAbsoluteURL.js +15 -0
- package/rules/.source/ESAxios/lib/helpers/isAxiosError.js +14 -0
- package/rules/.source/ESAxios/lib/helpers/isURLSameOrigin.js +17 -0
- package/rules/.source/ESAxios/lib/helpers/null.js +2 -0
- package/rules/.source/ESAxios/lib/helpers/parseHeaders.js +69 -0
- package/rules/.source/ESAxios/lib/helpers/parseProtocol.js +6 -0
- package/rules/.source/ESAxios/lib/helpers/progressEventReducer.js +51 -0
- package/rules/.source/ESAxios/lib/helpers/readBlob.js +15 -0
- package/rules/.source/ESAxios/lib/helpers/resolveConfig.js +83 -0
- package/rules/.source/ESAxios/lib/helpers/speedometer.js +55 -0
- package/rules/.source/ESAxios/lib/helpers/spread.js +28 -0
- package/rules/.source/ESAxios/lib/helpers/throttle.js +44 -0
- package/rules/.source/ESAxios/lib/helpers/toFormData.js +241 -0
- package/rules/.source/ESAxios/lib/helpers/toURLEncodedForm.js +25 -0
- package/rules/.source/ESAxios/lib/helpers/trackStream.js +89 -0
- package/rules/.source/ESAxios/lib/helpers/validator.js +120 -0
- package/rules/.source/ESAxios/lib/platform/browser/classes/Blob.js +3 -0
- package/rules/.source/ESAxios/lib/platform/browser/classes/FormData.js +3 -0
- package/rules/.source/ESAxios/lib/platform/browser/classes/URLSearchParams.js +6 -0
- package/rules/.source/ESAxios/lib/platform/browser/index.js +13 -0
- package/rules/.source/ESAxios/lib/platform/common/classes/FormData.js +142 -0
- package/rules/.source/ESAxios/lib/platform/common/index.js +7 -0
- package/rules/.source/ESAxios/lib/platform/common/utils.js +54 -0
- package/rules/.source/ESAxios/lib/platform/index.js +7 -0
- package/rules/.source/ESAxios/lib/platform/node/classes/FormData.js +3 -0
- package/rules/.source/ESAxios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/rules/.source/ESAxios/lib/platform/node/index.js +12 -0
- package/rules/.source/ESAxios/lib/utils.js +820 -0
- package/rules/.source/ESCore/CHANGELOG.md +7 -0
- package/rules/.source/ESCore/package.json +24 -0
- package/rules/.source/ESCore/rollup.config.js +28 -0
- package/rules/.source/ESCore/src/actionbar/ESActionBar.ts +48 -0
- package/rules/.source/ESCore/src/actionbar/ESActionBarModule.android.ts +29 -0
- package/rules/.source/ESCore/src/actionbar/ESActionBarModule.harmony.ts +31 -0
- package/rules/.source/ESCore/src/actionbar/ESActionBarModule.ts +9 -0
- package/rules/.source/ESCore/src/actionbar/index.ts +2 -0
- package/rules/.source/ESCore/src/app/ESAppInfo.ts +12 -0
- package/rules/.source/ESCore/src/app/ESAppInfoList.ts +9 -0
- package/rules/.source/ESCore/src/app/ESAppList.ts +64 -0
- package/rules/.source/ESCore/src/app/ESAppListModule.android.ts +55 -0
- package/rules/.source/ESCore/src/app/ESAppListModule.harmony.ts +57 -0
- package/rules/.source/ESCore/src/app/ESAppListModule.ts +15 -0
- package/rules/.source/ESCore/src/app/index.ts +4 -0
- package/rules/.source/ESCore/src/application/ESAppContext.ts +99 -0
- package/rules/.source/ESCore/src/application/ESAppKeyManager.android.ts +86 -0
- package/rules/.source/ESCore/src/application/ESAppKeyManager.harmony.ts +91 -0
- package/rules/.source/ESCore/src/application/ESAppKeyManager.ts +23 -0
- package/rules/.source/ESCore/src/application/ESAppLifecycleManager.android.ts +199 -0
- package/rules/.source/ESCore/src/application/ESAppLifecycleManager.harmony.ts +197 -0
- package/rules/.source/ESCore/src/application/ESAppLifecycleManager.ts +36 -0
- package/rules/.source/ESCore/src/application/ESAppModuleManager.ts +294 -0
- package/rules/.source/ESCore/src/application/ESAppParams.ts +14 -0
- package/rules/.source/ESCore/src/application/ESApplication.ts +169 -0
- package/rules/.source/ESCore/src/application/index.ts +38 -0
- package/rules/.source/ESCore/src/audio/ESAudio.ts +190 -0
- package/rules/.source/ESCore/src/audio/ESAudioContentType.ts +7 -0
- package/rules/.source/ESCore/src/audio/ESAudioDirection.ts +5 -0
- package/rules/.source/ESCore/src/audio/ESAudioDurationHint.ts +7 -0
- package/rules/.source/ESCore/src/audio/ESAudioManagerFlag.ts +14 -0
- package/rules/.source/ESCore/src/audio/ESAudioModule.android.ts +173 -0
- package/rules/.source/ESCore/src/audio/ESAudioModule.harmony.ts +152 -0
- package/rules/.source/ESCore/src/audio/ESAudioModule.ts +63 -0
- package/rules/.source/ESCore/src/audio/ESAudioStreamType.ts +15 -0
- package/rules/.source/ESCore/src/audio/ESAudioUsage.ts +20 -0
- package/rules/.source/ESCore/src/audio/index.ts +9 -0
- package/rules/.source/ESCore/src/brightness/ESBrightness.ts +69 -0
- package/rules/.source/ESCore/src/brightness/ESBrightnessModule.android.ts +73 -0
- package/rules/.source/ESCore/src/brightness/ESBrightnessModule.harmony.ts +59 -0
- package/rules/.source/ESCore/src/brightness/ESBrightnessModule.ts +15 -0
- package/rules/.source/ESCore/src/brightness/index.ts +2 -0
- package/rules/.source/ESCore/src/broadcast/ESBroadcast.ts +107 -0
- package/rules/.source/ESCore/src/broadcast/ESBroadcastModule.android.ts +42 -0
- package/rules/.source/ESCore/src/broadcast/ESBroadcastModule.harmony.ts +45 -0
- package/rules/.source/ESCore/src/broadcast/ESBroadcastModule.ts +10 -0
- package/rules/.source/ESCore/src/broadcast/ESBroadcastReceiver.ts +5 -0
- package/rules/.source/ESCore/src/broadcast/ESIntent.ts +6 -0
- package/rules/.source/ESCore/src/broadcast/ESIntentDataAuthority.ts +4 -0
- package/rules/.source/ESCore/src/broadcast/ESIntentDataPath.ts +4 -0
- package/rules/.source/ESCore/src/broadcast/ESIntentDataSchemeSpecificPart.ts +4 -0
- package/rules/.source/ESCore/src/broadcast/ESIntentFilter.ts +13 -0
- package/rules/.source/ESCore/src/broadcast/index.ts +8 -0
- package/rules/.source/ESCore/src/core/IESComponent.ts +1 -0
- package/rules/.source/ESCore/src/core/IESManager.ts +7 -0
- package/rules/.source/ESCore/src/core/IESModule.ts +13 -0
- package/rules/.source/ESCore/src/core/NeedToTyped.ts +1 -0
- package/rules/.source/ESCore/src/core/index.ts +4 -0
- package/rules/.source/ESCore/src/database/ESDatabase.ts +63 -0
- package/rules/.source/ESCore/src/database/ESDatabaseModule.android.ts +49 -0
- package/rules/.source/ESCore/src/database/ESDatabaseModule.harmony.ts +46 -0
- package/rules/.source/ESCore/src/database/ESDatabaseModule.ts +23 -0
- package/rules/.source/ESCore/src/database/index.ts +2 -0
- package/rules/.source/ESCore/src/develop/ESDevelop.ts +75 -0
- package/rules/.source/ESCore/src/develop/ESDevelopInfo.ts +9 -0
- package/rules/.source/ESCore/src/develop/ESDevelopModule.android.ts +50 -0
- package/rules/.source/ESCore/src/develop/ESDevelopModule.harmony.ts +52 -0
- package/rules/.source/ESCore/src/develop/ESDevelopModule.ts +14 -0
- package/rules/.source/ESCore/src/develop/index.ts +3 -0
- package/rules/.source/ESCore/src/device/ESDevice.ts +289 -0
- package/rules/.source/ESCore/src/device/ESDeviceInfo.ts +51 -0
- package/rules/.source/ESCore/src/device/ESDeviceModule.android.ts +143 -0
- package/rules/.source/ESCore/src/device/ESDeviceModule.harmony.ts +116 -0
- package/rules/.source/ESCore/src/device/ESDeviceModule.ts +42 -0
- package/rules/.source/ESCore/src/device/index.ts +3 -0
- package/rules/.source/ESCore/src/display/ESDisplay.ts +61 -0
- package/rules/.source/ESCore/src/display/index.ts +2 -0
- package/rules/.source/ESCore/src/download/ESDownload.ts +181 -0
- package/rules/.source/ESCore/src/download/ESDownloadInfo.ts +14 -0
- package/rules/.source/ESCore/src/download/ESDownloadListener.ts +21 -0
- package/rules/.source/ESCore/src/download/ESDownloadModule.android.ts +57 -0
- package/rules/.source/ESCore/src/download/ESDownloadModule.harmony.ts +66 -0
- package/rules/.source/ESCore/src/download/ESDownloadModule.ts +21 -0
- package/rules/.source/ESCore/src/download/ESDownloadParams.ts +4 -0
- package/rules/.source/ESCore/src/download/ESDownloadState.ts +9 -0
- package/rules/.source/ESCore/src/download/ESDownloadStatus.ts +11 -0
- package/rules/.source/ESCore/src/download/index.ts +7 -0
- package/rules/.source/ESCore/src/error/ESError.ts +88 -0
- package/rules/.source/ESCore/src/error/ESErrorListener.ts +9 -0
- package/rules/.source/ESCore/src/error/ErrorOptions.ts +16 -0
- package/rules/.source/ESCore/src/error/index.ts +2 -0
- package/rules/.source/ESCore/src/es/ES.ts +140 -0
- package/rules/.source/ESCore/src/es/ESModule.android.ts +166 -0
- package/rules/.source/ESCore/src/es/ESModule.harmony.ts +167 -0
- package/rules/.source/ESCore/src/es/ESModule.ts +41 -0
- package/rules/.source/ESCore/src/es/ESSDKInfo.ts +17 -0
- package/rules/.source/ESCore/src/es/ESVersion.ts +14 -0
- package/rules/.source/ESCore/src/es/index.ts +4 -0
- package/rules/.source/ESCore/src/eventbus/ESEventBus.ts +135 -0
- package/rules/.source/ESCore/src/eventbus/ESEventBusArg.ts +2 -0
- package/rules/.source/ESCore/src/eventbus/ESEventBusCallback.ts +4 -0
- package/rules/.source/ESCore/src/eventbus/ESEventBusContext.ts +2 -0
- package/rules/.source/ESCore/src/eventbus/ESEventBusEvent.ts +7 -0
- package/rules/.source/ESCore/src/eventbus/index.ts +6 -0
- package/rules/.source/ESCore/src/file/ESFile.ts +381 -0
- package/rules/.source/ESCore/src/file/ESFileModule.android.ts +334 -0
- package/rules/.source/ESCore/src/file/ESFileModule.harmony.ts +343 -0
- package/rules/.source/ESCore/src/file/ESFileModule.ts +101 -0
- package/rules/.source/ESCore/src/file/ESFileStat.ts +19 -0
- package/rules/.source/ESCore/src/file/index.ts +1 -0
- package/rules/.source/ESCore/src/focus/ESFocus.ts +56 -0
- package/rules/.source/ESCore/src/focus/ESFocusModule.android.ts +35 -0
- package/rules/.source/ESCore/src/focus/ESFocusModule.harmony.ts +35 -0
- package/rules/.source/ESCore/src/focus/ESFocusModule.ts +12 -0
- package/rules/.source/ESCore/src/focus/ESFocusable.ts +1 -0
- package/rules/.source/ESCore/src/focus/index.ts +3 -0
- package/rules/.source/ESCore/src/global.d.ts +37 -0
- package/rules/.source/ESCore/src/hlog/ESHLog.ts +276 -0
- package/rules/.source/ESCore/src/hlog/ESHLogModule.ts +130 -0
- package/rules/.source/ESCore/src/hlog/ESLogListener.ts +959 -0
- package/rules/.source/ESCore/src/hlog/LogPluginHelper.ts +44 -0
- package/rules/.source/ESCore/src/hlog/index.ts +6 -0
- package/rules/.source/ESCore/src/hlog/listener/OnInitListenerBase.ts +24 -0
- package/rules/.source/ESCore/src/hlog/listener/OnUploadListenerBase.ts +39 -0
- package/rules/.source/ESCore/src/hlog/listener/RemoveInitListenerBase.ts +17 -0
- package/rules/.source/ESCore/src/hlog/listener/RemoveOldUploadListenerBase.ts +21 -0
- package/rules/.source/ESCore/src/hlog/listener/RemoveUploadListenerBase.ts +29 -0
- package/rules/.source/ESCore/src/hlog/listener/SetInitListenerBase.ts +25 -0
- package/rules/.source/ESCore/src/hlog/listener/SetOldUploadListenerBase.ts +33 -0
- package/rules/.source/ESCore/src/hlog/listener/SetUploadListenerBase.ts +47 -0
- package/rules/.source/ESCore/src/iac/ESIAC.ts +150 -0
- package/rules/.source/ESCore/src/iac/ESIACMessage.ts +5 -0
- package/rules/.source/ESCore/src/iac/ESIACMessageFilter.ts +3 -0
- package/rules/.source/ESCore/src/iac/ESIACModule.android.ts +40 -0
- package/rules/.source/ESCore/src/iac/ESIACModule.harmony.ts +63 -0
- package/rules/.source/ESCore/src/iac/ESIACModule.ts +15 -0
- package/rules/.source/ESCore/src/iac/ESIACReceiver.ts +5 -0
- package/rules/.source/ESCore/src/iac/index.ts +5 -0
- package/rules/.source/ESCore/src/index.ts +92 -0
- package/rules/.source/ESCore/src/key/ESKeyAction.ts +5 -0
- package/rules/.source/ESCore/src/key/ESKeyCode.ts +15 -0
- package/rules/.source/ESCore/src/key/ESKeyEvent.ts +8 -0
- package/rules/.source/ESCore/src/key/index.ts +3 -0
- package/rules/.source/ESCore/src/kv/ESKV.ts +104 -0
- package/rules/.source/ESCore/src/kv/ESKVModule.android.ts +60 -0
- package/rules/.source/ESCore/src/kv/ESKVModule.harmony.ts +80 -0
- package/rules/.source/ESCore/src/kv/ESKVModule.ts +28 -0
- package/rules/.source/ESCore/src/kv/index.ts +2 -0
- package/rules/.source/ESCore/src/local/ESLocalStorage.ts +114 -0
- package/rules/.source/ESCore/src/local/ESLocalStorageModule.android.ts +150 -0
- package/rules/.source/ESCore/src/local/ESLocalStorageModule.harmony.ts +119 -0
- package/rules/.source/ESCore/src/local/ESLocalStorageModule.ts +23 -0
- package/rules/.source/ESCore/src/local/index.ts +2 -0
- package/rules/.source/ESCore/src/location/ESLocation.ts +89 -0
- package/rules/.source/ESCore/src/location/ESLocationInfo.ts +9 -0
- package/rules/.source/ESCore/src/location/ESLocationListener.ts +5 -0
- package/rules/.source/ESCore/src/location/ESLocationModule.android.ts +53 -0
- package/rules/.source/ESCore/src/location/ESLocationModule.harmony.ts +23 -0
- package/rules/.source/ESCore/src/location/ESLocationModule.ts +8 -0
- package/rules/.source/ESCore/src/location/index.ts +4 -0
- package/rules/.source/ESCore/src/log/ESLog.ts +163 -0
- package/rules/.source/ESCore/src/log/ESLogModule.android.ts +51 -0
- package/rules/.source/ESCore/src/log/ESLogModule.harmony.ts +52 -0
- package/rules/.source/ESCore/src/log/ESLogModule.ts +18 -0
- package/rules/.source/ESCore/src/log/index.ts +3 -0
- package/rules/.source/ESCore/src/network/ESNetwork.ts +102 -0
- package/rules/.source/ESCore/src/network/ESNetworkInfo.ts +20 -0
- package/rules/.source/ESCore/src/network/ESNetworkInfoState.ts +8 -0
- package/rules/.source/ESCore/src/network/ESNetworkInfoType.ts +6 -0
- package/rules/.source/ESCore/src/network/ESNetworkListener.ts +5 -0
- package/rules/.source/ESCore/src/network/ESNetworkModule.android.ts +38 -0
- package/rules/.source/ESCore/src/network/ESNetworkModule.harmony.ts +122 -0
- package/rules/.source/ESCore/src/network/ESNetworkModule.ts +13 -0
- package/rules/.source/ESCore/src/network/ESWifiInfo.ts +6 -0
- package/rules/.source/ESCore/src/network/index.ts +9 -0
- package/rules/.source/ESCore/src/page/ESPageParams.ts +14 -0
- package/rules/.source/ESCore/src/page/index.ts +1 -0
- package/rules/.source/ESCore/src/permission/ESPermission.ts +46 -0
- package/rules/.source/ESCore/src/permission/ESPermissionModule.android.ts +33 -0
- package/rules/.source/ESCore/src/permission/ESPermissionModule.harmony.ts +33 -0
- package/rules/.source/ESCore/src/permission/ESPermissionModule.ts +12 -0
- package/rules/.source/ESCore/src/permission/ESRequestPermissionsResult.ts +6 -0
- package/rules/.source/ESCore/src/permission/index.ts +3 -0
- package/rules/.source/ESCore/src/platform/ESPlatform.ts +63 -0
- package/rules/.source/ESCore/src/platform/index.ts +1 -0
- package/rules/.source/ESCore/src/plugin/ESPlugin.ts +152 -0
- package/rules/.source/ESCore/src/plugin/ESPluginModule.android.ts +20 -0
- package/rules/.source/ESCore/src/plugin/ESPluginModule.harmony.ts +24 -0
- package/rules/.source/ESCore/src/plugin/ESPluginModule.ts +9 -0
- package/rules/.source/ESCore/src/plugin/index.ts +3 -0
- package/rules/.source/ESCore/src/power/ESPower.ts +41 -0
- package/rules/.source/ESCore/src/power/ESPowerModule.android.ts +31 -0
- package/rules/.source/ESCore/src/power/ESPowerModule.harmony.ts +33 -0
- package/rules/.source/ESCore/src/power/ESPowerModule.ts +7 -0
- package/rules/.source/ESCore/src/power/index.ts +2 -0
- package/rules/.source/ESCore/src/provider/ESContentProvider.ts +82 -0
- package/rules/.source/ESCore/src/provider/ESContentProviderInfo.ts +8 -0
- package/rules/.source/ESCore/src/provider/ESContentProviderModule.android.ts +62 -0
- package/rules/.source/ESCore/src/provider/ESContentProviderModule.harmony.ts +62 -0
- package/rules/.source/ESCore/src/provider/ESContentProviderModule.ts +29 -0
- package/rules/.source/ESCore/src/provider/ESContentProviderResult.ts +4 -0
- package/rules/.source/ESCore/src/provider/ESContentValues.ts +3 -0
- package/rules/.source/ESCore/src/provider/index.ts +5 -0
- package/rules/.source/ESCore/src/router/ESData.ts +3 -0
- package/rules/.source/ESCore/src/router/ESParams.ts +3 -0
- package/rules/.source/ESCore/src/router/ESRouter.ts +364 -0
- package/rules/.source/ESCore/src/router/ESRouterKeyManager.android.ts +107 -0
- package/rules/.source/ESCore/src/router/ESRouterKeyManager.harmony.ts +205 -0
- package/rules/.source/ESCore/src/router/ESRouterKeyManager.ts +11 -0
- package/rules/.source/ESCore/src/router/ESRouterLifecycleManager.ts +301 -0
- package/rules/.source/ESCore/src/router/ESRouterManager.ts +221 -0
- package/rules/.source/ESCore/src/router/index.ts +9 -0
- package/rules/.source/ESCore/src/runtime/ESRuntime.ts +164 -0
- package/rules/.source/ESCore/src/runtime/ESRuntimeDeviceModule.android.ts +76 -0
- package/rules/.source/ESCore/src/runtime/ESRuntimeDeviceModule.harmony.ts +39 -0
- package/rules/.source/ESCore/src/runtime/ESRuntimeDeviceModule.ts +14 -0
- package/rules/.source/ESCore/src/runtime/ESRuntimeDeviceType.ts +53 -0
- package/rules/.source/ESCore/src/runtime/index.ts +4 -0
- package/rules/.source/ESCore/src/service/ESService.ts +34 -0
- package/rules/.source/ESCore/src/service/ESServiceModule.android.ts +20 -0
- package/rules/.source/ESCore/src/service/ESServiceModule.harmony.ts +19 -0
- package/rules/.source/ESCore/src/service/ESServiceModule.ts +5 -0
- package/rules/.source/ESCore/src/service/index.ts +2 -0
- package/rules/.source/ESCore/src/share/ESShareData.ts +177 -0
- package/rules/.source/ESCore/src/share/ESShareDataModule.android.ts +370 -0
- package/rules/.source/ESCore/src/share/ESShareDataModule.harmony.ts +201 -0
- package/rules/.source/ESCore/src/share/ESShareDataModule.ts +83 -0
- package/rules/.source/ESCore/src/share/ESSharedData.ts +9 -0
- package/rules/.source/ESCore/src/share/ESSharedDataMode.ts +5 -0
- package/rules/.source/ESCore/src/share/ESSharedDataParams.ts +4 -0
- package/rules/.source/ESCore/src/share/ESSharedDataType.ts +9 -0
- package/rules/.source/ESCore/src/share/index.ts +7 -0
- package/rules/.source/ESCore/src/slot/ESSlot.ts +75 -0
- package/rules/.source/ESCore/src/slot/ESSlotEvent.ts +4 -0
- package/rules/.source/ESCore/src/slot/ESSlotEventName.ts +3 -0
- package/rules/.source/ESCore/src/slot/ESSlotParams.ts +14 -0
- package/rules/.source/ESCore/src/slot/index.ts +3 -0
- package/rules/.source/ESCore/src/theme/ESTheme.ts +88 -0
- package/rules/.source/ESCore/src/theme/ESThemeListener.ts +3 -0
- package/rules/.source/ESCore/src/theme/index.ts +3 -0
- package/rules/.source/ESCore/src/toast/ESToast.ts +47 -0
- package/rules/.source/ESCore/src/toast/ESToastModule.android.ts +30 -0
- package/rules/.source/ESCore/src/toast/ESToastModule.harmony.ts +30 -0
- package/rules/.source/ESCore/src/toast/ESToastModule.ts +9 -0
- package/rules/.source/ESCore/src/toast/index.ts +2 -0
- package/rules/.source/ESCore/src/upload/ESUpload.ts +226 -0
- package/rules/.source/ESCore/src/upload/ESUploadInfo.ts +13 -0
- package/rules/.source/ESCore/src/upload/ESUploadListener.ts +21 -0
- package/rules/.source/ESCore/src/upload/ESUploadModule.android.ts +60 -0
- package/rules/.source/ESCore/src/upload/ESUploadModule.harmony.ts +51 -0
- package/rules/.source/ESCore/src/upload/ESUploadModule.ts +19 -0
- package/rules/.source/ESCore/src/upload/ESUploadState.ts +9 -0
- package/rules/.source/ESCore/src/upload/ESUploadStatus.ts +11 -0
- package/rules/.source/ESCore/src/upload/index.ts +6 -0
- package/rules/.source/ESCore/src/usb/ESUsbDevice.ts +112 -0
- package/rules/.source/ESCore/src/usb/ESUsbDeviceInfo.ts +11 -0
- package/rules/.source/ESCore/src/usb/ESUsbDeviceListener.ts +7 -0
- package/rules/.source/ESCore/src/usb/ESUsbDeviceModule.android.ts +62 -0
- package/rules/.source/ESCore/src/usb/ESUsbDeviceModule.harmony.ts +58 -0
- package/rules/.source/ESCore/src/usb/ESUsbDeviceModule.ts +23 -0
- package/rules/.source/ESCore/src/usb/index.ts +4 -0
- package/rules/.source/ESCore/src/useApi.ts +257 -0
- package/rules/.source/ESCore/src/xlog/ESLogUpload.ts +92 -0
- package/rules/.source/ESCore/src/xlog/ESLogUploadInfo.ts +12 -0
- package/rules/.source/ESCore/src/xlog/ESLogUploadListener.ts +7 -0
- package/rules/.source/ESCore/src/xlog/ESXLog.ts +130 -0
- package/rules/.source/ESCore/src/xlog/ESXLogModule.android.ts +74 -0
- package/rules/.source/ESCore/src/xlog/ESXLogModule.harmony.ts +47 -0
- package/rules/.source/ESCore/src/xlog/ESXLogModule.ts +24 -0
- package/rules/.source/ESCore/src/xlog/index.ts +6 -0
- package/rules/.source/ESCore/tsconfig.json +34 -0
- package/rules/.source/ESPlayer/package.json +24 -0
- package/rules/.source/ESPlayer/rollup.config.js +28 -0
- package/rules/.source/ESPlayer/src/cache/ESPlayerCache.ts +14 -0
- package/rules/.source/ESPlayer/src/cache/ESPlayerCacheManager.ts +39 -0
- package/rules/.source/ESPlayer/src/core/ESIPlayer.ts +179 -0
- package/rules/.source/ESPlayer/src/core/ESIPlayerManager.ts +7 -0
- package/rules/.source/ESPlayer/src/core/ESMediaMetadata.ts +8 -0
- package/rules/.source/ESPlayer/src/core/ESMediaSource.ts +13 -0
- package/rules/.source/ESPlayer/src/core/ESMediaSourceList.ts +15 -0
- package/rules/.source/ESPlayer/src/core/ESPlayer.ts +100 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerBufferPercentCallback.ts +3 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerCDNInfo.ts +5 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerCommand.ts +1 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerComponentInfo.ts +7 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerConfiguration.ts +13 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerControlOptions.ts +8 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerDurationCallback.ts +3 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerMediaMeta.ts +48 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerPosition.ts +5 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerProgressCallback.ts +3 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerState.ts +44 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerStatus.ts +10 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerTrackInfo.ts +36 -0
- package/rules/.source/ESPlayer/src/core/ESPlayerTrackType.ts +5 -0
- package/rules/.source/ESPlayer/src/core/M3U8DefinitionInfo.ts +38 -0
- package/rules/.source/ESPlayer/src/decode/ESPlayerDecode.ts +12 -0
- package/rules/.source/ESPlayer/src/decode/ESPlayerDecodeManager.ts +81 -0
- package/rules/.source/ESPlayer/src/definition/ESPlayerDefinition.ts +21 -0
- package/rules/.source/ESPlayer/src/definition/ESPlayerDefinitionManager.ts +93 -0
- package/rules/.source/ESPlayer/src/definition/ESPlayerDefinitionStrategy.ts +12 -0
- package/rules/.source/ESPlayer/src/device/ESPlayerDevice.ts +4 -0
- package/rules/.source/ESPlayer/src/device/ESPlayerDeviceManager.ts +41 -0
- package/rules/.source/ESPlayer/src/device/ESPlayerDeviceType.ts +53 -0
- package/rules/.source/ESPlayer/src/display/ESPlayerDisplay.ts +4 -0
- package/rules/.source/ESPlayer/src/display/ESPlayerDisplayManager.ts +63 -0
- package/rules/.source/ESPlayer/src/error/ESPlayerError.ts +5 -0
- package/rules/.source/ESPlayer/src/error/ESPlayerErrors.ts +8 -0
- package/rules/.source/ESPlayer/src/event/ESPlayerEventDefaultListener.ts +127 -0
- package/rules/.source/ESPlayer/src/event/ESPlayerEventListener.ts +120 -0
- package/rules/.source/ESPlayer/src/event/ESPlayerEventManager.ts +451 -0
- package/rules/.source/ESPlayer/src/index.ts +166 -0
- package/rules/.source/ESPlayer/src/info/ESPlayerInfo.ts +16 -0
- package/rules/.source/ESPlayer/src/injectionSymbols.ts +84 -0
- package/rules/.source/ESPlayer/src/interceptor/ESIPlayerInterceptor.ts +11 -0
- package/rules/.source/ESPlayer/src/interceptor/ESPlayerInterceptError.ts +8 -0
- package/rules/.source/ESPlayer/src/interceptor/ESPlayerInterceptResult.ts +8 -0
- package/rules/.source/ESPlayer/src/interceptor/ESPlayerInterceptorManager.ts +95 -0
- package/rules/.source/ESPlayer/src/interceptor/ESPlayerInterceptorType.ts +17 -0
- package/rules/.source/ESPlayer/src/log/ESPlayerLog.ts +143 -0
- package/rules/.source/ESPlayer/src/log/ESPlayerLogModule.ts +43 -0
- package/rules/.source/ESPlayer/src/mode/ESPlayerPlayMode.ts +8 -0
- package/rules/.source/ESPlayer/src/mode/ESPlayerPlayModeManager.ts +39 -0
- package/rules/.source/ESPlayer/src/option/ESPlayerOption.ts +11 -0
- package/rules/.source/ESPlayer/src/option/ESPlayerOptionType.ts +14 -0
- package/rules/.source/ESPlayer/src/rate/ESPlayerRate.ts +11 -0
- package/rules/.source/ESPlayer/src/rate/ESPlayerRateManager.ts +39 -0
- package/rules/.source/ESPlayer/src/ratio/ESPlayerAspectRatio.ts +9 -0
- package/rules/.source/ESPlayer/src/ratio/ESPlayerAspectRatioManager.ts +39 -0
- package/rules/.source/ESPlayer/src/render/ESPlayerRender.ts +5 -0
- package/rules/.source/ESPlayer/src/render/ESPlayerRenderManager.ts +36 -0
- package/rules/.source/ESPlayer/src/storage/ESPlayerLocalStorageManager.ts +97 -0
- package/rules/.source/ESPlayer/src/storage/ESPlayerLocalStorageModule.android.ts +111 -0
- package/rules/.source/ESPlayer/src/storage/ESPlayerLocalStorageModule.harmony.ts +111 -0
- package/rules/.source/ESPlayer/src/storage/ESPlayerLocalStorageModule.ts +21 -0
- package/rules/.source/ESPlayer/src/type/ESPlayerType.ts +18 -0
- package/rules/.source/ESPlayer/src/type/ESPlayerTypeManager.ts +81 -0
- package/rules/.source/ESPlayer/src/useApi.ts +108 -0
- package/rules/.source/ESPlayer/src/view/ESIPlayerView.ts +120 -0
- package/rules/.source/ESPlayer/src/view/ESPlayerDefaultView.ts +127 -0
- package/rules/.source/ESPlayer/src/view/ESPlayerViewManager.ts +453 -0
- package/rules/.source/ESPlayer/src/volume/ESPlayerVolume.ts +4 -0
- package/rules/.source/ESPlayer/src/volume/ESPlayerVolumeManager.ts +51 -0
- package/rules/.source/ESPlayer/src/window/ESPlayerWindowType.ts +5 -0
- package/rules/.source/ESPlayer/tsconfig.json +34 -0
- package/rules/.source/ESPlayer/yarn.lock +4 -0
- package/rules/.source/ESPlayerManager/package.json +24 -0
- package/rules/.source/ESPlayerManager/rollup.config.js +33 -0
- package/rules/.source/ESPlayerManager/src/core/ESBuiltinADPlayerType.ts +9 -0
- package/rules/.source/ESPlayerManager/src/core/ESBuiltinPlayerType.ts +8 -0
- package/rules/.source/ESPlayerManager/src/core/ESIPlayerManager.ts +71 -0
- package/rules/.source/ESPlayerManager/src/core/ESMediaItem.ts +47 -0
- package/rules/.source/ESPlayerManager/src/core/ESMediaItemList.ts +11 -0
- package/rules/.source/ESPlayerManager/src/core/ESPlayerManager.ts +41 -0
- package/rules/.source/ESPlayerManager/src/core/ESPlayerManagerConfiguration.ts +6 -0
- package/rules/.source/ESPlayerManager/src/core/ESPlayerManagerErrors.ts +6 -0
- package/rules/.source/ESPlayerManager/src/event/ESPlayerManagerEventDefaultListener.ts +154 -0
- package/rules/.source/ESPlayerManager/src/event/ESPlayerManagerEventListener.ts +37 -0
- package/rules/.source/ESPlayerManager/src/event/ESPlayerManagerEventManager.ts +521 -0
- package/rules/.source/ESPlayerManager/src/index.ts +37 -0
- package/rules/.source/ESPlayerManager/src/index.vue +2676 -0
- package/rules/.source/ESPlayerManager/src/injectionSymbols.ts +16 -0
- package/rules/.source/ESPlayerManager/src/mode/ESPlayerManagerPlayModeManager.ts +27 -0
- package/rules/.source/ESPlayerManager/src/typings/shims-vue.d.ts +6 -0
- package/rules/.source/ESPlayerManager/src/useApi.ts +22 -0
- package/rules/.source/ESPlayerManager/src/utils/SparseArray.ts +103 -0
- package/rules/.source/ESPlayerManager/src/view/ESIPlayerManagerDefaultView.ts +167 -0
- package/rules/.source/ESPlayerManager/src/view/ESIPlayerManagerView.ts +44 -0
- package/rules/.source/ESPlayerManager/src/view/ESPlayerManagerViewManager.ts +517 -0
- package/rules/.source/ESPlayerManager/tsconfig.json +34 -0
- package/rules/.source/ESRouter/CHANGELOGG.md +899 -0
- package/rules/.source/ESRouter/SECURITY.md +20 -0
- package/rules/.source/ESRouter/api-extractor.json +49 -0
- package/rules/.source/ESRouter/index.js +7 -0
- package/rules/.source/ESRouter/nightwatch.conf.js +240 -0
- package/rules/.source/ESRouter/package.json +19 -0
- package/rules/.source/ESRouter/rollup.config.mjs +195 -0
- package/rules/.source/ESRouter/src/RouterLink.ts +358 -0
- package/rules/.source/ESRouter/src/RouterView.ts +794 -0
- package/rules/.source/ESRouter/src/SlotView.ts +477 -0
- package/rules/.source/ESRouter/src/config.ts +6 -0
- package/rules/.source/ESRouter/src/devtools.ts +576 -0
- package/rules/.source/ESRouter/src/encoding.ts +147 -0
- package/rules/.source/ESRouter/src/errors.ts +200 -0
- package/rules/.source/ESRouter/src/es/ESNativeRouter.android.ts +100 -0
- package/rules/.source/ESRouter/src/es/ESNativeRouter.harmony.ts +155 -0
- package/rules/.source/ESRouter/src/es/ESNativeRouter.ts +24 -0
- package/rules/.source/ESRouter/src/es/ESNativeRouterLaunchMode.ts +7 -0
- package/rules/.source/ESRouter/src/es/ESNativeRouterSplash.ts +6 -0
- package/rules/.source/ESRouter/src/global.d.ts +15 -0
- package/rules/.source/ESRouter/src/globalExtensions.ts +83 -0
- package/rules/.source/ESRouter/src/history/common.ts +237 -0
- package/rules/.source/ESRouter/src/history/es.ts +278 -0
- package/rules/.source/ESRouter/src/history/hash.ts +46 -0
- package/rules/.source/ESRouter/src/history/html5.ts +354 -0
- package/rules/.source/ESRouter/src/history/index.ts +40 -0
- package/rules/.source/ESRouter/src/history/memory.ts +127 -0
- package/rules/.source/ESRouter/src/index.ts +131 -0
- package/rules/.source/ESRouter/src/injectionSymbols.ts +91 -0
- package/rules/.source/ESRouter/src/location.ts +251 -0
- package/rules/.source/ESRouter/src/log/RouterLog.ts +90 -0
- package/rules/.source/ESRouter/src/log/info.ts +9 -0
- package/rules/.source/ESRouter/src/matcher/index.ts +533 -0
- package/rules/.source/ESRouter/src/matcher/pathMatcher.ts +55 -0
- package/rules/.source/ESRouter/src/matcher/pathParserRanker.ts +369 -0
- package/rules/.source/ESRouter/src/matcher/pathTokenizer.ts +200 -0
- package/rules/.source/ESRouter/src/matcher/types.ts +131 -0
- package/rules/.source/ESRouter/src/navigationGuards.ts +409 -0
- package/rules/.source/ESRouter/src/page/PageRouteView.ts +11 -0
- package/rules/.source/ESRouter/src/page/PageView.ts +12 -0
- package/rules/.source/ESRouter/src/query.ts +149 -0
- package/rules/.source/ESRouter/src/result/RouteResult.ts +11 -0
- package/rules/.source/ESRouter/src/result/RouteResultCallback.ts +5 -0
- package/rules/.source/ESRouter/src/router.ts +1930 -0
- package/rules/.source/ESRouter/src/scrollBehavior.ts +194 -0
- package/rules/.source/ESRouter/src/slot/SlotRootView.ts +11 -0
- package/rules/.source/ESRouter/src/slot/SlotView.ts +11 -0
- package/rules/.source/ESRouter/src/types/index.ts +605 -0
- package/rules/.source/ESRouter/src/types/typeGuards.ts +9 -0
- package/rules/.source/ESRouter/src/types/utils.ts +77 -0
- package/rules/.source/ESRouter/src/useApi.ts +29 -0
- package/rules/.source/ESRouter/src/utils/callbacks.ts +24 -0
- package/rules/.source/ESRouter/src/utils/env.ts +1 -0
- package/rules/.source/ESRouter/src/utils/index.ts +60 -0
- package/rules/.source/ESRouter/src/warning.ts +9 -0
- package/rules/.source/ESRouter/tsconfig.json +37 -0
- package/rules/.source/ESSoundPoolPlayer/package.json +23 -0
- package/rules/.source/ESSoundPoolPlayer/rollup.config.js +33 -0
- package/rules/.source/ESSoundPoolPlayer/src/core/ESSoundPoolContentType.ts +7 -0
- package/rules/.source/ESSoundPoolPlayer/src/core/ESSoundPoolStreamType.ts +15 -0
- package/rules/.source/ESSoundPoolPlayer/src/core/ESSoundPoolUsage.ts +19 -0
- package/rules/.source/ESSoundPoolPlayer/src/index.ts +19 -0
- package/rules/.source/ESSoundPoolPlayer/src/index.vue +1564 -0
- package/rules/.source/ESSoundPoolPlayer/src/module/ESSoundPoolPlayerModul.android.ts +133 -0
- package/rules/.source/ESSoundPoolPlayer/src/module/ESSoundPoolPlayerModul.harmony.ts +119 -0
- package/rules/.source/ESSoundPoolPlayer/src/module/ESSoundPoolPlayerModule.ts +48 -0
- package/rules/.source/ESSoundPoolPlayer/src/typings/shims-vue.d.ts +6 -0
- package/rules/.source/ESSoundPoolPlayer/tsconfig.json +34 -0
- package/rules/.source/ESVideoPlayer/package.json +26 -0
- package/rules/.source/ESVideoPlayer/rollup.config.js +33 -0
- package/rules/.source/ESVideoPlayer/src/component/ESVideoPlayerViewComponent.android.ts +948 -0
- package/rules/.source/ESVideoPlayer/src/component/ESVideoPlayerViewComponent.harmony.ts +763 -0
- package/rules/.source/ESVideoPlayer/src/index.ts +18 -0
- package/rules/.source/ESVideoPlayer/src/index.vue +2003 -0
- package/rules/.source/ESVideoPlayer/src/typings/shims-vue.d.ts +6 -0
- package/rules/.source/ESVideoPlayer/src/utils/ESVideoPlayerDefinitionUtils.ts +36 -0
- package/rules/.source/ESVideoPlayer/tsconfig.json +34 -0
- package/rules/.source/ESVideoPlayer/tsconfig.json.vite +0 -0
- package/rules/.source/ESVideoPlayer/tsconfig.node.json +0 -0
- package/rules/.source/ESVideoPlayer/vite.config.ts +29 -0
- package/rules/.source/ESVue/CHANGELOG.MD +201 -0
- package/rules/.source/ESVue/api-extractor.json +41 -0
- package/rules/.source/ESVue/package.json +42 -0
- package/rules/.source/ESVue/rollup.config.js +40 -0
- package/rules/.source/ESVue/src/built-in-component.ts +650 -0
- package/rules/.source/ESVue/src/config/index.ts +109 -0
- package/rules/.source/ESVue/src/global.d.ts +636 -0
- package/rules/.source/ESVue/src/hooks/lifecycle.ts +248 -0
- package/rules/.source/ESVue/src/index.ts +365 -0
- package/rules/.source/ESVue/src/modules/attrs.ts +24 -0
- package/rules/.source/ESVue/src/modules/class.ts +31 -0
- package/rules/.source/ESVue/src/modules/events.ts +119 -0
- package/rules/.source/ESVue/src/modules/patch-log.ts +39 -0
- package/rules/.source/ESVue/src/modules/style.ts +68 -0
- package/rules/.source/ESVue/src/node-ops.ts +153 -0
- package/rules/.source/ESVue/src/patch-prop.ts +93 -0
- package/rules/.source/ESVue/src/runtime/component/index.ts +83 -0
- package/rules/.source/ESVue/src/runtime/document/hippy-document.ts +56 -0
- package/rules/.source/ESVue/src/runtime/element/hippy-comment-element.ts +21 -0
- package/rules/.source/ESVue/src/runtime/element/hippy-element.ts +1623 -0
- package/rules/.source/ESVue/src/runtime/element/hippy-input-element.ts +75 -0
- package/rules/.source/ESVue/src/runtime/element/hippy-list-element.ts +306 -0
- package/rules/.source/ESVue/src/runtime/event/event-bus.ts +148 -0
- package/rules/.source/ESVue/src/runtime/event/hippy-event-dispatcher.ts +391 -0
- package/rules/.source/ESVue/src/runtime/event/hippy-event-target.ts +191 -0
- package/rules/.source/ESVue/src/runtime/event/hippy-event.ts +317 -0
- package/rules/.source/ESVue/src/runtime/native/index.ts +924 -0
- package/rules/.source/ESVue/src/runtime/node/hippy-node.ts +722 -0
- package/rules/.source/ESVue/src/runtime/node/node-log.ts +39 -0
- package/rules/.source/ESVue/src/runtime/render/index.ts +550 -0
- package/rules/.source/ESVue/src/runtime/style/css-map.ts +100 -0
- package/rules/.source/ESVue/src/runtime/style/css-resolve-auto-style.ts +119 -0
- package/rules/.source/ESVue/src/runtime/style/css-resolve-percent-style.ts +111 -0
- package/rules/.source/ESVue/src/runtime/style/css-resolve-rem-style.ts +45 -0
- package/rules/.source/ESVue/src/runtime/style/css-resolve-scale-style.ts +103 -0
- package/rules/.source/ESVue/src/runtime/style/css-resolve-style.ts +24 -0
- package/rules/.source/ESVue/src/runtime/style/css-resolve-variables.ts +209 -0
- package/rules/.source/ESVue/src/runtime/style/css-resolve-vwvh-style.ts +65 -0
- package/rules/.source/ESVue/src/runtime/style/css-resolve-width-height-style.ts +18 -0
- package/rules/.source/ESVue/src/runtime/style/css-selectors-match.ts +295 -0
- package/rules/.source/ESVue/src/runtime/style/css-selectors.ts +1173 -0
- package/rules/.source/ESVue/src/runtime/style/index.ts +154 -0
- package/rules/.source/ESVue/src/runtime/style/log.ts +39 -0
- package/rules/.source/ESVue/src/runtime/style/parser.ts +291 -0
- package/rules/.source/ESVue/src/runtime/text/hippy-text.ts +41 -0
- package/rules/.source/ESVue/src/runtime/websocket/websocket.ts +282 -0
- package/rules/.source/ESVue/src/types/index.ts +25 -0
- package/rules/.source/ESVue/src/types/native-modules/clip-board-module.ts +24 -0
- package/rules/.source/ESVue/src/types/native-modules/device-event-module.ts +24 -0
- package/rules/.source/ESVue/src/types/native-modules/http.ts +57 -0
- package/rules/.source/ESVue/src/types/native-modules/image-loader-module.ts +27 -0
- package/rules/.source/ESVue/src/types/native-modules/net-info.ts +29 -0
- package/rules/.source/ESVue/src/types/native-modules/network.ts +24 -0
- package/rules/.source/ESVue/src/types/native-modules/test-module.ts +23 -0
- package/rules/.source/ESVue/src/types/native-modules/ui-manager-module.ts +44 -0
- package/rules/.source/ESVue/src/types/native-modules/websocket.ts +49 -0
- package/rules/.source/ESVue/src/types/native-modules.ts +41 -0
- package/rules/.source/ESVue/src/types/native-node.ts +48 -0
- package/rules/.source/ESVue/src/util/event.ts +74 -0
- package/rules/.source/ESVue/src/util/i18n.ts +32 -0
- package/rules/.source/ESVue/src/util/index.ts +418 -0
- package/rules/.source/ESVue/src/util/instance.ts +77 -0
- package/rules/.source/ESVue/src/util/log.ts +39 -0
- package/rules/.source/ESVue/src/util/node.ts +152 -0
- package/rules/.source/ESVue/src/util/rem.ts +54 -0
- package/rules/.source/ESVue/src/util/screen.ts +42 -0
- package/rules/.source/ESVue/tsconfig.json +34 -0
- package/rules/.source/ESVue/tsdoc.json +6 -0
- package/rules/.source/ESVue/yarn.lock +4 -0
- package/rules/.source/ESVueCssLoader/package.json +27 -0
- package/rules/.source/ESVueCssLoader/rollup.config.js +20 -0
- package/rules/.source/ESVueCssLoader/src/index.ts +2 -0
- package/rules/.source/ESVueCssLoader/src/log/log.ts +38 -0
- package/rules/.source/ESVueCssLoader/src/style-parser/color-parser.ts +357 -0
- package/rules/.source/ESVueCssLoader/src/style-parser/css-loader.ts +93 -0
- package/rules/.source/ESVueCssLoader/src/style-parser/css-parser.ts +1123 -0
- package/rules/.source/ESVueCssLoader/src/types.ts +5 -0
- package/rules/.source/ESVueCssLoader/src/utils/utils.ts +59 -0
- package/rules/.source/ESVueCssLoader/tsconfig.json +34 -0
- package/rules/.source/ESVueStyleParser/api-extractor.json +38 -0
- package/rules/.source/ESVueStyleParser/package.json +24 -0
- package/rules/.source/ESVueStyleParser/rollup.config.js +28 -0
- package/rules/.source/ESVueStyleParser/src/index.ts +24 -0
- package/rules/.source/ESVueStyleParser/src/style-parser/android-color-parser.ts +143 -0
- package/rules/.source/ESVueStyleParser/src/style-parser/color-parser.ts +256 -0
- package/rules/.source/ESVueStyleParser/src/style-parser/css-parser.ts +1371 -0
- package/rules/.source/ESVueStyleParser/src/style-parser/named-colors.ts +154 -0
- package/rules/.source/ESVueStyleParser/src/style-parser/utils.ts +55 -0
- package/rules/.source/ESVueStyleParser/src/types.ts +5 -0
- package/rules/.source/ESVueStyleParser/tsconfig.json +34 -0
- package/rules/.source/component/package.json +24 -0
- package/rules/.source/component/rollup.config.js +28 -0
- package/rules/.source/component/src/ESAnimationView/ESAnimationViewComponent.ts +51 -0
- package/rules/.source/component/src/ESAppIconView/ESAppIconViewComponent.ts +46 -0
- package/rules/.source/component/src/ESAppIconView/ESIAppIcon.ts +5 -0
- package/rules/.source/component/src/ESCardView/ESCardContainerViewComponent.ts +127 -0
- package/rules/.source/component/src/ESCardView/ESCardEvent.ts +3 -0
- package/rules/.source/component/src/ESCardView/ESCardViewComponent.ts +54 -0
- package/rules/.source/component/src/ESCardView/ESICard.ts +9 -0
- package/rules/.source/component/src/ESCardView/ESICardContainer.ts +25 -0
- package/rules/.source/component/src/ESChartView/ESBarChartViewComponent.ts +35 -0
- package/rules/.source/component/src/ESChartView/ESIChart.ts +3 -0
- package/rules/.source/component/src/ESChartView/ESLineChartViewComponent.ts +35 -0
- package/rules/.source/component/src/ESDialog/ESDialogComponent.ts +15 -0
- package/rules/.source/component/src/ESFastSwiperSlideView/ESFastSwiperSlideViewComponent.ts +46 -0
- package/rules/.source/component/src/ESFlexView/ESFlexViewComponent.ts +22 -0
- package/rules/.source/component/src/ESGradient/ESGradient.ts +14 -0
- package/rules/.source/component/src/ESGradient/ESGradientOrientation.ts +10 -0
- package/rules/.source/component/src/ESGradient/ESGradientShape.ts +6 -0
- package/rules/.source/component/src/ESGradient/ESGradientType.ts +5 -0
- package/rules/.source/component/src/ESItem/ESItemComponent.ts +40 -0
- package/rules/.source/component/src/ESItemStoreView/ESItemStoreViewComponent.ts +23 -0
- package/rules/.source/component/src/ESLargeListView/ESLargeListViewComponent.ts +136 -0
- package/rules/.source/component/src/ESLoading/ESLoadingViewComponent.ts +16 -0
- package/rules/.source/component/src/ESLoading/ESLoadingViewElement.android.ts +11 -0
- package/rules/.source/component/src/ESLoading/ESLoadingViewElement.harmony.ts +11 -0
- package/rules/.source/component/src/ESLottieView/ESLottieViewComponent.android.ts +29 -0
- package/rules/.source/component/src/ESLottieView/ESLottieViewComponent.harmony.ts +29 -0
- package/rules/.source/component/src/ESMediaSeries/ESIMediaSeries.ts +24 -0
- package/rules/.source/component/src/ESMediaSeries/ESMediaSeries.ts +6 -0
- package/rules/.source/component/src/ESMediaSeries/ESMediaSeriesComponent.ts +142 -0
- package/rules/.source/component/src/ESOrientationSeekBar/ESHorizontalSeekBarViewComponent.ts +1305 -0
- package/rules/.source/component/src/ESOrientationSeekBar/ESIHorizontalSeekBar.ts +255 -0
- package/rules/.source/component/src/ESOrientationSeekBar/ESIVerticalSeekBar.ts +13 -0
- package/rules/.source/component/src/ESOrientationSeekBar/ESVerticalSeekBarViewComponent.ts +1356 -0
- package/rules/.source/component/src/ESPlayMarkView/ESPlayMarkViewComponent.ts +21 -0
- package/rules/.source/component/src/ESPluginView/ESPluginViewComponent.ts +34 -0
- package/rules/.source/component/src/ESProgressBarView/ESProgressBarViewComponent.ts +38 -0
- package/rules/.source/component/src/ESQRCodeView/ESQRCodeViewComponent.ts +11 -0
- package/rules/.source/component/src/ESReplaceChildView/ESReplaceChildViewComponent.ts +151 -0
- package/rules/.source/component/src/ESRippleView/ESRippleViewComponent.ts +45 -0
- package/rules/.source/component/src/ESScrollView/ESIScrollView.ts +7 -0
- package/rules/.source/component/src/ESScrollView/ESScrollViewComponent.ts +49 -0
- package/rules/.source/component/src/ESSeekBarView/ESSeekBarViewElement.android.ts +38 -0
- package/rules/.source/component/src/ESSeekBarView/ESSeekBarViewElement.harmony.ts +38 -0
- package/rules/.source/component/src/ESSurfaceView/ESSurfaceViewComponent.ts +21 -0
- package/rules/.source/component/src/ESSwiftListView/ESSwiftListViewComponent.ts +117 -0
- package/rules/.source/component/src/ESSwiperSlideView/ESSwiperSlideViewComponent.ts +31 -0
- package/rules/.source/component/src/ESSwiperView/ESSwiperViewComponent.ts +82 -0
- package/rules/.source/component/src/ESTVItemView/ESTVItemViewComponent.ts +185 -0
- package/rules/.source/component/src/ESTVListView/ESIListView.ts +184 -0
- package/rules/.source/component/src/ESTVListView/ESListInitPosition.ts +15 -0
- package/rules/.source/component/src/ESTVListView/ESListViewItem.ts +10 -0
- package/rules/.source/component/src/ESTVListView/ESListViewItemDecoration.ts +7 -0
- package/rules/.source/component/src/ESTVListView/ESListViewItemFunctionParams.ts +7 -0
- package/rules/.source/component/src/ESTVListView/ESTVListViewComponent.ts +697 -0
- package/rules/.source/component/src/ESTabsView/ESITab.ts +90 -0
- package/rules/.source/component/src/ESTabsView/ESTab.ts +7 -0
- package/rules/.source/component/src/ESTabsView/ESTabItem.ts +8 -0
- package/rules/.source/component/src/ESTabsView/ESTabsViewComponent.ts +383 -0
- package/rules/.source/component/src/ESTestView/ESITestAView.ts +1 -0
- package/rules/.source/component/src/ESTestView/ESITestGroup.ts +3 -0
- package/rules/.source/component/src/ESTestView/ESITestView.ts +3 -0
- package/rules/.source/component/src/ESTestView/ESTestAViewComponent.ts +34 -0
- package/rules/.source/component/src/ESTestView/ESTestGroupComponent.ts +39 -0
- package/rules/.source/component/src/ESTestView/ESTestViewComponent.ts +51 -0
- package/rules/.source/component/src/ESTextView/ESTextViewComponent.ts +22 -0
- package/rules/.source/component/src/ESTransitionImageView/ESITransitionImage.ts +7 -0
- package/rules/.source/component/src/ESTransitionImageView/ESTransitionImageViewComponent.ts +58 -0
- package/rules/.source/component/src/ESView/ESDirections.ts +7 -0
- package/rules/.source/component/src/ESView/ESIView.ts +6 -0
- package/rules/.source/component/src/ESView/ESViewComponent.ts +24 -0
- package/rules/.source/component/src/ESView/ESViewCoordinate.ts +4 -0
- package/rules/.source/component/src/ESView/ESViewScrollState.ts +5 -0
- package/rules/.source/component/src/ESView/ESViewState.ts +16 -0
- package/rules/.source/component/src/ESView/ESViewStateCallback.ts +5 -0
- package/rules/.source/component/src/ESViewPager/ESIViewPager.ts +8 -0
- package/rules/.source/component/src/ESViewPager/ESPageData.ts +7 -0
- package/rules/.source/component/src/ESViewPager/ESViewPagerComponent.ts +58 -0
- package/rules/.source/component/src/ESWebView/ESWebViewComponent.ts +48 -0
- package/rules/.source/component/src/ESX5WebView/ESX5WebViewElement.android.ts +70 -0
- package/rules/.source/component/src/ESX5WebView/ESX5WebViewElement.harmony.ts +70 -0
- package/rules/.source/component/src/index.ts +180 -0
- package/rules/.source/component/src/tv-div/TVDivComponent.ts +131 -0
- package/rules/.source/component/src/tv-image/TVImageComponent.ts +126 -0
- package/rules/.source/component/src/tv-li/TVLiComponent.ts +10 -0
- package/rules/.source/component/src/tv-swiper/TVSwiperComponent.ts +110 -0
- package/rules/.source/component/src/tv-ul/TVULComponent.ts +82 -0
- package/rules/.source/component/src/typings/index.ts +7 -0
- package/rules/.source/component/src/typings/shims-vue.d.ts +6 -0
- package/rules/.source/component/tsconfig.json +34 -0
- package/rules/.source/quicktvui/assets/ic_media_sereis_vip.png +0 -0
- package/rules/.source/quicktvui/package.json +38 -0
- package/rules/.source/quicktvui/rollup.config.js +33 -0
- package/rules/.source/quicktvui/src/animation/QTAnimation.android.ts +1139 -0
- package/rules/.source/quicktvui/src/animation/QTAnimation.harmony.ts +1088 -0
- package/rules/.source/quicktvui/src/animation/QTIAnimation.ts +336 -0
- package/rules/.source/quicktvui/src/animation/QtAnimationAPI.ts +467 -0
- package/rules/.source/quicktvui/src/animation/types.ts +97 -0
- package/rules/.source/quicktvui/src/app/QTAppIcon.ts +41 -0
- package/rules/.source/quicktvui/src/app/QTIAppIcon.ts +5 -0
- package/rules/.source/quicktvui/src/app/QtAppIconAPI.ts +56 -0
- package/rules/.source/quicktvui/src/assets/vip.png +0 -0
- package/rules/.source/quicktvui/src/base/QTIBaseView.ts +95 -0
- package/rules/.source/quicktvui/src/base/QtBaseNativeViewAPI.ts +604 -0
- package/rules/.source/quicktvui/src/base/QtBaseViewAPI.ts +750 -0
- package/rules/.source/quicktvui/src/base/useBaseView.ts +374 -0
- package/rules/.source/quicktvui/src/button/QTIButton.ts +3 -0
- package/rules/.source/quicktvui/src/button/QtButtonAPI.ts +9 -0
- package/rules/.source/quicktvui/src/button/index.vue +223 -0
- package/rules/.source/quicktvui/src/canvas/CanvasGradient.ts +84 -0
- package/rules/.source/quicktvui/src/canvas/QTCanvasView.ts +468 -0
- package/rules/.source/quicktvui/src/canvas/QTICanvasView.ts +141 -0
- package/rules/.source/quicktvui/src/canvas/QtCanvasViewAPI.ts +1140 -0
- package/rules/.source/quicktvui/src/classified-list-view/QtClassifiedListViewAPI.ts +115 -0
- package/rules/.source/quicktvui/src/classified-list-view/core/QTClassifiedListViewItem.ts +11 -0
- package/rules/.source/quicktvui/src/classified-list-view/core/QTClassifiedListViewItemDecoration.ts +7 -0
- package/rules/.source/quicktvui/src/classified-list-view/core/QTIClassifiedListView.ts +18 -0
- package/rules/.source/quicktvui/src/classified-list-view/index.vue +520 -0
- package/rules/.source/quicktvui/src/collapse/QtCollapseAPI.ts +60 -0
- package/rules/.source/quicktvui/src/collapse/core/QTCollapse.ts +13 -0
- package/rules/.source/quicktvui/src/collapse/core/QTCollapseItem.ts +7 -0
- package/rules/.source/quicktvui/src/collapse/core/QTICollapse.ts +15 -0
- package/rules/.source/quicktvui/src/collapse/core/QTICollapseItem.ts +5 -0
- package/rules/.source/quicktvui/src/collapse/index.vue +337 -0
- package/rules/.source/quicktvui/src/column/QTIColumn.ts +3 -0
- package/rules/.source/quicktvui/src/column/QtColumnAPI.ts +9 -0
- package/rules/.source/quicktvui/src/column/index.vue +29 -0
- package/rules/.source/quicktvui/src/core/QTEventData.ts +4 -0
- package/rules/.source/quicktvui/src/core/QTFlexStyleBackground.ts +4 -0
- package/rules/.source/quicktvui/src/core/QTFlexStyleCoordinate.ts +5 -0
- package/rules/.source/quicktvui/src/core/QTFlexStyleDecoration.ts +7 -0
- package/rules/.source/quicktvui/src/core/QTFlexStyleGradientBackground.ts +6 -0
- package/rules/.source/quicktvui/src/core/QTFlexStyleMargin.ts +8 -0
- package/rules/.source/quicktvui/src/core/QTFlexStylePadding.ts +8 -0
- package/rules/.source/quicktvui/src/core/QTFlexStylePosition.ts +7 -0
- package/rules/.source/quicktvui/src/core/QTFlexStyleSize.ts +6 -0
- package/rules/.source/quicktvui/src/core/QTFlexStyleSpacing.ts +4 -0
- package/rules/.source/quicktvui/src/core/QTFlexStyleText.ts +5 -0
- package/rules/.source/quicktvui/src/core/QTFocusable.ts +5 -0
- package/rules/.source/quicktvui/src/core/QTLocation.ts +4 -0
- package/rules/.source/quicktvui/src/core/QTNativeParams.ts +22 -0
- package/rules/.source/quicktvui/src/core/QTPosition.ts +4 -0
- package/rules/.source/quicktvui/src/core/QTVisibility.ts +5 -0
- package/rules/.source/quicktvui/src/dialog/QTDialog.ts +28 -0
- package/rules/.source/quicktvui/src/dialog/QTIDialog.ts +3 -0
- package/rules/.source/quicktvui/src/file-browse/QTFileBrowse.ts +76 -0
- package/rules/.source/quicktvui/src/file-browse/QTIFileBrowse.ts +13 -0
- package/rules/.source/quicktvui/src/focus/QTDescendantFocusability.ts +5 -0
- package/rules/.source/quicktvui/src/focus/QTFocusDescendant.ts +5 -0
- package/rules/.source/quicktvui/src/focus/QTFocusDirection.ts +8 -0
- package/rules/.source/quicktvui/src/focus/QTFocusDirectionName.ts +7 -0
- package/rules/.source/quicktvui/src/gradient/QTGradient.ts +14 -0
- package/rules/.source/quicktvui/src/gradient/QTGradientOrientation.ts +10 -0
- package/rules/.source/quicktvui/src/gradient/QTGradientShape.ts +6 -0
- package/rules/.source/quicktvui/src/gradient/QTGradientType.ts +5 -0
- package/rules/.source/quicktvui/src/grid-view/QtGridViewAPI.ts +121 -0
- package/rules/.source/quicktvui/src/grid-view/README.md +93 -0
- package/rules/.source/quicktvui/src/grid-view/core/QTGridViewItem.ts +4 -0
- package/rules/.source/quicktvui/src/grid-view/core/QTGridViewItemDecoration.ts +7 -0
- package/rules/.source/quicktvui/src/grid-view/core/QTGridViewItemFunctionParams.ts +7 -0
- package/rules/.source/quicktvui/src/grid-view/core/QTIGridView.ts +23 -0
- package/rules/.source/quicktvui/src/grid-view/index.vue +390 -0
- package/rules/.source/quicktvui/src/image/QTIImage.ts +8 -0
- package/rules/.source/quicktvui/src/image/QTImageResizeMode.ts +7 -0
- package/rules/.source/quicktvui/src/image/QtImageAPI.ts +54 -0
- package/rules/.source/quicktvui/src/image/index.vue +33 -0
- package/rules/.source/quicktvui/src/index.ts +404 -0
- package/rules/.source/quicktvui/src/list/QTIBaseListView.ts +144 -0
- package/rules/.source/quicktvui/src/list/QTListInitPosition.ts +15 -0
- package/rules/.source/quicktvui/src/list/QtBaseListViewAPI.ts +930 -0
- package/rules/.source/quicktvui/src/list/useBaseListView.ts +454 -0
- package/rules/.source/quicktvui/src/list/useListView.ts +294 -0
- package/rules/.source/quicktvui/src/list-indicator/QTIndicatorListViewComponent.ts +553 -0
- package/rules/.source/quicktvui/src/list-indicator/QtIndicatorViewAPI.ts +114 -0
- package/rules/.source/quicktvui/src/list-indicator/core/QTIIndicatorView.ts +21 -0
- package/rules/.source/quicktvui/src/list-item/ESListItemComponent.ts +86 -0
- package/rules/.source/quicktvui/src/list-item/QTIListItem.ts +14 -0
- package/rules/.source/quicktvui/src/list-item/QtListItemAPI.ts +107 -0
- package/rules/.source/quicktvui/src/list-view/QTListViewComponent.ts +389 -0
- package/rules/.source/quicktvui/src/list-view/QtListViewAPI.ts +101 -0
- package/rules/.source/quicktvui/src/list-view/core/QTIListView.ts +19 -0
- package/rules/.source/quicktvui/src/list-view/core/QTListViewItem.ts +12 -0
- package/rules/.source/quicktvui/src/list-view/core/QTListViewItemDecoration.ts +7 -0
- package/rules/.source/quicktvui/src/list-view/core/QTListViewItemFunctionParams.ts +7 -0
- package/rules/.source/quicktvui/src/list-view/core/QTListViewItemState.ts +8 -0
- package/rules/.source/quicktvui/src/loading/QTILoadingView.ts +3 -0
- package/rules/.source/quicktvui/src/loading/QTLoadingView.ts +25 -0
- package/rules/.source/quicktvui/src/loading/QtLoadingAPI.ts +9 -0
- package/rules/.source/quicktvui/src/long-image/QTILongImage.ts +68 -0
- package/rules/.source/quicktvui/src/long-image/QTLongImage.ts +442 -0
- package/rules/.source/quicktvui/src/long-image/QTLongImageEventBean.ts +62 -0
- package/rules/.source/quicktvui/src/long-image/QTLongImageOrientation.ts +19 -0
- package/rules/.source/quicktvui/src/long-image/QTLongImagePositionType.ts +5 -0
- package/rules/.source/quicktvui/src/long-image/QTLongImageScaleType.ts +9 -0
- package/rules/.source/quicktvui/src/long-image/QtLongImageAPI.ts +9 -0
- package/rules/.source/quicktvui/src/long-image/index.vue +397 -0
- package/rules/.source/quicktvui/src/lottie/QTILottieView.ts +62 -0
- package/rules/.source/quicktvui/src/lottie/QTLottieAsyncUpdates.ts +5 -0
- package/rules/.source/quicktvui/src/lottie/QTLottieEvent.ts +5 -0
- package/rules/.source/quicktvui/src/lottie/QTLottieRenderMode.ts +5 -0
- package/rules/.source/quicktvui/src/lottie/QTLottieRepeatMode.ts +5 -0
- package/rules/.source/quicktvui/src/lottie/QTLottieView.android.ts +207 -0
- package/rules/.source/quicktvui/src/lottie/QTLottieView.harmony.ts +207 -0
- package/rules/.source/quicktvui/src/lottie/QtLottieViewAPI.ts +586 -0
- package/rules/.source/quicktvui/src/nav-bar/QTINavBar.ts +11 -0
- package/rules/.source/quicktvui/src/nav-bar/QTNavBar.ts +9 -0
- package/rules/.source/quicktvui/src/nav-bar/QTNavBarItem.ts +9 -0
- package/rules/.source/quicktvui/src/nav-bar/QTNavBarItemType.ts +3 -0
- package/rules/.source/quicktvui/src/nav-bar/QtNavBarAPI.ts +36 -0
- package/rules/.source/quicktvui/src/nav-bar/index.vue +220 -0
- package/rules/.source/quicktvui/src/plugin/QTIPluginView.ts +11 -0
- package/rules/.source/quicktvui/src/plugin/QTPluginView.ts +49 -0
- package/rules/.source/quicktvui/src/plugin/QtPluginViewAPI.ts +44 -0
- package/rules/.source/quicktvui/src/poster/QtPosterAPI.ts +9 -0
- package/rules/.source/quicktvui/src/poster/core/QTIPoster.ts +3 -0
- package/rules/.source/quicktvui/src/poster/core/QTPoster.ts +32 -0
- package/rules/.source/quicktvui/src/poster/core/QTPosterCorner.ts +9 -0
- package/rules/.source/quicktvui/src/poster/core/QTPosterElement.ts +8 -0
- package/rules/.source/quicktvui/src/poster/core/QTPosterImage.ts +7 -0
- package/rules/.source/quicktvui/src/poster/core/QTPosterPlaceholderImg.ts +4 -0
- package/rules/.source/quicktvui/src/poster/core/QTPosterRipple.ts +10 -0
- package/rules/.source/quicktvui/src/poster/core/QTPosterScore.ts +14 -0
- package/rules/.source/quicktvui/src/poster/core/QTPosterShadow.ts +4 -0
- package/rules/.source/quicktvui/src/poster/core/QTPosterShimmer.ts +4 -0
- package/rules/.source/quicktvui/src/poster/core/QTPosterTitle.ts +17 -0
- package/rules/.source/quicktvui/src/poster/index.vue +279 -0
- package/rules/.source/quicktvui/src/poster/qt-poster-corner-title.vue +69 -0
- package/rules/.source/quicktvui/src/poster/qt-poster-focus-title.vue +113 -0
- package/rules/.source/quicktvui/src/progressbar/QTIProgressBar.ts +264 -0
- package/rules/.source/quicktvui/src/progressbar/QTProgressBar.ts +1284 -0
- package/rules/.source/quicktvui/src/progressbar/QtProgressBarAPI.ts +2637 -0
- package/rules/.source/quicktvui/src/qrcode/QTIQRCode.ts +3 -0
- package/rules/.source/quicktvui/src/qrcode/QTQRCodeView.ts +24 -0
- package/rules/.source/quicktvui/src/qrcode/QtQRCodeAPI.ts +9 -0
- package/rules/.source/quicktvui/src/qt/QtAPI.ts +337 -0
- package/rules/.source/quicktvui/src/qt/QtAPIModule.ts +3 -0
- package/rules/.source/quicktvui/src/qt/warning.ts +9 -0
- package/rules/.source/quicktvui/src/qtListen/README.md +76 -0
- package/rules/.source/quicktvui/src/qtListen/effect.ts +141 -0
- package/rules/.source/quicktvui/src/qtListen/index.ts +11 -0
- package/rules/.source/quicktvui/src/qtListen/qtArray.ts +156 -0
- package/rules/.source/quicktvui/src/qtListen/qtDiff.ts +143 -0
- package/rules/.source/quicktvui/src/qtListen/reactive.ts +205 -0
- package/rules/.source/quicktvui/src/qtListen/ref.ts +98 -0
- package/rules/.source/quicktvui/src/qtListen/types.ts +311 -0
- package/rules/.source/quicktvui/src/qtListen/watch.ts +233 -0
- package/rules/.source/quicktvui/src/replace-child/QTIReplaceChildView.ts +5 -0
- package/rules/.source/quicktvui/src/replace-child/QTReplaceChildView.ts +30 -0
- package/rules/.source/quicktvui/src/replace-child/QtReplaceChildViewAPI.ts +37 -0
- package/rules/.source/quicktvui/src/row/QTIRow.ts +3 -0
- package/rules/.source/quicktvui/src/row/QtRowAPI.ts +9 -0
- package/rules/.source/quicktvui/src/row/index.vue +29 -0
- package/rules/.source/quicktvui/src/scroll-view/QTIScrollView.ts +7 -0
- package/rules/.source/quicktvui/src/scroll-view/QTScrollView.ts +45 -0
- package/rules/.source/quicktvui/src/scroll-view/QtScrollViewAPI.ts +62 -0
- package/rules/.source/quicktvui/src/section/index.vue +40 -0
- package/rules/.source/quicktvui/src/seekbar/QTISeekBar.ts +277 -0
- package/rules/.source/quicktvui/src/seekbar/QTSeekBar.ts +1380 -0
- package/rules/.source/quicktvui/src/seekbar/QTSeekBarGravity.ts +5 -0
- package/rules/.source/quicktvui/src/seekbar/QTSeekBarIndicatorMode.ts +6 -0
- package/rules/.source/quicktvui/src/seekbar/QTSeekBarMode.ts +4 -0
- package/rules/.source/quicktvui/src/seekbar/QTSeekBarTickMarkGravity.ts +5 -0
- package/rules/.source/quicktvui/src/seekbar/QTSeekBarTickMarkLayoutGravity.ts +4 -0
- package/rules/.source/quicktvui/src/seekbar/QTSeekBarTickMarkMode.ts +4 -0
- package/rules/.source/quicktvui/src/seekbar/QtSeekBarAPI.ts +2645 -0
- package/rules/.source/quicktvui/src/series/DataAdapter.ts +329 -0
- package/rules/.source/quicktvui/src/series/QTIMediaSeries.ts +33 -0
- package/rules/.source/quicktvui/src/series/QTMediaSeries.ts +9 -0
- package/rules/.source/quicktvui/src/series/QTMediaSeriesData.ts +9 -0
- package/rules/.source/quicktvui/src/series/QTMediaSeriesDataStyle.ts +4 -0
- package/rules/.source/quicktvui/src/series/QTMediaSeriesEvent.ts +7 -0
- package/rules/.source/quicktvui/src/series/QTMediaSeriesGroup.ts +8 -0
- package/rules/.source/quicktvui/src/series/QTMediaSeriesGroupStyle.ts +58 -0
- package/rules/.source/quicktvui/src/series/QTMediaSeriesStyleType.ts +5 -0
- package/rules/.source/quicktvui/src/series/QTMediaSeriesType.ts +8 -0
- package/rules/.source/quicktvui/src/series/QTMediaSeriesVip.ts +4 -0
- package/rules/.source/quicktvui/src/series/QtMediaSeriesAPI.ts +140 -0
- package/rules/.source/quicktvui/src/series/component/media-series.vue +160 -0
- package/rules/.source/quicktvui/src/series/index.vue +316 -0
- package/rules/.source/quicktvui/src/series/item/media-series-number-item.vue +212 -0
- package/rules/.source/quicktvui/src/series/item/media-series-text-item.vue +239 -0
- package/rules/.source/quicktvui/src/tab/QTITab.ts +163 -0
- package/rules/.source/quicktvui/src/tab/QTTab.ts +8 -0
- package/rules/.source/quicktvui/src/tab/QTTabDataManager.ts +620 -0
- package/rules/.source/quicktvui/src/tab/QTTabEvent.ts +11 -0
- package/rules/.source/quicktvui/src/tab/QTTabEventParams.ts +12 -0
- package/rules/.source/quicktvui/src/tab/QTTabIndex.ts +8 -0
- package/rules/.source/quicktvui/src/tab/QTTabItem.ts +5 -0
- package/rules/.source/quicktvui/src/tab/QTTabItemType.ts +3 -0
- package/rules/.source/quicktvui/src/tab/QTTabPage.ts +5 -0
- package/rules/.source/quicktvui/src/tab/QTTabPageData.ts +11 -0
- package/rules/.source/quicktvui/src/tab/QTTabPageDataState.ts +8 -0
- package/rules/.source/quicktvui/src/tab/QTTabPageState.ts +8 -0
- package/rules/.source/quicktvui/src/tab/QtTabAPI.ts +578 -0
- package/rules/.source/quicktvui/src/tab/index.vue +1561 -0
- package/rules/.source/quicktvui/src/tab/useQtTabWatch.ts +203 -0
- package/rules/.source/quicktvui/src/text/QTIText.ts +12 -0
- package/rules/.source/quicktvui/src/text/QTTextSpan.ts +6 -0
- package/rules/.source/quicktvui/src/text/QTTextSpanAttribute.ts +6 -0
- package/rules/.source/quicktvui/src/text/QTTextSpanAttributeType.ts +4 -0
- package/rules/.source/quicktvui/src/text/QtTextAPI.ts +90 -0
- package/rules/.source/quicktvui/src/text/index.vue +44 -0
- package/rules/.source/quicktvui/src/theme/button.css +195 -0
- package/rules/.source/quicktvui/src/typings/shims-vue.d.ts +6 -0
- package/rules/.source/quicktvui/src/ul/QTIUL.ts +34 -0
- package/rules/.source/quicktvui/src/ul/QTULInitPosition.ts +3 -0
- package/rules/.source/quicktvui/src/ul/QtULAPI.ts +232 -0
- package/rules/.source/quicktvui/src/utils/QtVirtualViewAPI.ts +32 -0
- package/rules/.source/quicktvui/src/utils/VirtualView.ts +124 -0
- package/rules/.source/quicktvui/src/utils/functions.ts +1 -0
- package/rules/.source/quicktvui/src/utils/index.ts +3 -0
- package/rules/.source/quicktvui/src/utils/make-installer.ts +16 -0
- package/rules/.source/quicktvui/src/utils/objects.ts +4 -0
- package/rules/.source/quicktvui/src/utils/type.ts +1 -0
- package/rules/.source/quicktvui/src/utils/types.ts +42 -0
- package/rules/.source/quicktvui/src/utils/utils.ts +62 -0
- package/rules/.source/quicktvui/src/utils/vue/index.ts +3 -0
- package/rules/.source/quicktvui/src/utils/vue/install.ts +48 -0
- package/rules/.source/quicktvui/src/utils/vue/props/index.ts +3 -0
- package/rules/.source/quicktvui/src/utils/vue/props/runtime.ts +129 -0
- package/rules/.source/quicktvui/src/utils/vue/props/types.ts +165 -0
- package/rules/.source/quicktvui/src/utils/vue/props/util.ts +10 -0
- package/rules/.source/quicktvui/src/utils/vue/typescript.ts +9 -0
- package/rules/.source/quicktvui/src/view/QTIView.ts +3 -0
- package/rules/.source/quicktvui/src/view/QTIViewVisibility.ts +5 -0
- package/rules/.source/quicktvui/src/view/QTViewEvent.ts +3 -0
- package/rules/.source/quicktvui/src/view/QTViewState.ts +12 -0
- package/rules/.source/quicktvui/src/view/QtViewAPI.ts +9 -0
- package/rules/.source/quicktvui/src/view/index.vue +24 -0
- package/rules/.source/quicktvui/src/waterfall/QtWaterfallAPI.ts +219 -0
- package/rules/.source/quicktvui/src/waterfall/README.md +143 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTIWaterfall.ts +49 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTScrollState.ts +5 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfall.ts +13 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallCardItem.ts +11 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallCardPlaceHolder.ts +10 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallCardSection.ts +12 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallDataAdapter.ts +195 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallDataManager.ts +305 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallEvent.ts +11 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallFlexStyle.ts +19 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallIndex.ts +7 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallItem.ts +9 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallItemType.ts +7 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallPlaceholder.ts +5 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallPluginItem.ts +9 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallPluginSection.ts +8 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallSection.ts +17 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallSectionType.ts +14 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallTabItem.ts +10 -0
- package/rules/.source/quicktvui/src/waterfall/core/QTWaterfallVisibleType.ts +7 -0
- package/rules/.source/quicktvui/src/waterfall/index.vue +704 -0
- package/rules/.source/quicktvui/src/waterfall/item/card-item.vue +49 -0
- package/rules/.source/quicktvui/src/waterfall/item/plugin-item.vue +52 -0
- package/rules/.source/quicktvui/src/waterfall/section/blank-section.vue +27 -0
- package/rules/.source/quicktvui/src/waterfall/section/card-section.vue +81 -0
- package/rules/.source/quicktvui/src/waterfall/section/end-section.vue +50 -0
- package/rules/.source/quicktvui/src/waterfall/section/flex-section.vue +167 -0
- package/rules/.source/quicktvui/src/waterfall/section/list-section.vue +247 -0
- package/rules/.source/quicktvui/src/waterfall/section/loading-section.vue +34 -0
- package/rules/.source/quicktvui/src/waterfall/section/plugin-section.vue +87 -0
- package/rules/.source/quicktvui/src/waterfall/section/section-title.vue +63 -0
- package/rules/.source/quicktvui/src/waterfall/section/vue-section.vue +44 -0
- package/rules/.source/quicktvui/src/webview/QTIWebView.ts +199 -0
- package/rules/.source/quicktvui/src/webview/QTWebView.ts +957 -0
- package/rules/.source/quicktvui/src/webview/QTWebViewInterceptRule.ts +4 -0
- package/rules/.source/quicktvui/src/webview/QTWebViewLayerType.ts +6 -0
- package/rules/.source/quicktvui/src/webview/QTWebViewSniffingRule.ts +18 -0
- package/rules/.source/quicktvui/src/webview/QtWebViewAPI.ts +1963 -0
- package/rules/.source/quicktvui/src/x5webview/QTIX5WebView.ts +211 -0
- package/rules/.source/quicktvui/src/x5webview/QTX5WebView.ts +1014 -0
- package/rules/.source/quicktvui/src/x5webview/QTX5WebViewInterceptRule.ts +4 -0
- package/rules/.source/quicktvui/src/x5webview/QTX5WebViewLayerType.ts +6 -0
- package/rules/.source/quicktvui/src/x5webview/QTX5WebViewSniffingRule.ts +18 -0
- package/rules/.source/quicktvui/src/x5webview/QtX5WebViewAPI.ts +2015 -0
- package/rules/.source/quicktvui/tsconfig.json +34 -0
- package/rules/.source/quicktvui/web-types.json +1 -0
- package/rules/.source/quicktvui/yarn.lock +72 -0
- package/rules/.source/web/audio/index.ts +9 -0
- package/rules/.source/web/audio/src/audio.ts +34 -0
- package/rules/.source/web/audio/src/audio.vue +146 -0
- package/rules/.source/web/audio/src/instance.ts +3 -0
- package/rules/.source/web/audio-service/index.ts +10 -0
- package/rules/.source/web/audio-service/src/audio-service.ts +34 -0
- package/rules/.source/web/audio-service/src/audio-service.vue +115 -0
- package/rules/.source/web/audio-service/src/instance.ts +3 -0
- package/rules/.source/web/base/index.ts +1 -0
- package/rules/.source/web/base/src/base-types.ts +1 -0
- package/rules/.source/web/component.ts +25 -0
- package/rules/.source/web/docs/h.txt +6 -0
- package/rules/.source/web/docs/video.txt +88 -0
- package/rules/.source/web/h1/index.ts +9 -0
- package/rules/.source/web/h1/src/h1.ts +9 -0
- package/rules/.source/web/h1/src/h1.vue +30 -0
- package/rules/.source/web/h1/src/instance.ts +3 -0
- package/rules/.source/web/h2/index.ts +9 -0
- package/rules/.source/web/h2/src/h2.ts +9 -0
- package/rules/.source/web/h2/src/h2.vue +30 -0
- package/rules/.source/web/h2/src/instance.ts +3 -0
- package/rules/.source/web/h3/index.ts +9 -0
- package/rules/.source/web/h3/src/h3.ts +9 -0
- package/rules/.source/web/h3/src/h3.vue +30 -0
- package/rules/.source/web/h3/src/instance.ts +3 -0
- package/rules/.source/web/h4/index.ts +9 -0
- package/rules/.source/web/h4/src/h4.ts +9 -0
- package/rules/.source/web/h4/src/h4.vue +30 -0
- package/rules/.source/web/h4/src/instance.ts +3 -0
- package/rules/.source/web/h5/index.ts +9 -0
- package/rules/.source/web/h5/src/h5.ts +9 -0
- package/rules/.source/web/h5/src/h5.vue +30 -0
- package/rules/.source/web/h5/src/instance.ts +3 -0
- package/rules/.source/web/h6/index.ts +9 -0
- package/rules/.source/web/h6/src/h6.ts +9 -0
- package/rules/.source/web/h6/src/h6.vue +30 -0
- package/rules/.source/web/h6/src/instance.ts +3 -0
- package/rules/.source/web/index.ts +84 -0
- package/rules/.source/web/package.json +24 -0
- package/rules/.source/web/plugin.ts +3 -0
- package/rules/.source/web/rollup.config.js +37 -0
- package/rules/.source/web/shims-vue.d.ts +6 -0
- package/rules/.source/web/source/index.ts +9 -0
- package/rules/.source/web/source/src/instance.ts +3 -0
- package/rules/.source/web/source/src/source.ts +17 -0
- package/rules/.source/web/source/src/source.vue +19 -0
- package/rules/.source/web/tsconfig.json +34 -0
- package/rules/.source/web/utils/functions.ts +1 -0
- package/rules/.source/web/utils/index.ts +3 -0
- package/rules/.source/web/utils/make-installer.ts +16 -0
- package/rules/.source/web/utils/objects.ts +4 -0
- package/rules/.source/web/utils/types.ts +42 -0
- package/rules/.source/web/utils/vue/index.ts +3 -0
- package/rules/.source/web/utils/vue/install.ts +48 -0
- package/rules/.source/web/utils/vue/props/index.ts +3 -0
- package/rules/.source/web/utils/vue/props/runtime.ts +129 -0
- package/rules/.source/web/utils/vue/props/types.ts +165 -0
- package/rules/.source/web/utils/vue/props/util.ts +10 -0
- package/rules/.source/web/utils/vue/typescript.ts +9 -0
- package/rules/.source/web/video/index.ts +9 -0
- package/rules/.source/web/video/src/instance.ts +3 -0
- package/rules/.source/web/video/src/video.ts +34 -0
- package/rules/.source/web/video/src/video.vue +171 -0
- package/rules/.windsurfrules +16 -1
- package/rules/AGENTS.md +16 -1
- package/rules/CLAUDE.md +10 -1
- package/rules/GEMINI.md +44 -460
|
@@ -0,0 +1,1623 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseBackgroundImage,
|
|
3
|
+
parseTransform,
|
|
4
|
+
parseBorder,
|
|
5
|
+
parseFocusBorder,
|
|
6
|
+
parseBackground,
|
|
7
|
+
PROPERTIES_MAP,
|
|
8
|
+
PropertiesMapType,
|
|
9
|
+
convertToAndroidHexColor,
|
|
10
|
+
parseBorderRadius,
|
|
11
|
+
} from "@extscreen/es3-vue-style-parser";
|
|
12
|
+
import { toRaw } from "@vue/runtime-core";
|
|
13
|
+
import { isFunction, isString } from "@vue/shared";
|
|
14
|
+
|
|
15
|
+
import type {
|
|
16
|
+
CallbackType,
|
|
17
|
+
NativeNode,
|
|
18
|
+
NativeNodeProps,
|
|
19
|
+
NeedToTyped,
|
|
20
|
+
} from "../../types";
|
|
21
|
+
import { IS_PROD, NATIVE_COMPONENT_MAP } from "../../config";
|
|
22
|
+
import {
|
|
23
|
+
capitalizeFirstLetter,
|
|
24
|
+
convertImageLocalPath,
|
|
25
|
+
deepCopy,
|
|
26
|
+
getBeforeRenderToNative,
|
|
27
|
+
getBeforeLoadStyle,
|
|
28
|
+
getStyleClassList,
|
|
29
|
+
isStyleMatched,
|
|
30
|
+
setsAreEqual,
|
|
31
|
+
tryConvertNumber,
|
|
32
|
+
unicodeToChar,
|
|
33
|
+
warn,
|
|
34
|
+
whitespaceFilter,
|
|
35
|
+
} from "../../util";
|
|
36
|
+
import { isRTL } from "../../util/i18n";
|
|
37
|
+
import { EventHandlerType, EventMethod } from "../../util/event";
|
|
38
|
+
import { getHippyCachedInstance } from "../../util/instance";
|
|
39
|
+
import { getTagComponent, TagComponent } from "../component";
|
|
40
|
+
import {
|
|
41
|
+
eventIsKeyboardEvent,
|
|
42
|
+
FocusEvent,
|
|
43
|
+
HippyEvent,
|
|
44
|
+
HippyLoadResourceEvent,
|
|
45
|
+
} from "../event/hippy-event";
|
|
46
|
+
import type { EventListenerOptions } from "../event/hippy-event-target";
|
|
47
|
+
import { Native } from "../native";
|
|
48
|
+
import {
|
|
49
|
+
convertToNativeNodesReturnedVal,
|
|
50
|
+
HippyNode,
|
|
51
|
+
NodeType,
|
|
52
|
+
} from "../node/hippy-node";
|
|
53
|
+
import { getCssMap, getGlobalCssMapVersion } from "../style/css-map";
|
|
54
|
+
import { HippyText } from "../text/hippy-text";
|
|
55
|
+
import { info } from "../style/log";
|
|
56
|
+
import { resolveStyle } from "../style/css-resolve-style";
|
|
57
|
+
import { percentProps } from "../style/css-resolve-percent-style";
|
|
58
|
+
import { remProps } from "../style/css-resolve-rem-style";
|
|
59
|
+
import { HippyEventDispatcher } from "../event/hippy-event-dispatcher";
|
|
60
|
+
|
|
61
|
+
interface OffsetMapType {
|
|
62
|
+
textShadowOffsetX: string;
|
|
63
|
+
textShadowOffsetY: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* parse text shadow offset
|
|
68
|
+
*
|
|
69
|
+
* @param property - property name
|
|
70
|
+
* @param value - property value
|
|
71
|
+
* @param rawStyle - original style
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
function parseTextShadowOffset(
|
|
75
|
+
property: keyof OffsetMapType,
|
|
76
|
+
value = 0,
|
|
77
|
+
rawStyle: NativeNodeProps,
|
|
78
|
+
): (string | { [key: string]: number })[] {
|
|
79
|
+
const style = rawStyle;
|
|
80
|
+
const offsetMap: OffsetMapType = {
|
|
81
|
+
textShadowOffsetX: "width",
|
|
82
|
+
textShadowOffsetY: "height",
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
style.textShadowOffset = style.textShadowOffset ?? {};
|
|
86
|
+
|
|
87
|
+
Object.assign(style.textShadowOffset, {
|
|
88
|
+
[offsetMap[property]]: value,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return ["textShadowOffset", style.textShadowOffset];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Handle special cases of text input component
|
|
96
|
+
*
|
|
97
|
+
* @param node - text input element
|
|
98
|
+
* @param rawStyle - original style
|
|
99
|
+
*/
|
|
100
|
+
function parseTextInputComponent(
|
|
101
|
+
node: HippyElement,
|
|
102
|
+
rawStyle: NativeNodeProps,
|
|
103
|
+
) {
|
|
104
|
+
const style = rawStyle;
|
|
105
|
+
|
|
106
|
+
// text input components need to support right-to-left text writing
|
|
107
|
+
if (node.component.name === NATIVE_COMPONENT_MAP.TextInput) {
|
|
108
|
+
if (isRTL()) {
|
|
109
|
+
if (!style.textAlign) {
|
|
110
|
+
style.textAlign = "right";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Handle special cases of view component
|
|
118
|
+
*
|
|
119
|
+
* @param node - hippy element
|
|
120
|
+
* @param rawNativeNode - native node
|
|
121
|
+
* @param rawStyle - original style
|
|
122
|
+
*/
|
|
123
|
+
// eslint-disable-next-line complexity
|
|
124
|
+
function parseViewComponent(
|
|
125
|
+
node: HippyElement,
|
|
126
|
+
rawNativeNode: Partial<NativeNode>,
|
|
127
|
+
rawStyle: NativeNodeProps,
|
|
128
|
+
) {
|
|
129
|
+
const nativeNode = rawNativeNode;
|
|
130
|
+
const style = rawStyle;
|
|
131
|
+
|
|
132
|
+
if (node.component.name === NATIVE_COMPONENT_MAP.View) {
|
|
133
|
+
// If the scroll property is included in the style of the view component,
|
|
134
|
+
// convert it to ScrollView at this time. View does not support scrolling.
|
|
135
|
+
if (style.overflowX === "scroll" && style.overflowY === "scroll") {
|
|
136
|
+
warn("overflow-x and overflow-y for View can not work together");
|
|
137
|
+
}
|
|
138
|
+
if (style.overflowY === "scroll") {
|
|
139
|
+
nativeNode.name = "ScrollView";
|
|
140
|
+
} else if (style.overflowX === "scroll") {
|
|
141
|
+
nativeNode.name = "ScrollView";
|
|
142
|
+
// Necessary for horizontal scrolling
|
|
143
|
+
if (nativeNode.props) {
|
|
144
|
+
nativeNode.props.horizontal = true;
|
|
145
|
+
}
|
|
146
|
+
// Change flexDirection to row-reverse if display direction is right to left.
|
|
147
|
+
style.flexDirection = isRTL() ? "row-reverse" : "row";
|
|
148
|
+
}
|
|
149
|
+
// Change the ScrollView child collapsable attribute
|
|
150
|
+
if (nativeNode.name === "ScrollView") {
|
|
151
|
+
if (node.childNodes.length !== 1) {
|
|
152
|
+
warn("Only one child node is acceptable for View with overflow");
|
|
153
|
+
}
|
|
154
|
+
if (node.childNodes.length && node.nodeType === NodeType.ElementNode) {
|
|
155
|
+
(node.childNodes[0] as HippyElement).setStyle("collapsable", false);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// TODO backgroundImage would use local path if webpack file-loader active, which needs native support
|
|
159
|
+
if (style.backgroundImage) {
|
|
160
|
+
style.backgroundImage = convertImageLocalPath(
|
|
161
|
+
style.backgroundImage as string,
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function transverseEventNames(eventNames, callback) {
|
|
168
|
+
if (typeof eventNames !== "string") return;
|
|
169
|
+
const events = eventNames.split(",");
|
|
170
|
+
for (let i = 0, l = events.length; i < l; i += 1) {
|
|
171
|
+
const eventName = events[i].trim();
|
|
172
|
+
callback(eventName);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function createEventListener(nativeName, originalName) {
|
|
177
|
+
return (event) => {
|
|
178
|
+
const { id, currentId, params, eventPhase } = event;
|
|
179
|
+
const dispatcherEvent = {
|
|
180
|
+
id,
|
|
181
|
+
nativeName,
|
|
182
|
+
originalName,
|
|
183
|
+
currentId,
|
|
184
|
+
params,
|
|
185
|
+
eventPhase,
|
|
186
|
+
};
|
|
187
|
+
HippyEventDispatcher.receiveComponentEvent(dispatcherEvent, event);
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* HippyElement
|
|
193
|
+
*
|
|
194
|
+
* @public
|
|
195
|
+
*/
|
|
196
|
+
export class HippyElement extends HippyNode {
|
|
197
|
+
// element tag name, such as div, ul, hi-swiper, etc.
|
|
198
|
+
public tagName: string;
|
|
199
|
+
|
|
200
|
+
// id
|
|
201
|
+
public id = "";
|
|
202
|
+
|
|
203
|
+
// style list, such as class="wrapper red" => ['wrapper', 'red']
|
|
204
|
+
public classList: Set<string>;
|
|
205
|
+
|
|
206
|
+
// attributes
|
|
207
|
+
public attributes: NativeNodeProps;
|
|
208
|
+
|
|
209
|
+
// style
|
|
210
|
+
public style: NativeNodeProps;
|
|
211
|
+
//--------------------------静态CSS缓存--------------------------------------------
|
|
212
|
+
// style cache
|
|
213
|
+
private __cssMatchedStyleCache?: {
|
|
214
|
+
normal: NativeNodeProps;
|
|
215
|
+
important: NativeNodeProps;
|
|
216
|
+
__pseudo__: Record<string, NativeNodeProps>;
|
|
217
|
+
} | null = null;
|
|
218
|
+
private __cssMatchedStyleVersion?: number; // 缓存版本控制
|
|
219
|
+
|
|
220
|
+
// 手动清除缓存的方法(当 className / inlineStyle 改变时应调用)
|
|
221
|
+
public invalidateStyleCache() {
|
|
222
|
+
this.__cssMatchedStyleCache = null;
|
|
223
|
+
this.__cssMatchedStyleVersion = -1;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
//---------------------------动态百分、Rem等解析后的样式缓存-------------------------------------------
|
|
227
|
+
private __inlineStyleDirty = false;
|
|
228
|
+
|
|
229
|
+
public isInlineStyleDirty(): boolean {
|
|
230
|
+
return this.__inlineStyleDirty;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
public markInlineStyleClean(): void {
|
|
234
|
+
this.__inlineStyleDirty = false;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
public markInlineStyleDirty(): void {
|
|
238
|
+
this.__inlineStyleDirty = true;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
private __resolvedStyleCache: NativeNodeProps | null = null;
|
|
242
|
+
private __resolvedStyleVersion?: number; // 缓存版本控制
|
|
243
|
+
|
|
244
|
+
// 手动清除缓存的方法(当 设计到宽高比属性改变时应调用)
|
|
245
|
+
public invalidateResolvedStyleCache() {
|
|
246
|
+
this.__resolvedStyleCache = null;
|
|
247
|
+
this.__resolvedStyleVersion = -1;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
public getResolvedStyle() {
|
|
251
|
+
return this.__resolvedStyleCache;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
//----------------------------------------------------------------------
|
|
255
|
+
// events map
|
|
256
|
+
public events: NativeNodeProps;
|
|
257
|
+
|
|
258
|
+
// element content for text element
|
|
259
|
+
public value?: string;
|
|
260
|
+
|
|
261
|
+
// additional processing of properties
|
|
262
|
+
public filterAttribute?: CallbackType;
|
|
263
|
+
|
|
264
|
+
// polyFill of native event
|
|
265
|
+
protected polyfillNativeEvents?: (
|
|
266
|
+
method: string,
|
|
267
|
+
eventNames: string,
|
|
268
|
+
callback: CallbackType,
|
|
269
|
+
options?: EventListenerOptions,
|
|
270
|
+
) => {
|
|
271
|
+
eventNames: string;
|
|
272
|
+
callback: CallbackType;
|
|
273
|
+
options?: EventListenerOptions;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
//-----------------------------------------------
|
|
277
|
+
//伪类的状态
|
|
278
|
+
__pseudoActive__: Record<string, boolean> = {
|
|
279
|
+
"first-child": true,
|
|
280
|
+
empty: true,
|
|
281
|
+
"last-child": true,
|
|
282
|
+
"only-child": true,
|
|
283
|
+
"nth-child": true,
|
|
284
|
+
};
|
|
285
|
+
//支持的伪类
|
|
286
|
+
_pseudoClassDependencies?: Set<string> = new Set<string>(); // 比如: Set('focus', 'hover')
|
|
287
|
+
setPseudoState(pseudo: string, value: boolean) {
|
|
288
|
+
if (this._pseudoClassDependencies) {
|
|
289
|
+
const hasDirect = this._pseudoClassDependencies.has(pseudo);
|
|
290
|
+
const hasIndirectNot = Array.from(this._pseudoClassDependencies).some(
|
|
291
|
+
(dep) => {
|
|
292
|
+
return dep.startsWith("not(") && dep.includes(`:${pseudo}`);
|
|
293
|
+
},
|
|
294
|
+
);
|
|
295
|
+
if (!hasDirect && !hasIndirectNot) {
|
|
296
|
+
info(
|
|
297
|
+
"setPseudoState _pseudoClassDependencies has no pseudo or indirect not:",
|
|
298
|
+
pseudo,
|
|
299
|
+
);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (!this.__pseudoActive__) {
|
|
304
|
+
this.__pseudoActive__ = {};
|
|
305
|
+
}
|
|
306
|
+
const prev = this.__pseudoActive__[pseudo];
|
|
307
|
+
info("setPseudoState pseudo:", pseudo, "prev:", prev, "value:", value);
|
|
308
|
+
if (prev === value) {
|
|
309
|
+
return; // 值未变,不需要更新
|
|
310
|
+
}
|
|
311
|
+
this.__pseudoActive__[pseudo] = value;
|
|
312
|
+
//
|
|
313
|
+
this.markInlineStyleDirty();
|
|
314
|
+
//清除当前节点
|
|
315
|
+
this.invalidateResolvedStyleCache();
|
|
316
|
+
//清除孩子节点
|
|
317
|
+
this.invalidateChildrenResolvedStyleCache();
|
|
318
|
+
//更新节点
|
|
319
|
+
this.updateNativeNode();
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
//-----------------------------------------------
|
|
323
|
+
// style scoped id for element
|
|
324
|
+
private scopedIdList: NeedToTyped[] = [];
|
|
325
|
+
|
|
326
|
+
constructor(tagName: string) {
|
|
327
|
+
super(NodeType.ElementNode);
|
|
328
|
+
|
|
329
|
+
// tag name should be lowercase
|
|
330
|
+
this.tagName = tagName.toLowerCase();
|
|
331
|
+
this.style = {};
|
|
332
|
+
this.events = {};
|
|
333
|
+
this.beforeLoadStyle = getBeforeLoadStyle();
|
|
334
|
+
|
|
335
|
+
this.classList = new Set();
|
|
336
|
+
this.attributes = {};
|
|
337
|
+
|
|
338
|
+
// hack special problems
|
|
339
|
+
this.hackSpecialIssue();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// style preprocessor
|
|
343
|
+
public beforeLoadStyle: CallbackType;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* get component info
|
|
347
|
+
*/
|
|
348
|
+
public get component(): TagComponent {
|
|
349
|
+
// If the value has been taken, return directly
|
|
350
|
+
if (this.tagComponent) {
|
|
351
|
+
return this.tagComponent;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Otherwise, go to fetch and save
|
|
355
|
+
this.tagComponent = getTagComponent(this.tagName);
|
|
356
|
+
if (!this.tagComponent) {
|
|
357
|
+
throw new Error(
|
|
358
|
+
`组件 "${this.tagName}" 未注册或 Native 端未实现该组件。\n` +
|
|
359
|
+
`👉 请检查:\n` +
|
|
360
|
+
`1. 是否在 Vue 中通过 registerElement 注册了该组件;\n` +
|
|
361
|
+
`2. 是否在原生 Native 端正确实现并导出 "${this.tagName}" 所需组件。`,
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
return this.tagComponent;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
public isRootNode(): boolean {
|
|
368
|
+
const { rootContainer } = getHippyCachedInstance();
|
|
369
|
+
return super.isRootNode() || this.id === rootContainer;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* append child node
|
|
374
|
+
*
|
|
375
|
+
* @param child - child node
|
|
376
|
+
* @param isHydrate - is hydrate or not
|
|
377
|
+
*/
|
|
378
|
+
public appendChild(child: HippyNode, isHydrate = false): void {
|
|
379
|
+
// If the node type is text node, call setText method to set the text property
|
|
380
|
+
if (child instanceof HippyText) {
|
|
381
|
+
this.setText(child.text, { notToNative: true });
|
|
382
|
+
}
|
|
383
|
+
super.appendChild(child, isHydrate);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Insert the node before the specified node
|
|
388
|
+
*
|
|
389
|
+
* @param child - node to be added
|
|
390
|
+
* @param referenceNode - reference node
|
|
391
|
+
*/
|
|
392
|
+
public insertBefore(child: HippyNode, referenceNode: HippyNode | null): void {
|
|
393
|
+
// If the node type is text node, call setText method to set the text property
|
|
394
|
+
if (child instanceof HippyText) {
|
|
395
|
+
this.setText(child.text, { notToNative: true });
|
|
396
|
+
}
|
|
397
|
+
super.insertBefore(child, referenceNode);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* move child node before specified node
|
|
402
|
+
*
|
|
403
|
+
* @param child - child node that needs to be moved
|
|
404
|
+
* @param referenceNode - reference node
|
|
405
|
+
*/
|
|
406
|
+
public moveChild(child: HippyNode, referenceNode: HippyNode): void {
|
|
407
|
+
// If the node type is text node, call setText method to set the text property
|
|
408
|
+
if (child instanceof HippyText) {
|
|
409
|
+
this.setText(child.text, { notToNative: true });
|
|
410
|
+
}
|
|
411
|
+
super.moveChild(child, referenceNode);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* remove child node
|
|
416
|
+
*
|
|
417
|
+
* @param child - node to be removed
|
|
418
|
+
*/
|
|
419
|
+
public removeChild(child: HippyNode): void {
|
|
420
|
+
// If the node type is text node, call setText method to set the text property
|
|
421
|
+
if (child instanceof HippyText) {
|
|
422
|
+
this.setText("", { notToNative: true });
|
|
423
|
+
}
|
|
424
|
+
super.removeChild(child);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Check if an attribute is included
|
|
429
|
+
*
|
|
430
|
+
* @param key - attribute name
|
|
431
|
+
*/
|
|
432
|
+
public hasAttribute(key: string): boolean {
|
|
433
|
+
return !!this.attributes[key];
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* get value of attribute
|
|
438
|
+
*
|
|
439
|
+
* @param key - attribute name
|
|
440
|
+
*/
|
|
441
|
+
public getAttribute(key: string): NeedToTyped {
|
|
442
|
+
return this.attributes[key];
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* remove specified attribute
|
|
447
|
+
*
|
|
448
|
+
* @param key - attribute name
|
|
449
|
+
*/
|
|
450
|
+
public removeAttribute(key: string): void {
|
|
451
|
+
delete this.attributes[key];
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* set attribute
|
|
456
|
+
*
|
|
457
|
+
* @param rawKey - attribute name
|
|
458
|
+
* @param rawValue - attribute value
|
|
459
|
+
* @param options - options
|
|
460
|
+
*/
|
|
461
|
+
// eslint-disable-next-line complexity
|
|
462
|
+
public setAttribute(
|
|
463
|
+
rawKey: string,
|
|
464
|
+
rawValue: NeedToTyped,
|
|
465
|
+
options: NeedToTyped = {},
|
|
466
|
+
): void {
|
|
467
|
+
let value = rawValue;
|
|
468
|
+
let key = rawKey;
|
|
469
|
+
|
|
470
|
+
try {
|
|
471
|
+
// detect expandable attrs for boolean values
|
|
472
|
+
if (typeof this.attributes[key] === "boolean" && value === "") {
|
|
473
|
+
value = true;
|
|
474
|
+
}
|
|
475
|
+
if (key === undefined) {
|
|
476
|
+
!options.notToNative && this.updateNativeNode();
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
//liulipeng 清除样式缓存
|
|
481
|
+
if (key == "class" || key == "id") {
|
|
482
|
+
//
|
|
483
|
+
this.markInlineStyleDirty();
|
|
484
|
+
//清除当前节点
|
|
485
|
+
this.invalidateResolvedStyleCache();
|
|
486
|
+
//清除孩子节点
|
|
487
|
+
this.invalidateChildrenResolvedStyleCache();
|
|
488
|
+
//---------------------------------------------
|
|
489
|
+
this.invalidateStyleCache();
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
switch (key) {
|
|
493
|
+
case "class": {
|
|
494
|
+
const newClassList = new Set(getStyleClassList(value));
|
|
495
|
+
// If classList is not change, return directly
|
|
496
|
+
if (setsAreEqual(this.classList, newClassList)) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
this.classList = newClassList;
|
|
500
|
+
// update current node and child nodes
|
|
501
|
+
!options.notToNative && this.updateNativeNode(true);
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
case "id":
|
|
505
|
+
if (value === this.id) {
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
this.id = value;
|
|
509
|
+
// update current node and child nodes
|
|
510
|
+
!options.notToNative && this.updateNativeNode(true);
|
|
511
|
+
return;
|
|
512
|
+
// Convert text related to character for interface.
|
|
513
|
+
case "text":
|
|
514
|
+
case "value":
|
|
515
|
+
case "defaultValue":
|
|
516
|
+
case "placeholder": {
|
|
517
|
+
if (typeof value !== "string") {
|
|
518
|
+
try {
|
|
519
|
+
value = value.toString();
|
|
520
|
+
} catch (error) {
|
|
521
|
+
warn(
|
|
522
|
+
`Property ${key} must be string:${(error as Error).message}`,
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
if (!options || !options.textUpdate) {
|
|
527
|
+
// Only when non-text nodes are automatically updated,
|
|
528
|
+
value = whitespaceFilter(value);
|
|
529
|
+
}
|
|
530
|
+
value = unicodeToChar(value);
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
533
|
+
case "numberOfRows":
|
|
534
|
+
if (!Native.isIOS()) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
break;
|
|
538
|
+
case "caretColor":
|
|
539
|
+
case "caret-color":
|
|
540
|
+
key = "caret-color";
|
|
541
|
+
value = Native.parseColor(value);
|
|
542
|
+
break;
|
|
543
|
+
case "break-strategy":
|
|
544
|
+
key = "breakStrategy";
|
|
545
|
+
break;
|
|
546
|
+
case "placeholderTextColor":
|
|
547
|
+
case "placeholder-text-color":
|
|
548
|
+
key = "placeholderTextColor";
|
|
549
|
+
value = Native.parseColor(value);
|
|
550
|
+
break;
|
|
551
|
+
case "underlineColorAndroid":
|
|
552
|
+
case "underline-color-android":
|
|
553
|
+
key = "underlineColorAndroid";
|
|
554
|
+
value = Native.parseColor(value);
|
|
555
|
+
break;
|
|
556
|
+
case "nativeBackgroundAndroid": {
|
|
557
|
+
const nativeBackgroundAndroid = value;
|
|
558
|
+
if (typeof nativeBackgroundAndroid.color !== "undefined") {
|
|
559
|
+
nativeBackgroundAndroid.color = Native.parseColor(
|
|
560
|
+
nativeBackgroundAndroid.color,
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
key = "nativeBackgroundAndroid";
|
|
564
|
+
value = nativeBackgroundAndroid;
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
case "gradientBackground": {
|
|
568
|
+
if (value.colors && value.colors.length > 0) {
|
|
569
|
+
const values = value.colors.map(convertToAndroidHexColor);
|
|
570
|
+
value.colors = values;
|
|
571
|
+
}
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
574
|
+
default:
|
|
575
|
+
break;
|
|
576
|
+
}
|
|
577
|
+
//
|
|
578
|
+
if (this.attributes[key] === value) return;
|
|
579
|
+
this.attributes[key] = value;
|
|
580
|
+
//
|
|
581
|
+
if (typeof this.filterAttribute === "function") {
|
|
582
|
+
this.filterAttribute(this.attributes);
|
|
583
|
+
}
|
|
584
|
+
!options.notToNative && this.updateNativeNode();
|
|
585
|
+
} catch (err) {
|
|
586
|
+
// Throw error in development mode
|
|
587
|
+
if (!IS_PROD) {
|
|
588
|
+
throw err;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* set text
|
|
595
|
+
*
|
|
596
|
+
* @param text - text content
|
|
597
|
+
* @param options - options
|
|
598
|
+
*/
|
|
599
|
+
public setText(text: string, options: NeedToTyped = {}): void {
|
|
600
|
+
return this.setAttribute("text", text, {
|
|
601
|
+
notToNative: !!options.notToNative,
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* remove style attr
|
|
607
|
+
*/
|
|
608
|
+
public removeInlineStyle(notToNative = false): void {
|
|
609
|
+
// remove all style
|
|
610
|
+
this.style = {};
|
|
611
|
+
if (!notToNative) {
|
|
612
|
+
this.updateNativeNode();
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* set styles batch
|
|
618
|
+
*
|
|
619
|
+
* @param batchStyles - batched style to set
|
|
620
|
+
*/
|
|
621
|
+
public setInlineStyle(batchStyles) {
|
|
622
|
+
if (!batchStyles || typeof batchStyles !== "object") {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
let hasSensitive = false;
|
|
626
|
+
let hasSensitiveValueChanged = false;
|
|
627
|
+
|
|
628
|
+
const keys = Object.keys(batchStyles);
|
|
629
|
+
|
|
630
|
+
for (const key of keys) {
|
|
631
|
+
const newVal = batchStyles[key];
|
|
632
|
+
const oldVal = this.style[key];
|
|
633
|
+
// 判断是否是敏感样式
|
|
634
|
+
const isSensitive = percentProps.includes(key) || remProps.includes(key);
|
|
635
|
+
if (isSensitive) {
|
|
636
|
+
hasSensitive = true;
|
|
637
|
+
// 判断值是否真正发生变化(比如从 '50%' -> '50%' 就不算变)
|
|
638
|
+
if (newVal !== oldVal) {
|
|
639
|
+
hasSensitiveValueChanged = true;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
// 决定是否失效缓存
|
|
644
|
+
if (hasSensitiveValueChanged) {
|
|
645
|
+
this.markInlineStyleDirty();
|
|
646
|
+
//清除当前节点
|
|
647
|
+
this.invalidateResolvedStyleCache();
|
|
648
|
+
//清除孩子节点
|
|
649
|
+
this.invalidateChildrenResolvedStyleCache();
|
|
650
|
+
} else {
|
|
651
|
+
// 非敏感变动或敏感但值未变,只需合并样式,不刷新解析缓存
|
|
652
|
+
this.markInlineStyleDirty();
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// 应用新样式
|
|
656
|
+
Object.keys(batchStyles).forEach((styleKey) => {
|
|
657
|
+
const styleValue = batchStyles[styleKey];
|
|
658
|
+
this.setStyle(styleKey, styleValue, true);
|
|
659
|
+
});
|
|
660
|
+
// 注意:是否需要触发 updateNativeNode
|
|
661
|
+
// 只有真正发生敏感变动才需要触发递归 update,否则仅当前节点更新即可
|
|
662
|
+
this.updateNativeNode(hasSensitiveValueChanged);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* 清空所有孩子节点解析完毕的样式
|
|
667
|
+
*/
|
|
668
|
+
private invalidateChildrenResolvedStyleCache(): void {
|
|
669
|
+
this.eachNode((child) => {
|
|
670
|
+
if (child instanceof HippyElement) {
|
|
671
|
+
child.invalidateResolvedStyleCache();
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* 在 HTML/CSS 或类 DOM 系统中,inline style 指的是直接写在组件/节点上的样式
|
|
678
|
+
* get the inline style
|
|
679
|
+
*/
|
|
680
|
+
getInlineStyle(): NativeNodeProps {
|
|
681
|
+
const nodeStyle: NativeNodeProps = {};
|
|
682
|
+
|
|
683
|
+
Object.keys(this.style).forEach((key) => {
|
|
684
|
+
const styleValue = toRaw(this.style[key]);
|
|
685
|
+
if (styleValue !== undefined) {
|
|
686
|
+
nodeStyle[key] = styleValue;
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
|
|
690
|
+
return nodeStyle;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
updateInlineStyle(batchStyles): void {
|
|
694
|
+
Object.keys(batchStyles).forEach((styleKey) => {
|
|
695
|
+
if (this.style) {
|
|
696
|
+
const styleValue = batchStyles[styleKey];
|
|
697
|
+
this.style[styleKey] = styleValue;
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* set style
|
|
704
|
+
*
|
|
705
|
+
* @param property - property name
|
|
706
|
+
* @param value - property value
|
|
707
|
+
* @param notToNative - not pass to native
|
|
708
|
+
*/
|
|
709
|
+
// eslint-disable-next-line complexity
|
|
710
|
+
public setStyle(
|
|
711
|
+
property: string,
|
|
712
|
+
value: NeedToTyped,
|
|
713
|
+
notToNative = false,
|
|
714
|
+
): void {
|
|
715
|
+
if (value === undefined) {
|
|
716
|
+
delete this.style[property];
|
|
717
|
+
if (!notToNative) {
|
|
718
|
+
this.updateNativeNode();
|
|
719
|
+
}
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// 检测 value 是否含有 !important
|
|
724
|
+
let important = false;
|
|
725
|
+
try {
|
|
726
|
+
if (typeof value === "string" && value.includes("!important")) {
|
|
727
|
+
important = true;
|
|
728
|
+
value = value.replace(/\s*!important\s*$/, "").trim();
|
|
729
|
+
// ✅ 提示开发者无需使用 !important
|
|
730
|
+
console.warn(
|
|
731
|
+
`[setStyle] "${property}: ${value} !important" 中的 "!important" 会被忽略,` +
|
|
732
|
+
`因为 Inline Style 本身就具有最高优先级,无需显式使用 !important。`,
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
} catch (e) {}
|
|
736
|
+
|
|
737
|
+
// Preprocess the style
|
|
738
|
+
let { property: styleProperty, value: styleValue } = this.beforeLoadStyle({
|
|
739
|
+
property,
|
|
740
|
+
value,
|
|
741
|
+
});
|
|
742
|
+
// Process the specific style value
|
|
743
|
+
switch (styleProperty) {
|
|
744
|
+
case "fontWeight":
|
|
745
|
+
if (typeof styleValue !== "string") {
|
|
746
|
+
styleValue = styleValue.toString();
|
|
747
|
+
}
|
|
748
|
+
break;
|
|
749
|
+
case "backgroundImage": {
|
|
750
|
+
[styleProperty, styleValue] = parseBackgroundImage(
|
|
751
|
+
styleProperty,
|
|
752
|
+
styleValue,
|
|
753
|
+
);
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
case "background": {
|
|
757
|
+
[styleProperty, styleValue] = parseBackground(
|
|
758
|
+
styleProperty,
|
|
759
|
+
styleValue,
|
|
760
|
+
);
|
|
761
|
+
break;
|
|
762
|
+
}
|
|
763
|
+
case "border": {
|
|
764
|
+
const parsed = parseBorder(styleProperty, styleValue);
|
|
765
|
+
if (parsed && typeof parsed === "object") {
|
|
766
|
+
for (const [subProp, subVal] of Object.entries(parsed)) {
|
|
767
|
+
this.setStyle(subProp, subVal, true);
|
|
768
|
+
}
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
case "borderRadius": {
|
|
774
|
+
const parsed = parseBorderRadius(styleProperty, styleValue);
|
|
775
|
+
if (parsed && typeof parsed === "object") {
|
|
776
|
+
for (const [subProp, subVal] of Object.entries(parsed)) {
|
|
777
|
+
this.setStyle(subProp, subVal, true);
|
|
778
|
+
}
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
break;
|
|
782
|
+
}
|
|
783
|
+
case "focusBorder": {
|
|
784
|
+
const parsed = parseFocusBorder(styleProperty, styleValue);
|
|
785
|
+
if (parsed && typeof parsed === "object") {
|
|
786
|
+
for (const [subProp, subVal] of Object.entries(parsed)) {
|
|
787
|
+
this.setStyle(subProp, subVal, true);
|
|
788
|
+
}
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
break;
|
|
792
|
+
}
|
|
793
|
+
case "textShadowOffsetX":
|
|
794
|
+
case "textShadowOffsetY": {
|
|
795
|
+
[styleProperty, styleValue] = parseTextShadowOffset(
|
|
796
|
+
styleProperty,
|
|
797
|
+
styleValue,
|
|
798
|
+
this.style,
|
|
799
|
+
);
|
|
800
|
+
break;
|
|
801
|
+
}
|
|
802
|
+
case "textShadowOffset": {
|
|
803
|
+
const { x = 0, width = 0, y = 0, height = 0 } = styleValue ?? {};
|
|
804
|
+
styleValue = { width: x || width, height: y || height };
|
|
805
|
+
break;
|
|
806
|
+
}
|
|
807
|
+
case "transform": {
|
|
808
|
+
[styleProperty, styleValue] = parseTransform(styleProperty, styleValue);
|
|
809
|
+
break;
|
|
810
|
+
}
|
|
811
|
+
default: {
|
|
812
|
+
// Convert the property to W3C standard.
|
|
813
|
+
if (
|
|
814
|
+
Object.prototype.hasOwnProperty.call(PROPERTIES_MAP, styleProperty)
|
|
815
|
+
) {
|
|
816
|
+
styleProperty =
|
|
817
|
+
PROPERTIES_MAP[styleProperty as keyof PropertiesMapType];
|
|
818
|
+
}
|
|
819
|
+
// Convert the value
|
|
820
|
+
if (typeof styleValue === "string") {
|
|
821
|
+
styleValue = styleValue.trim();
|
|
822
|
+
// Convert inline color style to int
|
|
823
|
+
if (styleProperty.toLowerCase().indexOf("color") >= 0) {
|
|
824
|
+
styleValue = Native.parseColor(styleValue);
|
|
825
|
+
// Convert inline length style, drop the px unit
|
|
826
|
+
} else if (styleValue.endsWith("px")) {
|
|
827
|
+
styleValue = parseFloat(styleValue.slice(0, styleValue.length - 2));
|
|
828
|
+
} else {
|
|
829
|
+
styleValue = tryConvertNumber(styleValue);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// If the style value does not exist or is equal to the original value, return directly
|
|
836
|
+
if (
|
|
837
|
+
styleValue === undefined ||
|
|
838
|
+
styleValue === null ||
|
|
839
|
+
this.style[styleProperty] === styleValue
|
|
840
|
+
) {
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
this.style[styleProperty] = styleValue;
|
|
845
|
+
|
|
846
|
+
// directly update the native node
|
|
847
|
+
if (!notToNative) {
|
|
848
|
+
this.updateNativeNode();
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Scroll children to specific position.
|
|
854
|
+
*/
|
|
855
|
+
public scrollToPosition(
|
|
856
|
+
x: number | undefined = 0,
|
|
857
|
+
y: number | undefined = 0,
|
|
858
|
+
rawDuration: number | boolean = 1000,
|
|
859
|
+
): void {
|
|
860
|
+
if (typeof x !== "number" || typeof y !== "number") {
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
let duration = rawDuration;
|
|
864
|
+
|
|
865
|
+
if (duration === false) {
|
|
866
|
+
duration = 0;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
Native.callUIFunction(this, "scrollToWithOptions", [{ x, y, duration }]);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Native implementation for the Chrome/Firefox Element.scrollTop method
|
|
874
|
+
*/
|
|
875
|
+
public scrollTo(
|
|
876
|
+
x:
|
|
877
|
+
| number
|
|
878
|
+
| {
|
|
879
|
+
left: number;
|
|
880
|
+
top: number;
|
|
881
|
+
behavior: string;
|
|
882
|
+
duration: number | boolean;
|
|
883
|
+
},
|
|
884
|
+
y?: number,
|
|
885
|
+
duration?: number | boolean,
|
|
886
|
+
): void {
|
|
887
|
+
if (typeof x === "object" && x) {
|
|
888
|
+
const { left, top, behavior = "auto", duration: animationDuration } = x;
|
|
889
|
+
this.scrollToPosition(
|
|
890
|
+
left,
|
|
891
|
+
top,
|
|
892
|
+
behavior === "none" ? 0 : animationDuration,
|
|
893
|
+
);
|
|
894
|
+
} else {
|
|
895
|
+
this.scrollToPosition(x, y, duration);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
setListenerHandledType(key: string, type) {
|
|
900
|
+
if (this.events[key]) {
|
|
901
|
+
this.events[key].handledType = type;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
isListenerHandled(key: string, type) {
|
|
906
|
+
if (this.events[key] && type !== this.events[key].handledType) {
|
|
907
|
+
// if handledType not equals to type params, this event needs updated
|
|
908
|
+
// if handledType equals to undefined, this event needs created
|
|
909
|
+
return false;
|
|
910
|
+
}
|
|
911
|
+
// if event not existed, marked it has been handled
|
|
912
|
+
return true;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* parse vue event name to native event name and return
|
|
917
|
+
*
|
|
918
|
+
* @param eventName - vue event name
|
|
919
|
+
*/
|
|
920
|
+
getNativeEventName(eventName: string) {
|
|
921
|
+
let nativeEventName = `on${capitalizeFirstLetter(eventName)}`;
|
|
922
|
+
if (this.component) {
|
|
923
|
+
const { eventNamesMap } = this.component;
|
|
924
|
+
if (eventNamesMap?.get(eventName)) {
|
|
925
|
+
nativeEventName = eventNamesMap.get(eventName) as string;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
return nativeEventName;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* add element event listener
|
|
933
|
+
*
|
|
934
|
+
* @param rawEventNames - event names
|
|
935
|
+
* @param rawCallback - callback
|
|
936
|
+
* @param rawOptions - options
|
|
937
|
+
*/
|
|
938
|
+
public addEventListener(
|
|
939
|
+
rawEventNames: string,
|
|
940
|
+
rawCallback: CallbackType,
|
|
941
|
+
rawOptions?: EventListenerOptions,
|
|
942
|
+
): void {
|
|
943
|
+
let eventNames = rawEventNames;
|
|
944
|
+
let callback = rawCallback;
|
|
945
|
+
let options = rawOptions;
|
|
946
|
+
let isNeedUpdate = true;
|
|
947
|
+
// Added default scrollEventThrottle when scroll event is added.
|
|
948
|
+
if (
|
|
949
|
+
eventNames === "scroll" &&
|
|
950
|
+
!(this.getAttribute("scrollEventThrottle") > 0)
|
|
951
|
+
) {
|
|
952
|
+
this.attributes.scrollEventThrottle = 200;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
// get the native event name
|
|
956
|
+
const ssrEventName = this.getNativeEventName(eventNames);
|
|
957
|
+
if (this.attributes[ssrEventName]) {
|
|
958
|
+
// ssrEventName attribute exist means this is ssrNode, the native event props has been
|
|
959
|
+
// set before, unnecessary to update
|
|
960
|
+
isNeedUpdate = false;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
// If there is an event polyfill, override the event names, callback and options
|
|
964
|
+
if (typeof this.polyfillNativeEvents === "function") {
|
|
965
|
+
({ eventNames, callback, options } = this.polyfillNativeEvents(
|
|
966
|
+
EventMethod.ADD,
|
|
967
|
+
eventNames,
|
|
968
|
+
callback,
|
|
969
|
+
options,
|
|
970
|
+
));
|
|
971
|
+
}
|
|
972
|
+
super.addEventListener(eventNames, callback, options);
|
|
973
|
+
transverseEventNames(eventNames, (eventName) => {
|
|
974
|
+
const nativeEventName = this.getNativeEventName(eventName);
|
|
975
|
+
if (!this.events[nativeEventName]) {
|
|
976
|
+
this.events[nativeEventName] = {
|
|
977
|
+
name: nativeEventName,
|
|
978
|
+
type: EventHandlerType.ADD,
|
|
979
|
+
listener: createEventListener(nativeEventName, eventName),
|
|
980
|
+
isCapture: false,
|
|
981
|
+
};
|
|
982
|
+
} else if (
|
|
983
|
+
this.events[nativeEventName] &&
|
|
984
|
+
this.events[nativeEventName].type !== EventHandlerType.ADD
|
|
985
|
+
) {
|
|
986
|
+
this.events[nativeEventName].type = EventHandlerType.ADD;
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
// update native node
|
|
990
|
+
if (isNeedUpdate) {
|
|
991
|
+
this.updateNativeEvent();
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* remove event listener
|
|
997
|
+
*
|
|
998
|
+
* @param rawEventNames - event type
|
|
999
|
+
* @param rawCallback - callback
|
|
1000
|
+
* @param rawOptions - options
|
|
1001
|
+
*/
|
|
1002
|
+
public removeEventListener(
|
|
1003
|
+
rawEventNames: string,
|
|
1004
|
+
rawCallback: CallbackType,
|
|
1005
|
+
rawOptions?: EventListenerOptions,
|
|
1006
|
+
): void {
|
|
1007
|
+
let eventNames = rawEventNames;
|
|
1008
|
+
let callback = rawCallback;
|
|
1009
|
+
let options = rawOptions;
|
|
1010
|
+
// If there is an event polyfill, override the event names, callback and options
|
|
1011
|
+
if (typeof this.polyfillNativeEvents === "function") {
|
|
1012
|
+
({ eventNames, callback, options } = this.polyfillNativeEvents(
|
|
1013
|
+
EventMethod.REMOVE,
|
|
1014
|
+
eventNames,
|
|
1015
|
+
callback,
|
|
1016
|
+
options,
|
|
1017
|
+
));
|
|
1018
|
+
}
|
|
1019
|
+
super.removeEventListener(eventNames, callback, options);
|
|
1020
|
+
transverseEventNames(eventNames, (eventName) => {
|
|
1021
|
+
const nativeEventName = this.getNativeEventName(eventName);
|
|
1022
|
+
if (this.events[nativeEventName]) {
|
|
1023
|
+
this.events[nativeEventName].type = EventHandlerType.REMOVE;
|
|
1024
|
+
}
|
|
1025
|
+
});
|
|
1026
|
+
// get the native event insert before
|
|
1027
|
+
const ssrEventName = this.getNativeEventName(eventNames);
|
|
1028
|
+
if (this.attributes[ssrEventName]) {
|
|
1029
|
+
// remove exist ssr native event attr
|
|
1030
|
+
delete this.attributes[ssrEventName];
|
|
1031
|
+
}
|
|
1032
|
+
// update native node
|
|
1033
|
+
this.updateNativeEvent();
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* dispatch event
|
|
1038
|
+
*
|
|
1039
|
+
* @param rawEvent - event object
|
|
1040
|
+
*/
|
|
1041
|
+
public dispatchEvent(
|
|
1042
|
+
rawEvent: HippyEvent,
|
|
1043
|
+
targetNode: HippyElement,
|
|
1044
|
+
domEvent?: HippyTypes.DOMEvent,
|
|
1045
|
+
): void {
|
|
1046
|
+
const event = rawEvent;
|
|
1047
|
+
|
|
1048
|
+
event.currentTarget = this;
|
|
1049
|
+
|
|
1050
|
+
if (!event.target) {
|
|
1051
|
+
event.target = this;
|
|
1052
|
+
|
|
1053
|
+
// TODO: Does not cover all terminal events, so instanceof cannot be used here, simply bypass it first
|
|
1054
|
+
if (eventIsKeyboardEvent(event)) {
|
|
1055
|
+
(event.target as HippyElement).value = event.value;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
//---------------------伪类处理焦点事件---------------------------
|
|
1060
|
+
//focus
|
|
1061
|
+
if (event.type === "focus") {
|
|
1062
|
+
const focusEvent = event as FocusEvent;
|
|
1063
|
+
const isFocused = focusEvent.isFocused ?? false;
|
|
1064
|
+
|
|
1065
|
+
this.setPseudoState("focus", isFocused);
|
|
1066
|
+
}
|
|
1067
|
+
//loadEnd 图片处理自动宽高
|
|
1068
|
+
else if (event.type === "loadEnd" && this.tagName == "img") {
|
|
1069
|
+
//stop bubbles
|
|
1070
|
+
event.bubbles = false;
|
|
1071
|
+
const evt = event as HippyLoadResourceEvent;
|
|
1072
|
+
|
|
1073
|
+
const inlineStyle = this.getInlineStyle();
|
|
1074
|
+
const cssStyle = this.__cssMatchedStyleCache?.normal ?? {};
|
|
1075
|
+
|
|
1076
|
+
//
|
|
1077
|
+
const width = inlineStyle.width ?? cssStyle.width ?? this.style.width;
|
|
1078
|
+
const height = inlineStyle.height ?? cssStyle.height ?? this.style.height;
|
|
1079
|
+
|
|
1080
|
+
const hasWidth = width !== undefined;
|
|
1081
|
+
const hasHeight = height !== undefined;
|
|
1082
|
+
|
|
1083
|
+
// 仅当没有宽高时设置
|
|
1084
|
+
const image = evt.image;
|
|
1085
|
+
// image 宽高必须合法
|
|
1086
|
+
const imageWidth = typeof image?.width === "number" ? image.width : null;
|
|
1087
|
+
const imageHeight =
|
|
1088
|
+
typeof image?.height === "number" ? image.height : null;
|
|
1089
|
+
const aspectRatio =
|
|
1090
|
+
imageWidth && imageHeight ? imageWidth / imageHeight : null;
|
|
1091
|
+
|
|
1092
|
+
let didChange = false;
|
|
1093
|
+
|
|
1094
|
+
//
|
|
1095
|
+
let displayWidth = width;
|
|
1096
|
+
let displayHeight = height;
|
|
1097
|
+
|
|
1098
|
+
try {
|
|
1099
|
+
if (!hasWidth && !hasHeight && imageWidth && imageHeight) {
|
|
1100
|
+
// 宽高都没有 → 使用 image 的尺寸
|
|
1101
|
+
displayWidth = imageWidth;
|
|
1102
|
+
displayHeight = imageHeight;
|
|
1103
|
+
didChange = true;
|
|
1104
|
+
} else if (
|
|
1105
|
+
!hasWidth &&
|
|
1106
|
+
hasHeight &&
|
|
1107
|
+
imageWidth &&
|
|
1108
|
+
imageHeight &&
|
|
1109
|
+
aspectRatio
|
|
1110
|
+
) {
|
|
1111
|
+
// 仅缺宽度 → 用高度推宽度
|
|
1112
|
+
displayWidth = height * aspectRatio;
|
|
1113
|
+
displayHeight = height;
|
|
1114
|
+
didChange = true;
|
|
1115
|
+
} else if (
|
|
1116
|
+
hasWidth &&
|
|
1117
|
+
!hasHeight &&
|
|
1118
|
+
imageWidth &&
|
|
1119
|
+
imageHeight &&
|
|
1120
|
+
aspectRatio
|
|
1121
|
+
) {
|
|
1122
|
+
// 仅缺高度 → 用宽度推高度
|
|
1123
|
+
displayWidth = width;
|
|
1124
|
+
displayHeight = width / aspectRatio;
|
|
1125
|
+
didChange = true;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
// 只有宽高有更新时才触发更新
|
|
1129
|
+
if (didChange && image) {
|
|
1130
|
+
this.setInlineStyle({
|
|
1131
|
+
width: displayWidth,
|
|
1132
|
+
height: displayHeight,
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
} catch (e) {
|
|
1136
|
+
console.error(e);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
//--------------------------------------------------------------------------------------------
|
|
1140
|
+
this.emitEvent(event);
|
|
1141
|
+
|
|
1142
|
+
// event bubbling
|
|
1143
|
+
if (!event.bubbles && domEvent) {
|
|
1144
|
+
domEvent.stopPropagation();
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
//20251103
|
|
1148
|
+
try {
|
|
1149
|
+
if (this.parentNode && event.bubbles) {
|
|
1150
|
+
(this.parentNode as HippyElement).dispatchEvent.call(
|
|
1151
|
+
this.parentNode,
|
|
1152
|
+
event,
|
|
1153
|
+
targetNode,
|
|
1154
|
+
domEvent,
|
|
1155
|
+
);
|
|
1156
|
+
}
|
|
1157
|
+
} catch (e) {
|
|
1158
|
+
console.error(e);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* convert hippy vue node to Native Node
|
|
1164
|
+
*
|
|
1165
|
+
* @param isIncludeChild - should or no convert child node recursive
|
|
1166
|
+
*/
|
|
1167
|
+
public convertToNativeNodes(
|
|
1168
|
+
isIncludeChild: boolean,
|
|
1169
|
+
refInfo: HippyTypes.ReferenceInfo = {},
|
|
1170
|
+
): convertToNativeNodesReturnedVal {
|
|
1171
|
+
// If the node does not need to be inserted into native, return directly
|
|
1172
|
+
if (!this.isNeedInsertToNative) {
|
|
1173
|
+
return [[], [], []];
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
if (isIncludeChild) {
|
|
1177
|
+
return super.convertToNativeNodes(true, refInfo);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// get styles
|
|
1181
|
+
let style: NativeNodeProps = this.getNativeStyles();
|
|
1182
|
+
|
|
1183
|
+
if (this.parentNode && this.parentNode instanceof HippyElement) {
|
|
1184
|
+
// Implement attribute inheritance logic
|
|
1185
|
+
// Only inherit color and font properties
|
|
1186
|
+
const parentNodeStyle = this.parentNode.getResolvedStyle;
|
|
1187
|
+
const styleAttributes = [
|
|
1188
|
+
"color",
|
|
1189
|
+
"fontSize",
|
|
1190
|
+
"fontWeight",
|
|
1191
|
+
"fontFamily",
|
|
1192
|
+
"fontStyle",
|
|
1193
|
+
"textAlign",
|
|
1194
|
+
"lineHeight",
|
|
1195
|
+
];
|
|
1196
|
+
|
|
1197
|
+
if (parentNodeStyle) {
|
|
1198
|
+
styleAttributes.forEach((attribute) => {
|
|
1199
|
+
if (!style[attribute] && parentNodeStyle[attribute]) {
|
|
1200
|
+
style[attribute] = parentNodeStyle[attribute];
|
|
1201
|
+
}
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
getBeforeRenderToNative()(this, style);
|
|
1207
|
+
|
|
1208
|
+
/*
|
|
1209
|
+
* append defaultNativeStyle later to avoid incorrect compute style from
|
|
1210
|
+
* inherit node in beforeRenderToNative hook
|
|
1211
|
+
*/
|
|
1212
|
+
if (this.component.defaultNativeStyle) {
|
|
1213
|
+
const { defaultNativeStyle } = this.component;
|
|
1214
|
+
const updateStyle: NativeNodeProps = {};
|
|
1215
|
+
Object.keys(defaultNativeStyle).forEach((key) => {
|
|
1216
|
+
if (!this.getAttribute(key)) {
|
|
1217
|
+
// save no default value style
|
|
1218
|
+
updateStyle[key] = defaultNativeStyle[key];
|
|
1219
|
+
}
|
|
1220
|
+
});
|
|
1221
|
+
style = { ...updateStyle, ...style };
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
const elementExtraAttributes: Partial<NativeNode> = {
|
|
1225
|
+
name: this.component.name,
|
|
1226
|
+
props: {
|
|
1227
|
+
// node props
|
|
1228
|
+
...this.getNativeProps(),
|
|
1229
|
+
// node events
|
|
1230
|
+
...this.getNativeEvents(),
|
|
1231
|
+
// node style
|
|
1232
|
+
style,
|
|
1233
|
+
},
|
|
1234
|
+
tagName: this.tagName,
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
// hack in dev environment, added properties for chrome inspector debugging
|
|
1238
|
+
if (!IS_PROD) {
|
|
1239
|
+
if (elementExtraAttributes.props) {
|
|
1240
|
+
elementExtraAttributes.props.attributes = this.getNodeAttributes();
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
// handle special cases of text input components
|
|
1245
|
+
parseTextInputComponent(this, style);
|
|
1246
|
+
|
|
1247
|
+
// handle special cases of view component
|
|
1248
|
+
parseViewComponent(this, elementExtraAttributes, style);
|
|
1249
|
+
|
|
1250
|
+
return super.convertToNativeNodes(false, refInfo, elementExtraAttributes);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* When loaded via HMR or dynamically, redraw the element with the latest style map
|
|
1255
|
+
*/
|
|
1256
|
+
public repaintWithChildren(): void {
|
|
1257
|
+
this.updateNativeNode(true);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* set native style props
|
|
1262
|
+
*/
|
|
1263
|
+
public setNativeProps(nativeProps: NeedToTyped): void {
|
|
1264
|
+
if (nativeProps) {
|
|
1265
|
+
const { style } = nativeProps;
|
|
1266
|
+
this.setInlineStyle(style);
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Set pressed state
|
|
1272
|
+
*
|
|
1273
|
+
* @param pressed - whether to press
|
|
1274
|
+
*/
|
|
1275
|
+
public setPressed(pressed: boolean): void {
|
|
1276
|
+
Native.callUIFunction(this, "setPressed", [pressed]);
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* Set hot zone
|
|
1281
|
+
*
|
|
1282
|
+
* @param x - x coordinate
|
|
1283
|
+
* @param y - y coordinate
|
|
1284
|
+
*/
|
|
1285
|
+
public setHotspot(x: number, y: number): void {
|
|
1286
|
+
Native.callUIFunction(this, "setHotspot", [x, y]);
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* save scoped id for element
|
|
1291
|
+
*
|
|
1292
|
+
* @param scopeStyleId - scoped style id
|
|
1293
|
+
*/
|
|
1294
|
+
public setStyleScope(scopeStyleId: NeedToTyped): void {
|
|
1295
|
+
const scopedId =
|
|
1296
|
+
typeof scopeStyleId !== "string" ? scopeStyleId.toString() : scopeStyleId;
|
|
1297
|
+
if (scopedId && !this.scopedIdList.includes(scopedId)) {
|
|
1298
|
+
this.scopedIdList.push(scopedId);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* get style scoped id
|
|
1304
|
+
*/
|
|
1305
|
+
public get styleScopeId() {
|
|
1306
|
+
return this.scopedIdList;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* TODO LIULIPENG 样式解析入口
|
|
1311
|
+
* get the style attribute of the node according to the global style sheet
|
|
1312
|
+
*/
|
|
1313
|
+
private getNativeStyles(): NativeNodeProps {
|
|
1314
|
+
const version = getGlobalCssMapVersion();
|
|
1315
|
+
|
|
1316
|
+
// ✅ 样式未变,inlineStyle 有变化,需要合并
|
|
1317
|
+
if (
|
|
1318
|
+
this.__resolvedStyleVersion === version &&
|
|
1319
|
+
this.__resolvedStyleCache &&
|
|
1320
|
+
this.isInlineStyleDirty()
|
|
1321
|
+
) {
|
|
1322
|
+
const merged = { ...this.__resolvedStyleCache, ...this.getInlineStyle() };
|
|
1323
|
+
this.markInlineStyleClean();
|
|
1324
|
+
return merged;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
// ✅ 样式未变,无变动
|
|
1328
|
+
if (this.__resolvedStyleVersion === version && this.__resolvedStyleCache) {
|
|
1329
|
+
return this.__resolvedStyleCache;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
// 🚨 缓存失效,需要走解析
|
|
1333
|
+
const cssStyle = this.getMatchedCssStyleWithCache(); // 缓存部分
|
|
1334
|
+
const inlineStyle = this.getInlineStyle(); // 动态部分
|
|
1335
|
+
|
|
1336
|
+
const finalCss: NativeNodeProps = { ...cssStyle.normal };
|
|
1337
|
+
|
|
1338
|
+
// 合并当前伪类状态下样式
|
|
1339
|
+
if (this.__pseudoActive__) {
|
|
1340
|
+
for (const pseudo in cssStyle.__pseudo__) {
|
|
1341
|
+
try {
|
|
1342
|
+
// 处理标准伪类(如 :focus)
|
|
1343
|
+
// 提取标准伪类的基础类型(如 nth-child(2) → nth-child)
|
|
1344
|
+
const base = pseudo.includes("(")
|
|
1345
|
+
? pseudo.slice(0, pseudo.indexOf("("))
|
|
1346
|
+
: pseudo;
|
|
1347
|
+
if (this.__pseudoActive__[base]) {
|
|
1348
|
+
Object.assign(finalCss, cssStyle.__pseudo__[pseudo]);
|
|
1349
|
+
}
|
|
1350
|
+
// 处理 :not(:xxx) 伪类
|
|
1351
|
+
if (pseudo.startsWith("not(") && pseudo.endsWith(")")) {
|
|
1352
|
+
const inner = pseudo.slice(4, -1).replace(/^:/, ""); // 提取 "focus"
|
|
1353
|
+
if (!this.__pseudoActive__[inner]) {
|
|
1354
|
+
Object.assign(finalCss, cssStyle.__pseudo__[pseudo]);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
} catch (e) {
|
|
1358
|
+
console.error(e);
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
// 最后合并 inline style(优先级最高)
|
|
1364
|
+
const merged = { ...finalCss, ...cssStyle.important, ...inlineStyle };
|
|
1365
|
+
const resolved = resolveStyle(this, merged);
|
|
1366
|
+
this.__resolvedStyleCache = resolved;
|
|
1367
|
+
this.__resolvedStyleVersion = version;
|
|
1368
|
+
this.__inlineStyleDirty = false;
|
|
1369
|
+
return resolved;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
getMatchedCssStyleWithCache(): {
|
|
1373
|
+
normal: NativeNodeProps;
|
|
1374
|
+
important: NativeNodeProps;
|
|
1375
|
+
__pseudo__: Record<string, NativeNodeProps>;
|
|
1376
|
+
} {
|
|
1377
|
+
const version = getGlobalCssMapVersion();
|
|
1378
|
+
|
|
1379
|
+
if (
|
|
1380
|
+
this.__cssMatchedStyleCache &&
|
|
1381
|
+
this.__cssMatchedStyleVersion === version
|
|
1382
|
+
) {
|
|
1383
|
+
info("【样式匹配】:使用缓存样式", this.__cssMatchedStyleCache);
|
|
1384
|
+
return this.__cssMatchedStyleCache;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
const normal: NativeNodeProps = {};
|
|
1388
|
+
const important: NativeNodeProps = {};
|
|
1389
|
+
const pseudoMap: Record<string, NativeNodeProps> = {};
|
|
1390
|
+
|
|
1391
|
+
const matchedSelectors = getCssMap().query(this);
|
|
1392
|
+
|
|
1393
|
+
for (const matchedSelector of matchedSelectors.selectors) {
|
|
1394
|
+
if (!isStyleMatched(matchedSelector, this)) {
|
|
1395
|
+
continue;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
const ruleSet = matchedSelector.ruleSet;
|
|
1399
|
+
if (!ruleSet?.declarations?.length) continue;
|
|
1400
|
+
|
|
1401
|
+
// 判断是否包含伪类(注意:这需要你确保 matchedSelector.pseudoClass 是在构造时挂上的)
|
|
1402
|
+
const pseudos = matchedSelector.pseudoClass;
|
|
1403
|
+
if (Array.isArray(pseudos) && pseudos.length > 0) {
|
|
1404
|
+
// 伪类样式分发到每个伪类的样式对象里
|
|
1405
|
+
for (const pseudoName of pseudos) {
|
|
1406
|
+
const targetStyle = (pseudoMap[pseudoName] ??= {});
|
|
1407
|
+
for (const decl of ruleSet.declarations) {
|
|
1408
|
+
targetStyle[decl.property] = decl.value;
|
|
1409
|
+
//
|
|
1410
|
+
if (decl.important) {
|
|
1411
|
+
important[decl.property] = decl.value;
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
} else {
|
|
1416
|
+
// 普通样式
|
|
1417
|
+
for (const decl of ruleSet.declarations) {
|
|
1418
|
+
normal[decl.property] = decl.value;
|
|
1419
|
+
if (decl.important) {
|
|
1420
|
+
important[decl.property] = decl.value;
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
// 缓存所有状态样式,包括 normal 和伪类样式
|
|
1427
|
+
const styleResult = {
|
|
1428
|
+
normal,
|
|
1429
|
+
important,
|
|
1430
|
+
__pseudo__: pseudoMap,
|
|
1431
|
+
};
|
|
1432
|
+
this.__cssMatchedStyleCache = styleResult;
|
|
1433
|
+
this.__cssMatchedStyleVersion = version;
|
|
1434
|
+
return styleResult;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* When generating props for Native Node, some additional logic needs to be hacked
|
|
1439
|
+
*
|
|
1440
|
+
* @param rawProps - original props
|
|
1441
|
+
*/
|
|
1442
|
+
private hackNativeProps(rawProps: NativeNodeProps) {
|
|
1443
|
+
const props = rawProps;
|
|
1444
|
+
|
|
1445
|
+
// solve the problem of src props of iOS image, which should be repaired by native
|
|
1446
|
+
if (this.tagName === "img") {
|
|
1447
|
+
if (!props.onLoadEnd) {
|
|
1448
|
+
props.onLoadEnd = true;
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* get the props of the Native node, the properties include the properties of the node and
|
|
1455
|
+
* the default properties of the component to which the node belongs
|
|
1456
|
+
*/
|
|
1457
|
+
private getNativeProps(): NativeNodeProps {
|
|
1458
|
+
const props: NativeNodeProps = {};
|
|
1459
|
+
const { defaultNativeProps } = this.component;
|
|
1460
|
+
|
|
1461
|
+
// first add default props
|
|
1462
|
+
if (defaultNativeProps) {
|
|
1463
|
+
Object.keys(defaultNativeProps).forEach((key) => {
|
|
1464
|
+
// the property has not been set, use the default property to set
|
|
1465
|
+
if (this.getAttribute(key) === undefined) {
|
|
1466
|
+
const prop = defaultNativeProps[key];
|
|
1467
|
+
|
|
1468
|
+
// if the default property is a function, execute, otherwise assign directly
|
|
1469
|
+
props[key] = isFunction(prop) ? prop(this) : toRaw(prop);
|
|
1470
|
+
}
|
|
1471
|
+
});
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
// then convert the attributes of the node itself
|
|
1475
|
+
Object.keys(this.attributes).forEach((key) => {
|
|
1476
|
+
let value = toRaw(this.getAttribute(key));
|
|
1477
|
+
|
|
1478
|
+
// if the key does not exist in the map, assign it directly
|
|
1479
|
+
if (!this.component.attributeMaps || !this.component.attributeMaps[key]) {
|
|
1480
|
+
props[key] = toRaw(value);
|
|
1481
|
+
return;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
// If there is an attribute in the attribute map, and the map value is a string, use the map as the key
|
|
1485
|
+
const map = this.component.attributeMaps[key];
|
|
1486
|
+
if (isString(map)) {
|
|
1487
|
+
props[map] = toRaw(value);
|
|
1488
|
+
return;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
// If it is a method, use the value after the method is executed as the attribute value
|
|
1492
|
+
if (isFunction(map)) {
|
|
1493
|
+
props[key] = toRaw(map(value));
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
const { name: propsKey, propsValue, jointKey } = map;
|
|
1498
|
+
if (isFunction(propsValue)) {
|
|
1499
|
+
value = propsValue(value);
|
|
1500
|
+
}
|
|
1501
|
+
// If jointKey is set, multiple properties will be written to the same jointKey object
|
|
1502
|
+
if (jointKey) {
|
|
1503
|
+
props[jointKey] = props[jointKey] ?? {};
|
|
1504
|
+
|
|
1505
|
+
Object.assign(props[jointKey], {
|
|
1506
|
+
[propsKey]: toRaw(value),
|
|
1507
|
+
});
|
|
1508
|
+
} else {
|
|
1509
|
+
props[propsKey] = toRaw(value);
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1512
|
+
|
|
1513
|
+
const { nativeProps } = this.component;
|
|
1514
|
+
if (nativeProps) {
|
|
1515
|
+
// Then process the configured nativeProps,
|
|
1516
|
+
// the priority here is the highest, and if there are settings, it will override others
|
|
1517
|
+
Object.keys(nativeProps).forEach((key) => {
|
|
1518
|
+
props[key] = toRaw(nativeProps[key]);
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
// Finally handle the hack logic
|
|
1523
|
+
this.hackNativeProps(props);
|
|
1524
|
+
|
|
1525
|
+
return props;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
/**
|
|
1529
|
+
* Get the attributes of the target node for chrome inspector
|
|
1530
|
+
*/
|
|
1531
|
+
private getNodeAttributes() {
|
|
1532
|
+
try {
|
|
1533
|
+
const nodeAttributes = deepCopy(this.attributes);
|
|
1534
|
+
const classInfo = Array.from(this.classList ?? []).join(" ");
|
|
1535
|
+
const attributes = {
|
|
1536
|
+
id: this.id,
|
|
1537
|
+
nodeId: `${this.nodeId}`,
|
|
1538
|
+
hippyNodeId: `${this.nodeId}`,
|
|
1539
|
+
class: classInfo,
|
|
1540
|
+
...nodeAttributes,
|
|
1541
|
+
};
|
|
1542
|
+
|
|
1543
|
+
// remove unwanted properties
|
|
1544
|
+
delete attributes.text;
|
|
1545
|
+
delete attributes.value;
|
|
1546
|
+
|
|
1547
|
+
Object.keys(attributes).forEach((key) => {
|
|
1548
|
+
if (key !== "id" && key !== "hippyNodeId" && key !== "class") {
|
|
1549
|
+
// value may big int that iOS do not support, should delete
|
|
1550
|
+
delete attributes[key];
|
|
1551
|
+
}
|
|
1552
|
+
});
|
|
1553
|
+
|
|
1554
|
+
return attributes;
|
|
1555
|
+
} catch (error) {
|
|
1556
|
+
return {};
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* Get the list of events bound to the node and convert it to the list required by the native node event properties
|
|
1562
|
+
*/
|
|
1563
|
+
private getNativeEvents(): NativeNodeProps {
|
|
1564
|
+
const events: NativeNodeProps = {};
|
|
1565
|
+
const eventList = this.getEventListenerList();
|
|
1566
|
+
// The event keys taken out here are all events
|
|
1567
|
+
// registered by vue, which are the event names with the on prefix removed.
|
|
1568
|
+
const eventKeys = Object.keys(eventList);
|
|
1569
|
+
|
|
1570
|
+
if (eventKeys.length) {
|
|
1571
|
+
const { eventNamesMap } = this.component;
|
|
1572
|
+
|
|
1573
|
+
// If the node belongs to a custom component and has a custom event map, use the custom event map
|
|
1574
|
+
// For example, the node registers the event "appear", but the event name in Native is called onWidgetShow
|
|
1575
|
+
eventKeys.forEach((eventKey) => {
|
|
1576
|
+
const nativeEventName = eventNamesMap?.get(eventKey);
|
|
1577
|
+
if (nativeEventName) {
|
|
1578
|
+
// there is a native mapping name, just use the native event name directly
|
|
1579
|
+
events[nativeEventName] = !!eventList[eventKey];
|
|
1580
|
+
} else {
|
|
1581
|
+
// otherwise, like other vue events, capitalize the first letter and prefix it with on
|
|
1582
|
+
const name = `on${capitalizeFirstLetter(eventKey)}`;
|
|
1583
|
+
events[name] = !!eventList[eventKey];
|
|
1584
|
+
}
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
return events;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
/**
|
|
1592
|
+
* Unified invocation of logic that requires special handling
|
|
1593
|
+
*/
|
|
1594
|
+
private hackSpecialIssue() {
|
|
1595
|
+
// special handling of node attributes
|
|
1596
|
+
this.fixVShowDirectiveIssue();
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Fix the problem that the v-show does not take effect
|
|
1601
|
+
*
|
|
1602
|
+
*/
|
|
1603
|
+
private fixVShowDirectiveIssue(): void {
|
|
1604
|
+
// use current value if exists
|
|
1605
|
+
let display = this.style.display ?? undefined;
|
|
1606
|
+
// watch the modification of this.style.display and update it with the modified value
|
|
1607
|
+
// fixme If the user here actively sets the display by means of setStyle,
|
|
1608
|
+
// the updateNode may be triggered one more time, here's how to deal with it
|
|
1609
|
+
Object.defineProperty(this.style, "display", {
|
|
1610
|
+
enumerable: true,
|
|
1611
|
+
configurable: true,
|
|
1612
|
+
get() {
|
|
1613
|
+
return display;
|
|
1614
|
+
},
|
|
1615
|
+
set: (newValue: string) => {
|
|
1616
|
+
// the display property in hippy defaults to flex
|
|
1617
|
+
display = newValue === undefined ? "flex" : newValue;
|
|
1618
|
+
// update native node
|
|
1619
|
+
this.updateNativeNode();
|
|
1620
|
+
},
|
|
1621
|
+
});
|
|
1622
|
+
}
|
|
1623
|
+
}
|