@esportsplus/ui 0.63.0 → 0.64.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/.audit/audit.json +2 -2
- package/.audit/rules-audit.md +2 -2
- package/README.md +15 -18
- package/RULES.md +80 -9
- package/bin/agent-cli +300 -0
- package/build/components/accordion/index.d.ts +4 -0
- package/build/components/accordion/index.js +13 -10
- package/build/components/breadcrumb/index.d.ts +1 -0
- package/build/components/breadcrumb/index.js +43 -37
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/kbd.d.ts +1 -1
- package/build/components/button/kbd.js +17 -15
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/split.js +14 -16
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/chat/minimap/index.js +4 -5
- package/build/components/checkbox/group.d.ts +1 -0
- package/build/components/checkbox/group.js +21 -20
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/color-picker/index.js +6 -6
- package/build/components/color-picker/scss/index.scss +1 -1
- package/build/components/command/index.d.ts +1 -1
- package/build/components/command/palette.d.ts +13 -9
- package/build/components/command/palette.js +143 -152
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/command/search.d.ts +5 -7
- package/build/components/command/search.js +6 -26
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/editor/code/commands.js +1 -1
- package/build/components/editor/code/document.d.ts +1 -3
- package/build/components/editor/code/document.js +1 -1
- package/build/components/editor/code/editor.d.ts +18 -6
- package/build/components/editor/code/editor.js +9 -7
- package/build/components/editor/code/features.js +27 -18
- package/build/components/editor/code/find.d.ts +1 -1
- package/build/components/editor/code/find.js +5 -6
- package/build/components/editor/code/folding.d.ts +3 -5
- package/build/components/editor/code/folding.js +2 -15
- package/build/components/editor/code/gutter.js +2 -2
- package/build/components/editor/code/index.d.ts +1 -0
- package/build/components/editor/code/index.js +1 -0
- package/build/components/editor/code/minimap.d.ts +3 -1
- package/build/components/editor/code/minimap.js +31 -5
- package/build/components/editor/code/services/model.js +2 -1
- package/build/components/editor/code/syntax.js +2 -1
- package/build/components/editor/code/view.d.ts +8 -2
- package/build/components/editor/code/view.js +37 -56
- package/build/components/editor/diffs/index.d.ts +1 -0
- package/build/components/editor/diffs/index.js +1 -0
- package/build/components/editor/diffs/merge.js +16 -17
- package/build/components/editor/diffs/view.js +10 -11
- package/build/components/editor/markdown/editing.d.ts +2 -1
- package/build/components/editor/markdown/editing.js +14 -5
- package/build/components/editor/markdown/format.d.ts +1 -1
- package/build/components/editor/markdown/format.js +116 -26
- package/build/components/editor/markdown/layout.js +2 -1
- package/build/components/editor/markdown/model.d.ts +1 -2
- package/build/components/editor/markdown/model.js +1 -29
- package/build/components/editor/markdown/render.js +1 -1
- package/build/components/editor/markdown/template.d.ts +3 -10
- package/build/components/editor/markdown/template.js +2 -29
- package/build/components/editor/markdown/toolbar.d.ts +2 -2
- package/build/components/editor/markdown/toolbar.js +90 -126
- package/build/components/editor/markdown/view.d.ts +1 -1
- package/build/components/editor/markdown/view.js +54 -87
- package/build/components/editor/tree/drag.js +1 -1
- package/build/components/editor/tree/find.js +70 -64
- package/build/components/editor/tree/template.js +8 -7
- package/build/components/editor/viewer/model.d.ts +1 -1
- package/build/components/editor/viewer/template.js +4 -26
- package/build/components/editor/workspace/keybindings.d.ts +1 -1
- package/build/components/editor/workspace/model.d.ts +12 -2
- package/build/components/editor/workspace/model.js +87 -31
- package/build/components/editor/workspace/session.d.ts +2 -6
- package/build/components/editor/workspace/session.js +99 -16
- package/build/components/editor/workspace/status.d.ts +1 -1
- package/build/components/editor/workspace/strip.d.ts +10 -9
- package/build/components/editor/workspace/strip.js +99 -141
- package/build/components/editor/workspace/tabs.d.ts +2 -4
- package/build/components/editor/workspace/tabs.js +1 -14
- package/build/components/editor/workspace/template.d.ts +1 -1
- package/build/components/editor/workspace/template.js +305 -435
- package/build/components/error/index.d.ts +4 -13
- package/build/components/error/index.js +53 -172
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/form/action.d.ts +2 -2
- package/build/components/form/action.js +2 -2
- package/build/components/form/input.d.ts +3 -3
- package/build/components/form/input.js +32 -10
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/group/index.js +96 -9
- package/build/components/group/scss/index.scss +1 -1
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/index.js +55 -48
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +3 -6
- package/build/components/index.js +3 -6
- package/build/components/inline-edit/index.d.ts +2 -2
- package/build/components/inline-edit/index.js +5 -5
- package/build/components/inline-edit/rich.js +4 -4
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/inline-edit/status.js +1 -0
- package/build/components/input/index.d.ts +4 -0
- package/build/components/input/index.js +3 -1
- package/build/components/input/otp.d.ts +18 -0
- package/build/components/input/otp.js +112 -0
- package/build/components/input/password.d.ts +15 -0
- package/build/components/input/password.js +163 -0
- package/build/components/input/scrub.d.ts +1 -0
- package/build/components/input/scrub.js +103 -89
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/input/tag.d.ts +5 -0
- package/build/components/input/tag.js +116 -69
- package/build/components/json/download.js +1 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/marquee/index.js +1 -1
- package/build/components/marquee/scss/index.scss +1 -1
- package/build/components/nav/scss/index.scss +1 -1
- package/build/components/nav/tree.d.ts +2 -1
- package/build/components/nav/tree.js +6 -5
- package/build/components/notification/index.js +3 -3
- package/build/components/notification/scss/index.scss +1 -1
- package/build/components/overlay/popup.d.ts +2 -2
- package/build/components/overlay/popup.js +1 -1
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/pagination/arrows.js +2 -3
- package/build/components/pagination/cards.js +2 -3
- package/build/components/pagination/index.d.ts +2 -3
- package/build/components/pagination/index.js +18 -13
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/progress/index.js +1 -1
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/progress/text.js +3 -3
- package/build/components/range/filter.d.ts +7 -1
- package/build/components/range/filter.js +188 -171
- package/build/components/range/index.d.ts +14 -9
- package/build/components/range/index.js +11 -8
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/range/surface.d.ts +21 -0
- package/build/components/range/surface.js +144 -0
- package/build/components/relative-time/index.js +2 -2
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/{preview/header.d.ts → search/button.d.ts} +3 -3
- package/build/components/search/button.js +18 -0
- package/build/components/search/index.d.ts +8 -0
- package/build/components/search/index.js +5 -0
- package/build/components/search/input.d.ts +9 -0
- package/build/components/search/input.js +23 -0
- package/build/components/search/parts.d.ts +5 -0
- package/build/components/search/parts.js +17 -0
- package/build/components/search/scss/index.scss +2 -0
- package/build/components/select/expand.js +4 -5
- package/build/components/select/index.d.ts +7 -7
- package/build/components/select/index.js +127 -117
- package/build/components/select/placement.js +8 -1
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/{panels → shell}/group.d.ts +21 -5
- package/build/components/shell/group.js +336 -0
- package/build/components/shell/index.d.ts +15 -17
- package/build/components/shell/index.js +583 -238
- package/build/components/shell/model.d.ts +94 -0
- package/build/components/{panels → shell}/model.js +199 -73
- package/build/components/shell/resize.d.ts +5 -0
- package/build/components/{panels → shell}/resize.js +54 -30
- package/build/components/shell/scss/index.scss +1 -1
- package/build/components/shell/sidebar.d.ts +34 -0
- package/build/components/shell/sidebar.js +362 -0
- package/build/components/{panels → shell}/subtree.js +7 -8
- package/build/components/shortcut-recorder/index.d.ts +5 -4
- package/build/components/shortcut-recorder/index.js +69 -44
- package/build/components/shortcut-recorder/scss/index.scss +1 -1
- package/build/components/sortable/index.d.ts +16 -2
- package/build/components/sortable/index.js +237 -134
- package/build/components/sortable/scss/index.scss +1 -1
- package/build/components/story/index.js +46 -34
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/engine.d.ts +2 -0
- package/build/components/surface-field/engine.js +86 -33
- package/build/components/surface-field/index.d.ts +26 -4
- package/build/components/surface-field/index.js +35 -4
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/surface-field/surface.d.ts +13 -1
- package/build/components/surface-field/surface.js +149 -58
- package/build/components/tasklist/index.d.ts +1 -4
- package/build/components/tasklist/index.js +36 -43
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/textarea/index.d.ts +1 -1
- package/build/components/textarea/index.js +14 -14
- package/build/components/theme/scss/index.scss +1 -1
- package/build/components/theme/shared.d.ts +1 -2
- package/build/components/theme/shared.js +2 -5
- package/build/components/toast/index.d.ts +3 -3
- package/build/components/toast/index.js +3 -3
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/toolbar/index.d.ts +91 -0
- package/build/components/toolbar/index.js +1281 -0
- package/build/components/toolbar/scss/index.scss +2 -0
- package/build/components/tooltip/menu.d.ts +9 -8
- package/build/components/tooltip/menu.js +397 -279
- package/build/components/tooltip/onclick.d.ts +2 -0
- package/build/components/tooltip/onclick.js +13 -4
- package/build/components/tooltip/onhover.d.ts +3 -1
- package/build/components/tooltip/onhover.js +10 -9
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/tooltip/shared.d.ts +4 -4
- package/build/components/tooltip/shared.js +27 -46
- package/build/components/tooltip/utilities.d.ts +5 -2
- package/build/components/tooltip/utilities.js +169 -9
- package/build/components/typewriter/rotate.js +6 -6
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/index.js +1 -1
- package/build/components/usage-meter/scss/index.scss +1 -1
- package/build/css-utilities/font/montserrat/OFL.txt +93 -0
- package/build/shared/drag.d.ts +15 -9
- package/build/shared/drag.js +41 -28
- package/build/shared/placement.d.ts +39 -0
- package/build/shared/placement.js +55 -0
- package/build/shared/transition.js +1 -1
- package/build/shared/viewport.d.ts +1 -2
- package/build/shared/viewport.js +1 -4
- package/package.json +2 -5
- package/src/components/accordion/index.ts +12 -5
- package/src/components/announcement/index.ts +1 -1
- package/src/components/breadcrumb/index.ts +13 -3
- package/src/components/breadcrumb/scss/index.scss +6 -6
- package/src/components/breadcrumb/scss/variables.scss +7 -0
- package/src/components/button/kbd.ts +22 -17
- package/src/components/button/scss/index.scss +69 -76
- package/src/components/button/scss/variables.scss +51 -18
- package/src/components/button/split.ts +12 -8
- package/src/components/capslock/index.ts +2 -0
- package/src/components/capslock/scss/index.scss +21 -21
- package/src/components/card/scss/index.scss +16 -0
- package/src/components/card/scss/variables.scss +25 -2
- package/src/components/chat/minimap/index.ts +5 -6
- package/src/components/chat/minimap/scss/index.scss +12 -11
- package/src/components/chat/minimap/scss/variables.scss +23 -17
- package/src/components/checkbox/group.ts +8 -7
- package/src/components/checkbox/scss/index.scss +59 -35
- package/src/components/checkbox/scss/variables.scss +24 -17
- package/src/components/color-picker/index.ts +6 -6
- package/src/components/color-picker/scss/index.scss +35 -22
- package/src/components/color-picker/scss/variables.scss +11 -3
- package/src/components/command/index.ts +1 -1
- package/src/components/command/palette.ts +174 -166
- package/src/components/command/scss/index.scss +18 -51
- package/src/components/command/scss/variables.scss +37 -71
- package/src/components/command/search.ts +9 -31
- package/src/components/counter/index.ts +22 -22
- package/src/components/counter/scss/variables.scss +10 -7
- package/src/components/editor/code/commands.ts +1 -1
- package/src/components/editor/code/document.ts +0 -2
- package/src/components/editor/code/editor.ts +31 -13
- package/src/components/editor/code/features.ts +39 -24
- package/src/components/editor/code/find.ts +5 -6
- package/src/components/editor/code/folding.ts +3 -21
- package/src/components/editor/code/gutter.ts +2 -2
- package/src/components/editor/code/index.ts +1 -0
- package/src/components/editor/code/minimap.ts +39 -5
- package/src/components/editor/code/scss/_editor.scss +28 -21
- package/src/components/editor/code/scss/_features.scss +19 -21
- package/src/components/editor/code/scss/_services.scss +14 -11
- package/src/components/editor/code/scss/variables.scss +31 -12
- package/src/components/editor/code/services/model.ts +2 -1
- package/src/components/editor/code/syntax.ts +2 -1
- package/src/components/editor/code/view.ts +22 -45
- package/src/components/editor/diffs/index.ts +1 -0
- package/src/components/editor/diffs/merge.ts +9 -10
- package/src/components/editor/diffs/scss/_diffs.scss +39 -63
- package/src/components/editor/diffs/scss/_merge.scss +10 -2
- package/src/components/editor/diffs/scss/index.scss +0 -1
- package/src/components/editor/diffs/scss/variables.scss +36 -17
- package/src/components/editor/diffs/view.ts +8 -9
- package/src/components/editor/markdown/editing.ts +18 -6
- package/src/components/editor/markdown/format.ts +180 -32
- package/src/components/editor/markdown/layout.ts +2 -1
- package/src/components/editor/markdown/model.ts +0 -38
- package/src/components/editor/markdown/render.ts +1 -1
- package/src/components/editor/markdown/scss/index.scss +38 -52
- package/src/components/editor/markdown/scss/variables.scss +24 -50
- package/src/components/editor/markdown/template.ts +3 -63
- package/src/components/editor/markdown/toolbar.ts +76 -127
- package/src/components/editor/markdown/view.ts +9 -32
- package/src/components/editor/tree/drag.ts +1 -1
- package/src/components/editor/tree/find.ts +61 -64
- package/src/components/editor/tree/scss/index.scss +29 -30
- package/src/components/editor/tree/scss/variables.scss +34 -15
- package/src/components/editor/tree/template.ts +9 -9
- package/src/components/editor/viewer/model.ts +1 -1
- package/src/components/editor/viewer/scss/_viewer.scss +4 -5
- package/src/components/editor/viewer/scss/variables.scss +3 -3
- package/src/components/editor/viewer/template.ts +4 -31
- package/src/components/editor/workspace/keybindings.ts +1 -1
- package/src/components/editor/workspace/model.ts +136 -37
- package/src/components/editor/workspace/scss/_keybindings.scss +3 -20
- package/src/components/editor/workspace/scss/_status.scss +0 -1
- package/src/components/editor/workspace/scss/_tabs.scss +2 -41
- package/src/components/editor/workspace/scss/index.scss +49 -71
- package/src/components/editor/workspace/scss/variables.scss +1 -135
- package/src/components/editor/workspace/session.ts +138 -18
- package/src/components/editor/workspace/status.ts +1 -1
- package/src/components/editor/workspace/strip.ts +96 -115
- package/src/components/editor/workspace/tabs.ts +2 -23
- package/src/components/editor/workspace/template.ts +323 -458
- package/src/components/error/index.ts +47 -183
- package/src/components/error/scss/index.scss +34 -35
- package/src/components/error/scss/variables.scss +14 -26
- package/src/components/filter/scss/index.scss +6 -5
- package/src/components/form/action.ts +7 -7
- package/src/components/form/input.ts +25 -12
- package/src/components/frame/scss/index.scss +5 -5
- package/src/components/group/index.ts +77 -2
- package/src/components/group/scss/index.scss +164 -0
- package/src/components/group/scss/variables.scss +110 -2
- package/src/components/heatmap/scss/variables.scss +13 -10
- package/src/components/highlight/index.ts +87 -79
- package/src/components/highlight/scss/index.scss +6 -16
- package/src/components/highlight/scss/variables.scss +33 -5
- package/src/components/icon/scss/index.scss +2 -2
- package/src/components/icon/scss/variables.scss +14 -1
- package/src/components/image/scss/index.scss +9 -9
- package/src/components/image/scss/variables.scss +1 -1
- package/src/components/index.ts +3 -6
- package/src/components/inline-edit/index.ts +8 -6
- package/src/components/inline-edit/rich.ts +8 -8
- package/src/components/inline-edit/scss/index.scss +50 -36
- package/src/components/inline-edit/scss/variables.scss +28 -18
- package/src/components/inline-edit/status.ts +2 -0
- package/src/components/input/index.ts +3 -1
- package/src/components/input/otp.ts +175 -0
- package/src/components/input/password.ts +178 -0
- package/src/components/input/scrub.ts +197 -178
- package/src/components/input/scss/index.scss +344 -4
- package/src/components/input/scss/variables.scss +234 -65
- package/src/components/input/tag.ts +98 -53
- package/src/components/json/download.ts +2 -5
- package/src/components/link/scss/index.scss +3 -5
- package/src/components/loading/scss/index.scss +1 -0
- package/src/components/loading/scss/variables.scss +1 -0
- package/src/components/marquee/index.ts +1 -1
- package/src/components/marquee/scss/index.scss +11 -4
- package/src/components/nav/scss/index.scss +10 -26
- package/src/components/nav/scss/variables.scss +13 -23
- package/src/components/nav/tree.ts +10 -8
- package/src/components/notification/index.ts +3 -3
- package/src/components/notification/scss/index.scss +7 -14
- package/src/components/notification/scss/variables.scss +10 -2
- package/src/components/number/index.ts +1 -1
- package/src/components/overlay/popup.ts +2 -2
- package/src/components/overlay/scss/index.scss +60 -51
- package/src/components/page/scss/variables.scss +1 -0
- package/src/components/pagination/arrows.ts +2 -3
- package/src/components/pagination/cards.ts +2 -3
- package/src/components/pagination/index.ts +11 -9
- package/src/components/pagination/scss/index.scss +38 -101
- package/src/components/pagination/scss/variables.scss +24 -75
- package/src/components/progress/index.ts +1 -1
- package/src/components/progress/scss/index.scss +22 -11
- package/src/components/progress/scss/variables.scss +13 -5
- package/src/components/progress/text.ts +3 -3
- package/src/components/range/filter.ts +249 -246
- package/src/components/range/index.ts +22 -7
- package/src/components/range/scss/index.scss +470 -15
- package/src/components/range/scss/variables.scss +402 -198
- package/src/components/range/surface.ts +135 -0
- package/src/components/relative-time/index.ts +2 -2
- package/src/components/relative-time/scss/index.scss +4 -2
- package/src/components/relative-time/scss/variables.scss +4 -5
- package/src/components/root/scss/index.scss +11 -11
- package/src/components/root/scss/variables.scss +4 -4
- package/src/components/search/button.ts +24 -0
- package/src/components/search/index.ts +12 -0
- package/src/components/search/input.ts +35 -0
- package/src/components/search/parts.ts +24 -0
- package/src/components/search/scss/index.scss +36 -0
- package/src/components/search/scss/variables.scss +67 -0
- package/src/components/section/scss/variables.scss +1 -0
- package/src/components/select/expand.ts +3 -4
- package/src/components/select/index.ts +55 -41
- package/src/components/select/placement.ts +17 -1
- package/src/components/select/scss/index.scss +57 -29
- package/src/components/select/scss/variables.scss +91 -53
- package/src/components/{panels → shell}/group.ts +151 -98
- package/src/components/shell/index.ts +805 -284
- package/src/components/{panels → shell}/model.ts +329 -102
- package/src/components/shell/resize.ts +176 -0
- package/src/components/shell/scss/index.scss +502 -89
- package/src/components/shell/scss/variables.scss +264 -39
- package/src/components/shell/sidebar.ts +325 -0
- package/src/components/{panels → shell}/subtree.ts +1 -2
- package/src/components/shortcut-recorder/index.ts +99 -61
- package/src/components/shortcut-recorder/scss/index.scss +76 -52
- package/src/components/shortcut-recorder/scss/variables.scss +25 -30
- package/src/components/sortable/index.ts +364 -63
- package/src/components/sortable/scss/index.scss +22 -2
- package/src/components/sortable/scss/variables.scss +16 -4
- package/src/components/story/index.ts +56 -33
- package/src/components/story/scss/index.scss +67 -16
- package/src/components/story/scss/variables.scss +59 -18
- package/src/components/surface-field/engine.ts +157 -61
- package/src/components/surface-field/index.ts +64 -9
- package/src/components/surface-field/scss/index.scss +88 -77
- package/src/components/surface-field/scss/variables.scss +84 -36
- package/src/components/surface-field/surface.ts +225 -76
- package/src/components/tasklist/index.ts +10 -14
- package/src/components/tasklist/scss/index.scss +25 -45
- package/src/components/tasklist/scss/variables.scss +12 -29
- package/src/components/textarea/index.ts +39 -42
- package/src/components/theme/reveal.ts +1 -0
- package/src/components/theme/scss/index.scss +20 -16
- package/src/components/theme/scss/variables.scss +11 -5
- package/src/components/theme/shared.ts +3 -7
- package/src/components/toast/index.ts +7 -8
- package/src/components/toast/scss/index.scss +44 -36
- package/src/components/toast/scss/variables.scss +36 -33
- package/src/components/toolbar/index.ts +1675 -0
- package/src/components/toolbar/scss/index.scss +759 -0
- package/src/components/toolbar/scss/variables.scss +555 -0
- package/src/components/tooltip/menu.ts +301 -220
- package/src/components/tooltip/onclick.ts +18 -3
- package/src/components/tooltip/onhover.ts +13 -9
- package/src/components/tooltip/scss/index.scss +155 -188
- package/src/components/tooltip/scss/variables.scss +151 -135
- package/src/components/tooltip/shared.ts +47 -74
- package/src/components/tooltip/utilities.ts +151 -10
- package/src/components/truncate/index.ts +1 -1
- package/src/components/typewriter/rotate.ts +6 -6
- package/src/components/typewriter/scss/index.scss +14 -5
- package/src/components/uptime/scss/index.scss +8 -15
- package/src/components/uptime/scss/variables.scss +12 -1
- package/src/components/usage-meter/index.ts +1 -1
- package/src/components/usage-meter/scss/index.scss +6 -4
- package/src/components/usage-meter/scss/variables.scss +11 -11
- package/src/css-utilities/box-shadow.scss +0 -1
- package/src/css-utilities/icon.scss +9 -9
- package/src/css-utilities/surface.scss +27 -17
- package/src/modifiers/glass/index.ts +2 -2
- package/src/modifiers/glass/scss/index.scss +2 -2
- package/src/normalize/scss/index.scss +1 -1
- package/src/shared/drag.ts +92 -53
- package/src/shared/placement.ts +145 -0
- package/src/shared/transition.ts +1 -1
- package/src/shared/viewport.ts +1 -7
- package/src/tokens/scss/color.scss +2 -2
- package/src/tokens/scss/scale.scss +5 -1
- package/src/tokens/scss/size.scss +0 -7
- package/storage/svg/angle.svg +1 -0
- package/storage/svg/{chevron-left.svg → arrow.svg} +1 -1
- package/storage/svg/calendar.svg +1 -0
- package/storage/svg/circle-filled.svg +1 -0
- package/storage/svg/cursor-arrow-left.svg +1 -0
- package/storage/svg/cursor-arrow-right.svg +1 -0
- package/storage/svg/fit.svg +1 -0
- package/storage/svg/grip.svg +1 -0
- package/storage/svg/mail.svg +1 -0
- package/storage/svg/{chevron-down.svg → minus.svg} +1 -1
- package/storage/svg/music.svg +1 -0
- package/storage/svg/{chevron-up.svg → rotate-ccw.svg} +1 -1
- package/vite.config.ts +9 -13
- package/NOTICE +0 -232
- package/build/components/dock/index.d.ts +0 -47
- package/build/components/dock/index.js +0 -469
- package/build/components/dock/scss/index.scss +0 -2
- package/build/components/metric/flash.d.ts +0 -12
- package/build/components/metric/flash.js +0 -117
- package/build/components/metric/index.d.ts +0 -44
- package/build/components/metric/index.js +0 -275
- package/build/components/metric/scss/index.scss +0 -2
- package/build/components/pagination/dots.d.ts +0 -23
- package/build/components/pagination/dots.js +0 -115
- package/build/components/panels/dnd.d.ts +0 -47
- package/build/components/panels/dnd.js +0 -114
- package/build/components/panels/group.js +0 -322
- package/build/components/panels/index.d.ts +0 -17
- package/build/components/panels/index.js +0 -524
- package/build/components/panels/model.d.ts +0 -64
- package/build/components/panels/resize.d.ts +0 -9
- package/build/components/panels/scss/index.scss +0 -2
- package/build/components/preview/buttons.d.ts +0 -12
- package/build/components/preview/buttons.js +0 -26
- package/build/components/preview/code.d.ts +0 -8
- package/build/components/preview/code.js +0 -18
- package/build/components/preview/header.js +0 -21
- package/build/components/preview/index.d.ts +0 -37
- package/build/components/preview/index.js +0 -123
- package/build/components/preview/scss/index.scss +0 -2
- package/build/components/preview/source.d.ts +0 -12
- package/build/components/preview/source.js +0 -79
- package/build/components/preview/stage.d.ts +0 -8
- package/build/components/preview/stage.js +0 -28
- package/build/components/textarea/scss/index.scss +0 -2
- package/src/components/dock/index.ts +0 -567
- package/src/components/dock/scss/index.scss +0 -346
- package/src/components/dock/scss/variables.scss +0 -357
- package/src/components/input/scss/_field.scss +0 -39
- package/src/components/input/scss/_scrub.scss +0 -89
- package/src/components/input/scss/_tag.scss +0 -142
- package/src/components/metric/flash.ts +0 -129
- package/src/components/metric/index.ts +0 -307
- package/src/components/metric/scss/_flash.scss +0 -150
- package/src/components/metric/scss/index.scss +0 -155
- package/src/components/metric/scss/variables.scss +0 -233
- package/src/components/pagination/dots.ts +0 -132
- package/src/components/panels/dnd.ts +0 -190
- package/src/components/panels/index.ts +0 -676
- package/src/components/panels/resize.ts +0 -157
- package/src/components/panels/scss/index.scss +0 -379
- package/src/components/panels/scss/variables.scss +0 -197
- package/src/components/preview/buttons.ts +0 -48
- package/src/components/preview/code.ts +0 -28
- package/src/components/preview/header.ts +0 -23
- package/src/components/preview/index.ts +0 -149
- package/src/components/preview/scss/index.scss +0 -158
- package/src/components/preview/scss/variables.scss +0 -149
- package/src/components/preview/source.ts +0 -73
- package/src/components/preview/stage.ts +0 -33
- package/src/components/range/scss/_filter.scss +0 -360
- package/src/components/range/scss/_slider.scss +0 -65
- package/src/components/range/scss/_vertical.scss +0 -10
- package/src/components/textarea/scss/index.scss +0 -72
- package/src/components/textarea/scss/variables.scss +0 -22
- package/storage/svg/amex.svg +0 -1
- package/storage/svg/arrow-down.svg +0 -1
- package/storage/svg/arrow-left.svg +0 -1
- package/storage/svg/arrow-right.svg +0 -1
- package/storage/svg/arrow-up.svg +0 -1
- package/storage/svg/card.svg +0 -1
- package/storage/svg/chip.svg +0 -1
- package/storage/svg/discover.svg +0 -1
- package/storage/svg/mastercard.svg +0 -1
- package/storage/svg/visa.svg +0 -1
- /package/build/components/{panels → shell}/subtree.d.ts +0 -0
- /package/storage/svg/{chevron-right.svg → chevron.svg} +0 -0
|
@@ -30,7 +30,10 @@ type Link = {
|
|
|
30
30
|
motion: 'bounce' | 'loop' | 'still';
|
|
31
31
|
// Flattened x, y pairs in field px.
|
|
32
32
|
points: number[];
|
|
33
|
+
// Empty for a link that carries its own wave.
|
|
34
|
+
sequence: string;
|
|
33
35
|
speed: number;
|
|
36
|
+
strength: number;
|
|
34
37
|
width: number;
|
|
35
38
|
};
|
|
36
39
|
|
|
@@ -38,12 +41,20 @@ type Path = {
|
|
|
38
41
|
along: Float64Array;
|
|
39
42
|
box: Box;
|
|
40
43
|
crest: number;
|
|
44
|
+
// The link whose wave this one carries: itself, or the first of its sequence, which holds the motion, speed, phase
|
|
45
|
+
// and the whole run's length.
|
|
46
|
+
head: Path;
|
|
41
47
|
length: number;
|
|
42
48
|
motion: 0 | 1 | 2;
|
|
43
|
-
|
|
49
|
+
// Shifts the crest's travel so a rebuilt link carries on from the same share of its cycle.
|
|
50
|
+
phase: number;
|
|
51
|
+
sequence: string;
|
|
44
52
|
sigma: number;
|
|
45
53
|
speed: number;
|
|
46
|
-
|
|
54
|
+
// Where along its sequence's run this link starts.
|
|
55
|
+
start: number;
|
|
56
|
+
strength: number;
|
|
57
|
+
total: number;
|
|
47
58
|
xs: Float64Array;
|
|
48
59
|
ys: Float64Array;
|
|
49
60
|
};
|
|
@@ -105,11 +116,10 @@ const LINK_CREST = 44;
|
|
|
105
116
|
|
|
106
117
|
const LINK_FRAME = 40;
|
|
107
118
|
|
|
108
|
-
const LINK_LIFT = 0.55;
|
|
109
|
-
|
|
110
119
|
const LINK_SPEED = 160;
|
|
111
120
|
|
|
112
|
-
|
|
121
|
+
// The corridor a crest runs in, about three dots across at the default gap; the resting line is half as wide.
|
|
122
|
+
const LINK_WIDTH = 56;
|
|
113
123
|
|
|
114
124
|
// The floor under a camera scales by zoom ^ 0.4 within these bounds, so it reads as a plane below the content rather
|
|
115
125
|
// than a sticker on it, and never crowds into a wash or thins into scattered points.
|
|
@@ -262,8 +272,13 @@ function simplify(points: number[]) {
|
|
|
262
272
|
|
|
263
273
|
|
|
264
274
|
const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Scheduler) => {
|
|
265
|
-
// The field
|
|
266
|
-
|
|
275
|
+
// The field paints only what changed, so it relies on the canvas keeping the last picture, and a committed frame
|
|
276
|
+
// can lose it (a failed buffer copy on the worker path leaves a black field with only the newest cells drawn). So
|
|
277
|
+
// the picture lives on a canvas that never reaches the compositor, and each painted frame is copied whole to the
|
|
278
|
+
// visible one. Both are owned here and never asked for another kind of context, so 2d is always granted.
|
|
279
|
+
let back = typeof OffscreenCanvas === 'function' ? new OffscreenCanvas(1, 1) : null,
|
|
280
|
+
screen = canvas.getContext('2d') as CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D,
|
|
281
|
+
ctx = back ? back.getContext('2d') as OffscreenCanvasRenderingContext2D : screen,
|
|
267
282
|
accent: Rgb = [102, 131, 232],
|
|
268
283
|
base: Rgb = [128, 128, 128],
|
|
269
284
|
breathed = -Infinity,
|
|
@@ -338,7 +353,10 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
338
353
|
}
|
|
339
354
|
|
|
340
355
|
function build(link: Link): Path | null {
|
|
341
|
-
|
|
356
|
+
// Past 4 a dot is pushed beyond its neighbour at the default gap, and the fabric folds over itself.
|
|
357
|
+
let strength = clamp(link.strength, 0, 4);
|
|
358
|
+
|
|
359
|
+
if (link.points.length < 4 || !strength) {
|
|
342
360
|
return null;
|
|
343
361
|
}
|
|
344
362
|
|
|
@@ -361,26 +379,28 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
361
379
|
return null;
|
|
362
380
|
}
|
|
363
381
|
|
|
364
|
-
let
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
382
|
+
let sigma = (link.width > 0 ? link.width : LINK_WIDTH) / 2,
|
|
383
|
+
pad = extent(sigma, strength),
|
|
384
|
+
path = {
|
|
385
|
+
along: distance,
|
|
386
|
+
box: { bottom: box.bottom + pad, left: box.left - pad, right: box.right + pad, top: box.top - pad },
|
|
387
|
+
crest: -Infinity,
|
|
388
|
+
length,
|
|
389
|
+
motion: link.motion === 'loop' ? 1 : link.motion === 'bounce' ? 2 : 0,
|
|
390
|
+
phase: 0,
|
|
391
|
+
sequence: link.sequence,
|
|
392
|
+
sigma,
|
|
393
|
+
speed: link.speed > 0 ? link.speed : LINK_SPEED,
|
|
394
|
+
start: 0,
|
|
395
|
+
strength,
|
|
396
|
+
total: length,
|
|
397
|
+
xs,
|
|
398
|
+
ys
|
|
399
|
+
} as Path;
|
|
400
|
+
|
|
401
|
+
path.head = path;
|
|
402
|
+
|
|
403
|
+
return path;
|
|
384
404
|
}
|
|
385
405
|
|
|
386
406
|
function crestBox(path: Path): Box | null {
|
|
@@ -413,7 +433,12 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
413
433
|
return null;
|
|
414
434
|
}
|
|
415
435
|
|
|
416
|
-
return pad(box,
|
|
436
|
+
return pad(box, extent(path.sigma, path.strength));
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// A wave's run past both ends by two crest widths, there and back for a bounce.
|
|
440
|
+
function cycle(head: Path) {
|
|
441
|
+
return (head.motion === 2 ? 2 : 1) * (head.total + 4 * LINK_CREST);
|
|
417
442
|
}
|
|
418
443
|
|
|
419
444
|
function draw(c0: number, c1: number, r0: number, r1: number) {
|
|
@@ -485,40 +510,33 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
485
510
|
}
|
|
486
511
|
|
|
487
512
|
let d2 = nearest(x, y, path),
|
|
488
|
-
|
|
513
|
+
s2 = path.sigma * path.sigma;
|
|
489
514
|
|
|
490
|
-
if (d2
|
|
515
|
+
if (d2 >= 9 * s2) {
|
|
491
516
|
continue;
|
|
492
517
|
}
|
|
493
518
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
519
|
+
// A link is lit as a surface's rim is, moving or not: the line is the gaussian of half the
|
|
520
|
+
// corridor, and a crest fills the whole corridor as it passes and swells it outward.
|
|
521
|
+
let across = Math.exp(-d2 / (2 * s2)),
|
|
522
|
+
vein = across * across * across * across * Math.min(1, path.strength);
|
|
497
523
|
|
|
498
|
-
if (
|
|
499
|
-
let off = along - path.crest
|
|
524
|
+
if (path.crest !== -Infinity) {
|
|
525
|
+
let off = along - path.crest,
|
|
526
|
+
wave = across * Math.exp(-(off * off) / (2 * LINK_CREST * LINK_CREST)) * path.strength;
|
|
500
527
|
|
|
501
|
-
|
|
502
|
-
}
|
|
528
|
+
vein = Math.max(vein, Math.min(1, wave));
|
|
503
529
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
vein = t * t * (3 - 2 * t) * (moving ? 0.45 + 0.55 * pulse : 0.8);
|
|
530
|
+
if (d2 > 0.0001) {
|
|
531
|
+
let s = settings.ripplePush * wave / Math.sqrt(d2);
|
|
507
532
|
|
|
508
|
-
|
|
509
|
-
|
|
533
|
+
x += offX * s;
|
|
534
|
+
y += offY * s;
|
|
535
|
+
}
|
|
510
536
|
}
|
|
511
537
|
|
|
512
|
-
dot
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
// The fabric parts a little either side of the vein, so the lattice bends round it.
|
|
516
|
-
if (d2 > 0.0001) {
|
|
517
|
-
let s = path.push * Math.exp(0.5 - d2 / (2 * w2)) / path.spread;
|
|
518
|
-
|
|
519
|
-
x += offX * s;
|
|
520
|
-
y += offY * s;
|
|
521
|
-
}
|
|
538
|
+
dot = Math.max(dot, vein);
|
|
539
|
+
line = Math.max(line, vein);
|
|
522
540
|
}
|
|
523
541
|
}
|
|
524
542
|
|
|
@@ -678,6 +696,11 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
678
696
|
ctx.globalAlpha = 1;
|
|
679
697
|
}
|
|
680
698
|
|
|
699
|
+
// How far a link's light and push reach past its path, with a spacing more for the lines to its neighbours.
|
|
700
|
+
function extent(sigma: number, strength: number) {
|
|
701
|
+
return 3 * sigma + strength * Math.abs(o!.ripplePush) + (lattice?.step ?? o!.gap) * 2;
|
|
702
|
+
}
|
|
703
|
+
|
|
681
704
|
function grow(n: number) {
|
|
682
705
|
if (px.length >= n) {
|
|
683
706
|
return;
|
|
@@ -736,10 +759,6 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
736
759
|
}
|
|
737
760
|
}
|
|
738
761
|
|
|
739
|
-
for (let i = 0, n = paths.length; i < n; i++) {
|
|
740
|
-
paths[i].spread = Math.max(paths[i].sigma, step);
|
|
741
|
-
}
|
|
742
|
-
|
|
743
762
|
full = true;
|
|
744
763
|
}
|
|
745
764
|
|
|
@@ -899,6 +918,7 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
899
918
|
ctx.clearRect(0, 0, width, height);
|
|
900
919
|
draw(0, cols, 0, rows);
|
|
901
920
|
full = false;
|
|
921
|
+
present();
|
|
902
922
|
return;
|
|
903
923
|
}
|
|
904
924
|
|
|
@@ -929,6 +949,8 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
929
949
|
);
|
|
930
950
|
ctx.restore();
|
|
931
951
|
}
|
|
952
|
+
|
|
953
|
+
present();
|
|
932
954
|
}
|
|
933
955
|
|
|
934
956
|
function prepare() {
|
|
@@ -961,11 +983,22 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
961
983
|
continue;
|
|
962
984
|
}
|
|
963
985
|
|
|
964
|
-
let span = path.
|
|
965
|
-
travel = (
|
|
986
|
+
let span = path.head.total + 4 * LINK_CREST,
|
|
987
|
+
travel = travelled(path.head);
|
|
988
|
+
|
|
989
|
+
path.crest = (path.head.motion === 2 && travel > span ? 2 * span - travel : travel) - 2 * LINK_CREST - path.start;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
966
992
|
|
|
967
|
-
|
|
993
|
+
function present() {
|
|
994
|
+
if (!back) {
|
|
995
|
+
return;
|
|
968
996
|
}
|
|
997
|
+
|
|
998
|
+
screen.setTransform(1, 0, 0, 1, 0, 0);
|
|
999
|
+
screen.globalCompositeOperation = 'copy';
|
|
1000
|
+
screen.drawImage(back, 0, 0);
|
|
1001
|
+
screen.globalCompositeOperation = 'source-over';
|
|
969
1002
|
}
|
|
970
1003
|
|
|
971
1004
|
function queue(a: number, b: number, segments: number, brightness: number) {
|
|
@@ -1012,11 +1045,18 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
1012
1045
|
return;
|
|
1013
1046
|
}
|
|
1014
1047
|
|
|
1048
|
+
// Resetting the visible canvas frees its buffers; the kept picture refills it unchanged.
|
|
1015
1049
|
let { width } = canvas;
|
|
1016
1050
|
|
|
1017
1051
|
canvas.width = width + 1;
|
|
1018
1052
|
canvas.width = width;
|
|
1019
|
-
|
|
1053
|
+
|
|
1054
|
+
if (back) {
|
|
1055
|
+
present();
|
|
1056
|
+
}
|
|
1057
|
+
else {
|
|
1058
|
+
paint(null);
|
|
1059
|
+
}
|
|
1020
1060
|
}
|
|
1021
1061
|
|
|
1022
1062
|
// Starts a travelling ring, making room by dropping the oldest ring that is not held.
|
|
@@ -1039,6 +1079,11 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
1039
1079
|
rings.push({ ...next, born: now });
|
|
1040
1080
|
}
|
|
1041
1081
|
|
|
1082
|
+
// The crests' clock: it only advances on a crest frame, and starts at the first.
|
|
1083
|
+
function seconds() {
|
|
1084
|
+
return linked === -Infinity ? 0 : linked / 1000;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1042
1087
|
function seeded(gap: number, view: Camera): Lattice {
|
|
1043
1088
|
let scale = parallax(view.zoom),
|
|
1044
1089
|
step = gap * scale,
|
|
@@ -1291,6 +1336,13 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
1291
1336
|
}
|
|
1292
1337
|
}
|
|
1293
1338
|
|
|
1339
|
+
// Distance the crest has covered through its cycle.
|
|
1340
|
+
function travelled(head: Path) {
|
|
1341
|
+
let length = cycle(head);
|
|
1342
|
+
|
|
1343
|
+
return ((seconds() * head.speed + head.phase) % length + length) % length;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1294
1346
|
function wake() {
|
|
1295
1347
|
if (!o || !lattice || !shown || !size.width) {
|
|
1296
1348
|
return;
|
|
@@ -1308,6 +1360,7 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
1308
1360
|
|
|
1309
1361
|
// The GPU can take a canvas back; the browser returns it blank, and only a full paint refills it.
|
|
1310
1362
|
(canvas as EventTarget).addEventListener('contextrestored', restored);
|
|
1363
|
+
back?.addEventListener('contextrestored', restored);
|
|
1311
1364
|
|
|
1312
1365
|
return {
|
|
1313
1366
|
camera(next: Camera | null) {
|
|
@@ -1404,6 +1457,7 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
1404
1457
|
scheduler.clear(trim);
|
|
1405
1458
|
frame = timer = trim = 0;
|
|
1406
1459
|
(canvas as EventTarget).removeEventListener('contextrestored', restored);
|
|
1460
|
+
back?.removeEventListener('contextrestored', restored);
|
|
1407
1461
|
},
|
|
1408
1462
|
// Runs a pending frame now, so a frame's layout reads and its paint land in the same vsync.
|
|
1409
1463
|
flush() {
|
|
@@ -1427,6 +1481,42 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
1427
1481
|
damage.push(paths[i].box);
|
|
1428
1482
|
}
|
|
1429
1483
|
|
|
1484
|
+
// Moving links sharing a sequence are laid end to end in list order, and one crest runs the whole run: it
|
|
1485
|
+
// leaves one link's far end as it enters the next one's, under the surface they share.
|
|
1486
|
+
let heads = new Map<string, Path>();
|
|
1487
|
+
|
|
1488
|
+
for (let i = 0, n = built.length; i < n; i++) {
|
|
1489
|
+
let path = built[i];
|
|
1490
|
+
|
|
1491
|
+
if (!path.motion || !path.sequence) {
|
|
1492
|
+
continue;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
let head = heads.get(path.sequence);
|
|
1496
|
+
|
|
1497
|
+
if (!head) {
|
|
1498
|
+
heads.set(path.sequence, path);
|
|
1499
|
+
continue;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
path.head = head;
|
|
1503
|
+
path.start = head.total;
|
|
1504
|
+
head.total += path.length;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
// A drag or a speed change rebuilds the links; each wave keeps the share of its cycle it had covered, or
|
|
1508
|
+
// the crest would jump. Links are matched by their place in the list, as the host resends them.
|
|
1509
|
+
for (let i = 0, n = Math.min(built.length, paths.length); i < n; i++) {
|
|
1510
|
+
let path = built[i],
|
|
1511
|
+
was = paths[i].head;
|
|
1512
|
+
|
|
1513
|
+
if (path.head !== path || !path.motion || path.motion !== was.motion) {
|
|
1514
|
+
continue;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
path.phase = travelled(was) / cycle(was) * cycle(path) - seconds() * path.speed;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1430
1520
|
for (let i = 0, n = built.length; i < n; i++) {
|
|
1431
1521
|
damage.push(built[i].box);
|
|
1432
1522
|
}
|
|
@@ -1497,6 +1587,12 @@ const engine = (canvas: HTMLCanvasElement | OffscreenCanvas, scheduler: Schedule
|
|
|
1497
1587
|
|
|
1498
1588
|
canvas.height = Math.max(1, Math.round(height * dpr));
|
|
1499
1589
|
canvas.width = Math.max(1, Math.round(width * dpr));
|
|
1590
|
+
|
|
1591
|
+
if (back) {
|
|
1592
|
+
back.height = canvas.height;
|
|
1593
|
+
back.width = canvas.width;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1500
1596
|
size = { dpr, height, width };
|
|
1501
1597
|
layout();
|
|
1502
1598
|
wake();
|
|
@@ -17,10 +17,14 @@ type Link = {
|
|
|
17
17
|
motion?: 'bounce' | 'loop' | 'still';
|
|
18
18
|
// The path itself, in field px (world units when a camera is set); wins over the curve between `from` and `to`.
|
|
19
19
|
points?: { x: number, y: number }[];
|
|
20
|
+
// Moving links sharing a sequence carry one wave through them in list order; the first sets its motion and speed.
|
|
21
|
+
sequence?: string;
|
|
20
22
|
// Crest speed in px per second.
|
|
21
23
|
speed?: number;
|
|
24
|
+
// 1 pushes a dot as far as a click's ring does; up to 4, and 0 hides the link.
|
|
25
|
+
strength?: number;
|
|
22
26
|
to?: string;
|
|
23
|
-
// Width of the
|
|
27
|
+
// Width of the crest's corridor in px; the lit line is half as wide.
|
|
24
28
|
width?: number;
|
|
25
29
|
};
|
|
26
30
|
|
|
@@ -136,6 +140,28 @@ function angle(value: string) {
|
|
|
136
140
|
return match ? parseFloat(match[1]) * UNITS[match[2]] : 0;
|
|
137
141
|
}
|
|
138
142
|
|
|
143
|
+
function inside(shape: Shape, x: number, y: number) {
|
|
144
|
+
let angle = shape.rotation * Math.PI / 180,
|
|
145
|
+
cos = Math.cos(angle),
|
|
146
|
+
sin = Math.sin(angle),
|
|
147
|
+
dx = x - shape.x,
|
|
148
|
+
dy = y - shape.y,
|
|
149
|
+
hx = shape.width / 2,
|
|
150
|
+
hy = shape.height / 2,
|
|
151
|
+
lx = Math.abs(dx * cos + dy * sin),
|
|
152
|
+
ly = Math.abs(dy * cos - dx * sin);
|
|
153
|
+
|
|
154
|
+
if (shape.ellipse) {
|
|
155
|
+
return (lx * lx) / (hx * hx) + (ly * ly) / (hy * hy) <= 1;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
let r = Math.max(0, Math.min(shape.radius, hx, hy)),
|
|
159
|
+
qx = Math.max(0, lx - hx + r),
|
|
160
|
+
qy = Math.max(0, ly - hy + r);
|
|
161
|
+
|
|
162
|
+
return lx <= hx && ly <= hy && qx * qx + qy * qy <= r * r;
|
|
163
|
+
}
|
|
164
|
+
|
|
139
165
|
// Resolves any CSS colour (oklch, named, hex…) to rgb by painting it once.
|
|
140
166
|
function rgb(color: string): Rgb {
|
|
141
167
|
let cached = colors.get(color);
|
|
@@ -281,16 +307,38 @@ export default component(
|
|
|
281
307
|
c1x = across ? a.x + dx / 2 : a.x,
|
|
282
308
|
c1y = across ? a.y : a.y + dy / 2,
|
|
283
309
|
c2x = across ? b.x - dx / 2 : b.x,
|
|
284
|
-
c2y = across ? b.y : b.y - dy / 2
|
|
310
|
+
c2y = across ? b.y : b.y - dy / 2,
|
|
311
|
+
x = (t: number) => (1 - t) ** 3 * a.x + 3 * (1 - t) ** 2 * t * c1x + 3 * (1 - t) * t * t * c2x + t ** 3 * b.x,
|
|
312
|
+
y = (t: number) => (1 - t) ** 3 * a.y + 3 * (1 - t) ** 2 * t * c1y + 3 * (1 - t) * t * t * c2y + t ** 3 * b.y;
|
|
313
|
+
|
|
314
|
+
// Aimed centre to centre but cut where it leaves one shape and enters the other: the field shows nothing
|
|
315
|
+
// under a surface, so only the stretch between them is drawn and a crest never stalls out of sight.
|
|
316
|
+
let edge = (shape: Shape, from: number, to: number) => {
|
|
317
|
+
for (let i = 0; i < 12; i++) {
|
|
318
|
+
let mid = (from + to) / 2;
|
|
319
|
+
|
|
320
|
+
if (inside(shape, x(mid), y(mid))) {
|
|
321
|
+
from = mid;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
to = mid;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
return (from + to) / 2;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
let t0 = edge(a, 0, 1),
|
|
332
|
+
t1 = edge(b, 1, t0);
|
|
333
|
+
|
|
334
|
+
if (t1 - t0 < 0.001) {
|
|
335
|
+
return points;
|
|
336
|
+
}
|
|
285
337
|
|
|
286
338
|
for (let i = 0; i <= 32; i++) {
|
|
287
|
-
let t = i / 32
|
|
288
|
-
u = 1 - t;
|
|
339
|
+
let t = t0 + (t1 - t0) * i / 32;
|
|
289
340
|
|
|
290
|
-
points.push(
|
|
291
|
-
u * u * u * a.x + 3 * u * u * t * c1x + 3 * u * t * t * c2x + t * t * t * b.x,
|
|
292
|
-
u * u * u * a.y + 3 * u * u * t * c1y + 3 * u * t * t * c2y + t * t * t * b.y
|
|
293
|
-
);
|
|
341
|
+
points.push(x(t), y(t));
|
|
294
342
|
}
|
|
295
343
|
|
|
296
344
|
return points;
|
|
@@ -435,7 +483,14 @@ export default component(
|
|
|
435
483
|
}
|
|
436
484
|
|
|
437
485
|
if (points.length >= 4) {
|
|
438
|
-
result.push({
|
|
486
|
+
result.push({
|
|
487
|
+
motion: link.motion ?? 'still',
|
|
488
|
+
points,
|
|
489
|
+
sequence: link.sequence ?? '',
|
|
490
|
+
speed: link.speed ?? 0,
|
|
491
|
+
strength: link.strength ?? 1,
|
|
492
|
+
width: link.width ?? 0
|
|
493
|
+
});
|
|
439
494
|
}
|
|
440
495
|
}
|
|
441
496
|
|