@specverse/engines 4.1.30 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/examples/manifests/frontend-only.yaml +3 -6
- package/assets/examples/manifests/fullstack-app.yaml +5 -7
- package/assets/examples/manifests/fullstack-monorepo.yaml +3 -6
- package/assets/templates/default/specs/main.specly +65 -0
- package/dist/inference/comprehensive-engine.d.ts.map +1 -1
- package/dist/inference/comprehensive-engine.js +3 -19
- package/dist/inference/comprehensive-engine.js.map +1 -1
- package/dist/inference/core/rule-engine.d.ts +31 -0
- package/dist/inference/core/rule-engine.d.ts.map +1 -1
- package/dist/inference/core/rule-engine.js +117 -33
- package/dist/inference/core/rule-engine.js.map +1 -1
- package/dist/inference/core/rule-file-types.d.ts +0 -2
- package/dist/inference/core/rule-file-types.d.ts.map +1 -1
- package/dist/inference/core/rule-file-types.js +3 -6
- package/dist/inference/core/rule-file-types.js.map +1 -1
- package/dist/inference/core/rule-loader.d.ts +5 -15
- package/dist/inference/core/rule-loader.d.ts.map +1 -1
- package/dist/inference/core/rule-loader.js +43 -132
- package/dist/inference/core/rule-loader.js.map +1 -1
- package/dist/inference/core/types.d.ts +0 -6
- package/dist/inference/core/types.d.ts.map +1 -1
- package/dist/inference/core/types.js +0 -4
- package/dist/inference/core/types.js.map +1 -1
- package/dist/inference/logical/generators/component-type-resolver.d.ts +0 -26
- package/dist/inference/logical/generators/component-type-resolver.d.ts.map +1 -1
- package/dist/inference/logical/generators/component-type-resolver.js +0 -19
- package/dist/inference/logical/generators/component-type-resolver.js.map +1 -1
- package/dist/inference/logical/generators/specialist-view-expander.d.ts +1 -17
- package/dist/inference/logical/generators/specialist-view-expander.d.ts.map +1 -1
- package/dist/inference/logical/generators/specialist-view-expander.js +0 -15
- package/dist/inference/logical/generators/specialist-view-expander.js.map +1 -1
- package/dist/inference/logical/generators/view-generator.d.ts +4 -14
- package/dist/inference/logical/generators/view-generator.d.ts.map +1 -1
- package/dist/inference/logical/generators/view-generator.js +6 -26
- package/dist/inference/logical/generators/view-generator.js.map +1 -1
- package/dist/inference/logical/index.d.ts +2 -2
- package/dist/inference/logical/index.d.ts.map +1 -1
- package/dist/inference/logical/logical-engine.d.ts.map +1 -1
- package/dist/inference/logical/logical-engine.js +17 -80
- package/dist/inference/logical/logical-engine.js.map +1 -1
- package/dist/inference/quint-transpiler.d.ts +5 -3
- package/dist/inference/quint-transpiler.d.ts.map +1 -1
- package/dist/inference/quint-transpiler.js +11 -6
- package/dist/inference/quint-transpiler.js.map +1 -1
- package/dist/libs/instance-factories/CURVED-INTERFACE.md +278 -0
- package/dist/libs/instance-factories/README.md +73 -0
- package/dist/libs/instance-factories/applications/README.md +51 -0
- package/dist/libs/instance-factories/applications/generic-app.yaml +52 -0
- package/{libs/instance-factories/applications/react-app.yaml → dist/libs/instance-factories/applications/react-app-runtime.yaml} +30 -77
- package/dist/libs/instance-factories/applications/react-app-starter.yaml +143 -0
- package/dist/libs/instance-factories/applications/templates/react/env-example-generator.js +24 -2
- package/dist/libs/instance-factories/applications/templates/react/vite-config-generator.js +54 -33
- package/dist/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.js +69 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.js +110 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/belongs-to.js +40 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.js +129 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/detail-body-composer.js +80 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/form-body-composer.js +217 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/helpers-emitter.js +51 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/html-to-jsx.js +192 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/list-body-composer.js +56 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/orchestrator.js +41 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/package-json-generator.js +38 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/regen-safety.js +89 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.js +95 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/view-emitter.js +81 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/views-generator.js +66 -0
- package/dist/libs/instance-factories/archived/fastify-prisma.yaml +104 -0
- package/dist/libs/instance-factories/cli/README.md +43 -0
- package/dist/libs/instance-factories/cli/commander-js.yaml +55 -0
- package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +63 -12
- package/dist/libs/instance-factories/communication/README.md +47 -0
- package/dist/libs/instance-factories/communication/event-emitter.yaml +60 -0
- package/dist/libs/instance-factories/communication/rabbitmq-events.yaml +87 -0
- package/dist/libs/instance-factories/controllers/README.md +42 -0
- package/dist/libs/instance-factories/controllers/fastify.yaml +139 -0
- package/dist/libs/instance-factories/controllers/templates/fastify/server-generator.js +29 -2
- package/dist/libs/instance-factories/infrastructure/README.md +29 -0
- package/dist/libs/instance-factories/infrastructure/docker-k8s.yaml +61 -0
- package/dist/libs/instance-factories/orms/README.md +54 -0
- package/dist/libs/instance-factories/orms/prisma.yaml +89 -0
- package/dist/libs/instance-factories/orms/templates/prisma/schema-generator.js +2 -2
- package/dist/libs/instance-factories/scaffolding/README.md +49 -0
- package/dist/libs/instance-factories/scaffolding/generic-scaffold.yaml +65 -0
- package/dist/libs/instance-factories/sdks/README.md +28 -0
- package/dist/libs/instance-factories/sdks/python-sdk.yaml +66 -0
- package/dist/libs/instance-factories/sdks/typescript-sdk.yaml +59 -0
- package/dist/libs/instance-factories/services/README.md +55 -0
- package/dist/libs/instance-factories/services/prisma-services.yaml +71 -0
- package/dist/libs/instance-factories/storage/README.md +34 -0
- package/dist/libs/instance-factories/storage/mongodb.yaml +79 -0
- package/dist/libs/instance-factories/storage/postgresql.yaml +75 -0
- package/dist/libs/instance-factories/storage/redis.yaml +79 -0
- package/dist/libs/instance-factories/testing/README.md +40 -0
- package/dist/libs/instance-factories/testing/vitest-tests.yaml +63 -0
- package/dist/libs/instance-factories/tools/README.md +70 -0
- package/dist/libs/instance-factories/tools/mcp.yaml +36 -0
- package/dist/libs/instance-factories/tools/vscode.yaml +35 -0
- package/dist/libs/instance-factories/validation/README.md +38 -0
- package/dist/libs/instance-factories/validation/zod.yaml +56 -0
- package/dist/realize/engines/code-generator.d.ts.map +1 -1
- package/dist/realize/engines/code-generator.js +3 -0
- package/dist/realize/engines/code-generator.js.map +1 -1
- package/dist/realize/index.d.ts.map +1 -1
- package/dist/realize/index.js +15 -22
- package/dist/realize/index.js.map +1 -1
- package/dist/registry/utils/manifest-adapter.d.ts +8 -1
- package/dist/registry/utils/manifest-adapter.d.ts.map +1 -1
- package/dist/registry/utils/manifest-adapter.js +8 -1
- package/dist/registry/utils/manifest-adapter.js.map +1 -1
- package/libs/instance-factories/applications/react-app-starter.yaml +143 -0
- package/libs/instance-factories/applications/templates/react/env-example-generator.ts +24 -2
- package/libs/instance-factories/applications/templates/react/vite-config-generator.ts +54 -33
- package/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/dashboard-body-composer.test.ts +153 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/detail-body-composer.test.ts +146 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/form-body-composer.test.ts +188 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/helpers-emitter.test.ts +55 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/html-to-jsx.test.ts +140 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/list-body-composer.test.ts +146 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/orchestrator.test.ts +184 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p2-factory-imports.test.ts +116 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p3-rendered-output.test.ts +183 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/regen-safety.test.ts +144 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/starter-generators.test.ts +114 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/view-emitter.test.ts +107 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/views-generator.test.ts +139 -0
- package/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.ts +98 -0
- package/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.ts +141 -0
- package/libs/instance-factories/applications/templates/react-starter/belongs-to.ts +82 -0
- package/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.ts +189 -0
- package/libs/instance-factories/applications/templates/react-starter/detail-body-composer.ts +135 -0
- package/libs/instance-factories/applications/templates/react-starter/form-body-composer.ts +383 -0
- package/libs/instance-factories/applications/templates/react-starter/helpers-emitter.ts +66 -0
- package/libs/instance-factories/applications/templates/react-starter/html-to-jsx.ts +334 -0
- package/libs/instance-factories/applications/templates/react-starter/list-body-composer.ts +146 -0
- package/libs/instance-factories/applications/templates/react-starter/orchestrator.ts +95 -0
- package/libs/instance-factories/applications/templates/react-starter/package-json-generator.ts +57 -0
- package/libs/instance-factories/applications/templates/react-starter/regen-safety.ts +157 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
- package/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.ts +124 -0
- package/libs/instance-factories/applications/templates/react-starter/view-emitter.ts +209 -0
- package/libs/instance-factories/applications/templates/react-starter/views-generator.ts +137 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.ts +63 -12
- package/libs/instance-factories/controllers/fastify.yaml +7 -0
- package/libs/instance-factories/controllers/templates/fastify/server-generator.ts +36 -2
- package/libs/instance-factories/orms/templates/prisma/schema-generator.ts +11 -4
- package/package.json +3 -3
- package/dist/libs/instance-factories/applications/templates/react/_view-components-source.js +0 -530
- package/dist/libs/instance-factories/applications/templates/react/app-tsx-generator.js +0 -73
- package/dist/libs/instance-factories/applications/templates/react/field-helpers-generator.js +0 -99
- package/dist/libs/instance-factories/applications/templates/react/package-json-generator.js +0 -49
- package/dist/libs/instance-factories/applications/templates/react/pattern-adapter-generator.js +0 -156
- package/dist/libs/instance-factories/applications/templates/react/react-pattern-adapter.js +0 -935
- package/dist/libs/instance-factories/applications/templates/react/relationship-field-generator.js +0 -143
- package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.js +0 -646
- package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.js +0 -65
- package/dist/libs/instance-factories/applications/templates/react/view-dashboard-generator.js +0 -143
- package/dist/libs/instance-factories/applications/templates/react/view-detail-generator.js +0 -143
- package/dist/libs/instance-factories/applications/templates/react/view-form-generator.js +0 -355
- package/dist/libs/instance-factories/applications/templates/react/view-list-generator.js +0 -91
- package/dist/libs/instance-factories/applications/templates/react/view-router-generator.js +0 -79
- package/dist/libs/instance-factories/views/index.js +0 -48
- package/dist/libs/instance-factories/views/templates/react/adapters/antd-adapter.js +0 -742
- package/dist/libs/instance-factories/views/templates/react/adapters/mui-adapter.js +0 -824
- package/dist/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.js +0 -719
- package/dist/libs/instance-factories/views/templates/react/app-generator.js +0 -45
- package/dist/libs/instance-factories/views/templates/react/components-generator.js +0 -820
- package/dist/libs/instance-factories/views/templates/react/forms-generator.js +0 -275
- package/dist/libs/instance-factories/views/templates/react/frontend-package-json-generator.js +0 -46
- package/dist/libs/instance-factories/views/templates/react/hooks-generator.js +0 -81
- package/dist/libs/instance-factories/views/templates/react/index-css-generator.js +0 -9
- package/dist/libs/instance-factories/views/templates/react/index-html-generator.js +0 -23
- package/dist/libs/instance-factories/views/templates/react/main-tsx-generator.js +0 -21
- package/dist/libs/instance-factories/views/templates/react/react-component-generator.js +0 -299
- package/dist/libs/instance-factories/views/templates/react/router-generator.js +0 -136
- package/dist/libs/instance-factories/views/templates/react/router-generic-generator.js +0 -107
- package/dist/libs/instance-factories/views/templates/react/shared-utils-generator.js +0 -187
- package/dist/libs/instance-factories/views/templates/react/spec-json-generator.js +0 -7
- package/dist/libs/instance-factories/views/templates/react/types-generator.js +0 -56
- package/dist/libs/instance-factories/views/templates/react/views-metadata-generator.js +0 -27
- package/dist/libs/instance-factories/views/templates/react/vite-config-generator.js +0 -29
- package/dist/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js +0 -261
- package/dist/libs/instance-factories/views/templates/shared/adapter-types.js +0 -34
- package/dist/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -800
- package/dist/libs/instance-factories/views/templates/shared/base-generator.js +0 -305
- package/dist/libs/instance-factories/views/templates/shared/component-metadata.js +0 -517
- package/dist/libs/instance-factories/views/templates/shared/composite-pattern-types.js +0 -0
- package/dist/libs/instance-factories/views/templates/shared/composite-patterns.js +0 -445
- package/dist/libs/instance-factories/views/templates/shared/index.js +0 -80
- package/dist/libs/instance-factories/views/templates/shared/pattern-validator.js +0 -210
- package/dist/libs/instance-factories/views/templates/shared/property-mapper.js +0 -492
- package/dist/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -321
- package/dist/realize/index.js.bak +0 -758
- package/libs/instance-factories/applications/templates/react/_view-components-source.ts +0 -555
- package/libs/instance-factories/applications/templates/react/app-tsx-generator.ts +0 -94
- package/libs/instance-factories/applications/templates/react/field-helpers-generator.ts +0 -106
- package/libs/instance-factories/applications/templates/react/package-json-generator.ts +0 -57
- package/libs/instance-factories/applications/templates/react/pattern-adapter-generator.ts +0 -179
- package/libs/instance-factories/applications/templates/react/react-pattern-adapter.tsx +0 -1347
- package/libs/instance-factories/applications/templates/react/relationship-field-generator.ts +0 -150
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.ts +0 -704
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.ts +0 -84
- package/libs/instance-factories/applications/templates/react/view-dashboard-generator.ts +0 -150
- package/libs/instance-factories/applications/templates/react/view-detail-generator.ts +0 -150
- package/libs/instance-factories/applications/templates/react/view-form-generator.ts +0 -362
- package/libs/instance-factories/applications/templates/react/view-list-generator.ts +0 -98
- package/libs/instance-factories/applications/templates/react/view-router-generator.ts +0 -89
- package/libs/instance-factories/views/README.md +0 -62
- package/libs/instance-factories/views/index.d.ts +0 -13
- package/libs/instance-factories/views/index.d.ts.map +0 -1
- package/libs/instance-factories/views/index.js +0 -18
- package/libs/instance-factories/views/index.js.map +0 -1
- package/libs/instance-factories/views/index.ts +0 -45
- package/libs/instance-factories/views/react-components.yaml +0 -129
- package/libs/instance-factories/views/templates/ARCHITECTURE.md +0 -198
- package/libs/instance-factories/views/templates/react/adapters/antd-adapter.ts +0 -869
- package/libs/instance-factories/views/templates/react/adapters/mui-adapter.ts +0 -953
- package/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.ts +0 -806
- package/libs/instance-factories/views/templates/react/app-generator.ts +0 -55
- package/libs/instance-factories/views/templates/react/components-generator.ts +0 -938
- package/libs/instance-factories/views/templates/react/forms-generator.ts +0 -325
- package/libs/instance-factories/views/templates/react/frontend-package-json-generator.ts +0 -57
- package/libs/instance-factories/views/templates/react/hooks-generator.ts +0 -106
- package/libs/instance-factories/views/templates/react/index-css-generator.ts +0 -14
- package/libs/instance-factories/views/templates/react/index-html-generator.ts +0 -34
- package/libs/instance-factories/views/templates/react/main-tsx-generator.ts +0 -29
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts +0 -152
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/react/react-component-generator.js +0 -398
- package/libs/instance-factories/views/templates/react/react-component-generator.js.map +0 -1
- package/libs/instance-factories/views/templates/react/react-component-generator.ts +0 -533
- package/libs/instance-factories/views/templates/react/router-generator.ts +0 -197
- package/libs/instance-factories/views/templates/react/router-generic-generator.ts +0 -132
- package/libs/instance-factories/views/templates/react/shared-utils-generator.ts +0 -196
- package/libs/instance-factories/views/templates/react/spec-json-generator.ts +0 -17
- package/libs/instance-factories/views/templates/react/types-generator.ts +0 -76
- package/libs/instance-factories/views/templates/react/views-metadata-generator.ts +0 -42
- package/libs/instance-factories/views/templates/react/vite-config-generator.ts +0 -38
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js.map +0 -1
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.ts +0 -474
- package/libs/instance-factories/views/templates/shared/__tests__/composite-patterns.test.ts +0 -242
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts +0 -77
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/adapter-types.js +0 -47
- package/libs/instance-factories/views/templates/shared/adapter-types.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/adapter-types.ts +0 -142
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts +0 -63
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -822
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.ts +0 -908
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts +0 -247
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/base-generator.js +0 -363
- package/libs/instance-factories/views/templates/shared/base-generator.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/base-generator.ts +0 -608
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts +0 -254
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/component-metadata.js +0 -602
- package/libs/instance-factories/views/templates/shared/component-metadata.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/component-metadata.ts +0 -803
- package/libs/instance-factories/views/templates/shared/composite-pattern-types.ts +0 -250
- package/libs/instance-factories/views/templates/shared/composite-patterns.ts +0 -535
- package/libs/instance-factories/views/templates/shared/index.ts +0 -68
- package/libs/instance-factories/views/templates/shared/pattern-validator.ts +0 -279
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts +0 -149
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/property-mapper.js +0 -580
- package/libs/instance-factories/views/templates/shared/property-mapper.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/property-mapper.ts +0 -700
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts +0 -143
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -420
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/syntax-mapper.ts +0 -539
|
@@ -1,700 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Property Mapper - Multi-Framework Support
|
|
3
|
-
*
|
|
4
|
-
* Maps SpecVerse component properties to framework-specific property values.
|
|
5
|
-
* Supports React (shadcn, MUI, antd), Vue (Vuetify, Element Plus), Svelte (Carbon),
|
|
6
|
-
* Angular (Material), and runtime interpretation.
|
|
7
|
-
*
|
|
8
|
-
* Architecture:
|
|
9
|
-
* - PropertyTarget: All supported frameworks/libraries + semantic layer
|
|
10
|
-
* - COMMON_PROPERTY_MAPPINGS: Universal properties (variant, size, color, position, orientation)
|
|
11
|
-
* - COMPONENT_SPECIFIC_MAPPINGS: Per-component overrides
|
|
12
|
-
* - mapProperty(): Main mapping function with fallback chain
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
// ============================================================================
|
|
16
|
-
// Types
|
|
17
|
-
// ============================================================================
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* All supported property mapping targets
|
|
21
|
-
*/
|
|
22
|
-
export type PropertyTarget =
|
|
23
|
-
// React libraries
|
|
24
|
-
| 'shadcn'
|
|
25
|
-
| 'mui'
|
|
26
|
-
| 'antd'
|
|
27
|
-
// Vue libraries
|
|
28
|
-
| 'vuetify'
|
|
29
|
-
| 'elementPlus'
|
|
30
|
-
| 'primeVue'
|
|
31
|
-
// Svelte libraries
|
|
32
|
-
| 'carbon'
|
|
33
|
-
| 'svelteui'
|
|
34
|
-
// Angular libraries
|
|
35
|
-
| 'angularMaterial'
|
|
36
|
-
| 'primeNg'
|
|
37
|
-
// Runtime interpretation
|
|
38
|
-
| 'runtime'
|
|
39
|
-
// Universal semantic meaning
|
|
40
|
-
| 'semantic';
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Framework categories for quick target identification
|
|
44
|
-
*/
|
|
45
|
-
export type FrameworkCategory = 'react' | 'vue' | 'svelte' | 'angular' | 'runtime';
|
|
46
|
-
|
|
47
|
-
export const FRAMEWORK_TARGETS: Record<FrameworkCategory, PropertyTarget[]> = {
|
|
48
|
-
react: ['shadcn', 'mui', 'antd'],
|
|
49
|
-
vue: ['vuetify', 'elementPlus', 'primeVue'],
|
|
50
|
-
svelte: ['carbon', 'svelteui'],
|
|
51
|
-
angular: ['angularMaterial', 'primeNg'],
|
|
52
|
-
runtime: ['runtime']
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Property value mapping for a specific SpecVerse value
|
|
57
|
-
*/
|
|
58
|
-
export interface PropertyValueMapping {
|
|
59
|
-
shadcn?: string | boolean | number;
|
|
60
|
-
mui?: string | boolean | number;
|
|
61
|
-
antd?: string | boolean | number;
|
|
62
|
-
vuetify?: string | boolean | number;
|
|
63
|
-
elementPlus?: string | boolean | number;
|
|
64
|
-
primeVue?: string | boolean | number;
|
|
65
|
-
carbon?: string | boolean | number;
|
|
66
|
-
svelteui?: string | boolean | number;
|
|
67
|
-
angularMaterial?: string | boolean | number;
|
|
68
|
-
primeNg?: string | boolean | number;
|
|
69
|
-
runtime?: string | boolean | number;
|
|
70
|
-
semantic: string; // Always required - universal meaning
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Complete mapping for a property
|
|
75
|
-
*/
|
|
76
|
-
export interface PropertyMapping {
|
|
77
|
-
[specverseValue: string]: PropertyValueMapping;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Component-specific property overrides
|
|
82
|
-
*/
|
|
83
|
-
export interface ComponentPropertyMapping {
|
|
84
|
-
[componentType: string]: {
|
|
85
|
-
[propertyName: string]: PropertyMapping;
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// ============================================================================
|
|
90
|
-
// Common Property Mappings (Universal across all component types)
|
|
91
|
-
// ============================================================================
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Variant mappings - Primary, secondary, destructive actions
|
|
95
|
-
* Consistency: 60-85% across frameworks (HIGH)
|
|
96
|
-
*/
|
|
97
|
-
export const VARIANT_MAPPING: PropertyMapping = {
|
|
98
|
-
primary: {
|
|
99
|
-
shadcn: 'default',
|
|
100
|
-
mui: 'contained',
|
|
101
|
-
antd: 'primary',
|
|
102
|
-
vuetify: 'primary',
|
|
103
|
-
elementPlus: 'primary',
|
|
104
|
-
primeVue: 'primary',
|
|
105
|
-
carbon: 'primary',
|
|
106
|
-
svelteui: 'primary',
|
|
107
|
-
angularMaterial: 'primary',
|
|
108
|
-
primeNg: 'primary',
|
|
109
|
-
runtime: 'primary',
|
|
110
|
-
semantic: 'primary-action'
|
|
111
|
-
},
|
|
112
|
-
secondary: {
|
|
113
|
-
shadcn: 'secondary',
|
|
114
|
-
mui: 'outlined',
|
|
115
|
-
antd: 'default',
|
|
116
|
-
vuetify: 'secondary',
|
|
117
|
-
elementPlus: 'default',
|
|
118
|
-
primeVue: 'secondary',
|
|
119
|
-
carbon: 'secondary',
|
|
120
|
-
svelteui: 'secondary',
|
|
121
|
-
angularMaterial: 'accent',
|
|
122
|
-
primeNg: 'secondary',
|
|
123
|
-
runtime: 'secondary',
|
|
124
|
-
semantic: 'secondary-action'
|
|
125
|
-
},
|
|
126
|
-
destructive: {
|
|
127
|
-
shadcn: 'destructive',
|
|
128
|
-
mui: 'error',
|
|
129
|
-
antd: 'danger',
|
|
130
|
-
vuetify: 'error',
|
|
131
|
-
elementPlus: 'danger',
|
|
132
|
-
primeVue: 'danger',
|
|
133
|
-
carbon: 'danger',
|
|
134
|
-
svelteui: 'error',
|
|
135
|
-
angularMaterial: 'warn',
|
|
136
|
-
primeNg: 'danger',
|
|
137
|
-
runtime: 'destructive',
|
|
138
|
-
semantic: 'destructive-action'
|
|
139
|
-
},
|
|
140
|
-
ghost: {
|
|
141
|
-
shadcn: 'ghost',
|
|
142
|
-
mui: 'text',
|
|
143
|
-
antd: 'link',
|
|
144
|
-
vuetify: 'text',
|
|
145
|
-
elementPlus: 'text',
|
|
146
|
-
primeVue: 'text',
|
|
147
|
-
carbon: 'ghost',
|
|
148
|
-
svelteui: 'ghost',
|
|
149
|
-
angularMaterial: 'basic',
|
|
150
|
-
primeNg: 'text',
|
|
151
|
-
runtime: 'ghost',
|
|
152
|
-
semantic: 'minimal-action'
|
|
153
|
-
},
|
|
154
|
-
outline: {
|
|
155
|
-
shadcn: 'outline',
|
|
156
|
-
mui: 'outlined',
|
|
157
|
-
antd: 'default',
|
|
158
|
-
vuetify: 'outlined',
|
|
159
|
-
elementPlus: 'plain',
|
|
160
|
-
primeVue: 'outlined',
|
|
161
|
-
carbon: 'tertiary',
|
|
162
|
-
svelteui: 'outline',
|
|
163
|
-
angularMaterial: 'stroked',
|
|
164
|
-
primeNg: 'outlined',
|
|
165
|
-
runtime: 'outline',
|
|
166
|
-
semantic: 'outlined-action'
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Size mappings - Component dimensions
|
|
172
|
-
* Consistency: 85-90% across frameworks (VERY HIGH)
|
|
173
|
-
*/
|
|
174
|
-
export const SIZE_MAPPING: PropertyMapping = {
|
|
175
|
-
small: {
|
|
176
|
-
shadcn: 'sm',
|
|
177
|
-
mui: 'small',
|
|
178
|
-
antd: 'small',
|
|
179
|
-
vuetify: 'small',
|
|
180
|
-
elementPlus: 'small',
|
|
181
|
-
primeVue: 'small',
|
|
182
|
-
carbon: 'sm',
|
|
183
|
-
svelteui: 'sm',
|
|
184
|
-
angularMaterial: 'small',
|
|
185
|
-
primeNg: 'small',
|
|
186
|
-
runtime: 'small',
|
|
187
|
-
semantic: 'compact'
|
|
188
|
-
},
|
|
189
|
-
medium: {
|
|
190
|
-
shadcn: 'default',
|
|
191
|
-
mui: 'medium',
|
|
192
|
-
antd: 'middle',
|
|
193
|
-
vuetify: 'default',
|
|
194
|
-
elementPlus: 'default',
|
|
195
|
-
primeVue: 'default',
|
|
196
|
-
carbon: 'md',
|
|
197
|
-
svelteui: 'md',
|
|
198
|
-
angularMaterial: 'medium',
|
|
199
|
-
primeNg: 'medium',
|
|
200
|
-
runtime: 'medium',
|
|
201
|
-
semantic: 'standard'
|
|
202
|
-
},
|
|
203
|
-
large: {
|
|
204
|
-
shadcn: 'lg',
|
|
205
|
-
mui: 'large',
|
|
206
|
-
antd: 'large',
|
|
207
|
-
vuetify: 'large',
|
|
208
|
-
elementPlus: 'large',
|
|
209
|
-
primeVue: 'large',
|
|
210
|
-
carbon: 'lg',
|
|
211
|
-
svelteui: 'lg',
|
|
212
|
-
angularMaterial: 'large',
|
|
213
|
-
primeNg: 'large',
|
|
214
|
-
runtime: 'large',
|
|
215
|
-
semantic: 'spacious'
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Color mappings - Semantic color values
|
|
221
|
-
* Consistency: 70-80% across frameworks (HIGH)
|
|
222
|
-
*/
|
|
223
|
-
export const COLOR_MAPPING: PropertyMapping = {
|
|
224
|
-
primary: {
|
|
225
|
-
shadcn: 'primary',
|
|
226
|
-
mui: 'primary',
|
|
227
|
-
antd: 'primary',
|
|
228
|
-
vuetify: 'primary',
|
|
229
|
-
elementPlus: 'primary',
|
|
230
|
-
primeVue: 'primary',
|
|
231
|
-
carbon: 'blue',
|
|
232
|
-
svelteui: 'primary',
|
|
233
|
-
angularMaterial: 'primary',
|
|
234
|
-
primeNg: 'primary',
|
|
235
|
-
runtime: 'primary',
|
|
236
|
-
semantic: 'primary-color'
|
|
237
|
-
},
|
|
238
|
-
success: {
|
|
239
|
-
shadcn: 'success',
|
|
240
|
-
mui: 'success',
|
|
241
|
-
antd: 'success',
|
|
242
|
-
vuetify: 'success',
|
|
243
|
-
elementPlus: 'success',
|
|
244
|
-
primeVue: 'success',
|
|
245
|
-
carbon: 'green',
|
|
246
|
-
svelteui: 'success',
|
|
247
|
-
angularMaterial: 'success',
|
|
248
|
-
primeNg: 'success',
|
|
249
|
-
runtime: 'success',
|
|
250
|
-
semantic: 'positive-feedback'
|
|
251
|
-
},
|
|
252
|
-
warning: {
|
|
253
|
-
shadcn: 'warning',
|
|
254
|
-
mui: 'warning',
|
|
255
|
-
antd: 'warning',
|
|
256
|
-
vuetify: 'warning',
|
|
257
|
-
elementPlus: 'warning',
|
|
258
|
-
primeVue: 'warning',
|
|
259
|
-
carbon: 'yellow',
|
|
260
|
-
svelteui: 'warning',
|
|
261
|
-
angularMaterial: 'warn',
|
|
262
|
-
primeNg: 'warning',
|
|
263
|
-
runtime: 'warning',
|
|
264
|
-
semantic: 'caution-feedback'
|
|
265
|
-
},
|
|
266
|
-
error: {
|
|
267
|
-
shadcn: 'destructive',
|
|
268
|
-
mui: 'error',
|
|
269
|
-
antd: 'error',
|
|
270
|
-
vuetify: 'error',
|
|
271
|
-
elementPlus: 'error',
|
|
272
|
-
primeVue: 'danger',
|
|
273
|
-
carbon: 'red',
|
|
274
|
-
svelteui: 'error',
|
|
275
|
-
angularMaterial: 'warn',
|
|
276
|
-
primeNg: 'danger',
|
|
277
|
-
runtime: 'error',
|
|
278
|
-
semantic: 'negative-feedback'
|
|
279
|
-
},
|
|
280
|
-
info: {
|
|
281
|
-
shadcn: 'default',
|
|
282
|
-
mui: 'info',
|
|
283
|
-
antd: 'info',
|
|
284
|
-
vuetify: 'info',
|
|
285
|
-
elementPlus: 'info',
|
|
286
|
-
primeVue: 'info',
|
|
287
|
-
carbon: 'cyan',
|
|
288
|
-
svelteui: 'info',
|
|
289
|
-
angularMaterial: 'primary',
|
|
290
|
-
primeNg: 'info',
|
|
291
|
-
runtime: 'info',
|
|
292
|
-
semantic: 'informational-feedback'
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Position mappings - Spatial positioning
|
|
298
|
-
* Consistency: 95-100% across frameworks (UNIVERSAL)
|
|
299
|
-
*/
|
|
300
|
-
export const POSITION_MAPPING: PropertyMapping = {
|
|
301
|
-
top: {
|
|
302
|
-
shadcn: 'top',
|
|
303
|
-
mui: 'top',
|
|
304
|
-
antd: 'top',
|
|
305
|
-
vuetify: 'top',
|
|
306
|
-
elementPlus: 'top',
|
|
307
|
-
primeVue: 'top',
|
|
308
|
-
carbon: 'top',
|
|
309
|
-
svelteui: 'top',
|
|
310
|
-
angularMaterial: 'above',
|
|
311
|
-
primeNg: 'top',
|
|
312
|
-
runtime: 'top',
|
|
313
|
-
semantic: 'top-position'
|
|
314
|
-
},
|
|
315
|
-
bottom: {
|
|
316
|
-
shadcn: 'bottom',
|
|
317
|
-
mui: 'bottom',
|
|
318
|
-
antd: 'bottom',
|
|
319
|
-
vuetify: 'bottom',
|
|
320
|
-
elementPlus: 'bottom',
|
|
321
|
-
primeVue: 'bottom',
|
|
322
|
-
carbon: 'bottom',
|
|
323
|
-
svelteui: 'bottom',
|
|
324
|
-
angularMaterial: 'below',
|
|
325
|
-
primeNg: 'bottom',
|
|
326
|
-
runtime: 'bottom',
|
|
327
|
-
semantic: 'bottom-position'
|
|
328
|
-
},
|
|
329
|
-
left: {
|
|
330
|
-
shadcn: 'left',
|
|
331
|
-
mui: 'left',
|
|
332
|
-
antd: 'left',
|
|
333
|
-
vuetify: 'left',
|
|
334
|
-
elementPlus: 'left',
|
|
335
|
-
primeVue: 'left',
|
|
336
|
-
carbon: 'left',
|
|
337
|
-
svelteui: 'left',
|
|
338
|
-
angularMaterial: 'before',
|
|
339
|
-
primeNg: 'left',
|
|
340
|
-
runtime: 'left',
|
|
341
|
-
semantic: 'left-position'
|
|
342
|
-
},
|
|
343
|
-
right: {
|
|
344
|
-
shadcn: 'right',
|
|
345
|
-
mui: 'right',
|
|
346
|
-
antd: 'right',
|
|
347
|
-
vuetify: 'right',
|
|
348
|
-
elementPlus: 'right',
|
|
349
|
-
primeVue: 'right',
|
|
350
|
-
carbon: 'right',
|
|
351
|
-
svelteui: 'right',
|
|
352
|
-
angularMaterial: 'after',
|
|
353
|
-
primeNg: 'right',
|
|
354
|
-
runtime: 'right',
|
|
355
|
-
semantic: 'right-position'
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Orientation mappings - Layout direction
|
|
361
|
-
* Consistency: 90-95% across frameworks (VERY HIGH)
|
|
362
|
-
*/
|
|
363
|
-
export const ORIENTATION_MAPPING: PropertyMapping = {
|
|
364
|
-
horizontal: {
|
|
365
|
-
shadcn: 'horizontal',
|
|
366
|
-
mui: 'horizontal',
|
|
367
|
-
antd: 'horizontal',
|
|
368
|
-
vuetify: 'horizontal',
|
|
369
|
-
elementPlus: 'horizontal',
|
|
370
|
-
primeVue: 'horizontal',
|
|
371
|
-
carbon: 'horizontal',
|
|
372
|
-
svelteui: 'horizontal',
|
|
373
|
-
angularMaterial: 'horizontal',
|
|
374
|
-
primeNg: 'horizontal',
|
|
375
|
-
runtime: 'horizontal',
|
|
376
|
-
semantic: 'horizontal-layout'
|
|
377
|
-
},
|
|
378
|
-
vertical: {
|
|
379
|
-
shadcn: 'vertical',
|
|
380
|
-
mui: 'vertical',
|
|
381
|
-
antd: 'vertical',
|
|
382
|
-
vuetify: 'vertical',
|
|
383
|
-
elementPlus: 'vertical',
|
|
384
|
-
primeVue: 'vertical',
|
|
385
|
-
carbon: 'vertical',
|
|
386
|
-
svelteui: 'vertical',
|
|
387
|
-
angularMaterial: 'vertical',
|
|
388
|
-
primeNg: 'vertical',
|
|
389
|
-
runtime: 'vertical',
|
|
390
|
-
semantic: 'vertical-layout'
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* All common property mappings
|
|
396
|
-
*/
|
|
397
|
-
export const COMMON_PROPERTY_MAPPINGS: Record<string, PropertyMapping> = {
|
|
398
|
-
variant: VARIANT_MAPPING,
|
|
399
|
-
size: SIZE_MAPPING,
|
|
400
|
-
color: COLOR_MAPPING,
|
|
401
|
-
position: POSITION_MAPPING,
|
|
402
|
-
orientation: ORIENTATION_MAPPING
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
// ============================================================================
|
|
406
|
-
// Component-Specific Property Mappings (Overrides)
|
|
407
|
-
// ============================================================================
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Component-specific overrides for properties that differ from common mappings
|
|
411
|
-
*
|
|
412
|
-
* Example: Table pagination size works differently than button size
|
|
413
|
-
*/
|
|
414
|
-
export const COMPONENT_SPECIFIC_MAPPINGS: ComponentPropertyMapping = {
|
|
415
|
-
table: {
|
|
416
|
-
size: {
|
|
417
|
-
small: {
|
|
418
|
-
shadcn: 'sm',
|
|
419
|
-
mui: 'small',
|
|
420
|
-
antd: 'small',
|
|
421
|
-
vuetify: 'small',
|
|
422
|
-
elementPlus: 'small',
|
|
423
|
-
primeVue: 'small',
|
|
424
|
-
carbon: 'sm',
|
|
425
|
-
svelteui: 'compact',
|
|
426
|
-
angularMaterial: 'small',
|
|
427
|
-
primeNg: 'small',
|
|
428
|
-
runtime: 'small',
|
|
429
|
-
semantic: 'compact-table'
|
|
430
|
-
},
|
|
431
|
-
medium: {
|
|
432
|
-
shadcn: 'default',
|
|
433
|
-
mui: 'medium',
|
|
434
|
-
antd: 'middle',
|
|
435
|
-
vuetify: 'default',
|
|
436
|
-
elementPlus: 'default',
|
|
437
|
-
primeVue: 'default',
|
|
438
|
-
carbon: 'md',
|
|
439
|
-
svelteui: 'default',
|
|
440
|
-
angularMaterial: 'medium',
|
|
441
|
-
primeNg: 'medium',
|
|
442
|
-
runtime: 'medium',
|
|
443
|
-
semantic: 'standard-table'
|
|
444
|
-
},
|
|
445
|
-
large: {
|
|
446
|
-
shadcn: 'lg',
|
|
447
|
-
mui: 'large',
|
|
448
|
-
antd: 'large',
|
|
449
|
-
vuetify: 'large',
|
|
450
|
-
elementPlus: 'large',
|
|
451
|
-
primeVue: 'large',
|
|
452
|
-
carbon: 'lg',
|
|
453
|
-
svelteui: 'relaxed',
|
|
454
|
-
angularMaterial: 'large',
|
|
455
|
-
primeNg: 'large',
|
|
456
|
-
runtime: 'large',
|
|
457
|
-
semantic: 'spacious-table'
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
|
|
462
|
-
input: {
|
|
463
|
-
variant: {
|
|
464
|
-
// Inputs use different variant semantics
|
|
465
|
-
filled: {
|
|
466
|
-
shadcn: 'default',
|
|
467
|
-
mui: 'filled',
|
|
468
|
-
antd: 'filled',
|
|
469
|
-
vuetify: 'filled',
|
|
470
|
-
elementPlus: 'default',
|
|
471
|
-
primeVue: 'filled',
|
|
472
|
-
carbon: 'default',
|
|
473
|
-
svelteui: 'filled',
|
|
474
|
-
angularMaterial: 'fill',
|
|
475
|
-
primeNg: 'filled',
|
|
476
|
-
runtime: 'filled',
|
|
477
|
-
semantic: 'filled-input'
|
|
478
|
-
},
|
|
479
|
-
outlined: {
|
|
480
|
-
shadcn: 'outline',
|
|
481
|
-
mui: 'outlined',
|
|
482
|
-
antd: 'outlined',
|
|
483
|
-
vuetify: 'outlined',
|
|
484
|
-
elementPlus: 'default',
|
|
485
|
-
primeVue: 'outlined',
|
|
486
|
-
carbon: 'outline',
|
|
487
|
-
svelteui: 'outlined',
|
|
488
|
-
angularMaterial: 'outline',
|
|
489
|
-
primeNg: 'outlined',
|
|
490
|
-
runtime: 'outlined',
|
|
491
|
-
semantic: 'outlined-input'
|
|
492
|
-
},
|
|
493
|
-
standard: {
|
|
494
|
-
shadcn: 'default',
|
|
495
|
-
mui: 'standard',
|
|
496
|
-
antd: 'borderless',
|
|
497
|
-
vuetify: 'underlined',
|
|
498
|
-
elementPlus: 'default',
|
|
499
|
-
primeVue: 'standard',
|
|
500
|
-
carbon: 'default',
|
|
501
|
-
svelteui: 'standard',
|
|
502
|
-
angularMaterial: 'standard',
|
|
503
|
-
primeNg: 'standard',
|
|
504
|
-
runtime: 'standard',
|
|
505
|
-
semantic: 'standard-input'
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
},
|
|
509
|
-
|
|
510
|
-
badge: {
|
|
511
|
-
variant: {
|
|
512
|
-
// Badges use different variant semantics
|
|
513
|
-
dot: {
|
|
514
|
-
shadcn: 'default',
|
|
515
|
-
mui: 'dot',
|
|
516
|
-
antd: 'default',
|
|
517
|
-
vuetify: 'dot',
|
|
518
|
-
elementPlus: 'default',
|
|
519
|
-
primeVue: 'default',
|
|
520
|
-
carbon: 'default',
|
|
521
|
-
svelteui: 'dot',
|
|
522
|
-
angularMaterial: 'default',
|
|
523
|
-
primeNg: 'default',
|
|
524
|
-
runtime: 'dot',
|
|
525
|
-
semantic: 'notification-indicator'
|
|
526
|
-
},
|
|
527
|
-
standard: {
|
|
528
|
-
shadcn: 'default',
|
|
529
|
-
mui: 'standard',
|
|
530
|
-
antd: 'default',
|
|
531
|
-
vuetify: 'default',
|
|
532
|
-
elementPlus: 'default',
|
|
533
|
-
primeVue: 'default',
|
|
534
|
-
carbon: 'default',
|
|
535
|
-
svelteui: 'default',
|
|
536
|
-
angularMaterial: 'default',
|
|
537
|
-
primeNg: 'default',
|
|
538
|
-
runtime: 'standard',
|
|
539
|
-
semantic: 'count-indicator'
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
// ============================================================================
|
|
546
|
-
// Mapping Functions
|
|
547
|
-
// ============================================================================
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* Maps a single property value from SpecVerse to a target framework/library
|
|
551
|
-
*
|
|
552
|
-
* Fallback chain:
|
|
553
|
-
* 1. Component-specific mapping
|
|
554
|
-
* 2. Common property mapping
|
|
555
|
-
* 3. Original value (passthrough)
|
|
556
|
-
*
|
|
557
|
-
* @param componentType - Component type (e.g., 'button', 'table')
|
|
558
|
-
* @param propertyName - Property name (e.g., 'variant', 'size')
|
|
559
|
-
* @param specverseValue - SpecVerse property value (e.g., 'primary', 'large')
|
|
560
|
-
* @param target - Target framework/library
|
|
561
|
-
* @returns Mapped property value for target
|
|
562
|
-
*/
|
|
563
|
-
export function mapProperty(
|
|
564
|
-
componentType: string,
|
|
565
|
-
propertyName: string,
|
|
566
|
-
specverseValue: any,
|
|
567
|
-
target: PropertyTarget
|
|
568
|
-
): any {
|
|
569
|
-
// Handle non-string primitive values (numbers, booleans) - pass through
|
|
570
|
-
if (typeof specverseValue !== 'string') {
|
|
571
|
-
return specverseValue;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
// 1. Try component-specific mapping
|
|
575
|
-
const componentMapping = COMPONENT_SPECIFIC_MAPPINGS[componentType]?.[propertyName]?.[specverseValue];
|
|
576
|
-
if (componentMapping && target in componentMapping) {
|
|
577
|
-
return componentMapping[target as keyof PropertyValueMapping];
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
// 2. Try common property mapping
|
|
581
|
-
const commonMapping = COMMON_PROPERTY_MAPPINGS[propertyName]?.[specverseValue];
|
|
582
|
-
if (commonMapping && target in commonMapping) {
|
|
583
|
-
return commonMapping[target as keyof PropertyValueMapping];
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
// 3. Fallback: Return original value
|
|
587
|
-
return specverseValue;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
/**
|
|
591
|
-
* Gets the semantic meaning of a property value (universal across frameworks)
|
|
592
|
-
*
|
|
593
|
-
* @param propertyName - Property name
|
|
594
|
-
* @param specverseValue - SpecVerse property value
|
|
595
|
-
* @returns Semantic meaning string
|
|
596
|
-
*/
|
|
597
|
-
export function getSemanticMeaning(
|
|
598
|
-
propertyName: string,
|
|
599
|
-
specverseValue: string
|
|
600
|
-
): string {
|
|
601
|
-
const commonMapping = COMMON_PROPERTY_MAPPINGS[propertyName]?.[specverseValue];
|
|
602
|
-
if (commonMapping && 'semantic' in commonMapping) {
|
|
603
|
-
return commonMapping.semantic as string;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
return `${propertyName}-${specverseValue}`;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* Maps all properties of a component to a target framework/library
|
|
611
|
-
*
|
|
612
|
-
* @param componentType - Component type
|
|
613
|
-
* @param properties - Object containing all component properties
|
|
614
|
-
* @param target - Target framework/library
|
|
615
|
-
* @returns Object with all properties mapped to target
|
|
616
|
-
*/
|
|
617
|
-
export function mapProperties(
|
|
618
|
-
componentType: string,
|
|
619
|
-
properties: Record<string, any>,
|
|
620
|
-
target: PropertyTarget
|
|
621
|
-
): Record<string, any> {
|
|
622
|
-
const mappedProperties: Record<string, any> = {};
|
|
623
|
-
|
|
624
|
-
for (const [propName, propValue] of Object.entries(properties)) {
|
|
625
|
-
mappedProperties[propName] = mapProperty(
|
|
626
|
-
componentType,
|
|
627
|
-
propName,
|
|
628
|
-
propValue,
|
|
629
|
-
target
|
|
630
|
-
);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
return mappedProperties;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
/**
|
|
637
|
-
* Gets all framework targets for a given framework category
|
|
638
|
-
*
|
|
639
|
-
* @param category - Framework category
|
|
640
|
-
* @returns Array of property targets for that framework
|
|
641
|
-
*/
|
|
642
|
-
export function getFrameworkTargets(category: FrameworkCategory): PropertyTarget[] {
|
|
643
|
-
return FRAMEWORK_TARGETS[category];
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* Checks if a property value has a mapping for a specific target
|
|
648
|
-
*
|
|
649
|
-
* @param componentType - Component type
|
|
650
|
-
* @param propertyName - Property name
|
|
651
|
-
* @param specverseValue - SpecVerse property value
|
|
652
|
-
* @param target - Target framework/library
|
|
653
|
-
* @returns True if mapping exists, false otherwise
|
|
654
|
-
*/
|
|
655
|
-
export function hasMapping(
|
|
656
|
-
componentType: string,
|
|
657
|
-
propertyName: string,
|
|
658
|
-
specverseValue: string,
|
|
659
|
-
target: PropertyTarget
|
|
660
|
-
): boolean {
|
|
661
|
-
const componentMapping = COMPONENT_SPECIFIC_MAPPINGS[componentType]?.[propertyName]?.[specverseValue];
|
|
662
|
-
if (componentMapping && target in componentMapping) {
|
|
663
|
-
return true;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
const commonMapping = COMMON_PROPERTY_MAPPINGS[propertyName]?.[specverseValue];
|
|
667
|
-
if (commonMapping && target in commonMapping) {
|
|
668
|
-
return true;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
return false;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* Gets all available mappings for a property across all frameworks
|
|
676
|
-
*
|
|
677
|
-
* Useful for debugging and documentation generation
|
|
678
|
-
*
|
|
679
|
-
* @param componentType - Component type
|
|
680
|
-
* @param propertyName - Property name
|
|
681
|
-
* @param specverseValue - SpecVerse property value
|
|
682
|
-
* @returns Object with all target mappings
|
|
683
|
-
*/
|
|
684
|
-
export function getAllMappings(
|
|
685
|
-
componentType: string,
|
|
686
|
-
propertyName: string,
|
|
687
|
-
specverseValue: string
|
|
688
|
-
): Partial<PropertyValueMapping> | null {
|
|
689
|
-
const componentMapping = COMPONENT_SPECIFIC_MAPPINGS[componentType]?.[propertyName]?.[specverseValue];
|
|
690
|
-
if (componentMapping) {
|
|
691
|
-
return componentMapping;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
const commonMapping = COMMON_PROPERTY_MAPPINGS[propertyName]?.[specverseValue];
|
|
695
|
-
if (commonMapping) {
|
|
696
|
-
return commonMapping;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
return null;
|
|
700
|
-
}
|