@markweave/vue2 0.1.0 → 0.1.1

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/dist/index.js CHANGED
@@ -9,44 +9,44 @@ import { detectUploadSource as k, getDirectUploadResult as A, resolveMarkweaveUp
9
9
  import { BubbleMenu as M } from "@tiptap/vue-2/menus";
10
10
  import { isEditorComposing as N } from "markweave/internal/editor-core/composition-guard";
11
11
  import { createMarkweaveEditorUpdatePayload as ee, getMarkweaveContentType as P, isEditorContentCurrent as te, normalizeMarkweaveContentFormat as F } from "markweave/internal/editor-core/editor-content";
12
- import { getCurrentFloatingToolbarBlockType as I, getFloatingToolbarHighlightColorOptions as L, getFloatingToolbarMoreActions as R, getFloatingToolbarTextColorOptions as ne, getFloatingToolbarTurnIntoOptions as re, runFloatingToolbarMoreAction as z, setFloatingToolbarTurnInto as ie } from "markweave/internal/editor-core/floating-toolbar-model";
13
- import { openMarkweaveReadonlyLinkFromEvent as ae } from "markweave/internal/editor-core/readonly-link";
14
- import { createMarkweaveEditorRuntimeSnapshot as oe } from "markweave/internal/editor-core/runtime-snapshot";
15
- import { createSelectionSnapshot as B, shouldShowFloatingToolbar as se } from "markweave/internal/editor-core/selection-state";
16
- import { createMarkweaveTocState as ce, emptyMarkweaveTocState as le, getActiveMarkweaveTocId as ue, getMarkweaveTocItems as de, getValidMarkweaveTocActiveId as fe, scrollToMarkweaveTocItem as pe } from "markweave/internal/core/toc-state";
17
- import { codeBlockCollapsePluginKey as me, copyActiveCodeBlock as he, getActiveCodeBlockState as ge, getCodeBlockCopyFeedbackSnapshot as _e, markweaveCodeBlockBehavior as ve, setCodeBlockCollapsedAtPosition as ye, setCodeBlockLanguageAtPosition as be, setCodeBlockMermaidPreviewModeAtPosition as xe } from "markweave/internal/plugins/codeblock/codeblock-behavior";
18
- import { calculateCodeBlockLanguageMenuPosition as Se, clampFullscreenScale as Ce, codeBlockCopyFeedbackTimeoutMs as we, copyCodeBlockText as Te, createCodeBlockOverlayPosition as Ee, createMermaidFullscreenViewerState as De, createMermaidTabPosition as Oe, focusCodeBlockTarget as ke, formatCodeBlockLanguageLabel as Ae, formatFullscreenZoom as je, getActiveCodeBlockElement as Me, getAnchoredRect as Ne, getCodeBlockLanguageItems as Pe, getCodeBlockPositionFromEventTarget as Fe, getCodeBlockStateAtPosition as Ie, getFrameElement as Le, getMermaidCodeBlockTargets as Re, getMermaidSvgMarkup as ze, isCodeBlockTargetCollapsed as Be, mergeStableMermaidTabPositions as Ve, mermaidFullscreenZoomStep as He, moveMermaidFullscreenViewer as Ue } from "markweave/internal/plugins/codeblock/codeblock-ui-model";
19
- import { normalizeMarkdownLinkHref as We } from "markweave/internal/plugins/markdown/markdown-input";
20
- import { applyMarkweaveMathLatex as Ge, calculateMarkweaveMathPopoverPosition as Ke, getMarkweaveMathAnchorRect as qe, getMarkweaveMathBlockIndex as Je, getMarkweaveMathRenderedHtml as Ye, getMarkweaveMathTargetAtPos as Xe, getMarkweaveMathTargetFromDomEvent as Ze, getMarkweaveMathTargetFromSelection as Qe, renderMarkweaveMathPreview as $e, setMarkweaveMathEditingDomState as et, setMarkweaveMathEditingDomStateInView as tt, setMarkweaveMathSelectionInView as nt } from "markweave/internal/plugins/math/math-ui-model";
21
- import { isMermaidInlinePreviewTransaction as rt, setMermaidInlinePreviewEditorMode as it, setReadonlyMermaidPreviewMode as at } from "markweave/internal/plugins/mermaid/mermaid-inline-preview";
22
- import { getMermaidPreviewState as ot } from "markweave/internal/plugins/mermaid/mermaid-renderer";
23
- import { filterSlashCommands as st, isExecutableSlashCommand as ct } from "markweave/internal/plugins/slash-command/command-spec";
24
- import { getSlashCommandKeyboardAction as lt } from "markweave/internal/plugins/slash-command/slash-keyboard";
25
- import { executeSlashCommand as ut, getNextSlashCommandState as dt, getSlashCommandAnchoredMenuPosition as ft, getSlashCommandContext as pt } from "markweave/internal/plugins/slash-command/slash-runtime";
26
- import { initialSlashCommandState as mt, reduceSlashCommandState as ht } from "markweave/internal/plugins/slash-command/slash-state";
27
- import { setMarkweaveTableMenuAxisTarget as gt } from "markweave/internal/plugins/table/table-clipboard";
28
- import { getFirstTableDebugSnapshot as _t } from "markweave/internal/plugins/table/table-debug-snapshot";
29
- import { focusFirstTableBodyCell as vt } from "markweave/internal/plugins/table/table-focus-position";
30
- import { getTableFocusState as yt } from "markweave/internal/plugins/table/table-focus-state";
31
- import { getTableSelectionOverlayState as bt, initialTableInteractionState as xt, tableInteractionPluginKey as St } from "markweave/internal/plugins/table/table-interaction-layer";
32
- import { calculateAnchoredTableMenuPosition as Ct, calculateTableEdgeHandlePosition as wt, canRunTableCommand as Tt, executeTableMenuCommand as Et, formatTableCopyFeedback as Dt, getActiveTableElement as Ot, getAvailableCellMenuCommandSpecs as kt, getTableAxisTargetRect as At, getTableControlAxisSelectionModel as jt, getTableEditWithAiRequest as Mt, getTableMenuItemGroup as Nt, getTableMenuItemLabel as Pt, getTableMenuItems as Ft, getTableSelectionTargetRect as It, measureTableSelectionOverlay as Lt, selectTableAxisFromCell as Rt, tableCopyFeedbackTimeoutMs as zt, tableMenuLabel as Bt } from "markweave/internal/plugins/table/table-ui-model";
12
+ import { getCurrentFloatingToolbarBlockType as ne, getFloatingToolbarHighlightColorOptions as I, getFloatingToolbarMoreActions as L, getFloatingToolbarTextColorOptions as re, getFloatingToolbarTurnIntoOptions as ie, runFloatingToolbarMoreAction as R, setFloatingToolbarTurnInto as ae } from "markweave/internal/editor-core/floating-toolbar-model";
13
+ import { openMarkweaveReadonlyLinkFromEvent as oe } from "markweave/internal/editor-core/readonly-link";
14
+ import { createMarkweaveEditorRuntimeSnapshot as se } from "markweave/internal/editor-core/runtime-snapshot";
15
+ import { createSelectionSnapshot as z, shouldShowFloatingToolbar as ce } from "markweave/internal/editor-core/selection-state";
16
+ import { createMarkweaveTocState as le, emptyMarkweaveTocState as ue, getActiveMarkweaveTocId as de, getMarkweaveTocItems as fe, getValidMarkweaveTocActiveId as pe, normalizeMarkweaveInnerTocPlacement as me, observeMarkweaveInnerTocContainerPosition as he, scrollToMarkweaveTocItem as ge } from "markweave/internal/core/toc-state";
17
+ import { codeBlockCollapsePluginKey as _e, copyActiveCodeBlock as ve, getActiveCodeBlockState as ye, getCodeBlockCopyFeedbackSnapshot as be, markweaveCodeBlockBehavior as xe, setCodeBlockCollapsedAtPosition as Se, setCodeBlockLanguageAtPosition as Ce, setCodeBlockMermaidPreviewModeAtPosition as we } from "markweave/internal/plugins/codeblock/codeblock-behavior";
18
+ import { calculateCodeBlockLanguageMenuPosition as Te, clampFullscreenScale as Ee, codeBlockCopyFeedbackTimeoutMs as De, copyCodeBlockText as Oe, createCodeBlockOverlayPosition as ke, createMermaidFullscreenViewerState as Ae, createMermaidTabPosition as je, focusCodeBlockTarget as Me, formatCodeBlockLanguageLabel as Ne, formatFullscreenZoom as Pe, getActiveCodeBlockElement as Fe, getAnchoredRect as Ie, getCodeBlockLanguageItems as Le, getCodeBlockPositionFromEventTarget as Re, getCodeBlockStateAtPosition as ze, getFrameElement as Be, getMermaidCodeBlockTargets as Ve, getMermaidSvgMarkup as He, isCodeBlockTargetCollapsed as Ue, mergeStableMermaidTabPositions as We, mermaidFullscreenZoomStep as Ge, moveMermaidFullscreenViewer as Ke } from "markweave/internal/plugins/codeblock/codeblock-ui-model";
19
+ import { normalizeMarkdownLinkHref as qe } from "markweave/internal/plugins/markdown/markdown-input";
20
+ import { applyMarkweaveMathLatex as Je, calculateMarkweaveMathPopoverPosition as Ye, getMarkweaveMathAnchorRect as Xe, getMarkweaveMathBlockIndex as Ze, getMarkweaveMathRenderedHtml as Qe, getMarkweaveMathTargetAtPos as $e, getMarkweaveMathTargetFromDomEvent as et, getMarkweaveMathTargetFromSelection as tt, renderMarkweaveMathPreview as nt, setMarkweaveMathEditingDomState as rt, setMarkweaveMathEditingDomStateInView as it, setMarkweaveMathSelectionInView as at } from "markweave/internal/plugins/math/math-ui-model";
21
+ import { isMermaidInlinePreviewTransaction as ot, setMermaidInlinePreviewEditorMode as st, setReadonlyMermaidPreviewMode as ct } from "markweave/internal/plugins/mermaid/mermaid-inline-preview";
22
+ import { getMermaidPreviewState as lt } from "markweave/internal/plugins/mermaid/mermaid-renderer";
23
+ import { filterSlashCommands as ut, isExecutableSlashCommand as dt } from "markweave/internal/plugins/slash-command/command-spec";
24
+ import { getSlashCommandKeyboardAction as ft } from "markweave/internal/plugins/slash-command/slash-keyboard";
25
+ import { executeSlashCommand as pt, getNextSlashCommandState as mt, getSlashCommandAnchoredMenuPosition as ht, getSlashCommandContext as gt } from "markweave/internal/plugins/slash-command/slash-runtime";
26
+ import { initialSlashCommandState as _t, reduceSlashCommandState as vt } from "markweave/internal/plugins/slash-command/slash-state";
27
+ import { setMarkweaveTableMenuAxisTarget as yt } from "markweave/internal/plugins/table/table-clipboard";
28
+ import { getFirstTableDebugSnapshot as bt } from "markweave/internal/plugins/table/table-debug-snapshot";
29
+ import { focusFirstTableBodyCell as xt } from "markweave/internal/plugins/table/table-focus-position";
30
+ import { getTableFocusState as St } from "markweave/internal/plugins/table/table-focus-state";
31
+ import { getTableSelectionOverlayState as Ct, initialTableInteractionState as wt, tableInteractionPluginKey as Tt } from "markweave/internal/plugins/table/table-interaction-layer";
32
+ import { calculateAnchoredTableMenuPosition as Et, calculateTableEdgeHandlePosition as Dt, canRunTableCommand as Ot, executeTableMenuCommand as kt, formatTableCopyFeedback as At, getActiveTableElement as jt, getAvailableCellMenuCommandSpecs as Mt, getTableAxisTargetRect as Nt, getTableControlAxisSelectionModel as Pt, getTableEditWithAiRequest as Ft, getTableMenuItemGroup as It, getTableMenuItemLabel as Lt, getTableMenuItems as Rt, getTableSelectionTargetRect as zt, measureTableSelectionOverlay as Bt, selectTableAxisFromCell as Vt, tableCopyFeedbackTimeoutMs as Ht, tableMenuLabel as Ut } from "markweave/internal/plugins/table/table-ui-model";
33
33
  //#region src/vue2-compat.ts
34
- var Vt = o.default ?? o, Ht = null, Ut = null, Wt = null;
35
- function Gt(e) {
34
+ var Wt = o.default ?? o, Gt = null, Kt = null, qt = null;
35
+ function Jt(e) {
36
36
  return !!(e && typeof e == "object" && "value" in e);
37
37
  }
38
- function Kt(e) {
38
+ function Yt(e) {
39
39
  let t = e.slice(2);
40
40
  return t.endsWith("Capture") ? `!${t.slice(0, -7).replace(/^[A-Z]/, (e) => e.toLowerCase())}` : t.replace(/^[A-Z]/, (e) => e.toLowerCase());
41
41
  }
42
- function qt(e) {
42
+ function Xt(e) {
43
43
  let t = {}, n = {}, r = {}, i = {}, a = {};
44
44
  for (let [o, s] of Object.entries(e)) if (s !== void 0) {
45
45
  if (o === "class" || o === "style" || o === "key") {
46
46
  t[o] = s;
47
47
  continue;
48
48
  }
49
- if (o === "ref" && Gt(s)) {
49
+ if (o === "ref" && Jt(s)) {
50
50
  a.insert = (e) => {
51
51
  s.value = e.elm;
52
52
  }, a.destroy = () => {
@@ -55,7 +55,7 @@ function qt(e) {
55
55
  continue;
56
56
  }
57
57
  if (/^on[A-Z]/.test(o)) {
58
- i[Kt(o)] = s;
58
+ i[Yt(o)] = s;
59
59
  continue;
60
60
  }
61
61
  if (o === "value" || o === "checked" || o === "innerHTML" || o === "textContent") {
@@ -66,14 +66,14 @@ function qt(e) {
66
66
  }
67
67
  return Object.keys(n).length && (t.attrs = n), Object.keys(r).length && (t.domProps = r), Object.keys(i).length && (t.on = i), Object.keys(a).length && (t.hook = a), t;
68
68
  }
69
- function Jt(e) {
69
+ function Zt(e) {
70
70
  let t = {}, n = {}, r = {}, i = {};
71
71
  for (let [a, o] of Object.entries(e)) if (o !== void 0) {
72
72
  if (a === "class" || a === "style" || a === "key") {
73
73
  t[a] = o;
74
74
  continue;
75
75
  }
76
- if (a === "ref" && Gt(o)) {
76
+ if (a === "ref" && Jt(o)) {
77
77
  i.insert = (e) => {
78
78
  o.value = e.componentInstance ?? e.elm;
79
79
  }, i.destroy = () => {
@@ -89,47 +89,47 @@ function Jt(e) {
89
89
  }
90
90
  return Object.keys(n).length && (t.props = n), Object.keys(r).length && (t.attrs = r), Object.keys(i).length && (t.hook = i), t;
91
91
  }
92
- function Yt(e) {
92
+ function Qt(e) {
93
93
  return !!(e && typeof e == "object" && "default" in e && typeof e.default == "function");
94
94
  }
95
- function Xt(e) {
95
+ function $t(e) {
96
96
  return !!(e && typeof e == "object" && ("tag" in e || "text" in e || "elm" in e || "componentOptions" in e || "componentInstance" in e));
97
97
  }
98
- function Zt(e) {
98
+ function en(e) {
99
99
  return e == null || Array.isArray(e) ? e : [e];
100
100
  }
101
- function Qt(e) {
102
- return typeof e == "function" ? Zt(e()) : Yt(e) ? Zt(e.default()) : Xt(e) ? [e] : e;
101
+ function tn(e) {
102
+ return typeof e == "function" ? en(e()) : Qt(e) ? en(e.default()) : $t(e) ? [e] : e;
103
103
  }
104
- function V(e, t, n) {
105
- if (!Wt) throw Error("Vue 2 render context is not available.");
106
- let r = t && typeof t == "object" && !Array.isArray(t) ? t : {}, i = typeof e == "string" ? qt(r) : Jt(r), a = arguments.length === 2 && (Array.isArray(t) || typeof t == "string") ? t : Qt(n);
107
- return Wt(e, i, a);
104
+ function B(e, t, n) {
105
+ if (!qt) throw Error("Vue 2 render context is not available.");
106
+ let r = t && typeof t == "object" && !Array.isArray(t) ? t : {}, i = typeof e == "string" ? Xt(r) : Zt(r), a = arguments.length === 2 && (Array.isArray(t) || typeof t == "string") ? t : tn(n);
107
+ return qt(e, i, a);
108
108
  }
109
- function H(e) {
110
- return Vt.observable({ value: e });
109
+ function V(e) {
110
+ return Wt.observable({ value: e });
111
111
  }
112
- var U = H;
113
- function W(e) {
112
+ var H = V;
113
+ function U(e) {
114
114
  return { get value() {
115
115
  return e();
116
116
  } };
117
117
  }
118
- function G(e, t, n) {
118
+ function W(e, t, n) {
119
119
  let r = typeof e == "function" ? e : () => e.value;
120
- return Ht?.$watch ? Ht.$watch(r, t, n) : () => void 0;
120
+ return Gt?.$watch ? Gt.$watch(r, t, n) : () => void 0;
121
121
  }
122
- function $t(e) {
123
- Ut?.mounted.push(e);
122
+ function G(e) {
123
+ Kt?.mounted.push(e);
124
124
  }
125
125
  function K(e) {
126
- Ut?.beforeUnmount.push(e);
126
+ Kt?.beforeUnmount.push(e);
127
127
  }
128
128
  function q(e) {
129
- return Vt.nextTick(e);
129
+ return Wt.nextTick(e);
130
130
  }
131
131
  function J(e) {
132
- return Vt.extend({
132
+ return Wt.extend({
133
133
  name: e.name,
134
134
  props: e.props,
135
135
  created() {
@@ -137,12 +137,12 @@ function J(e) {
137
137
  mounted: [],
138
138
  beforeUnmount: []
139
139
  };
140
- Ht = this, Ut = t;
140
+ Gt = this, Kt = t;
141
141
  try {
142
142
  let n = e.setup?.(this.$props ?? this) ?? null;
143
143
  this.__markweaveVue2Render = typeof n == "function" ? n : null, this.__markweaveVue2Lifecycle = t;
144
144
  } finally {
145
- Ht = null, Ut = null;
145
+ Gt = null, Kt = null;
146
146
  }
147
147
  },
148
148
  mounted() {
@@ -152,19 +152,19 @@ function J(e) {
152
152
  this.__markweaveVue2Lifecycle?.beforeUnmount.forEach((e) => e());
153
153
  },
154
154
  render(t) {
155
- Wt = t;
155
+ qt = t;
156
156
  try {
157
157
  let n = this.__markweaveVue2Render;
158
158
  return n ? n() : e.render?.(t) ?? null;
159
159
  } finally {
160
- Wt = null;
160
+ qt = null;
161
161
  }
162
162
  }
163
163
  });
164
164
  }
165
165
  //#endregion
166
166
  //#region src/vue2-icons.ts
167
- var en = {
167
+ var nn = {
168
168
  AlignCenter: {
169
169
  iconName: "text-align-center",
170
170
  node: [
@@ -1029,8 +1029,8 @@ var en = {
1029
1029
  }]]
1030
1030
  }
1031
1031
  };
1032
- function tn(e) {
1033
- return e.map(([e, t]) => V(e, t));
1032
+ function rn(e) {
1033
+ return e.map(([e, t]) => B(e, t));
1034
1034
  }
1035
1035
  function Y(e) {
1036
1036
  return J({
@@ -1050,8 +1050,8 @@ function Y(e) {
1050
1050
  }
1051
1051
  },
1052
1052
  setup(t) {
1053
- let n = en[e];
1054
- return () => V("svg", {
1053
+ let n = nn[e];
1054
+ return () => B("svg", {
1055
1055
  class: `lucide lucide-${n.iconName}`,
1056
1056
  viewBox: "0 0 24 24",
1057
1057
  width: t.size,
@@ -1063,16 +1063,16 @@ function Y(e) {
1063
1063
  "stroke-width": t.absoluteStrokeWidth && t.size ? Number(t.strokeWidth) * 24 / Number(t.size) : t.strokeWidth,
1064
1064
  "aria-hidden": "true",
1065
1065
  focusable: "false"
1066
- }, tn(n.node));
1066
+ }, rn(n.node));
1067
1067
  }
1068
1068
  });
1069
1069
  }
1070
- var nn = Y("AlignCenter"), rn = Y("AlignJustify"), an = Y("AlignLeft"), on = Y("AlignRight"), sn = Y("AlertTriangle"), cn = Y("Bold"), ln = Y("Braces"), un = Y("Captions"), dn = Y("CheckCircle2"), fn = Y("ChevronDown"), pn = Y("ChevronUp"), mn = Y("CircleX"), hn = Y("Code2"), gn = Y("CornerDownLeft"), _n = Y("Download");
1070
+ var an = Y("AlignCenter"), on = Y("AlignJustify"), sn = Y("AlignLeft"), cn = Y("AlignRight"), ln = Y("AlertTriangle"), un = Y("Bold"), dn = Y("Braces"), fn = Y("Captions"), pn = Y("CheckCircle2"), mn = Y("ChevronDown"), hn = Y("ChevronUp"), gn = Y("CircleX"), _n = Y("Code2"), vn = Y("CornerDownLeft"), yn = Y("Download");
1071
1071
  Y("Eye");
1072
- var vn = Y("ExternalLink"), yn = Y("Heading1"), bn = Y("Heading2"), xn = Y("Heading3"), Sn = Y("Image"), Cn = Y("ImageUp"), wn = Y("IndentDecrease"), Tn = Y("IndentIncrease"), En = Y("Info"), Dn = Y("Italic"), On = Y("Lightbulb"), kn = Y("Link2"), An = Y("List"), jn = Y("ListChecks"), Mn = Y("ListOrdered"), Nn = Y("Minus"), Pn = Y("MoreVertical"), Fn = Y("Paperclip");
1072
+ var bn = Y("ExternalLink"), xn = Y("Heading1"), Sn = Y("Heading2"), Cn = Y("Heading3"), wn = Y("Image"), Tn = Y("ImageUp"), En = Y("IndentDecrease"), Dn = Y("IndentIncrease"), On = Y("Info"), kn = Y("Italic"), An = Y("Lightbulb"), jn = Y("Link2"), Mn = Y("List"), Nn = Y("ListChecks"), Pn = Y("ListOrdered"), Fn = Y("Minus"), In = Y("MoreVertical"), Ln = Y("Paperclip");
1073
1073
  Y("PencilLine");
1074
- var In = Y("Quote"), Ln = Y("Replace"), Rn = Y("Sigma"), zn = Y("SmilePlus"), Bn = Y("Strikethrough"), Vn = Y("Subscript"), Hn = Y("Superscript"), Un = Y("Table2"), Wn = Y("Text"), Gn = Y("Trash2"), Kn = Y("Type"), qn = Y("Underline"), Jn = Y("Upload"), Yn = Y("Video"), Xn = T;
1075
- function Zn(e) {
1074
+ var Rn = Y("Quote"), zn = Y("Replace"), Bn = Y("Sigma"), Vn = Y("SmilePlus"), Hn = Y("Strikethrough"), Un = Y("Subscript"), Wn = Y("Superscript"), Gn = Y("Table2"), Kn = Y("Text"), qn = Y("Trash2"), Jn = Y("Type"), Yn = Y("Underline"), Xn = Y("Upload"), Zn = Y("Video"), Qn = T;
1075
+ function $n(e) {
1076
1076
  let t = e.view.dom.closest(".markweave-editor-frame"), n = () => {
1077
1077
  let n = t?.getAttribute("data-markweave-mode");
1078
1078
  return n === "view" ? {
@@ -1082,7 +1082,7 @@ function Zn(e) {
1082
1082
  mode: "live",
1083
1083
  editable: e.isEditable
1084
1084
  } : s(e);
1085
- }, r = H(n()), i = d(e, () => {
1085
+ }, r = V(n()), i = d(e, () => {
1086
1086
  r.value = n();
1087
1087
  }), a = typeof MutationObserver > "u" || !t ? null : new MutationObserver(() => {
1088
1088
  r.value = n();
@@ -1094,21 +1094,21 @@ function Zn(e) {
1094
1094
  i(), a?.disconnect();
1095
1095
  }), r;
1096
1096
  }
1097
- function Qn(e) {
1097
+ function er(e) {
1098
1098
  return e instanceof Element && !!e.closest("[data-markweave-image-ui=\"true\"]");
1099
1099
  }
1100
- function $n(e) {
1100
+ function tr(e) {
1101
1101
  return e instanceof Element && !!e.closest("[data-markweave-video-ui=\"true\"], iframe[data-markweave-video-embed], video[data-markweave-video]");
1102
1102
  }
1103
- function er(e, t) {
1104
- return V(e, {
1103
+ function nr(e, t) {
1104
+ return B(e, {
1105
1105
  size: 18,
1106
1106
  strokeWidth: 1.8,
1107
1107
  "aria-hidden": "true"
1108
1108
  }, { default: () => t });
1109
1109
  }
1110
1110
  function X(e) {
1111
- return V("button", {
1111
+ return B("button", {
1112
1112
  type: "button",
1113
1113
  "aria-label": e.label,
1114
1114
  title: e.label,
@@ -1116,14 +1116,14 @@ function X(e) {
1116
1116
  "data-active": e.active ? "true" : "false",
1117
1117
  onMousedown: (e) => e.preventDefault(),
1118
1118
  onClick: e.onClick
1119
- }, [er(e.icon, e.label), V("span", {
1119
+ }, [nr(e.icon, e.label), B("span", {
1120
1120
  class: "markweave-image-tooltip",
1121
1121
  role: "tooltip"
1122
1122
  }, e.label)]);
1123
1123
  }
1124
- function tr(e) {
1125
- let t = H(null), n = e.messages.image;
1126
- return V("section", {
1124
+ function rr(e) {
1125
+ let t = V(null), n = e.messages.image;
1126
+ return B("section", {
1127
1127
  class: "markweave-image-upload-placeholder",
1128
1128
  "data-testid": "markweave-image-upload-placeholder",
1129
1129
  "data-drag-active": e.dragActive ? "true" : "false",
@@ -1141,7 +1141,7 @@ function tr(e) {
1141
1141
  n && e.onFile(n);
1142
1142
  }
1143
1143
  }, [
1144
- V("input", {
1144
+ B("input", {
1145
1145
  ref: t,
1146
1146
  "data-testid": "markweave-image-file-input",
1147
1147
  type: "file",
@@ -1152,20 +1152,20 @@ function tr(e) {
1152
1152
  r && e.onFile(r), n.value = "";
1153
1153
  }
1154
1154
  }),
1155
- V("div", {
1155
+ B("div", {
1156
1156
  class: "markweave-image-upload-icon",
1157
1157
  "aria-hidden": "true"
1158
- }, [V(Cn, {
1158
+ }, [B(Tn, {
1159
1159
  size: 46,
1160
1160
  strokeWidth: 1.6
1161
1161
  })]),
1162
- V("div", { class: "markweave-image-upload-copy" }, [V("button", {
1162
+ B("div", { class: "markweave-image-upload-copy" }, [B("button", {
1163
1163
  type: "button",
1164
1164
  onClick: () => t.value?.click()
1165
- }, n.clickToUpload), V("span", null, n.dragAndDrop)]),
1166
- V("div", { class: "markweave-image-upload-note" }, n.uploadNote),
1167
- V("div", { class: "markweave-image-upload-row" }, [
1168
- V("input", {
1165
+ }, n.clickToUpload), B("span", null, n.dragAndDrop)]),
1166
+ B("div", { class: "markweave-image-upload-note" }, n.uploadNote),
1167
+ B("div", { class: "markweave-image-upload-row" }, [
1168
+ B("input", {
1169
1169
  "data-testid": "markweave-image-url-input",
1170
1170
  value: e.inputValue,
1171
1171
  placeholder: n.uploadInputPlaceholder,
@@ -1175,30 +1175,30 @@ function tr(e) {
1175
1175
  t.key === "Enter" && (t.preventDefault(), e.onSubmit());
1176
1176
  }
1177
1177
  }),
1178
- V("button", {
1178
+ B("button", {
1179
1179
  type: "button",
1180
1180
  "data-testid": "markweave-image-upload-submit",
1181
1181
  disabled: e.isSubmitting || !e.inputValue.trim(),
1182
1182
  onClick: e.onSubmit
1183
- }, [V(Cn, {
1183
+ }, [B(Tn, {
1184
1184
  size: 16,
1185
1185
  strokeWidth: 1.8
1186
1186
  }), e.messages.common.insert]),
1187
- V("button", {
1187
+ B("button", {
1188
1188
  type: "button",
1189
1189
  "data-testid": "markweave-image-upload-cancel",
1190
1190
  onClick: e.onCancel
1191
1191
  }, e.messages.common.cancel)
1192
1192
  ]),
1193
- e.error ? V("div", {
1193
+ e.error ? B("div", {
1194
1194
  class: "markweave-image-upload-error",
1195
1195
  role: "alert"
1196
1196
  }, e.error) : null
1197
1197
  ]);
1198
1198
  }
1199
- function nr(e) {
1200
- let t = H(null), n = e.messages.video;
1201
- return V("section", {
1199
+ function ir(e) {
1200
+ let t = V(null), n = e.messages.video;
1201
+ return B("section", {
1202
1202
  class: "markweave-video-upload-placeholder",
1203
1203
  "data-testid": "markweave-video-upload-placeholder",
1204
1204
  "data-drag-active": e.dragActive ? "true" : "false",
@@ -1216,7 +1216,7 @@ function nr(e) {
1216
1216
  n && e.onFile(n);
1217
1217
  }
1218
1218
  }, [
1219
- V("input", {
1219
+ B("input", {
1220
1220
  ref: t,
1221
1221
  "data-testid": "markweave-video-file-input",
1222
1222
  type: "file",
@@ -1227,20 +1227,20 @@ function nr(e) {
1227
1227
  r && e.onFile(r), n.value = "";
1228
1228
  }
1229
1229
  }),
1230
- V("div", {
1230
+ B("div", {
1231
1231
  class: "markweave-video-upload-icon",
1232
1232
  "aria-hidden": "true"
1233
- }, [V(Yn, {
1233
+ }, [B(Zn, {
1234
1234
  size: 46,
1235
1235
  strokeWidth: 1.6
1236
1236
  })]),
1237
- V("div", { class: "markweave-video-upload-copy" }, [V("button", {
1237
+ B("div", { class: "markweave-video-upload-copy" }, [B("button", {
1238
1238
  type: "button",
1239
1239
  onClick: () => t.value?.click()
1240
- }, n.clickToUpload), V("span", null, n.dragAndDrop)]),
1241
- V("div", { class: "markweave-video-upload-note" }, n.uploadNote),
1242
- V("div", { class: "markweave-video-upload-row" }, [
1243
- V("input", {
1240
+ }, n.clickToUpload), B("span", null, n.dragAndDrop)]),
1241
+ B("div", { class: "markweave-video-upload-note" }, n.uploadNote),
1242
+ B("div", { class: "markweave-video-upload-row" }, [
1243
+ B("input", {
1244
1244
  "data-testid": "markweave-video-url-input",
1245
1245
  value: e.inputValue,
1246
1246
  placeholder: n.uploadInputPlaceholder,
@@ -1250,28 +1250,28 @@ function nr(e) {
1250
1250
  t.key === "Enter" && (t.preventDefault(), e.onSubmit());
1251
1251
  }
1252
1252
  }),
1253
- V("button", {
1253
+ B("button", {
1254
1254
  type: "button",
1255
1255
  "data-testid": "markweave-video-upload-submit",
1256
1256
  disabled: e.isSubmitting || !e.inputValue.trim(),
1257
1257
  onClick: e.onSubmit
1258
- }, [V(Jn, {
1258
+ }, [B(Xn, {
1259
1259
  size: 16,
1260
1260
  strokeWidth: 1.8
1261
1261
  }), e.messages.common.insert]),
1262
- V("button", {
1262
+ B("button", {
1263
1263
  type: "button",
1264
1264
  "data-testid": "markweave-video-upload-cancel",
1265
1265
  onClick: e.onCancel
1266
1266
  }, e.messages.common.cancel)
1267
1267
  ]),
1268
- e.error ? V("div", {
1268
+ e.error ? B("div", {
1269
1269
  class: "markweave-video-upload-error",
1270
1270
  role: "alert"
1271
1271
  }, e.error) : null
1272
1272
  ]);
1273
1273
  }
1274
- var rr = J({
1274
+ var ar = J({
1275
1275
  name: "MarkweaveVueImageNodeView",
1276
1276
  props: {
1277
1277
  editor: {
@@ -1304,8 +1304,8 @@ var rr = J({
1304
1304
  }
1305
1305
  },
1306
1306
  setup(e) {
1307
- let t = H(null), n = H(!1), r = H(!1), a = H(!1), o = H(""), s = H(null), l = H(!1), u = W(() => e.node.attrs), d = H(!!O(u.value.caption)), f = H(O(u.value.caption) ?? ""), m = Zn(e.editor), h = W(() => c(m.value)), g = W(() => e.extension.options?.messages ?? p("zh")), v = W(() => g.value.image), y = W(() => O(u.value.src)), S = W(() => Xn(u.value.align)), w = W(() => D(u.value.width)), T = W(() => O(u.value.caption)), E = W(() => h.value && (!y.value || r.value));
1308
- G(T, (e) => {
1307
+ let t = V(null), n = V(!1), r = V(!1), a = V(!1), o = V(""), s = V(null), l = V(!1), u = U(() => e.node.attrs), d = V(!!O(u.value.caption)), f = V(O(u.value.caption) ?? ""), m = $n(e.editor), h = U(() => c(m.value)), g = U(() => e.extension.options?.messages ?? p("zh")), v = U(() => g.value.image), y = U(() => O(u.value.src)), S = U(() => Qn(u.value.align)), w = U(() => D(u.value.width)), T = U(() => O(u.value.caption)), E = U(() => h.value && (!y.value || r.value));
1308
+ W(T, (e) => {
1309
1309
  d.value || (f.value = e ?? "");
1310
1310
  });
1311
1311
  let A = () => {
@@ -1357,7 +1357,7 @@ var rr = J({
1357
1357
  };
1358
1358
  window.addEventListener("pointermove", c), window.addEventListener("pointerup", l, { once: !0 });
1359
1359
  };
1360
- return () => E.value ? V(i, {
1360
+ return () => E.value ? B(i, {
1361
1361
  as: "figure",
1362
1362
  class: "markweave-image-node",
1363
1363
  "data-testid": "markweave-image-node",
@@ -1365,7 +1365,7 @@ var rr = J({
1365
1365
  "data-selected": "false",
1366
1366
  "data-hovered": "false",
1367
1367
  "data-empty": "true"
1368
- }, () => tr({
1368
+ }, () => rr({
1369
1369
  messages: g.value,
1370
1370
  inputValue: o.value,
1371
1371
  error: s.value,
@@ -1380,7 +1380,7 @@ var rr = J({
1380
1380
  onDragActive: (e) => {
1381
1381
  a.value = e;
1382
1382
  }
1383
- })) : V(i, {
1383
+ })) : B(i, {
1384
1384
  as: "figure",
1385
1385
  class: "markweave-image-node",
1386
1386
  "data-testid": "markweave-image-node",
@@ -1395,10 +1395,10 @@ var rr = J({
1395
1395
  n.value = !1;
1396
1396
  },
1397
1397
  onMousedown: (e) => {
1398
- h.value && !Qn(e.target) && A();
1398
+ h.value && !er(e.target) && A();
1399
1399
  }
1400
1400
  }, () => [
1401
- h.value ? V("div", {
1401
+ h.value ? B("div", {
1402
1402
  class: "markweave-image-toolbar",
1403
1403
  "data-testid": "markweave-image-toolbar",
1404
1404
  "data-markweave-image-ui": "true",
@@ -1407,39 +1407,39 @@ var rr = J({
1407
1407
  X({
1408
1408
  testId: "markweave-image-align-left",
1409
1409
  label: v.value.alignLeft,
1410
- icon: an,
1410
+ icon: sn,
1411
1411
  active: S.value === "left",
1412
1412
  onClick: () => e.updateAttributes({ align: "left" })
1413
1413
  }),
1414
1414
  X({
1415
1415
  testId: "markweave-image-align-center",
1416
1416
  label: v.value.alignCenter,
1417
- icon: nn,
1417
+ icon: an,
1418
1418
  active: S.value === "center",
1419
1419
  onClick: () => e.updateAttributes({ align: "center" })
1420
1420
  }),
1421
1421
  X({
1422
1422
  testId: "markweave-image-align-right",
1423
1423
  label: v.value.alignRight,
1424
- icon: on,
1424
+ icon: cn,
1425
1425
  active: S.value === "right",
1426
1426
  onClick: () => e.updateAttributes({ align: "right" })
1427
1427
  }),
1428
- V("span", {
1428
+ B("span", {
1429
1429
  class: "markweave-image-toolbar-divider",
1430
1430
  "aria-hidden": "true"
1431
1431
  }),
1432
1432
  X({
1433
1433
  testId: "markweave-image-caption",
1434
1434
  label: v.value.caption,
1435
- icon: un,
1435
+ icon: fn,
1436
1436
  active: d.value || !!T.value,
1437
1437
  onClick: te
1438
1438
  }),
1439
1439
  X({
1440
1440
  testId: "markweave-image-download",
1441
1441
  label: v.value.download,
1442
- icon: _n,
1442
+ icon: yn,
1443
1443
  onClick: () => {
1444
1444
  y.value && C(y.value);
1445
1445
  }
@@ -1447,39 +1447,39 @@ var rr = J({
1447
1447
  X({
1448
1448
  testId: "markweave-image-replace",
1449
1449
  label: v.value.replace,
1450
- icon: Ln,
1450
+ icon: zn,
1451
1451
  onClick: () => {
1452
1452
  o.value = "", s.value = null, r.value = !0;
1453
1453
  }
1454
1454
  }),
1455
- V("span", {
1455
+ B("span", {
1456
1456
  class: "markweave-image-toolbar-divider",
1457
1457
  "aria-hidden": "true"
1458
1458
  }),
1459
1459
  X({
1460
1460
  testId: "markweave-image-delete",
1461
1461
  label: v.value.delete,
1462
- icon: Gn,
1462
+ icon: qn,
1463
1463
  onClick: () => e.deleteNode()
1464
1464
  })
1465
1465
  ]) : null,
1466
- V("div", {
1466
+ B("div", {
1467
1467
  ref: t,
1468
1468
  class: "markweave-image-box",
1469
1469
  style: w.value ? { width: `${Math.round(w.value)}px` } : void 0
1470
1470
  }, [
1471
- y.value ? V("img", {
1471
+ y.value ? B("img", {
1472
1472
  class: "markweave-image",
1473
1473
  src: y.value,
1474
1474
  alt: O(u.value.alt) ?? "",
1475
1475
  title: O(u.value.title) ?? void 0,
1476
1476
  draggable: !1
1477
- }) : V("div", {
1477
+ }) : B("div", {
1478
1478
  class: "markweave-image-readonly-empty",
1479
1479
  "data-testid": "markweave-image-readonly-empty",
1480
1480
  "aria-hidden": "true"
1481
1481
  }),
1482
- h.value ? V("button", {
1482
+ h.value ? B("button", {
1483
1483
  type: "button",
1484
1484
  class: "markweave-image-resize-handle",
1485
1485
  "data-testid": "markweave-image-resize-left",
@@ -1488,7 +1488,7 @@ var rr = J({
1488
1488
  "data-markweave-image-ui": "true",
1489
1489
  onPointerdown: (e) => F("left", e)
1490
1490
  }) : null,
1491
- h.value ? V("button", {
1491
+ h.value ? B("button", {
1492
1492
  type: "button",
1493
1493
  class: "markweave-image-resize-handle",
1494
1494
  "data-testid": "markweave-image-resize-right",
@@ -1498,7 +1498,7 @@ var rr = J({
1498
1498
  onPointerdown: (e) => F("right", e)
1499
1499
  }) : null
1500
1500
  ]),
1501
- h.value && (d.value || T.value) ? V("input", {
1501
+ h.value && (d.value || T.value) ? B("input", {
1502
1502
  class: "markweave-image-caption-input",
1503
1503
  "data-testid": "markweave-image-caption-input",
1504
1504
  "data-markweave-image-ui": "true",
@@ -1511,13 +1511,13 @@ var rr = J({
1511
1511
  onKeydown: (e) => {
1512
1512
  e.key === "Escape" && (e.preventDefault(), d.value = !1);
1513
1513
  }
1514
- }) : T.value ? V("figcaption", {
1514
+ }) : T.value ? B("figcaption", {
1515
1515
  class: "markweave-image-caption",
1516
1516
  "data-testid": "markweave-image-caption"
1517
1517
  }, T.value) : null
1518
1518
  ]);
1519
1519
  }
1520
- }), ir = J({
1520
+ }), or = J({
1521
1521
  name: "MarkweaveVueVideoNodeView",
1522
1522
  props: {
1523
1523
  editor: {
@@ -1550,7 +1550,7 @@ var rr = J({
1550
1550
  }
1551
1551
  },
1552
1552
  setup(e) {
1553
- let t = H(!1), n = H(""), r = H(null), a = H(!1), o = Zn(e.editor), s = W(() => c(o.value)), l = W(() => e.extension.options?.messages ?? p("zh")), u = W(() => l.value.video), d = W(() => e.node.attrs), f = W(() => O(d.value.src)), m = W(() => O(d.value.embedUrl)), h = W(() => O(d.value.provider)), g = W(() => m.value ? E(m.value, h.value) : null), _ = W(() => O(d.value.mimeType)), b = W(() => O(d.value.title)), x = () => {
1553
+ let t = V(!1), n = V(""), r = V(null), a = V(!1), o = $n(e.editor), s = U(() => c(o.value)), l = U(() => e.extension.options?.messages ?? p("zh")), u = U(() => l.value.video), d = U(() => e.node.attrs), f = U(() => O(d.value.src)), m = U(() => O(d.value.embedUrl)), h = U(() => O(d.value.provider)), g = U(() => m.value ? E(m.value, h.value) : null), _ = U(() => O(d.value.mimeType)), b = U(() => O(d.value.title)), x = () => {
1554
1554
  f.value || e.deleteNode(), n.value = "", r.value = null, t.value = !1;
1555
1555
  }, C = async (i) => {
1556
1556
  if (!s.value) return;
@@ -1585,13 +1585,13 @@ var rr = J({
1585
1585
  }, A = (t) => {
1586
1586
  s.value && e.selected && (t.key === "Backspace" || t.key === "Delete") && (t.preventDefault(), e.deleteNode());
1587
1587
  };
1588
- return () => s.value && !f.value ? V(i, {
1588
+ return () => s.value && !f.value ? B(i, {
1589
1589
  as: "figure",
1590
1590
  class: "markweave-video-node",
1591
1591
  "data-testid": "markweave-video-node",
1592
1592
  "data-empty": "true",
1593
1593
  "data-selected": "false"
1594
- }, () => nr({
1594
+ }, () => ir({
1595
1595
  messages: l.value,
1596
1596
  inputValue: n.value,
1597
1597
  error: r.value,
@@ -1606,7 +1606,7 @@ var rr = J({
1606
1606
  onDragActive: (e) => {
1607
1607
  t.value = e;
1608
1608
  }
1609
- })) : V(i, {
1609
+ })) : B(i, {
1610
1610
  as: "figure",
1611
1611
  class: "markweave-video-node",
1612
1612
  "data-testid": "markweave-video-node",
@@ -1618,9 +1618,9 @@ var rr = J({
1618
1618
  onFocus: k,
1619
1619
  onKeydown: A,
1620
1620
  onMousedown: (e) => {
1621
- s.value && !$n(e.target) && (e.preventDefault(), k());
1621
+ s.value && !tr(e.target) && (e.preventDefault(), k());
1622
1622
  }
1623
- }, () => [g.value ? V("div", { class: "markweave-video-embed" }, [V("iframe", {
1623
+ }, () => [g.value ? B("div", { class: "markweave-video-embed" }, [B("iframe", {
1624
1624
  class: "markweave-video-iframe",
1625
1625
  src: g.value,
1626
1626
  title: b.value ?? `${h.value ?? "Video"} embed`,
@@ -1629,32 +1629,32 @@ var rr = J({
1629
1629
  "data-markweave-video-src": f.value ?? void 0,
1630
1630
  allow: w,
1631
1631
  allowfullscreen: "true"
1632
- }), s.value ? V("button", {
1632
+ }), s.value ? B("button", {
1633
1633
  type: "button",
1634
1634
  class: "markweave-video-selection-layer",
1635
1635
  "data-testid": "markweave-video-selection-layer",
1636
1636
  tabindex: -1,
1637
1637
  "aria-label": u.value.selectAriaLabel
1638
- }) : null]) : f.value ? V("div", { class: "markweave-video-box" }, [V("video", {
1638
+ }) : null]) : f.value ? B("div", { class: "markweave-video-box" }, [B("video", {
1639
1639
  class: "markweave-video",
1640
1640
  src: f.value,
1641
1641
  title: b.value ?? void 0,
1642
1642
  controls: !0,
1643
1643
  "data-markweave-video": "true",
1644
1644
  "data-markweave-mime-type": _.value ?? void 0
1645
- }), s.value ? V("button", {
1645
+ }), s.value ? B("button", {
1646
1646
  type: "button",
1647
1647
  class: "markweave-video-selection-layer",
1648
1648
  "data-testid": "markweave-video-selection-layer",
1649
1649
  tabindex: -1,
1650
1650
  "aria-label": u.value.selectAriaLabel
1651
- }) : null]) : V("div", {
1651
+ }) : null]) : B("div", {
1652
1652
  class: "markweave-video-readonly-empty",
1653
1653
  "data-testid": "markweave-video-readonly-empty",
1654
1654
  "aria-hidden": "true"
1655
1655
  })]);
1656
1656
  }
1657
- }), ar = h.extend({
1657
+ }), sr = h.extend({
1658
1658
  addOptions() {
1659
1659
  return {
1660
1660
  ...this.parent?.(),
@@ -1663,9 +1663,9 @@ var rr = J({
1663
1663
  };
1664
1664
  },
1665
1665
  addNodeView() {
1666
- return typeof document > "u" ? null : a(rr, { stopEvent: ({ event: e }) => Qn(e.target) });
1666
+ return typeof document > "u" ? null : a(ar, { stopEvent: ({ event: e }) => er(e.target) });
1667
1667
  }
1668
- }), or = g.extend({
1668
+ }), cr = g.extend({
1669
1669
  addOptions() {
1670
1670
  return {
1671
1671
  ...this.parent?.(),
@@ -1674,17 +1674,17 @@ var rr = J({
1674
1674
  };
1675
1675
  },
1676
1676
  addNodeView() {
1677
- return typeof document > "u" ? null : a(ir, { stopEvent: ({ event: e }) => $n(e.target) });
1677
+ return typeof document > "u" ? null : a(or, { stopEvent: ({ event: e }) => tr(e.target) });
1678
1678
  }
1679
1679
  });
1680
1680
  //#endregion
1681
1681
  //#region src/create-editor-extensions.ts
1682
- function sr(n = {}) {
1682
+ function lr(n = {}) {
1683
1683
  return e({
1684
1684
  lang: n.lang,
1685
1685
  mediaExtensions: t({
1686
- image: ar,
1687
- video: or,
1686
+ image: sr,
1687
+ video: cr,
1688
1688
  lang: n.lang,
1689
1689
  onImageUpload: n.onImageUpload,
1690
1690
  onVideoUpload: n.onVideoUpload
@@ -1693,7 +1693,7 @@ function sr(n = {}) {
1693
1693
  }
1694
1694
  //#endregion
1695
1695
  //#region src/MarkweaveEditor.ts
1696
- var cr = {
1696
+ var ur = {
1697
1697
  active: !1,
1698
1698
  mode: "outside",
1699
1699
  activeCellPos: null,
@@ -1701,17 +1701,17 @@ var cr = {
1701
1701
  selectedCellCount: 0,
1702
1702
  selectionFrom: 0,
1703
1703
  selectionTo: 0
1704
- }, lr = {
1704
+ }, dr = {
1705
1705
  active: !1,
1706
- language: ve.defaultLanguage,
1706
+ language: xe.defaultLanguage,
1707
1707
  mermaidPreviewMode: "code",
1708
1708
  pos: null,
1709
1709
  text: ""
1710
1710
  };
1711
- function ur(e) {
1712
- return St.getState(e.state) ?? xt;
1711
+ function fr(e) {
1712
+ return Tt.getState(e.state) ?? wt;
1713
1713
  }
1714
- function dr(e) {
1714
+ function pr(e) {
1715
1715
  if (!e || typeof window > "u") return null;
1716
1716
  let t = e.parentElement;
1717
1717
  for (; t;) {
@@ -1722,133 +1722,133 @@ function dr(e) {
1722
1722
  return null;
1723
1723
  }
1724
1724
  function Z(e, t, n = 18, r = 1.8) {
1725
- return V(e, {
1725
+ return B(e, {
1726
1726
  size: n,
1727
1727
  strokeWidth: r,
1728
1728
  "aria-hidden": "true"
1729
1729
  }, { default: () => t });
1730
1730
  }
1731
- function fr(e) {
1732
- return e === "clipboard" ? [V("path", { d: "M9 4.5h6a1.5 1.5 0 0 1 1.5 1.5v11A1.5 1.5 0 0 1 15 18.5H7A1.5 1.5 0 0 1 5.5 17V6A1.5 1.5 0 0 1 7 4.5h2" }), V("path", { d: "M8.5 5.5v-1A1.5 1.5 0 0 1 10 3h2a1.5 1.5 0 0 1 1.5 1.5v1h-5Z" })] : e === "search" ? [V("circle", {
1731
+ function mr(e) {
1732
+ return e === "clipboard" ? [B("path", { d: "M9 4.5h6a1.5 1.5 0 0 1 1.5 1.5v11A1.5 1.5 0 0 1 15 18.5H7A1.5 1.5 0 0 1 5.5 17V6A1.5 1.5 0 0 1 7 4.5h2" }), B("path", { d: "M8.5 5.5v-1A1.5 1.5 0 0 1 10 3h2a1.5 1.5 0 0 1 1.5 1.5v1h-5Z" })] : e === "search" ? [B("circle", {
1733
1733
  cx: "10",
1734
1734
  cy: "10",
1735
1735
  r: "5.5"
1736
- }), V("path", { d: "m14 14 4 4" })] : e === "check" ? [V("path", { d: "m5 11 4 4 8-9" })] : e === "expand" ? [
1737
- V("path", { d: "M8 4H4v4" }),
1738
- V("path", { d: "M4 4l5 5" }),
1739
- V("path", { d: "M16 4h4v4" }),
1740
- V("path", { d: "m20 4-5 5" }),
1741
- V("path", { d: "M8 20H4v-4" }),
1742
- V("path", { d: "m4 20 5-5" }),
1743
- V("path", { d: "M16 20h4v-4" }),
1744
- V("path", { d: "m20 20-5-5" })
1736
+ }), B("path", { d: "m14 14 4 4" })] : e === "check" ? [B("path", { d: "m5 11 4 4 8-9" })] : e === "expand" ? [
1737
+ B("path", { d: "M8 4H4v4" }),
1738
+ B("path", { d: "M4 4l5 5" }),
1739
+ B("path", { d: "M16 4h4v4" }),
1740
+ B("path", { d: "m20 4-5 5" }),
1741
+ B("path", { d: "M8 20H4v-4" }),
1742
+ B("path", { d: "m4 20 5-5" }),
1743
+ B("path", { d: "M16 20h4v-4" }),
1744
+ B("path", { d: "m20 20-5-5" })
1745
1745
  ] : e === "download" ? [
1746
- V("path", { d: "M12 4v10" }),
1747
- V("path", { d: "m8 10 4 4 4-4" }),
1748
- V("path", { d: "M5 19h14" })
1749
- ] : e === "close" ? [V("path", { d: "M6 6l12 12" }), V("path", { d: "M18 6 6 18" })] : e === "zoomOut" ? [
1750
- V("circle", {
1746
+ B("path", { d: "M12 4v10" }),
1747
+ B("path", { d: "m8 10 4 4 4-4" }),
1748
+ B("path", { d: "M5 19h14" })
1749
+ ] : e === "close" ? [B("path", { d: "M6 6l12 12" }), B("path", { d: "M18 6 6 18" })] : e === "zoomOut" ? [
1750
+ B("circle", {
1751
1751
  cx: "10",
1752
1752
  cy: "10",
1753
1753
  r: "5.25"
1754
1754
  }),
1755
- V("path", { d: "M7.5 10h5" }),
1756
- V("path", { d: "m14 14 4 4" })
1755
+ B("path", { d: "M7.5 10h5" }),
1756
+ B("path", { d: "m14 14 4 4" })
1757
1757
  ] : e === "zoomIn" ? [
1758
- V("circle", {
1758
+ B("circle", {
1759
1759
  cx: "10",
1760
1760
  cy: "10",
1761
1761
  r: "5.25"
1762
1762
  }),
1763
- V("path", { d: "M7.5 10h5" }),
1764
- V("path", { d: "M10 7.5v5" }),
1765
- V("path", { d: "m14 14 4 4" })
1766
- ] : e === "reset" ? [V("path", { d: "M6.5 8.5A6 6 0 1 1 6 15" }), V("path", { d: "M6.5 8.5H3.5v-3" })] : [V("path", { d: "m6 9 6 6 6-6" })];
1763
+ B("path", { d: "M7.5 10h5" }),
1764
+ B("path", { d: "M10 7.5v5" }),
1765
+ B("path", { d: "m14 14 4 4" })
1766
+ ] : e === "reset" ? [B("path", { d: "M6.5 8.5A6 6 0 1 1 6 15" }), B("path", { d: "M6.5 8.5H3.5v-3" })] : [B("path", { d: "m6 9 6 6 6-6" })];
1767
1767
  }
1768
1768
  function Q(e) {
1769
- return V("svg", {
1769
+ return B("svg", {
1770
1770
  viewBox: "0 0 24 24",
1771
1771
  "aria-hidden": "true",
1772
1772
  focusable: "false"
1773
- }, V("g", {
1773
+ }, B("g", {
1774
1774
  fill: "none",
1775
1775
  stroke: "currentColor",
1776
1776
  "stroke-linecap": "round",
1777
1777
  "stroke-linejoin": "round",
1778
1778
  "stroke-width": "1.8"
1779
- }, fr(e)));
1779
+ }, mr(e)));
1780
1780
  }
1781
1781
  function $(e) {
1782
1782
  e.preventDefault();
1783
1783
  }
1784
- function pr(e) {
1785
- let t = We(e);
1784
+ function hr(e) {
1785
+ let t = qe(e);
1786
1786
  return !t || typeof window > "u" || typeof window.open != "function" ? !1 : (window.open(t, "_blank", "noopener,noreferrer"), !0);
1787
1787
  }
1788
- var mr = {
1789
- bold: cn,
1790
- italic: Dn,
1791
- underline: qn,
1792
- strike: Bn,
1793
- "inline-code": hn,
1794
- link: kn,
1795
- more: Pn,
1796
- superscript: Hn,
1797
- subscript: Vn,
1798
- "inline-math": Rn,
1799
- "align-left": an,
1800
- "align-center": nn,
1801
- "align-right": on,
1802
- "align-justify": rn,
1803
- "decrease-indent": wn,
1804
- "increase-indent": Tn
1805
- }, hr = {
1806
- type: Wn,
1807
- "heading-1": yn,
1808
- "heading-2": bn,
1809
- "heading-3": xn,
1810
- "bullet-list": An,
1811
- "ordered-list": Mn,
1812
- "task-list": jn,
1813
- blockquote: In,
1814
- "code-block": ln,
1815
- info: En,
1816
- tip: On,
1817
- warning: sn,
1818
- error: mn,
1819
- success: dn,
1820
- emoji: zn,
1821
- math: Rn,
1822
- table: Un,
1823
- separator: Nn,
1824
- image: Sn,
1825
- video: Yn,
1826
- attachment: Fn
1788
+ var gr = {
1789
+ bold: un,
1790
+ italic: kn,
1791
+ underline: Yn,
1792
+ strike: Hn,
1793
+ "inline-code": _n,
1794
+ link: jn,
1795
+ more: In,
1796
+ superscript: Wn,
1797
+ subscript: Un,
1798
+ "inline-math": Bn,
1799
+ "align-left": sn,
1800
+ "align-center": an,
1801
+ "align-right": cn,
1802
+ "align-justify": on,
1803
+ "decrease-indent": En,
1804
+ "increase-indent": Dn
1805
+ }, _r = {
1806
+ type: Kn,
1807
+ "heading-1": xn,
1808
+ "heading-2": Sn,
1809
+ "heading-3": Cn,
1810
+ "bullet-list": Mn,
1811
+ "ordered-list": Pn,
1812
+ "task-list": Nn,
1813
+ blockquote: Rn,
1814
+ "code-block": dn,
1815
+ info: On,
1816
+ tip: An,
1817
+ warning: ln,
1818
+ error: gn,
1819
+ success: pn,
1820
+ emoji: Vn,
1821
+ math: Bn,
1822
+ table: Gn,
1823
+ separator: Fn,
1824
+ image: wn,
1825
+ video: Zn,
1826
+ attachment: Ln
1827
1827
  };
1828
- function gr(e) {
1829
- let t = hr[e];
1830
- return V(t, {
1828
+ function vr(e) {
1829
+ let t = _r[e];
1830
+ return B(t, {
1831
1831
  size: 18,
1832
1832
  strokeWidth: 1.6,
1833
1833
  absoluteStrokeWidth: !0,
1834
1834
  "aria-hidden": "true"
1835
1835
  });
1836
1836
  }
1837
- var _r = {
1838
- paragraph: Kn,
1839
- "heading-1": yn,
1840
- "heading-2": bn,
1841
- "heading-3": xn,
1842
- "bullet-list": An,
1843
- "numbered-list": Mn,
1844
- "todo-list": jn,
1845
- quote: In,
1846
- "code-block": ln
1837
+ var yr = {
1838
+ paragraph: Jn,
1839
+ "heading-1": xn,
1840
+ "heading-2": Sn,
1841
+ "heading-3": Cn,
1842
+ "bullet-list": Mn,
1843
+ "numbered-list": Pn,
1844
+ "todo-list": Nn,
1845
+ quote: Rn,
1846
+ "code-block": dn
1847
1847
  };
1848
- function vr(e, t) {
1849
- return I(e, t).label;
1848
+ function br(e, t) {
1849
+ return ne(e, t).label;
1850
1850
  }
1851
- var yr = J({
1851
+ var xr = J({
1852
1852
  name: "MarkweaveVueFloatingToolbar",
1853
1853
  props: {
1854
1854
  editor: {
@@ -1865,19 +1865,19 @@ var yr = J({
1865
1865
  }
1866
1866
  },
1867
1867
  setup(e) {
1868
- let t = H(null), n = H(""), r = H(null), i = H(null), a = H(null), o = W(() => We(n.value.trim())), s = W(() => e.messages.floatingToolbar), c = W(() => re(e.messages).map((e) => [
1868
+ let t = V(null), n = V(""), r = V(null), i = V(null), a = V(null), o = U(() => qe(n.value.trim())), s = U(() => e.messages.floatingToolbar), c = U(() => ie(e.messages).map((e) => [
1869
1869
  e.id,
1870
1870
  e.label,
1871
- _r[e.id]
1872
- ])), l = W(() => ne(e.messages).map((e) => [
1871
+ yr[e.id]
1872
+ ])), l = U(() => re(e.messages).map((e) => [
1873
1873
  e.id,
1874
1874
  e.value,
1875
1875
  e.label
1876
- ])), u = W(() => L(e.messages).map((e) => [
1876
+ ])), u = U(() => I(e.messages).map((e) => [
1877
1877
  e.id,
1878
1878
  e.value,
1879
1879
  e.label
1880
- ])), d = W(() => R(e.messages).map((e) => e.id)), f = () => {
1880
+ ])), d = U(() => L(e.messages).map((e) => e.id)), f = () => {
1881
1881
  o.value && (e.editor.chain().focus().extendMarkRange("link").setLink({ href: o.value }).run(), t.value = null);
1882
1882
  }, p = () => {
1883
1883
  e.editor.isActive("link") && e.editor.chain().focus().extendMarkRange("link").unsetLink().run(), n.value = "", t.value = null;
@@ -1894,7 +1894,7 @@ var yr = J({
1894
1894
  let e = r.value;
1895
1895
  if (!e || t.value !== null) return null;
1896
1896
  let n = s.value.buttons[e];
1897
- return n ? V("div", {
1897
+ return n ? B("div", {
1898
1898
  class: "markweave-floating-toolbar-tooltip",
1899
1899
  role: "tooltip",
1900
1900
  "data-testid": "markweave-floating-toolbar-tooltip",
@@ -1902,7 +1902,7 @@ var yr = J({
1902
1902
  "data-active": h(e),
1903
1903
  style: i.value === null ? void 0 : { "--markweave-floating-toolbar-tooltip-left": `${i.value}px` }
1904
1904
  }, n) : null;
1905
- }, v = (n, i, a, o, s = !1, c) => V("button", {
1905
+ }, v = (n, i, a, o, s = !1, c) => B("button", {
1906
1906
  type: "button",
1907
1907
  class: `markweave-floating-toolbar-button markweave-floating-toolbar-button--${n}`,
1908
1908
  "aria-label": i,
@@ -1921,13 +1921,13 @@ var yr = J({
1921
1921
  onMouseenter: (e) => g(n, e.currentTarget),
1922
1922
  onMouseleave: () => g(null),
1923
1923
  onClick: o
1924
- }, n === "block-type" ? [V("span", { class: "markweave-floating-toolbar-button-inner" }, [V("span", { class: "markweave-floating-toolbar-block-label" }, vr(e.editor, e.messages)), Z(t.value === "block-type" ? pn : fn, i)])] : n === "color" ? [V("span", { class: "markweave-floating-toolbar-button-inner markweave-floating-toolbar-button-inner--color" }, [V("span", { class: "markweave-floating-toolbar-color-trigger" }, "A"), Z(t.value === "color" ? pn : fn, i)])] : [Z(a, i)]), y = () => V("span", {
1924
+ }, n === "block-type" ? [B("span", { class: "markweave-floating-toolbar-button-inner" }, [B("span", { class: "markweave-floating-toolbar-block-label" }, br(e.editor, e.messages)), Z(t.value === "block-type" ? hn : mn, i)])] : n === "color" ? [B("span", { class: "markweave-floating-toolbar-button-inner markweave-floating-toolbar-button-inner--color" }, [B("span", { class: "markweave-floating-toolbar-color-trigger" }, "A"), Z(t.value === "color" ? hn : mn, i)])] : [Z(a, i)]), y = () => B("span", {
1925
1925
  class: "markweave-floating-toolbar-divider",
1926
1926
  "aria-hidden": "true"
1927
- }), b = (n, r, i) => V("section", {
1927
+ }), b = (n, r, i) => B("section", {
1928
1928
  class: "markweave-floating-toolbar-color-section",
1929
1929
  "aria-label": n
1930
- }, [V("div", { class: "markweave-floating-toolbar-menu-title" }, n), V("div", { class: "markweave-floating-toolbar-swatch-grid" }, i.map(([n, i, a]) => V("button", {
1930
+ }, [B("div", { class: "markweave-floating-toolbar-menu-title" }, n), B("div", { class: "markweave-floating-toolbar-swatch-grid" }, i.map(([n, i, a]) => B("button", {
1931
1931
  key: `${r}-${n}`,
1932
1932
  type: "button",
1933
1933
  "aria-label": a,
@@ -1936,31 +1936,31 @@ var yr = J({
1936
1936
  onClick: () => {
1937
1937
  r === "text" ? i ? e.editor.chain().focus().setColor(i).run() : e.editor.chain().focus().unsetColor().run() : i ? e.editor.chain().focus().toggleHighlight({ color: i }).run() : e.editor.chain().focus().unsetHighlight().run(), t.value = null;
1938
1938
  }
1939
- }, r === "text" ? [V("span", {
1939
+ }, r === "text" ? [B("span", {
1940
1940
  class: "markweave-floating-toolbar-text-swatch",
1941
1941
  style: { color: i ?? "#646970" }
1942
- }, "A")] : [V("span", {
1942
+ }, "A")] : [B("span", {
1943
1943
  class: "markweave-floating-toolbar-highlight-swatch",
1944
1944
  style: { backgroundColor: i ?? "#ffffff" },
1945
1945
  "aria-hidden": "true"
1946
- })])))]), x = () => t.value === "block-type" ? V("div", {
1946
+ })])))]), x = () => t.value === "block-type" ? B("div", {
1947
1947
  class: "markweave-floating-toolbar-popover markweave-floating-toolbar-turn-menu",
1948
1948
  "data-testid": "markweave-floating-toolbar-turn-menu"
1949
- }, [V("div", { class: "markweave-floating-toolbar-menu-title" }, s.value.turnIntoTitle), ...c.value.map(([n, r, i]) => V("button", {
1949
+ }, [B("div", { class: "markweave-floating-toolbar-menu-title" }, s.value.turnIntoTitle), ...c.value.map(([n, r, i]) => B("button", {
1950
1950
  key: n,
1951
1951
  type: "button",
1952
1952
  "data-testid": `markweave-floating-toolbar-turn-${n}`,
1953
1953
  onMousedown: $,
1954
1954
  onClick: () => {
1955
- ie(e.editor, n), t.value = null;
1955
+ ae(e.editor, n), t.value = null;
1956
1956
  }
1957
- }, [V("span", { class: "markweave-floating-toolbar-menu-icon" }, [Z(i, r)]), V("span", null, r)]))]) : t.value === "link" ? V("form", {
1957
+ }, [B("span", { class: "markweave-floating-toolbar-menu-icon" }, [Z(i, r)]), B("span", null, r)]))]) : t.value === "link" ? B("form", {
1958
1958
  class: "markweave-floating-toolbar-popover markweave-floating-toolbar-link-popover",
1959
1959
  "data-testid": "markweave-floating-toolbar-link-popover",
1960
1960
  onSubmit: (e) => {
1961
1961
  e.preventDefault(), f();
1962
1962
  }
1963
- }, [V("input", {
1963
+ }, [B("input", {
1964
1964
  value: n.value,
1965
1965
  placeholder: s.value.linkPlaceholder,
1966
1966
  "aria-label": s.value.linkUrlLabel,
@@ -1968,43 +1968,43 @@ var yr = J({
1968
1968
  onInput: (e) => {
1969
1969
  n.value = e.target.value;
1970
1970
  }
1971
- }), V("span", { class: "markweave-floating-toolbar-link-actions" }, [
1972
- V("button", {
1971
+ }), B("span", { class: "markweave-floating-toolbar-link-actions" }, [
1972
+ B("button", {
1973
1973
  type: "submit",
1974
1974
  disabled: !o.value,
1975
1975
  "aria-label": s.value.applyLink,
1976
1976
  "data-testid": "markweave-floating-toolbar-link-apply",
1977
1977
  onMousedown: $
1978
- }, [Z(gn, s.value.applyLink)]),
1979
- V("span", {
1978
+ }, [Z(vn, s.value.applyLink)]),
1979
+ B("span", {
1980
1980
  class: "markweave-floating-toolbar-link-divider",
1981
1981
  "aria-hidden": "true"
1982
1982
  }),
1983
- V("button", {
1983
+ B("button", {
1984
1984
  type: "button",
1985
1985
  disabled: !o.value,
1986
1986
  "aria-label": s.value.openLink,
1987
1987
  "data-testid": "markweave-floating-toolbar-link-open",
1988
1988
  onMousedown: $,
1989
- onClick: () => pr(n.value)
1990
- }, [Z(vn, s.value.openLink)]),
1991
- V("button", {
1989
+ onClick: () => hr(n.value)
1990
+ }, [Z(bn, s.value.openLink)]),
1991
+ B("button", {
1992
1992
  type: "button",
1993
1993
  "aria-label": s.value.removeLink,
1994
1994
  "data-testid": "markweave-floating-toolbar-link-remove",
1995
1995
  onMousedown: $,
1996
1996
  onClick: p
1997
- }, [Z(Gn, s.value.removeLink)])
1998
- ])]) : t.value === "color" ? V("div", {
1997
+ }, [Z(qn, s.value.removeLink)])
1998
+ ])]) : t.value === "color" ? B("div", {
1999
1999
  class: "markweave-floating-toolbar-popover markweave-floating-toolbar-color-popover",
2000
2000
  "data-testid": "markweave-floating-toolbar-color-menu"
2001
- }, [b(s.value.textColorTitle, "text", l.value), b(s.value.highlightColorTitle, "highlight", u.value)]) : t.value === "more" ? V("div", {
2001
+ }, [b(s.value.textColorTitle, "text", l.value), b(s.value.highlightColorTitle, "highlight", u.value)]) : t.value === "more" ? B("div", {
2002
2002
  class: "markweave-floating-toolbar-popover markweave-floating-toolbar-more-menu",
2003
2003
  "data-testid": "markweave-floating-toolbar-more-menu"
2004
- }, d.value.map((n) => V("span", {
2004
+ }, d.value.map((n) => B("span", {
2005
2005
  key: n,
2006
2006
  class: "markweave-floating-toolbar-more-item"
2007
- }, [V("button", {
2007
+ }, [B("button", {
2008
2008
  type: "button",
2009
2009
  "aria-label": s.value.moreActions[n],
2010
2010
  "data-testid": `markweave-floating-toolbar-more-${n}`,
@@ -2017,41 +2017,41 @@ var yr = J({
2017
2017
  r.value = null;
2018
2018
  },
2019
2019
  onClick: () => {
2020
- z(e.editor, n), t.value = null;
2020
+ R(e.editor, n), t.value = null;
2021
2021
  }
2022
- }, [Z(mr[n], s.value.moreActions[n])]), r.value === n ? V("div", {
2022
+ }, [Z(gr[n], s.value.moreActions[n])]), r.value === n ? B("div", {
2023
2023
  class: "markweave-floating-toolbar-tooltip markweave-floating-toolbar-tooltip--more",
2024
2024
  role: "tooltip"
2025
2025
  }, s.value.moreActions[n]) : null]))) : null;
2026
- return () => V(M, {
2026
+ return () => B(M, {
2027
2027
  editor: e.editor,
2028
- shouldShow: ({ editor: e }) => e.isEditable && se(B(e)),
2028
+ shouldShow: ({ editor: e }) => e.isEditable && ce(z(e)),
2029
2029
  options: { placement: "top" }
2030
- }, { default: () => V("div", {
2030
+ }, { default: () => B("div", {
2031
2031
  class: "markweave-floating-toolbar markweave-floating-toolbar--default markweave-floating-toolbar--motion-entered",
2032
2032
  "data-testid": "markweave-floating-toolbar"
2033
- }, [V("div", {
2033
+ }, [B("div", {
2034
2034
  ref: a,
2035
2035
  class: "markweave-floating-toolbar-content",
2036
2036
  "data-menu": t.value ?? "none"
2037
2037
  }, [
2038
- v("block-type", s.value.buttons["block-type"], Kn, () => m("block-type"), t.value === "block-type"),
2038
+ v("block-type", s.value.buttons["block-type"], Jn, () => m("block-type"), t.value === "block-type"),
2039
2039
  y(),
2040
- v("bold", s.value.buttons.bold, cn, () => e.editor.chain().focus().toggleBold().run(), e.editor.isActive("bold")),
2041
- v("italic", s.value.buttons.italic, Dn, () => e.editor.chain().focus().toggleItalic().run(), e.editor.isActive("italic")),
2042
- v("underline", s.value.buttons.underline, qn, () => e.editor.chain().focus().toggleUnderline().run(), e.editor.isActive("underline")),
2043
- v("strike", s.value.buttons.strike, Bn, () => e.editor.chain().focus().toggleStrike().run(), e.editor.isActive("strike")),
2044
- v("inline-code", s.value.buttons["inline-code"], hn, () => e.editor.chain().focus().toggleCode().run(), e.editor.isActive("code")),
2040
+ v("bold", s.value.buttons.bold, un, () => e.editor.chain().focus().toggleBold().run(), e.editor.isActive("bold")),
2041
+ v("italic", s.value.buttons.italic, kn, () => e.editor.chain().focus().toggleItalic().run(), e.editor.isActive("italic")),
2042
+ v("underline", s.value.buttons.underline, Yn, () => e.editor.chain().focus().toggleUnderline().run(), e.editor.isActive("underline")),
2043
+ v("strike", s.value.buttons.strike, Hn, () => e.editor.chain().focus().toggleStrike().run(), e.editor.isActive("strike")),
2044
+ v("inline-code", s.value.buttons["inline-code"], _n, () => e.editor.chain().focus().toggleCode().run(), e.editor.isActive("code")),
2045
2045
  y(),
2046
- v("link", s.value.buttons.link, kn, () => m("link"), e.editor.isActive("link")),
2047
- v("color", s.value.buttons.color, Kn, () => m("color"), t.value === "color"),
2046
+ v("link", s.value.buttons.link, jn, () => m("link"), e.editor.isActive("link")),
2047
+ v("color", s.value.buttons.color, Jn, () => m("color"), t.value === "color"),
2048
2048
  y(),
2049
- v("more", s.value.buttons.more, Pn, () => m("more"), t.value === "more"),
2049
+ v("more", s.value.buttons.more, In, () => m("more"), t.value === "more"),
2050
2050
  x(),
2051
2051
  _()
2052
2052
  ])]) });
2053
2053
  }
2054
- }), br = J({
2054
+ }), Sr = J({
2055
2055
  name: "MarkweaveVueMathEditorPopover",
2056
2056
  props: {
2057
2057
  editor: {
@@ -2072,17 +2072,17 @@ var yr = J({
2072
2072
  }
2073
2073
  },
2074
2074
  setup(e) {
2075
- let t = H(e.target.latex), n = U(null), r = H(null), i = H(null), a = U(Ye(e.editor, e.target)), o = W(() => t.value === e.target.latex && a.value ? {
2075
+ let t = V(e.target.latex), n = H(null), r = V(null), i = V(null), a = H(Qe(e.editor, e.target)), o = U(() => t.value === e.target.latex && a.value ? {
2076
2076
  html: a.value,
2077
2077
  error: !1
2078
- } : $e(t.value, e.target.kind, e.editor)), s = W(() => t.value.trim().length > 0), c = W(() => e.messages.math), l = W(() => Je(e.editor, e.target) ?? 1), u = () => {
2078
+ } : nt(t.value, e.target.kind, e.editor)), s = U(() => t.value.trim().length > 0), c = U(() => e.messages.math), l = U(() => Ze(e.editor, e.target) ?? 1), u = () => {
2079
2079
  if (typeof window > "u") return;
2080
- let r = qe(e.editor, e.target), i = e.editor.view.dom.closest(".markweave-editor-frame")?.getBoundingClientRect();
2080
+ let r = Xe(e.editor, e.target), i = e.editor.view.dom.closest(".markweave-editor-frame")?.getBoundingClientRect();
2081
2081
  if (!r || !i) {
2082
2082
  e.onClose();
2083
2083
  return;
2084
2084
  }
2085
- n.value = Ke({
2085
+ n.value = Ye({
2086
2086
  anchorRect: r,
2087
2087
  frameRect: i,
2088
2088
  kind: e.target.kind,
@@ -2091,7 +2091,7 @@ var yr = J({
2091
2091
  viewportWidth: window.innerWidth
2092
2092
  });
2093
2093
  }, d = () => {
2094
- s.value && Ge(e.editor, e.target, t.value) && e.onClose();
2094
+ s.value && Je(e.editor, e.target, t.value) && e.onClose();
2095
2095
  }, f = (t) => {
2096
2096
  if (t.key === "Escape") {
2097
2097
  t.preventDefault(), e.onClose(), e.editor.commands.focus();
@@ -2102,14 +2102,14 @@ var yr = J({
2102
2102
  let n = t.target;
2103
2103
  n instanceof Node && (r.value?.contains(n) || n instanceof Element && n.closest(".tiptap-mathematics-render") || e.onClose());
2104
2104
  };
2105
- return G(() => [e.target.pos, e.target.latex], () => {
2106
- t.value = e.target.latex, a.value = Ye(e.editor, e.target), q(u);
2107
- }), $t(() => {
2108
- et(e.editor, e.target, !0), u(), q(() => {
2105
+ return W(() => [e.target.pos, e.target.latex], () => {
2106
+ t.value = e.target.latex, a.value = Qe(e.editor, e.target), q(u);
2107
+ }), G(() => {
2108
+ rt(e.editor, e.target, !0), u(), q(() => {
2109
2109
  i.value?.focus({ preventScroll: !0 }), i.value?.select(), u();
2110
2110
  }), window.addEventListener("resize", u), window.addEventListener("scroll", u, !0), document.addEventListener("mousedown", p);
2111
2111
  }), K(() => {
2112
- et(e.editor, e.target, !1), window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0), document.removeEventListener("mousedown", p);
2112
+ rt(e.editor, e.target, !1), window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0), document.removeEventListener("mousedown", p);
2113
2113
  }), () => {
2114
2114
  let a = e.target.kind === "block" ? c.value.blockTitle : c.value.inlineTitle, u = {
2115
2115
  ref: i,
@@ -2122,7 +2122,7 @@ var yr = J({
2122
2122
  },
2123
2123
  onKeydown: f
2124
2124
  };
2125
- return e.target.kind === "inline" ? V("form", {
2125
+ return e.target.kind === "inline" ? B("form", {
2126
2126
  ref: r,
2127
2127
  class: "markweave-math-editor-popover markweave-math-editor-popover--inline",
2128
2128
  "aria-label": a,
@@ -2137,22 +2137,22 @@ var yr = J({
2137
2137
  onSubmit: (e) => {
2138
2138
  e.preventDefault(), d();
2139
2139
  }
2140
- }, [V("label", {
2140
+ }, [B("label", {
2141
2141
  class: "markweave-math-inline-source",
2142
2142
  "data-testid": "markweave-math-inline-source"
2143
2143
  }, [
2144
- V("span", { attrs: { "aria-hidden": "true" } }, "$"),
2145
- V("input", {
2144
+ B("span", { attrs: { "aria-hidden": "true" } }, "$"),
2145
+ B("input", {
2146
2146
  ...u,
2147
2147
  "aria-label": c.value.latexLabel,
2148
2148
  size: Math.max(t.value.length, 1)
2149
2149
  }),
2150
- V("span", { attrs: { "aria-hidden": "true" } }, "$")
2151
- ]), V("div", {
2150
+ B("span", { attrs: { "aria-hidden": "true" } }, "$")
2151
+ ]), B("div", {
2152
2152
  class: "markweave-math-inline-preview",
2153
2153
  "data-error": o.value.error ? "true" : "false",
2154
2154
  "data-testid": "markweave-math-editor-preview"
2155
- }, [V("div", { innerHTML: o.value.html || " " }), o.value.error ? V("small", null, c.value.invalidPreview) : null])]) : V("form", {
2155
+ }, [B("div", { innerHTML: o.value.html || " " }), o.value.error ? B("small", null, c.value.invalidPreview) : null])]) : B("form", {
2156
2156
  ref: r,
2157
2157
  class: "markweave-math-editor-popover markweave-math-editor-popover--block",
2158
2158
  "aria-label": a,
@@ -2168,39 +2168,39 @@ var yr = J({
2168
2168
  e.preventDefault(), d();
2169
2169
  }
2170
2170
  }, [
2171
- V("div", { class: "markweave-math-block-toolbar" }, [
2172
- V("span", null, c.value.label),
2173
- Z(hn, c.value.label, 15, 1.75),
2174
- V("button", {
2171
+ B("div", { class: "markweave-math-block-toolbar" }, [
2172
+ B("span", null, c.value.label),
2173
+ Z(_n, c.value.label, 15, 1.75),
2174
+ B("button", {
2175
2175
  type: "submit",
2176
2176
  title: c.value.apply,
2177
2177
  "aria-label": c.value.apply,
2178
2178
  disabled: !s.value,
2179
2179
  "data-testid": "markweave-math-editor-apply"
2180
- }, [Z(dn, c.value.apply, 16, 2)])
2180
+ }, [Z(pn, c.value.apply, 16, 2)])
2181
2181
  ]),
2182
- V("label", {
2182
+ B("label", {
2183
2183
  class: "markweave-math-block-source",
2184
2184
  "data-testid": "markweave-math-block-source"
2185
2185
  }, [
2186
- V("span", { attrs: { "aria-hidden": "true" } }, "$$"),
2187
- V("textarea", {
2186
+ B("span", { attrs: { "aria-hidden": "true" } }, "$$"),
2187
+ B("textarea", {
2188
2188
  ...u,
2189
2189
  "aria-label": c.value.latexLabel,
2190
2190
  rows: 3
2191
2191
  }),
2192
- V("span", { attrs: { "aria-hidden": "true" } }, "$$")
2192
+ B("span", { attrs: { "aria-hidden": "true" } }, "$$")
2193
2193
  ]),
2194
- V("div", {
2194
+ B("div", {
2195
2195
  class: "markweave-math-block-preview",
2196
2196
  "data-error": o.value.error ? "true" : "false",
2197
2197
  "data-math-number": String(l.value),
2198
2198
  "data-testid": "markweave-math-editor-preview"
2199
- }, [V("div", { innerHTML: o.value.html || " " }), o.value.error ? V("small", null, c.value.invalidPreview) : null])
2199
+ }, [B("div", { innerHTML: o.value.html || " " }), o.value.error ? B("small", null, c.value.invalidPreview) : null])
2200
2200
  ]);
2201
2201
  };
2202
2202
  }
2203
- }), xr = J({
2203
+ }), Cr = J({
2204
2204
  name: "MarkweaveVueSlashCommandMenu",
2205
2205
  props: {
2206
2206
  commands: {
@@ -2237,7 +2237,7 @@ var yr = J({
2237
2237
  }
2238
2238
  },
2239
2239
  setup(e) {
2240
- let t = H(""), n = H(null), r = H(null), i = H(!1), a = H(""), o = H(0), s = W(() => {
2240
+ let t = V(""), n = V(null), r = V(null), i = V(!1), a = V(""), o = V(0), s = U(() => {
2241
2241
  let t = a.value.trim().toLowerCase();
2242
2242
  return (t ? e.messages.slash.emojiItems.filter((e) => [
2243
2243
  e.emoji,
@@ -2292,32 +2292,32 @@ var yr = J({
2292
2292
  group: t,
2293
2293
  commands: e.commands.filter((e) => e.group === t)
2294
2294
  })).filter((e) => e.commands.length);
2295
- return V("div", {
2295
+ return B("div", {
2296
2296
  class: "markweave-slash-layer",
2297
2297
  style: { display: "contents" },
2298
2298
  "data-testid": "markweave-slash-layer"
2299
- }, [V("div", {
2299
+ }, [B("div", {
2300
2300
  class: "markweave-slash-trigger",
2301
2301
  style: d,
2302
2302
  "aria-hidden": "true",
2303
2303
  "data-testid": "markweave-slash-trigger"
2304
- }, [V("span", null, "/"), V("em", null, e.state.query || e.messages.slash.filterPlaceholder)]), V("div", {
2304
+ }, [B("span", null, "/"), B("em", null, e.state.query || e.messages.slash.filterPlaceholder)]), B("div", {
2305
2305
  class: "markweave-slash-menu",
2306
2306
  style: u,
2307
2307
  role: "listbox",
2308
2308
  "aria-label": e.messages.slash.ariaLabel,
2309
2309
  "data-placement": e.position.placement,
2310
2310
  "data-testid": "markweave-slash-menu"
2311
- }, [e.inputCommand?.inputKind === "emoji" ? V("div", {
2311
+ }, [e.inputCommand?.inputKind === "emoji" ? B("div", {
2312
2312
  class: "markweave-slash-subpanel",
2313
2313
  "data-testid": "markweave-slash-emoji-picker"
2314
2314
  }, [
2315
- V("div", { class: "markweave-slash-subpanel-header" }, [V("button", {
2315
+ B("div", { class: "markweave-slash-subpanel-header" }, [B("button", {
2316
2316
  type: "button",
2317
2317
  onMousedown: $,
2318
2318
  onClick: () => e.onInputCommandChange(null)
2319
- }, e.messages.common.back), V("span", null, e.messages.slash.emojiTitle)]),
2320
- V("label", { class: "markweave-slash-input" }, [V("span", null, "/"), V("input", {
2319
+ }, e.messages.common.back), B("span", null, e.messages.slash.emojiTitle)]),
2320
+ B("label", { class: "markweave-slash-input" }, [B("span", null, "/"), B("input", {
2321
2321
  autofocus: !0,
2322
2322
  value: a.value,
2323
2323
  placeholder: e.messages.slash.emojiSearchPlaceholder,
@@ -2328,11 +2328,11 @@ var yr = J({
2328
2328
  t.key === "Escape" ? (t.preventDefault(), e.onInputCommandChange(null)) : t.key === "ArrowDown" ? (t.preventDefault(), o.value = s.value.length ? (o.value + 1) % s.value.length : 0) : t.key === "ArrowUp" ? (t.preventDefault(), o.value = s.value.length ? (o.value - 1 + s.value.length) % s.value.length : 0) : (t.key === "Enter" || t.key === "Tab") && (t.preventDefault(), l(o.value));
2329
2329
  }
2330
2330
  })]),
2331
- V("div", {
2331
+ B("div", {
2332
2332
  class: "markweave-slash-emoji-grid",
2333
2333
  role: "listbox",
2334
2334
  "aria-label": e.messages.slash.emojiTitle
2335
- }, s.value.map((e, t) => V("button", {
2335
+ }, s.value.map((e, t) => B("button", {
2336
2336
  key: `${e.emoji}-${e.label}`,
2337
2337
  type: "button",
2338
2338
  role: "option",
@@ -2341,17 +2341,17 @@ var yr = J({
2341
2341
  onMouseenter: () => o.value = t,
2342
2342
  onMousedown: $,
2343
2343
  onClick: () => l(t)
2344
- }, [V("span", null, e.emoji), V("small", null, e.label)])))
2345
- ]) : e.inputCommand?.inputKind === "upload" ? V("div", {
2344
+ }, [B("span", null, e.emoji), B("small", null, e.label)])))
2345
+ ]) : e.inputCommand?.inputKind === "upload" ? B("div", {
2346
2346
  class: "markweave-slash-subpanel",
2347
2347
  "data-testid": "markweave-slash-upload-panel"
2348
2348
  }, [
2349
- V("div", { class: "markweave-slash-upload-header" }, [V("button", {
2349
+ B("div", { class: "markweave-slash-upload-header" }, [B("button", {
2350
2350
  type: "button",
2351
2351
  onMousedown: $,
2352
2352
  onClick: () => e.onInputCommandChange(null)
2353
- }, e.messages.common.back), V("strong", null, e.inputCommand ? e.messages.slash.uploadKindLabels[e.inputCommand.uploadKind ?? "upload"] : e.messages.slash.uploadKindLabels.upload)]),
2354
- V("label", { class: "markweave-slash-upload-field" }, [V("span", null, e.messages.slash.uploadValueLabel), V("input", {
2353
+ }, e.messages.common.back), B("strong", null, e.inputCommand ? e.messages.slash.uploadKindLabels[e.inputCommand.uploadKind ?? "upload"] : e.messages.slash.uploadKindLabels.upload)]),
2354
+ B("label", { class: "markweave-slash-upload-field" }, [B("span", null, e.messages.slash.uploadValueLabel), B("input", {
2355
2355
  autofocus: !0,
2356
2356
  value: t.value,
2357
2357
  placeholder: e.messages.slash.uploadValuePlaceholder,
@@ -2362,32 +2362,32 @@ var yr = J({
2362
2362
  e.key === "Enter" && (e.preventDefault(), c());
2363
2363
  }
2364
2364
  })]),
2365
- V("label", { class: "markweave-slash-upload-field" }, [V("span", null, e.messages.common.file), V("input", {
2365
+ B("label", { class: "markweave-slash-upload-field" }, [B("span", null, e.messages.common.file), B("input", {
2366
2366
  type: "file",
2367
2367
  onChange: (e) => n.value = e.target.files?.[0] ?? null
2368
2368
  })]),
2369
- r.value ? V("div", {
2369
+ r.value ? B("div", {
2370
2370
  class: "markweave-slash-upload-error",
2371
2371
  role: "alert"
2372
2372
  }, r.value) : null,
2373
- V("div", { class: "markweave-slash-upload-actions" }, [V("button", {
2373
+ B("div", { class: "markweave-slash-upload-actions" }, [B("button", {
2374
2374
  type: "button",
2375
2375
  onMousedown: $,
2376
2376
  onClick: () => e.onInputCommandChange(null)
2377
- }, e.messages.common.cancel), V("button", {
2377
+ }, e.messages.common.cancel), B("button", {
2378
2378
  type: "button",
2379
2379
  "data-primary": "true",
2380
2380
  disabled: i.value,
2381
2381
  onMousedown: $,
2382
2382
  onClick: c
2383
2383
  }, e.messages.common.insert)])
2384
- ]) : e.commands.length ? V("div", { class: "markweave-slash-command-list" }, f.map((t) => V("section", {
2384
+ ]) : e.commands.length ? B("div", { class: "markweave-slash-command-list" }, f.map((t) => B("section", {
2385
2385
  key: t.group,
2386
2386
  class: "markweave-slash-group",
2387
2387
  "aria-label": t.group
2388
- }, [V("div", { class: "markweave-slash-group-title" }, t.group), ...t.commands.map((t) => {
2389
- let n = e.commands.indexOf(t) === e.state.activeIndex, r = ct(t);
2390
- return V("button", {
2388
+ }, [B("div", { class: "markweave-slash-group-title" }, t.group), ...t.commands.map((t) => {
2389
+ let n = e.commands.indexOf(t) === e.state.activeIndex, r = dt(t);
2390
+ return B("button", {
2391
2391
  key: t.id,
2392
2392
  type: "button",
2393
2393
  role: "option",
@@ -2409,18 +2409,18 @@ var yr = J({
2409
2409
  }
2410
2410
  }
2411
2411
  }, [
2412
- gr(t.icon),
2413
- V("span", null, t.label),
2414
- t.disabledReason ? V("small", null, t.disabledReason) : null
2412
+ vr(t.icon),
2413
+ B("span", null, t.label),
2414
+ t.disabledReason ? B("small", null, t.disabledReason) : null
2415
2415
  ]);
2416
- })]))) : V("div", {
2416
+ })]))) : B("div", {
2417
2417
  class: "markweave-slash-menu__empty",
2418
2418
  role: "option",
2419
2419
  "aria-disabled": "true"
2420
2420
  }, e.messages.slash.noResults)])]);
2421
2421
  };
2422
2422
  }
2423
- }), Sr = J({
2423
+ }), wr = J({
2424
2424
  name: "MarkweaveVueTableControls",
2425
2425
  props: {
2426
2426
  editor: {
@@ -2453,12 +2453,12 @@ var yr = J({
2453
2453
  }
2454
2454
  },
2455
2455
  setup(e) {
2456
- let t = H(null), n = H("row-edge"), r = H(null), i = H(null), a = H(null), o = H(null), s = H(null), c = H(null), l = H(null), u = H(null), d = H(null), f = H(null), p = null, m = W(() => e.active ? yt(e.editor.state) : cr), h = W(() => jt(e.editor, e.interactionState, "row", m.value.activeCellPos)), g = W(() => jt(e.editor, e.interactionState, "column", m.value.activeCellPos)), _ = W(() => kt(e.editor)), v = W(() => _.value.length > 0), y = W(() => t.value ? Ft(e.editor, t.value) : []), b = () => {
2456
+ let t = V(null), n = V("row-edge"), r = V(null), i = V(null), a = V(null), o = V(null), s = V(null), c = V(null), l = V(null), u = V(null), d = V(null), f = V(null), p = null, m = U(() => e.active ? St(e.editor.state) : ur), h = U(() => Pt(e.editor, e.interactionState, "row", m.value.activeCellPos)), g = U(() => Pt(e.editor, e.interactionState, "column", m.value.activeCellPos)), _ = U(() => Mt(e.editor)), v = U(() => _.value.length > 0), y = U(() => t.value ? Rt(e.editor, t.value) : []), b = () => {
2457
2457
  p === null || typeof window > "u" || (window.clearTimeout(p), p = null);
2458
2458
  }, x = (e) => {
2459
2459
  b(), s.value = e, !(!e || typeof window > "u") && (p = window.setTimeout(() => {
2460
2460
  s.value = null, p = null;
2461
- }, zt));
2461
+ }, Ht));
2462
2462
  }, S = () => {
2463
2463
  if (!e.active) {
2464
2464
  r.value = null, i.value = null, a.value = null, x(null);
@@ -2469,16 +2469,16 @@ var yr = J({
2469
2469
  r.value = null, i.value = null, a.value = null;
2470
2470
  return;
2471
2471
  }
2472
- let s = o.getBoundingClientRect(), c = h.value ? At(e.editor, h.value) : null, l = g.value ? At(e.editor, g.value) : null, u = v.value ? It(e.editor) : null;
2473
- c ? r.value = wt({
2472
+ let s = o.getBoundingClientRect(), c = h.value ? Nt(e.editor, h.value) : null, l = g.value ? Nt(e.editor, g.value) : null, u = v.value ? zt(e.editor) : null;
2473
+ c ? r.value = Dt({
2474
2474
  targetRect: c,
2475
2475
  frameRect: s,
2476
2476
  kind: "row"
2477
- }) : t.value === "row" && n.value === "row-edge" || (r.value = null), l ? i.value = wt({
2477
+ }) : t.value === "row" && n.value === "row-edge" || (r.value = null), l ? i.value = Dt({
2478
2478
  targetRect: l,
2479
2479
  frameRect: s,
2480
2480
  kind: "column"
2481
- }) : t.value === "column" && n.value === "column-edge" || (i.value = null), u ? a.value = wt({
2481
+ }) : t.value === "column" && n.value === "column-edge" || (i.value = null), u ? a.value = Dt({
2482
2482
  targetRect: u,
2483
2483
  frameRect: s,
2484
2484
  kind: "selection"
@@ -2493,13 +2493,13 @@ var yr = J({
2493
2493
  o.value = null;
2494
2494
  return;
2495
2495
  }
2496
- let a = i.getBoundingClientRect(), s = t.value === "row" ? Ot(e.editor)?.getBoundingClientRect() : null, c = s ? {
2496
+ let a = i.getBoundingClientRect(), s = t.value === "row" ? jt(e.editor)?.getBoundingClientRect() : null, c = s ? {
2497
2497
  left: a.left,
2498
2498
  top: s.top,
2499
2499
  width: a.width,
2500
2500
  height: a.height
2501
2501
  } : a, p = r.getBoundingClientRect(), m = f.value.getBoundingClientRect();
2502
- o.value = Ct({
2502
+ o.value = Et({
2503
2503
  anchorRect: c,
2504
2504
  frameRect: p,
2505
2505
  menuSize: {
@@ -2516,16 +2516,16 @@ var yr = J({
2516
2516
  let i = t.value === e && n.value === r;
2517
2517
  n.value = r, t.value = i ? null : e, T();
2518
2518
  }, D = () => {
2519
- e.editor.view.dispatch(gt(e.editor.state.tr, null));
2519
+ e.editor.view.dispatch(yt(e.editor.state.tr, null));
2520
2520
  }, O = (t, n) => {
2521
2521
  let r = e.interactionState.hoverCellPos ?? m.value.activeCellPos, i = e.interactionState.hoverCellPos === null ? null : t === "row" ? e.interactionState.hoverVisualRowIndex : e.interactionState.hoverVisualColumnIndex;
2522
- r !== null && Rt(e.editor, r, t, { visualIndex: i }), E(t, n);
2522
+ r !== null && Vt(e.editor, r, t, { visualIndex: i }), E(t, n);
2523
2523
  }, k = () => {
2524
2524
  D(), E("selection", "selection-edge");
2525
2525
  }, A = (n = !1) => {
2526
2526
  t.value = null, o.value = null, n && e.editor.view.focus();
2527
2527
  }, j = async (n, r) => {
2528
- let i = await Et({
2528
+ let i = await kt({
2529
2529
  editor: e.editor,
2530
2530
  commandId: n,
2531
2531
  menu: r ?? t.value ?? "selection",
@@ -2533,18 +2533,18 @@ var yr = J({
2533
2533
  });
2534
2534
  return i.copyFeedback ? (x(i.copyFeedback), i.copyPayload && e.onCopyPayload?.(i.copyPayload)) : x(null), e.onCommandResult?.(i.commandResult), i.success;
2535
2535
  }, M = (t) => {
2536
- let n = Mt(e.editor, t);
2536
+ let n = Ft(e.editor, t);
2537
2537
  n && e.onEditWithAi?.(n), A(!0);
2538
2538
  }, N = (e) => {
2539
2539
  !t.value || e.key !== "Escape" || A(!0);
2540
2540
  }, ee = (e) => {
2541
2541
  t.value && (e.target instanceof Node && c.value?.contains(e.target) || A());
2542
2542
  };
2543
- $t(() => {
2543
+ G(() => {
2544
2544
  w(), window.addEventListener("resize", w), window.addEventListener("scroll", w, !0), document.addEventListener("keydown", N), document.addEventListener("mousedown", ee);
2545
2545
  }), K(() => {
2546
2546
  b(), window.removeEventListener("resize", w), window.removeEventListener("scroll", w, !0), document.removeEventListener("keydown", N), document.removeEventListener("mousedown", ee);
2547
- }), G(() => [
2547
+ }), W(() => [
2548
2548
  e.active,
2549
2549
  m.value.activeCellPos,
2550
2550
  m.value.selectionFrom,
@@ -2555,11 +2555,11 @@ var yr = J({
2555
2555
  t.value,
2556
2556
  n.value
2557
2557
  ], T, { flush: "post" });
2558
- let P = () => t.value ? V("div", {
2558
+ let P = () => t.value ? B("div", {
2559
2559
  ref: f,
2560
2560
  class: "markweave-table-menu",
2561
2561
  role: "menu",
2562
- "aria-label": Bt(t.value, e.messages),
2562
+ "aria-label": Ut(t.value, e.messages),
2563
2563
  "data-testid": "markweave-table-menu",
2564
2564
  "data-positioned": o.value ? "true" : "false",
2565
2565
  style: o.value ? {
@@ -2567,8 +2567,8 @@ var yr = J({
2567
2567
  top: `${o.value.top}px`
2568
2568
  } : void 0
2569
2569
  }, y.value.map((n, r) => {
2570
- let i = Nt(n), a = r === 0 ? i : Nt(y.value[r - 1]), o = r > 0 && a !== i, s = n.commandId === null ? !!e.onEditWithAi : Tt(e.editor, n.commandId), c = Pt(n, e.messages);
2571
- return V("button", {
2570
+ let i = It(n), a = r === 0 ? i : It(y.value[r - 1]), o = r > 0 && a !== i, s = n.commandId === null ? !!e.onEditWithAi : Ot(e.editor, n.commandId), c = Lt(n, e.messages);
2571
+ return B("button", {
2572
2572
  key: `${n.id}-${r}`,
2573
2573
  type: "button",
2574
2574
  role: "menuitem",
@@ -2591,7 +2591,7 @@ var yr = J({
2591
2591
  }
2592
2592
  }, c);
2593
2593
  })) : null;
2594
- return () => e.active ? V("div", {
2594
+ return () => e.active ? B("div", {
2595
2595
  ref: c,
2596
2596
  class: "markweave-table-controls",
2597
2597
  "data-testid": "markweave-table-controls",
@@ -2599,7 +2599,7 @@ var yr = J({
2599
2599
  "data-open-menu": t.value ?? "none",
2600
2600
  "data-positioned": r.value || i.value || a.value ? "true" : "false"
2601
2601
  }, [
2602
- s.value ? V("div", {
2602
+ s.value ? B("div", {
2603
2603
  class: "markweave-table-copy-feedback",
2604
2604
  role: "status",
2605
2605
  "aria-live": "polite",
@@ -2607,8 +2607,8 @@ var yr = J({
2607
2607
  "data-copy-kind": s.value.kind,
2608
2608
  "data-text-length": s.value.textLength,
2609
2609
  "data-html-length": s.value.htmlLength
2610
- }, Dt(s.value)) : null,
2611
- r.value ? V("button", {
2610
+ }, At(s.value)) : null,
2611
+ r.value ? B("button", {
2612
2612
  ref: l,
2613
2613
  type: "button",
2614
2614
  class: "markweave-table-edge-handle markweave-table-edge-handle--row",
@@ -2627,8 +2627,8 @@ var yr = J({
2627
2627
  },
2628
2628
  onMousedown: $,
2629
2629
  onClick: () => O("row", "row-edge")
2630
- }, [V("span", { "aria-hidden": "true" }, "...")]) : null,
2631
- i.value ? V("button", {
2630
+ }, [B("span", { "aria-hidden": "true" }, "...")]) : null,
2631
+ i.value ? B("button", {
2632
2632
  ref: u,
2633
2633
  type: "button",
2634
2634
  class: "markweave-table-edge-handle markweave-table-edge-handle--column",
@@ -2647,8 +2647,8 @@ var yr = J({
2647
2647
  },
2648
2648
  onMousedown: $,
2649
2649
  onClick: () => O("column", "column-edge")
2650
- }, [V("span", { "aria-hidden": "true" }, "...")]) : null,
2651
- v.value && a.value ? V("button", {
2650
+ }, [B("span", { "aria-hidden": "true" }, "...")]) : null,
2651
+ v.value && a.value ? B("button", {
2652
2652
  ref: d,
2653
2653
  type: "button",
2654
2654
  class: "markweave-table-edge-handle markweave-table-edge-handle--selection",
@@ -2663,11 +2663,11 @@ var yr = J({
2663
2663
  },
2664
2664
  onMousedown: $,
2665
2665
  onClick: k
2666
- }, [V("span", { "aria-hidden": "true" }, "...")]) : null,
2666
+ }, [B("span", { "aria-hidden": "true" }, "...")]) : null,
2667
2667
  P()
2668
2668
  ]) : null;
2669
2669
  }
2670
- }), Cr = J({
2670
+ }), Tr = J({
2671
2671
  name: "MarkweaveVueTableSelectionOverlay",
2672
2672
  props: {
2673
2673
  editor: {
@@ -2680,18 +2680,18 @@ var yr = J({
2680
2680
  }
2681
2681
  },
2682
2682
  setup(e) {
2683
- let t = H(null), n = () => {
2683
+ let t = V(null), n = () => {
2684
2684
  if (e.focusState.mode !== "cell-selection") {
2685
2685
  t.value = null;
2686
2686
  return;
2687
2687
  }
2688
- t.value = Lt(e.editor, bt(e.editor.state));
2688
+ t.value = Bt(e.editor, Ct(e.editor.state));
2689
2689
  };
2690
- return $t(() => {
2690
+ return G(() => {
2691
2691
  n(), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0);
2692
2692
  }), K(() => {
2693
2693
  window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
2694
- }), G(() => [
2694
+ }), W(() => [
2695
2695
  e.focusState.activeCellPos,
2696
2696
  e.focusState.anchorCellPos,
2697
2697
  e.focusState.mode,
@@ -2702,7 +2702,7 @@ var yr = J({
2702
2702
  q(n);
2703
2703
  }, { flush: "post" }), () => {
2704
2704
  let e = t.value;
2705
- return e ? V("div", {
2705
+ return e ? B("div", {
2706
2706
  "aria-hidden": "true",
2707
2707
  class: "markweave-table-selection-overlay",
2708
2708
  "data-anchor-cell-pos": e.anchorCellPos ?? "",
@@ -2723,7 +2723,7 @@ var yr = J({
2723
2723
  }) : null;
2724
2724
  };
2725
2725
  }
2726
- }), wr = J({
2726
+ }), Er = J({
2727
2727
  name: "MarkweaveVueCodeBlockControls",
2728
2728
  props: {
2729
2729
  editor: {
@@ -2752,116 +2752,116 @@ var yr = J({
2752
2752
  }
2753
2753
  },
2754
2754
  setup(e) {
2755
- let t = H(null), n = H(null), r = H(null), i = H(null), a = H(null), o = H([]), s = H(null), c = H(!1), l = H(""), u = H(null), d = H(!1), f = H(null), p = H(null), m = H(!1), h = H({
2755
+ let t = V(null), n = V(null), r = V(null), i = V(null), a = V(null), o = V([]), s = V(null), c = V(!1), l = V(""), u = V(null), d = V(!1), f = V(null), p = V(null), m = V(!1), h = V({
2756
2756
  active: !1,
2757
2757
  lastX: 0,
2758
2758
  lastY: 0
2759
- }), g = H(0), _ = H(0), v = H(0), y = null, b = W(() => (v.value, Ie(e.editor, i.value))), x = W(() => !e.readOnly && e.active && e.state.active && e.state.pos !== null ? {
2759
+ }), g = V(0), _ = V(0), v = V(0), y = null, b = U(() => (v.value, ze(e.editor, i.value))), x = U(() => !e.readOnly && e.active && e.state.active && e.state.pos !== null ? {
2760
2760
  ...e.state,
2761
2761
  pos: e.state.pos,
2762
2762
  active: !0
2763
- } : null), S = W(() => b.value ?? x.value), C = W(() => S.value !== null), w = W(() => S.value?.language === "mermaid"), T = W(() => Be(e.editor, S.value)), E = W(() => C.value && S.value !== null && !T.value), D = W(() => !e.readOnly), O = W(() => S.value ? Ae(S.value.language) : Ae("text")), k = W(() => u.value?.status ?? "idle"), A = W(() => S.value?.mermaidPreviewMode ?? e.mermaidMode), j = W(() => w.value && A.value === "preview"), M = W(() => (v.value, g.value, _.value, Re(e.editor))), N = W(() => `${_.value}|${M.value.map((e) => `${e.pos}:${e.mermaidPreviewMode}:${e.text.length}`).join("|")}`), ee = W(() => Pe(l.value)), P = W(() => S.value ? `${S.value.pos}:${S.value.language}:${S.value.text}` : "none"), te = () => {
2763
+ } : null), S = U(() => b.value ?? x.value), C = U(() => S.value !== null), w = U(() => S.value?.language === "mermaid"), T = U(() => Ue(e.editor, S.value)), E = U(() => C.value && S.value !== null && !T.value), D = U(() => !e.readOnly), O = U(() => S.value ? Ne(S.value.language) : Ne("text")), k = U(() => u.value?.status ?? "idle"), A = U(() => S.value?.mermaidPreviewMode ?? e.mermaidMode), j = U(() => w.value && A.value === "preview"), M = U(() => (v.value, g.value, _.value, Ve(e.editor))), N = U(() => `${_.value}|${M.value.map((e) => `${e.pos}:${e.mermaidPreviewMode}:${e.text.length}`).join("|")}`), ee = U(() => Le(l.value)), P = U(() => S.value ? `${S.value.pos}:${S.value.language}:${S.value.text}` : "none"), te = () => {
2764
2764
  y !== null && (window.clearTimeout(y), y = null);
2765
2765
  }, F = (e) => {
2766
2766
  te(), u.value = e, e && (y = window.setTimeout(() => {
2767
2767
  u.value = null, y = null;
2768
- }, we));
2769
- }, I = () => {
2768
+ }, De));
2769
+ }, ne = () => {
2770
2770
  f.value = null, p.value = null, m.value = !1, h.value = {
2771
2771
  active: !1,
2772
2772
  lastX: 0,
2773
2773
  lastY: 0
2774
2774
  }, e.editor.view.focus();
2775
- }, L = () => {
2775
+ }, I = () => {
2776
2776
  let n = t.value;
2777
2777
  if (!n) return;
2778
- if (!Le(n) || M.value.length === 0) {
2778
+ if (!Be(n) || M.value.length === 0) {
2779
2779
  o.value = [];
2780
2780
  return;
2781
2781
  }
2782
2782
  let r = n.getBoundingClientRect(), i = M.value.flatMap((t) => {
2783
- let n = Ne(Me(e.editor, t.pos, t.mermaidPreviewMode), r);
2784
- return n ? [Oe(t, n, r)] : [];
2783
+ let n = Ie(Fe(e.editor, t.pos, t.mermaidPreviewMode), r);
2784
+ return n ? [je(t, n, r)] : [];
2785
2785
  });
2786
- o.value = Ve(o.value, i, M.value.map((e) => e.pos));
2787
- }, R = () => {
2786
+ o.value = We(o.value, i, M.value.map((e) => e.pos));
2787
+ }, L = () => {
2788
2788
  if (!E.value || !S.value) {
2789
2789
  a.value = null, s.value = null;
2790
2790
  return;
2791
2791
  }
2792
2792
  let r = t.value;
2793
2793
  if (!r) return;
2794
- let i = Me(e.editor, S.value.pos, A.value), o = r.getBoundingClientRect(), l = Ne(i, o);
2794
+ let i = Fe(e.editor, S.value.pos, A.value), o = r.getBoundingClientRect(), l = Ie(i, o);
2795
2795
  if (!l) {
2796
2796
  a.value = a.value?.pos === S.value.pos ? a.value : null, s.value = c.value ? s.value : null;
2797
2797
  return;
2798
2798
  }
2799
- if (a.value = Ee(S.value.pos, l, o), c.value && n.value) {
2799
+ if (a.value = ke(S.value.pos, l, o), c.value && n.value) {
2800
2800
  let e = n.value.getBoundingClientRect();
2801
- s.value = Se({
2801
+ s.value = Te({
2802
2802
  overlayRect: o,
2803
2803
  buttonRect: e,
2804
2804
  windowWidth: window.innerWidth,
2805
2805
  windowHeight: window.innerHeight
2806
2806
  });
2807
2807
  }
2808
- }, ne = async () => {
2808
+ }, re = async () => {
2809
2809
  if (e.readOnly) {
2810
2810
  if (!S.value) return;
2811
- let e = await Te(S.value.text);
2812
- F(_e(S.value, e ? "copied" : "failed"));
2811
+ let e = await Oe(S.value.text);
2812
+ F(be(S.value, e ? "copied" : "failed"));
2813
2813
  return;
2814
2814
  }
2815
- if (!ke(e.editor, S.value)) return;
2816
- let t = await he(e.editor);
2817
- F(_e(ge(e.editor), t ? "copied" : "failed")), e.editor.view.focus();
2818
- }, re = (t, n) => {
2815
+ if (!Me(e.editor, S.value)) return;
2816
+ let t = await ve(e.editor);
2817
+ F(be(ye(e.editor), t ? "copied" : "failed")), e.editor.view.focus();
2818
+ }, ie = (t, n) => {
2819
2819
  if (e.readOnly) {
2820
- at(e.editor, t.pos, n) && (_.value += 1, v.value += 1);
2820
+ ct(e.editor, t.pos, n) && (_.value += 1, v.value += 1);
2821
2821
  return;
2822
2822
  }
2823
2823
  let r = e.state.active && e.state.pos === t.pos;
2824
- xe(e.editor, t.pos, n) && (e.onMermaidModeChange(n), v.value += 1, r && e.editor.view.focus());
2825
- }, z = (t) => {
2824
+ we(e.editor, t.pos, n) && (e.onMermaidModeChange(n), v.value += 1, r && e.editor.view.focus());
2825
+ }, R = (t) => {
2826
2826
  if (e.readOnly || !S.value) return;
2827
2827
  let n = e.state.active && e.state.pos === S.value.pos;
2828
- be(e.editor, S.value.pos, t) && (t === "mermaid" && xe(e.editor, S.value.pos, "preview") && e.onMermaidModeChange("preview"), c.value = !1, l.value = "", v.value += 1, n && e.editor.view.focus());
2829
- }, ie = () => {
2830
- e.readOnly || !S.value || ye(e.editor, S.value.pos, !T.value) && (g.value += 1, v.value += 1, i.value = null);
2828
+ Ce(e.editor, S.value.pos, t) && (t === "mermaid" && we(e.editor, S.value.pos, "preview") && e.onMermaidModeChange("preview"), c.value = !1, l.value = "", v.value += 1, n && e.editor.view.focus());
2831
2829
  }, ae = () => {
2830
+ e.readOnly || !S.value || Se(e.editor, S.value.pos, !T.value) && (g.value += 1, v.value += 1, i.value = null);
2831
+ }, oe = () => {
2832
2832
  if (!S.value) return;
2833
- let t = ze(e.editor, S.value.pos);
2833
+ let t = He(e.editor, S.value.pos);
2834
2834
  if (!t) return;
2835
2835
  let n = new Blob([t], { type: "image/svg+xml" }), r = URL.createObjectURL(n), i = document.createElement("a");
2836
2836
  i.href = r, i.download = "markweave-mermaid.svg", i.click(), URL.revokeObjectURL(r), e.editor.view.focus();
2837
- }, oe = () => {
2837
+ }, se = () => {
2838
2838
  if (!S.value) return;
2839
- let t = ze(e.editor, S.value.pos);
2840
- t && (f.value = De(t), p.value = null, m.value = !1, h.value = {
2839
+ let t = He(e.editor, S.value.pos);
2840
+ t && (f.value = Ae(t), p.value = null, m.value = !1, h.value = {
2841
2841
  active: !1,
2842
2842
  lastX: 0,
2843
2843
  lastY: 0
2844
2844
  });
2845
- }, B = (e) => {
2845
+ }, z = (e) => {
2846
2846
  f.value = f.value ? {
2847
2847
  ...f.value,
2848
- scale: Ce(f.value.scale + e)
2848
+ scale: Ee(f.value.scale + e)
2849
2849
  } : null;
2850
- }, se = () => {
2851
- f.value = f.value ? De(f.value.svg) : null, h.value = {
2850
+ }, ce = () => {
2851
+ f.value = f.value ? Ae(f.value.svg) : null, h.value = {
2852
2852
  active: !1,
2853
2853
  lastX: 0,
2854
2854
  lastY: 0
2855
2855
  }, m.value = !1;
2856
- }, ce = (e) => {
2857
- e.preventDefault(), B(e.deltaY < 0 ? He : -He);
2858
2856
  }, le = (e) => {
2857
+ e.preventDefault(), z(e.deltaY < 0 ? Ge : -Ge);
2858
+ }, ue = (e) => {
2859
2859
  e.button === 0 && (e.preventDefault(), h.value = {
2860
2860
  active: !0,
2861
2861
  lastX: e.clientX,
2862
2862
  lastY: e.clientY
2863
2863
  }, m.value = !0);
2864
- }, ue = (e) => {
2864
+ }, de = (e) => {
2865
2865
  let t = h.value;
2866
2866
  if (!t.active) return;
2867
2867
  let n = e.clientX - t.lastX, r = e.clientY - t.lastY;
@@ -2869,50 +2869,50 @@ var yr = J({
2869
2869
  active: !0,
2870
2870
  lastX: e.clientX,
2871
2871
  lastY: e.clientY
2872
- }, f.value = Ue(f.value, n, r);
2873
- }, de = () => {
2872
+ }, f.value = Ke(f.value, n, r);
2873
+ }, fe = () => {
2874
2874
  h.value = {
2875
2875
  active: !1,
2876
2876
  lastX: 0,
2877
2877
  lastY: 0
2878
2878
  }, m.value = !1;
2879
2879
  };
2880
- G(() => e.readOnly, (e) => {
2880
+ W(() => e.readOnly, (e) => {
2881
2881
  e && (c.value = !1, l.value = "");
2882
- }), G(P, () => {
2882
+ }), W(P, () => {
2883
2883
  F(null), c.value = !1, l.value = "", f.value = null, p.value = null, m.value = !1;
2884
- }), G(c, async (e) => {
2885
- e && (await q(), R(), r.value?.focus({ preventScroll: !0 }));
2886
- }), G(() => [
2884
+ }), W(c, async (e) => {
2885
+ e && (await q(), L(), r.value?.focus({ preventScroll: !0 }));
2886
+ }), W(() => [
2887
2887
  E.value,
2888
2888
  g.value,
2889
2889
  S.value?.pos ?? null,
2890
2890
  c.value,
2891
2891
  A.value
2892
2892
  ], async () => {
2893
- await q(), R();
2893
+ await q(), L();
2894
2894
  }, {
2895
2895
  flush: "post",
2896
2896
  immediate: !0
2897
- }), G(N, async () => {
2898
- await q(), L(), window.requestAnimationFrame(L);
2897
+ }), W(N, async () => {
2898
+ await q(), I(), window.requestAnimationFrame(I);
2899
2899
  }, {
2900
2900
  flush: "post",
2901
2901
  immediate: !0
2902
2902
  });
2903
- let fe = null;
2904
- return $t(() => {
2903
+ let pe = null;
2904
+ return G(() => {
2905
2905
  q(() => {
2906
2906
  let n = e.editor.view.dom.closest(".markweave-editor-frame"), r = (n) => {
2907
2907
  if (n.target instanceof Node && t.value?.contains(n.target) || c.value) return;
2908
- let r = Fe(e.editor, n.target), a = Ie(e.editor, r), o = a && !Be(e.editor, a) ? a.pos : null;
2908
+ let r = Re(e.editor, n.target), a = ze(e.editor, r), o = a && !Ue(e.editor, a) ? a.pos : null;
2909
2909
  i.value = i.value === o ? i.value : o;
2910
2910
  }, a = () => {
2911
2911
  c.value || (i.value = null);
2912
2912
  }, o = (t) => {
2913
2913
  if (t.key === "Escape") {
2914
2914
  if (f.value) {
2915
- I();
2915
+ ne();
2916
2916
  return;
2917
2917
  }
2918
2918
  c.value && (c.value = !1, e.editor.view.focus());
@@ -2920,14 +2920,14 @@ var yr = J({
2920
2920
  }, s = (e) => {
2921
2921
  c.value && (e.target instanceof Node && t.value?.contains(e.target) || (c.value = !1));
2922
2922
  }, l = ({ transaction: e }) => {
2923
- e.getMeta(me) && (g.value += 1), (e.docChanged || e.selectionSet || e.getMeta(me) || rt(e)) && (v.value += 1);
2923
+ e.getMeta(_e) && (g.value += 1), (e.docChanged || e.selectionSet || e.getMeta(_e) || ot(e)) && (v.value += 1);
2924
2924
  };
2925
- n?.addEventListener("mousemove", r), n?.addEventListener("mouseleave", a), window.addEventListener("resize", R), window.addEventListener("scroll", R, !0), window.addEventListener("resize", L), window.addEventListener("scroll", L, !0), document.addEventListener("keydown", o), document.addEventListener("mousedown", s), e.editor.on("transaction", l), fe = () => {
2926
- n?.removeEventListener("mousemove", r), n?.removeEventListener("mouseleave", a), window.removeEventListener("resize", R), window.removeEventListener("scroll", R, !0), window.removeEventListener("resize", L), window.removeEventListener("scroll", L, !0), document.removeEventListener("keydown", o), document.removeEventListener("mousedown", s), e.editor.off("transaction", l), te();
2925
+ n?.addEventListener("mousemove", r), n?.addEventListener("mouseleave", a), window.addEventListener("resize", L), window.addEventListener("scroll", L, !0), window.addEventListener("resize", I), window.addEventListener("scroll", I, !0), document.addEventListener("keydown", o), document.addEventListener("mousedown", s), e.editor.on("transaction", l), pe = () => {
2926
+ n?.removeEventListener("mousemove", r), n?.removeEventListener("mouseleave", a), window.removeEventListener("resize", L), window.removeEventListener("scroll", L, !0), window.removeEventListener("resize", I), window.removeEventListener("scroll", I, !0), document.removeEventListener("keydown", o), document.removeEventListener("mousedown", s), e.editor.off("transaction", l), te();
2927
2927
  };
2928
2928
  });
2929
2929
  }), K(() => {
2930
- fe?.(), fe = null, te();
2930
+ pe?.(), pe = null, te();
2931
2931
  }), () => {
2932
2932
  if (!E.value && M.value.length === 0 && !f.value) return null;
2933
2933
  let i = a.value ? {
@@ -2937,7 +2937,7 @@ var yr = J({
2937
2937
  left: `${s.value.left}px`,
2938
2938
  top: `${s.value.top}px`
2939
2939
  } : void 0;
2940
- return V("div", {
2940
+ return B("div", {
2941
2941
  ref: t,
2942
2942
  class: "markweave-codeblock-overlay",
2943
2943
  "data-testid": "markweave-codeblock-overlay",
@@ -2945,7 +2945,7 @@ var yr = J({
2945
2945
  }, [
2946
2946
  ...M.value.map((e) => {
2947
2947
  let t = o.value.find((t) => t.pos === e.pos);
2948
- return V("div", {
2948
+ return B("div", {
2949
2949
  key: e.pos,
2950
2950
  class: "markweave-mermaid-tabs",
2951
2951
  "data-testid": "markweave-mermaid-tabs",
@@ -2955,16 +2955,16 @@ var yr = J({
2955
2955
  top: `${t.top}px`,
2956
2956
  left: `${t.left}px`
2957
2957
  } : void 0
2958
- }, ["code", "preview"].map((t) => V("button", {
2958
+ }, ["code", "preview"].map((t) => B("button", {
2959
2959
  key: t,
2960
2960
  type: "button",
2961
2961
  "data-testid": `markweave-mermaid-mode-${t}`,
2962
2962
  "data-active": e.mermaidPreviewMode === t ? "true" : "false",
2963
2963
  onMousedown: $,
2964
- onClick: () => re(e, t)
2964
+ onClick: () => ie(e, t)
2965
2965
  }, t === "code" ? "Code" : "Preview")));
2966
2966
  }),
2967
- E.value && S.value ? V("div", {
2967
+ E.value && S.value ? B("div", {
2968
2968
  class: "markweave-codeblock-controls",
2969
2969
  "data-testid": "markweave-codeblock-controls",
2970
2970
  "data-positioned": a.value ? "true" : "false",
@@ -2973,11 +2973,11 @@ var yr = J({
2973
2973
  "aria-label": "Code block controls",
2974
2974
  style: i
2975
2975
  }, [
2976
- e.readOnly ? V("span", {
2976
+ e.readOnly ? B("span", {
2977
2977
  class: "markweave-codeblock-language-button markweave-codeblock-language-label",
2978
2978
  "aria-label": "Code block language",
2979
2979
  "data-testid": "markweave-codeblock-language"
2980
- }, [V("span", null, O.value)]) : V("button", {
2980
+ }, [B("span", null, O.value)]) : B("button", {
2981
2981
  ref: n,
2982
2982
  type: "button",
2983
2983
  class: "markweave-codeblock-language-button",
@@ -2989,8 +2989,8 @@ var yr = J({
2989
2989
  onClick: () => {
2990
2990
  c.value = !c.value;
2991
2991
  }
2992
- }, [V("span", null, O.value), Q("chevron")]),
2993
- D.value ? V("button", {
2992
+ }, [B("span", null, O.value), Q("chevron")]),
2993
+ D.value ? B("button", {
2994
2994
  type: "button",
2995
2995
  class: "markweave-codeblock-icon-button markweave-codeblock-collapse-button",
2996
2996
  "aria-label": T.value ? "Expand code block" : "Collapse code block",
@@ -2998,9 +2998,9 @@ var yr = J({
2998
2998
  "data-testid": "markweave-codeblock-collapse",
2999
2999
  "data-collapsed": T.value ? "true" : "false",
3000
3000
  onMousedown: $,
3001
- onClick: ie
3001
+ onClick: ae
3002
3002
  }, [Q("chevron")]) : null,
3003
- V("span", { class: "markweave-codeblock-copy-wrap" }, [V("button", {
3003
+ B("span", { class: "markweave-codeblock-copy-wrap" }, [B("button", {
3004
3004
  type: "button",
3005
3005
  class: "markweave-codeblock-icon-button",
3006
3006
  "aria-label": "Copy to clipboard",
@@ -3020,42 +3020,42 @@ var yr = J({
3020
3020
  d.value = !1;
3021
3021
  },
3022
3022
  onClick: () => {
3023
- ne();
3023
+ re();
3024
3024
  }
3025
- }, [Q(k.value === "copied" ? "check" : "clipboard")]), d.value ? V("span", {
3025
+ }, [Q(k.value === "copied" ? "check" : "clipboard")]), d.value ? B("span", {
3026
3026
  class: "markweave-codeblock-tooltip",
3027
3027
  role: "tooltip",
3028
3028
  "data-testid": "markweave-codeblock-copy-tooltip"
3029
3029
  }, "Copy to clipboard") : null]),
3030
- w.value && A.value === "preview" ? V("div", {
3030
+ w.value && A.value === "preview" ? B("div", {
3031
3031
  class: "markweave-mermaid-preview-actions",
3032
3032
  "data-testid": "markweave-mermaid-preview-actions"
3033
- }, [V("button", {
3033
+ }, [B("button", {
3034
3034
  type: "button",
3035
3035
  class: "markweave-codeblock-icon-button",
3036
3036
  "aria-label": "Fullscreen Mermaid preview",
3037
3037
  "data-testid": "markweave-mermaid-fullscreen",
3038
3038
  disabled: !j.value,
3039
3039
  onMousedown: $,
3040
- onClick: oe
3041
- }, [Q("expand")]), V("button", {
3040
+ onClick: se
3041
+ }, [Q("expand")]), B("button", {
3042
3042
  type: "button",
3043
3043
  class: "markweave-codeblock-icon-button",
3044
3044
  "aria-label": "Download Mermaid SVG",
3045
3045
  "data-testid": "markweave-mermaid-download",
3046
3046
  disabled: !j.value,
3047
3047
  onMousedown: $,
3048
- onClick: ae
3048
+ onClick: oe
3049
3049
  }, [Q("download")])]) : null
3050
3050
  ]) : null,
3051
- D.value && E.value && c.value && S.value ? V("div", {
3051
+ D.value && E.value && c.value && S.value ? B("div", {
3052
3052
  class: "markweave-codeblock-language-menu",
3053
3053
  role: "listbox",
3054
3054
  "aria-label": "Code block languages",
3055
3055
  "data-testid": "markweave-codeblock-language-menu",
3056
3056
  "data-positioned": s.value ? "true" : "false",
3057
3057
  style: u
3058
- }, [V("label", { class: "markweave-codeblock-language-search" }, [V("input", {
3058
+ }, [B("label", { class: "markweave-codeblock-language-search" }, [B("input", {
3059
3059
  ref: r,
3060
3060
  value: l.value,
3061
3061
  placeholder: "Search...",
@@ -3066,9 +3066,9 @@ var yr = J({
3066
3066
  onKeydown: (t) => {
3067
3067
  t.key === "Escape" && (t.preventDefault(), c.value = !1, e.editor.view.focus());
3068
3068
  }
3069
- }), Q("search")]), V("div", { class: "markweave-codeblock-language-list" }, ee.value.map((e) => {
3069
+ }), Q("search")]), B("div", { class: "markweave-codeblock-language-list" }, ee.value.map((e) => {
3070
3070
  let t = S.value?.language === e.language;
3071
- return V("button", {
3071
+ return B("button", {
3072
3072
  key: e.language,
3073
3073
  type: "button",
3074
3074
  role: "option",
@@ -3076,21 +3076,21 @@ var yr = J({
3076
3076
  "data-testid": `markweave-codeblock-language-option-${e.language}`,
3077
3077
  "data-active": t ? "true" : "false",
3078
3078
  onMousedown: $,
3079
- onClick: () => z(e.language)
3080
- }, [V("span", null, e.label), t ? Q("check") : null]);
3079
+ onClick: () => R(e.language)
3080
+ }, [B("span", null, e.label), t ? Q("check") : null]);
3081
3081
  }))]) : null,
3082
- f.value ? V("div", {
3082
+ f.value ? B("div", {
3083
3083
  class: "markweave-mermaid-fullscreen-layer",
3084
3084
  role: "dialog",
3085
3085
  "aria-modal": "true",
3086
3086
  "aria-label": "Mermaid preview",
3087
3087
  "data-testid": "markweave-mermaid-fullscreen-layer"
3088
3088
  }, [
3089
- V("div", {
3089
+ B("div", {
3090
3090
  class: "markweave-mermaid-fullscreen-toolbar",
3091
3091
  "data-testid": "markweave-mermaid-fullscreen-toolbar"
3092
3092
  }, [
3093
- V("button", {
3093
+ B("button", {
3094
3094
  type: "button",
3095
3095
  class: "markweave-mermaid-fullscreen-control",
3096
3096
  "aria-label": "Zoom out",
@@ -3107,13 +3107,13 @@ var yr = J({
3107
3107
  onBlur: () => {
3108
3108
  p.value = null;
3109
3109
  },
3110
- onClick: () => B(-He)
3110
+ onClick: () => z(-Ge)
3111
3111
  }, [Q("zoomOut")]),
3112
- V("span", {
3112
+ B("span", {
3113
3113
  class: "markweave-mermaid-fullscreen-zoom-label",
3114
3114
  "data-testid": "markweave-mermaid-fullscreen-zoom-label"
3115
- }, je(f.value.scale)),
3116
- V("button", {
3115
+ }, Pe(f.value.scale)),
3116
+ B("button", {
3117
3117
  type: "button",
3118
3118
  class: "markweave-mermaid-fullscreen-control",
3119
3119
  "aria-label": "Zoom in",
@@ -3130,9 +3130,9 @@ var yr = J({
3130
3130
  onBlur: () => {
3131
3131
  p.value = null;
3132
3132
  },
3133
- onClick: () => B(He)
3133
+ onClick: () => z(Ge)
3134
3134
  }, [Q("zoomIn")]),
3135
- V("button", {
3135
+ B("button", {
3136
3136
  type: "button",
3137
3137
  class: "markweave-mermaid-fullscreen-control",
3138
3138
  "aria-label": "Reset zoom",
@@ -3149,31 +3149,31 @@ var yr = J({
3149
3149
  onBlur: () => {
3150
3150
  p.value = null;
3151
3151
  },
3152
- onClick: se
3152
+ onClick: ce
3153
3153
  }, [Q("reset")]),
3154
- p.value ? V("span", {
3154
+ p.value ? B("span", {
3155
3155
  class: "markweave-mermaid-fullscreen-tooltip",
3156
3156
  role: "tooltip",
3157
3157
  "data-testid": "markweave-mermaid-fullscreen-tooltip"
3158
3158
  }, p.value === "zoom-out" ? "Zoom out" : p.value === "zoom-in" ? "Zoom in" : "Reset") : null
3159
3159
  ]),
3160
- V("button", {
3160
+ B("button", {
3161
3161
  type: "button",
3162
3162
  class: "markweave-mermaid-fullscreen-close",
3163
3163
  "aria-label": "Close fullscreen Mermaid preview",
3164
3164
  "data-testid": "markweave-mermaid-fullscreen-close",
3165
- onClick: I
3165
+ onClick: ne
3166
3166
  }, [Q("close")]),
3167
- V("div", {
3167
+ B("div", {
3168
3168
  class: "markweave-mermaid-fullscreen-viewport",
3169
3169
  "data-testid": "markweave-mermaid-fullscreen-viewport",
3170
3170
  "data-dragging": m.value ? "true" : "false",
3171
- onWheel: ce,
3172
- onMousedown: le,
3173
- onMousemove: ue,
3174
- onMouseup: de,
3175
- onMouseleave: de
3176
- }, [V("div", {
3171
+ onWheel: le,
3172
+ onMousedown: ue,
3173
+ onMousemove: de,
3174
+ onMouseup: fe,
3175
+ onMouseleave: fe
3176
+ }, [B("div", {
3177
3177
  class: "markweave-mermaid-fullscreen-content",
3178
3178
  "data-testid": "markweave-mermaid-fullscreen-content",
3179
3179
  "data-scale-percent": Math.round(f.value.scale * 100),
@@ -3189,7 +3189,7 @@ var yr = J({
3189
3189
  ]);
3190
3190
  };
3191
3191
  }
3192
- }), Tr = J({
3192
+ }), Dr = J({
3193
3193
  name: "MarkweaveVueInnerToc",
3194
3194
  props: {
3195
3195
  editor: {
@@ -3207,21 +3207,29 @@ var yr = J({
3207
3207
  editable: {
3208
3208
  type: Boolean,
3209
3209
  required: !0
3210
+ },
3211
+ placement: {
3212
+ type: String,
3213
+ required: !0
3210
3214
  }
3211
3215
  },
3212
3216
  setup(e) {
3213
- return () => e.state.items.length ? V("nav", {
3217
+ let t = V(null), n, r = () => {
3218
+ n?.(), n = e.placement === "container" && t.value ? he(t.value) : void 0;
3219
+ };
3220
+ return G(r), K(() => n?.()), W(() => e.placement, r), () => e.state.items.length ? B("nav", {
3221
+ ref: t,
3214
3222
  class: "markweave-inner-toc",
3215
3223
  "data-testid": "markweave-inner-toc",
3216
3224
  "aria-label": e.messages.toc.ariaLabel
3217
- }, [V("div", {
3225
+ }, [B("div", {
3218
3226
  class: "markweave-inner-toc-rail",
3219
3227
  "aria-hidden": "true"
3220
- }, e.state.items.map((e) => V("span", {
3228
+ }, e.state.items.map((e) => B("span", {
3221
3229
  key: e.id,
3222
3230
  "data-level": e.level,
3223
3231
  "data-active": e.active ? "true" : "false"
3224
- }))), V("div", { class: "markweave-inner-toc-panel" }, [V("div", { class: "markweave-inner-toc-list" }, e.state.items.map((t) => V("button", {
3232
+ }))), B("div", { class: "markweave-inner-toc-panel" }, [B("div", { class: "markweave-inner-toc-list" }, e.state.items.map((t) => B("button", {
3225
3233
  key: t.id,
3226
3234
  type: "button",
3227
3235
  class: "markweave-inner-toc-item",
@@ -3230,17 +3238,17 @@ var yr = J({
3230
3238
  "aria-current": t.active ? "location" : void 0,
3231
3239
  "aria-label": `${e.messages.toc.itemAriaLabel}: ${t.text}`,
3232
3240
  title: t.text,
3233
- onClick: () => pe(e.editor, t, {
3241
+ onClick: () => ge(e.editor, t, {
3234
3242
  behavior: "smooth",
3235
3243
  focus: e.editable
3236
3244
  })
3237
3245
  }, t.text)))])]) : null;
3238
3246
  }
3239
3247
  });
3240
- function Er(e = {}) {
3241
- let t = m(e.lang), r = p(t), i = f(t), a = H(l(e.mode)), o = W(() => a.value === "live" && e.editable !== !1), s = H(0), c = U(null), d = H(mt), h = U(null), g = U(null), _ = H("code"), v = U(null), y = U(xt), b = H(null), x = H(!1), S = F(e.content === void 0 ? e.defaultContentFormat : e.contentFormat), C = e.onSlashCommandUpload, w = U(null);
3248
+ function Or(e = {}) {
3249
+ let t = m(e.lang), r = p(t), i = f(t), a = V(l(e.mode)), o = U(() => a.value === "live" && e.editable !== !1), s = V(0), c = H(null), d = V(_t), h = H(null), g = H(null), _ = V("code"), v = H(null), y = H(wt), b = V(null), x = V(!1), S = F(e.content === void 0 ? e.defaultContentFormat : e.contentFormat), C = e.onSlashCommandUpload, w = H(null);
3242
3250
  w.value = new n({
3243
- extensions: sr({
3251
+ extensions: lr({
3244
3252
  lang: t,
3245
3253
  onImageUpload: (e) => C?.(e) ?? A(e) ?? Promise.reject(/* @__PURE__ */ Error("File upload requires an upload handler.")),
3246
3254
  onVideoUpload: (e) => C?.(e) ?? A(e) ?? Promise.reject(/* @__PURE__ */ Error("File upload requires an upload handler."))
@@ -3259,17 +3267,17 @@ function Er(e = {}) {
3259
3267
  translate: "no"
3260
3268
  },
3261
3269
  handleClick: (e, t, n) => {
3262
- if (!o.value) return ae(n);
3263
- let r = Ze(e, n);
3264
- return r ? (n.preventDefault(), n.stopPropagation(), E(), tt(e, r, !0), nt(e, r), v.value = r, !0) : (v.value = null, !1);
3270
+ if (!o.value) return oe(n);
3271
+ let r = et(e, n);
3272
+ return r ? (n.preventDefault(), n.stopPropagation(), E(), it(e, r, !0), at(e, r), v.value = r, !0) : (v.value = null, !1);
3265
3273
  },
3266
3274
  handleDOMEvents: {
3267
- compositionstart: () => o.value ? (d.value = ht(d.value, { type: "composition-start" }), h.value = null, !1) : !1,
3275
+ compositionstart: () => o.value ? (d.value = vt(d.value, { type: "composition-start" }), h.value = null, !1) : !1,
3268
3276
  compositionend: (e) => (o.value && window.setTimeout(() => D(e), 0), !1),
3269
3277
  click: (e, t) => {
3270
- if (!o.value) return ae(t);
3271
- let n = Ze(e, t);
3272
- return n ? (t.preventDefault(), t.stopPropagation(), E(), tt(e, n, !0), nt(e, n), v.value = n, !0) : (v.value = null, !1);
3278
+ if (!o.value) return oe(t);
3279
+ let n = et(e, t);
3280
+ return n ? (t.preventDefault(), t.stopPropagation(), E(), it(e, n, !0), at(e, n), v.value = n, !0) : (v.value = null, !1);
3273
3281
  }
3274
3282
  }
3275
3283
  },
@@ -3278,11 +3286,11 @@ function Er(e = {}) {
3278
3286
  u(t, {
3279
3287
  mode: a.value,
3280
3288
  editable: o.value
3281
- }), it(t, o.value ? "live" : "view"), e.autoFocusFirstTableBodyCell && o.value && vt(t), j(t), k(t), s.value += 1;
3289
+ }), st(t, o.value ? "live" : "view"), e.autoFocusFirstTableBodyCell && o.value && xt(t), j(t), k(t), s.value += 1;
3282
3290
  },
3283
3291
  onTransaction: ({ editor: e, transaction: t }) => {
3284
- if (j(e), (t.docChanged || rt(t)) && (s.value += 1), t.docChanged && v.value) {
3285
- let t = Xe(e, v.value.pos);
3292
+ if (j(e), (t.docChanged || ot(t)) && (s.value += 1), t.docChanged && v.value) {
3293
+ let t = $e(e, v.value.pos);
3286
3294
  v.value = t?.kind === v.value.kind ? t : null;
3287
3295
  }
3288
3296
  },
@@ -3290,86 +3298,86 @@ function Er(e = {}) {
3290
3298
  k(t), o.value && O(t), x.value || e.onUpdate?.(ee(t));
3291
3299
  }
3292
3300
  });
3293
- let T = W(() => w.value ?? null);
3301
+ let T = U(() => w.value ?? null);
3294
3302
  function E() {
3295
- h.value = null, g.value = null, d.value = mt;
3303
+ h.value = null, g.value = null, d.value = _t;
3296
3304
  }
3297
3305
  function D(e) {
3298
- let t = pt(e.state);
3306
+ let t = gt(e.state);
3299
3307
  if (!t) {
3300
- d.value = d.value.name === "idle" ? d.value : mt, h.value = null, g.value = null;
3308
+ d.value = d.value.name === "idle" ? d.value : _t, h.value = null, g.value = null;
3301
3309
  return;
3302
3310
  }
3303
3311
  let n = e.coordsAtPos(t.cursor), r = e.coordsAtPos(t.triggerFrom), i = e.dom.closest(".markweave-editor-frame")?.getBoundingClientRect();
3304
- h.value = ft(n, {
3312
+ h.value = ht(n, {
3305
3313
  frameRect: i,
3306
3314
  triggerRect: r
3307
- }), d.value = dt(d.value, t);
3315
+ }), d.value = mt(d.value, t);
3308
3316
  }
3309
3317
  function O(e) {
3310
3318
  D(e.view);
3311
3319
  }
3312
3320
  function k(e) {
3313
- c.value = B(e);
3314
- let t = Qe(e);
3315
- t && (et(e, t, !0), v.value = t);
3316
- let n = ge(e);
3321
+ c.value = z(e);
3322
+ let t = tt(e);
3323
+ t && (rt(e, t, !0), v.value = t);
3324
+ let n = ye(e);
3317
3325
  n.active && n.language === "mermaid" && (_.value = n.mermaidPreviewMode);
3318
3326
  }
3319
3327
  function j(e) {
3320
- y.value = ur(e);
3328
+ y.value = fr(e);
3321
3329
  }
3322
- let M = W(() => T.value ? ge(T.value) : lr), I = W(() => T.value ? yt(T.value.state) : cr), L = W(() => c.value?.currentNode === "codeBlock"), R = W(() => L.value && M.value.language === "mermaid"), ne = W(() => T.value ? ot({
3323
- active: R.value,
3330
+ let M = U(() => T.value ? ye(T.value) : dr), ne = U(() => T.value ? St(T.value.state) : ur), I = U(() => c.value?.currentNode === "codeBlock"), L = U(() => I.value && M.value.language === "mermaid"), re = U(() => T.value ? lt({
3331
+ active: L.value,
3324
3332
  mode: _.value,
3325
3333
  source: M.value.text
3326
- }) : ot({
3334
+ }) : lt({
3327
3335
  active: !1,
3328
3336
  mode: "code",
3329
3337
  source: ""
3330
- })), re = W(() => T.value ? _t(T.value.state) : null), z = W(() => T.value ? de(T.value.state.doc) : le.items), ie = W(() => fe(z.value, b.value)), se = W(() => ce(z.value, ie.value)), pe = W(() => st(d.value.query, i)), me = W(() => oe({
3338
+ })), ie = U(() => T.value ? bt(T.value.state) : null), R = U(() => T.value ? fe(T.value.state.doc) : ue.items), ae = U(() => pe(R.value, b.value)), ce = U(() => le(R.value, ae.value)), me = U(() => ut(d.value.query, i)), he = U(() => se({
3331
3339
  revision: s.value,
3332
3340
  mode: a.value,
3333
3341
  editable: o.value,
3334
- toc: se.value,
3342
+ toc: ce.value,
3335
3343
  selection: c.value,
3336
3344
  slash: d.value,
3337
- table: I.value,
3345
+ table: ne.value,
3338
3346
  tableInteraction: y.value,
3339
3347
  codeBlock: M.value,
3340
- mermaid: ne.value,
3341
- tableDebugSnapshot: re.value
3342
- })), he = {
3348
+ mermaid: re.value,
3349
+ tableDebugSnapshot: ie.value
3350
+ })), ge = {
3343
3351
  closeSlashMenu: E,
3344
- focusFirstTableBodyCell: () => T.value ? vt(T.value) : !1,
3352
+ focusFirstTableBodyCell: () => T.value ? xt(T.value) : !1,
3345
3353
  setContent: (e, t = {}) => {
3346
3354
  if (!T.value) return !1;
3347
3355
  let n = F(t.format);
3348
3356
  return T.value.commands.setContent(e, {
3349
3357
  contentType: P(n),
3350
3358
  emitUpdate: t.emitUpdate ?? !1
3351
- }), t.focusFirstTableBodyCell && vt(T.value), k(T.value), o.value && O(T.value), j(T.value), s.value += 1, !0;
3359
+ }), t.focusFirstTableBodyCell && xt(T.value), k(T.value), o.value && O(T.value), j(T.value), s.value += 1, !0;
3352
3360
  }
3353
3361
  };
3354
3362
  function _e(e, t) {
3355
- if (!(!T.value || !o.value || !ct(e))) {
3363
+ if (!(!T.value || !o.value || !dt(e))) {
3356
3364
  if (e.inputKind && !t?.emoji && !t?.uploadResult) {
3357
3365
  g.value = e;
3358
3366
  return;
3359
3367
  }
3360
- ut(T.value, d.value, e, t), d.value = ht(d.value, { type: "execute" }), E();
3368
+ pt(T.value, d.value, e, t), d.value = vt(d.value, { type: "execute" }), E();
3361
3369
  }
3362
3370
  }
3363
3371
  function ve(e) {
3364
3372
  if (!T.value || g.value || !o.value) return;
3365
- let t = lt(d.value, pe.value, e.key, { isComposing: e.isComposing || N(T.value.state) });
3373
+ let t = ft(d.value, me.value, e.key, { isComposing: e.isComposing || N(T.value.state) });
3366
3374
  if (t.type !== "ignore") {
3367
3375
  if (e.preventDefault(), t.type === "close") {
3368
- d.value = ht(d.value, { type: "escape" }), E();
3376
+ d.value = vt(d.value, { type: "escape" }), E();
3369
3377
  return;
3370
3378
  }
3371
3379
  if (t.type === "move-active") {
3372
- d.value = ht(d.value, {
3380
+ d.value = vt(d.value, {
3373
3381
  type: "move-active",
3374
3382
  delta: t.delta,
3375
3383
  optionCount: t.optionCount
@@ -3379,58 +3387,58 @@ function Er(e = {}) {
3379
3387
  _e(t.command);
3380
3388
  }
3381
3389
  }
3382
- G(() => [e.mode, e.editable], () => {
3390
+ W(() => [e.mode, e.editable], () => {
3383
3391
  a.value = l(e.mode), T.value && (T.value.setEditable(o.value), u(T.value, {
3384
3392
  mode: a.value,
3385
3393
  editable: o.value
3386
- }), it(T.value, o.value ? "live" : "view"), o.value || E());
3387
- }, { immediate: !0 }), G(() => e.content, (t) => {
3394
+ }), st(T.value, o.value ? "live" : "view"), o.value || E());
3395
+ }, { immediate: !0 }), W(() => e.content, (t) => {
3388
3396
  !T.value || t === void 0 || te(T.value, t, F(e.contentFormat)) || (x.value = !0, T.value.commands.setContent(t, {
3389
3397
  contentType: P(F(e.contentFormat)),
3390
3398
  emitUpdate: !1
3391
3399
  }), x.value = !1, k(T.value), o.value && O(T.value), j(T.value), s.value += 1);
3392
- }), G(me, (t) => e.onRuntimeStateChange?.(t), { immediate: !0 }), G(se, (t) => e.onTocChange?.(t), { immediate: !0 }), G(z, (e) => {
3393
- let t = fe(e, b.value);
3400
+ }), W(he, (t) => e.onRuntimeStateChange?.(t), { immediate: !0 }), W(ce, (t) => e.onTocChange?.(t), { immediate: !0 }), W(R, (e) => {
3401
+ let t = pe(e, b.value);
3394
3402
  b.value !== t && (b.value = t);
3395
3403
  });
3396
- let ye = null;
3397
- return $t(() => {
3404
+ let be = null;
3405
+ return G(() => {
3398
3406
  let e = () => {
3399
- if (!T.value || !z.value.length) {
3407
+ if (!T.value || !R.value.length) {
3400
3408
  b.value = null;
3401
3409
  return;
3402
3410
  }
3403
3411
  let e = null;
3404
3412
  try {
3405
- e = ue(T.value, z.value);
3413
+ e = de(T.value, R.value);
3406
3414
  } catch {
3407
3415
  return;
3408
3416
  }
3409
3417
  b.value !== e && (b.value = e);
3410
- }, t = () => window.requestAnimationFrame(e), n = dr(T.value?.view.dom ?? null);
3411
- window.addEventListener("scroll", t, { passive: !0 }), window.addEventListener("resize", t), n?.addEventListener("scroll", t, { passive: !0 }), t(), ye = () => {
3418
+ }, t = () => window.requestAnimationFrame(e), n = pr(T.value?.view.dom ?? null);
3419
+ window.addEventListener("scroll", t, { passive: !0 }), window.addEventListener("resize", t), n?.addEventListener("scroll", t, { passive: !0 }), t(), be = () => {
3412
3420
  window.removeEventListener("scroll", t), window.removeEventListener("resize", t), n?.removeEventListener("scroll", t);
3413
3421
  };
3414
3422
  }), K(() => {
3415
- ye?.(), w.value?.destroy(), w.value = null;
3423
+ be?.(), w.value?.destroy(), w.value = null;
3416
3424
  }), {
3417
3425
  editor: T,
3418
- runtimeSnapshot: me,
3419
- actions: he,
3426
+ runtimeSnapshot: he,
3427
+ actions: ge,
3420
3428
  __render: {
3421
3429
  messages: r,
3422
3430
  effectiveEditable: o,
3423
- tableFocusState: I,
3431
+ tableFocusState: ne,
3424
3432
  tableInteractionState: y,
3425
3433
  codeBlockState: M,
3426
- isCodeBlockActive: L,
3434
+ isCodeBlockActive: I,
3427
3435
  mermaidMode: _,
3428
3436
  mathTarget: v,
3429
3437
  setMermaidMode: (e) => {
3430
3438
  _.value = e;
3431
3439
  },
3432
- tocState: se,
3433
- filteredSlashCommands: pe,
3440
+ tocState: ce,
3441
+ filteredSlashCommands: me,
3434
3442
  slashState: d,
3435
3443
  slashMenuPosition: h,
3436
3444
  slashInputCommand: g,
@@ -3442,7 +3450,7 @@ function Er(e = {}) {
3442
3450
  }
3443
3451
  };
3444
3452
  }
3445
- var Dr = J({
3453
+ var kr = J({
3446
3454
  name: "MarkweaveEditor",
3447
3455
  props: {
3448
3456
  defaultContent: {
@@ -3473,6 +3481,10 @@ var Dr = J({
3473
3481
  type: Boolean,
3474
3482
  default: !0
3475
3483
  },
3484
+ innerTocPlacement: {
3485
+ type: String,
3486
+ default: "container"
3487
+ },
3476
3488
  autofocus: {
3477
3489
  type: Boolean,
3478
3490
  default: !1
@@ -3531,26 +3543,27 @@ var Dr = J({
3531
3543
  }
3532
3544
  },
3533
3545
  setup(e) {
3534
- let t = Er(e);
3546
+ let t = Or(e);
3535
3547
  return () => {
3536
3548
  let n = t.editor.value;
3537
3549
  if (!n) return null;
3538
3550
  let i = t.__render;
3539
- return V("section", {
3551
+ return B("section", {
3540
3552
  class: ["markweave-editor-frame", e.className].filter(Boolean).join(" "),
3541
3553
  "aria-label": e.ariaLabel ?? i.messages.common.editorAriaLabel,
3542
3554
  "data-testid": "markweave-editor-frame",
3543
3555
  "data-markweave-mode": t.runtimeSnapshot.value.mode,
3544
3556
  "data-markweave-inner-toc": e.innerToc ? "true" : "false",
3557
+ "data-markweave-inner-toc-placement": me(e.innerTocPlacement),
3545
3558
  "data-mermaid-mode": t.runtimeSnapshot.value.mermaid.mode,
3546
3559
  "data-table-focus-mode": i.tableFocusState.value.mode,
3547
3560
  onKeydownCapture: i.handleEditorKeyDown
3548
3561
  }, [
3549
- i.effectiveEditable.value ? V(yr, {
3562
+ i.effectiveEditable.value ? B(xr, {
3550
3563
  editor: n,
3551
3564
  messages: i.messages
3552
3565
  }) : null,
3553
- i.effectiveEditable.value ? V(xr, {
3566
+ i.effectiveEditable.value ? B(Cr, {
3554
3567
  commands: i.filteredSlashCommands.value,
3555
3568
  state: i.slashState.value,
3556
3569
  position: i.slashMenuPosition.value,
@@ -3560,7 +3573,7 @@ var Dr = J({
3560
3573
  onInputCommandChange: i.setSlashInputCommand,
3561
3574
  onUpload: e.onSlashCommandUpload
3562
3575
  }) : null,
3563
- i.effectiveEditable.value ? V(Sr, {
3576
+ i.effectiveEditable.value ? B(wr, {
3564
3577
  editor: n,
3565
3578
  active: i.tableFocusState.value.active,
3566
3579
  interactionState: i.tableInteractionState.value,
@@ -3569,11 +3582,11 @@ var Dr = J({
3569
3582
  onCommandResult: e.onTableCommandResult,
3570
3583
  onEditWithAi: e.onEditWithAi
3571
3584
  }) : null,
3572
- i.effectiveEditable.value ? V(Cr, {
3585
+ i.effectiveEditable.value ? B(Tr, {
3573
3586
  editor: n,
3574
3587
  focusState: i.tableFocusState.value
3575
3588
  }) : null,
3576
- V(wr, {
3589
+ B(Er, {
3577
3590
  editor: n,
3578
3591
  state: i.codeBlockState.value,
3579
3592
  active: i.effectiveEditable.value && i.isCodeBlockActive.value,
@@ -3581,22 +3594,23 @@ var Dr = J({
3581
3594
  onMermaidModeChange: i.setMermaidMode,
3582
3595
  readOnly: !i.effectiveEditable.value
3583
3596
  }),
3584
- e.innerToc && i.tocState.value.items.length ? V(Tr, {
3597
+ e.innerToc && i.tocState.value.items.length ? B(Dr, {
3585
3598
  editor: n,
3586
3599
  state: i.tocState.value,
3587
3600
  messages: i.messages,
3588
- editable: i.effectiveEditable.value
3601
+ editable: i.effectiveEditable.value,
3602
+ placement: me(e.innerTocPlacement)
3589
3603
  }) : null,
3590
- i.effectiveEditable.value && i.mathTarget.value ? V(br, {
3604
+ i.effectiveEditable.value && i.mathTarget.value ? B(Sr, {
3591
3605
  editor: n,
3592
3606
  messages: i.messages,
3593
3607
  target: i.mathTarget.value,
3594
3608
  onClose: () => i.mathTarget.value = null
3595
3609
  }) : null,
3596
- V(r, { editor: n })
3610
+ B(r, { editor: n })
3597
3611
  ]);
3598
3612
  };
3599
3613
  }
3600
3614
  });
3601
3615
  //#endregion
3602
- export { Dr as MarkweaveEditor, sr as createMarkweaveEditorExtensions, sr as createMarkweaveVue2EditorExtensions, Er as useMarkweaveEditorController };
3616
+ export { kr as MarkweaveEditor, lr as createMarkweaveEditorExtensions, lr as createMarkweaveVue2EditorExtensions, Or as useMarkweaveEditorController };