@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,21 +1,19 @@
|
|
|
1
1
|
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
|
-
import { effect, flush, onCleanup, read, root, signal, untrack, write } from '@esportsplus/reactivity';
|
|
2
|
+
import { computed, effect, flush, onCleanup, read, root, signal, untrack, write } from '@esportsplus/reactivity';
|
|
3
3
|
import * as template_u1 from '@esportsplus/template';
|
|
4
4
|
import { component } from '@esportsplus/template';
|
|
5
5
|
import breadcrumb from '../../breadcrumb/index.js';
|
|
6
|
-
import sidebar from '../../button/sidebar.js';
|
|
7
6
|
import command from '../../command/index.js';
|
|
8
7
|
import fileTree, { FileTreeDecorations, FileTreeEditor, FileTreeElements, fileTreeIcon } from '../tree/index.js';
|
|
9
|
-
import highlight from '../../highlight/index.js';
|
|
10
8
|
import icon from '../../icon/index.js';
|
|
11
9
|
import input from '../../input/index.js';
|
|
12
10
|
import nav from '../../nav/index.js';
|
|
13
11
|
import overlay from '../../overlay/index.js';
|
|
12
|
+
import shell from '../../shell/index.js';
|
|
13
|
+
import { findSurfaceGroup } from '../../shell/model.js';
|
|
14
14
|
import tooltip from '../../tooltip/index.js';
|
|
15
|
-
import scrollbar from '../../../modifiers/scrollbar/index.js';
|
|
16
15
|
import fuzzy from '../../../shared/fuzzy.js';
|
|
17
16
|
import { mac } from '../../../shared/platform.js';
|
|
18
|
-
import { observe } from '../../../shared/resize.js';
|
|
19
17
|
import codeEditor from '../code/editor.js';
|
|
20
18
|
import { label as chordLabel, declare, merge, sequence } from './keybindings.js';
|
|
21
19
|
import { EditorWorkspaceModel } from './model.js';
|
|
@@ -24,10 +22,8 @@ import hosted from './session.js';
|
|
|
24
22
|
import shortcuts, { OPEN, PALETTE } from './shortcuts.js';
|
|
25
23
|
import statusbar from './statusbar.js';
|
|
26
24
|
import tabStrip from './strip.js';
|
|
27
|
-
import
|
|
28
|
-
import right from '@esportsplus/ui/svg/arrow-right.svg';
|
|
25
|
+
import arrow from '@esportsplus/ui/svg/arrow.svg';
|
|
29
26
|
import collapse from '@esportsplus/ui/svg/chevrons-up-down.svg';
|
|
30
|
-
import close from '@esportsplus/ui/svg/close.svg';
|
|
31
27
|
import cmd from '@esportsplus/ui/svg/command.svg';
|
|
32
28
|
import wrap from '@esportsplus/ui/svg/corner-down-right.svg';
|
|
33
29
|
import whitespace from '@esportsplus/ui/svg/eye.svg';
|
|
@@ -35,17 +31,16 @@ import save from '@esportsplus/ui/svg/save.svg';
|
|
|
35
31
|
import magnifier from '@esportsplus/ui/svg/search.svg';
|
|
36
32
|
import undo from '@esportsplus/ui/svg/undo.svg';
|
|
37
33
|
const template_0vs726u6 = template_u1.template(`<!--$--><!--$-->`);
|
|
38
|
-
const template_0vs726ua = template_u1.template(`<div class='code-workspace-
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const template_0vs726u1s = template_u1.template(`<h2 class='code-workspace-confirm-title'>Save unsaved changes?</h2><p class='code-workspace-confirm-files'></p><p class='code-workspace-confirm-text'></p><div class='code-workspace-confirm-actions'><button autofocus class='button code-workspace-confirm-button' type='button'> Cancel </button><button class='button code-workspace-confirm-button' type='button'> Discard </button><button class='button code-workspace-confirm-button code-workspace-confirm-button--primary' type='button'> Save `);
|
|
34
|
+
const template_0vs726ua = template_u1.template(`<div class='code-workspace-explorer'><div class='code-workspace-explorer-header'><!--$--><!--$--><!--$--><!--$--></div><div class='code-workspace-tree'><!--$-->`, true);
|
|
35
|
+
const template_0vs726ui = template_u1.template(`<div class='code-workspace-notice'>No files in this workspace`, true);
|
|
36
|
+
const template_0vs726uk = template_u1.template(`<div class='code-workspace-notice code-workspace-notice--cover' role='alert'><!--$--><button class='button code-workspace-retry' type='button'> Retry `, true);
|
|
37
|
+
const template_0vs726un = template_u1.template(`<div class='code-workspace-notice code-workspace-notice--cover' role='status'>Loading…`, true);
|
|
38
|
+
const template_0vs726up = template_u1.template(`<div class='code-workspace-pane'><div class='code-workspace-bar'><!--$--><div class='code-workspace-actions'><!--$--><!--$--></div></div><div class='code-workspace-editor'>`, true);
|
|
39
|
+
const template_0vs726ux = template_u1.template(`<button type='button'>`, true);
|
|
40
|
+
const template_0vs726uz = template_u1.template(`<section aria-label='Editor workspace'><!--$--><footer class='code-workspace-status'><span class='code-workspace-status-path'></span><span class='code-workspace-status-position'></span><!--$--><span aria-live='polite' role='status'></span></footer><div popover='manual'><!--$--></div><!--$--><!--$-->`, true);
|
|
41
|
+
const template_0vs726u1b = template_u1.template(`<div class='code-workspace-empty'> Open a file from the explorer or press <span class='code-workspace-keys'>`, true);
|
|
42
|
+
const template_0vs726u1e = template_u1.template(`<kbd class='button button--kbd'>`, true);
|
|
43
|
+
const template_0vs726u1g = template_u1.template(`<h2 class='code-workspace-confirm-title'>Save unsaved changes?</h2><p class='code-workspace-confirm-files'></p><p class='code-workspace-confirm-text'></p><div class='code-workspace-confirm-actions'><button autofocus class='button code-workspace-confirm-button' type='button'> Cancel </button><button class='button code-workspace-confirm-button' type='button'> Discard </button><button class='button code-workspace-confirm-button code-workspace-confirm-button--primary' type='button'> Save `);
|
|
49
44
|
class ReactiveObject_0vs726u0 extends reactivity_u0.ReactiveObject {
|
|
50
45
|
#active = this[reactivity_u0.SIGNAL](false);
|
|
51
46
|
constructor() {
|
|
@@ -125,59 +120,44 @@ class ReactiveObject_0vs726u3 extends reactivity_u0.ReactiveObject {
|
|
|
125
120
|
}
|
|
126
121
|
}
|
|
127
122
|
class ReactiveObject_0vs726u4 extends reactivity_u0.ReactiveObject {
|
|
128
|
-
#compact = this[reactivity_u0.SIGNAL](false);
|
|
129
|
-
#peek = this[reactivity_u0.SIGNAL](false);
|
|
130
123
|
#position = this[reactivity_u0.SIGNAL]('');
|
|
131
|
-
#ready = this[reactivity_u0.SIGNAL](false);
|
|
132
124
|
#search = this[reactivity_u0.SIGNAL]('');
|
|
133
125
|
constructor() {
|
|
134
126
|
super(null);
|
|
135
127
|
}
|
|
136
|
-
get compact() {
|
|
137
|
-
return reactivity_u0.read(this.#compact);
|
|
138
|
-
}
|
|
139
|
-
set compact(_v0) {
|
|
140
|
-
reactivity_u0.write(this.#compact, _v0);
|
|
141
|
-
}
|
|
142
|
-
get peek() {
|
|
143
|
-
return reactivity_u0.read(this.#peek);
|
|
144
|
-
}
|
|
145
|
-
set peek(_v1) {
|
|
146
|
-
reactivity_u0.write(this.#peek, _v1);
|
|
147
|
-
}
|
|
148
128
|
get position() {
|
|
149
129
|
return reactivity_u0.read(this.#position);
|
|
150
130
|
}
|
|
151
|
-
set position(
|
|
152
|
-
reactivity_u0.write(this.#position,
|
|
153
|
-
}
|
|
154
|
-
get ready() {
|
|
155
|
-
return reactivity_u0.read(this.#ready);
|
|
156
|
-
}
|
|
157
|
-
set ready(_v3) {
|
|
158
|
-
reactivity_u0.write(this.#ready, _v3);
|
|
131
|
+
set position(_v0) {
|
|
132
|
+
reactivity_u0.write(this.#position, _v0);
|
|
159
133
|
}
|
|
160
134
|
get search() {
|
|
161
135
|
return reactivity_u0.read(this.#search);
|
|
162
136
|
}
|
|
163
|
-
set search(
|
|
164
|
-
reactivity_u0.write(this.#search,
|
|
137
|
+
set search(_v1) {
|
|
138
|
+
reactivity_u0.write(this.#search, _v1);
|
|
165
139
|
}
|
|
166
140
|
}
|
|
167
|
-
const
|
|
141
|
+
const NARROW = 520;
|
|
168
142
|
let uid = 0;
|
|
169
|
-
function control({ active, disabled, label, onclick, sprite }) {
|
|
143
|
+
function control({ active, direction, disabled, label, onclick, sprite }) {
|
|
170
144
|
{
|
|
171
|
-
let
|
|
172
|
-
new template_u1.EffectSlot(
|
|
173
|
-
template_u1.setProperty(
|
|
174
|
-
template_u1.setProperty(
|
|
175
|
-
template_u1.setProperty(
|
|
176
|
-
template_u1.delegate(
|
|
177
|
-
template_u1.setProperty(
|
|
178
|
-
template_u1.setClass(
|
|
179
|
-
return
|
|
145
|
+
let root_0vs726uw = template_0vs726ux();
|
|
146
|
+
new template_u1.EffectSlot(root_0vs726uw, () => icon({ 'aria-hidden': 'true', class: ['code-workspace-control-icon', direction?.() ?? ''] }, typeof sprite === 'string' ? sprite : sprite()), 1);
|
|
147
|
+
template_u1.setProperty(root_0vs726uw, 'aria-label', label);
|
|
148
|
+
template_u1.setProperty(root_0vs726uw, 'aria-pressed', active && (() => (active() ? 'true' : 'false')));
|
|
149
|
+
template_u1.setProperty(root_0vs726uw, 'disabled', disabled);
|
|
150
|
+
template_u1.delegate(root_0vs726uw, 'click', onclick);
|
|
151
|
+
template_u1.setProperty(root_0vs726uw, 'title', label);
|
|
152
|
+
template_u1.setClass(root_0vs726uw, ["button code-workspace-control", active && (() => active() && '--active')]);
|
|
153
|
+
return root_0vs726uw;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function glyph(sprite) {
|
|
157
|
+
if (typeof sprite === 'string') {
|
|
158
|
+
return icon({ 'aria-hidden': 'true', class: 'code-workspace-command-icon' }, sprite);
|
|
180
159
|
}
|
|
160
|
+
return icon({ 'aria-hidden': 'true', class: ['code-workspace-command-icon', sprite.class] }, sprite.href);
|
|
181
161
|
}
|
|
182
162
|
function keys(names) {
|
|
183
163
|
let apple = mac();
|
|
@@ -221,7 +201,7 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
221
201
|
if (!supplied && !host) {
|
|
222
202
|
throw new Error('Workspace: editor.workspace requires a WorkspaceHost or EditorWorkspaceModel');
|
|
223
203
|
}
|
|
224
|
-
let actions,
|
|
204
|
+
let actions, chords = sequence({
|
|
225
205
|
accept: (event) => !confirmation && !!container?.contains(event.target),
|
|
226
206
|
actions: { [OPEN[1]]: () => openKeybindings() },
|
|
227
207
|
apple: mac(),
|
|
@@ -235,19 +215,22 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
235
215
|
}
|
|
236
216
|
},
|
|
237
217
|
prefix: OPEN[0]
|
|
238
|
-
}), confirmation, container, decorated = new Map(), decorations = new FileTreeDecorations(), dialog = new ReactiveObject_0vs726u0(),
|
|
218
|
+
}), confirmation, container, decorated = new Map(), decorations = new FileTreeDecorations(), dialog = new ReactiveObject_0vs726u0(), files = signal([]), focusing, id = `code-workspace-${++uid}`, keyboard = new ReactiveObject_0vs726u1(), model = supplied ?? new EditorWorkspaceModel(host, cwd), mounts = new Map(), palette = new ReactiveObject_0vs726u2('all'), release, request = signal(undefined), returnFocus, revealed = 0, searchField, remounts = new Map(), settle, statusBar = statusbar(model, () => navigation.go('problem')), strip = tabStrip({
|
|
239
219
|
isFile: (path) => treeStore.get(path)?.type === 'file',
|
|
240
220
|
model,
|
|
241
|
-
remount,
|
|
221
|
+
remount: (tab) => remounts.get(tab)?.(),
|
|
242
222
|
reveal: (path) => {
|
|
243
|
-
|
|
223
|
+
explore();
|
|
244
224
|
treeState.selected = '';
|
|
245
225
|
flush();
|
|
246
226
|
treeState.selected = path;
|
|
247
227
|
}
|
|
248
228
|
}), target = signal(undefined), tree, treeEditor = new FileTreeEditor(), treeState = new ReactiveObject_0vs726u3(new Set()), treeStore = new FileTreeElements([]), ui = new ReactiveObject_0vs726u4();
|
|
249
|
-
let
|
|
250
|
-
bindings: () =>
|
|
229
|
+
let active = computed(() => model.state.active), hosting = hosted(model, (tab) => mounts.get(tab)?.controller), navigation = navigate({
|
|
230
|
+
bindings: () => {
|
|
231
|
+
let tab = read(active);
|
|
232
|
+
return tab && mounts.has(tab) ? settings(tab, tab.path).keybindings : model.state.preferences.keybindings;
|
|
233
|
+
},
|
|
251
234
|
hosting,
|
|
252
235
|
model,
|
|
253
236
|
tree: () => tree
|
|
@@ -258,9 +241,6 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
258
241
|
get canUndo() {
|
|
259
242
|
return model.state.canUndoFiles;
|
|
260
243
|
},
|
|
261
|
-
get collapsed() {
|
|
262
|
-
return model.state.tabs.length > 0 && !model.state.preferences.explorerOpen;
|
|
263
|
-
},
|
|
264
244
|
get cwd() {
|
|
265
245
|
return model.state.cwd;
|
|
266
246
|
},
|
|
@@ -277,7 +257,7 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
277
257
|
return model.state.loaded;
|
|
278
258
|
},
|
|
279
259
|
get path() {
|
|
280
|
-
let tab =
|
|
260
|
+
let tab = read(active);
|
|
281
261
|
return tab && !tab.compare ? tab.path : '';
|
|
282
262
|
},
|
|
283
263
|
get project() {
|
|
@@ -292,16 +272,13 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
292
272
|
? 'Working…'
|
|
293
273
|
: state.loading
|
|
294
274
|
? 'Refreshing…'
|
|
295
|
-
:
|
|
275
|
+
: read(active)?.missing
|
|
296
276
|
? 'File removed from disk; draft retained'
|
|
297
277
|
: '');
|
|
298
278
|
},
|
|
299
279
|
get statusError() {
|
|
300
280
|
return !!model.state.status && model.state.statusKind === 'error';
|
|
301
281
|
},
|
|
302
|
-
get tabs() {
|
|
303
|
-
return model.state.tabs.length > 0;
|
|
304
|
-
},
|
|
305
282
|
get whitespace() {
|
|
306
283
|
return model.state.preferences.showWhitespace;
|
|
307
284
|
},
|
|
@@ -340,7 +317,6 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
340
317
|
function attach(current) {
|
|
341
318
|
let controller = current.controller;
|
|
342
319
|
detach(current);
|
|
343
|
-
statusBar.attach(controller);
|
|
344
320
|
write(current.path, current.tab.path);
|
|
345
321
|
if (!addons || !controller) {
|
|
346
322
|
return;
|
|
@@ -371,9 +347,6 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
371
347
|
release?.();
|
|
372
348
|
container = element;
|
|
373
349
|
release = root((dispose) => {
|
|
374
|
-
let unobserve = observe(element, ([entry]) => {
|
|
375
|
-
ui.compact = entry.contentRect.width <= COMPACT_WIDTH;
|
|
376
|
-
});
|
|
377
350
|
onCleanup(on(element.ownerDocument, 'keydown', chords.keydown, { capture: true }));
|
|
378
351
|
onCleanup(on(element, 'close', () => {
|
|
379
352
|
let next = settle;
|
|
@@ -386,12 +359,11 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
386
359
|
onCleanup(statusBar.connect());
|
|
387
360
|
onCleanup(() => {
|
|
388
361
|
chords.cancel();
|
|
389
|
-
unobserve();
|
|
390
362
|
confirmation?.resolve('cancel');
|
|
391
363
|
model.setConfirmation(undefined);
|
|
392
364
|
model.stop();
|
|
393
|
-
|
|
394
|
-
unmount(
|
|
365
|
+
for (let current of [...mounts.values()]) {
|
|
366
|
+
unmount(current);
|
|
395
367
|
}
|
|
396
368
|
container = undefined;
|
|
397
369
|
release = undefined;
|
|
@@ -410,36 +382,34 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
410
382
|
});
|
|
411
383
|
});
|
|
412
384
|
effect(() => {
|
|
413
|
-
let tab =
|
|
414
|
-
|
|
415
|
-
untrack(() => show(tab));
|
|
385
|
+
let tab = read(active);
|
|
386
|
+
untrack(() => statusBar.attach(tab && mounts.get(tab)?.controller));
|
|
416
387
|
});
|
|
417
388
|
effect(() => {
|
|
418
389
|
let path = view.path;
|
|
419
390
|
untrack(() => {
|
|
420
391
|
treeState.selected = path;
|
|
421
|
-
if (mount && mount.tab === model.state.active && read(mount.path) !== path) {
|
|
422
|
-
attach(mount);
|
|
423
|
-
}
|
|
424
392
|
});
|
|
425
393
|
});
|
|
426
394
|
effect(() => {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
395
|
+
let open = model.layout.layout[untrack(() => model.state.preferences.explorerSide)].open;
|
|
396
|
+
untrack(() => {
|
|
397
|
+
if (open !== model.state.preferences.explorerOpen) {
|
|
398
|
+
model.setPreferences({ explorerOpen: open });
|
|
399
|
+
}
|
|
400
|
+
});
|
|
431
401
|
});
|
|
432
402
|
effect(() => {
|
|
433
403
|
let tabs = model.state.tabs.map((tab) => [tab.path, tab.dirty]);
|
|
434
404
|
untrack(() => decorate(tabs));
|
|
435
405
|
});
|
|
436
406
|
effect(() => {
|
|
437
|
-
|
|
407
|
+
read(active);
|
|
438
408
|
model.state.reveal;
|
|
439
409
|
untrack(reveal);
|
|
440
410
|
});
|
|
441
411
|
effect(() => {
|
|
442
|
-
let tab =
|
|
412
|
+
let tab = read(active);
|
|
443
413
|
if (!tab || tab.compare) {
|
|
444
414
|
ui.position = '';
|
|
445
415
|
return;
|
|
@@ -459,7 +429,7 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
459
429
|
let path = treeState.selected;
|
|
460
430
|
if (path && treeStore.get(path)?.type === 'file') {
|
|
461
431
|
untrack(() => {
|
|
462
|
-
if (path !==
|
|
432
|
+
if (path !== read(active)?.path) {
|
|
463
433
|
void model.open(path, undefined, undefined, true);
|
|
464
434
|
}
|
|
465
435
|
});
|
|
@@ -482,11 +452,11 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
482
452
|
return dispose;
|
|
483
453
|
});
|
|
484
454
|
}
|
|
485
|
-
function crumbs() {
|
|
486
|
-
|
|
487
|
-
if (!path) {
|
|
455
|
+
function crumbs(tab) {
|
|
456
|
+
if (tab.compare) {
|
|
488
457
|
return '';
|
|
489
458
|
}
|
|
459
|
+
let path = tab.path;
|
|
490
460
|
let parts = path.split('/'), project = view.project, items = [];
|
|
491
461
|
if (project) {
|
|
492
462
|
items.push({ href: '#', label: project });
|
|
@@ -498,7 +468,7 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
498
468
|
class: 'code-workspace-breadcrumb',
|
|
499
469
|
items,
|
|
500
470
|
label: 'File path',
|
|
501
|
-
onnavigate: (item) => locate(item.href.slice(1)),
|
|
471
|
+
onnavigate: (item) => locate(item.href.slice(1), path),
|
|
502
472
|
separator: 'chevron'
|
|
503
473
|
});
|
|
504
474
|
}
|
|
@@ -529,18 +499,154 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
529
499
|
model.status(`Editor addon failed: ${String(error)}`, true);
|
|
530
500
|
}
|
|
531
501
|
}
|
|
502
|
+
function explore() {
|
|
503
|
+
if (!model.state.preferences.explorerOpen) {
|
|
504
|
+
model.setPreferences({ explorerOpen: true });
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
function explorer() {
|
|
508
|
+
{
|
|
509
|
+
let root_0vs726u9 = template_0vs726ua(), element_0vs726ub = root_0vs726u9.firstElementChild, element_0vs726uc = element_0vs726ub.firstChild, element_0vs726ud = element_0vs726uc.nextSibling, element_0vs726ue = element_0vs726ud.nextSibling, element_0vs726uf = element_0vs726ue.nextSibling, element_0vs726ug = element_0vs726ub.nextElementSibling.firstChild, element_0vs726uh = element_0vs726ub.nextElementSibling;
|
|
510
|
+
template_u1.slot(element_0vs726uc, control({
|
|
511
|
+
direction: () => (view.left ? '' : 'icon--left'),
|
|
512
|
+
label: () => (view.left ? 'Move file explorer to right' : 'Move file explorer to left'),
|
|
513
|
+
onclick: () => api.toggleExplorerSide(),
|
|
514
|
+
sprite: arrow
|
|
515
|
+
}));
|
|
516
|
+
template_u1.slot(element_0vs726ud, control({ label: 'Collapse all folders', onclick: () => api.collapseAll(), sprite: collapse }));
|
|
517
|
+
template_u1.slot(element_0vs726ue, control({
|
|
518
|
+
disabled: () => !view.canUndo || view.busy,
|
|
519
|
+
label: 'Undo file operation',
|
|
520
|
+
onclick: () => {
|
|
521
|
+
void model.undoFiles();
|
|
522
|
+
},
|
|
523
|
+
sprite: undo
|
|
524
|
+
}));
|
|
525
|
+
template_u1.slot(element_0vs726uf, control({ label: label('Go to file', ['Mod', 'P']), onclick: () => quickOpen(), sprite: magnifier }));
|
|
526
|
+
template_u1.slot(element_0vs726ub, input({
|
|
527
|
+
'aria-label': 'Search files',
|
|
528
|
+
autocomplete: 'off',
|
|
529
|
+
class: 'code-workspace-search',
|
|
530
|
+
onconnect: (element) => {
|
|
531
|
+
searchField = element;
|
|
532
|
+
},
|
|
533
|
+
oninput: (event) => search(event.target.value),
|
|
534
|
+
placeholder: 'Search files',
|
|
535
|
+
spellcheck: false,
|
|
536
|
+
type: 'search',
|
|
537
|
+
value: () => ui.search
|
|
538
|
+
}), 1);
|
|
539
|
+
new template_u1.EffectSlot(element_0vs726ug, () => hosting.ready() && untrack(() => fileTree({
|
|
540
|
+
class: 'code-workspace-files',
|
|
541
|
+
compact: true,
|
|
542
|
+
controller: (value) => {
|
|
543
|
+
tree = value;
|
|
544
|
+
value.search(ui.search);
|
|
545
|
+
},
|
|
546
|
+
decorations: [hosting.marks, ...[provided ?? []].flat(), decorations],
|
|
547
|
+
editor: treeEditor,
|
|
548
|
+
elements: treeStore,
|
|
549
|
+
empty: () => template_0vs726ui(),
|
|
550
|
+
export: hosting.export,
|
|
551
|
+
find: 'filter',
|
|
552
|
+
menu: (elements, position) => {
|
|
553
|
+
if (!elements.length || !actions) {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
write(target, { element: elements[0], paths: elements.map((element) => element.id) });
|
|
557
|
+
flush();
|
|
558
|
+
actions.open(position);
|
|
559
|
+
},
|
|
560
|
+
open: (element, open) => {
|
|
561
|
+
void model.open(element.id, undefined, undefined, open.mode === 'preview');
|
|
562
|
+
},
|
|
563
|
+
operations: {
|
|
564
|
+
delete: (elements) => {
|
|
565
|
+
void model.delete(elements.map((element) => element.id));
|
|
566
|
+
},
|
|
567
|
+
import: hosting.import
|
|
568
|
+
},
|
|
569
|
+
preview: 'immediate',
|
|
570
|
+
rename: async (element, value) => {
|
|
571
|
+
let parent = element.id.includes('/') ? element.id.slice(0, element.id.lastIndexOf('/') + 1) : '';
|
|
572
|
+
if (!(await model.rename(element.id, parent + value))) {
|
|
573
|
+
throw new Error(`Workspace: ${model.state.status}`);
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
searched: (query) => {
|
|
577
|
+
ui.search = query;
|
|
578
|
+
},
|
|
579
|
+
snapshot: hosting.explorer,
|
|
580
|
+
state: treeState,
|
|
581
|
+
typing: 'typeahead'
|
|
582
|
+
})));
|
|
583
|
+
new template_u1.EffectSlot(element_0vs726uh, () => {
|
|
584
|
+
if (view.error) {
|
|
585
|
+
{
|
|
586
|
+
let root_0vs726uj = template_0vs726uk(), element_0vs726ul = root_0vs726uj.firstChild, element_0vs726um = root_0vs726uj.firstElementChild;
|
|
587
|
+
template_u1.slot(element_0vs726ul, view.error);
|
|
588
|
+
template_u1.delegate(element_0vs726um, 'click', () => {
|
|
589
|
+
void model.refresh();
|
|
590
|
+
});
|
|
591
|
+
return root_0vs726uj;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
return !view.loaded && template_0vs726un();
|
|
595
|
+
}, 1);
|
|
596
|
+
return root_0vs726u9;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
function file(surface) {
|
|
600
|
+
let tab = model.find(surface.id);
|
|
601
|
+
if (!tab) {
|
|
602
|
+
return '';
|
|
603
|
+
}
|
|
604
|
+
let again = signal(0), owner = tab, visible = computed(() => findSurfaceGroup(model.layout.layout.root, surface.id)?.active === surface.id);
|
|
605
|
+
remounts.set(owner, () => write(again, untrack(() => read(again)) + 1));
|
|
606
|
+
onCleanup(() => remounts.delete(owner));
|
|
607
|
+
{
|
|
608
|
+
let root_0vs726uo = template_0vs726up(), element_0vs726uq = root_0vs726uo.firstElementChild, element_0vs726ur = element_0vs726uq.firstChild, element_0vs726us = element_0vs726uq.firstElementChild.firstChild, element_0vs726ut = element_0vs726us.nextSibling, element_0vs726uu = element_0vs726uq.firstElementChild, element_0vs726uv = element_0vs726uq.nextElementSibling;
|
|
609
|
+
new template_u1.EffectSlot(element_0vs726ur, () => crumbs(owner));
|
|
610
|
+
new template_u1.EffectSlot(element_0vs726us, statusBar.save(() => control({
|
|
611
|
+
disabled: () => !!owner.compare || view.busy,
|
|
612
|
+
label: label('Save file', ['Mod', 'S']),
|
|
613
|
+
onclick: () => {
|
|
614
|
+
void model.save(owner);
|
|
615
|
+
},
|
|
616
|
+
sprite: save
|
|
617
|
+
})));
|
|
618
|
+
template_u1.slot(element_0vs726ut, control({
|
|
619
|
+
active: () => view.wrap,
|
|
620
|
+
label: () => (view.wrap ? 'Disable wrap' : 'Wrap long lines'),
|
|
621
|
+
onclick: () => api.toggleWrap(),
|
|
622
|
+
sprite: wrap
|
|
623
|
+
}));
|
|
624
|
+
template_u1.slot(element_0vs726uu, control({
|
|
625
|
+
active: () => view.whitespace,
|
|
626
|
+
label: () => (view.whitespace ? 'Hide whitespace' : 'Show whitespace'),
|
|
627
|
+
onclick: () => api.toggleWhitespace(),
|
|
628
|
+
sprite: whitespace
|
|
629
|
+
}), 1);
|
|
630
|
+
new template_u1.EffectSlot(element_0vs726uv, () => {
|
|
631
|
+
read(again);
|
|
632
|
+
return read(visible) && pane(owner);
|
|
633
|
+
}, 1);
|
|
634
|
+
return root_0vs726uo;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
532
637
|
function focusEditor() {
|
|
533
|
-
let tab =
|
|
534
|
-
focusing =
|
|
638
|
+
let tab = untrack(() => read(active));
|
|
639
|
+
focusing = undefined;
|
|
535
640
|
if (!tab) {
|
|
536
641
|
searchField?.focus();
|
|
537
642
|
return;
|
|
538
643
|
}
|
|
539
|
-
|
|
540
|
-
|
|
644
|
+
let controller = mounts.get(tab)?.controller;
|
|
645
|
+
if (controller) {
|
|
646
|
+
controller.focus();
|
|
541
647
|
return;
|
|
542
648
|
}
|
|
543
|
-
focusing =
|
|
649
|
+
focusing = tab;
|
|
544
650
|
}
|
|
545
651
|
function keydown(event) {
|
|
546
652
|
if (event.defaultPrevented || event.isComposing || !container || confirmation) {
|
|
@@ -567,19 +673,14 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
567
673
|
event.preventDefault();
|
|
568
674
|
void model.undoFiles();
|
|
569
675
|
}
|
|
570
|
-
else if (key === 'escape' && ui.peek) {
|
|
571
|
-
event.preventDefault();
|
|
572
|
-
peek(false);
|
|
573
|
-
focusEditor();
|
|
574
|
-
}
|
|
575
676
|
}
|
|
576
|
-
function locate(path) {
|
|
577
|
-
|
|
677
|
+
function locate(path, from) {
|
|
678
|
+
explore();
|
|
578
679
|
if (!path) {
|
|
579
680
|
tree?.collapseAll();
|
|
580
681
|
return;
|
|
581
682
|
}
|
|
582
|
-
if (path !==
|
|
683
|
+
if (path !== from) {
|
|
583
684
|
treeState.selected = path;
|
|
584
685
|
}
|
|
585
686
|
}
|
|
@@ -587,20 +688,8 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
587
688
|
palette.active = false;
|
|
588
689
|
keyboard.active = true;
|
|
589
690
|
}
|
|
590
|
-
function pane() {
|
|
591
|
-
let
|
|
592
|
-
if (!next) {
|
|
593
|
-
{
|
|
594
|
-
let root_0vs726u9 = template_0vs726ua(), element_0vs726ub = root_0vs726u9.firstElementChild;
|
|
595
|
-
template_u1.slot(element_0vs726ub, keys(['Mod', 'P']).map((key) => {
|
|
596
|
-
let root_0vs726uc = template_0vs726ud();
|
|
597
|
-
template_u1.slot(root_0vs726uc, key === '⌘' ? icon({ 'aria-hidden': 'true', class: 'button-kbd-icon' }, cmd) : key, 1);
|
|
598
|
-
return root_0vs726uc;
|
|
599
|
-
}), 1);
|
|
600
|
-
return root_0vs726u9;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
let current = next.released ? { editor: next.editor, path: signal(next.tab.path), released: false, tab: next.tab } : next, bound = {
|
|
691
|
+
function pane(tab) {
|
|
692
|
+
let current = { editor: strip.editor(tab) ?? editorFor?.(tab) ?? codeEditor, path: signal(tab.path), released: false, tab }, bound = {
|
|
604
693
|
class: 'code-workspace-document',
|
|
605
694
|
controller: (controller) => {
|
|
606
695
|
if (current.released) {
|
|
@@ -609,9 +698,12 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
609
698
|
current.controller = controller;
|
|
610
699
|
restore(current);
|
|
611
700
|
attach(current);
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
701
|
+
if (untrack(() => read(active)) === tab) {
|
|
702
|
+
statusBar.attach(controller);
|
|
703
|
+
reveal();
|
|
704
|
+
}
|
|
705
|
+
if (focusing === tab) {
|
|
706
|
+
focusing = undefined;
|
|
615
707
|
queueMicrotask(() => {
|
|
616
708
|
if (!current.released) {
|
|
617
709
|
controller.focus();
|
|
@@ -619,30 +711,24 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
619
711
|
});
|
|
620
712
|
}
|
|
621
713
|
},
|
|
622
|
-
document:
|
|
714
|
+
document: tab.document,
|
|
623
715
|
onSave: () => {
|
|
624
|
-
void model.save(
|
|
716
|
+
void model.save(tab);
|
|
625
717
|
},
|
|
626
|
-
options: () => settings(
|
|
718
|
+
options: () => settings(tab, read(current.path))
|
|
627
719
|
};
|
|
628
|
-
|
|
720
|
+
mounts.set(tab, current);
|
|
629
721
|
onCleanup(() => unmount(current));
|
|
722
|
+
effect(() => {
|
|
723
|
+
let path = tab.path;
|
|
724
|
+
untrack(() => {
|
|
725
|
+
if (current.controller && read(current.path) !== path) {
|
|
726
|
+
attach(current);
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
});
|
|
630
730
|
return untrack(() => current.editor(bound));
|
|
631
731
|
}
|
|
632
|
-
function peek(open, keyboard = false) {
|
|
633
|
-
if (!view.collapsed) {
|
|
634
|
-
return;
|
|
635
|
-
}
|
|
636
|
-
if (!open) {
|
|
637
|
-
ui.peek = false;
|
|
638
|
-
ui.ready = false;
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
ui.peek = true;
|
|
642
|
-
if (keyboard || container?.ownerDocument.defaultView?.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
|
643
|
-
ui.ready = true;
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
732
|
function quickOpen(query = '') {
|
|
647
733
|
if (palette.active) {
|
|
648
734
|
palette.active = false;
|
|
@@ -652,11 +738,6 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
652
738
|
flush();
|
|
653
739
|
palette.query = query;
|
|
654
740
|
}
|
|
655
|
-
function reach() {
|
|
656
|
-
peek(true, true);
|
|
657
|
-
flush();
|
|
658
|
-
searchField?.focus();
|
|
659
|
-
}
|
|
660
741
|
function results(groups) {
|
|
661
742
|
return nav.tree({
|
|
662
743
|
current: 'command',
|
|
@@ -667,7 +748,7 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
667
748
|
content: (() => {
|
|
668
749
|
let root_0vs726u5 = template_0vs726u6(), element_0vs726u7 = root_0vs726u5.firstChild, element_0vs726u8 = element_0vs726u7.nextSibling;
|
|
669
750
|
template_u1.slot(element_0vs726u7, item.command?.icon
|
|
670
|
-
?
|
|
751
|
+
? glyph(item.command.icon)
|
|
671
752
|
: fileTreeIcon({ name: name(item.id), type: 'file' }, false));
|
|
672
753
|
template_u1.slot(element_0vs726u8, item.content);
|
|
673
754
|
return root_0vs726u5;
|
|
@@ -677,7 +758,7 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
677
758
|
}],
|
|
678
759
|
label: group.label
|
|
679
760
|
})),
|
|
680
|
-
[nav.tree.highlight]:
|
|
761
|
+
[nav.tree.highlight]: true
|
|
681
762
|
});
|
|
682
763
|
}
|
|
683
764
|
function remember(current) {
|
|
@@ -685,12 +766,6 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
685
766
|
current.tab.scroll = { left: element.scrollLeft, top: element.scrollTop };
|
|
686
767
|
hosting.remember(current.tab, current.controller);
|
|
687
768
|
}
|
|
688
|
-
function remount() {
|
|
689
|
-
if (mount) {
|
|
690
|
-
unmount(mount);
|
|
691
|
-
}
|
|
692
|
-
show(model.state.active);
|
|
693
|
-
}
|
|
694
769
|
function restore(current) {
|
|
695
770
|
hosting.shown(current.tab, current.controller);
|
|
696
771
|
let element = current.controller.scroller, { left, top } = current.tab.scroll, tab = current.tab;
|
|
@@ -705,18 +780,9 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
705
780
|
});
|
|
706
781
|
}
|
|
707
782
|
}
|
|
708
|
-
function retarget(current, tab) {
|
|
709
|
-
remember(current);
|
|
710
|
-
detach(current);
|
|
711
|
-
current.tab = tab;
|
|
712
|
-
current.controller.setDocument(tab.document, settings(tab, tab.path));
|
|
713
|
-
restore(current);
|
|
714
|
-
attach(current);
|
|
715
|
-
reveal();
|
|
716
|
-
}
|
|
717
783
|
function reveal() {
|
|
718
|
-
let
|
|
719
|
-
if (!
|
|
784
|
+
let tab = read(active), controller = tab && mounts.get(tab)?.controller, next = model.state.reveal;
|
|
785
|
+
if (!tab || !controller || !next || next.request === revealed || controller.document !== tab.document || tab.id !== next.tabId) {
|
|
720
786
|
return;
|
|
721
787
|
}
|
|
722
788
|
revealed = next.request;
|
|
@@ -752,90 +818,8 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
752
818
|
wrap: view.wrap
|
|
753
819
|
};
|
|
754
820
|
}
|
|
755
|
-
function show(tab) {
|
|
756
|
-
if (mount?.tab === tab) {
|
|
757
|
-
return;
|
|
758
|
-
}
|
|
759
|
-
let editor = tab && (strip.editor(tab) ?? editorFor?.(tab) ?? codeEditor);
|
|
760
|
-
if (tab && mount?.controller?.setDocument && mount.editor === editor) {
|
|
761
|
-
retarget(mount, tab);
|
|
762
|
-
return;
|
|
763
|
-
}
|
|
764
|
-
if (mount) {
|
|
765
|
-
unmount(mount);
|
|
766
|
-
}
|
|
767
|
-
mount = tab && editor && { editor, path: signal(tab.path), released: false, tab };
|
|
768
|
-
write(shown, mount);
|
|
769
|
-
}
|
|
770
|
-
function tab(entry) {
|
|
771
|
-
let chosen = () => signal.selector(activeId, entry.id), file = () => strip.label(entry);
|
|
772
|
-
{
|
|
773
|
-
let root_0vs726ue = template_0vs726uf(), element_0vs726ug = root_0vs726ue.firstChild, element_0vs726uh = root_0vs726ue.firstElementChild, element_0vs726ui = element_0vs726ug.nextSibling.nextSibling, element_0vs726uj = element_0vs726ui.nextSibling, element_0vs726uk = element_0vs726uh.nextElementSibling;
|
|
774
|
-
new template_u1.EffectSlot(element_0vs726ug, () => fileTreeIcon({ name: file(), type: 'file' }, false));
|
|
775
|
-
new template_u1.EffectSlot(element_0vs726uh, file, 1);
|
|
776
|
-
new template_u1.EffectSlot(element_0vs726ui, () => strip.pin(entry));
|
|
777
|
-
new template_u1.EffectSlot(element_0vs726uj, () => entry.dirty && template_0vs726ul());
|
|
778
|
-
template_u1.slot(element_0vs726uk, icon({ 'aria-hidden': 'true', class: 'code-workspace-tab-close-icon' }, close), 1);
|
|
779
|
-
template_u1.setProperty(element_0vs726uk, 'title', label('Close', ['Mod', 'W']));
|
|
780
|
-
template_u1.setProperty(element_0vs726uk, 'aria-label', () => `Close ${file()}`);
|
|
781
|
-
template_u1.delegate(element_0vs726uk, 'click', (event) => {
|
|
782
|
-
event.stopPropagation();
|
|
783
|
-
void model.close(entry.path);
|
|
784
|
-
});
|
|
785
|
-
template_u1.setClass(element_0vs726uk, ["button code-workspace-tab-close"]);
|
|
786
|
-
template_u1.setProperty(root_0vs726ue, 'aria-controls', "" + (id) + "-panel");
|
|
787
|
-
template_u1.setProperty(root_0vs726ue, 'id', "" + (id) + "-tab-" + (entry.id));
|
|
788
|
-
template_u1.setProperty(root_0vs726ue, 'aria-selected', () => (chosen() ? 'true' : 'false'));
|
|
789
|
-
template_u1.delegate(root_0vs726ue, 'auxclick', (event) => {
|
|
790
|
-
if (event.button === 1) {
|
|
791
|
-
event.preventDefault();
|
|
792
|
-
void model.close(entry.path);
|
|
793
|
-
}
|
|
794
|
-
});
|
|
795
|
-
template_u1.delegate(root_0vs726ue, 'click', () => {
|
|
796
|
-
model.activate(entry);
|
|
797
|
-
focusEditor();
|
|
798
|
-
});
|
|
799
|
-
template_u1.onconnect(root_0vs726ue, (element) => {
|
|
800
|
-
elements.set(entry, element);
|
|
801
|
-
});
|
|
802
|
-
template_u1.delegate(root_0vs726ue, 'keydown', (event) => {
|
|
803
|
-
let list = untrack(() => model.state.tabs), at = list.indexOf(entry), next;
|
|
804
|
-
if (event.key === 'ArrowRight') {
|
|
805
|
-
next = list[(at + 1) % list.length];
|
|
806
|
-
}
|
|
807
|
-
else if (event.key === 'ArrowLeft') {
|
|
808
|
-
next = list[(at - 1 + list.length) % list.length];
|
|
809
|
-
}
|
|
810
|
-
else if (event.key === 'Home') {
|
|
811
|
-
next = list[0];
|
|
812
|
-
}
|
|
813
|
-
else if (event.key === 'End') {
|
|
814
|
-
next = list.at(-1);
|
|
815
|
-
}
|
|
816
|
-
else if (event.key === 'Enter' || event.key === ' ') {
|
|
817
|
-
event.preventDefault();
|
|
818
|
-
model.activate(entry);
|
|
819
|
-
focusEditor();
|
|
820
|
-
return;
|
|
821
|
-
}
|
|
822
|
-
if (next) {
|
|
823
|
-
event.preventDefault();
|
|
824
|
-
model.activate(next);
|
|
825
|
-
elements.get(next)?.focus();
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
template_u1.setProperty(root_0vs726ue, 'tabindex', () => (chosen() ? 0 : -1));
|
|
829
|
-
template_u1.setProperty(root_0vs726ue, 'title', () => strip.title(entry));
|
|
830
|
-
template_u1.setProperties(root_0vs726ue, strip.attributes(entry));
|
|
831
|
-
template_u1.setClass(root_0vs726ue, ["button code-workspace-tab", () => chosen() && '--active']);
|
|
832
|
-
return root_0vs726ue;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
821
|
function toggle(key) {
|
|
836
822
|
model.setPreferences({ [key]: !model.state.preferences[key] });
|
|
837
|
-
ui.peek = false;
|
|
838
|
-
ui.ready = false;
|
|
839
823
|
}
|
|
840
824
|
function unmount(current) {
|
|
841
825
|
if (current.released) {
|
|
@@ -843,9 +827,11 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
843
827
|
}
|
|
844
828
|
let controller = current.controller;
|
|
845
829
|
current.released = true;
|
|
846
|
-
if (
|
|
847
|
-
|
|
848
|
-
|
|
830
|
+
if (mounts.get(current.tab) === current) {
|
|
831
|
+
mounts.delete(current.tab);
|
|
832
|
+
if (untrack(() => read(active)) === current.tab) {
|
|
833
|
+
statusBar.attach(undefined);
|
|
834
|
+
}
|
|
849
835
|
}
|
|
850
836
|
if (controller?.host.isConnected) {
|
|
851
837
|
remember(current);
|
|
@@ -862,7 +848,8 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
862
848
|
model.dispose();
|
|
863
849
|
},
|
|
864
850
|
get editor() {
|
|
865
|
-
|
|
851
|
+
let tab = untrack(() => read(active));
|
|
852
|
+
return tab && mounts.get(tab)?.controller;
|
|
866
853
|
},
|
|
867
854
|
focus: focusEditor,
|
|
868
855
|
keybindings: openKeybindings,
|
|
@@ -877,8 +864,6 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
877
864
|
toggleExplorer: () => toggle('explorerOpen'),
|
|
878
865
|
toggleExplorerSide: () => {
|
|
879
866
|
model.setPreferences({ explorerSide: view.left ? 'right' : 'left' });
|
|
880
|
-
ui.peek = false;
|
|
881
|
-
ui.ready = false;
|
|
882
867
|
},
|
|
883
868
|
toggleWhitespace: () => toggle('showWhitespace'),
|
|
884
869
|
toggleWrap: () => toggle('wrapText'),
|
|
@@ -923,138 +908,53 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
923
908
|
}
|
|
924
909
|
}
|
|
925
910
|
], paths = () => read(target)?.paths ?? [], single = () => paths().length === 1;
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
template_u1.slot(element_0vs726uv, control({
|
|
936
|
-
disabled: () => !view.canUndo || view.busy,
|
|
937
|
-
label: 'Undo file operation',
|
|
938
|
-
onclick: () => {
|
|
939
|
-
void model.undoFiles();
|
|
940
|
-
},
|
|
941
|
-
sprite: undo
|
|
942
|
-
}));
|
|
943
|
-
template_u1.slot(element_0vs726uw, control({ label: label('Go to file', ['Mod', 'P']), onclick: () => quickOpen(), sprite: magnifier }));
|
|
944
|
-
template_u1.slot(element_0vs726us, input({
|
|
945
|
-
'aria-label': 'Search files',
|
|
946
|
-
autocomplete: 'off',
|
|
947
|
-
class: 'code-workspace-search',
|
|
948
|
-
onconnect: (element) => {
|
|
949
|
-
searchField = element;
|
|
950
|
-
},
|
|
951
|
-
oninput: (event) => search(event.target.value),
|
|
952
|
-
placeholder: 'Search files',
|
|
953
|
-
spellcheck: false,
|
|
954
|
-
type: 'search',
|
|
955
|
-
value: () => ui.search
|
|
956
|
-
}), 1);
|
|
957
|
-
new template_u1.EffectSlot(element_0vs726ux, () => hosting.ready() && untrack(() => fileTree({
|
|
958
|
-
class: 'code-workspace-files',
|
|
959
|
-
compact: true,
|
|
960
|
-
controller: (value) => {
|
|
961
|
-
tree = value;
|
|
962
|
-
value.search(ui.search);
|
|
911
|
+
let catalog = {
|
|
912
|
+
explorer: { addable: false, render: explorer, title: 'File explorer' },
|
|
913
|
+
file: {
|
|
914
|
+
addable: false,
|
|
915
|
+
menu: strip.menu,
|
|
916
|
+
render: file,
|
|
917
|
+
tab: (surface) => {
|
|
918
|
+
let tab = model.find(surface.id);
|
|
919
|
+
return tab ? strip.tab(tab) : {};
|
|
963
920
|
},
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
empty: () => template_0vs726u1j(),
|
|
968
|
-
export: hosting.export,
|
|
969
|
-
find: 'filter',
|
|
970
|
-
menu: (elements, position) => {
|
|
971
|
-
if (!elements.length || !actions) {
|
|
972
|
-
return;
|
|
973
|
-
}
|
|
974
|
-
write(target, { element: elements[0], paths: elements.map((element) => element.id) });
|
|
975
|
-
flush();
|
|
976
|
-
actions.open(position);
|
|
977
|
-
},
|
|
978
|
-
open: (element, open) => {
|
|
979
|
-
void model.open(element.id, undefined, undefined, open.mode === 'preview');
|
|
980
|
-
},
|
|
981
|
-
operations: {
|
|
982
|
-
delete: (elements) => {
|
|
983
|
-
void model.delete(elements.map((element) => element.id));
|
|
984
|
-
},
|
|
985
|
-
import: hosting.import
|
|
986
|
-
},
|
|
987
|
-
preview: 'immediate',
|
|
988
|
-
rename: async (element, value) => {
|
|
989
|
-
let parent = element.id.includes('/') ? element.id.slice(0, element.id.lastIndexOf('/') + 1) : '';
|
|
990
|
-
if (!(await model.rename(element.id, parent + value))) {
|
|
991
|
-
throw new Error(`Workspace: ${model.state.status}`);
|
|
992
|
-
}
|
|
921
|
+
title: (surface) => {
|
|
922
|
+
let tab = model.find(surface.id);
|
|
923
|
+
return tab ? strip.label(tab) : '';
|
|
993
924
|
},
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
snapshot: hosting.explorer,
|
|
998
|
-
state: treeState,
|
|
999
|
-
typing: 'typeahead'
|
|
1000
|
-
})));
|
|
1001
|
-
new template_u1.EffectSlot(element_0vs726uy, () => {
|
|
1002
|
-
if (view.error) {
|
|
1003
|
-
{
|
|
1004
|
-
let root_0vs726u1k = template_0vs726u1l(), element_0vs726u1m = root_0vs726u1k.firstChild, element_0vs726u1n = root_0vs726u1k.firstElementChild;
|
|
1005
|
-
template_u1.slot(element_0vs726u1m, view.error);
|
|
1006
|
-
template_u1.delegate(element_0vs726u1n, 'click', () => {
|
|
1007
|
-
void model.refresh();
|
|
1008
|
-
});
|
|
1009
|
-
return root_0vs726u1k;
|
|
1010
|
-
}
|
|
925
|
+
tooltip: (surface) => {
|
|
926
|
+
let tab = model.find(surface.id);
|
|
927
|
+
return tab ? strip.title(tab) : '';
|
|
1011
928
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
void model.save();
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
receive?.(api);
|
|
932
|
+
{
|
|
933
|
+
let root_0vs726uy = template_0vs726uz(), element_0vs726u10 = root_0vs726uy.firstChild, element_0vs726u11 = root_0vs726uy.firstElementChild, element_0vs726u12 = element_0vs726u11.firstElementChild, element_0vs726u13 = element_0vs726u12.nextElementSibling, element_0vs726u14 = element_0vs726u11.firstChild.nextSibling.nextSibling, element_0vs726u15 = element_0vs726u13.nextElementSibling, element_0vs726u16 = element_0vs726u11.nextElementSibling, element_0vs726u17 = element_0vs726u16.firstChild, element_0vs726u18 = element_0vs726u10.nextSibling.nextSibling.nextSibling, element_0vs726u19 = element_0vs726u18.nextSibling;
|
|
934
|
+
template_u1.slot(element_0vs726u10, shell({
|
|
935
|
+
catalog,
|
|
936
|
+
class: 'code-workspace-layout',
|
|
937
|
+
empty: () => {
|
|
938
|
+
let root_0vs726u1a = template_0vs726u1b(), element_0vs726u1c = root_0vs726u1a.firstElementChild;
|
|
939
|
+
template_u1.slot(element_0vs726u1c, keys(['Mod', 'P']).map((key) => {
|
|
940
|
+
let root_0vs726u1d = template_0vs726u1e();
|
|
941
|
+
template_u1.slot(root_0vs726u1d, key === '⌘' ? icon({ 'aria-hidden': 'true', class: 'button-kbd-icon' }, cmd) : key, 1);
|
|
942
|
+
return root_0vs726u1d;
|
|
943
|
+
}), 1);
|
|
944
|
+
return root_0vs726u1a;
|
|
1029
945
|
},
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
sprite: wrap
|
|
1037
|
-
}));
|
|
1038
|
-
template_u1.slot(element_0vs726u16, control({
|
|
1039
|
-
active: () => view.whitespace,
|
|
1040
|
-
label: () => (view.whitespace ? 'Hide whitespace' : 'Show whitespace'),
|
|
1041
|
-
onclick: api.toggleWhitespace,
|
|
1042
|
-
sprite: whitespace
|
|
946
|
+
narrow: NARROW,
|
|
947
|
+
sidebars: {
|
|
948
|
+
left: { hover: true, label: 'File explorer', resizable: true },
|
|
949
|
+
right: { hover: true, label: 'File explorer', resizable: true }
|
|
950
|
+
},
|
|
951
|
+
state: model.layout
|
|
1043
952
|
}));
|
|
1044
|
-
template_u1.
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
side: () => (view.left ? 'left' : 'right'),
|
|
1050
|
-
title: () => (view.explorerOpen ? 'Hide file explorer' : 'Show file explorer')
|
|
1051
|
-
}), 1);
|
|
1052
|
-
new template_u1.EffectSlot(element_0vs726u18, pane, 1);
|
|
1053
|
-
new template_u1.EffectSlot(element_0vs726u1a, () => view.cwd, 1);
|
|
1054
|
-
new template_u1.EffectSlot(element_0vs726u1b, () => ui.position, 1);
|
|
1055
|
-
new template_u1.EffectSlot(element_0vs726u1c, statusBar.items);
|
|
1056
|
-
new template_u1.EffectSlot(element_0vs726u1d, () => view.status, 1);
|
|
1057
|
-
template_u1.slot(element_0vs726u1f, tooltip.context({
|
|
953
|
+
new template_u1.EffectSlot(element_0vs726u12, () => view.cwd, 1);
|
|
954
|
+
new template_u1.EffectSlot(element_0vs726u13, () => ui.position, 1);
|
|
955
|
+
new template_u1.EffectSlot(element_0vs726u14, statusBar.items);
|
|
956
|
+
new template_u1.EffectSlot(element_0vs726u15, () => view.status, 1);
|
|
957
|
+
template_u1.slot(element_0vs726u17, tooltip.context({
|
|
1058
958
|
class: 'code-workspace-menu',
|
|
1059
959
|
controller: (value) => {
|
|
1060
960
|
actions = value;
|
|
@@ -1062,9 +962,8 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
1062
962
|
items,
|
|
1063
963
|
[tooltip.context.panel]: { 'aria-label': 'File actions', class: 'code-workspace-menu-panel' }
|
|
1064
964
|
}, ''));
|
|
1065
|
-
new template_u1.EffectSlot(
|
|
1066
|
-
template_u1.slot(
|
|
1067
|
-
template_u1.slot(element_0vs726u1h, command({
|
|
965
|
+
new template_u1.EffectSlot(element_0vs726u16, statusBar.menu, 1);
|
|
966
|
+
template_u1.slot(element_0vs726u18, command({
|
|
1068
967
|
commands: () => [PALETTE, ...read(files).map((path) => ({ group: 'Files', id: path, label: path }))],
|
|
1069
968
|
hotkey: [],
|
|
1070
969
|
label: 'Go to file',
|
|
@@ -1077,73 +976,44 @@ const workspace = ({ addons, controller: receive, cwd = '', decorations: provide
|
|
|
1077
976
|
trigger: false,
|
|
1078
977
|
[command.dialog]: { 'aria-label': 'Go to file' }
|
|
1079
978
|
}));
|
|
1080
|
-
template_u1.slot(
|
|
979
|
+
template_u1.slot(element_0vs726u19, shortcuts({
|
|
1081
980
|
apple: mac(),
|
|
1082
981
|
id,
|
|
1083
982
|
keybindings: () => model.state.preferences.keybindings,
|
|
1084
983
|
onchange: (next) => model.setPreferences({ keybindings: next }),
|
|
1085
984
|
state: keyboard
|
|
1086
985
|
}));
|
|
1087
|
-
template_u1.slot(
|
|
986
|
+
template_u1.slot(root_0vs726uy, overlay({
|
|
1088
987
|
'aria-labelledby': `${id}-confirm`,
|
|
1089
988
|
class: 'card overlay--alert code-workspace-confirm',
|
|
1090
989
|
state: dialog
|
|
1091
990
|
}, (() => {
|
|
1092
|
-
let
|
|
1093
|
-
new template_u1.EffectSlot(
|
|
1094
|
-
new template_u1.EffectSlot(
|
|
991
|
+
let root_0vs726u1f = template_0vs726u1g(), element_0vs726u1h = root_0vs726u1f.firstChild, element_0vs726u1i = element_0vs726u1h.nextSibling, element_0vs726u1j = element_0vs726u1i.nextSibling, element_0vs726u1k = element_0vs726u1j.nextSibling.firstElementChild, element_0vs726u1l = element_0vs726u1k.nextElementSibling, element_0vs726u1m = element_0vs726u1l.nextElementSibling;
|
|
992
|
+
new template_u1.EffectSlot(element_0vs726u1i, () => read(request)?.dirty.join(', '), 1);
|
|
993
|
+
new template_u1.EffectSlot(element_0vs726u1j, () => (read(request)?.kind === 'delete'
|
|
1095
994
|
? 'Save before deleting, discard the drafts, or cancel deletion.'
|
|
1096
995
|
: 'Save the drafts, discard them, or keep them open.'), 1);
|
|
1097
|
-
template_u1.delegate(
|
|
1098
|
-
template_u1.delegate(
|
|
1099
|
-
template_u1.delegate(
|
|
1100
|
-
template_u1.setProperty(
|
|
1101
|
-
return
|
|
996
|
+
template_u1.delegate(element_0vs726u1m, 'click', () => confirmation?.resolve('save'));
|
|
997
|
+
template_u1.delegate(element_0vs726u1l, 'click', () => confirmation?.resolve('discard'));
|
|
998
|
+
template_u1.delegate(element_0vs726u1k, 'click', () => confirmation?.resolve('cancel'));
|
|
999
|
+
template_u1.setProperty(element_0vs726u1h, 'id', "" + (id) + "-confirm");
|
|
1000
|
+
return root_0vs726u1f;
|
|
1102
1001
|
})()), 1);
|
|
1103
|
-
template_u1.onconnect(
|
|
1002
|
+
template_u1.onconnect(element_0vs726u16, (element) => {
|
|
1104
1003
|
element.showPopover();
|
|
1105
1004
|
});
|
|
1106
|
-
template_u1.setClass(
|
|
1107
|
-
template_u1.setClass(
|
|
1108
|
-
|
|
1109
|
-
template_u1.
|
|
1110
|
-
template_u1.
|
|
1111
|
-
|
|
1112
|
-
template_u1.
|
|
1113
|
-
template_u1.
|
|
1114
|
-
template_u1.
|
|
1115
|
-
template_u1.
|
|
1116
|
-
template_u1.
|
|
1117
|
-
|
|
1118
|
-
template_u1.setClass(element_0vs726ur, ["code-workspace-explorer-content"]);
|
|
1119
|
-
template_u1.direct(element_0vs726uq, 'focusin', () => peek(true, true));
|
|
1120
|
-
template_u1.direct(element_0vs726uq, 'pointerenter', (event) => {
|
|
1121
|
-
if (!event.currentTarget.getAnimations().length) {
|
|
1122
|
-
peek(true);
|
|
1123
|
-
}
|
|
1124
|
-
});
|
|
1125
|
-
template_u1.delegate(element_0vs726uq, 'transitionend', (event) => {
|
|
1126
|
-
if (event.target === event.currentTarget && event.propertyName === 'translate') {
|
|
1127
|
-
ui.ready = ui.peek;
|
|
1128
|
-
}
|
|
1129
|
-
});
|
|
1130
|
-
template_u1.setClass(element_0vs726uq, ["code-workspace-explorer"]);
|
|
1131
|
-
let attributes_0vs726u20 = attributes;
|
|
1132
|
-
template_u1.setProperties(root_0vs726uo, attributes_0vs726u20, true);
|
|
1133
|
-
template_u1.setProperties(root_0vs726uo, hosting.attributes);
|
|
1134
|
-
template_u1.setProperties(root_0vs726uo, statusBar.attributes);
|
|
1135
|
-
template_u1.setProperty(root_0vs726uo, 'aria-keyshortcuts', declare(attributes['aria-keyshortcuts'], OPEN[0]));
|
|
1136
|
-
template_u1.onconnect(root_0vs726uo, connect);
|
|
1137
|
-
template_u1.ondocument(root_0vs726uo, 'keydown', keydown);
|
|
1138
|
-
template_u1.setClass(root_0vs726uo, ["code-workspace", attributes_0vs726u20?.class, [
|
|
1139
|
-
() => view.collapsed && 'code-workspace--collapsed',
|
|
1140
|
-
() => view.left && 'code-workspace--left',
|
|
1141
|
-
() => ui.peek && 'code-workspace--peek',
|
|
1142
|
-
() => ui.compact && view.tabs && view.explorerOpen && 'code-workspace--stacked',
|
|
1143
|
-
() => view.tabs && 'code-workspace--tabs'
|
|
1144
|
-
]]);
|
|
1145
|
-
template_u1.setStyle(root_0vs726uo, ["", attributes_0vs726u20?.style]);
|
|
1146
|
-
return root_0vs726uo;
|
|
1005
|
+
template_u1.setClass(element_0vs726u16, ["code-workspace-layer"]);
|
|
1006
|
+
template_u1.setClass(element_0vs726u15, ["code-workspace-status-message", () => view.statusError && 'code-workspace-status-message--error']);
|
|
1007
|
+
let attributes_0vs726u1n = attributes;
|
|
1008
|
+
template_u1.setProperties(root_0vs726uy, attributes_0vs726u1n, true);
|
|
1009
|
+
template_u1.setProperties(root_0vs726uy, hosting.attributes);
|
|
1010
|
+
template_u1.setProperties(root_0vs726uy, statusBar.attributes);
|
|
1011
|
+
template_u1.setProperty(root_0vs726uy, 'aria-keyshortcuts', declare(attributes['aria-keyshortcuts'], OPEN[0]));
|
|
1012
|
+
template_u1.onconnect(root_0vs726uy, connect);
|
|
1013
|
+
template_u1.ondocument(root_0vs726uy, 'keydown', keydown);
|
|
1014
|
+
template_u1.setClass(root_0vs726uy, ["code-workspace", attributes_0vs726u1n?.class]);
|
|
1015
|
+
template_u1.setStyle(root_0vs726uy, ["", attributes_0vs726u1n?.style]);
|
|
1016
|
+
return root_0vs726uy;
|
|
1147
1017
|
}
|
|
1148
1018
|
};
|
|
1149
1019
|
export default component(workspace);
|