@jini-ai/ui 0.7.3-next.2 → 0.7.3-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/mount-renderer.d.ts +33 -0
- package/dist/browser/mount-renderer.js +14 -0
- package/dist/browser/useDismissibleDropdown.d.ts +50 -0
- package/dist/browser/useDismissibleDropdown.js +49 -0
- package/dist/core.d.ts +4 -4
- package/dist/core.js +4 -1
- package/dist/features/admin-widgets/components/InfoTip.js +5 -5
- package/dist/features/admin-widgets/components/InfoTip.rules.d.ts +1 -1
- package/dist/features/admin-widgets/components/InfoTip.rules.js +1 -1
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +3 -3
- package/dist/features/admin-widgets/components/Select/Select.js +7 -7
- package/dist/features/app-shell/SiteToast.d.ts +24 -0
- package/dist/features/app-shell/SiteToast.js +9 -0
- package/dist/features/app-shell/copyable-details.d.ts +12 -0
- package/dist/features/app-shell/copyable-details.js +17 -0
- package/dist/features/app-shell/expanded-mode.d.ts +76 -0
- package/dist/features/app-shell/expanded-mode.js +70 -0
- package/dist/features/app-shell/index.d.ts +8 -0
- package/dist/features/app-shell/index.js +8 -0
- package/dist/features/app-shell/use-delete-confirmation.hooks.d.ts +48 -0
- package/dist/features/app-shell/use-delete-confirmation.hooks.js +57 -0
- package/dist/features/app-shell/use-expanded-mode.hooks.d.ts +19 -0
- package/dist/features/app-shell/use-expanded-mode.hooks.js +39 -0
- package/dist/features/app-shell/use-site-toast.hooks.d.ts +56 -0
- package/dist/features/app-shell/use-site-toast.hooks.js +44 -0
- package/dist/features/app-shell/use-theme-preference.hooks.d.ts +30 -0
- package/dist/features/app-shell/use-theme-preference.hooks.js +42 -0
- package/dist/features/app-version/use-app-version.d.ts +53 -0
- package/dist/features/app-version/use-app-version.js +42 -0
- package/dist/features/asset-grid/react/components/AssetGrid.d.ts +1 -1
- package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
- package/dist/features/asset-grid/react/components/DeleteConfirmDialog.d.ts +1 -1
- package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
- package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.d.ts +2 -2
- package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.js +1 -1
- package/dist/features/asset-tree-browser/react/components/FilePreviewPane.d.ts +1 -1
- package/dist/features/browser-chrome/react/components/BrowserViewportControls.d.ts +1 -1
- package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
- package/dist/features/charts/table.js +4 -4
- package/dist/features/command-palette/index.d.ts +1 -0
- package/dist/features/command-palette/index.js +1 -0
- package/dist/features/command-palette/react/components/CommandPalette.d.ts +9 -9
- package/dist/features/command-palette/react/components/CommandPalette.hooks.js +28 -1
- package/dist/features/command-palette/react/components/CommandPalette.js +3 -5
- package/dist/features/connectors/ConnectorsBrowser.d.ts +1 -1
- package/dist/features/connectors/ConnectorsBrowser.js +2 -2
- package/dist/features/connectors/components/ConnectorCard.hooks.js +2 -2
- package/dist/features/connectors/components/ConnectorCard.js +4 -4
- package/dist/features/connectors/components/ConnectorDetailDrawer.d.ts +1 -1
- package/dist/features/connectors/components/ConnectorDetailDrawer.js +7 -7
- package/dist/features/connectors/components/ConnectorGrid.js +1 -1
- package/dist/features/connectors/components/ConnectorLogo.js +1 -1
- package/dist/features/connectors/components/ConnectorSearchBar.js +1 -1
- package/dist/features/connectors/components/ProviderTabBar.js +1 -1
- package/dist/features/execution/claude/env-fields.d.ts +1 -1
- package/dist/features/execution/codex/env-fields.d.ts +1 -1
- package/dist/features/execution/constants.d.ts +2 -2
- package/dist/features/execution/constants.js +1 -1
- package/dist/features/execution/dependencies.d.ts +2 -3
- package/dist/features/execution/http-adapter.d.ts +2 -3
- package/dist/features/execution/index.d.ts +0 -2
- package/dist/features/execution/react/components/AgentCliEnvFields.d.ts +1 -1
- package/dist/features/execution/react/components/AgentDiagnosticRow.d.ts +1 -1
- package/dist/features/execution/react/components/AgentDiagnosticRow.js +3 -1
- package/dist/features/execution/react/components/ByokProviderForm.d.ts +10 -2
- package/dist/features/execution/react/components/ByokProviderForm.hooks.d.ts +2 -2
- package/dist/features/execution/react/components/ByokProviderForm.js +15 -4
- package/dist/features/execution/react/components/ExecutionTab.d.ts +2 -3
- package/dist/features/execution/react/components/ExecutionTab.hooks.d.ts +14 -4
- package/dist/features/execution/react/components/ExecutionTab.hooks.js +66 -9
- package/dist/features/execution/react/components/ExecutionTab.js +27 -10
- package/dist/features/execution/react/components/LocalCliAgentCard.d.ts +4 -4
- package/dist/features/execution/react/components/LocalCliAgentList.d.ts +4 -4
- package/dist/features/execution/react/components/LocalCliAgentList.hooks.d.ts +3 -3
- package/dist/features/execution/react/components/LocalCliAgentSettings.d.ts +2 -2
- package/dist/features/execution/react/components/ProviderChipGroup.d.ts +1 -1
- package/dist/features/execution/react/components/SearchableModelSelect.d.ts +1 -1
- package/dist/features/execution/react/hooks/use-byok-field-validation.hooks.d.ts +2 -2
- package/dist/features/execution/react/hooks/use-execution-credential.hooks.d.ts +1 -1
- package/dist/features/execution/react/hooks/useExecutionTab.d.ts +2 -3
- package/dist/features/execution/react/hooks/useLocalCliAgentCard.d.ts +4 -4
- package/dist/features/execution/react/hooks/useLocalCliAgentList.d.ts +4 -4
- package/dist/features/execution/react/hooks/useReasoningControl.d.ts +3 -3
- package/dist/features/execution/rules.d.ts +6 -6
- package/dist/features/execution/rules.js +1 -1
- package/dist/features/external-mcp/react/components/ExternalMcpTab.js +4 -4
- package/dist/features/file-dropzone/react/components/FileDropzone.d.ts +1 -1
- package/dist/features/file-dropzone/react/components/FileDropzone.js +1 -1
- package/dist/features/find/find-bar-state.d.ts +58 -0
- package/dist/features/find/find-bar-state.js +45 -0
- package/dist/features/find/find-focus-clock.d.ts +19 -0
- package/dist/features/find/find-focus-clock.js +9 -0
- package/dist/features/find/find-input-focus.d.ts +88 -0
- package/dist/features/find/find-input-focus.js +88 -0
- package/dist/features/find/find-target.d.ts +141 -0
- package/dist/features/find/find-target.js +160 -0
- package/dist/features/find/index.d.ts +10 -0
- package/dist/features/find/index.js +10 -0
- package/dist/features/find/use-find-bar-effects.hooks.d.ts +14 -0
- package/dist/features/find/use-find-bar-effects.hooks.js +92 -0
- package/dist/features/find/use-find-bar-state.hooks.d.ts +43 -0
- package/dist/features/find/use-find-bar-state.hooks.js +49 -0
- package/dist/features/find/use-find-focus-reclaim.hooks.d.ts +21 -0
- package/dist/features/find/use-find-focus-reclaim.hooks.js +64 -0
- package/dist/features/find/use-find-input-binding.hooks.d.ts +18 -0
- package/dist/features/find/use-find-input-binding.hooks.js +76 -0
- package/dist/features/find-bar/FindBar.d.ts +41 -0
- package/dist/features/find-bar/FindBar.js +31 -0
- package/dist/features/find-bar/index.d.ts +2 -0
- package/dist/features/find-bar/index.js +2 -0
- package/dist/features/folder-path-drop/index.d.ts +3 -1
- package/dist/features/folder-path-drop/index.js +1 -0
- package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.d.ts +50 -0
- package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.js +50 -0
- package/dist/features/folder-path-drop/types.d.ts +14 -0
- package/dist/features/i18n/context.d.ts +1 -1
- package/dist/features/i18n/context.js +1 -1
- package/dist/features/iframe-pool/react/dom-sync.d.ts +13 -3
- package/dist/features/iframe-pool/react/dom-sync.js +7 -7
- package/dist/features/import-handoff/use-import-handoff.d.ts +38 -0
- package/dist/features/import-handoff/use-import-handoff.js +40 -0
- package/dist/features/integrations/rules.js +39 -41
- package/dist/features/interactive-ui/interactive-ui.css +1 -1
- package/dist/features/interactive-ui/providers/native/data-table.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/data-table.js +3 -3
- package/dist/features/interactive-ui/providers/shadcn/radio-group-field.js +1 -1
- package/dist/features/live-views/index.d.ts +6 -0
- package/dist/features/live-views/index.js +6 -0
- package/dist/features/live-views/use-live-views.d.ts +31 -0
- package/dist/features/live-views/use-live-views.js +88 -0
- package/dist/features/live-views/use-site-view-preference.d.ts +33 -0
- package/dist/features/live-views/use-site-view-preference.js +32 -0
- package/dist/features/live-views/use-webview-load-failure.d.ts +90 -0
- package/dist/features/live-views/use-webview-load-failure.js +122 -0
- package/dist/features/mcp-ui/credential-card.d.ts +1 -0
- package/dist/features/mcp-ui/credential-card.js +1 -1
- package/dist/features/mcp-ui/surfaces/tool-approval.d.ts +10 -0
- package/dist/features/mcp-ui/surfaces/tool-approval.js +15 -0
- package/dist/features/media-providers/dependencies.d.ts +7 -1
- package/dist/features/media-providers/dependencies.js +43 -0
- package/dist/features/media-providers/index.d.ts +2 -2
- package/dist/features/media-providers/index.js +1 -1
- package/dist/features/media-providers/ports.d.ts +39 -5
- package/dist/features/media-providers/react/components/MediaProvidersTab.d.ts +4 -3
- package/dist/features/media-providers/react/components/MediaProvidersTab.js +1 -1
- package/dist/features/media-providers/react/hooks/useMediaProvidersTab.d.ts +3 -2
- package/dist/features/media-providers/react/hooks/useMediaProvidersTab.js +41 -3
- package/dist/features/memory/react/components/MemoryConnectedPanel.js +2 -2
- package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
- package/dist/features/memory/react/components/MemoryHooksPanel.js +2 -2
- package/dist/features/memory/react/components/MemoryList.js +2 -2
- package/dist/features/memory/react/components/MemorySettingsPanel.js +2 -2
- package/dist/features/memory/react/components/MemorySuggestionPanel.js +1 -1
- package/dist/features/memory/react/hooks/useMemoryConnectors.hooks.js +3 -3
- package/dist/features/memory/react/hooks/useMemoryConnectors.rules.d.ts +4 -1
- package/dist/features/memory/react/hooks/useMemoryConnectors.rules.js +1 -1
- package/dist/features/memory/react/render-markdown.js +1 -1
- package/dist/features/nav-availability/nav-availability.d.ts +18 -0
- package/dist/features/nav-availability/nav-availability.js +12 -0
- package/dist/features/number-stepper/NumberStepper.d.ts +39 -0
- package/dist/features/number-stepper/NumberStepper.js +16 -0
- package/dist/features/number-stepper/index.d.ts +5 -0
- package/dist/features/number-stepper/index.js +5 -0
- package/dist/features/number-stepper/number-stepper.d.ts +34 -0
- package/dist/features/number-stepper/number-stepper.js +32 -0
- package/dist/features/number-stepper/use-number-stepper.hooks.d.ts +20 -0
- package/dist/features/number-stepper/use-number-stepper.hooks.js +29 -0
- package/dist/features/number-stepper/use-optimistic-number-setting.hooks.d.ts +36 -0
- package/dist/features/number-stepper/use-optimistic-number-setting.hooks.js +25 -0
- package/dist/features/panel-kit/ErrorNotice.js +8 -1
- package/dist/features/panel-kit/helpers/standing-draft-local-backup.d.ts +1 -1
- package/dist/features/panel-kit/helpers/standing-draft-recovery-message.d.ts +1 -1
- package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.d.ts +1 -37
- package/dist/features/panel-kit/hooks/use-standing-draft-recovery.hooks.d.ts +2 -1
- package/dist/features/panel-kit/hooks/use-standing-draft-state.hooks.d.ts +2 -1
- package/dist/features/panel-kit/hooks/use-standing-draft-writes.hooks.d.ts +2 -1
- package/dist/features/panel-kit/index.d.ts +2 -1
- package/dist/features/privacy/react/components/PrivacyTab.d.ts +1 -1
- package/dist/features/privacy/react/components/PrivacyTab.js +1 -1
- package/dist/features/progress-card/components/ProgressCard.d.ts +1 -1
- package/dist/features/progress-card/components/ProgressCard.js +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceBoard.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.js +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceCardParts.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceCardParts.js +7 -2
- package/dist/features/resource-dashboard/react/components/ResourceRowListView.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceRowListView.js +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.js +1 -1
- package/dist/features/resource-dashboard/react/components/StatusPill.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/StatusPill.js +1 -1
- package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +6 -1
- package/dist/features/resource-monitor/ResourceTable.d.ts +67 -0
- package/dist/features/resource-monitor/ResourceTable.js +25 -0
- package/dist/features/resource-monitor/index.d.ts +4 -0
- package/dist/features/resource-monitor/index.js +4 -0
- package/dist/features/resource-monitor/resource-stop.d.ts +16 -0
- package/dist/features/resource-monitor/resource-stop.js +11 -0
- package/dist/features/resource-monitor/use-resource-readings.hooks.d.ts +44 -0
- package/dist/features/resource-monitor/use-resource-readings.hooks.js +91 -0
- package/dist/features/settings/dialog/styles/settings-dialog.css +251 -251
- package/dist/features/site-card/index.d.ts +4 -1
- package/dist/features/site-card/index.js +3 -0
- package/dist/features/site-card/use-created-site-return.hooks.d.ts +36 -0
- package/dist/features/site-card/use-created-site-return.hooks.js +43 -0
- package/dist/features/site-card/use-site-card-preview.hooks.d.ts +39 -0
- package/dist/features/site-card/use-site-card-preview.hooks.js +31 -0
- package/dist/features/site-card/use-site-list-prefs.hooks.d.ts +29 -8
- package/dist/features/site-card/use-site-list-prefs.hooks.js +56 -9
- package/dist/features/site-card/use-site-preview.hooks.d.ts +67 -0
- package/dist/features/site-card/use-site-preview.hooks.js +94 -0
- package/dist/features/sketch-editor/react/components/SketchEditor.d.ts +2 -2
- package/dist/features/sketch-editor/react/components/SketchEditor.js +1 -1
- package/dist/features/skills/react/components/SkillRow.js +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigAddForm.js +2 -2
- package/dist/features/source-config-list/react/components/SourceConfigField.js +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigItemCard.js +5 -5
- package/dist/features/source-config-list/react/components/SourceConfigList.d.ts +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigList.js +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigListView.js +3 -3
- package/dist/features/source-config-list/react/components/SourceConfigTestControl.d.ts +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigTestControl.js +1 -1
- package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.d.ts +1 -1
- package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.js +1 -1
- package/dist/features/tab-strip/react/components/TabBar.js +2 -2
- package/dist/features/tab-strip/react/components/TabStrip.d.ts +1 -1
- package/dist/features/tab-strip/react/components/TabStrip.js +1 -1
- package/dist/features/tab-strip/scrollable.js +0 -2
- package/dist/features/tabbed-dialog/react/components/TabbedDialog.d.ts +1 -1
- package/dist/features/tabbed-dialog/react/components/TabbedDialog.js +1 -1
- package/dist/features/version-manager/react/components/VersionManagerModal.d.ts +1 -1
- package/dist/features/version-manager/react/components/VersionManagerModal.js +1 -1
- package/dist/features/viewer-shell/react/components/CommentSidePanel.d.ts +2 -2
- package/dist/features/viewer-shell/react/components/CommentSidePanel.js +1 -1
- package/dist/features/viewer-shell/react/components/MarkdownSplitPane.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/MarkdownSplitPane.js +1 -1
- package/dist/features/viewer-shell/react/components/SegmentedToggle.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/SegmentedToggle.js +1 -1
- package/dist/features/viewer-shell/react/components/ViewportSwitcher.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
- package/dist/features/viewer-shell/react/components/ViewportToggleGroup.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/ViewportToggleGroup.js +1 -1
- package/dist/features/zoom/use-zoom.d.ts +141 -0
- package/dist/features/zoom/use-zoom.js +204 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/react/components/ComponentKitPreview.d.ts +1 -1
- package/dist/react/components/ComponentKitPreview.js +1 -1
- package/dist/react/components/CustomSelect.js +1 -1
- package/dist/react/components/ExportDiagnosticsButton.d.ts +6 -2
- package/dist/react/components/ExportDiagnosticsButton.js +3 -3
- package/dist/react/components/FileImportPanel.js +1 -1
- package/dist/react/components/IconFrame.d.ts +15 -0
- package/dist/react/components/IconFrame.js +11 -0
- package/dist/react/components/ImportChoice.js +1 -1
- package/dist/react/components/Notice.js +1 -1
- package/dist/react/components/OnboardingDropdown.js +1 -1
- package/dist/react/components/PaletteTweaks.js +1 -1
- package/dist/react/components/TooltipLayer.d.ts +13 -3
- package/dist/react/components/TooltipLayer.js +12 -12
- package/dist/react/mcp-ui/host-message-source.d.ts +3 -1
- package/dist/react/mcp-ui/host-message-source.js +1 -1
- package/dist/react/testing.js +3 -1
- package/dist/renderers/annotation-canvas/rules.js +30 -27
- package/dist/renderers/react/components/ArtifactView.js +1 -1
- package/dist/renderers/renderers/markdown.d.ts +3 -1
- package/dist/renderers/renderers/markdown.js +2 -2
- package/dist/styles/admin.css +54 -54
- package/dist/utils/zip.js +43 -36
- package/package.json +66 -9
- package/dist/features/execution/ports.d.ts +0 -71
- package/dist/features/execution/ports.js +0 -2
- package/dist/features/execution/types.d.ts +0 -472
- package/dist/features/execution/types.js +0 -2
- package/dist/react/components/CustomSelectMarkup.d.ts +0 -27
- package/dist/react/components/CustomSelectMarkup.js +0 -35
package/dist/index.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ export * from './react/hooks/usePersistedDisclosure.js';
|
|
|
106
106
|
export * from './browser/useModalWindowDragGuard.js';
|
|
107
107
|
export * from './browser/index.js';
|
|
108
108
|
export { Icon, type IconName } from './react/components/Icon.js';
|
|
109
|
+
export { IconFrame, type IconFrameProps } from './react/components/IconFrame.js';
|
|
109
110
|
export { ICON_PATH_DATA } from './react/components/icon-path-data.js';
|
|
110
111
|
export * from './react/components/RemixIcon.js';
|
|
111
112
|
export { SecretInput, SecretTextarea, type SecretInputProps, type SecretTextareaProps } from './react/components/SecretInput.js';
|
package/dist/index.js
CHANGED
|
@@ -113,6 +113,7 @@ export * from './browser/index.js';
|
|
|
113
113
|
// seam for asserting the name -> renderer lookup table directly. It must
|
|
114
114
|
// not reach this published package's public surface.
|
|
115
115
|
export { Icon } from './react/components/Icon.js';
|
|
116
|
+
export { IconFrame } from './react/components/IconFrame.js';
|
|
116
117
|
export { ICON_PATH_DATA } from './react/components/icon-path-data.js';
|
|
117
118
|
export * from './react/components/RemixIcon.js';
|
|
118
119
|
export { SecretInput, SecretTextarea } from './react/components/SecretInput.js';
|
|
@@ -40,7 +40,7 @@ export interface ComponentKitPreviewProps {
|
|
|
40
40
|
* shape; that markdown-parsing pipeline is OD-specific product logic (their
|
|
41
41
|
* "design.md" spec format) and is not ported — same call already made for
|
|
42
42
|
* the color-mixing math this component leans on (`readableTextColor`, see
|
|
43
|
-
* `
|
|
43
|
+
* `070311a07^:packages/ui/source-map.md` (section "flat atoms — `scrollWorkspaceTabsWithWheel` + `DesignSystemFlow` color math"), color-math subsection: "what was deliberately
|
|
44
44
|
* left behind"). This component instead takes the already-resolved token
|
|
45
45
|
* model directly, genericizing the token *source* to whatever the host
|
|
46
46
|
* computes it from.
|
|
@@ -14,7 +14,7 @@ import { ValueChip } from './ValueChip.js';
|
|
|
14
14
|
* shape; that markdown-parsing pipeline is OD-specific product logic (their
|
|
15
15
|
* "design.md" spec format) and is not ported — same call already made for
|
|
16
16
|
* the color-mixing math this component leans on (`readableTextColor`, see
|
|
17
|
-
* `
|
|
17
|
+
* `070311a07^:packages/ui/source-map.md` (section "flat atoms — `scrollWorkspaceTabsWithWheel` + `DesignSystemFlow` color math"), color-math subsection: "what was deliberately
|
|
18
18
|
* left behind"). This component instead takes the already-resolved token
|
|
19
19
|
* model directly, genericizing the token *source* to whatever the host
|
|
20
20
|
* computes it from.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
// NOTE: verified zero real consumers in the vendored source snapshot before
|
|
3
|
-
// porting (see
|
|
3
|
+
// porting (see `070311a07^:packages/ui/source-map.md` (section "ui-extraction-plan.md §A — flat-group items")) — shipped anyway since it's small,
|
|
4
4
|
// self-contained, and correct; a host may still find it useful as a select
|
|
5
5
|
// primitive with grouped options and optional portal-rendered menu.
|
|
6
6
|
//
|
|
@@ -36,9 +36,13 @@ export type ExportStatus = {
|
|
|
36
36
|
* the three regex branches captures a non-empty group, so a successful match
|
|
37
37
|
* always yields a defined `raw`.
|
|
38
38
|
*/
|
|
39
|
-
export declare function fileNameFromHeader(header
|
|
39
|
+
export declare function fileNameFromHeader({ header }: {
|
|
40
|
+
header: string | null;
|
|
41
|
+
}, _optional?: Record<string, never>): string | null;
|
|
40
42
|
/** Timestamped `<prefix>-<iso>.zip` name for the browser-download fallback. */
|
|
41
|
-
export declare function fallbackFilename(prefix
|
|
43
|
+
export declare function fallbackFilename({ prefix }: {
|
|
44
|
+
prefix: string;
|
|
45
|
+
}, _optional?: Record<string, never>): string;
|
|
42
46
|
/**
|
|
43
47
|
* Fetch the archive from a same-origin HTTP endpoint and trigger a browser
|
|
44
48
|
* download via a transient anchor. Resolves with the saved filename; throws an
|
|
@@ -11,7 +11,7 @@ export const STATUS_CLEAR_MS = 6000;
|
|
|
11
11
|
* the three regex branches captures a non-empty group, so a successful match
|
|
12
12
|
* always yields a defined `raw`.
|
|
13
13
|
*/
|
|
14
|
-
export function fileNameFromHeader(header) {
|
|
14
|
+
export function fileNameFromHeader({ header }, _optional = {}) {
|
|
15
15
|
if (header == null)
|
|
16
16
|
return null;
|
|
17
17
|
const match = /filename\*=UTF-8''([^;\n]+)|filename="([^"]+)"|filename=([^;\n]+)/i.exec(header);
|
|
@@ -26,7 +26,7 @@ export function fileNameFromHeader(header) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
/** Timestamped `<prefix>-<iso>.zip` name for the browser-download fallback. */
|
|
29
|
-
export function fallbackFilename(prefix) {
|
|
29
|
+
export function fallbackFilename({ prefix }, _optional = {}) {
|
|
30
30
|
const stamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
31
31
|
return `${prefix}-${stamp}.zip`;
|
|
32
32
|
}
|
|
@@ -52,7 +52,7 @@ export async function exportViaHttp({ exportPath, filenamePrefix }, { fetch } =
|
|
|
52
52
|
throw new Error(message);
|
|
53
53
|
}
|
|
54
54
|
const blob = await res.blob();
|
|
55
|
-
const filename = fileNameFromHeader(res.headers.get('content-disposition')) ?? fallbackFilename(filenamePrefix);
|
|
55
|
+
const filename = fileNameFromHeader({ header: res.headers.get('content-disposition') }) ?? fallbackFilename({ prefix: filenamePrefix });
|
|
56
56
|
const url = URL.createObjectURL(blob);
|
|
57
57
|
try {
|
|
58
58
|
const link = document.createElement('a');
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
// hardcoded its "Import"/"Importing…" button copy directly in JSX (title/
|
|
6
6
|
// body/fileLabel were already caller-supplied props); that copy now goes
|
|
7
7
|
// through `useT()` per this package's i18n policy. See
|
|
8
|
-
//
|
|
8
|
+
// `070311a07^:packages/ui/source-map.md` (section "bucket-A flat atoms").
|
|
9
9
|
import { useT } from '../../features/i18n/index.js';
|
|
10
10
|
export function FileImportPanel({ title, body, accept, working, fileLabel, folder, canSubmit, onChange, onImport, className, useTHook = useT, }) {
|
|
11
11
|
const t = useTHook();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
export interface IconFrameProps {
|
|
3
|
+
/** The glyph's shapes (`<path>`, `<rect>`, `<circle>`), drawn on the 20-unit grid. */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** A host class added beside the frame's own `jini-icon-frame`, when the host's CSS sizes its icons. */
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The shared 20-unit line-icon frame: one stroke weight, cap and join for every glyph a host draws
|
|
10
|
+
* inline, decorative (`aria-hidden`), coloured by `currentColor`. A module of its own, with JSX only
|
|
11
|
+
* at render, so a host can split its glyph tables across modules (one with module-level JSX tables,
|
|
12
|
+
* one rendered lazily) without either importing the other just for the frame.
|
|
13
|
+
*/
|
|
14
|
+
export declare function IconFrame({ children, className }: IconFrameProps): JSX.Element;
|
|
15
|
+
//# sourceMappingURL=IconFrame.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The shared 20-unit line-icon frame: one stroke weight, cap and join for every glyph a host draws
|
|
4
|
+
* inline, decorative (`aria-hidden`), coloured by `currentColor`. A module of its own, with JSX only
|
|
5
|
+
* at render, so a host can split its glyph tables across modules (one with module-level JSX tables,
|
|
6
|
+
* one rendered lazily) without either importing the other just for the frame.
|
|
7
|
+
*/
|
|
8
|
+
export function IconFrame({ children, className }) {
|
|
9
|
+
return (_jsx("svg", { className: className ? `jini-icon-frame ${className}` : 'jini-icon-frame', viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: children }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=IconFrame.js.map
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
// / "Upload zip" / "Upload folder"). Origin: `ImportChoice` in
|
|
4
4
|
// `PluginsView.tsx` (OD), verbatim structural port — all copy
|
|
5
5
|
// (title/body) is supplied by the caller as props, so there was nothing
|
|
6
|
-
// product-specific to strip. See
|
|
6
|
+
// product-specific to strip. See `070311a07^:packages/ui/source-map.md` (section "bucket-A flat atoms").
|
|
7
7
|
import { Icon } from './Icon.js';
|
|
8
8
|
export function ImportChoice({ active, icon, title, body, onClick, className }) {
|
|
9
9
|
return (_jsxs("button", { type: "button", className: [
|
|
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
// carrying the same three optional fields any "ran an operation, got a
|
|
7
7
|
// result + warnings + a log" flow would need. Every user-facing string now
|
|
8
8
|
// goes through `useT()` — the origin hardcoded "Install log" and the
|
|
9
|
-
// warning-count pluralization. See
|
|
9
|
+
// warning-count pluralization. See `070311a07^:packages/ui/source-map.md` (section "bucket-A flat atoms").
|
|
10
10
|
import { useT } from '../../features/i18n/index.js';
|
|
11
11
|
export function Notice({ outcome, logLabel, className, useTHook = useT }) {
|
|
12
12
|
const t = useTHook();
|
|
@@ -17,7 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
// available'` for an empty non-searchable field (the origin's fallback
|
|
18
18
|
// text talked about "text models", which was itself a leftover from the
|
|
19
19
|
// one call site it happened to serve, not a generic empty state).
|
|
20
|
-
// See
|
|
20
|
+
// See `070311a07^:packages/ui/source-map.md` (section "bucket-A flat atoms").
|
|
21
21
|
//
|
|
22
22
|
// Shape: this module follows the package's "dumb component + co-located
|
|
23
23
|
// testable hooks" pattern (see `TooltipLayer.tsx`). All state, refs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// NOTE: verified zero real consumers in the vendored source snapshot before
|
|
3
|
-
// porting (see
|
|
3
|
+
// porting (see `070311a07^:packages/ui/source-map.md` (section "ui-extraction-plan.md §A — flat-group items")) — shipped anyway since it's small,
|
|
4
4
|
// self-contained, and correct.
|
|
5
5
|
//
|
|
6
6
|
// Structure follows the "dumb component + co-located testable hook(s)"
|
|
@@ -14,10 +14,20 @@ export interface TooltipState {
|
|
|
14
14
|
export declare const TOOLTIP_MARGIN = 8;
|
|
15
15
|
export declare const TOOLTIP_GAP = 7;
|
|
16
16
|
export declare function isTooltipTarget(el: Element | null): el is HTMLElement;
|
|
17
|
-
export declare function readTooltipTarget(start
|
|
17
|
+
export declare function readTooltipTarget({ start }: {
|
|
18
|
+
start: EventTarget | null;
|
|
19
|
+
}, _optional?: Record<string, never>): HTMLElement | null;
|
|
18
20
|
export declare function tooltipPlacement(target: HTMLElement): TooltipPlacement;
|
|
19
|
-
export declare function clamp(value
|
|
20
|
-
|
|
21
|
+
export declare function clamp({ value, min, max }: {
|
|
22
|
+
value: number;
|
|
23
|
+
min: number;
|
|
24
|
+
max: number;
|
|
25
|
+
}, _optional?: Record<string, never>): number;
|
|
26
|
+
export declare function positionTooltip({ target, tooltip, placement }: {
|
|
27
|
+
target: HTMLElement;
|
|
28
|
+
tooltip: HTMLElement;
|
|
29
|
+
placement: TooltipPlacement;
|
|
30
|
+
}, _optional?: Record<string, never>): TooltipState['style'];
|
|
21
31
|
export declare function sameStyle(left: TooltipState['style'], right: TooltipState['style']): boolean;
|
|
22
32
|
export interface UseTooltipLayerResult {
|
|
23
33
|
/** The tooltip to render, or `null` when nothing is shown. */
|
|
@@ -13,7 +13,7 @@ export function isTooltipTarget(el) {
|
|
|
13
13
|
&& Boolean(el.dataset.tooltip?.trim())
|
|
14
14
|
&& el.getAttribute('aria-expanded') !== 'true';
|
|
15
15
|
}
|
|
16
|
-
export function readTooltipTarget(start) {
|
|
16
|
+
export function readTooltipTarget({ start }, _optional = {}) {
|
|
17
17
|
if (!(start instanceof Element))
|
|
18
18
|
return null;
|
|
19
19
|
const candidate = start.closest('.jini-tooltip[data-tooltip]');
|
|
@@ -23,10 +23,10 @@ export function tooltipPlacement(target) {
|
|
|
23
23
|
const raw = target.dataset.tooltipPlacement;
|
|
24
24
|
return raw === 'bottom' || raw === 'left' || raw === 'right' ? raw : 'top';
|
|
25
25
|
}
|
|
26
|
-
export function clamp(value, min, max) {
|
|
26
|
+
export function clamp({ value, min, max }, _optional = {}) {
|
|
27
27
|
return Math.max(min, Math.min(max, value));
|
|
28
28
|
}
|
|
29
|
-
export function positionTooltip(target, tooltip, placement) {
|
|
29
|
+
export function positionTooltip({ target, tooltip, placement }, _optional = {}) {
|
|
30
30
|
const rect = target.getBoundingClientRect();
|
|
31
31
|
const tip = tooltip.getBoundingClientRect();
|
|
32
32
|
const viewportWidth = window.innerWidth;
|
|
@@ -50,8 +50,8 @@ export function positionTooltip(target, tooltip, placement) {
|
|
|
50
50
|
// 'top': the centred-above position computed above already applies.
|
|
51
51
|
}
|
|
52
52
|
return {
|
|
53
|
-
x: Math.round(clamp(left, TOOLTIP_MARGIN, maxLeft)),
|
|
54
|
-
y: Math.round(clamp(top, TOOLTIP_MARGIN, maxTop)),
|
|
53
|
+
x: Math.round(clamp({ value: left, min: TOOLTIP_MARGIN, max: maxLeft })),
|
|
54
|
+
y: Math.round(clamp({ value: top, min: TOOLTIP_MARGIN, max: maxTop })),
|
|
55
55
|
visibility: 'visible',
|
|
56
56
|
};
|
|
57
57
|
}
|
|
@@ -81,7 +81,7 @@ function nextStateForPosition({ current, node }) {
|
|
|
81
81
|
return current;
|
|
82
82
|
const placement = tooltipPlacement(current.target);
|
|
83
83
|
const nextText = current.target.dataset.tooltip?.trim() ?? current.text;
|
|
84
|
-
const nextStyle = positionTooltip(current.target, node, placement);
|
|
84
|
+
const nextStyle = positionTooltip({ target: current.target, tooltip: node, placement });
|
|
85
85
|
if (current.text === nextText
|
|
86
86
|
&& current.placement === placement
|
|
87
87
|
&& sameStyle(current.style, nextStyle)) {
|
|
@@ -153,14 +153,14 @@ function createPointerHandlers(deps) {
|
|
|
153
153
|
lastInputRef.current = 'pointer';
|
|
154
154
|
if (event.pointerType === 'touch')
|
|
155
155
|
return;
|
|
156
|
-
const target = readTooltipTarget(event.target);
|
|
156
|
+
const target = readTooltipTarget({ start: event.target });
|
|
157
157
|
if (target)
|
|
158
158
|
showTooltip(target);
|
|
159
159
|
},
|
|
160
160
|
onTargetExit: (event) => {
|
|
161
161
|
if ('pointerType' in event && event.pointerType === 'touch')
|
|
162
162
|
return;
|
|
163
|
-
const target = readTooltipTarget(event.target);
|
|
163
|
+
const target = readTooltipTarget({ start: event.target });
|
|
164
164
|
if (!target)
|
|
165
165
|
return;
|
|
166
166
|
const next = event.relatedTarget;
|
|
@@ -170,7 +170,7 @@ function createPointerHandlers(deps) {
|
|
|
170
170
|
},
|
|
171
171
|
onPointerDown: (event) => {
|
|
172
172
|
lastInputRef.current = 'pointer';
|
|
173
|
-
const target = readTooltipTarget(event.target);
|
|
173
|
+
const target = readTooltipTarget({ start: event.target });
|
|
174
174
|
touchTapRef.current = null;
|
|
175
175
|
if (event.pointerType === 'touch' && target) {
|
|
176
176
|
touchTapRef.current = { target, wasOpen: openTargetRef.current === target };
|
|
@@ -184,7 +184,7 @@ function createPointerHandlers(deps) {
|
|
|
184
184
|
hideTooltip();
|
|
185
185
|
},
|
|
186
186
|
onClick: (event) => {
|
|
187
|
-
const target = readTooltipTarget(event.target);
|
|
187
|
+
const target = readTooltipTarget({ start: event.target });
|
|
188
188
|
const touchTap = touchTapRef.current;
|
|
189
189
|
touchTapRef.current = null;
|
|
190
190
|
if (target && touchTap?.target === target && !touchTap.wasOpen) {
|
|
@@ -209,7 +209,7 @@ function createFocusKeyHandlers(deps) {
|
|
|
209
209
|
};
|
|
210
210
|
return {
|
|
211
211
|
onFocusIn: (event) => {
|
|
212
|
-
const target = readTooltipTarget(event.target);
|
|
212
|
+
const target = readTooltipTarget({ start: event.target });
|
|
213
213
|
if (!target)
|
|
214
214
|
return;
|
|
215
215
|
if (shouldShowForFocus(target)) {
|
|
@@ -223,7 +223,7 @@ function createFocusKeyHandlers(deps) {
|
|
|
223
223
|
if (event.key === 'Escape')
|
|
224
224
|
hideTooltip();
|
|
225
225
|
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
|
|
226
|
-
hideTooltipForActivation(readTooltipTarget(event.target));
|
|
226
|
+
hideTooltipForActivation(readTooltipTarget({ start: event.target }));
|
|
227
227
|
}
|
|
228
228
|
},
|
|
229
229
|
};
|
|
@@ -31,7 +31,9 @@ export declare function forwardWindowMessages(scope: {
|
|
|
31
31
|
readonly window?: MessageEventTarget;
|
|
32
32
|
}, into: EarlyMessageBuffer): void;
|
|
33
33
|
/** How a Host receives raw window messages. Injectable so a test can drive one without a real `postMessage`. */
|
|
34
|
-
export type ViewMessageSource = (
|
|
34
|
+
export type ViewMessageSource = (required: {
|
|
35
|
+
handler: (message: BufferedWindowMessage) => void;
|
|
36
|
+
}, _optional?: Record<string, never>) => () => void;
|
|
35
37
|
/** The default {@link ViewMessageSource}: the shared, module-scope buffer above. */
|
|
36
38
|
export declare const subscribeToViewMessages: ViewMessageSource;
|
|
37
39
|
/** Backlogged message count — diagnostics and tests only. */
|
|
@@ -35,7 +35,7 @@ const buffer = createEarlyMessageBuffer({});
|
|
|
35
35
|
// Module scope, on purpose — see the header: this runs at first import, before any Host mounts.
|
|
36
36
|
forwardWindowMessages(globalThis, buffer);
|
|
37
37
|
/** The default {@link ViewMessageSource}: the shared, module-scope buffer above. */
|
|
38
|
-
export const subscribeToViewMessages = (handler) => buffer.subscribe(handler);
|
|
38
|
+
export const subscribeToViewMessages = ({ handler }, _optional = {}) => buffer.subscribe(handler);
|
|
39
39
|
/** Backlogged message count — diagnostics and tests only. */
|
|
40
40
|
export function viewMessageBacklogSize() {
|
|
41
41
|
return buffer.backlogSize;
|
package/dist/react/testing.js
CHANGED
|
@@ -5,7 +5,9 @@ import { useState } from 'react';
|
|
|
5
5
|
* stays in `__tests__/render-with-ui-kit.tsx`, so this published entry never imports a test library. */
|
|
6
6
|
export const fakeUiKit = {
|
|
7
7
|
components: {
|
|
8
|
-
|
|
8
|
+
// A stored secret is never the viewer's own login password, so the fake declares "new-password"
|
|
9
|
+
// (the token host credential-input scans require); password managers must not autofill it.
|
|
10
|
+
SecretInput: ({ label, value, onChange, ref }) => (_jsx("input", { type: "password", "aria-label": label, value: value, onChange: onChange, ref: ref, autoComplete: "new-password" })),
|
|
9
11
|
},
|
|
10
12
|
hooks: {
|
|
11
13
|
useOverlayContainer: () => document.body,
|
|
@@ -31,39 +31,17 @@ export const DRAW_DOCK_GAP = 12;
|
|
|
31
31
|
export const DRAW_DOCK_MARGIN = 16;
|
|
32
32
|
export const DRAW_DOCK_MIN_WIDTH = 320;
|
|
33
33
|
export const DRAW_DOCK_MIN_HEIGHT = 120;
|
|
34
|
-
|
|
35
|
-
* Computes where the floating toolbar should sit so it stays near the
|
|
36
|
-
* user's last mark without covering it. Tries right → left → bottom → top of
|
|
37
|
-
* the anchor rect, in that order, picking the first side that both fits
|
|
38
|
-
* inside the host's safe area and doesn't overlap the anchor; falls back to
|
|
39
|
-
* `dockedStyle` (bottom-center, non-floating) when nothing fits (small host,
|
|
40
|
-
* no anchor, or the dock/host haven't measured yet).
|
|
41
|
-
*/
|
|
42
|
-
export function computeDockPlacement(input) {
|
|
43
|
-
const docked = { layout: 'docked', side: null, style: input.dockedStyle };
|
|
44
|
-
const { hostRect, wrapRect, dockRect, anchor } = input;
|
|
45
|
-
if (!anchor)
|
|
46
|
-
return docked;
|
|
34
|
+
function dockFitsHost(hostRect, dockRect) {
|
|
47
35
|
const hostTooSmall = hostRect.width <= DRAW_DOCK_MARGIN * 2 || hostRect.height <= DRAW_DOCK_MARGIN * 2;
|
|
48
36
|
const dockEmpty = dockRect.width <= 0 || dockRect.height <= 0;
|
|
49
37
|
const dockDoesNotFit = hostRect.width < Math.max(DRAW_DOCK_MIN_WIDTH, dockRect.width) + DRAW_DOCK_MARGIN * 2
|
|
50
38
|
|| hostRect.height < Math.max(DRAW_DOCK_MIN_HEIGHT, dockRect.height) + DRAW_DOCK_MARGIN * 2;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const anchorInHost = {
|
|
55
|
-
x: wrapRect.x - hostRect.x + anchor.x,
|
|
56
|
-
y: wrapRect.y - hostRect.y + anchor.y,
|
|
57
|
-
width: anchor.width,
|
|
58
|
-
height: anchor.height,
|
|
59
|
-
};
|
|
60
|
-
const safeLeft = DRAW_DOCK_MARGIN;
|
|
61
|
-
const safeTop = DRAW_DOCK_MARGIN;
|
|
62
|
-
const safeRight = Math.max(safeLeft, hostRect.width - dockRect.width - DRAW_DOCK_MARGIN);
|
|
63
|
-
const safeBottom = Math.max(safeTop, hostRect.height - dockRect.height - DRAW_DOCK_MARGIN);
|
|
39
|
+
return !(hostTooSmall || dockEmpty || dockDoesNotFit);
|
|
40
|
+
}
|
|
41
|
+
function buildDockCandidates(anchorInHost, hostRect, dockRect) {
|
|
64
42
|
const centeredLeft = anchorInHost.x + anchorInHost.width / 2 - dockRect.width / 2;
|
|
65
43
|
const centeredTop = anchorInHost.y + anchorInHost.height / 2 - dockRect.height / 2;
|
|
66
|
-
|
|
44
|
+
return [
|
|
67
45
|
{
|
|
68
46
|
side: 'right',
|
|
69
47
|
left: anchorInHost.x + anchorInHost.width + DRAW_DOCK_GAP,
|
|
@@ -89,6 +67,31 @@ export function computeDockPlacement(input) {
|
|
|
89
67
|
fits: anchorInHost.y - DRAW_DOCK_GAP - dockRect.height >= DRAW_DOCK_MARGIN,
|
|
90
68
|
},
|
|
91
69
|
];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Computes where the floating toolbar should sit so it stays near the
|
|
73
|
+
* user's last mark without covering it. Tries right → left → bottom → top of
|
|
74
|
+
* the anchor rect, in that order, picking the first side that both fits
|
|
75
|
+
* inside the host's safe area and doesn't overlap the anchor; falls back to
|
|
76
|
+
* `dockedStyle` (bottom-center, non-floating) when nothing fits (small host,
|
|
77
|
+
* no anchor, or the dock/host haven't measured yet).
|
|
78
|
+
*/
|
|
79
|
+
export function computeDockPlacement(input) {
|
|
80
|
+
const docked = { layout: 'docked', side: null, style: input.dockedStyle };
|
|
81
|
+
const { hostRect, wrapRect, dockRect, anchor } = input;
|
|
82
|
+
if (!anchor || !dockFitsHost(hostRect, dockRect))
|
|
83
|
+
return docked;
|
|
84
|
+
const anchorInHost = {
|
|
85
|
+
x: wrapRect.x - hostRect.x + anchor.x,
|
|
86
|
+
y: wrapRect.y - hostRect.y + anchor.y,
|
|
87
|
+
width: anchor.width,
|
|
88
|
+
height: anchor.height,
|
|
89
|
+
};
|
|
90
|
+
const safeLeft = DRAW_DOCK_MARGIN;
|
|
91
|
+
const safeTop = DRAW_DOCK_MARGIN;
|
|
92
|
+
const safeRight = Math.max(safeLeft, hostRect.width - dockRect.width - DRAW_DOCK_MARGIN);
|
|
93
|
+
const safeBottom = Math.max(safeTop, hostRect.height - dockRect.height - DRAW_DOCK_MARGIN);
|
|
94
|
+
const candidates = buildDockCandidates(anchorInHost, hostRect, dockRect);
|
|
92
95
|
for (const candidate of candidates) {
|
|
93
96
|
if (!candidate.fits)
|
|
94
97
|
continue;
|
|
@@ -25,7 +25,7 @@ function renderBuiltIn({ file, match, t }, { className, srcDocOptions }) {
|
|
|
25
25
|
case 'svg':
|
|
26
26
|
return _jsx(SrcDocSandbox, { className: className, html: content, options: srcDocOptions, title: match.manifest.title });
|
|
27
27
|
case 'markdown': {
|
|
28
|
-
const html = match.renderer.renderPartial ? match.renderer.renderPartial(content) : renderMarkdownToSafeHtml(content);
|
|
28
|
+
const html = match.renderer.renderPartial ? match.renderer.renderPartial(content) : renderMarkdownToSafeHtml({ markdown: content });
|
|
29
29
|
// eslint-disable-next-line react/no-danger -- html is produced by renderMarkdownToSafeHtml, which escapes/allow-lists links; see markdown.ts.
|
|
30
30
|
return _jsx("div", { className: className, dangerouslySetInnerHTML: { __html: html } });
|
|
31
31
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type ArtifactRenderer } from '../registry.js';
|
|
2
|
-
export declare function renderMarkdownToSafeHtml(markdown
|
|
2
|
+
export declare function renderMarkdownToSafeHtml({ markdown }: {
|
|
3
|
+
markdown: string;
|
|
4
|
+
}, _optional?: Record<string, never>): string;
|
|
3
5
|
export declare const MarkdownRenderer: ArtifactRenderer;
|
|
4
6
|
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -9,7 +9,7 @@ import { micromark } from 'micromark';
|
|
|
9
9
|
import { gfm, gfmHtml } from 'micromark-extension-gfm';
|
|
10
10
|
import { resolveArtifactManifest } from '../registry.js';
|
|
11
11
|
import { trimTrailingWhere } from '../../utils/trim-chars.js';
|
|
12
|
-
export function renderMarkdownToSafeHtml(markdown) {
|
|
12
|
+
export function renderMarkdownToSafeHtml({ markdown }, _optional = {}) {
|
|
13
13
|
return postProcessMarkdownHtml(micromark(escapeTableCodePipes(markdown), {
|
|
14
14
|
extensions: [gfm()],
|
|
15
15
|
htmlExtensions: [gfmHtml()],
|
|
@@ -111,7 +111,7 @@ function escapeHtmlAttribute(value) {
|
|
|
111
111
|
export const MarkdownRenderer = {
|
|
112
112
|
id: 'markdown',
|
|
113
113
|
supportsStreaming: true,
|
|
114
|
-
renderPartial: renderMarkdownToSafeHtml,
|
|
114
|
+
renderPartial: (markdown) => renderMarkdownToSafeHtml({ markdown }),
|
|
115
115
|
canRender: ({ file }) => {
|
|
116
116
|
const manifest = resolveArtifactManifest({ file: file });
|
|
117
117
|
if (!manifest)
|