@esportsplus/ui 0.62.0 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.audit/audit.json +4 -92
- package/.audit/rules-audit.md +4 -18
- 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 -7
- package/build/components/index.js +3 -7
- 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 +9 -12
- 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 -7
- 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 -69
- 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/build/components/cc/index.d.ts +0 -33
- package/build/components/cc/index.js +0 -603
- package/build/components/cc/scss/index.scss +0 -2
- 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/cc/index.ts +0 -562
- package/src/components/cc/scss/index.scss +0 -416
- package/src/components/cc/scss/variables.scss +0 -257
- 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
|
@@ -2,14 +2,22 @@ import { reactive } from '@esportsplus/reactivity';
|
|
|
2
2
|
import { component, html, type Attributes } from '@esportsplus/template';
|
|
3
3
|
import { clamp } from '~/shared/clamp';
|
|
4
4
|
import inlineEdit from '~/components/inline-edit';
|
|
5
|
+
import '~/components/card/scss/index.scss';
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
type Geometry = { height: number, width: number, x: number, y: number };
|
|
8
|
+
type Geometry = { height: number, rotation: number, width: number, x: number, y: number };
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
// What the hand holds: the body moves, a frame corner or edge resizes (sx and sy say which sides follow it), the knob
|
|
11
|
+
// turns, the out port draws a link.
|
|
12
|
+
type Grip = { kind: 'link' | 'move' | 'resize' | 'rotate', sx: number, sy: number };
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
type Point = { x: number, y: number };
|
|
15
|
+
|
|
16
|
+
// Pointer and centre are viewport px; the rest is the geometry the gesture started from.
|
|
17
|
+
type Start = Geometry & { cx: number, cy: number, grip: Grip, moved: boolean, pointerX: number, pointerY: number, scale: number };
|
|
18
|
+
|
|
19
|
+
// Receives every move, resize, turn and edit, so edges, a minimap or a store can follow the surface.
|
|
20
|
+
type State = Omit<Geometry, 'rotation'> & { body?: string, rotation?: number, title?: string };
|
|
13
21
|
|
|
14
22
|
type Surface = Attributes & {
|
|
15
23
|
// Text under the header; an inline-edited note when `editable`.
|
|
@@ -19,15 +27,25 @@ type Surface = Attributes & {
|
|
|
19
27
|
// Edit the title and body in place.
|
|
20
28
|
editable?: boolean;
|
|
21
29
|
height?: number;
|
|
22
|
-
// Names the surface in its
|
|
30
|
+
// Names the surface in its accessible label; defaults to the title.
|
|
23
31
|
label?: string;
|
|
24
32
|
minHeight?: number;
|
|
25
33
|
minWidth?: number;
|
|
26
|
-
// Names the surface for field links
|
|
34
|
+
// Names the surface for field links and `onlink`, like `data-surface-field` on any other element.
|
|
27
35
|
name?: string;
|
|
36
|
+
// The name of the surface a link drawn from the out port was dropped on.
|
|
37
|
+
onlink?: (to: string) => void;
|
|
38
|
+
// The end of the link being drawn from the out port, in the parent's px; null once it is let go.
|
|
39
|
+
onlinking?: (point: Point | null) => void;
|
|
28
40
|
onsave?: (key: 'body' | 'title', value: string) => void;
|
|
41
|
+
// Connection dots on both sides: links arrive on the left and are drawn out from the right.
|
|
42
|
+
ports?: boolean;
|
|
43
|
+
// Edit the body with the markdown editor and its formatting toolbar instead of plain text.
|
|
44
|
+
rich?: boolean;
|
|
45
|
+
// Degrees, clockwise.
|
|
46
|
+
rotation?: number;
|
|
29
47
|
state?: State;
|
|
30
|
-
// Shown in the header
|
|
48
|
+
// Shown in the header; an inline edit when `editable`.
|
|
31
49
|
title?: string;
|
|
32
50
|
width?: number;
|
|
33
51
|
x?: number;
|
|
@@ -35,9 +53,25 @@ type Surface = Attributes & {
|
|
|
35
53
|
};
|
|
36
54
|
|
|
37
55
|
|
|
56
|
+
const CORNERS = [['ne', 1, -1], ['nw', -1, -1], ['se', 1, 1], ['sw', -1, 1]] as const;
|
|
57
|
+
|
|
58
|
+
// A press that travels less than this, in px, is a click that selects rather than a drag.
|
|
59
|
+
const DRAG_SLOP = 3;
|
|
60
|
+
|
|
61
|
+
const EDGES = [['e', 1, 0], ['n', 0, -1], ['s', 0, 1], ['w', -1, 0]] as const;
|
|
62
|
+
|
|
63
|
+
|
|
38
64
|
let z = 1;
|
|
39
65
|
|
|
40
66
|
|
|
67
|
+
// A turn kept in (-180, 180], so a surface spun twice reads -6 and not 714.
|
|
68
|
+
function wrap(degrees: number) {
|
|
69
|
+
let d = ((degrees % 360) + 360) % 360;
|
|
70
|
+
|
|
71
|
+
return d > 180 ? d - 360 : d;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
41
75
|
export default component<Surface>(
|
|
42
76
|
function(this, {
|
|
43
77
|
body,
|
|
@@ -48,7 +82,12 @@ export default component<Surface>(
|
|
|
48
82
|
minHeight = 72,
|
|
49
83
|
minWidth = 120,
|
|
50
84
|
name,
|
|
85
|
+
onlink,
|
|
86
|
+
onlinking,
|
|
51
87
|
onsave,
|
|
88
|
+
ports = false,
|
|
89
|
+
rich = false,
|
|
90
|
+
rotation = 0,
|
|
52
91
|
state,
|
|
53
92
|
title,
|
|
54
93
|
width = 240,
|
|
@@ -58,15 +97,16 @@ export default component<Surface>(
|
|
|
58
97
|
}, content) {
|
|
59
98
|
let element: HTMLElement | undefined,
|
|
60
99
|
start: Start | null = null,
|
|
61
|
-
view = reactive({ active: false, height, width, x, y, z: 0 });
|
|
100
|
+
view = reactive({ active: false, height, rotation, selected: false, width, x, y, z: 0 });
|
|
62
101
|
|
|
63
102
|
if (state) {
|
|
64
103
|
({ height, width, x, y } = state);
|
|
65
104
|
body = state.body ?? body;
|
|
105
|
+
rotation = state.rotation ?? rotation;
|
|
66
106
|
title = state.title ?? title;
|
|
67
107
|
}
|
|
68
108
|
|
|
69
|
-
let called = label ?? title
|
|
109
|
+
let called = label ?? title ?? 'Surface';
|
|
70
110
|
|
|
71
111
|
function apply() {
|
|
72
112
|
if (!element) {
|
|
@@ -89,66 +129,89 @@ export default component<Surface>(
|
|
|
89
129
|
}
|
|
90
130
|
|
|
91
131
|
view.height = height;
|
|
132
|
+
view.rotation = rotation;
|
|
92
133
|
view.width = width;
|
|
93
134
|
view.x = x;
|
|
94
135
|
view.y = y;
|
|
95
136
|
|
|
96
|
-
if (state && (state.height !== height || state.width !== width || state.x !== x || state.y !== y)) {
|
|
137
|
+
if (state && (state.height !== height || state.rotation !== rotation || state.width !== width || state.x !== x || state.y !== y)) {
|
|
97
138
|
state.height = height;
|
|
139
|
+
state.rotation = rotation;
|
|
98
140
|
state.width = width;
|
|
99
141
|
state.x = x;
|
|
100
142
|
state.y = y;
|
|
101
143
|
}
|
|
102
144
|
}
|
|
103
145
|
|
|
104
|
-
function begin(event: PointerEvent
|
|
105
|
-
if (event.button !== 0 || !element) {
|
|
146
|
+
function begin(event: PointerEvent) {
|
|
147
|
+
if (event.button !== 0 || !element || start) {
|
|
106
148
|
return;
|
|
107
149
|
}
|
|
108
150
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
151
|
+
view.selected = true;
|
|
152
|
+
|
|
153
|
+
let target = event.target as Element,
|
|
154
|
+
held = target.closest<HTMLElement>('[data-grip]');
|
|
155
|
+
|
|
156
|
+
// A press on editable text edits it; anywhere else on the body carries the surface.
|
|
157
|
+
if (!held || (held === element && target.closest('.inline-edit'))) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
let { grip: kind, sx, sy } = held.dataset,
|
|
162
|
+
bounds = element.getBoundingClientRect(),
|
|
163
|
+
turn = rotation * Math.PI / 180,
|
|
164
|
+
// Inside a zoomed world the pointer travels in screen px; the rendered box over the turned layout box
|
|
165
|
+
// gives the scale to divide by, so the surface stays under the cursor.
|
|
166
|
+
scale = bounds.width / (width * Math.abs(Math.cos(turn)) + height * Math.abs(Math.sin(turn))) || 1;
|
|
167
|
+
|
|
168
|
+
element.setPointerCapture(event.pointerId);
|
|
169
|
+
event.preventDefault();
|
|
114
170
|
start = {
|
|
115
|
-
|
|
116
|
-
|
|
171
|
+
cx: bounds.left + bounds.width / 2,
|
|
172
|
+
cy: bounds.top + bounds.height / 2,
|
|
173
|
+
grip: { kind: kind as Grip['kind'], sx: Number(sx ?? 0), sy: Number(sy ?? 0) },
|
|
174
|
+
height,
|
|
175
|
+
moved: kind !== 'move' && kind !== 'link',
|
|
117
176
|
pointerX: event.clientX,
|
|
118
177
|
pointerY: event.clientY,
|
|
119
|
-
|
|
120
|
-
|
|
178
|
+
rotation,
|
|
179
|
+
scale,
|
|
180
|
+
width,
|
|
121
181
|
x,
|
|
122
182
|
y
|
|
123
183
|
};
|
|
184
|
+
view.active = kind !== 'link';
|
|
185
|
+
view.z = ++z;
|
|
124
186
|
}
|
|
125
187
|
|
|
126
188
|
function end() {
|
|
189
|
+
if (start?.grip.kind === 'link') {
|
|
190
|
+
onlinking?.(null);
|
|
191
|
+
}
|
|
192
|
+
|
|
127
193
|
start = null;
|
|
128
194
|
view.active = false;
|
|
129
195
|
}
|
|
130
196
|
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
197
|
+
function keydown(event: KeyboardEvent) {
|
|
198
|
+
if (event.target !== event.currentTarget) {
|
|
133
199
|
return;
|
|
134
200
|
}
|
|
135
201
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
width = start.w + dx;
|
|
141
|
-
height = start.h + dy;
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
x = start.x + dx;
|
|
145
|
-
y = start.y + dy;
|
|
202
|
+
if (event.key === 'Escape') {
|
|
203
|
+
view.selected = false;
|
|
204
|
+
element?.blur();
|
|
205
|
+
return;
|
|
146
206
|
}
|
|
147
207
|
|
|
148
|
-
|
|
149
|
-
|
|
208
|
+
if (event.key === '[' || event.key === ']') {
|
|
209
|
+
event.preventDefault();
|
|
210
|
+
rotation = wrap(rotation + (event.key === ']' ? 1 : -1) * (event.shiftKey ? 1 : 15));
|
|
211
|
+
apply();
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
150
214
|
|
|
151
|
-
function nudge(event: KeyboardEvent, resize: boolean) {
|
|
152
215
|
let step = event.shiftKey ? 32 : 8,
|
|
153
216
|
dx = event.key === 'ArrowLeft' ? -step : event.key === 'ArrowRight' ? step : 0,
|
|
154
217
|
dy = event.key === 'ArrowUp' ? -step : event.key === 'ArrowDown' ? step : 0;
|
|
@@ -159,7 +222,7 @@ export default component<Surface>(
|
|
|
159
222
|
|
|
160
223
|
event.preventDefault();
|
|
161
224
|
|
|
162
|
-
if (
|
|
225
|
+
if (event.altKey) {
|
|
163
226
|
width += dx;
|
|
164
227
|
height += dy;
|
|
165
228
|
}
|
|
@@ -171,6 +234,91 @@ export default component<Surface>(
|
|
|
171
234
|
apply();
|
|
172
235
|
}
|
|
173
236
|
|
|
237
|
+
function move(event: PointerEvent) {
|
|
238
|
+
if (!start) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
let dx = event.clientX - start.pointerX,
|
|
243
|
+
dy = event.clientY - start.pointerY;
|
|
244
|
+
|
|
245
|
+
if (!start.moved) {
|
|
246
|
+
if (Math.hypot(dx, dy) < DRAG_SLOP) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
start.moved = true;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
let grip = start.grip,
|
|
254
|
+
turn = start.rotation * Math.PI / 180,
|
|
255
|
+
cos = Math.cos(turn),
|
|
256
|
+
sin = Math.sin(turn);
|
|
257
|
+
|
|
258
|
+
dx /= start.scale;
|
|
259
|
+
dy /= start.scale;
|
|
260
|
+
|
|
261
|
+
if (grip.kind === 'link') {
|
|
262
|
+
onlinking?.(port(start, dx, dy));
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (grip.kind === 'move') {
|
|
267
|
+
x = start.x + dx;
|
|
268
|
+
y = start.y + dy;
|
|
269
|
+
}
|
|
270
|
+
else if (grip.kind === 'rotate') {
|
|
271
|
+
// The angle the hand sweeps about the centre, added to the one it started at; Shift lands on 15 degree
|
|
272
|
+
// steps.
|
|
273
|
+
let swept = Math.atan2(event.clientY - start.cy, event.clientX - start.cx)
|
|
274
|
+
- Math.atan2(start.pointerY - start.cy, start.pointerX - start.cx),
|
|
275
|
+
degrees = start.rotation + swept * 180 / Math.PI;
|
|
276
|
+
|
|
277
|
+
rotation = wrap(event.shiftKey ? Math.round(degrees / 15) * 15 : degrees);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
// Read in the surface's own frame: the travel is turned back by its angle, the sides the grip owns follow
|
|
281
|
+
// it, and the centre moves by half of what they gained, turned forward again, so the opposite side stays
|
|
282
|
+
// put on screen, turned or not.
|
|
283
|
+
let du = cos * dx + sin * dy,
|
|
284
|
+
dv = cos * dy - sin * dx,
|
|
285
|
+
w = grip.sx ? Math.max(minWidth, start.width + grip.sx * du) : start.width,
|
|
286
|
+
h = grip.sy ? Math.max(minHeight, start.height + grip.sy * dv) : start.height,
|
|
287
|
+
lx = grip.sx * (w - start.width) / 2,
|
|
288
|
+
ly = grip.sy * (h - start.height) / 2;
|
|
289
|
+
|
|
290
|
+
width = w;
|
|
291
|
+
height = h;
|
|
292
|
+
x = start.x + start.width / 2 + cos * lx - sin * ly - w / 2;
|
|
293
|
+
y = start.y + start.height / 2 + sin * lx + cos * ly - h / 2;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
apply();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// The out port, turned with the surface, plus the hand's travel in the parent's px.
|
|
300
|
+
function port(from: Start, dx: number, dy: number): Point {
|
|
301
|
+
let turn = from.rotation * Math.PI / 180;
|
|
302
|
+
|
|
303
|
+
return {
|
|
304
|
+
x: from.x + from.width / 2 + Math.cos(turn) * from.width / 2 + dx,
|
|
305
|
+
y: from.y + from.height / 2 + Math.sin(turn) * from.width / 2 + dy
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function release(event: PointerEvent) {
|
|
310
|
+
if (start?.grip.kind !== 'link' || !start.moved) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Hit testing has no template equivalent: the surface under the hand is the one the link is dropped on.
|
|
315
|
+
let to = document.elementFromPoint(event.clientX, event.clientY)?.closest('[data-surface-field]')?.getAttribute('data-surface-field');
|
|
316
|
+
|
|
317
|
+
if (to && to !== name) {
|
|
318
|
+
onlink?.(to);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
174
322
|
function save(key: 'body' | 'title', value: string) {
|
|
175
323
|
if (state) {
|
|
176
324
|
state[key] = value;
|
|
@@ -181,40 +329,47 @@ export default component<Surface>(
|
|
|
181
329
|
|
|
182
330
|
return html`
|
|
183
331
|
<div
|
|
184
|
-
|
|
332
|
+
aria-keyshortcuts='ArrowUp ArrowDown ArrowLeft ArrowRight Alt+ArrowUp Alt+ArrowDown Alt+ArrowLeft Alt+ArrowRight [ ] Escape'
|
|
333
|
+
aria-label='${`${called}: arrow keys move it, Alt and the arrow keys resize it, [ and ] turn it`}'
|
|
334
|
+
aria-roledescription='surface'
|
|
335
|
+
class='card card--ring surface-field-surface'
|
|
336
|
+
data-grip='move'
|
|
337
|
+
role='group'
|
|
338
|
+
tabindex='0'
|
|
185
339
|
${this?.attributes}
|
|
186
340
|
${attributes}
|
|
187
341
|
${{
|
|
188
|
-
class: () => view.active && '--active',
|
|
342
|
+
class: () => [view.active && '--active', view.selected && 'surface-field-surface--selected'],
|
|
189
343
|
'data-surface-field': name,
|
|
190
344
|
onconnect: (el: HTMLElement) => {
|
|
191
345
|
element = el;
|
|
192
346
|
apply();
|
|
193
347
|
},
|
|
348
|
+
onfocus: () => {
|
|
349
|
+
view.selected = true;
|
|
350
|
+
},
|
|
351
|
+
onkeydown: keydown,
|
|
352
|
+
onlostpointercapture: end,
|
|
353
|
+
onpointerdown: begin,
|
|
354
|
+
onpointermove: move,
|
|
355
|
+
onpointerup: release,
|
|
356
|
+
onwindowpointerdown: (event: PointerEvent) => {
|
|
357
|
+
if (!element?.contains(event.target as Node)) {
|
|
358
|
+
view.selected = false;
|
|
359
|
+
}
|
|
360
|
+
},
|
|
194
361
|
style: [
|
|
195
|
-
() =>
|
|
196
|
-
() =>
|
|
362
|
+
() => `--geometry-height: ${view.height}px; --geometry-rotate: ${view.rotation}deg; --geometry-width: ${view.width}px; --geometry-x: ${view.x}px; --geometry-y: ${view.y}px;`,
|
|
363
|
+
() => `--geometry-z-index: ${view.z || 'auto'};`
|
|
197
364
|
]
|
|
198
365
|
}}
|
|
199
366
|
>
|
|
200
367
|
<span aria-hidden='true' class='surface-field-surface-lift'></span>
|
|
201
|
-
<div
|
|
202
|
-
class='surface-field-surface-header'
|
|
203
|
-
${{
|
|
204
|
-
onlostpointercapture: end,
|
|
205
|
-
onpointerdown: (event: PointerEvent) => {
|
|
206
|
-
// A click on an editable title edits it; the rest of the header carries the surface.
|
|
207
|
-
if (!(event.target as Element).closest('.inline-edit')) {
|
|
208
|
-
begin(event, 'move');
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
onpointermove: move
|
|
212
|
-
}}
|
|
213
|
-
>
|
|
368
|
+
<div class='surface-field-surface-content'>
|
|
214
369
|
${title !== undefined && (
|
|
215
370
|
editable
|
|
216
371
|
? inlineEdit({
|
|
217
|
-
class: 'surface-field-surface-title',
|
|
372
|
+
class: 'inline-edit--seamless surface-field-surface-title',
|
|
218
373
|
label: `${called} title`,
|
|
219
374
|
onsave: (value: string) => save('title', value),
|
|
220
375
|
placeholder: 'Untitled',
|
|
@@ -222,18 +377,10 @@ export default component<Surface>(
|
|
|
222
377
|
})
|
|
223
378
|
: html`<span class='surface-field-surface-title'>${title}</span>`
|
|
224
379
|
)}
|
|
225
|
-
<button
|
|
226
|
-
aria-label='${`Move ${called} with arrow keys`}'
|
|
227
|
-
class='surface-field-surface-handle'
|
|
228
|
-
type='button'
|
|
229
|
-
${{ onkeydown: (event: KeyboardEvent) => nudge(event, false) }}
|
|
230
|
-
></button>
|
|
231
|
-
</div>
|
|
232
|
-
<div class='surface-field-surface-content'>
|
|
233
380
|
${body !== undefined && (
|
|
234
381
|
editable
|
|
235
|
-
? inlineEdit({
|
|
236
|
-
class: 'surface-field-surface-body',
|
|
382
|
+
? (rich ? inlineEdit.rich : inlineEdit)({
|
|
383
|
+
class: 'inline-edit--seamless surface-field-surface-body',
|
|
237
384
|
label: `${called} note`,
|
|
238
385
|
multiline: true,
|
|
239
386
|
onsave: (value: string) => save('body', value),
|
|
@@ -244,17 +391,19 @@ export default component<Surface>(
|
|
|
244
391
|
)}
|
|
245
392
|
${content}
|
|
246
393
|
</div>
|
|
247
|
-
|
|
248
|
-
aria-
|
|
249
|
-
class='surface-field-surface-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
394
|
+
${ports && html`
|
|
395
|
+
<span aria-hidden='true' class='surface-field-surface-port surface-field-surface-port--in'></span>
|
|
396
|
+
<span aria-hidden='true' class='surface-field-surface-port surface-field-surface-port--out' data-grip='link'></span>
|
|
397
|
+
`}
|
|
398
|
+
<div aria-hidden='true' class='surface-field-surface-frame'>
|
|
399
|
+
${EDGES.map(([side, sx, sy]) => html`
|
|
400
|
+
<span class='surface-field-surface-edge' data-grip='resize' data-side='${side}' data-sx='${sx}' data-sy='${sy}'></span>
|
|
401
|
+
`)}
|
|
402
|
+
${CORNERS.map(([side, sx, sy]) => html`
|
|
403
|
+
<span class='surface-field-surface-corner' data-grip='resize' data-side='${side}' data-sx='${sx}' data-sy='${sy}'></span>
|
|
404
|
+
`)}
|
|
405
|
+
<span class='surface-field-surface-rotate' data-grip='rotate'></span>
|
|
406
|
+
</div>
|
|
258
407
|
</div>
|
|
259
408
|
`;
|
|
260
409
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { component, html, type Attributes, type Renderable } from '@esportsplus/template';
|
|
2
1
|
import { flush, reactive, ReactiveArray } from '@esportsplus/reactivity';
|
|
2
|
+
import { component, html, type Attributes, type Renderable } from '@esportsplus/template';
|
|
3
3
|
import { finished, measure, slides, timing } from '~/shared/animation';
|
|
4
4
|
import checkbox from '~/components/checkbox';
|
|
5
5
|
import sortable from '~/components/sortable';
|
|
6
|
+
import '~/components/group/scss/index.scss';
|
|
6
7
|
import './scss/index.scss';
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
type A = Attributes & {
|
|
10
11
|
[TASKLIST_CHECKBOX]?: CheckboxAttributes;
|
|
11
|
-
[TASKLIST_CONTENT]?: Attributes;
|
|
12
12
|
[TASKLIST_DESCRIPTION]?: Attributes;
|
|
13
13
|
[TASKLIST_ITEM]?: Attributes;
|
|
14
14
|
[TASKLIST_LABEL]?: Attributes;
|
|
@@ -36,8 +36,6 @@ type Task = {
|
|
|
36
36
|
|
|
37
37
|
const TASKLIST_CHECKBOX = Symbol.for('@esportsplus/ui/tasklist.checkbox');
|
|
38
38
|
|
|
39
|
-
const TASKLIST_CONTENT = Symbol.for('@esportsplus/ui/tasklist.content');
|
|
40
|
-
|
|
41
39
|
const TASKLIST_DESCRIPTION = Symbol.for('@esportsplus/ui/tasklist.description');
|
|
42
40
|
|
|
43
41
|
const TASKLIST_ITEM = Symbol.for('@esportsplus/ui/tasklist.item');
|
|
@@ -200,7 +198,7 @@ export default component(
|
|
|
200
198
|
}
|
|
201
199
|
}}
|
|
202
200
|
>
|
|
203
|
-
<label class='tasklist-row ${sorts && 'tasklist-row--sortable'}' ${context?.[TASKLIST_ROW]} ${attributes[TASKLIST_ROW]}>
|
|
201
|
+
<label class='group group--grid tasklist-row ${sorts && 'tasklist-row--sortable'}' ${context?.[TASKLIST_ROW]} ${attributes[TASKLIST_ROW]}>
|
|
204
202
|
${checkbox.call(
|
|
205
203
|
{ attributes: context?.[TASKLIST_CHECKBOX] },
|
|
206
204
|
{
|
|
@@ -209,15 +207,14 @@ export default component(
|
|
|
209
207
|
[checkbox.input]: { ...box?.[checkbox.input], checked: !!task.checked }
|
|
210
208
|
}
|
|
211
209
|
)}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
<span class='tasklist-label' ${context?.[TASKLIST_LABEL]} ${attributes[TASKLIST_LABEL]}>${task.label}</span>
|
|
215
|
-
${task.description && html`
|
|
216
|
-
<span class='tasklist-description' ${context?.[TASKLIST_DESCRIPTION]} ${attributes[TASKLIST_DESCRIPTION]}>
|
|
217
|
-
${task.description}
|
|
218
|
-
</span>
|
|
219
|
-
`}
|
|
210
|
+
<span class='group-label tasklist-label' ${context?.[TASKLIST_LABEL]} ${attributes[TASKLIST_LABEL]}>
|
|
211
|
+
<span class='tasklist-text'>${task.label}</span>
|
|
220
212
|
</span>
|
|
213
|
+
${task.description && html`
|
|
214
|
+
<small class='group-description tasklist-description' ${context?.[TASKLIST_DESCRIPTION]} ${attributes[TASKLIST_DESCRIPTION]}>
|
|
215
|
+
${task.description}
|
|
216
|
+
</small>
|
|
217
|
+
`}
|
|
221
218
|
</label>
|
|
222
219
|
</li>
|
|
223
220
|
`;
|
|
@@ -241,7 +238,6 @@ export default component(
|
|
|
241
238
|
},
|
|
242
239
|
{
|
|
243
240
|
checkbox: TASKLIST_CHECKBOX,
|
|
244
|
-
content: TASKLIST_CONTENT,
|
|
245
241
|
description: TASKLIST_DESCRIPTION,
|
|
246
242
|
item: TASKLIST_ITEM,
|
|
247
243
|
label: TASKLIST_LABEL,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@use 'css-utilities/reset';
|
|
2
2
|
@use 'variables';
|
|
3
3
|
|
|
4
|
+
// Each row is a 'group--grid', which lays out the checkbox, label and description; the list adds the check's strike,
|
|
5
|
+
// fade and reordering.
|
|
4
6
|
.tasklist {
|
|
5
7
|
@extend %reset-list;
|
|
6
8
|
display: flex;
|
|
@@ -13,7 +15,7 @@
|
|
|
13
15
|
counter-set: tasklist var(--index);
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
&--plan &-
|
|
18
|
+
&--plan &-text::before {
|
|
17
19
|
color: var(--color);
|
|
18
20
|
content: counter(tasklist, decimal-leading-zero);
|
|
19
21
|
font-family: var(--font-family);
|
|
@@ -24,29 +26,14 @@
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
&-
|
|
29
|
-
margin-block-start: calc((var(--line-height) - var(--size)) / 2);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&-content {
|
|
33
|
-
min-width: 0;
|
|
29
|
+
&-description,
|
|
30
|
+
&-label {
|
|
34
31
|
opacity: var(--opacity);
|
|
35
32
|
transition: opacity var(--strike-duration) var(--strike-timing-function) var(--strike-delay);
|
|
36
33
|
}
|
|
37
34
|
|
|
38
|
-
&-description {
|
|
39
|
-
color: var(--color);
|
|
40
|
-
display: block;
|
|
41
|
-
font-size: var(--font-size);
|
|
42
|
-
margin-block-start: calc(var(--size-100) / 4);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
35
|
&-item {
|
|
46
|
-
background: var(--background);
|
|
47
|
-
border-radius: var(--border-radius);
|
|
48
36
|
position: relative;
|
|
49
|
-
transition: background-color var(--transition-duration) var(--transition-timing-function);
|
|
50
37
|
|
|
51
38
|
&--moving {
|
|
52
39
|
z-index: 1;
|
|
@@ -59,39 +46,32 @@
|
|
|
59
46
|
transition-delay: var(--strike-duration);
|
|
60
47
|
}
|
|
61
48
|
|
|
49
|
+
// Block, not the group label's flex, so the text inside stays inline. Qualified by the row so it wins over the
|
|
50
|
+
// group label regardless of stylesheet order.
|
|
51
|
+
&-row > &-label {
|
|
52
|
+
display: block;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Drag grip, shown while the row is hovered. A third column of its own, on the label's line.
|
|
56
|
+
&-row--sortable::after {
|
|
57
|
+
background: var(--background);
|
|
58
|
+
content: '';
|
|
59
|
+
grid-column: 3;
|
|
60
|
+
grid-row: 1;
|
|
61
|
+
height: var(--size);
|
|
62
|
+
mask: url('../../../../storage/svg/grip.svg') center / contain no-repeat;
|
|
63
|
+
opacity: var(--opacity);
|
|
64
|
+
transition: opacity var(--transition-duration) var(--transition-timing-function);
|
|
65
|
+
width: var(--size);
|
|
66
|
+
}
|
|
67
|
+
|
|
62
68
|
// Inline so the strike is drawn once per wrapped line
|
|
63
|
-
&-
|
|
69
|
+
&-text {
|
|
64
70
|
background-image: linear-gradient(var(--strike-color), var(--strike-color));
|
|
65
71
|
background-position: 0 55%;
|
|
66
72
|
background-repeat: no-repeat;
|
|
67
73
|
background-size: var(--strike-length) var(--strike-width);
|
|
68
74
|
box-decoration-break: clone;
|
|
69
|
-
color: var(--color);
|
|
70
|
-
font-weight: var(--font-weight);
|
|
71
75
|
transition: background-size var(--strike-duration) var(--strike-timing-function) var(--strike-delay);
|
|
72
76
|
}
|
|
73
|
-
|
|
74
|
-
&-row {
|
|
75
|
-
align-items: flex-start;
|
|
76
|
-
cursor: pointer;
|
|
77
|
-
display: flex;
|
|
78
|
-
font-size: var(--font-size);
|
|
79
|
-
gap: var(--gap-vertical) var(--gap-horizontal);
|
|
80
|
-
line-height: var(--line-height);
|
|
81
|
-
padding: var(--padding-vertical) var(--padding-horizontal);
|
|
82
|
-
user-select: none;
|
|
83
|
-
|
|
84
|
-
// Drag grip, shown while the row is hovered
|
|
85
|
-
&--sortable::after {
|
|
86
|
-
background: var(--background);
|
|
87
|
-
content: '';
|
|
88
|
-
flex: 0 0 var(--size);
|
|
89
|
-
height: var(--size);
|
|
90
|
-
margin-block-start: calc((var(--line-height) - var(--size)) / 2);
|
|
91
|
-
margin-inline-start: auto;
|
|
92
|
-
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='5' r='1.5'/%3E%3Ccircle cx='9' cy='12' r='1.5'/%3E%3Ccircle cx='9' cy='19' r='1.5'/%3E%3Ccircle cx='15' cy='5' r='1.5'/%3E%3Ccircle cx='15' cy='12' r='1.5'/%3E%3Ccircle cx='15' cy='19' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
93
|
-
opacity: var(--opacity);
|
|
94
|
-
transition: opacity var(--transition-duration) var(--transition-timing-function);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
77
|
}
|