@esportsplus/ui 0.59.1 → 0.61.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 +2810 -0
- package/.audit/check-scss.mjs +20 -0
- package/.audit/rules-audit.md +542 -0
- package/README.md +42 -31
- package/RULES.md +115 -0
- package/build/components/accordion/index.d.ts +12 -2175
- package/build/components/accordion/index.js +3 -4
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/announcement/scss/index.scss +1 -1
- package/build/components/breadcrumb/index.js +47 -64
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/copy.d.ts +6 -4
- package/build/components/button/copy.js +24 -20
- package/build/components/button/faces.d.ts +0 -1
- package/build/components/button/faces.js +5 -6
- package/build/components/button/index.d.ts +3 -7
- package/build/components/button/index.js +3 -5
- package/build/components/button/kbd.d.ts +12 -8
- package/build/components/button/kbd.js +59 -74
- package/build/components/button/morph/index.d.ts +2169 -0
- package/build/components/button/morph/index.js +4 -0
- package/build/components/button/morph/save.d.ts +19 -0
- package/build/components/button/morph/save.js +57 -0
- package/build/components/button/morph/template.d.ts +22 -0
- package/build/components/button/morph/template.js +90 -0
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/sidebar.js +2 -2
- package/build/components/button/split.d.ts +1 -1
- package/build/components/button/split.js +11 -15
- package/build/components/capslock/index.js +6 -5
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/cc/index.js +103 -111
- package/build/components/cc/scss/index.scss +1 -1
- package/build/components/chat/index.d.ts +6 -0
- package/build/components/chat/index.js +3 -0
- package/build/components/chat/minimap/index.d.ts +52 -0
- package/build/components/chat/minimap/index.js +248 -0
- package/build/components/{chat-minimap/range.js → chat/minimap/model.js} +1 -1
- package/build/components/{chat-minimap → chat/minimap}/spy.d.ts +1 -1
- package/build/components/{chat-minimap → chat/minimap}/spy.js +1 -1
- package/build/components/checkbox/index.d.ts +1 -0
- package/build/components/checkbox/index.js +1 -0
- package/build/components/checkbox/options.d.ts +0 -1
- package/build/components/checkbox/options.js +0 -1
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/clipboard/index.d.ts +3 -2181
- package/build/components/clipboard/index.js +2 -3
- package/build/components/color-picker/index.d.ts +21 -0
- package/build/components/color-picker/index.js +153 -138
- package/build/components/color-picker/scss/index.scss +1 -1
- package/build/components/command/index.d.ts +6 -93
- package/build/components/command/index.js +4 -601
- package/build/components/command/palette.d.ts +103 -0
- package/build/components/command/palette.js +595 -0
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/command/search.d.ts +37 -0
- package/build/components/command/search.js +67 -0
- package/build/components/counter/index.d.ts +15 -4
- package/build/components/counter/index.js +3 -2
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/datalist/scss/index.scss +1 -1
- package/build/components/dock/index.d.ts +24 -5
- package/build/components/dock/index.js +389 -51
- package/build/components/dock/scss/index.scss +1 -1
- package/build/components/editor/markdown/index.d.ts +3 -22
- package/build/components/editor/markdown/index.js +3 -30
- package/build/components/editor/markdown/render.js +3 -5
- package/build/components/editor/markdown/template.d.ts +22 -0
- package/build/components/editor/markdown/template.js +30 -0
- package/build/components/editor/tree/find.js +3 -3
- package/build/components/editor/tree/index.d.ts +3 -116
- package/build/components/editor/tree/index.js +3 -2225
- package/build/components/editor/tree/template.d.ts +116 -0
- package/build/components/editor/tree/template.js +2225 -0
- package/build/components/editor/viewer/index.d.ts +3 -26
- package/build/components/editor/viewer/index.js +3 -249
- package/build/components/editor/viewer/template.d.ts +26 -0
- package/build/components/editor/viewer/template.js +249 -0
- package/build/components/editor/workspace/index.d.ts +4 -65
- package/build/components/editor/workspace/index.js +4 -1228
- package/build/components/editor/workspace/model.d.ts +29 -37
- package/build/components/editor/workspace/model.js +186 -155
- package/build/components/editor/workspace/session.d.ts +3 -0
- package/build/components/editor/workspace/session.js +61 -34
- package/build/components/editor/workspace/shortcuts.d.ts +0 -2
- package/build/components/editor/workspace/shortcuts.js +0 -2
- package/build/components/editor/workspace/status.d.ts +4 -5
- package/build/components/editor/workspace/status.js +79 -61
- package/build/components/editor/workspace/statusbar.d.ts +5 -3
- package/build/components/editor/workspace/statusbar.js +66 -80
- package/build/components/editor/workspace/strip.d.ts +1 -2
- package/build/components/editor/workspace/strip.js +4 -3
- package/build/components/editor/workspace/tabs.d.ts +35 -3
- package/build/components/editor/workspace/tabs.js +75 -13
- package/build/components/editor/workspace/template.d.ts +65 -0
- package/build/components/editor/workspace/template.js +1145 -0
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/filter/index.js +0 -3
- package/build/components/filter/scss/index.scss +1 -1
- package/build/components/form/index.d.ts +6 -32
- package/build/components/form/index.js +2 -1
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/grid/scss/index.scss +1 -1
- package/build/components/group/index.d.ts +12 -0
- package/build/components/group/index.js +15 -0
- package/build/components/group/scss/index.scss +2 -0
- package/build/components/heatmap/index.js +10 -32
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/index.d.ts +2 -3
- package/build/components/highlight/index.js +79 -78
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/index.d.ts +4 -3
- package/build/components/icon/index.js +2 -1
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/image/index.d.ts +3 -16
- package/build/components/image/index.js +2 -2
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +6 -4
- package/build/components/index.js +6 -4
- package/build/components/inline-edit/index.js +5 -4
- package/build/components/inline-edit/rich.js +79 -82
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/inline-edit/status.js +4 -3
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/input/tag.js +84 -67
- package/build/components/json/index.d.ts +4 -3
- package/build/components/json/index.js +2 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/loading/scss/index.scss +1 -1
- package/build/components/marquee/index.js +74 -71
- package/build/components/marquee/scss/index.scss +1 -1
- package/build/components/metric/flash.js +12 -11
- package/build/components/metric/scss/index.scss +1 -1
- package/build/components/nav/index.d.ts +1 -1
- package/build/components/nav/scss/index.scss +1 -1
- package/build/components/nav/toc.d.ts +8 -13
- package/build/components/nav/toc.js +9 -21
- package/build/components/nav/tree.d.ts +13 -14
- package/build/components/nav/tree.js +32 -19
- package/build/components/notification/index.d.ts +14 -3
- package/build/components/notification/index.js +4 -3
- package/build/components/notification/scss/index.scss +1 -1
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/page/scss/index.scss +1 -1
- package/build/components/pagination/cards.d.ts +1 -0
- package/build/components/pagination/cards.js +4 -6
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/panels/dnd.d.ts +47 -0
- package/build/components/panels/dnd.js +106 -0
- package/build/components/panels/group.d.ts +35 -0
- package/build/components/panels/group.js +319 -0
- package/build/components/panels/index.d.ts +25 -0
- package/build/components/panels/index.js +520 -0
- package/build/components/panels/model.d.ts +64 -0
- package/build/components/panels/model.js +446 -0
- package/build/components/panels/resize.d.ts +9 -0
- package/build/components/panels/resize.js +87 -0
- package/build/components/panels/scss/index.scss +2 -0
- package/build/components/panels/subtree.d.ts +3 -0
- package/build/components/panels/subtree.js +43 -0
- package/build/components/preview/buttons.d.ts +20 -0
- package/build/components/preview/buttons.js +26 -0
- package/build/components/{copy/index.d.ts → preview/code.d.ts} +3 -9
- package/build/components/preview/code.js +18 -0
- package/build/components/preview/header.d.ts +16 -0
- package/build/components/preview/header.js +18 -0
- package/build/components/preview/index.d.ts +8704 -0
- package/build/components/preview/index.js +123 -0
- package/build/components/preview/scss/index.scss +2 -0
- package/build/components/preview/source.d.ts +21 -0
- package/build/components/preview/source.js +76 -0
- package/build/components/preview/stage.d.ts +16 -0
- package/build/components/preview/stage.js +24 -0
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/progress/text.js +9 -11
- package/build/components/radio/index.d.ts +3 -2
- package/build/components/radio/index.js +2 -2
- package/build/components/range/filter.js +8 -9
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/relative-time/index.js +4 -7
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/select/index.d.ts +1 -1
- package/build/components/select/index.js +72 -59
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/shell/index.d.ts +22 -0
- package/build/components/shell/index.js +272 -0
- package/build/components/shell/scss/index.scss +2 -0
- package/build/components/shortcut-recorder/index.d.ts +2 -3
- package/build/components/shortcut-recorder/index.js +3 -1
- package/build/components/shortcut-recorder/scss/index.scss +1 -1
- package/build/components/sortable/scss/index.scss +1 -1
- package/build/components/sticky-header/scss/index.scss +1 -1
- package/build/components/story/index.d.ts +10 -6
- package/build/components/story/index.js +27 -47
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/index.js +13 -16
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/switch/index.d.ts +3 -2
- package/build/components/switch/index.js +2 -2
- package/build/components/tasklist/index.js +3 -1
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/textarea/scss/index.scss +1 -1
- package/build/components/theme/index.d.ts +6 -2
- package/build/components/theme/index.js +4 -3
- package/build/components/theme/scss/index.scss +1 -1
- package/build/components/theme-picker/cards.d.ts +13 -0
- package/build/components/theme-picker/cards.js +17 -0
- package/build/components/theme-picker/index.d.ts +9 -49
- package/build/components/theme-picker/index.js +5 -165
- package/build/components/theme-picker/scss/index.scss +1 -1
- package/build/components/theme-picker/shared.d.ts +26 -0
- package/build/components/theme-picker/shared.js +24 -0
- package/build/components/theme-picker/swatches.d.ts +13 -0
- package/build/components/theme-picker/swatches.js +17 -0
- package/build/components/theme-picker/toggle.d.ts +19 -0
- package/build/components/theme-picker/toggle.js +109 -0
- package/build/components/toast/index.js +10 -10
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/tooltip/menu.d.ts +2 -0
- package/build/components/tooltip/menu.js +88 -45
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/tooltip/shared.js +2 -2
- package/build/components/typewriter/rotate.js +7 -16
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/index.js +26 -33
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/scss/index.scss +1 -1
- package/build/modifiers/background/scss/index.scss +2 -0
- package/build/modifiers/border/scss/index.scss +2 -0
- package/build/modifiers/box-shadow/scss/index.scss +2 -0
- package/build/modifiers/color/scss/index.scss +2 -0
- package/build/modifiers/scrollbar/scss/index.scss +1 -1
- package/build/shared/animation.js +1 -1
- package/build/shared/drag.d.ts +2 -1
- package/build/shared/drag.js +4 -3
- package/package.json +5 -5
- package/scripts/code-editor-services.test.mjs +1 -1
- package/scripts/code-editor-workspace.test.mjs +28 -18
- package/scripts/panels.test.mjs +262 -0
- package/scripts/workspace-keybindings.test.mjs +1 -1
- package/scripts/workspace-session.test.mjs +8 -6
- package/scripts/workspace-status.test.mjs +9 -1
- package/scripts/workspace-tabs.test.mjs +5 -5
- package/src/components/accordion/index.ts +11 -8
- package/src/components/accordion/scss/index.scss +15 -15
- package/src/components/accordion/scss/variables.scss +11 -7
- package/src/components/announcement/scss/index.scss +21 -24
- package/src/components/announcement/scss/variables.scss +13 -7
- package/src/components/breadcrumb/index.ts +8 -10
- package/src/components/breadcrumb/scss/index.scss +48 -122
- package/src/components/breadcrumb/scss/variables.scss +73 -55
- package/src/components/button/copy.ts +34 -27
- package/src/components/button/faces.ts +2 -4
- package/src/components/button/index.ts +3 -7
- package/src/components/button/kbd.ts +37 -95
- package/src/components/button/morph/index.ts +6 -0
- package/src/components/button/morph/save.ts +55 -0
- package/src/components/button/morph/template.ts +135 -0
- package/src/components/button/scss/index.scss +218 -99
- package/src/components/button/scss/variables.scss +160 -115
- package/src/components/button/sidebar.ts +6 -6
- package/src/components/button/split.ts +5 -6
- package/src/components/capslock/index.ts +9 -8
- package/src/components/capslock/scss/index.scss +21 -25
- package/src/components/capslock/scss/variables.scss +31 -12
- package/src/components/card/scss/index.scss +9 -24
- package/src/components/card/scss/variables.scss +29 -76
- package/src/components/cc/index.ts +15 -10
- package/src/components/cc/scss/index.scss +110 -153
- package/src/components/cc/scss/variables.scss +231 -44
- package/src/components/chat/index.ts +10 -0
- package/src/components/{chat-minimap → chat/minimap}/index.ts +66 -21
- package/src/components/{chat-minimap → chat/minimap}/scss/index.scss +26 -54
- package/src/components/chat/minimap/scss/variables.scss +178 -0
- package/src/components/{chat-minimap → chat/minimap}/spy.ts +1 -1
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/checkbox/options.ts +0 -1
- package/src/components/checkbox/scss/index.scss +25 -31
- package/src/components/checkbox/scss/variables.scss +50 -19
- package/src/components/clipboard/index.ts +4 -3
- package/src/components/color-picker/index.ts +131 -67
- package/src/components/color-picker/scss/index.scss +138 -221
- package/src/components/color-picker/scss/variables.scss +228 -81
- package/src/components/command/index.ts +5 -860
- package/src/components/command/palette.ts +879 -0
- package/src/components/command/scss/index.scss +82 -99
- package/src/components/command/scss/variables.scss +129 -50
- package/src/components/command/search.ts +67 -0
- package/src/components/counter/index.ts +90 -85
- package/src/components/counter/scss/index.scss +32 -41
- package/src/components/counter/scss/variables.scss +44 -16
- package/src/components/datalist/scss/index.scss +25 -25
- package/src/components/datalist/scss/variables.scss +21 -11
- package/src/components/dock/index.ts +505 -42
- package/src/components/dock/scss/index.scss +318 -73
- package/src/components/dock/scss/variables.scss +310 -39
- package/src/components/editor/code/features.ts +0 -1
- package/src/components/editor/code/find.ts +0 -1
- package/src/components/editor/code/keymap.ts +0 -1
- package/src/components/editor/code/scss/_editor.scss +12 -31
- package/src/components/editor/code/scss/_features.scss +12 -45
- package/src/components/editor/code/scss/_services.scss +15 -23
- package/src/components/editor/code/scss/index.scss +1 -1
- package/src/components/editor/code/scss/variables.scss +195 -42
- package/src/components/editor/code/view.ts +0 -1
- package/src/components/editor/diffs/scss/_diffs.scss +24 -77
- package/src/components/editor/diffs/scss/_merge.scss +5 -16
- package/src/components/editor/diffs/scss/index.scss +1 -1
- package/src/components/editor/diffs/scss/variables.scss +148 -11
- package/src/components/editor/markdown/index.ts +3 -67
- package/src/components/editor/markdown/render.ts +3 -6
- package/src/components/editor/markdown/scss/index.scss +30 -48
- package/src/components/editor/markdown/scss/variables.scss +117 -32
- package/src/components/editor/markdown/template.ts +69 -0
- package/src/components/editor/tree/drag.ts +5 -2
- package/src/components/editor/tree/find.ts +5 -4
- package/src/components/editor/tree/index.ts +3 -3434
- package/src/components/editor/tree/scss/index.scss +204 -262
- package/src/components/editor/tree/scss/variables.scss +198 -31
- package/src/components/editor/tree/template.ts +3436 -0
- package/src/components/editor/viewer/index.ts +3 -318
- package/src/components/editor/viewer/scss/_viewer.scss +15 -31
- package/src/components/editor/viewer/scss/index.scss +1 -1
- package/src/components/editor/viewer/scss/variables.scss +56 -14
- package/src/components/editor/viewer/template.ts +321 -0
- package/src/components/editor/workspace/index.ts +4 -1480
- package/src/components/editor/workspace/model.ts +225 -185
- package/src/components/editor/workspace/scss/_keybindings.scss +163 -0
- package/src/components/editor/workspace/scss/{status.scss → _status.scss} +11 -44
- package/src/components/editor/workspace/scss/_tabs.scss +57 -0
- package/src/components/editor/workspace/scss/index.scss +82 -312
- package/src/components/editor/workspace/scss/variables.scss +427 -0
- package/src/components/editor/workspace/session.ts +80 -44
- package/src/components/editor/workspace/shortcuts.ts +0 -2
- package/src/components/editor/workspace/status.ts +110 -80
- package/src/components/editor/workspace/statusbar.ts +38 -35
- package/src/components/editor/workspace/strip.ts +6 -5
- package/src/components/editor/workspace/tabs.ts +115 -15
- package/src/components/editor/workspace/template.ts +1486 -0
- package/src/components/error/index.ts +3 -0
- package/src/components/error/scss/index.scss +34 -65
- package/src/components/error/scss/variables.scss +28 -9
- package/src/components/filter/index.ts +2 -6
- package/src/components/filter/scss/index.scss +9 -2
- package/src/components/filter/scss/variables.scss +6 -6
- package/src/components/form/index.ts +4 -1
- package/src/components/frame/scss/index.scss +31 -42
- package/src/components/frame/scss/variables.scss +25 -18
- package/src/components/grid/scss/index.scss +2 -1
- package/src/components/group/index.ts +24 -0
- package/src/components/group/scss/index.scss +6 -0
- package/src/components/group/scss/variables.scss +4 -0
- package/src/components/heatmap/index.ts +14 -44
- package/src/components/heatmap/scss/index.scss +38 -44
- package/src/components/heatmap/scss/variables.scss +100 -59
- package/src/components/highlight/index.ts +133 -119
- package/src/components/highlight/scss/index.scss +49 -43
- package/src/components/highlight/scss/variables.scss +71 -30
- package/src/components/icon/index.ts +7 -5
- package/src/components/icon/scss/index.scss +7 -2
- package/src/components/icon/scss/variables.scss +2 -0
- package/src/components/image/index.ts +4 -2
- package/src/components/image/scss/index.scss +14 -22
- package/src/components/image/scss/variables.scss +30 -15
- package/src/components/index.ts +6 -4
- package/src/components/inline-edit/index.ts +3 -2
- package/src/components/inline-edit/rich.ts +17 -15
- package/src/components/inline-edit/scss/index.scss +165 -254
- package/src/components/inline-edit/scss/variables.scss +311 -83
- package/src/components/inline-edit/status.ts +2 -1
- package/src/components/input/scrub.ts +1 -1
- package/src/components/input/scss/_field.scss +1 -1
- package/src/components/input/scss/_scrub.scss +14 -25
- package/src/components/input/scss/_tag.scss +26 -46
- package/src/components/input/scss/variables.scss +167 -77
- package/src/components/input/tag.ts +59 -49
- package/src/components/json/index.ts +4 -1
- package/src/components/link/scss/index.scss +1 -4
- package/src/components/link/scss/variables.scss +5 -1
- package/src/components/loading/scss/index.scss +3 -23
- package/src/components/loading/scss/variables.scss +3 -6
- package/src/components/marquee/index.ts +33 -28
- package/src/components/marquee/scss/index.scss +32 -26
- package/src/components/marquee/scss/variables.scss +35 -23
- package/src/components/metric/flash.ts +2 -1
- package/src/components/metric/scss/_flash.scss +125 -145
- package/src/components/metric/scss/index.scss +31 -43
- package/src/components/metric/scss/variables.scss +192 -98
- package/src/components/nav/index.ts +1 -1
- package/src/components/nav/scss/index.scss +46 -49
- package/src/components/nav/scss/variables.scss +61 -64
- package/src/components/nav/spy.ts +2 -0
- package/src/components/nav/toc.ts +11 -31
- package/src/components/nav/tree.ts +56 -24
- package/src/components/notification/index.ts +94 -89
- package/src/components/notification/scss/index.scss +77 -76
- package/src/components/notification/scss/variables.scss +55 -38
- package/src/components/overlay/index.ts +3 -1
- package/src/components/overlay/scss/index.scss +94 -114
- package/src/components/overlay/scss/variables.scss +46 -18
- package/src/components/page/scss/variables.scss +1 -1
- package/src/components/pagination/cards.ts +2 -1
- package/src/components/pagination/scss/index.scss +191 -7
- package/src/components/pagination/scss/variables.scss +112 -36
- package/src/components/panels/dnd.ts +184 -0
- package/src/components/panels/group.ts +437 -0
- package/src/components/panels/index.ts +678 -0
- package/src/components/panels/model.ts +675 -0
- package/src/components/panels/resize.ts +131 -0
- package/src/components/panels/scss/index.scss +394 -0
- package/src/components/panels/scss/variables.scss +197 -0
- package/src/components/panels/subtree.ts +65 -0
- package/src/components/preview/buttons.ts +48 -0
- package/src/components/preview/code.ts +28 -0
- package/src/components/preview/header.ts +23 -0
- package/src/components/preview/index.ts +144 -0
- package/src/components/preview/scss/index.scss +143 -0
- package/src/components/preview/scss/variables.scss +127 -0
- package/src/components/preview/source.ts +73 -0
- package/src/components/preview/stage.ts +33 -0
- package/src/components/progress/scss/index.scss +117 -15
- package/src/components/progress/scss/variables.scss +140 -40
- package/src/components/progress/text.ts +5 -4
- package/src/components/radio/index.ts +2 -4
- package/src/components/range/filter.ts +7 -11
- package/src/components/range/scss/_filter.scss +301 -327
- package/src/components/range/scss/_slider.scss +31 -110
- package/src/components/range/scss/_vertical.scss +8 -20
- package/src/components/range/scss/index.scss +1 -4
- package/src/components/range/scss/variables.scss +374 -70
- package/src/components/relative-time/index.ts +9 -14
- package/src/components/relative-time/scss/index.scss +13 -21
- package/src/components/relative-time/scss/variables.scss +46 -29
- package/src/components/root/scss/index.scss +11 -20
- package/src/components/root/scss/variables.scss +17 -15
- package/src/components/select/index.ts +37 -15
- package/src/components/select/scss/index.scss +24 -51
- package/src/components/select/scss/variables.scss +77 -19
- package/src/components/shell/index.ts +321 -0
- package/src/components/shell/scss/index.scss +214 -0
- package/src/components/shell/scss/variables.scss +89 -0
- package/src/components/shortcut-recorder/index.ts +6 -3
- package/src/components/shortcut-recorder/scss/index.scss +71 -56
- package/src/components/shortcut-recorder/scss/variables.scss +47 -21
- package/src/components/sortable/index.ts +1 -0
- package/src/components/sortable/scss/index.scss +37 -42
- package/src/components/sortable/scss/variables.scss +76 -52
- package/src/components/sticky-header/scss/index.scss +11 -10
- package/src/components/sticky-header/scss/variables.scss +36 -4
- package/src/components/story/index.ts +1 -36
- package/src/components/story/scss/index.scss +22 -98
- package/src/components/story/scss/variables.scss +57 -15
- package/src/components/surface-field/index.ts +18 -20
- package/src/components/surface-field/scss/index.scss +32 -46
- package/src/components/surface-field/scss/variables.scss +92 -23
- package/src/components/switch/index.ts +2 -4
- package/src/components/tasklist/index.ts +8 -2
- package/src/components/tasklist/scss/index.scss +7 -7
- package/src/components/tasklist/scss/variables.scss +18 -13
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/scss/index.scss +9 -7
- package/src/components/textarea/scss/variables.scss +2 -2
- package/src/components/theme/index.ts +12 -4
- package/src/components/theme/scss/index.scss +13 -0
- package/src/components/theme/scss/variables.scss +5 -16
- package/src/components/theme-picker/cards.ts +19 -0
- package/src/components/theme-picker/index.ts +6 -225
- package/src/components/theme-picker/scss/index.scss +77 -167
- package/src/components/theme-picker/scss/variables.scss +220 -0
- package/src/components/theme-picker/shared.ts +54 -0
- package/src/components/theme-picker/swatches.ts +15 -0
- package/src/components/theme-picker/toggle.ts +150 -0
- package/src/components/toast/index.ts +14 -14
- package/src/components/toast/scss/index.scss +130 -155
- package/src/components/toast/scss/variables.scss +89 -52
- package/src/components/tooltip/menu.ts +77 -10
- package/src/components/tooltip/scss/_menu.scss +96 -138
- package/src/components/tooltip/scss/_shared.scss +93 -90
- package/src/components/tooltip/scss/index.scss +52 -54
- package/src/components/tooltip/scss/variables.scss +187 -67
- package/src/components/tooltip/shared.ts +8 -6
- package/src/components/typewriter/rotate.ts +15 -24
- package/src/components/typewriter/scss/index.scss +131 -3
- package/src/components/typewriter/scss/variables.scss +56 -44
- package/src/components/uptime/index.ts +1 -13
- package/src/components/uptime/scss/index.scss +28 -66
- package/src/components/uptime/scss/variables.scss +63 -48
- package/src/components/usage-meter/scss/index.scss +19 -19
- package/src/components/usage-meter/scss/variables.scss +80 -35
- package/src/css-utilities/absolute.scss +54 -52
- package/src/css-utilities/background.scss +22 -24
- package/src/css-utilities/border.scss +21 -21
- package/src/css-utilities/box-shadow.scss +32 -21
- package/src/css-utilities/color.scss +23 -21
- package/src/css-utilities/flex.scss +55 -53
- package/src/css-utilities/group.scss +7 -0
- package/src/css-utilities/hidden.scss +22 -20
- package/src/css-utilities/icon.scss +32 -30
- package/src/css-utilities/layer.scss +10 -10
- package/src/css-utilities/reset.scss +27 -16
- package/src/css-utilities/surface.scss +206 -128
- package/src/css-utilities/text.scss +114 -114
- package/src/modifiers/background/scss/index.scss +1 -0
- package/src/modifiers/background/scss/variables.scss +24 -0
- package/src/modifiers/border/scss/index.scss +1 -0
- package/src/modifiers/border/scss/variables.scss +21 -0
- package/src/modifiers/box-shadow/scss/index.scss +1 -0
- package/src/modifiers/box-shadow/scss/variables.scss +12 -0
- package/src/modifiers/color/scss/index.scss +1 -0
- package/src/modifiers/color/scss/variables.scss +10 -0
- package/src/modifiers/scrollbar/scss/index.scss +3 -2
- package/src/modifiers/scrollbar/scss/variables.scss +4 -3
- package/src/shared/animation.ts +3 -3
- package/src/shared/drag.ts +8 -3
- package/src/tokens/scss/color.scss +53 -37
- package/src/tokens/scss/index.scss +0 -1
- package/src/tokens/scss/state.scss +16 -1
- package/storage/svg/code.svg +1 -1
- package/storage/svg/collapse.svg +1 -0
- package/storage/svg/grid.svg +1 -0
- package/storage/svg/stack.svg +1 -0
- package/build/components/banner/scss/index.scss +0 -2
- package/build/components/button/fan.d.ts +0 -24
- package/build/components/button/fan.js +0 -118
- package/build/components/button/hold.d.ts +0 -31
- package/build/components/button/hold.js +0 -115
- package/build/components/button/icons.d.ts +0 -6
- package/build/components/button/icons.js +0 -35
- package/build/components/button/loading.d.ts +0 -22
- package/build/components/button/loading.js +0 -60
- package/build/components/button/morph.d.ts +0 -22
- package/build/components/button/morph.js +0 -115
- package/build/components/card/expand.d.ts +0 -22
- package/build/components/card/expand.js +0 -118
- package/build/components/card/index.d.ts +0 -6
- package/build/components/card/index.js +0 -4
- package/build/components/chat-minimap/index.d.ts +0 -28
- package/build/components/chat-minimap/index.js +0 -223
- package/build/components/chat-minimap/scss/index.scss +0 -2
- package/build/components/clipboard/copy.d.ts +0 -27
- package/build/components/clipboard/copy.js +0 -48
- package/build/components/copy/index.js +0 -61
- package/build/components/copy/scss/index.scss +0 -2
- package/build/components/highlight/easing.d.ts +0 -2
- package/build/components/highlight/easing.js +0 -19
- package/build/components/pull-to-refresh/index.d.ts +0 -18
- package/build/components/pull-to-refresh/index.js +0 -222
- package/build/components/pull-to-refresh/scss/index.scss +0 -2
- package/src/components/banner/scss/index.scss +0 -37
- package/src/components/banner/scss/variables.scss +0 -16
- package/src/components/button/fan.ts +0 -170
- package/src/components/button/hold.ts +0 -154
- package/src/components/button/icons.ts +0 -21
- package/src/components/button/loading.ts +0 -77
- package/src/components/button/morph.ts +0 -153
- package/src/components/button/scss/_fan.scss +0 -121
- package/src/components/button/scss/_kbd.scss +0 -11
- package/src/components/button/scss/_morph.scss +0 -107
- package/src/components/button/scss/_sidebar.scss +0 -61
- package/src/components/button/scss/_split.scss +0 -53
- package/src/components/card/expand.ts +0 -141
- package/src/components/card/index.ts +0 -8
- package/src/components/card/scss/_expand.scss +0 -234
- package/src/components/chat-minimap/scss/variables.scss +0 -97
- package/src/components/clipboard/copy.ts +0 -49
- package/src/components/copy/index.ts +0 -69
- package/src/components/copy/scss/index.scss +0 -52
- package/src/components/copy/scss/variables.scss +0 -19
- package/src/components/editor/workspace/scss/keybindings.scss +0 -190
- package/src/components/editor/workspace/scss/tabs.scss +0 -56
- package/src/components/highlight/easing.ts +0 -33
- package/src/components/pagination/scss/_arrows.scss +0 -69
- package/src/components/pagination/scss/_cards.scss +0 -121
- package/src/components/pagination/scss/_dots.scss +0 -64
- package/src/components/progress/scss/_text.scss +0 -135
- package/src/components/pull-to-refresh/index.ts +0 -316
- package/src/components/pull-to-refresh/scss/index.scss +0 -128
- package/src/components/pull-to-refresh/scss/variables.scss +0 -38
- package/src/components/typewriter/scss/_caret.scss +0 -34
- package/src/components/typewriter/scss/_retype.scss +0 -68
- package/src/components/typewriter/scss/_rotate.scss +0 -29
- package/src/tokens/scss/transition.scss +0 -21
- /package/build/components/{chat-minimap/range.d.ts → chat/minimap/model.d.ts} +0 -0
- /package/src/components/{chat-minimap/range.ts → chat/minimap/model.ts} +0 -0
|
@@ -1,1231 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { effect, flush, onCleanup, read, root, signal, untrack, write } from '@esportsplus/reactivity';
|
|
3
|
-
import * as template_u1 from '@esportsplus/template';
|
|
4
|
-
import { component } from '@esportsplus/template';
|
|
5
|
-
import breadcrumb from '../../breadcrumb/index.js';
|
|
6
|
-
import sidebar from '../../button/sidebar.js';
|
|
7
|
-
import command from '../../command/index.js';
|
|
8
|
-
import fileTree, { FileTreeDecorations, FileTreeEditor, FileTreeElements, fileTreeIcon } from '../tree/index.js';
|
|
9
|
-
import highlight from '../../highlight/index.js';
|
|
10
|
-
import icon from '../../icon/index.js';
|
|
11
|
-
import input from '../../input/index.js';
|
|
12
|
-
import overlay from '../../overlay/index.js';
|
|
13
|
-
import tooltip from '../../tooltip/index.js';
|
|
14
|
-
import scrollbar from '../../../modifiers/scrollbar/index.js';
|
|
15
|
-
import fuzzy from '../../../shared/fuzzy.js';
|
|
16
|
-
import { mac } from '../../../shared/platform.js';
|
|
17
|
-
import { observe } from '../../../shared/resize.js';
|
|
18
|
-
import codeEditor from '../code/editor.js';
|
|
19
|
-
import { label as chordLabel, declare, merge, sequence } from './keybindings.js';
|
|
20
|
-
import { dirty, EditorWorkspaceModel } from './model.js';
|
|
21
|
-
import navigate from './navigate.js';
|
|
22
|
-
import hosted from './session.js';
|
|
23
|
-
import shortcuts, { OPEN, PALETTE } from './shortcuts.js';
|
|
24
|
-
import statusbar from './statusbar.js';
|
|
25
|
-
import tabStrip from './strip.js';
|
|
26
|
-
import left from '@esportsplus/ui/svg/arrow-left.svg';
|
|
27
|
-
import right from '@esportsplus/ui/svg/arrow-right.svg';
|
|
28
|
-
import collapse from '@esportsplus/ui/svg/chevrons-up-down.svg';
|
|
29
|
-
import close from '@esportsplus/ui/svg/close.svg';
|
|
30
|
-
import wrap from '@esportsplus/ui/svg/corner-down-right.svg';
|
|
31
|
-
import whitespace from '@esportsplus/ui/svg/eye.svg';
|
|
32
|
-
import save from '@esportsplus/ui/svg/save.svg';
|
|
33
|
-
import magnifier from '@esportsplus/ui/svg/search.svg';
|
|
34
|
-
import undo from '@esportsplus/ui/svg/undo.svg';
|
|
1
|
+
import template from './template.js';
|
|
35
2
|
import '../../button/scss/index.scss';
|
|
3
|
+
import '../../inline-edit/scss/index.scss';
|
|
36
4
|
import '../code/scss/index.scss';
|
|
37
5
|
import './scss/index.scss';
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const template_03uclquc = template_u1.template(`<!--$--><!--$-->`);
|
|
41
|
-
const template_03uclqug = template_u1.template(`<div class='command-group' role='group'><div class='command-group-label'>`);
|
|
42
|
-
const template_03uclquk = template_u1.template(`<div class='command-option'><!--$-->`);
|
|
43
|
-
const template_03uclquo = template_u1.template(`<div class='button code-workspace-tab' role='tab'><!--$--><span class='code-workspace-tab-name'></span><!--$--><!--$--><button class='button code-workspace-tab-close' tabindex='-1' type='button'>`);
|
|
44
|
-
const template_03uclquv = template_u1.template(`<span aria-label='Unsaved changes' class='code-workspace-tab-dirty' role='img'>`);
|
|
45
|
-
const template_03uclqux = template_u1.template(`<button class='button code-workspace-control' type='button'>`);
|
|
46
|
-
const template_03uclqu10 = template_u1.template(`<section aria-label='Editor workspace' class='code-workspace'><aside aria-label='File explorer' class='code-workspace-explorer'><div class='code-workspace-explorer-content'><div class='code-workspace-explorer-header'><!--$--><!--$--><!--$--><!--$--></div><div class='code-workspace-tree'><!--$--></div></div></aside><main class='code-workspace-main'><div aria-label='Open files' class='code-workspace-tabs' role='tablist'><!--$--></div><div class='code-workspace-bar'><!--$--><div class='code-workspace-actions'><!--$--><!--$--><!--$--></div></div><div class='code-workspace-editor' role='tabpanel'></div></main><footer class='code-workspace-status'><span class='code-workspace-status-path'></span><span class='code-workspace-status-position'></span><!--$--><span aria-live='polite' class='code-workspace-status-message' role='status'></span></footer><div class='code-workspace-layer' popover='manual'><!--$--><!--$--></div><!--$--><!--$-->`);
|
|
47
|
-
const template_03uclqu1t = template_u1.template(`<div class='code-workspace-notice'>No files in this workspace`);
|
|
48
|
-
const template_03uclqu1v = template_u1.template(`<div class='code-workspace-notice code-workspace-notice--cover' role='alert'><!--$--><button class='button code-workspace-retry' type='button'> Retry `);
|
|
49
|
-
const template_03uclqu1y = template_u1.template(`<div class='code-workspace-notice code-workspace-notice--cover' role='status'>Loading…`);
|
|
50
|
-
const template_03uclqu20 = template_u1.template(`<button aria-label='Peek file explorer' class='code-workspace-edge' type='button'>`);
|
|
51
|
-
const template_03uclqu23 = 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 `);
|
|
52
|
-
class ReactiveObject_03uclqu0 extends reactivity_u0.ReactiveObject {
|
|
53
|
-
#active = this[reactivity_u0.SIGNAL](false);
|
|
54
|
-
constructor() {
|
|
55
|
-
super(null);
|
|
56
|
-
}
|
|
57
|
-
get active() {
|
|
58
|
-
return reactivity_u0.read(this.#active);
|
|
59
|
-
}
|
|
60
|
-
set active(_v0) {
|
|
61
|
-
reactivity_u0.write(this.#active, _v0);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
class ReactiveObject_03uclqu1 extends reactivity_u0.ReactiveObject {
|
|
65
|
-
#active = this[reactivity_u0.SIGNAL](false);
|
|
66
|
-
constructor() {
|
|
67
|
-
super(null);
|
|
68
|
-
}
|
|
69
|
-
get active() {
|
|
70
|
-
return reactivity_u0.read(this.#active);
|
|
71
|
-
}
|
|
72
|
-
set active(_v0) {
|
|
73
|
-
reactivity_u0.write(this.#active, _v0);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
class ReactiveObject_03uclqu2 extends reactivity_u0.ReactiveObject {
|
|
77
|
-
#active = this[reactivity_u0.SIGNAL](false);
|
|
78
|
-
#index = this[reactivity_u0.SIGNAL](0);
|
|
79
|
-
#query = this[reactivity_u0.SIGNAL]('');
|
|
80
|
-
#tab;
|
|
81
|
-
constructor(_p0) {
|
|
82
|
-
super(null);
|
|
83
|
-
this.#tab = this[reactivity_u0.SIGNAL](_p0);
|
|
84
|
-
}
|
|
85
|
-
get active() {
|
|
86
|
-
return reactivity_u0.read(this.#active);
|
|
87
|
-
}
|
|
88
|
-
set active(_v0) {
|
|
89
|
-
reactivity_u0.write(this.#active, _v0);
|
|
90
|
-
}
|
|
91
|
-
get index() {
|
|
92
|
-
return reactivity_u0.read(this.#index);
|
|
93
|
-
}
|
|
94
|
-
set index(_v1) {
|
|
95
|
-
reactivity_u0.write(this.#index, _v1);
|
|
96
|
-
}
|
|
97
|
-
get query() {
|
|
98
|
-
return reactivity_u0.read(this.#query);
|
|
99
|
-
}
|
|
100
|
-
set query(_v2) {
|
|
101
|
-
reactivity_u0.write(this.#query, _v2);
|
|
102
|
-
}
|
|
103
|
-
get tab() {
|
|
104
|
-
return reactivity_u0.read(this.#tab);
|
|
105
|
-
}
|
|
106
|
-
set tab(_v3) {
|
|
107
|
-
reactivity_u0.write(this.#tab, _v3);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
class ReactiveObject_03uclqu3 extends reactivity_u0.ReactiveObject {
|
|
111
|
-
#selected = this[reactivity_u0.SIGNAL]('');
|
|
112
|
-
#selection;
|
|
113
|
-
constructor(_p0) {
|
|
114
|
-
super(null);
|
|
115
|
-
this.#selection = this[reactivity_u0.SIGNAL](_p0);
|
|
116
|
-
}
|
|
117
|
-
get selected() {
|
|
118
|
-
return reactivity_u0.read(this.#selected);
|
|
119
|
-
}
|
|
120
|
-
set selected(_v0) {
|
|
121
|
-
reactivity_u0.write(this.#selected, _v0);
|
|
122
|
-
}
|
|
123
|
-
get selection() {
|
|
124
|
-
return reactivity_u0.read(this.#selection);
|
|
125
|
-
}
|
|
126
|
-
set selection(_v1) {
|
|
127
|
-
reactivity_u0.write(this.#selection, _v1);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
class ReactiveObject_03uclqu4 extends reactivity_u0.ReactiveObject {
|
|
131
|
-
#busy = this[reactivity_u0.SIGNAL](false);
|
|
132
|
-
#canUndo = this[reactivity_u0.SIGNAL](false);
|
|
133
|
-
#collapsed = this[reactivity_u0.SIGNAL](false);
|
|
134
|
-
#compact = this[reactivity_u0.SIGNAL](false);
|
|
135
|
-
#cwd = this[reactivity_u0.SIGNAL]('');
|
|
136
|
-
#error = this[reactivity_u0.SIGNAL]('');
|
|
137
|
-
#explorerOpen = this[reactivity_u0.SIGNAL](true);
|
|
138
|
-
#left = this[reactivity_u0.SIGNAL](false);
|
|
139
|
-
#loaded = this[reactivity_u0.SIGNAL](false);
|
|
140
|
-
#path = this[reactivity_u0.SIGNAL]('');
|
|
141
|
-
#peek = this[reactivity_u0.SIGNAL](false);
|
|
142
|
-
#position = this[reactivity_u0.SIGNAL]('');
|
|
143
|
-
#project = this[reactivity_u0.SIGNAL]('');
|
|
144
|
-
#ready = this[reactivity_u0.SIGNAL](false);
|
|
145
|
-
#search = this[reactivity_u0.SIGNAL]('');
|
|
146
|
-
#status = this[reactivity_u0.SIGNAL]('');
|
|
147
|
-
#statusError = this[reactivity_u0.SIGNAL](false);
|
|
148
|
-
#tabs = this[reactivity_u0.SIGNAL](false);
|
|
149
|
-
#whitespace = this[reactivity_u0.SIGNAL](false);
|
|
150
|
-
#wrap = this[reactivity_u0.SIGNAL](false);
|
|
151
|
-
constructor() {
|
|
152
|
-
super(null);
|
|
153
|
-
}
|
|
154
|
-
get busy() {
|
|
155
|
-
return reactivity_u0.read(this.#busy);
|
|
156
|
-
}
|
|
157
|
-
set busy(_v0) {
|
|
158
|
-
reactivity_u0.write(this.#busy, _v0);
|
|
159
|
-
}
|
|
160
|
-
get canUndo() {
|
|
161
|
-
return reactivity_u0.read(this.#canUndo);
|
|
162
|
-
}
|
|
163
|
-
set canUndo(_v1) {
|
|
164
|
-
reactivity_u0.write(this.#canUndo, _v1);
|
|
165
|
-
}
|
|
166
|
-
get collapsed() {
|
|
167
|
-
return reactivity_u0.read(this.#collapsed);
|
|
168
|
-
}
|
|
169
|
-
set collapsed(_v2) {
|
|
170
|
-
reactivity_u0.write(this.#collapsed, _v2);
|
|
171
|
-
}
|
|
172
|
-
get compact() {
|
|
173
|
-
return reactivity_u0.read(this.#compact);
|
|
174
|
-
}
|
|
175
|
-
set compact(_v3) {
|
|
176
|
-
reactivity_u0.write(this.#compact, _v3);
|
|
177
|
-
}
|
|
178
|
-
get cwd() {
|
|
179
|
-
return reactivity_u0.read(this.#cwd);
|
|
180
|
-
}
|
|
181
|
-
set cwd(_v4) {
|
|
182
|
-
reactivity_u0.write(this.#cwd, _v4);
|
|
183
|
-
}
|
|
184
|
-
get error() {
|
|
185
|
-
return reactivity_u0.read(this.#error);
|
|
186
|
-
}
|
|
187
|
-
set error(_v5) {
|
|
188
|
-
reactivity_u0.write(this.#error, _v5);
|
|
189
|
-
}
|
|
190
|
-
get explorerOpen() {
|
|
191
|
-
return reactivity_u0.read(this.#explorerOpen);
|
|
192
|
-
}
|
|
193
|
-
set explorerOpen(_v6) {
|
|
194
|
-
reactivity_u0.write(this.#explorerOpen, _v6);
|
|
195
|
-
}
|
|
196
|
-
get left() {
|
|
197
|
-
return reactivity_u0.read(this.#left);
|
|
198
|
-
}
|
|
199
|
-
set left(_v7) {
|
|
200
|
-
reactivity_u0.write(this.#left, _v7);
|
|
201
|
-
}
|
|
202
|
-
get loaded() {
|
|
203
|
-
return reactivity_u0.read(this.#loaded);
|
|
204
|
-
}
|
|
205
|
-
set loaded(_v8) {
|
|
206
|
-
reactivity_u0.write(this.#loaded, _v8);
|
|
207
|
-
}
|
|
208
|
-
get path() {
|
|
209
|
-
return reactivity_u0.read(this.#path);
|
|
210
|
-
}
|
|
211
|
-
set path(_v9) {
|
|
212
|
-
reactivity_u0.write(this.#path, _v9);
|
|
213
|
-
}
|
|
214
|
-
get peek() {
|
|
215
|
-
return reactivity_u0.read(this.#peek);
|
|
216
|
-
}
|
|
217
|
-
set peek(_v10) {
|
|
218
|
-
reactivity_u0.write(this.#peek, _v10);
|
|
219
|
-
}
|
|
220
|
-
get position() {
|
|
221
|
-
return reactivity_u0.read(this.#position);
|
|
222
|
-
}
|
|
223
|
-
set position(_v11) {
|
|
224
|
-
reactivity_u0.write(this.#position, _v11);
|
|
225
|
-
}
|
|
226
|
-
get project() {
|
|
227
|
-
return reactivity_u0.read(this.#project);
|
|
228
|
-
}
|
|
229
|
-
set project(_v12) {
|
|
230
|
-
reactivity_u0.write(this.#project, _v12);
|
|
231
|
-
}
|
|
232
|
-
get ready() {
|
|
233
|
-
return reactivity_u0.read(this.#ready);
|
|
234
|
-
}
|
|
235
|
-
set ready(_v13) {
|
|
236
|
-
reactivity_u0.write(this.#ready, _v13);
|
|
237
|
-
}
|
|
238
|
-
get search() {
|
|
239
|
-
return reactivity_u0.read(this.#search);
|
|
240
|
-
}
|
|
241
|
-
set search(_v14) {
|
|
242
|
-
reactivity_u0.write(this.#search, _v14);
|
|
243
|
-
}
|
|
244
|
-
get status() {
|
|
245
|
-
return reactivity_u0.read(this.#status);
|
|
246
|
-
}
|
|
247
|
-
set status(_v15) {
|
|
248
|
-
reactivity_u0.write(this.#status, _v15);
|
|
249
|
-
}
|
|
250
|
-
get statusError() {
|
|
251
|
-
return reactivity_u0.read(this.#statusError);
|
|
252
|
-
}
|
|
253
|
-
set statusError(_v16) {
|
|
254
|
-
reactivity_u0.write(this.#statusError, _v16);
|
|
255
|
-
}
|
|
256
|
-
get tabs() {
|
|
257
|
-
return reactivity_u0.read(this.#tabs);
|
|
258
|
-
}
|
|
259
|
-
set tabs(_v17) {
|
|
260
|
-
reactivity_u0.write(this.#tabs, _v17);
|
|
261
|
-
}
|
|
262
|
-
get whitespace() {
|
|
263
|
-
return reactivity_u0.read(this.#whitespace);
|
|
264
|
-
}
|
|
265
|
-
set whitespace(_v18) {
|
|
266
|
-
reactivity_u0.write(this.#whitespace, _v18);
|
|
267
|
-
}
|
|
268
|
-
get wrap() {
|
|
269
|
-
return reactivity_u0.read(this.#wrap);
|
|
270
|
-
}
|
|
271
|
-
set wrap(_v19) {
|
|
272
|
-
reactivity_u0.write(this.#wrap, _v19);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
const COMPACT_WIDTH = 520;
|
|
276
|
-
let uid = 0;
|
|
277
|
-
function control({ active, disabled, label, onclick, sprite }) {
|
|
278
|
-
return (() => {
|
|
279
|
-
let root_03uclquw = template_03uclqux(), element_03uclquy = root_03uclquw.firstChild;
|
|
280
|
-
new template_u1.EffectSlot(element_03uclquy, () => icon({ 'aria-hidden': 'true', class: 'code-workspace-control-icon' }, typeof sprite === 'string' ? sprite : sprite()), 1);
|
|
281
|
-
template_u1.setProperty(element_03uclquy, 'aria-label', label);
|
|
282
|
-
template_u1.setProperty(element_03uclquy, 'aria-pressed', active && (() => (active() ? 'true' : 'false')));
|
|
283
|
-
template_u1.setList(element_03uclquy, 'class', active && (() => active() && '--active'));
|
|
284
|
-
template_u1.setProperty(element_03uclquy, 'disabled', disabled);
|
|
285
|
-
template_u1.delegate(element_03uclquy, 'click', onclick);
|
|
286
|
-
template_u1.setProperty(element_03uclquy, 'title', label);
|
|
287
|
-
return root_03uclquw;
|
|
288
|
-
})();
|
|
289
|
-
}
|
|
290
|
-
function keys(names) {
|
|
291
|
-
let apple = mac();
|
|
292
|
-
return names.map((name) => (name === 'Mod' ? (apple ? '⌘' : 'Ctrl') : name));
|
|
293
|
-
}
|
|
294
|
-
function label(text, names) {
|
|
295
|
-
return `${text} (${keys(names).join(mac() ? '' : '+')})`;
|
|
296
|
-
}
|
|
297
|
-
function name(path) {
|
|
298
|
-
return path.slice(path.lastIndexOf('/') + 1);
|
|
299
|
-
}
|
|
300
|
-
function reconcile(store, entries) {
|
|
301
|
-
let nodes = new Map();
|
|
302
|
-
for (let i = 0, n = entries.length; i < n; i++) {
|
|
303
|
-
let entry = entries[i], id = '', parts = entry.path.split('/');
|
|
304
|
-
for (let length = 1, m = parts.length; length <= m; length++) {
|
|
305
|
-
let folder = length < m || entry.kind === 'directory', parent = length === 1 ? null : id;
|
|
306
|
-
id = parent === null ? parts[0] : `${parent}/${parts[length - 1]}`;
|
|
307
|
-
nodes.set(id, {
|
|
308
|
-
depth: length,
|
|
309
|
-
element: { id, name: parts[length - 1], type: folder ? 'folder' : 'file', ...(folder ? { children: [] } : {}) },
|
|
310
|
-
parent
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
for (let [id, { element }] of [...store.index]) {
|
|
315
|
-
if (nodes.get(id)?.element.type !== element.type) {
|
|
316
|
-
store.remove(id);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
let sorted = [...nodes].sort(([, a], [, b]) => a.depth - b.depth);
|
|
320
|
-
for (let i = 0, n = sorted.length; i < n; i++) {
|
|
321
|
-
let [id, node] = sorted[i];
|
|
322
|
-
if (!store.get(id)) {
|
|
323
|
-
store.add(node.element, node.parent);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
const isWorkspaceCodeEditor = (controller) => 'goToLine' in controller && 'rectAt' in controller && 'refresh' in controller;
|
|
328
|
-
const workspace = ({ addons, controller: receive, cwd = '', decorations: provided, editor: editorFor, editorOptions, host, model: supplied, openTarget, ...attributes }) => {
|
|
329
|
-
if (!supplied && !host) {
|
|
330
|
-
throw new Error('Workspace: editor.workspace requires a WorkspaceHost or EditorWorkspaceModel');
|
|
331
|
-
}
|
|
332
|
-
let actions, active = signal(undefined), activeId = signal(0), bindings = signal({}), chords = sequence({
|
|
333
|
-
accept: (event) => !confirmation && !!container?.contains(event.target),
|
|
334
|
-
actions: { [OPEN[1]]: () => openKeybindings() },
|
|
335
|
-
apple: mac(),
|
|
336
|
-
onpending: (pending) => {
|
|
337
|
-
let text = `${chordLabel(OPEN[0], mac())} was pressed; waiting for the next key…`;
|
|
338
|
-
if (pending) {
|
|
339
|
-
model.status(text);
|
|
340
|
-
}
|
|
341
|
-
else if (model.state.status === text) {
|
|
342
|
-
model.status('');
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
prefix: OPEN[0]
|
|
346
|
-
}), confirmation, container, decorated = new Map(), decorations = new FileTreeDecorations(), dialog = new ReactiveObject_03uclqu0(), elements = new WeakMap(), entries, files = signal([]), flags = new Map(), focusing = false, hovered = false, id = `code-workspace-${++uid}`, keyboard = new ReactiveObject_03uclqu1(), model = supplied ?? new EditorWorkspaceModel(host, cwd), mount, palette = new ReactiveObject_03uclqu2('all'), release, request = signal(undefined), returnFocus, revealed = 0, searchField, settle, shown = signal(undefined), statusBar = statusbar(model, () => navigation.go('problem')), strip = tabStrip({
|
|
347
|
-
isFile: (path) => treeStore.get(path)?.type === 'file',
|
|
348
|
-
model,
|
|
349
|
-
remount,
|
|
350
|
-
reveal: (path) => {
|
|
351
|
-
peek(true, true);
|
|
352
|
-
treeState.selected = '';
|
|
353
|
-
flush();
|
|
354
|
-
treeState.selected = path;
|
|
355
|
-
}
|
|
356
|
-
}), tabs = signal([]), tabsKey = '', target = signal(undefined), tree, treeEditor = new FileTreeEditor(), treeState = new ReactiveObject_03uclqu3(new Set()), treeStore = new FileTreeElements([]), view = new ReactiveObject_03uclqu4();
|
|
357
|
-
let hosting = hosted(model, () => (mount?.controller ? { controller: mount.controller, tab: mount.tab } : undefined)), navigation = navigate({
|
|
358
|
-
bindings: () => (mount ? settings(mount.tab, mount.tab.path).keybindings : model.state.preferences.keybindings),
|
|
359
|
-
hosting,
|
|
360
|
-
model,
|
|
361
|
-
tree: () => tree
|
|
362
|
-
});
|
|
363
|
-
function ask(next) {
|
|
364
|
-
confirmation?.resolve('cancel');
|
|
365
|
-
returnFocus = container?.ownerDocument.activeElement ?? undefined;
|
|
366
|
-
return new Promise((resolve) => {
|
|
367
|
-
let current = {
|
|
368
|
-
request: next,
|
|
369
|
-
resolve: (decision) => {
|
|
370
|
-
if (confirmation !== current) {
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
confirmation = undefined;
|
|
374
|
-
dialog.active = false;
|
|
375
|
-
settle = () => {
|
|
376
|
-
if (returnFocus?.isConnected) {
|
|
377
|
-
returnFocus.focus({ preventScroll: true });
|
|
378
|
-
}
|
|
379
|
-
else {
|
|
380
|
-
focusEditor();
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
resolve(decision);
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
confirmation = current;
|
|
387
|
-
write(request, next);
|
|
388
|
-
dialog.active = true;
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
function attach(current) {
|
|
392
|
-
let controller = current.controller;
|
|
393
|
-
detach(current);
|
|
394
|
-
statusBar.attach(controller);
|
|
395
|
-
write(current.path, current.tab.path);
|
|
396
|
-
if (!addons || !controller) {
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
try {
|
|
400
|
-
current.addon = addons({
|
|
401
|
-
controller,
|
|
402
|
-
host: controller.host,
|
|
403
|
-
tab: current.tab,
|
|
404
|
-
workspace: model
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
catch (error) {
|
|
408
|
-
model.status(`Editor addon failed: ${String(error)}`, true);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function bridge() {
|
|
412
|
-
let state = model.state, current = state.active, key = '', list = state.tabs;
|
|
413
|
-
if (entries !== state.entries) {
|
|
414
|
-
entries = state.entries;
|
|
415
|
-
reconcile(treeStore, entries);
|
|
416
|
-
let paths = [];
|
|
417
|
-
for (let i = 0, n = entries.length; i < n; i++) {
|
|
418
|
-
if (entries[i].kind === 'file') {
|
|
419
|
-
paths.push(entries[i].path);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
write(files, paths);
|
|
423
|
-
}
|
|
424
|
-
for (let i = 0, n = list.length; i < n; i++) {
|
|
425
|
-
key += `${list[i].id}:${list[i].path}:${list[i].pinned}:${list[i].preview}\n`;
|
|
426
|
-
}
|
|
427
|
-
if (key !== tabsKey) {
|
|
428
|
-
tabsKey = key;
|
|
429
|
-
write(tabs, [...list]);
|
|
430
|
-
}
|
|
431
|
-
write(active, current);
|
|
432
|
-
write(activeId, current?.id ?? 0);
|
|
433
|
-
write(bindings, state.preferences.keybindings);
|
|
434
|
-
show(current);
|
|
435
|
-
view.busy = state.busy > 0;
|
|
436
|
-
view.canUndo = state.canUndoFiles;
|
|
437
|
-
view.collapsed = list.length > 0 && !state.preferences.explorerOpen;
|
|
438
|
-
view.cwd = state.cwd;
|
|
439
|
-
view.error = state.error;
|
|
440
|
-
view.explorerOpen = state.preferences.explorerOpen;
|
|
441
|
-
view.left = state.preferences.explorerSide === 'left';
|
|
442
|
-
view.loaded = state.loaded;
|
|
443
|
-
view.project = state.cwd.split(/[\\/]/).filter(Boolean).at(-1) ?? '';
|
|
444
|
-
view.status = state.status ||
|
|
445
|
-
(state.opening.length
|
|
446
|
-
? `Opening ${state.opening.at(-1)}…`
|
|
447
|
-
: state.busy
|
|
448
|
-
? 'Working…'
|
|
449
|
-
: state.loading
|
|
450
|
-
? 'Refreshing…'
|
|
451
|
-
: current?.missing
|
|
452
|
-
? 'File removed from disk; draft retained'
|
|
453
|
-
: '');
|
|
454
|
-
view.statusError = !!state.status && state.statusKind === 'error';
|
|
455
|
-
view.tabs = list.length > 0;
|
|
456
|
-
view.whitespace = state.preferences.showWhitespace;
|
|
457
|
-
view.wrap = state.preferences.wrapText;
|
|
458
|
-
if (!view.collapsed) {
|
|
459
|
-
view.peek = false;
|
|
460
|
-
view.ready = false;
|
|
461
|
-
}
|
|
462
|
-
let path = current && !current.compare ? current.path : '';
|
|
463
|
-
if (view.path !== path) {
|
|
464
|
-
view.path = path;
|
|
465
|
-
treeState.selected = path;
|
|
466
|
-
if (mount && mount.tab === current && read(mount.path) !== path) {
|
|
467
|
-
attach(mount);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
decorate(list);
|
|
471
|
-
reveal();
|
|
472
|
-
}
|
|
473
|
-
function choose(entry) {
|
|
474
|
-
if (entry.group === PALETTE.group && entry.id === PALETTE.id) {
|
|
475
|
-
settle = openKeybindings;
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
let opened = model.open(entry.id);
|
|
479
|
-
settle = () => {
|
|
480
|
-
void opened.then(focusEditor);
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
|
-
function connect(element) {
|
|
484
|
-
release?.();
|
|
485
|
-
container = element;
|
|
486
|
-
release = root((dispose) => {
|
|
487
|
-
let listening = new AbortController(), unobserve = observe(element, ([entry]) => {
|
|
488
|
-
view.compact = entry.contentRect.width <= COMPACT_WIDTH;
|
|
489
|
-
});
|
|
490
|
-
bridge();
|
|
491
|
-
element.setAttribute('aria-keyshortcuts', declare(element.getAttribute('aria-keyshortcuts'), OPEN[0]));
|
|
492
|
-
element.ownerDocument.addEventListener('keydown', keydown, { signal: listening.signal });
|
|
493
|
-
element.ownerDocument.addEventListener('keydown', chords.keydown, { capture: true, signal: listening.signal });
|
|
494
|
-
element.addEventListener('close', () => {
|
|
495
|
-
let next = settle;
|
|
496
|
-
settle = undefined;
|
|
497
|
-
next?.();
|
|
498
|
-
}, { capture: true, signal: listening.signal });
|
|
499
|
-
model.setConfirmation(ask);
|
|
500
|
-
onCleanup(model.subscribe(bridge));
|
|
501
|
-
onCleanup(hosting.connect(element));
|
|
502
|
-
onCleanup(navigation.connect(element));
|
|
503
|
-
onCleanup(statusBar.connect(element));
|
|
504
|
-
onCleanup(() => {
|
|
505
|
-
listening.abort();
|
|
506
|
-
chords.cancel();
|
|
507
|
-
unobserve();
|
|
508
|
-
confirmation?.resolve('cancel');
|
|
509
|
-
model.setConfirmation(undefined);
|
|
510
|
-
model.stop();
|
|
511
|
-
if (mount) {
|
|
512
|
-
unmount(mount);
|
|
513
|
-
}
|
|
514
|
-
container = undefined;
|
|
515
|
-
release = undefined;
|
|
516
|
-
});
|
|
517
|
-
effect(() => {
|
|
518
|
-
let tab = read(active);
|
|
519
|
-
if (!tab || tab.compare) {
|
|
520
|
-
view.position = '';
|
|
521
|
-
return;
|
|
522
|
-
}
|
|
523
|
-
let document = tab.document, update = () => {
|
|
524
|
-
let position = document.position();
|
|
525
|
-
view.position = `Ln ${position.line}, Col ${position.column}`;
|
|
526
|
-
};
|
|
527
|
-
update();
|
|
528
|
-
onCleanup(document.subscribe((_, change) => {
|
|
529
|
-
if (change.selectionChanged || change.textChanged) {
|
|
530
|
-
update();
|
|
531
|
-
}
|
|
532
|
-
}));
|
|
533
|
-
});
|
|
534
|
-
effect(() => {
|
|
535
|
-
let path = treeState.selected;
|
|
536
|
-
if (path && treeStore.get(path)?.type === 'file') {
|
|
537
|
-
untrack(() => {
|
|
538
|
-
if (path !== model.state.active?.path) {
|
|
539
|
-
void model.open(path, undefined, undefined, true);
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
});
|
|
544
|
-
effect(() => {
|
|
545
|
-
let next = typeof openTarget === 'function' ? openTarget() : openTarget;
|
|
546
|
-
if (next) {
|
|
547
|
-
untrack(() => {
|
|
548
|
-
void model.start().then(() => model.openTarget(next));
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
});
|
|
552
|
-
effect(() => {
|
|
553
|
-
if (!dialog.active) {
|
|
554
|
-
untrack(() => confirmation?.resolve('cancel'));
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
void hosting.restore();
|
|
558
|
-
return dispose;
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
function crumbs() {
|
|
562
|
-
let path = view.path;
|
|
563
|
-
if (!path) {
|
|
564
|
-
return '';
|
|
565
|
-
}
|
|
566
|
-
let parts = path.split('/'), project = view.project, items = [];
|
|
567
|
-
if (project) {
|
|
568
|
-
items.push({ href: '#', label: project });
|
|
569
|
-
}
|
|
570
|
-
for (let i = 0, n = parts.length; i < n; i++) {
|
|
571
|
-
items.push({ href: `#${parts.slice(0, i + 1).join('/')}`, label: parts[i] });
|
|
572
|
-
}
|
|
573
|
-
return breadcrumb({
|
|
574
|
-
class: 'breadcrumb--compact code-workspace-breadcrumb',
|
|
575
|
-
items,
|
|
576
|
-
label: 'File path',
|
|
577
|
-
onnavigate: (item) => locate(item.href.slice(1)),
|
|
578
|
-
separator: 'chevron'
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
function decorate(list) {
|
|
582
|
-
let ids = new Set(), open = new Set();
|
|
583
|
-
for (let i = 0, n = list.length; i < n; i++) {
|
|
584
|
-
let tab = list[i], unsaved = dirty(tab);
|
|
585
|
-
ids.add(tab.id);
|
|
586
|
-
open.add(tab.path);
|
|
587
|
-
write(flag(tab), unsaved);
|
|
588
|
-
if (decorated.get(tab.path) !== unsaved) {
|
|
589
|
-
decorated.set(tab.path, unsaved);
|
|
590
|
-
decorations.update([[tab.path, { editor: { open: true, unsaved } }]]);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
for (let path of [...decorated.keys()]) {
|
|
594
|
-
if (!open.has(path)) {
|
|
595
|
-
decorated.delete(path);
|
|
596
|
-
decorations.update([[path, null]]);
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
for (let id of [...flags.keys()]) {
|
|
600
|
-
if (!ids.has(id)) {
|
|
601
|
-
flags.delete(id);
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
function detach(current) {
|
|
606
|
-
let stop = current.addon;
|
|
607
|
-
current.addon = undefined;
|
|
608
|
-
try {
|
|
609
|
-
stop?.();
|
|
610
|
-
}
|
|
611
|
-
catch (error) {
|
|
612
|
-
model.status(`Editor addon failed: ${String(error)}`, true);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
function flag(tab) {
|
|
616
|
-
let found = flags.get(tab.id);
|
|
617
|
-
if (!found) {
|
|
618
|
-
found = signal(dirty(tab));
|
|
619
|
-
flags.set(tab.id, found);
|
|
620
|
-
}
|
|
621
|
-
return found;
|
|
622
|
-
}
|
|
623
|
-
function focusEditor() {
|
|
624
|
-
let tab = model.state.active;
|
|
625
|
-
focusing = false;
|
|
626
|
-
if (!tab) {
|
|
627
|
-
searchField?.focus();
|
|
628
|
-
return;
|
|
629
|
-
}
|
|
630
|
-
if (mount?.controller && mount.tab === tab) {
|
|
631
|
-
mount.controller.focus();
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
634
|
-
focusing = true;
|
|
635
|
-
}
|
|
636
|
-
function keydown(event) {
|
|
637
|
-
if (event.defaultPrevented || event.isComposing || !container || confirmation) {
|
|
638
|
-
return;
|
|
639
|
-
}
|
|
640
|
-
let inside = container.contains(event.target), key = event.key.toLowerCase(), mod = (event.ctrlKey || event.metaKey) && !event.altKey;
|
|
641
|
-
if (mod && !event.shiftKey && key === 'p' && (inside || hovered)) {
|
|
642
|
-
event.preventDefault();
|
|
643
|
-
quickOpen();
|
|
644
|
-
return;
|
|
645
|
-
}
|
|
646
|
-
if (!inside) {
|
|
647
|
-
return;
|
|
648
|
-
}
|
|
649
|
-
if (mod && key === 's') {
|
|
650
|
-
event.preventDefault();
|
|
651
|
-
void model.save();
|
|
652
|
-
}
|
|
653
|
-
else if (mod && key === 'w') {
|
|
654
|
-
event.preventDefault();
|
|
655
|
-
void model.close();
|
|
656
|
-
}
|
|
657
|
-
else if (mod && key === 'z' && !event.shiftKey && event.target.closest('.file-tree') && !event.target.closest('input, textarea, [contenteditable=true]')) {
|
|
658
|
-
event.preventDefault();
|
|
659
|
-
void model.undoFiles();
|
|
660
|
-
}
|
|
661
|
-
else if (key === 'escape' && view.peek) {
|
|
662
|
-
event.preventDefault();
|
|
663
|
-
peek(false);
|
|
664
|
-
focusEditor();
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
function locate(path) {
|
|
668
|
-
peek(true, true);
|
|
669
|
-
if (!path) {
|
|
670
|
-
tree?.collapseAll();
|
|
671
|
-
return;
|
|
672
|
-
}
|
|
673
|
-
if (path !== view.path) {
|
|
674
|
-
treeState.selected = path;
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
function openKeybindings() {
|
|
678
|
-
palette.active = false;
|
|
679
|
-
keyboard.active = true;
|
|
680
|
-
}
|
|
681
|
-
function pane() {
|
|
682
|
-
let next = read(shown);
|
|
683
|
-
if (!next) {
|
|
684
|
-
return (() => {
|
|
685
|
-
let root_03uclqu5 = template_03uclqu6(), element_03uclqu7 = root_03uclqu5.firstChild.firstElementChild;
|
|
686
|
-
template_u1.slot(element_03uclqu7, keys(['Mod', 'P']).map((key) => {
|
|
687
|
-
let root_03uclqu8 = template_03uclqu9(), element_03uclqua = root_03uclqu8.firstChild;
|
|
688
|
-
template_u1.slot(element_03uclqua, key, 1);
|
|
689
|
-
return root_03uclqu8;
|
|
690
|
-
}), 1);
|
|
691
|
-
return root_03uclqu5;
|
|
692
|
-
})();
|
|
693
|
-
}
|
|
694
|
-
let current = next.released ? { editor: next.editor, path: signal(next.tab.path), released: false, tab: next.tab } : next, bound = {
|
|
695
|
-
class: 'code-workspace-document',
|
|
696
|
-
controller: (controller) => {
|
|
697
|
-
if (current.released) {
|
|
698
|
-
return;
|
|
699
|
-
}
|
|
700
|
-
current.controller = controller;
|
|
701
|
-
restore(current);
|
|
702
|
-
attach(current);
|
|
703
|
-
reveal();
|
|
704
|
-
if (focusing) {
|
|
705
|
-
focusing = false;
|
|
706
|
-
queueMicrotask(() => {
|
|
707
|
-
if (!current.released) {
|
|
708
|
-
controller.focus();
|
|
709
|
-
}
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
},
|
|
713
|
-
document: current.tab.document,
|
|
714
|
-
onSave: () => {
|
|
715
|
-
void model.save(current.tab);
|
|
716
|
-
},
|
|
717
|
-
options: () => settings(current.tab, read(current.path))
|
|
718
|
-
};
|
|
719
|
-
mount = current;
|
|
720
|
-
onCleanup(() => unmount(current));
|
|
721
|
-
return untrack(() => current.editor(bound));
|
|
722
|
-
}
|
|
723
|
-
function peek(open, keyboard = false) {
|
|
724
|
-
if (!view.collapsed) {
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
if (!open) {
|
|
728
|
-
view.peek = false;
|
|
729
|
-
view.ready = false;
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
732
|
-
view.peek = true;
|
|
733
|
-
if (keyboard || container?.ownerDocument.defaultView?.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
|
734
|
-
view.ready = true;
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
function quickOpen(query = '') {
|
|
738
|
-
if (palette.active) {
|
|
739
|
-
palette.active = false;
|
|
740
|
-
return;
|
|
741
|
-
}
|
|
742
|
-
palette.active = true;
|
|
743
|
-
flush();
|
|
744
|
-
palette.query = query;
|
|
745
|
-
}
|
|
746
|
-
function reach() {
|
|
747
|
-
peek(true, true);
|
|
748
|
-
flush();
|
|
749
|
-
searchField?.focus();
|
|
750
|
-
}
|
|
751
|
-
function results(groups) {
|
|
752
|
-
return (() => {
|
|
753
|
-
let root_03uclqub = template_03uclquc(), element_03uclqud = root_03uclqub.firstChild, element_03uclque = element_03uclqud.nextSibling;
|
|
754
|
-
template_u1.slot(element_03uclqud, highlight({ class: 'command-highlight', hover: false, target: '.command-option' }));
|
|
755
|
-
template_u1.slot(element_03uclque, groups.map((group) => {
|
|
756
|
-
let root_03uclquf = template_03uclqug(), element_03uclquh = root_03uclquf.firstChild, element_03uclqui = element_03uclquh.firstElementChild;
|
|
757
|
-
template_u1.slot(element_03uclqui, group.label, 1);
|
|
758
|
-
template_u1.slot(element_03uclquh, group.items.map((item) => {
|
|
759
|
-
let root_03uclquj = template_03uclquk(), element_03uclqul = root_03uclquj.firstChild, element_03uclqum = element_03uclqul.firstChild;
|
|
760
|
-
template_u1.slot(element_03uclqum, item.command?.icon
|
|
761
|
-
? icon({ 'aria-hidden': 'true', class: 'code-workspace-command-icon' }, item.command.icon)
|
|
762
|
-
: fileTreeIcon({ name: name(item.id), type: 'file' }, false));
|
|
763
|
-
template_u1.slot(element_03uclqul, item.content, 2);
|
|
764
|
-
template_u1.setProperties(element_03uclqul, item.attributes);
|
|
765
|
-
return root_03uclquj;
|
|
766
|
-
}), 2);
|
|
767
|
-
template_u1.setProperty(element_03uclqui, 'id', group.id);
|
|
768
|
-
template_u1.setProperty(element_03uclquh, 'aria-labelledby', group.id);
|
|
769
|
-
return root_03uclquf;
|
|
770
|
-
}));
|
|
771
|
-
return root_03uclqub;
|
|
772
|
-
})();
|
|
773
|
-
}
|
|
774
|
-
function remember(current) {
|
|
775
|
-
let element = current.controller.scroller;
|
|
776
|
-
current.tab.scroll = { left: element.scrollLeft, top: element.scrollTop };
|
|
777
|
-
hosting.remember(current.tab, current.controller);
|
|
778
|
-
}
|
|
779
|
-
function remount() {
|
|
780
|
-
if (mount) {
|
|
781
|
-
unmount(mount);
|
|
782
|
-
}
|
|
783
|
-
show(model.state.active);
|
|
784
|
-
}
|
|
785
|
-
function restore(current) {
|
|
786
|
-
hosting.shown(current.tab, current.controller);
|
|
787
|
-
let element = current.controller.scroller, { left, top } = current.tab.scroll, tab = current.tab;
|
|
788
|
-
element.scrollLeft = left;
|
|
789
|
-
element.scrollTop = top;
|
|
790
|
-
if (Math.abs(element.scrollLeft - left) > 1 || Math.abs(element.scrollTop - top) > 1) {
|
|
791
|
-
requestAnimationFrame(() => {
|
|
792
|
-
if (!current.released && current.tab === tab) {
|
|
793
|
-
element.scrollLeft = left;
|
|
794
|
-
element.scrollTop = top;
|
|
795
|
-
}
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
function retarget(current, tab) {
|
|
800
|
-
remember(current);
|
|
801
|
-
detach(current);
|
|
802
|
-
current.tab = tab;
|
|
803
|
-
current.controller.setDocument(tab.document, settings(tab, tab.path));
|
|
804
|
-
restore(current);
|
|
805
|
-
attach(current);
|
|
806
|
-
reveal();
|
|
807
|
-
}
|
|
808
|
-
function reveal() {
|
|
809
|
-
let controller = mount?.controller, state = model.state, next = state.reveal;
|
|
810
|
-
if (!controller || !next || !state.active || next.request === revealed || controller.document !== state.active.document || state.active.id !== next.tabId) {
|
|
811
|
-
return;
|
|
812
|
-
}
|
|
813
|
-
revealed = next.request;
|
|
814
|
-
if (isWorkspaceCodeEditor(controller)) {
|
|
815
|
-
controller.goToLine(next.line, next.column);
|
|
816
|
-
return;
|
|
817
|
-
}
|
|
818
|
-
let offset = controller.document.offset(next.line, next.column);
|
|
819
|
-
controller.select({ end: offset, start: offset });
|
|
820
|
-
}
|
|
821
|
-
function search(query) {
|
|
822
|
-
view.search = query;
|
|
823
|
-
tree?.search(query);
|
|
824
|
-
}
|
|
825
|
-
function selected() {
|
|
826
|
-
return [...treeState.selection].filter((path) => treeStore.get(path));
|
|
827
|
-
}
|
|
828
|
-
function settings(tab, path) {
|
|
829
|
-
let options = typeof editorOptions === 'function' ? editorOptions(tab) : editorOptions;
|
|
830
|
-
return {
|
|
831
|
-
fold: true,
|
|
832
|
-
minimap: true,
|
|
833
|
-
onMerge: () => {
|
|
834
|
-
void strip.merge(tab);
|
|
835
|
-
},
|
|
836
|
-
...options,
|
|
837
|
-
...statusBar.options(tab),
|
|
838
|
-
...(model.host.baseline ? { baseline: hosting.baseline(path) } : {}),
|
|
839
|
-
fileName: path,
|
|
840
|
-
keybindings: merge(options?.keybindings, read(bindings)),
|
|
841
|
-
label: path,
|
|
842
|
-
whitespace: view.whitespace,
|
|
843
|
-
wrap: view.wrap
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
function show(tab) {
|
|
847
|
-
if (mount?.tab === tab) {
|
|
848
|
-
return;
|
|
849
|
-
}
|
|
850
|
-
let editor = tab && (strip.editor(tab) ?? editorFor?.(tab) ?? codeEditor);
|
|
851
|
-
if (tab && mount?.controller?.setDocument && mount.editor === editor) {
|
|
852
|
-
retarget(mount, tab);
|
|
853
|
-
return;
|
|
854
|
-
}
|
|
855
|
-
if (mount) {
|
|
856
|
-
unmount(mount);
|
|
857
|
-
}
|
|
858
|
-
mount = tab && editor && { editor, path: signal(tab.path), released: false, tab };
|
|
859
|
-
write(shown, mount);
|
|
860
|
-
}
|
|
861
|
-
function tab(entry) {
|
|
862
|
-
let chosen = () => signal.selector(activeId, entry.id), file = strip.label(entry);
|
|
863
|
-
return (() => {
|
|
864
|
-
let root_03uclqun = template_03uclquo(), element_03uclqup = root_03uclqun.firstChild, element_03uclquq = element_03uclqup.firstChild, element_03uclqur = element_03uclqup.firstElementChild, element_03uclqus = element_03uclquq.nextSibling.nextSibling, element_03uclqut = element_03uclqus.nextSibling, element_03uclquu = element_03uclqur.nextElementSibling;
|
|
865
|
-
template_u1.slot(element_03uclquq, fileTreeIcon({ name: file, type: 'file' }, false));
|
|
866
|
-
template_u1.slot(element_03uclqur, file, 1);
|
|
867
|
-
template_u1.slot(element_03uclqus, strip.pin(entry));
|
|
868
|
-
new template_u1.EffectSlot(element_03uclqut, () => read(flag(entry)) && template_03uclquv());
|
|
869
|
-
template_u1.slot(element_03uclquu, icon({ 'aria-hidden': 'true', class: 'code-workspace-tab-close-icon' }, close), 1);
|
|
870
|
-
template_u1.setProperty(element_03uclquu, 'aria-label', template_u1.interpolate(["Close ", (file)]));
|
|
871
|
-
template_u1.setProperty(element_03uclquu, 'title', label('Close', ['Mod', 'W']));
|
|
872
|
-
template_u1.delegate(element_03uclquu, 'click', (event) => {
|
|
873
|
-
event.stopPropagation();
|
|
874
|
-
void model.close(entry.path);
|
|
875
|
-
});
|
|
876
|
-
template_u1.setProperty(element_03uclqup, 'aria-controls', template_u1.interpolate([(id), "-panel"]));
|
|
877
|
-
template_u1.setProperty(element_03uclqup, 'id', template_u1.interpolate([(id), "-tab-", (entry.id)]));
|
|
878
|
-
template_u1.setProperty(element_03uclqup, 'title', strip.title(entry));
|
|
879
|
-
template_u1.setProperty(element_03uclqup, 'aria-selected', () => (chosen() ? 'true' : 'false'));
|
|
880
|
-
template_u1.setList(element_03uclqup, 'class', () => chosen() && '--active');
|
|
881
|
-
template_u1.delegate(element_03uclqup, 'auxclick', (event) => {
|
|
882
|
-
if (event.button === 1) {
|
|
883
|
-
event.preventDefault();
|
|
884
|
-
void model.close(entry.path);
|
|
885
|
-
}
|
|
886
|
-
});
|
|
887
|
-
template_u1.delegate(element_03uclqup, 'click', () => {
|
|
888
|
-
model.activate(entry);
|
|
889
|
-
focusEditor();
|
|
890
|
-
});
|
|
891
|
-
template_u1.onconnect(element_03uclqup, (element) => {
|
|
892
|
-
elements.set(entry, element);
|
|
893
|
-
});
|
|
894
|
-
template_u1.delegate(element_03uclqup, 'keydown', (event) => {
|
|
895
|
-
let list = untrack(() => read(tabs)), at = list.indexOf(entry), next;
|
|
896
|
-
if (event.key === 'ArrowRight') {
|
|
897
|
-
next = list[(at + 1) % list.length];
|
|
898
|
-
}
|
|
899
|
-
else if (event.key === 'ArrowLeft') {
|
|
900
|
-
next = list[(at - 1 + list.length) % list.length];
|
|
901
|
-
}
|
|
902
|
-
else if (event.key === 'Home') {
|
|
903
|
-
next = list[0];
|
|
904
|
-
}
|
|
905
|
-
else if (event.key === 'End') {
|
|
906
|
-
next = list.at(-1);
|
|
907
|
-
}
|
|
908
|
-
else if (event.key === 'Enter' || event.key === ' ') {
|
|
909
|
-
event.preventDefault();
|
|
910
|
-
model.activate(entry);
|
|
911
|
-
focusEditor();
|
|
912
|
-
return;
|
|
913
|
-
}
|
|
914
|
-
if (next) {
|
|
915
|
-
event.preventDefault();
|
|
916
|
-
model.activate(next);
|
|
917
|
-
elements.get(next)?.focus();
|
|
918
|
-
}
|
|
919
|
-
});
|
|
920
|
-
template_u1.setProperty(element_03uclqup, 'tabindex', () => (chosen() ? 0 : -1));
|
|
921
|
-
template_u1.setProperties(element_03uclqup, strip.attributes(entry));
|
|
922
|
-
return root_03uclqun;
|
|
923
|
-
})();
|
|
924
|
-
}
|
|
925
|
-
function toggle(key) {
|
|
926
|
-
model.setPreferences({ [key]: !model.state.preferences[key] });
|
|
927
|
-
view.peek = false;
|
|
928
|
-
view.ready = false;
|
|
929
|
-
}
|
|
930
|
-
function unmount(current) {
|
|
931
|
-
if (current.released) {
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
let controller = current.controller;
|
|
935
|
-
current.released = true;
|
|
936
|
-
if (mount === current) {
|
|
937
|
-
mount = undefined;
|
|
938
|
-
statusBar.attach(undefined);
|
|
939
|
-
}
|
|
940
|
-
if (controller?.host.isConnected) {
|
|
941
|
-
remember(current);
|
|
942
|
-
}
|
|
943
|
-
detach(current);
|
|
944
|
-
}
|
|
945
|
-
let api = {
|
|
946
|
-
close: (path) => model.close(path),
|
|
947
|
-
collapseAll: () => tree?.collapseAll(),
|
|
948
|
-
delete: (paths = selected()) => model.delete(paths),
|
|
949
|
-
dispose: () => {
|
|
950
|
-
release?.();
|
|
951
|
-
hosting.dispose();
|
|
952
|
-
model.dispose();
|
|
953
|
-
},
|
|
954
|
-
get editor() {
|
|
955
|
-
return mount?.controller;
|
|
956
|
-
},
|
|
957
|
-
focus: focusEditor,
|
|
958
|
-
keybindings: openKeybindings,
|
|
959
|
-
model,
|
|
960
|
-
navigate: (kind, backward) => navigation.go(kind, backward),
|
|
961
|
-
open: (path, line, column) => model.open(path, line, column),
|
|
962
|
-
quickOpen,
|
|
963
|
-
refresh: () => model.refresh(),
|
|
964
|
-
rename: (source, destination) => model.rename(source, destination),
|
|
965
|
-
save: () => model.save(),
|
|
966
|
-
search,
|
|
967
|
-
toggleExplorer: () => toggle('explorerOpen'),
|
|
968
|
-
toggleExplorerSide: () => {
|
|
969
|
-
model.setPreferences({ explorerSide: view.left ? 'right' : 'left' });
|
|
970
|
-
view.peek = false;
|
|
971
|
-
view.ready = false;
|
|
972
|
-
},
|
|
973
|
-
toggleWhitespace: () => toggle('showWhitespace'),
|
|
974
|
-
toggleWrap: () => toggle('wrapText'),
|
|
975
|
-
undoFiles: () => model.undoFiles()
|
|
976
|
-
}, items = [
|
|
977
|
-
{
|
|
978
|
-
hidden: () => !single() || read(target)?.element.type !== 'file',
|
|
979
|
-
label: 'Open',
|
|
980
|
-
onselect: () => {
|
|
981
|
-
void model.open(paths()[0]).then(focusEditor);
|
|
982
|
-
}
|
|
983
|
-
},
|
|
984
|
-
{
|
|
985
|
-
hidden: () => !single(),
|
|
986
|
-
hint: 'F2',
|
|
987
|
-
label: 'Rename',
|
|
988
|
-
onselect: () => treeEditor.rename(paths()[0])
|
|
989
|
-
},
|
|
990
|
-
{
|
|
991
|
-
hidden: () => !single(),
|
|
992
|
-
label: 'Copy Path',
|
|
993
|
-
onselect: () => {
|
|
994
|
-
void model.copyPath(paths()[0]);
|
|
995
|
-
}
|
|
996
|
-
},
|
|
997
|
-
...strip.items(() => paths()),
|
|
998
|
-
...(model.host.actions ?? []).map((action) => ({
|
|
999
|
-
danger: action.danger,
|
|
1000
|
-
hidden: () => !paths().length || (!!action.visible && !action.visible(paths())),
|
|
1001
|
-
icon: action.icon ? () => icon({ 'aria-hidden': 'true' }, action.icon) : undefined,
|
|
1002
|
-
label: action.label,
|
|
1003
|
-
onselect: () => {
|
|
1004
|
-
void model.run(action, paths());
|
|
1005
|
-
}
|
|
1006
|
-
})),
|
|
1007
|
-
{
|
|
1008
|
-
danger: true,
|
|
1009
|
-
hint: mac() ? '⌘⌫' : 'Del',
|
|
1010
|
-
label: 'Delete',
|
|
1011
|
-
onselect: () => {
|
|
1012
|
-
void model.delete(paths());
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
], paths = () => read(target)?.paths ?? [], single = () => paths().length === 1;
|
|
1016
|
-
receive?.(api);
|
|
1017
|
-
return (() => {
|
|
1018
|
-
let root_03uclquz = template_03uclqu10(), element_03uclqu11 = root_03uclquz.firstChild, element_03uclqu12 = element_03uclqu11.firstElementChild, element_03uclqu13 = element_03uclqu12.firstElementChild, element_03uclqu14 = element_03uclqu13.firstElementChild.firstChild, element_03uclqu15 = element_03uclqu14.nextSibling, element_03uclqu16 = element_03uclqu15.nextSibling, element_03uclqu17 = element_03uclqu16.nextSibling, element_03uclqu18 = element_03uclqu13.firstElementChild, element_03uclqu19 = element_03uclqu18.nextElementSibling.firstChild, element_03uclqu1a = element_03uclqu18.nextElementSibling, element_03uclqu1b = element_03uclqu12.nextElementSibling, element_03uclqu1c = element_03uclqu1b.firstElementChild, element_03uclqu1d = element_03uclqu1c.firstChild, element_03uclqu1e = element_03uclqu1c.nextElementSibling.firstChild, element_03uclqu1f = element_03uclqu1c.nextElementSibling.firstElementChild.firstChild, element_03uclqu1g = element_03uclqu1f.nextSibling, element_03uclqu1h = element_03uclqu1g.nextSibling, element_03uclqu1i = element_03uclqu1c.nextElementSibling.firstElementChild, element_03uclqu1j = element_03uclqu1c.nextElementSibling.nextElementSibling, element_03uclqu1k = element_03uclqu1b.nextElementSibling.firstElementChild, element_03uclqu1l = element_03uclqu1k.nextElementSibling, element_03uclqu1m = element_03uclqu1b.nextElementSibling.firstChild.nextSibling.nextSibling, element_03uclqu1n = element_03uclqu1l.nextElementSibling, element_03uclqu1o = element_03uclqu1b.nextElementSibling.nextElementSibling, element_03uclqu1p = element_03uclqu1o.firstChild, element_03uclqu1q = element_03uclqu1p.nextSibling, element_03uclqu1r = element_03uclqu11.firstChild.nextSibling.nextSibling.nextSibling.nextSibling, element_03uclqu1s = element_03uclqu1r.nextSibling;
|
|
1019
|
-
template_u1.slot(element_03uclqu14, control({
|
|
1020
|
-
label: () => (view.left ? 'Move file explorer to right' : 'Move file explorer to left'),
|
|
1021
|
-
onclick: api.toggleExplorerSide,
|
|
1022
|
-
sprite: () => (view.left ? right : left)
|
|
1023
|
-
}));
|
|
1024
|
-
template_u1.slot(element_03uclqu15, control({ label: 'Collapse all folders', onclick: api.collapseAll, sprite: collapse }));
|
|
1025
|
-
template_u1.slot(element_03uclqu16, control({
|
|
1026
|
-
disabled: () => !view.canUndo || view.busy,
|
|
1027
|
-
label: 'Undo file operation',
|
|
1028
|
-
onclick: () => {
|
|
1029
|
-
void model.undoFiles();
|
|
1030
|
-
},
|
|
1031
|
-
sprite: undo
|
|
1032
|
-
}));
|
|
1033
|
-
template_u1.slot(element_03uclqu17, control({ label: label('Go to file', ['Mod', 'P']), onclick: () => quickOpen(), sprite: magnifier }));
|
|
1034
|
-
template_u1.slot(element_03uclqu18, input({
|
|
1035
|
-
'aria-label': 'Search files',
|
|
1036
|
-
autocomplete: 'off',
|
|
1037
|
-
class: 'code-workspace-search',
|
|
1038
|
-
onconnect: (element) => {
|
|
1039
|
-
searchField = element;
|
|
1040
|
-
},
|
|
1041
|
-
oninput: (event) => search(event.target.value),
|
|
1042
|
-
placeholder: 'Search files',
|
|
1043
|
-
spellcheck: false,
|
|
1044
|
-
type: 'search',
|
|
1045
|
-
value: () => view.search
|
|
1046
|
-
}), 2);
|
|
1047
|
-
new template_u1.EffectSlot(element_03uclqu19, () => hosting.ready() && untrack(() => fileTree({
|
|
1048
|
-
class: 'code-workspace-files',
|
|
1049
|
-
compact: true,
|
|
1050
|
-
controller: (value) => {
|
|
1051
|
-
tree = value;
|
|
1052
|
-
value.search(view.search);
|
|
1053
|
-
},
|
|
1054
|
-
decorations: [hosting.marks, ...[provided ?? []].flat(), decorations],
|
|
1055
|
-
editor: treeEditor,
|
|
1056
|
-
elements: treeStore,
|
|
1057
|
-
empty: () => template_03uclqu1t(),
|
|
1058
|
-
export: hosting.export,
|
|
1059
|
-
find: 'filter',
|
|
1060
|
-
menu: (elements, position) => {
|
|
1061
|
-
if (!elements.length || !actions) {
|
|
1062
|
-
return;
|
|
1063
|
-
}
|
|
1064
|
-
write(target, { element: elements[0], paths: elements.map((element) => element.id) });
|
|
1065
|
-
flush();
|
|
1066
|
-
actions.open(position);
|
|
1067
|
-
},
|
|
1068
|
-
open: (element, open) => {
|
|
1069
|
-
void model.open(element.id, undefined, undefined, open.mode === 'preview');
|
|
1070
|
-
},
|
|
1071
|
-
operations: {
|
|
1072
|
-
delete: (elements) => {
|
|
1073
|
-
void model.delete(elements.map((element) => element.id));
|
|
1074
|
-
},
|
|
1075
|
-
import: hosting.import
|
|
1076
|
-
},
|
|
1077
|
-
preview: 'immediate',
|
|
1078
|
-
rename: async (element, value) => {
|
|
1079
|
-
let parent = element.id.includes('/') ? element.id.slice(0, element.id.lastIndexOf('/') + 1) : '';
|
|
1080
|
-
if (!(await model.rename(element.id, parent + value))) {
|
|
1081
|
-
throw new Error(`Workspace: ${model.state.status}`);
|
|
1082
|
-
}
|
|
1083
|
-
},
|
|
1084
|
-
searched: (query) => {
|
|
1085
|
-
view.search = query;
|
|
1086
|
-
},
|
|
1087
|
-
snapshot: hosting.explorer,
|
|
1088
|
-
state: treeState,
|
|
1089
|
-
typing: 'typeahead'
|
|
1090
|
-
})));
|
|
1091
|
-
new template_u1.EffectSlot(element_03uclqu1a, () => {
|
|
1092
|
-
if (view.error) {
|
|
1093
|
-
return (() => {
|
|
1094
|
-
let root_03uclqu1u = template_03uclqu1v(), element_03uclqu1w = root_03uclqu1u.firstChild.firstChild, element_03uclqu1x = root_03uclqu1u.firstChild.firstElementChild;
|
|
1095
|
-
template_u1.slot(element_03uclqu1w, view.error);
|
|
1096
|
-
template_u1.delegate(element_03uclqu1x, 'click', () => {
|
|
1097
|
-
void model.refresh();
|
|
1098
|
-
});
|
|
1099
|
-
return root_03uclqu1u;
|
|
1100
|
-
})();
|
|
1101
|
-
}
|
|
1102
|
-
return !view.loaded && template_03uclqu1y();
|
|
1103
|
-
}, 2);
|
|
1104
|
-
new template_u1.EffectSlot(element_03uclqu12, () => view.collapsed && !view.ready && (() => {
|
|
1105
|
-
let root_03uclqu1z = template_03uclqu20(), element_03uclqu21 = root_03uclqu1z.firstChild;
|
|
1106
|
-
template_u1.delegate(element_03uclqu21, 'click', reach);
|
|
1107
|
-
template_u1.on(element_03uclqu21, 'focus', reach);
|
|
1108
|
-
return root_03uclqu1z;
|
|
1109
|
-
})(), 2);
|
|
1110
|
-
template_u1.slot(element_03uclqu1d, highlight({ class: 'code-workspace-tabs-highlight', line: 'bottom' }));
|
|
1111
|
-
new template_u1.EffectSlot(element_03uclqu1c, () => read(tabs).map(tab), 2);
|
|
1112
|
-
new template_u1.EffectSlot(element_03uclqu1e, crumbs);
|
|
1113
|
-
new template_u1.EffectSlot(element_03uclqu1f, statusBar.save(() => control({
|
|
1114
|
-
disabled: () => !view.tabs || view.busy,
|
|
1115
|
-
label: label('Save file', ['Mod', 'S']),
|
|
1116
|
-
onclick: () => {
|
|
1117
|
-
void model.save();
|
|
1118
|
-
},
|
|
1119
|
-
sprite: save
|
|
1120
|
-
})));
|
|
1121
|
-
template_u1.slot(element_03uclqu1g, control({
|
|
1122
|
-
active: () => view.wrap,
|
|
1123
|
-
label: () => (view.wrap ? 'Disable wrap' : 'Wrap long lines'),
|
|
1124
|
-
onclick: api.toggleWrap,
|
|
1125
|
-
sprite: wrap
|
|
1126
|
-
}));
|
|
1127
|
-
template_u1.slot(element_03uclqu1h, control({
|
|
1128
|
-
active: () => view.whitespace,
|
|
1129
|
-
label: () => (view.whitespace ? 'Hide whitespace' : 'Show whitespace'),
|
|
1130
|
-
onclick: api.toggleWhitespace,
|
|
1131
|
-
sprite: whitespace
|
|
1132
|
-
}));
|
|
1133
|
-
template_u1.slot(element_03uclqu1i, sidebar({
|
|
1134
|
-
'aria-label': () => (view.explorerOpen ? 'Hide file explorer' : 'Show file explorer'),
|
|
1135
|
-
class: 'code-workspace-control',
|
|
1136
|
-
onclick: api.toggleExplorer,
|
|
1137
|
-
open: () => view.explorerOpen,
|
|
1138
|
-
side: () => (view.left ? 'left' : 'right'),
|
|
1139
|
-
title: () => (view.explorerOpen ? 'Hide file explorer' : 'Show file explorer')
|
|
1140
|
-
}), 2);
|
|
1141
|
-
new template_u1.EffectSlot(element_03uclqu1j, pane, 1);
|
|
1142
|
-
new template_u1.EffectSlot(element_03uclqu1k, () => view.cwd, 1);
|
|
1143
|
-
new template_u1.EffectSlot(element_03uclqu1l, () => view.position, 1);
|
|
1144
|
-
new template_u1.EffectSlot(element_03uclqu1m, statusBar.items);
|
|
1145
|
-
new template_u1.EffectSlot(element_03uclqu1n, () => view.status, 1);
|
|
1146
|
-
template_u1.slot(element_03uclqu1p, tooltip.context({
|
|
1147
|
-
class: 'code-workspace-menu',
|
|
1148
|
-
controller: (value) => {
|
|
1149
|
-
actions = value;
|
|
1150
|
-
},
|
|
1151
|
-
items,
|
|
1152
|
-
[tooltip.context.panel]: { 'aria-label': 'File actions', class: 'code-workspace-menu-panel' }
|
|
1153
|
-
}, ''));
|
|
1154
|
-
new template_u1.EffectSlot(element_03uclqu1q, statusBar.menu);
|
|
1155
|
-
template_u1.slot(element_03uclqu1o, strip.menu(), 2);
|
|
1156
|
-
template_u1.slot(element_03uclqu1r, command({
|
|
1157
|
-
commands: () => [PALETTE, ...read(files).map((path) => ({ group: 'Files', id: path, label: path }))],
|
|
1158
|
-
hotkey: [],
|
|
1159
|
-
label: 'Go to file',
|
|
1160
|
-
limit: 50,
|
|
1161
|
-
match: fuzzy,
|
|
1162
|
-
onrun: choose,
|
|
1163
|
-
placeholder: 'Go to file',
|
|
1164
|
-
render: results,
|
|
1165
|
-
state: palette,
|
|
1166
|
-
trigger: false,
|
|
1167
|
-
[command.dialog]: { 'aria-label': 'Go to file' }
|
|
1168
|
-
}));
|
|
1169
|
-
template_u1.slot(element_03uclqu1s, shortcuts({
|
|
1170
|
-
apple: mac(),
|
|
1171
|
-
id,
|
|
1172
|
-
keybindings: () => read(bindings),
|
|
1173
|
-
onchange: (next) => model.setPreferences({ keybindings: next }),
|
|
1174
|
-
state: keyboard
|
|
1175
|
-
}));
|
|
1176
|
-
template_u1.slot(element_03uclqu11, overlay({
|
|
1177
|
-
'aria-labelledby': `${id}-confirm`,
|
|
1178
|
-
class: 'card overlay--alert code-workspace-confirm',
|
|
1179
|
-
state: dialog
|
|
1180
|
-
}, (() => {
|
|
1181
|
-
let root_03uclqu22 = template_03uclqu23(), element_03uclqu24 = root_03uclqu22.firstChild, element_03uclqu25 = element_03uclqu24.nextSibling, element_03uclqu26 = element_03uclqu25.nextSibling, element_03uclqu27 = element_03uclqu26.nextSibling.firstElementChild, element_03uclqu28 = element_03uclqu27.nextElementSibling, element_03uclqu29 = element_03uclqu28.nextElementSibling;
|
|
1182
|
-
new template_u1.EffectSlot(element_03uclqu25, () => read(request)?.dirty.join(', '), 1);
|
|
1183
|
-
new template_u1.EffectSlot(element_03uclqu26, () => (read(request)?.kind === 'delete'
|
|
1184
|
-
? 'Save before deleting, discard the drafts, or cancel deletion.'
|
|
1185
|
-
: 'Save the drafts, discard them, or keep them open.'), 1);
|
|
1186
|
-
template_u1.delegate(element_03uclqu29, 'click', () => confirmation?.resolve('save'));
|
|
1187
|
-
template_u1.delegate(element_03uclqu28, 'click', () => confirmation?.resolve('discard'));
|
|
1188
|
-
template_u1.delegate(element_03uclqu27, 'click', () => confirmation?.resolve('cancel'));
|
|
1189
|
-
template_u1.setProperty(element_03uclqu24, 'id', template_u1.interpolate([(id), "-confirm"]));
|
|
1190
|
-
return root_03uclqu22;
|
|
1191
|
-
})()), 2);
|
|
1192
|
-
template_u1.onconnect(element_03uclqu1o, (element) => {
|
|
1193
|
-
element.showPopover();
|
|
1194
|
-
});
|
|
1195
|
-
template_u1.setList(element_03uclqu1n, 'class', () => view.statusError && 'code-workspace-status-message--error');
|
|
1196
|
-
template_u1.setProperty(element_03uclqu1j, 'id', template_u1.interpolate([(id), "-panel"]));
|
|
1197
|
-
template_u1.setProperty(element_03uclqu1j, 'aria-labelledby', () => (read(activeId) ? `${id}-tab-${read(activeId)}` : undefined));
|
|
1198
|
-
template_u1.setProperties(element_03uclqu1c, scrollbar());
|
|
1199
|
-
template_u1.on(element_03uclqu1b, 'pointerenter', () => peek(false));
|
|
1200
|
-
template_u1.setProperty(element_03uclqu13, 'inert', () => view.collapsed && !view.ready);
|
|
1201
|
-
template_u1.on(element_03uclqu12, 'focusin', () => peek(true, true));
|
|
1202
|
-
template_u1.on(element_03uclqu12, 'pointerenter', (event) => {
|
|
1203
|
-
if (!event.currentTarget.getAnimations().length) {
|
|
1204
|
-
peek(true);
|
|
1205
|
-
}
|
|
1206
|
-
});
|
|
1207
|
-
template_u1.delegate(element_03uclqu12, 'transitionend', (event) => {
|
|
1208
|
-
if (event.target === event.currentTarget && event.propertyName === 'translate') {
|
|
1209
|
-
view.ready = view.peek;
|
|
1210
|
-
}
|
|
1211
|
-
});
|
|
1212
|
-
template_u1.setProperties(element_03uclqu11, attributes);
|
|
1213
|
-
template_u1.setList(element_03uclqu11, 'class', [
|
|
1214
|
-
() => view.collapsed && 'code-workspace--collapsed',
|
|
1215
|
-
() => view.left && 'code-workspace--left',
|
|
1216
|
-
() => view.peek && 'code-workspace--peek',
|
|
1217
|
-
() => view.compact && view.tabs && view.explorerOpen && 'code-workspace--stacked',
|
|
1218
|
-
() => view.tabs && 'code-workspace--tabs'
|
|
1219
|
-
]);
|
|
1220
|
-
template_u1.onconnect(element_03uclqu11, connect);
|
|
1221
|
-
template_u1.on(element_03uclqu11, 'pointerenter', () => {
|
|
1222
|
-
hovered = true;
|
|
1223
|
-
});
|
|
1224
|
-
template_u1.on(element_03uclqu11, 'pointerleave', () => {
|
|
1225
|
-
hovered = false;
|
|
1226
|
-
});
|
|
1227
|
-
return root_03uclquz;
|
|
1228
|
-
})();
|
|
1229
|
-
};
|
|
1230
|
-
export default component(workspace);
|
|
1231
|
-
export { EditorWorkspaceModel, isWorkspaceCodeEditor };
|
|
6
|
+
export default template;
|
|
7
|
+
export * from './template.js';
|