@kortix/ui 0.16.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_vendor/kortix-shared.js +133 -26
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/space-icon.d.ts +30 -0
- package/dist/_vendor/shared/space-slug.d.ts +12 -0
- package/dist/access/access/access-dialog.js +2 -2
- package/dist/access/share-dialog.d.ts +77 -0
- package/dist/access/share-dialog.js +160 -0
- package/dist/access/sharing-picker.d.ts +8 -1
- package/dist/access/sharing-picker.js +2 -2
- package/dist/changes/change-list.js +3 -3
- package/dist/customize/connectors/catalog/catalog-paging.d.ts +1 -1
- package/dist/customize/connectors/catalog/catalog-paging.js +1 -1
- package/dist/customize/providers/provider-sheet.js +17 -7
- package/dist/customize/sections/component/manifest-copy-block.js +1 -1
- package/dist/customize/sections/component/section-wrapper.d.ts +1 -8
- package/dist/customize/sections/component/section-wrapper.js +3 -3
- package/dist/customize/sections/llm-provider/model-capability-icons.js +1 -1
- package/dist/customize/sections/view/gateway/generation-controls.js +1 -1
- package/dist/customize/sections/view/git-view.js +1 -1
- package/dist/customize/settings/settings-tabs.js +0 -5
- package/dist/customize/settings/tabs/general-tab.js +2 -2
- package/dist/customize/shared/capability-page-shell.d.ts +2 -2
- package/dist/customize/shared/capability-page-shell.js +7 -5
- package/dist/customize/shared/capability-scroll-root.js +1 -2
- package/dist/customize/shared/catalog/catalog-card.js +1 -1
- package/dist/files/project/components/change-requests-panel.js +2 -2
- package/dist/files/project/components/checkpoint-detail-dialog.js +4 -4
- package/dist/files/project/components/checkpoints-panel.js +2 -2
- package/dist/files/project/components/drive-explorer.js +2 -2
- package/dist/files/project/components/file-breadcrumbs.js +1 -1
- package/dist/files/project/components/file-history-popover.js +2 -2
- package/dist/files/project/components/file-thumbnail.js +1 -1
- package/dist/files/project/components/open-change-request-dialog.js +1 -1
- package/dist/files/renderers/mermaid/mermaid-diagram.js +2 -2
- package/dist/files/renderers/show-content-renderer.js +6 -6
- package/dist/files/renderers/sqlite-renderer.js +8 -8
- package/dist/files/renderers/zip/zip-renderer.js +2 -2
- package/dist/files/viewer/file-content-renderer.js +5 -5
- package/dist/files/viewer/json-tree-view.js +3 -3
- package/dist/i18n/en.d.ts +131 -8
- package/dist/i18n/en.js +167 -44
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -3
- package/dist/internal/billing/use-cost-explorer.d.ts +9 -2
- package/dist/internal/billing/use-cost-explorer.js +22 -0
- package/dist/internal/billing/use-session-costs.d.ts +7 -2
- package/dist/internal/billing/use-session-costs.js +6 -0
- package/dist/internal/chrome/use-chrome-offered.d.ts +3 -3
- package/dist/internal/chrome/use-chrome-offered.js +3 -3
- package/dist/internal/components/nav-rail.d.ts +1 -20
- package/dist/internal/components/nav-rail.js +1 -15
- package/dist/internal/layout/project-page-header.d.ts +13 -9
- package/dist/internal/layout/project-page-header.js +14 -10
- package/dist/internal/lib/browser-noise/evidence.d.ts +2 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +16 -1
- package/dist/internal/lib/error-handler.js +0 -9
- package/dist/internal/lib/interface-theme-defaults.js +2 -2
- package/dist/internal/lib/project-actions.d.ts +4 -5
- package/dist/internal/lib/project-actions.js +3 -5
- package/dist/internal/lib/project-preamble.d.ts +42 -4
- package/dist/internal/lib/project-preamble.js +49 -5
- package/dist/internal/lib/web-notifications.js +17 -29
- package/dist/internal/outcomes/outcome-vocabulary.js +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +2 -2
- package/dist/internal/stores/workspace-settings-rail-store.d.ts +0 -8
- package/dist/internal/stores/workspace-settings-rail-store.js +0 -2
- package/dist/lib/routes.d.ts +7 -0
- package/dist/lib/routes.js +6 -1
- package/dist/markdown/doc-editor/doc-extensions.js +2 -0
- package/dist/markdown/doc-editor/doc-paste.d.ts +13 -0
- package/dist/markdown/doc-editor/doc-paste.js +67 -0
- package/dist/markdown/markdown-frontmatter.js +3 -3
- package/dist/markdown/markdown-policy.d.ts +1 -1
- package/dist/markdown/ordered-list.js +1 -1
- package/dist/primitives/context-menu.d.ts +1 -0
- package/dist/primitives/definition-list.js +1 -1
- package/dist/primitives/dropdown-menu.d.ts +1 -0
- package/dist/primitives/emoji-picker.js +1 -1
- package/dist/primitives/expandable-search.d.ts +57 -0
- package/dist/primitives/expandable-search.js +58 -0
- package/dist/primitives/favicon-avatar.js +1 -1
- package/dist/primitives/file-tree.d.ts +1 -1
- package/dist/primitives/file-tree.js +1 -1
- package/dist/primitives/glyph-picker.js +2 -2
- package/dist/primitives/input-group.js +1 -1
- package/dist/primitives/menu-base.d.ts +10 -0
- package/dist/primitives/menu-base.js +7 -2
- package/dist/primitives/phone-input.js +1 -1
- package/dist/primitives/profile-hover-card.d.ts +28 -0
- package/dist/primitives/profile-hover-card.js +22 -0
- package/dist/primitives/settings-section-header.d.ts +5 -5
- package/dist/primitives/settings-section-header.js +5 -5
- package/dist/primitives/sort-menu.d.ts +23 -0
- package/dist/primitives/sort-menu.js +54 -0
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/toast-clearance.d.ts +12 -28
- package/dist/primitives/toast-clearance.js +23 -45
- package/dist/primitives/user-avatar.js +2 -3
- package/dist/session/agents/subagent-dialog-content.js +28 -70
- package/dist/session/composer/ComposerCard.d.ts +4 -1
- package/dist/session/composer/ComposerCard.js +51 -7
- package/dist/session/composer/composer-chat-input.js +3 -1
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +6 -2
- package/dist/session/composer/composer-underbar.d.ts +3 -1
- package/dist/session/composer/composer-underbar.js +2 -2
- package/dist/session/composer/composer.d.ts +12 -0
- package/dist/session/composer/composer.js +112 -6
- package/dist/session/composer/draft/composer-draft.d.ts +1 -0
- package/dist/session/composer/draft/composer-draft.js +10 -2
- package/dist/session/composer/draft/draft-uploads.js +13 -2
- package/dist/session/composer/draft/use-composer-draft.d.ts +2 -0
- package/dist/session/composer/draft/use-composer-draft.js +41 -6
- package/dist/session/composer/drive-mentions.d.ts +34 -0
- package/dist/session/composer/drive-mentions.js +98 -0
- package/dist/session/composer/editor/composer-editor.d.ts +3 -0
- package/dist/session/composer/editor/composer-editor.js +3 -1
- package/dist/session/composer/editor/serialize.js +3 -4
- package/dist/session/composer/menus/mention-controller.d.ts +3 -0
- package/dist/session/composer/menus/mention-controller.js +5 -0
- package/dist/session/composer/menus/mention-menu.d.ts +20 -3
- package/dist/session/composer/menus/mention-menu.js +33 -6
- package/dist/session/composer/menus/menu-items.d.ts +16 -1
- package/dist/session/composer/menus/menu-items.js +21 -1
- package/dist/session/composer/submit-latch.d.ts +3 -1
- package/dist/session/composer/submit-latch.js +5 -1
- package/dist/session/composer/types.d.ts +9 -2
- package/dist/session/header/session-changes-indicator.js +1 -1
- package/dist/session/header/session-site-header.js +2 -2
- package/dist/session/media/sandbox-url-detector.js +3 -3
- package/dist/session/models/model-connection-gate.d.ts +5 -0
- package/dist/session/models/model-connection-gate.js +12 -3
- package/dist/session/models/model-connection-layout.d.ts +7 -0
- package/dist/session/models/model-connection-layout.js +7 -0
- package/dist/session/models/provider-failure-recovery.js +1 -1
- package/dist/session/models/subscription-offer.d.ts +6 -5
- package/dist/session/models/subscription-offer.js +6 -6
- package/dist/session/panel/advanced/advanced-panel.js +1 -1
- package/dist/session/panel/session-detail-panel.js +1 -1
- package/dist/session/panel/session-diff-viewer.js +1 -1
- package/dist/session/panel/session-files-explorer.js +1 -1
- package/dist/session/panel/session-files-panel.js +3 -3
- package/dist/session/panel/shared/action-navigator.js +1 -1
- package/dist/session/status/provisioning-failure.d.ts +4 -4
- package/dist/session/status/provisioning-failure.js +4 -4
- package/dist/session/status/session-busy-indicator.js +1 -1
- package/dist/session/status/session-error-banner.js +6 -1
- package/dist/session/thread/mention-chip.d.ts +1 -1
- package/dist/session/thread/mention-segments.d.ts +4 -2
- package/dist/session/thread/mention-segments.js +28 -1
- package/dist/session/thread/message-parsing.d.ts +11 -0
- package/dist/session/thread/message-parsing.js +22 -3
- package/dist/session/thread/optimistic-turn.d.ts +4 -2
- package/dist/session/thread/optimistic-turn.js +13 -11
- package/dist/session/thread/session-chat.js +6 -1
- package/dist/session/thread/session-context-message-explorer.js +1 -1
- package/dist/session/thread/session-older-autoload.d.ts +2 -3
- package/dist/session/thread/session-older-autoload.js +2 -3
- package/dist/session/thread/transcript.js +8 -10
- package/dist/session/tool/shared/error-and-connector.js +1 -1
- package/dist/session/tool/shared/file-list.js +2 -2
- package/dist/session/tool/shared/infrastructure-parts.js +1 -1
- package/dist/session/tool/shared/infrastructure-preview.js +1 -1
- package/dist/session/tool/shared/infrastructure-row-header.js +3 -3
- package/dist/session/tool/shared/infrastructure-rows.js +2 -2
- package/dist/session/tool/shared/output-block.js +4 -4
- package/dist/session/tool/shared/session-helpers.js +3 -3
- package/dist/session/tool/shared/structured-output.js +3 -3
- package/dist/session/tool/shared/todo-helpers.js +1 -1
- package/dist/session/tool/tool-error.js +2 -2
- package/dist/session/tool/tools/agent-spawn-tool.js +3 -3
- package/dist/session/tool/tools/agent-status-tool.js +1 -1
- package/dist/session/tool/tools/apply-patch-tool.js +1 -1
- package/dist/session/tool/tools/connector-get-tool.js +1 -1
- package/dist/session/tool/tools/connector-list-tool.js +1 -1
- package/dist/session/tool/tools/connector-tools.js +1 -1
- package/dist/session/tool/tools/edit-tool.js +1 -1
- package/dist/session/tool/tools/get-mem-tool.js +1 -1
- package/dist/session/tool/tools/glob-tool.js +1 -1
- package/dist/session/tool/tools/image-search-tool.js +1 -1
- package/dist/session/tool/tools/memory-search-tool.js +1 -1
- package/dist/session/tool/tools/memory-tool.js +4 -4
- package/dist/session/tool/tools/presentation-gen-tool.js +2 -2
- package/dist/session/tool/tools/project-delete-tool.js +1 -1
- package/dist/session/tool/tools/project-list-tool.js +1 -1
- package/dist/session/tool/tools/pty-read-tool.js +1 -1
- package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
- package/dist/session/tool/tools/pty-write-tool.js +1 -1
- package/dist/session/tool/tools/read-tool.js +1 -1
- package/dist/session/tool/tools/removed-connector-tool.js +1 -1
- package/dist/session/tool/tools/scrape-webpage-tool.js +1 -1
- package/dist/session/tool/tools/session-get-tool.js +3 -3
- package/dist/session/tool/tools/session-list-background-tool.js +1 -1
- package/dist/session/tool/tools/session-read-tool.js +1 -1
- package/dist/session/tool/tools/session-search-tool.js +1 -1
- package/dist/session/tool/tools/session-spawn-tool.js +1 -1
- package/dist/session/tool/tools/skill-tool.js +1 -1
- package/dist/session/tool/tools/todo-write-tool.js +1 -1
- package/dist/session/tool/tools/web-fetch-tool.js +1 -1
- package/dist/session/tool/tools/write-tool.js +1 -1
- package/dist/session/turn/activity-file-chips.js +7 -3
- package/dist/session/turn/activity-step.js +1 -1
- package/dist/session/turn/burst-summary-trigger.js +3 -3
- package/dist/session/turn/chain-step-trigger.js +1 -1
- package/dist/session/turn/plan-card.js +1 -1
- package/dist/session/turn/thought-chain-step.js +1 -1
- package/dist/session/turn/turn-work-accordion.js +1 -1
- package/dist/session/turn/user-message.js +13 -6
- package/dist/session/voice/use-call-card-position.d.ts +30 -0
- package/dist/session/voice/use-call-card-position.js +126 -0
- package/dist/session/voice/voice-call-card.js +10 -3
- package/dist/styles/theme.css +12 -0
- package/dist/styles/tokens.css +12 -6
- package/dist/styles.css +1 -1
- package/dist/terminal/session-terminal-panel.js +1 -1
- package/dist/test-utils/intl.d.ts +131 -8
- package/dist/workspace/admin/project-admin-dashboard.js +7 -24
- package/dist/workspace/calendar/calendar-page.js +1 -1
- package/dist/workspace/home/first-chat.d.ts +4 -3
- package/dist/workspace/home/first-chat.js +6 -6
- package/dist/workspace/home/welcome-body.js +2 -2
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/layout/project-home.js +9 -3
- package/dist/workspace/layout/use-project-home-send.d.ts +3 -1
- package/dist/workspace/layout/use-project-home-send.js +6 -2
- package/dist/workspace/memory/company-memory-page.js +2 -4
- package/dist/workspace/new/github-source.js +0 -1
- package/dist/workspace/new/new-workspace-form.d.ts +0 -1
- package/dist/workspace/new/new-workspace-form.js +0 -3
- package/dist/workspace/new/use-create-workspace.d.ts +1 -1
- package/dist/workspace/new/use-create-workspace.js +1 -2
- package/dist/workspace/session-spaces/space-detail-page.d.ts +35 -0
- package/dist/workspace/session-spaces/space-detail-page.js +307 -0
- package/dist/workspace/session-spaces/space-form-modal.d.ts +16 -0
- package/dist/workspace/session-spaces/space-form-modal.js +92 -0
- package/dist/workspace/session-spaces/space-icon.d.ts +36 -0
- package/dist/workspace/session-spaces/space-icon.js +52 -0
- package/dist/workspace/session-spaces/space-people.d.ts +51 -0
- package/dist/workspace/session-spaces/space-people.js +91 -0
- package/dist/workspace/session-spaces/space-picker.d.ts +11 -0
- package/dist/workspace/session-spaces/space-picker.js +42 -0
- package/dist/workspace/session-spaces/space-share-modal.d.ts +14 -0
- package/dist/workspace/session-spaces/space-share-modal.js +93 -0
- package/dist/workspace/session-spaces/spaces-page.d.ts +8 -0
- package/dist/workspace/session-spaces/spaces-page.js +125 -0
- package/dist/workspace/sessions/session-owner-filters.d.ts +2 -0
- package/dist/workspace/sessions/session-owner-filters.js +2 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +1 -1
- package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +7 -2
- package/dist/workspace/sidebar/footer/project-promo-cards.js +4 -3
- package/dist/workspace/sidebar/footer/project-sandbox-alert.js +1 -1
- package/dist/workspace/sidebar/footer/promo-card.d.ts +10 -1
- package/dist/workspace/sidebar/footer/promo-card.js +31 -2
- package/dist/workspace/sidebar/modal/session-people-picker.d.ts +13 -0
- package/dist/workspace/sidebar/modal/session-people-picker.js +72 -0
- package/dist/workspace/sidebar/modal/share-session-modal.js +2 -1
- package/dist/workspace/sidebar/project-nav-items.d.ts +1 -3
- package/dist/workspace/sidebar/project-nav-items.js +3 -8
- package/dist/workspace/sidebar/project-session-list.js +19 -12
- package/dist/workspace/sidebar/project-sidebar.js +13 -13
- package/dist/workspace/sidebar/project-spaces-nav.js +1 -2
- package/dist/workspace/sidebar/session-filter-menu.js +19 -13
- package/dist/workspace/sidebar/session-group-sections.d.ts +12 -12
- package/dist/workspace/sidebar/session-group-sections.js +56 -75
- package/dist/workspace/sidebar/sidebar-more-group.js +1 -1
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +2 -2
- package/dist/workspace/spaces/space-tabs.d.ts +26 -6
- package/dist/workspace/spaces/space-tabs.js +19 -8
- package/package.json +27 -31
- package/skills/kortix-ui/references/modules.md +2 -2
- package/dist/workspace/new/clone-param.d.ts +0 -11
- package/dist/workspace/new/clone-param.js +0 -15
- package/dist/workspace/new/provision-new-workspace.d.ts +0 -14
- package/dist/workspace/new/provision-new-workspace.js +0 -14
- package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +0 -8
- package/dist/workspace/sidebar/footer/project-inbox-nav.js +0 -29
|
@@ -12,9 +12,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
12
12
|
* down. Dragging a row onto the rest of the list takes it out of its group.
|
|
13
13
|
*/
|
|
14
14
|
import { ApiError } from '@kortix/sdk';
|
|
15
|
-
import { findCachedProjectSession, useCreateProjectSessionGroup, useDeleteProjectSessionGroup, useProjectSessions,
|
|
15
|
+
import { findCachedProjectSession, useCreateProjectSessionGroup, useDeleteProjectSessionGroup, useProjectSessions, useReorderProjectSessionGroups, useSetProjectSessionGroup, } from '@kortix/sdk/react';
|
|
16
16
|
import { useQueryClient } from '@tanstack/react-query';
|
|
17
|
-
import { ArrowDownIcon, ArrowUpIcon, ArrowsInLineVerticalIcon, DotsThreeIcon, PencilSimpleIcon, PlusIcon, TrashIcon, } from '@phosphor-icons/react';
|
|
17
|
+
import { ArrowDownIcon, ArrowUpIcon, ArrowsInLineVerticalIcon, DotsThreeIcon, PencilSimpleIcon, PlusIcon, StackIcon, TrashIcon, } from '@phosphor-icons/react';
|
|
18
18
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
19
19
|
import { useTranslations } from '../../i18n/index.js';
|
|
20
20
|
import { cn } from '../../internal/lib/utils.js';
|
|
@@ -22,13 +22,14 @@ import { Button } from '../../primitives/button.js';
|
|
|
22
22
|
import { ConfirmDialog } from '../../primitives/confirm-dialog.js';
|
|
23
23
|
import { Disclosure, DisclosureContent, DisclosureTrigger } from '../../primitives/disclosure.js';
|
|
24
24
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '../../primitives/dropdown-menu.js';
|
|
25
|
-
import
|
|
26
|
-
import Loading from '../../primitives/loading.js';
|
|
27
|
-
import { Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalTitle, } from '../../primitives/modal.js';
|
|
25
|
+
import Hint from '../../primitives/hint.js';
|
|
28
26
|
import { errorToast, successToast } from '../../primitives/toast.js';
|
|
29
27
|
import { moveGroupBy, moveGroupTo } from './session-group-order.js';
|
|
28
|
+
import { SpaceIconBare } from '../session-spaces/space-icon.js';
|
|
30
29
|
import { SESSION_MENU_TRIGGER_CLASS, SESSION_ROW_HEIGHT_CLASS, SIDEBAR_PAGE_SIZE, ShowMoreButton, } from '../../session/list/session-list-chrome.js';
|
|
31
30
|
import { CaretRightSolidIcon } from '../../icons/caret-right-solid.js';
|
|
31
|
+
import { uiRoutes } from '../../lib/routes.js';
|
|
32
|
+
import { UiLink, useUiPathname, useUiRouter } from '../../providers/ui-provider.js';
|
|
32
33
|
/** A dragged session row carries its id under this type. */
|
|
33
34
|
const SESSION_DRAG_TYPE = 'application/x-kortix-session';
|
|
34
35
|
/** A dragged group header carries its id under this type. */
|
|
@@ -61,7 +62,10 @@ export function keepFocusForNewGroup(event) {
|
|
|
61
62
|
}
|
|
62
63
|
/** Keeps a click or key inside a group's menu or dialog (portals bubble through React) off the header's toggle. */
|
|
63
64
|
const stopAtMenu = (event) => event.stopPropagation();
|
|
64
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* The sections-state id of one space. Spaces start collapsed: the id in the
|
|
67
|
+
* set means the space is open (unlike Pinned and Sessions, where it means closed).
|
|
68
|
+
*/
|
|
65
69
|
export function sessionGroupSectionId(groupId) {
|
|
66
70
|
return `group:${groupId}`;
|
|
67
71
|
}
|
|
@@ -150,53 +154,6 @@ export function useSessionGroupActions(projectId, groups) {
|
|
|
150
154
|
};
|
|
151
155
|
}, [file, reorder, groups, t, queryClient, projectId]);
|
|
152
156
|
}
|
|
153
|
-
/**
|
|
154
|
-
* Rename a group (a new group is named in place, `NewSessionGroupRow`). A
|
|
155
|
-
* taken name shows in the dialog; the dialog closes with a toast once the
|
|
156
|
-
* list holds the change.
|
|
157
|
-
*/
|
|
158
|
-
export function SessionGroupNameModal({ projectId, group, open, onOpenChange, }) {
|
|
159
|
-
const t = useTranslations('sidebar.sessionGroups');
|
|
160
|
-
const rename = useRenameProjectSessionGroup(projectId);
|
|
161
|
-
const [value, setValue] = useState('');
|
|
162
|
-
const [problem, setProblem] = useState(null);
|
|
163
|
-
const [syncedFor, setSyncedFor] = useState([open, group?.group_id ?? null]);
|
|
164
|
-
if (syncedFor[0] !== open || syncedFor[1] !== (group?.group_id ?? null)) {
|
|
165
|
-
setSyncedFor([open, group?.group_id ?? null]);
|
|
166
|
-
if (open) {
|
|
167
|
-
setValue(group?.name ?? '');
|
|
168
|
-
setProblem(null);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
const pending = rename.isPending;
|
|
172
|
-
const name = value.trim();
|
|
173
|
-
const unchanged = group !== null && name === group.name;
|
|
174
|
-
const submit = async () => {
|
|
175
|
-
if (!group || !name || unchanged || pending)
|
|
176
|
-
return;
|
|
177
|
-
setProblem(null);
|
|
178
|
-
try {
|
|
179
|
-
await rename.mutateAsync({ groupId: group.group_id, name });
|
|
180
|
-
successToast(t('renamed'));
|
|
181
|
-
onOpenChange(false);
|
|
182
|
-
}
|
|
183
|
-
catch (error) {
|
|
184
|
-
const code = error instanceof ApiError ? error.code : undefined;
|
|
185
|
-
setProblem(code === 'group_name_taken' ? t('nameTaken') : t('renameFailed'));
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
return (_jsx(Modal, { open: open, onOpenChange: (next) => !pending && onOpenChange(next), children: _jsxs(ModalContent, { className: "lg:max-w-md", children: [_jsx(ModalHeader, { children: _jsx(ModalTitle, { children: t('rename') }) }), _jsxs(ModalBody, { className: "space-y-2", children: [_jsx(Input, { autoFocus: true, value: value, maxLength: GROUP_NAME_MAX, placeholder: t('namePlaceholder'), "aria-label": t('namePlaceholder'), "aria-invalid": problem ? true : undefined, onChange: (event) => {
|
|
189
|
-
setValue(event.target.value);
|
|
190
|
-
setProblem(null);
|
|
191
|
-
}, onKeyDown: (event) => {
|
|
192
|
-
if (event.nativeEvent.isComposing)
|
|
193
|
-
return;
|
|
194
|
-
if (event.key === 'Enter') {
|
|
195
|
-
event.preventDefault();
|
|
196
|
-
void submit();
|
|
197
|
-
}
|
|
198
|
-
} }), problem ? (_jsx("p", { className: "text-destructive text-xs", role: "alert", children: problem })) : null] }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [_jsx(Button, { variant: "outline-ghost", size: "sm", className: "w-full sm:w-auto", onClick: () => onOpenChange(false), disabled: pending, children: t('cancel') }), _jsxs(Button, { size: "sm", className: "w-full sm:w-auto", onClick: () => void submit(), disabled: !name || unchanged || pending, children: [pending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, t('save')] })] })] }) }));
|
|
199
|
-
}
|
|
200
157
|
/** `base`, or `base 2`, `base 3`…: the first name no group of the project has (names are unique per project). */
|
|
201
158
|
export function nextSessionGroupName(groups, base) {
|
|
202
159
|
const taken = new Set(groups.map((group) => group.name.toLowerCase()));
|
|
@@ -268,6 +225,19 @@ export function NewSessionGroupRow({ projectId, defaultName, onDone, }) {
|
|
|
268
225
|
}
|
|
269
226
|
}, className: "border-input bg-background text-sidebar-foreground placeholder:text-muted-foreground focus-visible:border-ring h-7 w-full min-w-0 rounded-md border px-1.5 text-sm font-medium outline-none" }) }), _jsx("p", { className: "text-muted-foreground flex h-8 items-center px-2 text-xs", children: _jsx("span", { className: "truncate", children: t('empty') }) })] }));
|
|
270
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* The Spaces heading over the spaces: its label opens the Spaces page, its "+"
|
|
230
|
+
* (on hover) names a new space in place, like the Sessions header's controls.
|
|
231
|
+
*/
|
|
232
|
+
export function SpacesHeading({ projectId, onNew }) {
|
|
233
|
+
const tGroups = useTranslations('sidebar.sessionGroups');
|
|
234
|
+
const href = uiRoutes().sessionSpaces?.(projectId) ?? null;
|
|
235
|
+
const label = 'text-muted-foreground group-hover/spaces-header:text-sidebar-foreground min-w-0 flex-1 truncate text-sm font-medium';
|
|
236
|
+
return (_jsxs("div", { className: cn('group/spaces-header hover:bg-sidebar-row flex items-center gap-1 rounded-md px-2 transition-colors', SESSION_ROW_HEIGHT_CLASS), children: [href ? (_jsx(Hint, { label: tGroups('allSpaces'), side: "right", children: _jsx(UiLink, { href: href, prefetch: false, className: cn(label, 'self-stretch leading-8 focus-visible:outline-none'), children: tGroups('heading') }) })) : (_jsx("span", { className: label, children: tGroups('heading') })), _jsx(Hint, { label: tGroups('newGroup'), side: "right", children: _jsx(Button, { variant: "ghost", size: "icon-xs", type: "button", "aria-label": tGroups('newGroup'), onClick: () => {
|
|
237
|
+
markNewGroupFocus();
|
|
238
|
+
onNew();
|
|
239
|
+
}, className: cn(SESSION_MENU_TRIGGER_CLASS, 'relative opacity-0 before:absolute before:-inset-1', 'group-hover/spaces-header:opacity-100 focus-visible:opacity-100'), children: _jsx(PlusIcon, { className: "size-4" }) }) })] }));
|
|
240
|
+
}
|
|
271
241
|
/** Every group of the project, in order. */
|
|
272
242
|
export function SessionGroupSections({ groups, ...rest }) {
|
|
273
243
|
const groupIds = groups.map((group) => group.group_id);
|
|
@@ -277,7 +247,11 @@ function SessionGroupSection({ projectId, group, groupIds, labels, collapsedSect
|
|
|
277
247
|
const t = useTranslations('sidebar');
|
|
278
248
|
const tGroups = useTranslations('sidebar.sessionGroups');
|
|
279
249
|
const sectionId = sessionGroupSectionId(group.group_id);
|
|
280
|
-
const open =
|
|
250
|
+
const open = collapsedSectionIds.has(sectionId);
|
|
251
|
+
const spaceHref = uiRoutes().sessionSpace?.(projectId, group.group_id) ?? null;
|
|
252
|
+
// The space whose page is open reads as the current row, as a nav row does.
|
|
253
|
+
const pathname = useUiPathname();
|
|
254
|
+
const current = !!spaceHref && !!pathname && pathname.endsWith(spaceHref);
|
|
281
255
|
// Any starter and any depth, like Pinned: a session is in a group because
|
|
282
256
|
// someone put it there. Loaded only while the group is open.
|
|
283
257
|
const query = useProjectSessions(projectId, {
|
|
@@ -285,8 +259,9 @@ function SessionGroupSection({ projectId, group, groupIds, labels, collapsedSect
|
|
|
285
259
|
labels,
|
|
286
260
|
limit: SIDEBAR_PAGE_SIZE,
|
|
287
261
|
enabled: open,
|
|
288
|
-
// No focus refetch: a
|
|
289
|
-
//
|
|
262
|
+
// No focus refetch: a project with dozens of open groups would refetch
|
|
263
|
+
// every one of them. A session started in a space refetches these lists
|
|
264
|
+
// itself (`use-project-home-send.ts`).
|
|
290
265
|
refetchOnWindowFocus: false,
|
|
291
266
|
});
|
|
292
267
|
// A pinned row shows under Pinned only. The `group_id` check drops a row the
|
|
@@ -297,23 +272,21 @@ function SessionGroupSection({ projectId, group, groupIds, labels, collapsedSect
|
|
|
297
272
|
onDropSession: (sessionId) => void actions.move(sessionId, group.group_id),
|
|
298
273
|
onDropGroup: (groupId) => void actions.reorder(moveGroupTo(groupIds, groupId, index)),
|
|
299
274
|
});
|
|
300
|
-
return (_jsx("div", { ...drop.props, "data-session-group": group.group_id, children: _jsxs(Disclosure, { open: open, onOpenChange: () => onToggleSection(sectionId), className: "group/section space-y-1", transition: { duration: 0.15, ease: 'easeOut' }, children: [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
// Always shown: the caret is what tells a group from a date header.
|
|
316
|
-
className: "duration-normal size-4 shrink-0 transition-transform ease-out group-data-[state=open]/section:rotate-90" }), _jsx(SessionGroupMenu, { group: group, onRename: () => onRename(group), onNewGroup: onNewGroup, onCollapseOthers: groupIds.length > 1 ? () => onCollapseOthers(group.group_id) : null, onMoveUp: moveGroupBy(groupIds, group.group_id, -1), onMoveDown: moveGroupBy(groupIds, group.group_id, 1), onReorder: (ids) => void actions.reorder(ids), projectId: projectId })] }) }), _jsxs(DisclosureContent, { contentClassName: "space-y-px", children: [rows.map(renderNode), query.data !== undefined && rows.length === 0 && !query.hasNextPage ? (
|
|
275
|
+
return (_jsx("div", { ...drop.props, "data-session-group": group.group_id, children: _jsxs(Disclosure, { open: open, onOpenChange: () => onToggleSection(sectionId), className: "group/section space-y-1", transition: { duration: 0.15, ease: 'easeOut' }, children: [_jsxs("div", { draggable: true, onDragStart: (event) => {
|
|
276
|
+
event.dataTransfer.setData(GROUP_DRAG_TYPE, group.group_id);
|
|
277
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
278
|
+
draggingGroupId = group.group_id;
|
|
279
|
+
}, onDragEnd: () => {
|
|
280
|
+
draggingGroupId = null;
|
|
281
|
+
}, className: cn(
|
|
282
|
+
// A space reads like a nav row (Inbox, Drive): a 16px glyph slot, then its name, which opens the space.
|
|
283
|
+
// The glyph turns into the caret on hover; the caret folds the space's sessions under it.
|
|
284
|
+
'group/section-header text-sidebar-foreground/80 hover:bg-sidebar-row hover:text-sidebar-foreground relative flex items-center gap-2 rounded-md px-2 text-sm', SESSION_ROW_HEIGHT_CLASS, current && 'bg-active text-sidebar-accent-foreground font-medium hover:bg-active', drop.over === 'session' && 'bg-sidebar-row text-sidebar-foreground',
|
|
285
|
+
// A group dropped here takes this place: a line marks the side it
|
|
286
|
+
// lands on (below this group when it comes from above).
|
|
287
|
+
drop.over === 'group' &&
|
|
288
|
+
'before:bg-foreground/40 before:absolute before:inset-x-2 before:h-0.5 before:rounded-full', drop.over === 'group' &&
|
|
289
|
+
(groupIds.indexOf(draggingGroupId ?? '') < index ? 'before:bottom-0' : 'before:top-0')), children: [_jsx(DisclosureTrigger, { children: _jsxs("button", { type: "button", "aria-label": `${open ? tGroups('hideSessions') : tGroups('showSessions')}: ${group.name}`, className: "text-muted-foreground hover:text-sidebar-foreground hit-area-1.5 flex size-4 shrink-0 items-center justify-center rounded-sm", children: [_jsx(SpaceIconBare, { space: group, className: "-mx-0.5 size-5 group-hover/section-header:hidden group-focus-within/section-header:hidden" }), _jsx(CaretRightSolidIcon, { "aria-hidden": true, className: "duration-normal hidden size-4 transition-transform ease-out group-hover/section-header:block group-focus-within/section-header:block group-data-[state=open]/section:rotate-90" })] }) }), spaceHref ? (_jsx(UiLink, { href: spaceHref, prefetch: false, "aria-current": current ? 'page' : undefined, className: "min-w-0 flex-1 truncate self-stretch leading-8 first-letter:uppercase focus-visible:outline-none", children: group.name })) : (_jsx("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: group.name })), _jsx(SessionGroupMenu, { group: group, onRename: () => onRename(group), onNewGroup: onNewGroup, onCollapseOthers: groupIds.length > 1 ? () => onCollapseOthers(group.group_id) : null, onMoveUp: moveGroupBy(groupIds, group.group_id, -1), onMoveDown: moveGroupBy(groupIds, group.group_id, 1), onReorder: (ids) => void actions.reorder(ids), projectId: projectId })] }), _jsxs(DisclosureContent, { contentClassName: "space-y-px pl-4", children: [rows.map(renderNode), query.data !== undefined && rows.length === 0 && !query.hasNextPage ? (
|
|
317
290
|
// Aligned to the name's x (px-2), one row tall.
|
|
318
291
|
_jsx("p", { className: "text-muted-foreground flex h-8 items-center px-2 text-xs", children: _jsx("span", { className: "truncate", children: tGroups('empty') }) })) : null, query.hasNextPage && (_jsx(ShowMoreButton, { loading: query.isFetchingNextPage, failed: query.isFetchNextPageError, label: t('loadMore'), onClick: () => query.fetchNextPage() }))] })] }) }));
|
|
319
292
|
}
|
|
@@ -325,6 +298,9 @@ function SessionGroupSection({ projectId, group, groupIds, labels, collapsedSect
|
|
|
325
298
|
*/
|
|
326
299
|
function SessionGroupMenu({ projectId, group, onRename, onNewGroup, onCollapseOthers, onMoveUp, onMoveDown, onReorder, }) {
|
|
327
300
|
const tGroups = useTranslations('sidebar.sessionGroups');
|
|
301
|
+
const router = useUiRouter();
|
|
302
|
+
const spaceHref = uiRoutes().sessionSpace?.(projectId, group.group_id) ?? null;
|
|
303
|
+
const pathname = useUiPathname();
|
|
328
304
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
329
305
|
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
330
306
|
const remove = useDeleteProjectSessionGroup(projectId);
|
|
@@ -333,14 +309,19 @@ function SessionGroupMenu({ projectId, group, onRename, onNewGroup, onCollapseOt
|
|
|
333
309
|
requestAnimationFrame(fn);
|
|
334
310
|
};
|
|
335
311
|
return (
|
|
336
|
-
// `contents`: the trigger stays a flex item of the header
|
|
337
|
-
_jsxs("span", { className: "contents", onClick: stopAtMenu, onKeyDown: stopAtMenu, children: [_jsxs(DropdownMenu, { open: menuOpen, onOpenChange: setMenuOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-xs", type: "button", "aria-label": `${tGroups('groupOptions')}: ${group.name}`, className: cn(SESSION_MENU_TRIGGER_CLASS, 'relative
|
|
312
|
+
// `contents`: the trigger stays a flex item of the header, after the name.
|
|
313
|
+
_jsxs("span", { className: "contents", onClick: stopAtMenu, onKeyDown: stopAtMenu, children: [_jsxs(DropdownMenu, { open: menuOpen, onOpenChange: setMenuOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-xs", type: "button", "aria-label": `${tGroups('groupOptions')}: ${group.name}`, className: cn(SESSION_MENU_TRIGGER_CLASS, 'relative opacity-0', 'before:absolute before:-inset-1', 'group-hover/section-header:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100'), children: _jsx(DotsThreeIcon, { className: "size-4" }) }) }), _jsxs(DropdownMenuContent, { align: "start", side: "right", className: "w-44", onCloseAutoFocus: keepFocusForNewGroup, children: [spaceHref ? (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => router.push(spaceHref), children: [_jsx(StackIcon, {}), tGroups('openSpace')] }), _jsx(DropdownMenuSeparator, {})] })) : null, _jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => {
|
|
338
314
|
markNewGroupFocus();
|
|
339
315
|
afterClose(onNewGroup);
|
|
340
316
|
}, children: [_jsx(PlusIcon, {}), tGroups('newGroup')] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => afterClose(onRename), children: [_jsx(PencilSimpleIcon, {}), tGroups('rename')] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: !onMoveUp, onSelect: () => onMoveUp && onReorder(onMoveUp), children: [_jsx(ArrowUpIcon, {}), tGroups('moveUp')] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: !onMoveDown, onSelect: () => onMoveDown && onReorder(onMoveDown), children: [_jsx(ArrowDownIcon, {}), tGroups('moveDown')] }), onCollapseOthers ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: onCollapseOthers, children: [_jsx(ArrowsInLineVerticalIcon, {}), tGroups('collapseOthers')] })] })) : null, _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "cursor-pointer", variant: "destructive", onSelect: () => afterClose(() => setConfirmOpen(true)), children: [_jsx(TrashIcon, {}), tGroups('delete')] })] })] }), _jsx(ConfirmDialog, { open: confirmOpen, onOpenChange: setConfirmOpen, title: tGroups('deleteTitle'), description: tGroups('deleteDescription', { name: group.name }), confirmLabel: tGroups('delete'), cancelLabel: tGroups('cancel'), confirmVariant: "destructive", isPending: remove.isPending, onConfirm: () => remove.mutate(group.group_id, {
|
|
341
317
|
onSuccess: () => {
|
|
342
318
|
setConfirmOpen(false);
|
|
343
319
|
successToast(tGroups('deleted'));
|
|
320
|
+
// Deleting the space you are looking at leaves its page for the spaces list,
|
|
321
|
+
// not a "This space does not exist" screen.
|
|
322
|
+
if (spaceHref && pathname?.endsWith(spaceHref)) {
|
|
323
|
+
router.push(uiRoutes().sessionSpaces?.(projectId) ?? uiRoutes().project(projectId));
|
|
324
|
+
}
|
|
344
325
|
},
|
|
345
326
|
onError: () => errorToast(tGroups('deleteFailed')),
|
|
346
327
|
}) })] }));
|
|
@@ -24,5 +24,5 @@ export function SidebarMoreGroup({ projectId, footer }) {
|
|
|
24
24
|
const expanded = useSessionExpandedStore(selectExpandedIds(projectId));
|
|
25
25
|
const toggleExpanded = useSessionExpandedStore((state) => state.toggleExpanded);
|
|
26
26
|
const open = expanded.includes(MORE_SECTION_ID);
|
|
27
|
-
return (_jsxs(Disclosure, { open: open, onOpenChange: () => toggleExpanded(projectId, MORE_SECTION_ID), className: cn('group/more flex min-h-0 flex-col', open ? 'max-h-1/2' : 'shrink-0'), transition: { duration: 0.15, ease: 'easeOut' }, children: [_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(DisclosureTrigger, { children: _jsxs(SidebarMenuButton, { className: "text-muted-foreground hover:text-sidebar-foreground", children: [_jsx(DotsThreeIcon, { weight: "bold" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: t('more') }), _jsx(CaretRightSolidIcon, { "aria-hidden": true, className: cn('size-4! shrink-0 transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none', open && 'rotate-90') })] }) }) }) }), _jsxs(DisclosureContent, { className: "flex min-h-0 flex-1 flex-col", contentClassName: "flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pt-1", children: [_jsx(SidebarMenu, { children: _jsx(ProjectNavItems, { projectId: projectId
|
|
27
|
+
return (_jsxs(Disclosure, { open: open, onOpenChange: () => toggleExpanded(projectId, MORE_SECTION_ID), className: cn('group/more flex min-h-0 flex-col', open ? 'max-h-1/2' : 'shrink-0'), transition: { duration: 0.15, ease: 'easeOut' }, children: [_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(DisclosureTrigger, { children: _jsxs(SidebarMenuButton, { className: "text-muted-foreground hover:text-sidebar-foreground", children: [_jsx(DotsThreeIcon, { weight: "bold" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: t('more') }), _jsx(CaretRightSolidIcon, { "aria-hidden": true, className: cn('size-4! shrink-0 transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none', open && 'rotate-90') })] }) }) }) }), _jsxs(DisclosureContent, { className: "flex min-h-0 flex-1 flex-col", contentClassName: "flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pt-1", children: [_jsx(SidebarMenu, { children: _jsx(ProjectNavItems, { projectId: projectId }) }), _jsx(ProjectSessionList, { projectId: projectId, secondary: true }), footer] })] }));
|
|
28
28
|
}
|
|
@@ -38,8 +38,8 @@ export function WorkspaceSettingsSidebarNav({ projectId, shown, onNavigate, }) {
|
|
|
38
38
|
const active = (listed ? fromUrl : undefined) ?? rail?.active;
|
|
39
39
|
// The page's settings landmark moved here with the rail.
|
|
40
40
|
return (_jsxs("nav", { "aria-label": tSettings('title'), className: "flex h-full min-h-0 flex-col space-y-2", children: [_jsx(SidebarGroup, { className: "py-0", children: _jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, className: "text-sidebar-foreground", children: _jsxs(Link, { href: backHref, prefetch: shown, onClick: onNavigate, children: [_jsx("span", { className: "shrink-0", children: _jsx(ArrowLeftIcon, { className: "cn-rtl-flip" }) }), _jsx("span", { children: tCommon('back') })] }) }) }) }) }), rail ? (_jsx(SettingsSearch, { projectId: projectId, rail: rail, active: active, shown: shown, onNavigate: onNavigate })) : (_jsx("div", { className: "min-h-0 flex-1", children: _jsx(RailSkeleton, {}) })), rail?.footer ? (
|
|
41
|
-
// Help sits under the groups, outside the scrolling list, behind
|
|
42
|
-
//
|
|
41
|
+
// Help sits under the groups, outside the scrolling list, behind a
|
|
42
|
+
// hairline: it must not read as a row of the last group.
|
|
43
43
|
_jsx("div", { className: "border-sidebar-border shrink-0 border-t", children: _jsx(RailGroup, { group: rail.footer, active: active, prefetch: shown, onNavigate: onNavigate }) })) : null] }));
|
|
44
44
|
}
|
|
45
45
|
const LIST_SCROLL_CLASS = 'min-h-0 flex-1 [scrollbar-width:none] overflow-y-auto [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden';
|
|
@@ -8,12 +8,13 @@ export declare const KIND_ICON: Record<ProjectSpaceTabKind, Icon>;
|
|
|
8
8
|
* runs, the tab row shows the list being saved. A person may edit a DM they
|
|
9
9
|
* own (every DM they see) or a channel they may edit (`can_edit`).
|
|
10
10
|
*/
|
|
11
|
-
export declare function useSpaceTabs(projectId: string, space: ProjectSpace):
|
|
11
|
+
export declare function useSpaceTabs(projectId: string, space: ProjectSpace): SpaceTabsState;
|
|
12
|
+
/** A place's tabs while they show, whether this person may change them, and the write that replaces them all. */
|
|
13
|
+
export interface SpaceTabsState {
|
|
12
14
|
tabs: ProjectSpaceTab[];
|
|
13
15
|
canEdit: boolean;
|
|
14
|
-
save: (next: ProjectSpaceTab[]) => Promise<
|
|
15
|
-
}
|
|
16
|
-
export type SpaceTabsState = ReturnType<typeof useSpaceTabs>;
|
|
16
|
+
save: (next: ProjectSpaceTab[]) => Promise<unknown>;
|
|
17
|
+
}
|
|
17
18
|
/**
|
|
18
19
|
* One stored tab in the tab row. A right click opens its menu; the open tab
|
|
19
20
|
* also shows a caret that opens the same menu: Rename, Move left, Move right,
|
|
@@ -30,13 +31,20 @@ export declare function StoredTabTrigger({ tab, index, active, state, }: {
|
|
|
30
31
|
* space's own folder), a folder (the space's own files, or a path), an
|
|
31
32
|
* artifact, an App or a link. The new tab opens.
|
|
32
33
|
*/
|
|
33
|
-
export declare function AddTabMenu({ projectId, space, state, onAdded, label, }: {
|
|
34
|
+
export declare function AddTabMenu({ projectId, space, ownFolder: ownFolderOverride, ownFolderTab, state, onAdded, label, triggerClassName, }: {
|
|
34
35
|
projectId: string;
|
|
35
|
-
|
|
36
|
+
/** A channel or DM: its own folder is the first folder offered. */
|
|
37
|
+
space?: ProjectSpace;
|
|
38
|
+
/** Another place's own folder (a Space's `/Spaces/<group_id>`), when there is no `space`. */
|
|
39
|
+
ownFolder?: string | null;
|
|
40
|
+
/** Offer the own folder as a tab ("This space's files"). False where the place already shows it as a built-in tab. */
|
|
41
|
+
ownFolderTab?: boolean;
|
|
36
42
|
state: SpaceTabsState;
|
|
37
43
|
onAdded: (id: string) => void;
|
|
38
44
|
/** A text trigger ("Add tab", the details panel) instead of the tab row's "+". */
|
|
39
45
|
label?: string;
|
|
46
|
+
/** Extra classes for the "+" trigger, for a host whose tab row has its own rhythm. */
|
|
47
|
+
triggerClassName?: string;
|
|
40
48
|
}): import("react").JSX.Element;
|
|
41
49
|
/** What a host's file view draws for a `file` tab. `place` is "#general" or the DM's agent. */
|
|
42
50
|
export interface SpaceFile {
|
|
@@ -72,3 +80,15 @@ export declare function StoredTabPanel({ projectId, space, tab, place, state, re
|
|
|
72
80
|
}) => ReactNode;
|
|
73
81
|
renderFile?: (file: SpaceFile) => ReactNode;
|
|
74
82
|
}): import("react").JSX.Element;
|
|
83
|
+
/**
|
|
84
|
+
* The body of a stored tab for any place that has tabs (a channel, a DM, a
|
|
85
|
+
* Space): `folder` and `file` render a Drive folder or file the host's way;
|
|
86
|
+
* the rest is the same everywhere.
|
|
87
|
+
*/
|
|
88
|
+
export declare function StoredTabBody({ projectId, tab, state, folder, file, }: {
|
|
89
|
+
projectId: string;
|
|
90
|
+
tab: ProjectSpaceTab;
|
|
91
|
+
state: SpaceTabsState;
|
|
92
|
+
folder?: (path: string, missing: ReactNode) => ReactNode;
|
|
93
|
+
file?: (path: string, title: string, missing: ReactNode) => ReactNode;
|
|
94
|
+
}): import("react").JSX.Element;
|
|
@@ -7,6 +7,7 @@ import { useState } from 'react';
|
|
|
7
7
|
import { framePolicy } from '../../files/viewer/preview-policy.js';
|
|
8
8
|
import { useProjectDrive } from '../../files/drives/use-drives.js';
|
|
9
9
|
import { useTranslations } from '../../i18n/index.js';
|
|
10
|
+
import { cn } from '../../lib/utils.js';
|
|
10
11
|
import { Button } from '../../primitives/button.js';
|
|
11
12
|
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger } from '../../primitives/context-menu.js';
|
|
12
13
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from '../../primitives/dropdown-menu.js';
|
|
@@ -73,7 +74,7 @@ export function StoredTabTrigger({ tab, index, active, state, }) {
|
|
|
73
74
|
* space's own folder), a folder (the space's own files, or a path), an
|
|
74
75
|
* artifact, an App or a link. The new tab opens.
|
|
75
76
|
*/
|
|
76
|
-
export function AddTabMenu({ projectId, space, state, onAdded, label, }) {
|
|
77
|
+
export function AddTabMenu({ projectId, space, ownFolder: ownFolderOverride, ownFolderTab = true, state, onAdded, label, triggerClassName, }) {
|
|
77
78
|
const t = useTranslations('spaces.view.tabEdit');
|
|
78
79
|
const artifactsOn = useFeatureFlag(projectId, 'artifacts').enabled;
|
|
79
80
|
const apps = useProjectApps(projectId);
|
|
@@ -82,10 +83,12 @@ export function AddTabMenu({ projectId, space, state, onAdded, label, }) {
|
|
|
82
83
|
const [ask, setAsk] = useState(null);
|
|
83
84
|
const { tabs, save } = state;
|
|
84
85
|
const full = tabs.length >= SPACE_TABS_MAX;
|
|
85
|
-
const name = space.kind === 'channel' ? space.slug : space.dm_agent_name;
|
|
86
|
-
const ownFolder =
|
|
87
|
-
?
|
|
88
|
-
|
|
86
|
+
const name = space ? (space.kind === 'channel' ? space.slug : space.dm_agent_name) : null;
|
|
87
|
+
const ownFolder = space
|
|
88
|
+
? name
|
|
89
|
+
? spaceDriveFolders(space.kind, name, drive.data?.personalFolder ?? null, space.visibility === 'private' ? space.space_id : null)?.files ?? null
|
|
90
|
+
: null
|
|
91
|
+
: (ownFolderOverride ?? null);
|
|
89
92
|
const add = async (kind, title, ref) => {
|
|
90
93
|
const tab = { id: newTabId(kind, tabs), title: tabTitle(title, t(`kind.${kind}`)), kind, ref };
|
|
91
94
|
await save(appendTab(tabs, tab));
|
|
@@ -93,7 +96,7 @@ export function AddTabMenu({ projectId, space, state, onAdded, label, }) {
|
|
|
93
96
|
};
|
|
94
97
|
const quick = (kind, title, ref) => () => void add(kind, title, ref).catch(() => undefined);
|
|
95
98
|
const open = (next) => requestAnimationFrame(() => setAsk(next));
|
|
96
|
-
return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { children: [_jsx(Hint, { label: full ? t('full', { max: SPACE_TABS_MAX }) : t('add'), side: "bottom", children: _jsx(DropdownMenuTrigger, { asChild: true, children: label ? (_jsxs(Button, { size: "sm", variant: "ghost", disabled: full, className: "text-muted-foreground hover:text-foreground gap-1.5 self-start", children: [_jsx(PlusIcon, { className: "size-3.5 shrink-0" }), label] })) : (_jsx(Button, { size: "icon-xs", variant: "ghost", "aria-label": t('add'), disabled: full, className:
|
|
99
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { children: [_jsx(Hint, { label: full ? t('full', { max: SPACE_TABS_MAX }) : t('add'), side: "bottom", children: _jsx(DropdownMenuTrigger, { asChild: true, children: label ? (_jsxs(Button, { size: "sm", variant: "ghost", disabled: full, className: "text-muted-foreground hover:text-foreground gap-1.5 self-start", children: [_jsx(PlusIcon, { className: "size-3.5 shrink-0" }), label] })) : (_jsx(Button, { size: "icon-xs", variant: "ghost", "aria-label": t('add'), disabled: full, className: cn('ml-1 shrink-0', triggerClassName), children: _jsx(PlusIcon, {}) })) }) }), _jsxs(DropdownMenuContent, { align: "start", className: "w-56", children: [_jsxs(DropdownMenuItem, { onSelect: () => open('file'), children: [_jsx(FileIcon, {}), t('fileItem')] }), _jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx(FolderSimpleIcon, {}), t('kind.folder')] }), _jsxs(DropdownMenuSubContent, { className: "w-56", children: [ownFolder && ownFolderTab ? (_jsx(DropdownMenuItem, { onSelect: quick('folder', t('spaceFiles'), ownFolder), children: t('spaceFiles') })) : null, _jsx(DropdownMenuItem, { onSelect: () => open('folder'), children: t('otherFolder') })] })] }), artifactsOn ? (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx(FileTextIcon, {}), t('kind.artifact')] }), _jsx(DropdownMenuSubContent, { className: "max-h-72 w-56 overflow-y-auto", children: (artifacts.data ?? []).length === 0 ? (_jsx(DropdownMenuItem, { disabled: true, children: t('noArtifacts') })) : ((artifacts.data ?? []).map((artifact) => (_jsx(DropdownMenuItem, { onSelect: quick('artifact', artifact.title, artifact.artifact_id), children: _jsx("span", { className: "truncate", children: artifact.title }) }, artifact.artifact_id)))) })] })) : null, _jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx(AppWindowIcon, {}), t('kind.app')] }), _jsx(DropdownMenuSubContent, { className: "max-h-72 w-56 overflow-y-auto", children: (apps.data ?? []).length === 0 ? (_jsx(DropdownMenuItem, { disabled: true, children: t('noApps') })) : ((apps.data ?? []).map((app) => (_jsx(DropdownMenuItem, { onSelect: quick('app', app.name, app.slug), children: _jsx("span", { className: "truncate", children: app.name }) }, app.app_id)))) })] }), _jsxs(DropdownMenuItem, { onSelect: () => open('link'), children: [_jsx(LinkSimpleIcon, {}), t('linkItem')] })] })] }), _jsx(TargetModal
|
|
97
100
|
// A new key per open: the path starts again from the space's folder.
|
|
98
101
|
, { kind: ask, initial: ask === 'file' ? filePathPrefix(ownFolder) : '', onClose: () => setAsk(null), onAdd: (kind, ref) => add(kind, kind === 'link' ? linkTitle(ref) : folderTitle(ref), ref) }, ask ?? 'closed')] }));
|
|
99
102
|
}
|
|
@@ -164,19 +167,27 @@ function RenameTabModal({ open, title, onClose, onSave, }) {
|
|
|
164
167
|
* empty state with "Remove tab" for a person who may edit.
|
|
165
168
|
*/
|
|
166
169
|
export function StoredTabPanel({ projectId, space, tab, place, state, renderFolder, renderFile, }) {
|
|
170
|
+
return (_jsx(StoredTabBody, { projectId: projectId, tab: tab, state: state, folder: renderFolder ? (path, missing) => renderFolder({ space, tab: 'files', place, path, missing }) : undefined, file: renderFile ? (path, title, missing) => renderFile({ space, place, path, title, missing }) : undefined }));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* The body of a stored tab for any place that has tabs (a channel, a DM, a
|
|
174
|
+
* Space): `folder` and `file` render a Drive folder or file the host's way;
|
|
175
|
+
* the rest is the same everywhere.
|
|
176
|
+
*/
|
|
177
|
+
export function StoredTabBody({ projectId, tab, state, folder, file, }) {
|
|
167
178
|
const t = useTranslations('spaces.view.tabEdit');
|
|
168
179
|
const removeAction = state.canEdit ? (_jsxs(Button, { variant: "outline", size: "sm", onClick: () => void state.save(removeTab(state.tabs, tab.id)).catch(() => undefined), children: [_jsx(XIcon, {}), t('remove')] })) : undefined;
|
|
169
180
|
const missing = (_jsx(EmptyState, { className: "min-h-full", media: _jsx(EmptyArt, { icon: KIND_ICON[tab.kind] ?? FileIcon }), title: t('missing.title'), description: t('missing.description'), action: removeAction }));
|
|
170
181
|
const ref = tab.ref ?? '';
|
|
171
182
|
switch (tab.kind) {
|
|
172
183
|
case 'file':
|
|
173
|
-
return ref &&
|
|
184
|
+
return ref && file ? _jsx(_Fragment, { children: file(ref, tab.title, missing) }) : missing;
|
|
174
185
|
case 'artifact':
|
|
175
186
|
return _jsx(ArtifactTab, { projectId: projectId, artifactId: ref, missingAction: removeAction });
|
|
176
187
|
case 'app':
|
|
177
188
|
return _jsx(AppTab, { projectId: projectId, slug: ref, missingAction: removeAction });
|
|
178
189
|
case 'folder':
|
|
179
|
-
return ref &&
|
|
190
|
+
return ref && folder ? _jsx(_Fragment, { children: folder(ref, missing) }) : missing;
|
|
180
191
|
case 'link':
|
|
181
192
|
if (!isLinkUrl(ref))
|
|
182
193
|
return missing;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kortix/ui",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"description": "Kortix UI: the shared React component library for apps/web, Kortix Apps and SDK hosts. Tailwind v4 classes, themed by CSS variables.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Elastic-2.0",
|
|
@@ -401,10 +401,6 @@
|
|
|
401
401
|
"types": "./dist/customize/shared/customize-tab-bar.d.ts",
|
|
402
402
|
"import": "./dist/customize/shared/customize-tab-bar.js"
|
|
403
403
|
},
|
|
404
|
-
"./customize/shared/entity/entity-files": {
|
|
405
|
-
"types": "./dist/customize/shared/entity/entity-files.d.ts",
|
|
406
|
-
"import": "./dist/customize/shared/entity/entity-files.js"
|
|
407
|
-
},
|
|
408
404
|
"./customize/shared/feature-gate-screen": {
|
|
409
405
|
"types": "./dist/customize/shared/feature-gate-screen.d.ts",
|
|
410
406
|
"import": "./dist/customize/shared/feature-gate-screen.js"
|
|
@@ -702,6 +698,10 @@
|
|
|
702
698
|
"types": "./dist/primitives/error-state.d.ts",
|
|
703
699
|
"import": "./dist/primitives/error-state.js"
|
|
704
700
|
},
|
|
701
|
+
"./expandable-search": {
|
|
702
|
+
"types": "./dist/primitives/expandable-search.d.ts",
|
|
703
|
+
"import": "./dist/primitives/expandable-search.js"
|
|
704
|
+
},
|
|
705
705
|
"./faded-scroll-area": {
|
|
706
706
|
"types": "./dist/primitives/faded-scroll-area.d.ts",
|
|
707
707
|
"import": "./dist/primitives/faded-scroll-area.js"
|
|
@@ -1191,10 +1191,6 @@
|
|
|
1191
1191
|
"types": "./dist/internal/lib/onboarding/last-project-cookie.d.ts",
|
|
1192
1192
|
"import": "./dist/internal/lib/onboarding/last-project-cookie.js"
|
|
1193
1193
|
},
|
|
1194
|
-
"./internal/lib/onboarding/provision-errors": {
|
|
1195
|
-
"types": "./dist/internal/lib/onboarding/provision-errors.d.ts",
|
|
1196
|
-
"import": "./dist/internal/lib/onboarding/provision-errors.js"
|
|
1197
|
-
},
|
|
1198
1194
|
"./internal/lib/onboarding/use-app-home": {
|
|
1199
1195
|
"types": "./dist/internal/lib/onboarding/use-app-home.d.ts",
|
|
1200
1196
|
"import": "./dist/internal/lib/onboarding/use-app-home.js"
|
|
@@ -1605,6 +1601,10 @@
|
|
|
1605
1601
|
"import": "./dist/primitives/preview-image.js"
|
|
1606
1602
|
},
|
|
1607
1603
|
"./print.css": "./dist/styles/print.css",
|
|
1604
|
+
"./profile-hover-card": {
|
|
1605
|
+
"types": "./dist/primitives/profile-hover-card.d.ts",
|
|
1606
|
+
"import": "./dist/primitives/profile-hover-card.js"
|
|
1607
|
+
},
|
|
1608
1608
|
"./progress": {
|
|
1609
1609
|
"types": "./dist/primitives/progress.d.ts",
|
|
1610
1610
|
"import": "./dist/primitives/progress.js"
|
|
@@ -1705,10 +1705,6 @@
|
|
|
1705
1705
|
"types": "./dist/session/models/ask-owner-for-credits-button.d.ts",
|
|
1706
1706
|
"import": "./dist/session/models/ask-owner-for-credits-button.js"
|
|
1707
1707
|
},
|
|
1708
|
-
"./session/models/connect-model-step": {
|
|
1709
|
-
"types": "./dist/session/models/connect-model-step.d.ts",
|
|
1710
|
-
"import": "./dist/session/models/connect-model-step.js"
|
|
1711
|
-
},
|
|
1712
1708
|
"./session/models/model-grouping": {
|
|
1713
1709
|
"types": "./dist/session/models/model-grouping.d.ts",
|
|
1714
1710
|
"import": "./dist/session/models/model-grouping.js"
|
|
@@ -1721,10 +1717,6 @@
|
|
|
1721
1717
|
"types": "./dist/session/models/model-selector.d.ts",
|
|
1722
1718
|
"import": "./dist/session/models/model-selector.js"
|
|
1723
1719
|
},
|
|
1724
|
-
"./session/models/use-workspace-model-gate": {
|
|
1725
|
-
"types": "./dist/session/models/use-workspace-model-gate.d.ts",
|
|
1726
|
-
"import": "./dist/session/models/use-workspace-model-gate.js"
|
|
1727
|
-
},
|
|
1728
1720
|
"./session/panel/audit/audit-credential-label": {
|
|
1729
1721
|
"types": "./dist/session/panel/audit/audit-credential-label.d.ts",
|
|
1730
1722
|
"import": "./dist/session/panel/audit/audit-credential-label.js"
|
|
@@ -1913,6 +1905,10 @@
|
|
|
1913
1905
|
"types": "./dist/primitives/slot.d.ts",
|
|
1914
1906
|
"import": "./dist/primitives/slot.js"
|
|
1915
1907
|
},
|
|
1908
|
+
"./sort-menu": {
|
|
1909
|
+
"types": "./dist/primitives/sort-menu.d.ts",
|
|
1910
|
+
"import": "./dist/primitives/sort-menu.js"
|
|
1911
|
+
},
|
|
1916
1912
|
"./split-sheet": {
|
|
1917
1913
|
"types": "./dist/primitives/split-sheet.d.ts",
|
|
1918
1914
|
"import": "./dist/primitives/split-sheet.js"
|
|
@@ -2073,18 +2069,10 @@
|
|
|
2073
2069
|
"types": "./dist/workspace/new/advanced-fields.d.ts",
|
|
2074
2070
|
"import": "./dist/workspace/new/advanced-fields.js"
|
|
2075
2071
|
},
|
|
2076
|
-
"./workspace/new/clone-param": {
|
|
2077
|
-
"types": "./dist/workspace/new/clone-param.d.ts",
|
|
2078
|
-
"import": "./dist/workspace/new/clone-param.js"
|
|
2079
|
-
},
|
|
2080
2072
|
"./workspace/new/new-workspace-form": {
|
|
2081
2073
|
"types": "./dist/workspace/new/new-workspace-form.d.ts",
|
|
2082
2074
|
"import": "./dist/workspace/new/new-workspace-form.js"
|
|
2083
2075
|
},
|
|
2084
|
-
"./workspace/new/provision-new-workspace": {
|
|
2085
|
-
"types": "./dist/workspace/new/provision-new-workspace.d.ts",
|
|
2086
|
-
"import": "./dist/workspace/new/provision-new-workspace.js"
|
|
2087
|
-
},
|
|
2088
2076
|
"./workspace/new/source-param": {
|
|
2089
2077
|
"types": "./dist/workspace/new/source-param.d.ts",
|
|
2090
2078
|
"import": "./dist/workspace/new/source-param.js"
|
|
@@ -2141,6 +2129,18 @@
|
|
|
2141
2129
|
"types": "./dist/workspace/review/types.d.ts",
|
|
2142
2130
|
"import": "./dist/workspace/review/types.js"
|
|
2143
2131
|
},
|
|
2132
|
+
"./workspace/session-spaces/space-detail-page": {
|
|
2133
|
+
"types": "./dist/workspace/session-spaces/space-detail-page.d.ts",
|
|
2134
|
+
"import": "./dist/workspace/session-spaces/space-detail-page.js"
|
|
2135
|
+
},
|
|
2136
|
+
"./workspace/session-spaces/space-icon": {
|
|
2137
|
+
"types": "./dist/workspace/session-spaces/space-icon.d.ts",
|
|
2138
|
+
"import": "./dist/workspace/session-spaces/space-icon.js"
|
|
2139
|
+
},
|
|
2140
|
+
"./workspace/session-spaces/spaces-page": {
|
|
2141
|
+
"types": "./dist/workspace/session-spaces/spaces-page.d.ts",
|
|
2142
|
+
"import": "./dist/workspace/session-spaces/spaces-page.js"
|
|
2143
|
+
},
|
|
2144
2144
|
"./workspace/settings/use-leave-workspace": {
|
|
2145
2145
|
"types": "./dist/workspace/settings/use-leave-workspace.d.ts",
|
|
2146
2146
|
"import": "./dist/workspace/settings/use-leave-workspace.js"
|
|
@@ -2181,10 +2181,6 @@
|
|
|
2181
2181
|
"types": "./dist/workspace/sidebar/modal/share-session-modal.d.ts",
|
|
2182
2182
|
"import": "./dist/workspace/sidebar/modal/share-session-modal.js"
|
|
2183
2183
|
},
|
|
2184
|
-
"./workspace/sidebar/project-nav-items": {
|
|
2185
|
-
"types": "./dist/workspace/sidebar/project-nav-items.d.ts",
|
|
2186
|
-
"import": "./dist/workspace/sidebar/project-nav-items.js"
|
|
2187
|
-
},
|
|
2188
2184
|
"./workspace/sidebar/project-session-list": {
|
|
2189
2185
|
"types": "./dist/workspace/sidebar/project-session-list.d.ts",
|
|
2190
2186
|
"import": "./dist/workspace/sidebar/project-session-list.js"
|
|
@@ -2266,7 +2262,7 @@
|
|
|
2266
2262
|
"@extend-ai/react-docx": "^0.7.5",
|
|
2267
2263
|
"@extend-ai/react-xlsx": "0.13.4",
|
|
2268
2264
|
"@glideapps/glide-data-grid": "6.0.4-alpha24",
|
|
2269
|
-
"@kortix/llm-catalog": "0.16.
|
|
2265
|
+
"@kortix/llm-catalog": "0.16.2",
|
|
2270
2266
|
"@lezer/highlight": "1.2.3",
|
|
2271
2267
|
"@paper-design/shaders-react": "^0.0.76",
|
|
2272
2268
|
"@phosphor-icons/react": "2.1.10",
|
|
@@ -2342,7 +2338,7 @@
|
|
|
2342
2338
|
"zustand": "^5.0.3"
|
|
2343
2339
|
},
|
|
2344
2340
|
"peerDependencies": {
|
|
2345
|
-
"@kortix/sdk": "^0.16.
|
|
2341
|
+
"@kortix/sdk": "^0.16.2",
|
|
2346
2342
|
"@tanstack/react-query": "^5.75.2",
|
|
2347
2343
|
"@types/react": ">=18",
|
|
2348
2344
|
"react": ">=19",
|
|
@@ -361,7 +361,7 @@ Names: `ActionPanel`, `AdvancedPanel`, `DiffDialog`, `EasyPanel`, `openSessionQu
|
|
|
361
361
|
|
|
362
362
|
## `@kortix/ui/workspace`
|
|
363
363
|
|
|
364
|
-
Source: `src/workspace/index.ts`. Composed workspace screens: session workspace, workspace sidebar, sessions list, workspace home, permission and route helpers.
|
|
364
|
+
Source: `src/workspace/index.ts`. `PROJECT_PAGE_HEADER_CLASS` is the shared workspace page-header class. Composed workspace screens: session workspace, workspace sidebar, sessions list, workspace home, permission and route helpers.
|
|
365
365
|
|
|
366
366
|
Mount: `SessionWorkspace` takes `session` (the `useSession` result): the thread plus the resizable side panel. `children` replaces the thread. `SessionLayout` is the same layout with explicit ids (`sessionId` = runtime id, `projectId`, `projectSessionId`, `bootStage`, `transient`) and the thread as `children`. Workspace screens take `projectId`; `ProjectSessionList` mounts inside a `SidebarProvider`. `ProjectHome` sends by itself (`useProjectHomeSend`: create the session with the prompt, open it); `beforeSend` gates it, `onSend` replaces it.
|
|
367
367
|
|
|
@@ -403,7 +403,7 @@ Channels and memory (behind the `chat` flag): `SpaceView` (`projectId`, `target`
|
|
|
403
403
|
|
|
404
404
|
Spaces (Work in progress, behind the `chat` flag; a space is a channel declared in kortix.yaml `spaces:`): `SPACES_FLAG` is that flag key. `useSpacesEnabled` (`projectId`) is true only while it is on. `spaceScope` (`items`, `config`, `enabled`, `bindingOf`) returns `{ spaces, groups, spaceOf }` for a list page; off, it offers no spaces and every item is workspace-wide. `useActiveSpace` (`projectId`) is the viewer's active space and its setter; off, it reads `null`. `useSpaceFilter` (`projectId`) is a list page's space filter value and setter; off, it is always `ALL_SPACES`. `SpaceFilterTabs` (`spaces`, `groups`, `value`, `onValueChange`) is the filter, and renders nothing without spaces. `spaceFilterLabel` (`value`, `spaces`, `projectWide`) names a filter value for an empty state.
|
|
405
405
|
|
|
406
|
-
Names: `SpaceView`, `SpaceViewProps`, `SpaceTarget`, `SpaceFolder`, `ChannelGlyph`, `agentLabel`, `MemoryView`, `MemoryViewProps`, `CompanyMemoryPage`, `MemoryLayerRef`, `useMemoryPageHref`, `ProjectPageHeader`, `useCapabilityAccess`, `useProjectNavRows`, `SidebarToggle`, `activeCapabilityTab`, `agentHref`, `capabilityTabHref`, `channelsHref`, `remindersHref`, `reviewHref`, `CUSTOMIZE_SECTION_ACCESS`, `CUSTOMIZE_SECTION_GATE_ACTIONS`, `PROJECT_ACTIONS`, `isCustomizeSectionVisible`, `CustomizeSection`, `ProjectAction`, `usePermission`, `usePermissions`, `usePermissionsFor`, `PROJECT_PAGE_ACTIONS`, `useProjectCan`, `useProjectCans`, `useProjectPageCans`, `CanResult`, `formatFireTime`, `nearestFire`, `reminderTitle`, `scheduleLabel`, `ProjectHomeWallpaper`, `ProjectHomeWelcomeBody`, `InstantSessionShell`, `ProjectFilesView`, `ProjectHome`, `ProjectHomeSendOptions`, `useProjectHomeSend`, `UseProjectHomeSendOptions`, `SavedSessionSkeleton`, `SessionLayout`, `SessionWorkspace`, `SessionLayoutProps`, `SessionWorkspaceProps`, `ProjectSessionsView`, `ProjectSessionList`, `ProjectSidebar`, `ShareSessionModal`
|
|
406
|
+
Names: `SpaceView`, `SpaceViewProps`, `SpaceTarget`, `SpaceFolder`, `ChannelGlyph`, `agentLabel`, `MemoryView`, `MemoryViewProps`, `CompanyMemoryPage`, `MemoryLayerRef`, `useMemoryPageHref`, `ProjectPageHeader`, `PROJECT_PAGE_HEADER_CLASS`, `useCapabilityAccess`, `useProjectNavRows`, `SidebarToggle`, `activeCapabilityTab`, `agentHref`, `capabilityTabHref`, `channelsHref`, `remindersHref`, `reviewHref`, `CUSTOMIZE_SECTION_ACCESS`, `CUSTOMIZE_SECTION_GATE_ACTIONS`, `PROJECT_ACTIONS`, `isCustomizeSectionVisible`, `CustomizeSection`, `ProjectAction`, `usePermission`, `usePermissions`, `usePermissionsFor`, `PROJECT_PAGE_ACTIONS`, `useProjectCan`, `useProjectCans`, `useProjectPageCans`, `CanResult`, `formatFireTime`, `nearestFire`, `reminderTitle`, `scheduleLabel`, `ProjectHomeWallpaper`, `ProjectHomeWelcomeBody`, `InstantSessionShell`, `ProjectFilesView`, `ProjectHome`, `ProjectHomeSendOptions`, `useProjectHomeSend`, `UseProjectHomeSendOptions`, `SavedSessionSkeleton`, `SessionLayout`, `SessionWorkspace`, `SessionLayoutProps`, `SessionWorkspaceProps`, `ProjectSessionsView`, `ProjectSessionList`, `ProjectSidebar`, `ShareSessionModal`
|
|
407
407
|
|
|
408
408
|
## `@kortix/ui/access`
|
|
409
409
|
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `/workspaces/new?clone=<itemId>` — seed the new workspace from a `registry:project`
|
|
3
|
-
* marketplace item instead of the blank starter. Replaces the removed
|
|
4
|
-
* projects-index list's `clone=` query param.
|
|
5
|
-
*
|
|
6
|
-
* The value is passed straight through to `source_item_id`, which the API
|
|
7
|
-
* type-checks against the catalogue BEFORE creating anything upstream
|
|
8
|
-
* (`projects.ts`: "Resolved + type-checked BEFORE any upstream repo/DB row is
|
|
9
|
-
* created"). So there is nothing to validate here beyond emptiness.
|
|
10
|
-
*/
|
|
11
|
-
export declare function readCloneParam(params: URLSearchParams): string | null;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `/workspaces/new?clone=<itemId>` — seed the new workspace from a `registry:project`
|
|
3
|
-
* marketplace item instead of the blank starter. Replaces the removed
|
|
4
|
-
* projects-index list's `clone=` query param.
|
|
5
|
-
*
|
|
6
|
-
* The value is passed straight through to `source_item_id`, which the API
|
|
7
|
-
* type-checks against the catalogue BEFORE creating anything upstream
|
|
8
|
-
* (`projects.ts`: "Resolved + type-checked BEFORE any upstream repo/DB row is
|
|
9
|
-
* created"). So there is nothing to validate here beyond emptiness.
|
|
10
|
-
*/
|
|
11
|
-
export function readCloneParam(params) {
|
|
12
|
-
const raw = params.get('clone');
|
|
13
|
-
const trimmed = raw?.trim();
|
|
14
|
-
return trimmed ? trimmed : null;
|
|
15
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type CreateWorkspaceInput, type KortixProject } from '@kortix/sdk';
|
|
2
|
-
/** A new workspace's provision input: no `account_id`, the server picks it. */
|
|
3
|
-
export type NewWorkspaceInput = CreateWorkspaceInput;
|
|
4
|
-
/**
|
|
5
|
-
* Create a whole workspace in one request: `POST /v1/projects/provision` with
|
|
6
|
-
* `new_workspace: true`. The server creates a new account the caller owns,
|
|
7
|
-
* then provisions its project (Workspaces D3; a retry with the same
|
|
8
|
-
* idempotency key returns the same workspace). A restricted self-host answers
|
|
9
|
-
* `403 account_creation_restricted` when a new account would be needed.
|
|
10
|
-
*
|
|
11
|
-
* For the hosts that create a workspace outside `/workspaces/new` (a marketplace item, a
|
|
12
|
-
* use-case template). The SDK's `createWorkspace` carries the flag.
|
|
13
|
-
*/
|
|
14
|
-
export declare function provisionNewWorkspace(input: NewWorkspaceInput): Promise<KortixProject>;
|