@tpitre/story-ui 2.7.1 → 2.8.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 (289) hide show
  1. package/README.md +40 -9
  2. package/dist/cli/deploy.d.ts +1 -1
  3. package/dist/cli/deploy.d.ts.map +1 -1
  4. package/dist/cli/deploy.js +5 -115
  5. package/dist/cli/index.js +0 -0
  6. package/dist/cli/setup.js +3 -3
  7. package/package.json +1 -1
  8. package/dist/cli/index.js.map +0 -1
  9. package/dist/cli/setup.js.map +0 -1
  10. package/dist/cloudflare-edge/src/mcp-session.js +0 -462
  11. package/dist/cloudflare-edge/src/types.js +0 -4
  12. package/dist/cloudflare-edge/src/worker.js +0 -106
  13. package/dist/cloudflare-pages/vite.config.js +0 -14
  14. package/dist/index.d.ts +0 -13
  15. package/dist/index.d.ts.map +0 -1
  16. package/dist/index.js +0 -12
  17. package/dist/index.js.map +0 -1
  18. package/dist/mcp-server/index.js.map +0 -1
  19. package/dist/mcp-server/mcp-stdio-server.js.map +0 -1
  20. package/dist/mcp-server/routes/claude.js.map +0 -1
  21. package/dist/mcp-server/routes/components.js.map +0 -1
  22. package/dist/mcp-server/routes/generateStory.js.map +0 -1
  23. package/dist/mcp-server/routes/hybridStories.js.map +0 -1
  24. package/dist/mcp-server/routes/memoryStories.js.map +0 -1
  25. package/dist/mcp-server/routes/storySync.js.map +0 -1
  26. package/dist/mcp-server/routes/updateStory.js +0 -246
  27. package/dist/mcp-server/sessionManager.js.map +0 -1
  28. package/dist/playground/components/AIAssistant/AIAssistant.d.ts +0 -6
  29. package/dist/playground/components/AIAssistant/AIAssistant.d.ts.map +0 -1
  30. package/dist/playground/components/AIAssistant/AIAssistant.js +0 -109
  31. package/dist/playground/components/AIAssistant/AIAssistant.js.map +0 -1
  32. package/dist/playground/components/AIAssistant/AIAssistant.module.css +0 -166
  33. package/dist/playground/components/Canvas/Canvas.d.ts +0 -9
  34. package/dist/playground/components/Canvas/Canvas.d.ts.map +0 -1
  35. package/dist/playground/components/Canvas/Canvas.js +0 -58
  36. package/dist/playground/components/Canvas/Canvas.js.map +0 -1
  37. package/dist/playground/components/Canvas/Canvas.module.css +0 -189
  38. package/dist/playground/components/Canvas/CanvasWithDnd.d.ts +0 -9
  39. package/dist/playground/components/Canvas/CanvasWithDnd.d.ts.map +0 -1
  40. package/dist/playground/components/Canvas/CanvasWithDnd.js +0 -158
  41. package/dist/playground/components/Canvas/CanvasWithDnd.js.map +0 -1
  42. package/dist/playground/components/Canvas/ComponentRenderer.d.ts +0 -15
  43. package/dist/playground/components/Canvas/ComponentRenderer.d.ts.map +0 -1
  44. package/dist/playground/components/Canvas/ComponentRenderer.js +0 -177
  45. package/dist/playground/components/Canvas/ComponentRenderer.js.map +0 -1
  46. package/dist/playground/components/Canvas/DraggableComponent.d.ts +0 -15
  47. package/dist/playground/components/Canvas/DraggableComponent.d.ts.map +0 -1
  48. package/dist/playground/components/Canvas/DraggableComponent.js +0 -49
  49. package/dist/playground/components/Canvas/DraggableComponent.js.map +0 -1
  50. package/dist/playground/components/Canvas/index.d.ts +0 -9
  51. package/dist/playground/components/Canvas/index.d.ts.map +0 -1
  52. package/dist/playground/components/Canvas/index.js +0 -5
  53. package/dist/playground/components/Canvas/index.js.map +0 -1
  54. package/dist/playground/components/CodeView/CodeView.d.ts +0 -12
  55. package/dist/playground/components/CodeView/CodeView.d.ts.map +0 -1
  56. package/dist/playground/components/CodeView/CodeView.js +0 -77
  57. package/dist/playground/components/CodeView/CodeView.js.map +0 -1
  58. package/dist/playground/components/CodeView/CodeView.module.css +0 -178
  59. package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts +0 -17
  60. package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts.map +0 -1
  61. package/dist/playground/components/ComponentPalette/ComponentPalette.js +0 -138
  62. package/dist/playground/components/ComponentPalette/ComponentPalette.js.map +0 -1
  63. package/dist/playground/components/ComponentPalette/ComponentPalette.module.css +0 -217
  64. package/dist/playground/components/ComponentPalette/index.d.ts +0 -3
  65. package/dist/playground/components/ComponentPalette/index.d.ts.map +0 -1
  66. package/dist/playground/components/ComponentPalette/index.js +0 -2
  67. package/dist/playground/components/ComponentPalette/index.js.map +0 -1
  68. package/dist/playground/components/DropZone/DropZone.d.ts +0 -17
  69. package/dist/playground/components/DropZone/DropZone.d.ts.map +0 -1
  70. package/dist/playground/components/DropZone/DropZone.js +0 -73
  71. package/dist/playground/components/DropZone/DropZone.js.map +0 -1
  72. package/dist/playground/components/DropZone/DropZone.module.css +0 -86
  73. package/dist/playground/components/ExportDialog/ExportDialog.d.ts +0 -10
  74. package/dist/playground/components/ExportDialog/ExportDialog.d.ts.map +0 -1
  75. package/dist/playground/components/ExportDialog/ExportDialog.js +0 -57
  76. package/dist/playground/components/ExportDialog/ExportDialog.js.map +0 -1
  77. package/dist/playground/components/ExportDialog/ExportDialog.module.css +0 -328
  78. package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts +0 -134
  79. package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts.map +0 -1
  80. package/dist/playground/components/LayoutHelpers/LayoutHelpers.js +0 -254
  81. package/dist/playground/components/LayoutHelpers/LayoutHelpers.js.map +0 -1
  82. package/dist/playground/components/LayoutHelpers/index.d.ts +0 -3
  83. package/dist/playground/components/LayoutHelpers/index.d.ts.map +0 -1
  84. package/dist/playground/components/LayoutHelpers/index.js +0 -2
  85. package/dist/playground/components/LayoutHelpers/index.js.map +0 -1
  86. package/dist/playground/components/Playground/Playground.d.ts +0 -10
  87. package/dist/playground/components/Playground/Playground.d.ts.map +0 -1
  88. package/dist/playground/components/Playground/Playground.js +0 -128
  89. package/dist/playground/components/Playground/Playground.js.map +0 -1
  90. package/dist/playground/components/Playground/Playground.module.css +0 -308
  91. package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts +0 -10
  92. package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts.map +0 -1
  93. package/dist/playground/components/PropertiesPanel/PropertiesPanel.js +0 -150
  94. package/dist/playground/components/PropertiesPanel/PropertiesPanel.js.map +0 -1
  95. package/dist/playground/components/PropertiesPanel/PropertiesPanel.module.css +0 -155
  96. package/dist/playground/components/PropertiesPanel/index.d.ts +0 -3
  97. package/dist/playground/components/PropertiesPanel/index.d.ts.map +0 -1
  98. package/dist/playground/components/PropertiesPanel/index.js +0 -2
  99. package/dist/playground/components/PropertiesPanel/index.js.map +0 -1
  100. package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts +0 -12
  101. package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts.map +0 -1
  102. package/dist/playground/components/PropertyEditors/BooleanEditor.js +0 -14
  103. package/dist/playground/components/PropertyEditors/BooleanEditor.js.map +0 -1
  104. package/dist/playground/components/PropertyEditors/ColorEditor.d.ts +0 -12
  105. package/dist/playground/components/PropertyEditors/ColorEditor.d.ts.map +0 -1
  106. package/dist/playground/components/PropertyEditors/ColorEditor.js +0 -62
  107. package/dist/playground/components/PropertyEditors/ColorEditor.js.map +0 -1
  108. package/dist/playground/components/PropertyEditors/IconEditor.d.ts +0 -12
  109. package/dist/playground/components/PropertyEditors/IconEditor.d.ts.map +0 -1
  110. package/dist/playground/components/PropertyEditors/IconEditor.js +0 -123
  111. package/dist/playground/components/PropertyEditors/IconEditor.js.map +0 -1
  112. package/dist/playground/components/PropertyEditors/NumberEditor.d.ts +0 -15
  113. package/dist/playground/components/PropertyEditors/NumberEditor.d.ts.map +0 -1
  114. package/dist/playground/components/PropertyEditors/NumberEditor.js +0 -46
  115. package/dist/playground/components/PropertyEditors/NumberEditor.js.map +0 -1
  116. package/dist/playground/components/PropertyEditors/PropertyEditors.module.css +0 -432
  117. package/dist/playground/components/PropertyEditors/SelectEditor.d.ts +0 -19
  118. package/dist/playground/components/PropertyEditors/SelectEditor.d.ts.map +0 -1
  119. package/dist/playground/components/PropertyEditors/SelectEditor.js +0 -17
  120. package/dist/playground/components/PropertyEditors/SelectEditor.js.map +0 -1
  121. package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts +0 -19
  122. package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts.map +0 -1
  123. package/dist/playground/components/PropertyEditors/SpacingEditor.js +0 -162
  124. package/dist/playground/components/PropertyEditors/SpacingEditor.js.map +0 -1
  125. package/dist/playground/components/PropertyEditors/SpacingEditor.module.css +0 -214
  126. package/dist/playground/components/PropertyEditors/TextEditor.d.ts +0 -14
  127. package/dist/playground/components/PropertyEditors/TextEditor.d.ts.map +0 -1
  128. package/dist/playground/components/PropertyEditors/TextEditor.js +0 -38
  129. package/dist/playground/components/PropertyEditors/TextEditor.js.map +0 -1
  130. package/dist/playground/components/PropertyEditors/TokenEditor.d.ts +0 -23
  131. package/dist/playground/components/PropertyEditors/TokenEditor.d.ts.map +0 -1
  132. package/dist/playground/components/PropertyEditors/TokenEditor.js +0 -50
  133. package/dist/playground/components/PropertyEditors/TokenEditor.js.map +0 -1
  134. package/dist/playground/components/PropertyEditors/index.d.ts +0 -20
  135. package/dist/playground/components/PropertyEditors/index.d.ts.map +0 -1
  136. package/dist/playground/components/PropertyEditors/index.js +0 -12
  137. package/dist/playground/components/PropertyEditors/index.js.map +0 -1
  138. package/dist/playground/components/TreeView/TreeView.d.ts +0 -10
  139. package/dist/playground/components/TreeView/TreeView.d.ts.map +0 -1
  140. package/dist/playground/components/TreeView/TreeView.js +0 -146
  141. package/dist/playground/components/TreeView/TreeView.js.map +0 -1
  142. package/dist/playground/components/TreeView/TreeView.module.css +0 -214
  143. package/dist/playground/components/TreeView/index.d.ts +0 -3
  144. package/dist/playground/components/TreeView/index.d.ts.map +0 -1
  145. package/dist/playground/components/TreeView/index.js +0 -2
  146. package/dist/playground/components/TreeView/index.js.map +0 -1
  147. package/dist/playground/config/propertyDefinitions.d.ts +0 -73
  148. package/dist/playground/config/propertyDefinitions.d.ts.map +0 -1
  149. package/dist/playground/config/propertyDefinitions.js +0 -809
  150. package/dist/playground/config/propertyDefinitions.js.map +0 -1
  151. package/dist/playground/hooks/useKeyboardShortcuts.d.ts +0 -38
  152. package/dist/playground/hooks/useKeyboardShortcuts.d.ts.map +0 -1
  153. package/dist/playground/hooks/useKeyboardShortcuts.js +0 -191
  154. package/dist/playground/hooks/useKeyboardShortcuts.js.map +0 -1
  155. package/dist/playground/index.d.ts +0 -21
  156. package/dist/playground/index.d.ts.map +0 -1
  157. package/dist/playground/index.js +0 -23
  158. package/dist/playground/index.js.map +0 -1
  159. package/dist/playground/services/CodeGenerator.d.ts +0 -73
  160. package/dist/playground/services/CodeGenerator.d.ts.map +0 -1
  161. package/dist/playground/services/CodeGenerator.js +0 -359
  162. package/dist/playground/services/CodeGenerator.js.map +0 -1
  163. package/dist/playground/services/DragDropManager.d.ts +0 -95
  164. package/dist/playground/services/DragDropManager.d.ts.map +0 -1
  165. package/dist/playground/services/DragDropManager.js +0 -408
  166. package/dist/playground/services/DragDropManager.js.map +0 -1
  167. package/dist/playground/services/StoryParser.d.ts +0 -73
  168. package/dist/playground/services/StoryParser.d.ts.map +0 -1
  169. package/dist/playground/services/StoryParser.js +0 -419
  170. package/dist/playground/services/StoryParser.js.map +0 -1
  171. package/dist/playground/store/playgroundStore.d.ts +0 -86
  172. package/dist/playground/store/playgroundStore.d.ts.map +0 -1
  173. package/dist/playground/store/playgroundStore.js +0 -337
  174. package/dist/playground/store/playgroundStore.js.map +0 -1
  175. package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts +0 -13
  176. package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts.map +0 -1
  177. package/dist/playground/stories/PlaygroundDragDrop.stories.js +0 -227
  178. package/dist/playground/stories/PlaygroundDragDrop.stories.js.map +0 -1
  179. package/dist/playground/stories/PlaygroundPhase4.stories.d.ts +0 -13
  180. package/dist/playground/stories/PlaygroundPhase4.stories.d.ts.map +0 -1
  181. package/dist/playground/stories/PlaygroundPhase4.stories.js +0 -334
  182. package/dist/playground/stories/PlaygroundPhase4.stories.js.map +0 -1
  183. package/dist/playground/stories/PlaygroundPhase5.stories.d.ts +0 -14
  184. package/dist/playground/stories/PlaygroundPhase5.stories.d.ts.map +0 -1
  185. package/dist/playground/stories/PlaygroundPhase5.stories.js +0 -512
  186. package/dist/playground/stories/PlaygroundPhase5.stories.js.map +0 -1
  187. package/dist/playground/stories/PlaygroundProperties.stories.d.ts +0 -13
  188. package/dist/playground/stories/PlaygroundProperties.stories.d.ts.map +0 -1
  189. package/dist/playground/stories/PlaygroundProperties.stories.js +0 -342
  190. package/dist/playground/stories/PlaygroundProperties.stories.js.map +0 -1
  191. package/dist/playground/types/index.d.ts +0 -251
  192. package/dist/playground/types/index.d.ts.map +0 -1
  193. package/dist/playground/types/index.js +0 -5
  194. package/dist/playground/types/index.js.map +0 -1
  195. package/dist/scripts/verify-framework-adapters.js +0 -105
  196. package/dist/story-generator/componentBlacklist.js.map +0 -1
  197. package/dist/story-generator/componentDiscovery.js.map +0 -1
  198. package/dist/story-generator/configLoader.js.map +0 -1
  199. package/dist/story-generator/considerationsLoader.js.map +0 -1
  200. package/dist/story-generator/documentation-sources.js.map +0 -1
  201. package/dist/story-generator/documentationLoader.js.map +0 -1
  202. package/dist/story-generator/dynamicPackageDiscovery.js.map +0 -1
  203. package/dist/story-generator/enhancedComponentDiscovery.js.map +0 -1
  204. package/dist/story-generator/generateStory.js.map +0 -1
  205. package/dist/story-generator/gitignoreManager.js.map +0 -1
  206. package/dist/story-generator/inMemoryStoryService.js.map +0 -1
  207. package/dist/story-generator/logger.js.map +0 -1
  208. package/dist/story-generator/postProcessStory.js.map +0 -1
  209. package/dist/story-generator/productionGitignoreManager.js.map +0 -1
  210. package/dist/story-generator/promptGenerator.js.map +0 -1
  211. package/dist/story-generator/providerPresets.d.ts +0 -54
  212. package/dist/story-generator/providerPresets.d.ts.map +0 -1
  213. package/dist/story-generator/providerPresets.js +0 -214
  214. package/dist/story-generator/storyHistory.js.map +0 -1
  215. package/dist/story-generator/storySync.js.map +0 -1
  216. package/dist/story-generator/storyTracker.js.map +0 -1
  217. package/dist/story-generator/storyValidator.js.map +0 -1
  218. package/dist/story-generator/test_validation.d.ts +0 -2
  219. package/dist/story-generator/test_validation.d.ts.map +0 -1
  220. package/dist/story-generator/test_validation.js +0 -51
  221. package/dist/story-generator/universalDesignSystemAdapter.js.map +0 -1
  222. package/dist/story-generator/urlRedirectService.js.map +0 -1
  223. package/dist/story-generator/validateStory.js.map +0 -1
  224. package/dist/story-ui.config.js.map +0 -1
  225. package/dist/story-ui.config.loader.d.ts +0 -36
  226. package/dist/story-ui.config.loader.d.ts.map +0 -1
  227. package/dist/story-ui.config.loader.js +0 -205
  228. package/dist/story-ui.config.loader.js.map +0 -1
  229. package/dist/temp/package/templates/StoryUI/StoryUIPanel.js +0 -807
  230. package/dist/temp/package/templates/StoryUI/StoryUIPanel.stories.js +0 -37
  231. package/dist/temp/package/templates/StoryUI/index.js +0 -2
  232. package/dist/templates/StoryUI/StoryUIPanel.js.map +0 -1
  233. package/dist/templates/StoryUI/StoryUIPanel.stories.js.map +0 -1
  234. package/dist/templates/StoryUI/index.js.map +0 -1
  235. package/dist/templates/StoryUI/manager.d.ts +0 -14
  236. package/dist/templates/StoryUI/manager.d.ts.map +0 -1
  237. package/dist/templates/production-app/src/App.d.ts +0 -10
  238. package/dist/templates/production-app/src/App.d.ts.map +0 -1
  239. package/dist/templates/production-app/src/App.js +0 -653
  240. package/dist/templates/production-app/src/LivePreviewRenderer.d.ts +0 -24
  241. package/dist/templates/production-app/src/LivePreviewRenderer.d.ts.map +0 -1
  242. package/dist/templates/production-app/src/LivePreviewRenderer.js +0 -199
  243. package/dist/templates/production-app/src/componentRegistry.d.ts +0 -20
  244. package/dist/templates/production-app/src/componentRegistry.d.ts.map +0 -1
  245. package/dist/templates/production-app/src/componentRegistry.js +0 -316
  246. package/dist/templates/production-app/src/main.d.ts +0 -9
  247. package/dist/templates/production-app/src/main.d.ts.map +0 -1
  248. package/dist/templates/production-app/src/main.js +0 -18
  249. package/dist/templates/production-app/vite.config.d.ts +0 -3
  250. package/dist/templates/production-app/vite.config.d.ts.map +0 -1
  251. package/dist/templates/production-app/vite.config.js +0 -71
  252. package/dist/test-storybooks/angular-material-storybook/src/main.js +0 -66
  253. package/dist/test-storybooks/chakra-storybook/vite.config.js +0 -6
  254. package/dist/test-storybooks/mantine-storybook/vite.config.js +0 -93
  255. package/dist/test-storybooks/web-components-shoelace/vite.config.js +0 -9
  256. package/dist/tsconfig.tsbuildinfo +0 -1
  257. package/dist/visual-builder/components/Canvas/Canvas.js +0 -70
  258. package/dist/visual-builder/components/Canvas/ComponentRenderer.js +0 -545
  259. package/dist/visual-builder/components/CodeExporter/CodeExporter.js +0 -25
  260. package/dist/visual-builder/components/CodeExporter/codeGenerator.js +0 -99
  261. package/dist/visual-builder/components/ComponentPalette/ComponentPalette.js +0 -8
  262. package/dist/visual-builder/components/ComponentPalette/ComponentPaletteItem.js +0 -51
  263. package/dist/visual-builder/components/EmbeddedVisualBuilder.js +0 -107
  264. package/dist/visual-builder/components/PropertyEditor/PropertyEditor.js +0 -16
  265. package/dist/visual-builder/components/PropertyEditor/PropertyForm.js +0 -88
  266. package/dist/visual-builder/components/PropertyEditor/SpacingControl.js +0 -145
  267. package/dist/visual-builder/components/PropertyEditor/SpacingEditor.js +0 -32
  268. package/dist/visual-builder/components/StoryManager/SaveOnlyManager.js +0 -94
  269. package/dist/visual-builder/components/StoryManager/StoryManager.js +0 -68
  270. package/dist/visual-builder/components/StoryManager/index.js +0 -1
  271. package/dist/visual-builder/components/VisualBuilder.js +0 -256
  272. package/dist/visual-builder/config/componentRegistry.js +0 -1758
  273. package/dist/visual-builder/decorators/VisualBuilderDecorator.js +0 -184
  274. package/dist/visual-builder/example-integration.js +0 -59
  275. package/dist/visual-builder/example.js +0 -23
  276. package/dist/visual-builder/hooks/useDragAndDrop.js +0 -137
  277. package/dist/visual-builder/hooks/useSelection.js +0 -27
  278. package/dist/visual-builder/index.js +0 -7
  279. package/dist/visual-builder/store/visualBuilderStore.js +0 -305
  280. package/dist/visual-builder/types/index.js +0 -1
  281. package/dist/visual-builder/utils/__tests__/storyFileUpdater.test.js +0 -145
  282. package/dist/visual-builder/utils/aiParser.js +0 -336
  283. package/dist/visual-builder/utils/componentTreeUtils.js +0 -111
  284. package/dist/visual-builder/utils/parserValidation.js +0 -122
  285. package/dist/visual-builder/utils/storyFileManager.js +0 -73
  286. package/dist/visual-builder/utils/storyFileUpdater.js +0 -326
  287. package/dist/visual-builder/utils/storyNameExtraction.test.js +0 -211
  288. package/dist/visual-builder/utils/storyPersistence.js +0 -180
  289. package/dist/visual-builder/utils/storyToBuilder.js +0 -813
@@ -1,24 +0,0 @@
1
- /**
2
- * Live Preview Renderer
3
- *
4
- * This component takes generated JSX code as a string and renders it live
5
- * using Babel standalone for JSX compilation and the component registry
6
- * for component resolution.
7
- */
8
- import React from 'react';
9
- interface LivePreviewRendererProps {
10
- /** The JSX code string to render */
11
- code: string;
12
- /** Optional error handler */
13
- onError?: (error: Error) => void;
14
- /** Optional success handler */
15
- onSuccess?: () => void;
16
- /** Custom styles for the container */
17
- containerStyle?: React.CSSProperties;
18
- }
19
- /**
20
- * Live Preview Renderer Component
21
- */
22
- export declare const LivePreviewRenderer: React.FC<LivePreviewRendererProps>;
23
- export default LivePreviewRenderer;
24
- //# sourceMappingURL=LivePreviewRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LivePreviewRenderer.d.ts","sourceRoot":"","sources":["../../../../templates/production-app/src/LivePreviewRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,UAAU,wBAAwB;IAChC,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,sCAAsC;IACtC,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACtC;AAuJD;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgGlE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,199 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * Live Preview Renderer
4
- *
5
- * This component takes generated JSX code as a string and renders it live
6
- * using Babel standalone for JSX compilation and the component registry
7
- * for component resolution.
8
- */
9
- import React, { useState, useEffect, useRef } from 'react';
10
- import * as Babel from '@babel/standalone';
11
- // This import will be replaced with the actual component registry at build time
12
- import { componentRegistry, React as ReactExport } from './componentRegistry';
13
- // Error boundary to catch render errors
14
- class ErrorBoundary extends React.Component {
15
- constructor(props) {
16
- super(props);
17
- this.state = { hasError: false, error: null };
18
- }
19
- static getDerivedStateFromError(error) {
20
- return { hasError: true, error };
21
- }
22
- componentDidCatch(error) {
23
- this.props.onError?.(error);
24
- }
25
- componentDidUpdate(prevProps) {
26
- // Reset error state when children change
27
- if (prevProps.children !== this.props.children && this.state.hasError) {
28
- this.setState({ hasError: false, error: null });
29
- }
30
- }
31
- render() {
32
- if (this.state.hasError) {
33
- return (_jsxs("div", { style: {
34
- padding: '16px',
35
- background: 'rgba(239, 68, 68, 0.1)',
36
- borderLeft: '3px solid #ef4444',
37
- borderRadius: '4px',
38
- color: '#ef4444',
39
- fontFamily: 'monospace',
40
- fontSize: '13px',
41
- whiteSpace: 'pre-wrap',
42
- }, children: [_jsx("strong", { children: "Render Error:" }), _jsx("br", {}), this.state.error?.message] }));
43
- }
44
- return this.props.children;
45
- }
46
- }
47
- /**
48
- * Extract JSX from generated code
49
- * The AI typically returns a full story file, but we only need the JSX render content
50
- */
51
- function extractJSX(code) {
52
- // Remove markdown code blocks if present
53
- let cleanCode = code.trim();
54
- if (cleanCode.startsWith('```')) {
55
- cleanCode = cleanCode
56
- .replace(/^```(?:jsx|tsx|javascript|js|typescript|ts)?\n?/, '')
57
- .replace(/\n?```$/, '');
58
- }
59
- // Try to extract JSX from a render function
60
- const renderMatch = cleanCode.match(/render:\s*\(\)\s*=>\s*\(?([\s\S]*?)\)?\s*,?\s*\}/);
61
- if (renderMatch) {
62
- const jsx = renderMatch[1].trim();
63
- // Remove trailing paren if present
64
- return jsx.endsWith(')') && !jsx.includes('(') ? jsx.slice(0, -1) : jsx;
65
- }
66
- // Try to extract from args.children
67
- const childrenMatch = cleanCode.match(/children:\s*\(?([\s\S]*?)\)?\s*\}/);
68
- if (childrenMatch) {
69
- const jsx = childrenMatch[1].trim();
70
- return jsx.endsWith(')') && !jsx.includes('(') ? jsx.slice(0, -1) : jsx;
71
- }
72
- // If it looks like a JSX expression (starts with <), use it directly
73
- if (cleanCode.trim().startsWith('<')) {
74
- return cleanCode;
75
- }
76
- // Try to extract any JSX from the code
77
- const jsxMatch = cleanCode.match(/<[A-Z][^]*$/);
78
- if (jsxMatch) {
79
- return jsxMatch[0];
80
- }
81
- // Return as-is and let Babel fail if it's not valid
82
- return cleanCode;
83
- }
84
- /**
85
- * Compile JSX code string to a React component
86
- */
87
- function compileJSX(jsxCode) {
88
- try {
89
- // Create a scope object with all available components and React
90
- const scope = {
91
- React: ReactExport,
92
- ...componentRegistry,
93
- // Add common React hooks
94
- useState: React.useState,
95
- useEffect: React.useEffect,
96
- useCallback: React.useCallback,
97
- useMemo: React.useMemo,
98
- useRef: React.useRef,
99
- };
100
- // Extract the JSX to render
101
- const extractedJSX = extractJSX(jsxCode);
102
- // Wrap in a function component
103
- const wrappedCode = `
104
- (function() {
105
- const { ${Object.keys(scope).join(', ')} } = scope;
106
- return function PreviewComponent() {
107
- return (${extractedJSX});
108
- };
109
- })()
110
- `;
111
- // Transform JSX to JavaScript
112
- const transformed = Babel.transform(wrappedCode, {
113
- presets: ['react'],
114
- filename: 'preview.tsx',
115
- });
116
- if (!transformed.code) {
117
- throw new Error('Babel transformation produced no output');
118
- }
119
- // Create the component using Function constructor
120
- // eslint-disable-next-line no-new-func
121
- const createComponent = new Function('scope', `return ${transformed.code}`);
122
- const Component = createComponent(scope);
123
- return Component;
124
- }
125
- catch (error) {
126
- console.error('JSX compilation error:', error);
127
- throw error;
128
- }
129
- }
130
- /**
131
- * Live Preview Renderer Component
132
- */
133
- export const LivePreviewRenderer = ({ code, onError, onSuccess, containerStyle, }) => {
134
- const [compiledComponent, setCompiledComponent] = useState(null);
135
- const [error, setError] = useState(null);
136
- const previousCodeRef = useRef('');
137
- // Compile the code when it changes
138
- useEffect(() => {
139
- if (!code || code === previousCodeRef.current) {
140
- return;
141
- }
142
- previousCodeRef.current = code;
143
- setError(null);
144
- try {
145
- const Component = compileJSX(code);
146
- setCompiledComponent(() => Component);
147
- onSuccess?.();
148
- }
149
- catch (err) {
150
- const error = err instanceof Error ? err : new Error(String(err));
151
- setError(error);
152
- setCompiledComponent(null);
153
- onError?.(error);
154
- }
155
- }, [code, onError, onSuccess]);
156
- // Render error state
157
- if (error) {
158
- return (_jsx("div", { style: {
159
- padding: '24px',
160
- ...containerStyle,
161
- }, children: _jsxs("div", { style: {
162
- padding: '16px',
163
- background: 'rgba(239, 68, 68, 0.1)',
164
- borderLeft: '3px solid #ef4444',
165
- borderRadius: '4px',
166
- color: '#ef4444',
167
- }, children: [_jsx("div", { style: {
168
- fontWeight: 600,
169
- marginBottom: '8px',
170
- fontSize: '14px',
171
- }, children: "Compilation Error" }), _jsx("pre", { style: {
172
- margin: 0,
173
- fontFamily: '"Fira Code", Monaco, monospace',
174
- fontSize: '12px',
175
- lineHeight: 1.5,
176
- whiteSpace: 'pre-wrap',
177
- wordBreak: 'break-word',
178
- }, children: error.message })] }) }));
179
- }
180
- // Render empty state
181
- if (!compiledComponent) {
182
- return (_jsx("div", { style: {
183
- display: 'flex',
184
- alignItems: 'center',
185
- justifyContent: 'center',
186
- height: '100%',
187
- color: '#71717a',
188
- ...containerStyle,
189
- }, children: "Waiting for code..." }));
190
- }
191
- // Render the compiled component
192
- const Component = compiledComponent;
193
- return (_jsx("div", { style: {
194
- padding: '24px',
195
- minHeight: '200px',
196
- ...containerStyle,
197
- }, children: _jsx(ErrorBoundary, { onError: onError, children: _jsx(Component, {}) }) }));
198
- };
199
- export default LivePreviewRenderer;
@@ -1,20 +0,0 @@
1
- /**
2
- * Component Registry
3
- *
4
- * AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
5
- * This file is generated at build time by story-ui
6
- *
7
- * It exports all components from your component library
8
- * for use in the live preview renderer.
9
- *
10
- * NOTE: This is a sample/placeholder registry for development.
11
- * When you run `story-ui deploy`, this file will be regenerated
12
- * with your actual component library imports.
13
- */
14
- import React from 'react';
15
- export declare const componentRegistry: Record<string, React.ComponentType<any>>;
16
- export declare const availableComponents: string[];
17
- export { React };
18
- export declare function getComponent(name: string): React.ComponentType<any> | undefined;
19
- export declare function hasComponent(name: string): boolean;
20
- //# sourceMappingURL=componentRegistry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentRegistry.d.ts","sourceRoot":"","sources":["../../../../templates/production-app/src/componentRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AA0Q1B,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAStE,CAAC;AAGF,eAAO,MAAM,mBAAmB,UAS/B,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,CAAC;AAGjB,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,SAAS,CAE/E;AAGD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD"}
@@ -1,316 +0,0 @@
1
- /**
2
- * Component Registry
3
- *
4
- * AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
5
- * This file is generated at build time by story-ui
6
- *
7
- * It exports all components from your component library
8
- * for use in the live preview renderer.
9
- *
10
- * NOTE: This is a sample/placeholder registry for development.
11
- * When you run `story-ui deploy`, this file will be regenerated
12
- * with your actual component library imports.
13
- */
14
- import React from 'react';
15
- // Sample placeholder components for development/testing
16
- // These will be replaced with actual component imports from your library
17
- const PlaceholderButton = ({ children, variant = 'filled', color = '#6366f1', size = 'md', disabled, onClick }) => {
18
- const sizes = {
19
- xs: { padding: '4px 8px', fontSize: '11px' },
20
- sm: { padding: '6px 12px', fontSize: '12px' },
21
- md: { padding: '8px 16px', fontSize: '14px' },
22
- lg: { padding: '10px 20px', fontSize: '16px' },
23
- xl: { padding: '12px 24px', fontSize: '18px' },
24
- };
25
- const baseStyles = {
26
- ...sizes[size],
27
- borderRadius: '6px',
28
- fontWeight: 500,
29
- cursor: disabled ? 'not-allowed' : 'pointer',
30
- opacity: disabled ? 0.5 : 1,
31
- transition: 'all 150ms ease',
32
- border: 'none',
33
- fontFamily: 'inherit',
34
- };
35
- const variantStyles = {
36
- filled: { backgroundColor: color, color: 'white' },
37
- outline: { backgroundColor: 'transparent', border: `1px solid ${color}`, color },
38
- subtle: { backgroundColor: `${color}20`, color },
39
- light: { backgroundColor: `${color}15`, color },
40
- };
41
- return style = {};
42
- {
43
- baseStyles, ;
44
- variantStyles[variant];
45
- }
46
- };
47
- disabled = { disabled };
48
- onClick = { onClick }
49
- >
50
- { children }
51
- < /button>;
52
- ;
53
- ;
54
- const PlaceholderCard = ({ children, shadow = 'sm', padding = 'md', radius = 'md', withBorder = false }) => {
55
- const paddings = { xs: '8px', sm: '12px', md: '16px', lg: '24px', xl: '32px' };
56
- const radii = { xs: '4px', sm: '6px', md: '8px', lg: '12px', xl: '16px' };
57
- const shadows = {
58
- xs: '0 1px 2px rgba(0,0,0,0.05)',
59
- sm: '0 1px 3px rgba(0,0,0,0.1)',
60
- md: '0 4px 6px rgba(0,0,0,0.1)',
61
- lg: '0 10px 15px rgba(0,0,0,0.1)',
62
- xl: '0 20px 25px rgba(0,0,0,0.15)',
63
- };
64
- return style = {};
65
- {
66
- backgroundColor: '#1e1e1e',
67
- padding;
68
- paddings[padding],
69
- borderRadius;
70
- radii[radius],
71
- boxShadow;
72
- shadows[shadow],
73
- border;
74
- withBorder ? '1px solid #27272a' : 'none',
75
- ;
76
- }
77
- };
78
- >
79
- { children }
80
- < /div>;
81
- ;
82
- ;
83
- const PlaceholderText = ({ children, size = 'md', weight = 400, color, align = 'left' }) => {
84
- const sizes = { xs: '11px', sm: '13px', md: '14px', lg: '16px', xl: '18px' };
85
- return style = {};
86
- {
87
- fontSize: sizes[size],
88
- fontWeight;
89
- weight,
90
- color;
91
- color || '#fafafa',
92
- textAlign;
93
- align,
94
- margin;
95
- 0,
96
- lineHeight;
97
- 1.5,
98
- ;
99
- }
100
- };
101
- >
102
- { children }
103
- < /p>;
104
- ;
105
- ;
106
- const PlaceholderTitle = ({ children, order = 1, color, align = 'left' }) => {
107
- const sizes = {
108
- 1: '32px',
109
- 2: '28px',
110
- 3: '24px',
111
- 4: '20px',
112
- 5: '18px',
113
- 6: '16px',
114
- };
115
- const Tag = `h${order}`;
116
- return style = {};
117
- {
118
- fontSize: sizes[order],
119
- fontWeight;
120
- 700,
121
- color;
122
- color || '#fafafa',
123
- textAlign;
124
- align,
125
- margin;
126
- 0,
127
- lineHeight;
128
- 1.25,
129
- ;
130
- }
131
- };
132
- >
133
- { children }
134
- < /Tag>;
135
- ;
136
- ;
137
- const PlaceholderStack = ({ children, spacing = 'md', align = 'stretch' }) => {
138
- const spacings = { xs: '4px', sm: '8px', md: '16px', lg: '24px', xl: '32px' };
139
- return style = {};
140
- {
141
- display: 'flex',
142
- flexDirection;
143
- 'column',
144
- gap;
145
- spacings[spacing],
146
- alignItems;
147
- align,
148
- ;
149
- }
150
- };
151
- >
152
- { children }
153
- < /div>;
154
- ;
155
- ;
156
- const PlaceholderGroup = ({ children, spacing = 'md', justify = 'flex-start', align = 'center', wrap = 'wrap' }) => {
157
- const spacings = { xs: '4px', sm: '8px', md: '16px', lg: '24px', xl: '32px' };
158
- return style = {};
159
- {
160
- display: 'flex',
161
- flexDirection;
162
- 'row',
163
- gap;
164
- spacings[spacing],
165
- justifyContent;
166
- justify,
167
- alignItems;
168
- align,
169
- flexWrap;
170
- wrap,
171
- ;
172
- }
173
- };
174
- >
175
- { children }
176
- < /div>;
177
- ;
178
- ;
179
- const PlaceholderBadge = ({ children, color = '#6366f1', variant = 'light', size = 'md' }) => {
180
- const sizes = {
181
- xs: { padding: '2px 6px', fontSize: '10px' },
182
- sm: { padding: '3px 8px', fontSize: '11px' },
183
- md: { padding: '4px 10px', fontSize: '12px' },
184
- lg: { padding: '5px 12px', fontSize: '13px' },
185
- xl: { padding: '6px 14px', fontSize: '14px' },
186
- };
187
- const variantStyles = {
188
- filled: { backgroundColor: color, color: 'white' },
189
- outline: { backgroundColor: 'transparent', border: `1px solid ${color}`, color },
190
- light: { backgroundColor: `${color}20`, color },
191
- };
192
- return style = {};
193
- {
194
- }
195
- };
196
- sizes[size],
197
- ;
198
- variantStyles[variant],
199
- borderRadius;
200
- '9999px',
201
- fontWeight;
202
- 500,
203
- display;
204
- 'inline-flex',
205
- alignItems;
206
- 'center',
207
- justifyContent;
208
- 'center',
209
- ;
210
- >
211
- { children }
212
- < /span>;
213
- ;
214
- ;
215
- const PlaceholderTextInput = ({ label, placeholder, value, onChange, disabled, error, description }) => {
216
- return style = {};
217
- {
218
- display: 'flex', flexDirection;
219
- 'column', gap;
220
- '4px';
221
- }
222
- };
223
- >
224
- { label } && style;
225
- {
226
- {
227
- fontSize: '14px', fontWeight;
228
- 500, color;
229
- '#fafafa';
230
- }
231
- }
232
- >
233
- { label }
234
- < /label>;
235
- {
236
- description && style;
237
- {
238
- {
239
- fontSize: '12px', color;
240
- '#71717a';
241
- }
242
- }
243
- > { description } < /span>;
244
- }
245
- type;
246
- "text";
247
- placeholder = { placeholder };
248
- value = { value };
249
- onChange = { onChange };
250
- disabled = { disabled };
251
- style = {};
252
- {
253
- padding: '8px 12px',
254
- fontSize;
255
- '14px',
256
- borderRadius;
257
- '6px',
258
- border;
259
- `1px solid ${error ? '#ef4444' : '#27272a'}`,
260
- backgroundColor;
261
- '#1a1a1a',
262
- color;
263
- '#fafafa',
264
- outline;
265
- 'none',
266
- opacity;
267
- disabled ? 0.5 : 1,
268
- ;
269
- }
270
- />;
271
- {
272
- error && style;
273
- {
274
- {
275
- fontSize: '12px', color;
276
- '#ef4444';
277
- }
278
- }
279
- > { error } < /span>;
280
- }
281
- /div>;
282
- ;
283
- ;
284
- // Component registry - maps component names to their implementations
285
- // This will be replaced with actual component imports at build time
286
- export const componentRegistry = {
287
- Button: PlaceholderButton,
288
- Card: PlaceholderCard,
289
- Text: PlaceholderText,
290
- Title: PlaceholderTitle,
291
- Stack: PlaceholderStack,
292
- Group: PlaceholderGroup,
293
- Badge: PlaceholderBadge,
294
- TextInput: PlaceholderTextInput,
295
- };
296
- // List of available component names
297
- export const availableComponents = [
298
- 'Button',
299
- 'Card',
300
- 'Text',
301
- 'Title',
302
- 'Stack',
303
- 'Group',
304
- 'Badge',
305
- 'TextInput',
306
- ];
307
- // Export React for use in compiled code
308
- export { React };
309
- // Helper to get a component by name
310
- export function getComponent(name) {
311
- return componentRegistry[name];
312
- }
313
- // Check if a component exists
314
- export function hasComponent(name) {
315
- return name in componentRegistry;
316
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * Production App Entry Point
3
- *
4
- * This is the main entry point for the Story UI production app.
5
- * It renders the main App component which provides the Lovable/Bolt-style
6
- * interface for generating and previewing UI components.
7
- */
8
- import './index.css';
9
- //# sourceMappingURL=main.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../templates/production-app/src/main.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,aAAa,CAAC"}
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * Production App Entry Point
4
- *
5
- * This is the main entry point for the Story UI production app.
6
- * It renders the main App component which provides the Lovable/Bolt-style
7
- * interface for generating and previewing UI components.
8
- */
9
- import React from 'react';
10
- import ReactDOM from 'react-dom/client';
11
- import App from './App';
12
- import './index.css';
13
- // Mount the app
14
- const rootElement = document.getElementById('root');
15
- if (!rootElement) {
16
- throw new Error('Root element not found. Make sure there is a <div id="root"></div> in your HTML.');
17
- }
18
- ReactDOM.createRoot(rootElement).render(_jsx(React.StrictMode, { children: _jsx(App, {}) }));
@@ -1,3 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
3
- //# sourceMappingURL=vite.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../../../templates/production-app/vite.config.ts"],"names":[],"mappings":";AAKA,wBA6EG"}
@@ -1,71 +0,0 @@
1
- import { defineConfig, loadEnv } from 'vite';
2
- import react from '@vitejs/plugin-react';
3
- import path from 'path';
4
- // https://vitejs.dev/config/
5
- export default defineConfig(({ mode }) => {
6
- // Load env file based on mode
7
- const env = loadEnv(mode, process.cwd(), '');
8
- return {
9
- plugins: [react()],
10
- // Define environment variables to expose to the client
11
- define: {
12
- // Backend API URL - required for production
13
- 'import.meta.env.VITE_BACKEND_URL': JSON.stringify(env.VITE_BACKEND_URL || 'http://localhost:4001'),
14
- // App title customization
15
- 'import.meta.env.VITE_APP_TITLE': JSON.stringify(env.VITE_APP_TITLE || 'Story UI'),
16
- },
17
- // Resolve aliases for cleaner imports
18
- resolve: {
19
- alias: {
20
- '@': path.resolve(__dirname, './src'),
21
- '@components': path.resolve(__dirname, './src/components'),
22
- },
23
- },
24
- // Server configuration for development
25
- server: {
26
- port: 5173,
27
- strictPort: false,
28
- host: true, // Listen on all addresses
29
- // Proxy API requests to backend in development
30
- proxy: {
31
- '/mcp': {
32
- target: env.VITE_BACKEND_URL || 'http://localhost:4001',
33
- changeOrigin: true,
34
- },
35
- '/story-ui': {
36
- target: env.VITE_BACKEND_URL || 'http://localhost:4001',
37
- changeOrigin: true,
38
- },
39
- },
40
- },
41
- // Build configuration
42
- build: {
43
- outDir: 'dist',
44
- sourcemap: mode === 'development',
45
- // Optimize chunk size
46
- rollupOptions: {
47
- output: {
48
- manualChunks: {
49
- // Split vendor chunks for better caching
50
- 'vendor-react': ['react', 'react-dom'],
51
- 'vendor-babel': ['@babel/standalone'],
52
- },
53
- },
54
- },
55
- // Target modern browsers
56
- target: 'es2020',
57
- // Minification
58
- minify: 'esbuild',
59
- },
60
- // Optimize dependencies
61
- optimizeDeps: {
62
- include: ['react', 'react-dom', '@babel/standalone'],
63
- },
64
- // Preview server configuration (for testing production build locally)
65
- preview: {
66
- port: 4173,
67
- strictPort: false,
68
- host: true,
69
- },
70
- };
71
- });