@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.
Files changed (104) hide show
  1. package/lib/parser/cals/index.d.ts +0 -8
  2. package/lib/parser/cals/index.d.ts.map +1 -1
  3. package/lib/parser/cals/index.js +2 -22
  4. package/lib/parser/cals/utils/block/index.d.ts +0 -0
  5. package/lib/parser/cals/utils/block/index.d.ts.map +0 -0
  6. package/lib/parser/cals/utils/block/index.js +0 -0
  7. package/lib/parser/cals/utils/code/index.d.ts +0 -0
  8. package/lib/parser/cals/utils/code/index.d.ts.map +0 -0
  9. package/lib/parser/cals/utils/code/index.js +0 -0
  10. package/lib/parser/cals/utils/common.d.ts +0 -0
  11. package/lib/parser/cals/utils/common.d.ts.map +0 -0
  12. package/lib/parser/cals/utils/common.js +0 -0
  13. package/lib/parser/cals/utils/runtime.d.ts +0 -0
  14. package/lib/parser/cals/utils/runtime.d.ts.map +0 -0
  15. package/lib/parser/cals/utils/runtime.js +0 -0
  16. package/lib/parser/cals/utils/spinoff/index.d.ts +0 -0
  17. package/lib/parser/cals/utils/spinoff/index.d.ts.map +0 -0
  18. package/lib/parser/cals/utils/spinoff/index.js +0 -0
  19. package/lib/parser/cals/utils/style.d.ts +5 -36
  20. package/lib/parser/cals/utils/style.d.ts.map +1 -1
  21. package/lib/parser/cals/utils/style.js +70 -102
  22. package/lib/parser/cals/utils/template.d.ts +0 -1
  23. package/lib/parser/cals/utils/template.d.ts.map +1 -1
  24. package/lib/parser/cals/utils/template.js +2 -3
  25. package/lib/parser/cals/utils/version/common.d.ts +0 -0
  26. package/lib/parser/cals/utils/version/common.d.ts.map +0 -0
  27. package/lib/parser/cals/utils/version/common.js +0 -0
  28. package/lib/parser/cals/utils/version/config.d.ts +0 -0
  29. package/lib/parser/cals/utils/version/config.d.ts.map +0 -0
  30. package/lib/parser/cals/utils/version/config.js +0 -0
  31. package/lib/parser/cals/utils/version/index.d.ts +0 -0
  32. package/lib/parser/cals/utils/version/index.d.ts.map +0 -0
  33. package/lib/parser/cals/utils/version/index.js +0 -0
  34. package/lib/parser/cals/utils/version/parses.d.ts +0 -0
  35. package/lib/parser/cals/utils/version/parses.d.ts.map +0 -0
  36. package/lib/parser/cals/utils/version/parses.js +0 -0
  37. package/lib/parser/cals/utils/version/utils.d.ts +0 -0
  38. package/lib/parser/cals/utils/version/utils.d.ts.map +0 -0
  39. package/lib/parser/cals/utils/version/utils.js +0 -0
  40. package/lib/parser/expression/index.d.ts +0 -0
  41. package/lib/parser/expression/index.d.ts.map +0 -0
  42. package/lib/parser/expression/index.js +0 -0
  43. package/lib/parser/index.d.ts +1 -2
  44. package/lib/parser/index.d.ts.map +1 -1
  45. package/lib/parser/index.js +1 -7
  46. package/lib/types/basic/app.d.ts +0 -0
  47. package/lib/types/basic/app.d.ts.map +0 -0
  48. package/lib/types/basic/app.js +0 -0
  49. package/lib/types/basic/common.d.ts +0 -0
  50. package/lib/types/basic/common.d.ts.map +0 -0
  51. package/lib/types/basic/common.js +0 -0
  52. package/lib/types/basic/component.d.ts +0 -0
  53. package/lib/types/basic/component.d.ts.map +0 -0
  54. package/lib/types/basic/component.js +0 -0
  55. package/lib/types/basic/datasource.d.ts +0 -0
  56. package/lib/types/basic/datasource.d.ts.map +0 -0
  57. package/lib/types/basic/datasource.js +0 -0
  58. package/lib/types/index.d.ts +0 -0
  59. package/lib/types/index.d.ts.map +0 -0
  60. package/lib/types/index.js +0 -0
  61. package/lib/types/lcds.d.ts +0 -0
  62. package/lib/types/lcds.d.ts.map +0 -0
  63. package/lib/types/lcds.js +0 -0
  64. package/lib/types/platform/app.d.ts +0 -21
  65. package/lib/types/platform/app.d.ts.map +1 -1
  66. package/lib/types/platform/app.js +0 -9
  67. package/lib/types/platform/common.d.ts +0 -0
  68. package/lib/types/platform/common.d.ts.map +0 -0
  69. package/lib/types/platform/common.js +0 -0
  70. package/lib/types/platform/component.d.ts +0 -0
  71. package/lib/types/platform/component.d.ts.map +0 -0
  72. package/lib/types/platform/component.js +0 -0
  73. package/lib/types/platform/datasource.d.ts +0 -0
  74. package/lib/types/platform/datasource.d.ts.map +0 -0
  75. package/lib/types/platform/datasource.js +0 -0
  76. package/lib/types/platform/widget/form.d.ts +0 -0
  77. package/lib/types/platform/widget/form.d.ts.map +0 -0
  78. package/lib/types/platform/widget/form.js +0 -0
  79. package/lib/types/platform/widget/meta.d.ts +0 -0
  80. package/lib/types/platform/widget/meta.d.ts.map +0 -0
  81. package/lib/types/platform/widget/meta.js +0 -0
  82. package/lib/utils/CSSProperty.d.ts +0 -0
  83. package/lib/utils/CSSProperty.d.ts.map +0 -0
  84. package/lib/utils/CSSProperty.js +0 -0
  85. package/lib/utils/build.d.ts +0 -0
  86. package/lib/utils/build.d.ts.map +0 -0
  87. package/lib/utils/build.js +0 -0
  88. package/lib/utils/constant.d.ts +0 -0
  89. package/lib/utils/constant.d.ts.map +0 -0
  90. package/lib/utils/constant.js +0 -0
  91. package/lib/utils/dts/auto-generated.d.ts +1 -1
  92. package/lib/utils/dts/auto-generated.d.ts.map +1 -1
  93. package/lib/utils/dts/auto-generated.js +92 -1
  94. package/lib/utils/dts/build.js +2 -0
  95. package/lib/utils/dts/index.d.ts +33 -6
  96. package/lib/utils/dts/index.d.ts.map +1 -1
  97. package/lib/utils/dts/index.js +168 -39
  98. package/lib/utils/index.d.ts +1 -0
  99. package/lib/utils/index.d.ts.map +1 -1
  100. package/lib/utils/index.js +1 -1
  101. package/package.json +1 -1
  102. package/lib/parser/plugins/postcss-rpx2clac.d.ts +0 -18
  103. package/lib/parser/plugins/postcss-rpx2clac.d.ts.map +0 -1
  104. 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,CA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,IAAI,EAAE;IACpD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACzC,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAAA;KAAE,CAAC;IAC/C,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;KAAE,CAAC;CAC1C;;;;;;;mBAIY,MAAM;mBACN,MAAM;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"}
@@ -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.parseVersion = 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;
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, externalResources } = data, restData = __rest(data, ["version", "author", "name", "label", "description", "selectedPageId", "pageInstanceList", "lowCodes", "datasources", "vars", "dataset", "extra", "dependencies", "miniprogramPlugins", "lastDependencies", "externalResources"]);
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;AAwKD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,GAAE,GAAQ,EACrB,OAAO,GAAE;IACP;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC;IACnC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACwE,GAC7F,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CA6T7B;AAED,UAAU,sBAAsB;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,GAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAE7B;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,KAAK,EAC1B,OAAO,CAAC,EAAE,sBAAsB,MAajC"}
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.processCSSPropertiesUnit = exports.processCSSProperties2Rem = exports.processCommonStyle2CSSProperties = exports.removeInvalidStyleFormValue = void 0;
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
- * 2022.12.13
55
- * 改分支未启用
56
- */
53
+ // 该分支实际没有使用?
54
+ // styleValue = '0.2' 时处理有问题
57
55
  const value = `${styleVal}`;
58
- if (/^\d*.?\d+$/.test(value)) {
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, rpxCalcRoot));
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 toREM(cssLen, rpxCalcRoot = undefined) {
113
- if (typeof cssLen === 'string' || typeof cssLen === 'number') {
114
- const cssLenArr = `${cssLen}`.split(' ');
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+)(r?px)?$/);
122
+ const matchResult = attr.match(/^(-?\d+)(px)?$/);
118
123
  if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) {
119
- const px = +matchResult[1];
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, rpxCalcRoot = undefined) {
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
- const px = +matchResult[1];
145
- if (Number.isNaN(px / 1))
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 `${+matchResult[1]}px`;
172
- }
173
- return attr;
174
- })
175
- .join(' ');
146
+ return attr;
147
+ })
148
+ .join(' ');
149
+ }
150
+ return `${cssLen}rpx`;
176
151
  }
177
- /**
178
- * Convert WeApps common style to css styles(React.CSSProperties)
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
- currentBoxShadowStyleString += _handleStyleNumValue(!!offsetX ? offsetX : 0, !!options.addPXUnit);
354
+ if (!!offsetX) {
355
+ currentBoxShadowStyleString += _handleStyleNumValue(offsetX, !!options.addPXUnit);
356
+ }
357
+ else {
358
+ currentBoxShadowStyleString += '0';
359
+ }
384
360
  // offsetY
385
- currentBoxShadowStyleString += ' ' + _handleStyleNumValue(!!offsetY ? offsetY : 0, !!options.addPXUnit);
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
- currentBoxShadowStyleString +=
389
- ' ' + _handleStyleNumValue(!!blurRadius ? blurRadius : 0, !!options.addPXUnit);
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
- const splitLabel = !!boxShadowStyleString ? ' , ' : '';
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
- let { defaultUnit } = options;
426
- const translateStyleOptions = { rpxCalcRoot: options.rpxCalcRoot };
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
- if (defaultUnit) {
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
- * @deprecated
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,6 +1,5 @@
1
1
  import { ECodeType } from '../../../types';
2
2
  export declare function generateDefaultCode(ctx: {
3
3
  id: string;
4
- version?: string;
5
4
  }, type: ECodeType, scope: 'component' | 'page' | 'app'): string;
6
5
  //# sourceMappingURL=template.d.ts.map
@@ -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,CACjC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,EACrC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK,UA6BpC"}
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
- // <%= version[0] === '4' ? '默认 rpx 会转换成 动态cals实现,px/PX/Px 均代表传统一样上的px':'默认 px 会转换成 rem,含大写字母 PX 和 Px 则不会转换' %>
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, version = '' } = ctx;
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
@@ -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, processCSSPropertiesUnit, } from './cals/utils/style';
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,EACL,gCAAgC,EAChC,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4BAA4B,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"}
@@ -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.PostcssRpx2Calc = exports.processCSSPropertiesUnit = exports.processCSSProperties2Rem = exports.processCommonStyle2CSSProperties = 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;
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; } });
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/types/lcds.js CHANGED
File without changes