@esportsplus/ui 0.63.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 +2 -2
- package/.audit/rules-audit.md +2 -2
- package/README.md +15 -18
- package/RULES.md +80 -9
- package/bin/agent-cli +300 -0
- package/build/components/accordion/index.d.ts +4 -0
- package/build/components/accordion/index.js +13 -10
- package/build/components/breadcrumb/index.d.ts +1 -0
- package/build/components/breadcrumb/index.js +43 -37
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/kbd.d.ts +1 -1
- package/build/components/button/kbd.js +17 -15
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/split.js +14 -16
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/chat/minimap/index.js +4 -5
- package/build/components/checkbox/group.d.ts +1 -0
- package/build/components/checkbox/group.js +21 -20
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/color-picker/index.js +6 -6
- package/build/components/color-picker/scss/index.scss +1 -1
- package/build/components/command/index.d.ts +1 -1
- package/build/components/command/palette.d.ts +13 -9
- package/build/components/command/palette.js +143 -152
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/command/search.d.ts +5 -7
- package/build/components/command/search.js +6 -26
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/editor/code/commands.js +1 -1
- package/build/components/editor/code/document.d.ts +1 -3
- package/build/components/editor/code/document.js +1 -1
- package/build/components/editor/code/editor.d.ts +18 -6
- package/build/components/editor/code/editor.js +9 -7
- package/build/components/editor/code/features.js +27 -18
- package/build/components/editor/code/find.d.ts +1 -1
- package/build/components/editor/code/find.js +5 -6
- package/build/components/editor/code/folding.d.ts +3 -5
- package/build/components/editor/code/folding.js +2 -15
- package/build/components/editor/code/gutter.js +2 -2
- package/build/components/editor/code/index.d.ts +1 -0
- package/build/components/editor/code/index.js +1 -0
- package/build/components/editor/code/minimap.d.ts +3 -1
- package/build/components/editor/code/minimap.js +31 -5
- package/build/components/editor/code/services/model.js +2 -1
- package/build/components/editor/code/syntax.js +2 -1
- package/build/components/editor/code/view.d.ts +8 -2
- package/build/components/editor/code/view.js +37 -56
- package/build/components/editor/diffs/index.d.ts +1 -0
- package/build/components/editor/diffs/index.js +1 -0
- package/build/components/editor/diffs/merge.js +16 -17
- package/build/components/editor/diffs/view.js +10 -11
- package/build/components/editor/markdown/editing.d.ts +2 -1
- package/build/components/editor/markdown/editing.js +14 -5
- package/build/components/editor/markdown/format.d.ts +1 -1
- package/build/components/editor/markdown/format.js +116 -26
- package/build/components/editor/markdown/layout.js +2 -1
- package/build/components/editor/markdown/model.d.ts +1 -2
- package/build/components/editor/markdown/model.js +1 -29
- package/build/components/editor/markdown/render.js +1 -1
- package/build/components/editor/markdown/template.d.ts +3 -10
- package/build/components/editor/markdown/template.js +2 -29
- package/build/components/editor/markdown/toolbar.d.ts +2 -2
- package/build/components/editor/markdown/toolbar.js +90 -126
- package/build/components/editor/markdown/view.d.ts +1 -1
- package/build/components/editor/markdown/view.js +54 -87
- package/build/components/editor/tree/drag.js +1 -1
- package/build/components/editor/tree/find.js +70 -64
- package/build/components/editor/tree/template.js +8 -7
- package/build/components/editor/viewer/model.d.ts +1 -1
- package/build/components/editor/viewer/template.js +4 -26
- package/build/components/editor/workspace/keybindings.d.ts +1 -1
- package/build/components/editor/workspace/model.d.ts +12 -2
- package/build/components/editor/workspace/model.js +87 -31
- package/build/components/editor/workspace/session.d.ts +2 -6
- package/build/components/editor/workspace/session.js +99 -16
- package/build/components/editor/workspace/status.d.ts +1 -1
- package/build/components/editor/workspace/strip.d.ts +10 -9
- package/build/components/editor/workspace/strip.js +99 -141
- package/build/components/editor/workspace/tabs.d.ts +2 -4
- package/build/components/editor/workspace/tabs.js +1 -14
- package/build/components/editor/workspace/template.d.ts +1 -1
- package/build/components/editor/workspace/template.js +305 -435
- package/build/components/error/index.d.ts +4 -13
- package/build/components/error/index.js +53 -172
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/form/action.d.ts +2 -2
- package/build/components/form/action.js +2 -2
- package/build/components/form/input.d.ts +3 -3
- package/build/components/form/input.js +32 -10
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/group/index.js +96 -9
- package/build/components/group/scss/index.scss +1 -1
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/index.js +55 -48
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +3 -6
- package/build/components/index.js +3 -6
- package/build/components/inline-edit/index.d.ts +2 -2
- package/build/components/inline-edit/index.js +5 -5
- package/build/components/inline-edit/rich.js +4 -4
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/inline-edit/status.js +1 -0
- package/build/components/input/index.d.ts +4 -0
- package/build/components/input/index.js +3 -1
- package/build/components/input/otp.d.ts +18 -0
- package/build/components/input/otp.js +112 -0
- package/build/components/input/password.d.ts +15 -0
- package/build/components/input/password.js +163 -0
- package/build/components/input/scrub.d.ts +1 -0
- package/build/components/input/scrub.js +103 -89
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/input/tag.d.ts +5 -0
- package/build/components/input/tag.js +116 -69
- package/build/components/json/download.js +1 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/marquee/index.js +1 -1
- package/build/components/marquee/scss/index.scss +1 -1
- package/build/components/nav/scss/index.scss +1 -1
- package/build/components/nav/tree.d.ts +2 -1
- package/build/components/nav/tree.js +6 -5
- package/build/components/notification/index.js +3 -3
- package/build/components/notification/scss/index.scss +1 -1
- package/build/components/overlay/popup.d.ts +2 -2
- package/build/components/overlay/popup.js +1 -1
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/pagination/arrows.js +2 -3
- package/build/components/pagination/cards.js +2 -3
- package/build/components/pagination/index.d.ts +2 -3
- package/build/components/pagination/index.js +18 -13
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/progress/index.js +1 -1
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/progress/text.js +3 -3
- package/build/components/range/filter.d.ts +7 -1
- package/build/components/range/filter.js +188 -171
- package/build/components/range/index.d.ts +14 -9
- package/build/components/range/index.js +11 -8
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/range/surface.d.ts +21 -0
- package/build/components/range/surface.js +144 -0
- package/build/components/relative-time/index.js +2 -2
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/{preview/header.d.ts → search/button.d.ts} +3 -3
- package/build/components/search/button.js +18 -0
- package/build/components/search/index.d.ts +8 -0
- package/build/components/search/index.js +5 -0
- package/build/components/search/input.d.ts +9 -0
- package/build/components/search/input.js +23 -0
- package/build/components/search/parts.d.ts +5 -0
- package/build/components/search/parts.js +17 -0
- package/build/components/search/scss/index.scss +2 -0
- package/build/components/select/expand.js +4 -5
- package/build/components/select/index.d.ts +7 -7
- package/build/components/select/index.js +127 -117
- package/build/components/select/placement.js +8 -1
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/{panels → shell}/group.d.ts +21 -5
- package/build/components/shell/group.js +336 -0
- package/build/components/shell/index.d.ts +15 -17
- package/build/components/shell/index.js +583 -238
- package/build/components/shell/model.d.ts +94 -0
- package/build/components/{panels → shell}/model.js +199 -73
- package/build/components/shell/resize.d.ts +5 -0
- package/build/components/{panels → shell}/resize.js +54 -30
- package/build/components/shell/scss/index.scss +1 -1
- package/build/components/shell/sidebar.d.ts +34 -0
- package/build/components/shell/sidebar.js +362 -0
- package/build/components/{panels → shell}/subtree.js +7 -8
- package/build/components/shortcut-recorder/index.d.ts +5 -4
- package/build/components/shortcut-recorder/index.js +69 -44
- package/build/components/shortcut-recorder/scss/index.scss +1 -1
- package/build/components/sortable/index.d.ts +16 -2
- package/build/components/sortable/index.js +237 -134
- package/build/components/sortable/scss/index.scss +1 -1
- package/build/components/story/index.js +46 -34
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/engine.d.ts +2 -0
- package/build/components/surface-field/engine.js +86 -33
- package/build/components/surface-field/index.d.ts +26 -4
- package/build/components/surface-field/index.js +35 -4
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/surface-field/surface.d.ts +13 -1
- package/build/components/surface-field/surface.js +149 -58
- package/build/components/tasklist/index.d.ts +1 -4
- package/build/components/tasklist/index.js +36 -43
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/textarea/index.d.ts +1 -1
- package/build/components/textarea/index.js +14 -14
- package/build/components/theme/scss/index.scss +1 -1
- package/build/components/theme/shared.d.ts +1 -2
- package/build/components/theme/shared.js +2 -5
- package/build/components/toast/index.d.ts +3 -3
- package/build/components/toast/index.js +3 -3
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/toolbar/index.d.ts +91 -0
- package/build/components/toolbar/index.js +1281 -0
- package/build/components/toolbar/scss/index.scss +2 -0
- package/build/components/tooltip/menu.d.ts +9 -8
- package/build/components/tooltip/menu.js +397 -279
- package/build/components/tooltip/onclick.d.ts +2 -0
- package/build/components/tooltip/onclick.js +13 -4
- package/build/components/tooltip/onhover.d.ts +3 -1
- package/build/components/tooltip/onhover.js +10 -9
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/tooltip/shared.d.ts +4 -4
- package/build/components/tooltip/shared.js +27 -46
- package/build/components/tooltip/utilities.d.ts +5 -2
- package/build/components/tooltip/utilities.js +169 -9
- package/build/components/typewriter/rotate.js +6 -6
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/index.js +1 -1
- package/build/components/usage-meter/scss/index.scss +1 -1
- package/build/css-utilities/font/montserrat/OFL.txt +93 -0
- package/build/shared/drag.d.ts +15 -9
- package/build/shared/drag.js +41 -28
- package/build/shared/placement.d.ts +39 -0
- package/build/shared/placement.js +55 -0
- package/build/shared/transition.js +1 -1
- package/build/shared/viewport.d.ts +1 -2
- package/build/shared/viewport.js +1 -4
- package/package.json +2 -5
- package/src/components/accordion/index.ts +12 -5
- package/src/components/announcement/index.ts +1 -1
- package/src/components/breadcrumb/index.ts +13 -3
- package/src/components/breadcrumb/scss/index.scss +6 -6
- package/src/components/breadcrumb/scss/variables.scss +7 -0
- package/src/components/button/kbd.ts +22 -17
- package/src/components/button/scss/index.scss +69 -76
- package/src/components/button/scss/variables.scss +51 -18
- package/src/components/button/split.ts +12 -8
- package/src/components/capslock/index.ts +2 -0
- package/src/components/capslock/scss/index.scss +21 -21
- package/src/components/card/scss/index.scss +16 -0
- package/src/components/card/scss/variables.scss +25 -2
- package/src/components/chat/minimap/index.ts +5 -6
- package/src/components/chat/minimap/scss/index.scss +12 -11
- package/src/components/chat/minimap/scss/variables.scss +23 -17
- package/src/components/checkbox/group.ts +8 -7
- package/src/components/checkbox/scss/index.scss +59 -35
- package/src/components/checkbox/scss/variables.scss +24 -17
- package/src/components/color-picker/index.ts +6 -6
- package/src/components/color-picker/scss/index.scss +35 -22
- package/src/components/color-picker/scss/variables.scss +11 -3
- package/src/components/command/index.ts +1 -1
- package/src/components/command/palette.ts +174 -166
- package/src/components/command/scss/index.scss +18 -51
- package/src/components/command/scss/variables.scss +37 -71
- package/src/components/command/search.ts +9 -31
- package/src/components/counter/index.ts +22 -22
- package/src/components/counter/scss/variables.scss +10 -7
- package/src/components/editor/code/commands.ts +1 -1
- package/src/components/editor/code/document.ts +0 -2
- package/src/components/editor/code/editor.ts +31 -13
- package/src/components/editor/code/features.ts +39 -24
- package/src/components/editor/code/find.ts +5 -6
- package/src/components/editor/code/folding.ts +3 -21
- package/src/components/editor/code/gutter.ts +2 -2
- package/src/components/editor/code/index.ts +1 -0
- package/src/components/editor/code/minimap.ts +39 -5
- package/src/components/editor/code/scss/_editor.scss +28 -21
- package/src/components/editor/code/scss/_features.scss +19 -21
- package/src/components/editor/code/scss/_services.scss +14 -11
- package/src/components/editor/code/scss/variables.scss +31 -12
- package/src/components/editor/code/services/model.ts +2 -1
- package/src/components/editor/code/syntax.ts +2 -1
- package/src/components/editor/code/view.ts +22 -45
- package/src/components/editor/diffs/index.ts +1 -0
- package/src/components/editor/diffs/merge.ts +9 -10
- package/src/components/editor/diffs/scss/_diffs.scss +39 -63
- package/src/components/editor/diffs/scss/_merge.scss +10 -2
- package/src/components/editor/diffs/scss/index.scss +0 -1
- package/src/components/editor/diffs/scss/variables.scss +36 -17
- package/src/components/editor/diffs/view.ts +8 -9
- package/src/components/editor/markdown/editing.ts +18 -6
- package/src/components/editor/markdown/format.ts +180 -32
- package/src/components/editor/markdown/layout.ts +2 -1
- package/src/components/editor/markdown/model.ts +0 -38
- package/src/components/editor/markdown/render.ts +1 -1
- package/src/components/editor/markdown/scss/index.scss +38 -52
- package/src/components/editor/markdown/scss/variables.scss +24 -50
- package/src/components/editor/markdown/template.ts +3 -63
- package/src/components/editor/markdown/toolbar.ts +76 -127
- package/src/components/editor/markdown/view.ts +9 -32
- package/src/components/editor/tree/drag.ts +1 -1
- package/src/components/editor/tree/find.ts +61 -64
- package/src/components/editor/tree/scss/index.scss +29 -30
- package/src/components/editor/tree/scss/variables.scss +34 -15
- package/src/components/editor/tree/template.ts +9 -9
- package/src/components/editor/viewer/model.ts +1 -1
- package/src/components/editor/viewer/scss/_viewer.scss +4 -5
- package/src/components/editor/viewer/scss/variables.scss +3 -3
- package/src/components/editor/viewer/template.ts +4 -31
- package/src/components/editor/workspace/keybindings.ts +1 -1
- package/src/components/editor/workspace/model.ts +136 -37
- package/src/components/editor/workspace/scss/_keybindings.scss +3 -20
- package/src/components/editor/workspace/scss/_status.scss +0 -1
- package/src/components/editor/workspace/scss/_tabs.scss +2 -41
- package/src/components/editor/workspace/scss/index.scss +49 -71
- package/src/components/editor/workspace/scss/variables.scss +1 -135
- package/src/components/editor/workspace/session.ts +138 -18
- package/src/components/editor/workspace/status.ts +1 -1
- package/src/components/editor/workspace/strip.ts +96 -115
- package/src/components/editor/workspace/tabs.ts +2 -23
- package/src/components/editor/workspace/template.ts +323 -458
- package/src/components/error/index.ts +47 -183
- package/src/components/error/scss/index.scss +34 -35
- package/src/components/error/scss/variables.scss +14 -26
- package/src/components/filter/scss/index.scss +6 -5
- package/src/components/form/action.ts +7 -7
- package/src/components/form/input.ts +25 -12
- package/src/components/frame/scss/index.scss +5 -5
- package/src/components/group/index.ts +77 -2
- package/src/components/group/scss/index.scss +164 -0
- package/src/components/group/scss/variables.scss +110 -2
- package/src/components/heatmap/scss/variables.scss +13 -10
- package/src/components/highlight/index.ts +87 -79
- package/src/components/highlight/scss/index.scss +6 -16
- package/src/components/highlight/scss/variables.scss +33 -5
- package/src/components/icon/scss/index.scss +2 -2
- package/src/components/icon/scss/variables.scss +14 -1
- package/src/components/image/scss/index.scss +9 -9
- package/src/components/image/scss/variables.scss +1 -1
- package/src/components/index.ts +3 -6
- package/src/components/inline-edit/index.ts +8 -6
- package/src/components/inline-edit/rich.ts +8 -8
- package/src/components/inline-edit/scss/index.scss +50 -36
- package/src/components/inline-edit/scss/variables.scss +28 -18
- package/src/components/inline-edit/status.ts +2 -0
- package/src/components/input/index.ts +3 -1
- package/src/components/input/otp.ts +175 -0
- package/src/components/input/password.ts +178 -0
- package/src/components/input/scrub.ts +197 -178
- package/src/components/input/scss/index.scss +344 -4
- package/src/components/input/scss/variables.scss +234 -65
- package/src/components/input/tag.ts +98 -53
- package/src/components/json/download.ts +2 -5
- package/src/components/link/scss/index.scss +3 -5
- package/src/components/loading/scss/index.scss +1 -0
- package/src/components/loading/scss/variables.scss +1 -0
- package/src/components/marquee/index.ts +1 -1
- package/src/components/marquee/scss/index.scss +11 -4
- package/src/components/nav/scss/index.scss +10 -26
- package/src/components/nav/scss/variables.scss +13 -23
- package/src/components/nav/tree.ts +10 -8
- package/src/components/notification/index.ts +3 -3
- package/src/components/notification/scss/index.scss +7 -14
- package/src/components/notification/scss/variables.scss +10 -2
- package/src/components/number/index.ts +1 -1
- package/src/components/overlay/popup.ts +2 -2
- package/src/components/overlay/scss/index.scss +60 -51
- package/src/components/page/scss/variables.scss +1 -0
- package/src/components/pagination/arrows.ts +2 -3
- package/src/components/pagination/cards.ts +2 -3
- package/src/components/pagination/index.ts +11 -9
- package/src/components/pagination/scss/index.scss +38 -101
- package/src/components/pagination/scss/variables.scss +24 -75
- package/src/components/progress/index.ts +1 -1
- package/src/components/progress/scss/index.scss +22 -11
- package/src/components/progress/scss/variables.scss +13 -5
- package/src/components/progress/text.ts +3 -3
- package/src/components/range/filter.ts +249 -246
- package/src/components/range/index.ts +22 -7
- package/src/components/range/scss/index.scss +470 -15
- package/src/components/range/scss/variables.scss +402 -198
- package/src/components/range/surface.ts +135 -0
- package/src/components/relative-time/index.ts +2 -2
- package/src/components/relative-time/scss/index.scss +4 -2
- package/src/components/relative-time/scss/variables.scss +4 -5
- package/src/components/root/scss/index.scss +11 -11
- package/src/components/root/scss/variables.scss +4 -4
- package/src/components/search/button.ts +24 -0
- package/src/components/search/index.ts +12 -0
- package/src/components/search/input.ts +35 -0
- package/src/components/search/parts.ts +24 -0
- package/src/components/search/scss/index.scss +36 -0
- package/src/components/search/scss/variables.scss +67 -0
- package/src/components/section/scss/variables.scss +1 -0
- package/src/components/select/expand.ts +3 -4
- package/src/components/select/index.ts +55 -41
- package/src/components/select/placement.ts +17 -1
- package/src/components/select/scss/index.scss +57 -29
- package/src/components/select/scss/variables.scss +91 -53
- package/src/components/{panels → shell}/group.ts +151 -98
- package/src/components/shell/index.ts +805 -284
- package/src/components/{panels → shell}/model.ts +329 -102
- package/src/components/shell/resize.ts +176 -0
- package/src/components/shell/scss/index.scss +502 -89
- package/src/components/shell/scss/variables.scss +264 -39
- package/src/components/shell/sidebar.ts +325 -0
- package/src/components/{panels → shell}/subtree.ts +1 -2
- package/src/components/shortcut-recorder/index.ts +99 -61
- package/src/components/shortcut-recorder/scss/index.scss +76 -52
- package/src/components/shortcut-recorder/scss/variables.scss +25 -30
- package/src/components/sortable/index.ts +364 -63
- package/src/components/sortable/scss/index.scss +22 -2
- package/src/components/sortable/scss/variables.scss +16 -4
- package/src/components/story/index.ts +56 -33
- package/src/components/story/scss/index.scss +67 -16
- package/src/components/story/scss/variables.scss +59 -18
- package/src/components/surface-field/engine.ts +157 -61
- package/src/components/surface-field/index.ts +64 -9
- package/src/components/surface-field/scss/index.scss +88 -77
- package/src/components/surface-field/scss/variables.scss +84 -36
- package/src/components/surface-field/surface.ts +225 -76
- package/src/components/tasklist/index.ts +10 -14
- package/src/components/tasklist/scss/index.scss +25 -45
- package/src/components/tasklist/scss/variables.scss +12 -29
- package/src/components/textarea/index.ts +39 -42
- package/src/components/theme/reveal.ts +1 -0
- package/src/components/theme/scss/index.scss +20 -16
- package/src/components/theme/scss/variables.scss +11 -5
- package/src/components/theme/shared.ts +3 -7
- package/src/components/toast/index.ts +7 -8
- package/src/components/toast/scss/index.scss +44 -36
- package/src/components/toast/scss/variables.scss +36 -33
- package/src/components/toolbar/index.ts +1675 -0
- package/src/components/toolbar/scss/index.scss +759 -0
- package/src/components/toolbar/scss/variables.scss +555 -0
- package/src/components/tooltip/menu.ts +301 -220
- package/src/components/tooltip/onclick.ts +18 -3
- package/src/components/tooltip/onhover.ts +13 -9
- package/src/components/tooltip/scss/index.scss +155 -188
- package/src/components/tooltip/scss/variables.scss +151 -135
- package/src/components/tooltip/shared.ts +47 -74
- package/src/components/tooltip/utilities.ts +151 -10
- package/src/components/truncate/index.ts +1 -1
- package/src/components/typewriter/rotate.ts +6 -6
- package/src/components/typewriter/scss/index.scss +14 -5
- package/src/components/uptime/scss/index.scss +8 -15
- package/src/components/uptime/scss/variables.scss +12 -1
- package/src/components/usage-meter/index.ts +1 -1
- package/src/components/usage-meter/scss/index.scss +6 -4
- package/src/components/usage-meter/scss/variables.scss +11 -11
- package/src/css-utilities/box-shadow.scss +0 -1
- package/src/css-utilities/icon.scss +9 -9
- package/src/css-utilities/surface.scss +27 -17
- package/src/modifiers/glass/index.ts +2 -2
- package/src/modifiers/glass/scss/index.scss +2 -2
- package/src/normalize/scss/index.scss +1 -1
- package/src/shared/drag.ts +92 -53
- package/src/shared/placement.ts +145 -0
- package/src/shared/transition.ts +1 -1
- package/src/shared/viewport.ts +1 -7
- package/src/tokens/scss/color.scss +2 -2
- package/src/tokens/scss/scale.scss +5 -1
- package/src/tokens/scss/size.scss +0 -7
- package/storage/svg/angle.svg +1 -0
- package/storage/svg/{chevron-left.svg → arrow.svg} +1 -1
- package/storage/svg/calendar.svg +1 -0
- package/storage/svg/circle-filled.svg +1 -0
- package/storage/svg/cursor-arrow-left.svg +1 -0
- package/storage/svg/cursor-arrow-right.svg +1 -0
- package/storage/svg/fit.svg +1 -0
- package/storage/svg/grip.svg +1 -0
- package/storage/svg/mail.svg +1 -0
- package/storage/svg/{chevron-down.svg → minus.svg} +1 -1
- package/storage/svg/music.svg +1 -0
- package/storage/svg/{chevron-up.svg → rotate-ccw.svg} +1 -1
- package/vite.config.ts +9 -13
- package/build/components/dock/index.d.ts +0 -47
- package/build/components/dock/index.js +0 -469
- package/build/components/dock/scss/index.scss +0 -2
- package/build/components/metric/flash.d.ts +0 -12
- package/build/components/metric/flash.js +0 -117
- package/build/components/metric/index.d.ts +0 -44
- package/build/components/metric/index.js +0 -275
- package/build/components/metric/scss/index.scss +0 -2
- package/build/components/pagination/dots.d.ts +0 -23
- package/build/components/pagination/dots.js +0 -115
- package/build/components/panels/dnd.d.ts +0 -47
- package/build/components/panels/dnd.js +0 -114
- package/build/components/panels/group.js +0 -322
- package/build/components/panels/index.d.ts +0 -17
- package/build/components/panels/index.js +0 -524
- package/build/components/panels/model.d.ts +0 -64
- package/build/components/panels/resize.d.ts +0 -9
- package/build/components/panels/scss/index.scss +0 -2
- package/build/components/preview/buttons.d.ts +0 -12
- package/build/components/preview/buttons.js +0 -26
- package/build/components/preview/code.d.ts +0 -8
- package/build/components/preview/code.js +0 -18
- package/build/components/preview/header.js +0 -21
- package/build/components/preview/index.d.ts +0 -37
- package/build/components/preview/index.js +0 -123
- package/build/components/preview/scss/index.scss +0 -2
- package/build/components/preview/source.d.ts +0 -12
- package/build/components/preview/source.js +0 -79
- package/build/components/preview/stage.d.ts +0 -8
- package/build/components/preview/stage.js +0 -28
- package/build/components/textarea/scss/index.scss +0 -2
- package/src/components/dock/index.ts +0 -567
- package/src/components/dock/scss/index.scss +0 -346
- package/src/components/dock/scss/variables.scss +0 -357
- package/src/components/input/scss/_field.scss +0 -39
- package/src/components/input/scss/_scrub.scss +0 -89
- package/src/components/input/scss/_tag.scss +0 -142
- package/src/components/metric/flash.ts +0 -129
- package/src/components/metric/index.ts +0 -307
- package/src/components/metric/scss/_flash.scss +0 -150
- package/src/components/metric/scss/index.scss +0 -155
- package/src/components/metric/scss/variables.scss +0 -233
- package/src/components/pagination/dots.ts +0 -132
- package/src/components/panels/dnd.ts +0 -190
- package/src/components/panels/index.ts +0 -676
- package/src/components/panels/resize.ts +0 -157
- package/src/components/panels/scss/index.scss +0 -379
- package/src/components/panels/scss/variables.scss +0 -197
- package/src/components/preview/buttons.ts +0 -48
- package/src/components/preview/code.ts +0 -28
- package/src/components/preview/header.ts +0 -23
- package/src/components/preview/index.ts +0 -149
- package/src/components/preview/scss/index.scss +0 -158
- package/src/components/preview/scss/variables.scss +0 -149
- package/src/components/preview/source.ts +0 -73
- package/src/components/preview/stage.ts +0 -33
- package/src/components/range/scss/_filter.scss +0 -360
- package/src/components/range/scss/_slider.scss +0 -65
- package/src/components/range/scss/_vertical.scss +0 -10
- package/src/components/textarea/scss/index.scss +0 -72
- package/src/components/textarea/scss/variables.scss +0 -22
- package/storage/svg/amex.svg +0 -1
- package/storage/svg/arrow-down.svg +0 -1
- package/storage/svg/arrow-left.svg +0 -1
- package/storage/svg/arrow-right.svg +0 -1
- package/storage/svg/arrow-up.svg +0 -1
- package/storage/svg/card.svg +0 -1
- package/storage/svg/chip.svg +0 -1
- package/storage/svg/discover.svg +0 -1
- package/storage/svg/mastercard.svg +0 -1
- package/storage/svg/visa.svg +0 -1
- /package/build/components/{panels → shell}/subtree.d.ts +0 -0
- /package/storage/svg/{chevron-right.svg → chevron.svg} +0 -0
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import { type ReactiveArray } from '@esportsplus/reactivity';
|
|
2
2
|
import { type Attributes, type Renderable } from '@esportsplus/template';
|
|
3
3
|
import './scss/index.scss';
|
|
4
|
+
type Combine<T> = {
|
|
5
|
+
accepts?: (item: T, target: HTMLElement) => boolean;
|
|
6
|
+
oncombine: (item: T, target: HTMLElement, items: ReactiveArray<T>, from: number, source: ReactiveArray<T>) => void;
|
|
7
|
+
};
|
|
4
8
|
type Options<T> = {
|
|
9
|
+
combine?: Combine<T>;
|
|
10
|
+
disabled?: (item: T) => boolean;
|
|
5
11
|
drag?: (item: T) => Renderable<unknown>;
|
|
6
12
|
group?: string;
|
|
7
13
|
handle?: string;
|
|
14
|
+
onland?: (item: T) => void;
|
|
15
|
+
onlift?: (item: T) => void;
|
|
8
16
|
onsort?: (item: T, from: number, to: number, source: ReactiveArray<T>, target: ReactiveArray<T>) => void;
|
|
17
|
+
onthrow?: (item: T, from: number, items: ReactiveArray<T>) => void;
|
|
18
|
+
outside?: Outside<T>;
|
|
19
|
+
};
|
|
20
|
+
type Outside<T> = {
|
|
21
|
+
ondrop: (item: T, target: HTMLElement, from: number, source: ReactiveArray<T>) => void;
|
|
22
|
+
over: (item: T, x: number, y: number) => HTMLElement | null;
|
|
9
23
|
};
|
|
10
24
|
export default _default;
|
|
11
|
-
declare function _default<T>(items: ReactiveArray<T>, template: (item: T, attributes: Attributes) => Renderable<unknown>, { drag: copy, group, handle, onsort }?: Options<T>): {
|
|
25
|
+
declare function _default<T>(items: ReactiveArray<T>, template: (item: T, attributes: Attributes) => Renderable<unknown>, { combine, disabled, drag: copy, group, handle, onland, onlift, onsort, onthrow, outside }?: Options<T>): {
|
|
12
26
|
attributes: Attributes[];
|
|
13
27
|
render: () => DocumentFragment | Element | Text;
|
|
14
28
|
};
|
|
15
|
-
export type { Options as SortableOptions };
|
|
29
|
+
export type { Combine as SortableCombine, Options as SortableOptions, Outside as SortableOutside };
|
|
@@ -3,11 +3,12 @@ import { flush, read, root, signal, write } from '@esportsplus/reactivity';
|
|
|
3
3
|
import * as template_u1 from '@esportsplus/template';
|
|
4
4
|
import { setProperties } from '@esportsplus/template';
|
|
5
5
|
import { finished, measure, slides, timing } from '../../shared/animation.js';
|
|
6
|
+
import { coast, sample, velocity } from '../../shared/drag.js';
|
|
6
7
|
import press from '../../shared/press.js';
|
|
7
8
|
import './scss/index.scss';
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const template_17lqxwv2 = template_u1.template(`<div inert popover='manual'>`, true);
|
|
10
|
+
const template_17lqxwv4 = template_u1.template(`<!--$--><!--$-->`);
|
|
11
|
+
const template_17lqxwv8 = template_u1.template(`<!--$-->`);
|
|
11
12
|
class ReactiveObject_17lqxwv0 extends reactivity_u0.ReactiveObject {
|
|
12
13
|
#carrying = this[reactivity_u0.SIGNAL](0);
|
|
13
14
|
constructor() {
|
|
@@ -20,89 +21,18 @@ class ReactiveObject_17lqxwv0 extends reactivity_u0.ReactiveObject {
|
|
|
20
21
|
reactivity_u0.write(this.#carrying, _v0);
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
#angle = this[reactivity_u0.SIGNAL](0);
|
|
25
|
-
#dropping = this[reactivity_u0.SIGNAL](false);
|
|
26
|
-
#height = this[reactivity_u0.SIGNAL](0);
|
|
27
|
-
#left = this[reactivity_u0.SIGNAL](0);
|
|
28
|
-
#origin = this[reactivity_u0.SIGNAL]('');
|
|
29
|
-
#radius = this[reactivity_u0.SIGNAL]('');
|
|
30
|
-
#top = this[reactivity_u0.SIGNAL](0);
|
|
31
|
-
#width = this[reactivity_u0.SIGNAL](0);
|
|
32
|
-
#x = this[reactivity_u0.SIGNAL](0);
|
|
33
|
-
#y = this[reactivity_u0.SIGNAL](0);
|
|
34
|
-
constructor() {
|
|
35
|
-
super(null);
|
|
36
|
-
}
|
|
37
|
-
get angle() {
|
|
38
|
-
return reactivity_u0.read(this.#angle);
|
|
39
|
-
}
|
|
40
|
-
set angle(_v0) {
|
|
41
|
-
reactivity_u0.write(this.#angle, _v0);
|
|
42
|
-
}
|
|
43
|
-
get dropping() {
|
|
44
|
-
return reactivity_u0.read(this.#dropping);
|
|
45
|
-
}
|
|
46
|
-
set dropping(_v1) {
|
|
47
|
-
reactivity_u0.write(this.#dropping, _v1);
|
|
48
|
-
}
|
|
49
|
-
get height() {
|
|
50
|
-
return reactivity_u0.read(this.#height);
|
|
51
|
-
}
|
|
52
|
-
set height(_v2) {
|
|
53
|
-
reactivity_u0.write(this.#height, _v2);
|
|
54
|
-
}
|
|
55
|
-
get left() {
|
|
56
|
-
return reactivity_u0.read(this.#left);
|
|
57
|
-
}
|
|
58
|
-
set left(_v3) {
|
|
59
|
-
reactivity_u0.write(this.#left, _v3);
|
|
60
|
-
}
|
|
61
|
-
get origin() {
|
|
62
|
-
return reactivity_u0.read(this.#origin);
|
|
63
|
-
}
|
|
64
|
-
set origin(_v4) {
|
|
65
|
-
reactivity_u0.write(this.#origin, _v4);
|
|
66
|
-
}
|
|
67
|
-
get radius() {
|
|
68
|
-
return reactivity_u0.read(this.#radius);
|
|
69
|
-
}
|
|
70
|
-
set radius(_v5) {
|
|
71
|
-
reactivity_u0.write(this.#radius, _v5);
|
|
72
|
-
}
|
|
73
|
-
get top() {
|
|
74
|
-
return reactivity_u0.read(this.#top);
|
|
75
|
-
}
|
|
76
|
-
set top(_v6) {
|
|
77
|
-
reactivity_u0.write(this.#top, _v6);
|
|
78
|
-
}
|
|
79
|
-
get width() {
|
|
80
|
-
return reactivity_u0.read(this.#width);
|
|
81
|
-
}
|
|
82
|
-
set width(_v7) {
|
|
83
|
-
reactivity_u0.write(this.#width, _v7);
|
|
84
|
-
}
|
|
85
|
-
get x() {
|
|
86
|
-
return reactivity_u0.read(this.#x);
|
|
87
|
-
}
|
|
88
|
-
set x(_v8) {
|
|
89
|
-
reactivity_u0.write(this.#x, _v8);
|
|
90
|
-
}
|
|
91
|
-
get y() {
|
|
92
|
-
return reactivity_u0.read(this.#y);
|
|
93
|
-
}
|
|
94
|
-
set y(_v9) {
|
|
95
|
-
reactivity_u0.write(this.#y, _v9);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
24
|
+
const ANYWHERE = [{ axis: 'x', sign: -1 }, { axis: 'x', sign: 1 }, { axis: 'y', sign: -1 }, { axis: 'y', sign: 1 }];
|
|
98
25
|
const DELAY = 180;
|
|
99
26
|
const ENTER = 0.15;
|
|
100
27
|
const HANG = 0.5;
|
|
28
|
+
const MIDDLE = 0.25;
|
|
29
|
+
const SETTLE = 200;
|
|
30
|
+
const SLOP = 6;
|
|
101
31
|
const SMOOTHING = 0.04;
|
|
102
32
|
const SORTABLE_STATE = Symbol('sortable.root');
|
|
103
33
|
let groups = new Map();
|
|
104
|
-
function drag(source, item, value, e, { group, onsort }) {
|
|
105
|
-
let carried = false, current = source, frame = 0, from = source.items.indexOf(value), hole = null, lastLeft = NaN, lastTop = NaN, layout = [], lists = group ? [...(groups.get(group) ?? [source])] : [source], motion = source.motion, originX = e.clientX, originY = e.clientY, previousX = e.clientX, previousY = e.clientY, shift = null, swing = null, time = 0, x = e.clientX, y = e.clientY;
|
|
34
|
+
function drag(source, item, value, e, { group, onland, onlift, onsort, onthrow, outside }) {
|
|
35
|
+
let aiming = null, carried = false, current = source, frame = 0, from = source.items.indexOf(value), hole = null, lastLeft = NaN, lastTop = NaN, layout = [], lists = group ? [...(groups.get(group) ?? [source])] : [source], marked = null, merged = false, motion = source.motion, originX = e.clientX, originY = e.clientY, pending = null, previousX = e.clientX, previousY = e.clientY, shift = null, swing = null, time = 0, tracked = velocity(), x = e.clientX, y = e.clientY;
|
|
106
36
|
function activate() {
|
|
107
37
|
let rect = item.getBoundingClientRect(), computed = getComputedStyle(item);
|
|
108
38
|
shift = timing(computed, 'shift');
|
|
@@ -114,6 +44,7 @@ function drag(source, item, value, e, { group, onsort }) {
|
|
|
114
44
|
motion.left = rect.left;
|
|
115
45
|
motion.origin = `${originX - rect.left}px ${originY - rect.top}px`;
|
|
116
46
|
motion.radius = computed.borderRadius;
|
|
47
|
+
motion.throw = null;
|
|
117
48
|
motion.top = rect.top;
|
|
118
49
|
motion.width = rect.width;
|
|
119
50
|
motion.x = 0;
|
|
@@ -122,8 +53,17 @@ function drag(source, item, value, e, { group, onsort }) {
|
|
|
122
53
|
write(source.held, value);
|
|
123
54
|
});
|
|
124
55
|
carry(true);
|
|
56
|
+
onlift?.(value);
|
|
125
57
|
frame = requestAnimationFrame(tick);
|
|
126
58
|
}
|
|
59
|
+
function aim(element) {
|
|
60
|
+
if (element === aiming) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
aiming?.classList.remove('sortable-item--target');
|
|
64
|
+
aiming = element;
|
|
65
|
+
element?.classList.add('sortable-item--target');
|
|
66
|
+
}
|
|
127
67
|
function carry(value) {
|
|
128
68
|
if (carried === value) {
|
|
129
69
|
return;
|
|
@@ -131,6 +71,31 @@ function drag(source, item, value, e, { group, onsort }) {
|
|
|
131
71
|
carried = value;
|
|
132
72
|
page().carrying += value ? 1 : -1;
|
|
133
73
|
}
|
|
74
|
+
function deliver(target, ondrop) {
|
|
75
|
+
let ghost = source.ghost, list = current, from = list.items.indexOf(value);
|
|
76
|
+
merged = true;
|
|
77
|
+
mark(null);
|
|
78
|
+
reflow(() => {
|
|
79
|
+
list.items.splice(from, 1);
|
|
80
|
+
write(list.held, null);
|
|
81
|
+
});
|
|
82
|
+
ondrop(value, target, from, list.items);
|
|
83
|
+
flush();
|
|
84
|
+
if (ghost) {
|
|
85
|
+
let box = target.getBoundingClientRect();
|
|
86
|
+
motion.angle = 0;
|
|
87
|
+
motion.dropping = true;
|
|
88
|
+
motion.x = box.left + (box.width - motion.width) / 2 - motion.left;
|
|
89
|
+
motion.y = box.top + (box.height - motion.height) / 2 - motion.top;
|
|
90
|
+
flush();
|
|
91
|
+
}
|
|
92
|
+
carry(false);
|
|
93
|
+
void (ghost ? finished(ghost) : Promise.resolve()).then(() => {
|
|
94
|
+
write(source.dragging, null);
|
|
95
|
+
flush();
|
|
96
|
+
onland?.(value);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
134
99
|
function drop() {
|
|
135
100
|
let ghost = source.ghost, slot = hole?.element;
|
|
136
101
|
if (ghost && slot) {
|
|
@@ -168,10 +133,11 @@ function drag(source, item, value, e, { group, onsort }) {
|
|
|
168
133
|
if (onsort && (current !== source || to !== from)) {
|
|
169
134
|
onsort(value, from, to, source.items, current.items);
|
|
170
135
|
}
|
|
136
|
+
onland?.(value);
|
|
171
137
|
});
|
|
172
138
|
}
|
|
173
139
|
function enter(target) {
|
|
174
|
-
let
|
|
140
|
+
let index = 0, { left, top } = local(target);
|
|
175
141
|
for (let i = 0, n = layout.length; i < n; i++) {
|
|
176
142
|
let rect = layout[i];
|
|
177
143
|
if (rect.list === target && (rect.bottom <= top || (rect.top < top && rect.right <= left))) {
|
|
@@ -182,29 +148,96 @@ function drag(source, item, value, e, { group, onsort }) {
|
|
|
182
148
|
}
|
|
183
149
|
function end(e, started) {
|
|
184
150
|
cancelAnimationFrame(frame);
|
|
185
|
-
if (!started) {
|
|
151
|
+
if (!started || merged) {
|
|
186
152
|
return;
|
|
187
153
|
}
|
|
154
|
+
aim(null);
|
|
188
155
|
if (e) {
|
|
189
|
-
|
|
156
|
+
let list = over(), target = !list && outside ? outside.over(value, x, y) : null, combine = list?.combine, point = list && local(list), rect = list && point && combine ? under(list, point.left, point.top) : null;
|
|
157
|
+
if (target) {
|
|
158
|
+
deliver(target, outside.ondrop);
|
|
159
|
+
}
|
|
160
|
+
else if (list && point && rect && middle(rect, point.left, point.top) &&
|
|
161
|
+
(combine.accepts?.(value, rect.element) ?? true)) {
|
|
162
|
+
merge(list, rect);
|
|
163
|
+
}
|
|
164
|
+
else if (onthrow && !hit()) {
|
|
165
|
+
toss(onthrow);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
drop();
|
|
169
|
+
}
|
|
190
170
|
return;
|
|
191
171
|
}
|
|
172
|
+
mark(null);
|
|
192
173
|
write(current.held, null);
|
|
193
174
|
write(source.dragging, null);
|
|
194
175
|
carry(false);
|
|
176
|
+
onland?.(value);
|
|
195
177
|
}
|
|
196
|
-
function
|
|
197
|
-
if (lists.length === 1) {
|
|
198
|
-
return source;
|
|
199
|
-
}
|
|
178
|
+
function hit() {
|
|
200
179
|
for (let i = 0, n = lists.length; i < n; i++) {
|
|
201
|
-
let
|
|
202
|
-
if (
|
|
180
|
+
let container = lists[i].container;
|
|
181
|
+
if (!container?.checkVisibility({ opacityProperty: true, visibilityProperty: true })) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
let rect = container.getBoundingClientRect();
|
|
185
|
+
if (x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom) {
|
|
203
186
|
return lists[i];
|
|
204
187
|
}
|
|
205
188
|
}
|
|
206
189
|
return null;
|
|
207
190
|
}
|
|
191
|
+
function local(list) {
|
|
192
|
+
let bounds = list.container.getBoundingClientRect();
|
|
193
|
+
return { left: x - bounds.left + list.container.scrollLeft, top: y - bounds.top + list.container.scrollTop };
|
|
194
|
+
}
|
|
195
|
+
function mark(element) {
|
|
196
|
+
if (element === marked) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
marked?.classList.remove('--over');
|
|
200
|
+
marked = element;
|
|
201
|
+
element?.classList.add('--over');
|
|
202
|
+
}
|
|
203
|
+
function merge(list, rect) {
|
|
204
|
+
let ghost = source.ghost, sitting = current, from = sitting.items.indexOf(value);
|
|
205
|
+
merged = true;
|
|
206
|
+
cancelAnimationFrame(frame);
|
|
207
|
+
aim(null);
|
|
208
|
+
reflow(() => {
|
|
209
|
+
sitting.items.splice(from, 1);
|
|
210
|
+
write(sitting.held, null);
|
|
211
|
+
});
|
|
212
|
+
for (let animation of rect.element.getAnimations()) {
|
|
213
|
+
animation.finish();
|
|
214
|
+
}
|
|
215
|
+
let box = rect.element.getBoundingClientRect();
|
|
216
|
+
list.combine.oncombine(value, rect.element, list.items, from, sitting.items);
|
|
217
|
+
flush();
|
|
218
|
+
if (ghost) {
|
|
219
|
+
motion.angle = 0;
|
|
220
|
+
motion.dropping = true;
|
|
221
|
+
motion.height = box.height;
|
|
222
|
+
motion.width = box.width;
|
|
223
|
+
motion.x = box.left - motion.left;
|
|
224
|
+
motion.y = box.top - motion.top;
|
|
225
|
+
flush();
|
|
226
|
+
}
|
|
227
|
+
carry(false);
|
|
228
|
+
void (ghost ? finished(ghost) : Promise.resolve()).then(() => {
|
|
229
|
+
write(source.dragging, null);
|
|
230
|
+
flush();
|
|
231
|
+
onland?.(value);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function middle(rect, left, top) {
|
|
235
|
+
let insetX = (rect.right - rect.left) * MIDDLE, insetY = (rect.bottom - rect.top) * MIDDLE;
|
|
236
|
+
return left > rect.left + insetX && left < rect.right - insetX && top > rect.top + insetY && top < rect.bottom - insetY;
|
|
237
|
+
}
|
|
238
|
+
function over() {
|
|
239
|
+
return lists.length === 1 && !outside ? source : hit();
|
|
240
|
+
}
|
|
208
241
|
function reflow(mutate) {
|
|
209
242
|
for (let i = 0, n = lists.length; i < n; i++) {
|
|
210
243
|
measure(lists[i].container?.children ?? []);
|
|
@@ -223,7 +256,7 @@ function drag(source, item, value, e, { group, onsort }) {
|
|
|
223
256
|
}
|
|
224
257
|
let bounds = parent.getBoundingClientRect(), index = 0, left = bounds.left - parent.scrollLeft, top = bounds.top - parent.scrollTop;
|
|
225
258
|
for (let element of parent.children) {
|
|
226
|
-
if (
|
|
259
|
+
if (element.classList.contains('sortable-item')) {
|
|
227
260
|
elements.push(element);
|
|
228
261
|
places.push({ index: index++, left, list, top });
|
|
229
262
|
}
|
|
@@ -246,6 +279,13 @@ function drag(source, item, value, e, { group, onsort }) {
|
|
|
246
279
|
layout.push(entry);
|
|
247
280
|
}
|
|
248
281
|
}
|
|
282
|
+
function rested(key, now) {
|
|
283
|
+
let rest = pending;
|
|
284
|
+
if (!rest || rest.key !== key || Math.hypot(x - rest.x, y - rest.y) > SLOP) {
|
|
285
|
+
rest = pending = { key, since: now, x, y };
|
|
286
|
+
}
|
|
287
|
+
return now - rest.since >= SETTLE;
|
|
288
|
+
}
|
|
249
289
|
function relocate(target, to) {
|
|
250
290
|
if (target === current) {
|
|
251
291
|
let rest = target.items.filter((v) => v !== value);
|
|
@@ -260,39 +300,59 @@ function drag(source, item, value, e, { group, onsort }) {
|
|
|
260
300
|
target.items.splice(to, 0, value);
|
|
261
301
|
current = target;
|
|
262
302
|
}
|
|
263
|
-
function sort() {
|
|
303
|
+
function sort(now) {
|
|
264
304
|
let slot = hole, target = over();
|
|
265
|
-
if (!
|
|
305
|
+
if (!target) {
|
|
306
|
+
aim(null);
|
|
307
|
+
mark(outside?.over(value, x, y) ?? null);
|
|
308
|
+
pending = null;
|
|
266
309
|
return;
|
|
267
310
|
}
|
|
268
|
-
|
|
311
|
+
mark(null);
|
|
312
|
+
if (!slot) {
|
|
313
|
+
aim(null);
|
|
314
|
+
pending = null;
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
let combine = target.combine;
|
|
318
|
+
if (target !== current && !combine) {
|
|
269
319
|
reflow(() => enter(target));
|
|
270
320
|
return;
|
|
271
321
|
}
|
|
272
|
-
let
|
|
273
|
-
if (left === lastLeft && top === lastTop) {
|
|
322
|
+
let { left, top } = local(target);
|
|
323
|
+
if (left === lastLeft && top === lastTop && !combine) {
|
|
274
324
|
return;
|
|
275
325
|
}
|
|
276
326
|
lastLeft = left;
|
|
277
327
|
lastTop = top;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
let row = rect.top < slot.bottom && rect.bottom > slot.top, depth = row
|
|
289
|
-
? (rect.left > slot.left ? left - rect.left : rect.right - left)
|
|
290
|
-
: (rect.top > slot.top ? top - rect.top : rect.bottom - top), size = row ? rect.right - rect.left : rect.bottom - rect.top;
|
|
291
|
-
if (depth > Math.max(0, (size - (row ? slot.right - slot.left : slot.bottom - slot.top)) / 2) + size * ENTER) {
|
|
292
|
-
reflow(() => relocate(target, rect.index));
|
|
328
|
+
let rect = under(target, left, top);
|
|
329
|
+
if (combine && rect && middle(rect, left, top) && (combine.accepts?.(value, rect.element) ?? true)) {
|
|
330
|
+
aim(rect.element);
|
|
331
|
+
pending = null;
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
aim(null);
|
|
335
|
+
if (target !== current) {
|
|
336
|
+
if (rested(target, now)) {
|
|
337
|
+
reflow(() => enter(target));
|
|
293
338
|
}
|
|
294
339
|
return;
|
|
295
340
|
}
|
|
341
|
+
if (!rect) {
|
|
342
|
+
pending = null;
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
if (combine && !rested(rect.element, now)) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
let row = rect.top < slot.bottom && rect.bottom > slot.top, depth = row
|
|
349
|
+
? (rect.left > slot.left ? left - rect.left : rect.right - left)
|
|
350
|
+
: (rect.top > slot.top ? top - rect.top : rect.bottom - top), size = row ? rect.right - rect.left : rect.bottom - rect.top;
|
|
351
|
+
if (depth > Math.max(0, (size - (row ? slot.right - slot.left : slot.bottom - slot.top)) / 2) + size * ENTER) {
|
|
352
|
+
let index = rect.index;
|
|
353
|
+
pending = null;
|
|
354
|
+
reflow(() => relocate(target, index));
|
|
355
|
+
}
|
|
296
356
|
}
|
|
297
357
|
function tick(now) {
|
|
298
358
|
frame = requestAnimationFrame(tick);
|
|
@@ -303,13 +363,44 @@ function drag(source, item, value, e, { group, onsort }) {
|
|
|
303
363
|
motion.angle = angle;
|
|
304
364
|
motion.x = x - originX;
|
|
305
365
|
motion.y = y - originY;
|
|
306
|
-
sort();
|
|
366
|
+
sort(now);
|
|
367
|
+
}
|
|
368
|
+
function toss(thrown) {
|
|
369
|
+
let ghost = source.ghost, list = current, from = list.items.indexOf(value);
|
|
370
|
+
if (ghost) {
|
|
371
|
+
let fade = timing(getComputedStyle(ghost), 'throw-fade');
|
|
372
|
+
motion.throw = coast(ghost, { ...tracked, directions: ANYWHERE, x: x - originX, y: y - originY })
|
|
373
|
+
?? { duration: fade?.duration ?? 0, easing: fade?.easing ?? 'linear', x: 0, y: 0 };
|
|
374
|
+
flush();
|
|
375
|
+
carry(false);
|
|
376
|
+
}
|
|
377
|
+
reflow(() => {
|
|
378
|
+
list.items.splice(from, 1);
|
|
379
|
+
write(list.held, null);
|
|
380
|
+
});
|
|
381
|
+
void (ghost ? finished(ghost) : Promise.resolve()).then(() => {
|
|
382
|
+
write(source.dragging, null);
|
|
383
|
+
flush();
|
|
384
|
+
carry(false);
|
|
385
|
+
thrown(value, from, list.items);
|
|
386
|
+
onland?.(value);
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
function under(list, left, top) {
|
|
390
|
+
for (let i = 0, n = layout.length; i < n; i++) {
|
|
391
|
+
let rect = layout[i];
|
|
392
|
+
if (rect !== hole && rect.list === list && left >= rect.left && left <= rect.right && top >= rect.top && top <= rect.bottom) {
|
|
393
|
+
return rect;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return null;
|
|
307
397
|
}
|
|
308
398
|
source.press.begin(e, {
|
|
309
399
|
end,
|
|
310
400
|
move: (e) => {
|
|
311
401
|
x = e.clientX;
|
|
312
402
|
y = e.clientY;
|
|
403
|
+
sample(tracked, x - originX, y - originY);
|
|
313
404
|
},
|
|
314
405
|
start: activate
|
|
315
406
|
});
|
|
@@ -337,51 +428,63 @@ function page() {
|
|
|
337
428
|
return state;
|
|
338
429
|
});
|
|
339
430
|
}
|
|
340
|
-
export default (items, template, { drag: copy, group, handle, onsort } = {}) => {
|
|
431
|
+
export default (items, template, { combine, disabled, drag: copy, group, handle, onland, onlift, onsort, onthrow, outside } = {}) => {
|
|
341
432
|
let list = {
|
|
433
|
+
combine,
|
|
342
434
|
dragging: signal(null),
|
|
343
435
|
held: signal(null),
|
|
344
436
|
items,
|
|
345
|
-
motion:
|
|
437
|
+
motion: reactivity_u0.reactive({ angle: 0, dropping: false, height: 0, left: 0, origin: '', radius: '', throw: null, top: 0, width: 0, x: 0, y: 0 }),
|
|
346
438
|
press: press(DELAY),
|
|
347
439
|
revealing: signal(null)
|
|
348
440
|
};
|
|
349
441
|
function ghost(item) {
|
|
350
442
|
let motion = list.motion;
|
|
351
443
|
{
|
|
352
|
-
let
|
|
353
|
-
template_u1.slot(
|
|
354
|
-
template_u1.onconnect(
|
|
444
|
+
let root_17lqxwv1 = template_17lqxwv2();
|
|
445
|
+
template_u1.slot(root_17lqxwv1, copy ? copy(item) : template(item, {}), 1);
|
|
446
|
+
template_u1.onconnect(root_17lqxwv1, (element) => {
|
|
355
447
|
list.ghost = element;
|
|
356
448
|
element.showPopover();
|
|
357
449
|
});
|
|
358
|
-
template_u1.delegate(
|
|
450
|
+
template_u1.delegate(root_17lqxwv1, 'transitionstart', (e) => {
|
|
359
451
|
if (e.target === e.currentTarget && e.propertyName === 'opacity') {
|
|
360
452
|
list.reveal?.();
|
|
361
453
|
}
|
|
362
454
|
});
|
|
363
|
-
template_u1.setClass(
|
|
364
|
-
template_u1.setStyle(
|
|
455
|
+
template_u1.setClass(root_17lqxwv1, ["sortable-drag", [() => motion.dropping && 'sortable-drag--dropping', () => motion.throw && 'sortable-drag--thrown']]);
|
|
456
|
+
template_u1.setStyle(root_17lqxwv1, ["", [
|
|
365
457
|
() => `--sortable-height: ${motion.height}px; --sortable-left: ${motion.left}px; --sortable-origin: ${motion.origin}; --sortable-radius: ${motion.radius}; --sortable-top: ${motion.top}px; --sortable-width: ${motion.width}px;`,
|
|
366
|
-
() => `--sortable-angle: ${motion.angle}deg; --sortable-x: ${motion.x}px; --sortable-y: ${motion.y}px
|
|
458
|
+
() => `--sortable-angle: ${motion.angle}deg; --sortable-x: ${motion.x}px; --sortable-y: ${motion.y}px;`,
|
|
459
|
+
() => motion.throw && `--sortable-throw-duration: ${motion.throw.duration}ms; --sortable-throw-easing: ${motion.throw.easing}; --sortable-throw-x: ${motion.throw.x}px; --sortable-throw-y: ${motion.throw.y}px;`
|
|
367
460
|
]]);
|
|
368
|
-
return
|
|
461
|
+
return root_17lqxwv1;
|
|
369
462
|
}
|
|
370
463
|
}
|
|
371
464
|
function hold(item) {
|
|
372
465
|
return {
|
|
373
|
-
class:
|
|
374
|
-
|
|
375
|
-
|
|
466
|
+
class: [
|
|
467
|
+
'sortable-item',
|
|
468
|
+
() => signal.selector(list.held, item)
|
|
469
|
+
? 'sortable-item--held'
|
|
470
|
+
: signal.selector(list.revealing, item) && 'sortable-item--revealing'
|
|
471
|
+
],
|
|
376
472
|
onpointerdown: (e) => {
|
|
377
473
|
let element = e.currentTarget;
|
|
378
|
-
if (e.button !== 0 || !e.isPrimary || list.press.busy() || read(list.dragging) !== null) {
|
|
474
|
+
if (e.button !== 0 || !e.isPrimary || list.press.busy() || read(list.dragging) !== null || disabled?.(item)) {
|
|
379
475
|
return;
|
|
380
476
|
}
|
|
381
477
|
if (handle && !element.contains(e.target.closest(handle))) {
|
|
382
478
|
return;
|
|
383
479
|
}
|
|
384
|
-
drag(list, element, item, e, {
|
|
480
|
+
drag(list, element, item, e, {
|
|
481
|
+
group,
|
|
482
|
+
onland: onland,
|
|
483
|
+
onlift: onlift,
|
|
484
|
+
onsort: onsort,
|
|
485
|
+
onthrow: onthrow,
|
|
486
|
+
outside: outside
|
|
487
|
+
});
|
|
385
488
|
}
|
|
386
489
|
};
|
|
387
490
|
}
|
|
@@ -413,17 +516,17 @@ export default (items, template, { drag: copy, group, handle, onsort } = {}) =>
|
|
|
413
516
|
}
|
|
414
517
|
}],
|
|
415
518
|
render: () => {
|
|
416
|
-
let
|
|
417
|
-
|
|
418
|
-
let
|
|
419
|
-
template_u1.slot(
|
|
420
|
-
return
|
|
421
|
-
}).fragment,
|
|
422
|
-
new template_u1.EffectSlot(
|
|
519
|
+
let root_17lqxwv3 = template_17lqxwv4(), element_17lqxwv5 = root_17lqxwv3.firstChild, element_17lqxwv6 = element_17lqxwv5.nextSibling;
|
|
520
|
+
element_17lqxwv5.parentNode.insertBefore(new template_u1.ArraySlot(items, (item) => {
|
|
521
|
+
let root_17lqxwv7 = template_17lqxwv8(), element_17lqxwv9 = root_17lqxwv7.firstChild;
|
|
522
|
+
template_u1.slot(element_17lqxwv9, template(item, hold(item)));
|
|
523
|
+
return root_17lqxwv7;
|
|
524
|
+
}).fragment, element_17lqxwv5);
|
|
525
|
+
new template_u1.EffectSlot(element_17lqxwv6, () => {
|
|
423
526
|
let item = read(list.dragging);
|
|
424
527
|
return item !== null && ghost(item);
|
|
425
528
|
});
|
|
426
|
-
return
|
|
529
|
+
return root_17lqxwv3;
|
|
427
530
|
}
|
|
428
531
|
};
|
|
429
532
|
};
|