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