hexagon-editor 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +105 -0
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/dist/MarkdownEditor.vue.d.ts +926 -0
- package/dist/MarkdownEditor.vue.d.ts.map +1 -0
- package/dist/MarkdownEditorLinkForm-mq-BVYM_.js +338 -0
- package/dist/MarkdownEditorLinkForm.css +1 -0
- package/dist/abnfDiagram-N423BO3Z-DCf6sPky.js +87 -0
- package/dist/arc-y6UeoJpJ.js +83 -0
- package/dist/architectureDiagram-T3A2C74G-Cc3_3-cI.js +4778 -0
- package/dist/base-Bnv2-Te4.js +13338 -0
- package/dist/base.css +1 -0
- package/dist/blockDiagram-VBNYF7ZC-DWVLZwXY.js +2419 -0
- package/dist/c4Diagram-5PPSVZJV-CaIN7qay.js +1577 -0
- package/dist/channel-BwXGcavV.js +5 -0
- package/dist/chunk-2GRJ4B5K-O75udjPr.js +68 -0
- package/dist/chunk-2Q5K7J3B-CySL0lOA.js +15 -0
- package/dist/chunk-5RXB4S5H-BKPnLCOJ.js +1408 -0
- package/dist/chunk-5VM5RSS4--it1VJIv.js +19 -0
- package/dist/chunk-6Q2QTUOP-DNiML-50.js +664 -0
- package/dist/chunk-GF5L2VYU-z7A-k0-V.js +1533 -0
- package/dist/chunk-JWPE2WC7-DAjx3Kjr.js +8 -0
- package/dist/chunk-KBJHAD2P-D4R1VW0r.js +19 -0
- package/dist/chunk-RYQCIY6F-DmJAYxq8.js +313 -0
- package/dist/chunk-XXDRQBXY-CK913N-t.js +8 -0
- package/dist/classDiagram-JCYQIIEL-Djipq_HJ.js +16 -0
- package/dist/classDiagram-v2-OCEON4UE-Djipq_HJ.js +16 -0
- package/dist/classname.d.ts +13 -0
- package/dist/classname.d.ts.map +1 -0
- package/dist/classname.js +17 -0
- package/dist/components/MarkdownEditorFloatingMenus.vue.d.ts +48 -0
- package/dist/components/MarkdownEditorFloatingMenus.vue.d.ts.map +1 -0
- package/dist/components/MarkdownEditorImageActions.vue.d.ts +20 -0
- package/dist/components/MarkdownEditorImageActions.vue.d.ts.map +1 -0
- package/dist/components/MarkdownEditorToolbar.vue.d.ts +62 -0
- package/dist/components/MarkdownEditorToolbar.vue.d.ts.map +1 -0
- package/dist/components/MarkdownEditorToolbarIcon.vue.d.ts +26 -0
- package/dist/components/MarkdownEditorToolbarIcon.vue.d.ts.map +1 -0
- package/dist/composables/useFloatingPanel.d.ts +13 -0
- package/dist/composables/useFloatingPanel.d.ts.map +1 -0
- package/dist/composables/useMarkdownEditorValue.d.ts +19 -0
- package/dist/composables/useMarkdownEditorValue.d.ts.map +1 -0
- package/dist/configure.d.ts +15 -0
- package/dist/configure.d.ts.map +1 -0
- package/dist/configure.js +19 -0
- package/dist/core/actions.d.ts +16 -0
- package/dist/core/actions.d.ts.map +1 -0
- package/dist/core/basic-editor-atomic-source.d.ts +9 -0
- package/dist/core/basic-editor-atomic-source.d.ts.map +1 -0
- package/dist/core/basic-editor-command-helpers.d.ts +11 -0
- package/dist/core/basic-editor-command-helpers.d.ts.map +1 -0
- package/dist/core/basic-editor-markdown.d.ts +7 -0
- package/dist/core/basic-editor-markdown.d.ts.map +1 -0
- package/dist/core/basic-editor-renderers.d.ts +6 -0
- package/dist/core/basic-editor-renderers.d.ts.map +1 -0
- package/dist/core/basic-editor-runtime-plugins.d.ts +7 -0
- package/dist/core/basic-editor-runtime-plugins.d.ts.map +1 -0
- package/dist/core/basic-editor-selection.d.ts +6 -0
- package/dist/core/basic-editor-selection.d.ts.map +1 -0
- package/dist/core/basic-editor-table-controls.d.ts +3 -0
- package/dist/core/basic-editor-table-controls.d.ts.map +1 -0
- package/dist/core/basic-editor-table-popover.d.ts +5 -0
- package/dist/core/basic-editor-table-popover.d.ts.map +1 -0
- package/dist/core/basic-editor-types.d.ts +96 -0
- package/dist/core/basic-editor-types.d.ts.map +1 -0
- package/dist/core/basic-editor.d.ts +14 -0
- package/dist/core/basic-editor.d.ts.map +1 -0
- package/dist/core/content-handler.d.ts +21 -0
- package/dist/core/content-handler.d.ts.map +1 -0
- package/dist/core/editor-instance.d.ts +38 -0
- package/dist/core/editor-instance.d.ts.map +1 -0
- package/dist/core/events.d.ts +22 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/extension-builder.d.ts +86 -0
- package/dist/core/extension-builder.d.ts.map +1 -0
- package/dist/core/extensions-manager.d.ts +36 -0
- package/dist/core/extensions-manager.d.ts.map +1 -0
- package/dist/core/index.d.ts +30 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/lists.d.ts +18 -0
- package/dist/core/lists.d.ts.map +1 -0
- package/dist/core/logger.d.ts +46 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/markdown-parser.d.ts +60 -0
- package/dist/core/markdown-parser.d.ts.map +1 -0
- package/dist/core/markdown.d.ts +23 -0
- package/dist/core/markdown.d.ts.map +1 -0
- package/dist/core/markup-editor.d.ts +22 -0
- package/dist/core/markup-editor.d.ts.map +1 -0
- package/dist/core/optional-renderers.d.ts +9 -0
- package/dist/core/optional-renderers.d.ts.map +1 -0
- package/dist/core/registries.d.ts +50 -0
- package/dist/core/registries.d.ts.map +1 -0
- package/dist/core/schema-dynamic-modifier.d.ts +13 -0
- package/dist/core/schema-dynamic-modifier.d.ts.map +1 -0
- package/dist/core/vue-renderer.d.ts +40 -0
- package/dist/core/vue-renderer.d.ts.map +1 -0
- package/dist/core.js +46 -0
- package/dist/cose-bilkent-JH36ORCC-CXuKFbXy.js +2608 -0
- package/dist/cynefin-VYW2F7L2-Bkk-F_Js.js +23766 -0
- package/dist/cynefinDiagram-MW4NZA55-DwOK40hm.js +299 -0
- package/dist/cytoscape.esm-3W4EOjxC.js +18756 -0
- package/dist/dagre-VZM6K2ZE-0VsGm8Ag.js +340 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/diagram-7IWD3JNH-BrApu1hz.js +350 -0
- package/dist/diagram-B4RE2ZJO-CVXoBg2r.js +461 -0
- package/dist/diagram-LBJQPF4R-Dp0eSz2L.js +142 -0
- package/dist/diagram-Q27KOJAE-DWIltqIH.js +528 -0
- package/dist/diagram-UB23O5K3-B7z2Lj3K.js +219 -0
- package/dist/directives.d.ts +10 -0
- package/dist/directives.d.ts.map +1 -0
- package/dist/ebnfDiagram-BXEA7PRR-CYgE6z_2.js +109 -0
- package/dist/erDiagram-JOGREHBK-D3QWrPo-.js +910 -0
- package/dist/extensions/additional/folding-heading.d.ts +11 -0
- package/dist/extensions/additional/folding-heading.d.ts.map +1 -0
- package/dist/extensions/additional/math.d.ts +36 -0
- package/dist/extensions/additional/math.d.ts.map +1 -0
- package/dist/extensions/additional/mermaid.d.ts +21 -0
- package/dist/extensions/additional/mermaid.d.ts.map +1 -0
- package/dist/extensions/additional/quote-link.d.ts +19 -0
- package/dist/extensions/additional/quote-link.d.ts.map +1 -0
- package/dist/extensions/additional/yfm-html-block.d.ts +21 -0
- package/dist/extensions/additional/yfm-html-block.d.ts.map +1 -0
- package/dist/extensions/base.d.ts +9 -0
- package/dist/extensions/base.d.ts.map +1 -0
- package/dist/extensions/behavior/clicks-on-edges.d.ts +12 -0
- package/dist/extensions/behavior/clicks-on-edges.d.ts.map +1 -0
- package/dist/extensions/behavior/clipboard.d.ts +6 -0
- package/dist/extensions/behavior/clipboard.d.ts.map +1 -0
- package/dist/extensions/behavior/cursor.d.ts +29 -0
- package/dist/extensions/behavior/cursor.d.ts.map +1 -0
- package/dist/extensions/behavior/editor-mode-keymap.d.ts +8 -0
- package/dist/extensions/behavior/editor-mode-keymap.d.ts.map +1 -0
- package/dist/extensions/behavior/history.d.ts +21 -0
- package/dist/extensions/behavior/history.d.ts.map +1 -0
- package/dist/extensions/behavior/placeholder.d.ts +11 -0
- package/dist/extensions/behavior/placeholder.d.ts.map +1 -0
- package/dist/extensions/behavior/resizable.d.ts +4 -0
- package/dist/extensions/behavior/resizable.d.ts.map +1 -0
- package/dist/extensions/behavior/selection-commands.d.ts +24 -0
- package/dist/extensions/behavior/selection-commands.d.ts.map +1 -0
- package/dist/extensions/behavior/selection-context.d.ts +9 -0
- package/dist/extensions/behavior/selection-context.d.ts.map +1 -0
- package/dist/extensions/behavior/selection.d.ts +12 -0
- package/dist/extensions/behavior/selection.d.ts.map +1 -0
- package/dist/extensions/index.d.ts +34 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/markdown/blockquote-specs.d.ts +15 -0
- package/dist/extensions/markdown/blockquote-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/blockquote.d.ts +14 -0
- package/dist/extensions/markdown/blockquote.d.ts.map +1 -0
- package/dist/extensions/markdown/bold-specs.d.ts +12 -0
- package/dist/extensions/markdown/bold-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/bold.d.ts +17 -0
- package/dist/extensions/markdown/bold.d.ts.map +1 -0
- package/dist/extensions/markdown/breaks-specs.d.ts +22 -0
- package/dist/extensions/markdown/breaks-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/breaks.d.ts +11 -0
- package/dist/extensions/markdown/breaks.d.ts.map +1 -0
- package/dist/extensions/markdown/code-block-specs.d.ts +14 -0
- package/dist/extensions/markdown/code-block-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/code-block.d.ts +14 -0
- package/dist/extensions/markdown/code-block.d.ts.map +1 -0
- package/dist/extensions/markdown/code-specs.d.ts +9 -0
- package/dist/extensions/markdown/code-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/code.d.ts +11 -0
- package/dist/extensions/markdown/code.d.ts.map +1 -0
- package/dist/extensions/markdown/deflist-specs.d.ts +16 -0
- package/dist/extensions/markdown/deflist-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/deflist.d.ts +14 -0
- package/dist/extensions/markdown/deflist.d.ts.map +1 -0
- package/dist/extensions/markdown/heading-specs.d.ts +11 -0
- package/dist/extensions/markdown/heading-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/heading.d.ts +17 -0
- package/dist/extensions/markdown/heading.d.ts.map +1 -0
- package/dist/extensions/markdown/horizontal-rule-specs.d.ts +10 -0
- package/dist/extensions/markdown/horizontal-rule-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/horizontal-rule.d.ts +8 -0
- package/dist/extensions/markdown/horizontal-rule.d.ts.map +1 -0
- package/dist/extensions/markdown/html.d.ts +15 -0
- package/dist/extensions/markdown/html.d.ts.map +1 -0
- package/dist/extensions/markdown/image.d.ts +39 -0
- package/dist/extensions/markdown/image.d.ts.map +1 -0
- package/dist/extensions/markdown/italic-specs.d.ts +12 -0
- package/dist/extensions/markdown/italic-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/italic.d.ts +11 -0
- package/dist/extensions/markdown/italic.d.ts.map +1 -0
- package/dist/extensions/markdown/link-specs.d.ts +19 -0
- package/dist/extensions/markdown/link-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/link.d.ts +21 -0
- package/dist/extensions/markdown/link.d.ts.map +1 -0
- package/dist/extensions/markdown/list-specs.d.ts +6 -0
- package/dist/extensions/markdown/list-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/lists.d.ts +18 -0
- package/dist/extensions/markdown/lists.d.ts.map +1 -0
- package/dist/extensions/markdown/mark.d.ts +12 -0
- package/dist/extensions/markdown/mark.d.ts.map +1 -0
- package/dist/extensions/markdown/strike.d.ts +12 -0
- package/dist/extensions/markdown/strike.d.ts.map +1 -0
- package/dist/extensions/markdown/subscript.d.ts +12 -0
- package/dist/extensions/markdown/subscript.d.ts.map +1 -0
- package/dist/extensions/markdown/table-actions.d.ts +14 -0
- package/dist/extensions/markdown/table-actions.d.ts.map +1 -0
- package/dist/extensions/markdown/table-specs.d.ts +25 -0
- package/dist/extensions/markdown/table-specs.d.ts.map +1 -0
- package/dist/extensions/markdown/table.d.ts +6 -0
- package/dist/extensions/markdown/table.d.ts.map +1 -0
- package/dist/extensions/markdown/underline.d.ts +12 -0
- package/dist/extensions/markdown/underline.d.ts.map +1 -0
- package/dist/extensions/specs.d.ts +13 -0
- package/dist/extensions/specs.d.ts.map +1 -0
- package/dist/extensions.js +247 -0
- package/dist/flowDiagram-UKHOOZJN-CfjPcHNW.js +1638 -0
- package/dist/forms/MarkdownEditorForm.vue.d.ts +37 -0
- package/dist/forms/MarkdownEditorForm.vue.d.ts.map +1 -0
- package/dist/forms/MarkdownEditorImageForm.vue.d.ts +131 -0
- package/dist/forms/MarkdownEditorImageForm.vue.d.ts.map +1 -0
- package/dist/forms/MarkdownEditorLinkForm.vue.d.ts +119 -0
- package/dist/forms/MarkdownEditorLinkForm.vue.d.ts.map +1 -0
- package/dist/forms/MarkdownEditorTextInput.vue.d.ts +39 -0
- package/dist/forms/MarkdownEditorTextInput.vue.d.ts.map +1 -0
- package/dist/forms/index.d.ts +7 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms.js +7 -0
- package/dist/full-C-o2lPBX.js +16 -0
- package/dist/full-specs-Cl-ODShc.js +10 -0
- package/dist/ganttDiagram-PKOTCBZU-ECmaWI-9.js +2711 -0
- package/dist/gitGraphDiagram-DS77QQ5N-DgG1RGJ8.js +815 -0
- package/dist/graph-DAHC4kPm.js +1545 -0
- package/dist/heading-specs-D7Bj4aIM.js +489 -0
- package/dist/i18n/index.d.ts +70 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n.js +132 -0
- package/dist/index-CqpK5VVw.js +149 -0
- package/dist/index-uerphigI.js +82 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1293 -0
- package/dist/infoDiagram-6WML65LV-B1Yl3nZV.js +24 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-WSZJBQD7-4sngaB5o.js +621 -0
- package/dist/journeyDiagram-NVQOT4AX-B_6AmR_j.js +834 -0
- package/dist/kanban-definition-27J2QSJJ-B8BO9o8J.js +724 -0
- package/dist/katex-ByXcxnHy.js +14436 -0
- package/dist/katex-DoRnZ_sp.js +11682 -0
- package/dist/layout-DBbo_M5I.js +1519 -0
- package/dist/linear-BEdRfKba.js +259 -0
- package/dist/map-DRdzG8Ho.js +224 -0
- package/dist/mermaid.core-CR0bA2Wa.js +16496 -0
- package/dist/mindmap-definition-FAOFIHXS-DnPz807N.js +827 -0
- package/dist/optional-renderers-BalvqqvY.js +11 -0
- package/dist/ordinal-B6-f3MAq.js +61 -0
- package/dist/pegDiagram-VL7TDLO6-csGWlzs8.js +95 -0
- package/dist/pieDiagram-7S7Q4E2Y-Bqs8j5FX.js +207 -0
- package/dist/presets/commonmark-specs.d.ts +9 -0
- package/dist/presets/commonmark-specs.d.ts.map +1 -0
- package/dist/presets/commonmark.d.ts +26 -0
- package/dist/presets/commonmark.d.ts.map +1 -0
- package/dist/presets/default.d.ts +6 -0
- package/dist/presets/default.d.ts.map +1 -0
- package/dist/presets/full-specs.d.ts +6 -0
- package/dist/presets/full-specs.d.ts.map +1 -0
- package/dist/presets/full.d.ts +17 -0
- package/dist/presets/full.d.ts.map +1 -0
- package/dist/presets/index.d.ts +13 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/zero.d.ts +8 -0
- package/dist/presets/zero.d.ts.map +1 -0
- package/dist/presets.js +10 -0
- package/dist/public-types.d.ts +96 -0
- package/dist/public-types.d.ts.map +1 -0
- package/dist/quadrantDiagram-CIZ2JOQS-jzP4lRrY.js +1023 -0
- package/dist/railroadDiagram-AXF67PYL-BSCyR24u.js +77 -0
- package/dist/renderer/MarkdownRenderer.vue.d.ts +10 -0
- package/dist/renderer/MarkdownRenderer.vue.d.ts.map +1 -0
- package/dist/renderer/index.d.ts +3 -0
- package/dist/renderer/index.d.ts.map +1 -0
- package/dist/renderer/markdown.d.ts +2 -0
- package/dist/renderer/markdown.d.ts.map +1 -0
- package/dist/renderer/mermaid-runtime.d.ts +4 -0
- package/dist/renderer/mermaid-runtime.d.ts.map +1 -0
- package/dist/renderer.js +258 -0
- package/dist/requirementDiagram-LRYGKXZP-DmEkLYqX.js +882 -0
- package/dist/sankeyDiagram-W5VNT64P-CYvRYMTh.js +847 -0
- package/dist/schema-dynamic-modifier-Dhf0m6tE.js +21514 -0
- package/dist/schema-dynamic-modifier.css +1 -0
- package/dist/sequenceDiagram-SI44F4Z6-CyWbDtPA.js +2888 -0
- package/dist/sizeCapture-X5ZJPWSS-xKhYCY84.js +46 -0
- package/dist/specs.js +127 -0
- package/dist/stateDiagram-OKZ733FA-DP44R2Dd.js +263 -0
- package/dist/stateDiagram-v2-UEYNNEHI-BvlOisND.js +16 -0
- package/dist/swimlanes-SLNWSIFB-BKFp8twH.js +5332 -0
- package/dist/swimlanesDiagram-ULZ7WXOC-CTvIFuHq.js +13 -0
- package/dist/timeline-definition-Z64GVDOM-B4137uIl.js +1055 -0
- package/dist/toolbar/config.d.ts +45 -0
- package/dist/toolbar/config.d.ts.map +1 -0
- package/dist/toolbar/index.d.ts +3 -0
- package/dist/toolbar/index.d.ts.map +1 -0
- package/dist/toolbar.js +100 -0
- package/dist/use-markdown-editor.d.ts +14 -0
- package/dist/use-markdown-editor.d.ts.map +1 -0
- package/dist/vennDiagram-T6HMQDX7-CPs8gXjx.js +1578 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/wardleyDiagram-T6FBY63Y-BYp13hbI.js +675 -0
- package/dist/xychartDiagram-ELKLHX3M-DTT37K2u.js +1388 -0
- package/package.json +110 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1293 @@
|
|
|
1
|
+
import { Lang as Ua, configure as Wa, getConfig as Qa, subscribeConfigure as Ga } from "./configure.js";
|
|
2
|
+
import { cn as Za } from "./classname.js";
|
|
3
|
+
import { getMarkdownEditorMessages as Ge } from "./i18n.js";
|
|
4
|
+
import { markdownEditorMessages as Xa } from "./i18n.js";
|
|
5
|
+
import { n as Ye, u as ce, r as Ze, q as Ke, o as Xe } from "./schema-dynamic-modifier-Dhf0m6tE.js";
|
|
6
|
+
import { A as _a, E as el, a as tl, b as al, c as ll, L as nl, L as ol, M as il, e as sl, f as rl, P as dl, g as ul, S as ml, h as cl, i as gl, j as vl, k as fl, W as bl, l as kl, m as wl, s as hl, p as yl, t as Ml } from "./schema-dynamic-modifier-Dhf0m6tE.js";
|
|
7
|
+
import { c4 as Je, c5 as _e, c6 as et, c7 as tt, c8 as at } from "./base-Bnv2-Te4.js";
|
|
8
|
+
import { B as pl, g as xl, h as Ll, i as Tl, k as Bl, n as El, C as Hl, o as $l, p as Vl, q as Sl, r as Al, D as Pl, E as zl, G as Fl, H as Nl, u as Rl, v as Dl, w as Il, x as Ol, y as ql, z as jl, I as Ul, A as Wl, J as Ql, L as Gl, K as Yl, M as Zl, P as Kl, Q as Xl, R as Jl, S as _l, T as en, U as tn, V as an, X as ln, Y as nn, c9 as on, Z as sn, _ as rn, $ as dn, a0 as un, a1 as mn, a2 as cn, a3 as gn, a4 as vn, a5 as fn, a6 as bn, ca as kn, cb as wn, cc as hn, cd as yn, c as Mn, ce as Cn, ac as pn, ad as xn, af as Ln, a as Tn, b as Bn, ak as En, d as Hn, e as $n, f as Vn, an as Sn, ao as An, ap as Pn, aq as zn, ar as Fn, cf as Nn, cg as Rn, ch as Dn, ci as In, cj as On, as as qn, at as jn, au as Un, av as Wn, aw as Qn, ax as Gn, ay as Yn, az as Zn, aA as Kn, aB as Xn, aC as Jn, aD as _n, aF as eo, aG as to, aI as ao, aJ as lo, ck as no, aN as oo, aP as io, aT as so, aU as ro, aV as uo, aW as mo, aX as co, aY as go, j as vo, l as fo, a_ as bo, a$ as ko, m as wo, b7 as ho, b8 as yo, bd as Mo, be as Co, bh as po, bi as xo, bl as Lo, bn as To, bo as Bo, bp as Eo, bz as Ho, bA as $o, bB as Vo, bC as So, bD as Ao, s as Po, bE as zo, bF as Fo, bL as No, t as Ro, bN as Do, bO as Io, bQ as Oo, bR as qo, bS as jo, bT as Uo, bU as Wo, bV as Qo, bX as Go, bY as Yo, b$ as Zo, c0 as Ko, c1 as Xo } from "./base-Bnv2-Te4.js";
|
|
9
|
+
import { c as _o, g as ei } from "./optional-renderers-BalvqqvY.js";
|
|
10
|
+
import { defineComponent as K, openBlock as s, createElementBlock as u, ref as y, Fragment as A, createElementVNode as v, withModifiers as w, createVNode as C, toDisplayString as B, createCommentVNode as T, renderList as ne, createStaticVNode as lt, unref as m, renderSlot as ge, onBeforeUnmount as ve, nextTick as le, getCurrentInstance as Te, computed as xe, watch as te, onMounted as nt, createBlock as Z, withCtx as ot, normalizeProps as it, guardReactiveProps as st, Teleport as rt, normalizeClass as dt, readonly as ae } from "vue";
|
|
11
|
+
import { c as X, a as ut, M as mt } from "./MarkdownEditorLinkForm-mq-BVYM_.js";
|
|
12
|
+
import { _ as ai, b as li } from "./MarkdownEditorLinkForm-mq-BVYM_.js";
|
|
13
|
+
import { getToolbarConfig as ct, isToolbarItemEnabled as V, isToolbarItemActive as j, normalizeToolbarItem as gt, isToolbarItemAvailable as vt } from "./toolbar.js";
|
|
14
|
+
import { commonmarkToolbarConfig as oi, createToolbarConfig as ii, createToolbarGroup as si, createToolbarItem as ri, defaultToolbarConfig as di, fullToolbarConfig as ui, markdownEditorToolbarItemIds as mi, minimalToolbarConfig as ci, zeroToolbarConfig as gi } from "./toolbar.js";
|
|
15
|
+
import "./katex-ByXcxnHy.js";
|
|
16
|
+
import { C as fi, D as bi, F as ki, Z as wi } from "./full-C-o2lPBX.js";
|
|
17
|
+
import { C as yi, F as Mi } from "./full-specs-Cl-ODShc.js";
|
|
18
|
+
import { B as pi, a as xi, b as Li, c as Ti, d as Bi, C as Ei, e as Hi, f as $i, D as Vi, g as Si, h as Ai, H as Pi, i as zi, I as Fi, j as Ni, L as Ri, k as Di, T as Ii, l as Oi, m as qi, n as ji, o as Ui, r as Wi, v as Qi, y as Gi, M as Yi, O as Zi, R as Ki, S as Xi, W as Ji, Z as _i } from "./heading-specs-D7Bj4aIM.js";
|
|
19
|
+
import './index.css';const ft = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2.47 4.72a.75.75 0 0 0 0 1.06l3 3a.75.75 0 0 0 1.06-1.06L4.81 6H9a3.25 3.25 0 0 1 0 6.5H8A.75.75 0 0 0 8 14h1a4.75 4.75 0 1 0 0-9.5H4.81l1.72-1.72a.75.75 0 0 0-1.06-1.06z" clip-rule="evenodd"/></svg>
|
|
20
|
+
`, bt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M13.53 4.72a.75.75 0 0 1 0 1.06l-3 3a.75.75 0 1 1-1.06-1.06L11.19 6H7a3.25 3.25 0 0 0 0 6.5h1A.75.75 0 0 1 8 14H7a4.75 4.75 0 1 1 0-9.5h4.19L9.47 2.78a.75.75 0 0 1 1.06-1.06z" clip-rule="evenodd"/></svg>
|
|
21
|
+
`, kt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M4.25 2.25A.75.75 0 0 0 3.5 3v10c0 .414.336.75.75.75H9.5a3.25 3.25 0 0 0 1.477-6.146A3.25 3.25 0 0 0 8.5 2.25zm3.5 5a1.75 1.75 0 1 0 0-3.5h-2v3.5zm-2 1.5v3.5h3a1.75 1.75 0 1 0 0-3.5z" clip-rule="evenodd"/></svg>
|
|
22
|
+
`, wt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2.5 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5m3.25-2a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5zm0 8.5a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5zM5 8a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-8.5A.75.75 0 0 1 5 8M3.75 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0M2.5 13.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5" clip-rule="evenodd"/></svg>
|
|
23
|
+
`, ht = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/></svg>
|
|
24
|
+
`, yt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M10.218 3.216a.75.75 0 0 0-1.436-.431l-3 10a.75.75 0 0 0 1.436.43zM4.53 4.97a.75.75 0 0 1 0 1.06L2.56 8l1.97 1.97a.75.75 0 0 1-1.06 1.06l-2.5-2.5a.75.75 0 0 1 0-1.06l2.5-2.5a.75.75 0 0 1 1.06 0m6.94 6.06a.75.75 0 0 1 0-1.06L13.44 8l-1.97-1.97a.75.75 0 0 1 1.06-1.06l2.5 2.5a.75.75 0 0 1 0 1.06l-2.5 2.5a.75.75 0 0 1-1.06 0" clip-rule="evenodd"/></svg>
|
|
25
|
+
`, Mt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill="currentColor" fill-rule="evenodd" d="M4.312 4.29a.764.764 0 0 1 1.103-.62.75.75 0 1 0 .67-1.34 2.264 2.264 0 0 0-3.268 1.836L2.706 5.5H1.75a.75.75 0 0 0 0 1.5h.83l-.392 4.71a.764.764 0 0 1-1.103.62.75.75 0 0 0-.67 1.34 2.264 2.264 0 0 0 3.268-1.836L4.086 7H5.25a.75.75 0 1 0 0-1.5H4.21zm6.014 2.23a.75.75 0 0 0-1.152.96l.85 1.02-.85 1.02a.75.75 0 0 0 1.152.96L11 9.672l.674.808a.75.75 0 0 0 1.152-.96l-.85-1.02.85-1.02a.75.75 0 0 0-1.152-.96L11 7.328zM8.02 4.55a.75.75 0 0 1 .43.969l-.145.378a7.25 7.25 0 0 0 0 5.205l.145.378a.75.75 0 0 1-1.4.539l-.145-.378a8.75 8.75 0 0 1 0-6.282l.145-.378a.75.75 0 0 1 .97-.431m5.961 0a.75.75 0 0 1 .97.43l.145.379a8.75 8.75 0 0 1 0 6.282l-.146.378a.75.75 0 1 1-1.4-.538l.146-.379a7.25 7.25 0 0 0 0-5.205l-.146-.378a.75.75 0 0 1 .431-.97" clip-rule="evenodd"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
|
26
|
+
`, Ct = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">
|
|
27
|
+
<circle cx="8" cy="8" r="2.25"/>
|
|
28
|
+
<path d="M6.7 1.5h2.6l.4 1.6c.3.1.6.3.9.5l1.6-.5 1.3 2.2-1.2 1.1v1.2l1.2 1.1-1.3 2.2-1.6-.5-.9.5-.4 1.6H6.7l-.4-1.6-.9-.5-1.6.5-1.3-2.2 1.2-1.1V6.4L2.5 5.3l1.3-2.2 1.6.5.9-.5.4-1.6Z"/>
|
|
29
|
+
</svg>
|
|
30
|
+
`, pt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M1.75 8a.75.75 0 0 1 .75-.75h11a.75.75 0 0 1 0 1.5h-11A.75.75 0 0 1 1.75 8" clip-rule="evenodd"/></svg>
|
|
31
|
+
`, xt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M11.5 3h-7A1.5 1.5 0 0 0 3 4.5v5.027l.962-.7a1.75 1.75 0 0 1 2.079.016l.928.696 2.368-2.03a1.75 1.75 0 0 1 2.325.043L13 8.787V4.5A1.5 1.5 0 0 0 11.5 3m3 7.498V4.5a3 3 0 0 0-3-3h-7a3 3 0 0 0-3 3v7a3 3 0 0 0 3 3h7a3 3 0 0 0 3-3zm-1.5.33-2.355-2.174a.25.25 0 0 0-.332-.006L7.488 11.07l-.457.392-.481-.361-1.41-1.057a.25.25 0 0 0-.296-.002L3 11.381v.119A1.5 1.5 0 0 0 4.5 13h7a1.5 1.5 0 0 0 1.5-1.5zM7.5 6a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" clip-rule="evenodd"/></svg>
|
|
32
|
+
`, Lt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M7.25 2a.75.75 0 0 0 0 1.5h1.317l-2.7 9H4.25a.75.75 0 1 0 0 1.5h4.5a.75.75 0 0 0 0-1.5H7.433l2.7-9h1.617a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/></svg>
|
|
33
|
+
`, Tt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3.47 6.53a.75.75 0 0 1 1.06 1.061l-.727.727a2.743 2.743 0 0 0 3.879 3.879l.727-.727a.75.75 0 0 1 1.06 1.06l-.726.727a4.243 4.243 0 0 1-6-6zm8 1.879a.75.75 0 0 0 1.06 1.06l.727-.726a4.243 4.243 0 0 0-6-6l-.727.727a.75.75 0 0 0 1.061 1.06l.727-.727a2.743 2.743 0 0 1 3.879 3.879zm-.94-1.879a.75.75 0 1 0-1.06-1.06l-4 4a.75.75 0 1 0 1.06 1.06z" clip-rule="evenodd"/></svg>
|
|
34
|
+
`, Bt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">
|
|
35
|
+
<rect x="1.5" y="1.5" width="4" height="3" rx=".75"/>
|
|
36
|
+
<rect x="10.5" y="1.5" width="4" height="3" rx=".75"/>
|
|
37
|
+
<rect x="6" y="11.5" width="4" height="3" rx=".75"/>
|
|
38
|
+
<path d="M3.5 4.5v2h4.5v5M12.5 4.5v2H8"/>
|
|
39
|
+
</svg>
|
|
40
|
+
`, Et = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3.21 2.5a.5.5 0 0 0-.796-.403l-.71.524a.5.5 0 0 0 .507.856V5a.5.5 0 0 0 1 0zm2.54.5a.75.75 0 1 0 0 1.5h8.5a.75.75 0 0 0 0-1.5zm0 8.5a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5zM5 8a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-8.5A.75.75 0 0 1 5 8m-2.596-.67c-.07.051-.087.097-.09.116a.5.5 0 0 1-.988-.149c.051-.345.26-.61.495-.779.236-.169.531-.268.83-.268.345 0 .666.109.902.343s.337.543.337.85c0 .51-.321.855-.76 1.278l-.02.018-.013.011h.493a.5.5 0 0 1 0 1H1.75a.5.5 0 0 1-.326-.879l1.022-.88c.223-.216.338-.344.398-.434.046-.069.046-.092.046-.111v-.002c0-.09-.027-.127-.041-.141-.013-.013-.062-.053-.199-.053a.44.44 0 0 0-.246.08M1.9 10.5a.5.5 0 0 0 0 1h.38l-.15.18a.5.5 0 0 0 .383.82c.259 0 .365.077.407.122.051.054.08.133.08.218a.02.02 0 0 1-.004.014.2.2 0 0 1-.057.052.7.7 0 0 1-.371.094.55.55 0 0 1-.258-.057c-.059-.032-.075-.061-.076-.064a.5.5 0 0 0-.91.416c.213.464.728.705 1.244.705.319 0 .651-.082.92-.258.275-.181.512-.487.512-.902 0-.293-.096-.634-.355-.906a1.3 1.3 0 0 0-.252-.206l.34-.407a.5.5 0 0 0-.383-.821z" clip-rule="evenodd"/></svg>
|
|
41
|
+
`, Ht = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill="currentColor" fill-rule="evenodd" d="M12.411 6.33A2.75 2.75 0 0 1 14.5 9v.25A2.75 2.75 0 0 1 11.75 12h-.25a2.747 2.747 0 0 1-2.748-2.657V9.34H8.75V9q0-.197.027-.386.03-.392.09-.77a8 8 0 0 1 .559-1.918 7.2 7.2 0 0 1 2.162-2.801l.098-.076A.24.24 0 0 1 11.83 3c.186 0 .306.202.22.367a19 19 0 0 0-.22.433 18 18 0 0 0-.43.951 14 14 0 0 0-.557 1.578l.054-.013a2.8 2.8 0 0 1 .603-.066h.25q.343.001.661.08m.549-1.405A4.25 4.25 0 0 1 16 9v.25a4.25 4.25 0 0 1-4.25 4.25h-.25A4.25 4.25 0 0 1 8 11.662 4.25 4.25 0 0 1 4.5 13.5h-.25A4.25 4.25 0 0 1 0 9.336V9q0-.275.035-.543c.207-2.62 1.358-4.966 3.488-6.599A1.74 1.74 0 0 1 4.58 1.5c1.341 0 2.146 1.425 1.548 2.564-.111.211-.26.508-.418.86.788.234 1.481.69 2.005 1.297a8.76 8.76 0 0 1 3.058-4.363A1.74 1.74 0 0 1 11.83 1.5c1.341 0 2.146 1.425 1.548 2.564-.111.211-.26.508-.418.86M5.16 6.33a2.8 2.8 0 0 0-.661-.08h-.25a2.8 2.8 0 0 0-.657.079 14 14 0 0 1 .68-1.865A18 18 0 0 1 4.8 3.367.25.25 0 0 0 4.58 3a.24.24 0 0 0-.144.049 8 8 0 0 0-.93.844 7.2 7.2 0 0 0-1.39 2.172 8 8 0 0 0-.498 1.779q-.062.378-.091.77A3 3 0 0 0 1.5 9v.339h.001v.004A2.747 2.747 0 0 0 4.25 12h.251a2.75 2.75 0 0 0 2.75-2.75V9c0-1.29-.89-2.374-2.089-2.67" clip-rule="evenodd"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
|
42
|
+
`, $t = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M5.502 2.757C6.214 2.236 7.122 2 7.984 2c1.685 0 3.015.572 3.687 1.915a.75.75 0 1 1-1.342.67C10.001 3.93 9.331 3.5 7.984 3.5c-.611 0-1.19.17-1.597.468-.384.28-.627.678-.627 1.242 0 .403.165.758.463 1.04H4.447a2.9 2.9 0 0 1-.187-1.04c0-1.084.507-1.916 1.242-2.453m6.047 5.993h1.201a.75.75 0 0 0 0-1.5h-9.5a.75.75 0 0 0 0 1.5h5.475l.043.012h.002c1.196.323 1.98 1.005 1.98 1.988 0 .669-.289 1.063-.742 1.33-.5.296-1.222.437-2 .437-1.398 0-2.453-.472-2.796-1.504a.75.75 0 1 0-1.424.474c.657 1.969 2.602 2.53 4.22 2.53.915 0 1.94-.16 2.762-.644.869-.512 1.48-1.376 1.48-2.623 0-.822-.276-1.481-.7-2" clip-rule="evenodd"/></svg>
|
|
43
|
+
`, Vt = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M9.25 3.5h-2.5v2h2.5zM4 3.5h1.25v2H2.5V5A1.5 1.5 0 0 1 4 3.5M2.5 7h2.75v2H2.5zm0 3.5v.5A1.5 1.5 0 0 0 4 12.5h1.25v-2zm4.25 0v2h2.5v-2zm4 0v2H12a1.5 1.5 0 0 0 1.5-1.5v-.5zM13.5 9h-2.75V7h2.75zM9.25 9h-2.5V7h2.5zm1.5-5.5v2h2.75V5A1.5 1.5 0 0 0 12 3.5zM4 2a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3z" clip-rule="evenodd"/></svg>
|
|
44
|
+
`, St = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M5 2.75a.75.75 0 0 0-1.5 0V7a4.5 4.5 0 0 0 9 0V2.75a.75.75 0 0 0-1.5 0V7a3 3 0 0 1-6 0zm-.75 9.75a.75.75 0 0 0 0 1.5h7.5a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/></svg>
|
|
45
|
+
`, At = ["innerHTML"], Pt = /* @__PURE__ */ K({
|
|
46
|
+
__name: "MarkdownEditorToolbarIcon",
|
|
47
|
+
props: {
|
|
48
|
+
name: {}
|
|
49
|
+
},
|
|
50
|
+
setup(e) {
|
|
51
|
+
const c = { arrowLeft: ft, arrowRight: bt, bold: kt, bulletList: wt, chevronDown: ht, code: yt, function: Mt, gear: Ct, horizontalRule: pt, image: xt, italic: Lt, link: Tt, mermaid: Bt, orderedList: Et, quote: Ht, strike: $t, table: Vt, underline: St }, M = e;
|
|
52
|
+
return (d, f) => (s(), u("span", {
|
|
53
|
+
class: "markdown-editor__toolbar-icon",
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
innerHTML: c[M.name]
|
|
56
|
+
}, null, 8, At));
|
|
57
|
+
}
|
|
58
|
+
}), p = /* @__PURE__ */ X(Pt, [["__scopeId", "data-v-ec4329c1"]]), zt = ["data-theme", "aria-label"], Ft = ["aria-checked"], Nt = ["aria-checked"], Rt = ["data-theme", "aria-label"], Dt = ["aria-checked", "onClick"], It = { class: "markdown-editor__floating-menu-icon" }, Ot = ["data-theme", "aria-label"], qt = ["data-theme", "aria-label"], jt = ["aria-checked"], Ut = ["aria-checked"], Wt = ["disabled"], Qt = ["disabled"], Gt = ["data-theme", "aria-label"], Yt = ["aria-checked", "onClick"], Zt = /* @__PURE__ */ K({
|
|
59
|
+
__name: "MarkdownEditorFloatingMenus",
|
|
60
|
+
props: {
|
|
61
|
+
codeVisible: { type: Boolean },
|
|
62
|
+
formulaVisible: { type: Boolean },
|
|
63
|
+
headingVisible: { type: Boolean },
|
|
64
|
+
listVisible: { type: Boolean },
|
|
65
|
+
mode: {},
|
|
66
|
+
modeVisible: { type: Boolean },
|
|
67
|
+
state: {},
|
|
68
|
+
textStyle: {},
|
|
69
|
+
theme: {},
|
|
70
|
+
translate: { type: Function }
|
|
71
|
+
},
|
|
72
|
+
emits: ["code-block", "inline-code", "inline-formula", "math-block", "select-mode", "select-text-style", "bullet-list", "ordered-list", "indent-list", "outdent-list"],
|
|
73
|
+
setup(e, { expose: c, emit: M }) {
|
|
74
|
+
const d = M, f = y(), r = y(), h = y(), o = y(), t = y(), b = ["wysiwyg", "markup", "split"];
|
|
75
|
+
return c({
|
|
76
|
+
getElement(n) {
|
|
77
|
+
return { code: f.value, formula: r.value, heading: h.value, list: o.value, mode: t.value }[n];
|
|
78
|
+
}
|
|
79
|
+
}), (n, l) => (s(), u(A, null, [
|
|
80
|
+
e.codeVisible ? (s(), u("div", {
|
|
81
|
+
key: 0,
|
|
82
|
+
ref_key: "code",
|
|
83
|
+
ref: f,
|
|
84
|
+
class: "markdown-editor__floating-menu",
|
|
85
|
+
"data-theme": e.theme,
|
|
86
|
+
role: "menu",
|
|
87
|
+
"aria-label": e.translate("code")
|
|
88
|
+
}, [
|
|
89
|
+
v("button", {
|
|
90
|
+
"aria-checked": e.state.code,
|
|
91
|
+
role: "menuitemradio",
|
|
92
|
+
type: "button",
|
|
93
|
+
onMousedown: l[0] || (l[0] = w(() => {
|
|
94
|
+
}, ["prevent"])),
|
|
95
|
+
onClick: l[1] || (l[1] = (k) => d("inline-code"))
|
|
96
|
+
}, [
|
|
97
|
+
C(p, { name: "code" }),
|
|
98
|
+
v("span", null, B(e.translate("code")), 1)
|
|
99
|
+
], 40, Ft),
|
|
100
|
+
v("button", {
|
|
101
|
+
"aria-checked": e.state.codeBlock,
|
|
102
|
+
role: "menuitemradio",
|
|
103
|
+
type: "button",
|
|
104
|
+
onMousedown: l[2] || (l[2] = w(() => {
|
|
105
|
+
}, ["prevent"])),
|
|
106
|
+
onClick: l[3] || (l[3] = (k) => d("code-block"))
|
|
107
|
+
}, [
|
|
108
|
+
l[16] || (l[16] = v("span", { class: "markdown-editor__floating-menu-icon" }, "{ }", -1)),
|
|
109
|
+
v("span", null, B(e.translate("codeBlock")), 1)
|
|
110
|
+
], 40, Nt)
|
|
111
|
+
], 8, zt)) : T("", !0),
|
|
112
|
+
e.headingVisible ? (s(), u("div", {
|
|
113
|
+
key: 1,
|
|
114
|
+
ref_key: "heading",
|
|
115
|
+
ref: h,
|
|
116
|
+
class: "markdown-editor__floating-menu",
|
|
117
|
+
"data-theme": e.theme,
|
|
118
|
+
role: "menu",
|
|
119
|
+
"aria-label": e.translate("heading")
|
|
120
|
+
}, [
|
|
121
|
+
(s(), u(A, null, ne(["paragraph", "1", "2", "3", "4", "5", "6"], (k) => v("button", {
|
|
122
|
+
key: k,
|
|
123
|
+
"aria-checked": e.textStyle === k,
|
|
124
|
+
role: "menuitemradio",
|
|
125
|
+
type: "button",
|
|
126
|
+
onClick: (J) => d("select-text-style", k)
|
|
127
|
+
}, [
|
|
128
|
+
v("span", It, B(k === "paragraph" ? "T" : `H${k}`), 1),
|
|
129
|
+
v("span", null, B(k === "paragraph" ? e.translate("paragraph") : `${e.translate("heading")} ${k}`), 1)
|
|
130
|
+
], 8, Dt)), 64))
|
|
131
|
+
], 8, Rt)) : T("", !0),
|
|
132
|
+
e.formulaVisible ? (s(), u("div", {
|
|
133
|
+
key: 2,
|
|
134
|
+
ref_key: "formula",
|
|
135
|
+
ref: r,
|
|
136
|
+
class: "markdown-editor__floating-menu",
|
|
137
|
+
"data-theme": e.theme,
|
|
138
|
+
role: "menu",
|
|
139
|
+
"aria-label": e.translate("formulaInsert")
|
|
140
|
+
}, [
|
|
141
|
+
v("button", {
|
|
142
|
+
role: "menuitem",
|
|
143
|
+
type: "button",
|
|
144
|
+
onMousedown: l[4] || (l[4] = w(() => {
|
|
145
|
+
}, ["prevent"])),
|
|
146
|
+
onClick: l[5] || (l[5] = (k) => d("inline-formula"))
|
|
147
|
+
}, [
|
|
148
|
+
l[17] || (l[17] = v("span", { class: "markdown-editor__floating-menu-icon" }, "ƒ", -1)),
|
|
149
|
+
v("span", null, B(e.translate("formulaInline")), 1)
|
|
150
|
+
], 32),
|
|
151
|
+
v("button", {
|
|
152
|
+
role: "menuitem",
|
|
153
|
+
type: "button",
|
|
154
|
+
onMousedown: l[6] || (l[6] = w(() => {
|
|
155
|
+
}, ["prevent"])),
|
|
156
|
+
onClick: l[7] || (l[7] = (k) => d("math-block"))
|
|
157
|
+
}, [
|
|
158
|
+
l[18] || (l[18] = v("span", { class: "markdown-editor__floating-menu-icon" }, "∑", -1)),
|
|
159
|
+
v("span", null, B(e.translate("formulaBlock")), 1)
|
|
160
|
+
], 32)
|
|
161
|
+
], 8, Ot)) : T("", !0),
|
|
162
|
+
e.listVisible ? (s(), u("div", {
|
|
163
|
+
key: 3,
|
|
164
|
+
ref_key: "list",
|
|
165
|
+
ref: o,
|
|
166
|
+
class: "markdown-editor__floating-menu markdown-editor__floating-menu--list",
|
|
167
|
+
"data-theme": e.theme,
|
|
168
|
+
role: "menu",
|
|
169
|
+
"aria-label": e.translate("bulletList")
|
|
170
|
+
}, [
|
|
171
|
+
v("button", {
|
|
172
|
+
"aria-checked": e.state.bulletList,
|
|
173
|
+
role: "menuitemradio",
|
|
174
|
+
type: "button",
|
|
175
|
+
onMousedown: l[8] || (l[8] = w(() => {
|
|
176
|
+
}, ["prevent"])),
|
|
177
|
+
onClick: l[9] || (l[9] = (k) => d("bullet-list"))
|
|
178
|
+
}, [
|
|
179
|
+
C(p, { name: "bulletList" }),
|
|
180
|
+
v("span", null, B(e.translate("bulletList")), 1)
|
|
181
|
+
], 40, jt),
|
|
182
|
+
v("button", {
|
|
183
|
+
"aria-checked": e.state.orderedList,
|
|
184
|
+
role: "menuitemradio",
|
|
185
|
+
type: "button",
|
|
186
|
+
onMousedown: l[10] || (l[10] = w(() => {
|
|
187
|
+
}, ["prevent"])),
|
|
188
|
+
onClick: l[11] || (l[11] = (k) => d("ordered-list"))
|
|
189
|
+
}, [
|
|
190
|
+
C(p, { name: "orderedList" }),
|
|
191
|
+
v("span", null, B(e.translate("orderedList")), 1)
|
|
192
|
+
], 40, Ut),
|
|
193
|
+
v("button", {
|
|
194
|
+
disabled: !e.state.listIndentEnabled,
|
|
195
|
+
role: "menuitem",
|
|
196
|
+
type: "button",
|
|
197
|
+
onMousedown: l[12] || (l[12] = w(() => {
|
|
198
|
+
}, ["prevent"])),
|
|
199
|
+
onClick: l[13] || (l[13] = (k) => d("indent-list"))
|
|
200
|
+
}, [
|
|
201
|
+
l[19] || (l[19] = v("span", { class: "markdown-editor__floating-menu-icon" }, "→", -1)),
|
|
202
|
+
v("span", null, B(e.translate("listIndent")), 1),
|
|
203
|
+
l[20] || (l[20] = v("kbd", null, "Tab", -1))
|
|
204
|
+
], 40, Wt),
|
|
205
|
+
v("button", {
|
|
206
|
+
disabled: !e.state.listOutdentEnabled,
|
|
207
|
+
role: "menuitem",
|
|
208
|
+
type: "button",
|
|
209
|
+
onMousedown: l[14] || (l[14] = w(() => {
|
|
210
|
+
}, ["prevent"])),
|
|
211
|
+
onClick: l[15] || (l[15] = (k) => d("outdent-list"))
|
|
212
|
+
}, [
|
|
213
|
+
l[21] || (l[21] = v("span", { class: "markdown-editor__floating-menu-icon" }, "←", -1)),
|
|
214
|
+
v("span", null, B(e.translate("listOutdent")), 1),
|
|
215
|
+
l[22] || (l[22] = v("kbd", null, "⇧ Tab", -1))
|
|
216
|
+
], 40, Qt)
|
|
217
|
+
], 8, qt)) : T("", !0),
|
|
218
|
+
e.modeVisible ? (s(), u("div", {
|
|
219
|
+
key: 4,
|
|
220
|
+
ref_key: "modeMenu",
|
|
221
|
+
ref: t,
|
|
222
|
+
class: "markdown-editor__floating-menu",
|
|
223
|
+
"data-theme": e.theme,
|
|
224
|
+
role: "menu",
|
|
225
|
+
"aria-label": e.translate("mode")
|
|
226
|
+
}, [
|
|
227
|
+
(s(), u(A, null, ne(b, (k) => v("button", {
|
|
228
|
+
key: k,
|
|
229
|
+
"aria-checked": e.mode === k,
|
|
230
|
+
role: "menuitemradio",
|
|
231
|
+
type: "button",
|
|
232
|
+
onClick: (J) => d("select-mode", k)
|
|
233
|
+
}, [
|
|
234
|
+
v("span", null, B(e.translate(k === "wysiwyg" ? "visual" : k)), 1)
|
|
235
|
+
], 8, Yt)), 64))
|
|
236
|
+
], 8, Gt)) : T("", !0)
|
|
237
|
+
], 64));
|
|
238
|
+
}
|
|
239
|
+
}), Kt = /* @__PURE__ */ X(Zt, [["__scopeId", "data-v-864eac67"]]), Xt = ["data-theme", "aria-label"], Jt = ["aria-label", "title"], _t = ["value", "aria-label"], ea = /* @__PURE__ */ K({
|
|
240
|
+
__name: "MarkdownEditorImageActions",
|
|
241
|
+
props: {
|
|
242
|
+
objectFit: {},
|
|
243
|
+
theme: {},
|
|
244
|
+
translate: { type: Function }
|
|
245
|
+
},
|
|
246
|
+
emits: ["full-width", "object-fit"],
|
|
247
|
+
setup(e, { expose: c, emit: M }) {
|
|
248
|
+
const d = M, f = y();
|
|
249
|
+
return c({ element: f }), (r, h) => (s(), u("div", {
|
|
250
|
+
ref_key: "element",
|
|
251
|
+
ref: f,
|
|
252
|
+
class: "markdown-editor__image-actions",
|
|
253
|
+
"data-theme": e.theme,
|
|
254
|
+
role: "toolbar",
|
|
255
|
+
"aria-label": e.translate("image")
|
|
256
|
+
}, [
|
|
257
|
+
v("button", {
|
|
258
|
+
type: "button",
|
|
259
|
+
"aria-label": e.translate("imageWidthFull"),
|
|
260
|
+
title: e.translate("imageWidthFull"),
|
|
261
|
+
onMousedown: h[0] || (h[0] = w(() => {
|
|
262
|
+
}, ["prevent"])),
|
|
263
|
+
onClick: h[1] || (h[1] = (o) => d("full-width"))
|
|
264
|
+
}, "↔", 40, Jt),
|
|
265
|
+
v("select", {
|
|
266
|
+
value: e.objectFit ?? "contain",
|
|
267
|
+
"aria-label": e.translate("imageFit"),
|
|
268
|
+
onChange: h[2] || (h[2] = (o) => d("object-fit", o.target.value))
|
|
269
|
+
}, [...h[3] || (h[3] = [
|
|
270
|
+
lt('<option value="contain" data-v-0158c930>Contain</option><option value="cover" data-v-0158c930>Cover</option><option value="fill" data-v-0158c930>Fill</option><option value="none" data-v-0158c930>None</option><option value="scale-down" data-v-0158c930>Scale down</option>', 5)
|
|
271
|
+
])], 40, _t)
|
|
272
|
+
], 8, Xt));
|
|
273
|
+
}
|
|
274
|
+
}), ta = /* @__PURE__ */ X(ea, [["__scopeId", "data-v-0158c930"]]), aa = ["aria-label"], la = ["data-toolbar-group"], na = ["disabled", "aria-label", "title", "onClick"], oa = ["disabled", "aria-label", "title", "onClick"], ia = ["aria-expanded", "aria-label", "aria-pressed", "title"], sa = ["disabled", "aria-label", "aria-pressed", "title", "onClick"], ra = ["disabled", "aria-label", "aria-pressed", "title", "onClick"], da = ["disabled", "aria-label", "aria-pressed", "title", "onClick"], ua = ["disabled", "aria-label", "aria-pressed", "title", "onClick"], ma = ["disabled", "aria-label", "aria-pressed", "title", "onClick"], ca = ["aria-expanded", "aria-label", "aria-pressed", "title"], ga = ["aria-expanded", "aria-label", "aria-pressed", "title"], va = ["disabled", "aria-label", "aria-pressed", "title", "onClick"], fa = ["aria-label", "aria-pressed", "title"], ba = ["aria-expanded", "aria-pressed", "aria-label", "title"], ka = ["title"], wa = ["aria-label"], ha = ["aria-expanded", "aria-label", "title"], ya = ["aria-expanded", "aria-label", "aria-pressed", "title"], Ma = ["aria-label", "aria-pressed", "title", "onClick"], Ca = ["aria-label", "title"], pa = ["aria-label", "title"], xa = ["aria-label", "title"], La = ["aria-expanded", "aria-label", "title"], Ta = /* @__PURE__ */ K({
|
|
275
|
+
__name: "MarkdownEditorToolbar",
|
|
276
|
+
props: {
|
|
277
|
+
commands: {},
|
|
278
|
+
codeMenuVisible: { type: Boolean },
|
|
279
|
+
formulaMenuVisible: { type: Boolean },
|
|
280
|
+
headingMenuVisible: { type: Boolean },
|
|
281
|
+
imageEditorVisible: { type: Boolean },
|
|
282
|
+
linkEditorVisible: { type: Boolean },
|
|
283
|
+
listMenuVisible: { type: Boolean },
|
|
284
|
+
mode: {},
|
|
285
|
+
modeMenuVisible: { type: Boolean },
|
|
286
|
+
state: {},
|
|
287
|
+
textStyleLabel: {},
|
|
288
|
+
toolbarPreset: {},
|
|
289
|
+
toolbarConfig: {},
|
|
290
|
+
translate: { type: Function }
|
|
291
|
+
},
|
|
292
|
+
emits: ["execute", "insert-html", "toggle-formula-menu", "toggle-code-menu", "toggle-heading-menu", "toggle-image-editor", "toggle-link-editor", "toggle-list-menu", "toggle-mode-menu"],
|
|
293
|
+
setup(e, { emit: c }) {
|
|
294
|
+
const M = e;
|
|
295
|
+
function d(o) {
|
|
296
|
+
return o.map(gt).filter((t) => vt(t, M.state));
|
|
297
|
+
}
|
|
298
|
+
function f(o, t) {
|
|
299
|
+
V(o, M.state) && (o.action ? o.action.run({ commands: M.commands, execute: (b) => r("execute", b), state: M.state }) : r("execute", t));
|
|
300
|
+
}
|
|
301
|
+
const r = c;
|
|
302
|
+
function h(o) {
|
|
303
|
+
return o.currentTarget;
|
|
304
|
+
}
|
|
305
|
+
return (o, t) => (s(), u("div", {
|
|
306
|
+
class: "markdown-editor__toolbar",
|
|
307
|
+
"data-markdown-editor-toolbar": "",
|
|
308
|
+
role: "toolbar",
|
|
309
|
+
"aria-label": e.translate("toolbar")
|
|
310
|
+
}, [
|
|
311
|
+
(s(!0), u(A, null, ne((e.toolbarConfig ?? m(ct)(e.toolbarPreset)).groups, (b) => (s(), u("div", {
|
|
312
|
+
key: b.id,
|
|
313
|
+
class: "markdown-editor__toolbar-group",
|
|
314
|
+
role: "group",
|
|
315
|
+
"data-toolbar-group": b.id
|
|
316
|
+
}, [
|
|
317
|
+
(s(!0), u(A, null, ne(d(b.items), (n) => (s(), u(A, {
|
|
318
|
+
key: n.id
|
|
319
|
+
}, [
|
|
320
|
+
n.id === "undo" ? (s(), u("button", {
|
|
321
|
+
key: 0,
|
|
322
|
+
"data-toolbar-item": "undo",
|
|
323
|
+
type: "button",
|
|
324
|
+
disabled: !m(V)(n, e.state),
|
|
325
|
+
"aria-label": e.translate("undo"),
|
|
326
|
+
title: e.translate("undo"),
|
|
327
|
+
onMousedown: t[0] || (t[0] = w(() => {
|
|
328
|
+
}, ["prevent"])),
|
|
329
|
+
onClick: (l) => f(n, e.commands.undo)
|
|
330
|
+
}, [
|
|
331
|
+
C(p, { name: "arrowLeft" })
|
|
332
|
+
], 40, na)) : n.id === "redo" ? (s(), u("button", {
|
|
333
|
+
key: 1,
|
|
334
|
+
"data-toolbar-item": "redo",
|
|
335
|
+
type: "button",
|
|
336
|
+
disabled: !m(V)(n, e.state),
|
|
337
|
+
"aria-label": e.translate("redo"),
|
|
338
|
+
title: e.translate("redo"),
|
|
339
|
+
onMousedown: t[1] || (t[1] = w(() => {
|
|
340
|
+
}, ["prevent"])),
|
|
341
|
+
onClick: (l) => f(n, e.commands.redo)
|
|
342
|
+
}, [
|
|
343
|
+
C(p, { name: "arrowRight" })
|
|
344
|
+
], 40, oa)) : n.id === "heading" ? (s(), u("button", {
|
|
345
|
+
key: 2,
|
|
346
|
+
class: "markdown-editor__toolbar-heading",
|
|
347
|
+
"data-toolbar-item": "heading",
|
|
348
|
+
"aria-expanded": e.headingMenuVisible,
|
|
349
|
+
"aria-label": e.translate("heading"),
|
|
350
|
+
"aria-pressed": e.state.headingLevel !== void 0,
|
|
351
|
+
title: e.translate("heading"),
|
|
352
|
+
type: "button",
|
|
353
|
+
onMousedown: t[2] || (t[2] = w(() => {
|
|
354
|
+
}, ["prevent"])),
|
|
355
|
+
onClick: t[3] || (t[3] = (l) => r("toggle-heading-menu", h(l)))
|
|
356
|
+
}, [
|
|
357
|
+
v("span", null, B(e.textStyleLabel), 1),
|
|
358
|
+
C(p, { name: "chevronDown" })
|
|
359
|
+
], 40, ia)) : n.id === "bold" ? (s(), u("button", {
|
|
360
|
+
key: 3,
|
|
361
|
+
"data-toolbar-item": "bold",
|
|
362
|
+
disabled: !m(V)(n, e.state),
|
|
363
|
+
"aria-label": e.translate("bold"),
|
|
364
|
+
"aria-pressed": m(j)(n, e.state, e.state.bold),
|
|
365
|
+
type: "button",
|
|
366
|
+
title: e.translate("bold"),
|
|
367
|
+
onMousedown: t[4] || (t[4] = w(() => {
|
|
368
|
+
}, ["prevent"])),
|
|
369
|
+
onClick: (l) => f(n, e.commands.bold)
|
|
370
|
+
}, [
|
|
371
|
+
C(p, { name: "bold" })
|
|
372
|
+
], 40, sa)) : n.id === "italic" ? (s(), u("button", {
|
|
373
|
+
key: 4,
|
|
374
|
+
"data-toolbar-item": "italic",
|
|
375
|
+
disabled: !m(V)(n, e.state),
|
|
376
|
+
"aria-label": e.translate("italic"),
|
|
377
|
+
"aria-pressed": m(j)(n, e.state, e.state.italic),
|
|
378
|
+
type: "button",
|
|
379
|
+
title: e.translate("italic"),
|
|
380
|
+
onMousedown: t[5] || (t[5] = w(() => {
|
|
381
|
+
}, ["prevent"])),
|
|
382
|
+
onClick: (l) => f(n, e.commands.italic)
|
|
383
|
+
}, [
|
|
384
|
+
C(p, { name: "italic" })
|
|
385
|
+
], 40, ra)) : n.id === "underline" ? (s(), u("button", {
|
|
386
|
+
key: 5,
|
|
387
|
+
"data-toolbar-item": "underline",
|
|
388
|
+
disabled: !m(V)(n, e.state),
|
|
389
|
+
"aria-label": e.translate("underline"),
|
|
390
|
+
"aria-pressed": m(j)(n, e.state, e.state.underline),
|
|
391
|
+
type: "button",
|
|
392
|
+
title: e.translate("underline"),
|
|
393
|
+
onMousedown: t[6] || (t[6] = w(() => {
|
|
394
|
+
}, ["prevent"])),
|
|
395
|
+
onClick: (l) => f(n, e.commands.underline)
|
|
396
|
+
}, [
|
|
397
|
+
C(p, { name: "underline" })
|
|
398
|
+
], 40, da)) : n.id === "strike" ? (s(), u("button", {
|
|
399
|
+
key: 6,
|
|
400
|
+
"data-toolbar-item": "strike",
|
|
401
|
+
disabled: !m(V)(n, e.state),
|
|
402
|
+
"aria-label": e.translate("strike"),
|
|
403
|
+
"aria-pressed": m(j)(n, e.state, e.state.strikethrough),
|
|
404
|
+
type: "button",
|
|
405
|
+
title: e.translate("strike"),
|
|
406
|
+
onMousedown: t[7] || (t[7] = w(() => {
|
|
407
|
+
}, ["prevent"])),
|
|
408
|
+
onClick: (l) => f(n, e.commands.strikethrough)
|
|
409
|
+
}, [
|
|
410
|
+
C(p, { name: "strike" })
|
|
411
|
+
], 40, ua)) : n.id === "mark" ? (s(), u("button", {
|
|
412
|
+
key: 7,
|
|
413
|
+
"data-toolbar-item": "mark",
|
|
414
|
+
disabled: !m(V)(n, e.state),
|
|
415
|
+
"aria-label": e.translate("mark"),
|
|
416
|
+
"aria-pressed": m(j)(n, e.state, e.state.mark),
|
|
417
|
+
type: "button",
|
|
418
|
+
title: e.translate("mark"),
|
|
419
|
+
onMousedown: t[8] || (t[8] = w(() => {
|
|
420
|
+
}, ["prevent"])),
|
|
421
|
+
onClick: (l) => f(n, e.commands.mark)
|
|
422
|
+
}, "M", 40, ma)) : n.id === "code" ? (s(), u("button", {
|
|
423
|
+
key: 8,
|
|
424
|
+
class: "markdown-editor__toolbar-code",
|
|
425
|
+
"data-toolbar-item": "code",
|
|
426
|
+
"aria-expanded": e.codeMenuVisible,
|
|
427
|
+
"aria-label": e.translate(e.state.codeBlock ? "codeBlock" : "code"),
|
|
428
|
+
"aria-pressed": e.state.code || e.state.codeBlock,
|
|
429
|
+
title: e.translate(e.state.codeBlock ? "codeBlock" : "code"),
|
|
430
|
+
type: "button",
|
|
431
|
+
onMousedown: t[9] || (t[9] = w(() => {
|
|
432
|
+
}, ["prevent"])),
|
|
433
|
+
onClick: t[10] || (t[10] = (l) => r("toggle-code-menu", h(l)))
|
|
434
|
+
}, [
|
|
435
|
+
C(p, { name: "code" }),
|
|
436
|
+
C(p, { name: "chevronDown" })
|
|
437
|
+
], 40, ca)) : n.id === "bullet-list" ? (s(), u("button", {
|
|
438
|
+
key: 9,
|
|
439
|
+
class: "markdown-editor__toolbar-list",
|
|
440
|
+
"data-toolbar-item": "list",
|
|
441
|
+
"aria-expanded": e.listMenuVisible,
|
|
442
|
+
"aria-label": e.translate(e.state.orderedList ? "orderedList" : "bulletList"),
|
|
443
|
+
"aria-pressed": e.state.bulletList || e.state.orderedList,
|
|
444
|
+
title: e.translate(e.state.orderedList ? "orderedList" : "bulletList"),
|
|
445
|
+
type: "button",
|
|
446
|
+
onMousedown: t[11] || (t[11] = w(() => {
|
|
447
|
+
}, ["prevent"])),
|
|
448
|
+
onClick: t[12] || (t[12] = (l) => r("toggle-list-menu", h(l)))
|
|
449
|
+
}, [
|
|
450
|
+
C(p, {
|
|
451
|
+
name: e.state.orderedList ? "orderedList" : "bulletList"
|
|
452
|
+
}, null, 8, ["name"]),
|
|
453
|
+
C(p, { name: "chevronDown" })
|
|
454
|
+
], 40, ga)) : n.id === "ordered-list" ? (s(), u(A, { key: 10 }, [], 64)) : n.id === "quote" ? (s(), u("button", {
|
|
455
|
+
key: 11,
|
|
456
|
+
"data-toolbar-item": "quote",
|
|
457
|
+
disabled: !m(V)(n, e.state),
|
|
458
|
+
"aria-label": e.translate("quote"),
|
|
459
|
+
"aria-pressed": m(j)(n, e.state, e.state.quote),
|
|
460
|
+
type: "button",
|
|
461
|
+
title: e.translate("quote"),
|
|
462
|
+
onMousedown: t[13] || (t[13] = w(() => {
|
|
463
|
+
}, ["prevent"])),
|
|
464
|
+
onClick: (l) => f(n, e.commands.quote)
|
|
465
|
+
}, [
|
|
466
|
+
C(p, { name: "quote" })
|
|
467
|
+
], 40, va)) : n.id === "fold-heading" ? (s(), u("button", {
|
|
468
|
+
key: 12,
|
|
469
|
+
"data-toolbar-item": "fold-heading",
|
|
470
|
+
"aria-label": e.translate("foldHeading"),
|
|
471
|
+
"aria-pressed": e.state.headingFolded,
|
|
472
|
+
type: "button",
|
|
473
|
+
title: e.translate("foldHeading"),
|
|
474
|
+
onMousedown: t[14] || (t[14] = w(() => {
|
|
475
|
+
}, ["prevent"])),
|
|
476
|
+
onClick: t[15] || (t[15] = (l) => r("execute", e.commands.toggleHeadingFolding))
|
|
477
|
+
}, "▸", 40, fa)) : n.id === "code-block" ? (s(), u(A, { key: 13 }, [], 64)) : n.id === "link" ? (s(), u("button", {
|
|
478
|
+
key: 14,
|
|
479
|
+
"data-toolbar-item": "link",
|
|
480
|
+
"aria-expanded": e.linkEditorVisible,
|
|
481
|
+
"aria-pressed": e.state.linkHref !== void 0,
|
|
482
|
+
type: "button",
|
|
483
|
+
"aria-label": e.translate("link"),
|
|
484
|
+
title: e.translate("link"),
|
|
485
|
+
onMousedown: t[16] || (t[16] = w(() => {
|
|
486
|
+
}, ["prevent"])),
|
|
487
|
+
onClick: t[17] || (t[17] = (l) => r("toggle-link-editor", h(l)))
|
|
488
|
+
}, [
|
|
489
|
+
C(p, { name: "link" })
|
|
490
|
+
], 40, ba)) : n.id === "color" ? (s(), u("label", {
|
|
491
|
+
key: 15,
|
|
492
|
+
"data-toolbar-item": "color",
|
|
493
|
+
class: "markdown-editor__color",
|
|
494
|
+
title: e.translate("color")
|
|
495
|
+
}, [
|
|
496
|
+
v("input", {
|
|
497
|
+
"aria-label": e.translate("color"),
|
|
498
|
+
type: "color",
|
|
499
|
+
value: "#202125",
|
|
500
|
+
onInput: t[18] || (t[18] = (l) => r("execute", e.commands.setColor(l.target.value)))
|
|
501
|
+
}, null, 40, wa)
|
|
502
|
+
], 8, ka)) : n.id === "image" ? (s(), u("button", {
|
|
503
|
+
key: 16,
|
|
504
|
+
"data-toolbar-item": "image",
|
|
505
|
+
"aria-expanded": e.imageEditorVisible,
|
|
506
|
+
"aria-label": e.translate("image"),
|
|
507
|
+
type: "button",
|
|
508
|
+
title: e.translate("image"),
|
|
509
|
+
onMousedown: t[19] || (t[19] = w(() => {
|
|
510
|
+
}, ["prevent"])),
|
|
511
|
+
onClick: t[20] || (t[20] = (l) => r("toggle-image-editor", h(l)))
|
|
512
|
+
}, [
|
|
513
|
+
C(p, { name: "image" })
|
|
514
|
+
], 40, ha)) : n.id === "formula" ? (s(), u("button", {
|
|
515
|
+
key: 17,
|
|
516
|
+
"data-toolbar-item": "formula",
|
|
517
|
+
"aria-expanded": e.formulaMenuVisible,
|
|
518
|
+
"aria-label": e.translate("formula"),
|
|
519
|
+
"aria-pressed": e.state.formula,
|
|
520
|
+
title: e.translate("formula"),
|
|
521
|
+
type: "button",
|
|
522
|
+
onMousedown: t[21] || (t[21] = w(() => {
|
|
523
|
+
}, ["prevent"])),
|
|
524
|
+
onClick: t[22] || (t[22] = (l) => r("toggle-formula-menu", h(l)))
|
|
525
|
+
}, [
|
|
526
|
+
C(p, { name: "function" })
|
|
527
|
+
], 40, ya)) : n.id === "mermaid" ? (s(), u("button", {
|
|
528
|
+
key: 18,
|
|
529
|
+
"data-toolbar-item": "mermaid",
|
|
530
|
+
type: "button",
|
|
531
|
+
"aria-label": e.translate("mermaid"),
|
|
532
|
+
"aria-pressed": e.state.mermaid,
|
|
533
|
+
title: e.translate("mermaid"),
|
|
534
|
+
onMousedown: t[23] || (t[23] = w(() => {
|
|
535
|
+
}, ["prevent"])),
|
|
536
|
+
onClick: (l) => f(n, e.commands.insertMermaid)
|
|
537
|
+
}, [
|
|
538
|
+
C(p, { name: "mermaid" })
|
|
539
|
+
], 40, Ma)) : n.id === "html" ? (s(), u("button", {
|
|
540
|
+
key: 19,
|
|
541
|
+
"data-toolbar-item": "html",
|
|
542
|
+
type: "button",
|
|
543
|
+
"aria-label": e.translate("html"),
|
|
544
|
+
title: e.translate("html"),
|
|
545
|
+
onMousedown: t[24] || (t[24] = w(() => {
|
|
546
|
+
}, ["prevent"])),
|
|
547
|
+
onClick: t[25] || (t[25] = (l) => r("insert-html"))
|
|
548
|
+
}, "</>", 40, Ca)) : n.id === "horizontal-rule" ? (s(), u("button", {
|
|
549
|
+
key: 20,
|
|
550
|
+
"data-toolbar-item": "horizontal-rule",
|
|
551
|
+
"aria-label": e.translate("horizontalRule"),
|
|
552
|
+
type: "button",
|
|
553
|
+
title: e.translate("horizontalRule"),
|
|
554
|
+
onMousedown: t[26] || (t[26] = w(() => {
|
|
555
|
+
}, ["prevent"])),
|
|
556
|
+
onClick: t[27] || (t[27] = (l) => r("execute", e.commands.horizontalRule))
|
|
557
|
+
}, [
|
|
558
|
+
C(p, { name: "horizontalRule" })
|
|
559
|
+
], 40, pa)) : n.id === "table" ? (s(), u("button", {
|
|
560
|
+
key: 21,
|
|
561
|
+
"data-toolbar-item": "table",
|
|
562
|
+
"aria-label": e.translate("table"),
|
|
563
|
+
type: "button",
|
|
564
|
+
title: e.translate("table"),
|
|
565
|
+
onMousedown: t[28] || (t[28] = w(() => {
|
|
566
|
+
}, ["prevent"])),
|
|
567
|
+
onClick: t[29] || (t[29] = (l) => r("execute", e.commands.insertTable()))
|
|
568
|
+
}, [
|
|
569
|
+
C(p, { name: "table" })
|
|
570
|
+
], 40, xa)) : T("", !0)
|
|
571
|
+
], 64))), 128))
|
|
572
|
+
], 8, la))), 128)),
|
|
573
|
+
v("button", {
|
|
574
|
+
class: "markdown-editor__toolbar-mode",
|
|
575
|
+
"data-toolbar-item": "mode",
|
|
576
|
+
type: "button",
|
|
577
|
+
"aria-expanded": e.modeMenuVisible,
|
|
578
|
+
"aria-label": e.translate("mode"),
|
|
579
|
+
title: e.translate("mode"),
|
|
580
|
+
onMousedown: t[30] || (t[30] = w(() => {
|
|
581
|
+
}, ["prevent"])),
|
|
582
|
+
onClick: t[31] || (t[31] = (b) => r("toggle-mode-menu", h(b)))
|
|
583
|
+
}, [
|
|
584
|
+
C(p, { name: "gear" }),
|
|
585
|
+
C(p, { name: "chevronDown" })
|
|
586
|
+
], 40, La),
|
|
587
|
+
ge(o.$slots, "default", {
|
|
588
|
+
commands: e.commands,
|
|
589
|
+
execute: (b) => r("execute", b)
|
|
590
|
+
}, void 0, !0)
|
|
591
|
+
], 8, aa));
|
|
592
|
+
}
|
|
593
|
+
}), Ba = /* @__PURE__ */ X(Ta, [["__scopeId", "data-v-d653c970"]]), Ea = [
|
|
594
|
+
"--markdown-background",
|
|
595
|
+
"--markdown-border",
|
|
596
|
+
"--markdown-focus-background",
|
|
597
|
+
"--markdown-focus-text",
|
|
598
|
+
"--markdown-text"
|
|
599
|
+
];
|
|
600
|
+
function S(e, c = {}) {
|
|
601
|
+
const M = y(!1);
|
|
602
|
+
let d;
|
|
603
|
+
function f() {
|
|
604
|
+
M.value = !1, d?.(), d = void 0;
|
|
605
|
+
}
|
|
606
|
+
async function r(o) {
|
|
607
|
+
f(), M.value = !0, await le();
|
|
608
|
+
const t = e();
|
|
609
|
+
if (t === void 0) return;
|
|
610
|
+
const b = o.closest(".markdown-editor");
|
|
611
|
+
if (b !== null) {
|
|
612
|
+
const l = getComputedStyle(b);
|
|
613
|
+
for (const k of Ea)
|
|
614
|
+
t.style.setProperty(k, l.getPropertyValue(k));
|
|
615
|
+
}
|
|
616
|
+
d = Je(o, t, async () => {
|
|
617
|
+
const { x: l, y: k } = await _e(o, t, {
|
|
618
|
+
middleware: [et(6), tt({ padding: 8 }), at({ padding: 8 })],
|
|
619
|
+
placement: c.placement ?? "bottom-start",
|
|
620
|
+
strategy: "fixed"
|
|
621
|
+
});
|
|
622
|
+
Object.assign(t.style, { left: `${l}px`, position: "fixed", top: `${k}px` });
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
async function h(o) {
|
|
626
|
+
M.value ? f() : await r(o);
|
|
627
|
+
}
|
|
628
|
+
return ve(f), {
|
|
629
|
+
close: f,
|
|
630
|
+
contains: (o) => e()?.contains(o) ?? !1,
|
|
631
|
+
open: r,
|
|
632
|
+
toggle: h,
|
|
633
|
+
visible: M
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function Le(e, c) {
|
|
637
|
+
return e.length === 0 ? c : c.length === 0 ? e : `${e}
|
|
638
|
+
|
|
639
|
+
${c}`;
|
|
640
|
+
}
|
|
641
|
+
function Ha(e) {
|
|
642
|
+
const c = y(e.initialValue);
|
|
643
|
+
let M = !1;
|
|
644
|
+
function d(o, t) {
|
|
645
|
+
M = !0, t !== "markup" && e.getMarkupHost()?.setValue(o), t !== "visual" && e.getVisualHost()?.setValue(o), M = !1;
|
|
646
|
+
}
|
|
647
|
+
function f(o) {
|
|
648
|
+
o !== c.value && (c.value = o, d(o));
|
|
649
|
+
}
|
|
650
|
+
function r(o) {
|
|
651
|
+
o !== c.value && (c.value = o, e.onChange(o), d(o));
|
|
652
|
+
}
|
|
653
|
+
function h(o, t) {
|
|
654
|
+
o === c.value || M || (c.value = o, e.onChange(o), d(o, t));
|
|
655
|
+
}
|
|
656
|
+
return { setExternalValue: f, setValue: r, updateFromHost: h, value: c };
|
|
657
|
+
}
|
|
658
|
+
const $a = ["data-locale", "data-mode", "data-theme"], Va = {
|
|
659
|
+
key: 0,
|
|
660
|
+
class: "markdown-editor__header"
|
|
661
|
+
}, Sa = /* @__PURE__ */ K({
|
|
662
|
+
name: "MarkdownEditor",
|
|
663
|
+
__name: "MarkdownEditor",
|
|
664
|
+
props: {
|
|
665
|
+
modelValue: { default: "" },
|
|
666
|
+
directiveComponents: { default: void 0 },
|
|
667
|
+
mode: { default: "wysiwyg" },
|
|
668
|
+
locale: { default: "ru" },
|
|
669
|
+
placeholder: { default: "" },
|
|
670
|
+
readonly: { type: Boolean, default: !1 },
|
|
671
|
+
toolbarPreset: { default: "default" },
|
|
672
|
+
uploadImage: { type: Function, default: void 0 },
|
|
673
|
+
toolbarConfig: { default: void 0 },
|
|
674
|
+
theme: { default: "auto" }
|
|
675
|
+
},
|
|
676
|
+
emits: ["cancel", "change", "mode-change", "update:modelValue", "update:mode", "submit"],
|
|
677
|
+
setup(e, { expose: c, emit: M }) {
|
|
678
|
+
const d = e, f = M, r = Ye(), h = Te()?.appContext, o = y(), t = y(), b = y(d.mode), n = y("https://"), l = y(""), k = y(""), J = y(), P = y(""), U = y(""), W = y(!1), x = y({
|
|
679
|
+
bold: !1,
|
|
680
|
+
bulletList: !1,
|
|
681
|
+
code: !1,
|
|
682
|
+
codeBlock: !1,
|
|
683
|
+
codeBlockLanguage: void 0,
|
|
684
|
+
formula: !1,
|
|
685
|
+
headingFolded: !1,
|
|
686
|
+
headingLevel: void 0,
|
|
687
|
+
image: !1,
|
|
688
|
+
imageObjectFit: void 0,
|
|
689
|
+
linkHref: void 0,
|
|
690
|
+
linkOpenInNewWindow: !1,
|
|
691
|
+
linkText: void 0,
|
|
692
|
+
listIndentEnabled: !1,
|
|
693
|
+
listOutdentEnabled: !1,
|
|
694
|
+
italic: !1,
|
|
695
|
+
mark: !1,
|
|
696
|
+
mermaid: !1,
|
|
697
|
+
orderedList: !1,
|
|
698
|
+
quote: !1,
|
|
699
|
+
strikethrough: !1,
|
|
700
|
+
underline: !1
|
|
701
|
+
}), oe = xe(() => x.value.headingLevel?.toString() ?? "paragraph"), Be = xe(() => oe.value === "paragraph" ? "H" : `H${oe.value}`), fe = y(), R = y(), be = y(), D = S(() => R.value?.getElement("code")), z = S(() => R.value?.getElement("formula")), I = S(() => R.value?.getElement("heading")), F = S(() => J.value?.element), Q = S(() => be.value?.element, { placement: "top" }), E = S(() => fe.value?.element), O = S(() => R.value?.getElement("list")), q = S(() => R.value?.getElement("mode"));
|
|
702
|
+
let H, _ = 0, ie = !1, L;
|
|
703
|
+
const { setExternalValue: Ee, setValue: G, updateFromHost: ke, value: N } = Ha({
|
|
704
|
+
getMarkupHost: () => H,
|
|
705
|
+
getVisualHost: () => L,
|
|
706
|
+
initialValue: d.modelValue,
|
|
707
|
+
onChange: (a) => {
|
|
708
|
+
f("update:modelValue", a), f("change", a);
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
function se(a) {
|
|
712
|
+
return Ge(d.locale)[a];
|
|
713
|
+
}
|
|
714
|
+
function re() {
|
|
715
|
+
H?.destroy(), L?.destroy(), H = void 0, L = void 0, x.value = {
|
|
716
|
+
bold: !1,
|
|
717
|
+
bulletList: !1,
|
|
718
|
+
code: !1,
|
|
719
|
+
codeBlock: !1,
|
|
720
|
+
codeBlockLanguage: void 0,
|
|
721
|
+
formula: !1,
|
|
722
|
+
headingFolded: !1,
|
|
723
|
+
headingLevel: void 0,
|
|
724
|
+
image: !1,
|
|
725
|
+
imageObjectFit: void 0,
|
|
726
|
+
linkHref: void 0,
|
|
727
|
+
linkOpenInNewWindow: !1,
|
|
728
|
+
linkText: void 0,
|
|
729
|
+
listIndentEnabled: !1,
|
|
730
|
+
listOutdentEnabled: !1,
|
|
731
|
+
italic: !1,
|
|
732
|
+
mark: !1,
|
|
733
|
+
mermaid: !1,
|
|
734
|
+
orderedList: !1,
|
|
735
|
+
quote: !1,
|
|
736
|
+
strikethrough: !1,
|
|
737
|
+
underline: !1
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
function He(a) {
|
|
741
|
+
b.value === "markup" || b.value === "split" && typeof a == "object" ? H?.moveCursor(a) : L?.moveCursor(typeof a == "object" ? "start" : a);
|
|
742
|
+
}
|
|
743
|
+
function $e(a) {
|
|
744
|
+
b.value === "markup" || b.value === "split" && H?.hasFocus() ? H?.insert(a) : L?.insert(a);
|
|
745
|
+
}
|
|
746
|
+
function Ve() {
|
|
747
|
+
if (P.value.trim().length === 0)
|
|
748
|
+
return;
|
|
749
|
+
ie = !0;
|
|
750
|
+
const a = U.value.trim() || P.value.trim();
|
|
751
|
+
$(r.setLink(P.value.trim(), a, a, W.value)), E.close();
|
|
752
|
+
}
|
|
753
|
+
function we() {
|
|
754
|
+
E.close();
|
|
755
|
+
}
|
|
756
|
+
function Se() {
|
|
757
|
+
const a = n.value.trim();
|
|
758
|
+
a.length !== 0 && ($(r.insertImage(a, l.value.trim() || "Image", k.value.trim() || void 0)), F.close());
|
|
759
|
+
}
|
|
760
|
+
function Ae() {
|
|
761
|
+
F.close();
|
|
762
|
+
}
|
|
763
|
+
function Pe(a) {
|
|
764
|
+
$(a === "paragraph" ? r.paragraph : r.heading(Number(a))), I.close();
|
|
765
|
+
}
|
|
766
|
+
async function ze(a) {
|
|
767
|
+
await I.toggle(a);
|
|
768
|
+
}
|
|
769
|
+
async function Fe(a) {
|
|
770
|
+
await D.toggle(a);
|
|
771
|
+
}
|
|
772
|
+
function he(a) {
|
|
773
|
+
$(a), D.close();
|
|
774
|
+
}
|
|
775
|
+
async function Ne(a) {
|
|
776
|
+
if (E.visible.value) {
|
|
777
|
+
E.close();
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
P.value = x.value.linkHref ?? "", U.value = x.value.linkText ?? window.getSelection()?.toString().trim() ?? "", W.value = x.value.linkOpenInNewWindow, await E.open(a);
|
|
781
|
+
}
|
|
782
|
+
async function ye(a) {
|
|
783
|
+
const i = x.value.linkHref;
|
|
784
|
+
if (i === void 0 && a === void 0) {
|
|
785
|
+
we();
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
P.value = a?.getAttribute("href") ?? i ?? "", U.value = a?.textContent ?? x.value.linkText ?? "", W.value = a?.getAttribute("target") === "_blank" || x.value.linkOpenInNewWindow;
|
|
789
|
+
const g = window.getSelection()?.anchorNode, Y = g instanceof Element ? g : g?.parentElement, me = a ?? Y?.closest("a");
|
|
790
|
+
me != null && await E.open(me);
|
|
791
|
+
}
|
|
792
|
+
function Re(a) {
|
|
793
|
+
const i = a.target;
|
|
794
|
+
if (!(i instanceof Element)) return;
|
|
795
|
+
const g = i.closest(".ProseMirror img");
|
|
796
|
+
if (g !== null) {
|
|
797
|
+
a.preventDefault(), L?.selectElement(g), Q.open(g);
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
const Y = i.closest(".ProseMirror a");
|
|
801
|
+
Y !== null && (a.preventDefault(), L?.selectElement(Y), ye(Y));
|
|
802
|
+
}
|
|
803
|
+
async function De(a) {
|
|
804
|
+
await O.toggle(a);
|
|
805
|
+
}
|
|
806
|
+
function ee(a) {
|
|
807
|
+
$(a), O.close();
|
|
808
|
+
}
|
|
809
|
+
async function Ie(a) {
|
|
810
|
+
await F.toggle(a);
|
|
811
|
+
}
|
|
812
|
+
async function Me(a) {
|
|
813
|
+
$(a), await le();
|
|
814
|
+
const i = t.value?.querySelector(".ProseMirror img.ProseMirror-selectednode");
|
|
815
|
+
i != null && await Q.open(i);
|
|
816
|
+
}
|
|
817
|
+
async function Oe(a) {
|
|
818
|
+
await q.toggle(a);
|
|
819
|
+
}
|
|
820
|
+
async function qe(a) {
|
|
821
|
+
q.close(), await ue(a);
|
|
822
|
+
}
|
|
823
|
+
function je() {
|
|
824
|
+
L?.run(r.insertHtml);
|
|
825
|
+
}
|
|
826
|
+
async function Ue() {
|
|
827
|
+
z.close(), !x.value.formula && L?.run(r.insertMathBlock);
|
|
828
|
+
}
|
|
829
|
+
function We() {
|
|
830
|
+
z.close(), L?.run(r.insertInlineMath);
|
|
831
|
+
}
|
|
832
|
+
async function Qe(a) {
|
|
833
|
+
x.value.formula || await z.toggle(a);
|
|
834
|
+
}
|
|
835
|
+
function Ce(a) {
|
|
836
|
+
const i = a.target;
|
|
837
|
+
if (i instanceof Node)
|
|
838
|
+
for (const g of [I, D, z, E, O, F, Q, q])
|
|
839
|
+
g.contains(i) || g.close();
|
|
840
|
+
}
|
|
841
|
+
function pe(a) {
|
|
842
|
+
if (a.key === "Escape")
|
|
843
|
+
for (const i of [I, D, z, E, O, F, Q, q]) i.close();
|
|
844
|
+
}
|
|
845
|
+
function de() {
|
|
846
|
+
b.value !== "markup" && t.value !== void 0 && (L = Ze({
|
|
847
|
+
directiveAppContext: h,
|
|
848
|
+
directiveComponents: d.directiveComponents,
|
|
849
|
+
editable: !d.readonly,
|
|
850
|
+
initialValue: N.value,
|
|
851
|
+
onCancel: () => (f("cancel"), !0),
|
|
852
|
+
onChange: (a) => {
|
|
853
|
+
ke(a, "visual"), t.value !== void 0 && ce(t.value, d.locale);
|
|
854
|
+
},
|
|
855
|
+
onSelectionChange: (a) => {
|
|
856
|
+
x.value = a, ie ? ie = !1 : ye();
|
|
857
|
+
},
|
|
858
|
+
onSubmit: () => (f("submit"), !0),
|
|
859
|
+
placeholder: d.placeholder,
|
|
860
|
+
target: t.value
|
|
861
|
+
}), ce(t.value, d.locale)), b.value !== "wysiwyg" && o.value !== void 0 && (H = Ke({
|
|
862
|
+
editable: !d.readonly,
|
|
863
|
+
initialValue: N.value,
|
|
864
|
+
onChange: (a) => ke(a, "markup"),
|
|
865
|
+
target: o.value
|
|
866
|
+
}));
|
|
867
|
+
}
|
|
868
|
+
async function ue(a) {
|
|
869
|
+
if (a === b.value)
|
|
870
|
+
return;
|
|
871
|
+
const i = ++_;
|
|
872
|
+
b.value = a, f("update:mode", a), f("mode-change", a), re(), await le(), i === _ && de();
|
|
873
|
+
}
|
|
874
|
+
function $(a) {
|
|
875
|
+
d.readonly || L?.run(a);
|
|
876
|
+
}
|
|
877
|
+
return te(
|
|
878
|
+
() => d.modelValue,
|
|
879
|
+
(a) => {
|
|
880
|
+
a !== N.value && Ee(a);
|
|
881
|
+
}
|
|
882
|
+
), te(
|
|
883
|
+
() => d.mode,
|
|
884
|
+
(a) => {
|
|
885
|
+
ue(a);
|
|
886
|
+
}
|
|
887
|
+
), te(
|
|
888
|
+
() => d.locale,
|
|
889
|
+
(a) => {
|
|
890
|
+
t.value !== void 0 && ce(t.value, a);
|
|
891
|
+
}
|
|
892
|
+
), te(
|
|
893
|
+
() => d.readonly,
|
|
894
|
+
async () => {
|
|
895
|
+
const a = ++_;
|
|
896
|
+
re(), await le(), a === _ && de();
|
|
897
|
+
}
|
|
898
|
+
), nt(() => {
|
|
899
|
+
de(), document.addEventListener("pointerdown", Ce), document.addEventListener("keydown", pe);
|
|
900
|
+
}), ve(() => {
|
|
901
|
+
re(), document.removeEventListener("pointerdown", Ce), document.removeEventListener("keydown", pe);
|
|
902
|
+
}), c({
|
|
903
|
+
append: (a) => G(Le(N.value, a)),
|
|
904
|
+
clear: () => G(""),
|
|
905
|
+
focus: () => b.value === "markup" ? H?.focus() : L?.focus(),
|
|
906
|
+
getMode: () => b.value,
|
|
907
|
+
getValue: () => N.value,
|
|
908
|
+
hasFocus: () => b.value === "markup" ? H?.hasFocus() ?? !1 : L?.hasFocus() ?? !1,
|
|
909
|
+
insert: $e,
|
|
910
|
+
isEmpty: () => N.value.length === 0,
|
|
911
|
+
moveCursor: He,
|
|
912
|
+
prepend: (a) => G(Le(a, N.value)),
|
|
913
|
+
replace: G,
|
|
914
|
+
setMode: ue,
|
|
915
|
+
setValue: G
|
|
916
|
+
}), (a, i) => (s(), u("section", {
|
|
917
|
+
class: "markdown-editor",
|
|
918
|
+
"data-locale": e.locale,
|
|
919
|
+
"data-mode": b.value,
|
|
920
|
+
"data-theme": e.theme,
|
|
921
|
+
onClick: Re
|
|
922
|
+
}, [
|
|
923
|
+
a.$slots.header ? (s(), u("header", Va, [
|
|
924
|
+
ge(a.$slots, "header", {}, void 0, !0)
|
|
925
|
+
])) : T("", !0),
|
|
926
|
+
e.readonly ? T("", !0) : (s(), Z(Ba, {
|
|
927
|
+
key: 1,
|
|
928
|
+
commands: m(r),
|
|
929
|
+
"code-menu-visible": m(D).visible.value,
|
|
930
|
+
"formula-menu-visible": m(z).visible.value,
|
|
931
|
+
"heading-menu-visible": m(I).visible.value,
|
|
932
|
+
"image-editor-visible": m(F).visible.value,
|
|
933
|
+
"link-editor-visible": m(E).visible.value,
|
|
934
|
+
"list-menu-visible": m(O).visible.value,
|
|
935
|
+
mode: b.value,
|
|
936
|
+
"mode-menu-visible": m(q).visible.value,
|
|
937
|
+
state: x.value,
|
|
938
|
+
"text-style-label": Be.value,
|
|
939
|
+
"toolbar-preset": e.toolbarPreset,
|
|
940
|
+
"toolbar-config": e.toolbarConfig,
|
|
941
|
+
translate: se,
|
|
942
|
+
onExecute: $,
|
|
943
|
+
onInsertHtml: je,
|
|
944
|
+
onToggleFormulaMenu: Qe,
|
|
945
|
+
onToggleCodeMenu: Fe,
|
|
946
|
+
onToggleHeadingMenu: ze,
|
|
947
|
+
onToggleImageEditor: Ie,
|
|
948
|
+
onToggleLinkEditor: Ne,
|
|
949
|
+
onToggleListMenu: De,
|
|
950
|
+
onToggleModeMenu: Oe
|
|
951
|
+
}, {
|
|
952
|
+
default: ot((g) => [
|
|
953
|
+
ge(a.$slots, "toolbar", it(st(g)), void 0, !0)
|
|
954
|
+
]),
|
|
955
|
+
_: 3
|
|
956
|
+
}, 8, ["commands", "code-menu-visible", "formula-menu-visible", "heading-menu-visible", "image-editor-visible", "link-editor-visible", "list-menu-visible", "mode", "mode-menu-visible", "state", "text-style-label", "toolbar-preset", "toolbar-config"])),
|
|
957
|
+
(s(), Z(rt, { to: "body" }, [
|
|
958
|
+
C(Kt, {
|
|
959
|
+
ref_key: "floatingMenus",
|
|
960
|
+
ref: R,
|
|
961
|
+
"code-visible": m(D).visible.value,
|
|
962
|
+
"formula-visible": m(z).visible.value,
|
|
963
|
+
"heading-visible": m(I).visible.value,
|
|
964
|
+
"list-visible": m(O).visible.value,
|
|
965
|
+
mode: b.value,
|
|
966
|
+
"mode-visible": m(q).visible.value,
|
|
967
|
+
state: x.value,
|
|
968
|
+
"text-style": oe.value,
|
|
969
|
+
theme: e.theme,
|
|
970
|
+
translate: se,
|
|
971
|
+
onBulletList: i[0] || (i[0] = (g) => ee(m(r).bulletList)),
|
|
972
|
+
onCodeBlock: i[1] || (i[1] = (g) => he(m(r).codeBlock)),
|
|
973
|
+
onIndentList: i[2] || (i[2] = (g) => ee(m(r).sinkListItem)),
|
|
974
|
+
onInlineCode: i[3] || (i[3] = (g) => he(m(r).code)),
|
|
975
|
+
onInlineFormula: We,
|
|
976
|
+
onMathBlock: Ue,
|
|
977
|
+
onOrderedList: i[4] || (i[4] = (g) => ee(m(r).orderedList)),
|
|
978
|
+
onOutdentList: i[5] || (i[5] = (g) => ee(m(r).liftListItem)),
|
|
979
|
+
onSelectMode: qe,
|
|
980
|
+
onSelectTextStyle: Pe
|
|
981
|
+
}, null, 8, ["code-visible", "formula-visible", "heading-visible", "list-visible", "mode", "mode-visible", "state", "text-style", "theme"]),
|
|
982
|
+
m(E).visible.value ? (s(), Z(ut, {
|
|
983
|
+
key: 0,
|
|
984
|
+
ref_key: "linkForm",
|
|
985
|
+
ref: fe,
|
|
986
|
+
"has-current-link": x.value.linkHref !== void 0,
|
|
987
|
+
locale: e.locale,
|
|
988
|
+
"open-in-new-window": W.value,
|
|
989
|
+
theme: e.theme,
|
|
990
|
+
text: U.value,
|
|
991
|
+
url: P.value,
|
|
992
|
+
onApply: Ve,
|
|
993
|
+
onCancel: we,
|
|
994
|
+
onRemove: i[6] || (i[6] = (g) => $(m(r).removeLink)),
|
|
995
|
+
"onUpdate:text": i[7] || (i[7] = (g) => U.value = g),
|
|
996
|
+
"onUpdate:url": i[8] || (i[8] = (g) => P.value = g),
|
|
997
|
+
"onUpdate:openInNewWindow": i[9] || (i[9] = (g) => W.value = g)
|
|
998
|
+
}, null, 8, ["has-current-link", "locale", "open-in-new-window", "theme", "text", "url"])) : T("", !0),
|
|
999
|
+
m(F).visible.value ? (s(), Z(mt, {
|
|
1000
|
+
key: 1,
|
|
1001
|
+
ref_key: "imageForm",
|
|
1002
|
+
ref: J,
|
|
1003
|
+
alt: l.value,
|
|
1004
|
+
locale: e.locale,
|
|
1005
|
+
theme: e.theme,
|
|
1006
|
+
title: k.value,
|
|
1007
|
+
"upload-image": e.uploadImage,
|
|
1008
|
+
url: n.value,
|
|
1009
|
+
onApply: Se,
|
|
1010
|
+
onCancel: Ae,
|
|
1011
|
+
"onUpdate:alt": i[10] || (i[10] = (g) => l.value = g),
|
|
1012
|
+
"onUpdate:title": i[11] || (i[11] = (g) => k.value = g),
|
|
1013
|
+
"onUpdate:url": i[12] || (i[12] = (g) => n.value = g)
|
|
1014
|
+
}, null, 8, ["alt", "locale", "theme", "title", "upload-image", "url"])) : T("", !0),
|
|
1015
|
+
m(Q).visible.value ? (s(), Z(ta, {
|
|
1016
|
+
key: 2,
|
|
1017
|
+
ref_key: "imageActions",
|
|
1018
|
+
ref: be,
|
|
1019
|
+
"object-fit": x.value.imageObjectFit,
|
|
1020
|
+
theme: e.theme,
|
|
1021
|
+
translate: se,
|
|
1022
|
+
onFullWidth: i[13] || (i[13] = (g) => Me(m(r).setImageDisplay("100%", "contain", null))),
|
|
1023
|
+
onObjectFit: i[14] || (i[14] = (g) => Me(m(r).setImageDisplay(void 0, g)))
|
|
1024
|
+
}, null, 8, ["object-fit", "theme"])) : T("", !0)
|
|
1025
|
+
])),
|
|
1026
|
+
v("div", {
|
|
1027
|
+
class: dt(["markdown-editor__hosts", { "markdown-editor__hosts--split": b.value === "split" }])
|
|
1028
|
+
}, [
|
|
1029
|
+
b.value !== "markup" ? (s(), u("div", {
|
|
1030
|
+
key: 0,
|
|
1031
|
+
ref_key: "visualTarget",
|
|
1032
|
+
ref: t,
|
|
1033
|
+
class: "markdown-editor__visual"
|
|
1034
|
+
}, null, 512)) : T("", !0),
|
|
1035
|
+
b.value !== "wysiwyg" ? (s(), u("div", {
|
|
1036
|
+
key: 1,
|
|
1037
|
+
ref_key: "markupTarget",
|
|
1038
|
+
ref: o,
|
|
1039
|
+
class: "markdown-editor__markup"
|
|
1040
|
+
}, null, 512)) : T("", !0)
|
|
1041
|
+
], 2)
|
|
1042
|
+
], 8, $a));
|
|
1043
|
+
}
|
|
1044
|
+
}), Ia = /* @__PURE__ */ X(Sa, [["__scopeId", "data-v-cf11416f"]]);
|
|
1045
|
+
function Oa(e = {}) {
|
|
1046
|
+
const c = Xe(e), M = y(c.getValue()), d = y(c.getMode()), f = y(c.readonly), r = y(c.toolbarVisible), h = () => c.destroy();
|
|
1047
|
+
return c.on("change", (o) => {
|
|
1048
|
+
M.value = o;
|
|
1049
|
+
}), c.on("modeChange", (o) => {
|
|
1050
|
+
d.value = o;
|
|
1051
|
+
}), c.on("changeReadonly", ({ readonly: o }) => {
|
|
1052
|
+
f.value = o;
|
|
1053
|
+
}), c.on("changeToolbarVisibility", ({ visible: o }) => {
|
|
1054
|
+
r.value = o;
|
|
1055
|
+
}), Te() !== null && ve(h), {
|
|
1056
|
+
destroy: h,
|
|
1057
|
+
editor: c,
|
|
1058
|
+
mode: ae(d),
|
|
1059
|
+
readonly: ae(f),
|
|
1060
|
+
toolbarVisible: ae(r),
|
|
1061
|
+
value: ae(M)
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
export {
|
|
1065
|
+
_a as ActionsManager,
|
|
1066
|
+
pl as BaseInputRules,
|
|
1067
|
+
xl as BaseKeymap,
|
|
1068
|
+
Ll as BaseSchema,
|
|
1069
|
+
Tl as Blockquote,
|
|
1070
|
+
pi as BlockquoteSpecs,
|
|
1071
|
+
Bl as Bold,
|
|
1072
|
+
xi as BoldAttrs,
|
|
1073
|
+
Li as BoldSpecs,
|
|
1074
|
+
Ti as BreakNodeName,
|
|
1075
|
+
El as Breaks,
|
|
1076
|
+
Bi as BreaksSpecs,
|
|
1077
|
+
Hl as ClicksOnEdges,
|
|
1078
|
+
$l as Clipboard,
|
|
1079
|
+
Vl as Code,
|
|
1080
|
+
Sl as CodeBlock,
|
|
1081
|
+
Ei as CodeBlockAttrs,
|
|
1082
|
+
Hi as CodeBlockSpecs,
|
|
1083
|
+
$i as CodeSpecs,
|
|
1084
|
+
fi as CommonMarkPreset,
|
|
1085
|
+
yi as CommonMarkSpecsPreset,
|
|
1086
|
+
Al as Cursor,
|
|
1087
|
+
bi as DefaultPreset,
|
|
1088
|
+
Pl as Deflist,
|
|
1089
|
+
Vi as DeflistAttr,
|
|
1090
|
+
Si as DeflistNode,
|
|
1091
|
+
Ai as DeflistSpecs,
|
|
1092
|
+
zl as EditorModeKeymap,
|
|
1093
|
+
el as EventEmitter,
|
|
1094
|
+
tl as ExtensionBuilder,
|
|
1095
|
+
al as ExtensionPriority,
|
|
1096
|
+
ll as ExtensionsManager,
|
|
1097
|
+
ki as FullPreset,
|
|
1098
|
+
Mi as FullSpecsPreset,
|
|
1099
|
+
Fl as GapCursorSelection,
|
|
1100
|
+
Nl as Heading,
|
|
1101
|
+
Pi as HeadingSpecs,
|
|
1102
|
+
Rl as History,
|
|
1103
|
+
Dl as HistoryAction,
|
|
1104
|
+
Il as HorizontalRule,
|
|
1105
|
+
zi as HorizontalRuleSpecs,
|
|
1106
|
+
Ol as Html,
|
|
1107
|
+
ql as HtmlAttr,
|
|
1108
|
+
jl as HtmlNode,
|
|
1109
|
+
Ul as Image,
|
|
1110
|
+
Wl as ImageAttr,
|
|
1111
|
+
Ql as Italic,
|
|
1112
|
+
Fi as ItalicAttrs,
|
|
1113
|
+
Ni as ItalicSpecs,
|
|
1114
|
+
Ua as Lang,
|
|
1115
|
+
Gl as Link,
|
|
1116
|
+
Ri as LinkAttr,
|
|
1117
|
+
Di as LinkSpecs,
|
|
1118
|
+
Yl as Lists,
|
|
1119
|
+
nl as Logger,
|
|
1120
|
+
ol as Logger2,
|
|
1121
|
+
Zl as Mark,
|
|
1122
|
+
il as MarkdownCodec,
|
|
1123
|
+
Ia as MarkdownEditor,
|
|
1124
|
+
ai as MarkdownEditorForm,
|
|
1125
|
+
mt as MarkdownEditorImageForm,
|
|
1126
|
+
ut as MarkdownEditorLinkForm,
|
|
1127
|
+
li as MarkdownEditorTextInput,
|
|
1128
|
+
sl as MarkdownParser,
|
|
1129
|
+
rl as MarkdownParserDynamicModifier,
|
|
1130
|
+
Kl as Mermaid,
|
|
1131
|
+
dl as ParserTokenRegistry,
|
|
1132
|
+
ul as ParserTokensRegistry,
|
|
1133
|
+
Xl as Placeholder,
|
|
1134
|
+
Jl as QuoteLink,
|
|
1135
|
+
_l as Resizable,
|
|
1136
|
+
ml as SafeEventEmitter,
|
|
1137
|
+
cl as SchemaDynamicModifier,
|
|
1138
|
+
gl as SchemaSpecRegistry,
|
|
1139
|
+
en as Selection,
|
|
1140
|
+
tn as SelectionContext,
|
|
1141
|
+
vl as SerializerTokenRegistry,
|
|
1142
|
+
fl as SerializerTokensRegistry,
|
|
1143
|
+
an as Strike,
|
|
1144
|
+
ln as Table,
|
|
1145
|
+
Ii as TableAttrs,
|
|
1146
|
+
Oi as TableCellAlign,
|
|
1147
|
+
qi as TableNode,
|
|
1148
|
+
ji as TableSpecs,
|
|
1149
|
+
nn as Underline,
|
|
1150
|
+
on as VERSION,
|
|
1151
|
+
bl as WysiwygContentHandler,
|
|
1152
|
+
sn as YfmHtmlBlock,
|
|
1153
|
+
wi as ZeroPreset,
|
|
1154
|
+
rn as addBreak,
|
|
1155
|
+
dn as addEmptyDefaultTextblockToEndOfDocumentActionName,
|
|
1156
|
+
un as addEmptyDefaultTextblockToStartOfDocumentActionName,
|
|
1157
|
+
mn as addHorizontalRule,
|
|
1158
|
+
cn as addImage,
|
|
1159
|
+
gn as addParagraphToEnd,
|
|
1160
|
+
vn as addParagraphToStart,
|
|
1161
|
+
fn as addTableColumn,
|
|
1162
|
+
bn as addTableRow,
|
|
1163
|
+
kn as arrowDown,
|
|
1164
|
+
wn as arrowLeft,
|
|
1165
|
+
hn as arrowRight,
|
|
1166
|
+
yn as arrowUp,
|
|
1167
|
+
kl as basicMarkdownCodec,
|
|
1168
|
+
wl as basicMarkdownSchema,
|
|
1169
|
+
Ui as blockquoteNodeName,
|
|
1170
|
+
Wi as boldMarkName,
|
|
1171
|
+
Za as cn,
|
|
1172
|
+
Qi as codeBlockNodeName,
|
|
1173
|
+
Gi as codeMarkName,
|
|
1174
|
+
Mn as collapseListsPlugin,
|
|
1175
|
+
oi as commonmarkToolbarConfig,
|
|
1176
|
+
Wa as configure,
|
|
1177
|
+
_o as configureAdvancedMarkdownRenderers,
|
|
1178
|
+
Ye as createBasicEditorCommands,
|
|
1179
|
+
Cn as createFakeParagraph,
|
|
1180
|
+
pn as createGapCursorPlugin,
|
|
1181
|
+
xn as createHistoryActions,
|
|
1182
|
+
Ln as createListActions,
|
|
1183
|
+
Tn as createListsInputRules,
|
|
1184
|
+
Bn as createListsKeymap,
|
|
1185
|
+
Xe as createMarkdownEditor,
|
|
1186
|
+
En as createTable,
|
|
1187
|
+
ii as createToolbarConfig,
|
|
1188
|
+
si as createToolbarGroup,
|
|
1189
|
+
ri as createToolbarItem,
|
|
1190
|
+
Hn as createVueContextPanelPlugin,
|
|
1191
|
+
$n as createVueNodeView,
|
|
1192
|
+
Vn as createVueWidgetDecoration,
|
|
1193
|
+
hl as defaultMarkdownSchema,
|
|
1194
|
+
Sn as defaultMermaidSource,
|
|
1195
|
+
di as defaultToolbarConfig,
|
|
1196
|
+
An as defaultYfmHtml,
|
|
1197
|
+
Pn as deleteTable,
|
|
1198
|
+
zn as deleteTableColumn,
|
|
1199
|
+
Fn as deleteTableRow,
|
|
1200
|
+
Nn as findFakeParaPosClosestToPos,
|
|
1201
|
+
Rn as findFakeParaPosForCodeBlock,
|
|
1202
|
+
Dn as findFakeParaPosForNodeSelection,
|
|
1203
|
+
In as findFakeParaPosForTextSelection,
|
|
1204
|
+
ui as fullToolbarConfig,
|
|
1205
|
+
On as gapCursorBackspace,
|
|
1206
|
+
ei as getAdvancedMarkdownRenderers,
|
|
1207
|
+
yl as getBasicWysiwygSelectionState,
|
|
1208
|
+
qn as getBlockquoteType,
|
|
1209
|
+
jn as getBoldType,
|
|
1210
|
+
Un as getCodeBlockType,
|
|
1211
|
+
Wn as getCodeType,
|
|
1212
|
+
Qa as getConfig,
|
|
1213
|
+
Qn as getCurrentLink,
|
|
1214
|
+
Gn as getDeflistTypes,
|
|
1215
|
+
Yn as getHeadingType,
|
|
1216
|
+
Zn as getHorizontalRuleType,
|
|
1217
|
+
Kn as getImageType,
|
|
1218
|
+
Xn as getItalicType,
|
|
1219
|
+
Jn as getLinkType,
|
|
1220
|
+
_n as getMarkType,
|
|
1221
|
+
Ge as getMarkdownEditorMessages,
|
|
1222
|
+
eo as getQuoteLinkType,
|
|
1223
|
+
to as getStrikeType,
|
|
1224
|
+
ct as getToolbarConfig,
|
|
1225
|
+
ao as getUnderlineType,
|
|
1226
|
+
lo as goToTableCell,
|
|
1227
|
+
Yi as headingLevelAttr,
|
|
1228
|
+
Zi as headingNodeName,
|
|
1229
|
+
no as hierarchicalSelectAll,
|
|
1230
|
+
Ki as horizontalRuleMarkupAttr,
|
|
1231
|
+
Xi as horizontalRuleNodeName,
|
|
1232
|
+
oo as imageNodeName,
|
|
1233
|
+
io as imageObjectFitValues,
|
|
1234
|
+
so as insertMermaid,
|
|
1235
|
+
ro as insertTable,
|
|
1236
|
+
uo as insertYfmHtmlBlock,
|
|
1237
|
+
mo as isBreakNode,
|
|
1238
|
+
co as isGapCursorSelection,
|
|
1239
|
+
go as isInsideCode,
|
|
1240
|
+
j as isToolbarItemActive,
|
|
1241
|
+
vt as isToolbarItemAvailable,
|
|
1242
|
+
V as isToolbarItemEnabled,
|
|
1243
|
+
Ji as italicMarkName,
|
|
1244
|
+
vo as joinPrevList,
|
|
1245
|
+
fo as liftEmptyListItem,
|
|
1246
|
+
bo as liftFromQuote,
|
|
1247
|
+
_i as linkMarkName,
|
|
1248
|
+
ko as markMarkName,
|
|
1249
|
+
Xa as markdownEditorMessages,
|
|
1250
|
+
mi as markdownEditorToolbarItemIds,
|
|
1251
|
+
wo as mergeListsPlugin,
|
|
1252
|
+
ho as mermaidActionName,
|
|
1253
|
+
yo as mermaidNodeName,
|
|
1254
|
+
ci as minimalToolbarConfig,
|
|
1255
|
+
Ke as mountBasicMarkupEditor,
|
|
1256
|
+
Ze as mountBasicWysiwygEditor,
|
|
1257
|
+
Mo as moveToNextTableRow,
|
|
1258
|
+
Co as newlineInCode,
|
|
1259
|
+
gt as normalizeToolbarItem,
|
|
1260
|
+
po as quoteLinkActionName,
|
|
1261
|
+
xo as quoteLinkNodeName,
|
|
1262
|
+
Lo as removeCurrentLink,
|
|
1263
|
+
To as removeLink,
|
|
1264
|
+
Ml as renderMarkdownPreview,
|
|
1265
|
+
Bo as resetCodeBlock,
|
|
1266
|
+
Eo as resetHeading,
|
|
1267
|
+
Ho as setCodeBlock,
|
|
1268
|
+
$o as setCodeBlockLanguage,
|
|
1269
|
+
Vo as setImageDisplay,
|
|
1270
|
+
So as setLink,
|
|
1271
|
+
Ao as setTableColumnAlignment,
|
|
1272
|
+
Po as sinkOnlySelectedListItem,
|
|
1273
|
+
zo as splitDeflist,
|
|
1274
|
+
Fo as strikeMarkName,
|
|
1275
|
+
Ga as subscribeConfigure,
|
|
1276
|
+
No as toHeading,
|
|
1277
|
+
Ro as toList,
|
|
1278
|
+
Do as toggleBold,
|
|
1279
|
+
Io as toggleCode,
|
|
1280
|
+
Oo as toggleHighlight,
|
|
1281
|
+
qo as toggleItalic,
|
|
1282
|
+
jo as toggleLink,
|
|
1283
|
+
Uo as toggleQuote,
|
|
1284
|
+
Wo as toggleQuoteLink,
|
|
1285
|
+
Qo as toggleStrike,
|
|
1286
|
+
Go as toggleUnderline,
|
|
1287
|
+
Yo as underlineMarkName,
|
|
1288
|
+
Oa as useMarkdownEditor,
|
|
1289
|
+
Zo as wrapToDeflist,
|
|
1290
|
+
Ko as yfmHtmlBlockActionName,
|
|
1291
|
+
Xo as yfmHtmlBlockNodeName,
|
|
1292
|
+
gi as zeroToolbarConfig
|
|
1293
|
+
};
|