@specverse/engines 4.1.30 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) 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/assets/templates/default/specs/main.specly +65 -0
  5. package/dist/inference/comprehensive-engine.d.ts.map +1 -1
  6. package/dist/inference/comprehensive-engine.js +3 -19
  7. package/dist/inference/comprehensive-engine.js.map +1 -1
  8. package/dist/inference/core/rule-engine.d.ts +31 -0
  9. package/dist/inference/core/rule-engine.d.ts.map +1 -1
  10. package/dist/inference/core/rule-engine.js +117 -33
  11. package/dist/inference/core/rule-engine.js.map +1 -1
  12. package/dist/inference/core/rule-file-types.d.ts +0 -2
  13. package/dist/inference/core/rule-file-types.d.ts.map +1 -1
  14. package/dist/inference/core/rule-file-types.js +3 -6
  15. package/dist/inference/core/rule-file-types.js.map +1 -1
  16. package/dist/inference/core/rule-loader.d.ts +5 -15
  17. package/dist/inference/core/rule-loader.d.ts.map +1 -1
  18. package/dist/inference/core/rule-loader.js +43 -132
  19. package/dist/inference/core/rule-loader.js.map +1 -1
  20. package/dist/inference/core/types.d.ts +0 -6
  21. package/dist/inference/core/types.d.ts.map +1 -1
  22. package/dist/inference/core/types.js +0 -4
  23. package/dist/inference/core/types.js.map +1 -1
  24. package/dist/inference/logical/generators/component-type-resolver.d.ts +0 -26
  25. package/dist/inference/logical/generators/component-type-resolver.d.ts.map +1 -1
  26. package/dist/inference/logical/generators/component-type-resolver.js +0 -19
  27. package/dist/inference/logical/generators/component-type-resolver.js.map +1 -1
  28. package/dist/inference/logical/generators/specialist-view-expander.d.ts +1 -17
  29. package/dist/inference/logical/generators/specialist-view-expander.d.ts.map +1 -1
  30. package/dist/inference/logical/generators/specialist-view-expander.js +0 -15
  31. package/dist/inference/logical/generators/specialist-view-expander.js.map +1 -1
  32. package/dist/inference/logical/generators/view-generator.d.ts +4 -14
  33. package/dist/inference/logical/generators/view-generator.d.ts.map +1 -1
  34. package/dist/inference/logical/generators/view-generator.js +6 -26
  35. package/dist/inference/logical/generators/view-generator.js.map +1 -1
  36. package/dist/inference/logical/index.d.ts +2 -2
  37. package/dist/inference/logical/index.d.ts.map +1 -1
  38. package/dist/inference/logical/logical-engine.d.ts.map +1 -1
  39. package/dist/inference/logical/logical-engine.js +17 -80
  40. package/dist/inference/logical/logical-engine.js.map +1 -1
  41. package/dist/inference/quint-transpiler.d.ts +5 -3
  42. package/dist/inference/quint-transpiler.d.ts.map +1 -1
  43. package/dist/inference/quint-transpiler.js +11 -6
  44. package/dist/inference/quint-transpiler.js.map +1 -1
  45. package/dist/libs/instance-factories/CURVED-INTERFACE.md +278 -0
  46. package/dist/libs/instance-factories/README.md +73 -0
  47. package/dist/libs/instance-factories/applications/README.md +51 -0
  48. package/dist/libs/instance-factories/applications/generic-app.yaml +52 -0
  49. package/{libs/instance-factories/applications/react-app.yaml → dist/libs/instance-factories/applications/react-app-runtime.yaml} +30 -77
  50. package/dist/libs/instance-factories/applications/react-app-starter.yaml +143 -0
  51. package/dist/libs/instance-factories/applications/templates/react/env-example-generator.js +24 -2
  52. package/dist/libs/instance-factories/applications/templates/react/vite-config-generator.js +54 -33
  53. package/dist/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
  54. package/dist/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.js +69 -0
  55. package/dist/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.js +110 -0
  56. package/dist/libs/instance-factories/applications/templates/react-starter/belongs-to.js +40 -0
  57. package/dist/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.js +129 -0
  58. package/dist/libs/instance-factories/applications/templates/react-starter/detail-body-composer.js +80 -0
  59. package/dist/libs/instance-factories/applications/templates/react-starter/form-body-composer.js +217 -0
  60. package/dist/libs/instance-factories/applications/templates/react-starter/helpers-emitter.js +51 -0
  61. package/dist/libs/instance-factories/applications/templates/react-starter/html-to-jsx.js +192 -0
  62. package/dist/libs/instance-factories/applications/templates/react-starter/list-body-composer.js +56 -0
  63. package/dist/libs/instance-factories/applications/templates/react-starter/orchestrator.js +41 -0
  64. package/dist/libs/instance-factories/applications/templates/react-starter/package-json-generator.js +38 -0
  65. package/dist/libs/instance-factories/applications/templates/react-starter/regen-safety.js +89 -0
  66. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
  67. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
  68. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
  69. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
  70. package/dist/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.js +95 -0
  71. package/dist/libs/instance-factories/applications/templates/react-starter/view-emitter.js +81 -0
  72. package/dist/libs/instance-factories/applications/templates/react-starter/views-generator.js +66 -0
  73. package/dist/libs/instance-factories/archived/fastify-prisma.yaml +104 -0
  74. package/dist/libs/instance-factories/cli/README.md +43 -0
  75. package/dist/libs/instance-factories/cli/commander-js.yaml +55 -0
  76. package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +63 -12
  77. package/dist/libs/instance-factories/communication/README.md +47 -0
  78. package/dist/libs/instance-factories/communication/event-emitter.yaml +60 -0
  79. package/dist/libs/instance-factories/communication/rabbitmq-events.yaml +87 -0
  80. package/dist/libs/instance-factories/controllers/README.md +42 -0
  81. package/dist/libs/instance-factories/controllers/fastify.yaml +139 -0
  82. package/dist/libs/instance-factories/controllers/templates/fastify/server-generator.js +29 -2
  83. package/dist/libs/instance-factories/infrastructure/README.md +29 -0
  84. package/dist/libs/instance-factories/infrastructure/docker-k8s.yaml +61 -0
  85. package/dist/libs/instance-factories/orms/README.md +54 -0
  86. package/dist/libs/instance-factories/orms/prisma.yaml +89 -0
  87. package/dist/libs/instance-factories/orms/templates/prisma/schema-generator.js +2 -2
  88. package/dist/libs/instance-factories/scaffolding/README.md +49 -0
  89. package/dist/libs/instance-factories/scaffolding/generic-scaffold.yaml +65 -0
  90. package/dist/libs/instance-factories/sdks/README.md +28 -0
  91. package/dist/libs/instance-factories/sdks/python-sdk.yaml +66 -0
  92. package/dist/libs/instance-factories/sdks/typescript-sdk.yaml +59 -0
  93. package/dist/libs/instance-factories/services/README.md +55 -0
  94. package/dist/libs/instance-factories/services/prisma-services.yaml +71 -0
  95. package/dist/libs/instance-factories/storage/README.md +34 -0
  96. package/dist/libs/instance-factories/storage/mongodb.yaml +79 -0
  97. package/dist/libs/instance-factories/storage/postgresql.yaml +75 -0
  98. package/dist/libs/instance-factories/storage/redis.yaml +79 -0
  99. package/dist/libs/instance-factories/testing/README.md +40 -0
  100. package/dist/libs/instance-factories/testing/vitest-tests.yaml +63 -0
  101. package/dist/libs/instance-factories/tools/README.md +70 -0
  102. package/dist/libs/instance-factories/tools/mcp.yaml +36 -0
  103. package/dist/libs/instance-factories/tools/vscode.yaml +35 -0
  104. package/dist/libs/instance-factories/validation/README.md +38 -0
  105. package/dist/libs/instance-factories/validation/zod.yaml +56 -0
  106. package/dist/realize/engines/code-generator.d.ts.map +1 -1
  107. package/dist/realize/engines/code-generator.js +3 -0
  108. package/dist/realize/engines/code-generator.js.map +1 -1
  109. package/dist/realize/index.d.ts.map +1 -1
  110. package/dist/realize/index.js +15 -22
  111. package/dist/realize/index.js.map +1 -1
  112. package/dist/registry/utils/manifest-adapter.d.ts +8 -1
  113. package/dist/registry/utils/manifest-adapter.d.ts.map +1 -1
  114. package/dist/registry/utils/manifest-adapter.js +8 -1
  115. package/dist/registry/utils/manifest-adapter.js.map +1 -1
  116. package/libs/instance-factories/applications/react-app-starter.yaml +143 -0
  117. package/libs/instance-factories/applications/templates/react/env-example-generator.ts +24 -2
  118. package/libs/instance-factories/applications/templates/react/vite-config-generator.ts +54 -33
  119. package/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
  120. package/libs/instance-factories/applications/templates/react-starter/__tests__/dashboard-body-composer.test.ts +153 -0
  121. package/libs/instance-factories/applications/templates/react-starter/__tests__/detail-body-composer.test.ts +146 -0
  122. package/libs/instance-factories/applications/templates/react-starter/__tests__/form-body-composer.test.ts +188 -0
  123. package/libs/instance-factories/applications/templates/react-starter/__tests__/helpers-emitter.test.ts +55 -0
  124. package/libs/instance-factories/applications/templates/react-starter/__tests__/html-to-jsx.test.ts +140 -0
  125. package/libs/instance-factories/applications/templates/react-starter/__tests__/list-body-composer.test.ts +146 -0
  126. package/libs/instance-factories/applications/templates/react-starter/__tests__/orchestrator.test.ts +184 -0
  127. package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p2-factory-imports.test.ts +116 -0
  128. package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p3-rendered-output.test.ts +183 -0
  129. package/libs/instance-factories/applications/templates/react-starter/__tests__/regen-safety.test.ts +144 -0
  130. package/libs/instance-factories/applications/templates/react-starter/__tests__/starter-generators.test.ts +114 -0
  131. package/libs/instance-factories/applications/templates/react-starter/__tests__/view-emitter.test.ts +107 -0
  132. package/libs/instance-factories/applications/templates/react-starter/__tests__/views-generator.test.ts +139 -0
  133. package/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.ts +98 -0
  134. package/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.ts +141 -0
  135. package/libs/instance-factories/applications/templates/react-starter/belongs-to.ts +82 -0
  136. package/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.ts +189 -0
  137. package/libs/instance-factories/applications/templates/react-starter/detail-body-composer.ts +135 -0
  138. package/libs/instance-factories/applications/templates/react-starter/form-body-composer.ts +383 -0
  139. package/libs/instance-factories/applications/templates/react-starter/helpers-emitter.ts +66 -0
  140. package/libs/instance-factories/applications/templates/react-starter/html-to-jsx.ts +334 -0
  141. package/libs/instance-factories/applications/templates/react-starter/list-body-composer.ts +146 -0
  142. package/libs/instance-factories/applications/templates/react-starter/orchestrator.ts +95 -0
  143. package/libs/instance-factories/applications/templates/react-starter/package-json-generator.ts +57 -0
  144. package/libs/instance-factories/applications/templates/react-starter/regen-safety.ts +157 -0
  145. package/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
  146. package/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
  147. package/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
  148. package/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
  149. package/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.ts +124 -0
  150. package/libs/instance-factories/applications/templates/react-starter/view-emitter.ts +209 -0
  151. package/libs/instance-factories/applications/templates/react-starter/views-generator.ts +137 -0
  152. package/libs/instance-factories/cli/templates/commander/command-generator.ts +63 -12
  153. package/libs/instance-factories/controllers/fastify.yaml +7 -0
  154. package/libs/instance-factories/controllers/templates/fastify/server-generator.ts +36 -2
  155. package/libs/instance-factories/orms/templates/prisma/schema-generator.ts +11 -4
  156. package/package.json +3 -3
  157. package/dist/libs/instance-factories/applications/templates/react/_view-components-source.js +0 -530
  158. package/dist/libs/instance-factories/applications/templates/react/app-tsx-generator.js +0 -73
  159. package/dist/libs/instance-factories/applications/templates/react/field-helpers-generator.js +0 -99
  160. package/dist/libs/instance-factories/applications/templates/react/package-json-generator.js +0 -49
  161. package/dist/libs/instance-factories/applications/templates/react/pattern-adapter-generator.js +0 -156
  162. package/dist/libs/instance-factories/applications/templates/react/react-pattern-adapter.js +0 -935
  163. package/dist/libs/instance-factories/applications/templates/react/relationship-field-generator.js +0 -143
  164. package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.js +0 -646
  165. package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.js +0 -65
  166. package/dist/libs/instance-factories/applications/templates/react/view-dashboard-generator.js +0 -143
  167. package/dist/libs/instance-factories/applications/templates/react/view-detail-generator.js +0 -143
  168. package/dist/libs/instance-factories/applications/templates/react/view-form-generator.js +0 -355
  169. package/dist/libs/instance-factories/applications/templates/react/view-list-generator.js +0 -91
  170. package/dist/libs/instance-factories/applications/templates/react/view-router-generator.js +0 -79
  171. package/dist/libs/instance-factories/views/index.js +0 -48
  172. package/dist/libs/instance-factories/views/templates/react/adapters/antd-adapter.js +0 -742
  173. package/dist/libs/instance-factories/views/templates/react/adapters/mui-adapter.js +0 -824
  174. package/dist/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.js +0 -719
  175. package/dist/libs/instance-factories/views/templates/react/app-generator.js +0 -45
  176. package/dist/libs/instance-factories/views/templates/react/components-generator.js +0 -820
  177. package/dist/libs/instance-factories/views/templates/react/forms-generator.js +0 -275
  178. package/dist/libs/instance-factories/views/templates/react/frontend-package-json-generator.js +0 -46
  179. package/dist/libs/instance-factories/views/templates/react/hooks-generator.js +0 -81
  180. package/dist/libs/instance-factories/views/templates/react/index-css-generator.js +0 -9
  181. package/dist/libs/instance-factories/views/templates/react/index-html-generator.js +0 -23
  182. package/dist/libs/instance-factories/views/templates/react/main-tsx-generator.js +0 -21
  183. package/dist/libs/instance-factories/views/templates/react/react-component-generator.js +0 -299
  184. package/dist/libs/instance-factories/views/templates/react/router-generator.js +0 -136
  185. package/dist/libs/instance-factories/views/templates/react/router-generic-generator.js +0 -107
  186. package/dist/libs/instance-factories/views/templates/react/shared-utils-generator.js +0 -187
  187. package/dist/libs/instance-factories/views/templates/react/spec-json-generator.js +0 -7
  188. package/dist/libs/instance-factories/views/templates/react/types-generator.js +0 -56
  189. package/dist/libs/instance-factories/views/templates/react/views-metadata-generator.js +0 -27
  190. package/dist/libs/instance-factories/views/templates/react/vite-config-generator.js +0 -29
  191. package/dist/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js +0 -261
  192. package/dist/libs/instance-factories/views/templates/shared/adapter-types.js +0 -34
  193. package/dist/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -800
  194. package/dist/libs/instance-factories/views/templates/shared/base-generator.js +0 -305
  195. package/dist/libs/instance-factories/views/templates/shared/component-metadata.js +0 -517
  196. package/dist/libs/instance-factories/views/templates/shared/composite-pattern-types.js +0 -0
  197. package/dist/libs/instance-factories/views/templates/shared/composite-patterns.js +0 -445
  198. package/dist/libs/instance-factories/views/templates/shared/index.js +0 -80
  199. package/dist/libs/instance-factories/views/templates/shared/pattern-validator.js +0 -210
  200. package/dist/libs/instance-factories/views/templates/shared/property-mapper.js +0 -492
  201. package/dist/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -321
  202. package/dist/realize/index.js.bak +0 -758
  203. package/libs/instance-factories/applications/templates/react/_view-components-source.ts +0 -555
  204. package/libs/instance-factories/applications/templates/react/app-tsx-generator.ts +0 -94
  205. package/libs/instance-factories/applications/templates/react/field-helpers-generator.ts +0 -106
  206. package/libs/instance-factories/applications/templates/react/package-json-generator.ts +0 -57
  207. package/libs/instance-factories/applications/templates/react/pattern-adapter-generator.ts +0 -179
  208. package/libs/instance-factories/applications/templates/react/react-pattern-adapter.tsx +0 -1347
  209. package/libs/instance-factories/applications/templates/react/relationship-field-generator.ts +0 -150
  210. package/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.ts +0 -704
  211. package/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.ts +0 -84
  212. package/libs/instance-factories/applications/templates/react/view-dashboard-generator.ts +0 -150
  213. package/libs/instance-factories/applications/templates/react/view-detail-generator.ts +0 -150
  214. package/libs/instance-factories/applications/templates/react/view-form-generator.ts +0 -362
  215. package/libs/instance-factories/applications/templates/react/view-list-generator.ts +0 -98
  216. package/libs/instance-factories/applications/templates/react/view-router-generator.ts +0 -89
  217. package/libs/instance-factories/views/README.md +0 -62
  218. package/libs/instance-factories/views/index.d.ts +0 -13
  219. package/libs/instance-factories/views/index.d.ts.map +0 -1
  220. package/libs/instance-factories/views/index.js +0 -18
  221. package/libs/instance-factories/views/index.js.map +0 -1
  222. package/libs/instance-factories/views/index.ts +0 -45
  223. package/libs/instance-factories/views/react-components.yaml +0 -129
  224. package/libs/instance-factories/views/templates/ARCHITECTURE.md +0 -198
  225. package/libs/instance-factories/views/templates/react/adapters/antd-adapter.ts +0 -869
  226. package/libs/instance-factories/views/templates/react/adapters/mui-adapter.ts +0 -953
  227. package/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.ts +0 -806
  228. package/libs/instance-factories/views/templates/react/app-generator.ts +0 -55
  229. package/libs/instance-factories/views/templates/react/components-generator.ts +0 -938
  230. package/libs/instance-factories/views/templates/react/forms-generator.ts +0 -325
  231. package/libs/instance-factories/views/templates/react/frontend-package-json-generator.ts +0 -57
  232. package/libs/instance-factories/views/templates/react/hooks-generator.ts +0 -106
  233. package/libs/instance-factories/views/templates/react/index-css-generator.ts +0 -14
  234. package/libs/instance-factories/views/templates/react/index-html-generator.ts +0 -34
  235. package/libs/instance-factories/views/templates/react/main-tsx-generator.ts +0 -29
  236. package/libs/instance-factories/views/templates/react/react-component-generator.d.ts +0 -152
  237. package/libs/instance-factories/views/templates/react/react-component-generator.d.ts.map +0 -1
  238. package/libs/instance-factories/views/templates/react/react-component-generator.js +0 -398
  239. package/libs/instance-factories/views/templates/react/react-component-generator.js.map +0 -1
  240. package/libs/instance-factories/views/templates/react/react-component-generator.ts +0 -533
  241. package/libs/instance-factories/views/templates/react/router-generator.ts +0 -197
  242. package/libs/instance-factories/views/templates/react/router-generic-generator.ts +0 -132
  243. package/libs/instance-factories/views/templates/react/shared-utils-generator.ts +0 -196
  244. package/libs/instance-factories/views/templates/react/spec-json-generator.ts +0 -17
  245. package/libs/instance-factories/views/templates/react/types-generator.ts +0 -76
  246. package/libs/instance-factories/views/templates/react/views-metadata-generator.ts +0 -42
  247. package/libs/instance-factories/views/templates/react/vite-config-generator.ts +0 -38
  248. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.d.ts.map +0 -1
  249. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js.map +0 -1
  250. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.ts +0 -474
  251. package/libs/instance-factories/views/templates/shared/__tests__/composite-patterns.test.ts +0 -242
  252. package/libs/instance-factories/views/templates/shared/adapter-types.d.ts +0 -77
  253. package/libs/instance-factories/views/templates/shared/adapter-types.d.ts.map +0 -1
  254. package/libs/instance-factories/views/templates/shared/adapter-types.js +0 -47
  255. package/libs/instance-factories/views/templates/shared/adapter-types.js.map +0 -1
  256. package/libs/instance-factories/views/templates/shared/adapter-types.ts +0 -142
  257. package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts +0 -63
  258. package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts.map +0 -1
  259. package/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -822
  260. package/libs/instance-factories/views/templates/shared/atomic-components-registry.js.map +0 -1
  261. package/libs/instance-factories/views/templates/shared/atomic-components-registry.ts +0 -908
  262. package/libs/instance-factories/views/templates/shared/base-generator.d.ts +0 -247
  263. package/libs/instance-factories/views/templates/shared/base-generator.d.ts.map +0 -1
  264. package/libs/instance-factories/views/templates/shared/base-generator.js +0 -363
  265. package/libs/instance-factories/views/templates/shared/base-generator.js.map +0 -1
  266. package/libs/instance-factories/views/templates/shared/base-generator.ts +0 -608
  267. package/libs/instance-factories/views/templates/shared/component-metadata.d.ts +0 -254
  268. package/libs/instance-factories/views/templates/shared/component-metadata.d.ts.map +0 -1
  269. package/libs/instance-factories/views/templates/shared/component-metadata.js +0 -602
  270. package/libs/instance-factories/views/templates/shared/component-metadata.js.map +0 -1
  271. package/libs/instance-factories/views/templates/shared/component-metadata.ts +0 -803
  272. package/libs/instance-factories/views/templates/shared/composite-pattern-types.ts +0 -250
  273. package/libs/instance-factories/views/templates/shared/composite-patterns.ts +0 -535
  274. package/libs/instance-factories/views/templates/shared/index.ts +0 -68
  275. package/libs/instance-factories/views/templates/shared/pattern-validator.ts +0 -279
  276. package/libs/instance-factories/views/templates/shared/property-mapper.d.ts +0 -149
  277. package/libs/instance-factories/views/templates/shared/property-mapper.d.ts.map +0 -1
  278. package/libs/instance-factories/views/templates/shared/property-mapper.js +0 -580
  279. package/libs/instance-factories/views/templates/shared/property-mapper.js.map +0 -1
  280. package/libs/instance-factories/views/templates/shared/property-mapper.ts +0 -700
  281. package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts +0 -143
  282. package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts.map +0 -1
  283. package/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -420
  284. package/libs/instance-factories/views/templates/shared/syntax-mapper.js.map +0 -1
  285. package/libs/instance-factories/views/templates/shared/syntax-mapper.ts +0 -539
@@ -1,742 +0,0 @@
1
- function renderProps(properties, exclude = []) {
2
- return Object.entries(properties).filter(([key]) => !exclude.includes(key)).map(([key, value]) => {
3
- if (typeof value === "boolean") return value ? key : "";
4
- if (typeof value === "string") return `${key}="${value}"`;
5
- return `${key}={${JSON.stringify(value)}}`;
6
- }).filter(Boolean).join(" ");
7
- }
8
- const antdAdapter = {
9
- name: "Ant Design",
10
- version: "5.x",
11
- description: "Ant Design (antd) component library adapter",
12
- baseDependencies: [
13
- { name: "antd", version: "^5.15.0" },
14
- { name: "@ant-design/icons", version: "^5.2.0" }
15
- ],
16
- config: {
17
- importPrefix: "antd",
18
- importStyle: "named"
19
- },
20
- components: {
21
- // ====================================================================
22
- // DATA DISPLAY (9 types)
23
- // ====================================================================
24
- table: {
25
- imports: ["import { Table } from 'antd'"],
26
- render: (ctx) => {
27
- const { properties, model } = ctx;
28
- const columns = properties.columns || ["id"];
29
- const modelVar = model?.name?.toLowerCase() || "item";
30
- return `<Table
31
- dataSource={${modelVar}s}
32
- columns={[
33
- ${columns.map((col) => `{ title: '${col}', dataIndex: '${col}', key: '${col}'${properties.sortable !== false ? ", sorter: true" : ""} }`).join(",\n ")}
34
- ]}
35
- ${properties.pagination !== false ? `pagination={{ pageSize: ${properties.pageSize || 10} }}` : "pagination={false}"}
36
- ${properties.size ? `size="${properties.size}"` : ""}
37
- ${properties.bordered ? "bordered" : ""}
38
- rowKey="id"
39
- />`;
40
- }
41
- },
42
- list: {
43
- imports: ["import { List } from 'antd'"],
44
- render: (ctx) => {
45
- const { properties, model } = ctx;
46
- const modelVar = model?.name?.toLowerCase() || "item";
47
- return `<List
48
- dataSource={${modelVar}s}
49
- ${properties.bordered ? "bordered" : ""}
50
- ${properties.size ? `size="${properties.size}"` : ""}
51
- ${properties.grid ? `grid={${JSON.stringify(properties.grid)}}` : ""}
52
- renderItem={(${modelVar}) => (
53
- <List.Item>
54
- <List.Item.Meta
55
- ${properties.showAvatar ? `avatar={<Avatar src={${modelVar}.avatar} />}` : ""}
56
- title={${modelVar}.${properties.primaryField || "name"}}
57
- ${properties.secondaryField ? `description={${modelVar}.${properties.secondaryField}}` : ""}
58
- />
59
- </List.Item>
60
- )}
61
- />`;
62
- }
63
- },
64
- grid: {
65
- imports: ["import { Row, Col } from 'antd'"],
66
- render: (ctx) => {
67
- const { properties, children } = ctx;
68
- const gutter = properties.gutter || 16;
69
- return `<Row gutter={${gutter}}>
70
- {items?.map((item) => (
71
- <Col xs={${properties.xs || 24}} sm={${properties.sm || 12}} md={${properties.md || 8}} lg={${properties.lg || 6}} key={item.id}>
72
- ${children || "{/* Item content */}"}
73
- </Col>
74
- ))}
75
- </Row>`;
76
- }
77
- },
78
- card: {
79
- imports: ["import { Card } from 'antd'"],
80
- render: (ctx) => {
81
- const { properties, children } = ctx;
82
- return `<Card
83
- ${properties.title ? `title="${properties.title}"` : ""}
84
- ${properties.bordered !== false ? "bordered" : "bordered={false}"}
85
- ${properties.hoverable ? "hoverable" : ""}
86
- ${properties.size ? `size="${properties.size}"` : ""}
87
- ${properties.image ? `cover={<img alt="${properties.title || "Card"}" src="${properties.image}" />}` : ""}
88
- ${properties.actions ? `actions={[${properties.actions.map((a) => `<${a} />`).join(", ")}]}` : ""}
89
- >
90
- ${children || "{content}"}
91
- </Card>`;
92
- }
93
- },
94
- chart: {
95
- imports: [
96
- "// Note: Ant Design doesn't include charts. Use @ant-design/charts or recharts",
97
- "// import { Line, Bar, Pie } from '@ant-design/charts'"
98
- ],
99
- render: (ctx) => {
100
- const { properties } = ctx;
101
- const chartType = properties.chartType || "line";
102
- const ChartComponent = chartType === "line" ? "Line" : chartType === "bar" ? "Bar" : "Pie";
103
- return `{/* TODO: Integrate @ant-design/charts */}
104
- {/* <${ChartComponent}
105
- data={data}
106
- ${chartType !== "pie" ? 'xField="name" yField="value"' : 'angleField="value" colorField="name"'}
107
- ${properties.responsive !== false ? "responsive" : ""}
108
- ${properties.showLegend !== false ? "" : "legend={false}"}
109
- /> */}`;
110
- },
111
- dependencies: [
112
- { name: "@ant-design/charts", version: "^2.0.0" }
113
- ]
114
- },
115
- tree: {
116
- imports: ["import { Tree } from 'antd'"],
117
- render: (ctx) => {
118
- const { properties } = ctx;
119
- return `<Tree
120
- treeData={treeData}
121
- ${properties.checkable ? "checkable" : ""}
122
- ${properties.defaultExpanded ? "defaultExpandAll" : ""}
123
- ${properties.selectable !== false ? "" : "selectable={false}"}
124
- ${properties.showLine ? "showLine" : ""}
125
- />`;
126
- }
127
- },
128
- timeline: {
129
- imports: ["import { Timeline } from 'antd'"],
130
- render: (ctx) => {
131
- const { properties } = ctx;
132
- const mode = properties.position === "alternate" ? "alternate" : properties.position === "right" ? "right" : "left";
133
- return `<Timeline mode="${mode}">
134
- {events?.map((event) => (
135
- <Timeline.Item key={event.id} ${properties.showDateMarkers ? `label={event.date}` : ""}>
136
- {event.title}
137
- </Timeline.Item>
138
- ))}
139
- </Timeline>`;
140
- }
141
- },
142
- avatar: {
143
- imports: ["import { Avatar } from 'antd'"],
144
- render: (ctx) => {
145
- const { properties } = ctx;
146
- const size = properties.size === "small" ? "small" : properties.size === "large" ? "large" : "default";
147
- return `<Avatar
148
- ${properties.src ? `src="${properties.src}"` : ""}
149
- ${properties.icon ? `icon={<${properties.icon} />}` : ""}
150
- size={${typeof properties.size === "number" ? properties.size : `"${size}"`}}
151
- ${properties.shape ? `shape="${properties.shape}"` : ""}
152
- >
153
- ${!properties.src && !properties.icon ? "{initials}" : ""}
154
- </Avatar>`;
155
- }
156
- },
157
- image: {
158
- imports: ["import { Image } from 'antd'"],
159
- render: (ctx) => {
160
- const { properties } = ctx;
161
- return `<Image
162
- src="${properties.src}"
163
- alt="${properties.alt || "Image"}"
164
- ${properties.width ? `width={${properties.width}}` : ""}
165
- ${properties.height ? `height={${properties.height}}` : ""}
166
- ${properties.preview !== false ? "" : "preview={false}"}
167
- ${properties.placeholder ? "placeholder" : ""}
168
- />`;
169
- }
170
- },
171
- // ====================================================================
172
- // FORMS & INPUTS (11 types)
173
- // ====================================================================
174
- form: {
175
- imports: ["import { Form } from 'antd'"],
176
- render: (ctx) => {
177
- const { properties, children } = ctx;
178
- return `<Form
179
- layout="${properties.layout || "vertical"}"
180
- onFinish={handleSubmit}
181
- ${properties.initialValues ? "initialValues={initialValues}" : ""}
182
- >
183
- ${children || "{/* Form items */}"}
184
- </Form>`;
185
- }
186
- },
187
- input: {
188
- imports: ["import { Input, Form } from 'antd'"],
189
- render: (ctx) => {
190
- const { properties } = ctx;
191
- return `<Form.Item
192
- label="${properties.label || ""}"
193
- name="${properties.name || "field"}"
194
- ${properties.required ? 'rules={[{ required: true, message: "Please input!" }]}' : ""}
195
- >
196
- <Input
197
- type="${properties.type || "text"}"
198
- placeholder="${properties.placeholder || ""}"
199
- ${properties.disabled ? "disabled" : ""}
200
- ${properties.prefix ? `prefix={<${properties.prefix} />}` : ""}
201
- ${properties.suffix ? `suffix={<${properties.suffix} />}` : ""}
202
- />
203
- </Form.Item>`;
204
- }
205
- },
206
- textarea: {
207
- imports: ["import { Input, Form } from 'antd'"],
208
- render: (ctx) => {
209
- const { properties } = ctx;
210
- return `<Form.Item
211
- label="${properties.label || ""}"
212
- name="${properties.name || "field"}"
213
- ${properties.required ? "rules={[{ required: true }]}" : ""}
214
- >
215
- <Input.TextArea
216
- placeholder="${properties.placeholder || ""}"
217
- rows={${properties.rows || 4}}
218
- ${properties.maxLength ? `maxLength={${properties.maxLength}}` : ""}
219
- ${properties.showCount ? "showCount" : ""}
220
- />
221
- </Form.Item>`;
222
- }
223
- },
224
- select: {
225
- imports: ["import { Select, Form } from 'antd'"],
226
- render: (ctx) => {
227
- const { properties } = ctx;
228
- return `<Form.Item
229
- label="${properties.label || "Select"}"
230
- name="${properties.name || "field"}"
231
- ${properties.required ? "rules={[{ required: true }]}" : ""}
232
- >
233
- <Select
234
- placeholder="${properties.placeholder || "Select..."}"
235
- ${properties.mode ? `mode="${properties.mode}"` : ""}
236
- ${properties.allowClear ? "allowClear" : ""}
237
- ${properties.showSearch ? "showSearch" : ""}
238
- options={${properties.options || "options"}}
239
- />
240
- </Form.Item>`;
241
- }
242
- },
243
- checkbox: {
244
- imports: ["import { Checkbox, Form } from 'antd'"],
245
- render: (ctx) => {
246
- const { properties } = ctx;
247
- return `<Form.Item name="${properties.name || "field"}" valuePropName="checked">
248
- <Checkbox ${properties.disabled ? "disabled" : ""}>
249
- ${properties.label || ""}
250
- </Checkbox>
251
- </Form.Item>`;
252
- }
253
- },
254
- radio: {
255
- imports: ["import { Radio, Form } from 'antd'"],
256
- render: (ctx) => {
257
- const { properties } = ctx;
258
- return `<Form.Item label="${properties.label || "Options"}" name="${properties.name || "field"}">
259
- <Radio.Group ${properties.buttonStyle ? `buttonStyle="${properties.buttonStyle}"` : ""}>
260
- {${properties.options || "options"}?.map((option) => (
261
- <Radio${properties.buttonStyle ? ".Button" : ""} key={option.value} value={option.value}>
262
- {option.label}
263
- </Radio${properties.buttonStyle ? ".Button" : ""}>
264
- ))}
265
- </Radio.Group>
266
- </Form.Item>`;
267
- }
268
- },
269
- slider: {
270
- imports: ["import { Slider, Form } from 'antd'"],
271
- render: (ctx) => {
272
- const { properties } = ctx;
273
- return `<Form.Item label="${properties.label || ""}" name="${properties.name || "field"}">
274
- <Slider
275
- min={${properties.min || 0}}
276
- max={${properties.max || 100}}
277
- step={${properties.step || 1}}
278
- ${properties.marks ? "marks={marks}" : ""}
279
- ${properties.range ? "range" : ""}
280
- ${properties.vertical ? "vertical" : ""}
281
- />
282
- </Form.Item>`;
283
- }
284
- },
285
- switch: {
286
- imports: ["import { Switch, Form } from 'antd'"],
287
- render: (ctx) => {
288
- const { properties } = ctx;
289
- return `<Form.Item label="${properties.label || ""}" name="${properties.name || "field"}" valuePropName="checked">
290
- <Switch
291
- ${properties.disabled ? "disabled" : ""}
292
- ${properties.checkedChildren ? `checkedChildren="${properties.checkedChildren}"` : ""}
293
- ${properties.unCheckedChildren ? `unCheckedChildren="${properties.unCheckedChildren}"` : ""}
294
- />
295
- </Form.Item>`;
296
- }
297
- },
298
- autocomplete: {
299
- imports: ["import { AutoComplete, Form } from 'antd'"],
300
- render: (ctx) => {
301
- const { properties } = ctx;
302
- return `<Form.Item label="${properties.label || ""}" name="${properties.name || "field"}">
303
- <AutoComplete
304
- options={${properties.options || "options"}}
305
- placeholder="${properties.placeholder || "Type to search..."}"
306
- filterOption={(inputValue, option) =>
307
- option!.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
308
- }
309
- ${properties.allowClear ? "allowClear" : ""}
310
- />
311
- </Form.Item>`;
312
- }
313
- },
314
- datepicker: {
315
- imports: ["import { DatePicker, Form } from 'antd'"],
316
- render: (ctx) => {
317
- const { properties } = ctx;
318
- return `<Form.Item label="${properties.label || "Select Date"}" name="${properties.name || "field"}">
319
- <DatePicker
320
- ${properties.format ? `format="${properties.format}"` : ""}
321
- ${properties.showTime ? "showTime" : ""}
322
- ${properties.picker ? `picker="${properties.picker}"` : ""}
323
- style={{ width: '100%' }}
324
- />
325
- </Form.Item>`;
326
- }
327
- },
328
- timepicker: {
329
- imports: ["import { TimePicker, Form } from 'antd'"],
330
- render: (ctx) => {
331
- const { properties } = ctx;
332
- return `<Form.Item label="${properties.label || "Select Time"}" name="${properties.name || "field"}">
333
- <TimePicker
334
- ${properties.format ? `format="${properties.format}"` : ""}
335
- ${properties.use12Hours ? "use12Hours" : ""}
336
- style={{ width: '100%' }}
337
- />
338
- </Form.Item>`;
339
- }
340
- },
341
- // ====================================================================
342
- // ACTIONS (5 types)
343
- // ====================================================================
344
- button: {
345
- imports: ["import { Button } from 'antd'"],
346
- render: (ctx) => {
347
- const { properties } = ctx;
348
- const type = { primary: "primary", secondary: "default", danger: "primary" }[properties.variant || "primary"] || "default";
349
- const danger = properties.variant === "danger";
350
- return `<Button
351
- type="${type}"
352
- ${danger ? "danger" : ""}
353
- size="${properties.size || "middle"}"
354
- ${properties.disabled ? "disabled" : ""}
355
- ${properties.loading ? "loading" : ""}
356
- ${properties.block ? "block" : ""}
357
- ${properties.icon ? `icon={<${properties.icon} />}` : ""}
358
- ${properties.shape ? `shape="${properties.shape}"` : ""}
359
- onClick={handleClick}
360
- >
361
- ${properties.label || "Button"}
362
- </Button>`;
363
- }
364
- },
365
- "button-group": {
366
- imports: ["import { Button, Space } from 'antd'"],
367
- render: (ctx) => {
368
- const { properties, children } = ctx;
369
- return `<Space.Compact ${properties.size ? `size="${properties.size}"` : ""}>
370
- ${children || "{/* Buttons */}"}
371
- </Space.Compact>`;
372
- }
373
- },
374
- link: {
375
- imports: ["import { Typography } from 'antd'"],
376
- render: (ctx) => {
377
- const { properties } = ctx;
378
- return `<Typography.Link
379
- href="${properties.href || "#"}"
380
- ${properties.disabled ? "disabled" : ""}
381
- ${properties.underline === false ? "underline={false}" : ""}
382
- ${properties.external ? 'target="_blank"' : ""}
383
- >
384
- ${properties.label || "Link"}
385
- </Typography.Link>`;
386
- }
387
- },
388
- icon: {
389
- imports: ["// Import specific icons: import { HomeOutlined, SettingOutlined } from '@ant-design/icons'"],
390
- render: (ctx) => {
391
- const { properties } = ctx;
392
- return `<${properties.name || "Icon"}Outlined style={{ fontSize: '${properties.size === "small" ? "12px" : properties.size === "large" ? "24px" : "16px"}' }} />`;
393
- }
394
- },
395
- menu: {
396
- imports: ["import { Menu, Dropdown, Button } from 'antd'", "import { MoreOutlined } from '@ant-design/icons'"],
397
- render: (ctx) => {
398
- const { properties } = ctx;
399
- return `<Dropdown
400
- menu={{
401
- items: ${properties.items || "menuItems"},
402
- onClick: handleMenuClick
403
- }}
404
- trigger={['click']}
405
- >
406
- <Button icon={<MoreOutlined />} />
407
- </Dropdown>`;
408
- }
409
- },
410
- // ====================================================================
411
- // OVERLAYS & FEEDBACK (9 types)
412
- // ====================================================================
413
- modal: {
414
- imports: ["import { Modal } from 'antd'"],
415
- render: (ctx) => {
416
- const { properties, children } = ctx;
417
- return `<Modal
418
- title="${properties.title || "Modal"}"
419
- open={open}
420
- onOk={handleOk}
421
- onCancel={handleCancel}
422
- ${properties.width ? `width={${properties.width}}` : ""}
423
- ${properties.centered ? "centered" : ""}
424
- ${properties.footer === false ? "footer={null}" : ""}
425
- >
426
- ${children || "{/* Content */}"}
427
- </Modal>`;
428
- }
429
- },
430
- dialog: {
431
- imports: ["import { Modal } from 'antd'"],
432
- render: (ctx) => {
433
- const { properties, children } = ctx;
434
- return `<Modal
435
- title="${properties.title || "Dialog"}"
436
- open={open}
437
- onOk={handleOk}
438
- onCancel={handleCancel}
439
- ${properties.closable !== false ? "" : "closable={false}"}
440
- ${properties.maskClosable !== false ? "" : "maskClosable={false}"}
441
- >
442
- ${children || "{/* Content */}"}
443
- </Modal>`;
444
- }
445
- },
446
- drawer: {
447
- imports: ["import { Drawer } from 'antd'"],
448
- render: (ctx) => {
449
- const { properties, children } = ctx;
450
- const placement = properties.position === "left" ? "left" : properties.position === "right" ? "right" : properties.position === "top" ? "top" : "bottom";
451
- return `<Drawer
452
- title="${properties.title || "Drawer"}"
453
- placement="${placement}"
454
- open={open}
455
- onClose={handleClose}
456
- ${properties.width ? `width={${properties.width}}` : ""}
457
- ${properties.height ? `height={${properties.height}}` : ""}
458
- >
459
- ${children || "{/* Content */}"}
460
- </Drawer>`;
461
- }
462
- },
463
- popover: {
464
- imports: ["import { Popover, Button } from 'antd'"],
465
- render: (ctx) => {
466
- const { properties, children } = ctx;
467
- return `<Popover
468
- content={${properties.content ? `"${properties.content}"` : "content"}}
469
- title="${properties.title || ""}"
470
- trigger="${properties.trigger || "click"}"
471
- placement="${properties.placement || "top"}"
472
- >
473
- ${children || "<Button>Trigger</Button>"}
474
- </Popover>`;
475
- }
476
- },
477
- tooltip: {
478
- imports: ["import { Tooltip } from 'antd'"],
479
- render: (ctx) => {
480
- const { properties, children } = ctx;
481
- return `<Tooltip
482
- title="${properties.content || ""}"
483
- placement="${properties.placement || "top"}"
484
- ${properties.color ? `color="${properties.color}"` : ""}
485
- >
486
- ${children || "<span>{children}</span>"}
487
- </Tooltip>`;
488
- }
489
- },
490
- alert: {
491
- imports: ["import { Alert } from 'antd'"],
492
- render: (ctx) => {
493
- const { properties } = ctx;
494
- const type = properties.variant === "error" ? "error" : properties.variant === "warning" ? "warning" : properties.variant === "success" ? "success" : "info";
495
- return `<Alert
496
- message="${properties.title || ""}"
497
- description="${properties.message || ""}"
498
- type="${type}"
499
- ${properties.closable ? "closable" : ""}
500
- ${properties.showIcon !== false ? "showIcon" : ""}
501
- ${properties.banner ? "banner" : ""}
502
- />`;
503
- }
504
- },
505
- snackbar: {
506
- imports: ["import { message } from 'antd'"],
507
- render: (ctx) => {
508
- const { properties } = ctx;
509
- return `{/* Use Ant Design message API */}
510
- {/* message.${properties.variant || "info"}('${properties.message || "Notification"}', ${properties.duration || 3}) */}`;
511
- }
512
- },
513
- badge: {
514
- imports: ["import { Badge } from 'antd'"],
515
- render: (ctx) => {
516
- const { properties, children } = ctx;
517
- return `<Badge
518
- count={${properties.count || 0}}
519
- ${properties.dot ? "dot" : ""}
520
- ${properties.status ? `status="${properties.status}"` : ""}
521
- ${properties.color ? `color="${properties.color}"` : ""}
522
- ${properties.overflowCount ? `overflowCount={${properties.overflowCount}}` : ""}
523
- >
524
- ${children || "{children}"}
525
- </Badge>`;
526
- }
527
- },
528
- spinner: {
529
- imports: ["import { Spin } from 'antd'"],
530
- render: (ctx) => {
531
- const { properties } = ctx;
532
- const size = properties.size === "small" ? "small" : properties.size === "large" ? "large" : "default";
533
- return `<Spin size="${size}" ${properties.tip ? `tip="${properties.tip}"` : ""} />`;
534
- }
535
- },
536
- // ====================================================================
537
- // NAVIGATION (5 types)
538
- // ====================================================================
539
- tabs: {
540
- imports: ["import { Tabs } from 'antd'"],
541
- render: (ctx) => {
542
- const { properties } = ctx;
543
- return `<Tabs
544
- activeKey={activeKey}
545
- onChange={handleChange}
546
- ${properties.type ? `type="${properties.type}"` : ""}
547
- ${properties.tabPosition ? `tabPosition="${properties.tabPosition}"` : ""}
548
- items={${properties.items || "tabItems"}}
549
- />`;
550
- }
551
- },
552
- breadcrumb: {
553
- imports: ["import { Breadcrumb } from 'antd'"],
554
- render: (ctx) => {
555
- const { properties } = ctx;
556
- return `<Breadcrumb
557
- items={${properties.items || "breadcrumbItems"}}
558
- ${properties.separator ? `separator="${properties.separator}"` : ""}
559
- />`;
560
- }
561
- },
562
- navbar: {
563
- imports: ["import { Layout, Menu } from 'antd'", "const { Header } = Layout"],
564
- render: (ctx) => {
565
- const { properties, children } = ctx;
566
- return `<Header ${properties.className ? `className="${properties.className}"` : ""}>
567
- <div style={{ float: 'left', color: '#fff', fontSize: '18px', fontWeight: 'bold' }}>
568
- ${properties.brand || "App"}
569
- </div>
570
- ${children || '<Menu theme="dark" mode="horizontal" items={menuItems} />'}
571
- </Header>`;
572
- }
573
- },
574
- sidebar: {
575
- imports: ["import { Layout, Menu } from 'antd'", "const { Sider } = Layout"],
576
- render: (ctx) => {
577
- const { properties } = ctx;
578
- return `<Sider
579
- ${properties.collapsible ? "collapsible" : ""}
580
- ${properties.collapsed !== void 0 ? `collapsed={${properties.collapsed}}` : ""}
581
- width={${properties.width || 200}}
582
- ${properties.theme ? `theme="${properties.theme}"` : ""}
583
- >
584
- <Menu
585
- mode="inline"
586
- ${properties.theme ? `theme="${properties.theme}"` : ""}
587
- items={${properties.items || "menuItems"}}
588
- />
589
- </Sider>`;
590
- }
591
- },
592
- pagination: {
593
- imports: ["import { Pagination } from 'antd'"],
594
- render: (ctx) => {
595
- const { properties } = ctx;
596
- return `<Pagination
597
- current={current}
598
- total={${properties.total || 100}}
599
- pageSize={${properties.pageSize || 10}}
600
- onChange={handleChange}
601
- ${properties.showSizeChanger ? "showSizeChanger" : ""}
602
- ${properties.showQuickJumper ? "showQuickJumper" : ""}
603
- ${properties.showTotal ? `showTotal={(total) => \`Total \${total} items\`}` : ""}
604
- ${properties.size ? `size="${properties.size}"` : ""}
605
- />`;
606
- }
607
- },
608
- // ====================================================================
609
- // LAYOUT (6 types)
610
- // ====================================================================
611
- accordion: {
612
- imports: ["import { Collapse } from 'antd'"],
613
- render: (ctx) => {
614
- const { properties } = ctx;
615
- return `<Collapse
616
- ${properties.accordion ? "accordion" : ""}
617
- ${properties.bordered !== false ? "" : "bordered={false}"}
618
- ${properties.expandIconPosition ? `expandIconPosition="${properties.expandIconPosition}"` : ""}
619
- items={${properties.items || "collapseItems"}}
620
- />`;
621
- }
622
- },
623
- carousel: {
624
- imports: ["import { Carousel } from 'antd'"],
625
- render: (ctx) => {
626
- const { properties } = ctx;
627
- return `<Carousel
628
- ${properties.autoplay ? "autoplay" : ""}
629
- ${properties.autoplaySpeed ? `autoplaySpeed={${properties.autoplaySpeed}}` : ""}
630
- ${properties.dots !== false ? "" : "dots={false}"}
631
- ${properties.effect ? `effect="${properties.effect}"` : ""}
632
- >
633
- {items?.map((item) => (
634
- <div key={item.id}>{item.content}</div>
635
- ))}
636
- </Carousel>`;
637
- }
638
- },
639
- container: {
640
- imports: ["import { Layout } from 'antd'", "const { Content } = Layout"],
641
- render: (ctx) => {
642
- const { properties, children } = ctx;
643
- return `<Content style={{ padding: '${properties.padding || "24px"}', ${properties.maxWidth ? `maxWidth: '${properties.maxWidth}'` : ""} }}>
644
- ${children || "{/* Content */}"}
645
- </Content>`;
646
- }
647
- },
648
- divider: {
649
- imports: ["import { Divider } from 'antd'"],
650
- render: (ctx) => {
651
- const { properties } = ctx;
652
- return `<Divider
653
- ${properties.type === "vertical" ? 'type="vertical"' : ""}
654
- ${properties.dashed ? "dashed" : ""}
655
- ${properties.orientation ? `orientation="${properties.orientation}"` : ""}
656
- >
657
- ${properties.text || ""}
658
- </Divider>`;
659
- }
660
- },
661
- header: {
662
- imports: ["import { Layout, Typography } from 'antd'", "const { Header } = Layout", "const { Title } = Typography"],
663
- render: (ctx) => {
664
- const { properties, children } = ctx;
665
- return `<Header style={{ padding: '16px 24px', background: '#fff', borderBottom: '1px solid #f0f0f0' }}>
666
- ${properties.title ? `<Title level={4}>${properties.title}</Title>` : ""}
667
- ${properties.subtitle ? `<Typography.Text type="secondary">${properties.subtitle}</Typography.Text>` : ""}
668
- ${children || ""}
669
- </Header>`;
670
- }
671
- },
672
- footer: {
673
- imports: ["import { Layout, Typography } from 'antd'", "const { Footer } = Layout"],
674
- render: (ctx) => {
675
- const { properties, children } = ctx;
676
- return `<Footer style={{ textAlign: 'center', padding: '24px 50px' }}>
677
- ${properties.copyright ? `<Typography.Text>${properties.copyright}</Typography.Text>` : ""}
678
- ${children || ""}
679
- </Footer>`;
680
- }
681
- },
682
- // ====================================================================
683
- // PROGRESS (2 types)
684
- // ====================================================================
685
- "progress-bar": {
686
- imports: ["import { Progress } from 'antd'"],
687
- render: (ctx) => {
688
- const { properties } = ctx;
689
- return `<Progress
690
- percent={${properties.value || 0}}
691
- ${properties.status ? `status="${properties.status}"` : ""}
692
- ${properties.showInfo !== false ? "" : "showInfo={false}"}
693
- ${properties.strokeColor ? `strokeColor="${properties.strokeColor}"` : ""}
694
- ${properties.size ? `size="${properties.size}"` : ""}
695
- />`;
696
- }
697
- },
698
- "progress-circle": {
699
- imports: ["import { Progress } from 'antd'"],
700
- render: (ctx) => {
701
- const { properties } = ctx;
702
- return `<Progress
703
- type="circle"
704
- percent={${properties.value || 0}}
705
- ${properties.status ? `status="${properties.status}"` : ""}
706
- ${properties.width ? `width={${properties.width}}` : ""}
707
- ${properties.strokeColor ? `strokeColor="${properties.strokeColor}"` : ""}
708
- />`;
709
- }
710
- },
711
- // ====================================================================
712
- // SPECIALIZED (2 types)
713
- // ====================================================================
714
- searchBar: {
715
- imports: ["import { Input } from 'antd'", "import { SearchOutlined } from '@ant-design/icons'"],
716
- render: (ctx) => {
717
- const { properties } = ctx;
718
- return `<Input.Search
719
- placeholder="${properties.placeholder || "Search..."}"
720
- ${properties.enterButton !== false ? "enterButton" : ""}
721
- ${properties.loading ? "loading" : ""}
722
- ${properties.size ? `size="${properties.size}"` : ""}
723
- onSearch={handleSearch}
724
- />`;
725
- }
726
- },
727
- filterPanel: {
728
- imports: ["import { Card, Space } from 'antd'"],
729
- render: (ctx) => {
730
- const { properties, children } = ctx;
731
- return `<Card title="Filters" ${properties.bordered !== false ? "" : "bordered={false}"}>
732
- <Space direction="vertical" style={{ width: '100%' }}>
733
- ${children || "{/* Filter controls */}"}
734
- </Space>
735
- </Card>`;
736
- }
737
- }
738
- }
739
- };
740
- export {
741
- antdAdapter
742
- };