@cloudbase/cals 0.3.20 → 0.3.22-alpha.2
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 +21 -67
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +137 -100
- package/lib/parser/cals/utils/block/index.js +2 -2
- 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/cals/utils/version/utils.d.ts +4 -4
- package/lib/parser/cals/utils/version/utils.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/lib/types/platform/widget/form.js +0 -1
- package/package.json +5 -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
|
|
@@ -30,51 +30,47 @@ interface ISerializeContext {
|
|
|
30
30
|
export declare function serializeValue({ ctx, key, dynamicValue, scope, streamlineDefaultValue, }: {
|
|
31
31
|
ctx: ISerializeContext;
|
|
32
32
|
key: string;
|
|
33
|
-
dynamicValue:
|
|
34
|
-
type?: PropBindType | 'static';
|
|
35
|
-
value: any;
|
|
36
|
-
};
|
|
33
|
+
dynamicValue: IDynamicValue;
|
|
37
34
|
scope?: 'page' | 'component';
|
|
38
35
|
streamlineDefaultValue?: boolean;
|
|
39
36
|
}): {
|
|
40
37
|
key: string;
|
|
41
38
|
value: any;
|
|
39
|
+
extra?: any;
|
|
42
40
|
};
|
|
43
|
-
export declare function deserializeValue(ctx: IDeserializeContext, key: string, value: any): {
|
|
41
|
+
export declare function deserializeValue(ctx: IDeserializeContext, key: string, value: any, extra?: any): {
|
|
44
42
|
key: string;
|
|
45
43
|
value: {
|
|
46
44
|
type: PropBindType;
|
|
47
45
|
value: any;
|
|
46
|
+
extra: any;
|
|
48
47
|
};
|
|
49
48
|
};
|
|
50
|
-
|
|
49
|
+
interface ISerializeDynamicMapProps {
|
|
51
50
|
ctx: ISerializeContext;
|
|
52
51
|
map: {
|
|
53
|
-
[key: string]:
|
|
52
|
+
[key: string]: IDynamicValue;
|
|
54
53
|
};
|
|
55
54
|
scope?: 'page' | 'component';
|
|
56
55
|
streamlineDefaultValue?: boolean;
|
|
57
|
-
}
|
|
56
|
+
}
|
|
57
|
+
export declare function serializeDynamicMap(props: ISerializeDynamicMapProps): {
|
|
58
58
|
[key: string]: string;
|
|
59
59
|
};
|
|
60
60
|
export declare function deserializeDynamicMap(ctx: IDeserializeContext, map: {
|
|
61
61
|
[key: string]: string | any;
|
|
62
|
+
}, extraMap?: {
|
|
63
|
+
[key: string]: any;
|
|
62
64
|
}): {
|
|
63
|
-
[key: string]:
|
|
64
|
-
type?: string;
|
|
65
|
-
value: any;
|
|
66
|
-
};
|
|
65
|
+
[key: string]: IDynamicValue;
|
|
67
66
|
};
|
|
68
67
|
export declare function serializeAttributes(ctx: ISerializeContext, scope: 'page' | 'component', attributes?: {
|
|
69
68
|
[key: string]: IDynamicValue;
|
|
70
69
|
}): {
|
|
71
70
|
[key: string]: string;
|
|
72
71
|
};
|
|
73
|
-
export declare function deserializeAttributes(ctx: IDeserializeContext, attributes?: IAttributes): {
|
|
74
|
-
[key: string]:
|
|
75
|
-
type?: string;
|
|
76
|
-
value: any;
|
|
77
|
-
};
|
|
72
|
+
export declare function deserializeAttributes(ctx: IDeserializeContext, attributes?: IAttributes, attributesExtraData?: {}): {
|
|
73
|
+
[key: string]: IDynamicValue;
|
|
78
74
|
};
|
|
79
75
|
export declare function deserializeDataVariables(ctx: IDeserializeContext, data: IDataSourceVariable): {
|
|
80
76
|
title: string;
|
|
@@ -142,31 +138,11 @@ export declare function deserializePage(ctx: {
|
|
|
142
138
|
}[];
|
|
143
139
|
};
|
|
144
140
|
data: {
|
|
145
|
-
[key: string]:
|
|
146
|
-
type?: string;
|
|
147
|
-
value: any;
|
|
148
|
-
};
|
|
141
|
+
[key: string]: IDynamicValue;
|
|
149
142
|
};
|
|
150
143
|
componentInstances: {
|
|
151
144
|
[key: string]: object;
|
|
152
145
|
};
|
|
153
|
-
pluginInstances: {
|
|
154
|
-
data: {
|
|
155
|
-
[key: string]: any;
|
|
156
|
-
};
|
|
157
|
-
dataBinds?: {
|
|
158
|
-
propertyPath: string;
|
|
159
|
-
bindDataPath: string;
|
|
160
|
-
type?: any;
|
|
161
|
-
}[];
|
|
162
|
-
dataTypes?: {
|
|
163
|
-
propertyPath: string;
|
|
164
|
-
type?: "static" | "slot" | "bind";
|
|
165
|
-
}[];
|
|
166
|
-
key: string;
|
|
167
|
-
sourceKey: string;
|
|
168
|
-
instanceFunction?: string;
|
|
169
|
-
};
|
|
170
146
|
commonStyle: object;
|
|
171
147
|
staticResourceAttribute: string[];
|
|
172
148
|
hideAdminPortalMenu: boolean;
|
|
@@ -186,10 +162,7 @@ export declare function deserializePage(ctx: {
|
|
|
186
162
|
moduleName: string;
|
|
187
163
|
};
|
|
188
164
|
data: {
|
|
189
|
-
[key: string]:
|
|
190
|
-
type?: string;
|
|
191
|
-
value: any;
|
|
192
|
-
};
|
|
165
|
+
[key: string]: IDynamicValue;
|
|
193
166
|
};
|
|
194
167
|
isCapturePhase: boolean;
|
|
195
168
|
noPropagation: boolean;
|
|
@@ -235,31 +208,11 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
235
208
|
}[];
|
|
236
209
|
};
|
|
237
210
|
data: {
|
|
238
|
-
[key: string]:
|
|
239
|
-
type?: string;
|
|
240
|
-
value: any;
|
|
241
|
-
};
|
|
211
|
+
[key: string]: IDynamicValue;
|
|
242
212
|
};
|
|
243
213
|
componentInstances: {
|
|
244
214
|
[key: string]: object;
|
|
245
215
|
};
|
|
246
|
-
pluginInstances: {
|
|
247
|
-
data: {
|
|
248
|
-
[key: string]: any;
|
|
249
|
-
};
|
|
250
|
-
dataBinds?: {
|
|
251
|
-
propertyPath: string;
|
|
252
|
-
bindDataPath: string;
|
|
253
|
-
type?: any;
|
|
254
|
-
}[];
|
|
255
|
-
dataTypes?: {
|
|
256
|
-
propertyPath: string;
|
|
257
|
-
type?: "static" | "slot" | "bind";
|
|
258
|
-
}[];
|
|
259
|
-
key: string;
|
|
260
|
-
sourceKey: string;
|
|
261
|
-
instanceFunction?: string;
|
|
262
|
-
};
|
|
263
216
|
commonStyle: object;
|
|
264
217
|
staticResourceAttribute: string[];
|
|
265
218
|
hideAdminPortalMenu: boolean;
|
|
@@ -279,10 +232,7 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
279
232
|
moduleName: string;
|
|
280
233
|
};
|
|
281
234
|
data: {
|
|
282
|
-
[key: string]:
|
|
283
|
-
type?: string;
|
|
284
|
-
value: any;
|
|
285
|
-
};
|
|
235
|
+
[key: string]: IDynamicValue;
|
|
286
236
|
};
|
|
287
237
|
isCapturePhase: boolean;
|
|
288
238
|
noPropagation: boolean;
|
|
@@ -308,6 +258,9 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
308
258
|
updateMethod?: IDataVarMethod;
|
|
309
259
|
}[];
|
|
310
260
|
};
|
|
261
|
+
compHiddenConfig: {
|
|
262
|
+
[pageId: string]: string[];
|
|
263
|
+
};
|
|
311
264
|
npmDependencies: {
|
|
312
265
|
[key: string]: string;
|
|
313
266
|
};
|
|
@@ -337,6 +290,7 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
337
290
|
name: string;
|
|
338
291
|
author: string;
|
|
339
292
|
description: string;
|
|
293
|
+
domain?: string;
|
|
340
294
|
};
|
|
341
295
|
dependencies: IDependencies;
|
|
342
296
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../parser/cals/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,
|
|
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,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IACrB,SAAS,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/D;;;OAGG;IACH,YAAY,CAAC,EAAE,GAAG,EAAE,CAAA;IACpB,eAAe,CAAC,EAAE,GAAG,CAAA;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,oBAAoB,CAAC,E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