vite-plugin-taro-runtime 0.7.0 → 0.7.1-beta.2
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/README.md +10 -28
- package/dist/api/dist/env.d.ts +15 -0
- package/dist/api/dist/env.js +58 -0
- package/dist/api/dist/env.js.map +1 -0
- package/dist/api/dist/index.d.ts +2 -0
- package/dist/api/dist/index.js +28 -0
- package/dist/api/dist/index.js.map +1 -0
- package/dist/api/dist/interceptor/chain.d.ts +16 -0
- package/dist/api/dist/interceptor/chain.js +30 -0
- package/dist/api/dist/interceptor/chain.js.map +1 -0
- package/dist/api/dist/interceptor/index.d.ts +11 -0
- package/dist/api/dist/interceptor/index.js +30 -0
- package/dist/api/dist/interceptor/index.js.map +1 -0
- package/dist/api/dist/interceptor/interceptors.d.ts +3 -0
- package/dist/api/dist/interceptor/interceptors.js +48 -0
- package/dist/api/dist/interceptor/interceptors.js.map +1 -0
- package/dist/api/dist/tools.d.ts +4 -0
- package/dist/api/dist/tools.js +67 -0
- package/dist/api/dist/tools.js.map +1 -0
- package/dist/components/dist/components/helper.js +24 -0
- package/dist/components/dist/components/index.d.ts +130 -0
- package/dist/components/dist/components/index.js +103 -0
- package/dist/components/dist/components/index2.js +89 -0
- package/dist/components/dist/components/index3.js +39 -0
- package/dist/components/dist/components/picker-group.js +218 -0
- package/dist/components/dist/components/taro-ad-core.d.ts +11 -0
- package/dist/components/dist/components/taro-ad-core.js +33 -0
- package/dist/components/dist/components/taro-ad-custom-core.d.ts +11 -0
- package/dist/components/dist/components/taro-ad-custom-core.js +33 -0
- package/dist/components/dist/components/taro-animation-video-core.d.ts +11 -0
- package/dist/components/dist/components/taro-animation-video-core.js +33 -0
- package/dist/components/dist/components/taro-animation-view-core.d.ts +11 -0
- package/dist/components/dist/components/taro-animation-view-core.js +33 -0
- package/dist/components/dist/components/taro-ar-camera-core.d.ts +11 -0
- package/dist/components/dist/components/taro-ar-camera-core.js +33 -0
- package/dist/components/dist/components/taro-audio-core.d.ts +11 -0
- package/dist/components/dist/components/taro-audio-core.js +78 -0
- package/dist/components/dist/components/taro-aweme-data-core.d.ts +11 -0
- package/dist/components/dist/components/taro-aweme-data-core.js +33 -0
- package/dist/components/dist/components/taro-block-core.d.ts +11 -0
- package/dist/components/dist/components/taro-block-core.js +29 -0
- package/dist/components/dist/components/taro-button-core.d.ts +11 -0
- package/dist/components/dist/components/taro-button-core.js +100 -0
- package/dist/components/dist/components/taro-camera-core.d.ts +11 -0
- package/dist/components/dist/components/taro-camera-core.js +33 -0
- package/dist/components/dist/components/taro-canvas-core.d.ts +11 -0
- package/dist/components/dist/components/taro-canvas-core.js +69 -0
- package/dist/components/dist/components/taro-channel-live-core.d.ts +11 -0
- package/dist/components/dist/components/taro-channel-live-core.js +33 -0
- package/dist/components/dist/components/taro-channel-video-core.d.ts +11 -0
- package/dist/components/dist/components/taro-channel-video-core.js +33 -0
- package/dist/components/dist/components/taro-checkbox-core.d.ts +11 -0
- package/dist/components/dist/components/taro-checkbox-core.js +79 -0
- package/dist/components/dist/components/taro-checkbox-group-core.d.ts +11 -0
- package/dist/components/dist/components/taro-checkbox-group-core.js +88 -0
- package/dist/components/dist/components/taro-comment-detail-core.d.ts +11 -0
- package/dist/components/dist/components/taro-comment-detail-core.js +33 -0
- package/dist/components/dist/components/taro-comment-list-core.d.ts +11 -0
- package/dist/components/dist/components/taro-comment-list-core.js +33 -0
- package/dist/components/dist/components/taro-contact-button-core.d.ts +11 -0
- package/dist/components/dist/components/taro-contact-button-core.js +33 -0
- package/dist/components/dist/components/taro-cover-image-core.d.ts +11 -0
- package/dist/components/dist/components/taro-cover-image-core.js +50 -0
- package/dist/components/dist/components/taro-cover-view-core.d.ts +11 -0
- package/dist/components/dist/components/taro-cover-view-core.js +87 -0
- package/dist/components/dist/components/taro-custom-wrapper-core.d.ts +11 -0
- package/dist/components/dist/components/taro-custom-wrapper-core.js +29 -0
- package/dist/components/dist/components/taro-double-tap-gesture-handler-core.d.ts +11 -0
- package/dist/components/dist/components/taro-double-tap-gesture-handler-core.js +33 -0
- package/dist/components/dist/components/taro-draggable-sheet-core.d.ts +11 -0
- package/dist/components/dist/components/taro-draggable-sheet-core.js +33 -0
- package/dist/components/dist/components/taro-editor-core.d.ts +11 -0
- package/dist/components/dist/components/taro-editor-core.js +33 -0
- package/dist/components/dist/components/taro-follow-swan-core.d.ts +11 -0
- package/dist/components/dist/components/taro-follow-swan-core.js +33 -0
- package/dist/components/dist/components/taro-force-press-gesture-handler-core.d.ts +11 -0
- package/dist/components/dist/components/taro-force-press-gesture-handler-core.js +33 -0
- package/dist/components/dist/components/taro-form-core.d.ts +11 -0
- package/dist/components/dist/components/taro-form-core.js +156 -0
- package/dist/components/dist/components/taro-functional-page-navigator-core.d.ts +11 -0
- package/dist/components/dist/components/taro-functional-page-navigator-core.js +33 -0
- package/dist/components/dist/components/taro-grid-builder-core.d.ts +11 -0
- package/dist/components/dist/components/taro-grid-builder-core.js +33 -0
- package/dist/components/dist/components/taro-grid-view-core.d.ts +11 -0
- package/dist/components/dist/components/taro-grid-view-core.js +33 -0
- package/dist/components/dist/components/taro-horizontal-drag-gesture-handler-core.d.ts +11 -0
- package/dist/components/dist/components/taro-horizontal-drag-gesture-handler-core.js +33 -0
- package/dist/components/dist/components/taro-icon-core.d.ts +11 -0
- package/dist/components/dist/components/taro-icon-core.js +49 -0
- package/dist/components/dist/components/taro-image-core.d.ts +11 -0
- package/dist/components/dist/components/taro-image-core.js +82 -0
- package/dist/components/dist/components/taro-inline-payment-panel-core.d.ts +11 -0
- package/dist/components/dist/components/taro-inline-payment-panel-core.js +33 -0
- package/dist/components/dist/components/taro-input-core.d.ts +11 -0
- package/dist/components/dist/components/taro-input-core.js +241 -0
- package/dist/components/dist/components/taro-keyboard-accessory-core.d.ts +11 -0
- package/dist/components/dist/components/taro-keyboard-accessory-core.js +33 -0
- package/dist/components/dist/components/taro-label-core.d.ts +11 -0
- package/dist/components/dist/components/taro-label-core.js +32 -0
- package/dist/components/dist/components/taro-lifestyle-core.d.ts +11 -0
- package/dist/components/dist/components/taro-lifestyle-core.js +33 -0
- package/dist/components/dist/components/taro-like-core.d.ts +11 -0
- package/dist/components/dist/components/taro-like-core.js +33 -0
- package/dist/components/dist/components/taro-list-builder-core.d.ts +11 -0
- package/dist/components/dist/components/taro-list-builder-core.js +33 -0
- package/dist/components/dist/components/taro-list-view-core.d.ts +11 -0
- package/dist/components/dist/components/taro-list-view-core.js +33 -0
- package/dist/components/dist/components/taro-live-player-core.d.ts +11 -0
- package/dist/components/dist/components/taro-live-player-core.js +33 -0
- package/dist/components/dist/components/taro-live-pusher-core.d.ts +11 -0
- package/dist/components/dist/components/taro-live-pusher-core.js +33 -0
- package/dist/components/dist/components/taro-login-core.d.ts +11 -0
- package/dist/components/dist/components/taro-login-core.js +33 -0
- package/dist/components/dist/components/taro-long-press-gesture-handler-core.d.ts +11 -0
- package/dist/components/dist/components/taro-long-press-gesture-handler-core.js +33 -0
- package/dist/components/dist/components/taro-lottie-core.d.ts +11 -0
- package/dist/components/dist/components/taro-lottie-core.js +33 -0
- package/dist/components/dist/components/taro-map-core.d.ts +11 -0
- package/dist/components/dist/components/taro-map-core.js +1376 -0
- package/dist/components/dist/components/taro-match-media-core.d.ts +11 -0
- package/dist/components/dist/components/taro-match-media-core.js +33 -0
- package/dist/components/dist/components/taro-movable-area-core.d.ts +11 -0
- package/dist/components/dist/components/taro-movable-area-core.js +174 -0
- package/dist/components/dist/components/taro-movable-view-core.d.ts +11 -0
- package/dist/components/dist/components/taro-movable-view-core.js +361 -0
- package/dist/components/dist/components/taro-native-slot-core.d.ts +11 -0
- package/dist/components/dist/components/taro-native-slot-core.js +33 -0
- package/dist/components/dist/components/taro-navigation-bar-core.d.ts +11 -0
- package/dist/components/dist/components/taro-navigation-bar-core.js +33 -0
- package/dist/components/dist/components/taro-navigator-core.d.ts +11 -0
- package/dist/components/dist/components/taro-navigator-core.js +94 -0
- package/dist/components/dist/components/taro-nested-scroll-body-core.d.ts +11 -0
- package/dist/components/dist/components/taro-nested-scroll-body-core.js +33 -0
- package/dist/components/dist/components/taro-nested-scroll-header-core.d.ts +11 -0
- package/dist/components/dist/components/taro-nested-scroll-header-core.js +33 -0
- package/dist/components/dist/components/taro-official-account-core.d.ts +11 -0
- package/dist/components/dist/components/taro-official-account-core.js +33 -0
- package/dist/components/dist/components/taro-open-container-core.d.ts +11 -0
- package/dist/components/dist/components/taro-open-container-core.js +33 -0
- package/dist/components/dist/components/taro-open-data-core.d.ts +11 -0
- package/dist/components/dist/components/taro-open-data-core.js +33 -0
- package/dist/components/dist/components/taro-open-embedded-atomicservice-core.d.ts +11 -0
- package/dist/components/dist/components/taro-open-embedded-atomicservice-core.js +33 -0
- package/dist/components/dist/components/taro-page-container-core.d.ts +11 -0
- package/dist/components/dist/components/taro-page-container-core.js +33 -0
- package/dist/components/dist/components/taro-page-meta-core.d.ts +11 -0
- package/dist/components/dist/components/taro-page-meta-core.js +33 -0
- package/dist/components/dist/components/taro-pan-gesture-handler-core.d.ts +11 -0
- package/dist/components/dist/components/taro-pan-gesture-handler-core.js +33 -0
- package/dist/components/dist/components/taro-picker-core.d.ts +11 -0
- package/dist/components/dist/components/taro-picker-core.js +540 -0
- package/dist/components/dist/components/taro-picker-group.d.ts +11 -0
- package/dist/components/dist/components/taro-picker-group.js +6 -0
- package/dist/components/dist/components/taro-picker-view-column-core.d.ts +11 -0
- package/dist/components/dist/components/taro-picker-view-column-core.js +103 -0
- package/dist/components/dist/components/taro-picker-view-core.d.ts +11 -0
- package/dist/components/dist/components/taro-picker-view-core.js +121 -0
- package/dist/components/dist/components/taro-progress-core.d.ts +11 -0
- package/dist/components/dist/components/taro-progress-core.js +63 -0
- package/dist/components/dist/components/taro-pull-to-refresh-core.d.ts +11 -0
- package/dist/components/dist/components/taro-pull-to-refresh-core.js +287 -0
- package/dist/components/dist/components/taro-radio-core.d.ts +11 -0
- package/dist/components/dist/components/taro-radio-core.js +81 -0
- package/dist/components/dist/components/taro-radio-group-core.d.ts +11 -0
- package/dist/components/dist/components/taro-radio-group-core.js +99 -0
- package/dist/components/dist/components/taro-rich-text-core.d.ts +11 -0
- package/dist/components/dist/components/taro-rich-text-core.js +93 -0
- package/dist/components/dist/components/taro-root-portal-core.d.ts +11 -0
- package/dist/components/dist/components/taro-root-portal-core.js +33 -0
- package/dist/components/dist/components/taro-rtc-room-core.d.ts +11 -0
- package/dist/components/dist/components/taro-rtc-room-core.js +33 -0
- package/dist/components/dist/components/taro-rtc-room-item-core.d.ts +11 -0
- package/dist/components/dist/components/taro-rtc-room-item-core.js +33 -0
- package/dist/components/dist/components/taro-scale-gesture-handler-core.d.ts +11 -0
- package/dist/components/dist/components/taro-scale-gesture-handler-core.js +33 -0
- package/dist/components/dist/components/taro-script-core.d.ts +11 -0
- package/dist/components/dist/components/taro-script-core.js +33 -0
- package/dist/components/dist/components/taro-scroll-view-core.d.ts +11 -0
- package/dist/components/dist/components/taro-scroll-view-core.js +199 -0
- package/dist/components/dist/components/taro-share-element-core.d.ts +11 -0
- package/dist/components/dist/components/taro-share-element-core.js +33 -0
- package/dist/components/dist/components/taro-slider-core.d.ts +11 -0
- package/dist/components/dist/components/taro-slider-core.js +197 -0
- package/dist/components/dist/components/taro-slot-core.d.ts +11 -0
- package/dist/components/dist/components/taro-slot-core.js +33 -0
- package/dist/components/dist/components/taro-snapshot-core.d.ts +11 -0
- package/dist/components/dist/components/taro-snapshot-core.js +33 -0
- package/dist/components/dist/components/taro-span-core.d.ts +11 -0
- package/dist/components/dist/components/taro-span-core.js +33 -0
- package/dist/components/dist/components/taro-sticky-header-core.d.ts +11 -0
- package/dist/components/dist/components/taro-sticky-header-core.js +33 -0
- package/dist/components/dist/components/taro-sticky-section-core.d.ts +11 -0
- package/dist/components/dist/components/taro-sticky-section-core.js +33 -0
- package/dist/components/dist/components/taro-swiper-core.d.ts +11 -0
- package/dist/components/dist/components/taro-swiper-core.js +438 -0
- package/dist/components/dist/components/taro-swiper-item-core.d.ts +11 -0
- package/dist/components/dist/components/taro-swiper-item-core.js +42 -0
- package/dist/components/dist/components/taro-switch-core.d.ts +11 -0
- package/dist/components/dist/components/taro-switch-core.js +85 -0
- package/dist/components/dist/components/taro-tab-item-core.d.ts +11 -0
- package/dist/components/dist/components/taro-tab-item-core.js +33 -0
- package/dist/components/dist/components/taro-tabbar.d.ts +11 -0
- package/dist/components/dist/components/taro-tabbar.js +371 -0
- package/dist/components/dist/components/taro-tabs-core.d.ts +11 -0
- package/dist/components/dist/components/taro-tabs-core.js +33 -0
- package/dist/components/dist/components/taro-tap-gesture-handler-core.d.ts +11 -0
- package/dist/components/dist/components/taro-tap-gesture-handler-core.js +33 -0
- package/dist/components/dist/components/taro-text-core.d.ts +11 -0
- package/dist/components/dist/components/taro-text-core.js +45 -0
- package/dist/components/dist/components/taro-textarea-core.d.ts +11 -0
- package/dist/components/dist/components/taro-textarea-core.js +285 -0
- package/dist/components/dist/components/taro-vertical-drag-gesture-handler-core.d.ts +11 -0
- package/dist/components/dist/components/taro-vertical-drag-gesture-handler-core.js +33 -0
- package/dist/components/dist/components/taro-video-control.d.ts +11 -0
- package/dist/components/dist/components/taro-video-control.js +6 -0
- package/dist/components/dist/components/taro-video-core.d.ts +11 -0
- package/dist/components/dist/components/taro-video-core.js +500 -0
- package/dist/components/dist/components/taro-video-danmu.d.ts +11 -0
- package/dist/components/dist/components/taro-video-danmu.js +6 -0
- package/dist/components/dist/components/taro-view-core.d.ts +11 -0
- package/dist/components/dist/components/taro-view-core.js +92 -0
- package/dist/components/dist/components/taro-voip-room-core.d.ts +11 -0
- package/dist/components/dist/components/taro-voip-room-core.js +33 -0
- package/dist/components/dist/components/taro-web-view-core.d.ts +11 -0
- package/dist/components/dist/components/taro-web-view-core.js +44 -0
- package/dist/components/dist/components/video-control.js +240 -0
- package/dist/components/dist/components/video-danmu.js +108 -0
- package/dist/components/dist/taro-components/taro-components.css +1 -0
- package/dist/components/global.css +1 -0
- package/dist/components/lib/react/component-lib/index.d.ts +54 -0
- package/dist/components/lib/react/component-lib/index.js +68 -0
- package/dist/components/lib/react/component-lib/index.js.map +1 -0
- package/dist/components/lib/react/component-lib/input.d.ts +3 -0
- package/dist/components/lib/react/component-lib/input.js +17 -0
- package/dist/components/lib/react/component-lib/input.js.map +1 -0
- package/dist/components/lib/react/component-lib/reactify-wc.d.ts +7 -0
- package/dist/components/lib/react/component-lib/reactify-wc.js +176 -0
- package/dist/components/lib/react/component-lib/reactify-wc.js.map +1 -0
- package/dist/components/lib/react/components.d.ts +103 -0
- package/dist/components/lib/react/components.js +112 -0
- package/dist/components/lib/react/components.js.map +1 -0
- package/dist/components/lib/react/helper.d.ts +10 -0
- package/dist/components/lib/react/helper.js +10 -0
- package/dist/components/lib/react/helper.js.map +1 -0
- package/dist/components/lib/react/index.d.ts +1 -0
- package/dist/components/lib/react/index.js +2 -0
- package/dist/components/lib/react/index.js.map +1 -0
- package/dist/components/lib/react/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.39.0_tslib@2.8.1_typescript@5.4.5/node_modules/tslib/tslib.es6.js +405 -0
- package/dist/components/lib/react/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.39.0_tslib@2.8.1_typescript@5.4.5/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/components/lib/react/react-component-lib/createComponent.d.ts +14 -0
- package/dist/components/lib/react/react-component-lib/createComponent.js +73 -0
- package/dist/components/lib/react/react-component-lib/createComponent.js.map +1 -0
- package/dist/components/lib/react/react-component-lib/createOverlayComponent.d.ts +25 -0
- package/dist/components/lib/react/react-component-lib/createOverlayComponent.js +94 -0
- package/dist/components/lib/react/react-component-lib/createOverlayComponent.js.map +1 -0
- package/dist/components/lib/react/react-component-lib/index.d.ts +2 -0
- package/dist/components/lib/react/react-component-lib/index.js +3 -0
- package/dist/components/lib/react/react-component-lib/index.js.map +1 -0
- package/dist/components/lib/react/react-component-lib/interfaces.d.ts +33 -0
- package/dist/components/lib/react/react-component-lib/utils/attachProps.d.ts +18 -0
- package/dist/components/lib/react/react-component-lib/utils/attachProps.js +182 -0
- package/dist/components/lib/react/react-component-lib/utils/attachProps.js.map +1 -0
- package/dist/components/lib/react/react-component-lib/utils/case.d.ts +6 -0
- package/dist/components/lib/react/react-component-lib/utils/case.js +13 -0
- package/dist/components/lib/react/react-component-lib/utils/case.js.map +1 -0
- package/dist/components/lib/react/react-component-lib/utils/dev.d.ts +6 -0
- package/dist/components/lib/react/react-component-lib/utils/index.d.ts +14 -0
- package/dist/components/lib/react/react-component-lib/utils/index.js +39 -0
- package/dist/components/lib/react/react-component-lib/utils/index.js.map +1 -0
- package/dist/components/types/Ad.d.ts +205 -0
- package/dist/components/types/AdCustom.d.ts +44 -0
- package/dist/components/types/AnimationVideo.d.ts +53 -0
- package/dist/components/types/AnimationView.d.ts +39 -0
- package/dist/components/types/ArCamera.d.ts +43 -0
- package/dist/components/types/Audio.d.ts +135 -0
- package/dist/components/types/AwemeData.d.ts +37 -0
- package/dist/components/types/Block.d.ts +9 -0
- package/dist/components/types/Button.d.ts +740 -0
- package/dist/components/types/Camera.d.ts +128 -0
- package/dist/components/types/Canvas.d.ts +98 -0
- package/dist/components/types/ChannelLive.d.ts +20 -0
- package/dist/components/types/ChannelVideo.d.ts +48 -0
- package/dist/components/types/Checkbox.d.ts +167 -0
- package/dist/components/types/CheckboxGroup.d.ts +81 -0
- package/dist/components/types/CommentDetail.d.ts +66 -0
- package/dist/components/types/CommentList.d.ts +112 -0
- package/dist/components/types/ContactButton.d.ts +46 -0
- package/dist/components/types/CoverImage.d.ts +151 -0
- package/dist/components/types/CoverView.d.ts +219 -0
- package/dist/components/types/CustomWrapper.d.ts +31 -0
- package/dist/components/types/DraggableSheet.d.ts +52 -0
- package/dist/components/types/Editor.d.ts +143 -0
- package/dist/components/types/FollowSwan.d.ts +25 -0
- package/dist/components/types/Form.d.ts +130 -0
- package/dist/components/types/FunctionalPageNavigator.d.ts +56 -0
- package/dist/components/types/GridBuilder.d.ts +72 -0
- package/dist/components/types/GridView.d.ts +51 -0
- package/dist/components/types/Icon.d.ts +97 -0
- package/dist/components/types/Image.d.ts +175 -0
- package/dist/components/types/InlinePaymentPanel.d.ts +49 -0
- package/dist/components/types/Input.d.ts +353 -0
- package/dist/components/types/KeyboardAccessory.d.ts +42 -0
- package/dist/components/types/Label.d.ts +52 -0
- package/dist/components/types/Lifestyle.d.ts +23 -0
- package/dist/components/types/Like.d.ts +90 -0
- package/dist/components/types/List.d.ts +38 -0
- package/dist/components/types/ListBuilder.d.ts +55 -0
- package/dist/components/types/ListItem.d.ts +6 -0
- package/dist/components/types/ListView.d.ts +19 -0
- package/dist/components/types/LivePlayer.d.ts +261 -0
- package/dist/components/types/LivePusher.d.ts +360 -0
- package/dist/components/types/Login.d.ts +40 -0
- package/dist/components/types/Lottie.d.ts +97 -0
- package/dist/components/types/Map.d.ts +732 -0
- package/dist/components/types/MatchMedia.d.ts +70 -0
- package/dist/components/types/MovableArea.d.ts +34 -0
- package/dist/components/types/MovableView.d.ts +180 -0
- package/dist/components/types/NativeSlot.d.ts +35 -0
- package/dist/components/types/NavigationBar.d.ts +44 -0
- package/dist/components/types/Navigator.d.ts +118 -0
- package/dist/components/types/NestedScrollBody.d.ts +15 -0
- package/dist/components/types/NestedScrollHeader.d.ts +15 -0
- package/dist/components/types/OfficialAccount.d.ts +58 -0
- package/dist/components/types/OpenContainer.d.ts +74 -0
- package/dist/components/types/OpenData.d.ts +98 -0
- package/dist/components/types/OpenEmbeddedAtomicservice.d.ts +52 -0
- package/dist/components/types/PageContainer.d.ts +110 -0
- package/dist/components/types/PageMeta.d.ts +133 -0
- package/dist/components/types/Picker.d.ts +452 -0
- package/dist/components/types/PickerView.d.ts +198 -0
- package/dist/components/types/PickerViewColumn.d.ts +12 -0
- package/dist/components/types/Progress.d.ts +105 -0
- package/dist/components/types/PullToRefresh.d.ts +26 -0
- package/dist/components/types/Radio.d.ts +187 -0
- package/dist/components/types/RadioGroup.d.ts +24 -0
- package/dist/components/types/RichText.d.ts +166 -0
- package/dist/components/types/RootPortal.d.ts +40 -0
- package/dist/components/types/RtcRoom.d.ts +88 -0
- package/dist/components/types/RtcRoomItem.d.ts +23 -0
- package/dist/components/types/Script.d.ts +37 -0
- package/dist/components/types/ScrollView.d.ts +510 -0
- package/dist/components/types/ShareElement.d.ts +270 -0
- package/dist/components/types/Slider.d.ts +145 -0
- package/dist/components/types/Slot.d.ts +42 -0
- package/dist/components/types/Snapshot.d.ts +25 -0
- package/dist/components/types/Span.d.ts +14 -0
- package/dist/components/types/StickyHeader.d.ts +31 -0
- package/dist/components/types/StickySection.d.ts +23 -0
- package/dist/components/types/Swiper.d.ts +339 -0
- package/dist/components/types/SwiperItem.d.ts +77 -0
- package/dist/components/types/Switch.d.ts +96 -0
- package/dist/components/types/TabItem.d.ts +31 -0
- package/dist/components/types/Tabs.d.ts +50 -0
- package/dist/components/types/Text.d.ts +146 -0
- package/dist/components/types/Textarea.d.ts +252 -0
- package/dist/components/types/Video.d.ts +604 -0
- package/dist/components/types/View.d.ts +183 -0
- package/dist/components/types/VoipRoom.d.ts +67 -0
- package/dist/components/types/WebView.d.ts +68 -0
- package/dist/components/types/common.d.ts +185 -0
- package/dist/components/types/event.d.ts +7 -0
- package/dist/components/types/gesture/DoubleTapGestureHandler.d.ts +53 -0
- package/dist/components/types/gesture/ForcePressGestureHandler.d.ts +49 -0
- package/dist/components/types/gesture/HorizontalDragGestureHandler.d.ts +53 -0
- package/dist/components/types/gesture/LongPressGestureHandler.d.ts +53 -0
- package/dist/components/types/gesture/PanGestureHandler.d.ts +53 -0
- package/dist/components/types/gesture/ScaleGestureHandler.d.ts +53 -0
- package/dist/components/types/gesture/TapGestureHandler.d.ts +53 -0
- package/dist/components/types/gesture/VerticalDragGestureHandler.d.ts +53 -0
- package/dist/components/types/global.d.ts +4 -0
- package/dist/components/types/index.d.ts +128 -0
- package/dist/components/types/index.solid.d.ts +301 -0
- package/dist/components/types/index.vue3.d.ts +337 -0
- package/dist/components/types/props.d.ts +72 -0
- package/dist/plugin-framework-react/runtime.js +1080 -0
- package/dist/plugin-framework-react/runtime.js.map +1 -0
- package/dist/plugin-platform-alipay/components-react.js +54 -0
- package/dist/plugin-platform-alipay/components-react.js.map +1 -0
- package/dist/plugin-platform-alipay/runtime-utils.js +854 -0
- package/dist/plugin-platform-alipay/runtime-utils.js.map +1 -0
- package/dist/plugin-platform-alipay/runtime.js +864 -0
- package/dist/plugin-platform-alipay/runtime.js.map +1 -0
- package/dist/plugin-platform-alipay/types/apis-list.d.ts +1 -0
- package/dist/plugin-platform-alipay/types/apis.d.ts +9 -0
- package/dist/plugin-platform-alipay/types/components-react.d.ts +10 -0
- package/dist/plugin-platform-alipay/types/components.d.ts +202 -0
- package/dist/plugin-platform-alipay/types/index.d.ts +5 -0
- package/dist/plugin-platform-alipay/types/program.d.ts +51 -0
- package/dist/plugin-platform-alipay/types/runtime-utils.d.ts +19 -0
- package/dist/plugin-platform-alipay/types/runtime.d.ts +1 -0
- package/dist/plugin-platform-alipay/types/template.d.ts +39 -0
- package/dist/plugin-platform-h5/definition.json +2481 -0
- package/dist/plugin-platform-h5/runtime/apis/index.d.ts +5 -0
- package/dist/plugin-platform-h5/runtime/apis/index.js +29 -0
- package/dist/plugin-platform-h5/runtime/apis/index.js.map +1 -0
- package/dist/plugin-platform-h5/runtime/apis/taro-h5.d.ts +1 -0
- package/dist/plugin-platform-h5/runtime/apis/taro-h5.js +2 -0
- package/dist/plugin-platform-h5/runtime/apis/taro-h5.js.map +1 -0
- package/dist/plugin-platform-h5/runtime/apis/taro.d.ts +2 -0
- package/dist/plugin-platform-h5/runtime/apis/taro.js +3 -0
- package/dist/plugin-platform-h5/runtime/apis/taro.js.map +1 -0
- package/dist/plugin-platform-weapp/components-react.js +81 -0
- package/dist/plugin-platform-weapp/components-react.js.map +1 -0
- package/dist/plugin-platform-weapp/runtime-utils.js +613 -0
- package/dist/plugin-platform-weapp/runtime-utils.js.map +1 -0
- package/dist/plugin-platform-weapp/runtime.js +614 -0
- package/dist/plugin-platform-weapp/runtime.js.map +1 -0
- package/dist/plugin-platform-weapp/types/apis-list.d.ts +1 -0
- package/dist/plugin-platform-weapp/types/apis.d.ts +1 -0
- package/dist/plugin-platform-weapp/types/components-react.d.ts +37 -0
- package/dist/plugin-platform-weapp/types/components.d.ts +503 -0
- package/dist/plugin-platform-weapp/types/index.d.ts +8 -0
- package/dist/plugin-platform-weapp/types/program.d.ts +35 -0
- package/dist/plugin-platform-weapp/types/runtime-utils.d.ts +13 -0
- package/dist/plugin-platform-weapp/types/runtime.d.ts +1 -0
- package/dist/plugin-platform-weapp/types/template.d.ts +25 -0
- package/dist/react/componentTree.d.ts +19 -0
- package/dist/react/constant.d.ts +7 -0
- package/dist/react/domInput.d.ts +12 -0
- package/dist/react/event.d.ts +13 -0
- package/dist/react/index.d.ts +33 -0
- package/dist/react/inputValueTracking.d.ts +3 -0
- package/dist/react/props.d.ts +5 -0
- package/dist/react/react.esm.js +1165 -0
- package/dist/react/react.esm.js.map +1 -0
- package/dist/react/reconciler.d.ts +4 -0
- package/dist/react/render.d.ts +25 -0
- package/dist/react/workTags.d.ts +26 -0
- package/dist/router/dist/api.d.ts +7 -0
- package/dist/router/dist/events/resize.d.ts +2 -0
- package/dist/router/dist/events/scroll.d.ts +2 -0
- package/dist/router/dist/history.d.ts +26 -0
- package/dist/router/dist/index.d.ts +9 -0
- package/dist/router/dist/index.esm.js +1755 -0
- package/dist/router/dist/navigationBar.d.ts +2 -0
- package/dist/router/dist/router/index.d.ts +11 -0
- package/dist/router/dist/router/mpa.d.ts +11 -0
- package/dist/router/dist/router/multi-page.d.ts +33 -0
- package/dist/router/dist/router/navigation-bar.d.ts +36 -0
- package/dist/router/dist/router/page.d.ts +53 -0
- package/dist/router/dist/router/spa.d.ts +4 -0
- package/dist/router/dist/router/stack.d.ts +26 -0
- package/dist/router/dist/style.d.ts +13 -0
- package/dist/router/dist/tabbar.d.ts +3 -0
- package/dist/router/dist/utils/index.d.ts +10 -0
- package/dist/router/dist/utils/navigate.d.ts +9 -0
- package/dist/router/types/api.d.ts +18 -0
- package/dist/router/types/component.d.ts +11 -0
- package/dist/router/types/history.d.ts +6 -0
- package/dist/router/types/router.d.ts +32 -0
- package/dist/router/types/taro.d.ts +8 -0
- package/dist/taro/index.js +9 -0
- package/dist/taro/package.json +76 -0
- package/dist/taro/types/api/ad/index.d.ts +197 -0
- package/dist/taro/types/api/ai/face.d.ts +133 -0
- package/dist/taro/types/api/ai/inference.d.ts +129 -0
- package/dist/taro/types/api/ai/visionkit.d.ts +874 -0
- package/dist/taro/types/api/alipay/index.d.ts +69 -0
- package/dist/taro/types/api/base/crypto.d.ts +104 -0
- package/dist/taro/types/api/base/debug.d.ts +329 -0
- package/dist/taro/types/api/base/env.d.ts +19 -0
- package/dist/taro/types/api/base/index.d.ts +102 -0
- package/dist/taro/types/api/base/performance.d.ts +258 -0
- package/dist/taro/types/api/base/system.d.ts +742 -0
- package/dist/taro/types/api/base/update.d.ts +130 -0
- package/dist/taro/types/api/base/weapp/app-event.d.ts +265 -0
- package/dist/taro/types/api/base/weapp/life-cycle.d.ts +155 -0
- package/dist/taro/types/api/canvas/index.d.ts +2162 -0
- package/dist/taro/types/api/cloud/index.d.ts +2622 -0
- package/dist/taro/types/api/data-analysis/index.d.ts +122 -0
- package/dist/taro/types/api/device/accelerometer.d.ts +102 -0
- package/dist/taro/types/api/device/accessibility.d.ts +26 -0
- package/dist/taro/types/api/device/battery.d.ts +46 -0
- package/dist/taro/types/api/device/bluetooth-ble.d.ts +601 -0
- package/dist/taro/types/api/device/bluetooth-peripheral.d.ts +430 -0
- package/dist/taro/types/api/device/bluetooth.d.ts +463 -0
- package/dist/taro/types/api/device/calendar.d.ts +98 -0
- package/dist/taro/types/api/device/clipboard.d.ts +81 -0
- package/dist/taro/types/api/device/compass.d.ts +105 -0
- package/dist/taro/types/api/device/contact.d.ts +110 -0
- package/dist/taro/types/api/device/gyroscope.d.ts +85 -0
- package/dist/taro/types/api/device/iBeacon.d.ts +168 -0
- package/dist/taro/types/api/device/keyboard.d.ts +97 -0
- package/dist/taro/types/api/device/memory.d.ts +52 -0
- package/dist/taro/types/api/device/motion.d.ts +88 -0
- package/dist/taro/types/api/device/network.d.ts +172 -0
- package/dist/taro/types/api/device/nfc.d.ts +1238 -0
- package/dist/taro/types/api/device/phone.d.ts +30 -0
- package/dist/taro/types/api/device/scan.d.ts +111 -0
- package/dist/taro/types/api/device/screen.d.ts +217 -0
- package/dist/taro/types/api/device/sms.d.ts +26 -0
- package/dist/taro/types/api/device/vibrate.d.ts +51 -0
- package/dist/taro/types/api/device/wifi.d.ts +301 -0
- package/dist/taro/types/api/ext/index.d.ts +64 -0
- package/dist/taro/types/api/files/index.d.ts +1472 -0
- package/dist/taro/types/api/framework/index.d.ts +51 -0
- package/dist/taro/types/api/location/index.d.ts +517 -0
- package/dist/taro/types/api/media/audio.d.ts +1013 -0
- package/dist/taro/types/api/media/background-audio.d.ts +291 -0
- package/dist/taro/types/api/media/camera.d.ts +207 -0
- package/dist/taro/types/api/media/editor.d.ts +239 -0
- package/dist/taro/types/api/media/image.d.ts +469 -0
- package/dist/taro/types/api/media/live.d.ts +461 -0
- package/dist/taro/types/api/media/map.d.ts +638 -0
- package/dist/taro/types/api/media/media-recorder.d.ts +117 -0
- package/dist/taro/types/api/media/recorder.d.ts +317 -0
- package/dist/taro/types/api/media/video-decoder.d.ts +117 -0
- package/dist/taro/types/api/media/video-processing.d.ts +84 -0
- package/dist/taro/types/api/media/video.d.ts +527 -0
- package/dist/taro/types/api/media/voip.d.ts +393 -0
- package/dist/taro/types/api/navigate/index.d.ts +327 -0
- package/dist/taro/types/api/network/download.d.ts +173 -0
- package/dist/taro/types/api/network/mdns.d.ts +191 -0
- package/dist/taro/types/api/network/request.d.ts +480 -0
- package/dist/taro/types/api/network/tcp.d.ts +181 -0
- package/dist/taro/types/api/network/udp.d.ts +218 -0
- package/dist/taro/types/api/network/upload.d.ts +201 -0
- package/dist/taro/types/api/network/websocket.d.ts +383 -0
- package/dist/taro/types/api/open-api/account.d.ts +51 -0
- package/dist/taro/types/api/open-api/address.d.ts +68 -0
- package/dist/taro/types/api/open-api/authorize.d.ts +80 -0
- package/dist/taro/types/api/open-api/card.d.ts +110 -0
- package/dist/taro/types/api/open-api/channels.d.ts +225 -0
- package/dist/taro/types/api/open-api/customer-service.d.ts +45 -0
- package/dist/taro/types/api/open-api/device-voip.d.ts +103 -0
- package/dist/taro/types/api/open-api/facial.d.ts +98 -0
- package/dist/taro/types/api/open-api/favorites.d.ts +101 -0
- package/dist/taro/types/api/open-api/group.d.ts +59 -0
- package/dist/taro/types/api/open-api/invoice.d.ts +87 -0
- package/dist/taro/types/api/open-api/license-plate.d.ts +27 -0
- package/dist/taro/types/api/open-api/login.d.ts +115 -0
- package/dist/taro/types/api/open-api/my-miniprogram.d.ts +28 -0
- package/dist/taro/types/api/open-api/privacy.d.ts +107 -0
- package/dist/taro/types/api/open-api/redpackage.d.ts +24 -0
- package/dist/taro/types/api/open-api/settings.d.ts +174 -0
- package/dist/taro/types/api/open-api/soter.d.ts +184 -0
- package/dist/taro/types/api/open-api/sticker.d.ts +83 -0
- package/dist/taro/types/api/open-api/subscribe-message.d.ts +305 -0
- package/dist/taro/types/api/open-api/user-info.d.ts +182 -0
- package/dist/taro/types/api/open-api/werun.d.ts +101 -0
- package/dist/taro/types/api/payment/index.d.ts +119 -0
- package/dist/taro/types/api/qq/index.d.ts +354 -0
- package/dist/taro/types/api/route/index.d.ts +324 -0
- package/dist/taro/types/api/share/index.d.ts +354 -0
- package/dist/taro/types/api/skyline/index.d.ts +345 -0
- package/dist/taro/types/api/storage/background-fetch.d.ts +131 -0
- package/dist/taro/types/api/storage/cache-manager.d.ts +249 -0
- package/dist/taro/types/api/storage/index.d.ts +397 -0
- package/dist/taro/types/api/swan/bookshelf.d.ts +307 -0
- package/dist/taro/types/api/swan/download-package.d.ts +80 -0
- package/dist/taro/types/api/swan/index.d.ts +251 -0
- package/dist/taro/types/api/swan/pay.d.ts +139 -0
- package/dist/taro/types/api/taro.extend.d.ts +233 -0
- package/dist/taro/types/api/taro.hooks.d.ts +148 -0
- package/dist/taro/types/api/ui/animation.d.ts +427 -0
- package/dist/taro/types/api/ui/background.d.ts +69 -0
- package/dist/taro/types/api/ui/custom-component.d.ts +23 -0
- package/dist/taro/types/api/ui/fonts.d.ts +77 -0
- package/dist/taro/types/api/ui/interaction.d.ts +281 -0
- package/dist/taro/types/api/ui/menu.d.ts +29 -0
- package/dist/taro/types/api/ui/navigation-bar.d.ts +130 -0
- package/dist/taro/types/api/ui/pull-down-refresh.d.ts +50 -0
- package/dist/taro/types/api/ui/scroll.d.ts +114 -0
- package/dist/taro/types/api/ui/sticky.d.ts +32 -0
- package/dist/taro/types/api/ui/tab-bar.d.ts +196 -0
- package/dist/taro/types/api/ui/window.d.ts +71 -0
- package/dist/taro/types/api/worker/index.d.ts +83 -0
- package/dist/taro/types/api/wxml/index.d.ts +540 -0
- package/dist/taro/types/compile/compiler.d.ts +32 -0
- package/dist/taro/types/compile/config/h5.d.ts +134 -0
- package/dist/taro/types/compile/config/harmony.d.ts +118 -0
- package/dist/taro/types/compile/config/index.d.ts +8 -0
- package/dist/taro/types/compile/config/manifest.d.ts +155 -0
- package/dist/taro/types/compile/config/mini.d.ts +120 -0
- package/dist/taro/types/compile/config/plugin.d.ts +34 -0
- package/dist/taro/types/compile/config/project.d.ts +338 -0
- package/dist/taro/types/compile/config/rn.d.ts +85 -0
- package/dist/taro/types/compile/config/util.d.ts +179 -0
- package/dist/taro/types/compile/hooks.d.ts +13 -0
- package/dist/taro/types/compile/index.d.ts +11 -0
- package/dist/taro/types/compile/viteCompilerContext.d.ts +167 -0
- package/dist/taro/types/global.d.ts +428 -0
- package/dist/taro/types/index.d.ts +196 -0
- package/dist/taro/types/taro.api.d.ts +130 -0
- package/dist/taro/types/taro.component.d.ts +168 -0
- package/dist/taro/types/taro.config.d.ts +712 -0
- package/dist/taro/types/taro.lifecycle.d.ts +220 -0
- package/dist/taro/types/taro.runtime.d.ts +9 -0
- package/dist/taro-h5/dist/api/ad/index.d.ts +2 -0
- package/dist/taro-h5/dist/api/ad/index.js +8 -0
- package/dist/taro-h5/dist/api/ad/index.js.map +1 -0
- package/dist/taro-h5/dist/api/ai/facial.d.ts +3 -0
- package/dist/taro-h5/dist/api/ai/facial.js +9 -0
- package/dist/taro-h5/dist/api/ai/facial.js.map +1 -0
- package/dist/taro-h5/dist/api/ai/index.d.ts +3 -0
- package/dist/taro-h5/dist/api/ai/index.js +4 -0
- package/dist/taro-h5/dist/api/ai/index.js.map +1 -0
- package/dist/taro-h5/dist/api/ai/inference.d.ts +2 -0
- package/dist/taro-h5/dist/api/ai/inference.js +8 -0
- package/dist/taro-h5/dist/api/ai/inference.js.map +1 -0
- package/dist/taro-h5/dist/api/ai/visual.d.ts +2 -0
- package/dist/taro-h5/dist/api/ai/visual.js +9 -0
- package/dist/taro-h5/dist/api/ai/visual.js.map +1 -0
- package/dist/taro-h5/dist/api/alipay/index.d.ts +2 -0
- package/dist/taro-h5/dist/api/alipay/index.js +8 -0
- package/dist/taro-h5/dist/api/alipay/index.js.map +1 -0
- package/dist/taro-h5/dist/api/base/crypto.d.ts +1 -0
- package/dist/taro-h5/dist/api/base/crypto.js +7 -0
- package/dist/taro-h5/dist/api/base/crypto.js.map +1 -0
- package/dist/taro-h5/dist/api/base/debug.d.ts +3 -0
- package/dist/taro-h5/dist/api/base/debug.js +8 -0
- package/dist/taro-h5/dist/api/base/debug.js.map +1 -0
- package/dist/taro-h5/dist/api/base/index.d.ts +15 -0
- package/dist/taro-h5/dist/api/base/index.js +26 -0
- package/dist/taro-h5/dist/api/base/index.js.map +1 -0
- package/dist/taro-h5/dist/api/base/performance.d.ts +5 -0
- package/dist/taro-h5/dist/api/base/performance.js +11 -0
- package/dist/taro-h5/dist/api/base/performance.js.map +1 -0
- package/dist/taro-h5/dist/api/base/system.d.ts +25 -0
- package/dist/taro-h5/dist/api/base/system.js +194 -0
- package/dist/taro-h5/dist/api/base/system.js.map +1 -0
- package/dist/taro-h5/dist/api/base/update.d.ts +2 -0
- package/dist/taro-h5/dist/api/base/update.js +8 -0
- package/dist/taro-h5/dist/api/base/update.js.map +1 -0
- package/dist/taro-h5/dist/api/base/weapp/app-event.d.ts +20 -0
- package/dist/taro-h5/dist/api/base/weapp/app-event.js +143 -0
- package/dist/taro-h5/dist/api/base/weapp/app-event.js.map +1 -0
- package/dist/taro-h5/dist/api/base/weapp/life-cycle.d.ts +4 -0
- package/dist/taro-h5/dist/api/base/weapp/life-cycle.js +19 -0
- package/dist/taro-h5/dist/api/base/weapp/life-cycle.js.map +1 -0
- package/dist/taro-h5/dist/api/canvas/CanvasContext.d.ts +106 -0
- package/dist/taro-h5/dist/api/canvas/CanvasContext.js +219 -0
- package/dist/taro-h5/dist/api/canvas/CanvasContext.js.map +1 -0
- package/dist/taro-h5/dist/api/canvas/canvasGetImageData.d.ts +6 -0
- package/dist/taro-h5/dist/api/canvas/canvasGetImageData.js +29 -0
- package/dist/taro-h5/dist/api/canvas/canvasGetImageData.js.map +1 -0
- package/dist/taro-h5/dist/api/canvas/canvasPutImageData.d.ts +7 -0
- package/dist/taro-h5/dist/api/canvas/canvasPutImageData.js +26 -0
- package/dist/taro-h5/dist/api/canvas/canvasPutImageData.js.map +1 -0
- package/dist/taro-h5/dist/api/canvas/canvasToTempFilePath.d.ts +7 -0
- package/dist/taro-h5/dist/api/canvas/canvasToTempFilePath.js +26 -0
- package/dist/taro-h5/dist/api/canvas/canvasToTempFilePath.js.map +1 -0
- package/dist/taro-h5/dist/api/canvas/createCanvasContext.d.ts +6 -0
- package/dist/taro-h5/dist/api/canvas/createCanvasContext.js +20 -0
- package/dist/taro-h5/dist/api/canvas/createCanvasContext.js.map +1 -0
- package/dist/taro-h5/dist/api/canvas/index.d.ts +10 -0
- package/dist/taro-h5/dist/api/canvas/index.js +12 -0
- package/dist/taro-h5/dist/api/canvas/index.js.map +1 -0
- package/dist/taro-h5/dist/api/cloud/index.d.ts +14 -0
- package/dist/taro-h5/dist/api/cloud/index.js +25 -0
- package/dist/taro-h5/dist/api/cloud/index.js.map +1 -0
- package/dist/taro-h5/dist/api/data-analysis/index.d.ts +4 -0
- package/dist/taro-h5/dist/api/data-analysis/index.js +9 -0
- package/dist/taro-h5/dist/api/data-analysis/index.js.map +1 -0
- package/dist/taro-h5/dist/api/device/accelerometer.d.ts +18 -0
- package/dist/taro-h5/dist/api/device/accelerometer.js +79 -0
- package/dist/taro-h5/dist/api/device/accelerometer.js.map +1 -0
- package/dist/taro-h5/dist/api/device/accessibility.d.ts +1 -0
- package/dist/taro-h5/dist/api/device/accessibility.js +7 -0
- package/dist/taro-h5/dist/api/device/accessibility.js.map +1 -0
- package/dist/taro-h5/dist/api/device/battery.d.ts +4 -0
- package/dist/taro-h5/dist/api/device/battery.js +27 -0
- package/dist/taro-h5/dist/api/device/battery.js.map +1 -0
- package/dist/taro-h5/dist/api/device/bluetooth-ble.d.ts +16 -0
- package/dist/taro-h5/dist/api/device/bluetooth-ble.js +22 -0
- package/dist/taro-h5/dist/api/device/bluetooth-ble.js.map +1 -0
- package/dist/taro-h5/dist/api/device/bluetooth-peripheral.d.ts +3 -0
- package/dist/taro-h5/dist/api/device/bluetooth-peripheral.js +9 -0
- package/dist/taro-h5/dist/api/device/bluetooth-peripheral.js.map +1 -0
- package/dist/taro-h5/dist/api/device/bluetooth.d.ts +13 -0
- package/dist/taro-h5/dist/api/device/bluetooth.js +19 -0
- package/dist/taro-h5/dist/api/device/bluetooth.js.map +1 -0
- package/dist/taro-h5/dist/api/device/calendar.d.ts +4 -0
- package/dist/taro-h5/dist/api/device/calendar.js +147 -0
- package/dist/taro-h5/dist/api/device/calendar.js.map +1 -0
- package/dist/taro-h5/dist/api/device/clipboard.d.ts +16 -0
- package/dist/taro-h5/dist/api/device/clipboard.js +77 -0
- package/dist/taro-h5/dist/api/device/clipboard.js.map +1 -0
- package/dist/taro-h5/dist/api/device/compass.d.ts +18 -0
- package/dist/taro-h5/dist/api/device/compass.js +82 -0
- package/dist/taro-h5/dist/api/device/compass.js.map +1 -0
- package/dist/taro-h5/dist/api/device/contact.d.ts +2 -0
- package/dist/taro-h5/dist/api/device/contact.js +8 -0
- package/dist/taro-h5/dist/api/device/contact.js.map +1 -0
- package/dist/taro-h5/dist/api/device/crypto.d.ts +1 -0
- package/dist/taro-h5/dist/api/device/crypto.js +7 -0
- package/dist/taro-h5/dist/api/device/crypto.js.map +1 -0
- package/dist/taro-h5/dist/api/device/gyroscope.d.ts +4 -0
- package/dist/taro-h5/dist/api/device/gyroscope.js +10 -0
- package/dist/taro-h5/dist/api/device/gyroscope.js.map +1 -0
- package/dist/taro-h5/dist/api/device/iBeacon.d.ts +7 -0
- package/dist/taro-h5/dist/api/device/iBeacon.js +13 -0
- package/dist/taro-h5/dist/api/device/iBeacon.js.map +1 -0
- package/dist/taro-h5/dist/api/device/index.d.ts +24 -0
- package/dist/taro-h5/dist/api/device/index.js +25 -0
- package/dist/taro-h5/dist/api/device/index.js.map +1 -0
- package/dist/taro-h5/dist/api/device/keyboard.d.ts +4 -0
- package/dist/taro-h5/dist/api/device/keyboard.js +10 -0
- package/dist/taro-h5/dist/api/device/keyboard.js.map +1 -0
- package/dist/taro-h5/dist/api/device/memory.d.ts +2 -0
- package/dist/taro-h5/dist/api/device/memory.js +8 -0
- package/dist/taro-h5/dist/api/device/memory.js.map +1 -0
- package/dist/taro-h5/dist/api/device/motion.d.ts +18 -0
- package/dist/taro-h5/dist/api/device/motion.js +76 -0
- package/dist/taro-h5/dist/api/device/motion.js.map +1 -0
- package/dist/taro-h5/dist/api/device/network.d.ts +15 -0
- package/dist/taro-h5/dist/api/device/network.js +83 -0
- package/dist/taro-h5/dist/api/device/network.js.map +1 -0
- package/dist/taro-h5/dist/api/device/nfc.d.ts +7 -0
- package/dist/taro-h5/dist/api/device/nfc.js +13 -0
- package/dist/taro-h5/dist/api/device/nfc.js.map +1 -0
- package/dist/taro-h5/dist/api/device/phone.d.ts +3 -0
- package/dist/taro-h5/dist/api/device/phone.js +28 -0
- package/dist/taro-h5/dist/api/device/phone.js.map +1 -0
- package/dist/taro-h5/dist/api/device/scan.d.ts +3 -0
- package/dist/taro-h5/dist/api/device/scan.js +14 -0
- package/dist/taro-h5/dist/api/device/scan.js.map +1 -0
- package/dist/taro-h5/dist/api/device/screen.d.ts +9 -0
- package/dist/taro-h5/dist/api/device/screen.js +15 -0
- package/dist/taro-h5/dist/api/device/screen.js.map +1 -0
- package/dist/taro-h5/dist/api/device/sms.d.ts +1 -0
- package/dist/taro-h5/dist/api/device/sms.js +7 -0
- package/dist/taro-h5/dist/api/device/sms.js.map +1 -0
- package/dist/taro-h5/dist/api/device/vibrate.d.ts +10 -0
- package/dist/taro-h5/dist/api/device/vibrate.js +44 -0
- package/dist/taro-h5/dist/api/device/vibrate.js.map +1 -0
- package/dist/taro-h5/dist/api/device/wifi.d.ts +12 -0
- package/dist/taro-h5/dist/api/device/wifi.js +18 -0
- package/dist/taro-h5/dist/api/device/wifi.js.map +1 -0
- package/dist/taro-h5/dist/api/ext/index.d.ts +2 -0
- package/dist/taro-h5/dist/api/ext/index.js +8 -0
- package/dist/taro-h5/dist/api/ext/index.js.map +1 -0
- package/dist/taro-h5/dist/api/files/index.d.ts +8 -0
- package/dist/taro-h5/dist/api/files/index.js +14 -0
- package/dist/taro-h5/dist/api/files/index.js.map +1 -0
- package/dist/taro-h5/dist/api/framework/index.d.ts +5 -0
- package/dist/taro-h5/dist/api/framework/index.js +11 -0
- package/dist/taro-h5/dist/api/framework/index.js.map +1 -0
- package/dist/taro-h5/dist/api/index.d.ts +25 -0
- package/dist/taro-h5/dist/api/index.js +133 -0
- package/dist/taro-h5/dist/api/index.js.map +1 -0
- package/dist/taro-h5/dist/api/location/chooseLocation.d.ts +7 -0
- package/dist/taro-h5/dist/api/location/chooseLocation.js +105 -0
- package/dist/taro-h5/dist/api/location/chooseLocation.js.map +1 -0
- package/dist/taro-h5/dist/api/location/getLocation.d.ts +3 -0
- package/dist/taro-h5/dist/api/location/getLocation.js +68 -0
- package/dist/taro-h5/dist/api/location/getLocation.js.map +1 -0
- package/dist/taro-h5/dist/api/location/index.d.ts +9 -0
- package/dist/taro-h5/dist/api/location/index.js +15 -0
- package/dist/taro-h5/dist/api/location/index.js.map +1 -0
- package/dist/taro-h5/dist/api/location/locationChange.d.ts +6 -0
- package/dist/taro-h5/dist/api/location/locationChange.js +130 -0
- package/dist/taro-h5/dist/api/location/locationChange.js.map +1 -0
- package/dist/taro-h5/dist/api/location/style.scss.js +8 -0
- package/dist/taro-h5/dist/api/location/style.scss.js.map +1 -0
- package/dist/taro-h5/dist/api/location/utils.d.ts +1 -0
- package/dist/taro-h5/dist/api/location/utils.js +4 -0
- package/dist/taro-h5/dist/api/location/utils.js.map +1 -0
- package/dist/taro-h5/dist/api/media/EditorContext.d.ts +17 -0
- package/dist/taro-h5/dist/api/media/audio/InnerAudioContext.d.ts +61 -0
- package/dist/taro-h5/dist/api/media/audio/InnerAudioContext.js +101 -0
- package/dist/taro-h5/dist/api/media/audio/InnerAudioContext.js.map +1 -0
- package/dist/taro-h5/dist/api/media/audio/index.d.ts +14 -0
- package/dist/taro-h5/dist/api/media/audio/index.js +19 -0
- package/dist/taro-h5/dist/api/media/audio/index.js.map +1 -0
- package/dist/taro-h5/dist/api/media/background-audio/BackgroundAudioManager.d.ts +64 -0
- package/dist/taro-h5/dist/api/media/background-audio/BackgroundAudioManager.js +101 -0
- package/dist/taro-h5/dist/api/media/background-audio/BackgroundAudioManager.js.map +1 -0
- package/dist/taro-h5/dist/api/media/background-audio/index.d.ts +13 -0
- package/dist/taro-h5/dist/api/media/background-audio/index.js +24 -0
- package/dist/taro-h5/dist/api/media/background-audio/index.js.map +1 -0
- package/dist/taro-h5/dist/api/media/camera.d.ts +1 -0
- package/dist/taro-h5/dist/api/media/camera.js +7 -0
- package/dist/taro-h5/dist/api/media/camera.js.map +1 -0
- package/dist/taro-h5/dist/api/media/image/chooseImage.d.ts +7 -0
- package/dist/taro-h5/dist/api/media/image/chooseImage.js +46 -0
- package/dist/taro-h5/dist/api/media/image/chooseImage.js.map +1 -0
- package/dist/taro-h5/dist/api/media/image/getImageInfo.d.ts +6 -0
- package/dist/taro-h5/dist/api/media/image/getImageInfo.js +50 -0
- package/dist/taro-h5/dist/api/media/image/getImageInfo.js.map +1 -0
- package/dist/taro-h5/dist/api/media/image/index.d.ts +11 -0
- package/dist/taro-h5/dist/api/media/image/index.js +14 -0
- package/dist/taro-h5/dist/api/media/image/index.js.map +1 -0
- package/dist/taro-h5/dist/api/media/image/previewImage.d.ts +9 -0
- package/dist/taro-h5/dist/api/media/image/previewImage.js +85 -0
- package/dist/taro-h5/dist/api/media/image/previewImage.js.map +1 -0
- package/dist/taro-h5/dist/api/media/image/saveImageToPhotosAlbum.d.ts +3 -0
- package/dist/taro-h5/dist/api/media/image/saveImageToPhotosAlbum.js +30 -0
- package/dist/taro-h5/dist/api/media/image/saveImageToPhotosAlbum.js.map +1 -0
- package/dist/taro-h5/dist/api/media/index.d.ts +12 -0
- package/dist/taro-h5/dist/api/media/index.js +13 -0
- package/dist/taro-h5/dist/api/media/index.js.map +1 -0
- package/dist/taro-h5/dist/api/media/live.d.ts +2 -0
- package/dist/taro-h5/dist/api/media/live.js +8 -0
- package/dist/taro-h5/dist/api/media/live.js.map +1 -0
- package/dist/taro-h5/dist/api/media/map.d.ts +1 -0
- package/dist/taro-h5/dist/api/media/map.js +7 -0
- package/dist/taro-h5/dist/api/media/map.js.map +1 -0
- package/dist/taro-h5/dist/api/media/media-recorder.d.ts +1 -0
- package/dist/taro-h5/dist/api/media/media-recorder.js +7 -0
- package/dist/taro-h5/dist/api/media/media-recorder.js.map +1 -0
- package/dist/taro-h5/dist/api/media/recorder.d.ts +3 -0
- package/dist/taro-h5/dist/api/media/recorder.js +9 -0
- package/dist/taro-h5/dist/api/media/recorder.js.map +1 -0
- package/dist/taro-h5/dist/api/media/video/chooseMedia.d.ts +6 -0
- package/dist/taro-h5/dist/api/media/video/chooseMedia.js +210 -0
- package/dist/taro-h5/dist/api/media/video/chooseMedia.js.map +1 -0
- package/dist/taro-h5/dist/api/media/video/chooseVideo.d.ts +7 -0
- package/dist/taro-h5/dist/api/media/video/chooseVideo.js +44 -0
- package/dist/taro-h5/dist/api/media/video/chooseVideo.js.map +1 -0
- package/dist/taro-h5/dist/api/media/video/getVideoInfo.d.ts +4 -0
- package/dist/taro-h5/dist/api/media/video/getVideoInfo.js +63 -0
- package/dist/taro-h5/dist/api/media/video/getVideoInfo.js.map +1 -0
- package/dist/taro-h5/dist/api/media/video/index.d.ts +12 -0
- package/dist/taro-h5/dist/api/media/video/index.js +19 -0
- package/dist/taro-h5/dist/api/media/video/index.js.map +1 -0
- package/dist/taro-h5/dist/api/media/video/saveVideoToPhotosAlbum.d.ts +3 -0
- package/dist/taro-h5/dist/api/media/video/saveVideoToPhotosAlbum.js +30 -0
- package/dist/taro-h5/dist/api/media/video/saveVideoToPhotosAlbum.js.map +1 -0
- package/dist/taro-h5/dist/api/media/video-decoder.d.ts +1 -0
- package/dist/taro-h5/dist/api/media/video-decoder.js +7 -0
- package/dist/taro-h5/dist/api/media/video-decoder.js.map +1 -0
- package/dist/taro-h5/dist/api/media/video-processing.d.ts +1 -0
- package/dist/taro-h5/dist/api/media/video-processing.js +7 -0
- package/dist/taro-h5/dist/api/media/video-processing.js.map +1 -0
- package/dist/taro-h5/dist/api/media/voip.d.ts +16 -0
- package/dist/taro-h5/dist/api/media/voip.js +22 -0
- package/dist/taro-h5/dist/api/media/voip.js.map +1 -0
- package/dist/taro-h5/dist/api/navigate/index.d.ts +5 -0
- package/dist/taro-h5/dist/api/navigate/index.js +11 -0
- package/dist/taro-h5/dist/api/navigate/index.js.map +1 -0
- package/dist/taro-h5/dist/api/network/download.d.ts +7 -0
- package/dist/taro-h5/dist/api/network/download.js +138 -0
- package/dist/taro-h5/dist/api/network/download.js.map +1 -0
- package/dist/taro-h5/dist/api/network/index.d.ts +7 -0
- package/dist/taro-h5/dist/api/network/index.js +8 -0
- package/dist/taro-h5/dist/api/network/index.js.map +1 -0
- package/dist/taro-h5/dist/api/network/mdns.d.ts +10 -0
- package/dist/taro-h5/dist/api/network/mdns.js +16 -0
- package/dist/taro-h5/dist/api/network/mdns.js.map +1 -0
- package/dist/taro-h5/dist/api/network/request/index.d.ts +7 -0
- package/dist/taro-h5/dist/api/network/request/index.js +179 -0
- package/dist/taro-h5/dist/api/network/request/index.js.map +1 -0
- package/dist/taro-h5/dist/api/network/tcp.d.ts +1 -0
- package/dist/taro-h5/dist/api/network/tcp.js +7 -0
- package/dist/taro-h5/dist/api/network/tcp.js.map +1 -0
- package/dist/taro-h5/dist/api/network/udp.d.ts +1 -0
- package/dist/taro-h5/dist/api/network/udp.js +7 -0
- package/dist/taro-h5/dist/api/network/udp.js.map +1 -0
- package/dist/taro-h5/dist/api/network/upload.d.ts +6 -0
- package/dist/taro-h5/dist/api/network/upload.js +159 -0
- package/dist/taro-h5/dist/api/network/upload.js.map +1 -0
- package/dist/taro-h5/dist/api/network/utils.d.ts +44 -0
- package/dist/taro-h5/dist/api/network/utils.js +69 -0
- package/dist/taro-h5/dist/api/network/utils.js.map +1 -0
- package/dist/taro-h5/dist/api/network/websocket/index.d.ts +9 -0
- package/dist/taro-h5/dist/api/network/websocket/index.js +74 -0
- package/dist/taro-h5/dist/api/network/websocket/index.js.map +1 -0
- package/dist/taro-h5/dist/api/network/websocket/socketTask.d.ts +26 -0
- package/dist/taro-h5/dist/api/network/websocket/socketTask.js +68 -0
- package/dist/taro-h5/dist/api/network/websocket/socketTask.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/account.d.ts +1 -0
- package/dist/taro-h5/dist/api/open-api/account.js +7 -0
- package/dist/taro-h5/dist/api/open-api/account.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/address.d.ts +1 -0
- package/dist/taro-h5/dist/api/open-api/address.js +7 -0
- package/dist/taro-h5/dist/api/open-api/address.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/authorize.d.ts +2 -0
- package/dist/taro-h5/dist/api/open-api/authorize.js +8 -0
- package/dist/taro-h5/dist/api/open-api/authorize.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/card.d.ts +2 -0
- package/dist/taro-h5/dist/api/open-api/card.js +8 -0
- package/dist/taro-h5/dist/api/open-api/card.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/channels-live.d.ts +8 -0
- package/dist/taro-h5/dist/api/open-api/channels-live.js +14 -0
- package/dist/taro-h5/dist/api/open-api/channels-live.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/customer-service.d.ts +1 -0
- package/dist/taro-h5/dist/api/open-api/customer-service.js +7 -0
- package/dist/taro-h5/dist/api/open-api/customer-service.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/device-voip.d.ts +2 -0
- package/dist/taro-h5/dist/api/open-api/device-voip.js +8 -0
- package/dist/taro-h5/dist/api/open-api/device-voip.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/facial.d.ts +4 -0
- package/dist/taro-h5/dist/api/open-api/facial.js +10 -0
- package/dist/taro-h5/dist/api/open-api/facial.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/favorites.d.ts +2 -0
- package/dist/taro-h5/dist/api/open-api/favorites.js +8 -0
- package/dist/taro-h5/dist/api/open-api/favorites.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/group.d.ts +1 -0
- package/dist/taro-h5/dist/api/open-api/group.js +7 -0
- package/dist/taro-h5/dist/api/open-api/group.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/index.d.ts +21 -0
- package/dist/taro-h5/dist/api/open-api/index.js +22 -0
- package/dist/taro-h5/dist/api/open-api/index.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/invoice.d.ts +2 -0
- package/dist/taro-h5/dist/api/open-api/invoice.js +8 -0
- package/dist/taro-h5/dist/api/open-api/invoice.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/license-plate.d.ts +1 -0
- package/dist/taro-h5/dist/api/open-api/license-plate.js +7 -0
- package/dist/taro-h5/dist/api/open-api/license-plate.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/login.d.ts +3 -0
- package/dist/taro-h5/dist/api/open-api/login.js +9 -0
- package/dist/taro-h5/dist/api/open-api/login.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/my-miniprogram.d.ts +1 -0
- package/dist/taro-h5/dist/api/open-api/my-miniprogram.js +7 -0
- package/dist/taro-h5/dist/api/open-api/my-miniprogram.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/privacy.d.ts +4 -0
- package/dist/taro-h5/dist/api/open-api/privacy.js +10 -0
- package/dist/taro-h5/dist/api/open-api/privacy.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/red-package.d.ts +1 -0
- package/dist/taro-h5/dist/api/open-api/red-package.js +7 -0
- package/dist/taro-h5/dist/api/open-api/red-package.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/settings.d.ts +2 -0
- package/dist/taro-h5/dist/api/open-api/settings.js +8 -0
- package/dist/taro-h5/dist/api/open-api/settings.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/soter.d.ts +3 -0
- package/dist/taro-h5/dist/api/open-api/soter.js +9 -0
- package/dist/taro-h5/dist/api/open-api/soter.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/subscribe-message.d.ts +2 -0
- package/dist/taro-h5/dist/api/open-api/subscribe-message.js +9 -0
- package/dist/taro-h5/dist/api/open-api/subscribe-message.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/user-info.d.ts +2 -0
- package/dist/taro-h5/dist/api/open-api/user-info.js +8 -0
- package/dist/taro-h5/dist/api/open-api/user-info.js.map +1 -0
- package/dist/taro-h5/dist/api/open-api/werun.d.ts +2 -0
- package/dist/taro-h5/dist/api/open-api/werun.js +8 -0
- package/dist/taro-h5/dist/api/open-api/werun.js.map +1 -0
- package/dist/taro-h5/dist/api/payment/index.d.ts +3 -0
- package/dist/taro-h5/dist/api/payment/index.js +9 -0
- package/dist/taro-h5/dist/api/payment/index.js.map +1 -0
- package/dist/taro-h5/dist/api/qq/index.d.ts +9 -0
- package/dist/taro-h5/dist/api/qq/index.js +15 -0
- package/dist/taro-h5/dist/api/qq/index.js.map +1 -0
- package/dist/taro-h5/dist/api/route/index.d.ts +7 -0
- package/dist/taro-h5/dist/api/route/index.js +12 -0
- package/dist/taro-h5/dist/api/route/index.js.map +1 -0
- package/dist/taro-h5/dist/api/share/index.d.ts +20 -0
- package/dist/taro-h5/dist/api/share/index.js +26 -0
- package/dist/taro-h5/dist/api/share/index.js.map +1 -0
- package/dist/taro-h5/dist/api/storage/background-fetch.d.ts +4 -0
- package/dist/taro-h5/dist/api/storage/background-fetch.js +10 -0
- package/dist/taro-h5/dist/api/storage/background-fetch.js.map +1 -0
- package/dist/taro-h5/dist/api/storage/cache-manager.d.ts +1 -0
- package/dist/taro-h5/dist/api/storage/cache-manager.js +7 -0
- package/dist/taro-h5/dist/api/storage/cache-manager.js.map +1 -0
- package/dist/taro-h5/dist/api/storage/index.d.ts +20 -0
- package/dist/taro-h5/dist/api/storage/index.js +166 -0
- package/dist/taro-h5/dist/api/storage/index.js.map +1 -0
- package/dist/taro-h5/dist/api/swan/index.d.ts +21 -0
- package/dist/taro-h5/dist/api/swan/index.js +30 -0
- package/dist/taro-h5/dist/api/swan/index.js.map +1 -0
- package/dist/taro-h5/dist/api/taro.d.ts +25 -0
- package/dist/taro-h5/dist/api/taro.js +114 -0
- package/dist/taro-h5/dist/api/taro.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/animation/index.d.ts +3 -0
- package/dist/taro-h5/dist/api/ui/animation/index.js +321 -0
- package/dist/taro-h5/dist/api/ui/animation/index.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/animation/worklet.d.ts +2 -0
- package/dist/taro-h5/dist/api/ui/animation/worklet.js +24 -0
- package/dist/taro-h5/dist/api/ui/animation/worklet.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/background.d.ts +2 -0
- package/dist/taro-h5/dist/api/ui/background.js +8 -0
- package/dist/taro-h5/dist/api/ui/background.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/custom-component.d.ts +1 -0
- package/dist/taro-h5/dist/api/ui/custom-component.js +7 -0
- package/dist/taro-h5/dist/api/ui/custom-component.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/fonts.d.ts +3 -0
- package/dist/taro-h5/dist/api/ui/fonts.js +57 -0
- package/dist/taro-h5/dist/api/ui/fonts.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/index.d.ts +13 -0
- package/dist/taro-h5/dist/api/ui/index.js +14 -0
- package/dist/taro-h5/dist/api/ui/index.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/interaction/actionSheet.d.ts +74 -0
- package/dist/taro-h5/dist/api/ui/interaction/actionSheet.js +212 -0
- package/dist/taro-h5/dist/api/ui/interaction/actionSheet.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/interaction/index.d.ts +11 -0
- package/dist/taro-h5/dist/api/ui/interaction/index.js +279 -0
- package/dist/taro-h5/dist/api/ui/interaction/index.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/interaction/modal.d.ts +72 -0
- package/dist/taro-h5/dist/api/ui/interaction/modal.js +207 -0
- package/dist/taro-h5/dist/api/ui/interaction/modal.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/interaction/toast.d.ts +86 -0
- package/dist/taro-h5/dist/api/ui/interaction/toast.js +185 -0
- package/dist/taro-h5/dist/api/ui/interaction/toast.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/menu.d.ts +1 -0
- package/dist/taro-h5/dist/api/ui/menu.js +7 -0
- package/dist/taro-h5/dist/api/ui/menu.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/navigation-bar/index.d.ts +16 -0
- package/dist/taro-h5/dist/api/ui/navigation-bar/index.js +62 -0
- package/dist/taro-h5/dist/api/ui/navigation-bar/index.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/pull-down-refresh.d.ts +10 -0
- package/dist/taro-h5/dist/api/ui/pull-down-refresh.js +30 -0
- package/dist/taro-h5/dist/api/ui/pull-down-refresh.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/scroll/index.d.ts +6 -0
- package/dist/taro-h5/dist/api/ui/scroll/index.js +89 -0
- package/dist/taro-h5/dist/api/ui/scroll/index.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/sticky.d.ts +1 -0
- package/dist/taro-h5/dist/api/ui/sticky.js +7 -0
- package/dist/taro-h5/dist/api/ui/sticky.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/tab-bar.d.ts +35 -0
- package/dist/taro-h5/dist/api/ui/tab-bar.js +287 -0
- package/dist/taro-h5/dist/api/ui/tab-bar.js.map +1 -0
- package/dist/taro-h5/dist/api/ui/window.d.ts +15 -0
- package/dist/taro-h5/dist/api/ui/window.js +36 -0
- package/dist/taro-h5/dist/api/ui/window.js.map +1 -0
- package/dist/taro-h5/dist/api/worker/index.d.ts +1 -0
- package/dist/taro-h5/dist/api/worker/index.js +7 -0
- package/dist/taro-h5/dist/api/worker/index.js.map +1 -0
- package/dist/taro-h5/dist/api/wxml/IntersectionObserver.d.ts +21 -0
- package/dist/taro-h5/dist/api/wxml/IntersectionObserver.js +113 -0
- package/dist/taro-h5/dist/api/wxml/IntersectionObserver.js.map +1 -0
- package/dist/taro-h5/dist/api/wxml/MediaQueryObserver.d.ts +8 -0
- package/dist/taro-h5/dist/api/wxml/MediaQueryObserver.js +55 -0
- package/dist/taro-h5/dist/api/wxml/MediaQueryObserver.js.map +1 -0
- package/dist/taro-h5/dist/api/wxml/index.d.ts +7 -0
- package/dist/taro-h5/dist/api/wxml/index.js +17 -0
- package/dist/taro-h5/dist/api/wxml/index.js.map +1 -0
- package/dist/taro-h5/dist/api/wxml/nodesRef.d.ts +15 -0
- package/dist/taro-h5/dist/api/wxml/nodesRef.js +48 -0
- package/dist/taro-h5/dist/api/wxml/nodesRef.js.map +1 -0
- package/dist/taro-h5/dist/api/wxml/selectorQuery.d.ts +25 -0
- package/dist/taro-h5/dist/api/wxml/selectorQuery.js +214 -0
- package/dist/taro-h5/dist/api/wxml/selectorQuery.js.map +1 -0
- package/dist/taro-h5/dist/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +29 -0
- package/dist/taro-h5/dist/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/taro-h5/dist/utils/animation.d.ts +6 -0
- package/dist/taro-h5/dist/utils/animation.js +17 -0
- package/dist/taro-h5/dist/utils/animation.js.map +1 -0
- package/dist/taro-h5/dist/utils/handler.d.ts +42 -0
- package/dist/taro-h5/dist/utils/handler.js +86 -0
- package/dist/taro-h5/dist/utils/handler.js.map +1 -0
- package/dist/taro-h5/dist/utils/helper.d.ts +1 -0
- package/dist/taro-h5/dist/utils/helper.js +11 -0
- package/dist/taro-h5/dist/utils/helper.js.map +1 -0
- package/dist/taro-h5/dist/utils/index.d.ts +40 -0
- package/dist/taro-h5/dist/utils/index.js +181 -0
- package/dist/taro-h5/dist/utils/index.js.map +1 -0
- package/dist/taro-h5/dist/utils/valid.d.ts +1 -0
- package/dist/taro-h5/dist/utils/valid.js +7 -0
- package/dist/taro-h5/dist/utils/valid.js.map +1 -0
- package/dist/taro-h5/types/api.d.ts +4 -0
- package/dist/taro-h5/types/component.d.ts +6 -0
- package/dist/taro-h5/types/define.d.ts +2 -0
- package/dist/taro-h5/types/global.d.ts +1 -0
- package/dist/taro-h5/types/index.d.ts +33 -0
- package/dist/taro-h5/types/overlay.d.ts +9 -0
- package/package.json +143 -8
- package/dist/index.cjs.d.ts +0 -921
- package/dist/index.cjs.js +0 -5406
- package/dist/index.cjs.js.map +0 -1
- /package/dist/{bom → runtime/bom}/URL.d.ts +0 -0
- /package/dist/{bom → runtime/bom}/URL.js +0 -0
- /package/dist/{bom → runtime/bom}/URL.js.map +0 -0
- /package/dist/{bom → runtime/bom}/URLSearchParams.d.ts +0 -0
- /package/dist/{bom → runtime/bom}/URLSearchParams.js +0 -0
- /package/dist/{bom → runtime/bom}/URLSearchParams.js.map +0 -0
- /package/dist/{bom → runtime/bom}/document.d.ts +0 -0
- /package/dist/{bom → runtime/bom}/document.js +0 -0
- /package/dist/{bom → runtime/bom}/document.js.map +0 -0
- /package/dist/{bom → runtime/bom}/getComputedStyle.d.ts +0 -0
- /package/dist/{bom → runtime/bom}/getComputedStyle.js +0 -0
- /package/dist/{bom → runtime/bom}/getComputedStyle.js.map +0 -0
- /package/dist/{bom → runtime/bom}/history.d.ts +0 -0
- /package/dist/{bom → runtime/bom}/history.js +0 -0
- /package/dist/{bom → runtime/bom}/history.js.map +0 -0
- /package/dist/{bom → runtime/bom}/location.d.ts +0 -0
- /package/dist/{bom → runtime/bom}/location.js +0 -0
- /package/dist/{bom → runtime/bom}/location.js.map +0 -0
- /package/dist/{bom → runtime/bom}/navigator.d.ts +0 -0
- /package/dist/{bom → runtime/bom}/navigator.js +0 -0
- /package/dist/{bom → runtime/bom}/navigator.js.map +0 -0
- /package/dist/{bom → runtime/bom}/raf.d.ts +0 -0
- /package/dist/{bom → runtime/bom}/raf.js +0 -0
- /package/dist/{bom → runtime/bom}/raf.js.map +0 -0
- /package/dist/{bom → runtime/bom}/window.d.ts +0 -0
- /package/dist/{bom → runtime/bom}/window.js +0 -0
- /package/dist/{bom → runtime/bom}/window.js.map +0 -0
- /package/dist/{constants → runtime/constants}/index.d.ts +0 -0
- /package/dist/{constants → runtime/constants}/index.js +0 -0
- /package/dist/{constants → runtime/constants}/index.js.map +0 -0
- /package/dist/{current.d.ts → runtime/current.d.ts} +0 -0
- /package/dist/{current.js → runtime/current.js} +0 -0
- /package/dist/{current.js.map → runtime/current.js.map} +0 -0
- /package/dist/{dom → runtime/dom}/anchor-element.js +0 -0
- /package/dist/{dom → runtime/dom}/anchor-element.js.map +0 -0
- /package/dist/{dom → runtime/dom}/class-list.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/class-list.js +0 -0
- /package/dist/{dom → runtime/dom}/class-list.js.map +0 -0
- /package/dist/{dom → runtime/dom}/document.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/document.js +0 -0
- /package/dist/{dom → runtime/dom}/document.js.map +0 -0
- /package/dist/{dom → runtime/dom}/element.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/element.js +0 -0
- /package/dist/{dom → runtime/dom}/element.js.map +0 -0
- /package/dist/{dom → runtime/dom}/event-source.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/event-source.js +0 -0
- /package/dist/{dom → runtime/dom}/event-source.js.map +0 -0
- /package/dist/{dom → runtime/dom}/event-target.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/event-target.js +0 -0
- /package/dist/{dom → runtime/dom}/event-target.js.map +0 -0
- /package/dist/{dom → runtime/dom}/event.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/event.js +0 -0
- /package/dist/{dom → runtime/dom}/event.js.map +0 -0
- /package/dist/{dom → runtime/dom}/form.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/form.js +0 -0
- /package/dist/{dom → runtime/dom}/form.js.map +0 -0
- /package/dist/{dom → runtime/dom}/node.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/node.js +0 -0
- /package/dist/{dom → runtime/dom}/node.js.map +0 -0
- /package/dist/{dom → runtime/dom}/node_types.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/root.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/root.js +0 -0
- /package/dist/{dom → runtime/dom}/root.js.map +0 -0
- /package/dist/{dom → runtime/dom}/style.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/style.js +0 -0
- /package/dist/{dom → runtime/dom}/style.js.map +0 -0
- /package/dist/{dom → runtime/dom}/style_properties.js +0 -0
- /package/dist/{dom → runtime/dom}/style_properties.js.map +0 -0
- /package/dist/{dom → runtime/dom}/svg.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/svg.js +0 -0
- /package/dist/{dom → runtime/dom}/svg.js.map +0 -0
- /package/dist/{dom → runtime/dom}/text.d.ts +0 -0
- /package/dist/{dom → runtime/dom}/text.js +0 -0
- /package/dist/{dom → runtime/dom}/text.js.map +0 -0
- /package/dist/{dom → runtime/dom}/transfer.js +0 -0
- /package/dist/{dom → runtime/dom}/transfer.js.map +0 -0
- /package/dist/{dom → runtime/dom}/tree.js +0 -0
- /package/dist/{dom → runtime/dom}/tree.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/element.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/element.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/index.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/index.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/html.d.ts +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/html.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/html.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/parser.d.ts +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/parser.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/parser.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/scanner.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/scanner.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/style.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/style.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/tags.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/tags.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/utils.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/inner-html/utils.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/mutation-observer/implements.d.ts +0 -0
- /package/dist/{dom-external → runtime/dom-external}/mutation-observer/implements.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/mutation-observer/implements.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/mutation-observer/index.d.ts +0 -0
- /package/dist/{dom-external → runtime/dom-external}/mutation-observer/index.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/mutation-observer/index.js.map +0 -0
- /package/dist/{dom-external → runtime/dom-external}/mutation-observer/record.d.ts +0 -0
- /package/dist/{dom-external → runtime/dom-external}/node.js +0 -0
- /package/dist/{dom-external → runtime/dom-external}/node.js.map +0 -0
- /package/dist/{dsl → runtime/dsl}/common.d.ts +0 -0
- /package/dist/{dsl → runtime/dsl}/common.js +0 -0
- /package/dist/{dsl → runtime/dsl}/common.js.map +0 -0
- /package/dist/{dsl → runtime/dsl}/instance.d.ts +0 -0
- /package/dist/{emitter → runtime/emitter}/emitter.d.ts +0 -0
- /package/dist/{emitter → runtime/emitter}/emitter.js +0 -0
- /package/dist/{emitter → runtime/emitter}/emitter.js.map +0 -0
- /package/dist/{env.d.ts → runtime/env.d.ts} +0 -0
- /package/dist/{env.js → runtime/env.js} +0 -0
- /package/dist/{env.js.map → runtime/env.js.map} +0 -0
- /package/dist/{hydrate.d.ts → runtime/hydrate.d.ts} +0 -0
- /package/dist/{hydrate.js → runtime/hydrate.js} +0 -0
- /package/dist/{hydrate.js.map → runtime/hydrate.js.map} +0 -0
- /package/dist/{index.d.ts → runtime/index.d.ts} +0 -0
- /package/dist/{index.js → runtime/index.js} +0 -0
- /package/dist/{index.js.map → runtime/index.js.map} +0 -0
- /package/dist/{interface → runtime/interface}/animate.d.ts +0 -0
- /package/dist/{interface → runtime/interface}/element.d.ts +0 -0
- /package/dist/{interface → runtime/interface}/event-target.d.ts +0 -0
- /package/dist/{interface → runtime/interface}/event.d.ts +0 -0
- /package/dist/{interface → runtime/interface}/hydrate.d.ts +0 -0
- /package/dist/{interface → runtime/interface}/node.d.ts +0 -0
- /package/dist/{interface → runtime/interface}/options.d.ts +0 -0
- /package/dist/{interface → runtime/interface}/utils.d.ts +0 -0
- /package/dist/{next-tick.d.ts → runtime/next-tick.d.ts} +0 -0
- /package/dist/{next-tick.js → runtime/next-tick.js} +0 -0
- /package/dist/{next-tick.js.map → runtime/next-tick.js.map} +0 -0
- /package/dist/{options.d.ts → runtime/options.d.ts} +0 -0
- /package/dist/{options.js → runtime/options.js} +0 -0
- /package/dist/{options.js.map → runtime/options.js.map} +0 -0
- /package/dist/{perf.d.ts → runtime/perf.d.ts} +0 -0
- /package/dist/{perf.js → runtime/perf.js} +0 -0
- /package/dist/{perf.js.map → runtime/perf.js.map} +0 -0
- /package/dist/{polyfill → runtime/polyfill}/array.js +0 -0
- /package/dist/{polyfill → runtime/polyfill}/array.js.map +0 -0
- /package/dist/{polyfill → runtime/polyfill}/index.d.ts +0 -0
- /package/dist/{polyfill → runtime/polyfill}/index.js +0 -0
- /package/dist/{polyfill → runtime/polyfill}/index.js.map +0 -0
- /package/dist/{polyfill → runtime/polyfill}/intersection-observer.js +0 -0
- /package/dist/{polyfill → runtime/polyfill}/intersection-observer.js.map +0 -0
- /package/dist/{polyfill → runtime/polyfill}/object.js +0 -0
- /package/dist/{polyfill → runtime/polyfill}/object.js.map +0 -0
- /package/dist/{runtime.esm.d.ts → runtime/runtime.esm.d.ts} +0 -0
- /package/dist/{runtime.esm.js → runtime/runtime.esm.js} +0 -0
- /package/dist/{runtime.esm.js.map → runtime/runtime.esm.js.map} +0 -0
- /package/dist/{utils → runtime/utils}/cache.d.ts +0 -0
- /package/dist/{utils → runtime/utils}/cache.js +0 -0
- /package/dist/{utils → runtime/utils}/cache.js.map +0 -0
- /package/dist/{utils → runtime/utils}/index.d.ts +0 -0
- /package/dist/{utils → runtime/utils}/index.js +0 -0
- /package/dist/{utils → runtime/utils}/index.js.map +0 -0
- /package/dist/{utils → runtime/utils}/lodash.d.ts +0 -0
- /package/dist/{utils → runtime/utils}/lodash.js +0 -0
- /package/dist/{utils → runtime/utils}/lodash.js.map +0 -0
- /package/dist/{utils → runtime/utils}/router.d.ts +0 -0
- /package/dist/{utils → runtime/utils}/router.js +0 -0
- /package/dist/{utils → runtime/utils}/router.js.map +0 -0
|
@@ -0,0 +1,1165 @@
|
|
|
1
|
+
import { PLATFORM_TYPE, isObject, isEnableTTDom, isString, isFunction, toCamelCase, UNITLESS_PROPERTIES_SET, isNumber, capitalize, internalComponents, isUndefined, noop, isBoolean, hooks, ensure } from '@tarojs/shared';
|
|
2
|
+
import { setInnerHTML, FormElement, convertNumber2PX, eventHandlerTTDom, document } from '@tarojs/runtime';
|
|
3
|
+
import Reconciler from 'react-reconciler';
|
|
4
|
+
import {
|
|
5
|
+
ContinuousEventPriority,
|
|
6
|
+
DefaultEventPriority,
|
|
7
|
+
DiscreteEventPriority,
|
|
8
|
+
NoEventPriority
|
|
9
|
+
} from 'react-reconciler/constants';
|
|
10
|
+
|
|
11
|
+
const supportedInputTypes = {
|
|
12
|
+
color: true,
|
|
13
|
+
date: true,
|
|
14
|
+
datetime: true,
|
|
15
|
+
'datetime-local': true,
|
|
16
|
+
email: true,
|
|
17
|
+
month: true,
|
|
18
|
+
number: true,
|
|
19
|
+
password: true,
|
|
20
|
+
range: true,
|
|
21
|
+
search: true,
|
|
22
|
+
tel: true,
|
|
23
|
+
text: true,
|
|
24
|
+
time: true,
|
|
25
|
+
url: true,
|
|
26
|
+
week: true,
|
|
27
|
+
};
|
|
28
|
+
function getEventPriority(domEventName) {
|
|
29
|
+
switch (domEventName) {
|
|
30
|
+
case 'cancel':
|
|
31
|
+
case 'click':
|
|
32
|
+
case 'close':
|
|
33
|
+
case 'contextmenu':
|
|
34
|
+
case 'copy':
|
|
35
|
+
case 'cut':
|
|
36
|
+
case 'dragend':
|
|
37
|
+
case 'dragstart':
|
|
38
|
+
case 'drop':
|
|
39
|
+
case 'input':
|
|
40
|
+
case 'paste':
|
|
41
|
+
case 'pause':
|
|
42
|
+
case 'play':
|
|
43
|
+
case 'pointercancel':
|
|
44
|
+
case 'pointerdown':
|
|
45
|
+
case 'pointerup':
|
|
46
|
+
case 'reset':
|
|
47
|
+
case 'resize':
|
|
48
|
+
case 'submit':
|
|
49
|
+
case 'touchcancel':
|
|
50
|
+
case 'touchend':
|
|
51
|
+
case 'touchstart':
|
|
52
|
+
case 'change':
|
|
53
|
+
case 'blur':
|
|
54
|
+
case 'focus':
|
|
55
|
+
case 'select':
|
|
56
|
+
case 'selectstart':
|
|
57
|
+
return DiscreteEventPriority;
|
|
58
|
+
case 'drag':
|
|
59
|
+
case 'dragenter':
|
|
60
|
+
case 'dragexit':
|
|
61
|
+
case 'dragleave':
|
|
62
|
+
case 'dragover':
|
|
63
|
+
case 'pointermove':
|
|
64
|
+
case 'pointerout':
|
|
65
|
+
case 'pointerover':
|
|
66
|
+
case 'scroll':
|
|
67
|
+
case 'toggle':
|
|
68
|
+
case 'touchmove':
|
|
69
|
+
case 'pointerenter':
|
|
70
|
+
case 'pointerleave':
|
|
71
|
+
return ContinuousEventPriority;
|
|
72
|
+
default:
|
|
73
|
+
return DefaultEventPriority;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const randomKey = Math.random()
|
|
77
|
+
.toString(36)
|
|
78
|
+
.slice(2);
|
|
79
|
+
const internalPropsKey = '__reactProps$' + randomKey;
|
|
80
|
+
const internalInstanceKey = '__reactFiber$' + randomKey;
|
|
81
|
+
const internalContainerInstanceKey = '__reactContainer$' + randomKey;
|
|
82
|
+
// const internalEventHandlersKey = '__reactEvents$' + randomKey
|
|
83
|
+
// const internalEventHandlerListenersKey = '__reactListeners$' + randomKey
|
|
84
|
+
// const internalEventHandlesSetKey = '__reactHandles$' + randomKey
|
|
85
|
+
|
|
86
|
+
const HostRoot = 3; // Root of a host tree. Could be nested inside another node.
|
|
87
|
+
const HostComponent = 5;
|
|
88
|
+
const HostText = 6;
|
|
89
|
+
const SuspenseComponent = 13;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 给 TaroElement 绑定 react fiber、react props 等属性
|
|
93
|
+
* 提供 fiber -> element、element -> fiber、element -> props 的方法
|
|
94
|
+
*/
|
|
95
|
+
function precacheFiberNode(hostInst, node) {
|
|
96
|
+
node[internalInstanceKey] = hostInst;
|
|
97
|
+
}
|
|
98
|
+
function markContainerAsRoot(hostRoot, node) {
|
|
99
|
+
node[internalContainerInstanceKey] = hostRoot;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
|
|
103
|
+
* instance, or null if the node was not rendered by this React.
|
|
104
|
+
*/
|
|
105
|
+
function getInstanceFromNode(node) {
|
|
106
|
+
const inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
|
|
107
|
+
if (inst) {
|
|
108
|
+
if (inst.tag === HostComponent ||
|
|
109
|
+
inst.tag === HostText ||
|
|
110
|
+
inst.tag === SuspenseComponent ||
|
|
111
|
+
inst.tag === HostRoot) {
|
|
112
|
+
return inst;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
|
|
122
|
+
* DOM node.
|
|
123
|
+
*/
|
|
124
|
+
function getNodeFromInstance(inst) {
|
|
125
|
+
if (inst.tag === HostComponent || inst.tag === HostText) {
|
|
126
|
+
// In Fiber this, is just the state node right now. We assume it will be
|
|
127
|
+
// a host component or host text.
|
|
128
|
+
return inst.stateNode;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function getFiberCurrentPropsFromNode(node) {
|
|
132
|
+
return node[internalPropsKey] || null;
|
|
133
|
+
}
|
|
134
|
+
function updateFiberProps(node, props) {
|
|
135
|
+
node[internalPropsKey] = props;
|
|
136
|
+
if (process.env.TARO_PLATFORM === 'harmony') {
|
|
137
|
+
// @ts-ignore
|
|
138
|
+
node.updateTextNode();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// 从 props 中,更新 input 组件的 value 值
|
|
143
|
+
function updateInputWrapper(element, oldValue, props) {
|
|
144
|
+
const node = element;
|
|
145
|
+
const checked = props.checked;
|
|
146
|
+
if (checked != null) {
|
|
147
|
+
console.warn('updateCheck 未实现', node);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
updateWrapper(element, oldValue, props);
|
|
151
|
+
updateNamedCousins(element, props);
|
|
152
|
+
}
|
|
153
|
+
// react 中原本处理 type=radio 的逻辑,这里留个空,暂时不处理
|
|
154
|
+
function updateNamedCousins(rootNode, props) {
|
|
155
|
+
const name = props.name;
|
|
156
|
+
if (props.type === 'radio' && name != null) {
|
|
157
|
+
console.warn('radio updateNamedCousins 未实现', rootNode, props);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function getToStringValue(value) {
|
|
161
|
+
const isEmptyType = typeof value === 'function' || typeof value === 'symbol';
|
|
162
|
+
return isEmptyType ? '' : value;
|
|
163
|
+
}
|
|
164
|
+
function toString(value) {
|
|
165
|
+
return '' + value;
|
|
166
|
+
}
|
|
167
|
+
function updateWrapper(element, oldValue, props) {
|
|
168
|
+
const node = element;
|
|
169
|
+
const value = getToStringValue(props.value);
|
|
170
|
+
const type = props.type;
|
|
171
|
+
setNodeValue(node, oldValue, value, type);
|
|
172
|
+
}
|
|
173
|
+
// oldValue 为 event.detail.value,value 为 fiber.props.value
|
|
174
|
+
// 如果 oldValue 和 value 不相等,代表受控组件需要更新
|
|
175
|
+
// 更新的原则为,fiber.props.value 永远为用户所需要的值,因此 node.value = toString(value)
|
|
176
|
+
function setNodeValue(node, oldValue, value, type = 'string') {
|
|
177
|
+
if (value != null) {
|
|
178
|
+
if (type === 'number') {
|
|
179
|
+
if ((value === 0 && node.value === '')
|
|
180
|
+
// We explicitly want to coerce to number here if possible.
|
|
181
|
+
// eslint-disable-next-line
|
|
182
|
+
|| oldValue != value) {
|
|
183
|
+
node.value = toString(value);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
else if (oldValue !== toString(value)) {
|
|
187
|
+
node.value = toString(value);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
else if (type === 'submit' || type === 'reset') {
|
|
191
|
+
// Submit/reset inputs need the attribute removed completely to avoid
|
|
192
|
+
// blank-text buttons.
|
|
193
|
+
node.removeAttribute('value');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// 判断当前 TaroElement 是否为 supportedInputTypes input 或 textarea
|
|
197
|
+
function isTextInputElement(elem) {
|
|
198
|
+
const nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
199
|
+
if (nodeName === 'input') {
|
|
200
|
+
const type = elem.type;
|
|
201
|
+
return !type || !!supportedInputTypes[type];
|
|
202
|
+
}
|
|
203
|
+
if (nodeName === 'textarea') {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
const ReactDOMTextareaRestoreControlledState = updateWrapper;
|
|
209
|
+
const ReactDOMInputRestoreControlledState = updateInputWrapper;
|
|
210
|
+
|
|
211
|
+
function isCheckable(elem) {
|
|
212
|
+
const type = elem.type;
|
|
213
|
+
const nodeName = elem.nodeName;
|
|
214
|
+
return (nodeName &&
|
|
215
|
+
nodeName.toLowerCase() === 'input' &&
|
|
216
|
+
(type === 'checkbox' || type === 'radio'));
|
|
217
|
+
}
|
|
218
|
+
function getTracker(node) {
|
|
219
|
+
return node._valueTracker;
|
|
220
|
+
}
|
|
221
|
+
function detachTracker(node) {
|
|
222
|
+
node._valueTracker = null;
|
|
223
|
+
}
|
|
224
|
+
// 之所以单独创建一个 tacker,是为了统一监听不同 type 的 input 值
|
|
225
|
+
// 比如 type=checkbox 或者 type=radio,就需要监听 checked,而不是 value
|
|
226
|
+
// 虽然目前还未实现 checkbox 和 radio 的 finishEventHandle,但后续不好说,所以先统一和 react 一样的写法
|
|
227
|
+
// 需要特别注意的是,tracker 初始化时的值为 node 的初始值,但后续会变更为事件的 detail.value 值
|
|
228
|
+
function trackValueOnNode(node) {
|
|
229
|
+
const valueField = isCheckable(node) ? 'checked' : 'value';
|
|
230
|
+
const descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
|
|
231
|
+
let currentValue = '' + node[valueField];
|
|
232
|
+
if (node.hasOwnProperty(valueField) ||
|
|
233
|
+
typeof descriptor === 'undefined' ||
|
|
234
|
+
typeof descriptor.get !== 'function' ||
|
|
235
|
+
typeof descriptor.set !== 'function') {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
const { get, set } = descriptor;
|
|
239
|
+
Object.defineProperty(node, valueField, {
|
|
240
|
+
configurable: true,
|
|
241
|
+
enumerable: descriptor.enumerable,
|
|
242
|
+
get: function () {
|
|
243
|
+
return get.call(this);
|
|
244
|
+
},
|
|
245
|
+
set: function (value) {
|
|
246
|
+
currentValue = '' + value;
|
|
247
|
+
set.call(this, value);
|
|
248
|
+
},
|
|
249
|
+
});
|
|
250
|
+
const tracker = {
|
|
251
|
+
getValue() {
|
|
252
|
+
return currentValue;
|
|
253
|
+
},
|
|
254
|
+
setValue(value) {
|
|
255
|
+
currentValue = '' + value;
|
|
256
|
+
},
|
|
257
|
+
stopTracking() {
|
|
258
|
+
detachTracker(node);
|
|
259
|
+
delete node[valueField];
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
return tracker;
|
|
263
|
+
}
|
|
264
|
+
function track(node) {
|
|
265
|
+
if (getTracker(node)) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
node._valueTracker = trackValueOnNode(node);
|
|
269
|
+
}
|
|
270
|
+
function updateValueIfChanged(node, nextValue) {
|
|
271
|
+
if (!node) {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
const tracker = getTracker(node);
|
|
275
|
+
if (!tracker) {
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
const lastValue = tracker.getValue();
|
|
279
|
+
if (nextValue !== lastValue) {
|
|
280
|
+
tracker.setValue(nextValue);
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const IS_NON_DIMENSIONAL = /aspect|acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
287
|
+
const IS_DATASET_OR_ARIA = /^(data|aria)-/;
|
|
288
|
+
function isEventName(s) {
|
|
289
|
+
return s[0] === 'o' && s[1] === 'n';
|
|
290
|
+
}
|
|
291
|
+
function isEqual(obj1, obj2) {
|
|
292
|
+
// 首先检查引用是否相同
|
|
293
|
+
if (obj1 === obj2) {
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
// 如果两者中有一个不是对象,或者为 null,直接返回 false
|
|
297
|
+
if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
// 获取两个对象键的数组
|
|
301
|
+
const keys1 = Object.keys(obj1);
|
|
302
|
+
const keys2 = Object.keys(obj2);
|
|
303
|
+
// 如果键的数量不相同,对象显然不相等
|
|
304
|
+
if (keys1.length !== keys2.length) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
// 遍历对象的每个键,比较两个对象同一键的值
|
|
308
|
+
for (let i = 0; i < keys1.length; i++) {
|
|
309
|
+
const key = keys1[i];
|
|
310
|
+
if (obj1[key] !== obj2[key]) {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
// 如果所有键的值都相等,返回 true
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
317
|
+
function updateProps(dom, oldProps, newProps) {
|
|
318
|
+
const updatePayload = getUpdatePayload(dom, oldProps, newProps);
|
|
319
|
+
if (updatePayload) {
|
|
320
|
+
updatePropsByPayload(dom, oldProps, updatePayload);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function updatePropsByPayload(dom, oldProps, updatePayload) {
|
|
324
|
+
const handlers = [];
|
|
325
|
+
let fixedHandler = null;
|
|
326
|
+
for (let i = 0; i < updatePayload.length; i += 2) {
|
|
327
|
+
// key, value 成对出现
|
|
328
|
+
const key = updatePayload[i];
|
|
329
|
+
const newProp = updatePayload[i + 1];
|
|
330
|
+
const oldProp = oldProps[key];
|
|
331
|
+
if (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY) {
|
|
332
|
+
if (key === '__fixed') {
|
|
333
|
+
// hack: __fixed最先识别
|
|
334
|
+
fixedHandler = () => setProperty(dom, key, newProp, oldProp);
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
// 鸿蒙样式前置插入,防止覆盖style
|
|
338
|
+
if (key === '__hmStyle') {
|
|
339
|
+
handlers.splice(0, 0, () => setHarmonyStyle(dom, newProp, oldProp));
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
handlers.push(() => setProperty(dom, key, newProp, oldProp));
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
setProperty(dom, key, newProp, oldProp);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY) {
|
|
350
|
+
fixedHandler && fixedHandler();
|
|
351
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
352
|
+
handlers[i]();
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
function getUpdatePayload(dom, oldProps, newProps) {
|
|
357
|
+
let i;
|
|
358
|
+
let updatePayload = null;
|
|
359
|
+
for (i in oldProps) {
|
|
360
|
+
if (!(i in newProps)) {
|
|
361
|
+
(updatePayload = updatePayload || []).push(i, null);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
const isFormElement = dom instanceof FormElement;
|
|
365
|
+
for (i in newProps) {
|
|
366
|
+
if (oldProps[i] !== newProps[i] || (isFormElement && i === 'value')) {
|
|
367
|
+
// 如果都是 style,且 style 里面的值相等,则无需记录到 payload 中
|
|
368
|
+
if (i === 'style' && isObject(oldProps[i]) && isObject(newProps[i]) && isEqual(oldProps[i], newProps[i]))
|
|
369
|
+
continue;
|
|
370
|
+
(updatePayload = updatePayload || []).push(i, newProps[i]);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return updatePayload;
|
|
374
|
+
}
|
|
375
|
+
// function eventProxy (e: CommonEvent) {
|
|
376
|
+
// const el = document.getElementById(e.currentTarget.id)
|
|
377
|
+
// const handlers = el!.__handlers[e.type]
|
|
378
|
+
// handlers[0](e)
|
|
379
|
+
// }
|
|
380
|
+
function setEvent(dom, name, value, oldValue) {
|
|
381
|
+
const isCapture = name.endsWith('Capture');
|
|
382
|
+
let eventName = name.toLowerCase().slice(2);
|
|
383
|
+
if (isCapture) {
|
|
384
|
+
eventName = eventName.slice(0, -7);
|
|
385
|
+
}
|
|
386
|
+
const compName = capitalize(toCamelCase(dom.tagName.toLowerCase()));
|
|
387
|
+
if (eventName === 'click' && process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY && compName in internalComponents) {
|
|
388
|
+
eventName = 'tap';
|
|
389
|
+
}
|
|
390
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
391
|
+
if (isFunction(oldValue)) {
|
|
392
|
+
dom.removeEventListener(`bind${eventName}`, dom[`__${eventName}__`]);
|
|
393
|
+
}
|
|
394
|
+
if (isFunction(value)) {
|
|
395
|
+
dom[`__${eventName}__`] = eventHandlerTTDom.bind(null, dom, value);
|
|
396
|
+
dom.addEventListener(`bind${eventName}`, dom[`__${eventName}__`], isCapture);
|
|
397
|
+
}
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
if (isFunction(value)) {
|
|
401
|
+
if (oldValue) {
|
|
402
|
+
dom.removeEventListener(eventName, oldValue, process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY ? false : undefined);
|
|
403
|
+
dom.addEventListener(eventName, value, process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY ? { isCapture, sideEffect: false } : undefined);
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
dom.addEventListener(eventName, value, process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY ? isCapture : undefined);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
dom.removeEventListener(eventName, oldValue);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function setStyle(style, key, value) {
|
|
414
|
+
if (key[0] === '-' && process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY) {
|
|
415
|
+
// css variables need not further judgment
|
|
416
|
+
style.setProperty(key, value.toString());
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
style[key] =
|
|
420
|
+
isNumber(value) && IS_NON_DIMENSIONAL.test(key) === false
|
|
421
|
+
? (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY ? value + 'px' : convertNumber2PX(value))
|
|
422
|
+
: value === null
|
|
423
|
+
? ''
|
|
424
|
+
: value;
|
|
425
|
+
}
|
|
426
|
+
// 鸿蒙样式特殊处理,需要在插入顺序中前置插入,防止覆盖了style
|
|
427
|
+
function setHarmonyStyle(dom, value, oldValue) {
|
|
428
|
+
// @ts-ignore
|
|
429
|
+
const style = dom._st.hmStyle; // __hmStyle是已经被处理过的鸿蒙样式,可以直接塞进hmStyle对象内
|
|
430
|
+
if (isObject(oldValue)) {
|
|
431
|
+
for (const i in oldValue) {
|
|
432
|
+
if (!(value && i in value)) {
|
|
433
|
+
// 鸿蒙伪类特殊处理
|
|
434
|
+
if (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY) {
|
|
435
|
+
if (i === '::after' || i === '::before') {
|
|
436
|
+
setPseudo(dom, i, null);
|
|
437
|
+
}
|
|
438
|
+
else if (['::first-child', '::last-child', '::empty'].includes(i) || `${i}`.indexOf('::nth-child') === 0) {
|
|
439
|
+
// @ts-ignore
|
|
440
|
+
dom.set_pseudo_class(i, null);
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
if (i === 'position' && oldValue[i] === 'fixed') {
|
|
444
|
+
// @ts-ignore
|
|
445
|
+
dom.setLayer(0);
|
|
446
|
+
}
|
|
447
|
+
else if (i === 'animationName') {
|
|
448
|
+
// @ts-ignore
|
|
449
|
+
dom.setAnimation(false);
|
|
450
|
+
}
|
|
451
|
+
style[i] = '';
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
style[i] = '';
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
if (isObject(value)) {
|
|
461
|
+
for (const i in value) {
|
|
462
|
+
if (!oldValue || !isEqual(value[i], oldValue[i])) {
|
|
463
|
+
// 鸿蒙伪类特殊处理
|
|
464
|
+
if (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY) {
|
|
465
|
+
if (i === '::after' || i === '::before') {
|
|
466
|
+
setPseudo(dom, i, value[i]);
|
|
467
|
+
}
|
|
468
|
+
else if (['::first-child', '::last-child', '::empty'].includes(i) || i.startsWith('::nth-child')) {
|
|
469
|
+
// @ts-ignore
|
|
470
|
+
dom.set_pseudo_class(i, value[i]);
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
if (i === 'position') {
|
|
474
|
+
if (value[i] === 'fixed' || (value[i] !== 'fixed' && (oldValue === null || oldValue === void 0 ? void 0 : oldValue[i]))) {
|
|
475
|
+
// @ts-ignore
|
|
476
|
+
dom.setLayer(value[i] === 'fixed' ? 1 : 0);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
else if (i === 'animationName') {
|
|
480
|
+
// @ts-ignore
|
|
481
|
+
dom.setAnimation(true);
|
|
482
|
+
}
|
|
483
|
+
style[i] = value[i];
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
style[i] = value[i];
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
dom.setAttribute('__hmStyle', value);
|
|
493
|
+
}
|
|
494
|
+
function setProperty(dom, name, value, oldValue) {
|
|
495
|
+
var _a, _b;
|
|
496
|
+
name = name === 'className' ? 'class' : name;
|
|
497
|
+
if (name === 'key' ||
|
|
498
|
+
name === 'children' ||
|
|
499
|
+
name === 'ref') ;
|
|
500
|
+
else if (name === 'style') {
|
|
501
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
502
|
+
if (isString(value)) {
|
|
503
|
+
dom.setAttribute('style', value);
|
|
504
|
+
}
|
|
505
|
+
else if (isObject(value)) {
|
|
506
|
+
dom.setAttribute('style', styleObjectToCss(value));
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
if (/harmony.*cpp/.test(process.env.TARO_ENV || '')) {
|
|
511
|
+
return dom.setAttribute('_style4cpp', value);
|
|
512
|
+
}
|
|
513
|
+
const style = dom.style;
|
|
514
|
+
if (isString(value)) {
|
|
515
|
+
style.cssText = value;
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
if (isString(oldValue)) {
|
|
519
|
+
style.cssText = '';
|
|
520
|
+
oldValue = null;
|
|
521
|
+
}
|
|
522
|
+
if (isObject(oldValue)) {
|
|
523
|
+
for (const i in oldValue) {
|
|
524
|
+
if (!(value && i in value)) {
|
|
525
|
+
// Harmony特殊处理
|
|
526
|
+
if (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY && i === 'position' && oldValue[i] === 'fixed') {
|
|
527
|
+
// @ts-ignore
|
|
528
|
+
dom.setLayer(0);
|
|
529
|
+
}
|
|
530
|
+
setStyle(style, i, '');
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if (isObject(value)) {
|
|
535
|
+
for (const i in value) {
|
|
536
|
+
if (!oldValue || !isEqual(value[i], oldValue[i])) {
|
|
537
|
+
// Harmony特殊处理
|
|
538
|
+
if (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY && i === 'position') {
|
|
539
|
+
if (value[i] === 'fixed' || (value[i] !== 'fixed' && (oldValue === null || oldValue === void 0 ? void 0 : oldValue[i]))) {
|
|
540
|
+
// @ts-ignore
|
|
541
|
+
dom.setLayer(value[i] === 'fixed' ? 1 : 0);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
setStyle(style, i, value[i]);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
else if (isEventName(name)) {
|
|
552
|
+
setEvent(dom, name, value, oldValue);
|
|
553
|
+
}
|
|
554
|
+
else if (name === 'dangerouslySetInnerHTML') {
|
|
555
|
+
const newHtml = (_a = value === null || value === void 0 ? void 0 : value.__html) !== null && _a !== void 0 ? _a : '';
|
|
556
|
+
const oldHtml = (_b = oldValue === null || oldValue === void 0 ? void 0 : oldValue.__html) !== null && _b !== void 0 ? _b : '';
|
|
557
|
+
if (newHtml || oldHtml) {
|
|
558
|
+
if (oldHtml !== newHtml) {
|
|
559
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
560
|
+
setInnerHTML(dom, newHtml);
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
dom.innerHTML = newHtml;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
else if (!isFunction(value)) {
|
|
569
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom() && !IS_DATASET_OR_ARIA.test(name)) {
|
|
570
|
+
name = toCamelCase(name);
|
|
571
|
+
}
|
|
572
|
+
if (value == null) {
|
|
573
|
+
dom.removeAttribute(name);
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
dom.setAttribute(name, value);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
// 设置鸿蒙伪类属性(特殊设置)
|
|
581
|
+
function setPseudo(dom, name, value) {
|
|
582
|
+
if (name === '::after') {
|
|
583
|
+
// @ts-ignore
|
|
584
|
+
dom.set_pseudo_after(value);
|
|
585
|
+
}
|
|
586
|
+
else if (name === '::before') {
|
|
587
|
+
// @ts-ignore
|
|
588
|
+
dom.set_pseudo_before(value);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
function styleObjectToCss(style) {
|
|
592
|
+
return Object.entries(style)
|
|
593
|
+
.map(([key, value]) => {
|
|
594
|
+
const kebabCaseKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
595
|
+
const cssValue = typeof value === 'number' && !UNITLESS_PROPERTIES_SET.has(kebabCaseKey) ? `${value}px` : value === null ? '' : value;
|
|
596
|
+
return `${kebabCaseKey}: ${cssValue};`;
|
|
597
|
+
})
|
|
598
|
+
.join(' ');
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/* eslint-disable @typescript-eslint/indent */
|
|
602
|
+
let taroCurrentUpdatePriority = NoEventPriority;
|
|
603
|
+
const taroNotPendingTransition = null;
|
|
604
|
+
const taroHostTransitionContext = {
|
|
605
|
+
$$typeof: Symbol.for('react.context'),
|
|
606
|
+
_currentValue: taroNotPendingTransition,
|
|
607
|
+
_currentValue2: taroNotPendingTransition,
|
|
608
|
+
_threadCount: 0,
|
|
609
|
+
Provider: null,
|
|
610
|
+
Consumer: null
|
|
611
|
+
};
|
|
612
|
+
taroHostTransitionContext.Provider = taroHostTransitionContext;
|
|
613
|
+
taroHostTransitionContext.Consumer = taroHostTransitionContext;
|
|
614
|
+
/**
|
|
615
|
+
* WX VPT Page outlet projection
|
|
616
|
+
* -----------------------------
|
|
617
|
+
* VPT retains one React ownership tree while WX exposes one independent setData surface per native Page. The singleton App
|
|
618
|
+
* host records live in each Page's `app` data, the current Page records live in `page`, and Page WXML supplies its own template
|
|
619
|
+
* as the default light-DOM slot of the virtual recursive App component. Taro restarts deep template recursion through nested
|
|
620
|
+
* `comp` components. At every such native component boundary the slot must be forwarded only through the App branch that
|
|
621
|
+
* contains the VPT Page outlet rendered for React's `{children}`: forwarding through all sibling branches creates duplicate
|
|
622
|
+
* unnamed slot consumers, while forwarding through none loses the Page.
|
|
623
|
+
*
|
|
624
|
+
* `vo` is the compact, branch-local answer to "does this App subtree contain the VPT Page outlet?". WXML reads only `i.vo`,
|
|
625
|
+
* so its decision is O(1) and it never scans descendants or receives Page data. This renderer owns `vo` rather than Taro's
|
|
626
|
+
* hydrate or root scheduler because React's commit boundary is the first point where every host mutation has completed and
|
|
627
|
+
* the final parent chain is authoritative. TaroElement already supports arbitrary properties: setAttribute updates
|
|
628
|
+
* node.props and queues the normal granular `app.*.vo` path. Structural Taro payloads are lazy functions flushed by setTimeout, so they run
|
|
629
|
+
* after resetAfterCommit and naturally serialize the same final `vo` props. There is consequently no projection-specific
|
|
630
|
+
* hydration mode, update-path translation, or full App snapshot.
|
|
631
|
+
*
|
|
632
|
+
* High-level commit flow:
|
|
633
|
+
* 1. React applies all Taro host insertions, removals, and reparenting synchronously.
|
|
634
|
+
* 2. resetAfterCommit obtains the unique VPT Page outlet and walks parentNode from that outlet to the App root.
|
|
635
|
+
* 3. The unchanged root-side suffix is skipped; old leaf-side nodes receive vo=false and new ones receive vo=true.
|
|
636
|
+
* 4. Ordinary Taro attribute updates join structural updates in the already scheduled App batch.
|
|
637
|
+
* 5. Lazy hydration observes node.props.vo, and the App batch fans out unchanged to every retained native Page.
|
|
638
|
+
*
|
|
639
|
+
* The App root stores the only persistent projection state as a VPT Page outlet-to-root node array. It contains O(D)
|
|
640
|
+
* references, where D is outlet depth, so index 0 is the outlet represented by the latest queued native batch. A normal commit
|
|
641
|
+
* performs an O(D) parent walk and raw array comparison and emits no native data when the spine is unchanged. A move touches
|
|
642
|
+
* only the leaf-side portions outside the common root-side suffix and never depends on total App size W or Page size. React
|
|
643
|
+
* can replace a host when moving it across parents; only then (and during initialization) a single O(W) search finds the new
|
|
644
|
+
* VPT Page outlet. WXML still performs one constant-time boolean check per recursive boundary.
|
|
645
|
+
*/
|
|
646
|
+
const VPT_PAGE_OUTLET = 'vpt_page_outlet';
|
|
647
|
+
const VPT_PAGE_OUTLET_BRANCH = 'vo';
|
|
648
|
+
const vptPageOutletSpineKey = Symbol('vptPageOutletSpine');
|
|
649
|
+
/** Finds the VPT Page outlet only during initialization or after React replaced the cached VPT Page outlet host. */
|
|
650
|
+
function findVptPageOutlet(node) {
|
|
651
|
+
if (node.nodeName === VPT_PAGE_OUTLET)
|
|
652
|
+
return node;
|
|
653
|
+
const children = node.childNodes;
|
|
654
|
+
for (let index = 0; index < children.length; index++) {
|
|
655
|
+
const vptPageOutlet = findVptPageOutlet(children[index]);
|
|
656
|
+
if (vptPageOutlet)
|
|
657
|
+
return vptPageOutlet;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
/** Builds the final ancestor identity array from the VPT Page outlet to the App root. */
|
|
661
|
+
function collectVptPageOutletSpine(container, vptPageOutlet) {
|
|
662
|
+
// This local array is filled once in parent-link order, then retained unchanged as the next VPT Page outlet spine.
|
|
663
|
+
const spine = [];
|
|
664
|
+
for (let node = vptPageOutlet; node !== container; node = node.parentNode) {
|
|
665
|
+
spine.push(node);
|
|
666
|
+
}
|
|
667
|
+
return spine;
|
|
668
|
+
}
|
|
669
|
+
/** Reconciles VPT Page outlet branch membership through ordinary Taro host props after one complete React commit. */
|
|
670
|
+
function reconcileVptPageOutletSpine(container) {
|
|
671
|
+
// Other React roots, including standalone Page/component roots, do not own the singleton VPT App-view projection.
|
|
672
|
+
if (!container.parentNode || container.parentNode.nodeName !== 'container')
|
|
673
|
+
return;
|
|
674
|
+
const previousSpine = container[vptPageOutletSpineKey] || [];
|
|
675
|
+
const previousVptPageOutlet = previousSpine[0];
|
|
676
|
+
/*
|
|
677
|
+
* Reuse the cached VPT Page outlet while it remains under this App root. Cross-parent React reconciliation may replace
|
|
678
|
+
* the host rather than reparent its Taro node, so a detached cache entry requires one search of the committed tree.
|
|
679
|
+
*/
|
|
680
|
+
const vptPageOutlet = previousVptPageOutlet && previousVptPageOutlet._root === container
|
|
681
|
+
? previousVptPageOutlet
|
|
682
|
+
: findVptPageOutlet(container);
|
|
683
|
+
ensure(vptPageOutlet, 'App must render children exactly once.');
|
|
684
|
+
const currentSpine = collectVptPageOutletSpine(container, vptPageOutlet);
|
|
685
|
+
/*
|
|
686
|
+
* VPT Page outlet parent chains are stored outlet-to-root, so equal nodes form a root-side suffix. These mutable indexes
|
|
687
|
+
* walk that suffix once without iterator, callback, Set, or intermediate-array allocation; the remaining prefixes are the
|
|
688
|
+
* only candidates whose branch marker can differ.
|
|
689
|
+
*/
|
|
690
|
+
let previousIndex = previousSpine.length - 1;
|
|
691
|
+
let currentIndex = currentSpine.length - 1;
|
|
692
|
+
while (previousIndex >= 0 && currentIndex >= 0 && previousSpine[previousIndex] === currentSpine[currentIndex]) {
|
|
693
|
+
previousIndex--;
|
|
694
|
+
currentIndex--;
|
|
695
|
+
}
|
|
696
|
+
/*
|
|
697
|
+
* Detached old nodes are already removed by their parent's structural payload. Surviving nodes in the changed old prefix
|
|
698
|
+
* still have native records, so clear their marker through Taro's ordinary attribute queue.
|
|
699
|
+
*/
|
|
700
|
+
for (let index = 0; index <= previousIndex; index++) {
|
|
701
|
+
const node = previousSpine[index];
|
|
702
|
+
if (node._root === container) {
|
|
703
|
+
node.setAttribute(VPT_PAGE_OUTLET_BRANCH, false);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
// Write the changed current prefix after clearing the old prefix so any surviving moved identity ends with vo=true.
|
|
707
|
+
for (let index = 0; index <= currentIndex; index++) {
|
|
708
|
+
currentSpine[index].setAttribute(VPT_PAGE_OUTLET_BRANCH, true);
|
|
709
|
+
}
|
|
710
|
+
// This is the sole persistent VPT projection state: the ancestor identities in the latest queued native App batch.
|
|
711
|
+
container[vptPageOutletSpineKey] = currentSpine;
|
|
712
|
+
}
|
|
713
|
+
const hostConfig = {
|
|
714
|
+
// React 19 react-reconciler host config additions.
|
|
715
|
+
setCurrentUpdatePriority(priority) {
|
|
716
|
+
taroCurrentUpdatePriority = priority;
|
|
717
|
+
},
|
|
718
|
+
getCurrentUpdatePriority() {
|
|
719
|
+
return taroCurrentUpdatePriority;
|
|
720
|
+
},
|
|
721
|
+
resolveUpdatePriority() {
|
|
722
|
+
return taroCurrentUpdatePriority === NoEventPriority ? DefaultEventPriority : taroCurrentUpdatePriority;
|
|
723
|
+
},
|
|
724
|
+
trackSchedulerEvent: noop,
|
|
725
|
+
resolveEventType: () => null,
|
|
726
|
+
resolveEventTimeStamp: () => -1.1,
|
|
727
|
+
requestPostPaintCallback: noop,
|
|
728
|
+
NotPendingTransition: taroNotPendingTransition,
|
|
729
|
+
HostTransitionContext: taroHostTransitionContext,
|
|
730
|
+
resetFormInstance: noop,
|
|
731
|
+
bindToConsole(methodName, args) {
|
|
732
|
+
const consoleMethod = console[methodName];
|
|
733
|
+
return typeof consoleMethod === 'function' ? consoleMethod.bind(console, ...args) : noop;
|
|
734
|
+
},
|
|
735
|
+
shouldAttemptEagerTransition: () => false,
|
|
736
|
+
maySuspendCommit: () => false,
|
|
737
|
+
maySuspendCommitOnUpdate: () => false,
|
|
738
|
+
maySuspendCommitInSyncRender: () => false,
|
|
739
|
+
preloadInstance: () => true,
|
|
740
|
+
startSuspendingCommit: noop,
|
|
741
|
+
suspendInstance: noop,
|
|
742
|
+
suspendOnActiveViewTransition: noop,
|
|
743
|
+
waitForCommitToBeReady: () => null,
|
|
744
|
+
getSuspendedCommitReason: () => null,
|
|
745
|
+
// below keys order by {React ReactFiberHostConfig.custom.js}, convenient for comparing each other.
|
|
746
|
+
// -------------------
|
|
747
|
+
// required by @types/react-reconciler
|
|
748
|
+
// -------------------
|
|
749
|
+
getPublicInstance(inst) {
|
|
750
|
+
return inst;
|
|
751
|
+
},
|
|
752
|
+
getRootHostContext() {
|
|
753
|
+
return {};
|
|
754
|
+
},
|
|
755
|
+
getChildHostContext(parentHostContext) {
|
|
756
|
+
return parentHostContext;
|
|
757
|
+
},
|
|
758
|
+
prepareForCommit(..._) {
|
|
759
|
+
return null;
|
|
760
|
+
},
|
|
761
|
+
/*
|
|
762
|
+
* React invokes this synchronously after host mutations and before returning from the commit. Taro defers evaluation of
|
|
763
|
+
* structural hydrate functions with setTimeout, so VPT Page outlet branch props written here are batched and visible to
|
|
764
|
+
* every compact record serialized for this commit.
|
|
765
|
+
*/
|
|
766
|
+
resetAfterCommit(container) {
|
|
767
|
+
reconcileVptPageOutletSpine(container);
|
|
768
|
+
},
|
|
769
|
+
createInstance(type, props, _rootContainerInstance, _hostContext, internalInstanceHandle) {
|
|
770
|
+
const element = document.createElement(type);
|
|
771
|
+
precacheFiberNode(internalInstanceHandle, element);
|
|
772
|
+
updateFiberProps(element, props);
|
|
773
|
+
return element;
|
|
774
|
+
},
|
|
775
|
+
appendInitialChild(parent, child) {
|
|
776
|
+
parent.appendChild(child);
|
|
777
|
+
},
|
|
778
|
+
finalizeInitialChildren(dom, type, props) {
|
|
779
|
+
let newProps = props;
|
|
780
|
+
if (dom instanceof FormElement) {
|
|
781
|
+
const [defaultName, defaultKey] = ['switch', 'checkbox', 'radio'].includes(type) ? ['checked', 'defaultChecked'] : ['value', 'defaultValue'];
|
|
782
|
+
if (props.hasOwnProperty(defaultKey)) {
|
|
783
|
+
newProps = Object.assign(Object.assign({}, newProps), { [defaultName]: props[defaultKey] });
|
|
784
|
+
delete newProps[defaultKey];
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
updateProps(dom, {}, newProps); // 提前执行更新属性操作,Taro 在 Page 初始化后会立即从 dom 读取必要信息
|
|
788
|
+
if (type === 'input' || type === 'textarea') {
|
|
789
|
+
track(dom);
|
|
790
|
+
}
|
|
791
|
+
return false;
|
|
792
|
+
},
|
|
793
|
+
prepareUpdate(instance, _, oldProps, newProps) {
|
|
794
|
+
return getUpdatePayload(instance, oldProps, newProps);
|
|
795
|
+
},
|
|
796
|
+
shouldSetTextContent() {
|
|
797
|
+
return false;
|
|
798
|
+
},
|
|
799
|
+
createTextInstance(text, _rootContainerInstance, _hostContext, internalInstanceHandle) {
|
|
800
|
+
const textNode = document.createTextNode(text);
|
|
801
|
+
precacheFiberNode(internalInstanceHandle, textNode);
|
|
802
|
+
return textNode;
|
|
803
|
+
},
|
|
804
|
+
scheduleTimeout: setTimeout,
|
|
805
|
+
cancelTimeout: clearTimeout,
|
|
806
|
+
noTimeout: -1,
|
|
807
|
+
isPrimaryRenderer: true,
|
|
808
|
+
warnsIfNotActing: true,
|
|
809
|
+
supportsMutation: true,
|
|
810
|
+
supportsPersistence: false,
|
|
811
|
+
supportsHydration: false,
|
|
812
|
+
getInstanceFromNode: () => null,
|
|
813
|
+
beforeActiveInstanceBlur: noop,
|
|
814
|
+
afterActiveInstanceBlur: noop,
|
|
815
|
+
preparePortalMount: noop,
|
|
816
|
+
prepareScopeUpdate: noop,
|
|
817
|
+
getInstanceFromScope: () => null,
|
|
818
|
+
getCurrentEventPriority() {
|
|
819
|
+
return DefaultEventPriority;
|
|
820
|
+
},
|
|
821
|
+
detachDeletedInstance: noop,
|
|
822
|
+
// -------------------
|
|
823
|
+
// Microtasks
|
|
824
|
+
// (optional)
|
|
825
|
+
// -------------------
|
|
826
|
+
supportsMicrotasks: true,
|
|
827
|
+
scheduleMicrotask: isUndefined(Promise)
|
|
828
|
+
? setTimeout
|
|
829
|
+
: (callback) => Promise.resolve(null)
|
|
830
|
+
.then(callback)
|
|
831
|
+
.catch(function (error) {
|
|
832
|
+
setTimeout(() => {
|
|
833
|
+
throw error;
|
|
834
|
+
});
|
|
835
|
+
}),
|
|
836
|
+
// -------------------
|
|
837
|
+
// Mutation
|
|
838
|
+
// (required if supportsMutation is true)
|
|
839
|
+
// -------------------
|
|
840
|
+
appendChild(parent, child) {
|
|
841
|
+
parent.appendChild(child);
|
|
842
|
+
},
|
|
843
|
+
appendChildToContainer(parent, child) {
|
|
844
|
+
parent.appendChild(child);
|
|
845
|
+
},
|
|
846
|
+
commitTextUpdate(textInst, _, newText) {
|
|
847
|
+
textInst.nodeValue = newText;
|
|
848
|
+
},
|
|
849
|
+
commitMount: noop,
|
|
850
|
+
commitUpdate(dom, updatePayloadOrType, maybeOldProps, maybeNewProps, maybeFiber) {
|
|
851
|
+
const isReact19Signature = typeof updatePayloadOrType === 'string';
|
|
852
|
+
const oldProps = isReact19Signature ? maybeOldProps : maybeNewProps;
|
|
853
|
+
const newProps = isReact19Signature ? maybeNewProps : maybeFiber;
|
|
854
|
+
const updatePayload = isReact19Signature ? getUpdatePayload(dom, oldProps, newProps) : updatePayloadOrType;
|
|
855
|
+
if (!updatePayload)
|
|
856
|
+
return;
|
|
857
|
+
// payload 只包含 children 的时候,不应该再继续触发后续的属性比较和更新的逻辑了
|
|
858
|
+
if (updatePayload.length === 2 && updatePayload.includes('children'))
|
|
859
|
+
return;
|
|
860
|
+
updatePropsByPayload(dom, oldProps, updatePayload);
|
|
861
|
+
updateFiberProps(dom, newProps);
|
|
862
|
+
},
|
|
863
|
+
insertBefore(parent, child, refChild) {
|
|
864
|
+
parent.insertBefore(child, refChild);
|
|
865
|
+
},
|
|
866
|
+
insertInContainerBefore(parent, child, refChild) {
|
|
867
|
+
parent.insertBefore(child, refChild);
|
|
868
|
+
},
|
|
869
|
+
removeChild(parent, child) {
|
|
870
|
+
parent.removeChild(child);
|
|
871
|
+
},
|
|
872
|
+
removeChildFromContainer(parent, child) {
|
|
873
|
+
parent.removeChild(child);
|
|
874
|
+
},
|
|
875
|
+
resetTextContent: noop,
|
|
876
|
+
hideInstance(instance) {
|
|
877
|
+
const style = instance.style;
|
|
878
|
+
style.setProperty('display', 'none');
|
|
879
|
+
},
|
|
880
|
+
hideTextInstance(textInstance) {
|
|
881
|
+
textInstance.nodeValue = '';
|
|
882
|
+
},
|
|
883
|
+
unhideInstance(instance, props) {
|
|
884
|
+
const styleProp = props.style;
|
|
885
|
+
let display = (styleProp === null || styleProp === void 0 ? void 0 : styleProp.hasOwnProperty('display')) ? styleProp.display : null;
|
|
886
|
+
display = display == null || isBoolean(display) || display === '' ? '' : ('' + display).trim();
|
|
887
|
+
// eslint-disable-next-line dot-notation
|
|
888
|
+
instance.style['display'] = display;
|
|
889
|
+
},
|
|
890
|
+
unhideTextInstance(textInstance, text) {
|
|
891
|
+
textInstance.nodeValue = text;
|
|
892
|
+
},
|
|
893
|
+
clearContainer(element) {
|
|
894
|
+
if (element.childNodes.length > 0) {
|
|
895
|
+
element.textContent = '';
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
const TaroReconciler = Reconciler(hostConfig);
|
|
900
|
+
TaroReconciler.flushSync = TaroReconciler.flushSync || TaroReconciler.flushSyncFromReconciler || TaroReconciler.flushSyncWork;
|
|
901
|
+
TaroReconciler.runWithPriority = TaroReconciler.runWithPriority || ((priority, fn) => {
|
|
902
|
+
const previousPriority = hostConfig.getCurrentUpdatePriority();
|
|
903
|
+
try {
|
|
904
|
+
hostConfig.setCurrentUpdatePriority(priority);
|
|
905
|
+
return fn();
|
|
906
|
+
}
|
|
907
|
+
finally {
|
|
908
|
+
hostConfig.setCurrentUpdatePriority(previousPriority);
|
|
909
|
+
}
|
|
910
|
+
});
|
|
911
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
912
|
+
const foundDevTools = TaroReconciler.injectIntoDevTools({
|
|
913
|
+
bundleType: 1,
|
|
914
|
+
version: '18.0.0',
|
|
915
|
+
rendererPackageName: 'taro-react'
|
|
916
|
+
});
|
|
917
|
+
if (!foundDevTools) {
|
|
918
|
+
// eslint-disable-next-line no-console
|
|
919
|
+
console.info('%cDownload the React DevTools ' +
|
|
920
|
+
'for a better development experience: ' +
|
|
921
|
+
'https://reactjs.org/link/react-devtools', 'font-weight:bold');
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
let restoreQueue = null;
|
|
926
|
+
// 对比 TaroElement tracker 下的 value 和事件下的 value,判断 element 的值是否存在更改
|
|
927
|
+
function getTargetInstForInputOrChangeEvent(e, node) {
|
|
928
|
+
var _a, _b;
|
|
929
|
+
const targetInst = getInstanceFromNode(node);
|
|
930
|
+
const domEventName = e.type;
|
|
931
|
+
if (!targetInst || !isTextInputElement(node))
|
|
932
|
+
return;
|
|
933
|
+
if (domEventName === 'input' || domEventName === 'change') {
|
|
934
|
+
const nextValue = toString((_b = (_a = e.mpEvent) === null || _a === void 0 ? void 0 : _a.detail) === null || _b === void 0 ? void 0 : _b.value);
|
|
935
|
+
return getInstIfValueChanged(targetInst, nextValue);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
function getInstIfValueChanged(targetInst, nextValue) {
|
|
939
|
+
const targetNode = getNodeFromInstance(targetInst);
|
|
940
|
+
if (!targetNode)
|
|
941
|
+
return false;
|
|
942
|
+
if (updateValueIfChanged(targetNode, nextValue)) {
|
|
943
|
+
return targetInst;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
// 把 target 塞入更新队列中
|
|
947
|
+
function enqueueStateRestore(target) {
|
|
948
|
+
if (restoreQueue) {
|
|
949
|
+
restoreQueue.push(target);
|
|
950
|
+
}
|
|
951
|
+
else {
|
|
952
|
+
restoreQueue = [target];
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
// 判断是否需要恢复 target(input、textarea) 的状态
|
|
956
|
+
function needsStateRestore() {
|
|
957
|
+
return restoreQueue !== null;
|
|
958
|
+
}
|
|
959
|
+
function finishEventHandler() {
|
|
960
|
+
const controlledComponentsHavePendingUpdates = needsStateRestore();
|
|
961
|
+
if (controlledComponentsHavePendingUpdates) {
|
|
962
|
+
TaroReconciler.flushSync();
|
|
963
|
+
restoreStateIfNeeded();
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
// 遍历 restoreQueue、restoreTarget,恢复其状态
|
|
967
|
+
function restoreStateIfNeeded() {
|
|
968
|
+
if (!restoreQueue) {
|
|
969
|
+
return;
|
|
970
|
+
}
|
|
971
|
+
const queuedTargets = restoreQueue;
|
|
972
|
+
restoreQueue = null;
|
|
973
|
+
for (let i = 0; i < queuedTargets.length; i++) {
|
|
974
|
+
restoreStateOfTarget(queuedTargets[i]);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
function restoreImpl(domElement, tag, oldValue, props) {
|
|
978
|
+
switch (tag) {
|
|
979
|
+
case 'input':
|
|
980
|
+
ReactDOMInputRestoreControlledState(domElement, oldValue, props);
|
|
981
|
+
break;
|
|
982
|
+
case 'textarea':
|
|
983
|
+
ReactDOMTextareaRestoreControlledState(domElement, oldValue, props);
|
|
984
|
+
break;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
function restoreStateOfTarget(item) {
|
|
988
|
+
const internalInstance = getInstanceFromNode(item.target);
|
|
989
|
+
if (!internalInstance)
|
|
990
|
+
return;
|
|
991
|
+
const { stateNode, type } = internalInstance;
|
|
992
|
+
if (stateNode) {
|
|
993
|
+
const props = getFiberCurrentPropsFromNode(stateNode);
|
|
994
|
+
restoreImpl(stateNode, type, item.value, props);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
const ContainerMap = new WeakMap();
|
|
999
|
+
class Root {
|
|
1000
|
+
constructor(renderer, domContainer, options) {
|
|
1001
|
+
this.renderer = renderer;
|
|
1002
|
+
this.initInternalRoot(renderer, domContainer, options);
|
|
1003
|
+
}
|
|
1004
|
+
initInternalRoot(renderer, domContainer, options) {
|
|
1005
|
+
// Since react-reconciler v0.27, createContainer need more parameters
|
|
1006
|
+
// @see:https://github.com/facebook/react/blob/0b974418c9a56f6c560298560265dcf4b65784bc/packages/react-reconciler/src/ReactFiberReconciler.js#L248
|
|
1007
|
+
const containerInfo = domContainer;
|
|
1008
|
+
if (options) {
|
|
1009
|
+
const tag = 1; // ConcurrentRoot
|
|
1010
|
+
const concurrentUpdatesByDefaultOverride = false;
|
|
1011
|
+
let isStrictMode = false;
|
|
1012
|
+
let identifierPrefix = '';
|
|
1013
|
+
let onUncaughtError = (error) => console.error(error);
|
|
1014
|
+
let onCaughtError = (error, errorInfo) => {
|
|
1015
|
+
console.error(error);
|
|
1016
|
+
if (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.componentStack) {
|
|
1017
|
+
console.error(errorInfo.componentStack);
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
let onRecoverableError = (error) => console.error(error);
|
|
1021
|
+
const onDefaultTransitionIndicator = null;
|
|
1022
|
+
if (options.unstable_strictMode === true) {
|
|
1023
|
+
isStrictMode = true;
|
|
1024
|
+
}
|
|
1025
|
+
if (options.identifierPrefix !== undefined) {
|
|
1026
|
+
identifierPrefix = options.identifierPrefix;
|
|
1027
|
+
}
|
|
1028
|
+
if (options.onUncaughtError !== undefined) {
|
|
1029
|
+
onUncaughtError = options.onUncaughtError;
|
|
1030
|
+
}
|
|
1031
|
+
if (options.onCaughtError !== undefined) {
|
|
1032
|
+
onCaughtError = options.onCaughtError;
|
|
1033
|
+
}
|
|
1034
|
+
if (options.onRecoverableError !== undefined) {
|
|
1035
|
+
onRecoverableError = options.onRecoverableError;
|
|
1036
|
+
}
|
|
1037
|
+
this.internalRoot = renderer.createContainer(containerInfo, tag, null, // hydrationCallbacks
|
|
1038
|
+
isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator);
|
|
1039
|
+
}
|
|
1040
|
+
else {
|
|
1041
|
+
const tag = 0; // LegacyRoot
|
|
1042
|
+
this.internalRoot = renderer.createContainer(containerInfo, tag, null, // hydrationCallbacks
|
|
1043
|
+
false, // isStrictMode
|
|
1044
|
+
false, // concurrentUpdatesByDefaultOverride,
|
|
1045
|
+
'', // identifierPrefix
|
|
1046
|
+
(error) => console.error(error), // onUncaughtError
|
|
1047
|
+
(error) => console.error(error), // onCaughtError
|
|
1048
|
+
(error) => console.error(error), // onRecoverableError
|
|
1049
|
+
null // onDefaultTransitionIndicator
|
|
1050
|
+
);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
render(children, cb) {
|
|
1054
|
+
const { renderer, internalRoot } = this;
|
|
1055
|
+
renderer.updateContainer(children, internalRoot, null, cb);
|
|
1056
|
+
return renderer.getPublicRootInstance(internalRoot);
|
|
1057
|
+
}
|
|
1058
|
+
unmount(cb) {
|
|
1059
|
+
this.renderer.updateContainer(null, this.internalRoot, null, cb);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
function render(element, domContainer, cb) {
|
|
1063
|
+
const oldRoot = ContainerMap.get(domContainer);
|
|
1064
|
+
if (oldRoot != null) {
|
|
1065
|
+
return oldRoot.render(element, cb);
|
|
1066
|
+
}
|
|
1067
|
+
const root = new Root(TaroReconciler, domContainer);
|
|
1068
|
+
ContainerMap.set(domContainer, root);
|
|
1069
|
+
return root.render(element, cb);
|
|
1070
|
+
}
|
|
1071
|
+
function createRoot(domContainer, options = {}) {
|
|
1072
|
+
var _a;
|
|
1073
|
+
const oldRoot = ContainerMap.get(domContainer);
|
|
1074
|
+
if (oldRoot != null) {
|
|
1075
|
+
return oldRoot;
|
|
1076
|
+
}
|
|
1077
|
+
// options should be an object
|
|
1078
|
+
const root = new Root(TaroReconciler, domContainer, options);
|
|
1079
|
+
ContainerMap.set(domContainer, root);
|
|
1080
|
+
markContainerAsRoot((_a = root === null || root === void 0 ? void 0 : root.internalRoot) === null || _a === void 0 ? void 0 : _a.current, domContainer);
|
|
1081
|
+
hooks.tap('dispatchTaroEvent', (e, node) => {
|
|
1082
|
+
const eventPriority = getEventPriority(e.type);
|
|
1083
|
+
TaroReconciler.runWithPriority(eventPriority, () => {
|
|
1084
|
+
node.dispatchEvent(e);
|
|
1085
|
+
});
|
|
1086
|
+
});
|
|
1087
|
+
// 对比 event.detail.value 和 node.tracker.value,判断 value 值是否有变动,存在变动则塞入队列中
|
|
1088
|
+
hooks.tap('modifyTaroEvent', (e, node) => {
|
|
1089
|
+
var _a, _b;
|
|
1090
|
+
const inst = getTargetInstForInputOrChangeEvent(e, node);
|
|
1091
|
+
if (!inst)
|
|
1092
|
+
return;
|
|
1093
|
+
// 这里塞入的是 event.detail.value,也就是事件的值,在受控组件中,你可以理解为需要被变更的值
|
|
1094
|
+
// 后续会在 finishEventHandler 中,使用最新的 fiber.props.value 来与其比较
|
|
1095
|
+
// 如果不一致,则表示需要更新,会执行 node.value = fiber.props.value 的更新操作
|
|
1096
|
+
const nextValue = (_b = (_a = e.mpEvent) === null || _a === void 0 ? void 0 : _a.detail) === null || _b === void 0 ? void 0 : _b.value;
|
|
1097
|
+
enqueueStateRestore({ target: node, value: nextValue });
|
|
1098
|
+
});
|
|
1099
|
+
return root;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1103
|
+
let isInsideEventHandler = false;
|
|
1104
|
+
// 重新包裹 batchedUpdates,使其可以在触发事件后执行 finishEventHandler
|
|
1105
|
+
const unstable_batchedUpdates = (fn, a) => {
|
|
1106
|
+
if (isInsideEventHandler) {
|
|
1107
|
+
return fn(a);
|
|
1108
|
+
}
|
|
1109
|
+
isInsideEventHandler = true;
|
|
1110
|
+
try {
|
|
1111
|
+
return TaroReconciler.batchedUpdates(fn, a);
|
|
1112
|
+
}
|
|
1113
|
+
finally {
|
|
1114
|
+
isInsideEventHandler = false;
|
|
1115
|
+
finishEventHandler();
|
|
1116
|
+
}
|
|
1117
|
+
};
|
|
1118
|
+
function unmountComponentAtNode(dom) {
|
|
1119
|
+
ensure(dom && [1, 8, 9, 11].includes(dom.nodeType), 'unmountComponentAtNode(...): Target container is not a DOM element.');
|
|
1120
|
+
const root = ContainerMap.get(dom);
|
|
1121
|
+
if (!root)
|
|
1122
|
+
return false;
|
|
1123
|
+
unstable_batchedUpdates(() => {
|
|
1124
|
+
root.unmount(() => {
|
|
1125
|
+
ContainerMap.delete(dom);
|
|
1126
|
+
});
|
|
1127
|
+
}, null);
|
|
1128
|
+
return true;
|
|
1129
|
+
}
|
|
1130
|
+
function findDOMNode(comp) {
|
|
1131
|
+
if (comp == null) {
|
|
1132
|
+
return null;
|
|
1133
|
+
}
|
|
1134
|
+
const nodeType = comp.nodeType;
|
|
1135
|
+
if (nodeType === 1 || nodeType === 3) {
|
|
1136
|
+
return comp;
|
|
1137
|
+
}
|
|
1138
|
+
return TaroReconciler.findHostInstance(comp);
|
|
1139
|
+
}
|
|
1140
|
+
const portalType = isFunction(Symbol) && Symbol.for
|
|
1141
|
+
? Symbol.for('react.portal')
|
|
1142
|
+
: 0xeaca;
|
|
1143
|
+
function createPortal(children, containerInfo, key) {
|
|
1144
|
+
return {
|
|
1145
|
+
$$typeof: portalType,
|
|
1146
|
+
key: key == null ? null : String(key),
|
|
1147
|
+
children,
|
|
1148
|
+
containerInfo,
|
|
1149
|
+
implementation: null
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
const flushSync = TaroReconciler.flushSync;
|
|
1153
|
+
var index = {
|
|
1154
|
+
render,
|
|
1155
|
+
flushSync,
|
|
1156
|
+
createRoot,
|
|
1157
|
+
unstable_batchedUpdates,
|
|
1158
|
+
unmountComponentAtNode,
|
|
1159
|
+
findDOMNode,
|
|
1160
|
+
createPortal,
|
|
1161
|
+
internalInstanceKey
|
|
1162
|
+
};
|
|
1163
|
+
|
|
1164
|
+
export { createPortal, createRoot, index as default, findDOMNode, flushSync, internalInstanceKey, render, unmountComponentAtNode, unstable_batchedUpdates };
|
|
1165
|
+
//# sourceMappingURL=react.esm.js.map
|