@tarojs/plugin-platform-weapp 3.3.12 → 3.4.0-beta.0

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/dist/runtime.js CHANGED
@@ -1,4 +1,4 @@
1
- import { processApis, singleQuote, mergeReconciler, mergeInternalComponents } from '@tarojs/shared';
1
+ import { processApis, mergeReconciler, mergeInternalComponents } from '@tarojs/shared';
2
2
 
3
3
  const needPromiseApis = new Set([
4
4
  'authPrivateMessage',
@@ -16,7 +16,8 @@ const needPromiseApis = new Set([
16
16
  'setWindowSize',
17
17
  'sendBizRedPacket',
18
18
  'startFacialRecognitionVerify',
19
- 'openCustomerServiceChat'
19
+ 'openCustomerServiceChat',
20
+ 'getLocalIPAddress'
20
21
  ]);
21
22
 
22
23
  function initNativeApi(taro) {
@@ -30,322 +31,326 @@ function initNativeApi(taro) {
30
31
  taro.cloud = wx.cloud;
31
32
  }
32
33
 
34
+ const _true = 'true';
35
+ const _false = 'false';
36
+ const _empty = '';
37
+ const _zero = '0';
33
38
  const components = {
34
39
  // ======== 调整属性 ========
35
40
  Progress: {
36
- 'border-radius': '0',
41
+ 'border-radius': _zero,
37
42
  'font-size': '16',
38
43
  duration: '30',
39
- bindActiveEnd: ''
44
+ bindActiveEnd: _empty
40
45
  },
41
46
  RichText: {
42
- space: ''
47
+ space: _empty
43
48
  },
44
49
  Text: {
45
- 'user-select': 'false'
50
+ 'user-select': _false
46
51
  },
47
52
  Map: {
48
53
  polygons: '[]',
49
- subkey: '',
50
- rotate: '0',
51
- skew: '0',
54
+ subkey: _empty,
55
+ rotate: _zero,
56
+ skew: _zero,
52
57
  'max-scale': '20',
53
58
  'min-scale': '3',
54
- 'enable-3D': 'false',
55
- 'show-compass': 'false',
56
- 'show-scale': 'false',
57
- 'enable-overlooking': 'false',
58
- 'enable-zoom': 'true',
59
- 'enable-scroll': 'true',
60
- 'enable-rotate': 'false',
61
- 'enable-satellite': 'false',
62
- 'enable-traffic': 'false',
59
+ 'enable-3D': _false,
60
+ 'show-compass': _false,
61
+ 'show-scale': _false,
62
+ 'enable-overlooking': _false,
63
+ 'enable-zoom': _true,
64
+ 'enable-scroll': _true,
65
+ 'enable-rotate': _false,
66
+ 'enable-satellite': _false,
67
+ 'enable-traffic': _false,
63
68
  setting: '[]',
64
- bindLabelTap: '',
65
- bindRegionChange: '',
66
- bindPoiTap: ''
69
+ bindLabelTap: _empty,
70
+ bindRegionChange: _empty,
71
+ bindPoiTap: _empty
67
72
  },
68
73
  Button: {
69
74
  lang: 'en',
70
- 'session-from': '',
71
- 'send-message-title': '',
72
- 'send-message-path': '',
73
- 'send-message-img': '',
74
- 'app-parameter': '',
75
- 'show-message-card': 'false',
76
- 'business-id': '',
77
- bindGetUserInfo: '',
78
- bindContact: '',
79
- bindGetPhoneNumber: '',
80
- bindError: '',
81
- bindOpenSetting: '',
82
- bindLaunchApp: ''
75
+ 'session-from': _empty,
76
+ 'send-message-title': _empty,
77
+ 'send-message-path': _empty,
78
+ 'send-message-img': _empty,
79
+ 'app-parameter': _empty,
80
+ 'show-message-card': _false,
81
+ 'business-id': _empty,
82
+ bindGetUserInfo: _empty,
83
+ bindContact: _empty,
84
+ bindGetPhoneNumber: _empty,
85
+ bindError: _empty,
86
+ bindOpenSetting: _empty,
87
+ bindLaunchApp: _empty
83
88
  },
84
89
  Form: {
85
- 'report-submit-timeout': '0'
90
+ 'report-submit-timeout': _zero
86
91
  },
87
92
  Input: {
88
- 'always-embed': 'false',
89
- 'adjust-position': 'true',
90
- 'hold-keyboard': 'false',
91
- bindKeyboardHeightChange: ''
93
+ 'always-embed': _false,
94
+ 'adjust-position': _true,
95
+ 'hold-keyboard': _false,
96
+ bindKeyboardHeightChange: _empty
92
97
  },
93
98
  Picker: {
94
- 'header-text': ''
99
+ 'header-text': _empty
95
100
  },
96
101
  PickerView: {
97
- bindPickStart: '',
98
- bindPickEnd: ''
102
+ bindPickStart: _empty,
103
+ bindPickEnd: _empty
99
104
  },
100
105
  Slider: {
101
- color: singleQuote('#e9e9e9'),
102
- 'selected-color': singleQuote('#1aad19')
106
+ color: "'#e9e9e9'",
107
+ 'selected-color': "'#1aad19'"
103
108
  },
104
109
  Textarea: {
105
- 'show-confirm-bar': 'true',
106
- 'adjust-position': 'true',
107
- 'hold-keyboard': 'false',
108
- 'disable-default-padding': 'false',
109
- 'confirm-type': singleQuote('return'),
110
- 'confirm-hold': 'false',
111
- bindKeyboardHeightChange: ''
110
+ 'show-confirm-bar': _true,
111
+ 'adjust-position': _true,
112
+ 'hold-keyboard': _false,
113
+ 'disable-default-padding': _false,
114
+ 'confirm-type': "'return'",
115
+ 'confirm-hold': _false,
116
+ bindKeyboardHeightChange: _empty
112
117
  },
113
118
  ScrollView: {
114
- 'enable-flex': 'false',
115
- 'scroll-anchoring': 'false',
116
- 'refresher-enabled': 'false',
119
+ 'enable-flex': _false,
120
+ 'scroll-anchoring': _false,
121
+ 'refresher-enabled': _false,
117
122
  'refresher-threshold': '45',
118
- 'refresher-default-style': singleQuote('black'),
119
- 'refresher-background': singleQuote('#FFF'),
120
- 'refresher-triggered': 'false',
121
- enhanced: 'false',
122
- bounces: 'true',
123
- 'show-scrollbar': 'true',
124
- 'paging-enabled': 'false',
125
- 'fast-deceleration': 'false',
126
- bindDragStart: '',
127
- bindDragging: '',
128
- bindDragEnd: '',
129
- bindRefresherPulling: '',
130
- bindRefresherRefresh: '',
131
- bindRefresherRestore: '',
132
- bindRefresherAbort: ''
123
+ 'refresher-default-style': "'black'",
124
+ 'refresher-background': "'#FFF'",
125
+ 'refresher-triggered': _false,
126
+ enhanced: _false,
127
+ bounces: _true,
128
+ 'show-scrollbar': _true,
129
+ 'paging-enabled': _false,
130
+ 'fast-deceleration': _false,
131
+ bindDragStart: _empty,
132
+ bindDragging: _empty,
133
+ bindDragEnd: _empty,
134
+ bindRefresherPulling: _empty,
135
+ bindRefresherRefresh: _empty,
136
+ bindRefresherRestore: _empty,
137
+ bindRefresherAbort: _empty
133
138
  },
134
139
  Swiper: {
135
- 'snap-to-edge': 'false',
136
- 'easing-function': singleQuote('default')
140
+ 'snap-to-edge': _false,
141
+ 'easing-function': "'default'"
137
142
  },
138
143
  SwiperItem: {
139
- 'skip-hidden-item-layout': 'false'
144
+ 'skip-hidden-item-layout': _false
140
145
  },
141
146
  Navigator: {
142
- target: singleQuote('self'),
143
- 'app-id': '',
144
- path: '',
145
- 'extra-data': '',
146
- version: singleQuote('version')
147
+ target: "'self'",
148
+ 'app-id': _empty,
149
+ path: _empty,
150
+ 'extra-data': _empty,
151
+ version: "'version'"
147
152
  },
148
153
  Camera: {
149
- mode: singleQuote('normal'),
150
- resolution: singleQuote('medium'),
151
- 'frame-size': singleQuote('medium'),
152
- bindInitDone: '',
153
- bindScanCode: ''
154
+ mode: "'normal'",
155
+ resolution: "'medium'",
156
+ 'frame-size': "'medium'",
157
+ bindInitDone: _empty,
158
+ bindScanCode: _empty
154
159
  },
155
160
  Image: {
156
- webp: 'false',
157
- 'show-menu-by-longpress': 'false'
161
+ webp: _false,
162
+ 'show-menu-by-longpress': _false
158
163
  },
159
164
  LivePlayer: {
160
- mode: singleQuote('live'),
161
- 'sound-mode': singleQuote('speaker'),
162
- 'auto-pause-if-navigate': 'true',
163
- 'auto-pause-if-open-native': 'true',
165
+ mode: "'live'",
166
+ 'sound-mode': "'speaker'",
167
+ 'auto-pause-if-navigate': _true,
168
+ 'auto-pause-if-open-native': _true,
164
169
  'picture-in-picture-mode': '[]',
165
- bindstatechange: '',
166
- bindfullscreenchange: '',
167
- bindnetstatus: '',
168
- bindAudioVolumeNotify: '',
169
- bindEnterPictureInPicture: '',
170
- bindLeavePictureInPicture: ''
170
+ bindstatechange: _empty,
171
+ bindfullscreenchange: _empty,
172
+ bindnetstatus: _empty,
173
+ bindAudioVolumeNotify: _empty,
174
+ bindEnterPictureInPicture: _empty,
175
+ bindLeavePictureInPicture: _empty
171
176
  },
172
177
  Video: {
173
- title: '',
174
- 'play-btn-position': singleQuote('bottom'),
175
- 'enable-play-gesture': 'false',
176
- 'auto-pause-if-navigate': 'true',
177
- 'auto-pause-if-open-native': 'true',
178
- 'vslide-gesture': 'false',
179
- 'vslide-gesture-in-fullscreen': 'true',
180
- 'ad-unit-id': '',
181
- 'poster-for-crawler': '',
182
- 'show-casting-button': 'false',
178
+ title: _empty,
179
+ 'play-btn-position': "'bottom'",
180
+ 'enable-play-gesture': _false,
181
+ 'auto-pause-if-navigate': _true,
182
+ 'auto-pause-if-open-native': _true,
183
+ 'vslide-gesture': _false,
184
+ 'vslide-gesture-in-fullscreen': _true,
185
+ 'ad-unit-id': _empty,
186
+ 'poster-for-crawler': _empty,
187
+ 'show-casting-button': _false,
183
188
  'picture-in-picture-mode': '[]',
184
189
  // picture-in-picture-show-progress 属性先注释掉的原因如下:
185
190
  // 该属性超过了 wxml 属性的长度限制,实际无法使用且导致编译报错。可等微信官方修复后再放开。
186
191
  // 参考1:https://developers.weixin.qq.com/community/develop/doc/000a429beb87f0eac07acc0fc5b400
187
192
  // 参考2: https://developers.weixin.qq.com/community/develop/doc/0006883619c48054286a4308258c00?_at=vyxqpllafi
188
193
  // 'picture-in-picture-show-progress': 'false',
189
- 'enable-auto-rotation': 'false',
190
- 'show-screen-lock-button': 'false',
191
- 'show-snapshot-button': 'false',
192
- 'show-background-playback-button': 'false',
193
- 'background-poster': '',
194
- bindProgress: '',
195
- bindLoadedMetadata: '',
196
- bindControlsToggle: '',
197
- bindEnterPictureInPicture: '',
198
- bindLeavePictureInPicture: '',
199
- bindSeekComplete: '',
200
- bindAdLoad: '',
201
- bindAdError: '',
202
- bindAdClose: '',
203
- bindAdPlay: ''
194
+ 'enable-auto-rotation': _false,
195
+ 'show-screen-lock-button': _false,
196
+ 'show-snapshot-button': _false,
197
+ 'show-background-playback-button': _false,
198
+ 'background-poster': _empty,
199
+ bindProgress: _empty,
200
+ bindLoadedMetadata: _empty,
201
+ bindControlsToggle: _empty,
202
+ bindEnterPictureInPicture: _empty,
203
+ bindLeavePictureInPicture: _empty,
204
+ bindSeekComplete: _empty,
205
+ bindAdLoad: _empty,
206
+ bindAdError: _empty,
207
+ bindAdClose: _empty,
208
+ bindAdPlay: _empty
204
209
  },
205
210
  Canvas: {
206
- type: ''
211
+ type: _empty
207
212
  },
208
213
  Ad: {
209
- 'ad-type': singleQuote('banner'),
210
- 'ad-theme': singleQuote('white')
214
+ 'ad-type': "'banner'",
215
+ 'ad-theme': "'white'"
211
216
  },
212
217
  CoverView: {
213
- 'marker-id': '',
214
- slot: ''
218
+ 'marker-id': _empty,
219
+ slot: _empty
215
220
  },
216
221
  // ======== 额外组件 ========
217
222
  Editor: {
218
- 'read-only': 'false',
219
- placeholder: '',
220
- 'show-img-size': 'false',
221
- 'show-img-toolbar': 'false',
222
- 'show-img-resize': 'false',
223
- focus: 'false',
224
- bindReady: '',
225
- bindFocus: '',
226
- bindBlur: '',
227
- bindInput: '',
228
- bindStatusChange: '',
229
- name: ''
223
+ 'read-only': _false,
224
+ placeholder: _empty,
225
+ 'show-img-size': _false,
226
+ 'show-img-toolbar': _false,
227
+ 'show-img-resize': _false,
228
+ focus: _false,
229
+ bindReady: _empty,
230
+ bindFocus: _empty,
231
+ bindBlur: _empty,
232
+ bindInput: _empty,
233
+ bindStatusChange: _empty,
234
+ name: _empty
230
235
  },
231
236
  MatchMedia: {
232
- 'min-width': '',
233
- 'max-width': '',
234
- width: '',
235
- 'min-height': '',
236
- 'max-height': '',
237
- height: '',
238
- orientation: ''
237
+ 'min-width': _empty,
238
+ 'max-width': _empty,
239
+ width: _empty,
240
+ 'min-height': _empty,
241
+ 'max-height': _empty,
242
+ height: _empty,
243
+ orientation: _empty
239
244
  },
240
245
  FunctionalPageNavigator: {
241
- version: singleQuote('release'),
242
- name: '',
243
- args: '',
244
- bindSuccess: '',
245
- bindFail: '',
246
- bindCancel: ''
246
+ version: "'release'",
247
+ name: _empty,
248
+ args: _empty,
249
+ bindSuccess: _empty,
250
+ bindFail: _empty,
251
+ bindCancel: _empty
247
252
  },
248
253
  LivePusher: {
249
- url: '',
250
- mode: singleQuote('RTC'),
251
- autopush: 'false',
252
- muted: 'false',
253
- 'enable-camera': 'true',
254
- 'auto-focus': 'true',
255
- orientation: singleQuote('vertical'),
256
- beauty: '0',
257
- whiteness: '0',
258
- aspect: singleQuote('9:16'),
254
+ url: _empty,
255
+ mode: "'RTC'",
256
+ autopush: _false,
257
+ muted: _false,
258
+ 'enable-camera': _true,
259
+ 'auto-focus': _true,
260
+ orientation: "'vertical'",
261
+ beauty: _zero,
262
+ whiteness: _zero,
263
+ aspect: "'9:16'",
259
264
  'min-bitrate': '200',
260
265
  'max-bitrate': '1000',
261
- 'audio-quality': singleQuote('high'),
262
- 'waiting-image': '',
263
- 'waiting-image-hash': '',
264
- zoom: 'false',
265
- 'device-position': singleQuote('front'),
266
- 'background-mute': 'false',
267
- mirror: 'false',
268
- 'remote-mirror': 'false',
269
- 'local-mirror': 'false',
270
- 'audio-reverb-type': '0',
271
- 'enable-mic': 'true',
272
- 'enable-agc': 'false',
273
- 'enable-ans': 'false',
274
- 'audio-volume-type': singleQuote('voicecall'),
266
+ 'audio-quality': "'high'",
267
+ 'waiting-image': _empty,
268
+ 'waiting-image-hash': _empty,
269
+ zoom: _false,
270
+ 'device-position': "'front'",
271
+ 'background-mute': _false,
272
+ mirror: _false,
273
+ 'remote-mirror': _false,
274
+ 'local-mirror': _false,
275
+ 'audio-reverb-type': _zero,
276
+ 'enable-mic': _true,
277
+ 'enable-agc': _false,
278
+ 'enable-ans': _false,
279
+ 'audio-volume-type': "'voicecall'",
275
280
  'video-width': '360',
276
281
  'video-height': '640',
277
- 'beauty-style': singleQuote('smooth'),
278
- filter: singleQuote('standard'),
279
- animation: '',
280
- bindStateChange: '',
281
- bindNetStatus: '',
282
- bindBgmStart: '',
283
- bindBgmProgress: '',
284
- bindBgmComplete: '',
285
- bindAudioVolumeNotify: ''
282
+ 'beauty-style': "'smooth'",
283
+ filter: "'standard'",
284
+ animation: _empty,
285
+ bindStateChange: _empty,
286
+ bindNetStatus: _empty,
287
+ bindBgmStart: _empty,
288
+ bindBgmProgress: _empty,
289
+ bindBgmComplete: _empty,
290
+ bindAudioVolumeNotify: _empty
286
291
  },
287
292
  OfficialAccount: {
288
- bindLoad: '',
289
- bindError: ''
293
+ bindLoad: _empty,
294
+ bindError: _empty
290
295
  },
291
296
  OpenData: {
292
- type: '',
293
- 'open-gid': '',
294
- lang: singleQuote('en'),
295
- 'default-text': '',
296
- 'default-avatar': '',
297
- bindError: ''
297
+ type: _empty,
298
+ 'open-gid': _empty,
299
+ lang: "'en'",
300
+ 'default-text': _empty,
301
+ 'default-avatar': _empty,
302
+ bindError: _empty
298
303
  },
299
304
  NavigationBar: {
300
- title: '',
301
- loading: 'false',
302
- 'front-color': '',
303
- 'background-color': '',
304
- 'color-animation-duration': '0',
305
- 'color-animation-timing-func': singleQuote('linear')
305
+ title: _empty,
306
+ loading: _false,
307
+ 'front-color': _empty,
308
+ 'background-color': _empty,
309
+ 'color-animation-duration': _zero,
310
+ 'color-animation-timing-func': "'linear'"
306
311
  },
307
312
  PageMeta: {
308
- 'background-text-style': '',
309
- 'background-color': '',
310
- 'background-color-top': '',
311
- 'background-color-bottom': '',
312
- 'scroll-top': singleQuote(''),
313
+ 'background-text-style': _empty,
314
+ 'background-color': _empty,
315
+ 'background-color-top': _empty,
316
+ 'background-color-bottom': _empty,
317
+ 'scroll-top': "''",
313
318
  'scroll-duration': '300',
314
- 'page-style': singleQuote(''),
315
- 'root-font-size': singleQuote(''),
316
- bindResize: '',
317
- bindScroll: '',
318
- bindScrollDone: ''
319
+ 'page-style': "''",
320
+ 'root-font-size': "''",
321
+ bindResize: _empty,
322
+ bindScroll: _empty,
323
+ bindScrollDone: _empty
319
324
  },
320
325
  VoipRoom: {
321
- openid: '',
322
- mode: singleQuote('camera'),
323
- 'device-position': singleQuote('front'),
324
- bindError: ''
326
+ openid: _empty,
327
+ mode: "'camera'",
328
+ 'device-position': "'front'",
329
+ bindError: _empty
325
330
  },
326
331
  AdCustom: {
327
- 'unit-id': '',
328
- 'ad-intervals': '',
329
- bindLoad: '',
330
- bindError: ''
332
+ 'unit-id': _empty,
333
+ 'ad-intervals': _empty,
334
+ bindLoad: _empty,
335
+ bindError: _empty
331
336
  },
332
337
  PageContainer: {
333
- show: 'false',
338
+ show: _false,
334
339
  duration: '300',
335
340
  'z-index': '100',
336
- overlay: 'true',
337
- position: singleQuote('bottom'),
338
- round: 'false',
339
- 'close-on-slideDown': 'false',
340
- 'overlay-style': '',
341
- 'custom-style': '',
342
- bindBeforeEnter: '',
343
- bindEnter: '',
344
- bindAfterEnter: '',
345
- bindBeforeLeave: '',
346
- bindLeave: '',
347
- bindAfterLeave: '',
348
- bindClickOverlay: ''
341
+ overlay: _true,
342
+ position: "'bottom'",
343
+ round: _false,
344
+ 'close-on-slideDown': _false,
345
+ 'overlay-style': _empty,
346
+ 'custom-style': _empty,
347
+ bindBeforeEnter: _empty,
348
+ bindEnter: _empty,
349
+ bindAfterEnter: _empty,
350
+ bindBeforeLeave: _empty,
351
+ bindLeave: _empty,
352
+ bindAfterLeave: _empty,
353
+ bindClickOverlay: _empty
349
354
  },
350
355
  KeyboardAccessory: {}
351
356
  };