@kortix/ui 0.14.8 → 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 +63 -3
- 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/space-slug.d.ts +37 -0
- package/dist/access/access/access-detail-shell.js +1 -1
- package/dist/access/access/principal-picker.d.ts +11 -0
- package/dist/access/access/principal-picker.js +3 -2
- 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-grant-pages.d.ts +5 -1
- package/dist/customize/agents/agent-grant-pages.js +30 -4
- package/dist/customize/agents/agent-page.js +3 -1
- 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/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 -25
- package/dist/customize/migrate-to-v2/migration-prompt.js +34 -236
- 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 +61 -75
- 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/use-customize-prefetch.d.ts +2 -3
- package/dist/customize/shared/use-customize-prefetch.js +9 -27
- 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/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 +5 -2
- 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 +873 -85
- package/dist/i18n/en.js +888 -100
- 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.js +5 -2
- 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/use-project-feature-flags.js +9 -9
- 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/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/secret-intake-form.d.ts +0 -10
- package/dist/markdown/setup-links/secret-intake-form.js +1 -1
- 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/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/providers/ui-provider.d.ts +9 -0
- 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 +13 -1
- package/dist/session/composer/agent-selector.js +25 -5
- 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/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/models/chatgpt-connection-button.d.ts +11 -0
- package/dist/session/models/chatgpt-connection-button.js +54 -0
- package/dist/session/models/model-selector.js +5 -2
- 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/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/session-chat.d.ts +3 -1
- package/dist/session/thread/session-chat.js +377 -252
- 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 +0 -9
- package/dist/session/thread/transcript.js +104 -19
- 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/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/show-tool.js +19 -8
- 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.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 +1 -1
- package/dist/session/turn/plan-anchor.js +1 -1
- 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/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-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 +27 -36
- 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/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/markdown/setup-links/app-credentials-form.d.ts +0 -12
- package/dist/markdown/setup-links/app-credentials-form.js +0 -115
- /package/dist/{internal/hooks → hooks}/use-media-query.js +0 -0
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getConnectStatus,
|
|
2
|
+
import { getConnectStatus, listConnectToolkits, listDiscoverConnectors, listDiscoverSections, listPipedreamApps, } from '@kortix/sdk';
|
|
3
3
|
import { keepPreviousData, useInfiniteQuery, useQuery } from '@tanstack/react-query';
|
|
4
4
|
import { useCallback, useMemo } from 'react';
|
|
5
5
|
import { useDebounce } from '../../../hooks/use-debounce.js';
|
|
6
6
|
import { useTranslations } from '../../../i18n/index.js';
|
|
7
|
-
import { browseSections,
|
|
8
|
-
import { catalogEntryFromDiscover,
|
|
7
|
+
import { browseSections, sectionsPageFromDiscover } from './browse-sections.js';
|
|
8
|
+
import { catalogEntryFromDiscover, connectToolkitApp } from './catalog-entry.js';
|
|
9
9
|
import { CATEGORY_ROW_CAP, localizedSectionTitle } from './connector-categories.js';
|
|
10
|
-
import { mergeSearchEntries } from './merge-search.js';
|
|
11
|
-
/** Apps per request. One page fills several rows of the widest grid, so a
|
|
12
|
-
* scroll-triggered fetch is felt as the grid growing rather than as a jump. */
|
|
13
|
-
const CATALOG_PAGE_SIZE = 48;
|
|
14
10
|
/** Cards per section on the browse page, and how many sections it shows.
|
|
15
11
|
* `CATEGORY_ROW_CAP` is two rows of `xl:grid-cols-3`; 12 sections is a browse
|
|
16
12
|
* page you can scan without it becoming a directory of headings. */
|
|
@@ -76,25 +72,22 @@ export const connectStatusQuery = {
|
|
|
76
72
|
queryFn: getConnectStatus,
|
|
77
73
|
};
|
|
78
74
|
/**
|
|
79
|
-
* The browse page's one request
|
|
80
|
-
*
|
|
81
|
-
* the Discover landing reads.
|
|
75
|
+
* The browse page's one request. Exported so the Customize prefetch
|
|
76
|
+
* (`use-customize-prefetch.ts`) fills the exact cache entry the landing reads.
|
|
82
77
|
*/
|
|
83
|
-
export function catalogSectionsQuery(projectId,
|
|
78
|
+
export function catalogSectionsQuery(projectId,
|
|
79
|
+
/** Just the apps that connect with nothing to set up. */
|
|
80
|
+
oneClick = false,
|
|
81
|
+
/** Just the apps that connect these ways. */
|
|
82
|
+
kinds = []) {
|
|
84
83
|
return {
|
|
85
|
-
queryKey: ['catalog-sections', projectId,
|
|
86
|
-
queryFn: async () => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
if (catalogue === 'pipedream') {
|
|
94
|
-
return sectionsPageFromPipedream(await listPipedreamSections(projectId, limits));
|
|
95
|
-
}
|
|
96
|
-
return sectionsPageFromConnect(await listConnectSections(projectId, limits));
|
|
97
|
-
},
|
|
84
|
+
queryKey: ['catalog-sections', projectId, 'kortix', ...(oneClick ? ['one-click'] : []), ...kinds],
|
|
85
|
+
queryFn: async () => sectionsPageFromDiscover(await listDiscoverSections(projectId, {
|
|
86
|
+
perCategory: SECTION_CARD_COUNT,
|
|
87
|
+
maxCategories: SECTION_COUNT,
|
|
88
|
+
...(oneClick ? { oneClick } : {}),
|
|
89
|
+
...(kinds.length ? { kinds: [...kinds] } : {}),
|
|
90
|
+
})),
|
|
98
91
|
staleTime: 5 * 60_000,
|
|
99
92
|
};
|
|
100
93
|
}
|
|
@@ -119,129 +112,43 @@ export async function listConnectCatalogPage(input) {
|
|
|
119
112
|
};
|
|
120
113
|
}
|
|
121
114
|
/**
|
|
122
|
-
* The catalogue behind the All tab
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* **Why two sources.** `connectors_api_discover` resolves to `false` by
|
|
126
|
-
* default (`apps/api/src/experimental/features.ts:83`), so the Discover
|
|
127
|
-
* catalogue is unavailable to most projects. Easy Connect (Pipedream) is not
|
|
128
|
-
* flagged. Falling back keeps the page populated for every project.
|
|
129
|
-
*
|
|
130
|
-
* **Why not merge them.** The two publish overlapping apps under different
|
|
131
|
-
* slugs and different `id` namespaces, and each has its own add flow. A merged
|
|
132
|
-
* list would need a cross-catalogue identity that neither API provides.
|
|
115
|
+
* The catalogue behind the All tab: Kortix's apps, every integrations.sh
|
|
116
|
+
* server and API, and the Composio apps, each app once by its best way in
|
|
117
|
+
* (`apps/api/src/connectors/mcp-apps.ts`). One source, the Discover routes.
|
|
133
118
|
*
|
|
134
119
|
* **One paging mechanism.** A scroll or a click on "Load more" fetches the next
|
|
135
|
-
* page.
|
|
136
|
-
*
|
|
137
|
-
* window over the top — that existed only because the client had to accumulate
|
|
138
|
-
* enough pages to fake a category filter. The server filters by category now
|
|
139
|
-
* (`pipedreamCatalogPage`), so the client asks for exactly the page it renders.
|
|
140
|
-
*
|
|
141
|
-
* **Filtering happens server-side, over the whole catalogue.** Both `q` and
|
|
142
|
-
* `category` are query keys, so changing either starts a new list rather than
|
|
143
|
-
* re-slicing an accumulated one. Pipedream's own API cannot filter by category
|
|
144
|
-
* at all — see `apps/api/src/connectors/pipedream-index.ts`.
|
|
145
|
-
*
|
|
146
|
-
* **Easy Connect waits for the deployment probe.** No Pipedream request is sent
|
|
147
|
-
* until `usePipedreamStatus` has ruled out `absent`, because on a deployment
|
|
148
|
-
* without Pipedream credentials every one of them is a `501` — and one landing
|
|
149
|
-
* before the probe would paint the error card the probe exists to prevent. The
|
|
150
|
-
* cost is one round trip on the first load of the session, spent on a route that
|
|
151
|
-
* only reads env vars, and the wait is reported as `isLoading` so the grid holds
|
|
152
|
-
* its skeletons instead of flashing an empty result.
|
|
120
|
+
* page. `q`, `oneClick` and `kinds` are query keys, so changing any of them
|
|
121
|
+
* starts a new list rather than re-slicing an accumulated one.
|
|
153
122
|
*/
|
|
154
123
|
export function useCatalog(projectId, query, opts) {
|
|
155
124
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
156
125
|
const { debouncedValue: activeQuery } = useDebounce(query.trim(), 300);
|
|
157
|
-
const
|
|
126
|
+
const hideComputerRecord = opts.computers !== true;
|
|
158
127
|
const searching = activeQuery.length > 0;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
// with no API/MCP catalogue either. It is one cached request.
|
|
162
|
-
const connectStatus = useConnectProviderStatus(true);
|
|
163
|
-
// One catalogue, no source toggle. Managed apps drive browsing; a search also
|
|
164
|
-
// asks the API/MCP catalogue (below). With no managed provider on this
|
|
165
|
-
// deployment, the API/MCP catalogue is the whole catalogue.
|
|
166
|
-
// `unknown` (the probe failed) falls back to the API/MCP catalogue too, as
|
|
167
|
-
// before the merge of the two.
|
|
168
|
-
const mcpApps = opts.mcpApps === true;
|
|
169
|
-
const source = mcpApps ||
|
|
170
|
-
(opts.discoverEnabled && (connectStatus.state === 'absent' || connectStatus.state === 'unknown'))
|
|
171
|
-
? 'discover'
|
|
172
|
-
: 'easy-connect';
|
|
173
|
-
const searchDirect = opts.discoverEnabled && source === 'easy-connect' && searching;
|
|
174
|
-
// Keys the Discover cache by the catalogue the API answers with.
|
|
175
|
-
const discoverCatalogue = mcpApps ? 'kortix' : 'discover';
|
|
176
|
-
// `unknown` proceeds: the probe failed, and refusing to load a catalogue that
|
|
177
|
-
// may well exist is the worse of the two mistakes.
|
|
178
|
-
const easyConnectRunnable = source === 'easy-connect' &&
|
|
179
|
-
(connectStatus.state === 'configured' || connectStatus.state === 'unknown');
|
|
180
|
-
const easyConnectProvider = connectStatus.provider ?? 'composio';
|
|
128
|
+
const oneClick = opts.oneClick === true;
|
|
129
|
+
const kinds = useMemo(() => [...(opts.kinds ?? [])], [opts.kinds]);
|
|
181
130
|
const discoverQuery = useInfiniteQuery({
|
|
182
|
-
|
|
183
|
-
// unfiltered key stays exactly the one `discover-catalogue.tsx` shares.
|
|
184
|
-
queryKey: mcpApps
|
|
185
|
-
? ['discover-connectors', projectId, activeQuery, 'kortix']
|
|
186
|
-
: ['discover-connectors', projectId, activeQuery],
|
|
131
|
+
queryKey: ['discover-connectors', projectId, activeQuery, 'kortix', oneClick, ...kinds],
|
|
187
132
|
queryFn: ({ pageParam }) => listDiscoverConnectors(projectId, {
|
|
188
133
|
q: activeQuery || undefined,
|
|
189
134
|
cursor: pageParam,
|
|
135
|
+
...(oneClick ? { oneClick } : {}),
|
|
136
|
+
...(kinds.length ? { kinds } : {}),
|
|
190
137
|
}),
|
|
191
138
|
initialPageParam: undefined,
|
|
192
139
|
getNextPageParam: (last) => (last.hasMore ? last.nextCursor : undefined),
|
|
193
140
|
staleTime: 5 * 60_000,
|
|
194
|
-
enabled: opts.enabled
|
|
195
|
-
placeholderData: keepPreviousData,
|
|
196
|
-
});
|
|
197
|
-
const easyConnectQuery = useInfiniteQuery({
|
|
198
|
-
queryKey: ['easy-connect-apps', projectId, activeQuery, null],
|
|
199
|
-
queryFn: ({ pageParam }) => listConnectCatalogPage({
|
|
200
|
-
projectId,
|
|
201
|
-
provider: easyConnectProvider,
|
|
202
|
-
q: activeQuery || undefined,
|
|
203
|
-
cursor: pageParam,
|
|
204
|
-
limit: CATALOG_PAGE_SIZE,
|
|
205
|
-
}),
|
|
206
|
-
initialPageParam: undefined,
|
|
207
|
-
getNextPageParam: (last) => (last.hasMore ? last.nextCursor : undefined),
|
|
208
|
-
staleTime: 60_000,
|
|
209
|
-
enabled: opts.enabled && easyConnectRunnable,
|
|
141
|
+
enabled: opts.enabled,
|
|
210
142
|
placeholderData: keepPreviousData,
|
|
211
143
|
});
|
|
212
|
-
// The browse page, in one request
|
|
213
|
-
//
|
|
214
|
-
// reports how many cards one loaded page happened to hold.
|
|
215
|
-
//
|
|
216
|
-
// Fetched while browsing. Discover and Composio also keep it while a category
|
|
217
|
-
// is open: their paged endpoints publish no category facet, and this
|
|
218
|
-
// response's facet is what lets the open category's header state its name
|
|
219
|
-
// and size. Same key, so opening a category from the browse page costs no
|
|
220
|
-
// request. Pipedream's paged endpoint carries its own facet.
|
|
221
|
-
const sectionsCatalogue = source === 'discover' ? discoverCatalogue : easyConnectProvider;
|
|
144
|
+
// The browse page, in one request. It answers with each category's TRUE
|
|
145
|
+
// size, so a heading never reports how many cards one loaded page held.
|
|
222
146
|
const sectionsQuery = useQuery({
|
|
223
|
-
...catalogSectionsQuery(projectId,
|
|
224
|
-
enabled: opts.enabled &&
|
|
147
|
+
...catalogSectionsQuery(projectId, oneClick, kinds),
|
|
148
|
+
enabled: opts.enabled && !searching,
|
|
225
149
|
});
|
|
226
|
-
const
|
|
227
|
-
const
|
|
228
|
-
source,
|
|
229
|
-
computers,
|
|
230
|
-
activeQuery,
|
|
231
|
-
searchDirect,
|
|
232
|
-
tI18nComplete,
|
|
233
|
-
discoverPages: discoverQuery.data?.pages,
|
|
234
|
-
managedPages: easyConnectQuery.data?.pages,
|
|
235
|
-
}), [
|
|
236
|
-
searchDirect,
|
|
237
|
-
tI18nComplete,
|
|
238
|
-
computers,
|
|
239
|
-
activeQuery,
|
|
240
|
-
source,
|
|
241
|
-
easyConnectQuery.data?.pages,
|
|
242
|
-
discoverQuery.data?.pages,
|
|
243
|
-
]);
|
|
244
|
-
const { fetchNextPage, hasNextPage, isFetchingNextPage, isPlaceholderData, refetch: activeRefetch, } = active;
|
|
150
|
+
const entries = useMemo(() => withoutComputerRecord(hideComputerRecord, (discoverQuery.data?.pages ?? []).flatMap((page) => page.items.map(catalogEntryFromDiscover))), [hideComputerRecord, discoverQuery.data?.pages]);
|
|
151
|
+
const { fetchNextPage, hasNextPage, isFetchingNextPage, isPlaceholderData, refetch: activeRefetch, } = discoverQuery;
|
|
245
152
|
// Stable identity: `useCatalogAutoload` lists this in its observer effect's
|
|
246
153
|
// deps, and a new function every render would tear down and rebuild the
|
|
247
154
|
// `IntersectionObserver` on each one.
|
|
@@ -261,27 +168,20 @@ export function useCatalog(projectId, query, opts) {
|
|
|
261
168
|
void sectionsRefetch();
|
|
262
169
|
}, [activeRefetch, sectionsRefetch, showingSections]);
|
|
263
170
|
/**
|
|
264
|
-
* The browse sections
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* All of them come from the server, complete and fixed, with each section's
|
|
268
|
-
* true total. A section key is exactly what the catalogue's category filter
|
|
269
|
-
* accepts, so "View all" asks the server for the set the heading counted.
|
|
171
|
+
* The browse sections. They come from the server, complete and fixed, with
|
|
172
|
+
* each section's true total. A section key is exactly what the catalogue's
|
|
173
|
+
* category filter accepts, so "View all" asks for the set the heading counted.
|
|
270
174
|
*/
|
|
271
175
|
const sections = useMemo(() => {
|
|
272
176
|
if (searching || !sectionsQuery.data)
|
|
273
177
|
return [];
|
|
274
178
|
return browseSections(sectionsQuery.data, {
|
|
275
|
-
native: computers ? computersCatalogEntry(tI18nComplete) : null,
|
|
276
179
|
cardCount: SECTION_CARD_COUNT,
|
|
277
180
|
title: (label) => localizedSectionTitle(label, tI18nComplete),
|
|
278
|
-
});
|
|
279
|
-
}, [searching, sectionsQuery.data, tI18nComplete,
|
|
280
|
-
const
|
|
281
|
-
const
|
|
282
|
-
const reportedTotal = source === 'discover' ? discoverQuery.data?.pages[0]?.total : easyConnectPage?.total;
|
|
283
|
-
const nativeCount = entries.some((entry) => entry.source === 'computer') ? 1 : 0;
|
|
284
|
-
const total = typeof reportedTotal === 'number' ? reportedTotal + nativeCount : entries.length;
|
|
181
|
+
}).map((section) => ({ ...section, items: withoutComputerRecord(hideComputerRecord, section.items) }));
|
|
182
|
+
}, [searching, sectionsQuery.data, tI18nComplete, hideComputerRecord]);
|
|
183
|
+
const reportedTotal = discoverQuery.data?.pages[0]?.total;
|
|
184
|
+
const total = typeof reportedTotal === 'number' ? reportedTotal : entries.length;
|
|
285
185
|
// A failed sections request on the browse page is an error, not an empty
|
|
286
186
|
// catalogue — without this the grid would say "no connectors" over an outage.
|
|
287
187
|
const sectionsFailed = showingSections && sectionsQuery.isError;
|
|
@@ -289,48 +189,21 @@ export function useCatalog(projectId, query, opts) {
|
|
|
289
189
|
entries,
|
|
290
190
|
total,
|
|
291
191
|
activeQuery,
|
|
292
|
-
source,
|
|
293
|
-
excludedNoActions,
|
|
294
192
|
sections,
|
|
295
193
|
// `isLoading` is the COLD state only — no cards on screen at all. A search
|
|
296
194
|
// over a populated catalogue keeps its results and reports `isRefreshing`,
|
|
297
195
|
// so the grid dims instead of blanking to skeletons.
|
|
298
|
-
|
|
299
|
-
// `asking` counts as loading: the Easy Connect queries are held disabled
|
|
300
|
-
// until the deployment probe answers, and a disabled query reports neither
|
|
301
|
-
// loading nor data — without this the grid would render "no results" for a
|
|
302
|
-
// round trip before the real request had started.
|
|
303
|
-
isLoading: opts.enabled &&
|
|
304
|
-
(connectStatus.state === 'asking' ||
|
|
305
|
-
active.isLoading ||
|
|
306
|
-
(showingSections && sectionsQuery.isLoading)),
|
|
196
|
+
isLoading: opts.enabled && (discoverQuery.isLoading || (showingSections && sectionsQuery.isLoading)),
|
|
307
197
|
isRefreshing: opts.enabled && isPlaceholderData,
|
|
308
|
-
isError:
|
|
309
|
-
error:
|
|
198
|
+
isError: discoverQuery.isError || sectionsFailed,
|
|
199
|
+
error: discoverQuery.isError ? discoverQuery.error : sectionsFailed ? sectionsQuery.error : null,
|
|
310
200
|
hasMore: opts.enabled && hasNextPage && !isPlaceholderData,
|
|
311
201
|
isLoadingMore: isFetchingNextPage,
|
|
312
202
|
loadMore,
|
|
313
203
|
refetch,
|
|
314
204
|
};
|
|
315
205
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
// locally and hidden inside a category it does not claim.
|
|
320
|
-
const includeComputers = computers &&
|
|
321
|
-
(!activeQuery ||
|
|
322
|
-
`${native.name} ${native.description ?? ''}`
|
|
323
|
-
.toLowerCase()
|
|
324
|
-
.includes(activeQuery.toLowerCase()));
|
|
325
|
-
const nativeEntries = includeComputers ? [native] : [];
|
|
326
|
-
if (source === 'discover') {
|
|
327
|
-
return nativeEntries.concat((discoverPages ?? []).flatMap((page) => page.items.map(catalogEntryFromDiscover)));
|
|
328
|
-
}
|
|
329
|
-
const managed = (managedPages ?? []).flatMap((page) => page.apps.map(catalogEntryFromEasyConnect));
|
|
330
|
-
if (!searchDirect)
|
|
331
|
-
return nativeEntries.concat(managed);
|
|
332
|
-
// ponytail: only the API/MCP catalogue's first page joins a search; its
|
|
333
|
-
// ranking puts the matches there. Page it too if users miss results.
|
|
334
|
-
const direct = (discoverPages?.[0]?.items ?? []).map(catalogEntryFromDiscover);
|
|
335
|
-
return nativeEntries.concat(mergeSearchEntries(managed, direct));
|
|
206
|
+
/** The catalogue's Computer record (`native:computer`), dropped where no computer can be paired. */
|
|
207
|
+
function withoutComputerRecord(hide, entries) {
|
|
208
|
+
return hide ? entries.filter((entry) => entry.key !== 'discover:native:computer') : entries;
|
|
336
209
|
}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import type { AdminConnector } from '@kortix/sdk';
|
|
2
2
|
/**
|
|
3
|
-
* How a connector presents
|
|
3
|
+
* How a connector presents its status — the connected mark and the status
|
|
4
|
+
* pill. Its logo is `ConnectorLogo` (`connector-logo.tsx`), shared by every
|
|
5
|
+
* connector surface.
|
|
4
6
|
*
|
|
5
7
|
* These two render once per card in the connectors grid, so they sit on the
|
|
6
8
|
* hottest path of `/projects/[id]/connectors`. They used to live in
|
|
7
9
|
* `customize/sections/connectors-view.tsx`, which is ~5,100 lines across 50
|
|
8
|
-
* components and pulls `HighlightedCode
|
|
9
|
-
* `PoliciesPanel`, `DiscoverCatalogue` and `ConnectorConnectionModal`. Importing
|
|
10
|
+
* components and pulls `HighlightedCode` and `PoliciesPanel`. Importing
|
|
10
11
|
* two small components from there put that entire graph in this route's client
|
|
11
12
|
* chunk — an ES module is all-or-nothing to the bundler.
|
|
12
13
|
*
|
|
13
14
|
* The tile-size helper came along because nothing else in the old file used it.
|
|
14
15
|
*/
|
|
15
|
-
export declare function ConnectorAppIcon({ connector, size, }: {
|
|
16
|
-
connector: AdminConnector;
|
|
17
|
-
size?: 'sm' | 'lg';
|
|
18
|
-
}): import("react").JSX.Element;
|
|
19
16
|
/**
|
|
20
17
|
* Green `✓` for a healthy project connector — same glyph Discovery/All use in
|
|
21
18
|
* the catalogue card's `trailing` slot. Not a badge: problem states keep the
|
|
@@ -26,10 +23,11 @@ export declare function ConnectorConnectedMark({ className }?: {
|
|
|
26
23
|
className?: string;
|
|
27
24
|
}): import("react").JSX.Element;
|
|
28
25
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
26
|
+
* The state pill for a project connector: Needs account or Error. Connected
|
|
27
|
+
* returns `null`: put {@link ConnectorConnectedMark} in the card's `trailing`
|
|
28
|
+
* slot instead, the catalogue's `✓`.
|
|
32
29
|
*/
|
|
33
|
-
export declare function ConnectorStatusBadge({ connector }: {
|
|
30
|
+
export declare function ConnectorStatusBadge({ connector, accountCount, }: {
|
|
34
31
|
connector: AdminConnector;
|
|
32
|
+
accountCount?: number;
|
|
35
33
|
}): import("react").JSX.Element | null;
|
|
@@ -1,44 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useState } from 'react';
|
|
7
|
-
import { Badge } from '../../primitives/badge.js';
|
|
8
|
-
import { EntityAvatar } from '../../primitives/entity-avatar.js';
|
|
9
|
-
import { connectorSetupStatus } from '../sections/connector-connection-form.js';
|
|
3
|
+
import { CheckIcon, } from '@phosphor-icons/react';
|
|
4
|
+
import { connectorStatusTone } from './detail/connector-status.js';
|
|
5
|
+
import { ConnectorStatusBadge as ToneBadge } from './detail/status-badge.js';
|
|
10
6
|
import { cn } from '../../internal/lib/utils.js';
|
|
11
7
|
/**
|
|
12
|
-
* How a connector presents
|
|
8
|
+
* How a connector presents its status — the connected mark and the status
|
|
9
|
+
* pill. Its logo is `ConnectorLogo` (`connector-logo.tsx`), shared by every
|
|
10
|
+
* connector surface.
|
|
13
11
|
*
|
|
14
12
|
* These two render once per card in the connectors grid, so they sit on the
|
|
15
13
|
* hottest path of `/projects/[id]/connectors`. They used to live in
|
|
16
14
|
* `customize/sections/connectors-view.tsx`, which is ~5,100 lines across 50
|
|
17
|
-
* components and pulls `HighlightedCode
|
|
18
|
-
* `PoliciesPanel`, `DiscoverCatalogue` and `ConnectorConnectionModal`. Importing
|
|
15
|
+
* components and pulls `HighlightedCode` and `PoliciesPanel`. Importing
|
|
19
16
|
* two small components from there put that entire graph in this route's client
|
|
20
17
|
* chunk — an ES module is all-or-nothing to the bundler.
|
|
21
18
|
*
|
|
22
19
|
* The tile-size helper came along because nothing else in the old file used it.
|
|
23
20
|
*/
|
|
24
|
-
export function ConnectorAppIcon({ connector, size = 'lg', }) {
|
|
25
|
-
const [broken, setBroken] = useState(false);
|
|
26
|
-
const imgSrc = connector.iconUrl ?? null;
|
|
27
|
-
if (imgSrc && !broken) {
|
|
28
|
-
return (_jsx("span", {
|
|
29
|
-
// The catalogue grid card's logo (`connector-browse.tsx`): the bare
|
|
30
|
-
// image, no tile, so an app looks the same on every connector surface.
|
|
31
|
-
className: cn('relative flex shrink-0 items-center justify-center overflow-hidden rounded-sm', size === 'lg' ? 'size-9' : 'size-6'), children: _jsx(Image, { src: imgSrc, alt: "", referrerPolicy: "no-referrer", fill: true, sizes: size === 'lg' ? '36px' : '24px', className: "object-contain", unoptimized: true, onError: () => setBroken(true) }) }));
|
|
32
|
-
}
|
|
33
|
-
// No logo: a channel or a computer keeps its own glyph, because that glyph
|
|
34
|
-
// says what it is. An app shows its first letter. A plug says only "some app".
|
|
35
|
-
const glyph = connector.provider === 'channel'
|
|
36
|
-
? MessageSquare
|
|
37
|
-
: connector.provider === 'computer'
|
|
38
|
-
? Monitor
|
|
39
|
-
: undefined;
|
|
40
|
-
return _jsx(EntityAvatar, { icon: glyph, size: size, label: connector.name });
|
|
41
|
-
}
|
|
42
21
|
/**
|
|
43
22
|
* Green `✓` for a healthy project connector — same glyph Discovery/All use in
|
|
44
23
|
* the catalogue card's `trailing` slot. Not a badge: problem states keep the
|
|
@@ -49,19 +28,11 @@ export function ConnectorConnectedMark({ className } = {}) {
|
|
|
49
28
|
return (_jsx(CheckIcon, { "aria-hidden": true, weight: "bold", className: cn('text-kortix-green size-4 shrink-0', className), "data-testid": "catalog-connected" }));
|
|
50
29
|
}
|
|
51
30
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
31
|
+
* The state pill for a project connector: Needs account or Error. Connected
|
|
32
|
+
* returns `null`: put {@link ConnectorConnectedMark} in the card's `trailing`
|
|
33
|
+
* slot instead, the catalogue's `✓`.
|
|
55
34
|
*/
|
|
56
|
-
export function ConnectorStatusBadge({ connector }) {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const status = connectorSetupStatus(connector);
|
|
60
|
-
if (status === 'pending')
|
|
61
|
-
return (_jsx(Badge, { variant: "info", size: "sm", children: tPages('statusPending') }));
|
|
62
|
-
if (status === 'error')
|
|
63
|
-
return (_jsx(Badge, { variant: "destructive", size: "sm", children: tI18nHardcoded.raw('i18nComplete.text54a0e8c17ebb') }));
|
|
64
|
-
if (status === 'needs_setup')
|
|
65
|
-
return (_jsx(Badge, { variant: "info", size: "sm", children: tI18nHardcoded.raw('autoComponentsProjectsCustomizeSectionsConnectorsViewJsxTextNeedsSetupbefdbc49') }));
|
|
66
|
-
return null;
|
|
35
|
+
export function ConnectorStatusBadge({ connector, accountCount, }) {
|
|
36
|
+
const tone = connectorStatusTone(connector, accountCount);
|
|
37
|
+
return tone === 'connected' ? null : _jsx(ToneBadge, { tone: tone });
|
|
67
38
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/** The Pipedream
|
|
1
|
+
/** The Pipedream connectors a project can move to Kortix apps, each linked to its page.
|
|
2
|
+
* Composio is a supported way to connect, not a retired one: it never shows here. */
|
|
2
3
|
export declare function ConnectorMovesBanner({ projectId }: {
|
|
3
4
|
projectId: string;
|
|
4
5
|
}): import("react").JSX.Element | null;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { listConnectorMoves } from '@kortix/sdk';
|
|
4
|
-
import { useFeatureFlag } from '@kortix/sdk/react';
|
|
5
4
|
import { useQuery } from '@tanstack/react-query';
|
|
6
5
|
import { UiLink as Link } from '../../providers/ui-provider.js';
|
|
7
6
|
import { Fragment } from 'react';
|
|
@@ -9,17 +8,16 @@ import { InfoBanner } from '../../primitives/info-banner.js';
|
|
|
9
8
|
import { useTranslations } from '../../i18n/index.js';
|
|
10
9
|
import { connectorHref } from './connector-routes.js';
|
|
11
10
|
import { connectorMovesQueryKey } from './detail/connector-move-row.js';
|
|
12
|
-
/** The Pipedream
|
|
11
|
+
/** The Pipedream connectors a project can move to Kortix apps, each linked to its page.
|
|
12
|
+
* Composio is a supported way to connect, not a retired one: it never shows here. */
|
|
13
13
|
export function ConnectorMovesBanner({ projectId }) {
|
|
14
14
|
const t = useTranslations('connectorPages');
|
|
15
|
-
const enabled = useFeatureFlag(projectId, 'connectors_v2').enabled;
|
|
16
15
|
const moves = useQuery({
|
|
17
16
|
queryKey: connectorMovesQueryKey(projectId),
|
|
18
17
|
queryFn: () => listConnectorMoves(projectId),
|
|
19
|
-
enabled,
|
|
20
18
|
});
|
|
21
|
-
const movable = (moves.data ?? []).filter((move) => move.to);
|
|
22
|
-
if (
|
|
19
|
+
const movable = (moves.data ?? []).filter((move) => move.to && move.provider === 'pipedream');
|
|
20
|
+
if (movable.length === 0)
|
|
23
21
|
return null;
|
|
24
22
|
return (_jsx(InfoBanner, { tone: "info", title: t('movesBannerTitle', { count: movable.length }), children: _jsxs("p", { className: "text-muted-foreground text-xs text-pretty", children: [t('movesBannerBody'), ' ', movable.map((move, index) => (_jsxs(Fragment, { children: [index > 0 ? ', ' : null, _jsx(Link, { href: connectorHref(projectId, move.slug), className: "text-foreground underline-offset-2 hover:underline", children: move.name })] }, move.slug)))] }) }));
|
|
25
23
|
}
|
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
import type { CatalogEntry } from './catalog/catalog-entry.js';
|
|
2
|
+
import type { ConnectorScope } from './connector-filter.js';
|
|
2
3
|
/**
|
|
3
4
|
* The app segment of a connector reached without an app: the Connected tab, a
|
|
4
5
|
* custom connector, a computer. Its back link goes to the Connected tab.
|
|
5
6
|
*/
|
|
6
7
|
export declare const CONNECTED_APP_SEGMENT = "connected";
|
|
8
|
+
/** The id of the native Computer entry: it has its own page (`ComputerAppPage`). */
|
|
9
|
+
export declare const COMPUTER_APP_ID = "native:computer";
|
|
7
10
|
/**
|
|
8
|
-
* Which catalogue app a page belongs to, as the URL carries it.
|
|
9
|
-
*
|
|
10
|
-
* a managed app is looked up by slug.
|
|
11
|
+
* Which catalogue app a page belongs to, as the URL carries it. The app is
|
|
12
|
+
* fetched by `id` (`getDiscoverConnector`), so the id rides in the query.
|
|
11
13
|
*/
|
|
12
14
|
export type AppRef = {
|
|
13
15
|
source: 'discover';
|
|
14
16
|
slug: string;
|
|
15
17
|
id: string;
|
|
16
|
-
} | {
|
|
17
|
-
source: 'easy-connect';
|
|
18
|
-
slug: string;
|
|
19
18
|
};
|
|
20
|
-
|
|
19
|
+
/** The Connectors page on one tab. */
|
|
20
|
+
export declare function connectorsHref(projectId: string, scope?: ConnectorScope): string;
|
|
21
|
+
/** The Connectors page with the project's approval rules open (`?rules=1`). */
|
|
22
|
+
export declare function rulesHref(projectId: string): string;
|
|
21
23
|
export declare function connectorSearchFromParams(search: Pick<URLSearchParams, 'get'> | null | undefined): string;
|
|
22
24
|
/** Sets `?q=` to the trimmed query, or removes it when the query is empty. */
|
|
23
25
|
export declare function withConnectorSearch(params: URLSearchParams, query: string): URLSearchParams;
|
|
24
|
-
export declare function appRefFromEntry(entry: CatalogEntry): AppRef
|
|
25
|
-
|
|
26
|
+
export declare function appRefFromEntry(entry: CatalogEntry): AppRef;
|
|
27
|
+
/**
|
|
28
|
+
* An app's page. Once the project has the app it redirects to the connector
|
|
29
|
+
* page; `ways` keeps it open, to install the app as another profile.
|
|
30
|
+
*/
|
|
31
|
+
export declare function appHref(projectId: string, app: AppRef, options?: {
|
|
32
|
+
ways?: boolean;
|
|
33
|
+
}): string;
|
|
34
|
+
/** `?ways=1`: the app page stays open on an installed app, and Browse links there. */
|
|
35
|
+
export declare function waysFromParams(search: Pick<URLSearchParams, 'get'> | null | undefined): boolean;
|
|
36
|
+
/** Browse, searching for one app, with its cards opening the app page (`ways`). */
|
|
37
|
+
export declare function browseForAnotherProfileHref(projectId: string, name: string): string;
|
|
26
38
|
export declare function appRefFromLocation(appSegment: string, search: URLSearchParams | null): AppRef | null;
|
|
27
39
|
export declare function connectorHref(projectId: string, connectorSlug: string, options?: {
|
|
28
40
|
app?: AppRef | null;
|
|
@@ -4,6 +4,8 @@ import { customizePath } from '../../lib/routes.js';
|
|
|
4
4
|
* custom connector, a computer. Its back link goes to the Connected tab.
|
|
5
5
|
*/
|
|
6
6
|
export const CONNECTED_APP_SEGMENT = 'connected';
|
|
7
|
+
/** The id of the native Computer entry: it has its own page (`ComputerAppPage`). */
|
|
8
|
+
export const COMPUTER_APP_ID = 'native:computer';
|
|
7
9
|
function base(projectId) {
|
|
8
10
|
return customizePath(encodeURIComponent(projectId), 'connectors');
|
|
9
11
|
}
|
|
@@ -12,17 +14,16 @@ function withQuery(path, params) {
|
|
|
12
14
|
return query ? `${path}?${query}` : path;
|
|
13
15
|
}
|
|
14
16
|
function appParams(app) {
|
|
15
|
-
|
|
16
|
-
if (app.source === 'discover')
|
|
17
|
-
params.set('id', app.id);
|
|
18
|
-
else
|
|
19
|
-
params.set('src', 'apps');
|
|
20
|
-
return params;
|
|
17
|
+
return new URLSearchParams({ id: app.id });
|
|
21
18
|
}
|
|
19
|
+
/** The Connectors page on one tab. */
|
|
22
20
|
export function connectorsHref(projectId, scope) {
|
|
23
21
|
return scope ? `${base(projectId)}?scope=${scope}` : base(projectId);
|
|
24
22
|
}
|
|
25
|
-
/**
|
|
23
|
+
/** The Connectors page with the project's approval rules open (`?rules=1`). */
|
|
24
|
+
export function rulesHref(projectId) {
|
|
25
|
+
return `${base(projectId)}?rules=1`;
|
|
26
|
+
}
|
|
26
27
|
/**
|
|
27
28
|
* The catalogue search, held in `?q=`. Opening a connector is a route change
|
|
28
29
|
* that unmounts the catalogue; a search kept only in state was gone on browser
|
|
@@ -42,25 +43,33 @@ export function withConnectorSearch(params, query) {
|
|
|
42
43
|
return params;
|
|
43
44
|
}
|
|
44
45
|
export function appRefFromEntry(entry) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
return { source: 'discover', slug: entry.slug, id: entry.connector.id };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* An app's page. Once the project has the app it redirects to the connector
|
|
50
|
+
* page; `ways` keeps it open, to install the app as another profile.
|
|
51
|
+
*/
|
|
52
|
+
export function appHref(projectId, app, options = {}) {
|
|
53
|
+
const params = appParams(app);
|
|
54
|
+
if (options.ways)
|
|
55
|
+
params.set(WAYS_PARAM, '1');
|
|
56
|
+
return withQuery(`${base(projectId)}/${encodeURIComponent(app.slug)}`, params);
|
|
57
|
+
}
|
|
58
|
+
const WAYS_PARAM = 'ways';
|
|
59
|
+
/** `?ways=1`: the app page stays open on an installed app, and Browse links there. */
|
|
60
|
+
export function waysFromParams(search) {
|
|
61
|
+
return search?.get(WAYS_PARAM) === '1';
|
|
51
62
|
}
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
/** Browse, searching for one app, with its cards opening the app page (`ways`). */
|
|
64
|
+
export function browseForAnotherProfileHref(projectId, name) {
|
|
65
|
+
const params = withConnectorSearch(new URLSearchParams({ scope: 'all', [WAYS_PARAM]: '1' }), name);
|
|
66
|
+
return withQuery(base(projectId), params);
|
|
54
67
|
}
|
|
55
68
|
export function appRefFromLocation(appSegment, search) {
|
|
56
69
|
if (appSegment === CONNECTED_APP_SEGMENT)
|
|
57
70
|
return null;
|
|
58
71
|
const id = search?.get('id');
|
|
59
|
-
|
|
60
|
-
return { source: 'discover', slug: appSegment, id };
|
|
61
|
-
if (search?.get('src') === 'apps')
|
|
62
|
-
return { source: 'easy-connect', slug: appSegment };
|
|
63
|
-
return null;
|
|
72
|
+
return id ? { source: 'discover', slug: appSegment, id } : null;
|
|
64
73
|
}
|
|
65
74
|
export function connectorHref(projectId, connectorSlug, options = {}) {
|
|
66
75
|
const segment = options.app ? options.app.slug : CONNECTED_APP_SEGMENT;
|