@jini-ai/ui 0.3.14 → 0.4.1
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/CHANGELOG.md +143 -0
- package/README.md +120 -26
- package/dist/browser/index.js +1 -1
- package/dist/browser/useDismissOnOutsideOrEscape.d.ts +10 -1
- package/dist/browser/useDismissOnOutsideOrEscape.js +7 -4
- package/dist/browser/useGlobalKeydown.d.ts +14 -2
- package/dist/browser/useGlobalKeydown.js +8 -17
- package/dist/features/a2ui/catalog-from-registry.d.ts +6 -3
- package/dist/features/a2ui/catalog-from-registry.js +1 -1
- package/dist/features/a2ui/index.d.ts +1 -1
- package/dist/features/a2ui/protocol.d.ts +1 -1
- package/dist/features/a2ui/renderer.js +23 -10
- package/dist/features/a2ui/use-a2ui-surface.d.ts +11 -6
- package/dist/features/a2ui/use-a2ui-surface.js +40 -10
- package/dist/features/admin-widgets/components/ComingSoonNotice.d.ts +11 -0
- package/dist/features/admin-widgets/components/ComingSoonNotice.js +7 -0
- package/dist/features/admin-widgets/components/ComingSoonPanel.d.ts +10 -0
- package/dist/features/admin-widgets/components/ComingSoonPanel.js +10 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.d.ts +16 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.hooks.d.ts +13 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.hooks.js +46 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.js +13 -0
- package/dist/features/admin-widgets/components/InfoTip.d.ts +18 -0
- package/dist/features/admin-widgets/components/InfoTip.hooks.d.ts +16 -0
- package/dist/features/admin-widgets/components/InfoTip.hooks.js +45 -0
- package/dist/features/admin-widgets/components/InfoTip.js +12 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.d.ts +41 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.hooks.d.ts +14 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.hooks.js +57 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +24 -0
- package/dist/features/admin-widgets/components/Select/Select.d.ts +39 -0
- package/dist/features/admin-widgets/components/Select/Select.hooks.d.ts +105 -0
- package/dist/features/admin-widgets/components/Select/Select.hooks.js +359 -0
- package/dist/features/admin-widgets/components/Select/Select.js +46 -0
- package/dist/features/admin-widgets/index.d.ts +20 -0
- package/dist/features/admin-widgets/index.js +11 -0
- package/dist/features/admin-widgets/styles/admin-widgets.css +2 -0
- package/dist/features/appearance/constants.d.ts +2 -2
- package/dist/features/appearance/constants.js +2 -1
- package/dist/features/appearance/react/components/AppearanceTab.js +5 -5
- package/dist/features/appearance/rules.d.ts +10 -4
- package/dist/features/appearance/rules.js +5 -5
- package/dist/features/appearance/types.d.ts +1 -1
- package/dist/features/appearance/types.js +1 -1
- package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
- package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
- package/dist/features/asset-grid/react/hooks/useAssetGridKeyboardShortcuts.js +23 -21
- package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.d.ts +1 -1
- package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.js +1 -1
- package/dist/features/asset-tree-browser/ports.d.ts +3 -1
- package/dist/features/asset-tree-browser/react/hooks/useAssetTreeCopyLocalPath.js +1 -1
- package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
- package/dist/features/browser-chrome/types.js +1 -1
- package/dist/features/command-palette/ports.js +1 -1
- package/dist/features/connectors/ConnectorsBrowser.js +2 -2
- package/dist/features/connectors/components/ConnectorCard.js +3 -3
- package/dist/features/connectors/components/ConnectorDetailDrawer.js +1 -1
- package/dist/features/connectors/components/ConnectorGrid.js +2 -2
- package/dist/features/connectors/components/ConnectorSearchBar.js +2 -2
- package/dist/features/connectors/components/ProviderTabBar.js +2 -2
- package/dist/features/connectors/constants.d.ts +1 -1
- package/dist/features/connectors/constants.js +1 -1
- package/dist/features/connectors/hooks/useConnectorAuthorization.js +1 -1
- package/dist/features/connectors/rules.d.ts +2 -2
- package/dist/features/connectors/rules.js +1 -1
- package/dist/features/connectors/types.d.ts +2 -2
- package/dist/features/connectors/types.js +1 -1
- package/dist/features/execution/react/components/ByokProviderForm.js +3 -3
- package/dist/features/execution/react/components/ExecutionTab.js +2 -2
- package/dist/features/execution/react/components/LocalCliAgentCard.js +3 -3
- package/dist/features/execution/react/components/LocalCliAgentList.js +2 -2
- package/dist/features/execution/react/components/ProviderChipGroup.js +2 -2
- package/dist/features/execution/react/components/SearchableModelSelect.js +1 -1
- package/dist/features/execution/rules.js +1 -1
- package/dist/features/file-dropzone/react/components/FileDropzone.js +5 -3
- package/dist/features/file-dropzone/react/hooks/useFileDropzone.d.ts +1 -1
- package/dist/features/file-dropzone/react/hooks/useFileDropzone.js +1 -1
- package/dist/features/file-dropzone/types.d.ts +1 -1
- package/dist/features/file-dropzone/types.js +1 -1
- package/dist/features/folder-path-drop/react/hooks/useFolderPathDropCapture.js +6 -4
- package/dist/features/html-editor/canvas-content-wrapper.js +1 -1
- package/dist/features/html-editor/canvas-embed-placeholders.js +7 -7
- package/dist/features/html-editor/canvas-style.d.ts +4 -0
- package/dist/features/html-editor/canvas-style.js +6 -21
- package/dist/features/html-viewer/constants.d.ts +1 -1
- package/dist/features/html-viewer/constants.js +1 -1
- package/dist/features/html-viewer/react/components/PresentMenu.js +1 -1
- package/dist/features/html-viewer/react/components/ZoomMenu.js +1 -1
- package/dist/features/html-viewer/types.d.ts +1 -1
- package/dist/features/html-viewer/types.js +1 -1
- package/dist/features/i18n/dictionaries/index.d.ts +2 -3
- package/dist/features/i18n/dictionaries/settings-dialog.en.d.ts +1 -1
- package/dist/features/i18n/dictionary-translator.d.ts +16 -0
- package/dist/features/i18n/dictionary-translator.js +14 -0
- package/dist/features/i18n/index.d.ts +3 -0
- package/dist/features/i18n/index.js +2 -0
- package/dist/features/i18n/locale.d.ts +1 -1
- package/dist/features/i18n/template-i18n.d.ts +26 -0
- package/dist/features/i18n/template-i18n.js +36 -0
- package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.d.ts +1 -1
- package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.js +1 -1
- package/dist/features/instructions/react/components/InstructionsTab.js +1 -1
- package/dist/features/integrations/react/components/ClientPicker.js +4 -4
- package/dist/features/integrations/react/components/CodexInstallToggleButton.js +1 -1
- package/dist/features/integrations/react/components/IntegrationsTab.js +2 -2
- package/dist/features/integrations/react/components/SnippetBlock.js +1 -1
- package/dist/features/integrations/types.d.ts +1 -1
- package/dist/features/integrations/types.js +1 -1
- package/dist/features/interactive-ui/index.js +13 -13
- package/dist/features/interactive-ui/interactive-ui.css +1 -1
- package/dist/features/interactive-ui/providers/recharts/bar-chart.js +1 -1
- package/dist/features/interactive-ui/providers/recharts/line-chart.js +1 -1
- package/dist/features/interactive-ui/providers/recharts/pie-chart.js +2 -2
- package/dist/features/interactive-ui/providers/shadcn/lib/utils.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/lib/utils.js +1 -1
- package/dist/features/interactive-ui/registry.d.ts +15 -4
- package/dist/features/interactive-ui/registry.js +5 -5
- package/dist/features/language/react/components/LanguageTab.js +2 -2
- package/dist/features/list-detail-panel/types.d.ts +1 -1
- package/dist/features/list-detail-panel/types.js +1 -1
- package/dist/features/mcp-ui/confirmation-store.js +2 -1
- package/dist/features/mcp-ui/surfaces/tokens.d.ts +17 -20
- package/dist/features/mcp-ui/surfaces/tokens.js +33 -35
- package/dist/features/media-providers/index.d.ts +1 -1
- package/dist/features/media-providers/index.js +1 -1
- package/dist/features/media-providers/react/components/MediaProvidersTab.js +4 -4
- package/dist/features/media-providers/rules.js +1 -1
- package/dist/features/memory/async-commit-guard.d.ts +1 -1
- package/dist/features/memory/constants.d.ts +1 -1
- package/dist/features/memory/constants.js +1 -1
- package/dist/features/memory/dependencies.d.ts +11 -23
- package/dist/features/memory/dependencies.js +116 -106
- package/dist/features/memory/index.d.ts +1 -1
- package/dist/features/memory/index.js +1 -1
- package/dist/features/memory/react/components/MemoryAdvancedModal.js +2 -2
- package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
- package/dist/features/memory/react/components/MemoryExtractionCard.js +1 -1
- package/dist/features/memory/react/components/MemoryHooksPanel.js +1 -1
- package/dist/features/memory/react/components/MemoryList.js +5 -5
- package/dist/features/memory/react/components/MemoryManualEditor.js +5 -5
- package/dist/features/memory/react/components/MemorySettingsPanel.js +1 -1
- package/dist/features/memory/react/hooks/useMemoryEntries.hooks.js +1 -1
- package/dist/features/memory/react/hooks/useMemoryNavigation.hooks.js +1 -1
- package/dist/features/memory/react/styles.js +1 -1
- package/dist/features/memory/rules.js +1 -1
- package/dist/features/memory/types.d.ts +1 -1
- package/dist/features/mention-autocomplete/react/hooks/useMentionAutocomplete.js +1 -1
- package/dist/features/notifications/react/components/NotificationsTab.js +7 -7
- package/dist/features/notifications/types.d.ts +1 -1
- package/dist/features/observability/boot-timing.js +2 -2
- package/dist/features/observability/stuck-run.js +1 -1
- package/dist/features/observability/white-screen.js +4 -4
- package/dist/features/panel-kit/fetch-query/adapter.react.d.ts +35 -0
- package/dist/features/panel-kit/fetch-query/adapter.react.js +122 -0
- package/dist/features/panel-kit/fetch-query/cache.d.ts +123 -0
- package/dist/features/panel-kit/fetch-query/cache.js +231 -0
- package/dist/features/panel-kit/fetch-query/environment.browser.d.ts +4 -0
- package/dist/features/panel-kit/fetch-query/environment.browser.js +25 -0
- package/dist/features/panel-kit/fetch-query/index.d.ts +4 -0
- package/dist/features/panel-kit/fetch-query/index.js +2 -0
- package/dist/features/panel-kit/fetch-query/types.d.ts +91 -0
- package/dist/features/panel-kit/fetch-query/types.js +2 -0
- package/dist/features/panel-kit/helpers/format-timestamp.d.ts +18 -0
- package/dist/features/panel-kit/helpers/format-timestamp.js +20 -0
- package/dist/features/panel-kit/helpers/permissions.d.ts +11 -0
- package/dist/features/panel-kit/helpers/permissions.js +10 -0
- package/dist/features/panel-kit/helpers/resolve-active-tab-id.d.ts +13 -0
- package/dist/features/panel-kit/helpers/resolve-active-tab-id.js +13 -0
- package/dist/features/panel-kit/helpers/retry-unreachable.d.ts +20 -0
- package/dist/features/panel-kit/helpers/retry-unreachable.js +39 -0
- package/dist/features/panel-kit/hooks/use-async-action.hooks.d.ts +13 -0
- package/dist/features/panel-kit/hooks/use-async-action.hooks.js +27 -0
- package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.d.ts +18 -0
- package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.js +33 -0
- package/dist/features/panel-kit/hooks/use-focus-trap.hooks.d.ts +11 -0
- package/dist/features/panel-kit/hooks/use-focus-trap.hooks.js +76 -0
- package/dist/features/panel-kit/hooks/use-serial-writes.hooks.d.ts +26 -0
- package/dist/features/panel-kit/hooks/use-serial-writes.hooks.js +41 -0
- package/dist/features/panel-kit/hooks/use-settlement-generation.hooks.d.ts +9 -0
- package/dist/features/panel-kit/hooks/use-settlement-generation.hooks.js +25 -0
- package/dist/features/panel-kit/index.d.ts +19 -0
- package/dist/features/panel-kit/index.js +13 -0
- package/dist/features/privacy/react/components/PrivacyTab.js +2 -2
- package/dist/features/privacy/types.d.ts +1 -1
- package/dist/features/privacy/types.js +1 -1
- package/dist/features/progress-card/reference-adapters.d.ts +1 -1
- package/dist/features/progress-card/rules.d.ts +1 -1
- package/dist/features/progress-card/rules.js +1 -1
- package/dist/features/progress-card/types.d.ts +1 -1
- package/dist/features/progress-card/types.js +1 -1
- package/dist/features/resource-dashboard/dependencies.d.ts +1 -1
- package/dist/features/resource-dashboard/ports.d.ts +1 -1
- package/dist/features/resource-dashboard/react/hooks/useResourceBoard.d.ts +1 -1
- package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +1 -1
- package/dist/features/resource-dashboard/rules.d.ts +1 -1
- package/dist/features/resource-dashboard/rules.js +2 -2
- package/dist/features/resource-dashboard/types.d.ts +4 -4
- package/dist/features/resource-dashboard/types.js +1 -1
- package/dist/features/schedule-picker/react/hooks/useRecurringSchedulePicker.js +1 -1
- package/dist/features/settings/dialog/styles/settings-dialog.css +62 -60
- package/dist/features/sketch-editor/constants.d.ts +1 -1
- package/dist/features/sketch-editor/constants.js +1 -1
- package/dist/features/sketch-editor/dom.d.ts +1 -1
- package/dist/features/sketch-editor/dom.js +1 -1
- package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.d.ts +1 -1
- package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.js +11 -9
- package/dist/features/sketch-editor/types.d.ts +1 -1
- package/dist/features/sketch-editor/types.js +1 -1
- package/dist/features/skills/react/components/SkillDraftForm.js +1 -1
- package/dist/features/skills/react/components/SkillRow.js +1 -1
- package/dist/features/skills/react/components/SkillsTab.js +2 -2
- package/dist/features/source-config-list/agent-handles.js +2 -2
- package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.d.ts +1 -1
- package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.js +1 -1
- package/dist/features/source-config-list/rules.d.ts +1 -1
- package/dist/features/source-config-list/rules.js +3 -3
- package/dist/features/source-config-list/types.d.ts +1 -1
- package/dist/features/source-config-list/types.js +1 -1
- package/dist/features/tab-launcher-menu/react/hooks/useTabLauncherMenu.js +1 -1
- package/dist/features/tab-strip/index.d.ts +4 -0
- package/dist/features/tab-strip/index.js +2 -0
- package/dist/features/tab-strip/react/components/TabBar.d.ts +23 -0
- package/dist/features/tab-strip/react/components/TabBar.hooks.d.ts +25 -0
- package/dist/features/tab-strip/react/components/TabBar.hooks.js +57 -0
- package/dist/features/tab-strip/react/components/TabBar.js +18 -0
- package/dist/features/tab-strip/react/components/TabStrip.js +2 -1
- package/dist/features/tab-strip/react/components/TabStripFrame.d.ts +3 -0
- package/dist/features/tab-strip/react/components/TabStripFrame.js +7 -0
- package/dist/features/tabbed-dialog/react/hooks/useTabbedDialog.js +1 -1
- package/dist/features/tabbed-dialog/styles/tabbed-dialog.css +8 -141
- package/dist/features/tabbed-dialog/types.d.ts +1 -1
- package/dist/features/tabbed-dialog/types.js +1 -1
- package/dist/features/version-manager/ports.d.ts +1 -1
- package/dist/features/version-manager/react/components/VersionPromptPopover.js +5 -3
- package/dist/features/version-manager/react/components/VersionRestoreControl.js +1 -1
- package/dist/features/version-manager/types.d.ts +1 -1
- package/dist/features/version-manager/types.js +1 -1
- package/dist/features/viewer-shell/dependencies.js +1 -1
- package/dist/features/viewer-shell/ports.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
- package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.d.ts +1 -1
- package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.js +1 -1
- package/dist/features/viewer-shell/types.d.ts +1 -1
- package/dist/features/viewer-shell/types.js +1 -1
- package/dist/index.d.ts +420 -0
- package/dist/index.js +421 -1
- package/dist/react/components/ComponentKitPreview.js +1 -1
- package/dist/react/components/EditorIcon.d.ts +1 -1
- package/dist/react/components/EditorIcon.js +22 -22
- package/dist/react/components/ExportDiagnosticsButton.d.ts +8 -1
- package/dist/react/components/ExportDiagnosticsButton.js +6 -6
- package/dist/react/components/PaletteTweaks.js +5 -5
- package/dist/react/hooks/useBrandFonts.d.ts +19 -4
- package/dist/react/hooks/useBrandFonts.js +11 -7
- package/dist/react/hooks/useDebouncedValue.d.ts +12 -1
- package/dist/react/hooks/useDebouncedValue.js +9 -4
- package/dist/react/hooks/useStableHandler.d.ts +3 -1
- package/dist/react/hooks/useStableHandler.js +1 -1
- package/dist/renderers/annotation-canvas/drawing.d.ts +4 -4
- package/dist/renderers/annotation-canvas/drawing.js +28 -15
- package/dist/renderers/annotation-canvas/react/components/AnnotationCanvas.js +2 -2
- package/dist/renderers/annotation-canvas/react/hooks/useAnnotationCanvas.js +4 -3
- package/dist/renderers/annotation-canvas/rules.d.ts +1 -1
- package/dist/renderers/annotation-canvas/theme.d.ts +13 -0
- package/dist/renderers/annotation-canvas/theme.js +16 -0
- package/dist/renderers/annotation-canvas/types.d.ts +1 -1
- package/dist/renderers/index.d.ts +1 -1
- package/dist/renderers/new-tab-preview.d.ts +3 -0
- package/dist/renderers/new-tab-preview.js +3 -1
- package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.d.ts +1 -1
- package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.js +1 -1
- package/dist/renderers/preview-modal-shell/rules.d.ts +1 -1
- package/dist/renderers/preview-modal-shell/types.d.ts +3 -3
- package/dist/renderers/preview-modal-shell/types.js +2 -2
- package/dist/renderers/react/components/ArtifactView.d.ts +1 -1
- package/dist/renderers/react/components/ArtifactView.js +1 -1
- package/dist/renderers/registry.d.ts +12 -6
- package/dist/renderers/registry.js +7 -9
- package/dist/renderers/renderers/html.js +2 -2
- package/dist/renderers/renderers/index.js +1 -1
- package/dist/renderers/renderers/markdown.js +2 -2
- package/dist/renderers/renderers/react-component.js +1 -1
- package/dist/renderers/renderers/svg.js +1 -1
- package/dist/renderers/shiki.js +1 -1
- package/dist/renderers/srcdoc/build.d.ts +1 -1
- package/dist/renderers/srcdoc/build.js +1 -1
- package/dist/renderers/url-load-decision.d.ts +1 -1
- package/dist/renderers/url-load-decision.js +1 -1
- package/dist/styles/admin.css +273 -0
- package/dist/styles/variables.css +117 -0
- package/dist/theme/apply.d.ts +9 -0
- package/dist/theme/apply.js +77 -0
- package/dist/theme/color-scheme.d.ts +8 -0
- package/dist/theme/color-scheme.js +9 -0
- package/dist/theme/default.d.ts +4 -0
- package/dist/theme/default.js +11 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.js +5 -0
- package/dist/theme/stylesheet.d.ts +8 -0
- package/dist/theme/stylesheet.js +14 -0
- package/dist/theme/types.d.ts +39 -0
- package/dist/theme/types.js +2 -0
- package/dist/theme/validation.d.ts +15 -0
- package/dist/theme/validation.js +55 -0
- package/dist/utils/appearance.js +1 -1
- package/dist/utils/browser-request.d.ts +12 -0
- package/dist/utils/browser-request.js +10 -0
- package/dist/utils/color-math.d.ts +20 -6
- package/dist/utils/color-math.js +12 -12
- package/dist/utils/copy-to-clipboard.d.ts +19 -8
- package/dist/utils/copy-to-clipboard.js +15 -11
- package/dist/utils/dom-subscriptions.js +1 -1
- package/dist/utils/endpoint-policy.d.ts +9 -3
- package/dist/utils/endpoint-policy.js +5 -5
- package/dist/utils/markdown-scroll-sync.js +3 -3
- package/dist/utils/notifications.d.ts +1 -1
- package/dist/utils/notifications.js +1 -1
- package/dist/utils/polygon-selection.d.ts +1 -1
- package/dist/utils/polygon-selection.js +1 -1
- package/dist/utils/scroll-tabs-with-wheel.d.ts +4 -1
- package/dist/utils/scroll-tabs-with-wheel.js +1 -1
- package/dist/utils/smooth-scroll-to-top.js +1 -1
- package/dist/utils/sse.d.ts +3 -1
- package/dist/utils/sse.js +1 -1
- package/package.json +105 -16
- package/dist/features/lexical-rich-text-editor/react/test-support/lexical-harness.d.ts +0 -11
- package/dist/features/lexical-rich-text-editor/react/test-support/lexical-harness.js +0 -35
|
@@ -38,7 +38,7 @@ export declare const DEFAULT_SKETCH_DARK_TOOL_COLOR = "#ffffff";
|
|
|
38
38
|
* Matches the Mermaid-dialog "Insert" button's rendered label (English
|
|
39
39
|
* only). The source product's own pattern also matched a hardcoded Chinese
|
|
40
40
|
* translation (`/^(Insert|插入)/i`) — dropped as real translated copy, not a
|
|
41
|
-
* mechanism (see `packages/ui/
|
|
41
|
+
* mechanism (see `packages/ui/archived provenance ledger`); a host running Excalidraw in
|
|
42
42
|
* a locale where this button's label differs should pass its own pattern via
|
|
43
43
|
* `SketchEditorProps.mermaidInsertLabelPattern`.
|
|
44
44
|
*/
|
|
@@ -96,7 +96,7 @@ export const DEFAULT_SKETCH_DARK_TOOL_COLOR = '#ffffff';
|
|
|
96
96
|
* Matches the Mermaid-dialog "Insert" button's rendered label (English
|
|
97
97
|
* only). The source product's own pattern also matched a hardcoded Chinese
|
|
98
98
|
* translation (`/^(Insert|插入)/i`) — dropped as real translated copy, not a
|
|
99
|
-
* mechanism (see `packages/ui/
|
|
99
|
+
* mechanism (see `packages/ui/archived provenance ledger`); a host running Excalidraw in
|
|
100
100
|
* a locale where this button's label differs should pass its own pattern via
|
|
101
101
|
* `SketchEditorProps.mermaidInsertLabelPattern`.
|
|
102
102
|
*/
|
|
@@ -21,7 +21,7 @@ export declare function applySketchContextMenuSimplification(root: HTMLElement,
|
|
|
21
21
|
* Walks `root`'s text nodes and a fixed set of text-bearing attributes,
|
|
22
22
|
* rewriting any that match `overrides`. `overrides` is entirely
|
|
23
23
|
* host-supplied — no translated copy ships as a default (see
|
|
24
|
-
* `packages/ui/
|
|
24
|
+
* `packages/ui/archived provenance ledger`).
|
|
25
25
|
*/
|
|
26
26
|
export declare function applySketchDomTextOverrides(root: ParentNode, overrides: SketchDomTextOverrides | undefined): void;
|
|
27
27
|
export declare function rewriteExcalidrawUnableToEmbedToasts(root: HTMLElement, replacement: string, additionalPhrases?: readonly string[]): void;
|
|
@@ -147,7 +147,7 @@ export function applySketchContextMenuSimplification(root, viewportRoot, allowLi
|
|
|
147
147
|
* Walks `root`'s text nodes and a fixed set of text-bearing attributes,
|
|
148
148
|
* rewriting any that match `overrides`. `overrides` is entirely
|
|
149
149
|
* host-supplied — no translated copy ships as a default (see
|
|
150
|
-
* `packages/ui/
|
|
150
|
+
* `packages/ui/archived provenance ledger`).
|
|
151
151
|
*/
|
|
152
152
|
export function applySketchDomTextOverrides(root, overrides) {
|
|
153
153
|
if (!overrides || Object.keys(overrides).length === 0 || typeof document === 'undefined')
|
|
@@ -4,7 +4,7 @@ export interface UseSketchDomEnhancementsParams {
|
|
|
4
4
|
containerRef: RefObject<HTMLElement | null>;
|
|
5
5
|
t: SketchTranslate;
|
|
6
6
|
/** Host-supplied translations for Excalidraw's own baked-in English UI
|
|
7
|
-
* text — no default translated copy ships (see `packages/ui/
|
|
7
|
+
* text — no default translated copy ships (see `packages/ui/archived provenance ledger`). */
|
|
8
8
|
domTextOverrides?: SketchDomTextOverrides | undefined;
|
|
9
9
|
tooltipTargets?: readonly SketchTooltipTarget[] | undefined;
|
|
10
10
|
contextMenuActionOrder?: readonly string[] | undefined;
|
|
@@ -61,16 +61,18 @@ export function useSketchDomEnhancements({ containerRef, t, domTextOverrides, to
|
|
|
61
61
|
// exact shape out of this hook. `useGlobalKeydown` re-reads its handler
|
|
62
62
|
// via a latest-ref internally, so passing a fresh closure each render is
|
|
63
63
|
// fine — no memoization needed here.
|
|
64
|
-
useGlobalKeydown(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
useGlobalKeydown({
|
|
65
|
+
handler: (event) => {
|
|
66
|
+
if (event.key !== 'Escape')
|
|
67
|
+
return;
|
|
68
|
+
if (!document.querySelector('.jini-sketch-modal .Modal'))
|
|
69
|
+
return;
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
onCloseActiveDialog();
|
|
73
|
+
},
|
|
72
74
|
}, { target: 'document', capture: true });
|
|
73
|
-
useGlobalKeydown((event) => handleSketchPortalCommandEnter(event, mermaidInsertLabelPattern), {
|
|
75
|
+
useGlobalKeydown({ handler: (event) => handleSketchPortalCommandEnter(event, mermaidInsertLabelPattern) }, {
|
|
74
76
|
target: 'document',
|
|
75
77
|
capture: true,
|
|
76
78
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Generic scene/toast/tooltip shapes for embedding an Excalidraw-backed
|
|
3
3
|
* sketch surface. Deliberately excludes any pre-Excalidraw legacy item
|
|
4
4
|
* format — that migration path is a host-product concern, not part of the
|
|
5
|
-
* generic shim. See `packages/ui/
|
|
5
|
+
* generic shim. See `packages/ui/archived provenance ledger` for provenance.
|
|
6
6
|
*/
|
|
7
7
|
/** A serializable Excalidraw scene: elements + sanitized app state + files. */
|
|
8
8
|
export interface SketchScene {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Generic scene/toast/tooltip shapes for embedding an Excalidraw-backed
|
|
3
3
|
* sketch surface. Deliberately excludes any pre-Excalidraw legacy item
|
|
4
4
|
* format — that migration path is a host-product concern, not part of the
|
|
5
|
-
* generic shim. See `packages/ui/
|
|
5
|
+
* generic shim. See `packages/ui/archived provenance ledger` for provenance.
|
|
6
6
|
*/
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=types.js.map
|
|
@@ -25,6 +25,6 @@ export function SkillDraftForm({ heading, subheading, draft, onDraftChange, erro
|
|
|
25
25
|
const bodyRequiredError = labels?.bodyRequiredError ?? t('Body is required.');
|
|
26
26
|
const submitLabel = saving ? savingLabel : isEdit ? (isBuiltInOverride ? overrideSaveLabel : saveLabel) : createLabel;
|
|
27
27
|
const errorText = error?.kind === 'name-required' ? nameRequiredError : error?.kind === 'body-required' ? bodyRequiredError : (error?.message ?? null);
|
|
28
|
-
return (_jsxs("div", { className: "jini-settings-subsection jini-skills-draft", "data-testid": isEdit ? 'skills-edit-form' : 'skills-create-form', children: [_jsx("div", { className: "jini-section-head", children: _jsxs("div", { children: [_jsx("h4", { children: heading }), subheading ? _jsx("p", { className: "jini-hint", children: subheading }) : null] }) }), _jsx("div", { className: "jini-settings-field", children: _jsxs("label", { children: [_jsx("span", { children: nameLabel }), _jsx("input", { type: "text", value: draft.name, onChange: (event) => onDraftChange((current) => ({ ...current, name: event.target.value })), placeholder: namePlaceholder, disabled: isEdit, ...agentHandleProps(agentHandle, { action: 'name', role: 'field', label: nameLabel }) })] }) }), _jsx("div", { className: "jini-settings-field", children: _jsxs("label", { children: [_jsx("span", { children: triggersLabel }), _jsx("input", { type: "text", value: draft.triggers, onChange: (event) => onDraftChange((current) => ({ ...current, triggers: event.target.value })), placeholder: triggersPlaceholder, ...agentHandleProps(agentHandle, { action: 'triggers', role: 'field', label: triggersLabel }) })] }) }), _jsx("div", { className: "jini-settings-field", children: _jsxs("label", { children: [_jsx("span", { children: descriptionLabel }), _jsx("textarea", { rows: 2, value: draft.description, onChange: (event) => onDraftChange((current) => ({ ...current, description: event.target.value })), placeholder: descriptionPlaceholder, ...agentHandleProps(agentHandle, { action: 'description', role: 'field', label: descriptionLabel }) })] }) }), _jsx("div", { className: "jini-settings-field", children: _jsxs("label", { children: [_jsx("span", { children: bodyLabel }), _jsx("textarea", { rows: 14, value: draft.body, onChange: (event) => onDraftChange((current) => ({ ...current, body: event.target.value })), placeholder: bodyPlaceholder, ...agentHandleProps(agentHandle, { action: 'body', role: 'field', label: bodyLabel }) })] }) }), errorText ? (_jsx("p", { className: "jini-hint jini-hint-error", role: "alert", children: errorText })) : null, _jsxs("div", { className: "jini-skills-draft-actions", children: [_jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onCancel, disabled: saving, ...agentHandleProps(agentHandle, { action: 'cancel', role: 'button', label: cancelLabel }), children: cancelLabel }), _jsx("button", { type: "button", className: "jini-button jini-button-primary", onClick: onSubmit, disabled: saving, "data-testid": "skills-save", ...agentHandleProps(agentHandle, { action: 'submit', role: 'button', label: submitLabel }), children: submitLabel })] })] }));
|
|
28
|
+
return (_jsxs("div", { className: "jini-settings-subsection jini-skills-draft", "data-testid": isEdit ? 'skills-edit-form' : 'skills-create-form', children: [_jsx("div", { className: "jini-section-head", children: _jsxs("div", { children: [_jsx("h4", { children: heading }), subheading ? _jsx("p", { className: "jini-hint", children: subheading }) : null] }) }), _jsx("div", { className: "jini-settings-field", children: _jsxs("label", { children: [_jsx("span", { children: nameLabel }), _jsx("input", { type: "text", value: draft.name, onChange: (event) => onDraftChange((current) => ({ ...current, name: event.target.value })), placeholder: namePlaceholder, disabled: isEdit, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'name', role: 'field', label: nameLabel }) }) })] }) }), _jsx("div", { className: "jini-settings-field", children: _jsxs("label", { children: [_jsx("span", { children: triggersLabel }), _jsx("input", { type: "text", value: draft.triggers, onChange: (event) => onDraftChange((current) => ({ ...current, triggers: event.target.value })), placeholder: triggersPlaceholder, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'triggers', role: 'field', label: triggersLabel }) }) })] }) }), _jsx("div", { className: "jini-settings-field", children: _jsxs("label", { children: [_jsx("span", { children: descriptionLabel }), _jsx("textarea", { rows: 2, value: draft.description, onChange: (event) => onDraftChange((current) => ({ ...current, description: event.target.value })), placeholder: descriptionPlaceholder, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'description', role: 'field', label: descriptionLabel }) }) })] }) }), _jsx("div", { className: "jini-settings-field", children: _jsxs("label", { children: [_jsx("span", { children: bodyLabel }), _jsx("textarea", { rows: 14, value: draft.body, onChange: (event) => onDraftChange((current) => ({ ...current, body: event.target.value })), placeholder: bodyPlaceholder, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'body', role: 'field', label: bodyLabel }) }) })] }) }), errorText ? (_jsx("p", { className: "jini-hint jini-hint-error", role: "alert", children: errorText })) : null, _jsxs("div", { className: "jini-skills-draft-actions", children: [_jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onCancel, disabled: saving, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'cancel', role: 'button', label: cancelLabel }) }), children: cancelLabel }), _jsx("button", { type: "button", className: "jini-button jini-button-primary", onClick: onSubmit, disabled: saving, "data-testid": "skills-save", ...agentHandleProps({}, { base: agentHandle, ...({ action: 'submit', role: 'button', label: submitLabel }) }), children: submitLabel })] })] }));
|
|
29
29
|
}
|
|
30
30
|
//# sourceMappingURL=SkillDraftForm.js.map
|
|
@@ -30,6 +30,6 @@ export function SkillRow({ skill, locale, enabled, expanded, editing, body, body
|
|
|
30
30
|
const bodyHeading = labels?.bodyHeading ?? t('SKILL.md');
|
|
31
31
|
const userBadge = labels?.userBadge ?? t('user');
|
|
32
32
|
const overrideWarning = labels?.overrideWarning ?? t('This skill ships with the host. Editing it creates your own copy — the original is unaffected.');
|
|
33
|
-
return (_jsxs("div", { className: `jini-skills-row${enabled ? '' : ' jini-skills-row-disabled'}${expanded ? ' jini-skills-row-expanded' : ''}`, "data-testid": `skill-row-${skill.id}`, children: [_jsxs("div", { className: "jini-skills-row-head", children: [_jsxs("button", { type: "button", className: "jini-skills-row-summary-btn", onClick: onToggleExpanded, "aria-expanded": expanded, title: expanded ? collapseLabel : expandLabel, ...agentHandleProps(agentHandle, { action: 'expand', role: 'button', label: name }), children: [_jsx(Icon, { name: "puzzle", size: 14, "aria-hidden": "true" }), _jsxs("span", { className: "jini-skills-row-summary", children: [_jsxs("span", { className: "jini-skills-row-summary-line", children: [_jsx("strong", { children: name }), _jsx("span", { className: "jini-skills-row-summary-mode", children: skill.mode }), skill.category ? (_jsx("span", { className: "jini-skills-row-summary-category", title: humanizeSkillCategory(skill.category), children: humanizeSkillCategory(skill.category) })) : null, skill.source === 'user' ? _jsx("span", { className: "jini-skills-row-summary-source", children: userBadge }) : null] }), description ? _jsx("span", { className: "jini-hint", children: description }) : null] }), _jsx(Icon, { name: "chevron-down", size: 14, "aria-hidden": "true" })] }), _jsxs("div", { className: "jini-skills-row-actions", children: [canDelete && confirmDelete ? (_jsxs("span", { className: "jini-skills-delete-confirm", role: "group", children: [_jsx("button", { type: "button", className: "jini-button jini-button-danger", onClick: onCommitDelete, "data-testid": "skills-delete-confirm", ...agentHandleProps(agentHandle, { action: 'delete-confirm', role: 'button', label: deleteConfirmLabel }), children: deleteConfirmLabel }), _jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onCancelDelete, ...agentHandleProps(agentHandle, { action: 'delete-cancel', role: 'button', label: cancelLabel }), children: cancelLabel })] })) : (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onStartEdit, "aria-label": builtIn ? overrideCreateLabel : editLabel, title: builtIn ? overrideCreateLabel : editLabel, "data-testid": "skills-edit", ...agentHandleProps(agentHandle, { action: 'edit', role: 'button', label: builtIn ? overrideCreateLabel : editLabel }), children: _jsx(Icon, { name: "edit", size: 13 }) }), canDelete ? (_jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onArmDelete, "aria-label": deleteLabel, title: deleteLabel, "data-testid": "skills-delete", ...agentHandleProps(agentHandle, { action: 'delete', role: 'button', label: deleteLabel }), children: _jsx(Icon, { name: "close", size: 13 }) })) : null] })), _jsxs("label", { className: "toggle-switch toggle-switch-sm jini-skills-row-enable", title: enableToggleLabel, children: [_jsx("input", { type: "checkbox", checked: enabled, onChange: (event) => onToggleEnabled(event.target.checked), "aria-label": enableToggleLabel, ...agentHandleProps(agentHandle, { action: 'enabled', role: 'checkbox', label: enableToggleLabel }) }), _jsx("span", { className: "toggle-slider" })] })] })] }), confirmBuiltInEdit ? (_jsxs("div", { className: "jini-empty-card jini-empty-card-warning", role: "alert", "data-testid": "skills-edit-builtin-warning", children: [_jsx("p", { children: overrideWarning }), _jsxs("div", { className: "jini-skills-draft-actions", children: [_jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onCancelBuiltInEdit, "data-testid": "skills-edit-builtin-cancel", ...agentHandleProps(agentHandle, { action: 'builtin-edit-cancel', role: 'button', label: cancelLabel }), children: cancelLabel }), _jsx("button", { type: "button", className: "jini-button jini-button-primary", onClick: onConfirmBuiltInEdit, "data-testid": "skills-edit-builtin-confirm", ...agentHandleProps(agentHandle, { action: 'builtin-edit-confirm', role: 'button', label: overrideCreateLabel }), children: overrideCreateLabel })] })] })) : null, expanded && !editing ? (_jsxs("div", { className: "jini-skills-row-detail", children: [_jsxs("div", { className: "jini-settings-subsection", children: [_jsx("h5", { children: bodyHeading }), bodyLoading ? _jsx("p", { className: "jini-hint", children: loadingLabel }) : _jsx("pre", { className: "jini-skills-body-preview", children: body ?? '' })] }), _jsxs("div", { className: "jini-settings-subsection", children: [_jsx("h5", { children: filesHeading }), filesLoading ? (_jsx("p", { className: "jini-hint", children: loadingLabel })) : !files || files.length === 0 ? (_jsx("p", { className: "jini-hint", children: noFilesLabel })) : (_jsx("ul", { className: "jini-skills-file-tree", children: files.map((entry) => (_jsxs("li", { className: "jini-skills-file-entry", style: { paddingLeft: skillFileTreeIndent(entry.path) }, children: [_jsx(Icon, { name: entry.kind === 'directory' ? 'folder' : 'file', size: 12 }), _jsx("span", { children: skillFileLeafName(entry.path) }), entry.kind === 'file' && typeof entry.size === 'number' ? (_jsx("span", { className: "jini-hint", children: formatSkillFileSize(entry.size) })) : null] }, entry.path))) }))] })] })) : null, editing && draft ? (_jsx(SkillDraftForm, { heading: builtIn ? overrideCreateLabel : editLabel, subheading: skill.id, draft: draft, onDraftChange: onDraftChange, error: draftError, saving: draftSaving, isEdit: true, isBuiltInOverride: builtIn, onCancel: onCancelEdit, onSubmit: onSubmitEdit, labels: labels, ...(agentHandle ? { agentHandle: agentSubHandle(agentHandle, 'edit-form') } : {}) })) : null] }));
|
|
33
|
+
return (_jsxs("div", { className: `jini-skills-row${enabled ? '' : ' jini-skills-row-disabled'}${expanded ? ' jini-skills-row-expanded' : ''}`, "data-testid": `skill-row-${skill.id}`, children: [_jsxs("div", { className: "jini-skills-row-head", children: [_jsxs("button", { type: "button", className: "jini-skills-row-summary-btn", onClick: onToggleExpanded, "aria-expanded": expanded, title: expanded ? collapseLabel : expandLabel, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'expand', role: 'button', label: name }) }), children: [_jsx(Icon, { name: "puzzle", size: 14, "aria-hidden": "true" }), _jsxs("span", { className: "jini-skills-row-summary", children: [_jsxs("span", { className: "jini-skills-row-summary-line", children: [_jsx("strong", { children: name }), _jsx("span", { className: "jini-skills-row-summary-mode", children: skill.mode }), skill.category ? (_jsx("span", { className: "jini-skills-row-summary-category", title: humanizeSkillCategory(skill.category), children: humanizeSkillCategory(skill.category) })) : null, skill.source === 'user' ? _jsx("span", { className: "jini-skills-row-summary-source", children: userBadge }) : null] }), description ? _jsx("span", { className: "jini-hint", children: description }) : null] }), _jsx(Icon, { name: "chevron-down", size: 14, "aria-hidden": "true" })] }), _jsxs("div", { className: "jini-skills-row-actions", children: [canDelete && confirmDelete ? (_jsxs("span", { className: "jini-skills-delete-confirm", role: "group", children: [_jsx("button", { type: "button", className: "jini-button jini-button-danger", onClick: onCommitDelete, "data-testid": "skills-delete-confirm", ...agentHandleProps({}, { base: agentHandle, ...({ action: 'delete-confirm', role: 'button', label: deleteConfirmLabel }) }), children: deleteConfirmLabel }), _jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onCancelDelete, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'delete-cancel', role: 'button', label: cancelLabel }) }), children: cancelLabel })] })) : (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onStartEdit, "aria-label": builtIn ? overrideCreateLabel : editLabel, title: builtIn ? overrideCreateLabel : editLabel, "data-testid": "skills-edit", ...agentHandleProps({}, { base: agentHandle, ...({ action: 'edit', role: 'button', label: builtIn ? overrideCreateLabel : editLabel }) }), children: _jsx(Icon, { name: "edit", size: 13 }) }), canDelete ? (_jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onArmDelete, "aria-label": deleteLabel, title: deleteLabel, "data-testid": "skills-delete", ...agentHandleProps({}, { base: agentHandle, ...({ action: 'delete', role: 'button', label: deleteLabel }) }), children: _jsx(Icon, { name: "close", size: 13 }) })) : null] })), _jsxs("label", { className: "toggle-switch toggle-switch-sm jini-skills-row-enable", title: enableToggleLabel, children: [_jsx("input", { type: "checkbox", checked: enabled, onChange: (event) => onToggleEnabled(event.target.checked), "aria-label": enableToggleLabel, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'enabled', role: 'checkbox', label: enableToggleLabel }) }) }), _jsx("span", { className: "toggle-slider" })] })] })] }), confirmBuiltInEdit ? (_jsxs("div", { className: "jini-empty-card jini-empty-card-warning", role: "alert", "data-testid": "skills-edit-builtin-warning", children: [_jsx("p", { children: overrideWarning }), _jsxs("div", { className: "jini-skills-draft-actions", children: [_jsx("button", { type: "button", className: "jini-button jini-button-ghost", onClick: onCancelBuiltInEdit, "data-testid": "skills-edit-builtin-cancel", ...agentHandleProps({}, { base: agentHandle, ...({ action: 'builtin-edit-cancel', role: 'button', label: cancelLabel }) }), children: cancelLabel }), _jsx("button", { type: "button", className: "jini-button jini-button-primary", onClick: onConfirmBuiltInEdit, "data-testid": "skills-edit-builtin-confirm", ...agentHandleProps({}, { base: agentHandle, ...({ action: 'builtin-edit-confirm', role: 'button', label: overrideCreateLabel }) }), children: overrideCreateLabel })] })] })) : null, expanded && !editing ? (_jsxs("div", { className: "jini-skills-row-detail", children: [_jsxs("div", { className: "jini-settings-subsection", children: [_jsx("h5", { children: bodyHeading }), bodyLoading ? _jsx("p", { className: "jini-hint", children: loadingLabel }) : _jsx("pre", { className: "jini-skills-body-preview", children: body ?? '' })] }), _jsxs("div", { className: "jini-settings-subsection", children: [_jsx("h5", { children: filesHeading }), filesLoading ? (_jsx("p", { className: "jini-hint", children: loadingLabel })) : !files || files.length === 0 ? (_jsx("p", { className: "jini-hint", children: noFilesLabel })) : (_jsx("ul", { className: "jini-skills-file-tree", children: files.map((entry) => (_jsxs("li", { className: "jini-skills-file-entry", style: { paddingLeft: skillFileTreeIndent(entry.path) }, children: [_jsx(Icon, { name: entry.kind === 'directory' ? 'folder' : 'file', size: 12 }), _jsx("span", { children: skillFileLeafName(entry.path) }), entry.kind === 'file' && typeof entry.size === 'number' ? (_jsx("span", { className: "jini-hint", children: formatSkillFileSize(entry.size) })) : null] }, entry.path))) }))] })] })) : null, editing && draft ? (_jsx(SkillDraftForm, { heading: builtIn ? overrideCreateLabel : editLabel, subheading: skill.id, draft: draft, onDraftChange: onDraftChange, error: draftError, saving: draftSaving, isEdit: true, isBuiltInOverride: builtIn, onCancel: onCancelEdit, onSubmit: onSubmitEdit, labels: labels, ...(agentHandle ? { agentHandle: agentSubHandle({ base: agentHandle, action: 'edit-form' }) } : {}) })) : null] }));
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=SkillRow.js.map
|
|
@@ -26,9 +26,9 @@ export function SkillsTab({ port, disabledSkillIds, onToggleEnabled, locale = 'e
|
|
|
26
26
|
const noResultsLabel = labels?.noResultsLabel ?? t('No skills match these filters.');
|
|
27
27
|
const loadErrorLabel = labels?.loadErrorLabel ?? t('Could not load skills: {error}', { error: loadError ?? '' });
|
|
28
28
|
const rowHandles = agentHandle
|
|
29
|
-
? buildAgentListHandles(agentSubHandle(agentHandle, 'skill'), filteredSkills.map((skill) => skill.id))
|
|
29
|
+
? buildAgentListHandles({ prefix: agentSubHandle({ base: agentHandle, action: 'skill' }), ids: filteredSkills.map((skill) => skill.id) })
|
|
30
30
|
: undefined;
|
|
31
|
-
return (_jsxs("section", { className: "jini-settings-section jini-settings-skills", children: [_jsxs("div", { className: "jini-skills-toolbar", children: [_jsxs("div", { className: "jini-skills-toolbar-top", children: [_jsx("input", { type: "search", className: "jini-skills-search", placeholder: searchPlaceholder, value: filters.search, onChange: (event) => setSearch(event.target.value), "aria-label": searchPlaceholder, ...agentHandleProps(agentHandle, { action: 'search', role: 'field', label: searchPlaceholder }) }), _jsxs("button", { type: "button", className: "jini-button jini-button-primary", onClick: startCreate, "data-testid": "skills-new", ...agentHandleProps(agentHandle, { action: 'new', role: 'button', label: newSkillLabel }), children: [_jsx(Icon, { name: "plus", size: 13 }), _jsx("span", { children: newSkillLabel })] })] }), _jsxs("div", { className: "jini-skills-filter-selects", children: [_jsxs("label", { className: "jini-skills-filter-select", children: [_jsx("span", { children: sourceFilterLabel }), _jsxs("select", { value: filters.source, onChange: (event) => setSourceFilter(event.target.value), ...agentHandleProps(agentHandle, { action: 'filter-source', role: 'field', label: sourceFilterLabel }), children: [_jsxs("option", { value: "all", children: [allLabel, " (", sourceOptions.all, ")"] }), sourceOptions.options.map(([value, count]) => (_jsxs("option", { value: value, children: [value, " (", count, ")"] }, value)))] })] }), _jsxs("label", { className: "jini-skills-filter-select", children: [_jsx("span", { children: modeFilterLabel }), _jsxs("select", { value: filters.mode, onChange: (event) => setModeFilter(event.target.value), ...agentHandleProps(agentHandle, { action: 'filter-mode', role: 'field', label: modeFilterLabel }), children: [_jsxs("option", { value: "all", children: [allLabel, " (", modeOptions.all, ")"] }), modeOptions.options.map(([value, count]) => (_jsxs("option", { value: value, children: [value, " (", count, ")"] }, value)))] })] }), categoryOptions ? (_jsxs("label", { className: "jini-skills-filter-select", "data-testid": "skills-category-filters", children: [_jsx("span", { children: categoryFilterLabel }), _jsxs("select", { value: filters.category, onChange: (event) => setCategoryFilter(event.target.value), ...agentHandleProps(agentHandle, { action: 'filter-category', role: 'field', label: categoryFilterLabel }), children: [_jsxs("option", { value: "all", children: [allLabel, " (", categoryOptions.all, ")"] }), categoryOptions.options.map(([value, count]) => (_jsxs("option", { value: value, children: [humanizeSkillCategory(value), " (", count, ")"] }, value)))] })] })) : null] })] }), loadError ? (_jsx("div", { className: "jini-empty-card jini-empty-card-error", children: _jsx("strong", { children: loadErrorLabel }) })) : null, creating ? (_jsx(SkillDraftForm, { heading: newSkillLabel, draft: draft, onDraftChange: setDraft, error: draftError, saving: draftSaving, isEdit: false, onCancel: cancelDraft, onSubmit: submitDraft, labels: labels, ...(agentHandle ? { agentHandle: agentSubHandle(agentHandle, 'create-form') } : {}) })) : null, !loading && filteredSkills.length === 0 ? (_jsx("div", { className: "jini-empty-card", children: _jsx("strong", { children: noResultsLabel }) })) : (_jsx("div", { className: "jini-skills-rows", "data-testid": "skills-list", children: filteredSkills.map((skill, index) => {
|
|
31
|
+
return (_jsxs("section", { className: "jini-settings-section jini-settings-skills", children: [_jsxs("div", { className: "jini-skills-toolbar", children: [_jsxs("div", { className: "jini-skills-toolbar-top", children: [_jsx("input", { type: "search", className: "jini-skills-search", placeholder: searchPlaceholder, value: filters.search, onChange: (event) => setSearch(event.target.value), "aria-label": searchPlaceholder, ...agentHandleProps({}, { base: agentHandle, ...({ action: 'search', role: 'field', label: searchPlaceholder }) }) }), _jsxs("button", { type: "button", className: "jini-button jini-button-primary", onClick: startCreate, "data-testid": "skills-new", ...agentHandleProps({}, { base: agentHandle, ...({ action: 'new', role: 'button', label: newSkillLabel }) }), children: [_jsx(Icon, { name: "plus", size: 13 }), _jsx("span", { children: newSkillLabel })] })] }), _jsxs("div", { className: "jini-skills-filter-selects", children: [_jsxs("label", { className: "jini-skills-filter-select", children: [_jsx("span", { children: sourceFilterLabel }), _jsxs("select", { value: filters.source, onChange: (event) => setSourceFilter(event.target.value), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'filter-source', role: 'field', label: sourceFilterLabel }) }), children: [_jsxs("option", { value: "all", children: [allLabel, " (", sourceOptions.all, ")"] }), sourceOptions.options.map(([value, count]) => (_jsxs("option", { value: value, children: [value, " (", count, ")"] }, value)))] })] }), _jsxs("label", { className: "jini-skills-filter-select", children: [_jsx("span", { children: modeFilterLabel }), _jsxs("select", { value: filters.mode, onChange: (event) => setModeFilter(event.target.value), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'filter-mode', role: 'field', label: modeFilterLabel }) }), children: [_jsxs("option", { value: "all", children: [allLabel, " (", modeOptions.all, ")"] }), modeOptions.options.map(([value, count]) => (_jsxs("option", { value: value, children: [value, " (", count, ")"] }, value)))] })] }), categoryOptions ? (_jsxs("label", { className: "jini-skills-filter-select", "data-testid": "skills-category-filters", children: [_jsx("span", { children: categoryFilterLabel }), _jsxs("select", { value: filters.category, onChange: (event) => setCategoryFilter(event.target.value), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'filter-category', role: 'field', label: categoryFilterLabel }) }), children: [_jsxs("option", { value: "all", children: [allLabel, " (", categoryOptions.all, ")"] }), categoryOptions.options.map(([value, count]) => (_jsxs("option", { value: value, children: [humanizeSkillCategory(value), " (", count, ")"] }, value)))] })] })) : null] })] }), loadError ? (_jsx("div", { className: "jini-empty-card jini-empty-card-error", children: _jsx("strong", { children: loadErrorLabel }) })) : null, creating ? (_jsx(SkillDraftForm, { heading: newSkillLabel, draft: draft, onDraftChange: setDraft, error: draftError, saving: draftSaving, isEdit: false, onCancel: cancelDraft, onSubmit: submitDraft, labels: labels, ...(agentHandle ? { agentHandle: agentSubHandle({ base: agentHandle, action: 'create-form' }) } : {}) })) : null, !loading && filteredSkills.length === 0 ? (_jsx("div", { className: "jini-empty-card", children: _jsx("strong", { children: noResultsLabel }) })) : (_jsx("div", { className: "jini-skills-rows", "data-testid": "skills-list", children: filteredSkills.map((skill, index) => {
|
|
32
32
|
const isExpanded = expandedId === skill.id;
|
|
33
33
|
const isEditing = editingId === skill.id;
|
|
34
34
|
return (_jsx(SkillRow, { ...(rowHandles?.[index] ? { agentHandle: rowHandles[index] } : {}), skill: skill, locale: locale, enabled: !disabledSkillIds.has(skill.id), expanded: isExpanded, editing: isEditing, body: bodyById[skill.id], bodyLoading: bodyLoadingId === skill.id, files: filesById[skill.id] ?? null, filesLoading: filesLoadingId === skill.id, confirmDelete: confirmDeleteId === skill.id, confirmBuiltInEdit: confirmBuiltInEditId === skill.id, draft: isEditing ? draft : null, draftError: isEditing ? draftError : null, draftSaving: isEditing && draftSaving, onDraftChange: setDraft, onToggleExpanded: () => toggleExpanded(skill.id), onToggleEnabled: (enabled) => onToggleEnabled(skill.id, enabled), onStartEdit: () => requestEdit(skill), onConfirmBuiltInEdit: confirmBuiltInEdit, onCancelBuiltInEdit: cancelBuiltInEdit, onArmDelete: () => armDelete(skill.id), onCancelDelete: cancelDelete, onCommitDelete: () => commitDelete(skill.id), onCancelEdit: cancelDraft, onSubmitEdit: submitDraft, labels: labels }, skill.id));
|
|
@@ -127,7 +127,7 @@ export function sourceConfigAddFormHandle(listBase) {
|
|
|
127
127
|
* @complexity See {@link buildAgentListHandles}.
|
|
128
128
|
*/
|
|
129
129
|
export function sourceConfigItemHandles(listBase, sourceIds) {
|
|
130
|
-
return buildAgentListHandles(`${listBase}${HANDLE_SEPARATOR}${LIST_ITEM_NAMESPACE}`, sourceIds);
|
|
130
|
+
return buildAgentListHandles({ prefix: `${listBase}${HANDLE_SEPARATOR}${LIST_ITEM_NAMESPACE}`, ids: sourceIds });
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* Builds the `data-agent-*` attribute props for one sub-element, or nothing at all when the host
|
|
@@ -146,6 +146,6 @@ export function sourceConfigAgentProps(base, options) {
|
|
|
146
146
|
if (base === undefined)
|
|
147
147
|
return {};
|
|
148
148
|
const handle = options.action === undefined ? base : sourceConfigActionHandle(base, options.action);
|
|
149
|
-
return agentHandle(handle, { role: options.role, label: options.label });
|
|
149
|
+
return agentHandle({ handle: handle }, { ...(options.role === undefined ? {} : { role: options.role }), ...(options.label === undefined ? {} : { label: options.label }) });
|
|
150
150
|
}
|
|
151
151
|
//# sourceMappingURL=agent-handles.js.map
|
|
@@ -26,7 +26,7 @@ export interface SourceConfigAddFormController {
|
|
|
26
26
|
* `PluginsView.tsx`'s `SourcesPanel`/`ConnectorsBrowser.tsx`'s "add
|
|
27
27
|
* immediately on submit" shape rather than `McpClientSection.tsx`'s
|
|
28
28
|
* draft-rows-with-a-separate-bulk-Save-button pattern — see
|
|
29
|
-
* `packages/ui/
|
|
29
|
+
* `packages/ui/archived provenance ledger` for why that behavior was not ported.
|
|
30
30
|
*/
|
|
31
31
|
export declare function useSourceConfigAddForm<TSource extends SourceConfigItem>(params: UseSourceConfigAddFormParams<TSource>): SourceConfigAddFormController;
|
|
32
32
|
export type UseWiredSourceConfigAddFormParams<TSource extends SourceConfigItem> = Omit<UseSourceConfigAddFormParams<TSource>, 'port'> & {
|
|
@@ -7,7 +7,7 @@ import { emptySourceDraft, validateSourceDraft } from '../../rules.js';
|
|
|
7
7
|
* `PluginsView.tsx`'s `SourcesPanel`/`ConnectorsBrowser.tsx`'s "add
|
|
8
8
|
* immediately on submit" shape rather than `McpClientSection.tsx`'s
|
|
9
9
|
* draft-rows-with-a-separate-bulk-Save-button pattern — see
|
|
10
|
-
* `packages/ui/
|
|
10
|
+
* `packages/ui/archived provenance ledger` for why that behavior was not ported.
|
|
11
11
|
*/
|
|
12
12
|
export function useSourceConfigAddForm(params) {
|
|
13
13
|
const { port, fieldSpecs, onAdded } = params;
|
|
@@ -8,7 +8,7 @@ export declare function emptySourceDraft(fieldSpecs: readonly SourceFieldSpec[])
|
|
|
8
8
|
* `PluginsView.tsx`'s marketplace-URL add flow). Protocol-specific API-key
|
|
9
9
|
* shape validation (the origin `byok/validation.ts`'s Anthropic/OpenAI/
|
|
10
10
|
* Google key-format detection) is deliberately NOT ported here — see
|
|
11
|
-
* `
|
|
11
|
+
* `archived provenance ledger`'s dropped-behavior list; a host that needs it supplies its
|
|
12
12
|
* own extra validation before calling `addSource`.
|
|
13
13
|
*
|
|
14
14
|
* **Applies to the EDIT path as well as the add path.** That was once true only
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure logic for the generic source-config-list primitive. No React, no
|
|
3
|
-
* transport, no DOM — see `packages/ui/
|
|
3
|
+
* transport, no DOM — see `packages/ui/archived provenance ledger` for full provenance.
|
|
4
4
|
*/
|
|
5
5
|
import { isAllowedEndpointUrl } from '../../utils/endpoint-policy.js';
|
|
6
6
|
import { MASK_CHAR, MASKED_VALUE_MIN_MASK_LENGTH, MASKED_VALUE_VISIBLE_SUFFIX_LENGTH } from './constants.js';
|
|
@@ -16,7 +16,7 @@ export function emptySourceDraft(fieldSpecs) {
|
|
|
16
16
|
* a scheme-only check accepted private address space. See
|
|
17
17
|
* `utils/endpoint-policy.ts`. */
|
|
18
18
|
function isValidHttpUrl(value) {
|
|
19
|
-
return isAllowedEndpointUrl(value);
|
|
19
|
+
return isAllowedEndpointUrl({ raw: value });
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Validates a draft against its field specs: required-field presence, plus a
|
|
@@ -25,7 +25,7 @@ function isValidHttpUrl(value) {
|
|
|
25
25
|
* `PluginsView.tsx`'s marketplace-URL add flow). Protocol-specific API-key
|
|
26
26
|
* shape validation (the origin `byok/validation.ts`'s Anthropic/OpenAI/
|
|
27
27
|
* Google key-format detection) is deliberately NOT ported here — see
|
|
28
|
-
* `
|
|
28
|
+
* `archived provenance ledger`'s dropped-behavior list; a host that needs it supplies its
|
|
29
29
|
* own extra validation before calling `addSource`.
|
|
30
30
|
*
|
|
31
31
|
* **Applies to the EDIT path as well as the add path.** That was once true only
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Generic "add a source by URL/key, set trust, list, per-item test/refresh/
|
|
3
3
|
* remove" domain types. This shape recurs independently at least 4 times in
|
|
4
4
|
* the origin product's `apps/web/src/components/` tree — see
|
|
5
|
-
* `packages/ui/
|
|
5
|
+
* `packages/ui/archived provenance ledger`'s `features/source-config-list/` section for
|
|
6
6
|
* full per-source provenance (which behaviors came from which file, and what
|
|
7
7
|
* did NOT make it into this generic primitive).
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Generic "add a source by URL/key, set trust, list, per-item test/refresh/
|
|
3
3
|
* remove" domain types. This shape recurs independently at least 4 times in
|
|
4
4
|
* the origin product's `apps/web/src/components/` tree — see
|
|
5
|
-
* `packages/ui/
|
|
5
|
+
* `packages/ui/archived provenance ledger`'s `features/source-config-list/` section for
|
|
6
6
|
* full per-source provenance (which behaviors came from which file, and what
|
|
7
7
|
* did NOT make it into this generic primitive).
|
|
8
8
|
*
|
|
@@ -31,7 +31,7 @@ export function useTabLauncherMenu(options) {
|
|
|
31
31
|
window.removeEventListener('resize', update);
|
|
32
32
|
};
|
|
33
33
|
}, [anchor]);
|
|
34
|
-
useDismissOnOutsideOrEscape(onClose, { containerRef });
|
|
34
|
+
useDismissOnOutsideOrEscape({ onDismiss: onClose }, { containerRef });
|
|
35
35
|
const kinds = useMemo(() => presentKinds(files), [files]);
|
|
36
36
|
const fileResults = useMemo(() => filterFiles(files, query, kindFilter), [files, query, kindFilter]);
|
|
37
37
|
const tabResults = useMemo(() => filterTabs(tabs, query, kindFilter), [tabs, query, kindFilter]);
|
|
@@ -10,4 +10,8 @@ export { TabStripItem } from './react/components/TabStripItem.js';
|
|
|
10
10
|
export type { TabStripItemProps } from './react/components/TabStripItem.js';
|
|
11
11
|
export { TabStrip } from './react/components/TabStrip.js';
|
|
12
12
|
export type { TabStripProps } from './react/components/TabStrip.js';
|
|
13
|
+
export { TabBar } from './react/components/TabBar.js';
|
|
14
|
+
export type { TabBarProps, TabBarTab } from './react/components/TabBar.js';
|
|
15
|
+
export { useTabBarKeyboard, resolveTabBarKeyTarget, resolveTabBarTabIndex, tabHandleProps } from './react/components/TabBar.hooks.js';
|
|
16
|
+
export type { TabBarKeyboardHandlers } from './react/components/TabBar.hooks.js';
|
|
13
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,4 +5,6 @@ export { createBrowserTabStripHaptics } from './dependencies.js';
|
|
|
5
5
|
export { useTabStripDragReorder } from './react/hooks/useTabStripDragReorder.js';
|
|
6
6
|
export { TabStripItem } from './react/components/TabStripItem.js';
|
|
7
7
|
export { TabStrip } from './react/components/TabStrip.js';
|
|
8
|
+
export { TabBar } from './react/components/TabBar.js';
|
|
9
|
+
export { useTabBarKeyboard, resolveTabBarKeyTarget, resolveTabBarTabIndex, tabHandleProps } from './react/components/TabBar.hooks.js';
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface TabBarTab {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly icon?: ReactNode | undefined;
|
|
6
|
+
readonly count?: number | undefined;
|
|
7
|
+
readonly tag?: string | undefined;
|
|
8
|
+
readonly disabled?: boolean | undefined;
|
|
9
|
+
readonly handle?: string | undefined;
|
|
10
|
+
readonly handleLabel?: string | undefined;
|
|
11
|
+
readonly dot?: boolean | undefined;
|
|
12
|
+
readonly dotLabel?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface TabBarProps {
|
|
15
|
+
tabs: readonly TabBarTab[];
|
|
16
|
+
activeId: string;
|
|
17
|
+
onChange: (id: string) => void;
|
|
18
|
+
ariaLabel: string;
|
|
19
|
+
containerHandle?: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
/** Controlled button-based selection strip, including roving focus and optional agent handles. */
|
|
22
|
+
export declare function TabBar({ tabs, activeId, onChange, ariaLabel, containerHandle }: TabBarProps): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=TabBar.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { KeyboardEvent as ReactKeyboardEvent } from "react";
|
|
2
|
+
import type { TabBarTab } from "./TabBar.js";
|
|
3
|
+
export declare function tabHandleProps({ tab }: {
|
|
4
|
+
tab: TabBarTab;
|
|
5
|
+
}): {};
|
|
6
|
+
/** Resolve arrow/Home/End navigation in enabled-tab order; null means no navigation. */
|
|
7
|
+
export declare function resolveTabBarKeyTarget({ tabs, activeId, key }: {
|
|
8
|
+
tabs: readonly TabBarTab[];
|
|
9
|
+
activeId: string;
|
|
10
|
+
key: string;
|
|
11
|
+
}): number | null;
|
|
12
|
+
export declare function resolveTabBarTabIndex({ tabs, activeId, tab }: {
|
|
13
|
+
tabs: readonly TabBarTab[];
|
|
14
|
+
activeId: string;
|
|
15
|
+
tab: TabBarTab;
|
|
16
|
+
}): 0 | -1;
|
|
17
|
+
export interface TabBarKeyboardHandlers {
|
|
18
|
+
onKeyDown: (e: ReactKeyboardEvent<HTMLDivElement>) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function useTabBarKeyboard({ tabs, activeId, onChange }: {
|
|
21
|
+
tabs: readonly TabBarTab[];
|
|
22
|
+
activeId: string;
|
|
23
|
+
onChange: (id: string) => void;
|
|
24
|
+
}): TabBarKeyboardHandlers;
|
|
25
|
+
//# sourceMappingURL=TabBar.hooks.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { agentHandle } from "@jini-ai/agentic";
|
|
2
|
+
export function tabHandleProps({ tab }) {
|
|
3
|
+
return tab.handle ? agentHandle({ handle: tab.handle }, { role: "button", label: tab.handleLabel ?? tab.label }) : {};
|
|
4
|
+
}
|
|
5
|
+
const TAB_BAR_NAV_KEYS = ["ArrowRight", "ArrowLeft", "Home", "End"];
|
|
6
|
+
function isTabBarNavKey(key) {
|
|
7
|
+
return TAB_BAR_NAV_KEYS.includes(key);
|
|
8
|
+
}
|
|
9
|
+
function enabledTabIndices(tabs) {
|
|
10
|
+
return tabs.reduce((acc, tab, i) => (tab.disabled ? acc : [...acc, i]), []);
|
|
11
|
+
}
|
|
12
|
+
/** Resolve arrow/Home/End navigation in enabled-tab order; null means no navigation. */
|
|
13
|
+
export function resolveTabBarKeyTarget({ tabs, activeId, key }) {
|
|
14
|
+
if (!isTabBarNavKey(key))
|
|
15
|
+
return null;
|
|
16
|
+
const enabled = enabledTabIndices(tabs);
|
|
17
|
+
if (enabled.length === 0)
|
|
18
|
+
return null;
|
|
19
|
+
if (key === "Home")
|
|
20
|
+
return enabled[0];
|
|
21
|
+
if (key === "End")
|
|
22
|
+
return enabled[enabled.length - 1];
|
|
23
|
+
const activeIndex = tabs.findIndex((tab) => tab.id === activeId);
|
|
24
|
+
const activePos = activeIndex === -1 ? -1 : enabled.indexOf(activeIndex);
|
|
25
|
+
if (key === "ArrowRight") {
|
|
26
|
+
if (activePos === -1)
|
|
27
|
+
return enabled[0];
|
|
28
|
+
return enabled[(activePos + 1) % enabled.length];
|
|
29
|
+
}
|
|
30
|
+
// ArrowLeft
|
|
31
|
+
if (activePos === -1)
|
|
32
|
+
return enabled[enabled.length - 1];
|
|
33
|
+
return enabled[(activePos - 1 + enabled.length) % enabled.length];
|
|
34
|
+
}
|
|
35
|
+
export function resolveTabBarTabIndex({ tabs, activeId, tab }) {
|
|
36
|
+
if (tab.disabled)
|
|
37
|
+
return -1;
|
|
38
|
+
if (tabs.some((t) => t.id === activeId && !t.disabled))
|
|
39
|
+
return tab.id === activeId ? 0 : -1;
|
|
40
|
+
const firstEnabled = tabs.find((t) => !t.disabled);
|
|
41
|
+
return firstEnabled?.id === tab.id ? 0 : -1;
|
|
42
|
+
}
|
|
43
|
+
export function useTabBarKeyboard({ tabs, activeId, onChange }) {
|
|
44
|
+
function onKeyDown(e) {
|
|
45
|
+
// Controls inside the strip that are not tabs keep their own navigation keys.
|
|
46
|
+
if (!(e.target instanceof Element) || !e.target.closest('[role="tab"]'))
|
|
47
|
+
return;
|
|
48
|
+
const target = resolveTabBarKeyTarget({ tabs: tabs, activeId: activeId, key: e.key });
|
|
49
|
+
if (target === null)
|
|
50
|
+
return;
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
onChange(tabs[target].id);
|
|
53
|
+
e.currentTarget.querySelectorAll('[role="tab"]')[target]?.focus();
|
|
54
|
+
}
|
|
55
|
+
return { onKeyDown };
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=TabBar.hooks.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TabStripFrame } from "./TabStripFrame.js";
|
|
3
|
+
import { agentHandle } from "@jini-ai/agentic";
|
|
4
|
+
import { resolveTabBarTabIndex, tabHandleProps, useTabBarKeyboard } from "./TabBar.hooks.js";
|
|
5
|
+
function tabDotAccessibleSuffix(tab) {
|
|
6
|
+
if (!tab.dot || !tab.dotLabel)
|
|
7
|
+
return null;
|
|
8
|
+
return _jsxs("span", { className: "visually-hidden", children: [", ", tab.dotLabel] });
|
|
9
|
+
}
|
|
10
|
+
function TabBarButton({ tab, active, tabIndex, onChange, }) {
|
|
11
|
+
return (_jsxs("button", { type: "button", role: "tab", className: "tab-bar-item", "aria-selected": active, "aria-label": tab.dot && tab.dotLabel ? [tab.label + ", " + tab.dotLabel, tab.tag, tab.count].filter((part) => part !== undefined).join(" ") : undefined, "aria-disabled": tab.disabled || undefined, disabled: tab.disabled, tabIndex: tabIndex, onClick: tab.disabled ? undefined : () => onChange(tab.id), ...tabHandleProps({ tab: tab }), children: [tab.dot ? _jsx("span", { className: "tab-bar-dot", "aria-hidden": "true" }) : null, tab.icon ? (_jsx("span", { className: "tab-bar-icon", "aria-hidden": "true", children: tab.icon })) : null, tab.label, tabDotAccessibleSuffix(tab), tab.tag ? _jsx("span", { className: "tab-bar-tag", children: tab.tag }) : null, tab.count !== undefined ? _jsx("span", { className: "tab-bar-count", children: tab.count }) : null] }));
|
|
12
|
+
}
|
|
13
|
+
/** Controlled button-based selection strip, including roving focus and optional agent handles. */
|
|
14
|
+
export function TabBar({ tabs, activeId, onChange, ariaLabel, containerHandle }) {
|
|
15
|
+
const { onKeyDown } = useTabBarKeyboard({ tabs: tabs, activeId: activeId, onChange: onChange });
|
|
16
|
+
return (_jsx(TabStripFrame, { className: "tab-bar", role: "tablist", "aria-label": ariaLabel, onKeyDown: onKeyDown, ...(containerHandle ? agentHandle({ handle: containerHandle }, { role: "region", label: ariaLabel }) : {}), children: tabs.map((tab) => (_jsx(TabBarButton, { tab: tab, active: activeId === tab.id, tabIndex: resolveTabBarTabIndex({ tabs: tabs, activeId: activeId, tab: tab }), onChange: onChange }, tab.id))) }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=TabBar.js.map
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { noopTabStripHaptics } from '../../ports.js';
|
|
3
3
|
import { useTabStripDragReorder } from '../hooks/useTabStripDragReorder.js';
|
|
4
4
|
import { TabStripItem } from './TabStripItem.js';
|
|
5
|
+
import { TabStripFrame } from './TabStripFrame.js';
|
|
5
6
|
/**
|
|
6
7
|
* The consolidated tab-strip primitive: composes `useTabStripDragReorder`
|
|
7
8
|
* with `TabStripItem` into the reorderable `role="tablist"` shell both
|
|
@@ -23,6 +24,6 @@ export function TabStrip({ tabs, activeTabId, onActivate, onClose, onReorder, re
|
|
|
23
24
|
reorderTiming,
|
|
24
25
|
haptics,
|
|
25
26
|
});
|
|
26
|
-
return (_jsxs(
|
|
27
|
+
return (_jsxs(TabStripFrame, { className: ['jini-tab-strip', className].filter(Boolean).join(' '), role: "tablist", "aria-label": ariaLabel, ref: stripRef, onDragOver: stripDragProps.onDragOver, onDrop: stripDragProps.onDrop, onDragLeave: stripDragProps.onDragLeave, children: [tabs.map((tab) => (_jsx(TabStripItem, { tab: tab, active: tab.id === activeTabId, dragging: draggingTabId === tab.id, dragOverEdge: dragOverTarget?.tabId === tab.id && draggingTabId !== tab.id ? dragOverTarget.edge : null, dragProps: getItemDragProps(tab.id), onActivate: onActivate, onClose: onClose, closeLabel: closeLabel, closeIcon: closeIcon }, tab.id))), trailing] }));
|
|
27
28
|
}
|
|
28
29
|
//# sourceMappingURL=TabStrip.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Shared tablist shell for the reorderable strip and controlled button-based TabBar. */
|
|
2
|
+
export declare const TabStripFrame: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
//# sourceMappingURL=TabStripFrame.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
/** Shared tablist shell for the reorderable strip and controlled button-based TabBar. */
|
|
4
|
+
export const TabStripFrame = forwardRef(function TabStripFrame(props, ref) {
|
|
5
|
+
return _jsx("div", { ...props, ref: ref, role: "tablist" });
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=TabStripFrame.js.map
|
|
@@ -36,7 +36,7 @@ export function useTabbedDialog({ tabs, initialActiveTabId, activeTabId: control
|
|
|
36
36
|
// in its Escape-only shape (no `containerRef` — the backdrop click is
|
|
37
37
|
// already handled separately by the host), matching the call site that
|
|
38
38
|
// hook's own doc comment names for this exact hook.
|
|
39
|
-
useDismissOnOutsideOrEscape(() => onClose?.(), { enabled: Boolean(onClose) });
|
|
39
|
+
useDismissOnOutsideOrEscape({ onDismiss: () => onClose?.() }, { enabled: Boolean(onClose) });
|
|
40
40
|
return {
|
|
41
41
|
activeTabId,
|
|
42
42
|
setActiveTabId,
|