@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
package/README.md
CHANGED
|
@@ -165,11 +165,11 @@ admin panel would otherwise re-derive — `execution`, `integrations`, `connecto
|
|
|
165
165
|
|
|
166
166
|
This has already gone wrong once: the reference implementation's admin API client defines
|
|
167
167
|
`AdminExecutionDetectedAgent` with the comment *"Mirrors `@jini-ai/ui`'s `ExecutionTab`
|
|
168
|
-
`DetectedAgent` shape"* — a hand-maintained copy of
|
|
169
|
-
`DetectedAgent` that has **already drifted** (it added `authStatus`/`authMessage`; this side has
|
|
168
|
+
`DetectedAgent` shape"* — a hand-maintained copy of `@jini-ai/core/contracts/execution`'s
|
|
169
|
+
`ExecutionCardAgent` (renamed from `DetectedAgent`) that has **already drifted** (it added `authStatus`/`authMessage`; this side has
|
|
170
170
|
`description` and reasoning-effort presets). It also re-derived `detectExecutionAgents` /
|
|
171
171
|
`testExecutionConnection` / `listExecutionModels` / `testExecutionAgent`, which is exactly the
|
|
172
|
-
`ExecutionPort` already defined in
|
|
172
|
+
`ExecutionPort` already defined in `@jini-ai/core/contracts/execution`.
|
|
173
173
|
|
|
174
174
|
Reuse the port. Do not create a third definition.
|
|
175
175
|
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './useDismissOnOutsideOrEscape.js';
|
|
2
2
|
export * from './useGlobalKeydown.js';
|
|
3
3
|
export * from './useFileDropTarget.js';
|
|
4
|
+
export { mountRenderer, type MountRendererDeps, type MountRendererOptions, type RendererRoot } from './mount-renderer.js';
|
|
4
5
|
export { menuFocusIndex, useMenuKeyboard, type DocumentFocus } from './useMenuKeyboard.js';
|
|
6
|
+
export { settingsControlHandlers, useDismissibleDropdown, type DismissibleDropdown, type SettingsControlHandlers } from './useDismissibleDropdown.js';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.js
CHANGED
|
@@ -7,5 +7,7 @@
|
|
|
7
7
|
export * from './useDismissOnOutsideOrEscape.js';
|
|
8
8
|
export * from './useGlobalKeydown.js';
|
|
9
9
|
export * from './useFileDropTarget.js';
|
|
10
|
+
export { mountRenderer } from './mount-renderer.js';
|
|
10
11
|
export { menuFocusIndex, useMenuKeyboard } from './useMenuKeyboard.js';
|
|
12
|
+
export { settingsControlHandlers, useDismissibleDropdown } from './useDismissibleDropdown.js';
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A renderer's mount step, kept out of the host's entry module so it can be tested: find the
|
|
3
|
+
* host element the page ships and render the app into it. The host's entry stays a pure composition
|
|
4
|
+
* root (real `document`, real `createRoot`, the real app); this module owns the one decision in that
|
|
5
|
+
* path, failing loudly when the host element is missing.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
/** The slice of a React root this module uses (`react-dom/client` `Root`). */
|
|
9
|
+
export interface RendererRoot {
|
|
10
|
+
render(children: ReactNode): void;
|
|
11
|
+
}
|
|
12
|
+
/** Required inputs: where to look for the host element, how to make a root, and what to render. */
|
|
13
|
+
export interface MountRendererDeps {
|
|
14
|
+
/** The slice of `document` used to find the host element. */
|
|
15
|
+
document: {
|
|
16
|
+
getElementById(id: string): Element | null;
|
|
17
|
+
};
|
|
18
|
+
/** `react-dom/client` `createRoot`, injected so a test can observe the mount. */
|
|
19
|
+
createRoot: (container: Element) => RendererRoot;
|
|
20
|
+
/** The tree to render (in production, the host's app inside `<StrictMode>`). */
|
|
21
|
+
app: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** Optional inputs. */
|
|
24
|
+
export interface MountRendererOptions {
|
|
25
|
+
/** Id of the host element; the page is expected to ship `<div id="root">`. */
|
|
26
|
+
rootId?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Render `app` into the host element. Throws when the element is missing: a blank window with no
|
|
30
|
+
* error is far harder to diagnose than an uncaught error naming the missing element.
|
|
31
|
+
*/
|
|
32
|
+
export declare function mountRenderer(deps: MountRendererDeps, options?: MountRendererOptions): RendererRoot;
|
|
33
|
+
//# sourceMappingURL=mount-renderer.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render `app` into the host element. Throws when the element is missing: a blank window with no
|
|
3
|
+
* error is far harder to diagnose than an uncaught error naming the missing element.
|
|
4
|
+
*/
|
|
5
|
+
export function mountRenderer(deps, options = {}) {
|
|
6
|
+
const { rootId = 'root' } = options;
|
|
7
|
+
const container = deps.document.getElementById(rootId);
|
|
8
|
+
if (container == null)
|
|
9
|
+
throw new Error(`renderer: #${rootId} missing from index.html`);
|
|
10
|
+
const root = deps.createRoot(container);
|
|
11
|
+
root.render(deps.app);
|
|
12
|
+
return root;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=mount-renderer.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A dropdown menu's open state with click-outside/Escape dismissal, and the handlers of a
|
|
3
|
+
* settings dropdown (a toggle button, a set of choices, a link to a fuller page). Every dropdown in a
|
|
4
|
+
* host's top nav or on a card wanted the same open flag plus "a press outside or Escape closes it";
|
|
5
|
+
* hand-rolled copies of that listener pair are how a menu becomes a menu bug.
|
|
6
|
+
*
|
|
7
|
+
* The listener logic is not reimplemented here: it is {@link useDismissOnOutsideOrEscape} with
|
|
8
|
+
* Escape in the capture phase, so a child that stops a bubbling Escape cannot keep the menu open.
|
|
9
|
+
*/
|
|
10
|
+
import { type Dispatch, type RefObject, type SetStateAction } from 'react';
|
|
11
|
+
/** What {@link useDismissibleDropdown} hands back: the open flag, its setter and the menu's container ref. */
|
|
12
|
+
export interface DismissibleDropdown<T extends HTMLElement = HTMLDivElement> {
|
|
13
|
+
open: boolean;
|
|
14
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
15
|
+
/** Attach to the element whose subtree counts as "inside" the dropdown. */
|
|
16
|
+
containerRef: RefObject<T | null>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A dropdown's open state plus the "click/tap outside or Escape closes it" behaviour. Listens only
|
|
20
|
+
* while open, and detaches on close and unmount.
|
|
21
|
+
* @returns The open flag, its setter and the container ref. @complexity O(1).
|
|
22
|
+
*/
|
|
23
|
+
export declare function useDismissibleDropdown<T extends HTMLElement = HTMLDivElement>(): DismissibleDropdown<T>;
|
|
24
|
+
/** A settings dropdown's three handlers — see {@link settingsControlHandlers}. */
|
|
25
|
+
export interface SettingsControlHandlers<TChoice> {
|
|
26
|
+
/** The trigger button: flips the dropdown, unless the control is disabled. */
|
|
27
|
+
toggleOpen: () => void;
|
|
28
|
+
/** A choice (e.g. a theme pill): applies it, then closes the dropdown. */
|
|
29
|
+
chooseTheme: (input: {
|
|
30
|
+
next: TChoice;
|
|
31
|
+
}) => void;
|
|
32
|
+
/** The link to the fuller settings page: closes the dropdown, then opens the page. */
|
|
33
|
+
openAppearancePage: () => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A settings dropdown's handlers, built from its dropdown setter and its two callbacks.
|
|
37
|
+
*
|
|
38
|
+
* Only the trigger checks `disabled`: an `aria-disabled` control stays focusable and clickable, so
|
|
39
|
+
* the click itself must do nothing. The dropdown entries do not, because a dropdown that cannot
|
|
40
|
+
* open offers nothing to click.
|
|
41
|
+
*
|
|
42
|
+
* @complexity O(1).
|
|
43
|
+
*/
|
|
44
|
+
export declare function settingsControlHandlers<TChoice>(input: {
|
|
45
|
+
disabled: boolean;
|
|
46
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
47
|
+
onThemeChange: (next: TChoice) => void;
|
|
48
|
+
onOpenAppearance: () => void;
|
|
49
|
+
}): SettingsControlHandlers<TChoice>;
|
|
50
|
+
//# sourceMappingURL=useDismissibleDropdown.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A dropdown menu's open state with click-outside/Escape dismissal, and the handlers of a
|
|
3
|
+
* settings dropdown (a toggle button, a set of choices, a link to a fuller page). Every dropdown in a
|
|
4
|
+
* host's top nav or on a card wanted the same open flag plus "a press outside or Escape closes it";
|
|
5
|
+
* hand-rolled copies of that listener pair are how a menu becomes a menu bug.
|
|
6
|
+
*
|
|
7
|
+
* The listener logic is not reimplemented here: it is {@link useDismissOnOutsideOrEscape} with
|
|
8
|
+
* Escape in the capture phase, so a child that stops a bubbling Escape cannot keep the menu open.
|
|
9
|
+
*/
|
|
10
|
+
import { useRef, useState, } from 'react';
|
|
11
|
+
import { useDismissOnOutsideOrEscape } from './useDismissOnOutsideOrEscape.js';
|
|
12
|
+
/**
|
|
13
|
+
* A dropdown's open state plus the "click/tap outside or Escape closes it" behaviour. Listens only
|
|
14
|
+
* while open, and detaches on close and unmount.
|
|
15
|
+
* @returns The open flag, its setter and the container ref. @complexity O(1).
|
|
16
|
+
*/
|
|
17
|
+
export function useDismissibleDropdown() {
|
|
18
|
+
const [open, setOpen] = useState(false);
|
|
19
|
+
const containerRef = useRef(null);
|
|
20
|
+
useDismissOnOutsideOrEscape({ onDismiss: () => setOpen(false) }, { enabled: open, containerRef, escapeCapture: true });
|
|
21
|
+
return { open, setOpen, containerRef };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A settings dropdown's handlers, built from its dropdown setter and its two callbacks.
|
|
25
|
+
*
|
|
26
|
+
* Only the trigger checks `disabled`: an `aria-disabled` control stays focusable and clickable, so
|
|
27
|
+
* the click itself must do nothing. The dropdown entries do not, because a dropdown that cannot
|
|
28
|
+
* open offers nothing to click.
|
|
29
|
+
*
|
|
30
|
+
* @complexity O(1).
|
|
31
|
+
*/
|
|
32
|
+
export function settingsControlHandlers(input) {
|
|
33
|
+
return {
|
|
34
|
+
toggleOpen: () => {
|
|
35
|
+
if (input.disabled)
|
|
36
|
+
return;
|
|
37
|
+
input.setOpen((current) => !current);
|
|
38
|
+
},
|
|
39
|
+
chooseTheme: ({ next }) => {
|
|
40
|
+
input.onThemeChange(next);
|
|
41
|
+
input.setOpen(false);
|
|
42
|
+
},
|
|
43
|
+
openAppearancePage: () => {
|
|
44
|
+
input.setOpen(false);
|
|
45
|
+
input.onOpenAppearance();
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=useDismissibleDropdown.js.map
|
package/dist/core.d.ts
CHANGED
|
@@ -17,11 +17,9 @@ export * from './features/connectors/constants.js';
|
|
|
17
17
|
export * from './features/connectors/ports.js';
|
|
18
18
|
export * from './features/connectors/rules.js';
|
|
19
19
|
export * from './features/connectors/types.js';
|
|
20
|
-
export type { AgentAuthStatus, AgentCliEnvFieldSpec, AgentDiagnostic, AgentDiagnosticReason, AgentDiagnosticSeverity, AgentExecutableRepair, AgentExecutableSource, AgentFixIntent, AgentModelOption, AgentModelSource, AgentScanState, AgentSupportsCustomModel, AgentTestState, ApiProtocol, ByokConfig, ByokProviderCredentials, ByokRequiredField, ConnectionTestState, DetectedAgent, ExecutionConfig, ExecutionMode, LocalCliConfig, ModelDiscoveryState, ProviderPreset, ProviderPresetKind, } from './features/execution/types.js';
|
|
21
20
|
export { CUSTOM_MODEL_SENTINEL, CUSTOM_PRESET_ID, DEFAULT_AGENT_CLI_ENV_FIELDS, DEFAULT_AGENT_DESCRIPTIONS, DEFAULT_BASE_URL_BY_PROTOCOL, DEFAULT_PROVIDER_PRESETS, PROTOCOL_OPTIONS, } from './features/execution/constants.js';
|
|
22
21
|
export { agentCliEnvValue, agentDiagnosticTooltip, agentExecutableRepairState, agentMetaLabel, agentModelSummary, binPathEnvField, cleanAgentVersionLabel, cliEnvFieldsForAgent, credentialsForPreset, customPreset, filterAgentModelOptions, groupPresets, isBaseUrlInvalid, isProviderConfigured, isValidApiBaseUrl, missingRequiredFields, nextConfigForAgentCliEnvChange, nextConfigForAgentModel, nextConfigForAgentReasoning, nextConfigForAgentSelect, nextConfigForModeChange, nextConfigForPresetSelect, nextConfigForProtocolSelect, parseMaxTokens, presetRequiresApiKey, presetsForProtocol, resolveSelectedPreset, selectedAgentModel, selectedAgentReasoning, shouldShowCustomModelInput, showsBaseUrlField, sortDetectedAgents, } from './features/execution/rules.js';
|
|
23
22
|
export type { AgentMetaLabels } from './features/execution/rules.js';
|
|
24
|
-
export type { ExecutionPort } from './features/execution/ports.js';
|
|
25
23
|
export { createFakeExecutionPort } from './features/execution/dependencies.js';
|
|
26
24
|
export type { FakeExecutionPortOptions } from './features/execution/dependencies.js';
|
|
27
25
|
export type { FolderPathDropPort } from './features/folder-path-drop/ports.js';
|
|
@@ -34,10 +32,11 @@ export type { McpIntegrationsPort } from './features/integrations/ports.js';
|
|
|
34
32
|
export { createFakeMcpIntegrationsPort } from './features/integrations/dependencies.js';
|
|
35
33
|
export type { FakeMcpIntegrationsPortOptions } from './features/integrations/dependencies.js';
|
|
36
34
|
export type { LocaleOption } from './features/language/types.js';
|
|
35
|
+
export { resolveSystemLocale } from './features/i18n/locale.js';
|
|
37
36
|
export type { MediaProviderCredentials, MediaProviderMap, MediaProviderOption, MediaProvidersLoadState, MediaProvidersSaveState, } from './features/media-providers/types.js';
|
|
38
37
|
export { hasAnyConfiguredProvider, hasRecoverableFields, invalidBaseUrlProviderIds, isEntryEmpty, isEntryPresent, isMarkerOnlyEntry, isProviderBaseUrlInvalid, maskedKeyLabel, mergeDaemonProviders, resolveProviderBaseUrl, shouldSyncLocalProvidersToDaemon, sortProvidersByConfigured, } from './features/media-providers/rules.js';
|
|
39
|
-
export type { MediaProvidersPort } from './features/media-providers/ports.js';
|
|
40
|
-
export { createFakeMediaProvidersPort } from './features/media-providers/dependencies.js';
|
|
38
|
+
export type { AnyMediaProvidersPort, MediaProviderFields, MediaProviderRowsPort, MediaProvidersPort } from './features/media-providers/ports.js';
|
|
39
|
+
export { createFakeMediaProviderRowsPort, createFakeMediaProvidersPort } from './features/media-providers/dependencies.js';
|
|
41
40
|
export type { FakeMediaProvidersPortOptions } from './features/media-providers/dependencies.js';
|
|
42
41
|
export { DEFAULT_MEDIA_PROVIDER_CATALOG } from './features/media-providers/constants.js';
|
|
43
42
|
export * from './features/memory/async-commit-guard.js';
|
|
@@ -71,4 +70,5 @@ export * from './features/source-config-list/rules.js';
|
|
|
71
70
|
export * from './features/source-config-list/types.js';
|
|
72
71
|
export { createFindQueryScheduler, FIND_QUERY_SETTLE_MS, type FindQueryClock } from "./features/find/find-query-scheduler.js";
|
|
73
72
|
export * from "./features/live-views/live-views.js";
|
|
73
|
+
export { navAvailability } from "./features/nav-availability/nav-availability.js";
|
|
74
74
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/core.js
CHANGED
|
@@ -27,6 +27,7 @@ export * from './features/connectors/constants.js';
|
|
|
27
27
|
export * from './features/connectors/ports.js';
|
|
28
28
|
export * from './features/connectors/rules.js';
|
|
29
29
|
export * from './features/connectors/types.js';
|
|
30
|
+
// --- execution ---
|
|
30
31
|
export { CUSTOM_MODEL_SENTINEL, CUSTOM_PRESET_ID, DEFAULT_AGENT_CLI_ENV_FIELDS, DEFAULT_AGENT_DESCRIPTIONS, DEFAULT_BASE_URL_BY_PROTOCOL, DEFAULT_PROVIDER_PRESETS, PROTOCOL_OPTIONS, } from './features/execution/constants.js';
|
|
31
32
|
export { agentCliEnvValue, agentDiagnosticTooltip, agentExecutableRepairState, agentMetaLabel, agentModelSummary, binPathEnvField, cleanAgentVersionLabel, cliEnvFieldsForAgent, credentialsForPreset, customPreset, filterAgentModelOptions, groupPresets, isBaseUrlInvalid, isProviderConfigured, isValidApiBaseUrl, missingRequiredFields, nextConfigForAgentCliEnvChange, nextConfigForAgentModel, nextConfigForAgentReasoning, nextConfigForAgentSelect, nextConfigForModeChange, nextConfigForPresetSelect, nextConfigForProtocolSelect, parseMaxTokens, presetRequiresApiKey, presetsForProtocol, resolveSelectedPreset, selectedAgentModel, selectedAgentReasoning, shouldShowCustomModelInput, showsBaseUrlField, sortDetectedAgents, } from './features/execution/rules.js';
|
|
32
33
|
export { createFakeExecutionPort } from './features/execution/dependencies.js';
|
|
@@ -34,8 +35,9 @@ export { captureFolderPathDrop, folderPathsFromDataTransfer, formatDroppedFolder
|
|
|
34
35
|
export { DEFAULT_MCP_CLIENT_ID, DEFAULT_MCP_SERVER_NAME, MCP_CLIENTS } from './features/integrations/constants.js';
|
|
35
36
|
export { buildClaudeCliSnippet, buildCodexEnvToml, buildCodexTomlSnippet, buildCursorDeeplink, buildMcpStdioServerConfig, buildSharedMcpJson, buildVsCodeSnippet, buildZedSnippet, commandPaletteShortcut, homeConfigPath, isMcpInstallPrerequisiteMissing, methodLabelForClient, settingsShortcut, snippetForClient, utf8Btoa, } from './features/integrations/rules.js';
|
|
36
37
|
export { createFakeMcpIntegrationsPort } from './features/integrations/dependencies.js';
|
|
38
|
+
export { resolveSystemLocale } from './features/i18n/locale.js';
|
|
37
39
|
export { hasAnyConfiguredProvider, hasRecoverableFields, invalidBaseUrlProviderIds, isEntryEmpty, isEntryPresent, isMarkerOnlyEntry, isProviderBaseUrlInvalid, maskedKeyLabel, mergeDaemonProviders, resolveProviderBaseUrl, shouldSyncLocalProvidersToDaemon, sortProvidersByConfigured, } from './features/media-providers/rules.js';
|
|
38
|
-
export { createFakeMediaProvidersPort } from './features/media-providers/dependencies.js';
|
|
40
|
+
export { createFakeMediaProviderRowsPort, createFakeMediaProvidersPort } from './features/media-providers/dependencies.js';
|
|
39
41
|
export { DEFAULT_MEDIA_PROVIDER_CATALOG } from './features/media-providers/constants.js';
|
|
40
42
|
// --- memory ---
|
|
41
43
|
// Full surface of the memory domain logic. `export *`, matching the old ui-core memory barrel:
|
|
@@ -66,4 +68,5 @@ export * from './features/source-config-list/rules.js';
|
|
|
66
68
|
export * from './features/source-config-list/types.js';
|
|
67
69
|
export { createFindQueryScheduler, FIND_QUERY_SETTLE_MS } from "./features/find/find-query-scheduler.js";
|
|
68
70
|
export * from "./features/live-views/live-views.js";
|
|
71
|
+
export { navAvailability } from "./features/nav-availability/nav-availability.js";
|
|
69
72
|
//# sourceMappingURL=core.js.map
|
|
@@ -12,7 +12,7 @@ export function InfoTip({ label, triggerLabel, descriptionId, placement: preferr
|
|
|
12
12
|
const { open, placement, coords, iconRef, bubbleRef, show, hide, leave, toggle, pointerDown, handleIconKeyDown } = useTip({}, { placement: inline ? undefined : preferredPlacement });
|
|
13
13
|
const autoId = useId();
|
|
14
14
|
const { name, textId, describedBy } = infoTipNaming({ label, autoId }, { triggerLabel, descriptionId });
|
|
15
|
-
return (_jsxs("span", { className: inline ? "info-tip info-tip--inline" : "info-tip", children: [_jsx("span", { ref: iconRef, className: icon ? "info-tip-icon info-tip-icon--custom" : "info-tip-icon", role: "button", tabIndex: 0, "aria-label": name, "aria-expanded": open, ...describedByAttrs({ describedBy }), onMouseEnter: show, onMouseLeave: leave, onFocus: show, onBlur: hide, onPointerDown: pointerDown, onClick: toggle, onKeyDown: handleIconKeyDown, ...triggerAgentAttrs({ handle, name }), children: icon ?? "ⓘ" }), textId ? _jsx("span", { id: textId, hidden: true, children: label }) : null, open ? _jsx(InfoTipOpenCopy, { label: label, inline: inline, placement: placement, coords: coords, iconRef: iconRef, bubbleRef: bubbleRef }) : null] }));
|
|
15
|
+
return (_jsxs("span", { className: inline ? "jini-ui-info-tip jini-ui-info-tip--inline" : "jini-ui-info-tip", children: [_jsx("span", { ref: iconRef, className: icon ? "jini-ui-info-tip-icon jini-ui-info-tip-icon--custom" : "jini-ui-info-tip-icon", role: "button", tabIndex: 0, "aria-label": name, "aria-expanded": open, ...describedByAttrs({ describedBy }), onMouseEnter: show, onMouseLeave: leave, onFocus: show, onBlur: hide, onPointerDown: pointerDown, onClick: toggle, onKeyDown: handleIconKeyDown, ...triggerAgentAttrs({ handle, name }), children: icon ?? "ⓘ" }), textId ? _jsx("span", { id: textId, hidden: true, children: label }) : null, open ? _jsx(InfoTipOpenCopy, { label: label, inline: inline, placement: placement, coords: coords, iconRef: iconRef, bubbleRef: bubbleRef }) : null] }));
|
|
16
16
|
}
|
|
17
17
|
/** `aria-describedby` only when the full text is actually described by a hidden copy. */
|
|
18
18
|
function describedByAttrs({ describedBy }, _options = {}) {
|
|
@@ -36,8 +36,8 @@ function infoTipNaming({ label, autoId }, { triggerLabel, descriptionId }) {
|
|
|
36
36
|
/** The open tip: inline copy beside the icon, or the bubble portaled out of clipping ancestors. */
|
|
37
37
|
function InfoTipOpenCopy({ label, inline, placement, coords, iconRef, bubbleRef }) {
|
|
38
38
|
if (inline)
|
|
39
|
-
return _jsx("span", { className: "info-tip-inline-copy", "aria-hidden": "true", children: label });
|
|
40
|
-
return createPortal(_jsx("span", { ref: bubbleRef, className: placement === "below" ? "info-tip-bubble info-tip-bubble-below" : "info-tip-bubble", role: "presentation", "aria-hidden": "true", style: { ...infoTipBubbleStyle(coords), whiteSpace: "pre-line" }, children: _jsx(InfoTipBubbleText, { label: label }) }),
|
|
39
|
+
return _jsx("span", { className: "jini-ui-info-tip-inline-copy", "aria-hidden": "true", children: label });
|
|
40
|
+
return createPortal(_jsx("span", { ref: bubbleRef, className: placement === "below" ? "jini-ui-info-tip-bubble jini-ui-info-tip-bubble-below" : "jini-ui-info-tip-bubble", role: "presentation", "aria-hidden": "true", style: { ...infoTipBubbleStyle(coords), whiteSpace: "pre-line" }, children: _jsx(InfoTipBubbleText, { label: label }) }),
|
|
41
41
|
// A modal <dialog> sits in the browser's top layer, above anything portaled to body.
|
|
42
42
|
iconRef.current?.closest("dialog") ?? document.body);
|
|
43
43
|
}
|
|
@@ -50,8 +50,8 @@ function InfoTipBubbleText({ label }) {
|
|
|
50
50
|
return lines.map((line, index) => {
|
|
51
51
|
const separator = index < lines.length - 1 ? "\n" : null;
|
|
52
52
|
return line.bullet
|
|
53
|
-
? _jsxs("span", { className: "info-tip-bullet", children: [_jsx("span", { "aria-hidden": "true", children: "\u2022" }), " ", _jsx("span", { children: line.text }), separator] }, index)
|
|
54
|
-
: _jsxs("span", { className: "info-tip-line", children: [line.text, separator] }, index);
|
|
53
|
+
? _jsxs("span", { className: "jini-ui-info-tip-bullet", children: [_jsx("span", { "aria-hidden": "true", children: "\u2022" }), " ", _jsx("span", { children: line.text }), separator] }, index)
|
|
54
|
+
: _jsxs("span", { className: "jini-ui-info-tip-line", children: [line.text, separator] }, index);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
//# sourceMappingURL=InfoTip.js.map
|
|
@@ -51,7 +51,7 @@ export declare function placeInfoTipBubble(input: {
|
|
|
51
51
|
}): InfoTipPlacement;
|
|
52
52
|
/**
|
|
53
53
|
* The portal's inline style: position plus, once measured, the arrow offset as a CSS variable
|
|
54
|
-
* (`.info-tip-bubble::after` reads `--info-tip-arrow-left`, defaulting to centred).
|
|
54
|
+
* (`.jini-ui-info-tip-bubble::after` reads `--info-tip-arrow-left`, defaulting to centred).
|
|
55
55
|
* @param coords The controller's coordinates.
|
|
56
56
|
* @returns Inline style for the bubble.
|
|
57
57
|
* @complexity O(1).
|
|
@@ -74,7 +74,7 @@ function placeVertically({ anchor, height, viewportHeight }, { preferred }) {
|
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* The portal's inline style: position plus, once measured, the arrow offset as a CSS variable
|
|
77
|
-
* (`.info-tip-bubble::after` reads `--info-tip-arrow-left`, defaulting to centred).
|
|
77
|
+
* (`.jini-ui-info-tip-bubble::after` reads `--info-tip-arrow-left`, defaulting to centred).
|
|
78
78
|
* @param coords The controller's coordinates.
|
|
79
79
|
* @returns Inline style for the bubble.
|
|
80
80
|
* @complexity O(1).
|
|
@@ -7,9 +7,9 @@ const DEFAULT_LINES = 2;
|
|
|
7
7
|
// Presentation depends only on props and expanded state, so this decision needs no React render.
|
|
8
8
|
export function resolveSeeMoreView({ expanded, }, { moreLabel = "See more", lessLabel = "See less", className, textClassName, toggleClassName, } = {}) {
|
|
9
9
|
return {
|
|
10
|
-
wrapperClassName: className ? `see-more ${className}` : "see-more",
|
|
11
|
-
textClassName: withClassName({ base: expanded ? "see-more-text is-expanded" : "see-more-text", extra: textClassName }),
|
|
12
|
-
toggleClassName: toggleClassName ? `see-more-toggle ${toggleClassName}` : "see-more-toggle",
|
|
10
|
+
wrapperClassName: className ? `jini-ui-see-more ${className}` : "jini-ui-see-more",
|
|
11
|
+
textClassName: withClassName({ base: expanded ? "jini-ui-see-more-text is-expanded" : "jini-ui-see-more-text", extra: textClassName }),
|
|
12
|
+
toggleClassName: toggleClassName ? `jini-ui-see-more-toggle ${toggleClassName}` : "jini-ui-see-more-toggle",
|
|
13
13
|
toggleLabel: expanded ? lessLabel : moreLabel,
|
|
14
14
|
};
|
|
15
15
|
}
|
|
@@ -8,23 +8,23 @@ import { Fragment } from "react";
|
|
|
8
8
|
import { useSelectDropdown, useSelectOptionRef, groupHeadingAt } from "./Select.hooks.js";
|
|
9
9
|
import {} from '@jini-ai/core/text';
|
|
10
10
|
function SelectOptionRow({ option, index, isSelected, isHighlighted, optionId, setOptionRef, onHighlight, onSelect, agentHandle: optionHandle, }) {
|
|
11
|
-
return (_jsxs("li", { ref: (el) => setOptionRef(index, el), id: optionId, role: "option", "aria-selected": isSelected, className: `select-option${isSelected ? " is-selected" : ""}${isHighlighted ? " is-highlighted" : ""}`, onMouseEnter: () => onHighlight(index), onClick: () => onSelect(option), ...(optionHandle ? agentHandle({ handle: optionHandle }, { role: "button", label: option.label }) : {}), children: [_jsx("span", { className: "select-option-label", children: option.label }), option.detail ? _jsx("span", { className: "select-option-detail", children: option.detail }) : null, option.badge ? _jsx("span", { className: "select-option-badge", children: option.badge }) : null, isSelected ? (_jsx("svg", { className: "select-option-check", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M3.5 8.5 6.5 11.5 12.5 4.5", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) })) : null] }));
|
|
11
|
+
return (_jsxs("li", { ref: (el) => setOptionRef(index, el), id: optionId, role: "option", "aria-selected": isSelected, className: `jini-ui-select-option${isSelected ? " is-selected" : ""}${isHighlighted ? " is-highlighted" : ""}`, onMouseEnter: () => onHighlight(index), onClick: () => onSelect(option), ...(optionHandle ? agentHandle({ handle: optionHandle }, { role: "button", label: option.label }) : {}), children: [_jsx("span", { className: "select-option-label", children: option.label }), option.detail ? _jsx("span", { className: "select-option-detail", children: option.detail }) : null, option.badge ? _jsx("span", { className: "select-option-badge", children: option.badge }) : null, isSelected ? (_jsx("svg", { className: "jini-ui-select-option-check", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M3.5 8.5 6.5 11.5 12.5 4.5", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) })) : null] }));
|
|
12
12
|
}
|
|
13
13
|
function SelectPanel(props) {
|
|
14
14
|
const { panelRef, page, position, onKeyDown, searchHandle } = props;
|
|
15
15
|
const searchHandleProps = searchHandle ? agentHandle({ handle: searchHandle }, { role: "field", label: "Search the option list" }) : {};
|
|
16
|
-
return (_jsxs("div", { ref: panelRef, "data-agent-page": page, className: "select-panel", style: { left: position.left, width: position.width, top: position.top, bottom: position.bottom, maxHeight: position.maxHeight }, tabIndex: -1, onKeyDown: onKeyDown, children: [renderSelectSearch(props, searchHandleProps), renderSelectOptions(props)] }));
|
|
16
|
+
return (_jsxs("div", { ref: panelRef, "data-agent-page": page, className: "jini-ui-select-panel", style: { left: position.left, width: position.width, top: position.top, bottom: position.bottom, maxHeight: position.maxHeight }, tabIndex: -1, onKeyDown: onKeyDown, children: [renderSelectSearch(props, searchHandleProps), renderSelectOptions(props)] }));
|
|
17
17
|
}
|
|
18
18
|
function renderSelectSearch({ showSearch, searchInputRef, query, setQuery, t }, searchHandleProps) {
|
|
19
|
-
return showSearch ? (_jsx("input", { ref: searchInputRef, type: "text", className: "select-search", "aria-label": t("Search options"), placeholder: t("Search…"), value: query, onChange: (e) => setQuery(e.target.value), ...searchHandleProps })) : null;
|
|
19
|
+
return showSearch ? (_jsx("input", { ref: searchInputRef, type: "text", className: "jini-ui-select-search", "aria-label": t("Search options"), placeholder: t("Search…"), value: query, onChange: (e) => setQuery(e.target.value), ...searchHandleProps })) : null;
|
|
20
20
|
}
|
|
21
21
|
function renderSelectOptions({ listboxId, filtered, value, highlightedIndex, optionId, setOptionRef, onHighlight, onSelect, optionHandles, t }) {
|
|
22
|
-
return (_jsx("ul", { className: "select-list", role: "listbox", id: listboxId, children: filtered.length === 0 ? (_jsx("li", { className: "select-empty", role: "presentation", children: t("No matches") })) : (filtered.map((option, index) => (_jsxs(Fragment, { children: [groupHeadingAt({ options: filtered, index }) ? (_jsx("li", { className: "select-group-label", role: "presentation", children: option.group })) : null, _jsx(SelectOptionRow, { option: option, index: index, isSelected: option.value === value, isHighlighted: index === highlightedIndex, optionId: optionId(index), setOptionRef: setOptionRef, onHighlight: onHighlight, onSelect: onSelect, agentHandle: optionHandles?.[index] })] }, option.value)))) }));
|
|
22
|
+
return (_jsx("ul", { className: "jini-ui-select-list", role: "listbox", id: listboxId, children: filtered.length === 0 ? (_jsx("li", { className: "jini-ui-select-empty", role: "presentation", children: t("No matches") })) : (filtered.map((option, index) => (_jsxs(Fragment, { children: [groupHeadingAt({ options: filtered, index }) ? (_jsx("li", { className: "select-group-label", role: "presentation", children: option.group })) : null, _jsx(SelectOptionRow, { option: option, index: index, isSelected: option.value === value, isHighlighted: index === highlightedIndex, optionId: optionId(index), setOptionRef: setOptionRef, onHighlight: onHighlight, onSelect: onSelect, agentHandle: optionHandles?.[index] })] }, option.value)))) }));
|
|
23
23
|
}
|
|
24
24
|
export function resolveSelectTriggerLabel({ selectedOption, placeholder }, { t = (key) => key } = {}) {
|
|
25
25
|
if (selectedOption)
|
|
26
|
-
return { text: selectedOption.label, className: "select-trigger-label" };
|
|
27
|
-
return { text: placeholder ?? t("Select…"), className: "select-trigger-label is-placeholder" };
|
|
26
|
+
return { text: selectedOption.label, className: "jini-ui-select-trigger-label" };
|
|
27
|
+
return { text: placeholder ?? t("Select…"), className: "jini-ui-select-trigger-label is-placeholder" };
|
|
28
28
|
}
|
|
29
29
|
function resolveSelectTriggerActiveDescendant(open, highlightedIndex, optionId) {
|
|
30
30
|
return open && highlightedIndex >= 0 ? optionId(highlightedIndex) : undefined;
|
|
@@ -53,7 +53,7 @@ export function Select({ hooks = defaultSelectHooks, useDropdown = useSelectDrop
|
|
|
53
53
|
return (_jsxs(_Fragment, { children: [renderSelectTrigger({ triggerRef, id, open, listboxId, activeDescendant, ariaLabel, ariaLabelledBy, disabled, closePanel, openPanel, handleTriggerKeyDown, base, placeholder, triggerLabel }), renderSelectPortal({ open, position, panelRef, triggerRef, showSearch, searchInputRef, query, setQuery, filtered, highlightedIndex, listboxId, optionId, setHighlightedIndex, selectOption, handlePanelKeyDown }, { value, setOptionRef, base, optionHandles, t, portalContainer: props.portalContainer, overlayContainer })] }));
|
|
54
54
|
}
|
|
55
55
|
function renderSelectTrigger({ triggerRef, id, open, listboxId, activeDescendant, ariaLabel, ariaLabelledBy, disabled, closePanel, openPanel, handleTriggerKeyDown, base, placeholder, triggerLabel, }) {
|
|
56
|
-
return (_jsxs("button", { type: "button", ref: triggerRef, id: id, className: "select-trigger", role: "combobox", "aria-expanded": open, "aria-haspopup": "listbox", "aria-controls": open ? listboxId : undefined, "aria-activedescendant": activeDescendant, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, disabled: disabled, onClick: () => (open ? closePanel({ refocusTrigger: false }) : openPanel()), onKeyDown: handleTriggerKeyDown, ...resolveSelectTriggerHandleProps(base, ariaLabel, placeholder), children: [_jsx("span", { className: triggerLabel.className, children: triggerLabel.text }), _jsx("span", { className: "select-trigger-chevron", "aria-hidden": "true" })] }));
|
|
56
|
+
return (_jsxs("button", { type: "button", ref: triggerRef, id: id, className: "jini-ui-select-trigger", role: "combobox", "aria-expanded": open, "aria-haspopup": "listbox", "aria-controls": open ? listboxId : undefined, "aria-activedescendant": activeDescendant, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, disabled: disabled, onClick: () => (open ? closePanel({ refocusTrigger: false }) : openPanel()), onKeyDown: handleTriggerKeyDown, ...resolveSelectTriggerHandleProps(base, ariaLabel, placeholder), children: [_jsx("span", { className: triggerLabel.className, children: triggerLabel.text }), _jsx("span", { className: "jini-ui-select-trigger-chevron", "aria-hidden": "true" })] }));
|
|
57
57
|
}
|
|
58
58
|
function renderSelectPortal({ open, position, panelRef, triggerRef, showSearch, searchInputRef, query, setQuery, filtered, highlightedIndex, listboxId, optionId, setHighlightedIndex, selectOption, handlePanelKeyDown }, { value, setOptionRef, base, optionHandles, t, portalContainer, overlayContainer }) {
|
|
59
59
|
return open && position
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SiteToast as SiteToastValue } from './use-site-toast.hooks.js';
|
|
2
|
+
/** The toast's visible and spoken words; product copy comes from the host. */
|
|
3
|
+
export interface SiteToastLabels {
|
|
4
|
+
showList: string;
|
|
5
|
+
dismiss: string;
|
|
6
|
+
}
|
|
7
|
+
/** Host classes added beside the toast's own `jini-site-toast*` classes. */
|
|
8
|
+
export interface SiteToastClassNames {
|
|
9
|
+
root?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
note?: string;
|
|
12
|
+
items?: string;
|
|
13
|
+
dismiss?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SiteToastProps {
|
|
16
|
+
/** The value from the host's `useSiteToast` state; `null` renders nothing. */
|
|
17
|
+
toast: SiteToastValue | null;
|
|
18
|
+
onDismiss: () => void;
|
|
19
|
+
labels: SiteToastLabels;
|
|
20
|
+
classNames?: SiteToastClassNames;
|
|
21
|
+
}
|
|
22
|
+
/** The "new site" toast. It renders over a site's tab too, which is where an import lands. */
|
|
23
|
+
export declare function SiteToast({ toast, onDismiss, labels, classNames }: SiteToastProps): import("react").JSX.Element | null;
|
|
24
|
+
//# sourceMappingURL=SiteToast.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const join = (own, host) => (host ? `${own} ${host}` : own);
|
|
3
|
+
/** The "new site" toast. It renders over a site's tab too, which is where an import lands. */
|
|
4
|
+
export function SiteToast({ toast, onDismiss, labels, classNames = {} }) {
|
|
5
|
+
if (toast === null)
|
|
6
|
+
return null;
|
|
7
|
+
return (_jsxs("div", { className: join('jini-site-toast', classNames.root), role: "status", children: [_jsxs("div", { children: [_jsx("p", { className: join('jini-site-toast__message', classNames.message), children: toast.message }), toast.note && _jsx("p", { className: join('jini-site-toast__note', classNames.note), children: toast.note }), toast.items && (_jsxs("details", { className: join('jini-site-toast__items', classNames.items), children: [_jsx("summary", { children: labels.showList }), _jsx("ul", { children: toast.items.map((item) => _jsx("li", { children: item }, item)) })] }))] }), _jsx("button", { type: "button", className: join('jini-site-toast__dismiss', classNames.dismiss), "aria-label": labels.dismiss, onClick: onDismiss, children: "\u00D7" })] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=SiteToast.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file "Copy details" text for a failure. A person pastes it into a support message, so it must be
|
|
3
|
+
* real (the actual error, not the host's summary) and safe (no home-folder user name).
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The raw error text with Electron's transport prefix and user home folders removed.
|
|
7
|
+
* @complexity O(n) in the text length.
|
|
8
|
+
*/
|
|
9
|
+
export declare function copyableDetails({ error }: {
|
|
10
|
+
error: unknown;
|
|
11
|
+
}, _optional?: Record<string, never>): string;
|
|
12
|
+
//# sourceMappingURL=copyable-details.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file "Copy details" text for a failure. A person pastes it into a support message, so it must be
|
|
3
|
+
* real (the actual error, not the host's summary) and safe (no home-folder user name).
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The raw error text with Electron's transport prefix and user home folders removed.
|
|
7
|
+
* @complexity O(n) in the text length.
|
|
8
|
+
*/
|
|
9
|
+
export function copyableDetails({ error }, _optional = {}) {
|
|
10
|
+
const raw = error instanceof Error ? error.message : String(error);
|
|
11
|
+
return raw
|
|
12
|
+
.replace(/^(?:Error:\s*)?Error invoking remote method '[^']*':\s*/, '')
|
|
13
|
+
.replace(/\/(?:Users|home)\/[^/\s'"]+/g, '~')
|
|
14
|
+
.replace(/[A-Za-z]:\\Users\\[^\\\s'"]+/g, '~')
|
|
15
|
+
.trim();
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=copyable-details.js.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Immersive ("expanded") mode's decision rules, as plain functions.
|
|
3
|
+
*
|
|
4
|
+
* `useExpandedMode` owns the state; the host's shell component owns the JSX. Every RULE either one
|
|
5
|
+
* applies lives here instead, so it can be called with real inputs and asserted against directly.
|
|
6
|
+
* Rules in this shape are testable without a renderer; the identical rules inlined in an effect
|
|
7
|
+
* body or a JSX guard are not.
|
|
8
|
+
*
|
|
9
|
+
* The invariant every rule here serves: expanded mode hides the only navigation there is, so the
|
|
10
|
+
* operator must always keep a VISIBLE way back. That is why the host's workspace bar survives into
|
|
11
|
+
* expanded mode and why `workspaceOnScreen` and `expandedAfterWorkspaceChange` are two halves of
|
|
12
|
+
* one guarantee. Escape is a convenience, never the exit: a <webview> is a separate browsing
|
|
13
|
+
* context and does not bubble its keydowns out to this document, so a keyboard rule cannot be the
|
|
14
|
+
* thing the operator depends on.
|
|
15
|
+
*/
|
|
16
|
+
/** The one key that collapses expanded mode. Nothing else is an exit. */
|
|
17
|
+
export declare const COLLAPSE_KEY = "Escape";
|
|
18
|
+
/** The workspace bar's toggle: expanded mode's one deliberate on/off switch. */
|
|
19
|
+
export declare function nextExpanded({ expanded }: {
|
|
20
|
+
expanded: boolean;
|
|
21
|
+
}, _options?: {}): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Expanded state after a keydown lands in the host's own chrome.
|
|
24
|
+
*
|
|
25
|
+
* Escape collapses; every other key leaves the mode exactly as it was. Collapsing something already
|
|
26
|
+
* collapsed is a no-op — `expandedAfterKeyDown({ expanded: false, key: 'Escape' })` is `false` — which is what makes
|
|
27
|
+
* this safe to call for any key and from any state rather than only from inside the listener that
|
|
28
|
+
* is attached while expanded.
|
|
29
|
+
*/
|
|
30
|
+
export declare function expandedAfterKeyDown({ expanded, key }: {
|
|
31
|
+
expanded: boolean;
|
|
32
|
+
key: string;
|
|
33
|
+
}, _options?: {}): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Expanded state after the thing being expanded may have gone away.
|
|
36
|
+
*
|
|
37
|
+
* Expanded mode must never outlive its workspace. Closing the tab, deleting the project, or a
|
|
38
|
+
* host navigation call moving the nav elsewhere would otherwise leave the host's chrome hidden with
|
|
39
|
+
* nothing immersed in it and no way back — so a false `showSiteTab` collapses unconditionally,
|
|
40
|
+
* whatever the mode was.
|
|
41
|
+
*/
|
|
42
|
+
export declare function expandedAfterWorkspaceChange({ expanded, showSiteTab }: {
|
|
43
|
+
expanded: boolean;
|
|
44
|
+
showSiteTab: boolean;
|
|
45
|
+
}, _options?: {}): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether an open project's workspace is the one currently on screen.
|
|
48
|
+
*
|
|
49
|
+
* Load-bearing for expanded mode rather than merely cosmetic: the workspace bar lives inside that
|
|
50
|
+
* section, and the bar is the only chrome expanded mode leaves standing. A workspace that goes off
|
|
51
|
+
* screen takes the operator's way out with it, so this and `expandedAfterWorkspaceChange` have to
|
|
52
|
+
* agree — whenever expanded mode can be on, exactly one workspace must satisfy this.
|
|
53
|
+
*/
|
|
54
|
+
export declare function workspaceOnScreen(input: {
|
|
55
|
+
inSites: boolean;
|
|
56
|
+
projectId: string;
|
|
57
|
+
visibleWorkspaceId: string | null;
|
|
58
|
+
}): boolean;
|
|
59
|
+
/** Which pieces of the host's own chrome the shell renders. See `chromeVisibility`. */
|
|
60
|
+
export interface ChromeVisibility {
|
|
61
|
+
showTopNav: boolean;
|
|
62
|
+
showTabStrip: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Which pieces of the host's own chrome are on screen, given the current mode.
|
|
66
|
+
*
|
|
67
|
+
* Expanded mode's whole visible effect, in one place: the top nav and the tab strip go away so the
|
|
68
|
+
* active project's admin has the entire window. Nothing here can hide the workspace bar — that is
|
|
69
|
+
* deliberate, not an omission. The bar is the exit, so it is not this function's to take away.
|
|
70
|
+
*/
|
|
71
|
+
export declare function chromeVisibility(input: {
|
|
72
|
+
expanded: boolean;
|
|
73
|
+
inSites: boolean;
|
|
74
|
+
appearanceOpen: boolean;
|
|
75
|
+
}): ChromeVisibility;
|
|
76
|
+
//# sourceMappingURL=expanded-mode.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Immersive ("expanded") mode's decision rules, as plain functions.
|
|
3
|
+
*
|
|
4
|
+
* `useExpandedMode` owns the state; the host's shell component owns the JSX. Every RULE either one
|
|
5
|
+
* applies lives here instead, so it can be called with real inputs and asserted against directly.
|
|
6
|
+
* Rules in this shape are testable without a renderer; the identical rules inlined in an effect
|
|
7
|
+
* body or a JSX guard are not.
|
|
8
|
+
*
|
|
9
|
+
* The invariant every rule here serves: expanded mode hides the only navigation there is, so the
|
|
10
|
+
* operator must always keep a VISIBLE way back. That is why the host's workspace bar survives into
|
|
11
|
+
* expanded mode and why `workspaceOnScreen` and `expandedAfterWorkspaceChange` are two halves of
|
|
12
|
+
* one guarantee. Escape is a convenience, never the exit: a <webview> is a separate browsing
|
|
13
|
+
* context and does not bubble its keydowns out to this document, so a keyboard rule cannot be the
|
|
14
|
+
* thing the operator depends on.
|
|
15
|
+
*/
|
|
16
|
+
/** The one key that collapses expanded mode. Nothing else is an exit. */
|
|
17
|
+
export const COLLAPSE_KEY = 'Escape';
|
|
18
|
+
/** The workspace bar's toggle: expanded mode's one deliberate on/off switch. */
|
|
19
|
+
export function nextExpanded({ expanded }, _options = {}) {
|
|
20
|
+
return !expanded;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Expanded state after a keydown lands in the host's own chrome.
|
|
24
|
+
*
|
|
25
|
+
* Escape collapses; every other key leaves the mode exactly as it was. Collapsing something already
|
|
26
|
+
* collapsed is a no-op — `expandedAfterKeyDown({ expanded: false, key: 'Escape' })` is `false` — which is what makes
|
|
27
|
+
* this safe to call for any key and from any state rather than only from inside the listener that
|
|
28
|
+
* is attached while expanded.
|
|
29
|
+
*/
|
|
30
|
+
export function expandedAfterKeyDown({ expanded, key }, _options = {}) {
|
|
31
|
+
if (key === COLLAPSE_KEY)
|
|
32
|
+
return false;
|
|
33
|
+
return expanded;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Expanded state after the thing being expanded may have gone away.
|
|
37
|
+
*
|
|
38
|
+
* Expanded mode must never outlive its workspace. Closing the tab, deleting the project, or a
|
|
39
|
+
* host navigation call moving the nav elsewhere would otherwise leave the host's chrome hidden with
|
|
40
|
+
* nothing immersed in it and no way back — so a false `showSiteTab` collapses unconditionally,
|
|
41
|
+
* whatever the mode was.
|
|
42
|
+
*/
|
|
43
|
+
export function expandedAfterWorkspaceChange({ expanded, showSiteTab }, _options = {}) {
|
|
44
|
+
return showSiteTab ? expanded : false;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Whether an open project's workspace is the one currently on screen.
|
|
48
|
+
*
|
|
49
|
+
* Load-bearing for expanded mode rather than merely cosmetic: the workspace bar lives inside that
|
|
50
|
+
* section, and the bar is the only chrome expanded mode leaves standing. A workspace that goes off
|
|
51
|
+
* screen takes the operator's way out with it, so this and `expandedAfterWorkspaceChange` have to
|
|
52
|
+
* agree — whenever expanded mode can be on, exactly one workspace must satisfy this.
|
|
53
|
+
*/
|
|
54
|
+
export function workspaceOnScreen(input) {
|
|
55
|
+
return input.inSites && input.projectId === input.visibleWorkspaceId;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Which pieces of the host's own chrome are on screen, given the current mode.
|
|
59
|
+
*
|
|
60
|
+
* Expanded mode's whole visible effect, in one place: the top nav and the tab strip go away so the
|
|
61
|
+
* active project's admin has the entire window. Nothing here can hide the workspace bar — that is
|
|
62
|
+
* deliberate, not an omission. The bar is the exit, so it is not this function's to take away.
|
|
63
|
+
*/
|
|
64
|
+
export function chromeVisibility(input) {
|
|
65
|
+
return {
|
|
66
|
+
showTopNav: !input.expanded,
|
|
67
|
+
showTabStrip: input.inSites && !input.appearanceOpen && !input.expanded,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=expanded-mode.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { COLLAPSE_KEY, chromeVisibility, expandedAfterKeyDown, expandedAfterWorkspaceChange, nextExpanded, workspaceOnScreen, type ChromeVisibility } from './expanded-mode.js';
|
|
2
|
+
export { useExpandedMode, type KeydownTarget } from './use-expanded-mode.hooks.js';
|
|
3
|
+
export { dismissOnEscape, useDeleteConfirmation, type DeleteConfirmationState, type DescribeDeleteError, type EscapeTarget } from './use-delete-confirmation.hooks.js';
|
|
4
|
+
export { readStoredPreference, useThemePreference, type ColorSchemeMediaPort, type PreferenceStorage, type ThemePreferencePorts, type ThemeRoot } from './use-theme-preference.hooks.js';
|
|
5
|
+
export { AUTO_HIDE_MS, AUTO_HIDE_WITH_NOTE_MS, toastLifetime, useSiteToast, type SiteToast as SiteToastValue, type SiteToastCopy } from './use-site-toast.hooks.js';
|
|
6
|
+
export { SiteToast, type SiteToastClassNames, type SiteToastLabels, type SiteToastProps } from './SiteToast.js';
|
|
7
|
+
export { copyableDetails } from './copyable-details.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { COLLAPSE_KEY, chromeVisibility, expandedAfterKeyDown, expandedAfterWorkspaceChange, nextExpanded, workspaceOnScreen } from './expanded-mode.js';
|
|
2
|
+
export { useExpandedMode } from './use-expanded-mode.hooks.js';
|
|
3
|
+
export { dismissOnEscape, useDeleteConfirmation } from './use-delete-confirmation.hooks.js';
|
|
4
|
+
export { readStoredPreference, useThemePreference } from './use-theme-preference.hooks.js';
|
|
5
|
+
export { AUTO_HIDE_MS, AUTO_HIDE_WITH_NOTE_MS, toastLifetime, useSiteToast } from './use-site-toast.hooks.js';
|
|
6
|
+
export { SiteToast } from './SiteToast.js';
|
|
7
|
+
export { copyableDetails } from './copyable-details.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|