@cloudbase/cals 0.5.4-beta.0 → 0.5.5-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.
- package/lib/parser/cals/index.d.ts +0 -8
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +2 -22
- package/lib/parser/cals/utils/block/index.d.ts +0 -0
- package/lib/parser/cals/utils/block/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/block/index.js +0 -0
- package/lib/parser/cals/utils/code/index.d.ts +0 -0
- package/lib/parser/cals/utils/code/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/code/index.js +0 -0
- package/lib/parser/cals/utils/common.d.ts +0 -0
- package/lib/parser/cals/utils/common.d.ts.map +0 -0
- package/lib/parser/cals/utils/common.js +0 -0
- package/lib/parser/cals/utils/runtime.d.ts +0 -0
- package/lib/parser/cals/utils/runtime.d.ts.map +0 -0
- package/lib/parser/cals/utils/runtime.js +0 -0
- package/lib/parser/cals/utils/spinoff/index.d.ts +0 -0
- package/lib/parser/cals/utils/spinoff/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/spinoff/index.js +0 -0
- package/lib/parser/cals/utils/style.d.ts +5 -36
- package/lib/parser/cals/utils/style.d.ts.map +1 -1
- package/lib/parser/cals/utils/style.js +70 -102
- package/lib/parser/cals/utils/template.d.ts +0 -1
- package/lib/parser/cals/utils/template.d.ts.map +1 -1
- package/lib/parser/cals/utils/template.js +2 -3
- package/lib/parser/cals/utils/version/common.d.ts +0 -0
- package/lib/parser/cals/utils/version/common.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/common.js +0 -0
- package/lib/parser/cals/utils/version/config.d.ts +0 -0
- package/lib/parser/cals/utils/version/config.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/config.js +0 -0
- package/lib/parser/cals/utils/version/index.d.ts +0 -0
- package/lib/parser/cals/utils/version/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/index.js +0 -0
- package/lib/parser/cals/utils/version/parses.d.ts +0 -0
- package/lib/parser/cals/utils/version/parses.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/parses.js +0 -0
- package/lib/parser/cals/utils/version/utils.d.ts +0 -0
- package/lib/parser/cals/utils/version/utils.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/utils.js +0 -0
- package/lib/parser/expression/index.d.ts +0 -0
- package/lib/parser/expression/index.d.ts.map +0 -0
- package/lib/parser/expression/index.js +0 -0
- package/lib/parser/index.d.ts +1 -2
- package/lib/parser/index.d.ts.map +1 -1
- package/lib/parser/index.js +1 -7
- package/lib/types/basic/app.d.ts +0 -0
- package/lib/types/basic/app.d.ts.map +0 -0
- package/lib/types/basic/app.js +0 -0
- package/lib/types/basic/common.d.ts +0 -0
- package/lib/types/basic/common.d.ts.map +0 -0
- package/lib/types/basic/common.js +0 -0
- package/lib/types/basic/component.d.ts +0 -0
- package/lib/types/basic/component.d.ts.map +0 -0
- package/lib/types/basic/component.js +0 -0
- package/lib/types/basic/datasource.d.ts +0 -0
- package/lib/types/basic/datasource.d.ts.map +0 -0
- package/lib/types/basic/datasource.js +0 -0
- package/lib/types/index.d.ts +0 -0
- package/lib/types/index.d.ts.map +0 -0
- package/lib/types/index.js +0 -0
- package/lib/types/lcds.d.ts +0 -0
- package/lib/types/lcds.d.ts.map +0 -0
- package/lib/types/lcds.js +0 -0
- package/lib/types/platform/app.d.ts +0 -21
- package/lib/types/platform/app.d.ts.map +1 -1
- package/lib/types/platform/app.js +0 -9
- package/lib/types/platform/common.d.ts +0 -0
- package/lib/types/platform/common.d.ts.map +0 -0
- package/lib/types/platform/common.js +0 -0
- package/lib/types/platform/component.d.ts +0 -0
- package/lib/types/platform/component.d.ts.map +0 -0
- package/lib/types/platform/component.js +0 -0
- package/lib/types/platform/datasource.d.ts +0 -0
- package/lib/types/platform/datasource.d.ts.map +0 -0
- package/lib/types/platform/datasource.js +0 -0
- package/lib/types/platform/widget/form.d.ts +0 -0
- package/lib/types/platform/widget/form.d.ts.map +0 -0
- package/lib/types/platform/widget/form.js +0 -0
- package/lib/types/platform/widget/meta.d.ts +0 -0
- package/lib/types/platform/widget/meta.d.ts.map +0 -0
- package/lib/types/platform/widget/meta.js +0 -0
- package/lib/utils/CSSProperty.d.ts +0 -0
- package/lib/utils/CSSProperty.d.ts.map +0 -0
- package/lib/utils/CSSProperty.js +0 -0
- package/lib/utils/build.d.ts +0 -0
- package/lib/utils/build.d.ts.map +0 -0
- package/lib/utils/build.js +0 -0
- package/lib/utils/constant.d.ts +0 -0
- package/lib/utils/constant.d.ts.map +0 -0
- package/lib/utils/constant.js +0 -0
- package/lib/utils/dts/auto-generated.d.ts +1 -1
- package/lib/utils/dts/auto-generated.d.ts.map +1 -1
- package/lib/utils/dts/auto-generated.js +92 -1
- package/lib/utils/dts/build.js +2 -0
- package/lib/utils/dts/index.d.ts +33 -6
- package/lib/utils/dts/index.d.ts.map +1 -1
- package/lib/utils/dts/index.js +168 -39
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -1
- package/package.json +1 -1
- package/lib/parser/plugins/postcss-rpx2clac.d.ts +0 -18
- package/lib/parser/plugins/postcss-rpx2clac.d.ts.map +0 -1
- package/lib/parser/plugins/postcss-rpx2clac.js +0 -68
|
@@ -289,7 +289,6 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
289
289
|
isMiniProgramPlugins?: boolean;
|
|
290
290
|
})[];
|
|
291
291
|
}[];
|
|
292
|
-
externalResources: import("../../types").IExternalResource[];
|
|
293
292
|
extra: {
|
|
294
293
|
name: string;
|
|
295
294
|
author: string;
|
|
@@ -357,12 +356,5 @@ export declare function deserializeComponentLibraryMeta(meta: {
|
|
|
357
356
|
};
|
|
358
357
|
export declare function processRuntimeCodeResources(ctx: {
|
|
359
358
|
id: string;
|
|
360
|
-
version?: string;
|
|
361
359
|
}, resources: any[], scope: string): any[];
|
|
362
|
-
/**
|
|
363
|
-
* 解析 cals version 来生成 feature map
|
|
364
|
-
*/
|
|
365
|
-
export declare function parseVersion(version?: string): {
|
|
366
|
-
defaultDynamicCssUnit: boolean;
|
|
367
|
-
};
|
|
368
360
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parser/cals/index.ts"],"names":[],"mappings":"AAIA,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,CAAC;AAErB,OAAO,EAAkC,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAgB5F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACtB,SAAS,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE;;;OAGG;IACH,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,c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M;sBACH,MAAM;;;6BACwB,OAAO;;;wBACnC,MAAM;;;;;;EAiCvB;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,SAAS,OAAyB,EAAE,KAAK,EAAE,MAAM,SAiCjH"}
|
package/lib/parser/cals/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
14
|
+
exports.processRuntimeCodeResources = 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.generateDefaultCode = exports.getUsedComps = void 0;
|
|
15
15
|
const lodash_1 = require("lodash");
|
|
16
16
|
const common_1 = require("../../types/platform/common");
|
|
17
17
|
const expression_1 = require("../expression");
|
|
@@ -781,7 +781,7 @@ exports.deserializePage = deserializePage;
|
|
|
781
781
|
*/
|
|
782
782
|
function serializePlatformApp(data, optsions) {
|
|
783
783
|
var _a;
|
|
784
|
-
let { version, author, name, label, description, selectedPageId, pageInstanceList, lowCodes = [], datasources, vars, dataset, extra, dependencies: calsDependencies, miniprogramPlugins, lastDependencies
|
|
784
|
+
let { version, author, name, label, description, selectedPageId, pageInstanceList, lowCodes = [], datasources, vars, dataset, extra, dependencies: calsDependencies, miniprogramPlugins, lastDependencies } = data, restData = __rest(data, ["version", "author", "name", "label", "description", "selectedPageId", "pageInstanceList", "lowCodes", "datasources", "vars", "dataset", "extra", "dependencies", "miniprogramPlugins", "lastDependencies"]);
|
|
785
785
|
let { dependencies = [] } = optsions || {};
|
|
786
786
|
const _b = extra || {}, { name: extraName, label: extraLabel, author: extraAuthor, description: extraDescription } = _b, restExtra = __rest(_b, ["name", "label", "author", "description"]);
|
|
787
787
|
const ctx = {
|
|
@@ -796,7 +796,6 @@ function serializePlatformApp(data, optsions) {
|
|
|
796
796
|
author: author || extraAuthor,
|
|
797
797
|
version,
|
|
798
798
|
description: description || extraDescription,
|
|
799
|
-
externalResources,
|
|
800
799
|
main: homePage ? homePage.id : ((_a = pageInstanceList === null || pageInstanceList === void 0 ? void 0 : pageInstanceList[0]) === null || _a === void 0 ? void 0 : _a.id) || selectedPageId,
|
|
801
800
|
items: pageInstanceList === null || pageInstanceList === void 0 ? void 0 : pageInstanceList.map((page) => serializePage(ctx, page)),
|
|
802
801
|
resources: lowCodes === null || lowCodes === void 0 ? void 0 : lowCodes.map((item) => serializeCodeSource(ctx, item)),
|
|
@@ -855,7 +854,6 @@ function deserializePlatformApp(data, optsions) {
|
|
|
855
854
|
presetColors: presetColors || [],
|
|
856
855
|
appConfig,
|
|
857
856
|
miniprogramPlugins,
|
|
858
|
-
externalResources: data.externalResources,
|
|
859
857
|
extra: Object.assign(Object.assign({}, restExtra), { name: data.name, author: data.author, description: data.description, lastDependencies }),
|
|
860
858
|
dependencies: data.dependencies,
|
|
861
859
|
// TODO
|
|
@@ -1075,21 +1073,3 @@ function processRuntimeCodeResources(ctx, resources /* : IWeappCode[]*/ = [], sc
|
|
|
1075
1073
|
return resources.filter((m) => m.name !== common_1.ECodeName.PLACEHOLDER);
|
|
1076
1074
|
}
|
|
1077
1075
|
exports.processRuntimeCodeResources = processRuntimeCodeResources;
|
|
1078
|
-
/**
|
|
1079
|
-
* 解析 cals version 来生成 feature map
|
|
1080
|
-
*/
|
|
1081
|
-
function parseVersion(version = '') {
|
|
1082
|
-
const list = version.split('.');
|
|
1083
|
-
const FEATURE_MAP = {
|
|
1084
|
-
/**
|
|
1085
|
-
* 默认单位为 px,
|
|
1086
|
-
* 然后进行动态转换 为 rem及rpx
|
|
1087
|
-
*/
|
|
1088
|
-
defaultDynamicCssUnit: true,
|
|
1089
|
-
};
|
|
1090
|
-
if (list[0] === '4' || version === 'latest') {
|
|
1091
|
-
FEATURE_MAP.defaultDynamicCssUnit = false;
|
|
1092
|
-
}
|
|
1093
|
-
return FEATURE_MAP;
|
|
1094
|
-
}
|
|
1095
|
-
exports.parseVersion = parseVersion;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,43 +1,12 @@
|
|
|
1
1
|
import { Properties } from 'csstype';
|
|
2
2
|
export declare function removeInvalidStyleFormValue(styleForm?: any): any;
|
|
3
|
-
/**
|
|
4
|
-
* Convert WeApps common style to css styles(React.CSSProperties)
|
|
5
|
-
* toRem/toRpx/toRpx 三者互斥 @deprecated
|
|
6
|
-
* 应使用 defaultUnit 来声明
|
|
7
|
-
*/
|
|
8
3
|
export declare function processCommonStyle2CSSProperties(commonStyle?: any, options?: {
|
|
9
|
-
|
|
10
|
-
* 默认 px/无单位 转 rem
|
|
11
|
-
* @deprecated
|
|
12
|
-
*/
|
|
13
|
-
toRem?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* 默认 px/无单位 转为rpx
|
|
16
|
-
* @deprecated
|
|
17
|
-
*/
|
|
18
|
-
toRpx?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* px/无单位情况下 处理为何单位
|
|
21
|
-
* rem | rpx | px
|
|
22
|
-
* 优先级高于以上
|
|
23
|
-
*/
|
|
24
|
-
defaultUnit?: 'rem' | 'px' | 'rpx';
|
|
25
|
-
/**
|
|
26
|
-
* 是否使用 calc(xx px / `${rpxCalcRoot}`) 来模拟rpx
|
|
27
|
-
* 小程序不需要转
|
|
28
|
-
*/
|
|
29
|
-
rpxCalcRoot?: string;
|
|
4
|
+
toRem: boolean;
|
|
30
5
|
ignoreSelf?: boolean;
|
|
31
6
|
addPXUnit?: boolean;
|
|
7
|
+
toRpx?: boolean;
|
|
8
|
+
}): Properties<string | number>;
|
|
9
|
+
export declare function processCSSProperties2Rem(style?: Properties<string | number>, options?: {
|
|
10
|
+
looseError: boolean;
|
|
32
11
|
}): Properties<string | number>;
|
|
33
|
-
interface ITranslateStyleOptions {
|
|
34
|
-
looseError?: boolean;
|
|
35
|
-
rpxCalcRoot?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated
|
|
39
|
-
*/
|
|
40
|
-
export declare function processCSSProperties2Rem(style?: Properties<string | number>, options?: ITranslateStyleOptions): Properties<string | number>;
|
|
41
|
-
export declare function processCSSPropertiesUnit(style: Properties<string | number>, type: 'px' | 'rem' | 'rpx', options?: ITranslateStyleOptions): {};
|
|
42
|
-
export {};
|
|
43
12
|
//# sourceMappingURL=style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMrC,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF;
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMrC,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF;AA+ID,wBAAgB,gCAAgC,CAC9C,WAAW,GAAE,GAAQ,EACrB,OAAO,GAAE;IACP,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACoD,GACrE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAgU7B;AASD,wBAAgB,wBAAwB,CACtC,KAAK,GAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,OAAO;;CAAwB,GAC9B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAE7B"}
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
14
|
+
exports.processCSSProperties2Rem = exports.processCommonStyle2CSSProperties = exports.removeInvalidStyleFormValue = void 0;
|
|
15
15
|
const common_1 = require("./common");
|
|
16
16
|
const lodash_1 = require("lodash");
|
|
17
17
|
const utils_1 = require("../../../utils");
|
|
@@ -50,12 +50,10 @@ function setStyleValue(object, key, value) {
|
|
|
50
50
|
}
|
|
51
51
|
function _handleStyleNumValue(styleVal, addPXUnit) {
|
|
52
52
|
if (addPXUnit) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* 改分支未启用
|
|
56
|
-
*/
|
|
53
|
+
// 该分支实际没有使用?
|
|
54
|
+
// styleValue = '0.2' 时处理有问题
|
|
57
55
|
const value = `${styleVal}`;
|
|
58
|
-
if (/^\d
|
|
56
|
+
if (value.search(/^\d+$/) >= 0) {
|
|
59
57
|
return `${value}px`;
|
|
60
58
|
}
|
|
61
59
|
}
|
|
@@ -86,8 +84,7 @@ function setDistanceStyle(style, distance, attr, addPXUnit) {
|
|
|
86
84
|
});
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
|
-
function translateStyleByHandler(style = {}, handler, options) {
|
|
90
|
-
const { looseError = false, rpxCalcRoot } = options || {};
|
|
87
|
+
function translateStyleByHandler(style = {}, handler, options = { looseError: false }) {
|
|
91
88
|
return Object.keys(style).reduce((result, key) => {
|
|
92
89
|
const value = style[key];
|
|
93
90
|
if (utils_1.isUnitlessNumber[key]) {
|
|
@@ -95,10 +92,10 @@ function translateStyleByHandler(style = {}, handler, options) {
|
|
|
95
92
|
}
|
|
96
93
|
else if (value !== undefined && value !== null) {
|
|
97
94
|
try {
|
|
98
|
-
setStyleValue(result, key, handler(value
|
|
95
|
+
setStyleValue(result, key, handler(value));
|
|
99
96
|
}
|
|
100
97
|
catch (e) {
|
|
101
|
-
if (looseError) {
|
|
98
|
+
if (options.looseError) {
|
|
102
99
|
console.warn('translate style error, key:value', key, value);
|
|
103
100
|
}
|
|
104
101
|
else {
|
|
@@ -109,77 +106,51 @@ function translateStyleByHandler(style = {}, handler, options) {
|
|
|
109
106
|
return result;
|
|
110
107
|
}, {});
|
|
111
108
|
}
|
|
112
|
-
function
|
|
113
|
-
if (
|
|
114
|
-
|
|
109
|
+
function calPxToREM(px) {
|
|
110
|
+
if (Number.isNaN(px / 28))
|
|
111
|
+
return px.toString();
|
|
112
|
+
if (+px === 0) {
|
|
113
|
+
return '0';
|
|
114
|
+
}
|
|
115
|
+
return `${(px / 28).toFixed(4)}rem`;
|
|
116
|
+
}
|
|
117
|
+
function toREM(cssLen) {
|
|
118
|
+
if (typeof cssLen === 'string') {
|
|
119
|
+
const cssLenArr = cssLen.split(' ');
|
|
115
120
|
return cssLenArr
|
|
116
121
|
.map((attr) => {
|
|
117
|
-
const matchResult = attr.match(/^(-?\d+)(
|
|
122
|
+
const matchResult = attr.match(/^(-?\d+)(px)?$/);
|
|
118
123
|
if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) {
|
|
119
|
-
|
|
120
|
-
if (Number.isNaN(px / 1))
|
|
121
|
-
return px.toString();
|
|
122
|
-
if (+px === 0) {
|
|
123
|
-
return '0';
|
|
124
|
-
}
|
|
125
|
-
if ((matchResult === null || matchResult === void 0 ? void 0 : matchResult[2]) === 'rpx') {
|
|
126
|
-
return rpxCalcRoot ? `calc(${px}px / ${rpxCalcRoot})` : attr;
|
|
127
|
-
}
|
|
128
|
-
return `${(px / 28).toFixed(4)}rem`;
|
|
124
|
+
return calPxToREM(+matchResult[1]);
|
|
129
125
|
}
|
|
130
126
|
return attr;
|
|
131
127
|
})
|
|
132
128
|
.join(' ');
|
|
133
129
|
}
|
|
130
|
+
else if (typeof cssLen === 'number') {
|
|
131
|
+
return calPxToREM(cssLen);
|
|
132
|
+
}
|
|
134
133
|
else {
|
|
135
134
|
throw new Error('cssLen type error ' + cssLen);
|
|
136
135
|
}
|
|
137
136
|
}
|
|
138
|
-
function toRPX(cssLen
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return px.toString();
|
|
147
|
-
if (+px === 0) {
|
|
148
|
-
return '0';
|
|
149
|
-
}
|
|
150
|
-
return rpxCalcRoot ? `calc(${px}px / ${rpxCalcRoot})` : `${px}rpx`;
|
|
151
|
-
}
|
|
152
|
-
return attr;
|
|
153
|
-
})
|
|
154
|
-
.join(' ');
|
|
155
|
-
}
|
|
156
|
-
function toPX(cssLen, rpxCalcRoot = undefined) {
|
|
157
|
-
const cssLenArr = `${cssLen}`.split(' ');
|
|
158
|
-
return cssLenArr
|
|
159
|
-
.map((attr) => {
|
|
160
|
-
const matchResult = attr.match(/^(-?\d+)(rpx)?$/);
|
|
161
|
-
if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) {
|
|
162
|
-
const px = +matchResult[1];
|
|
163
|
-
if (Number.isNaN(px / 1))
|
|
164
|
-
return px.toString();
|
|
165
|
-
if (+px === 0) {
|
|
166
|
-
return '0';
|
|
167
|
-
}
|
|
168
|
-
if ((matchResult === null || matchResult === void 0 ? void 0 : matchResult[2]) === 'rpx') {
|
|
169
|
-
return rpxCalcRoot ? `calc(${px}px / ${rpxCalcRoot})` : attr;
|
|
137
|
+
function toRPX(cssLen) {
|
|
138
|
+
if (typeof cssLen === 'string') {
|
|
139
|
+
const cssLenArr = cssLen.split(' ');
|
|
140
|
+
return cssLenArr
|
|
141
|
+
.map((attr) => {
|
|
142
|
+
const matchResult = attr.match(/^(-?\d+)(px)?$/);
|
|
143
|
+
if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) {
|
|
144
|
+
return `${+matchResult[1]}rpx`;
|
|
170
145
|
}
|
|
171
|
-
return
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
146
|
+
return attr;
|
|
147
|
+
})
|
|
148
|
+
.join(' ');
|
|
149
|
+
}
|
|
150
|
+
return `${cssLen}rpx`;
|
|
176
151
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
* toRem/toRpx/toRpx 三者互斥 @deprecated
|
|
180
|
-
* 应使用 defaultUnit 来声明
|
|
181
|
-
*/
|
|
182
|
-
function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: true, ignoreSelf: false, addPXUnit: false, toRpx: false, rpxCalcRoot: undefined }) {
|
|
152
|
+
// Convert WeApps common style to css styles(React.CSSProperties)
|
|
153
|
+
function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: true, ignoreSelf: false, addPXUnit: false, toRpx: false }) {
|
|
183
154
|
const { size,
|
|
184
155
|
// transform,
|
|
185
156
|
text, border, background, margin, padding, zIndex, position, display, flexConfig, custom, self, boxShadow, } = commonStyle;
|
|
@@ -380,13 +351,27 @@ function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: t
|
|
|
380
351
|
currentBoxShadowStyleString = 'inset ';
|
|
381
352
|
}
|
|
382
353
|
// offsetX
|
|
383
|
-
|
|
354
|
+
if (!!offsetX) {
|
|
355
|
+
currentBoxShadowStyleString += _handleStyleNumValue(offsetX, !!options.addPXUnit);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
currentBoxShadowStyleString += '0';
|
|
359
|
+
}
|
|
384
360
|
// offsetY
|
|
385
|
-
|
|
361
|
+
if (!!offsetY) {
|
|
362
|
+
currentBoxShadowStyleString += ' ' + _handleStyleNumValue(offsetY, !!options.addPXUnit);
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
currentBoxShadowStyleString += ' 0';
|
|
366
|
+
}
|
|
386
367
|
// blur-radius 当 spread-radius 存在时,即使不存在 blur-radius,blur-radius 也要为 0
|
|
387
368
|
if (!!blurRadius || !!spreadRadius) {
|
|
388
|
-
|
|
389
|
-
' ' + _handleStyleNumValue(
|
|
369
|
+
if (!!blurRadius) {
|
|
370
|
+
currentBoxShadowStyleString += ' ' + _handleStyleNumValue(blurRadius, !!options.addPXUnit);
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
currentBoxShadowStyleString += ' 0';
|
|
374
|
+
}
|
|
390
375
|
}
|
|
391
376
|
// spread-radius
|
|
392
377
|
if (!!spreadRadius) {
|
|
@@ -398,7 +383,13 @@ function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: t
|
|
|
398
383
|
}
|
|
399
384
|
}
|
|
400
385
|
if (!!currentBoxShadowStyleString) {
|
|
401
|
-
|
|
386
|
+
let splitLabel;
|
|
387
|
+
if (!!boxShadowStyleString) {
|
|
388
|
+
splitLabel = ' , ';
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
splitLabel = '';
|
|
392
|
+
}
|
|
402
393
|
boxShadowStyleString += splitLabel + currentBoxShadowStyleString;
|
|
403
394
|
}
|
|
404
395
|
});
|
|
@@ -422,39 +413,16 @@ function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: t
|
|
|
422
413
|
style[key] = value[value.length - 1];
|
|
423
414
|
}
|
|
424
415
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
if (!defaultUnit) {
|
|
428
|
-
if (options.toRpx) {
|
|
429
|
-
defaultUnit = 'rpx';
|
|
430
|
-
}
|
|
431
|
-
if (options.toRem) {
|
|
432
|
-
defaultUnit = 'rem';
|
|
433
|
-
}
|
|
416
|
+
if (options.toRpx) {
|
|
417
|
+
return translateStyleToRpx(style);
|
|
434
418
|
}
|
|
435
|
-
|
|
436
|
-
return processCSSPropertiesUnit(style, defaultUnit, translateStyleOptions);
|
|
437
|
-
}
|
|
438
|
-
return style;
|
|
419
|
+
return options.toRem ? processCSSProperties2Rem(style) : style;
|
|
439
420
|
}
|
|
440
421
|
exports.processCommonStyle2CSSProperties = processCommonStyle2CSSProperties;
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
function processCSSProperties2Rem(style = {}, options) {
|
|
422
|
+
function translateStyleToRpx(style = {}, options = { looseError: false }) {
|
|
423
|
+
return translateStyleByHandler(style, toRPX, options);
|
|
424
|
+
}
|
|
425
|
+
function processCSSProperties2Rem(style = {}, options = { looseError: false }) {
|
|
445
426
|
return translateStyleByHandler(style, toREM, options);
|
|
446
427
|
}
|
|
447
428
|
exports.processCSSProperties2Rem = processCSSProperties2Rem;
|
|
448
|
-
function processCSSPropertiesUnit(style = {}, type, options) {
|
|
449
|
-
const handerMap = {
|
|
450
|
-
px: toPX,
|
|
451
|
-
rem: toREM,
|
|
452
|
-
rpx: toRPX,
|
|
453
|
-
};
|
|
454
|
-
const handler = handerMap[type] ||
|
|
455
|
-
function (cssLen, _) {
|
|
456
|
-
return cssLen;
|
|
457
|
-
};
|
|
458
|
-
return translateStyleByHandler(style, handler, options);
|
|
459
|
-
}
|
|
460
|
-
exports.processCSSPropertiesUnit = processCSSPropertiesUnit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAqM3C,wBAAgB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAqM3C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK,UA2B5G"}
|
|
@@ -159,7 +159,7 @@ export function sayHi() {
|
|
|
159
159
|
// 使用theme中的变量
|
|
160
160
|
// color: <% if (type === 'app' || type === 'page') { %>@example-primary-color<% } %><% if (type === 'component') { %>blue<% } %>;
|
|
161
161
|
|
|
162
|
-
//
|
|
162
|
+
// 默认 px 会转换成 rem,含大写字母 PX 和 Px 则不会转换
|
|
163
163
|
// margin-top: 20px;
|
|
164
164
|
// 使用theme中的混合(mixins)
|
|
165
165
|
// <%= type === 'component' ? '':'.mixins();' %>
|
|
@@ -198,11 +198,10 @@ export default function(props) {
|
|
|
198
198
|
}`,
|
|
199
199
|
};
|
|
200
200
|
function generateDefaultCode(ctx, type, scope) {
|
|
201
|
-
const { id
|
|
201
|
+
const { id } = ctx;
|
|
202
202
|
const data = {
|
|
203
203
|
type: scope,
|
|
204
204
|
id,
|
|
205
|
-
version,
|
|
206
205
|
};
|
|
207
206
|
switch (type) {
|
|
208
207
|
case types_1.ECodeType.LIFECYCLE: {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/parser/index.d.ts
CHANGED
|
@@ -4,6 +4,5 @@ export { processComponentModule } from './cals/utils/spinoff';
|
|
|
4
4
|
export { calsToCode, codeToCals, ICodeItem, checkForConflicts, autoResolveConflicts } from './cals/utils/code';
|
|
5
5
|
export { parseComponentCals } from './cals/utils/block';
|
|
6
6
|
export { ActionType, IDataBind, PropBindType } from './expression/index';
|
|
7
|
-
export { processCommonStyle2CSSProperties, processCSSProperties2Rem
|
|
8
|
-
export { default as PostcssRpx2Calc } from './plugins/postcss-rpx2clac';
|
|
7
|
+
export { processCommonStyle2CSSProperties, processCSSProperties2Rem } from './cals/utils/style';
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/G,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/G,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/lib/parser/index.js
CHANGED
|
@@ -13,11 +13,8 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
17
|
+
exports.processCSSProperties2Rem = exports.processCommonStyle2CSSProperties = exports.PropBindType = exports.ActionType = exports.parseComponentCals = exports.autoResolveConflicts = exports.checkForConflicts = exports.codeToCals = exports.calsToCode = exports.processComponentModule = exports.upgrageToVersion2 = void 0;
|
|
21
18
|
__exportStar(require("./cals/index"), exports);
|
|
22
19
|
var version_1 = require("./cals/utils/version");
|
|
23
20
|
Object.defineProperty(exports, "upgrageToVersion2", { enumerable: true, get: function () { return version_1.upgrageToVersion2; } });
|
|
@@ -36,6 +33,3 @@ Object.defineProperty(exports, "PropBindType", { enumerable: true, get: function
|
|
|
36
33
|
var style_1 = require("./cals/utils/style");
|
|
37
34
|
Object.defineProperty(exports, "processCommonStyle2CSSProperties", { enumerable: true, get: function () { return style_1.processCommonStyle2CSSProperties; } });
|
|
38
35
|
Object.defineProperty(exports, "processCSSProperties2Rem", { enumerable: true, get: function () { return style_1.processCSSProperties2Rem; } });
|
|
39
|
-
Object.defineProperty(exports, "processCSSPropertiesUnit", { enumerable: true, get: function () { return style_1.processCSSPropertiesUnit; } });
|
|
40
|
-
var postcss_rpx2clac_1 = require("./plugins/postcss-rpx2clac");
|
|
41
|
-
Object.defineProperty(exports, "PostcssRpx2Calc", { enumerable: true, get: function () { return __importDefault(postcss_rpx2clac_1).default; } });
|
package/lib/types/basic/app.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/types/basic/app.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/index.d.ts
CHANGED
|
File without changes
|
package/lib/types/index.d.ts.map
CHANGED
|
File without changes
|
package/lib/types/index.js
CHANGED
|
File without changes
|
package/lib/types/lcds.d.ts
CHANGED
|
File without changes
|
package/lib/types/lcds.d.ts.map
CHANGED
|
File without changes
|
package/lib/types/lcds.js
CHANGED
|
File without changes
|