@kortix/ui 0.15.8 → 0.15.10
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 +75 -1
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/session/attachment-tile.d.ts +32 -0
- package/dist/_vendor/shared/session/stop-refusal.d.ts +15 -0
- package/dist/_vendor/shared/session/tool-row-text.d.ts +58 -0
- package/dist/_vendor/shared/session-delivery.d.ts +2 -0
- package/dist/access/access/access-dialog-share.js +12 -6
- package/dist/access/access/share-selection.d.ts +9 -0
- package/dist/access/access/share-selection.js +64 -0
- package/dist/customize/connectors/connector-identity.js +3 -3
- package/dist/customize/connectors/connectors-page.js +1 -1
- package/dist/customize/connectors/detail/app-page.js +2 -2
- package/dist/customize/connectors/detail/connector-accounts.d.ts +3 -1
- package/dist/customize/connectors/detail/connector-accounts.js +2 -2
- package/dist/customize/connectors/detail/connector-notice-view.d.ts +4 -0
- package/dist/customize/connectors/detail/connector-notice-view.js +4 -0
- package/dist/customize/connectors/detail/connector-notice.d.ts +31 -4
- package/dist/customize/connectors/detail/connector-notice.js +23 -4
- package/dist/customize/connectors/detail/connector-page.js +35 -10
- package/dist/customize/connectors/detail/connector-status.d.ts +12 -1
- package/dist/customize/connectors/detail/connector-status.js +11 -0
- package/dist/customize/connectors/detail/status-badge.d.ts +3 -3
- package/dist/customize/connectors/detail/status-badge.js +2 -1
- package/dist/customize/connectors/detail/use-connector-detail.js +10 -2
- package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.d.ts +13 -0
- package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.js +29 -0
- package/dist/customize/connectors/install/use-install.js +1 -1
- package/dist/customize/providers/provider-accordion.js +9 -8
- package/dist/customize/providers/provider-connect.d.ts +3 -3
- package/dist/customize/providers/provider-connect.js +10 -16
- package/dist/customize/providers/provider-sheet.js +13 -8
- package/dist/customize/sections/component/email-connect-form.js +4 -2
- package/dist/customize/sections/connector-connection-form.d.ts +0 -1
- package/dist/customize/sections/connector-connection-form.js +0 -9
- package/dist/customize/sections/connectors-view.d.ts +4 -1
- package/dist/customize/sections/connectors-view.js +42 -7
- package/dist/customize/sections/view/account-secret-resources-panel.d.ts +15 -0
- package/dist/customize/sections/view/account-secret-resources-panel.js +44 -5
- package/dist/customize/sections/view/review-center-connected.js +7 -3
- package/dist/customize/sections/view/secret-delivery.d.ts +9 -2
- package/dist/customize/sections/view/secret-delivery.js +14 -4
- package/dist/customize/sections/view/secrets-view.js +21 -5
- package/dist/customize/settings/tabs/workspace-keys.js +53 -11
- package/dist/customize/shared/feature-gate-screen.js +1 -1
- package/dist/customize/triggers/schedule/event-account-picker.js +1 -1
- package/dist/customize/triggers/schedule/schedule-builder.js +1 -1
- package/dist/customize/triggers/schedule/schedule-copy.js +4 -0
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +14 -3
- package/dist/customize/triggers/schedule/then-fields.d.ts +3 -1
- package/dist/customize/triggers/schedule/then-fields.js +8 -4
- package/dist/customize/triggers/schedule/trigger-composer.js +1 -1
- package/dist/customize/triggers/schedule/trigger-list.d.ts +3 -1
- package/dist/customize/triggers/schedule/trigger-list.js +18 -2
- package/dist/customize/triggers/schedule/trigger-runs-logic.js +4 -2
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +4 -1
- package/dist/customize/triggers/schedule/use-event-app-connect.js +2 -1
- package/dist/files/renderers/pptx-renderer.js +5 -20
- package/dist/files/renderers/presentation/FullScreenPresentationViewer.d.ts +3 -2
- package/dist/files/renderers/presentation/FullScreenPresentationViewer.js +23 -304
- package/dist/files/renderers/presentation/presentation-export-menu.d.ts +14 -0
- package/dist/files/renderers/presentation/presentation-export-menu.js +44 -0
- package/dist/files/renderers/presentation/presentation-utils.d.ts +1 -0
- package/dist/files/renderers/presentation/presentation-utils.js +4 -0
- package/dist/files/renderers/presentation/slide-iframe.d.ts +23 -0
- package/dist/files/renderers/presentation/slide-iframe.js +61 -0
- package/dist/files/renderers/presentation/use-presentation-metadata.d.ts +39 -0
- package/dist/files/renderers/presentation/use-presentation-metadata.js +137 -0
- package/dist/files/renderers/presentation/use-slide-navigation.d.ts +17 -0
- package/dist/files/renderers/presentation/use-slide-navigation.js +82 -0
- package/dist/files/renderers/shared/use-stage-fit-scale.d.ts +19 -0
- package/dist/files/renderers/shared/use-stage-fit-scale.js +41 -0
- package/dist/files/renderers/show-content-renderer.js +16 -11
- package/dist/files/renderers/xlsx/xlsx-renderer.d.ts +4 -13
- package/dist/files/renderers/xlsx/xlsx-renderer.js +6 -63
- package/dist/files/renderers/xlsx/xlsx-viewer.d.ts +4 -2
- package/dist/files/renderers/xlsx/xlsx-viewer.js +28 -34
- package/dist/files/viewer/file-content-renderer.js +1 -4
- package/dist/files/viewer/use-file-content-state.js +10 -9
- package/dist/i18n/en.d.ts +55 -7
- package/dist/i18n/en.js +59 -11
- package/dist/internal/billing/compute-pricing.d.ts +7 -1
- package/dist/internal/billing/compute-pricing.js +7 -1
- package/dist/internal/chrome/use-chrome-offered.d.ts +2 -1
- package/dist/internal/chrome/use-chrome-offered.js +4 -2
- package/dist/internal/hooks/connectors/invalidate-connections.d.ts +10 -0
- package/dist/internal/hooks/connectors/invalidate-connections.js +18 -0
- package/dist/internal/hooks/connectors/use-finish-sign-in.d.ts +13 -0
- package/dist/internal/hooks/connectors/use-finish-sign-in.js +33 -0
- package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +6 -1
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +6 -1
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +2 -0
- package/dist/internal/hooks/projects/use-new-project-session.js +4 -1
- package/dist/internal/hooks/use-review-session-summary.d.ts +1 -1
- package/dist/internal/hooks/use-review-session-summary.js +1 -1
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +2 -2
- package/dist/internal/lib/error-handler.js +33 -0
- package/dist/internal/lib/trigger-clock.d.ts +7 -2
- package/dist/internal/lib/trigger-clock.js +17 -3
- package/dist/internal/notifications/notification-inbox.d.ts +4 -10
- package/dist/internal/notifications/notification-inbox.js +8 -9
- package/dist/internal/stores/connector-gate-store.d.ts +3 -1
- package/dist/internal/stores/connector-gate-store.js +13 -3
- package/dist/internal/stores/upgrade-dialog-store.d.ts +4 -0
- package/dist/internal/stores/upgrade-dialog-store.js +2 -0
- package/dist/lib/routes.d.ts +4 -11
- package/dist/lib/routes.js +3 -5
- package/dist/lib/z-stack.d.ts +5 -1
- package/dist/lib/z-stack.js +12 -2
- package/dist/markdown/unified-markdown-utils.d.ts +7 -0
- package/dist/markdown/unified-markdown-utils.js +19 -0
- package/dist/markdown/unified-markdown.js +16 -3
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/dialog.js +3 -1
- package/dist/primitives/drawer.js +1 -1
- package/dist/primitives/modal.js +1 -1
- package/dist/primitives/preview-image.js +1 -1
- package/dist/primitives/sheet.js +1 -1
- package/dist/session/composer/ComposerCard.js +4 -2
- package/dist/session/composer/attachment-tile.d.ts +2 -26
- package/dist/session/composer/attachment-tile.js +3 -47
- package/dist/session/composer/composer-chat-input.d.ts +2 -1
- package/dist/session/composer/composer-chat-input.js +2 -2
- package/dist/session/composer/composer.d.ts +2 -0
- package/dist/session/composer/composer.js +5 -8
- package/dist/session/composer/draft/home-composer-focus-handoff.d.ts +7 -0
- package/dist/session/composer/draft/home-composer-focus-handoff.js +94 -0
- package/dist/session/composer/draft/use-composer-draft.d.ts +3 -1
- package/dist/session/composer/draft/use-composer-draft.js +22 -2
- package/dist/session/composer/editor/composer-editor.d.ts +4 -2
- package/dist/session/composer/editor/composer-editor.js +7 -3
- package/dist/session/composer/hooks/use-composer-focus.js +4 -2
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.js +1 -0
- package/dist/session/models/chatgpt-connection-button.js +5 -9
- package/dist/session/models/model-connection-gate.d.ts +2 -1
- package/dist/session/models/model-connection-gate.js +21 -5
- package/dist/session/models/model-connection-layout.d.ts +2 -0
- package/dist/session/models/model-connection-layout.js +4 -0
- package/dist/session/models/model-picker-panel.js +6 -2
- package/dist/session/models/model-selector.d.ts +1 -1
- package/dist/session/models/model-selector.js +9 -6
- package/dist/session/models/provider-key-action.d.ts +10 -0
- package/dist/session/models/provider-key-action.js +35 -0
- package/dist/session/models/provider-key-slot.d.ts +9 -0
- package/dist/session/models/provider-key-slot.js +19 -0
- package/dist/session/models/subscription-offer.d.ts +4 -0
- package/dist/session/models/subscription-offer.js +11 -3
- package/dist/session/overrides/session-overrides-toolbar.js +2 -4
- package/dist/session/prompts/ask-deck.d.ts +5 -1
- package/dist/session/prompts/ask-deck.js +15 -3
- package/dist/session/prompts/question-labels.d.ts +16 -0
- package/dist/session/prompts/question-labels.js +34 -0
- package/dist/session/prompts/question-prompt.js +6 -6
- package/dist/session/prompts/session-connect-prompt.d.ts +40 -0
- package/dist/session/prompts/session-connect-prompt.js +126 -0
- package/dist/session/status/provisioning-failure.d.ts +23 -2
- package/dist/session/status/provisioning-failure.js +53 -3
- package/dist/session/status/session-error-banner.d.ts +1 -1
- package/dist/session/status/session-error-banner.js +12 -4
- package/dist/session/status/stop-refusal.d.ts +6 -12
- package/dist/session/status/stop-refusal.js +6 -19
- package/dist/session/thread/agent-run-props.d.ts +19 -0
- package/dist/session/thread/agent-run-props.js +54 -0
- package/dist/session/thread/session-chat.js +34 -6
- package/dist/session/thread/transcript.d.ts +17 -1
- package/dist/session/thread/transcript.js +104 -16
- package/dist/session/tool/tools/bash-tool.d.ts +3 -52
- package/dist/session/tool/tools/bash-tool.js +3 -86
- package/dist/session/turn/answer-streaming.d.ts +21 -0
- package/dist/session/turn/answer-streaming.js +34 -0
- package/dist/session/turn/queued-prompt-bubbles.d.ts +5 -0
- package/dist/session/turn/queued-prompt-bubbles.js +12 -0
- package/dist/session/turn/turn-work-accordion.d.ts +3 -1
- package/dist/session/turn/turn-work-accordion.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +55 -7
- package/dist/workspace/home/first-chat.d.ts +7 -1
- package/dist/workspace/home/first-chat.js +12 -5
- package/dist/workspace/inbox/workspace-inbox.d.ts +6 -16
- package/dist/workspace/inbox/workspace-inbox.js +9 -51
- package/dist/workspace/layout/project-home.js +5 -11
- package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
- package/dist/workspace/layout/use-project-home-send.js +29 -15
- package/dist/workspace/new/advanced-fields.d.ts +4 -1
- package/dist/workspace/new/advanced-fields.js +2 -2
- package/dist/workspace/new/workspace-name.d.ts +9 -0
- package/dist/workspace/new/workspace-name.js +20 -0
- package/dist/workspace/projects/session-starter.d.ts +6 -4
- package/dist/workspace/projects/session-starter.js +8 -14
- package/dist/workspace/review/review-center.d.ts +6 -2
- package/dist/workspace/review/review-center.js +45 -25
- package/dist/workspace/sidebar/workspace-menu-model.d.ts +3 -5
- package/dist/workspace/sidebar/workspace-menu-model.js +1 -1
- package/package.json +3 -7
- package/skills/kortix-ui/references/modules.md +1 -1
- package/dist/customize/connectors/invalidate-connections.d.ts +0 -2
- package/dist/customize/connectors/invalidate-connections.js +0 -4
- package/dist/internal/notifications/use-inbox-summary.d.ts +0 -17
- package/dist/internal/notifications/use-inbox-summary.js +0 -28
|
@@ -284,8 +284,8 @@ function isRedeclaredInjectedIdentifierNoise(input) {
|
|
|
284
284
|
}
|
|
285
285
|
// Third-party tracking-pixel `Response.json()` noise. A marketing pixel
|
|
286
286
|
// (observed: Vector, `https://cdn.vector.co/pixel.js`, loaded on the marketing
|
|
287
|
-
// site by
|
|
288
|
-
//
|
|
287
|
+
// site by a visitor-identification vendor chain; apps/web removed that vendor
|
|
288
|
+
// on 2026-11-12, but a host page can still load the same pixel) fetches its own API
|
|
289
289
|
// (`https://api.vector.co/pixel/ip-info`) and calls `response.json()` without
|
|
290
290
|
// checking `response.ok`. When the site's bot protection 403s the request with
|
|
291
291
|
// an empty body, `Response.json()` rejects with the canonical DOM
|
|
@@ -3,6 +3,8 @@ import { isGitMirrorUnavailableNoiseMessage, isServerDeadlineNoiseMessage, } fro
|
|
|
3
3
|
import { isSilentTimeoutError } from './timeout-toast-policy.js';
|
|
4
4
|
import { openAccountSettings } from '../stores/account-settings-modal-store.js';
|
|
5
5
|
import { useUpgradeDialogStore } from '../stores/upgrade-dialog-store.js';
|
|
6
|
+
import { projectIdFromPathname } from '../stores/project-switch-store.js';
|
|
7
|
+
import { capabilityTabHref } from './capability-tab-routes.js';
|
|
6
8
|
import { BillingError, formatBillingErrorForUI, isBillingError } from '@kortix/sdk/react';
|
|
7
9
|
import { platformConfig } from '@kortix/sdk';
|
|
8
10
|
import { captureException } from '../../lib/telemetry.js';
|
|
@@ -218,6 +220,37 @@ export const handleApiError = (error, context, tI18nComplete) => {
|
|
|
218
220
|
// billing 402s. Scopes the upgrade dialog so a non-billing member sees the
|
|
219
221
|
// team's gated CTA, not their own primary account. Absent → primary account.
|
|
220
222
|
const v2AccountId = typeof v2Detail?.account_id === 'string' ? v2Detail.account_id : undefined;
|
|
223
|
+
// Session create refused because no model can run (409 `no_model_available`):
|
|
224
|
+
// a Free account sees no Kortix model (managed models are Credits-plan
|
|
225
|
+
// only) and has no provider key. Say so with both ways out, instead of a
|
|
226
|
+
// composer that reads "No model" with Send disabled and no reason.
|
|
227
|
+
if (v2Code === 'no_model_available') {
|
|
228
|
+
if (!context?.silent) {
|
|
229
|
+
const projectId = typeof window === 'undefined' ? null : projectIdFromPathname(window.location.pathname);
|
|
230
|
+
const actions = [
|
|
231
|
+
...(platformConfig().billingEnabled
|
|
232
|
+
? [{
|
|
233
|
+
label: tI18nComplete('noModelUpgradePlan'),
|
|
234
|
+
onClick: () => useUpgradeDialogStore.getState().openUpgradeDialog({
|
|
235
|
+
reason: 'subscription_required',
|
|
236
|
+
accountId: v2AccountId,
|
|
237
|
+
}),
|
|
238
|
+
}]
|
|
239
|
+
: []),
|
|
240
|
+
{
|
|
241
|
+
label: tI18nComplete('noModelAddProviderKey'),
|
|
242
|
+
onClick: () => {
|
|
243
|
+
if (!projectId || typeof window === 'undefined')
|
|
244
|
+
return;
|
|
245
|
+
// Next.js syncs its router with native pushState (see openAccountPanel).
|
|
246
|
+
window.history.pushState(null, '', capabilityTabHref(projectId, 'models'));
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
];
|
|
250
|
+
errorToast(v2Message ?? errorMessage, { actions, duration: 10000 });
|
|
251
|
+
}
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
221
254
|
// Marketplace imports can use either a paid managed model or a provider
|
|
222
255
|
// key. Preserve the server's remedy instead of swallowing this BillingError
|
|
223
256
|
// or sending an already-paid customer to the plan picker.
|
|
@@ -38,8 +38,13 @@ export declare const CLOCK_TONE: {
|
|
|
38
38
|
readonly dot: "bg-kortix-yellow";
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
/**
|
|
42
|
-
|
|
41
|
+
/**
|
|
42
|
+
* "2d ago", "9h ago", "3w ago" in the viewer's locale, or "Never run". A failed
|
|
43
|
+
* attempt newer than the last fire reads "Failed · 5m ago": a failed fire does
|
|
44
|
+
* not advance `last_fired_at` (the scheduler retries it), so a trigger whose
|
|
45
|
+
* every attempt failed read "Never run".
|
|
46
|
+
*/
|
|
47
|
+
export declare function lastRunLabel(trigger: Pick<ProjectTrigger, 'last_fired_at' | 'event'> & Partial<Pick<ProjectTrigger, 'last_status' | 'last_attempt_at'>>, t: UiTranslator, locale: string, now?: number): string;
|
|
43
48
|
/**
|
|
44
49
|
* A future run in whole minutes, hours or days, worded by `rtf`: "in 25m"
|
|
45
50
|
* (narrow), "in 25 minutes" (long). A past time reads as now; "—" with no time.
|
|
@@ -14,12 +14,26 @@ export const CLOCK_TONE = {
|
|
|
14
14
|
pending: YELLOW,
|
|
15
15
|
paused: YELLOW,
|
|
16
16
|
};
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* "2d ago", "9h ago", "3w ago" in the viewer's locale, or "Never run". A failed
|
|
19
|
+
* attempt newer than the last fire reads "Failed · 5m ago": a failed fire does
|
|
20
|
+
* not advance `last_fired_at` (the scheduler retries it), so a trigger whose
|
|
21
|
+
* every attempt failed read "Never run".
|
|
22
|
+
*/
|
|
18
23
|
export function lastRunLabel(trigger, t, locale, now = Date.now()) {
|
|
19
24
|
const iso = trigger.last_fired_at ?? trigger.event?.last_event_at ?? null;
|
|
20
|
-
const
|
|
21
|
-
|
|
25
|
+
const fired = iso ? Date.parse(iso) : Number.NaN;
|
|
26
|
+
const attempted = trigger.last_attempt_at ? Date.parse(trigger.last_attempt_at) : Number.NaN;
|
|
27
|
+
if (trigger.last_status === 'failed' &&
|
|
28
|
+
Number.isFinite(attempted) &&
|
|
29
|
+
!(Number.isFinite(fired) && fired >= attempted)) {
|
|
30
|
+
return `${t.raw('text031a8f0f659d')} · ${ago(attempted, locale, now)}`;
|
|
31
|
+
}
|
|
32
|
+
if (!Number.isFinite(fired))
|
|
22
33
|
return t.raw('text3d40a69d3160');
|
|
34
|
+
return ago(fired, locale, now);
|
|
35
|
+
}
|
|
36
|
+
function ago(at, locale, now) {
|
|
23
37
|
const rtf = new Intl.RelativeTimeFormat(locale, { style: 'narrow', numeric: 'auto' });
|
|
24
38
|
const min = Math.floor(Math.max(0, now - at) / 60_000);
|
|
25
39
|
if (min < 1)
|
|
@@ -15,15 +15,10 @@ export interface NotificationInboxViewProps {
|
|
|
15
15
|
prompt: string | null;
|
|
16
16
|
settings: InboxSettingsTarget;
|
|
17
17
|
/**
|
|
18
|
-
* The row above the page
|
|
19
|
-
*
|
|
18
|
+
* The row above the page (the account pages' top bar). Then the title is
|
|
19
|
+
* the column's heading. Absent: the project page header.
|
|
20
20
|
*/
|
|
21
21
|
header?: ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Only the scrolling list, without the page frame and title: the workspace
|
|
24
|
-
* Inbox draws its own header and the Review | Notifications tabs above it.
|
|
25
|
-
*/
|
|
26
|
-
bare?: boolean;
|
|
27
22
|
onOpenRow: (row: InboxNotification) => void;
|
|
28
23
|
onMarkAllRead: () => void;
|
|
29
24
|
onRetry: () => void;
|
|
@@ -36,7 +31,7 @@ export interface NotificationInboxViewProps {
|
|
|
36
31
|
* footer. Inside a project the title is `ProjectPageHeader` (the Review,
|
|
37
32
|
* Goals and Artifacts pages' header: it owns the desktop title-bar band).
|
|
38
33
|
*/
|
|
39
|
-
export declare function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header,
|
|
34
|
+
export declare function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header, onOpenRow, onMarkAllRead, onRetry, onTurnOn, onDismissPrompt, }: NotificationInboxViewProps): import("react").JSX.Element;
|
|
40
35
|
/**
|
|
41
36
|
* The Inbox page. Reads the inbox `NotificationHost` polls (one cache entry,
|
|
42
37
|
* so the sidebar count and the page agree), and renders nothing while signed
|
|
@@ -44,8 +39,7 @@ export declare function NotificationInboxView({ rows, state, unreadCount, prompt
|
|
|
44
39
|
* without it, "Notification settings" opens the project's Settings overlay.
|
|
45
40
|
* `header` sits above the page (the account pages' top bar).
|
|
46
41
|
*/
|
|
47
|
-
export declare function NotificationInbox({ settingsHref, header,
|
|
42
|
+
export declare function NotificationInbox({ settingsHref, header, }: {
|
|
48
43
|
settingsHref?: string;
|
|
49
44
|
header?: ReactNode;
|
|
50
|
-
bare?: boolean;
|
|
51
45
|
}): import("react").JSX.Element | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
* The Inbox (KRTX-1742): the person's notifications from every
|
|
5
|
-
* page.
|
|
6
|
-
*
|
|
4
|
+
* The Inbox (KRTX-1742): the person's notifications from every workspace, as
|
|
5
|
+
* a page. Notifications span every workspace, so the page is person-level:
|
|
6
|
+
* the workspace menu's Inbox row and `AccountTopBar` open it (KRTX-4799
|
|
7
|
+
* moved it out of the workspace Inbox page, which holds only Review).
|
|
7
8
|
*
|
|
8
9
|
* A row opens its subject (its session, its Artifact, or the Loops or
|
|
9
10
|
* Triggers page for an alert) and marks itself read. The tabs split what
|
|
@@ -59,16 +60,14 @@ const KIND_MARK = {
|
|
|
59
60
|
* footer. Inside a project the title is `ProjectPageHeader` (the Review,
|
|
60
61
|
* Goals and Artifacts pages' header: it owns the desktop title-bar band).
|
|
61
62
|
*/
|
|
62
|
-
export function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header,
|
|
63
|
+
export function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header, onOpenRow, onMarkAllRead, onRetry, onTurnOn, onDismissPrompt, }) {
|
|
63
64
|
const t = useTranslations('notifications');
|
|
64
65
|
const [tab, setTab] = useState('all');
|
|
65
66
|
const visible = tabRows(rows, tab);
|
|
66
67
|
const needsCount = tabUnreadCount(rows, 'needs');
|
|
67
68
|
const doneCount = tabUnreadCount(rows, 'done');
|
|
68
69
|
const settingsLabel = (_jsxs(_Fragment, { children: [_jsx(GearSixIcon, { className: "size-3.5 shrink-0" }), t('inbox.settings')] }));
|
|
69
|
-
const list = (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className:
|
|
70
|
-
if (bare)
|
|
71
|
-
return list;
|
|
70
|
+
const list = (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: "mx-auto flex w-full max-w-4xl flex-col gap-4 px-4 py-6 pb-20 md:px-8", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [header ? _jsx("h1", { className: "text-foreground text-xl font-medium text-balance", children: t('inbox.title') }) : null, _jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.description') })] }), _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsx(Tabs, { value: tab, onValueChange: (value) => setTab(value), children: _jsxs(TabsList, { variant: "secondary", size: "sm", children: [_jsxs(TabsTrigger, { value: "all", className: "w-fit flex-none gap-1.5 px-2.5", children: [t('inbox.tabAll'), unreadCount > 0 ? _jsx(CountBadge, { count: unreadCount }) : null] }), _jsxs(TabsTrigger, { value: "needs", className: "w-fit flex-none gap-1.5 px-2.5", children: [t('inbox.tabNeedsYou'), needsCount > 0 ? _jsx(CountBadge, { count: needsCount, tone: "waiting" }) : null] }), _jsxs(TabsTrigger, { value: "done", className: "w-fit flex-none gap-1.5 px-2.5", children: [t('inbox.tabDone'), doneCount > 0 ? _jsx(CountBadge, { count: doneCount }) : null] })] }) }), unreadCount > 0 ? (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: onMarkAllRead, children: [_jsx(ChecksIcon, { className: "size-3.5 shrink-0" }), t('inbox.markAllRead')] })) : null] }), prompt ? (_jsxs(BannerAlert, { variant: "default", children: [_jsx(BannerAlertMedia, { children: _jsx(BellIcon, {}) }), _jsx(BannerAlertTitle, { children: prompt }), _jsx(BannerAlertActions, { children: _jsxs(ButtonGroup, { children: [_jsx(Button, { variant: "secondary", size: "xs", onClick: onTurnOn, children: t('inbox.turnOn') }), _jsx(Hint, { label: t('inbox.dismiss'), side: "top", children: _jsx(Button, { variant: "secondary", size: "icon-sm", "aria-label": t('inbox.dismiss'), onClick: onDismissPrompt, children: _jsx(XIcon, { className: "size-3.5 shrink-0" }) }) })] }) })] })) : null, state === 'loading' ? (_jsx("div", { className: "space-y-0.5", children: [0, 1, 2].map((index) => (_jsx(Skeleton, { className: "h-14 w-full rounded-lg" }, index))) })) : state === 'error' ? (_jsx(ErrorState, { size: "sm", title: t('inbox.loadError'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: t('inbox.retry') }) })) : visible.length === 0 ? (_jsx(EmptyState, { size: "sm", media: _jsx(EmptyArt, { icon: BellIcon }), title: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYou') : t('inbox.empty'), description: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYouDescription') : t('inbox.emptyDescription') })) : (_jsx("ul", { className: "space-y-0.5", children: visible.map((row) => (_jsx("li", { children: _jsx(InboxRow, { row: row, onOpen: () => onOpenRow(row) }) }, row.id))) })), _jsxs("div", { className: "flex flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.emailOptIn') }), 'href' in settings ? (_jsx(Button, { asChild: true, variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", children: _jsx(UiLink, { href: settings.href, children: settingsLabel }) })) : (_jsx(Button, { variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", onClick: settings.onOpen, children: settingsLabel }))] })] }) }));
|
|
72
71
|
return (
|
|
73
72
|
// `h-svh`: nothing above this box has a definite height (as the Review page).
|
|
74
73
|
_jsxs("div", { className: "flex h-svh min-h-0 flex-col overflow-hidden", children: [header ?? _jsx(ProjectPageHeader, { title: t('inbox.title') }), list] }));
|
|
@@ -88,7 +87,7 @@ function InboxRow({ row, onOpen }) {
|
|
|
88
87
|
* without it, "Notification settings" opens the project's Settings overlay.
|
|
89
88
|
* `header` sits above the page (the account pages' top bar).
|
|
90
89
|
*/
|
|
91
|
-
export function NotificationInbox({ settingsHref, header,
|
|
90
|
+
export function NotificationInbox({ settingsHref, header, }) {
|
|
92
91
|
const t = useTranslations('notifications');
|
|
93
92
|
const viewerId = useUiViewerId();
|
|
94
93
|
const inbox = useNotificationInbox({ userId: viewerId });
|
|
@@ -107,7 +106,7 @@ export function NotificationInbox({ settingsHref, header, bare, }) {
|
|
|
107
106
|
!promptDismissed;
|
|
108
107
|
return (_jsx(NotificationInboxView, { rows: inbox.data?.notifications ?? [], state: inbox.data ? 'ready' : inbox.isError ? 'error' : 'loading', unreadCount: inbox.unreadCount, prompt: offerTurnOn ? (webPushSupported() ? t('inbox.promptPush') : t('inbox.promptBackground')) : null, settings: settingsHref
|
|
109
108
|
? { href: settingsHref }
|
|
110
|
-
: { onOpen: () => useSettingsPanelStore.getState().openSettings('sessions') }, header: header,
|
|
109
|
+
: { onOpen: () => useSettingsPanelStore.getState().openSettings('sessions') }, header: header, onOpenRow: (row) => {
|
|
111
110
|
if (!row.read)
|
|
112
111
|
inbox.markRead([row.id]).catch(() => { });
|
|
113
112
|
}, onMarkAllRead: () => {
|
|
@@ -20,8 +20,10 @@ interface ConnectorGateState {
|
|
|
20
20
|
projectId: string;
|
|
21
21
|
connectorConnections: ConnectorGateConnection[];
|
|
22
22
|
retry: () => void;
|
|
23
|
+
onCancel?: () => void;
|
|
23
24
|
}) => void;
|
|
24
|
-
closeConnectorGate: () => void;
|
|
25
|
+
closeConnectorGate: (retrying?: boolean) => void;
|
|
26
|
+
onCancel?: () => void;
|
|
25
27
|
}
|
|
26
28
|
export declare const useConnectorGateStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ConnectorGateState>>;
|
|
27
29
|
export {};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { create } from 'zustand';
|
|
2
|
-
export const useConnectorGateStore = create((set) => ({
|
|
2
|
+
export const useConnectorGateStore = create((set, get) => ({
|
|
3
3
|
isOpen: false,
|
|
4
4
|
projectId: null,
|
|
5
5
|
connectorConnections: [],
|
|
6
6
|
retry: null,
|
|
7
|
-
openConnectorGate: ({ projectId, connectorConnections, retry }) =>
|
|
8
|
-
|
|
7
|
+
openConnectorGate: ({ projectId, connectorConnections, retry, onCancel }) => {
|
|
8
|
+
const previousCancel = get().onCancel;
|
|
9
|
+
set({ isOpen: true, projectId, connectorConnections, retry, onCancel });
|
|
10
|
+
if (previousCancel !== onCancel)
|
|
11
|
+
previousCancel?.();
|
|
12
|
+
},
|
|
13
|
+
closeConnectorGate: (retrying = false) => {
|
|
14
|
+
const cancel = get().onCancel;
|
|
15
|
+
set({ isOpen: false, projectId: null, connectorConnections: [], retry: null, onCancel: undefined });
|
|
16
|
+
if (!retrying)
|
|
17
|
+
cancel?.();
|
|
18
|
+
},
|
|
9
19
|
}));
|
|
@@ -19,6 +19,10 @@ interface UpgradeDialogState {
|
|
|
19
19
|
* its view and its copy from, so the gate that opened it and the modal can
|
|
20
20
|
* never say opposite things about the same account. */
|
|
21
21
|
billingState?: BillingState;
|
|
22
|
+
/** The Credits tier the person last picked in the dialog. Reopening the
|
|
23
|
+
* dialog keeps it, so it opens on the entry tier only until they pick. */
|
|
24
|
+
pickedMonthlyUsd?: number;
|
|
25
|
+
setPickedMonthlyUsd: (monthlyUsd: number) => void;
|
|
22
26
|
openUpgradeDialog: (opts: {
|
|
23
27
|
reason?: UpgradeReason;
|
|
24
28
|
message?: string;
|
|
@@ -6,6 +6,8 @@ export const useUpgradeDialogStore = create((set) => ({
|
|
|
6
6
|
accountId: undefined,
|
|
7
7
|
hasSubscription: undefined,
|
|
8
8
|
billingState: undefined,
|
|
9
|
+
pickedMonthlyUsd: undefined,
|
|
10
|
+
setPickedMonthlyUsd: (monthlyUsd) => set({ pickedMonthlyUsd: monthlyUsd }),
|
|
9
11
|
openUpgradeDialog: (opts) => set({
|
|
10
12
|
isOpen: true,
|
|
11
13
|
reason: opts.reason ?? 'subscription_required',
|
package/dist/lib/routes.d.ts
CHANGED
|
@@ -52,19 +52,12 @@ export interface UiRoutes {
|
|
|
52
52
|
/** The project's Company memory (`chat` flag); a page is `?page=<page_id>`. */
|
|
53
53
|
memory: (projectId: string) => string | null;
|
|
54
54
|
/**
|
|
55
|
-
* Review:
|
|
56
|
-
*
|
|
57
|
-
*
|
|
55
|
+
* Review: the workspace's Review queue, beside the app sidebar. Since
|
|
56
|
+
* KRTX-4799 it lives at the workspace Inbox address; the person's
|
|
57
|
+
* notifications are not a view of it (they span every workspace). Absent:
|
|
58
|
+
* the host serves Review only inside its `customize` route.
|
|
58
59
|
*/
|
|
59
60
|
review?: (projectId: string) => string | null;
|
|
60
|
-
/**
|
|
61
|
-
* The Inbox: the signed-in person's notifications from every project, as a
|
|
62
|
-
* page beside the project sidebar (KRTX-1742). Absent or null: the host
|
|
63
|
-
* serves no Inbox page and the sidebar has no Inbox row. It is new
|
|
64
|
-
* (2026-11-06), so a host that maps any route (its own router) gets no
|
|
65
|
-
* Inbox row until it routes `inbox` too: no host gets a link it does not serve.
|
|
66
|
-
*/
|
|
67
|
-
inbox?: (projectId: string) => string | null;
|
|
68
61
|
}
|
|
69
62
|
export declare const defaultUiRoutes: UiRoutes;
|
|
70
63
|
/**
|
package/dist/lib/routes.js
CHANGED
|
@@ -15,9 +15,9 @@ const DEFAULT_ROUTES = {
|
|
|
15
15
|
channel: (p, slug) => `/workspaces/${p}/c/${slug}`,
|
|
16
16
|
dm: (p, agentName) => `/workspaces/${p}/dm/${encodeURIComponent(agentName)}`,
|
|
17
17
|
memory: (p) => `/workspaces/${p}/memory`,
|
|
18
|
-
//
|
|
18
|
+
// The workspace Inbox page IS the Review queue (KRTX-4799); the old
|
|
19
|
+
// `/workspaces/<id>/review` route redirects here.
|
|
19
20
|
review: (p) => `/workspaces/${p}/inbox?view=review`,
|
|
20
|
-
inbox: (p) => `/workspaces/${p}/inbox`,
|
|
21
21
|
};
|
|
22
22
|
export const defaultUiRoutes = DEFAULT_ROUTES;
|
|
23
23
|
let routes = DEFAULT_ROUTES;
|
|
@@ -31,9 +31,7 @@ export function setUiRoutes(overrides) {
|
|
|
31
31
|
const admin = overrides.admin ?? overrides.customize;
|
|
32
32
|
// A host that routes its own customize pages serves Review there unless it also routes `review`.
|
|
33
33
|
const review = overrides.review ?? (overrides.customize ? undefined : DEFAULT_ROUTES.review);
|
|
34
|
-
|
|
35
|
-
const inbox = overrides.inbox ?? (Object.keys(overrides).length === 0 ? DEFAULT_ROUTES.inbox : undefined);
|
|
36
|
-
routes = { ...DEFAULT_ROUTES, ...overrides, ...(admin ? { admin } : {}), review, inbox };
|
|
34
|
+
routes = { ...DEFAULT_ROUTES, ...overrides, ...(admin ? { admin } : {}), review };
|
|
37
35
|
}
|
|
38
36
|
export function uiRoutes() {
|
|
39
37
|
return routes;
|
package/dist/lib/z-stack.d.ts
CHANGED
|
@@ -58,5 +58,9 @@ export declare function hasOpenNestedDialog(): boolean;
|
|
|
58
58
|
* `floatingZ(0)`, above every top-level dialog, so a popover still open when
|
|
59
59
|
* one of those opens would float over it; popovers use this to step aside.
|
|
60
60
|
*/
|
|
61
|
-
export declare function foreignDialogOpen(panel: HTMLElement | null
|
|
61
|
+
export declare function foreignDialogOpen(panel: HTMLElement | null,
|
|
62
|
+
/** Dialogs open before the panel opened (its host modal): never foreign. */
|
|
63
|
+
except?: ReadonlySet<Element>): boolean;
|
|
64
|
+
/** Every open dialog and alert dialog in the document. */
|
|
65
|
+
export declare function openDialogs(): HTMLElement[];
|
|
62
66
|
export {};
|
package/dist/lib/z-stack.js
CHANGED
|
@@ -134,10 +134,20 @@ export function hasOpenNestedDialog() {
|
|
|
134
134
|
* `floatingZ(0)`, above every top-level dialog, so a popover still open when
|
|
135
135
|
* one of those opens would float over it; popovers use this to step aside.
|
|
136
136
|
*/
|
|
137
|
-
export function foreignDialogOpen(panel
|
|
138
|
-
|
|
137
|
+
export function foreignDialogOpen(panel,
|
|
138
|
+
/** Dialogs open before the panel opened (its host modal): never foreign. */
|
|
139
|
+
except) {
|
|
140
|
+
for (const dialog of openDialogs()) {
|
|
141
|
+
if (except?.has(dialog))
|
|
142
|
+
continue;
|
|
139
143
|
if (!panel || (dialog !== panel && !panel.contains(dialog) && !dialog.contains(panel)))
|
|
140
144
|
return true;
|
|
141
145
|
}
|
|
142
146
|
return false;
|
|
143
147
|
}
|
|
148
|
+
/** Every open dialog and alert dialog in the document. */
|
|
149
|
+
export function openDialogs() {
|
|
150
|
+
return [
|
|
151
|
+
...document.querySelectorAll('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]'),
|
|
152
|
+
];
|
|
153
|
+
}
|
|
@@ -59,6 +59,13 @@ export declare function remoteImageHost(src: string, proxiedSrc?: string): strin
|
|
|
59
59
|
* back to a plain `<a>` and never feed garbage to `next/link`.
|
|
60
60
|
*/
|
|
61
61
|
export declare function isLinkSafeHref(href: string | undefined): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The app path of an absolute URL on this page's own origin
|
|
64
|
+
* (`https://kortix.com/workspaces/…` on kortix.com → `/workspaces/…`), or
|
|
65
|
+
* `null` for any other href. Agents write full URLs; a click on one is an
|
|
66
|
+
* in-app navigation, not a page load.
|
|
67
|
+
*/
|
|
68
|
+
export declare function sameOriginAppPath(href: string | undefined): string | null;
|
|
62
69
|
/** Route only trusted app paths through Next.js Link and its prefetcher. */
|
|
63
70
|
export declare function shouldUseNextLink(href: string | undefined): boolean;
|
|
64
71
|
export { LANGUAGE_ALIASES, normalizeLanguage, languageLabel } from '../_vendor/shared/code-language.js';
|
|
@@ -122,6 +122,25 @@ export function isLinkSafeHref(href) {
|
|
|
122
122
|
// `new URL(..., window.location.href)` always succeeds for them.
|
|
123
123
|
return true;
|
|
124
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* The app path of an absolute URL on this page's own origin
|
|
127
|
+
* (`https://kortix.com/workspaces/…` on kortix.com → `/workspaces/…`), or
|
|
128
|
+
* `null` for any other href. Agents write full URLs; a click on one is an
|
|
129
|
+
* in-app navigation, not a page load.
|
|
130
|
+
*/
|
|
131
|
+
export function sameOriginAppPath(href) {
|
|
132
|
+
if (!href || typeof window === 'undefined' || !/^https?:\/\//i.test(href))
|
|
133
|
+
return null;
|
|
134
|
+
try {
|
|
135
|
+
const url = new URL(href);
|
|
136
|
+
if (url.origin !== window.location.origin)
|
|
137
|
+
return null;
|
|
138
|
+
return url.pathname + url.search + url.hash;
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
125
144
|
/** Route only trusted app paths through Next.js Link and its prefetcher. */
|
|
126
145
|
export function shouldUseNextLink(href) {
|
|
127
146
|
return isInternalUrl(href) && isLinkSafeHref(href);
|
|
@@ -14,7 +14,7 @@ import { InsideLinkContext } from './code/inside-link-context.js';
|
|
|
14
14
|
import { isKatexClassName, katexRehypePlugins, katexRehypePluginsNoRaw, katexRemarkPlugins, normalizeClassName, } from './katex-markdown.js';
|
|
15
15
|
import { markdownPolicy, } from './markdown-policy.js';
|
|
16
16
|
import { MarkdownOrderedList } from './ordered-list.js';
|
|
17
|
-
import { hasLinkReferenceDefinition, isInternalUrl, isStreamingLinkPlaceholder, prepareMarkdownSource, remoteImageHost, shouldUseNextLink, } from './unified-markdown-utils.js';
|
|
17
|
+
import { hasLinkReferenceDefinition, isInternalUrl, isStreamingLinkPlaceholder, prepareMarkdownSource, remoteImageHost, sameOriginAppPath, shouldUseNextLink, } from './unified-markdown-utils.js';
|
|
18
18
|
import { remarkSetupLinkBlocks } from './setup-link-blocks.js';
|
|
19
19
|
import { rehypeStreamWords, STREAM_WORD_CLASS, StreamFadeGateContext, StreamWord, createStreamFadeGate, } from './stream-words.js';
|
|
20
20
|
import { SetupLinkButton, SetupLinkInlineContext } from './setup-links/setup-link-button.js';
|
|
@@ -25,7 +25,7 @@ import { useSandboxProxy } from '../internal/hooks/use-sandbox-proxy.js';
|
|
|
25
25
|
import { useOpenPreviewLink } from '../internal/hooks/use-open-preview-link.js';
|
|
26
26
|
import { cn } from '../lib/utils.js';
|
|
27
27
|
import { ImageIcon } from '@phosphor-icons/react';
|
|
28
|
-
import { useUiLink } from '../providers/ui-provider.js';
|
|
28
|
+
import { useUiLink, useUiRouter } from '../providers/ui-provider.js';
|
|
29
29
|
import React, { useCallback, useContext, useMemo, useState } from 'react';
|
|
30
30
|
import { parseMarkdownIntoBlocks, Streamdown } from 'streamdown';
|
|
31
31
|
function SlackMark({ className }) {
|
|
@@ -119,6 +119,7 @@ function bareLinkText(children) {
|
|
|
119
119
|
export function MarkdownLink({ href, children, }) {
|
|
120
120
|
const tAppLink = useTranslations('markdownAppLinks');
|
|
121
121
|
const Link = useUiLink();
|
|
122
|
+
const router = useUiRouter();
|
|
122
123
|
const { proxy, policy, variant } = useContext(MarkdownRenderContext);
|
|
123
124
|
const openPreview = useOpenPreviewLink();
|
|
124
125
|
// Only agent content may turn a setup link into the in-app card. From any
|
|
@@ -201,8 +202,20 @@ export function MarkdownLink({ href, children, }) {
|
|
|
201
202
|
// treats those as app routes and prefetches them, including typos such
|
|
202
203
|
// as `/legal/terms.`. Only trusted root-relative/hash paths belong in
|
|
203
204
|
// the app router; every other href stays a plain anchor.
|
|
205
|
+
// An absolute URL on this app's own origin (an agent writes
|
|
206
|
+
// `https://kortix.com/workspaces/…`) navigates in place through the app
|
|
207
|
+
// router on a plain click. Decided at click time, so the server markup and
|
|
208
|
+
// the prefetcher never see it; a modified click keeps the native new tab.
|
|
204
209
|
if (!shouldUseNextLink(resolvedHref)) {
|
|
205
|
-
return (_jsx("a", { href: resolvedHref, className: anchorClass, title: presentation ? resolvedHref : undefined, ...(isExternal && !isHash ? { target: '_blank', rel: 'noopener noreferrer' } : {}),
|
|
210
|
+
return (_jsx("a", { href: resolvedHref, className: anchorClass, title: presentation ? resolvedHref : undefined, ...(isExternal && !isHash ? { target: '_blank', rel: 'noopener noreferrer' } : {}), onClick: (e) => {
|
|
211
|
+
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)
|
|
212
|
+
return;
|
|
213
|
+
const appPath = sameOriginAppPath(resolvedHref);
|
|
214
|
+
if (!appPath)
|
|
215
|
+
return;
|
|
216
|
+
e.preventDefault();
|
|
217
|
+
router.push(appPath);
|
|
218
|
+
}, children: _jsx(InsideLinkContext.Provider, { value: true, children: linkContent }) }));
|
|
206
219
|
}
|
|
207
220
|
return (_jsx(Link, { href: resolvedHref, onClick: isHash ? (e) => handleHashClick(e, resolvedHref) : undefined, className: anchorClass, title: presentation ? resolvedHref : undefined, ...(isExternal && !isHash ? { target: '_blank', rel: 'noopener noreferrer' } : {}), children: _jsx(InsideLinkContext.Provider, { value: true, children: linkContent }) }));
|
|
208
221
|
}
|
|
@@ -28,7 +28,7 @@ function AlertDialogPortal({ container, forceMount, children, }) {
|
|
|
28
28
|
}
|
|
29
29
|
function AlertDialogOverlay({ className, style, ...props }) {
|
|
30
30
|
const depth = useDialogDepth();
|
|
31
|
-
return (_jsx(AlertDialogPrimitive.Backdrop, { "data-slot": "alert-dialog-overlay", className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/65 backdrop-blur-xs', className), style: { zIndex: dialogOverlayZ(depth), ...style }, render: stateRender('div', openState), ...props }));
|
|
31
|
+
return (_jsx(AlertDialogPrimitive.Backdrop, { forceRender: true, "data-slot": "alert-dialog-overlay", className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/65 backdrop-blur-xs', className), style: { zIndex: dialogOverlayZ(depth), ...style }, render: stateRender('div', openState), ...props }));
|
|
32
32
|
}
|
|
33
33
|
function AlertDialogContent({ className, style, overlayClassName, asChild, forceMount, children, onEscapeKeyDown, onOpenAutoFocus, onCloseAutoFocus, ...props }) {
|
|
34
34
|
const depth = useDialogDepth();
|
|
@@ -34,7 +34,9 @@ const DialogClose = React.forwardRef(({ asChild, children, ...props }, ref) => {
|
|
|
34
34
|
DialogClose.displayName = 'DialogClose';
|
|
35
35
|
const DialogOverlay = React.forwardRef(({ className, style, ...props }, ref) => {
|
|
36
36
|
const depth = useDialogDepth();
|
|
37
|
-
return (_jsx(DialogPrimitive.Backdrop, { ref: ref,
|
|
37
|
+
return (_jsx(DialogPrimitive.Backdrop, { ref: ref,
|
|
38
|
+
// Base UI skips a nested backdrop by default; Radix dimmed the parent dialog.
|
|
39
|
+
forceRender: true, className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-moderate fixed inset-0 bg-black/65 backdrop-blur-xs', className), style: { zIndex: dialogOverlayZ(depth), ...style }, render: stateRender('div', openState), ...props }));
|
|
38
40
|
});
|
|
39
41
|
DialogOverlay.displayName = 'DialogOverlay';
|
|
40
42
|
const DialogVariants = cva(cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 border p-5 shadow-lg duration-moderate sm:max-w-lg sm:rounded-lg'), {
|
|
@@ -30,7 +30,7 @@ function DrawerClose({ asChild, children, ...props }) {
|
|
|
30
30
|
return (_jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props, ref: composeRefs(props.ref, native.ref), render: slot.render, nativeButton: native.nativeButton, children: slot.children }));
|
|
31
31
|
}
|
|
32
32
|
function DrawerOverlay({ className, ...props }) {
|
|
33
|
-
return (_jsx(DrawerPrimitive.Backdrop, { "data-slot": "drawer-overlay", className: cn('duration-moderate fixed inset-0 z-50 bg-black/50 opacity-[calc(1-var(--drawer-swipe-progress,0))] transition-opacity ease-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-swiping:duration-0', className), render: stateRender('div', openState), ...props }));
|
|
33
|
+
return (_jsx(DrawerPrimitive.Backdrop, { forceRender: true, "data-slot": "drawer-overlay", className: cn('duration-moderate fixed inset-0 z-50 bg-black/50 opacity-[calc(1-var(--drawer-swipe-progress,0))] transition-opacity ease-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-swiping:duration-0', className), render: stateRender('div', openState), ...props }));
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Slide-in per edge. The swipe offset Base UI writes while the drawer is
|
package/dist/primitives/modal.js
CHANGED
|
@@ -62,7 +62,7 @@ const overlayAnimationClasses = {
|
|
|
62
62
|
};
|
|
63
63
|
const ModalOverlay = React.forwardRef(({ className, style, animation = 'default', ...props }, ref) => {
|
|
64
64
|
const depth = useDialogDepth();
|
|
65
|
-
return (_jsx(DialogPrimitive.Backdrop, { render: stateRender('div', openState), className: cn('fixed inset-0 bg-black/65 backdrop-blur-xs', overlayAnimationClasses[animation], className), style: { zIndex: dialogOverlayZ(depth), ...style }, ...props, ref: ref }));
|
|
65
|
+
return (_jsx(DialogPrimitive.Backdrop, { forceRender: true, render: stateRender('div', openState), className: cn('fixed inset-0 bg-black/65 backdrop-blur-xs', overlayAnimationClasses[animation], className), style: { zIndex: dialogOverlayZ(depth), ...style }, ...props, ref: ref }));
|
|
66
66
|
});
|
|
67
67
|
ModalOverlay.displayName = 'ModalOverlay';
|
|
68
68
|
const ModalVariants = cva(cn('fixed gap-0 border p-0 shadow-lg overflow-y-auto', 'lg:top-[50%] lg:left-[50%] lg:grid lg:w-full lg:max-w-lg lg:-translate-x-1/2 lg:-translate-y-1/2 lg:rounded-xl', 'lg:flex lg:h-full lg:flex-col space-y-4'), {
|
|
@@ -14,7 +14,7 @@ function PreviewImage({ open, defaultOpen, onOpenChange, modal, children, }) {
|
|
|
14
14
|
const PreviewImageTrigger = DialogTrigger;
|
|
15
15
|
const PreviewImagePortal = DialogPortal;
|
|
16
16
|
const PreviewImageClose = DialogClose;
|
|
17
|
-
const PreviewImageOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Backdrop, { ref: ref, className: cn('fixed inset-0 z-50 bg-black/40', className), ...props })));
|
|
17
|
+
const PreviewImageOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Backdrop, { ref: ref, forceRender: true, className: cn('fixed inset-0 z-50 bg-black/40', className), ...props })));
|
|
18
18
|
PreviewImageOverlay.displayName = 'PreviewImageOverlay';
|
|
19
19
|
const MIN_ZOOM = 0.7;
|
|
20
20
|
const DEFAULT_ZOOM = 1;
|
package/dist/primitives/sheet.js
CHANGED
|
@@ -18,7 +18,7 @@ const SheetClose = DialogClose;
|
|
|
18
18
|
const SheetPortal = DialogPortal;
|
|
19
19
|
const SheetOverlay = React.forwardRef(({ className, style, ...props }, ref) => {
|
|
20
20
|
const depth = useDialogDepth();
|
|
21
|
-
return (_jsx(SheetPrimitive.Backdrop, { className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/80', className), style: { zIndex: dialogOverlayZ(depth), ...style }, render: stateRender('div', openState), ...props, ref: ref }));
|
|
21
|
+
return (_jsx(SheetPrimitive.Backdrop, { forceRender: true, className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/80', className), style: { zIndex: dialogOverlayZ(depth), ...style }, render: stateRender('div', openState), ...props, ref: ref }));
|
|
22
22
|
});
|
|
23
23
|
SheetOverlay.displayName = 'SheetOverlay';
|
|
24
24
|
const sheetVariants = cva('fixed flex min-h-0 flex-col gap-4 overflow-hidden bg-sidebar p-4 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out h-[calc(100vh-1.4rem)]', {
|
|
@@ -5,6 +5,7 @@ import { WarningIcon } from '@phosphor-icons/react';
|
|
|
5
5
|
import { lazy, Suspense, useContext, useMemo, useRef } from 'react';
|
|
6
6
|
import { SpaceMentionContext } from './menus/space-mentions.js';
|
|
7
7
|
import { useFeatureFlag } from '@kortix/sdk/react';
|
|
8
|
+
import { ModelConnectionLayoutContext } from '../models/model-connection-layout.js';
|
|
8
9
|
import { ImagesUnsupportedBar, ModelConnectionBar } from '../models/model-connection-gate.js';
|
|
9
10
|
import { AnimatedComposerPlaceholder } from './animated-placeholder.js';
|
|
10
11
|
import { AttachmentTiles } from './attachment-tiles.js';
|
|
@@ -25,6 +26,7 @@ export function ComposerCard({ tHardcodedUi, isDragOver, handleDragEnter, handle
|
|
|
25
26
|
// defaults mirror `ComposerImpl`'s, because the spread passes the raw
|
|
26
27
|
// values, not the component's defaulted locals.
|
|
27
28
|
agents = EMPTY_AGENTS, commands = EMPTY_COMMANDS, slashFiles = EMPTY_SLASH_FILES, models = EMPTY_MODELS, notice = null, disabled = false, lockForQuestion = false, lockForApproval = false, questionButtonLabel = null, questionActive = false, submitLabel = null, questionCanAct = true, escCount = 0, isBusy = false, isSending = false, onStop, stopDisabled = false, canStop = true, modelsLoading = false, modelRequired = false, onModelChange, modelDefaultControls, inheritedModel, providers, variants = EMPTY_VARIANTS, selectedVariant = null, onVariantChange, projectId, toolbarSlot, underbarSlot, rewind, selectedAgent = null, onAgentChange, noAccessibleAgents = false, agentLocked = false, onContextClick, messages, underbarPlacement = 'below', agentPickerCompact = false, slashMenuPlacement = 'above', cardClassName, call, }) {
|
|
29
|
+
const connectionsAbove = useContext(ModelConnectionLayoutContext) === 'above';
|
|
28
30
|
const cardRef = useRef(null);
|
|
29
31
|
const { attachAccept, modelPickerEnabled } = useUiHostConfig();
|
|
30
32
|
const inlineUnderbar = underbarPlacement === 'inline';
|
|
@@ -90,7 +92,7 @@ agents = EMPTY_AGENTS, commands = EMPTY_COMMANDS, slashFiles = EMPTY_SLASH_FILES
|
|
|
90
92
|
selectedVariant,
|
|
91
93
|
onVariantChange,
|
|
92
94
|
]);
|
|
93
|
-
return (_jsxs(ChatInputOverridesProvider, { enabled: chatInputEnabled, children: [_jsxs("div", { ref: cardRef, onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDropFiles, className: cn(
|
|
95
|
+
return (_jsxs(ChatInputOverridesProvider, { enabled: chatInputEnabled, children: [connectionsAbove ? _jsx(ModelConnectionBar, { show: noModelsConnected }) : null, _jsxs("div", { ref: cardRef, onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDropFiles, className: cn(
|
|
94
96
|
// One shadow, from the ladder. `shadow-card` is defined nowhere in
|
|
95
97
|
// `globals.css` and `shadow-xl` was dead — twMerge dropped it for the
|
|
96
98
|
// arbitrary `shadow-[…oklch…]` that followed, which was the only
|
|
@@ -124,5 +126,5 @@ agents = EMPTY_AGENTS, commands = EMPTY_COMMANDS, slashFiles = EMPTY_SLASH_FILES
|
|
|
124
126
|
toolbarSlot: inlineUnderbar ? toolbarSlot : undefined, rewind: rewind, isSending: isSending, isBusy: isBusy, onStop: onStop, stopDisabled: stopDisabled, canStop: canStop, escCount: escCount, lockForQuestion: lockForQuestion, questionButtonLabel: questionButtonLabel, submitLabel: submitLabel, questionCanAct: questionCanAct, hasText: !isEmpty, canSubmit: canSubmit, submitDisabled: submitDisabled ||
|
|
125
127
|
attachmentFailed ||
|
|
126
128
|
modelRejectingImages !== null ||
|
|
127
|
-
commandAttachmentPlan.kind === 'refuse', attachmentFailed: attachmentFailed, attachmentUnsupported: imagesUnsupportedReason, disabled: disabled, modelUnavailable: modelUnavailable, agentUnavailable: agentUnavailable, call: call, onSubmit: () => handleSubmit() })] })] })] }), _jsx(ImagesUnsupportedBar, { modelName: noModelsConnected ? null : modelRejectingImages }), inlineUnderbar ? null : (_jsx(ComposerUnderbar, { onAttachClick: handleAttachClick, agents: primaryAgents, selectedAgent: selectedAgent, onAgentChange: onAgentChange, agentMenuOpen: agentMenuOpen, onAgentMenuOpenChange: setAgentMenuOpen, noAccessibleAgents: noAccessibleAgents, agentLocked: agentLocked, messages: messages, models: models, selectedModel: availableSelectedModel, onContextClick: onContextClick, toolbarSlot: toolbarSlot, agentsSlot: underbarSlot, chatInput: chatInput })), _jsx(ModelConnectionBar, { show: noModelsConnected }), slashMenuPlacement === 'below' && (_jsx("div", { id: dockId, className: "absolute top-full right-4 left-4 z-99 mt-3.5" }))] }));
|
|
129
|
+
commandAttachmentPlan.kind === 'refuse', attachmentFailed: attachmentFailed, attachmentUnsupported: imagesUnsupportedReason, disabled: disabled, modelUnavailable: modelUnavailable, agentUnavailable: agentUnavailable, call: call, onSubmit: () => handleSubmit() })] })] })] }), _jsx(ImagesUnsupportedBar, { modelName: noModelsConnected ? null : modelRejectingImages }), inlineUnderbar ? null : (_jsx(ComposerUnderbar, { onAttachClick: handleAttachClick, agents: primaryAgents, selectedAgent: selectedAgent, onAgentChange: onAgentChange, agentMenuOpen: agentMenuOpen, onAgentMenuOpenChange: setAgentMenuOpen, noAccessibleAgents: noAccessibleAgents, agentLocked: agentLocked, messages: messages, models: models, selectedModel: availableSelectedModel, onContextClick: onContextClick, toolbarSlot: toolbarSlot, agentsSlot: underbarSlot, chatInput: chatInput })), connectionsAbove ? null : _jsx(ModelConnectionBar, { show: noModelsConnected }), slashMenuPlacement === 'below' && (_jsx("div", { id: dockId, className: "absolute top-full right-4 left-4 z-99 mt-3.5" }))] }));
|
|
128
130
|
}
|
|
@@ -25,32 +25,8 @@ export declare const TILE_SURFACE = "border-border bg-popover relative block siz
|
|
|
25
25
|
* the file, opens the lightbox). A tile with no handler carries no promise.
|
|
26
26
|
*/
|
|
27
27
|
export declare const TILE_INTERACTIVE = "hover:bg-accent cursor-pointer transition-colors duration-fast active:scale-[0.96]";
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
* that happens to draw — a logo file on a tile is a black blob at 100px, and
|
|
31
|
-
* its name is what tells it from the next logo file (Jay, 2026-09-06). It
|
|
32
|
-
* gets the named treatment, badge and all.
|
|
33
|
-
*/
|
|
34
|
-
export declare function isPreviewableImage(filename: string, mime?: string): boolean;
|
|
35
|
-
/** What the tile prints in the file's corner. Lowercase, from the name first
|
|
36
|
-
* and the MIME subtype second; empty when neither says anything. */
|
|
37
|
-
export declare function attachmentExtension(filename: string, mime?: string): string;
|
|
38
|
-
/**
|
|
39
|
-
* How a name is laid out on the tile.
|
|
40
|
-
*
|
|
41
|
-
* A short name wraps over two lines as the browser sees fit. A long one is
|
|
42
|
-
* split: the first line is the head, ellipsized by CSS at the tile's edge, and
|
|
43
|
-
* the second line is the last ten characters verbatim — the part that carries
|
|
44
|
-
* the extension and tells `…-chatux.md` from `…-ux.md`. A single middle
|
|
45
|
-
* ellipsis in one string wrapped wherever the browser chose, and left a
|
|
46
|
-
* dangling hyphen at the end of line one (2026-09-06).
|
|
47
|
-
*/
|
|
48
|
-
export declare const LONG_NAME_THRESHOLD = 24;
|
|
49
|
-
export declare const NAME_TAIL_CHARS = 10;
|
|
50
|
-
export declare function splitFilenameForTile(name: string): {
|
|
51
|
-
head: string;
|
|
52
|
-
tail: string;
|
|
53
|
-
} | null;
|
|
28
|
+
/** The five tile rules live once in `@kortix/shared/session/attachment-tile`. */
|
|
29
|
+
export { LONG_NAME_THRESHOLD, NAME_TAIL_CHARS, attachmentExtension, isPreviewableImage, splitFilenameForTile, } from '../../_vendor/shared/session/attachment-tile.js';
|
|
54
30
|
/** A tile previews the head of the paste only: the clamp shows four lines, and the DOM need not hold 100 kB. */
|
|
55
31
|
export declare const PASTE_PREVIEW_CHARS = 400;
|
|
56
32
|
export interface AttachmentTileProps {
|