@jini-ai/ui 0.3.13 → 0.4.0
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 +139 -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/bridge.d.ts +2 -1
- package/dist/features/mcp-ui/surfaces/bridge.js +17 -7
- package/dist/features/mcp-ui/surfaces/confirmation.d.ts +20 -0
- package/dist/features/mcp-ui/surfaces/confirmation.js +38 -6
- package/dist/features/mcp-ui/surfaces/document.d.ts +7 -1
- package/dist/features/mcp-ui/surfaces/document.js +19 -1
- package/dist/features/mcp-ui/surfaces/text-input.js +4 -4
- 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 +8 -0
- package/dist/features/panel-kit/hooks/use-focus-trap.hooks.js +66 -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
package/dist/index.js
CHANGED
|
@@ -1,5 +1,423 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Archived provenance rationale:
|
|
3
|
+
* ### Design decisions worth flagging
|
|
4
|
+
*
|
|
5
|
+
* - **`title`/`detail` are host-supplied, not computed from a status+kind
|
|
6
|
+
* lookup table.** Both source cards hardcode branded, kind-specific copy
|
|
7
|
+
* ("Open Design is rebuilding tokens", "Workspace update ready" — see the
|
|
8
|
+
* purity-grep note below for why that exact text can't even appear in this
|
|
9
|
+
* package's comments). Baking any "kind"-aware copy-selection logic into the
|
|
10
|
+
* generic component would just re-embed OD's product vocabulary (job
|
|
11
|
+
* "kind" — generation/revision/token-contract-rebuild — is OD-specific)
|
|
12
|
+
* under a different name. The generic component instead takes optional
|
|
13
|
+
* `title`/`detail` and falls back to a neutral, status-only default
|
|
14
|
+
* (`Queued`/`Running`/`Complete`/`Needs attention`) when omitted. Computing
|
|
15
|
+
* richer, kind-aware copy is left to the host.
|
|
16
|
+
* - **`progress: number | 'indeterminate'`** — neither source occurrence ever
|
|
17
|
+
* actually produces an indeterminate state (both always compute a 0-100
|
|
18
|
+
* percentage). It's included anyway because the task's own required test
|
|
19
|
+
* matrix asked for indeterminate-vs-determinate coverage, and because it's
|
|
20
|
+
* a natural, forward-looking capability for Jini's own Run/Agent/Tool
|
|
21
|
+
* dashboards (an agent step with no known total duration) — this is a
|
|
22
|
+
* deliberate generalization beyond what the two source cards themselves
|
|
23
|
+
* needed, called out here rather than silently added.
|
|
24
|
+
* - **Per-item `label` values are not run through `useT()`.** `steps[]`/
|
|
25
|
+
* `secondaryItems[]` mix genuinely dynamic content (a todo's own text, an
|
|
26
|
+
* agent-touched file path) with the reference adapter's static fallback
|
|
27
|
+
* step titles, indistinguishably once they're both just strings in the same
|
|
28
|
+
* array — there's no way for the component to tell them apart. This matches
|
|
29
|
+
* the precedent already set by `ConnectorCard` not wrapping `connector.name`/
|
|
30
|
+
* `connector.category`. What *is* wrapped in `t()`, and covered by a real
|
|
31
|
+
* `I18nProvider` test: the fallback title/detail, the progress-bar
|
|
32
|
+
* `aria-label`, and the default "Files touched" secondary-items heading.
|
|
33
|
+
* - **Adapters take a `*Like` structural input, not real `@open-design/contracts`
|
|
34
|
+
* types.** The task's own framing allowed shipping these as "documented
|
|
35
|
+
* reference adapters" for OD-shaped input; going one step further, the
|
|
36
|
+
* input types are locally declared minimal structural subsets rather than
|
|
37
|
+
* actual imports of an external, unvendored package — this package has zero
|
|
38
|
+
* dependency on `@open-design/contracts`, and a host whose real types are a
|
|
39
|
+
* structural superset can pass them in directly (TypeScript structural
|
|
40
|
+
* typing).
|
|
41
|
+
* - **Slicing (`maxSteps`/`maxSecondaryItems`) moved from the adapter to the
|
|
42
|
+
* component.** The source cards slice at render time (`todos.slice(0, 6)`,
|
|
43
|
+
* `fileOps.slice(0, 5)`) inside the component itself. The adapters here
|
|
44
|
+
* return the *full* derived list; `ProgressCard` truncates for display via
|
|
45
|
+
* props (defaulting to the same 6/5 caps). This keeps the adapter's output
|
|
46
|
+
* data-complete and makes the truncation a generic, overridable view
|
|
47
|
+
* concern rather than something baked into one specific adapter.
|
|
48
|
+
* - **No orchestrator hook was needed.** Unlike the connectors canary
|
|
49
|
+
* (`useConnectorCatalog`/`useConnectorAuthorization`/`useConnectorDetail`),
|
|
50
|
+
* this feature has no live data-fetching or async state of its own —
|
|
51
|
+
* `ProgressCard` is purely presentational, and the adapters are synchronous
|
|
52
|
+
* pure functions. There is deliberately no `ports.ts`/`dependencies.ts`
|
|
53
|
+
* pair in this feature; a host wires its own data source directly into
|
|
54
|
+
* `ProgressCardData` (via these adapters or its own mapping) rather than
|
|
55
|
+
* this package owning any transport.
|
|
56
|
+
*
|
|
57
|
+
* ### Dropped, and why
|
|
58
|
+
*
|
|
59
|
+
* - **The Bash `rm`-command detection heuristic** from the source
|
|
60
|
+
* `deriveFileOps` (`extractSimpleBashDeletes`/`shellWords`/
|
|
61
|
+
* `isShellSeparator`/`isRedirectionOperator`/`looksUnsafeForFileList`, ~100
|
|
62
|
+
* lines) — a self-contained shell-command tokenizer used only to detect
|
|
63
|
+
* file deletions performed via a raw `Bash` tool call rather than a
|
|
64
|
+
* dedicated `Delete`-family tool. This is a distinct, non-trivial parsing
|
|
65
|
+
* concern in its own right, not core to "progress bar + status icon + step
|
|
66
|
+
* list," and isn't mentioned anywhere in r6 §1.5 or the plan doc's item 2.
|
|
67
|
+
* `deriveFileOpsFromAgentEvents` keeps the tool-name-based classification
|
|
68
|
+
* (`Read`/`Write`/`Edit`/`MultiEdit`/`Delete`/etc., which covers the large
|
|
69
|
+
* majority of real file-op tool calls) and drops only the Bash-string
|
|
70
|
+
* heuristic. A future task adopting this as a real extraction target should
|
|
71
|
+
* do so as its own item, not bundled here.
|
|
72
|
+
* - **`job.kind`** (`generation`/`revision`/`token-contract-rebuild`) was not
|
|
73
|
+
* carried into `DesignSystemGenerationJobLike`/`ProgressCardData` at all —
|
|
74
|
+
* it exists purely to drive the OD-branded, kind-specific copy the generic
|
|
75
|
+
* title/detail design above already excludes. A host that wants
|
|
76
|
+
* kind-specific text computes it itself before calling the adapter and
|
|
77
|
+
* overrides `title`/`detail` on the result.
|
|
78
|
+
* - **`todo.activeForm`** (an alternate in-progress-tense label OD's todo
|
|
79
|
+
* schema carries) — not used by either card's actual rendering, so not
|
|
80
|
+
* carried into `TodoItemLike`.
|
|
81
|
+
* - **CSS class names were not ported verbatim** (`ds-workspace-activity-card`,
|
|
82
|
+
* `ds-generation-review-card`, `ds-generation-review-progress`, etc.) — new,
|
|
83
|
+
* neutral names were used (`progress-card`, `progress-card-bar`,
|
|
84
|
+
* `progress-card-steps`, `progress-card-secondary-items`) since the
|
|
85
|
+
* original classes are tied to OD's own stylesheet, not shipped here.
|
|
86
|
+
*
|
|
87
|
+
* ### Post-merge audit pass (2026-07-17): a real bug fix, a dead-code removal, and 100% coverage
|
|
88
|
+
*
|
|
89
|
+
* A follow-up audit re-diffed every in-scope piece above against the vendored
|
|
90
|
+
* original function-by-function and found the port faithful — every
|
|
91
|
+
* generification already listed in this section checked out against the
|
|
92
|
+
* original's actual behavior. The audit did surface two real issues once
|
|
93
|
+
* branch-coverage was wired up (`@vitest/coverage-v8`, run via a scoped CLI
|
|
94
|
+
* include/exclude filter — `--coverage.include='src/features/browser-chrome/**'`
|
|
95
|
+
* — rather than a shared `vitest.config.ts` change, so the rest of the package's
|
|
96
|
+
* test config is untouched):
|
|
97
|
+
*
|
|
98
|
+
* - **Real bug, fixed** — `rules.ts`'s `recordNavigation` hardcoded
|
|
99
|
+
* `DEFAULT_HOME_NAVIGATION_ENTRY.title` ("New Tab") for a navigation to
|
|
100
|
+
* `EMPTY_URL`, ignoring a caller-supplied `options.homeLabel`. Since
|
|
101
|
+
* `useBrowserNavigationStack` passes `homeLabel: homeEntry.title` on every
|
|
102
|
+
* call, a host configuring a custom `homeEntry` would see any navigation back
|
|
103
|
+
* to the home url silently retitle itself to the generic default instead of
|
|
104
|
+
* the host's own label — a regression relative to `initialNavigationState`/
|
|
105
|
+
* `labelFromUrl`, which both already honored a custom home label correctly.
|
|
106
|
+
* Fixed to `options.homeLabel ?? DEFAULT_HOME_NAVIGATION_ENTRY.title`; covered
|
|
107
|
+
* by new `rules.test.ts`/`useBrowserNavigationStack.test.ts` cases.
|
|
108
|
+
* - **Dead code, removed** — `MergeHistoryEntryOptions.homeLabel` (threaded
|
|
109
|
+
* through `mergeHistoryEntry` → `useBrowserHistory`'s `commitVisit`) could
|
|
110
|
+
* never actually affect anything: `mergeHistoryEntry` only calls
|
|
111
|
+
* `labelFromUrl` after its own `isHistoryUrl(url)` guard has already excluded
|
|
112
|
+
* `EMPTY_URL`, and `homeLabel` only changes `labelFromUrl`'s output on the
|
|
113
|
+
* `url === EMPTY_URL` branch. Removed the field from `MergeHistoryEntryOptions`
|
|
114
|
+
* and `UseBrowserHistoryOptions` rather than leaving a permanently-uncovered,
|
|
115
|
+
* inert option in the public API.
|
|
116
|
+
* - **One line excluded from coverage, not faked** —
|
|
117
|
+
* `useBrowserNavigationStack.ts`'s `if (!currentEntry) return;` guard inside
|
|
118
|
+
* the `onNavigate`-firing effect was unreachable through the hook's public
|
|
119
|
+
* API: every state transition it performs (`initialNavigationState`/
|
|
120
|
+
* `recordNavigation`/`resolveNavigationHistoryDelta`/
|
|
121
|
+
* `updateCurrentNavigationTitle`, all in `rules.ts`) preserves
|
|
122
|
+
* `0 <= navigationIndex < navigationStack.length`, so `currentEntry` is always
|
|
123
|
+
* defined in practice — the guard existed only because
|
|
124
|
+
* `noUncheckedIndexedAccess` types the array-index read as possibly-undefined.
|
|
125
|
+
* **Correction (2026-07-17, per the vendored `fixing-open-design-web` SKILL.md's
|
|
126
|
+
* Phase 9.5 classification #4 — "TS-required fallback with no real runtime
|
|
127
|
+
* path"):** an initial pass marked this with `/* v8 ignore next * /`, which
|
|
128
|
+
* that skill's rule explicitly forbids ("never a valid outcome... under any
|
|
129
|
+
* classification"). Fixed to the classification's actual prescription: the
|
|
130
|
+
* `if` branch is deleted and the index read is a non-null assertion
|
|
131
|
+
* (`state.navigationStack[state.navigationIndex]!`) with a one-line comment
|
|
132
|
+
* explaining the invariant — no suppression comment anywhere in this feature.
|
|
133
|
+
* - **`ports.ts`/`types.ts` excluded from coverage** — both are
|
|
134
|
+
* `export interface`/`export type` only; verified via the package's own
|
|
135
|
+
* esbuild transform that they compile to zero emitted statements, so
|
|
136
|
+
* v8/istanbul has no executable line to measure (reports 0/0 as 0%, not N/A).
|
|
137
|
+
* Excluded via `--coverage.exclude`, documented inline at the top of each
|
|
138
|
+
* file. `index.ts` (the barrel) is NOT excluded — it has real re-export
|
|
139
|
+
* statements that execute on import, and nothing else in the suite imported
|
|
140
|
+
* the barrel directly, so a small `index.test.ts` smoke test was added instead
|
|
141
|
+
* (also catches a typo'd/missing re-export a concrete-module test wouldn't).
|
|
142
|
+
*
|
|
143
|
+
* Also closed several genuine (non-dead) branch-coverage gaps with targeted
|
|
144
|
+
* tests rather than exclusions: `recordNavigation`'s adjacent-entry rejoin and
|
|
145
|
+
* `replacePendingTarget` branches (the back/forward state-machine logic
|
|
146
|
+
* faithfully ported from the origin, previously untested); `recordNavigation`/
|
|
147
|
+
* `updateCurrentNavigationTitle` given an out-of-bounds `navigationIndex` (both
|
|
148
|
+
* are exported pure functions, so a malformed `BrowserNavigationState` is a
|
|
149
|
+
* legitimately reachable input, not hook-internal dead code); `faviconUrl`'s
|
|
150
|
+
* catch branch (`https://` with no host); `labelFromUrl`'s empty-hostname
|
|
151
|
+
* fallback (`file://` urls); `cleanIconUrl`'s `data:image/` branch; the
|
|
152
|
+
* `onNavigate` dedup-by-content check (a re-recorded identical url+title still
|
|
153
|
+
* produces a new object reference via `updateEntry`, so the effect re-runs and
|
|
154
|
+
* must dedupe on content, not just skip via unchanged reference);
|
|
155
|
+
* `BrowserViewportControls`'s custom-`presets`-with-no-match and empty-`presets`
|
|
156
|
+
* branches; and `createDefaultBrowserChromeDependencies`'s `historyLimit`-only
|
|
157
|
+
* option combination.
|
|
158
|
+
*
|
|
159
|
+
* **Result**: feature-aggregate coverage on the executable-code portion (i.e.
|
|
160
|
+
* excluding `ports.ts`/`types.ts` per above) is **100% Lines, 100% Branches,
|
|
161
|
+
* 100% Functions, 100% Statements** — up from 99.15% / 87.77% / 97.56% / 99.15%
|
|
162
|
+
* before this pass. Full suite: 101 tests across 7 files for this feature (up
|
|
163
|
+
* from 78), 476 tests across 60 files package-wide (up from 453).
|
|
164
|
+
* `pnpm --filter @jini/ui run typecheck` and `pnpm guard` both remain clean.
|
|
165
|
+
*
|
|
166
|
+
* ### Second follow-up pass (2026-07-17): `useX`/`useWiredX` wiring pairs, toolbox merge
|
|
167
|
+
*
|
|
168
|
+
* Two retrofits landed on this branch after the audit pass above:
|
|
169
|
+
*
|
|
170
|
+
* **`useWiredX` wirers.** Per the now-required `useX(port)` / zero-arg
|
|
171
|
+
* `useWiredX()` pattern (see `apps/web/src/features/memory/hooks/
|
|
172
|
+
* useMemoryConfig.hooks.ts` on the OD repo's `refactor/web-memory-slice` for
|
|
173
|
+
* the reference shape), audited every hook in this feature against
|
|
174
|
+
* `ports.ts`/`dependencies.ts` to see which actually take an injected port:
|
|
175
|
+
*
|
|
176
|
+
* - `useBrowserHistory` (takes `{ historyStorage: BrowserHistoryStoragePort }`)
|
|
177
|
+
* — got `useWiredBrowserHistory(scopeKey, options?)`, binding a module-level
|
|
178
|
+
* `createBrowserHistoryStorage()` singleton (the real, SSR-guarded
|
|
179
|
+
* `localStorage`-backed implementation — a meaningful production default).
|
|
180
|
+
* - `useBrowserBridgeRegistration` (takes `{ bridgeRegistration:
|
|
181
|
+
* BrowserBridgeRegistrationPort }`) — got `useWiredBrowserBridgeRegistration
|
|
182
|
+
* (scopeKey, handle)`, binding `createNoopBrowserBridgeRegistration()`.
|
|
183
|
+
* Unlike the history port, there's no generic "real" default here by design
|
|
184
|
+
* (see `ports.ts`'s doc comment) — registering a handle only means something
|
|
185
|
+
* in the context of a host's own external bridge. A host that wants real
|
|
186
|
+
* bridge registration keeps calling `useBrowserBridgeRegistration` directly
|
|
187
|
+
* with its own port, same carve-out as a swappable test port, just for a
|
|
188
|
+
* real host implementation instead of a fake.
|
|
189
|
+
* - `useBrowserNavigationStack` — **no wirer added.** Its `options` (`initialUrl`/
|
|
190
|
+
* `initialTitle`/`homeEntry`/`onNavigate`) are all plain local config, not a
|
|
191
|
+
* `ports.ts` port; the hook owns its state entirely via `rules.ts`'s pure
|
|
192
|
+
* functions. Nothing to wire.
|
|
193
|
+
*
|
|
194
|
+
* Both wirers exported from `index.ts`; no internal call sites needed updating
|
|
195
|
+
* — this feature has no top-level assembling component (that lives in the
|
|
196
|
+
* consuming host, out of scope per this feature's own "OUT OF SCOPE" section
|
|
197
|
+
* above), so `useBrowserHistory`/`useBrowserBridgeRegistration` had zero
|
|
198
|
+
* in-package callers before or after.
|
|
199
|
+
*
|
|
200
|
+
* **Toolbox merge.** Merged local branch `feat/ui-browser-toolbox` (commit
|
|
201
|
+
* `c3e7f21`, not pushed to origin) — a clean merge, no conflicts (it branched
|
|
202
|
+
* off a commit before `features/browser-chrome/` existed, so it never touched
|
|
203
|
+
* this feature's files). It adds `packages/ui/src/browser/` (`useDismissOnOutsideOrEscape`,
|
|
204
|
+
* `useGlobalKeydown`) as a thin wrapper over `utils/dom-subscriptions.ts`'s
|
|
205
|
+
* `subscribeOutsideClickOrEscape`. `BrowserViewportControls.tsx`'s hand-rolled
|
|
206
|
+
* `document.addEventListener('pointerdown'/'keydown', ...)` pair (the one
|
|
207
|
+
* disclosed DOM-outside-`dependencies.ts` deviation noted earlier in this
|
|
208
|
+
* section) is now `useDismissOnOutsideOrEscape(() => setOpen(false), { enabled:
|
|
209
|
+
* open, containerRef: menuRef })` — same `pointerdown`-outside-or-Escape
|
|
210
|
+
* behavior, dead local listener code removed. All of `BrowserViewportControls.test.tsx`'s
|
|
211
|
+
* existing outside-click/Escape assertions pass unchanged against the shared
|
|
212
|
+
* hook, confirming no behavior change.
|
|
213
|
+
*
|
|
214
|
+
* **Result**: still 100% Lines/Branches/Functions/Statements on the
|
|
215
|
+
* executable-code portion after both retrofits (wirers came with their own
|
|
216
|
+
* tests; the toolbox swap needed none new since it's a drop-in behind the same
|
|
217
|
+
* public component API). 103 tests across 7 files for this feature; 494 tests
|
|
218
|
+
* across 62 files package-wide (the toolbox branch's own `useDismissOnOutsideOrEscape.test.ts`/
|
|
219
|
+
* `useGlobalKeydown.test.ts` account for the rest of the file-count jump).
|
|
220
|
+
* `pnpm --filter @jini/ui run typecheck` and `pnpm guard` both remain clean.
|
|
221
|
+
*
|
|
222
|
+
* ---
|
|
223
|
+
*
|
|
224
|
+
* ### What did NOT get ported (and why)
|
|
225
|
+
*
|
|
226
|
+
* - **No `ports.ts`/`dependencies.ts`.** Unlike every other feature in this
|
|
227
|
+
* package, `ListDetailPanel` has zero transport/DOM surface of its own — the
|
|
228
|
+
* host supplies items, the current selection, and both renderers as plain
|
|
229
|
+
* props/render-callbacks. There is nothing here for a port to abstract; the
|
|
230
|
+
* DI-seam ceremony would be empty ceremony for a purely presentational
|
|
231
|
+
* primitive, so it was skipped rather than added for form's sake.
|
|
232
|
+
* - **No visual skeleton markup.** `DesignSystemsTab.tsx`'s loading state is a
|
|
233
|
+
* richly detailed, OD-styled skeleton (specific row-variation patterns, a
|
|
234
|
+
* multi-section detail skeleton with its own CSS module). Per this package's
|
|
235
|
+
* established precedent (no `.module.css` ported anywhere in `@jini/ui` —
|
|
236
|
+
* see the flat-group porting section above), the loading state is generified
|
|
237
|
+
* to `loading` + `loadingSidebarContent`/`loadingDetailContent` slots; a host
|
|
238
|
+
* supplies its own skeleton visuals. The panel's only built-in loading-state
|
|
239
|
+
* contribution is the `role="status" aria-busy aria-label` wrapper.
|
|
240
|
+
* - **Analytics, i18n dictionary keys, scope/surface/category filtering,
|
|
241
|
+
* `SystemRow`'s thumbnail-resolution logic, publish/delete/make-default
|
|
242
|
+
* actions** — all OD-specific, stay in OD.
|
|
243
|
+
*
|
|
244
|
+
* ### The root-level "flattened tree" quirk — verified, not assumed, and preserved
|
|
245
|
+
*
|
|
246
|
+
* `deriveTreeChildren` preserves a genuinely surprising piece of the origin's own `dirsAtCurrentDir`/`filesAtCurrentDir` `useMemo` verbatim: at the tree root (`currentDir === ''`), **every** file is pushed into `filesAtCurrentDir` — both root-level files and files nested under a subdirectory (which *also* separately contribute their top segment to `dirsAtCurrentDir`) — so the root view is a flattened "everything" listing with folders offered only as a secondary drill-down. Once navigated into any non-root directory, only files strictly at that one level are included. This asymmetry looked enough like a bug to warrant re-reading the real source line-by-line before committing to it (per the task's own "don't trust it blindly" instruction) — but it's exactly what the code does, so it's preserved rather than "fixed," with a `rules.test.ts` case asserting it explicitly (`'at the root, flattens every file (including nested) and surfaces the top-level dir'`).
|
|
247
|
+
*
|
|
248
|
+
* ### Where it landed, and why (`packages/ui/src/features/memory/`, not `chat-react`)
|
|
249
|
+
*
|
|
250
|
+
* Per `ADS-memory/reports/jini-port/god-components-extraction-plan.md`'s Consolidation map and
|
|
251
|
+
* `packages/ui/README.md`'s scope boundary: Memory is a settings/data-management
|
|
252
|
+
* surface (saved facts/preferences, an editable index, connector-sourced
|
|
253
|
+
* suggestions) — the same shape as the already-shipped `features/connectors/` and
|
|
254
|
+
* `features/settings-dialog/`, not a conversation surface. It lands alongside them
|
|
255
|
+
* in `@jini/ui`, using the **new** `types.ts`/`constants.ts`/`rules.ts`/`ports.ts`/
|
|
256
|
+
* `dependencies.ts`/`formatters.ts`/`async-commit-guard.ts`/`index.ts` at the
|
|
257
|
+
* feature's top level, `hooks/`+`components/` under a `react/` subfolder — the
|
|
258
|
+
* layout decided 2026-07-17, matching `features/viewer-shell/`/`features/asset-grid/`/
|
|
259
|
+
* `features/sketch-editor/`, not `features/connectors/`'s older flat layout.
|
|
260
|
+
*
|
|
261
|
+
* ### The connector-reconciliation-reducer decision (the "third piece")
|
|
262
|
+
*
|
|
263
|
+
* The task brief's third sought piece — "connector-reconciliation reducers" — does
|
|
264
|
+
* **not** come from PR #5228. Its real origin is Open Design's `main`-branch
|
|
265
|
+
* `apps/web/src/components/connectors-state.ts` (confirmed by cloning
|
|
266
|
+
* `https://github.com/leonaburime-ucla/open-design.git` at its default `main`
|
|
267
|
+
* branch and reading `connectors-state.ts` directly, since `codex/connector-memory-settings`,
|
|
268
|
+
* the branch originally suspected to hold this, diffs empty against current `main`
|
|
269
|
+
* — i.e. that logic already lives on `main` by some other route). Its 4 functions
|
|
270
|
+
* — `connectorAuthSnapshotChanged`/`hasConnectorStatusChanges`/`mergeConnectorCatalog`/
|
|
271
|
+
* `applyConnectorStatuses` — are a **separate, shared/generic** connector-list
|
|
272
|
+
* reconciliation module OD's `MemorySection.tsx` monolith imports directly
|
|
273
|
+
* (`import { hasConnectorStatusChanges } from './connectors-state'`), distinct from
|
|
274
|
+
* PR #5228's own Memory-local `mergeMemoryConnector`/`upsertMemoryConnector`/
|
|
275
|
+
* `applyMemoryConnectorStatus(es)`/`connectorStatusesChanged` (which the PR's own
|
|
276
|
+
* `rules.ts` comment calls "convenience duplication" of the shared module, kept
|
|
277
|
+
* slice-local per the PR's own stated slice conventions).
|
|
278
|
+
*
|
|
279
|
+
* Direct line-by-line comparison found `@jini/ui`'s `features/connectors/rules.ts`
|
|
280
|
+
* **already ships the generified port of `connectors-state.ts`** — from the
|
|
281
|
+
* `ConnectorsBrowser.tsx` canary task (2026-07-17), see that section above —
|
|
282
|
+
* as `mergeConnectors`/`applyConnectorStatuses`/`hasConnectorStatusChanges`/
|
|
283
|
+
* `connectorAuthSnapshotChanged`, operating on the generic `Connector`/
|
|
284
|
+
* `ConnectorStatusMap` types instead of OD's `ConnectorDetail`. Their logic is
|
|
285
|
+
* identical to `connectors-state.ts`'s (verified field-by-field), and `mergeConnectors`
|
|
286
|
+
* already subsumes what PR #5228's `mergeMemoryConnector`+`upsertMemoryConnector`
|
|
287
|
+
* did (single-connector merge + array upsert in one pass). This is exactly the
|
|
288
|
+
* overlap `god-components-extraction-plan.md`'s Consolidation map flagged in
|
|
289
|
+
* advance: *"Memory slice's connector reducers... substantially overlap
|
|
290
|
+
* `features/connectors`'... check whether it can import these directly instead of
|
|
291
|
+
* re-deriving equivalents."*
|
|
292
|
+
*
|
|
293
|
+
* **Decision**: `features/memory/rules.ts` imports `mergeConnectors`/
|
|
294
|
+
* `applyConnectorStatuses`/`hasConnectorStatusChanges` from `../connectors` and
|
|
295
|
+
* re-exposes two thin, Memory-specific conveniences over them
|
|
296
|
+
* (`upsertMemoryConnector` = `mergeConnectors(current, next ? [next] : [])`;
|
|
297
|
+
* `applyMemoryConnectorStatus` = the 1-item form of `applyConnectorStatuses`, used
|
|
298
|
+
* by the synthetic not-yet-detailed catalogue row). Only `connectorWithPendingAuthorization`
|
|
299
|
+
* (no equivalent in `features/connectors`) is genuinely new Memory-local logic.
|
|
300
|
+
* Memory's own connector type is `Connector` from `features/connectors/types.ts`
|
|
301
|
+
* directly (not a third near-duplicate of `ConnectorDetail`) — its shape already
|
|
302
|
+
* matches (id/name/provider/category/status/accountLabel/lastError/tools/toolCount/
|
|
303
|
+
* toolsNextCursor/toolsHasMore/logoUrl).
|
|
304
|
+
*
|
|
305
|
+
* ### The consolidation decision: ONE primitive, with evidence
|
|
306
|
+
*
|
|
307
|
+
* Read both in full before designing anything, per the task brief. Verdict:
|
|
308
|
+
* **consolidate into one `FileDropzone` primitive** — not two components
|
|
309
|
+
* sharing a subdirectory, one component with configuration knobs. Evidence:
|
|
310
|
+
*
|
|
311
|
+
* 1. **Both are the exact same underlying interaction** — native drag/drop +
|
|
312
|
+
* click-to-browse, resolving to a flat `File[]` the host stages. The only
|
|
313
|
+
* real differences are *display* (thumbnail grid + lightbox vs. a plain
|
|
314
|
+
* prompt/names line) and which capabilities are wired on (paste,
|
|
315
|
+
* directory-select, the loading heuristic) — configuration, not a different
|
|
316
|
+
* component shape.
|
|
317
|
+
* 2. **They already shared the same directory-walking algorithm at the OD
|
|
318
|
+
* source level**, just wired at different layers: `DropZone`'s `readDrop`
|
|
319
|
+
* calls `filesFromDataTransfer` (a `webkitGetAsEntry` recursive directory
|
|
320
|
+
* walker) internally before calling `onFiles`; `DesignSystemAssetDropzone`'s
|
|
321
|
+
* `onDrop` prop just hands the raw `DataTransfer` up to its parent
|
|
322
|
+
* (`DesignSystemFlow.tsx`'s `handleAssetDrop`), which calls the **exact
|
|
323
|
+
* same** `filesFromDataTransfer` function (same file, one module-level
|
|
324
|
+
* definition) before staging. One algorithm, two wiring styles — a textbook
|
|
325
|
+
* case for one primitive owning it internally always, which is what this
|
|
326
|
+
* port does (both variants now get directory-aware drop resolution for
|
|
327
|
+
* free, including the thumbnail-grid variant, which never had it before).
|
|
328
|
+
* 3. **A duplicate of that same algorithm already existed a third time in this
|
|
329
|
+
* package** — `features/asset-tree-browser/rules.ts`'s `filesFromDataTransfer`
|
|
330
|
+
* (ported earlier from `DesignFilesPanel.tsx`, already fully generic). This
|
|
331
|
+
* is exactly the failure mode flagged by an independent audit the night
|
|
332
|
+
* this task was dispatched ("an undetected duplicate primitive") — so
|
|
333
|
+
* rather than writing a *fourth* copy for `file-dropzone`, this task
|
|
334
|
+
* promotes the shared logic to `utils/file-transfer.ts` (see below) and
|
|
335
|
+
* both features now import the one implementation.
|
|
336
|
+
*
|
|
337
|
+
* ### What's deferred, and why
|
|
338
|
+
*
|
|
339
|
+
* Per the `html-viewer` classification above: the sandboxed-iframe/postMessage-bridge core this feature's `resolvePreviewDocument` port is designed to eventually delegate to (`@jini/renderers-react`, currently a stub) does not exist yet. This feature does **not** wait on it — a host without a real sandbox core can implement `resolvePreviewDocument` as an identity function for a plain, unsandboxed preview, or delegate to whatever iframe-rendering mechanism it already has.
|
|
340
|
+
*
|
|
341
|
+
* **Update (2026-09-02):** this was accurate when written, but the same day
|
|
342
|
+
* (2026-07-18) a parallel task landed the real sandboxed-iframe/postMessage
|
|
343
|
+
* core (see `packages/ui/src/renderers/archived provenance ledger`'s "sandboxed-iframe
|
|
344
|
+
* rendering core" section) — it now exists (`sandbox-bridge.ts`,
|
|
345
|
+
* `sandboxed-document.ts`), and the package itself was later folded into
|
|
346
|
+
* `@jini/ui` as `src/renderers/` rather than staying a separate
|
|
347
|
+
* `@jini/renderers-react` package. The default fake dependency here
|
|
348
|
+
* (`features/version-manager/dependencies.ts`) still uses a plain identity
|
|
349
|
+
* stub for `resolvePreviewDocument` — that's an intentional default per the
|
|
350
|
+
* fake-double convention, not evidence the real core is missing — a host
|
|
351
|
+
* wanting the real sandbox behavior wires it to `src/renderers/` itself. `FileVersionViewportControls` was not re-ported; the orchestrator binds directly to `features/viewer-shell/`'s already-shipped `ViewportToggleGroup` (confirmed identical `role="group"`/`aria-pressed` shape by reading both source components side by side) rather than shipping a second, competing viewport-toggle primitive.
|
|
352
|
+
*
|
|
353
|
+
* ### A real cross-environment coverage-merge gap found and worked around
|
|
354
|
+
*
|
|
355
|
+
* Drafting `dependencies.ts`'s tests initially split them the way this
|
|
356
|
+
* package's own documented convention prescribes for an SSR guard: a jsdom
|
|
357
|
+
* test file for the "browser present" cases plus a separate
|
|
358
|
+
* `// @vitest-environment node` companion for the "no `document` at all"
|
|
359
|
+
* case. Coverage on the merged report showed that one guard's branch
|
|
360
|
+
* (`typeof document === 'undefined'` in `exitFullscreen`) as **uncovered**
|
|
361
|
+
* even though the node companion file, run alone, proved it covered — a real
|
|
362
|
+
* `@vitest/coverage-v8` limitation merging branch-hit counts for one source
|
|
363
|
+
* file instrumented under two different test environments in the same
|
|
364
|
+
* `vitest run`. Fixed by moving every `createBrowserFullscreenPort` test
|
|
365
|
+
* into a single `// @vitest-environment node` file, using a hand-built fake
|
|
366
|
+
* `document` (a real `EventTarget` plus the two Fullscreen-API members this
|
|
367
|
+
* port reads) for the "document present" cases instead of jsdom's real
|
|
368
|
+
* global — eliminating the environment split (and the merge gap with it)
|
|
369
|
+
* rather than leaving a genuinely-tested branch looking uncovered in the
|
|
370
|
+
* aggregate. Worth flagging for any future task in this package relying on
|
|
371
|
+
* the jsdom-file-plus-node-companion pattern for an SSR guard: verify the
|
|
372
|
+
* *merged* per-file coverage, not just the companion file's own isolated
|
|
373
|
+
* number, before trusting it clears the bar.
|
|
374
|
+
|
|
375
|
+
* Archived provenance rationale:
|
|
376
|
+
* ## Merge note (2026-07-18): reconciling with `port/renderers-react-and-annotation-canvas`
|
|
377
|
+
*
|
|
378
|
+
* This branch (`feature/jini-ui-html-viewer`) and `port/renderers-react-and-annotation-canvas`
|
|
379
|
+
* (merged to `main` first) both independently built a sandboxed-iframe HTML
|
|
380
|
+
* rendering core in this package, from the same OD origin file
|
|
381
|
+
* (`runtime/srcdoc.ts`), without either branch seeing the other's work. On
|
|
382
|
+
* merge, both cores are kept side by side rather than one replacing the
|
|
383
|
+
* other, since `@jini/ui`'s `features/html-viewer` (this branch) is a real,
|
|
384
|
+
* already-wired consumer of the `sandboxed-document.ts`/`sandbox-bridge.ts`/
|
|
385
|
+
* `new-tab-preview.ts` core (`useSandboxBridge`, `openSandboxedPreviewInNewTab`),
|
|
386
|
+
* while the `srcdoc/build.ts` core is the one wired into `buildSrcDoc`,
|
|
387
|
+
* `SrcDocBridge`, `ArtifactView`, and the annotation-canvas integration above.
|
|
388
|
+
*
|
|
389
|
+
* The two cores' public surfaces are disjoint by name **except** for three
|
|
390
|
+
* generic string-splice helpers both sides ported from the same origin
|
|
391
|
+
* function shape: `injectAfterHeadOpen`, `injectBeforeHeadEnd`,
|
|
392
|
+
* `injectBeforeBodyEnd`. They are not behaviorally identical — `srcdoc/
|
|
393
|
+
* build.ts`'s versions add a `DOMParser`-based fallback for documents with no
|
|
394
|
+
* matching `<head>`/`<body>` tag at all, which `html-utils.ts`'s versions
|
|
395
|
+
* (deliberately, per `sandboxed-document.ts`'s own already-tested contract)
|
|
396
|
+
* resolve via a plain string prepend/append instead. Both fallback behaviors
|
|
397
|
+
* are real, disclosed, and independently test-covered (`html-utils.test.ts`
|
|
398
|
+
* vs. `srcdoc/build.test.ts`'s "falls back to DOMParser" cases), so rather
|
|
399
|
+
* than pick a winner, `srcdoc/build.ts`'s versions keep their original names
|
|
400
|
+
* in the public barrel (`src/index.ts`) as the canonical/more broadly-used
|
|
401
|
+
* ones, and `html-utils.ts`'s versions are re-exported under an
|
|
402
|
+
* `injectAfterHeadOpenStringOnly`/`injectBeforeHeadEndStringOnly`/
|
|
403
|
+
* `injectBeforeBodyEndStringOnly` alias. Neither implementation changed;
|
|
404
|
+
* `sandboxed-document.ts` still imports its own `html-utils.ts` internally
|
|
405
|
+
* under the original names, unaffected by the barrel-level alias.
|
|
406
|
+
*
|
|
407
|
+
* No other real naming collisions were found between the two cores'
|
|
408
|
+
* `package.json`, `types.ts`, or barrel exports — `package.json`'s
|
|
409
|
+
* dependency/devDependency lists were a union merge (both sides' React
|
|
410
|
+
* version pins already matched); `types.ts`'s two additions
|
|
411
|
+
* (`SandboxedDocumentOptions`/`SandboxedDocumentResult`/`SandboxBridgeMessage`/
|
|
412
|
+
* `SandboxBridgeHandler` from this branch, `ArtifactFile` + the `@jini/
|
|
413
|
+
* chat-core` manifest-vocabulary re-exports from `port/renderers-react-and-
|
|
414
|
+
* annotation-canvas`) are simply concatenated, not merged shape-for-shape,
|
|
415
|
+
* since neither side redeclares anything the other already had.
|
|
416
|
+
*
|
|
417
|
+
* ---
|
|
418
|
+
*/
|
|
1
419
|
// @jini-ai/ui — generic, product-neutral UI primitives.
|
|
2
|
-
// See packages/ui/README.md for scope and packages/ui/
|
|
420
|
+
// See packages/ui/README.md for scope and packages/ui/archived provenance ledger for
|
|
3
421
|
// provenance (multiple porting tasks land content here in parallel; see
|
|
4
422
|
// that file's per-section breakdown).
|
|
5
423
|
//
|
|
@@ -12,6 +430,8 @@
|
|
|
12
430
|
// points instead, so a consumer wanting e.g. `WorkingDirPicker`/`AgentIcon` never drags either
|
|
13
431
|
// in — import the specific subpath when you actually want that editor.
|
|
14
432
|
export * from './features/i18n/index.js';
|
|
433
|
+
export * from './features/admin-widgets/index.js';
|
|
434
|
+
export * from './features/panel-kit/index.js';
|
|
15
435
|
export * from './features/observability/index.js';
|
|
16
436
|
export * from './features/connectors/index.js';
|
|
17
437
|
export * from './features/progress-card/index.js';
|
|
@@ -37,7 +37,7 @@ export function ComponentKitPreview({ tokens, theme, onThemeChange }) {
|
|
|
37
37
|
'--jini-kit-preview-body-font': tokens.bodyFont,
|
|
38
38
|
'--jini-kit-preview-font-size': `${tokens.fontSize}px`,
|
|
39
39
|
};
|
|
40
|
-
const primaryText = readableTextColor(tokens.colorPrimary);
|
|
40
|
+
const primaryText = readableTextColor({ hex: tokens.colorPrimary });
|
|
41
41
|
return (_jsxs("div", { className: "jini-component-kit-preview", style: style, "data-theme": theme, children: [_jsxs("div", { className: "jini-component-kit-preview__head", children: [_jsx("strong", { children: t('Preview') }), _jsx("span", { children: t('Component kit') })] }), _jsxs("div", { className: "jini-component-kit-preview__kit", children: [_jsxs("div", { className: "jini-component-kit-preview__tabs", children: [_jsx("button", { type: "button", className: theme === 'light' ? 'active' : '', "aria-pressed": theme === 'light', onClick: () => onThemeChange('light'), children: t('Light') }), _jsx("button", { type: "button", className: theme === 'dark' ? 'active' : '', "aria-pressed": theme === 'dark', onClick: () => onThemeChange('dark'), children: t('Dark') }), _jsx("span", { children: t('Component kit') })] }), _jsxs("div", { className: "jini-component-kit-preview__stage", children: [_jsxs("span", { className: "jini-component-kit-preview__badge", children: [tokens.name, " \u00B7 ", t('Default theme')] }), _jsx("h3", { children: t('Component kit for {name}', { name: tokens.name }) }), _jsx("p", { children: tokens.description || t('A generated component style guide.') }), _jsxs("div", { className: "jini-component-kit-preview__specimen", children: [_jsxs("section", { children: [_jsx("h4", { children: t('Buttons') }), _jsx("small", { children: t('Common button variants at this theme\'s tokens.') }), _jsxs("div", { className: "jini-component-kit-preview__button-row", children: [_jsx("button", { type: "button", className: "primary", style: { color: primaryText }, children: t('Primary') }), _jsx("button", { type: "button", children: t('Default') }), _jsx("button", { type: "button", className: "dashed", children: t('Dashed') }), _jsx("button", { type: "button", className: "text", children: t('Text') }), _jsx("button", { type: "button", className: "link", children: t('Link') })] }), _jsxs("div", { className: "jini-component-kit-preview__size-row", children: [_jsx("button", { type: "button", className: "primary small", style: { color: primaryText }, children: t('Small') }), _jsx("button", { type: "button", className: "primary", style: { color: primaryText }, children: t('Medium') }), _jsx("button", { type: "button", className: "primary large", style: { color: primaryText }, children: t('Large') })] })] }), _jsxs("section", { children: [_jsx("h4", { children: t('Type scale') }), _jsxs("small", { children: [tokens.displayFont, " \u00B7 ", tokens.bodyFont] }), _jsxs("div", { className: "jini-component-kit-preview__type-row", children: [_jsx("strong", { children: "Aa" }), _jsx("span", { children: "Aa" }), _jsx("small", { children: "Aa" })] })] })] })] })] }), _jsxs("div", { className: "jini-component-kit-preview__token-row", "aria-label": t('Extracted tokens'), children: [_jsx(TokenChip, { label: "colorPrimary", hex: tokens.colorPrimary }), _jsx(TokenChip, { label: "colorPrimaryBg", hex: tokens.colorPrimaryBg }), _jsx(TokenChip, { label: "colorPrimaryHover", hex: tokens.colorPrimaryHover }), _jsx(TokenChip, { label: "colorPrimaryActive", hex: tokens.colorPrimaryActive }), _jsx(ValueChip, { label: "fontSize", value: String(tokens.fontSize) }), _jsx(ValueChip, { label: "borderRadius", value: String(tokens.radius) })] })] }));
|
|
42
42
|
}
|
|
43
43
|
//# sourceMappingURL=ComponentKitPreview.js.map
|
|
@@ -4,7 +4,7 @@ interface Props {
|
|
|
4
4
|
size?: number;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Renders
|
|
7
|
+
* Renders an editor/target glyph by string key using the host's theme, with a
|
|
8
8
|
* graceful neutral folder-tile fallback for unregistered ids. Same
|
|
9
9
|
* lookup-table shape as `Icon`/`AgentIcon`/`RemixIcon`, but keyed on inline
|
|
10
10
|
* SVG glyphs + a bg/fg color pair instead of an external asset or webfont
|
|
@@ -11,23 +11,23 @@ function vscodeLogo(size) {
|
|
|
11
11
|
}
|
|
12
12
|
function finderLogo(size) {
|
|
13
13
|
const s = size * 0.78;
|
|
14
|
-
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("rect", { width: "24", height: "24", rx: "5.4", fill: "
|
|
14
|
+
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("rect", { width: "24", height: "24", rx: "5.4", fill: "var(--jini-primary)" }), _jsx("path", { d: "M12 0h6.6A5.4 5.4 0 0 1 24 5.4v13.2a5.4 5.4 0 0 1-5.4 5.4H12Z", fill: "var(--jini-primary)" }), _jsx("path", { d: "M11.6 2.2c-1.4 2.4-2.1 5.5-2.1 9.8s.7 7.4 2.1 9.8", fill: "none", stroke: "var(--jini-text)", strokeWidth: "1.2", strokeLinecap: "round" }), _jsx("path", { d: "M7.4 9.1h.1M16.4 9.1h.1", stroke: "var(--jini-text)", strokeWidth: "1.8", strokeLinecap: "round" }), _jsx("path", { d: "M7.4 15.2c2.9 1.6 6.3 1.6 9.2 0", fill: "none", stroke: "var(--jini-text)", strokeWidth: "1.2", strokeLinecap: "round" })] }));
|
|
15
15
|
}
|
|
16
16
|
function terminalLogo(size) {
|
|
17
17
|
const s = size * 0.76;
|
|
18
|
-
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [_jsx("rect", { x: "1.5", y: "3", width: "21", height: "18", rx: "3", fill: "
|
|
18
|
+
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [_jsx("rect", { x: "1.5", y: "3", width: "21", height: "18", rx: "3", fill: "var(--jini-text)" }), _jsx("path", { d: "m6.2 8 4 4-4 4", stroke: "var(--jini-success)", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M12.8 16h5", stroke: "var(--jini-success)", strokeWidth: "2.2", strokeLinecap: "round" })] }));
|
|
19
19
|
}
|
|
20
20
|
function folderLogo(size) {
|
|
21
21
|
const s = size * 0.76;
|
|
22
|
-
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("path", { d: "M2.75 5.75A2.75 2.75 0 0 1 5.5 3h4.32c.74 0 1.43.36 1.86.96l1.1 1.54h5.72a2.75 2.75 0 0 1 2.75 2.75v9.5a2.75 2.75 0 0 1-2.75 2.75h-13A2.75 2.75 0 0 1 2.75 17.75z", fill: "currentColor" }), _jsx("path", { d: "M3.7 8.1h16.6", stroke: "
|
|
22
|
+
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("path", { d: "M2.75 5.75A2.75 2.75 0 0 1 5.5 3h4.32c.74 0 1.43.36 1.86.96l1.1 1.54h5.72a2.75 2.75 0 0 1 2.75 2.75v9.5a2.75 2.75 0 0 1-2.75 2.75h-13A2.75 2.75 0 0 1 2.75 17.75z", fill: "currentColor" }), _jsx("path", { d: "M3.7 8.1h16.6", stroke: "var(--jini-bg)", strokeWidth: "1.25", strokeLinecap: "round", opacity: ".7" })] }));
|
|
23
23
|
}
|
|
24
24
|
function qoderLogo(size) {
|
|
25
25
|
const s = size * 0.76;
|
|
26
|
-
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("rect", { width: "24", height: "24", rx: "5", fill: "
|
|
26
|
+
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("rect", { width: "24", height: "24", rx: "5", fill: "var(--jini-warning)" }), _jsx("path", { d: "M12 4 20 12l-8 8-8-8 8-8Z", fill: "var(--jini-muted)" }), _jsx("path", { d: "M12 8.2 15.8 12 12 15.8 8.2 12 12 8.2Z", fill: "var(--jini-text)", opacity: ".2" })] }));
|
|
27
27
|
}
|
|
28
28
|
function antigravityLogo(size) {
|
|
29
29
|
const s = size * 0.78;
|
|
30
|
-
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [_jsx("rect", { width: "24", height: "24", rx: "5", fill: "
|
|
30
|
+
return (_jsxs("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [_jsx("rect", { width: "24", height: "24", rx: "5", fill: "var(--jini-bg)" }), _jsx("path", { d: "M6.5 15.4c1.5 2.4 5.1 3.2 8 1.8 2.9-1.4 4.2-4.5 2.7-6.9", stroke: "var(--jini-primary)", strokeWidth: "2.1", strokeLinecap: "round" }), _jsx("path", { d: "M17.5 8.6c-1.5-2.4-5.1-3.2-8-1.8-2.9 1.4-4.2 4.5-2.7 6.9", stroke: "var(--jini-danger)", strokeWidth: "2.1", strokeLinecap: "round" }), _jsx("path", { d: "M8.2 8.3 12 12l3.8 3.7", stroke: "var(--jini-success)", strokeWidth: "2.1", strokeLinecap: "round" }), _jsx("circle", { cx: "12", cy: "12", r: "2", fill: "var(--jini-warning)" })] }));
|
|
31
31
|
}
|
|
32
32
|
const cursorPath = 'M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23';
|
|
33
33
|
const zedPath = 'M2.25 1.5a.75.75 0 0 0-.75.75v16.5H0V2.25A2.25 2.25 0 0 1 2.25 0h20.095c1.002 0 1.504 1.212.795 1.92L10.764 14.298h3.486V12.75h1.5v1.922a1.125 1.125 0 0 1-1.125 1.125H9.264l-2.578 2.578h11.689V9h1.5v9.375a1.5 1.5 0 0 1-1.5 1.5H5.185L2.562 22.5H21.75a.75.75 0 0 0 .75-.75V5.25H24v16.5A2.25 2.25 0 0 1 21.75 24H1.655C.653 24 .151 22.788.86 22.08L13.19 9.75H9.75v1.5h-1.5V9.375A1.125 1.125 0 0 1 9.375 8.25h5.314l2.625-2.625H5.625V15h-1.5V5.625a1.5 1.5 0 0 1 1.5-1.5h13.19L21.438 1.5z';
|
|
@@ -37,23 +37,23 @@ const webstormPath = 'M0 0v24h24V0H0zm17.889 2.889c1.444 0 2.667.444 3.667 1.278
|
|
|
37
37
|
const ideaPath = 'M0 0v24h24V0zm3.723 3.111h5v1.834h-1.39v6.277h1.39v1.834h-5v-1.834h1.444V4.945H3.723zm11.055 0H17v6.5c0 .612-.055 1.111-.222 1.556-.167.444-.39.777-.723 1.11-.277.279-.666.557-1.11.668a3.933 3.933 0 0 1-1.445.278c-.778 0-1.444-.167-1.944-.445a4.81 4.81 0 0 1-1.279-1.056l1.39-1.555c.277.334.555.555.833.722.277.167.611.278.945.278.389 0 .721-.111 1-.389.221-.278.333-.667.333-1.278zM2.222 19.5h9V21h-9z';
|
|
38
38
|
const warpPath = 'M12.035 2.723h9.253A2.712 2.712 0 0 1 24 5.435v10.529a2.712 2.712 0 0 1-2.712 2.713H8.047Zm-1.681 2.6L6.766 19.677h5.598l-.399 1.6H2.712A2.712 2.712 0 0 1 0 18.565V8.036a2.712 2.712 0 0 1 2.712-2.712Z';
|
|
39
39
|
const EDITORS = {
|
|
40
|
-
vscode: { bg: '
|
|
41
|
-
cursor: { bg: '
|
|
42
|
-
windsurf: { bg: '
|
|
43
|
-
zed: { bg: '
|
|
44
|
-
qoder: { bg: '
|
|
45
|
-
antigravity: { bg: '
|
|
46
|
-
webstorm: { bg: '
|
|
47
|
-
idea: { bg: '
|
|
48
|
-
xcode: { bg: '
|
|
49
|
-
finder: { bg: '
|
|
50
|
-
explorer: { bg: '
|
|
51
|
-
'file-manager': { bg: '
|
|
52
|
-
terminal: { bg: '
|
|
53
|
-
warp: { bg: '
|
|
40
|
+
vscode: { bg: 'var(--jini-primary)', fg: 'var(--jini-bg)', glyph: vscodeLogo },
|
|
41
|
+
cursor: { bg: 'var(--jini-text)', fg: 'var(--jini-bg)', glyph: simplePath(cursorPath) },
|
|
42
|
+
windsurf: { bg: 'var(--jini-bg)', fg: 'var(--jini-text)', glyph: simplePath(windsurfPath) },
|
|
43
|
+
zed: { bg: 'var(--jini-primary)', fg: 'var(--jini-bg)', glyph: simplePath(zedPath) },
|
|
44
|
+
qoder: { bg: 'var(--jini-warning)', fg: 'var(--jini-text)', glyph: qoderLogo },
|
|
45
|
+
antigravity: { bg: 'var(--jini-bg)', fg: 'var(--jini-text)', glyph: antigravityLogo },
|
|
46
|
+
webstorm: { bg: 'var(--jini-text)', fg: 'var(--jini-bg)', glyph: simplePath(webstormPath) },
|
|
47
|
+
idea: { bg: 'var(--jini-text)', fg: 'var(--jini-bg)', glyph: simplePath(ideaPath) },
|
|
48
|
+
xcode: { bg: 'var(--jini-primary)', fg: 'var(--jini-bg)', glyph: simplePath(xcodePath) },
|
|
49
|
+
finder: { bg: 'var(--jini-primary)', fg: 'var(--jini-bg)', glyph: finderLogo },
|
|
50
|
+
explorer: { bg: 'var(--jini-warning)', fg: 'var(--jini-text)', glyph: folderLogo },
|
|
51
|
+
'file-manager': { bg: 'var(--jini-muted)', fg: 'var(--jini-bg)', glyph: folderLogo },
|
|
52
|
+
terminal: { bg: 'var(--jini-text)', fg: 'var(--jini-success)', glyph: terminalLogo },
|
|
53
|
+
warp: { bg: 'var(--jini-primary)', fg: 'var(--jini-bg)', glyph: simplePath(warpPath) },
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
|
-
* Renders
|
|
56
|
+
* Renders an editor/target glyph by string key using the host's theme, with a
|
|
57
57
|
* graceful neutral folder-tile fallback for unregistered ids. Same
|
|
58
58
|
* lookup-table shape as `Icon`/`AgentIcon`/`RemixIcon`, but keyed on inline
|
|
59
59
|
* SVG glyphs + a bg/fg color pair instead of an external asset or webfont
|
|
@@ -66,8 +66,8 @@ export function EditorIcon({ editorId, size = 16 }) {
|
|
|
66
66
|
return (_jsx("span", { className: "editor-icon", style: {
|
|
67
67
|
width: size,
|
|
68
68
|
height: size,
|
|
69
|
-
background: '
|
|
70
|
-
color: '
|
|
69
|
+
background: 'var(--jini-muted)',
|
|
70
|
+
color: 'var(--jini-bg)',
|
|
71
71
|
}, children: _jsx("svg", { width: size * 0.6, height: size * 0.6, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" }) }) }));
|
|
72
72
|
}
|
|
73
73
|
return (_jsx("span", { className: "editor-icon", style: { width: size, height: size, background: visual.bg, color: visual.fg }, children: visual.glyph(size) }));
|
|
@@ -44,7 +44,12 @@ export declare function fallbackFilename(prefix: string): string;
|
|
|
44
44
|
* download via a transient anchor. Resolves with the saved filename; throws an
|
|
45
45
|
* Error (carrying the server message when available) on a non-OK response.
|
|
46
46
|
*/
|
|
47
|
-
export declare function exportViaHttp(exportPath
|
|
47
|
+
export declare function exportViaHttp({ exportPath, filenamePrefix }: {
|
|
48
|
+
exportPath: string;
|
|
49
|
+
filenamePrefix: string;
|
|
50
|
+
}, { fetch }?: {
|
|
51
|
+
fetch?: typeof globalThis.fetch;
|
|
52
|
+
}): Promise<{
|
|
48
53
|
filename: string;
|
|
49
54
|
}>;
|
|
50
55
|
export type ExportLabels = Partial<{
|
|
@@ -62,6 +67,8 @@ export interface ExportDiagnosticsButtonProps {
|
|
|
62
67
|
* present, used instead of the HTTP fallback. */
|
|
63
68
|
desktopBridge?: DesktopExportBridge;
|
|
64
69
|
labels?: ExportLabels;
|
|
70
|
+
/** Native fetch port used for the browser archive download. */
|
|
71
|
+
fetch?: typeof globalThis.fetch;
|
|
65
72
|
}
|
|
66
73
|
export declare const DEFAULT_EXPORT_LABELS: {
|
|
67
74
|
button: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { requestWithTimeout } from '../../utils/browser-request.js';
|
|
4
4
|
import { Icon } from './Icon.js';
|
|
5
5
|
export const STATUS_CLEAR_MS = 6000;
|
|
6
6
|
/**
|
|
@@ -35,10 +35,10 @@ export function fallbackFilename(prefix) {
|
|
|
35
35
|
* download via a transient anchor. Resolves with the saved filename; throws an
|
|
36
36
|
* Error (carrying the server message when available) on a non-OK response.
|
|
37
37
|
*/
|
|
38
|
-
export async function exportViaHttp(exportPath, filenamePrefix) {
|
|
38
|
+
export async function exportViaHttp({ exportPath, filenamePrefix }, { fetch } = {}) {
|
|
39
39
|
// UPLOAD, not QUICK: this downloads a diagnostics archive — a large-payload transfer, the same
|
|
40
40
|
// risk profile as an asset upload, not a metadata read.
|
|
41
|
-
const res = await
|
|
41
|
+
const res = await requestWithTimeout({ url: exportPath, timeoutMs: 120_000 }, { ...(fetch === undefined ? {} : { fetch }), init: { credentials: 'same-origin' } });
|
|
42
42
|
if (!res.ok) {
|
|
43
43
|
let message = `${res.status} ${res.statusText}`;
|
|
44
44
|
try {
|
|
@@ -105,7 +105,7 @@ export function useAutoClearStatus(clearMs = STATUS_CLEAR_MS) {
|
|
|
105
105
|
* {@link ExportDiagnosticsButton} is the dumb consumer.
|
|
106
106
|
*/
|
|
107
107
|
export function useExportDiagnostics(props) {
|
|
108
|
-
const { exportPath = '/api/diagnostics/export', filenamePrefix = 'diagnostics', desktopBridge, labels, } = props;
|
|
108
|
+
const { exportPath = '/api/diagnostics/export', filenamePrefix = 'diagnostics', desktopBridge, labels, fetch, } = props;
|
|
109
109
|
const t = resolveExportLabels(labels);
|
|
110
110
|
const { status, setStatus, scheduleClear } = useAutoClearStatus();
|
|
111
111
|
const runExport = useCallback(async () => {
|
|
@@ -128,7 +128,7 @@ export function useExportDiagnostics(props) {
|
|
|
128
128
|
scheduleClear();
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
const { filename } = await exportViaHttp(exportPath, filenamePrefix);
|
|
131
|
+
const { filename } = await exportViaHttp({ exportPath, filenamePrefix }, fetch === undefined ? {} : { fetch });
|
|
132
132
|
setStatus({ kind: 'success', message: t.success(filename) });
|
|
133
133
|
scheduleClear();
|
|
134
134
|
}
|
|
@@ -137,7 +137,7 @@ export function useExportDiagnostics(props) {
|
|
|
137
137
|
setStatus({ kind: 'error', message: t.failed(message) });
|
|
138
138
|
scheduleClear();
|
|
139
139
|
}
|
|
140
|
-
}, [desktopBridge, exportPath, filenamePrefix, scheduleClear, setStatus, status.kind, t]);
|
|
140
|
+
}, [desktopBridge, exportPath, filenamePrefix, fetch, scheduleClear, setStatus, status.kind, t]);
|
|
141
141
|
return { status, busy: status.kind === 'busy', labels: t, runExport };
|
|
142
142
|
}
|
|
143
143
|
/**
|