@jini-ai/ui 0.7.3-next.2 → 0.7.3-next.3
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 +3 -3
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/mount-renderer.d.ts +33 -0
- package/dist/browser/mount-renderer.js +14 -0
- package/dist/browser/useDismissibleDropdown.d.ts +50 -0
- package/dist/browser/useDismissibleDropdown.js +49 -0
- package/dist/core.d.ts +4 -4
- package/dist/core.js +4 -1
- package/dist/features/admin-widgets/components/InfoTip.js +5 -5
- package/dist/features/admin-widgets/components/InfoTip.rules.d.ts +1 -1
- package/dist/features/admin-widgets/components/InfoTip.rules.js +1 -1
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +3 -3
- package/dist/features/admin-widgets/components/Select/Select.js +7 -7
- package/dist/features/app-shell/SiteToast.d.ts +24 -0
- package/dist/features/app-shell/SiteToast.js +9 -0
- package/dist/features/app-shell/copyable-details.d.ts +12 -0
- package/dist/features/app-shell/copyable-details.js +17 -0
- package/dist/features/app-shell/expanded-mode.d.ts +76 -0
- package/dist/features/app-shell/expanded-mode.js +70 -0
- package/dist/features/app-shell/index.d.ts +8 -0
- package/dist/features/app-shell/index.js +8 -0
- package/dist/features/app-shell/use-delete-confirmation.hooks.d.ts +48 -0
- package/dist/features/app-shell/use-delete-confirmation.hooks.js +57 -0
- package/dist/features/app-shell/use-expanded-mode.hooks.d.ts +19 -0
- package/dist/features/app-shell/use-expanded-mode.hooks.js +39 -0
- package/dist/features/app-shell/use-site-toast.hooks.d.ts +56 -0
- package/dist/features/app-shell/use-site-toast.hooks.js +44 -0
- package/dist/features/app-shell/use-theme-preference.hooks.d.ts +30 -0
- package/dist/features/app-shell/use-theme-preference.hooks.js +42 -0
- package/dist/features/app-version/use-app-version.d.ts +53 -0
- package/dist/features/app-version/use-app-version.js +42 -0
- package/dist/features/asset-grid/react/components/AssetGrid.d.ts +1 -1
- package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
- package/dist/features/asset-grid/react/components/DeleteConfirmDialog.d.ts +1 -1
- package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
- package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.d.ts +2 -2
- package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.js +1 -1
- package/dist/features/asset-tree-browser/react/components/FilePreviewPane.d.ts +1 -1
- package/dist/features/browser-chrome/react/components/BrowserViewportControls.d.ts +1 -1
- package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
- package/dist/features/charts/table.js +4 -4
- package/dist/features/command-palette/index.d.ts +1 -0
- package/dist/features/command-palette/index.js +1 -0
- package/dist/features/command-palette/react/components/CommandPalette.d.ts +9 -9
- package/dist/features/command-palette/react/components/CommandPalette.hooks.js +28 -1
- package/dist/features/command-palette/react/components/CommandPalette.js +3 -5
- package/dist/features/connectors/ConnectorsBrowser.d.ts +1 -1
- package/dist/features/connectors/ConnectorsBrowser.js +2 -2
- package/dist/features/connectors/components/ConnectorCard.hooks.js +2 -2
- package/dist/features/connectors/components/ConnectorCard.js +4 -4
- package/dist/features/connectors/components/ConnectorDetailDrawer.d.ts +1 -1
- package/dist/features/connectors/components/ConnectorDetailDrawer.js +7 -7
- package/dist/features/connectors/components/ConnectorGrid.js +1 -1
- package/dist/features/connectors/components/ConnectorLogo.js +1 -1
- package/dist/features/connectors/components/ConnectorSearchBar.js +1 -1
- package/dist/features/connectors/components/ProviderTabBar.js +1 -1
- package/dist/features/execution/claude/env-fields.d.ts +1 -1
- package/dist/features/execution/codex/env-fields.d.ts +1 -1
- package/dist/features/execution/constants.d.ts +2 -2
- package/dist/features/execution/constants.js +1 -1
- package/dist/features/execution/dependencies.d.ts +2 -3
- package/dist/features/execution/http-adapter.d.ts +2 -3
- package/dist/features/execution/index.d.ts +0 -2
- package/dist/features/execution/react/components/AgentCliEnvFields.d.ts +1 -1
- package/dist/features/execution/react/components/AgentDiagnosticRow.d.ts +1 -1
- package/dist/features/execution/react/components/AgentDiagnosticRow.js +3 -1
- package/dist/features/execution/react/components/ByokProviderForm.d.ts +10 -2
- package/dist/features/execution/react/components/ByokProviderForm.hooks.d.ts +2 -2
- package/dist/features/execution/react/components/ByokProviderForm.js +15 -4
- package/dist/features/execution/react/components/ExecutionTab.d.ts +2 -3
- package/dist/features/execution/react/components/ExecutionTab.hooks.d.ts +14 -4
- package/dist/features/execution/react/components/ExecutionTab.hooks.js +66 -9
- package/dist/features/execution/react/components/ExecutionTab.js +27 -10
- package/dist/features/execution/react/components/LocalCliAgentCard.d.ts +4 -4
- package/dist/features/execution/react/components/LocalCliAgentList.d.ts +4 -4
- package/dist/features/execution/react/components/LocalCliAgentList.hooks.d.ts +3 -3
- package/dist/features/execution/react/components/LocalCliAgentSettings.d.ts +2 -2
- package/dist/features/execution/react/components/ProviderChipGroup.d.ts +1 -1
- package/dist/features/execution/react/components/SearchableModelSelect.d.ts +1 -1
- package/dist/features/execution/react/hooks/use-byok-field-validation.hooks.d.ts +2 -2
- package/dist/features/execution/react/hooks/use-execution-credential.hooks.d.ts +1 -1
- package/dist/features/execution/react/hooks/useExecutionTab.d.ts +2 -3
- package/dist/features/execution/react/hooks/useLocalCliAgentCard.d.ts +4 -4
- package/dist/features/execution/react/hooks/useLocalCliAgentList.d.ts +4 -4
- package/dist/features/execution/react/hooks/useReasoningControl.d.ts +3 -3
- package/dist/features/execution/rules.d.ts +6 -6
- package/dist/features/execution/rules.js +1 -1
- package/dist/features/external-mcp/react/components/ExternalMcpTab.js +4 -4
- package/dist/features/file-dropzone/react/components/FileDropzone.d.ts +1 -1
- package/dist/features/file-dropzone/react/components/FileDropzone.js +1 -1
- package/dist/features/find/find-bar-state.d.ts +58 -0
- package/dist/features/find/find-bar-state.js +45 -0
- package/dist/features/find/find-focus-clock.d.ts +19 -0
- package/dist/features/find/find-focus-clock.js +9 -0
- package/dist/features/find/find-input-focus.d.ts +88 -0
- package/dist/features/find/find-input-focus.js +88 -0
- package/dist/features/find/find-target.d.ts +141 -0
- package/dist/features/find/find-target.js +160 -0
- package/dist/features/find/index.d.ts +10 -0
- package/dist/features/find/index.js +10 -0
- package/dist/features/find/use-find-bar-effects.hooks.d.ts +14 -0
- package/dist/features/find/use-find-bar-effects.hooks.js +92 -0
- package/dist/features/find/use-find-bar-state.hooks.d.ts +43 -0
- package/dist/features/find/use-find-bar-state.hooks.js +49 -0
- package/dist/features/find/use-find-focus-reclaim.hooks.d.ts +21 -0
- package/dist/features/find/use-find-focus-reclaim.hooks.js +64 -0
- package/dist/features/find/use-find-input-binding.hooks.d.ts +18 -0
- package/dist/features/find/use-find-input-binding.hooks.js +76 -0
- package/dist/features/find-bar/FindBar.d.ts +41 -0
- package/dist/features/find-bar/FindBar.js +31 -0
- package/dist/features/find-bar/index.d.ts +2 -0
- package/dist/features/find-bar/index.js +2 -0
- package/dist/features/folder-path-drop/index.d.ts +3 -1
- package/dist/features/folder-path-drop/index.js +1 -0
- package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.d.ts +50 -0
- package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.js +50 -0
- package/dist/features/folder-path-drop/types.d.ts +14 -0
- package/dist/features/i18n/context.d.ts +1 -1
- package/dist/features/i18n/context.js +1 -1
- package/dist/features/iframe-pool/react/dom-sync.d.ts +13 -3
- package/dist/features/iframe-pool/react/dom-sync.js +7 -7
- package/dist/features/import-handoff/use-import-handoff.d.ts +38 -0
- package/dist/features/import-handoff/use-import-handoff.js +40 -0
- package/dist/features/integrations/rules.js +39 -41
- package/dist/features/interactive-ui/interactive-ui.css +1 -1
- package/dist/features/interactive-ui/providers/native/data-table.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/data-table.js +3 -3
- package/dist/features/interactive-ui/providers/shadcn/radio-group-field.js +1 -1
- package/dist/features/live-views/index.d.ts +6 -0
- package/dist/features/live-views/index.js +6 -0
- package/dist/features/live-views/use-live-views.d.ts +31 -0
- package/dist/features/live-views/use-live-views.js +88 -0
- package/dist/features/live-views/use-site-view-preference.d.ts +33 -0
- package/dist/features/live-views/use-site-view-preference.js +32 -0
- package/dist/features/live-views/use-webview-load-failure.d.ts +90 -0
- package/dist/features/live-views/use-webview-load-failure.js +122 -0
- package/dist/features/mcp-ui/credential-card.d.ts +1 -0
- package/dist/features/mcp-ui/credential-card.js +1 -1
- package/dist/features/mcp-ui/surfaces/tool-approval.d.ts +10 -0
- package/dist/features/mcp-ui/surfaces/tool-approval.js +15 -0
- package/dist/features/media-providers/dependencies.d.ts +7 -1
- package/dist/features/media-providers/dependencies.js +43 -0
- package/dist/features/media-providers/index.d.ts +2 -2
- package/dist/features/media-providers/index.js +1 -1
- package/dist/features/media-providers/ports.d.ts +39 -5
- package/dist/features/media-providers/react/components/MediaProvidersTab.d.ts +4 -3
- package/dist/features/media-providers/react/components/MediaProvidersTab.js +1 -1
- package/dist/features/media-providers/react/hooks/useMediaProvidersTab.d.ts +3 -2
- package/dist/features/media-providers/react/hooks/useMediaProvidersTab.js +41 -3
- package/dist/features/memory/react/components/MemoryConnectedPanel.js +2 -2
- package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
- package/dist/features/memory/react/components/MemoryHooksPanel.js +2 -2
- package/dist/features/memory/react/components/MemoryList.js +2 -2
- package/dist/features/memory/react/components/MemorySettingsPanel.js +2 -2
- package/dist/features/memory/react/components/MemorySuggestionPanel.js +1 -1
- package/dist/features/memory/react/hooks/useMemoryConnectors.hooks.js +3 -3
- package/dist/features/memory/react/hooks/useMemoryConnectors.rules.d.ts +4 -1
- package/dist/features/memory/react/hooks/useMemoryConnectors.rules.js +1 -1
- package/dist/features/memory/react/render-markdown.js +1 -1
- package/dist/features/nav-availability/nav-availability.d.ts +18 -0
- package/dist/features/nav-availability/nav-availability.js +12 -0
- package/dist/features/number-stepper/NumberStepper.d.ts +39 -0
- package/dist/features/number-stepper/NumberStepper.js +16 -0
- package/dist/features/number-stepper/index.d.ts +5 -0
- package/dist/features/number-stepper/index.js +5 -0
- package/dist/features/number-stepper/number-stepper.d.ts +34 -0
- package/dist/features/number-stepper/number-stepper.js +32 -0
- package/dist/features/number-stepper/use-number-stepper.hooks.d.ts +20 -0
- package/dist/features/number-stepper/use-number-stepper.hooks.js +29 -0
- package/dist/features/number-stepper/use-optimistic-number-setting.hooks.d.ts +36 -0
- package/dist/features/number-stepper/use-optimistic-number-setting.hooks.js +25 -0
- package/dist/features/panel-kit/ErrorNotice.js +8 -1
- package/dist/features/panel-kit/helpers/standing-draft-local-backup.d.ts +1 -1
- package/dist/features/panel-kit/helpers/standing-draft-recovery-message.d.ts +1 -1
- package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.d.ts +1 -37
- package/dist/features/panel-kit/hooks/use-standing-draft-recovery.hooks.d.ts +2 -1
- package/dist/features/panel-kit/hooks/use-standing-draft-state.hooks.d.ts +2 -1
- package/dist/features/panel-kit/hooks/use-standing-draft-writes.hooks.d.ts +2 -1
- package/dist/features/panel-kit/index.d.ts +2 -1
- package/dist/features/privacy/react/components/PrivacyTab.d.ts +1 -1
- package/dist/features/privacy/react/components/PrivacyTab.js +1 -1
- package/dist/features/progress-card/components/ProgressCard.d.ts +1 -1
- package/dist/features/progress-card/components/ProgressCard.js +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceBoard.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.js +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceCardParts.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceCardParts.js +7 -2
- package/dist/features/resource-dashboard/react/components/ResourceRowListView.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceRowListView.js +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.js +1 -1
- package/dist/features/resource-dashboard/react/components/StatusPill.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/StatusPill.js +1 -1
- package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +6 -1
- package/dist/features/resource-monitor/ResourceTable.d.ts +67 -0
- package/dist/features/resource-monitor/ResourceTable.js +25 -0
- package/dist/features/resource-monitor/index.d.ts +4 -0
- package/dist/features/resource-monitor/index.js +4 -0
- package/dist/features/resource-monitor/resource-stop.d.ts +16 -0
- package/dist/features/resource-monitor/resource-stop.js +11 -0
- package/dist/features/resource-monitor/use-resource-readings.hooks.d.ts +44 -0
- package/dist/features/resource-monitor/use-resource-readings.hooks.js +91 -0
- package/dist/features/settings/dialog/styles/settings-dialog.css +251 -251
- package/dist/features/site-card/index.d.ts +4 -1
- package/dist/features/site-card/index.js +3 -0
- package/dist/features/site-card/use-created-site-return.hooks.d.ts +36 -0
- package/dist/features/site-card/use-created-site-return.hooks.js +43 -0
- package/dist/features/site-card/use-site-card-preview.hooks.d.ts +39 -0
- package/dist/features/site-card/use-site-card-preview.hooks.js +31 -0
- package/dist/features/site-card/use-site-list-prefs.hooks.d.ts +29 -8
- package/dist/features/site-card/use-site-list-prefs.hooks.js +56 -9
- package/dist/features/site-card/use-site-preview.hooks.d.ts +67 -0
- package/dist/features/site-card/use-site-preview.hooks.js +94 -0
- package/dist/features/sketch-editor/react/components/SketchEditor.d.ts +2 -2
- package/dist/features/sketch-editor/react/components/SketchEditor.js +1 -1
- package/dist/features/skills/react/components/SkillRow.js +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigAddForm.js +2 -2
- package/dist/features/source-config-list/react/components/SourceConfigField.js +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigItemCard.js +5 -5
- package/dist/features/source-config-list/react/components/SourceConfigList.d.ts +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigList.js +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigListView.js +3 -3
- package/dist/features/source-config-list/react/components/SourceConfigTestControl.d.ts +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigTestControl.js +1 -1
- package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.d.ts +1 -1
- package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.js +1 -1
- package/dist/features/tab-strip/react/components/TabBar.js +2 -2
- package/dist/features/tab-strip/react/components/TabStrip.d.ts +1 -1
- package/dist/features/tab-strip/react/components/TabStrip.js +1 -1
- package/dist/features/tab-strip/scrollable.js +0 -2
- package/dist/features/tabbed-dialog/react/components/TabbedDialog.d.ts +1 -1
- package/dist/features/tabbed-dialog/react/components/TabbedDialog.js +1 -1
- package/dist/features/version-manager/react/components/VersionManagerModal.d.ts +1 -1
- package/dist/features/version-manager/react/components/VersionManagerModal.js +1 -1
- package/dist/features/viewer-shell/react/components/CommentSidePanel.d.ts +2 -2
- package/dist/features/viewer-shell/react/components/CommentSidePanel.js +1 -1
- package/dist/features/viewer-shell/react/components/MarkdownSplitPane.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/MarkdownSplitPane.js +1 -1
- package/dist/features/viewer-shell/react/components/SegmentedToggle.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/SegmentedToggle.js +1 -1
- package/dist/features/viewer-shell/react/components/ViewportSwitcher.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
- package/dist/features/viewer-shell/react/components/ViewportToggleGroup.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/ViewportToggleGroup.js +1 -1
- package/dist/features/zoom/use-zoom.d.ts +141 -0
- package/dist/features/zoom/use-zoom.js +204 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/react/components/ComponentKitPreview.d.ts +1 -1
- package/dist/react/components/ComponentKitPreview.js +1 -1
- package/dist/react/components/CustomSelect.js +1 -1
- package/dist/react/components/ExportDiagnosticsButton.d.ts +6 -2
- package/dist/react/components/ExportDiagnosticsButton.js +3 -3
- package/dist/react/components/FileImportPanel.js +1 -1
- package/dist/react/components/IconFrame.d.ts +15 -0
- package/dist/react/components/IconFrame.js +11 -0
- package/dist/react/components/ImportChoice.js +1 -1
- package/dist/react/components/Notice.js +1 -1
- package/dist/react/components/OnboardingDropdown.js +1 -1
- package/dist/react/components/PaletteTweaks.js +1 -1
- package/dist/react/components/TooltipLayer.d.ts +13 -3
- package/dist/react/components/TooltipLayer.js +12 -12
- package/dist/react/mcp-ui/host-message-source.d.ts +3 -1
- package/dist/react/mcp-ui/host-message-source.js +1 -1
- package/dist/react/testing.js +3 -1
- package/dist/renderers/annotation-canvas/rules.js +30 -27
- package/dist/renderers/react/components/ArtifactView.js +1 -1
- package/dist/renderers/renderers/markdown.d.ts +3 -1
- package/dist/renderers/renderers/markdown.js +2 -2
- package/dist/styles/admin.css +54 -54
- package/dist/utils/zip.js +43 -36
- package/package.json +66 -9
- package/dist/features/execution/ports.d.ts +0 -71
- package/dist/features/execution/ports.js +0 -2
- package/dist/features/execution/types.d.ts +0 -472
- package/dist/features/execution/types.js +0 -2
- package/dist/react/components/CustomSelectMarkup.d.ts +0 -27
- package/dist/react/components/CustomSelectMarkup.js +0 -35
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** The slice of `document` {@link useDeleteConfirmation} listens on for Escape. */
|
|
2
|
+
export type EscapeTarget = Pick<Document, 'addEventListener' | 'removeEventListener'>;
|
|
3
|
+
/** Host display policy: the line shown under a card whose delete failed. */
|
|
4
|
+
export type DescribeDeleteError = (input: {
|
|
5
|
+
error: unknown;
|
|
6
|
+
}) => string;
|
|
7
|
+
export interface DeleteConfirmationState {
|
|
8
|
+
pendingId: string | null;
|
|
9
|
+
deletingId: string | null;
|
|
10
|
+
deleteError: string | null;
|
|
11
|
+
requestDelete: (input: {
|
|
12
|
+
id: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
cancelDelete: () => void;
|
|
15
|
+
confirmDelete: (input: {
|
|
16
|
+
id: string;
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Escape dismisses — but not mid-IME-composition (that Escape belongs to the input method), and
|
|
21
|
+
* not while the delete is already running (the card must stay until the outcome is known).
|
|
22
|
+
*/
|
|
23
|
+
export declare function dismissOnEscape({ event, dismiss, busy }: {
|
|
24
|
+
event: {
|
|
25
|
+
key: string;
|
|
26
|
+
isComposing?: boolean;
|
|
27
|
+
};
|
|
28
|
+
dismiss: () => void;
|
|
29
|
+
busy?: boolean;
|
|
30
|
+
}, _optional?: {}): void;
|
|
31
|
+
/**
|
|
32
|
+
* Which card (if any) is asking to be confirmed, which one is mid-delete, and the error from the
|
|
33
|
+
* last failed attempt.
|
|
34
|
+
*
|
|
35
|
+
* Confirmation lives on the card rather than in a `window.confirm`: a native modal dialog blocks
|
|
36
|
+
* the whole renderer, and in Electron that also freezes the IPC this window answers on.
|
|
37
|
+
*
|
|
38
|
+
* @param input.onDelete the host's delete action; a rejection keeps the card pending for a retry.
|
|
39
|
+
* @param input.describeError the host's copy for a failed delete (its own fallback included).
|
|
40
|
+
* @param options.doc where the Escape listener goes while a card is pending; `document` by default.
|
|
41
|
+
*/
|
|
42
|
+
export declare function useDeleteConfirmation({ onDelete, describeError }: {
|
|
43
|
+
onDelete: (id: string) => Promise<void>;
|
|
44
|
+
describeError: DescribeDeleteError;
|
|
45
|
+
}, { doc }?: {
|
|
46
|
+
doc?: EscapeTarget;
|
|
47
|
+
}): DeleteConfirmationState;
|
|
48
|
+
//# sourceMappingURL=use-delete-confirmation.hooks.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A card grid's delete-confirm flow. The delete action and the failure copy are the host's
|
|
3
|
+
* (injected); the document its Escape listener goes on is an injected port defaulting to `document`.
|
|
4
|
+
*/
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
/**
|
|
7
|
+
* Escape dismisses — but not mid-IME-composition (that Escape belongs to the input method), and
|
|
8
|
+
* not while the delete is already running (the card must stay until the outcome is known).
|
|
9
|
+
*/
|
|
10
|
+
export function dismissOnEscape({ event, dismiss, busy = false }, _optional = {}) {
|
|
11
|
+
if (event.key === 'Escape' && !event.isComposing && !busy)
|
|
12
|
+
dismiss();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Which card (if any) is asking to be confirmed, which one is mid-delete, and the error from the
|
|
16
|
+
* last failed attempt.
|
|
17
|
+
*
|
|
18
|
+
* Confirmation lives on the card rather than in a `window.confirm`: a native modal dialog blocks
|
|
19
|
+
* the whole renderer, and in Electron that also freezes the IPC this window answers on.
|
|
20
|
+
*
|
|
21
|
+
* @param input.onDelete the host's delete action; a rejection keeps the card pending for a retry.
|
|
22
|
+
* @param input.describeError the host's copy for a failed delete (its own fallback included).
|
|
23
|
+
* @param options.doc where the Escape listener goes while a card is pending; `document` by default.
|
|
24
|
+
*/
|
|
25
|
+
export function useDeleteConfirmation({ onDelete, describeError }, { doc = document } = {}) {
|
|
26
|
+
const [pendingId, setPendingId] = useState(null);
|
|
27
|
+
const [deletingId, setDeletingId] = useState(null);
|
|
28
|
+
const [deleteError, setDeleteError] = useState(null);
|
|
29
|
+
const requestDelete = ({ id }, _options = {}) => {
|
|
30
|
+
setDeleteError(null);
|
|
31
|
+
setPendingId(id);
|
|
32
|
+
};
|
|
33
|
+
const cancelDelete = () => setPendingId(null);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!pendingId)
|
|
36
|
+
return undefined;
|
|
37
|
+
const onEscape = (event) => dismissOnEscape({ event, dismiss: cancelDelete, busy: deletingId !== null });
|
|
38
|
+
doc.addEventListener('keydown', onEscape, true);
|
|
39
|
+
return () => doc.removeEventListener('keydown', onEscape, true);
|
|
40
|
+
}, [pendingId, deletingId, doc]);
|
|
41
|
+
const confirmDelete = async ({ id }, _options = {}) => {
|
|
42
|
+
setDeletingId(id);
|
|
43
|
+
setDeleteError(null);
|
|
44
|
+
try {
|
|
45
|
+
await onDelete(id);
|
|
46
|
+
setPendingId(null);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
setDeleteError(describeError({ error: err }));
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
setDeletingId(null);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return { pendingId, deletingId, deleteError, requestDelete, cancelDelete, confirmDelete };
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=use-delete-confirmation.hooks.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The slice of `window` {@link useExpandedMode} listens on for Escape. */
|
|
2
|
+
export type KeydownTarget = Pick<Window, 'addEventListener' | 'removeEventListener'>;
|
|
3
|
+
/**
|
|
4
|
+
* Immersive mode: the active project's admin takes the whole window and the host's own chrome (top
|
|
5
|
+
* nav, tab strip, fleet chat) gets out of the way. Owns both the state and the two rules that keep
|
|
6
|
+
* it honest — it must never outlive the workspace it is immersing, and Escape must collapse it.
|
|
7
|
+
*
|
|
8
|
+
* @param input.showSiteTab whether a project's workspace is on screen (the host's view flag).
|
|
9
|
+
* @param options.target where Escape is listened for; `window` unless the host supplies its own.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useExpandedMode({ showSiteTab }: {
|
|
12
|
+
showSiteTab: boolean;
|
|
13
|
+
}, { target }?: {
|
|
14
|
+
target?: KeydownTarget;
|
|
15
|
+
}): {
|
|
16
|
+
expanded: boolean;
|
|
17
|
+
toggleExpanded: () => void;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=use-expanded-mode.hooks.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Immersive mode's state. The window it listens on is an injected port defaulting to `window`.
|
|
3
|
+
*/
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { expandedAfterKeyDown, expandedAfterWorkspaceChange, nextExpanded } from './expanded-mode.js';
|
|
6
|
+
/**
|
|
7
|
+
* Immersive mode: the active project's admin takes the whole window and the host's own chrome (top
|
|
8
|
+
* nav, tab strip, fleet chat) gets out of the way. Owns both the state and the two rules that keep
|
|
9
|
+
* it honest — it must never outlive the workspace it is immersing, and Escape must collapse it.
|
|
10
|
+
*
|
|
11
|
+
* @param input.showSiteTab whether a project's workspace is on screen (the host's view flag).
|
|
12
|
+
* @param options.target where Escape is listened for; `window` unless the host supplies its own.
|
|
13
|
+
*/
|
|
14
|
+
export function useExpandedMode({ showSiteTab }, { target = window } = {}) {
|
|
15
|
+
const [expanded, setExpanded] = useState(false);
|
|
16
|
+
// Expanded hides the only navigation there is, so it must never outlive the thing it was
|
|
17
|
+
// expanding. Closing the tab, deleting the project, or a host navigation call moving the nav
|
|
18
|
+
// would otherwise leave the chrome hidden with nothing to be immersed in and no way back.
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setExpanded((on) => expandedAfterWorkspaceChange({ expanded: on, showSiteTab }));
|
|
21
|
+
}, [showSiteTab]);
|
|
22
|
+
// Escape collapses. This listener only sees keys pressed in the host's own chrome — a <webview>
|
|
23
|
+
// is a separate browsing context and does not bubble its keydowns out to this document — so it
|
|
24
|
+
// is a convenience, never the only exit. The bar's collapse button is the one that always works.
|
|
25
|
+
// `expandedAfterKeyDown` returns the SAME value for every key that is not Escape, so the updater
|
|
26
|
+
// form costs nothing for the other keys: React bails out of the re-render when state is unchanged.
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!expanded)
|
|
29
|
+
return undefined;
|
|
30
|
+
const onKeyDown = (event) => {
|
|
31
|
+
setExpanded((on) => expandedAfterKeyDown({ expanded: on, key: event.key }));
|
|
32
|
+
};
|
|
33
|
+
target.addEventListener('keydown', onKeyDown);
|
|
34
|
+
return () => target.removeEventListener('keydown', onKeyDown);
|
|
35
|
+
}, [expanded, target]);
|
|
36
|
+
const toggleExpanded = () => setExpanded((expanded) => nextExpanded({ expanded }));
|
|
37
|
+
return { expanded, toggleExpanded };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=use-expanded-mode.hooks.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** `note` is one short line; `items` is the full list behind it, shown on request. */
|
|
2
|
+
export interface SiteToast {
|
|
3
|
+
message: string;
|
|
4
|
+
note?: string;
|
|
5
|
+
items?: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
/** The host's wording for each announcement. */
|
|
8
|
+
export interface SiteToastCopy {
|
|
9
|
+
created: (input: {
|
|
10
|
+
displayName: string;
|
|
11
|
+
}) => string;
|
|
12
|
+
added: (input: {
|
|
13
|
+
displayName: string;
|
|
14
|
+
}) => string;
|
|
15
|
+
/** The one-line note on an import that kept `count` (> 0) items off or set them aside. */
|
|
16
|
+
setAside: (input: {
|
|
17
|
+
count: number;
|
|
18
|
+
}) => string;
|
|
19
|
+
}
|
|
20
|
+
export declare const AUTO_HIDE_MS = 5000;
|
|
21
|
+
/** Long enough to read what was kept off or left out. */
|
|
22
|
+
export declare const AUTO_HIDE_WITH_NOTE_MS = 12000;
|
|
23
|
+
/** How long a toast stays: a note or a list gets at least {@link AUTO_HIDE_WITH_NOTE_MS}. */
|
|
24
|
+
export declare function toastLifetime({ toast, autoHideMs }: {
|
|
25
|
+
toast: SiteToast;
|
|
26
|
+
autoHideMs: number;
|
|
27
|
+
}, _optional?: {}): number;
|
|
28
|
+
/**
|
|
29
|
+
* @param required.lastCreated the host's latest created site (its create flow's result), so that
|
|
30
|
+
* path needs no call here.
|
|
31
|
+
* @param required.copy the host's wording; pass a stable (module-level) object.
|
|
32
|
+
* @returns the toast to show, `dismiss`, and the announcers for the two paths that do not go
|
|
33
|
+
* through the host's create flow.
|
|
34
|
+
* @complexity O(1) per toast: one state value and one timer.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useSiteToast({ lastCreated, copy }: {
|
|
37
|
+
lastCreated: {
|
|
38
|
+
displayName: string;
|
|
39
|
+
} | null;
|
|
40
|
+
copy: SiteToastCopy;
|
|
41
|
+
}, { autoHideMs }?: {
|
|
42
|
+
autoHideMs?: number;
|
|
43
|
+
}): {
|
|
44
|
+
toast: SiteToast | null;
|
|
45
|
+
dismiss: () => void;
|
|
46
|
+
announceImported: (site: {
|
|
47
|
+
displayName: string;
|
|
48
|
+
warnings: readonly string[];
|
|
49
|
+
}) => void;
|
|
50
|
+
announceAdded: (site: {
|
|
51
|
+
displayName: string;
|
|
52
|
+
alreadyTracked?: boolean;
|
|
53
|
+
}) => void;
|
|
54
|
+
showToast: import("react").Dispatch<import("react").SetStateAction<SiteToast | null>>;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=use-site-toast.hooks.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The "new site" toast: one at a time, and it outlives the page that made the site, because
|
|
3
|
+
* every path that makes one leaves that page. Every word it shows is the host's (injected `copy`).
|
|
4
|
+
*/
|
|
5
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
6
|
+
export const AUTO_HIDE_MS = 5000;
|
|
7
|
+
/** Long enough to read what was kept off or left out. */
|
|
8
|
+
export const AUTO_HIDE_WITH_NOTE_MS = 12000;
|
|
9
|
+
/** How long a toast stays: a note or a list gets at least {@link AUTO_HIDE_WITH_NOTE_MS}. */
|
|
10
|
+
export function toastLifetime({ toast, autoHideMs }, _optional = {}) {
|
|
11
|
+
return (toast.note || toast.items) ? Math.max(autoHideMs, AUTO_HIDE_WITH_NOTE_MS) : autoHideMs;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @param required.lastCreated the host's latest created site (its create flow's result), so that
|
|
15
|
+
* path needs no call here.
|
|
16
|
+
* @param required.copy the host's wording; pass a stable (module-level) object.
|
|
17
|
+
* @returns the toast to show, `dismiss`, and the announcers for the two paths that do not go
|
|
18
|
+
* through the host's create flow.
|
|
19
|
+
* @complexity O(1) per toast: one state value and one timer.
|
|
20
|
+
*/
|
|
21
|
+
export function useSiteToast({ lastCreated, copy }, { autoHideMs = AUTO_HIDE_MS } = {}) {
|
|
22
|
+
const [toast, setToast] = useState(null);
|
|
23
|
+
const dismiss = useCallback(() => setToast(null), []);
|
|
24
|
+
useEffect(() => { if (lastCreated)
|
|
25
|
+
setToast({ message: copy.created(lastCreated) }); }, [lastCreated, copy]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (toast === null)
|
|
28
|
+
return undefined;
|
|
29
|
+
const timer = setTimeout(() => setToast(null), toastLifetime({ toast, autoHideMs }));
|
|
30
|
+
return () => clearTimeout(timer);
|
|
31
|
+
}, [toast, autoHideMs]);
|
|
32
|
+
const announceImported = useCallback((site) => {
|
|
33
|
+
const count = site.warnings.length;
|
|
34
|
+
// Each notice stays whole in `items`; the toast itself only counts them.
|
|
35
|
+
setToast({ message: copy.created(site), ...(count > 0 ? { note: copy.setAside({ count }), items: site.warnings } : {}) });
|
|
36
|
+
}, [copy]);
|
|
37
|
+
/** A folder is added rather than made, and one already on the list has its own notice. */
|
|
38
|
+
const announceAdded = useCallback((site) => {
|
|
39
|
+
if (!site.alreadyTracked)
|
|
40
|
+
setToast({ message: copy.added(site) });
|
|
41
|
+
}, [copy]);
|
|
42
|
+
return { toast, dismiss, announceImported, announceAdded, showToast: setToast };
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=use-site-toast.hooks.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ColorSchemePreference } from '../../core/theme/types.js';
|
|
2
|
+
/** The slice of `Storage` the preference is kept in. */
|
|
3
|
+
export type PreferenceStorage = Pick<Storage, 'getItem' | 'setItem'>;
|
|
4
|
+
/** The OS dark-mode query, with change events so `system` can follow it. */
|
|
5
|
+
export type ColorSchemeMediaPort = (query: string) => Pick<MediaQueryList, 'matches' | 'addEventListener' | 'removeEventListener'>;
|
|
6
|
+
/** The element whose `data-theme` and `color-scheme` carry the resolved scheme. */
|
|
7
|
+
export interface ThemeRoot {
|
|
8
|
+
dataset: DOMStringMap;
|
|
9
|
+
style: {
|
|
10
|
+
colorScheme: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface ThemePreferencePorts {
|
|
14
|
+
storage: PreferenceStorage;
|
|
15
|
+
storageKey: string;
|
|
16
|
+
/** Used when nothing (or something unrecognised) is stored. */
|
|
17
|
+
defaultPreference: ColorSchemePreference;
|
|
18
|
+
matchMedia: ColorSchemeMediaPort;
|
|
19
|
+
root: ThemeRoot;
|
|
20
|
+
}
|
|
21
|
+
/** The stored preference when it is one of the three, else the host's default. */
|
|
22
|
+
export declare function readStoredPreference({ storage, storageKey, defaultPreference }: Pick<ThemePreferencePorts, 'storage' | 'storageKey' | 'defaultPreference'>, _optional?: {}): ColorSchemePreference;
|
|
23
|
+
/**
|
|
24
|
+
* `data-theme` on the root element is always the *resolved* value — `light` or
|
|
25
|
+
* `dark`, never `system`. That keeps the stylesheet to a single dark block instead
|
|
26
|
+
* of repeating the whole palette once for the explicit choice and again inside a
|
|
27
|
+
* `prefers-color-scheme` query, which is the usual way these two drift apart.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useThemePreference(ports: ThemePreferencePorts, _optional?: {}): [ColorSchemePreference, (next: ColorSchemePreference) => void];
|
|
30
|
+
//# sourceMappingURL=use-theme-preference.hooks.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A persisted light / system / dark preference, applied to a root element. Storage, its key,
|
|
3
|
+
* the default, the OS media query and the root are all the host's (injected).
|
|
4
|
+
*/
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
import { resolveColorScheme } from '../../theme/color-scheme.js';
|
|
7
|
+
// Every port is an effect dependency, so the host passes stable references (module constants or a
|
|
8
|
+
// `useMemo`): a fresh `matchMedia` closure per render would re-subscribe on every render.
|
|
9
|
+
const DARK_QUERY = '(prefers-color-scheme: dark)';
|
|
10
|
+
/** The stored preference when it is one of the three, else the host's default. */
|
|
11
|
+
export function readStoredPreference({ storage, storageKey, defaultPreference }, _optional = {}) {
|
|
12
|
+
const stored = storage.getItem(storageKey);
|
|
13
|
+
return stored === 'light' || stored === 'dark' || stored === 'system' ? stored : defaultPreference;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `data-theme` on the root element is always the *resolved* value — `light` or
|
|
17
|
+
* `dark`, never `system`. That keeps the stylesheet to a single dark block instead
|
|
18
|
+
* of repeating the whole palette once for the explicit choice and again inside a
|
|
19
|
+
* `prefers-color-scheme` query, which is the usual way these two drift apart.
|
|
20
|
+
*/
|
|
21
|
+
export function useThemePreference(ports, _optional = {}) {
|
|
22
|
+
const { storage, storageKey, matchMedia, root } = ports;
|
|
23
|
+
const [preference, setPreference] = useState(() => readStoredPreference(ports));
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const media = matchMedia(DARK_QUERY);
|
|
26
|
+
const apply = () => {
|
|
27
|
+
const resolved = resolveColorScheme({ preference }, { matchMedia: () => media });
|
|
28
|
+
root.dataset['theme'] = resolved;
|
|
29
|
+
// Tells the engine which form controls and scrollbars to draw.
|
|
30
|
+
root.style.colorScheme = resolved;
|
|
31
|
+
};
|
|
32
|
+
apply();
|
|
33
|
+
storage.setItem(storageKey, preference);
|
|
34
|
+
// Only `system` tracks the OS; an explicit choice must not move underneath you.
|
|
35
|
+
if (preference !== 'system')
|
|
36
|
+
return undefined;
|
|
37
|
+
media.addEventListener('change', apply);
|
|
38
|
+
return () => media.removeEventListener('change', apply);
|
|
39
|
+
}, [preference, storage, storageKey, matchMedia, root]);
|
|
40
|
+
return [preference, setPreference];
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=use-theme-preference.hooks.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** The framework-free version loader this hook drives (one IPC read per bridge). */
|
|
2
|
+
export interface AppVersionLoaderPort<S> {
|
|
3
|
+
subscribe(listener: () => void): () => void;
|
|
4
|
+
getSnapshot(): S;
|
|
5
|
+
/** Starts the one read; the returned cleanup makes later responses inert. */
|
|
6
|
+
start(): () => void;
|
|
7
|
+
}
|
|
8
|
+
/** The framework-free update-check controller this hook drives (one check at a time). */
|
|
9
|
+
export interface UpdateCheckPort<S> {
|
|
10
|
+
subscribe(listener: () => void): () => void;
|
|
11
|
+
getSnapshot(): S;
|
|
12
|
+
checkForUpdates(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* No guessed version while pending/unavailable; IPC failures retain their actual message.
|
|
16
|
+
* Reads the version once per bridge, ignoring responses after cleanup. An older preload without
|
|
17
|
+
* the method keeps the label usable until the preload is rebuilt (the loader's own contract).
|
|
18
|
+
* @param required.bridge the preload bridge port, or `undefined`; main is the source of truth.
|
|
19
|
+
* @param required.createLoader the host's loader factory, called once per bridge.
|
|
20
|
+
* @returns the loader's snapshot; failures are contained rather than thrown from React.
|
|
21
|
+
* @complexity O(1) time and space, with one IPC request per bridge.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useAppVersion<B, S>({ bridge, createLoader }: {
|
|
24
|
+
bridge: B;
|
|
25
|
+
createLoader: (required: {
|
|
26
|
+
bridge: B;
|
|
27
|
+
}) => AppVersionLoaderPort<S>;
|
|
28
|
+
}, _optional?: {}): S;
|
|
29
|
+
/**
|
|
30
|
+
* Settings › Check for updates…: main runs the check and shows every notice; this only waits.
|
|
31
|
+
* One check at a time from this window; `onDone` closes the menu once main has answered.
|
|
32
|
+
* @param required.onDone called once main has answered; an inline function is fine.
|
|
33
|
+
* @param required.report receives a broken-channel message (main reports check failures itself).
|
|
34
|
+
* @param required.createCheck the host's update-check factory, called once per bridge.
|
|
35
|
+
* @complexity O(1), with one IPC request per click.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useUpdateCheck<B, S extends object>({ bridge, onDone, report, createCheck }: {
|
|
38
|
+
bridge: B;
|
|
39
|
+
onDone: () => void;
|
|
40
|
+
report: (required: {
|
|
41
|
+
readonly message: string;
|
|
42
|
+
}) => void;
|
|
43
|
+
createCheck: (required: {
|
|
44
|
+
bridge: B;
|
|
45
|
+
onDone: () => void;
|
|
46
|
+
report: (required: {
|
|
47
|
+
readonly message: string;
|
|
48
|
+
}) => void;
|
|
49
|
+
}) => UpdateCheckPort<S>;
|
|
50
|
+
}, _optional?: {}): S & {
|
|
51
|
+
checkForUpdates: () => Promise<void>;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=use-app-version.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file React bindings for a desktop app's version label and its "Check for updates…" row. The
|
|
3
|
+
* framework-free loader and update-check controller live in the host's desktop toolkit; the host
|
|
4
|
+
* injects their factories, so this browser package never depends on the desktop host package and
|
|
5
|
+
* no package metadata enters the renderer bundle.
|
|
6
|
+
*/
|
|
7
|
+
import { useEffect, useMemo, useRef, useSyncExternalStore } from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* No guessed version while pending/unavailable; IPC failures retain their actual message.
|
|
10
|
+
* Reads the version once per bridge, ignoring responses after cleanup. An older preload without
|
|
11
|
+
* the method keeps the label usable until the preload is rebuilt (the loader's own contract).
|
|
12
|
+
* @param required.bridge the preload bridge port, or `undefined`; main is the source of truth.
|
|
13
|
+
* @param required.createLoader the host's loader factory, called once per bridge.
|
|
14
|
+
* @returns the loader's snapshot; failures are contained rather than thrown from React.
|
|
15
|
+
* @complexity O(1) time and space, with one IPC request per bridge.
|
|
16
|
+
*/
|
|
17
|
+
export function useAppVersion({ bridge, createLoader }, _optional = {}) {
|
|
18
|
+
const loader = useMemo(() => createLoader({ bridge }), [bridge, createLoader]);
|
|
19
|
+
useEffect(() => loader.start(), [loader]);
|
|
20
|
+
return useSyncExternalStore(loader.subscribe, loader.getSnapshot);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Settings › Check for updates…: main runs the check and shows every notice; this only waits.
|
|
24
|
+
* One check at a time from this window; `onDone` closes the menu once main has answered.
|
|
25
|
+
* @param required.onDone called once main has answered; an inline function is fine.
|
|
26
|
+
* @param required.report receives a broken-channel message (main reports check failures itself).
|
|
27
|
+
* @param required.createCheck the host's update-check factory, called once per bridge.
|
|
28
|
+
* @complexity O(1), with one IPC request per click.
|
|
29
|
+
*/
|
|
30
|
+
export function useUpdateCheck({ bridge, onDone, report, createCheck }, _optional = {}) {
|
|
31
|
+
// An inline `onDone` is a new function every render; the controller keeps calling the latest one.
|
|
32
|
+
const latest = useRef({ onDone, report });
|
|
33
|
+
latest.current = { onDone, report };
|
|
34
|
+
const check = useMemo(() => createCheck({
|
|
35
|
+
bridge,
|
|
36
|
+
onDone: () => latest.current.onDone(),
|
|
37
|
+
report: (failure) => latest.current.report(failure),
|
|
38
|
+
}), [bridge, createCheck]);
|
|
39
|
+
const state = useSyncExternalStore(check.subscribe, check.getSnapshot);
|
|
40
|
+
return { ...state, checkForUpdates: check.checkForUpdates };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=use-app-version.js.map
|
|
@@ -51,7 +51,7 @@ export declare const defaultAssetGridHooks: {
|
|
|
51
51
|
export type AssetGridHooks = typeof defaultAssetGridHooks;
|
|
52
52
|
/**
|
|
53
53
|
* A live-updating, filterable, multi-selectable asset grid — the generic
|
|
54
|
-
* pattern behind a photo library / DAM. See `
|
|
54
|
+
* pattern behind a photo library / DAM. See `070311a07^:packages/ui/source-map.md` (section "features/asset-grid/") for
|
|
55
55
|
* the full retained-behavior manifest against the original `LibrarySection.tsx`.
|
|
56
56
|
*/
|
|
57
57
|
export declare function AssetGrid<TAsset extends AssetGridItem>({ active, report, useWiredAssetGridLiveUpdates: useWiredAssetGridLiveUpdatesHook, selectors, dependencies, kindFacets: configuredKindFacets, sourceFacets: configuredSourceFacets, renderThumbnail, renderThumbnailPlaceholder, renderCardExtra, renderBulkActions, onDeleteAsset, onDeleteSelected, onPreview, isPreviewOpen, toolbarActions, emptyState, searchPlaceholder, searchDebounceMs, liveUpdateCoalesceMs, initialViewMode, useWiredAssetGridData: useWiredAssetGridDataHook, useAssetGridSelection: useAssetGridSelectionHook, hooks, }: AssetGridProps<TAsset>): import("react").JSX.Element;
|
|
@@ -22,7 +22,7 @@ function renderGridContent({ loading, emptyState, t, ...bodyProps }, _options =
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* A live-updating, filterable, multi-selectable asset grid — the generic
|
|
25
|
-
* pattern behind a photo library / DAM. See `
|
|
25
|
+
* pattern behind a photo library / DAM. See `070311a07^:packages/ui/source-map.md` (section "features/asset-grid/") for
|
|
26
26
|
* the full retained-behavior manifest against the original `LibrarySection.tsx`.
|
|
27
27
|
*/
|
|
28
28
|
export function AssetGrid({ active = true, report, useWiredAssetGridLiveUpdates: useWiredAssetGridLiveUpdatesHook = useWiredAssetGridLiveUpdates, selectors, dependencies, kindFacets: configuredKindFacets, sourceFacets: configuredSourceFacets, renderThumbnail, renderThumbnailPlaceholder, renderCardExtra, renderBulkActions, onDeleteAsset, onDeleteSelected, onPreview, isPreviewOpen = false, toolbarActions, emptyState, searchPlaceholder, searchDebounceMs, liveUpdateCoalesceMs, initialViewMode = 'grid', useWiredAssetGridData: useWiredAssetGridDataHook = useWiredAssetGridData, useAssetGridSelection: useAssetGridSelectionHook = useAssetGridSelection, hooks = defaultAssetGridHooks, }) {
|
|
@@ -11,7 +11,7 @@ export interface DeleteConfirmDialogProps {
|
|
|
11
11
|
* Generic bulk-delete confirmation dialog. Keeps its own body-scroll-lock
|
|
12
12
|
* behavior inline (a standard modal a11y idiom) — matching the same
|
|
13
13
|
* disclosed deviation `ConnectorDetailDrawer` documents in
|
|
14
|
-
* `
|
|
14
|
+
* `070311a07^:packages/ui/source-map.md` (section "features/asset-grid/"). Escape-to-close is shared plumbing (see
|
|
15
15
|
* `useDismissOnOutsideOrEscape` below); the backdrop's own `onMouseDown`
|
|
16
16
|
* already handles outside-click, so no `containerRef` is passed.
|
|
17
17
|
*/
|
|
@@ -6,7 +6,7 @@ import { useDismissOnOutsideOrEscape } from '../../../../browser/index.js';
|
|
|
6
6
|
* Generic bulk-delete confirmation dialog. Keeps its own body-scroll-lock
|
|
7
7
|
* behavior inline (a standard modal a11y idiom) — matching the same
|
|
8
8
|
* disclosed deviation `ConnectorDetailDrawer` documents in
|
|
9
|
-
* `
|
|
9
|
+
* `070311a07^:packages/ui/source-map.md` (section "features/asset-grid/"). Escape-to-close is shared plumbing (see
|
|
10
10
|
* `useDismissOnOutsideOrEscape` below); the backdrop's own `onMouseDown`
|
|
11
11
|
* already handles outside-click, so no `containerRef` is passed.
|
|
12
12
|
*/
|
|
@@ -42,7 +42,7 @@ export interface AssetTreeBrowserProps<TFile extends AssetTreeFileItem> {
|
|
|
42
42
|
thumbnailIsInteractive?: boolean;
|
|
43
43
|
toolbarActions?: readonly AssetTreeToolbarAction[];
|
|
44
44
|
emptyStateActions?: readonly AssetTreeToolbarAction[];
|
|
45
|
-
/** Host-owned footer slot, rendered below the listing. This package ships no default footer — see `
|
|
45
|
+
/** Host-owned footer slot, rendered below the listing. This package ships no default footer — see `070311a07^:packages/ui/source-map.md` (section "features/asset-tree-browser/") for why. */
|
|
46
46
|
footer?: ReactNode;
|
|
47
47
|
/** Custom hook overrides for dependency injection / testing. */
|
|
48
48
|
useAssetTreeNavigation?: typeof useAssetTreeNavigation;
|
|
@@ -56,7 +56,7 @@ export interface AssetTreeBrowserProps<TFile extends AssetTreeFileItem> {
|
|
|
56
56
|
* batch delete/download, inline rename, a row context menu, drag-and-drop +
|
|
57
57
|
* clipboard-paste upload, and a companion `FilePreviewPane`. Ported from a
|
|
58
58
|
* design-tool origin project's file-manager panel — see
|
|
59
|
-
* `
|
|
59
|
+
* `070311a07^:packages/ui/source-map.md` (section "features/asset-tree-browser/") for the full retained-behavior manifest and
|
|
60
60
|
* everything dropped (the origin's live-artifacts section, plugin-folders
|
|
61
61
|
* section, project menu, rotating-tip footer, and file-kind-specific
|
|
62
62
|
* preview rendering).
|
|
@@ -9,7 +9,7 @@ import { useAssetTreeBrowserController } from './useAssetTreeBrowserController.j
|
|
|
9
9
|
* batch delete/download, inline rename, a row context menu, drag-and-drop +
|
|
10
10
|
* clipboard-paste upload, and a companion `FilePreviewPane`. Ported from a
|
|
11
11
|
* design-tool origin project's file-manager panel — see
|
|
12
|
-
* `
|
|
12
|
+
* `070311a07^:packages/ui/source-map.md` (section "features/asset-tree-browser/") for the full retained-behavior manifest and
|
|
13
13
|
* everything dropped (the origin's live-artifacts section, plugin-folders
|
|
14
14
|
* section, project menu, rotating-tip footer, and file-kind-specific
|
|
15
15
|
* preview rendering).
|
|
@@ -16,7 +16,7 @@ export interface FilePreviewPaneProps<TFile> {
|
|
|
16
16
|
* Host-supplied, kind-aware thumbnail. Defaults to a generic glyph
|
|
17
17
|
* placeholder — this package ships no file-kind-specific rendering (no
|
|
18
18
|
* HTML-iframe preview, no design-canvas preview; see
|
|
19
|
-
* `
|
|
19
|
+
* `070311a07^:packages/ui/source-map.md` (section "features/asset-tree-browser/") for what the origin `DesignFilesPanel`
|
|
20
20
|
* shipped there instead and why it isn't ported).
|
|
21
21
|
*/
|
|
22
22
|
renderThumbnail?: ((file: TFile) => ReactNode) | undefined;
|
|
@@ -17,7 +17,7 @@ export interface BrowserViewportControlsProps {
|
|
|
17
17
|
* hook (`packages/ui/src/browser/`) rather than a hand-rolled listener pair.
|
|
18
18
|
*
|
|
19
19
|
* Confirmed (2026-07-17) to be the same shape as `FileViewer.tsx`'s
|
|
20
|
-
* `PreviewViewportControls` — see `
|
|
20
|
+
* `PreviewViewportControls` — see `070311a07^:packages/ui/source-map.md` (section "features/browser-chrome/"), subsection
|
|
21
21
|
* `features/browser-chrome/` section before building a second one.
|
|
22
22
|
*/
|
|
23
23
|
export declare function BrowserViewportControls({ useTHook, useDismissOnOutsideOrEscapeHook, viewport, onViewport, disabled, presets, }: BrowserViewportControlsProps): import("react").JSX.Element | null;
|
|
@@ -19,7 +19,7 @@ function viewportIconName(viewport) {
|
|
|
19
19
|
* hook (`packages/ui/src/browser/`) rather than a hand-rolled listener pair.
|
|
20
20
|
*
|
|
21
21
|
* Confirmed (2026-07-17) to be the same shape as `FileViewer.tsx`'s
|
|
22
|
-
* `PreviewViewportControls` — see `
|
|
22
|
+
* `PreviewViewportControls` — see `070311a07^:packages/ui/source-map.md` (section "features/browser-chrome/"), subsection
|
|
23
23
|
* `features/browser-chrome/` section before building a second one.
|
|
24
24
|
*/
|
|
25
25
|
export function BrowserViewportControls({ useTHook = useT, useDismissOnOutsideOrEscapeHook = useDismissOnOutsideOrEscape, viewport, onViewport, disabled, presets = BROWSER_VIEWPORT_PRESETS, }) {
|
|
@@ -23,9 +23,9 @@ export function renderChartTable({ element, spec }, _options = {}) {
|
|
|
23
23
|
const columns = keys.map((key) => ({ key, label: spec.series.find((series) => series.key === key)?.label ?? key }));
|
|
24
24
|
const numeric = getNumericColumnKeys({ columns, rows: spec.data });
|
|
25
25
|
const scroll = doc.createElement('div');
|
|
26
|
-
scroll.className = 'jini-data-table-scroll';
|
|
26
|
+
scroll.className = 'jini-ui-data-table-scroll';
|
|
27
27
|
const table = doc.createElement('table');
|
|
28
|
-
table.className = 'jini-data-table';
|
|
28
|
+
table.className = 'jini-ui-data-table';
|
|
29
29
|
const caption = table.createCaption();
|
|
30
30
|
caption.textContent = spec.title ?? 'Chart data';
|
|
31
31
|
const header = table.createTHead().insertRow();
|
|
@@ -49,11 +49,11 @@ export function renderChartTable({ element, spec }, _options = {}) {
|
|
|
49
49
|
if (spec.data.length === 0) {
|
|
50
50
|
const cell = body.insertRow().insertCell();
|
|
51
51
|
cell.colSpan = Math.max(1, columns.length);
|
|
52
|
-
cell.className = 'jini-data-table-empty';
|
|
52
|
+
cell.className = 'jini-ui-data-table-empty';
|
|
53
53
|
cell.textContent = 'No results.';
|
|
54
54
|
}
|
|
55
55
|
scroll.append(table);
|
|
56
|
-
element.className = 'jini-data-table-frame';
|
|
56
|
+
element.className = 'jini-ui-data-table-frame';
|
|
57
57
|
element.dataset.tableProvider = 'native';
|
|
58
58
|
element.replaceChildren(scroll);
|
|
59
59
|
}
|
|
@@ -5,5 +5,6 @@ export type { CommandPaletteRecentsPort } from './ports.js';
|
|
|
5
5
|
export { createLocalStorageRecents } from './dependencies.js';
|
|
6
6
|
export { useCommandPalette, useWiredCommandPalette, type UseCommandPaletteOptions, type CommandPaletteController, } from './react/hooks/useCommandPalette.js';
|
|
7
7
|
export { CommandPaletteRow, type CommandPaletteRowProps } from './react/components/CommandPaletteRow.js';
|
|
8
|
+
export { useCommandPaletteView } from './react/components/CommandPalette.hooks.js';
|
|
8
9
|
export { CommandPalette, type CommandPaletteProps } from './react/components/CommandPalette.js';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -3,5 +3,6 @@ export { scoreItemMatch, rankItems, nextCursor, parseRecentIds, pushRecentId } f
|
|
|
3
3
|
export { createLocalStorageRecents } from './dependencies.js';
|
|
4
4
|
export { useCommandPalette, useWiredCommandPalette, } from './react/hooks/useCommandPalette.js';
|
|
5
5
|
export { CommandPaletteRow } from './react/components/CommandPaletteRow.js';
|
|
6
|
+
export { useCommandPaletteView } from './react/components/CommandPalette.hooks.js';
|
|
6
7
|
export { CommandPalette } from './react/components/CommandPalette.js';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useT } from '../../../i18n/index.js';
|
|
1
|
+
import type { useT } from '../../../i18n/index.js';
|
|
2
2
|
import type { CommandPaletteItem } from '../../types.js';
|
|
3
|
-
import { useWiredCommandPalette } from '../hooks/useCommandPalette.js';
|
|
4
|
-
import { useCommandPaletteView } from './CommandPalette.hooks.js';
|
|
3
|
+
import type { useWiredCommandPalette } from '../hooks/useCommandPalette.js';
|
|
4
|
+
import type { useCommandPaletteView } from './CommandPalette.hooks.js';
|
|
5
5
|
export interface CommandPaletteProps {
|
|
6
6
|
items: readonly CommandPaletteItem[];
|
|
7
7
|
onSelect: (item: CommandPaletteItem) => void;
|
|
8
8
|
onClose: () => void;
|
|
9
9
|
scopeKey?: string | undefined;
|
|
10
10
|
placeholder?: string | undefined;
|
|
11
|
-
/**
|
|
12
|
-
useWiredCommandPalette
|
|
13
|
-
useTHook
|
|
14
|
-
useCommandPaletteViewHook
|
|
11
|
+
/** Required hooks: the host injects the real implementations (type-only references here, no local defaults). */
|
|
12
|
+
useWiredCommandPalette: typeof useWiredCommandPalette;
|
|
13
|
+
useTHook: typeof useT;
|
|
14
|
+
useCommandPaletteViewHook: typeof useCommandPaletteView;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A full-screen Cmd/Ctrl+P-style palette: a single search input over a
|
|
@@ -22,9 +22,9 @@ export interface CommandPaletteProps {
|
|
|
22
22
|
*
|
|
23
23
|
* Origin: `QuickSwitcher.tsx` — the origin's `ProjectFile`/`WorkspaceContextItem`
|
|
24
24
|
* split (files vs. tabs, two different shapes) is replaced by one generic
|
|
25
|
-
* `CommandPaletteItem`; see `
|
|
25
|
+
* `CommandPaletteItem`; see `070311a07^:packages/ui/source-map.md` (section "features/command-palette/") for the full
|
|
26
26
|
* genericization writeup, including why this is a distinct primitive from
|
|
27
27
|
* `features/mention-autocomplete/`.
|
|
28
28
|
*/
|
|
29
|
-
export declare function CommandPalette(
|
|
29
|
+
export declare function CommandPalette(required: CommandPaletteProps, _optional?: {}): import("react").JSX.Element;
|
|
30
30
|
//# sourceMappingURL=CommandPalette.d.ts.map
|