basalt-ui 3.0.0 → 3.1.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/AGENTS.md +1 -0
- package/CHANGELOG.md +72 -39
- package/MIGRATING.md +44 -2
- package/README.md +39 -12
- package/agent/rules/basalt-tokens.md +1 -1
- package/agent/rules/basalt-ui.md +3 -3
- package/agent/skills/basalt-app/references/live.md +4 -4
- package/agent/skills/basalt-app/references/migrate.md +2 -2
- package/agent/skills/basalt-app/references/setup.md +17 -8
- package/agent/skills/basalt-app/references/testing.md +8 -6
- package/agent/skills/basalt-design/SKILL.md +2 -1
- package/agent/skills/basalt-design/references/controls.md +1 -0
- package/agent/skills/basalt-design/references/parts.md +5 -1
- package/agent/templates/AGENTS-block.md.tpl +6 -23
- package/agent/templates/AGENTS-block.site.md.tpl +5 -18
- package/agent/templates/AGENTS-block.tokens.md.tpl +3 -7
- package/agent/templates/DESIGN.md.tpl +1 -1
- package/agent/templates/_app-error.i18n.tpl +8 -32
- package/agent/templates/_app-error.tpl +8 -32
- package/agent/templates/_app-pending.i18n.tpl +5 -3
- package/agent/templates/_app-pending.tpl +5 -4
- package/agent/templates/main.i18n.tpl +8 -3
- package/agent/templates/main.tpl +8 -3
- package/agent/templates/router.start.tpl +8 -3
- package/agent/templates/seed-messages.json +0 -30
- package/configs/oxlint-app.json +9 -1
- package/configs/oxlint-bridge.json +3 -1
- package/configs/oxlint-parts.json +9 -1
- package/configs/oxlint-site.json +3 -1
- package/dist/astro/shiki.d.ts +3 -2
- package/dist/astro/shiki.d.ts.map +1 -1
- package/dist/cards/bar-list.d.ts.map +1 -1
- package/dist/cards/bar-list.js +2 -1
- package/dist/cards/chain-view.d.ts +37 -8
- package/dist/cards/chain-view.d.ts.map +1 -1
- package/dist/cards/chain-view.js +105 -38
- package/dist/cards/contract.d.ts +8 -1
- package/dist/cards/contract.d.ts.map +1 -1
- package/dist/cards/data-panel.d.ts.map +1 -1
- package/dist/cards/data-panel.js +1 -0
- package/dist/cards/event-list.d.ts.map +1 -1
- package/dist/cards/event-list.js +3 -2
- package/dist/cards/index.d.ts +1 -1
- package/dist/cards/index.d.ts.map +1 -1
- package/dist/cards/row-list.d.ts.map +1 -1
- package/dist/cards/row-list.js +2 -1
- package/dist/cards/stat-card-parts.d.ts +3 -3
- package/dist/cards/stat-card-parts.d.ts.map +1 -1
- package/dist/cards/stat-card-parts.js +8 -2
- package/dist/cards/stat-card.d.ts.map +1 -1
- package/dist/cards/stat-card.js +34 -9
- package/dist/charts/core/compile.d.ts +2 -0
- package/dist/charts/core/compile.d.ts.map +1 -1
- package/dist/charts/core/compile.js +16 -8
- package/dist/charts/core/cursor.d.ts +2 -1
- package/dist/charts/core/cursor.d.ts.map +1 -1
- package/dist/charts/core/cursor.js +8 -1
- package/dist/charts/core/tooltip-said.d.ts +16 -0
- package/dist/charts/core/tooltip-said.d.ts.map +1 -0
- package/dist/charts/core/tooltip-said.js +39 -0
- package/dist/charts/focus.d.ts.map +1 -1
- package/dist/charts/focus.js +1 -1
- package/dist/charts/parts/chart-card.d.ts.map +1 -1
- package/dist/charts/parts/chart-card.js +1 -0
- package/dist/cli/agent-note.d.ts +3 -3
- package/dist/cli/agent-note.d.ts.map +1 -1
- package/dist/cli/agent-note.js +5 -5
- package/dist/cli/budget/index.d.ts +7 -0
- package/dist/cli/budget/index.d.ts.map +1 -1
- package/dist/cli/budget/index.js +11 -5
- package/dist/cli/config.d.ts +1 -1
- package/dist/cli/doctor/app.d.ts.map +1 -1
- package/dist/cli/doctor/app.js +53 -24
- package/dist/cli/doctor/eject.d.ts.map +1 -1
- package/dist/cli/doctor/eject.js +16 -9
- package/dist/cli/doctor/guards.d.ts.map +1 -1
- package/dist/cli/doctor/guards.js +11 -8
- package/dist/cli/doctor/hook.js +1 -1
- package/dist/cli/doctor/install.d.ts.map +1 -1
- package/dist/cli/doctor/install.js +46 -22
- package/dist/cli/doctor/translations.d.ts.map +1 -1
- package/dist/cli/doctor/translations.js +11 -4
- package/dist/cli/doctor/types.d.ts +2 -2
- package/dist/cli/doctor/types.d.ts.map +1 -1
- package/dist/cli/doctor/types.js +1 -1
- package/dist/cli/doctor/wiring.d.ts.map +1 -1
- package/dist/cli/doctor/wiring.js +26 -15
- package/dist/cli/eject/dropped-slots.d.ts +6 -0
- package/dist/cli/eject/dropped-slots.d.ts.map +1 -0
- package/dist/cli/eject/dropped-slots.js +9 -0
- package/dist/cli/eject/index.d.ts.map +1 -1
- package/dist/cli/eject/index.js +9 -8
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +7 -2
- package/dist/cli/index.d.ts +6 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +38 -7
- package/dist/cli/init/index.d.ts +10 -0
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/index.js +61 -10
- package/dist/cli/init/locales.d.ts +7 -0
- package/dist/cli/init/locales.d.ts.map +1 -1
- package/dist/cli/init/locales.js +21 -6
- package/dist/cli/init/router-seeds.d.ts.map +1 -1
- package/dist/cli/init/router-seeds.js +16 -3
- package/dist/cli/init/steps.d.ts +36 -3
- package/dist/cli/init/steps.d.ts.map +1 -1
- package/dist/cli/init/steps.js +201 -34
- package/dist/cli/lint/baseline.d.ts +27 -0
- package/dist/cli/lint/baseline.d.ts.map +1 -0
- package/dist/cli/lint/baseline.js +96 -0
- package/dist/cli/lint/engine.d.ts +2 -0
- package/dist/cli/lint/engine.d.ts.map +1 -1
- package/dist/cli/lint/engine.js +18 -8
- package/dist/cli/lint/hook.d.ts.map +1 -1
- package/dist/cli/lint/hook.js +8 -3
- package/dist/cli/lint/index.d.ts +3 -0
- package/dist/cli/lint/index.d.ts.map +1 -1
- package/dist/cli/lint/index.js +67 -8
- package/dist/cli/manifest.d.ts +46 -3
- package/dist/cli/manifest.d.ts.map +1 -1
- package/dist/cli/manifest.js +71 -1
- package/dist/cli/migrate/census.d.ts +6 -0
- package/dist/cli/migrate/census.d.ts.map +1 -1
- package/dist/cli/migrate/census.js +22 -1
- package/dist/cli/migrate/index.d.ts +5 -0
- package/dist/cli/migrate/index.d.ts.map +1 -1
- package/dist/cli/migrate/index.js +36 -3
- package/dist/cli/migrate/lost-classes.d.ts +20 -0
- package/dist/cli/migrate/lost-classes.d.ts.map +1 -0
- package/dist/cli/migrate/lost-classes.js +145 -0
- package/dist/cli/migrate/rows.d.ts +10 -0
- package/dist/cli/migrate/rows.d.ts.map +1 -1
- package/dist/cli/migrate/rows.js +15 -0
- package/dist/cli/package-manager.d.ts.map +1 -1
- package/dist/cli/package-manager.js +2 -1
- package/dist/cli/peers.d.ts +2 -0
- package/dist/cli/peers.d.ts.map +1 -1
- package/dist/cli/peers.js +7 -0
- package/dist/cli/presets.d.ts.map +1 -1
- package/dist/cli/presets.js +27 -11
- package/dist/cli/resolver.d.ts +13 -4
- package/dist/cli/resolver.d.ts.map +1 -1
- package/dist/cli/resolver.js +39 -5
- package/dist/cli/router-wiring.d.ts +1 -0
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +1 -1
- package/dist/cli/sync/engine.d.ts +8 -1
- package/dist/cli/sync/engine.d.ts.map +1 -1
- package/dist/cli/sync/engine.js +25 -14
- package/dist/cli/sync/index.d.ts.map +1 -1
- package/dist/cli/sync/index.js +7 -4
- package/dist/cli/sync/render.d.ts.map +1 -1
- package/dist/cli/sync/render.js +21 -28
- package/dist/cli/tokens-css.d.ts +2 -0
- package/dist/cli/tokens-css.d.ts.map +1 -1
- package/dist/cli/tokens-css.js +28 -6
- package/dist/controls/contract.d.ts +2 -1
- package/dist/controls/contract.d.ts.map +1 -1
- package/dist/controls/control-home.d.ts +4 -1
- package/dist/controls/control-home.d.ts.map +1 -1
- package/dist/controls/control-home.js +5 -3
- package/dist/controls/local-control.d.ts +28 -1
- package/dist/controls/local-control.d.ts.map +1 -1
- package/dist/controls/local-control.js +14 -2
- package/dist/core/cn.d.ts.map +1 -1
- package/dist/core/cn.js +6 -5
- package/dist/core/frame-figure.d.ts +2 -0
- package/dist/core/frame-figure.d.ts.map +1 -1
- package/dist/core/frame-figure.js +5 -2
- package/dist/core/frame-head.d.ts +3 -1
- package/dist/core/frame-head.d.ts.map +1 -1
- package/dist/core/frame-head.js +28 -7
- package/dist/core/frame-regions.d.ts +1 -1
- package/dist/core/frame-regions.d.ts.map +1 -1
- package/dist/core/frame-regions.js +18 -8
- package/dist/core/info-hint.d.ts +5 -0
- package/dist/core/info-hint.d.ts.map +1 -1
- package/dist/core/info-hint.js +22 -1
- package/dist/core/mark-tone.d.ts +6 -2
- package/dist/core/mark-tone.d.ts.map +1 -1
- package/dist/core/mark-tone.js +1 -1
- package/dist/core/mark-types.d.ts +4 -2
- package/dist/core/mark-types.d.ts.map +1 -1
- package/dist/core/messages/chain.d.ts +2 -1
- package/dist/core/messages/chain.d.ts.map +1 -1
- package/dist/core/messages/chain.js +1 -0
- package/dist/core/messages/index.d.ts +2 -1
- package/dist/core/messages/index.d.ts.map +1 -1
- package/dist/core/messages/index.js +2 -0
- package/dist/core/messages/runs.d.ts +20 -0
- package/dist/core/messages/runs.d.ts.map +1 -0
- package/dist/core/messages/runs.js +18 -0
- package/dist/core/phase.d.ts +25 -2
- package/dist/core/phase.d.ts.map +1 -1
- package/dist/core/ports.d.ts +4 -1
- package/dist/core/ports.d.ts.map +1 -1
- package/dist/core/provider.d.ts +3 -1
- package/dist/core/provider.d.ts.map +1 -1
- package/dist/core/provider.js +5 -3
- package/dist/core/scheme.d.ts +2 -1
- package/dist/core/scheme.d.ts.map +1 -1
- package/dist/core/scheme.js +1 -0
- package/dist/core/spark/mini-bars.d.ts +6 -4
- package/dist/core/spark/mini-bars.d.ts.map +1 -1
- package/dist/core/spark/mini-bars.js +36 -11
- package/dist/core/spark/sparkline.d.ts +2 -2
- package/dist/core/spark/sparkline.d.ts.map +1 -1
- package/dist/core/spark/sparkline.js +21 -2
- package/dist/css/bridge.css +63 -0
- package/dist/css/generate.d.ts +2 -2
- package/dist/css/generate.d.ts.map +1 -1
- package/dist/css/generate.js +25 -0
- package/dist/data/live/live-query.d.ts +2 -2
- package/dist/data/live/live-query.d.ts.map +1 -1
- package/dist/data/live/live-query.js +2 -1
- package/dist/lint/preset.d.ts +12 -3
- package/dist/lint/preset.d.ts.map +1 -1
- package/dist/lint/preset.js +30 -10
- package/dist/lint/rules/class/table.d.ts.map +1 -1
- package/dist/lint/rules/class/table.js +3 -1
- package/dist/lint/rules/structure/control-home.js +1 -1
- package/dist/lint/rules/structure/import-boundary.d.ts.map +1 -1
- package/dist/lint/rules/structure/import-boundary.js +2 -0
- package/dist/lint/rules/structure/label-literal.d.ts.map +1 -1
- package/dist/lint/rules/structure/label-literal.js +1 -1
- package/dist/lint/shadcn.d.ts +562 -0
- package/dist/lint/shadcn.d.ts.map +1 -0
- package/dist/lint/shadcn.js +52 -0
- package/dist/lint/stylelint/render.d.ts +3 -1
- package/dist/lint/stylelint/render.d.ts.map +1 -1
- package/dist/lint/stylelint/render.js +23 -2
- package/dist/lint/stylelint/rules.d.ts +3 -2
- package/dist/lint/stylelint/rules.d.ts.map +1 -1
- package/dist/lint/stylelint/rules.js +11 -6
- package/dist/lint/weakened.d.ts +8 -0
- package/dist/lint/weakened.d.ts.map +1 -1
- package/dist/lint/weakened.js +44 -1
- package/dist/messages/de.d.ts.map +1 -1
- package/dist/messages/de.js +15 -0
- package/dist/messages/es.d.ts.map +1 -1
- package/dist/messages/es.js +15 -0
- package/dist/messages/fr.d.ts.map +1 -1
- package/dist/messages/fr.js +15 -0
- package/dist/messages/zh-hans.d.ts.map +1 -1
- package/dist/messages/zh-hans.js +15 -0
- package/dist/page/bar-title.d.ts +25 -0
- package/dist/page/bar-title.d.ts.map +1 -0
- package/dist/page/bar-title.js +10 -0
- package/dist/page/contract.d.ts +11 -1
- package/dist/page/contract.d.ts.map +1 -1
- package/dist/page/empty-state.d.ts +5 -2
- package/dist/page/empty-state.d.ts.map +1 -1
- package/dist/page/empty-state.js +14 -3
- package/dist/page/facts.d.ts +19 -2
- package/dist/page/facts.d.ts.map +1 -1
- package/dist/page/facts.js +26 -5
- package/dist/page/index.d.ts +8 -0
- package/dist/page/index.d.ts.map +1 -1
- package/dist/page/index.js +9 -0
- package/dist/page/page-bar.d.ts.map +1 -1
- package/dist/page/page-bar.js +2 -7
- package/dist/page/page-summary.d.ts +2 -1
- package/dist/page/page-summary.d.ts.map +1 -1
- package/dist/page/page-summary.js +1 -1
- package/dist/page/run-button.d.ts +26 -0
- package/dist/page/run-button.d.ts.map +1 -0
- package/dist/page/run-button.js +31 -0
- package/dist/page/run-list.d.ts +28 -0
- package/dist/page/run-list.d.ts.map +1 -0
- package/dist/page/run-list.js +88 -0
- package/dist/page/run-queue.d.ts +78 -0
- package/dist/page/run-queue.d.ts.map +1 -0
- package/dist/page/run-queue.js +93 -0
- package/dist/page/section.d.ts +6 -1
- package/dist/page/section.d.ts.map +1 -1
- package/dist/page/section.js +34 -16
- package/dist/shell/commands/command-palette.d.ts.map +1 -1
- package/dist/shell/commands/command-palette.js +5 -1
- package/dist/shell/parts/header.js +1 -1
- package/dist/surfaces.d.ts +15 -1
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +19 -2
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -0
- package/dist/testing/pseudo-locale.d.ts +41 -0
- package/dist/testing/pseudo-locale.d.ts.map +1 -0
- package/dist/testing/pseudo-locale.js +74 -0
- package/dist/testing/quality.d.ts +6 -0
- package/dist/testing/quality.d.ts.map +1 -1
- package/dist/testing/quality.js +139 -1
- package/dist/tokens/bridge-sheet.d.ts +21 -0
- package/dist/tokens/bridge-sheet.d.ts.map +1 -0
- package/dist/tokens/bridge-sheet.js +68 -0
- package/dist/tokens/emit.d.ts +6 -1
- package/dist/tokens/emit.d.ts.map +1 -1
- package/dist/tokens/emit.js +26 -1
- package/dist/ui/accordion.js +1 -1
- package/dist/ui/card.d.ts +32 -4
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +26 -3
- package/dist/ui/collapsible.d.ts +4 -2
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/meter.d.ts +34 -3
- package/dist/ui/meter.d.ts.map +1 -1
- package/dist/ui/meter.guard.d.ts +2 -0
- package/dist/ui/meter.guard.d.ts.map +1 -1
- package/dist/ui/meter.guard.js +20 -0
- package/dist/ui/meter.js +23 -7
- package/dist/ui/primitive.contract.d.ts.map +1 -1
- package/dist/ui/primitive.contract.js +7 -0
- package/dist/ui/remote-pad.d.ts +62 -0
- package/dist/ui/remote-pad.d.ts.map +1 -0
- package/dist/ui/remote-pad.guard.d.ts +21 -0
- package/dist/ui/remote-pad.guard.d.ts.map +1 -0
- package/dist/ui/remote-pad.guard.js +6 -0
- package/dist/ui/remote-pad.js +148 -0
- package/dist/ui/segmented.d.ts.map +1 -1
- package/dist/ui/segmented.js +4 -0
- package/dist/ui/skeleton.d.ts +9 -4
- package/dist/ui/skeleton.d.ts.map +1 -1
- package/dist/ui/skeleton.guard.d.ts +6 -2
- package/dist/ui/skeleton.guard.d.ts.map +1 -1
- package/dist/ui/skeleton.guard.js +4 -0
- package/dist/ui/skeleton.js +2 -1
- package/dist/ui/slots.d.ts +2 -1
- package/dist/ui/slots.d.ts.map +1 -1
- package/dist/ui/slots.js +2 -1
- package/dist/vite/allotment.d.ts +1 -1
- package/dist/vite/allotment.d.ts.map +1 -1
- package/dist/vite/allotment.js +15 -1
- package/dist/vite/doc.d.ts +1 -1
- package/dist/vite/doc.d.ts.map +1 -1
- package/dist/vite/doc.js +12 -2
- package/dist/vite/head.d.ts +4 -3
- package/dist/vite/head.d.ts.map +1 -1
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +4 -1
- package/dist/vite/shell-worker.d.ts +6 -0
- package/dist/vite/shell-worker.d.ts.map +1 -0
- package/dist/vite/shell-worker.js +92 -0
- package/docs/astro.md +19 -4
- package/docs/bar-list.md +3 -2
- package/docs/bar-title.md +33 -0
- package/docs/basalt-provider.md +2 -1
- package/docs/card.md +24 -4
- package/docs/chain-view.md +12 -7
- package/docs/chart-card.md +3 -2
- package/docs/collapsible.md +4 -2
- package/docs/control-home.md +4 -2
- package/docs/create-run-queue.md +40 -0
- package/docs/data-panel.md +3 -2
- package/docs/de.md +1 -1
- package/docs/empty-state.md +3 -1
- package/docs/es.md +1 -1
- package/docs/event-list.md +3 -2
- package/docs/fact.md +6 -1
- package/docs/facts.md +5 -1
- package/docs/fr.md +1 -1
- package/docs/live-query.md +1 -1
- package/docs/meter.md +17 -13
- package/docs/mini-bars.md +7 -5
- package/docs/pseudo-basalt-messages.md +30 -0
- package/docs/pseudo-messages.md +27 -0
- package/docs/quality.md +2 -1
- package/docs/recipes/localise-app.md +2 -2
- package/docs/remote-pad.md +40 -0
- package/docs/row-list.md +3 -2
- package/docs/run-button.md +45 -0
- package/docs/run-list.md +71 -0
- package/docs/section.md +7 -1
- package/docs/set-scheme.md +2 -2
- package/docs/skeleton.md +4 -3
- package/docs/slots.md +1 -1
- package/docs/sparkline.md +5 -2
- package/docs/stat-card.md +6 -4
- package/docs/testing.md +64 -0
- package/docs/use-local-control.md +8 -1
- package/docs/use-runs.md +32 -0
- package/docs/vite.md +12 -2
- package/docs/zh-hans.md +1 -1
- package/llms.txt +88 -21
- package/migrations/areas/shadcn.json +338 -0
- package/package.json +9 -2
- package/src/astro/shiki.ts +3 -1
- package/src/cards/bar-list.tsx +2 -1
- package/src/cards/chain-view.tsx +167 -55
- package/src/cards/contract.ts +8 -1
- package/src/cards/data-panel.tsx +1 -0
- package/src/cards/event-list.tsx +2 -1
- package/src/cards/index.ts +1 -0
- package/src/cards/row-list.tsx +2 -1
- package/src/cards/stat-card-parts.tsx +9 -7
- package/src/cards/stat-card.tsx +39 -12
- package/src/charts/core/compile.ts +31 -19
- package/src/charts/core/cursor.ts +11 -3
- package/src/charts/core/tooltip-said.ts +55 -0
- package/src/charts/focus.tsx +4 -1
- package/src/charts/parts/chart-card.tsx +1 -0
- package/src/cli/agent-note.ts +12 -5
- package/src/cli/budget/index.ts +22 -5
- package/src/cli/config.ts +1 -1
- package/src/cli/doctor/app.ts +75 -23
- package/src/cli/doctor/eject.ts +30 -10
- package/src/cli/doctor/guards.ts +11 -8
- package/src/cli/doctor/hook.ts +1 -1
- package/src/cli/doctor/install.ts +61 -24
- package/src/cli/doctor/translations.ts +13 -4
- package/src/cli/doctor/types.ts +2 -3
- package/src/cli/doctor/wiring.ts +30 -16
- package/src/cli/eject/dropped-slots.ts +11 -0
- package/src/cli/eject/index.ts +13 -9
- package/src/cli/help.ts +34 -10
- package/src/cli/index.ts +56 -14
- package/src/cli/init/index.ts +64 -5
- package/src/cli/init/locales.ts +41 -8
- package/src/cli/init/router-seeds.ts +17 -3
- package/src/cli/init/steps.ts +308 -41
- package/src/cli/lint/baseline.ts +141 -0
- package/src/cli/lint/engine.ts +33 -10
- package/src/cli/lint/hook.ts +11 -3
- package/src/cli/lint/index.ts +77 -12
- package/src/cli/manifest.ts +132 -4
- package/src/cli/migrate/census.ts +35 -1
- package/src/cli/migrate/index.ts +46 -3
- package/src/cli/migrate/lost-classes.ts +203 -0
- package/src/cli/migrate/rows.ts +21 -0
- package/src/cli/package-manager.ts +4 -1
- package/src/cli/peers.ts +11 -0
- package/src/cli/presets.ts +32 -11
- package/src/cli/resolver.ts +58 -10
- package/src/cli/router-wiring.ts +3 -1
- package/src/cli/sync/engine.ts +30 -14
- package/src/cli/sync/index.ts +7 -4
- package/src/cli/sync/render.ts +29 -37
- package/src/cli/tokens-css.ts +42 -5
- package/src/controls/contract.ts +2 -0
- package/src/controls/control-home.tsx +15 -4
- package/src/controls/local-control.ts +49 -3
- package/src/core/cn.ts +9 -5
- package/src/core/frame-figure.tsx +7 -1
- package/src/core/frame-head.tsx +32 -6
- package/src/core/frame-regions.tsx +18 -8
- package/src/core/info-hint.tsx +26 -0
- package/src/core/mark-tone.ts +10 -3
- package/src/core/mark-types.ts +4 -2
- package/src/core/messages/chain.ts +2 -1
- package/src/core/messages/index.ts +4 -0
- package/src/core/messages/runs.ts +40 -0
- package/src/core/phase.ts +22 -2
- package/src/core/ports.ts +13 -1
- package/src/core/provider.tsx +7 -3
- package/src/core/scheme.ts +6 -2
- package/src/core/spark/mini-bars.tsx +59 -15
- package/src/core/spark/sparkline.tsx +26 -4
- package/src/css/bridge.css +63 -0
- package/src/css/generate.ts +40 -3
- package/src/data/live/live-query.ts +4 -3
- package/src/lint/preset.ts +52 -13
- package/src/lint/rules/class/table.ts +3 -1
- package/src/lint/rules/structure/control-home.ts +1 -1
- package/src/lint/rules/structure/import-boundary.ts +2 -0
- package/src/lint/rules/structure/label-literal.ts +3 -1
- package/src/lint/shadcn.ts +91 -0
- package/src/lint/stylelint/render.ts +31 -1
- package/src/lint/stylelint/rules.ts +19 -7
- package/src/lint/weakened.ts +59 -1
- package/src/messages/de.ts +20 -0
- package/src/messages/es.ts +20 -0
- package/src/messages/fr.ts +20 -0
- package/src/messages/zh-hans.ts +20 -0
- package/src/page/bar-title.tsx +35 -0
- package/src/page/contract.ts +11 -1
- package/src/page/empty-state.tsx +18 -8
- package/src/page/facts.tsx +43 -5
- package/src/page/index.ts +8 -0
- package/src/page/page-bar.tsx +2 -9
- package/src/page/page-summary.tsx +4 -3
- package/src/page/run-button.tsx +52 -0
- package/src/page/run-list.tsx +151 -0
- package/src/page/run-queue.ts +185 -0
- package/src/page/section.tsx +30 -5
- package/src/shell/commands/command-palette.tsx +10 -1
- package/src/shell/parts/header.tsx +1 -1
- package/src/surfaces.ts +18 -1
- package/src/testing/index.ts +1 -0
- package/src/testing/pseudo-locale.ts +149 -0
- package/src/testing/quality.ts +188 -0
- package/src/tokens/bridge-sheet.ts +80 -0
- package/src/tokens/emit.ts +45 -6
- package/src/ui/accordion.tsx +1 -1
- package/src/ui/card.tsx +56 -6
- package/src/ui/collapsible.tsx +5 -3
- package/src/ui/combobox.tsx +1 -1
- package/src/ui/meter.guard.ts +23 -0
- package/src/ui/meter.tsx +76 -27
- package/src/ui/no-restyle.generated.json +8 -0
- package/src/ui/primitive.contract.ts +7 -0
- package/src/ui/remote-pad.guard.ts +24 -0
- package/src/ui/remote-pad.tsx +249 -0
- package/src/ui/segmented.tsx +6 -0
- package/src/ui/skeleton.guard.ts +7 -2
- package/src/ui/skeleton.tsx +10 -4
- package/src/ui/slots.ts +2 -1
- package/src/vite/allotment.ts +15 -1
- package/src/vite/doc.ts +12 -2
- package/src/vite/head.ts +4 -3
- package/src/vite/index.ts +4 -1
- package/src/vite/shell-worker.ts +115 -0
package/dist/page/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export { ArticleLayout } from './article-layout.js';
|
|
|
18
18
|
export { ToastHost } from './toast-host.js';
|
|
19
19
|
export { Page } from './page.js';
|
|
20
20
|
export { PageBar } from './page-bar.js';
|
|
21
|
+
export { BarTitle } from './bar-title.js';
|
|
22
|
+
export type { BarTitleProps } from './bar-title.js';
|
|
21
23
|
export { PageAside } from './page-aside.js';
|
|
22
24
|
export { Facts } from './facts.js';
|
|
23
25
|
export { PropertyList, controlProperty } from './property-list.js';
|
|
@@ -32,6 +34,12 @@ export { ConnectionIndicator } from './connection-indicator.js';
|
|
|
32
34
|
export type { ConnectionIndicatorProps } from './connection-indicator.js';
|
|
33
35
|
export { RefreshButton } from './refresh-button.js';
|
|
34
36
|
export type { RefreshButtonProps } from './refresh-button.js';
|
|
37
|
+
export { createRunQueue, useRuns } from './run-queue.js';
|
|
38
|
+
export type { Run, RunQueue, RunResult, RunTask } from './run-queue.js';
|
|
39
|
+
export { RunButton } from './run-button.js';
|
|
40
|
+
export type { RunButtonProps } from './run-button.js';
|
|
41
|
+
export { RunList } from './run-list.js';
|
|
42
|
+
export type { RunListProps } from './run-list.js';
|
|
35
43
|
export { Dock } from './dock.js';
|
|
36
44
|
export type { DockProps } from './dock.js';
|
|
37
45
|
export { FavoriteToggle, useFavorite } from './favorites.js';
|
package/dist/page/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC/D,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,YAAY,EAAE,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T,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,cAAc,GACf,MAAM,YAAY,CAAA"}
|
package/dist/page/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { ArticleLayout } from "./article-layout.js";
|
|
|
12
12
|
import { ToastHost } from "./toast-host.js";
|
|
13
13
|
import { Page } from "./page.js";
|
|
14
14
|
import { PageBar } from "./page-bar.js";
|
|
15
|
+
import { BarTitle } from "./bar-title.js";
|
|
15
16
|
import { PageAside } from "./page-aside.js";
|
|
16
17
|
import { Facts } from "./facts.js";
|
|
17
18
|
import { PropertyList, controlProperty } from "./property-list.js";
|
|
@@ -22,11 +23,15 @@ import { InnerNav } from "./parts/inner-nav.js";
|
|
|
22
23
|
import { mdxComponents } from "./mdx.js";
|
|
23
24
|
import { ConnectionIndicator } from "./connection-indicator.js";
|
|
24
25
|
import { RefreshButton } from "./refresh-button.js";
|
|
26
|
+
import { createRunQueue, useRuns } from "./run-queue.js";
|
|
27
|
+
import { RunButton } from "./run-button.js";
|
|
28
|
+
import { RunList } from "./run-list.js";
|
|
25
29
|
import { Dock } from "./dock.js";
|
|
26
30
|
import { FavoriteToggle, useFavorite } from "./favorites.js";
|
|
27
31
|
import { Peek } from "./peek.js";
|
|
28
32
|
export {
|
|
29
33
|
ArticleLayout,
|
|
34
|
+
BarTitle,
|
|
30
35
|
Callout,
|
|
31
36
|
CardGrid,
|
|
32
37
|
ConnectionIndicator,
|
|
@@ -45,14 +50,18 @@ export {
|
|
|
45
50
|
Prose,
|
|
46
51
|
QueryState,
|
|
47
52
|
RefreshButton,
|
|
53
|
+
RunButton,
|
|
54
|
+
RunList,
|
|
48
55
|
Section,
|
|
49
56
|
SettingsLayout,
|
|
50
57
|
SplitPage,
|
|
51
58
|
ToastHost,
|
|
52
59
|
Toc,
|
|
53
60
|
controlProperty,
|
|
61
|
+
createRunQueue,
|
|
54
62
|
defineOverlays,
|
|
55
63
|
mdxComponents,
|
|
56
64
|
useFavorite,
|
|
65
|
+
useRuns,
|
|
57
66
|
useSizeClass
|
|
58
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-bar.d.ts","sourceRoot":"","sources":["../../src/page/page-bar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2B,YAAY,EAAa,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"page-bar.d.ts","sourceRoot":"","sources":["../../src/page/page-bar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2B,YAAY,EAAa,MAAM,OAAO,CAAA;AAsB7E,OAAO,KAAK,EAEV,YAAY,EAOb,MAAM,YAAY,CAAA;AAOnB,KAAK,MAAM,GAAG,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAA;AAajD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,GAAG,YAAY,CAiBf;AA4VD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAC5E,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,UAAU,EACV,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,GACR,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CAuN1C"}
|
package/dist/page/page-bar.js
CHANGED
|
@@ -14,6 +14,7 @@ import { Kbd } from "basalt-ui/ui/kbd";
|
|
|
14
14
|
import { EntityTitle } from "basalt-ui/ui/entity";
|
|
15
15
|
import { Input } from "basalt-ui/ui/input";
|
|
16
16
|
import { Menu, MenuContent, MenuItem, MenuTrigger } from "basalt-ui/ui/menu";
|
|
17
|
+
import { BAR_TITLE } from "./bar-title.js";
|
|
17
18
|
import { ConnectionIndicator } from "./connection-indicator.js";
|
|
18
19
|
import { FavoriteToggle } from "./favorites.js";
|
|
19
20
|
import { CLOSE, Glyph, PanelSteps } from "./panel-steps.js";
|
|
@@ -401,13 +402,7 @@ function PageBar({
|
|
|
401
402
|
...identity.avatar !== void 0 && { avatar: identity.avatar },
|
|
402
403
|
...identity.tags !== void 0 && { tags: identity.tags }
|
|
403
404
|
}
|
|
404
|
-
) : /* @__PURE__ */ jsx(
|
|
405
|
-
"h1",
|
|
406
|
-
{
|
|
407
|
-
className: inShell ? "sr-only" : "m-0 min-w-0 font-head text-lg font-semibold tracking-tight text-balance text-foreground",
|
|
408
|
-
children: title
|
|
409
|
-
}
|
|
410
|
-
);
|
|
405
|
+
) : /* @__PURE__ */ jsx("h1", { className: inShell ? "sr-only" : BAR_TITLE, children: title });
|
|
411
406
|
if (!bandHasContent) return /* @__PURE__ */ jsx(Fragment, { children: heading });
|
|
412
407
|
const sticky = hasControls;
|
|
413
408
|
const trail = inShell || parent === void 0 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -5,7 +5,8 @@ import type { Phase, QueryStateLike } from '../core/ports.js';
|
|
|
5
5
|
* A fact is a node, or a label and a value as a footer fact is: `{ label: 'Last reindex', value,
|
|
6
6
|
* mono: true }` sets a time or an id in the mono face, which a node cannot ask for.
|
|
7
7
|
*/
|
|
8
|
-
type
|
|
8
|
+
type SummaryFact = Pick<LabelledFact, 'label' | 'value' | 'mono'>;
|
|
9
|
+
type Fact = ReactNode | SummaryFact | null | false | undefined;
|
|
9
10
|
type PageSummaryContent = {
|
|
10
11
|
/** The headline sentence. It must state a live number: never describe the page. */
|
|
11
12
|
sentence: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-summary.d.ts","sourceRoot":"","sources":["../../src/page/page-summary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOpD,OAAO,KAAK,EAAa,IAAI,IAAI,YAAY,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAK1D;;;GAGG;AACH,KAAK,IAAI,GAAG,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"page-summary.d.ts","sourceRoot":"","sources":["../../src/page/page-summary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOpD,OAAO,KAAK,EAAa,IAAI,IAAI,YAAY,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAK1D;;;GAGG;AACH,KAAK,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC,CAAA;AACjE,KAAK,IAAI,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,CAAA;AAE9D,KAAK,kBAAkB,GAAG;IACxB,mFAAmF;IACnF,QAAQ,EAAE,SAAS,CAAA;IACnB,yGAAyG;IACzG,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAA;IACvB,sDAAsD;IACtD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED;;;;GAIG;AACH,KAAK,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,GAAG;IACrE,KAAK,EAAE,KAAK,GAAG,cAAc,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,kBAAkB,CAAA;AAkDtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAsFjE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { ButtonProps } from 'basalt-ui/ui/button';
|
|
3
|
+
import type { RunQueue, RunTask } from './run-queue.js';
|
|
4
|
+
export type RunButtonProps<D = unknown> = ButtonProps & {
|
|
5
|
+
queue: RunQueue<D>;
|
|
6
|
+
task: RunTask<D>;
|
|
7
|
+
/** Stays pressable while its runs are open: a remote key pressed three times in a row. */
|
|
8
|
+
repeatable?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A button that starts a task on a queue and is busy until that task's latest run has ended. Its
|
|
12
|
+
* `data-action` is the latest run's phase, `idle` before the first. Where the outcome shows is
|
|
13
|
+
* `RunList`'s job.
|
|
14
|
+
*
|
|
15
|
+
* @useWhen a press sends a command that takes seconds
|
|
16
|
+
* @neverWhen the press is local and instant (use `Button`), or it submits a form (use the form's submit)
|
|
17
|
+
* @instead Button
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <RunButton queue={commands} task={tvOn} variant="primary">TV on</RunButton>
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <RunButton queue={commands} task={volumeUp} repeatable>Volume up</RunButton>
|
|
24
|
+
*/
|
|
25
|
+
export declare function RunButton<D = unknown>({ queue, task, repeatable, onClick, loading, ...props }: RunButtonProps<D>): ReactElement;
|
|
26
|
+
//# sourceMappingURL=run-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-button.d.ts","sourceRoot":"","sources":["../../src/page/run-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAEpD,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,OAAO,IAAI,WAAW,GAAG;IACtD,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;IAClB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IAChB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,EACrC,KAAK,EACL,IAAI,EACJ,UAAkB,EAClB,OAAO,EACP,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,YAAY,CAgBlC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "basalt-ui/ui/button";
|
|
3
|
+
import { useRuns } from "./run-queue.js";
|
|
4
|
+
function RunButton({
|
|
5
|
+
queue,
|
|
6
|
+
task,
|
|
7
|
+
repeatable = false,
|
|
8
|
+
onClick,
|
|
9
|
+
loading,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
const latest = useRuns(queue).find((run) => run.task === task.id);
|
|
13
|
+
const busy = latest?.phase === "running" || latest?.phase === "waiting";
|
|
14
|
+
const press = (event) => {
|
|
15
|
+
onClick?.(event);
|
|
16
|
+
if (!event.defaultPrevented) queue.start(task);
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
Button,
|
|
20
|
+
{
|
|
21
|
+
type: "button",
|
|
22
|
+
...props,
|
|
23
|
+
loading: loading === true || busy && !repeatable,
|
|
24
|
+
"data-action": latest?.phase ?? "idle",
|
|
25
|
+
onClick: press
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
RunButton
|
|
31
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { RunQueue } from './run-queue.js';
|
|
3
|
+
/** How long a finished run stays on the list, ms. A failed one stays until dismissed. */
|
|
4
|
+
export declare const DONE_VISIBLE_MS = 8000;
|
|
5
|
+
export type RunListProps<D = unknown> = {
|
|
6
|
+
queue: RunQueue<D>;
|
|
7
|
+
/** Only runs that hold one of these lanes; every run when left out. */
|
|
8
|
+
lanes?: readonly string[] | undefined;
|
|
9
|
+
/** The list's accessible name. Default `Runs`. */
|
|
10
|
+
label?: string | undefined;
|
|
11
|
+
/** Layout only (`mt-4`). */
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The runs of a queue as the reader needs them: what runs and for how long, what waits behind it,
|
|
16
|
+
* what just finished with its steps, and a failed run with the failing step's text until dismissed.
|
|
17
|
+
* A polite live list: a change of state is announced, the ticking elapsed time is not, and a
|
|
18
|
+
* failure is an `alert`, announced at once. Each row carries `data-run` with its phase.
|
|
19
|
+
*
|
|
20
|
+
* @useWhen commands started with `RunButton` or a queue need their outcome on the page
|
|
21
|
+
* @neverWhen the history is data from a server (use `EventList`), or one passing note is enough (use `notify`)
|
|
22
|
+
* @instead EventList, notify
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <RunList queue={commands} lanes={['living-room']} />
|
|
26
|
+
*/
|
|
27
|
+
export declare function RunList<D = unknown>({ queue, lanes, label, className, }: RunListProps<D>): ReactElement;
|
|
28
|
+
//# sourceMappingURL=run-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-list.d.ts","sourceRoot":"","sources":["../../src/page/run-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAYzC,OAAO,KAAK,EAAO,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEhD,yFAAyF;AACzF,eAAO,MAAM,eAAe,OAAO,CAAA;AAEnC,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI;IACtC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;IAClB,uEAAuE;IACvE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IACrC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAWD;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,EACnC,KAAK,EACL,KAAK,EACL,KAAK,EACL,SAAS,GACV,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAyBhC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../core/cn.js";
|
|
3
|
+
import { common } from "../core/messages/common.js";
|
|
4
|
+
import { runs as runMessages } from "../core/messages/runs.js";
|
|
5
|
+
import { useMessages } from "../core/messages/use-messages.js";
|
|
6
|
+
import { useNow } from "../core/use-now.js";
|
|
7
|
+
import { Alert } from "basalt-ui/ui/alert";
|
|
8
|
+
import { Badge } from "basalt-ui/ui/badge";
|
|
9
|
+
import { Button } from "basalt-ui/ui/button";
|
|
10
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "basalt-ui/ui/collapsible";
|
|
11
|
+
import { Status } from "basalt-ui/ui/status";
|
|
12
|
+
import { useRuns } from "./run-queue.js";
|
|
13
|
+
const DONE_VISIBLE_MS = 8e3;
|
|
14
|
+
const RANK = { running: 0, waiting: 1, failed: 2, done: 2 };
|
|
15
|
+
function order(a, b) {
|
|
16
|
+
const rank = RANK[a.phase] - RANK[b.phase];
|
|
17
|
+
if (rank !== 0) return rank;
|
|
18
|
+
return a.phase === "waiting" ? a.id - b.id : b.id - a.id;
|
|
19
|
+
}
|
|
20
|
+
function RunList({
|
|
21
|
+
queue,
|
|
22
|
+
lanes,
|
|
23
|
+
label,
|
|
24
|
+
className
|
|
25
|
+
}) {
|
|
26
|
+
const t = useMessages(runMessages);
|
|
27
|
+
const list = useRuns(queue);
|
|
28
|
+
const now = useNow(1e3);
|
|
29
|
+
const shown = list.filter((run) => lanes === void 0 || run.lanes.some((lane) => lanes.includes(lane))).filter(
|
|
30
|
+
(run) => run.phase !== "done" || run.finishedAt === null || now - run.finishedAt < DONE_VISIBLE_MS
|
|
31
|
+
).toSorted(order);
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
"ul",
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "run-list",
|
|
36
|
+
"aria-live": "polite",
|
|
37
|
+
"aria-label": label ?? t("runs.list"),
|
|
38
|
+
className: cn("m-0 flex list-none flex-col gap-2 p-0", className),
|
|
39
|
+
children: shown.map((run) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RunRow, { run, now, onDismiss: () => queue.dismiss(run.id) }) }, run.id))
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function RunRow({ run, now, onDismiss }) {
|
|
44
|
+
const t = useMessages(runMessages, common);
|
|
45
|
+
if (run.phase === "failed") {
|
|
46
|
+
return /* @__PURE__ */ jsxs(Alert, { tone: "bad", title: t("runs.failed", run.label), "data-run": "failed", children: [
|
|
47
|
+
/* @__PURE__ */ jsx("p", { className: "m-0", children: run.error }),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: "-ms-2 flex flex-wrap items-start gap-2", children: [
|
|
49
|
+
/* @__PURE__ */ jsx(RunSteps, { run }),
|
|
50
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onDismiss, children: t("common.dismiss") })
|
|
51
|
+
] })
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
const spent = run.startedAt === null ? 0 : Math.max(0, (run.finishedAt ?? now) - run.startedAt);
|
|
55
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 text-sm", "data-run": run.phase, children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
57
|
+
run.phase === "waiting" && /* @__PURE__ */ jsx(Status, { tone: "neutral", children: t("runs.waiting") }),
|
|
58
|
+
run.phase === "running" && /* @__PURE__ */ jsx(Status, { tone: "accent", children: t("runs.running") }),
|
|
59
|
+
run.phase === "done" && /* @__PURE__ */ jsx(Status, { tone: "good", children: t("common.done") }),
|
|
60
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 font-medium wrap-anywhere", children: run.label }),
|
|
61
|
+
run.note !== null && /* @__PURE__ */ jsx(Badge, { tone: "info", children: run.note })
|
|
62
|
+
] }),
|
|
63
|
+
run.phase === "waiting" && /* @__PURE__ */ jsx("p", { className: "m-0 text-muted-foreground", children: t("runs.waitingHint") }),
|
|
64
|
+
run.phase === "running" && /* @__PURE__ */ jsx("p", { className: "m-0 text-muted-foreground tabular-nums", "aria-live": "off", children: t("runs.elapsed", spent) }),
|
|
65
|
+
run.phase === "done" && run.startedAt !== null && /* @__PURE__ */ jsx("p", { className: "m-0 text-muted-foreground tabular-nums", children: t("runs.finished", spent) }),
|
|
66
|
+
run.phase === "done" && /* @__PURE__ */ jsx("div", { className: "-ms-2", children: /* @__PURE__ */ jsx(RunSteps, { run }) })
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
function RunSteps({ run }) {
|
|
70
|
+
const t = useMessages(runMessages);
|
|
71
|
+
if (run.steps.length === 0) return null;
|
|
72
|
+
return /* @__PURE__ */ jsxs(Collapsible, { children: [
|
|
73
|
+
/* @__PURE__ */ jsx(CollapsibleTrigger, { render: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost" }), children: t("runs.steps", run.steps.length) }),
|
|
74
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("ol", { className: "m-0 list-none p-0 text-sm", children: run.steps.map((step, index) => (
|
|
75
|
+
// oxlint-disable-next-line react/no-array-index-key -- the steps of a finished run never reorder
|
|
76
|
+
/* @__PURE__ */ jsxs("li", { className: "wrap-anywhere", children: [
|
|
77
|
+
step.ok ? t("runs.stepOk") : t("runs.stepFailed"),
|
|
78
|
+
": ",
|
|
79
|
+
step.label,
|
|
80
|
+
step.detail === void 0 ? "" : ` (${step.detail})`
|
|
81
|
+
] }, index)
|
|
82
|
+
)) }) })
|
|
83
|
+
] });
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
DONE_VISIBLE_MS,
|
|
87
|
+
RunList
|
|
88
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export type RunPhase = 'waiting' | 'running' | 'done' | 'failed';
|
|
2
|
+
/** One line of what a task did: shown under the run, and the failing one beside its error. */
|
|
3
|
+
export type RunStep = {
|
|
4
|
+
label: string;
|
|
5
|
+
ok: boolean;
|
|
6
|
+
detail?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/** What a task resolves with. `error` marks the run failed; a throw does the same. */
|
|
9
|
+
export type RunResult<D = unknown> = {
|
|
10
|
+
/** The failing step's text, as the reader should read it. */
|
|
11
|
+
error?: string | undefined;
|
|
12
|
+
steps?: readonly RunStep[] | undefined;
|
|
13
|
+
/** A short word beside a finished run (`Dry run`). */
|
|
14
|
+
note?: string | undefined;
|
|
15
|
+
/** The app's own read-back, kept on the run. */
|
|
16
|
+
data?: D | undefined;
|
|
17
|
+
};
|
|
18
|
+
/** A command the app can start. */
|
|
19
|
+
export type RunTask<D = unknown> = {
|
|
20
|
+
/** Identity: every button of the same `id` shows the same latest run. */
|
|
21
|
+
id: string;
|
|
22
|
+
/** The words the run list shows. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** The server queues the command holds; none means it waits for nothing. */
|
|
25
|
+
lanes?: readonly string[] | undefined;
|
|
26
|
+
run: () => Promise<RunResult<D> | void>;
|
|
27
|
+
};
|
|
28
|
+
export type Run<D = unknown> = {
|
|
29
|
+
readonly id: number;
|
|
30
|
+
readonly task: string;
|
|
31
|
+
readonly label: string;
|
|
32
|
+
readonly lanes: readonly string[];
|
|
33
|
+
readonly phase: RunPhase;
|
|
34
|
+
/** Epoch ms it began to run; `null` while waiting. */
|
|
35
|
+
readonly startedAt: number | null;
|
|
36
|
+
readonly finishedAt: number | null;
|
|
37
|
+
readonly error: string | null;
|
|
38
|
+
readonly steps: readonly RunStep[];
|
|
39
|
+
readonly note: string | null;
|
|
40
|
+
readonly data: D | null;
|
|
41
|
+
};
|
|
42
|
+
export type RunQueue<D = unknown> = {
|
|
43
|
+
/** Calls the task now and returns the run's id. */
|
|
44
|
+
start(task: RunTask<D>): number;
|
|
45
|
+
/** Removes a finished run. */
|
|
46
|
+
dismiss(id: number): void;
|
|
47
|
+
/** Newest first; stable until something changes. */
|
|
48
|
+
runs(): readonly Run<D>[];
|
|
49
|
+
subscribe(listener: () => void): () => void;
|
|
50
|
+
};
|
|
51
|
+
/** Done runs kept. Open and failed runs are never dropped: a failure leaves only by `dismiss`. */
|
|
52
|
+
export declare const RUNS_KEPT = 30;
|
|
53
|
+
/**
|
|
54
|
+
* Makes one queue of runs, usually one per app, at module level. Give it to `RunButton` and
|
|
55
|
+
* `RunList`; read it in a control of your own with `useRuns`.
|
|
56
|
+
*
|
|
57
|
+
* @useWhen a command takes seconds and the reader must see it running, waiting behind another, done or failed
|
|
58
|
+
* @neverWhen the call is instant or its result shows in the data itself (use a mutation and `notify`)
|
|
59
|
+
* @instead notify, optimistic
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* export const commands = createRunQueue()
|
|
63
|
+
* commands.start({ id: 'tv-on', label: 'TV on', lanes: ['living-room'], run: () => post('/tv/on') })
|
|
64
|
+
*/
|
|
65
|
+
export declare function createRunQueue<D = unknown>(): RunQueue<D>;
|
|
66
|
+
/**
|
|
67
|
+
* The queue's runs, newest first, re-read on every change. For a control that is not a button: a
|
|
68
|
+
* slider that holds the picked value until its command has answered.
|
|
69
|
+
*
|
|
70
|
+
* @useWhen a part of your own follows a queue's runs
|
|
71
|
+
* @neverWhen a button or a list is enough (use `RunButton`, `RunList`)
|
|
72
|
+
* @instead RunButton, RunList
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* const pending = useRuns(commands).find((run) => run.task === 'volume')
|
|
76
|
+
*/
|
|
77
|
+
export declare function useRuns<D>(queue: RunQueue<D>): readonly Run<D>[];
|
|
78
|
+
//# sourceMappingURL=run-queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-queue.d.ts","sourceRoot":"","sources":["../../src/page/run-queue.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAA;AAEhE,8FAA8F;AAC9F,MAAM,MAAM,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AAEjF,sFAAsF;AACtF,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAAI;IACnC,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,CAAA;IACtC,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,gDAAgD;IAChD,IAAI,CAAC,EAAE,CAAC,GAAG,SAAS,CAAA;CACrB,CAAA;AAED,mCAAmC;AACnC,MAAM,MAAM,OAAO,CAAC,CAAC,GAAG,OAAO,IAAI;IACjC,yEAAyE;IACzE,EAAE,EAAE,MAAM,CAAA;IACV,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,4EAA4E;IAC5E,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GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,GAAG,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAwEzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,CAEhE"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
import { toErrorMessage } from "../common/errors.js";
|
|
3
|
+
const RUNS_KEPT = 30;
|
|
4
|
+
const finished = (run) => run.phase === "done" || run.phase === "failed";
|
|
5
|
+
function promote(list) {
|
|
6
|
+
const holder = /* @__PURE__ */ new Map();
|
|
7
|
+
for (const run of list.toReversed()) {
|
|
8
|
+
if (finished(run)) continue;
|
|
9
|
+
for (const lane of run.lanes) if (!holder.has(lane)) holder.set(lane, run.id);
|
|
10
|
+
}
|
|
11
|
+
const now = Date.now();
|
|
12
|
+
return list.map(
|
|
13
|
+
(run) => run.phase === "waiting" && run.lanes.every((lane) => holder.get(lane) === run.id) ? { ...run, phase: "running", startedAt: now } : run
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function trim(list) {
|
|
17
|
+
let kept = 0;
|
|
18
|
+
return list.filter((run) => run.phase !== "done" || ++kept <= RUNS_KEPT);
|
|
19
|
+
}
|
|
20
|
+
function createRunQueue() {
|
|
21
|
+
let list = [];
|
|
22
|
+
let sequence = 0;
|
|
23
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
24
|
+
const commit = (next) => {
|
|
25
|
+
list = trim(promote(next));
|
|
26
|
+
for (const listener of listeners) listener();
|
|
27
|
+
};
|
|
28
|
+
const finish = (id, result) => {
|
|
29
|
+
const finishedAt = Date.now();
|
|
30
|
+
commit(
|
|
31
|
+
list.map(
|
|
32
|
+
(run) => run.id === id ? {
|
|
33
|
+
...run,
|
|
34
|
+
phase: result.error === void 0 ? "done" : "failed",
|
|
35
|
+
finishedAt,
|
|
36
|
+
error: result.error ?? null,
|
|
37
|
+
steps: result.steps ?? [],
|
|
38
|
+
note: result.note ?? null,
|
|
39
|
+
data: result.data ?? null
|
|
40
|
+
} : run
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
const execute = async (id, task) => {
|
|
45
|
+
let result;
|
|
46
|
+
try {
|
|
47
|
+
result = await task.run() ?? {};
|
|
48
|
+
} catch (error) {
|
|
49
|
+
result = { error: toErrorMessage(error) };
|
|
50
|
+
}
|
|
51
|
+
finish(id, result);
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
start(task) {
|
|
55
|
+
sequence += 1;
|
|
56
|
+
const run = {
|
|
57
|
+
id: sequence,
|
|
58
|
+
task: task.id,
|
|
59
|
+
label: task.label,
|
|
60
|
+
lanes: task.lanes ?? [],
|
|
61
|
+
phase: "waiting",
|
|
62
|
+
startedAt: null,
|
|
63
|
+
finishedAt: null,
|
|
64
|
+
error: null,
|
|
65
|
+
steps: [],
|
|
66
|
+
note: null,
|
|
67
|
+
data: null
|
|
68
|
+
};
|
|
69
|
+
commit([run, ...list]);
|
|
70
|
+
void execute(run.id, task);
|
|
71
|
+
return run.id;
|
|
72
|
+
},
|
|
73
|
+
dismiss(id) {
|
|
74
|
+
const next = list.filter((run) => run.id !== id || !finished(run));
|
|
75
|
+
if (next.length !== list.length) commit(next);
|
|
76
|
+
},
|
|
77
|
+
runs: () => list,
|
|
78
|
+
subscribe(listener) {
|
|
79
|
+
listeners.add(listener);
|
|
80
|
+
return () => {
|
|
81
|
+
listeners.delete(listener);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function useRuns(queue) {
|
|
87
|
+
return useSyncExternalStore(queue.subscribe, queue.runs, queue.runs);
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
RUNS_KEPT,
|
|
91
|
+
createRunQueue,
|
|
92
|
+
useRuns
|
|
93
|
+
};
|
package/dist/page/section.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { SectionProps } from './contract.js';
|
|
3
3
|
/**
|
|
4
|
-
* A titled part of a page: an `h2
|
|
4
|
+
* A titled part of a page: an `h2` (`h3` with `headingLevel={3}`), an optional controls slot on the
|
|
5
|
+
* same row and the body. The
|
|
5
6
|
* section is a named region and a scroll anchor: its `id` is the slug of `title`, and its scroll
|
|
6
7
|
* margin is `--basalt-page-sticky-top`, so a `#hash` jump, a skip link or `scrollIntoView` lands the
|
|
7
8
|
* heading just below the page band instead of under it. Outside a `Page` the offset is zero.
|
|
@@ -9,6 +10,10 @@ import type { SectionProps } from './contract.js';
|
|
|
9
10
|
* `tabs` is the section's view switch: `{ state, label }` of an enum field draws a tab strip
|
|
10
11
|
* bound to it, a `ControlsSlot` renders as is.
|
|
11
12
|
*
|
|
13
|
+
* `info` puts the card head's definition glyph beside the title and `divided` rules a hairline under
|
|
14
|
+
* the row. There is no free node beside the title: words go in `summary`, a control in `controls`
|
|
15
|
+
* (`filterSlot.custom` for your own) or `tabs`.
|
|
16
|
+
*
|
|
12
17
|
* `summary` is one line beside the title, shown while the section is collapsed too. `collapsible`
|
|
13
18
|
* makes the heading the trigger of a region around the body: `defaultOpen` for an uncontrolled
|
|
14
19
|
* section (open unless `false`), `state` (a boolean field) for one the URL or the device remembers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/page/section.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/page/section.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAOzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CASvF"}
|
package/dist/page/section.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
+
import { cn } from "../core/cn.js";
|
|
4
|
+
import { InfoGlyph, InfoText } from "../core/info-hint.js";
|
|
3
5
|
import { headingSlug } from "../core/slug.js";
|
|
4
6
|
import { SlotHomeContext } from "../core/slot-home.js";
|
|
5
7
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "basalt-ui/ui/collapsible";
|
|
@@ -44,12 +46,16 @@ function SectionFrame({
|
|
|
44
46
|
controls,
|
|
45
47
|
tabs,
|
|
46
48
|
children,
|
|
49
|
+
headingLevel = 2,
|
|
50
|
+
info,
|
|
51
|
+
divided,
|
|
47
52
|
collapse
|
|
48
53
|
}) {
|
|
49
54
|
const headingId = useId();
|
|
50
55
|
const anchor = headingSlug(title);
|
|
56
|
+
const Heading = headingLevel === 3 ? "h3" : "h2";
|
|
51
57
|
const heading = /* @__PURE__ */ jsx(
|
|
52
|
-
|
|
58
|
+
Heading,
|
|
53
59
|
{
|
|
54
60
|
id: headingId,
|
|
55
61
|
className: "m-0 min-w-0 font-head text-md font-semibold tracking-tight word-head text-foreground",
|
|
@@ -59,21 +65,33 @@ function SectionFrame({
|
|
|
59
65
|
] })
|
|
60
66
|
}
|
|
61
67
|
);
|
|
62
|
-
const header = /* @__PURE__ */ jsxs(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
const header = /* @__PURE__ */ jsxs(
|
|
69
|
+
"header",
|
|
70
|
+
{
|
|
71
|
+
className: cn(
|
|
72
|
+
"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2",
|
|
73
|
+
divided === true && "border-b border-border pb-2"
|
|
74
|
+
),
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-wrap items-baseline gap-x-3", children: [
|
|
77
|
+
info === void 0 || info.length === 0 ? heading : /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
78
|
+
heading,
|
|
79
|
+
/* @__PURE__ */ jsx(InfoGlyph, { title, className: "-my-0.5", children: /* @__PURE__ */ jsx(InfoText, { info }) })
|
|
80
|
+
] }),
|
|
81
|
+
summary !== void 0 && summary !== "" && /* @__PURE__ */ jsx("p", { "data-slot": "section-summary", className: "m-0 min-w-0 text-sm text-muted-foreground", children: summary })
|
|
82
|
+
] }),
|
|
83
|
+
!isEmptyTabs(tabs) && /* @__PURE__ */ jsx(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
"data-slot": "section-tabs",
|
|
87
|
+
className: "flex min-w-0 items-center @max-regular:block @max-regular:basis-full",
|
|
88
|
+
children: renderTabs(tabs, "segment")
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
controls !== void 0 && controls.count > 0 && /* @__PURE__ */ jsx("div", { "data-slot": "section-controls", className: "flex min-w-0 flex-wrap items-center gap-2", children: /* @__PURE__ */ jsx(SlotHomeContext, { value: "section-header", children: controls.render() }) })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
77
95
|
return /* @__PURE__ */ jsx(
|
|
78
96
|
"section",
|
|
79
97
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../src/shell/commands/command-palette.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAuC,YA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AAG,YAAY,CAqNpC"}
|
|
@@ -30,6 +30,9 @@ const LazyPaletteSheet = lazy(async () => ({
|
|
|
30
30
|
default: (await import("./palette-sheet.js")).PaletteSheet
|
|
31
31
|
}));
|
|
32
32
|
const NO_SOURCES = [];
|
|
33
|
+
function focusSearch() {
|
|
34
|
+
return document.querySelector('[data-slot="command-palette"] input');
|
|
35
|
+
}
|
|
33
36
|
function CommandPalette({
|
|
34
37
|
commands,
|
|
35
38
|
rank = defaultRank,
|
|
@@ -173,6 +176,7 @@ function CommandPalette({
|
|
|
173
176
|
slot: "autocomplete-content",
|
|
174
177
|
className: "relative max-h-80 overflow-y-auto outline-none",
|
|
175
178
|
container: listHost ?? void 0,
|
|
179
|
+
popupProps: { role: "presentation" },
|
|
176
180
|
children: /* @__PURE__ */ jsx(
|
|
177
181
|
OptionListBody,
|
|
178
182
|
{
|
|
@@ -219,7 +223,7 @@ function CommandPalette({
|
|
|
219
223
|
}
|
|
220
224
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
221
225
|
/* @__PURE__ */ jsx(ShortcutOverlay, { commands }),
|
|
222
|
-
/* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx(DialogContent, { title: paletteName(t), children: body }) })
|
|
226
|
+
/* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx(DialogContent, { title: paletteName(t), initialFocus: focusSearch, children: body }) })
|
|
223
227
|
] });
|
|
224
228
|
}
|
|
225
229
|
function ResultTrailing({
|