@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
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
|
+
import { dirty } from './model.js';
|
|
3
|
+
class ReactiveObject_0ab57aq0 extends reactivity_u0.ReactiveObject {
|
|
4
|
+
#phase;
|
|
5
|
+
#savedAt;
|
|
6
|
+
constructor(_p0, _p1) {
|
|
7
|
+
super(null);
|
|
8
|
+
this.#phase = this[reactivity_u0.SIGNAL](_p0);
|
|
9
|
+
this.#savedAt = this[reactivity_u0.SIGNAL](_p1);
|
|
10
|
+
}
|
|
11
|
+
get phase() {
|
|
12
|
+
return reactivity_u0.read(this.#phase);
|
|
13
|
+
}
|
|
14
|
+
set phase(_v0) {
|
|
15
|
+
reactivity_u0.write(this.#phase, _v0);
|
|
16
|
+
}
|
|
17
|
+
get savedAt() {
|
|
18
|
+
return reactivity_u0.read(this.#savedAt);
|
|
19
|
+
}
|
|
20
|
+
set savedAt(_v1) {
|
|
21
|
+
reactivity_u0.write(this.#savedAt, _v1);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const AUTO_SAVE_MODES = {
|
|
25
|
+
delay: 'After delay',
|
|
26
|
+
focus: 'On focus change',
|
|
27
|
+
off: 'Off'
|
|
28
|
+
};
|
|
29
|
+
const INDENT_SIZES = [2, 4, 8];
|
|
30
|
+
const LANGUAGES = {
|
|
31
|
+
css: 'CSS',
|
|
32
|
+
html: 'HTML',
|
|
33
|
+
javascript: 'JavaScript',
|
|
34
|
+
json: 'JSON',
|
|
35
|
+
jsonc: 'JSON with Comments',
|
|
36
|
+
jsx: 'JavaScript JSX',
|
|
37
|
+
markdown: 'Markdown',
|
|
38
|
+
plain: 'Plain Text',
|
|
39
|
+
python: 'Python',
|
|
40
|
+
scss: 'SCSS',
|
|
41
|
+
tsx: 'TypeScript JSX',
|
|
42
|
+
typescript: 'TypeScript'
|
|
43
|
+
};
|
|
44
|
+
const LINE_BREAK = /\r\n|\r|\n/g;
|
|
45
|
+
function indentation({ size, tabs }) {
|
|
46
|
+
return { indent: tabs ? '\t' : ' '.repeat(size), tabSize: size };
|
|
47
|
+
}
|
|
48
|
+
function indentLabel({ size, tabs }) {
|
|
49
|
+
return `${tabs ? 'Tab Size' : 'Spaces'}: ${size}`;
|
|
50
|
+
}
|
|
51
|
+
function lineEndings(document, eol) {
|
|
52
|
+
let edits = [], insert = eol === 'crlf' ? '\r\n' : '\n', shifts = [0], text = document.value;
|
|
53
|
+
for (let match of text.matchAll(LINE_BREAK)) {
|
|
54
|
+
if (match[0] !== insert) {
|
|
55
|
+
edits.push({ from: match.index, insert, to: match.index + match[0].length });
|
|
56
|
+
shifts.push(shifts[shifts.length - 1] + insert.length - match[0].length);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (!edits.length) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
let map = (offset) => {
|
|
63
|
+
let hi = edits.length, lo = 0;
|
|
64
|
+
while (lo < hi) {
|
|
65
|
+
let mid = (lo + hi) >>> 1;
|
|
66
|
+
if (edits[mid].to <= offset) {
|
|
67
|
+
lo = mid + 1;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
hi = mid;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
let edit = edits[lo];
|
|
74
|
+
if (edit && edit.from < offset) {
|
|
75
|
+
return edit.from + shifts[lo];
|
|
76
|
+
}
|
|
77
|
+
return offset + shifts[lo];
|
|
78
|
+
}, selections = document.selections.map((range) => ({ direction: range.direction, end: map(range.end), start: map(range.start) }));
|
|
79
|
+
return document.transact(edits, { selections }).changed;
|
|
80
|
+
}
|
|
81
|
+
class AutoSave {
|
|
82
|
+
model;
|
|
83
|
+
status = new ReactiveObject_0ab57aq0('saved', null);
|
|
84
|
+
active;
|
|
85
|
+
mode = 'off';
|
|
86
|
+
pending = 0;
|
|
87
|
+
tabs = new Map();
|
|
88
|
+
unsubscribe;
|
|
89
|
+
constructor(model) {
|
|
90
|
+
this.model = model;
|
|
91
|
+
}
|
|
92
|
+
edited(tab) {
|
|
93
|
+
let tracked = this.tabs.get(tab);
|
|
94
|
+
if (!tracked || this.mode !== 'delay') {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
clearTimeout(tracked.timer);
|
|
98
|
+
tracked.timer = undefined;
|
|
99
|
+
if (dirty(tab)) {
|
|
100
|
+
tracked.timer = setTimeout(() => {
|
|
101
|
+
tracked.timer = undefined;
|
|
102
|
+
this.save(tab);
|
|
103
|
+
}, this.model.state.preferences.autoSaveDelay);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
phase() {
|
|
107
|
+
this.status.phase = this.pending ? 'saving' : this.model.state.tabs.some(dirty) ? 'unsaved' : 'saved';
|
|
108
|
+
}
|
|
109
|
+
save(tab) {
|
|
110
|
+
if (!dirty(tab) || tab.missing || !this.tabs.has(tab)) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
this.pending++;
|
|
114
|
+
this.phase();
|
|
115
|
+
void this.model.save(tab).finally(() => {
|
|
116
|
+
this.pending--;
|
|
117
|
+
this.phase();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
sync() {
|
|
121
|
+
let state = this.model.state, open = new Set(state.tabs), previous = this.active;
|
|
122
|
+
for (let [tab, tracked] of this.tabs) {
|
|
123
|
+
if (!open.has(tab)) {
|
|
124
|
+
clearTimeout(tracked.timer);
|
|
125
|
+
tracked.unsubscribe();
|
|
126
|
+
this.tabs.delete(tab);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
for (let i = 0, n = state.tabs.length; i < n; i++) {
|
|
130
|
+
let tab = state.tabs[i], tracked = this.tabs.get(tab), unsaved = dirty(tab);
|
|
131
|
+
if (!tracked) {
|
|
132
|
+
this.tabs.set(tab, {
|
|
133
|
+
dirty: unsaved,
|
|
134
|
+
saved: tab.saved,
|
|
135
|
+
unsubscribe: tab.document.subscribe((_, change) => {
|
|
136
|
+
if (change.textChanged) {
|
|
137
|
+
this.edited(tab);
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
});
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (tracked.dirty && !unsaved && tracked.saved !== tab.saved) {
|
|
144
|
+
this.status.savedAt = Date.now();
|
|
145
|
+
}
|
|
146
|
+
tracked.dirty = unsaved;
|
|
147
|
+
tracked.saved = tab.saved;
|
|
148
|
+
}
|
|
149
|
+
if (state.preferences.autoSave !== this.mode) {
|
|
150
|
+
this.mode = state.preferences.autoSave;
|
|
151
|
+
for (let [tab, tracked] of this.tabs) {
|
|
152
|
+
clearTimeout(tracked.timer);
|
|
153
|
+
tracked.timer = undefined;
|
|
154
|
+
this.edited(tab);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
this.active = state.active;
|
|
158
|
+
if (this.mode === 'focus' && previous && previous !== state.active) {
|
|
159
|
+
this.save(previous);
|
|
160
|
+
}
|
|
161
|
+
this.phase();
|
|
162
|
+
}
|
|
163
|
+
blur(all = false) {
|
|
164
|
+
if (this.mode !== 'focus') {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
let tabs = all ? this.model.state.tabs : [this.model.state.active];
|
|
168
|
+
for (let i = 0, n = tabs.length; i < n; i++) {
|
|
169
|
+
let tab = tabs[i];
|
|
170
|
+
if (tab) {
|
|
171
|
+
this.save(tab);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
connect() {
|
|
176
|
+
this.disconnect();
|
|
177
|
+
this.unsubscribe = this.model.subscribe(() => this.sync());
|
|
178
|
+
this.sync();
|
|
179
|
+
return () => this.disconnect();
|
|
180
|
+
}
|
|
181
|
+
disconnect() {
|
|
182
|
+
this.unsubscribe?.();
|
|
183
|
+
this.unsubscribe = undefined;
|
|
184
|
+
for (let tracked of this.tabs.values()) {
|
|
185
|
+
clearTimeout(tracked.timer);
|
|
186
|
+
tracked.unsubscribe();
|
|
187
|
+
}
|
|
188
|
+
this.active = undefined;
|
|
189
|
+
this.mode = 'off';
|
|
190
|
+
this.tabs.clear();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
export { AUTO_SAVE_MODES, AutoSave, INDENT_SIZES, indentation, indentLabel, LANGUAGES, lineEndings };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Renderable } from '@esportsplus/template';
|
|
2
|
+
import type { Options } from '../code/index.js';
|
|
3
|
+
import type { WorkspaceEditorController } from './index.js';
|
|
4
|
+
import type { EditorWorkspaceModel, WorkspaceTab } from './model.js';
|
|
5
|
+
import '../../inline-edit/scss/index.scss';
|
|
6
|
+
import './scss/status.scss';
|
|
7
|
+
declare const statusbar: (model: EditorWorkspaceModel, nextProblem: () => Promise<boolean>) => {
|
|
8
|
+
attach: (controller: WorkspaceEditorController | undefined) => void;
|
|
9
|
+
connect: (element: HTMLElement) => () => void;
|
|
10
|
+
items: () => DocumentFragment | Text;
|
|
11
|
+
menu: () => Renderable<any>;
|
|
12
|
+
options: (tab: WorkspaceTab) => Options | undefined;
|
|
13
|
+
save: (button: () => Renderable<unknown>) => () => Renderable<unknown>;
|
|
14
|
+
};
|
|
15
|
+
export default statusbar;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
|
+
import { flush, peek, read, signal, untrack, write } from '@esportsplus/reactivity';
|
|
3
|
+
import * as template_u1 from '@esportsplus/template';
|
|
4
|
+
import icon from '../../icon/index.js';
|
|
5
|
+
import status from '../../inline-edit/status.js';
|
|
6
|
+
import tooltip from '../../tooltip/index.js';
|
|
7
|
+
import { AUTO_SAVE_MODES, AutoSave, INDENT_SIZES, indentation, indentLabel, LANGUAGES, lineEndings } from './status.js';
|
|
8
|
+
import alert from '@esportsplus/ui/svg/circle-alert.svg';
|
|
9
|
+
import check from '@esportsplus/ui/svg/check.svg';
|
|
10
|
+
import warning from '@esportsplus/ui/svg/warning.svg';
|
|
11
|
+
import '../../inline-edit/scss/index.scss';
|
|
12
|
+
import './scss/status.scss';
|
|
13
|
+
const template_071pfnv2 = template_u1.template(`<button class='button code-workspace-autosave' type='button'>`);
|
|
14
|
+
const template_071pfnv5 = template_u1.template(`<!--$-->`);
|
|
15
|
+
const template_071pfnv8 = template_u1.template(`<button class='button code-workspace-status-item ' type='button'>`);
|
|
16
|
+
const template_071pfnvb = template_u1.template(`<div class='code-workspace-status-items'><!--$-->`);
|
|
17
|
+
const template_071pfnvf = template_u1.template(`<!--$--><button class='button code-workspace-status-item code-workspace-status-item--problems' type='button'><!--$--><!--$--><!--$--></button><!--$--><!--$--><!--$--><span class='code-workspace-status-item code-workspace-status-item--encoding' title='Encoding'>UTF-8`);
|
|
18
|
+
const template_071pfnvp = template_u1.template(`<span class='code-workspace-status-item code-workspace-status-item--selections'><!--$--> selections`);
|
|
19
|
+
class ReactiveObject_071pfnv0 extends reactivity_u0.ReactiveObject {
|
|
20
|
+
#autoSave;
|
|
21
|
+
constructor(_p0) {
|
|
22
|
+
super(null);
|
|
23
|
+
this.#autoSave = this[reactivity_u0.SIGNAL](_p0);
|
|
24
|
+
}
|
|
25
|
+
get autoSave() {
|
|
26
|
+
return reactivity_u0.read(this.#autoSave);
|
|
27
|
+
}
|
|
28
|
+
set autoSave(_v0) {
|
|
29
|
+
reactivity_u0.write(this.#autoSave, _v0);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const CHOICES = {
|
|
33
|
+
autoSave: 'Auto save',
|
|
34
|
+
indent: 'Indentation',
|
|
35
|
+
language: 'Language'
|
|
36
|
+
};
|
|
37
|
+
function isCode(controller) {
|
|
38
|
+
return 'nextProblem' in controller && 'state' in controller;
|
|
39
|
+
}
|
|
40
|
+
function mark(selected) {
|
|
41
|
+
return () => {
|
|
42
|
+
let root_071pfnv4 = template_071pfnv5(), element_071pfnv6 = root_071pfnv4.firstChild;
|
|
43
|
+
new template_u1.EffectSlot(element_071pfnv6, () => selected() && icon({ 'aria-hidden': 'true', class: 'code-workspace-choice-icon' }, check));
|
|
44
|
+
return root_071pfnv4;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const statusbar = (model, nextProblem) => {
|
|
48
|
+
let autosave = new AutoSave(model), choice = signal('language'), editor = signal(undefined), menu, overrides = new WeakMap(), revision = signal(0), view = new ReactiveObject_071pfnv0('off');
|
|
49
|
+
function choose(next, element, below = false) {
|
|
50
|
+
let bounds = element.getBoundingClientRect();
|
|
51
|
+
write(choice, next);
|
|
52
|
+
flush();
|
|
53
|
+
menu?.open({ x: bounds.left, y: below ? bounds.bottom : bounds.top });
|
|
54
|
+
}
|
|
55
|
+
function code(render) {
|
|
56
|
+
return () => {
|
|
57
|
+
let controller = read(editor);
|
|
58
|
+
return controller && render(controller);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function item(kind, label, onclick, title = label) {
|
|
62
|
+
return (() => {
|
|
63
|
+
let root_071pfnv7 = template_071pfnv8(), element_071pfnv9 = root_071pfnv7.firstChild;
|
|
64
|
+
new template_u1.EffectSlot(element_071pfnv9, label, 1);
|
|
65
|
+
template_u1.setList(element_071pfnv9, 'class', template_u1.interpolate(["code-workspace-status-item--", (kind)]));
|
|
66
|
+
template_u1.setProperty(element_071pfnv9, 'aria-label', title);
|
|
67
|
+
template_u1.delegate(element_071pfnv9, 'click', onclick);
|
|
68
|
+
template_u1.setProperty(element_071pfnv9, 'title', title);
|
|
69
|
+
return root_071pfnv7;
|
|
70
|
+
})();
|
|
71
|
+
}
|
|
72
|
+
function override(next) {
|
|
73
|
+
let tab = model.state.active;
|
|
74
|
+
if (!tab) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
overrides.set(tab, { ...overrides.get(tab), ...next });
|
|
78
|
+
write(revision, peek(revision) + 1);
|
|
79
|
+
peek(editor)?.focus();
|
|
80
|
+
}
|
|
81
|
+
let indents = [false, true].flatMap((tabs) => INDENT_SIZES.map((size) => ({ size, tabs }))), items = [
|
|
82
|
+
...Object.keys(LANGUAGES).map((language) => ({
|
|
83
|
+
hidden: () => read(choice) !== 'language',
|
|
84
|
+
icon: mark(() => read(editor)?.state.language === language),
|
|
85
|
+
label: LANGUAGES[language],
|
|
86
|
+
onselect: () => override({ language })
|
|
87
|
+
})),
|
|
88
|
+
...indents.map((indent) => ({
|
|
89
|
+
hidden: () => read(choice) !== 'indent',
|
|
90
|
+
icon: mark(() => {
|
|
91
|
+
let current = read(editor)?.state.indent;
|
|
92
|
+
return current?.size === indent.size && current.tabs === indent.tabs;
|
|
93
|
+
}),
|
|
94
|
+
label: indent.tabs ? `Indent using tabs, size ${indent.size}` : `Indent using ${indent.size} spaces`,
|
|
95
|
+
onselect: () => override(indentation(indent))
|
|
96
|
+
})),
|
|
97
|
+
...['off', 'delay', 'focus'].map((mode) => ({
|
|
98
|
+
hidden: () => read(choice) !== 'autoSave',
|
|
99
|
+
icon: mark(() => view.autoSave === mode),
|
|
100
|
+
label: AUTO_SAVE_MODES[mode],
|
|
101
|
+
onselect: () => model.setPreferences({ autoSave: mode })
|
|
102
|
+
}))
|
|
103
|
+
];
|
|
104
|
+
return {
|
|
105
|
+
attach: (controller) => {
|
|
106
|
+
write(editor, controller && isCode(controller) ? controller : undefined);
|
|
107
|
+
},
|
|
108
|
+
connect: (element) => {
|
|
109
|
+
let listening = new AbortController(), update = () => {
|
|
110
|
+
view.autoSave = model.state.preferences.autoSave;
|
|
111
|
+
}, disconnect = autosave.connect(), unsubscribe = model.subscribe(update);
|
|
112
|
+
update();
|
|
113
|
+
element.ownerDocument.defaultView?.addEventListener('blur', () => autosave.blur(true), { signal: listening.signal });
|
|
114
|
+
element.addEventListener('focusout', (event) => {
|
|
115
|
+
let panel = event.target.closest('.code-workspace-editor');
|
|
116
|
+
if (panel && !panel.contains(event.relatedTarget)) {
|
|
117
|
+
autosave.blur();
|
|
118
|
+
}
|
|
119
|
+
}, { signal: listening.signal });
|
|
120
|
+
return () => {
|
|
121
|
+
listening.abort();
|
|
122
|
+
unsubscribe();
|
|
123
|
+
disconnect();
|
|
124
|
+
write(editor, undefined);
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
items: () => {
|
|
128
|
+
let root_071pfnva = template_071pfnvb(), element_071pfnvc = root_071pfnva.firstChild.firstChild, element_071pfnvd = root_071pfnva.firstChild;
|
|
129
|
+
new template_u1.EffectSlot(element_071pfnvc, code((controller) => {
|
|
130
|
+
let state = controller.state, problems = () => `${state.problems.errors} errors, ${state.problems.warnings} warnings: go to the next problem`;
|
|
131
|
+
return (() => {
|
|
132
|
+
let root_071pfnve = template_071pfnvf(), element_071pfnvg = root_071pfnve.firstChild, element_071pfnvh = element_071pfnvg.nextSibling, element_071pfnvi = element_071pfnvh.firstChild, element_071pfnvj = element_071pfnvi.nextSibling, element_071pfnvk = element_071pfnvj.nextSibling, element_071pfnvl = element_071pfnvh.nextSibling, element_071pfnvm = element_071pfnvl.nextSibling, element_071pfnvn = element_071pfnvm.nextSibling;
|
|
133
|
+
new template_u1.EffectSlot(element_071pfnvg, () => state.selections > 1 && (() => {
|
|
134
|
+
let root_071pfnvo = template_071pfnvp(), element_071pfnvq = root_071pfnvo.firstChild.firstChild;
|
|
135
|
+
template_u1.slot(element_071pfnvq, state.selections);
|
|
136
|
+
return root_071pfnvo;
|
|
137
|
+
})());
|
|
138
|
+
template_u1.slot(element_071pfnvi, icon({ 'aria-hidden': 'true', class: 'code-workspace-status-icon' }, alert));
|
|
139
|
+
new template_u1.EffectSlot(element_071pfnvj, () => state.problems.errors);
|
|
140
|
+
template_u1.slot(element_071pfnvk, icon({ 'aria-hidden': 'true', class: 'code-workspace-status-icon' }, warning));
|
|
141
|
+
new template_u1.EffectSlot(element_071pfnvh, () => state.problems.warnings, 2);
|
|
142
|
+
template_u1.slot(element_071pfnvl, item('language', () => LANGUAGES[state.language], (event) => choose('language', event.currentTarget), 'Select language'));
|
|
143
|
+
template_u1.slot(element_071pfnvm, item('indent', () => indentLabel(state.indent), (event) => choose('indent', event.currentTarget), 'Select indentation'));
|
|
144
|
+
template_u1.slot(element_071pfnvn, item('eol', () => (state.lineEnding === 'crlf' ? 'CRLF' : 'LF'), () => {
|
|
145
|
+
lineEndings(controller.document, state.lineEnding === 'crlf' ? 'lf' : 'crlf');
|
|
146
|
+
}, () => (state.lineEnding === 'crlf' ? 'Convert line endings to LF' : 'Convert line endings to CRLF')));
|
|
147
|
+
template_u1.setProperty(element_071pfnvh, 'aria-label', problems);
|
|
148
|
+
template_u1.setProperty(element_071pfnvh, 'disabled', () => !state.problems.errors && !state.problems.warnings);
|
|
149
|
+
template_u1.delegate(element_071pfnvh, 'click', () => {
|
|
150
|
+
void nextProblem().then((moved) => {
|
|
151
|
+
if (moved) {
|
|
152
|
+
peek(editor)?.focus();
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
template_u1.setProperty(element_071pfnvh, 'title', problems);
|
|
157
|
+
return root_071pfnve;
|
|
158
|
+
})();
|
|
159
|
+
}));
|
|
160
|
+
template_u1.slot(element_071pfnvd, item('autosave', () => `Auto Save: ${AUTO_SAVE_MODES[view.autoSave]}`, (event) => choose('autoSave', event.currentTarget), 'Select auto save'), 2);
|
|
161
|
+
return root_071pfnva;
|
|
162
|
+
},
|
|
163
|
+
menu: () => tooltip.context({
|
|
164
|
+
class: 'code-workspace-menu',
|
|
165
|
+
controller: (value) => {
|
|
166
|
+
menu = value;
|
|
167
|
+
},
|
|
168
|
+
items,
|
|
169
|
+
[tooltip.context.panel]: { 'aria-label': () => CHOICES[read(choice)], class: 'code-workspace-choices code-workspace-menu-panel' }
|
|
170
|
+
}, ''),
|
|
171
|
+
options: (tab) => {
|
|
172
|
+
read(revision);
|
|
173
|
+
return overrides.get(tab);
|
|
174
|
+
},
|
|
175
|
+
save: (button) => () => {
|
|
176
|
+
if (view.autoSave === 'off') {
|
|
177
|
+
return button();
|
|
178
|
+
}
|
|
179
|
+
return (() => {
|
|
180
|
+
let root_071pfnv1 = template_071pfnv2(), element_071pfnv3 = root_071pfnv1.firstChild;
|
|
181
|
+
template_u1.slot(element_071pfnv3, untrack(() => status.render(autosave.status)), 1);
|
|
182
|
+
template_u1.setProperty(element_071pfnv3, 'aria-label', () => `Auto save: ${AUTO_SAVE_MODES[view.autoSave]}`);
|
|
183
|
+
template_u1.delegate(element_071pfnv3, 'click', (event) => choose('autoSave', event.currentTarget, true));
|
|
184
|
+
template_u1.setProperty(element_071pfnv3, 'title', () => `Auto save: ${AUTO_SAVE_MODES[view.autoSave]}`);
|
|
185
|
+
return root_071pfnv1;
|
|
186
|
+
})();
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
export default statusbar;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
|
+
import type { Item } from '../../tooltip/menu.js';
|
|
3
|
+
import type { WorkspaceEditor } from './index.js';
|
|
4
|
+
import type { EditorWorkspaceModel, WorkspaceTab } from './model.js';
|
|
5
|
+
import './scss/tabs.scss';
|
|
6
|
+
type Options = {
|
|
7
|
+
isFile: (path: string) => boolean;
|
|
8
|
+
model: EditorWorkspaceModel;
|
|
9
|
+
remount: VoidFunction;
|
|
10
|
+
reveal: (path: string) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const strip: ({ isFile, model, remount, reveal }: Options) => {
|
|
13
|
+
attributes(tab: WorkspaceTab): {
|
|
14
|
+
class?: string | undefined;
|
|
15
|
+
oncontextmenu: (event: MouseEvent) => void;
|
|
16
|
+
ondblclick: () => void;
|
|
17
|
+
};
|
|
18
|
+
editor(tab: WorkspaceTab): WorkspaceEditor | undefined;
|
|
19
|
+
items(paths: () => string[]): Item[];
|
|
20
|
+
label(tab: WorkspaceTab): string;
|
|
21
|
+
merge(target: WorkspaceTab | string): Promise<void>;
|
|
22
|
+
menu: () => template_u1.Renderable<any>;
|
|
23
|
+
open(tab: WorkspaceTab, event: MouseEvent): void;
|
|
24
|
+
pin(tab: WorkspaceTab): template_u1.Renderable<any>;
|
|
25
|
+
title(tab: WorkspaceTab): string;
|
|
26
|
+
};
|
|
27
|
+
export default strip;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
|
+
import { flush } from '@esportsplus/reactivity';
|
|
3
|
+
import * as template_u1 from '@esportsplus/template';
|
|
4
|
+
import icon from '../../icon/index.js';
|
|
5
|
+
import tooltip from '../../tooltip/index.js';
|
|
6
|
+
import { mac } from '../../../shared/platform.js';
|
|
7
|
+
import diffs from '../diffs/index.js';
|
|
8
|
+
import { sides } from './tabs.js';
|
|
9
|
+
import pin from '@esportsplus/ui/svg/pin.svg';
|
|
10
|
+
import './scss/tabs.scss';
|
|
11
|
+
const template_07u9ia02 = template_u1.template(`<div class='code-workspace-document code-workspace-merge'><div class='code-workspace-merge-bar'><span class='code-workspace-merge-title'>Merging </span><button class='button code-workspace-merge-cancel' type='button'> Cancel merge `);
|
|
12
|
+
class ReactiveObject_07u9ia00 extends reactivity_u0.ReactiveObject {
|
|
13
|
+
#compare = this[reactivity_u0.SIGNAL](false);
|
|
14
|
+
#conflicted = this[reactivity_u0.SIGNAL](false);
|
|
15
|
+
#path = this[reactivity_u0.SIGNAL]('');
|
|
16
|
+
#pinned = this[reactivity_u0.SIGNAL](false);
|
|
17
|
+
constructor() {
|
|
18
|
+
super(null);
|
|
19
|
+
}
|
|
20
|
+
get compare() {
|
|
21
|
+
return reactivity_u0.read(this.#compare);
|
|
22
|
+
}
|
|
23
|
+
set compare(_v0) {
|
|
24
|
+
reactivity_u0.write(this.#compare, _v0);
|
|
25
|
+
}
|
|
26
|
+
get conflicted() {
|
|
27
|
+
return reactivity_u0.read(this.#conflicted);
|
|
28
|
+
}
|
|
29
|
+
set conflicted(_v1) {
|
|
30
|
+
reactivity_u0.write(this.#conflicted, _v1);
|
|
31
|
+
}
|
|
32
|
+
get path() {
|
|
33
|
+
return reactivity_u0.read(this.#path);
|
|
34
|
+
}
|
|
35
|
+
set path(_v2) {
|
|
36
|
+
reactivity_u0.write(this.#path, _v2);
|
|
37
|
+
}
|
|
38
|
+
get pinned() {
|
|
39
|
+
return reactivity_u0.read(this.#pinned);
|
|
40
|
+
}
|
|
41
|
+
set pinned(_v3) {
|
|
42
|
+
reactivity_u0.write(this.#pinned, _v3);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function name(path) {
|
|
46
|
+
return path.slice(path.lastIndexOf('/') + 1);
|
|
47
|
+
}
|
|
48
|
+
const strip = ({ isFile, model, remount, reveal }) => {
|
|
49
|
+
let chosen = '', controller, merging = new WeakMap(), subject = new ReactiveObject_07u9ia00();
|
|
50
|
+
function compare(tab) {
|
|
51
|
+
let { modified, original, paths } = tab.compare;
|
|
52
|
+
return () => diffs({
|
|
53
|
+
class: 'code-workspace-document code-workspace-compare',
|
|
54
|
+
filename: `${paths[0]} ↔ ${paths[1]}`,
|
|
55
|
+
modified,
|
|
56
|
+
original
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function merge(tab, found) {
|
|
60
|
+
return () => {
|
|
61
|
+
let root_07u9ia01 = template_07u9ia02(), element_07u9ia03 = root_07u9ia01.firstChild.firstElementChild.firstElementChild, element_07u9ia04 = element_07u9ia03.nextElementSibling, element_07u9ia05 = root_07u9ia01.firstChild;
|
|
62
|
+
template_u1.slot(element_07u9ia03, tab.path, 2);
|
|
63
|
+
template_u1.slot(element_07u9ia05, diffs.merge({
|
|
64
|
+
base: found.base,
|
|
65
|
+
class: 'code-workspace-merge-editor',
|
|
66
|
+
current: found.current,
|
|
67
|
+
filename: tab.path,
|
|
68
|
+
incoming: found.incoming,
|
|
69
|
+
onresolve: (result) => {
|
|
70
|
+
merging.delete(tab);
|
|
71
|
+
tab.document.setValue(result);
|
|
72
|
+
remount();
|
|
73
|
+
void model.save(tab);
|
|
74
|
+
}
|
|
75
|
+
}), 2);
|
|
76
|
+
template_u1.delegate(element_07u9ia04, 'click', () => {
|
|
77
|
+
merging.delete(tab);
|
|
78
|
+
remount();
|
|
79
|
+
});
|
|
80
|
+
return root_07u9ia01;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
let items = [
|
|
84
|
+
{
|
|
85
|
+
hidden: () => subject.compare || subject.pinned,
|
|
86
|
+
label: 'Pin',
|
|
87
|
+
onselect: () => model.pin(subject.path)
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
hidden: () => !subject.pinned,
|
|
91
|
+
label: 'Unpin',
|
|
92
|
+
onselect: () => model.unpin(subject.path)
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
hidden: () => !subject.conflicted,
|
|
96
|
+
label: 'Merge Conflicts',
|
|
97
|
+
onselect: () => {
|
|
98
|
+
void api.merge(subject.path);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
hint: mac() ? '⌘W' : 'Ctrl+W',
|
|
103
|
+
label: 'Close',
|
|
104
|
+
onselect: () => {
|
|
105
|
+
void model.close(subject.path);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: 'Close Others',
|
|
110
|
+
onselect: () => {
|
|
111
|
+
let path = subject.path;
|
|
112
|
+
void model.closeOthers(path).then((closed) => closed && model.activate(path));
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: 'Close to the Right',
|
|
117
|
+
onselect: () => {
|
|
118
|
+
let path = subject.path;
|
|
119
|
+
void model.closeRight(path).then((closed) => closed && model.activate(path));
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: 'Close Saved',
|
|
124
|
+
onselect: () => {
|
|
125
|
+
void model.closeSaved();
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
hidden: () => subject.compare,
|
|
130
|
+
label: 'Copy Path',
|
|
131
|
+
onselect: () => {
|
|
132
|
+
void model.copyPath(subject.path);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
hidden: () => subject.compare,
|
|
137
|
+
label: 'Reveal in Explorer',
|
|
138
|
+
onselect: () => reveal(subject.path)
|
|
139
|
+
}
|
|
140
|
+
];
|
|
141
|
+
let api = {
|
|
142
|
+
attributes(tab) {
|
|
143
|
+
let modifiers = [tab.pinned && 'code-workspace-tab--pinned', tab.preview && 'code-workspace-tab--preview'].filter(Boolean);
|
|
144
|
+
return {
|
|
145
|
+
...(modifiers.length ? { class: modifiers.join(' ') } : {}),
|
|
146
|
+
oncontextmenu: (event) => api.open(tab, event),
|
|
147
|
+
ondblclick: () => {
|
|
148
|
+
if (tab.preview) {
|
|
149
|
+
void model.open(tab.path);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
editor(tab) {
|
|
155
|
+
if (tab.compare) {
|
|
156
|
+
return compare(tab);
|
|
157
|
+
}
|
|
158
|
+
let found = merging.get(tab);
|
|
159
|
+
return found && merge(tab, found);
|
|
160
|
+
},
|
|
161
|
+
items(paths) {
|
|
162
|
+
let files = () => paths().filter(isFile);
|
|
163
|
+
return [
|
|
164
|
+
{
|
|
165
|
+
hidden: () => paths().length !== 1 || files().length !== 1,
|
|
166
|
+
label: 'Select for Compare',
|
|
167
|
+
onselect: () => {
|
|
168
|
+
chosen = paths()[0];
|
|
169
|
+
model.status(`Selected ${chosen} for compare`);
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
hidden: () => {
|
|
174
|
+
let list = files();
|
|
175
|
+
return list.length !== paths().length || !(list.length === 2 || (list.length === 1 && !!chosen && chosen !== list[0]));
|
|
176
|
+
},
|
|
177
|
+
label: 'Compare with Selected',
|
|
178
|
+
onselect: () => {
|
|
179
|
+
let list = files();
|
|
180
|
+
void (list.length === 2 ? model.compare(list[0], list[1]) : model.compare(chosen, list[0]));
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
hidden: () => paths().length !== 1 || files().length !== 1,
|
|
185
|
+
label: 'Merge Conflicts',
|
|
186
|
+
onselect: () => {
|
|
187
|
+
void api.merge(paths()[0]);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
];
|
|
191
|
+
},
|
|
192
|
+
label(tab) {
|
|
193
|
+
return tab.compare ? `${name(tab.compare.paths[0])} ↔ ${name(tab.compare.paths[1])}` : name(tab.path);
|
|
194
|
+
},
|
|
195
|
+
async merge(target) {
|
|
196
|
+
let tab = typeof target === 'string' ? await model.open(target) : target;
|
|
197
|
+
if (!tab || tab.compare) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
let found = sides(tab.document.value);
|
|
201
|
+
if (!found) {
|
|
202
|
+
model.status(`${tab.path} has no conflict markers`);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
merging.set(tab, found);
|
|
206
|
+
model.activate(tab);
|
|
207
|
+
remount();
|
|
208
|
+
},
|
|
209
|
+
menu: () => tooltip.context({
|
|
210
|
+
class: 'code-workspace-menu',
|
|
211
|
+
controller: (value) => {
|
|
212
|
+
controller = value;
|
|
213
|
+
},
|
|
214
|
+
items,
|
|
215
|
+
[tooltip.context.panel]: { 'aria-label': 'Tab actions', class: 'code-workspace-menu-panel' }
|
|
216
|
+
}, ''),
|
|
217
|
+
open(tab, event) {
|
|
218
|
+
if (!controller) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
event.preventDefault();
|
|
222
|
+
let box = event.button === 2 ? undefined : event.currentTarget.getBoundingClientRect();
|
|
223
|
+
subject.compare = !!tab.compare;
|
|
224
|
+
subject.conflicted = !tab.compare && !!sides(tab.document.value);
|
|
225
|
+
subject.path = tab.path;
|
|
226
|
+
subject.pinned = tab.pinned;
|
|
227
|
+
flush();
|
|
228
|
+
controller.open(box ? { x: box.left, y: box.bottom } : { x: event.clientX, y: event.clientY });
|
|
229
|
+
},
|
|
230
|
+
pin(tab) {
|
|
231
|
+
return tab.pinned && icon({ 'aria-label': 'Pinned', class: 'code-workspace-tab-pin', role: 'img' }, pin);
|
|
232
|
+
},
|
|
233
|
+
title(tab) {
|
|
234
|
+
return tab.compare ? `${tab.compare.paths[0]} ↔ ${tab.compare.paths[1]}` : tab.path;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
return api;
|
|
238
|
+
};
|
|
239
|
+
export default strip;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WorkspaceCompare, WorkspaceTab } from './model.js';
|
|
2
|
+
type Closable = 'others' | 'right' | 'saved';
|
|
3
|
+
type MergeSides = {
|
|
4
|
+
base: string | null;
|
|
5
|
+
current: string;
|
|
6
|
+
incoming: string;
|
|
7
|
+
};
|
|
8
|
+
declare const closable: (tabs: readonly WorkspaceTab[], kind: Closable, path?: string) => WorkspaceTab[];
|
|
9
|
+
declare const compareKey: (original: string, modified: string) => string;
|
|
10
|
+
declare const compareTab: (id: number, compare: WorkspaceCompare) => WorkspaceTab;
|
|
11
|
+
declare const order: (tabs: WorkspaceTab[]) => void;
|
|
12
|
+
declare const place: (tabs: WorkspaceTab[], tab: WorkspaceTab) => WorkspaceTab | undefined;
|
|
13
|
+
declare const sides: (text: string) => MergeSides | null;
|
|
14
|
+
export { closable, compareKey, compareTab, order, place, sides };
|
|
15
|
+
export type { Closable, MergeSides };
|