@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,37 @@
|
|
|
1
|
+
import { type Command } from '../code/keymap.js';
|
|
2
|
+
type KeybindingRow = {
|
|
3
|
+
builtin: string[];
|
|
4
|
+
chords: string[];
|
|
5
|
+
id: Command;
|
|
6
|
+
label: string;
|
|
7
|
+
user: boolean;
|
|
8
|
+
};
|
|
9
|
+
type Keybindings = Readonly<Record<string, Command | null>>;
|
|
10
|
+
type SequenceKey = Pick<KeyboardEvent, 'altKey' | 'code' | 'ctrlKey' | 'isComposing' | 'key' | 'metaKey' | 'preventDefault' | 'shiftKey' | 'stopPropagation' | 'target'>;
|
|
11
|
+
type SequenceOptions = {
|
|
12
|
+
accept: (e: SequenceKey) => boolean;
|
|
13
|
+
actions: Readonly<Record<string, VoidFunction>>;
|
|
14
|
+
apple: boolean;
|
|
15
|
+
onpending?: (pending: boolean) => void;
|
|
16
|
+
prefix: string;
|
|
17
|
+
timeout?: number;
|
|
18
|
+
};
|
|
19
|
+
declare const bind: (keybindings: Keybindings, apple: boolean, command: Command, keys: string) => Keybindings;
|
|
20
|
+
declare const conflict: (keybindings: Keybindings, apple: boolean, command: Command, keys: string) => Command | null;
|
|
21
|
+
declare const declare: (existing: string | null | undefined, keys: string) => string;
|
|
22
|
+
declare const fromChord: (keys: string, apple: boolean) => string;
|
|
23
|
+
declare const fromRecorder: (value: string, apple: boolean) => string | null;
|
|
24
|
+
declare const label: (keys: string, apple: boolean) => string;
|
|
25
|
+
declare const matches: (row: KeybindingRow, query: string, apple: boolean) => boolean;
|
|
26
|
+
declare const merge: (base: Keybindings | undefined, user: Keybindings) => Readonly<Record<string, Command | null>>;
|
|
27
|
+
declare const reset: (keybindings: Keybindings, apple: boolean, command: Command) => Keybindings;
|
|
28
|
+
declare const rows: (keybindings: Keybindings, apple: boolean) => KeybindingRow[];
|
|
29
|
+
declare const sanitize: (value: unknown) => Keybindings;
|
|
30
|
+
declare const sequence: ({ accept, actions, apple, onpending, prefix, timeout }: SequenceOptions) => {
|
|
31
|
+
cancel: () => void;
|
|
32
|
+
keydown: (e: SequenceKey) => void;
|
|
33
|
+
pending: () => boolean;
|
|
34
|
+
};
|
|
35
|
+
declare const unassign: (keybindings: Keybindings, apple: boolean, command: Command) => Keybindings;
|
|
36
|
+
export { bind, conflict, declare, fromChord, fromRecorder, label, matches, merge, reset, rows, sanitize, sequence, unassign };
|
|
37
|
+
export type { KeybindingRow, Keybindings, SequenceKey, SequenceOptions };
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { chord, combo, COMMANDS } from '../code/keymap.js';
|
|
2
|
+
const APPLE_ORDER = ['Ctrl', 'Alt', 'Shift', 'Mod'];
|
|
3
|
+
const ARROWS = {
|
|
4
|
+
ArrowDown: '↓',
|
|
5
|
+
ArrowLeft: '←',
|
|
6
|
+
ArrowRight: '→',
|
|
7
|
+
ArrowUp: '↑'
|
|
8
|
+
};
|
|
9
|
+
const BUILTIN = [
|
|
10
|
+
['Alt+Backspace', 'deleteWordBackward', true],
|
|
11
|
+
['Alt+Delete', 'deleteWordForward', true],
|
|
12
|
+
['Alt+`', 'autocomplete', true],
|
|
13
|
+
['Alt+i', 'autocomplete', true],
|
|
14
|
+
['Alt+v', 'pageUp', true],
|
|
15
|
+
['ArrowDown', 'moveDown'],
|
|
16
|
+
['ArrowLeft', 'moveLeft'],
|
|
17
|
+
['ArrowRight', 'moveRight'],
|
|
18
|
+
['ArrowUp', 'moveUp'],
|
|
19
|
+
['Backspace', 'deleteCharacterBackward'],
|
|
20
|
+
['Ctrl+a', 'lineStart', true],
|
|
21
|
+
['Ctrl+Alt+d', 'deleteWordForward', true],
|
|
22
|
+
['Ctrl+Alt+h', 'deleteWordBackward', true],
|
|
23
|
+
['Ctrl+b', 'moveLeft', true],
|
|
24
|
+
['Ctrl+d', 'deleteCharacterForward', true],
|
|
25
|
+
['Ctrl+e', 'lineEnd', true],
|
|
26
|
+
['Ctrl+f', 'moveRight', true],
|
|
27
|
+
['Ctrl+h', 'deleteCharacterBackward', true],
|
|
28
|
+
['Ctrl+k', 'deleteLineEnd', true],
|
|
29
|
+
['Ctrl+n', 'moveDown', true],
|
|
30
|
+
['Ctrl+o', 'splitLine', true],
|
|
31
|
+
['Ctrl+p', 'moveUp', true],
|
|
32
|
+
['Ctrl+t', 'transpose', true],
|
|
33
|
+
['Ctrl+v', 'pageDown', true],
|
|
34
|
+
['Delete', 'deleteCharacterForward'],
|
|
35
|
+
['End', 'lineEnd'],
|
|
36
|
+
['Home', 'lineStart'],
|
|
37
|
+
['Mod+ArrowLeft', 'lineStart', true],
|
|
38
|
+
['Mod+ArrowRight', 'lineEnd', true],
|
|
39
|
+
['Mod+Backspace', 'deleteWordBackward', false],
|
|
40
|
+
['Mod+Delete', 'deleteWordForward', false],
|
|
41
|
+
['Mod+Space', 'autocomplete'],
|
|
42
|
+
['PageDown', 'pageDown'],
|
|
43
|
+
['PageUp', 'pageUp']
|
|
44
|
+
];
|
|
45
|
+
const GLYPHS = {
|
|
46
|
+
Alt: '⌥',
|
|
47
|
+
Ctrl: '⌃',
|
|
48
|
+
Mod: '⌘',
|
|
49
|
+
Shift: '⇧'
|
|
50
|
+
};
|
|
51
|
+
const IDS = new Set(COMMANDS.map((command) => command.id));
|
|
52
|
+
const MODIFIER_KEYS = new Set(['Alt', 'AltGraph', 'Control', 'Meta', 'OS', 'Shift']);
|
|
53
|
+
const ORDER = ['Mod', 'Ctrl', 'Meta', 'Alt', 'Shift'];
|
|
54
|
+
const SEQUENCE_TIMEOUT = 1500;
|
|
55
|
+
const SHIFTED = {
|
|
56
|
+
'?': '/',
|
|
57
|
+
'{': '[',
|
|
58
|
+
'|': '\\',
|
|
59
|
+
'}': ']',
|
|
60
|
+
'~': '`'
|
|
61
|
+
};
|
|
62
|
+
const TOKEN = /[^+]+|\+/g;
|
|
63
|
+
function builtins(apple) {
|
|
64
|
+
let map = new Map();
|
|
65
|
+
for (let i = 0, n = BUILTIN.length; i < n; i++) {
|
|
66
|
+
let [keys, command, platform] = BUILTIN[i], normalized = chord(keys, apple);
|
|
67
|
+
if (normalized && (platform === undefined || platform === apple)) {
|
|
68
|
+
map.set(normalized, command);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return map;
|
|
72
|
+
}
|
|
73
|
+
function defaults(apple) {
|
|
74
|
+
let map = new Map();
|
|
75
|
+
for (let i = 0, n = COMMANDS.length; i < n; i++) {
|
|
76
|
+
let { id, keys } = COMMANDS[i];
|
|
77
|
+
for (let j = 0, m = keys.length; j < m; j++) {
|
|
78
|
+
let normalized = chord(keys[j], apple);
|
|
79
|
+
if (normalized) {
|
|
80
|
+
map.set(normalized, id);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return map;
|
|
85
|
+
}
|
|
86
|
+
function normalize(keybindings, apple) {
|
|
87
|
+
let out = {};
|
|
88
|
+
for (let keys in keybindings) {
|
|
89
|
+
let command = keybindings[keys], normalized = chord(keys, apple);
|
|
90
|
+
if (normalized && (command === null || IDS.has(command))) {
|
|
91
|
+
out[normalized] = command;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
function simplify(keybindings, base) {
|
|
97
|
+
for (let keys in keybindings) {
|
|
98
|
+
if (keybindings[keys] === (base.get(keys) ?? null)) {
|
|
99
|
+
delete keybindings[keys];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return keybindings;
|
|
103
|
+
}
|
|
104
|
+
function split(keys) {
|
|
105
|
+
return (keys.match(TOKEN) ?? []).filter((_, i) => i % 2 === 0);
|
|
106
|
+
}
|
|
107
|
+
function table(keybindings, apple) {
|
|
108
|
+
let map = new Map(defaults(apple)), user = normalize(keybindings, apple);
|
|
109
|
+
for (let keys in user) {
|
|
110
|
+
map.set(keys, user[keys]);
|
|
111
|
+
}
|
|
112
|
+
return map;
|
|
113
|
+
}
|
|
114
|
+
function unbind(keybindings, base, current, command) {
|
|
115
|
+
for (let [keys, owner] of current) {
|
|
116
|
+
if (owner !== command) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (base.has(keys)) {
|
|
120
|
+
keybindings[keys] = null;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
delete keybindings[keys];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const bind = (keybindings, apple, command, keys) => {
|
|
128
|
+
let base = defaults(apple), normalized = chord(keys, apple), next = normalize(keybindings, apple);
|
|
129
|
+
if (!normalized) {
|
|
130
|
+
return keybindings;
|
|
131
|
+
}
|
|
132
|
+
unbind(next, base, table(keybindings, apple), command);
|
|
133
|
+
next[normalized] = command;
|
|
134
|
+
return simplify(next, base);
|
|
135
|
+
};
|
|
136
|
+
const conflict = (keybindings, apple, command, keys) => {
|
|
137
|
+
let normalized = chord(keys, apple);
|
|
138
|
+
if (!normalized) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
let current = table(keybindings, apple), owner = current.has(normalized) ? current.get(normalized) : builtins(apple).get(normalized);
|
|
142
|
+
return owner && owner !== command ? owner : null;
|
|
143
|
+
};
|
|
144
|
+
const declare = (existing, keys) => {
|
|
145
|
+
let tokens = (existing ?? '').split(/\s+/).filter(Boolean), names = split(fromChord(keys, false));
|
|
146
|
+
for (let mod of ['Control', 'Meta']) {
|
|
147
|
+
let token = names.map((name) => (name === 'Mod' ? mod : name)).join('+');
|
|
148
|
+
if (!tokens.some((other) => other.toLowerCase() === token.toLowerCase())) {
|
|
149
|
+
tokens.push(token);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return tokens.join(' ');
|
|
153
|
+
};
|
|
154
|
+
const fromChord = (keys, apple) => {
|
|
155
|
+
let tokens = split(keys), key = tokens.pop() ?? '', order = apple ? APPLE_ORDER : ORDER;
|
|
156
|
+
if (key === ' ') {
|
|
157
|
+
key = 'Space';
|
|
158
|
+
}
|
|
159
|
+
else if (key === 'Enter') {
|
|
160
|
+
key = '↵';
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
key = ARROWS[key] ?? (key.length === 1 ? key.toUpperCase() : key);
|
|
164
|
+
}
|
|
165
|
+
return [...order.filter((name) => tokens.includes(name)), key].join('+');
|
|
166
|
+
};
|
|
167
|
+
const fromRecorder = (value, apple) => {
|
|
168
|
+
let tokens = split(value), key = tokens.pop();
|
|
169
|
+
if (!key) {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
for (let name in ARROWS) {
|
|
173
|
+
if (ARROWS[name] === key) {
|
|
174
|
+
key = name;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (key === '↵') {
|
|
178
|
+
key = 'Enter';
|
|
179
|
+
}
|
|
180
|
+
return chord([...tokens, SHIFTED[key] ?? key].join('+'), apple);
|
|
181
|
+
};
|
|
182
|
+
const label = (keys, apple) => {
|
|
183
|
+
let tokens = fromChord(keys, apple).split(/\+(?!$)/);
|
|
184
|
+
if (!apple) {
|
|
185
|
+
return tokens.map((token) => (token === 'Mod' ? 'Ctrl' : token)).join('+');
|
|
186
|
+
}
|
|
187
|
+
return tokens.map((token) => GLYPHS[token] ?? token).join('');
|
|
188
|
+
};
|
|
189
|
+
const matches = (row, query, apple) => {
|
|
190
|
+
let needle = query.trim().toLowerCase();
|
|
191
|
+
if (!needle) {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
if (row.label.toLowerCase().includes(needle) || row.id.toLowerCase().includes(needle)) {
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
for (let keys of [...row.chords, ...row.builtin]) {
|
|
198
|
+
for (let text of [keys, fromChord(keys, apple), label(keys, apple)]) {
|
|
199
|
+
if (text.toLowerCase().includes(needle)) {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return false;
|
|
205
|
+
};
|
|
206
|
+
const merge = (base, user) => {
|
|
207
|
+
if (!base) {
|
|
208
|
+
return user;
|
|
209
|
+
}
|
|
210
|
+
return { ...base, ...user };
|
|
211
|
+
};
|
|
212
|
+
const reset = (keybindings, apple, command) => {
|
|
213
|
+
let base = defaults(apple), next = normalize(keybindings, apple);
|
|
214
|
+
for (let keys in next) {
|
|
215
|
+
if (next[keys] === command || (next[keys] === null && base.get(keys) === command)) {
|
|
216
|
+
delete next[keys];
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return next;
|
|
220
|
+
};
|
|
221
|
+
const rows = (keybindings, apple) => {
|
|
222
|
+
let base = defaults(apple), current = table(keybindings, apple), native = [...builtins(apple)], user = normalize(keybindings, apple), changed = new Set();
|
|
223
|
+
for (let keys in user) {
|
|
224
|
+
let before = base.get(keys), after = user[keys];
|
|
225
|
+
if (before && before !== after) {
|
|
226
|
+
changed.add(before);
|
|
227
|
+
}
|
|
228
|
+
if (after && after !== before) {
|
|
229
|
+
changed.add(after);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return COMMANDS.map(({ id, label }) => ({
|
|
233
|
+
builtin: native.filter(([keys, command]) => command === id && !current.get(keys)).map(([keys]) => keys),
|
|
234
|
+
chords: [...current].filter(([, command]) => command === id).map(([keys]) => keys),
|
|
235
|
+
id,
|
|
236
|
+
label,
|
|
237
|
+
user: changed.has(id)
|
|
238
|
+
}));
|
|
239
|
+
};
|
|
240
|
+
const sanitize = (value) => {
|
|
241
|
+
let out = {};
|
|
242
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
243
|
+
return out;
|
|
244
|
+
}
|
|
245
|
+
for (let [keys, command] of Object.entries(value)) {
|
|
246
|
+
if (chord(keys, false) && (command === null || (typeof command === 'string' && IDS.has(command)))) {
|
|
247
|
+
out[keys] = command;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return out;
|
|
251
|
+
};
|
|
252
|
+
const sequence = ({ accept, actions, apple, onpending, prefix, timeout = SEQUENCE_TIMEOUT }) => {
|
|
253
|
+
let timer;
|
|
254
|
+
function cancel() {
|
|
255
|
+
if (timer === undefined) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
clearTimeout(timer);
|
|
259
|
+
timer = undefined;
|
|
260
|
+
onpending?.(false);
|
|
261
|
+
}
|
|
262
|
+
function keydown(e) {
|
|
263
|
+
if (e.isComposing || MODIFIER_KEYS.has(e.key)) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
let keys = combo(e, apple);
|
|
267
|
+
if (timer !== undefined) {
|
|
268
|
+
e.preventDefault();
|
|
269
|
+
e.stopPropagation();
|
|
270
|
+
cancel();
|
|
271
|
+
actions[keys]?.();
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (keys === prefix && accept(e)) {
|
|
275
|
+
e.preventDefault();
|
|
276
|
+
e.stopPropagation();
|
|
277
|
+
timer = setTimeout(cancel, timeout);
|
|
278
|
+
onpending?.(true);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return { cancel, keydown, pending: () => timer !== undefined };
|
|
282
|
+
};
|
|
283
|
+
const unassign = (keybindings, apple, command) => {
|
|
284
|
+
let base = defaults(apple), next = normalize(keybindings, apple);
|
|
285
|
+
unbind(next, base, table(keybindings, apple), command);
|
|
286
|
+
return simplify(next, base);
|
|
287
|
+
};
|
|
288
|
+
export { bind, conflict, declare, fromChord, fromRecorder, label, matches, merge, reset, rows, sanitize, sequence, unassign };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { Command } from '../code/keymap.js';
|
|
1
2
|
import { EditorDocument } from '../code/document.js';
|
|
3
|
+
import type { FileTreeExport, FileTreeImportEntry } from '../tree/index.js';
|
|
2
4
|
type WorkspaceAction = {
|
|
3
5
|
danger?: boolean;
|
|
4
6
|
icon?: string;
|
|
@@ -10,6 +12,11 @@ type WorkspaceAction = {
|
|
|
10
12
|
type WorkspaceChange = {
|
|
11
13
|
paths?: readonly string[];
|
|
12
14
|
};
|
|
15
|
+
type WorkspaceCompare = Readonly<{
|
|
16
|
+
modified: string;
|
|
17
|
+
original: string;
|
|
18
|
+
paths: readonly [string, string];
|
|
19
|
+
}>;
|
|
13
20
|
type WorkspaceConfirmation = {
|
|
14
21
|
dirty: readonly string[];
|
|
15
22
|
kind: 'close' | 'delete' | 'workspace';
|
|
@@ -22,11 +29,14 @@ type WorkspaceEntry = Readonly<{
|
|
|
22
29
|
}>;
|
|
23
30
|
type WorkspaceHost = {
|
|
24
31
|
actions?: readonly WorkspaceAction[];
|
|
32
|
+
baseline?: (cwd: string, path: string) => Promise<string | null>;
|
|
25
33
|
confirm?: (request: WorkspaceConfirmation) => WorkspaceDecision | Promise<WorkspaceDecision>;
|
|
26
34
|
copyPath(cwd: string, path: string): void | Promise<void>;
|
|
27
35
|
delete(cwd: string, paths: readonly string[]): Promise<{
|
|
28
36
|
operationId: string;
|
|
29
37
|
}>;
|
|
38
|
+
export?: (cwd: string, path: string) => FileTreeExport | null;
|
|
39
|
+
import?: (cwd: string, target: string, entries: readonly FileTreeImportEntry[]) => Promise<void>;
|
|
30
40
|
list(cwd: string): Promise<readonly WorkspaceEntry[]>;
|
|
31
41
|
preferences?: {
|
|
32
42
|
get(): Promise<Partial<WorkspacePreferences>>;
|
|
@@ -36,16 +46,46 @@ type WorkspaceHost = {
|
|
|
36
46
|
rename(cwd: string, source: string, destination: string): Promise<{
|
|
37
47
|
operationId: string;
|
|
38
48
|
}>;
|
|
49
|
+
session?: {
|
|
50
|
+
get(): Promise<WorkspaceSession | null>;
|
|
51
|
+
set(session: WorkspaceSession): Promise<void>;
|
|
52
|
+
};
|
|
39
53
|
undo(cwd: string, operationId: string): Promise<void>;
|
|
40
54
|
watch(cwd: string, changed: (event: WorkspaceChange) => void): VoidFunction | Promise<VoidFunction>;
|
|
41
55
|
write(cwd: string, path: string, content: string): Promise<void>;
|
|
42
56
|
};
|
|
43
57
|
type WorkspacePreferences = {
|
|
58
|
+
autoSave: 'delay' | 'focus' | 'off';
|
|
59
|
+
autoSaveDelay: number;
|
|
44
60
|
explorerOpen: boolean;
|
|
45
61
|
explorerSide: 'left' | 'right';
|
|
62
|
+
keybindings: Readonly<Record<string, Command | null>>;
|
|
46
63
|
showWhitespace: boolean;
|
|
47
64
|
wrapText: boolean;
|
|
48
65
|
};
|
|
66
|
+
type WorkspaceSession = {
|
|
67
|
+
active: string | null;
|
|
68
|
+
explorer: {
|
|
69
|
+
expanded: string[];
|
|
70
|
+
scroll: number;
|
|
71
|
+
};
|
|
72
|
+
tabs: WorkspaceSessionTab[];
|
|
73
|
+
};
|
|
74
|
+
type WorkspaceSessionTab = {
|
|
75
|
+
draft?: string;
|
|
76
|
+
folds: number[];
|
|
77
|
+
path: string;
|
|
78
|
+
pinned: boolean;
|
|
79
|
+
preview: boolean;
|
|
80
|
+
scroll: {
|
|
81
|
+
left: number;
|
|
82
|
+
top: number;
|
|
83
|
+
};
|
|
84
|
+
selection: {
|
|
85
|
+
anchor: number;
|
|
86
|
+
head: number;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
49
89
|
type WorkspaceState = Readonly<{
|
|
50
90
|
active: WorkspaceTab | undefined;
|
|
51
91
|
busy: number;
|
|
@@ -69,10 +109,13 @@ type WorkspaceState = Readonly<{
|
|
|
69
109
|
tabs: readonly WorkspaceTab[];
|
|
70
110
|
}>;
|
|
71
111
|
type WorkspaceTab = {
|
|
112
|
+
readonly compare?: WorkspaceCompare;
|
|
72
113
|
readonly document: EditorDocument;
|
|
73
114
|
readonly id: number;
|
|
74
115
|
missing: boolean;
|
|
75
116
|
path: string;
|
|
117
|
+
pinned: boolean;
|
|
118
|
+
preview: boolean;
|
|
76
119
|
saved: string;
|
|
77
120
|
scroll: {
|
|
78
121
|
left: number;
|
|
@@ -127,22 +170,31 @@ declare class EditorWorkspaceModel {
|
|
|
127
170
|
private tabId;
|
|
128
171
|
private tabs;
|
|
129
172
|
private unwatch;
|
|
173
|
+
private watchers;
|
|
130
174
|
private watchWork;
|
|
131
175
|
constructor(host: WorkspaceHost, cwd?: string, preferences?: Partial<WorkspacePreferences>);
|
|
132
176
|
private applyPreferences;
|
|
133
177
|
private authorize;
|
|
178
|
+
private closeTabs;
|
|
134
179
|
private desire;
|
|
135
180
|
private emit;
|
|
136
181
|
private queue;
|
|
137
182
|
private removeTab;
|
|
138
183
|
get state(): WorkspaceState;
|
|
139
184
|
activate(tab: WorkspaceTab | string): void;
|
|
185
|
+
adopt(path: string, content: string, saved: string, missing?: boolean): WorkspaceTab | undefined;
|
|
140
186
|
close(path?: string | undefined): Promise<boolean>;
|
|
187
|
+
closeOthers(path?: string | undefined): Promise<boolean>;
|
|
188
|
+
closeRight(path?: string | undefined): Promise<boolean>;
|
|
189
|
+
closeSaved(): Promise<boolean>;
|
|
190
|
+
compare(original: string, modified: string): Promise<WorkspaceTab | undefined>;
|
|
141
191
|
copyPath(path: string): Promise<void>;
|
|
142
192
|
delete(paths: readonly string[]): Promise<boolean | undefined>;
|
|
143
193
|
dispose(): void;
|
|
144
|
-
|
|
194
|
+
onWatch(listener: (event: WorkspaceChange) => void): () => void;
|
|
195
|
+
open(value: string, line?: number, column?: number, preview?: boolean): Promise<WorkspaceTab | undefined>;
|
|
145
196
|
openTarget(target?: WorkspaceTarget): Promise<WorkspaceTab | undefined>;
|
|
197
|
+
pin(path: string, pinned?: boolean): void;
|
|
146
198
|
refresh(_paths?: readonly string[]): Promise<void>;
|
|
147
199
|
rename(source: string, destination: string): Promise<boolean | undefined>;
|
|
148
200
|
run(action: WorkspaceAction, paths: readonly string[]): Promise<void>;
|
|
@@ -155,7 +207,8 @@ declare class EditorWorkspaceModel {
|
|
|
155
207
|
stop(): void;
|
|
156
208
|
subscribe(listener: (state: WorkspaceState) => void): () => void;
|
|
157
209
|
undoFiles(): Promise<boolean | undefined>;
|
|
210
|
+
unpin(path: string): void;
|
|
158
211
|
whenIdle(): Promise<void>;
|
|
159
212
|
}
|
|
160
213
|
export { containsPath, DEFAULTS, dirty, EditorWorkspaceModel, workspacePath };
|
|
161
|
-
export type { WorkspaceAction, WorkspaceChange, WorkspaceConfirmation, WorkspaceDecision, WorkspaceEntry, WorkspaceHost, WorkspacePreferences, WorkspaceState, WorkspaceTab, WorkspaceTarget };
|
|
214
|
+
export type { WorkspaceAction, WorkspaceChange, WorkspaceCompare, WorkspaceConfirmation, WorkspaceDecision, WorkspaceEntry, WorkspaceHost, WorkspacePreferences, WorkspaceSession, WorkspaceSessionTab, WorkspaceState, WorkspaceTab, WorkspaceTarget };
|