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,1080 @@
|
|
|
1
|
+
import { EMPTY_OBJ, isArray, isFunction, hooks, ensure, isUndefined } from '@tarojs/shared';
|
|
2
|
+
import { Current, getPageInstance, injectPageInstance, incrementId, document, perf, PAGE_INIT, CONTAINER, window, CONTEXT_ACTIONS, safeExecute, ON_HIDE, eventCenter, getOnHideEventKey, ON_SHOW, requestAnimationFrame, getOnShowEventKey, ON_READY, getOnReadyEventKey, removePageInstance, getPath, eventHandler, addLeadingSlash, hydrate } from '@tarojs/runtime';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WX App-wrap flow:
|
|
6
|
+
*
|
|
7
|
+
* React still owns one root in which every Page remains an ordinary child of the singleton App. Native WX rendering,
|
|
8
|
+
* however, is driven by independent Page.setData surfaces, so App hosts above those Page roots have no scheduler of their
|
|
9
|
+
* own. The Mini Program branch below gives the App host an app.* scheduler, fans its deltas into every mounted Page, places
|
|
10
|
+
* one opaque outlet at App {children}, and seeds each new Page with the current App snapshot in its first native batch.
|
|
11
|
+
* hydrate() is needed only for that initial snapshot; the patched runtime stops traversal at the outlet so Page roots stay
|
|
12
|
+
* in the React/Taro ownership tree without being copied into app data.
|
|
13
|
+
*/
|
|
14
|
+
const reactMeta = {
|
|
15
|
+
PageContext: EMPTY_OBJ,
|
|
16
|
+
R: EMPTY_OBJ,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const HOOKS_APP_ID = 'taro-app';
|
|
20
|
+
function isClassComponent(R, component) {
|
|
21
|
+
var _a;
|
|
22
|
+
const prototype = component.prototype;
|
|
23
|
+
// For React Redux
|
|
24
|
+
if ((_a = component.displayName) === null || _a === void 0 ? void 0 : _a.includes('Connect'))
|
|
25
|
+
return false;
|
|
26
|
+
return (isFunction(component.render) ||
|
|
27
|
+
!!(prototype === null || prototype === void 0 ? void 0 : prototype.isReactComponent) ||
|
|
28
|
+
prototype instanceof R.Component // compat for some others react-like library
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function ensureIsArray(item) {
|
|
32
|
+
if (isArray(item)) {
|
|
33
|
+
return item;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return item ? [item] : [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* set writable, enumerable to true
|
|
41
|
+
*/
|
|
42
|
+
function setDefaultDescriptor(obj) {
|
|
43
|
+
obj.writable = true;
|
|
44
|
+
obj.enumerable = true;
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 设置入口的路由参数
|
|
49
|
+
* @param options 小程序传入的参数
|
|
50
|
+
*/
|
|
51
|
+
function setRouterParams(options) {
|
|
52
|
+
Current.router = Object.assign({ params: options === null || options === void 0 ? void 0 : options.query }, options);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const createTaroHook = (lifecycle) => {
|
|
56
|
+
return (fn) => {
|
|
57
|
+
const { R: React, PageContext } = reactMeta;
|
|
58
|
+
const id = React.useContext(PageContext) || HOOKS_APP_ID;
|
|
59
|
+
const instRef = React.useRef();
|
|
60
|
+
// hold fn ref and keep up to date
|
|
61
|
+
const fnRef = React.useRef(fn);
|
|
62
|
+
if (fnRef.current !== fn)
|
|
63
|
+
fnRef.current = fn;
|
|
64
|
+
React.useLayoutEffect(() => {
|
|
65
|
+
let inst = instRef.current = getPageInstance(id);
|
|
66
|
+
let first = false;
|
|
67
|
+
if (!inst) {
|
|
68
|
+
first = true;
|
|
69
|
+
instRef.current = Object.create(null);
|
|
70
|
+
inst = instRef.current;
|
|
71
|
+
}
|
|
72
|
+
// callback is immutable but inner function is up to date
|
|
73
|
+
const callback = (...args) => fnRef.current(...args);
|
|
74
|
+
if (isFunction(inst[lifecycle])) {
|
|
75
|
+
(inst[lifecycle]) = [inst[lifecycle], callback];
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
(inst[lifecycle]) = [
|
|
79
|
+
...((inst[lifecycle]) || []),
|
|
80
|
+
callback
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
if (first) {
|
|
84
|
+
injectPageInstance(inst, id);
|
|
85
|
+
}
|
|
86
|
+
return () => {
|
|
87
|
+
const inst = instRef.current;
|
|
88
|
+
if (!inst)
|
|
89
|
+
return;
|
|
90
|
+
const list = inst[lifecycle];
|
|
91
|
+
if (list === callback) {
|
|
92
|
+
(inst[lifecycle]) = undefined;
|
|
93
|
+
}
|
|
94
|
+
else if (isArray(list)) {
|
|
95
|
+
(inst[lifecycle]) = list.filter(item => item !== callback);
|
|
96
|
+
}
|
|
97
|
+
instRef.current = undefined;
|
|
98
|
+
};
|
|
99
|
+
}, []);
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
/** LifeCycle */
|
|
103
|
+
const useDidHide = createTaroHook('componentDidHide');
|
|
104
|
+
const useDidShow = createTaroHook('componentDidShow');
|
|
105
|
+
/** App */
|
|
106
|
+
const useError = createTaroHook('onError');
|
|
107
|
+
const useUnhandledRejection = createTaroHook('onUnhandledRejection');
|
|
108
|
+
const useLaunch = createTaroHook('onLaunch');
|
|
109
|
+
const usePageNotFound = createTaroHook('onPageNotFound');
|
|
110
|
+
/** Page */
|
|
111
|
+
const useLoad = createTaroHook('onLoad');
|
|
112
|
+
const usePageScroll = createTaroHook('onPageScroll');
|
|
113
|
+
const usePullDownRefresh = createTaroHook('onPullDownRefresh');
|
|
114
|
+
const usePullIntercept = createTaroHook('onPullIntercept');
|
|
115
|
+
const useReachBottom = createTaroHook('onReachBottom');
|
|
116
|
+
const useResize = createTaroHook('onResize');
|
|
117
|
+
const useUnload = createTaroHook('onUnload');
|
|
118
|
+
/** Mini-Program */
|
|
119
|
+
const useAddToFavorites = createTaroHook('onAddToFavorites');
|
|
120
|
+
const useOptionMenuClick = createTaroHook('onOptionMenuClick');
|
|
121
|
+
const useKeyboardHeight = createTaroHook('onKeyboardHeight');
|
|
122
|
+
const useSaveExitState = createTaroHook('onSaveExitState');
|
|
123
|
+
const useShareAppMessage = createTaroHook('onShareAppMessage');
|
|
124
|
+
const useShareTimeline = createTaroHook('onShareTimeline');
|
|
125
|
+
const useTitleClick = createTaroHook('onTitleClick');
|
|
126
|
+
/** Router */
|
|
127
|
+
const useReady = createTaroHook('onReady');
|
|
128
|
+
const useRouter = (dynamic = false) => {
|
|
129
|
+
const React = reactMeta.R;
|
|
130
|
+
return dynamic ? Current.router : React.useMemo(() => Current.router, []);
|
|
131
|
+
};
|
|
132
|
+
const useTabItemTap = createTaroHook('onTabItemTap');
|
|
133
|
+
const useScope = () => undefined;
|
|
134
|
+
|
|
135
|
+
var taroHooks = /*#__PURE__*/Object.freeze({
|
|
136
|
+
__proto__: null,
|
|
137
|
+
useAddToFavorites: useAddToFavorites,
|
|
138
|
+
useDidHide: useDidHide,
|
|
139
|
+
useDidShow: useDidShow,
|
|
140
|
+
useError: useError,
|
|
141
|
+
useKeyboardHeight: useKeyboardHeight,
|
|
142
|
+
useLaunch: useLaunch,
|
|
143
|
+
useLoad: useLoad,
|
|
144
|
+
useOptionMenuClick: useOptionMenuClick,
|
|
145
|
+
usePageNotFound: usePageNotFound,
|
|
146
|
+
usePageScroll: usePageScroll,
|
|
147
|
+
usePullDownRefresh: usePullDownRefresh,
|
|
148
|
+
usePullIntercept: usePullIntercept,
|
|
149
|
+
useReachBottom: useReachBottom,
|
|
150
|
+
useReady: useReady,
|
|
151
|
+
useResize: useResize,
|
|
152
|
+
useRouter: useRouter,
|
|
153
|
+
useSaveExitState: useSaveExitState,
|
|
154
|
+
useScope: useScope,
|
|
155
|
+
useShareAppMessage: useShareAppMessage,
|
|
156
|
+
useShareTimeline: useShareTimeline,
|
|
157
|
+
useTabItemTap: useTabItemTap,
|
|
158
|
+
useTitleClick: useTitleClick,
|
|
159
|
+
useUnhandledRejection: useUnhandledRejection,
|
|
160
|
+
useUnload: useUnload
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
let h$1;
|
|
164
|
+
let ReactDOM$1;
|
|
165
|
+
const pageKeyId = incrementId();
|
|
166
|
+
function setReconciler(ReactDOM) {
|
|
167
|
+
hooks.tap('getLifecycle', function (instance, lifecycle) {
|
|
168
|
+
lifecycle = lifecycle.replace(/^on(Show|Hide)$/, 'componentDid$1');
|
|
169
|
+
return instance[lifecycle];
|
|
170
|
+
});
|
|
171
|
+
hooks.tap('modifyMpEvent', function (event) {
|
|
172
|
+
// Note: ohos 上事件没有设置 type 类型 setter 方法导致报错
|
|
173
|
+
Object.defineProperty(event, 'type', {
|
|
174
|
+
value: event.type.replace(/-/g, '')
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
hooks.tap('batchedEventUpdates', function (cb) {
|
|
178
|
+
ReactDOM === null || ReactDOM === void 0 ? void 0 : ReactDOM.unstable_batchedUpdates(cb);
|
|
179
|
+
});
|
|
180
|
+
hooks.tap('mergePageInstance', function (prev, next) {
|
|
181
|
+
if (!prev || !next)
|
|
182
|
+
return;
|
|
183
|
+
// 子组件使用 lifecycle hooks 注册了生命周期后,会存在 prev,里面是注册的生命周期回调。
|
|
184
|
+
// prev 使用 Object.create(null) 创建,H5 的 fast-refresh 可能也会导致存在 prev,要排除这些意外产生的 prev
|
|
185
|
+
if ('constructor' in prev)
|
|
186
|
+
return;
|
|
187
|
+
Object.keys(prev).forEach(item => {
|
|
188
|
+
const prevList = prev[item];
|
|
189
|
+
const nextList = ensureIsArray(next[item]);
|
|
190
|
+
next[item] = nextList.concat(prevList);
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
if (process.env.TARO_PLATFORM === 'web') {
|
|
194
|
+
hooks.tap('createPullDownComponent', (el, _, R, customWrapper) => {
|
|
195
|
+
const isReactComponent = isClassComponent(R, el);
|
|
196
|
+
return R.forwardRef((props, ref) => {
|
|
197
|
+
const newProps = Object.assign({}, props);
|
|
198
|
+
const refs = isReactComponent ? { ref: ref } : {
|
|
199
|
+
forwardedRef: ref,
|
|
200
|
+
// 兼容 react-redux 7.20.1+
|
|
201
|
+
reactReduxForwardedRef: ref
|
|
202
|
+
};
|
|
203
|
+
return h$1(customWrapper || 'taro-pull-to-refresh-core', null, h$1(el, Object.assign(Object.assign({}, newProps), refs)));
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
hooks.tap('getDOMNode', (inst) => {
|
|
207
|
+
// 由于react 18移除了ReactDOM.findDOMNode方法,修复H5端 Taro.createSelectorQuery设置in(scope)时,报错问题
|
|
208
|
+
// https://zh-hans.react.dev/reference/react-dom/findDOMNode
|
|
209
|
+
if (!inst) {
|
|
210
|
+
return document;
|
|
211
|
+
}
|
|
212
|
+
else if (inst instanceof HTMLElement) {
|
|
213
|
+
return inst;
|
|
214
|
+
}
|
|
215
|
+
else if (inst.$taroPath) {
|
|
216
|
+
const el = document.getElementById(inst.$taroPath);
|
|
217
|
+
return el !== null && el !== void 0 ? el : document;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function connectReactPage(R, id) {
|
|
223
|
+
return (Page) => {
|
|
224
|
+
// eslint-disable-next-line dot-notation
|
|
225
|
+
const isReactComponent = isClassComponent(R, Page);
|
|
226
|
+
const inject = (node) => node && injectPageInstance(node, id);
|
|
227
|
+
const refs = isReactComponent ? { ref: inject } : {
|
|
228
|
+
forwardedRef: inject,
|
|
229
|
+
// 兼容 react-redux 7.20.1+
|
|
230
|
+
reactReduxForwardedRef: inject
|
|
231
|
+
};
|
|
232
|
+
if (reactMeta.PageContext === EMPTY_OBJ) {
|
|
233
|
+
reactMeta.PageContext = R.createContext('');
|
|
234
|
+
}
|
|
235
|
+
return class PageWrapper extends R.Component {
|
|
236
|
+
constructor() {
|
|
237
|
+
super(...arguments);
|
|
238
|
+
this.state = {
|
|
239
|
+
hasError: false
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
static getDerivedStateFromError(error) {
|
|
243
|
+
var _a, _b;
|
|
244
|
+
(_b = (_a = Current.app) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, error.message + error.stack);
|
|
245
|
+
return { hasError: true };
|
|
246
|
+
}
|
|
247
|
+
// React 16 uncaught error 会导致整个应用 crash,
|
|
248
|
+
// 目前把错误缩小到页面
|
|
249
|
+
componentDidCatch(error, info) {
|
|
250
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
251
|
+
console.warn(error);
|
|
252
|
+
console.error(info.componentStack);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
render() {
|
|
256
|
+
const children = this.state.hasError
|
|
257
|
+
? []
|
|
258
|
+
: h$1(reactMeta.PageContext.Provider, { value: id }, h$1(Page, Object.assign(Object.assign({}, this.props), refs)));
|
|
259
|
+
if (process.env.TARO_PLATFORM === 'web') {
|
|
260
|
+
return h$1('div', { id, className: 'taro_page' }, children);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
return h$1('root', { id }, children);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* One App reconciliation produces one granular app.* batch, while WX stores an App mirror inside every mounted native
|
|
271
|
+
* Page. Resolve the native stack only when that batch flushes instead of maintaining a second Page registry or active-Page
|
|
272
|
+
* tracker. WeChat orders getCurrentPages() from the oldest hidden Page to the current visible Page, so forEach dispatches
|
|
273
|
+
* all hidden surfaces first. Only the final current Page receives Taro's callback: every setData call has then been issued,
|
|
274
|
+
* and Taro's scheduler completes its batch exactly once rather than coordinating one callback per Page.
|
|
275
|
+
*/
|
|
276
|
+
function broadcastAppUpdate(data, callback) {
|
|
277
|
+
const pages = getCurrentPages();
|
|
278
|
+
const currentPage = pages[pages.length - 1];
|
|
279
|
+
if (!currentPage) {
|
|
280
|
+
callback();
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
pages.forEach(page => {
|
|
284
|
+
if (page === currentPage) {
|
|
285
|
+
page.setData(data, callback);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
page.setData(data);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* 桥接小程序 App 构造器和 React 渲染流程
|
|
294
|
+
* @param App 用户编写的入口组件
|
|
295
|
+
* @param react 框架
|
|
296
|
+
* @param dom 框架渲染器
|
|
297
|
+
* @param config 入口组件配置 app.config.js 的内容
|
|
298
|
+
* @returns 传递给 App 构造器的对象 obj :App(obj)
|
|
299
|
+
*/
|
|
300
|
+
function createReactApp(App, react, dom, config) {
|
|
301
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
302
|
+
ensure(!!dom, '构建 React/Preact 项目请把 process.env.FRAMEWORK 设置为 \'react\'/\'preact\' ');
|
|
303
|
+
}
|
|
304
|
+
reactMeta.R = react;
|
|
305
|
+
h$1 = react.createElement;
|
|
306
|
+
ReactDOM$1 = dom;
|
|
307
|
+
const appInstanceRef = react.createRef();
|
|
308
|
+
const isReactComponent = isClassComponent(react, App);
|
|
309
|
+
let appWrapper;
|
|
310
|
+
let appWrapperResolver;
|
|
311
|
+
const appWrapperPromise = new Promise(resolve => (appWrapperResolver = resolve));
|
|
312
|
+
setReconciler(ReactDOM$1);
|
|
313
|
+
function getAppInstance() {
|
|
314
|
+
return appInstanceRef.current;
|
|
315
|
+
}
|
|
316
|
+
function waitAppWrapper(cb) {
|
|
317
|
+
/**
|
|
318
|
+
* 当同个事件触发多次时,waitAppWrapper 会出现同步和异步任务的执行顺序问题,
|
|
319
|
+
* 导致某些场景下 onShow 会优于 onLaunch 执行
|
|
320
|
+
*/
|
|
321
|
+
appWrapperPromise.then(() => cb());
|
|
322
|
+
// appWrapper ? cb() : appWrapperPromise.then(() => cb())
|
|
323
|
+
}
|
|
324
|
+
function renderReactRoot() {
|
|
325
|
+
var _a, _b;
|
|
326
|
+
const appId = (config === null || config === void 0 ? void 0 : config.appId) || 'app';
|
|
327
|
+
let container = document.getElementById(appId);
|
|
328
|
+
if (container == null) {
|
|
329
|
+
const appContainer = document.getElementById(CONTAINER);
|
|
330
|
+
/*
|
|
331
|
+
* A custom appId cannot reuse the document's pre-created #app root. Create the same TaroRootElement class and
|
|
332
|
+
* preserve the configured id, so custom-id lookup follows upstream behavior while scheduling keeps one root
|
|
333
|
+
* contract. The container itself is not serialized; only its children become Page.data.app records.
|
|
334
|
+
*/
|
|
335
|
+
container = document.createElement('root');
|
|
336
|
+
container.id = appId;
|
|
337
|
+
appContainer === null || appContainer === void 0 ? void 0 : appContainer.appendChild(container);
|
|
338
|
+
}
|
|
339
|
+
/*
|
|
340
|
+
* renderReactRoot runs only for the Mini Program branch. The patched WX document makes this App container a
|
|
341
|
+
* TaroRootElement, so it serves simultaneously as React's existing host container and Taro's App scheduler; its
|
|
342
|
+
* structural _path is app and its _root is itself. Assign only the native sink that fans Taro's normal granular
|
|
343
|
+
* batches across Page surfaces. No detached scheduler node, second React root, or host-property override participates.
|
|
344
|
+
*/
|
|
345
|
+
container.ctx = { setData: broadcastAppUpdate };
|
|
346
|
+
/*
|
|
347
|
+
* Upstream enables createRoot only for a React 18 version string, which skips the entire App render on React 19.
|
|
348
|
+
* Detect the renderer capability instead: React 18/19 take the modern path and older renderers retain the fallback.
|
|
349
|
+
*/
|
|
350
|
+
if (typeof ReactDOM$1.createRoot === 'function') {
|
|
351
|
+
const root = ReactDOM$1.createRoot(container);
|
|
352
|
+
(_a = root.render) === null || _a === void 0 ? void 0 : _a.call(root, h$1(AppWrapper));
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
// eslint-disable-next-line react/no-deprecated
|
|
356
|
+
(_b = ReactDOM$1.render) === null || _b === void 0 ? void 0 : _b.call(ReactDOM$1, h$1(AppWrapper), container);
|
|
357
|
+
}
|
|
358
|
+
/*
|
|
359
|
+
* Return the exact host passed to ReactDOM. AppWrapper.mount closes over this immutable value when a Page is added,
|
|
360
|
+
* guaranteeing that its initial snapshot comes from the same singleton App tree without a host registry or lookup.
|
|
361
|
+
*/
|
|
362
|
+
return container;
|
|
363
|
+
}
|
|
364
|
+
class AppWrapper extends react.Component {
|
|
365
|
+
constructor(props) {
|
|
366
|
+
super(props);
|
|
367
|
+
// run createElement() inside the render function to make sure that owner is right
|
|
368
|
+
this.pages = [];
|
|
369
|
+
this.elements = [];
|
|
370
|
+
appWrapper = this;
|
|
371
|
+
appWrapperResolver(this);
|
|
372
|
+
}
|
|
373
|
+
mount(pageComponent, id, cb) {
|
|
374
|
+
const pageWrapper = connectReactPage(react, id)(pageComponent);
|
|
375
|
+
const key = id + pageKeyId();
|
|
376
|
+
const page = () => h$1(pageWrapper, { key, tid: id });
|
|
377
|
+
this.pages.push(page);
|
|
378
|
+
this.forceUpdate((...args) => {
|
|
379
|
+
perf.stop(PAGE_INIT);
|
|
380
|
+
if (process.env.TARO_PLATFORM !== 'web') {
|
|
381
|
+
/*
|
|
382
|
+
* React has now committed the Page root, but createPageConfig has not yet attached the native Page ctx or
|
|
383
|
+
* called performUpdate(true). Queue a lazy app.cn snapshot beside the Page root's already-pending page.*
|
|
384
|
+
* payloads. Taro therefore resolves both in one initial setData: no blank App frame, second bridge write,
|
|
385
|
+
* Page-ready phase, or custom pending queue. Patched hydrate() stops at the outlet before Page roots.
|
|
386
|
+
*/
|
|
387
|
+
const pageRoot = document.getElementById(id);
|
|
388
|
+
pageRoot.enqueueUpdate({
|
|
389
|
+
path: 'app.cn',
|
|
390
|
+
value: () => hydrate(container).cn
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
return cb(...args);
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
unmount(id, cb) {
|
|
397
|
+
const elements = this.elements;
|
|
398
|
+
const idx = elements.findIndex(item => item.props.tid === id);
|
|
399
|
+
elements.splice(idx, 1);
|
|
400
|
+
this.forceUpdate(cb);
|
|
401
|
+
}
|
|
402
|
+
render() {
|
|
403
|
+
const { pages, elements } = this;
|
|
404
|
+
while (pages.length > 0) {
|
|
405
|
+
const page = pages.pop();
|
|
406
|
+
elements.push(page());
|
|
407
|
+
}
|
|
408
|
+
let props = null;
|
|
409
|
+
if (isReactComponent) {
|
|
410
|
+
props = { ref: appInstanceRef };
|
|
411
|
+
}
|
|
412
|
+
const pageElements = elements.slice();
|
|
413
|
+
/*
|
|
414
|
+
* Keep Page elements as ordinary App children so Context, effects, refs, state, and HMR retain one React tree.
|
|
415
|
+
* Web gives the Page stack its own taro_router host: upstream routing CSS addresses direct Page children and uses
|
|
416
|
+
* their sibling order to hide retained Pages, so unrelated App siblings must not participate in that ordering.
|
|
417
|
+
* WX instead uses a private host at the exact {children} position. The runtime patch makes that host opaque to App
|
|
418
|
+
* serialization, while generated Page WXML consumes its slot from the separate Page data root.
|
|
419
|
+
*/
|
|
420
|
+
const children = process.env.TARO_PLATFORM === 'web'
|
|
421
|
+
? h$1('div', { className: 'taro_router' }, pageElements)
|
|
422
|
+
: h$1('vpt_page_outlet', null, pageElements);
|
|
423
|
+
return h$1(App, props, children);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/*
|
|
427
|
+
* Mini Program lifecycle mounting is internal to this runtime, so create and retain exactly one App host for every Page
|
|
428
|
+
* mount callback to snapshot. Web keeps upstream external mounting and never executes the WX scheduler/outlet path.
|
|
429
|
+
*/
|
|
430
|
+
const container = process.env.TARO_PLATFORM !== 'web' ? renderReactRoot() : null;
|
|
431
|
+
const [ONLAUNCH, ONSHOW, ONHIDE] = hooks.call('getMiniLifecycleImpl').app;
|
|
432
|
+
const appObj = Object.create({
|
|
433
|
+
render(cb) {
|
|
434
|
+
appWrapper.forceUpdate(cb);
|
|
435
|
+
},
|
|
436
|
+
mount(component, id, cb) {
|
|
437
|
+
if (appWrapper) {
|
|
438
|
+
appWrapper.mount(component, id, cb);
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
appWrapperPromise.then(appWrapper => appWrapper.mount(component, id, cb));
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
unmount(id, cb) {
|
|
445
|
+
if (appWrapper) {
|
|
446
|
+
appWrapper.unmount(id, cb);
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
appWrapperPromise.then(appWrapper => appWrapper.unmount(id, cb));
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}, {
|
|
453
|
+
config: setDefaultDescriptor({
|
|
454
|
+
configurable: true,
|
|
455
|
+
value: config
|
|
456
|
+
}),
|
|
457
|
+
[ONLAUNCH]: setDefaultDescriptor({
|
|
458
|
+
value(options) {
|
|
459
|
+
setRouterParams(options);
|
|
460
|
+
if (process.env.TARO_PLATFORM === 'web') {
|
|
461
|
+
// 由于 H5 路由初始化的时候会清除 app 下的 dom 元素,所以需要在路由初始化后执行 render
|
|
462
|
+
renderReactRoot();
|
|
463
|
+
}
|
|
464
|
+
const onLaunch = () => {
|
|
465
|
+
var _a;
|
|
466
|
+
// 用户编写的入口组件实例
|
|
467
|
+
const app = getAppInstance();
|
|
468
|
+
this.$app = app;
|
|
469
|
+
if (app) {
|
|
470
|
+
// 把 App Class 上挂载的额外属性同步到全局 app 对象中
|
|
471
|
+
if (app.taroGlobalData) {
|
|
472
|
+
const globalData = app.taroGlobalData;
|
|
473
|
+
const keys = Object.keys(globalData);
|
|
474
|
+
const descriptors = Object.getOwnPropertyDescriptors(globalData);
|
|
475
|
+
keys.forEach(key => {
|
|
476
|
+
Object.defineProperty(this, key, {
|
|
477
|
+
configurable: true,
|
|
478
|
+
enumerable: true,
|
|
479
|
+
get() {
|
|
480
|
+
return globalData[key];
|
|
481
|
+
},
|
|
482
|
+
set(value) {
|
|
483
|
+
globalData[key] = value;
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
Object.defineProperties(this, descriptors);
|
|
488
|
+
}
|
|
489
|
+
(_a = app.onLaunch) === null || _a === void 0 ? void 0 : _a.call(app, options);
|
|
490
|
+
}
|
|
491
|
+
triggerAppHook('onLaunch', options);
|
|
492
|
+
};
|
|
493
|
+
waitAppWrapper(onLaunch);
|
|
494
|
+
}
|
|
495
|
+
}),
|
|
496
|
+
[ONSHOW]: setDefaultDescriptor({
|
|
497
|
+
value(options) {
|
|
498
|
+
setRouterParams(options);
|
|
499
|
+
const onShow = () => {
|
|
500
|
+
var _a;
|
|
501
|
+
/**
|
|
502
|
+
* trigger lifecycle
|
|
503
|
+
*/
|
|
504
|
+
const app = getAppInstance();
|
|
505
|
+
// class component, componentDidShow
|
|
506
|
+
(_a = app === null || app === void 0 ? void 0 : app.componentDidShow) === null || _a === void 0 ? void 0 : _a.call(app, options);
|
|
507
|
+
// functional component, useDidShow
|
|
508
|
+
triggerAppHook('onShow', options);
|
|
509
|
+
};
|
|
510
|
+
waitAppWrapper(onShow);
|
|
511
|
+
}
|
|
512
|
+
}),
|
|
513
|
+
[ONHIDE]: setDefaultDescriptor({
|
|
514
|
+
value() {
|
|
515
|
+
const onHide = () => {
|
|
516
|
+
var _a;
|
|
517
|
+
/**
|
|
518
|
+
* trigger lifecycle
|
|
519
|
+
*/
|
|
520
|
+
const app = getAppInstance();
|
|
521
|
+
// class component, componentDidHide
|
|
522
|
+
(_a = app === null || app === void 0 ? void 0 : app.componentDidHide) === null || _a === void 0 ? void 0 : _a.call(app);
|
|
523
|
+
// functional component, useDidHide
|
|
524
|
+
triggerAppHook('onHide');
|
|
525
|
+
};
|
|
526
|
+
waitAppWrapper(onHide);
|
|
527
|
+
}
|
|
528
|
+
}),
|
|
529
|
+
onError: setDefaultDescriptor({
|
|
530
|
+
value(error) {
|
|
531
|
+
const onError = () => {
|
|
532
|
+
var _a;
|
|
533
|
+
const app = getAppInstance();
|
|
534
|
+
(_a = app === null || app === void 0 ? void 0 : app.onError) === null || _a === void 0 ? void 0 : _a.call(app, error);
|
|
535
|
+
triggerAppHook('onError', error);
|
|
536
|
+
if (process.env.NODE_ENV !== 'production' && (error === null || error === void 0 ? void 0 : error.includes('Minified React error'))) {
|
|
537
|
+
console.warn('React 出现报错,请打开编译配置 mini.debugReact 查看报错详情:https://docs.taro.zone/docs/config-detail#minidebugreact');
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
waitAppWrapper(onError);
|
|
541
|
+
}
|
|
542
|
+
}),
|
|
543
|
+
onUnhandledRejection: setDefaultDescriptor({
|
|
544
|
+
value(res) {
|
|
545
|
+
const onUnhandledRejection = () => {
|
|
546
|
+
var _a;
|
|
547
|
+
const app = getAppInstance();
|
|
548
|
+
(_a = app === null || app === void 0 ? void 0 : app.onUnhandledRejection) === null || _a === void 0 ? void 0 : _a.call(app, res);
|
|
549
|
+
triggerAppHook('onUnhandledRejection', res);
|
|
550
|
+
};
|
|
551
|
+
waitAppWrapper(onUnhandledRejection);
|
|
552
|
+
}
|
|
553
|
+
}),
|
|
554
|
+
onPageNotFound: setDefaultDescriptor({
|
|
555
|
+
value(res) {
|
|
556
|
+
const onPageNotFound = () => {
|
|
557
|
+
var _a;
|
|
558
|
+
const app = getAppInstance();
|
|
559
|
+
(_a = app === null || app === void 0 ? void 0 : app.onPageNotFound) === null || _a === void 0 ? void 0 : _a.call(app, res);
|
|
560
|
+
triggerAppHook('onPageNotFound', res);
|
|
561
|
+
};
|
|
562
|
+
waitAppWrapper(onPageNotFound);
|
|
563
|
+
}
|
|
564
|
+
})
|
|
565
|
+
});
|
|
566
|
+
function triggerAppHook(lifecycle, ...option) {
|
|
567
|
+
const instance = getPageInstance(HOOKS_APP_ID);
|
|
568
|
+
if (instance) {
|
|
569
|
+
const app = getAppInstance();
|
|
570
|
+
const func = hooks.call('getLifecycle', instance, lifecycle);
|
|
571
|
+
if (Array.isArray(func)) {
|
|
572
|
+
func.forEach(cb => cb.apply(app, option));
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
Current.app = appObj;
|
|
577
|
+
return appObj;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
const getNativeCompId = incrementId();
|
|
581
|
+
let h;
|
|
582
|
+
let ReactDOM;
|
|
583
|
+
let nativeComponentApp;
|
|
584
|
+
function initNativeComponentEntry(params) {
|
|
585
|
+
var _a;
|
|
586
|
+
const { R, ReactDOM, cb, isDefaultEntryDom = true } = params;
|
|
587
|
+
class NativeComponentWrapper extends R.Component {
|
|
588
|
+
constructor() {
|
|
589
|
+
super(...arguments);
|
|
590
|
+
this.root = R.createRef();
|
|
591
|
+
this.ctx = this.props.getCtx();
|
|
592
|
+
}
|
|
593
|
+
componentDidMount() {
|
|
594
|
+
this.ctx.component = this;
|
|
595
|
+
const rootElement = this.root.current;
|
|
596
|
+
rootElement.ctx = this.ctx;
|
|
597
|
+
rootElement.performUpdate(true);
|
|
598
|
+
}
|
|
599
|
+
render() {
|
|
600
|
+
return (h('root', {
|
|
601
|
+
ref: this.root,
|
|
602
|
+
id: this.props.compId
|
|
603
|
+
}, this.props.renderComponent(this.ctx)));
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
class Entry extends R.Component {
|
|
607
|
+
constructor() {
|
|
608
|
+
super(...arguments);
|
|
609
|
+
this.state = {
|
|
610
|
+
components: []
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
componentDidMount() {
|
|
614
|
+
if (isDefaultEntryDom) {
|
|
615
|
+
Current.app = this;
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
nativeComponentApp = this;
|
|
619
|
+
}
|
|
620
|
+
cb && cb();
|
|
621
|
+
}
|
|
622
|
+
mount(Component, compId, getCtx, cb) {
|
|
623
|
+
const isReactComponent = isClassComponent(R, Component);
|
|
624
|
+
const inject = (node) => node && injectPageInstance(node, compId);
|
|
625
|
+
const refs = isReactComponent ? { ref: inject } : {
|
|
626
|
+
forwardedRef: inject,
|
|
627
|
+
reactReduxForwardedRef: inject
|
|
628
|
+
};
|
|
629
|
+
if (reactMeta.PageContext === EMPTY_OBJ) {
|
|
630
|
+
reactMeta.PageContext = R.createContext('');
|
|
631
|
+
}
|
|
632
|
+
const item = {
|
|
633
|
+
compId,
|
|
634
|
+
element: h(NativeComponentWrapper, {
|
|
635
|
+
key: compId,
|
|
636
|
+
compId,
|
|
637
|
+
getCtx,
|
|
638
|
+
renderComponent(ctx) {
|
|
639
|
+
return h(reactMeta.PageContext.Provider, { value: compId }, h(Component, Object.assign(Object.assign(Object.assign({}, (ctx.data || (ctx.data = {})).props), refs), { $scope: ctx })));
|
|
640
|
+
}
|
|
641
|
+
})
|
|
642
|
+
};
|
|
643
|
+
this.setState({
|
|
644
|
+
components: [...this.state.components, item]
|
|
645
|
+
}, () => cb && cb());
|
|
646
|
+
}
|
|
647
|
+
unmount(compId, cb) {
|
|
648
|
+
const components = this.state.components;
|
|
649
|
+
const index = components.findIndex(item => item.compId === compId);
|
|
650
|
+
const next = [...components.slice(0, index), ...components.slice(index + 1)];
|
|
651
|
+
this.setState({
|
|
652
|
+
components: next
|
|
653
|
+
}, () => {
|
|
654
|
+
removePageInstance(compId);
|
|
655
|
+
cb && cb();
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
render() {
|
|
659
|
+
const components = this.state.components;
|
|
660
|
+
return (components.map(({ element }) => element));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
setReconciler(ReactDOM);
|
|
664
|
+
let app = document.getElementById('app');
|
|
665
|
+
if (!isDefaultEntryDom && !nativeComponentApp) {
|
|
666
|
+
// create
|
|
667
|
+
const nativeApp = document.createElement('nativeComponent');
|
|
668
|
+
// insert
|
|
669
|
+
(_a = app === null || app === void 0 ? void 0 : app.parentNode) === null || _a === void 0 ? void 0 : _a.appendChild(nativeApp);
|
|
670
|
+
app = nativeApp;
|
|
671
|
+
}
|
|
672
|
+
// eslint-disable-next-line react/no-deprecated
|
|
673
|
+
ReactDOM.render(h(Entry, {}), app);
|
|
674
|
+
}
|
|
675
|
+
function createNativePageConfig(Component, pageName, data, react, reactDOM, pageConfig) {
|
|
676
|
+
reactMeta.R = react;
|
|
677
|
+
h = react.createElement;
|
|
678
|
+
ReactDOM = reactDOM;
|
|
679
|
+
setReconciler(ReactDOM);
|
|
680
|
+
const [ONLOAD, ONUNLOAD, ONREADY, ONSHOW, ONHIDE, LIFECYCLES, SIDE_EFFECT_LIFECYCLES] = hooks.call('getMiniLifecycleImpl').page;
|
|
681
|
+
let unmounting = false;
|
|
682
|
+
let prepareMountList = [];
|
|
683
|
+
let pageElement = null;
|
|
684
|
+
let loadResolver;
|
|
685
|
+
let hasLoaded;
|
|
686
|
+
const id = pageName !== null && pageName !== void 0 ? pageName : `taro_page_${getNativeCompId()}`;
|
|
687
|
+
function setCurrentRouter(page) {
|
|
688
|
+
const router = page.route || page.__route__ || page.$taroPath;
|
|
689
|
+
Current.router = {
|
|
690
|
+
params: page.$taroParams,
|
|
691
|
+
path: addLeadingSlash(router),
|
|
692
|
+
$taroPath: page.$taroPath,
|
|
693
|
+
onReady: getOnReadyEventKey(id),
|
|
694
|
+
onShow: getOnShowEventKey(id),
|
|
695
|
+
onHide: getOnHideEventKey(id)
|
|
696
|
+
};
|
|
697
|
+
if (!isUndefined(page.exitState)) {
|
|
698
|
+
Current.router.exitState = page.exitState;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
const pageObj = {
|
|
702
|
+
options: pageConfig,
|
|
703
|
+
[ONLOAD](options = {}, cb) {
|
|
704
|
+
hasLoaded = new Promise(resolve => { loadResolver = resolve; });
|
|
705
|
+
Current.page = this;
|
|
706
|
+
this.config = pageConfig || {};
|
|
707
|
+
// this.$taroPath 是页面唯一标识
|
|
708
|
+
const uniqueOptions = Object.assign({}, options, { $taroTimestamp: Date.now() });
|
|
709
|
+
const $taroPath = this.$taroPath = getPath(id, uniqueOptions);
|
|
710
|
+
// this.$taroParams 作为暴露给开发者的页面参数对象,可以被随意修改
|
|
711
|
+
if (this.$taroParams == null) {
|
|
712
|
+
this.$taroParams = uniqueOptions;
|
|
713
|
+
}
|
|
714
|
+
setCurrentRouter(this);
|
|
715
|
+
window.trigger(CONTEXT_ACTIONS.INIT, $taroPath);
|
|
716
|
+
const mountCallback = () => {
|
|
717
|
+
pageElement = document.getElementById($taroPath);
|
|
718
|
+
ensure(pageElement !== null, '没有找到页面实例。');
|
|
719
|
+
safeExecute($taroPath, ONLOAD, this.$taroParams);
|
|
720
|
+
loadResolver();
|
|
721
|
+
pageElement.ctx = this;
|
|
722
|
+
pageElement.performUpdate(true, cb);
|
|
723
|
+
};
|
|
724
|
+
const mount = () => {
|
|
725
|
+
if (!Current.app) {
|
|
726
|
+
initNativeComponentEntry({
|
|
727
|
+
R: react,
|
|
728
|
+
ReactDOM,
|
|
729
|
+
cb: () => {
|
|
730
|
+
Current.app.mount(Component, $taroPath, () => this, mountCallback);
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
Current.app.mount(Component, $taroPath, () => this, mountCallback);
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
if (unmounting) {
|
|
739
|
+
prepareMountList.push(mount);
|
|
740
|
+
}
|
|
741
|
+
else {
|
|
742
|
+
mount();
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
[ONUNLOAD]() {
|
|
746
|
+
const $taroPath = this.$taroPath;
|
|
747
|
+
// 销毁当前页面的上下文信息
|
|
748
|
+
window.trigger(CONTEXT_ACTIONS.DESTROY, $taroPath);
|
|
749
|
+
// 触发onUnload生命周期
|
|
750
|
+
safeExecute($taroPath, ONUNLOAD);
|
|
751
|
+
resetCurrent();
|
|
752
|
+
unmounting = true;
|
|
753
|
+
Current.app.unmount($taroPath, () => {
|
|
754
|
+
unmounting = false;
|
|
755
|
+
removePageInstance($taroPath);
|
|
756
|
+
if (pageElement) {
|
|
757
|
+
pageElement.ctx = null;
|
|
758
|
+
pageElement = null;
|
|
759
|
+
}
|
|
760
|
+
if (prepareMountList.length) {
|
|
761
|
+
prepareMountList.forEach(fn => fn());
|
|
762
|
+
prepareMountList = [];
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
},
|
|
766
|
+
[ONREADY]() {
|
|
767
|
+
hasLoaded.then(() => {
|
|
768
|
+
// 触发生命周期
|
|
769
|
+
safeExecute(this.$taroPath, ON_READY);
|
|
770
|
+
// 通过事件触发子组件的生命周期
|
|
771
|
+
requestAnimationFrame(() => eventCenter.trigger(getOnReadyEventKey(id)));
|
|
772
|
+
this.onReady.called = true;
|
|
773
|
+
});
|
|
774
|
+
},
|
|
775
|
+
[ONSHOW](options = {}) {
|
|
776
|
+
hasLoaded.then(() => {
|
|
777
|
+
// 设置 Current 的 page 和 router
|
|
778
|
+
Current.page = this;
|
|
779
|
+
setCurrentRouter(this);
|
|
780
|
+
// 恢复上下文信息
|
|
781
|
+
window.trigger(CONTEXT_ACTIONS.RECOVER, this.$taroPath);
|
|
782
|
+
// 触发生命周期
|
|
783
|
+
safeExecute(this.$taroPath, ON_SHOW, options);
|
|
784
|
+
// 通过事件触发子组件的生命周期
|
|
785
|
+
requestAnimationFrame(() => eventCenter.trigger(getOnShowEventKey(id)));
|
|
786
|
+
});
|
|
787
|
+
},
|
|
788
|
+
[ONHIDE]() {
|
|
789
|
+
// 缓存当前页面上下文信息
|
|
790
|
+
window.trigger(CONTEXT_ACTIONS.RESTORE, this.$taroPath);
|
|
791
|
+
// 设置 Current 的 page 和 router
|
|
792
|
+
if (Current.page === this) {
|
|
793
|
+
Current.page = null;
|
|
794
|
+
Current.router = null;
|
|
795
|
+
}
|
|
796
|
+
// 触发生命周期
|
|
797
|
+
safeExecute(this.$taroPath, ON_HIDE);
|
|
798
|
+
// 通过事件触发子组件的生命周期
|
|
799
|
+
eventCenter.trigger(getOnHideEventKey(id));
|
|
800
|
+
},
|
|
801
|
+
};
|
|
802
|
+
function resetCurrent() {
|
|
803
|
+
// 小程序插件页面卸载之后返回到宿主页面时,需重置Current页面和路由。否则引发插件组件二次加载异常 fix:#11991
|
|
804
|
+
Current.page = null;
|
|
805
|
+
Current.router = null;
|
|
806
|
+
}
|
|
807
|
+
LIFECYCLES.forEach((lifecycle) => {
|
|
808
|
+
pageObj[lifecycle] = function () {
|
|
809
|
+
return safeExecute(this.$taroPath, lifecycle, ...arguments);
|
|
810
|
+
};
|
|
811
|
+
});
|
|
812
|
+
// onShareAppMessage 和 onShareTimeline 一样,会影响小程序右上方按钮的选项,因此不能默认注册。
|
|
813
|
+
SIDE_EFFECT_LIFECYCLES.forEach(lifecycle => {
|
|
814
|
+
var _a;
|
|
815
|
+
if (Component[lifecycle] ||
|
|
816
|
+
((_a = Component.prototype) === null || _a === void 0 ? void 0 : _a[lifecycle]) ||
|
|
817
|
+
Component[lifecycle.replace(/^on/, 'enable')]) {
|
|
818
|
+
pageObj[lifecycle] = function (...args) {
|
|
819
|
+
var _a;
|
|
820
|
+
const target = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.target;
|
|
821
|
+
if (target === null || target === void 0 ? void 0 : target.id) {
|
|
822
|
+
const id = target.id;
|
|
823
|
+
const element = document.getElementById(id);
|
|
824
|
+
if (element) {
|
|
825
|
+
target.dataset = element.dataset;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
return safeExecute(this.$taroPath, lifecycle, ...args);
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
pageObj.eh = eventHandler;
|
|
833
|
+
if (!isUndefined(data)) {
|
|
834
|
+
pageObj.data = data;
|
|
835
|
+
}
|
|
836
|
+
hooks.call('modifyPageObject', pageObj);
|
|
837
|
+
return pageObj;
|
|
838
|
+
}
|
|
839
|
+
function createH5NativeComponentConfig(Component, react, reactDOM) {
|
|
840
|
+
reactMeta.R = react;
|
|
841
|
+
h = react.createElement;
|
|
842
|
+
ReactDOM = reactDOM;
|
|
843
|
+
setReconciler(ReactDOM);
|
|
844
|
+
return Component;
|
|
845
|
+
}
|
|
846
|
+
function createNativeComponentConfig(Component, react, reactDOM, componentConfig) {
|
|
847
|
+
var _a, _b;
|
|
848
|
+
reactMeta.R = react;
|
|
849
|
+
h = react.createElement;
|
|
850
|
+
ReactDOM = reactDOM;
|
|
851
|
+
setReconciler(ReactDOM);
|
|
852
|
+
const { isNewBlended } = componentConfig;
|
|
853
|
+
const componentObj = {
|
|
854
|
+
options: componentConfig,
|
|
855
|
+
properties: {
|
|
856
|
+
props: {
|
|
857
|
+
type: null,
|
|
858
|
+
value: null,
|
|
859
|
+
observer(_newVal, oldVal) {
|
|
860
|
+
var _a, _b, _c, _d;
|
|
861
|
+
if (process.env.TARO_ENV === 'swan') {
|
|
862
|
+
// 百度模版传递 props 时 函数参数会被忽略,这里需要根据 id 获取 TaroElement 中的 props 赋值到 ctx.data 中
|
|
863
|
+
const inst = document.getElementById(this.id);
|
|
864
|
+
if (((_b = (_a = this.component) === null || _a === void 0 ? void 0 : _a.ctx) === null || _b === void 0 ? void 0 : _b.data) && inst) {
|
|
865
|
+
this.component.ctx.data.props = (_c = inst === null || inst === void 0 ? void 0 : inst.props) === null || _c === void 0 ? void 0 : _c.props;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
oldVal && ((_d = this.component) === null || _d === void 0 ? void 0 : _d.forceUpdate());
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
created() {
|
|
873
|
+
var _a, _b;
|
|
874
|
+
if (process.env.TARO_ENV === 'swan') {
|
|
875
|
+
const inst = document.getElementById(this.id);
|
|
876
|
+
// 百度小程序 真机上 props中的函数会被转为Object 调用报错 导致后续组件无法渲染 这里先取TaroElement上的props,在properties中会重新赋值
|
|
877
|
+
if (((_a = this.data) === null || _a === void 0 ? void 0 : _a.props) && inst) {
|
|
878
|
+
this.data.props = ((_b = inst.props) === null || _b === void 0 ? void 0 : _b.props) || {};
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
const app = (isNewBlended ? nativeComponentApp : Current.app);
|
|
882
|
+
if (!app) {
|
|
883
|
+
initNativeComponentEntry({
|
|
884
|
+
R: react,
|
|
885
|
+
ReactDOM,
|
|
886
|
+
isDefaultEntryDom: !isNewBlended
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
attached() {
|
|
891
|
+
const compId = this.compId = getNativeCompId();
|
|
892
|
+
setCurrent(compId);
|
|
893
|
+
this.config = componentConfig;
|
|
894
|
+
const app = (isNewBlended ? nativeComponentApp : Current.app);
|
|
895
|
+
app.mount(Component, compId, () => this, () => {
|
|
896
|
+
const instance = getPageInstance(compId);
|
|
897
|
+
if (instance && instance.node) {
|
|
898
|
+
const el = document.getElementById(instance.node.uid);
|
|
899
|
+
if (el) {
|
|
900
|
+
el.ctx = this;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
});
|
|
904
|
+
},
|
|
905
|
+
ready() {
|
|
906
|
+
safeExecute(this.compId, 'onReady');
|
|
907
|
+
},
|
|
908
|
+
detached() {
|
|
909
|
+
resetCurrent();
|
|
910
|
+
const app = (isNewBlended ? nativeComponentApp : Current.app);
|
|
911
|
+
app.unmount(this.compId);
|
|
912
|
+
},
|
|
913
|
+
pageLifetimes: {
|
|
914
|
+
show(options) {
|
|
915
|
+
safeExecute(this.compId, 'onShow', options);
|
|
916
|
+
},
|
|
917
|
+
hide() {
|
|
918
|
+
safeExecute(this.compId, 'onHide');
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
methods: {
|
|
922
|
+
eh: eventHandler,
|
|
923
|
+
onLoad(options) {
|
|
924
|
+
safeExecute(this.compId, 'onLoad', options);
|
|
925
|
+
},
|
|
926
|
+
onUnload() {
|
|
927
|
+
safeExecute(this.compId, 'onUnload');
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
function resetCurrent() {
|
|
932
|
+
// 小程序插件页面卸载之后返回到宿主页面时,需重置Current页面和路由。否则引发插件组件二次加载异常 fix:#11991
|
|
933
|
+
Current.page = null;
|
|
934
|
+
Current.router = null;
|
|
935
|
+
}
|
|
936
|
+
// onShareAppMessage 和 onShareTimeline 一样,会影响小程序右上方按钮的选项,因此不能默认注册。
|
|
937
|
+
if (Component.onShareAppMessage ||
|
|
938
|
+
((_a = Component.prototype) === null || _a === void 0 ? void 0 : _a.onShareAppMessage) ||
|
|
939
|
+
Component.enableShareAppMessage) {
|
|
940
|
+
componentObj.methods.onShareAppMessage = function (options) {
|
|
941
|
+
const target = options === null || options === void 0 ? void 0 : options.target;
|
|
942
|
+
if (target) {
|
|
943
|
+
const id = target.id;
|
|
944
|
+
const element = document.getElementById(id);
|
|
945
|
+
if (element) {
|
|
946
|
+
target.dataset = element.dataset;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
return safeExecute(this.compId, 'onShareAppMessage', options);
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
if (Component.onShareTimeline ||
|
|
953
|
+
((_b = Component.prototype) === null || _b === void 0 ? void 0 : _b.onShareTimeline) ||
|
|
954
|
+
Component.enableShareTimeline) {
|
|
955
|
+
componentObj.methods.onShareTimeline = function () {
|
|
956
|
+
return safeExecute(this.compId, 'onShareTimeline');
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
if (process.env.TARO_ENV === 'alipay') {
|
|
960
|
+
/**
|
|
961
|
+
* 支付宝需要修改生命周期 同时宿主需要开启component2
|
|
962
|
+
* 如果不开启 props对象中的函数参数会被忽略 导致无法调用
|
|
963
|
+
* @see https://opendocs.alipay.com/mini/03dbc3#compileOptions
|
|
964
|
+
* @returns
|
|
965
|
+
*/
|
|
966
|
+
componentObj.onInit = componentObj.created;
|
|
967
|
+
componentObj.didMount = componentObj.attached;
|
|
968
|
+
componentObj.didUpdate = function () {
|
|
969
|
+
var _a, _b;
|
|
970
|
+
this.data.props = this.props.props;
|
|
971
|
+
(_b = (_a = this === null || this === void 0 ? void 0 : this.component) === null || _a === void 0 ? void 0 : _a.forceUpdate) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
972
|
+
};
|
|
973
|
+
componentObj.didUnmount = componentObj.detached;
|
|
974
|
+
}
|
|
975
|
+
return componentObj;
|
|
976
|
+
}
|
|
977
|
+
function setCurrent(compId) {
|
|
978
|
+
if (!getCurrentPages || typeof getCurrentPages !== 'function')
|
|
979
|
+
return;
|
|
980
|
+
const pages = getCurrentPages();
|
|
981
|
+
const currentPage = pages[pages.length - 1];
|
|
982
|
+
if (Current.page === currentPage)
|
|
983
|
+
return;
|
|
984
|
+
Current.page = currentPage;
|
|
985
|
+
const route = currentPage.route || currentPage.__route__;
|
|
986
|
+
const router = {
|
|
987
|
+
params: currentPage.options || {},
|
|
988
|
+
path: addLeadingSlash(route),
|
|
989
|
+
$taroPath: compId,
|
|
990
|
+
onReady: '',
|
|
991
|
+
onHide: '',
|
|
992
|
+
onShow: ''
|
|
993
|
+
};
|
|
994
|
+
Current.router = router;
|
|
995
|
+
if (!currentPage.options) {
|
|
996
|
+
// 例如在微信小程序中,页面 options 的设置时机比组件 attached 慢
|
|
997
|
+
Object.defineProperty(currentPage, 'options', {
|
|
998
|
+
enumerable: true,
|
|
999
|
+
configurable: true,
|
|
1000
|
+
get() {
|
|
1001
|
+
return this._optionsValue;
|
|
1002
|
+
},
|
|
1003
|
+
set(value) {
|
|
1004
|
+
router.params = value;
|
|
1005
|
+
this._optionsValue = value;
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
hooks.tap('initNativeApi', function (taro) {
|
|
1012
|
+
for (const hook in taroHooks) {
|
|
1013
|
+
taro[hook] = taroHooks[hook];
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
1016
|
+
if (process.env.FRAMEWORK === 'preact' && process.env.TARO_PLATFORM === 'mini') {
|
|
1017
|
+
const options = require('preact').options;
|
|
1018
|
+
const oldVNodeHook = options.vnode;
|
|
1019
|
+
const oldDiffedHook = options.diffed;
|
|
1020
|
+
options.vnode = vnode => {
|
|
1021
|
+
const { type, props } = vnode;
|
|
1022
|
+
let normalizedProps = props;
|
|
1023
|
+
// only normalize props on Element nodes
|
|
1024
|
+
if (typeof type === 'string') {
|
|
1025
|
+
normalizedProps = {};
|
|
1026
|
+
for (let i in props) {
|
|
1027
|
+
const value = props[i];
|
|
1028
|
+
if (/^on/.test(i)) {
|
|
1029
|
+
i = i.toLowerCase();
|
|
1030
|
+
}
|
|
1031
|
+
if (type === 'map' && i === 'onregionchange') {
|
|
1032
|
+
// map 组件的 regionchange 事件非常特殊,详情:https://github.com/NervJS/taro/issues/5766
|
|
1033
|
+
normalizedProps.onbegin = value;
|
|
1034
|
+
normalizedProps.onend = value;
|
|
1035
|
+
continue;
|
|
1036
|
+
}
|
|
1037
|
+
normalizedProps[i] = value;
|
|
1038
|
+
}
|
|
1039
|
+
vnode.props = normalizedProps;
|
|
1040
|
+
}
|
|
1041
|
+
if (oldVNodeHook)
|
|
1042
|
+
oldVNodeHook(vnode);
|
|
1043
|
+
};
|
|
1044
|
+
options.diffed = function (newVNode) {
|
|
1045
|
+
var _a;
|
|
1046
|
+
const domProp = Object.keys(newVNode).find(k => { var _a; return ((_a = newVNode[k]) === null || _a === void 0 ? void 0 : _a.setAttribute); });
|
|
1047
|
+
const dom = domProp ? newVNode[domProp] : null;
|
|
1048
|
+
const newVNodeProps = newVNode.props;
|
|
1049
|
+
if (dom) { /** ElementNode */
|
|
1050
|
+
for (const propName in newVNodeProps) {
|
|
1051
|
+
const propValue = newVNodeProps[propName];
|
|
1052
|
+
if (propValue === false && ((_a = dom.props) === null || _a === void 0 ? void 0 : _a[propName]) === undefined) {
|
|
1053
|
+
// 值为 false 的属性在 Preact 的 diff 中被 removeAttribute 了,这里手动 setAttribute
|
|
1054
|
+
// fix https://github.com/NervJS/taro/issues/11197
|
|
1055
|
+
dom.setAttribute(propName, propValue);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
if (oldDiffedHook)
|
|
1060
|
+
oldDiffedHook(newVNode);
|
|
1061
|
+
};
|
|
1062
|
+
hooks.tap('modifyMpEvent', e => {
|
|
1063
|
+
const type = e.type;
|
|
1064
|
+
if (type === 'tap') {
|
|
1065
|
+
e.type = 'click';
|
|
1066
|
+
}
|
|
1067
|
+
else if (type === 'focus') {
|
|
1068
|
+
// 兼容 preact/compat/src/render.js options.vnode 的处理逻辑
|
|
1069
|
+
e.type = 'focusin';
|
|
1070
|
+
}
|
|
1071
|
+
else if (type === 'blur') {
|
|
1072
|
+
e.type = 'focusout';
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
// hooks.modifyDispatchEventImpls?.push(e => {
|
|
1076
|
+
// })
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
export { connectReactPage, createH5NativeComponentConfig, createNativeComponentConfig, createNativePageConfig, createReactApp, setReconciler, useAddToFavorites, useDidHide, useDidShow, useError, useKeyboardHeight, useLaunch, useLoad, useOptionMenuClick, usePageNotFound, usePageScroll, usePullDownRefresh, usePullIntercept, useReachBottom, useReady, useResize, useRouter, useSaveExitState, useScope, useShareAppMessage, useShareTimeline, useTabItemTap, useTitleClick, useUnhandledRejection, useUnload };
|
|
1080
|
+
//# sourceMappingURL=runtime.js.map
|