@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
|
@@ -1,290 +1,635 @@
|
|
|
1
1
|
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
|
-
import { flush } from '@esportsplus/reactivity';
|
|
2
|
+
import { effect, flush, onCleanup, read, root, signal, untrack, write } from '@esportsplus/reactivity';
|
|
3
3
|
import * as template_u1 from '@esportsplus/template';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import '
|
|
4
|
+
import { component, render } from '@esportsplus/template';
|
|
5
|
+
import icon from '../icon/index.js';
|
|
6
|
+
import tooltip from '../tooltip/index.js';
|
|
7
|
+
import { mac } from '../../shared/platform.js';
|
|
8
|
+
import { observe } from '../../shared/resize.js';
|
|
9
|
+
import { group, launcher, title } from './group.js';
|
|
10
|
+
import state, { allGroups, bounded, contains, docked, findGroup, findSplit, findSurfaceGroup, MIN_FRACTION, stationary } from './model.js';
|
|
11
|
+
import { resized, separator } from './resize.js';
|
|
12
|
+
import { frame, grip, resizer, sidebar, toggle } from './sidebar.js';
|
|
13
|
+
import subtree from './subtree.js';
|
|
8
14
|
import './scss/index.scss';
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
15
|
+
const template_1dhwcf34 = template_u1.template(`<!--$--><!--$-->`);
|
|
16
|
+
const template_1dhwcf37 = template_u1.template(`<div aria-hidden='true' class='shell-dock-target shell-dock-target--bottom' data-placement='bottom'>`, true);
|
|
17
|
+
const template_1dhwcf38 = template_u1.template(`<div aria-hidden='true' class='shell-dock-target shell-dock-target--left' data-placement='left'>`, true);
|
|
18
|
+
const template_1dhwcf39 = template_u1.template(`<div aria-hidden='true' class='shell-dock-target shell-dock-target--right' data-placement='right'>`, true);
|
|
19
|
+
const template_1dhwcf3b = template_u1.template(`<div aria-hidden='true'>`, true);
|
|
20
|
+
const template_1dhwcf3d = template_u1.template(`<div>`, true);
|
|
21
|
+
const template_1dhwcf3g = template_u1.template(`<div></div><!--$-->`);
|
|
22
|
+
const template_1dhwcf3k = template_u1.template(`<div class='shell-frame'><!--$--><div class='shell-center'><div class='shell-main'></div></div></div><!--$-->`);
|
|
23
|
+
const template_1dhwcf3r = template_u1.template(`<!--$--><!--$--><!--$--><!--$-->`);
|
|
24
|
+
const template_1dhwcf3x = template_u1.template(`<!--$--><div>`);
|
|
25
|
+
const template_1dhwcf311 = template_u1.template(`<div><div></div><!--$--><!--$-->`, true);
|
|
12
26
|
class ReactiveObject_1dhwcf30 extends reactivity_u0.ReactiveObject {
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
#reach;
|
|
17
|
-
#space;
|
|
18
|
-
#translate;
|
|
19
|
-
constructor(_p0, _p1, _p2, _p3) {
|
|
27
|
+
#height = this[reactivity_u0.SIGNAL](0);
|
|
28
|
+
#width = this[reactivity_u0.SIGNAL](0);
|
|
29
|
+
constructor() {
|
|
20
30
|
super(null);
|
|
21
|
-
this.#gap = this[reactivity_u0.SIGNAL](_p0);
|
|
22
|
-
this.#reach = this[reactivity_u0.SIGNAL](_p1);
|
|
23
|
-
this.#space = this[reactivity_u0.SIGNAL](_p2);
|
|
24
|
-
this.#translate = this[reactivity_u0.SIGNAL](_p3);
|
|
25
31
|
}
|
|
26
|
-
get
|
|
27
|
-
return reactivity_u0.read(this.#
|
|
32
|
+
get height() {
|
|
33
|
+
return reactivity_u0.read(this.#height);
|
|
28
34
|
}
|
|
29
|
-
set
|
|
30
|
-
reactivity_u0.write(this.#
|
|
35
|
+
set height(_v0) {
|
|
36
|
+
reactivity_u0.write(this.#height, _v0);
|
|
31
37
|
}
|
|
32
|
-
get
|
|
33
|
-
return reactivity_u0.read(this.#
|
|
38
|
+
get width() {
|
|
39
|
+
return reactivity_u0.read(this.#width);
|
|
34
40
|
}
|
|
35
|
-
set
|
|
36
|
-
reactivity_u0.write(this.#
|
|
41
|
+
set width(_v1) {
|
|
42
|
+
reactivity_u0.write(this.#width, _v1);
|
|
37
43
|
}
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
}
|
|
45
|
+
class ReactiveObject_1dhwcf31 extends reactivity_u0.ReactiveObject {
|
|
46
|
+
#group = this[reactivity_u0.SIGNAL]('');
|
|
47
|
+
#surface = this[reactivity_u0.SIGNAL]('');
|
|
48
|
+
constructor() {
|
|
49
|
+
super(null);
|
|
40
50
|
}
|
|
41
|
-
|
|
42
|
-
reactivity_u0.
|
|
51
|
+
get group() {
|
|
52
|
+
return reactivity_u0.read(this.#group);
|
|
43
53
|
}
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
set group(_v0) {
|
|
55
|
+
reactivity_u0.write(this.#group, _v0);
|
|
46
56
|
}
|
|
47
|
-
|
|
48
|
-
reactivity_u0.
|
|
57
|
+
get surface() {
|
|
58
|
+
return reactivity_u0.read(this.#surface);
|
|
49
59
|
}
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
set surface(_v1) {
|
|
61
|
+
reactivity_u0.write(this.#surface, _v1);
|
|
52
62
|
}
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
}
|
|
64
|
+
class ReactiveObject_1dhwcf32 extends reactivity_u0.ReactiveObject {
|
|
65
|
+
#length = this[reactivity_u0.SIGNAL](0);
|
|
66
|
+
constructor() {
|
|
67
|
+
super(null);
|
|
55
68
|
}
|
|
56
|
-
get
|
|
57
|
-
return reactivity_u0.read(this.#
|
|
69
|
+
get length() {
|
|
70
|
+
return reactivity_u0.read(this.#length);
|
|
58
71
|
}
|
|
59
|
-
set
|
|
60
|
-
reactivity_u0.write(this.#
|
|
72
|
+
set length(_v0) {
|
|
73
|
+
reactivity_u0.write(this.#length, _v0);
|
|
61
74
|
}
|
|
62
75
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
const COLLAPSED = 80;
|
|
77
|
+
const NARROW = 1024;
|
|
78
|
+
const EDGES = {
|
|
79
|
+
bottom: ['column', 'after'],
|
|
80
|
+
left: ['row', 'before'],
|
|
81
|
+
right: ['row', 'after'],
|
|
82
|
+
top: ['column', 'before']
|
|
83
|
+
};
|
|
84
|
+
function corner(node, edge) {
|
|
85
|
+
if (node === null || node.kind === 'group') {
|
|
86
|
+
return node;
|
|
70
87
|
}
|
|
71
|
-
|
|
72
|
-
|
|
88
|
+
return corner((edge === 'right' && node.direction === 'row' ? node.children.at(-1) : node.children[0]) ?? null, edge);
|
|
89
|
+
}
|
|
90
|
+
function filter(node, keep) {
|
|
91
|
+
if (node === null) {
|
|
92
|
+
return null;
|
|
73
93
|
}
|
|
74
|
-
|
|
75
|
-
|
|
94
|
+
if (node.kind === 'group') {
|
|
95
|
+
return keep(node) ? node : null;
|
|
76
96
|
}
|
|
77
|
-
|
|
78
|
-
|
|
97
|
+
let entries = node.children.flatMap((child, i) => {
|
|
98
|
+
let kept = filter(child, keep);
|
|
99
|
+
return kept === null ? [] : [{ node: kept, size: node.sizes[i] ?? 0 }];
|
|
100
|
+
});
|
|
101
|
+
if (entries.length === 0) {
|
|
102
|
+
return null;
|
|
79
103
|
}
|
|
80
|
-
|
|
81
|
-
|
|
104
|
+
if (entries.length === 1) {
|
|
105
|
+
return entries[0].node;
|
|
82
106
|
}
|
|
107
|
+
let total = entries.reduce((sum, entry) => sum + entry.size, 0);
|
|
108
|
+
return {
|
|
109
|
+
...node,
|
|
110
|
+
children: entries.map((entry) => entry.node),
|
|
111
|
+
sizes: entries.map((entry) => total > 0 ? entry.size / total : 1 / entries.length)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function findSurface(node, id) {
|
|
115
|
+
return findSurfaceGroup(node, id)?.surfaces.find((surface) => surface.id === id) ?? null;
|
|
83
116
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
117
|
+
function mounted(layout) {
|
|
118
|
+
let ids = new Set();
|
|
119
|
+
for (let group of Object.values(shown(layout)).flatMap(allGroups)) {
|
|
120
|
+
if (group.active !== null) {
|
|
121
|
+
ids.add(group.active);
|
|
122
|
+
}
|
|
89
123
|
}
|
|
90
|
-
|
|
124
|
+
return ids;
|
|
91
125
|
}
|
|
92
|
-
function
|
|
93
|
-
|
|
126
|
+
function shown(layout) {
|
|
127
|
+
let zoom = layout.zoom.at(-1);
|
|
128
|
+
if (zoom) {
|
|
129
|
+
let ids = new Set(zoom.groups);
|
|
130
|
+
return { bottom: null, left: null, main: filter(layout.root, (group) => ids.has(group.id)), right: null };
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
bottom: layout.bottom.open ? filter(layout.root, (group) => docked(group, 'bottom')) : null,
|
|
134
|
+
left: filter(layout.root, (group) => docked(group, 'left')),
|
|
135
|
+
main: filter(layout.root, (group) => group.placement === undefined),
|
|
136
|
+
right: filter(layout.root, (group) => docked(group, 'right'))
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function structure(node) {
|
|
140
|
+
if (node === null) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
if (node.kind === 'group') {
|
|
144
|
+
return [node.id, node.placement ?? '', node.surfaces.map((surface) => surface.id)];
|
|
145
|
+
}
|
|
146
|
+
return [node.id, node.direction, node.children.map(structure)];
|
|
94
147
|
}
|
|
95
|
-
function
|
|
96
|
-
let
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
148
|
+
function target(workspace, x, y) {
|
|
149
|
+
let elements = document.elementsFromPoint(x, y).filter((element) => element.closest('.shell') === workspace), dock = elements.find((element) => element.matches('.shell-dock-target')), section = elements.find((element) => element.matches('.shell-group'));
|
|
150
|
+
if (dock) {
|
|
151
|
+
return dock;
|
|
152
|
+
}
|
|
153
|
+
if (!section || y <= (section.querySelector(':scope > .shell-header')?.getBoundingClientRect().bottom ?? -Infinity)) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
let { height, left, top, width } = section.getBoundingClientRect(), across = width <= 0 ? 0.5 : (x - left) / width, down = height <= 0 ? 0.5 : (y - top) / height, side = [['left', across], ['right', 1 - across], ['top', down], ['bottom', 1 - down]]
|
|
157
|
+
.reduce((nearest, candidate) => candidate[1] < nearest[1] ? candidate : nearest)[0];
|
|
158
|
+
return section.querySelector(`:scope > .shell-edge--${side}`);
|
|
159
|
+
}
|
|
160
|
+
function under(workspace, x, y) {
|
|
161
|
+
let found = document.elementsFromPoint(x, y).find((element) => element.matches('.shell-group') && element.closest('.shell') === workspace);
|
|
162
|
+
return found?.dataset.group;
|
|
163
|
+
}
|
|
164
|
+
const shell = component(function ({ catalog, empty, icons = false, narrow: breakpoint = NARROW, sidebars: options = {}, state, ...attributes }) {
|
|
165
|
+
let adding, apple = mac(), carrying = signal(false), controller, frames = { left: frame(), right: frame() }, hosts = new Map(), landing = null, parking, picks = signal([]), regions = {}, size = new ReactiveObject_1dhwcf30(), slots = new Map(), strips = new WeakMap(), subject = new ReactiveObject_1dhwcf31(), switching, unobserve, workspace;
|
|
166
|
+
let narrow = () => size.width > 0 && size.width <= breakpoint;
|
|
167
|
+
let edges = {
|
|
168
|
+
frames,
|
|
169
|
+
id: `shell-${crypto.randomUUID().slice(0, 8)}`,
|
|
170
|
+
narrow,
|
|
171
|
+
options,
|
|
172
|
+
stationary: (edge) => stationary(state.layout.root, edge),
|
|
173
|
+
state
|
|
174
|
+
};
|
|
175
|
+
function drop(surface, element) {
|
|
176
|
+
let placement = element.dataset.placement;
|
|
177
|
+
if (placement) {
|
|
178
|
+
state.dock(surface.id, placement);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
let group = element.closest('.shell-group')?.dataset.group, [direction, side] = EDGES[element.dataset.side];
|
|
182
|
+
if (group) {
|
|
183
|
+
state.split(surface.id, group, direction, side);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
let context = {
|
|
187
|
+
add(kind, group) {
|
|
188
|
+
let entry = catalog[kind];
|
|
189
|
+
if (!entry) {
|
|
190
|
+
return;
|
|
104
191
|
}
|
|
192
|
+
let id = kind;
|
|
193
|
+
if (entry.multiple) {
|
|
194
|
+
let taken = new Set(allGroups(state.layout.root).flatMap((group) => group.surfaces.map((surface) => surface.id))), n = 1;
|
|
195
|
+
while (taken.has(id = `${kind}-${n}`)) {
|
|
196
|
+
n++;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
state.open({ id, kind }, group);
|
|
200
|
+
},
|
|
201
|
+
addable: Object.entries(catalog).filter(([, entry]) => entry.addable !== false),
|
|
202
|
+
catalog,
|
|
203
|
+
choose(e, group) {
|
|
204
|
+
if (!adding) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
let { bottom, left } = e.currentTarget.getBoundingClientRect();
|
|
208
|
+
subject.group = group;
|
|
209
|
+
flush();
|
|
210
|
+
adding.open({ x: left, y: bottom });
|
|
211
|
+
},
|
|
212
|
+
empty,
|
|
213
|
+
held: (e) => apple ? e.metaKey : e.ctrlKey,
|
|
214
|
+
icons,
|
|
215
|
+
inset(group, edge) {
|
|
216
|
+
let layout = state.layout, trees = shown(layout);
|
|
217
|
+
return trees[edge] !== null && (group === corner(trees[edge], edge)?.id || (group === corner(trees.main, edge)?.id && !layout[edge].open));
|
|
218
|
+
},
|
|
219
|
+
menu(e, group, surface) {
|
|
220
|
+
if (!controller) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
subject.group = group;
|
|
225
|
+
subject.surface = surface;
|
|
226
|
+
flush();
|
|
227
|
+
controller.open(e.button === 2 ? { x: e.clientX, y: e.clientY } : undefined);
|
|
105
228
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
229
|
+
pick(group) {
|
|
230
|
+
let current = read(picks);
|
|
231
|
+
write(picks, current.includes(group) ? current.filter((id) => id !== group) : [...current, group]);
|
|
232
|
+
},
|
|
233
|
+
picked: (group) => read(picks).includes(group),
|
|
234
|
+
slot: (surface) => {
|
|
235
|
+
let root_1dhwcf3c = template_1dhwcf3d();
|
|
236
|
+
template_u1.onconnect(root_1dhwcf3c, (element) => {
|
|
237
|
+
slots.set(surface, element);
|
|
238
|
+
attach(surface, element);
|
|
239
|
+
});
|
|
240
|
+
template_u1.ondisconnect(root_1dhwcf3c, () => {
|
|
241
|
+
if (slots.get(surface)?.isConnected === false) {
|
|
242
|
+
slots.delete(surface);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
template_u1.setClass(root_1dhwcf3c, ["shell-slot"]);
|
|
246
|
+
return root_1dhwcf3c;
|
|
247
|
+
},
|
|
248
|
+
sorting(strip, group) {
|
|
249
|
+
strips.set(strip, group);
|
|
250
|
+
return {
|
|
251
|
+
disabled: (surface) => surface.sortable === false,
|
|
252
|
+
group: edges.id,
|
|
253
|
+
onland: () => {
|
|
254
|
+
let land = landing;
|
|
255
|
+
landing = null;
|
|
256
|
+
write(carrying, false);
|
|
257
|
+
land?.();
|
|
258
|
+
},
|
|
259
|
+
onlift: () => write(carrying, true),
|
|
260
|
+
onsort: (surface, _, to, __, target) => {
|
|
261
|
+
let group = strips.get(target);
|
|
262
|
+
landing = group ? () => state.move(surface.id, group, to) : null;
|
|
263
|
+
},
|
|
264
|
+
outside: {
|
|
265
|
+
ondrop: (surface, element) => {
|
|
266
|
+
landing = () => drop(surface, element);
|
|
267
|
+
},
|
|
268
|
+
over: (_, x, y) => workspace ? target(workspace, x, y) : null
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
},
|
|
272
|
+
state,
|
|
273
|
+
sweep(e, group) {
|
|
274
|
+
let swept = [group];
|
|
275
|
+
function end(event) {
|
|
276
|
+
document.documentElement.classList.remove('shell-sweeping');
|
|
277
|
+
window.removeEventListener('pointercancel', end);
|
|
278
|
+
window.removeEventListener('pointermove', move);
|
|
279
|
+
window.removeEventListener('pointerup', end);
|
|
280
|
+
if (swept.length < 2) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
let swallow = (click) => {
|
|
284
|
+
click.preventDefault();
|
|
285
|
+
click.stopPropagation();
|
|
286
|
+
};
|
|
287
|
+
window.addEventListener('click', swallow, { capture: true, once: true });
|
|
288
|
+
setTimeout(() => window.removeEventListener('click', swallow, { capture: true }));
|
|
289
|
+
if (event.type === 'pointerup') {
|
|
290
|
+
let chosen = read(picks);
|
|
291
|
+
write(picks, []);
|
|
292
|
+
state.zoom(chosen);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function move(event) {
|
|
296
|
+
let id = workspace && under(workspace, event.clientX, event.clientY);
|
|
297
|
+
if (!id || swept.includes(id)) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
swept.push(id);
|
|
301
|
+
write(picks, [...new Set([...read(picks), ...swept])]);
|
|
302
|
+
}
|
|
303
|
+
if (e.button !== 0) {
|
|
304
|
+
return;
|
|
110
305
|
}
|
|
306
|
+
document.documentElement.classList.add('shell-sweeping');
|
|
307
|
+
window.addEventListener('pointercancel', end);
|
|
308
|
+
window.addEventListener('pointermove', move);
|
|
309
|
+
window.addEventListener('pointerup', end);
|
|
310
|
+
},
|
|
311
|
+
switcher(e) {
|
|
312
|
+
let { bottom, left } = e.currentTarget.getBoundingClientRect();
|
|
313
|
+
switching?.open({ x: left, y: bottom });
|
|
314
|
+
},
|
|
315
|
+
switches: () => allGroups(shown(state.layout).main).length > 1
|
|
316
|
+
};
|
|
317
|
+
function attach(surface, slot) {
|
|
318
|
+
let host = hosts.get(surface);
|
|
319
|
+
if (!host) {
|
|
320
|
+
return;
|
|
111
321
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
322
|
+
if (!slot.isConnected) {
|
|
323
|
+
queueMicrotask(() => slot.isConnected && attach(surface, slot));
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
move(host.element, slot);
|
|
327
|
+
}
|
|
328
|
+
function ensure(surface) {
|
|
329
|
+
if (hosts.has(surface)) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
let found = findSurface(state.layout.root, surface), kind = found && catalog[found.kind];
|
|
333
|
+
if (!found || !kind) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
let element = document.createElement('div'), entry = found, release = untrack(() => root(() => render(element, { class: 'shell-host', 'data-surface': surface }, () => kind.render(entry))));
|
|
337
|
+
hosts.set(surface, { dispose: release, element });
|
|
338
|
+
}
|
|
339
|
+
function move(element, target) {
|
|
340
|
+
if (element.parentElement === target) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if ('moveBefore' in target && element.isConnected && target.isConnected) {
|
|
344
|
+
target.moveBefore(element, null);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
let focused = document.activeElement;
|
|
348
|
+
target.append(element);
|
|
349
|
+
if (focused instanceof HTMLElement && element.contains(focused)) {
|
|
350
|
+
focused.focus({ preventScroll: true });
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function node(current) {
|
|
354
|
+
if (current.kind === 'group') {
|
|
355
|
+
let id = current.id;
|
|
356
|
+
return group(context, () => {
|
|
357
|
+
let layout = state.layout;
|
|
358
|
+
return { group: findGroup(layout.root, id) ?? current, layout };
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
return split(current);
|
|
362
|
+
}
|
|
363
|
+
function open(edge) {
|
|
364
|
+
let layout = state.layout;
|
|
365
|
+
return layout.zoom.length === 0 && layout[edge].open && allGroups(layout.root).some((group) => docked(group, edge));
|
|
366
|
+
}
|
|
367
|
+
function park(within) {
|
|
368
|
+
if (!parking) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
for (let host of hosts.values()) {
|
|
372
|
+
if (!within || within.contains(host.element)) {
|
|
373
|
+
move(host.element, parking);
|
|
120
374
|
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function region(name) {
|
|
378
|
+
let last = '';
|
|
379
|
+
return subtree(() => {
|
|
380
|
+
let key = JSON.stringify(structure(shown(state.layout)[name]));
|
|
381
|
+
if (key !== last && last !== '' && regions[name]) {
|
|
382
|
+
park(regions[name]);
|
|
383
|
+
}
|
|
384
|
+
last = key;
|
|
385
|
+
return key;
|
|
386
|
+
}, () => {
|
|
387
|
+
let tree = shown(state.layout)[name];
|
|
388
|
+
if (name !== 'main') {
|
|
389
|
+
return tree ? node(tree) : '';
|
|
390
|
+
}
|
|
391
|
+
return tree ? (() => {
|
|
392
|
+
let root_1dhwcf33 = template_1dhwcf34(), element_1dhwcf35 = root_1dhwcf33.firstChild, element_1dhwcf36 = element_1dhwcf35.nextSibling;
|
|
393
|
+
template_u1.slot(element_1dhwcf35, node(tree));
|
|
394
|
+
template_u1.slot(element_1dhwcf36, switcher(tree));
|
|
395
|
+
return root_1dhwcf33;
|
|
396
|
+
})() : launcher(context);
|
|
397
|
+
}, {
|
|
398
|
+
onconnect: (element) => {
|
|
399
|
+
regions[name] = element;
|
|
128
400
|
}
|
|
129
401
|
});
|
|
130
|
-
template_u1.direct(root_1dhwcf32, 'pointerleave', (e) => leave(side, peeking, frame, edge, e));
|
|
131
|
-
template_u1.delegate(root_1dhwcf32, 'pointermove', function (e) {
|
|
132
|
-
let bounds = this.getBoundingClientRect();
|
|
133
|
-
frame[edge].offset = e.clientY - bounds.top - bounds.height / 2;
|
|
134
|
-
gesture.onpointermove(e);
|
|
135
|
-
});
|
|
136
|
-
template_u1.setClass(root_1dhwcf32, ["shell-edge", "shell-edge--" + (edge)]);
|
|
137
|
-
template_u1.setStyle(root_1dhwcf32, ["", () => `--offset: ${frame[edge].offset}px;`]);
|
|
138
|
-
return root_1dhwcf32;
|
|
139
402
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
403
|
+
function split(current) {
|
|
404
|
+
let axis = current.direction === 'row' ? 'x' : 'y', box = new ReactiveObject_1dhwcf32(), unobserve;
|
|
405
|
+
function sizes() {
|
|
406
|
+
for (let tree of Object.values(shown(state.layout))) {
|
|
407
|
+
let found = findSplit(tree, current.id);
|
|
408
|
+
if (found) {
|
|
409
|
+
return found.sizes;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return current.sizes;
|
|
413
|
+
}
|
|
414
|
+
{
|
|
415
|
+
let root_1dhwcf3e = template_1dhwcf3d();
|
|
416
|
+
template_u1.slot(root_1dhwcf3e, current.children.map((child, index) => {
|
|
417
|
+
let root_1dhwcf3f = template_1dhwcf3g(), element_1dhwcf3h = root_1dhwcf3f.firstChild, element_1dhwcf3i = element_1dhwcf3h.nextSibling;
|
|
418
|
+
template_u1.slot(element_1dhwcf3h, node(child), 1);
|
|
419
|
+
template_u1.slot(element_1dhwcf3i, index < current.children.length - 1 && separator(axis, () => {
|
|
420
|
+
let from = sizes(), length = box.length;
|
|
421
|
+
return (delta) => state.resize(current.id, resized(from, index, delta, length, MIN_FRACTION), current.children.map((child) => child.id));
|
|
422
|
+
}));
|
|
423
|
+
template_u1.setClass(element_1dhwcf3h, ["shell-pane", () => state.layout.main !== null && contains(child, state.layout.main) && 'shell-pane--current']);
|
|
424
|
+
template_u1.setStyle(element_1dhwcf3h, ["", () => {
|
|
425
|
+
let maximized = state.layout.maximized;
|
|
426
|
+
if (maximized === null || !contains(current, maximized)) {
|
|
427
|
+
return `--flex: 0 0 ${(sizes()[index] ?? 0) * 100}%;`;
|
|
428
|
+
}
|
|
429
|
+
return contains(current.children[index], maximized)
|
|
430
|
+
? `--flex: 0 0 calc(100% - ${(current.children.length - 1) * COLLAPSED}px);`
|
|
431
|
+
: `--flex: 0 0 ${COLLAPSED}px;`;
|
|
432
|
+
}]);
|
|
433
|
+
return root_1dhwcf3f;
|
|
434
|
+
}), 1);
|
|
435
|
+
template_u1.onconnect(root_1dhwcf3e, (element) => {
|
|
436
|
+
unobserve = observe(element, ([entry]) => {
|
|
437
|
+
box.length = axis === 'x' ? entry.contentRect.width : entry.contentRect.height;
|
|
438
|
+
});
|
|
439
|
+
});
|
|
440
|
+
template_u1.ondisconnect(root_1dhwcf3e, () => unobserve?.());
|
|
441
|
+
template_u1.setClass(root_1dhwcf3e, ["shell-split", "shell-split--" + (current.direction)]);
|
|
442
|
+
return root_1dhwcf3e;
|
|
443
|
+
}
|
|
149
444
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
445
|
+
function switcher(main) {
|
|
446
|
+
let groups = allGroups(main);
|
|
447
|
+
return groups.length > 1 && tooltip.context({
|
|
448
|
+
class: 'shell-menu',
|
|
449
|
+
controller: (value) => {
|
|
450
|
+
switching = value;
|
|
451
|
+
},
|
|
452
|
+
items: groups.map((entry) => ({
|
|
453
|
+
label: () => {
|
|
454
|
+
let found = findGroup(state.layout.root, entry.id), surface = found?.surfaces.find((item) => item.id === found.active);
|
|
455
|
+
return surface ? title(context, surface) : 'Empty group';
|
|
456
|
+
},
|
|
457
|
+
onselect: () => state.focus(entry.id)
|
|
458
|
+
})),
|
|
459
|
+
[tooltip.context.panel]: { 'aria-label': 'Switch group' }
|
|
460
|
+
}, '');
|
|
158
461
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
462
|
+
function sync(layout, attaching) {
|
|
463
|
+
let shown = mounted(layout);
|
|
464
|
+
for (let [surface, host] of hosts) {
|
|
465
|
+
if (findSurface(layout.root, surface)) {
|
|
466
|
+
if (!shown.has(surface) && parking) {
|
|
467
|
+
move(host.element, parking);
|
|
468
|
+
}
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
471
|
+
host.dispose();
|
|
472
|
+
host.element.remove();
|
|
473
|
+
hosts.delete(surface);
|
|
474
|
+
slots.delete(surface);
|
|
475
|
+
}
|
|
476
|
+
for (let surface of shown) {
|
|
477
|
+
ensure(surface);
|
|
478
|
+
let slot = slots.get(surface);
|
|
479
|
+
if (attaching && slot) {
|
|
480
|
+
attach(surface, slot);
|
|
171
481
|
}
|
|
172
|
-
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function targets() {
|
|
485
|
+
return ['bottom', 'left', 'right']
|
|
486
|
+
.filter((placement) => placement === 'bottom' || !stationary(state.layout.root, placement))
|
|
487
|
+
.map((placement) => (placement === "bottom" ? template_1dhwcf37() : placement === "left" ? template_1dhwcf38() : placement === "right" ? template_1dhwcf39() : (() => {
|
|
488
|
+
let root_1dhwcf3a = template_1dhwcf3b();
|
|
489
|
+
template_u1.setProperty(root_1dhwcf3a, 'data-placement', placement);
|
|
490
|
+
template_u1.setClass(root_1dhwcf3a, ["shell-dock-target", "shell-dock-target--" + (placement)]);
|
|
491
|
+
return root_1dhwcf3a;
|
|
492
|
+
})()));
|
|
493
|
+
}
|
|
494
|
+
function tree() {
|
|
495
|
+
let trees = shown(state.layout);
|
|
496
|
+
{
|
|
497
|
+
let root_1dhwcf3j = template_1dhwcf3k(), element_1dhwcf3l = root_1dhwcf3j.firstChild, element_1dhwcf3m = element_1dhwcf3l.firstChild, element_1dhwcf3n = element_1dhwcf3l.firstElementChild.firstElementChild, element_1dhwcf3o = element_1dhwcf3l.firstElementChild, element_1dhwcf3p = element_1dhwcf3l.nextSibling;
|
|
498
|
+
template_u1.slot(element_1dhwcf3m, ['left', 'right'].map((edge) => (trees[edge] || options[edge]) && (() => {
|
|
499
|
+
let root_1dhwcf3q = template_1dhwcf3r(), element_1dhwcf3s = root_1dhwcf3q.firstChild, element_1dhwcf3t = element_1dhwcf3s.nextSibling, element_1dhwcf3u = element_1dhwcf3t.nextSibling, element_1dhwcf3v = element_1dhwcf3u.nextSibling;
|
|
500
|
+
template_u1.slot(element_1dhwcf3s, sidebar(edges, edge, region(edge)));
|
|
501
|
+
template_u1.slot(element_1dhwcf3t, grip(edges, edge));
|
|
502
|
+
template_u1.slot(element_1dhwcf3u, options[edge]?.resizable && resizer(edges, edge));
|
|
503
|
+
template_u1.slot(element_1dhwcf3v, toggle(edges, edge));
|
|
504
|
+
return root_1dhwcf3q;
|
|
505
|
+
})()));
|
|
506
|
+
template_u1.slot(element_1dhwcf3n, region('main'), 1);
|
|
507
|
+
template_u1.slot(element_1dhwcf3o, trees.bottom && (() => {
|
|
508
|
+
let root_1dhwcf3w = template_1dhwcf3x(), element_1dhwcf3y = root_1dhwcf3w.firstChild, element_1dhwcf3z = element_1dhwcf3y.nextSibling;
|
|
509
|
+
template_u1.slot(element_1dhwcf3y, separator('y', () => {
|
|
510
|
+
let share = bounded(state.layout.bottom.size), length = size.height;
|
|
511
|
+
return (delta) => state.resizeDock('bottom', resized([1 - share, share], 0, delta, length, MIN_FRACTION)[1]);
|
|
512
|
+
}, { hidden: () => state.layout.bottom.maximized }));
|
|
513
|
+
template_u1.slot(element_1dhwcf3z, region('bottom'), 1);
|
|
514
|
+
template_u1.setClass(element_1dhwcf3z, ["shell-dock", () => state.layout.bottom.maximized && 'shell-dock--maximized']);
|
|
515
|
+
template_u1.setStyle(element_1dhwcf3z, ["", () => `--flex: 0 0 ${bounded(state.layout.bottom.size) * 100}%;`]);
|
|
516
|
+
return root_1dhwcf3w;
|
|
517
|
+
})(), 1);
|
|
518
|
+
template_u1.slot(element_1dhwcf3p, targets());
|
|
519
|
+
return root_1dhwcf3j;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
let kind = () => findSurface(state.layout.root, subject.surface)?.kind ?? '', own = () => !!catalog[kind()]?.menu, items = [
|
|
523
|
+
{ hidden: own, label: 'Close', onselect: () => void state.close(subject.surface) },
|
|
524
|
+
{
|
|
525
|
+
hidden: () => own() || (findGroup(state.layout.root, subject.group)?.surfaces.length ?? 0) <= 1,
|
|
526
|
+
label: 'Close Others',
|
|
527
|
+
onselect: () => void state.closeOthers(subject.group, subject.surface)
|
|
173
528
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
529
|
+
{
|
|
530
|
+
hidden: () => {
|
|
531
|
+
let surfaces = findGroup(state.layout.root, subject.group)?.surfaces ?? [];
|
|
532
|
+
return own() || surfaces.findIndex((surface) => surface.id === subject.surface) >= surfaces.length - 1;
|
|
533
|
+
},
|
|
534
|
+
label: 'Close to the Right',
|
|
535
|
+
onselect: () => void state.closeRight(subject.group, subject.surface)
|
|
177
536
|
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
537
|
+
{ hidden: own, label: 'Close All', onselect: () => void state.closeGroup(subject.group) },
|
|
538
|
+
...Object.entries(catalog).flatMap(([name, entry]) => (entry.menu?.(() => subject.surface) ?? []).map((item) => ({
|
|
539
|
+
...item,
|
|
540
|
+
hidden: () => kind() !== name || (typeof item.hidden === 'function' ? !!item.hidden() : !!item.hidden)
|
|
541
|
+
})))
|
|
542
|
+
], last = '';
|
|
543
|
+
onCleanup(() => {
|
|
544
|
+
for (let host of hosts.values()) {
|
|
545
|
+
host.dispose();
|
|
183
546
|
}
|
|
547
|
+
hosts.clear();
|
|
548
|
+
slots.clear();
|
|
184
549
|
});
|
|
185
|
-
|
|
186
|
-
if (
|
|
187
|
-
|
|
550
|
+
effect(() => {
|
|
551
|
+
if (narrow() && state.layout.left.open && state.layout.right.open) {
|
|
552
|
+
untrack(() => state.toggle('right', false));
|
|
188
553
|
}
|
|
189
|
-
|
|
190
|
-
close(side);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
554
|
+
});
|
|
193
555
|
{
|
|
194
|
-
let
|
|
195
|
-
template_u1.slot(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
556
|
+
let root_1dhwcf310 = template_1dhwcf311(), element_1dhwcf312 = root_1dhwcf310.firstElementChild, element_1dhwcf313 = root_1dhwcf310.firstChild.nextSibling, element_1dhwcf314 = element_1dhwcf313.nextSibling;
|
|
557
|
+
template_u1.slot(element_1dhwcf313, subtree(() => {
|
|
558
|
+
let layout = state.layout, trees = shown(layout), key = JSON.stringify([layout.bottom.open, layout.zoom.at(-1)?.groups ?? null, ...Object.values(trees).map((tree) => tree !== null)]), changed = key !== last;
|
|
559
|
+
if (changed) {
|
|
560
|
+
park();
|
|
561
|
+
}
|
|
562
|
+
sync(layout, !changed);
|
|
563
|
+
last = key;
|
|
564
|
+
return key;
|
|
565
|
+
}, tree, { class: 'shell-tree' }));
|
|
566
|
+
template_u1.slot(element_1dhwcf314, tooltip.context({
|
|
567
|
+
class: 'shell-menu',
|
|
568
|
+
controller: (value) => {
|
|
569
|
+
adding = value;
|
|
570
|
+
},
|
|
571
|
+
items: context.addable.map(([kind, entry]) => ({
|
|
572
|
+
...(entry.icon ? { icon: () => icon({ 'aria-hidden': 'true' }, entry.icon) } : {}),
|
|
573
|
+
label: typeof entry.title === 'function' ? entry.title({ id: '', kind }) : entry.title,
|
|
574
|
+
onselect: () => context.add(kind, subject.group)
|
|
575
|
+
})),
|
|
576
|
+
[tooltip.context.panel]: { 'aria-label': 'Add panel' }
|
|
577
|
+
}, ''));
|
|
578
|
+
template_u1.slot(root_1dhwcf310, tooltip.context({
|
|
579
|
+
class: 'shell-menu',
|
|
580
|
+
controller: (value) => {
|
|
581
|
+
controller = value;
|
|
582
|
+
},
|
|
583
|
+
items,
|
|
584
|
+
[tooltip.context.panel]: { 'aria-label': 'Tab actions' }
|
|
585
|
+
}, ''), 1);
|
|
586
|
+
template_u1.onconnect(element_1dhwcf312, (element) => {
|
|
587
|
+
parking = element;
|
|
588
|
+
});
|
|
589
|
+
template_u1.setClass(element_1dhwcf312, ["shell-parking"]);
|
|
590
|
+
let attributes_1dhwcf315 = attributes;
|
|
591
|
+
template_u1.setProperties(root_1dhwcf310, attributes_1dhwcf315, true);
|
|
592
|
+
template_u1.onconnect(root_1dhwcf310, (element) => {
|
|
593
|
+
workspace = element;
|
|
594
|
+
unobserve = observe(element, ([entry]) => {
|
|
595
|
+
size.height = entry.contentRect.height;
|
|
596
|
+
size.width = entry.contentRect.width;
|
|
597
|
+
});
|
|
207
598
|
});
|
|
208
|
-
template_u1.
|
|
209
|
-
|
|
599
|
+
template_u1.ondisconnect(root_1dhwcf310, () => unobserve?.());
|
|
600
|
+
template_u1.onwindow(root_1dhwcf310, 'blur', () => write(picks, []));
|
|
601
|
+
template_u1.onwindow(root_1dhwcf310, 'keydown', (e) => {
|
|
602
|
+
if (e.key === 'Escape' && read(picks).length) {
|
|
210
603
|
e.preventDefault();
|
|
211
|
-
|
|
604
|
+
write(picks, []);
|
|
212
605
|
}
|
|
213
606
|
});
|
|
214
|
-
template_u1.
|
|
215
|
-
|
|
216
|
-
|
|
607
|
+
template_u1.onwindow(root_1dhwcf310, 'keyup', (e) => {
|
|
608
|
+
let chosen = read(picks);
|
|
609
|
+
if (e.key !== (apple ? 'Meta' : 'Control') || chosen.length === 0) {
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
write(picks, []);
|
|
613
|
+
state.zoom(chosen);
|
|
614
|
+
});
|
|
615
|
+
template_u1.setClass(root_1dhwcf310, ["shell", attributes_1dhwcf315?.class, [
|
|
616
|
+
() => read(carrying) && 'shell--dragging',
|
|
617
|
+
() => narrow() && 'shell--narrow',
|
|
618
|
+
() => (frames.left.dragging || frames.right.dragging) && 'shell--sliding',
|
|
619
|
+
() => open('left') && 'shell--left-open',
|
|
620
|
+
() => open('right') && 'shell--right-open'
|
|
217
621
|
]]);
|
|
218
|
-
template_u1.setStyle(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
state.space = `${clamped}px`;
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
state.gap = undefined;
|
|
232
|
-
state.reach = `calc(${clamped}px + ${rest})`;
|
|
233
|
-
state.space = undefined;
|
|
622
|
+
template_u1.setStyle(root_1dhwcf310, ["", attributes_1dhwcf315?.style, () => {
|
|
623
|
+
let { left, right } = state.layout;
|
|
624
|
+
return {
|
|
625
|
+
'--left': frames.left.space,
|
|
626
|
+
'--left-size': left.size === null ? undefined : `${left.size}px`,
|
|
627
|
+
'--right': frames.right.space,
|
|
628
|
+
'--right-size': right.size === null ? undefined : `${right.size}px`
|
|
629
|
+
};
|
|
630
|
+
}]);
|
|
631
|
+
return root_1dhwcf310;
|
|
234
632
|
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
let state = frame[edge];
|
|
238
|
-
state.dragging = false;
|
|
239
|
-
flush();
|
|
240
|
-
state.gap = undefined;
|
|
241
|
-
state.reach = undefined;
|
|
242
|
-
state.space = undefined;
|
|
243
|
-
state.translate = undefined;
|
|
244
|
-
}
|
|
245
|
-
function toggle(sides, peeking, frame, edge) {
|
|
246
|
-
let side = sides[edge];
|
|
247
|
-
function label() {
|
|
248
|
-
return `${side.state.active ? 'Close' : 'Open'} ${side.label.toLowerCase()}`;
|
|
249
|
-
}
|
|
250
|
-
return button.sidebar({
|
|
251
|
-
'aria-controls': side.id,
|
|
252
|
-
'aria-label': label,
|
|
253
|
-
class: `shell-toggle shell-toggle--${edge}`,
|
|
254
|
-
id: `${side.id}-toggle`,
|
|
255
|
-
onclick: () => side.state.active ? close(side) : open(sides, peeking, edge),
|
|
256
|
-
onpointerout: (e) => leave(side, peeking, frame, edge, e),
|
|
257
|
-
open: () => side.state.active,
|
|
258
|
-
side: edge,
|
|
259
|
-
title: label
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
const shell = (sides, content) => {
|
|
263
|
-
let frame = { left: motion(), right: motion() }, peeking = new ReactiveObject_1dhwcf31(false, false);
|
|
264
|
-
{
|
|
265
|
-
let root_1dhwcf36 = template_1dhwcf37(), element_1dhwcf38 = root_1dhwcf36.firstChild.nextSibling.nextSibling, element_1dhwcf39 = element_1dhwcf38.nextSibling, element_1dhwcf3a = element_1dhwcf39.nextSibling, element_1dhwcf3b = element_1dhwcf3a.nextSibling, element_1dhwcf3c = element_1dhwcf3b.nextSibling, element_1dhwcf3d = element_1dhwcf3c.nextSibling, element_1dhwcf3e = root_1dhwcf36.firstElementChild.nextElementSibling.nextElementSibling;
|
|
266
|
-
template_u1.slot(element_1dhwcf38, panel(sides.left, peeking, frame, 'left'));
|
|
267
|
-
template_u1.slot(element_1dhwcf39, panel(sides.right, peeking, frame, 'right'));
|
|
268
|
-
template_u1.slot(element_1dhwcf3a, grip(sides, peeking, frame, 'left'));
|
|
269
|
-
template_u1.slot(element_1dhwcf3b, grip(sides, peeking, frame, 'right'));
|
|
270
|
-
template_u1.slot(element_1dhwcf3c, toggle(sides, peeking, frame, 'left'));
|
|
271
|
-
template_u1.slot(element_1dhwcf3d, toggle(sides, peeking, frame, 'right'));
|
|
272
|
-
template_u1.slot(element_1dhwcf3e, content, 1);
|
|
273
|
-
let attributes_1dhwcf3f = scrollbar();
|
|
274
|
-
template_u1.setProperties(element_1dhwcf3e, attributes_1dhwcf3f, true);
|
|
275
|
-
template_u1.setClass(element_1dhwcf3e, ["card shell-main", attributes_1dhwcf3f?.class]);
|
|
276
|
-
template_u1.setStyle(element_1dhwcf3e, ["", attributes_1dhwcf3f?.style]);
|
|
277
|
-
template_u1.setClass(root_1dhwcf36, ["shell", () => sides.left.state.active && 'shell--left-open', () => sides.right.state.active && 'shell--right-open', () => (frame.left.dragging || frame.right.dragging) && 'shell--dragging']);
|
|
278
|
-
template_u1.setStyle(root_1dhwcf36, ["", () => ({
|
|
279
|
-
'--left-edge': frame.left.reach,
|
|
280
|
-
'--left-gap-horizontal': frame.left.gap,
|
|
281
|
-
'--left-space': frame.left.space,
|
|
282
|
-
'--right-edge': frame.right.reach,
|
|
283
|
-
'--right-gap-horizontal': frame.right.gap,
|
|
284
|
-
'--right-space': frame.right.space
|
|
285
|
-
})]);
|
|
286
|
-
return root_1dhwcf36;
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
const layout = Object.assign(shell, { close });
|
|
633
|
+
});
|
|
634
|
+
const layout = Object.assign(shell, { state });
|
|
290
635
|
export default layout;
|