@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.
Files changed (237) hide show
  1. package/assets/examples/manifests/frontend-only.yaml +3 -6
  2. package/assets/examples/manifests/fullstack-app.yaml +5 -7
  3. package/assets/examples/manifests/fullstack-monorepo.yaml +3 -6
  4. package/dist/inference/comprehensive-engine.d.ts.map +1 -1
  5. package/dist/inference/comprehensive-engine.js +3 -19
  6. package/dist/inference/comprehensive-engine.js.map +1 -1
  7. package/dist/inference/core/rule-engine.d.ts +31 -0
  8. package/dist/inference/core/rule-engine.d.ts.map +1 -1
  9. package/dist/inference/core/rule-engine.js +117 -33
  10. package/dist/inference/core/rule-engine.js.map +1 -1
  11. package/dist/inference/core/rule-file-types.d.ts +0 -2
  12. package/dist/inference/core/rule-file-types.d.ts.map +1 -1
  13. package/dist/inference/core/rule-file-types.js +3 -6
  14. package/dist/inference/core/rule-file-types.js.map +1 -1
  15. package/dist/inference/core/rule-loader.d.ts +5 -15
  16. package/dist/inference/core/rule-loader.d.ts.map +1 -1
  17. package/dist/inference/core/rule-loader.js +43 -132
  18. package/dist/inference/core/rule-loader.js.map +1 -1
  19. package/dist/inference/core/types.d.ts +0 -6
  20. package/dist/inference/core/types.d.ts.map +1 -1
  21. package/dist/inference/core/types.js +0 -4
  22. package/dist/inference/core/types.js.map +1 -1
  23. package/dist/inference/logical/generators/component-type-resolver.d.ts +0 -26
  24. package/dist/inference/logical/generators/component-type-resolver.d.ts.map +1 -1
  25. package/dist/inference/logical/generators/component-type-resolver.js +0 -19
  26. package/dist/inference/logical/generators/component-type-resolver.js.map +1 -1
  27. package/dist/inference/logical/generators/specialist-view-expander.d.ts +1 -17
  28. package/dist/inference/logical/generators/specialist-view-expander.d.ts.map +1 -1
  29. package/dist/inference/logical/generators/specialist-view-expander.js +0 -15
  30. package/dist/inference/logical/generators/specialist-view-expander.js.map +1 -1
  31. package/dist/inference/logical/generators/view-generator.d.ts +4 -14
  32. package/dist/inference/logical/generators/view-generator.d.ts.map +1 -1
  33. package/dist/inference/logical/generators/view-generator.js +6 -26
  34. package/dist/inference/logical/generators/view-generator.js.map +1 -1
  35. package/dist/inference/logical/index.d.ts +2 -2
  36. package/dist/inference/logical/index.d.ts.map +1 -1
  37. package/dist/inference/logical/logical-engine.d.ts.map +1 -1
  38. package/dist/inference/logical/logical-engine.js +17 -80
  39. package/dist/inference/logical/logical-engine.js.map +1 -1
  40. package/dist/inference/quint-transpiler.d.ts +5 -3
  41. package/dist/inference/quint-transpiler.d.ts.map +1 -1
  42. package/dist/inference/quint-transpiler.js +11 -6
  43. package/dist/inference/quint-transpiler.js.map +1 -1
  44. package/dist/libs/instance-factories/applications/templates/generic/main-generator.js +3 -3
  45. package/dist/libs/instance-factories/applications/templates/react/api-client-generator.js +16 -6
  46. package/dist/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.js +110 -0
  47. package/dist/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.js +121 -0
  48. package/dist/libs/instance-factories/applications/templates/react-starter/detail-body-composer.js +78 -0
  49. package/dist/libs/instance-factories/applications/templates/react-starter/form-body-composer.js +190 -0
  50. package/dist/libs/instance-factories/applications/templates/react-starter/helpers-emitter.js +45 -0
  51. package/dist/libs/instance-factories/applications/templates/react-starter/html-to-jsx.js +192 -0
  52. package/dist/libs/instance-factories/applications/templates/react-starter/list-body-composer.js +46 -0
  53. package/dist/libs/instance-factories/applications/templates/react-starter/orchestrator.js +30 -0
  54. package/dist/libs/instance-factories/applications/templates/react-starter/package-json-generator.js +38 -0
  55. package/dist/libs/instance-factories/applications/templates/react-starter/regen-safety.js +89 -0
  56. package/dist/libs/instance-factories/applications/templates/react-starter/view-emitter.js +56 -0
  57. package/dist/libs/instance-factories/applications/templates/react-starter/views-generator.js +66 -0
  58. package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +14 -11
  59. package/dist/libs/instance-factories/controllers/templates/fastify/server-generator.js +11 -3
  60. package/dist/libs/instance-factories/services/templates/prisma/controller-generator.js +27 -17
  61. package/dist/libs/instance-factories/shared/path-resolver.js +1 -1
  62. package/dist/realize/index.d.ts.map +1 -1
  63. package/dist/realize/index.js +15 -22
  64. package/dist/realize/index.js.map +1 -1
  65. package/dist/registry/utils/manifest-adapter.d.ts +8 -1
  66. package/dist/registry/utils/manifest-adapter.d.ts.map +1 -1
  67. package/dist/registry/utils/manifest-adapter.js +8 -1
  68. package/dist/registry/utils/manifest-adapter.js.map +1 -1
  69. package/libs/instance-factories/applications/react-app-starter.yaml +150 -0
  70. package/libs/instance-factories/applications/templates/generic/main-generator.ts +3 -3
  71. package/libs/instance-factories/applications/templates/react/api-client-generator.ts +16 -6
  72. package/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
  73. package/libs/instance-factories/applications/templates/react-starter/__tests__/dashboard-body-composer.test.ts +153 -0
  74. package/libs/instance-factories/applications/templates/react-starter/__tests__/detail-body-composer.test.ts +145 -0
  75. package/libs/instance-factories/applications/templates/react-starter/__tests__/form-body-composer.test.ts +175 -0
  76. package/libs/instance-factories/applications/templates/react-starter/__tests__/helpers-emitter.test.ts +55 -0
  77. package/libs/instance-factories/applications/templates/react-starter/__tests__/html-to-jsx.test.ts +140 -0
  78. package/libs/instance-factories/applications/templates/react-starter/__tests__/list-body-composer.test.ts +146 -0
  79. package/libs/instance-factories/applications/templates/react-starter/__tests__/orchestrator.test.ts +163 -0
  80. package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p2-factory-imports.test.ts +116 -0
  81. package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p3-rendered-output.test.ts +183 -0
  82. package/libs/instance-factories/applications/templates/react-starter/__tests__/regen-safety.test.ts +144 -0
  83. package/libs/instance-factories/applications/templates/react-starter/__tests__/starter-generators.test.ts +114 -0
  84. package/libs/instance-factories/applications/templates/react-starter/__tests__/view-emitter.test.ts +107 -0
  85. package/libs/instance-factories/applications/templates/react-starter/__tests__/views-generator.test.ts +139 -0
  86. package/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.ts +141 -0
  87. package/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.ts +174 -0
  88. package/libs/instance-factories/applications/templates/react-starter/detail-body-composer.ts +135 -0
  89. package/libs/instance-factories/applications/templates/react-starter/form-body-composer.ts +306 -0
  90. package/libs/instance-factories/applications/templates/react-starter/helpers-emitter.ts +60 -0
  91. package/libs/instance-factories/applications/templates/react-starter/html-to-jsx.ts +334 -0
  92. package/libs/instance-factories/applications/templates/react-starter/list-body-composer.ts +120 -0
  93. package/libs/instance-factories/applications/templates/react-starter/orchestrator.ts +80 -0
  94. package/libs/instance-factories/applications/templates/react-starter/package-json-generator.ts +57 -0
  95. package/libs/instance-factories/applications/templates/react-starter/regen-safety.ts +157 -0
  96. package/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +47 -0
  97. package/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +94 -0
  98. package/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +114 -0
  99. package/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +72 -0
  100. package/libs/instance-factories/applications/templates/react-starter/view-emitter.ts +151 -0
  101. package/libs/instance-factories/applications/templates/react-starter/views-generator.ts +137 -0
  102. package/libs/instance-factories/cli/templates/commander/command-generator.ts +14 -11
  103. package/libs/instance-factories/controllers/templates/fastify/server-generator.ts +11 -3
  104. package/libs/instance-factories/services/templates/prisma/controller-generator.ts +27 -17
  105. package/libs/instance-factories/shared/path-resolver.ts +8 -2
  106. package/package.json +3 -3
  107. package/dist/libs/instance-factories/applications/templates/react/_view-components-source.js +0 -530
  108. package/dist/libs/instance-factories/applications/templates/react/app-tsx-generator.js +0 -73
  109. package/dist/libs/instance-factories/applications/templates/react/field-helpers-generator.js +0 -99
  110. package/dist/libs/instance-factories/applications/templates/react/package-json-generator.js +0 -49
  111. package/dist/libs/instance-factories/applications/templates/react/pattern-adapter-generator.js +0 -156
  112. package/dist/libs/instance-factories/applications/templates/react/react-pattern-adapter.js +0 -935
  113. package/dist/libs/instance-factories/applications/templates/react/relationship-field-generator.js +0 -143
  114. package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.js +0 -646
  115. package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.js +0 -65
  116. package/dist/libs/instance-factories/applications/templates/react/view-dashboard-generator.js +0 -143
  117. package/dist/libs/instance-factories/applications/templates/react/view-detail-generator.js +0 -143
  118. package/dist/libs/instance-factories/applications/templates/react/view-form-generator.js +0 -355
  119. package/dist/libs/instance-factories/applications/templates/react/view-list-generator.js +0 -91
  120. package/dist/libs/instance-factories/applications/templates/react/view-router-generator.js +0 -79
  121. package/dist/libs/instance-factories/tools/templates/vscode/vscode-extension-generator.js.bak +0 -244
  122. package/dist/libs/instance-factories/views/index.js +0 -48
  123. package/dist/libs/instance-factories/views/templates/react/adapters/antd-adapter.js +0 -742
  124. package/dist/libs/instance-factories/views/templates/react/adapters/mui-adapter.js +0 -824
  125. package/dist/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.js +0 -719
  126. package/dist/libs/instance-factories/views/templates/react/app-generator.js +0 -45
  127. package/dist/libs/instance-factories/views/templates/react/components-generator.js +0 -820
  128. package/dist/libs/instance-factories/views/templates/react/forms-generator.js +0 -275
  129. package/dist/libs/instance-factories/views/templates/react/frontend-package-json-generator.js +0 -46
  130. package/dist/libs/instance-factories/views/templates/react/hooks-generator.js +0 -81
  131. package/dist/libs/instance-factories/views/templates/react/index-css-generator.js +0 -9
  132. package/dist/libs/instance-factories/views/templates/react/index-html-generator.js +0 -23
  133. package/dist/libs/instance-factories/views/templates/react/main-tsx-generator.js +0 -21
  134. package/dist/libs/instance-factories/views/templates/react/react-component-generator.js +0 -299
  135. package/dist/libs/instance-factories/views/templates/react/router-generator.js +0 -136
  136. package/dist/libs/instance-factories/views/templates/react/router-generic-generator.js +0 -107
  137. package/dist/libs/instance-factories/views/templates/react/shared-utils-generator.js +0 -187
  138. package/dist/libs/instance-factories/views/templates/react/spec-json-generator.js +0 -7
  139. package/dist/libs/instance-factories/views/templates/react/types-generator.js +0 -56
  140. package/dist/libs/instance-factories/views/templates/react/views-metadata-generator.js +0 -27
  141. package/dist/libs/instance-factories/views/templates/react/vite-config-generator.js +0 -29
  142. package/dist/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js +0 -261
  143. package/dist/libs/instance-factories/views/templates/shared/adapter-types.js +0 -34
  144. package/dist/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -800
  145. package/dist/libs/instance-factories/views/templates/shared/base-generator.js +0 -305
  146. package/dist/libs/instance-factories/views/templates/shared/component-metadata.js +0 -517
  147. package/dist/libs/instance-factories/views/templates/shared/composite-pattern-types.js +0 -0
  148. package/dist/libs/instance-factories/views/templates/shared/composite-patterns.js +0 -445
  149. package/dist/libs/instance-factories/views/templates/shared/index.js +0 -80
  150. package/dist/libs/instance-factories/views/templates/shared/pattern-validator.js +0 -210
  151. package/dist/libs/instance-factories/views/templates/shared/property-mapper.js +0 -492
  152. package/dist/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -321
  153. package/dist/realize/index.js.bak +0 -758
  154. package/libs/instance-factories/applications/react-app.yaml +0 -186
  155. package/libs/instance-factories/applications/templates/react/_view-components-source.ts +0 -555
  156. package/libs/instance-factories/applications/templates/react/app-tsx-generator.ts +0 -94
  157. package/libs/instance-factories/applications/templates/react/field-helpers-generator.ts +0 -106
  158. package/libs/instance-factories/applications/templates/react/package-json-generator.ts +0 -57
  159. package/libs/instance-factories/applications/templates/react/pattern-adapter-generator.ts +0 -179
  160. package/libs/instance-factories/applications/templates/react/react-pattern-adapter.tsx +0 -1347
  161. package/libs/instance-factories/applications/templates/react/relationship-field-generator.ts +0 -150
  162. package/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.ts +0 -704
  163. package/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.ts +0 -84
  164. package/libs/instance-factories/applications/templates/react/view-dashboard-generator.ts +0 -150
  165. package/libs/instance-factories/applications/templates/react/view-detail-generator.ts +0 -150
  166. package/libs/instance-factories/applications/templates/react/view-form-generator.ts +0 -362
  167. package/libs/instance-factories/applications/templates/react/view-list-generator.ts +0 -98
  168. package/libs/instance-factories/applications/templates/react/view-router-generator.ts +0 -89
  169. package/libs/instance-factories/views/README.md +0 -62
  170. package/libs/instance-factories/views/index.d.ts +0 -13
  171. package/libs/instance-factories/views/index.d.ts.map +0 -1
  172. package/libs/instance-factories/views/index.js +0 -18
  173. package/libs/instance-factories/views/index.js.map +0 -1
  174. package/libs/instance-factories/views/index.ts +0 -45
  175. package/libs/instance-factories/views/react-components.yaml +0 -129
  176. package/libs/instance-factories/views/templates/ARCHITECTURE.md +0 -198
  177. package/libs/instance-factories/views/templates/react/adapters/antd-adapter.ts +0 -869
  178. package/libs/instance-factories/views/templates/react/adapters/mui-adapter.ts +0 -953
  179. package/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.ts +0 -806
  180. package/libs/instance-factories/views/templates/react/app-generator.ts +0 -55
  181. package/libs/instance-factories/views/templates/react/components-generator.ts +0 -938
  182. package/libs/instance-factories/views/templates/react/forms-generator.ts +0 -325
  183. package/libs/instance-factories/views/templates/react/frontend-package-json-generator.ts +0 -57
  184. package/libs/instance-factories/views/templates/react/hooks-generator.ts +0 -106
  185. package/libs/instance-factories/views/templates/react/index-css-generator.ts +0 -14
  186. package/libs/instance-factories/views/templates/react/index-html-generator.ts +0 -34
  187. package/libs/instance-factories/views/templates/react/main-tsx-generator.ts +0 -29
  188. package/libs/instance-factories/views/templates/react/react-component-generator.d.ts +0 -152
  189. package/libs/instance-factories/views/templates/react/react-component-generator.d.ts.map +0 -1
  190. package/libs/instance-factories/views/templates/react/react-component-generator.js +0 -398
  191. package/libs/instance-factories/views/templates/react/react-component-generator.js.map +0 -1
  192. package/libs/instance-factories/views/templates/react/react-component-generator.ts +0 -533
  193. package/libs/instance-factories/views/templates/react/router-generator.ts +0 -197
  194. package/libs/instance-factories/views/templates/react/router-generic-generator.ts +0 -132
  195. package/libs/instance-factories/views/templates/react/shared-utils-generator.ts +0 -196
  196. package/libs/instance-factories/views/templates/react/spec-json-generator.ts +0 -17
  197. package/libs/instance-factories/views/templates/react/types-generator.ts +0 -76
  198. package/libs/instance-factories/views/templates/react/views-metadata-generator.ts +0 -42
  199. package/libs/instance-factories/views/templates/react/vite-config-generator.ts +0 -38
  200. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.d.ts.map +0 -1
  201. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js.map +0 -1
  202. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.ts +0 -474
  203. package/libs/instance-factories/views/templates/shared/__tests__/composite-patterns.test.ts +0 -242
  204. package/libs/instance-factories/views/templates/shared/adapter-types.d.ts +0 -77
  205. package/libs/instance-factories/views/templates/shared/adapter-types.d.ts.map +0 -1
  206. package/libs/instance-factories/views/templates/shared/adapter-types.js +0 -47
  207. package/libs/instance-factories/views/templates/shared/adapter-types.js.map +0 -1
  208. package/libs/instance-factories/views/templates/shared/adapter-types.ts +0 -142
  209. package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts +0 -63
  210. package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts.map +0 -1
  211. package/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -822
  212. package/libs/instance-factories/views/templates/shared/atomic-components-registry.js.map +0 -1
  213. package/libs/instance-factories/views/templates/shared/atomic-components-registry.ts +0 -908
  214. package/libs/instance-factories/views/templates/shared/base-generator.d.ts +0 -247
  215. package/libs/instance-factories/views/templates/shared/base-generator.d.ts.map +0 -1
  216. package/libs/instance-factories/views/templates/shared/base-generator.js +0 -363
  217. package/libs/instance-factories/views/templates/shared/base-generator.js.map +0 -1
  218. package/libs/instance-factories/views/templates/shared/base-generator.ts +0 -608
  219. package/libs/instance-factories/views/templates/shared/component-metadata.d.ts +0 -254
  220. package/libs/instance-factories/views/templates/shared/component-metadata.d.ts.map +0 -1
  221. package/libs/instance-factories/views/templates/shared/component-metadata.js +0 -602
  222. package/libs/instance-factories/views/templates/shared/component-metadata.js.map +0 -1
  223. package/libs/instance-factories/views/templates/shared/component-metadata.ts +0 -803
  224. package/libs/instance-factories/views/templates/shared/composite-pattern-types.ts +0 -250
  225. package/libs/instance-factories/views/templates/shared/composite-patterns.ts +0 -535
  226. package/libs/instance-factories/views/templates/shared/index.ts +0 -68
  227. package/libs/instance-factories/views/templates/shared/pattern-validator.ts +0 -279
  228. package/libs/instance-factories/views/templates/shared/property-mapper.d.ts +0 -149
  229. package/libs/instance-factories/views/templates/shared/property-mapper.d.ts.map +0 -1
  230. package/libs/instance-factories/views/templates/shared/property-mapper.js +0 -580
  231. package/libs/instance-factories/views/templates/shared/property-mapper.js.map +0 -1
  232. package/libs/instance-factories/views/templates/shared/property-mapper.ts +0 -700
  233. package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts +0 -143
  234. package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts.map +0 -1
  235. package/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -420
  236. package/libs/instance-factories/views/templates/shared/syntax-mapper.js.map +0 -1
  237. package/libs/instance-factories/views/templates/shared/syntax-mapper.ts +0 -539
@@ -1,535 +0,0 @@
1
- /**
2
- * Composite View Patterns Registry
3
- *
4
- * Tech-independent definitions for composite view patterns.
5
- * These patterns describe high-level view structures that can be rendered
6
- * by any framework adapter (React, Vue, Svelte, Angular, etc.)
7
- *
8
- * NO FRAMEWORK DEPENDENCIES - Pure TypeScript definitions only.
9
- */
10
-
11
- import type {
12
- CompositeViewPattern,
13
- CompositePatternRegistry,
14
- CURVEDOperation,
15
- DataSource,
16
- LayoutStrategy
17
- } from './composite-pattern-types.js';
18
-
19
- /**
20
- * FormView Pattern
21
- *
22
- * A data entry view for creating or updating entities.
23
- * Generates forms with validation, field rendering, and submission handling.
24
- */
25
- export const FORM_VIEW_PATTERN: CompositeViewPattern = {
26
- // Identity
27
- id: 'form-view',
28
- name: 'FormView',
29
- version: '1.0.0',
30
- description: 'Data entry form for creating or updating entities with validation and field rendering',
31
-
32
- // Metadata
33
- category: 'data-entry',
34
- tags: ['form', 'crud', 'data-entry', 'validation', 'create', 'update'],
35
-
36
- // Composition
37
- requiredAtomicComponents: [
38
- 'form',
39
- 'input',
40
- 'button'
41
- ],
42
- optionalAtomicComponents: [
43
- 'select',
44
- 'textarea',
45
- 'checkbox',
46
- 'radio',
47
- 'label',
48
- 'error-message',
49
- 'fieldset',
50
- 'legend'
51
- ],
52
-
53
- // Layout
54
- layoutStrategy: {
55
- type: 'single-column',
56
- responsive: true,
57
- sections: [
58
- {
59
- id: 'fields',
60
- title: 'Form Fields',
61
- layout: {
62
- type: 'single-column',
63
- gap: 'medium'
64
- }
65
- },
66
- {
67
- id: 'actions',
68
- title: 'Actions',
69
- layout: {
70
- type: 'flex',
71
- gap: 'small'
72
- }
73
- }
74
- ]
75
- },
76
-
77
- // Data Bindings
78
- dataBindings: {
79
- source: 'controller',
80
- operations: [
81
- {
82
- operation: 'create',
83
- returns: 'entity',
84
- optimistic: false,
85
- cache: { enabled: false }
86
- },
87
- {
88
- operation: 'update',
89
- params: ['id'],
90
- returns: 'entity',
91
- optimistic: true,
92
- cache: { enabled: false }
93
- },
94
- {
95
- operation: 'validate',
96
- returns: 'validation-result',
97
- optimistic: false,
98
- cache: { enabled: false }
99
- }
100
- ],
101
- relationships: []
102
- },
103
-
104
- // Behavior
105
- supportedOperations: ['create', 'update', 'validate'],
106
-
107
- eventHandlers: [
108
- {
109
- event: 'submit',
110
- operation: 'create',
111
- validate: true
112
- },
113
- {
114
- event: 'submit',
115
- operation: 'update',
116
- validate: true
117
- },
118
- {
119
- event: 'blur',
120
- operation: 'validate',
121
- validate: false
122
- }
123
- ],
124
-
125
- // State Management
126
- state: {
127
- fields: ['formData', 'errors', 'touched', 'isSubmitting'],
128
- persistence: 'none'
129
- }
130
- };
131
-
132
- /**
133
- * ListView Pattern
134
- *
135
- * A data display view for showing collections of entities.
136
- * Supports table, list, card, and kanban display modes with filtering and pagination.
137
- */
138
- export const LIST_VIEW_PATTERN: CompositeViewPattern = {
139
- // Identity
140
- id: 'list-view',
141
- name: 'ListView',
142
- version: '1.0.0',
143
- description: 'Data display for collections with filtering, sorting, and pagination support',
144
-
145
- // Metadata
146
- category: 'data-display',
147
- tags: ['list', 'table', 'collection', 'data-display', 'pagination', 'filtering'],
148
-
149
- // Composition
150
- requiredAtomicComponents: [
151
- 'table',
152
- 'list'
153
- ],
154
- optionalAtomicComponents: [
155
- 'card',
156
- 'badge',
157
- 'button',
158
- 'input',
159
- 'select',
160
- 'pagination',
161
- 'search',
162
- 'filter'
163
- ],
164
-
165
- // Layout
166
- layoutStrategy: {
167
- type: 'flex',
168
- responsive: true,
169
- direction: 'column',
170
- sections: [
171
- {
172
- id: 'toolbar',
173
- title: 'Toolbar',
174
- fields: ['search', 'filters', 'actions'],
175
- layout: {
176
- type: 'flex',
177
- gap: 'medium'
178
- }
179
- },
180
- {
181
- id: 'content',
182
- title: 'Content',
183
- layout: {
184
- type: 'single-column'
185
- }
186
- },
187
- {
188
- id: 'pagination',
189
- title: 'Pagination',
190
- layout: {
191
- type: 'flex',
192
- gap: 'small'
193
- }
194
- }
195
- ]
196
- },
197
-
198
- // Data Bindings
199
- dataBindings: {
200
- source: 'controller',
201
- operations: [
202
- {
203
- operation: 'retrieve_many',
204
- returns: 'entity-array',
205
- optimistic: false,
206
- cache: {
207
- enabled: true,
208
- ttl: 300,
209
- key: 'list-{modelName}-{filters}'
210
- }
211
- }
212
- ],
213
- relationships: []
214
- },
215
-
216
- // Behavior
217
- supportedOperations: ['retrieve_many'],
218
-
219
- eventHandlers: [
220
- {
221
- event: 'search',
222
- operation: 'retrieve_many',
223
- validate: false
224
- },
225
- {
226
- event: 'filter',
227
- operation: 'retrieve_many',
228
- validate: false
229
- },
230
- {
231
- event: 'sort',
232
- operation: 'retrieve_many',
233
- validate: false
234
- },
235
- {
236
- event: 'paginate',
237
- operation: 'retrieve_many',
238
- validate: false
239
- }
240
- ],
241
-
242
- // State Management
243
- state: {
244
- fields: ['entities', 'filters', 'sort', 'pagination', 'loading'],
245
- persistence: 'session'
246
- }
247
- };
248
-
249
- /**
250
- * DetailView Pattern
251
- *
252
- * A data display view for showing a single entity with all its attributes.
253
- * Supports editing, deleting, and navigating to related entities.
254
- */
255
- export const DETAIL_VIEW_PATTERN: CompositeViewPattern = {
256
- // Identity
257
- id: 'detail-view',
258
- name: 'DetailView',
259
- version: '1.0.0',
260
- description: 'Single entity detail display with edit and delete actions',
261
-
262
- // Metadata
263
- category: 'data-display',
264
- tags: ['detail', 'view', 'entity', 'display', 'read-only'],
265
-
266
- // Composition
267
- requiredAtomicComponents: [
268
- 'card',
269
- 'container'
270
- ],
271
- optionalAtomicComponents: [
272
- 'badge',
273
- 'button',
274
- 'tabs',
275
- 'card',
276
- 'list',
277
- 'table'
278
- ],
279
-
280
- // Layout
281
- layoutStrategy: {
282
- type: 'single-column',
283
- responsive: true,
284
- sections: [
285
- {
286
- id: 'header',
287
- title: 'Header',
288
- fields: ['title', 'status', 'actions'],
289
- layout: {
290
- type: 'flex',
291
- gap: 'medium'
292
- }
293
- },
294
- {
295
- id: 'main',
296
- title: 'Main Content',
297
- layout: {
298
- type: 'two-column',
299
- columns: 2,
300
- gap: 'large'
301
- }
302
- },
303
- {
304
- id: 'relationships',
305
- title: 'Related Data',
306
- layout: {
307
- type: 'grid',
308
- columns: 2,
309
- gap: 'medium'
310
- }
311
- }
312
- ]
313
- },
314
-
315
- // Data Bindings
316
- dataBindings: {
317
- source: 'controller',
318
- operations: [
319
- {
320
- operation: 'retrieve',
321
- params: ['id'],
322
- returns: 'entity',
323
- optimistic: false,
324
- cache: {
325
- enabled: true,
326
- ttl: 300,
327
- key: 'detail-{modelName}-{id}'
328
- }
329
- },
330
- {
331
- operation: 'update',
332
- params: ['id'],
333
- returns: 'entity',
334
- optimistic: true,
335
- cache: { enabled: false }
336
- },
337
- {
338
- operation: 'delete',
339
- params: ['id'],
340
- returns: 'void',
341
- optimistic: false,
342
- cache: { enabled: false }
343
- }
344
- ],
345
- relationships: []
346
- },
347
-
348
- // Behavior
349
- supportedOperations: ['retrieve', 'update', 'delete'],
350
-
351
- eventHandlers: [
352
- {
353
- event: 'edit',
354
- operation: 'update',
355
- validate: true
356
- },
357
- {
358
- event: 'delete',
359
- operation: 'delete',
360
- validate: false,
361
- confirm: {
362
- title: 'Confirm Delete',
363
- message: 'Are you sure you want to delete this item?'
364
- }
365
- }
366
- ],
367
-
368
- // State Management
369
- state: {
370
- fields: ['entity', 'loading', 'error', 'editMode'],
371
- persistence: 'none'
372
- }
373
- };
374
-
375
- /**
376
- * DashboardView Pattern
377
- *
378
- * A multi-section dashboard for displaying aggregated data, metrics, and summaries.
379
- * Supports customizable grid layouts with various widget types.
380
- */
381
- export const DASHBOARD_VIEW_PATTERN: CompositeViewPattern = {
382
- // Identity
383
- id: 'dashboard-view',
384
- name: 'DashboardView',
385
- version: '1.0.0',
386
- description: 'Multi-section dashboard with metrics, charts, and data summaries',
387
-
388
- // Metadata
389
- category: 'dashboard',
390
- tags: ['dashboard', 'overview', 'metrics', 'analytics', 'summary'],
391
-
392
- // Composition
393
- requiredAtomicComponents: [
394
- 'grid',
395
- 'card'
396
- ],
397
- optionalAtomicComponents: [
398
- 'chart',
399
- 'metric',
400
- 'table',
401
- 'list',
402
- 'badge',
403
- 'progress',
404
- 'stat'
405
- ],
406
-
407
- // Layout
408
- layoutStrategy: {
409
- type: 'grid',
410
- responsive: true,
411
- columns: 12,
412
- sections: [
413
- {
414
- id: 'metrics',
415
- title: 'Key Metrics',
416
- layout: {
417
- type: 'grid',
418
- columns: 4,
419
- gap: 'medium'
420
- }
421
- },
422
- {
423
- id: 'charts',
424
- title: 'Charts',
425
- layout: {
426
- type: 'grid',
427
- columns: 2,
428
- gap: 'large'
429
- }
430
- },
431
- {
432
- id: 'recent-activity',
433
- title: 'Recent Activity',
434
- layout: {
435
- type: 'single-column',
436
- gap: 'small'
437
- }
438
- }
439
- ]
440
- },
441
-
442
- // Data Bindings
443
- dataBindings: {
444
- source: 'service',
445
- operations: [
446
- {
447
- operation: 'retrieve_many',
448
- returns: 'entity-array',
449
- optimistic: false,
450
- cache: {
451
- enabled: true,
452
- ttl: 600,
453
- key: 'dashboard-{component}'
454
- }
455
- }
456
- ],
457
- relationships: []
458
- },
459
-
460
- // Behavior
461
- supportedOperations: ['retrieve_many'],
462
-
463
- eventHandlers: [
464
- {
465
- event: 'refresh',
466
- operation: 'retrieve_many',
467
- validate: false
468
- }
469
- ],
470
-
471
- // State Management
472
- state: {
473
- fields: ['metrics', 'charts', 'recentActivity', 'loading', 'lastUpdate'],
474
- persistence: 'session'
475
- },
476
-
477
- // Customization
478
- customization: {
479
- allowedOverrides: ['layoutStrategy', 'sections', 'metrics'],
480
- requiredOverrides: []
481
- }
482
- };
483
-
484
- /**
485
- * Composite Patterns Registry
486
- *
487
- * Central registry of all composite view patterns available in SpecVerse.
488
- * Framework adapters and instance factories use this registry to generate
489
- * framework-specific implementations.
490
- */
491
- export const COMPOSITE_VIEW_PATTERNS: CompositePatternRegistry = {
492
- 'form-view': FORM_VIEW_PATTERN,
493
- 'list-view': LIST_VIEW_PATTERN,
494
- 'detail-view': DETAIL_VIEW_PATTERN,
495
- 'dashboard-view': DASHBOARD_VIEW_PATTERN
496
- };
497
-
498
- /**
499
- * Get a pattern by ID
500
- */
501
- export function getPattern(id: string): CompositeViewPattern | undefined {
502
- return COMPOSITE_VIEW_PATTERNS[id];
503
- }
504
-
505
- /**
506
- * Get all patterns by category
507
- */
508
- export function getPatternsByCategory(category: string): CompositeViewPattern[] {
509
- return Object.values(COMPOSITE_VIEW_PATTERNS).filter(
510
- pattern => pattern.category === category
511
- );
512
- }
513
-
514
- /**
515
- * Get all patterns by tag
516
- */
517
- export function getPatternsByTag(tag: string): CompositeViewPattern[] {
518
- return Object.values(COMPOSITE_VIEW_PATTERNS).filter(
519
- pattern => pattern.tags.includes(tag)
520
- );
521
- }
522
-
523
- /**
524
- * Get all pattern IDs
525
- */
526
- export function getPatternIds(): string[] {
527
- return Object.keys(COMPOSITE_VIEW_PATTERNS);
528
- }
529
-
530
- /**
531
- * Check if a pattern exists
532
- */
533
- export function hasPattern(id: string): boolean {
534
- return id in COMPOSITE_VIEW_PATTERNS;
535
- }
@@ -1,68 +0,0 @@
1
- /**
2
- * Shared View Templates - Framework-Agnostic Components
3
- *
4
- * This module exports framework-agnostic component definitions and utilities
5
- * that can be used by both runtime renderers and code generators.
6
- *
7
- * NO REACT DEPENDENCIES - Safe to import from any environment
8
- */
9
-
10
- // Component registries
11
- export {
12
- ATOMIC_COMPONENTS_REGISTRY,
13
- AtomicComponentDefinition
14
- } from './atomic-components-registry.js';
15
-
16
- // Component metadata and patterns
17
- export * from './component-metadata.js';
18
-
19
- // Type definitions
20
- export {
21
- ComponentAdapter,
22
- ComponentLibraryAdapter,
23
- ComponentMapping,
24
- RenderContext,
25
- renderProps,
26
- indent,
27
- wrapWithChildren
28
- } from './adapter-types.js';
29
-
30
- // Mappers
31
- export * from './property-mapper.js';
32
- export * from './syntax-mapper.js';
33
-
34
- // Base generator utilities
35
- export {
36
- BaseComponentGenerator,
37
- ViewSpec,
38
- StateDefinition,
39
- EventDefinition,
40
- UIComponent,
41
- RenderContext as GeneratorRenderContext,
42
- GeneratorConfig,
43
- extractComponentTypes,
44
- countComponents,
45
- validateNestingDepth
46
- } from './base-generator.js';
47
-
48
- // Composite view patterns (NEW - tech-independent patterns)
49
- export * from './composite-pattern-types.js';
50
- export {
51
- COMPOSITE_VIEW_PATTERNS,
52
- FORM_VIEW_PATTERN,
53
- LIST_VIEW_PATTERN,
54
- DETAIL_VIEW_PATTERN,
55
- DASHBOARD_VIEW_PATTERN,
56
- getPattern,
57
- getPatternsByCategory,
58
- getPatternsByTag,
59
- getPatternIds,
60
- hasPattern
61
- } from './composite-patterns.js';
62
-
63
- // Pattern validation
64
- export {
65
- validatePattern,
66
- validatePatternRegistry,
67
- getValidationSummary
68
- } from './pattern-validator.js';