@miragon/mcp-toolkit-ui 2.6.0 → 2.8.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/README.md +14 -5
- package/dist/app/adapt-data-widget.d.ts +1 -22
- package/dist/app/adapt-data-widget.d.ts.map +1 -1
- package/dist/app/adapt-data-widget.js +1 -35
- package/dist/app/adapt-data-widget.js.map +1 -1
- package/dist/app/builder/BuilderBanners.d.ts +7 -2
- package/dist/app/builder/BuilderBanners.d.ts.map +1 -1
- package/dist/app/builder/BuilderBanners.js +8 -3
- package/dist/app/builder/BuilderBanners.js.map +1 -1
- package/dist/app/builder/CanvasRow.d.ts +4 -2
- package/dist/app/builder/CanvasRow.d.ts.map +1 -1
- package/dist/app/builder/CanvasRow.js +29 -17
- package/dist/app/builder/CanvasRow.js.map +1 -1
- package/dist/app/builder/CatalogueSheet.d.ts.map +1 -1
- package/dist/app/builder/CatalogueSheet.js +14 -6
- package/dist/app/builder/CatalogueSheet.js.map +1 -1
- package/dist/app/builder/CellPropsSheet.d.ts +7 -3
- package/dist/app/builder/CellPropsSheet.d.ts.map +1 -1
- package/dist/app/builder/CellPropsSheet.js +10 -3
- package/dist/app/builder/CellPropsSheet.js.map +1 -1
- package/dist/app/builder/DiscardDialog.d.ts +18 -0
- package/dist/app/builder/DiscardDialog.d.ts.map +1 -0
- package/dist/app/builder/DiscardDialog.js +18 -0
- package/dist/app/builder/DiscardDialog.js.map +1 -0
- package/dist/app/builder/EmptyHint.d.ts +4 -0
- package/dist/app/builder/EmptyHint.d.ts.map +1 -1
- package/dist/app/builder/EmptyHint.js +6 -1
- package/dist/app/builder/EmptyHint.js.map +1 -1
- package/dist/app/builder/LayoutSurface.d.ts +33 -9
- package/dist/app/builder/LayoutSurface.d.ts.map +1 -1
- package/dist/app/builder/LayoutSurface.js +74 -23
- package/dist/app/builder/LayoutSurface.js.map +1 -1
- package/dist/app/builder/PipelineStrip.d.ts +5 -2
- package/dist/app/builder/PipelineStrip.d.ts.map +1 -1
- package/dist/app/builder/PipelineStrip.js +33 -15
- package/dist/app/builder/PipelineStrip.js.map +1 -1
- package/dist/app/builder/SaveDialog.d.ts +9 -1
- package/dist/app/builder/SaveDialog.d.ts.map +1 -1
- package/dist/app/builder/SaveDialog.js +9 -3
- package/dist/app/builder/SaveDialog.js.map +1 -1
- package/dist/app/builder/Toolbar.d.ts +14 -4
- package/dist/app/builder/Toolbar.d.ts.map +1 -1
- package/dist/app/builder/Toolbar.js +24 -7
- package/dist/app/builder/Toolbar.js.map +1 -1
- package/dist/app/builder/Workspace.d.ts +23 -3
- package/dist/app/builder/Workspace.d.ts.map +1 -1
- package/dist/app/builder/Workspace.js +58 -8
- package/dist/app/builder/Workspace.js.map +1 -1
- package/dist/app/builder/builder-model.d.ts +146 -3
- package/dist/app/builder/builder-model.d.ts.map +1 -1
- package/dist/app/builder/builder-model.js +196 -5
- package/dist/app/builder/builder-model.js.map +1 -1
- package/dist/app/builder/labels.d.ts +13 -62
- package/dist/app/builder/labels.d.ts.map +1 -1
- package/dist/app/builder/labels.js +9 -58
- package/dist/app/builder/labels.js.map +1 -1
- package/dist/app/builder/reveal.d.ts +10 -0
- package/dist/app/builder/reveal.d.ts.map +1 -0
- package/dist/app/builder/reveal.js +10 -0
- package/dist/app/builder/reveal.js.map +1 -0
- package/dist/app/builder/status-chip.d.ts.map +1 -1
- package/dist/app/builder/status-chip.js +3 -2
- package/dist/app/builder/status-chip.js.map +1 -1
- package/dist/app/builder/use-builder-catalogue.d.ts +5 -1
- package/dist/app/builder/use-builder-catalogue.d.ts.map +1 -1
- package/dist/app/builder/use-builder-catalogue.js +50 -17
- package/dist/app/builder/use-builder-catalogue.js.map +1 -1
- package/dist/app/builder/use-builder-session.d.ts +30 -0
- package/dist/app/builder/use-builder-session.d.ts.map +1 -0
- package/dist/app/builder/use-builder-session.js +58 -0
- package/dist/app/builder/use-builder-session.js.map +1 -0
- package/dist/app/builder/use-display-resolver.d.ts +17 -0
- package/dist/app/builder/use-display-resolver.d.ts.map +1 -0
- package/dist/app/builder/use-display-resolver.js +16 -0
- package/dist/app/builder/use-display-resolver.js.map +1 -0
- package/dist/app/builder/use-save-dashboard.d.ts +3 -1
- package/dist/app/builder/use-save-dashboard.d.ts.map +1 -1
- package/dist/app/builder/use-save-dashboard.js +3 -1
- package/dist/app/builder/use-save-dashboard.js.map +1 -1
- package/dist/app/index.d.ts +8 -3
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +8 -2
- package/dist/app/index.js.map +1 -1
- package/dist/app/layout-builder.d.ts +18 -25
- package/dist/app/layout-builder.d.ts.map +1 -1
- package/dist/app/layout-builder.js +84 -78
- package/dist/app/layout-builder.js.map +1 -1
- package/dist/app/mcp-app-view-chrome.d.ts +103 -20
- package/dist/app/mcp-app-view-chrome.d.ts.map +1 -1
- package/dist/app/mcp-app-view-chrome.js +125 -40
- package/dist/app/mcp-app-view-chrome.js.map +1 -1
- package/dist/app/mcp-app-view-states.d.ts +23 -0
- package/dist/app/mcp-app-view-states.d.ts.map +1 -0
- package/dist/app/mcp-app-view-states.js +55 -0
- package/dist/app/mcp-app-view-states.js.map +1 -0
- package/dist/app/mcp-app-view.d.ts +72 -5
- package/dist/app/mcp-app-view.d.ts.map +1 -1
- package/dist/app/mcp-app-view.js +241 -141
- package/dist/app/mcp-app-view.js.map +1 -1
- package/dist/app/mcp-toolkit-app.d.ts +8 -2
- package/dist/app/mcp-toolkit-app.d.ts.map +1 -1
- package/dist/app/mcp-toolkit-app.js +33 -4
- package/dist/app/mcp-toolkit-app.js.map +1 -1
- package/dist/app/mcp-use-host-bridge.d.ts +15 -6
- package/dist/app/mcp-use-host-bridge.d.ts.map +1 -1
- package/dist/app/mcp-use-host-bridge.js +51 -22
- package/dist/app/mcp-use-host-bridge.js.map +1 -1
- package/dist/app/model-context.d.ts +71 -0
- package/dist/app/model-context.d.ts.map +1 -0
- package/dist/app/model-context.js +101 -0
- package/dist/app/model-context.js.map +1 -0
- package/dist/app/use-build-mode-focus.d.ts +33 -0
- package/dist/app/use-build-mode-focus.d.ts.map +1 -0
- package/dist/app/use-build-mode-focus.js +59 -0
- package/dist/app/use-build-mode-focus.js.map +1 -0
- package/dist/app/use-view-actions.d.ts +31 -0
- package/dist/app/use-view-actions.d.ts.map +1 -0
- package/dist/app/use-view-actions.js +81 -0
- package/dist/app/use-view-actions.js.map +1 -0
- package/dist/app/use-view-lifecycle.d.ts +42 -0
- package/dist/app/use-view-lifecycle.d.ts.map +1 -0
- package/dist/app/use-view-lifecycle.js +81 -0
- package/dist/app/use-view-lifecycle.js.map +1 -0
- package/dist/app/view-lifecycle.d.ts +185 -0
- package/dist/app/view-lifecycle.d.ts.map +1 -0
- package/dist/app/view-lifecycle.js +207 -0
- package/dist/app/view-lifecycle.js.map +1 -0
- package/dist/app/widget-fixture.d.ts +10 -3
- package/dist/app/widget-fixture.d.ts.map +1 -1
- package/dist/app/widget-fixture.js +21 -8
- package/dist/app/widget-fixture.js.map +1 -1
- package/dist/app/widget-props-sheet.d.ts +6 -10
- package/dist/app/widget-props-sheet.d.ts.map +1 -1
- package/dist/app/widget-props-sheet.js +25 -20
- package/dist/app/widget-props-sheet.js.map +1 -1
- package/dist/app/widget-renderer.d.ts +41 -1
- package/dist/app/widget-renderer.d.ts.map +1 -1
- package/dist/app/widget-renderer.js +82 -31
- package/dist/app/widget-renderer.js.map +1 -1
- package/dist/components/DrillButton.d.ts +9 -6
- package/dist/components/DrillButton.d.ts.map +1 -1
- package/dist/components/DrillButton.js +9 -6
- package/dist/components/DrillButton.js.map +1 -1
- package/dist/components/EmptyState.d.ts +33 -0
- package/dist/components/EmptyState.d.ts.map +1 -0
- package/dist/components/EmptyState.js +19 -0
- package/dist/components/EmptyState.js.map +1 -0
- package/dist/components/ErrorState.d.ts +53 -0
- package/dist/components/ErrorState.d.ts.map +1 -0
- package/dist/components/ErrorState.js +77 -0
- package/dist/components/ErrorState.js.map +1 -0
- package/dist/components/FilterBar.d.ts +16 -5
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +13 -5
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/GroupCard.d.ts.map +1 -1
- package/dist/components/GroupCard.js +2 -1
- package/dist/components/GroupCard.js.map +1 -1
- package/dist/components/KpiGrid.d.ts +70 -18
- package/dist/components/KpiGrid.d.ts.map +1 -1
- package/dist/components/KpiGrid.js +112 -23
- package/dist/components/KpiGrid.js.map +1 -1
- package/dist/components/ListFooter.d.ts +32 -4
- package/dist/components/ListFooter.d.ts.map +1 -1
- package/dist/components/ListFooter.js +35 -6
- package/dist/components/ListFooter.js.map +1 -1
- package/dist/components/PagedListFooter.d.ts +57 -0
- package/dist/components/PagedListFooter.d.ts.map +1 -0
- package/dist/components/PagedListFooter.js +27 -0
- package/dist/components/PagedListFooter.js.map +1 -0
- package/dist/components/Pills.d.ts +36 -12
- package/dist/components/Pills.d.ts.map +1 -1
- package/dist/components/Pills.js +29 -8
- package/dist/components/Pills.js.map +1 -1
- package/dist/components/SectionHeading.d.ts +3 -1
- package/dist/components/SectionHeading.d.ts.map +1 -1
- package/dist/components/SectionHeading.js +6 -2
- package/dist/components/SectionHeading.js.map +1 -1
- package/dist/components/Toast.d.ts +43 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +106 -0
- package/dist/components/Toast.js.map +1 -0
- package/dist/components/WidgetHeader.d.ts +34 -10
- package/dist/components/WidgetHeader.d.ts.map +1 -1
- package/dist/components/WidgetHeader.js +11 -6
- package/dist/components/WidgetHeader.js.map +1 -1
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/tool-result-recovery-model.d.ts +155 -0
- package/dist/hooks/tool-result-recovery-model.d.ts.map +1 -0
- package/dist/hooks/tool-result-recovery-model.js +273 -0
- package/dist/hooks/tool-result-recovery-model.js.map +1 -0
- package/dist/hooks/use-tool-query.d.ts +56 -14
- package/dist/hooks/use-tool-query.d.ts.map +1 -1
- package/dist/hooks/use-tool-query.js +102 -25
- package/dist/hooks/use-tool-query.js.map +1 -1
- package/dist/hooks/use-tool-result-recovery.d.ts +61 -44
- package/dist/hooks/use-tool-result-recovery.d.ts.map +1 -1
- package/dist/hooks/use-tool-result-recovery.js +62 -110
- package/dist/hooks/use-tool-result-recovery.js.map +1 -1
- package/dist/hooks/use-view-data.d.ts +55 -7
- package/dist/hooks/use-view-data.d.ts.map +1 -1
- package/dist/hooks/use-view-data.js +81 -11
- package/dist/hooks/use-view-data.js.map +1 -1
- package/dist/hooks/use-view-tool-query.d.ts +12 -7
- package/dist/hooks/use-view-tool-query.d.ts.map +1 -1
- package/dist/hooks/use-view-tool-query.js +15 -14
- package/dist/hooks/use-view-tool-query.js.map +1 -1
- package/dist/index.d.ts +27 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/focus-return.d.ts +61 -0
- package/dist/lib/focus-return.d.ts.map +1 -0
- package/dist/lib/focus-return.js +46 -0
- package/dist/lib/focus-return.js.map +1 -0
- package/dist/lib/focus-ring.d.ts +18 -0
- package/dist/lib/focus-ring.d.ts.map +1 -0
- package/dist/lib/focus-ring.js +18 -0
- package/dist/lib/focus-ring.js.map +1 -0
- package/dist/lib/icon-stroke.d.ts +12 -0
- package/dist/lib/icon-stroke.d.ts.map +1 -0
- package/dist/lib/icon-stroke.js +12 -0
- package/dist/lib/icon-stroke.js.map +1 -0
- package/dist/lib/parse-tool-result.d.ts +23 -1
- package/dist/lib/parse-tool-result.d.ts.map +1 -1
- package/dist/lib/parse-tool-result.js +38 -2
- package/dist/lib/parse-tool-result.js.map +1 -1
- package/dist/lib/toast-model.d.ts +86 -0
- package/dist/lib/toast-model.d.ts.map +1 -0
- package/dist/lib/toast-model.js +102 -0
- package/dist/lib/toast-model.js.map +1 -0
- package/dist/lib/tone-utils.d.ts +95 -9
- package/dist/lib/tone-utils.d.ts.map +1 -1
- package/dist/lib/tone-utils.js +100 -9
- package/dist/lib/tone-utils.js.map +1 -1
- package/dist/lib/tool-query.d.ts +107 -0
- package/dist/lib/tool-query.d.ts.map +1 -0
- package/dist/lib/tool-query.js +182 -0
- package/dist/lib/tool-query.js.map +1 -0
- package/dist/lib/tool-result-observer.d.ts +108 -0
- package/dist/lib/tool-result-observer.d.ts.map +1 -0
- package/dist/lib/tool-result-observer.js +158 -0
- package/dist/lib/tool-result-observer.js.map +1 -0
- package/dist/lib/typography.d.ts +37 -0
- package/dist/lib/typography.d.ts.map +1 -0
- package/dist/lib/typography.js +41 -0
- package/dist/lib/typography.js.map +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +11 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/locale/index.d.ts +3 -1
- package/dist/locale/index.d.ts.map +1 -1
- package/dist/locale/index.js +2 -1
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/locale-provider.d.ts +42 -1
- package/dist/locale/locale-provider.d.ts.map +1 -1
- package/dist/locale/locale-provider.js +44 -3
- package/dist/locale/locale-provider.js.map +1 -1
- package/dist/locale/message-types.d.ts +336 -0
- package/dist/locale/message-types.d.ts.map +1 -0
- package/dist/locale/message-types.js +7 -0
- package/dist/locale/message-types.js.map +1 -0
- package/dist/locale/messages-de.d.ts +9 -0
- package/dist/locale/messages-de.d.ts.map +1 -0
- package/dist/locale/messages-de.js +185 -0
- package/dist/locale/messages-de.js.map +1 -0
- package/dist/locale/messages-en.d.ts +8 -0
- package/dist/locale/messages-en.d.ts.map +1 -0
- package/dist/locale/messages-en.js +184 -0
- package/dist/locale/messages-en.js.map +1 -0
- package/dist/locale/toolkit-messages.d.ts +57 -0
- package/dist/locale/toolkit-messages.d.ts.map +1 -0
- package/dist/locale/toolkit-messages.js +103 -0
- package/dist/locale/toolkit-messages.js.map +1 -0
- package/dist/primitives/alert.d.ts +1 -1
- package/dist/primitives/alert.d.ts.map +1 -1
- package/dist/primitives/alert.js +6 -2
- package/dist/primitives/alert.js.map +1 -1
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/badge.d.ts.map +1 -1
- package/dist/primitives/badge.js +19 -6
- package/dist/primitives/badge.js.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.d.ts.map +1 -1
- package/dist/primitives/button.js +12 -8
- package/dist/primitives/button.js.map +1 -1
- package/dist/primitives/card.js +4 -4
- package/dist/primitives/card.js.map +1 -1
- package/dist/primitives/dialog.d.ts +7 -3
- package/dist/primitives/dialog.d.ts.map +1 -1
- package/dist/primitives/dialog.js +22 -8
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/input.d.ts.map +1 -1
- package/dist/primitives/input.js +4 -1
- package/dist/primitives/input.js.map +1 -1
- package/dist/primitives/scroll-area.js +1 -1
- package/dist/primitives/scroll-area.js.map +1 -1
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +6 -3
- package/dist/primitives/select.js.map +1 -1
- package/dist/primitives/sheet.d.ts +3 -1
- package/dist/primitives/sheet.d.ts.map +1 -1
- package/dist/primitives/sheet.js +17 -7
- package/dist/primitives/sheet.js.map +1 -1
- package/dist/primitives/skeleton.js +1 -1
- package/dist/primitives/skeleton.js.map +1 -1
- package/dist/primitives/switch.d.ts.map +1 -1
- package/dist/primitives/switch.js +2 -1
- package/dist/primitives/switch.js.map +1 -1
- package/dist/primitives/tabs.d.ts.map +1 -1
- package/dist/primitives/tabs.js +5 -3
- package/dist/primitives/tabs.js.map +1 -1
- package/dist/providers/query-provider.d.ts +32 -1
- package/dist/providers/query-provider.d.ts.map +1 -1
- package/dist/providers/query-provider.js +53 -4
- package/dist/providers/query-provider.js.map +1 -1
- package/dist/render-cases-primitives.js +1 -1
- package/dist/render-cases-primitives.js.map +1 -1
- package/dist/render-cases.d.ts.map +1 -1
- package/dist/render-cases.js +48 -6
- package/dist/render-cases.js.map +1 -1
- package/dist/render-effects.d.ts +42 -0
- package/dist/render-effects.d.ts.map +1 -0
- package/dist/render-effects.js +81 -0
- package/dist/render-effects.js.map +1 -0
- package/dist/render-scan.d.ts +25 -0
- package/dist/render-scan.d.ts.map +1 -0
- package/dist/render-scan.js +66 -0
- package/dist/render-scan.js.map +1 -0
- package/dist/theme/cd-tokens.d.ts +66 -0
- package/dist/theme/cd-tokens.d.ts.map +1 -0
- package/dist/theme/cd-tokens.js +64 -0
- package/dist/theme/cd-tokens.js.map +1 -0
- package/dist/theme/create-theme.d.ts +214 -39
- package/dist/theme/create-theme.d.ts.map +1 -1
- package/dist/theme/create-theme.js +204 -13
- package/dist/theme/create-theme.js.map +1 -1
- package/dist/theme/fonts.d.ts +38 -0
- package/dist/theme/fonts.d.ts.map +1 -0
- package/dist/theme/fonts.js +56 -0
- package/dist/theme/fonts.js.map +1 -0
- package/dist/theme/host-fonts.d.ts +39 -0
- package/dist/theme/host-fonts.d.ts.map +1 -0
- package/dist/theme/host-fonts.js +44 -0
- package/dist/theme/host-fonts.js.map +1 -0
- package/dist/theme/index.d.ts +8 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +5 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/portal-container.d.ts +16 -0
- package/dist/theme/portal-container.d.ts.map +1 -0
- package/dist/theme/portal-container.js +19 -0
- package/dist/theme/portal-container.js.map +1 -0
- package/dist/theme/presets.d.ts +24 -9
- package/dist/theme/presets.d.ts.map +1 -1
- package/dist/theme/presets.js +44 -11
- package/dist/theme/presets.js.map +1 -1
- package/dist/theme/theme-provider.d.ts +27 -9
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/theme/theme-provider.js +42 -20
- package/dist/theme/theme-provider.js.map +1 -1
- package/package.json +11 -5
- package/src/app/adapt-data-widget.tsx +2 -42
- package/src/app/builder/BuilderBanners.tsx +26 -13
- package/src/app/builder/CanvasRow.tsx +79 -32
- package/src/app/builder/CatalogueSheet.tsx +58 -35
- package/src/app/builder/CellPropsSheet.tsx +17 -2
- package/src/app/builder/DiscardDialog.tsx +59 -0
- package/src/app/builder/EmptyHint.tsx +16 -11
- package/src/app/builder/LayoutSurface.tsx +207 -67
- package/src/app/builder/PipelineStrip.tsx +265 -156
- package/src/app/builder/SaveDialog.tsx +25 -14
- package/src/app/builder/Toolbar.tsx +154 -57
- package/src/app/builder/Workspace.tsx +226 -56
- package/src/app/builder/builder-feedback.test.tsx +75 -0
- package/src/app/builder/builder-model.test.ts +5 -0
- package/src/app/builder/builder-model.ts +346 -6
- package/src/app/builder/builder-model.ux.test.ts +456 -0
- package/src/app/builder/builder-ux.test.tsx +844 -0
- package/src/app/builder/labels.ts +15 -121
- package/src/app/builder/reveal.ts +10 -0
- package/src/app/builder/status-chip.tsx +8 -4
- package/src/app/builder/use-builder-catalogue.ts +62 -19
- package/src/app/builder/use-builder-session.ts +68 -0
- package/src/app/builder/use-display-resolver.ts +24 -0
- package/src/app/builder/use-save-dashboard.ts +5 -0
- package/src/app/index.ts +20 -3
- package/src/app/layout-builder.tsx +193 -186
- package/src/app/mcp-app-view-chrome.test.tsx +487 -14
- package/src/app/mcp-app-view-chrome.tsx +328 -100
- package/src/app/mcp-app-view-states.tsx +140 -0
- package/src/app/mcp-app-view.effects.test.tsx +292 -0
- package/src/app/mcp-app-view.test.tsx +478 -0
- package/src/app/mcp-app-view.tsx +447 -190
- package/src/app/mcp-toolkit-app.test.tsx +40 -0
- package/src/app/mcp-toolkit-app.tsx +39 -8
- package/src/app/mcp-use-host-bridge.test.tsx +180 -0
- package/src/app/mcp-use-host-bridge.tsx +67 -24
- package/src/app/model-context.test.tsx +116 -0
- package/src/app/model-context.tsx +125 -0
- package/src/app/use-build-mode-focus.ts +62 -0
- package/src/app/use-view-actions.ts +89 -0
- package/src/app/use-view-lifecycle.ts +122 -0
- package/src/app/view-lifecycle.test.ts +443 -0
- package/src/app/view-lifecycle.ts +334 -0
- package/src/app/widget-fixture.effects.test.tsx +51 -0
- package/src/app/widget-fixture.render.test.tsx +81 -0
- package/src/app/widget-fixture.tsx +34 -11
- package/src/app/widget-props-sheet.tsx +67 -39
- package/src/app/widget-renderer.render.test.tsx +131 -0
- package/src/app/widget-renderer.tsx +136 -38
- package/src/components/DrillButton.tsx +24 -10
- package/src/components/EmptyState.tsx +83 -0
- package/src/components/ErrorState.tsx +204 -0
- package/src/components/FilterBar.test.tsx +82 -0
- package/src/components/FilterBar.tsx +56 -27
- package/src/components/GroupCard.tsx +3 -2
- package/src/components/KpiGrid.test.tsx +279 -0
- package/src/components/KpiGrid.tsx +329 -91
- package/src/components/ListFooter.test.tsx +116 -0
- package/src/components/ListFooter.tsx +110 -12
- package/src/components/PagedListFooter.test.tsx +140 -0
- package/src/components/PagedListFooter.tsx +107 -0
- package/src/components/Pills.test.tsx +77 -0
- package/src/components/Pills.tsx +78 -16
- package/src/components/SectionHeading.tsx +9 -3
- package/src/components/Toast.tsx +206 -0
- package/src/components/WidgetHeader.test.tsx +78 -0
- package/src/components/WidgetHeader.tsx +63 -16
- package/src/components/feedback-states.test.tsx +314 -0
- package/src/components/tone-figures.test.tsx +58 -0
- package/src/fonts.css +19 -0
- package/src/globals.css +9 -165
- package/src/hooks/index.ts +6 -3
- package/src/hooks/tool-result-recovery-model.test.ts +744 -0
- package/src/hooks/tool-result-recovery-model.ts +418 -0
- package/src/hooks/use-tool-query.effects.test.tsx +205 -0
- package/src/hooks/use-tool-query.ts +156 -33
- package/src/hooks/use-tool-result-recovery.effects.test.tsx +141 -0
- package/src/hooks/use-tool-result-recovery.test.ts +28 -5
- package/src/hooks/use-tool-result-recovery.ts +101 -131
- package/src/hooks/use-view-data.test.tsx +169 -0
- package/src/hooks/use-view-data.ts +131 -10
- package/src/hooks/use-view-tool-query.ts +25 -19
- package/src/i18n-coverage.test.tsx +425 -0
- package/src/index.ts +102 -13
- package/src/lib/focus-return.test.ts +288 -0
- package/src/lib/focus-return.ts +96 -0
- package/src/lib/focus-ring.ts +20 -0
- package/src/lib/icon-stroke.test.ts +59 -0
- package/src/lib/icon-stroke.ts +13 -0
- package/src/lib/parse-tool-result.test.ts +46 -1
- package/src/lib/parse-tool-result.ts +40 -2
- package/src/lib/toast-model.test.ts +233 -0
- package/src/lib/toast-model.ts +165 -0
- package/src/lib/tone-utils.test.ts +125 -16
- package/src/lib/tone-utils.ts +144 -15
- package/src/lib/tool-query.test.ts +569 -0
- package/src/lib/tool-query.ts +253 -0
- package/src/lib/tool-result-observer.test.ts +296 -0
- package/src/lib/tool-result-observer.ts +211 -0
- package/src/lib/typography.test.ts +45 -0
- package/src/lib/typography.ts +47 -0
- package/src/lib/utils.ts +12 -1
- package/src/locale/index.ts +14 -1
- package/src/locale/locale-provider.test.tsx +87 -0
- package/src/locale/locale-provider.tsx +90 -3
- package/src/locale/message-types.ts +337 -0
- package/src/locale/messages-de.ts +198 -0
- package/src/locale/messages-en.ts +196 -0
- package/src/locale/toolkit-messages.test.ts +349 -0
- package/src/locale/toolkit-messages.ts +143 -0
- package/src/no-hardcoded-copy.test.ts +432 -0
- package/src/primitives/alert.tsx +7 -2
- package/src/primitives/badge.tsx +19 -7
- package/src/primitives/button.tsx +13 -8
- package/src/primitives/card.tsx +4 -4
- package/src/primitives/dialog.tsx +42 -8
- package/src/primitives/input.tsx +5 -3
- package/src/primitives/scroll-area.tsx +1 -1
- package/src/primitives/select.tsx +7 -4
- package/src/primitives/sheet.tsx +33 -6
- package/src/primitives/skeleton.tsx +1 -1
- package/src/primitives/switch.tsx +4 -2
- package/src/primitives/tabs.tsx +9 -6
- package/src/providers/query-provider.test.tsx +154 -0
- package/src/providers/query-provider.tsx +66 -5
- package/src/render-cases-primitives.tsx +1 -1
- package/src/render-cases.tsx +82 -6
- package/src/render-effects.tsx +96 -0
- package/src/render-scan.ts +75 -0
- package/src/theme/cd-tokens.generated.css +48 -0
- package/src/theme/cd-tokens.test.ts +109 -0
- package/src/theme/cd-tokens.ts +67 -0
- package/src/theme/create-theme.test.ts +253 -5
- package/src/theme/create-theme.ts +341 -41
- package/src/theme/fonts.test.ts +85 -0
- package/src/theme/fonts.ts +72 -0
- package/src/theme/host-fonts.test.ts +135 -0
- package/src/theme/host-fonts.ts +52 -0
- package/src/theme/index.ts +15 -1
- package/src/theme/portal-container.ts +20 -0
- package/src/theme/presets.ts +44 -11
- package/src/theme/theme-css.test.ts +619 -0
- package/src/theme/theme-provider.test.tsx +82 -0
- package/src/theme/theme-provider.tsx +60 -24
- package/src/theme.css +344 -0
- package/ui-catalog.json +783 -49
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/primitives/tabs.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,UAAU,CAAA;AAEhD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC,SAAS,IAAI,CAAC,EACZ,SAAS,EACT,WAAW,GAAG,YAAY,EAC1B,GAAG,KAAK,EACwC;IAChD,OAAO,CACL,KAAC,aAAa,CAAC,IAAI,iBACP,MAAM,sBACE,WAAW,EAC7B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CAAC,8DAA8D,EAAE,SAAS,CAAC,KACpF,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,gBAAgB,GAAG,GAAG,CAC1B,mRAAmR,EACnR;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,UAAU;YACnB,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CACF,CAAA;AAED,SAAS,QAAQ,CAAC,EAChB,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,GAAG,KAAK,EACgF;IACxF,OAAO,CACL,KAAC,aAAa,CAAC,IAAI,iBACP,WAAW,kBACP,OAAO,EACrB,SAAS,EAAE,EAAE,CAAC,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,EAAE,CAAC,EAAE,SAAS,CAAC,KACnD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAsD;IAC9F,OAAO,CACL,KAAC,aAAa,CAAC,OAAO,iBACV,cAAc,EACxB,SAAS,EAAE,EAAE,CACX,klBAAklB,EACllB,UAAU,EACV,sMAAsM,EACtM,yGAAyG,EACzG,+dAA+d,EAC/d,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAsD;IAC9F,8EAA8E;IAC9E,OAAO,CACL,KAAC,aAAa,CAAC,OAAO,iBACV,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -2,10 +2,41 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import { QueryClient } from "@tanstack/react-query";
|
|
3
3
|
type CallToolFn = (name: string, args: object) => Promise<unknown>;
|
|
4
4
|
declare const queryClient: QueryClient;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The query client and tool transport of the toolkit's data hooks.
|
|
7
|
+
*
|
|
8
|
+
* `callTool` is how `useToolQuery` & co. reach the server; without it they
|
|
9
|
+
* fall back to the nearest `HostBridgeProvider`'s bridge (toolkit#176 N25).
|
|
10
|
+
* `client` replaces the shared module-level client, e.g. one per mount;
|
|
11
|
+
* omitted, a nested provider keeps its parent's client (as `McpAppView`'s
|
|
12
|
+
* own provider does), and the outermost one shares the toolkit's client
|
|
13
|
+
* (`queryClient`). `toolNameInQueryKey` puts the tool name into the hooks'
|
|
14
|
+
* cache keys (`[...queryKey, toolName, args]`, see `toolQueryKey`), so two
|
|
15
|
+
* tools never share an entry; omitted, a nested provider keeps its parent's
|
|
16
|
+
* setting, and the outermost one uses the 2.x key `[...queryKey, args]`. The
|
|
17
|
+
* next major makes the tool name the default.
|
|
18
|
+
*/
|
|
19
|
+
export declare function AppQueryProvider({ children, callTool, client, toolNameInQueryKey, }: {
|
|
6
20
|
children: ReactNode;
|
|
7
21
|
callTool?: CallToolFn;
|
|
22
|
+
client?: QueryClient;
|
|
23
|
+
toolNameInQueryKey?: boolean;
|
|
8
24
|
}): import("react").JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* The client an `AppQueryProvider` without `client` uses at this point: the
|
|
27
|
+
* nearest `AppQueryProvider`'s, else the toolkit's shared `queryClient`. A
|
|
28
|
+
* plain TanStack `QueryClientProvider` does not count.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useAppQueryClient(): QueryClient;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the nearest `AppQueryProvider` puts the tool name into the data
|
|
33
|
+
* hooks' cache keys (`toolNameInQueryKey`); `false` outside one.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useToolNameInQueryKey(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The tool transport of the data hooks: `AppQueryProvider`'s `callTool`,
|
|
38
|
+
* else the nearest `HostBridgeProvider`'s `callTool`, else `undefined`.
|
|
39
|
+
*/
|
|
9
40
|
export declare function useCallTool(): CallToolFn | undefined;
|
|
10
41
|
export { queryClient };
|
|
11
42
|
//# sourceMappingURL=query-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-provider.d.ts","sourceRoot":"","sources":["../../src/providers/query-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"query-provider.d.ts","sourceRoot":"","sources":["../../src/providers/query-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAA;AAMxE,KAAK,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAOlE,QAAA,MAAM,WAAW,aAOf,CAAA;AAKF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,kBAAkB,GACnB,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,+BAeA;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAE/C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,UAAU,GAAG,SAAS,CAQpD;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext } from "react";
|
|
2
|
+
import { createContext, useContext, useMemo } from "react";
|
|
3
3
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
+
import { useHostBridgeOrNull } from "../app/host-bridge.js";
|
|
4
5
|
const CallToolContext = createContext(undefined);
|
|
6
|
+
/** Whether the data hooks put the tool name into their cache keys (`toolQueryKey`). */
|
|
7
|
+
const ToolNameInQueryKeyContext = createContext(false);
|
|
5
8
|
const queryClient = new QueryClient({
|
|
6
9
|
defaultOptions: {
|
|
7
10
|
queries: {
|
|
@@ -10,11 +13,57 @@ const queryClient = new QueryClient({
|
|
|
10
13
|
},
|
|
11
14
|
},
|
|
12
15
|
});
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
/** The client of the nearest `AppQueryProvider`, which a nested one without `client` keeps. */
|
|
17
|
+
const AppQueryClientContext = createContext(queryClient);
|
|
18
|
+
/**
|
|
19
|
+
* The query client and tool transport of the toolkit's data hooks.
|
|
20
|
+
*
|
|
21
|
+
* `callTool` is how `useToolQuery` & co. reach the server; without it they
|
|
22
|
+
* fall back to the nearest `HostBridgeProvider`'s bridge (toolkit#176 N25).
|
|
23
|
+
* `client` replaces the shared module-level client, e.g. one per mount;
|
|
24
|
+
* omitted, a nested provider keeps its parent's client (as `McpAppView`'s
|
|
25
|
+
* own provider does), and the outermost one shares the toolkit's client
|
|
26
|
+
* (`queryClient`). `toolNameInQueryKey` puts the tool name into the hooks'
|
|
27
|
+
* cache keys (`[...queryKey, toolName, args]`, see `toolQueryKey`), so two
|
|
28
|
+
* tools never share an entry; omitted, a nested provider keeps its parent's
|
|
29
|
+
* setting, and the outermost one uses the 2.x key `[...queryKey, args]`. The
|
|
30
|
+
* next major makes the tool name the default.
|
|
31
|
+
*/
|
|
32
|
+
export function AppQueryProvider({ children, callTool, client, toolNameInQueryKey, }) {
|
|
33
|
+
const inheritedClient = useAppQueryClient();
|
|
34
|
+
const inherited = useContext(ToolNameInQueryKeyContext);
|
|
35
|
+
const effective = client ?? inheritedClient;
|
|
36
|
+
return (_jsx(AppQueryClientContext.Provider, { value: effective, children: _jsx(QueryClientProvider, { client: effective, children: _jsx(CallToolContext.Provider, { value: callTool, children: _jsx(ToolNameInQueryKeyContext.Provider, { value: toolNameInQueryKey ?? inherited, children: children }) }) }) }));
|
|
15
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The client an `AppQueryProvider` without `client` uses at this point: the
|
|
40
|
+
* nearest `AppQueryProvider`'s, else the toolkit's shared `queryClient`. A
|
|
41
|
+
* plain TanStack `QueryClientProvider` does not count.
|
|
42
|
+
*/
|
|
43
|
+
export function useAppQueryClient() {
|
|
44
|
+
return useContext(AppQueryClientContext);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Whether the nearest `AppQueryProvider` puts the tool name into the data
|
|
48
|
+
* hooks' cache keys (`toolNameInQueryKey`); `false` outside one.
|
|
49
|
+
*/
|
|
50
|
+
export function useToolNameInQueryKey() {
|
|
51
|
+
return useContext(ToolNameInQueryKeyContext);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The tool transport of the data hooks: `AppQueryProvider`'s `callTool`,
|
|
55
|
+
* else the nearest `HostBridgeProvider`'s `callTool`, else `undefined`.
|
|
56
|
+
*/
|
|
16
57
|
export function useCallTool() {
|
|
17
|
-
|
|
58
|
+
const explicit = useContext(CallToolContext);
|
|
59
|
+
const bridge = useHostBridgeOrNull();
|
|
60
|
+
return useMemo(() => {
|
|
61
|
+
if (explicit)
|
|
62
|
+
return explicit;
|
|
63
|
+
if (!bridge)
|
|
64
|
+
return undefined;
|
|
65
|
+
return (name, args) => bridge.callTool(name, args);
|
|
66
|
+
}, [explicit, bridge]);
|
|
18
67
|
}
|
|
19
68
|
export { queryClient };
|
|
20
69
|
//# sourceMappingURL=query-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-provider.js","sourceRoot":"","sources":["../../src/providers/query-provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"query-provider.js","sourceRoot":"","sources":["../../src/providers/query-provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAO3D,MAAM,eAAe,GAAG,aAAa,CAAyB,SAAS,CAAC,CAAA;AAExE,uFAAuF;AACvF,MAAM,yBAAyB,GAAG,aAAa,CAAC,KAAK,CAAC,CAAA;AAEtD,MAAM,WAAW,GAAG,IAAI,WAAW,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AAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,IAA+B,CAAC,CAAA;IAC/E,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA;AACxB,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -67,7 +67,7 @@ export const PRIMITIVE_RENDER_CASES = [
|
|
|
67
67
|
{
|
|
68
68
|
name: "Alert",
|
|
69
69
|
marker: "RC:Alert",
|
|
70
|
-
render: () => (_jsxs(Alert, { variant: "
|
|
70
|
+
render: () => (_jsxs(Alert, { variant: "danger", children: [_jsx(AlertTitle, { children: "RC:Alert" }), _jsx(AlertDescription, { children: "The engine rejected the job." })] })),
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
name: "ScrollArea",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-cases-primitives.js","sourceRoot":"","sources":["../src/render-cases-primitives.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,KAAK,EACL,UAAU,EACV,SAAS,EACT,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,SAAS,EACT,KAAK,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,KAAK,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,WA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K,EAAC,UAAU,wBAAsB,EACnD,KAAC,WAAW,IAAC,KAAK,EAAC,QAAQ,iCAA+B,IACrD,CACR;KACF;IACD;QACE,yEAAyE;QACzE,qEAAqE;QACrE,mEAAmE;QACnE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,MAAC,MAAM,IAAC,IAAI,QAAC,YAAY,EAAE,IAAI,aAC7B,KAAC,aAAa,4BAA0B,EACxC,MAAC,aAAa,eACZ,MAAC,YAAY,eACX,KAAC,WAAW,iCAA6B,EACzC,KAAC,iBAAiB,mDAAqD,IAC1D,EACf,KAAC,YAAY,cACX,KAAC,WAAW,yBAAqB,GACpB,IACD,IACT,CACV;KACF;IACD;QACE,0EAA0E;QAC1E,iDAAiD;QACjD,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,MAAC,KAAK,IAAC,IAAI,QAAC,YAAY,EAAE,IAAI,aAC5B,KAAC,YAAY,2BAAwB,EACrC,MAAC,YAAY,IAAC,IAAI,EAAC,OAAO,aACxB,MAAC,WAAW,eACV,KAAC,UAAU,+BAA0B,EACrC,KAAC,gBAAgB,mDAAoD,IACzD,EACd,KAAC,WAAW,cACV,KAAC,UAAU,wBAAmB,GAClB,IACD,IACT,CACT;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,MAAC,KAAK,IAAC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"render-cases-primitives.js","sourceRoot":"","sources":["../src/render-cases-primitives.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,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,KAAC,UAAU,wBAAmB,GAClB,IACD,IACT,CACT;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,MAAC,KAAK,IAAC,OAAO,EAAC,QAAQ,aACrB,KAAC,UAAU,2BAAsB,EACjC,KAAC,gBAAgB,+CAAgD,IAC3D,CACT;KACF;IACD;QACE,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,MAAC,UAAU,IAAC,SAAS,EAAC,MAAM,aAC1B,0CAAwB,EACxB,KAAC,SAAS,IAAC,WAAW,EAAC,UAAU,GAAG,IACzB,CACd;KACF;IACD;QACE,kDAAkD;QAClD,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,GAAG,EAAE,CAAC,KAAC,QAAQ,IAAC,SAAS,EAAC,UAAU,GAAG;KAChD;IACD;QACE,gDAAgD;QAChD,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,GAAG,EAAE,CAAC,KAAC,SAAS,IAAC,WAAW,EAAC,YAAY,GAAG;KACrD;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-cases.d.ts","sourceRoot":"","sources":["../src/render-cases.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render-cases.d.ts","sourceRoot":"","sources":["../src/render-cases.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAEtF,YAAY,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAwC9D,eAAO,MAAM,YAAY,EAAE,UAAU,EAmPpC,CAAA"}
|
package/dist/render-cases.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { ExternalLink, Inbox } from "lucide-react";
|
|
3
|
+
import { Button, CountPill, DrillButton, EmptyState, ErrorState, FilterBar, GridItem, GridLayout, GroupCard, KpiGrid, KpiGridSkeleton, ListFooter, LivePill, LocaleProvider, PagedListFooter, SectionHeading, StatusBadge, ThemeProvider, themePresets, ToastProvider, useLocale, WidgetHeader, } from "./index.js";
|
|
3
4
|
import { createStandaloneHostBridge, HostBridgeProvider, useHostBridge } from "./app/host-bridge.js";
|
|
4
|
-
import { HostModelContext } from "./app/
|
|
5
|
+
import { HostModelContext } from "./app/model-context.js";
|
|
5
6
|
import { WidgetFixtureHost } from "./app/widget-fixture.js";
|
|
6
7
|
import { PRIMITIVE_RENDER_CASES } from "./render-cases-primitives.js";
|
|
7
8
|
/**
|
|
@@ -61,9 +62,15 @@ export const RENDER_CASES = [
|
|
|
61
62
|
trendDirection: "up",
|
|
62
63
|
},
|
|
63
64
|
{ label: "Done", value: 12, fraction: "/19", tone: "success" },
|
|
64
|
-
{ label: "Total", value: 19, onClick: noop,
|
|
65
|
+
{ label: "Total", value: 19, onClick: noop, actionHint: "Shows all orders" },
|
|
65
66
|
] })),
|
|
66
67
|
},
|
|
68
|
+
{
|
|
69
|
+
// A skeleton has no text; the marker is its busy state.
|
|
70
|
+
name: "KpiGridSkeleton",
|
|
71
|
+
marker: 'aria-busy="true"',
|
|
72
|
+
render: () => _jsx(KpiGridSkeleton, { cells: 4, boxed: true }),
|
|
73
|
+
},
|
|
67
74
|
{
|
|
68
75
|
name: "LivePill",
|
|
69
76
|
marker: "RC:LivePill",
|
|
@@ -74,6 +81,11 @@ export const RENDER_CASES = [
|
|
|
74
81
|
marker: "RC:CountPill",
|
|
75
82
|
render: () => _jsx(CountPill, { tone: "warning", children: "RC:CountPill" }),
|
|
76
83
|
},
|
|
84
|
+
{
|
|
85
|
+
name: "StatusBadge",
|
|
86
|
+
marker: "RC:StatusBadge",
|
|
87
|
+
render: () => _jsx(StatusBadge, { tone: "warning", children: "RC:StatusBadge" }),
|
|
88
|
+
},
|
|
77
89
|
{
|
|
78
90
|
name: "SectionHeading",
|
|
79
91
|
marker: "RC:SectionHeading",
|
|
@@ -82,7 +94,7 @@ export const RENDER_CASES = [
|
|
|
82
94
|
{
|
|
83
95
|
name: "WidgetHeader",
|
|
84
96
|
marker: "RC:WidgetHeader",
|
|
85
|
-
render: () => (_jsx(WidgetHeader, {
|
|
97
|
+
render: () => (_jsx(WidgetHeader, { as: "h2", title: "RC:WidgetHeader", badge: _jsx(StatusBadge, { tone: "info", children: "Running" }), sub: _jsx(LivePill, { children: "Live" }), actions: _jsx(Button, { size: "sm", variant: "ghost", onClick: noop, children: "Refresh" }) })),
|
|
86
98
|
},
|
|
87
99
|
{
|
|
88
100
|
name: "GroupCard",
|
|
@@ -101,13 +113,43 @@ export const RENDER_CASES = [
|
|
|
101
113
|
{
|
|
102
114
|
name: "DrillButton",
|
|
103
115
|
marker: "RC:DrillButton",
|
|
104
|
-
render: () => (_jsx(DrillButton, { onDrill: noop, icon:
|
|
116
|
+
render: () => (_jsx(DrillButton, { onDrill: noop, icon: _jsx(ExternalLink, {}), size: "sm", ariaLabel: "Open order o-1001", children: "RC:DrillButton" })),
|
|
105
117
|
},
|
|
106
118
|
{
|
|
107
119
|
name: "ListFooter",
|
|
108
120
|
marker: "of 42 tasks",
|
|
109
121
|
render: () => _jsx(ListFooter, { shown: 8, total: 42, hasMore: true, onLoadMore: noop, noun: "tasks" }),
|
|
110
122
|
},
|
|
123
|
+
{
|
|
124
|
+
name: "PagedListFooter",
|
|
125
|
+
marker: "of 3 orders",
|
|
126
|
+
render: () => (_jsx(PagedListFooter, { paged: {
|
|
127
|
+
items: ["o-1", "o-2"],
|
|
128
|
+
total: 3,
|
|
129
|
+
hasMore: true,
|
|
130
|
+
loadMore: noop,
|
|
131
|
+
refreshing: true,
|
|
132
|
+
firstPage: {},
|
|
133
|
+
loadMoreError: new Error("HTTP 503"),
|
|
134
|
+
}, noun: "orders" })),
|
|
135
|
+
},
|
|
136
|
+
// ── Feedback and states ──
|
|
137
|
+
{
|
|
138
|
+
// The provider renders its children plus the (empty) live region.
|
|
139
|
+
name: "ToastProvider",
|
|
140
|
+
marker: "RC:ToastProvider",
|
|
141
|
+
render: () => (_jsx(ToastProvider, { children: _jsx("div", { children: "RC:ToastProvider" }) })),
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "EmptyState",
|
|
145
|
+
marker: "RC:EmptyState",
|
|
146
|
+
render: () => (_jsx(EmptyState, { icon: _jsx(Inbox, {}), title: "RC:EmptyState", description: "No orders in this period.", action: _jsx(Button, { size: "sm", onClick: noop, children: "New order" }) })),
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "ErrorState",
|
|
150
|
+
marker: "RC:ErrorState",
|
|
151
|
+
render: () => (_jsx(ErrorState, { title: "RC:ErrorState", description: "Check the connection and try again.", details: "HTTP 503 Service Unavailable", onRetry: noop })),
|
|
152
|
+
},
|
|
111
153
|
// ── Host seam / providers ──
|
|
112
154
|
{
|
|
113
155
|
name: "HostBridgeProvider",
|
|
@@ -124,7 +166,7 @@ export const RENDER_CASES = [
|
|
|
124
166
|
{
|
|
125
167
|
name: "ThemeProvider",
|
|
126
168
|
marker: "RC:ThemeProvider",
|
|
127
|
-
render: () => (_jsx(ThemeProvider, { theme: themePresets.
|
|
169
|
+
render: () => (_jsx(ThemeProvider, { theme: themePresets.emerald, mode: "dark", children: _jsx("div", { children: "RC:ThemeProvider" }) })),
|
|
128
170
|
},
|
|
129
171
|
{
|
|
130
172
|
name: "LocaleProvider",
|
package/dist/render-cases.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-cases.js","sourceRoot":"","sources":["../src/render-cases.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,MAAM,EACN,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,aAAa,EACb,YAAY,E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M,EAAE,GAAG,EAAE,CAAC,CACZ,KAAC,kBAAkB,IAAC,MAAM,EAAE,WAAW,YACrC,KAAC,gBAAgB,IAAC,OAAO,EAAC,0BAA0B,YAClD,gDAA8B,GACb,GACA,CACtB;KACF;IACD;QACE,IAAI,EAAE,eAAe;QACrB,MAAM,EAAE,kBAAkB;QAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,CAAC,OAAO,EAAE,IAAI,EAAC,MAAM,YACrD,6CAA2B,GACb,CACjB;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,sBAAsB;QAC9B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,KAAC,cAAc,IAAC,MAAM,EAAC,IAAI,YACzB,KAAC,WAAW,KAAG,GACA,CAClB;KACF;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,mCAAmC;QAC3C,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,KAAC,iBAAiB,IAChB,MAAM,EAAE,kBAAmC,EAC3C,IAAI,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,GAC/B,CACH;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effect-running renders for the WIRING tests SSR cannot see: effects,
|
|
3
|
+
* subscriptions and timers of the view lifecycle and the data hooks
|
|
4
|
+
* (toolkit#176 review). `react-dom/client` + `act` in a test file that opts
|
|
5
|
+
* into a DOM with `// @vitest-environment happy-dom`. Not an interaction kit:
|
|
6
|
+
* the house render path stays SSR (`renderToStaticMarkup`), and these tests
|
|
7
|
+
* drive hooks through their inputs; a `click()` only where the wiring starts
|
|
8
|
+
* at a button.
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from "react";
|
|
11
|
+
/**
|
|
12
|
+
* Run `work` in an ASYNC act scope: the promises it starts (a tool call that
|
|
13
|
+
* resolves, a state update after it) settle, and their renders commit,
|
|
14
|
+
* before the scope ends.
|
|
15
|
+
*/
|
|
16
|
+
export declare function inAct(work: () => unknown): Promise<void>;
|
|
17
|
+
export interface EffectRender {
|
|
18
|
+
container: HTMLElement;
|
|
19
|
+
/** Render `node` into the same root (a new host state, new props). */
|
|
20
|
+
rerender: (node: ReactNode) => Promise<void>;
|
|
21
|
+
/** Unmount and run the cleanups; a second call does nothing. */
|
|
22
|
+
unmount: () => Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
/** Mount `node` and run its effects. */
|
|
25
|
+
export declare function renderWithEffects(node: ReactNode): Promise<EffectRender>;
|
|
26
|
+
/**
|
|
27
|
+
* Settle pending promises and the effects and renders they cause, with real
|
|
28
|
+
* timers: TanStack Query notifies its observers on a 0 ms timer, so each
|
|
29
|
+
* round lets one land (under fake timers use {@link advanceTimers}).
|
|
30
|
+
*/
|
|
31
|
+
export declare function flushEffects(rounds?: number): Promise<void>;
|
|
32
|
+
/** Advance fake timers by `ms` inside act, so the renders they cause commit. */
|
|
33
|
+
export declare function advanceTimers(advance: (ms: number) => unknown, ms: number): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Renders `useValue` in a probe and keeps its latest committed value: read
|
|
36
|
+
* `current` after a render or flush.
|
|
37
|
+
*/
|
|
38
|
+
export declare function hookProbe<T>(useValue: () => T): {
|
|
39
|
+
Probe: () => null;
|
|
40
|
+
current: () => T;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=render-effects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-effects.d.ts","sourceRoot":"","sources":["../src/render-effects.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxD;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,WAAW,CAAA;IACtB,sEAAsE;IACtE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,gEAAgE;IAChE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7B;AAED,wCAAwC;AACxC,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAgB9E;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,MAAM,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAM5D;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG;IAC/C,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,OAAO,EAAE,MAAM,CAAC,CAAA;CACjB,CAgBA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effect-running renders for the WIRING tests SSR cannot see: effects,
|
|
3
|
+
* subscriptions and timers of the view lifecycle and the data hooks
|
|
4
|
+
* (toolkit#176 review). `react-dom/client` + `act` in a test file that opts
|
|
5
|
+
* into a DOM with `// @vitest-environment happy-dom`. Not an interaction kit:
|
|
6
|
+
* the house render path stays SSR (`renderToStaticMarkup`), and these tests
|
|
7
|
+
* drive hooks through their inputs; a `click()` only where the wiring starts
|
|
8
|
+
* at a button.
|
|
9
|
+
*/
|
|
10
|
+
import { act, useEffect } from "react";
|
|
11
|
+
import { createRoot } from "react-dom/client";
|
|
12
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
13
|
+
/**
|
|
14
|
+
* Run `work` in an ASYNC act scope: the promises it starts (a tool call that
|
|
15
|
+
* resolves, a state update after it) settle, and their renders commit,
|
|
16
|
+
* before the scope ends.
|
|
17
|
+
*/
|
|
18
|
+
export function inAct(work) {
|
|
19
|
+
return act(() => {
|
|
20
|
+
work();
|
|
21
|
+
return Promise.resolve();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** Mount `node` and run its effects. */
|
|
25
|
+
export async function renderWithEffects(node) {
|
|
26
|
+
const container = document.createElement("div");
|
|
27
|
+
document.body.append(container);
|
|
28
|
+
const root = createRoot(container);
|
|
29
|
+
await inAct(() => root.render(node));
|
|
30
|
+
let mounted = true;
|
|
31
|
+
return {
|
|
32
|
+
container,
|
|
33
|
+
rerender: (next) => inAct(() => root.render(next)),
|
|
34
|
+
unmount: async () => {
|
|
35
|
+
if (!mounted)
|
|
36
|
+
return;
|
|
37
|
+
mounted = false;
|
|
38
|
+
await inAct(() => root.unmount());
|
|
39
|
+
container.remove();
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Settle pending promises and the effects and renders they cause, with real
|
|
45
|
+
* timers: TanStack Query notifies its observers on a 0 ms timer, so each
|
|
46
|
+
* round lets one land (under fake timers use {@link advanceTimers}).
|
|
47
|
+
*/
|
|
48
|
+
export async function flushEffects(rounds = 3) {
|
|
49
|
+
for (let round = 0; round < rounds; round++) {
|
|
50
|
+
await act(async () => {
|
|
51
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Advance fake timers by `ms` inside act, so the renders they cause commit. */
|
|
56
|
+
export function advanceTimers(advance, ms) {
|
|
57
|
+
return inAct(() => advance(ms));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Renders `useValue` in a probe and keeps its latest committed value: read
|
|
61
|
+
* `current` after a render or flush.
|
|
62
|
+
*/
|
|
63
|
+
export function hookProbe(useValue) {
|
|
64
|
+
const box = {};
|
|
65
|
+
function Probe() {
|
|
66
|
+
const value = useValue();
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
box.value = { current: value };
|
|
69
|
+
});
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
Probe,
|
|
74
|
+
current: () => {
|
|
75
|
+
if (!box.value)
|
|
76
|
+
throw new Error("the probe has not committed yet");
|
|
77
|
+
return box.value.current;
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=render-effects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-effects.js","sourceRoot":"","sources":["../src/render-effects.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,GAAG,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAG5C;AAAC,UAAqD,CAAC,wBAAwB,GAAG,IAAI,CAAA;AAEvF;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,IAAmB;IACvC,OAAO,GAAG,CAAC,GAAG,EAAE;QACd,IAAI,EAAE,CAAA;QACN,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC,CAAC,CAAA;AACJ,CAAC;AAUD,wCAAwC;AACxC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAe;IACrD,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC/C,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;IAClC,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IACpC,IAAI,OAAO,GAAG,IAAI,CAAA;IAClB,OAAO;QACL,SAAS;QACT,QAAQ,EAAE,CAAC,IAAI,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G,CAAC,KAAK;gBAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;YAClE,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,CAAA;QAC1B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read SSR markup (`renderToStaticMarkup`) the way a user — sighted or with a
|
|
3
|
+
* screen reader — meets it: its text nodes plus the attributes that carry
|
|
4
|
+
* text (accessible names, tooltips, placeholders). DATA/TEST support module
|
|
5
|
+
* like `render-cases.tsx`: the a11y and i18n render suites scan through it,
|
|
6
|
+
* so it stays pure and dependency-free. React's SSR output is well-formed
|
|
7
|
+
* (attributes always double-quoted), which is what keeps these regexes honest.
|
|
8
|
+
*/
|
|
9
|
+
/** Attributes whose value a user reads or hears. */
|
|
10
|
+
export declare const TEXT_ATTRIBUTES: readonly ["aria-label", "aria-description", "aria-roledescription", "aria-valuetext", "title", "placeholder", "alt"];
|
|
11
|
+
/** Decode the HTML entities React's SSR emits (named, decimal and hex). */
|
|
12
|
+
export declare function decodeEntities(text: string): string;
|
|
13
|
+
/** One piece of user-facing text in the markup. */
|
|
14
|
+
export interface MarkupText {
|
|
15
|
+
/** `"text"` for a text node, else the attribute name. */
|
|
16
|
+
source: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}
|
|
19
|
+
/** Every non-blank text node and text-bearing attribute value, decoded. */
|
|
20
|
+
export declare function userFacingTexts(html: string): MarkupText[];
|
|
21
|
+
/** The opening tags of every element named `tag` (e.g. `"button"`). */
|
|
22
|
+
export declare function openingTags(html: string, tag: string): string[];
|
|
23
|
+
/** The decoded value of `name` on one opening tag, `undefined` when absent. */
|
|
24
|
+
export declare function attribute(openingTag: string, name: string): string | undefined;
|
|
25
|
+
//# sourceMappingURL=render-scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-scan.d.ts","sourceRoot":"","sources":["../src/render-scan.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,oDAAoD;AACpD,eAAO,MAAM,eAAe,sHAQlB,CAAA;AAWV,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQnD;AAED,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAc1D;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAE/D;AAED,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI9E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read SSR markup (`renderToStaticMarkup`) the way a user — sighted or with a
|
|
3
|
+
* screen reader — meets it: its text nodes plus the attributes that carry
|
|
4
|
+
* text (accessible names, tooltips, placeholders). DATA/TEST support module
|
|
5
|
+
* like `render-cases.tsx`: the a11y and i18n render suites scan through it,
|
|
6
|
+
* so it stays pure and dependency-free. React's SSR output is well-formed
|
|
7
|
+
* (attributes always double-quoted), which is what keeps these regexes honest.
|
|
8
|
+
*/
|
|
9
|
+
/** Attributes whose value a user reads or hears. */
|
|
10
|
+
export const TEXT_ATTRIBUTES = [
|
|
11
|
+
"aria-label",
|
|
12
|
+
"aria-description",
|
|
13
|
+
"aria-roledescription",
|
|
14
|
+
"aria-valuetext",
|
|
15
|
+
"title",
|
|
16
|
+
"placeholder",
|
|
17
|
+
"alt",
|
|
18
|
+
];
|
|
19
|
+
const NAMED_ENTITIES = {
|
|
20
|
+
amp: "&",
|
|
21
|
+
lt: "<",
|
|
22
|
+
gt: ">",
|
|
23
|
+
quot: '"',
|
|
24
|
+
apos: "'",
|
|
25
|
+
nbsp: " ",
|
|
26
|
+
};
|
|
27
|
+
/** Decode the HTML entities React's SSR emits (named, decimal and hex). */
|
|
28
|
+
export function decodeEntities(text) {
|
|
29
|
+
return text.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (whole, ref) => {
|
|
30
|
+
if (ref.startsWith("#x") || ref.startsWith("#X")) {
|
|
31
|
+
return String.fromCodePoint(Number.parseInt(ref.slice(2), 16));
|
|
32
|
+
}
|
|
33
|
+
if (ref.startsWith("#"))
|
|
34
|
+
return String.fromCodePoint(Number.parseInt(ref.slice(1), 10));
|
|
35
|
+
return NAMED_ENTITIES[ref.toLowerCase()] ?? whole;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** Every non-blank text node and text-bearing attribute value, decoded. */
|
|
39
|
+
export function userFacingTexts(html) {
|
|
40
|
+
const out = [];
|
|
41
|
+
const withoutRawText = html.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi, "");
|
|
42
|
+
for (const chunk of withoutRawText.split(/<[^>]*>/)) {
|
|
43
|
+
const value = decodeEntities(chunk).trim();
|
|
44
|
+
if (value)
|
|
45
|
+
out.push({ source: "text", value });
|
|
46
|
+
}
|
|
47
|
+
for (const tag of withoutRawText.match(/<[a-z][^>]*>/gi) ?? []) {
|
|
48
|
+
for (const name of TEXT_ATTRIBUTES) {
|
|
49
|
+
const value = attribute(tag, name);
|
|
50
|
+
if (value?.trim())
|
|
51
|
+
out.push({ source: name, value: value.trim() });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/** The opening tags of every element named `tag` (e.g. `"button"`). */
|
|
57
|
+
export function openingTags(html, tag) {
|
|
58
|
+
return html.match(new RegExp(`<${tag}(?=[\\s>/])[^>]*>`, "gi")) ?? [];
|
|
59
|
+
}
|
|
60
|
+
/** The decoded value of `name` on one opening tag, `undefined` when absent. */
|
|
61
|
+
export function attribute(openingTag, name) {
|
|
62
|
+
const escaped = name.replace(/[-]/g, "\\-");
|
|
63
|
+
const match = new RegExp(`\\s${escaped}="([^"]*)"`, "i").exec(openingTag);
|
|
64
|
+
return match ? decodeEntities(match[1] ?? "") : undefined;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=render-scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-scan.js","sourceRoot":"","sources":["../src/render-scan.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,oDAAoD;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY;IACZ,kBAAkB;IAClB,sBAAsB;IACtB,gBAAgB;IAChB,OAAO;IACP,aAAa;IACb,KAAK;CACG,CAAA;AAEV,MAAM,cAAc,GAA2B;IAC7C,GAAG,EAAE,GAAG;IACR,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;CACV,CAAA;AAED,2EAA2E;AAC3E,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,OAAO,CAAC,+BAA+B,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;QAC1E,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACjD,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QAChE,CAAC;QACD,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,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,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC3C,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,OAAO,YAAY,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACzE,OAAO,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAC3D,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Miragon corporate-design tokens (`--cd-*`) as plain TypeScript, for code
|
|
3
|
+
* that cannot read CSS variables — an SVG or canvas renderer (BPMN overlays,
|
|
4
|
+
* chart marks), a server-side image, a test. Keys are the CSS names without the
|
|
5
|
+
* `--cd-` prefix.
|
|
6
|
+
*
|
|
7
|
+
* The source of truth is the vendored `cd-tokens.generated.css` next to this
|
|
8
|
+
* file (miragon-brand 1.8.0, copied unchanged from Miragon/corporate-identity).
|
|
9
|
+
* This module mirrors it value for value; `cd-tokens.test.ts` fails on any
|
|
10
|
+
* drift (modeler-tool-design §13). Never edit a value here without re-vendoring
|
|
11
|
+
* the CSS first.
|
|
12
|
+
*
|
|
13
|
+
* UI code styles through the role tokens (`bg-primary`, `text-link`,
|
|
14
|
+
* `border-danger`, …), never through these constants.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CD_TOKENS: {
|
|
17
|
+
readonly blau: "#335DE5";
|
|
18
|
+
readonly gruen: "#00E676";
|
|
19
|
+
readonly grau: "#F9F7F7";
|
|
20
|
+
readonly schwarz: "#1D1D1D";
|
|
21
|
+
readonly weiss: "#FFFFFF";
|
|
22
|
+
readonly "blau-link": "#2B50D4";
|
|
23
|
+
readonly "blau-hell": "#6B8AFF";
|
|
24
|
+
readonly success: "#00E676";
|
|
25
|
+
readonly "success-soft": "#DAFBEB";
|
|
26
|
+
readonly "success-hell": "#00E676";
|
|
27
|
+
readonly warning: "#FFB000";
|
|
28
|
+
readonly "warning-soft": "#FFF1D2";
|
|
29
|
+
readonly "warning-hell": "#FFB000";
|
|
30
|
+
readonly danger: "#CD1839";
|
|
31
|
+
readonly "danger-soft": "#FBEEF0";
|
|
32
|
+
readonly "danger-hell": "#FB6D73";
|
|
33
|
+
readonly info: "#335DE5";
|
|
34
|
+
readonly "info-soft": "#EEF1FD";
|
|
35
|
+
readonly "info-hell": "#6B8AFF";
|
|
36
|
+
readonly linie: "#E6E2E2";
|
|
37
|
+
readonly kontur: "#8F8A8A";
|
|
38
|
+
readonly "text-leise": "#6B6666";
|
|
39
|
+
readonly "gradient-brand": "linear-gradient(120deg, #335DE5 30%, #00E676)";
|
|
40
|
+
readonly "gradient-format": "linear-gradient(135deg, #335DE5 0%, #00E676 140%)";
|
|
41
|
+
readonly "space-1": "4px";
|
|
42
|
+
readonly "space-2": "8px";
|
|
43
|
+
readonly "space-3": "16px";
|
|
44
|
+
readonly "space-4": "24px";
|
|
45
|
+
readonly "space-5": "32px";
|
|
46
|
+
readonly "space-6": "48px";
|
|
47
|
+
readonly "space-7": "64px";
|
|
48
|
+
readonly "space-8": "96px";
|
|
49
|
+
readonly "radius-sm": "6px";
|
|
50
|
+
readonly "radius-md": "12px";
|
|
51
|
+
readonly "radius-lg": "16px";
|
|
52
|
+
readonly "radius-pill": "999px";
|
|
53
|
+
readonly "shadow-1": "0 1px 2px rgba(29, 29, 29, 0.06), 0 1px 3px rgba(29, 29, 29, 0.10)";
|
|
54
|
+
readonly "shadow-2": "0 4px 12px rgba(29, 29, 29, 0.10)";
|
|
55
|
+
readonly "shadow-3": "0 12px 32px rgba(29, 29, 29, 0.16)";
|
|
56
|
+
readonly "motion-fast": "150ms";
|
|
57
|
+
readonly "motion-base": "250ms";
|
|
58
|
+
readonly "motion-slow": "400ms";
|
|
59
|
+
readonly ease: "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
60
|
+
readonly "ease-out": "cubic-bezier(0, 0, 0.2, 1)";
|
|
61
|
+
};
|
|
62
|
+
/** A key of {@link CD_TOKENS} — the `--cd-*` name without its prefix. */
|
|
63
|
+
export type CdTokenName = keyof typeof CD_TOKENS;
|
|
64
|
+
/** The miragon-brand release the vendored tokens come from. */
|
|
65
|
+
export declare const CD_TOKENS_VERSION = "1.8.0";
|
|
66
|
+
//# sourceMappingURL=cd-tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cd-tokens.d.ts","sourceRoot":"","sources":["../../src/theme/cd-tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CZ,CAAA;AAEV,yEAAyE;AACzE,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,SAAS,CAAA;AAEhD,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,UAAU,CAAA"}
|