@jini-ai/ui 0.3.14 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +139 -0
- package/README.md +120 -26
- package/dist/browser/index.js +1 -1
- package/dist/browser/useDismissOnOutsideOrEscape.d.ts +10 -1
- package/dist/browser/useDismissOnOutsideOrEscape.js +7 -4
- package/dist/browser/useGlobalKeydown.d.ts +14 -2
- package/dist/browser/useGlobalKeydown.js +8 -17
- package/dist/features/a2ui/catalog-from-registry.d.ts +6 -3
- package/dist/features/a2ui/catalog-from-registry.js +1 -1
- package/dist/features/a2ui/index.d.ts +1 -1
- package/dist/features/a2ui/protocol.d.ts +1 -1
- package/dist/features/a2ui/renderer.js +23 -10
- package/dist/features/a2ui/use-a2ui-surface.d.ts +11 -6
- package/dist/features/a2ui/use-a2ui-surface.js +40 -10
- package/dist/features/admin-widgets/components/ComingSoonNotice.d.ts +11 -0
- package/dist/features/admin-widgets/components/ComingSoonNotice.js +7 -0
- package/dist/features/admin-widgets/components/ComingSoonPanel.d.ts +10 -0
- package/dist/features/admin-widgets/components/ComingSoonPanel.js +10 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.d.ts +16 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.hooks.d.ts +13 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.hooks.js +46 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.js +13 -0
- package/dist/features/admin-widgets/components/InfoTip.d.ts +18 -0
- package/dist/features/admin-widgets/components/InfoTip.hooks.d.ts +16 -0
- package/dist/features/admin-widgets/components/InfoTip.hooks.js +45 -0
- package/dist/features/admin-widgets/components/InfoTip.js +12 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.d.ts +41 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.hooks.d.ts +14 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.hooks.js +57 -0
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +24 -0
- package/dist/features/admin-widgets/components/Select/Select.d.ts +39 -0
- package/dist/features/admin-widgets/components/Select/Select.hooks.d.ts +105 -0
- package/dist/features/admin-widgets/components/Select/Select.hooks.js +359 -0
- package/dist/features/admin-widgets/components/Select/Select.js +46 -0
- package/dist/features/admin-widgets/index.d.ts +20 -0
- package/dist/features/admin-widgets/index.js +11 -0
- package/dist/features/admin-widgets/styles/admin-widgets.css +2 -0
- package/dist/features/appearance/constants.d.ts +2 -2
- package/dist/features/appearance/constants.js +2 -1
- package/dist/features/appearance/react/components/AppearanceTab.js +5 -5
- package/dist/features/appearance/rules.d.ts +10 -4
- package/dist/features/appearance/rules.js +5 -5
- package/dist/features/appearance/types.d.ts +1 -1
- package/dist/features/appearance/types.js +1 -1
- package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
- package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
- package/dist/features/asset-grid/react/hooks/useAssetGridKeyboardShortcuts.js +23 -21
- package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.d.ts +1 -1
- package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.js +1 -1
- package/dist/features/asset-tree-browser/ports.d.ts +3 -1
- package/dist/features/asset-tree-browser/react/hooks/useAssetTreeCopyLocalPath.js +1 -1
- package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
- package/dist/features/browser-chrome/types.js +1 -1
- package/dist/features/command-palette/ports.js +1 -1
- package/dist/features/connectors/ConnectorsBrowser.js +2 -2
- package/dist/features/connectors/components/ConnectorCard.js +3 -3
- package/dist/features/connectors/components/ConnectorDetailDrawer.js +1 -1
- package/dist/features/connectors/components/ConnectorGrid.js +2 -2
- package/dist/features/connectors/components/ConnectorSearchBar.js +2 -2
- package/dist/features/connectors/components/ProviderTabBar.js +2 -2
- package/dist/features/connectors/constants.d.ts +1 -1
- package/dist/features/connectors/constants.js +1 -1
- package/dist/features/connectors/hooks/useConnectorAuthorization.js +1 -1
- package/dist/features/connectors/rules.d.ts +2 -2
- package/dist/features/connectors/rules.js +1 -1
- package/dist/features/connectors/types.d.ts +2 -2
- package/dist/features/connectors/types.js +1 -1
- package/dist/features/execution/react/components/ByokProviderForm.js +3 -3
- package/dist/features/execution/react/components/ExecutionTab.js +2 -2
- package/dist/features/execution/react/components/LocalCliAgentCard.js +3 -3
- package/dist/features/execution/react/components/LocalCliAgentList.js +2 -2
- package/dist/features/execution/react/components/ProviderChipGroup.js +2 -2
- package/dist/features/execution/react/components/SearchableModelSelect.js +1 -1
- package/dist/features/execution/rules.js +1 -1
- package/dist/features/file-dropzone/react/components/FileDropzone.js +5 -3
- package/dist/features/file-dropzone/react/hooks/useFileDropzone.d.ts +1 -1
- package/dist/features/file-dropzone/react/hooks/useFileDropzone.js +1 -1
- package/dist/features/file-dropzone/types.d.ts +1 -1
- package/dist/features/file-dropzone/types.js +1 -1
- package/dist/features/folder-path-drop/react/hooks/useFolderPathDropCapture.js +6 -4
- package/dist/features/html-editor/canvas-content-wrapper.js +1 -1
- package/dist/features/html-editor/canvas-embed-placeholders.js +7 -7
- package/dist/features/html-editor/canvas-style.d.ts +4 -0
- package/dist/features/html-editor/canvas-style.js +6 -21
- package/dist/features/html-viewer/constants.d.ts +1 -1
- package/dist/features/html-viewer/constants.js +1 -1
- package/dist/features/html-viewer/react/components/PresentMenu.js +1 -1
- package/dist/features/html-viewer/react/components/ZoomMenu.js +1 -1
- package/dist/features/html-viewer/types.d.ts +1 -1
- package/dist/features/html-viewer/types.js +1 -1
- package/dist/features/i18n/dictionaries/index.d.ts +2 -3
- package/dist/features/i18n/dictionaries/settings-dialog.en.d.ts +1 -1
- package/dist/features/i18n/dictionary-translator.d.ts +16 -0
- package/dist/features/i18n/dictionary-translator.js +14 -0
- package/dist/features/i18n/index.d.ts +3 -0
- package/dist/features/i18n/index.js +2 -0
- package/dist/features/i18n/locale.d.ts +1 -1
- package/dist/features/i18n/template-i18n.d.ts +26 -0
- package/dist/features/i18n/template-i18n.js +36 -0
- package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.d.ts +1 -1
- package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.js +1 -1
- package/dist/features/instructions/react/components/InstructionsTab.js +1 -1
- package/dist/features/integrations/react/components/ClientPicker.js +4 -4
- package/dist/features/integrations/react/components/CodexInstallToggleButton.js +1 -1
- package/dist/features/integrations/react/components/IntegrationsTab.js +2 -2
- package/dist/features/integrations/react/components/SnippetBlock.js +1 -1
- package/dist/features/integrations/types.d.ts +1 -1
- package/dist/features/integrations/types.js +1 -1
- package/dist/features/interactive-ui/index.js +13 -13
- package/dist/features/interactive-ui/interactive-ui.css +1 -1
- package/dist/features/interactive-ui/providers/recharts/bar-chart.js +1 -1
- package/dist/features/interactive-ui/providers/recharts/line-chart.js +1 -1
- package/dist/features/interactive-ui/providers/recharts/pie-chart.js +2 -2
- package/dist/features/interactive-ui/providers/shadcn/lib/utils.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/lib/utils.js +1 -1
- package/dist/features/interactive-ui/registry.d.ts +15 -4
- package/dist/features/interactive-ui/registry.js +5 -5
- package/dist/features/language/react/components/LanguageTab.js +2 -2
- package/dist/features/list-detail-panel/types.d.ts +1 -1
- package/dist/features/list-detail-panel/types.js +1 -1
- package/dist/features/mcp-ui/confirmation-store.js +2 -1
- package/dist/features/mcp-ui/surfaces/tokens.d.ts +17 -20
- package/dist/features/mcp-ui/surfaces/tokens.js +33 -35
- package/dist/features/media-providers/index.d.ts +1 -1
- package/dist/features/media-providers/index.js +1 -1
- package/dist/features/media-providers/react/components/MediaProvidersTab.js +4 -4
- package/dist/features/media-providers/rules.js +1 -1
- package/dist/features/memory/async-commit-guard.d.ts +1 -1
- package/dist/features/memory/constants.d.ts +1 -1
- package/dist/features/memory/constants.js +1 -1
- package/dist/features/memory/dependencies.d.ts +11 -23
- package/dist/features/memory/dependencies.js +116 -106
- package/dist/features/memory/index.d.ts +1 -1
- package/dist/features/memory/index.js +1 -1
- package/dist/features/memory/react/components/MemoryAdvancedModal.js +2 -2
- package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
- package/dist/features/memory/react/components/MemoryExtractionCard.js +1 -1
- package/dist/features/memory/react/components/MemoryHooksPanel.js +1 -1
- package/dist/features/memory/react/components/MemoryList.js +5 -5
- package/dist/features/memory/react/components/MemoryManualEditor.js +5 -5
- package/dist/features/memory/react/components/MemorySettingsPanel.js +1 -1
- package/dist/features/memory/react/hooks/useMemoryEntries.hooks.js +1 -1
- package/dist/features/memory/react/hooks/useMemoryNavigation.hooks.js +1 -1
- package/dist/features/memory/react/styles.js +1 -1
- package/dist/features/memory/rules.js +1 -1
- package/dist/features/memory/types.d.ts +1 -1
- package/dist/features/mention-autocomplete/react/hooks/useMentionAutocomplete.js +1 -1
- package/dist/features/notifications/react/components/NotificationsTab.js +7 -7
- package/dist/features/notifications/types.d.ts +1 -1
- package/dist/features/observability/boot-timing.js +2 -2
- package/dist/features/observability/stuck-run.js +1 -1
- package/dist/features/observability/white-screen.js +4 -4
- package/dist/features/panel-kit/fetch-query/adapter.react.d.ts +35 -0
- package/dist/features/panel-kit/fetch-query/adapter.react.js +122 -0
- package/dist/features/panel-kit/fetch-query/cache.d.ts +123 -0
- package/dist/features/panel-kit/fetch-query/cache.js +231 -0
- package/dist/features/panel-kit/fetch-query/environment.browser.d.ts +4 -0
- package/dist/features/panel-kit/fetch-query/environment.browser.js +25 -0
- package/dist/features/panel-kit/fetch-query/index.d.ts +4 -0
- package/dist/features/panel-kit/fetch-query/index.js +2 -0
- package/dist/features/panel-kit/fetch-query/types.d.ts +91 -0
- package/dist/features/panel-kit/fetch-query/types.js +2 -0
- package/dist/features/panel-kit/helpers/format-timestamp.d.ts +18 -0
- package/dist/features/panel-kit/helpers/format-timestamp.js +20 -0
- package/dist/features/panel-kit/helpers/permissions.d.ts +11 -0
- package/dist/features/panel-kit/helpers/permissions.js +10 -0
- package/dist/features/panel-kit/helpers/resolve-active-tab-id.d.ts +13 -0
- package/dist/features/panel-kit/helpers/resolve-active-tab-id.js +13 -0
- package/dist/features/panel-kit/helpers/retry-unreachable.d.ts +20 -0
- package/dist/features/panel-kit/helpers/retry-unreachable.js +39 -0
- package/dist/features/panel-kit/hooks/use-async-action.hooks.d.ts +13 -0
- package/dist/features/panel-kit/hooks/use-async-action.hooks.js +27 -0
- package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.d.ts +18 -0
- package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.js +33 -0
- package/dist/features/panel-kit/hooks/use-focus-trap.hooks.d.ts +8 -0
- package/dist/features/panel-kit/hooks/use-focus-trap.hooks.js +66 -0
- package/dist/features/panel-kit/hooks/use-serial-writes.hooks.d.ts +26 -0
- package/dist/features/panel-kit/hooks/use-serial-writes.hooks.js +41 -0
- package/dist/features/panel-kit/hooks/use-settlement-generation.hooks.d.ts +9 -0
- package/dist/features/panel-kit/hooks/use-settlement-generation.hooks.js +25 -0
- package/dist/features/panel-kit/index.d.ts +19 -0
- package/dist/features/panel-kit/index.js +13 -0
- package/dist/features/privacy/react/components/PrivacyTab.js +2 -2
- package/dist/features/privacy/types.d.ts +1 -1
- package/dist/features/privacy/types.js +1 -1
- package/dist/features/progress-card/reference-adapters.d.ts +1 -1
- package/dist/features/progress-card/rules.d.ts +1 -1
- package/dist/features/progress-card/rules.js +1 -1
- package/dist/features/progress-card/types.d.ts +1 -1
- package/dist/features/progress-card/types.js +1 -1
- package/dist/features/resource-dashboard/dependencies.d.ts +1 -1
- package/dist/features/resource-dashboard/ports.d.ts +1 -1
- package/dist/features/resource-dashboard/react/hooks/useResourceBoard.d.ts +1 -1
- package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +1 -1
- package/dist/features/resource-dashboard/rules.d.ts +1 -1
- package/dist/features/resource-dashboard/rules.js +2 -2
- package/dist/features/resource-dashboard/types.d.ts +4 -4
- package/dist/features/resource-dashboard/types.js +1 -1
- package/dist/features/schedule-picker/react/hooks/useRecurringSchedulePicker.js +1 -1
- package/dist/features/settings/dialog/styles/settings-dialog.css +62 -60
- package/dist/features/sketch-editor/constants.d.ts +1 -1
- package/dist/features/sketch-editor/constants.js +1 -1
- package/dist/features/sketch-editor/dom.d.ts +1 -1
- package/dist/features/sketch-editor/dom.js +1 -1
- package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.d.ts +1 -1
- package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.js +11 -9
- package/dist/features/sketch-editor/types.d.ts +1 -1
- package/dist/features/sketch-editor/types.js +1 -1
- package/dist/features/skills/react/components/SkillDraftForm.js +1 -1
- package/dist/features/skills/react/components/SkillRow.js +1 -1
- package/dist/features/skills/react/components/SkillsTab.js +2 -2
- package/dist/features/source-config-list/agent-handles.js +2 -2
- package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.d.ts +1 -1
- package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.js +1 -1
- package/dist/features/source-config-list/rules.d.ts +1 -1
- package/dist/features/source-config-list/rules.js +3 -3
- package/dist/features/source-config-list/types.d.ts +1 -1
- package/dist/features/source-config-list/types.js +1 -1
- package/dist/features/tab-launcher-menu/react/hooks/useTabLauncherMenu.js +1 -1
- package/dist/features/tab-strip/index.d.ts +4 -0
- package/dist/features/tab-strip/index.js +2 -0
- package/dist/features/tab-strip/react/components/TabBar.d.ts +23 -0
- package/dist/features/tab-strip/react/components/TabBar.hooks.d.ts +25 -0
- package/dist/features/tab-strip/react/components/TabBar.hooks.js +57 -0
- package/dist/features/tab-strip/react/components/TabBar.js +18 -0
- package/dist/features/tab-strip/react/components/TabStrip.js +2 -1
- package/dist/features/tab-strip/react/components/TabStripFrame.d.ts +3 -0
- package/dist/features/tab-strip/react/components/TabStripFrame.js +7 -0
- package/dist/features/tabbed-dialog/react/hooks/useTabbedDialog.js +1 -1
- package/dist/features/tabbed-dialog/styles/tabbed-dialog.css +8 -141
- package/dist/features/tabbed-dialog/types.d.ts +1 -1
- package/dist/features/tabbed-dialog/types.js +1 -1
- package/dist/features/version-manager/ports.d.ts +1 -1
- package/dist/features/version-manager/react/components/VersionPromptPopover.js +5 -3
- package/dist/features/version-manager/react/components/VersionRestoreControl.js +1 -1
- package/dist/features/version-manager/types.d.ts +1 -1
- package/dist/features/version-manager/types.js +1 -1
- package/dist/features/viewer-shell/dependencies.js +1 -1
- package/dist/features/viewer-shell/ports.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
- package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.d.ts +1 -1
- package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.js +1 -1
- package/dist/features/viewer-shell/types.d.ts +1 -1
- package/dist/features/viewer-shell/types.js +1 -1
- package/dist/index.d.ts +420 -0
- package/dist/index.js +421 -1
- package/dist/react/components/ComponentKitPreview.js +1 -1
- package/dist/react/components/EditorIcon.d.ts +1 -1
- package/dist/react/components/EditorIcon.js +22 -22
- package/dist/react/components/ExportDiagnosticsButton.d.ts +8 -1
- package/dist/react/components/ExportDiagnosticsButton.js +6 -6
- package/dist/react/components/PaletteTweaks.js +5 -5
- package/dist/react/hooks/useBrandFonts.d.ts +19 -4
- package/dist/react/hooks/useBrandFonts.js +11 -7
- package/dist/react/hooks/useDebouncedValue.d.ts +12 -1
- package/dist/react/hooks/useDebouncedValue.js +9 -4
- package/dist/react/hooks/useStableHandler.d.ts +3 -1
- package/dist/react/hooks/useStableHandler.js +1 -1
- package/dist/renderers/annotation-canvas/drawing.d.ts +4 -4
- package/dist/renderers/annotation-canvas/drawing.js +28 -15
- package/dist/renderers/annotation-canvas/react/components/AnnotationCanvas.js +2 -2
- package/dist/renderers/annotation-canvas/react/hooks/useAnnotationCanvas.js +4 -3
- package/dist/renderers/annotation-canvas/rules.d.ts +1 -1
- package/dist/renderers/annotation-canvas/theme.d.ts +13 -0
- package/dist/renderers/annotation-canvas/theme.js +16 -0
- package/dist/renderers/annotation-canvas/types.d.ts +1 -1
- package/dist/renderers/index.d.ts +1 -1
- package/dist/renderers/new-tab-preview.d.ts +3 -0
- package/dist/renderers/new-tab-preview.js +3 -1
- package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.d.ts +1 -1
- package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.js +1 -1
- package/dist/renderers/preview-modal-shell/rules.d.ts +1 -1
- package/dist/renderers/preview-modal-shell/types.d.ts +3 -3
- package/dist/renderers/preview-modal-shell/types.js +2 -2
- package/dist/renderers/react/components/ArtifactView.d.ts +1 -1
- package/dist/renderers/react/components/ArtifactView.js +1 -1
- package/dist/renderers/registry.d.ts +12 -6
- package/dist/renderers/registry.js +7 -9
- package/dist/renderers/renderers/html.js +2 -2
- package/dist/renderers/renderers/index.js +1 -1
- package/dist/renderers/renderers/markdown.js +2 -2
- package/dist/renderers/renderers/react-component.js +1 -1
- package/dist/renderers/renderers/svg.js +1 -1
- package/dist/renderers/shiki.js +1 -1
- package/dist/renderers/srcdoc/build.d.ts +1 -1
- package/dist/renderers/srcdoc/build.js +1 -1
- package/dist/renderers/url-load-decision.d.ts +1 -1
- package/dist/renderers/url-load-decision.js +1 -1
- package/dist/styles/admin.css +273 -0
- package/dist/styles/variables.css +117 -0
- package/dist/theme/apply.d.ts +9 -0
- package/dist/theme/apply.js +77 -0
- package/dist/theme/color-scheme.d.ts +8 -0
- package/dist/theme/color-scheme.js +9 -0
- package/dist/theme/default.d.ts +4 -0
- package/dist/theme/default.js +11 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.js +5 -0
- package/dist/theme/stylesheet.d.ts +8 -0
- package/dist/theme/stylesheet.js +14 -0
- package/dist/theme/types.d.ts +39 -0
- package/dist/theme/types.js +2 -0
- package/dist/theme/validation.d.ts +15 -0
- package/dist/theme/validation.js +55 -0
- package/dist/utils/appearance.js +1 -1
- package/dist/utils/browser-request.d.ts +12 -0
- package/dist/utils/browser-request.js +10 -0
- package/dist/utils/color-math.d.ts +20 -6
- package/dist/utils/color-math.js +12 -12
- package/dist/utils/copy-to-clipboard.d.ts +19 -8
- package/dist/utils/copy-to-clipboard.js +15 -11
- package/dist/utils/dom-subscriptions.js +1 -1
- package/dist/utils/endpoint-policy.d.ts +9 -3
- package/dist/utils/endpoint-policy.js +5 -5
- package/dist/utils/markdown-scroll-sync.js +3 -3
- package/dist/utils/notifications.d.ts +1 -1
- package/dist/utils/notifications.js +1 -1
- package/dist/utils/polygon-selection.d.ts +1 -1
- package/dist/utils/polygon-selection.js +1 -1
- package/dist/utils/scroll-tabs-with-wheel.d.ts +4 -1
- package/dist/utils/scroll-tabs-with-wheel.js +1 -1
- package/dist/utils/smooth-scroll-to-top.js +1 -1
- package/dist/utils/sse.d.ts +3 -1
- package/dist/utils/sse.js +1 -1
- package/package.json +105 -16
- package/dist/features/lexical-rich-text-editor/react/test-support/lexical-harness.d.ts +0 -11
- package/dist/features/lexical-rich-text-editor/react/test-support/lexical-harness.js +0 -35
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* `apps/web/src/artifacts/markdown.ts` in the origin project — no
|
|
4
4
|
* product-specific logic in the original, just table-pipe-escaping + a few HTML
|
|
5
5
|
* post-processing passes (safe external links, table wrapper class,
|
|
6
|
-
* alignment-attribute → CSS). See `
|
|
6
|
+
* alignment-attribute → CSS). See `archived provenance ledger`.
|
|
7
7
|
*/
|
|
8
8
|
import { micromark } from 'micromark';
|
|
9
9
|
import { gfm, gfmHtml } from 'micromark-extension-gfm';
|
|
@@ -115,7 +115,7 @@ export const MarkdownRenderer = {
|
|
|
115
115
|
supportsStreaming: true,
|
|
116
116
|
renderPartial: renderMarkdownToSafeHtml,
|
|
117
117
|
canRender: ({ file }) => {
|
|
118
|
-
const manifest = resolveArtifactManifest(file);
|
|
118
|
+
const manifest = resolveArtifactManifest({ file: file });
|
|
119
119
|
if (!manifest)
|
|
120
120
|
return false;
|
|
121
121
|
if (manifest.renderer === 'markdown' || manifest.kind === 'markdown-document')
|
|
@@ -10,7 +10,7 @@ export const ReactComponentRenderer = {
|
|
|
10
10
|
id: 'react-component',
|
|
11
11
|
supportsStreaming: false,
|
|
12
12
|
canRender: ({ file }) => {
|
|
13
|
-
const manifest = resolveArtifactManifest(file);
|
|
13
|
+
const manifest = resolveArtifactManifest({ file: file });
|
|
14
14
|
if (!manifest)
|
|
15
15
|
return false;
|
|
16
16
|
return manifest.kind === 'react-component' || manifest.renderer === 'react-component';
|
|
@@ -3,7 +3,7 @@ export const SvgRenderer = {
|
|
|
3
3
|
id: 'svg',
|
|
4
4
|
supportsStreaming: false,
|
|
5
5
|
canRender: ({ file }) => {
|
|
6
|
-
const manifest = resolveArtifactManifest(file);
|
|
6
|
+
const manifest = resolveArtifactManifest({ file: file });
|
|
7
7
|
if (!manifest)
|
|
8
8
|
return false;
|
|
9
9
|
if (manifest.renderer === 'svg' || manifest.kind === 'svg')
|
package/dist/renderers/shiki.js
CHANGED
|
@@ -5,7 +5,7 @@ const CACHE_MAX = 128;
|
|
|
5
5
|
// 'toml', 'dockerfile' — this package's pinned `shiki` version's
|
|
6
6
|
// `bundle/web` (a deliberately size-trimmed, browser-focused subset) does
|
|
7
7
|
// not ship grammars for those, so they're dropped here rather than typed
|
|
8
|
-
// around with a cast that would fail at runtime. See `
|
|
8
|
+
// around with a cast that would fail at runtime. See `archived provenance ledger`.
|
|
9
9
|
function getHighlighter() {
|
|
10
10
|
if (!highlighterPromise) {
|
|
11
11
|
highlighterPromise = import('shiki/bundle/web').then(({ createHighlighter }) => createHighlighter({
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* CSS tweaks palette, manual-edit overlay, snapshot/export-capture) — those
|
|
10
10
|
* are that product's own UI protocols. They become `SrcDocBridge` plugins a
|
|
11
11
|
* host registers via `bridges` (see `bridge.ts`), not built-ins. See
|
|
12
|
-
* `
|
|
12
|
+
* `archived provenance ledger` for the full file-by-file breakdown.
|
|
13
13
|
*/
|
|
14
14
|
import { type SrcDocBridge } from './bridge.js';
|
|
15
15
|
export interface BuildSrcDocOptions {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* CSS tweaks palette, manual-edit overlay, snapshot/export-capture) — those
|
|
10
10
|
* are that product's own UI protocols. They become `SrcDocBridge` plugins a
|
|
11
11
|
* host registers via `bridges` (see `bridge.ts`), not built-ins. See
|
|
12
|
-
* `
|
|
12
|
+
* `archived provenance ledger` for the full file-by-file breakdown.
|
|
13
13
|
*/
|
|
14
14
|
import { applySrcDocBridges } from './bridge.js';
|
|
15
15
|
/**
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* replaces that fixed list with `activeBridgeIds`, so any host-registered
|
|
15
15
|
* `SrcDocBridge` (see `srcdoc/bridge.ts`) can force srcDoc mode by declaring
|
|
16
16
|
* itself active, without this package knowing the bridge's name in advance.
|
|
17
|
-
* See `
|
|
17
|
+
* See `archived provenance ledger`.
|
|
18
18
|
*/
|
|
19
19
|
export interface UrlLoadDecision {
|
|
20
20
|
/** Whether the viewer is showing the rendered preview vs. the raw source. */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* replaces that fixed list with `activeBridgeIds`, so any host-registered
|
|
15
15
|
* `SrcDocBridge` (see `srcdoc/bridge.ts`) can force srcDoc mode by declaring
|
|
16
16
|
* itself active, without this package knowing the bridge's name in advance.
|
|
17
|
-
* See `
|
|
17
|
+
* See `archived provenance ledger`.
|
|
18
18
|
*/
|
|
19
19
|
/**
|
|
20
20
|
* Returns true when an HTML file's preview iframe should load directly from
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
@import "./variables.css";
|
|
2
|
+
|
|
3
|
+
/* Legacy admin spellings derive from the single contract. */
|
|
4
|
+
:root, [data-admin-theme], [data-color-scheme] {
|
|
5
|
+
|
|
6
|
+
--bg: var(--jini-bg);
|
|
7
|
+
--surface: var(--jini-bg-panel);
|
|
8
|
+
--surface-2: var(--jini-bg-subtle);
|
|
9
|
+
--surface-3: var(--jini-bg-elevated);
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
--fg-1: var(--jini-text-strong);
|
|
13
|
+
--fg: var(--jini-text);
|
|
14
|
+
--fg-2: var(--jini-text-secondary);
|
|
15
|
+
--fg-3: var(--jini-text-muted);
|
|
16
|
+
--muted: var(--jini-text-muted);
|
|
17
|
+
--faint: var(--jini-text-faint);
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
--border: var(--jini-border);
|
|
21
|
+
--border-strong: var(--jini-border-strong);
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
--accent: var(--jini-neutral-accent);
|
|
25
|
+
--accent-ink: var(--jini-neutral-accent-ink);
|
|
26
|
+
--accent-text: var(--jini-neutral-accent-text);
|
|
27
|
+
--accent-dim: var(--jini-neutral-accent-soft);
|
|
28
|
+
--accent-ring: var(--jini-neutral-accent-ring);
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
--primary: var(--jini-accent);
|
|
32
|
+
--primary-strong: var(--jini-accent-strong);
|
|
33
|
+
--primary-ink: var(--jini-accent-ink);
|
|
34
|
+
--primary-dim: var(--jini-accent-soft);
|
|
35
|
+
--primary-ring: var(--jini-accent-ring);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
--link: var(--jini-link);
|
|
39
|
+
--link-ink: var(--jini-link-ink);
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
--ok: var(--jini-success);
|
|
43
|
+
--ok-bg: var(--jini-success-bg);
|
|
44
|
+
--ok-solid: var(--jini-success-solid);
|
|
45
|
+
--ok-solid-ink: var(--jini-success-solid-ink);
|
|
46
|
+
--danger: var(--jini-danger);
|
|
47
|
+
--danger-bg: var(--jini-danger-bg);
|
|
48
|
+
--warning: var(--jini-warning);
|
|
49
|
+
--warning-bg: var(--jini-warning-bg);
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
--font-display: var(--jini-font-display);
|
|
53
|
+
--font-ui: var(--jini-font-ui);
|
|
54
|
+
--font-mono: var(--jini-font-mono);
|
|
55
|
+
|
|
56
|
+
--text-2xs: var(--jini-font-size-2xs);
|
|
57
|
+
--text-xs: var(--jini-font-size-xs);
|
|
58
|
+
--text-sm: var(--jini-font-size-sm);
|
|
59
|
+
--text-base: var(--jini-font-size-base);
|
|
60
|
+
--text-md: var(--jini-font-size-md);
|
|
61
|
+
--text-lg: var(--jini-font-size-lg);
|
|
62
|
+
--text-xl: var(--jini-font-size-xl);
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
--r-sm: var(--jini-radius-sm);
|
|
66
|
+
--r-md: var(--jini-radius-md);
|
|
67
|
+
--r-lg: var(--jini-radius-lg);
|
|
68
|
+
--r-pill: var(--jini-radius-pill);
|
|
69
|
+
|
|
70
|
+
--radius-md: var(--jini-radius-md);
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
--space-1: var(--jini-space-1);
|
|
74
|
+
--space-2: var(--jini-space-2);
|
|
75
|
+
--space-3: var(--jini-space-3);
|
|
76
|
+
--space-4: var(--jini-space-4);
|
|
77
|
+
--space-5: var(--jini-space-5);
|
|
78
|
+
--space-6: var(--jini-space-6);
|
|
79
|
+
--space-7: var(--jini-space-7);
|
|
80
|
+
--space-8: var(--jini-space-8);
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
--shadow-sm: var(--jini-shadow-sm);
|
|
84
|
+
--shadow-md: var(--jini-shadow-md);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
.select-trigger {
|
|
89
|
+
width: 100%; box-sizing: border-box;
|
|
90
|
+
display: inline-flex; align-items: center; justify-content: space-between; gap: var(--jini-space-2);
|
|
91
|
+
background: var(--jini-bg-elevated); color: var(--jini-text);
|
|
92
|
+
|
|
93
|
+
border: 1px solid color-mix(in oklab, var(--jini-accent) 45%, var(--jini-border-strong));
|
|
94
|
+
border-radius: var(--jini-radius-sm); padding: 0.55rem 0.7rem; min-height: 37px;
|
|
95
|
+
font-family: var(--jini-font-ui); font-size: var(--jini-font-size-sm); font-weight: 400; letter-spacing: normal;
|
|
96
|
+
cursor: pointer; text-align: left;
|
|
97
|
+
transition: border-color 0.14s, box-shadow 0.14s;
|
|
98
|
+
}
|
|
99
|
+
.select-trigger:hover { opacity: 1; }
|
|
100
|
+
.select-trigger:focus-visible, .select-trigger[aria-expanded="true"] {
|
|
101
|
+
outline: none; border-color: var(--jini-accent); box-shadow: 0 0 0 3px var(--jini-accent-ring);
|
|
102
|
+
}
|
|
103
|
+
.select-trigger:disabled { cursor: default; border-color: var(--jini-border-strong); background: var(--jini-bg-subtle); color: var(--jini-text-disabled); }
|
|
104
|
+
.select-trigger-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
105
|
+
.select-trigger-label.is-placeholder { color: var(--jini-text-disabled); }
|
|
106
|
+
|
|
107
|
+
.select-trigger-chevron {
|
|
108
|
+
width: 14px; height: 14px; flex-shrink: 0;
|
|
109
|
+
background: currentColor;
|
|
110
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 5.5 7 9l3.5-3.5' fill='none' stroke='currentColor' stroke-width='1.5'/%3E%3C/svg%3E") center / 14px no-repeat;
|
|
111
|
+
background-repeat: no-repeat; background-position: center; background-size: 14px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.select-panel {
|
|
115
|
+
position: fixed; z-index: 50;
|
|
116
|
+
display: flex; flex-direction: column;
|
|
117
|
+
background: var(--jini-bg-elevated); border: 1px solid var(--jini-border-strong); border-radius: var(--jini-radius);
|
|
118
|
+
box-shadow: var(--jini-shadow-md); overflow: hidden;
|
|
119
|
+
}
|
|
120
|
+
.select-panel:focus { outline: none; }
|
|
121
|
+
.select-search {
|
|
122
|
+
margin: var(--jini-space-2); width: auto;
|
|
123
|
+
}
|
|
124
|
+
.select-list {
|
|
125
|
+
list-style: none; margin: 0; padding: var(--jini-space-1) 0;
|
|
126
|
+
flex: 1 1 auto; min-height: 0; overflow-y: auto;
|
|
127
|
+
}
|
|
128
|
+
.select-empty {
|
|
129
|
+
padding: var(--jini-space-3); font-size: var(--jini-font-size-sm); color: var(--jini-text-muted); text-align: center;
|
|
130
|
+
}
|
|
131
|
+
.select-option {
|
|
132
|
+
display: flex; align-items: center; justify-content: space-between; gap: var(--jini-space-2);
|
|
133
|
+
padding: 0.5rem 0.75rem; font-size: var(--jini-font-size-sm); color: var(--jini-text); cursor: pointer;
|
|
134
|
+
}
|
|
135
|
+
.select-option:hover, .select-option.is-highlighted { background: var(--jini-bg-subtle); }
|
|
136
|
+
|
|
137
|
+
.select-option.is-selected {
|
|
138
|
+
background: color-mix(in oklab, var(--jini-accent) 14%, var(--jini-bg-elevated));
|
|
139
|
+
color: var(--jini-accent);
|
|
140
|
+
font-weight: 600;
|
|
141
|
+
}
|
|
142
|
+
.select-option.is-selected.is-highlighted {
|
|
143
|
+
background: color-mix(in oklab, var(--jini-accent) 22%, var(--jini-bg-elevated));
|
|
144
|
+
}
|
|
145
|
+
.select-option-check { flex-shrink: 0; width: 16px; height: 16px; color: var(--jini-accent); }
|
|
146
|
+
|
|
147
|
+
.see-more {
|
|
148
|
+
display: block;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.see-more .see-more-text {
|
|
152
|
+
display: -webkit-box;
|
|
153
|
+
-webkit-box-orient: vertical;
|
|
154
|
+
-webkit-line-clamp: var(--see-more-lines, 2);
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
white-space: normal;
|
|
157
|
+
overflow-wrap: anywhere;
|
|
158
|
+
text-overflow: clip;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.see-more .see-more-text.is-expanded {
|
|
162
|
+
display: block;
|
|
163
|
+
-webkit-line-clamp: unset;
|
|
164
|
+
overflow: visible;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.see-more .see-more-toggle {
|
|
168
|
+
display: inline-block;
|
|
169
|
+
margin-top: 0.15rem;
|
|
170
|
+
padding: 0;
|
|
171
|
+
background: none;
|
|
172
|
+
border: none;
|
|
173
|
+
border-radius: 0;
|
|
174
|
+
color: var(--jini-accent);
|
|
175
|
+
font-family: inherit;
|
|
176
|
+
font-size: var(--jini-font-size-sm);
|
|
177
|
+
font-weight: 500;
|
|
178
|
+
letter-spacing: normal;
|
|
179
|
+
text-align: left;
|
|
180
|
+
text-decoration: none;
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.see-more .see-more-toggle:hover {
|
|
185
|
+
opacity: 1;
|
|
186
|
+
text-decoration: underline;
|
|
187
|
+
text-underline-offset: 2px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.info-tip { position: relative; display: inline-flex; margin-left: 0.35rem; vertical-align: middle; }
|
|
191
|
+
.info-tip-icon {
|
|
192
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
193
|
+
width: 1.1rem; height: 1.1rem; border-radius: 50%; color: var(--jini-text-disabled);
|
|
194
|
+
font-size: 0.95rem; line-height: 1; cursor: pointer;
|
|
195
|
+
}
|
|
196
|
+
.info-tip:hover .info-tip-icon, .info-tip:focus-within .info-tip-icon { color: var(--jini-accent); }
|
|
197
|
+
.info-tip-icon:focus-visible { outline: 2px solid var(--jini-accent); outline-offset: 2px; border-radius: 50%; }
|
|
198
|
+
.info-tip-bubble {
|
|
199
|
+
position: fixed; transform: translate(-50%, calc(-100% - 8px));
|
|
200
|
+
width: max-content; max-width: 18rem; padding: 0.55rem 0.75rem; border-radius: var(--jini-radius-sm);
|
|
201
|
+
background: var(--jini-bg-panel); color: var(--jini-text); font-size: 0.78rem; font-weight: 400;
|
|
202
|
+
line-height: 1.4; letter-spacing: normal; text-transform: none;
|
|
203
|
+
box-shadow: 0 4px 16px var(--jini-backdrop); border: 1px solid var(--jini-border);
|
|
204
|
+
pointer-events: none; z-index: 1000;
|
|
205
|
+
}
|
|
206
|
+
.info-tip-bubble::after {
|
|
207
|
+
content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
|
|
208
|
+
border: 5px solid transparent; border-top-color: var(--jini-bg-panel);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.info-tip-bubble-below { transform: translate(-50%, 8px); }
|
|
212
|
+
.info-tip-bubble-below::after {
|
|
213
|
+
top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--jini-bg-panel);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.tab-bar { display: flex; flex-wrap: wrap; gap: 0.3rem; border-bottom: 1px solid var(--jini-border); margin-bottom: 1.3rem; }
|
|
217
|
+
|
|
218
|
+
.tab-bar-item {
|
|
219
|
+
display: inline-flex; align-items: center;
|
|
220
|
+
background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
|
|
221
|
+
padding: 0.65rem 0.9rem; font-family: var(--jini-font-ui); font-size: var(--jini-font-size-sm); font-weight: 600;
|
|
222
|
+
color: var(--jini-text-muted); cursor: pointer; transition: color 0.14s, border-color 0.14s; flex-shrink: 0;
|
|
223
|
+
}
|
|
224
|
+
.tab-bar-item:hover { background: none; color: var(--jini-text); opacity: 1; }
|
|
225
|
+
.tab-bar-item[aria-selected="true"] { color: var(--jini-accent); border-bottom-color: var(--jini-accent); }
|
|
226
|
+
.tab-bar-count { margin-left: 0.4rem; font-size: var(--jini-font-size-2xs); color: var(--jini-text-disabled); font-variant-numeric: tabular-nums; }
|
|
227
|
+
.tab-bar-item[aria-selected="true"] .tab-bar-count { color: var(--jini-accent); opacity: 0.75; }
|
|
228
|
+
|
|
229
|
+
.tab-bar-tag {
|
|
230
|
+
margin-left: 0.4rem; font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
|
|
231
|
+
color: var(--jini-text-disabled); border: 1px solid var(--jini-border); padding: 1px 5px; border-radius: 5px;
|
|
232
|
+
}
|
|
233
|
+
.tab-bar-item[aria-selected="true"] .tab-bar-tag { color: var(--jini-accent); opacity: 0.75; }
|
|
234
|
+
|
|
235
|
+
.tab-bar-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--jini-success); margin-right: 0.4rem; flex-shrink: 0; }
|
|
236
|
+
|
|
237
|
+
.tab-bar-icon { display: inline-flex; align-items: center; margin-right: 0.4rem; flex-shrink: 0; width: 1em; height: 1em; color: currentColor; }
|
|
238
|
+
|
|
239
|
+
.tab-bar-item:disabled { color: var(--jini-text-disabled); background: none; cursor: not-allowed; }
|
|
240
|
+
.tab-bar-item:disabled:hover { color: var(--jini-text-disabled); background: none; }
|
|
241
|
+
.tab-bar-item:disabled .tab-bar-count { color: var(--jini-text-disabled); }
|
|
242
|
+
|
|
243
|
+
.tab-bar .visually-hidden { position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
|
|
244
|
+
|
|
245
|
+
.coming-soon-panel .settings-ui-inert-note {
|
|
246
|
+
margin: 0 0 12px; padding: 10px 14px; font-size: 12px; line-height: 1.5;
|
|
247
|
+
color: var(--jini-text-muted); background: var(--jini-bg-subtle);
|
|
248
|
+
border: 1px dashed var(--jini-border); border-radius: var(--jini-radius-sm);
|
|
249
|
+
}
|
|
250
|
+
.coming-soon-panel .settings-ui-inert-control { opacity: 0.55; }
|
|
251
|
+
|
|
252
|
+
.image-preview-modal {
|
|
253
|
+
border: none; padding: 0; background: transparent; max-width: 90vw; max-height: 90vh;
|
|
254
|
+
}
|
|
255
|
+
.image-preview-modal[open] { display: block; }
|
|
256
|
+
.image-preview-modal::backdrop { background: var(--jini-backdrop); }
|
|
257
|
+
.image-preview-modal img { display: block; max-width: 90vw; max-height: 90vh; width: auto; height: auto; border-radius: var(--jini-radius-lg); box-shadow: var(--jini-shadow-md); }
|
|
258
|
+
.image-preview-modal-close {
|
|
259
|
+
position: absolute; top: 0.7rem; right: 0.7rem; width: 2.1rem; height: 2.1rem; border-radius: 50%;
|
|
260
|
+
display: flex; align-items: center; justify-content: center;
|
|
261
|
+
background: var(--jini-bg-panel); color: var(--jini-text); font-size: 1.3rem; line-height: 1;
|
|
262
|
+
|
|
263
|
+
border: 1px solid var(--jini-border); box-shadow: var(--jini-shadow-md);
|
|
264
|
+
}
|
|
265
|
+
.image-preview-modal-close:hover { background: var(--jini-bg-subtle); opacity: 1; }
|
|
266
|
+
.select-search { box-sizing: border-box; padding: .5rem .7rem; background: var(--jini-bg-elevated); color: var(--jini-text); border: 1px solid var(--jini-border); border-radius: var(--jini-radius-sm); font: inherit; }
|
|
267
|
+
.tab-bar-item:focus-visible { outline: 2px solid var(--jini-accent); outline-offset: 2px; }
|
|
268
|
+
.coming-soon-notice-kicker { color: var(--jini-text-muted); font-size: .75rem; }
|
|
269
|
+
.coming-soon-notice h1 { margin: 0 0 .4rem; }
|
|
270
|
+
.coming-soon-notice p { color: var(--jini-text-muted); }
|
|
271
|
+
|
|
272
|
+
.admin-layout { background: var(--jini-bg); color: var(--jini-text); font-family: var(--jini-font-body); }
|
|
273
|
+
.admin-layout :is(h1, h2, h3) { font-family: var(--jini-font-heading); }
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/** The sole variable contract. Products override it through AdminTheme data. */
|
|
2
|
+
:root, [data-admin-theme], [data-color-scheme="light"] {
|
|
3
|
+
color-scheme: light;
|
|
4
|
+
--jini-bg: var(--jini-theme-light-bg, #ffffff);
|
|
5
|
+
--jini-surface: var(--jini-theme-light-surface, #f5f5f5);
|
|
6
|
+
--jini-text: var(--jini-theme-light-text, #202020);
|
|
7
|
+
--jini-muted: var(--jini-theme-light-muted, #666666);
|
|
8
|
+
--jini-border: var(--jini-theme-light-border, #d9d9d9);
|
|
9
|
+
--jini-primary: var(--jini-theme-light-primary, #363636);
|
|
10
|
+
--jini-primary-ink: var(--jini-theme-light-primary-ink, #ffffff);
|
|
11
|
+
--jini-danger: var(--jini-theme-light-danger, #b42318);
|
|
12
|
+
--jini-success: var(--jini-theme-light-success, #18763b);
|
|
13
|
+
--jini-warning: var(--jini-theme-light-warning, #845800);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[data-color-scheme="dark"] {
|
|
17
|
+
color-scheme: dark;
|
|
18
|
+
--jini-bg: var(--jini-theme-dark-bg, #171717);
|
|
19
|
+
--jini-surface: var(--jini-theme-dark-surface, #242424);
|
|
20
|
+
--jini-text: var(--jini-theme-dark-text, #f0f0f0);
|
|
21
|
+
--jini-muted: var(--jini-theme-dark-muted, #b3b3b3);
|
|
22
|
+
--jini-border: var(--jini-theme-dark-border, #454545);
|
|
23
|
+
--jini-primary: var(--jini-theme-dark-primary, #e0e0e0);
|
|
24
|
+
--jini-primary-ink: var(--jini-theme-dark-primary-ink, #202020);
|
|
25
|
+
--jini-danger: var(--jini-theme-dark-danger, #ff8b80);
|
|
26
|
+
--jini-success: var(--jini-theme-dark-success, #79d69b);
|
|
27
|
+
--jini-warning: var(--jini-theme-dark-warning, #ebc36b);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:root {
|
|
31
|
+
--jini-font-body: system-ui, sans-serif;
|
|
32
|
+
--jini-font-heading: system-ui, sans-serif;
|
|
33
|
+
--jini-font-mono: ui-monospace, monospace;
|
|
34
|
+
--jini-radius: 8px;
|
|
35
|
+
--jini-density: 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:root, [data-admin-theme], [data-color-scheme] {
|
|
39
|
+
--jini-bg-panel: var(--jini-surface);
|
|
40
|
+
--jini-bg-subtle: color-mix(in srgb, var(--jini-surface) 75%, var(--jini-bg));
|
|
41
|
+
--jini-bg-elevated: var(--jini-surface);
|
|
42
|
+
--jini-border-soft: var(--jini-border);
|
|
43
|
+
--jini-border-strong: color-mix(in srgb, var(--jini-border) 75%, var(--jini-text));
|
|
44
|
+
--jini-backdrop: color-mix(in srgb, var(--jini-text) 42%, transparent);
|
|
45
|
+
--jini-text-strong: var(--jini-text);
|
|
46
|
+
--jini-text-secondary: color-mix(in srgb, var(--jini-text) 80%, var(--jini-bg));
|
|
47
|
+
--jini-text-muted: var(--jini-muted);
|
|
48
|
+
--jini-text-faint: color-mix(in srgb, var(--jini-muted) 75%, var(--jini-bg));
|
|
49
|
+
--jini-text-disabled: color-mix(in srgb, var(--jini-muted) 60%, var(--jini-bg));
|
|
50
|
+
--jini-accent: var(--jini-primary);
|
|
51
|
+
--jini-accent-hover: color-mix(in srgb, var(--jini-primary) 88%, var(--jini-text));
|
|
52
|
+
--jini-accent-strong: color-mix(in srgb, var(--jini-primary) 85%, var(--jini-bg));
|
|
53
|
+
--jini-accent-ink: var(--jini-primary-ink);
|
|
54
|
+
--jini-accent-soft: color-mix(in srgb, var(--jini-primary) 10%, transparent);
|
|
55
|
+
--jini-accent-ring: color-mix(in srgb, var(--jini-primary) 22%, transparent);
|
|
56
|
+
--jini-neutral-accent: var(--jini-text);
|
|
57
|
+
--jini-neutral-accent-hover: var(--jini-muted);
|
|
58
|
+
--jini-neutral-accent-ink: var(--jini-bg);
|
|
59
|
+
--jini-neutral-accent-text: var(--jini-text);
|
|
60
|
+
--jini-neutral-accent-soft: color-mix(in srgb, var(--jini-text) 7%, transparent);
|
|
61
|
+
--jini-neutral-accent-ring: color-mix(in srgb, var(--jini-text) 16%, transparent);
|
|
62
|
+
--jini-link: var(--jini-primary);
|
|
63
|
+
--jini-link-ink: var(--jini-primary-ink);
|
|
64
|
+
--jini-success-bg: color-mix(in srgb, var(--jini-success) 12%, var(--jini-bg));
|
|
65
|
+
--jini-success-solid: var(--jini-success);
|
|
66
|
+
--jini-success-solid-ink: var(--jini-bg);
|
|
67
|
+
--jini-danger-bg: color-mix(in srgb, var(--jini-danger) 12%, var(--jini-bg));
|
|
68
|
+
--jini-warning-bg: color-mix(in srgb, var(--jini-warning) 12%, var(--jini-bg));
|
|
69
|
+
--jini-font-ui: var(--jini-font-body);
|
|
70
|
+
--jini-font-display: var(--jini-font-heading);
|
|
71
|
+
--jini-shadow-xs: 0 1px 0 color-mix(in srgb, var(--jini-text) 4%, transparent);
|
|
72
|
+
--jini-shadow-sm: 0 1px 3px color-mix(in srgb, var(--jini-text) 10%, transparent);
|
|
73
|
+
--jini-shadow-md: 0 6px 24px color-mix(in srgb, var(--jini-text) 15%, transparent);
|
|
74
|
+
--jini-shadow-lg: 0 24px 60px color-mix(in srgb, var(--jini-text) 22%, transparent);
|
|
75
|
+
--jini-radius-xs: calc(var(--jini-radius) * 0.5);
|
|
76
|
+
--jini-radius-sm: calc(var(--jini-radius) * 0.75);
|
|
77
|
+
/* The middle radius keeps compact rows/popovers distinct from generic cards and modal chrome:
|
|
78
|
+
at the default 8px base it is 10px, between the 8px card and 12px modal steps. */
|
|
79
|
+
--jini-radius-md: calc(var(--jini-radius) * 1.25);
|
|
80
|
+
--jini-radius-lg: calc(var(--jini-radius) * 1.5);
|
|
81
|
+
--jini-radius-pill: 999px;
|
|
82
|
+
--jini-space-1: calc(0.25rem * var(--jini-density));
|
|
83
|
+
--jini-space-2: calc(0.5rem * var(--jini-density));
|
|
84
|
+
--jini-space-3: calc(0.75rem * var(--jini-density));
|
|
85
|
+
--jini-space-4: calc(1rem * var(--jini-density));
|
|
86
|
+
--jini-space-5: calc(1.25rem * var(--jini-density));
|
|
87
|
+
--jini-space-6: calc(1.5rem * var(--jini-density));
|
|
88
|
+
--jini-space-7: calc(2rem * var(--jini-density));
|
|
89
|
+
--jini-space-8: calc(2.5rem * var(--jini-density));
|
|
90
|
+
--jini-font-size-2xs: 0.6875rem;
|
|
91
|
+
--jini-font-size-xs: 0.75rem;
|
|
92
|
+
--jini-font-size-sm: 0.8125rem;
|
|
93
|
+
--jini-font-size-base: 0.875rem;
|
|
94
|
+
--jini-font-size-md: 0.95rem;
|
|
95
|
+
--jini-font-size-lg: 1.05rem;
|
|
96
|
+
--jini-font-size-xl: 1.65rem;
|
|
97
|
+
--jini-font-weight-normal: 400;
|
|
98
|
+
--jini-font-weight-medium: 500;
|
|
99
|
+
--jini-font-weight-semibold: 600;
|
|
100
|
+
--jini-font-weight-bold: 700;
|
|
101
|
+
--jini-line-tight: 1.25;
|
|
102
|
+
--jini-line-normal: 1.5;
|
|
103
|
+
--jini-line-relaxed: 1.7;
|
|
104
|
+
--jini-duration-fast: 120ms;
|
|
105
|
+
--jini-duration-base: 200ms;
|
|
106
|
+
--jini-duration-slow: 320ms;
|
|
107
|
+
--jini-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
|
|
108
|
+
--jini-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
109
|
+
--jini-transition-base: var(--jini-duration-base) var(--jini-ease-out);
|
|
110
|
+
--jini-z-dropdown: 100;
|
|
111
|
+
--jini-z-sticky: 200;
|
|
112
|
+
--jini-z-overlay: 300;
|
|
113
|
+
--jini-z-modal: 400;
|
|
114
|
+
--jini-z-toast: 500;
|
|
115
|
+
--jini-modal-padding: 24px;
|
|
116
|
+
--jini-sidebar-width: 240px;
|
|
117
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AdminTheme, AdminThemeDocument, AdminThemeTarget } from './types.js';
|
|
2
|
+
/** Install both palettes on the injected scope and load fonts. Cleanup restores the host. */
|
|
3
|
+
export declare function applyAdminTheme({ theme }: {
|
|
4
|
+
readonly theme: AdminTheme;
|
|
5
|
+
}, { target, document }: {
|
|
6
|
+
readonly target: AdminThemeTarget;
|
|
7
|
+
readonly document: AdminThemeDocument;
|
|
8
|
+
}): () => void;
|
|
9
|
+
//# sourceMappingURL=apply.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defaultAdminTheme } from './default.js';
|
|
2
|
+
import { adminThemeColorKeys, validateAdminTheme } from './validation.js';
|
|
3
|
+
const fontLeases = new WeakMap();
|
|
4
|
+
function acquireFont(document, href) {
|
|
5
|
+
const leases = fontLeases.get(document) ?? new Map();
|
|
6
|
+
fontLeases.set(document, leases);
|
|
7
|
+
const absolute = new URL(href, document.baseURI).href;
|
|
8
|
+
let lease = leases.get(absolute);
|
|
9
|
+
if (!lease) {
|
|
10
|
+
const existing = Array.from(document.head.querySelectorAll('link[rel="stylesheet"]')).find((link) => link.href === absolute);
|
|
11
|
+
const link = existing ?? document.createElement('link');
|
|
12
|
+
if (!existing) {
|
|
13
|
+
link.rel = 'stylesheet';
|
|
14
|
+
link.href = absolute;
|
|
15
|
+
link.setAttribute('data-jini-theme-font', '');
|
|
16
|
+
document.head.appendChild(link);
|
|
17
|
+
}
|
|
18
|
+
lease = { link, owned: !existing, users: 0 };
|
|
19
|
+
leases.set(absolute, lease);
|
|
20
|
+
}
|
|
21
|
+
const held = lease;
|
|
22
|
+
held.users++;
|
|
23
|
+
return () => { if (--held.users === 0) {
|
|
24
|
+
if (held.owned)
|
|
25
|
+
held.link.remove();
|
|
26
|
+
leases.delete(absolute);
|
|
27
|
+
} };
|
|
28
|
+
}
|
|
29
|
+
/** Install both palettes on the injected scope and load fonts. Cleanup restores the host. */
|
|
30
|
+
export function applyAdminTheme({ theme }, { target, document }) {
|
|
31
|
+
const checked = validateAdminTheme({ theme });
|
|
32
|
+
if (!checked.valid)
|
|
33
|
+
throw new TypeError(checked.errors.join('; '));
|
|
34
|
+
const values = {};
|
|
35
|
+
for (const scheme of ['light', 'dark'])
|
|
36
|
+
for (const key of adminThemeColorKeys) {
|
|
37
|
+
values[`--jini-theme-${scheme}-${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`] = theme[scheme][key];
|
|
38
|
+
}
|
|
39
|
+
values['--jini-font-body'] = theme.fonts.body;
|
|
40
|
+
values['--jini-font-heading'] = theme.fonts.heading;
|
|
41
|
+
values['--jini-font-mono'] = theme.fonts.mono ?? defaultAdminTheme.fonts.mono;
|
|
42
|
+
values['--jini-radius'] = theme.radius ?? defaultAdminTheme.radius;
|
|
43
|
+
values['--jini-density'] = String(theme.density ?? defaultAdminTheme.density);
|
|
44
|
+
const before = Object.keys(values).map((key) => ({ key, value: target.style.getPropertyValue(key), priority: target.style.getPropertyPriority(key) }));
|
|
45
|
+
const previousName = target.getAttribute('data-admin-theme');
|
|
46
|
+
const releases = [];
|
|
47
|
+
const restore = () => {
|
|
48
|
+
for (const { key, value, priority } of before) {
|
|
49
|
+
if (value)
|
|
50
|
+
target.style.setProperty(key, value, priority);
|
|
51
|
+
else
|
|
52
|
+
target.style.removeProperty(key);
|
|
53
|
+
}
|
|
54
|
+
if (previousName === null)
|
|
55
|
+
target.removeAttribute('data-admin-theme');
|
|
56
|
+
else
|
|
57
|
+
target.setAttribute('data-admin-theme', previousName);
|
|
58
|
+
releases.forEach((release) => release());
|
|
59
|
+
};
|
|
60
|
+
try {
|
|
61
|
+
for (const [key, value] of Object.entries(values))
|
|
62
|
+
target.style.setProperty(key, value);
|
|
63
|
+
target.setAttribute('data-admin-theme', theme.name);
|
|
64
|
+
for (const href of new Set(theme.fonts.load ?? []))
|
|
65
|
+
releases.push(acquireFont(document, href));
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
restore();
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
let active = true;
|
|
72
|
+
return () => { if (active) {
|
|
73
|
+
active = false;
|
|
74
|
+
restore();
|
|
75
|
+
} };
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=apply.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ColorScheme, ColorSchemePreference, MatchMediaPort } from './types.js';
|
|
2
|
+
/** Explicit choices are deterministic; system resolution requires the host's media port. */
|
|
3
|
+
export declare function resolveColorScheme({ preference }: {
|
|
4
|
+
readonly preference: ColorSchemePreference;
|
|
5
|
+
}, { matchMedia }?: {
|
|
6
|
+
readonly matchMedia?: MatchMediaPort;
|
|
7
|
+
}): ColorScheme;
|
|
8
|
+
//# sourceMappingURL=color-scheme.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Explicit choices are deterministic; system resolution requires the host's media port. */
|
|
2
|
+
export function resolveColorScheme({ preference }, { matchMedia } = {}) {
|
|
3
|
+
if (preference === 'light' || preference === 'dark')
|
|
4
|
+
return preference;
|
|
5
|
+
if (preference !== 'system' || !matchMedia)
|
|
6
|
+
throw new TypeError('System color scheme requires matchMedia');
|
|
7
|
+
return matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=color-scheme.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Neutral chrome. Products supply their own brand theme instead of forking CSS. */
|
|
2
|
+
export const defaultAdminTheme = Object.freeze({
|
|
3
|
+
name: 'neutral',
|
|
4
|
+
fonts: Object.freeze({ body: 'system-ui, sans-serif', heading: 'system-ui, sans-serif', mono: 'ui-monospace, monospace' }),
|
|
5
|
+
light: Object.freeze({ primary: '#363636', primaryInk: '#ffffff', bg: '#ffffff', surface: '#f5f5f5',
|
|
6
|
+
text: '#202020', muted: '#666666', border: '#d9d9d9', danger: '#b42318', success: '#18763b', warning: '#845800' }),
|
|
7
|
+
dark: Object.freeze({ primary: '#e0e0e0', primaryInk: '#202020', bg: '#171717', surface: '#242424',
|
|
8
|
+
text: '#f0f0f0', muted: '#b3b3b3', border: '#454545', danger: '#ff8b80', success: '#79d69b', warning: '#ebc36b' }),
|
|
9
|
+
radius: '8px', density: 1,
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { AdminTheme, AdminThemeColors, AdminThemeTarget, AdminThemeDocument, ColorScheme, ColorSchemePreference, MatchMediaPort } from './types.js';
|
|
2
|
+
export { defaultAdminTheme } from './default.js';
|
|
3
|
+
export { validateAdminTheme } from './validation.js';
|
|
4
|
+
export { applyAdminTheme } from './apply.js';
|
|
5
|
+
export { resolveColorScheme } from './color-scheme.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AdminTheme, ColorScheme } from './types.js';
|
|
2
|
+
/** Internal document adapter: isolated previews cannot inherit the admin's stylesheet. */
|
|
3
|
+
export declare function renderAdminThemeVariables({ theme }: {
|
|
4
|
+
readonly theme: AdminTheme;
|
|
5
|
+
}, { colorScheme }?: {
|
|
6
|
+
readonly colorScheme?: ColorScheme;
|
|
7
|
+
}): string;
|
|
8
|
+
//# sourceMappingURL=stylesheet.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { adminThemeColorKeys, validateAdminTheme } from './validation.js';
|
|
2
|
+
import { defaultAdminTheme } from './default.js';
|
|
3
|
+
/** Internal document adapter: isolated previews cannot inherit the admin's stylesheet. */
|
|
4
|
+
export function renderAdminThemeVariables({ theme }, { colorScheme = 'light' } = {}) {
|
|
5
|
+
if (colorScheme !== 'light' && colorScheme !== 'dark')
|
|
6
|
+
throw new TypeError('Invalid resolved color scheme');
|
|
7
|
+
const checked = validateAdminTheme({ theme });
|
|
8
|
+
if (!checked.valid)
|
|
9
|
+
throw new TypeError(checked.errors.join('; '));
|
|
10
|
+
const values = adminThemeColorKeys.map((key) => `--jini-${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}:${theme[colorScheme][key]};`);
|
|
11
|
+
values.push(`--jini-font-body:${theme.fonts.body};`, `--jini-font-heading:${theme.fonts.heading};`, `--jini-font-mono:${theme.fonts.mono ?? defaultAdminTheme.fonts.mono};`, `--jini-radius:${theme.radius ?? defaultAdminTheme.radius};`);
|
|
12
|
+
return `:root{color-scheme:${colorScheme};${values.join('')}}`;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=stylesheet.js.map
|