@specverse/engines 4.1.5 → 4.1.7
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/dist/libs/instance-factories/applications/templates/generic/backend-env-generator.js +22 -0
- package/dist/libs/instance-factories/applications/templates/generic/backend-package-json-generator.js +66 -0
- package/dist/libs/instance-factories/applications/templates/generic/backend-tsconfig-generator.js +54 -0
- package/dist/libs/instance-factories/applications/templates/generic/main-generator.js +290 -0
- package/dist/libs/instance-factories/applications/templates/react/_view-components-source.js +530 -0
- package/dist/libs/instance-factories/applications/templates/react/api-client-generator.js +437 -0
- package/dist/libs/instance-factories/applications/templates/react/api-types-generator.js +146 -0
- package/dist/libs/instance-factories/applications/templates/react/app-tsx-generator.js +73 -0
- package/dist/libs/instance-factories/applications/templates/react/env-example-generator.js +18 -0
- package/dist/libs/instance-factories/applications/templates/react/field-helpers-generator.js +99 -0
- package/dist/libs/instance-factories/applications/templates/react/gitignore-generator.js +35 -0
- package/dist/libs/instance-factories/applications/templates/react/index-css-generator.js +9 -0
- package/dist/libs/instance-factories/applications/templates/react/index-html-generator.js +23 -0
- package/dist/libs/instance-factories/applications/templates/react/main-tsx-generator.js +29 -0
- package/dist/libs/instance-factories/applications/templates/react/package-json-generator.js +49 -0
- package/dist/libs/instance-factories/applications/templates/react/pattern-adapter-generator.js +156 -0
- package/dist/libs/instance-factories/applications/templates/react/react-pattern-adapter.js +935 -0
- package/dist/libs/instance-factories/applications/templates/react/relationship-field-generator.js +143 -0
- package/dist/libs/instance-factories/applications/templates/react/runtime-app-tsx-generator.js +101 -0
- package/dist/libs/instance-factories/applications/templates/react/runtime-package-json-generator.js +50 -0
- package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.js +646 -0
- package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.js +65 -0
- package/dist/libs/instance-factories/applications/templates/react/tsconfig-generator.js +28 -0
- package/dist/libs/instance-factories/applications/templates/react/use-api-hooks-generator.js +132 -0
- package/dist/libs/instance-factories/applications/templates/react/view-dashboard-generator.js +143 -0
- package/dist/libs/instance-factories/applications/templates/react/view-detail-generator.js +143 -0
- package/dist/libs/instance-factories/applications/templates/react/view-form-generator.js +355 -0
- package/dist/libs/instance-factories/applications/templates/react/view-list-generator.js +91 -0
- package/dist/libs/instance-factories/applications/templates/react/view-router-generator.js +79 -0
- package/dist/libs/instance-factories/applications/templates/react/vite-config-generator.js +42 -0
- package/dist/libs/instance-factories/cli/templates/commander/cli-bin-wrapper-generator.js +11 -0
- package/dist/libs/instance-factories/cli/templates/commander/cli-entry-generator.js +111 -0
- package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +928 -0
- package/dist/libs/instance-factories/communication/templates/eventemitter/bus-generator.js +83 -0
- package/dist/libs/instance-factories/communication/templates/eventemitter/publisher-generator.js +91 -0
- package/dist/libs/instance-factories/communication/templates/eventemitter/subscriber-generator.js +86 -0
- package/dist/libs/instance-factories/controllers/templates/fastify/meta-routes-generator.js +93 -0
- package/dist/libs/instance-factories/controllers/templates/fastify/routes-generator.js +280 -0
- package/dist/libs/instance-factories/controllers/templates/fastify/server-generator.js +125 -0
- package/dist/libs/instance-factories/infrastructure/templates/docker-k8s/infrastructure-generator.js +25 -0
- package/dist/libs/instance-factories/orms/templates/prisma/schema-generator.js +371 -0
- package/dist/libs/instance-factories/orms/templates/prisma/services-generator.js +266 -0
- package/dist/libs/instance-factories/scaffolding/templates/generic/env-example-generator.js +51 -0
- package/dist/libs/instance-factories/scaffolding/templates/generic/env-generator.js +61 -0
- package/dist/libs/instance-factories/scaffolding/templates/generic/gitignore-generator.js +59 -0
- package/dist/libs/instance-factories/scaffolding/templates/generic/package-json-generator.js +126 -0
- package/dist/libs/instance-factories/scaffolding/templates/generic/readme-generator.js +159 -0
- package/dist/libs/instance-factories/scaffolding/templates/generic/tsconfig-generator.js +56 -0
- package/dist/libs/instance-factories/scaffolding/templates/generic/tsconfig-react-generator.js +37 -0
- package/dist/libs/instance-factories/sdks/templates/python/sdk-generator.js +29 -0
- package/dist/libs/instance-factories/sdks/templates/typescript/sdk-generator.js +28 -0
- package/dist/libs/instance-factories/services/templates/memory/generate-interpreter.js +14 -0
- package/dist/libs/instance-factories/services/templates/memory/step-conventions-memory.js +415 -0
- package/dist/libs/instance-factories/services/templates/prisma/behavior-generator.js +177 -0
- package/dist/libs/instance-factories/services/templates/prisma/controller-generator.js +413 -0
- package/dist/libs/instance-factories/services/templates/prisma/service-generator.js +243 -0
- package/dist/libs/instance-factories/services/templates/prisma/step-conventions.js +264 -0
- package/dist/libs/instance-factories/services/templates/shared-patterns.js +24 -0
- package/dist/libs/instance-factories/shared/path-resolver.js +59 -0
- package/dist/libs/instance-factories/storage/templates/mongodb/config-generator.js +13 -0
- package/dist/libs/instance-factories/storage/templates/mongodb/docker-generator.js +16 -0
- package/dist/libs/instance-factories/storage/templates/postgresql/config-generator.js +45 -0
- package/dist/libs/instance-factories/storage/templates/postgresql/docker-generator.js +46 -0
- package/dist/libs/instance-factories/storage/templates/redis/config-generator.js +14 -0
- package/dist/libs/instance-factories/storage/templates/redis/docker-generator.js +16 -0
- package/dist/libs/instance-factories/test-generation.js +145 -0
- package/dist/libs/instance-factories/testing/templates/vitest/tests-generator.js +30 -0
- package/dist/libs/instance-factories/tools/templates/mcp/mcp-server-generator.js +149 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/controllers/MCPServerController.js +232 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/events/EventEmitter.js +49 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/index.js +18 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/interfaces/ResourceProvider.js +0 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/models/LibrarySuggestion.js +97 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/models/SpecVerseResource.js +64 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/server/mcp-server.js +182 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/services/CLIProxyService.js +1210 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/services/EmbeddedResourcesAdapter.js +172 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/services/EntityModuleService.js +240 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/services/HybridResourcesProvider.js +147 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/services/LibraryToolsService.js +281 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/services/OrchestratorBridge.js +409 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/services/OrchestratorToolsService.js +414 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/services/PromptToolsService.js +467 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/services/ResourcesProviderService.js +135 -0
- package/dist/libs/instance-factories/tools/templates/mcp/static/src/types/index.js +0 -0
- package/dist/libs/instance-factories/tools/templates/vscode/static/extension.js +965 -0
- package/dist/libs/instance-factories/tools/templates/vscode/vscode-extension-generator.js +238 -0
- package/dist/libs/instance-factories/validation/templates/zod/validation-generator.js +25 -0
- package/dist/libs/instance-factories/views/index.js +48 -0
- package/dist/libs/instance-factories/views/templates/react/adapters/antd-adapter.js +742 -0
- package/dist/libs/instance-factories/views/templates/react/adapters/mui-adapter.js +824 -0
- package/dist/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.js +719 -0
- package/dist/libs/instance-factories/views/templates/react/app-generator.js +45 -0
- package/dist/libs/instance-factories/views/templates/react/components-generator.js +779 -0
- package/dist/libs/instance-factories/views/templates/react/forms-generator.js +285 -0
- package/dist/libs/instance-factories/views/templates/react/frontend-package-json-generator.js +46 -0
- package/dist/libs/instance-factories/views/templates/react/hooks-generator.js +111 -0
- package/dist/libs/instance-factories/views/templates/react/index-css-generator.js +9 -0
- package/dist/libs/instance-factories/views/templates/react/index-html-generator.js +23 -0
- package/dist/libs/instance-factories/views/templates/react/main-tsx-generator.js +21 -0
- package/dist/libs/instance-factories/views/templates/react/react-component-generator.js +299 -0
- package/dist/libs/instance-factories/views/templates/react/router-generator.js +136 -0
- package/dist/libs/instance-factories/views/templates/react/router-generic-generator.js +107 -0
- package/dist/libs/instance-factories/views/templates/react/shared-utils-generator.js +179 -0
- package/dist/libs/instance-factories/views/templates/react/spec-json-generator.js +7 -0
- package/dist/libs/instance-factories/views/templates/react/types-generator.js +56 -0
- package/dist/libs/instance-factories/views/templates/react/views-metadata-generator.js +27 -0
- package/dist/libs/instance-factories/views/templates/react/vite-config-generator.js +29 -0
- package/dist/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js +261 -0
- package/dist/libs/instance-factories/views/templates/shared/adapter-types.js +34 -0
- package/dist/libs/instance-factories/views/templates/shared/atomic-components-registry.js +800 -0
- package/dist/libs/instance-factories/views/templates/shared/base-generator.js +305 -0
- package/dist/libs/instance-factories/views/templates/shared/component-metadata.js +517 -0
- 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 +445 -0
- package/dist/libs/instance-factories/views/templates/shared/index.js +80 -0
- package/dist/libs/instance-factories/views/templates/shared/pattern-validator.js +210 -0
- package/dist/libs/instance-factories/views/templates/shared/property-mapper.js +492 -0
- package/dist/libs/instance-factories/views/templates/shared/syntax-mapper.js +321 -0
- package/dist/realize/index.js +36 -12
- package/dist/realize/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
const FORM_VIEW_PATTERN = {
|
|
2
|
+
// Identity
|
|
3
|
+
id: "form-view",
|
|
4
|
+
name: "FormView",
|
|
5
|
+
version: "1.0.0",
|
|
6
|
+
description: "Data entry form for creating or updating entities with validation and field rendering",
|
|
7
|
+
// Metadata
|
|
8
|
+
category: "data-entry",
|
|
9
|
+
tags: ["form", "crud", "data-entry", "validation", "create", "update"],
|
|
10
|
+
// Composition
|
|
11
|
+
requiredAtomicComponents: [
|
|
12
|
+
"form",
|
|
13
|
+
"input",
|
|
14
|
+
"button"
|
|
15
|
+
],
|
|
16
|
+
optionalAtomicComponents: [
|
|
17
|
+
"select",
|
|
18
|
+
"textarea",
|
|
19
|
+
"checkbox",
|
|
20
|
+
"radio",
|
|
21
|
+
"label",
|
|
22
|
+
"error-message",
|
|
23
|
+
"fieldset",
|
|
24
|
+
"legend"
|
|
25
|
+
],
|
|
26
|
+
// Layout
|
|
27
|
+
layoutStrategy: {
|
|
28
|
+
type: "single-column",
|
|
29
|
+
responsive: true,
|
|
30
|
+
sections: [
|
|
31
|
+
{
|
|
32
|
+
id: "fields",
|
|
33
|
+
title: "Form Fields",
|
|
34
|
+
layout: {
|
|
35
|
+
type: "single-column",
|
|
36
|
+
gap: "medium"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "actions",
|
|
41
|
+
title: "Actions",
|
|
42
|
+
layout: {
|
|
43
|
+
type: "flex",
|
|
44
|
+
gap: "small"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
// Data Bindings
|
|
50
|
+
dataBindings: {
|
|
51
|
+
source: "controller",
|
|
52
|
+
operations: [
|
|
53
|
+
{
|
|
54
|
+
operation: "create",
|
|
55
|
+
returns: "entity",
|
|
56
|
+
optimistic: false,
|
|
57
|
+
cache: { enabled: false }
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
operation: "update",
|
|
61
|
+
params: ["id"],
|
|
62
|
+
returns: "entity",
|
|
63
|
+
optimistic: true,
|
|
64
|
+
cache: { enabled: false }
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
operation: "validate",
|
|
68
|
+
returns: "validation-result",
|
|
69
|
+
optimistic: false,
|
|
70
|
+
cache: { enabled: false }
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
relationships: []
|
|
74
|
+
},
|
|
75
|
+
// Behavior
|
|
76
|
+
supportedOperations: ["create", "update", "validate"],
|
|
77
|
+
eventHandlers: [
|
|
78
|
+
{
|
|
79
|
+
event: "submit",
|
|
80
|
+
operation: "create",
|
|
81
|
+
validate: true
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
event: "submit",
|
|
85
|
+
operation: "update",
|
|
86
|
+
validate: true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
event: "blur",
|
|
90
|
+
operation: "validate",
|
|
91
|
+
validate: false
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
// State Management
|
|
95
|
+
state: {
|
|
96
|
+
fields: ["formData", "errors", "touched", "isSubmitting"],
|
|
97
|
+
persistence: "none"
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const LIST_VIEW_PATTERN = {
|
|
101
|
+
// Identity
|
|
102
|
+
id: "list-view",
|
|
103
|
+
name: "ListView",
|
|
104
|
+
version: "1.0.0",
|
|
105
|
+
description: "Data display for collections with filtering, sorting, and pagination support",
|
|
106
|
+
// Metadata
|
|
107
|
+
category: "data-display",
|
|
108
|
+
tags: ["list", "table", "collection", "data-display", "pagination", "filtering"],
|
|
109
|
+
// Composition
|
|
110
|
+
requiredAtomicComponents: [
|
|
111
|
+
"table",
|
|
112
|
+
"list"
|
|
113
|
+
],
|
|
114
|
+
optionalAtomicComponents: [
|
|
115
|
+
"card",
|
|
116
|
+
"badge",
|
|
117
|
+
"button",
|
|
118
|
+
"input",
|
|
119
|
+
"select",
|
|
120
|
+
"pagination",
|
|
121
|
+
"search",
|
|
122
|
+
"filter"
|
|
123
|
+
],
|
|
124
|
+
// Layout
|
|
125
|
+
layoutStrategy: {
|
|
126
|
+
type: "flex",
|
|
127
|
+
responsive: true,
|
|
128
|
+
direction: "column",
|
|
129
|
+
sections: [
|
|
130
|
+
{
|
|
131
|
+
id: "toolbar",
|
|
132
|
+
title: "Toolbar",
|
|
133
|
+
fields: ["search", "filters", "actions"],
|
|
134
|
+
layout: {
|
|
135
|
+
type: "flex",
|
|
136
|
+
gap: "medium"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: "content",
|
|
141
|
+
title: "Content",
|
|
142
|
+
layout: {
|
|
143
|
+
type: "single-column"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: "pagination",
|
|
148
|
+
title: "Pagination",
|
|
149
|
+
layout: {
|
|
150
|
+
type: "flex",
|
|
151
|
+
gap: "small"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
// Data Bindings
|
|
157
|
+
dataBindings: {
|
|
158
|
+
source: "controller",
|
|
159
|
+
operations: [
|
|
160
|
+
{
|
|
161
|
+
operation: "retrieve_many",
|
|
162
|
+
returns: "entity-array",
|
|
163
|
+
optimistic: false,
|
|
164
|
+
cache: {
|
|
165
|
+
enabled: true,
|
|
166
|
+
ttl: 300,
|
|
167
|
+
key: "list-{modelName}-{filters}"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
relationships: []
|
|
172
|
+
},
|
|
173
|
+
// Behavior
|
|
174
|
+
supportedOperations: ["retrieve_many"],
|
|
175
|
+
eventHandlers: [
|
|
176
|
+
{
|
|
177
|
+
event: "search",
|
|
178
|
+
operation: "retrieve_many",
|
|
179
|
+
validate: false
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
event: "filter",
|
|
183
|
+
operation: "retrieve_many",
|
|
184
|
+
validate: false
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
event: "sort",
|
|
188
|
+
operation: "retrieve_many",
|
|
189
|
+
validate: false
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
event: "paginate",
|
|
193
|
+
operation: "retrieve_many",
|
|
194
|
+
validate: false
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
// State Management
|
|
198
|
+
state: {
|
|
199
|
+
fields: ["entities", "filters", "sort", "pagination", "loading"],
|
|
200
|
+
persistence: "session"
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const DETAIL_VIEW_PATTERN = {
|
|
204
|
+
// Identity
|
|
205
|
+
id: "detail-view",
|
|
206
|
+
name: "DetailView",
|
|
207
|
+
version: "1.0.0",
|
|
208
|
+
description: "Single entity detail display with edit and delete actions",
|
|
209
|
+
// Metadata
|
|
210
|
+
category: "data-display",
|
|
211
|
+
tags: ["detail", "view", "entity", "display", "read-only"],
|
|
212
|
+
// Composition
|
|
213
|
+
requiredAtomicComponents: [
|
|
214
|
+
"card",
|
|
215
|
+
"container"
|
|
216
|
+
],
|
|
217
|
+
optionalAtomicComponents: [
|
|
218
|
+
"badge",
|
|
219
|
+
"button",
|
|
220
|
+
"tabs",
|
|
221
|
+
"card",
|
|
222
|
+
"list",
|
|
223
|
+
"table"
|
|
224
|
+
],
|
|
225
|
+
// Layout
|
|
226
|
+
layoutStrategy: {
|
|
227
|
+
type: "single-column",
|
|
228
|
+
responsive: true,
|
|
229
|
+
sections: [
|
|
230
|
+
{
|
|
231
|
+
id: "header",
|
|
232
|
+
title: "Header",
|
|
233
|
+
fields: ["title", "status", "actions"],
|
|
234
|
+
layout: {
|
|
235
|
+
type: "flex",
|
|
236
|
+
gap: "medium"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
id: "main",
|
|
241
|
+
title: "Main Content",
|
|
242
|
+
layout: {
|
|
243
|
+
type: "two-column",
|
|
244
|
+
columns: 2,
|
|
245
|
+
gap: "large"
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "relationships",
|
|
250
|
+
title: "Related Data",
|
|
251
|
+
layout: {
|
|
252
|
+
type: "grid",
|
|
253
|
+
columns: 2,
|
|
254
|
+
gap: "medium"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
// Data Bindings
|
|
260
|
+
dataBindings: {
|
|
261
|
+
source: "controller",
|
|
262
|
+
operations: [
|
|
263
|
+
{
|
|
264
|
+
operation: "retrieve",
|
|
265
|
+
params: ["id"],
|
|
266
|
+
returns: "entity",
|
|
267
|
+
optimistic: false,
|
|
268
|
+
cache: {
|
|
269
|
+
enabled: true,
|
|
270
|
+
ttl: 300,
|
|
271
|
+
key: "detail-{modelName}-{id}"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
operation: "update",
|
|
276
|
+
params: ["id"],
|
|
277
|
+
returns: "entity",
|
|
278
|
+
optimistic: true,
|
|
279
|
+
cache: { enabled: false }
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
operation: "delete",
|
|
283
|
+
params: ["id"],
|
|
284
|
+
returns: "void",
|
|
285
|
+
optimistic: false,
|
|
286
|
+
cache: { enabled: false }
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
relationships: []
|
|
290
|
+
},
|
|
291
|
+
// Behavior
|
|
292
|
+
supportedOperations: ["retrieve", "update", "delete"],
|
|
293
|
+
eventHandlers: [
|
|
294
|
+
{
|
|
295
|
+
event: "edit",
|
|
296
|
+
operation: "update",
|
|
297
|
+
validate: true
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
event: "delete",
|
|
301
|
+
operation: "delete",
|
|
302
|
+
validate: false,
|
|
303
|
+
confirm: {
|
|
304
|
+
title: "Confirm Delete",
|
|
305
|
+
message: "Are you sure you want to delete this item?"
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
// State Management
|
|
310
|
+
state: {
|
|
311
|
+
fields: ["entity", "loading", "error", "editMode"],
|
|
312
|
+
persistence: "none"
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
const DASHBOARD_VIEW_PATTERN = {
|
|
316
|
+
// Identity
|
|
317
|
+
id: "dashboard-view",
|
|
318
|
+
name: "DashboardView",
|
|
319
|
+
version: "1.0.0",
|
|
320
|
+
description: "Multi-section dashboard with metrics, charts, and data summaries",
|
|
321
|
+
// Metadata
|
|
322
|
+
category: "dashboard",
|
|
323
|
+
tags: ["dashboard", "overview", "metrics", "analytics", "summary"],
|
|
324
|
+
// Composition
|
|
325
|
+
requiredAtomicComponents: [
|
|
326
|
+
"grid",
|
|
327
|
+
"card"
|
|
328
|
+
],
|
|
329
|
+
optionalAtomicComponents: [
|
|
330
|
+
"chart",
|
|
331
|
+
"metric",
|
|
332
|
+
"table",
|
|
333
|
+
"list",
|
|
334
|
+
"badge",
|
|
335
|
+
"progress",
|
|
336
|
+
"stat"
|
|
337
|
+
],
|
|
338
|
+
// Layout
|
|
339
|
+
layoutStrategy: {
|
|
340
|
+
type: "grid",
|
|
341
|
+
responsive: true,
|
|
342
|
+
columns: 12,
|
|
343
|
+
sections: [
|
|
344
|
+
{
|
|
345
|
+
id: "metrics",
|
|
346
|
+
title: "Key Metrics",
|
|
347
|
+
layout: {
|
|
348
|
+
type: "grid",
|
|
349
|
+
columns: 4,
|
|
350
|
+
gap: "medium"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
id: "charts",
|
|
355
|
+
title: "Charts",
|
|
356
|
+
layout: {
|
|
357
|
+
type: "grid",
|
|
358
|
+
columns: 2,
|
|
359
|
+
gap: "large"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: "recent-activity",
|
|
364
|
+
title: "Recent Activity",
|
|
365
|
+
layout: {
|
|
366
|
+
type: "single-column",
|
|
367
|
+
gap: "small"
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
]
|
|
371
|
+
},
|
|
372
|
+
// Data Bindings
|
|
373
|
+
dataBindings: {
|
|
374
|
+
source: "service",
|
|
375
|
+
operations: [
|
|
376
|
+
{
|
|
377
|
+
operation: "retrieve_many",
|
|
378
|
+
returns: "entity-array",
|
|
379
|
+
optimistic: false,
|
|
380
|
+
cache: {
|
|
381
|
+
enabled: true,
|
|
382
|
+
ttl: 600,
|
|
383
|
+
key: "dashboard-{component}"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
],
|
|
387
|
+
relationships: []
|
|
388
|
+
},
|
|
389
|
+
// Behavior
|
|
390
|
+
supportedOperations: ["retrieve_many"],
|
|
391
|
+
eventHandlers: [
|
|
392
|
+
{
|
|
393
|
+
event: "refresh",
|
|
394
|
+
operation: "retrieve_many",
|
|
395
|
+
validate: false
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
// State Management
|
|
399
|
+
state: {
|
|
400
|
+
fields: ["metrics", "charts", "recentActivity", "loading", "lastUpdate"],
|
|
401
|
+
persistence: "session"
|
|
402
|
+
},
|
|
403
|
+
// Customization
|
|
404
|
+
customization: {
|
|
405
|
+
allowedOverrides: ["layoutStrategy", "sections", "metrics"],
|
|
406
|
+
requiredOverrides: []
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
const COMPOSITE_VIEW_PATTERNS = {
|
|
410
|
+
"form-view": FORM_VIEW_PATTERN,
|
|
411
|
+
"list-view": LIST_VIEW_PATTERN,
|
|
412
|
+
"detail-view": DETAIL_VIEW_PATTERN,
|
|
413
|
+
"dashboard-view": DASHBOARD_VIEW_PATTERN
|
|
414
|
+
};
|
|
415
|
+
function getPattern(id) {
|
|
416
|
+
return COMPOSITE_VIEW_PATTERNS[id];
|
|
417
|
+
}
|
|
418
|
+
function getPatternsByCategory(category) {
|
|
419
|
+
return Object.values(COMPOSITE_VIEW_PATTERNS).filter(
|
|
420
|
+
(pattern) => pattern.category === category
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
function getPatternsByTag(tag) {
|
|
424
|
+
return Object.values(COMPOSITE_VIEW_PATTERNS).filter(
|
|
425
|
+
(pattern) => pattern.tags.includes(tag)
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
function getPatternIds() {
|
|
429
|
+
return Object.keys(COMPOSITE_VIEW_PATTERNS);
|
|
430
|
+
}
|
|
431
|
+
function hasPattern(id) {
|
|
432
|
+
return id in COMPOSITE_VIEW_PATTERNS;
|
|
433
|
+
}
|
|
434
|
+
export {
|
|
435
|
+
COMPOSITE_VIEW_PATTERNS,
|
|
436
|
+
DASHBOARD_VIEW_PATTERN,
|
|
437
|
+
DETAIL_VIEW_PATTERN,
|
|
438
|
+
FORM_VIEW_PATTERN,
|
|
439
|
+
LIST_VIEW_PATTERN,
|
|
440
|
+
getPattern,
|
|
441
|
+
getPatternIds,
|
|
442
|
+
getPatternsByCategory,
|
|
443
|
+
getPatternsByTag,
|
|
444
|
+
hasPattern
|
|
445
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ATOMIC_COMPONENTS_REGISTRY,
|
|
3
|
+
AtomicComponentDefinition
|
|
4
|
+
} from "./atomic-components-registry.js";
|
|
5
|
+
export * from "./component-metadata.js";
|
|
6
|
+
import {
|
|
7
|
+
ComponentAdapter,
|
|
8
|
+
ComponentLibraryAdapter,
|
|
9
|
+
ComponentMapping,
|
|
10
|
+
RenderContext,
|
|
11
|
+
renderProps,
|
|
12
|
+
indent,
|
|
13
|
+
wrapWithChildren
|
|
14
|
+
} from "./adapter-types.js";
|
|
15
|
+
export * from "./property-mapper.js";
|
|
16
|
+
export * from "./syntax-mapper.js";
|
|
17
|
+
import {
|
|
18
|
+
BaseComponentGenerator,
|
|
19
|
+
ViewSpec,
|
|
20
|
+
StateDefinition,
|
|
21
|
+
EventDefinition,
|
|
22
|
+
UIComponent,
|
|
23
|
+
RenderContext as RenderContext2,
|
|
24
|
+
GeneratorConfig,
|
|
25
|
+
extractComponentTypes,
|
|
26
|
+
countComponents,
|
|
27
|
+
validateNestingDepth
|
|
28
|
+
} from "./base-generator.js";
|
|
29
|
+
export * from "./composite-pattern-types.js";
|
|
30
|
+
import {
|
|
31
|
+
COMPOSITE_VIEW_PATTERNS,
|
|
32
|
+
FORM_VIEW_PATTERN,
|
|
33
|
+
LIST_VIEW_PATTERN,
|
|
34
|
+
DETAIL_VIEW_PATTERN,
|
|
35
|
+
DASHBOARD_VIEW_PATTERN,
|
|
36
|
+
getPattern,
|
|
37
|
+
getPatternsByCategory,
|
|
38
|
+
getPatternsByTag,
|
|
39
|
+
getPatternIds,
|
|
40
|
+
hasPattern
|
|
41
|
+
} from "./composite-patterns.js";
|
|
42
|
+
import {
|
|
43
|
+
validatePattern,
|
|
44
|
+
validatePatternRegistry,
|
|
45
|
+
getValidationSummary
|
|
46
|
+
} from "./pattern-validator.js";
|
|
47
|
+
export {
|
|
48
|
+
ATOMIC_COMPONENTS_REGISTRY,
|
|
49
|
+
AtomicComponentDefinition,
|
|
50
|
+
BaseComponentGenerator,
|
|
51
|
+
COMPOSITE_VIEW_PATTERNS,
|
|
52
|
+
ComponentAdapter,
|
|
53
|
+
ComponentLibraryAdapter,
|
|
54
|
+
ComponentMapping,
|
|
55
|
+
DASHBOARD_VIEW_PATTERN,
|
|
56
|
+
DETAIL_VIEW_PATTERN,
|
|
57
|
+
EventDefinition,
|
|
58
|
+
FORM_VIEW_PATTERN,
|
|
59
|
+
GeneratorConfig,
|
|
60
|
+
RenderContext2 as GeneratorRenderContext,
|
|
61
|
+
LIST_VIEW_PATTERN,
|
|
62
|
+
RenderContext,
|
|
63
|
+
StateDefinition,
|
|
64
|
+
UIComponent,
|
|
65
|
+
ViewSpec,
|
|
66
|
+
countComponents,
|
|
67
|
+
extractComponentTypes,
|
|
68
|
+
getPattern,
|
|
69
|
+
getPatternIds,
|
|
70
|
+
getPatternsByCategory,
|
|
71
|
+
getPatternsByTag,
|
|
72
|
+
getValidationSummary,
|
|
73
|
+
hasPattern,
|
|
74
|
+
indent,
|
|
75
|
+
renderProps,
|
|
76
|
+
validateNestingDepth,
|
|
77
|
+
validatePattern,
|
|
78
|
+
validatePatternRegistry,
|
|
79
|
+
wrapWithChildren
|
|
80
|
+
};
|