@agent-native/core 0.86.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +21 -0
- package/corpus/core/docs/content/components.mdx +13 -0
- package/corpus/core/docs/content/creating-templates.mdx +7 -0
- package/corpus/core/docs/content/locales/ar-SA/components.mdx +9 -0
- package/corpus/core/docs/content/locales/ar-SA/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/ar-SA/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/ar-SA/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/ar-SA/tracking.mdx +6 -0
- package/corpus/core/docs/content/locales/de-DE/components.mdx +9 -0
- package/corpus/core/docs/content/locales/de-DE/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/de-DE/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/de-DE/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/de-DE/tracking.mdx +6 -0
- package/corpus/core/docs/content/locales/es-ES/components.mdx +9 -0
- package/corpus/core/docs/content/locales/es-ES/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/es-ES/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/es-ES/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/es-ES/tracking.mdx +6 -0
- package/corpus/core/docs/content/locales/fr-FR/components.mdx +9 -0
- package/corpus/core/docs/content/locales/fr-FR/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/fr-FR/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/fr-FR/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/fr-FR/tracking.mdx +6 -0
- package/corpus/core/docs/content/locales/hi-IN/components.mdx +9 -0
- package/corpus/core/docs/content/locales/hi-IN/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/hi-IN/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/hi-IN/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/hi-IN/tracking.mdx +6 -0
- package/corpus/core/docs/content/locales/ja-JP/components.mdx +9 -0
- package/corpus/core/docs/content/locales/ja-JP/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/ja-JP/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/ja-JP/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/ja-JP/tracking.mdx +6 -0
- package/corpus/core/docs/content/locales/ko-KR/components.mdx +9 -0
- package/corpus/core/docs/content/locales/ko-KR/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/ko-KR/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/ko-KR/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/ko-KR/tracking.mdx +6 -0
- package/corpus/core/docs/content/locales/pt-BR/components.mdx +9 -0
- package/corpus/core/docs/content/locales/pt-BR/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/pt-BR/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/pt-BR/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/pt-BR/tracking.mdx +6 -0
- package/corpus/core/docs/content/locales/zh-CN/components.mdx +9 -0
- package/corpus/core/docs/content/locales/zh-CN/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-CN/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/zh-CN/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/zh-CN/tracking.mdx +6 -0
- package/corpus/core/docs/content/locales/zh-TW/components.mdx +9 -0
- package/corpus/core/docs/content/locales/zh-TW/creating-templates.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-TW/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/locales/zh-TW/template-clips.mdx +7 -0
- package/corpus/core/docs/content/locales/zh-TW/tracking.mdx +6 -0
- package/corpus/core/docs/content/template-analytics.mdx +6 -0
- package/corpus/core/docs/content/template-clips.mdx +7 -0
- package/corpus/core/docs/content/tracking.mdx +6 -0
- package/corpus/core/package.json +9 -1
- package/corpus/core/src/application-state/emitter.ts +37 -5
- package/corpus/core/src/cli/create.ts +55 -3
- package/corpus/core/src/cli/workspacify.ts +10 -4
- package/corpus/core/src/client/AgentPanel.tsx +10 -0
- package/corpus/core/src/client/AssistantChat.tsx +91 -27
- package/corpus/core/src/client/ErrorBoundary.tsx +67 -12
- package/corpus/core/src/client/ErrorReportActions.tsx +69 -0
- package/corpus/core/src/client/FeedbackButton.tsx +8 -4
- package/corpus/core/src/client/components/ui/dialog.tsx +1 -91
- package/corpus/core/src/client/components/ui/dropdown-menu.tsx +1 -191
- package/corpus/core/src/client/components/ui/hover-card.tsx +1 -29
- package/corpus/core/src/client/components/ui/popover.tsx +1 -31
- package/corpus/core/src/client/components/ui/sheet.tsx +1 -96
- package/corpus/core/src/client/components/ui/tooltip.tsx +1 -53
- package/corpus/core/src/client/db-admin/DbAdminPage.tsx +41 -13
- package/corpus/core/src/client/db-admin/SqlEditor.tsx +10 -3
- package/corpus/core/src/client/db-admin/TableEditor.tsx +12 -5
- package/corpus/core/src/client/db-admin/useAgentSync.ts +10 -3
- package/corpus/core/src/client/db-admin/useDbAdmin.ts +65 -16
- package/corpus/core/src/client/error-reporting.ts +100 -0
- package/corpus/core/src/client/index.ts +11 -0
- package/corpus/core/src/client/org/RequireActiveOrg.tsx +12 -0
- package/corpus/core/src/client/visual-style-controls.tsx +615 -2
- package/corpus/core/src/db-admin/index.ts +26 -0
- package/corpus/core/src/db-admin/operations.ts +87 -49
- package/corpus/core/src/localization/default-messages.ts +4 -0
- package/corpus/core/src/secrets/crypto.ts +47 -9
- package/corpus/core/src/server/agent-access.ts +72 -0
- package/corpus/core/src/server/builder-design-systems.ts +328 -9
- package/corpus/core/src/server/h3-helpers.ts +14 -2
- package/corpus/core/src/server/index.ts +34 -0
- package/corpus/core/src/server/request-context.ts +64 -7
- package/corpus/core/src/shared/agent-access.ts +112 -0
- package/corpus/core/src/shared/index.ts +14 -0
- package/corpus/core/src/templates/default/app/root.tsx +47 -0
- package/corpus/templates/analytics/AGENTS.md +10 -4
- package/corpus/templates/analytics/actions/delete-db-admin-connection.ts +19 -0
- package/corpus/templates/analytics/actions/list-db-admin-connections.ts +18 -0
- package/corpus/templates/analytics/actions/navigate.ts +17 -3
- package/corpus/templates/analytics/actions/save-db-admin-connection.ts +33 -0
- package/corpus/templates/analytics/actions/view-screen.ts +11 -3
- package/corpus/templates/analytics/app/components/InlineMetric.tsx +2 -2
- package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +7 -2
- package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +16 -11
- package/corpus/templates/analytics/app/components/dashboard/DateRangePicker.tsx +2 -1
- package/corpus/templates/analytics/app/components/dashboard/MetricCard.tsx +7 -2
- package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +6 -3
- package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +6 -1
- package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +7 -2
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +15 -11
- package/corpus/templates/analytics/app/components/dashboard/StatsCard.tsx +7 -1
- package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +7 -2
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +16 -16
- package/corpus/templates/analytics/app/components/layout/HeaderActions.tsx +1 -2
- package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +5 -2
- package/corpus/templates/analytics/app/components/layout/NewAnalysisDialog.tsx +6 -6
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +3 -4
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +12 -9
- package/corpus/templates/analytics/app/components/ui/calendar.tsx +1 -1
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +11 -2
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +23 -2
- package/corpus/templates/analytics/app/i18n-data.ts +230 -20
- package/corpus/templates/analytics/app/pages/Agents.tsx +406 -12
- package/corpus/templates/analytics/app/pages/DataDictionary.tsx +21 -21
- package/corpus/templates/analytics/app/pages/DataSources.tsx +28 -28
- package/corpus/templates/analytics/app/pages/NotFound.tsx +1 -2
- package/corpus/templates/analytics/app/pages/Placeholder.tsx +1 -2
- package/corpus/templates/analytics/app/pages/Settings.tsx +16 -16
- package/corpus/templates/analytics/app/pages/adhoc/DashboardSkeleton.tsx +2 -3
- package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +13 -8
- package/corpus/templates/analytics/app/pages/adhoc/_shared/components/DateRangeInput.tsx +2 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ChartTypePicker.tsx +4 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/DateRangePicker.tsx +2 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventCombobox.tsx +7 -7
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventPanel.tsx +1 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventRow.tsx +1 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ExplorerChart.tsx +8 -3
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/FilterBuilder.tsx +4 -5
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/GroupByPicker.tsx +1 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyCombobox.tsx +7 -7
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyValueCombobox.tsx +7 -7
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +16 -16
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +21 -16
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +32 -32
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +14 -14
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +13 -14
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +21 -13
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +28 -23
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewSqlPopover.tsx +12 -12
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +15 -15
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +33 -29
- package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +7 -8
- package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +19 -19
- package/corpus/templates/analytics/app/pages/analyses/LegacyFusionAnalysis.tsx +15 -11
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +42 -23
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +12 -7
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +12 -12
- package/corpus/templates/analytics/app/pages/settings/AlertRulesSettingsCard.tsx +25 -25
- package/corpus/templates/analytics/app/root.tsx +2 -2
- package/corpus/templates/analytics/app/routes/catalog.tsx +8 -8
- package/corpus/templates/analytics/changelog/2026-07-03-connect-other-app-databases-from-analytics.md +6 -0
- package/corpus/templates/analytics/package.json +1 -0
- package/corpus/templates/analytics/server/db/schema.ts +27 -0
- package/corpus/templates/analytics/server/lib/db-admin-connections.ts +458 -0
- package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +59 -59
- package/corpus/templates/analytics/server/plugins/db.ts +35 -0
- package/corpus/templates/analytics/server/routes/[base]/_agent-native/analytics-db-admin/[...path].ts +1 -0
- package/corpus/templates/analytics/server/routes/_agent-native/analytics-db-admin/[...path].ts +160 -0
- package/corpus/templates/analytics/shared/session-replay-agent-access.ts +14 -3
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +2 -3
- package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +9 -9
- package/corpus/templates/assets/app/components/layout/Header.tsx +4 -2
- package/corpus/templates/assets/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/assets/app/components/layout/PageShell.tsx +5 -6
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +12 -12
- package/corpus/templates/assets/app/components/library/CreateLibraryDialog.tsx +8 -8
- package/corpus/templates/assets/app/components/library/EditLibraryDialog.tsx +7 -7
- package/corpus/templates/assets/app/components/library/LibraryCard.tsx +8 -8
- package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +2 -3
- package/corpus/templates/assets/app/root.tsx +1 -1
- package/corpus/templates/assets/app/routes/asset.$id.tsx +19 -19
- package/corpus/templates/assets/app/routes/audit.tsx +14 -15
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +54 -49
- package/corpus/templates/assets/app/routes/library.tsx +31 -31
- package/corpus/templates/assets/app/routes/settings.tsx +18 -18
- package/corpus/templates/assets/package.json +1 -0
- package/corpus/templates/brain/app/components/brain/CanonicalPreviewSheet.tsx +5 -6
- package/corpus/templates/brain/app/components/brain/Surface.tsx +8 -3
- package/corpus/templates/brain/app/components/layout/Layout.tsx +7 -7
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +6 -6
- package/corpus/templates/brain/app/routes/knowledge.tsx +19 -19
- package/corpus/templates/brain/app/routes/ops.tsx +18 -18
- package/corpus/templates/brain/app/routes/review.tsx +27 -22
- package/corpus/templates/brain/app/routes/search.tsx +20 -20
- package/corpus/templates/brain/app/routes/settings.tsx +22 -22
- package/corpus/templates/brain/app/routes/sources.tsx +23 -23
- package/corpus/templates/brain/package.json +1 -0
- package/corpus/templates/calendar/app/components/ThemeToggle.tsx +5 -5
- package/corpus/templates/calendar/app/components/TimezoneCombobox.tsx +6 -6
- package/corpus/templates/calendar/app/components/booking/BookingConfirmation.tsx +1 -2
- package/corpus/templates/calendar/app/components/booking/BookingForm.tsx +8 -9
- package/corpus/templates/calendar/app/components/booking/DatePicker.tsx +2 -2
- package/corpus/templates/calendar/app/components/booking/TimeSlotPicker.tsx +2 -3
- package/corpus/templates/calendar/app/components/calendar/AddCalendarDialog.tsx +15 -10
- package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +6 -6
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +27 -27
- package/corpus/templates/calendar/app/components/calendar/DeleteEventDialog.tsx +12 -9
- package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +13 -10
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +7 -7
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +21 -21
- package/corpus/templates/calendar/app/components/calendar/EventDialog.tsx +11 -11
- package/corpus/templates/calendar/app/components/calendar/EventOptionControls.tsx +9 -9
- package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +9 -9
- package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +6 -6
- package/corpus/templates/calendar/app/components/calendar/GoogleSetupWizard.tsx +3 -3
- package/corpus/templates/calendar/app/components/calendar/GoogleSyncButton.tsx +1 -1
- package/corpus/templates/calendar/app/components/calendar/GuestNotificationDialog.tsx +10 -8
- package/corpus/templates/calendar/app/components/calendar/IntegrationsSidebar.tsx +12 -12
- package/corpus/templates/calendar/app/components/calendar/KeyboardShortcutsHelp.tsx +2 -2
- package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +1 -1
- package/corpus/templates/calendar/app/components/calendar/PeopleSearchDialog.tsx +6 -6
- package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +6 -6
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +2 -2
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +16 -16
- package/corpus/templates/calendar/app/pages/AvailabilitySettings.tsx +11 -11
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +50 -45
- package/corpus/templates/calendar/app/pages/BookingPage.tsx +2 -2
- package/corpus/templates/calendar/app/pages/BookingsList.tsx +12 -12
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +17 -17
- package/corpus/templates/calendar/app/pages/ManageBookingPage.tsx +13 -13
- package/corpus/templates/calendar/app/pages/Settings.tsx +12 -12
- package/corpus/templates/calendar/app/routes/event.tsx +2 -2
- package/corpus/templates/calendar/package.json +1 -0
- package/corpus/templates/chat/app/components/layout/Header.tsx +4 -2
- package/corpus/templates/chat/app/components/layout/Layout.tsx +7 -7
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +12 -12
- package/corpus/templates/chat/app/routes/database.tsx +1 -2
- package/corpus/templates/chat/app/routes/observability.tsx +1 -1
- package/corpus/templates/chat/app/routes/settings.tsx +5 -5
- package/corpus/templates/chat/package.json +1 -0
- package/corpus/templates/clips/AGENTS.md +5 -0
- package/corpus/templates/clips/actions/create-recording-agent-link.ts +15 -20
- package/corpus/templates/clips/actions/delete-recording-permanent.ts +74 -34
- package/corpus/templates/clips/app/components/capture-install-options.tsx +6 -6
- package/corpus/templates/clips/app/components/editable-recording-title.tsx +2 -2
- package/corpus/templates/clips/app/components/editor/chapters-editor.tsx +7 -7
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +165 -3
- package/corpus/templates/clips/app/components/editor/editor-toolbar.tsx +101 -57
- package/corpus/templates/clips/app/components/editor/split-button.tsx +4 -5
- package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +9 -9
- package/corpus/templates/clips/app/components/editor/thumbnail-picker.tsx +16 -11
- package/corpus/templates/clips/app/components/editor/timeline.tsx +4 -6
- package/corpus/templates/clips/app/components/editor/transcript-editor.tsx +5 -5
- package/corpus/templates/clips/app/components/editor/trim-handles.tsx +4 -7
- package/corpus/templates/clips/app/components/editor/waveform.tsx +13 -4
- package/corpus/templates/clips/app/components/layout/Header.tsx +4 -2
- package/corpus/templates/clips/app/components/layout/Layout.tsx +2 -3
- package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +4 -4
- package/corpus/templates/clips/app/components/library/create-space-dialog.tsx +8 -8
- package/corpus/templates/clips/app/components/library/empty-state.tsx +1 -2
- package/corpus/templates/clips/app/components/library/folder-tree.tsx +14 -14
- package/corpus/templates/clips/app/components/library/library-grid.tsx +7 -7
- package/corpus/templates/clips/app/components/library/library-layout.tsx +16 -16
- package/corpus/templates/clips/app/components/library/organization-switcher.tsx +11 -11
- package/corpus/templates/clips/app/components/library/recording-card.tsx +16 -12
- package/corpus/templates/clips/app/components/library/search-bar.tsx +5 -5
- package/corpus/templates/clips/app/components/library/sort-menu.tsx +3 -4
- package/corpus/templates/clips/app/components/library/tag-input.tsx +4 -4
- package/corpus/templates/clips/app/components/meetings/attendee-stack.tsx +6 -2
- package/corpus/templates/clips/app/components/meetings/auto-record-prompt.tsx +1 -1
- package/corpus/templates/clips/app/components/meetings/bullet-link.tsx +4 -4
- package/corpus/templates/clips/app/components/meetings/canvas-editor.tsx +5 -5
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +3 -3
- package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +9 -9
- package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +11 -6
- package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +4 -4
- package/corpus/templates/clips/app/components/player/access-password-prompt.tsx +2 -3
- package/corpus/templates/clips/app/components/player/comments-panel.tsx +14 -14
- package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +6 -7
- package/corpus/templates/clips/app/components/player/insights-panel.tsx +1 -2
- package/corpus/templates/clips/app/components/player/player-controls.tsx +15 -15
- package/corpus/templates/clips/app/components/player/reactions-tray.tsx +3 -3
- package/corpus/templates/clips/app/components/player/settings-panel.tsx +12 -13
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +20 -11
- package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +2 -3
- package/corpus/templates/clips/app/components/player/timestamped-comment-button.tsx +2 -2
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +7 -7
- package/corpus/templates/clips/app/components/player/video-player.tsx +9 -9
- package/corpus/templates/clips/app/components/recorder/camera-visualizer.tsx +1 -1
- package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +1 -1
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +21 -21
- package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +5 -6
- package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +6 -7
- package/corpus/templates/clips/app/components/sharing/share-ui.tsx +10 -10
- package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +9 -5
- package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +19 -9
- package/corpus/templates/clips/app/components/workspace/invite-dialog.tsx +9 -10
- package/corpus/templates/clips/app/components/workspace/members-list.tsx +10 -11
- package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +1 -2
- package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +2 -3
- package/corpus/templates/clips/app/components/workspace/top-videos-table.tsx +2 -3
- package/corpus/templates/clips/app/hooks/use-desktop-promo.ts +1 -2
- package/corpus/templates/clips/app/root.tsx +10 -10
- package/corpus/templates/clips/app/routes/_app.dictate.tsx +13 -13
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +35 -26
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +20 -20
- package/corpus/templates/clips/app/routes/_app.notifications.tsx +3 -3
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +31 -31
- package/corpus/templates/clips/app/routes/_app.settings.organization.tsx +13 -8
- package/corpus/templates/clips/app/routes/_app.spaces._index.tsx +1 -1
- package/corpus/templates/clips/app/routes/_app.trash.tsx +10 -10
- package/corpus/templates/clips/app/routes/bug-report.done.tsx +1 -1
- package/corpus/templates/clips/app/routes/bug-report.tsx +11 -11
- package/corpus/templates/clips/app/routes/download.tsx +2 -2
- package/corpus/templates/clips/app/routes/embed.$shareId.tsx +1 -1
- package/corpus/templates/clips/app/routes/invite.$token.tsx +13 -8
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +28 -23
- package/corpus/templates/clips/app/routes/record.tsx +3 -3
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +41 -20
- package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +2 -2
- package/corpus/templates/clips/changelog/2026-07-05-desktop-full-screen-recordings-with-system-audio-now-finaliz.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-05-desktop-recording-shortcut-start-stop.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-05-desktop-recordings-no-longer-fail-when-saved-capture-constra.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-05-permanently-deleted-clips-now-clean-up-s3-media-objects.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-05-timeline-zoom-controls-are-now-visible-in-the-clip-editor-an.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +98 -1
- package/corpus/templates/clips/desktop/src/components/MediaDeviceRow.tsx +3 -2
- package/corpus/templates/clips/desktop/src/lib/media-capture-constraints.ts +121 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +55 -84
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +77 -39
- package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +60 -8
- package/corpus/templates/clips/package.json +1 -0
- package/corpus/templates/clips/server/lib/public-agent-context.ts +17 -12
- package/corpus/templates/clips/server/lib/recording-media-cleanup.ts +110 -0
- package/corpus/templates/clips/server/lib/s3-upload-provider.ts +126 -0
- package/corpus/templates/clips/server/routes/api/public-recording.get.ts +47 -11
- package/corpus/templates/clips/shared/agent-context.ts +23 -21
- package/corpus/templates/content/app/blocks/contentBlockRegistry.tsx +4 -4
- package/corpus/templates/content/app/components/EmptyState.tsx +1 -1
- package/corpus/templates/content/app/components/ThemeToggle.tsx +6 -6
- package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +5 -5
- package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +5 -5
- package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +1 -1
- package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +36 -36
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +3 -3
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +29 -29
- package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +23 -23
- package/corpus/templates/content/app/components/editor/EmojiPicker.tsx +4 -5
- package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +4 -5
- package/corpus/templates/content/app/components/editor/NotionConflictBanner.tsx +1 -1
- package/corpus/templates/content/app/components/editor/NotionSyncBar.tsx +2 -2
- package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +5 -5
- package/corpus/templates/content/app/components/editor/TableHoverControls.tsx +13 -13
- package/corpus/templates/content/app/components/editor/VersionHistoryPanel.tsx +10 -10
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +41 -41
- package/corpus/templates/content/app/components/editor/database/shared.tsx +19 -19
- package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +8 -9
- package/corpus/templates/content/app/components/editor/extensions/AudioBlock.tsx +18 -19
- package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +20 -21
- package/corpus/templates/content/app/components/editor/extensions/LocalMdxComponentNode.tsx +8 -8
- package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +18 -19
- package/corpus/templates/content/app/components/layout/Header.tsx +4 -2
- package/corpus/templates/content/app/components/layout/Layout.tsx +3 -3
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +22 -22
- package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +22 -22
- package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +11 -11
- package/corpus/templates/content/app/root.tsx +13 -5
- package/corpus/templates/content/app/routes/_app._index.tsx +1 -1
- package/corpus/templates/content/app/routes/_app.local-files.tsx +11 -11
- package/corpus/templates/content/app/routes/_app.settings.tsx +3 -3
- package/corpus/templates/content/changelog/2026-07-03-error-screens-now-include-a-feedback-button-with-debug-info.md +6 -0
- package/corpus/templates/content/package.json +1 -0
- package/corpus/templates/design/AGENTS.md +13 -7
- package/corpus/templates/design/actions/get-design-system.ts +21 -0
- package/corpus/templates/design/actions/index-design-system-with-builder.ts +14 -37
- package/corpus/templates/design/app/components/ThemeToggle.tsx +6 -6
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +11 -11
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +2 -2
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +21 -16
- package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +3 -3
- package/corpus/templates/design/app/components/design/DrawOverlay.tsx +7 -7
- package/corpus/templates/design/app/components/design/EditPanel.tsx +30 -30
- package/corpus/templates/design/app/components/design/FusionAppBanner.tsx +8 -9
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +14 -14
- package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +5 -6
- package/corpus/templates/design/app/components/design/MotionDock.tsx +15 -15
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +3 -3
- package/corpus/templates/design/app/components/design/ReviewPanel.tsx +3 -3
- package/corpus/templates/design/app/components/design/StatesPanel.tsx +13 -13
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +14 -14
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design/code-workbench/ActivityBar.tsx +3 -3
- package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +3 -3
- package/corpus/templates/design/app/components/design/code-workbench/SideBar.tsx +70 -9
- package/corpus/templates/design/app/components/design/code-workbench/editor/EditorTabs.tsx +17 -8
- package/corpus/templates/design/app/components/design/code-workbench/editor/MonacoHost.tsx +2 -3
- package/corpus/templates/design/app/components/design/code-workbench/editor/StatusBar.tsx +1 -1
- package/corpus/templates/design/app/components/design/code-workbench/explorer/ExplorerView.tsx +8 -2
- package/corpus/templates/design/app/components/design/code-workbench/explorer/FileTree.tsx +24 -20
- package/corpus/templates/design/app/components/design/code-workbench/search/SearchView.tsx +6 -6
- package/corpus/templates/design/app/components/design/code-workbench/store.tsx +48 -0
- package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +3 -3
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +7 -7
- package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +3 -3
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +18 -18
- package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +6 -6
- package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +7 -7
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +7 -7
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +14 -14
- package/corpus/templates/design/app/components/design/inspector/ShaderEffectRow.tsx +9 -9
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design-system/DesignSystemCard.tsx +2 -3
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +18 -15
- package/corpus/templates/design/app/components/layout/Header.tsx +4 -2
- package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +5 -5
- package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +7 -7
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +7 -7
- package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +3 -3
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +6 -0
- package/corpus/templates/design/app/i18n/zh-TW.ts +15 -14
- package/corpus/templates/design/app/i18n-data.ts +154 -142
- package/corpus/templates/design/app/pages/DesignEditor.tsx +51 -47
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +40 -22
- package/corpus/templates/design/app/pages/DesignSystems.tsx +32 -32
- package/corpus/templates/design/app/pages/Index.tsx +28 -28
- package/corpus/templates/design/app/pages/NotFound.tsx +1 -2
- package/corpus/templates/design/app/pages/Present.tsx +1 -2
- package/corpus/templates/design/app/pages/VisualEdit.tsx +1 -2
- package/corpus/templates/design/app/root.tsx +1 -1
- package/corpus/templates/design/app/routes/settings.tsx +3 -3
- package/corpus/templates/design/changelog/2026-07-03-design-system-setup-now-indexes-figma-code-and-design-md-sou.md +6 -0
- package/corpus/templates/design/changelog/2026-07-03-the-code-editor-is-easier-to-use-with-top-sidebar-tabs-clear.md +6 -0
- package/corpus/templates/design/package.json +1 -0
- package/corpus/templates/design/server/lib/builder-design-system-proxy.ts +16 -106
- package/corpus/templates/forms/app/components/CloudUpgrade.tsx +10 -10
- package/corpus/templates/forms/app/components/ThemeToggle.tsx +5 -5
- package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +10 -11
- package/corpus/templates/forms/app/components/builder/FieldRenderer.tsx +13 -10
- package/corpus/templates/forms/app/components/layout/Header.tsx +4 -2
- package/corpus/templates/forms/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +15 -15
- package/corpus/templates/forms/app/components/ui/calendar.tsx +1 -1
- package/corpus/templates/forms/app/components/ui/command.tsx +1 -1
- package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +24 -24
- package/corpus/templates/forms/app/pages/FormFillPage.tsx +2 -2
- package/corpus/templates/forms/app/pages/FormsListPage.tsx +25 -25
- package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +11 -11
- package/corpus/templates/forms/app/pages/ResponsesPage.tsx +4 -4
- package/corpus/templates/forms/app/routes/_app.settings.tsx +5 -5
- package/corpus/templates/forms/app/routes/form-preview.tsx +3 -3
- package/corpus/templates/forms/package.json +1 -0
- package/corpus/templates/macros/app/components/AddExerciseDialog.tsx +1 -1
- package/corpus/templates/macros/app/components/AddMealDialog.tsx +1 -1
- package/corpus/templates/macros/app/components/AddWeightDialog.tsx +1 -1
- package/corpus/templates/macros/app/components/DailyProgress.tsx +7 -7
- package/corpus/templates/macros/app/components/WeeklyCaloriesChart.tsx +1 -2
- package/corpus/templates/macros/app/components/WeightCard.tsx +10 -10
- package/corpus/templates/macros/app/components/WeightTracker.tsx +1 -1
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +11 -7
- package/corpus/templates/macros/app/components/layout/Header.tsx +4 -2
- package/corpus/templates/macros/app/root.tsx +1 -1
- package/corpus/templates/macros/app/routes/_index.tsx +1 -1
- package/corpus/templates/macros/app/routes/analytics.tsx +9 -9
- package/corpus/templates/macros/app/routes/settings.tsx +2 -2
- package/corpus/templates/macros/package.json +1 -0
- package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +1 -1
- package/corpus/templates/mail/app/components/ThemeToggle.tsx +6 -6
- package/corpus/templates/mail/app/components/agent-engine-picker.tsx +10 -10
- package/corpus/templates/mail/app/components/email/CodeBlockLangPicker.tsx +3 -4
- package/corpus/templates/mail/app/components/email/ComposeBubbleToolbar.tsx +5 -5
- package/corpus/templates/mail/app/components/email/ComposeEditor.tsx +9 -9
- package/corpus/templates/mail/app/components/email/ComposeModal.tsx +18 -18
- package/corpus/templates/mail/app/components/email/EmailList.tsx +17 -17
- package/corpus/templates/mail/app/components/email/EmailListItem.tsx +5 -5
- package/corpus/templates/mail/app/components/email/EmailThread.tsx +6 -6
- package/corpus/templates/mail/app/components/email/InlineReplyComposer.tsx +11 -11
- package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +13 -13
- package/corpus/templates/mail/app/components/email/MobileActionBar.tsx +13 -13
- package/corpus/templates/mail/app/components/email/RecipientInput.tsx +13 -13
- package/corpus/templates/mail/app/components/email/SendLaterButton.tsx +4 -5
- package/corpus/templates/mail/app/components/email/SnoozeModal.tsx +1 -1
- package/corpus/templates/mail/app/components/email/SnoozePopover.tsx +6 -6
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +12 -12
- package/corpus/templates/mail/app/components/layout/SearchBar.tsx +5 -5
- package/corpus/templates/mail/app/components/settings/GmailFiltersSection.tsx +23 -23
- package/corpus/templates/mail/app/components/ui/calendar.tsx +1 -1
- package/corpus/templates/mail/app/components/ui/command.tsx +1 -1
- package/corpus/templates/mail/app/pages/DraftQueuePage.tsx +14 -14
- package/corpus/templates/mail/app/pages/NotFound.tsx +1 -2
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +25 -25
- package/corpus/templates/mail/app/root.tsx +61 -2
- package/corpus/templates/mail/app/routes/_index.tsx +1 -2
- package/corpus/templates/mail/app/routes/email.tsx +2 -2
- package/corpus/templates/mail/changelog/2026-07-03-error-screens-now-include-a-feedback-button-with-debug-info.md +6 -0
- package/corpus/templates/mail/package.json +1 -0
- package/corpus/templates/plan/app/components/layout/Header.tsx +4 -2
- package/corpus/templates/plan/app/components/layout/Layout.tsx +5 -6
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +20 -20
- package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +2 -3
- package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +2 -2
- package/corpus/templates/plan/app/components/plan/GuestModeBanner.tsx +1 -2
- package/corpus/templates/plan/app/components/plan/LocalCodebasePicker.tsx +8 -8
- package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +1 -1
- package/corpus/templates/plan/app/components/plan/PlanImageViewer.tsx +83 -82
- package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +3 -3
- package/corpus/templates/plan/app/components/plan/planBlocks.tsx +4 -4
- package/corpus/templates/plan/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/plan/app/i18n/de-DE.ts +4 -0
- package/corpus/templates/plan/app/i18n/en-US.ts +4 -0
- package/corpus/templates/plan/app/i18n/es-ES.ts +4 -0
- package/corpus/templates/plan/app/i18n/fr-FR.ts +4 -0
- package/corpus/templates/plan/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/plan/app/i18n/ja-JP.ts +4 -0
- package/corpus/templates/plan/app/i18n/ko-KR.ts +4 -0
- package/corpus/templates/plan/app/i18n/pt-BR.ts +4 -0
- package/corpus/templates/plan/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/plan/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +158 -80
- package/corpus/templates/plan/app/root.tsx +1 -1
- package/corpus/templates/plan/app/routes/_index.tsx +2 -1
- package/corpus/templates/plan/app/routes/local-plans.$slug.tsx +1 -1
- package/corpus/templates/plan/app/routes/plans.$id.tsx +2 -1
- package/corpus/templates/plan/app/routes/plans.tsx +2 -1
- package/corpus/templates/plan/app/routes/recaps.$id.tsx +2 -1
- package/corpus/templates/plan/app/routes/recaps.tsx +2 -1
- package/corpus/templates/plan/app/routes/settings.tsx +5 -5
- package/corpus/templates/plan/changelog/2026-07-03-error-screens-now-include-a-feedback-button-with-debug-info.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-05-images-in-plan-documents-open-reliably-in-the-full-size-prev.md +6 -0
- package/corpus/templates/plan/package.json +1 -0
- package/corpus/templates/slides/AGENTS.md +7 -3
- package/corpus/templates/slides/actions/get-design-system.ts +21 -0
- package/corpus/templates/slides/actions/import-file.ts +15 -7
- package/corpus/templates/slides/actions/index-design-system-with-builder.ts +14 -37
- package/corpus/templates/slides/app/components/ThemeToggle.tsx +6 -6
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +5 -5
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +7 -7
- package/corpus/templates/slides/app/components/deck/ExcalidrawSlide.tsx +1 -2
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +1 -1
- package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +2 -3
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +45 -22
- package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +7 -7
- package/corpus/templates/slides/app/components/editor/BlockBubbleMenu.tsx +5 -5
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +8 -8
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +15 -17
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +9 -10
- package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +5 -6
- package/corpus/templates/slides/app/components/editor/HistoryPanel.tsx +12 -12
- package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +3 -4
- package/corpus/templates/slides/app/components/editor/ImageSearchPanel.tsx +4 -5
- package/corpus/templates/slides/app/components/editor/ImportButton.tsx +3 -4
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +1 -2
- package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +10 -10
- package/corpus/templates/slides/app/components/editor/SlideBubbleMenu.tsx +10 -10
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +169 -160
- package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +20 -17
- package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +56 -6
- package/corpus/templates/slides/app/components/editor/TweaksPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/layout/Header.tsx +4 -2
- package/corpus/templates/slides/app/components/layout/Layout.tsx +7 -2
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +5 -5
- package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +6 -6
- package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +7 -7
- package/corpus/templates/slides/app/i18n/ar-SA.ts +8 -7
- package/corpus/templates/slides/app/i18n/de-DE.ts +7 -8
- package/corpus/templates/slides/app/i18n/en-US.ts +8 -7
- package/corpus/templates/slides/app/i18n/es-ES.ts +7 -8
- package/corpus/templates/slides/app/i18n/fr-FR.ts +7 -8
- package/corpus/templates/slides/app/i18n/hi-IN.ts +8 -7
- package/corpus/templates/slides/app/i18n/ja-JP.ts +7 -8
- package/corpus/templates/slides/app/i18n/ko-KR.ts +7 -7
- package/corpus/templates/slides/app/i18n/pt-BR.ts +7 -8
- package/corpus/templates/slides/app/i18n/zh-CN.ts +8 -7
- package/corpus/templates/slides/app/i18n/zh-TW.ts +8 -7
- package/corpus/templates/slides/app/lib/canvas-zoom.ts +16 -1
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +6 -6
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +5 -5
- package/corpus/templates/slides/app/pages/Index.tsx +18 -15
- package/corpus/templates/slides/app/root.tsx +3 -3
- package/corpus/templates/slides/app/routes/settings.tsx +5 -5
- package/corpus/templates/slides/changelog/2026-07-03-design-system-setup-now-indexes-figma-code-and-design-md-sou.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-03-slide-editing-now-keeps-thumbnails-speaker-notes-styling-and.md +6 -0
- package/corpus/templates/slides/package.json +1 -0
- package/corpus/templates/slides/server/lib/builder-design-system-proxy.ts +16 -104
- package/dist/application-state/emitter.d.ts +9 -2
- package/dist/application-state/emitter.d.ts.map +1 -1
- package/dist/application-state/emitter.js +25 -3
- package/dist/application-state/emitter.js.map +1 -1
- package/dist/cli/create.d.ts +2 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +52 -4
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/workspacify.d.ts +2 -0
- package/dist/cli/workspacify.d.ts.map +1 -1
- package/dist/cli/workspacify.js +8 -4
- package/dist/cli/workspacify.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +2 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +77 -25
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/ErrorBoundary.d.ts.map +1 -1
- package/dist/client/ErrorBoundary.js +37 -2
- package/dist/client/ErrorBoundary.js.map +1 -1
- package/dist/client/ErrorReportActions.d.ts +13 -0
- package/dist/client/ErrorReportActions.d.ts.map +1 -0
- package/dist/client/ErrorReportActions.js +14 -0
- package/dist/client/ErrorReportActions.js.map +1 -0
- package/dist/client/FeedbackButton.d.ts +3 -1
- package/dist/client/FeedbackButton.d.ts.map +1 -1
- package/dist/client/FeedbackButton.js +6 -5
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/components/ui/dialog.d.ts +1 -13
- package/dist/client/components/ui/dialog.d.ts.map +1 -1
- package/dist/client/components/ui/dialog.js +1 -20
- package/dist/client/components/ui/dialog.js.map +1 -1
- package/dist/client/components/ui/dropdown-menu.d.ts +1 -27
- package/dist/client/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/client/components/ui/dropdown-menu.js +1 -33
- package/dist/client/components/ui/dropdown-menu.js.map +1 -1
- package/dist/client/components/ui/hover-card.d.ts +1 -6
- package/dist/client/components/ui/hover-card.d.ts.map +1 -1
- package/dist/client/components/ui/hover-card.js +1 -9
- package/dist/client/components/ui/hover-card.js.map +1 -1
- package/dist/client/components/ui/popover.d.ts +1 -7
- package/dist/client/components/ui/popover.d.ts.map +1 -1
- package/dist/client/components/ui/popover.js +1 -10
- package/dist/client/components/ui/popover.js.map +1 -1
- package/dist/client/components/ui/sheet.d.ts +1 -15
- package/dist/client/components/ui/sheet.d.ts.map +1 -1
- package/dist/client/components/ui/sheet.js +1 -22
- package/dist/client/components/ui/sheet.js.map +1 -1
- package/dist/client/components/ui/tooltip.d.ts +1 -8
- package/dist/client/components/ui/tooltip.d.ts.map +1 -1
- package/dist/client/components/ui/tooltip.js +1 -17
- package/dist/client/components/ui/tooltip.js.map +1 -1
- package/dist/client/db-admin/DbAdminPage.d.ts +9 -1
- package/dist/client/db-admin/DbAdminPage.d.ts.map +1 -1
- package/dist/client/db-admin/DbAdminPage.js +17 -13
- package/dist/client/db-admin/DbAdminPage.js.map +1 -1
- package/dist/client/db-admin/SqlEditor.d.ts +3 -1
- package/dist/client/db-admin/SqlEditor.d.ts.map +1 -1
- package/dist/client/db-admin/SqlEditor.js +3 -3
- package/dist/client/db-admin/SqlEditor.js.map +1 -1
- package/dist/client/db-admin/TableEditor.d.ts +3 -1
- package/dist/client/db-admin/TableEditor.d.ts.map +1 -1
- package/dist/client/db-admin/TableEditor.js +6 -6
- package/dist/client/db-admin/TableEditor.js.map +1 -1
- package/dist/client/db-admin/useAgentSync.d.ts +3 -2
- package/dist/client/db-admin/useAgentSync.d.ts.map +1 -1
- package/dist/client/db-admin/useAgentSync.js +8 -4
- package/dist/client/db-admin/useAgentSync.js.map +1 -1
- package/dist/client/db-admin/useDbAdmin.d.ts +11 -7
- package/dist/client/db-admin/useDbAdmin.d.ts.map +1 -1
- package/dist/client/db-admin/useDbAdmin.js +45 -20
- package/dist/client/db-admin/useDbAdmin.js.map +1 -1
- package/dist/client/error-reporting.d.ts +19 -0
- package/dist/client/error-reporting.d.ts.map +1 -0
- package/dist/client/error-reporting.js +71 -0
- package/dist/client/error-reporting.js.map +1 -0
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/org/RequireActiveOrg.d.ts.map +1 -1
- package/dist/client/org/RequireActiveOrg.js +2 -1
- package/dist/client/org/RequireActiveOrg.js.map +1 -1
- package/dist/client/visual-style-controls.d.ts +11 -0
- package/dist/client/visual-style-controls.d.ts.map +1 -1
- package/dist/client/visual-style-controls.js +350 -1
- package/dist/client/visual-style-controls.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db-admin/index.d.ts +3 -0
- package/dist/db-admin/index.d.ts.map +1 -0
- package/dist/db-admin/index.js +2 -0
- package/dist/db-admin/index.js.map +1 -0
- package/dist/db-admin/operations.d.ts +26 -5
- package/dist/db-admin/operations.d.ts.map +1 -1
- package/dist/db-admin/operations.js +66 -55
- package/dist/db-admin/operations.js.map +1 -1
- package/dist/localization/default-messages.d.ts +3 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +3 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/secrets/crypto.d.ts.map +1 -1
- package/dist/secrets/crypto.js +37 -4
- package/dist/secrets/crypto.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-access.d.ts +16 -0
- package/dist/server/agent-access.d.ts.map +1 -0
- package/dist/server/agent-access.js +25 -0
- package/dist/server/agent-access.js.map +1 -0
- package/dist/server/builder-design-systems.d.ts +61 -0
- package/dist/server/builder-design-systems.d.ts.map +1 -1
- package/dist/server/builder-design-systems.js +219 -14
- package/dist/server/builder-design-systems.js.map +1 -1
- package/dist/server/h3-helpers.d.ts.map +1 -1
- package/dist/server/h3-helpers.js +12 -2
- package/dist/server/h3-helpers.js.map +1 -1
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/request-context.d.ts +17 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-context.js +46 -6
- package/dist/server/request-context.js.map +1 -1
- package/dist/shared/agent-access.d.ts +29 -0
- package/dist/shared/agent-access.d.ts.map +1 -0
- package/dist/shared/agent-access.js +57 -0
- package/dist/shared/agent-access.js.map +1 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/templates/default/app/root.tsx +47 -0
- package/docs/content/components.mdx +13 -0
- package/docs/content/creating-templates.mdx +7 -0
- package/docs/content/locales/ar-SA/components.mdx +9 -0
- package/docs/content/locales/ar-SA/creating-templates.mdx +2 -0
- package/docs/content/locales/ar-SA/template-analytics.mdx +6 -0
- package/docs/content/locales/ar-SA/template-clips.mdx +7 -0
- package/docs/content/locales/ar-SA/tracking.mdx +6 -0
- package/docs/content/locales/de-DE/components.mdx +9 -0
- package/docs/content/locales/de-DE/creating-templates.mdx +2 -0
- package/docs/content/locales/de-DE/template-analytics.mdx +6 -0
- package/docs/content/locales/de-DE/template-clips.mdx +7 -0
- package/docs/content/locales/de-DE/tracking.mdx +6 -0
- package/docs/content/locales/es-ES/components.mdx +9 -0
- package/docs/content/locales/es-ES/creating-templates.mdx +2 -0
- package/docs/content/locales/es-ES/template-analytics.mdx +6 -0
- package/docs/content/locales/es-ES/template-clips.mdx +7 -0
- package/docs/content/locales/es-ES/tracking.mdx +6 -0
- package/docs/content/locales/fr-FR/components.mdx +9 -0
- package/docs/content/locales/fr-FR/creating-templates.mdx +2 -0
- package/docs/content/locales/fr-FR/template-analytics.mdx +6 -0
- package/docs/content/locales/fr-FR/template-clips.mdx +7 -0
- package/docs/content/locales/fr-FR/tracking.mdx +6 -0
- package/docs/content/locales/hi-IN/components.mdx +9 -0
- package/docs/content/locales/hi-IN/creating-templates.mdx +2 -0
- package/docs/content/locales/hi-IN/template-analytics.mdx +6 -0
- package/docs/content/locales/hi-IN/template-clips.mdx +7 -0
- package/docs/content/locales/hi-IN/tracking.mdx +6 -0
- package/docs/content/locales/ja-JP/components.mdx +9 -0
- package/docs/content/locales/ja-JP/creating-templates.mdx +2 -0
- package/docs/content/locales/ja-JP/template-analytics.mdx +6 -0
- package/docs/content/locales/ja-JP/template-clips.mdx +7 -0
- package/docs/content/locales/ja-JP/tracking.mdx +6 -0
- package/docs/content/locales/ko-KR/components.mdx +9 -0
- package/docs/content/locales/ko-KR/creating-templates.mdx +2 -0
- package/docs/content/locales/ko-KR/template-analytics.mdx +6 -0
- package/docs/content/locales/ko-KR/template-clips.mdx +7 -0
- package/docs/content/locales/ko-KR/tracking.mdx +6 -0
- package/docs/content/locales/pt-BR/components.mdx +9 -0
- package/docs/content/locales/pt-BR/creating-templates.mdx +2 -0
- package/docs/content/locales/pt-BR/template-analytics.mdx +6 -0
- package/docs/content/locales/pt-BR/template-clips.mdx +7 -0
- package/docs/content/locales/pt-BR/tracking.mdx +6 -0
- package/docs/content/locales/zh-CN/components.mdx +9 -0
- package/docs/content/locales/zh-CN/creating-templates.mdx +2 -0
- package/docs/content/locales/zh-CN/template-analytics.mdx +6 -0
- package/docs/content/locales/zh-CN/template-clips.mdx +7 -0
- package/docs/content/locales/zh-CN/tracking.mdx +6 -0
- package/docs/content/locales/zh-TW/components.mdx +9 -0
- package/docs/content/locales/zh-TW/creating-templates.mdx +2 -0
- package/docs/content/locales/zh-TW/template-analytics.mdx +6 -0
- package/docs/content/locales/zh-TW/template-clips.mdx +7 -0
- package/docs/content/locales/zh-TW/tracking.mdx +6 -0
- package/docs/content/template-analytics.mdx +6 -0
- package/docs/content/template-clips.mdx +7 -0
- package/docs/content/tracking.mdx +6 -0
- package/package.json +10 -2
- package/src/templates/default/app/root.tsx +47 -0
- package/corpus/templates/analytics/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/analytics/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/analytics/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/analytics/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/analytics/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/analytics/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/analytics/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/analytics/app/components/ui/button.tsx +0 -57
- package/corpus/templates/analytics/app/components/ui/card.tsx +0 -86
- package/corpus/templates/analytics/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/analytics/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/analytics/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/analytics/app/components/ui/command.tsx +0 -154
- package/corpus/templates/analytics/app/components/ui/context-menu.tsx +0 -202
- package/corpus/templates/analytics/app/components/ui/date-picker.tsx +0 -68
- package/corpus/templates/analytics/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/analytics/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/analytics/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/analytics/app/components/ui/form.tsx +0 -177
- package/corpus/templates/analytics/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/analytics/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/analytics/app/components/ui/input.tsx +0 -22
- package/corpus/templates/analytics/app/components/ui/label.tsx +0 -24
- package/corpus/templates/analytics/app/components/ui/menubar.tsx +0 -234
- package/corpus/templates/analytics/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/analytics/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/analytics/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/analytics/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/analytics/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/analytics/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/analytics/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/analytics/app/components/ui/select.tsx +0 -158
- package/corpus/templates/analytics/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/analytics/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/analytics/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/analytics/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/analytics/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/analytics/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/analytics/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/analytics/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/analytics/app/components/ui/table.tsx +0 -117
- package/corpus/templates/analytics/app/components/ui/tabs.tsx +0 -53
- package/corpus/templates/analytics/app/components/ui/textarea.tsx +0 -23
- package/corpus/templates/analytics/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/analytics/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/analytics/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/analytics/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/analytics/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/analytics/app/components/ui/use-toast.ts +0 -3
- package/corpus/templates/analytics/app/hooks/use-mobile.tsx +0 -21
- package/corpus/templates/analytics/app/hooks/use-toast.ts +0 -188
- package/corpus/templates/assets/app/components/layout/HeaderActions.tsx +0 -84
- package/corpus/templates/assets/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/assets/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/assets/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/assets/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/assets/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/assets/app/components/ui/button.tsx +0 -57
- package/corpus/templates/assets/app/components/ui/card.tsx +0 -86
- package/corpus/templates/assets/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/assets/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/assets/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/assets/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/assets/app/components/ui/input.tsx +0 -22
- package/corpus/templates/assets/app/components/ui/label.tsx +0 -24
- package/corpus/templates/assets/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/assets/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/assets/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/assets/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/assets/app/components/ui/select.tsx +0 -158
- package/corpus/templates/assets/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/assets/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/assets/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/assets/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/assets/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/assets/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/assets/app/components/ui/table.tsx +0 -117
- package/corpus/templates/assets/app/components/ui/tabs.tsx +0 -53
- package/corpus/templates/assets/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/brain/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/brain/app/components/ui/button.tsx +0 -57
- package/corpus/templates/brain/app/components/ui/card.tsx +0 -86
- package/corpus/templates/brain/app/components/ui/input.tsx +0 -22
- package/corpus/templates/brain/app/components/ui/label.tsx +0 -24
- package/corpus/templates/brain/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/brain/app/components/ui/select.tsx +0 -158
- package/corpus/templates/brain/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/brain/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/brain/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/brain/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/brain/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/brain/app/components/ui/table.tsx +0 -117
- package/corpus/templates/brain/app/components/ui/textarea.tsx +0 -23
- package/corpus/templates/brain/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/calendar/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/calendar/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/calendar/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/calendar/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/calendar/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/calendar/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/calendar/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/calendar/app/components/ui/button.tsx +0 -57
- package/corpus/templates/calendar/app/components/ui/calendar.tsx +0 -68
- package/corpus/templates/calendar/app/components/ui/card.tsx +0 -86
- package/corpus/templates/calendar/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/calendar/app/components/ui/chart.tsx +0 -375
- package/corpus/templates/calendar/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/calendar/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/calendar/app/components/ui/command.tsx +0 -154
- package/corpus/templates/calendar/app/components/ui/context-menu.tsx +0 -202
- package/corpus/templates/calendar/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/calendar/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/calendar/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/calendar/app/components/ui/form.tsx +0 -177
- package/corpus/templates/calendar/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/calendar/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/calendar/app/components/ui/input.tsx +0 -22
- package/corpus/templates/calendar/app/components/ui/label.tsx +0 -24
- package/corpus/templates/calendar/app/components/ui/menubar.tsx +0 -234
- package/corpus/templates/calendar/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/calendar/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/calendar/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/calendar/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/calendar/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/calendar/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/calendar/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/calendar/app/components/ui/select.tsx +0 -158
- package/corpus/templates/calendar/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/calendar/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/calendar/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/calendar/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/calendar/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/calendar/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/calendar/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/calendar/app/components/ui/table.tsx +0 -117
- package/corpus/templates/calendar/app/components/ui/tabs.tsx +0 -53
- package/corpus/templates/calendar/app/components/ui/textarea.tsx +0 -23
- package/corpus/templates/calendar/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/calendar/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/calendar/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/calendar/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/calendar/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/calendar/app/components/ui/use-toast.ts +0 -3
- package/corpus/templates/calendar/app/hooks/use-mobile.tsx +0 -21
- package/corpus/templates/calendar/app/hooks/use-toast.ts +0 -188
- package/corpus/templates/chat/app/components/layout/HeaderActions.tsx +0 -84
- package/corpus/templates/chat/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/chat/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/chat/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/chat/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/chat/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/chat/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/chat/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/chat/app/components/ui/button.tsx +0 -57
- package/corpus/templates/chat/app/components/ui/calendar.tsx +0 -68
- package/corpus/templates/chat/app/components/ui/card.tsx +0 -86
- package/corpus/templates/chat/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/chat/app/components/ui/chart.tsx +0 -375
- package/corpus/templates/chat/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/chat/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/chat/app/components/ui/command.tsx +0 -154
- package/corpus/templates/chat/app/components/ui/context-menu.tsx +0 -202
- package/corpus/templates/chat/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/chat/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/chat/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/chat/app/components/ui/form.tsx +0 -177
- package/corpus/templates/chat/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/chat/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/chat/app/components/ui/input.tsx +0 -22
- package/corpus/templates/chat/app/components/ui/label.tsx +0 -24
- package/corpus/templates/chat/app/components/ui/menubar.tsx +0 -234
- package/corpus/templates/chat/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/chat/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/chat/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/chat/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/chat/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/chat/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/chat/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/chat/app/components/ui/select.tsx +0 -158
- package/corpus/templates/chat/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/chat/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/chat/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/chat/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/chat/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/chat/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/chat/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/chat/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/chat/app/components/ui/table.tsx +0 -117
- package/corpus/templates/chat/app/components/ui/tabs.tsx +0 -53
- package/corpus/templates/chat/app/components/ui/textarea.tsx +0 -23
- package/corpus/templates/chat/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/chat/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/chat/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/chat/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/chat/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/chat/app/components/ui/use-toast.ts +0 -3
- package/corpus/templates/chat/app/hooks/use-mobile.tsx +0 -21
- package/corpus/templates/chat/app/hooks/use-toast.ts +0 -188
- package/corpus/templates/clips/app/components/layout/HeaderActions.tsx +0 -84
- package/corpus/templates/clips/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/clips/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/clips/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/clips/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/clips/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/clips/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/clips/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/clips/app/components/ui/button.tsx +0 -57
- package/corpus/templates/clips/app/components/ui/calendar.tsx +0 -68
- package/corpus/templates/clips/app/components/ui/card.tsx +0 -86
- package/corpus/templates/clips/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/clips/app/components/ui/chart.tsx +0 -375
- package/corpus/templates/clips/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/clips/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/clips/app/components/ui/command.tsx +0 -154
- package/corpus/templates/clips/app/components/ui/context-menu.tsx +0 -202
- package/corpus/templates/clips/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/clips/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/clips/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/clips/app/components/ui/form.tsx +0 -177
- package/corpus/templates/clips/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/clips/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/clips/app/components/ui/input.tsx +0 -22
- package/corpus/templates/clips/app/components/ui/label.tsx +0 -24
- package/corpus/templates/clips/app/components/ui/menubar.tsx +0 -234
- package/corpus/templates/clips/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/clips/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/clips/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/clips/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/clips/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/clips/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/clips/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/clips/app/components/ui/select.tsx +0 -158
- package/corpus/templates/clips/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/clips/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/clips/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/clips/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/clips/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/clips/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/clips/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/clips/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/clips/app/components/ui/table.tsx +0 -117
- package/corpus/templates/clips/app/components/ui/tabs.tsx +0 -53
- package/corpus/templates/clips/app/components/ui/textarea.tsx +0 -23
- package/corpus/templates/clips/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/clips/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/clips/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/clips/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/clips/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/clips/app/components/ui/use-toast.ts +0 -3
- package/corpus/templates/clips/app/hooks/use-mobile.tsx +0 -21
- package/corpus/templates/clips/app/hooks/use-toast.ts +0 -188
- package/corpus/templates/content/app/components/layout/HeaderActions.tsx +0 -84
- package/corpus/templates/content/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/content/app/components/ui/button.tsx +0 -57
- package/corpus/templates/content/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/content/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/content/app/components/ui/input.tsx +0 -22
- package/corpus/templates/content/app/components/ui/label.tsx +0 -24
- package/corpus/templates/content/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/content/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/content/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/content/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/content/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/content/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/content/app/components/ui/table.tsx +0 -117
- package/corpus/templates/content/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/content/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/content/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/content/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/content/app/components/ui/use-toast.ts +0 -3
- package/corpus/templates/content/app/hooks/use-mobile.tsx +0 -21
- package/corpus/templates/content/app/hooks/use-toast.ts +0 -188
- package/corpus/templates/design/app/components/layout/HeaderActions.tsx +0 -84
- package/corpus/templates/design/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/design/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/design/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/design/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/design/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/design/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/design/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/design/app/components/ui/button.tsx +0 -57
- package/corpus/templates/design/app/components/ui/calendar.tsx +0 -68
- package/corpus/templates/design/app/components/ui/card.tsx +0 -86
- package/corpus/templates/design/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/design/app/components/ui/chart.tsx +0 -375
- package/corpus/templates/design/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/design/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/design/app/components/ui/command.tsx +0 -154
- package/corpus/templates/design/app/components/ui/context-menu.tsx +0 -202
- package/corpus/templates/design/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/design/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/design/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/design/app/components/ui/form.tsx +0 -177
- package/corpus/templates/design/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/design/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/design/app/components/ui/input.tsx +0 -22
- package/corpus/templates/design/app/components/ui/label.tsx +0 -24
- package/corpus/templates/design/app/components/ui/menubar.tsx +0 -234
- package/corpus/templates/design/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/design/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/design/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/design/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/design/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/design/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/design/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/design/app/components/ui/select.tsx +0 -158
- package/corpus/templates/design/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/design/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/design/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/design/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/design/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/design/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/design/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/design/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/design/app/components/ui/table.tsx +0 -117
- package/corpus/templates/design/app/components/ui/tabs.tsx +0 -53
- package/corpus/templates/design/app/components/ui/textarea.tsx +0 -23
- package/corpus/templates/design/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/design/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/design/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/design/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/design/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/design/app/components/ui/use-toast.ts +0 -3
- package/corpus/templates/design/app/hooks/use-mobile.tsx +0 -21
- package/corpus/templates/design/app/hooks/use-toast.ts +0 -188
- package/corpus/templates/forms/app/components/layout/HeaderActions.tsx +0 -84
- package/corpus/templates/forms/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/forms/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/forms/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/forms/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/forms/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/forms/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/forms/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/forms/app/components/ui/button.tsx +0 -57
- package/corpus/templates/forms/app/components/ui/card.tsx +0 -86
- package/corpus/templates/forms/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/forms/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/forms/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/forms/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/forms/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/forms/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/forms/app/components/ui/form.tsx +0 -177
- package/corpus/templates/forms/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/forms/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/forms/app/components/ui/input.tsx +0 -22
- package/corpus/templates/forms/app/components/ui/label.tsx +0 -24
- package/corpus/templates/forms/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/forms/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/forms/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/forms/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/forms/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/forms/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/forms/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/forms/app/components/ui/select.tsx +0 -158
- package/corpus/templates/forms/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/forms/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/forms/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/forms/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/forms/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/forms/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/forms/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/forms/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/forms/app/components/ui/table.tsx +0 -117
- package/corpus/templates/forms/app/components/ui/tabs.tsx +0 -53
- package/corpus/templates/forms/app/components/ui/textarea.tsx +0 -23
- package/corpus/templates/forms/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/forms/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/forms/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/forms/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/forms/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/forms/app/hooks/use-mobile.tsx +0 -21
- package/corpus/templates/forms/app/hooks/use-toast.ts +0 -188
- package/corpus/templates/macros/app/components/layout/HeaderActions.tsx +0 -84
- package/corpus/templates/macros/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/macros/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/macros/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/macros/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/macros/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/macros/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/macros/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/macros/app/components/ui/chart.tsx +0 -375
- package/corpus/templates/macros/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/macros/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/macros/app/components/ui/command.tsx +0 -154
- package/corpus/templates/macros/app/components/ui/context-menu.tsx +0 -202
- package/corpus/templates/macros/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/macros/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/macros/app/components/ui/form.tsx +0 -177
- package/corpus/templates/macros/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/macros/app/components/ui/label.tsx +0 -24
- package/corpus/templates/macros/app/components/ui/logo.tsx +0 -36
- package/corpus/templates/macros/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/macros/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/macros/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/macros/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/macros/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/macros/app/components/ui/select.tsx +0 -158
- package/corpus/templates/macros/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/macros/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/macros/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/macros/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/macros/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/macros/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/macros/app/components/ui/table.tsx +0 -117
- package/corpus/templates/macros/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/macros/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/macros/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/macros/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/mail/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/mail/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/mail/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/mail/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/mail/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/mail/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/mail/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/mail/app/components/ui/button.tsx +0 -57
- package/corpus/templates/mail/app/components/ui/card.tsx +0 -86
- package/corpus/templates/mail/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/mail/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/mail/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/mail/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/mail/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/mail/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/mail/app/components/ui/form.tsx +0 -177
- package/corpus/templates/mail/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/mail/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/mail/app/components/ui/label.tsx +0 -24
- package/corpus/templates/mail/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/mail/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/mail/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/mail/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/mail/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/mail/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/mail/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/mail/app/components/ui/select.tsx +0 -158
- package/corpus/templates/mail/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/mail/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/mail/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/mail/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/mail/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/mail/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/mail/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/mail/app/components/ui/table.tsx +0 -117
- package/corpus/templates/mail/app/components/ui/tabs.tsx +0 -53
- package/corpus/templates/mail/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/mail/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/mail/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/mail/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/mail/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/mail/app/hooks/use-toast.ts +0 -188
- package/corpus/templates/plan/app/components/layout/HeaderActions.tsx +0 -84
- package/corpus/templates/plan/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/plan/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/plan/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/plan/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/plan/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/plan/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/plan/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/plan/app/components/ui/button.tsx +0 -57
- package/corpus/templates/plan/app/components/ui/calendar.tsx +0 -68
- package/corpus/templates/plan/app/components/ui/card.tsx +0 -86
- package/corpus/templates/plan/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/plan/app/components/ui/chart.tsx +0 -375
- package/corpus/templates/plan/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/plan/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/plan/app/components/ui/command.tsx +0 -154
- package/corpus/templates/plan/app/components/ui/context-menu.tsx +0 -202
- package/corpus/templates/plan/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/plan/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/plan/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/plan/app/components/ui/form.tsx +0 -177
- package/corpus/templates/plan/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/plan/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/plan/app/components/ui/input.tsx +0 -22
- package/corpus/templates/plan/app/components/ui/label.tsx +0 -24
- package/corpus/templates/plan/app/components/ui/menubar.tsx +0 -234
- package/corpus/templates/plan/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/plan/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/plan/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/plan/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/plan/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/plan/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/plan/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/plan/app/components/ui/select.tsx +0 -158
- package/corpus/templates/plan/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/plan/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/plan/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/plan/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/plan/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/plan/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/plan/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/plan/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/plan/app/components/ui/table.tsx +0 -117
- package/corpus/templates/plan/app/components/ui/textarea.tsx +0 -23
- package/corpus/templates/plan/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/plan/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/plan/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/plan/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/plan/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/plan/app/components/ui/use-toast.ts +0 -3
- package/corpus/templates/plan/app/hooks/use-mobile.tsx +0 -21
- package/corpus/templates/plan/app/hooks/use-toast.ts +0 -188
- package/corpus/templates/slides/app/components/layout/HeaderActions.tsx +0 -84
- package/corpus/templates/slides/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/slides/app/components/ui/alert-dialog.tsx +0 -139
- package/corpus/templates/slides/app/components/ui/alert.tsx +0 -59
- package/corpus/templates/slides/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/slides/app/components/ui/avatar.tsx +0 -48
- package/corpus/templates/slides/app/components/ui/badge.tsx +0 -37
- package/corpus/templates/slides/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/slides/app/components/ui/button.tsx +0 -57
- package/corpus/templates/slides/app/components/ui/calendar.tsx +0 -68
- package/corpus/templates/slides/app/components/ui/card.tsx +0 -86
- package/corpus/templates/slides/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/slides/app/components/ui/chart.tsx +0 -375
- package/corpus/templates/slides/app/components/ui/checkbox.tsx +0 -28
- package/corpus/templates/slides/app/components/ui/collapsible.tsx +0 -9
- package/corpus/templates/slides/app/components/ui/command.tsx +0 -154
- package/corpus/templates/slides/app/components/ui/context-menu.tsx +0 -202
- package/corpus/templates/slides/app/components/ui/dialog.tsx +0 -130
- package/corpus/templates/slides/app/components/ui/drawer.tsx +0 -116
- package/corpus/templates/slides/app/components/ui/dropdown-menu.tsx +0 -212
- package/corpus/templates/slides/app/components/ui/form.tsx +0 -177
- package/corpus/templates/slides/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/slides/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/slides/app/components/ui/input.tsx +0 -22
- package/corpus/templates/slides/app/components/ui/label.tsx +0 -24
- package/corpus/templates/slides/app/components/ui/menubar.tsx +0 -234
- package/corpus/templates/slides/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/slides/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/slides/app/components/ui/popover.tsx +0 -44
- package/corpus/templates/slides/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/slides/app/components/ui/radio-group.tsx +0 -42
- package/corpus/templates/slides/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/slides/app/components/ui/scroll-area.tsx +0 -46
- package/corpus/templates/slides/app/components/ui/select.tsx +0 -158
- package/corpus/templates/slides/app/components/ui/separator.tsx +0 -29
- package/corpus/templates/slides/app/components/ui/sheet.tsx +0 -160
- package/corpus/templates/slides/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/slides/app/components/ui/skeleton.tsx +0 -15
- package/corpus/templates/slides/app/components/ui/slider.tsx +0 -26
- package/corpus/templates/slides/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/slides/app/components/ui/spinner.tsx +0 -17
- package/corpus/templates/slides/app/components/ui/switch.tsx +0 -27
- package/corpus/templates/slides/app/components/ui/table.tsx +0 -117
- package/corpus/templates/slides/app/components/ui/tabs.tsx +0 -53
- package/corpus/templates/slides/app/components/ui/textarea.tsx +0 -23
- package/corpus/templates/slides/app/components/ui/toast.tsx +0 -127
- package/corpus/templates/slides/app/components/ui/toaster.tsx +0 -33
- package/corpus/templates/slides/app/components/ui/toggle-group.tsx +0 -59
- package/corpus/templates/slides/app/components/ui/toggle.tsx +0 -43
- package/corpus/templates/slides/app/components/ui/tooltip.tsx +0 -30
- package/corpus/templates/slides/app/components/ui/use-toast.ts +0 -3
- package/corpus/templates/slides/app/hooks/use-mobile.tsx +0 -21
- package/corpus/templates/slides/app/hooks/use-toast.ts +0 -188
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqlEditor.js","sourceRoot":"","sources":["../../../src/client/db-admin/SqlEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,KAAK,EACL,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,UAAU,EAAE,EAEjB,UAAU,EACV,MAAM,EACN,IAAI,GACL,MAAM,uBAAuB,CAAC;AAC/B;;;;;;;;;;;GAWG;AACH,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO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C,SAAS,EAAC,oJAAoJ,uBAGvJ,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,EAC7B,SAAS,EAAC,0LAA0L,qBAG7L,IACL,IACF,GACA,CACT,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { sql, PostgreSQL } from \"@codemirror/lang-sql\";\nimport { oneDark } from \"@codemirror/theme-one-dark\";\nimport {\n IconPlayerPlayFilled,\n IconHistory,\n IconBookmark,\n IconBookmarkPlus,\n IconDownload,\n IconAlertTriangle,\n IconLoader2,\n IconTrash,\n IconX,\n IconChevronDown,\n} from \"@tabler/icons-react\";\nimport CodeMirror, {\n type ReactCodeMirrorRef,\n EditorView,\n keymap,\n Prec,\n} from \"@uiw/react-codemirror\";\n/**\n * Production-grade SQL editor for the dev-mode database admin.\n *\n * Layout: a CodeMirror editor pane on top, a resizable results panel below.\n * Features schema-aware autocomplete, keyboard run shortcuts, history, named\n * snippets, CSV/JSON export, and a confirm modal for destructive statements.\n *\n * Data access goes through `runQuery` from `./useDbAdmin.js` (the shared\n * contract). On a destructive statement without confirmation, `runQuery` throws\n * an Error whose `needsConfirm` flag is `true`; we catch that and re-run after\n * the user confirms in a locally-built modal.\n */\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\n\nimport type { DbAdminDialect } from \"../../db-admin/types.js\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"../components/ui/dropdown-menu.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport { cn } from \"../utils.js\";\nimport { toCSV, toJSON, downloadFile } from \"./export-utils.js\";\nimport { ResultsGrid } from \"./ResultsGrid.js\";\nimport {\n loadHistory,\n pushHistory,\n clearHistory,\n loadSnippets,\n saveSnippet,\n deleteSnippet,\n type SqlSnippet,\n} from \"./sql-storage.js\";\nimport { runQuery } from \"./useDbAdmin.js\";\n\nexport interface SqlEditorProps {\n dialect: DbAdminDialect;\n tableNames: string[];\n columnsByTable: Record<string, string[]>;\n}\n\ninterface QueryResult {\n columns: string[];\n rows: Record<string, unknown>[];\n rowsAffected: number;\n durationMs: number;\n}\n\n// ─── Dark-mode detection ─────────────────────────────────────────────────────\n\nfunction useIsDark(): boolean {\n const [isDark, setIsDark] = useState(false);\n useEffect(() => {\n if (typeof document === \"undefined\") return;\n const root = document.documentElement;\n const update = () => setIsDark(root.classList.contains(\"dark\"));\n update();\n const observer = new MutationObserver(update);\n observer.observe(root, { attributes: true, attributeFilter: [\"class\"] });\n return () => observer.disconnect();\n }, []);\n return isDark;\n}\n\n// ─── Statement-under-cursor helpers ──────────────────────────────────────────\n\n/**\n * Best-effort split of a SQL buffer into statements by top-level `;`, ignoring\n * semicolons inside single/double quotes or line/block comments. Returns each\n * statement with its character offsets so we can pick the one under the cursor.\n */\nfunction splitStatements(\n text: string,\n): { sql: string; start: number; end: number }[] {\n const out: { sql: string; start: number; end: number }[] = [];\n let start = 0;\n let inSingle = false;\n let inDouble = false;\n let inLineComment = false;\n let inBlockComment = false;\n\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n const next = text[i + 1];\n\n if (inLineComment) {\n if (ch === \"\\n\") inLineComment = false;\n continue;\n }\n if (inBlockComment) {\n if (ch === \"*\" && next === \"/\") {\n inBlockComment = false;\n i++;\n }\n continue;\n }\n if (inSingle) {\n if (ch === \"'\") inSingle = false;\n continue;\n }\n if (inDouble) {\n if (ch === '\"') inDouble = false;\n continue;\n }\n\n if (ch === \"-\" && next === \"-\") {\n inLineComment = true;\n i++;\n continue;\n }\n if (ch === \"/\" && next === \"*\") {\n inBlockComment = true;\n i++;\n continue;\n }\n if (ch === \"'\") {\n inSingle = true;\n continue;\n }\n if (ch === '\"') {\n inDouble = true;\n continue;\n }\n if (ch === \";\") {\n out.push({ sql: text.slice(start, i + 1), start, end: i + 1 });\n start = i + 1;\n }\n }\n if (start < text.length) {\n out.push({ sql: text.slice(start), start, end: text.length });\n }\n return out;\n}\n\n/** Resolve which SQL to run given the current selection and cursor position. */\nfunction resolveRunTarget(\n view: EditorView | undefined,\n buffer: string,\n): string {\n if (!view) return buffer;\n const sel = view.state.selection.main;\n if (!sel.empty) {\n return view.state.sliceDoc(sel.from, sel.to);\n }\n const cursor = sel.head;\n const statements = splitStatements(buffer);\n const hit = statements.find((s) => cursor >= s.start && cursor <= s.end);\n return (hit?.sql ?? buffer).trim() || buffer;\n}\n\n// ─── Local modal primitive ───────────────────────────────────────────────────\n\nfunction Modal({\n title,\n children,\n onClose,\n}: {\n title: string;\n children: ReactNode;\n onClose: () => void;\n}) {\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [onClose]);\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <div\n className=\"absolute inset-0 bg-black/50\"\n onClick={onClose}\n aria-hidden\n />\n <div className=\"relative z-10 w-full max-w-md rounded-lg border border-border bg-background shadow-xl\">\n <div className=\"flex items-center justify-between border-b border-border px-4 py-3\">\n <h2 className=\"text-sm font-semibold text-foreground\">{title}</h2>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"cursor-pointer rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground\"\n aria-label=\"Close\"\n >\n <IconX size={16} />\n </button>\n </div>\n <div className=\"p-4\">{children}</div>\n </div>\n </div>\n );\n}\n\n// ─── Toolbar button ──────────────────────────────────────────────────────────\n\nfunction ToolbarButton({\n children,\n onClick,\n className,\n title,\n disabled,\n}: {\n children: ReactNode;\n onClick?: () => void;\n className?: string;\n title?: string;\n disabled?: boolean;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title={title}\n disabled={disabled}\n className={cn(\n \"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-xs font-medium text-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n >\n {children}\n </button>\n );\n}\n\nconst isMac =\n typeof navigator !== \"undefined\" &&\n /Mac|iPhone|iPad/.test(navigator.platform);\nconst MOD = isMac ? \"Cmd\" : \"Ctrl\";\n\n// ─── Main component ──────────────────────────────────────────────────────────\n\nexport function SqlEditor({\n dialect,\n tableNames,\n columnsByTable,\n}: SqlEditorProps) {\n const isDark = useIsDark();\n const editorRef = useRef<ReactCodeMirrorRef>(null);\n\n const [value, setValue] = useState(\"\");\n const [running, setRunning] = useState(false);\n const [result, setResult] = useState<QueryResult | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [status, setStatus] = useState<string | null>(null);\n\n const [history, setHistory] = useState<string[]>([]);\n const [snippets, setSnippets] = useState<SqlSnippet[]>([]);\n\n const [confirmSql, setConfirmSql] = useState<string | null>(null);\n const [saveModalOpen, setSaveModalOpen] = useState(false);\n const [snippetName, setSnippetName] = useState(\"\");\n\n // Editor height (px) — draggable splitter between editor and results.\n const [editorHeight, setEditorHeight] = useState(240);\n const dragState = useRef<{ startY: number; startHeight: number } | null>(\n null,\n );\n\n // Keep the latest buffer accessible inside CodeMirror keymap closures.\n const valueRef = useRef(value);\n valueRef.current = value;\n\n useEffect(() => {\n setHistory(loadHistory());\n setSnippets(loadSnippets());\n }, []);\n\n // ─── Run logic ────────────────────────────────────────────────────────────\n\n const execute = useCallback(\n async (sqlText: string, confirmDestructive?: boolean) => {\n const trimmed = sqlText.trim();\n if (!trimmed) return;\n setRunning(true);\n setError(null);\n try {\n const res = await runQuery(trimmed, undefined, confirmDestructive);\n setResult({\n columns: res.columns,\n rows: res.rows,\n rowsAffected: res.rowsAffected,\n durationMs: res.durationMs,\n });\n if (res.columns.length > 0) {\n setStatus(`${res.rows.length} rows · ${res.durationMs}ms`);\n } else {\n setStatus(\n `Query OK · ${res.rowsAffected} rows affected · ${res.durationMs}ms`,\n );\n }\n setHistory(pushHistory(trimmed));\n } catch (err) {\n const e = err as Error & { needsConfirm?: boolean };\n if (e.needsConfirm) {\n setConfirmSql(trimmed);\n } else {\n setError(e.message || \"Query failed\");\n setStatus(null);\n }\n } finally {\n setRunning(false);\n }\n },\n [],\n );\n\n const runActiveStatement = useCallback(() => {\n const view = editorRef.current?.view;\n const target = resolveRunTarget(view, valueRef.current);\n void execute(target);\n }, [execute]);\n\n const runWholeBuffer = useCallback(() => {\n void execute(valueRef.current);\n }, [execute]);\n\n const confirmAndRun = useCallback(() => {\n const sqlText = confirmSql;\n setConfirmSql(null);\n if (sqlText) void execute(sqlText, true);\n }, [confirmSql, execute]);\n\n // ─── CodeMirror extensions ──────────────────────────────────────────────\n\n const extensions = useMemo(() => {\n const langExt = sql({\n dialect: dialect === \"postgres\" ? PostgreSQL : undefined,\n schema: columnsByTable,\n tables: tableNames.map((t) => ({ label: t })),\n upperCaseKeywords: true,\n });\n\n const runKeymap = Prec.highest(\n keymap.of([\n {\n key: \"Mod-Enter\",\n preventDefault: true,\n run: () => {\n runActiveStatement();\n return true;\n },\n },\n {\n key: \"Mod-Shift-Enter\",\n preventDefault: true,\n run: () => {\n runWholeBuffer();\n return true;\n },\n },\n ]),\n );\n\n return [runKeymap, langExt, EditorView.lineWrapping];\n // tableNames / columnsByTable identity is stable enough for our purposes;\n // re-derive when the dialect or schema reference changes.\n }, [dialect, columnsByTable, tableNames, runActiveStatement, runWholeBuffer]);\n\n // ─── Splitter drag ───────────────────────────────────────────────────────\n\n useEffect(() => {\n const onMove = (e: MouseEvent) => {\n if (!dragState.current) return;\n const delta = e.clientY - dragState.current.startY;\n const next = Math.min(\n Math.max(dragState.current.startHeight + delta, 120),\n 640,\n );\n setEditorHeight(next);\n };\n const onUp = () => {\n dragState.current = null;\n document.body.style.userSelect = \"\";\n };\n window.addEventListener(\"mousemove\", onMove);\n window.addEventListener(\"mouseup\", onUp);\n return () => {\n window.removeEventListener(\"mousemove\", onMove);\n window.removeEventListener(\"mouseup\", onUp);\n };\n }, []);\n\n const startDrag = (e: React.MouseEvent) => {\n dragState.current = { startY: e.clientY, startHeight: editorHeight };\n document.body.style.userSelect = \"none\";\n };\n\n // ─── Loading editor content from history / snippets ───────────────────────\n\n const loadIntoEditor = useCallback((sqlText: string) => {\n setValue(sqlText);\n // Focus and place cursor at end after the controlled value updates.\n requestAnimationFrame(() => {\n const view = editorRef.current?.view;\n if (view) {\n view.focus();\n view.dispatch({ selection: { anchor: view.state.doc.length } });\n }\n });\n }, []);\n\n // ─── Export ────────────────────────────────────────────────────────────────\n\n const exportAs = (format: \"csv\" | \"json\") => {\n if (!result || result.columns.length === 0) return;\n const stamp = new Date().toISOString().replace(/[:.]/g, \"-\").slice(0, 19);\n if (format === \"csv\") {\n downloadFile(\n `query-result-${stamp}.csv`,\n \"text/csv;charset=utf-8\",\n toCSV(result.columns, result.rows),\n );\n } else {\n downloadFile(\n `query-result-${stamp}.json`,\n \"application/json\",\n toJSON(result.rows),\n );\n }\n };\n\n // ─── Snippet save ────────────────────────────────────────────────────────\n\n const openSaveModal = () => {\n if (!value.trim()) return;\n setSnippetName(\"\");\n setSaveModalOpen(true);\n };\n\n const commitSnippet = () => {\n const name = snippetName.trim();\n if (!name || !value.trim()) return;\n setSnippets(saveSnippet({ name, sql: value }));\n setSaveModalOpen(false);\n };\n\n const removeSnippet = (id: string) => {\n setSnippets(deleteSnippet(id));\n };\n\n // ─── Example queries (empty state) ─────────────────────────────────────────\n\n const firstTable = tableNames[0];\n const examples = useMemo(() => {\n const list: { label: string; sql: string }[] = [];\n if (firstTable) {\n list.push({\n label: `Select rows from ${firstTable}`,\n sql: `SELECT * FROM ${firstTable} LIMIT 100;`,\n });\n }\n list.push({\n label: \"List tables\",\n sql:\n dialect === \"postgres\"\n ? \"SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' ORDER BY table_name;\"\n : \"SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;\",\n });\n if (firstTable) {\n list.push({\n label: `Count rows in ${firstTable}`,\n sql: `SELECT COUNT(*) AS total FROM ${firstTable};`,\n });\n }\n return list;\n }, [firstTable, dialect]);\n\n const hasResults = result !== null;\n const canExport = hasResults && result!.columns.length > 0;\n\n // ─── Render ──────────────────────────────────────────────────────────────\n\n return (\n <div className=\"flex h-full flex-col\">\n {/* Toolbar */}\n <div className=\"flex flex-wrap items-center gap-2 border-b border-border bg-background px-3 py-2\">\n <button\n type=\"button\"\n onClick={runActiveStatement}\n disabled={running || !value.trim()}\n title={`Run selection / statement (${MOD}+Enter)`}\n className=\"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-semibold text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {running ? (\n <IconLoader2 size={14} className=\"animate-spin\" />\n ) : (\n <IconPlayerPlayFilled size={14} />\n )}\n Run\n </button>\n\n <span className=\"hidden text-[11px] text-muted-foreground sm:inline\">\n {MOD}+Enter runs selection / statement · {MOD}+Shift+Enter runs all\n </span>\n\n <div className=\"ml-auto flex items-center gap-2\">\n {/* History */}\n <Popover>\n <PopoverTrigger asChild>\n <ToolbarButton title=\"Query history\">\n <IconHistory size={14} />\n History\n </ToolbarButton>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-96 p-0\">\n <div className=\"flex items-center justify-between border-b border-border px-3 py-2\">\n <span className=\"text-xs font-semibold text-foreground\">\n Recent queries\n </span>\n {history.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n clearHistory();\n setHistory([]);\n }}\n className=\"cursor-pointer text-[11px] text-muted-foreground hover:text-foreground\"\n >\n Clear\n </button>\n )}\n </div>\n <div className=\"max-h-80 overflow-auto py-1\">\n {history.length === 0 ? (\n <div className=\"px-3 py-6 text-center text-xs text-muted-foreground\">\n No queries yet\n </div>\n ) : (\n history.map((h, i) => (\n <button\n key={i}\n type=\"button\"\n onClick={() => loadIntoEditor(h)}\n className=\"block w-full cursor-pointer truncate px-3 py-1.5 text-left font-mono text-[11px] text-foreground hover:bg-accent\"\n title={h}\n >\n {h.replace(/\\s+/g, \" \").trim()}\n </button>\n ))\n )}\n </div>\n </PopoverContent>\n </Popover>\n\n {/* Snippets */}\n <Popover>\n <PopoverTrigger asChild>\n <ToolbarButton title=\"Saved snippets\">\n <IconBookmark size={14} />\n Snippets\n </ToolbarButton>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-96 p-0\">\n <div className=\"flex items-center justify-between border-b border-border px-3 py-2\">\n <span className=\"text-xs font-semibold text-foreground\">\n Saved snippets\n </span>\n <button\n type=\"button\"\n onClick={openSaveModal}\n disabled={!value.trim()}\n className=\"inline-flex cursor-pointer items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <IconBookmarkPlus size={13} />\n Save current\n </button>\n </div>\n <div className=\"max-h-80 overflow-auto py-1\">\n {snippets.length === 0 ? (\n <div className=\"px-3 py-6 text-center text-xs text-muted-foreground\">\n No saved snippets\n </div>\n ) : (\n snippets.map((s) => (\n <div\n key={s.id}\n className=\"group flex items-center gap-2 px-3 py-1.5 hover:bg-accent\"\n >\n <button\n type=\"button\"\n onClick={() => loadIntoEditor(s.sql)}\n className=\"min-w-0 flex-1 cursor-pointer text-left\"\n title={s.sql}\n >\n <div className=\"truncate text-xs font-medium text-foreground\">\n {s.name}\n </div>\n <div className=\"truncate font-mono text-[10px] text-muted-foreground\">\n {s.sql.replace(/\\s+/g, \" \").trim()}\n </div>\n </button>\n <button\n type=\"button\"\n onClick={() => removeSnippet(s.id)}\n className=\"cursor-pointer rounded p-1 text-muted-foreground opacity-0 transition-opacity hover:text-red-500 group-hover:opacity-100\"\n title=\"Delete snippet\"\n >\n <IconTrash size={13} />\n </button>\n </div>\n ))\n )}\n </div>\n </PopoverContent>\n </Popover>\n\n {/* Export */}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <ToolbarButton title=\"Export results\" disabled={!canExport}>\n <IconDownload size={14} />\n Export\n <IconChevronDown size={12} className=\"opacity-60\" />\n </ToolbarButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onClick={() => exportAs(\"csv\")}>\n Download CSV\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => exportAs(\"json\")}>\n Download JSON\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n </div>\n\n {/* Editor pane */}\n <div\n className=\"shrink-0 overflow-hidden border-b border-border\"\n style={{ height: editorHeight }}\n >\n <CodeMirror\n ref={editorRef}\n value={value}\n onChange={setValue}\n height={`${editorHeight}px`}\n theme={isDark ? oneDark : undefined}\n extensions={extensions}\n placeholder=\"Write SQL here…\"\n basicSetup={{\n lineNumbers: true,\n highlightActiveLine: true,\n autocompletion: true,\n bracketMatching: true,\n closeBrackets: true,\n }}\n style={{ fontSize: 13, height: \"100%\" }}\n />\n </div>\n\n {/* Splitter */}\n <div\n onMouseDown={startDrag}\n className=\"h-1.5 shrink-0 cursor-row-resize bg-border/40 transition-colors hover:bg-primary/40\"\n role=\"separator\"\n aria-orientation=\"horizontal\"\n />\n\n {/* Status / error bar */}\n {(status || error) && (\n <div className=\"shrink-0 px-3 py-1.5\">\n {error ? (\n <div className=\"flex items-start gap-2 rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-xs text-red-500\">\n <IconAlertTriangle size={14} className=\"mt-px shrink-0\" />\n <span className=\"break-words font-mono\">{error}</span>\n </div>\n ) : (\n <div className=\"font-mono text-[11px] text-muted-foreground\">\n {status}\n </div>\n )}\n </div>\n )}\n\n {/* Results panel */}\n <div className=\"min-h-0 flex-1 overflow-hidden\">\n {hasResults ? (\n <ResultsGrid columns={result!.columns} rows={result!.rows} />\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center gap-4 p-6 text-center\">\n <div className=\"text-sm text-muted-foreground\">\n Run a query to see results, or start with an example:\n </div>\n <div className=\"flex flex-col gap-2\">\n {examples.map((ex, i) => (\n <button\n key={i}\n type=\"button\"\n onClick={() => loadIntoEditor(ex.sql)}\n className=\"cursor-pointer rounded-md border border-border bg-background px-4 py-2 text-left transition-colors hover:bg-accent\"\n >\n <div className=\"text-xs font-medium text-foreground\">\n {ex.label}\n </div>\n <div className=\"mt-0.5 font-mono text-[11px] text-muted-foreground\">\n {ex.sql}\n </div>\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n\n {/* Destructive-confirm modal */}\n {confirmSql && (\n <Modal\n title=\"Confirm destructive query\"\n onClose={() => setConfirmSql(null)}\n >\n <div className=\"space-y-4\">\n <div className=\"flex items-start gap-2 text-sm text-foreground\">\n <IconAlertTriangle\n size={18}\n className=\"mt-px shrink-0 text-yellow-500\"\n />\n <p>\n This looks like a destructive query (DROP / TRUNCATE / DELETE\n without WHERE). Run it?\n </p>\n </div>\n <pre className=\"max-h-40 overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-[11px] text-foreground\">\n {confirmSql}\n </pre>\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => setConfirmSql(null)}\n className=\"inline-flex h-8 cursor-pointer items-center rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={confirmAndRun}\n className=\"inline-flex h-8 cursor-pointer items-center rounded-md bg-red-500 px-3 text-xs font-semibold text-white hover:bg-red-600\"\n >\n Run anyway\n </button>\n </div>\n </div>\n </Modal>\n )}\n\n {/* Save-snippet modal */}\n {saveModalOpen && (\n <Modal title=\"Save snippet\" onClose={() => setSaveModalOpen(false)}>\n <div className=\"space-y-4\">\n <div>\n <label className=\"mb-1.5 block text-xs font-medium text-muted-foreground\">\n Snippet name\n </label>\n <input\n autoFocus\n value={snippetName}\n onChange={(e) => setSnippetName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") commitSnippet();\n }}\n placeholder=\"e.g. Active users this week\"\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary\"\n />\n </div>\n <pre className=\"max-h-40 overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-[11px] text-foreground\">\n {value.trim()}\n </pre>\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => setSaveModalOpen(false)}\n className=\"inline-flex h-8 cursor-pointer items-center rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={commitSnippet}\n disabled={!snippetName.trim()}\n className=\"inline-flex h-8 cursor-pointer items-center rounded-md bg-primary px-3 text-xs font-semibold text-primary-foreground hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n Save\n </button>\n </div>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SqlEditor.js","sourceRoot":"","sources":["../../../src/client/db-admin/SqlEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,KAAK,EACL,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,UAAU,EAAE,EAEjB,UAAU,EACV,MAAM,EACN,IAAI,GACL,MAAM,uBAAuB,CAAC;AAC/B;;;;;;;;;;;GAWG;AACH,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,E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AAC,IAAI,EAAE,GACT,EACN,eAAK,SAAS,EAAC,wBAAwB,aACrC,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EACtC,SAAS,EAAC,oJAAoJ,uBAGvJ,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,EAC7B,SAAS,EAAC,0LAA0L,qBAG7L,IACL,IACF,GACA,CACT,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { sql, PostgreSQL } from \"@codemirror/lang-sql\";\nimport { oneDark } from \"@codemirror/theme-one-dark\";\nimport {\n IconPlayerPlayFilled,\n IconHistory,\n IconBookmark,\n IconBookmarkPlus,\n IconDownload,\n IconAlertTriangle,\n IconLoader2,\n IconTrash,\n IconX,\n IconChevronDown,\n} from \"@tabler/icons-react\";\nimport CodeMirror, {\n type ReactCodeMirrorRef,\n EditorView,\n keymap,\n Prec,\n} from \"@uiw/react-codemirror\";\n/**\n * Production-grade SQL editor for the dev-mode database admin.\n *\n * Layout: a CodeMirror editor pane on top, a resizable results panel below.\n * Features schema-aware autocomplete, keyboard run shortcuts, history, named\n * snippets, CSV/JSON export, and a confirm modal for destructive statements.\n *\n * Data access goes through `runQuery` from `./useDbAdmin.js` (the shared\n * contract). On a destructive statement without confirmation, `runQuery` throws\n * an Error whose `needsConfirm` flag is `true`; we catch that and re-run after\n * the user confirms in a locally-built modal.\n */\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\n\nimport type { DbAdminDialect } from \"../../db-admin/types.js\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"../components/ui/dropdown-menu.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport { cn } from \"../utils.js\";\nimport { toCSV, toJSON, downloadFile } from \"./export-utils.js\";\nimport { ResultsGrid } from \"./ResultsGrid.js\";\nimport {\n loadHistory,\n pushHistory,\n clearHistory,\n loadSnippets,\n saveSnippet,\n deleteSnippet,\n type SqlSnippet,\n} from \"./sql-storage.js\";\nimport { runQuery, type DbAdminRequestConfig } from \"./useDbAdmin.js\";\n\nexport interface SqlEditorProps {\n dialect: DbAdminDialect;\n tableNames: string[];\n columnsByTable: Record<string, string[]>;\n requestConfig?: DbAdminRequestConfig;\n}\n\ninterface QueryResult {\n columns: string[];\n rows: Record<string, unknown>[];\n rowsAffected: number;\n durationMs: number;\n}\n\n// ─── Dark-mode detection ─────────────────────────────────────────────────────\n\nfunction useIsDark(): boolean {\n const [isDark, setIsDark] = useState(false);\n useEffect(() => {\n if (typeof document === \"undefined\") return;\n const root = document.documentElement;\n const update = () => setIsDark(root.classList.contains(\"dark\"));\n update();\n const observer = new MutationObserver(update);\n observer.observe(root, { attributes: true, attributeFilter: [\"class\"] });\n return () => observer.disconnect();\n }, []);\n return isDark;\n}\n\n// ─── Statement-under-cursor helpers ──────────────────────────────────────────\n\n/**\n * Best-effort split of a SQL buffer into statements by top-level `;`, ignoring\n * semicolons inside single/double quotes or line/block comments. Returns each\n * statement with its character offsets so we can pick the one under the cursor.\n */\nfunction splitStatements(\n text: string,\n): { sql: string; start: number; end: number }[] {\n const out: { sql: string; start: number; end: number }[] = [];\n let start = 0;\n let inSingle = false;\n let inDouble = false;\n let inLineComment = false;\n let inBlockComment = false;\n\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n const next = text[i + 1];\n\n if (inLineComment) {\n if (ch === \"\\n\") inLineComment = false;\n continue;\n }\n if (inBlockComment) {\n if (ch === \"*\" && next === \"/\") {\n inBlockComment = false;\n i++;\n }\n continue;\n }\n if (inSingle) {\n if (ch === \"'\") inSingle = false;\n continue;\n }\n if (inDouble) {\n if (ch === '\"') inDouble = false;\n continue;\n }\n\n if (ch === \"-\" && next === \"-\") {\n inLineComment = true;\n i++;\n continue;\n }\n if (ch === \"/\" && next === \"*\") {\n inBlockComment = true;\n i++;\n continue;\n }\n if (ch === \"'\") {\n inSingle = true;\n continue;\n }\n if (ch === '\"') {\n inDouble = true;\n continue;\n }\n if (ch === \";\") {\n out.push({ sql: text.slice(start, i + 1), start, end: i + 1 });\n start = i + 1;\n }\n }\n if (start < text.length) {\n out.push({ sql: text.slice(start), start, end: text.length });\n }\n return out;\n}\n\n/** Resolve which SQL to run given the current selection and cursor position. */\nfunction resolveRunTarget(\n view: EditorView | undefined,\n buffer: string,\n): string {\n if (!view) return buffer;\n const sel = view.state.selection.main;\n if (!sel.empty) {\n return view.state.sliceDoc(sel.from, sel.to);\n }\n const cursor = sel.head;\n const statements = splitStatements(buffer);\n const hit = statements.find((s) => cursor >= s.start && cursor <= s.end);\n return (hit?.sql ?? buffer).trim() || buffer;\n}\n\n// ─── Local modal primitive ───────────────────────────────────────────────────\n\nfunction Modal({\n title,\n children,\n onClose,\n}: {\n title: string;\n children: ReactNode;\n onClose: () => void;\n}) {\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [onClose]);\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <div\n className=\"absolute inset-0 bg-black/50\"\n onClick={onClose}\n aria-hidden\n />\n <div className=\"relative z-10 w-full max-w-md rounded-lg border border-border bg-background shadow-xl\">\n <div className=\"flex items-center justify-between border-b border-border px-4 py-3\">\n <h2 className=\"text-sm font-semibold text-foreground\">{title}</h2>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"cursor-pointer rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground\"\n aria-label=\"Close\"\n >\n <IconX size={16} />\n </button>\n </div>\n <div className=\"p-4\">{children}</div>\n </div>\n </div>\n );\n}\n\n// ─── Toolbar button ──────────────────────────────────────────────────────────\n\nfunction ToolbarButton({\n children,\n onClick,\n className,\n title,\n disabled,\n}: {\n children: ReactNode;\n onClick?: () => void;\n className?: string;\n title?: string;\n disabled?: boolean;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title={title}\n disabled={disabled}\n className={cn(\n \"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-xs font-medium text-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n >\n {children}\n </button>\n );\n}\n\nconst isMac =\n typeof navigator !== \"undefined\" &&\n /Mac|iPhone|iPad/.test(navigator.platform);\nconst MOD = isMac ? \"Cmd\" : \"Ctrl\";\n\n// ─── Main component ──────────────────────────────────────────────────────────\n\nexport function SqlEditor({\n dialect,\n tableNames,\n columnsByTable,\n requestConfig,\n}: SqlEditorProps) {\n const isDark = useIsDark();\n const editorRef = useRef<ReactCodeMirrorRef>(null);\n\n const [value, setValue] = useState(\"\");\n const [running, setRunning] = useState(false);\n const [result, setResult] = useState<QueryResult | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [status, setStatus] = useState<string | null>(null);\n\n const [history, setHistory] = useState<string[]>([]);\n const [snippets, setSnippets] = useState<SqlSnippet[]>([]);\n\n const [confirmSql, setConfirmSql] = useState<string | null>(null);\n const [saveModalOpen, setSaveModalOpen] = useState(false);\n const [snippetName, setSnippetName] = useState(\"\");\n\n // Editor height (px) — draggable splitter between editor and results.\n const [editorHeight, setEditorHeight] = useState(240);\n const dragState = useRef<{ startY: number; startHeight: number } | null>(\n null,\n );\n\n // Keep the latest buffer accessible inside CodeMirror keymap closures.\n const valueRef = useRef(value);\n valueRef.current = value;\n\n useEffect(() => {\n setHistory(loadHistory());\n setSnippets(loadSnippets());\n }, []);\n\n // ─── Run logic ────────────────────────────────────────────────────────────\n\n const execute = useCallback(\n async (sqlText: string, confirmDestructive?: boolean) => {\n const trimmed = sqlText.trim();\n if (!trimmed) return;\n setRunning(true);\n setError(null);\n try {\n const res = await runQuery(\n trimmed,\n undefined,\n confirmDestructive,\n requestConfig,\n );\n setResult({\n columns: res.columns,\n rows: res.rows,\n rowsAffected: res.rowsAffected,\n durationMs: res.durationMs,\n });\n if (res.columns.length > 0) {\n setStatus(`${res.rows.length} rows · ${res.durationMs}ms`);\n } else {\n setStatus(\n `Query OK · ${res.rowsAffected} rows affected · ${res.durationMs}ms`,\n );\n }\n setHistory(pushHistory(trimmed));\n } catch (err) {\n const e = err as Error & { needsConfirm?: boolean };\n if (e.needsConfirm) {\n setConfirmSql(trimmed);\n } else {\n setError(e.message || \"Query failed\");\n setStatus(null);\n }\n } finally {\n setRunning(false);\n }\n },\n [requestConfig],\n );\n\n const runActiveStatement = useCallback(() => {\n const view = editorRef.current?.view;\n const target = resolveRunTarget(view, valueRef.current);\n void execute(target);\n }, [execute]);\n\n const runWholeBuffer = useCallback(() => {\n void execute(valueRef.current);\n }, [execute]);\n\n const confirmAndRun = useCallback(() => {\n const sqlText = confirmSql;\n setConfirmSql(null);\n if (sqlText) void execute(sqlText, true);\n }, [confirmSql, execute]);\n\n // ─── CodeMirror extensions ──────────────────────────────────────────────\n\n const extensions = useMemo(() => {\n const langExt = sql({\n dialect: dialect === \"postgres\" ? PostgreSQL : undefined,\n schema: columnsByTable,\n tables: tableNames.map((t) => ({ label: t })),\n upperCaseKeywords: true,\n });\n\n const runKeymap = Prec.highest(\n keymap.of([\n {\n key: \"Mod-Enter\",\n preventDefault: true,\n run: () => {\n runActiveStatement();\n return true;\n },\n },\n {\n key: \"Mod-Shift-Enter\",\n preventDefault: true,\n run: () => {\n runWholeBuffer();\n return true;\n },\n },\n ]),\n );\n\n return [runKeymap, langExt, EditorView.lineWrapping];\n // tableNames / columnsByTable identity is stable enough for our purposes;\n // re-derive when the dialect or schema reference changes.\n }, [dialect, columnsByTable, tableNames, runActiveStatement, runWholeBuffer]);\n\n // ─── Splitter drag ───────────────────────────────────────────────────────\n\n useEffect(() => {\n const onMove = (e: MouseEvent) => {\n if (!dragState.current) return;\n const delta = e.clientY - dragState.current.startY;\n const next = Math.min(\n Math.max(dragState.current.startHeight + delta, 120),\n 640,\n );\n setEditorHeight(next);\n };\n const onUp = () => {\n dragState.current = null;\n document.body.style.userSelect = \"\";\n };\n window.addEventListener(\"mousemove\", onMove);\n window.addEventListener(\"mouseup\", onUp);\n return () => {\n window.removeEventListener(\"mousemove\", onMove);\n window.removeEventListener(\"mouseup\", onUp);\n };\n }, []);\n\n const startDrag = (e: React.MouseEvent) => {\n dragState.current = { startY: e.clientY, startHeight: editorHeight };\n document.body.style.userSelect = \"none\";\n };\n\n // ─── Loading editor content from history / snippets ───────────────────────\n\n const loadIntoEditor = useCallback((sqlText: string) => {\n setValue(sqlText);\n // Focus and place cursor at end after the controlled value updates.\n requestAnimationFrame(() => {\n const view = editorRef.current?.view;\n if (view) {\n view.focus();\n view.dispatch({ selection: { anchor: view.state.doc.length } });\n }\n });\n }, []);\n\n // ─── Export ────────────────────────────────────────────────────────────────\n\n const exportAs = (format: \"csv\" | \"json\") => {\n if (!result || result.columns.length === 0) return;\n const stamp = new Date().toISOString().replace(/[:.]/g, \"-\").slice(0, 19);\n if (format === \"csv\") {\n downloadFile(\n `query-result-${stamp}.csv`,\n \"text/csv;charset=utf-8\",\n toCSV(result.columns, result.rows),\n );\n } else {\n downloadFile(\n `query-result-${stamp}.json`,\n \"application/json\",\n toJSON(result.rows),\n );\n }\n };\n\n // ─── Snippet save ────────────────────────────────────────────────────────\n\n const openSaveModal = () => {\n if (!value.trim()) return;\n setSnippetName(\"\");\n setSaveModalOpen(true);\n };\n\n const commitSnippet = () => {\n const name = snippetName.trim();\n if (!name || !value.trim()) return;\n setSnippets(saveSnippet({ name, sql: value }));\n setSaveModalOpen(false);\n };\n\n const removeSnippet = (id: string) => {\n setSnippets(deleteSnippet(id));\n };\n\n // ─── Example queries (empty state) ─────────────────────────────────────────\n\n const firstTable = tableNames[0];\n const examples = useMemo(() => {\n const list: { label: string; sql: string }[] = [];\n if (firstTable) {\n list.push({\n label: `Select rows from ${firstTable}`,\n sql: `SELECT * FROM ${firstTable} LIMIT 100;`,\n });\n }\n list.push({\n label: \"List tables\",\n sql:\n dialect === \"postgres\"\n ? \"SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' ORDER BY table_name;\"\n : \"SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;\",\n });\n if (firstTable) {\n list.push({\n label: `Count rows in ${firstTable}`,\n sql: `SELECT COUNT(*) AS total FROM ${firstTable};`,\n });\n }\n return list;\n }, [firstTable, dialect]);\n\n const hasResults = result !== null;\n const canExport = hasResults && result!.columns.length > 0;\n\n // ─── Render ──────────────────────────────────────────────────────────────\n\n return (\n <div className=\"flex h-full flex-col\">\n {/* Toolbar */}\n <div className=\"flex flex-wrap items-center gap-2 border-b border-border bg-background px-3 py-2\">\n <button\n type=\"button\"\n onClick={runActiveStatement}\n disabled={running || !value.trim()}\n title={`Run selection / statement (${MOD}+Enter)`}\n className=\"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-semibold text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {running ? (\n <IconLoader2 size={14} className=\"animate-spin\" />\n ) : (\n <IconPlayerPlayFilled size={14} />\n )}\n Run\n </button>\n\n <span className=\"hidden text-[11px] text-muted-foreground sm:inline\">\n {MOD}+Enter runs selection / statement · {MOD}+Shift+Enter runs all\n </span>\n\n <div className=\"ml-auto flex items-center gap-2\">\n {/* History */}\n <Popover>\n <PopoverTrigger asChild>\n <ToolbarButton title=\"Query history\">\n <IconHistory size={14} />\n History\n </ToolbarButton>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-96 p-0\">\n <div className=\"flex items-center justify-between border-b border-border px-3 py-2\">\n <span className=\"text-xs font-semibold text-foreground\">\n Recent queries\n </span>\n {history.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n clearHistory();\n setHistory([]);\n }}\n className=\"cursor-pointer text-[11px] text-muted-foreground hover:text-foreground\"\n >\n Clear\n </button>\n )}\n </div>\n <div className=\"max-h-80 overflow-auto py-1\">\n {history.length === 0 ? (\n <div className=\"px-3 py-6 text-center text-xs text-muted-foreground\">\n No queries yet\n </div>\n ) : (\n history.map((h, i) => (\n <button\n key={i}\n type=\"button\"\n onClick={() => loadIntoEditor(h)}\n className=\"block w-full cursor-pointer truncate px-3 py-1.5 text-left font-mono text-[11px] text-foreground hover:bg-accent\"\n title={h}\n >\n {h.replace(/\\s+/g, \" \").trim()}\n </button>\n ))\n )}\n </div>\n </PopoverContent>\n </Popover>\n\n {/* Snippets */}\n <Popover>\n <PopoverTrigger asChild>\n <ToolbarButton title=\"Saved snippets\">\n <IconBookmark size={14} />\n Snippets\n </ToolbarButton>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-96 p-0\">\n <div className=\"flex items-center justify-between border-b border-border px-3 py-2\">\n <span className=\"text-xs font-semibold text-foreground\">\n Saved snippets\n </span>\n <button\n type=\"button\"\n onClick={openSaveModal}\n disabled={!value.trim()}\n className=\"inline-flex cursor-pointer items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <IconBookmarkPlus size={13} />\n Save current\n </button>\n </div>\n <div className=\"max-h-80 overflow-auto py-1\">\n {snippets.length === 0 ? (\n <div className=\"px-3 py-6 text-center text-xs text-muted-foreground\">\n No saved snippets\n </div>\n ) : (\n snippets.map((s) => (\n <div\n key={s.id}\n className=\"group flex items-center gap-2 px-3 py-1.5 hover:bg-accent\"\n >\n <button\n type=\"button\"\n onClick={() => loadIntoEditor(s.sql)}\n className=\"min-w-0 flex-1 cursor-pointer text-left\"\n title={s.sql}\n >\n <div className=\"truncate text-xs font-medium text-foreground\">\n {s.name}\n </div>\n <div className=\"truncate font-mono text-[10px] text-muted-foreground\">\n {s.sql.replace(/\\s+/g, \" \").trim()}\n </div>\n </button>\n <button\n type=\"button\"\n onClick={() => removeSnippet(s.id)}\n className=\"cursor-pointer rounded p-1 text-muted-foreground opacity-0 transition-opacity hover:text-red-500 group-hover:opacity-100\"\n title=\"Delete snippet\"\n >\n <IconTrash size={13} />\n </button>\n </div>\n ))\n )}\n </div>\n </PopoverContent>\n </Popover>\n\n {/* Export */}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <ToolbarButton title=\"Export results\" disabled={!canExport}>\n <IconDownload size={14} />\n Export\n <IconChevronDown size={12} className=\"opacity-60\" />\n </ToolbarButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onClick={() => exportAs(\"csv\")}>\n Download CSV\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => exportAs(\"json\")}>\n Download JSON\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n </div>\n\n {/* Editor pane */}\n <div\n className=\"shrink-0 overflow-hidden border-b border-border\"\n style={{ height: editorHeight }}\n >\n <CodeMirror\n ref={editorRef}\n value={value}\n onChange={setValue}\n height={`${editorHeight}px`}\n theme={isDark ? oneDark : undefined}\n extensions={extensions}\n placeholder=\"Write SQL here…\"\n basicSetup={{\n lineNumbers: true,\n highlightActiveLine: true,\n autocompletion: true,\n bracketMatching: true,\n closeBrackets: true,\n }}\n style={{ fontSize: 13, height: \"100%\" }}\n />\n </div>\n\n {/* Splitter */}\n <div\n onMouseDown={startDrag}\n className=\"h-1.5 shrink-0 cursor-row-resize bg-border/40 transition-colors hover:bg-primary/40\"\n role=\"separator\"\n aria-orientation=\"horizontal\"\n />\n\n {/* Status / error bar */}\n {(status || error) && (\n <div className=\"shrink-0 px-3 py-1.5\">\n {error ? (\n <div className=\"flex items-start gap-2 rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-xs text-red-500\">\n <IconAlertTriangle size={14} className=\"mt-px shrink-0\" />\n <span className=\"break-words font-mono\">{error}</span>\n </div>\n ) : (\n <div className=\"font-mono text-[11px] text-muted-foreground\">\n {status}\n </div>\n )}\n </div>\n )}\n\n {/* Results panel */}\n <div className=\"min-h-0 flex-1 overflow-hidden\">\n {hasResults ? (\n <ResultsGrid columns={result!.columns} rows={result!.rows} />\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center gap-4 p-6 text-center\">\n <div className=\"text-sm text-muted-foreground\">\n Run a query to see results, or start with an example:\n </div>\n <div className=\"flex flex-col gap-2\">\n {examples.map((ex, i) => (\n <button\n key={i}\n type=\"button\"\n onClick={() => loadIntoEditor(ex.sql)}\n className=\"cursor-pointer rounded-md border border-border bg-background px-4 py-2 text-left transition-colors hover:bg-accent\"\n >\n <div className=\"text-xs font-medium text-foreground\">\n {ex.label}\n </div>\n <div className=\"mt-0.5 font-mono text-[11px] text-muted-foreground\">\n {ex.sql}\n </div>\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n\n {/* Destructive-confirm modal */}\n {confirmSql && (\n <Modal\n title=\"Confirm destructive query\"\n onClose={() => setConfirmSql(null)}\n >\n <div className=\"space-y-4\">\n <div className=\"flex items-start gap-2 text-sm text-foreground\">\n <IconAlertTriangle\n size={18}\n className=\"mt-px shrink-0 text-yellow-500\"\n />\n <p>\n This looks like a destructive query (DROP / TRUNCATE / DELETE\n without WHERE). Run it?\n </p>\n </div>\n <pre className=\"max-h-40 overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-[11px] text-foreground\">\n {confirmSql}\n </pre>\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => setConfirmSql(null)}\n className=\"inline-flex h-8 cursor-pointer items-center rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={confirmAndRun}\n className=\"inline-flex h-8 cursor-pointer items-center rounded-md bg-red-500 px-3 text-xs font-semibold text-white hover:bg-red-600\"\n >\n Run anyway\n </button>\n </div>\n </div>\n </Modal>\n )}\n\n {/* Save-snippet modal */}\n {saveModalOpen && (\n <Modal title=\"Save snippet\" onClose={() => setSaveModalOpen(false)}>\n <div className=\"space-y-4\">\n <div>\n <label className=\"mb-1.5 block text-xs font-medium text-muted-foreground\">\n Snippet name\n </label>\n <input\n autoFocus\n value={snippetName}\n onChange={(e) => setSnippetName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") commitSnippet();\n }}\n placeholder=\"e.g. Active users this week\"\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary\"\n />\n </div>\n <pre className=\"max-h-40 overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-[11px] text-foreground\">\n {value.trim()}\n </pre>\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => setSaveModalOpen(false)}\n className=\"inline-flex h-8 cursor-pointer items-center rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={commitSnippet}\n disabled={!snippetName.trim()}\n className=\"inline-flex h-8 cursor-pointer items-center rounded-md bg-primary px-3 text-xs font-semibold text-primary-foreground hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n Save\n </button>\n </div>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { DbAdminDialect, DbAdminFilter } from "../../db-admin/types.js";
|
|
2
|
+
import { type DbAdminRequestConfig } from "./useDbAdmin.js";
|
|
2
3
|
export interface TableEditorProps {
|
|
3
4
|
table: string;
|
|
4
5
|
dialect: DbAdminDialect;
|
|
6
|
+
requestConfig?: DbAdminRequestConfig;
|
|
5
7
|
initialFilters?: DbAdminFilter[];
|
|
6
8
|
onNavigateToRow: (table: string, filters: DbAdminFilter[]) => void;
|
|
7
9
|
}
|
|
8
|
-
export declare function TableEditor({ table, dialect: _dialect, initialFilters, onNavigateToRow, }: TableEditorProps): import("react").JSX.Element;
|
|
10
|
+
export declare function TableEditor({ table, dialect: _dialect, requestConfig, initialFilters, onNavigateToRow, }: TableEditorProps): import("react").JSX.Element;
|
|
9
11
|
//# sourceMappingURL=TableEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableEditor.d.ts","sourceRoot":"","sources":["../../../src/client/db-admin/TableEditor.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EAId,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"TableEditor.d.ts","sourceRoot":"","sources":["../../../src/client/db-admin/TableEditor.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EAId,MAAM,yBAAyB,CAAC;AAYjC,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,cAAc,CAAC;IACxB,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CACpE;AAKD,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EAAE,QAAQ,EACjB,aAAa,EACb,cAAc,EACd,eAAe,GAChB,EAAE,gBAAgB,+BAqelB"}
|
|
@@ -9,10 +9,10 @@ import { DataGrid } from "./DataGrid.js";
|
|
|
9
9
|
import { FilterBar } from "./FilterBar.js";
|
|
10
10
|
import { RowSidePanel } from "./RowSidePanel.js";
|
|
11
11
|
import { loadGridState, saveGridState } from "./storage.js";
|
|
12
|
-
import { useTableSchema, useTableRows, mutateTable } from "./useDbAdmin.js";
|
|
12
|
+
import { useTableSchema, useTableRows, mutateTable, } from "./useDbAdmin.js";
|
|
13
13
|
const DEFAULT_PAGE_SIZE = 100;
|
|
14
14
|
const PAGE_SIZES = [25, 50, 100, 250, 500];
|
|
15
|
-
export function TableEditor({ table, dialect: _dialect, initialFilters, onNavigateToRow, }) {
|
|
15
|
+
export function TableEditor({ table, dialect: _dialect, requestConfig, initialFilters, onNavigateToRow, }) {
|
|
16
16
|
// ─── Persisted view state ──────────────────────────────────────────────
|
|
17
17
|
const persisted = useMemo(() => loadGridState(table), [table]);
|
|
18
18
|
const [page, setPage] = useState(1);
|
|
@@ -39,9 +39,9 @@ export function TableEditor({ table, dialect: _dialect, initialFilters, onNaviga
|
|
|
39
39
|
saveGridState(table, { columnWidths, sort, filters, pageSize });
|
|
40
40
|
}, [table, columnWidths, sort, filters, pageSize]);
|
|
41
41
|
// ─── Data ────────────────────────────────────────────────────────────────
|
|
42
|
-
const schemaState = useTableSchema(table);
|
|
42
|
+
const schemaState = useTableSchema(table, requestConfig);
|
|
43
43
|
const rowsReq = useMemo(() => ({ page, pageSize, sort, filters }), [page, pageSize, sort, filters]);
|
|
44
|
-
const rowsState = useTableRows(table, rowsReq);
|
|
44
|
+
const rowsState = useTableRows(table, rowsReq, requestConfig);
|
|
45
45
|
const schema = schemaState.data;
|
|
46
46
|
const changeset = useChangeset(schema);
|
|
47
47
|
// ─── Toolbar UI state ──────────────────────────────────────────────────
|
|
@@ -123,8 +123,8 @@ export function TableEditor({ table, dialect: _dialect, initialFilters, onNaviga
|
|
|
123
123
|
if (!mutation.inserts && !mutation.updates && !mutation.deletes) {
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
126
|
-
return mutateTable(table, mutation);
|
|
127
|
-
}, [changeset, originalRows, table]);
|
|
126
|
+
return mutateTable(table, mutation, requestConfig);
|
|
127
|
+
}, [changeset, originalRows, requestConfig, table]);
|
|
128
128
|
const handlePreview = useCallback(async () => {
|
|
129
129
|
setCommitError(null);
|
|
130
130
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableEditor.js","sourceRoot":"","sources":["../../../src/client/db-admin/TableEditor.tsx"],"names":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jC,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;gBAAE,QAAQ,EAAE,CAAC;QACrC,CAAC,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC1C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IACjD,OAAO,YAAY,CACjB,eAAK,SAAS,EAAC,wDAAwD,aACrE,cAAK,SAAS,EAAC,8BAA8B,EAAC,OAAO,EAAE,QAAQ,GAAI,EACnE,eAAK,SAAS,EAAC,gFAAgF,aAC7F,eAAK,SAAS,EAAC,8BAA8B,aAC1C,WAAW,IAAI,CACd,KAAC,iBAAiB,IAAC,SAAS,EAAC,0BAA0B,GAAG,CAC3D,EACD,aAAI,SAAS,EAAC,uCAAuC,YAAE,KAAK,GAAM,IAC9D,EACN,YAAG,SAAS,EAAC,oCAAoC,YAAE,IAAI,GAAK,EAC5D,eAAK,SAAS,EAAC,wBAAwB,aACrC,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAC,2FAA2F,uBAG9F,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,EAAE,CACX,oEAAoE,EACpE,WAAW;oCACT,CAAC,CAAC,wCAAwC;oCAC1C,CAAC,CAAC,gCAAgC,CACrC,YAEA,YAAY,GACN,IACL,IACF,IACF,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;AACJ,CAAC","sourcesContent":["import {\n IconPlus,\n IconFilter,\n IconRefresh,\n IconTrash,\n IconAlertTriangle,\n IconCode,\n IconArrowBackUp,\n IconDeviceFloppy,\n IconChevronLeft,\n IconChevronRight,\n IconChevronsLeft,\n IconChevronsRight,\n IconLoader2,\n IconCheck,\n IconKeyOff,\n} from \"@tabler/icons-react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport type {\n DbAdminDialect,\n DbAdminFilter,\n DbAdminForeignKey,\n DbAdminSort,\n DbAdminMutationResult,\n} from \"../../db-admin/types.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport { cn } from \"../utils.js\";\nimport { useChangeset, pkStringFor } from \"./changeset.js\";\nimport { DataGrid, type GridRow, type ActiveCell } from \"./DataGrid.js\";\nimport { FilterBar } from \"./FilterBar.js\";\nimport { RowSidePanel, type RowSidePanelMode } from \"./RowSidePanel.js\";\nimport { loadGridState, saveGridState } from \"./storage.js\";\nimport { useTableSchema, useTableRows, mutateTable } from \"./useDbAdmin.js\";\n\nexport interface TableEditorProps {\n table: string;\n dialect: DbAdminDialect;\n initialFilters?: DbAdminFilter[];\n onNavigateToRow: (table: string, filters: DbAdminFilter[]) => void;\n}\n\nconst DEFAULT_PAGE_SIZE = 100;\nconst PAGE_SIZES = [25, 50, 100, 250, 500];\n\nexport function TableEditor({\n table,\n dialect: _dialect,\n initialFilters,\n onNavigateToRow,\n}: TableEditorProps) {\n // ─── Persisted view state ──────────────────────────────────────────────\n const persisted = useMemo(() => loadGridState(table), [table]);\n\n const [page, setPage] = useState(1);\n const [pageSize, setPageSize] = useState(\n persisted.pageSize ?? DEFAULT_PAGE_SIZE,\n );\n const [sort, setSort] = useState<DbAdminSort[]>(persisted.sort ?? []);\n const [filters, setFilters] = useState<DbAdminFilter[]>(\n initialFilters ?? persisted.filters ?? [],\n );\n const [columnWidths, setColumnWidths] = useState<Record<string, number>>(\n persisted.columnWidths ?? {},\n );\n const [selectedPks, setSelectedPks] = useState<Set<string>>(new Set());\n const [active, setActive] = useState<ActiveCell | null>(null);\n\n // Reset transient state when switching tables.\n useEffect(() => {\n const p = loadGridState(table);\n setPage(1);\n setPageSize(p.pageSize ?? DEFAULT_PAGE_SIZE);\n setSort(p.sort ?? []);\n setFilters(initialFilters ?? p.filters ?? []);\n setColumnWidths(p.columnWidths ?? {});\n setSelectedPks(new Set());\n setActive(null);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [table]);\n\n // Persist view state.\n useEffect(() => {\n saveGridState(table, { columnWidths, sort, filters, pageSize });\n }, [table, columnWidths, sort, filters, pageSize]);\n\n // ─── Data ────────────────────────────────────────────────────────────────\n const schemaState = useTableSchema(table);\n const rowsReq = useMemo(\n () => ({ page, pageSize, sort, filters }),\n [page, pageSize, sort, filters],\n );\n const rowsState = useTableRows(table, rowsReq);\n\n const schema = schemaState.data;\n const changeset = useChangeset(schema);\n\n // ─── Toolbar UI state ──────────────────────────────────────────────────\n const [panel, setPanel] = useState<{\n mode: RowSidePanelMode;\n pk?: string;\n } | null>(null);\n const [confirmDelete, setConfirmDelete] = useState(false);\n const [previewSql, setPreviewSql] = useState<string[] | null>(null);\n const [committing, setCommitting] = useState(false);\n const [commitError, setCommitError] = useState<string | null>(null);\n const [toast, setToast] = useState<string | null>(null);\n\n const showToast = useCallback((msg: string) => {\n setToast(msg);\n window.setTimeout(() => setToast(null), 2500);\n }, []);\n\n // ─── Original rows map (pk → fetched row) ──────────────────────────────\n const originalRows = useMemo(() => {\n const map = new Map<string, Record<string, unknown>>();\n for (const row of rowsState.data?.rows ?? []) {\n map.set(pkStringFor(schema, row), row);\n }\n return map;\n }, [rowsState.data, schema]);\n\n // ─── Build grid rows with staged edits applied ──────────────────────────\n const gridRows = useMemo<GridRow[]>(() => {\n const out: GridRow[] = [];\n // New rows first (top of grid, like Supabase).\n for (const nr of changeset.newRows) {\n out.push({\n pk: `new:${nr._localId}`,\n localId: nr._localId,\n isNew: true,\n values: { ...nr.values },\n });\n }\n for (const row of rowsState.data?.rows ?? []) {\n const pk = pkStringFor(schema, row);\n const staged = changeset.edits.get(pk);\n out.push({\n pk,\n values: staged ? { ...row, ...staged } : row,\n isDeleted: changeset.deletedKeys.has(pk),\n });\n }\n return out;\n }, [\n rowsState.data,\n schema,\n changeset.newRows,\n changeset.edits,\n changeset.deletedKeys,\n ]);\n\n // ─── Cell commit routing (existing rows vs new rows) ────────────────────\n const onCellCommit = useCallback(\n (row: GridRow, col: string, value: unknown) => {\n if (row.isNew && row.localId) {\n changeset.setNewRowCell(row.localId, col, value);\n } else {\n changeset.setCell(row.pk, col, value);\n }\n },\n [changeset],\n );\n\n const isCellDirty = useCallback(\n (row: GridRow, col: string) => {\n if (row.isNew) return true;\n return changeset.isCellDirty(row.pk, col);\n },\n [changeset],\n );\n\n const onToggleDelete = useCallback(\n (row: GridRow) => {\n if (row.isNew && row.localId) {\n changeset.removeNewRow(row.localId);\n return;\n }\n changeset.deleteRows([row.pk]);\n },\n [changeset],\n );\n\n // ─── FK navigation ───────────────────────────────────────────────────────\n const onFkNavigate = useCallback(\n (fk: DbAdminForeignKey, value: unknown) => {\n onNavigateToRow(fk.refTable, [{ column: fk.refColumn, op: \"eq\", value }]);\n },\n [onNavigateToRow],\n );\n\n // ─── Commit / preview ──────────────────────────────────────────────────\n const runCommit = useCallback(\n async (dryRun: boolean) => {\n const mutation = changeset.buildMutation(originalRows, dryRun);\n if (!mutation.inserts && !mutation.updates && !mutation.deletes) {\n return null;\n }\n return mutateTable(table, mutation);\n },\n [changeset, originalRows, table],\n );\n\n const handlePreview = useCallback(async () => {\n setCommitError(null);\n try {\n const res = await runCommit(true);\n setPreviewSql(res ? res.sql : []);\n } catch (err) {\n setCommitError(err instanceof Error ? err.message : String(err));\n }\n }, [runCommit]);\n\n const handleCommit = useCallback(async () => {\n const hasDeletes = changeset.deletedKeys.size > 0;\n if (hasDeletes && !confirmDelete) {\n setConfirmDelete(true);\n return;\n }\n setCommitting(true);\n setCommitError(null);\n try {\n const res: DbAdminMutationResult | null = await runCommit(false);\n changeset.discardAll();\n setSelectedPks(new Set());\n setConfirmDelete(false);\n rowsState.refetch();\n schemaState.refetch();\n if (res) {\n const parts: string[] = [];\n if (res.inserted) parts.push(`${res.inserted} inserted`);\n if (res.updated) parts.push(`${res.updated} updated`);\n if (res.deleted) parts.push(`${res.deleted} deleted`);\n showToast(parts.length ? parts.join(\", \") : \"No changes\");\n }\n } catch (err) {\n setCommitError(err instanceof Error ? err.message : String(err));\n } finally {\n setCommitting(false);\n }\n }, [changeset, confirmDelete, runCommit, rowsState, schemaState, showToast]);\n\n // ─── Cmd/Ctrl+S to commit ──────────────────────────────────────────────\n const commitRef = useRef(handleCommit);\n commitRef.current = handleCommit;\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (\n (e.metaKey || e.ctrlKey) &&\n typeof e.key === \"string\" &&\n e.key.toLowerCase() === \"s\"\n ) {\n e.preventDefault();\n if (changeset.isDirty) void commitRef.current();\n }\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [changeset.isDirty]);\n\n // ─── Bulk delete from selection ────────────────────────────────────────\n const onBulkDelete = useCallback(() => {\n const pks = [...selectedPks].filter((pk) => !pk.startsWith(\"new:\"));\n changeset.deleteRows(pks);\n setSelectedPks(new Set());\n }, [selectedPks, changeset]);\n\n // ─── Render ──────────────────────────────────────────────────────────────\n const total = rowsState.data?.total ?? schema?.rowCount ?? 0;\n const totalPages = Math.max(1, Math.ceil(total / pageSize));\n\n if (schemaState.error) {\n return (\n <div className=\"flex h-full items-center justify-center p-8 text-sm text-destructive\">\n <IconAlertTriangle className=\"mr-2 h-4 w-4\" />\n {schemaState.error.message}\n </div>\n );\n }\n\n if (!schema) {\n return (\n <div className=\"flex h-full items-center justify-center p-8 text-sm text-muted-foreground\">\n <IconLoader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n Loading {table}…\n </div>\n );\n }\n\n const noPk = schema.primaryKey.length === 0;\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {/* Toolbar */}\n <div className=\"flex flex-col gap-2 border-b border-border px-3 py-2\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-sm font-semibold text-foreground\">\n {table}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {total.toLocaleString()} rows\n </span>\n {schema.type === \"view\" && (\n <span className=\"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\">\n view\n </span>\n )}\n </div>\n\n <div className=\"ml-auto flex items-center gap-1.5\">\n <ToolbarButton\n icon={<IconRefresh className=\"h-3.5 w-3.5\" />}\n label=\"Refresh\"\n onClick={() => {\n rowsState.refetch();\n schemaState.refetch();\n }}\n />\n {!noPk && schema.type === \"table\" && (\n <ToolbarButton\n icon={<IconPlus className=\"h-3.5 w-3.5\" />}\n label=\"Insert\"\n onClick={() => setPanel({ mode: \"insert\" })}\n primary\n />\n )}\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"flex items-center gap-2\">\n <IconFilter className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <FilterBar\n columns={schema.columns}\n filters={filters}\n onChange={(f) => {\n setFilters(f);\n setPage(1);\n }}\n />\n </div>\n\n {/* No-PK warning */}\n {noPk && schema.type === \"table\" && (\n <div className=\"flex items-center gap-1.5 rounded-md bg-amber-500/10 px-2 py-1 text-[11px] text-amber-600 dark:text-amber-400\">\n <IconKeyOff className=\"h-3.5 w-3.5\" />\n This table has no primary key — editing and row deletion are\n disabled.\n </div>\n )}\n\n {/* Selection / changeset bar */}\n {(selectedPks.size > 0 || changeset.isDirty) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {selectedPks.size > 0 && (\n <>\n <span className=\"text-xs text-muted-foreground\">\n {selectedPks.size} selected\n </span>\n {!noPk && (\n <button\n type=\"button\"\n onClick={onBulkDelete}\n className=\"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-destructive hover:bg-destructive/10\"\n >\n <IconTrash className=\"h-3.5 w-3.5\" />\n Delete selected\n </button>\n )}\n <span className=\"h-4 w-px bg-border\" />\n </>\n )}\n\n {changeset.isDirty && (\n <>\n <span className=\"inline-flex items-center gap-1 rounded-md bg-amber-500/15 px-2 py-1 text-xs font-medium text-amber-600 dark:text-amber-400\">\n {changeset.pendingCount} pending change\n {changeset.pendingCount === 1 ? \"\" : \"s\"}\n </span>\n <button\n type=\"button\"\n onClick={changeset.discardAll}\n className=\"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground\"\n >\n <IconArrowBackUp className=\"h-3.5 w-3.5\" />\n Discard\n </button>\n <PreviewSqlButton\n onPreview={handlePreview}\n sql={previewSql}\n onClear={() => setPreviewSql(null)}\n error={commitError}\n />\n <button\n type=\"button\"\n onClick={() => void handleCommit()}\n disabled={committing}\n className=\"inline-flex items-center gap-1 rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-60\"\n >\n {committing ? (\n <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <IconDeviceFloppy className=\"h-3.5 w-3.5\" />\n )}\n Commit\n </button>\n </>\n )}\n </div>\n )}\n\n {commitError && !previewSql && (\n <div className=\"flex items-center gap-1.5 rounded-md bg-destructive/10 px-2 py-1 text-[11px] text-destructive\">\n <IconAlertTriangle className=\"h-3.5 w-3.5\" />\n {commitError}\n </div>\n )}\n </div>\n\n {/* Grid */}\n <DataGrid\n schema={schema}\n rows={gridRows}\n isLoading={rowsState.isLoading}\n pageSize={pageSize}\n sort={sort}\n onSortChange={(s) => {\n setSort(s);\n setPage(1);\n }}\n selectedPks={selectedPks}\n onSelectionChange={setSelectedPks}\n columnWidths={columnWidths}\n onColumnWidthsChange={setColumnWidths}\n active={active}\n onActiveChange={setActive}\n editable={!noPk && schema.type === \"table\"}\n onCellCommit={onCellCommit}\n isCellDirty={isCellDirty}\n onToggleDelete={onToggleDelete}\n onNavigateToRow={onFkNavigate}\n />\n\n {/* Pagination footer */}\n <div className=\"flex items-center justify-between border-t border-border px-3 py-1.5 text-xs text-muted-foreground\">\n <div className=\"flex items-center gap-2\">\n <span>Rows per page</span>\n <select\n value={pageSize}\n onChange={(e) => {\n setPageSize(Number(e.target.value));\n setPage(1);\n }}\n className=\"h-6 rounded border border-border bg-background px-1 text-xs outline-none focus:ring-1 focus:ring-ring\"\n >\n {PAGE_SIZES.map((s) => (\n <option key={s} value={s}>\n {s}\n </option>\n ))}\n </select>\n </div>\n\n <div className=\"flex items-center gap-1\">\n <span className=\"mr-2\">\n Page {page} of {totalPages}\n </span>\n <PagerButton\n disabled={page <= 1}\n onClick={() => setPage(1)}\n icon={<IconChevronsLeft className=\"h-3.5 w-3.5\" />}\n />\n <PagerButton\n disabled={page <= 1}\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n icon={<IconChevronLeft className=\"h-3.5 w-3.5\" />}\n />\n <PagerButton\n disabled={page >= totalPages}\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n icon={<IconChevronRight className=\"h-3.5 w-3.5\" />}\n />\n <PagerButton\n disabled={page >= totalPages}\n onClick={() => setPage(totalPages)}\n icon={<IconChevronsRight className=\"h-3.5 w-3.5\" />}\n />\n </div>\n </div>\n\n {/* Row side panel */}\n {panel && (\n <RowSidePanel\n schema={schema}\n mode={panel.mode}\n row={panel.pk ? originalRows.get(panel.pk) : undefined}\n staged={panel.pk ? changeset.edits.get(panel.pk) : undefined}\n onClose={() => setPanel(null)}\n onSave={(values) => {\n if (panel.mode === \"insert\") {\n changeset.addRow(values);\n } else if (panel.pk) {\n changeset.setCells(panel.pk, values);\n }\n }}\n />\n )}\n\n {/* Destructive commit confirmation */}\n {confirmDelete && (\n <ConfirmModal\n title=\"Commit deletions?\"\n body={`${changeset.deletedKeys.size} row${\n changeset.deletedKeys.size === 1 ? \"\" : \"s\"\n } will be permanently deleted along with any other pending changes. This cannot be undone.`}\n confirmLabel=\"Delete and commit\"\n destructive\n onCancel={() => setConfirmDelete(false)}\n onConfirm={() => void handleCommit()}\n />\n )}\n\n {/* Toast */}\n {toast &&\n typeof document !== \"undefined\" &&\n createPortal(\n <div className=\"fixed bottom-4 right-4 z-[500] flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2 text-xs text-foreground shadow-lg\">\n <IconCheck className=\"h-4 w-4 text-emerald-500\" />\n {toast}\n </div>,\n document.body,\n )}\n </div>\n );\n}\n\n// ─── Small UI atoms ────────────────────────────────────────────────────────\n\nfunction ToolbarButton({\n icon,\n label,\n onClick,\n primary,\n}: {\n icon: React.ReactNode;\n label: string;\n onClick: () => void;\n primary?: boolean;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(\n \"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs\",\n primary\n ? \"bg-primary text-primary-foreground hover:bg-primary/90\"\n : \"border border-border text-muted-foreground hover:text-foreground\",\n )}\n >\n {icon}\n {label}\n </button>\n );\n}\n\nfunction PagerButton({\n disabled,\n onClick,\n icon,\n}: {\n disabled: boolean;\n onClick: () => void;\n icon: React.ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n disabled={disabled}\n onClick={onClick}\n className=\"rounded border border-border p-1 text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n {icon}\n </button>\n );\n}\n\nfunction PreviewSqlButton({\n onPreview,\n sql,\n onClear,\n error,\n}: {\n onPreview: () => void;\n sql: string[] | null;\n onClear: () => void;\n error: string | null;\n}) {\n return (\n <Popover\n open={sql !== null}\n onOpenChange={(o) => {\n if (!o) onClear();\n }}\n >\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n onClick={onPreview}\n className=\"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground\"\n >\n <IconCode className=\"h-3.5 w-3.5\" />\n Preview SQL\n </button>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-[34rem] p-0\">\n <div className=\"border-b border-border px-3 py-2 text-xs font-medium text-foreground\">\n Preview SQL\n </div>\n <div className=\"max-h-80 overflow-auto p-3\">\n {error ? (\n <div className=\"text-xs text-destructive\">{error}</div>\n ) : sql && sql.length > 0 ? (\n <pre className=\"whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed text-foreground\">\n {sql.join(\";\\n\")}\n </pre>\n ) : (\n <div className=\"text-xs text-muted-foreground\">\n No statements to run.\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction ConfirmModal({\n title,\n body,\n confirmLabel,\n destructive,\n onCancel,\n onConfirm,\n}: {\n title: string;\n body: string;\n confirmLabel: string;\n destructive?: boolean;\n onCancel: () => void;\n onConfirm: () => void;\n}) {\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onCancel();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [onCancel]);\n\n if (typeof document === \"undefined\") return null;\n return createPortal(\n <div className=\"fixed inset-0 z-[450] flex items-center justify-center\">\n <div className=\"absolute inset-0 bg-black/40\" onClick={onCancel} />\n <div className=\"relative w-full max-w-sm rounded-lg border border-border bg-card p-4 shadow-xl\">\n <div className=\"mb-1 flex items-center gap-2\">\n {destructive && (\n <IconAlertTriangle className=\"h-4 w-4 text-destructive\" />\n )}\n <h2 className=\"text-sm font-semibold text-foreground\">{title}</h2>\n </div>\n <p className=\"mb-4 text-xs text-muted-foreground\">{body}</p>\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={onConfirm}\n className={cn(\n \"rounded-md px-3 py-1.5 text-xs font-medium text-primary-foreground\",\n destructive\n ? \"bg-destructive hover:bg-destructive/90\"\n : \"bg-primary hover:bg-primary/90\",\n )}\n >\n {confirmLabel}\n </button>\n </div>\n </div>\n </div>,\n document.body,\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TableEditor.js","sourceRoot":"","sources":["../../../src/client/db-admin/TableEdit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p,\n IconDeviceFloppy,\n IconChevronLeft,\n IconChevronRight,\n IconChevronsLeft,\n IconChevronsRight,\n IconLoader2,\n IconCheck,\n IconKeyOff,\n} from \"@tabler/icons-react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport type {\n DbAdminDialect,\n DbAdminFilter,\n DbAdminForeignKey,\n DbAdminSort,\n DbAdminMutationResult,\n} from \"../../db-admin/types.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport { cn } from \"../utils.js\";\nimport { useChangeset, pkStringFor } from \"./changeset.js\";\nimport { DataGrid, type GridRow, type ActiveCell } from \"./DataGrid.js\";\nimport { FilterBar } from \"./FilterBar.js\";\nimport { RowSidePanel, type RowSidePanelMode } from \"./RowSidePanel.js\";\nimport { loadGridState, saveGridState } from \"./storage.js\";\nimport {\n useTableSchema,\n useTableRows,\n mutateTable,\n type DbAdminRequestConfig,\n} from \"./useDbAdmin.js\";\n\nexport interface TableEditorProps {\n table: string;\n dialect: DbAdminDialect;\n requestConfig?: DbAdminRequestConfig;\n initialFilters?: DbAdminFilter[];\n onNavigateToRow: (table: string, filters: DbAdminFilter[]) => void;\n}\n\nconst DEFAULT_PAGE_SIZE = 100;\nconst PAGE_SIZES = [25, 50, 100, 250, 500];\n\nexport function TableEditor({\n table,\n dialect: _dialect,\n requestConfig,\n initialFilters,\n onNavigateToRow,\n}: TableEditorProps) {\n // ─── Persisted view state ──────────────────────────────────────────────\n const persisted = useMemo(() => loadGridState(table), [table]);\n\n const [page, setPage] = useState(1);\n const [pageSize, setPageSize] = useState(\n persisted.pageSize ?? DEFAULT_PAGE_SIZE,\n );\n const [sort, setSort] = useState<DbAdminSort[]>(persisted.sort ?? []);\n const [filters, setFilters] = useState<DbAdminFilter[]>(\n initialFilters ?? persisted.filters ?? [],\n );\n const [columnWidths, setColumnWidths] = useState<Record<string, number>>(\n persisted.columnWidths ?? {},\n );\n const [selectedPks, setSelectedPks] = useState<Set<string>>(new Set());\n const [active, setActive] = useState<ActiveCell | null>(null);\n\n // Reset transient state when switching tables.\n useEffect(() => {\n const p = loadGridState(table);\n setPage(1);\n setPageSize(p.pageSize ?? DEFAULT_PAGE_SIZE);\n setSort(p.sort ?? []);\n setFilters(initialFilters ?? p.filters ?? []);\n setColumnWidths(p.columnWidths ?? {});\n setSelectedPks(new Set());\n setActive(null);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [table]);\n\n // Persist view state.\n useEffect(() => {\n saveGridState(table, { columnWidths, sort, filters, pageSize });\n }, [table, columnWidths, sort, filters, pageSize]);\n\n // ─── Data ────────────────────────────────────────────────────────────────\n const schemaState = useTableSchema(table, requestConfig);\n const rowsReq = useMemo(\n () => ({ page, pageSize, sort, filters }),\n [page, pageSize, sort, filters],\n );\n const rowsState = useTableRows(table, rowsReq, requestConfig);\n\n const schema = schemaState.data;\n const changeset = useChangeset(schema);\n\n // ─── Toolbar UI state ──────────────────────────────────────────────────\n const [panel, setPanel] = useState<{\n mode: RowSidePanelMode;\n pk?: string;\n } | null>(null);\n const [confirmDelete, setConfirmDelete] = useState(false);\n const [previewSql, setPreviewSql] = useState<string[] | null>(null);\n const [committing, setCommitting] = useState(false);\n const [commitError, setCommitError] = useState<string | null>(null);\n const [toast, setToast] = useState<string | null>(null);\n\n const showToast = useCallback((msg: string) => {\n setToast(msg);\n window.setTimeout(() => setToast(null), 2500);\n }, []);\n\n // ─── Original rows map (pk → fetched row) ──────────────────────────────\n const originalRows = useMemo(() => {\n const map = new Map<string, Record<string, unknown>>();\n for (const row of rowsState.data?.rows ?? []) {\n map.set(pkStringFor(schema, row), row);\n }\n return map;\n }, [rowsState.data, schema]);\n\n // ─── Build grid rows with staged edits applied ──────────────────────────\n const gridRows = useMemo<GridRow[]>(() => {\n const out: GridRow[] = [];\n // New rows first (top of grid, like Supabase).\n for (const nr of changeset.newRows) {\n out.push({\n pk: `new:${nr._localId}`,\n localId: nr._localId,\n isNew: true,\n values: { ...nr.values },\n });\n }\n for (const row of rowsState.data?.rows ?? []) {\n const pk = pkStringFor(schema, row);\n const staged = changeset.edits.get(pk);\n out.push({\n pk,\n values: staged ? { ...row, ...staged } : row,\n isDeleted: changeset.deletedKeys.has(pk),\n });\n }\n return out;\n }, [\n rowsState.data,\n schema,\n changeset.newRows,\n changeset.edits,\n changeset.deletedKeys,\n ]);\n\n // ─── Cell commit routing (existing rows vs new rows) ────────────────────\n const onCellCommit = useCallback(\n (row: GridRow, col: string, value: unknown) => {\n if (row.isNew && row.localId) {\n changeset.setNewRowCell(row.localId, col, value);\n } else {\n changeset.setCell(row.pk, col, value);\n }\n },\n [changeset],\n );\n\n const isCellDirty = useCallback(\n (row: GridRow, col: string) => {\n if (row.isNew) return true;\n return changeset.isCellDirty(row.pk, col);\n },\n [changeset],\n );\n\n const onToggleDelete = useCallback(\n (row: GridRow) => {\n if (row.isNew && row.localId) {\n changeset.removeNewRow(row.localId);\n return;\n }\n changeset.deleteRows([row.pk]);\n },\n [changeset],\n );\n\n // ─── FK navigation ───────────────────────────────────────────────────────\n const onFkNavigate = useCallback(\n (fk: DbAdminForeignKey, value: unknown) => {\n onNavigateToRow(fk.refTable, [{ column: fk.refColumn, op: \"eq\", value }]);\n },\n [onNavigateToRow],\n );\n\n // ─── Commit / preview ──────────────────────────────────────────────────\n const runCommit = useCallback(\n async (dryRun: boolean) => {\n const mutation = changeset.buildMutation(originalRows, dryRun);\n if (!mutation.inserts && !mutation.updates && !mutation.deletes) {\n return null;\n }\n return mutateTable(table, mutation, requestConfig);\n },\n [changeset, originalRows, requestConfig, table],\n );\n\n const handlePreview = useCallback(async () => {\n setCommitError(null);\n try {\n const res = await runCommit(true);\n setPreviewSql(res ? res.sql : []);\n } catch (err) {\n setCommitError(err instanceof Error ? err.message : String(err));\n }\n }, [runCommit]);\n\n const handleCommit = useCallback(async () => {\n const hasDeletes = changeset.deletedKeys.size > 0;\n if (hasDeletes && !confirmDelete) {\n setConfirmDelete(true);\n return;\n }\n setCommitting(true);\n setCommitError(null);\n try {\n const res: DbAdminMutationResult | null = await runCommit(false);\n changeset.discardAll();\n setSelectedPks(new Set());\n setConfirmDelete(false);\n rowsState.refetch();\n schemaState.refetch();\n if (res) {\n const parts: string[] = [];\n if (res.inserted) parts.push(`${res.inserted} inserted`);\n if (res.updated) parts.push(`${res.updated} updated`);\n if (res.deleted) parts.push(`${res.deleted} deleted`);\n showToast(parts.length ? parts.join(\", \") : \"No changes\");\n }\n } catch (err) {\n setCommitError(err instanceof Error ? err.message : String(err));\n } finally {\n setCommitting(false);\n }\n }, [changeset, confirmDelete, runCommit, rowsState, schemaState, showToast]);\n\n // ─── Cmd/Ctrl+S to commit ──────────────────────────────────────────────\n const commitRef = useRef(handleCommit);\n commitRef.current = handleCommit;\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (\n (e.metaKey || e.ctrlKey) &&\n typeof e.key === \"string\" &&\n e.key.toLowerCase() === \"s\"\n ) {\n e.preventDefault();\n if (changeset.isDirty) void commitRef.current();\n }\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [changeset.isDirty]);\n\n // ─── Bulk delete from selection ────────────────────────────────────────\n const onBulkDelete = useCallback(() => {\n const pks = [...selectedPks].filter((pk) => !pk.startsWith(\"new:\"));\n changeset.deleteRows(pks);\n setSelectedPks(new Set());\n }, [selectedPks, changeset]);\n\n // ─── Render ──────────────────────────────────────────────────────────────\n const total = rowsState.data?.total ?? schema?.rowCount ?? 0;\n const totalPages = Math.max(1, Math.ceil(total / pageSize));\n\n if (schemaState.error) {\n return (\n <div className=\"flex h-full items-center justify-center p-8 text-sm text-destructive\">\n <IconAlertTriangle className=\"mr-2 h-4 w-4\" />\n {schemaState.error.message}\n </div>\n );\n }\n\n if (!schema) {\n return (\n <div className=\"flex h-full items-center justify-center p-8 text-sm text-muted-foreground\">\n <IconLoader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n Loading {table}…\n </div>\n );\n }\n\n const noPk = schema.primaryKey.length === 0;\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {/* Toolbar */}\n <div className=\"flex flex-col gap-2 border-b border-border px-3 py-2\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-sm font-semibold text-foreground\">\n {table}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {total.toLocaleString()} rows\n </span>\n {schema.type === \"view\" && (\n <span className=\"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\">\n view\n </span>\n )}\n </div>\n\n <div className=\"ml-auto flex items-center gap-1.5\">\n <ToolbarButton\n icon={<IconRefresh className=\"h-3.5 w-3.5\" />}\n label=\"Refresh\"\n onClick={() => {\n rowsState.refetch();\n schemaState.refetch();\n }}\n />\n {!noPk && schema.type === \"table\" && (\n <ToolbarButton\n icon={<IconPlus className=\"h-3.5 w-3.5\" />}\n label=\"Insert\"\n onClick={() => setPanel({ mode: \"insert\" })}\n primary\n />\n )}\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"flex items-center gap-2\">\n <IconFilter className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <FilterBar\n columns={schema.columns}\n filters={filters}\n onChange={(f) => {\n setFilters(f);\n setPage(1);\n }}\n />\n </div>\n\n {/* No-PK warning */}\n {noPk && schema.type === \"table\" && (\n <div className=\"flex items-center gap-1.5 rounded-md bg-amber-500/10 px-2 py-1 text-[11px] text-amber-600 dark:text-amber-400\">\n <IconKeyOff className=\"h-3.5 w-3.5\" />\n This table has no primary key — editing and row deletion are\n disabled.\n </div>\n )}\n\n {/* Selection / changeset bar */}\n {(selectedPks.size > 0 || changeset.isDirty) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {selectedPks.size > 0 && (\n <>\n <span className=\"text-xs text-muted-foreground\">\n {selectedPks.size} selected\n </span>\n {!noPk && (\n <button\n type=\"button\"\n onClick={onBulkDelete}\n className=\"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-destructive hover:bg-destructive/10\"\n >\n <IconTrash className=\"h-3.5 w-3.5\" />\n Delete selected\n </button>\n )}\n <span className=\"h-4 w-px bg-border\" />\n </>\n )}\n\n {changeset.isDirty && (\n <>\n <span className=\"inline-flex items-center gap-1 rounded-md bg-amber-500/15 px-2 py-1 text-xs font-medium text-amber-600 dark:text-amber-400\">\n {changeset.pendingCount} pending change\n {changeset.pendingCount === 1 ? \"\" : \"s\"}\n </span>\n <button\n type=\"button\"\n onClick={changeset.discardAll}\n className=\"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground\"\n >\n <IconArrowBackUp className=\"h-3.5 w-3.5\" />\n Discard\n </button>\n <PreviewSqlButton\n onPreview={handlePreview}\n sql={previewSql}\n onClear={() => setPreviewSql(null)}\n error={commitError}\n />\n <button\n type=\"button\"\n onClick={() => void handleCommit()}\n disabled={committing}\n className=\"inline-flex items-center gap-1 rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-60\"\n >\n {committing ? (\n <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <IconDeviceFloppy className=\"h-3.5 w-3.5\" />\n )}\n Commit\n </button>\n </>\n )}\n </div>\n )}\n\n {commitError && !previewSql && (\n <div className=\"flex items-center gap-1.5 rounded-md bg-destructive/10 px-2 py-1 text-[11px] text-destructive\">\n <IconAlertTriangle className=\"h-3.5 w-3.5\" />\n {commitError}\n </div>\n )}\n </div>\n\n {/* Grid */}\n <DataGrid\n schema={schema}\n rows={gridRows}\n isLoading={rowsState.isLoading}\n pageSize={pageSize}\n sort={sort}\n onSortChange={(s) => {\n setSort(s);\n setPage(1);\n }}\n selectedPks={selectedPks}\n onSelectionChange={setSelectedPks}\n columnWidths={columnWidths}\n onColumnWidthsChange={setColumnWidths}\n active={active}\n onActiveChange={setActive}\n editable={!noPk && schema.type === \"table\"}\n onCellCommit={onCellCommit}\n isCellDirty={isCellDirty}\n onToggleDelete={onToggleDelete}\n onNavigateToRow={onFkNavigate}\n />\n\n {/* Pagination footer */}\n <div className=\"flex items-center justify-between border-t border-border px-3 py-1.5 text-xs text-muted-foreground\">\n <div className=\"flex items-center gap-2\">\n <span>Rows per page</span>\n <select\n value={pageSize}\n onChange={(e) => {\n setPageSize(Number(e.target.value));\n setPage(1);\n }}\n className=\"h-6 rounded border border-border bg-background px-1 text-xs outline-none focus:ring-1 focus:ring-ring\"\n >\n {PAGE_SIZES.map((s) => (\n <option key={s} value={s}>\n {s}\n </option>\n ))}\n </select>\n </div>\n\n <div className=\"flex items-center gap-1\">\n <span className=\"mr-2\">\n Page {page} of {totalPages}\n </span>\n <PagerButton\n disabled={page <= 1}\n onClick={() => setPage(1)}\n icon={<IconChevronsLeft className=\"h-3.5 w-3.5\" />}\n />\n <PagerButton\n disabled={page <= 1}\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n icon={<IconChevronLeft className=\"h-3.5 w-3.5\" />}\n />\n <PagerButton\n disabled={page >= totalPages}\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n icon={<IconChevronRight className=\"h-3.5 w-3.5\" />}\n />\n <PagerButton\n disabled={page >= totalPages}\n onClick={() => setPage(totalPages)}\n icon={<IconChevronsRight className=\"h-3.5 w-3.5\" />}\n />\n </div>\n </div>\n\n {/* Row side panel */}\n {panel && (\n <RowSidePanel\n schema={schema}\n mode={panel.mode}\n row={panel.pk ? originalRows.get(panel.pk) : undefined}\n staged={panel.pk ? changeset.edits.get(panel.pk) : undefined}\n onClose={() => setPanel(null)}\n onSave={(values) => {\n if (panel.mode === \"insert\") {\n changeset.addRow(values);\n } else if (panel.pk) {\n changeset.setCells(panel.pk, values);\n }\n }}\n />\n )}\n\n {/* Destructive commit confirmation */}\n {confirmDelete && (\n <ConfirmModal\n title=\"Commit deletions?\"\n body={`${changeset.deletedKeys.size} row${\n changeset.deletedKeys.size === 1 ? \"\" : \"s\"\n } will be permanently deleted along with any other pending changes. This cannot be undone.`}\n confirmLabel=\"Delete and commit\"\n destructive\n onCancel={() => setConfirmDelete(false)}\n onConfirm={() => void handleCommit()}\n />\n )}\n\n {/* Toast */}\n {toast &&\n typeof document !== \"undefined\" &&\n createPortal(\n <div className=\"fixed bottom-4 right-4 z-[500] flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2 text-xs text-foreground shadow-lg\">\n <IconCheck className=\"h-4 w-4 text-emerald-500\" />\n {toast}\n </div>,\n document.body,\n )}\n </div>\n );\n}\n\n// ─── Small UI atoms ────────────────────────────────────────────────────────\n\nfunction ToolbarButton({\n icon,\n label,\n onClick,\n primary,\n}: {\n icon: React.ReactNode;\n label: string;\n onClick: () => void;\n primary?: boolean;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(\n \"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs\",\n primary\n ? \"bg-primary text-primary-foreground hover:bg-primary/90\"\n : \"border border-border text-muted-foreground hover:text-foreground\",\n )}\n >\n {icon}\n {label}\n </button>\n );\n}\n\nfunction PagerButton({\n disabled,\n onClick,\n icon,\n}: {\n disabled: boolean;\n onClick: () => void;\n icon: React.ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n disabled={disabled}\n onClick={onClick}\n className=\"rounded border border-border p-1 text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n {icon}\n </button>\n );\n}\n\nfunction PreviewSqlButton({\n onPreview,\n sql,\n onClear,\n error,\n}: {\n onPreview: () => void;\n sql: string[] | null;\n onClear: () => void;\n error: string | null;\n}) {\n return (\n <Popover\n open={sql !== null}\n onOpenChange={(o) => {\n if (!o) onClear();\n }}\n >\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n onClick={onPreview}\n className=\"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground\"\n >\n <IconCode className=\"h-3.5 w-3.5\" />\n Preview SQL\n </button>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-[34rem] p-0\">\n <div className=\"border-b border-border px-3 py-2 text-xs font-medium text-foreground\">\n Preview SQL\n </div>\n <div className=\"max-h-80 overflow-auto p-3\">\n {error ? (\n <div className=\"text-xs text-destructive\">{error}</div>\n ) : sql && sql.length > 0 ? (\n <pre className=\"whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed text-foreground\">\n {sql.join(\";\\n\")}\n </pre>\n ) : (\n <div className=\"text-xs text-muted-foreground\">\n No statements to run.\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction ConfirmModal({\n title,\n body,\n confirmLabel,\n destructive,\n onCancel,\n onConfirm,\n}: {\n title: string;\n body: string;\n confirmLabel: string;\n destructive?: boolean;\n onCancel: () => void;\n onConfirm: () => void;\n}) {\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onCancel();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [onCancel]);\n\n if (typeof document === \"undefined\") return null;\n return createPortal(\n <div className=\"fixed inset-0 z-[450] flex items-center justify-center\">\n <div className=\"absolute inset-0 bg-black/40\" onClick={onCancel} />\n <div className=\"relative w-full max-w-sm rounded-lg border border-border bg-card p-4 shadow-xl\">\n <div className=\"mb-1 flex items-center gap-2\">\n {destructive && (\n <IconAlertTriangle className=\"h-4 w-4 text-destructive\" />\n )}\n <h2 className=\"text-sm font-semibold text-foreground\">{title}</h2>\n </div>\n <p className=\"mb-4 text-xs text-muted-foreground\">{body}</p>\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={onConfirm}\n className={cn(\n \"rounded-md px-3 py-1.5 text-xs font-medium text-primary-foreground\",\n destructive\n ? \"bg-destructive hover:bg-destructive/90\"\n : \"bg-primary hover:bg-primary/90\",\n )}\n >\n {confirmLabel}\n </button>\n </div>\n </div>\n </div>,\n document.body,\n );\n}\n"]}
|
|
@@ -6,17 +6,18 @@ export interface DbAdminNavigationState {
|
|
|
6
6
|
export interface UseDbAdminAgentSyncArgs {
|
|
7
7
|
table: string | null;
|
|
8
8
|
mode: "table" | "sql";
|
|
9
|
+
enabled?: boolean;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Write the current database-admin view to application state whenever the
|
|
12
13
|
* selected table or mode changes, so the agent always knows what the user is
|
|
13
14
|
* looking at.
|
|
14
15
|
*/
|
|
15
|
-
export declare function useDbAdminAgentSync({ table, mode, }: UseDbAdminAgentSyncArgs): void;
|
|
16
|
+
export declare function useDbAdminAgentSync({ table, mode, enabled, }: UseDbAdminAgentSyncArgs): void;
|
|
16
17
|
/**
|
|
17
18
|
* Poll the one-shot `navigate` app-state key. When the agent requests a jump to
|
|
18
19
|
* a database table, invoke `onNavigate(table)` then clear the key so it does
|
|
19
20
|
* not replay on the next poll.
|
|
20
21
|
*/
|
|
21
|
-
export declare function useNavigateConsumer(onNavigate: (table: string) => void): void;
|
|
22
|
+
export declare function useNavigateConsumer(onNavigate: (table: string) => void, enabled?: boolean): void;
|
|
22
23
|
//# sourceMappingURL=useAgentSync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgentSync.d.ts","sourceRoot":"","sources":["../../../src/client/db-admin/useAgentSync.ts"],"names":[],"mappings":"AAyDA,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"useAgentSync.d.ts","sourceRoot":"","sources":["../../../src/client/db-admin/useAgentSync.ts"],"names":[],"mappings":"AAyDA,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,IAAI,EACJ,OAAc,GACf,EAAE,uBAAuB,GAAG,IAAI,CAYhC;AAOD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACnC,OAAO,UAAO,GACb,IAAI,CAgDN"}
|
|
@@ -52,8 +52,10 @@ function headers(extra) {
|
|
|
52
52
|
* selected table or mode changes, so the agent always knows what the user is
|
|
53
53
|
* looking at.
|
|
54
54
|
*/
|
|
55
|
-
export function useDbAdminAgentSync({ table, mode, }) {
|
|
55
|
+
export function useDbAdminAgentSync({ table, mode, enabled = true, }) {
|
|
56
56
|
useEffect(() => {
|
|
57
|
+
if (!enabled)
|
|
58
|
+
return;
|
|
57
59
|
const state = { view: "database", table, mode };
|
|
58
60
|
fetch(NAVIGATION_PATH, {
|
|
59
61
|
method: "PUT",
|
|
@@ -62,17 +64,19 @@ export function useDbAdminAgentSync({ table, mode, }) {
|
|
|
62
64
|
headers: headers({ "Content-Type": "application/json" }),
|
|
63
65
|
body: JSON.stringify(state),
|
|
64
66
|
}).catch(() => { });
|
|
65
|
-
}, [table, mode]);
|
|
67
|
+
}, [enabled, table, mode]);
|
|
66
68
|
}
|
|
67
69
|
/**
|
|
68
70
|
* Poll the one-shot `navigate` app-state key. When the agent requests a jump to
|
|
69
71
|
* a database table, invoke `onNavigate(table)` then clear the key so it does
|
|
70
72
|
* not replay on the next poll.
|
|
71
73
|
*/
|
|
72
|
-
export function useNavigateConsumer(onNavigate) {
|
|
74
|
+
export function useNavigateConsumer(onNavigate, enabled = true) {
|
|
73
75
|
const handlerRef = useRef(onNavigate);
|
|
74
76
|
handlerRef.current = onNavigate;
|
|
75
77
|
useEffect(() => {
|
|
78
|
+
if (!enabled)
|
|
79
|
+
return;
|
|
76
80
|
let active = true;
|
|
77
81
|
let timer;
|
|
78
82
|
const tick = async () => {
|
|
@@ -115,6 +119,6 @@ export function useNavigateConsumer(onNavigate) {
|
|
|
115
119
|
if (timer)
|
|
116
120
|
clearTimeout(timer);
|
|
117
121
|
};
|
|
118
|
-
}, []);
|
|
122
|
+
}, [enabled]);
|
|
119
123
|
}
|
|
120
124
|
//# sourceMappingURL=useAgentSync.js.map
|