@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,117 @@
|
|
|
1
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
registerComponent,
|
|
6
|
+
Prop,
|
|
7
|
+
Section,
|
|
8
|
+
PropsCategory,
|
|
9
|
+
type PropertiesPanelDefinition,
|
|
10
|
+
type EditorConfig,
|
|
11
|
+
} from "@superblocksteam/library";
|
|
12
|
+
|
|
13
|
+
import { cn } from "@/lib/utils";
|
|
14
|
+
|
|
15
|
+
function Avatar({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
|
|
19
|
+
return (
|
|
20
|
+
<AvatarPrimitive.Root
|
|
21
|
+
data-slot="avatar"
|
|
22
|
+
className={cn(
|
|
23
|
+
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function AvatarImage({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
35
|
+
return (
|
|
36
|
+
<AvatarPrimitive.Image
|
|
37
|
+
data-slot="avatar-image"
|
|
38
|
+
className={cn("aspect-square size-full", className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function AvatarFallback({
|
|
45
|
+
className,
|
|
46
|
+
...props
|
|
47
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
|
|
48
|
+
return (
|
|
49
|
+
<AvatarPrimitive.Fallback
|
|
50
|
+
data-slot="avatar-fallback"
|
|
51
|
+
className={cn(
|
|
52
|
+
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
53
|
+
className,
|
|
54
|
+
)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
61
|
+
|
|
62
|
+
// Properties Definition for Avatar (root)
|
|
63
|
+
const avatarPropertiesDefinition: PropertiesPanelDefinition<
|
|
64
|
+
React.ComponentPropsWithoutRef<typeof Avatar>
|
|
65
|
+
> = {
|
|
66
|
+
general: Section.category(PropsCategory.Content).children({
|
|
67
|
+
children: Prop.jsx(),
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const avatarEditorConfig: EditorConfig = {
|
|
72
|
+
icon: "image",
|
|
73
|
+
description: "An image element with a fallback for representing the user",
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// Properties Definition for AvatarImage
|
|
77
|
+
const avatarImagePropertiesDefinition: PropertiesPanelDefinition<
|
|
78
|
+
React.ComponentPropsWithoutRef<typeof AvatarImage>
|
|
79
|
+
> = {
|
|
80
|
+
general: Section.category(PropsCategory.Content).children({
|
|
81
|
+
src: Prop.string().propertiesPanel({
|
|
82
|
+
label: "Image source",
|
|
83
|
+
description: "URL of the avatar image",
|
|
84
|
+
}),
|
|
85
|
+
alt: Prop.string().propertiesPanel({
|
|
86
|
+
label: "Alt text",
|
|
87
|
+
description: "Alternative text for the avatar image",
|
|
88
|
+
}),
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// Properties Definition for AvatarFallback
|
|
93
|
+
const avatarFallbackPropertiesDefinition: PropertiesPanelDefinition<
|
|
94
|
+
React.ComponentPropsWithoutRef<typeof AvatarFallback>
|
|
95
|
+
> = {
|
|
96
|
+
general: Section.category(PropsCategory.Content).children({
|
|
97
|
+
children: Prop.jsx().propertiesPanel({
|
|
98
|
+
label: "Fallback content",
|
|
99
|
+
description:
|
|
100
|
+
"Content to display when image fails to load (typically initials)",
|
|
101
|
+
}),
|
|
102
|
+
}),
|
|
103
|
+
interaction: Section.category(PropsCategory.Interaction).children({
|
|
104
|
+
delayMs: Prop.number().propertiesPanel({
|
|
105
|
+
label: "Delay (ms)",
|
|
106
|
+
description:
|
|
107
|
+
"How long to wait before showing the fallback. This is useful to only show the fallback for those with slower connections.",
|
|
108
|
+
}),
|
|
109
|
+
}),
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// Register Components
|
|
113
|
+
registerComponent(Avatar, avatarPropertiesDefinition).editorConfig(
|
|
114
|
+
avatarEditorConfig,
|
|
115
|
+
);
|
|
116
|
+
registerComponent(AvatarImage, avatarImagePropertiesDefinition);
|
|
117
|
+
registerComponent(AvatarFallback, avatarFallbackPropertiesDefinition);
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/* eslint-disable react-refresh/only-export-components */
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
+
import type { IconName } from "lucide-react/dynamic";
|
|
5
|
+
import type * as React from "react";
|
|
6
|
+
|
|
7
|
+
import { registerComponent } from "@superblocksteam/library";
|
|
8
|
+
import {
|
|
9
|
+
Prop,
|
|
10
|
+
Section,
|
|
11
|
+
PropsCategory,
|
|
12
|
+
type PropertiesPanelDefinition,
|
|
13
|
+
type EditorConfig,
|
|
14
|
+
} from "@superblocksteam/library";
|
|
15
|
+
|
|
16
|
+
import { Icon as IconComponent } from "@/components/ui/icon";
|
|
17
|
+
import { cn } from "@/lib/utils";
|
|
18
|
+
|
|
19
|
+
// Variants
|
|
20
|
+
const badgeVariants = cva(
|
|
21
|
+
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
22
|
+
{
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
default:
|
|
26
|
+
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
27
|
+
secondary:
|
|
28
|
+
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
29
|
+
destructive:
|
|
30
|
+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
31
|
+
outline:
|
|
32
|
+
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
type BadgeVariantProps = VariantProps<typeof badgeVariants>;
|
|
42
|
+
|
|
43
|
+
// Base Badge Component
|
|
44
|
+
interface BaseBadgeProps
|
|
45
|
+
extends React.ComponentPropsWithoutRef<"span">, BadgeVariantProps {
|
|
46
|
+
asChild?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function BadgeComponent({
|
|
50
|
+
className,
|
|
51
|
+
variant,
|
|
52
|
+
asChild = false,
|
|
53
|
+
...props
|
|
54
|
+
}: BaseBadgeProps) {
|
|
55
|
+
const Comp = asChild ? Slot : "span";
|
|
56
|
+
return (
|
|
57
|
+
<Comp
|
|
58
|
+
data-slot="badge"
|
|
59
|
+
className={cn(
|
|
60
|
+
badgeVariants({
|
|
61
|
+
variant,
|
|
62
|
+
}),
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Badge with Icon Support
|
|
71
|
+
type BadgeProps = React.ComponentPropsWithoutRef<typeof BadgeComponent> & {
|
|
72
|
+
icon?: React.ReactElement | IconName;
|
|
73
|
+
onClick?: () => void;
|
|
74
|
+
} & Record<string, unknown>;
|
|
75
|
+
|
|
76
|
+
const Badge = ({ icon, children, ...props }: BadgeProps) => {
|
|
77
|
+
if (icon && typeof icon === "string") {
|
|
78
|
+
icon = <IconComponent icon={icon as IconName} />;
|
|
79
|
+
}
|
|
80
|
+
return (
|
|
81
|
+
<BadgeComponent {...props}>
|
|
82
|
+
{icon}
|
|
83
|
+
{children}
|
|
84
|
+
</BadgeComponent>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
type BadgeVariant = NonNullable<BadgeVariantProps["variant"]>;
|
|
89
|
+
|
|
90
|
+
// Properties Definition
|
|
91
|
+
const propertiesDefinition: PropertiesPanelDefinition<BadgeProps> = {
|
|
92
|
+
general: Section.category(PropsCategory.Content).children({
|
|
93
|
+
children: Prop.jsx().propertiesPanel({
|
|
94
|
+
label: "Children",
|
|
95
|
+
description: "The content of the badge",
|
|
96
|
+
}),
|
|
97
|
+
icon: Prop.any<JSX.Element | IconName>()
|
|
98
|
+
.propertiesPanel({
|
|
99
|
+
label: "Icon",
|
|
100
|
+
visibility: "SHOW_NAME",
|
|
101
|
+
defaultOnAdd: "info",
|
|
102
|
+
controlType: "ICON_SELECTOR",
|
|
103
|
+
})
|
|
104
|
+
.docs({
|
|
105
|
+
description:
|
|
106
|
+
"The icon to display in the component. You can use the Lucide icon library to find the icon you want.",
|
|
107
|
+
}),
|
|
108
|
+
}),
|
|
109
|
+
appearance: Section.category(PropsCategory.Appearance).children({
|
|
110
|
+
variant: Prop.string<BadgeVariant>().propertiesPanel({
|
|
111
|
+
label: "Variant",
|
|
112
|
+
controlType: "DROP_DOWN",
|
|
113
|
+
description: "The visual style of the badge",
|
|
114
|
+
options: [
|
|
115
|
+
{ label: "Default", value: "default" },
|
|
116
|
+
{ label: "Secondary", value: "secondary" },
|
|
117
|
+
{ label: "Destructive", value: "destructive" },
|
|
118
|
+
{ label: "Outline", value: "outline" },
|
|
119
|
+
],
|
|
120
|
+
}),
|
|
121
|
+
}),
|
|
122
|
+
|
|
123
|
+
events: Section.category(PropsCategory.EventHandlers).children({
|
|
124
|
+
onClick: Prop.eventHandler().propertiesPanel({
|
|
125
|
+
label: "onClick",
|
|
126
|
+
description: "Triggered when the badge is clicked",
|
|
127
|
+
}),
|
|
128
|
+
}),
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// Editor Template
|
|
132
|
+
// Editor Config
|
|
133
|
+
const editorConfig: EditorConfig = {
|
|
134
|
+
icon: "custom",
|
|
135
|
+
isDroppable: false,
|
|
136
|
+
description:
|
|
137
|
+
"A versatile badge component for displaying status, labels, or tags",
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// Register Component
|
|
141
|
+
registerComponent(Badge, propertiesDefinition).editorConfig(editorConfig);
|
|
142
|
+
|
|
143
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
BarChart as BarChartComponent,
|
|
4
|
+
Bar,
|
|
5
|
+
XAxis,
|
|
6
|
+
YAxis,
|
|
7
|
+
CartesianGrid,
|
|
8
|
+
LabelList,
|
|
9
|
+
} from "recharts";
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
registerComponent,
|
|
13
|
+
Prop,
|
|
14
|
+
Section,
|
|
15
|
+
PropsCategory,
|
|
16
|
+
type EditorConfig,
|
|
17
|
+
} from "@superblocksteam/library";
|
|
18
|
+
|
|
19
|
+
import { cn } from "@/lib/utils";
|
|
20
|
+
|
|
21
|
+
import type { ChartConfig } from "./chart";
|
|
22
|
+
import {
|
|
23
|
+
ChartContainer,
|
|
24
|
+
ChartTooltip,
|
|
25
|
+
ChartTooltipContent,
|
|
26
|
+
ChartLegend,
|
|
27
|
+
ChartLegendContent,
|
|
28
|
+
sanitizeForCssVar,
|
|
29
|
+
fixColorFormat,
|
|
30
|
+
createKeyMapping,
|
|
31
|
+
} from "./chart";
|
|
32
|
+
|
|
33
|
+
type ComponentProps = Omit<
|
|
34
|
+
React.ComponentPropsWithoutRef<typeof ChartContainer>,
|
|
35
|
+
"children" | "config"
|
|
36
|
+
> & {
|
|
37
|
+
data?: any[];
|
|
38
|
+
xAxisKey?: string;
|
|
39
|
+
categories?: string[];
|
|
40
|
+
seriesLabels?: Record<string, string>;
|
|
41
|
+
colors?: string[];
|
|
42
|
+
stackIds?: Record<string, string>;
|
|
43
|
+
gridStyle?: "solid" | "dashed" | "hidden";
|
|
44
|
+
showXAxis?: boolean;
|
|
45
|
+
showYAxis?: boolean;
|
|
46
|
+
showTooltip?: boolean;
|
|
47
|
+
showLegend?: boolean;
|
|
48
|
+
layout?: "horizontal" | "vertical";
|
|
49
|
+
barSize?: number;
|
|
50
|
+
stackOffset?: "expand" | "none" | "wiggle" | "silhouette";
|
|
51
|
+
barRadius?: number | [number, number, number, number];
|
|
52
|
+
showBarLabels?: boolean;
|
|
53
|
+
enableAnimation?: boolean;
|
|
54
|
+
onDataClick?: (data: any) => void;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const BarChart = ({ className, ...props }: ComponentProps) => {
|
|
58
|
+
const chartConfig: ChartConfig = React.useMemo(() => {
|
|
59
|
+
const effectiveCategories =
|
|
60
|
+
props.categories && props.categories.length > 0
|
|
61
|
+
? props.categories
|
|
62
|
+
: props.data && props.data.length > 0
|
|
63
|
+
? Object.keys(props.data[0]).filter((key) => {
|
|
64
|
+
if (key === props.xAxisKey) return false;
|
|
65
|
+
const value = props.data![0][key];
|
|
66
|
+
return typeof value === "number";
|
|
67
|
+
})
|
|
68
|
+
: [];
|
|
69
|
+
|
|
70
|
+
if (!effectiveCategories.length) return {};
|
|
71
|
+
|
|
72
|
+
const config: ChartConfig = {};
|
|
73
|
+
effectiveCategories.forEach((key, index) => {
|
|
74
|
+
const sanitizedKey = sanitizeForCssVar(key);
|
|
75
|
+
const label = props.seriesLabels?.[key] || key;
|
|
76
|
+
const color = fixColorFormat(
|
|
77
|
+
props.colors?.[index] || `var(--chart-${(index % 5) + 1})`,
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
config[sanitizedKey] = {
|
|
81
|
+
label,
|
|
82
|
+
color,
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
return config;
|
|
87
|
+
}, [
|
|
88
|
+
props.categories,
|
|
89
|
+
props.seriesLabels,
|
|
90
|
+
props.colors,
|
|
91
|
+
props.data,
|
|
92
|
+
props.xAxisKey,
|
|
93
|
+
]);
|
|
94
|
+
|
|
95
|
+
const keyMapping = React.useMemo(() => {
|
|
96
|
+
const effectiveCategories =
|
|
97
|
+
props.categories && props.categories.length > 0
|
|
98
|
+
? props.categories
|
|
99
|
+
: props.data && props.data.length > 0
|
|
100
|
+
? Object.keys(props.data[0]).filter((key) => {
|
|
101
|
+
if (key === props.xAxisKey) return false;
|
|
102
|
+
const value = props.data![0][key];
|
|
103
|
+
return typeof value === "number";
|
|
104
|
+
})
|
|
105
|
+
: [];
|
|
106
|
+
|
|
107
|
+
return effectiveCategories.length > 0
|
|
108
|
+
? createKeyMapping(
|
|
109
|
+
Object.fromEntries(effectiveCategories.map((k) => [k, { label: k }])),
|
|
110
|
+
)
|
|
111
|
+
: new Map();
|
|
112
|
+
}, [props.categories, props.data, props.xAxisKey]);
|
|
113
|
+
|
|
114
|
+
const hasData = Array.isArray(props.data) && props.data?.length;
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<ChartContainer
|
|
118
|
+
className={cn("h-full w-full pt-4 pb-4 pr-4", className)}
|
|
119
|
+
{...props}
|
|
120
|
+
config={chartConfig}
|
|
121
|
+
>
|
|
122
|
+
{hasData ? (
|
|
123
|
+
<BarChartComponent
|
|
124
|
+
data={props.data}
|
|
125
|
+
onClick={props.onDataClick}
|
|
126
|
+
accessibilityLayer
|
|
127
|
+
layout={props.layout}
|
|
128
|
+
barSize={props.barSize}
|
|
129
|
+
stackOffset={props.stackOffset}
|
|
130
|
+
>
|
|
131
|
+
{props.gridStyle !== "hidden" && (
|
|
132
|
+
<CartesianGrid
|
|
133
|
+
vertical={props.layout === "horizontal"}
|
|
134
|
+
strokeDasharray={props.gridStyle === "dashed" ? "3 3" : "0"}
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
|
|
138
|
+
{props.showXAxis && (
|
|
139
|
+
<XAxis
|
|
140
|
+
type={props.layout === "vertical" ? "number" : "category"}
|
|
141
|
+
dataKey={props.layout === "vertical" ? undefined : props.xAxisKey}
|
|
142
|
+
tickLine={false}
|
|
143
|
+
axisLine={false}
|
|
144
|
+
tickMargin={8}
|
|
145
|
+
/>
|
|
146
|
+
)}
|
|
147
|
+
|
|
148
|
+
{props.showYAxis && (
|
|
149
|
+
<YAxis
|
|
150
|
+
type={props.layout === "vertical" ? "category" : "number"}
|
|
151
|
+
dataKey={props.layout === "vertical" ? props.xAxisKey : undefined}
|
|
152
|
+
tickLine={false}
|
|
153
|
+
axisLine={false}
|
|
154
|
+
tickMargin={8}
|
|
155
|
+
/>
|
|
156
|
+
)}
|
|
157
|
+
|
|
158
|
+
{props.showTooltip && (
|
|
159
|
+
<ChartTooltip
|
|
160
|
+
cursor={{ fill: "rgba(0, 0, 0, 0.1)" }}
|
|
161
|
+
content={<ChartTooltipContent />}
|
|
162
|
+
/>
|
|
163
|
+
)}
|
|
164
|
+
|
|
165
|
+
{props.showLegend && <ChartLegend content={<ChartLegendContent />} />}
|
|
166
|
+
|
|
167
|
+
{Object.keys(chartConfig).map((key) => {
|
|
168
|
+
const originalKey = keyMapping.get(key) || key;
|
|
169
|
+
const stackId = props.stackIds?.[originalKey];
|
|
170
|
+
return (
|
|
171
|
+
<Bar
|
|
172
|
+
key={key}
|
|
173
|
+
dataKey={originalKey}
|
|
174
|
+
fill={`var(--color-${key})`}
|
|
175
|
+
radius={props.barRadius}
|
|
176
|
+
stackId={stackId || undefined}
|
|
177
|
+
isAnimationActive={props.enableAnimation}
|
|
178
|
+
>
|
|
179
|
+
{props.showBarLabels && (
|
|
180
|
+
<LabelList
|
|
181
|
+
dataKey={originalKey}
|
|
182
|
+
position={props.layout === "vertical" ? "right" : "top"}
|
|
183
|
+
className="fill-foreground font-semibold text-xs"
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
186
|
+
</Bar>
|
|
187
|
+
);
|
|
188
|
+
})}
|
|
189
|
+
</BarChartComponent>
|
|
190
|
+
) : (
|
|
191
|
+
<div className="flex items-center justify-center h-full w-full min-h-32 text-muted-foreground">
|
|
192
|
+
No data available
|
|
193
|
+
</div>
|
|
194
|
+
)}
|
|
195
|
+
</ChartContainer>
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const properties = {
|
|
200
|
+
general: Section.category(PropsCategory.Content).children({
|
|
201
|
+
data: Prop.array<any>()
|
|
202
|
+
.propertiesPanel({
|
|
203
|
+
label: "Data",
|
|
204
|
+
description: "Array of data objects for the bar chart",
|
|
205
|
+
controlType: "FUNCTION_CODE_EDITOR",
|
|
206
|
+
isJSConvertible: false,
|
|
207
|
+
})
|
|
208
|
+
.docs({
|
|
209
|
+
description:
|
|
210
|
+
"Array of objects where each object represents a category with X-axis value and Y-axis values for each data series. Each object should contain the xAxisKey property and properties for each bar series defined in categories. Example: [{month: 'January', desktop: 186, mobile: 80}, {month: 'February', desktop: 305, mobile: 200}]. Multiple Y-value properties create multiple bar series (grouped or stacked).",
|
|
211
|
+
}),
|
|
212
|
+
|
|
213
|
+
xAxisKey: Prop.string()
|
|
214
|
+
.propertiesPanel({
|
|
215
|
+
label: "X-axis data key",
|
|
216
|
+
description: " name for X-axis values (categories)",
|
|
217
|
+
placeholder: "category",
|
|
218
|
+
controlType: "DROP_DOWN",
|
|
219
|
+
options: function (this) {
|
|
220
|
+
if (!this.data || !Array.isArray(this.data) || !this.data.length) {
|
|
221
|
+
return [];
|
|
222
|
+
}
|
|
223
|
+
return Object.keys(this.data[0]).map((key) => ({
|
|
224
|
+
label: key,
|
|
225
|
+
value: key,
|
|
226
|
+
}));
|
|
227
|
+
},
|
|
228
|
+
})
|
|
229
|
+
.docs({
|
|
230
|
+
description:
|
|
231
|
+
"The property name in your data objects that contains the X-axis values (categories, labels, or identifiers). This determines the horizontal grouping of bars and should be consistent across all data objects.",
|
|
232
|
+
}),
|
|
233
|
+
|
|
234
|
+
categories: Prop.array<string>()
|
|
235
|
+
.propertiesPanel({
|
|
236
|
+
label: "Categories",
|
|
237
|
+
description:
|
|
238
|
+
"Array of data keys to plot as bar series (optional, auto-detects numeric properties if not provided)",
|
|
239
|
+
controlType: "FUNCTION_CODE_EDITOR",
|
|
240
|
+
isJSConvertible: false,
|
|
241
|
+
})
|
|
242
|
+
.docs({
|
|
243
|
+
description:
|
|
244
|
+
"Array of property names from your data objects to plot as separate bar series. Example: ['desktop', 'mobile'] will create two bar series. Each category should correspond to a numeric property in your data. If not provided, automatically detects all numeric properties (excluding xAxisKey) from the data.",
|
|
245
|
+
}),
|
|
246
|
+
|
|
247
|
+
seriesLabels: Prop.any<Record<string, string>>()
|
|
248
|
+
.propertiesPanel({
|
|
249
|
+
label: "Series labels",
|
|
250
|
+
description:
|
|
251
|
+
"Optional labels for series (optional, defaults to category names)",
|
|
252
|
+
controlType: "FUNCTION_CODE_EDITOR",
|
|
253
|
+
isJSConvertible: false,
|
|
254
|
+
})
|
|
255
|
+
.docs({
|
|
256
|
+
description:
|
|
257
|
+
"Optional object mapping category keys to display labels. Example: {desktop: 'Desktop Users', mobile: 'Mobile Users'}. If not provided, the category keys are used as labels.",
|
|
258
|
+
}),
|
|
259
|
+
|
|
260
|
+
colors: Prop.array<string>()
|
|
261
|
+
.propertiesPanel({
|
|
262
|
+
label: "Colors",
|
|
263
|
+
description: "Array of colors for series (optional)",
|
|
264
|
+
controlType: "FUNCTION_CODE_EDITOR",
|
|
265
|
+
isJSConvertible: false,
|
|
266
|
+
})
|
|
267
|
+
.docs({
|
|
268
|
+
description:
|
|
269
|
+
"Optional array of color values to use for series in order. Can be hex codes, rgb values, or CSS variables like 'var(--chart-1)'. Falls back to theme colors if not provided.",
|
|
270
|
+
}),
|
|
271
|
+
|
|
272
|
+
stackIds: Prop.any<Record<string, string>>()
|
|
273
|
+
.propertiesPanel({
|
|
274
|
+
label: "Stack IDs",
|
|
275
|
+
description: "Optional stack IDs for grouping bars (optional)",
|
|
276
|
+
controlType: "FUNCTION_CODE_EDITOR",
|
|
277
|
+
isJSConvertible: false,
|
|
278
|
+
})
|
|
279
|
+
.docs({
|
|
280
|
+
description:
|
|
281
|
+
"Optional object mapping category keys to stack IDs. Bars with the same stack ID will be stacked together. Example: {desktop: 'stack1', mobile: 'stack1'} stacks desktop and mobile bars.",
|
|
282
|
+
}),
|
|
283
|
+
}),
|
|
284
|
+
appearance: Section.category(PropsCategory.Appearance).children({
|
|
285
|
+
layout: Prop.string<"vertical" | "horizontal">()
|
|
286
|
+
.propertiesPanel({
|
|
287
|
+
label: "Layout",
|
|
288
|
+
description: "Orientation of the bars",
|
|
289
|
+
controlType: "DROP_DOWN",
|
|
290
|
+
options: [
|
|
291
|
+
{ label: "Vertical", value: "vertical" },
|
|
292
|
+
{ label: "Horizontal", value: "horizontal" },
|
|
293
|
+
],
|
|
294
|
+
})
|
|
295
|
+
.docs({
|
|
296
|
+
description:
|
|
297
|
+
"Chart orientation. 'vertical' creates bars that extend upward from bottom (categories on X-axis, values on Y-axis). 'horizontal' creates bars that extend rightward from left (categories on Y-axis, values on X-axis). Layout affects axis configuration and bar positioning.",
|
|
298
|
+
}),
|
|
299
|
+
|
|
300
|
+
gridStyle: Prop.string<"solid" | "dashed" | "hidden">().propertiesPanel({
|
|
301
|
+
label: "Grid style",
|
|
302
|
+
description: "Style of the chart grid lines",
|
|
303
|
+
controlType: "DROP_DOWN",
|
|
304
|
+
options: [
|
|
305
|
+
{ label: "Solid", value: "solid" },
|
|
306
|
+
{ label: "Dashed", value: "dashed" },
|
|
307
|
+
{ label: "Hidden", value: "hidden" },
|
|
308
|
+
],
|
|
309
|
+
}),
|
|
310
|
+
showXAxis: Prop.boolean().propertiesPanel({
|
|
311
|
+
label: "Show X-axis",
|
|
312
|
+
description: "Display X-axis with labels",
|
|
313
|
+
controlType: "SWITCH",
|
|
314
|
+
}),
|
|
315
|
+
showYAxis: Prop.boolean().propertiesPanel({
|
|
316
|
+
label: "Show Y-axis",
|
|
317
|
+
description: "Display Y-axis with labels",
|
|
318
|
+
controlType: "SWITCH",
|
|
319
|
+
}),
|
|
320
|
+
showTooltip: Prop.boolean().propertiesPanel({
|
|
321
|
+
label: "Show tooltip",
|
|
322
|
+
description: "Display tooltip on hover",
|
|
323
|
+
controlType: "SWITCH",
|
|
324
|
+
}),
|
|
325
|
+
showLegend: Prop.boolean().propertiesPanel({
|
|
326
|
+
label: "Show legend",
|
|
327
|
+
description: "Display chart legend",
|
|
328
|
+
controlType: "SWITCH",
|
|
329
|
+
}),
|
|
330
|
+
barSize: Prop.number().propertiesPanel({
|
|
331
|
+
label: "Bar size",
|
|
332
|
+
description: "Width/height of the bars",
|
|
333
|
+
visibility: "SHOW_NAME",
|
|
334
|
+
defaultOnAdd: 40,
|
|
335
|
+
}),
|
|
336
|
+
barRadius: Prop.number().propertiesPanel({
|
|
337
|
+
label: "Bar radius",
|
|
338
|
+
description: "Border radius of the bars for rounded corners",
|
|
339
|
+
visibility: "SHOW_NAME",
|
|
340
|
+
defaultOnAdd: 0,
|
|
341
|
+
}),
|
|
342
|
+
showBarLabels: Prop.boolean().propertiesPanel({
|
|
343
|
+
label: "Show bar labels",
|
|
344
|
+
description: "Display value labels on bars",
|
|
345
|
+
controlType: "SWITCH",
|
|
346
|
+
}),
|
|
347
|
+
stackOffset: Prop.string<"none" | "expand">()
|
|
348
|
+
.propertiesPanel({
|
|
349
|
+
label: "Stack offset",
|
|
350
|
+
description: "Type of stacking for multiple series (expand = 100%)",
|
|
351
|
+
controlType: "DROP_DOWN",
|
|
352
|
+
options: [
|
|
353
|
+
{ label: "None", value: "none" },
|
|
354
|
+
{ label: "Expand (100%)", value: "expand" },
|
|
355
|
+
],
|
|
356
|
+
})
|
|
357
|
+
.docs({
|
|
358
|
+
description:
|
|
359
|
+
"Stacking behavior for bars with matching stackId. 'none' shows actual values with bars stacked to their natural heights. 'expand' normalizes all stacked bars to 100% height, showing relative proportions rather than absolute values. Only affects bars that share the same stackId.",
|
|
360
|
+
}),
|
|
361
|
+
}),
|
|
362
|
+
interaction: Section.category(PropsCategory.Interaction).children({
|
|
363
|
+
enableAnimation: Prop.boolean().propertiesPanel({
|
|
364
|
+
label: "Enable animation",
|
|
365
|
+
description: "Enable chart animations on load",
|
|
366
|
+
controlType: "SWITCH",
|
|
367
|
+
}),
|
|
368
|
+
}),
|
|
369
|
+
events: Section.category(PropsCategory.EventHandlers).children({
|
|
370
|
+
onDataClick: Prop.eventHandler().propertiesPanel({
|
|
371
|
+
label: "onDataClick",
|
|
372
|
+
description: "Triggered when a bar is clicked",
|
|
373
|
+
computedArgs: [
|
|
374
|
+
{
|
|
375
|
+
name: "data",
|
|
376
|
+
type: "object",
|
|
377
|
+
description: "The data point that was clicked",
|
|
378
|
+
},
|
|
379
|
+
],
|
|
380
|
+
}),
|
|
381
|
+
}),
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
const editorConfig: EditorConfig = {
|
|
385
|
+
icon: "chart",
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
registerComponent(BarChart, properties).editorConfig(editorConfig);
|
|
389
|
+
|
|
390
|
+
export { BarChart };
|