@flyingrobots/bijou-tui 7.0.0 → 7.2.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 +27 -4
- package/dist/accordion.d.ts +3 -108
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +2 -161
- package/dist/accordion.js.map +1 -1
- package/dist/accordion.part01.d.ts +25 -0
- package/dist/accordion.part01.d.ts.map +1 -0
- package/dist/accordion.part01.js +61 -0
- package/dist/accordion.part01.js.map +1 -0
- package/dist/accordion.part02.d.ts +8 -0
- package/dist/accordion.part02.d.ts.map +1 -0
- package/dist/accordion.part02.js +15 -0
- package/dist/accordion.part02.js.map +1 -0
- package/dist/animate.d.ts.map +1 -1
- package/dist/animate.js +5 -6
- package/dist/animate.js.map +1 -1
- package/dist/app-frame-actions.d.ts +1 -18
- package/dist/app-frame-actions.d.ts.map +1 -1
- package/dist/app-frame-actions.js +47 -43
- package/dist/app-frame-actions.js.map +1 -1
- package/dist/app-frame-i18n.d.ts.map +1 -1
- package/dist/app-frame-i18n.js +20 -3
- package/dist/app-frame-i18n.js.map +1 -1
- package/dist/app-frame-overlays.d.ts +9 -1
- package/dist/app-frame-overlays.d.ts.map +1 -1
- package/dist/app-frame-overlays.js +117 -25
- package/dist/app-frame-overlays.js.map +1 -1
- package/dist/app-frame-palette.d.ts +1 -11
- package/dist/app-frame-palette.d.ts.map +1 -1
- package/dist/app-frame-palette.js +19 -18
- package/dist/app-frame-palette.js.map +1 -1
- package/dist/app-frame-render.d.ts +0 -7
- package/dist/app-frame-render.d.ts.map +1 -1
- package/dist/app-frame-render.js +17 -26
- package/dist/app-frame-render.js.map +1 -1
- package/dist/app-frame-types.d.ts +8 -4
- package/dist/app-frame-types.d.ts.map +1 -1
- package/dist/app-frame-types.js +5 -5
- package/dist/app-frame-types.js.map +1 -1
- package/dist/app-frame-utils.d.ts +2 -1
- package/dist/app-frame-utils.d.ts.map +1 -1
- package/dist/app-frame-utils.js +8 -1
- package/dist/app-frame-utils.js.map +1 -1
- package/dist/app-frame.d.ts +75 -4
- package/dist/app-frame.d.ts.map +1 -1
- package/dist/app-frame.js +346 -272
- package/dist/app-frame.js.map +1 -1
- package/dist/app-frame.test-support.part01.d.ts +149 -0
- package/dist/app-frame.test-support.part01.d.ts.map +1 -0
- package/dist/app-frame.test-support.part01.js +106 -0
- package/dist/app-frame.test-support.part01.js.map +1 -0
- package/dist/app-frame.test-support.part02.d.ts +15 -0
- package/dist/app-frame.test-support.part02.d.ts.map +1 -0
- package/dist/app-frame.test-support.part02.js +89 -0
- package/dist/app-frame.test-support.part02.js.map +1 -0
- package/dist/browsable-list.d.ts +5 -5
- package/dist/browsable-list.d.ts.map +1 -1
- package/dist/browsable-list.js.map +1 -1
- package/dist/canvas.d.ts +2 -34
- package/dist/canvas.d.ts.map +1 -1
- package/dist/canvas.js +43 -47
- package/dist/canvas.js.map +1 -1
- package/dist/cell-glyph-fit.js +1 -1
- package/dist/cell-glyph-fit.js.map +1 -1
- package/dist/collection-surface-types.d.ts +12 -0
- package/dist/collection-surface-types.d.ts.map +1 -0
- package/dist/collection-surface-types.js +2 -0
- package/dist/collection-surface-types.js.map +1 -0
- package/dist/collection-surface.d.ts +2 -7
- package/dist/collection-surface.d.ts.map +1 -1
- package/dist/collection-surface.js +8 -18
- package/dist/collection-surface.js.map +1 -1
- package/dist/command-palette.d.ts.map +1 -1
- package/dist/command-palette.js +2 -1
- package/dist/command-palette.js.map +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +1 -1
- package/dist/commands.js.map +1 -1
- package/dist/css/install.js.map +1 -1
- package/dist/css/parser.js +9 -3
- package/dist/css/parser.js.map +1 -1
- package/dist/css/resolver-types.d.ts +13 -0
- package/dist/css/resolver-types.d.ts.map +1 -0
- package/dist/css/resolver-types.js +2 -0
- package/dist/css/resolver-types.js.map +1 -0
- package/dist/css/resolver.d.ts +2 -12
- package/dist/css/resolver.d.ts.map +1 -1
- package/dist/css/resolver.js +13 -20
- package/dist/css/resolver.js.map +1 -1
- package/dist/css/text-style.d.ts +4 -8
- package/dist/css/text-style.d.ts.map +1 -1
- package/dist/css/text-style.js +13 -18
- package/dist/css/text-style.js.map +1 -1
- package/dist/dag-pane.d.ts +4 -224
- package/dist/dag-pane.d.ts.map +1 -1
- package/dist/dag-pane.js +3 -516
- package/dist/dag-pane.js.map +1 -1
- package/dist/dag-pane.part01.d.ts +58 -0
- package/dist/dag-pane.part01.d.ts.map +1 -0
- package/dist/dag-pane.part01.js +2 -0
- package/dist/dag-pane.part01.js.map +1 -0
- package/dist/dag-pane.part02.d.ts +4 -0
- package/dist/dag-pane.part02.d.ts.map +1 -0
- package/dist/dag-pane.part02.js +56 -0
- package/dist/dag-pane.part02.js.map +1 -0
- package/dist/dag-pane.part03.d.ts +6 -0
- package/dist/dag-pane.part03.d.ts.map +1 -0
- package/dist/dag-pane.part03.js +76 -0
- package/dist/dag-pane.part03.js.map +1 -0
- package/dist/dag-pane.part04.d.ts +7 -0
- package/dist/dag-pane.part04.d.ts.map +1 -0
- package/dist/dag-pane.part04.js +66 -0
- package/dist/dag-pane.part04.js.map +1 -0
- package/dist/dag-pane.part05.d.ts +7 -0
- package/dist/dag-pane.part05.d.ts.map +1 -0
- package/dist/dag-pane.part05.js +78 -0
- package/dist/dag-pane.part05.js.map +1 -0
- package/dist/dag-pane.part06.d.ts +14 -0
- package/dist/dag-pane.part06.d.ts.map +1 -0
- package/dist/dag-pane.part06.js +65 -0
- package/dist/dag-pane.part06.js.map +1 -0
- package/dist/dag-pane.part07.d.ts +18 -0
- package/dist/dag-pane.part07.d.ts.map +1 -0
- package/dist/dag-pane.part07.js +22 -0
- package/dist/dag-pane.part07.js.map +1 -0
- package/dist/driver.d.ts +35 -21
- package/dist/driver.d.ts.map +1 -1
- package/dist/driver.js +69 -39
- package/dist/driver.js.map +1 -1
- package/dist/eventbus.d.ts.map +1 -1
- package/dist/eventbus.js +13 -23
- package/dist/eventbus.js.map +1 -1
- package/dist/file-picker.d.ts +4 -160
- package/dist/file-picker.d.ts.map +1 -1
- package/dist/file-picker.js +3 -284
- package/dist/file-picker.js.map +1 -1
- package/dist/file-picker.part01.d.ts +54 -0
- package/dist/file-picker.part01.d.ts.map +1 -0
- package/dist/file-picker.part01.js +47 -0
- package/dist/file-picker.part01.js.map +1 -0
- package/dist/file-picker.part02.d.ts +9 -0
- package/dist/file-picker.part02.d.ts.map +1 -0
- package/dist/file-picker.part02.js +77 -0
- package/dist/file-picker.part02.js.map +1 -0
- package/dist/file-picker.part03.d.ts +12 -0
- package/dist/file-picker.part03.d.ts.map +1 -0
- package/dist/file-picker.part03.js +35 -0
- package/dist/file-picker.part03.js.map +1 -0
- package/dist/flex.d.ts +0 -61
- package/dist/flex.d.ts.map +1 -1
- package/dist/flex.js +11 -161
- package/dist/flex.js.map +1 -1
- package/dist/focus-area.d.ts +6 -210
- package/dist/focus-area.d.ts.map +1 -1
- package/dist/focus-area.js +5 -425
- package/dist/focus-area.js.map +1 -1
- package/dist/focus-area.part01.d.ts +57 -0
- package/dist/focus-area.part01.d.ts.map +1 -0
- package/dist/focus-area.part01.js +23 -0
- package/dist/focus-area.part01.js.map +1 -0
- package/dist/focus-area.part02.d.ts +13 -0
- package/dist/focus-area.part02.d.ts.map +1 -0
- package/dist/focus-area.part02.js +65 -0
- package/dist/focus-area.part02.js.map +1 -0
- package/dist/focus-area.part03.d.ts +5 -0
- package/dist/focus-area.part03.d.ts.map +1 -0
- package/dist/focus-area.part03.js +42 -0
- package/dist/focus-area.part03.js.map +1 -0
- package/dist/focus-area.part04.d.ts +5 -0
- package/dist/focus-area.part04.d.ts.map +1 -0
- package/dist/focus-area.part04.js +49 -0
- package/dist/focus-area.part04.js.map +1 -0
- package/dist/focus-area.part05.d.ts +10 -0
- package/dist/focus-area.part05.d.ts.map +1 -0
- package/dist/focus-area.part05.js +66 -0
- package/dist/focus-area.part05.js.map +1 -0
- package/dist/focus-area.part06.d.ts +17 -0
- package/dist/focus-area.part06.d.ts.map +1 -0
- package/dist/focus-area.part06.js +48 -0
- package/dist/focus-area.part06.js.map +1 -0
- package/dist/focus-map.d.ts.map +1 -1
- package/dist/focus-map.js +8 -10
- package/dist/focus-map.js.map +1 -1
- package/dist/index.d.ts +8 -79
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -105
- package/dist/index.js.map +1 -1
- package/dist/index.part01.d.ts +15 -0
- package/dist/index.part01.d.ts.map +1 -0
- package/dist/index.part01.js +11 -0
- package/dist/index.part01.js.map +1 -0
- package/dist/index.part02.d.ts +26 -0
- package/dist/index.part02.d.ts.map +1 -0
- package/dist/index.part02.js +24 -0
- package/dist/index.part02.js.map +1 -0
- package/dist/index.part03.d.ts +17 -0
- package/dist/index.part03.d.ts.map +1 -0
- package/dist/index.part03.js +11 -0
- package/dist/index.part03.js.map +1 -0
- package/dist/index.part04.d.ts +6 -0
- package/dist/index.part04.d.ts.map +1 -0
- package/dist/index.part04.js +11 -0
- package/dist/index.part04.js.map +1 -0
- package/dist/index.part05.d.ts +10 -0
- package/dist/index.part05.d.ts.map +1 -0
- package/dist/index.part05.js +26 -0
- package/dist/index.part05.js.map +1 -0
- package/dist/index.part06.d.ts +9 -0
- package/dist/index.part06.d.ts.map +1 -0
- package/dist/index.part06.js +16 -0
- package/dist/index.part06.js.map +1 -0
- package/dist/index.part07.d.ts +8 -0
- package/dist/index.part07.d.ts.map +1 -0
- package/dist/index.part07.js +15 -0
- package/dist/index.part07.js.map +1 -0
- package/dist/index.part08.d.ts +5 -0
- package/dist/index.part08.d.ts.map +1 -0
- package/dist/index.part08.js +9 -0
- package/dist/index.part08.js.map +1 -0
- package/dist/input-map.d.ts.map +1 -1
- package/dist/input-map.js +1 -2
- package/dist/input-map.js.map +1 -1
- package/dist/input-parser.d.ts +3 -0
- package/dist/input-parser.d.ts.map +1 -0
- package/dist/input-parser.js +95 -0
- package/dist/input-parser.js.map +1 -0
- package/dist/input-routing-inspector.js +3 -3
- package/dist/input-routing-inspector.js.map +1 -1
- package/dist/inputstack.d.ts.map +1 -1
- package/dist/inputstack.js +2 -0
- package/dist/inputstack.js.map +1 -1
- package/dist/keybindings.d.ts.map +1 -1
- package/dist/keybindings.js +5 -2
- package/dist/keybindings.js.map +1 -1
- package/dist/keys.d.ts +0 -36
- package/dist/keys.d.ts.map +1 -1
- package/dist/keys.js +11 -66
- package/dist/keys.js.map +1 -1
- package/dist/layout-inspector.d.ts +2 -30
- package/dist/layout-inspector.d.ts.map +1 -1
- package/dist/layout-inspector.js +1 -132
- package/dist/layout-inspector.js.map +1 -1
- package/dist/layout-inspector.part01.d.ts +52 -0
- package/dist/layout-inspector.part01.d.ts.map +1 -0
- package/dist/layout-inspector.part01.js +48 -0
- package/dist/layout-inspector.part01.js.map +1 -0
- package/dist/layout-inspector.part02.d.ts +11 -0
- package/dist/layout-inspector.part02.d.ts.map +1 -0
- package/dist/layout-inspector.part02.js +80 -0
- package/dist/layout-inspector.part02.js.map +1 -0
- package/dist/layout-inspector.part03.d.ts +5 -0
- package/dist/layout-inspector.part03.d.ts.map +1 -0
- package/dist/layout-inspector.part03.js +11 -0
- package/dist/layout-inspector.part03.js.map +1 -0
- package/dist/layout-preset.js +4 -4
- package/dist/layout-preset.js.map +1 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +5 -3
- package/dist/layout.js.map +1 -1
- package/dist/motion/motion.js +8 -4
- package/dist/motion/motion.js.map +1 -1
- package/dist/motion/reconciler.d.ts.map +1 -1
- package/dist/motion/reconciler.js +9 -7
- package/dist/motion/reconciler.js.map +1 -1
- package/dist/mouse-mode.d.ts +5 -0
- package/dist/mouse-mode.d.ts.map +1 -0
- package/dist/mouse-mode.js +17 -0
- package/dist/mouse-mode.js.map +1 -0
- package/dist/navigable-table.d.ts +3 -136
- package/dist/navigable-table.d.ts.map +1 -1
- package/dist/navigable-table.js +2 -234
- package/dist/navigable-table.js.map +1 -1
- package/dist/navigable-table.part01.d.ts +42 -0
- package/dist/navigable-table.part01.d.ts.map +1 -0
- package/dist/navigable-table.part01.js +42 -0
- package/dist/navigable-table.part01.js.map +1 -0
- package/dist/navigable-table.part02.d.ts +16 -0
- package/dist/navigable-table.part02.d.ts.map +1 -0
- package/dist/navigable-table.part02.js +83 -0
- package/dist/navigable-table.part02.js.map +1 -0
- package/dist/notification-card.d.ts +11 -0
- package/dist/notification-card.d.ts.map +1 -0
- package/dist/notification-card.js +157 -0
- package/dist/notification-card.js.map +1 -0
- package/dist/notification-stack.d.ts +6 -0
- package/dist/notification-stack.d.ts.map +1 -0
- package/dist/notification-stack.js +257 -0
- package/dist/notification-stack.js.map +1 -0
- package/dist/notification.d.ts +14 -112
- package/dist/notification.d.ts.map +1 -1
- package/dist/notification.js +12 -1087
- package/dist/notification.js.map +1 -1
- package/dist/notification.part01.d.ts +77 -0
- package/dist/notification.part01.d.ts.map +1 -0
- package/dist/notification.part01.js +19 -0
- package/dist/notification.part01.js.map +1 -0
- package/dist/notification.part02.d.ts +42 -0
- package/dist/notification.part02.d.ts.map +1 -0
- package/dist/notification.part02.js +44 -0
- package/dist/notification.part02.js.map +1 -0
- package/dist/notification.part03.d.ts +6 -0
- package/dist/notification.part03.d.ts.map +1 -0
- package/dist/notification.part03.js +81 -0
- package/dist/notification.part03.js.map +1 -0
- package/dist/notification.part04.d.ts +4 -0
- package/dist/notification.part04.d.ts.map +1 -0
- package/dist/notification.part04.js +32 -0
- package/dist/notification.part04.js.map +1 -0
- package/dist/notification.part05.d.ts +6 -0
- package/dist/notification.part05.d.ts.map +1 -0
- package/dist/notification.part05.js +95 -0
- package/dist/notification.part05.js.map +1 -0
- package/dist/notification.part06.d.ts +9 -0
- package/dist/notification.part06.d.ts.map +1 -0
- package/dist/notification.part06.js +65 -0
- package/dist/notification.part06.js.map +1 -0
- package/dist/notification.part07.d.ts +10 -0
- package/dist/notification.part07.d.ts.map +1 -0
- package/dist/notification.part07.js +70 -0
- package/dist/notification.part07.js.map +1 -0
- package/dist/notification.part08.d.ts +5 -0
- package/dist/notification.part08.d.ts.map +1 -0
- package/dist/notification.part08.js +79 -0
- package/dist/notification.part08.js.map +1 -0
- package/dist/notification.part09.d.ts +14 -0
- package/dist/notification.part09.d.ts.map +1 -0
- package/dist/notification.part09.js +96 -0
- package/dist/notification.part09.js.map +1 -0
- package/dist/notification.part10.d.ts +13 -0
- package/dist/notification.part10.d.ts.map +1 -0
- package/dist/notification.part10.js +94 -0
- package/dist/notification.part10.js.map +1 -0
- package/dist/notification.part11.d.ts +6 -0
- package/dist/notification.part11.d.ts.map +1 -0
- package/dist/notification.part11.js +42 -0
- package/dist/notification.part11.js.map +1 -0
- package/dist/overlay.d.ts +8 -232
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +5 -629
- package/dist/overlay.js.map +1 -1
- package/dist/overlay.part01.d.ts +71 -0
- package/dist/overlay.part01.d.ts.map +1 -0
- package/dist/overlay.part01.js +34 -0
- package/dist/overlay.part01.js.map +1 -0
- package/dist/overlay.part02.d.ts +8 -0
- package/dist/overlay.part02.d.ts.map +1 -0
- package/dist/overlay.part02.js +81 -0
- package/dist/overlay.part02.js.map +1 -0
- package/dist/overlay.part03.d.ts +27 -0
- package/dist/overlay.part03.d.ts.map +1 -0
- package/dist/overlay.part03.js +83 -0
- package/dist/overlay.part03.js.map +1 -0
- package/dist/overlay.part04.d.ts +8 -0
- package/dist/overlay.part04.d.ts.map +1 -0
- package/dist/overlay.part04.js +103 -0
- package/dist/overlay.part04.js.map +1 -0
- package/dist/overlay.part05.d.ts +8 -0
- package/dist/overlay.part05.d.ts.map +1 -0
- package/dist/overlay.part05.js +66 -0
- package/dist/overlay.part05.js.map +1 -0
- package/dist/overlay.part06.d.ts +46 -0
- package/dist/overlay.part06.d.ts.map +1 -0
- package/dist/overlay.part06.js +35 -0
- package/dist/overlay.part06.js.map +1 -0
- package/dist/overlay.part07.d.ts +4 -0
- package/dist/overlay.part07.d.ts.map +1 -0
- package/dist/overlay.part07.js +64 -0
- package/dist/overlay.part07.js.map +1 -0
- package/dist/overlay.part08.d.ts +34 -0
- package/dist/overlay.part08.d.ts.map +1 -0
- package/dist/overlay.part08.js +54 -0
- package/dist/overlay.part08.js.map +1 -0
- package/dist/overlay.part09.d.ts +6 -0
- package/dist/overlay.part09.d.ts.map +1 -0
- package/dist/overlay.part09.js +42 -0
- package/dist/overlay.part09.js.map +1 -0
- package/dist/pager.d.ts.map +1 -1
- package/dist/pager.js +2 -4
- package/dist/pager.js.map +1 -1
- package/dist/panel-dock.d.ts.map +1 -1
- package/dist/panel-dock.js +9 -11
- package/dist/panel-dock.js.map +1 -1
- package/dist/panels.d.ts.map +1 -1
- package/dist/panels.js +2 -0
- package/dist/panels.js.map +1 -1
- package/dist/pipeline/middleware/css.d.ts +3 -5
- package/dist/pipeline/middleware/css.d.ts.map +1 -1
- package/dist/pipeline/middleware/css.js +12 -6
- package/dist/pipeline/middleware/css.js.map +1 -1
- package/dist/pipeline/middleware/grayscale.js +15 -10
- package/dist/pipeline/middleware/grayscale.js.map +1 -1
- package/dist/pipeline/middleware/motion.js +9 -1
- package/dist/pipeline/middleware/motion.js.map +1 -1
- package/dist/pipeline/middleware/paint.js +9 -1
- package/dist/pipeline/middleware/paint.js.map +1 -1
- package/dist/pipeline/middleware/surface-shaders.js +13 -11
- package/dist/pipeline/middleware/surface-shaders.js.map +1 -1
- package/dist/pipeline/pipeline.d.ts +7 -52
- package/dist/pipeline/pipeline.d.ts.map +1 -1
- package/dist/pipeline/pipeline.js +37 -27
- package/dist/pipeline/pipeline.js.map +1 -1
- package/dist/raster-glyph.d.ts +3 -0
- package/dist/raster-glyph.d.ts.map +1 -0
- package/dist/raster-glyph.js +2 -0
- package/dist/raster-glyph.js.map +1 -0
- package/dist/raster-glyph.part01.d.ts +75 -0
- package/dist/raster-glyph.part01.d.ts.map +1 -0
- package/dist/raster-glyph.part01.js +25 -0
- package/dist/raster-glyph.part01.js.map +1 -0
- package/dist/raster-glyph.part02.d.ts +12 -0
- package/dist/raster-glyph.part02.d.ts.map +1 -0
- package/dist/raster-glyph.part02.js +81 -0
- package/dist/raster-glyph.part02.js.map +1 -0
- package/dist/raster-glyph.part03.d.ts +6 -0
- package/dist/raster-glyph.part03.d.ts.map +1 -0
- package/dist/raster-glyph.part03.js +60 -0
- package/dist/raster-glyph.part03.js.map +1 -0
- package/dist/raster-glyph.part04.d.ts +7 -0
- package/dist/raster-glyph.part04.d.ts.map +1 -0
- package/dist/raster-glyph.part04.js +59 -0
- package/dist/raster-glyph.part04.js.map +1 -0
- package/dist/raster-glyph.part05.d.ts +6 -0
- package/dist/raster-glyph.part05.d.ts.map +1 -0
- package/dist/raster-glyph.part05.js +71 -0
- package/dist/raster-glyph.part05.js.map +1 -0
- package/dist/raster-glyph.part06.d.ts +18 -0
- package/dist/raster-glyph.part06.d.ts.map +1 -0
- package/dist/raster-glyph.part06.js +78 -0
- package/dist/raster-glyph.part06.js.map +1 -0
- package/dist/raster-glyph.part07.d.ts +11 -0
- package/dist/raster-glyph.part07.d.ts.map +1 -0
- package/dist/raster-glyph.part07.js +55 -0
- package/dist/raster-glyph.part07.js.map +1 -0
- package/dist/raytrace.d.ts +3 -58
- package/dist/raytrace.d.ts.map +1 -1
- package/dist/raytrace.js +2 -120
- package/dist/raytrace.js.map +1 -1
- package/dist/raytrace.part01.d.ts +47 -0
- package/dist/raytrace.part01.d.ts.map +1 -0
- package/dist/raytrace.part01.js +45 -0
- package/dist/raytrace.part01.js.map +1 -0
- package/dist/raytrace.part02.d.ts +12 -0
- package/dist/raytrace.part02.d.ts.map +1 -0
- package/dist/raytrace.part02.js +73 -0
- package/dist/raytrace.part02.js.map +1 -0
- package/dist/runtime-binding.d.ts +2 -3
- package/dist/runtime-binding.d.ts.map +1 -1
- package/dist/runtime-binding.js +49 -38
- package/dist/runtime-binding.js.map +1 -1
- package/dist/runtime-engine.d.ts +2 -2
- package/dist/runtime-engine.d.ts.map +1 -1
- package/dist/runtime-engine.js +15 -4
- package/dist/runtime-engine.js.map +1 -1
- package/dist/runtime.d.ts +2 -18
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +43 -62
- package/dist/runtime.js.map +1 -1
- package/dist/screen.js +1 -1
- package/dist/screen.js.map +1 -1
- package/dist/shell-quit.d.ts.map +1 -1
- package/dist/shell-quit.js +49 -6
- package/dist/shell-quit.js.map +1 -1
- package/dist/split-pane.d.ts +3 -104
- package/dist/split-pane.d.ts.map +1 -1
- package/dist/split-pane.js +2 -190
- package/dist/split-pane.js.map +1 -1
- package/dist/split-pane.part01.d.ts +60 -0
- package/dist/split-pane.part01.d.ts.map +1 -0
- package/dist/split-pane.part01.js +45 -0
- package/dist/split-pane.part01.js.map +1 -0
- package/dist/split-pane.part02.d.ts +8 -0
- package/dist/split-pane.part02.d.ts.map +1 -0
- package/dist/split-pane.part02.js +73 -0
- package/dist/split-pane.part02.js.map +1 -0
- package/dist/split-pane.part03.d.ts +4 -0
- package/dist/split-pane.part03.d.ts.map +1 -0
- package/dist/split-pane.part03.js +40 -0
- package/dist/split-pane.part03.js.map +1 -0
- package/dist/spring.d.ts +4 -187
- package/dist/spring.d.ts.map +1 -1
- package/dist/spring.js +2 -142
- package/dist/spring.js.map +1 -1
- package/dist/spring.part01.d.ts +90 -0
- package/dist/spring.part01.d.ts.map +1 -0
- package/dist/spring.part01.js +58 -0
- package/dist/spring.part01.js.map +1 -0
- package/dist/spring.part02.d.ts +25 -0
- package/dist/spring.part02.d.ts.map +1 -0
- package/dist/spring.part02.js +21 -0
- package/dist/spring.part02.js.map +1 -0
- package/dist/status-bar.js +1 -1
- package/dist/status-bar.js.map +1 -1
- package/dist/subapp/mount.d.ts +6 -6
- package/dist/subapp/mount.d.ts.map +1 -1
- package/dist/subapp/mount.js +19 -14
- package/dist/subapp/mount.js.map +1 -1
- package/dist/surface-budget-types.d.ts +26 -0
- package/dist/surface-budget-types.d.ts.map +1 -0
- package/dist/surface-budget-types.js +2 -0
- package/dist/surface-budget-types.js.map +1 -0
- package/dist/surface-budget.d.ts +2 -25
- package/dist/surface-budget.d.ts.map +1 -1
- package/dist/surface-budget.js.map +1 -1
- package/dist/surface-diff.js +26 -28
- package/dist/surface-diff.js.map +1 -1
- package/dist/surface-layout.d.ts.map +1 -1
- package/dist/surface-layout.js +1 -2
- package/dist/surface-layout.js.map +1 -1
- package/dist/timeline.d.ts +1 -1
- package/dist/timeline.d.ts.map +1 -1
- package/dist/timeline.js +17 -15
- package/dist/timeline.js.map +1 -1
- package/dist/transition-shaders.d.ts +5 -142
- package/dist/transition-shaders.d.ts.map +1 -1
- package/dist/transition-shaders.js +4 -391
- package/dist/transition-shaders.js.map +1 -1
- package/dist/transition-shaders.part01.d.ts +41 -0
- package/dist/transition-shaders.part01.d.ts.map +1 -0
- package/dist/transition-shaders.part01.js +38 -0
- package/dist/transition-shaders.part01.js.map +1 -0
- package/dist/transition-shaders.part02.d.ts +12 -0
- package/dist/transition-shaders.part02.d.ts.map +1 -0
- package/dist/transition-shaders.part02.js +88 -0
- package/dist/transition-shaders.part02.js.map +1 -0
- package/dist/transition-shaders.part03.d.ts +6 -0
- package/dist/transition-shaders.part03.d.ts.map +1 -0
- package/dist/transition-shaders.part03.js +82 -0
- package/dist/transition-shaders.part03.js.map +1 -0
- package/dist/transition-shaders.part04.d.ts +16 -0
- package/dist/transition-shaders.part04.d.ts.map +1 -0
- package/dist/transition-shaders.part04.js +98 -0
- package/dist/transition-shaders.part04.js.map +1 -0
- package/dist/types.d.ts +10 -42
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +9 -36
- package/dist/types.js.map +1 -1
- package/dist/view-output.d.ts +1 -1
- package/dist/view-output.d.ts.map +1 -1
- package/dist/view-output.js +3 -2
- package/dist/view-output.js.map +1 -1
- package/dist/viewport.d.ts +7 -213
- package/dist/viewport.d.ts.map +1 -1
- package/dist/viewport.js +6 -470
- package/dist/viewport.js.map +1 -1
- package/dist/viewport.part01.d.ts +51 -0
- package/dist/viewport.part01.d.ts.map +1 -0
- package/dist/viewport.part01.js +10 -0
- package/dist/viewport.part01.js.map +1 -0
- package/dist/viewport.part02.d.ts +2 -0
- package/dist/viewport.part02.d.ts.map +1 -0
- package/dist/viewport.part02.js +69 -0
- package/dist/viewport.part02.js.map +1 -0
- package/dist/viewport.part03.d.ts +10 -0
- package/dist/viewport.part03.d.ts.map +1 -0
- package/dist/viewport.part03.js +78 -0
- package/dist/viewport.part03.js.map +1 -0
- package/dist/viewport.part04.d.ts +4 -0
- package/dist/viewport.part04.d.ts.map +1 -0
- package/dist/viewport.part04.js +50 -0
- package/dist/viewport.part04.js.map +1 -0
- package/dist/viewport.part05.d.ts +5 -0
- package/dist/viewport.part05.d.ts.map +1 -0
- package/dist/viewport.part05.js +59 -0
- package/dist/viewport.part05.js.map +1 -0
- package/dist/viewport.part06.d.ts +14 -0
- package/dist/viewport.part06.d.ts.map +1 -0
- package/dist/viewport.part06.js +58 -0
- package/dist/viewport.part06.js.map +1 -0
- package/package.json +3 -3
package/dist/overlay.js
CHANGED
|
@@ -1,630 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* - `modal()` — centered dialog overlay with title, body, hint
|
|
7
|
-
* - `toast()` — anchored notification overlay with variant icons
|
|
8
|
-
* - `tooltip()` — positioned overlay relative to a target element
|
|
9
|
-
*/
|
|
10
|
-
import { FLAG_DIM, FLAG_EMPTY } from '@flyingrobots/bijou';
|
|
11
|
-
import { CELL_STRIDE, OFF_FLAGS, OFF_ALPHA, FLAG_BG_SET, parseHex, encodeModifiers } from '@flyingrobots/bijou/perf';
|
|
12
|
-
import { createSurface, graphemeClusterWidth, isPackedSurface, parseAnsiToSurface, segmentGraphemes, shouldApplyBg, stripAnsi, surfaceToString, } from '@flyingrobots/bijou';
|
|
13
|
-
import { sliceAnsi, visibleLength, clipToWidth } from './viewport.js';
|
|
14
|
-
function resolvedColorRgb(ref) {
|
|
15
|
-
return typeof ref === 'object'
|
|
16
|
-
&& ref !== null
|
|
17
|
-
&& 'kind' in ref
|
|
18
|
-
&& ref.kind === 'resolved-color'
|
|
19
|
-
&& 'rgb' in ref
|
|
20
|
-
? ref.rgb
|
|
21
|
-
: undefined;
|
|
22
|
-
}
|
|
23
|
-
function resolvedColorHex(ref) {
|
|
24
|
-
if (typeof ref === 'string')
|
|
25
|
-
return ref;
|
|
26
|
-
return typeof ref === 'object'
|
|
27
|
-
&& ref !== null
|
|
28
|
-
&& 'kind' in ref
|
|
29
|
-
&& ref.kind === 'resolved-color'
|
|
30
|
-
&& 'hex' in ref
|
|
31
|
-
? ref.hex
|
|
32
|
-
: undefined;
|
|
33
|
-
}
|
|
34
|
-
import { clampCenteredPosition, resolveOverlayMargin } from './design-language.js';
|
|
35
|
-
import { forceTextPresentation } from './icon-presentation.js';
|
|
36
|
-
// ---------------------------------------------------------------------------
|
|
37
|
-
// Border characters (same as core box.ts)
|
|
38
|
-
// ---------------------------------------------------------------------------
|
|
39
|
-
/** Unicode box-drawing characters for overlay borders. */
|
|
40
|
-
const BORDER = {
|
|
41
|
-
tl: '\u250c', // ┌
|
|
42
|
-
tr: '\u2510', // ┐
|
|
43
|
-
bl: '\u2514', // └
|
|
44
|
-
br: '\u2518', // ┘
|
|
45
|
-
h: '\u2500', // ─
|
|
46
|
-
v: '\u2502', // │
|
|
47
|
-
};
|
|
48
|
-
// ---------------------------------------------------------------------------
|
|
49
|
-
// spliceLine (internal)
|
|
50
|
-
// ---------------------------------------------------------------------------
|
|
51
|
-
/**
|
|
52
|
-
* Splice an overlay line into a background line at a given column.
|
|
53
|
-
*
|
|
54
|
-
* Preserve background content to the left and right of the overlay,
|
|
55
|
-
* inserting ANSI resets at splice boundaries.
|
|
56
|
-
*
|
|
57
|
-
* @param bgLine - Background line (may contain ANSI escapes).
|
|
58
|
-
* @param overlayLine - Overlay line to paint over the background.
|
|
59
|
-
* @param col - Starting visible column for the overlay (0-based).
|
|
60
|
-
* @returns Merged line with the overlay replacing background characters.
|
|
61
|
-
*/
|
|
62
|
-
function spliceLine(bgLine, overlayLine, col) {
|
|
63
|
-
const overlayVis = visibleLength(overlayLine);
|
|
64
|
-
const bgVis = visibleLength(bgLine);
|
|
65
|
-
const left = bgVis <= col
|
|
66
|
-
? bgLine + ' '.repeat(col - bgVis)
|
|
67
|
-
: sliceAnsi(bgLine, 0, col);
|
|
68
|
-
const right = sliceAnsi(bgLine, col + overlayVis, bgVis);
|
|
69
|
-
return left + '\x1b[0m' + overlayLine + '\x1b[0m' + right;
|
|
70
|
-
}
|
|
71
|
-
// ---------------------------------------------------------------------------
|
|
72
|
-
// composite()
|
|
73
|
-
// ---------------------------------------------------------------------------
|
|
74
|
-
/**
|
|
75
|
-
* Paint one or more overlays onto a background string.
|
|
76
|
-
*
|
|
77
|
-
* Overlay content replaces background characters at the specified position.
|
|
78
|
-
* Overlays are applied in array order (later overlays paint over earlier ones).
|
|
79
|
-
* ANSI escape sequences are preserved correctly at splice boundaries.
|
|
80
|
-
*
|
|
81
|
-
* @param background - Background content string (newline-delimited).
|
|
82
|
-
* @param overlays - Positioned overlays to composite onto the background.
|
|
83
|
-
* @param options - Optional compositing settings (e.g., dim background).
|
|
84
|
-
* @returns Composited string with all overlays applied.
|
|
85
|
-
*/
|
|
86
|
-
export function composite(background, overlays, options) {
|
|
87
|
-
const bgLines = background.split('\n');
|
|
88
|
-
if (options?.dim) {
|
|
89
|
-
for (let i = 0; i < bgLines.length; i++) {
|
|
90
|
-
if (visibleLength(bgLines[i]) > 0) {
|
|
91
|
-
bgLines[i] = '\x1b[2m' + bgLines[i] + '\x1b[0m';
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
for (const overlay of overlays) {
|
|
96
|
-
const oLines = overlay.content.split('\n');
|
|
97
|
-
for (let i = 0; i < oLines.length; i++) {
|
|
98
|
-
const targetRow = overlay.row + i;
|
|
99
|
-
if (targetRow < 0 || targetRow >= bgLines.length)
|
|
100
|
-
continue;
|
|
101
|
-
bgLines[targetRow] = spliceLine(bgLines[targetRow], oLines[i], overlay.col);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return bgLines.join('\n');
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Paint one or more overlays onto a background surface.
|
|
108
|
-
*
|
|
109
|
-
* Overlays are applied in array order, with later overlays painting over
|
|
110
|
-
* earlier ones. String-only overlays are normalized through an explicit
|
|
111
|
-
* ANSI-to-surface bridge at the composition edge.
|
|
112
|
-
*/
|
|
113
|
-
export function compositeSurface(background, overlays, options) {
|
|
114
|
-
const result = background.clone();
|
|
115
|
-
return compositeSurfaceInto(result, result, overlays, options);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Paint overlays onto an existing target surface, optionally starting from an
|
|
119
|
-
* existing background surface.
|
|
120
|
-
*
|
|
121
|
-
* When `background` and `target` are the same object, the surface is
|
|
122
|
-
* composited in place without an extra clone.
|
|
123
|
-
*/
|
|
124
|
-
export function compositeSurfaceInto(background, target, overlays, options) {
|
|
125
|
-
if (target !== background) {
|
|
126
|
-
target.clear();
|
|
127
|
-
target.blit(background, 0, 0);
|
|
128
|
-
}
|
|
129
|
-
if (options?.dim) {
|
|
130
|
-
const packed = isPackedSurface(target);
|
|
131
|
-
if (packed) {
|
|
132
|
-
// Fast path: set the dim flag bit directly in the buffer
|
|
133
|
-
const buf = target.buffer;
|
|
134
|
-
const size = target.width * target.height;
|
|
135
|
-
for (let i = 0; i < size; i++) {
|
|
136
|
-
const off = i * CELL_STRIDE;
|
|
137
|
-
if (buf[off + OFF_FLAGS] & FLAG_EMPTY)
|
|
138
|
-
continue;
|
|
139
|
-
// Skip space chars (charCode 0x20)
|
|
140
|
-
if (buf[off] === 0x20 && buf[off + 1] === 0)
|
|
141
|
-
continue;
|
|
142
|
-
buf[off + OFF_FLAGS] = buf[off + OFF_FLAGS] | FLAG_DIM;
|
|
143
|
-
}
|
|
144
|
-
target.markAllDirty();
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
for (let y = 0; y < target.height; y++) {
|
|
148
|
-
for (let x = 0; x < target.width; x++) {
|
|
149
|
-
const cell = target.get(x, y);
|
|
150
|
-
if (cell.empty || cell.char === ' ')
|
|
151
|
-
continue;
|
|
152
|
-
const modifiers = cell.modifiers ?? [];
|
|
153
|
-
if (!modifiers.includes('dim')) {
|
|
154
|
-
target.set(x, y, { ...cell, modifiers: [...modifiers, 'dim'], empty: false });
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
for (const overlay of overlays) {
|
|
161
|
-
target.blit(overlay.surface ?? surfaceFromContent(overlay.content), overlay.col, overlay.row);
|
|
162
|
-
}
|
|
163
|
-
return target;
|
|
164
|
-
}
|
|
165
|
-
function styleFromToken(token, ctx) {
|
|
166
|
-
if (!ctx || token == null)
|
|
167
|
-
return {};
|
|
168
|
-
const style = {
|
|
169
|
-
fg: token.hex,
|
|
170
|
-
bg: token.bg,
|
|
171
|
-
modifiers: token.modifiers ? [...token.modifiers] : undefined,
|
|
172
|
-
};
|
|
173
|
-
if (token.fgRGB)
|
|
174
|
-
style.fgRGB = token.fgRGB;
|
|
175
|
-
if (token.bgRGB)
|
|
176
|
-
style.bgRGB = token.bgRGB;
|
|
177
|
-
return style;
|
|
178
|
-
}
|
|
179
|
-
function backgroundStyleFromToken(token, ctx) {
|
|
180
|
-
if (!ctx || !shouldApplyBg(ctx) || !token?.bg)
|
|
181
|
-
return {};
|
|
182
|
-
const style = { bg: token.bg };
|
|
183
|
-
if (token.bgRGB)
|
|
184
|
-
style.bgRGB = token.bgRGB;
|
|
185
|
-
return style;
|
|
186
|
-
}
|
|
187
|
-
function mergeStyles(base, extra) {
|
|
188
|
-
const modifiers = [...(base.modifiers ?? []), ...(extra.modifiers ?? [])];
|
|
189
|
-
const fg = extra.fg ?? base.fg;
|
|
190
|
-
const bg = extra.bg ?? base.bg;
|
|
191
|
-
return {
|
|
192
|
-
fg,
|
|
193
|
-
bg,
|
|
194
|
-
// When extra.fg overrides base.fg, use extra's fgRGB (may be
|
|
195
|
-
// undefined — correctly clearing the pre-parsed cache so the
|
|
196
|
-
// differ falls back to inlineHexRGB for the new hex string).
|
|
197
|
-
// When extra.fg is absent, inherit base's fgRGB if available.
|
|
198
|
-
fgRGB: extra.fg != null ? extra.fgRGB : (extra.fgRGB ?? base.fgRGB),
|
|
199
|
-
bgRGB: extra.bg != null ? extra.bgRGB : (extra.bgRGB ?? base.bgRGB),
|
|
200
|
-
modifiers: modifiers.length > 0 ? Array.from(new Set(modifiers)) : undefined,
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
function plainSurfaceToString(surface) {
|
|
204
|
-
const lines = [];
|
|
205
|
-
for (let y = 0; y < surface.height; y++) {
|
|
206
|
-
let line = '';
|
|
207
|
-
for (let x = 0; x < surface.width; x++) {
|
|
208
|
-
line += surface.get(x, y).char;
|
|
209
|
-
}
|
|
210
|
-
lines.push(line);
|
|
211
|
-
}
|
|
212
|
-
return lines.join('\n');
|
|
213
|
-
}
|
|
214
|
-
function overlayContentFromSurface(surface, ctx) {
|
|
215
|
-
return ctx ? surfaceToString(surface, ctx.style) : plainSurfaceToString(surface);
|
|
216
|
-
}
|
|
217
|
-
function setStyledCell(surface, x, y, char, style, numStyle) {
|
|
218
|
-
if (numStyle && isPackedSurface(surface)) {
|
|
219
|
-
surface.setRGB(x, y, char, numStyle.fR, numStyle.fG, numStyle.fB, numStyle.bR, numStyle.bG, numStyle.bB, numStyle.fl);
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
surface.set(x, y, { char, ...style, empty: false });
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
function setStyledGrapheme(surface, x, y, char, style, numStyle) {
|
|
226
|
-
if (x >= surface.width)
|
|
227
|
-
return 0;
|
|
228
|
-
const width = Math.max(1, graphemeClusterWidth(char));
|
|
229
|
-
setStyledCell(surface, x, y, char, style, numStyle);
|
|
230
|
-
for (let offset = 1; offset < width && x + offset < surface.width; offset++) {
|
|
231
|
-
setStyledCell(surface, x + offset, y, '', style);
|
|
232
|
-
}
|
|
233
|
-
return width;
|
|
234
|
-
}
|
|
235
|
-
function lineSurface(text, style = {}) {
|
|
236
|
-
if (text.length === 0)
|
|
237
|
-
return createSurface(0, 1);
|
|
238
|
-
const plain = stripAnsi(text);
|
|
239
|
-
const width = Math.max(0, visibleLength(text));
|
|
240
|
-
if (width === 0)
|
|
241
|
-
return createSurface(0, 1);
|
|
242
|
-
if (plain !== text && style.fg == null && style.bg == null && style.modifiers == null) {
|
|
243
|
-
return parseAnsiToSurface(text, width, 1);
|
|
244
|
-
}
|
|
245
|
-
const graphemes = segmentGraphemes(plain);
|
|
246
|
-
const surface = createSurface(width, 1);
|
|
247
|
-
// Pre-parse style for setRGB fast path
|
|
248
|
-
let ns;
|
|
249
|
-
if (isPackedSurface(surface)) {
|
|
250
|
-
let fR = -1, fG = 0, fB = 0, bR = -1, bG = 0, bB = 0;
|
|
251
|
-
const fgHex = resolvedColorHex(style.fg);
|
|
252
|
-
const fgRgb = style.fgRGB ?? resolvedColorRgb(style.fg) ?? (fgHex ? parseHex(fgHex) : undefined);
|
|
253
|
-
if (fgRgb) {
|
|
254
|
-
[fR, fG, fB] = fgRgb;
|
|
255
|
-
}
|
|
256
|
-
const bgHex = resolvedColorHex(style.bg);
|
|
257
|
-
const bgRgb = style.bgRGB ?? resolvedColorRgb(style.bg) ?? (bgHex ? parseHex(bgHex) : undefined);
|
|
258
|
-
if (bgRgb) {
|
|
259
|
-
[bR, bG, bB] = bgRgb;
|
|
260
|
-
}
|
|
261
|
-
ns = { fR, fG, fB, bR, bG, bB, fl: style.modifiers ? encodeModifiers(style.modifiers) : 0 };
|
|
262
|
-
}
|
|
263
|
-
let x = 0;
|
|
264
|
-
for (const grapheme of graphemes) {
|
|
265
|
-
if (x >= width)
|
|
266
|
-
break;
|
|
267
|
-
x += setStyledGrapheme(surface, x, 0, grapheme, style, ns);
|
|
268
|
-
}
|
|
269
|
-
return surface;
|
|
270
|
-
}
|
|
271
|
-
function lineWithInheritedBackground(line, style) {
|
|
272
|
-
if ((style.bg == null && style.bgRGB == null) || line.width === 0)
|
|
273
|
-
return line;
|
|
274
|
-
const result = line.clone();
|
|
275
|
-
// Fast path: packed surface — write bg bytes directly
|
|
276
|
-
const packedSurface = isPackedSurface(result) ? result : undefined;
|
|
277
|
-
const bgHex = resolvedColorHex(style.bg);
|
|
278
|
-
const rgb = packedSurface
|
|
279
|
-
? (style.bgRGB ?? resolvedColorRgb(style.bg) ?? (bgHex ? parseHex(bgHex) : undefined))
|
|
280
|
-
: undefined;
|
|
281
|
-
if (packedSurface && rgb) {
|
|
282
|
-
const [bgR, bgG, bgB] = rgb;
|
|
283
|
-
const buf = packedSurface.buffer;
|
|
284
|
-
for (let i = 0; i < result.width; i++) {
|
|
285
|
-
const off = i * CELL_STRIDE;
|
|
286
|
-
if (buf[off + OFF_FLAGS] & FLAG_EMPTY)
|
|
287
|
-
continue;
|
|
288
|
-
if (buf[off + OFF_ALPHA] & FLAG_BG_SET)
|
|
289
|
-
continue;
|
|
290
|
-
buf[off + 5] = bgR;
|
|
291
|
-
buf[off + 6] = bgG;
|
|
292
|
-
buf[off + 7] = bgB;
|
|
293
|
-
buf[off + OFF_ALPHA] = buf[off + OFF_ALPHA] | FLAG_BG_SET;
|
|
294
|
-
}
|
|
295
|
-
packedSurface.markAllDirty();
|
|
296
|
-
return result;
|
|
297
|
-
}
|
|
298
|
-
for (let x = 0; x < result.width; x++) {
|
|
299
|
-
const cell = result.get(x, 0);
|
|
300
|
-
if (cell.empty)
|
|
301
|
-
continue;
|
|
302
|
-
result.set(x, 0, {
|
|
303
|
-
...cell,
|
|
304
|
-
bg: cell.bg ?? style.bg,
|
|
305
|
-
bgRGB: cell.bgRGB ?? style.bgRGB,
|
|
306
|
-
empty: false,
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
return result;
|
|
310
|
-
}
|
|
311
|
-
function surfaceRows(surface, maxWidth) {
|
|
312
|
-
const width = maxWidth != null ? Math.max(0, Math.min(surface.width, maxWidth)) : surface.width;
|
|
313
|
-
if (surface.height <= 0)
|
|
314
|
-
return [createSurface(width, 1)];
|
|
315
|
-
const rows = [];
|
|
316
|
-
for (let y = 0; y < surface.height; y++) {
|
|
317
|
-
const row = createSurface(width, 1);
|
|
318
|
-
if (width > 0)
|
|
319
|
-
row.blit(surface, 0, 0, 0, y, width, 1);
|
|
320
|
-
rows.push(row);
|
|
321
|
-
}
|
|
322
|
-
return rows;
|
|
323
|
-
}
|
|
324
|
-
function contentLines(content, maxWidth) {
|
|
325
|
-
if (typeof content === 'string') {
|
|
326
|
-
return content.split('\n').map((line) => lineSurface(maxWidth != null ? clipToWidth(line, maxWidth) : line));
|
|
327
|
-
}
|
|
328
|
-
return surfaceRows(content, maxWidth);
|
|
329
|
-
}
|
|
330
|
-
function renderBoxSurface(lines, borderStyle, fillStyle, innerWidthOverride) {
|
|
331
|
-
const innerWidth = innerWidthOverride ?? lines.reduce((max, line) => Math.max(max, line.width), 0);
|
|
332
|
-
const width = innerWidth + 4;
|
|
333
|
-
const height = lines.length + 2;
|
|
334
|
-
const surface = createSurface(width, height);
|
|
335
|
-
setStyledCell(surface, 0, 0, BORDER.tl, borderStyle);
|
|
336
|
-
for (let x = 1; x < width - 1; x++)
|
|
337
|
-
setStyledCell(surface, x, 0, BORDER.h, borderStyle);
|
|
338
|
-
setStyledCell(surface, width - 1, 0, BORDER.tr, borderStyle);
|
|
339
|
-
setStyledCell(surface, 0, height - 1, BORDER.bl, borderStyle);
|
|
340
|
-
for (let x = 1; x < width - 1; x++)
|
|
341
|
-
setStyledCell(surface, x, height - 1, BORDER.h, borderStyle);
|
|
342
|
-
setStyledCell(surface, width - 1, height - 1, BORDER.br, borderStyle);
|
|
343
|
-
for (let i = 0; i < lines.length; i++) {
|
|
344
|
-
const y = i + 1;
|
|
345
|
-
setStyledCell(surface, 0, y, BORDER.v, borderStyle);
|
|
346
|
-
for (let x = 1; x < width - 1; x++)
|
|
347
|
-
setStyledCell(surface, x, y, ' ', fillStyle);
|
|
348
|
-
setStyledCell(surface, width - 1, y, BORDER.v, borderStyle);
|
|
349
|
-
const line = lineWithInheritedBackground(lines[i], fillStyle);
|
|
350
|
-
if (line.width > 0 && innerWidth > 0) {
|
|
351
|
-
surface.blit(line, 2, y, 0, 0, Math.min(line.width, innerWidth), 1);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
return surface;
|
|
355
|
-
}
|
|
356
|
-
// ---------------------------------------------------------------------------
|
|
357
|
-
// modal()
|
|
358
|
-
// ---------------------------------------------------------------------------
|
|
359
|
-
/**
|
|
360
|
-
* Create a centered modal dialog overlay.
|
|
361
|
-
*
|
|
362
|
-
* Build a bordered box with optional title, body, and hint text,
|
|
363
|
-
* then center it on screen.
|
|
364
|
-
*
|
|
365
|
-
* @param options - Modal configuration including content and screen dimensions.
|
|
366
|
-
* @returns Overlay positioned at the center of the screen.
|
|
367
|
-
*/
|
|
368
|
-
export function modal(options) {
|
|
369
|
-
const { title, body, hint, screenWidth, screenHeight, ctx } = options;
|
|
370
|
-
const lines = [];
|
|
371
|
-
if (title != null) {
|
|
372
|
-
lines.push(lineSurface(title, ctx ? { modifiers: ['bold'] } : {}), createSurface(0, 1));
|
|
373
|
-
}
|
|
374
|
-
lines.push(...contentLines(body));
|
|
375
|
-
if (hint != null) {
|
|
376
|
-
lines.push(createSurface(0, 1));
|
|
377
|
-
if (typeof hint === 'string') {
|
|
378
|
-
lines.push(lineSurface(hint, styleFromToken(ctx?.semantic('muted'), ctx)));
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
lines.push(...surfaceRows(hint));
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
const surface = renderBoxSurface(lines, styleFromToken(options.borderToken, ctx), backgroundStyleFromToken(options.bgToken, ctx), options.width != null ? Math.max(0, options.width - 4) : undefined);
|
|
385
|
-
const margin = resolveOverlayMargin(screenWidth, screenHeight, options.margin);
|
|
386
|
-
const row = clampCenteredPosition(screenHeight, surface.height, margin);
|
|
387
|
-
const col = clampCenteredPosition(screenWidth, surface.width, margin);
|
|
388
|
-
return { content: overlayContentFromSurface(surface, ctx), surface, row, col };
|
|
389
|
-
}
|
|
390
|
-
// ---------------------------------------------------------------------------
|
|
391
|
-
// toast()
|
|
392
|
-
// ---------------------------------------------------------------------------
|
|
393
|
-
/** Unicode icon characters mapped by toast variant. */
|
|
394
|
-
const TOAST_ICONS = {
|
|
395
|
-
success: forceTextPresentation('\u2714'), // ✔
|
|
396
|
-
error: forceTextPresentation('\u2718'), // ✘
|
|
397
|
-
info: forceTextPresentation('\u2139'), // ℹ
|
|
398
|
-
};
|
|
399
|
-
/** Semantic border token keys mapped by toast variant. */
|
|
400
|
-
const TOAST_BORDER = {
|
|
401
|
-
success: 'success',
|
|
402
|
-
error: 'error',
|
|
403
|
-
info: 'primary',
|
|
404
|
-
};
|
|
405
|
-
/**
|
|
406
|
-
* Create an anchored toast notification overlay.
|
|
407
|
-
*
|
|
408
|
-
* Render a bordered box with a variant icon and message, positioned
|
|
409
|
-
* at the specified screen corner with configurable margin.
|
|
410
|
-
*
|
|
411
|
-
* @param options - Toast configuration including message, variant, and screen dimensions.
|
|
412
|
-
* @returns Overlay positioned at the specified screen corner.
|
|
413
|
-
*/
|
|
414
|
-
export function toast(options) {
|
|
415
|
-
const { message, variant = 'info', anchor = 'bottom-right', screenWidth, screenHeight, margin, ctx, } = options;
|
|
416
|
-
const resolvedMargin = resolveOverlayMargin(screenWidth, screenHeight, margin);
|
|
417
|
-
const icon = TOAST_ICONS[variant];
|
|
418
|
-
const line = lineSurface(`${icon} ${message}`, styleFromToken(ctx?.semantic(variant), ctx));
|
|
419
|
-
const surface = renderBoxSurface([line], styleFromToken(ctx?.border(TOAST_BORDER[variant]), ctx), backgroundStyleFromToken(options.bgToken, ctx));
|
|
420
|
-
let row;
|
|
421
|
-
let col;
|
|
422
|
-
switch (anchor) {
|
|
423
|
-
case 'top-right':
|
|
424
|
-
row = resolvedMargin;
|
|
425
|
-
col = screenWidth - surface.width - resolvedMargin;
|
|
426
|
-
break;
|
|
427
|
-
case 'bottom-right':
|
|
428
|
-
row = screenHeight - surface.height - resolvedMargin;
|
|
429
|
-
col = screenWidth - surface.width - resolvedMargin;
|
|
430
|
-
break;
|
|
431
|
-
case 'bottom-left':
|
|
432
|
-
row = screenHeight - surface.height - resolvedMargin;
|
|
433
|
-
col = resolvedMargin;
|
|
434
|
-
break;
|
|
435
|
-
case 'top-left':
|
|
436
|
-
row = resolvedMargin;
|
|
437
|
-
col = resolvedMargin;
|
|
438
|
-
break;
|
|
439
|
-
}
|
|
440
|
-
row = Math.max(0, row);
|
|
441
|
-
col = Math.max(0, col);
|
|
442
|
-
return { content: overlayContentFromSurface(surface, ctx), surface, row, col };
|
|
443
|
-
}
|
|
444
|
-
// ---------------------------------------------------------------------------
|
|
445
|
-
// drawer()
|
|
446
|
-
// ---------------------------------------------------------------------------
|
|
447
|
-
/**
|
|
448
|
-
* Create a drawer overlay anchored to a screen edge.
|
|
449
|
-
*
|
|
450
|
-
* Supports horizontal anchors (`left`/`right`) that span the full screen height,
|
|
451
|
-
* and vertical anchors (`top`/`bottom`) that span the full screen width.
|
|
452
|
-
* Defaults to the right edge when no anchor is specified.
|
|
453
|
-
* Renders a bordered panel with optional title in the top border.
|
|
454
|
-
*
|
|
455
|
-
* When an optional `region` is provided, the drawer is constrained to that
|
|
456
|
-
* sub-region rectangle instead of spanning the full screen dimensions.
|
|
457
|
-
*
|
|
458
|
-
* @param options - Drawer configuration including content, anchor, and dimensions.
|
|
459
|
-
* @returns Overlay positioned at the specified screen edge.
|
|
460
|
-
*/
|
|
461
|
-
export function drawer(options) {
|
|
462
|
-
const { content, screenWidth, screenHeight, title, ctx, } = options;
|
|
463
|
-
const region = clampRegion(options.region, screenWidth, screenHeight);
|
|
464
|
-
const dims = resolveDrawerDimensions(options, region);
|
|
465
|
-
const { width, height, row, col } = dims;
|
|
466
|
-
const innerWidth = Math.max(0, width - 4); // border + padding on each side
|
|
467
|
-
const borderStyle = styleFromToken(options.borderToken, ctx);
|
|
468
|
-
const fillStyle = backgroundStyleFromToken(options.bgToken, ctx);
|
|
469
|
-
const titleStyle = ctx ? { modifiers: ['bold'] } : {};
|
|
470
|
-
const surface = createSurface(width, height);
|
|
471
|
-
if (width === 0 || height === 0) {
|
|
472
|
-
return { content: overlayContentFromSurface(surface, ctx), surface, row, col };
|
|
473
|
-
}
|
|
474
|
-
for (let x = 0; x < width; x++) {
|
|
475
|
-
const topChar = x === 0 ? BORDER.tl : x === width - 1 ? BORDER.tr : BORDER.h;
|
|
476
|
-
setStyledCell(surface, x, 0, topChar, borderStyle);
|
|
477
|
-
if (height > 1) {
|
|
478
|
-
const bottomChar = x === 0 ? BORDER.bl : x === width - 1 ? BORDER.br : BORDER.h;
|
|
479
|
-
setStyledCell(surface, x, height - 1, bottomChar, borderStyle);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
if (title != null && width > 2) {
|
|
483
|
-
const titleLine = lineSurface(title, titleStyle);
|
|
484
|
-
const spanWidth = Math.min(width - 2, titleLine.width + 2);
|
|
485
|
-
const startX = 1 + Math.max(0, Math.floor(((width - 2) - spanWidth) / 2));
|
|
486
|
-
setStyledCell(surface, startX, 0, ' ', borderStyle);
|
|
487
|
-
const mergedTitleStyle = mergeStyles(borderStyle, titleStyle);
|
|
488
|
-
for (let x = 0; x < Math.min(titleLine.width, Math.max(0, spanWidth - 2)); x++) {
|
|
489
|
-
setStyledCell(surface, startX + 1 + x, 0, titleLine.get(x, 0).char, mergedTitleStyle);
|
|
490
|
-
}
|
|
491
|
-
if (spanWidth >= 2) {
|
|
492
|
-
setStyledCell(surface, startX + spanWidth - 1, 0, ' ', borderStyle);
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
const rows = contentLines(content, innerWidth);
|
|
496
|
-
const availableHeight = Math.max(0, height - 2);
|
|
497
|
-
for (let i = 0; i < availableHeight; i++) {
|
|
498
|
-
const y = i + 1;
|
|
499
|
-
if (width >= 1)
|
|
500
|
-
setStyledCell(surface, 0, y, BORDER.v, borderStyle);
|
|
501
|
-
for (let x = 1; x < Math.max(1, width - 1); x++) {
|
|
502
|
-
if (x < width - 1)
|
|
503
|
-
setStyledCell(surface, x, y, ' ', fillStyle);
|
|
504
|
-
}
|
|
505
|
-
if (width >= 2)
|
|
506
|
-
setStyledCell(surface, width - 1, y, BORDER.v, borderStyle);
|
|
507
|
-
const line = lineWithInheritedBackground(rows[i] ?? createSurface(0, 1), fillStyle);
|
|
508
|
-
if (line.width > 0 && innerWidth > 0 && width >= 4) {
|
|
509
|
-
surface.blit(line, 2, y, 0, 0, Math.min(line.width, innerWidth), 1);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
return {
|
|
513
|
-
content: overlayContentFromSurface(surface, ctx),
|
|
514
|
-
surface,
|
|
515
|
-
row,
|
|
516
|
-
col,
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
/** Compute the final width, height, row, and col for a drawer given its anchor. */
|
|
520
|
-
function resolveDrawerDimensions(options, region) {
|
|
521
|
-
if (options.anchor === 'top' || options.anchor === 'bottom') {
|
|
522
|
-
const anchor = options.anchor;
|
|
523
|
-
const heightRaw = options.height;
|
|
524
|
-
if (heightRaw == null || !Number.isFinite(heightRaw)) {
|
|
525
|
-
throw new Error(`drawer(): "height" is required for anchor "${anchor}"`);
|
|
526
|
-
}
|
|
527
|
-
const height = clamp(Math.floor(heightRaw), 0, region.height);
|
|
528
|
-
const width = region.width;
|
|
529
|
-
const col = region.col;
|
|
530
|
-
const row = anchor === 'top'
|
|
531
|
-
? region.row
|
|
532
|
-
: region.row + region.height - height;
|
|
533
|
-
return { width, height, row: Math.max(region.row, row), col };
|
|
534
|
-
}
|
|
535
|
-
const anchor = options.anchor ?? 'right';
|
|
536
|
-
if (anchor === 'left' || anchor === 'right') {
|
|
537
|
-
const widthRaw = options.width;
|
|
538
|
-
if (widthRaw == null || !Number.isFinite(widthRaw)) {
|
|
539
|
-
throw new Error(`drawer(): "width" is required for anchor "${anchor}"`);
|
|
540
|
-
}
|
|
541
|
-
const width = clamp(Math.floor(widthRaw), 0, region.width);
|
|
542
|
-
const height = region.height;
|
|
543
|
-
const row = region.row;
|
|
544
|
-
const col = anchor === 'left'
|
|
545
|
-
? region.col
|
|
546
|
-
: region.col + region.width - width;
|
|
547
|
-
return { width, height, row, col: Math.max(region.col, col) };
|
|
548
|
-
}
|
|
549
|
-
return assertNever(anchor);
|
|
550
|
-
}
|
|
551
|
-
/** Exhaustive check — always throws. */
|
|
552
|
-
function assertNever(value) {
|
|
553
|
-
throw new Error(`Unexpected drawer anchor: ${String(value)}`);
|
|
554
|
-
}
|
|
555
|
-
/** Normalize an optional region into a clamped LayoutRect within screen bounds. */
|
|
556
|
-
function clampRegion(region, screenWidth, screenHeight) {
|
|
557
|
-
const sw = Math.floor(screenWidth);
|
|
558
|
-
const sh = Math.floor(screenHeight);
|
|
559
|
-
if (region == null) {
|
|
560
|
-
return {
|
|
561
|
-
row: 0,
|
|
562
|
-
col: 0,
|
|
563
|
-
width: Math.floor(Math.max(0, sw)),
|
|
564
|
-
height: Math.floor(Math.max(0, sh)),
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
const row = Math.floor(clamp(region.row, 0, Math.max(0, sh)));
|
|
568
|
-
const col = Math.floor(clamp(region.col, 0, Math.max(0, sw)));
|
|
569
|
-
const maxWidth = Math.max(0, sw - col);
|
|
570
|
-
const maxHeight = Math.max(0, sh - row);
|
|
571
|
-
return {
|
|
572
|
-
row,
|
|
573
|
-
col,
|
|
574
|
-
width: Math.floor(clamp(region.width, 0, maxWidth)),
|
|
575
|
-
height: Math.floor(clamp(region.height, 0, maxHeight)),
|
|
576
|
-
};
|
|
577
|
-
}
|
|
578
|
-
/** Clamp a number between min and max. */
|
|
579
|
-
function clamp(value, min, max) {
|
|
580
|
-
return Math.max(min, Math.min(max, value));
|
|
581
|
-
}
|
|
582
|
-
// ---------------------------------------------------------------------------
|
|
583
|
-
// tooltip()
|
|
584
|
-
// ---------------------------------------------------------------------------
|
|
585
|
-
/**
|
|
586
|
-
* Create a tooltip overlay positioned relative to a target element.
|
|
587
|
-
*
|
|
588
|
-
* Render a bordered box containing the content, placed in the specified
|
|
589
|
-
* direction from the target. Clamp to screen bounds to prevent overflow.
|
|
590
|
-
*
|
|
591
|
-
* @param options - Tooltip configuration including content, target position, and direction.
|
|
592
|
-
* @returns Overlay positioned relative to the target, clamped to screen bounds.
|
|
593
|
-
*/
|
|
594
|
-
export function tooltip(options) {
|
|
595
|
-
const { content, row: targetRow, col: targetCol, direction = 'top', screenWidth, screenHeight, borderToken, bgToken, ctx, } = options;
|
|
596
|
-
const maxContentWidth = Math.max(0, screenWidth - 4);
|
|
597
|
-
const lines = contentLines(content, maxContentWidth);
|
|
598
|
-
const surface = renderBoxSurface(lines, styleFromToken(borderToken, ctx), backgroundStyleFromToken(bgToken, ctx));
|
|
599
|
-
let tipRow;
|
|
600
|
-
let tipCol;
|
|
601
|
-
switch (direction) {
|
|
602
|
-
case 'top':
|
|
603
|
-
tipRow = targetRow - surface.height;
|
|
604
|
-
tipCol = targetCol - Math.floor(surface.width / 2);
|
|
605
|
-
break;
|
|
606
|
-
case 'bottom':
|
|
607
|
-
tipRow = targetRow + 1;
|
|
608
|
-
tipCol = targetCol - Math.floor(surface.width / 2);
|
|
609
|
-
break;
|
|
610
|
-
case 'left':
|
|
611
|
-
tipRow = targetRow - Math.floor(surface.height / 2);
|
|
612
|
-
tipCol = targetCol - surface.width;
|
|
613
|
-
break;
|
|
614
|
-
case 'right':
|
|
615
|
-
tipRow = targetRow - Math.floor(surface.height / 2);
|
|
616
|
-
tipCol = targetCol + 1;
|
|
617
|
-
break;
|
|
618
|
-
}
|
|
619
|
-
// Clamp to screen bounds
|
|
620
|
-
tipRow = Math.max(0, Math.min(tipRow, screenHeight - surface.height));
|
|
621
|
-
tipCol = Math.max(0, Math.min(tipCol, screenWidth - surface.width));
|
|
622
|
-
return { content: overlayContentFromSurface(surface, ctx), surface, row: tipRow, col: tipCol };
|
|
623
|
-
}
|
|
624
|
-
function surfaceFromContent(content) {
|
|
625
|
-
const lines = content.split('\n');
|
|
626
|
-
const width = Math.max(1, ...lines.map((line) => visibleLength(line)));
|
|
627
|
-
const height = Math.max(1, lines.length);
|
|
628
|
-
return parseAnsiToSurface(content, width, height);
|
|
629
|
-
}
|
|
1
|
+
export { composite, compositeSurface, compositeSurfaceInto } from './overlay.part02.js';
|
|
2
|
+
export { modal } from './overlay.part05.js';
|
|
3
|
+
export { toast } from './overlay.part06.js';
|
|
4
|
+
export { drawer } from './overlay.part07.js';
|
|
5
|
+
export { tooltip } from './overlay.part09.js';
|
|
630
6
|
//# sourceMappingURL=overlay.js.map
|