@cloudbase/cals 1.1.5 → 1.1.6
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/lib/parser/cals/index.d.ts +114 -28
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +25 -11
- package/lib/parser/cals/utils/block/helpers/renew-id-in-code.d.ts +1 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-code.d.ts.map +1 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts +2 -2
- package/lib/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts.map +1 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-expr.js +6 -9
- package/lib/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts +8 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts.map +1 -1
- package/lib/parser/cals/utils/block/index.d.ts +5 -1
- package/lib/parser/cals/utils/block/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/block/index.js +52 -1
- package/lib/parser/cals/utils/common.d.ts +1 -0
- package/lib/parser/cals/utils/common.d.ts.map +1 -1
- package/lib/parser/cals/utils/common.js +19 -1
- package/lib/parser/dependiencies/index.d.ts +1 -1
- package/lib/parser/dependiencies/index.d.ts.map +1 -1
- package/lib/parser/dependiencies/index.js +13 -4
- package/lib/parser/index.d.ts +1 -1
- package/lib/parser/index.d.ts.map +1 -1
- package/lib/parser/index.js +2 -1
- package/lib/schema/platform_application.json +1 -1
- package/lib/schema/platform_template.json +1 -1
- package/lib/types/platform/app.d.ts +1 -1
- package/lib/types/platform/app.d.ts.map +1 -1
- package/lib/utils/constant.d.ts +1 -0
- package/lib/utils/constant.d.ts.map +1 -1
- package/lib/utils/constant.js +2 -1
- package/lib/utils/version/featureChecker.d.ts +1 -0
- package/lib/utils/version/featureChecker.d.ts.map +1 -1
- package/lib/utils/version/featureChecker.js +5 -1
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ import { IEventFlow } from '../../types/platform/eventFlow';
|
|
|
6
6
|
import { IHandler, IPlatformSubApp, IPlatformComponentExtra } from '../../utils';
|
|
7
7
|
import { IVisitedContext } from './utils/block/helpers/remap-component-ids';
|
|
8
8
|
import { IBlockTemplate } from './utils/block/index';
|
|
9
|
-
export { getUsedComps, generateCustomLoginConfigPathname } from './utils/common';
|
|
9
|
+
export { getUsedComps, generateCustomLoginConfigPathname, replaceGloalIdentifier } from './utils/common';
|
|
10
10
|
export { generateDefaultCode } from './utils/template';
|
|
11
11
|
interface IDeserializeContext {
|
|
12
12
|
app?: IPlatformApp;
|
|
@@ -199,6 +199,19 @@ export declare function deserializePage(ctx: {
|
|
|
199
199
|
commonStyle: object;
|
|
200
200
|
staticResourceAttribute: string[];
|
|
201
201
|
hideAdminPortalMenu: boolean;
|
|
202
|
+
styleBindPath: any;
|
|
203
|
+
id: string;
|
|
204
|
+
dataset: any;
|
|
205
|
+
componentInstances: {
|
|
206
|
+
[key: string]: object;
|
|
207
|
+
};
|
|
208
|
+
lowCodes: {
|
|
209
|
+
type: string;
|
|
210
|
+
code: string;
|
|
211
|
+
description?: string;
|
|
212
|
+
path?: string;
|
|
213
|
+
name: string;
|
|
214
|
+
}[];
|
|
202
215
|
listeners: {
|
|
203
216
|
key: string;
|
|
204
217
|
trigger: string;
|
|
@@ -240,19 +253,6 @@ export declare function deserializePage(ctx: {
|
|
|
240
253
|
label?: string;
|
|
241
254
|
description?: string;
|
|
242
255
|
}[];
|
|
243
|
-
styleBindPath: any;
|
|
244
|
-
id: string;
|
|
245
|
-
dataset: any;
|
|
246
|
-
componentInstances: {
|
|
247
|
-
[key: string]: object;
|
|
248
|
-
};
|
|
249
|
-
lowCodes: {
|
|
250
|
-
type: string;
|
|
251
|
-
code: string;
|
|
252
|
-
description?: string;
|
|
253
|
-
path?: string;
|
|
254
|
-
name: string;
|
|
255
|
-
}[];
|
|
256
256
|
};
|
|
257
257
|
/**
|
|
258
258
|
* [WeApps协议] to [CALS协议]
|
|
@@ -303,6 +303,19 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
303
303
|
commonStyle: object;
|
|
304
304
|
staticResourceAttribute: string[];
|
|
305
305
|
hideAdminPortalMenu: boolean;
|
|
306
|
+
styleBindPath: any;
|
|
307
|
+
id: string;
|
|
308
|
+
dataset: any;
|
|
309
|
+
componentInstances: {
|
|
310
|
+
[key: string]: object;
|
|
311
|
+
};
|
|
312
|
+
lowCodes: {
|
|
313
|
+
type: string;
|
|
314
|
+
code: string;
|
|
315
|
+
description?: string;
|
|
316
|
+
path?: string;
|
|
317
|
+
name: string;
|
|
318
|
+
}[];
|
|
306
319
|
listeners: {
|
|
307
320
|
key: string;
|
|
308
321
|
trigger: string;
|
|
@@ -344,19 +357,6 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
344
357
|
label?: string;
|
|
345
358
|
description?: string;
|
|
346
359
|
}[];
|
|
347
|
-
styleBindPath: any;
|
|
348
|
-
id: string;
|
|
349
|
-
dataset: any;
|
|
350
|
-
componentInstances: {
|
|
351
|
-
[key: string]: object;
|
|
352
|
-
};
|
|
353
|
-
lowCodes: {
|
|
354
|
-
type: string;
|
|
355
|
-
code: string;
|
|
356
|
-
description?: string;
|
|
357
|
-
path?: string;
|
|
358
|
-
name: string;
|
|
359
|
-
}[];
|
|
360
360
|
}[];
|
|
361
361
|
lowCodes: {
|
|
362
362
|
type: string;
|
|
@@ -410,6 +410,47 @@ export declare function deserializeCompositeComponent(component: ArrayElement<IP
|
|
|
410
410
|
path?: string;
|
|
411
411
|
name: string;
|
|
412
412
|
}[];
|
|
413
|
+
listeners: {
|
|
414
|
+
key: string;
|
|
415
|
+
trigger: string;
|
|
416
|
+
type: string;
|
|
417
|
+
handler: {
|
|
418
|
+
name: string;
|
|
419
|
+
moduleName: string;
|
|
420
|
+
code: string;
|
|
421
|
+
};
|
|
422
|
+
data: {
|
|
423
|
+
[key: string]: IDynamicValue;
|
|
424
|
+
};
|
|
425
|
+
args: {
|
|
426
|
+
[key: string]: IDynamicValue;
|
|
427
|
+
};
|
|
428
|
+
isCapturePhase: boolean;
|
|
429
|
+
noPropagation: boolean;
|
|
430
|
+
}[];
|
|
431
|
+
eventFlows: {
|
|
432
|
+
listeners: {
|
|
433
|
+
key: string;
|
|
434
|
+
trigger: string;
|
|
435
|
+
type: string;
|
|
436
|
+
handler: {
|
|
437
|
+
name: string;
|
|
438
|
+
moduleName: string;
|
|
439
|
+
code: string;
|
|
440
|
+
};
|
|
441
|
+
data: {
|
|
442
|
+
[key: string]: IDynamicValue;
|
|
443
|
+
};
|
|
444
|
+
args: {
|
|
445
|
+
[key: string]: IDynamicValue;
|
|
446
|
+
};
|
|
447
|
+
isCapturePhase: boolean;
|
|
448
|
+
noPropagation: boolean;
|
|
449
|
+
}[];
|
|
450
|
+
id: string;
|
|
451
|
+
label?: string;
|
|
452
|
+
description?: string;
|
|
453
|
+
}[];
|
|
413
454
|
};
|
|
414
455
|
/**
|
|
415
456
|
* page
|
|
@@ -479,6 +520,7 @@ export declare function parseVersion(version?: string, dependencies?: any[]): {
|
|
|
479
520
|
enablePageRoot: boolean;
|
|
480
521
|
staticDatasourceProfile: boolean;
|
|
481
522
|
enableAsyncMaterials: boolean;
|
|
523
|
+
disablePageComponentInvoke: boolean;
|
|
482
524
|
};
|
|
483
525
|
export declare function processListeners(listeners: IPlatformListener[], options?: {
|
|
484
526
|
strict: boolean;
|
|
@@ -511,7 +553,51 @@ export declare function processTemplatesToDependiencies(templates?: any[]): {
|
|
|
511
553
|
*/
|
|
512
554
|
meta: any;
|
|
513
555
|
npmDependencies: {};
|
|
514
|
-
listeners:
|
|
556
|
+
listeners: {
|
|
557
|
+
key: string;
|
|
558
|
+
trigger: string;
|
|
559
|
+
type: string;
|
|
560
|
+
handler: {
|
|
561
|
+
name: string;
|
|
562
|
+
moduleName: string;
|
|
563
|
+
code: string;
|
|
564
|
+
};
|
|
565
|
+
data: {
|
|
566
|
+
[key: string]: IDynamicValue;
|
|
567
|
+
};
|
|
568
|
+
args: {
|
|
569
|
+
[key: string]: IDynamicValue;
|
|
570
|
+
};
|
|
571
|
+
isCapturePhase: boolean;
|
|
572
|
+
noPropagation: boolean;
|
|
573
|
+
}[];
|
|
574
|
+
/**
|
|
575
|
+
* 扩展 dataset 和 eventFlows 数据
|
|
576
|
+
*/
|
|
577
|
+
dataset: any;
|
|
578
|
+
eventFlows: {
|
|
579
|
+
listeners: {
|
|
580
|
+
key: string;
|
|
581
|
+
trigger: string;
|
|
582
|
+
type: string;
|
|
583
|
+
handler: {
|
|
584
|
+
name: string;
|
|
585
|
+
moduleName: string;
|
|
586
|
+
code: string;
|
|
587
|
+
};
|
|
588
|
+
data: {
|
|
589
|
+
[key: string]: IDynamicValue;
|
|
590
|
+
};
|
|
591
|
+
args: {
|
|
592
|
+
[key: string]: IDynamicValue;
|
|
593
|
+
};
|
|
594
|
+
isCapturePhase: boolean;
|
|
595
|
+
noPropagation: boolean;
|
|
596
|
+
}[];
|
|
597
|
+
id: string;
|
|
598
|
+
label?: string;
|
|
599
|
+
description?: string;
|
|
600
|
+
}[];
|
|
515
601
|
}[];
|
|
516
602
|
isComposite: boolean;
|
|
517
603
|
schemaVersion: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parser/cals/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuC,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEvH,OAAO,EACL,WAAW,EACX,YAAY,EAGZ,cAAc,EACd,kBAAkB,EAElB,mBAAmB,EACnB,cAAc,EAAE,cAAc;AAC9B,mBAAmB,EACnB,aAAa,EACb,IAAI,EAEL,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkC,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parser/cals/index.ts"],"names":[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ault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.expandCalsReference = exports.collapseCalsReference = exports.streamlineSubApp = exports.generateHandlerParamsDynamicMap = exports.processTemplatesToDependiencies = exports.parseDependenciesVersion = exports.processDependenciesVersionMap = exports.processListeners = exports.parseVersion = exports.processRuntimeCodeResources = exports.deserializeComponentLibraryMeta = exports.deserializeRuntimeComponent = exports.serializeRuntimeComponent = exports.serializeRuntimeDataset = exports.serializeRuntimePage = exports.deserializeCompositeComponent = exports.deserializePlatformApp = exports.serializePlatformApp = exports.deserializePage = exports.serializeLayouts = exports.serializePage = exports.deserializeComponent = exports.serializeComponent = exports.deserializeDataVariables = exports.normalizeQuery = exports.deserializeDataset = exports.deserializeTemplates = exports.serializeDataset = exports.deserializeAttributes = exports.serializeAttributes = exports.deserializeDynamicMap = exports.serializeDynamicMap = exports.deserializeValue = exports.serializeValue = exports.generateDefaultCode = exports.generateCustomLoginConfigPathname = exports.getUsedComps = void 0;
|
|
17
|
+
exports.expandCalsReference = exports.collapseCalsReference = exports.streamlineSubApp = exports.generateHandlerParamsDynamicMap = exports.processTemplatesToDependiencies = exports.parseDependenciesVersion = exports.processDependenciesVersionMap = exports.processListeners = exports.parseVersion = exports.processRuntimeCodeResources = exports.deserializeComponentLibraryMeta = exports.deserializeRuntimeComponent = exports.serializeRuntimeComponent = exports.serializeRuntimeDataset = exports.serializeRuntimePage = exports.deserializeCompositeComponent = exports.deserializePlatformApp = exports.serializePlatformApp = exports.deserializePage = exports.serializeLayouts = exports.serializePage = exports.deserializeComponent = exports.serializeComponent = exports.deserializeDataVariables = exports.normalizeQuery = exports.deserializeDataset = exports.deserializeTemplates = exports.serializeDataset = exports.deserializeAttributes = exports.serializeAttributes = exports.deserializeDynamicMap = exports.serializeDynamicMap = exports.deserializeValue = exports.serializeValue = exports.generateDefaultCode = exports.replaceGloalIdentifier = exports.generateCustomLoginConfigPathname = exports.getUsedComps = void 0;
|
|
18
18
|
const get_1 = __importDefault(require("lodash/get"));
|
|
19
19
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
20
20
|
const unset_1 = __importDefault(require("lodash/unset"));
|
|
@@ -37,6 +37,7 @@ const index_1 = require("./utils/block/index");
|
|
|
37
37
|
var common_3 = require("./utils/common");
|
|
38
38
|
Object.defineProperty(exports, "getUsedComps", { enumerable: true, get: function () { return common_3.getUsedComps; } });
|
|
39
39
|
Object.defineProperty(exports, "generateCustomLoginConfigPathname", { enumerable: true, get: function () { return common_3.generateCustomLoginConfigPathname; } });
|
|
40
|
+
Object.defineProperty(exports, "replaceGloalIdentifier", { enumerable: true, get: function () { return common_3.replaceGloalIdentifier; } });
|
|
40
41
|
var template_2 = require("./utils/template");
|
|
41
42
|
Object.defineProperty(exports, "generateDefaultCode", { enumerable: true, get: function () { return template_2.generateDefaultCode; } });
|
|
42
43
|
function serializeValue({ ctx, key, dynamicValue, scope = 'page', streamlineDefaultValue, }) {
|
|
@@ -909,20 +910,12 @@ function deserializePage(ctx, page) {
|
|
|
909
910
|
let dynamicStyle = page[':style']
|
|
910
911
|
? deserializeValue(pageCtx, ':style', page[':style'], (_b = (_a = page === null || page === void 0 ? void 0 : page.extra) === null || _a === void 0 ? void 0 : _a.attributeExtraData) === null || _b === void 0 ? void 0 : _b.style).value
|
|
911
912
|
: undefined;
|
|
912
|
-
const { listeners = [], eventFlows } = processListeners((page === null || page === void 0 ? void 0 : page.listeners) || []);
|
|
913
913
|
const instance = deserializeInstance(pageCtx, page);
|
|
914
914
|
return Object.assign(Object.assign({}, instance), { isHome: page.id === homePageId, vars: {
|
|
915
915
|
data: ((_c = page.dataVariables) === null || _c === void 0 ? void 0 : _c.map((item) => {
|
|
916
916
|
return deserializeDataVariables(undefined, item);
|
|
917
917
|
})) || [],
|
|
918
|
-
}, data: deserializeAttributes(pageCtx, page.attributes, (_d = page === null || page === void 0 ? void 0 : page.extra) === null || _d === void 0 ? void 0 : _d.attributeExtraData), style: (_e = page.attributes) === null || _e === void 0 ? void 0 : _e.style, commonStyle: (_f = page === null || page === void 0 ? void 0 : page.extra) === null || _f === void 0 ? void 0 : _f.commonStyle, staticResourceAttribute: (_g = page === null || page === void 0 ? void 0 : page.extra) === null || _g === void 0 ? void 0 : _g.staticResourceAttribute, hideAdminPortalMenu: (_h = page === null || page === void 0 ? void 0 : page.extra) === null || _h === void 0 ? void 0 : _h.hideAdminPortalMenu,
|
|
919
|
-
return deserializeListener(pageCtx, item);
|
|
920
|
-
})) || [], eventFlows: (eventFlows === null || eventFlows === void 0 ? void 0 : eventFlows.map((eventFlow) => {
|
|
921
|
-
var _a, _b;
|
|
922
|
-
return Object.assign(Object.assign({}, eventFlow), { listeners: ((_b = (_a = eventFlow.listeners) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (item) => {
|
|
923
|
-
return deserializeListener(pageCtx, item);
|
|
924
|
-
})) || [] });
|
|
925
|
-
})) || [],
|
|
918
|
+
}, data: deserializeAttributes(pageCtx, page.attributes, (_d = page === null || page === void 0 ? void 0 : page.extra) === null || _d === void 0 ? void 0 : _d.attributeExtraData), style: (_e = page.attributes) === null || _e === void 0 ? void 0 : _e.style, commonStyle: (_f = page === null || page === void 0 ? void 0 : page.extra) === null || _f === void 0 ? void 0 : _f.commonStyle, staticResourceAttribute: (_g = page === null || page === void 0 ? void 0 : page.extra) === null || _g === void 0 ? void 0 : _g.staticResourceAttribute, hideAdminPortalMenu: (_h = page === null || page === void 0 ? void 0 : page.extra) === null || _h === void 0 ? void 0 : _h.hideAdminPortalMenu,
|
|
926
919
|
// TODO
|
|
927
920
|
// children: [],
|
|
928
921
|
styleBindPath: (dynamicStyle === null || dynamicStyle === void 0 ? void 0 : dynamicStyle.value) || undefined });
|
|
@@ -931,11 +924,21 @@ exports.deserializePage = deserializePage;
|
|
|
931
924
|
function deserializeInstance(ctx, instance, scope = 'page') {
|
|
932
925
|
var _a;
|
|
933
926
|
const instanceCtx = Object.assign(Object.assign({}, ctx), { page: scope === 'page' ? instance : undefined });
|
|
927
|
+
const { listeners = [], eventFlows } = processListeners((instance === null || instance === void 0 ? void 0 : instance.listeners) || []);
|
|
934
928
|
return {
|
|
935
929
|
id: instance.id || instance.name,
|
|
936
930
|
dataset: deserializeDataset(ctx, instance.dataset),
|
|
937
931
|
componentInstances: deserializeComponent(instanceCtx, instance.items || []),
|
|
938
932
|
lowCodes: (_a = instance === null || instance === void 0 ? void 0 : instance.resources) === null || _a === void 0 ? void 0 : _a.filter((item) => item.type === common_1.EResourceType.CODE && item.name !== common_1.ECodeName.PLACEHOLDER).map((item) => deserializeCodeResource(undefined, item)),
|
|
933
|
+
listeners: (listeners === null || listeners === void 0 ? void 0 : listeners.map((item) => {
|
|
934
|
+
return deserializeListener(ctx, item);
|
|
935
|
+
})) || [],
|
|
936
|
+
eventFlows: (eventFlows === null || eventFlows === void 0 ? void 0 : eventFlows.map((eventFlow) => {
|
|
937
|
+
var _a, _b;
|
|
938
|
+
return Object.assign(Object.assign({}, eventFlow), { listeners: ((_b = (_a = eventFlow.listeners) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (item) => {
|
|
939
|
+
return deserializeListener(ctx, item);
|
|
940
|
+
})) || [] });
|
|
941
|
+
})) || [],
|
|
939
942
|
};
|
|
940
943
|
}
|
|
941
944
|
/**
|
|
@@ -1336,6 +1339,11 @@ function parseVersion(version = '', dependencies = []) {
|
|
|
1336
1339
|
* 是否启用异步组件库
|
|
1337
1340
|
*/
|
|
1338
1341
|
enableAsyncMaterials: false,
|
|
1342
|
+
/**
|
|
1343
|
+
* 使用简单的组件api调用方式
|
|
1344
|
+
* $w.componentId.method()
|
|
1345
|
+
*/
|
|
1346
|
+
disablePageComponentInvoke: false,
|
|
1339
1347
|
};
|
|
1340
1348
|
if (list[0] === '4' || version === 'latest') {
|
|
1341
1349
|
FEATURE_MAP.defaultDynamicCssUnit = false;
|
|
@@ -1343,6 +1351,7 @@ function parseVersion(version = '', dependencies = []) {
|
|
|
1343
1351
|
FEATURE_MAP.enableObserverRef = (0, featureChecker_1.isEnbaleObserverVersion)(dependencies);
|
|
1344
1352
|
FEATURE_MAP.enablePageRoot = (0, featureChecker_1.isEnablePageRoot)(dependencies);
|
|
1345
1353
|
FEATURE_MAP.staticDatasourceProfile = !(0, featureChecker_1.isEnablePageRoot)(dependencies);
|
|
1354
|
+
FEATURE_MAP.disablePageComponentInvoke = (0, featureChecker_1.isEnableSimpleComponentInvoke)(dependencies);
|
|
1346
1355
|
// FEATURE_MAP.enableAsyncMaterials = isEnableAsyncMaterials(dependencies);
|
|
1347
1356
|
return FEATURE_MAP;
|
|
1348
1357
|
}
|
|
@@ -1466,7 +1475,12 @@ function processTemplatesToDependiencies(templates = []) {
|
|
|
1466
1475
|
platforms: { mp: {} },
|
|
1467
1476
|
},
|
|
1468
1477
|
npmDependencies: {},
|
|
1469
|
-
listeners: [],
|
|
1478
|
+
listeners: weappsData.listeners || [],
|
|
1479
|
+
/**
|
|
1480
|
+
* 扩展 dataset 和 eventFlows 数据
|
|
1481
|
+
*/
|
|
1482
|
+
dataset: weappsData.dataset,
|
|
1483
|
+
eventFlows: weappsData.eventFlows || [],
|
|
1470
1484
|
};
|
|
1471
1485
|
}),
|
|
1472
1486
|
isComposite: true,
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* @param expr 表达式
|
|
4
4
|
* @param componentIdMap 映射: 组件原始 ID => 新生成 ID
|
|
5
5
|
*/
|
|
6
|
-
export declare function renewIdInCode(code: string, componentIdMap: Map<string, string>):
|
|
6
|
+
export declare function renewIdInCode(code: string, componentIdMap: Map<string, string>): any;
|
|
7
7
|
//# sourceMappingURL=renew-id-in-code.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renew-id-in-code.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/block/helpers/renew-id-in-code.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"renew-id-in-code.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/block/helpers/renew-id-in-code.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,OAE9E"}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* @param expr 表达式
|
|
4
4
|
* @param componentIdMap 映射: 组件原始 ID => 新生成 ID
|
|
5
5
|
*/
|
|
6
|
-
export declare function renewIdInExpr(expr: string, componentIdMap: Map<string, string>):
|
|
7
|
-
export declare function renewIdWithRegexp(str: string, componentIdMap: Map<string, string>):
|
|
6
|
+
export declare function renewIdInExpr(expr: string, componentIdMap: Map<string, string>): any;
|
|
7
|
+
export declare function renewIdWithRegexp(str: string, componentIdMap: Map<string, string>): any;
|
|
8
8
|
//# sourceMappingURL=renew-id-in-expr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renew-id-in-expr.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/block/helpers/renew-id-in-expr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renew-id-in-expr.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/block/helpers/renew-id-in-expr.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,OA0C9E;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,OASjF"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.renewIdWithRegexp = exports.renewIdInExpr = void 0;
|
|
4
4
|
// import * as Babel from '@babel/standalone';
|
|
5
5
|
const resolve_new_id_1 = require("./resolve-new-id");
|
|
6
|
+
const common_1 = require("../../common");
|
|
6
7
|
/**
|
|
7
8
|
* 按需将表达式中引用的组件旧 ID 更新为新 ID
|
|
8
9
|
* @param expr 表达式
|
|
@@ -47,18 +48,14 @@ function renewIdInExpr(expr, componentIdMap) {
|
|
|
47
48
|
}
|
|
48
49
|
exports.renewIdInExpr = renewIdInExpr;
|
|
49
50
|
function renewIdWithRegexp(str, componentIdMap) {
|
|
50
|
-
return
|
|
51
|
-
const before = str[offset - 1];
|
|
51
|
+
return (0, common_1.replaceGloalIdentifier)(str, '$w', (match, p1, p2, offset) => {
|
|
52
52
|
const newId = (0, resolve_new_id_1.resolveNewId)(p2, componentIdMap);
|
|
53
|
-
|
|
54
|
-
* 前向匹配
|
|
55
|
-
* 前一个字符存在,且前一个字符费变量安全字 a-z、A-Z、0-9、_、$起始
|
|
56
|
-
* 且前一字符非 . 表示成员访问
|
|
57
|
-
*/
|
|
58
|
-
if (newId && !(before && /[a-zA-Z0-9_$.]/.test(before))) {
|
|
53
|
+
if (newId) {
|
|
59
54
|
return `${p1}${newId}`;
|
|
60
55
|
}
|
|
61
|
-
|
|
56
|
+
else {
|
|
57
|
+
return match;
|
|
58
|
+
}
|
|
62
59
|
});
|
|
63
60
|
}
|
|
64
61
|
exports.renewIdWithRegexp = renewIdWithRegexp;
|
|
@@ -4,5 +4,12 @@ import { ICodeResource } from '../../../../../types';
|
|
|
4
4
|
* @param resource 代码资源
|
|
5
5
|
* @param componentIdMap 映射: 组件原始 ID => 新生成 ID
|
|
6
6
|
*/
|
|
7
|
-
export declare function renewIdInResource(resource: ICodeResource, componentIdMap: Map<string, string>):
|
|
7
|
+
export declare function renewIdInResource(resource: ICodeResource, componentIdMap: Map<string, string>): {
|
|
8
|
+
code: any;
|
|
9
|
+
type: "CODE";
|
|
10
|
+
description?: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
codeType?: string;
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
8
15
|
//# sourceMappingURL=renew-id-in-resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renew-id-in-resource.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/block/helpers/renew-id-in-resource.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"renew-id-in-resource.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/block/helpers/renew-id-in-resource.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;;;;;;;EAK7F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPlatformApp, IPlatformComponent } from '../../../../types';
|
|
1
|
+
import { IPlatformApp, IPlatformComponent, IPageComponent } from '../../../../types';
|
|
2
2
|
import { IVisitedContext } from './helpers/remap-component-ids';
|
|
3
3
|
import { ICalsReferenceContext } from '../../../../utils';
|
|
4
4
|
export { renewIdInResource } from './helpers/renew-id-in-resource';
|
|
@@ -42,4 +42,8 @@ export interface IBlockTemplate {
|
|
|
42
42
|
dynamicConfig?: any;
|
|
43
43
|
content: IPlatformApp;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* 转换区块 page 到 template
|
|
47
|
+
*/
|
|
48
|
+
export declare function processPage2Template(page: IPageComponent, properties?: any): any;
|
|
45
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxG,OAAO,EAAE,eAAe,EAAsD,MAAM,+BAA+B,CAAC;AAOpH,OAAO,EAAmB,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACtC;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,kBAAkB,GAAG,aAAa,CAyD9F;AA+GD,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,qBAAqB,GAAG;IAAE,QAAQ,EAAE,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAAC,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,EAClH,UAAU,EAAE,kBAAkB,EAAE,GAC/B,kBAAkB,EAAE,CAiBtB;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa,CAAC,EAAE;QACd,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;KAC5C,CAAC;CACH;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE;IAAE,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;CAAE,EAAE,IAAI,EAAE,cAAc,EAAE,gBA8E1G;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,qBAAqB,GAAG;IAAE,QAAQ,EAAE,eAAe,CAAA;CAAE,EAC1D,SAAS,EAAE,kBAAkB,OAiE9B;AAED,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,qBAAqB,EAAE,SAAS,KAAA,OA2B/E;AAaD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,GAAG,OAqE1E"}
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.collapseComponentReference = exports.expandComponentReference = exports.mergeCals = exports.regenBlockTemplateComponents = exports.parseComponentCals = exports.VisitedMap = exports.refreshComponentIds = exports.remapComponentIds = exports.renewIdInResource = void 0;
|
|
17
|
+
exports.processPage2Template = exports.collapseComponentReference = exports.expandComponentReference = exports.mergeCals = exports.regenBlockTemplateComponents = exports.parseComponentCals = exports.VisitedMap = exports.refreshComponentIds = exports.remapComponentIds = exports.renewIdInResource = void 0;
|
|
18
18
|
const get_1 = __importDefault(require("lodash/get"));
|
|
19
19
|
const set_1 = __importDefault(require("lodash/set"));
|
|
20
20
|
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
@@ -26,6 +26,7 @@ const renew_id_in_resource_1 = require("./helpers/renew-id-in-resource");
|
|
|
26
26
|
const merge_resources_1 = require("./helpers/merge-resources");
|
|
27
27
|
const merge_dataset_1 = require("./helpers/merge-dataset");
|
|
28
28
|
const merge_listeners_1 = require("./helpers/merge-listeners");
|
|
29
|
+
const utils_1 = require("../../../../utils");
|
|
29
30
|
const lodash_1 = require("lodash");
|
|
30
31
|
var renew_id_in_resource_2 = require("./helpers/renew-id-in-resource");
|
|
31
32
|
Object.defineProperty(exports, "renewIdInResource", { enumerable: true, get: function () { return renew_id_in_resource_2.renewIdInResource; } });
|
|
@@ -322,3 +323,53 @@ function filterMap(current = {}, base = {}) {
|
|
|
322
323
|
});
|
|
323
324
|
return filtered;
|
|
324
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* 转换区块 page 到 template
|
|
328
|
+
*/
|
|
329
|
+
function processPage2Template(page, properties) {
|
|
330
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
331
|
+
let { items = [] } = page;
|
|
332
|
+
let dataForm = {};
|
|
333
|
+
if (items.length > 1) {
|
|
334
|
+
items = items;
|
|
335
|
+
items = [{ id: `comtainer_${page.id}`, component: 'Container', attributes: {}, items: items }];
|
|
336
|
+
}
|
|
337
|
+
else if (items.length === 1) {
|
|
338
|
+
let component = items[0];
|
|
339
|
+
// simple block
|
|
340
|
+
if (component.component === 'Container' &&
|
|
341
|
+
((_a = component.attributes) === null || _a === void 0 ? void 0 : _a[':data']) &&
|
|
342
|
+
(((_d = (_c = (_b = component.extra) === null || _b === void 0 ? void 0 : _b.dataForm) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.type) === 'object' || properties)) {
|
|
343
|
+
component = Object.assign(Object.assign({}, component), { attributes: Object.assign(Object.assign({}, component.attributes), { ':data': '$comp.props.data' }) });
|
|
344
|
+
dataForm = properties || ((_g = (_f = (_e = component.extra) === null || _e === void 0 ? void 0 : _e.dataForm) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.properties);
|
|
345
|
+
}
|
|
346
|
+
component = Object.assign(Object.assign({}, component), { extra: Object.assign(Object.assign({}, component.extra), { anchored: undefined, dataForm: undefined }) });
|
|
347
|
+
items = [component];
|
|
348
|
+
}
|
|
349
|
+
const TRANSFER_EVENTNAME_MAP = {
|
|
350
|
+
load: 'attached',
|
|
351
|
+
unload: 'detached',
|
|
352
|
+
};
|
|
353
|
+
function replacePageMember(str) {
|
|
354
|
+
return (str === null || str === void 0 ? void 0 : str.replace(/(?:\$w\.page|\$page).(dataset|handler)/g, '$comp.$1')) || str;
|
|
355
|
+
}
|
|
356
|
+
return JSON.parse(JSON.stringify({
|
|
357
|
+
id: page.id,
|
|
358
|
+
name: page.id,
|
|
359
|
+
items,
|
|
360
|
+
listeners: (_j = (_h = page.listeners) === null || _h === void 0 ? void 0 : _h.map) === null || _j === void 0 ? void 0 : _j.call(_h, (listener) => {
|
|
361
|
+
return Object.assign(Object.assign({}, listener), { eventName: TRANSFER_EVENTNAME_MAP[listener.eventName] || listener.eventName });
|
|
362
|
+
}),
|
|
363
|
+
dataset: page.dataset,
|
|
364
|
+
resources: (_k = page.resources) === null || _k === void 0 ? void 0 : _k.map((item) => {
|
|
365
|
+
return Object.assign(Object.assign({}, item), { code: replacePageMember(item.code || '') });
|
|
366
|
+
}),
|
|
367
|
+
data: { properties: properties || dataForm },
|
|
368
|
+
}, function (key, v) {
|
|
369
|
+
if (utils_1.DYNAMIC_KEY_REG.test(key) && typeof v === 'string') {
|
|
370
|
+
return replacePageMember(v);
|
|
371
|
+
}
|
|
372
|
+
return v;
|
|
373
|
+
}));
|
|
374
|
+
}
|
|
375
|
+
exports.processPage2Template = processPage2Template;
|
|
@@ -30,5 +30,6 @@ export declare function generateCustomLoginConfigPathname({ appId, version }: {
|
|
|
30
30
|
}): string;
|
|
31
31
|
export declare function walkThroughComponents(components: IPlatformComponent[], visit: any): void;
|
|
32
32
|
export declare const DYNAMIC_KEY_REG: RegExp;
|
|
33
|
+
export declare function replaceGloalIdentifier(str: any, identifier: any, replacer: (match: any, p1: any, p2: any, offset: any) => string): any;
|
|
33
34
|
export {};
|
|
34
35
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/common.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEnG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAsBnD,aAAK,uBAAuB,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAOlE,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;AA6JD,wBAAgB,YAAY,CAE1B,IAAI,EAAE,CAAC,YAAY,GAAG,eAAe,CAAC,EAAE,EAExC,YAAY,EAAE,GAAG,EAAE,EACnB,OAAO,CAAC,EAAE;IACR;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB,GACA,uBAAuB,CAAC;AAC3B,wBAAgB,YAAY,CAE1B,IAAI,EAAE,CAAC,YAAY,GAAG,eAAe,CAAC,EAAE,EAExC,YAAY,EAAE,GAAG,EAAE,EACnB,OAAO,EAAE;IACP,UAAU,EAAE,IAAI,CAAC;IACjB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB,GACA;IAAE,SAAS,EAAE,uBAAuB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;CAAE,CAAC;AAsG/E,wBAAgB,iCAAiC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,UASvG;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,kBAAkB,EAAO,EAAE,KAAK,KAAA,QAKjF;AAED,eAAO,MAAM,eAAe,QAAY,CAAC;AAEzC,wBAAgB,sBAAsB,CAAC,GAAG,KAAA,EAAE,UAAU,KAAA,EAAE,QAAQ,EAAE,CAAC,KAAK,KAAA,EAAE,EAAE,KAAA,EAAE,EAAE,KAAA,EAAE,MAAM,KAAA,KAAK,MAAM,OAelG"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DYNAMIC_KEY_REG = exports.walkThroughComponents = exports.generateCustomLoginConfigPathname = exports.getUsedComps = exports.isValidClassNameListBind = exports.isValidStyleBind = exports.isEmptyObj = exports.isPlainObject = exports.camelcase = void 0;
|
|
3
|
+
exports.replaceGloalIdentifier = exports.DYNAMIC_KEY_REG = exports.walkThroughComponents = exports.generateCustomLoginConfigPathname = exports.getUsedComps = exports.isValidClassNameListBind = exports.isValidStyleBind = exports.isEmptyObj = exports.isPlainObject = exports.camelcase = void 0;
|
|
4
|
+
/* eslint-disable no-restricted-syntax */
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
4
6
|
const utils_1 = require("../../../utils");
|
|
5
7
|
const index_1 = require("../index");
|
|
6
8
|
function camelcase(str, firstUpperCase = false) {
|
|
@@ -293,3 +295,19 @@ function walkThroughComponents(components = [], visit) {
|
|
|
293
295
|
}
|
|
294
296
|
exports.walkThroughComponents = walkThroughComponents;
|
|
295
297
|
exports.DYNAMIC_KEY_REG = /^:(.*)$/;
|
|
298
|
+
function replaceGloalIdentifier(str, identifier, replacer) {
|
|
299
|
+
const reg = new RegExp(`(${(0, lodash_1.escapeRegExp)(`${identifier}.`)})(\\w+)`, 'g');
|
|
300
|
+
return str.replace(reg, (match, p1, p2, offset) => {
|
|
301
|
+
const before = str[offset - 1];
|
|
302
|
+
/**
|
|
303
|
+
* 前向匹配
|
|
304
|
+
* 前一个字符存在,且前一个字符费变量安全字 a-z、A-Z、0-9、_、$起始
|
|
305
|
+
* 且前一字符非 . 表示成员访问
|
|
306
|
+
*/
|
|
307
|
+
if (!(before && /[a-zA-Z0-9_$.]/.test(before))) {
|
|
308
|
+
return replacer(match, p1, p2, offset);
|
|
309
|
+
}
|
|
310
|
+
return match;
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
exports.replaceGloalIdentifier = replaceGloalIdentifier;
|
|
@@ -34,7 +34,7 @@ export declare class Dependencies {
|
|
|
34
34
|
constructor({ request, cals, compositeGroupId, compositeComponentId, }: {
|
|
35
35
|
cals: {
|
|
36
36
|
id: Required<IPlatformApp>['id'];
|
|
37
|
-
dependencies
|
|
37
|
+
dependencies?: IPlatformApp['dependencies'];
|
|
38
38
|
};
|
|
39
39
|
compositeGroupId?: string;
|
|
40
40
|
compositeComponentId?: string;
|
|
@@ -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AC,YAAY,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,EAC9E,IAAI,MAAY,GACf,OAAO,CAAC;QACT,IAAI,EAAE;YACJ,IAAI,CAAC,EAAE,mBAAmB,EAAE,CAAC;SAC9B,CAAC;KACH,CAAC;IAOI,uBAAuB,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAChE,IAAI,EAAE;YACJ,IAAI,CAAC,EAAE,mBAAmB,EAAE,CAAC;SAC9B,CAAC;KACH,CAAC;IAOI,wBAAwB,CAAC,IAAI,EAAE,GAAG;CAsMzC;AAED,UAAU,mBAAmB;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -205,17 +205,26 @@ class Dependencies {
|
|
|
205
205
|
// a.如果存在任意一个官方组件库不同,则加载应用的版本
|
|
206
206
|
// b.如果拉取最新的gsd-h5-react组件版本的中版本号低于当前组件版本,则加载应用版本
|
|
207
207
|
const officialCompositeGroupMeta = [];
|
|
208
|
+
const officialCompositeGroupMetaList = [];
|
|
208
209
|
latestCompositeGroupList.forEach((compositeGroup) => {
|
|
209
210
|
const version = dependenciesVersionMap[`${utils_1.WEDA_OFFICIAL_NAMESPACE}${compositeGroup.GroupName}`] ||
|
|
210
211
|
dependenciesVersionMap[compositeGroup.GroupName];
|
|
211
|
-
if (OFFICIAL_LIB_SET.has(compositeGroup.GroupName)
|
|
212
|
-
|
|
212
|
+
if (OFFICIAL_LIB_SET.has(compositeGroup.GroupName)) {
|
|
213
|
+
if (version) {
|
|
214
|
+
officialCompositeGroupMeta.push({ Id: compositeGroup.Id, GroupVersion: version });
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
officialCompositeGroupMetaList.push(compositeGroup);
|
|
218
|
+
}
|
|
213
219
|
}
|
|
214
220
|
else {
|
|
215
221
|
compositeGroupList.push(compositeGroup);
|
|
216
222
|
}
|
|
217
223
|
});
|
|
218
|
-
|
|
224
|
+
if (officialCompositeGroupMeta.length) {
|
|
225
|
+
const { Data: { List = [] }, } = yield this.DescribeCompositeGroupList({ GroupList: officialCompositeGroupMeta });
|
|
226
|
+
officialCompositeGroupMetaList.push(...List);
|
|
227
|
+
}
|
|
219
228
|
if (!__classPrivateFieldGet(this, _Dependencies_options, "f").autoUpgradeToLatestPatchVersion) {
|
|
220
229
|
compositeGroupList.push(...officialCompositeGroupMetaList);
|
|
221
230
|
}
|
|
@@ -227,7 +236,7 @@ class Dependencies {
|
|
|
227
236
|
typeof compGroup.TinyPrimeVersion === 'string' &&
|
|
228
237
|
compGroup.TinyPrimeVersion.length > 0 &&
|
|
229
238
|
compGroup.TinyPrimeVersion !== compGroup.Version) {
|
|
230
|
-
//
|
|
239
|
+
// 收集需要 patch 的版本
|
|
231
240
|
patchGroupMeta.push({ Id: compGroup.Id, GroupVersion: compGroup.TinyPrimeVersion });
|
|
232
241
|
}
|
|
233
242
|
else {
|
package/lib/parser/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './cals/index';
|
|
|
2
2
|
export { upgrageToVersion2 } from './cals/utils/version';
|
|
3
3
|
export { processComponentModule } from './cals/utils/spinoff';
|
|
4
4
|
export { calsToCode, codeToCals, type ICodeItem, checkForConflicts, autoResolveConflicts, findAllConflicts, } from './cals/utils/code';
|
|
5
|
-
export { parseComponentCals, regenBlockTemplateComponents, renewIdInResource, VisitedMap, remapComponentIds, refreshComponentIds, mergeCals, } from './cals/utils/block';
|
|
5
|
+
export { parseComponentCals, regenBlockTemplateComponents, processPage2Template, renewIdInResource, VisitedMap, remapComponentIds, refreshComponentIds, mergeCals, } from './cals/utils/block';
|
|
6
6
|
export { ActionType, type IDataBind, PropBindType } from './expression/index';
|
|
7
7
|
export { processCommonStyle2CSSProperties, processCSSProperties2Rem, processCSSPropertiesUnit, } from './cals/utils/style';
|
|
8
8
|
export { getUsedResources, getNavUsedStaticResource, _simpleGetUsedResourceOfComponent, } from './cals/utils/getUsedResources';
|