@tarojs/shared 4.0.0-canary.8 → 4.0.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/template.js CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const DEFAULT_EMPTY_ARRAY = '[]';
6
4
  const NO_DEFAULT_VALUE = '';
7
5
  const DEFAULT_TRUE = '!0';
@@ -43,11 +41,7 @@ const Progress = {
43
41
  const RichText = {
44
42
  nodes: DEFAULT_EMPTY_ARRAY
45
43
  };
46
- const Text = {
47
- selectable: DEFAULT_FALSE,
48
- space: NO_DEFAULT_VALUE,
49
- decode: DEFAULT_FALSE
50
- };
44
+ const Text = Object.assign({ selectable: DEFAULT_FALSE, space: NO_DEFAULT_VALUE, decode: DEFAULT_FALSE }, touchEvents);
51
45
  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, bindagreeprivacyauthorization: NO_DEFAULT_VALUE }, touchEvents);
52
46
  const Checkbox = {
53
47
  value: NO_DEFAULT_VALUE,
@@ -88,10 +82,7 @@ const Input = {
88
82
  bindConfirm: NO_DEFAULT_VALUE,
89
83
  name: NO_DEFAULT_VALUE
90
84
  };
91
- const Label = {
92
- for: NO_DEFAULT_VALUE,
93
- name: NO_DEFAULT_VALUE
94
- };
85
+ const Label = Object.assign({ for: NO_DEFAULT_VALUE, name: NO_DEFAULT_VALUE }, touchEvents);
95
86
  const Picker = {
96
87
  mode: singleQuote('selector'),
97
88
  disabled: NO_DEFAULT_VALUE,
@@ -254,6 +245,7 @@ const Slot = {
254
245
  const NativeSlot = {
255
246
  name: NO_DEFAULT_VALUE
256
247
  };
248
+ const Script = {};
257
249
  const internalComponents = {
258
250
  View,
259
251
  Icon,
@@ -295,6 +287,7 @@ const internalComponents = {
295
287
  Slot,
296
288
  SlotView,
297
289
  NativeSlot,
290
+ Script,
298
291
  };
299
292
  const focusComponents = new Set([
300
293
  'input',
@@ -329,7 +322,7 @@ const nestElements = new Map([
329
322
  ['form', 4],
330
323
  ['scroll-view', 4],
331
324
  ['swiper', 4],
332
- ['swiper-item', 4]
325
+ ['swiper-item', 4],
333
326
  ]);
334
327
 
335
328
  function isString(o) {
@@ -345,6 +338,20 @@ function isBooleanStringLiteral(o) {
345
338
  return o === 'true' || o === 'false';
346
339
  }
347
340
 
341
+ // 字符串简写
342
+ exports.Shortcuts = void 0;
343
+ (function (Shortcuts) {
344
+ Shortcuts["Container"] = "container";
345
+ Shortcuts["Childnodes"] = "cn";
346
+ Shortcuts["Text"] = "v";
347
+ Shortcuts["NodeType"] = "nt";
348
+ Shortcuts["NodeName"] = "nn";
349
+ // Attrtibutes
350
+ Shortcuts["Style"] = "st";
351
+ Shortcuts["Class"] = "cl";
352
+ Shortcuts["Src"] = "src";
353
+ })(exports.Shortcuts || (exports.Shortcuts = {}));
354
+
348
355
  var PLATFORM_TYPE;
349
356
  (function (PLATFORM_TYPE) {
350
357
  PLATFORM_TYPE["MINI"] = "mini";
@@ -368,7 +375,7 @@ var PLATFORM_TYPE;
368
375
  },
369
376
  quickapp: {
370
377
  type: PLATFORM_TYPE.QUICK
371
- }
378
+ },
372
379
  });
373
380
 
374
381
  class Events {
@@ -489,7 +496,7 @@ const defaultMiniLifecycle = {
489
496
  'onReachBottom',
490
497
  'onPageScroll',
491
498
  'onResize',
492
- 'defer:onTabItemTap',
499
+ 'defer:onTabItemTap', // defer: 需要等页面组件挂载后再调用
493
500
  'onTitleClick',
494
501
  'onOptionMenuClick',
495
502
  'onPopMenuClick',
@@ -756,6 +763,7 @@ class BaseTemplate {
756
763
  this.exportExpr = 'module.exports =';
757
764
  this.thirdPartyPatcher = {};
758
765
  this.supportXS = false;
766
+ this.isXMLSupportRecursiveReference = true;
759
767
  this.Adapter = weixinAdapter;
760
768
  /** 组件列表 */
761
769
  this.internalComponents = internalComponents;
@@ -1157,7 +1165,7 @@ ${this.buildXsTemplate()}
1157
1165
  getAttrValue(value, _key, _nodeName) {
1158
1166
  return `{${value}}`;
1159
1167
  }
1160
- buildXsTemplate() {
1168
+ buildXsTemplate(_filePath) {
1161
1169
  return '';
1162
1170
  }
1163
1171
  mergeComponents(ctx, patch) {