@kortix/ui 0.16.2 → 0.16.4
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 +1 -4
- package/dist/customize/settings/rail-copy-context.d.ts +2 -0
- package/dist/customize/settings/rail-copy-context.js +2 -0
- package/dist/customize/settings/tabs/chrome-connections-tab.js +1 -1
- package/dist/files/renderers/show-content-renderer.js +3 -1
- package/dist/i18n/en.d.ts +14 -9
- package/dist/i18n/en.js +15 -10
- package/dist/internal/chrome/chrome-connect.d.ts +3 -5
- package/dist/internal/chrome/chrome-connect.js +7 -10
- package/dist/internal/chrome/extension.d.ts +1 -8
- package/dist/internal/chrome/extension.js +1 -8
- package/dist/internal/chrome/use-chrome-offered.d.ts +6 -12
- package/dist/internal/chrome/use-chrome-offered.js +13 -15
- package/dist/internal/layout/project-page-header.js +5 -4
- package/dist/internal/stores/user-preferences-store.d.ts +17 -0
- package/dist/internal/stores/user-preferences-store.js +5 -0
- package/dist/primitives/color-picker.d.ts +19 -0
- package/dist/primitives/color-picker.js +27 -0
- package/dist/primitives/faded-scroll-area.js +4 -0
- package/dist/primitives/glyph-picker.d.ts +11 -0
- package/dist/primitives/glyph-picker.js +10 -6
- package/dist/primitives/gradient-wallpaper-gl.d.ts +61 -0
- package/dist/primitives/gradient-wallpaper-gl.js +446 -0
- package/dist/primitives/gradient-wallpaper.d.ts +20 -0
- package/dist/primitives/gradient-wallpaper.js +242 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/session/composer/ComposerCard.js +0 -3
- package/dist/session/panel/easy/detail-view.js +3 -2
- package/dist/session/panel/shared/collect-tool-parts.js +2 -2
- package/dist/session/panel/shared/use-panel-handoffs.js +23 -2
- package/dist/session/thread/session-body.js +1 -1
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +5 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +7 -0
- package/dist/session/tool/show-group-renderer.d.ts +5 -5
- package/dist/session/tool/show-group-renderer.js +7 -4
- package/dist/session/tool/tool-part-renderer.js +3 -1
- package/dist/session/tool/tool-renderers.d.ts +1 -1
- package/dist/session/tool/tool-renderers.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +14 -9
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.js +2 -1
- package/dist/theme/wallpaper-gradients.d.ts +106 -0
- package/dist/theme/wallpaper-gradients.js +347 -0
- package/dist/theme/wallpapers.d.ts +23 -3
- package/dist/theme/wallpapers.js +53 -29
- package/dist/workspace/admin/project-admin-dashboard.js +1 -1
- package/dist/workspace/layout/project-home.js +1 -1
- package/dist/workspace/new/use-create-workspace.d.ts +5 -3
- package/dist/workspace/new/use-create-workspace.js +1 -1
- package/dist/workspace/session-spaces/space-picker.js +3 -3
- package/dist/workspace/setup/setup-banner-snooze.d.ts +10 -0
- package/dist/workspace/setup/setup-banner-snooze.js +44 -0
- package/dist/workspace/setup/setup-banner.js +19 -36
- package/dist/workspace/setup/setup-steps.d.ts +0 -5
- package/dist/workspace/setup/setup-steps.js +0 -7
- package/dist/workspace/setup/workspace-setup-modal.d.ts +39 -0
- package/dist/workspace/setup/workspace-setup-modal.js +202 -0
- package/dist/workspace/sidebar/project-session-list.js +2 -1
- package/dist/workspace/sidebar/project-sidebar.js +6 -5
- package/package.json +14 -10
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/modules.md +3 -1
- package/dist/primitives/toast-clearance.d.ts +0 -36
- package/dist/primitives/toast-clearance.js +0 -94
- package/dist/workspace/setup/workspace-setup-page.d.ts +0 -10
- package/dist/workspace/setup/workspace-setup-page.js +0 -91
|
@@ -417,7 +417,7 @@ export function ProjectAdminDashboard({ projectId, section, content, hostSection
|
|
|
417
417
|
// Every page header in the pane reads its title from the rail row,
|
|
418
418
|
// so the page is named exactly like the row that opened it. A page
|
|
419
419
|
// below a section (a connector) names itself.
|
|
420
|
-
_jsx(SettingsPageTitleProvider, { value: content ? null : activeRow.label, children: _jsx(Suspense, { fallback: _jsx(CapabilitiesSkeleton, {}), children: isProjectAdminResource(active) && ProjectPage ? (
|
|
420
|
+
_jsx(SettingsPageTitleProvider, { value: content ? null : activeRow.label, children: _jsx(Suspense, { fallback: _jsx(CapabilitiesSkeleton, {}), children: isProjectAdminResource(active) && ProjectPage ? (_jsx("div", { className: cn('flex min-h-0 flex-1 flex-col overflow-hidden', active === 'apps' && HOST_PANE_CLASS), children: content ?? _jsx(ProjectPage, { projectId: projectId }) })) : (
|
|
421
421
|
// Bounded, not scrolling: the account panes' split sheet
|
|
422
422
|
// (Invite, New key) splits this column, and the page and the
|
|
423
423
|
// sheet each scroll inside their own half.
|
|
@@ -309,5 +309,5 @@ function ProjectHomeView({ projectId, onSend, busy, beforeSend, onboarding: onbo
|
|
|
309
309
|
return (
|
|
310
310
|
// A file dropped anywhere on the page attaches to the composer, as on a
|
|
311
311
|
// session page.
|
|
312
|
-
_jsxs(ComposerDropZone, { className: "bg-background relative flex min-h-0 flex-1 flex-col overflow-hidden lg:px-4.5", children: [_jsx(ProjectHomeWallpaper, {}), _jsx(SidebarToggle, { placement: "floating" }), _jsx(AccessRequestsBell, { requests: accessRequests.data?.requests ?? [], to: accessRequestsTo }), firstChatPending || !onboarded || noAgent || !HomeAnnouncement ? null : _jsx(HomeAnnouncement, {}),
|
|
312
|
+
_jsxs(ComposerDropZone, { className: "bg-background relative flex min-h-0 flex-1 flex-col overflow-hidden lg:px-4.5", children: [_jsx(ProjectHomeWallpaper, {}), _jsx(SidebarToggle, { placement: "floating" }), _jsx(AccessRequestsBell, { requests: accessRequests.data?.requests ?? [], to: accessRequestsTo }), firstChatPending || !onboarded || noAgent || !HomeAnnouncement ? null : _jsx(HomeAnnouncement, {}), _jsx("div", { className: "relative z-10 mx-auto flex w-full max-w-2xl flex-col gap-2 px-4 pt-14 empty:hidden", children: _jsx(SplitNoticeBanner, { workspaceId: projectId }) }), _jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-6 z-20 flex justify-center px-4 empty:hidden", children: _jsx(SetupBanner, { projectId: projectId, className: "pointer-events-auto w-full max-w-xl" }, projectId) }), noAgentReason ? (_jsx(NoAgentHome, { reason: noAgentReason, repoUrl: projectRowQuery.data?.repo_url, branch: projectRowQuery.data?.default_branch, dashboardUrl: projectRowQuery.data?.dashboard_url })) : firstChat ? (_jsx(FirstChat, { projectId: projectId, composer: composer })) : (_jsx(ProjectHomeWelcomeBody, { projectId: projectId, onPickSuggestion: applySuggestion, composer: composer }))] }));
|
|
313
313
|
}
|
|
@@ -366,9 +366,11 @@ export type CreateOrchestrationClient = {
|
|
|
366
366
|
* on the project by itself (KRTX-1419).
|
|
367
367
|
*
|
|
368
368
|
* Implemented as `router.replace`, never `push`: the form state this
|
|
369
|
-
* replaces is not somewhere the user may navigate back into.
|
|
369
|
+
* replaces is not somewhere the user may navigate back into. A host that
|
|
370
|
+
* stays on its page (the CLI sign-in, KRTX-4940) reads the created
|
|
371
|
+
* `project` instead, to select its account.
|
|
370
372
|
*/
|
|
371
|
-
enterProject: (projectId: string) => void;
|
|
373
|
+
enterProject: (projectId: string, project: KortixProject) => void;
|
|
372
374
|
now: () => number;
|
|
373
375
|
};
|
|
374
376
|
export type CreateResult = {
|
|
@@ -435,7 +437,7 @@ export declare function runCreate(state: NewWorkspaceFormState, sourceAccountId:
|
|
|
435
437
|
* (`resolveTargetAccountId`). The managed source lets the server choose.
|
|
436
438
|
*/
|
|
437
439
|
export declare function useCreateWorkspace(options?: {
|
|
438
|
-
enterProject?: (projectId: string) => void;
|
|
440
|
+
enterProject?: (projectId: string, project: KortixProject) => void;
|
|
439
441
|
}): {
|
|
440
442
|
create: (state: NewWorkspaceFormState) => Promise<void>;
|
|
441
443
|
status: CreateStatus;
|
|
@@ -558,7 +558,7 @@ export async function runCreate(state, sourceAccountId, userId, client) {
|
|
|
558
558
|
// `completeThenNotify` accepts for the wizard's own exits.
|
|
559
559
|
await client.completeOnboarding(project.project_id).catch(() => { });
|
|
560
560
|
}
|
|
561
|
-
client.enterProject(project.project_id);
|
|
561
|
+
client.enterProject(project.project_id, project);
|
|
562
562
|
return { ok: true, project };
|
|
563
563
|
}
|
|
564
564
|
catch (error) {
|
|
@@ -8,7 +8,7 @@ import { cn } from '../../lib/utils.js';
|
|
|
8
8
|
import { Button } from '../../primitives/button.js';
|
|
9
9
|
import { CommandGroup, CommandInput, CommandItem, CommandList, CommandPopover, CommandPopoverContent, CommandPopoverTrigger, CommandSeparator, } from '../../primitives/command.js';
|
|
10
10
|
import { SpaceFormModal } from './space-form-modal.js';
|
|
11
|
-
import {
|
|
11
|
+
import { SpaceIconBare } from './space-icon.js';
|
|
12
12
|
/** Spaces on screen before the popover shows its search field (it stays mounted for the arrow keys). */
|
|
13
13
|
const SEARCH_THRESHOLD = 8;
|
|
14
14
|
/**
|
|
@@ -34,8 +34,8 @@ export function SpacePicker({ projectId, value, onChange, }) {
|
|
|
34
34
|
setOpen(false);
|
|
35
35
|
setSearch('');
|
|
36
36
|
};
|
|
37
|
-
const row = (space) => (_jsxs(CommandItem, { value: `space-${space.group_id}`, className: "gap-2", onSelect: () => pick(space.group_id), children: [_jsx(
|
|
38
|
-
return (_jsxs(_Fragment, { children: [_jsxs(CommandPopover, { open: open, onOpenChange: setOpen, children: [_jsx(CommandPopoverTrigger, { children: _jsxs(Button, { type: "button", variant: "ghost", size: "sm", "aria-label": picked ? `${t('picker')}: ${picked.name}` : t('picker'), className: cn('rounded-lg hit-area-y-3', picked ? 'text-foreground' : 'text-muted-foreground'), children: [picked ? _jsx(
|
|
37
|
+
const row = (space) => (_jsxs(CommandItem, { value: `space-${space.group_id}`, className: "gap-2", onSelect: () => pick(space.group_id), children: [_jsx(SpaceIconBare, { space: space }), _jsx("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: space.name }), space.group_id === value ? _jsx(CheckIcon, { className: "text-foreground size-4 shrink-0" }) : null] }, space.group_id));
|
|
38
|
+
return (_jsxs(_Fragment, { children: [_jsxs(CommandPopover, { open: open, onOpenChange: setOpen, children: [_jsx(CommandPopoverTrigger, { children: _jsxs(Button, { type: "button", variant: "ghost", size: "sm", "aria-label": picked ? `${t('picker')}: ${picked.name}` : t('picker'), className: cn('rounded-lg hit-area-y-3', picked ? 'text-foreground' : 'text-muted-foreground'), children: [picked ? _jsx(SpaceIconBare, { space: picked }) : _jsx(StackIcon, { className: "size-4 shrink-0" }), _jsx("span", { className: "max-w-[140px] truncate first-letter:uppercase", children: picked ? picked.name : t('picker') }), _jsx(CaretDownIcon, { className: cn('size-3 transition-transform duration-moderate ease-out', open && 'rotate-180') })] }) }), _jsxs(CommandPopoverContent, { side: "top", align: "start", sideOffset: 8, className: "w-[min(300px,calc(100vw-1.5rem))]", children: [_jsx("div", { className: spaces.length > SEARCH_THRESHOLD ? undefined : 'sr-only', children: _jsx(CommandInput, { compact: true, placeholder: t('pickerSearch'), value: search, onValueChange: setSearch }) }), _jsx(CommandList, { className: "max-h-[320px]", children: _jsxs(CommandGroup, { forceMount: true, className: "[&_[cmdk-group-items]]:flex [&_[cmdk-group-items]]:flex-col [&_[cmdk-group-items]]:gap-px", children: [query ? null : (_jsxs(CommandItem, { value: "space-none", className: "gap-2", onSelect: () => pick(null), children: [_jsx(StackIcon, { className: "text-muted-foreground size-4 shrink-0" }), _jsx("span", { className: "text-muted-foreground min-w-0 flex-1 truncate", children: t('pickerNone') }), value === null ? _jsx(CheckIcon, { className: "text-foreground size-4 shrink-0" }) : null] })), shown.map(row), query && shown.length === 0 ? (_jsx("div", { className: "text-muted-foreground py-6 text-center text-xs", children: t('pickerEmpty') })) : null, _jsx(CommandSeparator, { className: "my-1" }), _jsxs(CommandItem, { value: "space-new", className: "gap-2", onSelect: () => {
|
|
39
39
|
setOpen(false);
|
|
40
40
|
setCreating(true);
|
|
41
41
|
}, children: [_jsx(PlusIcon, { className: "size-4 shrink-0" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: t('newSpace') })] })] }) })] })] }), _jsx(SpaceFormModal, { projectId: projectId, space: null, open: creating, onOpenChange: setCreating, onSaved: (space) => onChange(space.group_id) })] }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Later" in the setup modal snoozes the home banner for this long. The banner
|
|
3
|
+
* has no dismiss of its own: the one way to quiet it is the modal it opens.
|
|
4
|
+
* It comes back after the snooze while a step is still open.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SETUP_BANNER_SNOOZE_MS: number;
|
|
7
|
+
/** Hide the banner of this workspace, in this browser, for `SETUP_BANNER_SNOOZE_MS`. */
|
|
8
|
+
export declare function snoozeSetupBanner(projectId: string, now?: number): void;
|
|
9
|
+
/** True while "Later" holds the banner of this workspace. The server renders it unsnoozed. */
|
|
10
|
+
export declare function useSetupBannerSnoozed(projectId: string): boolean;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useSyncExternalStore } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* "Later" in the setup modal snoozes the home banner for this long. The banner
|
|
5
|
+
* has no dismiss of its own: the one way to quiet it is the modal it opens.
|
|
6
|
+
* It comes back after the snooze while a step is still open.
|
|
7
|
+
*/
|
|
8
|
+
export const SETUP_BANNER_SNOOZE_MS = 24 * 60 * 60 * 1000;
|
|
9
|
+
const KEY = (projectId) => `kortix.setupBanner.snoozedUntil.${projectId}`;
|
|
10
|
+
/** Same-tab signal: `storage` events fire only in other tabs. */
|
|
11
|
+
const EVENT = 'kortix:setup-banner-snooze';
|
|
12
|
+
/** Hide the banner of this workspace, in this browser, for `SETUP_BANNER_SNOOZE_MS`. */
|
|
13
|
+
export function snoozeSetupBanner(projectId, now = Date.now()) {
|
|
14
|
+
try {
|
|
15
|
+
window.localStorage.setItem(KEY(projectId), String(now + SETUP_BANNER_SNOOZE_MS));
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// Private mode or blocked storage: the banner stays. Nothing else depends on it.
|
|
19
|
+
}
|
|
20
|
+
window.dispatchEvent(new Event(EVENT));
|
|
21
|
+
}
|
|
22
|
+
function snoozedUntil(projectId) {
|
|
23
|
+
try {
|
|
24
|
+
const raw = window.localStorage.getItem(KEY(projectId));
|
|
25
|
+
const until = raw ? Number(raw) : 0;
|
|
26
|
+
return Number.isFinite(until) ? until : 0;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function subscribe(onChange) {
|
|
33
|
+
window.addEventListener(EVENT, onChange);
|
|
34
|
+
window.addEventListener('storage', onChange);
|
|
35
|
+
return () => {
|
|
36
|
+
window.removeEventListener(EVENT, onChange);
|
|
37
|
+
window.removeEventListener('storage', onChange);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** True while "Later" holds the banner of this workspace. The server renders it unsnoozed. */
|
|
41
|
+
export function useSetupBannerSnoozed(projectId) {
|
|
42
|
+
// The snapshot is a boolean, so it stays stable between reads while the snooze holds.
|
|
43
|
+
return useSyncExternalStore(subscribe, () => snoozedUntil(projectId) > Date.now(), () => false);
|
|
44
|
+
}
|
|
@@ -1,57 +1,40 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
* The way back to `/workspaces/<id>/setup`. The workspace home shows it
|
|
5
|
-
* the
|
|
6
|
-
* in, a required secret, Slack. It
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* The way back to `/workspaces/<id>/setup`. The workspace home shows it,
|
|
5
|
+
* floating at the bottom of the page, while the setup page has an open step
|
|
6
|
+
* the viewer can finish: a connector to sign in, a required secret, Slack. It
|
|
7
|
+
* counts the same steps as the page. It has no dismiss of its own: "Later" in
|
|
8
|
+
* the setup modal snoozes it for a day (`setup-banner-snooze.ts`), and it goes
|
|
9
|
+
* for good when every step it counts is done.
|
|
9
10
|
*/
|
|
10
11
|
import { useProjectAccountId } from '@kortix/sdk/react';
|
|
11
|
-
import { XIcon } from '@phosphor-icons/react';
|
|
12
|
-
import { useState } from 'react';
|
|
13
12
|
import { useTranslations } from '../../i18n/index.js';
|
|
14
13
|
import { cn } from '../../lib/utils.js';
|
|
15
14
|
import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
|
|
16
15
|
import { useProjectCan } from '../../internal/lib/use-project-can.js';
|
|
17
|
-
import { Alert, AlertActions, AlertTitle } from '../../primitives/alert.js';
|
|
18
16
|
import { Button } from '../../primitives/button.js';
|
|
19
17
|
import { UiLink as Link } from '../../providers/ui-provider.js';
|
|
20
|
-
import { openStepsFor
|
|
18
|
+
import { openStepsFor } from './setup-steps.js';
|
|
19
|
+
import { useSetupBannerSnoozed } from './setup-banner-snooze.js';
|
|
21
20
|
import { useSetupSteps } from './use-setup-steps.js';
|
|
22
|
-
|
|
23
|
-
/** The step ids that were open when the viewer dismissed the banner, or null. */
|
|
24
|
-
function readDismissed(projectId) {
|
|
25
|
-
try {
|
|
26
|
-
const raw = window.localStorage.getItem(DISMISS_KEY(projectId));
|
|
27
|
-
const ids = raw ? JSON.parse(raw) : null;
|
|
28
|
-
return Array.isArray(ids) ? ids.filter((id) => typeof id === 'string') : null;
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
21
|
+
import { StepLogoStack, useStepCopy } from './workspace-setup-modal.js';
|
|
34
22
|
export function SetupBanner({ projectId, className }) {
|
|
35
23
|
const t = useTranslations('workspaceSetup');
|
|
24
|
+
const copy = useStepCopy();
|
|
36
25
|
const accountId = useProjectAccountId(projectId);
|
|
37
26
|
const canConnect = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_CONNECTOR_WRITE, { accountId }).allowed === true;
|
|
38
27
|
const canSetSecrets = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_SECRET_WRITE).allowed === true;
|
|
39
28
|
const { steps } = useSetupSteps(projectId, { enabled: canConnect || canSetSecrets });
|
|
40
29
|
const open = openStepsFor(steps, { connect: canConnect, setSecrets: canSetSecrets });
|
|
41
|
-
const
|
|
42
|
-
if (open.length === 0 ||
|
|
30
|
+
const snoozed = useSetupBannerSnoozed(projectId);
|
|
31
|
+
if (open.length === 0 || snoozed)
|
|
43
32
|
return null;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
setDismissed(ids);
|
|
53
|
-
};
|
|
54
|
-
return (
|
|
55
|
-
// One line: the title centers on the button, not on the alert's first line.
|
|
56
|
-
_jsxs(Alert, { variant: "default", className: cn('items-center', className), "data-testid": "setup-banner", children: [_jsx(AlertTitle, { children: t('bannerTitle', { left: open.length }) }), _jsxs(AlertActions, { children: [_jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsx(Link, { href: `/workspaces/${projectId}/setup`, children: t('title') }) }), _jsx(Button, { variant: "ghost", size: "icon-xs", "aria-label": t('bannerDismiss'), onClick: dismiss, children: _jsx(XIcon, { className: "size-3.5" }) })] })] }));
|
|
33
|
+
// One open step names itself ("Connect GitHub to finish setup"); more give the count.
|
|
34
|
+
const only = open.length === 1 ? open[0] : null;
|
|
35
|
+
const title = only ? t('bannerNamed', { action: copy.action(only) }) : t('bannerTitle', { left: open.length });
|
|
36
|
+
return (_jsxs("div", { role: "status", "data-testid": "setup-banner", className: cn(
|
|
37
|
+
// Floats over the home page: the light preset of the soft layered shadow
|
|
38
|
+
// (shadow.floriankiem.com `ring-sm`, the toasts' shadow), hairline included.
|
|
39
|
+
'bg-popover smooth-shadow-ring-sm flex items-center gap-3 rounded-xl py-2 pr-2 pl-3', 'animate-in fade-in-0 zoom-in-95 duration-normal ease-out motion-reduce:animate-none', className), children: [_jsx(StepLogoStack, { steps: open, ringClassName: "ring-popover" }), _jsx("p", { className: "text-foreground min-w-0 flex-1 truncate text-sm font-medium", title: open.map((step) => step.name).join(', '), children: title }), _jsx(Button, { asChild: true, size: "sm", children: _jsx(Link, { href: `/workspaces/${projectId}/setup`, children: steps.some((step) => step.done) ? t('bannerContinue') : t('bannerStart') }) })] }));
|
|
57
40
|
}
|
|
@@ -50,8 +50,3 @@ export declare function openStepsFor(steps: SetupStep[], can: {
|
|
|
50
50
|
connect: boolean;
|
|
51
51
|
setSecrets: boolean;
|
|
52
52
|
}): SetupStep[];
|
|
53
|
-
/**
|
|
54
|
-
* A dismissed banner stays hidden until a step opens that was not open when
|
|
55
|
-
* the viewer dismissed it, for example a connector a later setup added.
|
|
56
|
-
*/
|
|
57
|
-
export declare function setupBannerDismissed(open: SetupStep[], dismissedIds: readonly string[] | null): boolean;
|
|
@@ -44,10 +44,3 @@ export function setupSteps({ connectors, secrets, slack, slackName, }) {
|
|
|
44
44
|
export function openStepsFor(steps, can) {
|
|
45
45
|
return steps.filter((step) => !step.done && (step.kind === 'secret' ? can.setSecrets : can.connect));
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
48
|
-
* A dismissed banner stays hidden until a step opens that was not open when
|
|
49
|
-
* the viewer dismissed it, for example a connector a later setup added.
|
|
50
|
-
*/
|
|
51
|
-
export function setupBannerDismissed(open, dismissedIds) {
|
|
52
|
-
return dismissedIds !== null && open.every((step) => dismissedIds.includes(step.id));
|
|
53
|
-
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ConnectorLogoSize } from '../../internal/connector-logo/connector-logo.js';
|
|
2
|
+
import type { SetupStep } from './setup-steps.js';
|
|
3
|
+
/**
|
|
4
|
+
* `/workspaces/<id>/setup`: every step of a workspace's setup that only a
|
|
5
|
+
* person can do, in one modal over the workspace. The route keeps its URL:
|
|
6
|
+
* the web app intercepts it (`@modal/(.)setup`) over the page it was opened
|
|
7
|
+
* from, and a direct load draws it over the workspace home. `kortix onboard`
|
|
8
|
+
* opens that URL instead of printing a link per step, and `kortix onboard
|
|
9
|
+
* --wait` continues when every row is done. A missing model never reaches
|
|
10
|
+
* this modal: the workspace shell shows "Connect a model" first (`ProjectShell`).
|
|
11
|
+
*/
|
|
12
|
+
export declare function WorkspaceSetupModal({ projectId, onClose }: {
|
|
13
|
+
projectId: string;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function StepLogo({ step, size, className, }: {
|
|
17
|
+
step: SetupStep;
|
|
18
|
+
size?: ConnectorLogoSize;
|
|
19
|
+
className?: string;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* Steps' logos as an overlapping stack, the rest as "+N". Every logo sits on
|
|
23
|
+
* the same 28px tile, washed with its own colour: a blurred, scaled copy of
|
|
24
|
+
* the logo at low opacity behind the mark. The logo hosts send no CORS
|
|
25
|
+
* headers, so a canvas cannot read the colour; the browser blends it instead.
|
|
26
|
+
* Each tile overlaps the one before it and is cut out of it by a ring in the
|
|
27
|
+
* surface's own fill (`ringClassName`); the "+N" tile, last, is never hidden.
|
|
28
|
+
*/
|
|
29
|
+
export declare function StepLogoStack({ steps, max, ringClassName, }: {
|
|
30
|
+
steps: SetupStep[];
|
|
31
|
+
max?: number;
|
|
32
|
+
ringClassName: string;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
/** The words for one step: the verb that finishes it, whole or short. */
|
|
35
|
+
export declare function useStepCopy(): {
|
|
36
|
+
action: (step: SetupStep) => string;
|
|
37
|
+
/** The verb alone, for a row that already names the step. Slack keeps its own label. */
|
|
38
|
+
short: (step: SetupStep) => string | undefined;
|
|
39
|
+
};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { CheckCircleIcon, KeyIcon } from '@phosphor-icons/react';
|
|
4
|
+
import { getSlackMode } from '@kortix/sdk';
|
|
5
|
+
import { useProjectAccountId } from '@kortix/sdk/react';
|
|
6
|
+
import { useQuery } from '@tanstack/react-query';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { connectorHref } from '../../customize/connectors/connector-routes.js';
|
|
9
|
+
import { SetCredentialModal } from '../../customize/sections/connectors-view.js';
|
|
10
|
+
import { ProjectSecretDialog } from '../../customize/sections/view/secrets-view.js';
|
|
11
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
12
|
+
import { ConnectorLogo } from '../../internal/connector-logo/connector-logo.js';
|
|
13
|
+
import { installedConnectorLogoSource, resolveConnectorLogo } from '../../internal/connector-logo/connector-logo-source.js';
|
|
14
|
+
import { useAddAccount } from '../../internal/hooks/connectors/use-add-account.js';
|
|
15
|
+
import { SolidCheckIcon } from '../../internal/icons/solid-check-icon.js';
|
|
16
|
+
import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
|
|
17
|
+
import { useProjectCan } from '../../internal/lib/use-project-can.js';
|
|
18
|
+
import { cn } from '../../lib/utils.js';
|
|
19
|
+
import { AvatarGroup, AvatarGroupCount } from '../../primitives/avatar.js';
|
|
20
|
+
import { Button } from '../../primitives/button.js';
|
|
21
|
+
import { EmptyState } from '../../primitives/empty-state.js';
|
|
22
|
+
import { EmptyArt } from '../../primitives/empty-art.js';
|
|
23
|
+
import { ErrorState } from '../../primitives/error-state.js';
|
|
24
|
+
import { Modal, ModalContent, ModalDescription, ModalHeader, ModalTitle } from '../../primitives/modal.js';
|
|
25
|
+
import { Progress } from '../../primitives/progress.js';
|
|
26
|
+
import { Skeleton } from '../../primitives/skeleton.js';
|
|
27
|
+
import { UiLink as Link, useUiSearchParams } from '../../providers/ui-provider.js';
|
|
28
|
+
import { snoozeSetupBanner } from './setup-banner-snooze.js';
|
|
29
|
+
import { useSetupSteps } from './use-setup-steps.js';
|
|
30
|
+
/** While a step is open, read it again this often: the person may finish it in another tab. */
|
|
31
|
+
const OPEN_STEP_POLL_MS = 5_000;
|
|
32
|
+
/**
|
|
33
|
+
* `/workspaces/<id>/setup`: every step of a workspace's setup that only a
|
|
34
|
+
* person can do, in one modal over the workspace. The route keeps its URL:
|
|
35
|
+
* the web app intercepts it (`@modal/(.)setup`) over the page it was opened
|
|
36
|
+
* from, and a direct load draws it over the workspace home. `kortix onboard`
|
|
37
|
+
* opens that URL instead of printing a link per step, and `kortix onboard
|
|
38
|
+
* --wait` continues when every row is done. A missing model never reaches
|
|
39
|
+
* this modal: the workspace shell shows "Connect a model" first (`ProjectShell`).
|
|
40
|
+
*/
|
|
41
|
+
export function WorkspaceSetupModal({ projectId, onClose }) {
|
|
42
|
+
const t = useTranslations('workspaceSetup');
|
|
43
|
+
const params = useUiSearchParams();
|
|
44
|
+
const accountId = useProjectAccountId(projectId);
|
|
45
|
+
const canConnect = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_CONNECTOR_WRITE, { accountId }).allowed === true;
|
|
46
|
+
const canSetSecrets = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_SECRET_WRITE).allowed === true;
|
|
47
|
+
const { steps, usesSlack, loading, failed, refresh } = useSetupSteps(projectId, {
|
|
48
|
+
slackRequested: params.get('slack') === '1',
|
|
49
|
+
pollMs: OPEN_STEP_POLL_MS,
|
|
50
|
+
});
|
|
51
|
+
// The same cache entry as the Channels page (`useSlackMode`).
|
|
52
|
+
const slackModeQuery = useQuery({
|
|
53
|
+
queryKey: ['channels', 'slack-mode', projectId],
|
|
54
|
+
queryFn: () => getSlackMode(projectId),
|
|
55
|
+
enabled: usesSlack,
|
|
56
|
+
staleTime: 60_000,
|
|
57
|
+
});
|
|
58
|
+
const open = steps.filter((step) => !step.done);
|
|
59
|
+
const finished = steps.filter((step) => step.done);
|
|
60
|
+
const ready = !loading && !failed && steps.length > 0;
|
|
61
|
+
const complete = ready && open.length === 0;
|
|
62
|
+
const view = {
|
|
63
|
+
projectId,
|
|
64
|
+
canConnect,
|
|
65
|
+
canSetSecrets,
|
|
66
|
+
slackInstallUrl: slackModeQuery.data?.oauth_available ? slackModeQuery.data.install_url : null,
|
|
67
|
+
refresh,
|
|
68
|
+
};
|
|
69
|
+
// "Later" is the banner's one dismiss: it snoozes it for a day. "Done",
|
|
70
|
+
// Escape and a click outside only close.
|
|
71
|
+
const finishedOrEmpty = complete || (!loading && steps.length === 0);
|
|
72
|
+
const later = () => {
|
|
73
|
+
if (!finishedOrEmpty)
|
|
74
|
+
snoozeSetupBanner(projectId);
|
|
75
|
+
onClose();
|
|
76
|
+
};
|
|
77
|
+
return (_jsx(Modal, { open: true, onOpenChange: (isOpen) => {
|
|
78
|
+
if (!isOpen)
|
|
79
|
+
onClose();
|
|
80
|
+
}, children: _jsxs(ModalContent, { variant: "base", className: "space-y-0 overflow-hidden lg:grid lg:h-[min(34rem,85vh)] lg:max-w-4xl lg:grid-cols-[17rem_1fr]", "data-testid": "workspace-setup", children: [_jsxs("aside", { className: "bg-sidebar flex flex-col gap-6 border-b px-6 pt-6 pb-5 lg:border-r lg:border-b-0", children: [_jsxs(ModalHeader, { className: "space-y-1.5 p-0 pr-10 lg:pr-0", children: [_jsx(ModalTitle, { className: "text-xl font-medium text-balance", children: complete ? t('completeTitle') : t('title') }), _jsx(ModalDescription, { className: "text-sm text-pretty", children: complete ? t('completeDescription') : t('subtitle') })] }), ready ? (_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-foreground text-sm font-medium tabular-nums", children: t('progress', { done: finished.length, total: steps.length }) }), _jsx(Progress, { value: (finished.length / steps.length) * 100, getValueLabel: () => t('progress', { done: finished.length, total: steps.length }), className: "bg-muted h-1", indicatorClassName: "bg-kortix-green" })] })) : null, _jsxs("div", { className: "mt-auto hidden items-center justify-between gap-3 lg:flex", children: [_jsx("p", { className: "text-muted-foreground min-w-0 text-sm text-pretty", children: ready && !complete ? t('liveNote') : null }), _jsx(Button, { size: "sm", onClick: later, children: finishedOrEmpty ? t('done') : t('later') })] })] }), _jsx("div", { className: "min-h-0 overflow-y-auto px-6 pt-6 pb-6 lg:pt-14", children: loading ? (_jsx("ul", { className: "grid gap-2 sm:grid-cols-2", "aria-busy": "true", children: [0, 1, 2, 3].map((index) => (_jsx("li", { children: _jsx(Skeleton, { className: "h-14 rounded-lg" }) }, index))) })) : failed ? (_jsx(ErrorState, { size: "sm", title: t('loadFailed'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: refresh, children: t('tryAgain') }) })) : steps.length === 0 ? (_jsx(EmptyState, { media: _jsx(EmptyArt, { icon: CheckCircleIcon }), title: t('emptyTitle'), description: t('emptyDescription') })) : (_jsxs("div", { className: "space-y-6", children: [open.length > 0 ? (_jsx(StepSection, { title: t('sectionOpen'), count: open.length, children: _jsx("ul", { className: "grid gap-2 sm:grid-cols-2", children: open.map((step) => (_jsx(OpenStepTile, { view: view, step: step }, step.id))) }) })) : null, finished.length > 0 ? (
|
|
81
|
+
// What is already done is one quiet line, not a second list:
|
|
82
|
+
// the stack shows which, the count says how many.
|
|
83
|
+
_jsxs("div", { className: cn('flex items-center gap-3', open.length > 0 && 'border-t pt-5'), title: finished.map((step) => step.name).join(', '), children: [_jsx(StepLogoStack, { steps: finished, max: 5, ringClassName: "ring-background" }), _jsxs("p", { className: "text-muted-foreground flex min-w-0 items-center gap-1.5 text-xs", children: [_jsx(SolidCheckIcon, { className: "text-kortix-green size-3.5 shrink-0" }), t('doneSummary', { count: finished.length })] })] })) : null] })) }), _jsx("footer", { className: "flex justify-end border-t px-6 py-3 lg:hidden", children: _jsx(Button, { size: "sm", onClick: later, children: finishedOrEmpty ? t('done') : t('later') }) })] }) }));
|
|
84
|
+
}
|
|
85
|
+
function StepSection({ title, count, children }) {
|
|
86
|
+
return (_jsxs("section", { className: "space-y-2.5", children: [_jsxs("h3", { className: "text-muted-foreground flex items-baseline gap-1.5 text-xs", children: [title, _jsx("span", { className: "tabular-nums", children: count })] }), children] }));
|
|
87
|
+
}
|
|
88
|
+
/** An open step: its logo, its name, and the one control that finishes it. */
|
|
89
|
+
function OpenStepTile({ view, step }) {
|
|
90
|
+
return (_jsxs("li", { className: "flex min-w-0 items-center gap-3 rounded-lg border py-2.5 pr-2.5 pl-3", children: [_jsx(StepLogo, { step: step, size: "md" }), _jsx("p", { className: cn('text-foreground min-w-0 flex-1 truncate text-sm font-medium', step.kind === 'secret' && 'font-mono text-xs'), children: step.name }), _jsx(StepAction, { view: view, step: step })] }));
|
|
91
|
+
}
|
|
92
|
+
export function StepLogo({ step, size = 'lg', className, }) {
|
|
93
|
+
if (step.kind === 'connector') {
|
|
94
|
+
return _jsx(ConnectorLogo, { source: installedConnectorLogoSource(step.connector), size: size, className: className });
|
|
95
|
+
}
|
|
96
|
+
if (step.kind === 'slack')
|
|
97
|
+
return _jsx(ConnectorLogo, { source: { nativeApp: 'slack' }, size: size, className: className });
|
|
98
|
+
const tile = { xs: 'size-5 rounded-sm', sm: 'size-6 rounded-sm', md: 'size-8 rounded-md', lg: 'size-9 rounded-md', xl: 'size-14 rounded-xl' }[size];
|
|
99
|
+
const glyph = { xs: 'size-3', sm: 'size-3.5', md: 'size-4', lg: 'size-4', xl: 'size-6' }[size];
|
|
100
|
+
return (_jsx("span", { className: cn('bg-muted flex shrink-0 items-center justify-center', tile, className), children: _jsx(KeyIcon, { className: cn('text-muted-foreground', glyph) }) }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Steps' logos as an overlapping stack, the rest as "+N". Every logo sits on
|
|
104
|
+
* the same 28px tile, washed with its own colour: a blurred, scaled copy of
|
|
105
|
+
* the logo at low opacity behind the mark. The logo hosts send no CORS
|
|
106
|
+
* headers, so a canvas cannot read the colour; the browser blends it instead.
|
|
107
|
+
* Each tile overlaps the one before it and is cut out of it by a ring in the
|
|
108
|
+
* surface's own fill (`ringClassName`); the "+N" tile, last, is never hidden.
|
|
109
|
+
*/
|
|
110
|
+
export function StepLogoStack({ steps, max = 3, ringClassName, }) {
|
|
111
|
+
const shown = steps.slice(0, max);
|
|
112
|
+
const more = steps.length - shown.length;
|
|
113
|
+
// 7px corners on the 28px tile, 4px on the 18px mark inside it: between the
|
|
114
|
+
// `rounded-sm` (6px) and `rounded-md` (8px) rungs by design (Jay, 2026-11-21),
|
|
115
|
+
// the same curve at both sizes.
|
|
116
|
+
const tile = cn('relative flex size-7 shrink-0 items-center justify-center rounded-[7px] ring-2', ringClassName); // audit:allow 7px logo tile, between rungs by request
|
|
117
|
+
return (_jsxs(AvatarGroup, { "aria-hidden": true, className: "shrink-0 -space-x-1.5", children: [shown.map((step) => (_jsxs("span", { className: cn(tile, 'bg-background isolate overflow-hidden'), children: [_jsx(LogoWash, { src: stepLogoImage(step) }), _jsx(StepLogo, { step: step, size: "xs", className: "rounded-[4px] border-0 bg-transparent [&_img]:rounded-[4px]" }), " "] }, step.id))), more > 0 ? (_jsxs(AvatarGroupCount, { className: cn(tile, 'bg-muted text-muted-foreground w-auto min-w-7 px-1.5 text-xs font-medium tabular-nums'), children: ["+", more] })) : null] }));
|
|
118
|
+
}
|
|
119
|
+
/** The step's logo image URL, or null for a drawn mark (Slack, a secret's key) that has no image to wash with. */
|
|
120
|
+
function stepLogoImage(step) {
|
|
121
|
+
if (step.kind !== 'connector')
|
|
122
|
+
return null;
|
|
123
|
+
const logo = resolveConnectorLogo(installedConnectorLogoSource(step.connector));
|
|
124
|
+
return logo.kind === 'image' ? logo.src : null;
|
|
125
|
+
}
|
|
126
|
+
/** The logo's colour as a faint fill: the image itself, blurred past recognition. A drawn mark gets the muted fill. */
|
|
127
|
+
function LogoWash({ src }) {
|
|
128
|
+
const [failed, setFailed] = useState(false);
|
|
129
|
+
if (!src || failed)
|
|
130
|
+
return _jsx("span", { "aria-hidden": true, className: "bg-muted absolute inset-0 -z-10" });
|
|
131
|
+
return (
|
|
132
|
+
// eslint-disable-next-line @next/next/no-img-element -- third-party logos on arbitrary hosts; the Next loader adds nothing
|
|
133
|
+
_jsx("img", { src: src, alt: "", "aria-hidden": true, loading: "lazy", decoding: "async", referrerPolicy: "no-referrer", draggable: false, onError: () => setFailed(true), className: "pointer-events-none absolute inset-0 -z-10 size-full scale-150 object-cover opacity-40 blur-sm select-none" }));
|
|
134
|
+
}
|
|
135
|
+
/** The words for one step: the verb that finishes it, whole or short. */
|
|
136
|
+
export function useStepCopy() {
|
|
137
|
+
const t = useTranslations('workspaceSetup');
|
|
138
|
+
return {
|
|
139
|
+
action: (step) => step.kind === 'connector'
|
|
140
|
+
? step.broken
|
|
141
|
+
? t('reconnect', { name: step.name })
|
|
142
|
+
: t('connect', { name: step.name })
|
|
143
|
+
: step.kind === 'secret'
|
|
144
|
+
? t('setSecret', { name: step.name })
|
|
145
|
+
: t('addSlack'),
|
|
146
|
+
/** The verb alone, for a row that already names the step. Slack keeps its own label. */
|
|
147
|
+
short: (step) => step.kind === 'connector'
|
|
148
|
+
? step.broken
|
|
149
|
+
? t('reconnectShort')
|
|
150
|
+
: t('connectShort')
|
|
151
|
+
: step.kind === 'secret'
|
|
152
|
+
? t('setShort')
|
|
153
|
+
: undefined,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The control that finishes one step, or "Done". Hidden (not disabled) when
|
|
158
|
+
* the viewer may not do it.
|
|
159
|
+
*/
|
|
160
|
+
function StepAction({ view, step }) {
|
|
161
|
+
const t = useTranslations('workspaceSetup');
|
|
162
|
+
const copy = useStepCopy();
|
|
163
|
+
if (step.done) {
|
|
164
|
+
return (_jsxs("span", { className: "text-muted-foreground flex shrink-0 items-center gap-1.5 text-xs", children: [_jsx(SolidCheckIcon, { className: "text-kortix-green size-4 shrink-0" }), t('done')] }));
|
|
165
|
+
}
|
|
166
|
+
const label = copy.short(step);
|
|
167
|
+
if (step.kind === 'connector') {
|
|
168
|
+
return view.canConnect ? (_jsx(ConnectorAction, { projectId: view.projectId, connector: step.connector, name: step.name, broken: step.broken, onChanged: view.refresh, label: label ?? t('connect', { name: step.name }) })) : null;
|
|
169
|
+
}
|
|
170
|
+
if (step.kind === 'secret') {
|
|
171
|
+
return view.canSetSecrets ? (_jsx(SecretAction, { projectId: view.projectId, step: step, onChanged: view.refresh, label: label ?? t('setSecret', { name: step.name }) })) : null;
|
|
172
|
+
}
|
|
173
|
+
return _jsx(SlackAction, { projectId: view.projectId, installUrl: view.slackInstallUrl });
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Connect: the shared account every agent of the workspace uses, signed in at
|
|
177
|
+
* once, the same as the connector page's Add account with "Everyone". A
|
|
178
|
+
* connector whose account broke opens its own page, where the account is.
|
|
179
|
+
*/
|
|
180
|
+
function ConnectorAction({ projectId, connector, name, broken, onChanged, label, }) {
|
|
181
|
+
const [credential, setCredential] = useState(null);
|
|
182
|
+
const add = useAddAccount({ projectId, connector, displayName: name, onAdded: onChanged, onCredential: setCredential });
|
|
183
|
+
if (broken) {
|
|
184
|
+
return (_jsx(Button, { asChild: true, size: "sm", variant: "outline", "aria-label": label, children: _jsx(Link, { href: connectorHref(projectId, connector.slug), children: label }) }));
|
|
185
|
+
}
|
|
186
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { size: "sm", variant: "outline", disabled: add.pending, "aria-busy": add.pending, onClick: () => add.submit({ label: add.proposedLabel(), audience: 'project', picked: { memberIds: [], groupIds: [] } }), children: label }), credential ? (_jsx(SetCredentialModal, { projectId: projectId, connector: connector, connectionId: credential.connectionId, owner: credential.owner, open: true, onOpenChange: (open) => {
|
|
187
|
+
if (!open)
|
|
188
|
+
setCredential(null);
|
|
189
|
+
}, onSaved: () => {
|
|
190
|
+
setCredential(null);
|
|
191
|
+
onChanged();
|
|
192
|
+
} }, credential.connectionId)) : null] }));
|
|
193
|
+
}
|
|
194
|
+
function SecretAction({ projectId, step, onChanged, label, }) {
|
|
195
|
+
const [open, setOpen] = useState(false);
|
|
196
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { size: "sm", variant: "outline", onClick: () => setOpen(true), children: label }), _jsx(ProjectSecretDialog, { projectId: projectId, row: step.row, open: open, onOpenChange: setOpen, onSaved: onChanged })] }));
|
|
197
|
+
}
|
|
198
|
+
/** One-click "Add to Slack" in a new tab when the host has the Slack app; else the Channels page, which takes a bot token. */
|
|
199
|
+
function SlackAction({ projectId, installUrl }) {
|
|
200
|
+
const t = useTranslations('workspaceSetup');
|
|
201
|
+
return installUrl ? (_jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx("a", { href: installUrl, target: "_blank", rel: "noopener noreferrer", children: t('addSlack') }) })) : (_jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: `/workspaces/${projectId}/admin/connectors?scope=channels`, children: t('connectSlack') }) }));
|
|
202
|
+
}
|
|
@@ -43,6 +43,7 @@ import { selectCollapsedSections, selectGroupMode, selectHiddenSections, selectL
|
|
|
43
43
|
import { shouldBeginSessionSwitch, useSessionSwitchStore } from '../../internal/stores/session-switch-store.js';
|
|
44
44
|
import { directSubsessions, createProjectSession, listChangeRequests, restartProjectSession, sessionParentId, stopProjectSession, } from '@kortix/sdk';
|
|
45
45
|
import { SpaceFormModal } from '../session-spaces/space-form-modal.js';
|
|
46
|
+
import { SpaceIconBare } from '../session-spaces/space-icon.js';
|
|
46
47
|
import { qk, useProjectSession, useProjectSessions, useRuntimeSupports, useSessionChildren, useFeatureFlag, useProjectSessionGroups, useSessionGoal, } from '@kortix/sdk/react';
|
|
47
48
|
import { ArchiveIcon, ArrowsSplitIcon, CheckIcon, DotsThreeIcon, FunnelSimpleIcon, FolderSimpleIcon, FolderSimpleMinusIcon, PlusIcon, PushPinIcon, PushPinSlashIcon, RobotIcon, GitForkIcon, PencilSimpleIcon, ArrowCounterClockwiseIcon as RotateCcw, ShareIcon as Share, SquareIcon as Square, TagIcon, TrashIcon, } from '@phosphor-icons/react';
|
|
48
49
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
@@ -637,7 +638,7 @@ function ProjectSessionRow({ session, href, isActive, isSwitching, onNavigate, d
|
|
|
637
638
|
e.stopPropagation();
|
|
638
639
|
}, children: _jsx(DotsThreeIcon, { className: "size-4" }) }) }), _jsxs(DropdownMenuContent, { align: "start", side: "right", className: "w-44", onCloseAutoFocus: keepFocusForNewGroup, children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => deferAfterClose(() => onRename(session.session_id, displayTitle)), children: [_jsx(PencilSimpleIcon, {}), tI18nComplete.raw('text3064d79a295c')] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => deferAfterClose(() => onEditLabels(session)), children: [_jsx(TagIcon, {}), t('labels.menu')] }), groups && onMoveToGroup && (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { className: "cursor-pointer", children: [_jsx(FolderSimpleIcon, {}), tGroups('moveTo')] }), _jsxs(DropdownMenuSubContent, { className: "w-48", children: [groups.map((group) => {
|
|
639
640
|
const current = session.group_id === group.group_id;
|
|
640
|
-
return (_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: current, onSelect: () => deferAfterClose(() => onMoveToGroup(session.session_id, group.group_id)), children: [
|
|
641
|
+
return (_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: current, onSelect: () => deferAfterClose(() => onMoveToGroup(session.session_id, group.group_id)), children: [_jsx(SpaceIconBare, { space: group }), _jsx("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: group.name }), current ? _jsx(CheckIcon, { className: "text-muted-foreground ml-auto" }) : null] }, group.group_id));
|
|
641
642
|
}), groups.length > 0 && _jsx(DropdownMenuSeparator, {}), onNewGroupFor && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => {
|
|
642
643
|
markNewGroupFocus();
|
|
643
644
|
deferAfterClose(() => onNewGroupFor(session.session_id));
|
|
@@ -25,7 +25,6 @@ import { useBillingAccountId } from '../../internal/stores/billing-account-conte
|
|
|
25
25
|
import { useFeatureFlag } from '@kortix/sdk/react';
|
|
26
26
|
import { AppsModal } from '../../internal/apps-and-extensions/apps-modal.js';
|
|
27
27
|
import { useAppsModalStore } from '../../internal/stores/apps-modal-store.js';
|
|
28
|
-
import { CHROME_UI_ENABLED } from '../../internal/chrome/use-chrome-offered.js';
|
|
29
28
|
import { MagnifyingGlassIcon, NavigationArrowIcon, } from '@phosphor-icons/react';
|
|
30
29
|
import { UiLink as Link, useUiPathname } from '../../providers/ui-provider.js';
|
|
31
30
|
import { SettingsReturnTracker, SidebarDrill } from './sidebar-drill.js';
|
|
@@ -36,8 +35,11 @@ import { SidebarGlyph as PanelLeft } from '../../icons/sidebar-toggle.js';
|
|
|
36
35
|
import { Close } from '../../icons/close.js';
|
|
37
36
|
const isMac = typeof navigator !== 'undefined' && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
38
37
|
const modSymbol = isMac ? '⌘' : 'Ctrl';
|
|
39
|
-
/**
|
|
40
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Workspace pages with a centered bottom composer: home, one session (not the
|
|
40
|
+
* Sessions list), and `/setup`, whose modal opens over home with its banner.
|
|
41
|
+
*/
|
|
42
|
+
const CENTERED_COMPOSER_ROUTE = /\/workspaces\/[^/]+(?:\/setup|\/sessions\/[^/]+(?:\/.*)?)?\/?$/;
|
|
41
43
|
/** Workspace pages whose composer runs to the right edge: chat, DMs, channels, Spaces. */
|
|
42
44
|
const FULL_COMPOSER_ROUTE = /\/workspaces\/[^/]+\/(?:c|chat|dm|spaces)(?:\/.*)?$/;
|
|
43
45
|
export function ProjectSidebar({ projectId, menu, onOpenSearch, onOpenDownloadApp, }) {
|
|
@@ -61,8 +63,7 @@ export function ProjectSidebar({ projectId, menu, onOpenSearch, onOpenDownloadAp
|
|
|
61
63
|
// Chat (`chat`): the spaces list replaces New session, and the session list
|
|
62
64
|
// moves below it, closed by default (fail-closed: off until the project answers).
|
|
63
65
|
const chat = useFeatureFlag(projectId, 'chat').enabled;
|
|
64
|
-
|
|
65
|
-
const chrome = useFeatureFlag(projectId, 'chrome').enabled && CHROME_UI_ENABLED;
|
|
66
|
+
const chrome = useFeatureFlag(projectId, 'chrome').enabled;
|
|
66
67
|
// Open the project composer without creating a durable session.
|
|
67
68
|
const newSession = useNewProjectSession(projectId);
|
|
68
69
|
const creatingSession = useIsCreatingProjectSession(projectId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kortix/ui",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
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",
|
|
@@ -160,6 +160,10 @@
|
|
|
160
160
|
"types": "./dist/primitives/collapsible.d.ts",
|
|
161
161
|
"import": "./dist/primitives/collapsible.js"
|
|
162
162
|
},
|
|
163
|
+
"./color-picker": {
|
|
164
|
+
"types": "./dist/primitives/color-picker.d.ts",
|
|
165
|
+
"import": "./dist/primitives/color-picker.js"
|
|
166
|
+
},
|
|
163
167
|
"./command": {
|
|
164
168
|
"types": "./dist/primitives/command.d.ts",
|
|
165
169
|
"import": "./dist/primitives/command.js"
|
|
@@ -775,6 +779,10 @@
|
|
|
775
779
|
"types": "./dist/primitives/glyph-tint.d.ts",
|
|
776
780
|
"import": "./dist/primitives/glyph-tint.js"
|
|
777
781
|
},
|
|
782
|
+
"./gradient-wallpaper": {
|
|
783
|
+
"types": "./dist/primitives/gradient-wallpaper.d.ts",
|
|
784
|
+
"import": "./dist/primitives/gradient-wallpaper.js"
|
|
785
|
+
},
|
|
778
786
|
"./hint": {
|
|
779
787
|
"types": "./dist/primitives/hint.d.ts",
|
|
780
788
|
"import": "./dist/primitives/hint.js"
|
|
@@ -1976,10 +1984,6 @@
|
|
|
1976
1984
|
"types": "./dist/primitives/toast.d.ts",
|
|
1977
1985
|
"import": "./dist/primitives/toast.js"
|
|
1978
1986
|
},
|
|
1979
|
-
"./toast-clearance": {
|
|
1980
|
-
"types": "./dist/primitives/toast-clearance.d.ts",
|
|
1981
|
-
"import": "./dist/primitives/toast-clearance.js"
|
|
1982
|
-
},
|
|
1983
1987
|
"./toggle": {
|
|
1984
1988
|
"types": "./dist/primitives/toggle.d.ts",
|
|
1985
1989
|
"import": "./dist/primitives/toggle.js"
|
|
@@ -2145,9 +2149,9 @@
|
|
|
2145
2149
|
"types": "./dist/workspace/settings/use-leave-workspace.d.ts",
|
|
2146
2150
|
"import": "./dist/workspace/settings/use-leave-workspace.js"
|
|
2147
2151
|
},
|
|
2148
|
-
"./workspace/setup/workspace-setup-
|
|
2149
|
-
"types": "./dist/workspace/setup/workspace-setup-
|
|
2150
|
-
"import": "./dist/workspace/setup/workspace-setup-
|
|
2152
|
+
"./workspace/setup/workspace-setup-modal": {
|
|
2153
|
+
"types": "./dist/workspace/setup/workspace-setup-modal.d.ts",
|
|
2154
|
+
"import": "./dist/workspace/setup/workspace-setup-modal.js"
|
|
2151
2155
|
},
|
|
2152
2156
|
"./workspace/sidebar/footer/project-apps-nav": {
|
|
2153
2157
|
"types": "./dist/workspace/sidebar/footer/project-apps-nav.d.ts",
|
|
@@ -2262,7 +2266,7 @@
|
|
|
2262
2266
|
"@extend-ai/react-docx": "^0.7.5",
|
|
2263
2267
|
"@extend-ai/react-xlsx": "0.13.4",
|
|
2264
2268
|
"@glideapps/glide-data-grid": "6.0.4-alpha24",
|
|
2265
|
-
"@kortix/llm-catalog": "0.16.
|
|
2269
|
+
"@kortix/llm-catalog": "0.16.4",
|
|
2266
2270
|
"@lezer/highlight": "1.2.3",
|
|
2267
2271
|
"@paper-design/shaders-react": "^0.0.76",
|
|
2268
2272
|
"@phosphor-icons/react": "2.1.10",
|
|
@@ -2338,7 +2342,7 @@
|
|
|
2338
2342
|
"zustand": "^5.0.3"
|
|
2339
2343
|
},
|
|
2340
2344
|
"peerDependencies": {
|
|
2341
|
-
"@kortix/sdk": "^0.16.
|
|
2345
|
+
"@kortix/sdk": "^0.16.4",
|
|
2342
2346
|
"@tanstack/react-query": "^5.75.2",
|
|
2343
2347
|
"@types/react": ">=18",
|
|
2344
2348
|
"react": ">=19",
|