@esportsplus/ui 0.57.0 → 0.58.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/README.md +123 -39
- package/build/components/accordion/group.d.ts +14 -0
- package/build/components/accordion/group.js +21 -0
- package/build/components/accordion/index.d.ts +9 -0
- package/build/components/accordion/index.js +20 -3
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/announcement/scss/index.scss +1 -1
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/sidebar.d.ts +3 -0
- package/build/components/button/sidebar.js +40 -10
- package/build/components/capslock/index.js +1 -1
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/cc/scss/index.scss +1 -1
- package/build/components/chat-minimap/scss/index.scss +1 -1
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/color-picker/index.d.ts +1 -0
- package/build/components/color-picker/index.js +166 -136
- package/build/components/color-picker/scss/index.scss +1 -1
- package/build/components/command/index.d.ts +0 -1
- package/build/components/command/index.js +3 -2
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/copy/scss/index.scss +1 -1
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/datalist/index.js +3 -3
- package/build/components/datalist/scss/index.scss +1 -1
- package/build/components/dock/scss/index.scss +1 -1
- package/build/components/editor/code/index.d.ts +0 -1
- package/build/components/editor/code/index.js +0 -1
- package/build/components/editor/code/minimap.d.ts +2 -1
- package/build/components/editor/code/minimap.js +5 -2
- package/build/components/editor/code/view.d.ts +3 -1
- package/build/components/editor/code/view.js +37 -26
- package/build/components/editor/diffs/index.d.ts +0 -1
- package/build/components/editor/diffs/index.js +0 -1
- package/build/components/editor/diffs/merge.js +7 -3
- package/build/components/editor/diffs/view.js +3 -1
- package/build/components/editor/index.d.ts +4 -1
- package/build/components/editor/index.js +2 -1
- package/build/components/editor/markdown/editing.js +22 -3
- package/build/components/editor/markdown/erase.d.ts +9 -0
- package/build/components/editor/markdown/erase.js +78 -0
- package/build/components/editor/markdown/index.d.ts +0 -1
- package/build/components/editor/markdown/index.js +0 -1
- package/build/components/editor/markdown/layout.d.ts +2 -9
- package/build/components/editor/markdown/layout.js +2 -7
- package/build/components/editor/markdown/render.d.ts +0 -1
- package/build/components/editor/markdown/render.js +287 -235
- package/build/components/editor/markdown/view.js +566 -667
- package/build/components/editor/viewer/index.d.ts +27 -0
- package/build/components/editor/viewer/index.js +250 -0
- package/build/components/editor/viewer/model.d.ts +15 -0
- package/build/components/editor/viewer/model.js +73 -0
- package/build/components/editor/workspace/index.d.ts +6 -2
- package/build/components/editor/workspace/index.js +243 -137
- package/build/components/editor/workspace/keybindings.d.ts +37 -0
- package/build/components/editor/workspace/keybindings.js +288 -0
- package/build/components/editor/workspace/model.d.ts +55 -2
- package/build/components/editor/workspace/model.js +141 -3
- package/build/components/editor/workspace/navigate.d.ts +19 -0
- package/build/components/editor/workspace/navigate.js +118 -0
- package/build/components/editor/workspace/session.d.ts +29 -0
- package/build/components/editor/workspace/session.js +373 -0
- package/build/components/editor/workspace/shortcuts.d.ts +19 -0
- package/build/components/editor/workspace/shortcuts.js +185 -0
- package/build/components/editor/workspace/status.d.ts +34 -0
- package/build/components/editor/workspace/status.js +193 -0
- package/build/components/editor/workspace/statusbar.d.ts +15 -0
- package/build/components/editor/workspace/statusbar.js +190 -0
- package/build/components/editor/workspace/strip.d.ts +27 -0
- package/build/components/editor/workspace/strip.js +239 -0
- package/build/components/editor/workspace/tabs.d.ts +15 -0
- package/build/components/editor/workspace/tabs.js +63 -0
- package/build/components/error/index.js +1 -1
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/filter/index.js +5 -3
- package/build/components/filter/scss/index.scss +1 -1
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/heatmap/index.js +3 -3
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +2 -0
- package/build/components/index.js +2 -0
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/loading/scss/index.scss +1 -1
- package/build/components/marquee/scss/index.scss +1 -1
- 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/tree.d.ts +3 -1
- package/build/components/nav/tree.js +30 -60
- 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/arrows.d.ts +15 -0
- package/build/components/pagination/arrows.js +65 -0
- package/build/components/pagination/cards.d.ts +23 -0
- package/build/components/pagination/cards.js +66 -0
- package/build/components/pagination/index.d.ts +5 -0
- package/build/components/pagination/index.js +3 -1
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/pull-to-refresh/scss/index.scss +1 -1
- package/build/components/range/index.js +1 -1
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/section/scss/index.scss +2 -0
- package/build/components/select/index.d.ts +1 -0
- package/build/components/select/index.js +16 -11
- package/build/components/select/scss/index.scss +1 -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/index.js +3 -3
- package/build/components/sticky-header/scss/index.scss +1 -1
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/text/scss/index.scss +1 -1
- package/build/components/textarea/scss/index.scss +1 -1
- package/build/{css-utilities → components}/theme/index.d.ts +1 -1
- package/build/{css-utilities → components}/theme/index.js +15 -5
- package/build/components/theme/scss/index.scss +2 -0
- package/build/components/theme-picker/index.d.ts +52 -0
- package/build/components/theme-picker/index.js +167 -0
- package/build/components/theme-picker/scss/index.scss +2 -0
- package/build/components/toast/index.js +3 -5
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/tooltip/menu.js +3 -1
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/scss/index.scss +1 -1
- package/build/{css-utilities → modifiers}/glass/index.d.ts +2 -2
- package/build/modifiers/glass/index.js +28 -0
- package/build/modifiers/glass/scss/index.scss +2 -0
- package/build/{css-utilities → modifiers}/index.d.ts +0 -1
- package/build/{css-utilities → modifiers}/index.js +0 -1
- package/build/modifiers/scrollbar/index.d.ts +72 -0
- package/build/{css-utilities → modifiers}/scrollbar/index.js +52 -19
- package/build/modifiers/scrollbar/scss/index.scss +2 -0
- package/build/normalize/scss/index.scss +1 -2
- package/layer.scss +1 -1
- package/package.json +11 -18
- package/scripts/code-editor-markdown.test.mjs +45 -14
- package/scripts/code-viewer.test.mjs +69 -0
- package/scripts/workspace-keybindings.test.mjs +273 -0
- package/scripts/workspace-session.test.mjs +349 -0
- package/scripts/workspace-status.test.mjs +229 -0
- package/scripts/workspace-tabs.test.mjs +142 -0
- package/src/components/accordion/group.ts +39 -0
- package/src/components/accordion/index.ts +32 -6
- package/src/components/accordion/scss/index.scss +12 -21
- package/src/components/accordion/scss/variables.scss +18 -3
- package/src/components/announcement/scss/index.scss +4 -4
- package/src/components/announcement/scss/variables.scss +6 -6
- package/src/components/banner/scss/index.scss +1 -1
- package/src/components/breadcrumb/scss/index.scss +35 -50
- package/src/components/breadcrumb/scss/variables.scss +23 -31
- package/src/components/button/scss/_fan.scss +39 -43
- package/src/components/button/scss/_morph.scss +66 -78
- package/src/components/button/scss/_sidebar.scss +41 -30
- package/src/components/button/scss/_split.scss +9 -9
- package/src/components/button/scss/index.scss +23 -19
- package/src/components/button/scss/variables.scss +94 -90
- package/src/components/button/sidebar.ts +36 -24
- package/src/components/capslock/index.ts +2 -2
- package/src/components/capslock/scss/index.scss +11 -6
- package/src/components/capslock/scss/variables.scss +3 -5
- package/src/components/card/scss/_expand.scss +58 -64
- package/src/components/card/scss/index.scss +40 -21
- package/src/components/card/scss/variables.scss +40 -31
- package/src/components/cc/scss/index.scss +68 -68
- package/src/components/cc/scss/variables.scss +13 -14
- package/src/components/chat-minimap/scss/index.scss +24 -16
- package/src/components/chat-minimap/scss/variables.scss +37 -37
- package/src/components/checkbox/scss/index.scss +54 -52
- package/src/components/checkbox/scss/variables.scss +37 -39
- package/src/components/color-picker/index.ts +157 -120
- package/src/components/color-picker/scss/index.scss +159 -96
- package/src/components/color-picker/scss/variables.scss +33 -15
- package/src/components/command/index.ts +3 -2
- package/src/components/command/scss/index.scss +10 -14
- package/src/components/command/scss/variables.scss +12 -35
- package/src/components/copy/scss/index.scss +6 -6
- package/src/components/copy/scss/variables.scss +12 -15
- package/src/components/counter/scss/index.scss +14 -14
- package/src/components/counter/scss/variables.scss +1 -1
- package/src/components/datalist/index.ts +3 -3
- package/src/components/datalist/scss/index.scss +7 -6
- package/src/components/datalist/scss/variables.scss +7 -3
- package/src/components/dock/scss/index.scss +10 -15
- package/src/components/dock/scss/variables.scss +29 -25
- package/src/components/editor/code/index.ts +0 -1
- package/src/components/editor/code/minimap.ts +13 -5
- package/src/components/editor/code/scss/_editor.scss +83 -81
- package/src/components/editor/code/scss/_features.scss +106 -97
- package/src/components/editor/code/scss/_services.scss +27 -25
- package/src/components/editor/code/scss/index.scss +0 -1
- package/src/components/editor/code/scss/variables.scss +30 -26
- package/src/components/editor/code/view.ts +14 -5
- package/src/components/editor/diffs/index.ts +0 -1
- package/src/components/editor/diffs/merge.ts +2 -1
- package/src/components/editor/diffs/scss/_diffs.scss +67 -57
- package/src/components/editor/diffs/scss/_merge.scss +17 -14
- package/src/components/editor/diffs/scss/index.scss +0 -1
- package/src/components/editor/diffs/scss/variables.scss +25 -18
- package/src/components/editor/diffs/view.ts +2 -1
- package/src/components/editor/index.ts +7 -1
- package/src/components/editor/markdown/editing.ts +38 -3
- package/src/components/editor/markdown/erase.ts +124 -0
- package/src/components/editor/markdown/index.ts +0 -1
- package/src/components/editor/markdown/layout.ts +3 -12
- package/src/components/editor/markdown/render.ts +65 -37
- package/src/components/editor/markdown/scss/index.scss +92 -124
- package/src/components/editor/markdown/scss/variables.scss +39 -19
- package/src/components/editor/markdown/view.ts +737 -786
- package/src/components/editor/tree/scss/index.scss +121 -110
- package/src/components/editor/tree/scss/variables.scss +48 -54
- package/src/components/editor/viewer/index.ts +321 -0
- package/src/components/editor/viewer/model.ts +130 -0
- package/src/components/editor/viewer/scss/_viewer.scss +302 -0
- package/src/components/editor/viewer/scss/index.scss +2 -0
- package/src/components/editor/viewer/scss/variables.scss +69 -0
- package/src/components/editor/workspace/index.ts +159 -31
- package/src/components/editor/workspace/keybindings.ts +447 -0
- package/src/components/editor/workspace/model.ts +233 -3
- package/src/components/editor/workspace/navigate.ts +194 -0
- package/src/components/editor/workspace/scss/index.scss +72 -59
- package/src/components/editor/workspace/scss/keybindings.scss +190 -0
- package/src/components/editor/workspace/scss/status.scss +122 -0
- package/src/components/editor/workspace/scss/tabs.scss +56 -0
- package/src/components/editor/workspace/session.ts +551 -0
- package/src/components/editor/workspace/shortcuts.ts +255 -0
- package/src/components/editor/workspace/status.ts +259 -0
- package/src/components/editor/workspace/statusbar.ts +255 -0
- package/src/components/editor/workspace/strip.ts +273 -0
- package/src/components/editor/workspace/tabs.ts +106 -0
- package/src/components/error/index.ts +1 -1
- package/src/components/error/scss/index.scss +19 -19
- package/src/components/error/scss/variables.scss +2 -2
- package/src/components/filter/index.ts +7 -2
- package/src/components/filter/scss/index.scss +1 -1
- package/src/components/filter/scss/variables.scss +11 -10
- package/src/components/frame/scss/index.scss +12 -12
- package/src/components/frame/scss/variables.scss +8 -8
- package/src/components/heatmap/index.ts +3 -3
- package/src/components/heatmap/scss/index.scss +28 -26
- package/src/components/heatmap/scss/variables.scss +18 -17
- package/src/components/highlight/scss/index.scss +17 -13
- package/src/components/highlight/scss/variables.scss +8 -10
- package/src/components/icon/scss/index.scss +10 -0
- package/src/components/icon/scss/variables.scss +5 -0
- package/src/components/image/scss/index.scss +9 -9
- package/src/components/image/scss/variables.scss +7 -2
- package/src/components/index.ts +2 -0
- package/src/components/inline-edit/scss/index.scss +99 -104
- package/src/components/inline-edit/scss/variables.scss +40 -39
- package/src/components/input/scss/_field.scss +6 -20
- package/src/components/input/scss/_scrub.scss +10 -8
- package/src/components/input/scss/_tag.scss +35 -37
- package/src/components/input/scss/variables.scss +100 -99
- package/src/components/link/scss/index.scss +4 -1
- package/src/components/loading/scss/index.scss +1 -1
- package/src/components/loading/scss/variables.scss +1 -1
- package/src/components/marquee/scss/index.scss +9 -5
- package/src/components/marquee/scss/variables.scss +3 -1
- package/src/components/metric/scss/_flash.scss +3 -1
- package/src/components/metric/scss/index.scss +8 -6
- package/src/components/metric/scss/variables.scss +26 -20
- package/src/components/nav/index.ts +1 -1
- package/src/components/nav/scss/index.scss +12 -40
- package/src/components/nav/scss/variables.scss +30 -11
- package/src/components/nav/tree.ts +19 -62
- package/src/components/notification/scss/index.scss +7 -7
- package/src/components/notification/scss/variables.scss +7 -9
- package/src/components/overlay/scss/index.scss +181 -170
- package/src/components/overlay/scss/variables.scss +26 -57
- package/src/components/page/scss/index.scss +12 -11
- package/src/components/page/scss/variables.scss +5 -0
- package/src/components/pagination/arrows.ts +58 -0
- package/src/components/pagination/cards.ts +57 -0
- package/src/components/pagination/index.ts +4 -1
- package/src/components/pagination/scss/_arrows.scss +69 -0
- package/src/components/pagination/scss/_cards.scss +121 -0
- package/src/components/pagination/scss/_dots.scss +2 -5
- package/src/components/pagination/scss/index.scss +8 -6
- package/src/components/pagination/scss/variables.scss +87 -37
- package/src/components/progress/scss/_text.scss +21 -18
- package/src/components/progress/scss/index.scss +1 -1
- package/src/components/progress/scss/variables.scss +12 -12
- package/src/components/pull-to-refresh/scss/index.scss +2 -1
- package/src/components/pull-to-refresh/scss/variables.scss +11 -6
- package/src/components/range/index.ts +1 -1
- package/src/components/range/scss/_filter.scss +62 -51
- package/src/components/range/scss/_slider.scss +78 -75
- package/src/components/range/scss/_vertical.scss +6 -6
- package/src/components/range/scss/index.scss +3 -2
- package/src/components/range/scss/variables.scss +26 -23
- package/src/components/relative-time/scss/index.scss +27 -27
- package/src/components/relative-time/scss/variables.scss +10 -12
- package/src/components/root/scss/index.scss +71 -43
- package/src/components/root/scss/variables.scss +35 -31
- package/src/components/section/scss/index.scss +31 -0
- package/src/components/section/scss/variables.scss +21 -0
- package/src/components/select/index.ts +11 -6
- package/src/components/select/scss/index.scss +21 -32
- package/src/components/select/scss/variables.scss +25 -18
- package/src/components/shortcut-recorder/scss/index.scss +13 -12
- package/src/components/shortcut-recorder/scss/variables.scss +12 -13
- package/src/components/sortable/scss/index.scss +47 -44
- package/src/components/sortable/scss/variables.scss +4 -5
- package/src/components/sticky-header/index.ts +4 -4
- package/src/components/sticky-header/scss/index.scss +14 -13
- package/src/components/sticky-header/scss/variables.scss +9 -9
- package/src/components/story/scss/index.scss +26 -30
- package/src/components/story/scss/variables.scss +16 -9
- package/src/components/surface-field/scss/index.scss +45 -40
- package/src/components/surface-field/scss/variables.scss +5 -6
- package/src/components/tasklist/scss/index.scss +19 -19
- package/src/components/tasklist/scss/variables.scss +26 -29
- package/src/components/text/scss/index.scss +2 -1
- package/src/components/textarea/scss/variables.scss +1 -1
- package/src/{css-utilities → components}/theme/index.ts +17 -3
- package/src/components/theme/scss/index.scss +1 -0
- package/src/components/theme/scss/variables.scss +78 -0
- package/src/components/theme-picker/index.ts +231 -0
- package/src/components/theme-picker/scss/index.scss +264 -0
- package/src/components/toast/index.ts +28 -30
- package/src/components/toast/scss/index.scss +87 -87
- package/src/components/toast/scss/variables.scss +39 -39
- package/src/components/tooltip/menu.ts +4 -1
- package/src/components/tooltip/scss/_east.scss +10 -10
- package/src/components/tooltip/scss/_menu.scss +284 -269
- package/src/components/tooltip/scss/_north.scss +10 -10
- package/src/components/tooltip/scss/_shared.scss +7 -7
- package/src/components/tooltip/scss/_south.scss +10 -10
- package/src/components/tooltip/scss/_west.scss +10 -10
- package/src/components/tooltip/scss/index.scss +21 -20
- package/src/components/tooltip/scss/variables.scss +104 -96
- package/src/components/typewriter/scss/_retype.scss +12 -11
- package/src/components/typewriter/scss/_rotate.scss +2 -1
- package/src/components/typewriter/scss/variables.scss +41 -39
- package/src/components/uptime/scss/index.scss +15 -15
- package/src/components/uptime/scss/variables.scss +8 -8
- package/src/components/usage-meter/scss/index.scss +3 -1
- package/src/components/usage-meter/scss/variables.scss +5 -5
- package/src/css-utilities/absolute.scss +64 -0
- package/src/css-utilities/background.scss +43 -0
- package/src/css-utilities/border.scss +45 -0
- package/src/css-utilities/box-shadow.scss +29 -0
- package/src/css-utilities/color.scss +41 -0
- package/src/css-utilities/flex.scss +64 -0
- package/src/css-utilities/font/geist/{scss/index.scss → index.scss} +12 -4
- package/src/css-utilities/font/montserrat/Montserrat-Italic-Variable.woff2 +0 -0
- package/src/css-utilities/font/montserrat/Montserrat-Variable.woff2 +0 -0
- package/src/css-utilities/font/montserrat/OFL.txt +93 -0
- package/src/css-utilities/font/montserrat/index.scss +38 -0
- package/src/{shared/scss → css-utilities}/icon.scss +1 -1
- package/src/css-utilities/{inline/scss/index.scss → inline.scss} +1 -1
- package/src/css-utilities/{skeleton/scss/index.scss → skeleton.scss} +11 -11
- package/src/css-utilities/surface.scss +266 -0
- package/src/css-utilities/text.scss +191 -0
- package/src/modifiers/glass/index.ts +44 -0
- package/src/{css-utilities → modifiers}/glass/scss/index.scss +6 -6
- package/src/{css-utilities → modifiers}/glass/scss/variables.scss +1 -1
- package/src/{css-utilities → modifiers}/index.ts +0 -1
- package/src/{css-utilities → modifiers}/scrollbar/index.ts +92 -17
- package/src/{css-utilities → modifiers}/scrollbar/scss/index.scss +178 -177
- package/src/{css-utilities → modifiers}/scrollbar/scss/variables.scss +28 -21
- package/src/normalize/scss/index.scss +4 -2
- package/src/shared/scss/color-weights.scss +19 -0
- package/src/shared/scss/index.scss +1 -12
- package/src/tokens/scss/blur.scss +5 -0
- package/src/tokens/scss/color.scss +74 -50
- package/src/tokens/scss/index.scss +1 -2
- package/src/tokens/scss/size.scss +0 -2
- package/src/tokens/scss/state.scss +3 -2
- package/src/tokens/scss/transition.scss +19 -2
- package/storage/svg/monitor.svg +1 -0
- package/storage/svg/moon.svg +1 -0
- package/storage/svg/pin.svg +1 -0
- package/storage/svg/sun.svg +1 -0
- package/vite.config.ts +33 -8
- package/build/css-utilities/background/scss/index.scss +0 -2
- package/build/css-utilities/border/scss/index.scss +0 -2
- package/build/css-utilities/color/scss/index.scss +0 -2
- package/build/css-utilities/flex/scss/index.scss +0 -2
- package/build/css-utilities/font/geist/index.d.ts +0 -1
- package/build/css-utilities/font/geist/index.js +0 -1
- package/build/css-utilities/font/geist/scss/index.scss +0 -2
- package/build/css-utilities/font/montserrat/index.d.ts +0 -1
- package/build/css-utilities/font/montserrat/index.js +0 -1
- package/build/css-utilities/font/montserrat/scss/Montserrat-Bold.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Bold.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-BoldItalic.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-BoldItalic.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Italic.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Italic.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Medium.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Medium.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-MediumItalic.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-MediumItalic.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Regular.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Regular.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-SemiBold.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-SemiBold.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-SemiBoldItalic.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-SemiBoldItalic.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/index.scss +0 -2
- package/build/css-utilities/glass/index.js +0 -26
- package/build/css-utilities/glass/scss/index.scss +0 -2
- package/build/css-utilities/index.scss +0 -2
- package/build/css-utilities/inline/scss/index.scss +0 -2
- package/build/css-utilities/scrollbar/index.d.ts +0 -42
- package/build/css-utilities/scrollbar/scss/index.scss +0 -2
- package/build/css-utilities/skeleton/scss/index.scss +0 -2
- package/build/css-utilities/text/scss/index.scss +0 -2
- package/build/themes/dark/index.d.ts +0 -3
- package/build/themes/dark/index.js +0 -3
- package/build/themes/dark/input.d.ts +0 -3
- package/build/themes/dark/input.js +0 -12
- package/build/themes/dark/select.d.ts +0 -3
- package/build/themes/dark/select.js +0 -23
- package/build/themes/dark/textarea.d.ts +0 -2186
- package/build/themes/dark/textarea.js +0 -11
- package/src/css-utilities/background/scss/index.scss +0 -1
- package/src/css-utilities/background/scss/variables.scss +0 -18
- package/src/css-utilities/border/scss/index.scss +0 -1
- package/src/css-utilities/border/scss/variables.scss +0 -23
- package/src/css-utilities/color/scss/index.scss +0 -1
- package/src/css-utilities/color/scss/variables.scss +0 -17
- package/src/css-utilities/flex/scss/index.scss +0 -57
- package/src/css-utilities/flex/scss/variables.scss +0 -16
- package/src/css-utilities/font/geist/index.ts +0 -1
- package/src/css-utilities/font/montserrat/index.ts +0 -1
- package/src/css-utilities/font/montserrat/scss/Montserrat-Bold.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Bold.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-BoldItalic.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-BoldItalic.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Italic.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Italic.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Medium.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Medium.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-MediumItalic.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-MediumItalic.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Regular.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Regular.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-SemiBold.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-SemiBold.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-SemiBoldItalic.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-SemiBoldItalic.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/index.scss +0 -94
- package/src/css-utilities/glass/index.ts +0 -42
- package/src/css-utilities/index.scss +0 -13
- package/src/css-utilities/skeleton/scss/variables.scss +0 -3
- package/src/css-utilities/text/scss/index.scss +0 -152
- package/src/css-utilities/text/scss/variables.scss +0 -22
- package/src/shared/scss/absolute.scss +0 -28
- package/src/shared/scss/background.scss +0 -21
- package/src/shared/scss/border.scss +0 -21
- package/src/shared/scss/color.scss +0 -21
- package/src/shared/scss/position.scss +0 -55
- package/src/shared/scss/text.scss +0 -31
- package/src/themes/dark/index.ts +0 -3
- package/src/themes/dark/input.ts +0 -16
- package/src/themes/dark/select.ts +0 -28
- package/src/themes/dark/textarea.ts +0 -13
- package/src/tokens/scss/box-shadow.scss +0 -23
- package/src/tokens/scss/font-family.scss +0 -5
- package/storage/code.md +0 -180
- package/storage/editor-features.md +0 -227
- package/build/css-utilities/font/geist/{scss/Geist-Italic-Variable.woff2 → Geist-Italic-Variable.woff2} +0 -0
- package/build/css-utilities/font/geist/{scss/Geist-Variable.woff2 → Geist-Variable.woff2} +0 -0
- package/build/css-utilities/font/geist/{scss/GeistMono-Italic-Variable.woff2 → GeistMono-Italic-Variable.woff2} +0 -0
- package/build/css-utilities/font/geist/{scss/GeistMono-Variable.woff2 → GeistMono-Variable.woff2} +0 -0
- package/src/{shared/scss → css-utilities}/anchor.scss +6 -6
- package/src/{shared/scss → css-utilities}/drag.scss +0 -0
- package/src/css-utilities/font/geist/{scss/Geist-Italic-Variable.woff2 → Geist-Italic-Variable.woff2} +0 -0
- package/src/css-utilities/font/geist/{scss/Geist-Variable.woff2 → Geist-Variable.woff2} +0 -0
- package/src/css-utilities/font/geist/{scss/GeistMono-Italic-Variable.woff2 → GeistMono-Italic-Variable.woff2} +0 -0
- package/src/css-utilities/font/geist/{scss/GeistMono-Variable.woff2 → GeistMono-Variable.woff2} +0 -0
- package/src/{shared/scss → css-utilities}/hidden.scss +11 -11
- /package/src/{shared/scss → css-utilities}/layer.scss +0 -0
- /package/src/{shared/scss → css-utilities}/reset.scss +0 -0
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { EditorDocument } from '../code/document.js';
|
|
2
|
+
import { sanitize } from './keybindings.js';
|
|
3
|
+
import { closable, compareKey, compareTab, order, place } from './tabs.js';
|
|
4
|
+
const AUTO_SAVE_DELAY_MAX = 60_000;
|
|
5
|
+
const AUTO_SAVE_DELAY_MIN = 100;
|
|
2
6
|
const DEFAULTS = {
|
|
7
|
+
autoSave: 'off',
|
|
8
|
+
autoSaveDelay: 1000,
|
|
3
9
|
explorerOpen: true,
|
|
4
10
|
explorerSide: 'right',
|
|
11
|
+
keybindings: {},
|
|
5
12
|
showWhitespace: false,
|
|
6
13
|
wrapText: false
|
|
7
14
|
};
|
|
@@ -64,6 +71,7 @@ class EditorWorkspaceModel {
|
|
|
64
71
|
tabId = 0;
|
|
65
72
|
tabs = [];
|
|
66
73
|
unwatch;
|
|
74
|
+
watchers = new Set();
|
|
67
75
|
watchWork = Promise.resolve();
|
|
68
76
|
constructor(host, cwd = '', preferences = {}) {
|
|
69
77
|
this.cwd = cwd;
|
|
@@ -71,6 +79,12 @@ class EditorWorkspaceModel {
|
|
|
71
79
|
this.applyPreferences(preferences);
|
|
72
80
|
}
|
|
73
81
|
applyPreferences(preferences) {
|
|
82
|
+
if (preferences.autoSave === 'delay' || preferences.autoSave === 'focus' || preferences.autoSave === 'off') {
|
|
83
|
+
this.preferences.autoSave = preferences.autoSave;
|
|
84
|
+
}
|
|
85
|
+
if (typeof preferences.autoSaveDelay === 'number' && Number.isFinite(preferences.autoSaveDelay)) {
|
|
86
|
+
this.preferences.autoSaveDelay = Math.min(Math.max(Math.round(preferences.autoSaveDelay), AUTO_SAVE_DELAY_MIN), AUTO_SAVE_DELAY_MAX);
|
|
87
|
+
}
|
|
74
88
|
for (let key of ['explorerOpen', 'showWhitespace', 'wrapText']) {
|
|
75
89
|
if (typeof preferences[key] === 'boolean') {
|
|
76
90
|
this.preferences[key] = preferences[key];
|
|
@@ -79,6 +93,9 @@ class EditorWorkspaceModel {
|
|
|
79
93
|
if (preferences.explorerSide === 'left' || preferences.explorerSide === 'right') {
|
|
80
94
|
this.preferences.explorerSide = preferences.explorerSide;
|
|
81
95
|
}
|
|
96
|
+
if (preferences.keybindings !== undefined) {
|
|
97
|
+
this.preferences.keybindings = sanitize(preferences.keybindings);
|
|
98
|
+
}
|
|
82
99
|
}
|
|
83
100
|
async authorize(kind, tabs, paths) {
|
|
84
101
|
let changed = tabs.filter(dirty), revisions = new Map(tabs.map((tab) => [tab.id, tab.document.state.revision]));
|
|
@@ -117,6 +134,23 @@ class EditorWorkspaceModel {
|
|
|
117
134
|
}
|
|
118
135
|
return revisions;
|
|
119
136
|
}
|
|
137
|
+
async closeTabs(tabs) {
|
|
138
|
+
if (!tabs.length) {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
let paths = tabs.map((tab) => tab.path);
|
|
142
|
+
for (let path of paths) {
|
|
143
|
+
this.closed.set(path, (this.closed.get(path) ?? 0) + 1);
|
|
144
|
+
}
|
|
145
|
+
if (!(await this.authorize('close', tabs, paths))) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
for (let tab of tabs) {
|
|
149
|
+
this.removeTab(tab);
|
|
150
|
+
}
|
|
151
|
+
this.emit();
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
120
154
|
desire(before, after) {
|
|
121
155
|
for (let entry of before) {
|
|
122
156
|
this.overlay.set(entry.path, null);
|
|
@@ -215,6 +249,32 @@ class EditorWorkspaceModel {
|
|
|
215
249
|
this.active = found.id;
|
|
216
250
|
this.emit();
|
|
217
251
|
}
|
|
252
|
+
adopt(path, content, saved, missing = false) {
|
|
253
|
+
if (this.disposed || this.opening.has(path) || this.tabs.some((tab) => tab.path === path)) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
let tab = {
|
|
257
|
+
document: new EditorDocument(content),
|
|
258
|
+
id: ++this.tabId,
|
|
259
|
+
missing,
|
|
260
|
+
path,
|
|
261
|
+
pinned: false,
|
|
262
|
+
preview: false,
|
|
263
|
+
saved,
|
|
264
|
+
scroll: { left: 0, top: 0 }
|
|
265
|
+
};
|
|
266
|
+
this.tabs.push(tab);
|
|
267
|
+
this.documents.set(tab.id, tab.document.subscribe((_, change) => {
|
|
268
|
+
if (change.textChanged && dirty(tab) !== this.dirty.get(tab.id)) {
|
|
269
|
+
if (dirty(tab)) {
|
|
270
|
+
tab.preview = false;
|
|
271
|
+
}
|
|
272
|
+
this.emit();
|
|
273
|
+
}
|
|
274
|
+
}));
|
|
275
|
+
this.emit();
|
|
276
|
+
return tab;
|
|
277
|
+
}
|
|
218
278
|
async close(path = this.state.active?.path) {
|
|
219
279
|
if (!path) {
|
|
220
280
|
return false;
|
|
@@ -231,6 +291,48 @@ class EditorWorkspaceModel {
|
|
|
231
291
|
this.emit();
|
|
232
292
|
return true;
|
|
233
293
|
}
|
|
294
|
+
closeOthers(path = this.state.active?.path) {
|
|
295
|
+
return this.closeTabs(closable(this.tabs, 'others', path));
|
|
296
|
+
}
|
|
297
|
+
closeRight(path = this.state.active?.path) {
|
|
298
|
+
return this.closeTabs(closable(this.tabs, 'right', path));
|
|
299
|
+
}
|
|
300
|
+
closeSaved() {
|
|
301
|
+
return this.closeTabs(closable(this.tabs, 'saved'));
|
|
302
|
+
}
|
|
303
|
+
async compare(original, modified) {
|
|
304
|
+
let paths;
|
|
305
|
+
try {
|
|
306
|
+
paths = [workspacePath(original, this.cwd), workspacePath(modified, this.cwd)];
|
|
307
|
+
}
|
|
308
|
+
catch (error) {
|
|
309
|
+
this.status(`Compare failed: ${message(error)}`, true);
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
let cwd = this.cwd, epoch = this.epoch, key = compareKey(paths[0], paths[1]), tab = this.tabs.find((tab) => tab.path === key);
|
|
313
|
+
if (!tab) {
|
|
314
|
+
let texts;
|
|
315
|
+
try {
|
|
316
|
+
texts = await Promise.all([this.host.read(cwd, paths[0]), this.host.read(cwd, paths[1])]);
|
|
317
|
+
}
|
|
318
|
+
catch (error) {
|
|
319
|
+
if (epoch === this.epoch) {
|
|
320
|
+
this.status(`Compare failed: ${message(error)}`, true);
|
|
321
|
+
}
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (epoch !== this.epoch || this.disposed) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
tab = this.tabs.find((tab) => tab.path === key);
|
|
328
|
+
if (!tab) {
|
|
329
|
+
tab = compareTab(++this.tabId, { modified: texts[1], original: texts[0], paths });
|
|
330
|
+
this.tabs.push(tab);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
this.activate(tab);
|
|
334
|
+
return tab;
|
|
335
|
+
}
|
|
234
336
|
async copyPath(path) {
|
|
235
337
|
try {
|
|
236
338
|
await this.host.copyPath(this.cwd, workspacePath(path, this.cwd));
|
|
@@ -293,7 +395,13 @@ class EditorWorkspaceModel {
|
|
|
293
395
|
this.documents.clear();
|
|
294
396
|
this.listeners.clear();
|
|
295
397
|
}
|
|
296
|
-
|
|
398
|
+
onWatch(listener) {
|
|
399
|
+
this.watchers.add(listener);
|
|
400
|
+
return () => {
|
|
401
|
+
this.watchers.delete(listener);
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
async open(value, line, column = 1, preview = false) {
|
|
297
405
|
if (this.disposed) {
|
|
298
406
|
return;
|
|
299
407
|
}
|
|
@@ -321,12 +429,20 @@ class EditorWorkspaceModel {
|
|
|
321
429
|
id: ++this.tabId,
|
|
322
430
|
missing: false,
|
|
323
431
|
path,
|
|
432
|
+
pinned: false,
|
|
433
|
+
preview,
|
|
324
434
|
saved: content,
|
|
325
435
|
scroll: { left: 0, top: 0 }
|
|
326
436
|
};
|
|
327
|
-
this.tabs
|
|
437
|
+
let replaced = place(this.tabs, tab);
|
|
438
|
+
if (replaced) {
|
|
439
|
+
this.removeTab(replaced);
|
|
440
|
+
}
|
|
328
441
|
this.documents.set(tab.id, tab.document.subscribe((_, change) => {
|
|
329
442
|
if (change.textChanged && dirty(tab) !== this.dirty.get(tab.id)) {
|
|
443
|
+
if (dirty(tab)) {
|
|
444
|
+
tab.preview = false;
|
|
445
|
+
}
|
|
330
446
|
this.emit();
|
|
331
447
|
}
|
|
332
448
|
}));
|
|
@@ -351,6 +467,9 @@ class EditorWorkspaceModel {
|
|
|
351
467
|
if (!tab || epoch !== this.epoch || !this.tabs.includes(tab)) {
|
|
352
468
|
return;
|
|
353
469
|
}
|
|
470
|
+
if (!preview) {
|
|
471
|
+
tab.preview = false;
|
|
472
|
+
}
|
|
354
473
|
if (intent === this.openIntent) {
|
|
355
474
|
this.active = tab.id;
|
|
356
475
|
if (line !== undefined) {
|
|
@@ -371,6 +490,16 @@ class EditorWorkspaceModel {
|
|
|
371
490
|
this.lastTarget = target.requestId;
|
|
372
491
|
return this.open(target.path, target.line, target.column);
|
|
373
492
|
}
|
|
493
|
+
pin(path, pinned = true) {
|
|
494
|
+
let tab = this.tabs.find((tab) => tab.path === path);
|
|
495
|
+
if (!tab || tab.pinned === pinned) {
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
tab.pinned = pinned;
|
|
499
|
+
tab.preview = false;
|
|
500
|
+
order(this.tabs);
|
|
501
|
+
this.emit();
|
|
502
|
+
}
|
|
374
503
|
async refresh(_paths) {
|
|
375
504
|
if (this.disposed || !this.cwd) {
|
|
376
505
|
return;
|
|
@@ -409,6 +538,9 @@ class EditorWorkspaceModel {
|
|
|
409
538
|
if (epoch !== this.epoch || intent !== this.refreshIntent || mutation !== this.mutation) {
|
|
410
539
|
return;
|
|
411
540
|
}
|
|
541
|
+
if (tab.compare) {
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
412
544
|
tab.missing = !entries.has(tab.path);
|
|
413
545
|
if (dirty(tab) || tab.missing) {
|
|
414
546
|
this.emit();
|
|
@@ -496,7 +628,7 @@ class EditorWorkspaceModel {
|
|
|
496
628
|
}
|
|
497
629
|
save(tab = this.state.active) {
|
|
498
630
|
return this.queue('Save', async () => {
|
|
499
|
-
if (!tab || !this.tabs.includes(tab)) {
|
|
631
|
+
if (!tab || !this.tabs.includes(tab) || tab.compare) {
|
|
500
632
|
return false;
|
|
501
633
|
}
|
|
502
634
|
if (!dirty(tab) && !tab.missing) {
|
|
@@ -607,6 +739,9 @@ class EditorWorkspaceModel {
|
|
|
607
739
|
let stop = await this.host.watch(this.cwd, (event) => {
|
|
608
740
|
if (epoch === this.epoch) {
|
|
609
741
|
this.watchWork = this.refresh(event.paths);
|
|
742
|
+
for (let watcher of [...this.watchers]) {
|
|
743
|
+
watcher(event);
|
|
744
|
+
}
|
|
610
745
|
}
|
|
611
746
|
});
|
|
612
747
|
if (epoch !== this.epoch) {
|
|
@@ -675,6 +810,9 @@ class EditorWorkspaceModel {
|
|
|
675
810
|
return true;
|
|
676
811
|
});
|
|
677
812
|
}
|
|
813
|
+
unpin(path) {
|
|
814
|
+
this.pin(path, false);
|
|
815
|
+
}
|
|
678
816
|
async whenIdle() {
|
|
679
817
|
for (;;) {
|
|
680
818
|
let operations = this.operations, preferences = this.preferenceWrite, watch = this.watchWork;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Command } from '../code/keymap.js';
|
|
2
|
+
import type { CodeController } from '../code/view.js';
|
|
3
|
+
import type { FileTreeController, FileTreeJump } from '../tree/index.js';
|
|
4
|
+
import type { EditorWorkspaceModel } from './model.js';
|
|
5
|
+
import type hosted from './session.js';
|
|
6
|
+
type Options = {
|
|
7
|
+
bindings: () => Readonly<Record<string, Command | null>> | undefined;
|
|
8
|
+
hosting: ReturnType<typeof hosted>;
|
|
9
|
+
model: EditorWorkspaceModel;
|
|
10
|
+
tree: () => FileTreeController | undefined;
|
|
11
|
+
};
|
|
12
|
+
type Step = 'moved' | 'none' | 'wrapped';
|
|
13
|
+
declare function step(controller: CodeController, kind: FileTreeJump, backward: boolean): Step;
|
|
14
|
+
declare const navigate: ({ bindings, hosting, model, tree }: Options) => {
|
|
15
|
+
connect(element: HTMLElement): () => void;
|
|
16
|
+
go: (kind: FileTreeJump, backward?: boolean) => Promise<boolean>;
|
|
17
|
+
};
|
|
18
|
+
export default navigate;
|
|
19
|
+
export { step };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { effect, root } from '@esportsplus/reactivity';
|
|
2
|
+
import { mac } from '../../../shared/platform.js';
|
|
3
|
+
import { keymap } from '../code/keymap.js';
|
|
4
|
+
const COMMANDS = {
|
|
5
|
+
nextChange: ['change', false],
|
|
6
|
+
nextProblem: ['problem', false],
|
|
7
|
+
previousChange: ['change', true],
|
|
8
|
+
previousProblem: ['problem', true]
|
|
9
|
+
};
|
|
10
|
+
const PROBLEMS_WAIT = 1500;
|
|
11
|
+
function caret(selection) {
|
|
12
|
+
return selection.direction === 'backward' ? selection.start : selection.end;
|
|
13
|
+
}
|
|
14
|
+
function code(controller) {
|
|
15
|
+
return !!controller && 'nextChange' in controller && 'nextProblem' in controller;
|
|
16
|
+
}
|
|
17
|
+
function step(controller, kind, backward) {
|
|
18
|
+
let before = caret(controller.document.selection), moved = kind === 'change'
|
|
19
|
+
? (backward ? controller.previousChange() : controller.nextChange())
|
|
20
|
+
: (backward ? controller.previousProblem() : controller.nextProblem());
|
|
21
|
+
if (!moved) {
|
|
22
|
+
return 'none';
|
|
23
|
+
}
|
|
24
|
+
let after = caret(controller.document.selection);
|
|
25
|
+
return (backward ? after >= before : after <= before) ? 'wrapped' : 'moved';
|
|
26
|
+
}
|
|
27
|
+
function reported(controller) {
|
|
28
|
+
return new Promise((resolve) => {
|
|
29
|
+
let stop = root((dispose) => {
|
|
30
|
+
effect(() => {
|
|
31
|
+
let { errors, warnings } = controller.state.problems;
|
|
32
|
+
if (errors || warnings) {
|
|
33
|
+
queueMicrotask(finish);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return dispose;
|
|
37
|
+
}), timer = setTimeout(finish, PROBLEMS_WAIT);
|
|
38
|
+
function finish() {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
stop();
|
|
41
|
+
resolve();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const navigate = ({ bindings, hosting, model, tree }) => {
|
|
46
|
+
let bound = null, resolve = keymap(mac());
|
|
47
|
+
async function go(kind, backward = false) {
|
|
48
|
+
let active = model.state.active, controller = active && (await hosting.whenShown(active)), left, result = 'none';
|
|
49
|
+
if (active && code(controller) && model.state.active === active) {
|
|
50
|
+
left = controller.document.selection;
|
|
51
|
+
result = step(controller, kind, backward);
|
|
52
|
+
if (result === 'moved') {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
hosting.mark();
|
|
57
|
+
let explorer = tree(), element = explorer && (await (backward ? explorer.previous(kind) : explorer.next(kind)));
|
|
58
|
+
if (!element || element.id === active?.path) {
|
|
59
|
+
if (result === 'none') {
|
|
60
|
+
model.status(kind === 'change' ? 'No changes' : 'No problems');
|
|
61
|
+
}
|
|
62
|
+
return result !== 'none';
|
|
63
|
+
}
|
|
64
|
+
if (result === 'wrapped' && code(controller) && left) {
|
|
65
|
+
controller.select(left, false);
|
|
66
|
+
}
|
|
67
|
+
let tab = await model.open(element.id);
|
|
68
|
+
return !!tab && model.state.active === tab && arrive(tab, kind, backward);
|
|
69
|
+
}
|
|
70
|
+
async function arrive(tab, kind, backward) {
|
|
71
|
+
let controller = await hosting.whenShown(tab);
|
|
72
|
+
if (!code(controller) || model.state.active !== tab) {
|
|
73
|
+
return !!controller;
|
|
74
|
+
}
|
|
75
|
+
if (kind === 'change') {
|
|
76
|
+
let text = await hosting.loaded(tab.path);
|
|
77
|
+
if (text != null) {
|
|
78
|
+
controller.setBaseline(text);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else if (!controller.state.problems.errors && !controller.state.problems.warnings) {
|
|
82
|
+
await reported(controller);
|
|
83
|
+
}
|
|
84
|
+
if (model.state.active !== tab) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
controller.select({ start: backward ? 0 : controller.document.value.length }, false);
|
|
88
|
+
step(controller, kind, backward);
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
function keydown(event) {
|
|
92
|
+
if (event.defaultPrevented || event.isComposing) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
let next = bindings();
|
|
96
|
+
if (next !== bound) {
|
|
97
|
+
bound = next;
|
|
98
|
+
resolve = keymap(mac(), next);
|
|
99
|
+
}
|
|
100
|
+
let command = resolve(event), jump = command && COMMANDS[command];
|
|
101
|
+
if (!jump) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
event.stopPropagation();
|
|
106
|
+
void go(jump[0], jump[1]);
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
connect(element) {
|
|
110
|
+
let listening = new AbortController();
|
|
111
|
+
element.addEventListener('keydown', keydown, { capture: true, signal: listening.signal });
|
|
112
|
+
return () => listening.abort();
|
|
113
|
+
},
|
|
114
|
+
go
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
export default navigate;
|
|
118
|
+
export { step };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Decorations from '../tree/decorations.js';
|
|
2
|
+
import type { FileTreeElement, FileTreeImportEntry, FileTreeSnapshot } from '../tree/index.js';
|
|
3
|
+
import { type EditorWorkspaceModel, type WorkspaceSession, type WorkspaceTab } from './model.js';
|
|
4
|
+
import type { WorkspaceEditorController } from './index.js';
|
|
5
|
+
type Shown = {
|
|
6
|
+
controller: WorkspaceEditorController;
|
|
7
|
+
tab: WorkspaceTab;
|
|
8
|
+
};
|
|
9
|
+
declare function parse(value: WorkspaceSession | null | undefined): WorkspaceSession | null;
|
|
10
|
+
declare const hosted: (model: EditorWorkspaceModel, current: () => Shown | undefined, delay?: number) => {
|
|
11
|
+
baseline(path: string): string | null | undefined;
|
|
12
|
+
connect(element: HTMLElement): () => void;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
explorer: FileTreeSnapshot;
|
|
15
|
+
export: ((element: FileTreeElement) => import("../index.js").FileTreeExport | null) | undefined;
|
|
16
|
+
flush: () => void;
|
|
17
|
+
import: ((target: FileTreeElement | null, entries: readonly FileTreeImportEntry[]) => Promise<void>) | undefined;
|
|
18
|
+
loaded(path: string): Promise<string | null>;
|
|
19
|
+
mark: () => void;
|
|
20
|
+
marks: Decorations;
|
|
21
|
+
ready: () => boolean;
|
|
22
|
+
remember(tab: WorkspaceTab, controller: WorkspaceEditorController): void;
|
|
23
|
+
restore(): Promise<void>;
|
|
24
|
+
shown(tab: WorkspaceTab, controller: WorkspaceEditorController): void;
|
|
25
|
+
whenShown(tab: WorkspaceTab): Promise<WorkspaceEditorController | undefined>;
|
|
26
|
+
};
|
|
27
|
+
export default hosted;
|
|
28
|
+
export { parse };
|
|
29
|
+
export type { Shown };
|