@react-x11/components 0.1.0 → 0.2.1
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 +979 -21
- package/dist/ansi/cast.d.ts +48 -0
- package/dist/ansi/cast.d.ts.map +1 -0
- package/dist/ansi/cast.js +135 -0
- package/dist/ansi/cast.js.map +1 -0
- package/dist/ansi/index.d.ts +10 -0
- package/dist/ansi/index.d.ts.map +1 -0
- package/dist/ansi/index.js +27 -0
- package/dist/ansi/index.js.map +1 -0
- package/dist/ansi/palette.d.ts +79 -0
- package/dist/ansi/palette.d.ts.map +1 -0
- package/dist/ansi/palette.js +155 -0
- package/dist/ansi/palette.js.map +1 -0
- package/dist/ansi/parse.d.ts +114 -0
- package/dist/ansi/parse.d.ts.map +1 -0
- package/dist/ansi/parse.js +687 -0
- package/dist/ansi/parse.js.map +1 -0
- package/dist/ansi/sgr.d.ts +87 -0
- package/dist/ansi/sgr.d.ts.map +1 -0
- package/dist/ansi/sgr.js +302 -0
- package/dist/ansi/sgr.js.map +1 -0
- package/dist/ansi/utf8.d.ts +15 -0
- package/dist/ansi/utf8.d.ts.map +1 -0
- package/dist/ansi/utf8.js +82 -0
- package/dist/ansi/utf8.js.map +1 -0
- package/dist/calendar/Calendar.d.ts +136 -0
- package/dist/calendar/Calendar.d.ts.map +1 -0
- package/dist/calendar/Calendar.js +460 -0
- package/dist/calendar/Calendar.js.map +1 -0
- package/dist/calendar/DatePicker.d.ts +52 -0
- package/dist/calendar/DatePicker.d.ts.map +1 -0
- package/dist/calendar/DatePicker.js +257 -0
- package/dist/calendar/DatePicker.js.map +1 -0
- package/dist/calendar/dates.d.ts +90 -0
- package/dist/calendar/dates.d.ts.map +1 -0
- package/dist/calendar/dates.js +236 -0
- package/dist/calendar/dates.js.map +1 -0
- package/dist/calendar/index.d.ts +8 -0
- package/dist/calendar/index.d.ts.map +1 -0
- package/dist/calendar/index.js +15 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/charts/components.d.ts +141 -0
- package/dist/charts/components.d.ts.map +1 -0
- package/dist/charts/components.js +580 -0
- package/dist/charts/components.js.map +1 -0
- package/dist/charts/data.d.ts +198 -0
- package/dist/charts/data.d.ts.map +1 -0
- package/dist/charts/data.js +616 -0
- package/dist/charts/data.js.map +1 -0
- package/dist/charts/hx.d.ts +21 -0
- package/dist/charts/hx.d.ts.map +1 -0
- package/dist/charts/hx.js +15 -0
- package/dist/charts/hx.js.map +1 -0
- package/dist/charts/index.d.ts +27 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +38 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/node.d.ts +96 -0
- package/dist/charts/node.d.ts.map +1 -0
- package/dist/charts/node.js +720 -0
- package/dist/charts/node.js.map +1 -0
- package/dist/charts/render.d.ts +153 -0
- package/dist/charts/render.d.ts.map +1 -0
- package/dist/charts/render.js +762 -0
- package/dist/charts/render.js.map +1 -0
- package/dist/charts/scale.d.ts +42 -0
- package/dist/charts/scale.d.ts.map +1 -0
- package/dist/charts/scale.js +173 -0
- package/dist/charts/scale.js.map +1 -0
- package/dist/charts/spec.d.ts +91 -0
- package/dist/charts/spec.d.ts.map +1 -0
- package/dist/charts/spec.js +33 -0
- package/dist/charts/spec.js.map +1 -0
- package/dist/charts/timers.d.ts +6 -0
- package/dist/charts/timers.d.ts.map +1 -0
- package/dist/charts/timers.js +14 -0
- package/dist/charts/timers.js.map +1 -0
- package/dist/code/hx.d.ts +24 -0
- package/dist/code/hx.d.ts.map +1 -0
- package/dist/code/hx.js +25 -0
- package/dist/code/hx.js.map +1 -0
- package/dist/code/index.d.ts +45 -0
- package/dist/code/index.d.ts.map +1 -0
- package/dist/code/index.js +93 -0
- package/dist/code/index.js.map +1 -0
- package/dist/code-editor/completion.d.ts +26 -0
- package/dist/code-editor/completion.d.ts.map +1 -0
- package/dist/code-editor/completion.js +129 -0
- package/dist/code-editor/completion.js.map +1 -0
- package/dist/code-editor/doc.d.ts +35 -0
- package/dist/code-editor/doc.d.ts.map +1 -0
- package/dist/code-editor/doc.js +162 -0
- package/dist/code-editor/doc.js.map +1 -0
- package/dist/code-editor/hx.d.ts +13 -0
- package/dist/code-editor/hx.d.ts.map +1 -0
- package/dist/code-editor/hx.js +10 -0
- package/dist/code-editor/hx.js.map +1 -0
- package/dist/code-editor/index.d.ts +88 -0
- package/dist/code-editor/index.d.ts.map +1 -0
- package/dist/code-editor/index.js +401 -0
- package/dist/code-editor/index.js.map +1 -0
- package/dist/code-editor/node.d.ts +343 -0
- package/dist/code-editor/node.d.ts.map +1 -0
- package/dist/code-editor/node.js +1521 -0
- package/dist/code-editor/node.js.map +1 -0
- package/dist/code-language/hljs.d.ts +47 -0
- package/dist/code-language/hljs.d.ts.map +1 -0
- package/dist/code-language/hljs.js +211 -0
- package/dist/code-language/hljs.js.map +1 -0
- package/dist/code-language/index.d.ts +22 -0
- package/dist/code-language/index.d.ts.map +1 -0
- package/dist/code-language/index.js +20 -0
- package/dist/code-language/index.js.map +1 -0
- package/dist/code-language/languages/glsl.d.ts +4 -0
- package/dist/code-language/languages/glsl.d.ts.map +1 -0
- package/dist/code-language/languages/glsl.js +99 -0
- package/dist/code-language/languages/glsl.js.map +1 -0
- package/dist/code-language/languages/javascript.d.ts +10 -0
- package/dist/code-language/languages/javascript.d.ts.map +1 -0
- package/dist/code-language/languages/javascript.js +360 -0
- package/dist/code-language/languages/javascript.js.map +1 -0
- package/dist/code-language/languages/json.d.ts +4 -0
- package/dist/code-language/languages/json.d.ts.map +1 -0
- package/dist/code-language/languages/json.js +68 -0
- package/dist/code-language/languages/json.js.map +1 -0
- package/dist/code-language/languages/shell.d.ts +4 -0
- package/dist/code-language/languages/shell.d.ts.map +1 -0
- package/dist/code-language/languages/shell.js +189 -0
- package/dist/code-language/languages/shell.js.map +1 -0
- package/dist/code-language/languages/sql.d.ts +11 -0
- package/dist/code-language/languages/sql.d.ts.map +1 -0
- package/dist/code-language/languages/sql.js +133 -0
- package/dist/code-language/languages/sql.js.map +1 -0
- package/dist/code-language/lezer.d.ts +24 -0
- package/dist/code-language/lezer.d.ts.map +1 -0
- package/dist/code-language/lezer.js +148 -0
- package/dist/code-language/lezer.js.map +1 -0
- package/dist/code-language/registry.d.ts +19 -0
- package/dist/code-language/registry.d.ts.map +1 -0
- package/dist/code-language/registry.js +56 -0
- package/dist/code-language/registry.js.map +1 -0
- package/dist/code-language/runs.d.ts +35 -0
- package/dist/code-language/runs.d.ts.map +1 -0
- package/dist/code-language/runs.js +88 -0
- package/dist/code-language/runs.js.map +1 -0
- package/dist/code-language/stream.d.ts +70 -0
- package/dist/code-language/stream.d.ts.map +1 -0
- package/dist/code-language/stream.js +243 -0
- package/dist/code-language/stream.js.map +1 -0
- package/dist/code-language/textmate.d.ts +27 -0
- package/dist/code-language/textmate.d.ts.map +1 -0
- package/dist/code-language/textmate.js +86 -0
- package/dist/code-language/textmate.js.map +1 -0
- package/dist/code-language/theme.d.ts +26 -0
- package/dist/code-language/theme.d.ts.map +1 -0
- package/dist/code-language/theme.js +108 -0
- package/dist/code-language/theme.js.map +1 -0
- package/dist/code-language/timers.d.ts +7 -0
- package/dist/code-language/timers.d.ts.map +1 -0
- package/dist/code-language/timers.js +22 -0
- package/dist/code-language/timers.js.map +1 -0
- package/dist/code-language/types.d.ts +173 -0
- package/dist/code-language/types.d.ts.map +1 -0
- package/dist/code-language/types.js +41 -0
- package/dist/code-language/types.js.map +1 -0
- package/dist/codeblock/index.d.ts +69 -0
- package/dist/codeblock/index.d.ts.map +1 -0
- package/dist/codeblock/index.js +85 -0
- package/dist/codeblock/index.js.map +1 -0
- package/dist/color-picker/ColorField.d.ts +39 -0
- package/dist/color-picker/ColorField.d.ts.map +1 -0
- package/dist/color-picker/ColorField.js +239 -0
- package/dist/color-picker/ColorField.js.map +1 -0
- package/dist/color-picker/ColorPicker.d.ts +109 -0
- package/dist/color-picker/ColorPicker.d.ts.map +1 -0
- package/dist/color-picker/ColorPicker.js +757 -0
- package/dist/color-picker/ColorPicker.js.map +1 -0
- package/dist/color-picker/color.d.ts +105 -0
- package/dist/color-picker/color.d.ts.map +1 -0
- package/dist/color-picker/color.js +313 -0
- package/dist/color-picker/color.js.map +1 -0
- package/dist/color-picker/index.d.ts +8 -0
- package/dist/color-picker/index.d.ts.map +1 -0
- package/dist/color-picker/index.js +19 -0
- package/dist/color-picker/index.js.map +1 -0
- package/dist/desktop-calendar/eds.d.ts +102 -0
- package/dist/desktop-calendar/eds.d.ts.map +1 -0
- package/dist/desktop-calendar/eds.js +356 -0
- package/dist/desktop-calendar/eds.js.map +1 -0
- package/dist/desktop-calendar/ical.d.ts +63 -0
- package/dist/desktop-calendar/ical.d.ts.map +1 -0
- package/dist/desktop-calendar/ical.js +57 -0
- package/dist/desktop-calendar/ical.js.map +1 -0
- package/dist/desktop-calendar/index.d.ts +72 -0
- package/dist/desktop-calendar/index.d.ts.map +1 -0
- package/dist/desktop-calendar/index.js +213 -0
- package/dist/desktop-calendar/index.js.map +1 -0
- package/dist/embed/client.d.ts +121 -0
- package/dist/embed/client.d.ts.map +1 -0
- package/dist/embed/client.js +203 -0
- package/dist/embed/client.js.map +1 -0
- package/dist/embed/host.d.ts +96 -0
- package/dist/embed/host.d.ts.map +1 -0
- package/dist/embed/host.js +266 -0
- package/dist/embed/host.js.map +1 -0
- package/dist/embed/index.d.ts +5 -0
- package/dist/embed/index.d.ts.map +1 -0
- package/dist/embed/index.js +13 -0
- package/dist/embed/index.js.map +1 -0
- package/dist/embed/timers.d.ts +6 -0
- package/dist/embed/timers.d.ts.map +1 -0
- package/dist/embed/timers.js +16 -0
- package/dist/embed/timers.js.map +1 -0
- package/dist/flow/draw.d.ts +45 -0
- package/dist/flow/draw.d.ts.map +1 -0
- package/dist/flow/draw.js +295 -0
- package/dist/flow/draw.js.map +1 -0
- package/dist/flow/index.d.ts +64 -0
- package/dist/flow/index.d.ts.map +1 -0
- package/dist/flow/index.js +306 -0
- package/dist/flow/index.js.map +1 -0
- package/dist/flow/model.d.ts +158 -0
- package/dist/flow/model.d.ts.map +1 -0
- package/dist/flow/model.js +566 -0
- package/dist/flow/model.js.map +1 -0
- package/dist/flow/node.d.ts +429 -0
- package/dist/flow/node.d.ts.map +1 -0
- package/dist/flow/node.js +3025 -0
- package/dist/flow/node.js.map +1 -0
- package/dist/flow/paths.d.ts +43 -0
- package/dist/flow/paths.d.ts.map +1 -0
- package/dist/flow/paths.js +327 -0
- package/dist/flow/paths.js.map +1 -0
- package/dist/flow/types.d.ts +561 -0
- package/dist/flow/types.d.ts.map +1 -0
- package/dist/flow/types.js +2 -0
- package/dist/flow/types.js.map +1 -0
- package/dist/formula/hx.d.ts +24 -0
- package/dist/formula/hx.d.ts.map +1 -0
- package/dist/formula/hx.js +25 -0
- package/dist/formula/hx.js.map +1 -0
- package/dist/formula/index.d.ts +74 -0
- package/dist/formula/index.d.ts.map +1 -0
- package/dist/formula/index.js +155 -0
- package/dist/formula/index.js.map +1 -0
- package/dist/formula/katex.d.ts +78 -0
- package/dist/formula/katex.d.ts.map +1 -0
- package/dist/formula/katex.js +130 -0
- package/dist/formula/katex.js.map +1 -0
- package/dist/formula/layout.d.ts +103 -0
- package/dist/formula/layout.d.ts.map +1 -0
- package/dist/formula/layout.js +716 -0
- package/dist/formula/layout.js.map +1 -0
- package/dist/formula/node.d.ts +50 -0
- package/dist/formula/node.d.ts.map +1 -0
- package/dist/formula/node.js +351 -0
- package/dist/formula/node.js.map +1 -0
- package/dist/html/controls.d.ts +48 -0
- package/dist/html/controls.d.ts.map +1 -0
- package/dist/html/controls.js +195 -0
- package/dist/html/controls.js.map +1 -0
- package/dist/html/css/cascade.d.ts +51 -0
- package/dist/html/css/cascade.d.ts.map +1 -0
- package/dist/html/css/cascade.js +552 -0
- package/dist/html/css/cascade.js.map +1 -0
- package/dist/html/css/parse.d.ts +74 -0
- package/dist/html/css/parse.d.ts.map +1 -0
- package/dist/html/css/parse.js +464 -0
- package/dist/html/css/parse.js.map +1 -0
- package/dist/html/css/style.d.ts +142 -0
- package/dist/html/css/style.d.ts.map +1 -0
- package/dist/html/css/style.js +1145 -0
- package/dist/html/css/style.js.map +1 -0
- package/dist/html/css/ua.d.ts +5 -0
- package/dist/html/css/ua.d.ts.map +1 -0
- package/dist/html/css/ua.js +171 -0
- package/dist/html/css/ua.js.map +1 -0
- package/dist/html/css/values.d.ts +78 -0
- package/dist/html/css/values.d.ts.map +1 -0
- package/dist/html/css/values.js +330 -0
- package/dist/html/css/values.js.map +1 -0
- package/dist/html/dom.d.ts +112 -0
- package/dist/html/dom.d.ts.map +1 -0
- package/dist/html/dom.js +374 -0
- package/dist/html/dom.js.map +1 -0
- package/dist/html/hx.d.ts +24 -0
- package/dist/html/hx.d.ts.map +1 -0
- package/dist/html/hx.js +29 -0
- package/dist/html/hx.js.map +1 -0
- package/dist/html/index.d.ts +137 -0
- package/dist/html/index.d.ts.map +1 -0
- package/dist/html/index.js +339 -0
- package/dist/html/index.js.map +1 -0
- package/dist/html/layout/block.d.ts +58 -0
- package/dist/html/layout/block.d.ts.map +1 -0
- package/dist/html/layout/block.js +724 -0
- package/dist/html/layout/block.js.map +1 -0
- package/dist/html/layout/boxes.d.ts +261 -0
- package/dist/html/layout/boxes.d.ts.map +1 -0
- package/dist/html/layout/boxes.js +725 -0
- package/dist/html/layout/boxes.js.map +1 -0
- package/dist/html/layout/flex.d.ts +16 -0
- package/dist/html/layout/flex.d.ts.map +1 -0
- package/dist/html/layout/flex.js +242 -0
- package/dist/html/layout/flex.js.map +1 -0
- package/dist/html/layout/floats.d.ts +50 -0
- package/dist/html/layout/floats.d.ts.map +1 -0
- package/dist/html/layout/floats.js +110 -0
- package/dist/html/layout/floats.js.map +1 -0
- package/dist/html/layout/inline.d.ts +44 -0
- package/dist/html/layout/inline.d.ts.map +1 -0
- package/dist/html/layout/inline.js +700 -0
- package/dist/html/layout/inline.js.map +1 -0
- package/dist/html/layout/table.d.ts +5 -0
- package/dist/html/layout/table.d.ts.map +1 -0
- package/dist/html/layout/table.js +340 -0
- package/dist/html/layout/table.js.map +1 -0
- package/dist/html/node.d.ts +149 -0
- package/dist/html/node.d.ts.map +1 -0
- package/dist/html/node.js +861 -0
- package/dist/html/node.js.map +1 -0
- package/dist/html/paint.d.ts +48 -0
- package/dist/html/paint.d.ts.map +1 -0
- package/dist/html/paint.js +495 -0
- package/dist/html/paint.js.map +1 -0
- package/dist/html/resources.d.ts +48 -0
- package/dist/html/resources.d.ts.map +1 -0
- package/dist/html/resources.js +156 -0
- package/dist/html/resources.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +92 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/heights.d.ts +88 -0
- package/dist/internal/heights.d.ts.map +1 -0
- package/dist/internal/heights.js +203 -0
- package/dist/internal/heights.js.map +1 -0
- package/dist/internal/hx.d.ts +24 -0
- package/dist/internal/hx.d.ts.map +1 -0
- package/dist/internal/hx.js +27 -0
- package/dist/internal/hx.js.map +1 -0
- package/dist/internal/scroll.d.ts +62 -0
- package/dist/internal/scroll.d.ts.map +1 -0
- package/dist/internal/scroll.js +224 -0
- package/dist/internal/scroll.js.map +1 -0
- package/dist/internal/text.d.ts +6 -0
- package/dist/internal/text.d.ts.map +1 -0
- package/dist/internal/text.js +44 -0
- package/dist/internal/text.js.map +1 -0
- package/dist/internal/timers.d.ts +8 -0
- package/dist/internal/timers.d.ts.map +1 -0
- package/dist/internal/timers.js +22 -0
- package/dist/internal/timers.js.map +1 -0
- package/dist/internal/widget.d.ts +40 -0
- package/dist/internal/widget.d.ts.map +1 -0
- package/dist/internal/widget.js +44 -0
- package/dist/internal/widget.js.map +1 -0
- package/dist/markdown/ast.d.ts +126 -0
- package/dist/markdown/ast.d.ts.map +1 -0
- package/dist/markdown/ast.js +8 -0
- package/dist/markdown/ast.js.map +1 -0
- package/dist/markdown/hx.d.ts +24 -0
- package/dist/markdown/hx.d.ts.map +1 -0
- package/dist/markdown/hx.js +25 -0
- package/dist/markdown/hx.js.map +1 -0
- package/dist/markdown/index.d.ts +90 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +413 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/markdown/parse.d.ts +8 -0
- package/dist/markdown/parse.d.ts.map +1 -0
- package/dist/markdown/parse.js +911 -0
- package/dist/markdown/parse.js.map +1 -0
- package/dist/markdown/spans.d.ts +20 -0
- package/dist/markdown/spans.d.ts.map +1 -0
- package/dist/markdown/spans.js +96 -0
- package/dist/markdown/spans.js.map +1 -0
- package/dist/media-player/backends.d.ts +64 -0
- package/dist/media-player/backends.d.ts.map +1 -0
- package/dist/media-player/backends.js +110 -0
- package/dist/media-player/backends.js.map +1 -0
- package/dist/media-player/control.d.ts +40 -0
- package/dist/media-player/control.d.ts.map +1 -0
- package/dist/media-player/control.js +44 -0
- package/dist/media-player/control.js.map +1 -0
- package/dist/media-player/hx.d.ts +24 -0
- package/dist/media-player/hx.d.ts.map +1 -0
- package/dist/media-player/hx.js +25 -0
- package/dist/media-player/hx.js.map +1 -0
- package/dist/media-player/index.d.ts +107 -0
- package/dist/media-player/index.d.ts.map +1 -0
- package/dist/media-player/index.js +219 -0
- package/dist/media-player/index.js.map +1 -0
- package/dist/media-player/mpv.d.ts +4 -0
- package/dist/media-player/mpv.d.ts.map +1 -0
- package/dist/media-player/mpv.js +120 -0
- package/dist/media-player/mpv.js.map +1 -0
- package/dist/media-player/vlc.d.ts +8 -0
- package/dist/media-player/vlc.d.ts.map +1 -0
- package/dist/media-player/vlc.js +83 -0
- package/dist/media-player/vlc.js.map +1 -0
- package/dist/richtext/index.d.ts +19 -0
- package/dist/richtext/index.d.ts.map +1 -0
- package/dist/richtext/index.js +4 -0
- package/dist/richtext/index.js.map +1 -0
- package/dist/richtext/links.d.ts +12 -0
- package/dist/richtext/links.d.ts.map +1 -0
- package/dist/richtext/links.js +64 -0
- package/dist/richtext/links.js.map +1 -0
- package/dist/richtext/menu.d.ts +11 -0
- package/dist/richtext/menu.d.ts.map +1 -0
- package/dist/richtext/menu.js +43 -0
- package/dist/richtext/menu.js.map +1 -0
- package/dist/richtext/node.d.ts +151 -0
- package/dist/richtext/node.d.ts.map +1 -0
- package/dist/richtext/node.js +255 -0
- package/dist/richtext/node.js.map +1 -0
- package/dist/richtext/runs.d.ts +92 -0
- package/dist/richtext/runs.d.ts.map +1 -0
- package/dist/richtext/runs.js +158 -0
- package/dist/richtext/runs.js.map +1 -0
- package/dist/table/hx.d.ts +24 -0
- package/dist/table/hx.d.ts.map +1 -0
- package/dist/table/hx.js +25 -0
- package/dist/table/hx.js.map +1 -0
- package/dist/table/index.d.ts +169 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/index.js +890 -0
- package/dist/table/index.js.map +1 -0
- package/dist/table/rows.d.ts +136 -0
- package/dist/table/rows.d.ts.map +1 -0
- package/dist/table/rows.js +146 -0
- package/dist/table/rows.js.map +1 -0
- package/dist/terminal/backends.d.ts +105 -0
- package/dist/terminal/backends.d.ts.map +1 -0
- package/dist/terminal/backends.js +185 -0
- package/dist/terminal/backends.js.map +1 -0
- package/dist/terminal/hx.d.ts +24 -0
- package/dist/terminal/hx.d.ts.map +1 -0
- package/dist/terminal/hx.js +25 -0
- package/dist/terminal/hx.js.map +1 -0
- package/dist/terminal/index.d.ts +160 -0
- package/dist/terminal/index.d.ts.map +1 -0
- package/dist/terminal/index.js +344 -0
- package/dist/terminal/index.js.map +1 -0
- package/dist/terminal/title.d.ts +24 -0
- package/dist/terminal/title.d.ts.map +1 -0
- package/dist/terminal/title.js +129 -0
- package/dist/terminal/title.js.map +1 -0
- package/dist/terminal/vt/colors.d.ts +63 -0
- package/dist/terminal/vt/colors.d.ts.map +1 -0
- package/dist/terminal/vt/colors.js +203 -0
- package/dist/terminal/vt/colors.js.map +1 -0
- package/dist/terminal/vt/diff.d.ts +117 -0
- package/dist/terminal/vt/diff.d.ts.map +1 -0
- package/dist/terminal/vt/diff.js +358 -0
- package/dist/terminal/vt/diff.js.map +1 -0
- package/dist/terminal/vt/fonts.d.ts +92 -0
- package/dist/terminal/vt/fonts.d.ts.map +1 -0
- package/dist/terminal/vt/fonts.js +178 -0
- package/dist/terminal/vt/fonts.js.map +1 -0
- package/dist/terminal/vt/index.d.ts +78 -0
- package/dist/terminal/vt/index.d.ts.map +1 -0
- package/dist/terminal/vt/index.js +312 -0
- package/dist/terminal/vt/index.js.map +1 -0
- package/dist/terminal/vt/keys.d.ts +74 -0
- package/dist/terminal/vt/keys.d.ts.map +1 -0
- package/dist/terminal/vt/keys.js +309 -0
- package/dist/terminal/vt/keys.js.map +1 -0
- package/dist/terminal/vt/mouse.d.ts +44 -0
- package/dist/terminal/vt/mouse.d.ts.map +1 -0
- package/dist/terminal/vt/mouse.js +106 -0
- package/dist/terminal/vt/mouse.js.map +1 -0
- package/dist/terminal/vt/node.d.ts +246 -0
- package/dist/terminal/vt/node.d.ts.map +1 -0
- package/dist/terminal/vt/node.js +1068 -0
- package/dist/terminal/vt/node.js.map +1 -0
- package/dist/terminal/vt/pty.d.ts +81 -0
- package/dist/terminal/vt/pty.d.ts.map +1 -0
- package/dist/terminal/vt/pty.js +201 -0
- package/dist/terminal/vt/pty.js.map +1 -0
- package/dist/terminal/vt/renderer.d.ts +179 -0
- package/dist/terminal/vt/renderer.d.ts.map +1 -0
- package/dist/terminal/vt/renderer.js +357 -0
- package/dist/terminal/vt/renderer.js.map +1 -0
- package/dist/terminal/vt/timers.d.ts +6 -0
- package/dist/terminal/vt/timers.d.ts.map +1 -0
- package/dist/terminal/vt/timers.js +16 -0
- package/dist/terminal/vt/timers.js.map +1 -0
- package/dist/terminal/vt/xterm.d.ts +142 -0
- package/dist/terminal/vt/xterm.d.ts.map +1 -0
- package/dist/terminal/vt/xterm.js +32 -0
- package/dist/terminal/vt/xterm.js.map +1 -0
- package/dist/terminal-output/hx.d.ts +24 -0
- package/dist/terminal-output/hx.d.ts.map +1 -0
- package/dist/terminal-output/hx.js +25 -0
- package/dist/terminal-output/hx.js.map +1 -0
- package/dist/terminal-output/index.d.ts +92 -0
- package/dist/terminal-output/index.d.ts.map +1 -0
- package/dist/terminal-output/index.js +179 -0
- package/dist/terminal-output/index.js.map +1 -0
- package/dist/terminal-output/runs.d.ts +27 -0
- package/dist/terminal-output/runs.d.ts.map +1 -0
- package/dist/terminal-output/runs.js +66 -0
- package/dist/terminal-output/runs.js.map +1 -0
- package/dist/three/canvas.d.ts +46 -0
- package/dist/three/canvas.d.ts.map +1 -0
- package/dist/three/canvas.js +305 -0
- package/dist/three/canvas.js.map +1 -0
- package/dist/three/events.d.ts +64 -0
- package/dist/three/events.d.ts.map +1 -0
- package/dist/three/events.js +146 -0
- package/dist/three/events.js.map +1 -0
- package/dist/three/geometries.d.ts +89 -0
- package/dist/three/geometries.d.ts.map +1 -0
- package/dist/three/geometries.js +345 -0
- package/dist/three/geometries.js.map +1 -0
- package/dist/three/globals.d.ts +7 -0
- package/dist/three/globals.d.ts.map +1 -0
- package/dist/three/globals.js +20 -0
- package/dist/three/globals.js.map +1 -0
- package/dist/three/hx.d.ts +9 -0
- package/dist/three/hx.d.ts.map +1 -0
- package/dist/three/hx.js +10 -0
- package/dist/three/hx.js.map +1 -0
- package/dist/three/index.d.ts +22 -0
- package/dist/three/index.d.ts.map +1 -0
- package/dist/three/index.js +24 -0
- package/dist/three/index.js.map +1 -0
- package/dist/three/jsx-dev-runtime.d.ts +19 -0
- package/dist/three/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/three/jsx-dev-runtime.js +2 -0
- package/dist/three/jsx-dev-runtime.js.map +1 -0
- package/dist/three/jsx-runtime.d.ts +19 -0
- package/dist/three/jsx-runtime.d.ts.map +1 -0
- package/dist/three/jsx-runtime.js +2 -0
- package/dist/three/jsx-runtime.js.map +1 -0
- package/dist/three/jsx.d.ts +198 -0
- package/dist/three/jsx.d.ts.map +1 -0
- package/dist/three/jsx.js +2 -0
- package/dist/three/jsx.js.map +1 -0
- package/dist/three/materials.d.ts +125 -0
- package/dist/three/materials.d.ts.map +1 -0
- package/dist/three/materials.js +229 -0
- package/dist/three/materials.js.map +1 -0
- package/dist/three/math.d.ts +146 -0
- package/dist/three/math.d.ts.map +1 -0
- package/dist/three/math.js +464 -0
- package/dist/three/math.js.map +1 -0
- package/dist/three/objects.d.ts +185 -0
- package/dist/three/objects.d.ts.map +1 -0
- package/dist/three/objects.js +309 -0
- package/dist/three/objects.js.map +1 -0
- package/dist/three/passes.d.ts +54 -0
- package/dist/three/passes.d.ts.map +1 -0
- package/dist/three/passes.js +78 -0
- package/dist/three/passes.js.map +1 -0
- package/dist/three/postprocess.d.ts +85 -0
- package/dist/three/postprocess.d.ts.map +1 -0
- package/dist/three/postprocess.js +503 -0
- package/dist/three/postprocess.js.map +1 -0
- package/dist/three/raycast.d.ts +24 -0
- package/dist/three/raycast.d.ts.map +1 -0
- package/dist/three/raycast.js +138 -0
- package/dist/three/raycast.js.map +1 -0
- package/dist/three/reconciler.d.ts +48 -0
- package/dist/three/reconciler.d.ts.map +1 -0
- package/dist/three/reconciler.js +416 -0
- package/dist/three/reconciler.js.map +1 -0
- package/dist/three/renderer-direct.d.ts +102 -0
- package/dist/three/renderer-direct.d.ts.map +1 -0
- package/dist/three/renderer-direct.js +782 -0
- package/dist/three/renderer-direct.js.map +1 -0
- package/dist/three/renderer-indirect.d.ts +68 -0
- package/dist/three/renderer-indirect.d.ts.map +1 -0
- package/dist/three/renderer-indirect.js +438 -0
- package/dist/three/renderer-indirect.js.map +1 -0
- package/dist/three/store.d.ts +81 -0
- package/dist/three/store.d.ts.map +1 -0
- package/dist/three/store.js +110 -0
- package/dist/three/store.js.map +1 -0
- package/dist/timeline/hx.d.ts +18 -0
- package/dist/timeline/hx.d.ts.map +1 -0
- package/dist/timeline/hx.js +10 -0
- package/dist/timeline/hx.js.map +1 -0
- package/dist/timeline/index.d.ts +152 -0
- package/dist/timeline/index.d.ts.map +1 -0
- package/dist/timeline/index.js +383 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/tray-host/hx.d.ts +24 -0
- package/dist/tray-host/hx.d.ts.map +1 -0
- package/dist/tray-host/hx.js +25 -0
- package/dist/tray-host/hx.js.map +1 -0
- package/dist/tray-host/index.d.ts +110 -0
- package/dist/tray-host/index.d.ts.map +1 -0
- package/dist/tray-host/index.js +191 -0
- package/dist/tray-host/index.js.map +1 -0
- package/dist/tray-host/manager.d.ts +137 -0
- package/dist/tray-host/manager.d.ts.map +1 -0
- package/dist/tray-host/manager.js +462 -0
- package/dist/tray-host/manager.js.map +1 -0
- package/dist/tray-host/notify.d.ts +22 -0
- package/dist/tray-host/notify.d.ts.map +1 -0
- package/dist/tray-host/notify.js +74 -0
- package/dist/tray-host/notify.js.map +1 -0
- package/dist/tray-host/protocol.d.ts +106 -0
- package/dist/tray-host/protocol.d.ts.map +1 -0
- package/dist/tray-host/protocol.js +191 -0
- package/dist/tray-host/protocol.js.map +1 -0
- package/dist/tree/hx.d.ts +24 -0
- package/dist/tree/hx.d.ts.map +1 -0
- package/dist/tree/hx.js +25 -0
- package/dist/tree/hx.js.map +1 -0
- package/dist/tree/index.d.ts +221 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/tree/index.js +751 -0
- package/dist/tree/index.js.map +1 -0
- package/dist/tree/internal.d.ts +18 -0
- package/dist/tree/internal.d.ts.map +1 -0
- package/dist/tree/internal.js +66 -0
- package/dist/tree/internal.js.map +1 -0
- package/dist/tree/rows.d.ts +177 -0
- package/dist/tree/rows.d.ts.map +1 -0
- package/dist/tree/rows.js +179 -0
- package/dist/tree/rows.js.map +1 -0
- package/package.json +166 -12
- package/src/ansi/cast.ts +159 -0
- package/src/ansi/index.ts +53 -0
- package/src/ansi/palette.ts +226 -0
- package/src/ansi/parse.ts +780 -0
- package/src/ansi/sgr.ts +380 -0
- package/src/ansi/utf8.ts +84 -0
- package/src/calendar/Calendar.ts +744 -0
- package/src/calendar/DatePicker.ts +368 -0
- package/src/calendar/dates.ts +307 -0
- package/src/calendar/index.ts +51 -0
- package/src/charts/components.ts +864 -0
- package/src/charts/data.ts +776 -0
- package/src/charts/hx.ts +39 -0
- package/src/charts/index.ts +99 -0
- package/src/charts/node.ts +932 -0
- package/src/charts/render.ts +982 -0
- package/src/charts/scale.ts +214 -0
- package/src/charts/spec.ts +122 -0
- package/src/charts/timers.ts +24 -0
- package/src/code/hx.ts +51 -0
- package/src/code/index.ts +174 -0
- package/src/code-editor/completion.ts +161 -0
- package/src/code-editor/doc.ts +198 -0
- package/src/code-editor/hx.ts +26 -0
- package/src/code-editor/index.ts +615 -0
- package/src/code-editor/node.ts +1926 -0
- package/src/code-language/hljs.ts +302 -0
- package/src/code-language/index.ts +51 -0
- package/src/code-language/languages/glsl.ts +120 -0
- package/src/code-language/languages/javascript.ts +419 -0
- package/src/code-language/languages/json.ts +72 -0
- package/src/code-language/languages/shell.ts +221 -0
- package/src/code-language/languages/sql.ts +165 -0
- package/src/code-language/lezer.ts +190 -0
- package/src/code-language/registry.ts +66 -0
- package/src/code-language/runs.ts +128 -0
- package/src/code-language/stream.ts +306 -0
- package/src/code-language/textmate.ts +134 -0
- package/src/code-language/theme.ts +124 -0
- package/src/code-language/timers.ts +36 -0
- package/src/code-language/types.ts +252 -0
- package/src/codeblock/index.ts +146 -0
- package/src/color-picker/ColorField.ts +333 -0
- package/src/color-picker/ColorPicker.ts +1069 -0
- package/src/color-picker/color.ts +399 -0
- package/src/color-picker/index.ts +50 -0
- package/src/desktop-calendar/eds.ts +484 -0
- package/src/desktop-calendar/ical.ts +119 -0
- package/src/desktop-calendar/index.ts +287 -0
- package/src/embed/client.ts +311 -0
- package/src/embed/host.ts +432 -0
- package/src/embed/index.ts +33 -0
- package/src/embed/timers.ts +32 -0
- package/src/flow/draw.ts +418 -0
- package/src/flow/index.ts +473 -0
- package/src/flow/model.ts +687 -0
- package/src/flow/node.ts +3694 -0
- package/src/flow/paths.ts +403 -0
- package/src/flow/types.ts +634 -0
- package/src/formula/hx.ts +51 -0
- package/src/formula/index.ts +243 -0
- package/src/formula/katex.ts +209 -0
- package/src/formula/layout.ts +876 -0
- package/src/formula/node.ts +467 -0
- package/src/html/controls.ts +244 -0
- package/src/html/css/cascade.ts +606 -0
- package/src/html/css/parse.ts +500 -0
- package/src/html/css/style.ts +1371 -0
- package/src/html/css/ua.ts +174 -0
- package/src/html/css/values.ts +358 -0
- package/src/html/dom.ts +410 -0
- package/src/html/hx.ts +55 -0
- package/src/html/index.ts +545 -0
- package/src/html/layout/block.ts +876 -0
- package/src/html/layout/boxes.ts +981 -0
- package/src/html/layout/flex.ts +297 -0
- package/src/html/layout/floats.ts +125 -0
- package/src/html/layout/inline.ts +870 -0
- package/src/html/layout/table.ts +380 -0
- package/src/html/node.ts +967 -0
- package/src/html/paint.ts +605 -0
- package/src/html/resources.ts +214 -0
- package/src/index.ts +638 -0
- package/src/internal/heights.ts +222 -0
- package/src/internal/hx.ts +53 -0
- package/src/internal/scroll.ts +288 -0
- package/src/internal/text.ts +44 -0
- package/src/internal/timers.ts +44 -0
- package/src/internal/widget.ts +92 -0
- package/src/markdown/ast.ts +163 -0
- package/src/markdown/hx.ts +51 -0
- package/src/markdown/index.ts +686 -0
- package/src/markdown/parse.ts +1037 -0
- package/src/markdown/spans.ts +143 -0
- package/src/media-player/backends.ts +155 -0
- package/src/media-player/control.ts +70 -0
- package/src/media-player/hx.ts +51 -0
- package/src/media-player/index.ts +378 -0
- package/src/media-player/mpv.ts +146 -0
- package/src/media-player/vlc.ts +97 -0
- package/src/richtext/index.ts +42 -0
- package/src/richtext/links.ts +78 -0
- package/src/richtext/menu.ts +49 -0
- package/src/richtext/node.ts +406 -0
- package/src/richtext/runs.ts +253 -0
- package/src/table/hx.ts +51 -0
- package/src/table/index.ts +1270 -0
- package/src/table/rows.ts +275 -0
- package/src/terminal/backends.ts +242 -0
- package/src/terminal/hx.ts +51 -0
- package/src/terminal/index.ts +574 -0
- package/src/terminal/title.ts +172 -0
- package/src/terminal/vt/colors.ts +247 -0
- package/src/terminal/vt/diff.ts +467 -0
- package/src/terminal/vt/fonts.ts +233 -0
- package/src/terminal/vt/index.ts +443 -0
- package/src/terminal/vt/keys.ts +369 -0
- package/src/terminal/vt/mouse.ts +144 -0
- package/src/terminal/vt/node.ts +1242 -0
- package/src/terminal/vt/pty.ts +334 -0
- package/src/terminal/vt/renderer.ts +555 -0
- package/src/terminal/vt/timers.ts +31 -0
- package/src/terminal/vt/xterm.ts +193 -0
- package/src/terminal-output/hx.ts +51 -0
- package/src/terminal-output/index.ts +340 -0
- package/src/terminal-output/runs.ts +79 -0
- package/src/three/canvas.ts +451 -0
- package/src/three/events.ts +197 -0
- package/src/three/geometries.ts +429 -0
- package/src/three/globals.ts +34 -0
- package/src/three/hx.ts +22 -0
- package/src/three/index.ts +98 -0
- package/src/three/jsx-dev-runtime.ts +27 -0
- package/src/three/jsx-runtime.ts +38 -0
- package/src/three/jsx.ts +275 -0
- package/src/three/materials.ts +270 -0
- package/src/three/math.ts +585 -0
- package/src/three/objects.ts +397 -0
- package/src/three/passes.ts +90 -0
- package/src/three/postprocess.ts +677 -0
- package/src/three/raycast.ts +189 -0
- package/src/three/react-reconciler.d.ts +50 -0
- package/src/three/reconciler.ts +624 -0
- package/src/three/renderer-direct.ts +1055 -0
- package/src/three/renderer-indirect.ts +570 -0
- package/src/three/store.ts +207 -0
- package/src/timeline/hx.ts +31 -0
- package/src/timeline/index.ts +603 -0
- package/src/tray-host/hx.ts +51 -0
- package/src/tray-host/index.ts +331 -0
- package/src/tray-host/manager.ts +639 -0
- package/src/tray-host/notify.ts +102 -0
- package/src/tray-host/protocol.ts +235 -0
- package/src/tree/hx.ts +51 -0
- package/src/tree/index.ts +1127 -0
- package/src/tree/internal.ts +87 -0
- package/src/tree/rows.ts +334 -0
- package/src/index.d.ts +0 -2
- package/src/index.js +0 -9
- package/src/sparkline/index.d.ts +0 -29
- package/src/sparkline/index.js +0 -50
- package/src/sparkline/node.js +0 -72
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
// <Timeline> — a vertical run of events: an indicator per step, a line
|
|
2
|
+
// between them, and content beside them.
|
|
3
|
+
//
|
|
4
|
+
// The API is [Chakra UI's Timeline](https://chakra-ui.com/docs/components/timeline)
|
|
5
|
+
// with its parts spelled flat — `Timeline.Root` is `<Timeline>`,
|
|
6
|
+
// `Timeline.Item` is `<TimelineItem>` — because that is how the rest of this
|
|
7
|
+
// package names a composition (see `/charts`), and because a namespace object
|
|
8
|
+
// is a module-scope mutation the tree-shaking guard would have to reason
|
|
9
|
+
// about. Everything else is Chakra's: the eight parts, `size`, `variant`, and
|
|
10
|
+
// the last item's line being off by default.
|
|
11
|
+
//
|
|
12
|
+
// It is pure composition of `<box>` and `<text>`, so there is no
|
|
13
|
+
// `registerElement` here and nothing for the reconciler to learn. The one
|
|
14
|
+
// piece that looks like it wants a custom drawing element — the line running
|
|
15
|
+
// down the gutter — is a 1px `<box>` positioned absolutely over the item's
|
|
16
|
+
// full height, which is exactly how the web does it and costs a rectangle
|
|
17
|
+
// instead of a paint callback.
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { useTheme } from 'react-x11';
|
|
20
|
+
import { interpolate, readableInk } from 'react-x11/style';
|
|
21
|
+
import { hx } from './hx.js';
|
|
22
|
+
const h = React.createElement;
|
|
23
|
+
// --- geometry ---------------------------------------------------------------
|
|
24
|
+
//
|
|
25
|
+
// Chakra's numbers, tightened for the desktop: a web timeline is read at arm's
|
|
26
|
+
// length down a column that owns the page, and a panel in an application
|
|
27
|
+
// window is not. Everything a caller is likely to want to move — the width of
|
|
28
|
+
// the whole thing, the space around it — is `style` on the root, so these stay
|
|
29
|
+
// constants rather than props.
|
|
30
|
+
/** The line. One pixel, at every size, the way every timeline draws it. */
|
|
31
|
+
const THICKNESS = 1;
|
|
32
|
+
/** Between the connector column and the content beside it. */
|
|
33
|
+
const ITEM_GAP = 12;
|
|
34
|
+
/** Between the rows inside one item's content. */
|
|
35
|
+
const CONTENT_GAP = 4;
|
|
36
|
+
/** Under one item's content: the run of line between two indicators. */
|
|
37
|
+
const STEP_GAP = 18;
|
|
38
|
+
/** Inside a title, between the label and whatever is set beside it. */
|
|
39
|
+
const TITLE_GAP = 6;
|
|
40
|
+
/**
|
|
41
|
+
* How far an indicator clears the line it sits on.
|
|
42
|
+
*
|
|
43
|
+
* Drawn as an `outline`, which is painted outside the border box and never
|
|
44
|
+
* seen by yoga — so the clearance cannot move the circle it surrounds, and a
|
|
45
|
+
* variant that turns it off cannot change the layout either.
|
|
46
|
+
*/
|
|
47
|
+
const RING = 2;
|
|
48
|
+
// The indicator sizes are Chakra's (16/20/24/32). The type sizes are not:
|
|
49
|
+
// they step off the theme's own `fontSize` rather than a fixed scale, so a
|
|
50
|
+
// theme that sets 16 gets a timeline in 16 instead of one that ignores it.
|
|
51
|
+
const SIZES = {
|
|
52
|
+
sm: { indicator: 16, font: 10, titleStep: -2, titleTop: 0 },
|
|
53
|
+
md: { indicator: 20, font: 12, titleStep: 0, titleTop: 0 },
|
|
54
|
+
lg: { indicator: 24, font: 12, titleStep: 0, titleTop: 2 },
|
|
55
|
+
xl: { indicator: 32, font: 14, titleStep: 0, titleTop: 6 },
|
|
56
|
+
};
|
|
57
|
+
const LookContext = React.createContext(null);
|
|
58
|
+
/** Whether the item being rendered is the last one. */
|
|
59
|
+
const LastContext = React.createContext(false);
|
|
60
|
+
function useLook(part) {
|
|
61
|
+
const look = React.useContext(LookContext);
|
|
62
|
+
if (!look) {
|
|
63
|
+
throw new Error(`@react-x11/components: <${part}> has to be inside a <Timeline>. ` +
|
|
64
|
+
'It reads the size, the variant and the accent from it.');
|
|
65
|
+
}
|
|
66
|
+
return look;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A colour prop, resolved against the palette.
|
|
70
|
+
*
|
|
71
|
+
* `$token` is normally the renderer's job — it resolves one against the
|
|
72
|
+
* nearest `theme` prop while painting — but `tint()` and `readableInk()` are
|
|
73
|
+
* arithmetic over real colours and run here, before any of that. So the two
|
|
74
|
+
* colours this component computes *from* are looked up eagerly, and every
|
|
75
|
+
* other colour it uses stays a `$token` in the style.
|
|
76
|
+
*/
|
|
77
|
+
function resolveColor(value, theme, fallback) {
|
|
78
|
+
if (!value)
|
|
79
|
+
return fallback;
|
|
80
|
+
if (!value.startsWith('$'))
|
|
81
|
+
return value;
|
|
82
|
+
const named = theme[value.slice(1)];
|
|
83
|
+
return typeof named === 'string' ? named : fallback;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* `accent` laid over `ground`, opaquely — a weak wash of the accent at
|
|
87
|
+
* `amount`, a strong one near 1.
|
|
88
|
+
*
|
|
89
|
+
* The obvious spelling of a `subtle` chip is `tint(accent, 0.22)`, and it is
|
|
90
|
+
* the wrong one here: the line runs *behind* every indicator, so a
|
|
91
|
+
* translucent chip has it showing through the middle of the mark. Mixing
|
|
92
|
+
* against the ground gives the same colour and stops the light — and it is
|
|
93
|
+
* still one expression for both palettes, because the ground is what
|
|
94
|
+
* differs between them.
|
|
95
|
+
*
|
|
96
|
+
* `interpolate` is the renderer's own colour lerp, the one that drives every
|
|
97
|
+
* `transition`; it answers null for anything it cannot parse, which is the
|
|
98
|
+
* same "keep going with what you were given" the rest of the style layer
|
|
99
|
+
* does.
|
|
100
|
+
*/
|
|
101
|
+
function over(ground, accent, amount) {
|
|
102
|
+
const mixed = interpolate(ground, accent, amount);
|
|
103
|
+
return typeof mixed === 'string' ? mixed : accent;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Strings and numbers are only legal inside `<text>`, and every part here
|
|
107
|
+
* takes prose — `<TimelineTitle>Product shipped</TimelineTitle>` is the
|
|
108
|
+
* shortest thing that works and has to keep working. So a primitive child is
|
|
109
|
+
* wrapped, and an element child is left exactly as it was written.
|
|
110
|
+
*
|
|
111
|
+
* The wrapper carries no style of its own: `color`, `fontSize`, `fontFamily`
|
|
112
|
+
* and `fontWeight` inherit down the tree, so the box above it has already
|
|
113
|
+
* said everything there is to say — and an app's own `<text>` child inherits
|
|
114
|
+
* the same thing, which is what keeps the two forms looking alike.
|
|
115
|
+
*/
|
|
116
|
+
function withText(children) {
|
|
117
|
+
let wrapped = false;
|
|
118
|
+
const mapped = React.Children.map(children, (child) => {
|
|
119
|
+
if (typeof child !== 'string' && typeof child !== 'number')
|
|
120
|
+
return child;
|
|
121
|
+
wrapped = true;
|
|
122
|
+
return hx('text', null, child);
|
|
123
|
+
});
|
|
124
|
+
return wrapped ? mapped : children;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The part's own style, then the caller's — later entries win, which is how
|
|
128
|
+
* every `style` prop in this renderer resolves precedence.
|
|
129
|
+
*/
|
|
130
|
+
function styled(base, extra) {
|
|
131
|
+
if (!extra)
|
|
132
|
+
return [base];
|
|
133
|
+
return Array.isArray(extra) ? [base, ...extra] : [base, extra];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A timeline.
|
|
137
|
+
*
|
|
138
|
+
* ```jsx
|
|
139
|
+
* <Timeline>
|
|
140
|
+
* <TimelineItem>
|
|
141
|
+
* <TimelineConnector>
|
|
142
|
+
* <TimelineSeparator />
|
|
143
|
+
* <TimelineIndicator>1</TimelineIndicator>
|
|
144
|
+
* </TimelineConnector>
|
|
145
|
+
* <TimelineContent>
|
|
146
|
+
* <TimelineTitle>Product shipped</TimelineTitle>
|
|
147
|
+
* <TimelineDescription>13th May 2021</TimelineDescription>
|
|
148
|
+
* </TimelineContent>
|
|
149
|
+
* </TimelineItem>
|
|
150
|
+
* </Timeline>
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export function Timeline(props) {
|
|
154
|
+
// `Theme` is an interface, so it has no implicit index signature — the same
|
|
155
|
+
// widening `hx.ts` documents for the `theme` prop.
|
|
156
|
+
const theme = useTheme();
|
|
157
|
+
const size = props.size ?? 'md';
|
|
158
|
+
const variant = props.variant ?? 'solid';
|
|
159
|
+
const accent = resolveColor(props.accent, theme, String(theme.accent));
|
|
160
|
+
const ground = resolveColor(props.ground, theme, String(theme.background));
|
|
161
|
+
const showLastSeparator = props.showLastSeparator ?? false;
|
|
162
|
+
const body = typeof theme.fontSize === 'number' ? theme.fontSize : 14;
|
|
163
|
+
const look = React.useMemo(() => {
|
|
164
|
+
const spec = SIZES[size] ?? SIZES.md;
|
|
165
|
+
return {
|
|
166
|
+
variant,
|
|
167
|
+
accent,
|
|
168
|
+
ground,
|
|
169
|
+
indicator: spec.indicator,
|
|
170
|
+
indicatorFont: spec.font,
|
|
171
|
+
titleFont: body + spec.titleStep,
|
|
172
|
+
titleTop: spec.titleTop,
|
|
173
|
+
// One size for every timeline, as in Chakra: a caption is a caption,
|
|
174
|
+
// and a description that grew with the indicator would make the
|
|
175
|
+
// biggest timeline the one whose dates are hardest to skim.
|
|
176
|
+
descriptionFont: body - 2,
|
|
177
|
+
showLastSeparator,
|
|
178
|
+
};
|
|
179
|
+
}, [size, variant, accent, ground, showLastSeparator, body]);
|
|
180
|
+
// Which item is last is a `:last-of-type` selector on the web and a walk
|
|
181
|
+
// here. `Children.toArray` drops the nulls a `{cond && <TimelineItem/>}`
|
|
182
|
+
// leaves behind, so "last" means the last one actually rendered.
|
|
183
|
+
const items = React.Children.toArray(props.children);
|
|
184
|
+
const end = items.length - 1;
|
|
185
|
+
return h(LookContext.Provider, { value: look }, hx('box', {
|
|
186
|
+
// A run of steps is a list, and saying so is what gets a screen
|
|
187
|
+
// reader to announce "list, 4 items" before reading the first one.
|
|
188
|
+
role: 'list',
|
|
189
|
+
style: styled({ flexDirection: 'column' }, props.style),
|
|
190
|
+
'data-testname': props['data-testname'],
|
|
191
|
+
}, items.map((child, i) => h(LastContext.Provider, {
|
|
192
|
+
key: (React.isValidElement(child) && child.key) || i,
|
|
193
|
+
value: i === end,
|
|
194
|
+
}, child))));
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* One step: a connector column and the content beside it, in whichever order
|
|
198
|
+
* they are written. Putting a `<TimelineContent>` *before* the connector is
|
|
199
|
+
* how the two-sided layout is built.
|
|
200
|
+
*/
|
|
201
|
+
export function TimelineItem(props) {
|
|
202
|
+
useLook('TimelineItem');
|
|
203
|
+
return hx('box', {
|
|
204
|
+
// `listitem` takes its accessible name from its contents, so the title
|
|
205
|
+
// and the date below are what an assistive technology reads out.
|
|
206
|
+
role: 'listitem',
|
|
207
|
+
style: styled({
|
|
208
|
+
flexDirection: 'row',
|
|
209
|
+
alignItems: 'flex-start',
|
|
210
|
+
flexShrink: 0,
|
|
211
|
+
gap: ITEM_GAP,
|
|
212
|
+
}, props.style),
|
|
213
|
+
'data-testname': props['data-testname'],
|
|
214
|
+
}, props.children);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The gutter: the indicator, and the line running past it.
|
|
218
|
+
*
|
|
219
|
+
* `alignSelf: 'stretch'` is what makes it as tall as the item however tall
|
|
220
|
+
* the content beside it turns out to be, which is what the separator measures
|
|
221
|
+
* itself against.
|
|
222
|
+
*
|
|
223
|
+
* Which *side* it lands on is nobody's decision here: `<TimelineItem>` is a
|
|
224
|
+
* plain flex row, so an RTL subtree mirrors it and the marks end up on the
|
|
225
|
+
* right, where an RTL reader starts. That is the reason there is no `side`
|
|
226
|
+
* prop — `direction` already says this, and a second way to say it is a
|
|
227
|
+
* second thing that can disagree with the first.
|
|
228
|
+
*/
|
|
229
|
+
export function TimelineConnector(props) {
|
|
230
|
+
useLook('TimelineConnector');
|
|
231
|
+
return hx('box', {
|
|
232
|
+
style: styled({ alignSelf: 'stretch', alignItems: 'center', flexShrink: 0 }, props.style),
|
|
233
|
+
'data-testname': props['data-testname'],
|
|
234
|
+
}, props.children);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* The line down the gutter.
|
|
238
|
+
*
|
|
239
|
+
* It spans the item's full height and the indicator is painted over it,
|
|
240
|
+
* rather than being two stubs above and below — that is the arrangement that
|
|
241
|
+
* needs no arithmetic about where the indicator ends, and it is why the
|
|
242
|
+
* indicator carries a `ground`-coloured ring: the ring is what cuts the line.
|
|
243
|
+
*
|
|
244
|
+
* `zIndex: -1` rather than an ordering rule: Chakra's snippets write the
|
|
245
|
+
* separator before the indicator, but a reader who writes it after should get
|
|
246
|
+
* the same picture, and paint order is otherwise document order.
|
|
247
|
+
*/
|
|
248
|
+
export function TimelineSeparator(props) {
|
|
249
|
+
const look = useLook('TimelineSeparator');
|
|
250
|
+
const last = React.useContext(LastContext);
|
|
251
|
+
if (last && !look.showLastSeparator)
|
|
252
|
+
return null;
|
|
253
|
+
return hx('box', {
|
|
254
|
+
style: styled({
|
|
255
|
+
position: 'absolute',
|
|
256
|
+
top: 0,
|
|
257
|
+
bottom: 0,
|
|
258
|
+
width: THICKNESS,
|
|
259
|
+
// `start` rather than `left`, so an RTL timeline puts its gutter on
|
|
260
|
+
// the other side without anything here knowing which way it reads.
|
|
261
|
+
start: Math.round((look.indicator - THICKNESS) / 2),
|
|
262
|
+
backgroundColor: '$border',
|
|
263
|
+
zIndex: -1,
|
|
264
|
+
}, props.style),
|
|
265
|
+
'data-testname': props['data-testname'],
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* The mark on the line: a filled circle by default, with a step number, a
|
|
270
|
+
* glyph or nothing inside it.
|
|
271
|
+
*
|
|
272
|
+
* An `<Icon>` in here needs no colour of its own — `color` inherits down the
|
|
273
|
+
* tree and a `mono` canvas resolves its ink the same way `<text>` does — but
|
|
274
|
+
* it does need a `size`, which does not inherit.
|
|
275
|
+
*/
|
|
276
|
+
export function TimelineIndicator(props) {
|
|
277
|
+
const look = useLook('TimelineIndicator');
|
|
278
|
+
const theme = useTheme();
|
|
279
|
+
const variant = props.variant ?? look.variant;
|
|
280
|
+
const accent = props.accent === undefined
|
|
281
|
+
? look.accent
|
|
282
|
+
: resolveColor(props.accent, theme, look.accent);
|
|
283
|
+
// The ink on a filled indicator. The palette has already answered this for
|
|
284
|
+
// its own accent (`accentText`, itself derived), so ask it rather than
|
|
285
|
+
// deriving a second answer that could disagree; a colour the app brought is
|
|
286
|
+
// measured the same way core measures one.
|
|
287
|
+
const onAccent = accent === theme.accent
|
|
288
|
+
? String(theme.accentText)
|
|
289
|
+
: readableInk(accent, [String(theme.text), String(theme.background)]);
|
|
290
|
+
const paint = variant === 'solid'
|
|
291
|
+
? { backgroundColor: accent, color: props.color ?? onAccent }
|
|
292
|
+
: variant === 'subtle'
|
|
293
|
+
? {
|
|
294
|
+
backgroundColor: over(look.ground, accent, 0.22),
|
|
295
|
+
color: props.color ?? '$text',
|
|
296
|
+
}
|
|
297
|
+
: variant === 'outline'
|
|
298
|
+
? {
|
|
299
|
+
backgroundColor: look.ground,
|
|
300
|
+
borderWidth: 1,
|
|
301
|
+
borderColor: over(look.ground, accent, 0.55),
|
|
302
|
+
color: props.color ?? '$text',
|
|
303
|
+
}
|
|
304
|
+
: // plain: no chip, but still opaque. The line runs *behind* every
|
|
305
|
+
// indicator, and a transparent one would have it struck through
|
|
306
|
+
// whatever is inside — which is the one thing a tick in a
|
|
307
|
+
// timeline must not look like.
|
|
308
|
+
{ backgroundColor: look.ground, color: props.color ?? '$text' };
|
|
309
|
+
return hx('box', {
|
|
310
|
+
style: styled({
|
|
311
|
+
width: look.indicator,
|
|
312
|
+
height: look.indicator,
|
|
313
|
+
borderRadius: look.indicator / 2,
|
|
314
|
+
alignItems: 'center',
|
|
315
|
+
justifyContent: 'center',
|
|
316
|
+
flexShrink: 0,
|
|
317
|
+
fontSize: look.indicatorFont,
|
|
318
|
+
fontWeight: 'bold',
|
|
319
|
+
// The clearance around the mark. An explicit `outlineWidth` draws
|
|
320
|
+
// the ring whether or not anything is focused, which is what makes
|
|
321
|
+
// it usable as something other than a focus ring.
|
|
322
|
+
outlineWidth: RING,
|
|
323
|
+
outlineColor: look.ground,
|
|
324
|
+
outlineOffset: 0,
|
|
325
|
+
...paint,
|
|
326
|
+
}, props.style),
|
|
327
|
+
'data-testname': props['data-testname'],
|
|
328
|
+
}, withText(props.children));
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* What the step says. Its bottom padding is the run of line between this
|
|
332
|
+
* indicator and the next, so the gutter's length is decided by the content
|
|
333
|
+
* beside it rather than by a height anyone has to name — and the last item
|
|
334
|
+
* has none, which is what stops a timeline ending in a gap.
|
|
335
|
+
*/
|
|
336
|
+
export function TimelineContent(props) {
|
|
337
|
+
useLook('TimelineContent');
|
|
338
|
+
const last = React.useContext(LastContext);
|
|
339
|
+
return hx('box', {
|
|
340
|
+
style: styled({
|
|
341
|
+
flexDirection: 'column',
|
|
342
|
+
flexGrow: 1,
|
|
343
|
+
flexShrink: 1,
|
|
344
|
+
gap: CONTENT_GAP,
|
|
345
|
+
paddingBottom: last ? 0 : STEP_GAP,
|
|
346
|
+
}, props.style),
|
|
347
|
+
'data-testname': props['data-testname'],
|
|
348
|
+
}, withText(props.children));
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* The step's heading. A row, so a badge or a timestamp can sit beside the
|
|
352
|
+
* label, dropped by whatever it takes to line its letters up with the middle
|
|
353
|
+
* of the indicator at this size.
|
|
354
|
+
*/
|
|
355
|
+
export function TimelineTitle(props) {
|
|
356
|
+
const look = useLook('TimelineTitle');
|
|
357
|
+
return hx('box', {
|
|
358
|
+
style: styled({
|
|
359
|
+
flexDirection: 'row',
|
|
360
|
+
flexWrap: 'wrap',
|
|
361
|
+
alignItems: 'center',
|
|
362
|
+
gap: TITLE_GAP,
|
|
363
|
+
marginTop: look.titleTop,
|
|
364
|
+
fontSize: look.titleFont,
|
|
365
|
+
fontWeight: 'bold',
|
|
366
|
+
color: '$text',
|
|
367
|
+
}, props.style),
|
|
368
|
+
'data-testname': props['data-testname'],
|
|
369
|
+
}, withText(props.children));
|
|
370
|
+
}
|
|
371
|
+
/** The quiet line under the title: a date, a name, a status. */
|
|
372
|
+
export function TimelineDescription(props) {
|
|
373
|
+
const look = useLook('TimelineDescription');
|
|
374
|
+
return hx('box', {
|
|
375
|
+
style: styled({
|
|
376
|
+
flexDirection: 'column',
|
|
377
|
+
fontSize: look.descriptionFont,
|
|
378
|
+
color: '$textMuted',
|
|
379
|
+
}, props.style),
|
|
380
|
+
'data-testname': props['data-testname'],
|
|
381
|
+
}, withText(props.children));
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/timeline/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yCAAyC;AACzC,EAAE;AACF,oFAAoF;AACpF,iEAAiE;AACjE,6EAA6E;AAC7E,8EAA8E;AAC9E,yEAAyE;AACzE,8EAA8E;AAC9E,6CAA6C;AAC7C,EAAE;AACF,iEAAiE;AACjE,0EAA0E;AAC1E,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,+BAA+B;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG3D,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC;AAK9B,+EAA+E;AAC/E,EAAE;AACF,+EAA+E;AAC/E,yEAAyE;AACzE,8EAA8E;AAC9E,+EAA+E;AAC/E,+BAA+B;AAE/B,2EAA2E;AAC3E,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,8DAA8D;AAC9D,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,kDAAkD;AAClD,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,wEAAwE;AACxE,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,uEAAuE;AACvE,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB;;;;;;GAMG;AACH,MAAM,IAAI,GAAG,CAAC,CAAC;AAyBf,0EAA0E;AAC1E,2EAA2E;AAC3E,2EAA2E;AAC3E,MAAM,KAAK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;IACrD,MAAM,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACtC,OAAO,EAAE,CACP,KAAK,EACL;QACE,KAAK,EAAE,MAAM,CACX;YACE,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,SAAS;YACd,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,OAAO;SACf,EACD,KAAK,CAAC,KAAK,CACZ;QACD,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC;KACxC,EACD,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,CAAC;AACJ,CAAC;AAQD,gEAAgE;AAChE,MAAM,UAAU,mBAAmB,CACjC,KAA+B;IAE/B,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC5C,OAAO,EAAE,CACP,KAAK,EACL;QACE,KAAK,EAAE,MAAM,CACX;YACE,aAAa,EAAE,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,eAAe;YAC9B,KAAK,EAAE,YAAY;SACpB,EACD,KAAK,CAAC,KAAK,CACZ;QACD,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC;KACxC,EACD,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Key, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { ReactX11Elements, Theme } from 'react-x11';
|
|
3
|
+
/** The host elements, by name. */
|
|
4
|
+
export type Host = ReactX11Elements;
|
|
5
|
+
/**
|
|
6
|
+
* What every element takes on top of its own props.
|
|
7
|
+
*
|
|
8
|
+
* `theme` is honoured by **every** node — `Node.theme` merges `props.theme`
|
|
9
|
+
* over the inherited palette, whatever the kind — but react-x11's element
|
|
10
|
+
* declarations only put it on `<window>`. A widget re-declares the theme it
|
|
11
|
+
* read from context onto its own root so that `$token` values still resolve
|
|
12
|
+
* inside a `<popup>`, which is a separate window and does not inherit the
|
|
13
|
+
* trigger's node tree. So the prop is real; only the declaration is narrow.
|
|
14
|
+
*/
|
|
15
|
+
interface CommonProps {
|
|
16
|
+
key?: Key;
|
|
17
|
+
/** `Theme` is listed alongside the record because it is an interface, and
|
|
18
|
+
* an interface has no implicit index signature — so the palette `useTheme`
|
|
19
|
+
* hands back is not assignable to the record react-x11 declares. */
|
|
20
|
+
theme?: Theme | Record<string, string | number>;
|
|
21
|
+
}
|
|
22
|
+
export declare function hx<K extends keyof Host>(type: K, props?: (Omit<Host[K], 'theme'> & CommonProps) | null, ...children: ReactNode[]): ReactElement;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=hx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx.d.ts","sourceRoot":"","sources":["../../src/tray-host/hx.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEzD,kCAAkC;AAClC,MAAM,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAEpC;;;;;;;;;GASG;AACH,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV;;yEAEqE;IACrE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACjD;AAED,wBAAgB,EAAE,CAAC,CAAC,SAAS,MAAM,IAAI,EACrC,IAAI,EAAE,CAAC,EAIP,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,WAAW,CAAC,GAAG,IAAI,EACrD,GAAG,QAAQ,EAAE,SAAS,EAAE,GACvB,YAAY,CAKd"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// `React.createElement`, typed against react-x11's host elements.
|
|
2
|
+
//
|
|
3
|
+
// The library writes `h(...)` rather than JSX — a convention inherited from
|
|
4
|
+
// core, and worth keeping so moving code between the two repos stays a
|
|
5
|
+
// rename. But `React.createElement`'s own overloads are `@types/react`'s, and
|
|
6
|
+
// they describe the DOM: a `<box onKeyDown>` handler is checked against
|
|
7
|
+
// React's `KeyboardEvent`, not react-x11's, and the whole props object is
|
|
8
|
+
// measured against `DOMAttributes`. Everything interesting fails.
|
|
9
|
+
//
|
|
10
|
+
// So the element name is looked up in react-x11's own element table instead.
|
|
11
|
+
// `hx('box', …)` gets `<box>`'s real props — `ev.keysym` on a key handler,
|
|
12
|
+
// `onDraw` on a `<canvas>` — and `hx('div', …)` is an error, which is the
|
|
13
|
+
// same guarantee the JSX namespace gives `examples/` and `test/types/`.
|
|
14
|
+
import React from 'react';
|
|
15
|
+
export function hx(type,
|
|
16
|
+
// `theme` is dropped from the element's own props before the merge:
|
|
17
|
+
// `<window>` and `<popup>` already declare it, narrower, and intersecting
|
|
18
|
+
// the two would demand a value satisfying both.
|
|
19
|
+
props, ...children) {
|
|
20
|
+
// The cast is the whole point of the wrapper: `createElement`'s string
|
|
21
|
+
// overload insists on DOM props, and the signature above has already
|
|
22
|
+
// checked these against the element that will actually receive them.
|
|
23
|
+
return React.createElement(type, props, ...children);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=hx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx.js","sourceRoot":"","sources":["../../src/tray-host/hx.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,4EAA4E;AAC5E,uEAAuE;AACvE,8EAA8E;AAC9E,wEAAwE;AACxE,0EAA0E;AAC1E,kEAAkE;AAClE,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,wEAAwE;AACxE,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,MAAM,UAAU,EAAE,CAChB,IAAO;AACP,oEAAoE;AACpE,0EAA0E;AAC1E,gDAAgD;AAChD,KAAqD,EACrD,GAAG,QAAqB;IAExB,uEAAuE;IACvE,qEAAqE;IACrE,qEAAqE;IACrE,OAAO,KAAK,CAAC,aAAa,CAAC,IAAc,EAAE,KAAc,EAAE,GAAG,QAAQ,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode, Ref } from 'react';
|
|
2
|
+
import type { Style } from 'react-x11/style';
|
|
3
|
+
import type { TrayConflict, TrayStatus } from './manager.js';
|
|
4
|
+
import type { TrayIcon, TrayMessage, TrayOrientation } from './protocol.js';
|
|
5
|
+
export { BalloonAssembler, MANAGER_ATOM, MESSAGE_DATA_ATOM, OPCODE_ATOM, ORIENTATION_ATOM, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, SYSTEM_TRAY_BEGIN_MESSAGE, SYSTEM_TRAY_CANCEL_MESSAGE, SYSTEM_TRAY_REQUEST_DOCK, VISUAL_ATOM, argbVisualOf, decodeUtf8, orientationValue, selectionNameFor, } from './protocol.js';
|
|
6
|
+
export type { TrayIcon, TrayMessage, TrayOrientation } from './protocol.js';
|
|
7
|
+
export { TrayManager } from './manager.js';
|
|
8
|
+
export type { TrayApp, TrayConflict, TrayManagerHandlers, TrayManagerStartOptions, TrayStatus, } from './manager.js';
|
|
9
|
+
export { BalloonNotifier } from './notify.js';
|
|
10
|
+
/** What a `ref` on `<TrayHost>` gets. */
|
|
11
|
+
export interface TrayHostHandle {
|
|
12
|
+
readonly status: TrayStatus;
|
|
13
|
+
/** Who owns the selection, when this host does not. */
|
|
14
|
+
readonly conflict: TrayConflict | null;
|
|
15
|
+
/** The docked icons, in the order they are rendered. */
|
|
16
|
+
readonly icons: readonly TrayIcon[];
|
|
17
|
+
/** The manager selection window — the address clients send opcodes to. */
|
|
18
|
+
readonly windowId: number | null;
|
|
19
|
+
}
|
|
20
|
+
export interface TrayHostProps {
|
|
21
|
+
/**
|
|
22
|
+
* Which way the icons run, and what `_NET_SYSTEM_TRAY_ORIENTATION` says so
|
|
23
|
+
* an icon can draw itself to match. Default `'horizontal'`.
|
|
24
|
+
*/
|
|
25
|
+
orientation?: TrayOrientation;
|
|
26
|
+
/** The square each icon is laid out in, in pixels. Default 22. */
|
|
27
|
+
iconSize?: number;
|
|
28
|
+
/** Between icons. Default 2. */
|
|
29
|
+
spacing?: number;
|
|
30
|
+
/** Which screen's selection to own. Default 0. */
|
|
31
|
+
screen?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Render order. Icons are otherwise in the order they docked.
|
|
34
|
+
*
|
|
35
|
+
* A comparator rather than a sorted list because **node identity has to
|
|
36
|
+
* stay with the icon**: each `<foreign>` is keyed on the window id and its
|
|
37
|
+
* `windowId` never changes, so reordering moves the node instead of
|
|
38
|
+
* releasing a client from one node and re-embedding it in another. That
|
|
39
|
+
* hand-off is a documented race — the client is parked at the root long
|
|
40
|
+
* enough for a window manager to frame it, and the second node then
|
|
41
|
+
* reports `onClientGone` for a live window.
|
|
42
|
+
*/
|
|
43
|
+
sort?: (a: TrayIcon, b: TrayIcon) => number;
|
|
44
|
+
/** An application asked to be in the tray, and now is. */
|
|
45
|
+
onDock?: (icon: TrayIcon) => void;
|
|
46
|
+
/** Its window went away — the ordinary end of a tray icon's life, not an
|
|
47
|
+
* error. Also fires for every icon when the selection is lost. */
|
|
48
|
+
onUndock?: (icon: TrayIcon) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Another tray already owns this screen's selection, so this one embeds
|
|
51
|
+
* nothing. A second panel on one display is a configuration mistake rather
|
|
52
|
+
* than an exception, which is why it arrives here instead of throwing.
|
|
53
|
+
*/
|
|
54
|
+
onConflict?: (info: TrayConflict) => void;
|
|
55
|
+
onStatusChange?: (status: TrayStatus) => void;
|
|
56
|
+
/**
|
|
57
|
+
* A balloon message. **Providing this turns off the default**, which is to
|
|
58
|
+
* forward the text to the desktop's notification service — a panel that
|
|
59
|
+
* draws its own bubble should not also raise a notification.
|
|
60
|
+
*/
|
|
61
|
+
onMessage?: (message: TrayMessage) => void;
|
|
62
|
+
/** A message was withdrawn before it finished arriving. */
|
|
63
|
+
onCancelMessage?: (info: {
|
|
64
|
+
windowId: number;
|
|
65
|
+
id: number;
|
|
66
|
+
}) => void;
|
|
67
|
+
/** Failures on the wire, and a notification that could not be delivered.
|
|
68
|
+
* Without a handler none of it is reported anywhere. */
|
|
69
|
+
onError?: (err: Error) => void;
|
|
70
|
+
/** False stops balloon messages being forwarded to the notification
|
|
71
|
+
* service. Ignored when `onMessage` is given, which already replaces it. */
|
|
72
|
+
notify?: boolean;
|
|
73
|
+
/** Who a forwarded balloon message is attributed to. Default
|
|
74
|
+
* `'System Tray'`. */
|
|
75
|
+
appName?: string;
|
|
76
|
+
/** Rendered instead of the tray when another host owns the selection. */
|
|
77
|
+
fallback?: ReactNode;
|
|
78
|
+
style?: Style | Style[];
|
|
79
|
+
ref?: Ref<TrayHostHandle>;
|
|
80
|
+
'data-testname'?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The system tray: applications dock their icons into it, and it lays them
|
|
84
|
+
* out like any other row of elements.
|
|
85
|
+
*
|
|
86
|
+
* ```jsx
|
|
87
|
+
* <TrayHost
|
|
88
|
+
* orientation="horizontal"
|
|
89
|
+
* iconSize={22}
|
|
90
|
+
* onDock={(icon) => log(`docked ${icon.id}`)}
|
|
91
|
+
* onUndock={(icon) => log(`gone ${icon.id}`)}
|
|
92
|
+
* />
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* **One per display.** Mounting takes `_NET_SYSTEM_TRAY_S<screen>` and
|
|
96
|
+
* announces it to the root, which is what makes applications that were
|
|
97
|
+
* waiting start docking; unmounting gives the selection back and hands every
|
|
98
|
+
* client back to the root untouched.
|
|
99
|
+
*
|
|
100
|
+
* **An icon that never maps is normal.** Clients set `XEMBED_MAPPED` when
|
|
101
|
+
* they are ready, and some take a while about it. The square is laid out
|
|
102
|
+
* either way, because a tray that only reserved space for icons it could see
|
|
103
|
+
* would reflow every time one woke up.
|
|
104
|
+
*
|
|
105
|
+
* **Icons are not tab stops.** A tray icon is a click target, and Tab
|
|
106
|
+
* walking through eleven of them — several of which are invisible — is the
|
|
107
|
+
* worst version of this, so every `<foreign>` here is `focusable={false}`.
|
|
108
|
+
*/
|
|
109
|
+
export declare function TrayHost(props: TrayHostProps): ReactElement;
|
|
110
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tray-host/index.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAI7C,OAAO,KAAK,EAAW,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5E,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,YAAY,EACV,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,EACvB,UAAU,GACX,MAAM,cAAc,C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