@tarojs/plugin-platform-weapp 3.3.20 → 3.4.0-beta.3

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