@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.
- package/dist/cli/index.js +0 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cloudflare-edge/src/mcp-session.js +462 -0
- package/dist/cloudflare-edge/src/types.js +4 -0
- package/dist/cloudflare-edge/src/worker.js +106 -0
- package/dist/cloudflare-pages/vite.config.js +14 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/index.js.map +1 -0
- package/dist/mcp-server/mcp-stdio-server.js.map +1 -0
- package/dist/mcp-server/routes/claude.js.map +1 -0
- package/dist/mcp-server/routes/components.js.map +1 -0
- package/dist/mcp-server/routes/generateStory.js.map +1 -0
- package/dist/mcp-server/routes/hybridStories.d.ts +18 -0
- package/dist/mcp-server/routes/hybridStories.d.ts.map +1 -0
- package/dist/mcp-server/routes/hybridStories.js +216 -0
- package/dist/mcp-server/routes/hybridStories.js.map +1 -0
- package/dist/mcp-server/routes/memoryStories.d.ts +26 -0
- package/dist/mcp-server/routes/memoryStories.d.ts.map +1 -0
- package/dist/mcp-server/routes/memoryStories.js +158 -0
- package/dist/mcp-server/routes/memoryStories.js.map +1 -0
- package/dist/mcp-server/routes/storySync.d.ts +26 -0
- package/dist/mcp-server/routes/storySync.d.ts.map +1 -0
- package/dist/mcp-server/routes/storySync.js +147 -0
- package/dist/mcp-server/routes/storySync.js.map +1 -0
- package/dist/mcp-server/routes/updateStory.js +246 -0
- package/dist/mcp-server/sessionManager.d.ts +50 -0
- package/dist/mcp-server/sessionManager.d.ts.map +1 -0
- package/dist/mcp-server/sessionManager.js +125 -0
- package/dist/mcp-server/sessionManager.js.map +1 -0
- package/dist/playground/components/AIAssistant/AIAssistant.d.ts +6 -0
- package/dist/playground/components/AIAssistant/AIAssistant.d.ts.map +1 -0
- package/dist/playground/components/AIAssistant/AIAssistant.js +109 -0
- package/dist/playground/components/AIAssistant/AIAssistant.js.map +1 -0
- package/dist/playground/components/AIAssistant/AIAssistant.module.css +166 -0
- package/dist/playground/components/Canvas/Canvas.d.ts +9 -0
- package/dist/playground/components/Canvas/Canvas.d.ts.map +1 -0
- package/dist/playground/components/Canvas/Canvas.js +58 -0
- package/dist/playground/components/Canvas/Canvas.js.map +1 -0
- package/dist/playground/components/Canvas/Canvas.module.css +189 -0
- package/dist/playground/components/Canvas/CanvasWithDnd.d.ts +9 -0
- package/dist/playground/components/Canvas/CanvasWithDnd.d.ts.map +1 -0
- package/dist/playground/components/Canvas/CanvasWithDnd.js +158 -0
- package/dist/playground/components/Canvas/CanvasWithDnd.js.map +1 -0
- package/dist/playground/components/Canvas/ComponentRenderer.d.ts +15 -0
- package/dist/playground/components/Canvas/ComponentRenderer.d.ts.map +1 -0
- package/dist/playground/components/Canvas/ComponentRenderer.js +177 -0
- package/dist/playground/components/Canvas/ComponentRenderer.js.map +1 -0
- package/dist/playground/components/Canvas/DraggableComponent.d.ts +15 -0
- package/dist/playground/components/Canvas/DraggableComponent.d.ts.map +1 -0
- package/dist/playground/components/Canvas/DraggableComponent.js +49 -0
- package/dist/playground/components/Canvas/DraggableComponent.js.map +1 -0
- package/dist/playground/components/Canvas/index.d.ts +9 -0
- package/dist/playground/components/Canvas/index.d.ts.map +1 -0
- package/dist/playground/components/Canvas/index.js +5 -0
- package/dist/playground/components/Canvas/index.js.map +1 -0
- package/dist/playground/components/CodeView/CodeView.d.ts +12 -0
- package/dist/playground/components/CodeView/CodeView.d.ts.map +1 -0
- package/dist/playground/components/CodeView/CodeView.js +77 -0
- package/dist/playground/components/CodeView/CodeView.js.map +1 -0
- package/dist/playground/components/CodeView/CodeView.module.css +178 -0
- package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts +17 -0
- package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts.map +1 -0
- package/dist/playground/components/ComponentPalette/ComponentPalette.js +138 -0
- package/dist/playground/components/ComponentPalette/ComponentPalette.js.map +1 -0
- package/dist/playground/components/ComponentPalette/ComponentPalette.module.css +217 -0
- package/dist/playground/components/ComponentPalette/index.d.ts +3 -0
- package/dist/playground/components/ComponentPalette/index.d.ts.map +1 -0
- package/dist/playground/components/ComponentPalette/index.js +2 -0
- package/dist/playground/components/ComponentPalette/index.js.map +1 -0
- package/dist/playground/components/DropZone/DropZone.d.ts +17 -0
- package/dist/playground/components/DropZone/DropZone.d.ts.map +1 -0
- package/dist/playground/components/DropZone/DropZone.js +73 -0
- package/dist/playground/components/DropZone/DropZone.js.map +1 -0
- package/dist/playground/components/DropZone/DropZone.module.css +86 -0
- package/dist/playground/components/ExportDialog/ExportDialog.d.ts +10 -0
- package/dist/playground/components/ExportDialog/ExportDialog.d.ts.map +1 -0
- package/dist/playground/components/ExportDialog/ExportDialog.js +57 -0
- package/dist/playground/components/ExportDialog/ExportDialog.js.map +1 -0
- package/dist/playground/components/ExportDialog/ExportDialog.module.css +328 -0
- package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts +134 -0
- package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts.map +1 -0
- package/dist/playground/components/LayoutHelpers/LayoutHelpers.js +254 -0
- package/dist/playground/components/LayoutHelpers/LayoutHelpers.js.map +1 -0
- package/dist/playground/components/LayoutHelpers/index.d.ts +3 -0
- package/dist/playground/components/LayoutHelpers/index.d.ts.map +1 -0
- package/dist/playground/components/LayoutHelpers/index.js +2 -0
- package/dist/playground/components/LayoutHelpers/index.js.map +1 -0
- package/dist/playground/components/Playground/Playground.d.ts +10 -0
- package/dist/playground/components/Playground/Playground.d.ts.map +1 -0
- package/dist/playground/components/Playground/Playground.js +128 -0
- package/dist/playground/components/Playground/Playground.js.map +1 -0
- package/dist/playground/components/Playground/Playground.module.css +308 -0
- package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts +10 -0
- package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts.map +1 -0
- package/dist/playground/components/PropertiesPanel/PropertiesPanel.js +150 -0
- package/dist/playground/components/PropertiesPanel/PropertiesPanel.js.map +1 -0
- package/dist/playground/components/PropertiesPanel/PropertiesPanel.module.css +155 -0
- package/dist/playground/components/PropertiesPanel/index.d.ts +3 -0
- package/dist/playground/components/PropertiesPanel/index.d.ts.map +1 -0
- package/dist/playground/components/PropertiesPanel/index.js +2 -0
- package/dist/playground/components/PropertiesPanel/index.js.map +1 -0
- package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts +12 -0
- package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts.map +1 -0
- package/dist/playground/components/PropertyEditors/BooleanEditor.js +14 -0
- package/dist/playground/components/PropertyEditors/BooleanEditor.js.map +1 -0
- package/dist/playground/components/PropertyEditors/ColorEditor.d.ts +12 -0
- package/dist/playground/components/PropertyEditors/ColorEditor.d.ts.map +1 -0
- package/dist/playground/components/PropertyEditors/ColorEditor.js +62 -0
- package/dist/playground/components/PropertyEditors/ColorEditor.js.map +1 -0
- package/dist/playground/components/PropertyEditors/IconEditor.d.ts +12 -0
- package/dist/playground/components/PropertyEditors/IconEditor.d.ts.map +1 -0
- package/dist/playground/components/PropertyEditors/IconEditor.js +123 -0
- package/dist/playground/components/PropertyEditors/IconEditor.js.map +1 -0
- package/dist/playground/components/PropertyEditors/NumberEditor.d.ts +15 -0
- package/dist/playground/components/PropertyEditors/NumberEditor.d.ts.map +1 -0
- package/dist/playground/components/PropertyEditors/NumberEditor.js +46 -0
- package/dist/playground/components/PropertyEditors/NumberEditor.js.map +1 -0
- package/dist/playground/components/PropertyEditors/PropertyEditors.module.css +432 -0
- package/dist/playground/components/PropertyEditors/SelectEditor.d.ts +19 -0
- package/dist/playground/components/PropertyEditors/SelectEditor.d.ts.map +1 -0
- package/dist/playground/components/PropertyEditors/SelectEditor.js +17 -0
- package/dist/playground/components/PropertyEditors/SelectEditor.js.map +1 -0
- package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts +19 -0
- package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts.map +1 -0
- package/dist/playground/components/PropertyEditors/SpacingEditor.js +162 -0
- package/dist/playground/components/PropertyEditors/SpacingEditor.js.map +1 -0
- package/dist/playground/components/PropertyEditors/SpacingEditor.module.css +214 -0
- package/dist/playground/components/PropertyEditors/TextEditor.d.ts +14 -0
- package/dist/playground/components/PropertyEditors/TextEditor.d.ts.map +1 -0
- package/dist/playground/components/PropertyEditors/TextEditor.js +38 -0
- package/dist/playground/components/PropertyEditors/TextEditor.js.map +1 -0
- package/dist/playground/components/PropertyEditors/TokenEditor.d.ts +23 -0
- package/dist/playground/components/PropertyEditors/TokenEditor.d.ts.map +1 -0
- package/dist/playground/components/PropertyEditors/TokenEditor.js +50 -0
- package/dist/playground/components/PropertyEditors/TokenEditor.js.map +1 -0
- package/dist/playground/components/PropertyEditors/index.d.ts +20 -0
- package/dist/playground/components/PropertyEditors/index.d.ts.map +1 -0
- package/dist/playground/components/PropertyEditors/index.js +12 -0
- package/dist/playground/components/PropertyEditors/index.js.map +1 -0
- package/dist/playground/components/TreeView/TreeView.d.ts +10 -0
- package/dist/playground/components/TreeView/TreeView.d.ts.map +1 -0
- package/dist/playground/components/TreeView/TreeView.js +146 -0
- package/dist/playground/components/TreeView/TreeView.js.map +1 -0
- package/dist/playground/components/TreeView/TreeView.module.css +214 -0
- package/dist/playground/components/TreeView/index.d.ts +3 -0
- package/dist/playground/components/TreeView/index.d.ts.map +1 -0
- package/dist/playground/components/TreeView/index.js +2 -0
- package/dist/playground/components/TreeView/index.js.map +1 -0
- package/dist/playground/config/propertyDefinitions.d.ts +73 -0
- package/dist/playground/config/propertyDefinitions.d.ts.map +1 -0
- package/dist/playground/config/propertyDefinitions.js +809 -0
- package/dist/playground/config/propertyDefinitions.js.map +1 -0
- package/dist/playground/hooks/useKeyboardShortcuts.d.ts +38 -0
- package/dist/playground/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/playground/hooks/useKeyboardShortcuts.js +191 -0
- package/dist/playground/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/playground/index.d.ts +21 -0
- package/dist/playground/index.d.ts.map +1 -0
- package/dist/playground/index.js +23 -0
- package/dist/playground/index.js.map +1 -0
- package/dist/playground/services/CodeGenerator.d.ts +73 -0
- package/dist/playground/services/CodeGenerator.d.ts.map +1 -0
- package/dist/playground/services/CodeGenerator.js +359 -0
- package/dist/playground/services/CodeGenerator.js.map +1 -0
- package/dist/playground/services/DragDropManager.d.ts +95 -0
- package/dist/playground/services/DragDropManager.d.ts.map +1 -0
- package/dist/playground/services/DragDropManager.js +408 -0
- package/dist/playground/services/DragDropManager.js.map +1 -0
- package/dist/playground/services/StoryParser.d.ts +73 -0
- package/dist/playground/services/StoryParser.d.ts.map +1 -0
- package/dist/playground/services/StoryParser.js +419 -0
- package/dist/playground/services/StoryParser.js.map +1 -0
- package/dist/playground/store/playgroundStore.d.ts +86 -0
- package/dist/playground/store/playgroundStore.d.ts.map +1 -0
- package/dist/playground/store/playgroundStore.js +337 -0
- package/dist/playground/store/playgroundStore.js.map +1 -0
- package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts +13 -0
- package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts.map +1 -0
- package/dist/playground/stories/PlaygroundDragDrop.stories.js +227 -0
- package/dist/playground/stories/PlaygroundDragDrop.stories.js.map +1 -0
- package/dist/playground/stories/PlaygroundPhase4.stories.d.ts +13 -0
- package/dist/playground/stories/PlaygroundPhase4.stories.d.ts.map +1 -0
- package/dist/playground/stories/PlaygroundPhase4.stories.js +334 -0
- package/dist/playground/stories/PlaygroundPhase4.stories.js.map +1 -0
- package/dist/playground/stories/PlaygroundPhase5.stories.d.ts +14 -0
- package/dist/playground/stories/PlaygroundPhase5.stories.d.ts.map +1 -0
- package/dist/playground/stories/PlaygroundPhase5.stories.js +512 -0
- package/dist/playground/stories/PlaygroundPhase5.stories.js.map +1 -0
- package/dist/playground/stories/PlaygroundProperties.stories.d.ts +13 -0
- package/dist/playground/stories/PlaygroundProperties.stories.d.ts.map +1 -0
- package/dist/playground/stories/PlaygroundProperties.stories.js +342 -0
- package/dist/playground/stories/PlaygroundProperties.stories.js.map +1 -0
- package/dist/playground/types/index.d.ts +251 -0
- package/dist/playground/types/index.d.ts.map +1 -0
- package/dist/playground/types/index.js +5 -0
- package/dist/playground/types/index.js.map +1 -0
- package/dist/scripts/verify-framework-adapters.js +105 -0
- package/dist/story-generator/componentBlacklist.js.map +1 -0
- package/dist/story-generator/componentDiscovery.js.map +1 -0
- package/dist/story-generator/configLoader.js.map +1 -0
- package/dist/story-generator/considerationsLoader.js.map +1 -0
- package/dist/story-generator/documentation-sources.js.map +1 -0
- package/dist/story-generator/documentationLoader.js.map +1 -0
- package/dist/story-generator/dynamicPackageDiscovery.js.map +1 -0
- package/dist/story-generator/enhancedComponentDiscovery.js.map +1 -0
- package/dist/story-generator/generateStory.js.map +1 -0
- package/dist/story-generator/gitignoreManager.js.map +1 -0
- package/dist/story-generator/inMemoryStoryService.d.ts +89 -0
- package/dist/story-generator/inMemoryStoryService.d.ts.map +1 -0
- package/dist/story-generator/inMemoryStoryService.js +128 -0
- package/dist/story-generator/inMemoryStoryService.js.map +1 -0
- package/dist/story-generator/logger.js.map +1 -0
- package/dist/story-generator/postProcessStory.js.map +1 -0
- package/dist/story-generator/postgresStoryService.d.ts +56 -0
- package/dist/story-generator/postgresStoryService.d.ts.map +1 -0
- package/dist/story-generator/postgresStoryService.js +240 -0
- package/dist/story-generator/productionGitignoreManager.d.ts +91 -0
- package/dist/story-generator/productionGitignoreManager.d.ts.map +1 -0
- package/dist/story-generator/productionGitignoreManager.js +340 -0
- package/dist/story-generator/productionGitignoreManager.js.map +1 -0
- package/dist/story-generator/promptGenerator.js.map +1 -0
- package/dist/story-generator/providerPresets.d.ts +54 -0
- package/dist/story-generator/providerPresets.d.ts.map +1 -0
- package/dist/story-generator/providerPresets.js +214 -0
- package/dist/story-generator/storyHistory.js.map +1 -0
- package/dist/story-generator/storyServiceFactory.d.ts +22 -0
- package/dist/story-generator/storyServiceFactory.d.ts.map +1 -0
- package/dist/story-generator/storyServiceFactory.js +97 -0
- package/dist/story-generator/storyServiceInterface.d.ts +85 -0
- package/dist/story-generator/storyServiceInterface.d.ts.map +1 -0
- package/dist/story-generator/storyServiceInterface.js +5 -0
- package/dist/story-generator/storySync.d.ts +68 -0
- package/dist/story-generator/storySync.d.ts.map +1 -0
- package/dist/story-generator/storySync.js +201 -0
- package/dist/story-generator/storySync.js.map +1 -0
- package/dist/story-generator/storyTracker.js.map +1 -0
- package/dist/story-generator/storyValidator.js.map +1 -0
- package/dist/story-generator/test_validation.d.ts +2 -0
- package/dist/story-generator/test_validation.d.ts.map +1 -0
- package/dist/story-generator/test_validation.js +51 -0
- package/dist/story-generator/universalDesignSystemAdapter.js.map +1 -0
- package/dist/story-generator/urlRedirectService.js.map +1 -0
- package/dist/story-generator/validateStory.js.map +1 -0
- package/dist/story-ui.config.js.map +1 -0
- package/dist/story-ui.config.loader.d.ts +36 -0
- package/dist/story-ui.config.loader.d.ts.map +1 -0
- package/dist/story-ui.config.loader.js +205 -0
- package/dist/story-ui.config.loader.js.map +1 -0
- package/dist/temp/package/templates/StoryUI/StoryUIPanel.js +807 -0
- package/dist/temp/package/templates/StoryUI/StoryUIPanel.stories.js +37 -0
- package/dist/temp/package/templates/StoryUI/index.js +2 -0
- package/dist/templates/StoryUI/StoryUIPanel.js.map +1 -0
- package/dist/templates/StoryUI/StoryUIPanel.stories.js.map +1 -0
- package/dist/templates/StoryUI/index.js.map +1 -0
- package/dist/templates/StoryUI/manager.d.ts +14 -0
- package/dist/templates/StoryUI/manager.d.ts.map +1 -0
- package/dist/templates/production-app/src/App.d.ts +10 -0
- package/dist/templates/production-app/src/App.d.ts.map +1 -0
- package/dist/templates/production-app/src/App.js +653 -0
- package/dist/templates/production-app/src/LivePreviewRenderer.d.ts +24 -0
- package/dist/templates/production-app/src/LivePreviewRenderer.d.ts.map +1 -0
- package/dist/templates/production-app/src/LivePreviewRenderer.js +199 -0
- package/dist/templates/production-app/src/componentRegistry.d.ts +20 -0
- package/dist/templates/production-app/src/componentRegistry.d.ts.map +1 -0
- package/dist/templates/production-app/src/componentRegistry.js +316 -0
- package/dist/templates/production-app/src/main.d.ts +9 -0
- package/dist/templates/production-app/src/main.d.ts.map +1 -0
- package/dist/templates/production-app/src/main.js +18 -0
- package/dist/templates/production-app/vite.config.d.ts +3 -0
- package/dist/templates/production-app/vite.config.d.ts.map +1 -0
- package/dist/templates/production-app/vite.config.js +71 -0
- package/dist/test-storybooks/angular-material-storybook/src/main.js +66 -0
- package/dist/test-storybooks/chakra-storybook/vite.config.js +6 -0
- package/dist/test-storybooks/mantine-storybook/vite.config.js +93 -0
- package/dist/test-storybooks/web-components-shoelace/vite.config.js +9 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* CanvasWithDnd - Canvas with drag and drop support
|
|
4
|
+
*/
|
|
5
|
+
import { useEffect, useRef, 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 { usePlaygroundStore } from '../../store/playgroundStore';
|
|
9
|
+
import { DragDropManager } from '../../services/DragDropManager';
|
|
10
|
+
import { ComponentRenderer } from './ComponentRenderer';
|
|
11
|
+
import { DropZone } from '../DropZone/DropZone';
|
|
12
|
+
import { DraggableComponent } from './DraggableComponent';
|
|
13
|
+
import styles from './Canvas.module.css';
|
|
14
|
+
export const CanvasWithDnd = ({ onReady }) => {
|
|
15
|
+
const canvasRef = useRef(null);
|
|
16
|
+
const dragDropManagerRef = useRef(null);
|
|
17
|
+
const store = usePlaygroundStore();
|
|
18
|
+
const { components, rootId, selectedIds, hoveredId, canvasZoom, canvasOffset, showGrid, gridSize, mode, draggedItem, selectComponent, deselectAll, setHoveredComponent } = store;
|
|
19
|
+
// Initialize DragDropManager
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!dragDropManagerRef.current) {
|
|
22
|
+
dragDropManagerRef.current = new DragDropManager(store);
|
|
23
|
+
}
|
|
24
|
+
}, [store]);
|
|
25
|
+
// Configure drag sensors
|
|
26
|
+
const sensors = useSensors(useSensor(PointerSensor, {
|
|
27
|
+
activationConstraint: {
|
|
28
|
+
distance: 8,
|
|
29
|
+
},
|
|
30
|
+
}), useSensor(KeyboardSensor, {
|
|
31
|
+
coordinateGetter: sortableKeyboardCoordinates,
|
|
32
|
+
}));
|
|
33
|
+
// Handle drag start
|
|
34
|
+
const handleDragStart = useCallback((event) => {
|
|
35
|
+
const { active } = event;
|
|
36
|
+
// Create dragged item based on what's being dragged
|
|
37
|
+
let draggedItem;
|
|
38
|
+
if (active.data.current?.type === 'component') {
|
|
39
|
+
// Dragging from palette
|
|
40
|
+
draggedItem = {
|
|
41
|
+
type: 'new-component',
|
|
42
|
+
componentType: active.data.current.componentType,
|
|
43
|
+
source: 'palette'
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
else if (active.data.current?.type === 'canvas-component') {
|
|
47
|
+
// Dragging existing component
|
|
48
|
+
const component = components.get(active.id);
|
|
49
|
+
if (component) {
|
|
50
|
+
draggedItem = {
|
|
51
|
+
id: component.id,
|
|
52
|
+
type: 'move-component',
|
|
53
|
+
component,
|
|
54
|
+
source: 'canvas'
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
dragDropManagerRef.current?.startDrag(draggedItem);
|
|
65
|
+
}, [components]);
|
|
66
|
+
// Handle drag move
|
|
67
|
+
const handleDragMove = useCallback((event) => {
|
|
68
|
+
// Update drag position for drop zone detection
|
|
69
|
+
// This would be enhanced with actual mouse position tracking
|
|
70
|
+
}, []);
|
|
71
|
+
// Handle drag end
|
|
72
|
+
const handleDragEnd = useCallback((event) => {
|
|
73
|
+
const { active, over } = event;
|
|
74
|
+
if (over && dragDropManagerRef.current) {
|
|
75
|
+
// Perform the drop
|
|
76
|
+
const result = dragDropManagerRef.current.endDrag();
|
|
77
|
+
if (result?.success) {
|
|
78
|
+
// Select the dropped component
|
|
79
|
+
if (active.data.current?.type === 'component') {
|
|
80
|
+
// New component was created, select it
|
|
81
|
+
// We'd need to track the created component ID
|
|
82
|
+
}
|
|
83
|
+
else if (active.data.current?.type === 'canvas-component') {
|
|
84
|
+
// Existing component was moved, keep it selected
|
|
85
|
+
selectComponent(active.id);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
// Cancelled drop
|
|
91
|
+
dragDropManagerRef.current?.cancelDrag();
|
|
92
|
+
}
|
|
93
|
+
}, [selectComponent]);
|
|
94
|
+
// Handle drag cancel
|
|
95
|
+
const handleDragCancel = useCallback((event) => {
|
|
96
|
+
dragDropManagerRef.current?.cancelDrag();
|
|
97
|
+
}, []);
|
|
98
|
+
// Handle canvas click for deselection
|
|
99
|
+
const handleCanvasClick = useCallback((e) => {
|
|
100
|
+
if (e.target === e.currentTarget) {
|
|
101
|
+
deselectAll();
|
|
102
|
+
}
|
|
103
|
+
}, [deselectAll]);
|
|
104
|
+
// Handle keyboard shortcuts
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const handleKeyDown = (e) => {
|
|
107
|
+
// Delete selected components
|
|
108
|
+
if ((e.key === 'Delete' || e.key === 'Backspace') && selectedIds.size > 0) {
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
selectedIds.forEach(id => {
|
|
111
|
+
if (id !== rootId) {
|
|
112
|
+
store.deleteComponent(id);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
// Select all
|
|
117
|
+
if (e.metaKey && e.key === 'a') {
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
store.selectAll();
|
|
120
|
+
}
|
|
121
|
+
// Deselect all
|
|
122
|
+
if (e.key === 'Escape') {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
deselectAll();
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
128
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
129
|
+
}, [selectedIds, rootId, deselectAll, store]);
|
|
130
|
+
// Notify when ready
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
onReady?.();
|
|
133
|
+
}, [onReady]);
|
|
134
|
+
// Get root component
|
|
135
|
+
const rootComponent = components.get(rootId);
|
|
136
|
+
if (!rootComponent) {
|
|
137
|
+
return (_jsx("div", { className: styles.canvas, children: _jsxs("div", { className: styles.emptyState, children: [_jsx("p", { children: "No components to display" }), _jsx("p", { className: styles.hint, children: "Use the AI Assistant to generate a layout or drag components from the palette" })] }) }));
|
|
138
|
+
}
|
|
139
|
+
// Render dragged component overlay
|
|
140
|
+
const renderDragOverlay = () => {
|
|
141
|
+
if (!draggedItem)
|
|
142
|
+
return null;
|
|
143
|
+
if (draggedItem.type === 'move-component' && draggedItem.component) {
|
|
144
|
+
return (_jsx("div", { className: styles.dragGhost, children: _jsx(ComponentRenderer, { component: draggedItem.component, isSelected: false, isHovered: false }) }));
|
|
145
|
+
}
|
|
146
|
+
if (draggedItem.type === 'new-component') {
|
|
147
|
+
return (_jsx("div", { className: styles.dragGhost, children: _jsx("div", { className: styles.newComponentGhost, children: draggedItem.componentType }) }));
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
};
|
|
151
|
+
return (_jsxs(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragStart: handleDragStart, onDragMove: handleDragMove, onDragEnd: handleDragEnd, onDragCancel: handleDragCancel, children: [_jsx("div", { ref: canvasRef, className: styles.canvas, onClick: handleCanvasClick, "data-mode": mode, children: _jsxs("div", { className: styles.viewport, style: {
|
|
152
|
+
transform: `scale(${canvasZoom}) translate(${canvasOffset.x}px, ${canvasOffset.y}px)`,
|
|
153
|
+
transformOrigin: 'center center'
|
|
154
|
+
}, children: [showGrid && (_jsx("div", { className: styles.grid, style: {
|
|
155
|
+
backgroundSize: `${gridSize}px ${gridSize}px`
|
|
156
|
+
} })), _jsx("div", { className: styles.componentContainer, children: _jsx(DropZone, { id: "root-drop-zone", componentId: rootId, accepts: ['all'], showIndicator: mode === 'edit', children: _jsx(DraggableComponent, { component: rootComponent, isRoot: true, isSelected: selectedIds.has(rootId), isHovered: hoveredId === rootId, onSelect: (id) => selectComponent(id), onHover: (id) => setHoveredComponent(id) }) }) }), selectedIds.size > 0 && (_jsx("div", { className: styles.selectionOverlay }))] }) }), _jsx(DragOverlay, { children: renderDragOverlay() })] }));
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=CanvasWithDnd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasWithDnd.js","sourceRoot":"","sources":["../../../../playground/components/Canvas/CanvasWithDnd.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAW,MAAM,OAAO,CAAC;AACvE,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,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,s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AAkB,IACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,IAAI,EACZ,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EACnC,SAAS,EAAE,SAAS,KAAK,MAAM,EAC/B,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,EACrC,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC,GACxC,GACO,GACP,EAGL,WAAW,CAAC,IAAI,GAAG,CAAC,IAAI,CACvB,cAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,GAEjC,CACP,IACG,GACF,EAGN,KAAC,WAAW,cACT,iBAAiB,EAAE,GACR,IACH,CACd,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ComponentRenderer - Renders playground components recursively
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { PlaygroundComponent } from '../../types';
|
|
6
|
+
export interface ComponentRendererProps {
|
|
7
|
+
component: PlaygroundComponent;
|
|
8
|
+
isRoot?: boolean;
|
|
9
|
+
isSelected?: boolean;
|
|
10
|
+
isHovered?: boolean;
|
|
11
|
+
onSelect?: (id: string) => void;
|
|
12
|
+
onHover?: (id: string | null) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ComponentRenderer: React.FC<ComponentRendererProps>;
|
|
15
|
+
//# sourceMappingURL=ComponentRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentRenderer.d.ts","sourceRoot":"","sources":["../../../../playground/components/Canvas/ComponentRenderer.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmS9D,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* ComponentRenderer - Renders playground components recursively
|
|
4
|
+
*/
|
|
5
|
+
import { useMemo, useCallback } from 'react';
|
|
6
|
+
import { usePlaygroundStore } from '../../store/playgroundStore';
|
|
7
|
+
import styles from './Canvas.module.css';
|
|
8
|
+
export const ComponentRenderer = ({ component, isRoot = false, isSelected = false, isHovered = false, onSelect, onHover }) => {
|
|
9
|
+
const { components } = usePlaygroundStore();
|
|
10
|
+
// Handle component click
|
|
11
|
+
const handleClick = useCallback((e) => {
|
|
12
|
+
e.stopPropagation();
|
|
13
|
+
onSelect?.(component.id);
|
|
14
|
+
}, [component.id, onSelect]);
|
|
15
|
+
// Handle hover
|
|
16
|
+
const handleMouseEnter = useCallback(() => {
|
|
17
|
+
onHover?.(component.id);
|
|
18
|
+
}, [component.id, onHover]);
|
|
19
|
+
const handleMouseLeave = useCallback(() => {
|
|
20
|
+
onHover?.(null);
|
|
21
|
+
}, [onHover]);
|
|
22
|
+
// Combine styles with font inheritance
|
|
23
|
+
const combinedStyles = useMemo(() => ({
|
|
24
|
+
fontFamily: 'inherit',
|
|
25
|
+
...component.style,
|
|
26
|
+
...(isRoot ? { minHeight: '100vh', width: '100%' } : {})
|
|
27
|
+
}), [component.style, isRoot]);
|
|
28
|
+
// Render based on component type
|
|
29
|
+
const renderComponent = () => {
|
|
30
|
+
// Handle text nodes
|
|
31
|
+
if (component.type === 'Text') {
|
|
32
|
+
return _jsx("span", { children: component.textContent });
|
|
33
|
+
}
|
|
34
|
+
// Handle layout helper components
|
|
35
|
+
if (component.isHelper) {
|
|
36
|
+
return renderHelperComponent();
|
|
37
|
+
}
|
|
38
|
+
// For now, render as a div with placeholder
|
|
39
|
+
// In production, this would dynamically load the actual component
|
|
40
|
+
return renderPlaceholderComponent();
|
|
41
|
+
};
|
|
42
|
+
// Render helper components (FlexContainer, GridContainer, etc.)
|
|
43
|
+
const renderHelperComponent = () => {
|
|
44
|
+
const { type, props, children } = component;
|
|
45
|
+
switch (type) {
|
|
46
|
+
case 'FlexContainer':
|
|
47
|
+
return (_jsx("div", { style: {
|
|
48
|
+
display: 'flex',
|
|
49
|
+
flexDirection: props.direction || 'row',
|
|
50
|
+
justifyContent: props.justify || 'flex-start',
|
|
51
|
+
alignItems: props.align || 'stretch',
|
|
52
|
+
gap: props.gap ? `${props.gap}px` : undefined,
|
|
53
|
+
flexWrap: props.wrap || 'nowrap',
|
|
54
|
+
...combinedStyles
|
|
55
|
+
}, "data-helper": "flex", children: renderChildren() }));
|
|
56
|
+
case 'GridContainer':
|
|
57
|
+
return (_jsx("div", { style: {
|
|
58
|
+
display: 'grid',
|
|
59
|
+
gridTemplateColumns: props.columns || 'auto',
|
|
60
|
+
gridTemplateRows: props.rows || 'auto',
|
|
61
|
+
gap: props.gap ? `${props.gap}px` : undefined,
|
|
62
|
+
...combinedStyles
|
|
63
|
+
}, "data-helper": "grid", children: renderChildren() }));
|
|
64
|
+
case 'Spacer':
|
|
65
|
+
return (_jsx("div", { style: {
|
|
66
|
+
width: props.width || 'auto',
|
|
67
|
+
height: props.height || '16px',
|
|
68
|
+
...combinedStyles
|
|
69
|
+
}, "data-helper": "spacer" }));
|
|
70
|
+
default:
|
|
71
|
+
return renderPlaceholderComponent();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
// Render placeholder for actual components
|
|
75
|
+
const renderPlaceholderComponent = () => {
|
|
76
|
+
const { type, props, children } = component;
|
|
77
|
+
// Common component rendering
|
|
78
|
+
switch (type) {
|
|
79
|
+
case 'Container':
|
|
80
|
+
case 'Box':
|
|
81
|
+
case 'div':
|
|
82
|
+
return (_jsx("div", { style: combinedStyles, ...props, children: renderChildren() }));
|
|
83
|
+
case 'Button':
|
|
84
|
+
return (_jsx("button", { style: {
|
|
85
|
+
fontFamily: 'inherit',
|
|
86
|
+
border: '1px solid #d1d5db',
|
|
87
|
+
borderRadius: '6px',
|
|
88
|
+
padding: '8px 16px',
|
|
89
|
+
backgroundColor: '#3b82f6',
|
|
90
|
+
color: 'white',
|
|
91
|
+
cursor: 'pointer',
|
|
92
|
+
...combinedStyles
|
|
93
|
+
}, ...props, disabled: props.disabled || false, children: props.children || props.text || 'Button' }));
|
|
94
|
+
case 'Card':
|
|
95
|
+
return (_jsxs("div", { style: {
|
|
96
|
+
padding: '16px',
|
|
97
|
+
borderRadius: '8px',
|
|
98
|
+
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
99
|
+
backgroundColor: 'white',
|
|
100
|
+
...combinedStyles
|
|
101
|
+
}, ...props, children: [props.title && _jsx("h3", { children: props.title }), props.children || renderChildren()] }));
|
|
102
|
+
case 'Input':
|
|
103
|
+
return (_jsx("input", { type: props.type || 'text', placeholder: props.placeholder, value: props.value || '', style: {
|
|
104
|
+
fontFamily: 'inherit',
|
|
105
|
+
border: '1px solid #d1d5db',
|
|
106
|
+
borderRadius: '4px',
|
|
107
|
+
padding: '8px 12px',
|
|
108
|
+
fontSize: '14px',
|
|
109
|
+
...combinedStyles
|
|
110
|
+
}, ...props, readOnly: true }));
|
|
111
|
+
case 'Text':
|
|
112
|
+
case 'Typography':
|
|
113
|
+
case 'p':
|
|
114
|
+
return (_jsx("p", { style: {
|
|
115
|
+
fontFamily: 'inherit',
|
|
116
|
+
margin: '0',
|
|
117
|
+
...combinedStyles
|
|
118
|
+
}, ...props, children: props.children || component.textContent }));
|
|
119
|
+
case 'Heading':
|
|
120
|
+
case 'h1':
|
|
121
|
+
return (_jsx("h1", { style: {
|
|
122
|
+
fontFamily: 'inherit',
|
|
123
|
+
margin: '0 0 16px 0',
|
|
124
|
+
fontSize: '2rem',
|
|
125
|
+
fontWeight: 'bold',
|
|
126
|
+
...combinedStyles
|
|
127
|
+
}, ...props, children: props.children || component.textContent }));
|
|
128
|
+
case 'h2':
|
|
129
|
+
return (_jsx("h2", { style: {
|
|
130
|
+
fontFamily: 'inherit',
|
|
131
|
+
margin: '0 0 14px 0',
|
|
132
|
+
fontSize: '1.5rem',
|
|
133
|
+
fontWeight: 'bold',
|
|
134
|
+
...combinedStyles
|
|
135
|
+
}, ...props, children: props.children || component.textContent }));
|
|
136
|
+
case 'h3':
|
|
137
|
+
return (_jsx("h3", { style: {
|
|
138
|
+
fontFamily: 'inherit',
|
|
139
|
+
margin: '0 0 12px 0',
|
|
140
|
+
fontSize: '1.25rem',
|
|
141
|
+
fontWeight: 'bold',
|
|
142
|
+
...combinedStyles
|
|
143
|
+
}, ...props, children: props.children || component.textContent }));
|
|
144
|
+
default:
|
|
145
|
+
// Generic component placeholder
|
|
146
|
+
return (_jsxs("div", { style: {
|
|
147
|
+
fontFamily: 'inherit',
|
|
148
|
+
padding: '8px',
|
|
149
|
+
border: '1px dashed #ccc',
|
|
150
|
+
borderRadius: '4px',
|
|
151
|
+
backgroundColor: '#f9f9f9',
|
|
152
|
+
minHeight: '40px',
|
|
153
|
+
...combinedStyles
|
|
154
|
+
}, ...props, children: [_jsx("span", { style: { fontSize: '12px', color: '#666', fontFamily: 'inherit' }, children: type }), renderChildren()] }));
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
// Render children recursively
|
|
158
|
+
const renderChildren = () => {
|
|
159
|
+
if (!component.children || component.children.length === 0) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
return component.children.map((childId) => {
|
|
163
|
+
const child = components.get(childId);
|
|
164
|
+
if (!child)
|
|
165
|
+
return null;
|
|
166
|
+
return (_jsx(ComponentRenderer, { component: child, isSelected: isSelected, isHovered: isHovered, onSelect: onSelect, onHover: onHover }, child.id));
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
// Main render
|
|
170
|
+
return (_jsx("div", { className: `
|
|
171
|
+
${styles.component}
|
|
172
|
+
${isSelected ? styles.selected : ''}
|
|
173
|
+
${isHovered ? styles.hovered : ''}
|
|
174
|
+
${isRoot ? styles.root : ''}
|
|
175
|
+
`, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, "data-component-id": component.id, "data-component-type": component.type, children: renderComponent() }));
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=ComponentRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentRenderer.js","sourceRoot":"","sources":["../../../../playground/components/Canvas/ComponentRenderer.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAWzC,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAClE,SAAS,EACT,MAAM,GAAG,KAAK,EACd,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,QAAQ,EACR,OAAO,EACR,EAAE,EAAE;IACH,MAAM,EAAE,UAAU,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC5C,yBAAyB;IACzB,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAmB,EAAE,EAAE;QACtD,CAAC,CAAC,eAAe,EAAE,CAAC;QACpB,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,E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,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,uBACX,SAAS,CAAC,EAAE,yBACV,SAAS,CAAC,IAAI,YAElC,eAAe,EAAE,GACd,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DraggableComponent - Wrapper for draggable components in the canvas
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { PlaygroundComponent } from '../../types';
|
|
6
|
+
export interface DraggableComponentProps {
|
|
7
|
+
component: PlaygroundComponent;
|
|
8
|
+
isRoot?: boolean;
|
|
9
|
+
isSelected?: boolean;
|
|
10
|
+
isHovered?: boolean;
|
|
11
|
+
onSelect?: (id: string) => void;
|
|
12
|
+
onHover?: (id: string | null) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const DraggableComponent: React.FC<DraggableComponentProps>;
|
|
15
|
+
//# sourceMappingURL=DraggableComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DraggableComponent.d.ts","sourceRoot":"","sources":["../../../../playground/components/Canvas/DraggableComponent.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA0GhE,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* DraggableComponent - Wrapper for draggable components in the canvas
|
|
4
|
+
*/
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
import { useDraggable } from '@dnd-kit/core';
|
|
7
|
+
import { ComponentRenderer } from './ComponentRenderer';
|
|
8
|
+
import { DropZone } from '../DropZone/DropZone';
|
|
9
|
+
import { usePlaygroundStore } from '../../store/playgroundStore';
|
|
10
|
+
import styles from './Canvas.module.css';
|
|
11
|
+
export const DraggableComponent = ({ component, isRoot = false, isSelected = false, isHovered = false, onSelect, onHover }) => {
|
|
12
|
+
const { components, canvasZoom, canvasOffset } = usePlaygroundStore();
|
|
13
|
+
const { attributes, listeners, setNodeRef, transform, isDragging } = useDraggable({
|
|
14
|
+
id: component.id,
|
|
15
|
+
disabled: isRoot, // Root component should not be draggable
|
|
16
|
+
data: {
|
|
17
|
+
type: 'canvas-component',
|
|
18
|
+
component
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const handleClick = useCallback((e) => {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
onSelect?.(component.id);
|
|
24
|
+
}, [component.id, onSelect]);
|
|
25
|
+
const handleMouseEnter = useCallback(() => {
|
|
26
|
+
onHover?.(component.id);
|
|
27
|
+
}, [component.id, onHover]);
|
|
28
|
+
const handleMouseLeave = useCallback(() => {
|
|
29
|
+
onHover?.(null);
|
|
30
|
+
}, [onHover]);
|
|
31
|
+
const style = transform ? {
|
|
32
|
+
transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,
|
|
33
|
+
opacity: isDragging ? 0.5 : undefined,
|
|
34
|
+
zIndex: isDragging ? 1000 : undefined
|
|
35
|
+
} : undefined;
|
|
36
|
+
return (_jsxs("div", { ref: setNodeRef, style: style, className: `
|
|
37
|
+
${styles.draggableComponent}
|
|
38
|
+
${isSelected ? styles.selected : ''}
|
|
39
|
+
${isHovered ? styles.hovered : ''}
|
|
40
|
+
${isDragging ? styles.dragging : ''}
|
|
41
|
+
${isRoot ? styles.root : ''}
|
|
42
|
+
`, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, "data-component-id": component.id, ...(!isRoot ? listeners : {}), ...(!isRoot ? attributes : {}), children: [_jsx(ComponentRenderer, { component: component, isSelected: isSelected, isHovered: isHovered }), component.children && component.children.length > 0 && (_jsx("div", { className: styles.componentChildren, children: component.children.map((childId, index) => {
|
|
43
|
+
const child = components.get(childId);
|
|
44
|
+
if (!child)
|
|
45
|
+
return null;
|
|
46
|
+
return (_jsxs("div", { className: styles.childWrapper, children: [_jsx(DropZone, { id: `${component.id}-before-${index}`, componentId: component.id, insertIndex: index, accepts: ['all'], showIndicator: false, className: styles.insertionZone }), _jsx(DraggableComponent, { component: child, isSelected: false, isHovered: false, onSelect: onSelect, onHover: onHover }), index === component.children.length - 1 && (_jsx(DropZone, { id: `${component.id}-after-${index}`, componentId: component.id, insertIndex: index + 1, accepts: ['all'], showIndicator: false, className: styles.insertionZone }))] }, child.id));
|
|
47
|
+
}) }))] }));
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=DraggableComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DraggableComponent.js","sourceRoot":"","sources":["../../../../playground/components/Canvas/DraggableComponent.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAWzC,MAAM,CAAC,M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AAC,YAAY,aAEhD,KAAC,QAAQ,IACP,EAAE,EAAE,GAAG,SAAS,CAAC,EAAE,WAAW,KAAK,EAAE,EACrC,WAAW,EAAE,SAAS,CAAC,EAAE,EACzB,WAAW,EAAE,KAAK,EAClB,OAAO,EAAE,CAAC,KAAK,CAAC,EAChB,aAAa,EAAE,KAAK,EACpB,SAAS,EAAE,MAAM,CAAC,aAAa,GAC/B,EAEF,KAAC,kBAAkB,IACjB,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,KAAK,EACjB,SAAS,EAAE,KAAK,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,GAChB,EAGD,KAAK,KAAK,SAAS,CAAC,QAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3C,KAAC,QAAQ,IACP,EAAE,EAAE,GAAG,SAAS,CAAC,EAAE,UAAU,KAAK,EAAE,EACpC,WAAW,EAAE,SAAS,CAAC,EAAE,EACzB,WAAW,EAAE,KAAK,GAAG,CAAC,EACtB,OAAO,EAAE,CAAC,KAAK,CAAC,EAChB,aAAa,EAAE,KAAK,EACpB,SAAS,EAAE,MAAM,CAAC,aAAa,GAC/B,CACH,KA7BO,KAAK,CAAC,EAAE,CA8BZ,CACP,CAAC;gBACJ,CAAC,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Canvas } from './Canvas';
|
|
2
|
+
export { CanvasWithDnd } from './CanvasWithDnd';
|
|
3
|
+
export { ComponentRenderer } from './ComponentRenderer';
|
|
4
|
+
export { DraggableComponent } from './DraggableComponent';
|
|
5
|
+
export type { CanvasProps } from './Canvas';
|
|
6
|
+
export type { CanvasWithDndProps } from './CanvasWithDnd';
|
|
7
|
+
export type { ComponentRendererProps } from './ComponentRenderer';
|
|
8
|
+
export type { DraggableComponentProps } from './DraggableComponent';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../playground/components/Canvas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../playground/components/Canvas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeView - Displays generated story code with syntax highlighting
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface CodeViewProps {
|
|
6
|
+
storyName?: string;
|
|
7
|
+
framework?: 'react' | 'vue' | 'angular';
|
|
8
|
+
includeImports?: boolean;
|
|
9
|
+
includeHelpers?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const CodeView: React.FC<CodeViewProps>;
|
|
12
|
+
//# sourceMappingURL=CodeView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeView.d.ts","sourceRoot":"","sources":["../../../../playground/components/CodeView/CodeView.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAK9D,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;IACxC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAwJ5C,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* CodeView - Displays generated story code with syntax highlighting
|
|
4
|
+
*/
|
|
5
|
+
import { useMemo, useState, useCallback } from 'react';
|
|
6
|
+
import { usePlaygroundStore } from '../../store/playgroundStore';
|
|
7
|
+
import { CodeGenerator } from '../../services/CodeGenerator';
|
|
8
|
+
import styles from './CodeView.module.css';
|
|
9
|
+
export const CodeView = ({ storyName = 'MyStory', framework = 'react', includeImports = true, includeHelpers = true }) => {
|
|
10
|
+
const { components, rootId } = usePlaygroundStore();
|
|
11
|
+
const [copied, setCopied] = useState(false);
|
|
12
|
+
const [showLineNumbers, setShowLineNumbers] = useState(true);
|
|
13
|
+
// Generate code
|
|
14
|
+
const generatedCode = useMemo(() => {
|
|
15
|
+
try {
|
|
16
|
+
const generator = new CodeGenerator({
|
|
17
|
+
framework,
|
|
18
|
+
includeImports,
|
|
19
|
+
includeHelpers,
|
|
20
|
+
prettier: true,
|
|
21
|
+
indentSize: 2,
|
|
22
|
+
useTypeScript: true
|
|
23
|
+
});
|
|
24
|
+
return generator.generateStoryCode(components, rootId, storyName);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Code generation error:', error);
|
|
28
|
+
return '// Error generating code\n// ' + error.message;
|
|
29
|
+
}
|
|
30
|
+
}, [components, rootId, storyName, framework, includeImports, includeHelpers]);
|
|
31
|
+
// Copy to clipboard
|
|
32
|
+
const handleCopy = useCallback(() => {
|
|
33
|
+
navigator.clipboard.writeText(generatedCode).then(() => {
|
|
34
|
+
setCopied(true);
|
|
35
|
+
setTimeout(() => setCopied(false), 2000);
|
|
36
|
+
});
|
|
37
|
+
}, [generatedCode]);
|
|
38
|
+
// Export as file
|
|
39
|
+
const handleExport = useCallback(() => {
|
|
40
|
+
const blob = new Blob([generatedCode], { type: 'text/javascript' });
|
|
41
|
+
const url = URL.createObjectURL(blob);
|
|
42
|
+
const a = document.createElement('a');
|
|
43
|
+
a.href = url;
|
|
44
|
+
a.download = `${storyName}.stories.${framework === 'react' ? 'tsx' : 'js'}`;
|
|
45
|
+
document.body.appendChild(a);
|
|
46
|
+
a.click();
|
|
47
|
+
document.body.removeChild(a);
|
|
48
|
+
URL.revokeObjectURL(url);
|
|
49
|
+
}, [generatedCode, storyName, framework]);
|
|
50
|
+
// Add line numbers
|
|
51
|
+
const codeWithLineNumbers = useMemo(() => {
|
|
52
|
+
const lines = generatedCode.split('\n');
|
|
53
|
+
return lines.map((line, index) => {
|
|
54
|
+
const lineNum = (index + 1).toString().padStart(3, ' ');
|
|
55
|
+
return `${lineNum} │ ${line}`;
|
|
56
|
+
}).join('\n');
|
|
57
|
+
}, [generatedCode]);
|
|
58
|
+
// Syntax highlighting (basic)
|
|
59
|
+
const highlightedCode = useMemo(() => {
|
|
60
|
+
let code = showLineNumbers ? codeWithLineNumbers : generatedCode;
|
|
61
|
+
// Keywords
|
|
62
|
+
code = code.replace(/\b(import|export|from|const|let|var|function|return|if|else|for|while|default|interface|type)\b/g, '<span class="keyword">$1</span>');
|
|
63
|
+
// Strings
|
|
64
|
+
code = code.replace(/(["'`])(?:(?=(\\?))\2.)*?\1/g, '<span class="string">$&</span>');
|
|
65
|
+
// Comments
|
|
66
|
+
code = code.replace(/(\/\/.*$|\/\*[\s\S]*?\*\/)/gm, '<span class="comment">$1</span>');
|
|
67
|
+
// JSX tags
|
|
68
|
+
code = code.replace(/(<\/?[A-Z][a-zA-Z]*)(.*?)(\/?>)/g, '<span class="tag">$1</span>$2<span class="tag">$3</span>');
|
|
69
|
+
// Props
|
|
70
|
+
code = code.replace(/\b([a-zA-Z]+)=/g, '<span class="prop">$1</span>=');
|
|
71
|
+
// Numbers
|
|
72
|
+
code = code.replace(/\b(\d+)\b/g, '<span class="number">$1</span>');
|
|
73
|
+
return code;
|
|
74
|
+
}, [generatedCode, codeWithLineNumbers, showLineNumbers]);
|
|
75
|
+
return (_jsxs("div", { className: styles.codeView, children: [_jsxs("div", { className: styles.toolbar, children: [_jsx("div", { className: styles.title, children: "Generated Story Code" }), _jsxs("div", { className: styles.actions, children: [_jsx("button", { className: styles.actionButton, onClick: () => setShowLineNumbers(!showLineNumbers), title: showLineNumbers ? 'Hide line numbers' : 'Show line numbers', children: "#" }), _jsx("button", { className: `${styles.actionButton} ${copied ? styles.copied : ''}`, onClick: handleCopy, title: "Copy to clipboard", children: copied ? '✓' : '📋' }), _jsx("button", { className: styles.actionButton, onClick: handleExport, title: "Export as file", children: "\uD83D\uDCBE" })] })] }), _jsx("div", { className: styles.codeContainer, children: _jsx("pre", { className: styles.code, children: _jsx("code", { dangerouslySetInnerHTML: { __html: highlightedCode } }) }) }), _jsxs("div", { className: styles.footer, children: [_jsxs("span", { className: styles.info, children: [generatedCode.split('\n').length, " lines"] }), _jsxs("span", { className: styles.info, children: [generatedCode.length, " characters"] }), _jsx("span", { className: styles.info, children: framework === 'react' ? 'React/TSX' : framework })] })] }));
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=CodeView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeView.js","sourceRoot":"","sources":["../../../../playground/components/CodeView/CodeView.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAc,EAAE,OAAO,EAAE,QAA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