@esportsplus/ui 0.59.1 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.audit/audit.json +2770 -0
- package/.audit/check-scss.mjs +20 -0
- package/.audit/rules-audit.md +531 -0
- package/README.md +52 -40
- package/RULES.md +145 -0
- package/build/components/accordion/index.d.ts +15 -2174
- package/build/components/accordion/index.js +32 -31
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/announcement/index.d.ts +720 -2164
- package/build/components/announcement/index.js +12 -9
- package/build/components/announcement/scss/index.scss +1 -1
- package/build/components/breadcrumb/index.d.ts +4 -1
- package/build/components/breadcrumb/index.js +57 -69
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/copy.d.ts +4 -11
- package/build/components/button/copy.js +32 -25
- package/build/components/button/faces.d.ts +2 -2
- package/build/components/button/faces.js +9 -11
- package/build/components/button/index.d.ts +3 -7
- package/build/components/button/index.js +3 -5
- package/build/components/button/kbd.d.ts +3 -7
- package/build/components/button/kbd.js +63 -76
- package/build/components/button/morph/index.d.ts +1447 -0
- package/build/components/button/morph/index.js +4 -0
- package/build/components/button/morph/save.d.ts +10 -0
- package/build/components/button/morph/save.js +57 -0
- package/build/components/button/morph/template.d.ts +23 -0
- package/build/components/button/morph/template.js +110 -0
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/sidebar.d.ts +1 -10
- package/build/components/button/sidebar.js +14 -12
- package/build/components/button/split.d.ts +7 -2
- package/build/components/button/split.js +20 -19
- package/build/components/capslock/index.d.ts +1 -10
- package/build/components/capslock/index.js +18 -14
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/cc/index.d.ts +4 -1
- package/build/components/cc/index.js +209 -175
- package/build/components/cc/scss/index.scss +1 -1
- package/build/components/chat/index.d.ts +6 -0
- package/build/components/chat/index.js +3 -0
- package/build/components/chat/minimap/index.d.ts +63 -0
- package/build/components/chat/minimap/index.js +272 -0
- package/build/components/{chat-minimap/range.js → chat/minimap/model.js} +1 -1
- package/build/components/{chat-minimap → chat/minimap}/spy.d.ts +1 -1
- package/build/components/{chat-minimap → chat/minimap}/spy.js +1 -1
- package/build/components/checkbox/group.d.ts +2 -10
- package/build/components/checkbox/group.js +39 -29
- package/build/components/checkbox/index.d.ts +1 -0
- package/build/components/checkbox/index.js +1 -0
- package/build/components/checkbox/options.d.ts +5005 -6441
- package/build/components/checkbox/options.js +72 -45
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/clipboard/index.d.ts +3 -2181
- package/build/components/clipboard/index.js +2 -3
- package/build/components/color-picker/index.d.ts +31 -1
- package/build/components/color-picker/index.js +200 -168
- package/build/components/color-picker/scss/index.scss +1 -1
- package/build/components/command/index.d.ts +6 -93
- package/build/components/command/index.js +4 -601
- package/build/components/command/palette.d.ts +111 -0
- package/build/components/command/palette.js +606 -0
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/command/search.d.ts +19 -0
- package/build/components/command/search.js +68 -0
- package/build/components/container/scss/index.scss +1 -1
- package/build/components/counter/index.d.ts +6 -4
- package/build/components/counter/index.js +36 -32
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/dock/index.d.ts +28 -6
- package/build/components/dock/index.js +433 -55
- package/build/components/dock/scss/index.scss +1 -1
- package/build/components/editor/code/editor.d.ts +1 -10
- package/build/components/editor/code/features.d.ts +3 -3
- package/build/components/editor/code/features.js +65 -52
- package/build/components/editor/code/field.d.ts +1 -1
- package/build/components/editor/code/find.d.ts +4 -4
- package/build/components/editor/code/find.js +39 -37
- package/build/components/editor/code/folding.d.ts +1 -1
- package/build/components/editor/code/goto.d.ts +2 -1
- package/build/components/editor/code/goto.js +7 -7
- package/build/components/editor/code/gutter.js +12 -12
- package/build/components/editor/code/html.d.ts +4 -0
- package/build/components/editor/code/html.js +8 -0
- package/build/components/editor/code/minimap.d.ts +4 -10
- package/build/components/editor/code/minimap.js +18 -13
- package/build/components/editor/code/rows.js +6 -12
- package/build/components/editor/code/search.d.ts +1 -2
- package/build/components/editor/code/search.js +1 -1
- package/build/components/editor/code/services/index.d.ts +1 -1
- package/build/components/editor/code/services/index.js +27 -23
- package/build/components/editor/code/services/model.d.ts +1 -5
- package/build/components/editor/code/services/model.js +1 -1
- package/build/components/editor/code/services/session.d.ts +3 -2
- package/build/components/editor/code/services/session.js +1 -4
- package/build/components/editor/code/syntax.d.ts +1 -1
- package/build/components/editor/code/view.d.ts +2 -1
- package/build/components/editor/code/view.js +50 -39
- package/build/components/editor/diffs/merge.d.ts +1 -10
- package/build/components/editor/diffs/merge.js +126 -102
- package/build/components/editor/diffs/render.d.ts +1 -2
- package/build/components/editor/diffs/render.js +2 -8
- package/build/components/editor/diffs/view.d.ts +1 -10
- package/build/components/editor/diffs/view.js +112 -105
- package/build/components/editor/markdown/editing.d.ts +1 -1
- package/build/components/editor/markdown/erase.js +1 -1
- package/build/components/editor/markdown/format.d.ts +23 -0
- package/build/components/editor/markdown/format.js +319 -0
- package/build/components/editor/markdown/html.d.ts +1 -1
- package/build/components/editor/markdown/index.d.ts +3 -22
- package/build/components/editor/markdown/index.js +3 -30
- package/build/components/editor/markdown/inline.d.ts +1 -1
- package/build/components/editor/markdown/inline.js +6 -5
- package/build/components/editor/markdown/layout.d.ts +1 -3
- package/build/components/editor/markdown/layout.js +1 -1
- package/build/components/editor/markdown/model.d.ts +3 -9
- package/build/components/editor/markdown/model.js +1 -8
- package/build/components/editor/markdown/render.d.ts +2 -1
- package/build/components/editor/markdown/render.js +281 -252
- package/build/components/editor/markdown/template.d.ts +13 -0
- package/build/components/editor/markdown/template.js +30 -0
- package/build/components/editor/markdown/toolbar.d.ts +32 -0
- package/build/components/editor/markdown/toolbar.js +556 -0
- package/build/components/editor/markdown/view.d.ts +12 -1
- package/build/components/editor/markdown/view.js +154 -60
- package/build/components/editor/tree/compact.d.ts +2 -1
- package/build/components/editor/tree/compact.js +12 -11
- package/build/components/editor/tree/drag.d.ts +3 -2
- package/build/components/editor/tree/drag.js +29 -26
- package/build/components/editor/tree/edit.d.ts +1 -1
- package/build/components/editor/tree/edit.js +10 -9
- package/build/components/editor/tree/find.d.ts +1 -1
- package/build/components/editor/tree/find.js +13 -9
- package/build/components/editor/tree/icons.d.ts +1 -1
- package/build/components/editor/tree/icons.js +1 -1
- package/build/components/editor/tree/index.d.ts +3 -116
- package/build/components/editor/tree/index.js +3 -2225
- package/build/components/editor/tree/lazy.d.ts +2 -1
- package/build/components/editor/tree/lazy.js +17 -16
- package/build/components/editor/tree/sticky.d.ts +3 -2
- package/build/components/editor/tree/sticky.js +7 -6
- package/build/components/editor/tree/template.d.ts +117 -0
- package/build/components/editor/tree/template.js +2212 -0
- package/build/components/editor/viewer/index.d.ts +3 -26
- package/build/components/editor/viewer/index.js +3 -249
- package/build/components/editor/viewer/model.js +1 -7
- package/build/components/editor/viewer/template.d.ts +17 -0
- package/build/components/editor/viewer/template.js +258 -0
- package/build/components/editor/workspace/index.d.ts +4 -65
- package/build/components/editor/workspace/index.js +4 -1228
- package/build/components/editor/workspace/model.d.ts +29 -37
- package/build/components/editor/workspace/model.js +186 -155
- package/build/components/editor/workspace/navigate.d.ts +2 -1
- package/build/components/editor/workspace/navigate.js +2 -4
- package/build/components/editor/workspace/session.d.ts +5 -1
- package/build/components/editor/workspace/session.js +71 -39
- package/build/components/editor/workspace/shortcuts.d.ts +0 -2
- package/build/components/editor/workspace/shortcuts.js +39 -35
- package/build/components/editor/workspace/status.d.ts +4 -5
- package/build/components/editor/workspace/status.js +79 -61
- package/build/components/editor/workspace/statusbar.d.ts +7 -4
- package/build/components/editor/workspace/statusbar.js +73 -86
- package/build/components/editor/workspace/strip.d.ts +1 -2
- package/build/components/editor/workspace/strip.js +10 -8
- package/build/components/editor/workspace/tabs.d.ts +35 -3
- package/build/components/editor/workspace/tabs.js +75 -13
- package/build/components/editor/workspace/template.d.ts +57 -0
- package/build/components/editor/workspace/template.js +1150 -0
- package/build/components/error/index.d.ts +1 -10
- package/build/components/error/index.js +64 -32
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/filter/index.js +138 -77
- package/build/components/filter/scss/index.scss +1 -1
- package/build/components/form/action.d.ts +2 -2
- package/build/components/form/action.js +12 -9
- package/build/components/form/index.d.ts +6 -32
- package/build/components/form/index.js +2 -1
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/grid/scss/index.scss +1 -1
- package/build/components/group/index.d.ts +14 -0
- package/build/components/group/index.js +18 -0
- package/build/components/group/scss/index.scss +2 -0
- package/build/components/heatmap/index.d.ts +5 -2
- package/build/components/heatmap/index.js +79 -88
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/index.d.ts +3 -13
- package/build/components/highlight/index.js +95 -92
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/index.d.ts +2 -10
- package/build/components/icon/index.js +12 -10
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/image/index.d.ts +3 -16
- package/build/components/image/index.js +2 -2
- package/build/components/image/lazyload.d.ts +2 -1
- package/build/components/image/lazyload.js +29 -26
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +6 -7
- package/build/components/index.js +6 -7
- package/build/components/inline-edit/index.d.ts +5 -1
- package/build/components/inline-edit/index.js +35 -27
- package/build/components/inline-edit/rich.d.ts +10 -15
- package/build/components/inline-edit/rich.js +82 -1197
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/inline-edit/status.d.ts +3 -2
- package/build/components/inline-edit/status.js +23 -18
- package/build/components/input/field.d.ts +2 -1
- package/build/components/input/field.js +12 -9
- package/build/components/input/scrub.d.ts +4 -1
- package/build/components/input/scrub.js +25 -20
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/input/tag.d.ts +4 -2
- package/build/components/input/tag.js +105 -83
- package/build/components/json/index.d.ts +4 -3
- package/build/components/json/index.js +2 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/loading/index.d.ts +2 -1
- package/build/components/loading/index.js +6 -3
- package/build/components/loading/scss/index.scss +1 -1
- package/build/components/marquee/index.d.ts +2 -1
- package/build/components/marquee/index.js +92 -84
- package/build/components/marquee/scss/index.scss +1 -1
- package/build/components/marquee/velocity.js +4 -3
- package/build/components/metric/flash.d.ts +2 -1
- package/build/components/metric/flash.js +26 -25
- package/build/components/metric/index.d.ts +13 -2
- package/build/components/metric/index.js +60 -56
- package/build/components/metric/scss/index.scss +1 -1
- package/build/components/nav/index.d.ts +1 -1
- package/build/components/nav/scss/index.scss +1 -1
- package/build/components/nav/spy.js +9 -6
- package/build/components/nav/toc.d.ts +4 -18
- package/build/components/nav/toc.js +9 -21
- package/build/components/nav/tree.d.ts +14 -13
- package/build/components/nav/tree.js +80 -65
- package/build/components/notification/index.d.ts +5 -3
- package/build/components/notification/index.js +30 -39
- package/build/components/notification/scss/index.scss +1 -1
- package/build/components/overlay/index.d.ts +4 -5
- package/build/components/overlay/index.js +399 -196
- package/build/components/overlay/popup.d.ts +5 -6
- package/build/components/overlay/popup.js +80 -39
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/page/scss/index.scss +1 -1
- package/build/components/pagination/arrows.d.ts +2 -1
- package/build/components/pagination/arrows.js +48 -45
- package/build/components/pagination/cards.d.ts +5 -1
- package/build/components/pagination/cards.js +70 -47
- package/build/components/pagination/dots.d.ts +3 -1
- package/build/components/pagination/dots.js +29 -24
- package/build/components/pagination/index.d.ts +2 -1
- package/build/components/pagination/index.js +27 -28
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/panels/dnd.d.ts +47 -0
- package/build/components/panels/dnd.js +114 -0
- package/build/components/panels/group.d.ts +36 -0
- package/build/components/panels/group.js +322 -0
- package/build/components/panels/index.d.ts +17 -0
- package/build/components/panels/index.js +524 -0
- package/build/components/panels/model.d.ts +64 -0
- package/build/components/panels/model.js +446 -0
- package/build/components/panels/resize.d.ts +9 -0
- package/build/components/panels/resize.js +123 -0
- package/build/components/panels/scss/index.scss +2 -0
- package/build/components/panels/subtree.d.ts +4 -0
- package/build/components/panels/subtree.js +44 -0
- package/build/components/preview/buttons.d.ts +12 -0
- package/build/components/preview/buttons.js +26 -0
- package/build/components/preview/code.d.ts +8 -0
- package/build/components/preview/code.js +18 -0
- package/build/components/preview/header.d.ts +8 -0
- package/build/components/preview/header.js +21 -0
- package/build/components/preview/index.d.ts +37 -0
- package/build/components/preview/index.js +123 -0
- package/build/components/preview/scss/index.scss +2 -0
- package/build/components/preview/source.d.ts +12 -0
- package/build/components/preview/source.js +79 -0
- package/build/components/preview/stage.d.ts +8 -0
- package/build/components/preview/stage.js +28 -0
- package/build/components/progress/index.d.ts +2 -1
- package/build/components/progress/index.js +30 -26
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/progress/text.d.ts +2 -1
- package/build/components/progress/text.js +30 -30
- package/build/components/radio/index.d.ts +3 -2
- package/build/components/radio/index.js +2 -2
- package/build/components/range/filter.d.ts +2 -1
- package/build/components/range/filter.js +130 -132
- package/build/components/range/index.d.ts +2 -1
- package/build/components/range/index.js +17 -22
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/relative-time/index.d.ts +3 -1
- package/build/components/relative-time/index.js +60 -48
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/select/expand.d.ts +44 -0
- package/build/components/select/expand.js +215 -0
- package/build/components/select/index.d.ts +19 -10
- package/build/components/select/index.js +130 -90
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/shell/index.d.ts +23 -0
- package/build/components/shell/index.js +290 -0
- package/build/components/shell/scss/index.scss +2 -0
- package/build/components/shortcut-recorder/index.d.ts +2 -3
- package/build/components/shortcut-recorder/index.js +49 -44
- package/build/components/shortcut-recorder/scss/index.scss +1 -1
- package/build/components/sortable/index.d.ts +2 -714
- package/build/components/sortable/index.js +75 -64
- package/build/components/sortable/scss/index.scss +1 -1
- package/build/components/story/index.d.ts +3 -5
- package/build/components/story/index.js +122 -84
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/engine.js +51 -53
- package/build/components/surface-field/index.d.ts +2180 -2921
- package/build/components/surface-field/index.js +52 -51
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/surface-field/surface.d.ts +1 -10
- package/build/components/surface-field/surface.js +42 -36
- package/build/components/switch/index.d.ts +3 -2
- package/build/components/switch/index.js +2 -2
- package/build/components/tasklist/index.d.ts +8 -1
- package/build/components/tasklist/index.js +66 -47
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/textarea/index.d.ts +722 -2170
- package/build/components/textarea/index.js +67 -91
- package/build/components/textarea/scss/index.scss +1 -1
- package/build/components/theme/cards.d.ts +4 -0
- package/build/components/theme/cards.js +21 -0
- package/build/components/theme/index.d.ts +17 -4
- package/build/components/theme/index.js +40 -15
- package/build/components/theme/reveal.d.ts +6 -0
- package/build/components/theme/reveal.js +100 -0
- package/build/components/theme/scss/index.scss +1 -1
- package/build/components/theme/shared.d.ts +26 -0
- package/build/components/theme/shared.js +26 -0
- package/build/components/theme/swatches.d.ts +4 -0
- package/build/components/theme/swatches.js +21 -0
- package/build/components/theme/toggle.d.ts +15 -0
- package/build/components/theme/toggle.js +33 -0
- package/build/components/toast/index.d.ts +6 -2
- package/build/components/toast/index.js +68 -56
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/tooltip/menu.d.ts +12 -2
- package/build/components/tooltip/menu.js +234 -176
- package/build/components/tooltip/onclick.d.ts +1 -10
- package/build/components/tooltip/onclick.js +25 -27
- package/build/components/tooltip/onhover.d.ts +8 -709
- package/build/components/tooltip/onhover.js +60 -60
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/tooltip/shared.d.ts +5 -3
- package/build/components/tooltip/shared.js +201 -91
- package/build/components/tooltip/utilities.d.ts +10 -4
- package/build/components/tooltip/utilities.js +95 -18
- package/build/components/typewriter/index.d.ts +2855 -1413
- package/build/components/typewriter/index.js +17 -18
- package/build/components/typewriter/retype.d.ts +2 -1
- package/build/components/typewriter/retype.js +21 -18
- package/build/components/typewriter/rotate.d.ts +2 -1
- package/build/components/typewriter/rotate.js +41 -45
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/index.d.ts +2 -1
- package/build/components/uptime/index.js +51 -54
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/index.d.ts +719 -2161
- package/build/components/usage-meter/index.js +23 -20
- package/build/components/usage-meter/scss/index.scss +1 -1
- package/build/modifiers/background/scss/index.scss +2 -0
- package/build/modifiers/border/scss/index.scss +2 -0
- package/build/modifiers/box-shadow/scss/index.scss +2 -0
- package/build/modifiers/color/scss/index.scss +2 -0
- package/build/modifiers/disabled/scss/index.scss +2 -0
- package/build/modifiers/glass/index.d.ts +3 -2
- package/build/modifiers/glass/index.js +7 -7
- package/build/modifiers/glass/scss/index.scss +1 -1
- package/build/modifiers/scrollbar/index.d.ts +13 -13
- package/build/modifiers/scrollbar/index.js +74 -90
- package/build/modifiers/scrollbar/scss/index.scss +1 -1
- package/build/shared/animation.d.ts +1 -1
- package/build/shared/animation.js +6 -4
- package/build/shared/dispatch.d.ts +7 -0
- package/build/shared/dispatch.js +25 -0
- package/build/shared/drag.d.ts +4 -5
- package/build/shared/drag.js +4 -3
- package/build/shared/press.d.ts +1 -1
- package/build/shared/press.js +5 -3
- package/build/shared/resize.js +2 -25
- package/build/shared/transition.d.ts +1 -1
- package/build/shared/transition.js +2 -2
- package/build/shared/visible.js +1 -24
- package/package.json +10 -11
- package/scripts/code-editor-services.test.mjs +1 -1
- package/scripts/code-editor-workspace.test.mjs +28 -18
- package/scripts/panels.test.mjs +262 -0
- package/scripts/workspace-keybindings.test.mjs +1 -1
- package/scripts/workspace-session.test.mjs +8 -6
- package/scripts/workspace-status.test.mjs +9 -1
- package/scripts/workspace-tabs.test.mjs +5 -5
- package/src/components/accordion/index.ts +13 -12
- package/src/components/accordion/scss/index.scss +16 -13
- package/src/components/accordion/scss/variables.scss +13 -10
- package/src/components/announcement/scss/index.scss +16 -24
- package/src/components/announcement/scss/variables.scss +20 -10
- package/src/components/breadcrumb/index.ts +11 -13
- package/src/components/breadcrumb/scss/index.scss +52 -126
- package/src/components/breadcrumb/scss/variables.scss +64 -53
- package/src/components/button/copy.ts +35 -28
- package/src/components/button/faces.ts +2 -4
- package/src/components/button/index.ts +3 -7
- package/src/components/button/kbd.ts +42 -99
- package/src/components/button/morph/index.ts +6 -0
- package/src/components/button/morph/save.ts +55 -0
- package/src/components/button/morph/template.ts +133 -0
- package/src/components/button/scss/index.scss +263 -119
- package/src/components/button/scss/variables.scss +180 -120
- package/src/components/button/sidebar.ts +7 -7
- package/src/components/button/split.ts +11 -13
- package/src/components/capslock/index.ts +11 -10
- package/src/components/capslock/scss/index.scss +24 -26
- package/src/components/capslock/scss/variables.scss +32 -14
- package/src/components/card/scss/index.scss +12 -36
- package/src/components/card/scss/variables.scss +33 -76
- package/src/components/cc/index.ts +46 -42
- package/src/components/cc/scss/index.scss +142 -155
- package/src/components/cc/scss/variables.scss +234 -44
- package/src/components/chat/index.ts +10 -0
- package/src/components/{chat-minimap → chat/minimap}/index.ts +74 -28
- package/src/components/chat/minimap/scss/index.scss +111 -0
- package/src/components/chat/minimap/scss/variables.scss +182 -0
- package/src/components/{chat-minimap → chat/minimap}/spy.ts +1 -1
- package/src/components/checkbox/group.ts +5 -5
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/checkbox/options.ts +2 -3
- package/src/components/checkbox/scss/index.scss +33 -35
- package/src/components/checkbox/scss/variables.scss +102 -56
- package/src/components/clipboard/index.ts +4 -3
- package/src/components/clipboard/write.ts +2 -1
- package/src/components/color-picker/index.ts +131 -69
- package/src/components/color-picker/scss/index.scss +138 -221
- package/src/components/color-picker/scss/variables.scss +205 -73
- package/src/components/command/index.ts +5 -860
- package/src/components/command/palette.ts +865 -0
- package/src/components/command/scss/index.scss +77 -99
- package/src/components/command/scss/variables.scss +129 -50
- package/src/components/command/search.ts +62 -0
- package/src/components/container/scss/index.scss +2 -4
- package/src/components/container/scss/variables.scss +0 -2
- package/src/components/counter/index.ts +91 -85
- package/src/components/counter/scss/index.scss +33 -41
- package/src/components/counter/scss/variables.scss +41 -19
- package/src/components/dock/index.ts +514 -42
- package/src/components/dock/scss/index.scss +288 -73
- package/src/components/dock/scss/variables.scss +301 -39
- package/src/components/editor/code/features.ts +4 -6
- package/src/components/editor/code/field.ts +1 -1
- package/src/components/editor/code/find.ts +1 -2
- package/src/components/editor/code/folding.ts +1 -1
- package/src/components/editor/code/html.ts +17 -0
- package/src/components/editor/code/keymap.ts +0 -1
- package/src/components/editor/code/minimap.ts +7 -5
- package/src/components/editor/code/rows.ts +1 -14
- package/src/components/editor/code/scss/_editor.scss +22 -54
- package/src/components/editor/code/scss/_features.scss +28 -70
- package/src/components/editor/code/scss/_minimap.scss +29 -0
- package/src/components/editor/code/scss/_services.scss +19 -30
- package/src/components/editor/code/scss/index.scss +1 -2
- package/src/components/editor/code/scss/variables.scss +217 -56
- package/src/components/editor/code/search.ts +1 -1
- package/src/components/editor/code/services/completion.ts +1 -0
- package/src/components/editor/code/services/hover.ts +1 -0
- package/src/components/editor/code/services/index.ts +1 -1
- package/src/components/editor/code/services/model.ts +1 -1
- package/src/components/editor/code/services/session.ts +1 -4
- package/src/components/editor/code/syntax.ts +1 -1
- package/src/components/editor/code/view.ts +0 -1
- package/src/components/editor/diffs/merge.ts +3 -3
- package/src/components/editor/diffs/render.ts +2 -17
- package/src/components/editor/diffs/scss/_diffs.scss +41 -129
- package/src/components/editor/diffs/scss/_merge.scss +9 -41
- package/src/components/editor/diffs/scss/index.scss +1 -1
- package/src/components/editor/diffs/scss/variables.scss +141 -13
- package/src/components/editor/diffs/view.ts +4 -5
- package/src/components/editor/markdown/editing.ts +1 -1
- package/src/components/editor/markdown/erase.ts +3 -3
- package/src/components/editor/markdown/format.ts +517 -0
- package/src/components/editor/markdown/html.ts +1 -1
- package/src/components/editor/markdown/index.ts +3 -67
- package/src/components/editor/markdown/inline.ts +9 -6
- package/src/components/editor/markdown/layout.ts +1 -1
- package/src/components/editor/markdown/model.ts +2 -17
- package/src/components/editor/markdown/render.ts +6 -8
- package/src/components/editor/markdown/scss/index.scss +157 -100
- package/src/components/editor/markdown/scss/variables.scss +241 -36
- package/src/components/editor/markdown/template.ts +69 -0
- package/src/components/editor/markdown/toolbar.ts +628 -0
- package/src/components/editor/markdown/view.ts +121 -10
- package/src/components/editor/tree/drag.ts +19 -15
- package/src/components/editor/tree/find.ts +5 -4
- package/src/components/editor/tree/icons.ts +1 -1
- package/src/components/editor/tree/index.ts +3 -3434
- package/src/components/editor/tree/scss/index.scss +261 -294
- package/src/components/editor/tree/scss/variables.scss +263 -65
- package/src/components/editor/tree/sticky.ts +1 -1
- package/src/components/editor/tree/template.ts +3436 -0
- package/src/components/editor/viewer/index.ts +3 -318
- package/src/components/editor/viewer/model.ts +1 -14
- package/src/components/editor/viewer/scss/_viewer.scss +31 -97
- package/src/components/editor/viewer/scss/variables.scss +56 -16
- package/src/components/editor/viewer/template.ts +323 -0
- package/src/components/editor/workspace/index.ts +4 -1480
- package/src/components/editor/workspace/model.ts +225 -185
- package/src/components/editor/workspace/navigate.ts +3 -6
- package/src/components/editor/workspace/scss/_keybindings.scss +165 -0
- package/src/components/editor/workspace/scss/_status.scss +65 -0
- package/src/components/editor/workspace/scss/_tabs.scss +60 -0
- package/src/components/editor/workspace/scss/index.scss +105 -330
- package/src/components/editor/workspace/scss/variables.scss +431 -0
- package/src/components/editor/workspace/session.ts +96 -53
- package/src/components/editor/workspace/shortcuts.ts +0 -2
- package/src/components/editor/workspace/status.ts +110 -80
- package/src/components/editor/workspace/statusbar.ts +38 -35
- package/src/components/editor/workspace/strip.ts +6 -5
- package/src/components/editor/workspace/tabs.ts +115 -15
- package/src/components/editor/workspace/template.ts +1477 -0
- package/src/components/error/index.ts +36 -15
- package/src/components/error/scss/index.scss +35 -64
- package/src/components/error/scss/variables.scss +29 -9
- package/src/components/filter/index.ts +147 -104
- package/src/components/filter/scss/index.scss +9 -2
- package/src/components/filter/scss/variables.scss +6 -6
- package/src/components/form/action.ts +1 -1
- package/src/components/form/index.ts +4 -1
- package/src/components/frame/scss/index.scss +37 -44
- package/src/components/frame/scss/variables.scss +31 -19
- package/src/components/grid/scss/index.scss +3 -2
- package/src/components/grid/scss/variables.scss +1 -1
- package/src/components/group/index.ts +24 -0
- package/src/components/group/scss/index.scss +6 -0
- package/src/components/group/scss/variables.scss +4 -0
- package/src/components/heatmap/index.ts +16 -46
- package/src/components/heatmap/scss/index.scss +48 -49
- package/src/components/heatmap/scss/variables.scss +74 -51
- package/src/components/highlight/index.ts +133 -120
- package/src/components/highlight/scss/index.scss +43 -45
- package/src/components/highlight/scss/variables.scss +70 -31
- package/src/components/icon/index.ts +7 -9
- package/src/components/icon/scss/index.scss +9 -2
- package/src/components/icon/scss/variables.scss +2 -0
- package/src/components/image/index.ts +4 -2
- package/src/components/image/lazyload.ts +1 -1
- package/src/components/image/scss/index.scss +18 -25
- package/src/components/image/scss/variables.scss +31 -12
- package/src/components/index.ts +6 -7
- package/src/components/inline-edit/index.ts +9 -7
- package/src/components/inline-edit/rich.ts +88 -1401
- package/src/components/inline-edit/scss/index.scss +125 -381
- package/src/components/inline-edit/scss/variables.scss +153 -92
- package/src/components/inline-edit/status.ts +8 -4
- package/src/components/input/field.ts +2 -2
- package/src/components/input/scrub.ts +1 -5
- package/src/components/input/scss/_field.scss +1 -1
- package/src/components/input/scss/_scrub.scss +21 -25
- package/src/components/input/scss/_tag.scss +28 -46
- package/src/components/input/scss/index.scss +1 -2
- package/src/components/input/scss/variables.scss +160 -77
- package/src/components/input/tag.ts +65 -56
- package/src/components/json/download.ts +2 -1
- package/src/components/json/index.ts +4 -1
- package/src/components/link/scss/index.scss +1 -5
- package/src/components/link/scss/variables.scss +5 -1
- package/src/components/loading/index.ts +1 -1
- package/src/components/loading/scss/index.scss +7 -27
- package/src/components/loading/scss/variables.scss +7 -10
- package/src/components/marquee/index.ts +36 -31
- package/src/components/marquee/scss/index.scss +37 -29
- package/src/components/marquee/scss/variables.scss +35 -24
- package/src/components/marquee/velocity.ts +7 -3
- package/src/components/metric/flash.ts +3 -2
- package/src/components/metric/index.ts +5 -13
- package/src/components/metric/scss/_flash.scss +129 -144
- package/src/components/metric/scss/index.scss +38 -48
- package/src/components/metric/scss/variables.scss +196 -102
- package/src/components/nav/index.ts +1 -1
- package/src/components/nav/scss/index.scss +47 -49
- package/src/components/nav/scss/variables.scss +59 -64
- package/src/components/nav/spy.ts +15 -6
- package/src/components/nav/toc.ts +11 -31
- package/src/components/nav/tree.ts +77 -47
- package/src/components/notification/index.ts +115 -89
- package/src/components/notification/scss/index.scss +91 -75
- package/src/components/notification/scss/variables.scss +55 -38
- package/src/components/overlay/index.ts +211 -139
- package/src/components/overlay/popup.ts +89 -52
- package/src/components/overlay/scss/index.scss +152 -189
- package/src/components/overlay/scss/variables.scss +54 -23
- package/src/components/page/scss/variables.scss +1 -1
- package/src/components/pagination/cards.ts +1 -1
- package/src/components/pagination/index.ts +1 -7
- package/src/components/pagination/scss/index.scss +191 -7
- package/src/components/pagination/scss/variables.scss +128 -40
- package/src/components/panels/dnd.ts +190 -0
- package/src/components/panels/group.ts +429 -0
- package/src/components/panels/index.ts +676 -0
- package/src/components/panels/model.ts +675 -0
- package/src/components/panels/resize.ts +157 -0
- package/src/components/panels/scss/index.scss +379 -0
- package/src/components/panels/scss/variables.scss +197 -0
- package/src/components/panels/subtree.ts +65 -0
- package/src/components/preview/buttons.ts +48 -0
- package/src/components/preview/code.ts +28 -0
- package/src/components/preview/header.ts +23 -0
- package/src/components/preview/index.ts +149 -0
- package/src/components/preview/scss/index.scss +158 -0
- package/src/components/preview/scss/variables.scss +149 -0
- package/src/components/preview/source.ts +73 -0
- package/src/components/preview/stage.ts +33 -0
- package/src/components/progress/scss/index.scss +120 -15
- package/src/components/progress/scss/variables.scss +144 -41
- package/src/components/progress/text.ts +11 -9
- package/src/components/radio/index.ts +2 -4
- package/src/components/range/filter.ts +16 -22
- package/src/components/range/index.ts +2 -9
- package/src/components/range/scss/_filter.scss +300 -325
- package/src/components/range/scss/_slider.scss +32 -110
- package/src/components/range/scss/_vertical.scss +8 -20
- package/src/components/range/scss/index.scss +1 -4
- package/src/components/range/scss/variables.scss +361 -71
- package/src/components/relative-time/index.ts +22 -28
- package/src/components/relative-time/scss/index.scss +17 -21
- package/src/components/relative-time/scss/variables.scss +51 -30
- package/src/components/root/scss/index.scss +14 -20
- package/src/components/root/scss/variables.scss +24 -22
- package/src/components/select/expand.ts +272 -0
- package/src/components/select/index.ts +155 -110
- package/src/components/select/scss/index.scss +99 -54
- package/src/components/select/scss/variables.scss +141 -19
- package/src/components/shell/index.ts +344 -0
- package/src/components/shell/scss/index.scss +201 -0
- package/src/components/shell/scss/variables.scss +89 -0
- package/src/components/shortcut-recorder/index.ts +20 -20
- package/src/components/shortcut-recorder/scss/index.scss +78 -58
- package/src/components/shortcut-recorder/scss/variables.scss +48 -25
- package/src/components/sortable/index.ts +25 -27
- package/src/components/sortable/scss/index.scss +59 -63
- package/src/components/sortable/scss/variables.scss +81 -52
- package/src/components/story/index.ts +111 -83
- package/src/components/story/scss/index.scss +26 -107
- package/src/components/story/scss/variables.scss +52 -22
- package/src/components/surface-field/engine.ts +71 -72
- package/src/components/surface-field/index.ts +32 -37
- package/src/components/surface-field/scss/index.scss +36 -52
- package/src/components/surface-field/scss/variables.scss +89 -23
- package/src/components/surface-field/surface.ts +4 -3
- package/src/components/switch/index.ts +2 -4
- package/src/components/tasklist/index.ts +9 -8
- package/src/components/tasklist/scss/index.scss +28 -32
- package/src/components/tasklist/scss/variables.scss +31 -32
- package/src/components/textarea/index.ts +50 -91
- package/src/components/textarea/scss/index.scss +28 -21
- package/src/components/textarea/scss/variables.scss +17 -2
- package/src/components/theme/cards.ts +19 -0
- package/src/components/theme/index.ts +68 -19
- package/src/components/theme/reveal.ts +190 -0
- package/src/components/theme/scss/index.scss +122 -0
- package/src/components/theme/scss/variables.scss +155 -16
- package/src/components/theme/shared.ts +57 -0
- package/src/components/theme/swatches.ts +15 -0
- package/src/components/theme/toggle.ts +47 -0
- package/src/components/toast/index.ts +16 -17
- package/src/components/toast/scss/index.scss +193 -155
- package/src/components/toast/scss/variables.scss +195 -53
- package/src/components/tooltip/menu.ts +194 -117
- package/src/components/tooltip/onclick.ts +16 -21
- package/src/components/tooltip/onhover.ts +5 -8
- package/src/components/tooltip/scss/index.scss +561 -85
- package/src/components/tooltip/scss/variables.scss +243 -72
- package/src/components/tooltip/shared.ts +129 -85
- package/src/components/tooltip/utilities.ts +75 -24
- package/src/components/typewriter/index.ts +7 -10
- package/src/components/typewriter/rotate.ts +26 -31
- package/src/components/typewriter/scss/index.scss +133 -3
- package/src/components/typewriter/scss/variables.scss +56 -44
- package/src/components/uptime/index.ts +13 -19
- package/src/components/uptime/scss/index.scss +99 -126
- package/src/components/uptime/scss/variables.scss +101 -55
- package/src/components/usage-meter/index.ts +1 -1
- package/src/components/usage-meter/scss/index.scss +19 -22
- package/src/components/usage-meter/scss/variables.scss +80 -36
- package/src/css-utilities/absolute.scss +54 -52
- package/src/css-utilities/background.scss +29 -23
- package/src/css-utilities/border.scss +24 -21
- package/src/css-utilities/box-shadow.scss +33 -21
- package/src/css-utilities/color.scss +34 -22
- package/src/css-utilities/disabled.scss +12 -0
- package/src/css-utilities/flex.scss +55 -53
- package/src/css-utilities/font/geist/index.scss +2 -1
- package/src/css-utilities/font/montserrat/index.scss +1 -1
- package/src/css-utilities/group.scss +6 -0
- package/src/css-utilities/hidden.scss +22 -20
- package/src/css-utilities/icon.scss +33 -30
- package/src/css-utilities/layer.scss +12 -11
- package/src/css-utilities/reset.scss +27 -16
- package/src/css-utilities/skeleton.scss +4 -1
- package/src/css-utilities/surface.scss +217 -150
- package/src/css-utilities/text.scss +115 -115
- package/src/modifiers/background/scss/index.scss +1 -0
- package/src/modifiers/background/scss/variables.scss +22 -0
- package/src/modifiers/border/scss/index.scss +1 -0
- package/src/modifiers/border/scss/variables.scss +19 -0
- package/src/modifiers/box-shadow/scss/index.scss +1 -0
- package/src/modifiers/box-shadow/scss/variables.scss +12 -0
- package/src/modifiers/color/scss/index.scss +1 -0
- package/src/modifiers/color/scss/variables.scss +10 -0
- package/src/modifiers/disabled/scss/index.scss +5 -0
- package/src/modifiers/glass/index.ts +2 -1
- package/src/modifiers/glass/scss/index.scss +8 -11
- package/src/modifiers/glass/scss/variables.scss +1 -0
- package/src/modifiers/scrollbar/index.ts +94 -113
- package/src/modifiers/scrollbar/scss/index.scss +23 -4
- package/src/modifiers/scrollbar/scss/variables.scss +6 -5
- package/src/normalize/scss/index.scss +1 -0
- package/src/shared/anchor.ts +1 -1
- package/src/shared/animation.ts +9 -7
- package/src/shared/dispatch.ts +42 -0
- package/src/shared/drag.ts +10 -4
- package/src/shared/press.ts +7 -5
- package/src/shared/resize.ts +4 -35
- package/src/shared/scss/list.scss +1 -2
- package/src/shared/transition.ts +2 -2
- package/src/shared/visible.ts +3 -35
- package/src/tokens/scss/color.scss +50 -38
- package/src/tokens/scss/focus.scss +5 -0
- package/src/tokens/scss/font-size.scss +1 -2
- package/src/tokens/scss/index.scss +1 -1
- package/src/tokens/scss/scale.scss +4 -8
- package/src/tokens/scss/size.scss +3 -3
- package/src/tokens/scss/spacer.scss +1 -1
- package/src/tokens/scss/state.scss +25 -29
- package/storage/svg/code.svg +1 -1
- package/storage/svg/collapse.svg +1 -0
- package/storage/svg/grid.svg +1 -0
- package/storage/svg/stack.svg +1 -0
- package/vite-env.d.ts +1 -1
- package/vite.config.ts +10 -8
- package/build/components/banner/scss/index.scss +0 -2
- package/build/components/button/fan.d.ts +0 -24
- package/build/components/button/fan.js +0 -118
- package/build/components/button/hold.d.ts +0 -31
- package/build/components/button/hold.js +0 -115
- package/build/components/button/icons.d.ts +0 -6
- package/build/components/button/icons.js +0 -35
- package/build/components/button/loading.d.ts +0 -22
- package/build/components/button/loading.js +0 -60
- package/build/components/button/morph.d.ts +0 -22
- package/build/components/button/morph.js +0 -115
- package/build/components/card/expand.d.ts +0 -22
- package/build/components/card/expand.js +0 -118
- package/build/components/card/index.d.ts +0 -6
- package/build/components/card/index.js +0 -4
- package/build/components/chat-minimap/index.d.ts +0 -28
- package/build/components/chat-minimap/index.js +0 -223
- package/build/components/chat-minimap/scss/index.scss +0 -2
- package/build/components/clipboard/copy.d.ts +0 -27
- package/build/components/clipboard/copy.js +0 -48
- package/build/components/copy/index.d.ts +0 -23
- package/build/components/copy/index.js +0 -61
- package/build/components/copy/scss/index.scss +0 -2
- package/build/components/datalist/index.d.ts +0 -42
- package/build/components/datalist/index.js +0 -186
- package/build/components/datalist/scss/index.scss +0 -2
- package/build/components/highlight/easing.d.ts +0 -2
- package/build/components/highlight/easing.js +0 -19
- package/build/components/inline-edit/format.d.ts +0 -29
- package/build/components/inline-edit/format.js +0 -112
- package/build/components/inline-edit/history.d.ts +0 -14
- package/build/components/inline-edit/history.js +0 -40
- package/build/components/inline-edit/markdown.d.ts +0 -7
- package/build/components/inline-edit/markdown.js +0 -314
- package/build/components/inline-edit/model.d.ts +0 -61
- package/build/components/inline-edit/model.js +0 -192
- package/build/components/inline-edit/selection.d.ts +0 -7
- package/build/components/inline-edit/selection.js +0 -114
- package/build/components/inline-edit/utilities.d.ts +0 -4
- package/build/components/inline-edit/utilities.js +0 -12
- package/build/components/pull-to-refresh/index.d.ts +0 -18
- package/build/components/pull-to-refresh/index.js +0 -222
- package/build/components/pull-to-refresh/scss/index.scss +0 -2
- package/build/components/sticky-header/index.d.ts +0 -2166
- package/build/components/sticky-header/index.js +0 -58
- package/build/components/sticky-header/scss/index.scss +0 -2
- package/build/components/theme-picker/index.d.ts +0 -52
- package/build/components/theme-picker/index.js +0 -167
- package/build/components/theme-picker/scss/index.scss +0 -2
- package/src/components/banner/scss/index.scss +0 -37
- package/src/components/banner/scss/variables.scss +0 -16
- package/src/components/button/fan.ts +0 -170
- package/src/components/button/hold.ts +0 -154
- package/src/components/button/icons.ts +0 -21
- package/src/components/button/loading.ts +0 -77
- package/src/components/button/morph.ts +0 -153
- package/src/components/button/scss/_fan.scss +0 -121
- package/src/components/button/scss/_kbd.scss +0 -11
- package/src/components/button/scss/_morph.scss +0 -107
- package/src/components/button/scss/_sidebar.scss +0 -61
- package/src/components/button/scss/_split.scss +0 -53
- package/src/components/card/expand.ts +0 -141
- package/src/components/card/index.ts +0 -8
- package/src/components/card/scss/_expand.scss +0 -234
- package/src/components/chat-minimap/scss/index.scss +0 -148
- package/src/components/chat-minimap/scss/variables.scss +0 -97
- package/src/components/clipboard/copy.ts +0 -49
- package/src/components/copy/index.ts +0 -69
- package/src/components/copy/scss/index.scss +0 -52
- package/src/components/copy/scss/variables.scss +0 -19
- package/src/components/datalist/index.ts +0 -256
- package/src/components/datalist/scss/index.scss +0 -104
- package/src/components/datalist/scss/variables.scss +0 -33
- package/src/components/editor/workspace/scss/keybindings.scss +0 -190
- package/src/components/editor/workspace/scss/status.scss +0 -122
- package/src/components/editor/workspace/scss/tabs.scss +0 -56
- package/src/components/highlight/easing.ts +0 -33
- package/src/components/inline-edit/format.ts +0 -183
- package/src/components/inline-edit/history.ts +0 -71
- package/src/components/inline-edit/markdown.ts +0 -485
- package/src/components/inline-edit/model.ts +0 -366
- package/src/components/inline-edit/selection.ts +0 -188
- package/src/components/inline-edit/utilities.ts +0 -18
- package/src/components/pagination/scss/_arrows.scss +0 -69
- package/src/components/pagination/scss/_cards.scss +0 -121
- package/src/components/pagination/scss/_dots.scss +0 -64
- package/src/components/progress/scss/_text.scss +0 -135
- package/src/components/pull-to-refresh/index.ts +0 -316
- package/src/components/pull-to-refresh/scss/index.scss +0 -128
- package/src/components/pull-to-refresh/scss/variables.scss +0 -38
- package/src/components/sticky-header/index.ts +0 -78
- package/src/components/sticky-header/scss/index.scss +0 -140
- package/src/components/sticky-header/scss/variables.scss +0 -46
- package/src/components/theme-picker/index.ts +0 -231
- package/src/components/theme-picker/scss/index.scss +0 -264
- package/src/components/tooltip/scss/_center.scss +0 -9
- package/src/components/tooltip/scss/_east.scss +0 -33
- package/src/components/tooltip/scss/_menu.scss +0 -367
- package/src/components/tooltip/scss/_north.scss +0 -33
- package/src/components/tooltip/scss/_shared.scss +0 -109
- package/src/components/tooltip/scss/_south.scss +0 -33
- package/src/components/tooltip/scss/_west.scss +0 -33
- package/src/components/typewriter/scss/_caret.scss +0 -34
- package/src/components/typewriter/scss/_retype.scss +0 -68
- package/src/components/typewriter/scss/_rotate.scss +0 -29
- package/src/tokens/scss/transition.scss +0 -21
- /package/build/components/{chat-minimap/range.d.ts → chat/minimap/model.d.ts} +0 -0
- /package/src/components/{chat-minimap/range.ts → chat/minimap/model.ts} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
|
-
import { flush } from '@esportsplus/reactivity';
|
|
2
|
+
import { flush, untrack } from '@esportsplus/reactivity';
|
|
3
3
|
import * as template_u1 from '@esportsplus/template';
|
|
4
|
+
import tooltip from '../../tooltip/index.js';
|
|
4
5
|
import scrollbar from '../../../modifiers/scrollbar/index.js';
|
|
5
6
|
import { clamp } from '../../../shared/clamp.js';
|
|
6
7
|
import { mac } from '../../../shared/platform.js';
|
|
@@ -20,18 +21,20 @@ import { NativeText } from '../code/projection.js';
|
|
|
20
21
|
import { syntaxCache } from '../code/syntax.js';
|
|
21
22
|
import { markdownCommand } from './editing.js';
|
|
22
23
|
import { reach, widen } from './erase.js';
|
|
24
|
+
import { clearFormats, formatsAt, setBlockKind, setLink, toggleMark } from './format.js';
|
|
23
25
|
import { parseInline } from './inline.js';
|
|
24
26
|
import { arrange, cache, MarkdownLayout, unitStart } from './layout.js';
|
|
25
27
|
import { blockAt, contentEnd, markdownBackspace, markdownReferences, parseMarkdown, quotePrefix, reparse, toggleTask } from './model.js';
|
|
26
28
|
import { renderer } from './render.js';
|
|
27
29
|
import { foldable, foldAt, markdownFolds } from './structure.js';
|
|
28
|
-
import
|
|
29
|
-
const template_1ayo7z94 = template_u1.template(`<div
|
|
30
|
-
const template_1ayo7z9g = template_u1.template(`<div
|
|
31
|
-
const
|
|
30
|
+
import { toolbar } from './toolbar.js';
|
|
31
|
+
const template_1ayo7z94 = template_u1.template(`<div><!--$--><!--$--><div><div><div aria-hidden='true' class='markdown-editor-overlay'></div><div></div></div><!--$--><span aria-hidden='true'>0000000000000000000000000000000000000000000000000000000000000000</span></div><span class='markdown-editor-help'>Press Escape then Tab to move focus out of the editor.</span><!--$-->`, true);
|
|
32
|
+
const template_1ayo7z9g = template_u1.template(`<div>`, true);
|
|
33
|
+
const template_1ayo7z9i = template_u1.template(`<div aria-hidden='true' contenteditable='false'>`, true);
|
|
32
34
|
class ReactiveObject_1ayo7z90 extends reactivity_u0.ReactiveObject {
|
|
33
35
|
#empty;
|
|
34
36
|
#fold = this[reactivity_u0.SIGNAL](false);
|
|
37
|
+
#inline = this[reactivity_u0.SIGNAL](false);
|
|
35
38
|
#label = this[reactivity_u0.SIGNAL]('Markdown editor');
|
|
36
39
|
#linking = this[reactivity_u0.SIGNAL](false);
|
|
37
40
|
#minimap = this[reactivity_u0.SIGNAL](false);
|
|
@@ -39,6 +42,7 @@ class ReactiveObject_1ayo7z90 extends reactivity_u0.ReactiveObject {
|
|
|
39
42
|
#readonly = this[reactivity_u0.SIGNAL](false);
|
|
40
43
|
#spellcheck = this[reactivity_u0.SIGNAL](true);
|
|
41
44
|
#tabSize = this[reactivity_u0.SIGNAL](4);
|
|
45
|
+
#tools = this[reactivity_u0.SIGNAL]('');
|
|
42
46
|
#wrap = this[reactivity_u0.SIGNAL](true);
|
|
43
47
|
constructor(_p0) {
|
|
44
48
|
super(null);
|
|
@@ -56,53 +60,65 @@ class ReactiveObject_1ayo7z90 extends reactivity_u0.ReactiveObject {
|
|
|
56
60
|
set fold(_v1) {
|
|
57
61
|
reactivity_u0.write(this.#fold, _v1);
|
|
58
62
|
}
|
|
63
|
+
get inline() {
|
|
64
|
+
return reactivity_u0.read(this.#inline);
|
|
65
|
+
}
|
|
66
|
+
set inline(_v2) {
|
|
67
|
+
reactivity_u0.write(this.#inline, _v2);
|
|
68
|
+
}
|
|
59
69
|
get label() {
|
|
60
70
|
return reactivity_u0.read(this.#label);
|
|
61
71
|
}
|
|
62
|
-
set label(
|
|
63
|
-
reactivity_u0.write(this.#label,
|
|
72
|
+
set label(_v3) {
|
|
73
|
+
reactivity_u0.write(this.#label, _v3);
|
|
64
74
|
}
|
|
65
75
|
get linking() {
|
|
66
76
|
return reactivity_u0.read(this.#linking);
|
|
67
77
|
}
|
|
68
|
-
set linking(
|
|
69
|
-
reactivity_u0.write(this.#linking,
|
|
78
|
+
set linking(_v4) {
|
|
79
|
+
reactivity_u0.write(this.#linking, _v4);
|
|
70
80
|
}
|
|
71
81
|
get minimap() {
|
|
72
82
|
return reactivity_u0.read(this.#minimap);
|
|
73
83
|
}
|
|
74
|
-
set minimap(
|
|
75
|
-
reactivity_u0.write(this.#minimap,
|
|
84
|
+
set minimap(_v5) {
|
|
85
|
+
reactivity_u0.write(this.#minimap, _v5);
|
|
76
86
|
}
|
|
77
87
|
get placeholder() {
|
|
78
88
|
return reactivity_u0.read(this.#placeholder);
|
|
79
89
|
}
|
|
80
|
-
set placeholder(
|
|
81
|
-
reactivity_u0.write(this.#placeholder,
|
|
90
|
+
set placeholder(_v6) {
|
|
91
|
+
reactivity_u0.write(this.#placeholder, _v6);
|
|
82
92
|
}
|
|
83
93
|
get readonly() {
|
|
84
94
|
return reactivity_u0.read(this.#readonly);
|
|
85
95
|
}
|
|
86
|
-
set readonly(
|
|
87
|
-
reactivity_u0.write(this.#readonly,
|
|
96
|
+
set readonly(_v7) {
|
|
97
|
+
reactivity_u0.write(this.#readonly, _v7);
|
|
88
98
|
}
|
|
89
99
|
get spellcheck() {
|
|
90
100
|
return reactivity_u0.read(this.#spellcheck);
|
|
91
101
|
}
|
|
92
|
-
set spellcheck(
|
|
93
|
-
reactivity_u0.write(this.#spellcheck,
|
|
102
|
+
set spellcheck(_v8) {
|
|
103
|
+
reactivity_u0.write(this.#spellcheck, _v8);
|
|
94
104
|
}
|
|
95
105
|
get tabSize() {
|
|
96
106
|
return reactivity_u0.read(this.#tabSize);
|
|
97
107
|
}
|
|
98
|
-
set tabSize(
|
|
99
|
-
reactivity_u0.write(this.#tabSize,
|
|
108
|
+
set tabSize(_v9) {
|
|
109
|
+
reactivity_u0.write(this.#tabSize, _v9);
|
|
110
|
+
}
|
|
111
|
+
get tools() {
|
|
112
|
+
return reactivity_u0.read(this.#tools);
|
|
113
|
+
}
|
|
114
|
+
set tools(_v10) {
|
|
115
|
+
reactivity_u0.write(this.#tools, _v10);
|
|
100
116
|
}
|
|
101
117
|
get wrap() {
|
|
102
118
|
return reactivity_u0.read(this.#wrap);
|
|
103
119
|
}
|
|
104
|
-
set wrap(
|
|
105
|
-
reactivity_u0.write(this.#wrap,
|
|
120
|
+
set wrap(_v11) {
|
|
121
|
+
reactivity_u0.write(this.#wrap, _v11);
|
|
106
122
|
}
|
|
107
123
|
}
|
|
108
124
|
class ReactiveObject_1ayo7z91 extends reactivity_u0.ReactiveObject {
|
|
@@ -140,6 +156,7 @@ const DECORATIONS = 1000;
|
|
|
140
156
|
const ITEM_TASK = /^[ \t]*(?:[-+*]|\d+[.)])[ \t]+\[ ?\]$/;
|
|
141
157
|
const JOINABLE = new Set(['heading', 'list', 'paragraph', 'quote']);
|
|
142
158
|
const LINE_BREAK = /[\r\n]/;
|
|
159
|
+
const LINE_BREAKS = /\r\n|\r|\n/g;
|
|
143
160
|
const LINK_DELAY = 700;
|
|
144
161
|
const LITERAL = new Set(['code', 'fence', 'frontmatter', 'html']);
|
|
145
162
|
const NAVIGATION = /^(ArrowDown|ArrowLeft|ArrowRight|ArrowUp|End|Home|PageDown|PageUp)$/;
|
|
@@ -325,6 +342,38 @@ const view = (model, callbacks, receive) => {
|
|
|
325
342
|
});
|
|
326
343
|
let size = observeSize(() => measure());
|
|
327
344
|
let tip = tooltip.shared({ delay: { open: LINK_DELAY } });
|
|
345
|
+
let formatting = {
|
|
346
|
+
get blocks() {
|
|
347
|
+
current();
|
|
348
|
+
return blocks;
|
|
349
|
+
},
|
|
350
|
+
get document() {
|
|
351
|
+
return model;
|
|
352
|
+
},
|
|
353
|
+
tokens: inlineOf
|
|
354
|
+
};
|
|
355
|
+
let bar = toolbar({
|
|
356
|
+
block: (kind) => controller.block(kind),
|
|
357
|
+
clear: () => controller.clearFormats(),
|
|
358
|
+
copy: () => model.value.slice(model.selection.start, model.selection.end),
|
|
359
|
+
focus: () => controller.focus(),
|
|
360
|
+
formats: () => controller.formats(),
|
|
361
|
+
link: (href) => controller.link(href),
|
|
362
|
+
mark: (mark) => controller.mark(mark),
|
|
363
|
+
range: () => {
|
|
364
|
+
let native = content?.ownerDocument.getSelection(), { end, start } = model.selection;
|
|
365
|
+
if (!content || !native?.rangeCount || content.ownerDocument.activeElement !== content || start === end) {
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
let range = native.getRangeAt(0);
|
|
369
|
+
return range.collapsed || !content.contains(range.commonAncestorContainer) ? null : range;
|
|
370
|
+
},
|
|
371
|
+
selected: () => {
|
|
372
|
+
let { end, start } = model.selection;
|
|
373
|
+
return !!content && start !== end && content.ownerDocument.activeElement === content;
|
|
374
|
+
},
|
|
375
|
+
selection: () => model.selection
|
|
376
|
+
});
|
|
328
377
|
let source = {
|
|
329
378
|
breaks: () => NONE,
|
|
330
379
|
get count() {
|
|
@@ -816,6 +865,9 @@ const view = (model, callbacks, receive) => {
|
|
|
816
865
|
if (!ime.busy()) {
|
|
817
866
|
present();
|
|
818
867
|
}
|
|
868
|
+
if (!unplaced) {
|
|
869
|
+
bar.refresh();
|
|
870
|
+
}
|
|
819
871
|
markFoldable();
|
|
820
872
|
queueMicrotask(() => {
|
|
821
873
|
if (!disposed) {
|
|
@@ -1199,7 +1251,11 @@ const view = (model, callbacks, receive) => {
|
|
|
1199
1251
|
}
|
|
1200
1252
|
return out;
|
|
1201
1253
|
}
|
|
1254
|
+
function single(text) {
|
|
1255
|
+
return options.singleLine ? text.replace(LINE_BREAKS, ' ') : text;
|
|
1256
|
+
}
|
|
1202
1257
|
function typed(text) {
|
|
1258
|
+
text = single(text);
|
|
1203
1259
|
return editable(() => shortcut(text) || insertText(model, text, 'input'));
|
|
1204
1260
|
}
|
|
1205
1261
|
let controller = {
|
|
@@ -1212,7 +1268,9 @@ const view = (model, callbacks, receive) => {
|
|
|
1212
1268
|
start(true);
|
|
1213
1269
|
return changed;
|
|
1214
1270
|
},
|
|
1271
|
+
block: (kind) => editable(() => setBlockKind(formatting, kind)),
|
|
1215
1272
|
bold: () => editable(() => markdownCommand(model, 'bold', kindAt)),
|
|
1273
|
+
clearFormats: () => editable(() => clearFormats(formatting)),
|
|
1216
1274
|
closeFind: () => search.close(),
|
|
1217
1275
|
dispose: () => {
|
|
1218
1276
|
if (disposed) {
|
|
@@ -1282,6 +1340,7 @@ const view = (model, callbacks, receive) => {
|
|
|
1282
1340
|
revealing = true;
|
|
1283
1341
|
controller.focus();
|
|
1284
1342
|
},
|
|
1343
|
+
formats: () => formatsAt(formatting),
|
|
1285
1344
|
get host() {
|
|
1286
1345
|
return host;
|
|
1287
1346
|
},
|
|
@@ -1289,7 +1348,9 @@ const view = (model, callbacks, receive) => {
|
|
|
1289
1348
|
insert: (text) => editable(() => insertText(model, text)),
|
|
1290
1349
|
italic: () => editable(() => markdownCommand(model, 'italic', kindAt)),
|
|
1291
1350
|
lineCommand: (command) => editable(() => lineCommand(model, command)),
|
|
1292
|
-
|
|
1351
|
+
link: (href) => editable(() => setLink(formatting, href)),
|
|
1352
|
+
mark: (mark) => editable(() => toggleMark(formatting, mark)),
|
|
1353
|
+
newline: () => !options.singleLine && editable(() => markdownCommand(model, 'enter', kindAt)),
|
|
1293
1354
|
offsetAt,
|
|
1294
1355
|
openFind: (replace = false) => {
|
|
1295
1356
|
if (disposed || ime.busy()) {
|
|
@@ -1389,12 +1450,14 @@ const view = (model, callbacks, receive) => {
|
|
|
1389
1450
|
options.indent = ' ';
|
|
1390
1451
|
}
|
|
1391
1452
|
ui.fold = !!options.fold;
|
|
1453
|
+
ui.inline = !!options.inline;
|
|
1392
1454
|
ui.label = options.label ?? 'Markdown editor';
|
|
1393
1455
|
ui.minimap = !!options.minimap;
|
|
1394
1456
|
ui.placeholder = options.placeholder ?? '';
|
|
1395
1457
|
ui.readonly = !!options.readonly;
|
|
1396
1458
|
ui.spellcheck = options.spellcheck ?? true;
|
|
1397
1459
|
ui.tabSize = options.tabSize;
|
|
1460
|
+
ui.tools = (options.toolbar ?? []).join(' ');
|
|
1398
1461
|
ui.wrap = options.wrap !== false;
|
|
1399
1462
|
search.status();
|
|
1400
1463
|
if (!options.fold) {
|
|
@@ -1516,7 +1579,9 @@ const view = (model, callbacks, receive) => {
|
|
|
1516
1579
|
controller.undo();
|
|
1517
1580
|
return;
|
|
1518
1581
|
case 'insertLineBreak':
|
|
1519
|
-
|
|
1582
|
+
if (!options.singleLine) {
|
|
1583
|
+
editable(() => insertText(model, model.eol, 'input'));
|
|
1584
|
+
}
|
|
1520
1585
|
return;
|
|
1521
1586
|
case 'insertParagraph':
|
|
1522
1587
|
controller.newline();
|
|
@@ -1571,6 +1636,11 @@ const view = (model, callbacks, receive) => {
|
|
|
1571
1636
|
e.preventDefault();
|
|
1572
1637
|
return;
|
|
1573
1638
|
}
|
|
1639
|
+
if (e.key === 'Escape' && bar.open) {
|
|
1640
|
+
e.preventDefault();
|
|
1641
|
+
bar.dismiss();
|
|
1642
|
+
return;
|
|
1643
|
+
}
|
|
1574
1644
|
if (e.key === 'Escape') {
|
|
1575
1645
|
escapeTab = true;
|
|
1576
1646
|
if (model.selections.length > 1) {
|
|
@@ -1586,6 +1656,10 @@ const view = (model, callbacks, receive) => {
|
|
|
1586
1656
|
escapeTab = false;
|
|
1587
1657
|
capture();
|
|
1588
1658
|
let mod = apple ? e.metaKey : e.ctrlKey, key = e.key.toLowerCase();
|
|
1659
|
+
if (bar.shortcut(e)) {
|
|
1660
|
+
e.preventDefault();
|
|
1661
|
+
return;
|
|
1662
|
+
}
|
|
1589
1663
|
if (mod && !e.altKey && !e.shiftKey && (key === 'b' || key === 'i')) {
|
|
1590
1664
|
e.preventDefault();
|
|
1591
1665
|
key === 'b' ? controller.bold() : controller.italic();
|
|
@@ -1619,7 +1693,7 @@ const view = (model, callbacks, receive) => {
|
|
|
1619
1693
|
return;
|
|
1620
1694
|
}
|
|
1621
1695
|
e.preventDefault();
|
|
1622
|
-
let
|
|
1696
|
+
let pasted = read(e.clipboardData, model.selections.length), text = typeof pasted === 'string' ? single(pasted) : pasted.map(single);
|
|
1623
1697
|
editable(() => insertText(model, text, 'paste'));
|
|
1624
1698
|
},
|
|
1625
1699
|
role: 'textbox',
|
|
@@ -1657,6 +1731,9 @@ const view = (model, callbacks, receive) => {
|
|
|
1657
1731
|
onpointercancel: gestures.end,
|
|
1658
1732
|
onpointerdown: (e) => {
|
|
1659
1733
|
tip.release();
|
|
1734
|
+
if (e.button === 0) {
|
|
1735
|
+
bar.press();
|
|
1736
|
+
}
|
|
1660
1737
|
gestures.onpointerdown(e);
|
|
1661
1738
|
},
|
|
1662
1739
|
onpointerleave: () => tip.release(),
|
|
@@ -1681,58 +1758,75 @@ const view = (model, callbacks, receive) => {
|
|
|
1681
1758
|
}
|
|
1682
1759
|
};
|
|
1683
1760
|
let template = (attributes) => {
|
|
1684
|
-
let root_1ayo7z93 = template_1ayo7z94(), element_1ayo7z95 = root_1ayo7z93.firstChild, element_1ayo7z96 = element_1ayo7z95.
|
|
1685
|
-
template_u1.slot(
|
|
1686
|
-
template_u1.slot(
|
|
1687
|
-
|
|
1688
|
-
let root_1ayo7z9f = template_1ayo7z9g()
|
|
1689
|
-
template_u1.
|
|
1690
|
-
template_u1.
|
|
1761
|
+
let root_1ayo7z93 = template_1ayo7z94(), element_1ayo7z95 = root_1ayo7z93.firstChild, element_1ayo7z96 = element_1ayo7z95.nextSibling, element_1ayo7z97 = root_1ayo7z93.firstElementChild, element_1ayo7z98 = element_1ayo7z97.firstElementChild, element_1ayo7z99 = element_1ayo7z98.firstElementChild, element_1ayo7z9a = element_1ayo7z99.nextElementSibling, element_1ayo7z9b = element_1ayo7z97.firstChild.nextSibling, element_1ayo7z9c = element_1ayo7z98.nextElementSibling, element_1ayo7z9d = element_1ayo7z97.nextElementSibling, element_1ayo7z9e = element_1ayo7z96.nextSibling.nextSibling.nextSibling;
|
|
1762
|
+
template_u1.slot(element_1ayo7z95, search.template());
|
|
1763
|
+
template_u1.slot(element_1ayo7z96, jump.template());
|
|
1764
|
+
element_1ayo7z99.appendChild(new template_u1.ArraySlot(decorations, (decoration) => {
|
|
1765
|
+
let root_1ayo7z9f = template_1ayo7z9g();
|
|
1766
|
+
template_u1.setClass(root_1ayo7z9f, ["", () => decoration.kind]);
|
|
1767
|
+
template_u1.setStyle(root_1ayo7z9f, ["", () => decoration.style]);
|
|
1691
1768
|
return root_1ayo7z9f;
|
|
1692
1769
|
}, true).fragment);
|
|
1693
|
-
|
|
1770
|
+
element_1ayo7z9a.appendChild(new template_u1.ArraySlot(items, (item) => 'block' in item
|
|
1694
1771
|
? draw.template(item)
|
|
1695
1772
|
: (() => {
|
|
1696
|
-
let
|
|
1697
|
-
template_u1.
|
|
1698
|
-
|
|
1773
|
+
let root_1ayo7z9h = template_1ayo7z9i();
|
|
1774
|
+
template_u1.setClass(root_1ayo7z9h, ["markdown-editor-spacer"]);
|
|
1775
|
+
template_u1.setStyle(root_1ayo7z9h, ["", () => `height: ${item.height}px;`]);
|
|
1776
|
+
return root_1ayo7z9h;
|
|
1699
1777
|
})(), true).fragment);
|
|
1700
|
-
template_u1.slot(
|
|
1701
|
-
template_u1.slot(
|
|
1702
|
-
template_u1.
|
|
1703
|
-
|
|
1778
|
+
template_u1.slot(element_1ayo7z9b, map.template());
|
|
1779
|
+
template_u1.slot(element_1ayo7z9e, tip.render());
|
|
1780
|
+
new template_u1.EffectSlot(root_1ayo7z93, () => {
|
|
1781
|
+
let tools = ui.tools;
|
|
1782
|
+
return tools && untrack(() => bar.template(tools.split(' ')));
|
|
1783
|
+
}, 1);
|
|
1784
|
+
template_u1.setProperty(element_1ayo7z9d, 'id', help);
|
|
1785
|
+
template_u1.onconnect(element_1ayo7z9c, (element) => {
|
|
1704
1786
|
ruler = element;
|
|
1705
1787
|
connect();
|
|
1706
1788
|
});
|
|
1707
|
-
template_u1.
|
|
1708
|
-
|
|
1789
|
+
template_u1.setClass(element_1ayo7z9c, ["markdown-editor-ruler"]);
|
|
1790
|
+
let attributes_1ayo7z9j = field;
|
|
1791
|
+
template_u1.setProperties(element_1ayo7z9a, attributes_1ayo7z9j, true);
|
|
1792
|
+
template_u1.onconnect(element_1ayo7z9a, (element) => {
|
|
1709
1793
|
content = element;
|
|
1710
1794
|
connect();
|
|
1711
1795
|
});
|
|
1712
|
-
template_u1.
|
|
1713
|
-
template_u1.
|
|
1714
|
-
|
|
1715
|
-
template_u1.setProperties(
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
]);
|
|
1726
|
-
template_u1.onconnect(element_1ayo7z95, (element) => {
|
|
1796
|
+
template_u1.setClass(element_1ayo7z9a, ["", attributes_1ayo7z9j?.class]);
|
|
1797
|
+
template_u1.setStyle(element_1ayo7z9a, ["", attributes_1ayo7z9j?.style]);
|
|
1798
|
+
let attributes_1ayo7z9k = body;
|
|
1799
|
+
template_u1.setProperties(element_1ayo7z98, attributes_1ayo7z9k, true);
|
|
1800
|
+
let attributes_1ayo7z9l = scrollbar();
|
|
1801
|
+
template_u1.setProperties(element_1ayo7z98, attributes_1ayo7z9l, true);
|
|
1802
|
+
template_u1.setClass(element_1ayo7z98, ["markdown-editor-surface", attributes_1ayo7z9k?.class, attributes_1ayo7z9l?.class]);
|
|
1803
|
+
template_u1.setStyle(element_1ayo7z98, ["", attributes_1ayo7z9k?.style, attributes_1ayo7z9l?.style]);
|
|
1804
|
+
template_u1.setProperties(element_1ayo7z97, size);
|
|
1805
|
+
template_u1.setClass(element_1ayo7z97, ["markdown-editor-body"]);
|
|
1806
|
+
let attributes_1ayo7z9m = attributes;
|
|
1807
|
+
template_u1.setProperties(root_1ayo7z93, attributes_1ayo7z9m, true);
|
|
1808
|
+
template_u1.onconnect(root_1ayo7z93, (element) => {
|
|
1727
1809
|
host = element;
|
|
1728
1810
|
connect();
|
|
1729
1811
|
});
|
|
1730
|
-
template_u1.ondisconnect(
|
|
1731
|
-
template_u1.ondocument(
|
|
1732
|
-
template_u1.
|
|
1812
|
+
template_u1.ondisconnect(root_1ayo7z93, () => controller.dispose());
|
|
1813
|
+
template_u1.ondocument(root_1ayo7z93, 'selectionchange', capture);
|
|
1814
|
+
template_u1.direct(root_1ayo7z93, 'focusout', () => {
|
|
1815
|
+
requestAnimationFrame(bar.refresh);
|
|
1816
|
+
});
|
|
1817
|
+
template_u1.onwindow(root_1ayo7z93, 'blur', () => {
|
|
1733
1818
|
ui.linking = false;
|
|
1734
1819
|
});
|
|
1735
|
-
template_u1.
|
|
1820
|
+
template_u1.setClass(root_1ayo7z93, ["markdown-editor", attributes_1ayo7z9m?.class, [
|
|
1821
|
+
() => gestures.state.crosshair && 'markdown-editor--crosshair',
|
|
1822
|
+
() => ui.empty && 'markdown-editor--empty',
|
|
1823
|
+
() => ui.fold && 'markdown-editor--fold',
|
|
1824
|
+
() => ui.inline && 'markdown-editor--inline',
|
|
1825
|
+
() => ui.linking && 'markdown-editor--linking',
|
|
1826
|
+
() => ui.minimap && 'markdown-editor--minimap',
|
|
1827
|
+
() => !ui.wrap && 'markdown-editor--nowrap'
|
|
1828
|
+
]]);
|
|
1829
|
+
template_u1.setStyle(root_1ayo7z93, ["", attributes_1ayo7z9m?.style, () => `--tab-size: ${ui.tabSize};`]);
|
|
1736
1830
|
return root_1ayo7z93;
|
|
1737
1831
|
};
|
|
1738
1832
|
return { controller, template };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
1
2
|
import { type Attributes, type Renderable } from '@esportsplus/template';
|
|
2
3
|
import type { FileTreeElement as Element } from './index.js';
|
|
3
4
|
type Node<T> = {
|
|
@@ -18,6 +19,6 @@ declare function lineage<T extends Node<T>>(row: T): T[];
|
|
|
18
19
|
declare function same<T extends Node<T>>(a: T[] | undefined, b: T[] | undefined): boolean;
|
|
19
20
|
declare function sole(element: Element, hidden: Set<string>, folder: (element: Element) => boolean): Element | null;
|
|
20
21
|
export default _default;
|
|
21
|
-
declare function _default<T extends Node<T>>(row: T, part: (node: T) => Attributes[], name: (node: T) => Renderable<unknown>):
|
|
22
|
+
declare function _default<T extends Node<T>>(row: T, part: (node: T) => Attributes[], name: (node: T) => Renderable<unknown>): template_u1.Element;
|
|
22
23
|
export { ancestors, caption, holds, lineage, same, SEGMENT, sole };
|
|
23
24
|
export type { Segment };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as template_u1 from '@esportsplus/template';
|
|
2
|
-
const template_05h7g901 = template_u1.template(`<span class='file-tree-name'
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
const template_05h7g901 = template_u1.template(`<span class='file-tree-name'>`, true);
|
|
3
|
+
const template_05h7g903 = template_u1.template(`<!--$--><span>`);
|
|
4
|
+
const template_05h7g906 = template_u1.template(`<span aria-hidden='true' class='file-tree-separator'>/`, true);
|
|
5
5
|
const SEGMENT = Symbol();
|
|
6
6
|
function ancestors(row) {
|
|
7
7
|
let out = lineage(row).slice(0, -1);
|
|
@@ -43,14 +43,15 @@ function sole(element, hidden, folder) {
|
|
|
43
43
|
return only && folder(only) && only.selectable !== false ? only : null;
|
|
44
44
|
}
|
|
45
45
|
export default (row, part, name) => {
|
|
46
|
-
let root_05h7g900 = template_05h7g901()
|
|
47
|
-
template_u1.slot(
|
|
48
|
-
let
|
|
49
|
-
template_u1.slot(
|
|
50
|
-
template_u1.slot(
|
|
51
|
-
template_u1.setProperties(
|
|
52
|
-
template_u1.onconnect(
|
|
53
|
-
|
|
46
|
+
let root_05h7g900 = template_05h7g901();
|
|
47
|
+
template_u1.slot(root_05h7g900, lineage(row).map((node, i) => {
|
|
48
|
+
let root_05h7g902 = template_05h7g903(), element_05h7g904 = root_05h7g902.firstChild, element_05h7g905 = element_05h7g904.nextSibling;
|
|
49
|
+
template_u1.slot(element_05h7g904, i > 0 && template_05h7g906());
|
|
50
|
+
template_u1.slot(element_05h7g905, name(node), 1);
|
|
51
|
+
template_u1.setProperties(element_05h7g905, part(node));
|
|
52
|
+
template_u1.onconnect(element_05h7g905, (element) => { element[SEGMENT] = node; });
|
|
53
|
+
template_u1.setClass(element_05h7g905, ["file-tree-segment"]);
|
|
54
|
+
return root_05h7g902;
|
|
54
55
|
}), 1);
|
|
55
56
|
return root_05h7g900;
|
|
56
57
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Signal } from '@esportsplus/reactivity';
|
|
2
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
3
|
import { type Attributes } from '@esportsplus/template';
|
|
3
4
|
import { type Export, type ImportEntry } from './transfer.js';
|
|
4
5
|
type Drag<E> = {
|
|
@@ -36,8 +37,8 @@ type Tree<T> = {
|
|
|
36
37
|
};
|
|
37
38
|
export default _default;
|
|
38
39
|
declare function _default<T extends Row<T>>({ drag, export: give, import: take }: Handlers<T['element']>, tree: Tree<T>): {
|
|
39
|
-
ghost:
|
|
40
|
-
root: Attributes;
|
|
40
|
+
ghost: template_u1.Element;
|
|
41
|
+
root: Attributes[];
|
|
41
42
|
row: (row: T) => Attributes;
|
|
42
43
|
segment: (row: T) => Attributes;
|
|
43
44
|
viewport: Attributes;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
2
|
import { peek, read, signal, write } from '@esportsplus/reactivity';
|
|
3
3
|
import * as template_u1 from '@esportsplus/template';
|
|
4
|
+
import { on } from '@esportsplus/template';
|
|
4
5
|
import press from '../../../shared/press.js';
|
|
5
6
|
import { attach, collect } from './transfer.js';
|
|
6
|
-
const template_1b19bft2 = template_u1.template(`<div aria-hidden='true'
|
|
7
|
-
const
|
|
7
|
+
const template_1b19bft2 = template_u1.template(`<div aria-hidden='true' popover='manual'><span class='file-tree-drag-name'></span><!--$--><span class='file-tree-drag-copy'>+`, true);
|
|
8
|
+
const template_1b19bft6 = template_u1.template(`<span class='file-tree-drag-count'>`, true);
|
|
8
9
|
class ReactiveObject_1b19bft0 extends reactivity_u0.ReactiveObject {
|
|
9
10
|
#count = this[reactivity_u0.SIGNAL](0);
|
|
10
11
|
#depth;
|
|
@@ -60,7 +61,7 @@ const HOVER = 500;
|
|
|
60
61
|
const SPEED = 600;
|
|
61
62
|
const STALE = 600;
|
|
62
63
|
export default ({ drag, export: give, import: take }, tree) => {
|
|
63
|
-
let carry = 0, copy = false, frame = 0, gesture = press(DELAY), ghost, held = signal(false), list = [], marks = { folder: signal(0), last: signal(0), target: signal(0) }, mode = '', opening, pointer = 0, seen = 0, sources = new Set(), target, time = 0, ui = new ReactiveObject_1b19bft0(null, ''), x = 0, y = 0;
|
|
64
|
+
let carry = 0, copy = false, frame = 0, gesture = press(DELAY), ghost, held = signal(false), keys = null, list = [], marks = { folder: signal(0), last: signal(0), target: signal(0) }, mode = '', opening, pointer = 0, seen = 0, sources = new Set(), target, time = 0, ui = new ReactiveObject_1b19bft0(null, ''), x = 0, y = 0;
|
|
64
65
|
function aim() {
|
|
65
66
|
let viewport = tree.viewport();
|
|
66
67
|
if (!viewport) {
|
|
@@ -217,10 +218,10 @@ export default ({ drag, export: give, import: take }, tree) => {
|
|
|
217
218
|
ui.y = y;
|
|
218
219
|
}
|
|
219
220
|
function pressed(rows, e) {
|
|
220
|
-
let cancelled = false
|
|
221
|
+
let cancelled = false;
|
|
221
222
|
function end(e) {
|
|
222
223
|
let folder = mode === 'pointer' && e?.type === 'pointerup' ? target : undefined, copied = copy;
|
|
223
|
-
keys
|
|
224
|
+
keys = null;
|
|
224
225
|
stop();
|
|
225
226
|
if (folder !== undefined) {
|
|
226
227
|
void deliver(folder, rows, copied);
|
|
@@ -271,8 +272,7 @@ export default ({ drag, export: give, import: take }, tree) => {
|
|
|
271
272
|
frame = requestAnimationFrame(tick);
|
|
272
273
|
}
|
|
273
274
|
});
|
|
274
|
-
|
|
275
|
-
document.addEventListener('keyup', key, { capture: true, signal: keys.signal });
|
|
275
|
+
keys = key;
|
|
276
276
|
}
|
|
277
277
|
function start(rows, value) {
|
|
278
278
|
list = rows;
|
|
@@ -336,29 +336,32 @@ export default ({ drag, export: give, import: take }, tree) => {
|
|
|
336
336
|
}
|
|
337
337
|
return {
|
|
338
338
|
ghost: (() => {
|
|
339
|
-
let root_1b19bft1 = template_1b19bft2(), element_1b19bft3 = root_1b19bft1.
|
|
340
|
-
new template_u1.EffectSlot(
|
|
341
|
-
new template_u1.EffectSlot(
|
|
342
|
-
let
|
|
343
|
-
template_u1.slot(
|
|
344
|
-
return
|
|
339
|
+
let root_1b19bft1 = template_1b19bft2(), element_1b19bft3 = root_1b19bft1.firstElementChild, element_1b19bft4 = root_1b19bft1.firstChild.nextSibling;
|
|
340
|
+
new template_u1.EffectSlot(element_1b19bft3, () => ui.label, 1);
|
|
341
|
+
new template_u1.EffectSlot(element_1b19bft4, () => ui.count > 1 && (() => {
|
|
342
|
+
let root_1b19bft5 = template_1b19bft6();
|
|
343
|
+
template_u1.slot(root_1b19bft5, ui.count, 1);
|
|
344
|
+
return root_1b19bft5;
|
|
345
345
|
})());
|
|
346
|
-
template_u1.
|
|
347
|
-
template_u1.onconnect(element_1b19bft3, (element) => {
|
|
346
|
+
template_u1.onconnect(root_1b19bft1, (element) => {
|
|
348
347
|
ghost = element;
|
|
349
348
|
});
|
|
350
|
-
template_u1.
|
|
349
|
+
template_u1.setClass(root_1b19bft1, ["file-tree-drag", () => ui.effect && `file-tree-drag--${ui.effect}`]);
|
|
350
|
+
template_u1.setStyle(root_1b19bft1, ["", () => `translate: ${ui.x}px ${ui.y}px`]);
|
|
351
351
|
return root_1b19bft1;
|
|
352
352
|
})(),
|
|
353
|
-
root: {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
353
|
+
root: [gesture.attributes, {
|
|
354
|
+
onconnect: (_, on) => {
|
|
355
|
+
on(document, 'keydown', (e) => keys?.(e), { capture: true });
|
|
356
|
+
on(document, 'keyup', (e) => keys?.(e), { capture: true });
|
|
357
|
+
},
|
|
358
|
+
ondisconnect: () => {
|
|
359
|
+
gesture.cancel();
|
|
360
|
+
if (mode) {
|
|
361
|
+
stop();
|
|
362
|
+
}
|
|
359
363
|
}
|
|
360
|
-
}
|
|
361
|
-
},
|
|
364
|
+
}],
|
|
362
365
|
row: (row) => ({
|
|
363
366
|
class: [
|
|
364
367
|
() => read(held) && ui.effect === 'move' && sources.has(row) && 'file-tree-row--dragged',
|
|
@@ -380,11 +383,11 @@ export default ({ drag, export: give, import: take }, tree) => {
|
|
|
380
383
|
}
|
|
381
384
|
transfer.effectAllowed = drag ? 'copyMove' : 'copy';
|
|
382
385
|
attach(transfer, files.length ? files : rows.map((row) => ({ name: row.element.name })));
|
|
383
|
-
e.currentTarget
|
|
386
|
+
on(e.currentTarget, 'dragend', () => {
|
|
384
387
|
if (mode === 'native') {
|
|
385
388
|
stop();
|
|
386
389
|
}
|
|
387
|
-
}, { once: true });
|
|
390
|
+
}, { direct: true, once: true });
|
|
388
391
|
start(rows, 'native');
|
|
389
392
|
}
|
|
390
393
|
}),
|
|
@@ -24,7 +24,7 @@ type Request = {
|
|
|
24
24
|
target?: string | null;
|
|
25
25
|
};
|
|
26
26
|
type Result = boolean | void | Promise<boolean | void>;
|
|
27
|
-
declare function field<R>(draft: Draft<R>, id: string, on: Handlers): DocumentFragment | Text;
|
|
27
|
+
declare function field<R>(draft: Draft<R>, id: string, on: Handlers): DocumentFragment | globalThis.Element | Text;
|
|
28
28
|
declare function resolve(value: string, parent: Element | null, renaming: Element | null, children: (parent: Element | null) => Element[], folder: (element: Element) => boolean): {
|
|
29
29
|
message: string;
|
|
30
30
|
parent: Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { read } from '@esportsplus/reactivity';
|
|
2
2
|
import * as template_u1 from '@esportsplus/template';
|
|
3
|
-
const template_1t8hp3r1 = template_u1.template(`<input autocomplete='off'
|
|
4
|
-
const template_1t8hp3r5 = template_u1.template(`<span class='file-tree-message' role='alert'
|
|
3
|
+
const template_1t8hp3r1 = template_u1.template(`<input autocomplete='off' spellcheck='false' type='text' /><!--$-->`);
|
|
4
|
+
const template_1t8hp3r5 = template_u1.template(`<span class='file-tree-message' role='alert'>`, true);
|
|
5
5
|
const INVALID = /[\\/:*?"<>|\x00-\x1f]/;
|
|
6
6
|
function check(name, path) {
|
|
7
7
|
if (!name.trim()) {
|
|
@@ -22,18 +22,18 @@ function exists(name) {
|
|
|
22
22
|
return `A file or folder ${name} already exists at this location`;
|
|
23
23
|
}
|
|
24
24
|
function field(draft, id, on) {
|
|
25
|
-
|
|
25
|
+
{
|
|
26
26
|
let root_1t8hp3r0 = template_1t8hp3r1(), element_1t8hp3r2 = root_1t8hp3r0.firstChild, element_1t8hp3r3 = element_1t8hp3r2.nextSibling;
|
|
27
27
|
new template_u1.EffectSlot(element_1t8hp3r3, () => read(draft.message) && (() => {
|
|
28
|
-
let root_1t8hp3r4 = template_1t8hp3r5()
|
|
29
|
-
template_u1.slot(
|
|
30
|
-
template_u1.setProperty(
|
|
28
|
+
let root_1t8hp3r4 = template_1t8hp3r5();
|
|
29
|
+
template_u1.slot(root_1t8hp3r4, read(draft.message), 1);
|
|
30
|
+
template_u1.setProperty(root_1t8hp3r4, 'id', "" + (id) + "-message");
|
|
31
31
|
return root_1t8hp3r4;
|
|
32
32
|
})());
|
|
33
|
-
template_u1.setProperty(element_1t8hp3r2, 'aria-describedby',
|
|
33
|
+
template_u1.setProperty(element_1t8hp3r2, 'aria-describedby', "" + (id) + "-message");
|
|
34
34
|
template_u1.setProperty(element_1t8hp3r2, 'aria-label', draft.element ? `Rename ${draft.element.name}` : `New ${draft.kind} name`);
|
|
35
35
|
template_u1.setProperty(element_1t8hp3r2, 'aria-invalid', () => read(draft.message) ? 'true' : 'false');
|
|
36
|
-
template_u1.
|
|
36
|
+
template_u1.direct(element_1t8hp3r2, 'blur', (event) => {
|
|
37
37
|
let element = event.currentTarget;
|
|
38
38
|
queueMicrotask(() => {
|
|
39
39
|
if (element.isConnected && document.hasFocus()) {
|
|
@@ -68,8 +68,9 @@ function field(draft, id, on) {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
template_u1.setProperty(element_1t8hp3r2, 'readonly', () => read(draft.busy) && 'true');
|
|
71
|
+
template_u1.setClass(element_1t8hp3r2, ["file-tree-input"]);
|
|
71
72
|
return root_1t8hp3r0;
|
|
72
|
-
}
|
|
73
|
+
}
|
|
73
74
|
}
|
|
74
75
|
function resolve(value, parent, renaming, children, folder) {
|
|
75
76
|
let parts = renaming ? [value] : value.split('/');
|
|
@@ -45,7 +45,7 @@ declare class Finder {
|
|
|
45
45
|
mark(id: string): "current" | "true" | false;
|
|
46
46
|
open(text?: string): void;
|
|
47
47
|
refresh(): void;
|
|
48
|
-
render(tree: string): DocumentFragment | Text;
|
|
48
|
+
render(tree: string): DocumentFragment | globalThis.Element | Text;
|
|
49
49
|
set(text: string, quiet?: boolean): void;
|
|
50
50
|
step(by: 1 | -1): void;
|
|
51
51
|
toggle(): void;
|