@cloudbase/cals 0.4.3 → 0.4.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.
@@ -1,2 +1,12 @@
1
+ import { Properties } from 'csstype';
1
2
  export declare function removeInvalidStyleFormValue(styleForm?: any): any;
3
+ export declare function processCommonStyle2CSSProperties(commonStyle?: any, options?: {
4
+ toRem: boolean;
5
+ ignoreSelf?: boolean;
6
+ addPXUnit?: boolean;
7
+ toRpx?: boolean;
8
+ }): Properties<string | number>;
9
+ export declare function processCSSProperties2Rem(style?: Properties<string | number>, options?: {
10
+ looseError: boolean;
11
+ }): Properties<string | number>;
2
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":"AAEA,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;AAKrC,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF;AA0ID,wBAAgB,gCAAgC,CAC9C,WAAW,GAAE,GAA2B,EACxC,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,CA8N7B;AASD,wBAAgB,wBAAwB,CACtC,KAAK,GAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,OAAO;;CAAwB,GAC9B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAE7B"}
@@ -1,7 +1,21 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeInvalidStyleFormValue = void 0;
14
+ exports.processCSSProperties2Rem = exports.processCommonStyle2CSSProperties = exports.removeInvalidStyleFormValue = void 0;
4
15
  const common_1 = require("./common");
16
+ const lodash_1 = require("lodash");
17
+ const CSSProperty_1 = require("../../../utils/CSSProperty");
18
+ const DISTANCE_KEY_LIST = ['top', 'right', 'bottom', 'left'];
5
19
  function removeInvalidStyleFormValue(styleForm = {}) {
6
20
  return Object.keys(styleForm).reduce((result, key) => {
7
21
  const propStyleFormData = styleForm[key];
@@ -28,3 +42,284 @@ function setStyleValue(object, key, value) {
28
42
  }
29
43
  object[(0, common_1.camelcase)(key)] = value;
30
44
  }
45
+ function _handleStyleNumValue(styleVal, addPXUnit) {
46
+ if (addPXUnit) {
47
+ // 该分支实际没有使用?
48
+ // styleValue = '0.2' 时处理有问题
49
+ const value = `${styleVal}`;
50
+ if (value.search(/^\d+$/) >= 0) {
51
+ return `${value}px`;
52
+ }
53
+ }
54
+ return styleVal;
55
+ }
56
+ function setDistanceStyle(style, distance, attr, addPXUnit) {
57
+ const attributeKey = (0, common_1.camelcase)(`${attr}`);
58
+ if (Object.keys(distance).length === 4) {
59
+ if ((0, lodash_1.uniq)((0, lodash_1.map)(distance, (val) => val)).length === 1) {
60
+ // 4个值全相等的情况
61
+ setStyleValue(style, attributeKey, _handleStyleNumValue(distance.top, addPXUnit));
62
+ }
63
+ else if (distance.top === distance.bottom && distance.left === distance.right) {
64
+ // 俩俩相等的情况
65
+ setStyleValue(style, attributeKey, `${_handleStyleNumValue(distance.top, addPXUnit)} ${_handleStyleNumValue(distance.right, addPXUnit)}`);
66
+ }
67
+ else if (distance.left === distance.right) {
68
+ setStyleValue(style, attributeKey, `${_handleStyleNumValue(distance.top, addPXUnit)} ${_handleStyleNumValue(distance.right, addPXUnit)} ${_handleStyleNumValue(distance.bottom, addPXUnit)}`);
69
+ }
70
+ else {
71
+ setStyleValue(style, attributeKey, `${_handleStyleNumValue(distance.top, addPXUnit)} ${_handleStyleNumValue(distance.right, addPXUnit)} ${_handleStyleNumValue(distance.bottom, addPXUnit)} ${_handleStyleNumValue(distance.left, addPXUnit)}`);
72
+ }
73
+ }
74
+ else {
75
+ DISTANCE_KEY_LIST.forEach((key) => {
76
+ if (distance[key] !== undefined)
77
+ setStyleValue(style, (0, common_1.camelcase)(`${attr}_${key}`), _handleStyleNumValue(distance[key], addPXUnit));
78
+ });
79
+ }
80
+ }
81
+ function translateStyleByHandler(style = {}, handler, options = { looseError: false }) {
82
+ return Object.keys(style).reduce((result, key) => {
83
+ const value = style[key];
84
+ if (CSSProperty_1.isUnitlessNumber[key]) {
85
+ setStyleValue(result, key, value);
86
+ }
87
+ else if (value !== undefined && value !== null) {
88
+ try {
89
+ setStyleValue(result, key, handler(value));
90
+ }
91
+ catch (e) {
92
+ if (options.looseError) {
93
+ console.warn('translate style error, key:value', key, value);
94
+ }
95
+ else {
96
+ throw e;
97
+ }
98
+ }
99
+ }
100
+ return result;
101
+ }, {});
102
+ }
103
+ function calPxToREM(px) {
104
+ if (Number.isNaN(px / 28))
105
+ return px.toString();
106
+ if (+px === 0) {
107
+ return '0';
108
+ }
109
+ return `${(px / 28).toFixed(4)}rem`;
110
+ }
111
+ function toREM(cssLen) {
112
+ if (typeof cssLen === 'string') {
113
+ const cssLenArr = cssLen.split(' ');
114
+ return cssLenArr
115
+ .map((attr) => {
116
+ const matchResult = attr.match(/^(-?\d+)(px)?$/);
117
+ if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) {
118
+ return calPxToREM(+matchResult[1]);
119
+ }
120
+ return attr;
121
+ })
122
+ .join(' ');
123
+ }
124
+ else if (typeof cssLen === 'number') {
125
+ return calPxToREM(cssLen);
126
+ }
127
+ else {
128
+ throw new Error('cssLen type error ' + cssLen);
129
+ }
130
+ }
131
+ function toRPX(cssLen) {
132
+ if (typeof cssLen === 'string') {
133
+ const cssLenArr = cssLen.split(' ');
134
+ return cssLenArr
135
+ .map((attr) => {
136
+ const matchResult = attr.match(/^(-?\d+)(px)?$/);
137
+ if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) {
138
+ return `${+matchResult[1]}rpx`;
139
+ }
140
+ return attr;
141
+ })
142
+ .join(' ');
143
+ }
144
+ return `${cssLen}rpx`;
145
+ }
146
+ // Convert WeApps common style to css styles(React.CSSProperties)
147
+ function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: true, ignoreSelf: false, addPXUnit: false, toRpx: false }) {
148
+ const { size,
149
+ // transform,
150
+ text, border, background, margin, padding, zIndex, position, display, flexConfig, custom, self, } = commonStyle;
151
+ const style = {};
152
+ if (size) {
153
+ setStyleValue(style, 'width', _handleStyleNumValue(size.width, !!options.addPXUnit));
154
+ setStyleValue(style, 'height', _handleStyleNumValue(size.height, !!options.addPXUnit));
155
+ }
156
+ // if (transform) {
157
+ // const { rotate, opacity, scale, radius } = transform
158
+ // if ((rotate && rotate !== 0) || (scale && scale !== 1)) {
159
+ // style.transform = `${rotate ? `rotate(${rotate}deg) ` : ''}${scale ? `scale(${scale})` : ''}`
160
+ // }
161
+ // setStyleValue(style, 'opacity', opacity)
162
+ // setStyleValue(style, 'borderRadius', radius)
163
+ // }
164
+ if (margin) {
165
+ setDistanceStyle(style, margin, 'margin', !!options.addPXUnit);
166
+ }
167
+ if (padding) {
168
+ setDistanceStyle(style, padding, 'padding', !!options.addPXUnit);
169
+ }
170
+ if (display) {
171
+ setStyleValue(style, 'display', display);
172
+ }
173
+ if (display === 'flex' && flexConfig) {
174
+ if (flexConfig.justifyContent)
175
+ setStyleValue(style, 'justifyContent', flexConfig.justifyContent);
176
+ if (flexConfig.alignItems)
177
+ setStyleValue(style, 'alignItems', flexConfig.alignItems);
178
+ if (flexConfig.flexWrap && flexConfig.flexDirection) {
179
+ setStyleValue(style, 'flexFlow', `${flexConfig.flexDirection} ${flexConfig.flexWrap}`);
180
+ }
181
+ else {
182
+ if (flexConfig.flexWrap)
183
+ setStyleValue(style, 'flexWrap', flexConfig.flexWrap);
184
+ if (flexConfig.flexDirection)
185
+ setStyleValue(style, 'flexDirection', flexConfig.flexDirection);
186
+ }
187
+ }
188
+ if (typeof zIndex === 'number' || `${zIndex}`.search(/^\d+$/) === 0) {
189
+ style.zIndex = zIndex;
190
+ }
191
+ if (text) {
192
+ setStyleValue(style, 'color', text.color);
193
+ setStyleValue(style, 'fontSize', _handleStyleNumValue(text.fontSize, !!options.addPXUnit));
194
+ setStyleValue(style, 'lineHeight', text.lineHeight);
195
+ setStyleValue(style, 'textAlign', text.textAlign);
196
+ setStyleValue(style, 'fontWeight', text.weight);
197
+ if (text.opacity !== undefined) {
198
+ setStyleValue(style, 'opacity', text.opacity / 100);
199
+ }
200
+ }
201
+ if (border) {
202
+ const { type, color, width, radius, radiusInfo } = border;
203
+ if (width !== undefined) {
204
+ if (type && type !== 'none') {
205
+ setStyleValue(style, 'border', `${_handleStyleNumValue(width, !!options.addPXUnit)} ${type} ${color || ''}`);
206
+ }
207
+ else {
208
+ setStyleValue(style, 'borderWidth', _handleStyleNumValue(width, !!options.addPXUnit));
209
+ if (color)
210
+ setStyleValue(style, 'borderColor', color);
211
+ }
212
+ }
213
+ if (radius !== undefined) {
214
+ setStyleValue(style, 'borderRadius', _handleStyleNumValue(radius, !!options.addPXUnit));
215
+ }
216
+ if (radiusInfo && !(0, common_1.isEmptyObj)(radiusInfo)) {
217
+ if (Object.keys(radiusInfo).length === 4) {
218
+ if ((0, lodash_1.uniq)((0, lodash_1.map)(radiusInfo, (val) => val)).length === 1) {
219
+ // 4个值全相等的情况
220
+ setStyleValue(style, 'borderRadius', _handleStyleNumValue(radiusInfo.topLeft, !!options.addPXUnit));
221
+ }
222
+ else if (radiusInfo.topLeft === radiusInfo.bottomRight && radiusInfo.topRight === radiusInfo.bottomLeft) {
223
+ // 俩俩相等的情况
224
+ setStyleValue(style, 'borderRadius', `${_handleStyleNumValue(radiusInfo.topLeft, !!options.addPXUnit)} ${_handleStyleNumValue(radiusInfo.topRight, !!options.addPXUnit)}`);
225
+ }
226
+ else if (radiusInfo.topRight === radiusInfo.bottomLeft) {
227
+ setStyleValue(style, 'borderRadius', `${_handleStyleNumValue(radiusInfo.topLeft, !!options.addPXUnit)} ${_handleStyleNumValue(radiusInfo.topRight, !!options.addPXUnit)} ${_handleStyleNumValue(radiusInfo.bottomRight, !!options.addPXUnit)}`);
228
+ }
229
+ else {
230
+ setStyleValue(style, 'borderRadius', `${_handleStyleNumValue(radiusInfo.topLeft, !!options.addPXUnit)} ${_handleStyleNumValue(radiusInfo.topRight, !!options.addPXUnit)} ${_handleStyleNumValue(radiusInfo.bottomRight, !!options.addPXUnit)} ${_handleStyleNumValue(radiusInfo.bottomLeft, !!options.addPXUnit)}`);
231
+ }
232
+ }
233
+ else {
234
+ setStyleValue(style, 'borderTopLeftRadius', _handleStyleNumValue(radiusInfo.topLeft, !!options.addPXUnit));
235
+ setStyleValue(style, 'borderTopRightRadius', _handleStyleNumValue(radiusInfo.topRight, !!options.addPXUnit));
236
+ setStyleValue(style, 'borderBottomRightRadius', _handleStyleNumValue(radiusInfo.bottomRight, !!options.addPXUnit));
237
+ setStyleValue(style, 'borderBottomLeftRadius', _handleStyleNumValue(radiusInfo.bottomLeft, !!options.addPXUnit));
238
+ }
239
+ }
240
+ if (type === 'none') {
241
+ setStyleValue(style, 'border', `none`);
242
+ }
243
+ }
244
+ if (background) {
245
+ const { bgType, color, image, size, repeat, position, positionObj } = background;
246
+ if (bgType === 'color') {
247
+ setStyleValue(style, 'background', color);
248
+ }
249
+ else if (bgType === 'image') {
250
+ // 如 radial-gradient(crimson, skyblue);
251
+ if (image != null) {
252
+ if (image.search(/[()]/) >= 0) {
253
+ style.background = image;
254
+ }
255
+ else {
256
+ style.background = `url(${image})`;
257
+ }
258
+ }
259
+ if (repeat)
260
+ style.background += ` ${repeat}`;
261
+ if (size) {
262
+ setStyleValue(style, 'backgroundSize', _handleStyleNumValue(size, !!options.addPXUnit));
263
+ }
264
+ setStyleValue(style, 'backgroundPosition', position);
265
+ if (positionObj && !(0, common_1.isEmptyObj)(positionObj)) {
266
+ style.background += ` ${_handleStyleNumValue(positionObj.left, !!options.addPXUnit)} ${_handleStyleNumValue(positionObj.top, !!options.addPXUnit)}`;
267
+ }
268
+ }
269
+ // FIXME: 这里兼容原有应用的数据,后面应去掉
270
+ if (bgType === undefined) {
271
+ setStyleValue(style, 'backgroundColor', color);
272
+ if (image != null) {
273
+ style.backgroundImage = `url(${image})`;
274
+ setStyleValue(style, 'backgroundRepeat', repeat);
275
+ setStyleValue(style, 'backgroundSize', _handleStyleNumValue(size, !!options.addPXUnit));
276
+ setStyleValue(style, 'backgroundPosition', position);
277
+ }
278
+ }
279
+ }
280
+ if (position) {
281
+ setStyleValue(style, 'position', position.position);
282
+ if (position.left !== undefined) {
283
+ setStyleValue(style, 'left', _handleStyleNumValue(position.left, !!options.addPXUnit));
284
+ }
285
+ if (position.right !== undefined) {
286
+ setStyleValue(style, 'right', _handleStyleNumValue(position.right, !!options.addPXUnit));
287
+ }
288
+ if (position.top !== undefined) {
289
+ setStyleValue(style, 'top', _handleStyleNumValue(position.top, !!options.addPXUnit));
290
+ }
291
+ if (position.bottom !== undefined) {
292
+ setStyleValue(style, 'bottom', _handleStyleNumValue(position.bottom, !!options.addPXUnit));
293
+ }
294
+ }
295
+ if (custom && custom.length > 0) {
296
+ custom.map((item) => {
297
+ setStyleValue(style, item.key, item.value);
298
+ });
299
+ }
300
+ if (self && !options.ignoreSelf) {
301
+ const _a = self, { cssFloat } = _a, restSelf = __rest(_a, ["cssFloat"]);
302
+ Object.assign(style, restSelf, { float: cssFloat });
303
+ }
304
+ for (const key in style) {
305
+ const value = style[key];
306
+ if (Array.isArray(value)) {
307
+ style[key] = value[value.length - 1];
308
+ }
309
+ }
310
+ if (style.display) {
311
+ console.log(style.display);
312
+ }
313
+ if (options.toRpx) {
314
+ return translateStyleToRpx(style);
315
+ }
316
+ return options.toRem ? processCSSProperties2Rem(style) : style;
317
+ }
318
+ exports.processCommonStyle2CSSProperties = processCommonStyle2CSSProperties;
319
+ function translateStyleToRpx(style = {}, options = { looseError: false }) {
320
+ return translateStyleByHandler(style, toRPX, options);
321
+ }
322
+ function processCSSProperties2Rem(style = {}, options = { looseError: false }) {
323
+ return translateStyleByHandler(style, toREM, options);
324
+ }
325
+ exports.processCSSProperties2Rem = processCSSProperties2Rem;
@@ -1,7 +1,8 @@
1
1
  export * from './cals/index';
2
2
  export { upgrageToVersion2 } from './cals/utils/version';
3
3
  export { processComponentModule } from './cals/utils/spinoff';
4
- export { calsToCode, codeToCals, ICodeItem, checkForConflicts, autoResolveConflicts, } from './cals/utils/code';
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 } from './cals/utils/style';
7
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,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
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"}
@@ -14,7 +14,7 @@ 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
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.PropBindType = exports.ActionType = exports.parseComponentCals = exports.autoResolveConflicts = exports.checkForConflicts = exports.codeToCals = exports.calsToCode = exports.processComponentModule = exports.upgrageToVersion2 = void 0;
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;
18
18
  __exportStar(require("./cals/index"), exports);
19
19
  var version_1 = require("./cals/utils/version");
20
20
  Object.defineProperty(exports, "upgrageToVersion2", { enumerable: true, get: function () { return version_1.upgrageToVersion2; } });
@@ -30,3 +30,6 @@ Object.defineProperty(exports, "parseComponentCals", { enumerable: true, get: fu
30
30
  var index_1 = require("./expression/index");
31
31
  Object.defineProperty(exports, "ActionType", { enumerable: true, get: function () { return index_1.ActionType; } });
32
32
  Object.defineProperty(exports, "PropBindType", { enumerable: true, get: function () { return index_1.PropBindType; } });
33
+ var style_1 = require("./cals/utils/style");
34
+ Object.defineProperty(exports, "processCommonStyle2CSSProperties", { enumerable: true, get: function () { return style_1.processCommonStyle2CSSProperties; } });
35
+ Object.defineProperty(exports, "processCSSProperties2Rem", { enumerable: true, get: function () { return style_1.processCSSProperties2Rem; } });
@@ -40,7 +40,10 @@ export declare const isUnitlessNumber: {
40
40
  gridColumnStart: boolean;
41
41
  fontWeight: boolean;
42
42
  lineClamp: boolean;
43
- lineHeight: boolean;
43
+ /**
44
+ * TODO:
45
+ * 历史原因,存量大量的是当做默认补充 px 单位来做的,导致没法一下子兼容,需要刷新设计态数据
46
+ */
44
47
  opacity: boolean;
45
48
  order: boolean;
46
49
  orphans: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"CSSProperty.d.ts","sourceRoot":"","sources":["../../src/utils/CSSProperty.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AAEH;;GAEG;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C5B,CAAC"}
1
+ {"version":3,"file":"CSSProperty.d.ts","sourceRoot":"","sources":["../../src/utils/CSSProperty.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AAEH;;GAEG;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6B3B;;;OAGG;;;;;;;;;;;;;;;;CAmBJ,CAAC"}
@@ -43,7 +43,11 @@ exports.isUnitlessNumber = {
43
43
  gridColumnStart: true,
44
44
  fontWeight: true,
45
45
  lineClamp: true,
46
- lineHeight: true,
46
+ /**
47
+ * TODO:
48
+ * 历史原因,存量大量的是当做默认补充 px 单位来做的,导致没法一下子兼容,需要刷新设计态数据
49
+ */
50
+ // lineHeight: true,
47
51
  opacity: true,
48
52
  order: true,
49
53
  orphans: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cals",
3
- "version": "0.4.3",
3
+ "version": "0.4.6",
4
4
  "description": "Common application specifications",
5
5
  "main": "lib/utils/index.js",
6
6
  "source": "src/utils/index.ts",
@@ -31,6 +31,7 @@
31
31
  "@types/jest": "^27.4.0",
32
32
  "@types/lodash": "^4.14.168",
33
33
  "@types/node": "^14.14.6",
34
+ "@types/react": "^18.0.17",
34
35
  "ajv": "^8.8.2",
35
36
  "csstype": "^3.0.11",
36
37
  "jest": "^27.1.0",