@esportsplus/ui 0.59.1 → 0.62.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 +2770 -0
- package/.audit/check-scss.mjs +20 -0
- package/.audit/rules-audit.md +531 -0
- package/README.md +52 -40
- package/RULES.md +145 -0
- package/build/components/accordion/index.d.ts +15 -2174
- package/build/components/accordion/index.js +32 -31
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/announcement/index.d.ts +720 -2164
- package/build/components/announcement/index.js +12 -9
- package/build/components/announcement/scss/index.scss +1 -1
- package/build/components/breadcrumb/index.d.ts +4 -1
- package/build/components/breadcrumb/index.js +57 -69
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/copy.d.ts +4 -11
- package/build/components/button/copy.js +32 -25
- package/build/components/button/faces.d.ts +2 -2
- package/build/components/button/faces.js +9 -11
- package/build/components/button/index.d.ts +3 -7
- package/build/components/button/index.js +3 -5
- package/build/components/button/kbd.d.ts +3 -7
- package/build/components/button/kbd.js +63 -76
- package/build/components/button/morph/index.d.ts +1447 -0
- package/build/components/button/morph/index.js +4 -0
- package/build/components/button/morph/save.d.ts +10 -0
- package/build/components/button/morph/save.js +57 -0
- package/build/components/button/morph/template.d.ts +23 -0
- package/build/components/button/morph/template.js +110 -0
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/sidebar.d.ts +1 -10
- package/build/components/button/sidebar.js +14 -12
- package/build/components/button/split.d.ts +7 -2
- package/build/components/button/split.js +20 -19
- package/build/components/capslock/index.d.ts +1 -10
- package/build/components/capslock/index.js +18 -14
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/cc/index.d.ts +4 -1
- package/build/components/cc/index.js +209 -175
- 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 +63 -0
- package/build/components/chat/minimap/index.js +272 -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/group.d.ts +2 -10
- package/build/components/checkbox/group.js +39 -29
- package/build/components/checkbox/index.d.ts +1 -0
- package/build/components/checkbox/index.js +1 -0
- package/build/components/checkbox/options.d.ts +5005 -6441
- package/build/components/checkbox/options.js +72 -45
- 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 +31 -1
- package/build/components/color-picker/index.js +200 -168
- 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 +111 -0
- package/build/components/command/palette.js +606 -0
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/command/search.d.ts +19 -0
- package/build/components/command/search.js +68 -0
- package/build/components/container/scss/index.scss +1 -1
- package/build/components/counter/index.d.ts +6 -4
- package/build/components/counter/index.js +36 -32
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/dock/index.d.ts +28 -6
- package/build/components/dock/index.js +433 -55
- package/build/components/dock/scss/index.scss +1 -1
- package/build/components/editor/code/editor.d.ts +1 -10
- package/build/components/editor/code/features.d.ts +3 -3
- package/build/components/editor/code/features.js +65 -52
- package/build/components/editor/code/field.d.ts +1 -1
- package/build/components/editor/code/find.d.ts +4 -4
- package/build/components/editor/code/find.js +39 -37
- package/build/components/editor/code/folding.d.ts +1 -1
- package/build/components/editor/code/goto.d.ts +2 -1
- package/build/components/editor/code/goto.js +7 -7
- package/build/components/editor/code/gutter.js +12 -12
- package/build/components/editor/code/html.d.ts +4 -0
- package/build/components/editor/code/html.js +8 -0
- package/build/components/editor/code/minimap.d.ts +4 -10
- package/build/components/editor/code/minimap.js +18 -13
- package/build/components/editor/code/rows.js +6 -12
- package/build/components/editor/code/search.d.ts +1 -2
- package/build/components/editor/code/search.js +1 -1
- package/build/components/editor/code/services/index.d.ts +1 -1
- package/build/components/editor/code/services/index.js +27 -23
- package/build/components/editor/code/services/model.d.ts +1 -5
- package/build/components/editor/code/services/model.js +1 -1
- package/build/components/editor/code/services/session.d.ts +3 -2
- package/build/components/editor/code/services/session.js +1 -4
- package/build/components/editor/code/syntax.d.ts +1 -1
- package/build/components/editor/code/view.d.ts +2 -1
- package/build/components/editor/code/view.js +50 -39
- package/build/components/editor/diffs/merge.d.ts +1 -10
- package/build/components/editor/diffs/merge.js +126 -102
- package/build/components/editor/diffs/render.d.ts +1 -2
- package/build/components/editor/diffs/render.js +2 -8
- package/build/components/editor/diffs/view.d.ts +1 -10
- package/build/components/editor/diffs/view.js +112 -105
- package/build/components/editor/markdown/editing.d.ts +1 -1
- package/build/components/editor/markdown/erase.js +1 -1
- package/build/components/editor/markdown/format.d.ts +23 -0
- package/build/components/editor/markdown/format.js +319 -0
- package/build/components/editor/markdown/html.d.ts +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/inline.d.ts +1 -1
- package/build/components/editor/markdown/inline.js +6 -5
- package/build/components/editor/markdown/layout.d.ts +1 -3
- package/build/components/editor/markdown/layout.js +1 -1
- package/build/components/editor/markdown/model.d.ts +3 -9
- package/build/components/editor/markdown/model.js +1 -8
- package/build/components/editor/markdown/render.d.ts +2 -1
- package/build/components/editor/markdown/render.js +281 -252
- package/build/components/editor/markdown/template.d.ts +13 -0
- package/build/components/editor/markdown/template.js +30 -0
- package/build/components/editor/markdown/toolbar.d.ts +32 -0
- package/build/components/editor/markdown/toolbar.js +556 -0
- package/build/components/editor/markdown/view.d.ts +12 -1
- package/build/components/editor/markdown/view.js +154 -60
- package/build/components/editor/tree/compact.d.ts +2 -1
- package/build/components/editor/tree/compact.js +12 -11
- package/build/components/editor/tree/drag.d.ts +3 -2
- package/build/components/editor/tree/drag.js +29 -26
- package/build/components/editor/tree/edit.d.ts +1 -1
- package/build/components/editor/tree/edit.js +10 -9
- package/build/components/editor/tree/find.d.ts +1 -1
- package/build/components/editor/tree/find.js +13 -9
- package/build/components/editor/tree/icons.d.ts +1 -1
- package/build/components/editor/tree/icons.js +1 -1
- package/build/components/editor/tree/index.d.ts +3 -116
- package/build/components/editor/tree/index.js +3 -2225
- package/build/components/editor/tree/lazy.d.ts +2 -1
- package/build/components/editor/tree/lazy.js +17 -16
- package/build/components/editor/tree/sticky.d.ts +3 -2
- package/build/components/editor/tree/sticky.js +7 -6
- package/build/components/editor/tree/template.d.ts +117 -0
- package/build/components/editor/tree/template.js +2212 -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/model.js +1 -7
- package/build/components/editor/viewer/template.d.ts +17 -0
- package/build/components/editor/viewer/template.js +258 -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/navigate.d.ts +2 -1
- package/build/components/editor/workspace/navigate.js +2 -4
- package/build/components/editor/workspace/session.d.ts +5 -1
- package/build/components/editor/workspace/session.js +71 -39
- package/build/components/editor/workspace/shortcuts.d.ts +0 -2
- package/build/components/editor/workspace/shortcuts.js +39 -35
- 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 +7 -4
- package/build/components/editor/workspace/statusbar.js +73 -86
- package/build/components/editor/workspace/strip.d.ts +1 -2
- package/build/components/editor/workspace/strip.js +10 -8
- 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 +57 -0
- package/build/components/editor/workspace/template.js +1150 -0
- package/build/components/error/index.d.ts +1 -10
- package/build/components/error/index.js +64 -32
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/filter/index.js +138 -77
- package/build/components/filter/scss/index.scss +1 -1
- package/build/components/form/action.d.ts +2 -2
- package/build/components/form/action.js +12 -9
- 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 +14 -0
- package/build/components/group/index.js +18 -0
- package/build/components/group/scss/index.scss +2 -0
- package/build/components/heatmap/index.d.ts +5 -2
- package/build/components/heatmap/index.js +79 -88
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/index.d.ts +3 -13
- package/build/components/highlight/index.js +95 -92
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/index.d.ts +2 -10
- package/build/components/icon/index.js +12 -10
- 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/lazyload.d.ts +2 -1
- package/build/components/image/lazyload.js +29 -26
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +6 -7
- package/build/components/index.js +6 -7
- package/build/components/inline-edit/index.d.ts +5 -1
- package/build/components/inline-edit/index.js +35 -27
- package/build/components/inline-edit/rich.d.ts +10 -15
- package/build/components/inline-edit/rich.js +82 -1197
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/inline-edit/status.d.ts +3 -2
- package/build/components/inline-edit/status.js +23 -18
- package/build/components/input/field.d.ts +2 -1
- package/build/components/input/field.js +12 -9
- package/build/components/input/scrub.d.ts +4 -1
- package/build/components/input/scrub.js +25 -20
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/input/tag.d.ts +4 -2
- package/build/components/input/tag.js +105 -83
- 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/index.d.ts +2 -1
- package/build/components/loading/index.js +6 -3
- package/build/components/loading/scss/index.scss +1 -1
- package/build/components/marquee/index.d.ts +2 -1
- package/build/components/marquee/index.js +92 -84
- package/build/components/marquee/scss/index.scss +1 -1
- package/build/components/marquee/velocity.js +4 -3
- package/build/components/metric/flash.d.ts +2 -1
- package/build/components/metric/flash.js +26 -25
- package/build/components/metric/index.d.ts +13 -2
- package/build/components/metric/index.js +60 -56
- 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/spy.js +9 -6
- package/build/components/nav/toc.d.ts +4 -18
- package/build/components/nav/toc.js +9 -21
- package/build/components/nav/tree.d.ts +14 -13
- package/build/components/nav/tree.js +80 -65
- package/build/components/notification/index.d.ts +5 -3
- package/build/components/notification/index.js +30 -39
- package/build/components/notification/scss/index.scss +1 -1
- package/build/components/overlay/index.d.ts +4 -5
- package/build/components/overlay/index.js +399 -196
- package/build/components/overlay/popup.d.ts +5 -6
- package/build/components/overlay/popup.js +80 -39
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/page/scss/index.scss +1 -1
- package/build/components/pagination/arrows.d.ts +2 -1
- package/build/components/pagination/arrows.js +48 -45
- package/build/components/pagination/cards.d.ts +5 -1
- package/build/components/pagination/cards.js +70 -47
- package/build/components/pagination/dots.d.ts +3 -1
- package/build/components/pagination/dots.js +29 -24
- package/build/components/pagination/index.d.ts +2 -1
- package/build/components/pagination/index.js +27 -28
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/panels/dnd.d.ts +47 -0
- package/build/components/panels/dnd.js +114 -0
- package/build/components/panels/group.d.ts +36 -0
- package/build/components/panels/group.js +322 -0
- package/build/components/panels/index.d.ts +17 -0
- package/build/components/panels/index.js +524 -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 +123 -0
- package/build/components/panels/scss/index.scss +2 -0
- package/build/components/panels/subtree.d.ts +4 -0
- package/build/components/panels/subtree.js +44 -0
- package/build/components/preview/buttons.d.ts +12 -0
- package/build/components/preview/buttons.js +26 -0
- package/build/components/preview/code.d.ts +8 -0
- package/build/components/preview/code.js +18 -0
- package/build/components/preview/header.d.ts +8 -0
- package/build/components/preview/header.js +21 -0
- package/build/components/preview/index.d.ts +37 -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 +12 -0
- package/build/components/preview/source.js +79 -0
- package/build/components/preview/stage.d.ts +8 -0
- package/build/components/preview/stage.js +28 -0
- package/build/components/progress/index.d.ts +2 -1
- package/build/components/progress/index.js +30 -26
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/progress/text.d.ts +2 -1
- package/build/components/progress/text.js +30 -30
- package/build/components/radio/index.d.ts +3 -2
- package/build/components/radio/index.js +2 -2
- package/build/components/range/filter.d.ts +2 -1
- package/build/components/range/filter.js +130 -132
- package/build/components/range/index.d.ts +2 -1
- package/build/components/range/index.js +17 -22
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/relative-time/index.d.ts +3 -1
- package/build/components/relative-time/index.js +60 -48
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/select/expand.d.ts +44 -0
- package/build/components/select/expand.js +215 -0
- package/build/components/select/index.d.ts +19 -10
- package/build/components/select/index.js +130 -90
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/shell/index.d.ts +23 -0
- package/build/components/shell/index.js +290 -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 +49 -44
- package/build/components/shortcut-recorder/scss/index.scss +1 -1
- package/build/components/sortable/index.d.ts +2 -714
- package/build/components/sortable/index.js +75 -64
- package/build/components/sortable/scss/index.scss +1 -1
- package/build/components/story/index.d.ts +3 -5
- package/build/components/story/index.js +122 -84
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/engine.js +51 -53
- package/build/components/surface-field/index.d.ts +2180 -2921
- package/build/components/surface-field/index.js +52 -51
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/surface-field/surface.d.ts +1 -10
- package/build/components/surface-field/surface.js +42 -36
- package/build/components/switch/index.d.ts +3 -2
- package/build/components/switch/index.js +2 -2
- package/build/components/tasklist/index.d.ts +8 -1
- package/build/components/tasklist/index.js +66 -47
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/textarea/index.d.ts +722 -2170
- package/build/components/textarea/index.js +67 -91
- package/build/components/textarea/scss/index.scss +1 -1
- package/build/components/theme/cards.d.ts +4 -0
- package/build/components/theme/cards.js +21 -0
- package/build/components/theme/index.d.ts +17 -4
- package/build/components/theme/index.js +40 -15
- package/build/components/theme/reveal.d.ts +6 -0
- package/build/components/theme/reveal.js +100 -0
- package/build/components/theme/scss/index.scss +1 -1
- package/build/components/theme/shared.d.ts +26 -0
- package/build/components/theme/shared.js +26 -0
- package/build/components/theme/swatches.d.ts +4 -0
- package/build/components/theme/swatches.js +21 -0
- package/build/components/theme/toggle.d.ts +15 -0
- package/build/components/theme/toggle.js +33 -0
- package/build/components/toast/index.d.ts +6 -2
- package/build/components/toast/index.js +68 -56
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/tooltip/menu.d.ts +12 -2
- package/build/components/tooltip/menu.js +234 -176
- package/build/components/tooltip/onclick.d.ts +1 -10
- package/build/components/tooltip/onclick.js +25 -27
- package/build/components/tooltip/onhover.d.ts +8 -709
- package/build/components/tooltip/onhover.js +60 -60
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/tooltip/shared.d.ts +5 -3
- package/build/components/tooltip/shared.js +201 -91
- package/build/components/tooltip/utilities.d.ts +10 -4
- package/build/components/tooltip/utilities.js +95 -18
- package/build/components/typewriter/index.d.ts +2855 -1413
- package/build/components/typewriter/index.js +17 -18
- package/build/components/typewriter/retype.d.ts +2 -1
- package/build/components/typewriter/retype.js +21 -18
- package/build/components/typewriter/rotate.d.ts +2 -1
- package/build/components/typewriter/rotate.js +41 -45
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/index.d.ts +2 -1
- package/build/components/uptime/index.js +51 -54
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/index.d.ts +719 -2161
- package/build/components/usage-meter/index.js +23 -20
- 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/disabled/scss/index.scss +2 -0
- package/build/modifiers/glass/index.d.ts +3 -2
- package/build/modifiers/glass/index.js +7 -7
- package/build/modifiers/glass/scss/index.scss +1 -1
- package/build/modifiers/scrollbar/index.d.ts +13 -13
- package/build/modifiers/scrollbar/index.js +74 -90
- package/build/modifiers/scrollbar/scss/index.scss +1 -1
- package/build/shared/animation.d.ts +1 -1
- package/build/shared/animation.js +6 -4
- package/build/shared/dispatch.d.ts +7 -0
- package/build/shared/dispatch.js +25 -0
- package/build/shared/drag.d.ts +4 -5
- package/build/shared/drag.js +4 -3
- package/build/shared/press.d.ts +1 -1
- package/build/shared/press.js +5 -3
- package/build/shared/resize.js +2 -25
- package/build/shared/transition.d.ts +1 -1
- package/build/shared/transition.js +2 -2
- package/build/shared/visible.js +1 -24
- package/package.json +10 -11
- 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 +13 -12
- package/src/components/accordion/scss/index.scss +16 -13
- package/src/components/accordion/scss/variables.scss +13 -10
- package/src/components/announcement/scss/index.scss +16 -24
- package/src/components/announcement/scss/variables.scss +20 -10
- package/src/components/breadcrumb/index.ts +11 -13
- package/src/components/breadcrumb/scss/index.scss +52 -126
- package/src/components/breadcrumb/scss/variables.scss +64 -53
- package/src/components/button/copy.ts +35 -28
- package/src/components/button/faces.ts +2 -4
- package/src/components/button/index.ts +3 -7
- package/src/components/button/kbd.ts +42 -99
- 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 +133 -0
- package/src/components/button/scss/index.scss +263 -119
- package/src/components/button/scss/variables.scss +180 -120
- package/src/components/button/sidebar.ts +7 -7
- package/src/components/button/split.ts +11 -13
- package/src/components/capslock/index.ts +11 -10
- package/src/components/capslock/scss/index.scss +24 -26
- package/src/components/capslock/scss/variables.scss +32 -14
- package/src/components/card/scss/index.scss +12 -36
- package/src/components/card/scss/variables.scss +33 -76
- package/src/components/cc/index.ts +46 -42
- package/src/components/cc/scss/index.scss +142 -155
- package/src/components/cc/scss/variables.scss +234 -44
- package/src/components/chat/index.ts +10 -0
- package/src/components/{chat-minimap → chat/minimap}/index.ts +74 -28
- package/src/components/chat/minimap/scss/index.scss +111 -0
- package/src/components/chat/minimap/scss/variables.scss +182 -0
- package/src/components/{chat-minimap → chat/minimap}/spy.ts +1 -1
- package/src/components/checkbox/group.ts +5 -5
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/checkbox/options.ts +2 -3
- package/src/components/checkbox/scss/index.scss +33 -35
- package/src/components/checkbox/scss/variables.scss +102 -56
- package/src/components/clipboard/index.ts +4 -3
- package/src/components/clipboard/write.ts +2 -1
- package/src/components/color-picker/index.ts +131 -69
- package/src/components/color-picker/scss/index.scss +138 -221
- package/src/components/color-picker/scss/variables.scss +205 -73
- package/src/components/command/index.ts +5 -860
- package/src/components/command/palette.ts +865 -0
- package/src/components/command/scss/index.scss +77 -99
- package/src/components/command/scss/variables.scss +129 -50
- package/src/components/command/search.ts +62 -0
- package/src/components/container/scss/index.scss +2 -4
- package/src/components/container/scss/variables.scss +0 -2
- package/src/components/counter/index.ts +91 -85
- package/src/components/counter/scss/index.scss +33 -41
- package/src/components/counter/scss/variables.scss +41 -19
- package/src/components/dock/index.ts +514 -42
- package/src/components/dock/scss/index.scss +288 -73
- package/src/components/dock/scss/variables.scss +301 -39
- package/src/components/editor/code/features.ts +4 -6
- package/src/components/editor/code/field.ts +1 -1
- package/src/components/editor/code/find.ts +1 -2
- package/src/components/editor/code/folding.ts +1 -1
- package/src/components/editor/code/html.ts +17 -0
- package/src/components/editor/code/keymap.ts +0 -1
- package/src/components/editor/code/minimap.ts +7 -5
- package/src/components/editor/code/rows.ts +1 -14
- package/src/components/editor/code/scss/_editor.scss +22 -54
- package/src/components/editor/code/scss/_features.scss +28 -70
- package/src/components/editor/code/scss/_minimap.scss +29 -0
- package/src/components/editor/code/scss/_services.scss +19 -30
- package/src/components/editor/code/scss/index.scss +1 -2
- package/src/components/editor/code/scss/variables.scss +217 -56
- package/src/components/editor/code/search.ts +1 -1
- package/src/components/editor/code/services/completion.ts +1 -0
- package/src/components/editor/code/services/hover.ts +1 -0
- package/src/components/editor/code/services/index.ts +1 -1
- package/src/components/editor/code/services/model.ts +1 -1
- package/src/components/editor/code/services/session.ts +1 -4
- package/src/components/editor/code/syntax.ts +1 -1
- package/src/components/editor/code/view.ts +0 -1
- package/src/components/editor/diffs/merge.ts +3 -3
- package/src/components/editor/diffs/render.ts +2 -17
- package/src/components/editor/diffs/scss/_diffs.scss +41 -129
- package/src/components/editor/diffs/scss/_merge.scss +9 -41
- package/src/components/editor/diffs/scss/index.scss +1 -1
- package/src/components/editor/diffs/scss/variables.scss +141 -13
- package/src/components/editor/diffs/view.ts +4 -5
- package/src/components/editor/markdown/editing.ts +1 -1
- package/src/components/editor/markdown/erase.ts +3 -3
- package/src/components/editor/markdown/format.ts +517 -0
- package/src/components/editor/markdown/html.ts +1 -1
- package/src/components/editor/markdown/index.ts +3 -67
- package/src/components/editor/markdown/inline.ts +9 -6
- package/src/components/editor/markdown/layout.ts +1 -1
- package/src/components/editor/markdown/model.ts +2 -17
- package/src/components/editor/markdown/render.ts +6 -8
- package/src/components/editor/markdown/scss/index.scss +157 -100
- package/src/components/editor/markdown/scss/variables.scss +241 -36
- package/src/components/editor/markdown/template.ts +69 -0
- package/src/components/editor/markdown/toolbar.ts +628 -0
- package/src/components/editor/markdown/view.ts +121 -10
- package/src/components/editor/tree/drag.ts +19 -15
- package/src/components/editor/tree/find.ts +5 -4
- package/src/components/editor/tree/icons.ts +1 -1
- package/src/components/editor/tree/index.ts +3 -3434
- package/src/components/editor/tree/scss/index.scss +261 -294
- package/src/components/editor/tree/scss/variables.scss +263 -65
- package/src/components/editor/tree/sticky.ts +1 -1
- package/src/components/editor/tree/template.ts +3436 -0
- package/src/components/editor/viewer/index.ts +3 -318
- package/src/components/editor/viewer/model.ts +1 -14
- package/src/components/editor/viewer/scss/_viewer.scss +31 -97
- package/src/components/editor/viewer/scss/variables.scss +56 -16
- package/src/components/editor/viewer/template.ts +323 -0
- package/src/components/editor/workspace/index.ts +4 -1480
- package/src/components/editor/workspace/model.ts +225 -185
- package/src/components/editor/workspace/navigate.ts +3 -6
- package/src/components/editor/workspace/scss/_keybindings.scss +165 -0
- package/src/components/editor/workspace/scss/_status.scss +65 -0
- package/src/components/editor/workspace/scss/_tabs.scss +60 -0
- package/src/components/editor/workspace/scss/index.scss +105 -330
- package/src/components/editor/workspace/scss/variables.scss +431 -0
- package/src/components/editor/workspace/session.ts +96 -53
- 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 +1477 -0
- package/src/components/error/index.ts +36 -15
- package/src/components/error/scss/index.scss +35 -64
- package/src/components/error/scss/variables.scss +29 -9
- package/src/components/filter/index.ts +147 -104
- package/src/components/filter/scss/index.scss +9 -2
- package/src/components/filter/scss/variables.scss +6 -6
- package/src/components/form/action.ts +1 -1
- package/src/components/form/index.ts +4 -1
- package/src/components/frame/scss/index.scss +37 -44
- package/src/components/frame/scss/variables.scss +31 -19
- package/src/components/grid/scss/index.scss +3 -2
- package/src/components/grid/scss/variables.scss +1 -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 +16 -46
- package/src/components/heatmap/scss/index.scss +48 -49
- package/src/components/heatmap/scss/variables.scss +74 -51
- package/src/components/highlight/index.ts +133 -120
- package/src/components/highlight/scss/index.scss +43 -45
- package/src/components/highlight/scss/variables.scss +70 -31
- package/src/components/icon/index.ts +7 -9
- package/src/components/icon/scss/index.scss +9 -2
- package/src/components/icon/scss/variables.scss +2 -0
- package/src/components/image/index.ts +4 -2
- package/src/components/image/lazyload.ts +1 -1
- package/src/components/image/scss/index.scss +18 -25
- package/src/components/image/scss/variables.scss +31 -12
- package/src/components/index.ts +6 -7
- package/src/components/inline-edit/index.ts +9 -7
- package/src/components/inline-edit/rich.ts +88 -1401
- package/src/components/inline-edit/scss/index.scss +125 -381
- package/src/components/inline-edit/scss/variables.scss +153 -92
- package/src/components/inline-edit/status.ts +8 -4
- package/src/components/input/field.ts +2 -2
- package/src/components/input/scrub.ts +1 -5
- package/src/components/input/scss/_field.scss +1 -1
- package/src/components/input/scss/_scrub.scss +21 -25
- package/src/components/input/scss/_tag.scss +28 -46
- package/src/components/input/scss/index.scss +1 -2
- package/src/components/input/scss/variables.scss +160 -77
- package/src/components/input/tag.ts +65 -56
- package/src/components/json/download.ts +2 -1
- package/src/components/json/index.ts +4 -1
- package/src/components/link/scss/index.scss +1 -5
- package/src/components/link/scss/variables.scss +5 -1
- package/src/components/loading/index.ts +1 -1
- package/src/components/loading/scss/index.scss +7 -27
- package/src/components/loading/scss/variables.scss +7 -10
- package/src/components/marquee/index.ts +36 -31
- package/src/components/marquee/scss/index.scss +37 -29
- package/src/components/marquee/scss/variables.scss +35 -24
- package/src/components/marquee/velocity.ts +7 -3
- package/src/components/metric/flash.ts +3 -2
- package/src/components/metric/index.ts +5 -13
- package/src/components/metric/scss/_flash.scss +129 -144
- package/src/components/metric/scss/index.scss +38 -48
- package/src/components/metric/scss/variables.scss +196 -102
- package/src/components/nav/index.ts +1 -1
- package/src/components/nav/scss/index.scss +47 -49
- package/src/components/nav/scss/variables.scss +59 -64
- package/src/components/nav/spy.ts +15 -6
- package/src/components/nav/toc.ts +11 -31
- package/src/components/nav/tree.ts +77 -47
- package/src/components/notification/index.ts +115 -89
- package/src/components/notification/scss/index.scss +91 -75
- package/src/components/notification/scss/variables.scss +55 -38
- package/src/components/overlay/index.ts +211 -139
- package/src/components/overlay/popup.ts +89 -52
- package/src/components/overlay/scss/index.scss +152 -189
- package/src/components/overlay/scss/variables.scss +54 -23
- package/src/components/page/scss/variables.scss +1 -1
- package/src/components/pagination/cards.ts +1 -1
- package/src/components/pagination/index.ts +1 -7
- package/src/components/pagination/scss/index.scss +191 -7
- package/src/components/pagination/scss/variables.scss +128 -40
- package/src/components/panels/dnd.ts +190 -0
- package/src/components/panels/group.ts +429 -0
- package/src/components/panels/index.ts +676 -0
- package/src/components/panels/model.ts +675 -0
- package/src/components/panels/resize.ts +157 -0
- package/src/components/panels/scss/index.scss +379 -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 +149 -0
- package/src/components/preview/scss/index.scss +158 -0
- package/src/components/preview/scss/variables.scss +149 -0
- package/src/components/preview/source.ts +73 -0
- package/src/components/preview/stage.ts +33 -0
- package/src/components/progress/scss/index.scss +120 -15
- package/src/components/progress/scss/variables.scss +144 -41
- package/src/components/progress/text.ts +11 -9
- package/src/components/radio/index.ts +2 -4
- package/src/components/range/filter.ts +16 -22
- package/src/components/range/index.ts +2 -9
- package/src/components/range/scss/_filter.scss +300 -325
- package/src/components/range/scss/_slider.scss +32 -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 +361 -71
- package/src/components/relative-time/index.ts +22 -28
- package/src/components/relative-time/scss/index.scss +17 -21
- package/src/components/relative-time/scss/variables.scss +51 -30
- package/src/components/root/scss/index.scss +14 -20
- package/src/components/root/scss/variables.scss +24 -22
- package/src/components/select/expand.ts +272 -0
- package/src/components/select/index.ts +155 -110
- package/src/components/select/scss/index.scss +99 -54
- package/src/components/select/scss/variables.scss +141 -19
- package/src/components/shell/index.ts +344 -0
- package/src/components/shell/scss/index.scss +201 -0
- package/src/components/shell/scss/variables.scss +89 -0
- package/src/components/shortcut-recorder/index.ts +20 -20
- package/src/components/shortcut-recorder/scss/index.scss +78 -58
- package/src/components/shortcut-recorder/scss/variables.scss +48 -25
- package/src/components/sortable/index.ts +25 -27
- package/src/components/sortable/scss/index.scss +59 -63
- package/src/components/sortable/scss/variables.scss +81 -52
- package/src/components/story/index.ts +111 -83
- package/src/components/story/scss/index.scss +26 -107
- package/src/components/story/scss/variables.scss +52 -22
- package/src/components/surface-field/engine.ts +71 -72
- package/src/components/surface-field/index.ts +32 -37
- package/src/components/surface-field/scss/index.scss +36 -52
- package/src/components/surface-field/scss/variables.scss +89 -23
- package/src/components/surface-field/surface.ts +4 -3
- package/src/components/switch/index.ts +2 -4
- package/src/components/tasklist/index.ts +9 -8
- package/src/components/tasklist/scss/index.scss +28 -32
- package/src/components/tasklist/scss/variables.scss +31 -32
- package/src/components/textarea/index.ts +50 -91
- package/src/components/textarea/scss/index.scss +28 -21
- package/src/components/textarea/scss/variables.scss +17 -2
- package/src/components/theme/cards.ts +19 -0
- package/src/components/theme/index.ts +68 -19
- package/src/components/theme/reveal.ts +190 -0
- package/src/components/theme/scss/index.scss +122 -0
- package/src/components/theme/scss/variables.scss +155 -16
- package/src/components/theme/shared.ts +57 -0
- package/src/components/theme/swatches.ts +15 -0
- package/src/components/theme/toggle.ts +47 -0
- package/src/components/toast/index.ts +16 -17
- package/src/components/toast/scss/index.scss +193 -155
- package/src/components/toast/scss/variables.scss +195 -53
- package/src/components/tooltip/menu.ts +194 -117
- package/src/components/tooltip/onclick.ts +16 -21
- package/src/components/tooltip/onhover.ts +5 -8
- package/src/components/tooltip/scss/index.scss +561 -85
- package/src/components/tooltip/scss/variables.scss +243 -72
- package/src/components/tooltip/shared.ts +129 -85
- package/src/components/tooltip/utilities.ts +75 -24
- package/src/components/typewriter/index.ts +7 -10
- package/src/components/typewriter/rotate.ts +26 -31
- package/src/components/typewriter/scss/index.scss +133 -3
- package/src/components/typewriter/scss/variables.scss +56 -44
- package/src/components/uptime/index.ts +13 -19
- package/src/components/uptime/scss/index.scss +99 -126
- package/src/components/uptime/scss/variables.scss +101 -55
- package/src/components/usage-meter/index.ts +1 -1
- package/src/components/usage-meter/scss/index.scss +19 -22
- package/src/components/usage-meter/scss/variables.scss +80 -36
- package/src/css-utilities/absolute.scss +54 -52
- package/src/css-utilities/background.scss +29 -23
- package/src/css-utilities/border.scss +24 -21
- package/src/css-utilities/box-shadow.scss +33 -21
- package/src/css-utilities/color.scss +34 -22
- package/src/css-utilities/disabled.scss +12 -0
- package/src/css-utilities/flex.scss +55 -53
- package/src/css-utilities/font/geist/index.scss +2 -1
- package/src/css-utilities/font/montserrat/index.scss +1 -1
- package/src/css-utilities/group.scss +6 -0
- package/src/css-utilities/hidden.scss +22 -20
- package/src/css-utilities/icon.scss +33 -30
- package/src/css-utilities/layer.scss +12 -11
- package/src/css-utilities/reset.scss +27 -16
- package/src/css-utilities/skeleton.scss +4 -1
- package/src/css-utilities/surface.scss +217 -150
- package/src/css-utilities/text.scss +115 -115
- package/src/modifiers/background/scss/index.scss +1 -0
- package/src/modifiers/background/scss/variables.scss +22 -0
- package/src/modifiers/border/scss/index.scss +1 -0
- package/src/modifiers/border/scss/variables.scss +19 -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/disabled/scss/index.scss +5 -0
- package/src/modifiers/glass/index.ts +2 -1
- package/src/modifiers/glass/scss/index.scss +8 -11
- package/src/modifiers/glass/scss/variables.scss +1 -0
- package/src/modifiers/scrollbar/index.ts +94 -113
- package/src/modifiers/scrollbar/scss/index.scss +23 -4
- package/src/modifiers/scrollbar/scss/variables.scss +6 -5
- package/src/normalize/scss/index.scss +1 -0
- package/src/shared/anchor.ts +1 -1
- package/src/shared/animation.ts +9 -7
- package/src/shared/dispatch.ts +42 -0
- package/src/shared/drag.ts +10 -4
- package/src/shared/press.ts +7 -5
- package/src/shared/resize.ts +4 -35
- package/src/shared/scss/list.scss +1 -2
- package/src/shared/transition.ts +2 -2
- package/src/shared/visible.ts +3 -35
- package/src/tokens/scss/color.scss +50 -38
- package/src/tokens/scss/focus.scss +5 -0
- package/src/tokens/scss/font-size.scss +1 -2
- package/src/tokens/scss/index.scss +1 -1
- package/src/tokens/scss/scale.scss +4 -8
- package/src/tokens/scss/size.scss +3 -3
- package/src/tokens/scss/spacer.scss +1 -1
- package/src/tokens/scss/state.scss +25 -29
- 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/vite-env.d.ts +1 -1
- package/vite.config.ts +10 -8
- 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.d.ts +0 -23
- package/build/components/copy/index.js +0 -61
- package/build/components/copy/scss/index.scss +0 -2
- package/build/components/datalist/index.d.ts +0 -42
- package/build/components/datalist/index.js +0 -186
- package/build/components/datalist/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/inline-edit/format.d.ts +0 -29
- package/build/components/inline-edit/format.js +0 -112
- package/build/components/inline-edit/history.d.ts +0 -14
- package/build/components/inline-edit/history.js +0 -40
- package/build/components/inline-edit/markdown.d.ts +0 -7
- package/build/components/inline-edit/markdown.js +0 -314
- package/build/components/inline-edit/model.d.ts +0 -61
- package/build/components/inline-edit/model.js +0 -192
- package/build/components/inline-edit/selection.d.ts +0 -7
- package/build/components/inline-edit/selection.js +0 -114
- package/build/components/inline-edit/utilities.d.ts +0 -4
- package/build/components/inline-edit/utilities.js +0 -12
- 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/build/components/sticky-header/index.d.ts +0 -2166
- package/build/components/sticky-header/index.js +0 -58
- package/build/components/sticky-header/scss/index.scss +0 -2
- package/build/components/theme-picker/index.d.ts +0 -52
- package/build/components/theme-picker/index.js +0 -167
- package/build/components/theme-picker/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/index.scss +0 -148
- 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/datalist/index.ts +0 -256
- package/src/components/datalist/scss/index.scss +0 -104
- package/src/components/datalist/scss/variables.scss +0 -33
- package/src/components/editor/workspace/scss/keybindings.scss +0 -190
- package/src/components/editor/workspace/scss/status.scss +0 -122
- package/src/components/editor/workspace/scss/tabs.scss +0 -56
- package/src/components/highlight/easing.ts +0 -33
- package/src/components/inline-edit/format.ts +0 -183
- package/src/components/inline-edit/history.ts +0 -71
- package/src/components/inline-edit/markdown.ts +0 -485
- package/src/components/inline-edit/model.ts +0 -366
- package/src/components/inline-edit/selection.ts +0 -188
- package/src/components/inline-edit/utilities.ts +0 -18
- 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/sticky-header/index.ts +0 -78
- package/src/components/sticky-header/scss/index.scss +0 -140
- package/src/components/sticky-header/scss/variables.scss +0 -46
- package/src/components/theme-picker/index.ts +0 -231
- package/src/components/theme-picker/scss/index.scss +0 -264
- package/src/components/tooltip/scss/_center.scss +0 -9
- package/src/components/tooltip/scss/_east.scss +0 -33
- package/src/components/tooltip/scss/_menu.scss +0 -367
- package/src/components/tooltip/scss/_north.scss +0 -33
- package/src/components/tooltip/scss/_shared.scss +0 -109
- package/src/components/tooltip/scss/_south.scss +0 -33
- package/src/components/tooltip/scss/_west.scss +0 -33
- 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,8 +1,8 @@
|
|
|
1
|
+
import { peek, read, signal, write, type Signal } from '@esportsplus/reactivity';
|
|
1
2
|
import type { Command } from '../code/keymap';
|
|
2
|
-
import { EditorDocument } from '../code/document';
|
|
3
3
|
import { sanitize } from './keybindings';
|
|
4
4
|
import type { FileTreeExport, FileTreeImportEntry } from '../tree';
|
|
5
|
-
import { closable, compareKey, compareTab, order, place } from './tabs';
|
|
5
|
+
import { closable, compareKey, compareTab, order, place, WorkspaceTab } from './tabs';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
type FileOperation = {
|
|
@@ -108,24 +108,11 @@ type WorkspaceState = Readonly<{
|
|
|
108
108
|
opening: readonly string[];
|
|
109
109
|
preferences: Readonly<WorkspacePreferences>;
|
|
110
110
|
reveal: { column: number; line: number; request: number; tabId: number } | undefined;
|
|
111
|
-
revision: number;
|
|
112
111
|
status: string;
|
|
113
112
|
statusKind: 'error' | 'info';
|
|
114
113
|
tabs: readonly WorkspaceTab[];
|
|
115
114
|
}>;
|
|
116
115
|
|
|
117
|
-
type WorkspaceTab = {
|
|
118
|
-
readonly compare?: WorkspaceCompare;
|
|
119
|
-
readonly document: EditorDocument;
|
|
120
|
-
readonly id: number;
|
|
121
|
-
missing: boolean;
|
|
122
|
-
path: string;
|
|
123
|
-
pinned: boolean;
|
|
124
|
-
preview: boolean;
|
|
125
|
-
saved: string;
|
|
126
|
-
scroll: { left: number; top: number };
|
|
127
|
-
};
|
|
128
|
-
|
|
129
116
|
type WorkspaceTarget = { column?: number; line?: number; path: string; requestId?: number | string };
|
|
130
117
|
|
|
131
118
|
|
|
@@ -145,12 +132,31 @@ const DEFAULTS: WorkspacePreferences = {
|
|
|
145
132
|
|
|
146
133
|
const ERROR_PREFIX = /^Workspace: /;
|
|
147
134
|
|
|
135
|
+
const PREFERENCES = Object.keys(DEFAULTS) as (keyof WorkspacePreferences)[];
|
|
136
|
+
|
|
148
137
|
|
|
149
138
|
// The status line already names the failed operation, so this module's error prefix is dropped there.
|
|
150
139
|
function message(error: unknown) {
|
|
151
140
|
return (error instanceof Error ? error.message : String(error)).replace(ERROR_PREFIX, '');
|
|
152
141
|
}
|
|
153
142
|
|
|
143
|
+
// Each preference is a signal of its own, so toggling wrap never reaches what reads the keybindings.
|
|
144
|
+
function preferences() {
|
|
145
|
+
let values = {} as WorkspacePreferences;
|
|
146
|
+
|
|
147
|
+
for (let key of PREFERENCES) {
|
|
148
|
+
let node: Signal<unknown> = signal(DEFAULTS[key]);
|
|
149
|
+
|
|
150
|
+
Object.defineProperty(values, key, {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: () => read(node),
|
|
153
|
+
set: (value) => write(node, value)
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return values;
|
|
158
|
+
}
|
|
159
|
+
|
|
154
160
|
/** Workspace-relative path identity; accept an absolute open target only when it lies inside cwd.
|
|
155
161
|
* @throws {Error} A path outside the workspace, or an invalid path segment.
|
|
156
162
|
*/
|
|
@@ -182,29 +188,18 @@ function workspacePath(value: string, cwd = '') {
|
|
|
182
188
|
|
|
183
189
|
const containsPath = (parent: string, path: string) => path === parent || path.startsWith(`${parent}/`);
|
|
184
190
|
|
|
185
|
-
const dirty = (tab: WorkspaceTab) => tab.document.value !== tab.saved;
|
|
186
|
-
|
|
187
191
|
|
|
188
|
-
/** UI-independent workspace coordinator. One document per tab; all file mutations are serialized.
|
|
192
|
+
/** UI-independent workspace coordinator. One document per tab; all file mutations are serialized. Each field of
|
|
193
|
+
* 'state', each preference and each tab flag is a signal of its own, so a reader re-runs only for what it read.
|
|
194
|
+
*/
|
|
189
195
|
class EditorWorkspaceModel {
|
|
190
196
|
readonly host: WorkspaceHost;
|
|
191
|
-
|
|
192
|
-
private busy = 0;
|
|
197
|
+
readonly state: WorkspaceState;
|
|
193
198
|
private closed = new Map<string, number>();
|
|
194
199
|
private confirm: WorkspaceHost['confirm'];
|
|
195
|
-
private cwd: string;
|
|
196
|
-
// Each tab's dirty state as last emitted, so typing only notifies when a tab turns dirty or clean.
|
|
197
|
-
private dirty = new Map<number, boolean>();
|
|
198
200
|
private disposed = false;
|
|
199
|
-
private documents = new Map<number, VoidFunction>();
|
|
200
|
-
private entries: WorkspaceEntry[] = [];
|
|
201
201
|
private epoch = 0;
|
|
202
|
-
private error = '';
|
|
203
|
-
private history: FileOperation[] = [];
|
|
204
202
|
private lastTarget: number | string | undefined;
|
|
205
|
-
private listeners = new Set<(state: WorkspaceState) => void>();
|
|
206
|
-
private loaded = false;
|
|
207
|
-
private loading = false;
|
|
208
203
|
private mutation = 0;
|
|
209
204
|
private openIntent = 0;
|
|
210
205
|
private opening = new Map<string, Promise<WorkspaceTab | undefined>>();
|
|
@@ -212,31 +207,183 @@ class EditorWorkspaceModel {
|
|
|
212
207
|
// Optimistic desired entries survive a lagging workspace index until it acknowledges each mutation.
|
|
213
208
|
private overlay = new Map<string, WorkspaceEntry | null>();
|
|
214
209
|
private preferenceRevision = 0;
|
|
215
|
-
private preferences =
|
|
210
|
+
private preferences = preferences();
|
|
216
211
|
private preferenceWrite = Promise.resolve();
|
|
217
212
|
private refreshIntent = 0;
|
|
218
213
|
private requestedPath = '';
|
|
219
|
-
private revealed: WorkspaceState['reveal'];
|
|
220
214
|
private revealRequest = 0;
|
|
221
|
-
private revision = 0;
|
|
222
215
|
private running = false;
|
|
216
|
+
private signals = {
|
|
217
|
+
active: signal<WorkspaceTab | undefined>(undefined),
|
|
218
|
+
busy: signal(0),
|
|
219
|
+
cwd: signal(''),
|
|
220
|
+
entries: signal<readonly WorkspaceEntry[]>([]),
|
|
221
|
+
error: signal(''),
|
|
222
|
+
history: signal<readonly FileOperation[]>([]),
|
|
223
|
+
loaded: signal(false),
|
|
224
|
+
loading: signal(false),
|
|
225
|
+
opening: signal<readonly string[]>([]),
|
|
226
|
+
reveal: signal<WorkspaceState['reveal']>(undefined),
|
|
227
|
+
status: signal(''),
|
|
228
|
+
statusKind: signal<WorkspaceState['statusKind']>('info'),
|
|
229
|
+
tabs: signal<readonly WorkspaceTab[]>([])
|
|
230
|
+
};
|
|
223
231
|
private starting: Promise<void> | undefined;
|
|
224
|
-
private statusKind: 'error' | 'info' = 'info';
|
|
225
|
-
private statusText = '';
|
|
226
232
|
private tabId = 0;
|
|
227
|
-
private tabs: WorkspaceTab[] = [];
|
|
228
233
|
private unwatch: VoidFunction | undefined;
|
|
229
234
|
private watchers = new Set<(event: WorkspaceChange) => void>();
|
|
230
235
|
private watchWork = Promise.resolve();
|
|
231
236
|
|
|
232
237
|
|
|
233
238
|
constructor(host: WorkspaceHost, cwd = '', preferences: Partial<WorkspacePreferences> = {}) {
|
|
239
|
+
let signals = this.signals;
|
|
240
|
+
|
|
234
241
|
this.cwd = cwd;
|
|
235
242
|
this.host = host;
|
|
243
|
+
this.state = {
|
|
244
|
+
get active() {
|
|
245
|
+
return read(signals.active);
|
|
246
|
+
},
|
|
247
|
+
get busy() {
|
|
248
|
+
return read(signals.busy);
|
|
249
|
+
},
|
|
250
|
+
get canUndoFiles() {
|
|
251
|
+
return read(signals.history).length > 0;
|
|
252
|
+
},
|
|
253
|
+
get cwd() {
|
|
254
|
+
return read(signals.cwd);
|
|
255
|
+
},
|
|
256
|
+
get entries() {
|
|
257
|
+
return read(signals.entries);
|
|
258
|
+
},
|
|
259
|
+
get error() {
|
|
260
|
+
return read(signals.error);
|
|
261
|
+
},
|
|
262
|
+
get loaded() {
|
|
263
|
+
return read(signals.loaded);
|
|
264
|
+
},
|
|
265
|
+
get loading() {
|
|
266
|
+
return read(signals.loading);
|
|
267
|
+
},
|
|
268
|
+
get opening() {
|
|
269
|
+
return read(signals.opening);
|
|
270
|
+
},
|
|
271
|
+
preferences: this.preferences,
|
|
272
|
+
get reveal() {
|
|
273
|
+
return read(signals.reveal);
|
|
274
|
+
},
|
|
275
|
+
get status() {
|
|
276
|
+
return read(signals.status);
|
|
277
|
+
},
|
|
278
|
+
get statusKind() {
|
|
279
|
+
return read(signals.statusKind);
|
|
280
|
+
},
|
|
281
|
+
get tabs() {
|
|
282
|
+
return read(signals.tabs);
|
|
283
|
+
}
|
|
284
|
+
};
|
|
236
285
|
this.applyPreferences(preferences);
|
|
237
286
|
}
|
|
238
287
|
|
|
239
288
|
|
|
289
|
+
// The model's own reads never track, so a method an effect calls never subscribes that effect to the model.
|
|
290
|
+
private get active() {
|
|
291
|
+
return peek(this.signals.active);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
private set active(value: WorkspaceTab | undefined) {
|
|
295
|
+
write(this.signals.active, value);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
private get busy() {
|
|
299
|
+
return peek(this.signals.busy);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
private set busy(value: number) {
|
|
303
|
+
write(this.signals.busy, value);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
private get cwd() {
|
|
307
|
+
return peek(this.signals.cwd);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
private set cwd(value: string) {
|
|
311
|
+
write(this.signals.cwd, value);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
private get entries() {
|
|
315
|
+
return peek(this.signals.entries);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
private set entries(value: readonly WorkspaceEntry[]) {
|
|
319
|
+
write(this.signals.entries, value);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
private get error() {
|
|
323
|
+
return peek(this.signals.error);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
private set error(value: string) {
|
|
327
|
+
write(this.signals.error, value);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
private get history() {
|
|
331
|
+
return peek(this.signals.history);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
private set history(value: readonly FileOperation[]) {
|
|
335
|
+
write(this.signals.history, value);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
private get loaded() {
|
|
339
|
+
return peek(this.signals.loaded);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
private set loaded(value: boolean) {
|
|
343
|
+
write(this.signals.loaded, value);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
private get loading() {
|
|
347
|
+
return peek(this.signals.loading);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
private set loading(value: boolean) {
|
|
351
|
+
write(this.signals.loading, value);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
private get revealed() {
|
|
355
|
+
return peek(this.signals.reveal);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
private set revealed(value: WorkspaceState['reveal']) {
|
|
359
|
+
write(this.signals.reveal, value);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
private get statusKind() {
|
|
363
|
+
return peek(this.signals.statusKind);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
private set statusKind(value: WorkspaceState['statusKind']) {
|
|
367
|
+
write(this.signals.statusKind, value);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
private get statusText() {
|
|
371
|
+
return peek(this.signals.status);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
private set statusText(value: string) {
|
|
375
|
+
write(this.signals.status, value);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
private get tabs() {
|
|
379
|
+
return peek(this.signals.tabs);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
private set tabs(value: readonly WorkspaceTab[]) {
|
|
383
|
+
write(this.signals.tabs, value);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
|
|
240
387
|
private applyPreferences(preferences: Partial<WorkspacePreferences>) {
|
|
241
388
|
if (preferences.autoSave === 'delay' || preferences.autoSave === 'focus' || preferences.autoSave === 'off') {
|
|
242
389
|
this.preferences.autoSave = preferences.autoSave;
|
|
@@ -262,7 +409,7 @@ class EditorWorkspaceModel {
|
|
|
262
409
|
}
|
|
263
410
|
|
|
264
411
|
private async authorize(kind: WorkspaceConfirmation['kind'], tabs: readonly WorkspaceTab[], paths: readonly string[]) {
|
|
265
|
-
let changed = tabs.filter(dirty),
|
|
412
|
+
let changed = tabs.filter((tab) => tab.dirty),
|
|
266
413
|
revisions = new Map(tabs.map((tab) => [tab.id, tab.document.state.revision]));
|
|
267
414
|
|
|
268
415
|
if (!changed.length) {
|
|
@@ -292,7 +439,7 @@ class EditorWorkspaceModel {
|
|
|
292
439
|
|
|
293
440
|
if (decision === 'save') {
|
|
294
441
|
for (let tab of changed) {
|
|
295
|
-
if (!(await this.save(tab)) || dirty
|
|
442
|
+
if (!(await this.save(tab)) || tab.dirty) {
|
|
296
443
|
this.status('Changes made during saving remain open.', true);
|
|
297
444
|
return;
|
|
298
445
|
}
|
|
@@ -328,8 +475,6 @@ class EditorWorkspaceModel {
|
|
|
328
475
|
this.removeTab(tab);
|
|
329
476
|
}
|
|
330
477
|
|
|
331
|
-
this.emit();
|
|
332
|
-
|
|
333
478
|
return true;
|
|
334
479
|
}
|
|
335
480
|
|
|
@@ -346,25 +491,11 @@ class EditorWorkspaceModel {
|
|
|
346
491
|
|
|
347
492
|
this.entries = [...this.entries.filter((entry) => !removed.has(entry.path)), ...after];
|
|
348
493
|
this.mutation++;
|
|
349
|
-
this.emit();
|
|
350
494
|
}
|
|
351
495
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
this.revision++;
|
|
358
|
-
|
|
359
|
-
for (let i = 0, n = this.tabs.length; i < n; i++) {
|
|
360
|
-
this.dirty.set(this.tabs[i].id, dirty(this.tabs[i]));
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
let state = this.state;
|
|
364
|
-
|
|
365
|
-
for (let listener of [...this.listeners]) {
|
|
366
|
-
listener(state);
|
|
367
|
-
}
|
|
496
|
+
// A path that started or stopped opening; 'state.opening' lists the paths still on their way.
|
|
497
|
+
private pending() {
|
|
498
|
+
write(this.signals.opening, [...this.opening.keys()]);
|
|
368
499
|
}
|
|
369
500
|
|
|
370
501
|
private queue<T>(label: string, task: () => Promise<T>) {
|
|
@@ -375,7 +506,6 @@ class EditorWorkspaceModel {
|
|
|
375
506
|
}
|
|
376
507
|
|
|
377
508
|
this.busy++;
|
|
378
|
-
this.emit();
|
|
379
509
|
|
|
380
510
|
try {
|
|
381
511
|
return await task();
|
|
@@ -389,7 +519,6 @@ class EditorWorkspaceModel {
|
|
|
389
519
|
}
|
|
390
520
|
finally {
|
|
391
521
|
this.busy--;
|
|
392
|
-
this.emit();
|
|
393
522
|
}
|
|
394
523
|
});
|
|
395
524
|
|
|
@@ -405,44 +534,14 @@ class EditorWorkspaceModel {
|
|
|
405
534
|
return;
|
|
406
535
|
}
|
|
407
536
|
|
|
408
|
-
this.tabs.
|
|
409
|
-
this.documents.get(tab.id)?.();
|
|
410
|
-
this.documents.delete(tab.id);
|
|
411
|
-
this.dirty.delete(tab.id);
|
|
537
|
+
let tabs = this.tabs.filter((item) => item !== tab);
|
|
412
538
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
}
|
|
539
|
+
this.tabs = tabs;
|
|
540
|
+
tab.dispose();
|
|
417
541
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
let active: WorkspaceTab | undefined;
|
|
421
|
-
|
|
422
|
-
for (let i = 0, n = this.tabs.length; i < n; i++) {
|
|
423
|
-
if (this.tabs[i].id === this.active) {
|
|
424
|
-
active = this.tabs[i];
|
|
425
|
-
break;
|
|
426
|
-
}
|
|
542
|
+
if (this.active === tab) {
|
|
543
|
+
this.active = tabs[at] ?? tabs[at - 1];
|
|
427
544
|
}
|
|
428
|
-
|
|
429
|
-
return {
|
|
430
|
-
active,
|
|
431
|
-
busy: this.busy,
|
|
432
|
-
canUndoFiles: this.history.length > 0,
|
|
433
|
-
cwd: this.cwd,
|
|
434
|
-
entries: this.entries,
|
|
435
|
-
error: this.error,
|
|
436
|
-
loaded: this.loaded,
|
|
437
|
-
loading: this.loading,
|
|
438
|
-
opening: [...this.opening.keys()],
|
|
439
|
-
preferences: this.preferences,
|
|
440
|
-
reveal: this.revealed,
|
|
441
|
-
revision: this.revision,
|
|
442
|
-
status: this.statusText,
|
|
443
|
-
statusKind: this.statusKind,
|
|
444
|
-
tabs: this.tabs
|
|
445
|
-
};
|
|
446
545
|
}
|
|
447
546
|
|
|
448
547
|
|
|
@@ -455,8 +554,7 @@ class EditorWorkspaceModel {
|
|
|
455
554
|
|
|
456
555
|
this.openIntent++;
|
|
457
556
|
this.requestedPath = found.path;
|
|
458
|
-
this.active = found
|
|
459
|
-
this.emit();
|
|
557
|
+
this.active = found;
|
|
460
558
|
}
|
|
461
559
|
|
|
462
560
|
/** Adds a tab whose text came from elsewhere, like a restored draft; undefined when the path is open or opening. */
|
|
@@ -465,33 +563,14 @@ class EditorWorkspaceModel {
|
|
|
465
563
|
return;
|
|
466
564
|
}
|
|
467
565
|
|
|
468
|
-
let tab
|
|
469
|
-
document: new EditorDocument(content),
|
|
470
|
-
id: ++this.tabId,
|
|
471
|
-
missing,
|
|
472
|
-
path,
|
|
473
|
-
pinned: false,
|
|
474
|
-
preview: false,
|
|
475
|
-
saved,
|
|
476
|
-
scroll: { left: 0, top: 0 }
|
|
477
|
-
};
|
|
566
|
+
let tab = new WorkspaceTab(++this.tabId, content, { missing, path, saved });
|
|
478
567
|
|
|
479
|
-
this.tabs.
|
|
480
|
-
this.documents.set(tab.id, tab.document.subscribe((_, change) => {
|
|
481
|
-
if (change.textChanged && dirty(tab) !== this.dirty.get(tab.id)) {
|
|
482
|
-
if (dirty(tab)) {
|
|
483
|
-
tab.preview = false;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
this.emit();
|
|
487
|
-
}
|
|
488
|
-
}));
|
|
489
|
-
this.emit();
|
|
568
|
+
this.tabs = [...this.tabs, tab];
|
|
490
569
|
|
|
491
570
|
return tab;
|
|
492
571
|
}
|
|
493
572
|
|
|
494
|
-
async close(path = this.
|
|
573
|
+
async close(path = this.active?.path) {
|
|
495
574
|
if (!path) {
|
|
496
575
|
return false;
|
|
497
576
|
}
|
|
@@ -509,16 +588,15 @@ class EditorWorkspaceModel {
|
|
|
509
588
|
}
|
|
510
589
|
|
|
511
590
|
this.removeTab(tab);
|
|
512
|
-
this.emit();
|
|
513
591
|
|
|
514
592
|
return true;
|
|
515
593
|
}
|
|
516
594
|
|
|
517
|
-
closeOthers(path = this.
|
|
595
|
+
closeOthers(path = this.active?.path) {
|
|
518
596
|
return this.closeTabs(closable(this.tabs, 'others', path));
|
|
519
597
|
}
|
|
520
598
|
|
|
521
|
-
closeRight(path = this.
|
|
599
|
+
closeRight(path = this.active?.path) {
|
|
522
600
|
return this.closeTabs(closable(this.tabs, 'right', path));
|
|
523
601
|
}
|
|
524
602
|
|
|
@@ -565,7 +643,7 @@ class EditorWorkspaceModel {
|
|
|
565
643
|
|
|
566
644
|
if (!tab) {
|
|
567
645
|
tab = compareTab(++this.tabId, { modified: texts[1], original: texts[0], paths });
|
|
568
|
-
this.tabs.
|
|
646
|
+
this.tabs = [...this.tabs, tab];
|
|
569
647
|
}
|
|
570
648
|
}
|
|
571
649
|
|
|
@@ -618,7 +696,7 @@ class EditorWorkspaceModel {
|
|
|
618
696
|
return false;
|
|
619
697
|
}
|
|
620
698
|
|
|
621
|
-
this.history.
|
|
699
|
+
this.history = [...this.history, { after: [], before, id: result.operationId, kind: 'delete' }];
|
|
622
700
|
this.desire(before, []);
|
|
623
701
|
|
|
624
702
|
for (let tab of this.tabs.slice()) {
|
|
@@ -650,12 +728,9 @@ class EditorWorkspaceModel {
|
|
|
650
728
|
this.stop();
|
|
651
729
|
this.disposed = true;
|
|
652
730
|
|
|
653
|
-
for (let
|
|
654
|
-
|
|
731
|
+
for (let tab of this.tabs) {
|
|
732
|
+
tab.dispose();
|
|
655
733
|
}
|
|
656
|
-
|
|
657
|
-
this.documents.clear();
|
|
658
|
-
this.listeners.clear();
|
|
659
734
|
}
|
|
660
735
|
|
|
661
736
|
/** Hears each event the host's watcher reports, once its refresh has started. */
|
|
@@ -703,33 +778,16 @@ class EditorWorkspaceModel {
|
|
|
703
778
|
return;
|
|
704
779
|
}
|
|
705
780
|
|
|
706
|
-
let tab
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
missing: false,
|
|
710
|
-
path,
|
|
711
|
-
pinned: false,
|
|
712
|
-
preview,
|
|
713
|
-
saved: content,
|
|
714
|
-
scroll: { left: 0, top: 0 }
|
|
715
|
-
};
|
|
781
|
+
let tab = new WorkspaceTab(++this.tabId, content, { path, preview }),
|
|
782
|
+
tabs = [...this.tabs],
|
|
783
|
+
replaced = place(tabs, tab);
|
|
716
784
|
|
|
717
|
-
|
|
785
|
+
this.tabs = tabs;
|
|
718
786
|
|
|
719
787
|
if (replaced) {
|
|
720
788
|
this.removeTab(replaced);
|
|
721
789
|
}
|
|
722
790
|
|
|
723
|
-
this.documents.set(tab.id, tab.document.subscribe((_, change) => {
|
|
724
|
-
if (change.textChanged && dirty(tab) !== this.dirty.get(tab.id)) {
|
|
725
|
-
if (dirty(tab)) {
|
|
726
|
-
tab.preview = false;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
this.emit();
|
|
730
|
-
}
|
|
731
|
-
}));
|
|
732
|
-
|
|
733
791
|
return tab;
|
|
734
792
|
}
|
|
735
793
|
catch (error) {
|
|
@@ -740,12 +798,12 @@ class EditorWorkspaceModel {
|
|
|
740
798
|
finally {
|
|
741
799
|
if (epoch === this.epoch) {
|
|
742
800
|
this.opening.delete(path);
|
|
743
|
-
this.
|
|
801
|
+
this.pending();
|
|
744
802
|
}
|
|
745
803
|
}
|
|
746
804
|
})();
|
|
747
805
|
this.opening.set(path, pending);
|
|
748
|
-
this.
|
|
806
|
+
this.pending();
|
|
749
807
|
}
|
|
750
808
|
|
|
751
809
|
let tab = existing ?? (await pending);
|
|
@@ -759,7 +817,7 @@ class EditorWorkspaceModel {
|
|
|
759
817
|
}
|
|
760
818
|
|
|
761
819
|
if (intent === this.openIntent) {
|
|
762
|
-
this.active = tab
|
|
820
|
+
this.active = tab;
|
|
763
821
|
|
|
764
822
|
if (line !== undefined) {
|
|
765
823
|
let safeColumn = Number.isFinite(column) ? Math.max(1, Math.trunc(column)) : 1,
|
|
@@ -772,7 +830,6 @@ class EditorWorkspaceModel {
|
|
|
772
830
|
|
|
773
831
|
this.statusText = '';
|
|
774
832
|
this.statusKind = 'info';
|
|
775
|
-
this.emit();
|
|
776
833
|
}
|
|
777
834
|
|
|
778
835
|
return tab;
|
|
@@ -795,10 +852,12 @@ class EditorWorkspaceModel {
|
|
|
795
852
|
return;
|
|
796
853
|
}
|
|
797
854
|
|
|
855
|
+
let tabs = [...this.tabs];
|
|
856
|
+
|
|
798
857
|
tab.pinned = pinned;
|
|
799
858
|
tab.preview = false;
|
|
800
|
-
order(
|
|
801
|
-
this.
|
|
859
|
+
order(tabs);
|
|
860
|
+
this.tabs = tabs;
|
|
802
861
|
}
|
|
803
862
|
|
|
804
863
|
async refresh(_paths?: readonly string[]) {
|
|
@@ -812,7 +871,6 @@ class EditorWorkspaceModel {
|
|
|
812
871
|
mutation = this.mutation;
|
|
813
872
|
|
|
814
873
|
this.loading = true;
|
|
815
|
-
this.emit();
|
|
816
874
|
|
|
817
875
|
try {
|
|
818
876
|
let listed = await this.host.list(cwd);
|
|
@@ -847,7 +905,6 @@ class EditorWorkspaceModel {
|
|
|
847
905
|
this.error = '';
|
|
848
906
|
this.loaded = true;
|
|
849
907
|
this.loading = false;
|
|
850
|
-
this.emit();
|
|
851
908
|
|
|
852
909
|
// Refresh sequentially to bound IO even with many open tabs. Recheck after the read, not only before it.
|
|
853
910
|
for (let tab of [...this.tabs]) {
|
|
@@ -861,8 +918,7 @@ class EditorWorkspaceModel {
|
|
|
861
918
|
|
|
862
919
|
tab.missing = !entries.has(tab.path);
|
|
863
920
|
|
|
864
|
-
if (dirty
|
|
865
|
-
this.emit();
|
|
921
|
+
if (tab.dirty || tab.missing) {
|
|
866
922
|
continue;
|
|
867
923
|
}
|
|
868
924
|
|
|
@@ -878,7 +934,7 @@ class EditorWorkspaceModel {
|
|
|
878
934
|
mutation !== this.mutation ||
|
|
879
935
|
!this.tabs.includes(tab) ||
|
|
880
936
|
tab.path !== path ||
|
|
881
|
-
dirty
|
|
937
|
+
tab.dirty ||
|
|
882
938
|
tab.document.state.revision !== revision
|
|
883
939
|
) {
|
|
884
940
|
continue;
|
|
@@ -889,8 +945,6 @@ class EditorWorkspaceModel {
|
|
|
889
945
|
if (content !== tab.document.value) {
|
|
890
946
|
tab.document.reset(content, tab.document.selection);
|
|
891
947
|
}
|
|
892
|
-
|
|
893
|
-
this.emit();
|
|
894
948
|
}
|
|
895
949
|
catch (error) {
|
|
896
950
|
if (epoch === this.epoch && this.tabs.includes(tab)) {
|
|
@@ -902,13 +956,11 @@ class EditorWorkspaceModel {
|
|
|
902
956
|
catch (error) {
|
|
903
957
|
if (epoch === this.epoch && intent === this.refreshIntent) {
|
|
904
958
|
this.error = message(error);
|
|
905
|
-
this.emit();
|
|
906
959
|
}
|
|
907
960
|
}
|
|
908
961
|
finally {
|
|
909
962
|
if (epoch === this.epoch && intent === this.refreshIntent) {
|
|
910
963
|
this.loading = false;
|
|
911
|
-
this.emit();
|
|
912
964
|
}
|
|
913
965
|
}
|
|
914
966
|
}
|
|
@@ -947,7 +999,10 @@ class EditorWorkspaceModel {
|
|
|
947
999
|
|
|
948
1000
|
let after = before.map((entry) => ({ ...entry, path: to + entry.path.slice(from.length) }));
|
|
949
1001
|
|
|
950
|
-
this.history
|
|
1002
|
+
this.history = [
|
|
1003
|
+
...this.history,
|
|
1004
|
+
{ after, before, destination: to, id: result.operationId, kind: 'rename', source: from }
|
|
1005
|
+
];
|
|
951
1006
|
|
|
952
1007
|
for (let tab of this.tabs) {
|
|
953
1008
|
if (containsPath(from, tab.path)) {
|
|
@@ -973,13 +1028,13 @@ class EditorWorkspaceModel {
|
|
|
973
1028
|
}
|
|
974
1029
|
}
|
|
975
1030
|
|
|
976
|
-
save(tab = this.
|
|
1031
|
+
save(tab = this.active) {
|
|
977
1032
|
return this.queue('Save', async () => {
|
|
978
1033
|
if (!tab || !this.tabs.includes(tab) || tab.compare) {
|
|
979
1034
|
return false;
|
|
980
1035
|
}
|
|
981
1036
|
|
|
982
|
-
if (!dirty
|
|
1037
|
+
if (!tab.dirty && !tab.missing) {
|
|
983
1038
|
return true;
|
|
984
1039
|
}
|
|
985
1040
|
|
|
@@ -1023,10 +1078,8 @@ class EditorWorkspaceModel {
|
|
|
1023
1078
|
}
|
|
1024
1079
|
|
|
1025
1080
|
setPreferences(preferences: Partial<WorkspacePreferences>) {
|
|
1026
|
-
this.preferences = { ...this.preferences };
|
|
1027
1081
|
this.applyPreferences(preferences);
|
|
1028
1082
|
this.preferenceRevision++;
|
|
1029
|
-
this.emit();
|
|
1030
1083
|
|
|
1031
1084
|
let epoch = this.epoch,
|
|
1032
1085
|
snapshot = { ...this.preferences };
|
|
@@ -1072,7 +1125,6 @@ class EditorWorkspaceModel {
|
|
|
1072
1125
|
this.overlay.clear();
|
|
1073
1126
|
this.revealed = undefined;
|
|
1074
1127
|
this.statusText = '';
|
|
1075
|
-
this.emit();
|
|
1076
1128
|
await this.start();
|
|
1077
1129
|
|
|
1078
1130
|
return true;
|
|
@@ -1095,7 +1147,6 @@ class EditorWorkspaceModel {
|
|
|
1095
1147
|
this.starting = (async () => {
|
|
1096
1148
|
if (!this.cwd) {
|
|
1097
1149
|
this.error = 'No workspace open.';
|
|
1098
|
-
this.emit();
|
|
1099
1150
|
return;
|
|
1100
1151
|
}
|
|
1101
1152
|
|
|
@@ -1106,9 +1157,7 @@ class EditorWorkspaceModel {
|
|
|
1106
1157
|
let result = await this.host.preferences?.get();
|
|
1107
1158
|
|
|
1108
1159
|
if (epoch === this.epoch && result && revision === this.preferenceRevision) {
|
|
1109
|
-
this.preferences = { ...this.preferences };
|
|
1110
1160
|
this.applyPreferences(result);
|
|
1111
|
-
this.emit();
|
|
1112
1161
|
}
|
|
1113
1162
|
}
|
|
1114
1163
|
catch (error) {
|
|
@@ -1155,7 +1204,6 @@ class EditorWorkspaceModel {
|
|
|
1155
1204
|
status(text: string, error = false) {
|
|
1156
1205
|
this.statusText = text;
|
|
1157
1206
|
this.statusKind = error ? 'error' : 'info';
|
|
1158
|
-
this.emit();
|
|
1159
1207
|
}
|
|
1160
1208
|
|
|
1161
1209
|
stop() {
|
|
@@ -1165,17 +1213,9 @@ class EditorWorkspaceModel {
|
|
|
1165
1213
|
this.loading = false;
|
|
1166
1214
|
this.openIntent++;
|
|
1167
1215
|
this.opening.clear();
|
|
1216
|
+
this.pending();
|
|
1168
1217
|
this.refreshIntent++;
|
|
1169
1218
|
this.running = false;
|
|
1170
|
-
this.emit();
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
subscribe(listener: (state: WorkspaceState) => void) {
|
|
1174
|
-
this.listeners.add(listener);
|
|
1175
|
-
|
|
1176
|
-
return () => {
|
|
1177
|
-
this.listeners.delete(listener);
|
|
1178
|
-
};
|
|
1179
1219
|
}
|
|
1180
1220
|
|
|
1181
1221
|
undoFiles() {
|
|
@@ -1194,7 +1234,7 @@ class EditorWorkspaceModel {
|
|
|
1194
1234
|
return false;
|
|
1195
1235
|
}
|
|
1196
1236
|
|
|
1197
|
-
this.history.
|
|
1237
|
+
this.history = this.history.slice(0, -1);
|
|
1198
1238
|
|
|
1199
1239
|
if (operation.kind === 'rename') {
|
|
1200
1240
|
for (let tab of this.tabs) {
|
|
@@ -1235,7 +1275,7 @@ class EditorWorkspaceModel {
|
|
|
1235
1275
|
}
|
|
1236
1276
|
|
|
1237
1277
|
|
|
1238
|
-
export { containsPath, DEFAULTS,
|
|
1278
|
+
export { containsPath, DEFAULTS, EditorWorkspaceModel, workspacePath };
|
|
1239
1279
|
export type {
|
|
1240
1280
|
WorkspaceAction,
|
|
1241
1281
|
WorkspaceChange,
|