@kortix/ui 0.15.11 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_vendor/kortix-shared.js +485 -187
- package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
- package/dist/_vendor/shared/session/attachment-tile.d.ts +8 -0
- package/dist/_vendor/shared/workspace-settings.d.ts +3 -0
- package/dist/access/access/copy-row.d.ts +7 -1
- package/dist/access/access/copy-row.js +2 -2
- package/dist/animated-copy-icon.js +2 -1
- package/dist/browser/sandbox-browser-chrome.d.ts +2 -1
- package/dist/browser/sandbox-browser-chrome.js +1 -1
- package/dist/customize/agents/agent-cover-card.d.ts +1 -1
- package/dist/customize/agents/agent-cover-card.js +10 -2
- package/dist/customize/agents/agent-filter.js +3 -1
- package/dist/customize/agents/agent-overview.d.ts +10 -0
- package/dist/customize/agents/agent-overview.js +5 -4
- package/dist/customize/agents/agent-page-chrome.d.ts +5 -6
- package/dist/customize/agents/agent-page-chrome.js +16 -13
- package/dist/customize/agents/agent-page.js +6 -28
- package/dist/customize/agents/agent-tabs.d.ts +1 -0
- package/dist/customize/agents/agent-tabs.js +1 -0
- package/dist/customize/agents/agents-page.js +3 -3
- package/dist/customize/agents/create-agent-modal.d.ts +9 -0
- package/dist/customize/agents/create-agent-modal.js +21 -3
- package/dist/customize/agents/use-default-agent.js +2 -2
- package/dist/customize/connectors/connector-identity.d.ts +11 -2
- package/dist/customize/connectors/connector-identity.js +16 -4
- package/dist/customize/connectors/connectors-page.js +10 -6
- package/dist/customize/connectors/detail/app-page.js +2 -2
- package/dist/customize/connectors/install/install-dialog.d.ts +2 -0
- package/dist/customize/connectors/install/install-dialog.js +6 -1
- package/dist/customize/connectors/use-agent-access.d.ts +1 -0
- package/dist/customize/evals/eval-compare-view.d.ts +10 -0
- package/dist/customize/evals/eval-compare-view.js +68 -0
- package/dist/customize/evals/eval-dataset-view.d.ts +20 -0
- package/dist/customize/evals/eval-dataset-view.js +81 -0
- package/dist/customize/evals/eval-datasets-page.d.ts +25 -0
- package/dist/customize/evals/eval-datasets-page.js +91 -0
- package/dist/customize/evals/eval-job-view.d.ts +12 -0
- package/dist/customize/evals/eval-job-view.js +360 -0
- package/dist/customize/evals/eval-jobs-page.d.ts +4 -0
- package/dist/customize/evals/eval-jobs-page.js +69 -0
- package/dist/customize/evals/eval-meta.d.ts +97 -0
- package/dist/customize/evals/eval-meta.js +228 -0
- package/dist/customize/evals/eval-task-view.d.ts +13 -0
- package/dist/customize/evals/eval-task-view.js +123 -0
- package/dist/customize/evals/eval-tasks-page.d.ts +8 -0
- package/dist/customize/evals/eval-tasks-page.js +56 -0
- package/dist/customize/evals/eval-ui.d.ts +97 -0
- package/dist/customize/evals/eval-ui.js +153 -0
- package/dist/customize/evals/evals-page.d.ts +10 -0
- package/dist/customize/evals/evals-page.js +56 -0
- package/dist/customize/evals/run-eval-modal.d.ts +28 -0
- package/dist/customize/evals/run-eval-modal.js +167 -0
- package/dist/customize/project-settings/project-admin-sections.d.ts +3 -2
- package/dist/customize/project-settings/project-admin-sections.js +6 -1
- package/dist/customize/providers/provider-connect.d.ts +13 -0
- package/dist/customize/providers/provider-connect.js +29 -5
- package/dist/customize/providers/provider-sheet.js +5 -4
- package/dist/customize/sections/view/gateway/gateway-overview.d.ts +5 -0
- package/dist/customize/sections/view/gateway/gateway-overview.js +32 -6
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +6 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +21 -13
- package/dist/customize/sections/view/git-view.d.ts +19 -1
- package/dist/customize/sections/view/git-view.js +7 -3
- package/dist/customize/sections/view/manifest-issue-list.d.ts +16 -0
- package/dist/customize/sections/view/manifest-issue-list.js +41 -0
- package/dist/customize/sections/view/manifest-issues-row.d.ts +24 -0
- package/dist/customize/sections/view/manifest-issues-row.js +39 -0
- package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +7 -1
- package/dist/customize/sections/view/sandbox-provider-coverage.js +7 -5
- package/dist/customize/sections/view/secrets-view.d.ts +13 -0
- package/dist/customize/sections/view/secrets-view.js +10 -6
- package/dist/customize/sections/view/subscription-usage.d.ts +2 -7
- package/dist/customize/sections/view/subscription-usage.js +4 -8
- package/dist/customize/settings/settings-tab-header.js +12 -3
- package/dist/customize/settings/tabs/experimental-tab.d.ts +16 -5
- package/dist/customize/settings/tabs/experimental-tab.js +36 -11
- package/dist/customize/settings/tabs/general-tab.js +1 -1
- package/dist/customize/settings/tabs/sandbox-tab.d.ts +10 -0
- package/dist/customize/settings/tabs/sandbox-tab.js +27 -4
- package/dist/customize/settings/tabs/snapshots-tab.d.ts +31 -0
- package/dist/customize/settings/tabs/snapshots-tab.js +61 -5
- package/dist/customize/settings/tabs/workspace-keys.js +6 -3
- package/dist/customize/shared/capability-page-shell.js +9 -1
- package/dist/customize/shared/catalog/catalog-card.d.ts +1 -1
- package/dist/customize/shared/catalog/catalog-card.js +15 -5
- package/dist/customize/shared/customize-tab-bar.js +1 -1
- package/dist/customize/shared/new-entity-menu.d.ts +1 -1
- package/dist/customize/shared/new-entity-menu.js +38 -1
- package/dist/customize/triggers/runtime-triggers.d.ts +4 -0
- package/dist/customize/triggers/runtime-triggers.js +21 -2
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule-view.js +2 -1
- package/dist/files/project/components/drive-explorer.js +33 -70
- package/dist/files/project/components/drive-grid-view.d.ts +2 -31
- package/dist/files/project/components/drive-grid-view.js +12 -22
- package/dist/files/project/components/drive-list-view.d.ts +3 -30
- package/dist/files/project/components/drive-list-view.js +8 -18
- package/dist/files/project/components/drive-selection-bar.d.ts +4 -5
- package/dist/files/project/components/drive-selection-bar.js +13 -20
- package/dist/files/project/components/explorer-listing.d.ts +48 -0
- package/dist/files/project/components/explorer-listing.js +64 -0
- package/dist/files/project/components/file-explorer-page.js +7 -204
- package/dist/files/project/components/file-thumbnail.js +3 -1
- package/dist/files/project/components/manifest-issue-mark.d.ts +9 -0
- package/dist/files/project/components/manifest-issue-mark.js +26 -0
- package/dist/files/project/hooks/use-change-requests.d.ts +10 -0
- package/dist/files/project/hooks/use-change-requests.js +17 -0
- package/dist/files/project/manifest-annotations.d.ts +16 -0
- package/dist/files/project/manifest-annotations.js +19 -0
- package/dist/files/project/store/version-store.d.ts +1 -1
- package/dist/files/project/upload-batch.d.ts +20 -0
- package/dist/files/project/upload-batch.js +20 -0
- package/dist/files/runtime/hooks/use-binary-blob.js +3 -2
- package/dist/files/runtime/hooks/use-file-content.js +3 -2
- package/dist/files/runtime/hooks/use-file-list.js +1 -2
- package/dist/files/runtime/hooks/use-file-mutations.js +69 -6
- package/dist/files/runtime/hooks/use-file-refresh.d.ts +4 -0
- package/dist/files/runtime/hooks/use-file-refresh.js +6 -0
- package/dist/files/tree/components/file-tree-item.js +1 -4
- package/dist/files/viewer/file-annotations.d.ts +18 -0
- package/dist/files/viewer/file-annotations.js +21 -0
- package/dist/files/viewer/file-content-renderer.js +1 -1
- package/dist/files/viewer/file-viewer.js +2 -1
- package/dist/files/viewer/index.d.ts +1 -0
- package/dist/files/viewer/index.js +1 -0
- package/dist/files/viewer/use-file-content-state.js +8 -1
- package/dist/i18n/en.d.ts +497 -46
- package/dist/i18n/en.js +538 -87
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -4
- package/dist/icons/caret-right-solid.d.ts +11 -0
- package/dist/icons/caret-right-solid.js +15 -0
- package/dist/internal/auth/auth-art.d.ts +12 -0
- package/dist/internal/auth/auth-art.js +118 -0
- package/dist/internal/auth/auth-card-shell.d.ts +14 -10
- package/dist/internal/auth/auth-card-shell.js +20 -31
- package/dist/internal/auth/auth-consent.d.ts +3 -1
- package/dist/internal/auth/auth-consent.js +2 -2
- package/dist/internal/auth/auth-primitives.d.ts +26 -1
- package/dist/internal/auth/auth-primitives.js +37 -8
- package/dist/internal/connector-logo/connector-logo.d.ts +2 -1
- package/dist/internal/connector-logo/connector-logo.js +11 -2
- package/dist/internal/files/file-read-retry.d.ts +18 -2
- package/dist/internal/files/file-read-retry.js +42 -4
- package/dist/internal/hooks/projects/use-new-project-session.js +5 -10
- package/dist/internal/hooks/use-auto-scroll-physics.d.ts +1 -1
- package/dist/internal/hooks/use-auto-scroll-physics.js +2 -10
- package/dist/internal/hooks/use-reduced-motion.d.ts +4 -0
- package/dist/internal/hooks/use-reduced-motion.js +12 -0
- package/dist/internal/hooks/use-save-shortcut.d.ts +8 -0
- package/dist/internal/hooks/use-save-shortcut.js +28 -0
- package/dist/internal/layout/connect-mcp-modal.d.ts +1 -1
- package/dist/internal/layout/connect-mcp-modal.js +9 -4
- package/dist/internal/layout/panel-chrome.d.ts +28 -0
- package/dist/internal/layout/panel-chrome.js +27 -0
- package/dist/internal/layout/project-page-header.js +5 -1
- package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
- package/dist/internal/lib/manifest-health.d.ts +25 -1
- package/dist/internal/lib/manifest-health.js +56 -0
- package/dist/internal/lib/project-preamble.js +1 -1
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +3 -0
- package/dist/internal/notifications/notification-inbox.js +2 -1
- package/dist/internal/notifications/notification-rows.d.ts +1 -1
- package/dist/internal/notifications/notification-rows.js +15 -1
- package/dist/internal/selection/selection-bar.d.ts +2 -8
- package/dist/internal/selection/selection-bar.js +15 -38
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +9 -1
- package/dist/internal/stores/user-preferences-store.js +2 -0
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.js +28 -1
- package/dist/lib/dotmatrix-hooks.d.ts +1 -0
- package/dist/lib/dotmatrix-hooks.js +3 -13
- package/dist/lib/reduced-motion.d.ts +10 -0
- package/dist/lib/reduced-motion.js +104 -0
- package/dist/lib/routes.d.ts +9 -0
- package/dist/lib/routes.js +7 -4
- package/dist/markdown/artifact-link.d.ts +11 -0
- package/dist/markdown/artifact-link.js +62 -0
- package/dist/markdown/code/index.d.ts +1 -1
- package/dist/markdown/code/index.js +1 -1
- package/dist/markdown/code/inline-code.d.ts +1 -1
- package/dist/markdown/code/inline-code.js +1 -1
- package/dist/markdown/genui/components/map-canvas.js +2 -1
- package/dist/markdown/index.d.ts +3 -1
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/{code/inline-chip.js → inline-chip.js} +2 -2
- package/dist/markdown/inline-code-text.d.ts +34 -0
- package/dist/markdown/inline-code-text.js +68 -0
- package/dist/markdown/setup-links/approval-decision.js +3 -3
- package/dist/markdown/soft-breaks.d.ts +21 -0
- package/dist/markdown/soft-breaks.js +33 -0
- package/dist/markdown/unified-markdown.d.ts +9 -1
- package/dist/markdown/unified-markdown.js +31 -9
- package/dist/primitives/action-bar.d.ts +50 -0
- package/dist/primitives/action-bar.js +87 -0
- package/dist/primitives/calendar.js +4 -2
- package/dist/primitives/inline-meta.js +2 -2
- package/dist/primitives/kortix-loader.js +2 -1
- package/dist/primitives/modal.d.ts +1 -1
- package/dist/primitives/paper-wallpaper-shaders.d.ts +1 -0
- package/dist/primitives/paper-wallpaper-shaders.js +6 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/primitives/resize-seam.d.ts +3 -2
- package/dist/primitives/resize-seam.js +4 -3
- package/dist/primitives/settings-section-header.d.ts +30 -1
- package/dist/primitives/settings-section-header.js +37 -0
- package/dist/primitives/sliding-tab-indicator.js +2 -1
- package/dist/primitives/switch.js +15 -8
- package/dist/primitives/text-shimmer.js +6 -0
- package/dist/primitives/toast-clearance.d.ts +52 -0
- package/dist/primitives/toast-clearance.js +116 -0
- package/dist/primitives/toast.d.ts +3 -1
- package/dist/primitives/toast.js +2 -0
- package/dist/primitives/typed-title.js +1 -1
- package/dist/primitives/wallpaper-shaders.js +1 -1
- package/dist/session/actions/project-session-list-helpers.d.ts +16 -0
- package/dist/session/actions/project-session-list-helpers.js +18 -0
- package/dist/session/agents/agent-model.d.ts +1 -0
- package/dist/session/agents/agent-model.js +2 -1
- package/dist/session/agents/agent-strip.js +10 -4
- package/dist/session/agents/workflow-run-controls.d.ts +27 -4
- package/dist/session/agents/workflow-run-controls.js +63 -10
- package/dist/session/composer/ComposerCard.js +3 -0
- package/dist/session/composer/agent-selector.js +6 -4
- package/dist/session/composer/animated-placeholder.js +2 -1
- package/dist/session/composer/attachment-tile.d.ts +2 -2
- package/dist/session/composer/attachment-tile.js +25 -3
- package/dist/session/composer/composer-agent-access.d.ts +10 -1
- package/dist/session/composer/composer-agent-access.js +18 -4
- package/dist/session/composer/composer-chat-input.js +7 -2
- package/dist/session/composer/composer.d.ts +2 -2
- package/dist/session/composer/composer.js +7 -6
- package/dist/session/composer/hooks/use-file-search.d.ts +12 -2
- package/dist/session/composer/hooks/use-file-search.js +71 -7
- package/dist/session/composer/menus/menu-items.js +6 -2
- package/dist/session/composer/menus/menu-shell.d.ts +3 -1
- package/dist/session/composer/menus/menu-shell.js +2 -2
- package/dist/session/composer/menus/slash-menu.d.ts +7 -0
- package/dist/session/composer/menus/slash-menu.js +48 -1
- package/dist/session/composer/use-instant-session-send.js +7 -1
- package/dist/session/header/session-reminders-indicator.js +3 -2
- package/dist/session/header/session-site-header.js +24 -6
- package/dist/session/media/sandbox-url-detector.js +1 -1
- package/dist/session/models/model-connection-gate.js +2 -1
- package/dist/session/models/model-selector.js +1 -1
- package/dist/session/models/subscription-switcher.d.ts +7 -0
- package/dist/session/models/subscription-switcher.js +52 -10
- package/dist/session/models/subscription-windows.d.ts +2 -0
- package/dist/session/models/subscription-windows.js +2 -0
- package/dist/session/outcomes/session-outcomes-provider.js +14 -7
- package/dist/session/panel/action-panel.js +8 -19
- package/dist/session/panel/easy/app-preview.d.ts +4 -1
- package/dist/session/panel/easy/app-preview.js +95 -33
- package/dist/session/panel/easy/apps-card.js +6 -11
- package/dist/session/panel/easy/change-requests-card.js +1 -1
- package/dist/session/panel/easy/changes-card.d.ts +14 -0
- package/dist/session/panel/easy/changes-card.js +60 -0
- package/dist/session/panel/easy/context-card.d.ts +5 -1
- package/dist/session/panel/easy/context-card.js +13 -28
- package/dist/session/panel/easy/context-meter.d.ts +18 -0
- package/dist/session/panel/easy/context-meter.js +73 -0
- package/dist/session/panel/easy/detail-view.d.ts +1 -1
- package/dist/session/panel/easy/detail-view.js +24 -21
- package/dist/session/panel/easy/easy-panel.js +7 -5
- package/dist/session/panel/easy/file-preview.js +3 -1
- package/dist/session/panel/easy/frame-history.d.ts +91 -0
- package/dist/session/panel/easy/frame-history.js +198 -0
- package/dist/session/panel/easy/outputs-card.d.ts +10 -0
- package/dist/session/panel/easy/outputs-card.js +28 -31
- package/dist/session/panel/easy/panel-card.d.ts +1 -3
- package/dist/session/panel/easy/panel-card.js +24 -8
- package/dist/session/panel/easy/plan-card.js +2 -2
- package/dist/session/panel/easy/step-icon.d.ts +4 -1
- package/dist/session/panel/easy/step-icon.js +2 -2
- package/dist/session/panel/session-action-panel-column.d.ts +5 -0
- package/dist/session/panel/session-action-panel-column.js +198 -101
- package/dist/session/panel/session-desktop.js +5 -1
- package/dist/session/panel/session-diff-viewer.d.ts +3 -1
- package/dist/session/panel/session-diff-viewer.js +7 -4
- package/dist/session/panel/session-panel-provider.js +29 -5
- package/dist/session/panel/shared/derive-panels.js +64 -4
- package/dist/session/status/session-busy-indicator.js +2 -1
- package/dist/session/status/session-error-banner.js +1 -1
- package/dist/session/thread/chat-minimap.js +2 -1
- package/dist/session/thread/session-body.js +4 -1
- package/dist/session/thread/session-chat.js +18 -3
- package/dist/session/thread/session-turn-meta-rows.d.ts +13 -5
- package/dist/session/thread/session-turn-meta-rows.js +33 -5
- package/dist/session/thread/transcript.d.ts +1 -2
- package/dist/session/thread/transcript.js +26 -24
- package/dist/session/thread/typing-indicator.d.ts +2 -2
- package/dist/session/thread/typing-indicator.js +10 -3
- package/dist/session/tool/tools/session-spawn-tool.js +3 -3
- package/dist/session/tool/tools/workflow-run-card.d.ts +11 -1
- package/dist/session/tool/tools/workflow-run-card.js +31 -7
- package/dist/session/tool/tools/workflow-run-cost.d.ts +29 -0
- package/dist/session/tool/tools/workflow-run-cost.js +75 -0
- package/dist/session/tool/tools/workflow-tool.d.ts +1 -1
- package/dist/session/tool/tools/workflow-tool.js +40 -15
- package/dist/session/turn/peer-message-row.js +1 -1
- package/dist/session/turn/queued-prompt-bubbles.d.ts +3 -2
- package/dist/session/turn/queued-prompt-bubbles.js +1 -1
- package/dist/session/turn/throttled-markdown.js +1 -1
- package/dist/styles/theme.css +68 -0
- package/dist/styles.css +1 -1
- package/dist/terminal/pty-terminal.js +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +2 -1
- package/dist/test-utils/intl.d.ts +497 -46
- package/dist/workspace/admin/project-admin-dashboard.js +21 -7
- package/dist/workspace/admin/settings-search-landing.js +2 -1
- package/dist/workspace/calendar/calendar-dates.d.ts +31 -0
- package/dist/workspace/calendar/calendar-dates.js +64 -0
- package/dist/workspace/calendar/calendar-new-item.d.ts +11 -0
- package/dist/workspace/calendar/calendar-new-item.js +47 -0
- package/dist/workspace/calendar/calendar-page.d.ts +3 -0
- package/dist/workspace/calendar/calendar-page.js +177 -0
- package/dist/workspace/calendar/calendar-panel.d.ts +13 -0
- package/dist/workspace/calendar/calendar-panel.js +103 -0
- package/dist/workspace/calendar/calendar-people.d.ts +52 -0
- package/dist/workspace/calendar/calendar-people.js +117 -0
- package/dist/workspace/calendar/calendar-scheduled.d.ts +29 -0
- package/dist/workspace/calendar/calendar-scheduled.js +118 -0
- package/dist/workspace/calendar/calendar-views.d.ts +32 -0
- package/dist/workspace/calendar/calendar-views.js +124 -0
- package/dist/workspace/calendar/calendar-when.d.ts +14 -0
- package/dist/workspace/calendar/calendar-when.js +81 -0
- package/dist/workspace/calendar/mention-textarea.d.ts +19 -0
- package/dist/workspace/calendar/mention-textarea.js +84 -0
- package/dist/workspace/home/access-requests-bell.js +2 -1
- package/dist/workspace/inbox/workspace-inbox.d.ts +1 -1
- package/dist/workspace/inbox/workspace-inbox.js +1 -1
- package/dist/workspace/layout/project-files-view.js +2 -1
- package/dist/workspace/layout/project-home.js +2 -1
- package/dist/workspace/memory/memory-page-list.js +1 -1
- package/dist/workspace/new/workspace-handoff.js +2 -1
- package/dist/workspace/projects/modal/project-icon-field.js +2 -1
- package/dist/workspace/session-workspace.js +13 -12
- package/dist/workspace/setup/setup-banner.d.ts +4 -0
- package/dist/workspace/setup/setup-banner.js +57 -0
- package/dist/workspace/setup/setup-steps.d.ts +57 -0
- package/dist/workspace/setup/setup-steps.js +53 -0
- package/dist/workspace/setup/use-setup-steps.d.ts +18 -0
- package/dist/workspace/setup/use-setup-steps.js +57 -0
- package/dist/workspace/setup/workspace-setup-page.d.ts +10 -0
- package/dist/workspace/setup/workspace-setup-page.js +91 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +5 -1
- package/dist/workspace/sidebar/footer/project-calendar-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-calendar-nav.js +31 -0
- package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +14 -6
- package/dist/workspace/sidebar/footer/project-chrome-nav.js +37 -25
- package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -9
- package/dist/workspace/sidebar/footer/project-computer-nav.js +36 -26
- package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-download-app-nav.js +25 -13
- package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-inbox-nav.js +29 -0
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +3 -13
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +6 -48
- package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-mcp-nav.js +31 -13
- package/dist/workspace/sidebar/footer/project-phone-app-nav.d.ts +10 -0
- package/dist/workspace/sidebar/footer/project-phone-app-nav.js +61 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +21 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.js +33 -0
- package/dist/workspace/sidebar/footer/promo-card.d.ts +41 -0
- package/dist/workspace/sidebar/footer/promo-card.js +47 -0
- package/dist/workspace/sidebar/footer/sandbox-health.js +1 -1
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +12 -4
- package/dist/workspace/sidebar/project-session-list.js +58 -26
- package/dist/workspace/sidebar/project-sidebar.js +2 -5
- package/dist/workspace/sidebar/project-spaces-nav.js +2 -1
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +24 -0
- package/dist/workspace/sidebar/session-brief-hover-card.js +4 -3
- package/dist/workspace/sidebar/session-group-sections.d.ts +26 -7
- package/dist/workspace/sidebar/session-group-sections.js +121 -41
- package/dist/workspace/sidebar/sidebar-drill.js +6 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +3 -2
- package/dist/workspace/sidebar/use-workspace-list.d.ts +7 -0
- package/dist/workspace/sidebar/use-workspace-list.js +11 -1
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +14 -0
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +46 -2
- package/dist/workspace/space/space-tab-panels.js +1 -1
- package/dist/workspace/spaces/space-timeline.js +2 -2
- package/package.json +67 -10
- package/skills/kortix-ui/SKILL.md +2 -2
- package/skills/kortix-ui/references/modules.md +5 -3
- package/dist/session/thread/turn-share.d.ts +0 -16
- package/dist/session/thread/turn-share.js +0 -161
- package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +0 -11
- package/dist/workspace/sidebar/footer/promo-nav-row.js +0 -7
- /package/dist/markdown/{code/inline-chip.d.ts → inline-chip.d.ts} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from 'react';
|
|
3
4
|
import { HoverPrefetchLink } from '../../../internal/components/hover-prefetch-link.js';
|
|
5
|
+
import { plainTextFromMarkdown, shortSummary } from '../../../markdown/inline-code-text.js';
|
|
4
6
|
import { Checkbox } from '../../../primitives/checkbox.js';
|
|
5
7
|
import { cn } from '../../../internal/lib/utils.js';
|
|
6
8
|
export function CatalogCard({ leading, title, description, badges, meta, subtitle, variant = 'default', trailing, trailingInteractive, href, onIntent, onClick, disabled, className, style, select, }) {
|
|
@@ -11,10 +13,18 @@ export function CatalogCard({ leading, title, description, badges, meta, subtitl
|
|
|
11
13
|
// toggle), so in select mode it is a SIBLING of the body button, never a
|
|
12
14
|
// child — a <button> inside a <button> is invalid HTML and a hydration error.
|
|
13
15
|
const trailingSlot = trailing ? _jsx("span", { className: "shrink-0", children: trailing }) : null;
|
|
14
|
-
|
|
16
|
+
// The control's name is the title alone; the summary is its description.
|
|
17
|
+
// Without these, the name is every word inside the card (a whole SKILL.md
|
|
18
|
+
// summary on each Tab stop).
|
|
19
|
+
const id = useId();
|
|
20
|
+
const titleId = `${id}-title`;
|
|
21
|
+
const descriptionId = `${id}-description`;
|
|
22
|
+
const summary = description ? plainTextFromMarkdown(description) : '';
|
|
23
|
+
const a11y = { 'aria-labelledby': titleId, 'aria-describedby': summary ? descriptionId : undefined };
|
|
24
|
+
const content = (_jsxs(_Fragment, { children: [leading ? _jsx("span", { className: "shrink-0", children: leading }) : null, _jsxs("span", { className: cn('min-w-0 flex-1', variant === 'plain' ? 'space-y-0' : 'space-y-1'), children: [_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { id: titleId, className: "text-foreground truncate text-sm font-medium", children: title }), badges] }), subtitle ? _jsx("span", { className: "flex flex-wrap items-center gap-1.5", children: subtitle }) : null, summary ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground line-clamp-2 text-xs text-pretty", children: summary }), _jsx("span", { id: descriptionId, className: "sr-only", "aria-hidden": true, children: shortSummary(description ?? '') })] })) : null, meta ? (_jsx("span", { className: "text-muted-foreground/80 flex flex-wrap items-center gap-x-2 gap-y-0.5 pt-1 text-xs", children: meta })) : null] })] }));
|
|
15
25
|
const body = (_jsxs(_Fragment, { children: [content, trailingSlot] }));
|
|
16
26
|
if (select) {
|
|
17
|
-
return (_jsxs("div", { style: style, "data-selected": select.checked || undefined, className: cn(classes, select.checked && 'border-border bg-accent'), children: [_jsx(Checkbox, { "aria-label": select.label, checked: select.checked, disabled: disabled || select.disabled, onCheckedChange: () => select.onCheckedChange(), className: "mt-0.5" }), _jsx("button", { type: "button", onClick: onClick, disabled: disabled, className: "flex min-w-0 flex-1 items-start gap-3 text-left focus-visible:outline-none", children: content }), trailingSlot] }));
|
|
27
|
+
return (_jsxs("div", { style: style, "data-selected": select.checked || undefined, className: cn(classes, select.checked && 'border-border bg-accent'), children: [_jsx(Checkbox, { "aria-label": select.label, checked: select.checked, disabled: disabled || select.disabled, onCheckedChange: () => select.onCheckedChange(), className: "mt-0.5" }), _jsx("button", { type: "button", onClick: onClick, disabled: disabled, ...a11y, className: "flex min-w-0 flex-1 items-start gap-3 text-left focus-visible:outline-none", children: content }), trailingSlot] }));
|
|
18
28
|
}
|
|
19
29
|
if (href && trailingInteractive) {
|
|
20
30
|
return (
|
|
@@ -22,10 +32,10 @@ export function CatalogCard({ leading, title, description, badges, meta, subtitl
|
|
|
22
32
|
// never paints here: `has-` draws the same ring while the link holds
|
|
23
33
|
// keyboard focus. The link's `after` covers the card, so the padding
|
|
24
34
|
// still navigates; the control is `relative` to stay above it.
|
|
25
|
-
_jsxs("div", { style: style, className: cn(classes, 'has-[a:focus-visible]:ring-ring/50 relative has-[a:focus-visible]:ring-2'), children: [_jsx(HoverPrefetchLink, { href: href, prefetch: true, "aria-disabled": disabled || undefined, onPointerEnter: onIntent, onFocus: onIntent, className: "flex min-w-0 flex-1 items-start gap-3 text-left after:absolute after:inset-0 after:content-[''] focus-visible:outline-none", children: content }), trailing ? _jsx("span", { className: "relative shrink-0", children: trailing }) : null] }));
|
|
35
|
+
_jsxs("div", { style: style, className: cn(classes, 'has-[a:focus-visible]:ring-ring/50 relative has-[a:focus-visible]:ring-2'), children: [_jsx(HoverPrefetchLink, { href: href, prefetch: true, "aria-disabled": disabled || undefined, onPointerEnter: onIntent, onFocus: onIntent, ...a11y, className: "flex min-w-0 flex-1 items-start gap-3 text-left after:absolute after:inset-0 after:content-[''] focus-visible:outline-none", children: content }), trailing ? _jsx("span", { className: "relative shrink-0", children: trailing }) : null] }));
|
|
26
36
|
}
|
|
27
37
|
if (href) {
|
|
28
|
-
return (_jsx(HoverPrefetchLink, { href: href, prefetch: true, "aria-disabled": disabled || undefined, onPointerEnter: onIntent, onFocus: onIntent, style: style, className: classes, children: body }));
|
|
38
|
+
return (_jsx(HoverPrefetchLink, { href: href, prefetch: true, "aria-disabled": disabled || undefined, onPointerEnter: onIntent, onFocus: onIntent, ...a11y, style: style, className: classes, children: body }));
|
|
29
39
|
}
|
|
30
|
-
return (_jsx("button", { type: "button", onClick: onClick, disabled: disabled, style: style, className: classes, children: body }));
|
|
40
|
+
return (_jsx("button", { type: "button", onClick: onClick, disabled: disabled, ...a11y, style: style, className: classes, children: body }));
|
|
31
41
|
}
|
|
@@ -50,7 +50,7 @@ export function CustomizeFrame({ projectId, children }) {
|
|
|
50
50
|
export function SettingsFrame({ children }) {
|
|
51
51
|
const tSettings = useTranslations('workspaces.settings');
|
|
52
52
|
const sidebar = useOptionalSidebar();
|
|
53
|
-
return (_jsxs(InCustomizeFrame.Provider, { value: true, children: [_jsxs("div", { className: "kx-titlebar-row kx-capability-titlebar relative flex h-11 shrink-0 items-center gap-1 border-b px-2", "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [_jsx(SidebarToggle, {}), _jsx("
|
|
53
|
+
return (_jsxs(InCustomizeFrame.Provider, { value: true, children: [_jsxs("div", { className: "kx-titlebar-row kx-capability-titlebar relative flex h-11 shrink-0 items-center gap-1 border-b px-2", "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [_jsx(SidebarToggle, {}), _jsx("p", { className: "text-foreground truncate px-2 text-sm font-medium", children: tSettings('title') })] }), children] }));
|
|
54
54
|
}
|
|
55
55
|
const TAB_CLASS = 'w-fit flex-none px-1 py-3';
|
|
56
56
|
const SETTINGS_LINK_CLASS = 'text-muted-foreground hover:text-foreground flex w-fit flex-none items-center gap-1 px-1 py-3 text-sm font-medium whitespace-nowrap transition-colors';
|
|
@@ -6,6 +6,7 @@ import Loading from '../../primitives/loading.js';
|
|
|
6
6
|
import { useTranslations as useI18nTranslations } from '../../i18n/index.js';
|
|
7
7
|
import { CaretDownIcon, ChatCircleIcon, GearSixIcon, PlusIcon } from '@phosphor-icons/react';
|
|
8
8
|
import { UiLink as Link } from '../../providers/ui-provider.js';
|
|
9
|
+
import { useEffect, useRef } from 'react';
|
|
9
10
|
/**
|
|
10
11
|
* One row of the New menu: icon, title, description (Paper "New menu" V03,
|
|
11
12
|
* after `alert.tsx`). The 16px glyph takes `mt-1 ml-0.5` so it sits level
|
|
@@ -35,10 +36,46 @@ export function NewEntityMenu({ label = 'New',
|
|
|
35
36
|
// Customize header puts beside it. `sm` (`h-8`) left the pair 4px apart.
|
|
36
37
|
size = 'default', variant = 'secondary', caret = true, pending = false, onChat, manual, quick, }) {
|
|
37
38
|
const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
|
|
39
|
+
const triggerRef = useRef(null);
|
|
40
|
+
const pendingRef = useRef(null);
|
|
41
|
+
const fallbackRef = useRef(null);
|
|
42
|
+
useEffect(() => () => {
|
|
43
|
+
if (fallbackRef.current)
|
|
44
|
+
clearTimeout(fallbackRef.current);
|
|
45
|
+
}, []);
|
|
38
46
|
if (!manual) {
|
|
39
47
|
return (_jsxs(Button, { variant: variant, size: size, className: "gap-1.5", disabled: pending, onClick: onChat, children: [pending ? _jsx(Loading, { className: "size-4 shrink-0" }) : _jsx(PlusIcon, { className: "size-4" }), label] }));
|
|
40
48
|
}
|
|
49
|
+
// A row that opens a dialog or panel runs after the menu has closed and
|
|
50
|
+
// focus is back on the New button. Run from the row itself, the dialog
|
|
51
|
+
// remembers the row as its return target; the menu unmounts the row, so
|
|
52
|
+
// Cancel or Escape dropped focus to <body>. Run here, the dialog records the
|
|
53
|
+
// New button and returns focus to it.
|
|
54
|
+
const runPending = () => {
|
|
55
|
+
const open = pendingRef.current;
|
|
56
|
+
pendingRef.current = null;
|
|
57
|
+
open?.();
|
|
58
|
+
};
|
|
59
|
+
const afterClose = (open) => {
|
|
60
|
+
pendingRef.current = open ?? null;
|
|
61
|
+
// The close hook runs on the frame the menu closes. If it never runs, the
|
|
62
|
+
// row still opens its dialog, with the old focus behavior.
|
|
63
|
+
if (fallbackRef.current)
|
|
64
|
+
clearTimeout(fallbackRef.current);
|
|
65
|
+
fallbackRef.current = setTimeout(() => {
|
|
66
|
+
fallbackRef.current = null;
|
|
67
|
+
if (pendingRef.current === open)
|
|
68
|
+
runPending();
|
|
69
|
+
}, 250);
|
|
70
|
+
};
|
|
71
|
+
const onCloseAutoFocus = (event) => {
|
|
72
|
+
if (!pendingRef.current)
|
|
73
|
+
return;
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
triggerRef.current?.focus({ preventScroll: true });
|
|
76
|
+
runPending();
|
|
77
|
+
};
|
|
41
78
|
const manualLabel = manual.label ?? 'Set up manually';
|
|
42
79
|
const manualBody = (_jsx(RichRowBody, { icon: GearSixIcon, title: manualLabel, description: manual.description }));
|
|
43
|
-
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: variant, size: size, className: "gap-1.5", disabled: pending, children: [pending ? _jsx(Loading, { className: "size-4 shrink-0" }) : _jsx(PlusIcon, { className: "size-4" }), label, caret ? _jsx(CaretDownIcon, { className: "text-muted-foreground size-3.5 shrink-0" }) : null] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-76", children: [quick ? (_jsx(DropdownMenuItem, { className: RICH_ROW_CLASS, onSelect: quick.onSelect, children: _jsx(RichRowBody, { icon: quick.icon, title: quick.label, description: quick.description }) })) : null, _jsx(DropdownMenuItem, { className: RICH_ROW_CLASS, onSelect: onChat, children: _jsx(RichRowBody, { icon: ChatCircleIcon, title: tI18nComplete.raw('textb1895f6ddd9d'), description: tI18nComplete.raw('text31e3ed0f6798') }) }), manual.href ? (_jsx(DropdownMenuItem, { asChild: true, className: RICH_ROW_CLASS, children: _jsx(Link, { href: manual.href, prefetch: true, children: manualBody }) })) : (_jsx(DropdownMenuItem, { className: RICH_ROW_CLASS, onSelect: manual.onSelect, children: manualBody }))] })] }));
|
|
80
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { ref: triggerRef, asChild: true, children: _jsxs(Button, { variant: variant, size: size, className: "gap-1.5", disabled: pending, children: [pending ? _jsx(Loading, { className: "size-4 shrink-0" }) : _jsx(PlusIcon, { className: "size-4" }), label, caret ? _jsx(CaretDownIcon, { className: "text-muted-foreground size-3.5 shrink-0" }) : null] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-76", onCloseAutoFocus: onCloseAutoFocus, children: [quick ? (_jsx(DropdownMenuItem, { className: RICH_ROW_CLASS, onSelect: () => afterClose(quick.onSelect), children: _jsx(RichRowBody, { icon: quick.icon, title: quick.label, description: quick.description }) })) : null, _jsx(DropdownMenuItem, { className: RICH_ROW_CLASS, onSelect: onChat, children: _jsx(RichRowBody, { icon: ChatCircleIcon, title: tI18nComplete.raw('textb1895f6ddd9d'), description: tI18nComplete.raw('text31e3ed0f6798') }) }), manual.href ? (_jsx(DropdownMenuItem, { asChild: true, className: RICH_ROW_CLASS, children: _jsx(Link, { href: manual.href, prefetch: true, children: manualBody }) })) : (_jsx(DropdownMenuItem, { className: RICH_ROW_CLASS, onSelect: () => afterClose(manual.onSelect), children: manualBody }))] })] }));
|
|
44
81
|
}
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
import type { UnifiedTrigger } from '@kortix/sdk';
|
|
12
12
|
/** `true` for a row this page lists: runtime, and (on an agent's page) one that starts that agent. */
|
|
13
13
|
export declare function runtimeRowsFor(triggers: readonly UnifiedTrigger[], agentName: string | null): UnifiedTrigger[];
|
|
14
|
+
/** A one-shot schedule's run time (`source.at`) in the viewer's locale, or null. */
|
|
15
|
+
export declare function oneShotText(source: UnifiedTrigger['source'], locale: string): string | null;
|
|
16
|
+
/** Active and paused rows first, then the one-shots that already fired. Stable within each group. */
|
|
17
|
+
export declare function sortRuntimeRows(rows: readonly UnifiedTrigger[]): UnifiedTrigger[];
|
|
14
18
|
export declare function RuntimeTriggers({ projectId, agentName }: {
|
|
15
19
|
projectId: string;
|
|
16
20
|
agentName?: string | null;
|
|
@@ -34,12 +34,25 @@ function scheduleText(source) {
|
|
|
34
34
|
return null;
|
|
35
35
|
return source.cron ?? source.every ?? null;
|
|
36
36
|
}
|
|
37
|
+
/** A one-shot schedule's run time (`source.at`) in the viewer's locale, or null. */
|
|
38
|
+
export function oneShotText(source, locale) {
|
|
39
|
+
if (source.type !== 'schedule' || source.cron || source.every || !source.at)
|
|
40
|
+
return null;
|
|
41
|
+
const at = new Date(source.at);
|
|
42
|
+
if (Number.isNaN(at.getTime()))
|
|
43
|
+
return null;
|
|
44
|
+
return new Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeStyle: 'short' }).format(at);
|
|
45
|
+
}
|
|
46
|
+
/** Active and paused rows first, then the one-shots that already fired. Stable within each group. */
|
|
47
|
+
export function sortRuntimeRows(rows) {
|
|
48
|
+
return [...rows.filter((a) => a.state !== 'done'), ...rows.filter((a) => a.state === 'done')];
|
|
49
|
+
}
|
|
37
50
|
export function RuntimeTriggers({ projectId, agentName = null }) {
|
|
38
51
|
const t = useTranslations('hardcodedUi.i18nComplete');
|
|
39
52
|
const locale = useLocale();
|
|
40
53
|
const triggers = useUnifiedTriggers(projectId);
|
|
41
54
|
const [deleteTarget, setDeleteTarget] = useState(null);
|
|
42
|
-
const rows = runtimeRowsFor(triggers.data?.triggers ?? [], agentName);
|
|
55
|
+
const rows = sortRuntimeRows(runtimeRowsFor(triggers.data?.triggers ?? [], agentName));
|
|
43
56
|
// `?id=<runtime id>` names one row (a loop's Manage link): mark it and bring it into view once.
|
|
44
57
|
const openId = readTriggerSheet(useUiSearchParams()).slug;
|
|
45
58
|
const openRow = rows.some((a) => a.id === openId) ? openId : null;
|
|
@@ -59,7 +72,13 @@ export function RuntimeTriggers({ projectId, agentName = null }) {
|
|
|
59
72
|
return (_jsxs("section", { className: "space-y-2 pt-4", children: [_jsxs("div", { className: "space-y-0.5", children: [_jsx(Label, { children: t.raw('text41bec5c0977c') }), _jsx("p", { className: "text-muted-foreground text-xs", children: t.raw('text8898c02a816e') })] }), _jsx("ul", { className: "space-y-2", children: rows.map((a) => {
|
|
60
73
|
const busy = (triggers.update.isPending && triggers.update.variables?.triggerId === a.id) ||
|
|
61
74
|
(triggers.run.isPending && triggers.run.variables?.triggerId === a.id);
|
|
62
|
-
|
|
75
|
+
const done = a.state === 'done';
|
|
76
|
+
const once = oneShotText(a.source, locale);
|
|
77
|
+
// The API runs a fired one-shot again on request (POST …/run has no state gate).
|
|
78
|
+
const runLabel = done ? t.raw('text3e310b75051c') : t.raw('text0991397702fa');
|
|
79
|
+
return (_jsxs("li", { ref: a.id === openRow ? openRef : undefined, "data-trigger-id": a.id, "aria-current": a.id === openRow ? 'true' : undefined, className: cn('flex items-center gap-3 rounded-md border px-4 py-2', a.id === openRow ? 'bg-hover' : 'bg-popover'), children: [_jsxs("div", { className: "min-w-0 flex-1 space-y-0.5", children: [_jsx("p", { className: "text-foreground truncate text-sm font-medium", children: a.name ?? a.prompt }), _jsxs(InlineMeta, { children: [_jsx("span", { children: t.raw(SOURCE_KEY[a.source.type]) }), scheduleText(a.source) ? _jsx("span", { className: "font-mono", children: scheduleText(a.source) }) : null, once ? _jsx("span", { children: t.raw('textd88f6d8372f4') }) : null, once ? _jsx("time", { dateTime: a.source.at ?? undefined, children: once }) : null, _jsx("span", { className: "min-w-0 truncate", children: target(a) }), a.state === 'active' && a.next_fire_at ? (_jsxs("span", { children: [t.raw('textb3c0ab96930c'), " ", relativeTime(a.next_fire_at, locale)] })) : null, _jsxs("span", { children: [t.raw('text512a48218ba2'), ' ', a.last_fired_at ? relativeTime(a.last_fired_at, locale) : t.raw('text6300ef800bb8')] })] }), a.last_error ? _jsx("p", { className: "text-destructive truncate text-xs", children: a.last_error }) : null] }), busy ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, done ? (
|
|
80
|
+
// A fired one-shot has nothing to turn on: a label, not a dead switch.
|
|
81
|
+
_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: t.raw('text11a6767d5674') })) : (_jsx(Switch, { checked: a.state === 'active', disabled: busy, "aria-label": a.state === 'active' ? t.raw('text858e4ba7a29f') : t.raw('textd640c7421da0'), onCheckedChange: (enabled) => triggers.update.mutate({ triggerId: a.id, enabled }, { onError }) })), _jsxs(ButtonGroup, { children: [_jsx(Hint, { label: runLabel, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": runLabel, disabled: busy, onClick: () => triggers.run.mutate({ triggerId: a.id }, { onError }), children: _jsx(PlayIcon, { className: "size-4 shrink-0" }) }) }), _jsx(Hint, { label: t.raw('texte2d0a54968ea'), children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": t.raw('texte2d0a54968ea'), onClick: () => setDeleteTarget(a), children: _jsx(TrashIcon, { className: "size-4 shrink-0" }) }) })] })] }, a.id));
|
|
63
82
|
}) }), _jsx(ConfirmDialog, { open: !!deleteTarget, onOpenChange: (next) => {
|
|
64
83
|
if (!next)
|
|
65
84
|
setDeleteTarget(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useFeatureFlag, useProjectSpaces } from '@kortix/sdk/react';
|
|
4
|
-
import {
|
|
4
|
+
import { agentDisplayName } from '../../../_vendor/kortix-shared.js';
|
|
5
5
|
import { HashIcon, LockSimpleIcon } from '@phosphor-icons/react';
|
|
6
6
|
import { useTranslations } from '../../../i18n/index.js';
|
|
7
7
|
import { AgentMark } from '../../../internal/components/agent-mark.js';
|
|
@@ -45,5 +45,5 @@ export function PostToField({ projectId, draft, patch, baseAccess, }) {
|
|
|
45
45
|
})] })] }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: t('postToHint', { channel: list.find((space) => space.is_default)?.slug ?? 'general' }) })] }));
|
|
46
46
|
}
|
|
47
47
|
function agentLabel(name) {
|
|
48
|
-
return
|
|
48
|
+
return agentDisplayName(name);
|
|
49
49
|
}
|
|
@@ -64,6 +64,7 @@ import { RuntimeTriggers, runtimeRowsFor } from './runtime-triggers.js';
|
|
|
64
64
|
import { runsInFlight } from './schedule/trigger-runs-logic.js';
|
|
65
65
|
import { runsOf } from './schedule/trigger-runs-panel.js';
|
|
66
66
|
import { bulkTargets, runSequentially, selectAllShown, selectRange, toggleSlug, visibleSelection, } from './schedule/trigger-selection.js';
|
|
67
|
+
import { ActionBarDock } from '../../primitives/action-bar.js';
|
|
67
68
|
import { TriggerSelectionBar } from './schedule/trigger-selection-bar.js';
|
|
68
69
|
import { useEventTitles } from './schedule/use-event-titles.js';
|
|
69
70
|
/** Tab label per filter: the three kinds reuse the page's existing words. */
|
|
@@ -453,5 +454,5 @@ export function ScheduleView({ projectId, surface = { kind: 'global' }, defaultA
|
|
|
453
454
|
} })] }), selectMode ? (
|
|
454
455
|
// Pinned to the bottom of the list column, not to the end of the list:
|
|
455
456
|
// `sticky` stops where a short list ends.
|
|
456
|
-
_jsx(
|
|
457
|
+
_jsx(ActionBarDock, { className: "z-10", children: _jsx(TriggerSelectionBar, { selectedCount: actionable.size, shownCount: filtered.length, allSelected: filtered.length > 0 && filtered.every((t) => selectedSlugs.has(t.slug)), canPause: bulkTargets(triggers, actionable, false).length > 0, canResume: bulkTargets(triggers, actionable, true).length > 0, canDelete: controls.canDelete, progress: bulkProgress, onSelectAll: () => setSelectedSlugs(selectAllShown(filtered)), onClear: () => setSelectedSlugs(new Set()), onPause: () => void runBulk('pause'), onResume: () => void runBulk('resume'), onDelete: () => setBulkDeleteOpen(true), onExit: exitSelectMode }) })) : null] }), _jsx(ScheduleDetailSplitContent, { projectId: projectId, trigger: selected, eventsEnabled: eventsOn, controls: controls, initialTab: sheet.tab, projectPaused: paused, live: !!selected && selected.slug === liveSlug, onResumeAll: () => resumeAll.mutate(false), resumingAll: resumeAll.isPending, onTabChange: (tab) => selected && navigateSheet({ slug: selected.slug, tab }), onRun: () => selected && run.mutate(selected), running: run.isPending && run.variables?.slug === selected?.slug, onDelete: () => selected && setDeleteTarget(selected), onMutated: invalidate })] }));
|
|
457
458
|
}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '../../../primitives/alert-dialog.js';
|
|
4
4
|
import { Button } from '../../../primitives/button.js';
|
|
5
|
-
import {
|
|
5
|
+
import { ActionBar, ActionBarDock } from '../../../primitives/action-bar.js';
|
|
6
6
|
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, } from '../../../primitives/context-menu.js';
|
|
7
7
|
import Loading from '../../../primitives/loading.js';
|
|
8
|
-
import { Skeleton } from '../../../primitives/skeleton.js';
|
|
9
8
|
import { errorToast, successToast } from '../../../primitives/toast.js';
|
|
10
9
|
import { DRAG_MIME } from '../../tree/components/file-tree-item.js';
|
|
11
10
|
import { useFilesStore, useFilesStoreApi } from '../../../internal/stores/files-store.js';
|
|
@@ -13,14 +12,14 @@ import { EmptyState } from '../../../primitives/empty-state.js';
|
|
|
13
12
|
import { EmptyArt } from '../../../primitives/empty-art.js';
|
|
14
13
|
import { ErrorState } from '../../../primitives/error-state.js';
|
|
15
14
|
import { isSandboxNotReadyError } from '@kortix/sdk';
|
|
16
|
-
import { ClipboardIcon as Clipboard, FolderPlusIcon as FolderPlus,
|
|
15
|
+
import { ClipboardIcon as Clipboard, FolderPlusIcon as FolderPlus, MoonIcon, XIcon, UploadSimpleIcon, UploadIcon as Upload, ArrowsLeftRightIcon, CheckSquareIcon, TrashIcon, } from '@phosphor-icons/react';
|
|
17
16
|
import { Download } from '../../../internal/icons/download.js';
|
|
18
17
|
import { useLocale, useTranslations } from '../../../i18n/index.js';
|
|
19
18
|
import { formatStorageBytes } from '../../drives/drive-storage.js';
|
|
20
19
|
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
21
20
|
import { useFileExplorerSource } from '../explorer-source.js';
|
|
22
21
|
import { buildGitStatusMap } from '../hooks/index.js';
|
|
23
|
-
import { forEachLimit, MAX_UPLOAD_BYTES, partitionUploadBatch, resolveUploadTarget, UPLOAD_CONCURRENCY, } from '../upload-batch.js';
|
|
22
|
+
import { forEachLimit, inFlightPaths, MAX_UPLOAD_BYTES, partitionUploadBatch, resolveUploadTarget, UPLOAD_CONCURRENCY, } from '../upload-batch.js';
|
|
24
23
|
import { droppedEntries, folderMaker, hasFolder, readDroppedTree, treeLevels, } from '../drop-tree.js';
|
|
25
24
|
import { DriveCreateDialog, } from './drive-create-dialog.js';
|
|
26
25
|
import { DriveGridView } from './drive-grid-view.js';
|
|
@@ -34,8 +33,7 @@ import { FileHistoryPopoverContent } from './file-history-popover.js';
|
|
|
34
33
|
import { ExplorerFilePreview } from './file-preview-modal.js';
|
|
35
34
|
import { FileSearch } from './file-search.js';
|
|
36
35
|
import { isPartialListing, LoadMoreRow } from './load-more-row.js';
|
|
37
|
-
|
|
38
|
-
const ELEVATED_DIRS = new Set(['.kortix']);
|
|
36
|
+
import { ListingSkeleton, useSortedListing } from './explorer-listing.js';
|
|
39
37
|
/**
|
|
40
38
|
* Google Drive-style file explorer — the ONE explorer implementation, shared
|
|
41
39
|
* by every surface. Data access comes from the injected FileExplorerSource
|
|
@@ -83,8 +81,6 @@ export function DriveExplorer({ embedded = false, shareContext, leading, trailin
|
|
|
83
81
|
const currentPath = useFilesStore((s) => s.currentPath);
|
|
84
82
|
const navigateToPath = useFilesStore((s) => s.navigateToPath);
|
|
85
83
|
const viewMode = useFilesStore((s) => s.viewMode);
|
|
86
|
-
const sortBy = useFilesStore((s) => s.sortBy);
|
|
87
|
-
const sortOrder = useFilesStore((s) => s.sortOrder);
|
|
88
84
|
const isSearchOpen = useFilesStore((s) => s.isSearchOpen);
|
|
89
85
|
const toggleSearch = useFilesStore((s) => s.toggleSearch);
|
|
90
86
|
const closeSearch = useFilesStore((s) => s.closeSearch);
|
|
@@ -152,10 +148,9 @@ export function DriveExplorer({ embedded = false, shareContext, leading, trailin
|
|
|
152
148
|
// Project-wide, so a batch keeps going (and its tray keeps reporting) after
|
|
153
149
|
// this folder view unmounts. The tray itself is in the project shell.
|
|
154
150
|
const uploads = useDriveUploads((s) => s.uploads);
|
|
155
|
-
// Cards and rows still on their way up
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
.map((u) => (u.targetPath ? `${u.targetPath.replace(/\/+$/, '')}/${u.file.name}` : u.file.name))), [uploads]);
|
|
151
|
+
// Cards and rows still on their way up (an upload, or a New file not yet
|
|
152
|
+
// created) show a spinner and defer their preview until the server has them.
|
|
153
|
+
const uploadingPaths = useMemo(() => inFlightPaths(uploads, pending), [uploads, pending]);
|
|
159
154
|
const dragPageCounter = useRef(0);
|
|
160
155
|
const [createKind, setCreateKind] = useState(null);
|
|
161
156
|
const [renameTarget, setRenameTarget] = useState(null);
|
|
@@ -204,46 +199,7 @@ export function DriveExplorer({ embedded = false, shareContext, leading, trailin
|
|
|
204
199
|
window.addEventListener('keydown', handleKeyDown);
|
|
205
200
|
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
206
201
|
}, [searchEnabled, toggleSearch, closeSearch, isSearchOpen]);
|
|
207
|
-
|
|
208
|
-
const { elevatedDirs, dirs, fileItems } = useMemo(() => {
|
|
209
|
-
if (!files)
|
|
210
|
-
return {
|
|
211
|
-
elevatedDirs: [],
|
|
212
|
-
dirs: [],
|
|
213
|
-
fileItems: [],
|
|
214
|
-
};
|
|
215
|
-
const sortFn = (a, b) => {
|
|
216
|
-
let cmp = 0;
|
|
217
|
-
switch (sortBy) {
|
|
218
|
-
case 'name':
|
|
219
|
-
cmp = a.name.localeCompare(b.name);
|
|
220
|
-
break;
|
|
221
|
-
case 'type': {
|
|
222
|
-
const extA = a.name.includes('.') ? a.name.split('.').pop() || '' : '';
|
|
223
|
-
const extB = b.name.includes('.') ? b.name.split('.').pop() || '' : '';
|
|
224
|
-
cmp = extA.localeCompare(extB);
|
|
225
|
-
if (cmp === 0)
|
|
226
|
-
cmp = a.name.localeCompare(b.name);
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
case 'modified':
|
|
230
|
-
case 'size':
|
|
231
|
-
cmp = a.name.localeCompare(b.name);
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
return sortOrder === 'desc' ? -cmp : cmp;
|
|
235
|
-
};
|
|
236
|
-
// A partial folder keeps the server's name order: a sorted subset would
|
|
237
|
-
// put a later page's rows above the ones shown (KRTX-1723).
|
|
238
|
-
const sorted = (nodes) => (partial ? nodes : nodes.sort(sortFn));
|
|
239
|
-
const allDirs = files.filter((f) => f.type === 'directory');
|
|
240
|
-
const elevatedDirs = allDirs
|
|
241
|
-
.filter((f) => ELEVATED_DIRS.has(f.name))
|
|
242
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
|
243
|
-
const dirs = sorted(allDirs.filter((f) => !ELEVATED_DIRS.has(f.name)));
|
|
244
|
-
const fileItems = sorted(files.filter((f) => f.type === 'file'));
|
|
245
|
-
return { elevatedDirs, dirs, fileItems };
|
|
246
|
-
}, [files, sortBy, sortOrder, partial]);
|
|
202
|
+
const { dirs, fileItems } = useSortedListing(files, partial);
|
|
247
203
|
// ── Handlers ──────────────────────────────────────────────────
|
|
248
204
|
const handleNavigateToDir = useCallback((node) => {
|
|
249
205
|
navigateToPath(node.path);
|
|
@@ -789,7 +745,7 @@ export function DriveExplorer({ embedded = false, shareContext, leading, trailin
|
|
|
789
745
|
const [selectionStore] = useState(createSelectionStore);
|
|
790
746
|
useEffect(() => selectionStore.clear(), [currentPath, selectionStore]);
|
|
791
747
|
const selectMode = useSyncExternalStore(selectionStore.subscribe, selectionStore.mode, () => false);
|
|
792
|
-
const ordered = useMemo(() => [...
|
|
748
|
+
const ordered = useMemo(() => [...dirs, ...fileItems], [dirs, fileItems]);
|
|
793
749
|
// Read by the stable callbacks below at the moment they run.
|
|
794
750
|
const orderedRef = useRef(ordered);
|
|
795
751
|
useEffect(() => {
|
|
@@ -1014,7 +970,6 @@ export function DriveExplorer({ embedded = false, shareContext, leading, trailin
|
|
|
1014
970
|
!error &&
|
|
1015
971
|
Boolean(files) &&
|
|
1016
972
|
!listing.hasNextPage &&
|
|
1017
|
-
elevatedDirs.length === 0 &&
|
|
1018
973
|
dirs.length === 0 &&
|
|
1019
974
|
fileItems.length === 0;
|
|
1020
975
|
return (_jsx(DriveSelectionContext.Provider, { value: selectionValue, children: _jsx(DriveRenameContext.Provider, { value: canWrite ? requestRename : null, children: _jsxs("div", { className: "bg-background relative flex h-full flex-col", onDragEnter: handlePageDragEnter, onDragLeave: handlePageDragLeave, onDragOver: handlePageDragOver, onDrop: handlePageDrop, children: [_jsx(DriveActionRow, { leading: leading, actions: (() => {
|
|
@@ -1033,11 +988,7 @@ export function DriveExplorer({ embedded = false, shareContext, leading, trailin
|
|
|
1033
988
|
if (picked?.length)
|
|
1034
989
|
void handleUploadFolder(picked);
|
|
1035
990
|
e.target.value = '';
|
|
1036
|
-
} }), _jsxs(ListingRegion, { className: "relative min-h-0 flex-1", children: [_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { asChild: true, children: _jsxs("div", { ref: scrollRef, className: "absolute inset-0 overflow-y-auto", onPointerDown: onMarqueeDown, onPointerMove: onMarqueeMove, onPointerUp: onMarqueeUp, onPointerCancel: onMarqueeUp, children: [_jsx("div", { ref: marqueeBoxRef, "aria-hidden": true, className: "border-kortix-base bg-kortix-base/15 pointer-events-none absolute top-0 left-0 z-20 hidden rounded-sm border" }), isLoading && showSkeleton &&
|
|
1037
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(160px, 1fr))",
|
|
1038
|
-
}, children: Array.from({ length: 6 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 rounded-lg" }, `f${i}`))) })] }), _jsxs("div", { children: [_jsx(Skeleton, { className: "mb-3 h-4 w-12" }), _jsx("div", { className: "grid gap-2.5", style: {
|
|
1039
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(150px, 1fr))",
|
|
1040
|
-
}, children: Array.from({ length: 8 }).map((_, i) => (_jsx(Skeleton, { className: "h-[138px] rounded-lg" }, `fi${i}`))) })] })] })) : (_jsx("div", { className: "space-y-1", children: Array.from({ length: 10 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 w-full rounded-sm" }, i))) })) })), !!error &&
|
|
991
|
+
} }), _jsxs(ListingRegion, { className: "relative min-h-0 flex-1", children: [_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { asChild: true, children: _jsxs("div", { ref: scrollRef, className: "absolute inset-0 overflow-y-auto", onPointerDown: onMarqueeDown, onPointerMove: onMarqueeMove, onPointerUp: onMarqueeUp, onPointerCancel: onMarqueeUp, children: [_jsx("div", { ref: marqueeBoxRef, "aria-hidden": true, className: "border-kortix-base bg-kortix-base/15 pointer-events-none absolute top-0 left-0 z-20 hidden rounded-sm border" }), isLoading && showSkeleton && _jsx(ListingSkeleton, { viewMode: viewMode }), !!error &&
|
|
1041
992
|
!isLoading &&
|
|
1042
993
|
(sandboxWaking ? (_jsxs("div", { className: "flex flex-col items-center justify-center gap-3 py-16 text-center", children: [_jsx(Loading, { className: "text-muted-foreground size-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: tHardcodedUi.raw('i18nComplete.text5e3de76869f3') }), _jsx("p", { className: "text-muted-foreground max-w-xs text-xs", children: tHardcodedUi.raw('i18nComplete.textc1b1dc22e207') })] })) : (_jsx(ErrorState, { title: tHardcodedUi.raw('featuresProjectFilesComponentsFileExplorerPage.line658JsxTextFailedToLoadFiles'), description: error instanceof Error
|
|
1043
994
|
? error.message
|
|
@@ -1047,20 +998,32 @@ export function DriveExplorer({ embedded = false, shareContext, leading, trailin
|
|
|
1047
998
|
// An empty folder with no way to add a file is the worst case of
|
|
1048
999
|
// the missing-affordance bug — surface upload here, not only in
|
|
1049
1000
|
// the toolbar menu.
|
|
1050
|
-
action: canWrite ? (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: handleUpload, children: [_jsx(Upload, { className: "size-3.5 shrink-0" }), tHardcodedUi.raw('i18nComplete.text4118deee6e13')] })) : undefined, secondaryAction: canWrite ? (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: () => setCreateKind('folder'), children: [_jsx(FolderPlus, { className: "size-3.5 shrink-0" }), tHardcodedUi.raw('i18nComplete.textcf28f49ec597')] })) : undefined })), !isLoading && !error && files && !isEmpty && (_jsxs(_Fragment, { children: [viewMode === 'grid' ? (_jsx(DriveGridView, {
|
|
1001
|
+
action: canWrite ? (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: handleUpload, children: [_jsx(Upload, { className: "size-3.5 shrink-0" }), tHardcodedUi.raw('i18nComplete.text4118deee6e13')] })) : undefined, secondaryAction: canWrite ? (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: () => setCreateKind('folder'), children: [_jsx(FolderPlus, { className: "size-3.5 shrink-0" }), tHardcodedUi.raw('i18nComplete.textcf28f49ec597')] })) : undefined })), !isLoading && !error && files && !isEmpty && (_jsxs(_Fragment, { children: [viewMode === 'grid' ? (_jsx(DriveGridView, { dirs: dirs, files: fileItems, onNavigateToDir: handleNavigateToDir, onOpenFile: handleOpenFile, onPreviewFile: handlePreviewFile, onDownload: handleDownload, onDownloadDir: handleDownloadDir, onRename: handleRename, onDelete: handleDelete, onHistory: handleHistory, onCopy: handleCopy, onCut: handleCut, onDropMove: handleDropMove, onDropUpload: handleRowDropUpload, gitStatusMap: gitStatusMap, clipboardPath: clipboard?.path, clipboardOperation: clipboard?.operation, isDirDownloading: isDirDownloading, readOnly: !canWrite, isFixed: capabilities.fixedAt, uploadingPaths: uploadingPaths })) : (_jsx(DriveListView, { dirs: dirs, files: fileItems, sortDisabled: partial, onNavigateToDir: handleNavigateToDir, onOpenFile: handleOpenFile, onPreviewFile: handlePreviewFile, onDownload: handleDownload, onDownloadDir: handleDownloadDir, onRename: handleRename, onDelete: handleDelete, onHistory: handleHistory, onCopy: handleCopy, onCut: handleCut, onDropMove: handleDropMove, onDropUpload: handleRowDropUpload, gitStatusMap: gitStatusMap, clipboardPath: clipboard?.path, clipboardOperation: clipboard?.operation, isDirDownloading: isDirDownloading, readOnly: !canWrite, isFixed: capabilities.fixedAt, uploadingPaths: uploadingPaths })), _jsx(LoadMoreRow, { listing: listing })] }))] }) }), _jsxs(ContextMenuContent, { className: "w-48", children: [_jsx(DriveNewMenuItems, { Item: ContextMenuItem, Separator: ContextMenuSeparator, onUpload: canWrite && filesAllowedHere ? handleUpload : undefined, onUploadFolder: canWrite ? handlePickFolder : undefined, onNewFile: canWrite && filesAllowedHere && capabilities.newFile !== false
|
|
1051
1002
|
? () => setCreateKind('file')
|
|
1052
1003
|
: undefined, onNewFolder: canWrite ? () => setCreateKind('folder') : undefined }), ordered.length > 0 ? (_jsxs(_Fragment, { children: [canWrite ? _jsx(ContextMenuSeparator, {}) : null, _jsxs(ContextMenuItem, { onClick: () => selectionStore.set(new Set(selectionStore.paths()), true), children: [_jsx(CheckSquareIcon, {}), tDrives('select')] }), _jsxs(ContextMenuItem, { onClick: selectAll, children: [_jsx(CheckSquareIcon, {}), tDrives('selectAll')] })] })) : null] })] }), panels] }), canWrite && filesAllowedHere && isDragOverPage && (_jsx("div", { className: "bg-background/85 pointer-events-none absolute inset-0 z-50 p-3 backdrop-blur-sm", children: _jsxs("div", { className: "border-kortix-base flex h-full flex-col items-center justify-center gap-4 rounded-md border-2 border-dashed p-6 text-center", children: [_jsx(UploadSimpleIcon, { className: "text-muted-foreground size-10" }), _jsxs("div", { className: "max-w-xs space-y-1.5", children: [_jsx("p", { className: "text-foreground text-sm font-semibold tracking-tight", children: tDrives('dropToUpload', {
|
|
1053
1004
|
folder: normalizedCurrentPath.split('/').filter(Boolean).pop() ?? rootLabel ?? '/',
|
|
1054
|
-
}) }), _jsx("p", { className: "text-muted-foreground text-sm", children: tDrives('dropHint') })] })] }) })), selectMode ? (_jsx(
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1005
|
+
}) }), _jsx("p", { className: "text-muted-foreground text-sm", children: tDrives('dropHint') })] })] }) })), selectMode ? (_jsx(ActionBarDock, { children: _jsx(DriveSelectionBar, { store: selectionStore, total: ordered.length, zipping: zipping, canWrite: canWrite, onSelectAll: selectAll, onClearSelection: () => selectionStore.set(new Set()), onDownload: () => void bulkDownload(selectedNodes()), onCopy: () => bulkClipboard(selectedNodes(), 'copy'), onMove: () => bulkClipboard(selectedNodes(), 'cut'), onDelete: () => bulkDelete(selectedNodes()), onExit: exitSelect }) })) : null, canWrite && clipboard && !selectMode && (_jsx(ActionBarDock, { children: _jsx(ActionBar, { leading: _jsx(Clipboard, {}), title: clipboardItems.length > 1
|
|
1006
|
+
? tDrives(clipboard.operation === 'cut' ? 'clipboardMovingMany' : 'clipboardCopyingMany', {
|
|
1007
|
+
count: clipboardItems.length,
|
|
1008
|
+
})
|
|
1009
|
+
: tDrives(clipboard.operation === 'cut' ? 'clipboardMoving' : 'clipboardCopying', {
|
|
1010
|
+
name: clipboard.name,
|
|
1011
|
+
}), actions: [
|
|
1012
|
+
{
|
|
1013
|
+
id: 'paste',
|
|
1014
|
+
label: tHardcodedUi.raw('featuresFilesComponentsFileExplorerPage.line771JsxTextPasteHere'),
|
|
1015
|
+
loading: pasting,
|
|
1016
|
+
onSelect: handlePaste,
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
id: 'cancel',
|
|
1020
|
+
label: tHardcodedUi.raw('i18nComplete.text19766ed6ccb2'),
|
|
1021
|
+
// A paste already sent cannot be taken back; Cancel would only
|
|
1022
|
+
// hide the bar while it finishes.
|
|
1023
|
+
disabled: pasting,
|
|
1024
|
+
onSelect: clearClipboard,
|
|
1025
|
+
},
|
|
1026
|
+
] }) })), _jsx(DriveCreateDialog, { kind: canWrite ? createKind : null, location: location ?? {
|
|
1064
1027
|
icon: rootIcon,
|
|
1065
1028
|
crumbs: [
|
|
1066
1029
|
...(rootLabel ? [rootLabel] : []),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { GitStatusType } from '../../tree/components/file-tree-item.js';
|
|
1
|
+
import { type DriveListingProps } from './explorer-listing.js';
|
|
3
2
|
import type { FileNode } from '../../../internal/files/types.js';
|
|
4
3
|
import { type ComponentType, type ReactNode } from 'react';
|
|
5
4
|
type DriveMenuItemComponent = ComponentType<{
|
|
@@ -40,33 +39,5 @@ interface FileDriveMenuProps {
|
|
|
40
39
|
copyPathLabel: string;
|
|
41
40
|
}
|
|
42
41
|
export declare function FileDriveMenuItems({ Item, Separator, node, onClick, onDownload, onHistory, onCopy, onCut, onRename, onDelete, startRenaming, checkpointHistoryLabel, copyPathLabel, }: FileDriveMenuProps): import("react").JSX.Element;
|
|
43
|
-
|
|
44
|
-
elevatedDirs: FileNode[];
|
|
45
|
-
dirs: FileNode[];
|
|
46
|
-
files: FileNode[];
|
|
47
|
-
onNavigateToDir: (node: FileNode) => void;
|
|
48
|
-
onOpenFile: (node: FileNode) => void;
|
|
49
|
-
onPreviewFile: (node: FileNode) => void;
|
|
50
|
-
onDownload: (node: FileNode) => void;
|
|
51
|
-
onDownloadDir: (node: FileNode) => void;
|
|
52
|
-
onRename: (node: FileNode, newName: string) => void;
|
|
53
|
-
onDelete: (node: FileNode) => void;
|
|
54
|
-
onHistory: (node: FileNode) => void;
|
|
55
|
-
onCopy: (node: FileNode) => void;
|
|
56
|
-
onCut: (node: FileNode) => void;
|
|
57
|
-
onDropMove: (sourcePath: string, targetDirPath: string) => void;
|
|
58
|
-
/** External files dropped onto a folder card upload into THAT folder. */
|
|
59
|
-
onDropUpload?: (files: File[], targetDirPath: string, entries?: DroppedEntry[]) => void;
|
|
60
|
-
gitStatusMap: Map<string, GitStatusType>;
|
|
61
|
-
clipboardPath?: string;
|
|
62
|
-
clipboardOperation?: string;
|
|
63
|
-
isDirDownloading: (path: string) => boolean;
|
|
64
|
-
/** Hide mutation context-menu entries (delete/rename/cut/copy/history). */
|
|
65
|
-
readOnly?: boolean;
|
|
66
|
-
/** Folders that cannot be renamed, cut or deleted (see `ExplorerCapabilities.fixedAt`). */
|
|
67
|
-
isFixed?: (path: string) => boolean;
|
|
68
|
-
/** Paths still uploading. */
|
|
69
|
-
uploadingPaths?: ReadonlySet<string>;
|
|
70
|
-
}
|
|
71
|
-
export declare function DriveGridView({ elevatedDirs, dirs, files, onNavigateToDir, onOpenFile, onPreviewFile, onDownload, onDownloadDir, onRename: rawOnRename, onDelete: rawOnDelete, onHistory: rawOnHistory, onCopy: rawOnCopy, onCut: rawOnCut, onDropMove: rawOnDropMove, onDropUpload: rawOnDropUpload, gitStatusMap, clipboardPath, clipboardOperation, isDirDownloading, readOnly, isFixed, uploadingPaths, }: DriveGridViewProps): import("react").JSX.Element;
|
|
42
|
+
export declare function DriveGridView(props: DriveListingProps): import("react").JSX.Element;
|
|
72
43
|
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Button } from '../../../primitives/button.js';
|
|
4
|
+
import { listingWriteHandlers } from './explorer-listing.js';
|
|
4
5
|
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, } from '../../../primitives/context-menu.js';
|
|
5
6
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '../../../primitives/dropdown-menu.js';
|
|
6
7
|
import { Label } from '../../../primitives/label.js';
|
|
7
8
|
import { cn } from '../../../lib/utils.js';
|
|
9
|
+
import { ManifestIssueMark } from './manifest-issue-mark.js';
|
|
8
10
|
import Loading from '../../../primitives/loading.js';
|
|
9
11
|
import { Copy } from '../../../icons/copy.js';
|
|
10
12
|
import { ArrowUpRightIcon as ArrowUpRight, ClipboardIcon as ClipboardCopy, EyeIcon as Eye, ClockCounterClockwiseIcon as History, DotsThreeIcon as MoreVertical, PencilSimpleIcon, ScissorsIcon as Scissors, TrashIcon, } from '@phosphor-icons/react';
|
|
@@ -98,38 +100,26 @@ const FileCard = memo(function FileCard({ node, onClick, onDoubleClick, onDownlo
|
|
|
98
100
|
checkpointHistoryLabel,
|
|
99
101
|
copyPathLabel,
|
|
100
102
|
};
|
|
101
|
-
return (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { asChild: true, children: _jsxs("div", { draggable: !isRenaming, onDragStart: handleDragStart, onDragEnd: handleDragEnd, onClick: isRenaming ? undefined : onItemClick, "data-drive-item": node.path, onDoubleClick: isRenaming || !onDoubleClick ? undefined : ownClicks(() => onDoubleClick(node)), className: cn('group relative flex cursor-pointer flex-col gap-2 select-none', isCut && 'opacity-60', isDragging && 'opacity-30'), children: [_jsx(FileThumbnail, { filePath: node.path, fileName: node.name,
|
|
103
|
+
return (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { asChild: true, children: _jsxs("div", { draggable: !isRenaming, onDragStart: handleDragStart, onDragEnd: handleDragEnd, onClick: isRenaming ? undefined : onItemClick, "data-drive-item": node.path, onDoubleClick: isRenaming || !onDoubleClick ? undefined : ownClicks(() => onDoubleClick(node)), className: cn('group relative flex cursor-pointer flex-col gap-2 select-none', isCut && 'opacity-60', isDragging && 'opacity-30'), children: [_jsx(FileThumbnail, { filePath: node.path, fileName: node.name,
|
|
104
|
+
// No preview until the server has the file: a read before the
|
|
105
|
+
// write lands is a 404 the card would keep (D-08).
|
|
106
|
+
deferPreview: uploading, onOpen: open, className: cn('border-border h-[120px] rounded-lg border',
|
|
102
107
|
// Copied, cut or selected: the focus border plus its soft 15% ring.
|
|
103
|
-
(isCut || isCopied || selected) && 'border-ring ring-ring/15 ring-2') }), selectMode && !uploading ? (_jsx(SelectionCheck, { selected: selected, className: "absolute top-2 left-2 z-10" })) : null, uploading ? (_jsx("span", { role: "status", "aria-label": tDrives('uploadingFile', { name: node.name }), className: "bg-popover border-border absolute top-2 left-2 z-10 flex size-7 items-center justify-center rounded-md border shadow-xs", children: _jsx(Loading, { variant: "spokes", className: "size-4" }) })) : null, !isRenaming && (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { onClick: (e) => e.stopPropagation(), "aria-label": tHardcodedUi.raw('i18nComplete.textf8d46c2570e7'), variant: "secondary", size: "icon-sm", className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100", children: _jsx(MoreVertical, { weight: "bold", className: "size-3.5" }) }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-48", children: _jsx(FileDriveMenuItems, { Item: DropdownMenuItem, Separator: DropdownMenuSeparator, ...fileMenuProps }) })] })), _jsx("div", { className: "flex min-w-0 items-center px-0.5", children: isRenaming ? (_jsx("input", { ref: renameInputRef, type: "text", "aria-label": tHardcodedUi.raw('i18nComplete.text3064d79a295c'), value: renameName, onChange: (e) => setRenameName(e.target.value), onKeyDown: (e) => {
|
|
108
|
+
(isCut || isCopied || selected) && 'border-ring ring-ring/15 ring-2') }), selectMode && !uploading ? (_jsx(SelectionCheck, { selected: selected, className: "absolute top-2 left-2 z-10" })) : null, uploading ? (_jsx("span", { role: "status", "aria-label": tDrives('uploadingFile', { name: node.name }), className: "bg-popover border-border absolute top-2 left-2 z-10 flex size-7 items-center justify-center rounded-md border shadow-xs", children: _jsx(Loading, { variant: "spokes", className: "size-4" }) })) : null, !isRenaming && (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { onClick: (e) => e.stopPropagation(), "aria-label": tHardcodedUi.raw('i18nComplete.textf8d46c2570e7'), variant: "secondary", size: "icon-sm", className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100", children: _jsx(MoreVertical, { weight: "bold", className: "size-3.5" }) }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-48", children: _jsx(FileDriveMenuItems, { Item: DropdownMenuItem, Separator: DropdownMenuSeparator, ...fileMenuProps }) })] })), _jsx("div", { className: "flex min-w-0 items-center gap-1 px-0.5", children: isRenaming ? (_jsx("input", { ref: renameInputRef, type: "text", "aria-label": tHardcodedUi.raw('i18nComplete.text3064d79a295c'), value: renameName, onChange: (e) => setRenameName(e.target.value), onKeyDown: (e) => {
|
|
104
109
|
if (e.nativeEvent.isComposing)
|
|
105
110
|
return;
|
|
106
111
|
if (e.key === 'Enter')
|
|
107
112
|
confirmRename();
|
|
108
113
|
if (e.key === 'Escape')
|
|
109
114
|
setIsRenaming(false);
|
|
110
|
-
}, onBlur: confirmRename, onClick: (e) => e.stopPropagation(), className: "border-primary/50 w-full border-b bg-transparent py-0.5 text-sm outline-none" })) : (_jsx("span", { className: "text-foreground truncate text-sm font-medium", children: node.name })) })] }) }), _jsx(ContextMenuContent, { className: "w-48", children: selection?.selectionMenu(node, ContextMenuItem, ContextMenuSeparator) ?? (_jsxs(_Fragment, { children: [_jsx(SelectMenuItem, { selection: selection, node: node, Item: ContextMenuItem, Separator: ContextMenuSeparator }), _jsx(FileDriveMenuItems, { Item: ContextMenuItem, Separator: ContextMenuSeparator, ...fileMenuProps })] })) })] }));
|
|
115
|
+
}, onBlur: confirmRename, onClick: (e) => e.stopPropagation(), className: "border-primary/50 w-full border-b bg-transparent py-0.5 text-sm outline-none" })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-foreground truncate text-sm font-medium", children: node.name }), _jsx(ManifestIssueMark, { path: node.path, name: node.name })] })) })] }) }), _jsx(ContextMenuContent, { className: "w-48", children: selection?.selectionMenu(node, ContextMenuItem, ContextMenuSeparator) ?? (_jsxs(_Fragment, { children: [_jsx(SelectMenuItem, { selection: selection, node: node, Item: ContextMenuItem, Separator: ContextMenuSeparator }), _jsx(FileDriveMenuItems, { Item: ContextMenuItem, Separator: ContextMenuSeparator, ...fileMenuProps })] })) })] }));
|
|
111
116
|
});
|
|
112
117
|
// ─── Main Grid View ─────────────────────────────────────────────────────────
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
};
|
|
117
|
-
export function DriveGridView({ elevatedDirs, dirs, files, onNavigateToDir, onOpenFile, onPreviewFile, onDownload, onDownloadDir, onRename: rawOnRename, onDelete: rawOnDelete, onHistory: rawOnHistory, onCopy: rawOnCopy, onCut: rawOnCut, onDropMove: rawOnDropMove, onDropUpload: rawOnDropUpload, gitStatusMap, clipboardPath, clipboardOperation, isDirDownloading, readOnly = false, isFixed, uploadingPaths, }) {
|
|
118
|
+
export function DriveGridView(props) {
|
|
119
|
+
const { dirs, files, onNavigateToDir, onOpenFile, onPreviewFile, onDownload, onDownloadDir, onHistory, gitStatusMap, clipboardPath, clipboardOperation, isDirDownloading, isFixed, uploadingPaths, } = props;
|
|
120
|
+
const { onRename, onDelete, onCopy, onCut, onDropMove, onDropUpload } = listingWriteHandlers(props);
|
|
118
121
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
119
|
-
|
|
120
|
-
const onDelete = readOnly ? undefined : rawOnDelete;
|
|
121
|
-
const onHistory = rawOnHistory;
|
|
122
|
-
const onCopy = readOnly ? undefined : rawOnCopy;
|
|
123
|
-
const onCut = readOnly ? undefined : rawOnCut;
|
|
124
|
-
const onDropMove = readOnly ? undefined : rawOnDropMove;
|
|
125
|
-
const onDropUpload = readOnly ? undefined : rawOnDropUpload;
|
|
126
|
-
return (_jsxs("div", { className: "space-y-7 p-5", children: [elevatedDirs.length > 0 && (_jsxs("section", { className: "space-y-2", children: [_jsx(SectionHeader, { label: tI18nComplete.raw('text6725e7bbcd28'), count: elevatedDirs.length }), _jsx("div", { className: "grid gap-x-4 gap-y-5", style: { gridTemplateColumns: "repeat(auto-fill, minmax(168px, 1fr))" }, children: elevatedDirs.map((node) => {
|
|
127
|
-
const meta = ELEVATED_DIR_META[node.name];
|
|
128
|
-
const description = meta
|
|
129
|
-
? tI18nComplete.raw(node.name === '.kortix' ? 'text85231c543c71' : 'text96ef9c0ac0c9')
|
|
130
|
-
: undefined;
|
|
131
|
-
return (_jsxs("button", { type: "button", onClick: () => onNavigateToDir(node), title: description, className: "group relative flex w-full min-w-0 cursor-pointer flex-col gap-2 text-left select-none", children: [_jsx(DriveFolderThumbnail, { path: node.path, className: "h-[120px]" }), _jsx("span", { className: "text-foreground truncate px-0.5 text-sm font-medium", children: node.name })] }, node.path));
|
|
132
|
-
}) })] })), dirs.length > 0 && (_jsxs("section", { className: "space-y-2", children: [_jsx(SectionHeader, { label: tI18nComplete.raw('textc4d6bb200f4c'), count: dirs.length }), _jsx("div", { className: "grid gap-x-4 gap-y-5", style: { gridTemplateColumns: "repeat(auto-fill, minmax(168px, 1fr))" }, children: dirs.map((node) => (_jsx(FolderCard, { node: node, onClick: onNavigateToDir, onDownload: onDownloadDir, isDownloadingItem: isDirDownloading(node.path), onRename: isFixed?.(node.path) ? undefined : onRename, onDelete: isFixed?.(node.path) ? undefined : onDelete, onCopy: onCopy, onCut: isFixed?.(node.path) ? undefined : onCut, onDropMove: onDropMove, onDropUpload: onDropUpload, isCut: clipboardOperation === 'cut' && clipboardPath === node.path, isCopied: clipboardOperation === 'copy' && clipboardPath === node.path }, node.path))) })] })), files.length > 0 && (_jsxs("section", { className: "space-y-2", children: [_jsx(SectionHeader, { label: tI18nComplete.raw('textabc7e9892806'), count: files.length }), _jsx("div", { className: "grid gap-x-4 gap-y-5", style: { gridTemplateColumns: "repeat(auto-fill, minmax(168px, 1fr))" }, children: files.map((node) => (_jsx(FileCard, { node: node, onClick: onPreviewFile, onDoubleClick: onOpenFile, onDownload: onDownload, onRename: onRename, onDelete: onDelete, onHistory: onHistory, onCopy: onCopy, onCut: onCut, gitStatus: gitStatusMap.get(node.path), isCut: clipboardOperation === 'cut' && clipboardPath === node.path, isCopied: clipboardOperation === 'copy' && clipboardPath === node.path, uploading: uploadingPaths?.has(node.path) }, node.path))) })] }))] }));
|
|
122
|
+
return (_jsxs("div", { className: "space-y-7 p-5", children: [dirs.length > 0 && (_jsxs("section", { className: "space-y-2", children: [_jsx(SectionHeader, { label: tI18nComplete.raw('textc4d6bb200f4c'), count: dirs.length }), _jsx("div", { className: "grid gap-x-4 gap-y-5", style: { gridTemplateColumns: "repeat(auto-fill, minmax(168px, 1fr))" }, children: dirs.map((node) => (_jsx(FolderCard, { node: node, onClick: onNavigateToDir, onDownload: onDownloadDir, isDownloadingItem: isDirDownloading(node.path), onRename: isFixed?.(node.path) ? undefined : onRename, onDelete: isFixed?.(node.path) ? undefined : onDelete, onCopy: onCopy, onCut: isFixed?.(node.path) ? undefined : onCut, onDropMove: onDropMove, onDropUpload: onDropUpload, isCut: clipboardOperation === 'cut' && clipboardPath === node.path, isCopied: clipboardOperation === 'copy' && clipboardPath === node.path }, node.path))) })] })), files.length > 0 && (_jsxs("section", { className: "space-y-2", children: [_jsx(SectionHeader, { label: tI18nComplete.raw('textabc7e9892806'), count: files.length }), _jsx("div", { className: "grid gap-x-4 gap-y-5", style: { gridTemplateColumns: "repeat(auto-fill, minmax(168px, 1fr))" }, children: files.map((node) => (_jsx(FileCard, { node: node, onClick: onPreviewFile, onDoubleClick: onOpenFile, onDownload: onDownload, onRename: onRename, onDelete: onDelete, onHistory: onHistory, onCopy: onCopy, onCut: onCut, gitStatus: gitStatusMap.get(node.path), isCut: clipboardOperation === 'cut' && clipboardPath === node.path, isCopied: clipboardOperation === 'copy' && clipboardPath === node.path, uploading: uploadingPaths?.has(node.path) }, node.path))) })] }))] }));
|
|
133
123
|
}
|
|
134
124
|
function SectionHeader({ label, count, icon, }) {
|
|
135
125
|
return (_jsxs("div", { className: "flex w-fit items-center justify-between gap-2 px-1", children: [_jsxs(Label, { className: "text-foreground flex items-center gap-2 text-sm font-medium", children: [icon, label] }), _jsx("span", { className: "text-muted-foreground text-xs tabular-nums", children: count })] }));
|