@flextudio/scenario 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +260 -0
- package/bin/flex-scenario.mjs +895 -0
- package/commands/flex-spec.md +28 -0
- package/contract-data/README.md +267 -0
- package/contract-data/examples/README.md +147 -0
- package/contract-data/examples/basic/basic-list-detail.json +2521 -0
- package/contract-data/examples/basic/delivery-address-popup.json +2175 -0
- package/contract-data/examples/basic/fixedtop-floating-form.json +1524 -0
- package/contract-data/examples/basic/search-period-popup.json +1524 -0
- package/contract-data/examples/design/booking-wizard-3step.json +1335 -0
- package/contract-data/examples/design/list-detail-form-3step.json +1516 -0
- package/contract-data/examples/design/list-filter-2step.json +1365 -0
- package/contract-data/examples/design/list-filter-detail-3step.json +1570 -0
- package/contract-data/examples/design/result-entry-wizard-4step.json +1861 -0
- package/contract-data/examples/intent/mock-employee-list.json +54 -0
- package/contract-data/examples/intent/script-cart-flow.json +96 -0
- package/contract-data/examples/intent/script-dialog-confirm.json +61 -0
- package/contract-data/runtime/v1/collection/README.md +119 -0
- package/contract-data/runtime/v1/collection/_c.md +205 -0
- package/contract-data/runtime/v1/collection/category.md +165 -0
- package/contract-data/runtime/v1/collection/collection.md +135 -0
- package/contract-data/runtime/v1/collection/lifecycle.md +140 -0
- package/contract-data/runtime/v1/collection/naming.md +174 -0
- package/contract-data/runtime/v1/collection/sector.md +176 -0
- package/contract-data/runtime/v1/collection/status.md +114 -0
- package/contract-data/runtime/v1/intent-system/INTENT.md +552 -0
- package/contract-data/runtime/v1/intent-system/README.md +118 -0
- package/contract-data/runtime/v1/intent-system/intent.schema.json +164 -0
- package/contract-data/runtime/v1/intent-system/kinds/_base.mjs +137 -0
- package/contract-data/runtime/v1/intent-system/kinds/clearCategory.mjs +35 -0
- package/contract-data/runtime/v1/intent-system/kinds/copyStepValues.mjs +100 -0
- package/contract-data/runtime/v1/intent-system/kinds/deleteActive.mjs +45 -0
- package/contract-data/runtime/v1/intent-system/kinds/dialog.mjs +127 -0
- package/contract-data/runtime/v1/intent-system/kinds/reloadGroup.mjs +28 -0
- package/contract-data/runtime/v1/intent-system/kinds/updateActive.mjs +74 -0
- package/contract-data/runtime/v1/intent-system/materialize.mjs +495 -0
- package/contract-data/runtime/v1/script/README.md +37 -0
- package/contract-data/runtime/v1/script/current_step.md +112 -0
- package/contract-data/runtime/v1/script/f_collection.md +142 -0
- package/contract-data/runtime/v1/script/f_content.md +133 -0
- package/contract-data/runtime/v1/script/f_messagebox.md +132 -0
- package/contract-data/runtime/v1/script/scenario-gen-rules.md +264 -0
- package/contract-data/schema/v1/SKELETON-SHELL.md +120 -0
- package/contract-data/schema/v1/bottom-buttons.md +155 -0
- package/contract-data/schema/v1/bottom-buttons.schema.json +134 -0
- package/contract-data/schema/v1/control/_base.schema.json +1296 -0
- package/contract-data/schema/v1/control/button.md +147 -0
- package/contract-data/schema/v1/control/button.schema.json +55 -0
- package/contract-data/schema/v1/control/calendar-navigator.md +143 -0
- package/contract-data/schema/v1/control/calendar-navigator.schema.json +164 -0
- package/contract-data/schema/v1/control/calendar.md +128 -0
- package/contract-data/schema/v1/control/calendar.schema.json +18 -0
- package/contract-data/schema/v1/control/check-box.md +117 -0
- package/contract-data/schema/v1/control/check-box.schema.json +41 -0
- package/contract-data/schema/v1/control/combo.md +293 -0
- package/contract-data/schema/v1/control/combo.schema.json +23 -0
- package/contract-data/schema/v1/control/embed.md +211 -0
- package/contract-data/schema/v1/control/embed.schema.json +30 -0
- package/contract-data/schema/v1/control/image-box.md +237 -0
- package/contract-data/schema/v1/control/image-box.schema.json +49 -0
- package/contract-data/schema/v1/control/input-date.md +175 -0
- package/contract-data/schema/v1/control/input-date.schema.json +27 -0
- package/contract-data/schema/v1/control/input-file.md +192 -0
- package/contract-data/schema/v1/control/input-file.schema.json +139 -0
- package/contract-data/schema/v1/control/input-mask.md +89 -0
- package/contract-data/schema/v1/control/input-mask.schema.json +45 -0
- package/contract-data/schema/v1/control/input-number.md +55 -0
- package/contract-data/schema/v1/control/input-number.schema.json +24 -0
- package/contract-data/schema/v1/control/input-text.md +73 -0
- package/contract-data/schema/v1/control/input-text.schema.json +24 -0
- package/contract-data/schema/v1/control/label.md +127 -0
- package/contract-data/schema/v1/control/label.schema.json +113 -0
- package/contract-data/schema/v1/control/multi-input-box.md +51 -0
- package/contract-data/schema/v1/control/multi-input-box.schema.json +19 -0
- package/contract-data/schema/v1/control/other.schema.json +24 -0
- package/contract-data/schema/v1/control/radio-box.md +150 -0
- package/contract-data/schema/v1/control/radio-box.schema.json +87 -0
- package/contract-data/schema/v1/control/search.md +163 -0
- package/contract-data/schema/v1/control/search.schema.json +23 -0
- package/contract-data/schema/v1/control/tab.md +240 -0
- package/contract-data/schema/v1/control/tab.schema.json +112 -0
- package/contract-data/schema/v1/control/tree.md +278 -0
- package/contract-data/schema/v1/control/tree.schema.json +83 -0
- package/contract-data/schema/v1/control.md +264 -0
- package/contract-data/schema/v1/control.schema.json +30 -0
- package/contract-data/schema/v1/data-objects.md +278 -0
- package/contract-data/schema/v1/data-objects.schema.json +161 -0
- package/contract-data/schema/v1/data-sources.md +215 -0
- package/contract-data/schema/v1/data-sources.schema.json +184 -0
- package/contract-data/schema/v1/design-system/DESIGN.md +282 -0
- package/contract-data/schema/v1/design-system/README.md +235 -0
- package/contract-data/schema/v1/design-system/design.schema.json +496 -0
- package/contract-data/schema/v1/design-system/error-mapping.mjs +132 -0
- package/contract-data/schema/v1/design-system/materialize.mjs +1435 -0
- package/contract-data/schema/v1/design-system/tests/_base.additional-meta.test.mjs +98 -0
- package/contract-data/schema/v1/design-system/tests/_base.materialize.test.mjs +596 -0
- package/contract-data/schema/v1/design-system/tests/checklist.test.mjs +135 -0
- package/contract-data/schema/v1/design-system/tests/design.schema.test.mjs +487 -0
- package/contract-data/schema/v1/design-system/tests/error-mapping.test.mjs +244 -0
- package/contract-data/schema/v1/design-system/tests/materialize.test.mjs +1093 -0
- package/contract-data/schema/v1/design-system/tests/move-step.test.mjs +119 -0
- package/contract-data/schema/v1/design-system/tests/override.integration.test.mjs +116 -0
- package/contract-data/schema/v1/design-system/tokens.json +76 -0
- package/contract-data/schema/v1/events.md +467 -0
- package/contract-data/schema/v1/events.schema.json +272 -0
- package/contract-data/schema/v1/group.md +146 -0
- package/contract-data/schema/v1/group.schema.json +133 -0
- package/contract-data/schema/v1/mockup-data.md +186 -0
- package/contract-data/schema/v1/naming-objects.schema.json +133 -0
- package/contract-data/schema/v1/node.md +32 -0
- package/contract-data/schema/v1/node.schema.json +24 -0
- package/contract-data/schema/v1/patterns/_base.additional-meta.mjs +135 -0
- package/contract-data/schema/v1/patterns/_base.controls.mjs +759 -0
- package/contract-data/schema/v1/patterns/_base.icon.mjs +61 -0
- package/contract-data/schema/v1/patterns/_base.id.mjs +15 -0
- package/contract-data/schema/v1/patterns/_base.materialize.mjs +1181 -0
- package/contract-data/schema/v1/patterns/_base.style.mjs +312 -0
- package/contract-data/schema/v1/patterns/atom/badge.materialize.mjs +68 -0
- package/contract-data/schema/v1/patterns/atom/badge.schema.json +44 -0
- package/contract-data/schema/v1/patterns/atom/button.materialize.mjs +91 -0
- package/contract-data/schema/v1/patterns/atom/button.schema.json +70 -0
- package/contract-data/schema/v1/patterns/atom/checkbox.materialize.mjs +40 -0
- package/contract-data/schema/v1/patterns/atom/checkbox.schema.json +39 -0
- package/contract-data/schema/v1/patterns/atom/segmented-radio.materialize.mjs +67 -0
- package/contract-data/schema/v1/patterns/atom/segmented-radio.schema.json +49 -0
- package/contract-data/schema/v1/patterns/atom/switch.materialize.mjs +58 -0
- package/contract-data/schema/v1/patterns/atom/switch.schema.json +27 -0
- package/contract-data/schema/v1/patterns/molecule/checklist.materialize.mjs +130 -0
- package/contract-data/schema/v1/patterns/molecule/checklist.schema.json +63 -0
- package/contract-data/schema/v1/patterns/molecule/input-action.materialize.mjs +356 -0
- package/contract-data/schema/v1/patterns/molecule/input-action.schema.json +251 -0
- package/contract-data/schema/v1/patterns/molecule/input-button.materialize.mjs +183 -0
- package/contract-data/schema/v1/patterns/molecule/input-button.schema.json +141 -0
- package/contract-data/schema/v1/patterns/molecule/input-pair.materialize.mjs +254 -0
- package/contract-data/schema/v1/patterns/molecule/input-pair.schema.json +210 -0
- package/contract-data/schema/v1/scenario.md +112 -0
- package/contract-data/schema/v1/scenario.schema.json +161 -0
- package/contract-data/schema/v1/service/CustomSystem.md +139 -0
- package/contract-data/schema/v1/service/CustomSystem.schema.json +41 -0
- package/contract-data/schema/v1/service/Firestore.md +125 -0
- package/contract-data/schema/v1/service/Firestore.schema.json +28 -0
- package/contract-data/schema/v1/service/FlexAutoQuery.md +128 -0
- package/contract-data/schema/v1/service/FlexAutoQuery.schema.json +35 -0
- package/contract-data/schema/v1/service/FlexSQL.md +96 -0
- package/contract-data/schema/v1/service/FlexSQL.schema.json +33 -0
- package/contract-data/schema/v1/service/Flextudio API.md +161 -0
- package/contract-data/schema/v1/service/Flextudio API.schema.json +115 -0
- package/contract-data/schema/v1/service/Flextudio.md +87 -0
- package/contract-data/schema/v1/service/Flextudio.schema.json +26 -0
- package/contract-data/schema/v1/service/GoogleSheet.md +71 -0
- package/contract-data/schema/v1/service/GoogleSheet.schema.json +31 -0
- package/contract-data/schema/v1/service/README.md +127 -0
- package/contract-data/schema/v1/service/_base.schema.json +31 -0
- package/contract-data/schema/v1/service/ksystem.md +76 -0
- package/contract-data/schema/v1/service/ksystem.schema.json +36 -0
- package/contract-data/schema/v1/service-binding.md +228 -0
- package/contract-data/schema/v1/service-binding.schema.json +51 -0
- package/contract-data/schema/v1/step.md +546 -0
- package/contract-data/schema/v1/step.schema.json +258 -0
- package/contract-data/schema/v1/style-objects.md +183 -0
- package/contract-data/schema/v1/style-objects.schema.json +155 -0
- package/contract-data/spec/catalog.json +406 -0
- package/contract-data/spec/rules.md +400 -0
- package/node_modules/@flextudio/contract-core/contract.mjs +367 -0
- package/node_modules/@flextudio/contract-core/index.mjs +16 -0
- package/node_modules/@flextudio/contract-core/package.json +21 -0
- package/node_modules/@flextudio/contract-core/paths.mjs +72 -0
- package/node_modules/@flextudio/contract-core/schemas.mjs +474 -0
- package/node_modules/@flextudio/contract-core/validators.mjs +2471 -0
- package/node_modules/ajv/.runkit_example.js +23 -0
- package/node_modules/ajv/LICENSE +22 -0
- package/node_modules/ajv/README.md +207 -0
- package/node_modules/ajv/dist/2019.d.ts +19 -0
- package/node_modules/ajv/dist/2019.js +61 -0
- package/node_modules/ajv/dist/2019.js.map +1 -0
- package/node_modules/ajv/dist/2020.d.ts +19 -0
- package/node_modules/ajv/dist/2020.js +55 -0
- package/node_modules/ajv/dist/2020.js.map +1 -0
- package/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/node_modules/ajv/dist/ajv.js +50 -0
- package/node_modules/ajv/dist/ajv.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/node_modules/ajv/dist/compile/errors.js +123 -0
- package/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/node_modules/ajv/dist/compile/index.js +242 -0
- package/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js +236 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/node_modules/ajv/dist/compile/names.js +28 -0
- package/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/node_modules/ajv/dist/compile/rules.js +26 -0
- package/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/node_modules/ajv/dist/compile/util.js +178 -0
- package/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/node_modules/ajv/dist/core.d.ts +174 -0
- package/node_modules/ajv/dist/core.js +618 -0
- package/node_modules/ajv/dist/core.js.map +1 -0
- package/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/node_modules/ajv/dist/jtd.js +72 -0
- package/node_modules/ajv/dist/jtd.js.map +1 -0
- package/node_modules/ajv/dist/refs/data.json +13 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/node_modules/ajv/dist/standalone/index.js +90 -0
- package/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/node_modules/ajv/dist/types/index.js +3 -0
- package/node_modules/ajv/dist/types/index.js.map +1 -0
- package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/node_modules/ajv/lib/2019.ts +81 -0
- package/node_modules/ajv/lib/2020.ts +75 -0
- package/node_modules/ajv/lib/ajv.ts +70 -0
- package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/node_modules/ajv/lib/compile/index.ts +324 -0
- package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/node_modules/ajv/lib/compile/jtd/serialize.ts +277 -0
- package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/node_modules/ajv/lib/compile/names.ts +27 -0
- package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/node_modules/ajv/lib/compile/util.ts +213 -0
- package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/node_modules/ajv/lib/core.ts +892 -0
- package/node_modules/ajv/lib/jtd.ts +132 -0
- package/node_modules/ajv/lib/refs/data.json +13 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/node_modules/ajv/lib/types/index.ts +244 -0
- package/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +39 -0
- package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/node_modules/ajv/package.json +126 -0
- package/node_modules/fast-deep-equal/LICENSE +21 -0
- package/node_modules/fast-deep-equal/README.md +96 -0
- package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/react.js +79 -0
- package/node_modules/fast-deep-equal/index.d.ts +4 -0
- package/node_modules/fast-deep-equal/index.js +46 -0
- package/node_modules/fast-deep-equal/package.json +61 -0
- package/node_modules/fast-deep-equal/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/react.js +53 -0
- package/node_modules/fast-uri/.gitattributes +2 -0
- package/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/node_modules/fast-uri/.github/workflows/ci.yml +106 -0
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
- package/node_modules/fast-uri/LICENSE +30 -0
- package/node_modules/fast-uri/README.md +152 -0
- package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/node_modules/fast-uri/benchmark/package.json +17 -0
- package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/node_modules/fast-uri/eslint.config.js +6 -0
- package/node_modules/fast-uri/index.js +406 -0
- package/node_modules/fast-uri/lib/schemes.js +267 -0
- package/node_modules/fast-uri/lib/utils.js +443 -0
- package/node_modules/fast-uri/package.json +68 -0
- package/node_modules/fast-uri/test/ajv.test.js +43 -0
- package/node_modules/fast-uri/test/equal.test.js +117 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/node_modules/fast-uri/test/parse.test.js +323 -0
- package/node_modules/fast-uri/test/resolve.test.js +87 -0
- package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +39 -0
- package/node_modules/fast-uri/test/security.test.js +133 -0
- package/node_modules/fast-uri/test/serialize.test.js +151 -0
- package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/node_modules/fast-uri/test/uri-js.test.js +912 -0
- package/node_modules/fast-uri/test/util.test.js +38 -0
- package/node_modules/fast-uri/tsconfig.json +9 -0
- package/node_modules/fast-uri/types/index.d.ts +60 -0
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/node_modules/json-schema-traverse/LICENSE +21 -0
- package/node_modules/json-schema-traverse/README.md +95 -0
- package/node_modules/json-schema-traverse/index.d.ts +40 -0
- package/node_modules/json-schema-traverse/index.js +93 -0
- package/node_modules/json-schema-traverse/package.json +43 -0
- package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/node_modules/require-from-string/index.js +34 -0
- package/node_modules/require-from-string/license +21 -0
- package/node_modules/require-from-string/package.json +28 -0
- package/node_modules/require-from-string/readme.md +56 -0
- package/package.json +51 -0
- package/scripts/api-call.mjs +59 -0
- package/scripts/auth.mjs +262 -0
- package/scripts/build-skill-payload.mjs +338 -0
- package/scripts/cleanup.mjs +166 -0
- package/scripts/install-paths.mjs +146 -0
- package/scripts/postinstall.mjs +218 -0
- package/scripts/postpack.mjs +43 -0
- package/scripts/prepack.mjs +222 -0
- package/scripts/tty-menu.mjs +100 -0
- package/skill/README.md +55 -0
- package/skill/SKILL.md +138 -0
- package/skill/catalog.json +406 -0
- package/skill/design-rules.md +282 -0
- package/skill/design-system.md +235 -0
- package/skill/docs/SKELETON-SHELL.md +120 -0
- package/skill/docs/bottom-buttons.md +155 -0
- package/skill/docs/control/button.md +147 -0
- package/skill/docs/control/calendar-navigator.md +143 -0
- package/skill/docs/control/calendar.md +128 -0
- package/skill/docs/control/check-box.md +117 -0
- package/skill/docs/control/combo.md +293 -0
- package/skill/docs/control/embed.md +211 -0
- package/skill/docs/control/image-box.md +237 -0
- package/skill/docs/control/input-date.md +175 -0
- package/skill/docs/control/input-file.md +192 -0
- package/skill/docs/control/input-mask.md +89 -0
- package/skill/docs/control/input-number.md +55 -0
- package/skill/docs/control/input-text.md +73 -0
- package/skill/docs/control/label.md +127 -0
- package/skill/docs/control/multi-input-box.md +51 -0
- package/skill/docs/control/radio-box.md +150 -0
- package/skill/docs/control/search.md +163 -0
- package/skill/docs/control/tab.md +240 -0
- package/skill/docs/control/tree.md +278 -0
- package/skill/docs/control.md +264 -0
- package/skill/docs/data-objects.md +278 -0
- package/skill/docs/data-sources.md +215 -0
- package/skill/docs/events.md +467 -0
- package/skill/docs/group.md +146 -0
- package/skill/docs/index.json +125 -0
- package/skill/docs/mockup-data.md +186 -0
- package/skill/docs/node.md +32 -0
- package/skill/docs/scenario.md +112 -0
- package/skill/docs/service/CustomSystem.md +139 -0
- package/skill/docs/service/Firestore.md +125 -0
- package/skill/docs/service/FlexAutoQuery.md +128 -0
- package/skill/docs/service/FlexSQL.md +96 -0
- package/skill/docs/service/Flextudio API.md +161 -0
- package/skill/docs/service/Flextudio.md +87 -0
- package/skill/docs/service/GoogleSheet.md +71 -0
- package/skill/docs/service/README.md +127 -0
- package/skill/docs/service/ksystem.md +76 -0
- package/skill/docs/service-binding.md +228 -0
- package/skill/docs/step.md +546 -0
- package/skill/docs/style-objects.md +183 -0
- package/skill/examples/README.md +147 -0
- package/skill/examples/basic/basic-list-detail.json +2521 -0
- package/skill/examples/basic/delivery-address-popup.json +2175 -0
- package/skill/examples/basic/fixedtop-floating-form.json +1524 -0
- package/skill/examples/basic/search-period-popup.json +1524 -0
- package/skill/examples/design/booking-wizard-3step.json +1335 -0
- package/skill/examples/design/list-detail-form-3step.json +1516 -0
- package/skill/examples/design/list-filter-2step.json +1365 -0
- package/skill/examples/design/list-filter-detail-3step.json +1570 -0
- package/skill/examples/design/result-entry-wizard-4step.json +1861 -0
- package/skill/examples/index.json +150 -0
- package/skill/examples/intent/mock-employee-list.json +54 -0
- package/skill/examples/intent/script-cart-flow.json +96 -0
- package/skill/examples/intent/script-dialog-confirm.json +61 -0
- package/skill/intent-rules.md +552 -0
- package/skill/intent-system.md +118 -0
- package/skill/patterns/atom/badge.json +103 -0
- package/skill/patterns/atom/button.json +111 -0
- package/skill/patterns/atom/checkbox.json +70 -0
- package/skill/patterns/atom/segmented-radio.json +92 -0
- package/skill/patterns/atom/switch.json +57 -0
- package/skill/patterns/index.json +471 -0
- package/skill/patterns/molecule/checklist.json +107 -0
- package/skill/patterns/molecule/input-action.json +355 -0
- package/skill/patterns/molecule/input-button.json +212 -0
- package/skill/patterns/molecule/input-pair.json +284 -0
- package/skill/references/build-sequence.md +55 -0
- package/skill/references/patterns-cheatsheet.md +87 -0
- package/skill/references/spec-evolve/README.md +43 -0
- package/skill/references/spec-evolve/conventions.md +92 -0
- package/skill/references/spec-evolve/data-connection.md +102 -0
- package/skill/references/spec-evolve/intake.md +41 -0
- package/skill/references/spec-evolve/key-roles.md +44 -0
- package/skill/references/spec-evolve/lint.md +27 -0
- package/skill/references/spec-evolve/mockup.md +50 -0
- package/skill/references/spec-evolve/query-screens.md +66 -0
- package/skill/references/spec-evolve/routing.md +43 -0
- package/skill/references/spec-evolve/spec-format.md +76 -0
- package/skill/references/spec-evolve/templates/master-detail.spec.md +97 -0
- package/skill/references/spec-evolve/templates/query-screen.spec.md +96 -0
- package/skill/references/spec-evolve/templates/static-prototype.spec.md +54 -0
- package/skill/references/spec-evolve/templates-index.json +26 -0
- package/skill/rules.md +400 -0
- package/skill/schemas/bottom-buttons.schema.json +134 -0
- package/skill/schemas/control/_base.schema.json +1296 -0
- package/skill/schemas/control/button.schema.json +55 -0
- package/skill/schemas/control/calendar-navigator.schema.json +164 -0
- package/skill/schemas/control/calendar.schema.json +18 -0
- package/skill/schemas/control/check-box.schema.json +41 -0
- package/skill/schemas/control/combo.schema.json +23 -0
- package/skill/schemas/control/embed.schema.json +30 -0
- package/skill/schemas/control/image-box.schema.json +49 -0
- package/skill/schemas/control/input-date.schema.json +27 -0
- package/skill/schemas/control/input-file.schema.json +139 -0
- package/skill/schemas/control/input-mask.schema.json +45 -0
- package/skill/schemas/control/input-number.schema.json +24 -0
- package/skill/schemas/control/input-text.schema.json +24 -0
- package/skill/schemas/control/label.schema.json +113 -0
- package/skill/schemas/control/multi-input-box.schema.json +19 -0
- package/skill/schemas/control/other.schema.json +24 -0
- package/skill/schemas/control/radio-box.schema.json +87 -0
- package/skill/schemas/control/search.schema.json +23 -0
- package/skill/schemas/control/tab.schema.json +112 -0
- package/skill/schemas/control/tree.schema.json +83 -0
- package/skill/schemas/control.schema.json +30 -0
- package/skill/schemas/data-objects.schema.json +161 -0
- package/skill/schemas/data-sources.schema.json +184 -0
- package/skill/schemas/design-system/design.schema.json +496 -0
- package/skill/schemas/events.schema.json +272 -0
- package/skill/schemas/group.schema.json +133 -0
- package/skill/schemas/index.json +362 -0
- package/skill/schemas/naming-objects.schema.json +133 -0
- package/skill/schemas/node.schema.json +24 -0
- package/skill/schemas/patterns/atom/badge.schema.json +44 -0
- package/skill/schemas/patterns/atom/button.schema.json +70 -0
- package/skill/schemas/patterns/atom/checkbox.schema.json +39 -0
- package/skill/schemas/patterns/atom/segmented-radio.schema.json +49 -0
- package/skill/schemas/patterns/atom/switch.schema.json +27 -0
- package/skill/schemas/patterns/molecule/checklist.schema.json +63 -0
- package/skill/schemas/patterns/molecule/input-action.schema.json +251 -0
- package/skill/schemas/patterns/molecule/input-button.schema.json +141 -0
- package/skill/schemas/patterns/molecule/input-pair.schema.json +210 -0
- package/skill/schemas/scenario.schema.json +161 -0
- package/skill/schemas/service/CustomSystem.schema.json +41 -0
- package/skill/schemas/service/Firestore.schema.json +28 -0
- package/skill/schemas/service/FlexAutoQuery.schema.json +35 -0
- package/skill/schemas/service/FlexSQL.schema.json +33 -0
- package/skill/schemas/service/Flextudio API.schema.json +115 -0
- package/skill/schemas/service/Flextudio.schema.json +26 -0
- package/skill/schemas/service/GoogleSheet.schema.json +31 -0
- package/skill/schemas/service/_base.schema.json +31 -0
- package/skill/schemas/service/ksystem.schema.json +36 -0
- package/skill/schemas/service-binding.schema.json +51 -0
- package/skill/schemas/step.schema.json +258 -0
- package/skill/schemas/style-objects.schema.json +155 -0
- package/skill/skill-guides/README.md +50 -0
- package/skill/skill-guides/control-options.md +126 -0
- package/skill/skill-guides/events.md +61 -0
- package/skill/skill-guides/failure-discipline.md +95 -0
- package/skill/skill-guides/index.json +40 -0
- package/skill/skill-guides/prompt-interview.md +92 -0
- package/skill/skill-guides/scripts.md +169 -0
- package/skill/skill-guides/step-navigation.md +98 -0
|
@@ -0,0 +1,1435 @@
|
|
|
1
|
+
// design-system/materialize.mjs
|
|
2
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
3
|
+
// `design` 키 expander.
|
|
4
|
+
//
|
|
5
|
+
// LLM 이 raw control 안에 short-form `design` 객체를 넣으면, 이 모듈이
|
|
6
|
+
// 엔진 style objects (FontStyle / Width / Height / Padding / Margin /
|
|
7
|
+
// BgStyle / BorderStyle / DisplayStyle / ContentStyle / UseFixedSize) 로
|
|
8
|
+
// 풀어준다.
|
|
9
|
+
//
|
|
10
|
+
// 핵심 규칙 (Flextudio MCP design abstraction §):
|
|
11
|
+
// 1. design 안의 모든 색상은 tokens.json 의 slot 이름만 허용 — raw escape
|
|
12
|
+
// (`var(--colorXxx)` / `#hex` / `rgb(...)`) 는 거부. 일관성 강제.
|
|
13
|
+
// 2. typography 는 role 토큰만 (`body-large` / `title-medium` ...). FontWeight
|
|
14
|
+
// override 없음.
|
|
15
|
+
// 3. design 키 자체는 raw 와 공존 가능. 같은 leaf 가 겹치면 **design 우선**.
|
|
16
|
+
// design 이 건드리지 않는 raw leaf 는 그대로 보존.
|
|
17
|
+
// 4. sourceMap 산출 — validator 가 raw path 의 에러를 design path 로 역매핑
|
|
18
|
+
// 하여 LLM 에게 자기가 적은 키 이름으로 피드백할 수 있도록.
|
|
19
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
20
|
+
|
|
21
|
+
import { readFileSync } from "node:fs";
|
|
22
|
+
import { dirname, join } from "node:path";
|
|
23
|
+
import { fileURLToPath } from "node:url";
|
|
24
|
+
|
|
25
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
26
|
+
const TOKENS = JSON.parse(readFileSync(join(__dirname, "tokens.json"), "utf8"));
|
|
27
|
+
|
|
28
|
+
// surface 프리셋 (variant → design 키 묶음). Group 전용 매크로. SSOT: tokens.json#/surface.
|
|
29
|
+
const SURFACE = TOKENS.surface;
|
|
30
|
+
|
|
31
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
32
|
+
// 정적 enum (작아서 tokens.json 에 안 둠 — 단순 alias)
|
|
33
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
34
|
+
|
|
35
|
+
const FONT_ALIGN = { start: "flex-start", center: "center", end: "flex-end" };
|
|
36
|
+
|
|
37
|
+
const DISPLAY_ALIGN = {
|
|
38
|
+
left: "Left",
|
|
39
|
+
center: "Center",
|
|
40
|
+
right: "Right",
|
|
41
|
+
between: "Between",
|
|
42
|
+
};
|
|
43
|
+
const DISPLAY_VALIGN = { top: "Top", center: "Center", bottom: "Bottom" };
|
|
44
|
+
// flexbox 어휘 alias — 모델이 CSS flex 정렬 vocab(start/end/flex-start/flex-end)을
|
|
45
|
+
// 습관적으로 쓰는 케이스를 canonical 토큰으로 결정적 정규화. lookup 전에만 적용하고
|
|
46
|
+
// 정본 맵(DISPLAY_ALIGN/DISPLAY_VALIGN)은 순수 유지.
|
|
47
|
+
// - 수직(valign): start→top / end→bottom. 수평(align): start→left / end→right.
|
|
48
|
+
const VALIGN_ALIAS = { start: "top", "flex-start": "top", end: "bottom", "flex-end": "bottom" };
|
|
49
|
+
const ALIGN_ALIAS = { start: "left", "flex-start": "left", end: "right", "flex-end": "right" };
|
|
50
|
+
// DESIGN.md §DisplayStyle: justify=between → flexBoxType="space", 그 외 "align".
|
|
51
|
+
const FLEX_BOX_TYPE = {
|
|
52
|
+
left: "align",
|
|
53
|
+
center: "align",
|
|
54
|
+
right: "align",
|
|
55
|
+
between: "space",
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const KNOWN_KEYS = new Set([
|
|
59
|
+
"font",
|
|
60
|
+
"color",
|
|
61
|
+
"align",
|
|
62
|
+
"w",
|
|
63
|
+
"h",
|
|
64
|
+
"p",
|
|
65
|
+
"m",
|
|
66
|
+
"bg",
|
|
67
|
+
"border",
|
|
68
|
+
"radius",
|
|
69
|
+
"elevation",
|
|
70
|
+
"flex",
|
|
71
|
+
"caption",
|
|
72
|
+
"abs",
|
|
73
|
+
"opacity",
|
|
74
|
+
"itemBg",
|
|
75
|
+
"tabHeader",
|
|
76
|
+
"fixed",
|
|
77
|
+
"surface",
|
|
78
|
+
]);
|
|
79
|
+
|
|
80
|
+
// caption 전용 typography role enum — small text 5종.
|
|
81
|
+
const CAPTION_TEXT_ROLES = new Set([
|
|
82
|
+
"body-large",
|
|
83
|
+
"body-medium",
|
|
84
|
+
"body-small",
|
|
85
|
+
"caption",
|
|
86
|
+
"micro",
|
|
87
|
+
]);
|
|
88
|
+
|
|
89
|
+
const BORDER_TYPE_ENUM = new Set(["solid", "dashed", "dotted"]);
|
|
90
|
+
|
|
91
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
92
|
+
// 에러 헬퍼
|
|
93
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
94
|
+
|
|
95
|
+
function pushErr(errors, path, message, hint) {
|
|
96
|
+
const e = { kind: "design", path, message };
|
|
97
|
+
if (hint) e.hint = hint;
|
|
98
|
+
errors.push(e);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function resolveSlot(map, key, slotKind, path, errors) {
|
|
102
|
+
if (typeof key !== "string") {
|
|
103
|
+
pushErr(errors, path, `${slotKind} must be a string slot name (got ${typeof key})`);
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
if (!Object.hasOwn(map, key)) {
|
|
107
|
+
pushErr(
|
|
108
|
+
errors,
|
|
109
|
+
path,
|
|
110
|
+
`unknown ${slotKind} slot '${key}'`,
|
|
111
|
+
`available: ${Object.keys(map).join(", ")}`,
|
|
112
|
+
);
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
return map[key];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
119
|
+
// Width / Height parser
|
|
120
|
+
// "full" / "text" / "NNpx" / "NN%" / "NNvh" / "NNvw"
|
|
121
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
122
|
+
|
|
123
|
+
const SIZE_RE = /^(\d+(?:\.\d+)?)(px|%|vh|vw)$/;
|
|
124
|
+
|
|
125
|
+
function parseSize(v, path, errors) {
|
|
126
|
+
if (v === "full") {
|
|
127
|
+
return { SizeValue: "100", SizeUnit: "%", MatchText: false };
|
|
128
|
+
}
|
|
129
|
+
if (v === "text") {
|
|
130
|
+
return { MatchText: true, SizeValue: "", SizeUnit: "text" };
|
|
131
|
+
}
|
|
132
|
+
if (typeof v !== "string") {
|
|
133
|
+
pushErr(
|
|
134
|
+
errors,
|
|
135
|
+
path,
|
|
136
|
+
`size must be 'full' / 'text' / 'NNpx' / 'NN%' (got ${typeof v})`,
|
|
137
|
+
);
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
const m = SIZE_RE.exec(v);
|
|
141
|
+
if (!m) {
|
|
142
|
+
pushErr(
|
|
143
|
+
errors,
|
|
144
|
+
path,
|
|
145
|
+
`invalid size '${v}' — use 'full', 'text', or '<number><px|%|vh|vw>'`,
|
|
146
|
+
);
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return { SizeValue: m[1], SizeUnit: m[2], MatchText: false };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
153
|
+
// Padding / Margin parser
|
|
154
|
+
// string shorthand: "16" | "16 20" | "16 20 8" | "16 20 8 4" (CSS order TRBL)
|
|
155
|
+
// object: { t, r, b, l } — 누락 사이드는 "" (엔진 default)
|
|
156
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
157
|
+
|
|
158
|
+
const INT_RE = /^\d+$/;
|
|
159
|
+
const SPACING_OBJ_KEYS = new Set(["t", "r", "b", "l"]);
|
|
160
|
+
|
|
161
|
+
function parseSpacingShorthand(s, path, errors) {
|
|
162
|
+
const parts = s.trim().split(/\s+/);
|
|
163
|
+
if (parts.length === 0 || parts.length > 4) {
|
|
164
|
+
pushErr(
|
|
165
|
+
errors,
|
|
166
|
+
path,
|
|
167
|
+
`spacing '${s}' must have 1–4 values (CSS shorthand)`,
|
|
168
|
+
);
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
for (const p of parts) {
|
|
172
|
+
if (!INT_RE.test(p)) {
|
|
173
|
+
pushErr(
|
|
174
|
+
errors,
|
|
175
|
+
path,
|
|
176
|
+
`spacing '${s}' contains non-integer '${p}' — only non-negative integers allowed`,
|
|
177
|
+
);
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
let t, r, b, l;
|
|
182
|
+
if (parts.length === 1) {
|
|
183
|
+
t = r = b = l = parts[0];
|
|
184
|
+
} else if (parts.length === 2) {
|
|
185
|
+
t = b = parts[0];
|
|
186
|
+
r = l = parts[1];
|
|
187
|
+
} else if (parts.length === 3) {
|
|
188
|
+
t = parts[0];
|
|
189
|
+
r = l = parts[1];
|
|
190
|
+
b = parts[2];
|
|
191
|
+
} else {
|
|
192
|
+
[t, r, b, l] = parts;
|
|
193
|
+
}
|
|
194
|
+
return { t, r, b, l };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function parseSpacing(v, path, errors) {
|
|
198
|
+
let sides;
|
|
199
|
+
if (typeof v === "string") {
|
|
200
|
+
sides = parseSpacingShorthand(v, path, errors);
|
|
201
|
+
} else if (v && typeof v === "object" && !Array.isArray(v)) {
|
|
202
|
+
for (const k of Object.keys(v)) {
|
|
203
|
+
if (!SPACING_OBJ_KEYS.has(k)) {
|
|
204
|
+
pushErr(
|
|
205
|
+
errors,
|
|
206
|
+
`${path}.${k}`,
|
|
207
|
+
`unknown spacing key '${k}' — allowed: t / r / b / l`,
|
|
208
|
+
);
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const pick = (val, key) => {
|
|
213
|
+
if (val == null) return "";
|
|
214
|
+
const s = String(val);
|
|
215
|
+
if (!INT_RE.test(s)) {
|
|
216
|
+
pushErr(
|
|
217
|
+
errors,
|
|
218
|
+
`${path}.${key}`,
|
|
219
|
+
`spacing '${s}' must be a non-negative integer`,
|
|
220
|
+
);
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
return s;
|
|
224
|
+
};
|
|
225
|
+
const t = pick(v.t, "t");
|
|
226
|
+
const r = pick(v.r, "r");
|
|
227
|
+
const b = pick(v.b, "b");
|
|
228
|
+
const l = pick(v.l, "l");
|
|
229
|
+
if (t == null || r == null || b == null || l == null) return null;
|
|
230
|
+
sides = { t, r, b, l };
|
|
231
|
+
} else {
|
|
232
|
+
pushErr(
|
|
233
|
+
errors,
|
|
234
|
+
path,
|
|
235
|
+
`spacing must be CSS-shorthand string or { t, r, b, l } object (got ${
|
|
236
|
+
Array.isArray(v) ? "array" : typeof v
|
|
237
|
+
})`,
|
|
238
|
+
);
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
if (sides == null) return null;
|
|
242
|
+
return {
|
|
243
|
+
UseEach: true,
|
|
244
|
+
UseAuto: true,
|
|
245
|
+
All: "",
|
|
246
|
+
Top: sides.t,
|
|
247
|
+
Right: sides.r,
|
|
248
|
+
Btm: sides.b,
|
|
249
|
+
Left: sides.l,
|
|
250
|
+
SizeUnit: "px",
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
255
|
+
// flex layout parser (DisplayStyle — Group 전용 의도)
|
|
256
|
+
// { dir: "row"|"column"|"wrap", // required
|
|
257
|
+
// gap?: <int>|<intString>|{ row?, col? }, // single value → 양축 동일
|
|
258
|
+
// align?: "left"|"center"|"right"|"between", // DisplayAlign (메인 축)
|
|
259
|
+
// valign?: "top"|"center"|"bottom" // DisplayVerticalAlign (크로스 축) }
|
|
260
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
261
|
+
|
|
262
|
+
const FLEX_KEYS = new Set(["dir", "gap", "align", "valign"]);
|
|
263
|
+
const FLEX_DIRS = new Set(["row", "column", "wrap"]);
|
|
264
|
+
const GAP_OBJ_KEYS = new Set(["row", "col"]);
|
|
265
|
+
|
|
266
|
+
function parseFlex(v, path, errors) {
|
|
267
|
+
if (v == null || typeof v !== "object" || Array.isArray(v)) {
|
|
268
|
+
pushErr(
|
|
269
|
+
errors,
|
|
270
|
+
path,
|
|
271
|
+
`flex must be an object { dir, gap?, align?, valign? }`,
|
|
272
|
+
);
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
for (const k of Object.keys(v)) {
|
|
276
|
+
if (!FLEX_KEYS.has(k)) {
|
|
277
|
+
pushErr(
|
|
278
|
+
errors,
|
|
279
|
+
`${path}.${k}`,
|
|
280
|
+
`unknown flex key '${k}' — allowed: dir / gap / align / valign`,
|
|
281
|
+
);
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (v.dir == null) {
|
|
286
|
+
pushErr(
|
|
287
|
+
errors,
|
|
288
|
+
`${path}.dir`,
|
|
289
|
+
`flex.dir is required — use 'row' / 'column' / 'wrap'`,
|
|
290
|
+
);
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
if (!FLEX_DIRS.has(v.dir)) {
|
|
294
|
+
pushErr(
|
|
295
|
+
errors,
|
|
296
|
+
`${path}.dir`,
|
|
297
|
+
`unknown dir '${v.dir}' — use 'row' / 'column' / 'wrap'`,
|
|
298
|
+
);
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const ds = {
|
|
303
|
+
UseDisplay: true,
|
|
304
|
+
DisplayType: "Flex",
|
|
305
|
+
FlexDirection: v.dir,
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
if (v.align != null) {
|
|
309
|
+
const alignKey = ALIGN_ALIAS[v.align] ?? v.align;
|
|
310
|
+
const da = DISPLAY_ALIGN[alignKey];
|
|
311
|
+
if (da == null) {
|
|
312
|
+
pushErr(
|
|
313
|
+
errors,
|
|
314
|
+
`${path}.align`,
|
|
315
|
+
`unknown align '${v.align}' — use left / center / right / between`,
|
|
316
|
+
);
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
ds.DisplayAlign = da;
|
|
320
|
+
ds.flexBoxType = FLEX_BOX_TYPE[alignKey];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (v.valign != null) {
|
|
324
|
+
const valignKey = VALIGN_ALIAS[v.valign] ?? v.valign;
|
|
325
|
+
const dva = DISPLAY_VALIGN[valignKey];
|
|
326
|
+
if (dva == null) {
|
|
327
|
+
pushErr(
|
|
328
|
+
errors,
|
|
329
|
+
`${path}.valign`,
|
|
330
|
+
`unknown valign '${v.valign}' — use top / center / bottom`,
|
|
331
|
+
);
|
|
332
|
+
return null;
|
|
333
|
+
}
|
|
334
|
+
ds.DisplayVerticalAlign = dva;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (v.gap != null) {
|
|
338
|
+
let rowVal, colVal;
|
|
339
|
+
if (typeof v.gap === "number" || typeof v.gap === "string") {
|
|
340
|
+
const g = String(v.gap);
|
|
341
|
+
if (!INT_RE.test(g)) {
|
|
342
|
+
pushErr(
|
|
343
|
+
errors,
|
|
344
|
+
`${path}.gap`,
|
|
345
|
+
`gap '${g}' must be a non-negative integer`,
|
|
346
|
+
);
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
rowVal = g;
|
|
350
|
+
colVal = g;
|
|
351
|
+
} else if (typeof v.gap === "object" && !Array.isArray(v.gap)) {
|
|
352
|
+
for (const k of Object.keys(v.gap)) {
|
|
353
|
+
if (!GAP_OBJ_KEYS.has(k)) {
|
|
354
|
+
pushErr(
|
|
355
|
+
errors,
|
|
356
|
+
`${path}.gap.${k}`,
|
|
357
|
+
`unknown gap key '${k}' — allowed: row / col`,
|
|
358
|
+
);
|
|
359
|
+
return null;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const pick = (val, key) => {
|
|
363
|
+
if (val == null) return null;
|
|
364
|
+
const s = String(val);
|
|
365
|
+
if (!INT_RE.test(s)) {
|
|
366
|
+
pushErr(
|
|
367
|
+
errors,
|
|
368
|
+
`${path}.gap.${key}`,
|
|
369
|
+
`gap.${key} '${s}' must be a non-negative integer`,
|
|
370
|
+
);
|
|
371
|
+
return undefined; // sentinel for failure
|
|
372
|
+
}
|
|
373
|
+
return s;
|
|
374
|
+
};
|
|
375
|
+
rowVal = pick(v.gap.row, "row");
|
|
376
|
+
colVal = pick(v.gap.col, "col");
|
|
377
|
+
if (rowVal === undefined || colVal === undefined) return null;
|
|
378
|
+
} else {
|
|
379
|
+
pushErr(
|
|
380
|
+
errors,
|
|
381
|
+
`${path}.gap`,
|
|
382
|
+
`gap must be a non-negative integer or { row?, col? } object`,
|
|
383
|
+
);
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
if (rowVal != null) {
|
|
387
|
+
ds.rowGapValue = rowVal;
|
|
388
|
+
ds.rowGapUnit = "px";
|
|
389
|
+
}
|
|
390
|
+
if (colVal != null) {
|
|
391
|
+
ds.columnGapValue = colVal;
|
|
392
|
+
ds.columnGapUnit = "px";
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return ds;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
400
|
+
// border object parser (객체 form — shorthand 와 별개 경로)
|
|
401
|
+
// { color: <slot>, type?: solid|dashed|dotted, size? | sides?: { t,r,b,l } }
|
|
402
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
403
|
+
|
|
404
|
+
const BORDER_OBJ_KEYS = new Set(["color", "type", "size", "sides"]);
|
|
405
|
+
const SIDE_OBJ_KEYS = new Set(["t", "r", "b", "l"]);
|
|
406
|
+
|
|
407
|
+
function pickIntString(val, errors, path) {
|
|
408
|
+
if (val == null) return "";
|
|
409
|
+
const s = String(val);
|
|
410
|
+
if (!INT_RE.test(s)) {
|
|
411
|
+
pushErr(errors, path, `must be a non-negative integer (got '${s}')`);
|
|
412
|
+
return undefined; // sentinel for failure
|
|
413
|
+
}
|
|
414
|
+
return s;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
function parseBorderObject(v, path, errors, sourceMap) {
|
|
418
|
+
for (const k of Object.keys(v)) {
|
|
419
|
+
if (!BORDER_OBJ_KEYS.has(k)) {
|
|
420
|
+
pushErr(
|
|
421
|
+
errors,
|
|
422
|
+
`${path}.${k}`,
|
|
423
|
+
`unknown border key '${k}' — allowed: color / type / size / sides`,
|
|
424
|
+
);
|
|
425
|
+
return null;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (v.color == null) {
|
|
429
|
+
pushErr(errors, path, `border object must have 'color'`);
|
|
430
|
+
return null;
|
|
431
|
+
}
|
|
432
|
+
const color = resolveSlot(
|
|
433
|
+
TOKENS.color,
|
|
434
|
+
v.color,
|
|
435
|
+
"border color",
|
|
436
|
+
`${path}.color`,
|
|
437
|
+
errors,
|
|
438
|
+
);
|
|
439
|
+
if (color == null) return null;
|
|
440
|
+
|
|
441
|
+
if (v.size != null && v.sides != null) {
|
|
442
|
+
pushErr(
|
|
443
|
+
errors,
|
|
444
|
+
path,
|
|
445
|
+
`border 'size' and 'sides' are mutually exclusive — pick one`,
|
|
446
|
+
);
|
|
447
|
+
return null;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
const out = {
|
|
451
|
+
Useborder: true,
|
|
452
|
+
BorderColor: color,
|
|
453
|
+
BorderType: "solid",
|
|
454
|
+
};
|
|
455
|
+
sourceMap["BorderStyle.BorderColor"] = `${path}.color`;
|
|
456
|
+
|
|
457
|
+
if (v.type != null) {
|
|
458
|
+
if (!BORDER_TYPE_ENUM.has(v.type)) {
|
|
459
|
+
pushErr(
|
|
460
|
+
errors,
|
|
461
|
+
`${path}.type`,
|
|
462
|
+
`unknown border type '${v.type}' — use solid / dashed / dotted`,
|
|
463
|
+
);
|
|
464
|
+
return null;
|
|
465
|
+
}
|
|
466
|
+
out.BorderType = v.type;
|
|
467
|
+
sourceMap["BorderStyle.BorderType"] = `${path}.type`;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (v.sides != null) {
|
|
471
|
+
if (typeof v.sides !== "object" || Array.isArray(v.sides)) {
|
|
472
|
+
pushErr(
|
|
473
|
+
errors,
|
|
474
|
+
`${path}.sides`,
|
|
475
|
+
`sides must be { t?, r?, b?, l? } object`,
|
|
476
|
+
);
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
for (const k of Object.keys(v.sides)) {
|
|
480
|
+
if (!SIDE_OBJ_KEYS.has(k)) {
|
|
481
|
+
pushErr(
|
|
482
|
+
errors,
|
|
483
|
+
`${path}.sides.${k}`,
|
|
484
|
+
`unknown side key '${k}' — allowed: t / r / b / l`,
|
|
485
|
+
);
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
const t = pickIntString(v.sides.t, errors, `${path}.sides.t`);
|
|
490
|
+
const r = pickIntString(v.sides.r, errors, `${path}.sides.r`);
|
|
491
|
+
const b = pickIntString(v.sides.b, errors, `${path}.sides.b`);
|
|
492
|
+
const l = pickIntString(v.sides.l, errors, `${path}.sides.l`);
|
|
493
|
+
if (t === undefined || r === undefined || b === undefined || l === undefined) {
|
|
494
|
+
return null;
|
|
495
|
+
}
|
|
496
|
+
out.SizeSet = "Each";
|
|
497
|
+
out.BorderSize = "";
|
|
498
|
+
out.Top = t;
|
|
499
|
+
out.Right = r;
|
|
500
|
+
out.Bottom = b;
|
|
501
|
+
out.Left = l;
|
|
502
|
+
if (v.sides.t != null) sourceMap["BorderStyle.Top"] = `${path}.sides.t`;
|
|
503
|
+
if (v.sides.r != null) sourceMap["BorderStyle.Right"] = `${path}.sides.r`;
|
|
504
|
+
if (v.sides.b != null) sourceMap["BorderStyle.Bottom"] = `${path}.sides.b`;
|
|
505
|
+
if (v.sides.l != null) sourceMap["BorderStyle.Left"] = `${path}.sides.l`;
|
|
506
|
+
} else {
|
|
507
|
+
out.SizeSet = "All";
|
|
508
|
+
if (v.size != null) {
|
|
509
|
+
const s = pickIntString(v.size, errors, `${path}.size`);
|
|
510
|
+
if (s === undefined) return null;
|
|
511
|
+
out.BorderSize = s;
|
|
512
|
+
sourceMap["BorderStyle.BorderSize"] = `${path}.size`;
|
|
513
|
+
} else {
|
|
514
|
+
out.BorderSize = 1;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return out;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
522
|
+
// radius object parser (객체 form — per-corner)
|
|
523
|
+
// { tl?, tr?, br?, bl? }
|
|
524
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
525
|
+
|
|
526
|
+
const CORNER_OBJ_KEYS = new Set(["tl", "tr", "br", "bl"]);
|
|
527
|
+
|
|
528
|
+
function parseRadiusObject(v, path, errors, sourceMap) {
|
|
529
|
+
for (const k of Object.keys(v)) {
|
|
530
|
+
if (!CORNER_OBJ_KEYS.has(k)) {
|
|
531
|
+
pushErr(
|
|
532
|
+
errors,
|
|
533
|
+
`${path}.${k}`,
|
|
534
|
+
`unknown radius key '${k}' — allowed: tl / tr / br / bl`,
|
|
535
|
+
);
|
|
536
|
+
return null;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
const tl = pickIntString(v.tl, errors, `${path}.tl`);
|
|
540
|
+
const tr = pickIntString(v.tr, errors, `${path}.tr`);
|
|
541
|
+
const br = pickIntString(v.br, errors, `${path}.br`);
|
|
542
|
+
const bl = pickIntString(v.bl, errors, `${path}.bl`);
|
|
543
|
+
if (tl === undefined || tr === undefined || br === undefined || bl === undefined) {
|
|
544
|
+
return null;
|
|
545
|
+
}
|
|
546
|
+
if (v.tl != null) sourceMap["BorderStyle.RadiusTopLeft"] = `${path}.tl`;
|
|
547
|
+
if (v.tr != null) sourceMap["BorderStyle.RadiusTopRight"] = `${path}.tr`;
|
|
548
|
+
if (v.br != null) sourceMap["BorderStyle.RadiusBottomRight"] = `${path}.br`;
|
|
549
|
+
if (v.bl != null) sourceMap["BorderStyle.RadiusBottomLeft"] = `${path}.bl`;
|
|
550
|
+
return {
|
|
551
|
+
BorderRadius: "",
|
|
552
|
+
RadiusSet: "Each",
|
|
553
|
+
RadiusTopLeft: tl,
|
|
554
|
+
RadiusTopRight: tr,
|
|
555
|
+
RadiusBottomLeft: bl,
|
|
556
|
+
RadiusBottomRight: br,
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
561
|
+
// caption parser (CaptionStyle)
|
|
562
|
+
// { font?: 5 roles, color? }
|
|
563
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
564
|
+
|
|
565
|
+
const CAPTION_OBJ_KEYS = new Set(["text", "font", "color", "pos", "align"]);
|
|
566
|
+
const CAPTION_POS_MAP = { left: "Left", top: "Top" };
|
|
567
|
+
|
|
568
|
+
function parseCaption(v, path, errors, sourceMap) {
|
|
569
|
+
if (v == null || typeof v !== "object" || Array.isArray(v)) {
|
|
570
|
+
pushErr(
|
|
571
|
+
errors,
|
|
572
|
+
path,
|
|
573
|
+
`caption must be an object { text?, font?, color?, pos?, align? }`,
|
|
574
|
+
);
|
|
575
|
+
return null;
|
|
576
|
+
}
|
|
577
|
+
for (const k of Object.keys(v)) {
|
|
578
|
+
if (!CAPTION_OBJ_KEYS.has(k)) {
|
|
579
|
+
pushErr(
|
|
580
|
+
errors,
|
|
581
|
+
`${path}.${k}`,
|
|
582
|
+
`unknown caption key '${k}' — allowed: text / font / color / pos / align`,
|
|
583
|
+
);
|
|
584
|
+
return null;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
const out = { UseDesign: true };
|
|
588
|
+
if (v.font != null) {
|
|
589
|
+
if (!CAPTION_TEXT_ROLES.has(v.font)) {
|
|
590
|
+
pushErr(
|
|
591
|
+
errors,
|
|
592
|
+
`${path}.font`,
|
|
593
|
+
`unknown caption typography role '${v.font}'`,
|
|
594
|
+
`caption supports: ${[...CAPTION_TEXT_ROLES].join(", ")}`,
|
|
595
|
+
);
|
|
596
|
+
return null;
|
|
597
|
+
}
|
|
598
|
+
const role = TOKENS.typography[v.font];
|
|
599
|
+
out.FontSize = role.FontSize;
|
|
600
|
+
out.FontWeight = role.FontWeight;
|
|
601
|
+
sourceMap["CaptionStyle.FontSize"] = `${path}.font`;
|
|
602
|
+
sourceMap["CaptionStyle.FontWeight"] = `${path}.font`;
|
|
603
|
+
}
|
|
604
|
+
if (v.color != null) {
|
|
605
|
+
const c = resolveSlot(
|
|
606
|
+
TOKENS.color,
|
|
607
|
+
v.color,
|
|
608
|
+
"caption color",
|
|
609
|
+
`${path}.color`,
|
|
610
|
+
errors,
|
|
611
|
+
);
|
|
612
|
+
if (c == null) return null;
|
|
613
|
+
out.FontColor = c;
|
|
614
|
+
sourceMap["CaptionStyle.FontColor"] = `${path}.color`;
|
|
615
|
+
}
|
|
616
|
+
if (v.pos != null) {
|
|
617
|
+
const cp = CAPTION_POS_MAP[v.pos];
|
|
618
|
+
if (cp == null) {
|
|
619
|
+
pushErr(
|
|
620
|
+
errors,
|
|
621
|
+
`${path}.pos`,
|
|
622
|
+
`unknown caption pos '${v.pos}' — use 'left' / 'top'`,
|
|
623
|
+
);
|
|
624
|
+
return null;
|
|
625
|
+
}
|
|
626
|
+
out.CaptionPosition = cp;
|
|
627
|
+
sourceMap["CaptionStyle.CaptionPosition"] = `${path}.pos`;
|
|
628
|
+
}
|
|
629
|
+
if (v.align != null) {
|
|
630
|
+
const fa = FONT_ALIGN[v.align];
|
|
631
|
+
if (fa == null) {
|
|
632
|
+
pushErr(
|
|
633
|
+
errors,
|
|
634
|
+
`${path}.align`,
|
|
635
|
+
`unknown caption align '${v.align}' — use 'start' / 'center' / 'end'`,
|
|
636
|
+
);
|
|
637
|
+
return null;
|
|
638
|
+
}
|
|
639
|
+
out.FontAlign = fa;
|
|
640
|
+
sourceMap["CaptionStyle.FontAlign"] = `${path}.align`;
|
|
641
|
+
}
|
|
642
|
+
return out;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
646
|
+
// abs parser (UseAbsoluteLayout + AbsolutePosition)
|
|
647
|
+
// { t?, r?, b?, l? } — spacing 패턴과 동일 (단 string shorthand 는 받지 않음)
|
|
648
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
649
|
+
|
|
650
|
+
function parseAbs(v, path, errors) {
|
|
651
|
+
if (v == null || typeof v !== "object" || Array.isArray(v)) {
|
|
652
|
+
pushErr(errors, path, `abs must be { t?, r?, b?, l? } object`);
|
|
653
|
+
return null;
|
|
654
|
+
}
|
|
655
|
+
for (const k of Object.keys(v)) {
|
|
656
|
+
if (!SPACING_OBJ_KEYS.has(k)) {
|
|
657
|
+
pushErr(
|
|
658
|
+
errors,
|
|
659
|
+
`${path}.${k}`,
|
|
660
|
+
`unknown abs key '${k}' — allowed: t / r / b / l`,
|
|
661
|
+
);
|
|
662
|
+
return null;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
const t = pickIntString(v.t, errors, `${path}.t`);
|
|
666
|
+
const r = pickIntString(v.r, errors, `${path}.r`);
|
|
667
|
+
const b = pickIntString(v.b, errors, `${path}.b`);
|
|
668
|
+
const l = pickIntString(v.l, errors, `${path}.l`);
|
|
669
|
+
if (t === undefined || r === undefined || b === undefined || l === undefined) {
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
return {
|
|
673
|
+
UseEach: true,
|
|
674
|
+
UseAuto: true,
|
|
675
|
+
All: "",
|
|
676
|
+
Top: t,
|
|
677
|
+
Right: r,
|
|
678
|
+
Btm: b,
|
|
679
|
+
Left: l,
|
|
680
|
+
SizeUnit: "px",
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
685
|
+
// opacity parser
|
|
686
|
+
// <int 0..100> → UseOpacity:true + OpacityValue:"<n>"
|
|
687
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
688
|
+
|
|
689
|
+
function parseOpacity(v, path, errors) {
|
|
690
|
+
if (typeof v !== "number" || !Number.isInteger(v)) {
|
|
691
|
+
pushErr(
|
|
692
|
+
errors,
|
|
693
|
+
path,
|
|
694
|
+
`opacity must be an integer 0..100 (got ${typeof v})`,
|
|
695
|
+
);
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
if (v < 0 || v > 100) {
|
|
699
|
+
pushErr(errors, path, `opacity out of range — must be 0..100 (got ${v})`);
|
|
700
|
+
return null;
|
|
701
|
+
}
|
|
702
|
+
return String(v);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
706
|
+
// arrange parser (Tab 헤더 컨테이너 안에서만 의미)
|
|
707
|
+
// { type?: match|equal|fixed, align?: left|center|right|between }
|
|
708
|
+
// → ArrangeItemsStyle: { UseArrangeItems, ArrangeItemsType, ArrangeItemsAlign }
|
|
709
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
710
|
+
|
|
711
|
+
const ARRANGE_KEYS = new Set(["type", "align"]);
|
|
712
|
+
const ARRANGE_TYPE_MAP = {
|
|
713
|
+
match: "MatchText",
|
|
714
|
+
equal: "EqualDistribution",
|
|
715
|
+
fixed: "Fixed",
|
|
716
|
+
};
|
|
717
|
+
const ARRANGE_ALIGN_MAP = {
|
|
718
|
+
left: "Left",
|
|
719
|
+
center: "Center",
|
|
720
|
+
right: "Right",
|
|
721
|
+
between: "Between",
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
function parseArrange(v, path, errors) {
|
|
725
|
+
if (v == null || typeof v !== "object" || Array.isArray(v)) {
|
|
726
|
+
pushErr(errors, path, `arrange must be { type?, align? } object`);
|
|
727
|
+
return null;
|
|
728
|
+
}
|
|
729
|
+
for (const k of Object.keys(v)) {
|
|
730
|
+
if (!ARRANGE_KEYS.has(k)) {
|
|
731
|
+
pushErr(
|
|
732
|
+
errors,
|
|
733
|
+
`${path}.${k}`,
|
|
734
|
+
`unknown arrange key '${k}' — allowed: type / align`,
|
|
735
|
+
);
|
|
736
|
+
return null;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
const out = { UseArrangeItems: true };
|
|
740
|
+
if (v.type != null) {
|
|
741
|
+
const t = ARRANGE_TYPE_MAP[v.type];
|
|
742
|
+
if (t == null) {
|
|
743
|
+
pushErr(
|
|
744
|
+
errors,
|
|
745
|
+
`${path}.type`,
|
|
746
|
+
`unknown arrange type '${v.type}' — use match / equal / fixed`,
|
|
747
|
+
);
|
|
748
|
+
return null;
|
|
749
|
+
}
|
|
750
|
+
out.ArrangeItemsType = t;
|
|
751
|
+
}
|
|
752
|
+
if (v.align != null) {
|
|
753
|
+
const a = ARRANGE_ALIGN_MAP[v.align];
|
|
754
|
+
if (a == null) {
|
|
755
|
+
pushErr(
|
|
756
|
+
errors,
|
|
757
|
+
`${path}.align`,
|
|
758
|
+
`unknown arrange align '${v.align}' — use left / center / right / between`,
|
|
759
|
+
);
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
out.ArrangeItemsAlign = a;
|
|
763
|
+
}
|
|
764
|
+
return out;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
768
|
+
// tabHeader parser (Tab 컨트롤 4중 헤더 스타일)
|
|
769
|
+
//
|
|
770
|
+
// design.tabHeader: {
|
|
771
|
+
// container?: { arrange?, p?, m?, border?, radius?, bg? }
|
|
772
|
+
// selectedContainer?: 동일
|
|
773
|
+
// item?: { font?, color?, align?, p?, m?, border?, radius?, bg? }
|
|
774
|
+
// selectedItem?: 동일
|
|
775
|
+
// }
|
|
776
|
+
//
|
|
777
|
+
// → raw {
|
|
778
|
+
// TabHeader: { ArrangeItemsStyle?, Padding?, Margin?, BorderStyle?, BgStyle? }
|
|
779
|
+
// SelectTabHeader: 동일
|
|
780
|
+
// TabHeaderItem: { FontStyle?, Padding?, Margin?, BorderStyle?, BgStyle? }
|
|
781
|
+
// SelectTabHeaderItem: 동일
|
|
782
|
+
// }
|
|
783
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
784
|
+
|
|
785
|
+
const TAB_HEADER_SUB_BLOCKS = [
|
|
786
|
+
"container",
|
|
787
|
+
"selectedContainer",
|
|
788
|
+
"item",
|
|
789
|
+
"selectedItem",
|
|
790
|
+
];
|
|
791
|
+
const TAB_HEADER_BLOCK_TO_RAW = {
|
|
792
|
+
container: "TabHeader",
|
|
793
|
+
selectedContainer: "SelectTabHeader",
|
|
794
|
+
item: "TabHeaderItem",
|
|
795
|
+
selectedItem: "SelectTabHeaderItem",
|
|
796
|
+
};
|
|
797
|
+
const TAB_HEADER_CONTAINER_KEYS = new Set([
|
|
798
|
+
"arrange",
|
|
799
|
+
"p",
|
|
800
|
+
"m",
|
|
801
|
+
"border",
|
|
802
|
+
"radius",
|
|
803
|
+
"bg",
|
|
804
|
+
]);
|
|
805
|
+
const TAB_HEADER_ITEM_KEYS = new Set([
|
|
806
|
+
"font",
|
|
807
|
+
"color",
|
|
808
|
+
"align",
|
|
809
|
+
"p",
|
|
810
|
+
"m",
|
|
811
|
+
"border",
|
|
812
|
+
"radius",
|
|
813
|
+
"bg",
|
|
814
|
+
]);
|
|
815
|
+
|
|
816
|
+
function parseTabHeaderBlock(v, designPath, errors, opts) {
|
|
817
|
+
// opts: { kind: "container" | "item" }
|
|
818
|
+
if (v == null || typeof v !== "object" || Array.isArray(v)) {
|
|
819
|
+
pushErr(
|
|
820
|
+
errors,
|
|
821
|
+
designPath,
|
|
822
|
+
`tabHeader.${opts.kind} must be a plain object`,
|
|
823
|
+
);
|
|
824
|
+
return null;
|
|
825
|
+
}
|
|
826
|
+
const allowed =
|
|
827
|
+
opts.kind === "item" ? TAB_HEADER_ITEM_KEYS : TAB_HEADER_CONTAINER_KEYS;
|
|
828
|
+
for (const k of Object.keys(v)) {
|
|
829
|
+
if (!allowed.has(k)) {
|
|
830
|
+
pushErr(
|
|
831
|
+
errors,
|
|
832
|
+
`${designPath}.${k}`,
|
|
833
|
+
`unknown tabHeader.${opts.kind} key '${k}'`,
|
|
834
|
+
`allowed: ${[...allowed].join(" / ")}`,
|
|
835
|
+
);
|
|
836
|
+
return null;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// arrange 분리 — materializeDesign 의 KNOWN_KEYS 에 없으므로 사전 strip.
|
|
841
|
+
const { arrange, ...subDesign } = v;
|
|
842
|
+
|
|
843
|
+
// 부분집합 design 객체에 대해 materializeDesign 재귀 호출 — 기존 parser 재활용.
|
|
844
|
+
const {
|
|
845
|
+
raw: subRaw,
|
|
846
|
+
sourceMap: subMap,
|
|
847
|
+
errors: subErrors,
|
|
848
|
+
} = materializeDesign(subDesign, designPath);
|
|
849
|
+
if (subErrors.length > 0) errors.push(...subErrors);
|
|
850
|
+
|
|
851
|
+
if (opts.kind === "container" && arrange !== undefined) {
|
|
852
|
+
const ais = parseArrange(arrange, `${designPath}.arrange`, errors);
|
|
853
|
+
if (ais != null) {
|
|
854
|
+
subRaw.ArrangeItemsStyle = ais;
|
|
855
|
+
subMap["ArrangeItemsStyle"] = `${designPath}.arrange`;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
return { block: subRaw, subMap };
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
function parseTabHeader(v, designPath, errors, sourceMap) {
|
|
863
|
+
if (v == null || typeof v !== "object" || Array.isArray(v)) {
|
|
864
|
+
pushErr(
|
|
865
|
+
errors,
|
|
866
|
+
designPath,
|
|
867
|
+
`tabHeader must be an object { container?, selectedContainer?, item?, selectedItem? }`,
|
|
868
|
+
);
|
|
869
|
+
return null;
|
|
870
|
+
}
|
|
871
|
+
for (const k of Object.keys(v)) {
|
|
872
|
+
if (!TAB_HEADER_SUB_BLOCKS.includes(k)) {
|
|
873
|
+
pushErr(
|
|
874
|
+
errors,
|
|
875
|
+
`${designPath}.${k}`,
|
|
876
|
+
`unknown tabHeader key '${k}'`,
|
|
877
|
+
`allowed: ${TAB_HEADER_SUB_BLOCKS.join(" / ")}`,
|
|
878
|
+
);
|
|
879
|
+
return null;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
const out = {};
|
|
884
|
+
for (const subKey of TAB_HEADER_SUB_BLOCKS) {
|
|
885
|
+
if (v[subKey] == null) continue;
|
|
886
|
+
const subPath = `${designPath}.${subKey}`;
|
|
887
|
+
const isItem = subKey === "item" || subKey === "selectedItem";
|
|
888
|
+
const result = parseTabHeaderBlock(v[subKey], subPath, errors, {
|
|
889
|
+
kind: isItem ? "item" : "container",
|
|
890
|
+
});
|
|
891
|
+
if (result == null || Object.keys(result.block).length === 0) continue;
|
|
892
|
+
const rawKey = TAB_HEADER_BLOCK_TO_RAW[subKey];
|
|
893
|
+
out[rawKey] = result.block;
|
|
894
|
+
// sub block 의 sourceMap leaf path 를 rawKey prefix 로 등록
|
|
895
|
+
for (const [leafPath, designSource] of Object.entries(result.subMap)) {
|
|
896
|
+
sourceMap[`${rawKey}.${leafPath}`] = designSource;
|
|
897
|
+
}
|
|
898
|
+
// 도메인 fallback
|
|
899
|
+
if (!Object.hasOwn(sourceMap, rawKey)) sourceMap[rawKey] = subPath;
|
|
900
|
+
}
|
|
901
|
+
return out;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
905
|
+
// 핵심 entry: design 객체 → { raw style fields, sourceMap, errors }
|
|
906
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* design 객체를 raw style 필드로 변환.
|
|
910
|
+
*
|
|
911
|
+
* @param design 사용자가 적은 design 객체.
|
|
912
|
+
* @param path 에러 메시지용 path prefix (default "$.design").
|
|
913
|
+
* @returns { raw, sourceMap, errors }
|
|
914
|
+
* - raw : control 에 머지될 style 필드들 (FontStyle, Width, ... 등).
|
|
915
|
+
* - sourceMap : raw leaf path → design leaf path (역매핑용).
|
|
916
|
+
* - errors : 검증 실패 항목. raw 는 부분 결과로도 반환.
|
|
917
|
+
*/
|
|
918
|
+
export function materializeDesign(design, path = "$.design") {
|
|
919
|
+
const errors = [];
|
|
920
|
+
const raw = {};
|
|
921
|
+
const sourceMap = {};
|
|
922
|
+
|
|
923
|
+
if (design == null || typeof design !== "object" || Array.isArray(design)) {
|
|
924
|
+
pushErr(
|
|
925
|
+
errors,
|
|
926
|
+
path,
|
|
927
|
+
`design must be a plain object (got ${
|
|
928
|
+
design == null ? "null" : Array.isArray(design) ? "array" : typeof design
|
|
929
|
+
})`,
|
|
930
|
+
);
|
|
931
|
+
return { raw, sourceMap, errors };
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// unknown key 검사
|
|
935
|
+
for (const k of Object.keys(design)) {
|
|
936
|
+
if (!KNOWN_KEYS.has(k)) {
|
|
937
|
+
pushErr(
|
|
938
|
+
errors,
|
|
939
|
+
`${path}.${k}`,
|
|
940
|
+
`unknown design key '${k}'`,
|
|
941
|
+
`allowed: ${[...KNOWN_KEYS].join(" / ")}`,
|
|
942
|
+
);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
// ── surface 프리셋 확장 (Group 전용 매크로) ──────────────────────────────
|
|
947
|
+
// surface 는 bg/border/radius/elevation 의 고정 조합으로 풀린다. 프리셋이
|
|
948
|
+
// baseline 이고, 작성자가 같은 키를 명시하면 override (CSS shorthand 의미).
|
|
949
|
+
// 확장 결과는 기존 키 경로로 처리되므로 별도 parser/sourceMap 불필요.
|
|
950
|
+
// Group 한정 가드는 applyDesign 에서 (node type 을 알아야 하므로).
|
|
951
|
+
if (design.surface != null) {
|
|
952
|
+
if (!Object.hasOwn(SURFACE, design.surface)) {
|
|
953
|
+
pushErr(
|
|
954
|
+
errors,
|
|
955
|
+
`${path}.surface`,
|
|
956
|
+
`unknown surface preset '${design.surface}'`,
|
|
957
|
+
`available: ${Object.keys(SURFACE).join(", ")}`,
|
|
958
|
+
);
|
|
959
|
+
const { surface: _s, ...rest } = design;
|
|
960
|
+
design = rest;
|
|
961
|
+
} else {
|
|
962
|
+
const { surface: _s, ...rest } = design;
|
|
963
|
+
design = { ...SURFACE[design.surface], ...rest };
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
// ── FontStyle (font / color / align) ────────────────────────────────────
|
|
968
|
+
let font = null;
|
|
969
|
+
if (design.font != null) {
|
|
970
|
+
const role = resolveSlot(
|
|
971
|
+
TOKENS.typography,
|
|
972
|
+
design.font,
|
|
973
|
+
"typography role",
|
|
974
|
+
`${path}.font`,
|
|
975
|
+
errors,
|
|
976
|
+
);
|
|
977
|
+
if (role != null) {
|
|
978
|
+
font ??= { UseFont: true };
|
|
979
|
+
font.FontSize = role.FontSize;
|
|
980
|
+
font.FontWeight = role.FontWeight;
|
|
981
|
+
sourceMap["FontStyle.FontSize"] = `${path}.font`;
|
|
982
|
+
sourceMap["FontStyle.FontWeight"] = `${path}.font`;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
if (design.color != null) {
|
|
986
|
+
const c = resolveSlot(
|
|
987
|
+
TOKENS.color,
|
|
988
|
+
design.color,
|
|
989
|
+
"text color",
|
|
990
|
+
`${path}.color`,
|
|
991
|
+
errors,
|
|
992
|
+
);
|
|
993
|
+
if (c != null) {
|
|
994
|
+
font ??= { UseFont: true };
|
|
995
|
+
font.FontColor = c;
|
|
996
|
+
sourceMap["FontStyle.FontColor"] = `${path}.color`;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
if (design.align != null) {
|
|
1000
|
+
const fa = FONT_ALIGN[design.align];
|
|
1001
|
+
if (fa == null) {
|
|
1002
|
+
pushErr(
|
|
1003
|
+
errors,
|
|
1004
|
+
`${path}.align`,
|
|
1005
|
+
`unknown align '${design.align}' — use start / center / end`,
|
|
1006
|
+
);
|
|
1007
|
+
} else {
|
|
1008
|
+
font ??= { UseFont: true };
|
|
1009
|
+
font.FontAlign = fa;
|
|
1010
|
+
sourceMap["FontStyle.FontAlign"] = `${path}.align`;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
if (font != null) raw.FontStyle = font;
|
|
1014
|
+
|
|
1015
|
+
// ── Width / Height ──────────────────────────────────────────────────────
|
|
1016
|
+
if (design.w != null) {
|
|
1017
|
+
const w = parseSize(design.w, `${path}.w`, errors);
|
|
1018
|
+
if (w != null) {
|
|
1019
|
+
raw.Width = w;
|
|
1020
|
+
sourceMap["Width"] = `${path}.w`;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
if (design.h != null) {
|
|
1024
|
+
const h = parseSize(design.h, `${path}.h`, errors);
|
|
1025
|
+
if (h != null) {
|
|
1026
|
+
// top caption 자동 보정 — 엔진은 Height 를 (caption 포함) 총 시각 예산으로
|
|
1027
|
+
// 처리하므로 top caption 이 붙으면 입력 본체가 ~24px 만큼 압축된다. 작성자가
|
|
1028
|
+
// `design.h` 를 본체 높이로 의도해도 결과는 줄어든 본체로 보임 — 그래서 caption
|
|
1029
|
+
// pos:'top' (또는 pos 생략 = top default) 이면 Height 에 24px 를 자동 가산해
|
|
1030
|
+
// 본체가 의도한 높이를 유지하도록 한다. 'px' 단위에서만 적용 — '%'/'vh'/'vw' 등은
|
|
1031
|
+
// 의미가 모호하고 'text'/'full' 은 SizeValue 가산 자체가 의미 없음.
|
|
1032
|
+
const cap = design.caption;
|
|
1033
|
+
const topCaption =
|
|
1034
|
+
cap != null && typeof cap === "object" &&
|
|
1035
|
+
(cap.pos == null || cap.pos === "top");
|
|
1036
|
+
if (topCaption && h.SizeUnit === "px") {
|
|
1037
|
+
const n = Number(h.SizeValue);
|
|
1038
|
+
if (Number.isFinite(n)) h.SizeValue = String(n + 24);
|
|
1039
|
+
}
|
|
1040
|
+
raw.Height = h;
|
|
1041
|
+
sourceMap["Height"] = `${path}.h`;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
// ── Padding / Margin ────────────────────────────────────────────────────
|
|
1046
|
+
if (design.p != null) {
|
|
1047
|
+
const p = parseSpacing(design.p, `${path}.p`, errors);
|
|
1048
|
+
if (p != null) {
|
|
1049
|
+
raw.Padding = p;
|
|
1050
|
+
sourceMap["Padding"] = `${path}.p`;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
if (design.m != null) {
|
|
1054
|
+
const m = parseSpacing(design.m, `${path}.m`, errors);
|
|
1055
|
+
if (m != null) {
|
|
1056
|
+
raw.Margin = m;
|
|
1057
|
+
sourceMap["Margin"] = `${path}.m`;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
// ── BgStyle ─────────────────────────────────────────────────────────────
|
|
1062
|
+
if (design.bg != null) {
|
|
1063
|
+
const c = resolveSlot(
|
|
1064
|
+
TOKENS.color,
|
|
1065
|
+
design.bg,
|
|
1066
|
+
"bg color",
|
|
1067
|
+
`${path}.bg`,
|
|
1068
|
+
errors,
|
|
1069
|
+
);
|
|
1070
|
+
if (c != null) {
|
|
1071
|
+
raw.BgStyle = {
|
|
1072
|
+
UseBackground: true,
|
|
1073
|
+
BgColor: c,
|
|
1074
|
+
UseImage: false,
|
|
1075
|
+
Image: {},
|
|
1076
|
+
};
|
|
1077
|
+
sourceMap["BgStyle.BgColor"] = `${path}.bg`;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
// ── BorderStyle (border / radius) ───────────────────────────────────────
|
|
1082
|
+
const hasBorder = design.border != null;
|
|
1083
|
+
const hasRadius = design.radius != null;
|
|
1084
|
+
if (hasBorder || hasRadius) {
|
|
1085
|
+
let bs = {};
|
|
1086
|
+
if (hasBorder) {
|
|
1087
|
+
if (design.border === false || design.border === "none") {
|
|
1088
|
+
bs.Useborder = false;
|
|
1089
|
+
} else if (typeof design.border === "string") {
|
|
1090
|
+
// shorthand: color slot only
|
|
1091
|
+
const c = resolveSlot(
|
|
1092
|
+
TOKENS.color,
|
|
1093
|
+
design.border,
|
|
1094
|
+
"border color",
|
|
1095
|
+
`${path}.border`,
|
|
1096
|
+
errors,
|
|
1097
|
+
);
|
|
1098
|
+
if (c != null) {
|
|
1099
|
+
bs.Useborder = true;
|
|
1100
|
+
bs.BorderColor = c;
|
|
1101
|
+
bs.BorderSize = 1;
|
|
1102
|
+
bs.BorderType = "solid";
|
|
1103
|
+
bs.SizeSet = "All";
|
|
1104
|
+
sourceMap["BorderStyle.BorderColor"] = `${path}.border`;
|
|
1105
|
+
}
|
|
1106
|
+
} else if (
|
|
1107
|
+
typeof design.border === "object" &&
|
|
1108
|
+
!Array.isArray(design.border)
|
|
1109
|
+
) {
|
|
1110
|
+
const bObj = parseBorderObject(
|
|
1111
|
+
design.border,
|
|
1112
|
+
`${path}.border`,
|
|
1113
|
+
errors,
|
|
1114
|
+
sourceMap,
|
|
1115
|
+
);
|
|
1116
|
+
if (bObj != null) bs = { ...bs, ...bObj };
|
|
1117
|
+
} else {
|
|
1118
|
+
pushErr(
|
|
1119
|
+
errors,
|
|
1120
|
+
`${path}.border`,
|
|
1121
|
+
`border must be a color slot, false, 'none', or an object { color, type?, size? | sides? }`,
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
if (hasRadius) {
|
|
1126
|
+
if (typeof design.radius === "string") {
|
|
1127
|
+
const r = design.radius;
|
|
1128
|
+
if (!INT_RE.test(r)) {
|
|
1129
|
+
pushErr(
|
|
1130
|
+
errors,
|
|
1131
|
+
`${path}.radius`,
|
|
1132
|
+
`radius must be a non-negative integer string (e.g. "16", "9999"; got '${r}')`,
|
|
1133
|
+
);
|
|
1134
|
+
} else {
|
|
1135
|
+
bs.BorderRadius = r;
|
|
1136
|
+
bs.RadiusSet = r === "9999" ? "None" : "All";
|
|
1137
|
+
if (bs.Useborder == null) bs.Useborder = true;
|
|
1138
|
+
sourceMap["BorderStyle.BorderRadius"] = `${path}.radius`;
|
|
1139
|
+
}
|
|
1140
|
+
} else if (
|
|
1141
|
+
typeof design.radius === "object" &&
|
|
1142
|
+
design.radius !== null &&
|
|
1143
|
+
!Array.isArray(design.radius)
|
|
1144
|
+
) {
|
|
1145
|
+
const rObj = parseRadiusObject(
|
|
1146
|
+
design.radius,
|
|
1147
|
+
`${path}.radius`,
|
|
1148
|
+
errors,
|
|
1149
|
+
sourceMap,
|
|
1150
|
+
);
|
|
1151
|
+
if (rObj != null) {
|
|
1152
|
+
bs = { ...bs, ...rObj };
|
|
1153
|
+
if (bs.Useborder == null) bs.Useborder = true;
|
|
1154
|
+
}
|
|
1155
|
+
} else {
|
|
1156
|
+
pushErr(
|
|
1157
|
+
errors,
|
|
1158
|
+
`${path}.radius`,
|
|
1159
|
+
`radius must be a non-negative integer string or { tl?, tr?, br?, bl? } object (got ${typeof design.radius})`,
|
|
1160
|
+
);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
if (Object.keys(bs).length > 0) raw.BorderStyle = bs;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
// ── ContentStyle (elevation — shadow preset only) ───────────────────────
|
|
1167
|
+
if (design.elevation != null) {
|
|
1168
|
+
const cs = resolveSlot(
|
|
1169
|
+
TOKENS.elevation,
|
|
1170
|
+
design.elevation,
|
|
1171
|
+
"elevation",
|
|
1172
|
+
`${path}.elevation`,
|
|
1173
|
+
errors,
|
|
1174
|
+
);
|
|
1175
|
+
if (cs != null) {
|
|
1176
|
+
raw.ContentStyle = cs;
|
|
1177
|
+
sourceMap["ContentStyle"] = `${path}.elevation`;
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
// ── DisplayStyle (flex) ─────────────────────────────────────────────────
|
|
1182
|
+
if (design.flex != null) {
|
|
1183
|
+
const ds = parseFlex(design.flex, `${path}.flex`, errors);
|
|
1184
|
+
if (ds != null) {
|
|
1185
|
+
raw.DisplayStyle = ds;
|
|
1186
|
+
sourceMap["DisplayStyle"] = `${path}.flex`;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// ── CaptionStyle (+ 루트 Caption 내용) ──────────────────────────────────
|
|
1191
|
+
if (design.caption != null) {
|
|
1192
|
+
const cs = parseCaption(
|
|
1193
|
+
design.caption,
|
|
1194
|
+
`${path}.caption`,
|
|
1195
|
+
errors,
|
|
1196
|
+
sourceMap,
|
|
1197
|
+
);
|
|
1198
|
+
if (cs != null) raw.CaptionStyle = cs;
|
|
1199
|
+
// caption.text → 루트 Caption (사용자 보이는 라벨 내용). CaptionStyle(스타일)
|
|
1200
|
+
// 와 별개 필드. design 키 중 유일하게 content 를 담는 슬롯 (캡션 한정 예외).
|
|
1201
|
+
const cap = design.caption;
|
|
1202
|
+
if (
|
|
1203
|
+
cap != null && typeof cap === "object" && !Array.isArray(cap) &&
|
|
1204
|
+
cap.text != null
|
|
1205
|
+
) {
|
|
1206
|
+
if (typeof cap.text !== "string") {
|
|
1207
|
+
pushErr(
|
|
1208
|
+
errors,
|
|
1209
|
+
`${path}.caption.text`,
|
|
1210
|
+
`caption.text must be a string (got ${typeof cap.text})`,
|
|
1211
|
+
);
|
|
1212
|
+
} else {
|
|
1213
|
+
raw.Caption = cap.text;
|
|
1214
|
+
sourceMap["Caption"] = `${path}.caption.text`;
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
// ── AbsolutePosition + UseAbsoluteLayout ────────────────────────────────
|
|
1220
|
+
if (design.abs != null) {
|
|
1221
|
+
const ap = parseAbs(design.abs, `${path}.abs`, errors);
|
|
1222
|
+
if (ap != null) {
|
|
1223
|
+
raw.UseAbsoluteLayout = true;
|
|
1224
|
+
raw.AbsolutePosition = ap;
|
|
1225
|
+
sourceMap["AbsolutePosition"] = `${path}.abs`;
|
|
1226
|
+
sourceMap["UseAbsoluteLayout"] = `${path}.abs`;
|
|
1227
|
+
if (design.abs.t != null) {
|
|
1228
|
+
sourceMap["AbsolutePosition.Top"] = `${path}.abs.t`;
|
|
1229
|
+
}
|
|
1230
|
+
if (design.abs.r != null) {
|
|
1231
|
+
sourceMap["AbsolutePosition.Right"] = `${path}.abs.r`;
|
|
1232
|
+
}
|
|
1233
|
+
if (design.abs.b != null) {
|
|
1234
|
+
sourceMap["AbsolutePosition.Btm"] = `${path}.abs.b`;
|
|
1235
|
+
}
|
|
1236
|
+
if (design.abs.l != null) {
|
|
1237
|
+
sourceMap["AbsolutePosition.Left"] = `${path}.abs.l`;
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
// ── UseOpacity + OpacityValue ───────────────────────────────────────────
|
|
1243
|
+
if (design.opacity != null) {
|
|
1244
|
+
const ov = parseOpacity(design.opacity, `${path}.opacity`, errors);
|
|
1245
|
+
if (ov != null) {
|
|
1246
|
+
raw.UseOpacity = true;
|
|
1247
|
+
raw.OpacityValue = ov;
|
|
1248
|
+
sourceMap["UseOpacity"] = `${path}.opacity`;
|
|
1249
|
+
sourceMap["OpacityValue"] = `${path}.opacity`;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
// ── ItemBgStyle (CheckBox / RadioBox 항목 기본 배경) ────────────────────
|
|
1254
|
+
if (design.itemBg != null) {
|
|
1255
|
+
const c = resolveSlot(
|
|
1256
|
+
TOKENS.color,
|
|
1257
|
+
design.itemBg,
|
|
1258
|
+
"itemBg color",
|
|
1259
|
+
`${path}.itemBg`,
|
|
1260
|
+
errors,
|
|
1261
|
+
);
|
|
1262
|
+
if (c != null) {
|
|
1263
|
+
raw.ItemBgStyle = {
|
|
1264
|
+
UseBackground: true,
|
|
1265
|
+
BgColor: c,
|
|
1266
|
+
UseImage: false,
|
|
1267
|
+
Image: {},
|
|
1268
|
+
};
|
|
1269
|
+
sourceMap["ItemBgStyle.BgColor"] = `${path}.itemBg`;
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
// ── TabHeader / SelectTabHeader / TabHeaderItem / SelectTabHeaderItem ───
|
|
1274
|
+
if (design.tabHeader != null) {
|
|
1275
|
+
const th = parseTabHeader(
|
|
1276
|
+
design.tabHeader,
|
|
1277
|
+
`${path}.tabHeader`,
|
|
1278
|
+
errors,
|
|
1279
|
+
sourceMap,
|
|
1280
|
+
);
|
|
1281
|
+
if (th != null) {
|
|
1282
|
+
for (const [rawKey, val] of Object.entries(th)) {
|
|
1283
|
+
raw[rawKey] = val;
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
// ── UseFixedSize ────────────────────────────────────────────────────────
|
|
1289
|
+
if (design.fixed != null) {
|
|
1290
|
+
if (typeof design.fixed !== "boolean") {
|
|
1291
|
+
pushErr(
|
|
1292
|
+
errors,
|
|
1293
|
+
`${path}.fixed`,
|
|
1294
|
+
`fixed must be boolean (got ${typeof design.fixed})`,
|
|
1295
|
+
);
|
|
1296
|
+
} else {
|
|
1297
|
+
raw.UseFixedSize = design.fixed;
|
|
1298
|
+
sourceMap["UseFixedSize"] = `${path}.fixed`;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
// ── Domain-level fallback entries ───────────────────────────────────────
|
|
1303
|
+
// FontStyle / BgStyle / BorderStyle / CaptionStyle 는 design 키가 leaf
|
|
1304
|
+
// 단위로 매핑되지만, materializer 가 같이 emit 하는 파생 leaf (UseFont /
|
|
1305
|
+
// UseBackground / Useborder / SizeSet / UseDesign 등) 는 leaf 매핑이 없다.
|
|
1306
|
+
// 이런 leaf 의 Ajv 에러가 들어왔을 때 error-mapping 의 부모 fallback 이
|
|
1307
|
+
// 도메인 단위로 잡을 수 있도록, 도메인 레벨 엔트리를 함께 둔다.
|
|
1308
|
+
//
|
|
1309
|
+
// Width / Height / Padding / Margin / DisplayStyle / ContentStyle /
|
|
1310
|
+
// AbsolutePosition / UseAbsoluteLayout / UseOpacity / OpacityValue /
|
|
1311
|
+
// UseFixedSize 는 위에서 이미 도메인 레벨 키로 매핑됐으므로 추가 불필요.
|
|
1312
|
+
if (raw.FontStyle != null && !Object.hasOwn(sourceMap, "FontStyle")) {
|
|
1313
|
+
sourceMap["FontStyle"] = path;
|
|
1314
|
+
}
|
|
1315
|
+
if (raw.BgStyle != null && !Object.hasOwn(sourceMap, "BgStyle")) {
|
|
1316
|
+
sourceMap["BgStyle"] = path;
|
|
1317
|
+
}
|
|
1318
|
+
if (raw.BorderStyle != null && !Object.hasOwn(sourceMap, "BorderStyle")) {
|
|
1319
|
+
sourceMap["BorderStyle"] = path;
|
|
1320
|
+
}
|
|
1321
|
+
if (raw.CaptionStyle != null && !Object.hasOwn(sourceMap, "CaptionStyle")) {
|
|
1322
|
+
sourceMap["CaptionStyle"] = `${path}.caption`;
|
|
1323
|
+
}
|
|
1324
|
+
if (raw.ItemBgStyle != null && !Object.hasOwn(sourceMap, "ItemBgStyle")) {
|
|
1325
|
+
sourceMap["ItemBgStyle"] = `${path}.itemBg`;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
return { raw, sourceMap, errors };
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
1332
|
+
// applyDesign — control 노드에서 design 키를 expand 하고 raw 와 머지.
|
|
1333
|
+
//
|
|
1334
|
+
// 머지 규칙: leaf 단위. design 이 쓴 leaf 는 raw 의 같은 leaf 를 덮어쓰고,
|
|
1335
|
+
// design 이 안 건드린 leaf 는 raw 그대로 보존. style 객체가 통째로 design 에서만
|
|
1336
|
+
// 나온 경우엔 그 객체가 그대로 들어감.
|
|
1337
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
1338
|
+
|
|
1339
|
+
// Group 기본 Width — w 미지정 시 content-sized(text). MatchText 는 boolean
|
|
1340
|
+
// (style-objects.schema.json). design 키 유무와 무관하게 모든 Group 에 적용.
|
|
1341
|
+
const GROUP_DEFAULT_WIDTH = Object.freeze({
|
|
1342
|
+
MatchText: true,
|
|
1343
|
+
SizeValue: "",
|
|
1344
|
+
SizeUnit: "text",
|
|
1345
|
+
});
|
|
1346
|
+
|
|
1347
|
+
/**
|
|
1348
|
+
* @param control control 객체 (design 키 가질 수 있음).
|
|
1349
|
+
* @param path 부모 경로 (에러용; default "$").
|
|
1350
|
+
* @returns { control, sourceMap, errors }
|
|
1351
|
+
*/
|
|
1352
|
+
export function applyDesign(control, path = "$") {
|
|
1353
|
+
if (control == null || typeof control !== "object" || Array.isArray(control)) {
|
|
1354
|
+
return { control, sourceMap: {}, errors: [] };
|
|
1355
|
+
}
|
|
1356
|
+
// design 키 없는 노드 — Group 이고 Width 가 없으면 기본 Width 만 주입 후 반환.
|
|
1357
|
+
// (raw Group 도 Width 없이 렌더되지 않도록. 패턴 산출 Group 은 makeGroup 이
|
|
1358
|
+
// 이미 Width 100% 를 세팅하므로 이 가드를 건너뛴다.)
|
|
1359
|
+
if (control.design == null) {
|
|
1360
|
+
if (control.ContentsType === "Group" && control.Width == null) {
|
|
1361
|
+
return {
|
|
1362
|
+
control: { ...control, Width: { ...GROUP_DEFAULT_WIDTH } },
|
|
1363
|
+
sourceMap: {},
|
|
1364
|
+
errors: [],
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
return { control, sourceMap: {}, errors: [] };
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
const designPath = `${path}.design`;
|
|
1371
|
+
const preErrors = [];
|
|
1372
|
+
|
|
1373
|
+
// flex 는 Group 전용 — Group 이 아닌 컨테이너 (Control 등) 에서는 거부.
|
|
1374
|
+
// 잘못된 DisplayStyle 이 emit 되지 않도록 input 에서 flex 키를 strip.
|
|
1375
|
+
let designInput = control.design;
|
|
1376
|
+
const isGroup = control.ContentsType === "Group";
|
|
1377
|
+
if (designInput.flex != null && !isGroup) {
|
|
1378
|
+
pushErr(
|
|
1379
|
+
preErrors,
|
|
1380
|
+
`${designPath}.flex`,
|
|
1381
|
+
`flex is allowed only on Groups (ContentsType:'Group') — controls do not compose children`,
|
|
1382
|
+
`wrap children in a Group, or remove the flex key`,
|
|
1383
|
+
);
|
|
1384
|
+
const { flex: _f, ...rest } = designInput;
|
|
1385
|
+
designInput = rest;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
// surface 프리셋도 Group 전용 — Paper 는 컨테이너 개념. Control 에서는 거부.
|
|
1389
|
+
if (designInput.surface != null && !isGroup) {
|
|
1390
|
+
pushErr(
|
|
1391
|
+
preErrors,
|
|
1392
|
+
`${designPath}.surface`,
|
|
1393
|
+
`surface preset is allowed only on Groups (ContentsType:'Group') — it styles a container surface`,
|
|
1394
|
+
`wrap content in a Group, or use bg/border/radius/elevation directly on the control`,
|
|
1395
|
+
);
|
|
1396
|
+
const { surface: _s, ...rest } = designInput;
|
|
1397
|
+
designInput = rest;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
const { raw, sourceMap, errors } = materializeDesign(designInput, designPath);
|
|
1401
|
+
if (preErrors.length > 0) errors.unshift(...preErrors);
|
|
1402
|
+
|
|
1403
|
+
const { design: _omit, ...rest } = control;
|
|
1404
|
+
const out = { ...rest };
|
|
1405
|
+
|
|
1406
|
+
for (const [domain, designVal] of Object.entries(raw)) {
|
|
1407
|
+
const rawVal = out[domain];
|
|
1408
|
+
if (
|
|
1409
|
+
rawVal != null &&
|
|
1410
|
+
typeof rawVal === "object" &&
|
|
1411
|
+
typeof designVal === "object" &&
|
|
1412
|
+
!Array.isArray(rawVal) &&
|
|
1413
|
+
!Array.isArray(designVal)
|
|
1414
|
+
) {
|
|
1415
|
+
out[domain] = { ...rawVal, ...designVal };
|
|
1416
|
+
} else {
|
|
1417
|
+
out[domain] = designVal;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
// Group 기본 Width — design.w 미지정 & 기존 raw Width 없음이면 content-sized(text)
|
|
1422
|
+
// 기본 메타를 삽입 (디자인 키 있는 Group 경로; 디자인 키 없는 Group 은 위 early-return).
|
|
1423
|
+
if (isGroup && out.Width == null) {
|
|
1424
|
+
out.Width = { ...GROUP_DEFAULT_WIDTH };
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
return { control: out, sourceMap, errors };
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
1431
|
+
// introspection (테스트 / 디버깅 / get_design_grammar tool 용)
|
|
1432
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
1433
|
+
|
|
1434
|
+
export const designTokens = Object.freeze(TOKENS);
|
|
1435
|
+
export const designKnownKeys = Object.freeze([...KNOWN_KEYS]);
|