@cloudbase/cals 0.3.19 → 0.3.22-alpha.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.
- package/README.md +17 -10
- package/lib/parser/cals/index.d.ts +22 -68
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +134 -96
- package/lib/parser/cals/utils/block/index.js +2 -2
- package/lib/parser/cals/utils/common.d.ts +5 -0
- package/lib/parser/cals/utils/common.d.ts.map +1 -1
- package/lib/parser/cals/utils/common.js +125 -1
- package/lib/parser/cals/utils/runtime.d.ts +4 -1
- package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
- package/lib/parser/cals/utils/runtime.js +7 -0
- package/lib/parser/cals/utils/spinoff/index.d.ts.map +1 -1
- package/lib/parser/expression/index.d.ts +8 -1
- package/lib/parser/expression/index.d.ts.map +1 -1
- package/lib/parser/expression/index.js +6 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/platform/app.d.ts +15 -1
- package/lib/types/platform/app.d.ts.map +1 -1
- package/lib/types/platform/common.d.ts +7 -7
- package/lib/types/platform/common.d.ts.map +1 -1
- package/lib/types/platform/common.js +4 -5
- package/lib/types/platform/component.d.ts +17 -30
- package/lib/types/platform/component.d.ts.map +1 -1
- package/lib/types/platform/component.js +5 -6
- package/lib/types/platform/datasource.d.ts +9 -5
- package/lib/types/platform/datasource.d.ts.map +1 -1
- package/package.json +6 -2
- package/lib/schema/platform_application.json +0 -2177
- package/lib/tests/common-application-specs.test.d.ts +0 -2
- package/lib/tests/common-application-specs.test.d.ts.map +0 -1
- package/lib/tests/common-application-specs.test.js +0 -45
package/README.md
CHANGED
|
@@ -2,24 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
## 定义
|
|
4
4
|
|
|
5
|
-
CALS 是将前端应用抽象为统一模型, 采用跨端的数据交换格式(如JSON)对前端应用进行标准化描述, 与平台、语言、框架无关的应用规范。
|
|
5
|
+
CALS 是将前端应用抽象为统一模型, 采用跨端的数据交换格式(如 JSON)对前端应用进行标准化描述, 与平台、语言、框架无关的应用规范。
|
|
6
6
|
|
|
7
|
-
通用应用语言规范 :Common Application Language Specification,简称CALS。
|
|
7
|
+
通用应用语言规范 :Common Application Language Specification,简称 CALS。
|
|
8
8
|
|
|
9
9
|
## 组成
|
|
10
10
|
|
|
11
11
|
CALS 规范主要分为三部分 :
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
- 通用组件语言描述([**CLS**](http://cls.pages.oa.com/))
|
|
14
|
+
- 通用数据源描述
|
|
15
|
+
- 通用应用信息描述
|
|
15
16
|
|
|
16
17
|
## 应用
|
|
17
18
|
|
|
18
19
|
CALS 目前主要应用于云开发低码平台,目前定义了 basic 和 platform 两套规范(platform 继承自 basic)
|
|
19
20
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
| **basic** | 基类 |
|
|
23
|
-
| **platform** | 子类 |
|
|
21
|
+
| 类型 | 层级 | 定义 |
|
|
22
|
+
| ------------ | ---- | ------------------------------------------ |
|
|
23
|
+
| **basic** | 基类 | 对外的通用应用规范 |
|
|
24
|
+
| **platform** | 子类 | 对内的低码应用规范,微搭平台运行的实际标准 |
|
|
25
|
+
|
|
26
|
+
## 组件
|
|
27
|
+
|
|
28
|
+
TODO
|
|
29
|
+
|
|
30
|
+
## 数据源
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
TODO
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { getUsedComps } from './utils/common';
|
|
1
2
|
import { IAttributes, IPlatformApp, IComplexComponent, IBasicComponent, IPageComponent, IDataSourceVariable, IDataVarMethod, // 勿删,为了生成d.ts
|
|
2
3
|
IPlatformDataSource, IDependencies, LCDS } from '../../types';
|
|
3
4
|
import { IDynamicValue, PropBindType } from '../expression';
|
|
@@ -29,51 +30,47 @@ interface ISerializeContext {
|
|
|
29
30
|
export declare function serializeValue({ ctx, key, dynamicValue, scope, streamlineDefaultValue, }: {
|
|
30
31
|
ctx: ISerializeContext;
|
|
31
32
|
key: string;
|
|
32
|
-
dynamicValue:
|
|
33
|
-
type?: PropBindType | 'static';
|
|
34
|
-
value: any;
|
|
35
|
-
};
|
|
33
|
+
dynamicValue: IDynamicValue;
|
|
36
34
|
scope?: 'page' | 'component';
|
|
37
35
|
streamlineDefaultValue?: boolean;
|
|
38
36
|
}): {
|
|
39
37
|
key: string;
|
|
40
38
|
value: any;
|
|
39
|
+
extra?: any;
|
|
41
40
|
};
|
|
42
|
-
export declare function deserializeValue(ctx: IDeserializeContext, key: string, value: any): {
|
|
41
|
+
export declare function deserializeValue(ctx: IDeserializeContext, key: string, value: any, extra?: any): {
|
|
43
42
|
key: string;
|
|
44
43
|
value: {
|
|
45
44
|
type: PropBindType;
|
|
46
45
|
value: any;
|
|
46
|
+
extra: any;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
interface ISerializeDynamicMapProps {
|
|
50
50
|
ctx: ISerializeContext;
|
|
51
51
|
map: {
|
|
52
|
-
[key: string]:
|
|
52
|
+
[key: string]: IDynamicValue;
|
|
53
53
|
};
|
|
54
54
|
scope?: 'page' | 'component';
|
|
55
55
|
streamlineDefaultValue?: boolean;
|
|
56
|
-
}
|
|
56
|
+
}
|
|
57
|
+
export declare function serializeDynamicMap(props: ISerializeDynamicMapProps): {
|
|
57
58
|
[key: string]: string;
|
|
58
59
|
};
|
|
59
60
|
export declare function deserializeDynamicMap(ctx: IDeserializeContext, map: {
|
|
60
61
|
[key: string]: string | any;
|
|
62
|
+
}, extraMap?: {
|
|
63
|
+
[key: string]: any;
|
|
61
64
|
}): {
|
|
62
|
-
[key: string]:
|
|
63
|
-
type?: string;
|
|
64
|
-
value: any;
|
|
65
|
-
};
|
|
65
|
+
[key: string]: IDynamicValue;
|
|
66
66
|
};
|
|
67
67
|
export declare function serializeAttributes(ctx: ISerializeContext, scope: 'page' | 'component', attributes?: {
|
|
68
68
|
[key: string]: IDynamicValue;
|
|
69
69
|
}): {
|
|
70
70
|
[key: string]: string;
|
|
71
71
|
};
|
|
72
|
-
export declare function deserializeAttributes(ctx: IDeserializeContext, attributes?: IAttributes): {
|
|
73
|
-
[key: string]:
|
|
74
|
-
type?: string;
|
|
75
|
-
value: any;
|
|
76
|
-
};
|
|
72
|
+
export declare function deserializeAttributes(ctx: IDeserializeContext, attributes?: IAttributes, attributesExtraData?: {}): {
|
|
73
|
+
[key: string]: IDynamicValue;
|
|
77
74
|
};
|
|
78
75
|
export declare function deserializeDataVariables(ctx: IDeserializeContext, data: IDataSourceVariable): {
|
|
79
76
|
title: string;
|
|
@@ -141,31 +138,11 @@ export declare function deserializePage(ctx: {
|
|
|
141
138
|
}[];
|
|
142
139
|
};
|
|
143
140
|
data: {
|
|
144
|
-
[key: string]:
|
|
145
|
-
type?: string;
|
|
146
|
-
value: any;
|
|
147
|
-
};
|
|
141
|
+
[key: string]: IDynamicValue;
|
|
148
142
|
};
|
|
149
143
|
componentInstances: {
|
|
150
144
|
[key: string]: object;
|
|
151
145
|
};
|
|
152
|
-
pluginInstances: {
|
|
153
|
-
data: {
|
|
154
|
-
[key: string]: any;
|
|
155
|
-
};
|
|
156
|
-
dataBinds?: {
|
|
157
|
-
propertyPath: string;
|
|
158
|
-
bindDataPath: string;
|
|
159
|
-
type?: any;
|
|
160
|
-
}[];
|
|
161
|
-
dataTypes?: {
|
|
162
|
-
propertyPath: string;
|
|
163
|
-
type?: "static" | "slot" | "bind";
|
|
164
|
-
}[];
|
|
165
|
-
key: string;
|
|
166
|
-
sourceKey: string;
|
|
167
|
-
instanceFunction?: string;
|
|
168
|
-
};
|
|
169
146
|
commonStyle: object;
|
|
170
147
|
staticResourceAttribute: string[];
|
|
171
148
|
hideAdminPortalMenu: boolean;
|
|
@@ -185,10 +162,7 @@ export declare function deserializePage(ctx: {
|
|
|
185
162
|
moduleName: string;
|
|
186
163
|
};
|
|
187
164
|
data: {
|
|
188
|
-
[key: string]:
|
|
189
|
-
type?: string;
|
|
190
|
-
value: any;
|
|
191
|
-
};
|
|
165
|
+
[key: string]: IDynamicValue;
|
|
192
166
|
};
|
|
193
167
|
isCapturePhase: boolean;
|
|
194
168
|
noPropagation: boolean;
|
|
@@ -234,31 +208,11 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
234
208
|
}[];
|
|
235
209
|
};
|
|
236
210
|
data: {
|
|
237
|
-
[key: string]:
|
|
238
|
-
type?: string;
|
|
239
|
-
value: any;
|
|
240
|
-
};
|
|
211
|
+
[key: string]: IDynamicValue;
|
|
241
212
|
};
|
|
242
213
|
componentInstances: {
|
|
243
214
|
[key: string]: object;
|
|
244
215
|
};
|
|
245
|
-
pluginInstances: {
|
|
246
|
-
data: {
|
|
247
|
-
[key: string]: any;
|
|
248
|
-
};
|
|
249
|
-
dataBinds?: {
|
|
250
|
-
propertyPath: string;
|
|
251
|
-
bindDataPath: string;
|
|
252
|
-
type?: any;
|
|
253
|
-
}[];
|
|
254
|
-
dataTypes?: {
|
|
255
|
-
propertyPath: string;
|
|
256
|
-
type?: "static" | "slot" | "bind";
|
|
257
|
-
}[];
|
|
258
|
-
key: string;
|
|
259
|
-
sourceKey: string;
|
|
260
|
-
instanceFunction?: string;
|
|
261
|
-
};
|
|
262
216
|
commonStyle: object;
|
|
263
217
|
staticResourceAttribute: string[];
|
|
264
218
|
hideAdminPortalMenu: boolean;
|
|
@@ -278,10 +232,7 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
278
232
|
moduleName: string;
|
|
279
233
|
};
|
|
280
234
|
data: {
|
|
281
|
-
[key: string]:
|
|
282
|
-
type?: string;
|
|
283
|
-
value: any;
|
|
284
|
-
};
|
|
235
|
+
[key: string]: IDynamicValue;
|
|
285
236
|
};
|
|
286
237
|
isCapturePhase: boolean;
|
|
287
238
|
noPropagation: boolean;
|
|
@@ -307,6 +258,9 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
307
258
|
updateMethod?: IDataVarMethod;
|
|
308
259
|
}[];
|
|
309
260
|
};
|
|
261
|
+
compHiddenConfig: {
|
|
262
|
+
[pageId: string]: string[];
|
|
263
|
+
};
|
|
310
264
|
npmDependencies: {
|
|
311
265
|
[key: string]: string;
|
|
312
266
|
};
|
|
@@ -336,6 +290,7 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
336
290
|
name: string;
|
|
337
291
|
author: string;
|
|
338
292
|
description: string;
|
|
293
|
+
domain?: string;
|
|
339
294
|
};
|
|
340
295
|
dependencies: IDependencies;
|
|
341
296
|
};
|
|
@@ -389,5 +344,4 @@ export declare function deserializeComponentLibraryMeta(meta: {
|
|
|
389
344
|
};
|
|
390
345
|
};
|
|
391
346
|
};
|
|
392
|
-
export {};
|
|
393
347
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../parser/cals/index.ts"],"names":[],"mappings":"
|
|
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,CAAA;CACtB;AAED,UAAU,iBAAiB;IACzB,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,IAAI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