@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,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* BooleanEditor - Toggle switch for boolean properties using MUI Switch
|
|
4
|
+
*/
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
import { Switch, FormControlLabel, FormGroup } from '@mui/material';
|
|
7
|
+
import styles from './PropertyEditors.module.css';
|
|
8
|
+
export const BooleanEditor = ({ value = false, onChange, label, description }) => {
|
|
9
|
+
const handleToggle = useCallback(() => {
|
|
10
|
+
onChange(!value);
|
|
11
|
+
}, [value, onChange]);
|
|
12
|
+
return (_jsx("div", { className: styles.propertyEditor, children: _jsx(FormGroup, { children: _jsx(FormControlLabel, { control: _jsx(Switch, { checked: value, onChange: handleToggle, size: "small", color: "primary" }), label: _jsxs("div", { children: [label && _jsx("span", { className: styles.label, children: label }), description && _jsx("span", { className: styles.description, children: description })] }), labelPlacement: "end" }) }) }));
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=BooleanEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanEditor.js","sourceRoot":"","sources":["../../../../playground/components/PropertyEditors/BooleanEditor.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,MAAM,MAAM,8BAA8B,CAAC;AASlD,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,KAAK,GAAG,KAAK,EACb,QAAQ,EACR,KAAK,EACL,WAAW,EACZ,EAAE,EAAE;IACH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtB,OAAO,CACL,cAAK,SAAS,EAAE,MAAM,CAAC,cAAc,YACnC,KAAC,SAAS,cACR,KAAC,gBAAgB,IACf,OAAO,EACL,KAAC,MAAM,IACL,OAAO,EAAE,KAAK,EACd,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAC,SAAS,GACf,EAEJ,KAAK,EACH,0BACG,KAAK,IAAI,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAQ,EACtD,WAAW,IAAI,eAAM,SAAS,EAAE,MAAM,CAAC,WAAW,YAAG,WAAW,GAAQ,IACrE,EAER,cAAc,EAAC,KAAK,GACpB,GACQ,GACR,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColorEditor - Color picker for color properties with MUI
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface ColorEditorProps {
|
|
6
|
+
value?: string;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
label?: string;
|
|
9
|
+
presets?: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare const ColorEditor: React.FC<ColorEditorProps>;
|
|
12
|
+
//# sourceMappingURL=ColorEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorEditor.d.ts","sourceRoot":"","sources":["../../../../playground/components/PropertyEditors/ColorEditor.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAeD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwHlD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* ColorEditor - Color picker for color properties with MUI
|
|
4
|
+
*/
|
|
5
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
6
|
+
import { TextField, Box, IconButton, Popover } from '@mui/material';
|
|
7
|
+
import styles from './PropertyEditors.module.css';
|
|
8
|
+
const DEFAULT_PRESETS = [
|
|
9
|
+
'#000000',
|
|
10
|
+
'#FFFFFF',
|
|
11
|
+
'#EF4444', // red
|
|
12
|
+
'#F59E0B', // amber
|
|
13
|
+
'#10B981', // emerald
|
|
14
|
+
'#3B82F6', // blue
|
|
15
|
+
'#8B5CF6', // violet
|
|
16
|
+
'#EC4899', // pink
|
|
17
|
+
'#6B7280', // gray
|
|
18
|
+
'#F3F4F6', // light gray
|
|
19
|
+
];
|
|
20
|
+
export const ColorEditor = ({ value = '#000000', onChange, label, presets = DEFAULT_PRESETS }) => {
|
|
21
|
+
const [localValue, setLocalValue] = useState(value);
|
|
22
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
setLocalValue(value);
|
|
25
|
+
}, [value]);
|
|
26
|
+
const handleChange = useCallback((e) => {
|
|
27
|
+
const newValue = e.target.value;
|
|
28
|
+
setLocalValue(newValue);
|
|
29
|
+
onChange(newValue);
|
|
30
|
+
}, [onChange]);
|
|
31
|
+
const handlePresetClick = useCallback((color) => {
|
|
32
|
+
setLocalValue(color);
|
|
33
|
+
onChange(color);
|
|
34
|
+
setAnchorEl(null);
|
|
35
|
+
}, [onChange]);
|
|
36
|
+
const handlePopoverOpen = useCallback((event) => {
|
|
37
|
+
setAnchorEl(event.currentTarget);
|
|
38
|
+
}, []);
|
|
39
|
+
const handlePopoverClose = useCallback(() => {
|
|
40
|
+
setAnchorEl(null);
|
|
41
|
+
}, []);
|
|
42
|
+
const open = Boolean(anchorEl);
|
|
43
|
+
return (_jsxs("div", { className: styles.propertyEditor, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(Box, { width: 32, height: 32, bgcolor: localValue, border: "1px solid #e5e7eb", borderRadius: 1, sx: { cursor: 'pointer' }, onClick: handlePopoverOpen }), _jsx(TextField, { label: label, value: localValue, onChange: handleChange, placeholder: "#000000", size: "small", fullWidth: true, inputProps: {
|
|
44
|
+
style: { fontSize: '13px' }
|
|
45
|
+
}, sx: {
|
|
46
|
+
'& .MuiInputLabel-root': {
|
|
47
|
+
fontSize: '12px'
|
|
48
|
+
}
|
|
49
|
+
} }), _jsx(IconButton, { size: "small", onClick: handlePopoverOpen, children: "\uD83C\uDFA8" }), _jsx("input", { type: "color", value: localValue, onChange: handleChange, style: {
|
|
50
|
+
width: 0,
|
|
51
|
+
height: 0,
|
|
52
|
+
border: 'none',
|
|
53
|
+
visibility: 'hidden'
|
|
54
|
+
} })] }), _jsx(Popover, { open: open, anchorEl: anchorEl, onClose: handlePopoverClose, anchorOrigin: {
|
|
55
|
+
vertical: 'bottom',
|
|
56
|
+
horizontal: 'left',
|
|
57
|
+
}, transformOrigin: {
|
|
58
|
+
vertical: 'top',
|
|
59
|
+
horizontal: 'left',
|
|
60
|
+
}, children: _jsx(Box, { p: 2, maxWidth: 200, children: _jsx(Box, { display: "flex", flexWrap: "wrap", gap: 1, maxWidth: 160, children: presets.map((color) => (_jsx(Box, { width: 28, height: 28, bgcolor: color, border: "1px solid #e5e7eb", borderRadius: 0.5, sx: { cursor: 'pointer' }, onClick: () => handlePresetClick(color), title: color }, color))) }) }) })] }));
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=ColorEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorEditor.js","sourceRoot":"","sources":["../../../../playground/components/PropertyEditors/ColorEditor.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,MAAM,MAAM,8BAA8B,CAAC;AASlD,MAAM,eAAe,GAAG;IACtB,SAAS;IACT,SAAS;IACT,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,aAAa;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACtD,KAAK,GAAG,SAAS,EACjB,QAAQ,EACR,KAAK,EACL,OAAO,GAAG,eAAe,EAC1B,EAAE,EAAE;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,QA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EACT,MAAM,EAAE,EAAE,EACV,OAAO,EAAE,KAAK,EACd,MAAM,EAAC,mBAAmB,EAC1B,YAAY,EAAE,GAAG,EACjB,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,EACvC,KAAK,EAAE,KAAK,IARP,KAAK,CASV,CACH,CAAC,GACE,GACF,GACE,IACN,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IconEditor - Icon selector for icon properties using MUI Icons
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface IconEditorProps {
|
|
6
|
+
value?: string;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
label?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const IconEditor: React.FC<IconEditorProps>;
|
|
12
|
+
//# sourceMappingURL=IconEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconEditor.d.ts","sourceRoot":"","sources":["../../../../playground/components/PropertyEditors/IconEditor.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAuE9D,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyMhD,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* IconEditor - Icon selector for icon properties using MUI Icons
|
|
4
|
+
*/
|
|
5
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
6
|
+
import { TextField, IconButton, Popover, Box, Typography, InputAdornment, Chip } from '@mui/material';
|
|
7
|
+
// Simple icon components using Unicode/emoji
|
|
8
|
+
const IconComponent = ({ icon }) => (_jsx("span", { style: { fontSize: '16px', display: 'inline-block' }, children: icon }));
|
|
9
|
+
import styles from './PropertyEditors.module.css';
|
|
10
|
+
// Available icons with their emoji representations
|
|
11
|
+
const AVAILABLE_ICONS = [
|
|
12
|
+
{ name: 'Home', icon: '🏠', keywords: ['home', 'house', 'main'] },
|
|
13
|
+
{ name: 'Settings', icon: '⚙️', keywords: ['settings', 'config', 'gear', 'preferences'] },
|
|
14
|
+
{ name: 'Person', icon: '👤', keywords: ['person', 'user', 'profile', 'account'] },
|
|
15
|
+
{ name: 'Mail', icon: '✉️', keywords: ['mail', 'email', 'message', 'contact'] },
|
|
16
|
+
{ name: 'Phone', icon: '📞', keywords: ['phone', 'call', 'contact', 'telephone'] },
|
|
17
|
+
{ name: 'Favorite', icon: '❤️', keywords: ['heart', 'love', 'like', 'favorite'] },
|
|
18
|
+
{ name: 'Star', icon: '⭐', keywords: ['star', 'rating', 'favorite', 'bookmark'] },
|
|
19
|
+
{ name: 'Add', icon: '➕', keywords: ['add', 'plus', 'create', 'new'] },
|
|
20
|
+
{ name: 'Edit', icon: '✏️', keywords: ['edit', 'pencil', 'modify', 'change'] },
|
|
21
|
+
{ name: 'Delete', icon: '🗑️', keywords: ['delete', 'remove', 'trash', 'bin'] },
|
|
22
|
+
{ name: 'Visibility', icon: '👁️', keywords: ['show', 'eye', 'view', 'visible'] },
|
|
23
|
+
{ name: 'VisibilityOff', icon: '🙈', keywords: ['hide', 'hidden', 'invisible'] },
|
|
24
|
+
{ name: 'Download', icon: '⬇️', keywords: ['download', 'save', 'export'] },
|
|
25
|
+
{ name: 'Upload', icon: '⬆️', keywords: ['upload', 'import', 'attach'] },
|
|
26
|
+
{ name: 'Share', icon: '🔗', keywords: ['share', 'send', 'forward'] },
|
|
27
|
+
{ name: 'Save', icon: '💾', keywords: ['save', 'disk', 'store'] },
|
|
28
|
+
{ name: 'Print', icon: '🖨️', keywords: ['print', 'printer', 'output'] },
|
|
29
|
+
{ name: 'Refresh', icon: '🔄', keywords: ['refresh', 'reload', 'sync', 'update'] },
|
|
30
|
+
{ name: 'ArrowBack', icon: '⬅️', keywords: ['back', 'previous', 'left', 'return'] },
|
|
31
|
+
{ name: 'ArrowForward', icon: '➡️', keywords: ['forward', 'next', 'right', 'continue'] },
|
|
32
|
+
{ name: 'ArrowUpward', icon: '⬆️', keywords: ['up', 'top', 'ascend'] },
|
|
33
|
+
{ name: 'ArrowDownward', icon: '⬇️', keywords: ['down', 'bottom', 'descend'] },
|
|
34
|
+
{ name: 'Check', icon: '✓', keywords: ['check', 'done', 'complete', 'tick', 'success'] },
|
|
35
|
+
{ name: 'Clear', icon: '❌', keywords: ['clear', 'close', 'cancel', 'x'] },
|
|
36
|
+
{ name: 'Warning', icon: '⚠️', keywords: ['warning', 'alert', 'caution'] },
|
|
37
|
+
{ name: 'Error', icon: '⛔', keywords: ['error', 'alert', 'danger', 'problem'] },
|
|
38
|
+
{ name: 'Info', icon: 'ℹ️', keywords: ['info', 'information', 'details'] },
|
|
39
|
+
{ name: 'Help', icon: '❓', keywords: ['help', 'question', 'support'] },
|
|
40
|
+
{ name: 'Menu', icon: '☰', keywords: ['menu', 'hamburger', 'navigation'] },
|
|
41
|
+
{ name: 'MoreVert', icon: '⋮', keywords: ['more', 'options', 'dots', 'vertical'] },
|
|
42
|
+
{ name: 'FilterList', icon: '📊', keywords: ['filter', 'sort', 'organize'] },
|
|
43
|
+
{ name: 'Sort', icon: '🔄', keywords: ['sort', 'order', 'arrange'] },
|
|
44
|
+
{ name: 'Search', icon: '🔍', keywords: ['search', 'find', 'lookup'] },
|
|
45
|
+
{ name: 'Notifications', icon: '🔔', keywords: ['notifications', 'bell', 'alerts'] },
|
|
46
|
+
{ name: 'AccountCircle', icon: '👤', keywords: ['account', 'profile', 'user', 'avatar'] },
|
|
47
|
+
{ name: 'ShoppingCart', icon: '🛒', keywords: ['cart', 'shopping', 'basket', 'buy'] },
|
|
48
|
+
{ name: 'Dashboard', icon: '📊', keywords: ['dashboard', 'overview', 'summary'] },
|
|
49
|
+
{ name: 'Business', icon: '🏢', keywords: ['business', 'company', 'office'] },
|
|
50
|
+
{ name: 'School', icon: '🏫', keywords: ['school', 'education', 'learning'] },
|
|
51
|
+
{ name: 'Work', icon: '💼', keywords: ['work', 'job', 'career', 'briefcase'] },
|
|
52
|
+
{ name: 'Event', icon: '📅', keywords: ['event', 'calendar', 'date'] },
|
|
53
|
+
{ name: 'Today', icon: '📆', keywords: ['today', 'calendar', 'date', 'current'] },
|
|
54
|
+
{ name: 'Schedule', icon: '⏰', keywords: ['schedule', 'time', 'clock'] },
|
|
55
|
+
{ name: 'LocationOn', icon: '📍', keywords: ['location', 'place', 'map', 'pin'] },
|
|
56
|
+
{ name: 'Language', icon: '🌐', keywords: ['language', 'globe', 'international'] },
|
|
57
|
+
{ name: 'Lock', icon: '🔒', keywords: ['lock', 'secure', 'private', 'protected'] },
|
|
58
|
+
{ name: 'LockOpen', icon: '🔓', keywords: ['unlock', 'open', 'public'] },
|
|
59
|
+
{ name: 'Security', icon: '🛡️', keywords: ['security', 'shield', 'protection'] },
|
|
60
|
+
{ name: 'Logout', icon: '🚪', keywords: ['logout', 'exit', 'signout'] },
|
|
61
|
+
{ name: 'Login', icon: '🚾', keywords: ['login', 'signin', 'enter'] }
|
|
62
|
+
];
|
|
63
|
+
export const IconEditor = ({ value, onChange, label, placeholder = 'Select icon...' }) => {
|
|
64
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
65
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
66
|
+
const selectedIcon = useMemo(() => {
|
|
67
|
+
return AVAILABLE_ICONS.find(icon => icon.name === value);
|
|
68
|
+
}, [value]);
|
|
69
|
+
const filteredIcons = useMemo(() => {
|
|
70
|
+
if (!searchTerm)
|
|
71
|
+
return AVAILABLE_ICONS;
|
|
72
|
+
const term = searchTerm.toLowerCase();
|
|
73
|
+
return AVAILABLE_ICONS.filter(icon => icon.name.toLowerCase().includes(term) ||
|
|
74
|
+
icon.keywords.some(keyword => keyword.includes(term)));
|
|
75
|
+
}, [searchTerm]);
|
|
76
|
+
const handlePopoverOpen = useCallback((event) => {
|
|
77
|
+
setAnchorEl(event.currentTarget);
|
|
78
|
+
}, []);
|
|
79
|
+
const handlePopoverClose = useCallback(() => {
|
|
80
|
+
setAnchorEl(null);
|
|
81
|
+
setSearchTerm('');
|
|
82
|
+
}, []);
|
|
83
|
+
const handleIconSelect = useCallback((iconName) => {
|
|
84
|
+
onChange(iconName);
|
|
85
|
+
handlePopoverClose();
|
|
86
|
+
}, [onChange, handlePopoverClose]);
|
|
87
|
+
const handleClear = useCallback(() => {
|
|
88
|
+
onChange('');
|
|
89
|
+
}, [onChange]);
|
|
90
|
+
const open = Boolean(anchorEl);
|
|
91
|
+
return (_jsxs("div", { className: styles.propertyEditor, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [selectedIcon && (_jsx(Box, { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", border: "1px solid #e5e7eb", borderRadius: 1, bgcolor: "#f9fafb", children: _jsx(IconComponent, { icon: selectedIcon.icon }) })), _jsx(TextField, { label: label, value: selectedIcon ? selectedIcon.name : value || '', placeholder: placeholder, size: "small", fullWidth: true, onClick: handlePopoverOpen, InputProps: {
|
|
92
|
+
readOnly: true,
|
|
93
|
+
endAdornment: (_jsxs(InputAdornment, { position: "end", children: [value && (_jsx(IconButton, { size: "small", onClick: handleClear, children: "\u274C" })), _jsx(IconButton, { size: "small", onClick: handlePopoverOpen, children: "\uD83D\uDD0D" })] })),
|
|
94
|
+
style: { cursor: 'pointer', fontSize: '13px' }
|
|
95
|
+
}, sx: {
|
|
96
|
+
'& .MuiInputLabel-root': {
|
|
97
|
+
fontSize: '12px'
|
|
98
|
+
}
|
|
99
|
+
} })] }), _jsx(Popover, { open: open, anchorEl: anchorEl, onClose: handlePopoverClose, anchorOrigin: {
|
|
100
|
+
vertical: 'bottom',
|
|
101
|
+
horizontal: 'left',
|
|
102
|
+
}, transformOrigin: {
|
|
103
|
+
vertical: 'top',
|
|
104
|
+
horizontal: 'left',
|
|
105
|
+
}, PaperProps: {
|
|
106
|
+
sx: { width: 400, maxHeight: 500 }
|
|
107
|
+
}, children: _jsxs(Box, { p: 2, children: [_jsx(TextField, { placeholder: "Search icons...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), size: "small", fullWidth: true, InputProps: {
|
|
108
|
+
startAdornment: (_jsx(InputAdornment, { position: "start", children: "\uD83D\uDD0D" }))
|
|
109
|
+
}, sx: { mb: 2 } }), selectedIcon && (_jsxs(Box, { mb: 2, children: [_jsx(Typography, { variant: "caption", color: "textSecondary", children: "Current Selection:" }), _jsx(Box, { mt: 1, children: _jsx(Chip, { icon: _jsx(IconComponent, { icon: selectedIcon.icon }), label: selectedIcon.name, onDelete: handleClear, color: "primary", variant: "outlined" }) })] })), _jsxs(Box, { maxHeight: 300, overflow: "auto", children: [_jsx(Box, { display: "flex", flexWrap: "wrap", gap: 1, children: filteredIcons.map((icon) => {
|
|
110
|
+
const isSelected = value === icon.name;
|
|
111
|
+
return (_jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5, p: 1, border: 1, borderColor: isSelected ? 'primary.main' : 'grey.300', borderRadius: 1, bgcolor: isSelected ? 'primary.50' : 'transparent', width: 80, sx: {
|
|
112
|
+
cursor: 'pointer',
|
|
113
|
+
'&:hover': {
|
|
114
|
+
bgcolor: isSelected ? 'primary.100' : 'grey.50'
|
|
115
|
+
}
|
|
116
|
+
}, onClick: () => handleIconSelect(icon.name), children: [_jsx(IconComponent, { icon: icon.icon }), _jsx(Typography, { variant: "caption", textAlign: "center", sx: {
|
|
117
|
+
fontSize: '10px',
|
|
118
|
+
lineHeight: 1,
|
|
119
|
+
color: isSelected ? 'primary.main' : 'text.secondary'
|
|
120
|
+
}, children: icon.name })] }, icon.name));
|
|
121
|
+
}) }), filteredIcons.length === 0 && (_jsx(Box, { textAlign: "center", py: 4, children: _jsxs(Typography, { variant: "body2", color: "textSecondary", children: ["No icons found matching \"", searchTerm, "\""] }) }))] })] }) })] }));
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=IconEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconEditor.js","sourceRoot":"","sources":["../../../../playground/components/PropertyEditors/IconEditor.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,GAAG,EACH,UAAU,EACV,cAAc,EACd,IAAI,EACL,MAAM,eAAe,CAAC;AAEvB,6CAA6C;AAC7C,MAAM,aAAa,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE,CAAC,CACpD,eAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,YAAG,IAAI,GAAQ,CAC1E,CAAC;AACF,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAElD,mDAAmD;AACnD,MAAM,eAAe,GAAG;IACtB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;IACjE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE;IACzF,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAA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D,YAEA,IAAI,CAAC,IAAI,GACC,KA9BR,IAAI,CAAC,IAAI,CA+BV,CACP,CAAC;oCACJ,CAAC,CAAC,GACE,EAEL,aAAa,CAAC,MAAM,KAAK,CAAC,IAAI,CAC7B,KAAC,GAAG,IAAC,SAAS,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,YAC3B,MAAC,UAAU,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,eAAe,2CACrB,UAAU,UACzB,GACT,CACP,IACG,IACF,GACE,IACN,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NumberEditor - Number input with optional min/max and step using MUI
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface NumberEditorProps {
|
|
6
|
+
value?: number;
|
|
7
|
+
onChange: (value: number) => void;
|
|
8
|
+
label?: string;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
step?: number;
|
|
12
|
+
unit?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const NumberEditor: React.FC<NumberEditorProps>;
|
|
15
|
+
//# sourceMappingURL=NumberEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberEditor.d.ts","sourceRoot":"","sources":["../../../../playground/components/PropertyEditors/NumberEditor.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuFpD,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* NumberEditor - Number input with optional min/max and step using MUI
|
|
4
|
+
*/
|
|
5
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
6
|
+
import { TextField, IconButton, InputAdornment, Box } from '@mui/material';
|
|
7
|
+
import styles from './PropertyEditors.module.css';
|
|
8
|
+
export const NumberEditor = ({ value = 0, onChange, label, min, max, step = 1, unit }) => {
|
|
9
|
+
const [localValue, setLocalValue] = useState(value.toString());
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setLocalValue(value.toString());
|
|
12
|
+
}, [value]);
|
|
13
|
+
const handleChange = useCallback((e) => {
|
|
14
|
+
const newValue = e.target.value;
|
|
15
|
+
setLocalValue(newValue);
|
|
16
|
+
const numValue = parseFloat(newValue);
|
|
17
|
+
if (!isNaN(numValue)) {
|
|
18
|
+
onChange(numValue);
|
|
19
|
+
}
|
|
20
|
+
}, [onChange]);
|
|
21
|
+
const handleIncrement = useCallback(() => {
|
|
22
|
+
const current = parseFloat(localValue) || 0;
|
|
23
|
+
const newValue = Math.min(current + step, max ?? Infinity);
|
|
24
|
+
setLocalValue(newValue.toString());
|
|
25
|
+
onChange(newValue);
|
|
26
|
+
}, [localValue, step, max, onChange]);
|
|
27
|
+
const handleDecrement = useCallback(() => {
|
|
28
|
+
const current = parseFloat(localValue) || 0;
|
|
29
|
+
const newValue = Math.max(current - step, min ?? -Infinity);
|
|
30
|
+
setLocalValue(newValue.toString());
|
|
31
|
+
onChange(newValue);
|
|
32
|
+
}, [localValue, step, min, onChange]);
|
|
33
|
+
return (_jsx("div", { className: styles.propertyEditor, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(IconButton, { size: "small", onClick: handleDecrement, disabled: min !== undefined && parseFloat(localValue) <= min, children: "\u2796" }), _jsx(TextField, { label: label, type: "number", value: localValue, onChange: handleChange, size: "small", fullWidth: true, inputProps: {
|
|
34
|
+
min,
|
|
35
|
+
max,
|
|
36
|
+
step,
|
|
37
|
+
style: { fontSize: '13px', textAlign: 'center' }
|
|
38
|
+
}, InputProps: {
|
|
39
|
+
endAdornment: unit ? (_jsx(InputAdornment, { position: "end", children: _jsx("span", { style: { fontSize: '12px', color: '#6b7280' }, children: unit }) })) : undefined
|
|
40
|
+
}, sx: {
|
|
41
|
+
'& .MuiInputLabel-root': {
|
|
42
|
+
fontSize: '12px'
|
|
43
|
+
}
|
|
44
|
+
} }), _jsx(IconButton, { size: "small", onClick: handleIncrement, disabled: max !== undefined && parseFloat(localValue) >= max, children: "\u2795" })] }) }));
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=NumberEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberEditor.js","sourceRoot":"","sources":["../../../../playground/components/PropertyEditors/NumberEditor.tsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAYlD,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EACxD,KAAK,GAAG,CAAC,EACT,QAAQ,EACR,KAAK,EACL,GAAG,EACH,GAAG,EACH,IAAI,GAAG,CAAC,EACR,IAAI,EACL,EAAE,EAAE;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE/D,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IA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