@specverse/engines 4.1.28 → 4.2.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/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/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/applications/templates/generic/main-generator.js +3 -3
- package/dist/libs/instance-factories/applications/templates/react/api-client-generator.js +16 -6
- package/dist/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.js +110 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.js +121 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/detail-body-composer.js +78 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/form-body-composer.js +190 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/helpers-emitter.js +45 -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 +46 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/orchestrator.js +30 -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/view-emitter.js +56 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/views-generator.js +66 -0
- package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +14 -11
- package/dist/libs/instance-factories/controllers/templates/fastify/server-generator.js +11 -3
- package/dist/libs/instance-factories/services/templates/prisma/controller-generator.js +27 -17
- package/dist/libs/instance-factories/shared/path-resolver.js +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 +150 -0
- package/libs/instance-factories/applications/templates/generic/main-generator.ts +3 -3
- package/libs/instance-factories/applications/templates/react/api-client-generator.ts +16 -6
- 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 +145 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/form-body-composer.test.ts +175 -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 +163 -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/app-tsx-generator.ts +141 -0
- package/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.ts +174 -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 +306 -0
- package/libs/instance-factories/applications/templates/react-starter/helpers-emitter.ts +60 -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 +120 -0
- package/libs/instance-factories/applications/templates/react-starter/orchestrator.ts +80 -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 +47 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +94 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +114 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +72 -0
- package/libs/instance-factories/applications/templates/react-starter/view-emitter.ts +151 -0
- package/libs/instance-factories/applications/templates/react-starter/views-generator.ts +137 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.ts +14 -11
- package/libs/instance-factories/controllers/templates/fastify/server-generator.ts +11 -3
- package/libs/instance-factories/services/templates/prisma/controller-generator.ts +27 -17
- package/libs/instance-factories/shared/path-resolver.ts +8 -2
- 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/tools/templates/vscode/vscode-extension-generator.js.bak +0 -244
- 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/react-app.yaml +0 -186
- 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,210 +0,0 @@
|
|
|
1
|
-
import { ATOMIC_COMPONENTS_REGISTRY } from "./atomic-components-registry.js";
|
|
2
|
-
function validatePattern(pattern) {
|
|
3
|
-
const errors = [];
|
|
4
|
-
const warnings = [];
|
|
5
|
-
if (!pattern.id || pattern.id.trim() === "") {
|
|
6
|
-
errors.push({
|
|
7
|
-
field: "id",
|
|
8
|
-
message: "Pattern ID is required",
|
|
9
|
-
severity: "error"
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
if (!pattern.name || pattern.name.trim() === "") {
|
|
13
|
-
errors.push({
|
|
14
|
-
field: "name",
|
|
15
|
-
message: "Pattern name is required",
|
|
16
|
-
severity: "error"
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
if (!pattern.version || !isValidVersion(pattern.version)) {
|
|
20
|
-
errors.push({
|
|
21
|
-
field: "version",
|
|
22
|
-
message: "Pattern version must be in semver format (e.g., 1.0.0)",
|
|
23
|
-
severity: "error"
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
if (!pattern.description || pattern.description.trim() === "") {
|
|
27
|
-
warnings.push({
|
|
28
|
-
field: "description",
|
|
29
|
-
message: "Pattern description is recommended for clarity"
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
const validCategories = ["data-entry", "data-display", "dashboard", "navigation", "workflow"];
|
|
33
|
-
if (!validCategories.includes(pattern.category)) {
|
|
34
|
-
errors.push({
|
|
35
|
-
field: "category",
|
|
36
|
-
message: `Category must be one of: ${validCategories.join(", ")}`,
|
|
37
|
-
severity: "error"
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
if (!pattern.requiredAtomicComponents || pattern.requiredAtomicComponents.length === 0) {
|
|
41
|
-
errors.push({
|
|
42
|
-
field: "requiredAtomicComponents",
|
|
43
|
-
message: "At least one required atomic component must be specified",
|
|
44
|
-
severity: "error"
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
for (const component of pattern.requiredAtomicComponents) {
|
|
48
|
-
if (!ATOMIC_COMPONENTS_REGISTRY[component]) {
|
|
49
|
-
errors.push({
|
|
50
|
-
field: "requiredAtomicComponents",
|
|
51
|
-
message: `Required component '${component}' not found in ATOMIC_COMPONENTS_REGISTRY`,
|
|
52
|
-
severity: "error"
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (pattern.optionalAtomicComponents) {
|
|
58
|
-
for (const component of pattern.optionalAtomicComponents) {
|
|
59
|
-
if (!ATOMIC_COMPONENTS_REGISTRY[component]) {
|
|
60
|
-
warnings.push({
|
|
61
|
-
field: "optionalAtomicComponents",
|
|
62
|
-
message: `Optional component '${component}' not found in ATOMIC_COMPONENTS_REGISTRY`
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (!pattern.layoutStrategy) {
|
|
68
|
-
errors.push({
|
|
69
|
-
field: "layoutStrategy",
|
|
70
|
-
message: "Layout strategy is required",
|
|
71
|
-
severity: "error"
|
|
72
|
-
});
|
|
73
|
-
} else {
|
|
74
|
-
const validLayoutTypes = ["single-column", "two-column", "grid", "flex", "masonry", "custom"];
|
|
75
|
-
if (!validLayoutTypes.includes(pattern.layoutStrategy.type)) {
|
|
76
|
-
errors.push({
|
|
77
|
-
field: "layoutStrategy.type",
|
|
78
|
-
message: `Layout type must be one of: ${validLayoutTypes.join(", ")}`,
|
|
79
|
-
severity: "error"
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (!pattern.dataBindings) {
|
|
84
|
-
errors.push({
|
|
85
|
-
field: "dataBindings",
|
|
86
|
-
message: "Data bindings are required",
|
|
87
|
-
severity: "error"
|
|
88
|
-
});
|
|
89
|
-
} else {
|
|
90
|
-
const validSources = ["model", "controller", "service", "store", "computed"];
|
|
91
|
-
if (!validSources.includes(pattern.dataBindings.source)) {
|
|
92
|
-
errors.push({
|
|
93
|
-
field: "dataBindings.source",
|
|
94
|
-
message: `Data source must be one of: ${validSources.join(", ")}`,
|
|
95
|
-
severity: "error"
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
if (!pattern.dataBindings.operations || pattern.dataBindings.operations.length === 0) {
|
|
99
|
-
errors.push({
|
|
100
|
-
field: "dataBindings.operations",
|
|
101
|
-
message: "At least one data operation must be specified",
|
|
102
|
-
severity: "error"
|
|
103
|
-
});
|
|
104
|
-
} else {
|
|
105
|
-
for (const op of pattern.dataBindings.operations) {
|
|
106
|
-
const validOps = ["create", "update", "retrieve", "retrieve_many", "validate", "evolve", "delete"];
|
|
107
|
-
if (!validOps.includes(op.operation)) {
|
|
108
|
-
errors.push({
|
|
109
|
-
field: "dataBindings.operations",
|
|
110
|
-
message: `Operation '${op.operation}' must be one of: ${validOps.join(", ")}`,
|
|
111
|
-
severity: "error"
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
if (!pattern.supportedOperations || pattern.supportedOperations.length === 0) {
|
|
118
|
-
errors.push({
|
|
119
|
-
field: "supportedOperations",
|
|
120
|
-
message: "At least one supported operation must be specified",
|
|
121
|
-
severity: "error"
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
if (pattern.eventHandlers) {
|
|
125
|
-
for (const handler of pattern.eventHandlers) {
|
|
126
|
-
if (!handler.event) {
|
|
127
|
-
errors.push({
|
|
128
|
-
field: "eventHandlers",
|
|
129
|
-
message: "Event handler must specify an event name",
|
|
130
|
-
severity: "error"
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
if (!handler.operation && !handler.handler) {
|
|
134
|
-
errors.push({
|
|
135
|
-
field: "eventHandlers",
|
|
136
|
-
message: `Event handler for '${handler.event}' must specify either operation or handler`,
|
|
137
|
-
severity: "error"
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (pattern.dataBindings?.relationships) {
|
|
143
|
-
for (const rel of pattern.dataBindings.relationships) {
|
|
144
|
-
const validRelTypes = ["belongsTo", "hasMany", "hasOne", "manyToMany"];
|
|
145
|
-
if (!validRelTypes.includes(rel.type)) {
|
|
146
|
-
errors.push({
|
|
147
|
-
field: "dataBindings.relationships",
|
|
148
|
-
message: `Relationship type '${rel.type}' must be one of: ${validRelTypes.join(", ")}`,
|
|
149
|
-
severity: "error"
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
if (!rel.display?.labelField) {
|
|
153
|
-
warnings.push({
|
|
154
|
-
field: "dataBindings.relationships",
|
|
155
|
-
message: `Relationship '${rel.name}' should specify a labelField for display`
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
if (pattern.extends) {
|
|
161
|
-
warnings.push({
|
|
162
|
-
field: "extends",
|
|
163
|
-
message: `Pattern extends '${pattern.extends}' - ensure parent pattern exists`
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
if (pattern.customization) {
|
|
167
|
-
if (pattern.customization.requiredOverrides && pattern.customization.requiredOverrides.length > 0) {
|
|
168
|
-
const validFields = ["layoutStrategy", "sections", "operations", "relationships"];
|
|
169
|
-
for (const override of pattern.customization.requiredOverrides) {
|
|
170
|
-
if (!validFields.includes(override)) {
|
|
171
|
-
warnings.push({
|
|
172
|
-
field: "customization.requiredOverrides",
|
|
173
|
-
message: `Override field '${override}' may not be a valid customization point`
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return {
|
|
180
|
-
valid: errors.length === 0,
|
|
181
|
-
errors,
|
|
182
|
-
warnings
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function isValidVersion(version) {
|
|
186
|
-
const semverRegex = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/;
|
|
187
|
-
return semverRegex.test(version);
|
|
188
|
-
}
|
|
189
|
-
function validatePatternRegistry(registry) {
|
|
190
|
-
const results = {};
|
|
191
|
-
for (const [id, pattern] of Object.entries(registry)) {
|
|
192
|
-
results[id] = validatePattern(pattern);
|
|
193
|
-
}
|
|
194
|
-
return results;
|
|
195
|
-
}
|
|
196
|
-
function getValidationSummary(results) {
|
|
197
|
-
const total = Object.keys(results).length;
|
|
198
|
-
const valid = Object.values(results).filter((r) => r.valid).length;
|
|
199
|
-
const invalid = total - valid;
|
|
200
|
-
const warnings = Object.values(results).reduce(
|
|
201
|
-
(sum, r) => sum + r.warnings.length,
|
|
202
|
-
0
|
|
203
|
-
);
|
|
204
|
-
return { total, valid, invalid, warnings };
|
|
205
|
-
}
|
|
206
|
-
export {
|
|
207
|
-
getValidationSummary,
|
|
208
|
-
validatePattern,
|
|
209
|
-
validatePatternRegistry
|
|
210
|
-
};
|
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
const FRAMEWORK_TARGETS = {
|
|
2
|
-
react: ["shadcn", "mui", "antd"],
|
|
3
|
-
vue: ["vuetify", "elementPlus", "primeVue"],
|
|
4
|
-
svelte: ["carbon", "svelteui"],
|
|
5
|
-
angular: ["angularMaterial", "primeNg"],
|
|
6
|
-
runtime: ["runtime"]
|
|
7
|
-
};
|
|
8
|
-
const VARIANT_MAPPING = {
|
|
9
|
-
primary: {
|
|
10
|
-
shadcn: "default",
|
|
11
|
-
mui: "contained",
|
|
12
|
-
antd: "primary",
|
|
13
|
-
vuetify: "primary",
|
|
14
|
-
elementPlus: "primary",
|
|
15
|
-
primeVue: "primary",
|
|
16
|
-
carbon: "primary",
|
|
17
|
-
svelteui: "primary",
|
|
18
|
-
angularMaterial: "primary",
|
|
19
|
-
primeNg: "primary",
|
|
20
|
-
runtime: "primary",
|
|
21
|
-
semantic: "primary-action"
|
|
22
|
-
},
|
|
23
|
-
secondary: {
|
|
24
|
-
shadcn: "secondary",
|
|
25
|
-
mui: "outlined",
|
|
26
|
-
antd: "default",
|
|
27
|
-
vuetify: "secondary",
|
|
28
|
-
elementPlus: "default",
|
|
29
|
-
primeVue: "secondary",
|
|
30
|
-
carbon: "secondary",
|
|
31
|
-
svelteui: "secondary",
|
|
32
|
-
angularMaterial: "accent",
|
|
33
|
-
primeNg: "secondary",
|
|
34
|
-
runtime: "secondary",
|
|
35
|
-
semantic: "secondary-action"
|
|
36
|
-
},
|
|
37
|
-
destructive: {
|
|
38
|
-
shadcn: "destructive",
|
|
39
|
-
mui: "error",
|
|
40
|
-
antd: "danger",
|
|
41
|
-
vuetify: "error",
|
|
42
|
-
elementPlus: "danger",
|
|
43
|
-
primeVue: "danger",
|
|
44
|
-
carbon: "danger",
|
|
45
|
-
svelteui: "error",
|
|
46
|
-
angularMaterial: "warn",
|
|
47
|
-
primeNg: "danger",
|
|
48
|
-
runtime: "destructive",
|
|
49
|
-
semantic: "destructive-action"
|
|
50
|
-
},
|
|
51
|
-
ghost: {
|
|
52
|
-
shadcn: "ghost",
|
|
53
|
-
mui: "text",
|
|
54
|
-
antd: "link",
|
|
55
|
-
vuetify: "text",
|
|
56
|
-
elementPlus: "text",
|
|
57
|
-
primeVue: "text",
|
|
58
|
-
carbon: "ghost",
|
|
59
|
-
svelteui: "ghost",
|
|
60
|
-
angularMaterial: "basic",
|
|
61
|
-
primeNg: "text",
|
|
62
|
-
runtime: "ghost",
|
|
63
|
-
semantic: "minimal-action"
|
|
64
|
-
},
|
|
65
|
-
outline: {
|
|
66
|
-
shadcn: "outline",
|
|
67
|
-
mui: "outlined",
|
|
68
|
-
antd: "default",
|
|
69
|
-
vuetify: "outlined",
|
|
70
|
-
elementPlus: "plain",
|
|
71
|
-
primeVue: "outlined",
|
|
72
|
-
carbon: "tertiary",
|
|
73
|
-
svelteui: "outline",
|
|
74
|
-
angularMaterial: "stroked",
|
|
75
|
-
primeNg: "outlined",
|
|
76
|
-
runtime: "outline",
|
|
77
|
-
semantic: "outlined-action"
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
const SIZE_MAPPING = {
|
|
81
|
-
small: {
|
|
82
|
-
shadcn: "sm",
|
|
83
|
-
mui: "small",
|
|
84
|
-
antd: "small",
|
|
85
|
-
vuetify: "small",
|
|
86
|
-
elementPlus: "small",
|
|
87
|
-
primeVue: "small",
|
|
88
|
-
carbon: "sm",
|
|
89
|
-
svelteui: "sm",
|
|
90
|
-
angularMaterial: "small",
|
|
91
|
-
primeNg: "small",
|
|
92
|
-
runtime: "small",
|
|
93
|
-
semantic: "compact"
|
|
94
|
-
},
|
|
95
|
-
medium: {
|
|
96
|
-
shadcn: "default",
|
|
97
|
-
mui: "medium",
|
|
98
|
-
antd: "middle",
|
|
99
|
-
vuetify: "default",
|
|
100
|
-
elementPlus: "default",
|
|
101
|
-
primeVue: "default",
|
|
102
|
-
carbon: "md",
|
|
103
|
-
svelteui: "md",
|
|
104
|
-
angularMaterial: "medium",
|
|
105
|
-
primeNg: "medium",
|
|
106
|
-
runtime: "medium",
|
|
107
|
-
semantic: "standard"
|
|
108
|
-
},
|
|
109
|
-
large: {
|
|
110
|
-
shadcn: "lg",
|
|
111
|
-
mui: "large",
|
|
112
|
-
antd: "large",
|
|
113
|
-
vuetify: "large",
|
|
114
|
-
elementPlus: "large",
|
|
115
|
-
primeVue: "large",
|
|
116
|
-
carbon: "lg",
|
|
117
|
-
svelteui: "lg",
|
|
118
|
-
angularMaterial: "large",
|
|
119
|
-
primeNg: "large",
|
|
120
|
-
runtime: "large",
|
|
121
|
-
semantic: "spacious"
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
const COLOR_MAPPING = {
|
|
125
|
-
primary: {
|
|
126
|
-
shadcn: "primary",
|
|
127
|
-
mui: "primary",
|
|
128
|
-
antd: "primary",
|
|
129
|
-
vuetify: "primary",
|
|
130
|
-
elementPlus: "primary",
|
|
131
|
-
primeVue: "primary",
|
|
132
|
-
carbon: "blue",
|
|
133
|
-
svelteui: "primary",
|
|
134
|
-
angularMaterial: "primary",
|
|
135
|
-
primeNg: "primary",
|
|
136
|
-
runtime: "primary",
|
|
137
|
-
semantic: "primary-color"
|
|
138
|
-
},
|
|
139
|
-
success: {
|
|
140
|
-
shadcn: "success",
|
|
141
|
-
mui: "success",
|
|
142
|
-
antd: "success",
|
|
143
|
-
vuetify: "success",
|
|
144
|
-
elementPlus: "success",
|
|
145
|
-
primeVue: "success",
|
|
146
|
-
carbon: "green",
|
|
147
|
-
svelteui: "success",
|
|
148
|
-
angularMaterial: "success",
|
|
149
|
-
primeNg: "success",
|
|
150
|
-
runtime: "success",
|
|
151
|
-
semantic: "positive-feedback"
|
|
152
|
-
},
|
|
153
|
-
warning: {
|
|
154
|
-
shadcn: "warning",
|
|
155
|
-
mui: "warning",
|
|
156
|
-
antd: "warning",
|
|
157
|
-
vuetify: "warning",
|
|
158
|
-
elementPlus: "warning",
|
|
159
|
-
primeVue: "warning",
|
|
160
|
-
carbon: "yellow",
|
|
161
|
-
svelteui: "warning",
|
|
162
|
-
angularMaterial: "warn",
|
|
163
|
-
primeNg: "warning",
|
|
164
|
-
runtime: "warning",
|
|
165
|
-
semantic: "caution-feedback"
|
|
166
|
-
},
|
|
167
|
-
error: {
|
|
168
|
-
shadcn: "destructive",
|
|
169
|
-
mui: "error",
|
|
170
|
-
antd: "error",
|
|
171
|
-
vuetify: "error",
|
|
172
|
-
elementPlus: "error",
|
|
173
|
-
primeVue: "danger",
|
|
174
|
-
carbon: "red",
|
|
175
|
-
svelteui: "error",
|
|
176
|
-
angularMaterial: "warn",
|
|
177
|
-
primeNg: "danger",
|
|
178
|
-
runtime: "error",
|
|
179
|
-
semantic: "negative-feedback"
|
|
180
|
-
},
|
|
181
|
-
info: {
|
|
182
|
-
shadcn: "default",
|
|
183
|
-
mui: "info",
|
|
184
|
-
antd: "info",
|
|
185
|
-
vuetify: "info",
|
|
186
|
-
elementPlus: "info",
|
|
187
|
-
primeVue: "info",
|
|
188
|
-
carbon: "cyan",
|
|
189
|
-
svelteui: "info",
|
|
190
|
-
angularMaterial: "primary",
|
|
191
|
-
primeNg: "info",
|
|
192
|
-
runtime: "info",
|
|
193
|
-
semantic: "informational-feedback"
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
const POSITION_MAPPING = {
|
|
197
|
-
top: {
|
|
198
|
-
shadcn: "top",
|
|
199
|
-
mui: "top",
|
|
200
|
-
antd: "top",
|
|
201
|
-
vuetify: "top",
|
|
202
|
-
elementPlus: "top",
|
|
203
|
-
primeVue: "top",
|
|
204
|
-
carbon: "top",
|
|
205
|
-
svelteui: "top",
|
|
206
|
-
angularMaterial: "above",
|
|
207
|
-
primeNg: "top",
|
|
208
|
-
runtime: "top",
|
|
209
|
-
semantic: "top-position"
|
|
210
|
-
},
|
|
211
|
-
bottom: {
|
|
212
|
-
shadcn: "bottom",
|
|
213
|
-
mui: "bottom",
|
|
214
|
-
antd: "bottom",
|
|
215
|
-
vuetify: "bottom",
|
|
216
|
-
elementPlus: "bottom",
|
|
217
|
-
primeVue: "bottom",
|
|
218
|
-
carbon: "bottom",
|
|
219
|
-
svelteui: "bottom",
|
|
220
|
-
angularMaterial: "below",
|
|
221
|
-
primeNg: "bottom",
|
|
222
|
-
runtime: "bottom",
|
|
223
|
-
semantic: "bottom-position"
|
|
224
|
-
},
|
|
225
|
-
left: {
|
|
226
|
-
shadcn: "left",
|
|
227
|
-
mui: "left",
|
|
228
|
-
antd: "left",
|
|
229
|
-
vuetify: "left",
|
|
230
|
-
elementPlus: "left",
|
|
231
|
-
primeVue: "left",
|
|
232
|
-
carbon: "left",
|
|
233
|
-
svelteui: "left",
|
|
234
|
-
angularMaterial: "before",
|
|
235
|
-
primeNg: "left",
|
|
236
|
-
runtime: "left",
|
|
237
|
-
semantic: "left-position"
|
|
238
|
-
},
|
|
239
|
-
right: {
|
|
240
|
-
shadcn: "right",
|
|
241
|
-
mui: "right",
|
|
242
|
-
antd: "right",
|
|
243
|
-
vuetify: "right",
|
|
244
|
-
elementPlus: "right",
|
|
245
|
-
primeVue: "right",
|
|
246
|
-
carbon: "right",
|
|
247
|
-
svelteui: "right",
|
|
248
|
-
angularMaterial: "after",
|
|
249
|
-
primeNg: "right",
|
|
250
|
-
runtime: "right",
|
|
251
|
-
semantic: "right-position"
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
const ORIENTATION_MAPPING = {
|
|
255
|
-
horizontal: {
|
|
256
|
-
shadcn: "horizontal",
|
|
257
|
-
mui: "horizontal",
|
|
258
|
-
antd: "horizontal",
|
|
259
|
-
vuetify: "horizontal",
|
|
260
|
-
elementPlus: "horizontal",
|
|
261
|
-
primeVue: "horizontal",
|
|
262
|
-
carbon: "horizontal",
|
|
263
|
-
svelteui: "horizontal",
|
|
264
|
-
angularMaterial: "horizontal",
|
|
265
|
-
primeNg: "horizontal",
|
|
266
|
-
runtime: "horizontal",
|
|
267
|
-
semantic: "horizontal-layout"
|
|
268
|
-
},
|
|
269
|
-
vertical: {
|
|
270
|
-
shadcn: "vertical",
|
|
271
|
-
mui: "vertical",
|
|
272
|
-
antd: "vertical",
|
|
273
|
-
vuetify: "vertical",
|
|
274
|
-
elementPlus: "vertical",
|
|
275
|
-
primeVue: "vertical",
|
|
276
|
-
carbon: "vertical",
|
|
277
|
-
svelteui: "vertical",
|
|
278
|
-
angularMaterial: "vertical",
|
|
279
|
-
primeNg: "vertical",
|
|
280
|
-
runtime: "vertical",
|
|
281
|
-
semantic: "vertical-layout"
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
const COMMON_PROPERTY_MAPPINGS = {
|
|
285
|
-
variant: VARIANT_MAPPING,
|
|
286
|
-
size: SIZE_MAPPING,
|
|
287
|
-
color: COLOR_MAPPING,
|
|
288
|
-
position: POSITION_MAPPING,
|
|
289
|
-
orientation: ORIENTATION_MAPPING
|
|
290
|
-
};
|
|
291
|
-
const COMPONENT_SPECIFIC_MAPPINGS = {
|
|
292
|
-
table: {
|
|
293
|
-
size: {
|
|
294
|
-
small: {
|
|
295
|
-
shadcn: "sm",
|
|
296
|
-
mui: "small",
|
|
297
|
-
antd: "small",
|
|
298
|
-
vuetify: "small",
|
|
299
|
-
elementPlus: "small",
|
|
300
|
-
primeVue: "small",
|
|
301
|
-
carbon: "sm",
|
|
302
|
-
svelteui: "compact",
|
|
303
|
-
angularMaterial: "small",
|
|
304
|
-
primeNg: "small",
|
|
305
|
-
runtime: "small",
|
|
306
|
-
semantic: "compact-table"
|
|
307
|
-
},
|
|
308
|
-
medium: {
|
|
309
|
-
shadcn: "default",
|
|
310
|
-
mui: "medium",
|
|
311
|
-
antd: "middle",
|
|
312
|
-
vuetify: "default",
|
|
313
|
-
elementPlus: "default",
|
|
314
|
-
primeVue: "default",
|
|
315
|
-
carbon: "md",
|
|
316
|
-
svelteui: "default",
|
|
317
|
-
angularMaterial: "medium",
|
|
318
|
-
primeNg: "medium",
|
|
319
|
-
runtime: "medium",
|
|
320
|
-
semantic: "standard-table"
|
|
321
|
-
},
|
|
322
|
-
large: {
|
|
323
|
-
shadcn: "lg",
|
|
324
|
-
mui: "large",
|
|
325
|
-
antd: "large",
|
|
326
|
-
vuetify: "large",
|
|
327
|
-
elementPlus: "large",
|
|
328
|
-
primeVue: "large",
|
|
329
|
-
carbon: "lg",
|
|
330
|
-
svelteui: "relaxed",
|
|
331
|
-
angularMaterial: "large",
|
|
332
|
-
primeNg: "large",
|
|
333
|
-
runtime: "large",
|
|
334
|
-
semantic: "spacious-table"
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
input: {
|
|
339
|
-
variant: {
|
|
340
|
-
// Inputs use different variant semantics
|
|
341
|
-
filled: {
|
|
342
|
-
shadcn: "default",
|
|
343
|
-
mui: "filled",
|
|
344
|
-
antd: "filled",
|
|
345
|
-
vuetify: "filled",
|
|
346
|
-
elementPlus: "default",
|
|
347
|
-
primeVue: "filled",
|
|
348
|
-
carbon: "default",
|
|
349
|
-
svelteui: "filled",
|
|
350
|
-
angularMaterial: "fill",
|
|
351
|
-
primeNg: "filled",
|
|
352
|
-
runtime: "filled",
|
|
353
|
-
semantic: "filled-input"
|
|
354
|
-
},
|
|
355
|
-
outlined: {
|
|
356
|
-
shadcn: "outline",
|
|
357
|
-
mui: "outlined",
|
|
358
|
-
antd: "outlined",
|
|
359
|
-
vuetify: "outlined",
|
|
360
|
-
elementPlus: "default",
|
|
361
|
-
primeVue: "outlined",
|
|
362
|
-
carbon: "outline",
|
|
363
|
-
svelteui: "outlined",
|
|
364
|
-
angularMaterial: "outline",
|
|
365
|
-
primeNg: "outlined",
|
|
366
|
-
runtime: "outlined",
|
|
367
|
-
semantic: "outlined-input"
|
|
368
|
-
},
|
|
369
|
-
standard: {
|
|
370
|
-
shadcn: "default",
|
|
371
|
-
mui: "standard",
|
|
372
|
-
antd: "borderless",
|
|
373
|
-
vuetify: "underlined",
|
|
374
|
-
elementPlus: "default",
|
|
375
|
-
primeVue: "standard",
|
|
376
|
-
carbon: "default",
|
|
377
|
-
svelteui: "standard",
|
|
378
|
-
angularMaterial: "standard",
|
|
379
|
-
primeNg: "standard",
|
|
380
|
-
runtime: "standard",
|
|
381
|
-
semantic: "standard-input"
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
badge: {
|
|
386
|
-
variant: {
|
|
387
|
-
// Badges use different variant semantics
|
|
388
|
-
dot: {
|
|
389
|
-
shadcn: "default",
|
|
390
|
-
mui: "dot",
|
|
391
|
-
antd: "default",
|
|
392
|
-
vuetify: "dot",
|
|
393
|
-
elementPlus: "default",
|
|
394
|
-
primeVue: "default",
|
|
395
|
-
carbon: "default",
|
|
396
|
-
svelteui: "dot",
|
|
397
|
-
angularMaterial: "default",
|
|
398
|
-
primeNg: "default",
|
|
399
|
-
runtime: "dot",
|
|
400
|
-
semantic: "notification-indicator"
|
|
401
|
-
},
|
|
402
|
-
standard: {
|
|
403
|
-
shadcn: "default",
|
|
404
|
-
mui: "standard",
|
|
405
|
-
antd: "default",
|
|
406
|
-
vuetify: "default",
|
|
407
|
-
elementPlus: "default",
|
|
408
|
-
primeVue: "default",
|
|
409
|
-
carbon: "default",
|
|
410
|
-
svelteui: "default",
|
|
411
|
-
angularMaterial: "default",
|
|
412
|
-
primeNg: "default",
|
|
413
|
-
runtime: "standard",
|
|
414
|
-
semantic: "count-indicator"
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
function mapProperty(componentType, propertyName, specverseValue, target) {
|
|
420
|
-
if (typeof specverseValue !== "string") {
|
|
421
|
-
return specverseValue;
|
|
422
|
-
}
|
|
423
|
-
const componentMapping = COMPONENT_SPECIFIC_MAPPINGS[componentType]?.[propertyName]?.[specverseValue];
|
|
424
|
-
if (componentMapping && target in componentMapping) {
|
|
425
|
-
return componentMapping[target];
|
|
426
|
-
}
|
|
427
|
-
const commonMapping = COMMON_PROPERTY_MAPPINGS[propertyName]?.[specverseValue];
|
|
428
|
-
if (commonMapping && target in commonMapping) {
|
|
429
|
-
return commonMapping[target];
|
|
430
|
-
}
|
|
431
|
-
return specverseValue;
|
|
432
|
-
}
|
|
433
|
-
function getSemanticMeaning(propertyName, specverseValue) {
|
|
434
|
-
const commonMapping = COMMON_PROPERTY_MAPPINGS[propertyName]?.[specverseValue];
|
|
435
|
-
if (commonMapping && "semantic" in commonMapping) {
|
|
436
|
-
return commonMapping.semantic;
|
|
437
|
-
}
|
|
438
|
-
return `${propertyName}-${specverseValue}`;
|
|
439
|
-
}
|
|
440
|
-
function mapProperties(componentType, properties, target) {
|
|
441
|
-
const mappedProperties = {};
|
|
442
|
-
for (const [propName, propValue] of Object.entries(properties)) {
|
|
443
|
-
mappedProperties[propName] = mapProperty(
|
|
444
|
-
componentType,
|
|
445
|
-
propName,
|
|
446
|
-
propValue,
|
|
447
|
-
target
|
|
448
|
-
);
|
|
449
|
-
}
|
|
450
|
-
return mappedProperties;
|
|
451
|
-
}
|
|
452
|
-
function getFrameworkTargets(category) {
|
|
453
|
-
return FRAMEWORK_TARGETS[category];
|
|
454
|
-
}
|
|
455
|
-
function hasMapping(componentType, propertyName, specverseValue, target) {
|
|
456
|
-
const componentMapping = COMPONENT_SPECIFIC_MAPPINGS[componentType]?.[propertyName]?.[specverseValue];
|
|
457
|
-
if (componentMapping && target in componentMapping) {
|
|
458
|
-
return true;
|
|
459
|
-
}
|
|
460
|
-
const commonMapping = COMMON_PROPERTY_MAPPINGS[propertyName]?.[specverseValue];
|
|
461
|
-
if (commonMapping && target in commonMapping) {
|
|
462
|
-
return true;
|
|
463
|
-
}
|
|
464
|
-
return false;
|
|
465
|
-
}
|
|
466
|
-
function getAllMappings(componentType, propertyName, specverseValue) {
|
|
467
|
-
const componentMapping = COMPONENT_SPECIFIC_MAPPINGS[componentType]?.[propertyName]?.[specverseValue];
|
|
468
|
-
if (componentMapping) {
|
|
469
|
-
return componentMapping;
|
|
470
|
-
}
|
|
471
|
-
const commonMapping = COMMON_PROPERTY_MAPPINGS[propertyName]?.[specverseValue];
|
|
472
|
-
if (commonMapping) {
|
|
473
|
-
return commonMapping;
|
|
474
|
-
}
|
|
475
|
-
return null;
|
|
476
|
-
}
|
|
477
|
-
export {
|
|
478
|
-
COLOR_MAPPING,
|
|
479
|
-
COMMON_PROPERTY_MAPPINGS,
|
|
480
|
-
COMPONENT_SPECIFIC_MAPPINGS,
|
|
481
|
-
FRAMEWORK_TARGETS,
|
|
482
|
-
ORIENTATION_MAPPING,
|
|
483
|
-
POSITION_MAPPING,
|
|
484
|
-
SIZE_MAPPING,
|
|
485
|
-
VARIANT_MAPPING,
|
|
486
|
-
getAllMappings,
|
|
487
|
-
getFrameworkTargets,
|
|
488
|
-
getSemanticMeaning,
|
|
489
|
-
hasMapping,
|
|
490
|
-
mapProperties,
|
|
491
|
-
mapProperty
|
|
492
|
-
};
|