@esportsplus/ui 0.59.0 → 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 +8 -8
- 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,6 +1,6 @@
|
|
|
1
|
-
import { effect, read, root, signal, untrack, write } from '@esportsplus/reactivity';
|
|
1
|
+
import { effect, onCleanup, read, root, signal, untrack, write } from '@esportsplus/reactivity';
|
|
2
2
|
import Decorations from '../tree/decorations.js';
|
|
3
|
-
import { containsPath,
|
|
3
|
+
import { containsPath, workspacePath } from './model.js';
|
|
4
4
|
const DELAY = 500;
|
|
5
5
|
function code(controller) {
|
|
6
6
|
return 'folds' in controller && 'nextChange' in controller;
|
|
@@ -64,7 +64,7 @@ const hosted = (model, current, delay = DELAY) => {
|
|
|
64
64
|
scroll: live ? { left: live.scroller.scrollLeft, top: live.scroller.scrollTop } : { ...tab.scroll },
|
|
65
65
|
selection: selection(tab)
|
|
66
66
|
};
|
|
67
|
-
if (dirty
|
|
67
|
+
if (tab.dirty || tab.missing) {
|
|
68
68
|
item.draft = tab.document.value;
|
|
69
69
|
}
|
|
70
70
|
tabs.push(item);
|
|
@@ -90,6 +90,37 @@ const hosted = (model, current, delay = DELAY) => {
|
|
|
90
90
|
mark();
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
function follow(tab) {
|
|
94
|
+
let stop = !tab.compare && host.baseline
|
|
95
|
+
? root(() => effect(() => {
|
|
96
|
+
let path = tab.path;
|
|
97
|
+
untrack(() => {
|
|
98
|
+
if (!baselines.has(path)) {
|
|
99
|
+
track(tab);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
onCleanup(() => baselines.delete(path));
|
|
103
|
+
effect(() => {
|
|
104
|
+
let saved = tab.saved;
|
|
105
|
+
untrack(() => {
|
|
106
|
+
let entry = baselines.get(path);
|
|
107
|
+
if (entry && entry.saved !== saved) {
|
|
108
|
+
entry.saved = saved;
|
|
109
|
+
entry.fetched = fetch(path, entry);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}))
|
|
114
|
+
: undefined, unsubscribe = tab.document.subscribe((_, change) => {
|
|
115
|
+
if (change.selectionChanged || change.textChanged) {
|
|
116
|
+
schedule();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
documents.set(tab, () => {
|
|
120
|
+
stop?.();
|
|
121
|
+
unsubscribe();
|
|
122
|
+
});
|
|
123
|
+
}
|
|
93
124
|
function flush() {
|
|
94
125
|
clearTimeout(timer);
|
|
95
126
|
timer = undefined;
|
|
@@ -180,28 +211,10 @@ const hosted = (model, current, delay = DELAY) => {
|
|
|
180
211
|
list[i](controller);
|
|
181
212
|
}
|
|
182
213
|
}
|
|
183
|
-
function sync() {
|
|
184
|
-
let open = new Set(), tabs = model.state.tabs;
|
|
214
|
+
function sync(tabs) {
|
|
185
215
|
for (let i = 0, n = tabs.length; i < n; i++) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (!documents.has(tab)) {
|
|
189
|
-
documents.set(tab, tab.document.subscribe((_, change) => {
|
|
190
|
-
if (change.selectionChanged || change.textChanged) {
|
|
191
|
-
schedule();
|
|
192
|
-
}
|
|
193
|
-
}));
|
|
194
|
-
}
|
|
195
|
-
if (!host.baseline) {
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
let entry = baselines.get(tab.path);
|
|
199
|
-
if (!entry) {
|
|
200
|
-
track(tab);
|
|
201
|
-
}
|
|
202
|
-
else if (entry.saved !== tab.saved) {
|
|
203
|
-
entry.saved = tab.saved;
|
|
204
|
-
entry.fetched = fetch(tab.path, entry);
|
|
216
|
+
if (!documents.has(tabs[i])) {
|
|
217
|
+
follow(tabs[i]);
|
|
205
218
|
}
|
|
206
219
|
}
|
|
207
220
|
for (let [tab, stop] of documents) {
|
|
@@ -212,12 +225,6 @@ const hosted = (model, current, delay = DELAY) => {
|
|
|
212
225
|
settle(tab, undefined);
|
|
213
226
|
}
|
|
214
227
|
}
|
|
215
|
-
for (let path of [...baselines.keys()]) {
|
|
216
|
-
if (!open.has(path)) {
|
|
217
|
-
baselines.delete(path);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
schedule();
|
|
221
228
|
}
|
|
222
229
|
function track(tab) {
|
|
223
230
|
let entry = { fetched: Promise.resolve(), request: 0, saved: tab.saved, text: signal(null) };
|
|
@@ -243,16 +250,36 @@ const hosted = (model, current, delay = DELAY) => {
|
|
|
243
250
|
});
|
|
244
251
|
return entry ? read(entry.text) : null;
|
|
245
252
|
},
|
|
253
|
+
attributes: {
|
|
254
|
+
onwindowpagehide: flush
|
|
255
|
+
},
|
|
246
256
|
connect(element) {
|
|
247
|
-
let listening = new AbortController(),
|
|
257
|
+
let listening = new AbortController(), release = root((dispose) => {
|
|
258
|
+
effect(() => {
|
|
259
|
+
let tabs = model.state.tabs;
|
|
260
|
+
untrack(() => sync(tabs));
|
|
261
|
+
});
|
|
262
|
+
effect(() => {
|
|
263
|
+
let state = model.state;
|
|
264
|
+
state.active;
|
|
265
|
+
for (let i = 0, n = state.tabs.length; i < n; i++) {
|
|
266
|
+
let tab = state.tabs[i];
|
|
267
|
+
tab.dirty;
|
|
268
|
+
tab.missing;
|
|
269
|
+
tab.path;
|
|
270
|
+
tab.pinned;
|
|
271
|
+
tab.preview;
|
|
272
|
+
}
|
|
273
|
+
untrack(schedule);
|
|
274
|
+
});
|
|
275
|
+
return dispose;
|
|
276
|
+
}), unwatch = model.onWatch(watched);
|
|
248
277
|
element.addEventListener('keyup', schedule, { capture: true, passive: true, signal: listening.signal });
|
|
249
278
|
element.addEventListener('pointerup', schedule, { capture: true, passive: true, signal: listening.signal });
|
|
250
279
|
element.addEventListener('scroll', schedule, { capture: true, passive: true, signal: listening.signal });
|
|
251
|
-
element.ownerDocument.defaultView?.addEventListener('pagehide', flush, { signal: listening.signal });
|
|
252
|
-
sync();
|
|
253
280
|
return () => {
|
|
254
281
|
listening.abort();
|
|
255
|
-
|
|
282
|
+
release();
|
|
256
283
|
unwatch();
|
|
257
284
|
flush();
|
|
258
285
|
stopProblems?.();
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as template_u1 from '@esportsplus/template';
|
|
2
2
|
import type { Command as PaletteCommand } from '../../command/index.js';
|
|
3
3
|
import { type Keybindings } from './keybindings.js';
|
|
4
|
-
import '../../button/scss/index.scss';
|
|
5
|
-
import './scss/keybindings.scss';
|
|
6
4
|
type A = {
|
|
7
5
|
apple: boolean;
|
|
8
6
|
id: string;
|
|
@@ -7,8 +7,6 @@ import shortcutRecorder from '../../shortcut-recorder/index.js';
|
|
|
7
7
|
import scrollbar from '../../../modifiers/scrollbar/index.js';
|
|
8
8
|
import { bind, conflict, fromChord, fromRecorder, label, matches, reset, rows, unassign } from './keybindings.js';
|
|
9
9
|
import keyboard from '@esportsplus/ui/svg/keyboard.svg';
|
|
10
|
-
import '../../button/scss/index.scss';
|
|
11
|
-
import './scss/keybindings.scss';
|
|
12
10
|
const template_1xp781n3 = template_u1.template(`<div class='code-workspace-keybindings-row' role='row'><div class='code-workspace-keybindings-command' role='cell'><span class='code-workspace-keybindings-label'></span><span class='code-workspace-keybindings-id'></span></div><div class='code-workspace-keybindings-keys' role='cell'><!--$--><!--$--><!--$--></div><div class='code-workspace-keybindings-source' role='cell'></div><div class='code-workspace-keybindings-actions' role='cell'><button class='button code-workspace-keybindings-button' type='button'> Reset `);
|
|
13
11
|
const template_1xp781ne = template_u1.template(`<kbd class='button button--kbd code-workspace-keybindings-key code-workspace-keybindings-key--builtin' title='Built into the editor and not removable here; a chord bound to another command takes it over'>`);
|
|
14
12
|
const template_1xp781nh = template_u1.template(`<kbd class='button button--kbd code-workspace-keybindings-key'>`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorDocument, Language, Options } from '../code/index.js';
|
|
2
2
|
import type { Status } from '../../inline-edit/status.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { EditorWorkspaceModel, WorkspacePreferences } from './model.js';
|
|
4
4
|
type AutoSaveMode = WorkspacePreferences['autoSave'];
|
|
5
5
|
type Indentation = {
|
|
6
6
|
size: number;
|
|
@@ -17,15 +17,14 @@ declare class AutoSave {
|
|
|
17
17
|
readonly model: EditorWorkspaceModel;
|
|
18
18
|
readonly status: Status;
|
|
19
19
|
private active;
|
|
20
|
-
private mode;
|
|
21
20
|
private pending;
|
|
21
|
+
private release;
|
|
22
22
|
private tabs;
|
|
23
|
-
private unsubscribe;
|
|
24
23
|
constructor(model: EditorWorkspaceModel);
|
|
24
|
+
private get mode();
|
|
25
25
|
private edited;
|
|
26
|
-
private phase;
|
|
27
26
|
private save;
|
|
28
|
-
private
|
|
27
|
+
private track;
|
|
29
28
|
blur(all?: boolean): void;
|
|
30
29
|
connect(): () => void;
|
|
31
30
|
disconnect(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
|
-
import {
|
|
2
|
+
import { effect, peek, read, root, signal, untrack, write } from '@esportsplus/reactivity';
|
|
3
3
|
class ReactiveObject_0ab57aq0 extends reactivity_u0.ReactiveObject {
|
|
4
4
|
#phase;
|
|
5
5
|
#savedAt;
|
|
@@ -82,13 +82,15 @@ class AutoSave {
|
|
|
82
82
|
model;
|
|
83
83
|
status = new ReactiveObject_0ab57aq0('saved', null);
|
|
84
84
|
active;
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
pending = signal(0);
|
|
86
|
+
release;
|
|
87
87
|
tabs = new Map();
|
|
88
|
-
unsubscribe;
|
|
89
88
|
constructor(model) {
|
|
90
89
|
this.model = model;
|
|
91
90
|
}
|
|
91
|
+
get mode() {
|
|
92
|
+
return untrack(() => this.model.state.preferences.autoSave);
|
|
93
|
+
}
|
|
92
94
|
edited(tab) {
|
|
93
95
|
let tracked = this.tabs.get(tab);
|
|
94
96
|
if (!tracked || this.mode !== 'delay') {
|
|
@@ -96,69 +98,43 @@ class AutoSave {
|
|
|
96
98
|
}
|
|
97
99
|
clearTimeout(tracked.timer);
|
|
98
100
|
tracked.timer = undefined;
|
|
99
|
-
if (dirty
|
|
101
|
+
if (tab.dirty) {
|
|
100
102
|
tracked.timer = setTimeout(() => {
|
|
101
103
|
tracked.timer = undefined;
|
|
102
|
-
this.
|
|
103
|
-
|
|
104
|
+
if (this.mode === 'delay') {
|
|
105
|
+
this.save(tab);
|
|
106
|
+
}
|
|
107
|
+
}, untrack(() => this.model.state.preferences.autoSaveDelay));
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
|
-
phase() {
|
|
107
|
-
this.status.phase = this.pending ? 'saving' : this.model.state.tabs.some(dirty) ? 'unsaved' : 'saved';
|
|
108
|
-
}
|
|
109
110
|
save(tab) {
|
|
110
|
-
if (!dirty
|
|
111
|
+
if (!tab.dirty || tab.missing || !this.tabs.has(tab)) {
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
|
-
this.pending
|
|
114
|
-
this.phase();
|
|
114
|
+
write(this.pending, peek(this.pending) + 1);
|
|
115
115
|
void this.model.save(tab).finally(() => {
|
|
116
|
-
this.pending
|
|
117
|
-
this.phase();
|
|
116
|
+
write(this.pending, peek(this.pending) - 1);
|
|
118
117
|
});
|
|
119
118
|
}
|
|
120
|
-
|
|
121
|
-
let
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
clearTimeout(tracked.timer);
|
|
125
|
-
tracked.unsubscribe();
|
|
126
|
-
this.tabs.delete(tab);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
for (let i = 0, n = state.tabs.length; i < n; i++) {
|
|
130
|
-
let tab = state.tabs[i], tracked = this.tabs.get(tab), unsaved = dirty(tab);
|
|
131
|
-
if (!tracked) {
|
|
132
|
-
this.tabs.set(tab, {
|
|
133
|
-
dirty: unsaved,
|
|
134
|
-
saved: tab.saved,
|
|
135
|
-
unsubscribe: tab.document.subscribe((_, change) => {
|
|
136
|
-
if (change.textChanged) {
|
|
137
|
-
this.edited(tab);
|
|
138
|
-
}
|
|
139
|
-
})
|
|
140
|
-
});
|
|
141
|
-
continue;
|
|
119
|
+
track(tab) {
|
|
120
|
+
let tracked = { dirty: tab.dirty, saved: tab.saved, stop: () => { } }, unsubscribe = tab.document.subscribe((_, change) => {
|
|
121
|
+
if (change.textChanged) {
|
|
122
|
+
this.edited(tab);
|
|
142
123
|
}
|
|
143
|
-
|
|
124
|
+
}), stop = root(() => effect(() => {
|
|
125
|
+
let dirty = tab.dirty, saved = tab.saved;
|
|
126
|
+
if (tracked.dirty && !dirty && tracked.saved !== saved) {
|
|
144
127
|
this.status.savedAt = Date.now();
|
|
145
128
|
}
|
|
146
|
-
tracked.dirty =
|
|
147
|
-
tracked.saved =
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
this.active = state.active;
|
|
158
|
-
if (this.mode === 'focus' && previous && previous !== state.active) {
|
|
159
|
-
this.save(previous);
|
|
160
|
-
}
|
|
161
|
-
this.phase();
|
|
129
|
+
tracked.dirty = dirty;
|
|
130
|
+
tracked.saved = saved;
|
|
131
|
+
}));
|
|
132
|
+
tracked.stop = () => {
|
|
133
|
+
clearTimeout(tracked.timer);
|
|
134
|
+
stop();
|
|
135
|
+
unsubscribe();
|
|
136
|
+
};
|
|
137
|
+
this.tabs.set(tab, tracked);
|
|
162
138
|
}
|
|
163
139
|
blur(all = false) {
|
|
164
140
|
if (this.mode !== 'focus') {
|
|
@@ -174,19 +150,61 @@ class AutoSave {
|
|
|
174
150
|
}
|
|
175
151
|
connect() {
|
|
176
152
|
this.disconnect();
|
|
177
|
-
this.
|
|
178
|
-
|
|
153
|
+
this.release = root((dispose) => {
|
|
154
|
+
let state = this.model.state;
|
|
155
|
+
effect(() => {
|
|
156
|
+
let tabs = state.tabs;
|
|
157
|
+
untrack(() => {
|
|
158
|
+
let open = new Set(tabs);
|
|
159
|
+
for (let [tab, tracked] of this.tabs) {
|
|
160
|
+
if (!open.has(tab)) {
|
|
161
|
+
tracked.stop();
|
|
162
|
+
this.tabs.delete(tab);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
for (let i = 0, n = tabs.length; i < n; i++) {
|
|
166
|
+
if (!this.tabs.has(tabs[i])) {
|
|
167
|
+
this.track(tabs[i]);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
effect(() => {
|
|
173
|
+
state.preferences.autoSave;
|
|
174
|
+
untrack(() => {
|
|
175
|
+
for (let [tab, tracked] of this.tabs) {
|
|
176
|
+
clearTimeout(tracked.timer);
|
|
177
|
+
tracked.timer = undefined;
|
|
178
|
+
this.edited(tab);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
effect(() => {
|
|
183
|
+
let active = state.active;
|
|
184
|
+
untrack(() => {
|
|
185
|
+
let previous = this.active;
|
|
186
|
+
this.active = active;
|
|
187
|
+
if (this.mode === 'focus' && previous && previous !== active) {
|
|
188
|
+
this.save(previous);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
effect(() => {
|
|
193
|
+
this.status.phase = read(this.pending)
|
|
194
|
+
? 'saving'
|
|
195
|
+
: state.tabs.some((tab) => tab.dirty) ? 'unsaved' : 'saved';
|
|
196
|
+
});
|
|
197
|
+
return dispose;
|
|
198
|
+
});
|
|
179
199
|
return () => this.disconnect();
|
|
180
200
|
}
|
|
181
201
|
disconnect() {
|
|
182
|
-
this.
|
|
183
|
-
this.
|
|
202
|
+
this.release?.();
|
|
203
|
+
this.release = undefined;
|
|
184
204
|
for (let tracked of this.tabs.values()) {
|
|
185
|
-
|
|
186
|
-
tracked.unsubscribe();
|
|
205
|
+
tracked.stop();
|
|
187
206
|
}
|
|
188
207
|
this.active = undefined;
|
|
189
|
-
this.mode = 'off';
|
|
190
208
|
this.tabs.clear();
|
|
191
209
|
}
|
|
192
210
|
}
|
|
@@ -2,11 +2,13 @@ import { type Renderable } from '@esportsplus/template';
|
|
|
2
2
|
import type { Options } from '../code/index.js';
|
|
3
3
|
import type { WorkspaceEditorController } from './index.js';
|
|
4
4
|
import type { EditorWorkspaceModel, WorkspaceTab } from './model.js';
|
|
5
|
-
import '../../inline-edit/scss/index.scss';
|
|
6
|
-
import './scss/status.scss';
|
|
7
5
|
declare const statusbar: (model: EditorWorkspaceModel, nextProblem: () => Promise<boolean>) => {
|
|
8
6
|
attach: (controller: WorkspaceEditorController | undefined) => void;
|
|
9
|
-
|
|
7
|
+
attributes: {
|
|
8
|
+
onfocusout: (event: FocusEvent) => void;
|
|
9
|
+
onwindowblur: () => void;
|
|
10
|
+
};
|
|
11
|
+
connect: () => () => void;
|
|
10
12
|
items: () => DocumentFragment | Text;
|
|
11
13
|
menu: () => Renderable<any>;
|
|
12
14
|
options: (tab: WorkspaceTab) => Options | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { flush, peek, read, signal, untrack, write } from '@esportsplus/reactivity';
|
|
1
|
+
import { computed, flush, peek, read, signal, untrack, write } from '@esportsplus/reactivity';
|
|
3
2
|
import * as template_u1 from '@esportsplus/template';
|
|
4
3
|
import icon from '../../icon/index.js';
|
|
5
4
|
import status from '../../inline-edit/status.js';
|
|
@@ -8,27 +7,12 @@ import { AUTO_SAVE_MODES, AutoSave, INDENT_SIZES, indentation, indentLabel, LANG
|
|
|
8
7
|
import alert from '@esportsplus/ui/svg/circle-alert.svg';
|
|
9
8
|
import check from '@esportsplus/ui/svg/check.svg';
|
|
10
9
|
import warning from '@esportsplus/ui/svg/warning.svg';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const template_071pfnvf = template_u1.template(`<!--$--><button class='button code-workspace-status-item code-workspace-status-item--problems' type='button'><!--$--><!--$--><!--$--></button><!--$--><!--$--><!--$--><span class='code-workspace-status-item code-workspace-status-item--encoding' title='Encoding'>UTF-8`);
|
|
18
|
-
const template_071pfnvp = template_u1.template(`<span class='code-workspace-status-item code-workspace-status-item--selections'><!--$--> selections`);
|
|
19
|
-
class ReactiveObject_071pfnv0 extends reactivity_u0.ReactiveObject {
|
|
20
|
-
#autoSave;
|
|
21
|
-
constructor(_p0) {
|
|
22
|
-
super(null);
|
|
23
|
-
this.#autoSave = this[reactivity_u0.SIGNAL](_p0);
|
|
24
|
-
}
|
|
25
|
-
get autoSave() {
|
|
26
|
-
return reactivity_u0.read(this.#autoSave);
|
|
27
|
-
}
|
|
28
|
-
set autoSave(_v0) {
|
|
29
|
-
reactivity_u0.write(this.#autoSave, _v0);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
10
|
+
const template_071pfnv1 = template_u1.template(`<button class='button code-workspace-autosave' type='button'>`);
|
|
11
|
+
const template_071pfnv4 = template_u1.template(`<!--$-->`);
|
|
12
|
+
const template_071pfnv7 = template_u1.template(`<button class='button code-workspace-status-item ' type='button'>`);
|
|
13
|
+
const template_071pfnva = template_u1.template(`<div class='code-workspace-status-items'><!--$-->`);
|
|
14
|
+
const template_071pfnve = template_u1.template(`<!--$--><button class='button code-workspace-status-item code-workspace-status-item--problems' type='button'><!--$--><!--$--><!--$--></button><!--$--><!--$--><!--$--><span class='code-workspace-status-item code-workspace-status-item--encoding' title='Encoding'>UTF-8`);
|
|
15
|
+
const template_071pfnvo = template_u1.template(`<span class='code-workspace-status-item code-workspace-status-item--selections'><!--$--> selections`);
|
|
32
16
|
const CHOICES = {
|
|
33
17
|
autoSave: 'Auto save',
|
|
34
18
|
indent: 'Indentation',
|
|
@@ -39,13 +23,13 @@ function isCode(controller) {
|
|
|
39
23
|
}
|
|
40
24
|
function mark(selected) {
|
|
41
25
|
return () => {
|
|
42
|
-
let
|
|
43
|
-
new template_u1.EffectSlot(
|
|
44
|
-
return
|
|
26
|
+
let root_071pfnv3 = template_071pfnv4(), element_071pfnv5 = root_071pfnv3.firstChild;
|
|
27
|
+
new template_u1.EffectSlot(element_071pfnv5, () => selected() && icon({ 'aria-hidden': 'true', class: 'code-workspace-choice-icon' }, check));
|
|
28
|
+
return root_071pfnv3;
|
|
45
29
|
};
|
|
46
30
|
}
|
|
47
31
|
const statusbar = (model, nextProblem) => {
|
|
48
|
-
let autosave = new AutoSave(model), choice = signal('language'), editor = signal(undefined), menu, overrides = new WeakMap(),
|
|
32
|
+
let autosave = new AutoSave(model), choice = signal('language'), editor = signal(undefined), menu, overrides = new WeakMap(), preferences = model.state.preferences;
|
|
49
33
|
function choose(next, element, below = false) {
|
|
50
34
|
let bounds = element.getBoundingClientRect();
|
|
51
35
|
write(choice, next);
|
|
@@ -60,13 +44,13 @@ const statusbar = (model, nextProblem) => {
|
|
|
60
44
|
}
|
|
61
45
|
function item(kind, label, onclick, title = label) {
|
|
62
46
|
return (() => {
|
|
63
|
-
let
|
|
64
|
-
new template_u1.EffectSlot(
|
|
65
|
-
template_u1.setList(
|
|
66
|
-
template_u1.setProperty(
|
|
67
|
-
template_u1.delegate(
|
|
68
|
-
template_u1.setProperty(
|
|
69
|
-
return
|
|
47
|
+
let root_071pfnv6 = template_071pfnv7(), element_071pfnv8 = root_071pfnv6.firstChild;
|
|
48
|
+
new template_u1.EffectSlot(element_071pfnv8, label, 1);
|
|
49
|
+
template_u1.setList(element_071pfnv8, 'class', template_u1.interpolate(["code-workspace-status-item--", (kind)]));
|
|
50
|
+
template_u1.setProperty(element_071pfnv8, 'aria-label', title);
|
|
51
|
+
template_u1.delegate(element_071pfnv8, 'click', onclick);
|
|
52
|
+
template_u1.setProperty(element_071pfnv8, 'title', title);
|
|
53
|
+
return root_071pfnv6;
|
|
70
54
|
})();
|
|
71
55
|
}
|
|
72
56
|
function override(next) {
|
|
@@ -74,10 +58,18 @@ const statusbar = (model, nextProblem) => {
|
|
|
74
58
|
if (!tab) {
|
|
75
59
|
return;
|
|
76
60
|
}
|
|
77
|
-
|
|
78
|
-
write(
|
|
61
|
+
let node = overridden(tab);
|
|
62
|
+
write(node, { ...peek(node), ...next });
|
|
79
63
|
peek(editor)?.focus();
|
|
80
64
|
}
|
|
65
|
+
function overridden(tab) {
|
|
66
|
+
let node = overrides.get(tab);
|
|
67
|
+
if (!node) {
|
|
68
|
+
node = signal(undefined);
|
|
69
|
+
overrides.set(tab, node);
|
|
70
|
+
}
|
|
71
|
+
return node;
|
|
72
|
+
}
|
|
81
73
|
let indents = [false, true].flatMap((tabs) => INDENT_SIZES.map((size) => ({ size, tabs }))), items = [
|
|
82
74
|
...Object.keys(LANGUAGES).map((language) => ({
|
|
83
75
|
hidden: () => read(choice) !== 'language',
|
|
@@ -96,7 +88,7 @@ const statusbar = (model, nextProblem) => {
|
|
|
96
88
|
})),
|
|
97
89
|
...['off', 'delay', 'focus'].map((mode) => ({
|
|
98
90
|
hidden: () => read(choice) !== 'autoSave',
|
|
99
|
-
icon: mark(() =>
|
|
91
|
+
icon: mark(() => preferences.autoSave === mode),
|
|
100
92
|
label: AUTO_SAVE_MODES[mode],
|
|
101
93
|
onselect: () => model.setPreferences({ autoSave: mode })
|
|
102
94
|
}))
|
|
@@ -105,60 +97,57 @@ const statusbar = (model, nextProblem) => {
|
|
|
105
97
|
attach: (controller) => {
|
|
106
98
|
write(editor, controller && isCode(controller) ? controller : undefined);
|
|
107
99
|
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
view.autoSave = model.state.preferences.autoSave;
|
|
111
|
-
}, disconnect = autosave.connect(), unsubscribe = model.subscribe(update);
|
|
112
|
-
update();
|
|
113
|
-
element.ownerDocument.defaultView?.addEventListener('blur', () => autosave.blur(true), { signal: listening.signal });
|
|
114
|
-
element.addEventListener('focusout', (event) => {
|
|
100
|
+
attributes: {
|
|
101
|
+
onfocusout: (event) => {
|
|
115
102
|
let panel = event.target.closest('.code-workspace-editor');
|
|
116
103
|
if (panel && !panel.contains(event.relatedTarget)) {
|
|
117
104
|
autosave.blur();
|
|
118
105
|
}
|
|
119
|
-
},
|
|
106
|
+
},
|
|
107
|
+
onwindowblur: () => autosave.blur(true)
|
|
108
|
+
},
|
|
109
|
+
connect: () => {
|
|
110
|
+
let disconnect = autosave.connect();
|
|
120
111
|
return () => {
|
|
121
|
-
listening.abort();
|
|
122
|
-
unsubscribe();
|
|
123
112
|
disconnect();
|
|
124
113
|
write(editor, undefined);
|
|
125
114
|
};
|
|
126
115
|
},
|
|
127
116
|
items: () => {
|
|
128
|
-
let
|
|
129
|
-
new template_u1.EffectSlot(
|
|
130
|
-
let state = controller.state, problems = () => `${state.problems.errors} errors, ${state.problems.warnings} warnings: go to the next problem`;
|
|
117
|
+
let root_071pfnv9 = template_071pfnva(), element_071pfnvb = root_071pfnv9.firstChild.firstChild, element_071pfnvc = root_071pfnv9.firstChild;
|
|
118
|
+
new template_u1.EffectSlot(element_071pfnvb, code((controller) => {
|
|
119
|
+
let state = controller.state, multiple = computed(() => state.selections > 1), problems = () => `${state.problems.errors} errors, ${state.problems.warnings} warnings: go to the next problem`;
|
|
131
120
|
return (() => {
|
|
132
|
-
let
|
|
133
|
-
new template_u1.EffectSlot(
|
|
134
|
-
let
|
|
135
|
-
template_u1.
|
|
136
|
-
return
|
|
121
|
+
let root_071pfnvd = template_071pfnve(), element_071pfnvf = root_071pfnvd.firstChild, element_071pfnvg = element_071pfnvf.nextSibling, element_071pfnvh = element_071pfnvg.firstChild, element_071pfnvi = element_071pfnvh.nextSibling, element_071pfnvj = element_071pfnvi.nextSibling, element_071pfnvk = element_071pfnvg.nextSibling, element_071pfnvl = element_071pfnvk.nextSibling, element_071pfnvm = element_071pfnvl.nextSibling;
|
|
122
|
+
new template_u1.EffectSlot(element_071pfnvf, () => read(multiple) && (() => {
|
|
123
|
+
let root_071pfnvn = template_071pfnvo(), element_071pfnvp = root_071pfnvn.firstChild.firstChild;
|
|
124
|
+
new template_u1.EffectSlot(element_071pfnvp, () => state.selections);
|
|
125
|
+
return root_071pfnvn;
|
|
137
126
|
})());
|
|
138
|
-
template_u1.slot(
|
|
139
|
-
new template_u1.EffectSlot(
|
|
140
|
-
template_u1.slot(
|
|
141
|
-
new template_u1.EffectSlot(
|
|
142
|
-
template_u1.slot(
|
|
143
|
-
template_u1.slot(
|
|
144
|
-
template_u1.slot(
|
|
127
|
+
template_u1.slot(element_071pfnvh, icon({ 'aria-hidden': 'true', class: 'code-workspace-status-icon' }, alert));
|
|
128
|
+
new template_u1.EffectSlot(element_071pfnvi, () => state.problems.errors);
|
|
129
|
+
template_u1.slot(element_071pfnvj, icon({ 'aria-hidden': 'true', class: 'code-workspace-status-icon' }, warning));
|
|
130
|
+
new template_u1.EffectSlot(element_071pfnvg, () => state.problems.warnings, 2);
|
|
131
|
+
template_u1.slot(element_071pfnvk, item('language', () => LANGUAGES[state.language], (event) => choose('language', event.currentTarget), 'Select language'));
|
|
132
|
+
template_u1.slot(element_071pfnvl, item('indent', () => indentLabel(state.indent), (event) => choose('indent', event.currentTarget), 'Select indentation'));
|
|
133
|
+
template_u1.slot(element_071pfnvm, item('eol', () => (state.lineEnding === 'crlf' ? 'CRLF' : 'LF'), () => {
|
|
145
134
|
lineEndings(controller.document, state.lineEnding === 'crlf' ? 'lf' : 'crlf');
|
|
146
135
|
}, () => (state.lineEnding === 'crlf' ? 'Convert line endings to LF' : 'Convert line endings to CRLF')));
|
|
147
|
-
template_u1.setProperty(
|
|
148
|
-
template_u1.setProperty(
|
|
149
|
-
template_u1.delegate(
|
|
136
|
+
template_u1.setProperty(element_071pfnvg, 'aria-label', problems);
|
|
137
|
+
template_u1.setProperty(element_071pfnvg, 'disabled', () => !state.problems.errors && !state.problems.warnings);
|
|
138
|
+
template_u1.delegate(element_071pfnvg, 'click', () => {
|
|
150
139
|
void nextProblem().then((moved) => {
|
|
151
140
|
if (moved) {
|
|
152
141
|
peek(editor)?.focus();
|
|
153
142
|
}
|
|
154
143
|
});
|
|
155
144
|
});
|
|
156
|
-
template_u1.setProperty(
|
|
157
|
-
return
|
|
145
|
+
template_u1.setProperty(element_071pfnvg, 'title', problems);
|
|
146
|
+
return root_071pfnvd;
|
|
158
147
|
})();
|
|
159
148
|
}));
|
|
160
|
-
template_u1.slot(
|
|
161
|
-
return
|
|
149
|
+
template_u1.slot(element_071pfnvc, item('autosave', () => `Auto Save: ${AUTO_SAVE_MODES[preferences.autoSave]}`, (event) => choose('autoSave', event.currentTarget), 'Select auto save'), 2);
|
|
150
|
+
return root_071pfnv9;
|
|
162
151
|
},
|
|
163
152
|
menu: () => tooltip.context({
|
|
164
153
|
class: 'code-workspace-menu',
|
|
@@ -168,21 +157,18 @@ const statusbar = (model, nextProblem) => {
|
|
|
168
157
|
items,
|
|
169
158
|
[tooltip.context.panel]: { 'aria-label': () => CHOICES[read(choice)], class: 'code-workspace-choices code-workspace-menu-panel' }
|
|
170
159
|
}, ''),
|
|
171
|
-
options: (tab) =>
|
|
172
|
-
read(revision);
|
|
173
|
-
return overrides.get(tab);
|
|
174
|
-
},
|
|
160
|
+
options: (tab) => read(overridden(tab)),
|
|
175
161
|
save: (button) => () => {
|
|
176
|
-
if (
|
|
162
|
+
if (preferences.autoSave === 'off') {
|
|
177
163
|
return button();
|
|
178
164
|
}
|
|
179
165
|
return (() => {
|
|
180
|
-
let
|
|
181
|
-
template_u1.slot(
|
|
182
|
-
template_u1.setProperty(
|
|
183
|
-
template_u1.delegate(
|
|
184
|
-
template_u1.setProperty(
|
|
185
|
-
return
|
|
166
|
+
let root_071pfnv0 = template_071pfnv1(), element_071pfnv2 = root_071pfnv0.firstChild;
|
|
167
|
+
template_u1.slot(element_071pfnv2, untrack(() => status.render(autosave.status)), 1);
|
|
168
|
+
template_u1.setProperty(element_071pfnv2, 'aria-label', () => `Auto save: ${AUTO_SAVE_MODES[preferences.autoSave]}`);
|
|
169
|
+
template_u1.delegate(element_071pfnv2, 'click', (event) => choose('autoSave', event.currentTarget, true));
|
|
170
|
+
template_u1.setProperty(element_071pfnv2, 'title', () => `Auto save: ${AUTO_SAVE_MODES[preferences.autoSave]}`);
|
|
171
|
+
return root_071pfnv0;
|
|
186
172
|
})();
|
|
187
173
|
}
|
|
188
174
|
};
|
|
@@ -2,7 +2,6 @@ import * as template_u1 from '@esportsplus/template';
|
|
|
2
2
|
import type { Item } from '../../tooltip/menu.js';
|
|
3
3
|
import type { WorkspaceEditor } from './index.js';
|
|
4
4
|
import type { EditorWorkspaceModel, WorkspaceTab } from './model.js';
|
|
5
|
-
import './scss/tabs.scss';
|
|
6
5
|
type Options = {
|
|
7
6
|
isFile: (path: string) => boolean;
|
|
8
7
|
model: EditorWorkspaceModel;
|
|
@@ -11,7 +10,7 @@ type Options = {
|
|
|
11
10
|
};
|
|
12
11
|
declare const strip: ({ isFile, model, remount, reveal }: Options) => {
|
|
13
12
|
attributes(tab: WorkspaceTab): {
|
|
14
|
-
class
|
|
13
|
+
class: ((() => "code-workspace-tab--pinned" | false) | (() => "code-workspace-tab--preview" | false))[];
|
|
15
14
|
oncontextmenu: (event: MouseEvent) => void;
|
|
16
15
|
ondblclick: () => void;
|
|
17
16
|
};
|