@kortix/ui 0.14.7 → 0.14.9
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/README.md +2 -2
- package/dist/_vendor/kortix-shared.js +64 -4
- package/dist/_vendor/shared/app-config.d.ts +175 -0
- package/dist/_vendor/shared/channel-message.d.ts +34 -5
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/runtime-versions.d.ts +4 -0
- package/dist/_vendor/shared/space-slug.d.ts +37 -0
- package/dist/access/access/access-detail-shell.js +1 -1
- package/dist/access/access/access-dialog-share.js +4 -7
- package/dist/access/access/access-dialog.js +2 -1
- package/dist/access/access/principal-picker.d.ts +11 -0
- package/dist/access/access/principal-picker.js +9 -7
- package/dist/apps/app-preview-pool.d.ts +7 -2
- package/dist/apps/app-preview-pool.js +11 -5
- package/dist/apps/app-shared.d.ts +22 -15
- package/dist/apps/app-shared.js +37 -19
- package/dist/apps/index.d.ts +2 -2
- package/dist/apps/index.js +2 -2
- package/dist/artifacts/artifact-frame.d.ts +16 -0
- package/dist/artifacts/artifact-frame.js +51 -0
- package/dist/artifacts/artifact-session.d.ts +18 -0
- package/dist/artifacts/artifact-session.js +101 -0
- package/dist/artifacts/frame-policy.d.ts +30 -0
- package/dist/artifacts/frame-policy.js +61 -0
- package/dist/artifacts/index.d.ts +3 -0
- package/dist/artifacts/index.js +5 -0
- package/dist/browser/sandbox-browser-chrome.d.ts +4 -1
- package/dist/browser/sandbox-browser-chrome.js +2 -2
- package/dist/customize/agents/agent-cover-card.d.ts +17 -0
- package/dist/customize/agents/agent-cover-card.js +13 -0
- package/dist/customize/agents/agent-grant-pages.d.ts +5 -1
- package/dist/customize/agents/agent-grant-pages.js +30 -4
- package/dist/customize/agents/agent-page.js +8 -33
- package/dist/customize/agents/agent-policy-sets.d.ts +43 -0
- package/dist/customize/agents/agent-policy-sets.js +72 -0
- package/dist/customize/agents/agent-triggers-section.js +2 -1
- package/dist/customize/agents/agents-page.js +43 -49
- package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.d.ts +6 -1
- package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.js +10 -4
- package/dist/customize/connectors/agent-access.d.ts +35 -0
- package/dist/customize/connectors/agent-access.js +77 -0
- package/dist/customize/connectors/catalog/browse-sections.d.ts +2 -29
- package/dist/customize/connectors/catalog/browse-sections.js +7 -74
- package/dist/customize/connectors/catalog/catalog-entry.d.ts +18 -37
- package/dist/customize/connectors/catalog/catalog-entry.js +28 -40
- package/dist/customize/connectors/catalog/connector-browse.d.ts +3 -32
- package/dist/customize/connectors/catalog/connector-browse.js +19 -50
- package/dist/customize/connectors/catalog/use-catalog.d.ts +20 -59
- package/dist/customize/connectors/catalog/use-catalog.js +48 -175
- package/dist/customize/connectors/connector-identity.d.ts +9 -11
- package/dist/customize/connectors/connector-identity.js +13 -42
- package/dist/customize/connectors/connector-moves-banner.d.ts +2 -1
- package/dist/customize/connectors/connector-moves-banner.js +4 -6
- package/dist/customize/connectors/connector-routes.d.ts +21 -9
- package/dist/customize/connectors/connector-routes.js +29 -20
- package/dist/customize/connectors/connectors-page.js +53 -82
- package/dist/customize/connectors/detail/app-page.js +226 -98
- package/dist/customize/connectors/detail/computer-app-page.d.ts +16 -0
- package/dist/customize/connectors/detail/computer-app-page.js +39 -0
- package/dist/customize/connectors/detail/connector-accounts.js +3 -1
- package/dist/customize/connectors/detail/connector-advanced-tools.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-advanced-tools.js +2 -2
- package/dist/customize/connectors/detail/connector-agents.d.ts +14 -0
- package/dist/customize/connectors/detail/connector-agents.js +69 -0
- package/dist/customize/connectors/detail/connector-detail-tabs.js +2 -1
- package/dist/customize/connectors/detail/connector-move-row.d.ts +8 -5
- package/dist/customize/connectors/detail/connector-move-row.js +23 -14
- package/dist/customize/connectors/detail/connector-page.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-page.js +14 -10
- package/dist/customize/connectors/detail/connector-policy-sets.d.ts +28 -0
- package/dist/customize/connectors/detail/connector-policy-sets.js +203 -0
- package/dist/customize/connectors/detail/connector-settings.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-settings.js +7 -3
- package/dist/customize/connectors/detail/connector-status.d.ts +19 -6
- package/dist/customize/connectors/detail/connector-status.js +34 -10
- package/dist/customize/connectors/detail/connector-tabs.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-tabs.js +8 -2
- package/dist/customize/connectors/detail/connector-tools.d.ts +3 -3
- package/dist/customize/connectors/detail/connector-tools.js +105 -48
- package/dist/customize/connectors/detail/email-inboxes.d.ts +43 -0
- package/dist/customize/connectors/detail/email-inboxes.js +184 -0
- package/dist/customize/connectors/detail/provider-info.d.ts +1 -1
- package/dist/customize/connectors/detail/provider-info.js +2 -2
- package/dist/customize/connectors/detail/status-badge.d.ts +1 -1
- package/dist/customize/connectors/detail/status-badge.js +4 -5
- package/dist/customize/connectors/detail/use-connector-detail.d.ts +6 -0
- package/dist/customize/connectors/detail/use-connector-detail.js +14 -4
- package/dist/customize/connectors/install/install-dialog.d.ts +23 -0
- package/dist/customize/connectors/install/install-dialog.js +40 -0
- package/dist/customize/connectors/install/install.d.ts +13 -2
- package/dist/customize/connectors/install/install.js +9 -4
- package/dist/customize/connectors/install/use-install.d.ts +19 -2
- package/dist/customize/connectors/install/use-install.js +65 -37
- package/dist/customize/connectors/install/way-kind.d.ts +5 -0
- package/dist/customize/connectors/install/way-kind.js +16 -0
- package/dist/customize/connectors/provider-label.d.ts +2 -1
- package/dist/customize/connectors/provider-label.js +13 -3
- package/dist/customize/connectors/tools/pattern-rule-draft.d.ts +4 -0
- package/dist/customize/connectors/tools/pattern-rule-draft.js +12 -3
- package/dist/customize/connectors/tools/policy-sets.d.ts +27 -0
- package/dist/customize/connectors/tools/policy-sets.js +41 -0
- package/dist/customize/connectors/tools/tool-groups.d.ts +32 -9
- package/dist/customize/connectors/tools/tool-groups.js +78 -16
- package/dist/customize/connectors/tools/tool-policy-control.d.ts +11 -10
- package/dist/customize/connectors/tools/tool-policy-control.js +15 -16
- package/dist/customize/connectors/tools/tool-policy-labels.d.ts +6 -5
- package/dist/customize/connectors/tools/tool-policy-labels.js +17 -16
- package/dist/customize/connectors/tools/tool-policy.d.ts +50 -4
- package/dist/customize/connectors/tools/tool-policy.js +74 -8
- package/dist/customize/connectors/use-agent-access.d.ts +85 -0
- package/dist/customize/connectors/use-agent-access.js +72 -0
- package/dist/customize/migrate-to-v2/index.d.ts +1 -2
- package/dist/customize/migrate-to-v2/index.js +1 -2
- package/dist/customize/migrate-to-v2/migration-prompt.d.ts +12 -24
- package/dist/customize/migrate-to-v2/migration-prompt.js +34 -235
- package/dist/customize/migrate-to-v2/upgrade-defs.d.ts +1 -1
- package/dist/customize/migrate-to-v2/upgrade-defs.js +7 -6
- package/dist/customize/migrate-to-v2/upgrade-view.js +7 -7
- package/dist/customize/migrate-to-v2/use-run-upgrade.d.ts +3 -3
- package/dist/customize/providers/provider-accordion.js +17 -2
- package/dist/customize/sections/component/channel-access-panel.d.ts +16 -0
- package/dist/customize/sections/component/channel-access-panel.js +146 -0
- package/dist/customize/sections/component/channel-connect-hero.d.ts +3 -2
- package/dist/customize/sections/component/channel-connect-hero.js +3 -2
- package/dist/customize/sections/component/channel-hero-frame.d.ts +31 -0
- package/dist/customize/sections/component/channel-hero-frame.js +40 -0
- package/dist/customize/sections/component/channel-mocks.d.ts +6 -0
- package/dist/customize/sections/component/channel-mocks.js +46 -0
- package/dist/customize/sections/component/channel-row.d.ts +13 -3
- package/dist/customize/sections/component/channel-row.js +10 -4
- package/dist/customize/sections/component/email-connect-form.d.ts +27 -0
- package/dist/customize/sections/component/email-connect-form.js +183 -0
- package/dist/customize/sections/component/slack-connect-card.d.ts +7 -0
- package/dist/customize/sections/component/slack-connect-card.js +2 -3
- package/dist/customize/sections/component/teams-connect-card.d.ts +7 -0
- package/dist/customize/sections/component/teams-connect-card.js +2 -3
- package/dist/customize/sections/component/telegram-channel-row.js +16 -25
- package/dist/customize/sections/connectors-view.d.ts +1 -15
- package/dist/customize/sections/connectors-view.js +81 -314
- package/dist/customize/sections/view/agent-editor-catalog.js +5 -0
- package/dist/customize/sections/view/channels-view.d.ts +5 -1
- package/dist/customize/sections/view/channels-view.js +63 -81
- package/dist/customize/sections/view/gateway/gateway-overview.js +10 -2
- package/dist/customize/settings/tabs/experimental-tab.js +35 -16
- package/dist/customize/shared/catalog/catalog-empty-state.d.ts +1 -12
- package/dist/customize/shared/catalog/catalog-empty-state.js +3 -3
- package/dist/customize/shared/channels-switch-dialog.d.ts +18 -0
- package/dist/customize/shared/channels-switch-dialog.js +30 -0
- package/dist/customize/shared/feature-gate-screen.js +27 -9
- package/dist/customize/shared/new-entity-menu.js +4 -1
- package/dist/customize/shared/use-customize-prefetch.d.ts +2 -3
- package/dist/customize/shared/use-customize-prefetch.js +9 -27
- package/dist/customize/skills/skills-page.js +4 -5
- package/dist/customize/triggers/schedule/post-to-field.d.ts +18 -0
- package/dist/customize/triggers/schedule/post-to-field.js +49 -0
- package/dist/customize/triggers/schedule/schedule-copy.d.ts +10 -6
- package/dist/customize/triggers/schedule/schedule-copy.js +42 -11
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +2 -1
- package/dist/customize/triggers/schedule/then-fields.js +1 -5
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +22 -0
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +25 -0
- package/dist/customize/triggers/schedule/trigger-composer.d.ts +5 -0
- package/dist/customize/triggers/schedule/trigger-composer.js +23 -14
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +3 -0
- package/dist/customize/triggers/schedule/trigger-filter.js +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +2 -2
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -0
- package/dist/customize/triggers/schedule/trigger-toast.js +2 -1
- package/dist/customize/triggers/schedule-view.js +9 -4
- package/dist/files/index.d.ts +1 -0
- package/dist/files/index.js +1 -0
- package/dist/files/project/change-request-recovery.d.ts +1 -26
- package/dist/files/project/change-request-recovery.js +1 -59
- package/dist/files/project/components/change-request-detail-dialog.js +13 -3
- package/dist/files/project/components/drive-explorer.js +15 -15
- package/dist/files/project/components/drive-toolbar.d.ts +16 -2
- package/dist/files/project/components/drive-toolbar.js +14 -5
- package/dist/files/project/hooks/use-change-request-recovery.js +3 -19
- package/dist/files/project/hooks/use-change-requests.d.ts +1 -0
- package/dist/files/project/hooks/use-change-requests.js +11 -2
- package/dist/files/renderers/image-frame.d.ts +46 -0
- package/dist/files/renderers/image-frame.js +59 -0
- package/dist/files/renderers/image-renderer.d.ts +11 -1
- package/dist/files/renderers/image-renderer.js +13 -3
- package/dist/files/renderers/pdf/pdf-clipboard.d.ts +2 -0
- package/dist/files/renderers/pdf/pdf-clipboard.js +21 -0
- package/dist/files/renderers/pdf/pdf-viewer.js +4 -2
- package/dist/files/renderers/show-content-renderer.d.ts +9 -1
- package/dist/files/renderers/show-content-renderer.js +56 -14
- package/dist/files/runtime/file-source.js +2 -0
- package/dist/files/runtime/hooks/use-binary-blob.d.ts +10 -1
- package/dist/files/runtime/hooks/use-binary-blob.js +10 -4
- package/dist/files/runtime/hooks/use-shared-image.d.ts +41 -0
- package/dist/files/runtime/hooks/use-shared-image.js +177 -0
- package/dist/files/viewer/file-content-renderer.d.ts +22 -1
- package/dist/files/viewer/file-content-renderer.js +50 -7
- package/dist/files/viewer/file-header.d.ts +7 -3
- package/dist/files/viewer/file-header.js +20 -11
- package/dist/files/viewer/file-preview-modal.d.ts +1 -1
- package/dist/files/viewer/file-preview-modal.js +10 -22
- package/dist/files/viewer/file-source.d.ts +13 -0
- package/dist/files/viewer/use-file-content-state.d.ts +2 -0
- package/dist/files/viewer/use-file-content-state.js +28 -10
- package/dist/files/viewer/viewer-actions.d.ts +3 -1
- package/dist/files/viewer/viewer-actions.js +2 -2
- package/dist/hooks/use-media-query.d.ts +1 -0
- package/dist/hooks/use-mobile.d.ts +5 -0
- package/dist/hooks/use-mobile.js +8 -0
- package/dist/i18n/en.d.ts +906 -70
- package/dist/i18n/en.js +924 -88
- package/dist/i18n/ui-catalog/localize-ui-catalog.js +4 -0
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +15 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/internal/account-hub/account-settings-sidebar.js +1 -1
- package/dist/internal/account-hub/hub-sheet.d.ts +9 -1
- package/dist/internal/account-hub/hub-sheet.js +21 -5
- package/dist/internal/account-hub/sections.d.ts +1 -1
- package/dist/internal/account-hub/sections.js +2 -1
- package/dist/internal/auth/auth-card-shell.js +3 -3
- package/dist/internal/components/agent-mark.d.ts +38 -0
- package/dist/internal/components/agent-mark.js +41 -0
- package/dist/internal/connector-logo/connector-logo-source.d.ts +63 -0
- package/dist/internal/connector-logo/connector-logo-source.js +48 -0
- package/dist/internal/connector-logo/connector-logo.d.ts +39 -0
- package/dist/internal/connector-logo/connector-logo.js +56 -0
- package/dist/internal/connector-logo/connector-mark-files.d.ts +11 -0
- package/dist/internal/connector-logo/connector-mark-files.js +35 -0
- package/dist/internal/files/file-read-retry.d.ts +13 -0
- package/dist/internal/files/file-read-retry.js +23 -3
- package/dist/internal/files/session-drive-files.d.ts +5 -1
- package/dist/internal/files/session-drive-files.js +7 -2
- package/dist/internal/hooks/channels/use-channels-installations.d.ts +32 -5
- package/dist/internal/hooks/channels/use-channels-installations.js +55 -7
- package/dist/internal/hooks/channels/use-email-inboxes.d.ts +19 -0
- package/dist/internal/hooks/channels/use-email-inboxes.js +48 -0
- package/dist/internal/hooks/connectors/use-add-account.js +1 -1
- package/dist/internal/hooks/index.d.ts +1 -1
- package/dist/internal/hooks/index.js +1 -1
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +9 -0
- package/dist/internal/hooks/projects/use-new-project-session.js +28 -12
- package/dist/internal/hooks/use-auto-scroll.d.ts +8 -1
- package/dist/internal/hooks/use-auto-scroll.js +4 -4
- package/dist/internal/icons/telegram.d.ts +5 -0
- package/dist/internal/icons/telegram.js +6 -1
- package/dist/internal/layout/nav-hover-card.d.ts +35 -0
- package/dist/internal/layout/nav-hover-card.js +84 -0
- package/dist/internal/layout/project-nav-row.d.ts +3 -1
- package/dist/internal/layout/project-nav-row.js +3 -2
- package/dist/internal/layout/project-page-header.d.ts +4 -2
- package/dist/internal/layout/project-page-header.js +4 -3
- package/dist/internal/layout/project-settings-nav.js +59 -2
- package/dist/internal/lib/browser-error-noise.d.ts +1 -1
- package/dist/internal/lib/browser-error-noise.js +1 -1
- package/dist/internal/lib/browser-noise/rules/injected-scripts.d.ts +7 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +15 -0
- package/dist/internal/lib/manifest-version.d.ts +1 -1
- package/dist/internal/lib/manifest-version.js +2 -2
- package/dist/internal/lib/memory-href.d.ts +16 -0
- package/dist/internal/lib/memory-href.js +46 -0
- package/dist/internal/lib/pixel-mark.d.ts +33 -0
- package/dist/internal/lib/pixel-mark.js +152 -0
- package/dist/internal/lib/use-project-feature-flags.js +11 -11
- package/dist/internal/lib/utils/heic-convert.d.ts +1 -1
- package/dist/internal/lib/utils/heic-convert.js +3 -4
- package/dist/internal/lib/web-notifications.d.ts +20 -0
- package/dist/internal/lib/web-notifications.js +48 -4
- package/dist/internal/notifications/notification-bell.d.ts +4 -1
- package/dist/internal/notifications/notification-bell.js +2 -2
- package/dist/internal/selection/selection-bar.d.ts +2 -1
- package/dist/internal/selection/selection-bar.js +1 -1
- package/dist/internal/stores/file-preview-store.d.ts +29 -2
- package/dist/internal/stores/file-preview-store.js +19 -1
- package/dist/internal/stores/kortix-computer-store.js +3 -0
- package/dist/internal/stores/sidebar-nav-store.d.ts +1 -1
- package/dist/internal/stores/sidebar-nav-store.js +3 -1
- package/dist/lib/routes.d.ts +13 -1
- package/dist/lib/routes.js +13 -0
- package/dist/markdown/genui/components/inline.d.ts +1 -1
- package/dist/markdown/index.d.ts +2 -1
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/setup-links/approval-decision.d.ts +1 -0
- package/dist/markdown/setup-links/approval-decision.js +6 -2
- package/dist/markdown/setup-links/connector-handshake.d.ts +3 -1
- package/dist/markdown/setup-links/connector-handshake.js +12 -10
- package/dist/markdown/setup-links/show-connect-hero.d.ts +28 -0
- package/dist/markdown/setup-links/show-connect-hero.js +91 -0
- package/dist/markdown/unified-markdown.js +5 -5
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/badge.js +2 -0
- package/dist/primitives/disclosure.js +14 -2
- package/dist/primitives/empty-art.d.ts +12 -0
- package/dist/primitives/empty-art.js +11 -0
- package/dist/primitives/entity-avatar.d.ts +4 -1
- package/dist/primitives/entity-avatar.js +4 -2
- package/dist/primitives/mermaid-renderer.d.ts +2 -0
- package/dist/primitives/mermaid-renderer.js +21 -15
- package/dist/primitives/resizable.js +6 -1
- package/dist/primitives/resize-seam.d.ts +11 -0
- package/dist/primitives/resize-seam.js +12 -0
- package/dist/primitives/sidebar-panel.js +4 -7
- package/dist/primitives/tabs.d.ts +14 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/user-avatar.d.ts +3 -1
- package/dist/primitives/user-avatar.js +4 -2
- package/dist/providers/ui-provider.d.ts +10 -1
- package/dist/session/composer/ComposerAboveCard.d.ts +1 -1
- package/dist/session/composer/ComposerAboveCard.js +2 -2
- package/dist/session/composer/ComposerCard.d.ts +1 -1
- package/dist/session/composer/ComposerCard.js +3 -3
- package/dist/session/composer/agent-selector.d.ts +19 -1
- package/dist/session/composer/agent-selector.js +42 -12
- package/dist/session/composer/composer-agent-access.d.ts +15 -0
- package/dist/session/composer/composer-agent-access.js +27 -0
- package/dist/session/composer/composer-chat-input.d.ts +8 -2
- package/dist/session/composer/composer-chat-input.js +8 -6
- package/dist/session/composer/composer-logic.d.ts +16 -0
- package/dist/session/composer/composer-logic.js +12 -0
- package/dist/session/composer/composer-underbar.d.ts +3 -1
- package/dist/session/composer/composer-underbar.js +4 -3
- package/dist/session/composer/composer.d.ts +15 -1
- package/dist/session/composer/composer.js +19 -1
- package/dist/session/composer/context-usage.d.ts +5 -0
- package/dist/session/composer/context-usage.js +6 -1
- package/dist/session/composer/draft/composer-draft.d.ts +6 -2
- package/dist/session/composer/draft/composer-draft.js +5 -1
- package/dist/session/composer/reasoning-effort-selector.js +1 -1
- package/dist/session/composer/token-progress.js +4 -4
- package/dist/session/header/export-transcript-modal.d.ts +3 -2
- package/dist/session/header/export-transcript-modal.js +6 -3
- package/dist/session/models/chatgpt-connection-button.d.ts +11 -0
- package/dist/session/models/chatgpt-connection-button.js +54 -0
- package/dist/session/models/model-selector.d.ts +3 -1
- package/dist/session/models/model-selector.js +7 -3
- package/dist/session/models/use-model-connection-gate.d.ts +5 -5
- package/dist/session/models/use-model-connection-gate.js +5 -5
- package/dist/session/outcomes/jump-to-outcome.d.ts +10 -0
- package/dist/session/outcomes/jump-to-outcome.js +11 -0
- package/dist/session/outcomes/session-outcomes-bridge.d.ts +14 -0
- package/dist/session/outcomes/session-outcomes-bridge.js +12 -0
- package/dist/session/outcomes/session-outcomes-provider.d.ts +3 -1
- package/dist/session/outcomes/session-outcomes-provider.js +33 -3
- package/dist/session/panel/easy/app-preview.d.ts +10 -0
- package/dist/session/panel/easy/app-preview.js +31 -12
- package/dist/session/panel/easy/change-requests-card.d.ts +7 -0
- package/dist/session/panel/easy/change-requests-card.js +17 -0
- package/dist/session/panel/easy/easy-panel-logic.js +7 -1
- package/dist/session/panel/easy/easy-panel.js +5 -2
- package/dist/session/panel/easy/file-preview.js +1 -1
- package/dist/session/panel/easy/outputs-card.d.ts +2 -1
- package/dist/session/panel/easy/outputs-card.js +3 -2
- package/dist/session/panel/easy/plan-card.d.ts +2 -0
- package/dist/session/panel/easy/plan-card.js +2 -0
- package/dist/session/panel/mobile-tool-drawer.js +7 -1
- package/dist/session/panel/session-audit-panel.js +9 -2
- package/dist/session/panel/session-detail-panel.js +9 -3
- package/dist/session/panel/session-files-explorer.d.ts +9 -0
- package/dist/session/panel/session-files-explorer.js +12 -3
- package/dist/session/panel/session-panel-provider.d.ts +15 -1
- package/dist/session/panel/session-panel-provider.js +32 -7
- package/dist/session/panel/shared/derive-panels.d.ts +8 -1
- package/dist/session/panel/shared/derive-panels.js +12 -2
- package/dist/session/panel/shared/output-priority.js +2 -0
- package/dist/session/participants/session-participants.d.ts +5 -1
- package/dist/session/participants/session-participants.js +9 -2
- package/dist/session/prompts/approval-request.d.ts +5 -0
- package/dist/session/prompts/approval-request.js +7 -1
- package/dist/session/prompts/session-approval-review.d.ts +9 -0
- package/dist/session/prompts/session-approval-review.js +18 -0
- package/dist/session/status/session-error-banner.js +2 -49
- package/dist/session/status/session-starting-loader.d.ts +14 -2
- package/dist/session/status/session-starting-loader.js +16 -4
- package/dist/session/thread/after-first-prompt.d.ts +7 -0
- package/dist/session/thread/after-first-prompt.js +8 -0
- package/dist/session/thread/detect-command.d.ts +12 -0
- package/dist/session/thread/detect-command.js +20 -0
- package/dist/session/thread/plan-surface.d.ts +1 -0
- package/dist/session/thread/plan-surface.js +1 -0
- package/dist/session/thread/session-chat.d.ts +3 -1
- package/dist/session/thread/session-chat.js +377 -252
- package/dist/session/thread/session-context-metrics.d.ts +15 -0
- package/dist/session/thread/session-context-metrics.js +10 -1
- package/dist/session/thread/session-context-modal.d.ts +4 -2
- package/dist/session/thread/session-context-modal.js +16 -9
- package/dist/session/thread/session-thread.d.ts +3 -1
- package/dist/session/thread/session-thread.js +9 -2
- package/dist/session/thread/thread-boot-rows.d.ts +36 -0
- package/dist/session/thread/thread-boot-rows.js +89 -0
- package/dist/session/thread/transcript-rows.d.ts +31 -0
- package/dist/session/thread/transcript-rows.js +3 -0
- package/dist/session/thread/transcript.d.ts +4 -9
- package/dist/session/thread/transcript.js +119 -21
- package/dist/session/thread/turn-share.d.ts +16 -0
- package/dist/session/thread/turn-share.js +162 -0
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +28 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +31 -3
- package/dist/session/tool/tool-part-renderer.d.ts +5 -4
- package/dist/session/tool/tool-part-renderer.js +8 -3
- package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -0
- package/dist/session/tool/tools/apply-patch-tool.js +1 -0
- package/dist/session/tool/tools/bash-tool.js +7 -6
- package/dist/session/tool/tools/channel-send-card.d.ts +1 -2
- package/dist/session/tool/tools/channel-send.d.ts +2 -1
- package/dist/session/tool/tools/codemode-tool.js +1 -1
- package/dist/session/tool/tools/connector-tools.js +1 -1
- package/dist/session/tool/tools/image-gen-tool.d.ts +1 -1
- package/dist/session/tool/tools/image-gen-tool.js +240 -53
- package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -0
- package/dist/session/tool/tools/pty-kill-tool.js +1 -0
- package/dist/session/tool/tools/pty-read-tool.d.ts +2 -0
- package/dist/session/tool/tools/pty-read-tool.js +2 -0
- package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -0
- package/dist/session/tool/tools/pty-spawn-tool.js +1 -0
- package/dist/session/tool/tools/pty-write-tool.d.ts +1 -0
- package/dist/session/tool/tools/pty-write-tool.js +1 -0
- package/dist/session/tool/tools/show-tool.js +19 -8
- package/dist/session/tool/tools/todo-write-tool.d.ts +1 -0
- package/dist/session/tool/tools/todo-write-tool.js +1 -0
- package/dist/session/turn/channel-brand.d.ts +8 -3
- package/dist/session/turn/channel-brand.js +20 -4
- package/dist/session/turn/message-author-label.js +6 -2
- package/dist/session/turn/message-author.d.ts +8 -0
- package/dist/session/turn/message-author.js +24 -0
- package/dist/session/turn/message-row.d.ts +52 -0
- package/dist/session/turn/message-row.js +44 -0
- package/dist/session/turn/plan-anchor.d.ts +4 -1
- package/dist/session/turn/plan-anchor.js +4 -1
- package/dist/session/turn/plan-card.d.ts +7 -0
- package/dist/session/turn/plan-card.js +7 -0
- package/dist/session/turn/user-message.d.ts +7 -1
- package/dist/session/turn/user-message.js +21 -7
- package/dist/styles.css +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +2 -1
- package/dist/workspace/home/access-requests-bell.d.ts +9 -2
- package/dist/workspace/home/access-requests-bell.js +20 -6
- package/dist/workspace/home/first-chat.d.ts +8 -21
- package/dist/workspace/home/first-chat.js +22 -72
- package/dist/workspace/index.d.ts +6 -0
- package/dist/workspace/index.js +6 -0
- package/dist/workspace/layout/project-home.d.ts +14 -2
- package/dist/workspace/layout/project-home.js +60 -21
- package/dist/workspace/layout/use-project-home-send.d.ts +9 -1
- package/dist/workspace/layout/use-project-home-send.js +82 -3
- package/dist/workspace/memory/body-doc.d.ts +17 -0
- package/dist/workspace/memory/body-doc.js +208 -0
- package/dist/workspace/memory/body-extensions.d.ts +38 -0
- package/dist/workspace/memory/body-extensions.js +103 -0
- package/dist/workspace/memory/company-memory-page.d.ts +8 -0
- package/dist/workspace/memory/company-memory-page.js +16 -0
- package/dist/workspace/memory/memory-all.d.ts +20 -0
- package/dist/workspace/memory/memory-all.js +27 -0
- package/dist/workspace/memory/memory-body.d.ts +19 -0
- package/dist/workspace/memory/memory-body.js +139 -0
- package/dist/workspace/memory/memory-empty.d.ts +13 -0
- package/dist/workspace/memory/memory-empty.js +28 -0
- package/dist/workspace/memory/memory-history.d.ts +27 -0
- package/dist/workspace/memory/memory-history.js +108 -0
- package/dist/workspace/memory/memory-labels.d.ts +16 -0
- package/dist/workspace/memory/memory-labels.js +47 -0
- package/dist/workspace/memory/memory-page-list.d.ts +34 -0
- package/dist/workspace/memory/memory-page-list.js +156 -0
- package/dist/workspace/memory/memory-reader.d.ts +58 -0
- package/dist/workspace/memory/memory-reader.js +123 -0
- package/dist/workspace/memory/memory-view.d.ts +21 -0
- package/dist/workspace/memory/memory-view.js +124 -0
- package/dist/workspace/memory/remember-popover.d.ts +19 -0
- package/dist/workspace/memory/remember-popover.js +61 -0
- package/dist/workspace/memory/remember-this.d.ts +12 -0
- package/dist/workspace/memory/remember-this.js +89 -0
- package/dist/workspace/memory/source-mark.d.ts +18 -0
- package/dist/workspace/memory/source-mark.js +79 -0
- package/dist/workspace/memory/used-memory-chip.d.ts +14 -0
- package/dist/workspace/memory/used-memory-chip.js +61 -0
- package/dist/workspace/new/advanced-fields.d.ts +2 -1
- package/dist/workspace/new/advanced-fields.js +2 -2
- package/dist/workspace/new/source-param.d.ts +1 -1
- package/dist/workspace/new/source-param.js +3 -1
- package/dist/workspace/new/use-create-workspace.d.ts +8 -10
- package/dist/workspace/new/use-create-workspace.js +3 -3
- package/dist/workspace/projects/onboarding/app-logo.d.ts +7 -2
- package/dist/workspace/projects/onboarding/app-logo.js +6 -13
- package/dist/workspace/projects/policies-panel.js +5 -3
- package/dist/workspace/review/review-actions.d.ts +4 -2
- package/dist/workspace/review/review-actions.js +8 -2
- package/dist/workspace/review/review-center.js +11 -7
- package/dist/workspace/review/review-detail.d.ts +10 -0
- package/dist/workspace/review/review-detail.js +101 -13
- package/dist/workspace/saved-session-skeleton.d.ts +2 -2
- package/dist/workspace/saved-session-skeleton.js +3 -3
- package/dist/workspace/session-workspace.js +15 -13
- package/dist/workspace/sessions/project-sessions-view.js +3 -2
- package/dist/workspace/sessions/sessions-toolbar.d.ts +3 -1
- package/dist/workspace/sessions/sessions-toolbar.js +2 -2
- package/dist/workspace/sidebar/footer/project-apps-nav.d.ts +5 -0
- package/dist/workspace/sidebar/footer/project-apps-nav.js +41 -2
- package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +22 -0
- package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.js +13 -13
- package/dist/workspace/sidebar/footer/project-memory-nav.d.ts +7 -0
- package/dist/workspace/sidebar/footer/project-memory-nav.js +19 -0
- package/dist/workspace/sidebar/nav-row-meta.js +14 -2
- package/dist/workspace/sidebar/project-nav-items.js +3 -0
- package/dist/workspace/sidebar/project-session-list.js +68 -56
- package/dist/workspace/sidebar/project-sidebar.js +9 -2
- package/dist/workspace/sidebar/project-spaces-nav.d.ts +8 -0
- package/dist/workspace/sidebar/project-spaces-nav.js +69 -0
- package/dist/workspace/sidebar/session-brief-hover-card.js +28 -1
- package/dist/workspace/sidebar/session-group-order.d.ts +9 -0
- package/dist/workspace/sidebar/session-group-order.js +25 -0
- package/dist/workspace/sidebar/session-group-sections.d.ts +62 -0
- package/dist/workspace/sidebar/session-group-sections.js +267 -0
- package/dist/workspace/sidebar/session-list-chrome.d.ts +28 -0
- package/dist/workspace/sidebar/session-list-chrome.js +50 -0
- package/dist/workspace/spaces/channel-glyph.d.ts +5 -0
- package/dist/workspace/spaces/channel-glyph.js +6 -0
- package/dist/workspace/spaces/channel-setup.d.ts +16 -0
- package/dist/workspace/spaces/channel-setup.js +105 -0
- package/dist/workspace/spaces/channels-onboarding.d.ts +13 -0
- package/dist/workspace/spaces/channels-onboarding.js +37 -0
- package/dist/workspace/spaces/create-channel-dialog.d.ts +16 -0
- package/dist/workspace/spaces/create-channel-dialog.js +158 -0
- package/dist/workspace/spaces/private-channels-not-in.d.ts +9 -0
- package/dist/workspace/spaces/private-channels-not-in.js +69 -0
- package/dist/workspace/spaces/space-agents.d.ts +10 -0
- package/dist/workspace/spaces/space-agents.js +10 -0
- package/dist/workspace/spaces/space-details-dialog.d.ts +20 -0
- package/dist/workspace/spaces/space-details-dialog.js +176 -0
- package/dist/workspace/spaces/space-link-label.d.ts +49 -0
- package/dist/workspace/spaces/space-link-label.js +73 -0
- package/dist/workspace/spaces/space-links.d.ts +19 -0
- package/dist/workspace/spaces/space-links.js +230 -0
- package/dist/workspace/spaces/space-members.d.ts +46 -0
- package/dist/workspace/spaces/space-members.js +182 -0
- package/dist/workspace/spaces/space-roster.d.ts +15 -0
- package/dist/workspace/spaces/space-roster.js +44 -0
- package/dist/workspace/spaces/space-threads-tab.d.ts +56 -0
- package/dist/workspace/spaces/space-threads-tab.js +156 -0
- package/dist/workspace/spaces/space-timeline-view.d.ts +254 -0
- package/dist/workspace/spaces/space-timeline-view.js +235 -0
- package/dist/workspace/spaces/space-timeline.d.ts +106 -0
- package/dist/workspace/spaces/space-timeline.js +183 -0
- package/dist/workspace/spaces/space-triggers.d.ts +13 -0
- package/dist/workspace/spaces/space-triggers.js +78 -0
- package/dist/workspace/spaces/space-view.d.ts +37 -0
- package/dist/workspace/spaces/space-view.js +436 -0
- package/package.json +31 -32
- package/skills/kortix-ui/SKILL.md +3 -3
- package/skills/kortix-ui/references/custom-dashboard.md +3 -3
- package/skills/kortix-ui/references/modules.md +28 -4
- package/skills/kortix-ui/references/theming.md +1 -1
- package/dist/customize/agents/agent-nav.prototype.d.ts +0 -35
- package/dist/customize/agents/agent-nav.prototype.js +0 -95
- package/dist/customize/connectors/catalog/merge-search.d.ts +0 -10
- package/dist/customize/connectors/catalog/merge-search.js +0 -26
- package/dist/customize/connectors/detail/find-easy-connect-app.d.ts +0 -29
- package/dist/customize/connectors/detail/find-easy-connect-app.js +0 -22
- package/dist/customize/migrate-to-v2/use-migrate-to-v2.d.ts +0 -9
- package/dist/customize/migrate-to-v2/use-migrate-to-v2.js +0 -24
- package/dist/customize/sections/connector-connection-header.d.ts +0 -36
- package/dist/customize/sections/connector-connection-header.js +0 -33
- package/dist/customize/sections/connector-connection-modal.d.ts +0 -34
- package/dist/customize/sections/connector-connection-modal.js +0 -72
- package/dist/customize/sections/discover-catalogue-card.d.ts +0 -19
- package/dist/customize/sections/discover-catalogue-card.js +0 -26
- package/dist/customize/sections/discover-catalogue-detail.d.ts +0 -15
- package/dist/customize/sections/discover-catalogue-detail.js +0 -24
- package/dist/customize/sections/discover-catalogue.d.ts +0 -17
- package/dist/customize/sections/discover-catalogue.js +0 -132
- package/dist/customize/sections/llm-provider/provider-access-menu.d.ts +0 -10
- package/dist/customize/sections/llm-provider/provider-access-menu.js +0 -23
- package/dist/files/project/components/drive-empty-art.d.ts +0 -2
- package/dist/files/project/components/drive-empty-art.js +0 -5
- package/dist/internal/hooks/use-media-query.d.ts +0 -2
- package/dist/internal/share/public-share-link-button.d.ts +0 -14
- package/dist/internal/share/public-share-link-button.js +0 -17
- /package/dist/{internal/hooks → hooks}/use-media-query.js +0 -0
|
@@ -38,12 +38,17 @@ export function resolveSessionDriveFile(filePath, mounts) {
|
|
|
38
38
|
return { driveId: best.driveId, path: `${stripTrailingSlashes(best.subdir)}${rest}` || '/' };
|
|
39
39
|
}
|
|
40
40
|
let scope = null;
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Make `next` the session drive paths resolve against; returns its undo. The
|
|
43
|
+
* undo restores the scope it replaced: a review item's files open over a
|
|
44
|
+
* session page, and closing them must not drop that page's scope.
|
|
45
|
+
*/
|
|
42
46
|
export function setSessionDriveFilesScope(next) {
|
|
47
|
+
const previous = scope;
|
|
43
48
|
scope = next;
|
|
44
49
|
return () => {
|
|
45
50
|
if (scope === next)
|
|
46
|
-
scope =
|
|
51
|
+
scope = previous;
|
|
47
52
|
};
|
|
48
53
|
}
|
|
49
54
|
/** Make the open session's mounts the ones drive paths resolve against. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
-
import { type EmailInstallation, type EmailMode, type EmailSenderPolicy, type SlackInstallation, type SlackMode, type ConnectTelegramInput, type TelegramInstallation } from '@kortix/sdk';
|
|
3
|
-
export type { EmailInstallation, EmailMode, EmailSenderPolicy, SlackInstallation, SlackMode, TelegramInstallation };
|
|
2
|
+
import { type EmailDomain, type EmailDomainList, type EmailDomainResult, type EmailInstallation, type EmailMode, type EmailSenderPolicy, type SlackInstallation, type SlackMode, type ConnectTelegramInput, type TelegramInstallation, type ChannelAccessList, type ChannelAccessPlatform, type ChannelUser } from '@kortix/sdk';
|
|
3
|
+
export type { EmailDomain, EmailDomainList, EmailDomainResult, EmailInstallation, EmailMode, EmailSenderPolicy, SlackInstallation, SlackMode, TelegramInstallation, ChannelAccessPlatform, ChannelUser, };
|
|
4
4
|
export declare function useSlackInstall(projectId: string | null): import("@tanstack/react-query").UseQueryResult<SlackInstallation | null, Error>;
|
|
5
5
|
interface ConnectInput {
|
|
6
6
|
projectId: string;
|
|
@@ -25,6 +25,21 @@ interface ConnectEmailInput {
|
|
|
25
25
|
sender_policy?: EmailSenderPolicy;
|
|
26
26
|
}
|
|
27
27
|
export declare function useConnectEmail(): import("@tanstack/react-query").UseMutationResult<EmailInstallation, Error, ConnectEmailInput, unknown>;
|
|
28
|
+
/** The domains an own Resend API key can create inboxes on. A mutation: it runs when the user enters a key. */
|
|
29
|
+
export declare function useListEmailDomains(): import("@tanstack/react-query").UseMutationResult<EmailDomainList, Error, {
|
|
30
|
+
projectId: string;
|
|
31
|
+
apiKey: string;
|
|
32
|
+
}, unknown>;
|
|
33
|
+
export declare function useAddEmailDomain(): import("@tanstack/react-query").UseMutationResult<EmailDomainResult, Error, {
|
|
34
|
+
projectId: string;
|
|
35
|
+
apiKey: string;
|
|
36
|
+
domain: string;
|
|
37
|
+
}, unknown>;
|
|
38
|
+
export declare function useVerifyEmailDomain(): import("@tanstack/react-query").UseMutationResult<EmailDomainResult, Error, {
|
|
39
|
+
projectId: string;
|
|
40
|
+
apiKey: string;
|
|
41
|
+
domainId: string;
|
|
42
|
+
}, unknown>;
|
|
28
43
|
export declare function useDisconnectEmail(): import("@tanstack/react-query").UseMutationResult<{
|
|
29
44
|
projectId: string;
|
|
30
45
|
connectorSlug: string | null | undefined;
|
|
@@ -37,13 +52,25 @@ export declare function useUpdateEmailPolicy(): import("@tanstack/react-query").
|
|
|
37
52
|
connectorSlug?: string | null;
|
|
38
53
|
sender_policy: EmailSenderPolicy;
|
|
39
54
|
}, unknown>;
|
|
40
|
-
/** The project's Telegram bot
|
|
55
|
+
/** The project's Telegram bot. Pass null to keep the query off. */
|
|
41
56
|
export declare function useTelegramInstall(projectId: string | null): import("@tanstack/react-query").UseQueryResult<TelegramInstallation | null, Error>;
|
|
42
57
|
export declare function useConnectTelegram(): import("@tanstack/react-query").UseMutationResult<TelegramInstallation, Error, {
|
|
43
58
|
projectId: string;
|
|
44
59
|
} & ConnectTelegramInput, unknown>;
|
|
45
|
-
|
|
60
|
+
/** Allowed users and access requests, with their names on the platform. Each fetch can call the platform, so enable it only on demand. */
|
|
61
|
+
export declare function useChannelUsers(projectId: string, platform: ChannelAccessPlatform, enabled: boolean): import("@tanstack/react-query").UseQueryResult<import("@kortix/sdk").ChannelUsers, Error>;
|
|
62
|
+
/** One user's profile photo. Off without a `version`: that user has no photo. */
|
|
63
|
+
export declare function useChannelUserPhoto(projectId: string, platform: ChannelAccessPlatform, userId: string, version: string | null, enabled: boolean): import("@tanstack/react-query").UseQueryResult<Blob | null, Error>;
|
|
64
|
+
export declare const useAllowChannelUser: (platform: ChannelAccessPlatform) => import("@tanstack/react-query").UseMutationResult<ChannelAccessList, Error, {
|
|
65
|
+
projectId: string;
|
|
66
|
+
userId: string;
|
|
67
|
+
}, unknown>;
|
|
68
|
+
export declare const useRemoveChannelUser: (platform: ChannelAccessPlatform) => import("@tanstack/react-query").UseMutationResult<ChannelAccessList, Error, {
|
|
69
|
+
projectId: string;
|
|
70
|
+
userId: string;
|
|
71
|
+
}, unknown>;
|
|
72
|
+
export declare const useDismissChannelAccessRequest: (platform: ChannelAccessPlatform) => import("@tanstack/react-query").UseMutationResult<ChannelAccessList, Error, {
|
|
46
73
|
projectId: string;
|
|
47
|
-
|
|
74
|
+
userId: string;
|
|
48
75
|
}, unknown>;
|
|
49
76
|
export declare function useDisconnectTelegram(): import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { connectEmail, connectSlack, connectTelegram, disconnectEmail, disconnectSlack, disconnectTelegram, getEmailInstallation, getEmailMode, getSlackInstallation, getSlackManifest, getSlackMode, getTelegramInstallation,
|
|
2
|
+
import { addEmailDomain, connectEmail, listEmailDomains, verifyEmailDomain, connectSlack, connectTelegram, disconnectEmail, disconnectSlack, disconnectTelegram, getEmailInstallation, getEmailMode, getSlackInstallation, getSlackManifest, getSlackMode, getTelegramInstallation, getChannelUserPhoto, listChannelUsers, allowChannelUser, removeChannelUser, dismissChannelAccessRequest, updateEmailPolicy, } from '@kortix/sdk';
|
|
3
3
|
import { qk } from '@kortix/sdk/react';
|
|
4
4
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
5
5
|
const key = (projectId) => ['channels', 'slack-install', projectId ?? 'none'];
|
|
@@ -73,7 +73,7 @@ export function useEmailMode(projectId) {
|
|
|
73
73
|
staleTime: 60_000,
|
|
74
74
|
queryFn: () => projectId
|
|
75
75
|
? getEmailMode(projectId)
|
|
76
|
-
: { provider: '
|
|
76
|
+
: { provider: 'resend', managed_available: false },
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
export function useConnectEmail() {
|
|
@@ -87,6 +87,22 @@ export function useConnectEmail() {
|
|
|
87
87
|
},
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
+
/** The domains an own Resend API key can create inboxes on. A mutation: it runs when the user enters a key. */
|
|
91
|
+
export function useListEmailDomains() {
|
|
92
|
+
return useMutation({
|
|
93
|
+
mutationFn: ({ projectId, apiKey }) => listEmailDomains(projectId, { apiKey }),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
export function useAddEmailDomain() {
|
|
97
|
+
return useMutation({
|
|
98
|
+
mutationFn: ({ projectId, apiKey, domain }) => addEmailDomain(projectId, { apiKey, domain }),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
export function useVerifyEmailDomain() {
|
|
102
|
+
return useMutation({
|
|
103
|
+
mutationFn: ({ projectId, apiKey, domainId }) => verifyEmailDomain(projectId, { apiKey, domainId }),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
90
106
|
export function useDisconnectEmail() {
|
|
91
107
|
const qc = useQueryClient();
|
|
92
108
|
return useMutation({
|
|
@@ -112,8 +128,11 @@ export function useUpdateEmailPolicy() {
|
|
|
112
128
|
},
|
|
113
129
|
});
|
|
114
130
|
}
|
|
115
|
-
const
|
|
116
|
-
|
|
131
|
+
const installKey = (platform, projectId) => ['channels', `${platform}-install`, projectId ?? 'none'];
|
|
132
|
+
const usersKey = (platform, projectId) => ['channels', `${platform}-users`, projectId];
|
|
133
|
+
const telegramKey = (projectId) => installKey('telegram', projectId);
|
|
134
|
+
const telegramUsersKey = (projectId) => usersKey('telegram', projectId);
|
|
135
|
+
/** The project's Telegram bot. Pass null to keep the query off. */
|
|
117
136
|
export function useTelegramInstall(projectId) {
|
|
118
137
|
return useQuery({
|
|
119
138
|
queryKey: telegramKey(projectId),
|
|
@@ -128,23 +147,52 @@ export function useConnectTelegram() {
|
|
|
128
147
|
mutationFn: ({ projectId, ...body }) => connectTelegram(projectId, body),
|
|
129
148
|
onSuccess: (_data, { projectId }) => {
|
|
130
149
|
qc.invalidateQueries({ queryKey: telegramKey(projectId) });
|
|
150
|
+
// Another bot sees other users: never show the old bot's list.
|
|
151
|
+
qc.removeQueries({ queryKey: telegramUsersKey(projectId) });
|
|
131
152
|
qc.invalidateQueries({ queryKey: qk.project.connectors(projectId) });
|
|
132
153
|
},
|
|
133
154
|
});
|
|
134
155
|
}
|
|
135
|
-
|
|
156
|
+
/** Allowed users and access requests, with their names on the platform. Each fetch can call the platform, so enable it only on demand. */
|
|
157
|
+
export function useChannelUsers(projectId, platform, enabled) {
|
|
158
|
+
return useQuery({
|
|
159
|
+
queryKey: usersKey(platform, projectId),
|
|
160
|
+
enabled,
|
|
161
|
+
queryFn: () => listChannelUsers(projectId, platform),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/** One user's profile photo. Off without a `version`: that user has no photo. */
|
|
165
|
+
export function useChannelUserPhoto(projectId, platform, userId, version, enabled) {
|
|
166
|
+
return useQuery({
|
|
167
|
+
queryKey: ['channels', `${platform}-photo`, projectId, userId, version],
|
|
168
|
+
enabled: enabled && !!version,
|
|
169
|
+
// The version is in the key: a new photo is a new key.
|
|
170
|
+
staleTime: Infinity,
|
|
171
|
+
retry: false,
|
|
172
|
+
queryFn: ({ signal }) => getChannelUserPhoto(projectId, platform, userId, version, signal),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function useChannelUserMutation(platform, action) {
|
|
136
176
|
const qc = useQueryClient();
|
|
137
177
|
return useMutation({
|
|
138
|
-
mutationFn: ({ projectId,
|
|
139
|
-
|
|
178
|
+
mutationFn: ({ projectId, userId }) => action(projectId, platform, userId),
|
|
179
|
+
// Returned so the mutation stays pending until the list shows the change.
|
|
180
|
+
onSuccess: (_data, { projectId }) => Promise.all([
|
|
181
|
+
qc.invalidateQueries({ queryKey: installKey(platform, projectId) }),
|
|
182
|
+
qc.invalidateQueries({ queryKey: usersKey(platform, projectId) }),
|
|
183
|
+
]),
|
|
140
184
|
});
|
|
141
185
|
}
|
|
186
|
+
export const useAllowChannelUser = (platform) => useChannelUserMutation(platform, allowChannelUser);
|
|
187
|
+
export const useRemoveChannelUser = (platform) => useChannelUserMutation(platform, removeChannelUser);
|
|
188
|
+
export const useDismissChannelAccessRequest = (platform) => useChannelUserMutation(platform, dismissChannelAccessRequest);
|
|
142
189
|
export function useDisconnectTelegram() {
|
|
143
190
|
const qc = useQueryClient();
|
|
144
191
|
return useMutation({
|
|
145
192
|
mutationFn: (projectId) => disconnectTelegram(projectId),
|
|
146
193
|
onSuccess: (_data, projectId) => {
|
|
147
194
|
qc.invalidateQueries({ queryKey: telegramKey(projectId) });
|
|
195
|
+
qc.removeQueries({ queryKey: telegramUsersKey(projectId) });
|
|
148
196
|
qc.invalidateQueries({ queryKey: qk.project.connectors(projectId) });
|
|
149
197
|
},
|
|
150
198
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
+
import { type AddEmailInboxInput, type EmailInbox, type EmailSenderPolicy } from '@kortix/sdk';
|
|
3
|
+
export type { AddEmailInboxInput, EmailInbox };
|
|
4
|
+
/** The inboxes the viewer can use. Pass null to keep the query off (flag off). */
|
|
5
|
+
export declare function useEmailInboxes(projectId: string | null): import("@tanstack/react-query").UseQueryResult<EmailInbox[], Error>;
|
|
6
|
+
export declare function useAddEmailInbox(): import("@tanstack/react-query").UseMutationResult<EmailInbox, Error, AddEmailInboxInput & {
|
|
7
|
+
projectId: string;
|
|
8
|
+
}, unknown>;
|
|
9
|
+
export declare function useUpdateEmailInbox(): import("@tanstack/react-query").UseMutationResult<EmailInbox, Error, {
|
|
10
|
+
projectId: string;
|
|
11
|
+
connectionId: string;
|
|
12
|
+
sender_policy?: EmailSenderPolicy;
|
|
13
|
+
display_name?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
}, unknown>;
|
|
16
|
+
export declare function useRemoveEmailInbox(): import("@tanstack/react-query").UseMutationResult<import("@kortix/sdk").RemoveEmailInboxResult, Error, {
|
|
17
|
+
projectId: string;
|
|
18
|
+
connectionId: string;
|
|
19
|
+
}, unknown>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { addEmailInbox, listEmailInboxes, removeEmailInbox, updateEmailInbox, } from '@kortix/sdk';
|
|
3
|
+
import { qk } from '@kortix/sdk/react';
|
|
4
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
5
|
+
/**
|
|
6
|
+
* The project's email inboxes. Each inbox is one ACCOUNT on the `kortix_email`
|
|
7
|
+
* connector profile, so the standard account surfaces (default, who can use
|
|
8
|
+
* it) apply to it; these hooks add what only email has: the Resend inbox
|
|
9
|
+
* behind the account, its address and who may email it.
|
|
10
|
+
*/
|
|
11
|
+
const inboxesKey = (projectId) => ['channels', 'email-inboxes', projectId ?? 'none'];
|
|
12
|
+
/** Everything that shows an inbox: the inbox list, the account list, the connector page. */
|
|
13
|
+
function refreshInboxViews(qc, projectId) {
|
|
14
|
+
void qc.invalidateQueries({ queryKey: inboxesKey(projectId) });
|
|
15
|
+
void qc.invalidateQueries({ queryKey: ['connections', projectId] });
|
|
16
|
+
void qc.invalidateQueries({ queryKey: qk.project.connectors(projectId) });
|
|
17
|
+
void qc.invalidateQueries({ queryKey: ['channels', 'email-install'] });
|
|
18
|
+
}
|
|
19
|
+
/** The inboxes the viewer can use. Pass null to keep the query off (flag off). */
|
|
20
|
+
export function useEmailInboxes(projectId) {
|
|
21
|
+
return useQuery({
|
|
22
|
+
queryKey: inboxesKey(projectId),
|
|
23
|
+
enabled: !!projectId,
|
|
24
|
+
staleTime: 30_000,
|
|
25
|
+
queryFn: async () => (projectId ? listEmailInboxes(projectId) : []),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export function useAddEmailInbox() {
|
|
29
|
+
const qc = useQueryClient();
|
|
30
|
+
return useMutation({
|
|
31
|
+
mutationFn: ({ projectId, ...input }) => addEmailInbox(projectId, input),
|
|
32
|
+
onSuccess: (_inbox, { projectId }) => refreshInboxViews(qc, projectId),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export function useUpdateEmailInbox() {
|
|
36
|
+
const qc = useQueryClient();
|
|
37
|
+
return useMutation({
|
|
38
|
+
mutationFn: ({ projectId, connectionId, ...patch }) => updateEmailInbox(projectId, connectionId, patch),
|
|
39
|
+
onSuccess: (_inbox, { projectId }) => refreshInboxViews(qc, projectId),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function useRemoveEmailInbox() {
|
|
43
|
+
const qc = useQueryClient();
|
|
44
|
+
return useMutation({
|
|
45
|
+
mutationFn: ({ projectId, connectionId }) => removeEmailInbox(projectId, connectionId),
|
|
46
|
+
onSuccess: (_result, { projectId }) => refreshInboxViews(qc, projectId),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
@@ -33,7 +33,7 @@ export function useAddAccount({ projectId, connector, displayName, onAdded, onCr
|
|
|
33
33
|
queryFn: () => listConnections(projectId),
|
|
34
34
|
staleTime: 30_000,
|
|
35
35
|
// A channel connector has no accounts: same guard as `useConnectorDetail`.
|
|
36
|
-
enabled: connector.provider !== 'channel',
|
|
36
|
+
enabled: connector.provider !== 'channel' || connector.platform === 'email',
|
|
37
37
|
});
|
|
38
38
|
const addManaged = useAddManagedAccount(projectId, connector.slug, accountId, onAdded);
|
|
39
39
|
// Direct providers: create the account, narrow it before it holds a
|
|
@@ -40,6 +40,9 @@ import { type PendingSessionPrompt, type SessionConnectorBindingsInput } from '@
|
|
|
40
40
|
*/
|
|
41
41
|
/**
|
|
42
42
|
* Options for a new-session start.
|
|
43
|
+
* `create.space_id` files the session in a channel or DM (`project_channels`).
|
|
44
|
+
* It never claims a warm session, shows no toast, and does not navigate: the
|
|
45
|
+
* space view stays and `onNavigate(sessionId)` opens the thread beside it.
|
|
43
46
|
* `agent_name` chooses the session's boot agent. Later prompts can name another
|
|
44
47
|
* agent; the API re-scopes its grants before forwarding the prompt.
|
|
45
48
|
* `connector_bindings` binds specific connections; `inherit_unbound`
|
|
@@ -52,11 +55,17 @@ import { type PendingSessionPrompt, type SessionConnectorBindingsInput } from '@
|
|
|
52
55
|
*/
|
|
53
56
|
export type NewProjectSessionOpts = {
|
|
54
57
|
onNavigate?: (sessionId: string) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Runs with the client-minted id right before the create POST (never on the
|
|
60
|
+
* warm path). A space draws its optimistic thread row here; `onError` takes it back.
|
|
61
|
+
*/
|
|
62
|
+
onCreating?: (sessionId: string) => void;
|
|
55
63
|
onError?: () => void;
|
|
56
64
|
scope?: SessionScopeCommit;
|
|
57
65
|
create?: {
|
|
58
66
|
sandbox_slug?: string;
|
|
59
67
|
agent_name?: string;
|
|
68
|
+
space_id?: string;
|
|
60
69
|
pending_prompt?: PendingSessionPrompt;
|
|
61
70
|
connector_bindings?: SessionConnectorBindingsInput;
|
|
62
71
|
inherit_unbound?: boolean;
|
|
@@ -25,11 +25,14 @@ function makeTakeOrCreateSession(projectId, opts, router, queryClient, onAdopt)
|
|
|
25
25
|
// null whenever there is nothing suitable, so the create path below stays
|
|
26
26
|
// the authority on billing and connector requirements.
|
|
27
27
|
async function takeOrCreateSession() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
// A space thread always creates: a warm session belongs to no space.
|
|
29
|
+
const warm = opts.create?.space_id
|
|
30
|
+
? null
|
|
31
|
+
: takeWarmSessionEntry(projectId, {
|
|
32
|
+
create: opts?.create,
|
|
33
|
+
// Replenish after /start, not beside the claim and /start requests.
|
|
34
|
+
replenish: false,
|
|
35
|
+
});
|
|
33
36
|
if (warm) {
|
|
34
37
|
// The first prompt is a DURABLE inbox row, never a client-side
|
|
35
38
|
// replay (the start stash carries picks only — see the producers).
|
|
@@ -61,7 +64,9 @@ function makeTakeOrCreateSession(projectId, opts, router, queryClient, onAdopt)
|
|
|
61
64
|
}
|
|
62
65
|
const sessionId = randomUUID();
|
|
63
66
|
markSessionFresh(sessionId);
|
|
64
|
-
|
|
67
|
+
opts.onCreating?.(sessionId);
|
|
68
|
+
if (!opts.create?.space_id)
|
|
69
|
+
router.prefetch(uiRoutes().session(projectId, sessionId));
|
|
65
70
|
let created;
|
|
66
71
|
try {
|
|
67
72
|
created = await createProjectSession(projectId, {
|
|
@@ -92,6 +97,7 @@ function makeTakeOrCreateSession(projectId, opts, router, queryClient, onAdopt)
|
|
|
92
97
|
}
|
|
93
98
|
export function useNewProjectSession(projectId) {
|
|
94
99
|
const t = useTranslations('threads');
|
|
100
|
+
const tSpaces = useTranslations('spaces.view');
|
|
95
101
|
const router = useUiRouter();
|
|
96
102
|
const pathname = useUiPathname();
|
|
97
103
|
const queryClient = useQueryClient();
|
|
@@ -186,7 +192,8 @@ export function useNewProjectSession(projectId) {
|
|
|
186
192
|
const takeOrCreateSession = makeTakeOrCreateSession(projectId, opts, router, queryClient, (session) => {
|
|
187
193
|
adoptedWarmSession = session;
|
|
188
194
|
});
|
|
189
|
-
|
|
195
|
+
// A space thread shows up in the timeline at once, so it gets no toast.
|
|
196
|
+
const inSpace = Boolean(opts.create?.space_id);
|
|
190
197
|
// `threads.*`, not `hardcodedUi.i18nComplete.*`. The two
|
|
191
198
|
// i18nComplete slots these used to read hold the literal strings
|
|
192
199
|
// "startingSession" and "sessionStarted" in en, fr, de, pt, sr and
|
|
@@ -194,9 +201,11 @@ export function useNewProjectSession(projectId) {
|
|
|
194
201
|
// rendered its own key name. `threads.startingSession` /
|
|
195
202
|
// `threads.sessionStarted` are the canonical entries and are
|
|
196
203
|
// correctly translated in all nine catalogs.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
204
|
+
const createSession = () => inSpace
|
|
205
|
+
? takeOrCreateSession()
|
|
206
|
+
: loadingToast(t('startingSession'), takeOrCreateSession(), {
|
|
207
|
+
success: t('sessionStarted'),
|
|
208
|
+
});
|
|
200
209
|
createScopedSession({
|
|
201
210
|
create: createSession,
|
|
202
211
|
draft: opts?.scope?.draft,
|
|
@@ -243,6 +252,11 @@ export function useNewProjectSession(projectId) {
|
|
|
243
252
|
invalidate: () => queryClient.invalidateQueries({ queryKey: qk.project.sessionsScope(projectId) }),
|
|
244
253
|
});
|
|
245
254
|
opts?.onNavigate?.(sessionId);
|
|
255
|
+
// The space view stays on screen, so no navigation lands to release the claim.
|
|
256
|
+
if (inSpace) {
|
|
257
|
+
release();
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
246
260
|
// nav-contract: prefetch-only — the session id is minted or returned
|
|
247
261
|
// by the create POST, so no anchor can name it. `takeOrCreateSession`
|
|
248
262
|
// prefetches the route the moment the id exists.
|
|
@@ -251,6 +265,7 @@ export function useNewProjectSession(projectId) {
|
|
|
251
265
|
}).catch((err) => {
|
|
252
266
|
const code = err?.code;
|
|
253
267
|
const action = resolveCreateFailure(code, err instanceof ApiError);
|
|
268
|
+
const failed = inSpace ? tSpaces('sendFailed') : t('failedToStartSession');
|
|
254
269
|
if (action === 'upgrade') {
|
|
255
270
|
openUpgradeDialog({ reason: 'subscription_required', accountId });
|
|
256
271
|
}
|
|
@@ -264,11 +279,11 @@ export function useNewProjectSession(projectId) {
|
|
|
264
279
|
});
|
|
265
280
|
}
|
|
266
281
|
else {
|
|
267
|
-
errorToast(err instanceof Error ? err.message :
|
|
282
|
+
errorToast(err instanceof Error ? err.message : failed);
|
|
268
283
|
}
|
|
269
284
|
}
|
|
270
285
|
else if (action === 'toast') {
|
|
271
|
-
errorToast(err instanceof Error ? err.message :
|
|
286
|
+
errorToast(err instanceof Error ? err.message : failed);
|
|
272
287
|
}
|
|
273
288
|
// No navigation happened, so release the claim now — the user stays
|
|
274
289
|
// where they are and must be able to try again immediately.
|
|
@@ -286,6 +301,7 @@ export function useNewProjectSession(projectId) {
|
|
|
286
301
|
openUpgradeDialog,
|
|
287
302
|
accountId,
|
|
288
303
|
t,
|
|
304
|
+
tSpaces,
|
|
289
305
|
queryClient,
|
|
290
306
|
openConnectorGate,
|
|
291
307
|
]);
|
|
@@ -6,6 +6,13 @@ interface UseAutoScrollOptions {
|
|
|
6
6
|
* until then (the area is conditionally rendered), so the observers and
|
|
7
7
|
* listeners attach on this edge. */
|
|
8
8
|
hasContent?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* FACT 1's room under the newest turn. False keeps only the bottom gap: the
|
|
11
|
+
* end is the end of the content, as in a chat thread (a channel's thread
|
|
12
|
+
* panel). A transcript shorter than the viewport then rests at the top,
|
|
13
|
+
* never below an empty screen. Default true.
|
|
14
|
+
*/
|
|
15
|
+
room?: boolean;
|
|
9
16
|
}
|
|
10
17
|
interface UseAutoScrollReturn {
|
|
11
18
|
scrollRef: React.RefObject<HTMLDivElement | null>;
|
|
@@ -27,4 +34,4 @@ interface UseAutoScrollReturn {
|
|
|
27
34
|
* turns follow off until the reader comes to the end themselves. */
|
|
28
35
|
startAtTop: () => void;
|
|
29
36
|
}
|
|
30
|
-
export declare function useAutoScroll({ hasContent, }?: UseAutoScrollOptions): UseAutoScrollReturn;
|
|
37
|
+
export declare function useAutoScroll({ hasContent, room, }?: UseAutoScrollOptions): UseAutoScrollReturn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
-
import { OWN_SCROLL_MS, chevronVisible, isAtEnd, keyScrollIntentFor, pickAnchorIndex, prefersReducedMotion, roomUnderNewestTurn, settleMotion, shouldReleaseFollow, } from './use-auto-scroll-physics.js';
|
|
3
|
+
import { BOTTOM_GAP_PX, OWN_SCROLL_MS, chevronVisible, isAtEnd, keyScrollIntentFor, pickAnchorIndex, prefersReducedMotion, roomUnderNewestTurn, settleMotion, shouldReleaseFollow, } from './use-auto-scroll-physics.js';
|
|
4
4
|
export { AT_END_PX, BOTTOM_GAP_PX, CHEVRON_PX, GLIDE_MIN_PX, OWN_SCROLL_MS, TURN_TOP_OFFSET, chevronVisible, classifyScrollKey, isAtEnd, isEditableTarget, isSpaceActivatedTarget, keyScrollIntentFor, pickAnchorIndex, roomUnderNewestTurn, settleMotion, shouldReleaseFollow, } from './use-auto-scroll-physics.js';
|
|
5
5
|
/**
|
|
6
6
|
* useAutoScroll — the session transcript's scroll physics, from first
|
|
@@ -75,7 +75,7 @@ const SEND_GLIDE_ARM_MS = 1000;
|
|
|
75
75
|
function distanceFromEnd(el) {
|
|
76
76
|
return el.scrollHeight - el.scrollTop - el.clientHeight;
|
|
77
77
|
}
|
|
78
|
-
export function useAutoScroll({ hasContent = false, } = {}) {
|
|
78
|
+
export function useAutoScroll({ hasContent = false, room = true, } = {}) {
|
|
79
79
|
const scrollRef = useRef(null);
|
|
80
80
|
const contentRef = useRef(null);
|
|
81
81
|
const spacerElRef = useRef(null);
|
|
@@ -149,7 +149,7 @@ export function useAutoScroll({ hasContent = false, } = {}) {
|
|
|
149
149
|
const span = anchor
|
|
150
150
|
? spacer.getBoundingClientRect().top - anchor.getBoundingClientRect().top
|
|
151
151
|
: null;
|
|
152
|
-
const h = roomUnderNewestTurn(el.clientHeight, span);
|
|
152
|
+
const h = room ? roomUnderNewestTurn(el.clientHeight, span) : BOTTOM_GAP_PX;
|
|
153
153
|
if (spacer.style.height !== `${h}px`)
|
|
154
154
|
spacer.style.height = `${h}px`;
|
|
155
155
|
const anchorChanged = previous !== null && anchor !== previous.el;
|
|
@@ -161,7 +161,7 @@ export function useAutoScroll({ hasContent = false, } = {}) {
|
|
|
161
161
|
}
|
|
162
162
|
: null;
|
|
163
163
|
return { room: h, anchorChanged };
|
|
164
|
-
}, []);
|
|
164
|
+
}, [room]);
|
|
165
165
|
const settleRef = useRef(null);
|
|
166
166
|
const cancelGlide = useCallback(() => {
|
|
167
167
|
const glide = glideRef.current;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
+
/**
|
|
3
|
+
* The official Telegram logo (telegram.org brand mark): a blue gradient
|
|
4
|
+
* circle with a white paper plane. Static gradient id: the mark is identical
|
|
5
|
+
* wherever it sits, so a shared id resolves to the same fill.
|
|
6
|
+
*/
|
|
2
7
|
export declare const Telegram: ({ className }: {
|
|
3
8
|
className?: string;
|
|
4
9
|
}) => import("react").JSX.Element;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from '../lib/utils.js';
|
|
4
|
+
/**
|
|
5
|
+
* The official Telegram logo (telegram.org brand mark): a blue gradient
|
|
6
|
+
* circle with a white paper plane. Static gradient id: the mark is identical
|
|
7
|
+
* wherever it sits, so a shared id resolves to the same fill.
|
|
8
|
+
*/
|
|
4
9
|
export const Telegram = ({ className }) => {
|
|
5
|
-
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 240 240", className: cn('size-4', className), children: [_jsx("defs", { children: _jsxs("linearGradient", { id: "
|
|
10
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 240 240", className: cn('size-4', className), children: [_jsx("defs", { children: _jsxs("linearGradient", { id: "kortix-telegram-logo", x1: "0.5", y1: "0", x2: "0.5", y2: "1", children: [_jsx("stop", { offset: "0", stopColor: "#2AABEE" }), _jsx("stop", { offset: "1", stopColor: "#229ED9" })] }) }), _jsx("circle", { cx: "120", cy: "120", r: "120", fill: "url(#kortix-telegram-logo)" }), _jsx("path", { fill: "#FFFFFF", d: "M54.3 118.8c35-15.2 58.3-25.3 70-30.2 33.3-13.9 40.3-16.3 44.8-16.4 1 0 3.2.2 4.7 1.4 1.2 1 1.5 2.3 1.7 3.3s.4 3.1.2 4.7c-1.8 19-9.6 65.1-13.6 86.3-1.7 9-5 12-8.2 12.3-7 .6-12.3-4.6-19-9-10.6-6.9-16.5-11.2-26.8-18-11.9-7.8-4.2-12.1 2.6-19.1 1.8-1.8 32.5-29.8 33.1-32.3.1-.3.1-1.5-.6-2.1-.7-.6-1.7-.4-2.5-.2-1.1.2-17.9 11.4-50.6 33.5-4.8 3.3-9.1 4.9-13 4.8-4.3-.1-12.5-2.4-18.7-4.4-7.5-2.4-13.5-3.7-13-7.9.3-2.2 3.3-4.4 8.9-6.7z" })] }));
|
|
6
11
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
+
import { PopoverContent } from '../../primitives/popover.js';
|
|
3
|
+
import { type ComponentProps, type PointerEvent, type RefObject } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* The hover card of a sidebar nav row (Apps, Customize): a mouse that rests on
|
|
6
|
+
* the row opens a list of where the row leads, so one click lands on the
|
|
7
|
+
* thing instead of two. The row stays a plain link: the card is a Popover
|
|
8
|
+
* anchored to it (`anchorRef` as `PopoverAnchor virtualRef`), not a menu
|
|
9
|
+
* trigger, which would take Enter and Space for itself.
|
|
10
|
+
*
|
|
11
|
+
* It opens only where hover exists (the session list's gate) and only on the
|
|
12
|
+
* expanded sidebar: the collapsed rail shows the row's tooltip there.
|
|
13
|
+
* `holdRef` names an input that keeps the card open while it has focus.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useNavHoverCard({ enabled, holdRef, }: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
holdRef?: RefObject<HTMLElement | null>;
|
|
18
|
+
}): {
|
|
19
|
+
open: boolean;
|
|
20
|
+
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
21
|
+
anchorRef: RefObject<HTMLElement>;
|
|
22
|
+
rowProps: {
|
|
23
|
+
onPointerEnter: (event: PointerEvent<HTMLElement>) => void;
|
|
24
|
+
onPointerLeave: (event: PointerEvent<HTMLElement>) => void;
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
};
|
|
27
|
+
contentProps: {
|
|
28
|
+
onPointerEnter: (event: PointerEvent<HTMLElement>) => void;
|
|
29
|
+
onPointerLeave: (event: PointerEvent<HTMLElement>) => void;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/** The card's panel: to the right of the row, top edges aligned, never taking focus. */
|
|
33
|
+
export declare function NavHoverCardContent({ className, ...props }: ComponentProps<typeof PopoverContent>): import("react").JSX.Element;
|
|
34
|
+
/** The card's list: the floating-list padding. A list that can grow long sets its own cap. */
|
|
35
|
+
export declare function NavHoverCardList({ className, ...props }: ComponentProps<'ul'>): import("react").JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useMediaQuery } from '../hooks/index.js';
|
|
4
|
+
import { PopoverContent } from '../../primitives/popover.js';
|
|
5
|
+
import { useSidebar } from '../../primitives/sidebar.js';
|
|
6
|
+
import { cn } from '../../lib/utils.js';
|
|
7
|
+
import { useEffect, useRef, useState, } from 'react';
|
|
8
|
+
/** Time the pointer rests on the row before the card opens, so passing over it does nothing. */
|
|
9
|
+
const HOVER_OPEN_DELAY_MS = 400;
|
|
10
|
+
/** Time to cross the gap between the row and its card before it closes. Same as the More row. */
|
|
11
|
+
const HOVER_CLOSE_DELAY_MS = 150;
|
|
12
|
+
/**
|
|
13
|
+
* The hover card of a sidebar nav row (Apps, Customize): a mouse that rests on
|
|
14
|
+
* the row opens a list of where the row leads, so one click lands on the
|
|
15
|
+
* thing instead of two. The row stays a plain link: the card is a Popover
|
|
16
|
+
* anchored to it (`anchorRef` as `PopoverAnchor virtualRef`), not a menu
|
|
17
|
+
* trigger, which would take Enter and Space for itself.
|
|
18
|
+
*
|
|
19
|
+
* It opens only where hover exists (the session list's gate) and only on the
|
|
20
|
+
* expanded sidebar: the collapsed rail shows the row's tooltip there.
|
|
21
|
+
* `holdRef` names an input that keeps the card open while it has focus.
|
|
22
|
+
*/
|
|
23
|
+
export function useNavHoverCard({ enabled, holdRef, }) {
|
|
24
|
+
const canHover = useMediaQuery('(min-width: 768px) and (hover: hover) and (pointer: fine)');
|
|
25
|
+
const { state } = useSidebar();
|
|
26
|
+
const [open, setOpen] = useState(false);
|
|
27
|
+
const anchorRef = useRef(null);
|
|
28
|
+
const openTimer = useRef(undefined);
|
|
29
|
+
const closeTimer = useRef(undefined);
|
|
30
|
+
const active = enabled && canHover && state === 'expanded';
|
|
31
|
+
const cancelTimers = () => {
|
|
32
|
+
clearTimeout(openTimer.current);
|
|
33
|
+
clearTimeout(closeTimer.current);
|
|
34
|
+
};
|
|
35
|
+
useEffect(() => cancelTimers, []);
|
|
36
|
+
// An open card stays open while the pointer crosses between row and card;
|
|
37
|
+
// a closed one opens only after the pointer rests on the row.
|
|
38
|
+
const hoverOpen = (event) => {
|
|
39
|
+
if (event.pointerType !== 'mouse' || !active)
|
|
40
|
+
return;
|
|
41
|
+
cancelTimers();
|
|
42
|
+
if (open)
|
|
43
|
+
return;
|
|
44
|
+
openTimer.current = setTimeout(() => setOpen(true), HOVER_OPEN_DELAY_MS);
|
|
45
|
+
};
|
|
46
|
+
const hoverClose = (event) => {
|
|
47
|
+
if (event.pointerType !== 'mouse')
|
|
48
|
+
return;
|
|
49
|
+
cancelTimers();
|
|
50
|
+
closeTimer.current = setTimeout(() => {
|
|
51
|
+
// Typing in the card keeps it; a click outside or Escape closes it.
|
|
52
|
+
if (holdRef?.current && document.activeElement === holdRef.current)
|
|
53
|
+
return;
|
|
54
|
+
setOpen(false);
|
|
55
|
+
}, HOVER_CLOSE_DELAY_MS);
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
open: open && active,
|
|
59
|
+
setOpen,
|
|
60
|
+
anchorRef: anchorRef,
|
|
61
|
+
rowProps: {
|
|
62
|
+
onPointerEnter: (event) => {
|
|
63
|
+
anchorRef.current = event.currentTarget;
|
|
64
|
+
hoverOpen(event);
|
|
65
|
+
},
|
|
66
|
+
onPointerLeave: hoverClose,
|
|
67
|
+
onClick: () => {
|
|
68
|
+
cancelTimers();
|
|
69
|
+
setOpen(false);
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
contentProps: { onPointerEnter: hoverOpen, onPointerLeave: hoverClose },
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** The card's panel: to the right of the row, top edges aligned, never taking focus. */
|
|
76
|
+
export function NavHoverCardContent({ className, ...props }) {
|
|
77
|
+
return (_jsx(PopoverContent, { side: "right", align: "start", sideOffset: 8, className: cn('w-60 overflow-hidden p-0', className),
|
|
78
|
+
// Hover must not move focus: the row keeps it, and so does the page.
|
|
79
|
+
onOpenAutoFocus: (event) => event.preventDefault(), onCloseAutoFocus: (event) => event.preventDefault(), ...props }));
|
|
80
|
+
}
|
|
81
|
+
/** The card's list: the floating-list padding. A list that can grow long sets its own cap. */
|
|
82
|
+
export function NavHoverCardList({ className, ...props }) {
|
|
83
|
+
return _jsx("ul", { className: cn('p-1', className), ...props });
|
|
84
|
+
}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import { HoverPrefetchLink } from '../components/hover-prefetch-link.js';
|
|
3
3
|
import type { ComponentProps, ReactNode } from 'react';
|
|
4
4
|
/** Keep the anchor's intent handlers and the caller's active-route semantics. */
|
|
5
|
-
export declare function ProjectNavRow({ active, label, children, ...link }: ComponentProps<typeof HoverPrefetchLink> & {
|
|
5
|
+
export declare function ProjectNavRow({ active, label, className, children, ...link }: ComponentProps<typeof HoverPrefetchLink> & {
|
|
6
6
|
active: boolean;
|
|
7
7
|
label: string;
|
|
8
|
+
/** Added to the row button's classes. */
|
|
9
|
+
className?: string;
|
|
8
10
|
children: ReactNode;
|
|
9
11
|
}): import("react").JSX.Element;
|