@inhuman.tools/quickdraw 0.0.0-bootstrap.0 → 0.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/LICENSE.md +7 -0
- package/README.md +102 -1
- package/aurora.vert +168 -0
- package/dist/bench/host.d.ts +62 -0
- package/dist/bench/host.d.ts.map +1 -0
- package/dist/bench/host.js +77 -0
- package/dist/bench/host.js.map +1 -0
- package/dist/bench/main.d.ts +6 -0
- package/dist/bench/main.d.ts.map +1 -0
- package/dist/bench/main.js +118 -0
- package/dist/bench/main.js.map +1 -0
- package/dist/bench/model.d.ts +36 -0
- package/dist/bench/model.d.ts.map +1 -0
- package/dist/bench/model.js +112 -0
- package/dist/bench/model.js.map +1 -0
- package/dist/bench/tea.d.ts +14 -0
- package/dist/bench/tea.d.ts.map +1 -0
- package/dist/bench/tea.js +6 -0
- package/dist/bench/tea.js.map +1 -0
- package/dist/bench/view.d.ts +9 -0
- package/dist/bench/view.d.ts.map +1 -0
- package/dist/bench/view.js +88 -0
- package/dist/bench/view.js.map +1 -0
- package/dist/bench/worker.d.ts +6 -0
- package/dist/bench/worker.d.ts.map +1 -0
- package/dist/bench/worker.js +46 -0
- package/dist/bench/worker.js.map +1 -0
- package/dist/buffer/bgfx-mark.d.ts +32 -0
- package/dist/buffer/bgfx-mark.d.ts.map +1 -0
- package/dist/buffer/bgfx-mark.js +43 -0
- package/dist/buffer/bgfx-mark.js.map +1 -0
- package/dist/buffer/index.d.ts +191 -0
- package/dist/buffer/index.d.ts.map +1 -0
- package/dist/buffer/index.js +353 -0
- package/dist/buffer/index.js.map +1 -0
- package/dist/capabilities/env.d.ts +23 -0
- package/dist/capabilities/env.d.ts.map +1 -0
- package/dist/capabilities/env.js +35 -0
- package/dist/capabilities/env.js.map +1 -0
- package/dist/capabilities/index.d.ts +13 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +13 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/parse.d.ts +41 -0
- package/dist/capabilities/parse.d.ts.map +1 -0
- package/dist/capabilities/parse.js +86 -0
- package/dist/capabilities/parse.js.map +1 -0
- package/dist/capabilities/probe.d.ts +37 -0
- package/dist/capabilities/probe.d.ts.map +1 -0
- package/dist/capabilities/probe.js +75 -0
- package/dist/capabilities/probe.js.map +1 -0
- package/dist/capabilities/sequences.d.ts +33 -0
- package/dist/capabilities/sequences.d.ts.map +1 -0
- package/dist/capabilities/sequences.js +36 -0
- package/dist/capabilities/sequences.js.map +1 -0
- package/dist/capabilities/types.d.ts +25 -0
- package/dist/capabilities/types.d.ts.map +1 -0
- package/dist/capabilities/types.js +5 -0
- package/dist/capabilities/types.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/input/decode.d.ts +167 -0
- package/dist/input/decode.d.ts.map +1 -0
- package/dist/input/decode.js +825 -0
- package/dist/input/decode.js.map +1 -0
- package/dist/input/draft.d.ts +85 -0
- package/dist/input/draft.d.ts.map +1 -0
- package/dist/input/draft.js +276 -0
- package/dist/input/draft.js.map +1 -0
- package/dist/input/index.d.ts +3 -0
- package/dist/input/index.d.ts.map +1 -0
- package/dist/input/index.js +3 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/prompt-blocks.d.ts +58 -0
- package/dist/input/prompt-blocks.d.ts.map +1 -0
- package/dist/input/prompt-blocks.js +48 -0
- package/dist/input/prompt-blocks.js.map +1 -0
- package/dist/input/rich-draft.d.ts +46 -0
- package/dist/input/rich-draft.d.ts.map +1 -0
- package/dist/input/rich-draft.js +391 -0
- package/dist/input/rich-draft.js.map +1 -0
- package/dist/input/rich-hit.d.ts +17 -0
- package/dist/input/rich-hit.d.ts.map +1 -0
- package/dist/input/rich-hit.js +89 -0
- package/dist/input/rich-hit.js.map +1 -0
- package/dist/input/rich-intake.d.ts +16 -0
- package/dist/input/rich-intake.d.ts.map +1 -0
- package/dist/input/rich-intake.js +22 -0
- package/dist/input/rich-intake.js.map +1 -0
- package/dist/input/rich-paint.d.ts +13 -0
- package/dist/input/rich-paint.d.ts.map +1 -0
- package/dist/input/rich-paint.js +18 -0
- package/dist/input/rich-paint.js.map +1 -0
- package/dist/internals/bgfx/index.d.ts +17 -0
- package/dist/internals/bgfx/index.d.ts.map +1 -0
- package/dist/internals/bgfx/index.js +17 -0
- package/dist/internals/bgfx/index.js.map +1 -0
- package/dist/internals/bgfx/materialize.d.ts +31 -0
- package/dist/internals/bgfx/materialize.d.ts.map +1 -0
- package/dist/internals/bgfx/materialize.js +117 -0
- package/dist/internals/bgfx/materialize.js.map +1 -0
- package/dist/internals/bgfx/opacity.d.ts +37 -0
- package/dist/internals/bgfx/opacity.d.ts.map +1 -0
- package/dist/internals/bgfx/opacity.js +76 -0
- package/dist/internals/bgfx/opacity.js.map +1 -0
- package/dist/internals/bgfx/registry.d.ts +13 -0
- package/dist/internals/bgfx/registry.d.ts.map +1 -0
- package/dist/internals/bgfx/registry.js +24 -0
- package/dist/internals/bgfx/registry.js.map +1 -0
- package/dist/internals/bgfx/sab-layout.d.ts +61 -0
- package/dist/internals/bgfx/sab-layout.d.ts.map +1 -0
- package/dist/internals/bgfx/sab-layout.js +107 -0
- package/dist/internals/bgfx/sab-layout.js.map +1 -0
- package/dist/internals/bgfx/shader-frame-host.d.ts +22 -0
- package/dist/internals/bgfx/shader-frame-host.d.ts.map +1 -0
- package/dist/internals/bgfx/shader-frame-host.js +165 -0
- package/dist/internals/bgfx/shader-frame-host.js.map +1 -0
- package/dist/internals/bgfx/shadertoy-catalog.d.ts +41 -0
- package/dist/internals/bgfx/shadertoy-catalog.d.ts.map +1 -0
- package/dist/internals/bgfx/shadertoy-catalog.js +200 -0
- package/dist/internals/bgfx/shadertoy-catalog.js.map +1 -0
- package/dist/internals/bgfx/shadertoy-gl.d.ts +38 -0
- package/dist/internals/bgfx/shadertoy-gl.d.ts.map +1 -0
- package/dist/internals/bgfx/shadertoy-gl.js +283 -0
- package/dist/internals/bgfx/shadertoy-gl.js.map +1 -0
- package/dist/internals/bgfx/types.d.ts +51 -0
- package/dist/internals/bgfx/types.d.ts.map +1 -0
- package/dist/internals/bgfx/types.js +14 -0
- package/dist/internals/bgfx/types.js.map +1 -0
- package/dist/internals/bgfx-worker.d.ts +6 -0
- package/dist/internals/bgfx-worker.d.ts.map +1 -0
- package/dist/internals/bgfx-worker.js +131 -0
- package/dist/internals/bgfx-worker.js.map +1 -0
- package/dist/layout/birth.d.ts +77 -0
- package/dist/layout/birth.d.ts.map +1 -0
- package/dist/layout/birth.js +148 -0
- package/dist/layout/birth.js.map +1 -0
- package/dist/layout/children.d.ts +5 -0
- package/dist/layout/children.d.ts.map +1 -0
- package/dist/layout/children.js +19 -0
- package/dist/layout/children.js.map +1 -0
- package/dist/layout/chrome_frame.d.ts +254 -0
- package/dist/layout/chrome_frame.d.ts.map +1 -0
- package/dist/layout/chrome_frame.js +1080 -0
- package/dist/layout/chrome_frame.js.map +1 -0
- package/dist/layout/chrome_mask.d.ts +40 -0
- package/dist/layout/chrome_mask.d.ts.map +1 -0
- package/dist/layout/chrome_mask.js +150 -0
- package/dist/layout/chrome_mask.js.map +1 -0
- package/dist/layout/engine.d.ts +49 -0
- package/dist/layout/engine.d.ts.map +1 -0
- package/dist/layout/engine.js +1269 -0
- package/dist/layout/engine.js.map +1 -0
- package/dist/layout/flex.d.ts +36 -0
- package/dist/layout/flex.d.ts.map +1 -0
- package/dist/layout/flex.js +111 -0
- package/dist/layout/flex.js.map +1 -0
- package/dist/layout/grid.d.ts +36 -0
- package/dist/layout/grid.d.ts.map +1 -0
- package/dist/layout/grid.js +126 -0
- package/dist/layout/grid.js.map +1 -0
- package/dist/layout/index.d.ts +30 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +30 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/indication.d.ts +34 -0
- package/dist/layout/indication.d.ts.map +1 -0
- package/dist/layout/indication.js +68 -0
- package/dist/layout/indication.js.map +1 -0
- package/dist/layout/length.d.ts +18 -0
- package/dist/layout/length.d.ts.map +1 -0
- package/dist/layout/length.js +24 -0
- package/dist/layout/length.js.map +1 -0
- package/dist/layout/live_paint.d.ts +145 -0
- package/dist/layout/live_paint.d.ts.map +1 -0
- package/dist/layout/live_paint.js +255 -0
- package/dist/layout/live_paint.js.map +1 -0
- package/dist/layout/markdown.d.ts +22 -0
- package/dist/layout/markdown.d.ts.map +1 -0
- package/dist/layout/markdown.js +167 -0
- package/dist/layout/markdown.js.map +1 -0
- package/dist/layout/measure.d.ts +46 -0
- package/dist/layout/measure.d.ts.map +1 -0
- package/dist/layout/measure.js +307 -0
- package/dist/layout/measure.js.map +1 -0
- package/dist/layout/paint-hotkey.d.ts +45 -0
- package/dist/layout/paint-hotkey.d.ts.map +1 -0
- package/dist/layout/paint-hotkey.js +152 -0
- package/dist/layout/paint-hotkey.js.map +1 -0
- package/dist/layout/paint.d.ts +25 -0
- package/dist/layout/paint.d.ts.map +1 -0
- package/dist/layout/paint.js +189 -0
- package/dist/layout/paint.js.map +1 -0
- package/dist/layout/paint_theme.d.ts +85 -0
- package/dist/layout/paint_theme.d.ts.map +1 -0
- package/dist/layout/paint_theme.js +76 -0
- package/dist/layout/paint_theme.js.map +1 -0
- package/dist/layout/progress.d.ts +31 -0
- package/dist/layout/progress.d.ts.map +1 -0
- package/dist/layout/progress.js +83 -0
- package/dist/layout/progress.js.map +1 -0
- package/dist/layout/selection.d.ts +136 -0
- package/dist/layout/selection.d.ts.map +1 -0
- package/dist/layout/selection.js +312 -0
- package/dist/layout/selection.js.map +1 -0
- package/dist/layout/selection_gesture.d.ts +88 -0
- package/dist/layout/selection_gesture.d.ts.map +1 -0
- package/dist/layout/selection_gesture.js +239 -0
- package/dist/layout/selection_gesture.js.map +1 -0
- package/dist/layout/selection_paint.d.ts +47 -0
- package/dist/layout/selection_paint.d.ts.map +1 -0
- package/dist/layout/selection_paint.js +320 -0
- package/dist/layout/selection_paint.js.map +1 -0
- package/dist/layout/serialize.d.ts +49 -0
- package/dist/layout/serialize.d.ts.map +1 -0
- package/dist/layout/serialize.js +437 -0
- package/dist/layout/serialize.js.map +1 -0
- package/dist/layout/squeeze.d.ts +58 -0
- package/dist/layout/squeeze.d.ts.map +1 -0
- package/dist/layout/squeeze.js +239 -0
- package/dist/layout/squeeze.js.map +1 -0
- package/dist/layout/text.d.ts +44 -0
- package/dist/layout/text.d.ts.map +1 -0
- package/dist/layout/text.js +230 -0
- package/dist/layout/text.js.map +1 -0
- package/dist/layout/theme_store.d.ts +21 -0
- package/dist/layout/theme_store.d.ts.map +1 -0
- package/dist/layout/theme_store.js +133 -0
- package/dist/layout/theme_store.js.map +1 -0
- package/dist/layout/types.d.ts +564 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/layout/types.js +2 -0
- package/dist/layout/types.js.map +1 -0
- package/dist/layout/visual_draft.d.ts +60 -0
- package/dist/layout/visual_draft.d.ts.map +1 -0
- package/dist/layout/visual_draft.js +199 -0
- package/dist/layout/visual_draft.js.map +1 -0
- package/dist/lexicon/color.d.ts +22 -0
- package/dist/lexicon/color.d.ts.map +1 -0
- package/dist/lexicon/color.js +6 -0
- package/dist/lexicon/color.js.map +1 -0
- package/dist/lexicon/index.d.ts +15 -0
- package/dist/lexicon/index.d.ts.map +1 -0
- package/dist/lexicon/index.js +15 -0
- package/dist/lexicon/index.js.map +1 -0
- package/dist/lexicon/prominence.d.ts +46 -0
- package/dist/lexicon/prominence.d.ts.map +1 -0
- package/dist/lexicon/prominence.js +73 -0
- package/dist/lexicon/prominence.js.map +1 -0
- package/dist/lexicon/quarantine.d.ts +21 -0
- package/dist/lexicon/quarantine.d.ts.map +1 -0
- package/dist/lexicon/quarantine.js +15 -0
- package/dist/lexicon/quarantine.js.map +1 -0
- package/dist/lexicon/roles.d.ts +37 -0
- package/dist/lexicon/roles.d.ts.map +1 -0
- package/dist/lexicon/roles.js +52 -0
- package/dist/lexicon/roles.js.map +1 -0
- package/dist/lexicon/tiers.d.ts +18 -0
- package/dist/lexicon/tiers.d.ts.map +1 -0
- package/dist/lexicon/tiers.js +17 -0
- package/dist/lexicon/tiers.js.map +1 -0
- package/dist/measure/index.d.ts +43 -0
- package/dist/measure/index.d.ts.map +1 -0
- package/dist/measure/index.js +120 -0
- package/dist/measure/index.js.map +1 -0
- package/dist/render.d.ts +72 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +164 -0
- package/dist/render.js.map +1 -0
- package/dist/runtime/agents_keys.d.ts +8 -0
- package/dist/runtime/agents_keys.d.ts.map +1 -0
- package/dist/runtime/agents_keys.js +24 -0
- package/dist/runtime/agents_keys.js.map +1 -0
- package/dist/runtime/agents_peek.d.ts +44 -0
- package/dist/runtime/agents_peek.d.ts.map +1 -0
- package/dist/runtime/agents_peek.js +96 -0
- package/dist/runtime/agents_peek.js.map +1 -0
- package/dist/runtime/agents_preview.d.ts +27 -0
- package/dist/runtime/agents_preview.d.ts.map +1 -0
- package/dist/runtime/agents_preview.js +122 -0
- package/dist/runtime/agents_preview.js.map +1 -0
- package/dist/runtime/box_bus.d.ts +144 -0
- package/dist/runtime/box_bus.d.ts.map +1 -0
- package/dist/runtime/box_bus.js +74 -0
- package/dist/runtime/box_bus.js.map +1 -0
- package/dist/runtime/clipboard-image.d.ts +20 -0
- package/dist/runtime/clipboard-image.d.ts.map +1 -0
- package/dist/runtime/clipboard-image.js +62 -0
- package/dist/runtime/clipboard-image.js.map +1 -0
- package/dist/runtime/copy_toast.d.ts +46 -0
- package/dist/runtime/copy_toast.d.ts.map +1 -0
- package/dist/runtime/copy_toast.js +117 -0
- package/dist/runtime/copy_toast.js.map +1 -0
- package/dist/runtime/echo.d.ts +41 -0
- package/dist/runtime/echo.d.ts.map +1 -0
- package/dist/runtime/echo.js +112 -0
- package/dist/runtime/echo.js.map +1 -0
- package/dist/runtime/frame.d.ts +79 -0
- package/dist/runtime/frame.d.ts.map +1 -0
- package/dist/runtime/frame.js +258 -0
- package/dist/runtime/frame.js.map +1 -0
- package/dist/runtime/index.d.ts +16 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +16 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/key_buffer.d.ts +19 -0
- package/dist/runtime/key_buffer.d.ts.map +1 -0
- package/dist/runtime/key_buffer.js +24 -0
- package/dist/runtime/key_buffer.js.map +1 -0
- package/dist/runtime/keys.d.ts +66 -0
- package/dist/runtime/keys.d.ts.map +1 -0
- package/dist/runtime/keys.js +220 -0
- package/dist/runtime/keys.js.map +1 -0
- package/dist/runtime/paint_snapshot.d.ts +9 -0
- package/dist/runtime/paint_snapshot.d.ts.map +1 -0
- package/dist/runtime/paint_snapshot.js +8 -0
- package/dist/runtime/paint_snapshot.js.map +1 -0
- package/dist/runtime/paint_source.d.ts +266 -0
- package/dist/runtime/paint_source.d.ts.map +1 -0
- package/dist/runtime/paint_source.js +532 -0
- package/dist/runtime/paint_source.js.map +1 -0
- package/dist/runtime/present_loop.d.ts +11 -0
- package/dist/runtime/present_loop.d.ts.map +1 -0
- package/dist/runtime/present_loop.js +46 -0
- package/dist/runtime/present_loop.js.map +1 -0
- package/dist/runtime/present_profile.d.ts +58 -0
- package/dist/runtime/present_profile.d.ts.map +1 -0
- package/dist/runtime/present_profile.js +130 -0
- package/dist/runtime/present_profile.js.map +1 -0
- package/dist/runtime/raster.d.ts +24 -0
- package/dist/runtime/raster.d.ts.map +1 -0
- package/dist/runtime/raster.js +43 -0
- package/dist/runtime/raster.js.map +1 -0
- package/dist/runtime/renderer.d.ts +151 -0
- package/dist/runtime/renderer.d.ts.map +1 -0
- package/dist/runtime/renderer.js +1607 -0
- package/dist/runtime/renderer.js.map +1 -0
- package/dist/runtime/screenshot.d.ts +9 -0
- package/dist/runtime/screenshot.d.ts.map +1 -0
- package/dist/runtime/screenshot.js +111 -0
- package/dist/runtime/screenshot.js.map +1 -0
- package/dist/runtime/selection_host.d.ts +41 -0
- package/dist/runtime/selection_host.d.ts.map +1 -0
- package/dist/runtime/selection_host.js +190 -0
- package/dist/runtime/selection_host.js.map +1 -0
- package/dist/runtime/stderr_hold.d.ts +16 -0
- package/dist/runtime/stderr_hold.d.ts.map +1 -0
- package/dist/runtime/stderr_hold.js +23 -0
- package/dist/runtime/stderr_hold.js.map +1 -0
- package/dist/runtime/thought_birth.d.ts +25 -0
- package/dist/runtime/thought_birth.d.ts.map +1 -0
- package/dist/runtime/thought_birth.js +122 -0
- package/dist/runtime/thought_birth.js.map +1 -0
- package/dist/runtime/thought_collapsed.d.ts +35 -0
- package/dist/runtime/thought_collapsed.d.ts.map +1 -0
- package/dist/runtime/thought_collapsed.js +94 -0
- package/dist/runtime/thought_collapsed.js.map +1 -0
- package/dist/runtime/tty.d.ts +58 -0
- package/dist/runtime/tty.d.ts.map +1 -0
- package/dist/runtime/tty.js +130 -0
- package/dist/runtime/tty.js.map +1 -0
- package/dist/theme/ansi16.d.ts +34 -0
- package/dist/theme/ansi16.d.ts.map +1 -0
- package/dist/theme/ansi16.js +181 -0
- package/dist/theme/ansi16.js.map +1 -0
- package/dist/theme/ansi256.d.ts +15 -0
- package/dist/theme/ansi256.d.ts.map +1 -0
- package/dist/theme/ansi256.js +94 -0
- package/dist/theme/ansi256.js.map +1 -0
- package/dist/theme/ground.d.ts +8 -0
- package/dist/theme/ground.d.ts.map +1 -0
- package/dist/theme/ground.js +11 -0
- package/dist/theme/ground.js.map +1 -0
- package/dist/theme/index.d.ts +10 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +10 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/region.d.ts +42 -0
- package/dist/theme/region.d.ts.map +1 -0
- package/dist/theme/region.js +105 -0
- package/dist/theme/region.js.map +1 -0
- package/dist/theme/resolver.d.ts +126 -0
- package/dist/theme/resolver.d.ts.map +1 -0
- package/dist/theme/resolver.js +366 -0
- package/dist/theme/resolver.js.map +1 -0
- package/dist/theme/salience.d.ts +90 -0
- package/dist/theme/salience.d.ts.map +1 -0
- package/dist/theme/salience.js +208 -0
- package/dist/theme/salience.js.map +1 -0
- package/dist/theme/seeds.d.ts +113 -0
- package/dist/theme/seeds.d.ts.map +1 -0
- package/dist/theme/seeds.js +52 -0
- package/dist/theme/seeds.js.map +1 -0
- package/dist/theme/selection.d.ts +94 -0
- package/dist/theme/selection.d.ts.map +1 -0
- package/dist/theme/selection.js +135 -0
- package/dist/theme/selection.js.map +1 -0
- package/dist/theme/theme.d.ts +41 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/theme.js +34 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/widgets/composer-caret.d.ts +47 -0
- package/dist/widgets/composer-caret.d.ts.map +1 -0
- package/dist/widgets/composer-caret.js +90 -0
- package/dist/widgets/composer-caret.js.map +1 -0
- package/dist/widgets/composer-click.d.ts +30 -0
- package/dist/widgets/composer-click.d.ts.map +1 -0
- package/dist/widgets/composer-click.js +89 -0
- package/dist/widgets/composer-click.js.map +1 -0
- package/dist/widgets/composer-command.d.ts +64 -0
- package/dist/widgets/composer-command.d.ts.map +1 -0
- package/dist/widgets/composer-command.js +127 -0
- package/dist/widgets/composer-command.js.map +1 -0
- package/dist/widgets/composer-frame.d.ts +74 -0
- package/dist/widgets/composer-frame.d.ts.map +1 -0
- package/dist/widgets/composer-frame.js +284 -0
- package/dist/widgets/composer-frame.js.map +1 -0
- package/dist/widgets/composer-picker.d.ts +89 -0
- package/dist/widgets/composer-picker.d.ts.map +1 -0
- package/dist/widgets/composer-picker.js +240 -0
- package/dist/widgets/composer-picker.js.map +1 -0
- package/dist/widgets/diff.d.ts +11 -0
- package/dist/widgets/diff.d.ts.map +1 -0
- package/dist/widgets/diff.js +19 -0
- package/dist/widgets/diff.js.map +1 -0
- package/dist/widgets/expand.d.ts +28 -0
- package/dist/widgets/expand.d.ts.map +1 -0
- package/dist/widgets/expand.js +94 -0
- package/dist/widgets/expand.js.map +1 -0
- package/dist/widgets/index.d.ts +126 -0
- package/dist/widgets/index.d.ts.map +1 -0
- package/dist/widgets/index.js +455 -0
- package/dist/widgets/index.js.map +1 -0
- package/dist/widgets/internals/arrival-lang.d.ts +88 -0
- package/dist/widgets/internals/arrival-lang.d.ts.map +1 -0
- package/dist/widgets/internals/arrival-lang.js +211 -0
- package/dist/widgets/internals/arrival-lang.js.map +1 -0
- package/dist/widgets/internals/diff-expand.d.ts +93 -0
- package/dist/widgets/internals/diff-expand.d.ts.map +1 -0
- package/dist/widgets/internals/diff-expand.js +1106 -0
- package/dist/widgets/internals/diff-expand.js.map +1 -0
- package/dist/widgets/internals/embedded-syntax.d.ts +62 -0
- package/dist/widgets/internals/embedded-syntax.d.ts.map +1 -0
- package/dist/widgets/internals/embedded-syntax.js +465 -0
- package/dist/widgets/internals/embedded-syntax.js.map +1 -0
- package/dist/widgets/internals/markdown-expand.d.ts +57 -0
- package/dist/widgets/internals/markdown-expand.d.ts.map +1 -0
- package/dist/widgets/internals/markdown-expand.js +980 -0
- package/dist/widgets/internals/markdown-expand.js.map +1 -0
- package/dist/widgets/internals/overlay-syntax.d.ts +24 -0
- package/dist/widgets/internals/overlay-syntax.d.ts.map +1 -0
- package/dist/widgets/internals/overlay-syntax.js +90 -0
- package/dist/widgets/internals/overlay-syntax.js.map +1 -0
- package/dist/widgets/internals/pierre-parse/cleanLastNewline.d.ts +6 -0
- package/dist/widgets/internals/pierre-parse/cleanLastNewline.d.ts.map +1 -0
- package/dist/widgets/internals/pierre-parse/cleanLastNewline.js +8 -0
- package/dist/widgets/internals/pierre-parse/cleanLastNewline.js.map +1 -0
- package/dist/widgets/internals/pierre-parse/constants.d.ts +13 -0
- package/dist/widgets/internals/pierre-parse/constants.d.ts.map +1 -0
- package/dist/widgets/internals/pierre-parse/constants.js +13 -0
- package/dist/widgets/internals/pierre-parse/constants.js.map +1 -0
- package/dist/widgets/internals/pierre-parse/detachString.d.ts +3 -0
- package/dist/widgets/internals/pierre-parse/detachString.d.ts.map +1 -0
- package/dist/widgets/internals/pierre-parse/detachString.js +24 -0
- package/dist/widgets/internals/pierre-parse/detachString.js.map +1 -0
- package/dist/widgets/internals/pierre-parse/index.d.ts +8 -0
- package/dist/widgets/internals/pierre-parse/index.d.ts.map +1 -0
- package/dist/widgets/internals/pierre-parse/index.js +8 -0
- package/dist/widgets/internals/pierre-parse/index.js.map +1 -0
- package/dist/widgets/internals/pierre-parse/parseDiffFromFile.d.ts +15 -0
- package/dist/widgets/internals/pierre-parse/parseDiffFromFile.d.ts.map +1 -0
- package/dist/widgets/internals/pierre-parse/parseDiffFromFile.js +39 -0
- package/dist/widgets/internals/pierre-parse/parseDiffFromFile.js.map +1 -0
- package/dist/widgets/internals/pierre-parse/parsePatchFiles.d.ts +11 -0
- package/dist/widgets/internals/pierre-parse/parsePatchFiles.d.ts.map +1 -0
- package/dist/widgets/internals/pierre-parse/parsePatchFiles.js +621 -0
- package/dist/widgets/internals/pierre-parse/parsePatchFiles.js.map +1 -0
- package/dist/widgets/internals/pierre-parse/types.d.ts +73 -0
- package/dist/widgets/internals/pierre-parse/types.d.ts.map +1 -0
- package/dist/widgets/internals/pierre-parse/types.js +7 -0
- package/dist/widgets/internals/pierre-parse/types.js.map +1 -0
- package/dist/widgets/internals/syntax.d.ts +55 -0
- package/dist/widgets/internals/syntax.d.ts.map +1 -0
- package/dist/widgets/internals/syntax.js +261 -0
- package/dist/widgets/internals/syntax.js.map +1 -0
- package/dist/widgets/markdown.d.ts +14 -0
- package/dist/widgets/markdown.d.ts.map +1 -0
- package/dist/widgets/markdown.js +9 -0
- package/dist/widgets/markdown.js.map +1 -0
- package/dist/widgets/shadow-stream.d.ts +88 -0
- package/dist/widgets/shadow-stream.d.ts.map +1 -0
- package/dist/widgets/shadow-stream.js +359 -0
- package/dist/widgets/shadow-stream.js.map +1 -0
- package/dist/widgets/speech.d.ts +36 -0
- package/dist/widgets/speech.d.ts.map +1 -0
- package/dist/widgets/speech.js +238 -0
- package/dist/widgets/speech.js.map +1 -0
- package/dist/widgets/stream-birth.d.ts +13 -0
- package/dist/widgets/stream-birth.d.ts.map +1 -0
- package/dist/widgets/stream-birth.js +70 -0
- package/dist/widgets/stream-birth.js.map +1 -0
- package/dist/widgets/syntax-boot.d.ts +25 -0
- package/dist/widgets/syntax-boot.d.ts.map +1 -0
- package/dist/widgets/syntax-boot.js +181 -0
- package/dist/widgets/syntax-boot.js.map +1 -0
- package/dist/widgets/text.d.ts +16 -0
- package/dist/widgets/text.d.ts.map +1 -0
- package/dist/widgets/text.js +14 -0
- package/dist/widgets/text.js.map +1 -0
- package/dist/widgets/transcript.d.ts +44 -0
- package/dist/widgets/transcript.d.ts.map +1 -0
- package/dist/widgets/transcript.js +106 -0
- package/dist/widgets/transcript.js.map +1 -0
- package/doom.vert +1840 -0
- package/fonts/DejaVuSans.ttf +0 -0
- package/fonts/DejaVuSansMono.ttf +0 -0
- package/fonts/LICENSE-DejaVu.txt +187 -0
- package/fonts/README.md +6 -0
- package/gradient.vert +75 -0
- package/package.json +147 -4
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* paintFrame: Frame → cell buffer. Always lowers styles through a resolver.
|
|
3
|
+
* Dual-dirty: reuse an existing Frame, pass a new theme.resolveStyle —
|
|
4
|
+
* zero layout() calls.
|
|
5
|
+
*
|
|
6
|
+
* Theme defaults to ambient {@link paintTheme} (active theme + depth). Hosts
|
|
7
|
+
* that attune at boot can omit the third arg; product present should still
|
|
8
|
+
* pass an explicit binding. Empty `{}` is not legal — resolveStyle is required.
|
|
9
|
+
*/
|
|
10
|
+
import { wavefrontProminence } from "./birth.js";
|
|
11
|
+
import { resolveLiveText } from "./live_paint.js";
|
|
12
|
+
import { paintTheme } from "./paint_theme.js";
|
|
13
|
+
import { fillBgFx, put } from "../buffer/index.js";
|
|
14
|
+
import { FgP } from "../lexicon/index.js";
|
|
15
|
+
import { displayWidth, splitAtWidth, takeGrapheme } from "../measure/index.js";
|
|
16
|
+
import { ansi256ToRgb } from "../theme/ansi256.js";
|
|
17
|
+
function applyThemeStyle(style, theme) {
|
|
18
|
+
return theme.resolveStyle(style);
|
|
19
|
+
}
|
|
20
|
+
function inScissor(s, x, y) {
|
|
21
|
+
if (!s)
|
|
22
|
+
return true;
|
|
23
|
+
return x >= s.x && x < s.x + s.w && y >= s.y && y < s.y + s.h;
|
|
24
|
+
}
|
|
25
|
+
/** Skip a grapheme cluster if any of its cells sit outside the scissor. */
|
|
26
|
+
function putInClip(buf, x, y, text, style, scissor) {
|
|
27
|
+
if (!scissor) {
|
|
28
|
+
put(buf, x, y, text, style);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (y < scissor.y || y >= scissor.y + scissor.h)
|
|
32
|
+
return;
|
|
33
|
+
const [head] = splitAtWidth(text, 10_000);
|
|
34
|
+
let cx = x;
|
|
35
|
+
let rest = head;
|
|
36
|
+
while (rest.length > 0) {
|
|
37
|
+
const [g, tail] = takeGrapheme(rest);
|
|
38
|
+
if (!g)
|
|
39
|
+
break;
|
|
40
|
+
const gW = Math.max(1, displayWidth(g));
|
|
41
|
+
let ok = true;
|
|
42
|
+
for (let k = 0; k < gW; k++) {
|
|
43
|
+
if (!inScissor(scissor, cx + k, y)) {
|
|
44
|
+
ok = false;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (ok)
|
|
49
|
+
put(buf, cx, y, g, style);
|
|
50
|
+
cx += gW;
|
|
51
|
+
rest = tail;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** Resolve transparent ink against the furniture already painted beneath it. */
|
|
55
|
+
function paintText(buf, x, y, text, intent, theme, scissor) {
|
|
56
|
+
const explicitSurface = intent.surfaceRole ||
|
|
57
|
+
intent.surfaceRgb ||
|
|
58
|
+
intent.fuseRole ||
|
|
59
|
+
intent.bgRole ||
|
|
60
|
+
intent.bgRgb ||
|
|
61
|
+
intent.bg !== undefined ||
|
|
62
|
+
intent.bgFx ||
|
|
63
|
+
intent.cast === "transparent";
|
|
64
|
+
if (explicitSurface || y < 0 || y >= buf.height) {
|
|
65
|
+
putInClip(buf, x, y, text, applyThemeStyle(intent, theme), scissor);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
let col = x;
|
|
69
|
+
let remaining = text;
|
|
70
|
+
const styles = new Map();
|
|
71
|
+
while (remaining.length > 0) {
|
|
72
|
+
const [head, tail] = takeGrapheme(remaining);
|
|
73
|
+
if (!head)
|
|
74
|
+
break;
|
|
75
|
+
const under = col >= 0 && col < buf.width ? buf.cells[y * buf.width + col]?.style : undefined;
|
|
76
|
+
const surfaceRgb = under?.bgRgb ?? (under?.bg === undefined ? undefined : ansi256ToRgb(under.bg));
|
|
77
|
+
const key = surfaceRgb ? `${surfaceRgb.r},${surfaceRgb.g},${surfaceRgb.b}` : "ground";
|
|
78
|
+
let style = styles.get(key);
|
|
79
|
+
if (!style) {
|
|
80
|
+
style = applyThemeStyle(surfaceRgb ? { ...intent, surfaceRgb } : intent, theme);
|
|
81
|
+
styles.set(key, style);
|
|
82
|
+
}
|
|
83
|
+
putInClip(buf, col, y, head, style, scissor);
|
|
84
|
+
col += Math.max(1, displayWidth(head));
|
|
85
|
+
remaining = tail;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function paintBirthLine(buf, op, theme, birth, scissor) {
|
|
89
|
+
const live = op.live;
|
|
90
|
+
if (live.kind !== "birth")
|
|
91
|
+
return;
|
|
92
|
+
const src = op.content ?? "";
|
|
93
|
+
if (!src)
|
|
94
|
+
return;
|
|
95
|
+
const rest = Math.max(0, live.T - live.tipWindow);
|
|
96
|
+
const W = birth?.get(live.siteId) ?? rest;
|
|
97
|
+
const fieldOpts = { birthFloor: live.birthFloor, falloff: live.falloff };
|
|
98
|
+
let col = 0;
|
|
99
|
+
let restText = src;
|
|
100
|
+
while (restText.length > 0 && col < op.rect.w) {
|
|
101
|
+
const [head, tail] = takeGrapheme(restText);
|
|
102
|
+
if (!head)
|
|
103
|
+
break;
|
|
104
|
+
const gW = Math.max(1, displayWidth(head));
|
|
105
|
+
const mid = live.offset + col + gW / 2;
|
|
106
|
+
const p = wavefrontProminence(mid, W, live.T, live.target, fieldOpts);
|
|
107
|
+
if (p <= 1 / 255) {
|
|
108
|
+
col += gW;
|
|
109
|
+
restText = tail;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
paintText(buf, op.rect.x + col, op.rect.y, head, { ...op.style, prominence: p }, theme, scissor);
|
|
113
|
+
col += gW;
|
|
114
|
+
restText = tail;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export function paintFrame(frame, buf, theme = paintTheme(), opts = {}) {
|
|
118
|
+
const nowMs = opts.nowMs ?? Date.now();
|
|
119
|
+
for (const pos of frame.paintOrder) {
|
|
120
|
+
const scissor = pos.clip;
|
|
121
|
+
for (const op of pos.paint) {
|
|
122
|
+
switch (op.kind) {
|
|
123
|
+
case "live": {
|
|
124
|
+
if (op.live.kind === "birth") {
|
|
125
|
+
paintBirthLine(buf, op, theme, opts.birth, scissor);
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
const text = resolveLiveText(op.live, nowMs);
|
|
129
|
+
// Spinner is 1 cell; elapsed is one line clipped to rect.w columns.
|
|
130
|
+
const [line] = splitAtWidth(text, Math.max(1, op.rect.w));
|
|
131
|
+
paintText(buf, op.rect.x, op.rect.y, line || " ", op.style, theme, scissor);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case "fill": {
|
|
135
|
+
const style = applyThemeStyle(op.style, theme);
|
|
136
|
+
// Procedural bg: write markers + baked UV only. Present materializes RGB.
|
|
137
|
+
if (style.bgFx) {
|
|
138
|
+
fillBgFx(buf, op.rect, style.bgFx, scissor);
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
const ch = " ";
|
|
142
|
+
for (let dy = 0; dy < op.rect.h; dy++) {
|
|
143
|
+
putInClip(buf, op.rect.x, op.rect.y + dy, ch.repeat(Math.max(0, op.rect.w)), style, scissor);
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
case "border": {
|
|
148
|
+
// Unstyled border ops (no fg/fgRgb/role stated) default to the
|
|
149
|
+
// border role at ghost prominence — the system-wide default
|
|
150
|
+
// border, never a bare index.
|
|
151
|
+
const base = op.style.fg === undefined && !op.style.fgRgb && !op.style.role
|
|
152
|
+
? { ...op.style, role: "border", prominence: op.style.prominence ?? FgP.ghost }
|
|
153
|
+
: op.style;
|
|
154
|
+
const style = applyThemeStyle(base, theme);
|
|
155
|
+
const { x, y, w, h } = op.rect;
|
|
156
|
+
if (w <= 0 || h <= 0)
|
|
157
|
+
break;
|
|
158
|
+
const hLine = "─".repeat(Math.max(0, w - 2));
|
|
159
|
+
if (h >= 1) {
|
|
160
|
+
const top = w >= 2 ? `┌${hLine}┐` : "│";
|
|
161
|
+
putInClip(buf, x, y, top.slice(0, w), style, scissor);
|
|
162
|
+
}
|
|
163
|
+
if (h >= 2) {
|
|
164
|
+
const bot = w >= 2 ? `└${hLine}┘` : "│";
|
|
165
|
+
putInClip(buf, x, y + h - 1, bot.slice(0, w), style, scissor);
|
|
166
|
+
}
|
|
167
|
+
for (let dy = 1; dy < h - 1; dy++) {
|
|
168
|
+
putInClip(buf, x, y + dy, "│", style, scissor);
|
|
169
|
+
if (w >= 2)
|
|
170
|
+
putInClip(buf, x + w - 1, y + dy, "│", style, scissor);
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
case "text": {
|
|
175
|
+
for (let i = 0; i < op.lines.length && i < op.rect.h; i++) {
|
|
176
|
+
// Clip by display columns, not code units (CJK/emoji safe).
|
|
177
|
+
const [head] = splitAtWidth(op.lines[i], op.rect.w);
|
|
178
|
+
paintText(buf, op.rect.x, op.rect.y + i, head, op.style, theme, scissor);
|
|
179
|
+
}
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case "raw":
|
|
183
|
+
op.paint(op.rect,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,CAAC,CAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;wBACrD,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;oBAC3E,CAAC;oBACD,MAAM;gBACR,CAAC;gBACD,KAAK,KAAK;oBACR,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;oBACvB,MAAM;YACV,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme → paint binding: a {@link Theme} plus a {@link ColorDepth} become the
|
|
3
|
+
* `resolveStyle` callback `paintFrame` calls per style. Dual-dirty recolor is
|
|
4
|
+
* exactly re-binding this and painting the SAME frame again.
|
|
5
|
+
*
|
|
6
|
+
* `attuneTheme` is the explicit form and the one new callers should use: pass a
|
|
7
|
+
* theme, get its paint binding, hold it. Live ground changes go through
|
|
8
|
+
* {@link ThemeStore} (host reaction drops cached RGB; polarity flip drops the
|
|
9
|
+
* Frame). The module-level `active` / `depth` below are an AMBIENT fallback
|
|
10
|
+
* for the deprecated tree's builders, which read the theme from nowhere; they
|
|
11
|
+
* are not a second source of truth for anyone who can pass an argument. A host
|
|
12
|
+
* that relies on the ambient pair must SET it at boot — reading it without
|
|
13
|
+
* ever calling `setActiveTheme` is how a session silently paints the untuned
|
|
14
|
+
* default ground no matter what the terminal actually is.
|
|
15
|
+
*
|
|
16
|
+
* Lives in layout, not theme: `PaintTheme` is layout's own type and `Style` is
|
|
17
|
+
* buffer's, both of which theme deliberately avoids depending on (it mirrors
|
|
18
|
+
* `Style` structurally as `StyleLike` for that reason).
|
|
19
|
+
*/
|
|
20
|
+
import type { Theme as PaintTheme } from "./types.js";
|
|
21
|
+
import { type ColorDepth } from "../capabilities/index.js";
|
|
22
|
+
import type { Rgb } from "../lexicon/index.js";
|
|
23
|
+
import { type Theme } from "../theme/index.js";
|
|
24
|
+
/** Replace active theme (e.g. after OSC 11 attunement). */
|
|
25
|
+
export declare function setActiveTheme(theme: Theme): void;
|
|
26
|
+
export declare function setColorDepth(d: ColorDepth): void;
|
|
27
|
+
/**
|
|
28
|
+
* A theme and its paint binding, together.
|
|
29
|
+
*
|
|
30
|
+
* The pair, not either half, is what a host actually needs: `paint` goes to
|
|
31
|
+
* `paintFrame`, and `theme.ground` is what selection recolor levels against.
|
|
32
|
+
* Holding one of these is the explicit alternative to reading the ambient
|
|
33
|
+
* globals — which is why it carries no setter.
|
|
34
|
+
*/
|
|
35
|
+
export interface ThemeBinding {
|
|
36
|
+
readonly theme: Theme;
|
|
37
|
+
readonly depth: ColorDepth;
|
|
38
|
+
/** `resolveStyle` bound to `theme` + `depth`. Pass straight to `paintFrame`. */
|
|
39
|
+
readonly paint: PaintTheme;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Build a binding from an explicit theme (or a measured ground OKLCH L, which
|
|
43
|
+
* rebuilds the seed table against it). Touches no module state in either
|
|
44
|
+
* direction: a host that calls this owns its theme.
|
|
45
|
+
*
|
|
46
|
+
* Pass `depth` explicitly whenever a real answer exists — the canonical
|
|
47
|
+
* source is `resolvePresentConfig().colorDepth`
|
|
48
|
+
* (`../runtime/index.js`, itself falling back to
|
|
49
|
+
* `guessColorDepth(env)` from capabilities when no probe ran, so `NO_COLOR`
|
|
50
|
+
* still reaches `mono` without a TTY probe). When `depth` is omitted (probe
|
|
51
|
+
* threw, host has no caps yet), fall back to `guessColorDepth()` — an honest
|
|
52
|
+
* env read (COLORTERM/TERM/NO_COLOR), never a hard demotion to `ansi16`.
|
|
53
|
+
* Hard-ansi16 was collapsing truecolor sessions to 16 colors whenever the
|
|
54
|
+
* OSC probe timed out; env is the right under-claim ladder for that case.
|
|
55
|
+
*/
|
|
56
|
+
export declare function attuneTheme(opts?: {
|
|
57
|
+
theme?: Theme;
|
|
58
|
+
/** Ground OKLCH L from OSC 11 (`groundFromOsc11`). Ignored when `theme` is given. */
|
|
59
|
+
ground?: number;
|
|
60
|
+
/** Probed terminal background RGB. Ignored when `theme` is given. */
|
|
61
|
+
groundRgb?: Rgb;
|
|
62
|
+
depth?: ColorDepth;
|
|
63
|
+
/**
|
|
64
|
+
* Default region prominence (backdrop fade of ALL paint) — its own axis,
|
|
65
|
+
* never the BG ladder. Bare 0–1, not a {@link BgProminence}: `BgP` is fill
|
|
66
|
+
* solidity of painted furniture, a call-site-level `bgProminence`, not this.
|
|
67
|
+
*/
|
|
68
|
+
regionProminence?: number;
|
|
69
|
+
}): ThemeBinding;
|
|
70
|
+
/**
|
|
71
|
+
* Layout paint Theme with ColorResolver bound to the given theme/depth, or to
|
|
72
|
+
* the ambient pair when omitted (the deprecated builders' path).
|
|
73
|
+
*/
|
|
74
|
+
export declare function paintTheme(opts?: {
|
|
75
|
+
theme?: Theme;
|
|
76
|
+
depth?: ColorDepth;
|
|
77
|
+
/**
|
|
78
|
+
* Backdrop fade of ALL paint (fg + bg alike) — its own argument, never the
|
|
79
|
+
* BG ladder. A bare 0–1, not a {@link BgProminence}: conflating the two
|
|
80
|
+
* (passing `BgP.wash` here) mixes "how solid is this furniture" into "how
|
|
81
|
+
* present is this whole region", which are independent per decision 1.
|
|
82
|
+
*/
|
|
83
|
+
regionProminence?: number;
|
|
84
|
+
}): PaintTheme;
|
|
85
|
+
//# sourceMappingURL=paint_theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paint_theme.d.ts","sourceRoot":"","sources":["../../src/layout/paint_theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAA8D,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK3G,2DAA2D;AAC3D,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAEjD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAEjD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CACzB,IAAI,GAAE;IACJ,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACtB,GACL,YAAY,CAed;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,UAAU,CAWb"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme → paint binding: a {@link Theme} plus a {@link ColorDepth} become the
|
|
3
|
+
* `resolveStyle` callback `paintFrame` calls per style. Dual-dirty recolor is
|
|
4
|
+
* exactly re-binding this and painting the SAME frame again.
|
|
5
|
+
*
|
|
6
|
+
* `attuneTheme` is the explicit form and the one new callers should use: pass a
|
|
7
|
+
* theme, get its paint binding, hold it. Live ground changes go through
|
|
8
|
+
* {@link ThemeStore} (host reaction drops cached RGB; polarity flip drops the
|
|
9
|
+
* Frame). The module-level `active` / `depth` below are an AMBIENT fallback
|
|
10
|
+
* for the deprecated tree's builders, which read the theme from nowhere; they
|
|
11
|
+
* are not a second source of truth for anyone who can pass an argument. A host
|
|
12
|
+
* that relies on the ambient pair must SET it at boot — reading it without
|
|
13
|
+
* ever calling `setActiveTheme` is how a session silently paints the untuned
|
|
14
|
+
* default ground no matter what the terminal actually is.
|
|
15
|
+
*
|
|
16
|
+
* Lives in layout, not theme: `PaintTheme` is layout's own type and `Style` is
|
|
17
|
+
* buffer's, both of which theme deliberately avoids depending on (it mirrors
|
|
18
|
+
* `Style` structurally as `StyleLike` for that reason).
|
|
19
|
+
*/
|
|
20
|
+
import { guessColorDepth } from "../capabilities/index.js";
|
|
21
|
+
import { buildTheme, defaultTheme, groundFromRgb, makeStyleResolver } from "../theme/index.js";
|
|
22
|
+
let active = defaultTheme;
|
|
23
|
+
let depth = "truecolor";
|
|
24
|
+
/** Replace active theme (e.g. after OSC 11 attunement). */
|
|
25
|
+
export function setActiveTheme(theme) {
|
|
26
|
+
active = theme;
|
|
27
|
+
}
|
|
28
|
+
export function setColorDepth(d) {
|
|
29
|
+
depth = d;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build a binding from an explicit theme (or a measured ground OKLCH L, which
|
|
33
|
+
* rebuilds the seed table against it). Touches no module state in either
|
|
34
|
+
* direction: a host that calls this owns its theme.
|
|
35
|
+
*
|
|
36
|
+
* Pass `depth` explicitly whenever a real answer exists — the canonical
|
|
37
|
+
* source is `resolvePresentConfig().colorDepth`
|
|
38
|
+
* (`../runtime/index.js`, itself falling back to
|
|
39
|
+
* `guessColorDepth(env)` from capabilities when no probe ran, so `NO_COLOR`
|
|
40
|
+
* still reaches `mono` without a TTY probe). When `depth` is omitted (probe
|
|
41
|
+
* threw, host has no caps yet), fall back to `guessColorDepth()` — an honest
|
|
42
|
+
* env read (COLORTERM/TERM/NO_COLOR), never a hard demotion to `ansi16`.
|
|
43
|
+
* Hard-ansi16 was collapsing truecolor sessions to 16 colors whenever the
|
|
44
|
+
* OSC probe timed out; env is the right under-claim ladder for that case.
|
|
45
|
+
*/
|
|
46
|
+
export function attuneTheme(opts = {}) {
|
|
47
|
+
const ground = opts.ground ??
|
|
48
|
+
(opts.groundRgb === undefined ? undefined : groundFromRgb(opts.groundRgb.r, opts.groundRgb.g, opts.groundRgb.b));
|
|
49
|
+
const theme = opts.theme ??
|
|
50
|
+
(ground === undefined && opts.groundRgb === undefined
|
|
51
|
+
? defaultTheme
|
|
52
|
+
: buildTheme({ ground, groundRgb: opts.groundRgb }));
|
|
53
|
+
const depthUsed = opts.depth ?? guessColorDepth();
|
|
54
|
+
return {
|
|
55
|
+
theme,
|
|
56
|
+
depth: depthUsed,
|
|
57
|
+
paint: paintTheme({ theme, depth: depthUsed, regionProminence: opts.regionProminence }),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Layout paint Theme with ColorResolver bound to the given theme/depth, or to
|
|
62
|
+
* the ambient pair when omitted (the deprecated builders' path).
|
|
63
|
+
*/
|
|
64
|
+
export function paintTheme(opts) {
|
|
65
|
+
const t = opts?.theme ?? active;
|
|
66
|
+
const d = opts?.depth ?? depth;
|
|
67
|
+
const resolve = makeStyleResolver({
|
|
68
|
+
theme: t,
|
|
69
|
+
depth: d,
|
|
70
|
+
regionProminence: opts?.regionProminence,
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
resolveStyle: (style) => resolve(style),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=paint_theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paint_theme.js","sourceRoot":"","sources":["../../src/layout/paint_theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;A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U,CAAC,IAU1B;IACC,MAAM,CAAC,GAAG,IAAI,EAAE,KAAK,IAAI,MAAM,CAAC;IAChC,MAAM,CAAC,GAAG,IAAI,EAAE,KAAK,IAAI,KAAK,CAAC;IAC/B,MAAM,OAAO,GAAG,iBAAiB,CAAC;QAChC,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;QACR,gBAAgB,EAAE,IAAI,EAAE,gBAAgB;KACzC,CAAC,CAAC;IACH,OAAO;QACL,YAAY,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAU;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { LayoutNode } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Chrome-frame progress ease — renderer-plane motion.
|
|
4
|
+
*
|
|
5
|
+
* Logic declares a target 0..1 (and optional role). The host holds displayed
|
|
6
|
+
* value and eases toward the target; paint samples the displayed number.
|
|
7
|
+
* Same cut as birth: TEA names the end state, present interpolates.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PROGRESS_EASE_MS = 240;
|
|
10
|
+
export declare function easeInOutCubic(t: number): number;
|
|
11
|
+
export type ProgressBarAnim = {
|
|
12
|
+
readonly displayed: number;
|
|
13
|
+
readonly displayedRole?: string;
|
|
14
|
+
readonly from: number;
|
|
15
|
+
readonly to: number;
|
|
16
|
+
readonly fromRole?: string;
|
|
17
|
+
readonly toRole?: string;
|
|
18
|
+
readonly startedAt: number;
|
|
19
|
+
readonly durationMs: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function stepProgressBar(prev: ProgressBarAnim | undefined, target: number, targetRole: string | undefined, nowMs: number): ProgressBarAnim;
|
|
22
|
+
/** Still interpolating — host keeps the present timer armed. */
|
|
23
|
+
export declare function progressBarLive(anim: ProgressBarAnim): boolean;
|
|
24
|
+
export type ProgressSite = {
|
|
25
|
+
readonly key: string;
|
|
26
|
+
readonly progress: number;
|
|
27
|
+
readonly role?: string;
|
|
28
|
+
};
|
|
29
|
+
/** Walk a tree for chrome_frame progress targets (host steps these). */
|
|
30
|
+
export declare function collectProgressSites(node: LayoutNode): ProgressSite[];
|
|
31
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/layout/progress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;GAMG;AAEH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAGhD;AAOD,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wBAAgB,eAAe,CAC7B,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,MAAM,GACZ,eAAe,CAiCjB;AAED,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAG9D;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,CAIrE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { layoutChildren } from "./children.js";
|
|
2
|
+
/**
|
|
3
|
+
* Chrome-frame progress ease — renderer-plane motion.
|
|
4
|
+
*
|
|
5
|
+
* Logic declares a target 0..1 (and optional role). The host holds displayed
|
|
6
|
+
* value and eases toward the target; paint samples the displayed number.
|
|
7
|
+
* Same cut as birth: TEA names the end state, present interpolates.
|
|
8
|
+
*/
|
|
9
|
+
export const PROGRESS_EASE_MS = 240;
|
|
10
|
+
export function easeInOutCubic(t) {
|
|
11
|
+
const x = Number.isFinite(t) ? Math.max(0, Math.min(1, t)) : 0;
|
|
12
|
+
return x < 0.5 ? 4 * x * x * x : 1 - (-2 * x + 2) ** 3 / 2;
|
|
13
|
+
}
|
|
14
|
+
function clamp01(n) {
|
|
15
|
+
if (!Number.isFinite(n))
|
|
16
|
+
return 0;
|
|
17
|
+
return Math.max(0, Math.min(1, n));
|
|
18
|
+
}
|
|
19
|
+
export function stepProgressBar(prev, target, targetRole, nowMs) {
|
|
20
|
+
const to = clamp01(target);
|
|
21
|
+
if (prev === undefined) {
|
|
22
|
+
return {
|
|
23
|
+
displayed: to,
|
|
24
|
+
displayedRole: targetRole,
|
|
25
|
+
from: to,
|
|
26
|
+
to,
|
|
27
|
+
fromRole: targetRole,
|
|
28
|
+
toRole: targetRole,
|
|
29
|
+
startedAt: nowMs,
|
|
30
|
+
durationMs: PROGRESS_EASE_MS,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const targetChanged = Math.abs(prev.to - to) > 1e-4 || (prev.toRole ?? "") !== (targetRole ?? "");
|
|
34
|
+
if (targetChanged) {
|
|
35
|
+
return {
|
|
36
|
+
displayed: prev.displayed,
|
|
37
|
+
displayedRole: prev.displayedRole,
|
|
38
|
+
from: prev.displayed,
|
|
39
|
+
to,
|
|
40
|
+
fromRole: prev.displayedRole,
|
|
41
|
+
toRole: targetRole,
|
|
42
|
+
startedAt: nowMs,
|
|
43
|
+
durationMs: PROGRESS_EASE_MS,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const u = easeInOutCubic((nowMs - prev.startedAt) / Math.max(1, prev.durationMs));
|
|
47
|
+
return {
|
|
48
|
+
...prev,
|
|
49
|
+
displayed: prev.from + (prev.to - prev.from) * u,
|
|
50
|
+
displayedRole: u < 0.5 ? prev.fromRole : prev.toRole,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** Still interpolating — host keeps the present timer armed. */
|
|
54
|
+
export function progressBarLive(anim) {
|
|
55
|
+
if (Math.abs(anim.displayed - anim.to) > 1e-3)
|
|
56
|
+
return true;
|
|
57
|
+
return (anim.displayedRole ?? "") !== (anim.toRole ?? "");
|
|
58
|
+
}
|
|
59
|
+
/** Walk a tree for chrome_frame progress targets (host steps these). */
|
|
60
|
+
export function collectProgressSites(node) {
|
|
61
|
+
const out = [];
|
|
62
|
+
walk(node, out);
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
function walk(node, out) {
|
|
66
|
+
if (node.type === "chrome_frame") {
|
|
67
|
+
const key = node.key;
|
|
68
|
+
const progress = node.progress;
|
|
69
|
+
if (key && typeof progress === "number" && node.plainBottom !== true) {
|
|
70
|
+
out.push({
|
|
71
|
+
key,
|
|
72
|
+
progress,
|
|
73
|
+
role: node.progressRole,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (const child of layoutChildren(node))
|
|
78
|
+
walk(child, out);
|
|
79
|
+
if (node.type === "disclosure") {
|
|
80
|
+
walk(node.summary, out);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/layout/progress.ts"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AAM,GAAG,GAAmB,EAAE,CAAC;IAC/B,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAChB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,IAAI,CAAC,IAAgB,EAAE,GAAmB;IACjD,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;YACrE,GAAG,CAAC,IAAI,CAAC;gBACP,GAAG;gBACH,QAAQ;gBACR,IAAI,EAAE,IAAI,CAAC,YAAY;aACxB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC;QAAE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC3D,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selection state model — buffer-cell-space ranges with granularity.
|
|
3
|
+
*
|
|
4
|
+
* State lives renderer/main-side (the buffer owner). The host wires mouse
|
|
5
|
+
* gestures (Phase 1d) and keyboard selection into transitions on this type;
|
|
6
|
+
* paint (Phase 1c) reads it to mark cells `selected`.
|
|
7
|
+
*
|
|
8
|
+
* Two cooperating concepts:
|
|
9
|
+
*
|
|
10
|
+
* 1. GLOBAL state (this module): anchor/active cells + granularity. Knows
|
|
11
|
+
* "this cell is fully inside the selection range" — the cheap, geometry-
|
|
12
|
+
* only membership test. Does NOT know what text a cell renders.
|
|
13
|
+
*
|
|
14
|
+
* 2. COMPONENT-delegated serialization (Phase 2b): each widget declares how
|
|
15
|
+
* its cells map back to semantic content (markdown source, diff text,
|
|
16
|
+
* code). The global layer asks "is this cell selected?" and the component
|
|
17
|
+
* answers "what text does it produce?"
|
|
18
|
+
*
|
|
19
|
+
* Geometry law (the bifunctor):
|
|
20
|
+
* - `"char"` / `"word"` — **stream** range in document order (row-major).
|
|
21
|
+
* Multi-line: first row from start.col→EOL, middle rows full width, last
|
|
22
|
+
* row SOL→end.col. Same model every terminal/editor uses for drag-select.
|
|
23
|
+
* - `"line"` — full row width for every row in the vertical span.
|
|
24
|
+
* - `"rect"` — axis-aligned column block (Alt+drag / tmux rectangle).
|
|
25
|
+
* - `"structural"` — bounding box of a LayoutNode (refined by component).
|
|
26
|
+
*
|
|
27
|
+
* Cell coordinates are 0-indexed buffer cells (matching `elementAt`'s
|
|
28
|
+
* internal rect math after the 1-based SGR subtraction).
|
|
29
|
+
*/
|
|
30
|
+
import type { Rect } from "./types.js";
|
|
31
|
+
/** 0-indexed buffer cell. */
|
|
32
|
+
export type Cell = {
|
|
33
|
+
col: number;
|
|
34
|
+
row: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Selection granularity — what a drag or extend operation selects.
|
|
38
|
+
*
|
|
39
|
+
* - `"char"` — stream range, cell-by-cell (the bare-drag default)
|
|
40
|
+
* - `"word"` — stream range, endpoints snapped to word bounds
|
|
41
|
+
* - `"line"` — whole logical lines (triple-click; code/diff/log default)
|
|
42
|
+
* - `"rect"` — rectangular/columnar block (Alt+drag, tmux rectangle-toggle)
|
|
43
|
+
* - `"structural"` — a LayoutNode subtree (Ctrl+W walk; the Phase 4 moat)
|
|
44
|
+
*/
|
|
45
|
+
export type SelectionGranularity = "char" | "word" | "line" | "rect" | "structural";
|
|
46
|
+
/**
|
|
47
|
+
* Active text selection. `null` = no selection.
|
|
48
|
+
*
|
|
49
|
+
* - `anchor` — where the selection started (fixed during a drag)
|
|
50
|
+
* - `active` — the moving end (follows the pointer / keyboard endpoint)
|
|
51
|
+
* - `granularity` — how drag/extend snaps the range
|
|
52
|
+
* - `anchorKey` — the LayoutNode key the anchor started in
|
|
53
|
+
* - `contain` — when set (anchor under `userSelect: "contain"`, e.g. composer
|
|
54
|
+
* input), every geometry query and endpoint clamp is confined to this rect.
|
|
55
|
+
* Selection never paints or serializes outside the input.
|
|
56
|
+
*/
|
|
57
|
+
export type SelectionState = {
|
|
58
|
+
anchor: Cell;
|
|
59
|
+
active: Cell;
|
|
60
|
+
granularity: SelectionGranularity;
|
|
61
|
+
/** LayoutNode key at the anchor (structural walk / contain node). */
|
|
62
|
+
anchorKey?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Confinement rect from `userSelect: "contain"` (buffer coords, inclusive
|
|
65
|
+
* origin + size). CSS textarea model: drag cannot leave this box.
|
|
66
|
+
*/
|
|
67
|
+
contain?: Rect;
|
|
68
|
+
};
|
|
69
|
+
/** Clamp a cell into a rect (inclusive). */
|
|
70
|
+
export declare function clampCell(cell: Cell, rect: Rect): Cell;
|
|
71
|
+
/**
|
|
72
|
+
* Start a new selection at a cell. Anchor and active both start at the cell;
|
|
73
|
+
* a subsequent drag/extend moves `active`. When `contain` is set, the cell is
|
|
74
|
+
* clamped into that rect and the confinement rides on the state.
|
|
75
|
+
*/
|
|
76
|
+
export declare function startSelection(cell: Cell, granularity?: SelectionGranularity, anchorKey?: string, contain?: Rect): SelectionState;
|
|
77
|
+
/** Move the active end (drag / shift-click extend / keyboard arrow). */
|
|
78
|
+
export declare function extendSelection(sel: SelectionState | null, cell: Cell): SelectionState | null;
|
|
79
|
+
/** Clear the selection. */
|
|
80
|
+
export declare function clearSelection(): SelectionState | null;
|
|
81
|
+
/**
|
|
82
|
+
* True when anchor and active are the same cell (collapsed caret / click
|
|
83
|
+
* without drag). Copy-on-select hosts should skip OSC 52 for collapsed
|
|
84
|
+
* selections unless multi-click expanded the range.
|
|
85
|
+
*/
|
|
86
|
+
export declare function isCollapsed(sel: SelectionState | null): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* True when the selection covers more than one cell under its geometry law.
|
|
89
|
+
* For `"line"` a single-row collapsed click still selects the full line, so
|
|
90
|
+
* this is true whenever granularity is line (or structural) even if collapsed.
|
|
91
|
+
*/
|
|
92
|
+
export declare function hasCopyableExtent(sel: SelectionState | null): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Stream endpoints in document order (start ≤ end). Used by char/word geometry.
|
|
95
|
+
* Anchor/active may be in either drag direction.
|
|
96
|
+
*/
|
|
97
|
+
export declare function streamEndpoints(sel: SelectionState): {
|
|
98
|
+
start: Cell;
|
|
99
|
+
end: Cell;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Bounding rect envelope of the selection in buffer coordinates.
|
|
103
|
+
*
|
|
104
|
+
* For multi-line stream (`"char"`/`"word"`) and `"line"`, the envelope spans
|
|
105
|
+
* full row width when `rowWidth` is supplied — paint loops walk this rect and
|
|
106
|
+
* filter with {@link rowRange}. When `rowWidth` is omitted, multi-line
|
|
107
|
+
* stream uses a conservative full-width sentinel (caller should prefer
|
|
108
|
+
* providing width).
|
|
109
|
+
*
|
|
110
|
+
* For `"rect"` the envelope IS the selected region.
|
|
111
|
+
*/
|
|
112
|
+
export declare function selectionRect(sel: SelectionState, rowWidth?: number): Rect;
|
|
113
|
+
/**
|
|
114
|
+
* Column range selected on a given row, or `null` if the row is outside the
|
|
115
|
+
* selection. Returned range is **inclusive** on both ends: `[startCol, endCol]`.
|
|
116
|
+
*
|
|
117
|
+
* Geometry by granularity:
|
|
118
|
+
* - `"char"` / `"word"` — stream: first/middle/last row rules
|
|
119
|
+
* - `"line"` — full row `[0, rowWidth-1]`
|
|
120
|
+
* - `"rect"` / `"structural"` — axis box columns on every selected row
|
|
121
|
+
*/
|
|
122
|
+
export declare function rowRange(sel: SelectionState, row: number, rowWidth: number): readonly [number, number] | null;
|
|
123
|
+
export declare function wordBoundsOnRow(cells: readonly string[], col: number): readonly [number, number];
|
|
124
|
+
/**
|
|
125
|
+
* Expand a collapsed (or any) selection to the full word under `cell`.
|
|
126
|
+
* Sets anchor to word start and active to word end on that row.
|
|
127
|
+
*/
|
|
128
|
+
export declare function expandToWordAt(cell: Cell, getRowCells: (row: number) => readonly string[] | null | undefined, anchorKey?: string, contain?: Rect): SelectionState;
|
|
129
|
+
/**
|
|
130
|
+
* Expand to full line under `cell` (triple-click). Anchor at col 0, active at
|
|
131
|
+
* last content-ish col when `rowWidth` known; granularity `"line"` so
|
|
132
|
+
* {@link rowRange} already spans full width either way. With `contain`, the
|
|
133
|
+
* "line" is the input row only (cols of the box), never the whole terminal.
|
|
134
|
+
*/
|
|
135
|
+
export declare function expandToLineAt(cell: Cell, rowWidth: number, anchorKey?: string, contain?: Rect): SelectionState;
|
|
136
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../src/layout/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,6BAA6B;AAC7B,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;AAEpF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;IACb,WAAW,EAAE,oBAAoB,CAAC;IAClC,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,4CAA4C;AAC5C,wBAAg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