@mpxjs/webpack-plugin 2.10.16 → 2.10.17
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/lib/dependencies/AppEntryDependency.js +2 -2
- package/lib/dependencies/RecordModuleIdMapDependency.js +49 -0
- package/lib/dependencies/ResolveDependency.js +1 -1
- package/lib/helpers.js +2 -0
- package/lib/index.js +40 -15
- package/lib/json-compiler/helper.js +72 -2
- package/lib/json-compiler/index.js +14 -54
- package/lib/json-compiler/plugin.js +2 -2
- package/lib/loader.js +10 -4
- package/lib/native-loader.js +6 -3
- package/lib/platform/json/wx/index.js +24 -29
- package/lib/platform/style/wx/index.js +8 -1
- package/lib/platform/template/wx/component-config/button.js +12 -3
- package/lib/platform/template/wx/component-config/component.js +31 -33
- package/lib/platform/template/wx/component-config/fix-component-name.js +2 -2
- package/lib/react/index.js +2 -0
- package/lib/react/processJSON.js +39 -71
- package/lib/react/processStyles.js +3 -2
- package/lib/react/processTemplate.js +8 -6
- package/lib/react/script-helper.js +6 -16
- package/lib/react/style-helper.js +10 -2
- package/lib/runtime/components/react/context.ts +12 -6
- package/lib/runtime/components/react/dist/context.d.ts +75 -0
- package/lib/runtime/components/react/dist/context.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/context.js +1 -0
- package/lib/runtime/components/react/dist/event.config.d.ts +8 -0
- package/lib/runtime/components/react/dist/event.config.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts +8 -0
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +13 -0
- package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-button.d.ts +69 -0
- package/lib/runtime/components/react/dist/mpx-button.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +11 -0
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +3 -0
- package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +33 -0
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +1 -1
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +53 -0
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +33 -0
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-form.d.ts +28 -0
- package/lib/runtime/components/react/dist/mpx-form.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +19 -0
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-image.d.ts +22 -0
- package/lib/runtime/components/react/dist/mpx-image.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-image.jsx +107 -57
- package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-input.d.ts +50 -0
- package/lib/runtime/components/react/dist/mpx-input.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-input.jsx +32 -8
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +13 -0
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +58 -50
- package/lib/runtime/components/react/dist/mpx-label.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-label.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +66 -0
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-nav.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-nav.jsx +132 -0
- package/lib/runtime/components/react/dist/mpx-navigator.d.ts +10 -0
- package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +3 -0
- package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +107 -0
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +33 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +4 -3
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +12 -18
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +15 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.jsx +8 -11
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +14 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.jsx +20 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +17 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +13 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +12 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +17 -0
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +16 -0
- package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-portal/index.jsx +5 -1
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +30 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +10 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-progress.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-radio.d.ts +27 -0
- package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +2 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +25 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +1 -1
- package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +15 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +55 -0
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +6 -14
- package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-slider.d.ts +31 -0
- package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +18 -0
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +16 -0
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +19 -0
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts +53 -0
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-switch.d.ts +27 -0
- package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-text.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-text.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-text.jsx +33 -5
- package/lib/runtime/components/react/dist/mpx-textarea.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-video.d.ts +102 -0
- package/lib/runtime/components/react/dist/mpx-video.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-view.d.ts +35 -0
- package/lib/runtime/components/react/dist/mpx-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-view.jsx +1 -1
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +10 -2
- package/lib/runtime/components/react/dist/parser.d.ts +40 -0
- package/lib/runtime/components/react/dist/parser.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +33 -0
- package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/useNodesRef.d.ts +12 -0
- package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/utils.d.ts +123 -0
- package/lib/runtime/components/react/dist/utils.d.ts.map +1 -0
- package/lib/runtime/components/react/dist/utils.jsx +16 -6
- package/lib/runtime/components/react/mpx-canvas/index.tsx +1 -1
- package/lib/runtime/components/react/mpx-image.tsx +130 -77
- package/lib/runtime/components/react/mpx-input.tsx +38 -15
- package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +66 -49
- package/lib/runtime/components/react/mpx-nav.tsx +155 -0
- package/lib/runtime/components/react/mpx-picker-view/index.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +26 -21
- package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItem.tsx +8 -12
- package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItemLite.tsx +55 -0
- package/lib/runtime/components/react/mpx-portal/index.tsx +8 -2
- package/lib/runtime/components/react/mpx-rich-text/index.tsx +1 -1
- package/lib/runtime/components/react/mpx-scroll-view.tsx +6 -17
- package/lib/runtime/components/react/mpx-text.tsx +38 -5
- package/lib/runtime/components/react/mpx-view.tsx +1 -1
- package/lib/runtime/components/react/mpx-web-view.tsx +13 -4
- package/lib/runtime/components/react/types/common.d.ts +19 -0
- package/lib/runtime/components/react/utils.tsx +15 -6
- package/lib/script-setup-compiler/index.js +2 -2
- package/lib/style-compiler/index.js +3 -2
- package/lib/style-compiler/load-postcss-config.js +1 -1
- package/lib/style-compiler/plugins/trans-special.js +10 -2
- package/lib/style-compiler/strip-conditional-loader.js +177 -15
- package/lib/template-compiler/compiler.js +268 -70
- package/lib/template-compiler/gen-node-react.js +18 -6
- package/lib/template-compiler/index.js +6 -4
- package/lib/template-compiler/parse-exps.js +1 -1
- package/lib/utils/const.js +2 -1
- package/lib/utils/dom-tag-config.js +5 -5
- package/lib/utils/env.js +6 -1
- package/lib/utils/get-build-tag-component.js +35 -0
- package/lib/utils/merge-visitors.js +55 -0
- package/lib/utils/pre-process-json.js +5 -0
- package/lib/web/index.js +2 -0
- package/lib/web/processJSON.js +44 -16
- package/lib/web/processScript.js +1 -1
- package/lib/web/processTemplate.js +6 -4
- package/lib/web/script-helper.js +19 -9
- package/lib/wxs/pre-loader.js +9 -6
- package/lib/wxss/loader.js +1 -9
- package/package.json +15 -5
- package/lib/utils/chain-assign.js +0 -47
|
@@ -31,13 +31,16 @@ module.exports = function ({ print }) {
|
|
|
31
31
|
const qaPropLog = print({ platform: 'qa', tag: TAG_NAME, isError: false })
|
|
32
32
|
const wxPropValueLog = print({ platform: 'wx', tag: TAG_NAME, isError: false, type: 'value' })
|
|
33
33
|
const iosValueLogError = print({ platform: 'ios', tag: TAG_NAME, isError: true, type: 'value' })
|
|
34
|
+
const iosValueLog = print({ platform: 'ios', tag: TAG_NAME, isError: false, type: 'value' })
|
|
34
35
|
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
|
|
35
36
|
const iosEventLog = print({ platform: 'ios', tag: TAG_NAME, isError: false, type: 'event' })
|
|
36
37
|
const androidValueLogError = print({ platform: 'android', tag: TAG_NAME, isError: true, type: 'value' })
|
|
38
|
+
const androidValueLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'value' })
|
|
37
39
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
38
40
|
const androidEventLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
|
|
39
41
|
|
|
40
42
|
const harmonyValueLogError = print({ platform: 'harmony', tag: TAG_NAME, isError: true, type: 'value' })
|
|
43
|
+
const harmonyValueLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'value' })
|
|
41
44
|
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
42
45
|
const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
43
46
|
|
|
@@ -133,19 +136,25 @@ module.exports = function ({ print }) {
|
|
|
133
136
|
ios ({ name, value }) {
|
|
134
137
|
// TODO 此处open-type无其他属性支持了?
|
|
135
138
|
const supported = ['share']
|
|
136
|
-
if (
|
|
139
|
+
if (isMustache(value)) {
|
|
140
|
+
iosValueLog({ name, value })
|
|
141
|
+
} else if (!supported.includes(value)) {
|
|
137
142
|
iosValueLogError({ name, value })
|
|
138
143
|
}
|
|
139
144
|
},
|
|
140
145
|
android ({ name, value }) {
|
|
141
146
|
const supported = ['share']
|
|
142
|
-
if (
|
|
147
|
+
if (isMustache(value)) {
|
|
148
|
+
androidValueLog({ name, value })
|
|
149
|
+
} else if (!supported.includes(value)) {
|
|
143
150
|
androidValueLogError({ name, value })
|
|
144
151
|
}
|
|
145
152
|
},
|
|
146
153
|
harmony ({ name, value }) {
|
|
147
154
|
const supported = ['share']
|
|
148
|
-
if (
|
|
155
|
+
if (isMustache(value)) {
|
|
156
|
+
harmonyValueLog({ name, value })
|
|
157
|
+
} else if (!supported.includes(value)) {
|
|
149
158
|
harmonyValueLogError({ name, value })
|
|
150
159
|
}
|
|
151
160
|
}
|
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
const { parseMustache } = require('../../../../template-compiler/compiler')
|
|
2
|
-
const normalize = require('../../../../utils/normalize')
|
|
3
1
|
const TAG_NAME = 'component'
|
|
4
2
|
|
|
5
|
-
/** is 属性格式化为中划线(-)连接 */
|
|
6
|
-
const formatPropIs = (obj, data) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
3
|
+
/** is 属性格式化为中划线(-)连接 (弃用,新方案:https://github.com/didi/mpx/pull/2228) */
|
|
4
|
+
// const formatPropIs = (obj, data) => {
|
|
5
|
+
// const parsed = parseMustache(obj.value)
|
|
6
|
+
// let value = parsed.result
|
|
7
|
+
// if (parsed.hasBinding) value = value.slice(1, -1)
|
|
8
|
+
// const el = data.el
|
|
9
|
+
// if (el) {
|
|
10
|
+
// const injectWxsProp = {
|
|
11
|
+
// injectWxsPath: '~' + normalize.lib('runtime/utils.wxs'),
|
|
12
|
+
// injectWxsModuleName: '__wxsUtils__'
|
|
13
|
+
// }
|
|
14
|
+
// if (el.injectWxsProps && Array.isArray(el.injectWxsProps)) {
|
|
15
|
+
// el.injectWxsProps.push(injectWxsProp)
|
|
16
|
+
// } else {
|
|
17
|
+
// el.injectWxsProps = [injectWxsProp]
|
|
18
|
+
// }
|
|
19
|
+
// }
|
|
20
|
+
// return {
|
|
21
|
+
// name: 'is',
|
|
22
|
+
// value: `{{__wxsUtils__.humpToLine(${value})}}`
|
|
23
|
+
// }
|
|
24
|
+
// }
|
|
27
25
|
|
|
28
26
|
module.exports = function () {
|
|
29
27
|
return {
|
|
30
28
|
test: TAG_NAME,
|
|
31
29
|
props: [
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
30
|
+
// {
|
|
31
|
+
// test: 'is',
|
|
32
|
+
// ali (obj, data) {
|
|
33
|
+
// return formatPropIs(obj, data)
|
|
34
|
+
// },
|
|
35
|
+
// swan (obj, data) {
|
|
36
|
+
// return formatPropIs(obj, data)
|
|
37
|
+
// }
|
|
38
|
+
// }
|
|
41
39
|
]
|
|
42
40
|
}
|
|
43
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { isOriginTag, isBuildInWebTag } = require('../../../../utils/dom-tag-config')
|
|
1
|
+
const { isOriginTag, isBuildInWebTag, isBuildInReactTag } = require('../../../../utils/dom-tag-config')
|
|
2
2
|
|
|
3
3
|
module.exports = function () {
|
|
4
4
|
const handleComponentTag = (el, data) => {
|
|
@@ -16,7 +16,7 @@ module.exports = function () {
|
|
|
16
16
|
waterfall: true,
|
|
17
17
|
skipNormalize: true,
|
|
18
18
|
supportedModes: ['web', 'ios', 'android', 'harmony'],
|
|
19
|
-
test: (input) => isOriginTag(input) || isBuildInWebTag(input),
|
|
19
|
+
test: (input) => isOriginTag(input) || isBuildInWebTag(input) || isBuildInReactTag(input),
|
|
20
20
|
web: handleComponentTag,
|
|
21
21
|
ios: handleComponentTag,
|
|
22
22
|
android: handleComponentTag,
|
package/lib/react/index.js
CHANGED
|
@@ -21,6 +21,7 @@ module.exports = function ({
|
|
|
21
21
|
hasComment,
|
|
22
22
|
isNative,
|
|
23
23
|
usingComponentsInfo,
|
|
24
|
+
originalUsingComponents,
|
|
24
25
|
componentGenerics,
|
|
25
26
|
autoScope,
|
|
26
27
|
callback
|
|
@@ -53,6 +54,7 @@ module.exports = function ({
|
|
|
53
54
|
moduleId,
|
|
54
55
|
ctorType,
|
|
55
56
|
usingComponentsInfo,
|
|
57
|
+
originalUsingComponents,
|
|
56
58
|
componentGenerics
|
|
57
59
|
}, callback)
|
|
58
60
|
},
|
package/lib/react/processJSON.js
CHANGED
|
@@ -12,11 +12,8 @@ const { transSubpackage } = require('../utils/trans-async-sub-rules')
|
|
|
12
12
|
const createJSONHelper = require('../json-compiler/helper')
|
|
13
13
|
const getRulesRunner = require('../platform/index')
|
|
14
14
|
const { RESOLVE_IGNORED_ERR } = require('../utils/const')
|
|
15
|
-
const normalize = require('../utils/normalize')
|
|
16
15
|
const RecordResourceMapDependency = require('../dependencies/RecordResourceMapDependency')
|
|
17
16
|
const RecordPageConfigsMapDependency = require('../dependencies/RecordPageConfigsMapDependency')
|
|
18
|
-
const mpxViewPath = normalize.lib('runtime/components/react/dist/mpx-view.jsx')
|
|
19
|
-
const mpxTextPath = normalize.lib('runtime/components/react/dist/mpx-text.jsx')
|
|
20
17
|
|
|
21
18
|
module.exports = function (jsonContent, {
|
|
22
19
|
loaderContext,
|
|
@@ -42,23 +39,38 @@ module.exports = function (jsonContent, {
|
|
|
42
39
|
|
|
43
40
|
const emitWarning = (msg) => {
|
|
44
41
|
loaderContext.emitWarning(
|
|
45
|
-
new Error('[json
|
|
42
|
+
new Error('[Mpx json warning][' + loaderContext.resource + ']: ' + msg)
|
|
46
43
|
)
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
const emitError = (msg) => {
|
|
50
47
|
loaderContext.emitError(
|
|
51
|
-
new Error('[json
|
|
48
|
+
new Error('[Mpx json error][' + loaderContext.resource + ']: ' + msg)
|
|
52
49
|
)
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
const stringifyRequest = r => loaderUtils.stringifyRequest(loaderContext, r)
|
|
56
53
|
|
|
54
|
+
function fillInComponentsMap (name, entry, tarRoot) {
|
|
55
|
+
const { resource, outputPath } = entry
|
|
56
|
+
const { resourcePath } = parseRequest(resource)
|
|
57
|
+
componentsMap[resourcePath] = outputPath
|
|
58
|
+
loaderContext._module && loaderContext._module.addPresentationalDependency(new RecordResourceMapDependency(resourcePath, 'component', outputPath))
|
|
59
|
+
localComponentsMap[name] = {
|
|
60
|
+
resource: addQuery(resource, {
|
|
61
|
+
isComponent: true,
|
|
62
|
+
outputPath
|
|
63
|
+
}),
|
|
64
|
+
async: tarRoot
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
57
68
|
const {
|
|
58
69
|
isUrlRequest,
|
|
59
70
|
urlToRequest,
|
|
60
71
|
processPage,
|
|
61
|
-
processComponent
|
|
72
|
+
processComponent,
|
|
73
|
+
processPlaceholder
|
|
62
74
|
} = createJSONHelper({
|
|
63
75
|
loaderContext,
|
|
64
76
|
emitWarning,
|
|
@@ -137,45 +149,6 @@ module.exports = function (jsonContent, {
|
|
|
137
149
|
isShow: true
|
|
138
150
|
}
|
|
139
151
|
|
|
140
|
-
const fillInComponentPlaceholder = (name, placeholder, placeholderEntry) => {
|
|
141
|
-
const componentPlaceholder = jsonObj.componentPlaceholder || {}
|
|
142
|
-
if (componentPlaceholder[name]) return
|
|
143
|
-
componentPlaceholder[name] = placeholder
|
|
144
|
-
jsonObj.componentPlaceholder = componentPlaceholder
|
|
145
|
-
if (placeholderEntry && !jsonObj.usingComponents[placeholder]) jsonObj.usingComponents[placeholder] = placeholderEntry
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const fillInComponentsMap = (name, entry, tarRoot) => {
|
|
149
|
-
const { resource, outputPath } = entry
|
|
150
|
-
const { resourcePath } = parseRequest(resource)
|
|
151
|
-
tarRoot = transSubpackage(mpx.transSubpackageRules, tarRoot)
|
|
152
|
-
componentsMap[resourcePath] = outputPath
|
|
153
|
-
loaderContext._module && loaderContext._module.addPresentationalDependency(new RecordResourceMapDependency(resourcePath, 'component', outputPath))
|
|
154
|
-
localComponentsMap[name] = {
|
|
155
|
-
resource: addQuery(resource, {
|
|
156
|
-
isComponent: true,
|
|
157
|
-
outputPath
|
|
158
|
-
}),
|
|
159
|
-
async: tarRoot
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const normalizePlaceholder = (placeholder) => {
|
|
164
|
-
if (typeof placeholder === 'string') {
|
|
165
|
-
const placeholderMap = mode === 'ali'
|
|
166
|
-
? {
|
|
167
|
-
view: { name: 'mpx-view', resource: mpxViewPath },
|
|
168
|
-
text: { name: 'mpx-text', resource: mpxTextPath }
|
|
169
|
-
}
|
|
170
|
-
: {}
|
|
171
|
-
placeholder = placeholderMap[placeholder] || { name: placeholder }
|
|
172
|
-
}
|
|
173
|
-
if (!placeholder.name) {
|
|
174
|
-
emitError('The asyncSubpackageRules configuration format of @mpxjs/webpack-plugin a is incorrect')
|
|
175
|
-
}
|
|
176
|
-
return placeholder
|
|
177
|
-
}
|
|
178
|
-
|
|
179
152
|
const processTabBar = (tabBar, callback) => {
|
|
180
153
|
if (tabBar) {
|
|
181
154
|
tabBar = Object.assign({}, defaultTabbar, tabBar)
|
|
@@ -345,38 +318,34 @@ module.exports = function (jsonContent, {
|
|
|
345
318
|
|
|
346
319
|
const processComponents = (components, context, callback) => {
|
|
347
320
|
if (components) {
|
|
321
|
+
const asyncComponents = []
|
|
322
|
+
const resolveResourcePathMap = new Map()
|
|
348
323
|
async.eachOf(components, (component, name, callback) => {
|
|
349
|
-
processComponent(component, context, {}, (err, entry = {}, { tarRoot, placeholder } = {}) => {
|
|
324
|
+
processComponent(component, context, {}, (err, entry = {}, { tarRoot, placeholder, resourcePath } = {}) => {
|
|
350
325
|
if (err) return callback(err === RESOLVE_IGNORED_ERR ? null : err)
|
|
351
|
-
fillInComponentsMap(name, entry, tarRoot)
|
|
352
326
|
const { relativePath } = entry
|
|
353
327
|
|
|
354
|
-
|
|
328
|
+
tarRoot = transSubpackage(mpx.transSubpackageRules, tarRoot)
|
|
329
|
+
|
|
330
|
+
resolveResourcePathMap.set(name, resourcePath)
|
|
331
|
+
if (tarRoot) asyncComponents.push({ name, tarRoot, placeholder, relativePath })
|
|
332
|
+
|
|
333
|
+
fillInComponentsMap(name, entry, tarRoot)
|
|
334
|
+
callback()
|
|
335
|
+
})
|
|
336
|
+
}, (err) => {
|
|
337
|
+
if (err) return callback(err)
|
|
338
|
+
async.each(asyncComponents, ({ name, tarRoot, placeholder, relativePath }, callback) => {
|
|
339
|
+
processPlaceholder({ jsonObj, context, name, tarRoot, placeholder, relativePath, resolveResourcePathMap }, (err, placeholder) => {
|
|
340
|
+
if (err) return callback(err)
|
|
355
341
|
if (placeholder) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
processComponent(placeholder.resource, projectRoot, { relativePath }, (err, entry) => {
|
|
359
|
-
if (err) return callback(err)
|
|
360
|
-
fillInComponentPlaceholder(name, placeholder.name, entry)
|
|
361
|
-
fillInComponentsMap(placeholder.name, entry, '')
|
|
362
|
-
callback()
|
|
363
|
-
})
|
|
364
|
-
} else {
|
|
365
|
-
fillInComponentPlaceholder(name, placeholder.name)
|
|
366
|
-
callback()
|
|
367
|
-
}
|
|
368
|
-
} else {
|
|
369
|
-
if (!jsonObj.componentPlaceholder || !jsonObj.componentPlaceholder[name]) {
|
|
370
|
-
const errMsg = `componentPlaceholder of "${name}" doesn't exist! \n\r`
|
|
371
|
-
emitError(errMsg)
|
|
372
|
-
}
|
|
373
|
-
callback()
|
|
342
|
+
const { name, entry } = placeholder
|
|
343
|
+
fillInComponentsMap(name, entry, '')
|
|
374
344
|
}
|
|
375
|
-
} else {
|
|
376
345
|
callback()
|
|
377
|
-
}
|
|
378
|
-
})
|
|
379
|
-
}
|
|
346
|
+
})
|
|
347
|
+
}, callback)
|
|
348
|
+
})
|
|
380
349
|
} else {
|
|
381
350
|
callback()
|
|
382
351
|
}
|
|
@@ -394,7 +363,6 @@ module.exports = function (jsonContent, {
|
|
|
394
363
|
callback()
|
|
395
364
|
}
|
|
396
365
|
}
|
|
397
|
-
|
|
398
366
|
async.parallel([
|
|
399
367
|
(callback) => {
|
|
400
368
|
// 添加首页标识
|
|
@@ -15,12 +15,12 @@ module.exports = function (styles, {
|
|
|
15
15
|
if (styles.length) {
|
|
16
16
|
const warn = (msg) => {
|
|
17
17
|
loaderContext.emitWarning(
|
|
18
|
-
new Error('[style
|
|
18
|
+
new Error('[Mpx style warning][' + loaderContext.resource + ']: ' + msg)
|
|
19
19
|
)
|
|
20
20
|
}
|
|
21
21
|
const error = (msg) => {
|
|
22
22
|
loaderContext.emitError(
|
|
23
|
-
new Error('[style
|
|
23
|
+
new Error('[Mpx style error][' + loaderContext.resource + ']: ' + msg)
|
|
24
24
|
)
|
|
25
25
|
}
|
|
26
26
|
const { mode, srcMode } = loaderContext.getMpx()
|
|
@@ -52,6 +52,7 @@ module.exports = function (styles, {
|
|
|
52
52
|
filename: loaderContext.resourcePath,
|
|
53
53
|
mode,
|
|
54
54
|
srcMode,
|
|
55
|
+
ctorType,
|
|
55
56
|
warn,
|
|
56
57
|
error
|
|
57
58
|
})
|
|
@@ -17,6 +17,7 @@ module.exports = function (template, {
|
|
|
17
17
|
moduleId,
|
|
18
18
|
ctorType,
|
|
19
19
|
usingComponentsInfo,
|
|
20
|
+
originalUsingComponents,
|
|
20
21
|
componentGenerics
|
|
21
22
|
}, callback) {
|
|
22
23
|
const mpx = loaderContext.getMpx()
|
|
@@ -46,28 +47,29 @@ module.exports = function (template, {
|
|
|
46
47
|
if (template) {
|
|
47
48
|
// 由于远端src template资源引用的相对路径可能发生变化,暂时不支持。
|
|
48
49
|
if (template.src) {
|
|
49
|
-
return callback(new Error('[
|
|
50
|
+
return callback(new Error('[Mpx template error][' + loaderContext.resource + ']: ' + 'template content must be inline in .mpx files!'))
|
|
50
51
|
}
|
|
51
52
|
if (template.lang) {
|
|
52
|
-
return callback(new Error('[
|
|
53
|
+
return callback(new Error('[Mpx template error][' + loaderContext.resource + ']: ' + 'template lang is not supported in trans react native mode temporarily, we will support it in the future!'))
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
if (template.content) {
|
|
56
57
|
const templateSrcMode = template.mode || srcMode
|
|
57
58
|
const warn = (msg) => {
|
|
58
59
|
loaderContext.emitWarning(
|
|
59
|
-
new Error('[template
|
|
60
|
+
new Error('[Mpx template warning][' + loaderContext.resource + ']: ' + msg)
|
|
60
61
|
)
|
|
61
62
|
}
|
|
62
63
|
const error = (msg) => {
|
|
63
64
|
loaderContext.emitError(
|
|
64
|
-
new Error('[template
|
|
65
|
+
new Error('[mpx template error][' + loaderContext.resource + ']: ' + msg)
|
|
65
66
|
)
|
|
66
67
|
}
|
|
67
68
|
const { root, meta } = templateCompiler.parse(template.content, {
|
|
68
69
|
warn,
|
|
69
70
|
error,
|
|
70
71
|
usingComponentsInfo, // processTemplate中无其他地方使用,直接透传 string 类型
|
|
72
|
+
originalUsingComponents,
|
|
71
73
|
hasComment,
|
|
72
74
|
isNative,
|
|
73
75
|
ctorType,
|
|
@@ -113,7 +115,7 @@ module.exports = function (template, {
|
|
|
113
115
|
output += `var ${module} = require(${loaderUtils.stringifyRequest(this, src)});\n`
|
|
114
116
|
}
|
|
115
117
|
|
|
116
|
-
const rawCode = genNode(root)
|
|
118
|
+
const rawCode = genNode(root, true)
|
|
117
119
|
if (rawCode) {
|
|
118
120
|
try {
|
|
119
121
|
const ignoreMap = Object.assign({
|
|
@@ -130,7 +132,7 @@ module.exports = function (template, {
|
|
|
130
132
|
return ${bindResult.code}
|
|
131
133
|
};\n`
|
|
132
134
|
} catch (e) {
|
|
133
|
-
error(`Invalid render function generated by the template, please check!
|
|
135
|
+
error(`[Mpx template error]: Invalid render function generated by the template, please check!
|
|
134
136
|
Error code:
|
|
135
137
|
${rawCode}
|
|
136
138
|
Error Detail:
|
|
@@ -4,16 +4,11 @@ const parseRequest = require('../utils/parse-request')
|
|
|
4
4
|
const shallowStringify = require('../utils/shallow-stringify')
|
|
5
5
|
const normalize = require('../utils/normalize')
|
|
6
6
|
const addQuery = require('../utils/add-query')
|
|
7
|
-
const { isBuildInReactTag } = require('../utils/dom-tag-config')
|
|
8
7
|
|
|
9
8
|
function stringifyRequest (loaderContext, request) {
|
|
10
9
|
return loaderUtils.stringifyRequest(loaderContext, request)
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
function getBuiltInComponentRequest (component) {
|
|
14
|
-
return JSON.stringify(addQuery(`@mpxjs/webpack-plugin/lib/runtime/components/react/dist/${component}`, { isComponent: true }))
|
|
15
|
-
}
|
|
16
|
-
|
|
17
12
|
function getAsyncChunkName (chunkName) {
|
|
18
13
|
if (chunkName && typeof chunkName !== 'boolean') {
|
|
19
14
|
return `/* webpackChunkName: "${chunkName}/index" */`
|
|
@@ -26,8 +21,8 @@ function getAsyncSuspense (type, moduleId, componentRequest, componentName, chun
|
|
|
26
21
|
type: ${JSON.stringify(type)},
|
|
27
22
|
moduleId: ${JSON.stringify(moduleId)},
|
|
28
23
|
chunkName: ${JSON.stringify(chunkName)},
|
|
29
|
-
getFallback: ${getFallback}
|
|
30
|
-
getLoading: ${getLoading}
|
|
24
|
+
${getFallback ? `getFallback: ${getFallback},` : ''}
|
|
25
|
+
${getLoading ? `getLoading: ${getLoading},` : ''}
|
|
31
26
|
getChildren () {
|
|
32
27
|
return import(${getAsyncChunkName(chunkName)}${componentRequest}).then(function (res) {
|
|
33
28
|
return getComponent(res, {displayName: ${JSON.stringify(componentName)}})
|
|
@@ -95,22 +90,17 @@ function buildComponentsMap ({ localComponentsMap, builtInComponentsMap, loaderC
|
|
|
95
90
|
if (placeholder) {
|
|
96
91
|
if (localComponentsMap[placeholder]) {
|
|
97
92
|
const placeholderCfg = localComponentsMap[placeholder]
|
|
98
|
-
const placeholderRequest = stringifyRequest(loaderContext, placeholderCfg.resource)
|
|
99
93
|
if (placeholderCfg.async) {
|
|
100
94
|
loaderContext.emitWarning(
|
|
101
95
|
new Error(`[json processor][${loaderContext.resource}]: componentPlaceholder ${placeholder} should not be a async component, please check!`)
|
|
102
96
|
)
|
|
103
97
|
}
|
|
98
|
+
const placeholderRequest = stringifyRequest(loaderContext, placeholderCfg.resource)
|
|
104
99
|
getFallback = getComponentGetter(getComponent(placeholderRequest, placeholder))
|
|
105
100
|
} else {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} else {
|
|
110
|
-
loaderContext.emitError(
|
|
111
|
-
new Error(`[json processor][${loaderContext.resource}]: componentPlaceholder ${placeholder} is not built-in component, please check!`)
|
|
112
|
-
)
|
|
113
|
-
}
|
|
101
|
+
loaderContext.emitError(
|
|
102
|
+
new Error(`[json processor][${loaderContext.resource}]: componentPlaceholder ${placeholder} is not built-in component or custom component, please check!`)
|
|
103
|
+
)
|
|
114
104
|
}
|
|
115
105
|
} else {
|
|
116
106
|
loaderContext.emitError(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const postcss = require('postcss')
|
|
2
2
|
const selectorParser = require('postcss-selector-parser')
|
|
3
|
+
const { MPX_TAG_PAGE_SELECTOR } = require('../utils/const')
|
|
3
4
|
const getRulesRunner = require('../platform/index')
|
|
4
5
|
const dash2hump = require('../utils/hump-dash').dash2hump
|
|
5
6
|
const unitRegExp = /^\s*(-?\d+(?:\.\d+)?)(rpx|vw|vh)\s*$/
|
|
@@ -7,8 +8,8 @@ const numberRegExp = /^\s*(-?\d+(\.\d+)?)(px)?\s*$/
|
|
|
7
8
|
const hairlineRegExp = /^\s*hairlineWidth\s*$/
|
|
8
9
|
const varRegExp = /^--/
|
|
9
10
|
const cssPrefixExp = /^-(webkit|moz|ms|o)-/
|
|
10
|
-
function getClassMap ({ content, filename, mode, srcMode, warn, error }) {
|
|
11
|
-
const classMap = {}
|
|
11
|
+
function getClassMap ({ content, filename, mode, srcMode, ctorType, warn, error }) {
|
|
12
|
+
const classMap = ctorType === 'page' ? { [MPX_TAG_PAGE_SELECTOR]: { flex: 1 } } : {}
|
|
12
13
|
|
|
13
14
|
const root = postcss.parse(content, {
|
|
14
15
|
from: filename
|
|
@@ -36,6 +37,13 @@ function getClassMap ({ content, filename, mode, srcMode, warn, error }) {
|
|
|
36
37
|
error
|
|
37
38
|
})
|
|
38
39
|
|
|
40
|
+
// 目前所有 AtRule 只支持 @media,其他全部给出错误提示
|
|
41
|
+
root.walkAtRules(rule => {
|
|
42
|
+
if (rule.name !== 'media') {
|
|
43
|
+
warn(`Only @media rule is supported in react native mode temporarily, but got @${rule.name}`)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
|
|
39
47
|
root.walkRules(rule => {
|
|
40
48
|
const classMapValue = {}
|
|
41
49
|
rule.walkDecls(({ prop, value }) => {
|
|
@@ -6,9 +6,13 @@ export type LabelContextValue = MutableRefObject<{
|
|
|
6
6
|
triggerChange: (evt: NativeSyntheticEvent<TouchEvent>) => void
|
|
7
7
|
}>
|
|
8
8
|
|
|
9
|
-
export type KeyboardAvoidContextValue = MutableRefObject<
|
|
10
|
-
|
|
11
|
-
>
|
|
9
|
+
export type KeyboardAvoidContextValue = MutableRefObject<{
|
|
10
|
+
cursorSpacing: number
|
|
11
|
+
ref: MutableRefObject<any>
|
|
12
|
+
adjustPosition: boolean
|
|
13
|
+
keyboardHeight?: number
|
|
14
|
+
onKeyboardShow?: () => void
|
|
15
|
+
} | null>
|
|
12
16
|
|
|
13
17
|
export interface GroupValue {
|
|
14
18
|
[key: string]: { checked: boolean; setValue: Dispatch<SetStateAction<boolean>> }
|
|
@@ -37,13 +41,13 @@ export interface IntersectionObserver {
|
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
export interface PortalContextValue {
|
|
40
|
-
mount: (children: React.ReactNode, key?: number | null, id?: number| null) => number| undefined
|
|
44
|
+
mount: (children: React.ReactNode, key?: number | null, id?: number | null) => number | undefined
|
|
41
45
|
update: (key: number, children: React.ReactNode) => void
|
|
42
46
|
unmount: (key: number) => void
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
export interface ScrollViewContextValue {
|
|
46
|
-
gestureRef: React.RefObject<any> | null
|
|
50
|
+
gestureRef: React.RefObject<any> | null
|
|
47
51
|
scrollOffset: Animated.Value
|
|
48
52
|
}
|
|
49
53
|
|
|
@@ -53,7 +57,7 @@ export interface RouteContextValue {
|
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
export interface StickyContextValue {
|
|
56
|
-
registerStickyHeader: Function
|
|
60
|
+
registerStickyHeader: Function
|
|
57
61
|
unregisterStickyHeader: Function
|
|
58
62
|
}
|
|
59
63
|
|
|
@@ -84,3 +88,5 @@ export const ScrollViewContext = createContext<ScrollViewContextValue>({ gesture
|
|
|
84
88
|
export const PortalContext = createContext<PortalContextValue>(null as any)
|
|
85
89
|
|
|
86
90
|
export const StickyContext = createContext<StickyContextValue>({ registerStickyHeader: noop, unregisterStickyHeader: noop })
|
|
91
|
+
|
|
92
|
+
export const ProviderContext = createContext(null)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
2
|
+
import { NativeSyntheticEvent, Animated } from 'react-native';
|
|
3
|
+
export type LabelContextValue = MutableRefObject<{
|
|
4
|
+
triggerChange: (evt: NativeSyntheticEvent<TouchEvent>) => void;
|
|
5
|
+
}>;
|
|
6
|
+
export type KeyboardAvoidContextValue = MutableRefObject<{
|
|
7
|
+
cursorSpacing: number;
|
|
8
|
+
ref: MutableRefObject<any>;
|
|
9
|
+
adjustPosition: boolean;
|
|
10
|
+
keyboardHeight?: number;
|
|
11
|
+
onKeyboardShow?: () => void;
|
|
12
|
+
} | null>;
|
|
13
|
+
export interface GroupValue {
|
|
14
|
+
[key: string]: {
|
|
15
|
+
checked: boolean;
|
|
16
|
+
setValue: Dispatch<SetStateAction<boolean>>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface GroupContextValue {
|
|
20
|
+
groupValue: GroupValue;
|
|
21
|
+
notifyChange: (evt: NativeSyntheticEvent<TouchEvent>) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface FormFieldValue {
|
|
24
|
+
getValue: () => any;
|
|
25
|
+
resetValue: ({ newVal, type }: {
|
|
26
|
+
newVal?: any;
|
|
27
|
+
type?: string;
|
|
28
|
+
}) => void;
|
|
29
|
+
}
|
|
30
|
+
export interface FormContextValue {
|
|
31
|
+
formValuesMap: Map<string, FormFieldValue>;
|
|
32
|
+
submit: () => void;
|
|
33
|
+
reset: () => void;
|
|
34
|
+
}
|
|
35
|
+
export interface IntersectionObserver {
|
|
36
|
+
[key: number]: {
|
|
37
|
+
throttleMeasure: () => void;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface PortalContextValue {
|
|
41
|
+
mount: (children: React.ReactNode, key?: number | null, id?: number | null) => number | undefined;
|
|
42
|
+
update: (key: number, children: React.ReactNode) => void;
|
|
43
|
+
unmount: (key: number) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface ScrollViewContextValue {
|
|
46
|
+
gestureRef: React.RefObject<any> | null;
|
|
47
|
+
scrollOffset: Animated.Value;
|
|
48
|
+
}
|
|
49
|
+
export interface RouteContextValue {
|
|
50
|
+
pageId: number;
|
|
51
|
+
navigation: Record<string, any>;
|
|
52
|
+
}
|
|
53
|
+
export interface StickyContextValue {
|
|
54
|
+
registerStickyHeader: Function;
|
|
55
|
+
unregisterStickyHeader: Function;
|
|
56
|
+
}
|
|
57
|
+
export declare const MovableAreaContext: import("react").Context<{
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const FormContext: import("react").Context<FormContextValue | null>;
|
|
62
|
+
export declare const CheckboxGroupContext: import("react").Context<GroupContextValue | null>;
|
|
63
|
+
export declare const RadioGroupContext: import("react").Context<GroupContextValue | null>;
|
|
64
|
+
export declare const LabelContext: import("react").Context<LabelContextValue | null>;
|
|
65
|
+
export declare const PickerContext: import("react").Context<null>;
|
|
66
|
+
export declare const VarContext: import("react").Context<{}>;
|
|
67
|
+
export declare const IntersectionObserverContext: import("react").Context<IntersectionObserver | null>;
|
|
68
|
+
export declare const RouteContext: import("react").Context<RouteContextValue | null>;
|
|
69
|
+
export declare const SwiperContext: import("react").Context<{}>;
|
|
70
|
+
export declare const KeyboardAvoidContext: import("react").Context<KeyboardAvoidContextValue | null>;
|
|
71
|
+
export declare const ScrollViewContext: import("react").Context<ScrollViewContextValue>;
|
|
72
|
+
export declare const PortalContext: import("react").Context<PortalContextValue>;
|
|
73
|
+
export declare const StickyContext: import("react").Context<StickyContextValue>;
|
|
74
|
+
export declare const ProviderContext: import("react").Context<null>;
|
|
75
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../context.ts"],"names":[],"mappings":"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"}
|
|
@@ -15,3 +15,4 @@ export const KeyboardAvoidContext = createContext(null);
|
|
|
15
15
|
export const ScrollViewContext = createContext({ gestureRef: null, scrollOffset: new Animated.Value(0) });
|
|
16
16
|
export const PortalContext = createContext(null);
|
|
17
17
|
export const StickyContext = createContext({ registerStickyHeader: noop, unregisterStickyHeader: noop });
|
|
18
|
+
export const ProviderContext = createContext(null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.config.d.ts","sourceRoot":"","sources":["../event.config.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,cAAc,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAyB3E,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Props, RawConfig, RemoveProps, LayoutRef, ExtendedNativeTouchEvent } from './types/getInnerListeners';
|
|
2
|
+
export declare const getCustomEvent: (type: string | undefined, oe: any, { detail, layoutRef }: {
|
|
3
|
+
detail?: Record<string, unknown> | undefined;
|
|
4
|
+
layoutRef?: LayoutRef | undefined;
|
|
5
|
+
}, props?: Props) => any;
|
|
6
|
+
declare const useInnerProps: (props?: Props, userRemoveProps?: RemoveProps, rawConfig?: RawConfig) => Record<string, (e: ExtendedNativeTouchEvent) => void> & Omit<Props, string>;
|
|
7
|
+
export default useInnerProps;
|
|
8
|
+
//# sourceMappingURL=getInnerListeners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInnerListeners.d.ts","sourceRoot":"","sources":["../getInnerListeners.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,EAEL,SAAS,EAET,WAAW,EAEX,SAAS,EACT,wBAAwB,EAEzB,MAAM,2BAA2B,CAAA;AAsElC,eAAO,MAAM,cAAc,iCAErB,GAAG;;;WAKA,KAAK,QAgBb,CAAA;AAyID,QAAA,MAAM,aAAa,WACV,KAAK,6CAEA,SAAS,wBA8Dc,wBAAwB,KAAK,IAAI,uBA2BrE,CAAA;AACD,eAAe,aAAa,CAAA"}
|