@cloudbase/cals 0.3.29 → 0.3.30-alpha.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,7 +1,7 @@
1
- export { getUsedComps } from './utils/common';
2
1
  import { IAttributes, IPlatformApp, IComplexComponent, IBasicComponent, IPageComponent, IDataSourceVariable, IDataVarMethod, // 勿删,为了生成d.ts
3
2
  IPlatformDataSource, IDependencies, LCDS } from '../../types';
4
3
  import { IDynamicValue, PropBindType } from '../expression';
4
+ export { getUsedComps } from './utils/common';
5
5
  interface IDeserializeContext {
6
6
  app?: IPlatformApp;
7
7
  dependencies?: any[];
@@ -166,6 +166,7 @@ export declare function deserializePage(ctx: {
166
166
  };
167
167
  isCapturePhase: boolean;
168
168
  noPropagation: boolean;
169
+ extra: object;
169
170
  }[];
170
171
  };
171
172
  /**
@@ -236,6 +237,7 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
236
237
  };
237
238
  isCapturePhase: boolean;
238
239
  noPropagation: boolean;
240
+ extra: object;
239
241
  }[];
240
242
  }[];
241
243
  lowCodes: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../parser/cals/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EAGd,mBAAmB,EACnB,cAAc,EAAE,cAAc;AAC9B,mBAAmB,EACnB,aAAa,EACb,IAAI,EACL,MAAM,aAAa,CAAA;AAEpB,OAAO,EAGL,aAAa,EACb,YAAY,EACb,MAAM,eAAe,CAAA;AAuBtB,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,YAAY,CAAA;IAClB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAA;IACpB,eAAe,CAAC,EAAE,GAAG,CAAA;IACrB,IAAI,CAAC,EAAE,cAAc,C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E,CAAC;IACzC,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAAA;KAAE,CAAC;IAC/C,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;KAAE,CAAC;CAC1C;;;;;;;mBAIY,MAAM;mBACN,MAAM;sBACH,MAAM;;;6BACwB,OAAO;;;wBACnC,MAAM;;;EA8BvB"}
@@ -14,16 +14,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.deserializeComponentLibraryMeta = exports.deserializeRuntimeComponent = exports.serializeRuntimeComponent = exports.serializeRuntimePage = exports.deserializePlatformApp = exports.serializePlatformApp = exports.deserializePage = exports.serializePage = exports.deserializeComponent = exports.serializeComponent = exports.deserializeDataVariables = exports.deserializeAttributes = exports.serializeAttributes = exports.deserializeDynamicMap = exports.serializeDynamicMap = exports.deserializeValue = exports.serializeValue = exports.getUsedComps = void 0;
15
15
  const lodash_1 = require("lodash");
16
16
  const common_1 = require("../../types/platform/common");
17
- var common_2 = require("./utils/common");
18
- Object.defineProperty(exports, "getUsedComps", { enumerable: true, get: function () { return common_2.getUsedComps; } });
19
17
  const expression_1 = require("../expression");
20
- const common_3 = require("./utils/common");
18
+ const common_2 = require("./utils/common");
21
19
  const style_1 = require("./utils/style");
22
20
  const runtime_1 = require("./utils/runtime");
23
21
  const config_1 = require("./utils/version/config");
22
+ var common_3 = require("./utils/common");
23
+ Object.defineProperty(exports, "getUsedComps", { enumerable: true, get: function () { return common_3.getUsedComps; } });
24
24
  function serializeValue({ ctx, key, dynamicValue, scope = 'page', streamlineDefaultValue, }) {
25
25
  var _a, _b;
26
- let value = dynamicValue.value;
26
+ let { value } = dynamicValue;
27
27
  let { dependenciesMap = {} } = ctx;
28
28
  if (dynamicValue.type && dynamicValue.type !== 'static') {
29
29
  key = `:${key}`;
@@ -80,8 +80,7 @@ function serializeValue({ ctx, key, dynamicValue, scope = 'page', streamlineDefa
80
80
  let { module = '', component = '' } = ctx.component || {};
81
81
  let sourceKey = `${module}:${component}`;
82
82
  let config = (_b = (_a = dependenciesMap === null || dependenciesMap === void 0 ? void 0 : dependenciesMap[sourceKey]) === null || _a === void 0 ? void 0 : _a.dataForm) === null || _b === void 0 ? void 0 : _b[key];
83
- if ((config === null || config === void 0 ? void 0 : config.default) === value ||
84
- (config && config.default === undefined && value === '')) {
83
+ if ((config === null || config === void 0 ? void 0 : config.default) === value || (config && config.default === undefined && value === '')) {
85
84
  value = undefined;
86
85
  }
87
86
  }
@@ -110,9 +109,7 @@ function deserializeValue(ctx, key, value, extra) {
110
109
  else {
111
110
  type = expression_1.PropBindType.expression;
112
111
  try {
113
- value = value
114
- .replace(/\$app\./g, 'app.')
115
- .replace(/\$for./g, 'forItems.');
112
+ value = value.replace(/\$app\./g, 'app.').replace(/\$for./g, 'forItems.');
116
113
  }
117
114
  catch (e) { }
118
115
  }
@@ -128,7 +125,7 @@ function deserializeValue(ctx, key, value, extra) {
128
125
  value: value === undefined
129
126
  ? undefined
130
127
  : {
131
- type: undefined /*'static'*/,
128
+ type: undefined /* 'static'*/,
132
129
  value,
133
130
  extra,
134
131
  },
@@ -172,8 +169,7 @@ function serializeDynamicMapWithExtra({ ctx, map = {}, scope = 'page', streamlin
172
169
  }
173
170
  if ((0, lodash_1.get)(data, processedKey) == undefined) {
174
171
  /* 选区结构处理 [formily] to [CALS] */
175
- if (Array.isArray(processedValue) &&
176
- (processedValue === null || processedValue === void 0 ? void 0 : processedValue.some((item) => item && item.selectableBlock))) {
172
+ if (Array.isArray(processedValue) && (processedValue === null || processedValue === void 0 ? void 0 : processedValue.some((item) => !!(item === null || item === void 0 ? void 0 : item.selectableBlock)))) {
177
173
  let valueTmp = (0, lodash_1.cloneDeep)(processedValue);
178
174
  processedValue = valueTmp === null || valueTmp === void 0 ? void 0 : valueTmp.map((_value) => {
179
175
  var _a, _b, _c;
@@ -196,17 +192,16 @@ function serializeDynamicMapWithExtra({ ctx, map = {}, scope = 'page', streamlin
196
192
  return { data, extra };
197
193
  }
198
194
  function deserializeDynamicMap(ctx, map, extraMap) {
199
- var _a, _b;
195
+ var _a, _b, _c;
200
196
  let data = {};
201
197
  for (let key in map || {}) {
202
- let value = map === null || map === void 0 ? void 0 : map[key];
198
+ let value = (_a = map) === null || _a === void 0 ? void 0 : _a[key];
203
199
  let matched = key.match(DYNAMIC_KEY_REG);
204
200
  let { key: processedKey, value: processedValue } = deserializeValue(ctx, key, value, extraMap === null || extraMap === void 0 ? void 0 : extraMap[matched ? matched[1] : key]);
205
201
  /* 选区结构处理 [CALS] to [formily] */
206
- if (Array.isArray(processedValue === null || processedValue === void 0 ? void 0 : processedValue.value) &&
207
- ((_a = processedValue === null || processedValue === void 0 ? void 0 : processedValue.value) === null || _a === void 0 ? void 0 : _a.some((item) => item && item.selectableBlock))) {
202
+ if (Array.isArray(processedValue === null || processedValue === void 0 ? void 0 : processedValue.value) && ((_b = processedValue === null || processedValue === void 0 ? void 0 : processedValue.value) === null || _b === void 0 ? void 0 : _b.some((item) => !!(item === null || item === void 0 ? void 0 : item.selectableBlock)))) {
208
203
  let valueTmp = (0, lodash_1.cloneDeep)(processedValue);
209
- (_b = valueTmp === null || valueTmp === void 0 ? void 0 : valueTmp.value) === null || _b === void 0 ? void 0 : _b.forEach((_value) => {
204
+ (_c = valueTmp === null || valueTmp === void 0 ? void 0 : valueTmp.value) === null || _c === void 0 ? void 0 : _c.forEach((_value) => {
210
205
  var _a, _b, _c, _d;
211
206
  const module = (_b = (_a = _value === null || _value === void 0 ? void 0 : _value.selectableBlock) === null || _a === void 0 ? void 0 : _a.module) === null || _b === void 0 ? void 0 : _b.toLowerCase();
212
207
  const component = (_d = (_c = _value === null || _value === void 0 ? void 0 : _value.selectableBlock) === null || _c === void 0 ? void 0 : _c.component) === null || _d === void 0 ? void 0 : _d.toLowerCase();
@@ -316,8 +311,7 @@ function isDatasetNeedToProcess(dataset) {
316
311
  return false;
317
312
  const hasNoParams = Object.values(dataset.state).every((item) => {
318
313
  var _a, _b;
319
- return (item.varType !== 'datasource' ||
320
- !(((_a = item.initMethod) === null || _a === void 0 ? void 0 : _a.params) || ((_b = item.updateMethod) === null || _b === void 0 ? void 0 : _b.params)));
314
+ return item.varType !== 'datasource' || !(((_a = item.initMethod) === null || _a === void 0 ? void 0 : _a.params) || ((_b = item.updateMethod) === null || _b === void 0 ? void 0 : _b.params));
321
315
  });
322
316
  if (hasNoParams)
323
317
  return false;
@@ -352,12 +346,8 @@ function serializeDirecties(ctx, directives, scope = 'page') {
352
346
  return undefined;
353
347
  }
354
348
  function deserializeDirecties(ctx, directives) {
355
- let waIf = (directives === null || directives === void 0 ? void 0 : directives[':if']) != undefined
356
- ? deserializeValue(ctx, ':if', directives[':if']).value
357
- : { value: true };
358
- let waFor = (directives === null || directives === void 0 ? void 0 : directives[':for'])
359
- ? deserializeValue(ctx, ':for', directives[':for']).value
360
- : undefined;
349
+ let waIf = (directives === null || directives === void 0 ? void 0 : directives[':if']) != undefined ? deserializeValue(ctx, ':if', directives[':if']).value : { value: true };
350
+ let waFor = (directives === null || directives === void 0 ? void 0 : directives[':for']) ? deserializeValue(ctx, ':for', directives[':for']).value : undefined;
361
351
  if (waFor) {
362
352
  let { type, value } = waFor;
363
353
  if (type === expression_1.PropBindType.expression) {
@@ -366,7 +356,7 @@ function deserializeDirecties(ctx, directives) {
366
356
  }
367
357
  let processed = {
368
358
  waIf: (waIf === null || waIf === void 0 ? void 0 : waIf.value) === true ? undefined : waIf,
369
- waFor: waFor,
359
+ waFor,
370
360
  };
371
361
  for (let key in processed) {
372
362
  let map = processed;
@@ -388,19 +378,18 @@ function serializeListener(ctx, listener) {
388
378
  type: listener.type,
389
379
  handler: {
390
380
  name: listener.handler.name,
391
- module: /^comp\-\w+$/.test(listener.handler.moduleName)
392
- ? '$comp'
393
- : listener.handler.moduleName,
381
+ module: /^comp-\w+$/.test(listener.handler.moduleName) ? '$comp' : listener.handler.moduleName,
394
382
  params: (_a = serializeDynamicMapWithExtra({
395
383
  ctx,
396
384
  map: listener.data,
397
385
  })) === null || _a === void 0 ? void 0 : _a.data,
386
+ extra: listener === null || listener === void 0 ? void 0 : listener.extra,
398
387
  },
399
388
  isCapturePhase: listener.isCapturePhase,
400
389
  };
401
390
  }
402
391
  function deserializeListener(ctx, listener) {
403
- var _a, _b, _c;
392
+ var _a, _b, _c, _d;
404
393
  let processed = {
405
394
  key: listener.id,
406
395
  trigger: listener.eventName,
@@ -413,6 +402,7 @@ function deserializeListener(ctx, listener) {
413
402
  isCapturePhase: !!listener.isCapturePhase,
414
403
  // TODO
415
404
  noPropagation: !!listener.noPropagation,
405
+ extra: (_d = listener.handler) === null || _d === void 0 ? void 0 : _d.extra,
416
406
  };
417
407
  return processed;
418
408
  }
@@ -518,7 +508,7 @@ function serializeComponent(ctx, component, scope = 'page') {
518
508
  scope,
519
509
  });
520
510
  if (classListBindData.extra) {
521
- attributeExtraData['class'] = classListBindData.extra;
511
+ attributeExtraData.class = classListBindData.extra;
522
512
  }
523
513
  }
524
514
  if ((_g = component === null || component === void 0 ? void 0 : component.xProps) === null || _g === void 0 ? void 0 : _g.styleBind) {
@@ -528,7 +518,7 @@ function serializeComponent(ctx, component, scope = 'page') {
528
518
  dynamicValue: (_h = component === null || component === void 0 ? void 0 : component.xProps) === null || _h === void 0 ? void 0 : _h.styleBind,
529
519
  });
530
520
  if (styleBindData.extra) {
531
- attributeExtraData['style'] = styleBindData.extra;
521
+ attributeExtraData.style = styleBindData.extra;
532
522
  }
533
523
  }
534
524
  return {
@@ -557,9 +547,7 @@ function serializeComponent(ctx, component, scope = 'page') {
557
547
  xIndex: component.xIndex,
558
548
  styleBindPath: (_r = component === null || component === void 0 ? void 0 : component.xProps) === null || _r === void 0 ? void 0 : _r.styleBindPath,
559
549
  staticResourceAttribute: (_s = component === null || component === void 0 ? void 0 : component.xProps) === null || _s === void 0 ? void 0 : _s.staticResourceAttribute,
560
- attributeExtraData: (0, common_3.isEmptyObj)(attributeExtraData)
561
- ? undefined
562
- : attributeExtraData,
550
+ attributeExtraData: (0, common_2.isEmptyObj)(attributeExtraData) ? undefined : attributeExtraData,
563
551
  },
564
552
  };
565
553
  }
@@ -569,12 +557,10 @@ function deserializeComponent(ctx, components) {
569
557
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
570
558
  const { attributeExtraData = {} } = item.extra || {};
571
559
  let dynamicStyle = item[':style']
572
- ? deserializeValue(ctx, ':style', item[':style'], attributeExtraData['style'] // 此处就是 style,取的是原始的属性
573
- ).value
560
+ ? deserializeValue(ctx, ':style', item[':style'], attributeExtraData.style).value
574
561
  : undefined;
575
562
  let dynamicClassList = item[':class']
576
- ? deserializeValue(ctx, ':class', item[':class'], attributeExtraData['class'] // 此处就是 class,取的是原始的属性
577
- ).value
563
+ ? deserializeValue(ctx, ':class', item[':class'], attributeExtraData.class).value
578
564
  : undefined;
579
565
  const xComponent = {
580
566
  moduleName: item.module,
@@ -582,8 +568,7 @@ function deserializeComponent(ctx, components) {
582
568
  };
583
569
  if (xComponent.name) {
584
570
  xComponent.moduleName =
585
- deserializeModuleName(ctx, xComponent.name, xComponent.moduleName) ||
586
- xComponent.moduleName;
571
+ deserializeModuleName(ctx, xComponent.name, xComponent.moduleName) || xComponent.moduleName;
587
572
  }
588
573
  const xProps = {
589
574
  data: deserializeAttributes(ctx, item.attributes, attributeExtraData),
@@ -609,26 +594,20 @@ function deserializeComponent(ctx, components) {
609
594
  })) || [],
610
595
  };
611
596
  let processed = {
612
- xComponent: Object.values(xComponent).find((item) => item != undefined)
613
- ? xComponent
614
- : undefined,
597
+ xComponent: Object.values(xComponent).find((item) => item != undefined) ? xComponent : undefined,
615
598
  xProps: Object.values(xProps).find((item) => {
616
599
  if (Array.isArray(item)) {
617
600
  return !!item.length;
618
601
  }
619
- return item != undefined && !(0, common_3.isEmptyObj)(item);
602
+ return item != undefined && !(0, common_2.isEmptyObj)(item);
620
603
  })
621
604
  ? xProps
622
605
  : undefined,
623
606
  /**
624
607
  * TODO
625
608
  */
626
- xIndex: ((_h = item.extra) === null || _h === void 0 ? void 0 : _h.xIndex) !== undefined
627
- ? (_j = item.extra) === null || _j === void 0 ? void 0 : _j.xIndex
628
- : undefined /*0*/,
629
- properties: item.items
630
- ? deserializeComponent(ctx, item.items)
631
- : undefined,
609
+ xIndex: ((_h = item.extra) === null || _h === void 0 ? void 0 : _h.xIndex) !== undefined ? (_j = item.extra) === null || _j === void 0 ? void 0 : _j.xIndex : undefined /* 0*/,
610
+ properties: item.items ? deserializeComponent(ctx, item.items) : undefined,
632
611
  };
633
612
  map[item.id] = processed;
634
613
  return map;
@@ -685,7 +664,7 @@ function serializePage(ctx, page) {
685
664
  exports.serializePage = serializePage;
686
665
  function deserializePage(ctx, page) {
687
666
  var _a, _b, _c, _d, _e, _f, _g;
688
- let pageCtx = Object.assign(Object.assign({}, ctx), { page: page });
667
+ let pageCtx = Object.assign(Object.assign({}, ctx), { page });
689
668
  return {
690
669
  id: page.id,
691
670
  isHome: page.id === ctx.homePageId,
@@ -730,7 +709,7 @@ function serializePlatformApp(data, optsions) {
730
709
  label: label || extraLabel,
731
710
  name: name || extraName,
732
711
  author: author || extraAuthor,
733
- version: version,
712
+ version,
734
713
  description: description || extraDescription,
735
714
  main: homePage ? homePage.id : ((_a = pageInstanceList === null || pageInstanceList === void 0 ? void 0 : pageInstanceList[0]) === null || _a === void 0 ? void 0 : _a.id) || selectedPageId,
736
715
  items: pageInstanceList === null || pageInstanceList === void 0 ? void 0 : pageInstanceList.map((page) => serializePage(ctx, page)),
@@ -784,11 +763,11 @@ function deserializePlatformApp(data, optsions) {
784
763
  compHiddenConfig: compHiddenConfig || {},
785
764
  npmDependencies: npmDependencies || {},
786
765
  plugins: plugins || [],
787
- maxID: maxID,
788
- rootPath: rootPath,
789
- themeVars: themeVars,
766
+ maxID,
767
+ rootPath,
768
+ themeVars,
790
769
  presetColors: presetColors || [],
791
- appConfig: appConfig,
770
+ appConfig,
792
771
  miniprogramPlugins,
793
772
  extra: Object.assign(Object.assign({}, restExtra), { name: data.name, author: data.author, description: data.description }),
794
773
  dependencies: data.dependencies,
@@ -802,8 +781,7 @@ exports.deserializePlatformApp = deserializePlatformApp;
802
781
  * page
803
782
  * [formily] to [CALS]
804
783
  */
805
- function serializeRuntimePage(ctx, page //IPageInstance
806
- ) {
784
+ function serializeRuntimePage(ctx, page) {
807
785
  var _a, _b, _c, _d, _e, _f;
808
786
  const pageCtx = Object.assign(Object.assign({}, ctx), { dependenciesMap: processDependenciesMap(ctx.dependencies || []), page: { id: page.id } });
809
787
  let processedPage = {
@@ -828,15 +806,14 @@ function serializeRuntimePage(ctx, page //IPageInstance
828
806
  children: (0, runtime_1.getValidValue)((_f = page.children) === null || _f === void 0 ? void 0 : _f.map((child) => serializeRuntimePage(ctx, child))),
829
807
  },
830
808
  };
831
- if ((0, common_3.isValidStyleBind)(page.styleBind) && (0, runtime_1.getValidValue)(page.styleBind)) {
809
+ if ((0, common_2.isValidStyleBind)(page.styleBind) && (0, runtime_1.getValidValue)(page.styleBind)) {
832
810
  page[':style'] = serializeValue({
833
811
  ctx: pageCtx,
834
812
  key: 'styleBind',
835
813
  dynamicValue: page.styleBind,
836
814
  }).value;
837
815
  }
838
- if ((0, common_3.isValidClassNameListBind)(page.classListBind) &&
839
- (0, runtime_1.getValidValue)(page.classListBind)) {
816
+ if ((0, common_2.isValidClassNameListBind)(page.classListBind) && (0, runtime_1.getValidValue)(page.classListBind)) {
840
817
  page[':class'] = serializeValue({
841
818
  ctx: pageCtx,
842
819
  key: 'classListBind',
@@ -858,8 +835,7 @@ exports.serializeRuntimePage = serializeRuntimePage;
858
835
  * component
859
836
  * [formily] to [CALS]
860
837
  */
861
- function serializeRuntimeComponent(ctx, component //IComponentSchemaJson
862
- ) {
838
+ function serializeRuntimeComponent(ctx, component) {
863
839
  var _a, _b, _c;
864
840
  if (!component.id) {
865
841
  component.id = component.key;
@@ -898,7 +874,7 @@ function serializeRuntimeComponent(ctx, component //IComponentSchemaJson
898
874
  attributeExtraData.style = styleBindData === null || styleBindData === void 0 ? void 0 : styleBindData.extra;
899
875
  }
900
876
  }
901
- if ((0, common_3.isValidClassNameListBind)(props.classNameListBind)) {
877
+ if ((0, common_2.isValidClassNameListBind)(props.classNameListBind)) {
902
878
  classListBindData = serializeValue({
903
879
  ctx: componentCtx,
904
880
  key: 'classListBind',
@@ -921,9 +897,7 @@ function serializeRuntimeComponent(ctx, component //IComponentSchemaJson
921
897
  xIndex: (0, runtime_1.getValidValue)(component['x-index']),
922
898
  styleBindPath: (0, runtime_1.getValidValue)(props.styleBindPath),
923
899
  staticResourceAttribute: (0, runtime_1.getValidValue)(props.staticResourceAttribute),
924
- attributeExtraData: (0, common_3.isEmptyObj)(attributeExtraData)
925
- ? undefined
926
- : attributeExtraData,
900
+ attributeExtraData: (0, common_2.isEmptyObj)(attributeExtraData) ? undefined : attributeExtraData,
927
901
  } });
928
902
  }
929
903
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../parser/cals/utils/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAYlD,aAAK,UAAU,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAAA;AAGpD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,UAAQ,UAQ5D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,eAAO,MAAM,UAAU,QAAS,MAAM,YAUrC,CAAA;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,WAQpD;AAED,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,SAAS,WAQpE;AAmFD,wBAAgB,YAAY,CAExB,IAAI,EAAE,GAAG,EAAE,EAEX,KAAK,EAAE,GAAG,EAAE,GACb,UAAU,CAwDZ"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../parser/cals/utils/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAYnD,aAAK,UAAU,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAGrD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,UAAQ,UAQ5D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,eAAO,MAAM,UAAU,QAAS,MAAM,YAUrC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,WAQpD;AAED,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,SAAS,WAQpE;AAyED,wBAAgB,YAAY,CAE1B,IAAI,EAAE,GAAG,EAAE,EAEX,KAAK,EAAE,GAAG,EAAE,GACX,UAAU,CA6CZ"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getUsedComps = exports.isValidClassNameListBind = exports.isValidStyleBind = exports.isEmptyObj = exports.isPlainObject = exports.camelcase = void 0;
4
4
  const index_1 = require("../index");
5
5
  function camelcase(str, firstUpperCase = false) {
6
- str = str.replace(/[_-]([a-z])/g, function (l) {
6
+ str = str.replace(/[_-]([a-z])/g, (l) => {
7
7
  return l[1].toUpperCase();
8
8
  });
9
9
  if (firstUpperCase)
@@ -89,7 +89,7 @@ addedUsedComps) {
89
89
  const cmp = lib.components.find((c) => c.name === cmpName);
90
90
  if (!cmp) {
91
91
  // 找不到复合组件内容, 应该抛异常
92
- console.warn('Component not found', libName + ':' + cmpName);
92
+ console.warn('Component not found', `${libName}:${cmpName}`);
93
93
  return;
94
94
  }
95
95
  if (checkedComps.indexOf(cmp) > -1) {
@@ -122,12 +122,12 @@ apps,
122
122
  // 分库后的组件库 denpendienicy
123
123
  comps) {
124
124
  // 0. 应用内容转换(cals to weapps)
125
- const transferApps = apps.map(app => {
125
+ const transferApps = apps.map((app) => {
126
126
  return (0, index_1.deserializePlatformApp)(app, { dependencies: comps });
127
127
  });
128
128
  // 1. 寻找应用内容里用到的所有组件
129
129
  // 1.1 寻找主子应用各自的内容里所用到的组件
130
- const appUsedComps = transferApps.map(app => {
130
+ const appUsedComps = transferApps.map((app) => {
131
131
  var _a;
132
132
  const usedComps = {};
133
133
  // 主子包模式下, 可能没有应用内容
@@ -139,10 +139,7 @@ comps) {
139
139
  // 1.2 合并主子包所有用到的组件
140
140
  const mergeAppUsedComps = appUsedComps.reduce((comps, item) => {
141
141
  for (const libName in item) {
142
- comps[libName] = new Set([
143
- ...Array.from(item[libName]),
144
- ...Array.from(comps[libName] || [])
145
- ]);
142
+ comps[libName] = new Set([...Array.from(item[libName]), ...Array.from(comps[libName] || [])]);
146
143
  }
147
144
  return comps;
148
145
  }, {});
@@ -160,10 +157,7 @@ comps) {
160
157
  // 3. 合并[应用内容用到的组件]和[复合组件库用到的组件]
161
158
  const allUsedComps = [mergeAppUsedComps, libUsedComps].reduce((comps, item) => {
162
159
  for (const libName in item) {
163
- comps[libName] = new Set([
164
- ...Array.from(item[libName]),
165
- ...Array.from(comps[libName] || [])
166
- ]);
160
+ comps[libName] = new Set([...Array.from(item[libName]), ...Array.from(comps[libName] || [])]);
167
161
  }
168
162
  return comps;
169
163
  }, {});
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../parser/cals/utils/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,kBAAkB,CAAA;AAUzE,wBAAgB,cAAc,CAC5B,UAAU,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAmB,EACnD,WAAW,GAAE,MAAM,EAAO,GACzB,MAAM,CAiER;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,OAwCtC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,GA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AAK,EAAE,GAAG,OAWvC"}
@@ -6,6 +6,7 @@ const style_1 = require("./style");
6
6
  const common_1 = require("./common");
7
7
  const lodash_1 = require("lodash");
8
8
  function readComponents(properties = {}, excludeKeys = []) {
9
+ var _a;
9
10
  const cmps = {};
10
11
  for (const key in properties) {
11
12
  if (excludeKeys.indexOf(key) > -1) {
@@ -27,7 +28,7 @@ function readComponents(properties = {}, excludeKeys = []) {
27
28
  setValidValue(componentXProps, 'style', srcProps.style);
28
29
  setValidValue(componentXProps, 'commonStyle', (0, style_1.removeInvalidStyleFormValue)(srcProps.commonStyle));
29
30
  setValidValue(componentXProps, 'styleBindPath', srcProps.styleBindPath);
30
- if (srcProps.styleBind && srcProps.styleBind.bindDataPath) {
31
+ if ((_a = srcProps.styleBind) === null || _a === void 0 ? void 0 : _a.bindDataPath) {
31
32
  componentXProps.styleBind = {
32
33
  type: srcProps.styleBind.type,
33
34
  value: srcProps.styleBind.bindDataPath,
@@ -60,6 +61,7 @@ function readComponents(properties = {}, excludeKeys = []) {
60
61
  }
61
62
  exports.readComponents = readComponents;
62
63
  function readDirectives(cmp) {
64
+ var _a;
63
65
  const directives = {};
64
66
  // 默认为 true,节省体积不记录
65
67
  if (cmp.data && cmp.data._visible !== true) {
@@ -67,7 +69,7 @@ function readDirectives(cmp) {
67
69
  value: cmp.data._visible,
68
70
  };
69
71
  }
70
- if (cmp.dataBinds && cmp.dataBinds.length) {
72
+ if ((_a = cmp.dataBinds) === null || _a === void 0 ? void 0 : _a.length) {
71
73
  const bind = cmp.dataBinds.find((bind) => bind.propertyPath === '_visible');
72
74
  if (bind) {
73
75
  const foundDataType = (cmp.dataTypes || []).find((dataType) => dataType.propertyPath === bind.propertyPath);
@@ -92,6 +94,7 @@ function readDirectives(cmp) {
92
94
  }
93
95
  exports.readDirectives = readDirectives;
94
96
  function readDynamicData(cmp) {
97
+ var _a, _b;
95
98
  const data = {};
96
99
  const ignoredProps = ['_visible', '_waFor'];
97
100
  // Read data
@@ -103,20 +106,19 @@ function readDynamicData(cmp) {
103
106
  data[prop] = { value: cmp.data[prop] };
104
107
  }
105
108
  // Read data binds
106
- cmp.dataBinds &&
107
- cmp.dataBinds.forEach((bind) => {
108
- if (ignoredProps.indexOf(bind.propertyPath) > -1) {
109
- return;
110
- }
111
- const foundDataType = (cmp.dataTypes || []).find((dataType) => dataType.propertyPath === bind.propertyPath);
112
- if (foundDataType && foundDataType.type === 'bind') {
113
- data[bind.propertyPath] = {
114
- type: bind.type || expression_1.PropBindType.state,
115
- value: bind.bindDataPath,
116
- extra: bind.extra,
117
- };
118
- }
119
- });
109
+ (_b = (_a = cmp.dataBinds) === null || _a === void 0 ? void 0 : _a.forEach) === null || _b === void 0 ? void 0 : _b.call(_a, (bind) => {
110
+ if (ignoredProps.indexOf(bind.propertyPath) > -1) {
111
+ return;
112
+ }
113
+ const foundDataType = (cmp.dataTypes || []).find((dataType) => dataType.propertyPath === bind.propertyPath);
114
+ if (foundDataType && foundDataType.type === 'bind') {
115
+ data[bind.propertyPath] = {
116
+ type: bind.type || expression_1.PropBindType.state,
117
+ value: bind.bindDataPath,
118
+ extra: bind.extra,
119
+ };
120
+ }
121
+ });
120
122
  return data;
121
123
  }
122
124
  exports.readDynamicData = readDynamicData;
@@ -132,6 +134,7 @@ function readListeners(listenerInstances = []) {
132
134
  name: fromParts[1],
133
135
  },
134
136
  data: readDynamicData(act),
137
+ extra: act === null || act === void 0 ? void 0 : act.extra,
135
138
  isCapturePhase: act.isCapturePhase,
136
139
  noPropagation: act.noPropagation,
137
140
  };
@@ -143,11 +146,12 @@ function writeListeners(listeners = []) {
143
146
  return listeners.map((l) => {
144
147
  const act = {
145
148
  key: l.key || '',
146
- sourceKey: l.handler.moduleName + ':' + l.handler.name,
149
+ sourceKey: `${l.handler.moduleName}:${l.handler.name}`,
147
150
  trigger: l.trigger,
148
151
  type: l.type,
149
152
  data: {},
150
153
  dataBinds: [],
154
+ extra: l.extra,
151
155
  handler: l.handler,
152
156
  isCapturePhase: l.isCapturePhase,
153
157
  noPropagation: l.noPropagation,
@@ -0,0 +1,4 @@
1
+ import { IPlatformApp } from '../../../../types/index';
2
+ export declare function generateLocalFromCals(cals: IPlatformApp, options?: any): Promise<void>;
3
+ export declare function generateCalsFromLocal(dir: any): Promise<any>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/transform/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA4B,MAAM,yBAAyB,CAAC;AAEjF,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,KAAA,iBAkDvE;AAED,wBAAsB,qBAAqB,CAAC,GAAG,KAAA,gBAmD9C"}