@kortix/ui 0.15.7 → 0.15.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/_vendor/kortix-shared.js +39 -1
- package/dist/_vendor/shared/my-kortix-agent.d.ts +7 -0
- package/dist/_vendor/shared/pixel-mark.d.ts +18 -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/catalog/connector-categories.d.ts +2 -2
- package/dist/customize/connectors/catalog/connector-categories.js +2 -2
- package/dist/customize/connectors/connector-identity.js +3 -3
- 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-modal.js +1 -1
- 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 +27 -7
- 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/providers/provider-accordion.js +5 -4
- package/dist/customize/providers/provider-connect.js +3 -1
- package/dist/customize/providers/provider-sheet.js +9 -4
- package/dist/customize/sections/component/email-connect-form.js +4 -2
- package/dist/customize/sections/connectors-view.d.ts +4 -1
- package/dist/customize/sections/connectors-view.js +42 -7
- package/dist/customize/sections/gateway-view.d.ts +1 -1
- package/dist/customize/sections/gateway-view.js +1 -1
- package/dist/customize/sections/view/account-secret-resources-panel.d.ts +15 -0
- package/dist/customize/sections/view/account-secret-resources-panel.js +48 -7
- package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
- package/dist/customize/sections/view/git-view.js +1 -1
- package/dist/customize/sections/view/permission-editor.js +1 -1
- 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/sections/view/subscription-usage.d.ts +3 -32
- package/dist/customize/sections/view/subscription-usage.js +2 -86
- package/dist/customize/shared/entity/entity-modal.js +8 -10
- 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/files/project/components/drive-toolbar.d.ts +1 -1
- package/dist/files/project/components/drive-toolbar.js +1 -1
- package/dist/files/project/store/version-store.d.ts +1 -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/scroll-area-compat.d.ts +6 -6
- package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
- package/dist/files/renderers/shared/select-compat.js +3 -7
- 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/file-preview-modal.d.ts +10 -11
- package/dist/files/viewer/file-preview-modal.js +17 -18
- package/dist/files/viewer/use-file-content-state.js +10 -9
- package/dist/i18n/en.d.ts +51 -0
- package/dist/i18n/en.js +58 -7
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/account-hub-location.js +2 -2
- package/dist/internal/account-hub/use-account-members.d.ts +28 -1
- package/dist/internal/account-hub/use-account-members.js +27 -10
- package/dist/internal/chrome/use-chrome-offered.d.ts +2 -1
- package/dist/internal/chrome/use-chrome-offered.js +4 -2
- package/dist/internal/components/agent-mark.d.ts +1 -8
- package/dist/internal/components/agent-mark.js +2 -19
- 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/lib/error-handler.js +33 -0
- package/dist/internal/lib/navigation/modified-click.js +2 -2
- package/dist/internal/lib/pixel-mark.d.ts +3 -20
- package/dist/internal/lib/pixel-mark.js +3 -34
- package/dist/internal/lib/trigger-clock.d.ts +7 -2
- package/dist/internal/lib/trigger-clock.js +17 -3
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-hover-store.d.ts +1 -1
- package/dist/internal/stores/session-hover-store.js +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +1 -1
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.d.ts +149 -0
- package/dist/lib/base-ui-compat.js +339 -0
- package/dist/lib/portal-container.d.ts +3 -7
- package/dist/lib/portal-container.js +5 -3
- package/dist/lib/z-stack.d.ts +9 -5
- package/dist/lib/z-stack.js +17 -7
- package/dist/primitives/accordion.d.ts +36 -5
- package/dist/primitives/accordion.js +41 -8
- package/dist/primitives/alert-dialog.d.ts +33 -11
- package/dist/primitives/alert-dialog.js +41 -19
- package/dist/primitives/avatar.d.ts +5 -2
- package/dist/primitives/avatar.js +3 -3
- package/dist/primitives/badge.js +1 -1
- package/dist/primitives/breadcrumb.js +1 -1
- package/dist/primitives/button-group.js +3 -3
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox.d.ts +14 -5
- package/dist/primitives/checkbox.js +24 -9
- package/dist/primitives/collapsible.d.ts +16 -4
- package/dist/primitives/collapsible.js +18 -7
- package/dist/primitives/command-core.d.ts +121 -0
- package/dist/primitives/command-core.js +642 -0
- package/dist/primitives/command.d.ts +38 -4
- package/dist/primitives/command.js +22 -13
- package/dist/primitives/context-menu.d.ts +61 -31
- package/dist/primitives/context-menu.js +40 -53
- package/dist/primitives/dialog.d.ts +48 -10
- package/dist/primitives/dialog.js +48 -19
- package/dist/primitives/disclosure.d.ts +1 -1
- package/dist/primitives/disclosure.js +2 -2
- package/dist/primitives/drawer.d.ts +28 -9
- package/dist/primitives/drawer.js +42 -18
- package/dist/primitives/dropdown-menu.d.ts +55 -33
- package/dist/primitives/dropdown-menu.js +46 -82
- package/dist/primitives/faded-scroll-area.js +2 -1
- package/dist/primitives/hint.js +3 -3
- package/dist/primitives/hover-card.d.ts +17 -5
- package/dist/primitives/hover-card.js +45 -8
- package/dist/primitives/item.js +2 -2
- package/dist/primitives/label.d.ts +5 -2
- package/dist/primitives/label.js +10 -3
- package/dist/primitives/menu-base.d.ts +150 -0
- package/dist/primitives/menu-base.js +171 -0
- package/dist/primitives/menu-recipe.d.ts +1 -1
- package/dist/primitives/menu-recipe.js +2 -7
- package/dist/primitives/modal.d.ts +19 -52
- package/dist/primitives/modal.js +24 -28
- package/dist/primitives/navigation-menu.d.ts +36 -11
- package/dist/primitives/navigation-menu.js +31 -12
- package/dist/primitives/popover.d.ts +31 -6
- package/dist/primitives/popover.js +79 -12
- package/dist/primitives/preview-image.d.ts +18 -7
- package/dist/primitives/preview-image.js +14 -11
- package/dist/primitives/progress.d.ts +4 -2
- package/dist/primitives/progress.js +4 -3
- package/dist/primitives/project-icon-picker.js +2 -2
- package/dist/primitives/radio-group.d.ts +28 -5
- package/dist/primitives/radio-group.js +18 -10
- package/dist/primitives/scroll-area.d.ts +2 -2
- package/dist/primitives/scroll-area.js +8 -3
- package/dist/primitives/select.d.ts +55 -12
- package/dist/primitives/select.js +93 -36
- package/dist/primitives/separator.d.ts +6 -2
- package/dist/primitives/separator.js +10 -2
- package/dist/primitives/sheet.d.ts +17 -10
- package/dist/primitives/sheet.js +19 -22
- package/dist/primitives/sidebar-menu-primitives.js +8 -8
- package/dist/primitives/slider-native.d.ts +2 -2
- package/dist/primitives/slider-native.js +11 -9
- package/dist/primitives/slider.d.ts +24 -6
- package/dist/primitives/slider.js +26 -24
- package/dist/primitives/slot.d.ts +6 -0
- package/dist/primitives/slot.js +7 -0
- package/dist/primitives/split-sheet.js +1 -1
- package/dist/primitives/stepper.js +1 -1
- package/dist/primitives/switch.d.ts +16 -3
- package/dist/primitives/switch.js +7 -6
- package/dist/primitives/tabs.d.ts +36 -20
- package/dist/primitives/tabs.js +131 -102
- package/dist/primitives/toggle.d.ts +16 -3
- package/dist/primitives/toggle.js +8 -3
- package/dist/primitives/tooltip.d.ts +24 -5
- package/dist/primitives/tooltip.js +32 -10
- package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
- package/dist/primitives/type-to-confirm-dialog.js +1 -1
- package/dist/session/composer/animated-placeholder.js +1 -1
- package/dist/session/composer/chat-input/chat-input-control.js +3 -3
- package/dist/session/composer/editor/composer-editor.js +1 -1
- package/dist/session/composer/menus/menu-shell.d.ts +1 -1
- package/dist/session/composer/menus/menu-shell.js +1 -1
- package/dist/session/composer/menus/mount.js +1 -1
- package/dist/session/composer/reasoning-effort-selector.js +1 -1
- package/dist/session/header/session-site-header.js +2 -2
- package/dist/session/header/subagent-hover-card.js +2 -2
- package/dist/session/media/image-preview.js +1 -1
- package/dist/session/models/model-connection-gate.js +16 -3
- 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 +18 -12
- 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-switcher.d.ts +37 -0
- package/dist/session/models/subscription-switcher.js +97 -0
- package/dist/session/models/subscription-windows.d.ts +40 -0
- package/dist/session/models/subscription-windows.js +86 -0
- package/dist/session/overrides/session-overrides-control.js +3 -3
- package/dist/session/panel/diff-dialog.js +1 -1
- package/dist/session/panel/easy/detail-view.js +3 -3
- package/dist/session/panel/mobile-tool-drawer.js +2 -2
- package/dist/session/panel/panel-fallback.js +1 -1
- package/dist/session/panel/session-files-explorer.d.ts +1 -1
- package/dist/session/panel/session-files-explorer.js +1 -1
- 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/session-error-banner.d.ts +1 -1
- package/dist/session/status/session-error-banner.js +12 -4
- package/dist/session/thread/session-chat.js +9 -4
- package/dist/session/thread/session-context-message-explorer.js +1 -1
- package/dist/session/thread/transcript.js +31 -7
- package/dist/session/thread/turn-share.js +3 -4
- package/dist/session/tool/shared/show-helpers.js +1 -1
- package/dist/session/turn/message-time-label.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +51 -0
- package/dist/workspace/projects/modal/project-icon-field.js +9 -23
- package/dist/workspace/review/review-center.js +1 -1
- package/dist/workspace/sessions/session-row.js +1 -1
- package/dist/workspace/sidebar/project-session-list.js +2 -2
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
- package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
- package/dist/workspace/sidebar/session-title.d.ts +2 -2
- package/dist/workspace/sidebar/session-title.js +2 -2
- package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
- package/dist/workspace/spaces/space-links.js +1 -1
- package/dist/workspace/spaces/space-threads-tab.js +1 -1
- package/package.json +16 -35
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/custom-dashboard.md +1 -1
|
@@ -5,6 +5,7 @@ import { setWasmSource, useXlsxViewer, useXlsxViewerController, useXlsxViewerThu
|
|
|
5
5
|
import { CaretLeftIcon as ChevronLeft, CaretRightIcon as ChevronRight, MinusCircleIcon as CircleMinus, PlusCircleIcon as CirclePlus, DotsThreeIcon as Ellipsis, MagnifyingGlassIcon as Search, UploadIcon as Upload, } from '@phosphor-icons/react';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
|
+
import { downloadBlob } from '../../../internal/lib/utils/download.js';
|
|
8
9
|
import { Button } from '../../../primitives/button.js';
|
|
9
10
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger, } from '../../../primitives/dropdown-menu.js';
|
|
10
11
|
import { Input } from '../../../primitives/input.js';
|
|
@@ -51,17 +52,22 @@ const XLSX_SHEET_TAB_THUMBNAIL_OPTIONS = {
|
|
|
51
52
|
maxWidth: 560,
|
|
52
53
|
},
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return
|
|
55
|
+
/** The workbook Blob's own identity: the same object keeps one id, a fresh
|
|
56
|
+
* read (an edited file, a refetch) gets the next one, so per-workbook state
|
|
57
|
+
* (search, sheet tabs, zoom) resets exactly when the bytes change — the same
|
|
58
|
+
* remount-on-change the blob URL gave this identity before the workbook
|
|
59
|
+
* arrived as a Blob instead of a URL. */
|
|
60
|
+
const workbookIds = new WeakMap();
|
|
61
|
+
let nextWorkbookId = 1;
|
|
62
|
+
function workbookIdentity(blob) {
|
|
63
|
+
if (!blob)
|
|
64
|
+
return 'empty';
|
|
65
|
+
let id = workbookIds.get(blob);
|
|
66
|
+
if (id === undefined) {
|
|
67
|
+
id = nextWorkbookId++;
|
|
68
|
+
workbookIds.set(blob, id);
|
|
64
69
|
}
|
|
70
|
+
return `blob-${id}`;
|
|
65
71
|
}
|
|
66
72
|
function ensureWorkbookExtension(fileName) {
|
|
67
73
|
const lowerFileName = fileName.toLowerCase();
|
|
@@ -76,15 +82,7 @@ function downloadWorkbookBuffer(buffer, fileName) {
|
|
|
76
82
|
? 'application/vnd.ms-excel'
|
|
77
83
|
: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
78
84
|
});
|
|
79
|
-
|
|
80
|
-
const anchor = document.createElement('a');
|
|
81
|
-
anchor.href = url;
|
|
82
|
-
anchor.download = resolvedFileName;
|
|
83
|
-
anchor.rel = 'noopener';
|
|
84
|
-
document.body.append(anchor);
|
|
85
|
-
anchor.click();
|
|
86
|
-
anchor.remove();
|
|
87
|
-
setTimeout(() => URL.revokeObjectURL(url), 0);
|
|
85
|
+
downloadBlob(blob, resolvedFileName);
|
|
88
86
|
}
|
|
89
87
|
function normalizeSearchText(value) {
|
|
90
88
|
return typeof value === 'string'
|
|
@@ -634,26 +632,26 @@ export function XlsxWorkbookSurface({ className, fileName, isDark, onDownload, o
|
|
|
634
632
|
}, [copySelection]);
|
|
635
633
|
return (_jsxs("div", { className: cn('bg-background flex h-[640px] min-h-0 flex-col overflow-hidden', className), children: [showToolbar ? (_jsx(WorkbookToolbar, { fileName: fileName, isDark: isDark, onDownload: onDownload, onIsDarkChange: onIsDarkChange, onUploadClick: onUploadClick, showDownloadButton: showDownloadButton, showNightRenderToggle: showNightRenderToggle, showUploadButton: showUploadButton, toolbarActions: toolbarActions, viewportRef: viewportRef, workbookIdentity: workbookIdentity })) : null, _jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [_jsx(ViewerCopyMenu, { onCopy: copySelection, children: _jsx("div", { className: "bg-muted/20 min-h-0 flex-1", children: _jsx(XlsxViewer, { experimentalCanvas: true, allowResizeInReadOnly: true, className: "h-full min-h-0 min-w-0", height: "100%", isDark: isDark, readOnly: true, rounded: false, showDefaultToolbar: false, showImages: true, fileTooLargeState: _jsx("div", { className: "grid h-full w-full min-w-full place-items-center p-6", children: _jsxs("div", { className: "bg-background max-w-sm rounded-lg border p-4 text-sm", children: [_jsx("p", { className: "font-medium", children: tI18nComplete.raw('text8a2819cae213') }), _jsx("p", { className: "text-muted-foreground mt-1", children: tI18nComplete.raw('textd3821f7d63f3') })] }) }), loadingState: _jsx(ViewerLoadingSurface, {}), renderScroller: renderSearchableScroller, errorState: _jsx("div", { className: "text-destructive grid h-full w-full min-w-full place-items-center p-6 text-sm", children: error?.message ?? tI18nComplete.raw('text8d75c18adecc') }), renderTableHeaderMenu: renderTableHeaderMenu }) }) }), _jsx(WorkbookSheetTabs, { workbookIdentity: workbookIdentity })] })] }));
|
|
636
634
|
}
|
|
637
|
-
export function XlsxViewerPreview({ className, fileName, isDark, onIsDarkChange, showDownload = true, showToolbar = true, showUpload = true,
|
|
638
|
-
return (_jsx(XlsxViewerContent, { className: className, effectiveIsDark: isDark, fileName: fileName, setNightRenderEnabled: onIsDarkChange, shouldRenderNightMode: true, showDownload: showDownload, showToolbar: showToolbar, showUpload: showUpload, toolbarActions: toolbarActions,
|
|
635
|
+
export function XlsxViewerPreview({ className, fileName, isDark, onIsDarkChange, showDownload = true, showToolbar = true, showUpload = true, workbook, toolbarActions, }) {
|
|
636
|
+
return (_jsx(XlsxViewerContent, { className: className, effectiveIsDark: isDark, fileName: fileName, setNightRenderEnabled: onIsDarkChange, shouldRenderNightMode: true, showDownload: showDownload, showToolbar: showToolbar, showUpload: showUpload, toolbarActions: toolbarActions, workbook: workbook }));
|
|
639
637
|
}
|
|
640
|
-
function XlsxViewerContent({ className, effectiveIsDark, fileName, setNightRenderEnabled, shouldRenderNightMode, showDownload, showToolbar = true, showUpload, toolbarActions,
|
|
638
|
+
function XlsxViewerContent({ className, effectiveIsDark, fileName, setNightRenderEnabled, shouldRenderNightMode, showDownload, showToolbar = true, showUpload, toolbarActions, workbook, }) {
|
|
641
639
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
642
640
|
const fileInputRef = React.useRef(null);
|
|
643
641
|
const [uploadedWorkbook, setUploadedWorkbook] = React.useState(null);
|
|
644
|
-
const sourceFileName = React.useMemo(() => (
|
|
642
|
+
const sourceFileName = React.useMemo(() => fileName?.trim() || 'workbook.xlsx', [fileName]);
|
|
645
643
|
const displayFileName = React.useMemo(() => uploadedWorkbook?.fileName ?? sourceFileName, [sourceFileName, uploadedWorkbook?.fileName]);
|
|
646
|
-
const
|
|
644
|
+
const identity = React.useMemo(() => uploadedWorkbook?.identity ?? workbookIdentity(workbook), [uploadedWorkbook?.identity, workbook]);
|
|
647
645
|
const [workbookBuffer, setWorkbookBuffer] = React.useState(null);
|
|
648
646
|
const [loadError, setLoadError] = React.useState();
|
|
649
647
|
const shouldShowLoadingSpinner = useDelayedLoadingIndicator(!workbookBuffer && !loadError && !uploadedWorkbook, XLSX_LOADING_INDICATOR_DELAY_MS);
|
|
650
648
|
React.useEffect(() => {
|
|
651
649
|
let isCurrent = true;
|
|
652
|
-
if (
|
|
650
|
+
if (workbook) {
|
|
653
651
|
setUploadedWorkbook(null);
|
|
654
652
|
}
|
|
655
653
|
async function loadWorkbook() {
|
|
656
|
-
if (!
|
|
654
|
+
if (!workbook) {
|
|
657
655
|
setWorkbookBuffer(null);
|
|
658
656
|
setLoadError(undefined);
|
|
659
657
|
return;
|
|
@@ -661,11 +659,7 @@ function XlsxViewerContent({ className, effectiveIsDark, fileName, setNightRende
|
|
|
661
659
|
setWorkbookBuffer(null);
|
|
662
660
|
setLoadError(undefined);
|
|
663
661
|
try {
|
|
664
|
-
const
|
|
665
|
-
if (!response.ok) {
|
|
666
|
-
throw new Error(`Failed to fetch XLSX (${response.status})`);
|
|
667
|
-
}
|
|
668
|
-
const nextWorkbookBuffer = await response.arrayBuffer();
|
|
662
|
+
const nextWorkbookBuffer = await workbook.arrayBuffer();
|
|
669
663
|
if (!isCurrent)
|
|
670
664
|
return;
|
|
671
665
|
setWorkbookBuffer(nextWorkbookBuffer);
|
|
@@ -680,7 +674,7 @@ function XlsxViewerContent({ className, effectiveIsDark, fileName, setNightRende
|
|
|
680
674
|
return () => {
|
|
681
675
|
isCurrent = false;
|
|
682
676
|
};
|
|
683
|
-
}, [
|
|
677
|
+
}, [workbook]);
|
|
684
678
|
async function handleUpload(event) {
|
|
685
679
|
const file = event.target.files?.[0];
|
|
686
680
|
event.target.value = '';
|
|
@@ -696,8 +690,8 @@ function XlsxViewerContent({ className, effectiveIsDark, fileName, setNightRende
|
|
|
696
690
|
}
|
|
697
691
|
const activeBuffer = uploadedWorkbook?.buffer ?? workbookBuffer;
|
|
698
692
|
const activeFileName = uploadedWorkbook?.fileName ?? displayFileName;
|
|
699
|
-
const activeIdentity =
|
|
700
|
-
if (!
|
|
693
|
+
const activeIdentity = identity;
|
|
694
|
+
if (!workbook && !uploadedWorkbook) {
|
|
701
695
|
return (_jsxs("div", { className: cn('bg-background flex h-[640px] min-h-0 flex-col overflow-hidden', className), children: [_jsx("input", { ref: fileInputRef, type: "file", accept: ".xlsx,.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel", className: "hidden", onChange: handleUpload }), _jsx(WorkbookStandaloneToolbar, { onUploadClick: () => fileInputRef.current?.click(), showUploadButton: showUpload, toolbarActions: toolbarActions }), _jsx("div", { className: "bg-muted/30 grid min-h-0 flex-1 place-items-center p-4", children: _jsxs("div", { className: "bg-background max-w-md rounded-lg border p-4 text-center text-sm shadow-xs", children: [_jsx("p", { className: "font-medium", children: tI18nComplete.raw('text2e15b5a6e45a') }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [tI18nComplete.raw('text27acc1f81d66'), " ", _jsx("code", { children: "src" }), ' ', tI18nComplete.raw('text37056f2381e2')] }), _jsxs(Button, { type: "button", variant: "outline", size: "sm", className: "mt-4", onClick: () => fileInputRef.current?.click(), children: [_jsx(Upload, { className: "size-4" }), tI18nComplete.raw('text522d6e41c020')] })] }) })] }));
|
|
702
696
|
}
|
|
703
697
|
if (loadError && !activeBuffer) {
|
|
@@ -132,10 +132,7 @@ export function FileContentRenderer({ filePath, showHeader = true, headerSlot, h
|
|
|
132
132
|
!isSandboxWaking &&
|
|
133
133
|
(sharedImagePath && !isNotFound ? (
|
|
134
134
|
// An image never shows the read's raw error text (R38).
|
|
135
|
-
_jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsx(ImageUnavailable, { onRetry: retrySharedImage }) })) : errorFallback ? (errorFallback(contentError, filePath)) : isNotFound ? (_jsx(FileNotFoundState, { filePath: filePath })) : (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-3 p-8 text-center", children: [_jsx("div", { className: "bg-destructive/10 flex h-12 w-12 items-center justify-center rounded-sm", children: _jsx(FileWarning, { className: "text-destructive/50 h-6 w-6" }) }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: tHardcodedUi.raw('featuresFilesComponentsFileContentRenderer.line692JsxTextFailedToLoadFile') }), _jsx("p", { className: "text-muted-foreground/50 max-w-sm font-mono text-xs break-all", children: filePath }), _jsx("p", { className: "text-muted-foreground/60 max-w-sm text-xs", children: contentError })] }))), !isLoading && !error && imageDataUrl && (_jsx(CaptionedImage, { caption: caption, open: captionOpen, onOpenChange: onCaptionOpenChange, children: _jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ImageRenderer, { url: imageDataUrl, className: "h-full", fileName: fileName, controls: imageControls, info: imageInfo }) }) })), isHeicImage && (blobLoading || heicConverting) && _jsx(RendererFallback, {}), isHeicImage && !blobLoading && !blobError && heicImageUrl && !heicConverting && (_jsx(CaptionedImage, { caption: caption, open: captionOpen, onOpenChange: onCaptionOpenChange, children: _jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ImageRenderer, { url: heicImageUrl, className: "h-full", fileName: fileName, controls: imageControls, info: imageInfo }) }) })), isContentReady && fileCategory === 'pdf' && fileContent?.content && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(PdfRenderer, { fileContent: fileContent.content, fileName: fileName, className: "h-full", fitOnOpen: fitOnOpen, findText: findText, showDownload: false }) })), isContentReady && fileCategory === 'docx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(DocxRenderer, { blob: rawBlob, fileName: fileName, className: "h-full", showDownload: false }) })), isContentReady && fileCategory === 'zip' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ZipRenderer, { blob: rawBlob, fileName: fileName, className: "h-full" }, filePath) })), !isLoading && !error && !isNotFound && fileCategory === '
|
|
136
|
-
// A bytes-only source hands the workbook over as a blob URL;
|
|
137
|
-
// the renderer reads a sandbox path only for a session.
|
|
138
|
-
filePath: bytesOnly ? blobUrl : filePath, fileName: fileName, className: "h-full", showDownload: false }, `xlsx-${filePath}-${contentRevision}-${reloadKey}`) })), !isLoading && !error && !isNotFound && fileCategory === 'sqlite' && (!bytesOnly || rawBlob) && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(SqliteRenderer, { filePath: filePath, fileName: fileName, className: "h-full", readOnly: readOnly, ...(bytesOnly ? { bytes: rawBlob, onSave: saveThroughSource } : {}) }, `sqlite-${filePath}-${contentRevision}-${reloadKey}`) })), !isLoading && !error && csvAsTable && fileContent && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(CsvRenderer, { content: fileContent.content, fileName: fileName, className: "h-full", showDownload: false }) })), isContentReady && fileCategory === 'video' && blobUrl && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(VideoRenderer, { url: blobUrl, className: "h-full" }) })), isContentReady && fileCategory === 'audio' && blobUrl && (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-5 p-8", children: [_jsx("div", { className: "bg-muted/50 flex h-14 w-14 items-center justify-center rounded-sm", children: _jsxs("svg", { className: "text-muted-foreground/40 h-6 w-6", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [_jsx("path", { d: "M9 18V5l12-2v13" }), _jsx("circle", { cx: "6", cy: "18", r: "3" }), _jsx("circle", { cx: "18", cy: "16", r: "3" })] }) }), _jsx("p", { className: "text-muted-foreground/60 text-sm", children: fileName }), _jsx("audio", { controls: true, src: blobUrl, className: "w-full max-w-sm" })] })), isContentReady && fileCategory === 'pptx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(PptxRenderer, { blob: rawBlob, binaryUrl: blobUrl, filePath: filePath, fileName: fileName, className: "h-full", onDownload: handleDownload }) })), isHtmlFile && isHtmlPreview && (_jsx(HtmlPreview, { path: toSandboxAbsolutePath(filePath), reloadKey: `${fetchRevision}-${reloadKey}`, fileName: fileName, pendingLabel: tHardcodedUi.raw('featuresFilesComponentsFileContentRenderer.line805JsxTextStartingPreviewServer') }, `html-preview-${filePath}`)), isHtmlFile && !isHtmlPreview && !isLoading && !error && fileContent?.type === 'text' && (_jsx(CodeEditor, { editorClassName: codeEditorEditorClassName, ...codeEditorProps, className: readOnly ? 'min-h-full' : 'h-full' }, `html-source-${filePath}-${discardKey}`)), !isLoading &&
|
|
135
|
+
_jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsx(ImageUnavailable, { onRetry: retrySharedImage }) })) : errorFallback ? (errorFallback(contentError, filePath)) : isNotFound ? (_jsx(FileNotFoundState, { filePath: filePath })) : (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-3 p-8 text-center", children: [_jsx("div", { className: "bg-destructive/10 flex h-12 w-12 items-center justify-center rounded-sm", children: _jsx(FileWarning, { className: "text-destructive/50 h-6 w-6" }) }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: tHardcodedUi.raw('featuresFilesComponentsFileContentRenderer.line692JsxTextFailedToLoadFile') }), _jsx("p", { className: "text-muted-foreground/50 max-w-sm font-mono text-xs break-all", children: filePath }), _jsx("p", { className: "text-muted-foreground/60 max-w-sm text-xs", children: contentError })] }))), !isLoading && !error && imageDataUrl && (_jsx(CaptionedImage, { caption: caption, open: captionOpen, onOpenChange: onCaptionOpenChange, children: _jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ImageRenderer, { url: imageDataUrl, className: "h-full", fileName: fileName, controls: imageControls, info: imageInfo }) }) })), isHeicImage && (blobLoading || heicConverting) && _jsx(RendererFallback, {}), isHeicImage && !blobLoading && !blobError && heicImageUrl && !heicConverting && (_jsx(CaptionedImage, { caption: caption, open: captionOpen, onOpenChange: onCaptionOpenChange, children: _jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ImageRenderer, { url: heicImageUrl, className: "h-full", fileName: fileName, controls: imageControls, info: imageInfo }) }) })), isContentReady && fileCategory === 'pdf' && fileContent?.content && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(PdfRenderer, { fileContent: fileContent.content, fileName: fileName, className: "h-full", fitOnOpen: fitOnOpen, findText: findText, showDownload: false }) })), isContentReady && fileCategory === 'docx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(DocxRenderer, { blob: rawBlob, fileName: fileName, className: "h-full", showDownload: false }) })), isContentReady && fileCategory === 'zip' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ZipRenderer, { blob: rawBlob, fileName: fileName, className: "h-full" }, filePath) })), isContentReady && fileCategory === 'xlsx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(XlsxRenderer, { blob: rawBlob, fileName: fileName, className: "h-full", showDownload: false }, `xlsx-${filePath}-${contentRevision}-${reloadKey}`) })), !isLoading && !error && !isNotFound && fileCategory === 'sqlite' && (!bytesOnly || rawBlob) && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(SqliteRenderer, { filePath: filePath, fileName: fileName, className: "h-full", readOnly: readOnly, ...(bytesOnly ? { bytes: rawBlob, onSave: saveThroughSource } : {}) }, `sqlite-${filePath}-${contentRevision}-${reloadKey}`) })), !isLoading && !error && csvAsTable && fileContent && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(CsvRenderer, { content: fileContent.content, fileName: fileName, className: "h-full", showDownload: false }) })), isContentReady && fileCategory === 'video' && blobUrl && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(VideoRenderer, { url: blobUrl, className: "h-full" }) })), isContentReady && fileCategory === 'audio' && blobUrl && (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-5 p-8", children: [_jsx("div", { className: "bg-muted/50 flex h-14 w-14 items-center justify-center rounded-sm", children: _jsxs("svg", { className: "text-muted-foreground/40 h-6 w-6", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [_jsx("path", { d: "M9 18V5l12-2v13" }), _jsx("circle", { cx: "6", cy: "18", r: "3" }), _jsx("circle", { cx: "18", cy: "16", r: "3" })] }) }), _jsx("p", { className: "text-muted-foreground/60 text-sm", children: fileName }), _jsx("audio", { controls: true, src: blobUrl, className: "w-full max-w-sm" })] })), isContentReady && fileCategory === 'pptx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(PptxRenderer, { blob: rawBlob, binaryUrl: blobUrl, filePath: filePath, fileName: fileName, className: "h-full", onDownload: handleDownload }) })), isHtmlFile && isHtmlPreview && (_jsx(HtmlPreview, { path: toSandboxAbsolutePath(filePath), reloadKey: `${fetchRevision}-${reloadKey}`, fileName: fileName, pendingLabel: tHardcodedUi.raw('featuresFilesComponentsFileContentRenderer.line805JsxTextStartingPreviewServer') }, `html-preview-${filePath}`)), isHtmlFile && !isHtmlPreview && !isLoading && !error && fileContent?.type === 'text' && (_jsx(CodeEditor, { editorClassName: codeEditorEditorClassName, ...codeEditorProps, className: readOnly ? 'min-h-full' : 'h-full' }, `html-source-${filePath}-${discardKey}`)), !isLoading &&
|
|
139
136
|
!error &&
|
|
140
137
|
fileContent &&
|
|
141
138
|
fileContent.type === 'binary' &&
|
|
@@ -48,16 +48,15 @@ export interface FilePreviewModalProps extends FilePreviewState {
|
|
|
48
48
|
* source down; this component owns all the chrome so every surface looks and
|
|
49
49
|
* behaves identically (one full-bleed brand style, no variants).
|
|
50
50
|
*
|
|
51
|
-
* It portals to <body
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* `
|
|
60
|
-
*
|
|
61
|
-
* Z-index is dialog-depth aware so it always stacks above its host overlay.
|
|
51
|
+
* It portals to <body>, also when nested inside a parent modal dialog (the
|
|
52
|
+
* Customize overlay). That dialog blocks outside pointer input with a
|
|
53
|
+
* full-screen backdrop and locks page scroll. Three things keep this preview
|
|
54
|
+
* usable on top of it:
|
|
55
|
+
* 1. Z-index is dialog-depth aware, so it stacks above the host's backdrop.
|
|
56
|
+
* 2. `pointer-events-auto` on the backdrop + surface, so an ancestor that
|
|
57
|
+
* sets `pointer-events:none` cannot make it inert.
|
|
58
|
+
* 3. A native `wheel`/`touchmove` listener that stops propagation before the
|
|
59
|
+
* event reaches `document`, so no document-level wheel handler can cancel
|
|
60
|
+
* scrolling here.
|
|
62
61
|
*/
|
|
63
62
|
export declare function FilePreviewModal({ selectedFilePath, panelMode, filePathList, currentFileIndex, onClose: closePreview, onNext: nextPreview, onPrev: prevPreview, source, HistoryContent, renderFileIcon, statusSlot, extraActions, shareContext, historyLabel, embedded, targetLine, }: FilePreviewModalProps): import("react").JSX.Element | null;
|
|
@@ -41,17 +41,16 @@ const NO_REFRESH = {
|
|
|
41
41
|
* source down; this component owns all the chrome so every surface looks and
|
|
42
42
|
* behaves identically (one full-bleed brand style, no variants).
|
|
43
43
|
*
|
|
44
|
-
* It portals to <body
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* `
|
|
53
|
-
*
|
|
54
|
-
* Z-index is dialog-depth aware so it always stacks above its host overlay.
|
|
44
|
+
* It portals to <body>, also when nested inside a parent modal dialog (the
|
|
45
|
+
* Customize overlay). That dialog blocks outside pointer input with a
|
|
46
|
+
* full-screen backdrop and locks page scroll. Three things keep this preview
|
|
47
|
+
* usable on top of it:
|
|
48
|
+
* 1. Z-index is dialog-depth aware, so it stacks above the host's backdrop.
|
|
49
|
+
* 2. `pointer-events-auto` on the backdrop + surface, so an ancestor that
|
|
50
|
+
* sets `pointer-events:none` cannot make it inert.
|
|
51
|
+
* 3. A native `wheel`/`touchmove` listener that stops propagation before the
|
|
52
|
+
* event reaches `document`, so no document-level wheel handler can cancel
|
|
53
|
+
* scrolling here.
|
|
55
54
|
*/
|
|
56
55
|
export function FilePreviewModal({ selectedFilePath, panelMode, filePathList, currentFileIndex, onClose: closePreview, onNext: nextPreview, onPrev: prevPreview, source, HistoryContent, renderFileIcon, statusSlot, extraActions, shareContext, historyLabel = "History", embedded = false, targetLine = null, }) {
|
|
57
56
|
const tI18nHardcoded = useTranslations("hardcodedUi");
|
|
@@ -98,14 +97,14 @@ export function FilePreviewModal({ selectedFilePath, panelMode, filePathList, cu
|
|
|
98
97
|
setExpanded(false);
|
|
99
98
|
}, [selectedFilePath, targetLine]);
|
|
100
99
|
// Keyboard navigation. Capture-phase + stopImmediatePropagation so ESC only
|
|
101
|
-
// closes the preview, not a host
|
|
100
|
+
// closes the preview, not a host dialog underneath (Customize overlay).
|
|
102
101
|
useEffect(() => {
|
|
103
102
|
if (!isOpen)
|
|
104
103
|
return;
|
|
105
104
|
const handleKeyDown = (e) => {
|
|
106
105
|
// Focus trap: keep Tab cycling within the dialog. Only acts when focus is
|
|
107
|
-
// already inside our surface, so when nested under the Customize
|
|
108
|
-
// dialog (whose own
|
|
106
|
+
// already inside our surface, so when nested under the Customize
|
|
107
|
+
// dialog (whose own focus trap owns focus) we don't hijack its Tab order.
|
|
109
108
|
if (e.key === "Tab") {
|
|
110
109
|
const surface = surfaceRef.current;
|
|
111
110
|
if (surface && surface.contains(document.activeElement)) {
|
|
@@ -178,7 +177,7 @@ export function FilePreviewModal({ selectedFilePath, panelMode, filePathList, cu
|
|
|
178
177
|
]);
|
|
179
178
|
// Move focus into the dialog on open and restore it to the triggering element
|
|
180
179
|
// on close. Standalone (session Files tab) this completes the focus trap;
|
|
181
|
-
// nested under the Customize
|
|
180
|
+
// nested under the Customize dialog, that dialog's focus trap may keep focus —
|
|
182
181
|
// we make a single, non-looping attempt and don't fight it (no regression).
|
|
183
182
|
useEffect(() => {
|
|
184
183
|
// Inline (embedded) viewers must not steal focus from the chat composer.
|
|
@@ -202,10 +201,10 @@ export function FilePreviewModal({ selectedFilePath, panelMode, filePathList, cu
|
|
|
202
201
|
};
|
|
203
202
|
}
|
|
204
203
|
}, [isOpen, fullscreen]);
|
|
205
|
-
// Keep wheel/touch scroll alive when nested under a
|
|
206
|
-
//
|
|
204
|
+
// Keep wheel/touch scroll alive when nested under a modal dialog: stop the
|
|
205
|
+
// event before it reaches document, where a scroll-lock listener could
|
|
207
206
|
// preventDefault it. Native listener (not React onWheel) so it fires during
|
|
208
|
-
// real DOM bubbling, ahead of
|
|
207
|
+
// real DOM bubbling, ahead of any document-level listener.
|
|
209
208
|
const contentRef = useRef(null);
|
|
210
209
|
// A host theme with larger controls, or a narrow panel: the toolbar drops the
|
|
211
210
|
// Download label, the previous/next pair (the arrow keys still step), the
|
|
@@ -12,7 +12,7 @@ import { getFileCategory, getLanguageFromExt } from './preview-policy.js';
|
|
|
12
12
|
import { usePreviewFit } from './preview-fit.js';
|
|
13
13
|
import { useContentRevision } from './use-content-revision.js';
|
|
14
14
|
/** Categories that need a blob fetched via readFileAsBlob */
|
|
15
|
-
const BLOB_CATEGORIES = ['docx', 'video', 'audio', 'pptx', 'zip'];
|
|
15
|
+
const BLOB_CATEGORIES = ['docx', 'video', 'audio', 'pptx', 'zip', 'xlsx'];
|
|
16
16
|
function isImageMime(mimeType) {
|
|
17
17
|
return !!mimeType && mimeType.startsWith('image/');
|
|
18
18
|
}
|
|
@@ -66,9 +66,10 @@ export function useFileContentState({ filePath, onUnsavedChange, onSaved, readOn
|
|
|
66
66
|
const sharedImageSha = useFileCaption(filePath)?.sha256;
|
|
67
67
|
const sharedImage = (source.useSharedImage ?? noSharedImage)(sharedImagePath, sharedImageSha);
|
|
68
68
|
const { data: fileContent, isLoading, error, refetch, dataUpdatedAt, } = useFileContent(isHeicImage || isZipArchive || sharedImagePath ? null : filePath);
|
|
69
|
-
// The agent's turn end refetches this file. The
|
|
70
|
-
//
|
|
71
|
-
//
|
|
69
|
+
// The agent's turn end refetches this file. The sqlite renderer still
|
|
70
|
+
// reads its own bytes, and the xlsx renderer re-parses the blob its parent
|
|
71
|
+
// passes, so both remount only when the content really changed
|
|
72
|
+
// (structural sharing keeps the reference otherwise). The HTML frame
|
|
72
73
|
// reloads on every refetch: its stylesheets can change while its markup
|
|
73
74
|
// does not. Neither moves on the first load.
|
|
74
75
|
const contentRevision = useContentRevision(fileContent);
|
|
@@ -129,12 +130,12 @@ export function useFileContentState({ filePath, onUnsavedChange, onSaved, readOn
|
|
|
129
130
|
const fileDiagnostics = useMemo(() => findDiagnosticsForFile(diagByFile, filePath), [diagByFile, filePath]);
|
|
130
131
|
const fileDiagErrorCount = useMemo(() => fileDiagnostics?.filter((d) => d.severity === 1).length ?? 0, [fileDiagnostics]);
|
|
131
132
|
const fileDiagWarningCount = useMemo(() => fileDiagnostics?.filter((d) => d.severity === 2).length ?? 0, [fileDiagnostics]);
|
|
132
|
-
// Binary blob for DOCX, video, audio, PPTX — AND HEIC images.
|
|
133
|
+
// Binary blob for DOCX, video, audio, PPTX, XLSX — AND HEIC images.
|
|
133
134
|
// PDFs intentionally use /file/content base64 so PdfRenderer can create a Blob URL from the string.
|
|
134
|
-
// A bytes-only source (the project's Files) also serves the
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
const readsOwnBytes = fileCategory === '
|
|
135
|
+
// A bytes-only source (the project's Files) also serves the SQLite bytes:
|
|
136
|
+
// that renderer would otherwise read a sandbox path, and there is no
|
|
137
|
+
// sandbox behind Files.
|
|
138
|
+
const readsOwnBytes = fileCategory === 'sqlite';
|
|
138
139
|
const blobPath = isBlobCategory(fileCategory) || isHeicImage || (source.bytesOnly && readsOwnBytes) ? filePath : null;
|
|
139
140
|
const { blobUrl, blob: rawBlob, isLoading: binaryLoading, error: binaryError, } = useBinaryBlob(blobPath);
|
|
140
141
|
const blobLoading = sharedImagePath ? sharedImage.loading : binaryLoading;
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -98,6 +98,14 @@ declare const catalog: {
|
|
|
98
98
|
access: string;
|
|
99
99
|
actions: string;
|
|
100
100
|
coolingDown: string;
|
|
101
|
+
keyVerified: string;
|
|
102
|
+
keyInvalid: string;
|
|
103
|
+
keyUnchecked: string;
|
|
104
|
+
checkKey: string;
|
|
105
|
+
savedVerified: string;
|
|
106
|
+
savedInvalid: string;
|
|
107
|
+
checkError: string;
|
|
108
|
+
openProviderInModels: string;
|
|
101
109
|
member: string;
|
|
102
110
|
members: string;
|
|
103
111
|
actionsFor: string;
|
|
@@ -139,6 +147,9 @@ declare const catalog: {
|
|
|
139
147
|
providerKeys: string;
|
|
140
148
|
chooseSharedKeys: string;
|
|
141
149
|
sessionKeyPool: string;
|
|
150
|
+
subscriptionSwitcher: string;
|
|
151
|
+
subscriptionSwitcherDefault: string;
|
|
152
|
+
subscriptionSwitcherUse: string;
|
|
142
153
|
sharedSessionKeys: string;
|
|
143
154
|
promptedSessionKeys: string;
|
|
144
155
|
noPersonSessionKeys: string;
|
|
@@ -167,6 +178,9 @@ declare const catalog: {
|
|
|
167
178
|
claudeReconnectDescription: string;
|
|
168
179
|
claudeAccountLabelPlaceholder: string;
|
|
169
180
|
claudeDeleteAccountConfirmTitle: string;
|
|
181
|
+
sharedOnlyYouDescription: string;
|
|
182
|
+
oauthOnlyYouDescription: string;
|
|
183
|
+
claudeOauthOnlyYouDescription: string;
|
|
170
184
|
};
|
|
171
185
|
secrets: {
|
|
172
186
|
undecryptable: {
|
|
@@ -1485,6 +1499,10 @@ declare const catalog: {
|
|
|
1485
1499
|
connectModel: string;
|
|
1486
1500
|
imagesUnsupported: string;
|
|
1487
1501
|
imagesUnsupportedHint: string;
|
|
1502
|
+
noModelUpgradeReason: string;
|
|
1503
|
+
noModelKeyReason: string;
|
|
1504
|
+
noModelUpgradePlan: string;
|
|
1505
|
+
noModelAddProviderKey: string;
|
|
1488
1506
|
};
|
|
1489
1507
|
providerRecovery: {
|
|
1490
1508
|
savedPrompt: string;
|
|
@@ -2690,6 +2708,8 @@ declare const catalog: {
|
|
|
2690
2708
|
checkConnection: string;
|
|
2691
2709
|
};
|
|
2692
2710
|
i18nComplete: {
|
|
2711
|
+
noModelAddProviderKey: string;
|
|
2712
|
+
noModelUpgradePlan: string;
|
|
2693
2713
|
text03217276a5f1: string;
|
|
2694
2714
|
text0b6a47661327: string;
|
|
2695
2715
|
text1a9030082a20: string;
|
|
@@ -6831,6 +6851,12 @@ declare const catalog: {
|
|
|
6831
6851
|
noticeSignInTitle: string;
|
|
6832
6852
|
noticeSignInBody: string;
|
|
6833
6853
|
noticeSignInAction: string;
|
|
6854
|
+
noticeSignInAgainTitle: string;
|
|
6855
|
+
noticeSignInAgainBody: string;
|
|
6856
|
+
noticeNoToolsTitle: string;
|
|
6857
|
+
noticeNoToolsBody: string;
|
|
6858
|
+
noticeAddRoutesAction: string;
|
|
6859
|
+
statusNoTools: string;
|
|
6834
6860
|
connectAccount: string;
|
|
6835
6861
|
notSignedIn: string;
|
|
6836
6862
|
credentialRejected: string;
|
|
@@ -7848,6 +7874,12 @@ declare const catalog: {
|
|
|
7848
7874
|
triggerAutoPause: {
|
|
7849
7875
|
title: string;
|
|
7850
7876
|
description: string;
|
|
7877
|
+
billingTitle: string;
|
|
7878
|
+
billingDescription: string;
|
|
7879
|
+
modelTitle: string;
|
|
7880
|
+
modelDescription: string;
|
|
7881
|
+
listBilling: string;
|
|
7882
|
+
listModel: string;
|
|
7851
7883
|
};
|
|
7852
7884
|
featureGate: {
|
|
7853
7885
|
enable: string;
|
|
@@ -10080,5 +10112,24 @@ declare const catalog: {
|
|
|
10080
10112
|
capWorkspace: string;
|
|
10081
10113
|
capMember: string;
|
|
10082
10114
|
};
|
|
10115
|
+
connectSignIn: {
|
|
10116
|
+
openSignIn: string;
|
|
10117
|
+
checkingTitle: string;
|
|
10118
|
+
checkingDescription: string;
|
|
10119
|
+
signInUnfinished: string;
|
|
10120
|
+
finishSignIn: string;
|
|
10121
|
+
signInFinished: string;
|
|
10122
|
+
cardHeadline: string;
|
|
10123
|
+
cardTitle: string;
|
|
10124
|
+
cardShared: string;
|
|
10125
|
+
cardPrivate: string;
|
|
10126
|
+
signingIn: string;
|
|
10127
|
+
connectedAs: string;
|
|
10128
|
+
connected: string;
|
|
10129
|
+
connect: string;
|
|
10130
|
+
cardFailed: string;
|
|
10131
|
+
blockedTitle: string;
|
|
10132
|
+
blockedDescription: string;
|
|
10133
|
+
};
|
|
10083
10134
|
};
|
|
10084
10135
|
export default catalog;
|
package/dist/i18n/en.js
CHANGED
|
@@ -52,7 +52,7 @@ const catalog = {
|
|
|
52
52
|
"oauthWaiting": "Waiting for authorization…",
|
|
53
53
|
"oauthFinishing": "Signed in. Saving your account…",
|
|
54
54
|
"oauthExpired": "Authorization timed out. Try again.",
|
|
55
|
-
"oauthPrivateDescription": "Use your ChatGPT Plus or Pro plan in this workspace. New accounts are
|
|
55
|
+
"oauthPrivateDescription": "Use your ChatGPT Plus or Pro plan in this workspace. New accounts are shared with every workspace member. You can make one private.",
|
|
56
56
|
"chatGptSubscription": "ChatGPT subscription",
|
|
57
57
|
"manageChatGptAccounts": "Manage ChatGPT accounts",
|
|
58
58
|
"connect": "Connect",
|
|
@@ -88,7 +88,7 @@ const catalog = {
|
|
|
88
88
|
"deleteError": "Secret could not be deleted",
|
|
89
89
|
"accessError": "Access could not be changed",
|
|
90
90
|
"sharedTitle": "Provider connections",
|
|
91
|
-
"sharedDescription": "Add API keys, ChatGPT accounts and Claude accounts. New ones are
|
|
91
|
+
"sharedDescription": "Add API keys, ChatGPT accounts and Claude accounts. New ones are shared with every workspace member. You can make one private. Choose which ones each session uses.",
|
|
92
92
|
"legacyProjectKey": "Existing workspace key · Used when this session has no key selection",
|
|
93
93
|
"keyCount": "{count, plural, one {# key} other {# keys}}",
|
|
94
94
|
"providerKeysFor": "{provider} API keys",
|
|
@@ -99,6 +99,14 @@ const catalog = {
|
|
|
99
99
|
"access": "Access",
|
|
100
100
|
"actions": "Actions",
|
|
101
101
|
"coolingDown": "Cooling down",
|
|
102
|
+
"keyVerified": "Verified: {provider} accepted this key",
|
|
103
|
+
"keyInvalid": "{provider} refused this key: {message}",
|
|
104
|
+
"keyUnchecked": "Not verified: {message}",
|
|
105
|
+
"checkKey": "Check again",
|
|
106
|
+
"savedVerified": "Key saved and verified",
|
|
107
|
+
"savedInvalid": "Key saved, but {provider} refused it: {message}",
|
|
108
|
+
"checkError": "The key could not be checked",
|
|
109
|
+
"openProviderInModels": "Open {provider} in Models",
|
|
102
110
|
"member": "member",
|
|
103
111
|
"members": "members",
|
|
104
112
|
"actionsFor": "Actions for {label}",
|
|
@@ -140,6 +148,9 @@ const catalog = {
|
|
|
140
148
|
"providerKeys": "Provider keys",
|
|
141
149
|
"chooseSharedKeys": "Choose the shared keys this session can use.",
|
|
142
150
|
"sessionKeyPool": "Session key pool",
|
|
151
|
+
"subscriptionSwitcher": "Subscription",
|
|
152
|
+
"subscriptionSwitcherDefault": "Rotates through every connected subscription",
|
|
153
|
+
"subscriptionSwitcherUse": "Use {label} for this session",
|
|
143
154
|
"sharedSessionKeys": "This session is shared with the workspace, so only keys shared with the whole workspace work here. Keys granted to you work in your private sessions.",
|
|
144
155
|
"promptedSessionKeys": "Another member has prompted this session, so it no longer acts for its owner. Only keys shared with the whole workspace work here.",
|
|
145
156
|
"noPersonSessionKeys": "This session does not act for a person: it started before personal keys existed, or unattended. Only keys shared with the whole workspace work here. Start a new session to use your own keys.",
|
|
@@ -159,7 +170,7 @@ const catalog = {
|
|
|
159
170
|
"claudeAccounts": "Claude accounts",
|
|
160
171
|
"noClaudeAccounts": "No Claude accounts yet",
|
|
161
172
|
"connectClaude": "Sign in with Claude",
|
|
162
|
-
"claudeOauthPrivateDescription": "Use your Claude Pro or Max plan for Claude models in this workspace. New accounts are
|
|
173
|
+
"claudeOauthPrivateDescription": "Use your Claude Pro or Max plan for Claude models in this workspace. New accounts are shared with every workspace member. You can make one private.",
|
|
163
174
|
"claudeOauthCreationDescription": "Sign in with your Claude Pro or Max account. Kortix stores the login encrypted and never shows it.",
|
|
164
175
|
"claudeDefaultAccountLabel": "Claude · {name}",
|
|
165
176
|
"claudeAccountConnected": "Claude account connected",
|
|
@@ -167,7 +178,10 @@ const catalog = {
|
|
|
167
178
|
"claudeConnectFailed": "The Claude sign-in did not finish. Try again.",
|
|
168
179
|
"claudeReconnectDescription": "Sign in with Claude again. The account keeps its name, access, and session selections.",
|
|
169
180
|
"claudeAccountLabelPlaceholder": "e.g. My Claude account",
|
|
170
|
-
"claudeDeleteAccountConfirmTitle": "Delete this Claude account for everyone?"
|
|
181
|
+
"claudeDeleteAccountConfirmTitle": "Delete this Claude account for everyone?",
|
|
182
|
+
"sharedOnlyYouDescription": "Add API keys, ChatGPT accounts and Claude accounts. Only you can use the ones you add. A workspace manager can share one. Choose which ones each session uses.",
|
|
183
|
+
"oauthOnlyYouDescription": "Use your ChatGPT Plus or Pro plan in this workspace. Only you can use the accounts you add.",
|
|
184
|
+
"claudeOauthOnlyYouDescription": "Use your Claude Pro or Max plan for Claude models in this workspace. Only you can use the accounts you add."
|
|
171
185
|
},
|
|
172
186
|
"secrets": {
|
|
173
187
|
"undecryptable": {
|
|
@@ -1485,7 +1499,11 @@ const catalog = {
|
|
|
1485
1499
|
"claudePlan": "Pro or Max plan",
|
|
1486
1500
|
"connectModel": "Connect model",
|
|
1487
1501
|
"imagesUnsupported": "{model} can’t read images",
|
|
1488
|
-
"imagesUnsupportedHint": "remove them or pick another model"
|
|
1502
|
+
"imagesUnsupportedHint": "remove them or pick another model",
|
|
1503
|
+
"noModelUpgradeReason": "No model: upgrade to the Credits plan or add your own provider key.",
|
|
1504
|
+
"noModelKeyReason": "No model: add your own provider key.",
|
|
1505
|
+
"noModelUpgradePlan": "Upgrade plan",
|
|
1506
|
+
"noModelAddProviderKey": "Add provider key"
|
|
1489
1507
|
},
|
|
1490
1508
|
"providerRecovery": {
|
|
1491
1509
|
"savedPrompt": "Saved prompt",
|
|
@@ -2691,6 +2709,8 @@ const catalog = {
|
|
|
2691
2709
|
"checkConnection": "Check your connection, then retry."
|
|
2692
2710
|
},
|
|
2693
2711
|
"i18nComplete": {
|
|
2712
|
+
"noModelAddProviderKey": "Add provider key",
|
|
2713
|
+
"noModelUpgradePlan": "Upgrade plan",
|
|
2694
2714
|
"text03217276a5f1": "Balance {value0} credits",
|
|
2695
2715
|
"text0b6a47661327": "Unknown owner",
|
|
2696
2716
|
"text1a9030082a20": "Create skill",
|
|
@@ -2705,7 +2725,7 @@ const catalog = {
|
|
|
2705
2725
|
"text0026c5053478": "Revert",
|
|
2706
2726
|
"text004bad6bfbd7": "Patched the retry to back off",
|
|
2707
2727
|
"text0059798b7f70": "(optional)",
|
|
2708
|
-
"text005b4c1dad87": "Search workspaces, accounts, owners",
|
|
2728
|
+
"text005b4c1dad87": "Search workspaces, accounts, owners or an ID",
|
|
2709
2729
|
"text005c9bcbce1e": "Creating trigger...",
|
|
2710
2730
|
"text008e94f6ea7c": "What you own",
|
|
2711
2731
|
"text009e910ccb18": "enterpriseAccordionTokenBody",
|
|
@@ -6832,6 +6852,12 @@ const catalog = {
|
|
|
6832
6852
|
"noticeSignInTitle": "Sign in to {name}",
|
|
6833
6853
|
"noticeSignInBody": "Kortix added {name}. Finish signing in so agents can use its tools.",
|
|
6834
6854
|
"noticeSignInAction": "Sign in",
|
|
6855
|
+
"noticeSignInAgainTitle": "Sign in to {name} again",
|
|
6856
|
+
"noticeSignInAgainBody": "Its sign-in expired or was revoked. Agents cannot use {name} until you sign in again.",
|
|
6857
|
+
"noticeNoToolsTitle": "{name} has no tools",
|
|
6858
|
+
"noticeNoToolsBody": "It has no routes, so agents have nothing to call. Add routes to its routes spec in Settings.",
|
|
6859
|
+
"noticeAddRoutesAction": "Add routes",
|
|
6860
|
+
"statusNoTools": "No tools",
|
|
6835
6861
|
"connectAccount": "Connect",
|
|
6836
6862
|
"notSignedIn": "Not signed in",
|
|
6837
6863
|
"credentialRejected": "Credential rejected: replace it",
|
|
@@ -7848,7 +7874,13 @@ const catalog = {
|
|
|
7848
7874
|
},
|
|
7849
7875
|
"triggerAutoPause": {
|
|
7850
7876
|
"title": "Paused automatically",
|
|
7851
|
-
"description": "It stopped starting runs for the reason below. Fix the cause, then resume it."
|
|
7877
|
+
"description": "It stopped starting runs for the reason below. Fix the cause, then resume it.",
|
|
7878
|
+
"billingTitle": "Paused: out of credits",
|
|
7879
|
+
"billingDescription": "No run can be paid for, so it stopped starting runs. It resumes by itself a few minutes after the wallet is topped up.",
|
|
7880
|
+
"modelTitle": "Paused: no model to run on",
|
|
7881
|
+
"modelDescription": "Automations use only model keys and accounts shared with the whole workspace, and none is usable. It resumes by itself a few minutes after you add one in Models.",
|
|
7882
|
+
"listBilling": "No credits",
|
|
7883
|
+
"listModel": "No model"
|
|
7852
7884
|
},
|
|
7853
7885
|
"featureGate": {
|
|
7854
7886
|
"enable": "Enable {name}",
|
|
@@ -10080,6 +10112,25 @@ const catalog = {
|
|
|
10080
10112
|
"gatewayBudgets": {
|
|
10081
10113
|
"capWorkspace": "Cap gateway spend for this workspace.",
|
|
10082
10114
|
"capMember": "Cap gateway spend for {who}."
|
|
10115
|
+
},
|
|
10116
|
+
"connectSignIn": {
|
|
10117
|
+
"openSignIn": "Open {app} sign-in",
|
|
10118
|
+
"checkingTitle": "Finishing sign-in",
|
|
10119
|
+
"checkingDescription": "Kortix checks your {app} sign-in. This page updates by itself.",
|
|
10120
|
+
"signInUnfinished": "Sign-in not finished",
|
|
10121
|
+
"finishSignIn": "Finish sign-in",
|
|
10122
|
+
"signInFinished": "Sign-in finished",
|
|
10123
|
+
"cardHeadline": "Your agent needs you to sign in",
|
|
10124
|
+
"cardTitle": "Connect {app}",
|
|
10125
|
+
"cardShared": "Shared with the workspace",
|
|
10126
|
+
"cardPrivate": "Only you",
|
|
10127
|
+
"signingIn": "Finish signing in to {app} in the window that opened.",
|
|
10128
|
+
"connectedAs": "Connected as {account}",
|
|
10129
|
+
"connected": "Connected",
|
|
10130
|
+
"connect": "Connect",
|
|
10131
|
+
"cardFailed": "Could not connect {app}. Try again.",
|
|
10132
|
+
"blockedTitle": "Open {app} to sign in",
|
|
10133
|
+
"blockedDescription": "Your browser blocked the sign-in window. Open it with the button below. This page updates by itself."
|
|
10083
10134
|
}
|
|
10084
10135
|
};
|
|
10085
10136
|
export default catalog;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @kortix/ui root barrel: light core primitives only (
|
|
1
|
+
// @kortix/ui root barrel: light core primitives only (Base UI, cva, motion).
|
|
2
2
|
// Heavy or app-shaped modules are reachable only through their own subpath,
|
|
3
3
|
// never from here: charts ('@kortix/ui/chart'), maps ('@kortix/ui/map'), grids
|
|
4
4
|
// ('@kortix/ui/data-grid'), mermaid, emoji data ('@kortix/ui/emoji-picker'),
|
|
@@ -113,8 +113,8 @@ export const HubLink = forwardRef(function HubLink({ to, onClick, onPointerEnter
|
|
|
113
113
|
return;
|
|
114
114
|
event.preventDefault();
|
|
115
115
|
// One frame later, not now. Many of these rows live inside a menu or
|
|
116
|
-
// another modal, and
|
|
117
|
-
// unmounts. Opening a focus-trapping dialog in the same tick lets that
|
|
116
|
+
// another modal, and a closing layer restores focus to its trigger as
|
|
117
|
+
// it unmounts. Opening a focus-trapping dialog in the same tick lets that
|
|
118
118
|
// restore land last and pull focus back OUT of the hub. A frame is
|
|
119
119
|
// imperceptible and puts the two in the right order.
|
|
120
120
|
requestAnimationFrame(() => openAccountPanel(to));
|
|
@@ -1,2 +1,29 @@
|
|
|
1
1
|
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The account member list, read once and shared by the hub page (the Members
|
|
4
|
+
* pane) and the settings sidebar (the count beside "Members"). One key, one
|
|
5
|
+
* fetcher, one gate — two hand-typed copies is how a "13 readers, one
|
|
6
|
+
* request" property quietly becomes two requests (see
|
|
7
|
+
* `packages/ui/src/internal/hooks/account/use-accounts-list.ts` for the longer version of that story).
|
|
8
|
+
*/
|
|
9
|
+
import type { AccountRole } from '@kortix/sdk';
|
|
10
|
+
import { listAccountMembers } from '@kortix/sdk';
|
|
11
|
+
import { type UseQueryResult } from '@tanstack/react-query';
|
|
12
|
+
/** Account-level standing of one member, keyed by user id. */
|
|
13
|
+
export interface AccountMemberMeta {
|
|
14
|
+
email: string | null;
|
|
15
|
+
accountRole: AccountRole;
|
|
16
|
+
isSuperAdmin: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function useAccountMembers(accountId: string | undefined,
|
|
19
|
+
/** Extra gate ANDed with the signed-in check — a surface that only needs
|
|
20
|
+
* the roster while a dialog is open passes `{ enabled: isOpen }`. */
|
|
21
|
+
options?: {
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
}): UseQueryResult<Awaited<ReturnType<typeof listAccountMembers>>, Error> & {
|
|
24
|
+
/** user_id → email. Members without an email are absent: the caller
|
|
25
|
+
* renders the raw user id (the fallback the IAM tables show). */
|
|
26
|
+
emailByUserId: Map<string, string>;
|
|
27
|
+
/** user_id → account-level standing (email, role, super-admin flag). */
|
|
28
|
+
accountMetaByUserId: Map<string, AccountMemberMeta>;
|
|
29
|
+
};
|