@tarojs/shared 3.7.0-canary.6 → 3.8.0-canary.1

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.
@@ -58,6 +58,7 @@ declare class BaseTemplate {
58
58
  protected modifyTemplateResult?: (res: string, nodeName: string, level: number, children: string) => string;
59
59
  protected modifyThirdPartyLoopBody?: (child: string, nodeName: string) => string;
60
60
  supportXS: boolean;
61
+ isXMLSupportRecursiveReference: boolean;
61
62
  Adapter: IAdapter;
62
63
  /** 组件列表 */
63
64
  internalComponents: Record<string, Record<string, string>>;
@@ -72,7 +73,7 @@ declare class BaseTemplate {
72
73
  get baseLevel(): number;
73
74
  private buildAttribute;
74
75
  protected replacePropName(name: string, value: string, _componentName?: string, _componentAlias?: any): string;
75
- protected createMiniComponents(components: Components): Components;
76
+ createMiniComponents(components: Components): Components;
76
77
  protected buildBaseTemplate(): string;
77
78
  protected buildThirdPartyAttr(attrs: Set<string>, patcher?: Record<string, string>): string;
78
79
  protected buildComponentTemplate(comp: Component, level: number): string;
@@ -87,8 +88,8 @@ declare class BaseTemplate {
87
88
  protected dataKeymap(keymap: string): string;
88
89
  protected getEvents(): any;
89
90
  protected getAttrValue(value: string, _key: string, _nodeName: string): string;
90
- protected buildXsTemplate(): string;
91
- buildPageTemplate: (baseTempPath: string, _page?: {
91
+ buildXsTemplate(_filePath?: string): string;
92
+ buildPageTemplate: (baseTempPath: string, _page: {
92
93
  content: Record<string, any>;
93
94
  path: string;
94
95
  }) => string;
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,7 +287,18 @@ const internalComponents = {
295
287
  Slot,
296
288
  SlotView,
297
289
  NativeSlot,
290
+ Script,
298
291
  };
292
+ new Set([
293
+ 'input',
294
+ 'checkbox',
295
+ 'picker',
296
+ 'picker-view',
297
+ 'radio',
298
+ 'slider',
299
+ 'switch',
300
+ 'textarea'
301
+ ]);
299
302
  const focusComponents = new Set([
300
303
  'input',
301
304
  'textarea'
@@ -329,7 +332,7 @@ const nestElements = new Map([
329
332
  ['form', 4],
330
333
  ['scroll-view', 4],
331
334
  ['swiper', 4],
332
- ['swiper-item', 4]
335
+ ['swiper-item', 4],
333
336
  ]);
334
337
 
335
338
  function isString(o) {
@@ -345,6 +348,20 @@ function isBooleanStringLiteral(o) {
345
348
  return o === 'true' || o === 'false';
346
349
  }
347
350
 
351
+ // 字符串简写
352
+ exports.Shortcuts = void 0;
353
+ (function (Shortcuts) {
354
+ Shortcuts["Container"] = "container";
355
+ Shortcuts["Childnodes"] = "cn";
356
+ Shortcuts["Text"] = "v";
357
+ Shortcuts["NodeType"] = "nt";
358
+ Shortcuts["NodeName"] = "nn";
359
+ // Attrtibutes
360
+ Shortcuts["Style"] = "st";
361
+ Shortcuts["Class"] = "cl";
362
+ Shortcuts["Src"] = "src";
363
+ })(exports.Shortcuts || (exports.Shortcuts = {}));
364
+
348
365
  var PLATFORM_TYPE;
349
366
  (function (PLATFORM_TYPE) {
350
367
  PLATFORM_TYPE["MINI"] = "mini";
@@ -368,7 +385,7 @@ var PLATFORM_TYPE;
368
385
  },
369
386
  quickapp: {
370
387
  type: PLATFORM_TYPE.QUICK
371
- }
388
+ },
372
389
  });
373
390
 
374
391
  class Events {
@@ -631,6 +648,7 @@ new TaroHooks({
631
648
  node.dispatchEvent(e);
632
649
  }),
633
650
  dispatchTaroEventFinish: TaroHook(HOOK_TYPE.MULTI),
651
+ modifyTaroEventReturn: TaroHook(HOOK_TYPE.SINGLE, () => undefined),
634
652
  modifyDispatchEvent: TaroHook(HOOK_TYPE.MULTI),
635
653
  initNativeApi: TaroHook(HOOK_TYPE.MULTI),
636
654
  patchElement: TaroHook(HOOK_TYPE.MULTI),
@@ -754,6 +772,7 @@ class BaseTemplate {
754
772
  this.exportExpr = 'module.exports =';
755
773
  this.thirdPartyPatcher = {};
756
774
  this.supportXS = false;
775
+ this.isXMLSupportRecursiveReference = true;
757
776
  this.Adapter = weixinAdapter;
758
777
  /** 组件列表 */
759
778
  this.internalComponents = internalComponents;
@@ -1155,7 +1174,7 @@ ${this.buildXsTemplate()}
1155
1174
  getAttrValue(value, _key, _nodeName) {
1156
1175
  return `{${value}}`;
1157
1176
  }
1158
- buildXsTemplate() {
1177
+ buildXsTemplate(_filePath) {
1159
1178
  return '';
1160
1179
  }
1161
1180
  mergeComponents(ctx, patch) {