@cloudbase/cals 1.1.14 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{parser → cjs/parser}/cals/index.d.ts +1 -1
- package/lib/cjs/parser/cals/index.d.ts.map +1 -0
- package/lib/{parser → cjs/parser}/cals/index.js +2 -1
- package/lib/cjs/parser/cals/utils/block/helpers/get-component-namespace.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/merge-dataset.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/merge-listeners.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/merge-resources.d.ts.map +1 -0
- package/lib/{parser → cjs/parser}/cals/utils/block/helpers/remap-component-ids.d.ts +2 -2
- package/lib/cjs/parser/cals/utils/block/helpers/remap-component-ids.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/renew-id-in-code.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/resolve-new-id.d.ts.map +1 -0
- package/lib/{parser → cjs/parser}/cals/utils/block/index.d.ts +2 -2
- package/lib/cjs/parser/cals/utils/block/index.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/code/index.d.ts.map +1 -0
- package/lib/{parser → cjs/parser}/cals/utils/common.d.ts +1 -1
- package/lib/cjs/parser/cals/utils/common.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/getUsedReference.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/getUsedResources.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/runtime.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/spinoff/index.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/style.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/template.d.ts.map +1 -0
- package/lib/{parser → cjs/parser}/cals/utils/template.js +2 -0
- package/lib/cjs/parser/cals/utils/version/common.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/version/config.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/version/index.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/version/parses.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/version/utils.d.ts.map +1 -0
- package/lib/cjs/parser/dependiencies/index.d.ts.map +1 -0
- package/lib/cjs/parser/expression/index.d.ts.map +1 -0
- package/lib/cjs/parser/index.d.ts.map +1 -0
- package/lib/cjs/parser/plugins/postcss-rpx2clac.d.ts.map +1 -0
- package/lib/cjs/types/basic/app.d.ts.map +1 -0
- package/lib/cjs/types/basic/common.d.ts.map +1 -0
- package/lib/cjs/types/basic/component.d.ts.map +1 -0
- package/lib/cjs/types/basic/datasource.d.ts.map +1 -0
- package/lib/{types → cjs/types}/index.d.ts +1 -1
- package/lib/cjs/types/index.d.ts.map +1 -0
- package/lib/{types → cjs/types}/index.js +2 -13
- package/lib/cjs/types/lcds.d.ts +612 -0
- package/lib/cjs/types/lcds.d.ts.map +1 -0
- package/lib/cjs/types/lcds.js +34 -0
- package/lib/{types → cjs/types}/platform/app.d.ts +4 -2
- package/lib/cjs/types/platform/app.d.ts.map +1 -0
- package/lib/cjs/types/platform/common.d.ts.map +1 -0
- package/lib/{types → cjs/types}/platform/component.d.ts +1 -1
- package/lib/cjs/types/platform/component.d.ts.map +1 -0
- package/lib/{types → cjs/types}/platform/datasource.d.ts +4 -4
- package/lib/cjs/types/platform/datasource.d.ts.map +1 -0
- package/lib/cjs/types/platform/eventFlow.d.ts.map +1 -0
- package/lib/cjs/types/platform/query.d.ts.map +1 -0
- package/lib/{types → cjs/types}/platform/theme.d.ts +5 -5
- package/lib/cjs/types/platform/theme.d.ts.map +1 -0
- package/lib/cjs/utils/CSSProperty.d.ts.map +1 -0
- package/lib/cjs/utils/color-generator/core.d.ts.map +1 -0
- package/lib/cjs/utils/color-generator/generate.d.ts.map +1 -0
- package/lib/cjs/utils/color-generator/utils.d.ts.map +1 -0
- package/lib/cjs/utils/constant.d.ts.map +1 -0
- package/lib/cjs/utils/dts/auto-generated.d.ts +2 -0
- package/lib/cjs/utils/dts/auto-generated.d.ts.map +1 -0
- package/lib/{utils → cjs/utils}/dts/auto-generated.js +113 -0
- package/lib/{utils → cjs/utils}/dts/build.d.ts.map +1 -1
- package/lib/cjs/utils/dts/index.d.ts.map +1 -0
- package/lib/cjs/utils/index.d.ts.map +1 -0
- package/lib/cjs/utils/version/common.d.ts.map +1 -0
- package/lib/cjs/utils/version/featureChecker.d.ts.map +1 -0
- package/lib/cjs/utils/version/migrations/version4.d.ts.map +1 -0
- package/lib/esm/parser/cals/index.d.ts +625 -0
- package/lib/esm/parser/cals/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/index.js +1549 -0
- package/lib/esm/parser/cals/utils/block/helpers/get-component-namespace.d.ts +2 -0
- package/lib/esm/parser/cals/utils/block/helpers/get-component-namespace.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/get-component-namespace.js +5 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-dataset.d.ts +6 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-dataset.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-dataset.js +13 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-listeners.d.ts +6 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-listeners.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-listeners.js +10 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-resources.d.ts +6 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-resources.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-resources.js +25 -0
- package/lib/esm/parser/cals/utils/block/helpers/remap-component-ids.d.ts +30 -0
- package/lib/esm/parser/cals/utils/block/helpers/remap-component-ids.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/remap-component-ids.js +125 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-code.d.ts +7 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-code.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-code.js +9 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts +8 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-expr.js +56 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts +15 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-resource.js +13 -0
- package/lib/esm/parser/cals/utils/block/helpers/resolve-new-id.d.ts +7 -0
- package/lib/esm/parser/cals/utils/block/helpers/resolve-new-id.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/resolve-new-id.js +17 -0
- package/lib/esm/parser/cals/utils/block/index.d.ts +67 -0
- package/lib/esm/parser/cals/utils/block/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/index.js +451 -0
- package/lib/esm/parser/cals/utils/code/index.d.ts +36 -0
- package/lib/esm/parser/cals/utils/code/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/code/index.js +401 -0
- package/lib/esm/parser/cals/utils/common.d.ts +35 -0
- package/lib/esm/parser/cals/utils/common.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/common.js +301 -0
- package/lib/esm/parser/cals/utils/getUsedReference.d.ts +8 -0
- package/lib/esm/parser/cals/utils/getUsedReference.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/getUsedReference.js +54 -0
- package/lib/esm/parser/cals/utils/getUsedResources.d.ts +10 -0
- package/lib/esm/parser/cals/utils/getUsedResources.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/getUsedResources.js +132 -0
- package/lib/esm/parser/cals/utils/runtime.d.ts +14 -0
- package/lib/esm/parser/cals/utils/runtime.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/runtime.js +254 -0
- package/lib/esm/parser/cals/utils/spinoff/index.d.ts +10 -0
- package/lib/esm/parser/cals/utils/spinoff/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/spinoff/index.js +95 -0
- package/lib/esm/parser/cals/utils/style.d.ts +43 -0
- package/lib/esm/parser/cals/utils/style.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/style.js +463 -0
- package/lib/esm/parser/cals/utils/template.d.ts +6 -0
- package/lib/esm/parser/cals/utils/template.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/template.js +223 -0
- package/lib/esm/parser/cals/utils/version/common.d.ts +5 -0
- package/lib/esm/parser/cals/utils/version/common.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/common.js +375 -0
- package/lib/esm/parser/cals/utils/version/config.d.ts +16 -0
- package/lib/esm/parser/cals/utils/version/config.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/config.js +241 -0
- package/lib/esm/parser/cals/utils/version/index.d.ts +3 -0
- package/lib/esm/parser/cals/utils/version/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/index.js +68 -0
- package/lib/esm/parser/cals/utils/version/parses.d.ts +16 -0
- package/lib/esm/parser/cals/utils/version/parses.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/parses.js +560 -0
- package/lib/esm/parser/cals/utils/version/utils.d.ts +14 -0
- package/lib/esm/parser/cals/utils/version/utils.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/utils.js +129 -0
- package/lib/esm/parser/dependiencies/index.d.ts +143 -0
- package/lib/esm/parser/dependiencies/index.d.ts.map +1 -0
- package/lib/esm/parser/dependiencies/index.js +684 -0
- package/lib/esm/parser/expression/index.d.ts +123 -0
- package/lib/esm/parser/expression/index.d.ts.map +1 -0
- package/lib/esm/parser/expression/index.js +296 -0
- package/lib/esm/parser/index.d.ts +13 -0
- package/lib/esm/parser/index.d.ts.map +1 -0
- package/lib/esm/parser/index.js +12 -0
- package/lib/esm/parser/plugins/postcss-rpx2clac.d.ts +18 -0
- package/lib/esm/parser/plugins/postcss-rpx2clac.d.ts.map +1 -0
- package/lib/esm/parser/plugins/postcss-rpx2clac.js +67 -0
- package/lib/esm/types/basic/app.d.ts +76 -0
- package/lib/esm/types/basic/app.d.ts.map +1 -0
- package/lib/esm/types/basic/app.js +1 -0
- package/lib/esm/types/basic/common.d.ts +125 -0
- package/lib/esm/types/basic/common.d.ts.map +1 -0
- package/lib/esm/types/basic/common.js +1 -0
- package/lib/esm/types/basic/component.d.ts +212 -0
- package/lib/esm/types/basic/component.d.ts.map +1 -0
- package/lib/esm/types/basic/component.js +1 -0
- package/lib/esm/types/basic/datasource.d.ts +50 -0
- package/lib/esm/types/basic/datasource.d.ts.map +1 -0
- package/lib/esm/types/basic/datasource.js +1 -0
- package/lib/esm/types/index.d.ts +12 -0
- package/lib/esm/types/index.d.ts.map +1 -0
- package/lib/esm/types/index.js +14 -0
- package/lib/esm/types/lcds.d.ts +612 -0
- package/lib/esm/types/lcds.d.ts.map +1 -0
- package/lib/esm/types/lcds.js +31 -0
- package/lib/esm/types/platform/app.d.ts +278 -0
- package/lib/esm/types/platform/app.d.ts.map +1 -0
- package/lib/esm/types/platform/app.js +8 -0
- package/lib/esm/types/platform/common.d.ts +190 -0
- package/lib/esm/types/platform/common.d.ts.map +1 -0
- package/lib/esm/types/platform/common.js +84 -0
- package/lib/esm/types/platform/component.d.ts +166 -0
- package/lib/esm/types/platform/component.d.ts.map +1 -0
- package/lib/esm/types/platform/component.js +8 -0
- package/lib/esm/types/platform/datasource.d.ts +500 -0
- package/lib/esm/types/platform/datasource.d.ts.map +1 -0
- package/lib/esm/types/platform/datasource.js +6 -0
- package/lib/esm/types/platform/eventFlow.d.ts +20 -0
- package/lib/esm/types/platform/eventFlow.d.ts.map +1 -0
- package/lib/esm/types/platform/eventFlow.js +1 -0
- package/lib/esm/types/platform/query.d.ts +78 -0
- package/lib/esm/types/platform/query.d.ts.map +1 -0
- package/lib/esm/types/platform/query.js +12 -0
- package/lib/esm/types/platform/theme.d.ts +47 -0
- package/lib/esm/types/platform/theme.d.ts.map +1 -0
- package/lib/esm/types/platform/theme.js +1 -0
- package/lib/esm/utils/CSSProperty.d.ts +64 -0
- package/lib/esm/utils/CSSProperty.d.ts.map +1 -0
- package/lib/esm/utils/CSSProperty.js +86 -0
- package/lib/esm/utils/color-generator/core.d.ts +52 -0
- package/lib/esm/utils/color-generator/core.d.ts.map +1 -0
- package/lib/esm/utils/color-generator/core.js +57 -0
- package/lib/esm/utils/color-generator/generate.d.ts +67 -0
- package/lib/esm/utils/color-generator/generate.d.ts.map +1 -0
- package/lib/esm/utils/color-generator/generate.js +92 -0
- package/lib/esm/utils/color-generator/utils.d.ts +15 -0
- package/lib/esm/utils/color-generator/utils.d.ts.map +1 -0
- package/lib/esm/utils/color-generator/utils.js +30 -0
- package/lib/esm/utils/constant.d.ts +65 -0
- package/lib/esm/utils/constant.d.ts.map +1 -0
- package/lib/esm/utils/constant.js +69 -0
- package/lib/esm/utils/dts/auto-generated.d.ts +2 -0
- package/lib/esm/utils/dts/auto-generated.d.ts.map +1 -0
- package/lib/esm/utils/dts/auto-generated.js +1909 -0
- package/lib/esm/utils/dts/build.d.ts +2 -0
- package/lib/esm/utils/dts/build.d.ts.map +1 -0
- package/lib/esm/utils/dts/build.js +147 -0
- package/lib/esm/utils/dts/index.d.ts +141 -0
- package/lib/esm/utils/dts/index.d.ts.map +1 -0
- package/lib/esm/utils/dts/index.js +1071 -0
- package/lib/esm/utils/index.d.ts +9 -0
- package/lib/esm/utils/index.d.ts.map +1 -0
- package/lib/esm/utils/index.js +8 -0
- package/lib/esm/utils/version/common.d.ts +3 -0
- package/lib/esm/utils/version/common.d.ts.map +1 -0
- package/lib/esm/utils/version/common.js +22 -0
- package/lib/esm/utils/version/featureChecker.d.ts +5 -0
- package/lib/esm/utils/version/featureChecker.d.ts.map +1 -0
- package/lib/esm/utils/version/featureChecker.js +32 -0
- package/lib/esm/utils/version/migrations/version4.d.ts +3 -0
- package/lib/esm/utils/version/migrations/version4.d.ts.map +1 -0
- package/lib/esm/utils/version/migrations/version4.js +192 -0
- package/lib/schema/lcds_component.json +1 -1
- package/lib/schema/platform_application.json +1 -1
- package/lib/schema/platform_template.json +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +7 -5
- package/lib/parser/cals/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/get-component-namespace.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/merge-dataset.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/merge-listeners.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/merge-resources.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/remap-component-ids.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-code.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/resolve-new-id.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/code/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/common.d.ts.map +0 -1
- package/lib/parser/cals/utils/getUsedReference.d.ts.map +0 -1
- package/lib/parser/cals/utils/getUsedResources.d.ts.map +0 -1
- package/lib/parser/cals/utils/runtime.d.ts.map +0 -1
- package/lib/parser/cals/utils/spinoff/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/style.d.ts.map +0 -1
- package/lib/parser/cals/utils/template.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/common.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/config.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/parses.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/utils.d.ts.map +0 -1
- package/lib/parser/dependiencies/index.d.ts.map +0 -1
- package/lib/parser/expression/index.d.ts.map +0 -1
- package/lib/parser/index.d.ts.map +0 -1
- package/lib/parser/plugins/postcss-rpx2clac.d.ts.map +0 -1
- package/lib/types/basic/app.d.ts.map +0 -1
- package/lib/types/basic/common.d.ts.map +0 -1
- package/lib/types/basic/component.d.ts.map +0 -1
- package/lib/types/basic/datasource.d.ts.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/lcds.d.ts +0 -610
- package/lib/types/lcds.d.ts.map +0 -1
- package/lib/types/lcds.js +0 -25
- package/lib/types/platform/app.d.ts.map +0 -1
- package/lib/types/platform/common.d.ts.map +0 -1
- package/lib/types/platform/component.d.ts.map +0 -1
- package/lib/types/platform/datasource.d.ts.map +0 -1
- package/lib/types/platform/eventFlow.d.ts.map +0 -1
- package/lib/types/platform/query.d.ts.map +0 -1
- package/lib/types/platform/theme.d.ts.map +0 -1
- package/lib/utils/CSSProperty.d.ts.map +0 -1
- package/lib/utils/color-generator/core.d.ts.map +0 -1
- package/lib/utils/color-generator/generate.d.ts.map +0 -1
- package/lib/utils/color-generator/utils.d.ts.map +0 -1
- package/lib/utils/constant.d.ts.map +0 -1
- package/lib/utils/dts/auto-generated.d.ts +0 -2
- package/lib/utils/dts/auto-generated.d.ts.map +0 -1
- package/lib/utils/dts/index.d.ts.map +0 -1
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/version/common.d.ts.map +0 -1
- package/lib/utils/version/featureChecker.d.ts.map +0 -1
- package/lib/utils/version/migrations/version4.d.ts.map +0 -1
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/get-component-namespace.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/get-component-namespace.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-dataset.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-dataset.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-listeners.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-listeners.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-resources.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-resources.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/remap-component-ids.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-code.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-code.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-expr.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-expr.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-resource.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-resource.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/resolve-new-id.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/resolve-new-id.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/index.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/code/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/code/index.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/common.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/getUsedReference.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/getUsedReference.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/getUsedResources.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/getUsedResources.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/runtime.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/runtime.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/spinoff/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/spinoff/index.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/style.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/style.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/template.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/common.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/common.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/config.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/config.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/index.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/parses.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/parses.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/utils.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/utils.js +0 -0
- /package/lib/{parser → cjs/parser}/dependiencies/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/dependiencies/index.js +0 -0
- /package/lib/{parser → cjs/parser}/expression/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/expression/index.js +0 -0
- /package/lib/{parser → cjs/parser}/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/index.js +0 -0
- /package/lib/{parser → cjs/parser}/plugins/postcss-rpx2clac.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/plugins/postcss-rpx2clac.js +0 -0
- /package/lib/{types → cjs/types}/basic/app.d.ts +0 -0
- /package/lib/{types → cjs/types}/basic/app.js +0 -0
- /package/lib/{types → cjs/types}/basic/common.d.ts +0 -0
- /package/lib/{types → cjs/types}/basic/common.js +0 -0
- /package/lib/{types → cjs/types}/basic/component.d.ts +0 -0
- /package/lib/{types → cjs/types}/basic/component.js +0 -0
- /package/lib/{types → cjs/types}/basic/datasource.d.ts +0 -0
- /package/lib/{types → cjs/types}/basic/datasource.js +0 -0
- /package/lib/{types → cjs/types}/platform/app.js +0 -0
- /package/lib/{types → cjs/types}/platform/common.d.ts +0 -0
- /package/lib/{types → cjs/types}/platform/common.js +0 -0
- /package/lib/{types → cjs/types}/platform/component.js +0 -0
- /package/lib/{types → cjs/types}/platform/datasource.js +0 -0
- /package/lib/{types → cjs/types}/platform/eventFlow.d.ts +0 -0
- /package/lib/{types → cjs/types}/platform/eventFlow.js +0 -0
- /package/lib/{types → cjs/types}/platform/query.d.ts +0 -0
- /package/lib/{types → cjs/types}/platform/query.js +0 -0
- /package/lib/{types → cjs/types}/platform/theme.js +0 -0
- /package/lib/{utils → cjs/utils}/CSSProperty.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/CSSProperty.js +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/core.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/core.js +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/generate.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/generate.js +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/utils.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/utils.js +0 -0
- /package/lib/{utils → cjs/utils}/constant.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/constant.js +0 -0
- /package/lib/{utils → cjs/utils}/dts/build.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/dts/build.js +0 -0
- /package/lib/{utils → cjs/utils}/dts/index.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/dts/index.js +0 -0
- /package/lib/{utils → cjs/utils}/index.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/index.js +0 -0
- /package/lib/{utils → cjs/utils}/version/common.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/version/common.js +0 -0
- /package/lib/{utils → cjs/utils}/version/featureChecker.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/version/featureChecker.js +0 -0
- /package/lib/{utils → cjs/utils}/version/migrations/version4.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/version/migrations/version4.js +0 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { EQueryType, } from '../../../../types';
|
|
13
|
+
import get from 'lodash/get';
|
|
14
|
+
import set from 'lodash/set';
|
|
15
|
+
import isEqual from 'lodash/isEqual';
|
|
16
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
17
|
+
import isObject from 'lodash/isObject';
|
|
18
|
+
import { ActionType, DynamicValueParser, PropBindType } from '../../../expression';
|
|
19
|
+
import { VisitedMap, refreshComponentIds, remapComponentIds } from './helpers/remap-component-ids';
|
|
20
|
+
import { walkThroughComponents } from '../common';
|
|
21
|
+
import { getComponentNamespace } from './helpers/get-component-namespace';
|
|
22
|
+
import { renewIdInResource } from './helpers/renew-id-in-resource';
|
|
23
|
+
import { mergeResources } from './helpers/merge-resources';
|
|
24
|
+
import { mergeDataset } from './helpers/merge-dataset';
|
|
25
|
+
import { mergeListeners } from './helpers/merge-listeners';
|
|
26
|
+
import { DYNAMIC_KEY_REG } from '../../../../utils';
|
|
27
|
+
import { renewIdInCode } from './helpers/renew-id-in-code';
|
|
28
|
+
export { renewIdInResource } from './helpers/renew-id-in-resource';
|
|
29
|
+
export { remapComponentIds, refreshComponentIds } from './helpers/remap-component-ids';
|
|
30
|
+
export { VisitedMap } from './helpers/remap-component-ids';
|
|
31
|
+
export function parseComponentCals(ctx, cals) {
|
|
32
|
+
if (!ctx.datasetMap) {
|
|
33
|
+
ctx.datasetMap = {};
|
|
34
|
+
}
|
|
35
|
+
if (!ctx.dataSourceMap) {
|
|
36
|
+
ctx.dataSourceMap = {};
|
|
37
|
+
}
|
|
38
|
+
if (!ctx.componentMap) {
|
|
39
|
+
ctx.componentMap = {};
|
|
40
|
+
}
|
|
41
|
+
if (!ctx.lowcodeMap) {
|
|
42
|
+
ctx.lowcodeMap = {};
|
|
43
|
+
}
|
|
44
|
+
if (!ctx.componentLibMap) {
|
|
45
|
+
ctx.componentLibMap = {};
|
|
46
|
+
}
|
|
47
|
+
ctx.component = {
|
|
48
|
+
id: cals.id || '',
|
|
49
|
+
};
|
|
50
|
+
const { component, module, attributes = {}, items = [], listeners = [], directives = {}, [':class']: dynamicClassList, [':style']: dynamicStyle, } = cals;
|
|
51
|
+
if (module && component && !get(ctx.componentMap, `${module}.${component}`)) {
|
|
52
|
+
set(ctx.componentMap, `${module}.${component}`, true);
|
|
53
|
+
ctx.componentLibMap[module] = true;
|
|
54
|
+
}
|
|
55
|
+
// 优先处理 directives 因为其他绑定会用到for
|
|
56
|
+
parseDirectivesCals(ctx, directives);
|
|
57
|
+
pasrseDynamicMapCals(ctx, attributes);
|
|
58
|
+
for (let item of listeners) {
|
|
59
|
+
parseListenertCals(ctx, item);
|
|
60
|
+
}
|
|
61
|
+
if (dynamicClassList) {
|
|
62
|
+
parseValueCals(ctx, dynamicClassList);
|
|
63
|
+
}
|
|
64
|
+
if (dynamicStyle) {
|
|
65
|
+
parseValueCals(ctx, dynamicStyle);
|
|
66
|
+
}
|
|
67
|
+
for (let item of items) {
|
|
68
|
+
parseComponentCals(ctx, item);
|
|
69
|
+
}
|
|
70
|
+
return ctx;
|
|
71
|
+
}
|
|
72
|
+
function parseListenertCals(ctx, listener) {
|
|
73
|
+
let { type, handler } = listener;
|
|
74
|
+
switch (type) {
|
|
75
|
+
case ActionType.Rematch: {
|
|
76
|
+
if (handler === null || handler === void 0 ? void 0 : handler.name) {
|
|
77
|
+
ctx.lowcodeMap[handler === null || handler === void 0 ? void 0 : handler.name] = true;
|
|
78
|
+
}
|
|
79
|
+
pasrseDynamicMapCals(ctx, handler === null || handler === void 0 ? void 0 : handler.params);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case ActionType.DataSource: {
|
|
83
|
+
let params = handler === null || handler === void 0 ? void 0 : handler.params;
|
|
84
|
+
pasrseDynamicMapCals(params);
|
|
85
|
+
if (params === null || params === void 0 ? void 0 : params.dataSourceName) {
|
|
86
|
+
ctx.dataSourceMap[params === null || params === void 0 ? void 0 : params.dataSourceName] = true;
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case ActionType.Material: {
|
|
91
|
+
if (handler === null || handler === void 0 ? void 0 : handler.module) {
|
|
92
|
+
ctx.componentLibMap[handler === null || handler === void 0 ? void 0 : handler.module] = true;
|
|
93
|
+
}
|
|
94
|
+
pasrseDynamicMapCals(ctx, handler === null || handler === void 0 ? void 0 : handler.params);
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
case ActionType.Platform: {
|
|
98
|
+
pasrseDynamicMapCals(ctx, handler === null || handler === void 0 ? void 0 : handler.params);
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function pasrseDynamicMapCals(ctx, map = {}) {
|
|
104
|
+
for (let key in map) {
|
|
105
|
+
if (/^:/.test(key) && typeof map[key] === 'string') {
|
|
106
|
+
parseValueCals(ctx, map[key]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function parseDirectivesCals(ctx, directives) {
|
|
111
|
+
var _a;
|
|
112
|
+
// 优先处理for,因为其他的可能会用到 foritem
|
|
113
|
+
let forValue = directives[':for'];
|
|
114
|
+
if (typeof forValue === 'string') {
|
|
115
|
+
parseValueCals(ctx, forValue);
|
|
116
|
+
if (!ctx.forContext) {
|
|
117
|
+
ctx.forContext = {};
|
|
118
|
+
}
|
|
119
|
+
if ((_a = ctx.component) === null || _a === void 0 ? void 0 : _a.id) {
|
|
120
|
+
ctx.forContext[ctx.component.id] = true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
let visibleValue = directives[':if'];
|
|
124
|
+
if (typeof visibleValue === 'string') {
|
|
125
|
+
parseValueCals(ctx, visibleValue);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function parseValueCals(ctx, value) {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
function processExpression(ctx, value) {
|
|
131
|
+
const regex = /\$([\w.]+)\.dataset\.(state|params)\.([\w$]+)/gm;
|
|
132
|
+
const matches = value.match(regex) || [];
|
|
133
|
+
for (let i = 0; i < matches.length; i++) {
|
|
134
|
+
const match = matches[i];
|
|
135
|
+
const [_, scope, type, varName] = regex.exec(match);
|
|
136
|
+
let key = '';
|
|
137
|
+
switch (scope) {
|
|
138
|
+
case 'page':
|
|
139
|
+
case 'w.page': {
|
|
140
|
+
key = '$page';
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
case 'app':
|
|
144
|
+
case 'w.app': {
|
|
145
|
+
key = '$app';
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (key && type && varName) {
|
|
150
|
+
if (!ctx.datasetMap[key]) {
|
|
151
|
+
ctx.datasetMap[key] = {};
|
|
152
|
+
}
|
|
153
|
+
ctx.datasetMap[key][`${type}.${varName}`] = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
let res;
|
|
158
|
+
try {
|
|
159
|
+
let parser = new DynamicValueParser(value, { pageId: '$page' });
|
|
160
|
+
res = parser.parse();
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
try {
|
|
164
|
+
processExpression(ctx, value);
|
|
165
|
+
}
|
|
166
|
+
catch (e) {
|
|
167
|
+
console.error(e);
|
|
168
|
+
}
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
try {
|
|
172
|
+
switch (res.type) {
|
|
173
|
+
case PropBindType.params:
|
|
174
|
+
case PropBindType.stateData: {
|
|
175
|
+
const TYPE_MAP = {
|
|
176
|
+
[PropBindType.params]: 'params',
|
|
177
|
+
[PropBindType.stateData]: 'state',
|
|
178
|
+
};
|
|
179
|
+
const type = TYPE_MAP[res.type];
|
|
180
|
+
const path = ((_a = res.value) === null || _a === void 0 ? void 0 : _a.split('.')) || [];
|
|
181
|
+
let key = path[0];
|
|
182
|
+
if (!ctx.datasetMap[key]) {
|
|
183
|
+
ctx.datasetMap[key] = {};
|
|
184
|
+
}
|
|
185
|
+
if (path.length === 1) {
|
|
186
|
+
ctx.datasetMap[key][type] = true;
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
ctx.datasetMap[key][`${type}.${path[1].replace(/\[.*/, '')}`] = true;
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
case PropBindType.forItem: {
|
|
194
|
+
const [id] = ((_b = res.value) === null || _b === void 0 ? void 0 : _b.split('.')) || [];
|
|
195
|
+
if (!ctx.forContext[id]) {
|
|
196
|
+
throw {
|
|
197
|
+
code: 'INVALID_FOR_CONTEXT',
|
|
198
|
+
message: '缺少循环上下文,无法保存为区块',
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
case PropBindType.expression: {
|
|
204
|
+
processExpression(ctx, value);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (e) {
|
|
209
|
+
if ((e === null || e === void 0 ? void 0 : e.code) === 'INVALID_FOR_CONTEXT') {
|
|
210
|
+
throw e;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
export function regenBlockTemplateCals(ctx, cals) {
|
|
215
|
+
var _a, _b, _c;
|
|
216
|
+
const page = cals.items[0];
|
|
217
|
+
const { componentIdMap } = remapComponentIds(page.items, ctx.visiting);
|
|
218
|
+
page.items = regenBlockTemplateComponents(Object.assign(Object.assign({}, ctx), { componentIdMap }), page.items);
|
|
219
|
+
// 应用资源更新 ID
|
|
220
|
+
cals.resources = (_a = cals.resources) === null || _a === void 0 ? void 0 : _a.map((resource) => renewIdInResource(resource, componentIdMap));
|
|
221
|
+
// 页面资源更新 ID
|
|
222
|
+
page.resources = (_b = page.resources) === null || _b === void 0 ? void 0 : _b.map((resource) => renewIdInResource(resource, componentIdMap));
|
|
223
|
+
Object.keys(((_c = page === null || page === void 0 ? void 0 : page.dataset) === null || _c === void 0 ? void 0 : _c.query) || {}).forEach((key) => {
|
|
224
|
+
var _a, _b;
|
|
225
|
+
const query = (_b = (_a = page.dataset) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b[key];
|
|
226
|
+
if ((query === null || query === void 0 ? void 0 : query.type) === EQueryType.GeneralFunc && query.handler[':code']) {
|
|
227
|
+
query.handler[':code'] = renewIdInCode(query.handler[':code'], componentIdMap);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
return cals;
|
|
231
|
+
}
|
|
232
|
+
export function regenBlockTemplateComponents(ctx, components) {
|
|
233
|
+
let { componentIdMap } = ctx, restContext = __rest(ctx, ["componentIdMap"]);
|
|
234
|
+
if (!componentIdMap) {
|
|
235
|
+
componentIdMap = remapComponentIds(components, ctx.visiting).componentIdMap;
|
|
236
|
+
}
|
|
237
|
+
return components.map((component) => {
|
|
238
|
+
let processed = refreshComponentIds({ componentIdMap }, component);
|
|
239
|
+
return expandComponentReference(restContext, Object.assign(Object.assign({}, processed), { extra: Object.assign(Object.assign({}, processed.extra), { xIndex: undefined, anchored: true }) }));
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* todo: dataForm 追加
|
|
244
|
+
*/
|
|
245
|
+
export function mergeCals(ctx, list) {
|
|
246
|
+
const visitedContext = {
|
|
247
|
+
existing: new VisitedMap(),
|
|
248
|
+
untilNow: new VisitedMap(),
|
|
249
|
+
};
|
|
250
|
+
// 不修改原始数据
|
|
251
|
+
const clonedCalsList = JSON.parse(JSON.stringify(list));
|
|
252
|
+
// 初始化 `visitedContext.existing` 数据
|
|
253
|
+
for (const { cals } of clonedCalsList) {
|
|
254
|
+
if (cals.items.length > 1) {
|
|
255
|
+
throw new Error('不支持对多页面的 CALS 进行合并');
|
|
256
|
+
}
|
|
257
|
+
// 区块只有一个页面
|
|
258
|
+
const page = cals.items[0];
|
|
259
|
+
walkThroughComponents(page.items, (item) => {
|
|
260
|
+
var _a;
|
|
261
|
+
(_a = item.extra) === null || _a === void 0 ? true : delete _a.xIndex;
|
|
262
|
+
if (!item.component || typeof item.component !== 'string') {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const namespace = getComponentNamespace(item.component);
|
|
266
|
+
visitedContext.existing.add(namespace, item.id);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* 根据 `visitedContext` 收集的信息,按需更新组件 ID
|
|
271
|
+
* 组件id是页面隔离的,因此限制约定,只处理 0 号页面
|
|
272
|
+
*/
|
|
273
|
+
for (const { cals } of clonedCalsList) {
|
|
274
|
+
// 包含副作用,修改 cals 上id 为新id
|
|
275
|
+
regenBlockTemplateCals({ visiting: visitedContext, blockTemplateMap: ctx.blockTemplateMap }, cals);
|
|
276
|
+
}
|
|
277
|
+
const mergedCals = clonedCalsList
|
|
278
|
+
.map((meta) => meta.cals)
|
|
279
|
+
.reduce((first, second) => {
|
|
280
|
+
return pureMergeCals(first, second, () => [mergePage(first.items[0], second.items[0])]);
|
|
281
|
+
});
|
|
282
|
+
return mergedCals;
|
|
283
|
+
}
|
|
284
|
+
function pureMergeCals(first, second, resolveItems = (first, second) => {
|
|
285
|
+
return [...(first.items || []), ...(second.items || [])];
|
|
286
|
+
}) {
|
|
287
|
+
return Object.assign(Object.assign(Object.assign({}, second), first), { items: resolveItems(first, second), resources: mergeResources(first.resources, second.resources) || [], dataset: mergeDataset(first.dataset, second.dataset) || {}, theme: first.theme || second.theme, extra: Object.assign(Object.assign({}, second.extra), first.extra), externalResources: mergeExternalResources(first.externalResources, second.externalResources) });
|
|
288
|
+
}
|
|
289
|
+
function mergeExternalResources(origin = [], current = []) {
|
|
290
|
+
const MAP = origin.reduce((map, item) => {
|
|
291
|
+
const { type, url, code } = item;
|
|
292
|
+
map[`${type}:${url}:${code}`] = item;
|
|
293
|
+
return map;
|
|
294
|
+
}, {});
|
|
295
|
+
return [
|
|
296
|
+
...origin,
|
|
297
|
+
...current.filter((item) => {
|
|
298
|
+
const { type, url, code } = item;
|
|
299
|
+
return !MAP[`${type}:${url}:${code}`];
|
|
300
|
+
}),
|
|
301
|
+
];
|
|
302
|
+
}
|
|
303
|
+
function mergePage(firstPage, secondPage, resolveItems = (first, second) => {
|
|
304
|
+
return [...(first.items || []), ...(second.items || [])];
|
|
305
|
+
}) {
|
|
306
|
+
const mergedPage = Object.assign(Object.assign(Object.assign({}, secondPage), firstPage), { items: resolveItems(firstPage, secondPage), resources: mergeResources(firstPage.resources, secondPage.resources) || [], dataset: mergeDataset(firstPage.dataset, secondPage.dataset) || {}, listeners: mergeListeners(firstPage.listeners, secondPage.listeners), attributes: Object.assign(Object.assign({}, secondPage.attributes), firstPage.attributes), extra: Object.assign(Object.assign({}, secondPage.extra), firstPage.extra) });
|
|
307
|
+
if (!mergedPage.listeners) {
|
|
308
|
+
delete mergedPage.listeners;
|
|
309
|
+
}
|
|
310
|
+
return mergedPage;
|
|
311
|
+
}
|
|
312
|
+
export function expandComponentReference(ctx, component) {
|
|
313
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
314
|
+
const { blockTemplateMap, strict, enableRestore, processPickedTeamplate = (template) => template } = ctx;
|
|
315
|
+
const { extra = {}, id, component: componentName } = component;
|
|
316
|
+
const { ref } = extra;
|
|
317
|
+
if (ref) {
|
|
318
|
+
if (blockTemplateMap[ref]) {
|
|
319
|
+
if ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.referenceMap) === null || _a === void 0 ? void 0 : _a[ref]) {
|
|
320
|
+
if (strict) {
|
|
321
|
+
throw new Error(`存在循环引用:${ref}`);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
const block = processPickedTeamplate(cloneDeep(blockTemplateMap[ref]), { ref, component });
|
|
328
|
+
const cals = regenBlockTemplateCals(Object.assign(Object.assign({}, ctx), { referenceMap: Object.assign(Object.assign({}, ctx.referenceMap), { [ref]: true }) }), block.content);
|
|
329
|
+
if (ctx.patchRef) {
|
|
330
|
+
const global = ctx.patchRef.cals;
|
|
331
|
+
const page = ctx.patchRef.page;
|
|
332
|
+
if (page) {
|
|
333
|
+
Object.assign(page, mergePage(page, cals.items[0]), () => []);
|
|
334
|
+
}
|
|
335
|
+
if (global) {
|
|
336
|
+
Object.assign(global, pureMergeCals(global, cals), () => []);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
const blockContent = (_b = cals.items[0].items) === null || _b === void 0 ? void 0 : _b[0];
|
|
340
|
+
if (!blockContent) {
|
|
341
|
+
return undefined;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* 动态配置协议有修改未定
|
|
345
|
+
* 因此先写死限制
|
|
346
|
+
*/
|
|
347
|
+
if (!((_c = blockContent === null || blockContent === void 0 ? void 0 : blockContent.extra) === null || _c === void 0 ? void 0 : _c.dataForm) &&
|
|
348
|
+
blockContent.component === 'Container' &&
|
|
349
|
+
(((_d = blockContent.attributes) === null || _d === void 0 ? void 0 : _d.data) || ((_e = blockContent.attributes) === null || _e === void 0 ? void 0 : _e[':data'])) &&
|
|
350
|
+
((_f = block.dynamicConfig) === null || _f === void 0 ? void 0 : _f.type) === 'object' &&
|
|
351
|
+
((_g = block.dynamicConfig) === null || _g === void 0 ? void 0 : _g.properties.configs)) {
|
|
352
|
+
blockContent.extra = Object.assign(Object.assign({}, blockContent.extra), { dataForm: { data: (_h = block.dynamicConfig) === null || _h === void 0 ? void 0 : _h.properties.configs } });
|
|
353
|
+
}
|
|
354
|
+
const { attributes: blockAttributes = {} } = blockContent;
|
|
355
|
+
return Object.assign(Object.assign({}, blockContent), {
|
|
356
|
+
// todo: 这里合并有问题,无法简单的合并
|
|
357
|
+
attributes: Object.assign(Object.assign({}, blockAttributes), component.attributes), ':style': component[':style'] || blockContent[':style'], ':class': component[':class'] || blockContent[':class'], extra: Object.assign(Object.assign({}, blockContent.extra), { refAttributes: enableRestore && Object.keys(blockAttributes) ? blockAttributes : undefined, ref: enableRestore ? ref : undefined }) });
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
if (strict) {
|
|
361
|
+
throw new Error(`未找到引用:${ref}`);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
return undefined;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return Object.assign(Object.assign({}, component), { items: (_k = (_j = component.items) === null || _j === void 0 ? void 0 : _j.map) === null || _k === void 0 ? void 0 : _k.call(_j, (item) => expandComponentReference(ctx, item)).filter((item) => !!item) });
|
|
369
|
+
}
|
|
370
|
+
export function collapseComponentReference(ctx, component) {
|
|
371
|
+
var _a, _b, _c;
|
|
372
|
+
const { extra, attributes = {}, ':style': styleBind, ':class': classBind } = component;
|
|
373
|
+
const { blockTemplateMap } = ctx;
|
|
374
|
+
const _d = extra || {}, { ref, anchored, dataForm, refAttributes } = _d, restExtra = __rest(_d, ["ref", "anchored", "dataForm", "refAttributes"]);
|
|
375
|
+
if (ref && blockTemplateMap[ref]) {
|
|
376
|
+
const processed = {};
|
|
377
|
+
const blockContent = (_c = (_b = (_a = blockTemplateMap[ref].content.items) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.items) === null || _c === void 0 ? void 0 : _c[0];
|
|
378
|
+
restExtra.ref = ref;
|
|
379
|
+
processed.attributes = filterMap(attributes, refAttributes);
|
|
380
|
+
if (styleBind !== blockContent[':style']) {
|
|
381
|
+
processed[':style'] = styleBind;
|
|
382
|
+
}
|
|
383
|
+
if (classBind !== blockContent[':class']) {
|
|
384
|
+
processed[':class'] = classBind;
|
|
385
|
+
}
|
|
386
|
+
processed.extra = filterMap(restExtra, blockContent === null || blockContent === void 0 ? void 0 : blockContent.extra);
|
|
387
|
+
return processed;
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
const _e = (component === null || component === void 0 ? void 0 : component.extra) || {}, { ref, refAttributes, dataForm } = _e, rest = __rest(_e, ["ref", "refAttributes", "dataForm"]);
|
|
391
|
+
return Object.assign(Object.assign({}, component), { extra: (component === null || component === void 0 ? void 0 : component.extra) ? rest : component === null || component === void 0 ? void 0 : component.extra });
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
function filterMap(current = {}, base = {}) {
|
|
395
|
+
const filtered = {};
|
|
396
|
+
Object.entries(current).forEach(([key, value]) => {
|
|
397
|
+
// todo: 变量绑定key与非绑定key应为相同key
|
|
398
|
+
if (!isEqual(base[key], value)) {
|
|
399
|
+
filtered[key] = value;
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
return filtered;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* 转换区块 page 到 template
|
|
406
|
+
*/
|
|
407
|
+
export function processPage2Template(page, properties) {
|
|
408
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
409
|
+
let { items = [] } = page;
|
|
410
|
+
let dataForm = {};
|
|
411
|
+
if (items.length > 1) {
|
|
412
|
+
items = items;
|
|
413
|
+
items = [{ id: `comtainer_${page.id}`, component: 'Container', attributes: {}, items: items }];
|
|
414
|
+
}
|
|
415
|
+
else if (items.length === 1) {
|
|
416
|
+
let component = items[0];
|
|
417
|
+
// simple block
|
|
418
|
+
if (component.component === 'Container' && (((_c = (_b = (_a = component.extra) === null || _a === void 0 ? void 0 : _a.dataForm) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.type) === 'object' || properties)) {
|
|
419
|
+
const _k = component.attributes, { data } = _k, rest = __rest(_k, ["data"]);
|
|
420
|
+
component = Object.assign(Object.assign({}, component), { attributes: Object.assign(Object.assign({}, rest), { ':data': `Object.assign(${isObject(data) ? JSON.stringify(data) : '{}'}, $comp.props.data)` }) });
|
|
421
|
+
dataForm = properties || ((_f = (_e = (_d = component.extra) === null || _d === void 0 ? void 0 : _d.dataForm) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.properties);
|
|
422
|
+
}
|
|
423
|
+
component = Object.assign(Object.assign({}, component), { extra: Object.assign(Object.assign({}, component.extra), { anchored: undefined, dataForm: undefined }) });
|
|
424
|
+
items = [component];
|
|
425
|
+
}
|
|
426
|
+
const TRANSFER_EVENTNAME_MAP = {
|
|
427
|
+
load: 'attached',
|
|
428
|
+
unload: 'detached',
|
|
429
|
+
};
|
|
430
|
+
function replacePageMember(str) {
|
|
431
|
+
return (str === null || str === void 0 ? void 0 : str.replace(/(?:\$w\.page|\$page).(dataset|handler)/g, '$comp.$1')) || str;
|
|
432
|
+
}
|
|
433
|
+
return JSON.parse(JSON.stringify({
|
|
434
|
+
id: page.id,
|
|
435
|
+
name: page.id,
|
|
436
|
+
items,
|
|
437
|
+
listeners: (_h = (_g = page.listeners) === null || _g === void 0 ? void 0 : _g.map) === null || _h === void 0 ? void 0 : _h.call(_g, (listener) => {
|
|
438
|
+
return Object.assign(Object.assign({}, listener), { eventName: TRANSFER_EVENTNAME_MAP[listener.eventName] || listener.eventName });
|
|
439
|
+
}),
|
|
440
|
+
dataset: page.dataset,
|
|
441
|
+
resources: (_j = page.resources) === null || _j === void 0 ? void 0 : _j.map((item) => {
|
|
442
|
+
return Object.assign(Object.assign({}, item), { code: replacePageMember(item.code || '') });
|
|
443
|
+
}),
|
|
444
|
+
data: { properties: properties || dataForm },
|
|
445
|
+
}, function (key, v) {
|
|
446
|
+
if (DYNAMIC_KEY_REG.test(key) && typeof v === 'string') {
|
|
447
|
+
return replacePageMember(v);
|
|
448
|
+
}
|
|
449
|
+
return v;
|
|
450
|
+
}));
|
|
451
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cals 与 code 互转
|
|
3
|
+
* 这里的 code 是中间状态的 code,即非最终生成的可运行的项目代码
|
|
4
|
+
*/
|
|
5
|
+
import { IPlatformApp, IPlatformSubApp } from '../../../../types';
|
|
6
|
+
export interface ICodeItem {
|
|
7
|
+
path: string;
|
|
8
|
+
code: string;
|
|
9
|
+
conflict?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* CALS 转成 中间状态的代码
|
|
13
|
+
*
|
|
14
|
+
* @params version: v0 - 没有 pages 目录; v1 - 有 pages 目录
|
|
15
|
+
*/
|
|
16
|
+
export declare function calsToCode(calsJSON: IPlatformApp | IPlatformSubApp, version?: 'v0' | 'v1'): ICodeItem[];
|
|
17
|
+
/**
|
|
18
|
+
* 中间状态的代码 转成 CALS
|
|
19
|
+
*
|
|
20
|
+
* @params version: v0 - 没有 pages 目录; v1 - 有 pages 目录
|
|
21
|
+
*/
|
|
22
|
+
export declare function codeToCals(codeList: ICodeItem[], version?: 'v0' | 'v1'): IPlatformApp;
|
|
23
|
+
/**
|
|
24
|
+
* 指定代码内容是否存在冲突未解决
|
|
25
|
+
*/
|
|
26
|
+
export declare function checkForConflicts(code: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 以 from 为准自动解决冲突
|
|
29
|
+
*/
|
|
30
|
+
export declare function autoResolveConflicts(code: string, from: 'theirs' | 'ours'): string;
|
|
31
|
+
export declare function findAllConflicts(code: string, onlyFindFirstOne?: boolean): {
|
|
32
|
+
start: number;
|
|
33
|
+
middle: number;
|
|
34
|
+
end: number;
|
|
35
|
+
}[];
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/code/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,YAAY,EAMZ,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAK3B,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,YAAY,GAAG,eAAe,EAAE,OAAO,GAAE,IAAI,GAAG,IAAW,GAAG,SAAS,EAAE,CA4M7G;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,OAAO,GAAE,IAAI,GAAG,IAAW,GAAG,YAAY,CAgK3F;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CA6BlF;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,gBAAgB,GAAE,OAAe,GAChC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,CAoClD"}
|