@tarojs/shared 3.3.14 → 3.5.0-canary.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.
@@ -1,10 +1,3 @@
1
- export declare const styles: {
2
- style: string;
3
- class: string;
4
- };
5
- export declare const events: {
6
- bindtap: string;
7
- };
8
1
  export declare const touchEvents: {
9
2
  bindTouchStart: string;
10
3
  bindTouchMove: string;
@@ -12,7 +5,8 @@ export declare const touchEvents: {
12
5
  bindTouchCancel: string;
13
6
  bindLongTap: string;
14
7
  };
15
- export declare const animationEvents: {
8
+ export declare const animation: {
9
+ animation: string;
16
10
  bindAnimationStart: string;
17
11
  bindAnimationIteration: string;
18
12
  bindAnimationEnd: string;
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ function isBooleanStringLiteral(o) {
29
29
  const isArray = Array.isArray;
30
30
 
31
31
  // 字符串简写
32
+ exports.Shortcuts = void 0;
32
33
  (function (Shortcuts) {
33
34
  Shortcuts["Container"] = "container";
34
35
  Shortcuts["Childnodes"] = "cn";
@@ -41,298 +42,254 @@ const isArray = Array.isArray;
41
42
  Shortcuts["Src"] = "src";
42
43
  })(exports.Shortcuts || (exports.Shortcuts = {}));
43
44
 
44
- const styles = {
45
- style: `i.${"st" /* Style */}`,
46
- class: `i.${"cl" /* Class */}`
47
- };
48
- const events = {
49
- bindtap: 'eh'
50
- };
45
+ const DEFAULT_EMPTY_ARRAY = '[]';
46
+ const NO_DEFAULT_VALUE = '';
47
+ const DEFAULT_TRUE = 'true';
48
+ const DEFAULT_FALSE = 'false';
51
49
  const touchEvents = {
52
- bindTouchStart: '',
53
- bindTouchMove: '',
54
- bindTouchEnd: '',
55
- bindTouchCancel: '',
56
- bindLongTap: ''
57
- };
58
- const animationEvents = {
59
- bindAnimationStart: '',
60
- bindAnimationIteration: '',
61
- bindAnimationEnd: '',
62
- bindTransitionEnd: ''
50
+ bindTouchStart: NO_DEFAULT_VALUE,
51
+ bindTouchMove: NO_DEFAULT_VALUE,
52
+ bindTouchEnd: NO_DEFAULT_VALUE,
53
+ bindTouchCancel: NO_DEFAULT_VALUE,
54
+ bindLongTap: NO_DEFAULT_VALUE
55
+ };
56
+ const animation = {
57
+ animation: NO_DEFAULT_VALUE,
58
+ bindAnimationStart: NO_DEFAULT_VALUE,
59
+ bindAnimationIteration: NO_DEFAULT_VALUE,
60
+ bindAnimationEnd: NO_DEFAULT_VALUE,
61
+ bindTransitionEnd: NO_DEFAULT_VALUE
63
62
  };
64
63
  function singleQuote(s) {
65
64
  return `'${s}'`;
66
65
  }
67
- const View = Object.assign(Object.assign({ 'hover-class': singleQuote('none'), 'hover-stop-propagation': 'false', 'hover-start-time': '50', 'hover-stay-time': '400', animation: '' }, touchEvents), animationEvents);
66
+ const View = Object.assign(Object.assign({ 'hover-class': singleQuote('none'), 'hover-stop-propagation': DEFAULT_FALSE, 'hover-start-time': '50', 'hover-stay-time': '400' }, touchEvents), animation);
68
67
  const Icon = {
69
- type: '',
68
+ type: NO_DEFAULT_VALUE,
70
69
  size: '23',
71
- color: ''
70
+ color: NO_DEFAULT_VALUE
72
71
  };
73
- const MapComp = Object.assign({ longitude: '', latitude: '', scale: '16', markers: '[]', covers: '', polyline: '[]', circles: '[]', controls: '[]', 'include-points': '[]', 'show-location': '', 'layer-style': '1', bindMarkerTap: '', bindControlTap: '', bindCalloutTap: '', bindUpdated: '' }, touchEvents);
72
+ const MapComp = Object.assign({ longitude: NO_DEFAULT_VALUE, latitude: NO_DEFAULT_VALUE, scale: '16', markers: DEFAULT_EMPTY_ARRAY, covers: NO_DEFAULT_VALUE, polyline: DEFAULT_EMPTY_ARRAY, circles: DEFAULT_EMPTY_ARRAY, controls: DEFAULT_EMPTY_ARRAY, 'include-points': DEFAULT_EMPTY_ARRAY, 'show-location': NO_DEFAULT_VALUE, 'layer-style': '1', bindMarkerTap: NO_DEFAULT_VALUE, bindControlTap: NO_DEFAULT_VALUE, bindCalloutTap: NO_DEFAULT_VALUE, bindUpdated: NO_DEFAULT_VALUE }, touchEvents);
74
73
  const Progress = {
75
- percent: '',
74
+ percent: NO_DEFAULT_VALUE,
76
75
  'stroke-width': '6',
77
76
  color: singleQuote('#09BB07'),
78
77
  activeColor: singleQuote('#09BB07'),
79
78
  backgroundColor: singleQuote('#EBEBEB'),
80
- active: 'false',
79
+ active: DEFAULT_FALSE,
81
80
  'active-mode': singleQuote('backwards'),
82
- 'show-info': 'false'
81
+ 'show-info': DEFAULT_FALSE
83
82
  };
84
83
  const RichText = {
85
- nodes: '[]'
84
+ nodes: DEFAULT_EMPTY_ARRAY
86
85
  };
87
86
  const Text = {
88
- selectable: 'false',
89
- space: '',
90
- decode: 'false'
87
+ selectable: DEFAULT_FALSE,
88
+ space: NO_DEFAULT_VALUE,
89
+ decode: DEFAULT_FALSE
91
90
  };
92
- const Button = Object.assign({ size: singleQuote('default'), type: '', plain: 'false', disabled: '', loading: 'false', 'form-type': '', 'open-type': '', 'hover-class': singleQuote('button-hover'), 'hover-stop-propagation': 'false', 'hover-start-time': '20', 'hover-stay-time': '70', name: '' }, touchEvents);
91
+ const Button = Object.assign({ size: singleQuote('default'), type: NO_DEFAULT_VALUE, plain: DEFAULT_FALSE, disabled: NO_DEFAULT_VALUE, loading: DEFAULT_FALSE, 'form-type': NO_DEFAULT_VALUE, 'open-type': NO_DEFAULT_VALUE, 'hover-class': singleQuote('button-hover'), 'hover-stop-propagation': DEFAULT_FALSE, 'hover-start-time': '20', 'hover-stay-time': '70', name: NO_DEFAULT_VALUE }, touchEvents);
93
92
  const Checkbox = {
94
- value: '',
95
- disabled: '',
96
- checked: 'false',
93
+ value: NO_DEFAULT_VALUE,
94
+ disabled: NO_DEFAULT_VALUE,
95
+ checked: DEFAULT_FALSE,
97
96
  color: singleQuote('#09BB07'),
98
- name: ''
97
+ name: NO_DEFAULT_VALUE
99
98
  };
100
99
  const CheckboxGroup = {
101
- bindChange: '',
102
- name: ''
100
+ bindChange: NO_DEFAULT_VALUE,
101
+ name: NO_DEFAULT_VALUE
103
102
  };
104
103
  const Form = {
105
- 'report-submit': 'false',
106
- bindSubmit: '',
107
- bindReset: '',
108
- name: ''
104
+ 'report-submit': DEFAULT_FALSE,
105
+ bindSubmit: NO_DEFAULT_VALUE,
106
+ bindReset: NO_DEFAULT_VALUE,
107
+ name: NO_DEFAULT_VALUE
109
108
  };
110
109
  const Input = {
111
- value: '',
112
- type: singleQuote(''),
113
- password: 'false',
114
- placeholder: '',
115
- 'placeholder-style': '',
110
+ value: NO_DEFAULT_VALUE,
111
+ type: singleQuote(NO_DEFAULT_VALUE),
112
+ password: DEFAULT_FALSE,
113
+ placeholder: NO_DEFAULT_VALUE,
114
+ 'placeholder-style': NO_DEFAULT_VALUE,
116
115
  'placeholder-class': singleQuote('input-placeholder'),
117
- disabled: '',
116
+ disabled: NO_DEFAULT_VALUE,
118
117
  maxlength: '140',
119
118
  'cursor-spacing': '0',
120
- focus: 'false',
119
+ focus: DEFAULT_FALSE,
121
120
  'confirm-type': singleQuote('done'),
122
- 'confirm-hold': 'false',
121
+ 'confirm-hold': DEFAULT_FALSE,
123
122
  cursor: 'i.value.length',
124
123
  'selection-start': '-1',
125
124
  'selection-end': '-1',
126
- bindInput: '',
127
- bindFocus: '',
128
- bindBlur: '',
129
- bindConfirm: '',
130
- name: ''
125
+ bindInput: NO_DEFAULT_VALUE,
126
+ bindFocus: NO_DEFAULT_VALUE,
127
+ bindBlur: NO_DEFAULT_VALUE,
128
+ bindConfirm: NO_DEFAULT_VALUE,
129
+ name: NO_DEFAULT_VALUE
131
130
  };
132
131
  const Label = {
133
- for: '',
134
- name: ''
132
+ for: NO_DEFAULT_VALUE,
133
+ name: NO_DEFAULT_VALUE
135
134
  };
136
135
  const Picker = {
137
136
  mode: singleQuote('selector'),
138
- disabled: '',
139
- range: '',
140
- 'range-key': '',
141
- value: '',
142
- start: '',
143
- end: '',
137
+ disabled: NO_DEFAULT_VALUE,
138
+ range: NO_DEFAULT_VALUE,
139
+ 'range-key': NO_DEFAULT_VALUE,
140
+ value: NO_DEFAULT_VALUE,
141
+ start: NO_DEFAULT_VALUE,
142
+ end: NO_DEFAULT_VALUE,
144
143
  fields: singleQuote('day'),
145
- 'custom-item': '',
146
- name: '',
147
- bindCancel: '',
148
- bindChange: '',
149
- bindColumnChange: ''
144
+ 'custom-item': NO_DEFAULT_VALUE,
145
+ name: NO_DEFAULT_VALUE,
146
+ bindCancel: NO_DEFAULT_VALUE,
147
+ bindChange: NO_DEFAULT_VALUE,
148
+ bindColumnChange: NO_DEFAULT_VALUE
150
149
  };
151
150
  const PickerView = {
152
- value: '',
153
- 'indicator-style': '',
154
- 'indicator-class': '',
155
- 'mask-style': '',
156
- 'mask-class': '',
157
- bindChange: '',
158
- name: ''
151
+ value: NO_DEFAULT_VALUE,
152
+ 'indicator-style': NO_DEFAULT_VALUE,
153
+ 'indicator-class': NO_DEFAULT_VALUE,
154
+ 'mask-style': NO_DEFAULT_VALUE,
155
+ 'mask-class': NO_DEFAULT_VALUE,
156
+ bindChange: NO_DEFAULT_VALUE,
157
+ name: NO_DEFAULT_VALUE
159
158
  };
160
159
  const PickerViewColumn = {
161
- name: ''
160
+ name: NO_DEFAULT_VALUE
162
161
  };
163
162
  const Radio = {
164
- value: '',
165
- checked: 'false',
166
- disabled: '',
163
+ value: NO_DEFAULT_VALUE,
164
+ checked: DEFAULT_FALSE,
165
+ disabled: NO_DEFAULT_VALUE,
167
166
  color: singleQuote('#09BB07'),
168
- name: ''
167
+ name: NO_DEFAULT_VALUE
169
168
  };
170
169
  const RadioGroup = {
171
- bindChange: '',
172
- name: ''
170
+ bindChange: NO_DEFAULT_VALUE,
171
+ name: NO_DEFAULT_VALUE
173
172
  };
174
173
  const Slider = {
175
174
  min: '0',
176
175
  max: '100',
177
176
  step: '1',
178
- disabled: '',
177
+ disabled: NO_DEFAULT_VALUE,
179
178
  value: '0',
180
179
  activeColor: singleQuote('#1aad19'),
181
180
  backgroundColor: singleQuote('#e9e9e9'),
182
181
  'block-size': '28',
183
182
  'block-color': singleQuote('#ffffff'),
184
- 'show-value': 'false',
185
- bindChange: '',
186
- bindChanging: '',
187
- name: ''
183
+ 'show-value': DEFAULT_FALSE,
184
+ bindChange: NO_DEFAULT_VALUE,
185
+ bindChanging: NO_DEFAULT_VALUE,
186
+ name: NO_DEFAULT_VALUE
188
187
  };
189
188
  const Switch = {
190
- checked: 'false',
191
- disabled: '',
189
+ checked: DEFAULT_FALSE,
190
+ disabled: NO_DEFAULT_VALUE,
192
191
  type: singleQuote('switch'),
193
192
  color: singleQuote('#04BE02'),
194
- bindChange: '',
195
- name: ''
193
+ bindChange: NO_DEFAULT_VALUE,
194
+ name: NO_DEFAULT_VALUE
196
195
  };
197
196
  const Textarea = {
198
- value: '',
199
- placeholder: '',
200
- 'placeholder-style': '',
197
+ value: NO_DEFAULT_VALUE,
198
+ placeholder: NO_DEFAULT_VALUE,
199
+ 'placeholder-style': NO_DEFAULT_VALUE,
201
200
  'placeholder-class': singleQuote('textarea-placeholder'),
202
- disabled: '',
201
+ disabled: NO_DEFAULT_VALUE,
203
202
  maxlength: '140',
204
- 'auto-focus': 'false',
205
- focus: 'false',
206
- 'auto-height': 'false',
207
- fixed: 'false',
203
+ 'auto-focus': DEFAULT_FALSE,
204
+ focus: DEFAULT_FALSE,
205
+ 'auto-height': DEFAULT_FALSE,
206
+ fixed: DEFAULT_FALSE,
208
207
  'cursor-spacing': '0',
209
208
  cursor: '-1',
210
209
  'selection-start': '-1',
211
210
  'selection-end': '-1',
212
- bindFocus: '',
213
- bindBlur: '',
214
- bindLineChange: '',
215
- bindInput: '',
216
- bindConfirm: '',
217
- name: ''
211
+ bindFocus: NO_DEFAULT_VALUE,
212
+ bindBlur: NO_DEFAULT_VALUE,
213
+ bindLineChange: NO_DEFAULT_VALUE,
214
+ bindInput: NO_DEFAULT_VALUE,
215
+ bindConfirm: NO_DEFAULT_VALUE,
216
+ name: NO_DEFAULT_VALUE
218
217
  };
219
218
  const CoverImage = {
220
- src: '',
219
+ src: NO_DEFAULT_VALUE,
221
220
  bindLoad: 'eh',
222
221
  bindError: 'eh'
223
222
  };
224
- const CoverView = Object.assign({ 'scroll-top': 'false' }, touchEvents);
223
+ const CoverView = Object.assign({ 'scroll-top': DEFAULT_FALSE }, touchEvents);
225
224
  const MovableArea = {
226
- 'scale-area': 'false'
225
+ 'scale-area': DEFAULT_FALSE
227
226
  };
228
- const MovableView = Object.assign(Object.assign({ direction: 'none', inertia: 'false', 'out-of-bounds': 'false', x: '', y: '', damping: '20', friction: '2', disabled: '', scale: 'false', 'scale-min': '0.5', 'scale-max': '10', 'scale-value': '1', animation: 'true', bindChange: '', bindScale: '', bindHTouchMove: '', bindVTouchMove: '', width: singleQuote('10px'), height: singleQuote('10px') }, touchEvents), animationEvents);
229
- const ScrollView = Object.assign(Object.assign({ 'scroll-x': 'false', 'scroll-y': 'false', 'upper-threshold': '50', 'lower-threshold': '50', 'scroll-top': '', 'scroll-left': '', 'scroll-into-view': '', 'scroll-with-animation': 'false', 'enable-back-to-top': 'false', bindScrollToUpper: '', bindScrollToLower: '', bindScroll: '' }, touchEvents), animationEvents);
230
- const Swiper = Object.assign({ 'indicator-dots': 'false', 'indicator-color': singleQuote('rgba(0, 0, 0, .3)'), 'indicator-active-color': singleQuote('#000000'), autoplay: 'false', current: '0', interval: '5000', duration: '500', circular: 'false', vertical: 'false', 'previous-margin': '\'0px\'', 'next-margin': '\'0px\'', 'display-multiple-items': '1', bindChange: '', bindTransition: '', bindAnimationFinish: '' }, touchEvents);
227
+ const MovableView = Object.assign(Object.assign({ direction: 'none', inertia: DEFAULT_FALSE, 'out-of-bounds': DEFAULT_FALSE, x: NO_DEFAULT_VALUE, y: NO_DEFAULT_VALUE, damping: '20', friction: '2', disabled: NO_DEFAULT_VALUE, scale: DEFAULT_FALSE, 'scale-min': '0.5', 'scale-max': '10', 'scale-value': '1', bindChange: NO_DEFAULT_VALUE, bindScale: NO_DEFAULT_VALUE, bindHTouchMove: NO_DEFAULT_VALUE, bindVTouchMove: NO_DEFAULT_VALUE, width: singleQuote('10px'), height: singleQuote('10px') }, touchEvents), animation);
228
+ const ScrollView = Object.assign(Object.assign({ 'scroll-x': DEFAULT_FALSE, 'scroll-y': DEFAULT_FALSE, 'upper-threshold': '50', 'lower-threshold': '50', 'scroll-top': NO_DEFAULT_VALUE, 'scroll-left': NO_DEFAULT_VALUE, 'scroll-into-view': NO_DEFAULT_VALUE, 'scroll-with-animation': DEFAULT_FALSE, 'enable-back-to-top': DEFAULT_FALSE, bindScrollToUpper: NO_DEFAULT_VALUE, bindScrollToLower: NO_DEFAULT_VALUE, bindScroll: NO_DEFAULT_VALUE }, touchEvents), animation);
229
+ const Swiper = Object.assign({ 'indicator-dots': DEFAULT_FALSE, 'indicator-color': singleQuote('rgba(0, 0, 0, .3)'), 'indicator-active-color': singleQuote('#000000'), autoplay: DEFAULT_FALSE, current: '0', interval: '5000', duration: '500', circular: DEFAULT_FALSE, vertical: DEFAULT_FALSE, 'previous-margin': singleQuote('0px'), 'next-margin': singleQuote('0px'), 'display-multiple-items': '1', bindChange: NO_DEFAULT_VALUE, bindTransition: NO_DEFAULT_VALUE, bindAnimationFinish: NO_DEFAULT_VALUE }, touchEvents);
231
230
  const SwiperItem = {
232
- 'item-id': ''
231
+ 'item-id': NO_DEFAULT_VALUE
233
232
  };
234
233
  const Navigator = {
235
- url: '',
234
+ url: NO_DEFAULT_VALUE,
236
235
  'open-type': singleQuote('navigate'),
237
236
  delta: '1',
238
237
  'hover-class': singleQuote('navigator-hover'),
239
- 'hover-stop-propagation': 'false',
238
+ 'hover-stop-propagation': DEFAULT_FALSE,
240
239
  'hover-start-time': '50',
241
240
  'hover-stay-time': '600',
242
- bindSuccess: '',
243
- bindFail: '',
244
- bindComplete: ''
241
+ bindSuccess: NO_DEFAULT_VALUE,
242
+ bindFail: NO_DEFAULT_VALUE,
243
+ bindComplete: NO_DEFAULT_VALUE
245
244
  };
246
245
  const Audio = {
247
- id: '',
248
- src: '',
249
- loop: 'false',
250
- controls: 'false',
251
- poster: '',
252
- name: '',
253
- author: '',
254
- bindError: '',
255
- bindPlay: '',
256
- bindPause: '',
257
- bindTimeUpdate: '',
258
- bindEnded: ''
246
+ id: NO_DEFAULT_VALUE,
247
+ src: NO_DEFAULT_VALUE,
248
+ loop: DEFAULT_FALSE,
249
+ controls: DEFAULT_FALSE,
250
+ poster: NO_DEFAULT_VALUE,
251
+ name: NO_DEFAULT_VALUE,
252
+ author: NO_DEFAULT_VALUE,
253
+ bindError: NO_DEFAULT_VALUE,
254
+ bindPlay: NO_DEFAULT_VALUE,
255
+ bindPause: NO_DEFAULT_VALUE,
256
+ bindTimeUpdate: NO_DEFAULT_VALUE,
257
+ bindEnded: NO_DEFAULT_VALUE
259
258
  };
260
259
  const Camera = {
261
260
  'device-position': singleQuote('back'),
262
261
  flash: singleQuote('auto'),
263
- bindStop: '',
264
- bindError: ''
265
- };
266
- const Image = Object.assign({ src: '', mode: singleQuote('scaleToFill'), 'lazy-load': 'false', bindError: '', bindLoad: '' }, touchEvents);
267
- const LivePlayer = {
268
- src: '',
269
- autoplay: 'false',
270
- muted: 'false',
271
- orientation: singleQuote('vertical'),
272
- 'object-fit': singleQuote('contain'),
273
- 'background-mute': 'false',
274
- 'min-cache': '1',
275
- 'max-cache': '3',
276
- animation: '',
277
- bindStateChange: '',
278
- bindFullScreenChange: '',
279
- bindNetStatus: ''
280
- };
281
- const Video = {
282
- src: '',
283
- duration: '',
284
- controls: 'true',
285
- 'danmu-list': '',
286
- 'danmu-btn': '',
287
- 'enable-danmu': '',
288
- autoplay: 'false',
289
- loop: 'false',
290
- muted: 'false',
291
- 'initial-time': '0',
292
- 'page-gesture': 'false',
293
- direction: '',
294
- 'show-progress': 'true',
295
- 'show-fullscreen-btn': 'true',
296
- 'show-play-btn': 'true',
297
- 'show-center-play-btn': 'true',
298
- 'enable-progress-gesture': 'true',
299
- 'object-fit': singleQuote('contain'),
300
- poster: '',
301
- 'show-mute-btn': 'false',
302
- animation: '',
303
- bindPlay: '',
304
- bindPause: '',
305
- bindEnded: '',
306
- bindTimeUpdate: '',
307
- bindFullScreenChange: '',
308
- bindWaiting: '',
309
- bindError: ''
262
+ bindStop: NO_DEFAULT_VALUE,
263
+ bindError: NO_DEFAULT_VALUE
310
264
  };
311
- const Canvas = Object.assign({ 'canvas-id': '', 'disable-scroll': 'false', bindError: '' }, touchEvents);
265
+ const Image = Object.assign({ src: NO_DEFAULT_VALUE, mode: singleQuote('scaleToFill'), 'lazy-load': DEFAULT_FALSE, bindError: NO_DEFAULT_VALUE, bindLoad: NO_DEFAULT_VALUE }, touchEvents);
266
+ const LivePlayer = Object.assign({ src: NO_DEFAULT_VALUE, autoplay: DEFAULT_FALSE, muted: DEFAULT_FALSE, orientation: singleQuote('vertical'), 'object-fit': singleQuote('contain'), 'background-mute': DEFAULT_FALSE, 'min-cache': '1', 'max-cache': '3', bindStateChange: NO_DEFAULT_VALUE, bindFullScreenChange: NO_DEFAULT_VALUE, bindNetStatus: NO_DEFAULT_VALUE }, animation);
267
+ const Video = Object.assign({ src: NO_DEFAULT_VALUE, duration: NO_DEFAULT_VALUE, controls: DEFAULT_TRUE, 'danmu-list': NO_DEFAULT_VALUE, 'danmu-btn': NO_DEFAULT_VALUE, 'enable-danmu': NO_DEFAULT_VALUE, autoplay: DEFAULT_FALSE, loop: DEFAULT_FALSE, muted: DEFAULT_FALSE, 'initial-time': '0', 'page-gesture': DEFAULT_FALSE, direction: NO_DEFAULT_VALUE, 'show-progress': DEFAULT_TRUE, 'show-fullscreen-btn': DEFAULT_TRUE, 'show-play-btn': DEFAULT_TRUE, 'show-center-play-btn': DEFAULT_TRUE, 'enable-progress-gesture': DEFAULT_TRUE, 'object-fit': singleQuote('contain'), poster: NO_DEFAULT_VALUE, 'show-mute-btn': DEFAULT_FALSE, bindPlay: NO_DEFAULT_VALUE, bindPause: NO_DEFAULT_VALUE, bindEnded: NO_DEFAULT_VALUE, bindTimeUpdate: NO_DEFAULT_VALUE, bindFullScreenChange: NO_DEFAULT_VALUE, bindWaiting: NO_DEFAULT_VALUE, bindError: NO_DEFAULT_VALUE }, animation);
268
+ const Canvas = Object.assign({ 'canvas-id': NO_DEFAULT_VALUE, 'disable-scroll': DEFAULT_FALSE, bindError: NO_DEFAULT_VALUE }, touchEvents);
312
269
  const Ad = {
313
- 'unit-id': '',
314
- 'ad-intervals': '',
315
- bindLoad: '',
316
- bindError: '',
317
- bindClose: ''
270
+ 'unit-id': NO_DEFAULT_VALUE,
271
+ 'ad-intervals': NO_DEFAULT_VALUE,
272
+ bindLoad: NO_DEFAULT_VALUE,
273
+ bindError: NO_DEFAULT_VALUE,
274
+ bindClose: NO_DEFAULT_VALUE
318
275
  };
319
276
  const WebView = {
320
- src: '',
321
- bindMessage: '',
322
- bindLoad: '',
323
- bindError: ''
277
+ src: NO_DEFAULT_VALUE,
278
+ bindMessage: NO_DEFAULT_VALUE,
279
+ bindLoad: NO_DEFAULT_VALUE,
280
+ bindError: NO_DEFAULT_VALUE
324
281
  };
325
282
  const Block = {};
326
283
  // For Vue,因为 slot 标签被 vue 占用了
327
284
  const SlotView = {
328
- name: ''
285
+ name: NO_DEFAULT_VALUE
329
286
  };
330
287
  // For React
331
288
  // Slot 和 SlotView 最终都会编译成 <view slot={{ i.name }} />
332
289
  // 因为 <slot name="{{ i.name }}" /> 适用性没有前者高(无法添加类和样式)
333
290
  // 不给 View 直接加 slot 属性的原因是性能损耗
334
291
  const Slot = {
335
- name: ''
292
+ name: NO_DEFAULT_VALUE
336
293
  };
337
294
  const internalComponents = {
338
295
  View,
@@ -466,7 +423,6 @@ function capitalize(s) {
466
423
  }
467
424
  const hasOwnProperty = Object.prototype.hasOwnProperty;
468
425
  const hasOwn = (val, key) => hasOwnProperty.call(val, key);
469
- const reportIssue = '如有疑问,请提交 issue 至:https://github.com/nervjs/taro/issues';
470
426
  /**
471
427
  * ensure takes a condition and throw a error if the condition fails,
472
428
  * like failure::ensure: https://docs.rs/failure/0.1.1/failure/macro.ensure.html
@@ -475,7 +431,13 @@ const reportIssue = '如有疑问,请提交 issue 至:https://github.com/ner
475
431
  */
476
432
  function ensure(condition, msg) {
477
433
  if (!condition) {
478
- throw new Error(msg + '\n' + reportIssue);
434
+ if (process.env.NODE_ENV !== 'production') {
435
+ const reportIssue = '\n如有疑问,请提交 issue 至:https://github.com/nervjs/taro/issues';
436
+ throw new Error(msg + reportIssue);
437
+ }
438
+ else {
439
+ throw new Error(msg);
440
+ }
479
441
  }
480
442
  }
481
443
  function warn(condition, msg) {
@@ -547,17 +509,11 @@ function mergeReconciler(hostConfig) {
547
509
  Object.keys(hostConfig).forEach(key => {
548
510
  const value = hostConfig[key];
549
511
  const raw = defaultReconciler[key];
550
- if (!raw) {
551
- defaultReconciler[key] = value;
552
- }
553
- else {
554
- if (isArray(raw)) {
555
- defaultReconciler[key] = raw.push(value);
556
- }
557
- else {
558
- defaultReconciler[key] = [raw, value];
559
- }
560
- }
512
+ defaultReconciler[key] = !raw
513
+ ? value
514
+ : (isArray(raw)
515
+ ? raw.concat(value)
516
+ : [raw, value]);
561
517
  });
562
518
  }
563
519
  function unsupport(api) {
@@ -712,11 +668,15 @@ const needPromiseApis = new Set([
712
668
  ]);
713
669
  function getCanIUseWebp(taro) {
714
670
  return function () {
715
- if (typeof taro.getSystemInfoSync !== 'function') {
716
- console.error('不支持 API canIUseWebp');
671
+ var _a;
672
+ const res = (_a = taro.getSystemInfoSync) === null || _a === void 0 ? void 0 : _a.call(taro);
673
+ if (!res) {
674
+ if (process.env.NODE_ENV !== 'production') {
675
+ console.error('不支持 API canIUseWebp');
676
+ }
717
677
  return false;
718
678
  }
719
- const { platform } = taro.getSystemInfoSync();
679
+ const { platform } = res;
720
680
  const platformLower = platform.toLowerCase();
721
681
  if (platformLower === 'android' || platformLower === 'devtools') {
722
682
  return true;
@@ -726,12 +686,11 @@ function getCanIUseWebp(taro) {
726
686
  }
727
687
  function getNormalRequest(global) {
728
688
  return function request(options) {
729
- options = options || {};
730
- if (typeof options === 'string') {
731
- options = {
732
- url: options
733
- };
734
- }
689
+ options = options
690
+ ? (isString(options)
691
+ ? { url: options }
692
+ : options)
693
+ : {};
735
694
  const originSuccess = options.success;
736
695
  const originFail = options.fail;
737
696
  const originComplete = options.complete;
@@ -777,7 +736,7 @@ function processApis(taro, global, config = {}) {
777
736
  ];
778
737
  const apis = new Set(!config.isOnlyPromisify
779
738
  ? Object.keys(global).filter(api => preserved.indexOf(api) === -1)
780
- : new Set(patchNeedPromiseApis));
739
+ : patchNeedPromiseApis);
781
740
  if (config.modifyApis) {
782
741
  config.modifyApis(apis);
783
742
  }
@@ -862,7 +821,7 @@ function processApis(taro, global, config = {}) {
862
821
  taro[key] = unsupport(key);
863
822
  return;
864
823
  }
865
- if (typeof global[key] === 'function') {
824
+ if (isFunction(global[key])) {
866
825
  taro[key] = (...args) => {
867
826
  if (config.handleSyncApis) {
868
827
  return config.handleSyncApis(key, global, args);
@@ -896,7 +855,7 @@ function equipCommonApis(taro, global, apis = {}) {
896
855
  taro.requirePlugin = unsupport('requirePlugin');
897
856
  }
898
857
  // request & interceptors
899
- const request = apis.request ? apis.request : getNormalRequest(global);
858
+ const request = apis.request || getNormalRequest(global);
900
859
  function taroInterceptor(chain) {
901
860
  return request(chain.requestParams);
902
861
  }
@@ -909,7 +868,7 @@ function equipCommonApis(taro, global, apis = {}) {
909
868
 
910
869
  exports.EMPTY_ARR = EMPTY_ARR;
911
870
  exports.EMPTY_OBJ = EMPTY_OBJ;
912
- exports.animationEvents = animationEvents;
871
+ exports.animation = animation;
913
872
  exports.box = box;
914
873
  exports.cacheDataGet = cacheDataGet;
915
874
  exports.cacheDataHas = cacheDataHas;
@@ -918,7 +877,6 @@ exports.capitalize = capitalize;
918
877
  exports.controlledComponent = controlledComponent;
919
878
  exports.defaultReconciler = defaultReconciler;
920
879
  exports.ensure = ensure;
921
- exports.events = events;
922
880
  exports.focusComponents = focusComponents;
923
881
  exports.getUniqueKey = getUniqueKey;
924
882
  exports.hasOwn = hasOwn;
@@ -941,7 +899,6 @@ exports.processApis = processApis;
941
899
  exports.queryToJson = queryToJson;
942
900
  exports.setUniqueKeyToRoute = setUniqueKeyToRoute;
943
901
  exports.singleQuote = singleQuote;
944
- exports.styles = styles;
945
902
  exports.toCamelCase = toCamelCase;
946
903
  exports.toDashed = toDashed;
947
904
  exports.toKebabCase = toKebabCase;