@jini-ai/ui 0.3.14 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +143 -0
- package/README.md +120 -26
- package/dist/browser/index.js +1 -1
- package/dist/browser/useDismissOnOutsideOrEscape.d.ts +10 -1
- package/dist/browser/useDismissOnOutsideOrEscape.js +7 -4
- package/dist/browser/useGlobalKeydown.d.ts +14 -2
- package/dist/browser/useGlobalKeydown.js +8 -17
- package/dist/features/a2ui/catalog-from-registry.d.ts +6 -3
- package/dist/features/a2ui/catalog-from-registry.js +1 -1
- package/dist/features/a2ui/index.d.ts +1 -1
- package/dist/features/a2ui/protocol.d.ts +1 -1
- package/dist/features/a2ui/renderer.js +23 -10
- package/dist/features/a2ui/use-a2ui-surface.d.ts +11 -6
- package/dist/features/a2ui/use-a2ui-surface.js +40 -10
- package/dist/features/admin-widgets/components/ComingSoonNotice.d.ts +11 -0
- package/dist/features/admin-widgets/components/ComingSoonNotice.js +7 -0
- package/dist/features/admin-widgets/components/ComingSoonPanel.d.ts +10 -0
- package/dist/features/admin-widgets/components/ComingSoonPanel.js +10 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.d.ts +16 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.hooks.d.ts +13 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.hooks.js +46 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.js +13 -0
- package/dist/features/admin-widgets/components/InfoTip.d.ts +18 -0
- package/dist/features/admin-widgets/components/InfoTip.hooks.d.ts +16 -0
- package/dist/features/admin-widgets/components/InfoTip.hooks.js +45 -0
- package/dist/features/admin-widgets/components/InfoTip.js +12 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.d.ts +41 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.hooks.d.ts +14 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.hooks.js +57 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +24 -0
- package/dist/features/admin-widgets/components/Select/Select.d.ts +39 -0
- package/dist/features/admin-widgets/components/Select/Select.hooks.d.ts +105 -0
- package/dist/features/admin-widgets/components/Select/Select.hooks.js +359 -0
- package/dist/features/admin-widgets/components/Select/Select.js +46 -0
- package/dist/features/admin-widgets/index.d.ts +20 -0
- package/dist/features/admin-widgets/index.js +11 -0
- package/dist/features/admin-widgets/styles/admin-widgets.css +2 -0
- package/dist/features/appearance/constants.d.ts +2 -2
- package/dist/features/appearance/constants.js +2 -1
- package/dist/features/appearance/react/components/AppearanceTab.js +5 -5
- package/dist/features/appearance/rules.d.ts +10 -4
- package/dist/features/appearance/rules.js +5 -5
- package/dist/features/appearance/types.d.ts +1 -1
- package/dist/features/appearance/types.js +1 -1
- package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
- package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
- package/dist/features/asset-grid/react/hooks/useAssetGridKeyboardShortcuts.js +23 -21
- package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.d.ts +1 -1
- package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.js +1 -1
- package/dist/features/asset-tree-browser/ports.d.ts +3 -1
- package/dist/features/asset-tree-browser/react/hooks/useAssetTreeCopyLocalPath.js +1 -1
- package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
- package/dist/features/browser-chrome/types.js +1 -1
- package/dist/features/command-palette/ports.js +1 -1
- package/dist/features/connectors/ConnectorsBrowser.js +2 -2
- package/dist/features/connectors/components/ConnectorCard.js +3 -3
- package/dist/features/connectors/components/ConnectorDetailDrawer.js +1 -1
- package/dist/features/connectors/components/ConnectorGrid.js +2 -2
- package/dist/features/connectors/components/ConnectorSearchBar.js +2 -2
- package/dist/features/connectors/components/ProviderTabBar.js +2 -2
- package/dist/features/connectors/constants.d.ts +1 -1
- package/dist/features/connectors/constants.js +1 -1
- package/dist/features/connectors/hooks/useConnectorAuthorization.js +1 -1
- package/dist/features/connectors/rules.d.ts +2 -2
- package/dist/features/connectors/rules.js +1 -1
- package/dist/features/connectors/types.d.ts +2 -2
- package/dist/features/connectors/types.js +1 -1
- package/dist/features/execution/react/components/ByokProviderForm.js +3 -3
- package/dist/features/execution/react/components/ExecutionTab.js +2 -2
- package/dist/features/execution/react/components/LocalCliAgentCard.js +3 -3
- package/dist/features/execution/react/components/LocalCliAgentList.js +2 -2
- package/dist/features/execution/react/components/ProviderChipGroup.js +2 -2
- package/dist/features/execution/react/components/SearchableModelSelect.js +1 -1
- package/dist/features/execution/rules.js +1 -1
- package/dist/features/file-dropzone/react/components/FileDropzone.js +5 -3
- package/dist/features/file-dropzone/react/hooks/useFileDropzone.d.ts +1 -1
- package/dist/features/file-dropzone/react/hooks/useFileDropzone.js +1 -1
- package/dist/features/file-dropzone/types.d.ts +1 -1
- package/dist/features/file-dropzone/types.js +1 -1
- package/dist/features/folder-path-drop/react/hooks/useFolderPathDropCapture.js +6 -4
- package/dist/features/html-editor/canvas-content-wrapper.js +1 -1
- package/dist/features/html-editor/canvas-embed-placeholders.js +7 -7
- package/dist/features/html-editor/canvas-style.d.ts +4 -0
- package/dist/features/html-editor/canvas-style.js +6 -21
- package/dist/features/html-viewer/constants.d.ts +1 -1
- package/dist/features/html-viewer/constants.js +1 -1
- package/dist/features/html-viewer/react/components/PresentMenu.js +1 -1
- package/dist/features/html-viewer/react/components/ZoomMenu.js +1 -1
- package/dist/features/html-viewer/types.d.ts +1 -1
- package/dist/features/html-viewer/types.js +1 -1
- package/dist/features/i18n/dictionaries/index.d.ts +2 -3
- package/dist/features/i18n/dictionaries/settings-dialog.en.d.ts +1 -1
- package/dist/features/i18n/dictionary-translator.d.ts +16 -0
- package/dist/features/i18n/dictionary-translator.js +14 -0
- package/dist/features/i18n/index.d.ts +3 -0
- package/dist/features/i18n/index.js +2 -0
- package/dist/features/i18n/locale.d.ts +1 -1
- package/dist/features/i18n/template-i18n.d.ts +26 -0
- package/dist/features/i18n/template-i18n.js +36 -0
- package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.d.ts +1 -1
- package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.js +1 -1
- package/dist/features/instructions/react/components/InstructionsTab.js +1 -1
- package/dist/features/integrations/react/components/ClientPicker.js +4 -4
- package/dist/features/integrations/react/components/CodexInstallToggleButton.js +1 -1
- package/dist/features/integrations/react/components/IntegrationsTab.js +2 -2
- package/dist/features/integrations/react/components/SnippetBlock.js +1 -1
- package/dist/features/integrations/types.d.ts +1 -1
- package/dist/features/integrations/types.js +1 -1
- package/dist/features/interactive-ui/index.js +13 -13
- package/dist/features/interactive-ui/interactive-ui.css +1 -1
- package/dist/features/interactive-ui/providers/recharts/bar-chart.js +1 -1
- package/dist/features/interactive-ui/providers/recharts/line-chart.js +1 -1
- package/dist/features/interactive-ui/providers/recharts/pie-chart.js +2 -2
- package/dist/features/interactive-ui/providers/shadcn/lib/utils.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/lib/utils.js +1 -1
- package/dist/features/interactive-ui/registry.d.ts +15 -4
- package/dist/features/interactive-ui/registry.js +5 -5
- package/dist/features/language/react/components/LanguageTab.js +2 -2
- package/dist/features/list-detail-panel/types.d.ts +1 -1
- package/dist/features/list-detail-panel/types.js +1 -1
- package/dist/features/mcp-ui/confirmation-store.js +2 -1
- package/dist/features/mcp-ui/surfaces/tokens.d.ts +17 -20
- package/dist/features/mcp-ui/surfaces/tokens.js +33 -35
- package/dist/features/media-providers/index.d.ts +1 -1
- package/dist/features/media-providers/index.js +1 -1
- package/dist/features/media-providers/react/components/MediaProvidersTab.js +4 -4
- package/dist/features/media-providers/rules.js +1 -1
- package/dist/features/memory/async-commit-guard.d.ts +1 -1
- package/dist/features/memory/constants.d.ts +1 -1
- package/dist/features/memory/constants.js +1 -1
- package/dist/features/memory/dependencies.d.ts +11 -23
- package/dist/features/memory/dependencies.js +116 -106
- package/dist/features/memory/index.d.ts +1 -1
- package/dist/features/memory/index.js +1 -1
- package/dist/features/memory/react/components/MemoryAdvancedModal.js +2 -2
- package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
- package/dist/features/memory/react/components/MemoryExtractionCard.js +1 -1
- package/dist/features/memory/react/components/MemoryHooksPanel.js +1 -1
- package/dist/features/memory/react/components/MemoryList.js +5 -5
- package/dist/features/memory/react/components/MemoryManualEditor.js +5 -5
- package/dist/features/memory/react/components/MemorySettingsPanel.js +1 -1
- package/dist/features/memory/react/hooks/useMemoryEntries.hooks.js +1 -1
- package/dist/features/memory/react/hooks/useMemoryNavigation.hooks.js +1 -1
- package/dist/features/memory/react/styles.js +1 -1
- package/dist/features/memory/rules.js +1 -1
- package/dist/features/memory/types.d.ts +1 -1
- package/dist/features/mention-autocomplete/react/hooks/useMentionAutocomplete.js +1 -1
- package/dist/features/notifications/react/components/NotificationsTab.js +7 -7
- package/dist/features/notifications/types.d.ts +1 -1
- package/dist/features/observability/boot-timing.js +2 -2
- package/dist/features/observability/stuck-run.js +1 -1
- package/dist/features/observability/white-screen.js +4 -4
- package/dist/features/panel-kit/fetch-query/adapter.react.d.ts +35 -0
- package/dist/features/panel-kit/fetch-query/adapter.react.js +122 -0
- package/dist/features/panel-kit/fetch-query/cache.d.ts +123 -0
- package/dist/features/panel-kit/fetch-query/cache.js +231 -0
- package/dist/features/panel-kit/fetch-query/environment.browser.d.ts +4 -0
- package/dist/features/panel-kit/fetch-query/environment.browser.js +25 -0
- package/dist/features/panel-kit/fetch-query/index.d.ts +4 -0
- package/dist/features/panel-kit/fetch-query/index.js +2 -0
- package/dist/features/panel-kit/fetch-query/types.d.ts +91 -0
- package/dist/features/panel-kit/fetch-query/types.js +2 -0
- package/dist/features/panel-kit/helpers/format-timestamp.d.ts +18 -0
- package/dist/features/panel-kit/helpers/format-timestamp.js +20 -0
- package/dist/features/panel-kit/helpers/permissions.d.ts +11 -0
- package/dist/features/panel-kit/helpers/permissions.js +10 -0
- package/dist/features/panel-kit/helpers/resolve-active-tab-id.d.ts +13 -0
- package/dist/features/panel-kit/helpers/resolve-active-tab-id.js +13 -0
- package/dist/features/panel-kit/helpers/retry-unreachable.d.ts +20 -0
- package/dist/features/panel-kit/helpers/retry-unreachable.js +39 -0
- package/dist/features/panel-kit/hooks/use-async-action.hooks.d.ts +13 -0
- package/dist/features/panel-kit/hooks/use-async-action.hooks.js +27 -0
- package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.d.ts +18 -0
- package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.js +33 -0
- package/dist/features/panel-kit/hooks/use-focus-trap.hooks.d.ts +11 -0
- package/dist/features/panel-kit/hooks/use-focus-trap.hooks.js +76 -0
- package/dist/features/panel-kit/hooks/use-serial-writes.hooks.d.ts +26 -0
- package/dist/features/panel-kit/hooks/use-serial-writes.hooks.js +41 -0
- package/dist/features/panel-kit/hooks/use-settlement-generation.hooks.d.ts +9 -0
- package/dist/features/panel-kit/hooks/use-settlement-generation.hooks.js +25 -0
- package/dist/features/panel-kit/index.d.ts +19 -0
- package/dist/features/panel-kit/index.js +13 -0
- package/dist/features/privacy/react/components/PrivacyTab.js +2 -2
- package/dist/features/privacy/types.d.ts +1 -1
- package/dist/features/privacy/types.js +1 -1
- package/dist/features/progress-card/reference-adapters.d.ts +1 -1
- package/dist/features/progress-card/rules.d.ts +1 -1
- package/dist/features/progress-card/rules.js +1 -1
- package/dist/features/progress-card/types.d.ts +1 -1
- package/dist/features/progress-card/types.js +1 -1
- package/dist/features/resource-dashboard/dependencies.d.ts +1 -1
- package/dist/features/resource-dashboard/ports.d.ts +1 -1
- package/dist/features/resource-dashboard/react/hooks/useResourceBoard.d.ts +1 -1
- package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +1 -1
- package/dist/features/resource-dashboard/rules.d.ts +1 -1
- package/dist/features/resource-dashboard/rules.js +2 -2
- package/dist/features/resource-dashboard/types.d.ts +4 -4
- package/dist/features/resource-dashboard/types.js +1 -1
- package/dist/features/schedule-picker/react/hooks/useRecurringSchedulePicker.js +1 -1
- package/dist/features/settings/dialog/styles/settings-dialog.css +62 -60
- package/dist/features/sketch-editor/constants.d.ts +1 -1
- package/dist/features/sketch-editor/constants.js +1 -1
- package/dist/features/sketch-editor/dom.d.ts +1 -1
- package/dist/features/sketch-editor/dom.js +1 -1
- package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.d.ts +1 -1
- package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.js +11 -9
- package/dist/features/sketch-editor/types.d.ts +1 -1
- package/dist/features/sketch-editor/types.js +1 -1
- package/dist/features/skills/react/components/SkillDraftForm.js +1 -1
- package/dist/features/skills/react/components/SkillRow.js +1 -1
- package/dist/features/skills/react/components/SkillsTab.js +2 -2
- package/dist/features/source-config-list/agent-handles.js +2 -2
- package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.d.ts +1 -1
- package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.js +1 -1
- package/dist/features/source-config-list/rules.d.ts +1 -1
- package/dist/features/source-config-list/rules.js +3 -3
- package/dist/features/source-config-list/types.d.ts +1 -1
- package/dist/features/source-config-list/types.js +1 -1
- package/dist/features/tab-launcher-menu/react/hooks/useTabLauncherMenu.js +1 -1
- package/dist/features/tab-strip/index.d.ts +4 -0
- package/dist/features/tab-strip/index.js +2 -0
- package/dist/features/tab-strip/react/components/TabBar.d.ts +23 -0
- package/dist/features/tab-strip/react/components/TabBar.hooks.d.ts +25 -0
- package/dist/features/tab-strip/react/components/TabBar.hooks.js +57 -0
- package/dist/features/tab-strip/react/components/TabBar.js +18 -0
- package/dist/features/tab-strip/react/components/TabStrip.js +2 -1
- package/dist/features/tab-strip/react/components/TabStripFrame.d.ts +3 -0
- package/dist/features/tab-strip/react/components/TabStripFrame.js +7 -0
- package/dist/features/tabbed-dialog/react/hooks/useTabbedDialog.js +1 -1
- package/dist/features/tabbed-dialog/styles/tabbed-dialog.css +8 -141
- package/dist/features/tabbed-dialog/types.d.ts +1 -1
- package/dist/features/tabbed-dialog/types.js +1 -1
- package/dist/features/version-manager/ports.d.ts +1 -1
- package/dist/features/version-manager/react/components/VersionPromptPopover.js +5 -3
- package/dist/features/version-manager/react/components/VersionRestoreControl.js +1 -1
- package/dist/features/version-manager/types.d.ts +1 -1
- package/dist/features/version-manager/types.js +1 -1
- package/dist/features/viewer-shell/dependencies.js +1 -1
- package/dist/features/viewer-shell/ports.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
- package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.d.ts +1 -1
- package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.js +1 -1
- package/dist/features/viewer-shell/types.d.ts +1 -1
- package/dist/features/viewer-shell/types.js +1 -1
- package/dist/index.d.ts +420 -0
- package/dist/index.js +421 -1
- package/dist/react/components/ComponentKitPreview.js +1 -1
- package/dist/react/components/EditorIcon.d.ts +1 -1
- package/dist/react/components/EditorIcon.js +22 -22
- package/dist/react/components/ExportDiagnosticsButton.d.ts +8 -1
- package/dist/react/components/ExportDiagnosticsButton.js +6 -6
- package/dist/react/components/PaletteTweaks.js +5 -5
- package/dist/react/hooks/useBrandFonts.d.ts +19 -4
- package/dist/react/hooks/useBrandFonts.js +11 -7
- package/dist/react/hooks/useDebouncedValue.d.ts +12 -1
- package/dist/react/hooks/useDebouncedValue.js +9 -4
- package/dist/react/hooks/useStableHandler.d.ts +3 -1
- package/dist/react/hooks/useStableHandler.js +1 -1
- package/dist/renderers/annotation-canvas/drawing.d.ts +4 -4
- package/dist/renderers/annotation-canvas/drawing.js +28 -15
- package/dist/renderers/annotation-canvas/react/components/AnnotationCanvas.js +2 -2
- package/dist/renderers/annotation-canvas/react/hooks/useAnnotationCanvas.js +4 -3
- package/dist/renderers/annotation-canvas/rules.d.ts +1 -1
- package/dist/renderers/annotation-canvas/theme.d.ts +13 -0
- package/dist/renderers/annotation-canvas/theme.js +16 -0
- package/dist/renderers/annotation-canvas/types.d.ts +1 -1
- package/dist/renderers/index.d.ts +1 -1
- package/dist/renderers/new-tab-preview.d.ts +3 -0
- package/dist/renderers/new-tab-preview.js +3 -1
- package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.d.ts +1 -1
- package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.js +1 -1
- package/dist/renderers/preview-modal-shell/rules.d.ts +1 -1
- package/dist/renderers/preview-modal-shell/types.d.ts +3 -3
- package/dist/renderers/preview-modal-shell/types.js +2 -2
- package/dist/renderers/react/components/ArtifactView.d.ts +1 -1
- package/dist/renderers/react/components/ArtifactView.js +1 -1
- package/dist/renderers/registry.d.ts +12 -6
- package/dist/renderers/registry.js +7 -9
- package/dist/renderers/renderers/html.js +2 -2
- package/dist/renderers/renderers/index.js +1 -1
- package/dist/renderers/renderers/markdown.js +2 -2
- package/dist/renderers/renderers/react-component.js +1 -1
- package/dist/renderers/renderers/svg.js +1 -1
- package/dist/renderers/shiki.js +1 -1
- package/dist/renderers/srcdoc/build.d.ts +1 -1
- package/dist/renderers/srcdoc/build.js +1 -1
- package/dist/renderers/url-load-decision.d.ts +1 -1
- package/dist/renderers/url-load-decision.js +1 -1
- package/dist/styles/admin.css +273 -0
- package/dist/styles/variables.css +117 -0
- package/dist/theme/apply.d.ts +9 -0
- package/dist/theme/apply.js +77 -0
- package/dist/theme/color-scheme.d.ts +8 -0
- package/dist/theme/color-scheme.js +9 -0
- package/dist/theme/default.d.ts +4 -0
- package/dist/theme/default.js +11 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.js +5 -0
- package/dist/theme/stylesheet.d.ts +8 -0
- package/dist/theme/stylesheet.js +14 -0
- package/dist/theme/types.d.ts +39 -0
- package/dist/theme/types.js +2 -0
- package/dist/theme/validation.d.ts +15 -0
- package/dist/theme/validation.js +55 -0
- package/dist/utils/appearance.js +1 -1
- package/dist/utils/browser-request.d.ts +12 -0
- package/dist/utils/browser-request.js +10 -0
- package/dist/utils/color-math.d.ts +20 -6
- package/dist/utils/color-math.js +12 -12
- package/dist/utils/copy-to-clipboard.d.ts +19 -8
- package/dist/utils/copy-to-clipboard.js +15 -11
- package/dist/utils/dom-subscriptions.js +1 -1
- package/dist/utils/endpoint-policy.d.ts +9 -3
- package/dist/utils/endpoint-policy.js +5 -5
- package/dist/utils/markdown-scroll-sync.js +3 -3
- package/dist/utils/notifications.d.ts +1 -1
- package/dist/utils/notifications.js +1 -1
- package/dist/utils/polygon-selection.d.ts +1 -1
- package/dist/utils/polygon-selection.js +1 -1
- package/dist/utils/scroll-tabs-with-wheel.d.ts +4 -1
- package/dist/utils/scroll-tabs-with-wheel.js +1 -1
- package/dist/utils/smooth-scroll-to-top.js +1 -1
- package/dist/utils/sse.d.ts +3 -1
- package/dist/utils/sse.js +1 -1
- package/package.json +105 -16
- package/dist/features/lexical-rich-text-editor/react/test-support/lexical-harness.d.ts +0 -11
- package/dist/features/lexical-rich-text-editor/react/test-support/lexical-harness.js +0 -35
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** The intentionally small palette every admin theme supplies in both schemes. */
|
|
2
|
+
export interface AdminThemeColors {
|
|
3
|
+
readonly primary: string;
|
|
4
|
+
readonly primaryInk: string;
|
|
5
|
+
readonly bg: string;
|
|
6
|
+
readonly surface: string;
|
|
7
|
+
readonly text: string;
|
|
8
|
+
readonly muted: string;
|
|
9
|
+
readonly border: string;
|
|
10
|
+
readonly danger: string;
|
|
11
|
+
readonly success: string;
|
|
12
|
+
readonly warning: string;
|
|
13
|
+
}
|
|
14
|
+
/** Product fonts and palette are data. Font loading URLs are stylesheet URLs. */
|
|
15
|
+
export interface AdminTheme {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly fonts: {
|
|
18
|
+
readonly body: string;
|
|
19
|
+
readonly heading: string;
|
|
20
|
+
readonly mono?: string;
|
|
21
|
+
readonly load?: readonly string[];
|
|
22
|
+
};
|
|
23
|
+
readonly light: AdminThemeColors;
|
|
24
|
+
readonly dark: AdminThemeColors;
|
|
25
|
+
readonly radius?: string;
|
|
26
|
+
/** Unitless spacing multiplier, from 0.5 to 2. */
|
|
27
|
+
readonly density?: number;
|
|
28
|
+
}
|
|
29
|
+
export type ColorScheme = 'light' | 'dark';
|
|
30
|
+
export type ColorSchemePreference = ColorScheme | 'system';
|
|
31
|
+
export type MatchMediaPort = (query: string) => {
|
|
32
|
+
readonly matches: boolean;
|
|
33
|
+
addEventListener?: (type: 'change', listener: () => void) => void;
|
|
34
|
+
removeEventListener?: (type: 'change', listener: () => void) => void;
|
|
35
|
+
};
|
|
36
|
+
/** Only these DOM capabilities are needed; no ambient document is consulted. */
|
|
37
|
+
export type AdminThemeTarget = Pick<HTMLElement, 'style' | 'getAttribute' | 'setAttribute' | 'removeAttribute'>;
|
|
38
|
+
export type AdminThemeDocument = Pick<Document, 'head' | 'createElement' | 'baseURI'>;
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AdminTheme } from './types.js';
|
|
2
|
+
export declare const adminThemeColorKeys: readonly ["primary", "primaryInk", "bg", "surface", "text", "muted", "border", "danger", "success", "warning"];
|
|
3
|
+
type Validation = {
|
|
4
|
+
readonly valid: true;
|
|
5
|
+
readonly theme: AdminTheme;
|
|
6
|
+
} | {
|
|
7
|
+
readonly valid: false;
|
|
8
|
+
readonly errors: readonly string[];
|
|
9
|
+
};
|
|
10
|
+
/** Validate serializable theme data before any DOM or font-loading effect. */
|
|
11
|
+
export declare function validateAdminTheme({ theme }: {
|
|
12
|
+
readonly theme: unknown;
|
|
13
|
+
}): Validation;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const adminThemeColorKeys = ['primary', 'primaryInk', 'bg', 'surface', 'text', 'muted', 'border', 'danger', 'success', 'warning'];
|
|
2
|
+
const record = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
3
|
+
const safeValue = (value) => typeof value === 'string' && value.trim().length > 0
|
|
4
|
+
&& value.length <= 512 && !/[;{}\x00-\x1f<>\\]/.test(value) && !/url\s*\(|\/\*|\*\//i.test(value);
|
|
5
|
+
// Concrete palette values, deliberately excluding dependent var()/url() expressions.
|
|
6
|
+
const component = '(?:[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:%|deg|rad|grad|turn)?|none)';
|
|
7
|
+
const components = new RegExp(`^(?:rgb|rgba|hsl|hsla|oklch|oklab|lab|lch)\\(\\s*${component}(?:\\s*,\\s*|\\s+)${component}(?:\\s*,\\s*|\\s+)${component}(?:(?:\\s*[,/]\\s*)${component})?\\s*\\)$`, 'i');
|
|
8
|
+
const colorValue = (value) => safeValue(value)
|
|
9
|
+
&& (/^#[\da-f]{3}(?:[\da-f]{1}|[\da-f]{3}|[\da-f]{5})?$/i.test(value)
|
|
10
|
+
|| components.test(value)
|
|
11
|
+
|| /^(?:transparent|black|white|red|green|blue|gray|grey)$/i.test(value));
|
|
12
|
+
/** Validate serializable theme data before any DOM or font-loading effect. */
|
|
13
|
+
export function validateAdminTheme({ theme }) {
|
|
14
|
+
const errors = [];
|
|
15
|
+
if (!record(theme))
|
|
16
|
+
return { valid: false, errors: ['Theme must be an object'] };
|
|
17
|
+
if (!safeValue(theme.name))
|
|
18
|
+
errors.push('name must be a nonempty safe string');
|
|
19
|
+
const fonts = theme.fonts;
|
|
20
|
+
if (!record(fonts) || !safeValue(fonts.body) || !safeValue(fonts.heading) || (fonts.mono !== undefined && !safeValue(fonts.mono))) {
|
|
21
|
+
errors.push('fonts must provide body and heading font stacks');
|
|
22
|
+
}
|
|
23
|
+
if (record(fonts) && fonts.load !== undefined) {
|
|
24
|
+
if (!Array.isArray(fonts.load) || fonts.load.length > 16 || !fonts.load.every((url) => {
|
|
25
|
+
if (typeof url !== 'string' || url.length > 4096 || /[\x00-\x20<>]/.test(url))
|
|
26
|
+
return false;
|
|
27
|
+
try {
|
|
28
|
+
return new URL(url, 'https://font-base.invalid').protocol === 'https:';
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}))
|
|
34
|
+
errors.push('fonts.load must contain relative or HTTPS stylesheet URLs');
|
|
35
|
+
}
|
|
36
|
+
for (const scheme of ['light', 'dark']) {
|
|
37
|
+
const colors = theme[scheme];
|
|
38
|
+
if (!record(colors)) {
|
|
39
|
+
errors.push(`${scheme} must be a complete palette`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
for (const key of adminThemeColorKeys)
|
|
43
|
+
if (!Object.hasOwn(colors, key) || !colorValue(colors[key]))
|
|
44
|
+
errors.push(`${scheme}.${key} must be a concrete CSS color`);
|
|
45
|
+
for (const key of Object.keys(colors))
|
|
46
|
+
if (!adminThemeColorKeys.includes(key))
|
|
47
|
+
errors.push(`${scheme}.${key} is not a theme color`);
|
|
48
|
+
}
|
|
49
|
+
if (theme.radius !== undefined && (typeof theme.radius !== 'string' || !/^(?:0|\d+(?:\.\d+)?(?:px|rem|em))$/.test(theme.radius)))
|
|
50
|
+
errors.push('radius must be a nonnegative CSS length');
|
|
51
|
+
if (theme.density !== undefined && (typeof theme.density !== 'number' || !Number.isFinite(theme.density) || theme.density < 0.5 || theme.density > 2))
|
|
52
|
+
errors.push('density must be between 0.5 and 2');
|
|
53
|
+
return errors.length ? { valid: false, errors } : { valid: true, theme: theme };
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=validation.js.map
|
package/dist/utils/appearance.js
CHANGED
|
@@ -30,7 +30,7 @@ export function applyAppearanceToDocument({ theme, accentColor, }) {
|
|
|
30
30
|
else {
|
|
31
31
|
root.removeAttribute('data-theme');
|
|
32
32
|
}
|
|
33
|
-
const vars = accentVars(resolveAccentColor(accentColor));
|
|
33
|
+
const vars = accentVars({ accentColor: resolveAccentColor({ value: accentColor }) });
|
|
34
34
|
for (const name of Object.keys(vars)) {
|
|
35
35
|
root.style.setProperty(name, vars[name]);
|
|
36
36
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser transport defaults stay here rather than importing a Node package.
|
|
3
|
+
* Preserve a caller's cancellation alongside the deadline; fetch keeps its native ABI.
|
|
4
|
+
*/
|
|
5
|
+
export declare function requestWithTimeout({ url, timeoutMs }: {
|
|
6
|
+
url: string | URL;
|
|
7
|
+
timeoutMs: number;
|
|
8
|
+
}, { fetch, init }?: {
|
|
9
|
+
fetch?: typeof globalThis.fetch;
|
|
10
|
+
init?: RequestInit;
|
|
11
|
+
}): Promise<Response>;
|
|
12
|
+
//# sourceMappingURL=browser-request.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser transport defaults stay here rather than importing a Node package.
|
|
3
|
+
* Preserve a caller's cancellation alongside the deadline; fetch keeps its native ABI.
|
|
4
|
+
*/
|
|
5
|
+
export function requestWithTimeout({ url, timeoutMs }, { fetch, init = {} } = {}) {
|
|
6
|
+
const timeout = AbortSignal.timeout(timeoutMs);
|
|
7
|
+
const signal = init.signal ? AbortSignal.any([init.signal, timeout]) : timeout;
|
|
8
|
+
return (fetch ?? globalThis.fetch)(url, { ...init, signal });
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=browser-request.js.map
|
|
@@ -10,25 +10,39 @@ export interface Rgb {
|
|
|
10
10
|
* channel dropped. Returns `null` if `value` is undefined or contains no
|
|
11
11
|
* hex-color-shaped substring.
|
|
12
12
|
*/
|
|
13
|
-
export declare function normalizeHex(value
|
|
13
|
+
export declare function normalizeHex({ value }: {
|
|
14
|
+
value: string | undefined;
|
|
15
|
+
}): string | null;
|
|
14
16
|
/** Decodes a hex color string to `{ r, g, b }` (0-255 each), or `null` if it doesn't normalize to a valid hex color. */
|
|
15
|
-
export declare function hexToRgb(hex
|
|
17
|
+
export declare function hexToRgb({ hex }: {
|
|
18
|
+
hex: string;
|
|
19
|
+
}): Rgb | null;
|
|
16
20
|
/**
|
|
17
21
|
* Perceptual luminance of `hex` in `[0, 1]` via the ITU-R BT.709 luma
|
|
18
22
|
* weights (0.2126R + 0.7152G + 0.0722B). Not true WCAG relative luminance —
|
|
19
23
|
* see the module doc comment. Returns `1` (treated as "light") if `hex`
|
|
20
24
|
* doesn't decode to a valid color.
|
|
21
25
|
*/
|
|
22
|
-
export declare function luminance(hex
|
|
26
|
+
export declare function luminance({ hex }: {
|
|
27
|
+
hex: string;
|
|
28
|
+
}): number;
|
|
23
29
|
/** Clamps `value` to `[0, 255]` and formats it as a 2-digit lowercase hex byte. */
|
|
24
|
-
export declare function toHexByte(value
|
|
30
|
+
export declare function toHexByte({ value }: {
|
|
31
|
+
value: number;
|
|
32
|
+
}): string;
|
|
25
33
|
/**
|
|
26
34
|
* Linearly mixes `hex` and `other` in RGB space. `weight` is `hex`'s share
|
|
27
35
|
* of the result, clamped to `[0, 1]` (`1` returns `hex`, `0` returns
|
|
28
36
|
* `other`). A color that fails to decode falls back to black (`hex`) or
|
|
29
37
|
* white (`other`) respectively, so the mix is still well-defined.
|
|
30
38
|
*/
|
|
31
|
-
export declare function mixHex(hex
|
|
39
|
+
export declare function mixHex({ hex, other, weight }: {
|
|
40
|
+
hex: string;
|
|
41
|
+
other: string;
|
|
42
|
+
weight: number;
|
|
43
|
+
}): string;
|
|
32
44
|
/** Picks `#111111` (near-black) or `#ffffff` (white) as the more readable text color for a `hex` background, using {@link luminance}. */
|
|
33
|
-
export declare function readableTextColor(hex
|
|
45
|
+
export declare function readableTextColor({ hex }: {
|
|
46
|
+
hex: string;
|
|
47
|
+
}): string;
|
|
34
48
|
//# sourceMappingURL=color-math.d.ts.map
|
package/dist/utils/color-math.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* channel dropped. Returns `null` if `value` is undefined or contains no
|
|
17
17
|
* hex-color-shaped substring.
|
|
18
18
|
*/
|
|
19
|
-
export function normalizeHex(value) {
|
|
19
|
+
export function normalizeHex({ value }) {
|
|
20
20
|
const match = value?.match(/#[0-9a-fA-F]{3}\b|#[0-9a-fA-F]{6}\b|#[0-9a-fA-F]{8}\b/);
|
|
21
21
|
if (!match)
|
|
22
22
|
return null;
|
|
@@ -29,8 +29,8 @@ export function normalizeHex(value) {
|
|
|
29
29
|
return raw;
|
|
30
30
|
}
|
|
31
31
|
/** Decodes a hex color string to `{ r, g, b }` (0-255 each), or `null` if it doesn't normalize to a valid hex color. */
|
|
32
|
-
export function hexToRgb(hex) {
|
|
33
|
-
const normalized = normalizeHex(hex);
|
|
32
|
+
export function hexToRgb({ hex }) {
|
|
33
|
+
const normalized = normalizeHex({ value: hex });
|
|
34
34
|
if (!normalized)
|
|
35
35
|
return null;
|
|
36
36
|
return {
|
|
@@ -45,14 +45,14 @@ export function hexToRgb(hex) {
|
|
|
45
45
|
* see the module doc comment. Returns `1` (treated as "light") if `hex`
|
|
46
46
|
* doesn't decode to a valid color.
|
|
47
47
|
*/
|
|
48
|
-
export function luminance(hex) {
|
|
49
|
-
const rgb = hexToRgb(hex);
|
|
48
|
+
export function luminance({ hex }) {
|
|
49
|
+
const rgb = hexToRgb({ hex });
|
|
50
50
|
if (!rgb)
|
|
51
51
|
return 1;
|
|
52
52
|
return (0.2126 * rgb.r + 0.7152 * rgb.g + 0.0722 * rgb.b) / 255;
|
|
53
53
|
}
|
|
54
54
|
/** Clamps `value` to `[0, 255]` and formats it as a 2-digit lowercase hex byte. */
|
|
55
|
-
export function toHexByte(value) {
|
|
55
|
+
export function toHexByte({ value }) {
|
|
56
56
|
return Math.max(0, Math.min(255, value)).toString(16).padStart(2, '0');
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -61,19 +61,19 @@ export function toHexByte(value) {
|
|
|
61
61
|
* `other`). A color that fails to decode falls back to black (`hex`) or
|
|
62
62
|
* white (`other`) respectively, so the mix is still well-defined.
|
|
63
63
|
*/
|
|
64
|
-
export function mixHex(hex, other, weight) {
|
|
65
|
-
const a = hexToRgb(hex) ?? { r: 0, g: 0, b: 0 };
|
|
66
|
-
const b = hexToRgb(other) ?? { r: 255, g: 255, b: 255 };
|
|
64
|
+
export function mixHex({ hex, other, weight }) {
|
|
65
|
+
const a = hexToRgb({ hex }) ?? { r: 0, g: 0, b: 0 };
|
|
66
|
+
const b = hexToRgb({ hex: other }) ?? { r: 255, g: 255, b: 255 };
|
|
67
67
|
const clampedWeight = Math.max(0, Math.min(1, weight));
|
|
68
68
|
const mixed = {
|
|
69
69
|
r: Math.round(a.r * clampedWeight + b.r * (1 - clampedWeight)),
|
|
70
70
|
g: Math.round(a.g * clampedWeight + b.g * (1 - clampedWeight)),
|
|
71
71
|
b: Math.round(a.b * clampedWeight + b.b * (1 - clampedWeight)),
|
|
72
72
|
};
|
|
73
|
-
return `#${toHexByte(mixed.r)}${toHexByte(mixed.g)}${toHexByte(mixed.b)}`;
|
|
73
|
+
return `#${toHexByte({ value: mixed.r })}${toHexByte({ value: mixed.g })}${toHexByte({ value: mixed.b })}`;
|
|
74
74
|
}
|
|
75
75
|
/** Picks `#111111` (near-black) or `#ffffff` (white) as the more readable text color for a `hex` background, using {@link luminance}. */
|
|
76
|
-
export function readableTextColor(hex) {
|
|
77
|
-
return luminance(hex) > 0.56 ? '#111111' : '#ffffff';
|
|
76
|
+
export function readableTextColor({ hex }) {
|
|
77
|
+
return luminance({ hex }) > 0.56 ? '#111111' : '#ffffff';
|
|
78
78
|
}
|
|
79
79
|
//# sourceMappingURL=color-math.js.map
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
export interface ClipboardWritePort {
|
|
2
|
+
writeText(requiredArgs: {
|
|
3
|
+
text: string;
|
|
4
|
+
}): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export interface CopyToClipboardOptions {
|
|
7
|
+
clipboard?: ClipboardWritePort;
|
|
8
|
+
document?: Document;
|
|
9
|
+
isHTMLElement?: (requiredArgs: {
|
|
10
|
+
value: Element | null;
|
|
11
|
+
}) => boolean;
|
|
12
|
+
}
|
|
1
13
|
/**
|
|
2
|
-
* Copy `text` to the system clipboard.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* API and the `execCommand('copy')` fallback fail.
|
|
7
|
-
* @complexity O(1) — a single clipboard write, with a bounded-size DOM
|
|
8
|
-
* fallback (create/select/copy/remove one textarea) on rejection.
|
|
14
|
+
* Copy `requiredArgs.text` to the system clipboard.
|
|
15
|
+
* Optional ports replace the clipboard writer, fallback document and element check.
|
|
16
|
+
* Returns true on success through either strategy, false when both writes fail.
|
|
17
|
+
* O(1): one clipboard write and a single temporary textarea on rejection.
|
|
9
18
|
*/
|
|
10
|
-
export declare function copyToClipboard(text
|
|
19
|
+
export declare function copyToClipboard({ text }: {
|
|
20
|
+
text: string;
|
|
21
|
+
}, options?: CopyToClipboardOptions): Promise<boolean>;
|
|
11
22
|
//# sourceMappingURL=copy-to-clipboard.d.ts.map
|
|
@@ -3,21 +3,25 @@
|
|
|
3
3
|
// locked-clipboard contexts, or insecure (HTTP) origins where
|
|
4
4
|
// navigator.clipboard.writeText rejects.
|
|
5
5
|
/**
|
|
6
|
-
* Copy `text` to the system clipboard.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* API and the `execCommand('copy')` fallback fail.
|
|
11
|
-
* @complexity O(1) — a single clipboard write, with a bounded-size DOM
|
|
12
|
-
* fallback (create/select/copy/remove one textarea) on rejection.
|
|
6
|
+
* Copy `requiredArgs.text` to the system clipboard.
|
|
7
|
+
* Optional ports replace the clipboard writer, fallback document and element check.
|
|
8
|
+
* Returns true on success through either strategy, false when both writes fail.
|
|
9
|
+
* O(1): one clipboard write and a single temporary textarea on rejection.
|
|
13
10
|
*/
|
|
14
|
-
export async function copyToClipboard(text) {
|
|
11
|
+
export async function copyToClipboard({ text }, options = {}) {
|
|
15
12
|
try {
|
|
16
|
-
|
|
13
|
+
if (options.clipboard)
|
|
14
|
+
await options.clipboard.writeText({ text });
|
|
15
|
+
else
|
|
16
|
+
await navigator.clipboard.writeText(text);
|
|
17
17
|
return true;
|
|
18
18
|
}
|
|
19
19
|
catch {
|
|
20
|
-
const
|
|
20
|
+
const document = options.document ?? globalThis.document;
|
|
21
|
+
const isHTMLElement = options.isHTMLElement ?? (({ value }) => value instanceof HTMLElement);
|
|
22
|
+
const priorFocus = isHTMLElement({ value: document.activeElement })
|
|
23
|
+
? document.activeElement
|
|
24
|
+
: null;
|
|
21
25
|
const ta = document.createElement('textarea');
|
|
22
26
|
ta.value = text;
|
|
23
27
|
ta.style.position = 'fixed';
|
|
@@ -30,7 +34,7 @@ export async function copyToClipboard(text) {
|
|
|
30
34
|
// "abrupt completion through finally" branch permanently unreachable —
|
|
31
35
|
// same dead-branch discipline as this repo's `daemon/tool-executor.ts`
|
|
32
36
|
// and `packages/ui`'s `useMemoryExtractions.hooks.ts` precedents (see
|
|
33
|
-
// packages/ui/
|
|
37
|
+
// packages/ui/archived provenance ledger's 2026-07-22 dated entry).
|
|
34
38
|
const cleanup = () => {
|
|
35
39
|
document.body.removeChild(ta);
|
|
36
40
|
if (priorFocus?.isConnected) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// Ported from a chat-surface-scoped `providers/dom/*.dom.ts` pair in the
|
|
8
8
|
// source project, where these were filed under one feature's "DOM bridges"
|
|
9
9
|
// despite having no feature-specific logic in their bodies — see
|
|
10
|
-
// packages/ui/
|
|
10
|
+
// packages/ui/archived provenance ledger for the reclassification note.
|
|
11
11
|
/** The current viewport size, or a zero-size fallback outside the browser (SSR). */
|
|
12
12
|
export function getViewportSize() {
|
|
13
13
|
if (typeof window === 'undefined')
|
|
@@ -47,9 +47,13 @@
|
|
|
47
47
|
* are a first-class configuration, not an attack.
|
|
48
48
|
*/
|
|
49
49
|
/** True for `localhost`, `::1`, `127.0.0.0/8`, and their IPv4-mapped-IPv6 forms. Allowed — local model servers live here. */
|
|
50
|
-
export declare function isLoopbackEndpointHost(hostname
|
|
50
|
+
export declare function isLoopbackEndpointHost({ hostname }: {
|
|
51
|
+
hostname: string;
|
|
52
|
+
}): boolean;
|
|
51
53
|
/** True for RFC1918/link-local/CGNAT/multicast/unspecified/unique-local-IPv6 literals — private space a credentialed request must not be steered into. */
|
|
52
|
-
export declare function isBlockedEndpointHost(hostname
|
|
54
|
+
export declare function isBlockedEndpointHost({ hostname }: {
|
|
55
|
+
hostname: string;
|
|
56
|
+
}): boolean;
|
|
53
57
|
/**
|
|
54
58
|
* Whether `raw` is an endpoint this UI will accept: an absolute `http(s)` URL
|
|
55
59
|
* whose literal hostname is not private address space.
|
|
@@ -61,5 +65,7 @@ export declare function isBlockedEndpointHost(hostname: string): boolean;
|
|
|
61
65
|
* time. This is the cheap check that runs on every keystroke, not the last
|
|
62
66
|
* line of defense.
|
|
63
67
|
*/
|
|
64
|
-
export declare function isAllowedEndpointUrl(raw
|
|
68
|
+
export declare function isAllowedEndpointUrl({ raw }: {
|
|
69
|
+
raw: string;
|
|
70
|
+
}): boolean;
|
|
65
71
|
//# sourceMappingURL=endpoint-policy.d.ts.map
|
|
@@ -102,7 +102,7 @@ function ipv4MappedToDotted(hostname) {
|
|
|
102
102
|
return [(value >>> 24) & 255, (value >>> 16) & 255, (value >>> 8) & 255, value & 255].join('.');
|
|
103
103
|
}
|
|
104
104
|
/** True for `localhost`, `::1`, `127.0.0.0/8`, and their IPv4-mapped-IPv6 forms. Allowed — local model servers live here. */
|
|
105
|
-
export function isLoopbackEndpointHost(hostname) {
|
|
105
|
+
export function isLoopbackEndpointHost({ hostname }) {
|
|
106
106
|
const host = normalizeHost(hostname);
|
|
107
107
|
if (host === 'localhost' || host === '::1')
|
|
108
108
|
return true;
|
|
@@ -112,7 +112,7 @@ export function isLoopbackEndpointHost(hostname) {
|
|
|
112
112
|
return Boolean(mapped && isLoopbackIpv4(mapped));
|
|
113
113
|
}
|
|
114
114
|
/** True for RFC1918/link-local/CGNAT/multicast/unspecified/unique-local-IPv6 literals — private space a credentialed request must not be steered into. */
|
|
115
|
-
export function isBlockedEndpointHost(hostname) {
|
|
115
|
+
export function isBlockedEndpointHost({ hostname }) {
|
|
116
116
|
const host = normalizeHost(hostname);
|
|
117
117
|
if (host === '::')
|
|
118
118
|
return true;
|
|
@@ -136,7 +136,7 @@ export function isBlockedEndpointHost(hostname) {
|
|
|
136
136
|
* time. This is the cheap check that runs on every keystroke, not the last
|
|
137
137
|
* line of defense.
|
|
138
138
|
*/
|
|
139
|
-
export function isAllowedEndpointUrl(raw) {
|
|
139
|
+
export function isAllowedEndpointUrl({ raw }) {
|
|
140
140
|
const trimmed = raw.trim();
|
|
141
141
|
if (!trimmed)
|
|
142
142
|
return false;
|
|
@@ -150,8 +150,8 @@ export function isAllowedEndpointUrl(raw) {
|
|
|
150
150
|
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')
|
|
151
151
|
return false;
|
|
152
152
|
const hostname = parsed.hostname.toLowerCase();
|
|
153
|
-
if (isLoopbackEndpointHost(hostname))
|
|
153
|
+
if (isLoopbackEndpointHost({ hostname }))
|
|
154
154
|
return true;
|
|
155
|
-
return !isBlockedEndpointHost(hostname);
|
|
155
|
+
return !isBlockedEndpointHost({ hostname });
|
|
156
156
|
}
|
|
157
157
|
//# sourceMappingURL=endpoint-policy.js.map
|
|
@@ -116,10 +116,10 @@ export function measureEditorBlockOffsets(textarea, blockLines, text) {
|
|
|
116
116
|
// would require either reintroducing this package's own documented
|
|
117
117
|
// `@vitest/coverage-v8` jsdom/node branch-merge bug (see
|
|
118
118
|
// `features/html-viewer/dependencies`'s precedent in
|
|
119
|
-
// packages/ui/
|
|
119
|
+
// packages/ui/archived provenance ledger) or hand-faking this function's full
|
|
120
120
|
// `innerHTML`/`querySelectorAll`/`getComputedStyle` surface under plain
|
|
121
121
|
// Node — disproportionate to a defensive guard with no reachable path.
|
|
122
|
-
// See packages/ui/
|
|
122
|
+
// See packages/ui/archived provenance ledger's 2026-07-22 dated entry.
|
|
123
123
|
if (blockLines.length === 0 || typeof document === 'undefined')
|
|
124
124
|
return null;
|
|
125
125
|
const computed = window.getComputedStyle(textarea);
|
|
@@ -269,7 +269,7 @@ export function mapScrollPosition(value, source, target) {
|
|
|
269
269
|
// sourceLow` always, and a `span > 0 ? ... : 0` guard against
|
|
270
270
|
// division-by-zero was dead code for every possible call, not a real
|
|
271
271
|
// defensive branch — removed rather than tested around (see
|
|
272
|
-
// packages/ui/
|
|
272
|
+
// packages/ui/archived provenance ledger's 2026-07-22 dated entry for the full proof).
|
|
273
273
|
const span = sourceHigh - sourceLow;
|
|
274
274
|
const fraction = (value - sourceLow) / span;
|
|
275
275
|
return targetLow + fraction * (targetHigh - targetLow);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* "long-running task finished" style completion signals.
|
|
4
4
|
*
|
|
5
5
|
* Origin: `utils/notifications.ts`. Genericized in two places (see
|
|
6
|
-
* `packages/ui/
|
|
6
|
+
* `packages/ui/archived provenance ledger`):
|
|
7
7
|
* - `labelKey: keyof Dict` (OD's fixed translation dictionary type)
|
|
8
8
|
* widened to a plain `string` — this package's i18n feature has no
|
|
9
9
|
* fixed `Dict` shape for a sound catalog to key into.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* "long-running task finished" style completion signals.
|
|
4
4
|
*
|
|
5
5
|
* Origin: `utils/notifications.ts`. Genericized in two places (see
|
|
6
|
-
* `packages/ui/
|
|
6
|
+
* `packages/ui/archived provenance ledger`):
|
|
7
7
|
* - `labelKey: keyof Dict` (OD's fixed translation dictionary type)
|
|
8
8
|
* widened to a plain `string` — this package's i18n feature has no
|
|
9
9
|
* fixed `Dict` shape for a sound catalog to key into.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Correction to an earlier framing: this is NOT multi-user
|
|
11
11
|
* presence/collaboration (no cursors-of-other-users, no realtime presence
|
|
12
12
|
* state exist in the source) — it is a single-user lasso-select tool. See
|
|
13
|
-
* `packages/ui/
|
|
13
|
+
* `packages/ui/archived provenance ledger`'s `html-viewer` classification section.
|
|
14
14
|
*
|
|
15
15
|
* Only the geometry primitives ship here — the source's own
|
|
16
16
|
* `buildPodSnapshot`/`pruneContainerSelections`/`podOverlayWeights` (which
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Correction to an earlier framing: this is NOT multi-user
|
|
11
11
|
* presence/collaboration (no cursors-of-other-users, no realtime presence
|
|
12
12
|
* state exist in the source) — it is a single-user lasso-select tool. See
|
|
13
|
-
* `packages/ui/
|
|
13
|
+
* `packages/ui/archived provenance ledger`'s `html-viewer` classification section.
|
|
14
14
|
*
|
|
15
15
|
* Only the geometry primitives ship here — the source's own
|
|
16
16
|
* `buildPodSnapshot`/`pruneContainerSelections`/`podOverlayWeights` (which
|
|
@@ -15,5 +15,8 @@
|
|
|
15
15
|
* to pixels per `deltaMode`) and calls `event.preventDefault()` so the page
|
|
16
16
|
* itself doesn't also scroll vertically.
|
|
17
17
|
*/
|
|
18
|
-
export declare function scrollTabsWithWheel(tabBar
|
|
18
|
+
export declare function scrollTabsWithWheel({ tabBar, event }: {
|
|
19
|
+
tabBar: Pick<HTMLDivElement, 'clientWidth' | 'scrollLeft' | 'scrollWidth'>;
|
|
20
|
+
event: Pick<globalThis.WheelEvent, 'ctrlKey' | 'deltaMode' | 'deltaX' | 'deltaY' | 'preventDefault'>;
|
|
21
|
+
}): void;
|
|
19
22
|
//# sourceMappingURL=scroll-tabs-with-wheel.d.ts.map
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* to pixels per `deltaMode`) and calls `event.preventDefault()` so the page
|
|
22
22
|
* itself doesn't also scroll vertically.
|
|
23
23
|
*/
|
|
24
|
-
export function scrollTabsWithWheel(tabBar, event) {
|
|
24
|
+
export function scrollTabsWithWheel({ tabBar, event }) {
|
|
25
25
|
if (event.ctrlKey)
|
|
26
26
|
return;
|
|
27
27
|
if (Math.abs(event.deltaY) <= Math.abs(event.deltaX))
|
|
@@ -49,7 +49,7 @@ function unitBezier(x1, y1, x2, y2) {
|
|
|
49
49
|
// full domain t∈[0,1] (the only range `smoothScrollToTop` ever feeds
|
|
50
50
|
// in, since its own `t` is clamped via `Math.min(1, ...)`) and the
|
|
51
51
|
// minimum observed was ~0.6095 — nowhere near this 1e-6 guard. See
|
|
52
|
-
// packages/ui/
|
|
52
|
+
// packages/ui/archived provenance ledger's 2026-07-22 dated entry for the full
|
|
53
53
|
// re-verification record (matches this task's own standard for
|
|
54
54
|
// documenting provable unreachability instead of forcing a test).
|
|
55
55
|
if (Math.abs(d) < 1e-6)
|
package/dist/utils/sse.d.ts
CHANGED
|
@@ -22,5 +22,7 @@ export type ParsedSseFrame = {
|
|
|
22
22
|
* are present but do not parse as JSON.
|
|
23
23
|
* @complexity O(n) in the frame's line count — one linear scan.
|
|
24
24
|
*/
|
|
25
|
-
export declare function parseSseFrame(frame
|
|
25
|
+
export declare function parseSseFrame({ frame }: {
|
|
26
|
+
frame: string;
|
|
27
|
+
}): ParsedSseFrame | null;
|
|
26
28
|
//# sourceMappingURL=sse.d.ts.map
|
package/dist/utils/sse.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* are present but do not parse as JSON.
|
|
15
15
|
* @complexity O(n) in the frame's line count — one linear scan.
|
|
16
16
|
*/
|
|
17
|
-
export function parseSseFrame(frame) {
|
|
17
|
+
export function parseSseFrame({ frame }) {
|
|
18
18
|
const lines = frame.split('\n');
|
|
19
19
|
const comments = [];
|
|
20
20
|
let event = 'message';
|