@tpitre/story-ui 3.3.0 → 3.4.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 (281) hide show
  1. package/dist/cli/index.js +0 -0
  2. package/dist/cli/index.js.map +1 -0
  3. package/dist/cli/setup.js.map +1 -0
  4. package/dist/cloudflare-edge/src/mcp-session.js +462 -0
  5. package/dist/cloudflare-edge/src/types.js +4 -0
  6. package/dist/cloudflare-edge/src/worker.js +106 -0
  7. package/dist/cloudflare-pages/vite.config.js +14 -0
  8. package/dist/index.d.ts +13 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +12 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/mcp-server/index.js.map +1 -0
  13. package/dist/mcp-server/mcp-stdio-server.js.map +1 -0
  14. package/dist/mcp-server/routes/claude.js.map +1 -0
  15. package/dist/mcp-server/routes/components.js.map +1 -0
  16. package/dist/mcp-server/routes/generateStory.js.map +1 -0
  17. package/dist/mcp-server/routes/hybridStories.d.ts +18 -0
  18. package/dist/mcp-server/routes/hybridStories.d.ts.map +1 -0
  19. package/dist/mcp-server/routes/hybridStories.js +216 -0
  20. package/dist/mcp-server/routes/hybridStories.js.map +1 -0
  21. package/dist/mcp-server/routes/memoryStories.d.ts +26 -0
  22. package/dist/mcp-server/routes/memoryStories.d.ts.map +1 -0
  23. package/dist/mcp-server/routes/memoryStories.js +158 -0
  24. package/dist/mcp-server/routes/memoryStories.js.map +1 -0
  25. package/dist/mcp-server/routes/storySync.d.ts +26 -0
  26. package/dist/mcp-server/routes/storySync.d.ts.map +1 -0
  27. package/dist/mcp-server/routes/storySync.js +147 -0
  28. package/dist/mcp-server/routes/storySync.js.map +1 -0
  29. package/dist/mcp-server/routes/updateStory.js +246 -0
  30. package/dist/mcp-server/sessionManager.d.ts +50 -0
  31. package/dist/mcp-server/sessionManager.d.ts.map +1 -0
  32. package/dist/mcp-server/sessionManager.js +125 -0
  33. package/dist/mcp-server/sessionManager.js.map +1 -0
  34. package/dist/playground/components/AIAssistant/AIAssistant.d.ts +6 -0
  35. package/dist/playground/components/AIAssistant/AIAssistant.d.ts.map +1 -0
  36. package/dist/playground/components/AIAssistant/AIAssistant.js +109 -0
  37. package/dist/playground/components/AIAssistant/AIAssistant.js.map +1 -0
  38. package/dist/playground/components/AIAssistant/AIAssistant.module.css +166 -0
  39. package/dist/playground/components/Canvas/Canvas.d.ts +9 -0
  40. package/dist/playground/components/Canvas/Canvas.d.ts.map +1 -0
  41. package/dist/playground/components/Canvas/Canvas.js +58 -0
  42. package/dist/playground/components/Canvas/Canvas.js.map +1 -0
  43. package/dist/playground/components/Canvas/Canvas.module.css +189 -0
  44. package/dist/playground/components/Canvas/CanvasWithDnd.d.ts +9 -0
  45. package/dist/playground/components/Canvas/CanvasWithDnd.d.ts.map +1 -0
  46. package/dist/playground/components/Canvas/CanvasWithDnd.js +158 -0
  47. package/dist/playground/components/Canvas/CanvasWithDnd.js.map +1 -0
  48. package/dist/playground/components/Canvas/ComponentRenderer.d.ts +15 -0
  49. package/dist/playground/components/Canvas/ComponentRenderer.d.ts.map +1 -0
  50. package/dist/playground/components/Canvas/ComponentRenderer.js +177 -0
  51. package/dist/playground/components/Canvas/ComponentRenderer.js.map +1 -0
  52. package/dist/playground/components/Canvas/DraggableComponent.d.ts +15 -0
  53. package/dist/playground/components/Canvas/DraggableComponent.d.ts.map +1 -0
  54. package/dist/playground/components/Canvas/DraggableComponent.js +49 -0
  55. package/dist/playground/components/Canvas/DraggableComponent.js.map +1 -0
  56. package/dist/playground/components/Canvas/index.d.ts +9 -0
  57. package/dist/playground/components/Canvas/index.d.ts.map +1 -0
  58. package/dist/playground/components/Canvas/index.js +5 -0
  59. package/dist/playground/components/Canvas/index.js.map +1 -0
  60. package/dist/playground/components/CodeView/CodeView.d.ts +12 -0
  61. package/dist/playground/components/CodeView/CodeView.d.ts.map +1 -0
  62. package/dist/playground/components/CodeView/CodeView.js +77 -0
  63. package/dist/playground/components/CodeView/CodeView.js.map +1 -0
  64. package/dist/playground/components/CodeView/CodeView.module.css +178 -0
  65. package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts +17 -0
  66. package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts.map +1 -0
  67. package/dist/playground/components/ComponentPalette/ComponentPalette.js +138 -0
  68. package/dist/playground/components/ComponentPalette/ComponentPalette.js.map +1 -0
  69. package/dist/playground/components/ComponentPalette/ComponentPalette.module.css +217 -0
  70. package/dist/playground/components/ComponentPalette/index.d.ts +3 -0
  71. package/dist/playground/components/ComponentPalette/index.d.ts.map +1 -0
  72. package/dist/playground/components/ComponentPalette/index.js +2 -0
  73. package/dist/playground/components/ComponentPalette/index.js.map +1 -0
  74. package/dist/playground/components/DropZone/DropZone.d.ts +17 -0
  75. package/dist/playground/components/DropZone/DropZone.d.ts.map +1 -0
  76. package/dist/playground/components/DropZone/DropZone.js +73 -0
  77. package/dist/playground/components/DropZone/DropZone.js.map +1 -0
  78. package/dist/playground/components/DropZone/DropZone.module.css +86 -0
  79. package/dist/playground/components/ExportDialog/ExportDialog.d.ts +10 -0
  80. package/dist/playground/components/ExportDialog/ExportDialog.d.ts.map +1 -0
  81. package/dist/playground/components/ExportDialog/ExportDialog.js +57 -0
  82. package/dist/playground/components/ExportDialog/ExportDialog.js.map +1 -0
  83. package/dist/playground/components/ExportDialog/ExportDialog.module.css +328 -0
  84. package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts +134 -0
  85. package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts.map +1 -0
  86. package/dist/playground/components/LayoutHelpers/LayoutHelpers.js +254 -0
  87. package/dist/playground/components/LayoutHelpers/LayoutHelpers.js.map +1 -0
  88. package/dist/playground/components/LayoutHelpers/index.d.ts +3 -0
  89. package/dist/playground/components/LayoutHelpers/index.d.ts.map +1 -0
  90. package/dist/playground/components/LayoutHelpers/index.js +2 -0
  91. package/dist/playground/components/LayoutHelpers/index.js.map +1 -0
  92. package/dist/playground/components/Playground/Playground.d.ts +10 -0
  93. package/dist/playground/components/Playground/Playground.d.ts.map +1 -0
  94. package/dist/playground/components/Playground/Playground.js +128 -0
  95. package/dist/playground/components/Playground/Playground.js.map +1 -0
  96. package/dist/playground/components/Playground/Playground.module.css +308 -0
  97. package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts +10 -0
  98. package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts.map +1 -0
  99. package/dist/playground/components/PropertiesPanel/PropertiesPanel.js +150 -0
  100. package/dist/playground/components/PropertiesPanel/PropertiesPanel.js.map +1 -0
  101. package/dist/playground/components/PropertiesPanel/PropertiesPanel.module.css +155 -0
  102. package/dist/playground/components/PropertiesPanel/index.d.ts +3 -0
  103. package/dist/playground/components/PropertiesPanel/index.d.ts.map +1 -0
  104. package/dist/playground/components/PropertiesPanel/index.js +2 -0
  105. package/dist/playground/components/PropertiesPanel/index.js.map +1 -0
  106. package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts +12 -0
  107. package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts.map +1 -0
  108. package/dist/playground/components/PropertyEditors/BooleanEditor.js +14 -0
  109. package/dist/playground/components/PropertyEditors/BooleanEditor.js.map +1 -0
  110. package/dist/playground/components/PropertyEditors/ColorEditor.d.ts +12 -0
  111. package/dist/playground/components/PropertyEditors/ColorEditor.d.ts.map +1 -0
  112. package/dist/playground/components/PropertyEditors/ColorEditor.js +62 -0
  113. package/dist/playground/components/PropertyEditors/ColorEditor.js.map +1 -0
  114. package/dist/playground/components/PropertyEditors/IconEditor.d.ts +12 -0
  115. package/dist/playground/components/PropertyEditors/IconEditor.d.ts.map +1 -0
  116. package/dist/playground/components/PropertyEditors/IconEditor.js +123 -0
  117. package/dist/playground/components/PropertyEditors/IconEditor.js.map +1 -0
  118. package/dist/playground/components/PropertyEditors/NumberEditor.d.ts +15 -0
  119. package/dist/playground/components/PropertyEditors/NumberEditor.d.ts.map +1 -0
  120. package/dist/playground/components/PropertyEditors/NumberEditor.js +46 -0
  121. package/dist/playground/components/PropertyEditors/NumberEditor.js.map +1 -0
  122. package/dist/playground/components/PropertyEditors/PropertyEditors.module.css +432 -0
  123. package/dist/playground/components/PropertyEditors/SelectEditor.d.ts +19 -0
  124. package/dist/playground/components/PropertyEditors/SelectEditor.d.ts.map +1 -0
  125. package/dist/playground/components/PropertyEditors/SelectEditor.js +17 -0
  126. package/dist/playground/components/PropertyEditors/SelectEditor.js.map +1 -0
  127. package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts +19 -0
  128. package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts.map +1 -0
  129. package/dist/playground/components/PropertyEditors/SpacingEditor.js +162 -0
  130. package/dist/playground/components/PropertyEditors/SpacingEditor.js.map +1 -0
  131. package/dist/playground/components/PropertyEditors/SpacingEditor.module.css +214 -0
  132. package/dist/playground/components/PropertyEditors/TextEditor.d.ts +14 -0
  133. package/dist/playground/components/PropertyEditors/TextEditor.d.ts.map +1 -0
  134. package/dist/playground/components/PropertyEditors/TextEditor.js +38 -0
  135. package/dist/playground/components/PropertyEditors/TextEditor.js.map +1 -0
  136. package/dist/playground/components/PropertyEditors/TokenEditor.d.ts +23 -0
  137. package/dist/playground/components/PropertyEditors/TokenEditor.d.ts.map +1 -0
  138. package/dist/playground/components/PropertyEditors/TokenEditor.js +50 -0
  139. package/dist/playground/components/PropertyEditors/TokenEditor.js.map +1 -0
  140. package/dist/playground/components/PropertyEditors/index.d.ts +20 -0
  141. package/dist/playground/components/PropertyEditors/index.d.ts.map +1 -0
  142. package/dist/playground/components/PropertyEditors/index.js +12 -0
  143. package/dist/playground/components/PropertyEditors/index.js.map +1 -0
  144. package/dist/playground/components/TreeView/TreeView.d.ts +10 -0
  145. package/dist/playground/components/TreeView/TreeView.d.ts.map +1 -0
  146. package/dist/playground/components/TreeView/TreeView.js +146 -0
  147. package/dist/playground/components/TreeView/TreeView.js.map +1 -0
  148. package/dist/playground/components/TreeView/TreeView.module.css +214 -0
  149. package/dist/playground/components/TreeView/index.d.ts +3 -0
  150. package/dist/playground/components/TreeView/index.d.ts.map +1 -0
  151. package/dist/playground/components/TreeView/index.js +2 -0
  152. package/dist/playground/components/TreeView/index.js.map +1 -0
  153. package/dist/playground/config/propertyDefinitions.d.ts +73 -0
  154. package/dist/playground/config/propertyDefinitions.d.ts.map +1 -0
  155. package/dist/playground/config/propertyDefinitions.js +809 -0
  156. package/dist/playground/config/propertyDefinitions.js.map +1 -0
  157. package/dist/playground/hooks/useKeyboardShortcuts.d.ts +38 -0
  158. package/dist/playground/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  159. package/dist/playground/hooks/useKeyboardShortcuts.js +191 -0
  160. package/dist/playground/hooks/useKeyboardShortcuts.js.map +1 -0
  161. package/dist/playground/index.d.ts +21 -0
  162. package/dist/playground/index.d.ts.map +1 -0
  163. package/dist/playground/index.js +23 -0
  164. package/dist/playground/index.js.map +1 -0
  165. package/dist/playground/services/CodeGenerator.d.ts +73 -0
  166. package/dist/playground/services/CodeGenerator.d.ts.map +1 -0
  167. package/dist/playground/services/CodeGenerator.js +359 -0
  168. package/dist/playground/services/CodeGenerator.js.map +1 -0
  169. package/dist/playground/services/DragDropManager.d.ts +95 -0
  170. package/dist/playground/services/DragDropManager.d.ts.map +1 -0
  171. package/dist/playground/services/DragDropManager.js +408 -0
  172. package/dist/playground/services/DragDropManager.js.map +1 -0
  173. package/dist/playground/services/StoryParser.d.ts +73 -0
  174. package/dist/playground/services/StoryParser.d.ts.map +1 -0
  175. package/dist/playground/services/StoryParser.js +419 -0
  176. package/dist/playground/services/StoryParser.js.map +1 -0
  177. package/dist/playground/store/playgroundStore.d.ts +86 -0
  178. package/dist/playground/store/playgroundStore.d.ts.map +1 -0
  179. package/dist/playground/store/playgroundStore.js +337 -0
  180. package/dist/playground/store/playgroundStore.js.map +1 -0
  181. package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts +13 -0
  182. package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts.map +1 -0
  183. package/dist/playground/stories/PlaygroundDragDrop.stories.js +227 -0
  184. package/dist/playground/stories/PlaygroundDragDrop.stories.js.map +1 -0
  185. package/dist/playground/stories/PlaygroundPhase4.stories.d.ts +13 -0
  186. package/dist/playground/stories/PlaygroundPhase4.stories.d.ts.map +1 -0
  187. package/dist/playground/stories/PlaygroundPhase4.stories.js +334 -0
  188. package/dist/playground/stories/PlaygroundPhase4.stories.js.map +1 -0
  189. package/dist/playground/stories/PlaygroundPhase5.stories.d.ts +14 -0
  190. package/dist/playground/stories/PlaygroundPhase5.stories.d.ts.map +1 -0
  191. package/dist/playground/stories/PlaygroundPhase5.stories.js +512 -0
  192. package/dist/playground/stories/PlaygroundPhase5.stories.js.map +1 -0
  193. package/dist/playground/stories/PlaygroundProperties.stories.d.ts +13 -0
  194. package/dist/playground/stories/PlaygroundProperties.stories.d.ts.map +1 -0
  195. package/dist/playground/stories/PlaygroundProperties.stories.js +342 -0
  196. package/dist/playground/stories/PlaygroundProperties.stories.js.map +1 -0
  197. package/dist/playground/types/index.d.ts +251 -0
  198. package/dist/playground/types/index.d.ts.map +1 -0
  199. package/dist/playground/types/index.js +5 -0
  200. package/dist/playground/types/index.js.map +1 -0
  201. package/dist/scripts/verify-framework-adapters.js +105 -0
  202. package/dist/story-generator/componentBlacklist.js.map +1 -0
  203. package/dist/story-generator/componentDiscovery.js.map +1 -0
  204. package/dist/story-generator/configLoader.js.map +1 -0
  205. package/dist/story-generator/considerationsLoader.js.map +1 -0
  206. package/dist/story-generator/documentation-sources.js.map +1 -0
  207. package/dist/story-generator/documentationLoader.js.map +1 -0
  208. package/dist/story-generator/dynamicPackageDiscovery.js.map +1 -0
  209. package/dist/story-generator/enhancedComponentDiscovery.js.map +1 -0
  210. package/dist/story-generator/generateStory.js.map +1 -0
  211. package/dist/story-generator/gitignoreManager.js.map +1 -0
  212. package/dist/story-generator/inMemoryStoryService.d.ts +89 -0
  213. package/dist/story-generator/inMemoryStoryService.d.ts.map +1 -0
  214. package/dist/story-generator/inMemoryStoryService.js +128 -0
  215. package/dist/story-generator/inMemoryStoryService.js.map +1 -0
  216. package/dist/story-generator/logger.js.map +1 -0
  217. package/dist/story-generator/postProcessStory.js.map +1 -0
  218. package/dist/story-generator/postgresStoryService.d.ts +56 -0
  219. package/dist/story-generator/postgresStoryService.d.ts.map +1 -0
  220. package/dist/story-generator/postgresStoryService.js +240 -0
  221. package/dist/story-generator/productionGitignoreManager.d.ts +91 -0
  222. package/dist/story-generator/productionGitignoreManager.d.ts.map +1 -0
  223. package/dist/story-generator/productionGitignoreManager.js +340 -0
  224. package/dist/story-generator/productionGitignoreManager.js.map +1 -0
  225. package/dist/story-generator/promptGenerator.js.map +1 -0
  226. package/dist/story-generator/providerPresets.d.ts +54 -0
  227. package/dist/story-generator/providerPresets.d.ts.map +1 -0
  228. package/dist/story-generator/providerPresets.js +214 -0
  229. package/dist/story-generator/storyHistory.js.map +1 -0
  230. package/dist/story-generator/storyServiceFactory.d.ts +22 -0
  231. package/dist/story-generator/storyServiceFactory.d.ts.map +1 -0
  232. package/dist/story-generator/storyServiceFactory.js +97 -0
  233. package/dist/story-generator/storyServiceInterface.d.ts +85 -0
  234. package/dist/story-generator/storyServiceInterface.d.ts.map +1 -0
  235. package/dist/story-generator/storyServiceInterface.js +5 -0
  236. package/dist/story-generator/storySync.d.ts +68 -0
  237. package/dist/story-generator/storySync.d.ts.map +1 -0
  238. package/dist/story-generator/storySync.js +201 -0
  239. package/dist/story-generator/storySync.js.map +1 -0
  240. package/dist/story-generator/storyTracker.js.map +1 -0
  241. package/dist/story-generator/storyValidator.js.map +1 -0
  242. package/dist/story-generator/test_validation.d.ts +2 -0
  243. package/dist/story-generator/test_validation.d.ts.map +1 -0
  244. package/dist/story-generator/test_validation.js +51 -0
  245. package/dist/story-generator/universalDesignSystemAdapter.js.map +1 -0
  246. package/dist/story-generator/urlRedirectService.js.map +1 -0
  247. package/dist/story-generator/validateStory.js.map +1 -0
  248. package/dist/story-ui.config.js.map +1 -0
  249. package/dist/story-ui.config.loader.d.ts +36 -0
  250. package/dist/story-ui.config.loader.d.ts.map +1 -0
  251. package/dist/story-ui.config.loader.js +205 -0
  252. package/dist/story-ui.config.loader.js.map +1 -0
  253. package/dist/temp/package/templates/StoryUI/StoryUIPanel.js +807 -0
  254. package/dist/temp/package/templates/StoryUI/StoryUIPanel.stories.js +37 -0
  255. package/dist/temp/package/templates/StoryUI/index.js +2 -0
  256. package/dist/templates/StoryUI/StoryUIPanel.js.map +1 -0
  257. package/dist/templates/StoryUI/StoryUIPanel.stories.js.map +1 -0
  258. package/dist/templates/StoryUI/index.js.map +1 -0
  259. package/dist/templates/StoryUI/manager.d.ts +14 -0
  260. package/dist/templates/StoryUI/manager.d.ts.map +1 -0
  261. package/dist/templates/production-app/src/App.d.ts +10 -0
  262. package/dist/templates/production-app/src/App.d.ts.map +1 -0
  263. package/dist/templates/production-app/src/App.js +653 -0
  264. package/dist/templates/production-app/src/LivePreviewRenderer.d.ts +24 -0
  265. package/dist/templates/production-app/src/LivePreviewRenderer.d.ts.map +1 -0
  266. package/dist/templates/production-app/src/LivePreviewRenderer.js +199 -0
  267. package/dist/templates/production-app/src/componentRegistry.d.ts +20 -0
  268. package/dist/templates/production-app/src/componentRegistry.d.ts.map +1 -0
  269. package/dist/templates/production-app/src/componentRegistry.js +316 -0
  270. package/dist/templates/production-app/src/main.d.ts +9 -0
  271. package/dist/templates/production-app/src/main.d.ts.map +1 -0
  272. package/dist/templates/production-app/src/main.js +18 -0
  273. package/dist/templates/production-app/vite.config.d.ts +3 -0
  274. package/dist/templates/production-app/vite.config.d.ts.map +1 -0
  275. package/dist/templates/production-app/vite.config.js +71 -0
  276. package/dist/test-storybooks/angular-material-storybook/src/main.js +66 -0
  277. package/dist/test-storybooks/chakra-storybook/vite.config.js +6 -0
  278. package/dist/test-storybooks/mantine-storybook/vite.config.js +93 -0
  279. package/dist/test-storybooks/web-components-shoelace/vite.config.js +9 -0
  280. package/dist/tsconfig.tsbuildinfo +1 -0
  281. package/package.json +1 -1
@@ -0,0 +1,134 @@
1
+ /**
2
+ * LayoutHelpers - Helper components for design systems lacking native layout components
3
+ * These provide consistent layout primitives across different design systems
4
+ */
5
+ import React from 'react';
6
+ import type { CSSProperties, ReactNode } from 'react';
7
+ interface BaseLayoutProps {
8
+ children?: ReactNode;
9
+ className?: string;
10
+ style?: CSSProperties;
11
+ as?: keyof React.JSX.IntrinsicElements;
12
+ }
13
+ interface SpacingProps {
14
+ p?: string | number;
15
+ pt?: string | number;
16
+ pr?: string | number;
17
+ pb?: string | number;
18
+ pl?: string | number;
19
+ px?: string | number;
20
+ py?: string | number;
21
+ m?: string | number;
22
+ mt?: string | number;
23
+ mr?: string | number;
24
+ mb?: string | number;
25
+ ml?: string | number;
26
+ mx?: string | number;
27
+ my?: string | number;
28
+ }
29
+ interface FlexStyleProps {
30
+ direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
31
+ justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
32
+ align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
33
+ wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
34
+ gap?: string | number;
35
+ flex?: string | number;
36
+ }
37
+ interface GridProps {
38
+ columns?: number | string;
39
+ rows?: number | string;
40
+ gap?: string | number;
41
+ columnGap?: string | number;
42
+ rowGap?: string | number;
43
+ areas?: string;
44
+ autoFlow?: 'row' | 'column' | 'dense' | 'row dense' | 'column dense';
45
+ }
46
+ /**
47
+ * Box - Basic container with spacing utilities
48
+ */
49
+ export interface BoxProps extends BaseLayoutProps, SpacingProps {
50
+ display?: CSSProperties['display'];
51
+ width?: string | number;
52
+ height?: string | number;
53
+ minWidth?: string | number;
54
+ minHeight?: string | number;
55
+ maxWidth?: string | number;
56
+ maxHeight?: string | number;
57
+ overflow?: CSSProperties['overflow'];
58
+ position?: CSSProperties['position'];
59
+ background?: string;
60
+ border?: string;
61
+ borderRadius?: string | number;
62
+ boxShadow?: string;
63
+ }
64
+ export declare const Box: React.FC<BoxProps>;
65
+ /**
66
+ * Flex - Flexbox container
67
+ */
68
+ export interface FlexProps extends BaseLayoutProps, SpacingProps, FlexStyleProps {
69
+ }
70
+ export declare const Flex: React.FC<FlexProps>;
71
+ /**
72
+ * Stack - Vertical flex container
73
+ */
74
+ export interface StackProps extends Omit<FlexProps, 'direction'> {
75
+ spacing?: string | number;
76
+ }
77
+ export declare const Stack: React.FC<StackProps>;
78
+ /**
79
+ * HStack - Horizontal flex container
80
+ */
81
+ export interface HStackProps extends Omit<FlexProps, 'direction'> {
82
+ spacing?: string | number;
83
+ }
84
+ export declare const HStack: React.FC<HStackProps>;
85
+ /**
86
+ * Grid - CSS Grid container
87
+ */
88
+ export interface GridContainerProps extends BaseLayoutProps, SpacingProps, GridProps {
89
+ }
90
+ export declare const Grid: React.FC<GridContainerProps>;
91
+ /**
92
+ * Center - Centers content both horizontally and vertically
93
+ */
94
+ export interface CenterProps extends BaseLayoutProps, SpacingProps {
95
+ inline?: boolean;
96
+ }
97
+ export declare const Center: React.FC<CenterProps>;
98
+ /**
99
+ * Container - Centered container with max width
100
+ */
101
+ export interface ContainerProps extends BaseLayoutProps, SpacingProps {
102
+ maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | string | number;
103
+ centerContent?: boolean;
104
+ }
105
+ export declare const Container: React.FC<ContainerProps>;
106
+ /**
107
+ * Spacer - Creates space between elements
108
+ */
109
+ export interface SpacerProps {
110
+ size?: string | number;
111
+ axis?: 'horizontal' | 'vertical';
112
+ flex?: boolean;
113
+ }
114
+ export declare const Spacer: React.FC<SpacerProps>;
115
+ /**
116
+ * Divider - Visual separator
117
+ */
118
+ export interface DividerProps {
119
+ orientation?: 'horizontal' | 'vertical';
120
+ color?: string;
121
+ thickness?: string | number;
122
+ spacing?: string | number;
123
+ style?: CSSProperties;
124
+ }
125
+ export declare const Divider: React.FC<DividerProps>;
126
+ /**
127
+ * AspectRatio - Maintains aspect ratio for content
128
+ */
129
+ export interface AspectRatioProps extends BaseLayoutProps {
130
+ ratio?: number | string;
131
+ }
132
+ export declare const AspectRatio: React.FC<AspectRatioProps>;
133
+ export {};
134
+ //# sourceMappingURL=LayoutHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutHelpers.d.ts","sourceRoot":"","sources":["../../../../playground/components/LayoutHelpers/LayoutHelpers.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC;CACxC;AAED,UAAU,YAAY;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,EA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components
4
+ * These provide consistent layout primitives across different design systems
5
+ */
6
+ import React from 'react';
7
+ // Utility to convert spacing props to CSS
8
+ const getSpacingStyles = (props) => {
9
+ const styles = {};
10
+ // Padding
11
+ if (props.p !== undefined)
12
+ styles.padding = props.p;
13
+ if (props.pt !== undefined)
14
+ styles.paddingTop = props.pt;
15
+ if (props.pr !== undefined)
16
+ styles.paddingRight = props.pr;
17
+ if (props.pb !== undefined)
18
+ styles.paddingBottom = props.pb;
19
+ if (props.pl !== undefined)
20
+ styles.paddingLeft = props.pl;
21
+ if (props.px !== undefined) {
22
+ styles.paddingLeft = props.px;
23
+ styles.paddingRight = props.px;
24
+ }
25
+ if (props.py !== undefined) {
26
+ styles.paddingTop = props.py;
27
+ styles.paddingBottom = props.py;
28
+ }
29
+ // Margin
30
+ if (props.m !== undefined)
31
+ styles.margin = props.m;
32
+ if (props.mt !== undefined)
33
+ styles.marginTop = props.mt;
34
+ if (props.mr !== undefined)
35
+ styles.marginRight = props.mr;
36
+ if (props.mb !== undefined)
37
+ styles.marginBottom = props.mb;
38
+ if (props.ml !== undefined)
39
+ styles.marginLeft = props.ml;
40
+ if (props.mx !== undefined) {
41
+ styles.marginLeft = props.mx;
42
+ styles.marginRight = props.mx;
43
+ }
44
+ if (props.my !== undefined) {
45
+ styles.marginTop = props.my;
46
+ styles.marginBottom = props.my;
47
+ }
48
+ return styles;
49
+ };
50
+ // Utility to convert flex props to CSS
51
+ const getFlexStyles = (props) => {
52
+ const styles = {
53
+ display: 'flex'
54
+ };
55
+ if (props.direction)
56
+ styles.flexDirection = props.direction;
57
+ if (props.gap)
58
+ styles.gap = props.gap;
59
+ if (props.wrap)
60
+ styles.flexWrap = props.wrap;
61
+ if (props.flex)
62
+ styles.flex = props.flex;
63
+ // Map justify values
64
+ if (props.justify) {
65
+ const justifyMap = {
66
+ 'start': 'flex-start',
67
+ 'end': 'flex-end',
68
+ 'center': 'center',
69
+ 'between': 'space-between',
70
+ 'around': 'space-around',
71
+ 'evenly': 'space-evenly'
72
+ };
73
+ styles.justifyContent = justifyMap[props.justify];
74
+ }
75
+ // Map align values
76
+ if (props.align) {
77
+ const alignMap = {
78
+ 'start': 'flex-start',
79
+ 'end': 'flex-end',
80
+ 'center': 'center',
81
+ 'stretch': 'stretch',
82
+ 'baseline': 'baseline'
83
+ };
84
+ styles.alignItems = alignMap[props.align];
85
+ }
86
+ return styles;
87
+ };
88
+ // Utility to convert grid props to CSS
89
+ const getGridStyles = (props) => {
90
+ const styles = {
91
+ display: 'grid'
92
+ };
93
+ if (props.columns) {
94
+ styles.gridTemplateColumns = typeof props.columns === 'number'
95
+ ? `repeat(${props.columns}, 1fr)`
96
+ : props.columns;
97
+ }
98
+ if (props.rows) {
99
+ styles.gridTemplateRows = typeof props.rows === 'number'
100
+ ? `repeat(${props.rows}, 1fr)`
101
+ : props.rows;
102
+ }
103
+ if (props.gap)
104
+ styles.gap = props.gap;
105
+ if (props.columnGap)
106
+ styles.columnGap = props.columnGap;
107
+ if (props.rowGap)
108
+ styles.rowGap = props.rowGap;
109
+ if (props.areas)
110
+ styles.gridTemplateAreas = props.areas;
111
+ if (props.autoFlow)
112
+ styles.gridAutoFlow = props.autoFlow;
113
+ return styles;
114
+ };
115
+ export const Box = ({ children, className, style, as: Component = 'div', display, width, height, minWidth, minHeight, maxWidth, maxHeight, overflow, position, background, border, borderRadius, boxShadow, ...spacingProps }) => {
116
+ const computedStyles = {
117
+ ...getSpacingStyles(spacingProps),
118
+ display,
119
+ width,
120
+ height,
121
+ minWidth,
122
+ minHeight,
123
+ maxWidth,
124
+ maxHeight,
125
+ overflow,
126
+ position,
127
+ background,
128
+ border,
129
+ borderRadius,
130
+ boxShadow,
131
+ ...style
132
+ };
133
+ return React.createElement(Component, {
134
+ className,
135
+ style: computedStyles,
136
+ 'data-helper': 'Box'
137
+ }, children);
138
+ };
139
+ export const Flex = ({ children, className, style, as: Component = 'div', ...props }) => {
140
+ const { direction, justify, align, wrap, gap, flex, ...spacingProps } = props;
141
+ const computedStyles = {
142
+ ...getSpacingStyles(spacingProps),
143
+ ...getFlexStyles({ direction, justify, align, wrap, gap, flex }),
144
+ ...style
145
+ };
146
+ return React.createElement(Component, {
147
+ className,
148
+ style: computedStyles,
149
+ 'data-helper': 'Flex'
150
+ }, children);
151
+ };
152
+ export const Stack = ({ spacing, gap = spacing, ...props }) => {
153
+ return _jsx(Flex, { ...props, direction: "column", gap: gap, "data-helper": "Stack" });
154
+ };
155
+ export const HStack = ({ spacing, gap = spacing, ...props }) => {
156
+ return _jsx(Flex, { ...props, direction: "row", gap: gap, "data-helper": "HStack" });
157
+ };
158
+ export const Grid = ({ children, className, style, as: Component = 'div', columns, rows, gap, columnGap, rowGap, areas, autoFlow, ...spacingProps }) => {
159
+ const computedStyles = {
160
+ ...getSpacingStyles(spacingProps),
161
+ ...getGridStyles({ columns, rows, gap, columnGap, rowGap, areas, autoFlow }),
162
+ ...style
163
+ };
164
+ return React.createElement(Component, {
165
+ className,
166
+ style: computedStyles,
167
+ 'data-helper': 'Grid'
168
+ }, children);
169
+ };
170
+ export const Center = ({ children, className, style, inline, ...spacingProps }) => {
171
+ const computedStyles = {
172
+ ...getSpacingStyles(spacingProps),
173
+ display: inline ? 'inline-flex' : 'flex',
174
+ alignItems: 'center',
175
+ justifyContent: 'center',
176
+ ...style
177
+ };
178
+ return (_jsx("div", { className: className, style: computedStyles, "data-helper": "Center", children: children }));
179
+ };
180
+ export const Container = ({ children, className, style, maxWidth = 'lg', centerContent, ...spacingProps }) => {
181
+ const maxWidthMap = {
182
+ 'sm': '640px',
183
+ 'md': '768px',
184
+ 'lg': '1024px',
185
+ 'xl': '1280px',
186
+ '2xl': '1536px'
187
+ };
188
+ const computedMaxWidth = typeof maxWidth === 'string' && maxWidth in maxWidthMap
189
+ ? maxWidthMap[maxWidth]
190
+ : maxWidth;
191
+ const computedStyles = {
192
+ ...getSpacingStyles(spacingProps),
193
+ width: '100%',
194
+ maxWidth: computedMaxWidth,
195
+ marginLeft: 'auto',
196
+ marginRight: 'auto',
197
+ ...(centerContent && {
198
+ display: 'flex',
199
+ flexDirection: 'column',
200
+ alignItems: 'center',
201
+ justifyContent: 'center'
202
+ }),
203
+ ...style
204
+ };
205
+ return (_jsx("div", { className: className, style: computedStyles, "data-helper": "Container", children: children }));
206
+ };
207
+ export const Spacer = ({ size = '1rem', axis = 'vertical', flex }) => {
208
+ const style = flex
209
+ ? { flex: 1 }
210
+ : axis === 'horizontal'
211
+ ? { width: size }
212
+ : { height: size };
213
+ return _jsx("div", { style: style, "data-helper": "Spacer", "aria-hidden": "true" });
214
+ };
215
+ export const Divider = ({ orientation = 'horizontal', color = '#e5e7eb', thickness = '1px', spacing = '1rem', style }) => {
216
+ const computedStyles = {
217
+ backgroundColor: color,
218
+ ...(orientation === 'horizontal' ? {
219
+ width: '100%',
220
+ height: thickness,
221
+ marginTop: spacing,
222
+ marginBottom: spacing
223
+ } : {
224
+ width: thickness,
225
+ height: '100%',
226
+ marginLeft: spacing,
227
+ marginRight: spacing
228
+ }),
229
+ ...style
230
+ };
231
+ return _jsx("div", { style: computedStyles, "data-helper": "Divider", "aria-hidden": "true" });
232
+ };
233
+ export const AspectRatio = ({ children, className, style, ratio = 1 }) => {
234
+ // Parse ratio string if needed
235
+ const numericRatio = typeof ratio === 'string'
236
+ ? ratio.includes(':')
237
+ ? parseFloat(ratio.split(':')[0]) / parseFloat(ratio.split(':')[1])
238
+ : parseFloat(ratio)
239
+ : ratio;
240
+ const paddingBottom = `${(1 / numericRatio) * 100}%`;
241
+ return (_jsx("div", { className: className, style: {
242
+ position: 'relative',
243
+ width: '100%',
244
+ paddingBottom,
245
+ ...style
246
+ }, "data-helper": "AspectRatio", children: _jsx("div", { style: {
247
+ position: 'absolute',
248
+ top: 0,
249
+ left: 0,
250
+ right: 0,
251
+ bottom: 0
252
+ }, children: children }) }));
253
+ };
254
+ //# sourceMappingURL=LayoutHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutHelpers.js","sourceRo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AC"}
@@ -0,0 +1,3 @@
1
+ export { Box, Flex, Stack, HStack, Grid, Center, Container, Spacer, Divider, AspectRatio } from './LayoutHelpers';
2
+ export type { BoxProps, FlexProps, StackProps, HStackProps, GridContainerProps, CenterProps, ContainerProps, SpacerProps, DividerProps, AspectRatioProps } from './LayoutHelpers';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../playground/components/LayoutHelpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,SAAS,EACT,MAAM,EACN,OAAO,EACP,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,WAAW,EACX,YAAY,EACZ,gBAAgB,EACjB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Box, Flex, Stack, HStack, Grid, Center, Container, Spacer, Divider, AspectRatio } from './LayoutHelpers';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../playground/components/LayoutHelpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,SAAS,EACT,MAAM,EACN,OAAO,EACP,WAAW,EACZ,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Playground - Main component that orchestrates the visual builder
3
+ */
4
+ import React from 'react';
5
+ export interface PlaygroundProps {
6
+ initialMode?: 'ai' | 'edit' | 'code' | 'preview';
7
+ onReady?: () => void;
8
+ }
9
+ export declare const Playground: React.FC<PlaygroundProps>;
10
+ //# sourceMappingURL=Playground.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Playground.d.ts","sourceRoot":"","sources":["../../../../playground/components/Playground/Playground.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AA+BxE,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwShD,CAAC"}
@@ -0,0 +1,128 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Playground - Main component that orchestrates the visual builder
4
+ */
5
+ import { useState, useRef, useEffect, useCallback } from 'react';
6
+ import { DndContext, DragOverlay, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';
7
+ import { sortableKeyboardCoordinates, } from '@dnd-kit/sortable';
8
+ import { Canvas } from '../Canvas/Canvas';
9
+ import { AIAssistant } from '../AIAssistant/AIAssistant';
10
+ import { ComponentPalette } from '../ComponentPalette/ComponentPalette';
11
+ import { PropertiesPanel } from '../PropertiesPanel/PropertiesPanel';
12
+ import { TreeView } from '../TreeView/TreeView';
13
+ import { CodeView } from '../CodeView/CodeView';
14
+ import { ExportDialog } from '../ExportDialog/ExportDialog';
15
+ import { ComponentRenderer } from '../Canvas/ComponentRenderer';
16
+ import { DragDropManager } from '../../services/DragDropManager';
17
+ import { useKeyboardShortcuts } from '../../hooks/useKeyboardShortcuts';
18
+ import styles from './Playground.module.css';
19
+ import { usePlaygroundStore } from '../../store/playgroundStore';
20
+ export const Playground = ({ initialMode = 'ai', onReady }) => {
21
+ const dragDropManagerRef = useRef(null);
22
+ const [exportDialogOpen, setExportDialogOpen] = useState(false);
23
+ const store = usePlaygroundStore();
24
+ const { mode, sidebarTab, setSidebarTab, propertiesPanelOpen, togglePropertiesPanel, canvasZoom, setCanvasZoom, selectedIds, components, draggedItem, selectComponent } = store;
25
+ // Initialize DragDropManager
26
+ useEffect(() => {
27
+ if (!dragDropManagerRef.current) {
28
+ dragDropManagerRef.current = new DragDropManager(store);
29
+ }
30
+ }, [store]);
31
+ // Configure drag sensors
32
+ const sensors = useSensors(useSensor(PointerSensor, {
33
+ activationConstraint: {
34
+ distance: 8,
35
+ },
36
+ }), useSensor(KeyboardSensor, {
37
+ coordinateGetter: sortableKeyboardCoordinates,
38
+ }));
39
+ // Handle drag start
40
+ const handleDragStart = useCallback((event) => {
41
+ const { active } = event;
42
+ // Create dragged item based on what's being dragged
43
+ let draggedItem;
44
+ if (active.data.current?.type === 'component') {
45
+ // Dragging from palette
46
+ draggedItem = {
47
+ type: 'new-component',
48
+ componentType: active.data.current.componentType,
49
+ source: 'palette'
50
+ };
51
+ }
52
+ else if (active.data.current?.type === 'canvas-component') {
53
+ // Dragging existing component
54
+ const component = components.get(active.id);
55
+ if (component) {
56
+ draggedItem = {
57
+ id: component.id,
58
+ type: 'move-component',
59
+ component,
60
+ source: 'canvas'
61
+ };
62
+ }
63
+ else {
64
+ return;
65
+ }
66
+ }
67
+ else {
68
+ return;
69
+ }
70
+ dragDropManagerRef.current?.startDrag(draggedItem);
71
+ }, [components]);
72
+ // Handle drag move
73
+ const handleDragMove = useCallback((event) => {
74
+ const { delta, activatorEvent } = event;
75
+ // dnd-kit supplies the original pointer event on activatorEvent for PointerSensor
76
+ const pointerEvent = activatorEvent?.nativeEvent;
77
+ if (pointerEvent && dragDropManagerRef.current) {
78
+ // Forward to DragDropManager for hit testing
79
+ dragDropManagerRef.current.updateDrag(pointerEvent);
80
+ }
81
+ }, []);
82
+ // Handle drag end
83
+ const handleDragEnd = useCallback((event) => {
84
+ const { active, over } = event;
85
+ if (over && dragDropManagerRef.current) {
86
+ // Perform the drop
87
+ const result = dragDropManagerRef.current.endDrag(over.id);
88
+ if (result?.success) {
89
+ // Select the dropped component
90
+ if (result.componentId) {
91
+ selectComponent(result.componentId);
92
+ }
93
+ else if (active.data.current?.type === 'canvas-component') {
94
+ // Existing component was moved, keep it selected
95
+ selectComponent(active.id);
96
+ }
97
+ }
98
+ }
99
+ else {
100
+ // Cancelled drop
101
+ dragDropManagerRef.current?.cancelDrag();
102
+ }
103
+ }, [selectComponent]);
104
+ // Handle drag cancel
105
+ const handleDragCancel = useCallback((event) => {
106
+ dragDropManagerRef.current?.cancelDrag();
107
+ }, []);
108
+ // Enable keyboard shortcuts
109
+ useKeyboardShortcuts();
110
+ // Get selected component
111
+ const selectedComponent = selectedIds.size === 1
112
+ ? components.get(Array.from(selectedIds)[0])
113
+ : null;
114
+ // Render dragged component overlay
115
+ const renderDragOverlay = () => {
116
+ if (!draggedItem)
117
+ return null;
118
+ if (draggedItem.type === 'move-component' && draggedItem.component) {
119
+ return (_jsx("div", { className: styles.dragGhost, children: _jsx(ComponentRenderer, { component: draggedItem.component, isSelected: false, isHovered: false }) }));
120
+ }
121
+ if (draggedItem.type === 'new-component') {
122
+ return (_jsx("div", { className: styles.dragGhost, children: _jsx("div", { className: styles.newComponentGhost, children: draggedItem.componentType }) }));
123
+ }
124
+ return null;
125
+ };
126
+ return (_jsxs(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragStart: handleDragStart, onDragMove: handleDragMove, onDragEnd: handleDragEnd, onDragCancel: handleDragCancel, children: [_jsxs("div", { className: styles.playground, children: [_jsxs("header", { className: styles.header, children: [_jsx("div", { className: styles.headerLeft, children: _jsx("h1", { className: styles.logo, children: "StoryUI Playground" }) }), _jsx("div", { className: styles.headerCenter, children: _jsxs("div", { className: styles.modeToggle, children: [_jsx("button", { className: `${styles.modeButton} ${mode === 'edit' ? styles.active : ''}`, onClick: () => usePlaygroundStore.getState().setMode('edit'), children: "\u270F\uFE0F Edit" }), _jsx("button", { className: `${styles.modeButton} ${mode === 'preview' ? styles.active : ''}`, onClick: () => usePlaygroundStore.getState().setMode('preview'), children: "\uD83D\uDC41 Preview" }), _jsxs("button", { className: `${styles.modeButton} ${mode === 'code' ? styles.active : ''}`, onClick: () => usePlaygroundStore.getState().setMode('code'), children: ['<>', " Code"] })] }) }), _jsxs("div", { className: styles.headerRight, children: [_jsx("button", { className: styles.exportButton, onClick: () => setExportDialogOpen(true), children: "\uD83D\uDCBE Export" }), _jsxs("div", { className: styles.zoomControls, children: [_jsx("button", { className: styles.zoomButton, onClick: () => setCanvasZoom(canvasZoom - 0.1), disabled: canvasZoom <= 0.25, children: "\u2212" }), _jsxs("span", { className: styles.zoomValue, children: [Math.round(canvasZoom * 100), "%"] }), _jsx("button", { className: styles.zoomButton, onClick: () => setCanvasZoom(canvasZoom + 0.1), disabled: canvasZoom >= 4, children: "+" })] })] })] }), _jsxs("div", { className: styles.main, children: [_jsxs("aside", { className: styles.sidebar, children: [_jsxs("div", { className: styles.sidebarTabs, children: [_jsx("button", { className: `${styles.tab} ${sidebarTab === 'ai' ? styles.activeTab : ''}`, onClick: () => setSidebarTab('ai'), children: "\u2728 AI" }), _jsx("button", { className: `${styles.tab} ${sidebarTab === 'components' ? styles.activeTab : ''}`, onClick: () => setSidebarTab('components'), children: "\uD83E\uDDE9 Components" }), _jsx("button", { className: `${styles.tab} ${sidebarTab === 'structure' ? styles.activeTab : ''}`, onClick: () => setSidebarTab('structure'), children: "\uD83C\uDF33 Structure" })] }), _jsxs("div", { className: styles.sidebarContent, children: [sidebarTab === 'ai' && _jsx(AIAssistant, {}), sidebarTab === 'components' && _jsx(ComponentPalette, {}), sidebarTab === 'structure' && _jsx(TreeView, {})] })] }), _jsx("div", { className: styles.canvasContainer, children: mode === 'code' ? (_jsx(CodeView, { storyName: "PlaygroundStory" })) : (_jsx(Canvas, { onReady: onReady })) }), propertiesPanelOpen && (_jsx("aside", { className: styles.propertiesPanel, children: _jsx(PropertiesPanel, { onClose: togglePropertiesPanel }) }))] }), _jsxs("footer", { className: styles.statusBar, children: [_jsxs("div", { className: styles.statusItem, children: ["\uD83D\uDCE6 ", components.size, " components"] }), _jsxs("div", { className: styles.statusItem, children: ["\u2705 ", selectedIds.size, " selected"] }), _jsxs("div", { className: styles.statusItem, children: ["Mode: ", mode] })] }), _jsx(ExportDialog, { isOpen: exportDialogOpen, onClose: () => setExportDialogOpen(false) })] }), _jsx(DragOverlay, { children: renderDragOverlay() })] }));
127
+ };
128
+ //# sourceMappingURL=Playground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Playground.js","sourceRoot":"","sources":["../../../../playground/components/Playground/Playground.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,SAAS,EACT,UAAU,EAKX,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAQjE,MAAM,CAAC,MAAM,UAAU,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