@superblocksteam/vite-plugin-file-sync 2.0.115-next.0 → 2.0.115-next.2
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/ai-service/agent/middleware.d.ts.map +1 -1
- package/dist/ai-service/agent/middleware.js +19 -0
- package/dist/ai-service/agent/middleware.js.map +1 -1
- package/dist/ai-service/agent/prompts/api-prompts.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/api-prompts.js +13 -17
- package/dist/ai-service/agent/prompts/api-prompts.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +22 -3
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/subagents/coding/prompt-builder.d.ts +16 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.js +30 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.js.map +1 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.d.ts +29 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.js +108 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.js.map +1 -0
- package/dist/ai-service/agent/subagents/types.d.ts +9 -1
- package/dist/ai-service/agent/subagents/types.d.ts.map +1 -1
- package/dist/ai-service/agent/subagents/types.js +8 -0
- package/dist/ai-service/agent/subagents/types.js.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +5 -0
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js +2 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts +6 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +138 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -0
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.js +39 -15
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +6 -3
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.js +116 -49
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
- package/dist/ai-service/agent/tools/index.d.ts +2 -0
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/index.js +2 -0
- package/dist/ai-service/agent/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +3 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.js +330 -204
- package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +40 -2
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/access-control.d.ts +1 -1
- package/dist/ai-service/agent/tools2/access-control.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/access-control.js +15 -4
- package/dist/ai-service/agent/tools2/access-control.js.map +1 -1
- package/dist/ai-service/agent/tools2/registry.d.ts +3 -0
- package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/registry.js +50 -8
- package/dist/ai-service/agent/tools2/registry.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +3 -2
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js +2 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/deploy-service.d.ts +16 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.js +135 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts +33 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.js +308 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +8 -4
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/git.d.ts +57 -1
- package/dist/ai-service/agent/tools2/tools/git.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/git.js +275 -8
- package/dist/ai-service/agent/tools2/tools/git.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/index.d.ts +2 -1
- package/dist/ai-service/agent/tools2/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/index.js +2 -1
- package/dist/ai-service/agent/tools2/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts +4 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.js +20 -4
- package/dist/ai-service/agent/tools2/tools/list-attachments.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts +28 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js +152 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js.map +1 -0
- package/dist/ai-service/agent/tools2/types.d.ts +1 -18
- package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/types.js.map +1 -1
- package/dist/ai-service/agent/utils.d.ts.map +1 -1
- package/dist/ai-service/agent/utils.js +22 -5
- package/dist/ai-service/agent/utils.js.map +1 -1
- package/dist/ai-service/app-interface/file-system-interface.d.ts +0 -4
- package/dist/ai-service/app-interface/file-system-interface.d.ts.map +1 -1
- package/dist/ai-service/app-interface/file-system-interface.js +0 -21
- package/dist/ai-service/app-interface/file-system-interface.js.map +1 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts +11 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js +29 -7
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js.map +1 -1
- package/dist/ai-service/app-interface/shell.d.ts +6 -0
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +8 -0
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/app-skills/helpers.d.ts.map +1 -1
- package/dist/ai-service/app-skills/helpers.js +4 -2
- package/dist/ai-service/app-skills/helpers.js.map +1 -1
- package/dist/ai-service/attachments/store.d.ts +18 -2
- package/dist/ai-service/attachments/store.d.ts.map +1 -1
- package/dist/ai-service/attachments/store.js +102 -9
- package/dist/ai-service/attachments/store.js.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.d.ts +5 -2
- package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.js +32 -0
- package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -1
- package/dist/ai-service/chat/chat-session-store.d.ts +2 -2
- package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
- package/dist/ai-service/chat/chat-session-store.js +45 -243
- package/dist/ai-service/chat/chat-session-store.js.map +1 -1
- package/dist/ai-service/chat/utils.d.ts +6 -0
- package/dist/ai-service/chat/utils.d.ts.map +1 -1
- package/dist/ai-service/chat/utils.js +47 -0
- package/dist/ai-service/chat/utils.js.map +1 -1
- package/dist/ai-service/features.d.ts +4 -0
- package/dist/ai-service/features.d.ts.map +1 -1
- package/dist/ai-service/features.js +4 -0
- package/dist/ai-service/features.js.map +1 -1
- package/dist/ai-service/index.d.ts +36 -11
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +228 -68
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/judge/tools/playwright-action.d.ts +1 -1
- package/dist/ai-service/llm/client.d.ts.map +1 -1
- package/dist/ai-service/llm/client.js +4 -2
- package/dist/ai-service/llm/client.js.map +1 -1
- package/dist/ai-service/llm/stream/observers/retry-notification.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/retry-notification.js +4 -2
- package/dist/ai-service/llm/stream/observers/retry-notification.js.map +1 -1
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.d.ts.map +1 -1
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js +1 -16
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js.map +1 -1
- package/dist/ai-service/prompt-builder-service/types.d.ts +2 -13
- package/dist/ai-service/prompt-builder-service/types.d.ts.map +1 -1
- package/dist/ai-service/prompt-builder-service/types.js.map +1 -1
- package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/_registry.generated.js +6 -0
- package/dist/ai-service/skills/system/_registry.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js +58 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js +107 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +137 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts +26 -13
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js +12 -7
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +76 -27
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.js +15 -6
- package/dist/ai-service/state-machine/handlers/awaiting-user.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.js +4 -2
- package/dist/ai-service/state-machine/handlers/idle.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +48 -15
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.js +23 -151
- package/dist/ai-service/state-machine/handlers/post-processing.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js +16 -8
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/change-info.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/change-info.js +2 -15
- package/dist/ai-service/state-machine/helpers/change-info.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.d.ts +3 -3
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.js +9 -23
- package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +52 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.js +141 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -0
- package/dist/ai-service/state-machine/mocks.d.ts.map +1 -1
- package/dist/ai-service/state-machine/mocks.js +0 -17
- package/dist/ai-service/state-machine/mocks.js.map +1 -1
- package/dist/ai-service/types.d.ts +2 -21
- package/dist/ai-service/types.d.ts.map +1 -1
- package/dist/ai-service/types.js.map +1 -1
- package/dist/ai-service/util/archive-extractors.d.ts +52 -0
- package/dist/ai-service/util/archive-extractors.d.ts.map +1 -0
- package/dist/ai-service/util/archive-extractors.js +278 -0
- package/dist/ai-service/util/archive-extractors.js.map +1 -0
- package/dist/codegen.d.ts +1 -22
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +1 -117
- package/dist/codegen.js.map +1 -1
- package/dist/components-manager.d.ts +0 -6
- package/dist/components-manager.d.ts.map +1 -1
- package/dist/components-manager.js +0 -27
- package/dist/components-manager.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +47 -94
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-manager.d.ts +2 -15
- package/dist/file-system-manager.d.ts.map +1 -1
- package/dist/file-system-manager.js +16 -128
- package/dist/file-system-manager.js.map +1 -1
- package/dist/git-service/live-branch.d.ts.map +1 -1
- package/dist/git-service/live-branch.js +15 -1
- package/dist/git-service/live-branch.js.map +1 -1
- package/dist/lock-service/index.d.ts.map +1 -1
- package/dist/lock-service/index.js +8 -5
- package/dist/lock-service/index.js.map +1 -1
- package/dist/migration/get-fullstack-template-dir.d.ts +37 -0
- package/dist/migration/get-fullstack-template-dir.d.ts.map +1 -0
- package/dist/migration/get-fullstack-template-dir.js +99 -0
- package/dist/migration/get-fullstack-template-dir.js.map +1 -0
- package/dist/migration/migration-checklist.d.ts +60 -0
- package/dist/migration/migration-checklist.d.ts.map +1 -0
- package/dist/migration/migration-checklist.js +230 -0
- package/dist/migration/migration-checklist.js.map +1 -0
- package/dist/migration/migration-routes.d.ts +23 -0
- package/dist/migration/migration-routes.d.ts.map +1 -0
- package/dist/migration/migration-routes.js +533 -0
- package/dist/migration/migration-routes.js.map +1 -0
- package/dist/migration/restructure.d.ts +76 -0
- package/dist/migration/restructure.d.ts.map +1 -0
- package/dist/migration/restructure.js +446 -0
- package/dist/migration/restructure.js.map +1 -0
- package/dist/migration/translation-prompt.d.ts +22 -0
- package/dist/migration/translation-prompt.d.ts.map +1 -0
- package/dist/migration/translation-prompt.js +27 -0
- package/dist/migration/translation-prompt.js.map +1 -0
- package/dist/migration-templates/app-fullstack/client/App.tsx +17 -0
- package/dist/migration-templates/app-fullstack/client/components/common/sonner.tsx +20 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-active-page.ts +73 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-mobile.ts +21 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +197 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/area-chart.tsx +432 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/aspect-ratio.tsx +45 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +117 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/badge.tsx +143 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/bar-chart.tsx +390 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +259 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +182 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +300 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/card.tsx +129 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +403 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/chat.tsx +2303 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/checkbox.tsx +97 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/code-block-content.tsx +66 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/date-range-picker.tsx +396 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/dialog.tsx +223 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/dropdown-menu.tsx +284 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +395 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +166 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +162 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/icon.tsx +133 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +68 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +219 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +55 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/line-chart.tsx +380 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/link.tsx +139 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +345 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +192 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/pie-chart.tsx +295 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +162 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +69 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/radar-chart.tsx +386 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/radial-chart.tsx +402 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/scroll-area.tsx +86 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +229 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/separator.tsx +62 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +234 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +974 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/skeleton.tsx +13 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +198 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +95 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +145 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +87 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/textarea.tsx +148 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +225 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +150 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +175 -0
- package/dist/migration-templates/app-fullstack/client/hooks/useApi.ts +25 -0
- package/dist/migration-templates/app-fullstack/client/hooks/useApiData.ts +10 -0
- package/dist/migration-templates/app-fullstack/client/index.css +131 -0
- package/dist/migration-templates/app-fullstack/client/lib/executeApi.ts +9 -0
- package/dist/migration-templates/app-fullstack/client/lib/utils.ts +6 -0
- package/dist/migration-templates/app-fullstack/client/pages/Page1/index.tsx +3 -0
- package/dist/migration-templates/app-fullstack/client/root.tsx +17 -0
- package/dist/migration-templates/app-fullstack/client/router.tsx +48 -0
- package/dist/migration-templates/app-fullstack/client/types/node.d.ts +9 -0
- package/dist/migration-templates/app-fullstack/components.json +21 -0
- package/dist/migration-templates/app-fullstack/eslint.config.js +108 -0
- package/dist/migration-templates/app-fullstack/package.json +89 -0
- package/dist/migration-templates/app-fullstack/server/.gitkeep +0 -0
- package/dist/migration-templates/app-fullstack/server/apis/index.ts +22 -0
- package/dist/migration-templates/app-fullstack/server/index.ts +2 -0
- package/dist/migration-templates/app-fullstack/tsconfig.client.json +27 -0
- package/dist/migration-templates/app-fullstack/tsconfig.eslint.json +8 -0
- package/dist/migration-templates/app-fullstack/tsconfig.json +25 -0
- package/dist/migration-templates/app-fullstack/tsconfig.server.json +13 -0
- package/dist/migration-templates/app-fullstack/vite.config.ts +17 -0
- package/dist/parsing/imports.d.ts +0 -16
- package/dist/parsing/imports.d.ts.map +1 -1
- package/dist/parsing/imports.js +0 -68
- package/dist/parsing/imports.js.map +1 -1
- package/dist/parsing/jsx.d.ts +0 -2
- package/dist/parsing/jsx.d.ts.map +1 -1
- package/dist/parsing/jsx.js +0 -62
- package/dist/parsing/jsx.js.map +1 -1
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +109 -32
- package/dist/socket-manager.js.map +1 -1
- package/dist/source-tracker.d.ts +7 -85
- package/dist/source-tracker.d.ts.map +1 -1
- package/dist/source-tracker.js +19 -695
- package/dist/source-tracker.js.map +1 -1
- package/dist/sync-service/index.d.ts +79 -2
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +139 -10
- package/dist/sync-service/index.js.map +1 -1
- package/package.json +11 -9
- package/dist/ai-service/artifacts/bolt.d.ts +0 -8
- package/dist/ai-service/artifacts/bolt.d.ts.map +0 -1
- package/dist/ai-service/artifacts/bolt.js +0 -92
- package/dist/ai-service/artifacts/bolt.js.map +0 -1
- package/dist/ai-service/result-buffer/bolt.d.ts +0 -18
- package/dist/ai-service/result-buffer/bolt.d.ts.map +0 -1
- package/dist/ai-service/result-buffer/bolt.js +0 -100
- package/dist/ai-service/result-buffer/bolt.js.map +0 -1
- package/dist/ai-service/result-buffer/shared.d.ts +0 -17
- package/dist/ai-service/result-buffer/shared.d.ts.map +0 -1
- package/dist/ai-service/result-buffer/shared.js +0 -7
- package/dist/ai-service/result-buffer/shared.js.map +0 -1
- package/dist/inject-no-select.d.ts +0 -15
- package/dist/inject-no-select.d.ts.map +0 -1
- package/dist/inject-no-select.js +0 -175
- package/dist/inject-no-select.js.map +0 -1
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Upload, Trash, File, Image } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import {
|
|
7
|
+
useDropzone,
|
|
8
|
+
type DropzoneOptions,
|
|
9
|
+
type FileRejection,
|
|
10
|
+
} from "react-dropzone";
|
|
11
|
+
|
|
12
|
+
import { registerComponent } from "@superblocksteam/library";
|
|
13
|
+
import {
|
|
14
|
+
Prop,
|
|
15
|
+
Section,
|
|
16
|
+
PropsCategory,
|
|
17
|
+
type PropertiesPanelDefinition,
|
|
18
|
+
type EditorConfig,
|
|
19
|
+
} from "@superblocksteam/library";
|
|
20
|
+
|
|
21
|
+
import { cn } from "@/lib/utils";
|
|
22
|
+
|
|
23
|
+
import { Button } from "./button";
|
|
24
|
+
|
|
25
|
+
// Variants
|
|
26
|
+
const dropzoneVariants = cva(
|
|
27
|
+
"relative border-2 border-dashed rounded-lg transition-all duration-200 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
28
|
+
{
|
|
29
|
+
variants: {
|
|
30
|
+
state: {
|
|
31
|
+
idle: "",
|
|
32
|
+
active: "border-primary bg-primary/5 border-solid",
|
|
33
|
+
accept:
|
|
34
|
+
"border-green-500 bg-green-50 border-solid dark:bg-green-950/20",
|
|
35
|
+
reject: "border-destructive bg-destructive/5 border-solid",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
state: "idle",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
type DropzoneVariantProps = VariantProps<typeof dropzoneVariants>;
|
|
45
|
+
|
|
46
|
+
// Types
|
|
47
|
+
interface DropzoneProps
|
|
48
|
+
extends
|
|
49
|
+
Omit<React.HTMLAttributes<HTMLDivElement>, "onDrop">,
|
|
50
|
+
DropzoneVariantProps {
|
|
51
|
+
onDrop?: (acceptedFiles: File[]) => void;
|
|
52
|
+
onDropAccepted?: (files: File[]) => void;
|
|
53
|
+
onDropRejected?: (fileRejections: FileRejection[]) => void;
|
|
54
|
+
onFileRemove?: (file: File) => void;
|
|
55
|
+
acceptedFileTypes?: string[];
|
|
56
|
+
maxFiles?: number;
|
|
57
|
+
maxSize?: number;
|
|
58
|
+
minSize?: number;
|
|
59
|
+
multiple?: boolean;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
showFileList?: boolean;
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
files: File[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Utility Functions
|
|
67
|
+
const formatFileSize = (bytes: number) => {
|
|
68
|
+
if (bytes === 0) return "0 Bytes";
|
|
69
|
+
const k = 1024;
|
|
70
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
71
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
72
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Sub-Components
|
|
76
|
+
const FilePreview = ({
|
|
77
|
+
file,
|
|
78
|
+
onRemove,
|
|
79
|
+
}: {
|
|
80
|
+
file: File;
|
|
81
|
+
onRemove?: () => void;
|
|
82
|
+
}) => {
|
|
83
|
+
const isImage = file.type.startsWith("image/");
|
|
84
|
+
const preview = React.useMemo(() => {
|
|
85
|
+
if (isImage) {
|
|
86
|
+
return URL.createObjectURL(file);
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}, [file, isImage]);
|
|
90
|
+
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
return () => {
|
|
93
|
+
if (preview) {
|
|
94
|
+
URL.revokeObjectURL(preview);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}, [preview]);
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<div className="flex items-center gap-2 p-2 border rounded-md">
|
|
101
|
+
<div className="flex-shrink-0">
|
|
102
|
+
{isImage && preview ? (
|
|
103
|
+
<img
|
|
104
|
+
src={preview}
|
|
105
|
+
alt={file.name}
|
|
106
|
+
className="w-8 h-8 object-cover rounded"
|
|
107
|
+
/>
|
|
108
|
+
) : (
|
|
109
|
+
<div className="w-8 h-8 flex items-center justify-center bg-muted rounded">
|
|
110
|
+
{isImage ? (
|
|
111
|
+
<Image className="w-4 h-4" />
|
|
112
|
+
) : (
|
|
113
|
+
<File className="w-4 h-4" />
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
)}
|
|
117
|
+
</div>
|
|
118
|
+
<div className="flex-1 min-w-0">
|
|
119
|
+
<p className="text-sm truncate">{file.name}</p>
|
|
120
|
+
<p className="text-xs text-muted-foreground">
|
|
121
|
+
{formatFileSize(file.size)}
|
|
122
|
+
</p>
|
|
123
|
+
</div>
|
|
124
|
+
{onRemove && (
|
|
125
|
+
<Button
|
|
126
|
+
type="button"
|
|
127
|
+
variant="ghost"
|
|
128
|
+
size="sm"
|
|
129
|
+
className="h-6 w-6 p-0 text-muted-foreground cursor-pointer"
|
|
130
|
+
onClick={onRemove}
|
|
131
|
+
>
|
|
132
|
+
<Trash className="w-3 h-3" />
|
|
133
|
+
</Button>
|
|
134
|
+
)}
|
|
135
|
+
</div>
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const DropArea = ({
|
|
140
|
+
placeholder,
|
|
141
|
+
acceptedFileTypes,
|
|
142
|
+
maxSize,
|
|
143
|
+
}: Pick<DropzoneProps, "placeholder" | "acceptedFileTypes" | "maxSize">) => {
|
|
144
|
+
return (
|
|
145
|
+
<div className="flex flex-col items-center justify-center text-center">
|
|
146
|
+
<Upload className="w-6 h-6 mb-4 text-muted-foreground" />
|
|
147
|
+
<div className="space-y-2">
|
|
148
|
+
<p className="text-sm">{placeholder}</p>
|
|
149
|
+
<p className="text-xs text-muted-foreground">
|
|
150
|
+
{acceptedFileTypes
|
|
151
|
+
? `Accepted formats: ${acceptedFileTypes.join(", ")}`
|
|
152
|
+
: "All file types accepted"}
|
|
153
|
+
</p>
|
|
154
|
+
{maxSize && (
|
|
155
|
+
<p className="text-xs text-muted-foreground">
|
|
156
|
+
Max. file size: {formatFileSize(maxSize)}
|
|
157
|
+
</p>
|
|
158
|
+
)}
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const FileListPreview = ({
|
|
165
|
+
files,
|
|
166
|
+
onFileRemove,
|
|
167
|
+
}: Pick<DropzoneProps, "files" | "onFileRemove">) => {
|
|
168
|
+
return (
|
|
169
|
+
<div className="space-y-2">
|
|
170
|
+
<h4 className="text-xs">Uploads ({files.length})</h4>
|
|
171
|
+
<div className="space-y-2 max-h-40 overflow-y-auto">
|
|
172
|
+
{files.map((file, index) => (
|
|
173
|
+
<FilePreview
|
|
174
|
+
key={`${file.name}-${index}`}
|
|
175
|
+
file={file}
|
|
176
|
+
onRemove={onFileRemove ? () => onFileRemove(file) : undefined}
|
|
177
|
+
/>
|
|
178
|
+
))}
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// Main Component
|
|
185
|
+
const Dropzone = React.forwardRef<HTMLDivElement, DropzoneProps>(
|
|
186
|
+
function Dropzone(
|
|
187
|
+
{
|
|
188
|
+
className,
|
|
189
|
+
onDrop,
|
|
190
|
+
onDropAccepted,
|
|
191
|
+
onDropRejected,
|
|
192
|
+
onFileRemove,
|
|
193
|
+
acceptedFileTypes,
|
|
194
|
+
maxFiles,
|
|
195
|
+
maxSize,
|
|
196
|
+
minSize,
|
|
197
|
+
multiple,
|
|
198
|
+
disabled,
|
|
199
|
+
showFileList = true,
|
|
200
|
+
placeholder,
|
|
201
|
+
files,
|
|
202
|
+
...props
|
|
203
|
+
},
|
|
204
|
+
ref,
|
|
205
|
+
) {
|
|
206
|
+
const dropzoneOptions: DropzoneOptions = {
|
|
207
|
+
onDrop: (acceptedFiles, fileRejections) => {
|
|
208
|
+
onDrop?.(acceptedFiles);
|
|
209
|
+
if (acceptedFiles.length > 0) {
|
|
210
|
+
onDropAccepted?.(acceptedFiles);
|
|
211
|
+
}
|
|
212
|
+
if (fileRejections.length > 0) {
|
|
213
|
+
onDropRejected?.(fileRejections);
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
accept: acceptedFileTypes
|
|
217
|
+
? acceptedFileTypes.reduce(
|
|
218
|
+
(acc, type) => {
|
|
219
|
+
acc[type] = [];
|
|
220
|
+
return acc;
|
|
221
|
+
},
|
|
222
|
+
{} as Record<string, string[]>,
|
|
223
|
+
)
|
|
224
|
+
: undefined,
|
|
225
|
+
maxFiles,
|
|
226
|
+
maxSize,
|
|
227
|
+
minSize,
|
|
228
|
+
multiple,
|
|
229
|
+
disabled,
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
const {
|
|
233
|
+
getRootProps,
|
|
234
|
+
getInputProps,
|
|
235
|
+
isDragActive,
|
|
236
|
+
isDragAccept,
|
|
237
|
+
isDragReject,
|
|
238
|
+
} = useDropzone(dropzoneOptions);
|
|
239
|
+
|
|
240
|
+
const getState = () => {
|
|
241
|
+
if (isDragReject) return "reject";
|
|
242
|
+
if (isDragAccept) return "accept";
|
|
243
|
+
if (isDragActive) return "active";
|
|
244
|
+
return "idle";
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
return (
|
|
248
|
+
<div className={cn("w-full space-y-4", className)} {...props}>
|
|
249
|
+
<div
|
|
250
|
+
ref={ref}
|
|
251
|
+
{...(getRootProps() as any)}
|
|
252
|
+
className={cn(
|
|
253
|
+
"p-8 min-h-[160px]",
|
|
254
|
+
dropzoneVariants({ state: getState() }),
|
|
255
|
+
)}
|
|
256
|
+
>
|
|
257
|
+
<input {...getInputProps()} />
|
|
258
|
+
|
|
259
|
+
<DropArea
|
|
260
|
+
placeholder={placeholder}
|
|
261
|
+
acceptedFileTypes={acceptedFileTypes}
|
|
262
|
+
maxSize={maxSize}
|
|
263
|
+
/>
|
|
264
|
+
</div>
|
|
265
|
+
{showFileList && files.length > 0 && (
|
|
266
|
+
<FileListPreview files={files} onFileRemove={onFileRemove} />
|
|
267
|
+
)}
|
|
268
|
+
</div>
|
|
269
|
+
);
|
|
270
|
+
},
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
Dropzone.displayName = "Dropzone";
|
|
274
|
+
|
|
275
|
+
// Properties Definition
|
|
276
|
+
const propertiesDefinition: PropertiesPanelDefinition<DropzoneProps> = {
|
|
277
|
+
general: Section.category(PropsCategory.Content).children({
|
|
278
|
+
placeholder: Prop.string().propertiesPanel({
|
|
279
|
+
label: "Placeholder",
|
|
280
|
+
description: "Placeholder text shown when no files are uploaded",
|
|
281
|
+
}),
|
|
282
|
+
acceptedFileTypes: Prop.array<string>().propertiesPanel({
|
|
283
|
+
label: "Accepted file types",
|
|
284
|
+
controlType: "FUNCTION_CODE_EDITOR",
|
|
285
|
+
description:
|
|
286
|
+
"Array of MIME types or file extensions (e.g. image/*, .pdf, .doc)",
|
|
287
|
+
}),
|
|
288
|
+
multiple: Prop.boolean().propertiesPanel({
|
|
289
|
+
label: "Multiple files",
|
|
290
|
+
controlType: "SWITCH",
|
|
291
|
+
description: "Allow multiple file selection",
|
|
292
|
+
}),
|
|
293
|
+
maxFiles: Prop.number().propertiesPanel({
|
|
294
|
+
label: "Max files",
|
|
295
|
+
controlType: "INPUT_TEXT",
|
|
296
|
+
description: "Maximum number of files allowed",
|
|
297
|
+
isRemovable: true,
|
|
298
|
+
visibility: "SHOW_NAME",
|
|
299
|
+
defaultOnAdd: 5,
|
|
300
|
+
isVisible: function (this: any) {
|
|
301
|
+
return this.multiple;
|
|
302
|
+
},
|
|
303
|
+
}),
|
|
304
|
+
}),
|
|
305
|
+
|
|
306
|
+
appearance: Section.category(PropsCategory.Appearance).children({
|
|
307
|
+
showFileList: Prop.boolean().propertiesPanel({
|
|
308
|
+
label: "Show file list",
|
|
309
|
+
controlType: "SWITCH",
|
|
310
|
+
description: "Display list of uploaded files",
|
|
311
|
+
}),
|
|
312
|
+
}),
|
|
313
|
+
|
|
314
|
+
interaction: Section.category(PropsCategory.Interaction).children({
|
|
315
|
+
disabled: Prop.boolean().propertiesPanel({
|
|
316
|
+
label: "Disabled",
|
|
317
|
+
controlType: "SWITCH",
|
|
318
|
+
description: "Whether the dropzone is disabled",
|
|
319
|
+
}),
|
|
320
|
+
maxSize: Prop.number().propertiesPanel({
|
|
321
|
+
label: "Max file size",
|
|
322
|
+
controlType: "INPUT_TEXT",
|
|
323
|
+
description: "Maximum file size in bytes (default: 10MB)",
|
|
324
|
+
isRemovable: true,
|
|
325
|
+
visibility: "SHOW_NAME",
|
|
326
|
+
defaultOnAdd: 10485760, // 10MB
|
|
327
|
+
}),
|
|
328
|
+
minSize: Prop.number().propertiesPanel({
|
|
329
|
+
label: "Min file size",
|
|
330
|
+
description: "Minimum file size in bytes",
|
|
331
|
+
isRemovable: true,
|
|
332
|
+
visibility: "SHOW_NAME",
|
|
333
|
+
defaultOnAdd: 0,
|
|
334
|
+
}),
|
|
335
|
+
}),
|
|
336
|
+
|
|
337
|
+
events: Section.category(PropsCategory.EventHandlers).children({
|
|
338
|
+
onDrop: Prop.eventHandler().propertiesPanel({
|
|
339
|
+
label: "On drop",
|
|
340
|
+
description: "Triggered when files are dropped or selected",
|
|
341
|
+
computedArgs: [
|
|
342
|
+
{
|
|
343
|
+
name: "files",
|
|
344
|
+
type: "array",
|
|
345
|
+
description: "The dropped files",
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
}),
|
|
349
|
+
onDropAccepted: Prop.eventHandler().propertiesPanel({
|
|
350
|
+
label: "On drop accepted",
|
|
351
|
+
description: "Triggered when valid files are accepted",
|
|
352
|
+
computedArgs: [
|
|
353
|
+
{
|
|
354
|
+
name: "files",
|
|
355
|
+
type: "array",
|
|
356
|
+
description: "The accepted files",
|
|
357
|
+
},
|
|
358
|
+
],
|
|
359
|
+
}),
|
|
360
|
+
onDropRejected: Prop.eventHandler().propertiesPanel({
|
|
361
|
+
label: "On drop rejected",
|
|
362
|
+
description: "Triggered when files are rejected due to validation",
|
|
363
|
+
computedArgs: [
|
|
364
|
+
{
|
|
365
|
+
name: "fileRejections",
|
|
366
|
+
type: "array",
|
|
367
|
+
description: "The rejected files",
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
}),
|
|
371
|
+
onFileRemove: Prop.eventHandler().propertiesPanel({
|
|
372
|
+
label: "On file remove",
|
|
373
|
+
description: "Triggered when a file is removed from the list",
|
|
374
|
+
computedArgs: [
|
|
375
|
+
{
|
|
376
|
+
name: "fileToRemove",
|
|
377
|
+
type: "object",
|
|
378
|
+
description: "The file to remove",
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
}),
|
|
382
|
+
}),
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
// Editor Configuration
|
|
386
|
+
const editorConfig: EditorConfig = {
|
|
387
|
+
icon: "file-picker",
|
|
388
|
+
description: "A versatile file upload component with drag and drop support",
|
|
389
|
+
hasExtendedClickArea: true,
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
// Registration
|
|
393
|
+
registerComponent(Dropzone, propertiesDefinition).editorConfig(editorConfig);
|
|
394
|
+
|
|
395
|
+
export { Dropzone };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { IconName } from "lucide-react/dynamic";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { registerComponent } from "@superblocksteam/library";
|
|
5
|
+
import {
|
|
6
|
+
Prop,
|
|
7
|
+
Section,
|
|
8
|
+
PropsCategory,
|
|
9
|
+
type PropertiesPanelDefinition,
|
|
10
|
+
type EditorConfig,
|
|
11
|
+
} from "@superblocksteam/library";
|
|
12
|
+
|
|
13
|
+
import { Icon } from "@/components/ui/icon";
|
|
14
|
+
import { Input } from "@/components/ui/input";
|
|
15
|
+
import { cn } from "@/lib/utils";
|
|
16
|
+
|
|
17
|
+
// Types
|
|
18
|
+
type FileInputProps = React.ComponentPropsWithoutRef<typeof Input> & {
|
|
19
|
+
acceptedFileTypes?: string[];
|
|
20
|
+
icon?: string;
|
|
21
|
+
iconPosition?: "left" | "right";
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Main Component
|
|
25
|
+
const FileInput = ({
|
|
26
|
+
acceptedFileTypes,
|
|
27
|
+
style,
|
|
28
|
+
multiple,
|
|
29
|
+
icon,
|
|
30
|
+
iconPosition,
|
|
31
|
+
children: _children,
|
|
32
|
+
...props
|
|
33
|
+
}: FileInputProps) => {
|
|
34
|
+
const accept = React.useMemo(
|
|
35
|
+
() => (acceptedFileTypes ? acceptedFileTypes.join(",") : undefined),
|
|
36
|
+
[acceptedFileTypes],
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
if (icon) {
|
|
40
|
+
const isLeft = iconPosition === "left";
|
|
41
|
+
return (
|
|
42
|
+
<div className={cn("relative", props.className)} style={style}>
|
|
43
|
+
<Input
|
|
44
|
+
className={cn(isLeft ? "pl-10" : "pr-10")}
|
|
45
|
+
type="file"
|
|
46
|
+
accept={accept}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
<div
|
|
50
|
+
className={cn(
|
|
51
|
+
"absolute inset-y-0 flex items-center pointer-events-none",
|
|
52
|
+
isLeft ? "left-0 pl-3" : "right-0 pr-3",
|
|
53
|
+
)}
|
|
54
|
+
>
|
|
55
|
+
<Icon
|
|
56
|
+
icon={icon as IconName}
|
|
57
|
+
style={{
|
|
58
|
+
width: 16,
|
|
59
|
+
height: 16,
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return <Input style={style} type="file" accept={accept} {...props} />;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Properties Definition
|
|
71
|
+
const propertiesDefinition: PropertiesPanelDefinition<FileInputProps> = {
|
|
72
|
+
general: Section.category(PropsCategory.Content).children({
|
|
73
|
+
multiple: Prop.boolean().propertiesPanel({
|
|
74
|
+
label: "Multiple files",
|
|
75
|
+
controlType: "SWITCH",
|
|
76
|
+
description: "Allow multiple file selection",
|
|
77
|
+
}),
|
|
78
|
+
acceptedFileTypes: Prop.array<string>().propertiesPanel({
|
|
79
|
+
label: "Accepted file types",
|
|
80
|
+
controlType: "FUNCTION_CODE_EDITOR",
|
|
81
|
+
description:
|
|
82
|
+
"Array of MIME types or file extensions (e.g. image/*, .pdf, .doc)",
|
|
83
|
+
}),
|
|
84
|
+
icon: Prop.string<string>()
|
|
85
|
+
.propertiesPanel({
|
|
86
|
+
label: "Icon",
|
|
87
|
+
description: "Icon to display in the input (e.g., 'search', 'lock')",
|
|
88
|
+
defaultOnAdd: "search",
|
|
89
|
+
isRemovable: true,
|
|
90
|
+
visibility: "SHOW_NAME",
|
|
91
|
+
controlType: "ICON_SELECTOR",
|
|
92
|
+
})
|
|
93
|
+
.docs({
|
|
94
|
+
description:
|
|
95
|
+
"The icon to display in the component. You can use the Lucide icon library to find the icon you want.",
|
|
96
|
+
}),
|
|
97
|
+
iconPosition: Prop.string<"left" | "right">().propertiesPanel({
|
|
98
|
+
label: "Icon position",
|
|
99
|
+
controlType: "RADIO_BUTTON_GROUP",
|
|
100
|
+
description: "Position of the icon within the input",
|
|
101
|
+
options: [
|
|
102
|
+
{ label: "Left", value: "left" },
|
|
103
|
+
{ label: "Right", value: "right" },
|
|
104
|
+
],
|
|
105
|
+
isVisible: function (this: any) {
|
|
106
|
+
return Boolean(this.icon);
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
}),
|
|
110
|
+
|
|
111
|
+
interaction: Section.category(PropsCategory.Interaction).children({
|
|
112
|
+
disabled: Prop.boolean().propertiesPanel({
|
|
113
|
+
label: "Disabled",
|
|
114
|
+
controlType: "SWITCH",
|
|
115
|
+
description: "Whether the input is disabled",
|
|
116
|
+
}),
|
|
117
|
+
required: Prop.boolean().propertiesPanel({
|
|
118
|
+
label: "Required",
|
|
119
|
+
controlType: "SWITCH",
|
|
120
|
+
description: "Whether the input is required",
|
|
121
|
+
}),
|
|
122
|
+
readOnly: Prop.boolean().propertiesPanel({
|
|
123
|
+
label: "Read only",
|
|
124
|
+
controlType: "SWITCH",
|
|
125
|
+
description: "Whether the input is read only",
|
|
126
|
+
}),
|
|
127
|
+
autoFocus: Prop.boolean().propertiesPanel({
|
|
128
|
+
label: "Auto focus",
|
|
129
|
+
controlType: "SWITCH",
|
|
130
|
+
description: "Whether the input should auto focus on page load",
|
|
131
|
+
}),
|
|
132
|
+
}),
|
|
133
|
+
|
|
134
|
+
events: Section.category(PropsCategory.EventHandlers).children({
|
|
135
|
+
onChange: Prop.eventHandler().propertiesPanel({
|
|
136
|
+
label: "On change",
|
|
137
|
+
description: "Triggered when the file input changes",
|
|
138
|
+
computedArgs: [
|
|
139
|
+
{
|
|
140
|
+
name: "event",
|
|
141
|
+
type: "object",
|
|
142
|
+
description: "The event object",
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
}),
|
|
146
|
+
onFocus: Prop.eventHandler().propertiesPanel({
|
|
147
|
+
label: "On focus",
|
|
148
|
+
description: "Triggered when the input receives focus",
|
|
149
|
+
}),
|
|
150
|
+
onBlur: Prop.eventHandler().propertiesPanel({
|
|
151
|
+
label: "On blur",
|
|
152
|
+
description: "Triggered when the input loses focus",
|
|
153
|
+
}),
|
|
154
|
+
}),
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// Editor Configuration
|
|
158
|
+
const editorConfig: EditorConfig = {
|
|
159
|
+
icon: "file-picker",
|
|
160
|
+
description: "A file input component",
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// Registration
|
|
164
|
+
registerComponent(FileInput, propertiesDefinition).editorConfig(editorConfig);
|
|
165
|
+
|
|
166
|
+
export { FileInput };
|