@markweave/vue2 0.5.1 → 0.5.2

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
@@ -10,55 +10,58 @@ import { normalizeMarkweaveLinkCardAttrs as _, normalizeMarkweaveLinkCardHref as
10
10
  import { openMarkweaveImagePreview as b } from "markweave/internal/plugins/media/image-preview";
11
11
  import { createMarkweaveLightweightImageNodeViewRenderer as x } from "markweave/internal/plugins/media/lightweight-image-node-view";
12
12
  import { resolveMarkweaveMediaSource as S } from "markweave/internal/plugins/media/media-source";
13
- import { MarkweaveCoreImage as C, MarkweaveCoreVideo as w, attrsFromMarkweaveImageUploadResult as T, attrsFromMarkweaveVideoUploadResult as E, attrsFromMarkweaveVideoUrl as D, clampMarkweaveImageWidth as O, createMarkweaveImageUploadRequest as k, createMarkweaveVideoUploadRequest as A, downloadMarkweaveImage as j, markweaveVideoIframeAllow as M, normalizeMarkweaveCoreImageAlign as ee, normalizeMarkweaveVideoEmbedUrl as N, numberAttribute as P, stringAttribute as F } from "markweave/internal/plugins/media/core-media-nodes";
14
- import { detectUploadSource as I, getDirectUploadResult as L, resolveMarkweaveUploadResult as R } from "markweave/internal/plugins/slash-command/upload";
15
- import { createMarkweaveAiEditController as te } from "markweave";
16
- import { BubbleMenu as z } from "@tiptap/vue-2/menus";
17
- import { isEditorComposing as B } from "markweave/internal/editor-core/composition-guard";
18
- import { saveMarkweaveBrowserFile as V } from "markweave/internal/core/browser-file-save";
19
- import { createMarkweaveFrameScheduler as H } from "markweave/internal/editor-core/frame-scheduler";
20
- import { createMarkweaveEditorUpdatePayload as U, getMarkweaveContentType as ne, isEditorContentCurrent as re, isMarkweaveControlledContentEchoCurrent as ie, normalizeMarkweaveContentFormat as W } from "markweave/internal/editor-core/editor-content";
21
- import { getCurrentFloatingToolbarBlockType as ae, getFloatingToolbarHighlightColorOptions as oe, getFloatingToolbarMoreActions as se, getFloatingToolbarTextColorOptions as ce, getFloatingToolbarTurnIntoOptions as le, runFloatingToolbarMoreAction as ue, setFloatingToolbarTurnInto as de } from "markweave/internal/editor-core/floating-toolbar-model";
22
- import { openMarkweaveReadonlyLinkFromEvent as fe } from "markweave/internal/editor-core/readonly-link";
23
- import { createMarkweaveEditorRuntimeSnapshot as pe } from "markweave/internal/editor-core/runtime-snapshot";
24
- import { areEditorSelectionSnapshotsEquivalent as me, calculateFloatingToolbarPopoverPlacement as he, createSelectionSnapshot as ge, markweaveRuntimeProjectionDelayMs as _e, shouldShowFloatingToolbarForAiState as ve } from "markweave/internal/editor-core/selection-state";
25
- import { normalizeMarkweaveCanvasColor as ye, normalizeMarkweaveTheme as be } from "markweave/internal/core/theme";
26
- import { createMarkweaveAiEditController as xe } from "markweave/internal/plugins/ai-edit/ai-edit-controller";
27
- import { MarkweaveAskAiError as Se, acceptMarkweaveAskAiResult as Ce, calculateMarkweaveAskAiPanelPosition as we, canStartMarkweaveAskAiTableTarget as Te, clearMarkweaveAskAiPreview as Ee, clearMarkweaveAskAiTarget as De, createMarkweaveAskAiRequest as Oe, getMappedMarkweaveAskAiSelection as ke, getMarkweaveAskAiSurfaceRect as Ae, getMarkweaveAskAiTarget as je, getMarkweaveAskAiTargetRect as Me, hasMarkweaveAskAiPreview as Ne, isMarkweaveAskAiSelectionEligible as Pe, restoreMarkweaveAskAiTargetSelection as Fe, runMarkweaveAskAiHandler as Ie, setMarkweaveAskAiPreview as Le, startMarkweaveAskAiTableTarget as Re, startMarkweaveAskAiTarget as ze } from "markweave/internal/plugins/ask-ai/ask-ai-session";
28
- import { createMarkweaveTocState as Be, emptyMarkweaveTocState as Ve, getActiveMarkweaveTocId as He, getMarkweaveInnerTocRailHeight as Ue, getMarkweaveTocItemsFromState as We, getValidMarkweaveTocActiveId as Ge, normalizeMarkweaveInnerTocPlacement as Ke, observeMarkweaveInnerTocContainerPosition as qe, observeMarkweaveInnerTocRailOverflow as Je, scrollToMarkweaveTocItem as Ye } from "markweave/internal/core/toc-state";
29
- import { codeBlockCollapsePluginKey as Xe, copyActiveCodeBlock as Ze, getActiveCodeBlockState as Qe, getCodeBlockCopyFeedbackSnapshot as $e, markweaveCodeBlockBehavior as et, setCodeBlockCollapsedAtPosition as tt, setCodeBlockLanguageAtPosition as nt, setCodeBlockMermaidPreviewModeAtPosition as rt } from "markweave/internal/plugins/codeblock/codeblock-behavior";
30
- import { calculateCodeBlockLanguageMenuPosition as it, clampFullscreenScale as at, codeBlockCopyFeedbackTimeoutMs as ot, copyCodeBlockText as st, createCodeBlockLanguageMenuDomId as ct, createCodeBlockOverlayPosition as lt, createMermaidFullscreenViewerState as ut, createMermaidTabPosition as dt, focusCodeBlockTarget as ft, formatCodeBlockLanguageLabel as pt, formatFullscreenZoom as mt, getActiveCodeBlockElement as ht, getAnchoredRect as gt, getCodeBlockLanguageItems as _t, getCodeBlockLanguageOptionDomId as vt, getCodeBlockPositionFromEventTarget as yt, getCodeBlockStateAtPosition as bt, getFrameElement as xt, getInitialCodeBlockLanguageItemIndex as St, getMermaidCodeBlockTargets as Ct, getMermaidSvgMarkup as wt, isCodeBlockTargetCollapsed as Tt, mergeStableMermaidTabPositions as Et, mermaidFullscreenZoomStep as Dt, moveCodeBlockLanguageItemIndex as Ot, moveMermaidFullscreenViewer as kt, scrollCodeBlockLanguageItemIntoView as At } from "markweave/internal/plugins/codeblock/codeblock-ui-model";
31
- import { normalizeMarkdownLinkHref as jt } from "markweave/internal/plugins/markdown/markdown-input";
32
- import { applyMarkweaveMathLatex as Mt, calculateMarkweaveMathPopoverPosition as Nt, getMarkweaveMathAnchorRect as Pt, getMarkweaveMathBlockIndex as Ft, getMarkweaveMathRenderedHtml as It, getMarkweaveMathTargetAtPos as Lt, getMarkweaveMathTargetFromDomEvent as Rt, getMarkweaveMathTargetFromSelection as zt, renderMarkweaveMathPreview as Bt, setMarkweaveMathEditingDomState as Vt, setMarkweaveMathEditingDomStateInView as Ht, setMarkweaveMathSelectionInView as Ut } from "markweave/internal/plugins/math/math-ui-model";
33
- import { isMermaidInlinePreviewTransaction as Wt, setMarkweaveMermaidTheme as Gt, setMermaidInlinePreviewEditorMode as Kt, setReadonlyMermaidPreviewMode as qt } from "markweave/internal/plugins/mermaid/mermaid-inline-preview";
34
- import { getMermaidPreviewState as Jt } from "markweave/internal/plugins/mermaid/mermaid-renderer";
35
- import { filterSlashCommands as Yt, isExecutableSlashCommand as Xt } from "markweave/internal/plugins/slash-command/command-spec";
36
- import { getSlashCommandKeyboardAction as Zt } from "markweave/internal/plugins/slash-command/slash-keyboard";
37
- import { areSlashCommandMenuPositionsEquivalent as Qt, executeSlashCommand as $t, getNextSlashCommandState as en, getSlashCommandAnchoredMenuPosition as tn, getSlashCommandContext as nn, isSlashCommandAnchorVisible as rn } from "markweave/internal/plugins/slash-command/slash-runtime";
38
- import { initialSlashCommandState as an, reduceSlashCommandState as on } from "markweave/internal/plugins/slash-command/slash-state";
39
- import { setMarkweaveTableMenuAxisTarget as sn } from "markweave/internal/plugins/table/table-clipboard";
40
- import { getFirstTableDebugSnapshot as cn } from "markweave/internal/plugins/table/table-debug-snapshot";
41
- import { focusFirstTableBodyCell as ln } from "markweave/internal/plugins/table/table-focus-position";
42
- import { getTableFocusState as un } from "markweave/internal/plugins/table/table-focus-state";
43
- import { getTableSelectionOverlayState as dn, initialTableInteractionState as fn, tableInteractionPluginKey as pn } from "markweave/internal/plugins/table/table-interaction-layer";
44
- import { applyTableAxisAlignment as mn, applyTableAxisBackgroundColor as hn, applyTableAxisTextColor as gn, calculateAnchoredTableMenuPosition as _n, calculateAnchoredTableSubmenuPosition as vn, calculateTableAxisHandleLayout as yn, calculateTableExtendButtonLayout as bn, canRunTableCommand as xn, executeTableMenuCommand as Sn, formatTableCopyFeedback as Cn, getActiveTableElement as wn, getAvailableCellMenuCommandSpecs as Tn, getTableAxisDropIndexAtPoint as En, getTableAxisFormattingState as Dn, getTableAxisTargetRect as On, getTableControlAxisSelectionModel as kn, getTableMenuBoundaryRect as An, getTableMenuItemGroup as jn, getTableMenuItemLabel as Mn, getTableMenuItems as Nn, getTableSelectionTargetRect as Pn, measureTableSelectionOverlay as Fn, moveTargetedTableAxis as In, selectTableAxisFromCell as Ln, tableColorOptions as Rn, tableCopyFeedbackTimeoutMs as zn, tableHorizontalAlignmentOptions as Bn, tableMenuLabel as Vn, tableVerticalAlignmentOptions as Hn, targetTableAxisFromCell as Un } from "markweave/internal/plugins/table/table-ui-model";
13
+ import { MarkweaveCoreImage as C, MarkweaveCoreVideo as w, attrsFromMarkweaveImageUploadResult as T, attrsFromMarkweaveVideoUploadResult as E, attrsFromMarkweaveVideoUrl as D, clampMarkweaveImageWidth as O, createMarkweaveImageUploadRequest as k, createMarkweaveVideoUploadRequest as A, downloadMarkweaveImage as j, markweaveVideoIframeAllow as ee, normalizeMarkweaveCoreImageAlign as te, normalizeMarkweaveVideoEmbedUrl as M, numberAttribute as N, stringAttribute as P } from "markweave/internal/plugins/media/core-media-nodes";
14
+ import { activateMarkweaveAttachmentDownload as F, attrsFromMarkweaveAttachmentUploadResult as I, createMarkweaveAttachmentRefFromAttrs as L, createMarkweaveAttachmentUploadRequest as R, formatMarkweaveAttachmentSize as z } from "markweave/internal/plugins/media/attachment-download";
15
+ import { MarkweaveAttachment as B } from "markweave/internal/plugins/media/media-nodes";
16
+ import { detectUploadSource as V, getDirectUploadResult as H, resolveMarkweaveUploadResult as ne } from "markweave/internal/plugins/slash-command/upload";
17
+ import { createMarkweaveAiEditController as re } from "markweave";
18
+ import { BubbleMenu as ie } from "@tiptap/vue-2/menus";
19
+ import { isEditorComposing as ae } from "markweave/internal/editor-core/composition-guard";
20
+ import { saveMarkweaveBrowserFile as oe } from "markweave/internal/core/browser-file-save";
21
+ import { createMarkweaveFrameScheduler as se } from "markweave/internal/editor-core/frame-scheduler";
22
+ import { createMarkweaveEditorUpdatePayload as ce, getMarkweaveContentType as le, isEditorContentCurrent as ue, isMarkweaveControlledContentEchoCurrent as de, normalizeMarkweaveContentFormat as fe } from "markweave/internal/editor-core/editor-content";
23
+ import { getCurrentFloatingToolbarBlockType as pe, getFloatingToolbarHighlightColorOptions as me, getFloatingToolbarMoreActions as he, getFloatingToolbarTextColorOptions as ge, getFloatingToolbarTurnIntoOptions as _e, runFloatingToolbarMoreAction as ve, setFloatingToolbarTurnInto as ye } from "markweave/internal/editor-core/floating-toolbar-model";
24
+ import { openMarkweaveReadonlyLinkFromEvent as be } from "markweave/internal/editor-core/readonly-link";
25
+ import { createMarkweaveEditorRuntimeSnapshot as xe } from "markweave/internal/editor-core/runtime-snapshot";
26
+ import { areEditorSelectionSnapshotsEquivalent as Se, calculateFloatingToolbarPopoverPlacement as Ce, createSelectionSnapshot as we, markweaveRuntimeProjectionDelayMs as Te, shouldShowFloatingToolbarForAiState as Ee } from "markweave/internal/editor-core/selection-state";
27
+ import { normalizeMarkweaveCanvasColor as De, normalizeMarkweaveTheme as Oe } from "markweave/internal/core/theme";
28
+ import { createMarkweaveAiEditController as ke } from "markweave/internal/plugins/ai-edit/ai-edit-controller";
29
+ import { MarkweaveAskAiError as Ae, acceptMarkweaveAskAiResult as je, calculateMarkweaveAskAiPanelPosition as Me, canStartMarkweaveAskAiTableTarget as Ne, clearMarkweaveAskAiPreview as Pe, clearMarkweaveAskAiTarget as Fe, createMarkweaveAskAiRequest as Ie, getMappedMarkweaveAskAiSelection as Le, getMarkweaveAskAiSurfaceRect as Re, getMarkweaveAskAiTarget as ze, getMarkweaveAskAiTargetRect as Be, hasMarkweaveAskAiPreview as Ve, isMarkweaveAskAiSelectionEligible as He, restoreMarkweaveAskAiTargetSelection as Ue, runMarkweaveAskAiHandler as We, setMarkweaveAskAiPreview as Ge, startMarkweaveAskAiTableTarget as Ke, startMarkweaveAskAiTarget as qe } from "markweave/internal/plugins/ask-ai/ask-ai-session";
30
+ import { createMarkweaveTocState as Je, emptyMarkweaveTocState as Ye, getActiveMarkweaveTocId as Xe, getMarkweaveInnerTocRailHeight as Ze, getMarkweaveTocItemsFromState as Qe, getValidMarkweaveTocActiveId as $e, normalizeMarkweaveInnerTocPlacement as et, observeMarkweaveInnerTocContainerPosition as tt, observeMarkweaveInnerTocRailOverflow as nt, scrollToMarkweaveTocItem as rt } from "markweave/internal/core/toc-state";
31
+ import { codeBlockCollapsePluginKey as it, copyActiveCodeBlock as at, getActiveCodeBlockState as ot, getCodeBlockCopyFeedbackSnapshot as st, markweaveCodeBlockBehavior as ct, setCodeBlockCollapsedAtPosition as lt, setCodeBlockLanguageAtPosition as ut, setCodeBlockMermaidPreviewModeAtPosition as dt } from "markweave/internal/plugins/codeblock/codeblock-behavior";
32
+ import { calculateCodeBlockLanguageMenuPosition as ft, clampFullscreenScale as pt, codeBlockCopyFeedbackTimeoutMs as mt, copyCodeBlockText as ht, createCodeBlockLanguageMenuDomId as gt, createCodeBlockOverlayPosition as _t, createMermaidFullscreenViewerState as vt, createMermaidTabPosition as yt, focusCodeBlockTarget as bt, formatCodeBlockLanguageLabel as xt, formatFullscreenZoom as St, getActiveCodeBlockElement as Ct, getAnchoredRect as wt, getCodeBlockLanguageItems as Tt, getCodeBlockLanguageOptionDomId as Et, getCodeBlockPositionFromEventTarget as Dt, getCodeBlockStateAtPosition as Ot, getFrameElement as kt, getInitialCodeBlockLanguageItemIndex as At, getMermaidCodeBlockTargets as jt, getMermaidSvgMarkup as Mt, isCodeBlockTargetCollapsed as Nt, mergeStableMermaidTabPositions as Pt, mermaidFullscreenZoomStep as Ft, moveCodeBlockLanguageItemIndex as It, moveMermaidFullscreenViewer as Lt, scrollCodeBlockLanguageItemIntoView as Rt } from "markweave/internal/plugins/codeblock/codeblock-ui-model";
33
+ import { normalizeMarkdownLinkHref as zt } from "markweave/internal/plugins/markdown/markdown-input";
34
+ import { applyMarkweaveMathLatex as Bt, calculateMarkweaveMathPopoverPosition as Vt, getMarkweaveMathAnchorRect as Ht, getMarkweaveMathBlockIndex as Ut, getMarkweaveMathRenderedHtml as Wt, getMarkweaveMathTargetAtPos as Gt, getMarkweaveMathTargetFromDomEvent as Kt, getMarkweaveMathTargetFromSelection as qt, renderMarkweaveMathPreview as Jt, setMarkweaveMathEditingDomState as Yt, setMarkweaveMathEditingDomStateInView as Xt, setMarkweaveMathSelectionInView as Zt } from "markweave/internal/plugins/math/math-ui-model";
35
+ import { isMermaidInlinePreviewTransaction as Qt, setMarkweaveMermaidTheme as $t, setMermaidInlinePreviewEditorMode as en, setReadonlyMermaidPreviewMode as tn } from "markweave/internal/plugins/mermaid/mermaid-inline-preview";
36
+ import { getMermaidPreviewState as nn } from "markweave/internal/plugins/mermaid/mermaid-renderer";
37
+ import { filterSlashCommands as rn, isExecutableSlashCommand as an } from "markweave/internal/plugins/slash-command/command-spec";
38
+ import { getSlashCommandKeyboardAction as on } from "markweave/internal/plugins/slash-command/slash-keyboard";
39
+ import { scrollSlashCommandItemIntoView as sn } from "markweave/internal/plugins/slash-command/slash-menu-scroll";
40
+ import { areSlashCommandMenuPositionsEquivalent as cn, executeSlashCommand as ln, getNextSlashCommandState as un, getSlashCommandAnchoredMenuPosition as dn, getSlashCommandContext as fn, isMarkweaveSlashMenuScrollTarget as pn, isSlashCommandAnchorVisible as mn } from "markweave/internal/plugins/slash-command/slash-runtime";
41
+ import { initialSlashCommandState as hn, reduceSlashCommandState as gn } from "markweave/internal/plugins/slash-command/slash-state";
42
+ import { setMarkweaveTableMenuAxisTarget as _n } from "markweave/internal/plugins/table/table-clipboard";
43
+ import { getFirstTableDebugSnapshot as vn } from "markweave/internal/plugins/table/table-debug-snapshot";
44
+ import { focusFirstTableBodyCell as yn } from "markweave/internal/plugins/table/table-focus-position";
45
+ import { getTableFocusState as bn } from "markweave/internal/plugins/table/table-focus-state";
46
+ import { getTableSelectionOverlayState as xn, initialTableInteractionState as Sn, tableInteractionPluginKey as Cn } from "markweave/internal/plugins/table/table-interaction-layer";
47
+ import { applyTableAxisAlignment as wn, applyTableAxisBackgroundColor as Tn, applyTableAxisTextColor as En, calculateAnchoredTableMenuPosition as Dn, calculateAnchoredTableSubmenuPosition as On, calculateTableAxisHandleLayout as kn, calculateTableExtendButtonLayout as An, canRunTableCommand as jn, executeTableMenuCommand as Mn, formatTableCopyFeedback as Nn, getActiveTableElement as Pn, getAvailableCellMenuCommandSpecs as Fn, getTableAxisDropIndexAtPoint as In, getTableAxisFormattingState as Ln, getTableAxisTargetRect as Rn, getTableControlAxisSelectionModel as zn, getTableMenuBoundaryRect as Bn, getTableMenuItemGroup as Vn, getTableMenuItemLabel as Hn, getTableMenuItems as Un, getTableSelectionTargetRect as Wn, measureTableSelectionOverlay as Gn, moveTargetedTableAxis as Kn, selectTableAxisFromCell as qn, tableColorOptions as Jn, tableCopyFeedbackTimeoutMs as Yn, tableHorizontalAlignmentOptions as Xn, tableMenuLabel as Zn, tableVerticalAlignmentOptions as Qn, targetTableAxisFromCell as $n } from "markweave/internal/plugins/table/table-ui-model";
45
48
  //#region src/vue2-compat.ts
46
- var Wn = l.default ?? l, Gn = null, Kn = null, qn = null;
47
- function Jn(e) {
49
+ var er = l.default ?? l, tr = null, nr = null, rr = null;
50
+ function ir(e) {
48
51
  return !!(e && typeof e == "object" && "value" in e);
49
52
  }
50
- function Yn(e) {
53
+ function ar(e) {
51
54
  let t = e.slice(2);
52
55
  return t.endsWith("Capture") ? `!${t.slice(0, -7).replace(/^[A-Z]/, (e) => e.toLowerCase())}` : t.replace(/^[A-Z]/, (e) => e.toLowerCase());
53
56
  }
54
- function Xn(e) {
57
+ function or(e) {
55
58
  let t = {}, n = {}, r = {}, i = {}, a = {};
56
59
  for (let [o, s] of Object.entries(e)) if (s !== void 0) {
57
60
  if (o === "class" || o === "style" || o === "key") {
58
61
  t[o] = s;
59
62
  continue;
60
63
  }
61
- if (o === "ref" && Jn(s)) {
64
+ if (o === "ref" && ir(s)) {
62
65
  a.insert = (e) => {
63
66
  s.value = e.elm;
64
67
  }, a.destroy = () => {
@@ -67,7 +70,7 @@ function Xn(e) {
67
70
  continue;
68
71
  }
69
72
  if (/^on[A-Z]/.test(o)) {
70
- i[Yn(o)] = s;
73
+ i[ar(o)] = s;
71
74
  continue;
72
75
  }
73
76
  if (o === "value" || o === "checked" || o === "innerHTML" || o === "textContent") {
@@ -78,14 +81,14 @@ function Xn(e) {
78
81
  }
79
82
  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;
80
83
  }
81
- function Zn(e) {
84
+ function sr(e) {
82
85
  let t = {}, n = {}, r = {}, i = {};
83
86
  for (let [a, o] of Object.entries(e)) if (o !== void 0) {
84
87
  if (a === "class" || a === "style" || a === "key") {
85
88
  t[a] = o;
86
89
  continue;
87
90
  }
88
- if (a === "ref" && Jn(o)) {
91
+ if (a === "ref" && ir(o)) {
89
92
  i.insert = (e) => {
90
93
  o.value = e.componentInstance ?? e.elm;
91
94
  }, i.destroy = () => {
@@ -101,47 +104,47 @@ function Zn(e) {
101
104
  }
102
105
  return Object.keys(n).length && (t.props = n), Object.keys(r).length && (t.attrs = r), Object.keys(i).length && (t.hook = i), t;
103
106
  }
104
- function Qn(e) {
107
+ function cr(e) {
105
108
  return !!(e && typeof e == "object" && "default" in e && typeof e.default == "function");
106
109
  }
107
- function $n(e) {
110
+ function lr(e) {
108
111
  return !!(e && typeof e == "object" && ("tag" in e || "text" in e || "elm" in e || "componentOptions" in e || "componentInstance" in e));
109
112
  }
110
- function er(e) {
113
+ function ur(e) {
111
114
  return e == null || Array.isArray(e) ? e : [e];
112
115
  }
113
- function tr(e) {
114
- return typeof e == "function" ? er(e()) : Qn(e) ? er(e.default()) : $n(e) ? [e] : e;
116
+ function dr(e) {
117
+ return typeof e == "function" ? ur(e()) : cr(e) ? ur(e.default()) : lr(e) ? [e] : e;
115
118
  }
116
- function G(e, t, n) {
117
- if (!qn) throw Error("Vue 2 render context is not available.");
118
- let r = t && typeof t == "object" && !Array.isArray(t) ? t : {}, i = typeof e == "string" ? Xn(r) : Zn(r), a = arguments.length === 2 && (Array.isArray(t) || typeof t == "string") ? t : tr(n);
119
- return qn(e, i, a);
119
+ function U(e, t, n) {
120
+ if (!rr) throw Error("Vue 2 render context is not available.");
121
+ let r = t && typeof t == "object" && !Array.isArray(t) ? t : {}, i = typeof e == "string" ? or(r) : sr(r), a = arguments.length === 2 && (Array.isArray(t) || typeof t == "string") ? t : dr(n);
122
+ return rr(e, i, a);
120
123
  }
121
- function K(e) {
122
- return Wn.observable({ value: e });
124
+ function W(e) {
125
+ return er.observable({ value: e });
123
126
  }
124
- var nr = K;
125
- function q(e) {
127
+ var G = W;
128
+ function K(e) {
126
129
  return { get value() {
127
130
  return e();
128
131
  } };
129
132
  }
130
- function J(e, t, n) {
133
+ function q(e, t, n) {
131
134
  let r = typeof e == "function" ? e : () => e.value;
132
- return Gn?.$watch ? Gn.$watch(r, t, n) : () => void 0;
135
+ return tr?.$watch ? tr.$watch(r, t, n) : () => void 0;
133
136
  }
134
- function rr(e) {
135
- Kn?.mounted.push(e);
137
+ function fr(e) {
138
+ nr?.mounted.push(e);
136
139
  }
137
- function ir(e) {
138
- Kn?.beforeUnmount.push(e);
140
+ function J(e) {
141
+ nr?.beforeUnmount.push(e);
139
142
  }
140
143
  function Y(e) {
141
- return Wn.nextTick(e);
144
+ return er.nextTick(e);
142
145
  }
143
146
  function X(e) {
144
- return Wn.extend({
147
+ return er.extend({
145
148
  name: e.name,
146
149
  props: e.props,
147
150
  created() {
@@ -149,12 +152,12 @@ function X(e) {
149
152
  mounted: [],
150
153
  beforeUnmount: []
151
154
  };
152
- Gn = this, Kn = t;
155
+ tr = this, nr = t;
153
156
  try {
154
157
  let n = e.setup?.(this.$props ?? this) ?? null;
155
158
  this.__markweaveVue2Render = typeof n == "function" ? n : null, this.__markweaveVue2Lifecycle = t;
156
159
  } finally {
157
- Gn = null, Kn = null;
160
+ tr = null, nr = null;
158
161
  }
159
162
  },
160
163
  mounted() {
@@ -164,19 +167,19 @@ function X(e) {
164
167
  this.__markweaveVue2Lifecycle?.beforeUnmount.forEach((e) => e());
165
168
  },
166
169
  render(t) {
167
- qn = t;
170
+ rr = t;
168
171
  try {
169
172
  let n = this.__markweaveVue2Render;
170
173
  return n ? n() : e.render?.(t) ?? null;
171
174
  } finally {
172
- qn = null;
175
+ rr = null;
173
176
  }
174
177
  }
175
178
  });
176
179
  }
177
180
  //#endregion
178
181
  //#region src/vue2-icons.ts
179
- var ar = {
182
+ var pr = {
180
183
  AlignVerticalJustifyCenter: {
181
184
  iconName: "align-vertical-justify-center",
182
185
  node: [
@@ -1498,8 +1501,8 @@ var ar = {
1498
1501
  }]]
1499
1502
  }
1500
1503
  };
1501
- function or(e) {
1502
- return e.map(([e, t]) => G(e, t));
1504
+ function mr(e) {
1505
+ return e.map(([e, t]) => U(e, t));
1503
1506
  }
1504
1507
  function Z(e) {
1505
1508
  return X({
@@ -1519,8 +1522,8 @@ function Z(e) {
1519
1522
  }
1520
1523
  },
1521
1524
  setup(t) {
1522
- let n = ar[e];
1523
- return () => G("svg", {
1525
+ let n = pr[e];
1526
+ return () => U("svg", {
1524
1527
  class: `lucide lucide-${n.iconName}`,
1525
1528
  viewBox: "0 0 24 24",
1526
1529
  width: t.size,
@@ -1532,12 +1535,12 @@ function Z(e) {
1532
1535
  "stroke-width": t.absoluteStrokeWidth && t.size ? Number(t.strokeWidth) * 24 / Number(t.size) : t.strokeWidth,
1533
1536
  "aria-hidden": "true",
1534
1537
  focusable: "false"
1535
- }, or(n.node));
1538
+ }, mr(n.node));
1536
1539
  }
1537
1540
  });
1538
1541
  }
1539
- var sr = Z("AlignCenter"), cr = Z("AlignJustify"), lr = Z("AlignLeft"), ur = Z("AlignRight"), dr = Z("AlignVerticalJustifyCenter"), fr = Z("AlignVerticalJustifyEnd"), pr = Z("AlignVerticalJustifyStart"), mr = Z("AlertTriangle"), hr = Z("ArrowDown"), gr = Z("ArrowDownAZ"), _r = Z("ArrowLeft"), vr = Z("ArrowRight"), yr = Z("ArrowUp"), br = Z("ArrowUpZA"), xr = Z("BetweenHorizontalEnd"), Sr = Z("BetweenHorizontalStart"), Cr = Z("BetweenVerticalEnd"), wr = Z("BetweenVerticalStart"), Tr = Z("Bold"), Er = Z("Braces"), Dr = Z("Captions"), Or = Z("Check"), kr = Z("CheckCircle2"), Ar = Z("ChevronDown"), jr = Z("ChevronRight"), Mr = Z("ChevronUp"), Nr = Z("CircleX"), Pr = Z("Code2"), Fr = Z("CornerDownLeft"), Ir = Z("Copy"), Lr = Z("Download"), Rr = Z("Eye"), zr = Z("ExternalLink"), Br = Z("Heading1"), Vr = Z("Heading2"), Hr = Z("Heading3"), Ur = Z("Image"), Wr = Z("ImageUp"), Gr = Z("IndentDecrease"), Kr = Z("IndentIncrease"), qr = Z("Info"), Jr = Z("Italic"), Yr = Z("Lightbulb"), Xr = Z("Link2"), Zr = Z("List"), Qr = Z("ListChecks"), $r = Z("ListOrdered"), ei = Z("Minus"), ti = Z("MoreVertical"), ni = Z("PaintBucket"), ri = Z("Paperclip"), ii = Z("PencilLine"), ai = Z("Plus"), oi = Z("Quote"), si = Z("Replace"), ci = Z("RotateCcw"), li = Z("Sigma"), ui = Z("SmilePlus"), di = Z("Sparkles"), fi = Z("Square"), pi = Z("SquareX"), mi = Z("Strikethrough"), hi = Z("Subscript"), gi = Z("Superscript"), _i = Z("Table2"), vi = Z("TableCellsMerge"), yi = Z("TableCellsSplit"), bi = Z("Text"), xi = Z("Trash2"), Si = Z("Type"), Ci = Z("Underline"), wi = Z("Upload"), Ti = Z("Video"), Ei = Z("X"), Di = ee;
1540
- function Oi(e) {
1542
+ var hr = Z("AlignCenter"), gr = Z("AlignJustify"), _r = Z("AlignLeft"), vr = Z("AlignRight"), yr = Z("AlignVerticalJustifyCenter"), br = Z("AlignVerticalJustifyEnd"), xr = Z("AlignVerticalJustifyStart"), Sr = Z("AlertTriangle"), Cr = Z("ArrowDown"), wr = Z("ArrowDownAZ"), Tr = Z("ArrowLeft"), Er = Z("ArrowRight"), Dr = Z("ArrowUp"), Or = Z("ArrowUpZA"), kr = Z("BetweenHorizontalEnd"), Ar = Z("BetweenHorizontalStart"), jr = Z("BetweenVerticalEnd"), Mr = Z("BetweenVerticalStart"), Nr = Z("Bold"), Pr = Z("Braces"), Fr = Z("Captions"), Ir = Z("Check"), Lr = Z("CheckCircle2"), Rr = Z("ChevronDown"), zr = Z("ChevronRight"), Br = Z("ChevronUp"), Vr = Z("CircleX"), Hr = Z("Code2"), Ur = Z("CornerDownLeft"), Wr = Z("Copy"), Gr = Z("Download"), Kr = Z("Eye"), qr = Z("ExternalLink"), Jr = Z("Heading1"), Yr = Z("Heading2"), Xr = Z("Heading3"), Zr = Z("Image"), Qr = Z("ImageUp"), $r = Z("IndentDecrease"), ei = Z("IndentIncrease"), ti = Z("Info"), ni = Z("Italic"), ri = Z("Lightbulb"), ii = Z("Link2"), ai = Z("List"), oi = Z("ListChecks"), si = Z("ListOrdered"), ci = Z("Minus"), li = Z("MoreVertical"), ui = Z("PaintBucket"), di = Z("Paperclip"), fi = Z("PencilLine"), pi = Z("Plus"), mi = Z("Quote"), hi = Z("Replace"), gi = Z("RotateCcw"), _i = Z("Sigma"), vi = Z("SmilePlus"), yi = Z("Sparkles"), bi = Z("Square"), xi = Z("SquareX"), Si = Z("Strikethrough"), Ci = Z("Subscript"), wi = Z("Superscript"), Ti = Z("Table2"), Ei = Z("TableCellsMerge"), Di = Z("TableCellsSplit"), Oi = Z("Text"), ki = Z("Trash2"), Ai = Z("Type"), ji = Z("Underline"), Mi = Z("Upload"), Ni = Z("Video"), Pi = Z("X"), Fi = te;
1543
+ function Ii(e) {
1541
1544
  let t = e.view.dom.closest(".markweave-editor-frame"), n = () => {
1542
1545
  let n = t?.getAttribute("data-markweave-mode");
1543
1546
  return n === "view" ? {
@@ -1547,7 +1550,7 @@ function Oi(e) {
1547
1550
  mode: "live",
1548
1551
  editable: e.isEditable
1549
1552
  } : u(e);
1550
- }, r = K(n()), i = m(e, () => {
1553
+ }, r = W(n()), i = m(e, () => {
1551
1554
  r.value = n();
1552
1555
  }), a = typeof MutationObserver > "u" || !t ? null : new MutationObserver(() => {
1553
1556
  r.value = n();
@@ -1555,28 +1558,28 @@ function Oi(e) {
1555
1558
  return a && t && a.observe(t, {
1556
1559
  attributes: !0,
1557
1560
  attributeFilter: ["data-markweave-mode"]
1558
- }), ir(() => {
1561
+ }), J(() => {
1559
1562
  i(), a?.disconnect();
1560
1563
  }), r;
1561
1564
  }
1562
- function ki(e) {
1565
+ function Li(e) {
1563
1566
  return e instanceof Element && !!e.closest("[data-markweave-image-ui=\"true\"]");
1564
1567
  }
1565
- function Ai(e) {
1568
+ function Ri(e) {
1566
1569
  return e instanceof Element && !!e.closest("[data-markweave-video-ui=\"true\"], iframe[data-markweave-video-embed], video[data-markweave-video]");
1567
1570
  }
1568
- function ji(e) {
1571
+ function zi(e) {
1569
1572
  return e instanceof Element && !!e.closest("[data-markweave-link-card-ui=\"true\"]");
1570
1573
  }
1571
- function Mi(e, t) {
1572
- return G(e, {
1574
+ function Bi(e, t) {
1575
+ return U(e, {
1573
1576
  size: 18,
1574
1577
  strokeWidth: 1.8,
1575
1578
  "aria-hidden": "true"
1576
1579
  }, { default: () => t });
1577
1580
  }
1578
- function Ni(e) {
1579
- return G("button", {
1581
+ function Vi(e) {
1582
+ return U("button", {
1580
1583
  type: "button",
1581
1584
  "aria-label": e.label,
1582
1585
  title: e.label,
@@ -1584,14 +1587,14 @@ function Ni(e) {
1584
1587
  "data-active": e.active ? "true" : "false",
1585
1588
  onMousedown: (e) => e.preventDefault(),
1586
1589
  onClick: e.onClick
1587
- }, [Mi(e.icon, e.label), G("span", {
1590
+ }, [Bi(e.icon, e.label), U("span", {
1588
1591
  class: "markweave-image-tooltip",
1589
1592
  role: "tooltip"
1590
1593
  }, e.label)]);
1591
1594
  }
1592
- function Pi(e) {
1593
- let t = K(null), n = e.messages.image;
1594
- return G("section", {
1595
+ function Hi(e) {
1596
+ let t = W(null), n = e.messages.image;
1597
+ return U("section", {
1595
1598
  class: "markweave-image-upload-placeholder",
1596
1599
  "data-testid": "markweave-image-upload-placeholder",
1597
1600
  "data-drag-active": e.dragActive ? "true" : "false",
@@ -1609,7 +1612,7 @@ function Pi(e) {
1609
1612
  n && e.onFile(n);
1610
1613
  }
1611
1614
  }, [
1612
- G("input", {
1615
+ U("input", {
1613
1616
  ref: t,
1614
1617
  "data-testid": "markweave-image-file-input",
1615
1618
  type: "file",
@@ -1620,20 +1623,29 @@ function Pi(e) {
1620
1623
  r && e.onFile(r), n.value = "";
1621
1624
  }
1622
1625
  }),
1623
- G("div", {
1624
- class: "markweave-image-upload-icon",
1625
- "aria-hidden": "true"
1626
- }, [G(Wr, {
1627
- size: 46,
1628
- strokeWidth: 1.6
1629
- })]),
1630
- G("div", { class: "markweave-image-upload-copy" }, [G("button", {
1626
+ U("button", {
1631
1627
  type: "button",
1628
+ class: "markweave-image-upload-trigger",
1629
+ "data-testid": "markweave-image-upload-trigger",
1630
+ "aria-label": n.uploadLabel,
1631
+ onMousedown: (e) => e.preventDefault(),
1632
1632
  onClick: () => t.value?.click()
1633
- }, n.clickToUpload), G("span", null, n.dragAndDrop)]),
1634
- G("div", { class: "markweave-image-upload-note" }, n.uploadNote),
1635
- G("div", { class: "markweave-image-upload-row" }, [
1636
- G("input", {
1633
+ }, [
1634
+ U("span", {
1635
+ class: "markweave-image-upload-icon",
1636
+ "aria-hidden": "true"
1637
+ }, [U(Qr, {
1638
+ size: 16,
1639
+ strokeWidth: 1.8
1640
+ })]),
1641
+ U("span", { class: "markweave-image-upload-label" }, n.uploadLabel),
1642
+ U("span", {
1643
+ class: "markweave-image-upload-tooltip",
1644
+ role: "tooltip"
1645
+ }, `${n.clickToUpload}${n.dragAndDrop}. ${n.uploadNote}`)
1646
+ ]),
1647
+ U("div", { class: "markweave-image-upload-row" }, [
1648
+ U("input", {
1637
1649
  "data-testid": "markweave-image-url-input",
1638
1650
  value: e.inputValue,
1639
1651
  placeholder: n.uploadInputPlaceholder,
@@ -1643,30 +1655,30 @@ function Pi(e) {
1643
1655
  t.key === "Enter" && (t.preventDefault(), e.onSubmit());
1644
1656
  }
1645
1657
  }),
1646
- G("button", {
1658
+ U("button", {
1647
1659
  type: "button",
1648
1660
  "data-testid": "markweave-image-upload-submit",
1649
1661
  disabled: e.isSubmitting || !e.inputValue.trim(),
1650
1662
  onClick: e.onSubmit
1651
- }, [G(Wr, {
1663
+ }, [U(Qr, {
1652
1664
  size: 16,
1653
1665
  strokeWidth: 1.8
1654
1666
  }), e.messages.common.insert]),
1655
- G("button", {
1667
+ U("button", {
1656
1668
  type: "button",
1657
1669
  "data-testid": "markweave-image-upload-cancel",
1658
1670
  onClick: e.onCancel
1659
1671
  }, e.messages.common.cancel)
1660
1672
  ]),
1661
- e.error ? G("div", {
1673
+ e.error ? U("div", {
1662
1674
  class: "markweave-image-upload-error",
1663
1675
  role: "alert"
1664
1676
  }, e.error) : null
1665
1677
  ]);
1666
1678
  }
1667
- function Fi(e) {
1668
- let t = K(null), n = e.messages.video;
1669
- return G("section", {
1679
+ function Ui(e) {
1680
+ let t = W(null), n = e.messages.video;
1681
+ return U("section", {
1670
1682
  class: "markweave-video-upload-placeholder",
1671
1683
  "data-testid": "markweave-video-upload-placeholder",
1672
1684
  "data-drag-active": e.dragActive ? "true" : "false",
@@ -1684,7 +1696,7 @@ function Fi(e) {
1684
1696
  n && e.onFile(n);
1685
1697
  }
1686
1698
  }, [
1687
- G("input", {
1699
+ U("input", {
1688
1700
  ref: t,
1689
1701
  "data-testid": "markweave-video-file-input",
1690
1702
  type: "file",
@@ -1695,20 +1707,29 @@ function Fi(e) {
1695
1707
  r && e.onFile(r), n.value = "";
1696
1708
  }
1697
1709
  }),
1698
- G("div", {
1699
- class: "markweave-video-upload-icon",
1700
- "aria-hidden": "true"
1701
- }, [G(Ti, {
1702
- size: 46,
1703
- strokeWidth: 1.6
1704
- })]),
1705
- G("div", { class: "markweave-video-upload-copy" }, [G("button", {
1710
+ U("button", {
1706
1711
  type: "button",
1712
+ class: "markweave-video-upload-trigger",
1713
+ "data-testid": "markweave-video-upload-trigger",
1714
+ "aria-label": n.uploadLabel,
1715
+ onMousedown: (e) => e.preventDefault(),
1707
1716
  onClick: () => t.value?.click()
1708
- }, n.clickToUpload), G("span", null, n.dragAndDrop)]),
1709
- G("div", { class: "markweave-video-upload-note" }, n.uploadNote),
1710
- G("div", { class: "markweave-video-upload-row" }, [
1711
- G("input", {
1717
+ }, [
1718
+ U("span", {
1719
+ class: "markweave-video-upload-icon",
1720
+ "aria-hidden": "true"
1721
+ }, [U(Ni, {
1722
+ size: 16,
1723
+ strokeWidth: 1.8
1724
+ })]),
1725
+ U("span", { class: "markweave-video-upload-label" }, n.uploadLabel),
1726
+ U("span", {
1727
+ class: "markweave-video-upload-tooltip",
1728
+ role: "tooltip"
1729
+ }, `${n.clickToUpload}${n.dragAndDrop}. ${n.uploadNote}`)
1730
+ ]),
1731
+ U("div", { class: "markweave-video-upload-row" }, [
1732
+ U("input", {
1712
1733
  "data-testid": "markweave-video-url-input",
1713
1734
  value: e.inputValue,
1714
1735
  placeholder: n.uploadInputPlaceholder,
@@ -1718,28 +1739,28 @@ function Fi(e) {
1718
1739
  t.key === "Enter" && (t.preventDefault(), e.onSubmit());
1719
1740
  }
1720
1741
  }),
1721
- G("button", {
1742
+ U("button", {
1722
1743
  type: "button",
1723
1744
  "data-testid": "markweave-video-upload-submit",
1724
1745
  disabled: e.isSubmitting || !e.inputValue.trim(),
1725
1746
  onClick: e.onSubmit
1726
- }, [G(wi, {
1747
+ }, [U(Mi, {
1727
1748
  size: 16,
1728
1749
  strokeWidth: 1.8
1729
1750
  }), e.messages.common.insert]),
1730
- G("button", {
1751
+ U("button", {
1731
1752
  type: "button",
1732
1753
  "data-testid": "markweave-video-upload-cancel",
1733
1754
  onClick: e.onCancel
1734
1755
  }, e.messages.common.cancel)
1735
1756
  ]),
1736
- e.error ? G("div", {
1757
+ e.error ? U("div", {
1737
1758
  class: "markweave-video-upload-error",
1738
1759
  role: "alert"
1739
1760
  }, e.error) : null
1740
1761
  ]);
1741
1762
  }
1742
- var Ii = X({
1763
+ var Wi = X({
1743
1764
  name: "MarkweaveVueImageNodeView",
1744
1765
  props: {
1745
1766
  editor: {
@@ -1772,8 +1793,8 @@ var Ii = X({
1772
1793
  }
1773
1794
  },
1774
1795
  setup(e) {
1775
- let t = K(null), r = K(!1), i = K(!1), a = K(!1), o = K(""), c = K(null), l = K(!1), u = q(() => e.node.attrs), f = K(!!F(u.value.caption)), p = K(F(u.value.caption) ?? ""), m = Oi(e.editor), h = q(() => d(m.value)), g = q(() => e.extension.options?.messages ?? n("zh")), _ = q(() => g.value.image), v = q(() => F(u.value.src)), y = q(() => e.extension.options?.resolveMediaSource), x = K(null), C = null;
1776
- J(v, (t) => {
1796
+ let t = W(null), r = W(!1), i = W(!1), a = W(!1), o = W(""), c = W(null), l = W(!1), u = K(() => e.node.attrs), f = W(!!P(u.value.caption)), p = W(P(u.value.caption) ?? ""), m = Ii(e.editor), h = K(() => d(m.value)), g = K(() => e.extension.options?.messages ?? n("zh")), _ = K(() => g.value.image), v = K(() => P(u.value.src)), y = K(() => e.extension.options?.resolveMediaSource), x = W(null), C = null;
1797
+ q(v, (t) => {
1777
1798
  if (C?.abort(), C = null, !t) {
1778
1799
  x.value = null;
1779
1800
  return;
@@ -1792,11 +1813,11 @@ var Ii = X({
1792
1813
  }).then((e) => {
1793
1814
  r.signal.aborted || (x.value = e);
1794
1815
  });
1795
- }, { immediate: !0 }), ir(() => C?.abort());
1796
- let w = q(() => x.value?.src ?? (y.value ? null : v.value)), E = q(() => Di(u.value.align)), D = q(() => P(u.value.width)), A = q(() => F(u.value.caption)), M = q(() => h.value && (!v.value || i.value)), ee = () => {
1816
+ }, { immediate: !0 }), J(() => C?.abort());
1817
+ let w = K(() => x.value?.src ?? (y.value ? null : v.value)), E = K(() => Fi(u.value.align)), D = K(() => N(u.value.width)), A = K(() => P(u.value.caption)), ee = K(() => h.value && (!v.value || i.value)), te = () => {
1797
1818
  w.value && b({
1798
1819
  src: w.value,
1799
- alt: F(u.value.alt) ?? "",
1820
+ alt: P(u.value.alt) ?? "",
1800
1821
  messages: {
1801
1822
  dialogAriaLabel: _.value.previewDialogAriaLabel,
1802
1823
  zoomOut: _.value.previewZoomOut,
@@ -1806,48 +1827,48 @@ var Ii = X({
1806
1827
  }
1807
1828
  });
1808
1829
  };
1809
- J(A, (e) => {
1830
+ q(A, (e) => {
1810
1831
  f.value || (p.value = e ?? "");
1811
1832
  });
1812
- let N = () => {
1833
+ let M = () => {
1813
1834
  if (!h.value) return;
1814
1835
  let t = e.getPos();
1815
1836
  typeof t == "number" && e.editor.chain().focus().setNodeSelection(t).run();
1816
- }, L = () => {
1837
+ }, F = () => {
1817
1838
  if (o.value = "", c.value = null, a.value = !1, v.value) {
1818
1839
  i.value = !1;
1819
1840
  return;
1820
1841
  }
1821
1842
  e.deleteNode();
1822
- }, te = async (t) => {
1843
+ }, I = async (t) => {
1823
1844
  if (!h.value) return;
1824
1845
  let n = e.extension.options;
1825
1846
  l.value = !0, c.value = null;
1826
1847
  try {
1827
- let r = await R(k(t, v.value && i.value ? "image-replace" : "image-insert"), n?.onUpload);
1848
+ let r = await ne(k(t, v.value && i.value ? "image-replace" : "image-insert"), n?.onUpload);
1828
1849
  e.updateAttributes(T(u.value, r)), o.value = "", i.value = !1;
1829
1850
  } catch (e) {
1830
1851
  c.value = e instanceof Error ? e.message : _.value.uploadFailedError;
1831
1852
  } finally {
1832
1853
  l.value = !1, a.value = !1;
1833
1854
  }
1834
- }, z = () => {
1855
+ }, L = () => {
1835
1856
  if (!o.value.trim()) {
1836
1857
  c.value = _.value.uploadRequiredError;
1837
1858
  return;
1838
1859
  }
1839
- te(I(o.value));
1840
- }, B = (e) => {
1841
- te({
1860
+ I(V(o.value));
1861
+ }, R = (e) => {
1862
+ I({
1842
1863
  type: "file",
1843
1864
  file: e,
1844
1865
  mimeType: e.type || "image/*"
1845
1866
  });
1846
- }, V = () => {
1867
+ }, z = () => {
1847
1868
  f.value = !f.value, f.value && (p.value = A.value ?? "");
1848
- }, H = (n, r) => {
1869
+ }, B = (n, r) => {
1849
1870
  if (!h.value || !v.value) return;
1850
- r.preventDefault(), r.stopPropagation(), N();
1871
+ r.preventDefault(), r.stopPropagation(), M();
1851
1872
  let i = t.value;
1852
1873
  if (!i) return;
1853
1874
  let a = r.clientX, o = i.getBoundingClientRect().width || D.value || 320, s = i.closest(".markweave-editor-surface")?.getBoundingClientRect().width ?? i.parentElement?.getBoundingClientRect().width ?? o, c = (t) => {
@@ -1858,7 +1879,7 @@ var Ii = X({
1858
1879
  };
1859
1880
  window.addEventListener("pointermove", c), window.addEventListener("pointerup", l, { once: !0 });
1860
1881
  };
1861
- return () => M.value ? G(s, {
1882
+ return () => ee.value ? U(s, {
1862
1883
  as: "figure",
1863
1884
  class: "markweave-image-node",
1864
1885
  "data-testid": "markweave-image-node",
@@ -1866,7 +1887,7 @@ var Ii = X({
1866
1887
  "data-selected": "false",
1867
1888
  "data-hovered": "false",
1868
1889
  "data-empty": "true"
1869
- }, () => Pi({
1890
+ }, () => Hi({
1870
1891
  messages: g.value,
1871
1892
  inputValue: o.value,
1872
1893
  error: c.value,
@@ -1875,13 +1896,13 @@ var Ii = X({
1875
1896
  onInputValue: (e) => {
1876
1897
  o.value = e;
1877
1898
  },
1878
- onFile: B,
1879
- onSubmit: z,
1880
- onCancel: L,
1899
+ onFile: R,
1900
+ onSubmit: L,
1901
+ onCancel: F,
1881
1902
  onDragActive: (e) => {
1882
1903
  a.value = e;
1883
1904
  }
1884
- })) : G(s, {
1905
+ })) : U(s, {
1885
1906
  as: "figure",
1886
1907
  class: "markweave-image-node",
1887
1908
  "data-testid": "markweave-image-node",
@@ -1896,81 +1917,81 @@ var Ii = X({
1896
1917
  r.value = !1;
1897
1918
  },
1898
1919
  onMousedown: (e) => {
1899
- h.value && !ki(e.target) && N();
1920
+ h.value && !Li(e.target) && M();
1900
1921
  }
1901
1922
  }, () => [
1902
- h.value ? G("div", {
1923
+ h.value ? U("div", {
1903
1924
  class: "markweave-image-toolbar",
1904
1925
  "data-testid": "markweave-image-toolbar",
1905
1926
  "data-markweave-image-ui": "true",
1906
1927
  "aria-label": _.value.toolsAriaLabel
1907
1928
  }, [
1908
- Ni({
1929
+ Vi({
1909
1930
  testId: "markweave-image-align-left",
1910
1931
  label: _.value.alignLeft,
1911
- icon: lr,
1932
+ icon: _r,
1912
1933
  active: E.value === "left",
1913
1934
  onClick: () => e.updateAttributes({ align: "left" })
1914
1935
  }),
1915
- Ni({
1936
+ Vi({
1916
1937
  testId: "markweave-image-align-center",
1917
1938
  label: _.value.alignCenter,
1918
- icon: sr,
1939
+ icon: hr,
1919
1940
  active: E.value === "center",
1920
1941
  onClick: () => e.updateAttributes({ align: "center" })
1921
1942
  }),
1922
- Ni({
1943
+ Vi({
1923
1944
  testId: "markweave-image-align-right",
1924
1945
  label: _.value.alignRight,
1925
- icon: ur,
1946
+ icon: vr,
1926
1947
  active: E.value === "right",
1927
1948
  onClick: () => e.updateAttributes({ align: "right" })
1928
1949
  }),
1929
- G("span", {
1950
+ U("span", {
1930
1951
  class: "markweave-image-toolbar-divider",
1931
1952
  "aria-hidden": "true"
1932
1953
  }),
1933
- Ni({
1954
+ Vi({
1934
1955
  testId: "markweave-image-caption",
1935
1956
  label: _.value.caption,
1936
- icon: Dr,
1957
+ icon: Fr,
1937
1958
  active: f.value || !!A.value,
1938
- onClick: V
1959
+ onClick: z
1939
1960
  }),
1940
- Ni({
1961
+ Vi({
1941
1962
  testId: "markweave-image-preview",
1942
1963
  label: _.value.preview,
1943
- icon: Rr,
1944
- onClick: ee
1964
+ icon: Kr,
1965
+ onClick: te
1945
1966
  }),
1946
- Ni({
1967
+ Vi({
1947
1968
  testId: "markweave-image-download",
1948
1969
  label: _.value.download,
1949
- icon: Lr,
1970
+ icon: Gr,
1950
1971
  onClick: () => {
1951
1972
  w.value && j(w.value);
1952
1973
  }
1953
1974
  }),
1954
- Ni({
1975
+ Vi({
1955
1976
  testId: "markweave-image-replace",
1956
1977
  label: _.value.replace,
1957
- icon: si,
1978
+ icon: hi,
1958
1979
  onClick: () => {
1959
1980
  o.value = "", c.value = null, i.value = !0;
1960
1981
  }
1961
1982
  }),
1962
- G("span", {
1983
+ U("span", {
1963
1984
  class: "markweave-image-toolbar-divider",
1964
1985
  "aria-hidden": "true"
1965
1986
  }),
1966
- Ni({
1987
+ Vi({
1967
1988
  testId: "markweave-image-delete",
1968
1989
  label: _.value.delete,
1969
- icon: xi,
1990
+ icon: ki,
1970
1991
  onClick: () => e.deleteNode()
1971
1992
  })
1972
1993
  ]) : null,
1973
- G("div", {
1994
+ U("div", {
1974
1995
  ref: t,
1975
1996
  class: "markweave-image-box",
1976
1997
  style: {
@@ -1978,22 +1999,22 @@ var Ii = X({
1978
1999
  ...x.value?.width && x.value.height ? { aspectRatio: `${x.value.width} / ${x.value.height}` } : {}
1979
2000
  }
1980
2001
  }, [
1981
- w.value ? G("img", {
2002
+ w.value ? U("img", {
1982
2003
  class: "markweave-image",
1983
2004
  src: w.value,
1984
- alt: F(u.value.alt) ?? "",
1985
- title: F(u.value.title) ?? void 0,
2005
+ alt: P(u.value.alt) ?? "",
2006
+ title: P(u.value.title) ?? void 0,
1986
2007
  draggable: !1,
1987
2008
  loading: "lazy",
1988
2009
  decoding: "async",
1989
2010
  width: x.value?.width,
1990
2011
  height: x.value?.height
1991
- }) : G("div", {
2012
+ }) : U("div", {
1992
2013
  class: "markweave-image-readonly-empty",
1993
2014
  "data-testid": "markweave-image-readonly-empty",
1994
2015
  "aria-hidden": "true"
1995
2016
  }),
1996
- !h.value && w.value ? G("button", {
2017
+ !h.value && w.value ? U("button", {
1997
2018
  type: "button",
1998
2019
  class: "markweave-image-preview-trigger",
1999
2020
  "data-testid": "markweave-image-preview",
@@ -2001,34 +2022,34 @@ var Ii = X({
2001
2022
  "aria-label": _.value.preview,
2002
2023
  title: _.value.preview,
2003
2024
  onMousedown: (e) => e.preventDefault(),
2004
- onClick: ee
2005
- }, [G(Rr, {
2025
+ onClick: te
2026
+ }, [U(Kr, {
2006
2027
  size: 16,
2007
2028
  strokeWidth: 1.8
2008
- }), G("span", {
2029
+ }), U("span", {
2009
2030
  class: "markweave-image-tooltip",
2010
2031
  role: "tooltip"
2011
2032
  }, _.value.preview)]) : null,
2012
- h.value ? G("button", {
2033
+ h.value ? U("button", {
2013
2034
  type: "button",
2014
2035
  class: "markweave-image-resize-handle",
2015
2036
  "data-testid": "markweave-image-resize-left",
2016
2037
  "data-side": "left",
2017
2038
  "aria-label": _.value.resizeLeft,
2018
2039
  "data-markweave-image-ui": "true",
2019
- onPointerdown: (e) => H("left", e)
2040
+ onPointerdown: (e) => B("left", e)
2020
2041
  }) : null,
2021
- h.value ? G("button", {
2042
+ h.value ? U("button", {
2022
2043
  type: "button",
2023
2044
  class: "markweave-image-resize-handle",
2024
2045
  "data-testid": "markweave-image-resize-right",
2025
2046
  "data-side": "right",
2026
2047
  "aria-label": _.value.resizeRight,
2027
2048
  "data-markweave-image-ui": "true",
2028
- onPointerdown: (e) => H("right", e)
2049
+ onPointerdown: (e) => B("right", e)
2029
2050
  }) : null
2030
2051
  ]),
2031
- h.value && (f.value || A.value) ? G("input", {
2052
+ h.value && (f.value || A.value) ? U("input", {
2032
2053
  class: "markweave-image-caption-input",
2033
2054
  "data-testid": "markweave-image-caption-input",
2034
2055
  "data-markweave-image-ui": "true",
@@ -2041,13 +2062,13 @@ var Ii = X({
2041
2062
  onKeydown: (e) => {
2042
2063
  e.key === "Escape" && (e.preventDefault(), f.value = !1);
2043
2064
  }
2044
- }) : A.value ? G("figcaption", {
2065
+ }) : A.value ? U("figcaption", {
2045
2066
  class: "markweave-image-caption",
2046
2067
  "data-testid": "markweave-image-caption"
2047
2068
  }, A.value) : null
2048
2069
  ]);
2049
2070
  }
2050
- }), Li = X({
2071
+ }), Gi = X({
2051
2072
  name: "MarkweaveVueVideoNodeView",
2052
2073
  props: {
2053
2074
  editor: {
@@ -2080,14 +2101,14 @@ var Ii = X({
2080
2101
  }
2081
2102
  },
2082
2103
  setup(e) {
2083
- let t = K(!1), r = K(""), i = K(null), a = K(!1), o = Oi(e.editor), c = q(() => d(o.value)), l = q(() => e.extension.options?.messages ?? n("zh")), u = q(() => l.value.video), f = q(() => e.node.attrs), p = q(() => F(f.value.src)), m = q(() => F(f.value.embedUrl)), h = q(() => F(f.value.provider)), g = q(() => m.value ? N(m.value, h.value) : null), _ = q(() => F(f.value.mimeType)), v = q(() => F(f.value.title)), y = () => {
2104
+ let t = W(!1), r = W(""), i = W(null), a = W(!1), o = Ii(e.editor), c = K(() => d(o.value)), l = K(() => e.extension.options?.messages ?? n("zh")), u = K(() => l.value.video), f = K(() => e.node.attrs), p = K(() => P(f.value.src)), m = K(() => P(f.value.embedUrl)), h = K(() => P(f.value.provider)), g = K(() => m.value ? M(m.value, h.value) : null), _ = K(() => P(f.value.mimeType)), v = K(() => P(f.value.title)), y = () => {
2084
2105
  p.value || e.deleteNode(), r.value = "", i.value = null, t.value = !1;
2085
2106
  }, b = async (n) => {
2086
2107
  if (!c.value) return;
2087
2108
  let o = e.extension.options;
2088
2109
  a.value = !0, i.value = null;
2089
2110
  try {
2090
- let t = await R(A(n), o?.onUpload);
2111
+ let t = await ne(A(n), o?.onUpload);
2091
2112
  e.updateAttributes(E(t)), r.value = "";
2092
2113
  } catch (e) {
2093
2114
  i.value = e instanceof Error ? e.message : u.value.uploadFailedError;
@@ -2115,13 +2136,13 @@ var Ii = X({
2115
2136
  }, w = (t) => {
2116
2137
  c.value && e.selected && (t.key === "Backspace" || t.key === "Delete") && (t.preventDefault(), e.deleteNode());
2117
2138
  };
2118
- return () => c.value && !p.value ? G(s, {
2139
+ return () => c.value && !p.value ? U(s, {
2119
2140
  as: "figure",
2120
2141
  class: "markweave-video-node",
2121
2142
  "data-testid": "markweave-video-node",
2122
2143
  "data-empty": "true",
2123
2144
  "data-selected": "false"
2124
- }, () => Fi({
2145
+ }, () => Ui({
2125
2146
  messages: l.value,
2126
2147
  inputValue: r.value,
2127
2148
  error: i.value,
@@ -2136,7 +2157,7 @@ var Ii = X({
2136
2157
  onDragActive: (e) => {
2137
2158
  t.value = e;
2138
2159
  }
2139
- })) : G(s, {
2160
+ })) : U(s, {
2140
2161
  as: "figure",
2141
2162
  class: "markweave-video-node",
2142
2163
  "data-testid": "markweave-video-node",
@@ -2148,25 +2169,25 @@ var Ii = X({
2148
2169
  onFocus: C,
2149
2170
  onKeydown: w,
2150
2171
  onMousedown: (e) => {
2151
- c.value && !Ai(e.target) && (e.preventDefault(), C());
2172
+ c.value && !Ri(e.target) && (e.preventDefault(), C());
2152
2173
  }
2153
- }, () => [g.value ? G("div", { class: "markweave-video-embed" }, [G("iframe", {
2174
+ }, () => [g.value ? U("div", { class: "markweave-video-embed" }, [U("iframe", {
2154
2175
  class: "markweave-video-iframe",
2155
2176
  src: g.value,
2156
2177
  title: v.value ?? `${h.value ?? "Video"} embed`,
2157
2178
  "data-markweave-video-embed": "true",
2158
2179
  "data-markweave-video-provider": h.value ?? void 0,
2159
2180
  "data-markweave-video-src": p.value ?? void 0,
2160
- allow: M,
2181
+ allow: ee,
2161
2182
  loading: "lazy",
2162
2183
  allowfullscreen: "true"
2163
- }), c.value ? G("button", {
2184
+ }), c.value ? U("button", {
2164
2185
  type: "button",
2165
2186
  class: "markweave-video-selection-layer",
2166
2187
  "data-testid": "markweave-video-selection-layer",
2167
2188
  tabindex: -1,
2168
2189
  "aria-label": u.value.selectAriaLabel
2169
- }) : null]) : p.value ? G("div", { class: "markweave-video-box" }, [G("video", {
2190
+ }) : null]) : p.value ? U("div", { class: "markweave-video-box" }, [U("video", {
2170
2191
  class: "markweave-video",
2171
2192
  src: p.value,
2172
2193
  title: v.value ?? void 0,
@@ -2174,19 +2195,19 @@ var Ii = X({
2174
2195
  controls: !0,
2175
2196
  "data-markweave-video": "true",
2176
2197
  "data-markweave-mime-type": _.value ?? void 0
2177
- }), c.value ? G("button", {
2198
+ }), c.value ? U("button", {
2178
2199
  type: "button",
2179
2200
  class: "markweave-video-selection-layer",
2180
2201
  "data-testid": "markweave-video-selection-layer",
2181
2202
  tabindex: -1,
2182
2203
  "aria-label": u.value.selectAriaLabel
2183
- }) : null]) : G("div", {
2204
+ }) : null]) : U("div", {
2184
2205
  class: "markweave-video-readonly-empty",
2185
2206
  "data-testid": "markweave-video-readonly-empty",
2186
2207
  "aria-hidden": "true"
2187
2208
  })]);
2188
2209
  }
2189
- }), Ri = C.extend({
2210
+ }), Ki = C.extend({
2190
2211
  addOptions() {
2191
2212
  return {
2192
2213
  ...this.parent?.(),
@@ -2197,16 +2218,16 @@ var Ii = X({
2197
2218
  },
2198
2219
  addNodeView() {
2199
2220
  if (typeof document > "u") return null;
2200
- let e = c(Ii, { stopEvent: ({ event: e }) => ki(e.target) }), t = this.options.resolveMediaSource;
2221
+ let e = c(Wi, { stopEvent: ({ event: e }) => Li(e.target) }), t = this.options.resolveMediaSource;
2201
2222
  if (!t) return e;
2202
2223
  let r = x({
2203
2224
  messages: this.options.messages ?? n("zh"),
2204
2225
  onUpload: this.options.onUpload,
2205
2226
  resolveMediaSource: t
2206
2227
  });
2207
- return (t) => F(t.node.attrs.src) ? r(t) : e(t);
2228
+ return (t) => P(t.node.attrs.src) ? r(t) : e(t);
2208
2229
  }
2209
- }), zi = w.extend({
2230
+ }), qi = w.extend({
2210
2231
  addOptions() {
2211
2232
  return {
2212
2233
  ...this.parent?.(),
@@ -2216,9 +2237,215 @@ var Ii = X({
2216
2237
  };
2217
2238
  },
2218
2239
  addNodeView() {
2219
- return typeof document > "u" ? null : c(Li, { stopEvent: ({ event: e }) => Ai(e.target) });
2240
+ return typeof document > "u" ? null : c(Gi, { stopEvent: ({ event: e }) => Ri(e.target) });
2220
2241
  }
2221
- }), Bi = X({
2242
+ });
2243
+ function Ji(e) {
2244
+ return e instanceof Element && !!e.closest("[data-markweave-attachment-ui=\"true\"], .markweave-attachment-upload-placeholder, .markweave-attachment-uploading");
2245
+ }
2246
+ function Yi(e, t) {
2247
+ return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : Math.max(0, Math.min(100, Math.round(e / t * 100)));
2248
+ }
2249
+ var Xi = X({
2250
+ name: "MarkweaveVueAttachmentNodeView",
2251
+ props: {
2252
+ editor: {
2253
+ type: Object,
2254
+ required: !0
2255
+ },
2256
+ extension: {
2257
+ type: Object,
2258
+ required: !0
2259
+ },
2260
+ node: {
2261
+ type: Object,
2262
+ required: !0
2263
+ },
2264
+ getPos: {
2265
+ type: Function,
2266
+ required: !0
2267
+ },
2268
+ deleteNode: {
2269
+ type: Function,
2270
+ required: !0
2271
+ },
2272
+ updateAttributes: {
2273
+ type: Function,
2274
+ required: !0
2275
+ },
2276
+ selected: {
2277
+ type: Boolean,
2278
+ required: !0
2279
+ }
2280
+ },
2281
+ setup(e) {
2282
+ let t = K(() => e.extension.options), r = K(() => t.value?.messages ?? n("zh")), i = Ii(e.editor), a = K(() => d(i.value)), o = K(() => L(e.node.attrs ?? {})), c = K(() => o.value?.name ?? P(e.node.attrs?.src) ?? r.value.attachment.missingSrc), l = K(() => [P(e.node.attrs?.mimeType), z(typeof e.node.attrs?.size == "number" ? e.node.attrs.size : null)].filter(Boolean).join(" · ")), f = W(null), p = W(!1), m = W(!1), h = W(null), g = W(null), _ = W(null), v = W(null), y = () => {
2283
+ if (!a.value) return;
2284
+ let t = e.getPos();
2285
+ typeof t == "number" && e.editor.chain().focus().setNodeSelection(t).run();
2286
+ }, b = () => {
2287
+ !a.value || m.value || f.value?.click();
2288
+ }, x = async (n) => {
2289
+ if (!(!a.value || !n || m.value)) {
2290
+ h.value = null, m.value = !0, g.value = n.name, _.value = n.size, v.value = null;
2291
+ try {
2292
+ let r = await ne({
2293
+ ...R({
2294
+ type: "file",
2295
+ file: n,
2296
+ mimeType: n.type || void 0
2297
+ }),
2298
+ onProgress: (e) => {
2299
+ v.value = Yi(e.loaded, e.total);
2300
+ }
2301
+ }, t.value?.onUpload);
2302
+ e.updateAttributes(I(r));
2303
+ } catch (e) {
2304
+ h.value = e instanceof Error ? e.message : r.value.attachment.uploadFailedError;
2305
+ } finally {
2306
+ m.value = !1, g.value = null, _.value = null, v.value = null, f.value && (f.value.value = "");
2307
+ }
2308
+ }
2309
+ }, S = (n) => {
2310
+ n.preventDefault(), n.stopPropagation(), o.value && F(o.value, {
2311
+ mode: u(e.editor).mode,
2312
+ event: n
2313
+ }, t.value?.onDownload);
2314
+ }, C = (e) => {
2315
+ Ji(e.target) || (e.preventDefault(), e.stopPropagation(), o.value && S(e));
2316
+ };
2317
+ return () => {
2318
+ let t = r.value.attachment, n = a.value && !o.value && !m.value, i = m.value, u = !!o.value && (p.value || e.selected), d = [z(_.value), v.value === null ? null : `${v.value}%`].filter(Boolean).join(" · ");
2319
+ return n ? U(s, {
2320
+ as: "div",
2321
+ class: "markweave-attachment markweave-attachment-upload-placeholder",
2322
+ "data-markweave-attachment": "true",
2323
+ "data-markweave-attachment-nodeview": "true",
2324
+ "data-empty": "true",
2325
+ "data-testid": "markweave-attachment-node",
2326
+ "data-selected": e.selected ? "true" : "false",
2327
+ "aria-label": t.uploadLabel,
2328
+ onKeydown: (t) => {
2329
+ a.value && e.selected && (t.key === "Delete" || t.key === "Backspace") && (t.preventDefault(), e.deleteNode());
2330
+ }
2331
+ }, [U("input", {
2332
+ ref: f,
2333
+ type: "file",
2334
+ hidden: !0,
2335
+ "data-testid": "markweave-attachment-file-input",
2336
+ onChange: (e) => {
2337
+ x(e.target.files?.[0] ?? null);
2338
+ }
2339
+ }), U("button", {
2340
+ type: "button",
2341
+ class: "markweave-attachment-upload-trigger",
2342
+ "data-markweave-attachment-ui": "true",
2343
+ "data-testid": "markweave-attachment-upload-trigger",
2344
+ "aria-label": t.uploadLabel,
2345
+ onMousedown: (e) => e.preventDefault(),
2346
+ onClick: () => b()
2347
+ }, [
2348
+ U("span", {
2349
+ class: "markweave-attachment-icon",
2350
+ "aria-hidden": "true"
2351
+ }, [Bi(Mi, t.uploadLabel)]),
2352
+ U("span", { class: "markweave-attachment-upload-label" }, t.uploadLabel),
2353
+ h.value ? U("span", { class: "markweave-attachment-upload-error" }, h.value) : null
2354
+ ])]) : i ? U(s, {
2355
+ as: "div",
2356
+ class: "markweave-attachment markweave-attachment-uploading",
2357
+ "data-markweave-attachment": "true",
2358
+ "data-markweave-attachment-nodeview": "true",
2359
+ "data-markweave-attachment-ui": "true",
2360
+ "data-uploading": "true",
2361
+ "data-testid": "markweave-attachment-node",
2362
+ "data-selected": e.selected ? "true" : "false",
2363
+ "aria-label": t.uploading,
2364
+ onMousedown: (e) => {
2365
+ e.preventDefault(), e.stopPropagation();
2366
+ },
2367
+ onKeydown: (t) => {
2368
+ a.value && e.selected && (t.key === "Delete" || t.key === "Backspace") && (t.preventDefault(), e.deleteNode());
2369
+ }
2370
+ }, [U("span", {
2371
+ class: "markweave-attachment-icon",
2372
+ "aria-hidden": "true"
2373
+ }, [Bi(Mi, t.uploading)]), U("span", { class: "markweave-attachment-body" }, [U("span", { class: "markweave-attachment-name" }, g.value ?? t.uploading), U("span", { class: "markweave-attachment-meta" }, [U("span", {
2374
+ class: "markweave-attachment-spinner",
2375
+ "aria-hidden": "true"
2376
+ }), d || t.uploading])])]) : U(s, {
2377
+ as: "div",
2378
+ class: "markweave-attachment",
2379
+ "data-markweave-attachment": "true",
2380
+ "data-markweave-attachment-nodeview": "true",
2381
+ "data-testid": "markweave-attachment-node",
2382
+ "data-selected": e.selected ? "true" : "false",
2383
+ "data-hovered": p.value ? "true" : "false",
2384
+ "aria-label": t.nodeAriaLabel,
2385
+ onMouseenter: () => {
2386
+ p.value = !0;
2387
+ },
2388
+ onMouseleave: () => {
2389
+ p.value = !1;
2390
+ },
2391
+ onMousedown: (e) => {
2392
+ !a.value || Ji(e.target) || (e.preventDefault(), y());
2393
+ },
2394
+ onKeydown: (t) => {
2395
+ a.value && e.selected && (t.key === "Delete" || t.key === "Backspace") && (t.preventDefault(), e.deleteNode());
2396
+ },
2397
+ onClick: C
2398
+ }, [
2399
+ U("span", {
2400
+ class: "markweave-attachment-icon",
2401
+ "aria-hidden": "true"
2402
+ }, [Bi(di, t.nodeAriaLabel)]),
2403
+ U("span", { class: "markweave-attachment-body" }, [U("span", { class: "markweave-attachment-name" }, c.value), l.value ? U("span", { class: "markweave-attachment-meta" }, l.value) : null]),
2404
+ u ? U("span", {
2405
+ class: "markweave-attachment-actions",
2406
+ "data-markweave-attachment-ui": "true"
2407
+ }, [U("button", {
2408
+ type: "button",
2409
+ class: "markweave-attachment-download",
2410
+ "data-markweave-attachment-ui": "true",
2411
+ "data-testid": "markweave-attachment-download",
2412
+ "aria-label": t.downloadAriaLabel,
2413
+ onMousedown: (e) => e.preventDefault(),
2414
+ onClick: S
2415
+ }, [Bi(Gr, t.download), U("span", {
2416
+ class: "markweave-attachment-tooltip",
2417
+ role: "tooltip"
2418
+ }, t.download)]), a.value ? U("button", {
2419
+ type: "button",
2420
+ class: "markweave-attachment-delete",
2421
+ "data-markweave-attachment-ui": "true",
2422
+ "data-testid": "markweave-attachment-delete",
2423
+ "aria-label": t.deleteAriaLabel,
2424
+ onMousedown: (e) => e.preventDefault(),
2425
+ onClick: (t) => {
2426
+ t.preventDefault(), t.stopPropagation(), e.deleteNode();
2427
+ }
2428
+ }, [Bi(ki, t.delete), U("span", {
2429
+ class: "markweave-attachment-tooltip",
2430
+ role: "tooltip"
2431
+ }, t.delete)]) : null]) : null
2432
+ ]);
2433
+ };
2434
+ }
2435
+ }), Zi = B.extend({
2436
+ addOptions() {
2437
+ return {
2438
+ ...this.parent?.(),
2439
+ messages: n("zh"),
2440
+ onUpload: void 0,
2441
+ onDownload: void 0,
2442
+ HTMLAttributes: { class: "markweave-attachment" }
2443
+ };
2444
+ },
2445
+ addNodeView() {
2446
+ return typeof document > "u" ? null : c(Xi, { stopEvent: ({ event: e }) => Ji(e.target) });
2447
+ }
2448
+ }), Qi = X({
2222
2449
  name: "MarkweaveVueLinkCardNodeView",
2223
2450
  props: {
2224
2451
  editor: {
@@ -2251,11 +2478,11 @@ var Ii = X({
2251
2478
  }
2252
2479
  },
2253
2480
  setup(e) {
2254
- let t = e.extension.options, r = t.messages ?? n("zh"), i = Oi(e.editor), a = K(!1), o = K(!1), c = K(!1), l = q(() => _(e.node.attrs ?? {})), u = K(l.value?.title ?? ""), f = K(l.value?.href ?? "");
2255
- J(l, (e) => {
2481
+ let t = e.extension.options, r = t.messages ?? n("zh"), i = Ii(e.editor), a = W(!1), o = W(!1), c = W(!1), l = K(() => _(e.node.attrs ?? {})), u = W(l.value?.title ?? ""), f = W(l.value?.href ?? "");
2482
+ q(l, (e) => {
2256
2483
  u.value = e?.title ?? "", f.value = e?.href ?? "", c.value = !1;
2257
2484
  });
2258
- let p = q(() => d(i.value)), m = q(() => {
2485
+ let p = K(() => d(i.value)), m = K(() => {
2259
2486
  try {
2260
2487
  return new URL(l.value?.href ?? "").host;
2261
2488
  } catch {
@@ -2279,18 +2506,18 @@ var Ii = X({
2279
2506
  ...r,
2280
2507
  ...i
2281
2508
  }) ?? r);
2282
- }, C = (e, t, n, r) => G("button", {
2509
+ }, C = (e, t, n, r) => U("button", {
2283
2510
  type: "button",
2284
2511
  title: e,
2285
2512
  "aria-label": e,
2286
2513
  "data-testid": n,
2287
2514
  onMousedown: h,
2288
2515
  onClick: r
2289
- }, [Mi(t, e), G("span", { role: "tooltip" }, e)]);
2516
+ }, [Bi(t, e), U("span", { role: "tooltip" }, e)]);
2290
2517
  return () => {
2291
2518
  let n = l.value;
2292
2519
  if (!n) return null;
2293
- let i = !c.value && n.imageUrl ? G("img", {
2520
+ let i = !c.value && n.imageUrl ? U("img", {
2294
2521
  src: n.imageUrl,
2295
2522
  alt: "",
2296
2523
  loading: "lazy",
@@ -2298,7 +2525,7 @@ var Ii = X({
2298
2525
  onError: () => {
2299
2526
  c.value = !0;
2300
2527
  }
2301
- }) : !c.value && n.faviconUrl ? G("img", {
2528
+ }) : !c.value && n.faviconUrl ? U("img", {
2302
2529
  class: "markweave-link-card-favicon",
2303
2530
  src: n.faviconUrl,
2304
2531
  alt: "",
@@ -2307,8 +2534,8 @@ var Ii = X({
2307
2534
  onError: () => {
2308
2535
  c.value = !0;
2309
2536
  }
2310
- }) : G("b", null, m.value.slice(0, 1).toUpperCase());
2311
- return G(s, {
2537
+ }) : U("b", null, m.value.slice(0, 1).toUpperCase());
2538
+ return U(s, {
2312
2539
  as: "article",
2313
2540
  class: "markweave-link-card",
2314
2541
  "data-testid": "markweave-link-card",
@@ -2322,32 +2549,32 @@ var Ii = X({
2322
2549
  a.value = !1;
2323
2550
  },
2324
2551
  onMousedown: (e) => {
2325
- ji(e.target) || e.preventDefault();
2552
+ zi(e.target) || e.preventDefault();
2326
2553
  },
2327
2554
  onClick: (e) => {
2328
- ji(e.target) || (e.preventDefault(), n.href && window.open(n.href, "_blank", "noopener,noreferrer"));
2555
+ zi(e.target) || (e.preventDefault(), n.href && window.open(n.href, "_blank", "noopener,noreferrer"));
2329
2556
  }
2330
2557
  }, () => [
2331
- G("a", {
2558
+ U("a", {
2332
2559
  class: "markweave-link-card-main",
2333
2560
  href: n.href,
2334
2561
  "aria-label": r.linkCard.open
2335
- }, [G("span", { class: "markweave-link-card-copy" }, [
2336
- G("strong", null, n.title),
2337
- n.description ? G("span", null, n.description) : null,
2338
- G("small", null, n.siteName ?? m.value)
2339
- ]), G("span", {
2562
+ }, [U("span", { class: "markweave-link-card-copy" }, [
2563
+ U("strong", null, n.title),
2564
+ n.description ? U("span", null, n.description) : null,
2565
+ U("small", null, n.siteName ?? m.value)
2566
+ ]), U("span", {
2340
2567
  class: "markweave-link-card-media",
2341
2568
  "aria-hidden": "true"
2342
2569
  }, [i])]),
2343
- p.value && a.value ? G("div", {
2570
+ p.value ? U("div", {
2344
2571
  class: "markweave-link-card-tools",
2345
2572
  "data-markweave-link-card-ui": "true",
2346
2573
  "aria-label": r.linkCard.toolsAriaLabel
2347
2574
  }, [
2348
- C(r.linkCard.convertToLink, Xr, "markweave-link-card-convert", x),
2349
- C(r.linkCard.copyAddress, Lr, "markweave-link-card-copy", () => b(n.href)),
2350
- C(r.linkCard.edit, ii, "markweave-link-card-edit", (i) => g({
2575
+ C(r.linkCard.convertToLink, ii, "markweave-link-card-convert", x),
2576
+ C(r.linkCard.copyAddress, Gr, "markweave-link-card-copy", () => b(n.href)),
2577
+ C(r.linkCard.edit, fi, "markweave-link-card-edit", (i) => g({
2351
2578
  anchor: i.currentTarget,
2352
2579
  editor: e.editor,
2353
2580
  messages: r,
@@ -2357,15 +2584,15 @@ var Ii = X({
2357
2584
  attrs: n
2358
2585
  }
2359
2586
  })),
2360
- C(r.linkCard.delete, xi, "markweave-link-card-delete", () => e.deleteNode())
2587
+ C(r.linkCard.delete, ki, "markweave-link-card-delete", () => e.deleteNode())
2361
2588
  ]) : null,
2362
- p.value && o.value ? G("form", {
2589
+ p.value && o.value ? U("form", {
2363
2590
  class: "markweave-link-card-editor",
2364
2591
  "data-markweave-link-card-ui": "true",
2365
2592
  "data-testid": "markweave-link-card-editor",
2366
2593
  onSubmit: S
2367
2594
  }, [
2368
- G("label", null, [G("span", null, r.linkCard.titleLabel), G("input", {
2595
+ U("label", null, [U("span", null, r.linkCard.titleLabel), U("input", {
2369
2596
  value: u.value,
2370
2597
  placeholder: r.linkCard.titlePlaceholder,
2371
2598
  "aria-label": r.linkCard.titleLabel,
@@ -2373,7 +2600,7 @@ var Ii = X({
2373
2600
  u.value = e.target.value;
2374
2601
  }
2375
2602
  })]),
2376
- G("label", null, [G("span", null, r.linkCard.addressLabel), G("input", {
2603
+ U("label", null, [U("span", null, r.linkCard.addressLabel), U("input", {
2377
2604
  value: f.value,
2378
2605
  placeholder: r.linkCard.addressPlaceholder,
2379
2606
  "aria-label": r.linkCard.addressLabel,
@@ -2381,16 +2608,16 @@ var Ii = X({
2381
2608
  f.value = e.target.value;
2382
2609
  }
2383
2610
  })]),
2384
- G("button", {
2611
+ U("button", {
2385
2612
  type: "submit",
2386
2613
  disabled: !v(f.value),
2387
2614
  "aria-label": r.linkCard.edit
2388
- }, [Mi(Xr, r.linkCard.edit)])
2615
+ }, [Bi(ii, r.linkCard.edit)])
2389
2616
  ]) : null
2390
2617
  ]);
2391
2618
  };
2392
2619
  }
2393
- }), Vi = h.extend({
2620
+ }), $i = h.extend({
2394
2621
  addOptions() {
2395
2622
  return {
2396
2623
  ...this.parent?.(),
@@ -2399,33 +2626,36 @@ var Ii = X({
2399
2626
  };
2400
2627
  },
2401
2628
  addNodeView() {
2402
- return typeof document > "u" ? null : c(Bi, { stopEvent: ({ event: e }) => ji(e.target) });
2629
+ return typeof document > "u" ? null : c(Qi, { stopEvent: ({ event: e }) => zi(e.target) });
2403
2630
  }
2404
2631
  });
2405
2632
  //#endregion
2406
2633
  //#region src/create-editor-extensions.ts
2407
- function Hi(t = {}) {
2634
+ function ea(t = {}) {
2408
2635
  return e({
2409
2636
  lang: t.lang,
2410
2637
  onImageUpload: t.onImageUpload,
2411
- linkCardExtension: Vi.configure({
2638
+ linkCardExtension: $i.configure({
2412
2639
  lang: t.lang,
2413
2640
  messages: n(t.lang),
2414
2641
  resolver: t.linkCardResolver
2415
2642
  }),
2416
2643
  mediaExtensions: i({
2417
- image: Ri,
2418
- video: zi,
2644
+ image: Ki,
2645
+ video: qi,
2646
+ attachment: Zi,
2419
2647
  lang: t.lang,
2420
2648
  onImageUpload: t.onImageUpload,
2421
2649
  onVideoUpload: t.onVideoUpload,
2650
+ onAttachmentUpload: t.onAttachmentUpload,
2651
+ onAttachmentDownload: t.onAttachmentDownload,
2422
2652
  resolveMediaSource: t.resolveMediaSource
2423
2653
  })
2424
2654
  });
2425
2655
  }
2426
2656
  //#endregion
2427
2657
  //#region src/MarkweaveEditor.ts
2428
- var Ui = {
2658
+ var ta = {
2429
2659
  active: !1,
2430
2660
  mode: "outside",
2431
2661
  activeCellPos: null,
@@ -2433,17 +2663,17 @@ var Ui = {
2433
2663
  selectedCellCount: 0,
2434
2664
  selectionFrom: 0,
2435
2665
  selectionTo: 0
2436
- }, Wi = {
2666
+ }, na = {
2437
2667
  active: !1,
2438
- language: et.defaultLanguage,
2668
+ language: ct.defaultLanguage,
2439
2669
  mermaidPreviewMode: "code",
2440
2670
  pos: null,
2441
2671
  text: ""
2442
2672
  };
2443
- function Gi(e) {
2444
- return pn.getState(e.state) ?? fn;
2673
+ function ra(e) {
2674
+ return Cn.getState(e.state) ?? Sn;
2445
2675
  }
2446
- function Ki(e) {
2676
+ function ia(e) {
2447
2677
  if (!e || typeof window > "u") return null;
2448
2678
  let t = e.parentElement;
2449
2679
  for (; t;) {
@@ -2454,133 +2684,133 @@ function Ki(e) {
2454
2684
  return null;
2455
2685
  }
2456
2686
  function Q(e, t, n = 18, r = 1.8) {
2457
- return G(e, {
2687
+ return U(e, {
2458
2688
  size: n,
2459
2689
  strokeWidth: r,
2460
2690
  "aria-hidden": "true"
2461
2691
  }, { default: () => t });
2462
2692
  }
2463
- function qi(e) {
2464
- return e === "clipboard" ? [G("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" }), G("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" ? [G("circle", {
2693
+ function aa(e) {
2694
+ return e === "clipboard" ? [U("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" }), U("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" ? [U("circle", {
2465
2695
  cx: "10",
2466
2696
  cy: "10",
2467
2697
  r: "5.5"
2468
- }), G("path", { d: "m14 14 4 4" })] : e === "check" ? [G("path", { d: "m5 11 4 4 8-9" })] : e === "expand" ? [
2469
- G("path", { d: "M8 4H4v4" }),
2470
- G("path", { d: "M4 4l5 5" }),
2471
- G("path", { d: "M16 4h4v4" }),
2472
- G("path", { d: "m20 4-5 5" }),
2473
- G("path", { d: "M8 20H4v-4" }),
2474
- G("path", { d: "m4 20 5-5" }),
2475
- G("path", { d: "M16 20h4v-4" }),
2476
- G("path", { d: "m20 20-5-5" })
2698
+ }), U("path", { d: "m14 14 4 4" })] : e === "check" ? [U("path", { d: "m5 11 4 4 8-9" })] : e === "expand" ? [
2699
+ U("path", { d: "M8 4H4v4" }),
2700
+ U("path", { d: "M4 4l5 5" }),
2701
+ U("path", { d: "M16 4h4v4" }),
2702
+ U("path", { d: "m20 4-5 5" }),
2703
+ U("path", { d: "M8 20H4v-4" }),
2704
+ U("path", { d: "m4 20 5-5" }),
2705
+ U("path", { d: "M16 20h4v-4" }),
2706
+ U("path", { d: "m20 20-5-5" })
2477
2707
  ] : e === "download" ? [
2478
- G("path", { d: "M12 4v10" }),
2479
- G("path", { d: "m8 10 4 4 4-4" }),
2480
- G("path", { d: "M5 19h14" })
2481
- ] : e === "close" ? [G("path", { d: "M6 6l12 12" }), G("path", { d: "M18 6 6 18" })] : e === "zoomOut" ? [
2482
- G("circle", {
2708
+ U("path", { d: "M12 4v10" }),
2709
+ U("path", { d: "m8 10 4 4 4-4" }),
2710
+ U("path", { d: "M5 19h14" })
2711
+ ] : e === "close" ? [U("path", { d: "M6 6l12 12" }), U("path", { d: "M18 6 6 18" })] : e === "zoomOut" ? [
2712
+ U("circle", {
2483
2713
  cx: "10",
2484
2714
  cy: "10",
2485
2715
  r: "5.25"
2486
2716
  }),
2487
- G("path", { d: "M7.5 10h5" }),
2488
- G("path", { d: "m14 14 4 4" })
2717
+ U("path", { d: "M7.5 10h5" }),
2718
+ U("path", { d: "m14 14 4 4" })
2489
2719
  ] : e === "zoomIn" ? [
2490
- G("circle", {
2720
+ U("circle", {
2491
2721
  cx: "10",
2492
2722
  cy: "10",
2493
2723
  r: "5.25"
2494
2724
  }),
2495
- G("path", { d: "M7.5 10h5" }),
2496
- G("path", { d: "M10 7.5v5" }),
2497
- G("path", { d: "m14 14 4 4" })
2498
- ] : e === "reset" ? [G("path", { d: "M6.5 8.5A6 6 0 1 1 6 15" }), G("path", { d: "M6.5 8.5H3.5v-3" })] : [G("path", { d: "m6 9 6 6 6-6" })];
2725
+ U("path", { d: "M7.5 10h5" }),
2726
+ U("path", { d: "M10 7.5v5" }),
2727
+ U("path", { d: "m14 14 4 4" })
2728
+ ] : e === "reset" ? [U("path", { d: "M6.5 8.5A6 6 0 1 1 6 15" }), U("path", { d: "M6.5 8.5H3.5v-3" })] : [U("path", { d: "m6 9 6 6 6-6" })];
2499
2729
  }
2500
- function Ji(e) {
2501
- return G("svg", {
2730
+ function oa(e) {
2731
+ return U("svg", {
2502
2732
  viewBox: "0 0 24 24",
2503
2733
  "aria-hidden": "true",
2504
2734
  focusable: "false"
2505
- }, G("g", {
2735
+ }, U("g", {
2506
2736
  fill: "none",
2507
2737
  stroke: "currentColor",
2508
2738
  "stroke-linecap": "round",
2509
2739
  "stroke-linejoin": "round",
2510
2740
  "stroke-width": "1.8"
2511
- }, qi(e)));
2741
+ }, aa(e)));
2512
2742
  }
2513
2743
  function $(e) {
2514
2744
  e.preventDefault();
2515
2745
  }
2516
- function Yi(e) {
2517
- let t = jt(e);
2746
+ function sa(e) {
2747
+ let t = zt(e);
2518
2748
  return !t || typeof window > "u" || typeof window.open != "function" ? !1 : (window.open(t, "_blank", "noopener,noreferrer"), !0);
2519
2749
  }
2520
- var Xi = {
2521
- bold: Tr,
2522
- italic: Jr,
2523
- underline: Ci,
2524
- strike: mi,
2525
- "inline-code": Pr,
2526
- link: Xr,
2527
- more: ti,
2528
- superscript: gi,
2529
- subscript: hi,
2530
- "inline-math": li,
2531
- "align-left": lr,
2532
- "align-center": sr,
2533
- "align-right": ur,
2534
- "align-justify": cr,
2535
- "decrease-indent": Gr,
2536
- "increase-indent": Kr
2537
- }, Zi = {
2538
- type: bi,
2539
- "heading-1": Br,
2540
- "heading-2": Vr,
2541
- "heading-3": Hr,
2542
- "bullet-list": Zr,
2543
- "ordered-list": $r,
2544
- "task-list": Qr,
2545
- blockquote: oi,
2546
- "code-block": Er,
2547
- info: qr,
2548
- tip: Yr,
2549
- warning: mr,
2550
- error: Nr,
2551
- success: kr,
2552
- emoji: ui,
2553
- math: li,
2554
- table: _i,
2555
- separator: ei,
2556
- image: Ur,
2557
- video: Ti,
2558
- attachment: ri
2750
+ var ca = {
2751
+ bold: Nr,
2752
+ italic: ni,
2753
+ underline: ji,
2754
+ strike: Si,
2755
+ "inline-code": Hr,
2756
+ link: ii,
2757
+ more: li,
2758
+ superscript: wi,
2759
+ subscript: Ci,
2760
+ "inline-math": _i,
2761
+ "align-left": _r,
2762
+ "align-center": hr,
2763
+ "align-right": vr,
2764
+ "align-justify": gr,
2765
+ "decrease-indent": $r,
2766
+ "increase-indent": ei
2767
+ }, la = {
2768
+ type: Oi,
2769
+ "heading-1": Jr,
2770
+ "heading-2": Yr,
2771
+ "heading-3": Xr,
2772
+ "bullet-list": ai,
2773
+ "ordered-list": si,
2774
+ "task-list": oi,
2775
+ blockquote: mi,
2776
+ "code-block": Pr,
2777
+ info: ti,
2778
+ tip: ri,
2779
+ warning: Sr,
2780
+ error: Vr,
2781
+ success: Lr,
2782
+ emoji: vi,
2783
+ math: _i,
2784
+ table: Ti,
2785
+ separator: ci,
2786
+ image: Zr,
2787
+ video: Ni,
2788
+ attachment: di
2559
2789
  };
2560
- function Qi(e) {
2561
- let t = Zi[e];
2562
- return G(t, {
2790
+ function ua(e) {
2791
+ let t = la[e];
2792
+ return U(t, {
2563
2793
  size: 18,
2564
2794
  strokeWidth: 1.6,
2565
2795
  absoluteStrokeWidth: !0,
2566
2796
  "aria-hidden": "true"
2567
2797
  });
2568
2798
  }
2569
- var $i = {
2570
- paragraph: Si,
2571
- "heading-1": Br,
2572
- "heading-2": Vr,
2573
- "heading-3": Hr,
2574
- "bullet-list": Zr,
2575
- "numbered-list": $r,
2576
- "todo-list": Qr,
2577
- quote: oi,
2578
- "code-block": Er
2799
+ var da = {
2800
+ paragraph: Ai,
2801
+ "heading-1": Jr,
2802
+ "heading-2": Yr,
2803
+ "heading-3": Xr,
2804
+ "bullet-list": ai,
2805
+ "numbered-list": si,
2806
+ "todo-list": oi,
2807
+ quote: mi,
2808
+ "code-block": Pr
2579
2809
  };
2580
- function ea(e, t) {
2581
- return ae(e, t).label;
2810
+ function fa(e, t) {
2811
+ return pe(e, t).label;
2582
2812
  }
2583
- var ta = X({
2813
+ var pa = X({
2584
2814
  name: "MarkweaveVueFloatingToolbar",
2585
2815
  props: {
2586
2816
  editor: {
@@ -2605,73 +2835,73 @@ var ta = X({
2605
2835
  }
2606
2836
  },
2607
2837
  setup(e) {
2608
- let t = K(null), n = K("input"), r = K(""), i = K(""), a = K(""), o = K(""), s = nr(null), c = nr(null), l = K(null), u = K(null), d = "", f = q(() => e.askAi?.enabled === !0 && typeof e.askAi.handler == "function"), p = K(""), m = K(null), h = K(null), g = K("bottom"), _ = K(null), v = K(null), y = K(null), b = q(() => jt(p.value.trim())), x = q(() => e.messages.floatingToolbar), S = q(() => le(e.messages).map((e) => [
2838
+ let t = W(null), n = W("input"), r = W(""), i = W(""), a = W(""), o = W(""), s = G(null), c = G(null), l = W(null), u = W(null), d = "", f = K(() => e.askAi?.enabled === !0 && typeof e.askAi.handler == "function"), p = W(""), m = W(null), h = W(null), g = W("bottom"), _ = W(null), v = W(null), y = W(null), b = K(() => zt(p.value.trim())), x = K(() => e.messages.floatingToolbar), S = K(() => _e(e.messages).map((e) => [
2609
2839
  e.id,
2610
2840
  e.label,
2611
- $i[e.id]
2612
- ])), C = q(() => ce(e.messages).map((e) => [
2841
+ da[e.id]
2842
+ ])), C = K(() => ge(e.messages).map((e) => [
2613
2843
  e.id,
2614
2844
  e.value,
2615
2845
  e.label
2616
- ])), w = q(() => oe(e.messages).map((e) => [
2846
+ ])), w = K(() => me(e.messages).map((e) => [
2617
2847
  e.id,
2618
2848
  e.value,
2619
2849
  e.label
2620
- ])), T = q(() => se(e.messages).map((e) => e.id)), E = () => {
2850
+ ])), T = K(() => he(e.messages).map((e) => e.id)), E = () => {
2621
2851
  b.value && (e.editor.chain().focus().extendMarkRange("link").setLink({ href: b.value }).run(), t.value = null);
2622
2852
  }, D = () => {
2623
2853
  e.editor.isActive("link") && e.editor.chain().focus().extendMarkRange("link").unsetLink().run(), p.value = "", t.value = null;
2624
2854
  }, O = (n) => {
2625
2855
  t.value = t.value === n ? null : n, n === "link" && (p.value = e.editor.getAttributes("link").href ?? "");
2626
- }, k = H(() => {
2627
- Le(e.editor, d), a.value = d;
2856
+ }, k = se(() => {
2857
+ Ge(e.editor, d), a.value = d;
2628
2858
  }), A = (n = !0) => {
2629
- c.value?.abort(), k.cancel(), d = "", c.value = null, l.value = null, n && Fe(e.editor), De(e.editor), t.value = null, n && e.editor.commands.focus();
2859
+ c.value?.abort(), k.cancel(), d = "", c.value = null, l.value = null, n && Ue(e.editor), Fe(e.editor), t.value = null, n && e.editor.commands.focus();
2630
2860
  }, j = () => {
2631
2861
  if (!f.value) return;
2632
- let r = ze(e.editor);
2862
+ let r = qe(e.editor);
2633
2863
  r && (s.value = r, n.value = "input", a.value = "", o.value = "", i.value = "", t.value = "ask-ai", Y(() => u.value?.focus()));
2634
- }, M = async (t) => {
2864
+ }, ee = async (t) => {
2635
2865
  if (!f.value || e.askAi?.enabled !== !0 || !s.value) return;
2636
2866
  let u = (t ?? r.value).trim();
2637
2867
  if (!u) {
2638
2868
  o.value = e.messages.askAi.emptyPrompt, n.value = "error";
2639
2869
  return;
2640
2870
  }
2641
- let p = ke(e.editor, s.value);
2871
+ let p = Le(e.editor, s.value);
2642
2872
  if (!p) {
2643
2873
  n.value = "conflict";
2644
2874
  return;
2645
2875
  }
2646
- s.value = p, c.value?.abort(), Ee(e.editor);
2647
- let m = new AbortController(), h = Oe(p, u, e.lang, m.signal, void 0, je(e.editor)?.target);
2876
+ s.value = p, c.value?.abort(), Pe(e.editor);
2877
+ let m = new AbortController(), h = Ie(p, u, e.lang, m.signal, void 0, ze(e.editor)?.target);
2648
2878
  c.value = m, l.value = h.id, i.value = u, k.cancel(), d = "", a.value = "", o.value = "", n.value = "generating";
2649
2879
  try {
2650
- let t = await Ie(e.askAi.handler, h, (e) => {
2880
+ let t = await We(e.askAi.handler, h, (e) => {
2651
2881
  l.value === h.id && !m.signal.aborted && (d = e, k.schedule());
2652
2882
  });
2653
2883
  if (l.value !== h.id || m.signal.aborted) return;
2654
- if (k.cancel(), d = t, !Le(e.editor, t)) throw new Se("invalid-output", "Ask AI output is incompatible with the selected content.");
2655
- a.value = t, r.value = "", n.value = je(e.editor)?.status === "target" ? "result" : "conflict";
2884
+ if (k.cancel(), d = t, !Ge(e.editor, t)) throw new Ae("invalid-output", "Ask AI output is incompatible with the selected content.");
2885
+ a.value = t, r.value = "", n.value = ze(e.editor)?.status === "target" ? "result" : "conflict";
2656
2886
  } catch (t) {
2657
2887
  if (l.value !== h.id) return;
2658
2888
  if (k.cancel(), m.signal.aborted) {
2659
- Ee(e.editor), n.value = je(e.editor)?.status === "conflict" ? "conflict" : "input";
2889
+ Pe(e.editor), n.value = ze(e.editor)?.status === "conflict" ? "conflict" : "input";
2660
2890
  return;
2661
2891
  }
2662
- Ee(e.editor), o.value = t instanceof Se ? t.code === "empty-result" ? e.messages.askAi.emptyResult : e.messages.askAi.errorFallback : t instanceof Error && t.message ? t.message : e.messages.askAi.errorFallback, n.value = "error";
2892
+ Pe(e.editor), o.value = t instanceof Ae ? t.code === "empty-result" ? e.messages.askAi.emptyResult : e.messages.askAi.errorFallback : t instanceof Error && t.message ? t.message : e.messages.askAi.errorFallback, n.value = "error";
2663
2893
  }
2664
- }, ee = () => {
2665
- if (!Ce(e.editor, a.value)) {
2666
- n.value = je(e.editor)?.status === "conflict" ? "conflict" : "error", o.value = e.messages.askAi.errorFallback;
2894
+ }, te = () => {
2895
+ if (!je(e.editor, a.value)) {
2896
+ n.value = ze(e.editor)?.status === "conflict" ? "conflict" : "error", o.value = e.messages.askAi.errorFallback;
2667
2897
  return;
2668
2898
  }
2669
- t.value = null, window.setTimeout(() => De(e.editor), 560), e.editor.commands.focus();
2670
- }, N = H(() => {
2899
+ t.value = null, window.setTimeout(() => Fe(e.editor), 560), e.editor.commands.focus();
2900
+ }, M = se(() => {
2671
2901
  let n = _.value, r = y.value, i = e.editor.view.dom.closest(".markweave-editor-frame");
2672
2902
  if (!t.value || !n || !r) return;
2673
2903
  if (t.value === "ask-ai") {
2674
- let t = Me(e.editor), n = v.value?.getBoundingClientRect();
2904
+ let t = Be(e.editor), n = v.value?.getBoundingClientRect();
2675
2905
  if (!t || !n) return;
2676
2906
  let a = {
2677
2907
  anchorRect: n,
@@ -2681,18 +2911,18 @@ var ta = X({
2681
2911
  height: window.innerHeight
2682
2912
  },
2683
2913
  frameRect: i?.getBoundingClientRect() ?? null,
2684
- surfaceRect: Ae(e.editor.view.dom)
2685
- }, o = we({
2914
+ surfaceRect: Re(e.editor.view.dom)
2915
+ }, o = Me({
2686
2916
  ...a,
2687
2917
  panelSize: r.getBoundingClientRect()
2688
2918
  }), s = `${o.width}px`;
2689
- r.style.width !== s && (r.style.width = s, o = we({
2919
+ r.style.width !== s && (r.style.width = s, o = Me({
2690
2920
  ...a,
2691
2921
  panelSize: r.getBoundingClientRect()
2692
2922
  })), r.style.left = `${o.left}px`, r.style.top = `${o.top}px`, r.style.bottom = "auto", r.style.maxWidth = `${o.maxWidth}px`, r.style.maxHeight = `${Math.max(0, o.maxHeight)}px`, r.dataset.positioned = "true", g.value = o.placement;
2693
2923
  return;
2694
2924
  }
2695
- let a = he({
2925
+ let a = Ce({
2696
2926
  toolbarRect: n.getBoundingClientRect(),
2697
2927
  popoverSize: r.getBoundingClientRect(),
2698
2928
  viewport: {
@@ -2703,16 +2933,16 @@ var ta = X({
2703
2933
  gap: t.value === "more" ? 8 : 6
2704
2934
  });
2705
2935
  g.value = a.placement;
2706
- }), P = () => {
2707
- let l = je(e.editor);
2936
+ }), N = () => {
2937
+ let l = ze(e.editor);
2708
2938
  if (l?.target.kind === "table" && l.status === "target" && t.value !== "ask-ai") {
2709
2939
  s.value = l.selection, n.value = "input", r.value = "", a.value = "", o.value = "", i.value = "", t.value = "ask-ai", Y(() => u.value?.focus());
2710
2940
  return;
2711
2941
  }
2712
2942
  t.value === "ask-ai" && l?.status === "conflict" && (c.value?.abort(), k.cancel(), n.value = "conflict");
2713
- }, F = (e) => {
2943
+ }, P = (e) => {
2714
2944
  e.key !== "Escape" || t.value !== "ask-ai" || (e.preventDefault(), n.value === "generating" ? (c.value?.abort(), k.cancel(), n.value = "input") : A(!0));
2715
- }, I = (e) => {
2945
+ }, F = (e) => {
2716
2946
  if (!(!t.value || v.value?.contains(e.target))) {
2717
2947
  if (t.value === "ask-ai") {
2718
2948
  A(!0);
@@ -2721,38 +2951,38 @@ var ta = X({
2721
2951
  t.value = null;
2722
2952
  }
2723
2953
  };
2724
- J(() => [
2954
+ q(() => [
2725
2955
  t.value,
2726
2956
  n.value,
2727
2957
  a.value,
2728
2958
  o.value
2729
2959
  ], ([e]) => {
2730
- e && Y(N.schedule);
2731
- }), rr(() => {
2732
- window.addEventListener("resize", N.schedule), window.addEventListener("scroll", N.schedule, !0), e.editor.on("transaction", P), document.addEventListener("pointerdown", I, !0), document.addEventListener("keydown", F, !0);
2733
- }), ir(() => {
2734
- N.cancel(), k.cancel(), window.removeEventListener("resize", N.schedule), window.removeEventListener("scroll", N.schedule, !0), e.editor.off("transaction", P), document.removeEventListener("pointerdown", I, !0), document.removeEventListener("keydown", F, !0), c.value?.abort(), De(e.editor);
2960
+ e && Y(M.schedule);
2961
+ }), fr(() => {
2962
+ window.addEventListener("resize", M.schedule), window.addEventListener("scroll", M.schedule, !0), e.editor.on("transaction", N), document.addEventListener("pointerdown", F, !0), document.addEventListener("keydown", P, !0);
2963
+ }), J(() => {
2964
+ M.cancel(), k.cancel(), window.removeEventListener("resize", M.schedule), window.removeEventListener("scroll", M.schedule, !0), e.editor.off("transaction", N), document.removeEventListener("pointerdown", F, !0), document.removeEventListener("keydown", P, !0), c.value?.abort(), Fe(e.editor);
2735
2965
  });
2736
- let L = (n) => n === "block-type" || n === "color" || n === "more" ? t.value === n : n === "bold" ? e.editor.isActive("bold") : n === "italic" ? e.editor.isActive("italic") : n === "underline" ? e.editor.isActive("underline") : n === "strike" ? e.editor.isActive("strike") : n === "inline-code" ? e.editor.isActive("code") : n === "link" ? e.editor.isActive("link") : !1, R = (e, t) => {
2966
+ let I = (n) => n === "block-type" || n === "color" || n === "more" ? t.value === n : n === "bold" ? e.editor.isActive("bold") : n === "italic" ? e.editor.isActive("italic") : n === "underline" ? e.editor.isActive("underline") : n === "strike" ? e.editor.isActive("strike") : n === "inline-code" ? e.editor.isActive("code") : n === "link" ? e.editor.isActive("link") : !1, L = (e, t) => {
2737
2967
  if (m.value = e, !e || !(t instanceof HTMLElement) || !v.value) {
2738
2968
  h.value = null;
2739
2969
  return;
2740
2970
  }
2741
2971
  let n = t.getBoundingClientRect(), r = v.value.getBoundingClientRect();
2742
2972
  h.value = n.left + n.width / 2 - r.left;
2743
- }, te = () => {
2973
+ }, R = () => {
2744
2974
  let e = m.value;
2745
2975
  if (!e || t.value !== null) return null;
2746
2976
  let n = x.value.buttons[e];
2747
- return n ? G("div", {
2977
+ return n ? U("div", {
2748
2978
  class: "markweave-floating-toolbar-tooltip",
2749
2979
  role: "tooltip",
2750
2980
  "data-testid": "markweave-floating-toolbar-tooltip",
2751
2981
  "data-button-id": e,
2752
- "data-active": L(e),
2982
+ "data-active": I(e),
2753
2983
  style: h.value === null ? void 0 : { "--markweave-floating-toolbar-tooltip-left": `${h.value}px` }
2754
2984
  }, n) : null;
2755
- }, B = (n, r, i, a, o = !1, s) => G("button", {
2985
+ }, z = (n, r, i, a, o = !1, s) => U("button", {
2756
2986
  type: "button",
2757
2987
  class: `markweave-floating-toolbar-button markweave-floating-toolbar-button--${n}`,
2758
2988
  "aria-label": r,
@@ -2766,19 +2996,19 @@ var ta = X({
2766
2996
  "data-active": o || t.value === n,
2767
2997
  "data-tooltip-active": m.value === n ? "true" : "false",
2768
2998
  "data-testid": `markweave-floating-toolbar-button-${n}`,
2769
- onBlur: () => R(null),
2770
- onFocus: (e) => R(n, e.currentTarget),
2999
+ onBlur: () => L(null),
3000
+ onFocus: (e) => L(n, e.currentTarget),
2771
3001
  onMousedown: $,
2772
- onMouseenter: (e) => R(n, e.currentTarget),
2773
- onMouseleave: () => R(null),
3002
+ onMouseenter: (e) => L(n, e.currentTarget),
3003
+ onMouseleave: () => L(null),
2774
3004
  onClick: a
2775
- }, n === "ask-ai" ? [G("span", { class: "markweave-floating-toolbar-button-inner" }, [Q(i, r), G("span", null, s ?? r)])] : n === "block-type" ? [G("span", { class: "markweave-floating-toolbar-button-inner" }, [G("span", { class: "markweave-floating-toolbar-block-label" }, ea(e.editor, e.messages)), Q(t.value === "block-type" ? Mr : Ar, r)])] : n === "color" ? [G("span", { class: "markweave-floating-toolbar-button-inner markweave-floating-toolbar-button-inner--color" }, [G("span", { class: "markweave-floating-toolbar-color-trigger" }, "A"), Q(t.value === "color" ? Mr : Ar, r)])] : [Q(i, r)]), V = () => G("span", {
3005
+ }, n === "ask-ai" ? [U("span", { class: "markweave-floating-toolbar-button-inner" }, [Q(i, r), U("span", null, s ?? r)])] : n === "block-type" ? [U("span", { class: "markweave-floating-toolbar-button-inner" }, [U("span", { class: "markweave-floating-toolbar-block-label" }, fa(e.editor, e.messages)), Q(t.value === "block-type" ? Br : Rr, r)])] : n === "color" ? [U("span", { class: "markweave-floating-toolbar-button-inner markweave-floating-toolbar-button-inner--color" }, [U("span", { class: "markweave-floating-toolbar-color-trigger" }, "A"), Q(t.value === "color" ? Br : Rr, r)])] : [Q(i, r)]), B = () => U("span", {
2776
3006
  class: "markweave-floating-toolbar-divider",
2777
3007
  "aria-hidden": "true"
2778
- }), U = (n, r, i) => G("section", {
3008
+ }), V = (n, r, i) => U("section", {
2779
3009
  class: "markweave-floating-toolbar-color-section",
2780
3010
  "aria-label": n
2781
- }, [G("div", { class: "markweave-floating-toolbar-menu-title" }, n), G("div", { class: "markweave-floating-toolbar-swatch-grid" }, i.map(([n, i, a]) => G("button", {
3011
+ }, [U("div", { class: "markweave-floating-toolbar-menu-title" }, n), U("div", { class: "markweave-floating-toolbar-swatch-grid" }, i.map(([n, i, a]) => U("button", {
2782
3012
  key: `${r}-${n}`,
2783
3013
  type: "button",
2784
3014
  "aria-label": a,
@@ -2787,24 +3017,24 @@ var ta = X({
2787
3017
  onClick: () => {
2788
3018
  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;
2789
3019
  }
2790
- }, r === "text" ? [G("span", {
3020
+ }, r === "text" ? [U("span", {
2791
3021
  class: "markweave-floating-toolbar-text-swatch",
2792
3022
  style: { color: i ?? "#646970" }
2793
- }, "A")] : [G("span", {
3023
+ }, "A")] : [U("span", {
2794
3024
  class: "markweave-floating-toolbar-highlight-swatch",
2795
3025
  style: { backgroundColor: i ?? "#ffffff" },
2796
3026
  "aria-hidden": "true"
2797
- })])))]), ne = () => {
3027
+ })])))]), H = () => {
2798
3028
  if (t.value === "ask-ai") {
2799
- let t = (e, t, n, r) => G("button", {
3029
+ let t = (e, t, n, r) => U("button", {
2800
3030
  type: "button",
2801
3031
  class: n,
2802
3032
  onMousedown: $,
2803
3033
  onClick: t
2804
- }, r ? [Q(r, e), G("span", null, e)] : e), s = n.value === "input" || n.value === "result" || n.value === "error" ? G("div", {
3034
+ }, r ? [Q(r, e), U("span", null, e)] : e), s = n.value === "input" || n.value === "result" || n.value === "error" ? U("div", {
2805
3035
  class: "markweave-ask-ai-composer",
2806
3036
  "data-variant": n.value === "result" ? "follow-up" : "prompt"
2807
- }, [G("textarea", {
3037
+ }, [U("textarea", {
2808
3038
  ref: u,
2809
3039
  class: "markweave-ask-ai-input",
2810
3040
  rows: 2,
@@ -2815,19 +3045,19 @@ var ta = X({
2815
3045
  r.value = e.target.value;
2816
3046
  },
2817
3047
  onKeydown: (e) => {
2818
- e.key === "Enter" && !e.shiftKey && !e.isComposing && (e.preventDefault(), M());
3048
+ e.key === "Enter" && !e.shiftKey && !e.isComposing && (e.preventDefault(), ee());
2819
3049
  }
2820
- }), G("button", {
3050
+ }), U("button", {
2821
3051
  type: "button",
2822
3052
  class: "markweave-ask-ai-send",
2823
3053
  "aria-label": e.messages.askAi.send,
2824
3054
  disabled: !r.value.trim(),
2825
3055
  onMousedown: $,
2826
3056
  onClick: () => {
2827
- M();
3057
+ ee();
2828
3058
  }
2829
- }, [Q(yr, e.messages.askAi.send)])]) : null;
2830
- return G("section", {
3059
+ }, [Q(Dr, e.messages.askAi.send)])]) : null;
3060
+ return U("section", {
2831
3061
  ref: y,
2832
3062
  class: "markweave-floating-toolbar-popover markweave-ask-ai-popover",
2833
3063
  "aria-label": e.messages.askAi.ariaLabel,
@@ -2835,65 +3065,65 @@ var ta = X({
2835
3065
  "data-testid": "markweave-ask-ai-popover"
2836
3066
  }, [
2837
3067
  s,
2838
- n.value === "generating" ? G("div", {
3068
+ n.value === "generating" ? U("div", {
2839
3069
  class: "markweave-ask-ai-progress markweave-ask-ai-generating",
2840
3070
  role: "status"
2841
3071
  }, [
2842
- G("span", {
3072
+ U("span", {
2843
3073
  class: "markweave-ask-ai-sparkles",
2844
3074
  "aria-hidden": "true"
2845
- }, [Q(di, "")]),
2846
- G("span", { class: "markweave-ask-ai-progress-label" }, a.value ? e.messages.askAi.streaming : e.messages.askAi.generating),
2847
- G("button", {
3075
+ }, [Q(yi, "")]),
3076
+ U("span", { class: "markweave-ask-ai-progress-label" }, a.value ? e.messages.askAi.streaming : e.messages.askAi.generating),
3077
+ U("button", {
2848
3078
  type: "button",
2849
3079
  class: "markweave-ask-ai-stop",
2850
3080
  "aria-label": e.messages.askAi.stop,
2851
3081
  onMousedown: $,
2852
3082
  onClick: () => {
2853
- c.value?.abort(), k.cancel(), Ee(e.editor), n.value = "input";
3083
+ c.value?.abort(), k.cancel(), Pe(e.editor), n.value = "input";
2854
3084
  }
2855
- }, [Q(fi, e.messages.askAi.stop)])
3085
+ }, [Q(bi, e.messages.askAi.stop)])
2856
3086
  ]) : null,
2857
- n.value === "result" ? G("div", { class: "markweave-ask-ai-action-bar" }, [
3087
+ n.value === "result" ? U("div", { class: "markweave-ask-ai-action-bar" }, [
2858
3088
  t(e.messages.askAi.retry, () => {
2859
- M(i.value);
2860
- }, "markweave-ask-ai-retry", ci),
2861
- G("span", { class: "markweave-ask-ai-action-spacer" }),
2862
- t(e.messages.askAi.discard, () => A(!0), "markweave-ask-ai-discard", Ei),
2863
- t(e.messages.askAi.accept, ee, "markweave-ask-ai-accept", Or)
3089
+ ee(i.value);
3090
+ }, "markweave-ask-ai-retry", gi),
3091
+ U("span", { class: "markweave-ask-ai-action-spacer" }),
3092
+ t(e.messages.askAi.discard, () => A(!0), "markweave-ask-ai-discard", Pi),
3093
+ t(e.messages.askAi.accept, te, "markweave-ask-ai-accept", Ir)
2864
3094
  ]) : null,
2865
- n.value === "error" || n.value === "conflict" ? G("div", {
3095
+ n.value === "error" || n.value === "conflict" ? U("div", {
2866
3096
  class: "markweave-ask-ai-error",
2867
3097
  role: "alert"
2868
- }, [n.value === "conflict" ? e.messages.askAi.conflict : o.value || e.messages.askAi.errorFallback, G("div", { class: "markweave-ask-ai-action-bar" }, [
3098
+ }, [n.value === "conflict" ? e.messages.askAi.conflict : o.value || e.messages.askAi.errorFallback, U("div", { class: "markweave-ask-ai-action-bar" }, [
2869
3099
  n.value === "error" ? t(e.messages.askAi.retry, () => {
2870
- M(i.value);
2871
- }, "markweave-ask-ai-retry", ci) : null,
2872
- G("span", { class: "markweave-ask-ai-action-spacer" }),
2873
- t(e.messages.askAi.discard, () => A(!0), "markweave-ask-ai-discard", Ei)
3100
+ ee(i.value);
3101
+ }, "markweave-ask-ai-retry", gi) : null,
3102
+ U("span", { class: "markweave-ask-ai-action-spacer" }),
3103
+ t(e.messages.askAi.discard, () => A(!0), "markweave-ask-ai-discard", Pi)
2874
3104
  ])]) : null
2875
3105
  ]);
2876
3106
  }
2877
- return t.value === "block-type" ? G("div", {
3107
+ return t.value === "block-type" ? U("div", {
2878
3108
  ref: y,
2879
3109
  class: "markweave-floating-toolbar-popover markweave-floating-toolbar-turn-menu",
2880
3110
  "data-testid": "markweave-floating-toolbar-turn-menu"
2881
- }, [G("div", { class: "markweave-floating-toolbar-menu-title" }, x.value.turnIntoTitle), ...S.value.map(([n, r, i]) => G("button", {
3111
+ }, [U("div", { class: "markweave-floating-toolbar-menu-title" }, x.value.turnIntoTitle), ...S.value.map(([n, r, i]) => U("button", {
2882
3112
  key: n,
2883
3113
  type: "button",
2884
3114
  "data-testid": `markweave-floating-toolbar-turn-${n}`,
2885
3115
  onMousedown: $,
2886
3116
  onClick: () => {
2887
- de(e.editor, n), t.value = null;
3117
+ ye(e.editor, n), t.value = null;
2888
3118
  }
2889
- }, [G("span", { class: "markweave-floating-toolbar-menu-icon" }, [Q(i, r)]), G("span", null, r)]))]) : t.value === "link" ? G("form", {
3119
+ }, [U("span", { class: "markweave-floating-toolbar-menu-icon" }, [Q(i, r)]), U("span", null, r)]))]) : t.value === "link" ? U("form", {
2890
3120
  class: "markweave-floating-toolbar-popover markweave-floating-toolbar-link-popover",
2891
3121
  ref: y,
2892
3122
  "data-testid": "markweave-floating-toolbar-link-popover",
2893
3123
  onSubmit: (e) => {
2894
3124
  e.preventDefault(), E();
2895
3125
  }
2896
- }, [G("input", {
3126
+ }, [U("input", {
2897
3127
  value: p.value,
2898
3128
  placeholder: x.value.linkPlaceholder,
2899
3129
  "aria-label": x.value.linkUrlLabel,
@@ -2901,45 +3131,45 @@ var ta = X({
2901
3131
  onInput: (e) => {
2902
3132
  p.value = e.target.value;
2903
3133
  }
2904
- }), G("span", { class: "markweave-floating-toolbar-link-actions" }, [
2905
- G("button", {
3134
+ }), U("span", { class: "markweave-floating-toolbar-link-actions" }, [
3135
+ U("button", {
2906
3136
  type: "submit",
2907
3137
  disabled: !b.value,
2908
3138
  "aria-label": x.value.applyLink,
2909
3139
  "data-testid": "markweave-floating-toolbar-link-apply",
2910
3140
  onMousedown: $
2911
- }, [Q(Fr, x.value.applyLink)]),
2912
- G("span", {
3141
+ }, [Q(Ur, x.value.applyLink)]),
3142
+ U("span", {
2913
3143
  class: "markweave-floating-toolbar-link-divider",
2914
3144
  "aria-hidden": "true"
2915
3145
  }),
2916
- G("button", {
3146
+ U("button", {
2917
3147
  type: "button",
2918
3148
  disabled: !b.value,
2919
3149
  "aria-label": x.value.openLink,
2920
3150
  "data-testid": "markweave-floating-toolbar-link-open",
2921
3151
  onMousedown: $,
2922
- onClick: () => Yi(p.value)
2923
- }, [Q(zr, x.value.openLink)]),
2924
- G("button", {
3152
+ onClick: () => sa(p.value)
3153
+ }, [Q(qr, x.value.openLink)]),
3154
+ U("button", {
2925
3155
  type: "button",
2926
3156
  "aria-label": x.value.removeLink,
2927
3157
  "data-testid": "markweave-floating-toolbar-link-remove",
2928
3158
  onMousedown: $,
2929
3159
  onClick: D
2930
- }, [Q(xi, x.value.removeLink)])
2931
- ])]) : t.value === "color" ? G("div", {
3160
+ }, [Q(ki, x.value.removeLink)])
3161
+ ])]) : t.value === "color" ? U("div", {
2932
3162
  ref: y,
2933
3163
  class: "markweave-floating-toolbar-popover markweave-floating-toolbar-color-popover",
2934
3164
  "data-testid": "markweave-floating-toolbar-color-menu"
2935
- }, [U(x.value.textColorTitle, "text", C.value), U(x.value.highlightColorTitle, "highlight", w.value)]) : t.value === "more" ? G("div", {
3165
+ }, [V(x.value.textColorTitle, "text", C.value), V(x.value.highlightColorTitle, "highlight", w.value)]) : t.value === "more" ? U("div", {
2936
3166
  ref: y,
2937
3167
  class: "markweave-floating-toolbar-popover markweave-floating-toolbar-more-menu",
2938
3168
  "data-testid": "markweave-floating-toolbar-more-menu"
2939
- }, T.value.map((n) => G("span", {
3169
+ }, T.value.map((n) => U("span", {
2940
3170
  key: n,
2941
3171
  class: "markweave-floating-toolbar-more-item"
2942
- }, [G("button", {
3172
+ }, [U("button", {
2943
3173
  type: "button",
2944
3174
  "aria-label": x.value.moreActions[n],
2945
3175
  "data-testid": `markweave-floating-toolbar-more-${n}`,
@@ -2952,61 +3182,61 @@ var ta = X({
2952
3182
  m.value = null;
2953
3183
  },
2954
3184
  onClick: () => {
2955
- ue(e.editor, n), t.value = null;
3185
+ ve(e.editor, n), t.value = null;
2956
3186
  }
2957
- }, [Q(Xi[n], x.value.moreActions[n])]), m.value === n ? G("div", {
3187
+ }, [Q(ca[n], x.value.moreActions[n])]), m.value === n ? U("div", {
2958
3188
  class: "markweave-floating-toolbar-tooltip markweave-floating-toolbar-tooltip--more",
2959
3189
  role: "tooltip"
2960
3190
  }, x.value.moreActions[n]) : null]))) : null;
2961
3191
  };
2962
- return () => G(z, {
3192
+ return () => U(ie, {
2963
3193
  editor: e.editor,
2964
3194
  shouldShow: ({ editor: e }) => {
2965
- let t = je(e);
2966
- return ve(ge(e), {
3195
+ let t = ze(e);
3196
+ return Ee(we(e), {
2967
3197
  editable: e.isEditable,
2968
- hasAskAiPreview: Ne(e.state),
3198
+ hasAskAiPreview: Ve(e.state),
2969
3199
  hasActiveAskAiTableTarget: t?.target.kind === "table" && t.status === "target"
2970
3200
  });
2971
3201
  },
2972
3202
  getReferencedVirtualElement: () => {
2973
- let t = je(e.editor)?.target.kind === "table" ? Me(e.editor) : null;
3203
+ let t = ze(e.editor)?.target.kind === "table" ? Be(e.editor) : null;
2974
3204
  return t ? {
2975
3205
  getBoundingClientRect: () => new DOMRect(t.left, t.top, t.width, t.height),
2976
3206
  getClientRects: () => [new DOMRect(t.left, t.top, t.width, t.height)]
2977
3207
  } : null;
2978
3208
  },
2979
3209
  options: { placement: "top" }
2980
- }, { default: () => G("div", {
3210
+ }, { default: () => U("div", {
2981
3211
  ref: _,
2982
3212
  class: "markweave-floating-toolbar markweave-floating-toolbar--default markweave-floating-toolbar--motion-entered",
2983
3213
  "data-popover-placement": t.value ? g.value : void 0,
2984
3214
  "data-ask-ai-session": t.value === "ask-ai" ? "open" : "closed",
2985
3215
  "data-testid": "markweave-floating-toolbar"
2986
- }, [G("div", {
3216
+ }, [U("div", {
2987
3217
  ref: v,
2988
3218
  class: "markweave-floating-toolbar-content",
2989
3219
  "data-menu": t.value ?? "none"
2990
3220
  }, [
2991
- f.value && Pe(e.editor) ? B("ask-ai", x.value.buttons["ask-ai"], di, j, t.value === "ask-ai", x.value.buttons["ask-ai"]) : null,
2992
- f.value && Pe(e.editor) ? V() : null,
2993
- B("block-type", x.value.buttons["block-type"], Si, () => O("block-type"), t.value === "block-type"),
2994
- V(),
2995
- B("bold", x.value.buttons.bold, Tr, () => e.editor.chain().focus().toggleBold().run(), e.editor.isActive("bold")),
2996
- B("italic", x.value.buttons.italic, Jr, () => e.editor.chain().focus().toggleItalic().run(), e.editor.isActive("italic")),
2997
- B("underline", x.value.buttons.underline, Ci, () => e.editor.chain().focus().toggleUnderline().run(), e.editor.isActive("underline")),
2998
- B("strike", x.value.buttons.strike, mi, () => e.editor.chain().focus().toggleStrike().run(), e.editor.isActive("strike")),
2999
- B("inline-code", x.value.buttons["inline-code"], Pr, () => e.editor.chain().focus().toggleCode().run(), e.editor.isActive("code")),
3000
- V(),
3001
- B("link", x.value.buttons.link, Xr, () => O("link"), e.editor.isActive("link")),
3002
- B("color", x.value.buttons.color, Si, () => O("color"), t.value === "color"),
3003
- V(),
3004
- B("more", x.value.buttons.more, ti, () => O("more"), t.value === "more"),
3005
- ne(),
3006
- te()
3221
+ f.value && He(e.editor) ? z("ask-ai", x.value.buttons["ask-ai"], yi, j, t.value === "ask-ai", x.value.buttons["ask-ai"]) : null,
3222
+ f.value && He(e.editor) ? B() : null,
3223
+ z("block-type", x.value.buttons["block-type"], Ai, () => O("block-type"), t.value === "block-type"),
3224
+ B(),
3225
+ z("bold", x.value.buttons.bold, Nr, () => e.editor.chain().focus().toggleBold().run(), e.editor.isActive("bold")),
3226
+ z("italic", x.value.buttons.italic, ni, () => e.editor.chain().focus().toggleItalic().run(), e.editor.isActive("italic")),
3227
+ z("underline", x.value.buttons.underline, ji, () => e.editor.chain().focus().toggleUnderline().run(), e.editor.isActive("underline")),
3228
+ z("strike", x.value.buttons.strike, Si, () => e.editor.chain().focus().toggleStrike().run(), e.editor.isActive("strike")),
3229
+ z("inline-code", x.value.buttons["inline-code"], Hr, () => e.editor.chain().focus().toggleCode().run(), e.editor.isActive("code")),
3230
+ B(),
3231
+ z("link", x.value.buttons.link, ii, () => O("link"), e.editor.isActive("link")),
3232
+ z("color", x.value.buttons.color, Ai, () => O("color"), t.value === "color"),
3233
+ B(),
3234
+ z("more", x.value.buttons.more, li, () => O("more"), t.value === "more"),
3235
+ H(),
3236
+ R()
3007
3237
  ])]) });
3008
3238
  }
3009
- }), na = X({
3239
+ }), ma = X({
3010
3240
  name: "MarkweaveVueMathEditorPopover",
3011
3241
  props: {
3012
3242
  editor: {
@@ -3027,17 +3257,17 @@ var ta = X({
3027
3257
  }
3028
3258
  },
3029
3259
  setup(e) {
3030
- let t = K(e.target.latex), n = nr(null), r = K(null), i = K(null), a = nr(It(e.editor, e.target)), o = q(() => t.value === e.target.latex && a.value ? {
3260
+ let t = W(e.target.latex), n = G(null), r = W(null), i = W(null), a = G(Wt(e.editor, e.target)), o = K(() => t.value === e.target.latex && a.value ? {
3031
3261
  html: a.value,
3032
3262
  error: !1
3033
- } : Bt(t.value, e.target.kind, e.editor)), s = q(() => t.value.trim().length > 0), c = q(() => e.messages.math), l = q(() => Ft(e.editor, e.target) ?? 1), u = () => {
3263
+ } : Jt(t.value, e.target.kind, e.editor)), s = K(() => t.value.trim().length > 0), c = K(() => e.messages.math), l = K(() => Ut(e.editor, e.target) ?? 1), u = () => {
3034
3264
  if (typeof window > "u") return;
3035
- let r = Pt(e.editor, e.target), i = e.editor.view.dom.closest(".markweave-editor-frame")?.getBoundingClientRect();
3265
+ let r = Ht(e.editor, e.target), i = e.editor.view.dom.closest(".markweave-editor-frame")?.getBoundingClientRect();
3036
3266
  if (!r || !i) {
3037
3267
  e.onClose();
3038
3268
  return;
3039
3269
  }
3040
- n.value = Nt({
3270
+ n.value = Vt({
3041
3271
  anchorRect: r,
3042
3272
  frameRect: i,
3043
3273
  kind: e.target.kind,
@@ -3046,7 +3276,7 @@ var ta = X({
3046
3276
  viewportWidth: window.innerWidth
3047
3277
  });
3048
3278
  }, d = () => {
3049
- s.value && Mt(e.editor, e.target, t.value) && e.onClose();
3279
+ s.value && Bt(e.editor, e.target, t.value) && e.onClose();
3050
3280
  }, f = (t) => {
3051
3281
  if (t.key === "Escape") {
3052
3282
  t.preventDefault(), e.onClose(), e.editor.commands.focus();
@@ -3057,14 +3287,14 @@ var ta = X({
3057
3287
  let n = t.target;
3058
3288
  n instanceof Node && (r.value?.contains(n) || n instanceof Element && n.closest(".tiptap-mathematics-render") || e.onClose());
3059
3289
  };
3060
- return J(() => [e.target.pos, e.target.latex], () => {
3061
- t.value = e.target.latex, a.value = It(e.editor, e.target), Y(u);
3062
- }), rr(() => {
3063
- Vt(e.editor, e.target, !0), u(), Y(() => {
3290
+ return q(() => [e.target.pos, e.target.latex], () => {
3291
+ t.value = e.target.latex, a.value = Wt(e.editor, e.target), Y(u);
3292
+ }), fr(() => {
3293
+ Yt(e.editor, e.target, !0), u(), Y(() => {
3064
3294
  i.value?.focus({ preventScroll: !0 }), i.value?.select(), u();
3065
3295
  }), window.addEventListener("resize", u), window.addEventListener("scroll", u, !0), document.addEventListener("mousedown", p);
3066
- }), ir(() => {
3067
- Vt(e.editor, e.target, !1), window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0), document.removeEventListener("mousedown", p);
3296
+ }), J(() => {
3297
+ Yt(e.editor, e.target, !1), window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0), document.removeEventListener("mousedown", p);
3068
3298
  }), () => {
3069
3299
  let a = e.target.kind === "block" ? c.value.blockTitle : c.value.inlineTitle, u = {
3070
3300
  ref: i,
@@ -3077,7 +3307,7 @@ var ta = X({
3077
3307
  },
3078
3308
  onKeydown: f
3079
3309
  };
3080
- return e.target.kind === "inline" ? G("form", {
3310
+ return e.target.kind === "inline" ? U("form", {
3081
3311
  ref: r,
3082
3312
  class: "markweave-math-editor-popover markweave-math-editor-popover--inline",
3083
3313
  "aria-label": a,
@@ -3092,22 +3322,22 @@ var ta = X({
3092
3322
  onSubmit: (e) => {
3093
3323
  e.preventDefault(), d();
3094
3324
  }
3095
- }, [G("label", {
3325
+ }, [U("label", {
3096
3326
  class: "markweave-math-inline-source",
3097
3327
  "data-testid": "markweave-math-inline-source"
3098
3328
  }, [
3099
- G("span", { attrs: { "aria-hidden": "true" } }, "$"),
3100
- G("input", {
3329
+ U("span", { attrs: { "aria-hidden": "true" } }, "$"),
3330
+ U("input", {
3101
3331
  ...u,
3102
3332
  "aria-label": c.value.latexLabel,
3103
3333
  size: Math.max(t.value.length, 1)
3104
3334
  }),
3105
- G("span", { attrs: { "aria-hidden": "true" } }, "$")
3106
- ]), G("div", {
3335
+ U("span", { attrs: { "aria-hidden": "true" } }, "$")
3336
+ ]), U("div", {
3107
3337
  class: "markweave-math-inline-preview",
3108
3338
  "data-error": o.value.error ? "true" : "false",
3109
3339
  "data-testid": "markweave-math-editor-preview"
3110
- }, [G("div", { innerHTML: o.value.html || "&nbsp;" }), o.value.error ? G("small", null, c.value.invalidPreview) : null])]) : G("form", {
3340
+ }, [U("div", { innerHTML: o.value.html || "&nbsp;" }), o.value.error ? U("small", null, c.value.invalidPreview) : null])]) : U("form", {
3111
3341
  ref: r,
3112
3342
  class: "markweave-math-editor-popover markweave-math-editor-popover--block",
3113
3343
  "aria-label": a,
@@ -3123,39 +3353,39 @@ var ta = X({
3123
3353
  e.preventDefault(), d();
3124
3354
  }
3125
3355
  }, [
3126
- G("div", { class: "markweave-math-block-toolbar" }, [
3127
- G("span", null, c.value.label),
3128
- Q(Pr, c.value.label, 15, 1.75),
3129
- G("button", {
3356
+ U("div", { class: "markweave-math-block-toolbar" }, [
3357
+ U("span", null, c.value.label),
3358
+ Q(Hr, c.value.label, 15, 1.75),
3359
+ U("button", {
3130
3360
  type: "submit",
3131
3361
  title: c.value.apply,
3132
3362
  "aria-label": c.value.apply,
3133
3363
  disabled: !s.value,
3134
3364
  "data-testid": "markweave-math-editor-apply"
3135
- }, [Q(kr, c.value.apply, 16, 2)])
3365
+ }, [Q(Lr, c.value.apply, 16, 2)])
3136
3366
  ]),
3137
- G("label", {
3367
+ U("label", {
3138
3368
  class: "markweave-math-block-source",
3139
3369
  "data-testid": "markweave-math-block-source"
3140
3370
  }, [
3141
- G("span", { attrs: { "aria-hidden": "true" } }, "$$"),
3142
- G("textarea", {
3371
+ U("span", { attrs: { "aria-hidden": "true" } }, "$$"),
3372
+ U("textarea", {
3143
3373
  ...u,
3144
3374
  "aria-label": c.value.latexLabel,
3145
3375
  rows: 3
3146
3376
  }),
3147
- G("span", { attrs: { "aria-hidden": "true" } }, "$$")
3377
+ U("span", { attrs: { "aria-hidden": "true" } }, "$$")
3148
3378
  ]),
3149
- G("div", {
3379
+ U("div", {
3150
3380
  class: "markweave-math-block-preview",
3151
3381
  "data-error": o.value.error ? "true" : "false",
3152
3382
  "data-math-number": String(l.value),
3153
3383
  "data-testid": "markweave-math-editor-preview"
3154
- }, [G("div", { innerHTML: o.value.html || "&nbsp;" }), o.value.error ? G("small", null, c.value.invalidPreview) : null])
3384
+ }, [U("div", { innerHTML: o.value.html || "&nbsp;" }), o.value.error ? U("small", null, c.value.invalidPreview) : null])
3155
3385
  ]);
3156
3386
  };
3157
3387
  }
3158
- }), ra = X({
3388
+ }), ha = X({
3159
3389
  name: "MarkweaveVueSlashCommandMenu",
3160
3390
  props: {
3161
3391
  commands: {
@@ -3192,87 +3422,99 @@ var ta = X({
3192
3422
  }
3193
3423
  },
3194
3424
  setup(e) {
3195
- let t = K(""), n = K(null), r = K(null), i = K(!1), a = K(""), o = K(0), s = q(() => {
3425
+ let t = W(""), n = W(null), r = W(null), i = W(!1), a = W(""), o = W(0), s = W(null), c = K(() => {
3196
3426
  let t = a.value.trim().toLowerCase();
3197
3427
  return (t ? e.messages.slash.emojiItems.filter((e) => [
3198
3428
  e.emoji,
3199
3429
  e.label,
3200
3430
  ...e.terms
3201
3431
  ].join(" ").toLowerCase().includes(t)) : e.messages.slash.emojiItems).slice(0, 12);
3202
- }), c = async () => {
3432
+ });
3433
+ q(() => [
3434
+ e.state.name,
3435
+ e.state.activeIndex,
3436
+ e.commands.length,
3437
+ e.inputCommand?.id ?? null
3438
+ ], async () => {
3439
+ if (e.state.name !== "keyboard-selecting" || e.inputCommand || !e.commands.length) return;
3440
+ await Y();
3441
+ let t = s.value, n = t?.querySelector("[data-active=\"true\"]");
3442
+ t && n && sn(t, n);
3443
+ }, { flush: "post" });
3444
+ let l = async () => {
3203
3445
  if (e.inputCommand) {
3204
3446
  r.value = null, i.value = !0;
3205
3447
  try {
3206
- let i = n.value ? {
3207
- kind: e.inputCommand.uploadKind ?? "attachment",
3208
- trigger: "slash-command",
3448
+ let i = e.inputCommand.uploadKind ?? "attachment", a = n.value ? {
3449
+ kind: i,
3450
+ trigger: i === "attachment" ? "attachment-insert" : "slash-command",
3209
3451
  source: {
3210
3452
  type: "file",
3211
3453
  file: n.value,
3212
3454
  mimeType: n.value.type
3213
3455
  }
3214
3456
  } : {
3215
- kind: e.inputCommand.uploadKind ?? "attachment",
3216
- trigger: "slash-command",
3217
- source: I(t.value)
3457
+ kind: i,
3458
+ trigger: i === "attachment" ? "attachment-insert" : "slash-command",
3459
+ source: V(t.value)
3218
3460
  };
3219
3461
  if (!n.value && !t.value.trim()) {
3220
3462
  r.value = e.messages.slash.uploadRequiredError;
3221
3463
  return;
3222
3464
  }
3223
- let a = await R(i, e.onUpload);
3224
- e.onSelect(e.inputCommand, { uploadResult: a }), e.onInputCommandChange(null), t.value = "", n.value = null;
3465
+ let o = await ne(a, e.onUpload);
3466
+ e.onSelect(e.inputCommand, { uploadResult: o }), e.onInputCommandChange(null), t.value = "", n.value = null;
3225
3467
  } catch (t) {
3226
3468
  r.value = t instanceof Error ? t.message : e.messages.slash.uploadFailedError;
3227
3469
  } finally {
3228
3470
  i.value = !1;
3229
3471
  }
3230
3472
  }
3231
- }, l = (t) => {
3473
+ }, u = (t) => {
3232
3474
  if (!e.inputCommand) return;
3233
- let n = s.value[Math.min(s.value.length - 1, Math.max(0, t))];
3475
+ let n = c.value[Math.min(c.value.length - 1, Math.max(0, t))];
3234
3476
  n && (e.onSelect(e.inputCommand, { emoji: n.emoji }), e.onInputCommandChange(null));
3235
3477
  };
3236
3478
  return () => {
3237
3479
  if (!e.position) return null;
3238
- let u = {
3480
+ let d = {
3239
3481
  left: `${e.position.left}px`,
3240
3482
  top: `${e.position.top}px`,
3241
3483
  maxHeight: `${e.position.maxHeight}px`,
3242
3484
  "--markweave-slash-menu-max-height": `${e.position.maxHeight}px`
3243
- }, d = {
3485
+ }, f = {
3244
3486
  left: `${e.position.triggerLeft}px`,
3245
3487
  top: `${e.position.triggerTop}px`
3246
- }, f = Object.values(e.messages.slash.groups).map((t) => ({
3488
+ }, p = Object.values(e.messages.slash.groups).map((t) => ({
3247
3489
  group: t,
3248
3490
  commands: e.commands.filter((e) => e.group === t)
3249
3491
  })).filter((e) => e.commands.length);
3250
- return G("div", {
3492
+ return U("div", {
3251
3493
  class: "markweave-slash-layer",
3252
3494
  style: { display: "contents" },
3253
3495
  "data-testid": "markweave-slash-layer"
3254
- }, [G("div", {
3496
+ }, [U("div", {
3255
3497
  class: "markweave-slash-trigger",
3256
- style: d,
3498
+ style: f,
3257
3499
  "aria-hidden": "true",
3258
3500
  "data-testid": "markweave-slash-trigger"
3259
- }, [G("span", null, "/"), G("em", null, e.state.query || e.messages.slash.filterPlaceholder)]), G("div", {
3501
+ }, [U("span", null, "/"), U("em", null, e.state.query || e.messages.slash.filterPlaceholder)]), U("div", {
3260
3502
  class: "markweave-slash-menu",
3261
- style: u,
3503
+ style: d,
3262
3504
  role: "listbox",
3263
3505
  "aria-label": e.messages.slash.ariaLabel,
3264
3506
  "data-placement": e.position.placement,
3265
3507
  "data-testid": "markweave-slash-menu"
3266
- }, [e.inputCommand?.inputKind === "emoji" ? G("div", {
3508
+ }, [e.inputCommand?.inputKind === "emoji" ? U("div", {
3267
3509
  class: "markweave-slash-subpanel",
3268
3510
  "data-testid": "markweave-slash-emoji-picker"
3269
3511
  }, [
3270
- G("div", { class: "markweave-slash-subpanel-header" }, [G("button", {
3512
+ U("div", { class: "markweave-slash-subpanel-header" }, [U("button", {
3271
3513
  type: "button",
3272
3514
  onMousedown: $,
3273
3515
  onClick: () => e.onInputCommandChange(null)
3274
- }, e.messages.common.back), G("span", null, e.messages.slash.emojiTitle)]),
3275
- G("label", { class: "markweave-slash-input" }, [G("span", null, "/"), G("input", {
3516
+ }, e.messages.common.back), U("span", null, e.messages.slash.emojiTitle)]),
3517
+ U("label", { class: "markweave-slash-input" }, [U("span", null, "/"), U("input", {
3276
3518
  autofocus: !0,
3277
3519
  value: a.value,
3278
3520
  placeholder: e.messages.slash.emojiSearchPlaceholder,
@@ -3280,14 +3522,14 @@ var ta = X({
3280
3522
  a.value = e.target.value, o.value = 0;
3281
3523
  },
3282
3524
  onKeydown: (t) => {
3283
- 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));
3525
+ t.key === "Escape" ? (t.preventDefault(), e.onInputCommandChange(null)) : t.key === "ArrowDown" ? (t.preventDefault(), o.value = c.value.length ? (o.value + 1) % c.value.length : 0) : t.key === "ArrowUp" ? (t.preventDefault(), o.value = c.value.length ? (o.value - 1 + c.value.length) % c.value.length : 0) : (t.key === "Enter" || t.key === "Tab") && (t.preventDefault(), u(o.value));
3284
3526
  }
3285
3527
  })]),
3286
- G("div", {
3528
+ U("div", {
3287
3529
  class: "markweave-slash-emoji-grid",
3288
3530
  role: "listbox",
3289
3531
  "aria-label": e.messages.slash.emojiTitle
3290
- }, s.value.map((e, t) => G("button", {
3532
+ }, c.value.map((e, t) => U("button", {
3291
3533
  key: `${e.emoji}-${e.label}`,
3292
3534
  type: "button",
3293
3535
  role: "option",
@@ -3295,18 +3537,18 @@ var ta = X({
3295
3537
  "data-active": t === o.value,
3296
3538
  onMouseenter: () => o.value = t,
3297
3539
  onMousedown: $,
3298
- onClick: () => l(t)
3299
- }, [G("span", null, e.emoji), G("small", null, e.label)])))
3300
- ]) : e.inputCommand?.inputKind === "upload" ? G("div", {
3540
+ onClick: () => u(t)
3541
+ }, [U("span", null, e.emoji), U("small", null, e.label)])))
3542
+ ]) : e.inputCommand?.inputKind === "upload" ? U("div", {
3301
3543
  class: "markweave-slash-subpanel",
3302
3544
  "data-testid": "markweave-slash-upload-panel"
3303
3545
  }, [
3304
- G("div", { class: "markweave-slash-upload-header" }, [G("button", {
3546
+ U("div", { class: "markweave-slash-upload-header" }, [U("button", {
3305
3547
  type: "button",
3306
3548
  onMousedown: $,
3307
3549
  onClick: () => e.onInputCommandChange(null)
3308
- }, e.messages.common.back), G("strong", null, e.inputCommand ? e.messages.slash.uploadKindLabels[e.inputCommand.uploadKind ?? "upload"] : e.messages.slash.uploadKindLabels.upload)]),
3309
- G("label", { class: "markweave-slash-upload-field" }, [G("span", null, e.messages.slash.uploadValueLabel), G("input", {
3550
+ }, e.messages.common.back), U("strong", null, e.inputCommand ? e.messages.slash.uploadKindLabels[e.inputCommand.uploadKind ?? "upload"] : e.messages.slash.uploadKindLabels.upload)]),
3551
+ U("label", { class: "markweave-slash-upload-field" }, [U("span", null, e.messages.slash.uploadValueLabel), U("input", {
3310
3552
  autofocus: !0,
3311
3553
  value: t.value,
3312
3554
  placeholder: e.messages.slash.uploadValuePlaceholder,
@@ -3314,35 +3556,38 @@ var ta = X({
3314
3556
  t.value = e.target.value;
3315
3557
  },
3316
3558
  onKeydown: (e) => {
3317
- e.key === "Enter" && (e.preventDefault(), c());
3559
+ e.key === "Enter" && (e.preventDefault(), l());
3318
3560
  }
3319
3561
  })]),
3320
- G("label", { class: "markweave-slash-upload-field" }, [G("span", null, e.messages.common.file), G("input", {
3562
+ U("label", { class: "markweave-slash-upload-field" }, [U("span", null, e.messages.common.file), U("input", {
3321
3563
  type: "file",
3322
3564
  onChange: (e) => n.value = e.target.files?.[0] ?? null
3323
3565
  })]),
3324
- r.value ? G("div", {
3566
+ r.value ? U("div", {
3325
3567
  class: "markweave-slash-upload-error",
3326
3568
  role: "alert"
3327
3569
  }, r.value) : null,
3328
- G("div", { class: "markweave-slash-upload-actions" }, [G("button", {
3570
+ U("div", { class: "markweave-slash-upload-actions" }, [U("button", {
3329
3571
  type: "button",
3330
3572
  onMousedown: $,
3331
3573
  onClick: () => e.onInputCommandChange(null)
3332
- }, e.messages.common.cancel), G("button", {
3574
+ }, e.messages.common.cancel), U("button", {
3333
3575
  type: "button",
3334
3576
  "data-primary": "true",
3335
3577
  disabled: i.value,
3336
3578
  onMousedown: $,
3337
- onClick: c
3579
+ onClick: l
3338
3580
  }, e.messages.common.insert)])
3339
- ]) : e.commands.length ? G("div", { class: "markweave-slash-command-list" }, f.map((t) => G("section", {
3581
+ ]) : e.commands.length ? U("div", {
3582
+ ref: s,
3583
+ class: "markweave-slash-command-list"
3584
+ }, p.map((t) => U("section", {
3340
3585
  key: t.group,
3341
3586
  class: "markweave-slash-group",
3342
3587
  "aria-label": t.group
3343
- }, [G("div", { class: "markweave-slash-group-title" }, t.group), ...t.commands.map((t) => {
3344
- let n = e.commands.indexOf(t) === e.state.activeIndex, r = Xt(t);
3345
- return G("button", {
3588
+ }, [U("div", { class: "markweave-slash-group-title" }, t.group), ...t.commands.map((t) => {
3589
+ let n = e.commands.indexOf(t) === e.state.activeIndex, r = an(t);
3590
+ return U("button", {
3346
3591
  key: t.id,
3347
3592
  type: "button",
3348
3593
  role: "option",
@@ -3364,45 +3609,45 @@ var ta = X({
3364
3609
  }
3365
3610
  }
3366
3611
  }, [
3367
- Qi(t.icon),
3368
- G("span", null, t.label),
3369
- t.disabledReason ? G("small", null, t.disabledReason) : null
3612
+ ua(t.icon),
3613
+ U("span", null, t.label),
3614
+ t.disabledReason ? U("small", null, t.disabledReason) : null
3370
3615
  ]);
3371
- })]))) : G("div", {
3616
+ })]))) : U("div", {
3372
3617
  class: "markweave-slash-menu__empty",
3373
3618
  role: "option",
3374
3619
  "aria-disabled": "true"
3375
3620
  }, e.messages.slash.noResults)])]);
3376
3621
  };
3377
3622
  }
3378
- }), ia = {
3379
- "ask-ai": di,
3380
- "move-left": _r,
3381
- "move-right": vr,
3382
- "move-up": yr,
3383
- "move-down": hr,
3384
- "insert-left": wr,
3385
- "insert-right": Cr,
3386
- "insert-above": Sr,
3387
- "insert-below": xr,
3388
- "sort-asc": gr,
3389
- "sort-desc": br,
3390
- color: ni,
3391
- alignment: lr,
3392
- clear: pi,
3393
- duplicate: Ir,
3394
- copy: Ir,
3395
- merge: vi,
3396
- split: yi,
3397
- delete: xi
3398
- }, aa = {
3399
- left: lr,
3400
- center: sr,
3401
- right: ur,
3402
- top: pr,
3403
- middle: dr,
3404
- bottom: fr
3405
- }, oa = X({
3623
+ }), ga = {
3624
+ "ask-ai": yi,
3625
+ "move-left": Tr,
3626
+ "move-right": Er,
3627
+ "move-up": Dr,
3628
+ "move-down": Cr,
3629
+ "insert-left": Mr,
3630
+ "insert-right": jr,
3631
+ "insert-above": Ar,
3632
+ "insert-below": kr,
3633
+ "sort-asc": wr,
3634
+ "sort-desc": Or,
3635
+ color: ui,
3636
+ alignment: _r,
3637
+ clear: xi,
3638
+ duplicate: Wr,
3639
+ copy: Wr,
3640
+ merge: Ei,
3641
+ split: Di,
3642
+ delete: ki
3643
+ }, _a = {
3644
+ left: _r,
3645
+ center: hr,
3646
+ right: vr,
3647
+ top: xr,
3648
+ middle: yr,
3649
+ bottom: br
3650
+ }, va = X({
3406
3651
  name: "MarkweaveVueTableControls",
3407
3652
  props: {
3408
3653
  editor: {
@@ -3439,13 +3684,13 @@ var ta = X({
3439
3684
  }
3440
3685
  },
3441
3686
  setup(e) {
3442
- let t = K(null), n = K(null), r = K("row-edge"), i = K(null), a = K(null), o = K(null), s = K(null), c = K(null), l = K(null), u = K(null), d = K(null), f = K(0), p = K(null), m = K(null), h = K(null), g = K(null), _ = K(null), v = K(null), y = K(null), b = null, x = null, S = null, C = q(() => e.askAi?.enabled === !0 && typeof e.askAi.handler == "function"), w = q(() => e.active ? un(e.editor.state) : Ui), T = q(() => kn(e.editor, e.interactionState, "row", w.value.activeCellPos)), E = q(() => kn(e.editor, e.interactionState, "column", w.value.activeCellPos)), D = q(() => Tn(e.editor)), O = q(() => (D.value, w.value.active && Nn(e.editor, "selection", { askAiEnabled: C.value }).length > 0)), k = q(() => t.value ? Nn(e.editor, t.value, { askAiEnabled: C.value }) : []), A = () => {
3687
+ let t = W(null), n = W(null), r = W("row-edge"), i = W(null), a = W(null), o = W(null), s = W(null), c = W(null), l = W(null), u = W(null), d = W(null), f = W(0), p = W(null), m = W(null), h = W(null), g = W(null), _ = W(null), v = W(null), y = W(null), b = null, x = null, S = null, C = K(() => e.askAi?.enabled === !0 && typeof e.askAi.handler == "function"), w = K(() => e.active ? bn(e.editor.state) : ta), T = K(() => zn(e.editor, e.interactionState, "row", w.value.activeCellPos)), E = K(() => zn(e.editor, e.interactionState, "column", w.value.activeCellPos)), D = K(() => Fn(e.editor)), O = K(() => (D.value, w.value.active && Un(e.editor, "selection", { askAiEnabled: C.value }).length > 0)), k = K(() => t.value ? Un(e.editor, t.value, { askAiEnabled: C.value }) : []), A = () => {
3443
3688
  b === null || typeof window > "u" || (window.clearTimeout(b), b = null);
3444
3689
  }, j = (e) => {
3445
3690
  A(), d.value = e, !(!e || typeof window > "u") && (b = window.setTimeout(() => {
3446
3691
  d.value = null, b = null;
3447
- }, zn));
3448
- }, M = () => {
3692
+ }, Yn));
3693
+ }, ee = () => {
3449
3694
  if (!e.active) {
3450
3695
  i.value = null, a.value = null, o.value = null, s.value = null, c.value = null, j(null);
3451
3696
  return;
@@ -3455,31 +3700,31 @@ var ta = X({
3455
3700
  i.value = null, a.value = null, o.value = null, s.value = null, c.value = null;
3456
3701
  return;
3457
3702
  }
3458
- let l = n.getBoundingClientRect(), u = T.value ? On(e.editor, T.value) : null, d = E.value ? On(e.editor, E.value) : null, f = O.value ? Pn(e.editor) : null, p = wn(e.editor)?.getBoundingClientRect() ?? null;
3459
- u ? i.value = yn({
3703
+ let l = n.getBoundingClientRect(), u = T.value ? Rn(e.editor, T.value) : null, d = E.value ? Rn(e.editor, E.value) : null, f = O.value ? Wn(e.editor) : null, p = Pn(e.editor)?.getBoundingClientRect() ?? null;
3704
+ u ? i.value = kn({
3460
3705
  targetRect: u,
3461
3706
  frameRect: l,
3462
3707
  kind: "row"
3463
- }) : t.value === "row" && r.value === "row-edge" || (i.value = null), d ? a.value = yn({
3708
+ }) : t.value === "row" && r.value === "row-edge" || (i.value = null), d ? a.value = kn({
3464
3709
  targetRect: d,
3465
3710
  frameRect: l,
3466
3711
  kind: "column"
3467
- }) : t.value === "column" && r.value === "column-edge" || (a.value = null), f ? o.value = yn({
3712
+ }) : t.value === "column" && r.value === "column-edge" || (a.value = null), f ? o.value = kn({
3468
3713
  targetRect: f,
3469
3714
  frameRect: l,
3470
3715
  kind: "selection"
3471
3716
  }) : t.value === "selection" && r.value === "selection-edge" || (o.value = null);
3472
3717
  let m = e.interactionState.hoverCellPos !== null && !!(T.value && T.value.index === T.value.visualHeight - 1), h = e.interactionState.hoverCellPos !== null && !!(E.value && E.value.index === E.value.visualWidth - 1);
3473
- s.value = p && m ? bn({
3718
+ s.value = p && m ? An({
3474
3719
  tableRect: p,
3475
3720
  frameRect: l,
3476
3721
  kind: "row"
3477
- }) : null, c.value = p && h ? bn({
3722
+ }) : null, c.value = p && h ? An({
3478
3723
  tableRect: p,
3479
3724
  frameRect: l,
3480
3725
  kind: "column"
3481
3726
  }) : null;
3482
- }, ee = () => {
3727
+ }, te = () => {
3483
3728
  if (!e.active || !t.value) {
3484
3729
  l.value = null;
3485
3730
  return;
@@ -3489,23 +3734,23 @@ var ta = X({
3489
3734
  l.value = null;
3490
3735
  return;
3491
3736
  }
3492
- let a = i.getBoundingClientRect(), o = t.value === "row" ? wn(e.editor)?.getBoundingClientRect() : null, s = o ? {
3737
+ let a = i.getBoundingClientRect(), o = t.value === "row" ? Pn(e.editor)?.getBoundingClientRect() : null, s = o ? {
3493
3738
  left: a.left,
3494
3739
  top: o.top,
3495
3740
  width: a.width,
3496
3741
  height: a.height
3497
3742
  } : a, c = n.getBoundingClientRect(), u = _.value.getBoundingClientRect(), d = v.value?.scrollHeight ?? 0, f = d > 0 ? d + 12 : 0;
3498
- l.value = _n({
3743
+ l.value = Dn({
3499
3744
  anchorRect: s,
3500
3745
  frameRect: c,
3501
- boundaryRect: An(n),
3746
+ boundaryRect: Bn(n),
3502
3747
  menuSize: {
3503
3748
  width: u.width || 254,
3504
3749
  height: f || u.height || 410
3505
3750
  },
3506
3751
  kind: t.value
3507
3752
  });
3508
- }, N = () => {
3753
+ }, M = () => {
3509
3754
  if (!e.active || !t.value || !n.value || !l.value) {
3510
3755
  u.value = null;
3511
3756
  return;
@@ -3516,33 +3761,33 @@ var ta = X({
3516
3761
  return;
3517
3762
  }
3518
3763
  let a = y.value.getBoundingClientRect(), o = Math.max(y.value.scrollHeight + 2, a.height);
3519
- u.value = vn({
3764
+ u.value = On({
3520
3765
  triggerRect: i.getBoundingClientRect(),
3521
3766
  parentMenuRect: _.value.getBoundingClientRect(),
3522
- boundaryRect: An(r),
3767
+ boundaryRect: Bn(r),
3523
3768
  submenuSize: {
3524
3769
  width: a.width || 238,
3525
3770
  height: o || 410
3526
3771
  }
3527
3772
  });
3773
+ }, N = () => {
3774
+ ee(), te(), M();
3528
3775
  }, P = () => {
3529
- M(), ee(), N();
3530
- }, F = () => {
3531
- Y(P);
3532
- }, I = (e, i) => {
3776
+ Y(N);
3777
+ }, F = (e, i) => {
3533
3778
  let a = t.value === e && r.value === i;
3534
- r.value = i, t.value = a ? null : e, n.value = null, u.value = null, F();
3535
- }, L = () => {
3536
- e.editor.view.dispatch(sn(e.editor.state.tr, null));
3537
- }, R = (t, n) => {
3779
+ r.value = i, t.value = a ? null : e, n.value = null, u.value = null, P();
3780
+ }, I = () => {
3781
+ e.editor.view.dispatch(_n(e.editor.state.tr, null));
3782
+ }, L = (t, n) => {
3538
3783
  let r = e.interactionState.hoverCellPos ?? w.value.activeCellPos, i = e.interactionState.hoverCellPos === null ? null : t === "row" ? e.interactionState.hoverVisualRowIndex : e.interactionState.hoverVisualColumnIndex;
3539
- r !== null && Ln(e.editor, r, t, { visualIndex: i }), I(t, n);
3540
- }, te = () => {
3541
- L(), I("selection", "selection-edge");
3784
+ r !== null && qn(e.editor, r, t, { visualIndex: i }), F(t, n);
3785
+ }, R = () => {
3786
+ I(), F("selection", "selection-edge");
3542
3787
  }, z = (r = !1) => {
3543
3788
  t.value = null, n.value = null, l.value = null, u.value = null, r && e.editor.view.focus();
3544
3789
  }, B = async (n, r) => {
3545
- let i = await Sn({
3790
+ let i = await Mn({
3546
3791
  editor: e.editor,
3547
3792
  commandId: n,
3548
3793
  menu: r ?? t.value ?? "selection",
@@ -3550,27 +3795,27 @@ var ta = X({
3550
3795
  });
3551
3796
  return i.copyFeedback ? (j(i.copyFeedback), i.copyPayload && e.onCopyPayload?.(i.copyPayload)) : j(null), e.onCommandResult?.(i.commandResult), i.success;
3552
3797
  }, V = (t) => {
3553
- C.value && (Re(e.editor, t), z(!1));
3798
+ C.value && (Ke(e.editor, t), z(!1));
3554
3799
  }, H = (e) => {
3555
- t.value !== "row" && t.value !== "column" || e(t.value) && (f.value += 1, F());
3556
- }, U = (t) => {
3800
+ t.value !== "row" && t.value !== "column" || e(t.value) && (f.value += 1, P());
3801
+ }, ne = (t) => {
3557
3802
  let n = t === "row" ? T.value : E.value, r = e.interactionState.hoverCellPos ?? w.value.activeCellPos;
3558
- !n || r === null || Un(e.editor, r, t, { visualIndex: n.index }) && B(t === "row" ? "add-row-after" : "add-column-after", t);
3559
- }, ne = (e, t, n) => {
3803
+ !n || r === null || $n(e.editor, r, t, { visualIndex: n.index }) && B(t === "row" ? "add-row-after" : "add-column-after", t);
3804
+ }, re = (e, t, n) => {
3560
3805
  x = {
3561
3806
  axis: e,
3562
3807
  index: t
3563
3808
  }, S = t, n.dataTransfer?.setData("application/x-markweave-table-axis", `${e}:${t}`), n.dataTransfer && (n.dataTransfer.effectAllowed = "move");
3564
- }, re = (t) => {
3809
+ }, ie = (t) => {
3565
3810
  if (!x) return;
3566
- let n = En(e.editor, x.axis, t.clientX, t.clientY);
3811
+ let n = In(e.editor, x.axis, t.clientX, t.clientY);
3567
3812
  n !== null && (t.preventDefault(), S = n, t.dataTransfer && (t.dataTransfer.dropEffect = "move"));
3568
- }, ie = (t) => {
3813
+ }, ae = (t) => {
3569
3814
  let n = x;
3570
3815
  if (!n) return;
3571
- let r = En(e.editor, n.axis, t.clientX, t.clientY) ?? S;
3572
- t.preventDefault(), x = null, S = null, r !== null && In(e.editor, n.axis, n.index, r);
3573
- }, W = q(() => (f.value, t.value === "row" || t.value === "column" ? Dn(e.editor, t.value) : null)), ae = (e) => {
3816
+ let r = In(e.editor, n.axis, t.clientX, t.clientY) ?? S;
3817
+ t.preventDefault(), x = null, S = null, r !== null && Kn(e.editor, n.axis, n.index, r);
3818
+ }, oe = K(() => (f.value, t.value === "row" || t.value === "column" ? Ln(e.editor, t.value) : null)), se = (e) => {
3574
3819
  if (!(!t.value || e.key !== "Escape")) {
3575
3820
  if (n.value) {
3576
3821
  n.value = null;
@@ -3578,20 +3823,20 @@ var ta = X({
3578
3823
  }
3579
3824
  z(!0);
3580
3825
  }
3581
- }, oe = (e) => {
3826
+ }, ce = (e) => {
3582
3827
  if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
3583
3828
  let t = e.currentTarget;
3584
3829
  if (!(t instanceof HTMLElement)) return;
3585
3830
  let n = t.classList.contains("markweave-table-menu") ? t.querySelector(":scope > .markweave-table-menu-scroll") ?? t : t, r = Array.from(n.querySelectorAll(":scope > button[role=\"menuitem\"]:not(:disabled), :scope > button[role=\"menuitemradio\"]:not(:disabled)")), i = r.indexOf(document.activeElement), a = e.key === "ArrowDown" ? 1 : -1, o = i < 0 ? 0 : Math.min(r.length - 1, Math.max(0, i + a));
3586
3831
  e.preventDefault(), e.stopPropagation(), r[o]?.focus();
3587
- }, se = (e) => {
3832
+ }, le = (e) => {
3588
3833
  t.value && (e.target instanceof Node && p.value?.contains(e.target) || z());
3589
3834
  };
3590
- rr(() => {
3591
- P(), window.addEventListener("resize", P), window.addEventListener("scroll", P, !0), document.addEventListener("keydown", ae), document.addEventListener("mousedown", se), document.addEventListener("dragover", re), document.addEventListener("drop", ie);
3592
- }), ir(() => {
3593
- A(), window.removeEventListener("resize", P), window.removeEventListener("scroll", P, !0), document.removeEventListener("keydown", ae), document.removeEventListener("mousedown", se), document.removeEventListener("dragover", re), document.removeEventListener("drop", ie);
3594
- }), J(() => [
3835
+ fr(() => {
3836
+ N(), window.addEventListener("resize", N), window.addEventListener("scroll", N, !0), document.addEventListener("keydown", se), document.addEventListener("mousedown", le), document.addEventListener("dragover", ie), document.addEventListener("drop", ae);
3837
+ }), J(() => {
3838
+ A(), window.removeEventListener("resize", N), window.removeEventListener("scroll", N, !0), document.removeEventListener("keydown", se), document.removeEventListener("mousedown", le), document.removeEventListener("dragover", ie), document.removeEventListener("drop", ae);
3839
+ }), q(() => [
3595
3840
  e.active,
3596
3841
  w.value.activeCellPos,
3597
3842
  w.value.selectionFrom,
@@ -3602,12 +3847,12 @@ var ta = X({
3602
3847
  t.value,
3603
3848
  n.value,
3604
3849
  r.value
3605
- ], F, { flush: "post" });
3606
- let ce = () => {
3850
+ ], P, { flush: "post" });
3851
+ let ue = () => {
3607
3852
  if (!t.value) return null;
3608
3853
  let r = k.value.map((r, i) => {
3609
- let a = jn(r), o = i === 0 ? a : jn(k.value[i - 1]), s = i > 0 && o !== a, c = t.value === "row" || t.value === "column" ? t.value : "selection", l = r.submenuId ? !0 : r.commandId === null ? C.value && Te(e.editor, c) : xn(e.editor, r.commandId), u = Mn(r, e.messages), d = ia[r.icon];
3610
- return G("button", {
3854
+ let a = Vn(r), o = i === 0 ? a : Vn(k.value[i - 1]), s = i > 0 && o !== a, c = t.value === "row" || t.value === "column" ? t.value : "selection", l = r.submenuId ? !0 : r.commandId === null ? C.value && Ne(e.editor, c) : jn(e.editor, r.commandId), u = Hn(r, e.messages), d = ga[r.icon];
3855
+ return U("button", {
3611
3856
  key: `${r.id}-${i}`,
3612
3857
  type: "button",
3613
3858
  role: "menuitem",
@@ -3642,26 +3887,26 @@ var ta = X({
3642
3887
  }
3643
3888
  }
3644
3889
  }, [
3645
- G("span", {
3890
+ U("span", {
3646
3891
  class: "markweave-table-menu-item-icon",
3647
3892
  "aria-hidden": "true"
3648
- }, [G(d, {
3893
+ }, [U(d, {
3649
3894
  size: 18,
3650
3895
  strokeWidth: 1.8
3651
3896
  })]),
3652
- G("span", { class: "markweave-table-menu-item-label" }, u),
3653
- r.submenuId ? G(jr, {
3897
+ U("span", { class: "markweave-table-menu-item-label" }, u),
3898
+ r.submenuId ? U(zr, {
3654
3899
  class: "markweave-table-menu-chevron",
3655
3900
  size: 16,
3656
3901
  "aria-hidden": "true"
3657
3902
  }) : null
3658
3903
  ]);
3659
- }), i = [G("div", {
3904
+ }), i = [U("div", {
3660
3905
  ref: v,
3661
3906
  class: "markweave-table-menu-scroll",
3662
3907
  style: l.value ? { maxHeight: `${Math.max(1, l.value.maxHeight - 12)}px` } : void 0
3663
3908
  }, r)];
3664
- if (n.value === "color" && (t.value === "row" || t.value === "column") && i.push(G("div", {
3909
+ if (n.value === "color" && (t.value === "row" || t.value === "column") && i.push(U("div", {
3665
3910
  ref: y,
3666
3911
  class: "markweave-table-submenu markweave-table-color-menu",
3667
3912
  role: "menu",
@@ -3674,43 +3919,43 @@ var ta = X({
3674
3919
  top: `${u.value.top}px`,
3675
3920
  maxHeight: `${u.value.maxHeight}px`
3676
3921
  } : void 0,
3677
- onKeydown: oe
3922
+ onKeydown: ce
3678
3923
  }, [
3679
- G("div", { class: "markweave-table-submenu-title" }, e.messages.table.submenus.textColor),
3680
- ...Rn.map((t) => G("button", {
3924
+ U("div", { class: "markweave-table-submenu-title" }, e.messages.table.submenus.textColor),
3925
+ ...Jn.map((t) => U("button", {
3681
3926
  key: `text-${t.id}`,
3682
3927
  type: "button",
3683
3928
  role: "menuitemradio",
3684
- "aria-checked": W.value?.textColorId === t.id,
3685
- "data-active": W.value?.textColorId === t.id ? "true" : "false",
3929
+ "aria-checked": oe.value?.textColorId === t.id,
3930
+ "data-active": oe.value?.textColorId === t.id ? "true" : "false",
3686
3931
  "data-testid": `markweave-table-text-color-${t.id}`,
3687
3932
  onMousedown: $,
3688
- onClick: () => H((n) => gn(e.editor, n, t.id))
3689
- }, [G("span", {
3933
+ onClick: () => H((n) => En(e.editor, n, t.id))
3934
+ }, [U("span", {
3690
3935
  class: "markweave-table-color-swatch markweave-table-text-color-swatch",
3691
3936
  "aria-hidden": "true",
3692
3937
  style: { backgroundColor: t.textColor ?? "var(--markweave-text)" }
3693
- }), G("span", null, e.messages.table.colors[t.id].text)])),
3694
- G("div", { class: "markweave-table-submenu-separator" }),
3695
- G("div", { class: "markweave-table-submenu-title" }, e.messages.table.submenus.backgroundColor),
3696
- ...Rn.map((t) => G("button", {
3938
+ }), U("span", null, e.messages.table.colors[t.id].text)])),
3939
+ U("div", { class: "markweave-table-submenu-separator" }),
3940
+ U("div", { class: "markweave-table-submenu-title" }, e.messages.table.submenus.backgroundColor),
3941
+ ...Jn.map((t) => U("button", {
3697
3942
  key: `background-${t.id}`,
3698
3943
  type: "button",
3699
3944
  role: "menuitemradio",
3700
- "aria-checked": W.value?.backgroundColorId === t.id,
3701
- "data-active": W.value?.backgroundColorId === t.id ? "true" : "false",
3945
+ "aria-checked": oe.value?.backgroundColorId === t.id,
3946
+ "data-active": oe.value?.backgroundColorId === t.id ? "true" : "false",
3702
3947
  "data-testid": `markweave-table-background-color-${t.id}`,
3703
3948
  onMousedown: $,
3704
- onClick: () => H((n) => hn(e.editor, n, t.id))
3705
- }, [G("span", {
3949
+ onClick: () => H((n) => Tn(e.editor, n, t.id))
3950
+ }, [U("span", {
3706
3951
  class: "markweave-table-color-swatch",
3707
3952
  "aria-hidden": "true",
3708
3953
  style: { backgroundColor: t.backgroundColor }
3709
- }), G("span", null, e.messages.table.colors[t.id].background)]))
3954
+ }), U("span", null, e.messages.table.colors[t.id].background)]))
3710
3955
  ])), n.value === "alignment" && (t.value === "row" || t.value === "column")) {
3711
3956
  let t = (t, n) => {
3712
- let r = aa[t];
3713
- return G("button", {
3957
+ let r = _a[t];
3958
+ return U("button", {
3714
3959
  key: t,
3715
3960
  type: "button",
3716
3961
  role: "menuitemradio",
@@ -3718,14 +3963,14 @@ var ta = X({
3718
3963
  "data-active": n ? "true" : "false",
3719
3964
  "data-testid": `markweave-table-alignment-${t}`,
3720
3965
  onMousedown: $,
3721
- onClick: () => H((n) => mn(e.editor, n, t))
3722
- }, [G(r, {
3966
+ onClick: () => H((n) => wn(e.editor, n, t))
3967
+ }, [U(r, {
3723
3968
  size: 18,
3724
3969
  strokeWidth: 1.8,
3725
3970
  "aria-hidden": "true"
3726
- }), G("span", null, e.messages.table.alignments[t])]);
3971
+ }), U("span", null, e.messages.table.alignments[t])]);
3727
3972
  };
3728
- i.push(G("div", {
3973
+ i.push(U("div", {
3729
3974
  ref: y,
3730
3975
  class: "markweave-table-submenu markweave-table-alignment-menu",
3731
3976
  role: "menu",
@@ -3738,18 +3983,18 @@ var ta = X({
3738
3983
  top: `${u.value.top}px`,
3739
3984
  maxHeight: `${u.value.maxHeight}px`
3740
3985
  } : void 0,
3741
- onKeydown: oe
3986
+ onKeydown: ce
3742
3987
  }, [
3743
- ...Bn.map((e) => t(e, W.value?.textAlign === e)),
3744
- G("div", { class: "markweave-table-submenu-separator" }),
3745
- ...Hn.map((e) => t(e, W.value?.verticalAlign === e))
3988
+ ...Xn.map((e) => t(e, oe.value?.textAlign === e)),
3989
+ U("div", { class: "markweave-table-submenu-separator" }),
3990
+ ...Qn.map((e) => t(e, oe.value?.verticalAlign === e))
3746
3991
  ]));
3747
3992
  }
3748
- return G("div", {
3993
+ return U("div", {
3749
3994
  ref: _,
3750
3995
  class: "markweave-table-menu",
3751
3996
  role: "menu",
3752
- "aria-label": Vn(t.value, e.messages),
3997
+ "aria-label": Zn(t.value, e.messages),
3753
3998
  "data-testid": "markweave-table-menu",
3754
3999
  "data-positioned": l.value ? "true" : "false",
3755
4000
  "data-placement": l.value?.placement,
@@ -3758,19 +4003,19 @@ var ta = X({
3758
4003
  left: `${l.value.left}px`,
3759
4004
  top: `${l.value.top}px`
3760
4005
  } : void 0,
3761
- onKeydown: oe
4006
+ onKeydown: ce
3762
4007
  }, i);
3763
4008
  };
3764
- return () => e.active ? G("div", {
4009
+ return () => e.active ? U("div", {
3765
4010
  ref: p,
3766
4011
  class: "markweave-table-controls",
3767
4012
  "data-testid": "markweave-table-controls",
3768
4013
  "aria-label": e.messages.table.controlsAriaLabel,
3769
4014
  "data-open-menu": t.value ?? "none",
3770
4015
  "data-positioned": i.value || a.value || o.value ? "true" : "false",
3771
- onMouseleave: () => e.editor.view.dispatch(e.editor.state.tr.setMeta(pn, { type: "clear-hover" }))
4016
+ onMouseleave: () => e.editor.view.dispatch(e.editor.state.tr.setMeta(Cn, { type: "clear-hover" }))
3772
4017
  }, [
3773
- d.value ? G("div", {
4018
+ d.value ? U("div", {
3774
4019
  class: "markweave-table-copy-feedback",
3775
4020
  role: "status",
3776
4021
  "aria-live": "polite",
@@ -3778,8 +4023,8 @@ var ta = X({
3778
4023
  "data-copy-kind": d.value.kind,
3779
4024
  "data-text-length": d.value.textLength,
3780
4025
  "data-html-length": d.value.htmlLength
3781
- }, Cn(d.value)) : null,
3782
- i.value ? G("button", {
4026
+ }, Nn(d.value)) : null,
4027
+ i.value ? U("button", {
3783
4028
  ref: m,
3784
4029
  type: "button",
3785
4030
  draggable: !0,
@@ -3800,16 +4045,16 @@ var ta = X({
3800
4045
  height: `${i.value.height}px`
3801
4046
  },
3802
4047
  onMousedown: $,
3803
- onClick: () => R("row", "row-edge"),
3804
- onDragstart: (e) => ne("row", T.value?.index ?? 0, e),
4048
+ onClick: () => L("row", "row-edge"),
4049
+ onDragstart: (e) => re("row", T.value?.index ?? 0, e),
3805
4050
  onDragend: () => {
3806
4051
  x = null, S = null;
3807
4052
  }
3808
- }, [G(ti, {
4053
+ }, [U(li, {
3809
4054
  size: 14,
3810
4055
  "aria-hidden": "true"
3811
4056
  })]) : null,
3812
- a.value ? G("button", {
4057
+ a.value ? U("button", {
3813
4058
  ref: h,
3814
4059
  type: "button",
3815
4060
  draggable: !0,
@@ -3830,16 +4075,16 @@ var ta = X({
3830
4075
  height: `${a.value.height}px`
3831
4076
  },
3832
4077
  onMousedown: $,
3833
- onClick: () => R("column", "column-edge"),
3834
- onDragstart: (e) => ne("column", E.value?.index ?? 0, e),
4078
+ onClick: () => L("column", "column-edge"),
4079
+ onDragstart: (e) => re("column", E.value?.index ?? 0, e),
3835
4080
  onDragend: () => {
3836
4081
  x = null, S = null;
3837
4082
  }
3838
- }, [G(ti, {
4083
+ }, [U(li, {
3839
4084
  size: 14,
3840
4085
  "aria-hidden": "true"
3841
4086
  })]) : null,
3842
- O.value && o.value ? G("button", {
4087
+ O.value && o.value ? U("button", {
3843
4088
  ref: g,
3844
4089
  type: "button",
3845
4090
  class: "markweave-table-edge-handle markweave-table-edge-handle--selection",
@@ -3855,12 +4100,12 @@ var ta = X({
3855
4100
  height: `${o.value.height}px`
3856
4101
  },
3857
4102
  onMousedown: $,
3858
- onClick: te
3859
- }, [G(ti, {
4103
+ onClick: R
4104
+ }, [U(li, {
3860
4105
  size: 14,
3861
4106
  "aria-hidden": "true"
3862
4107
  })]) : null,
3863
- s.value ? G("button", {
4108
+ s.value ? U("button", {
3864
4109
  type: "button",
3865
4110
  class: "markweave-table-extend-button markweave-table-extend-button--row",
3866
4111
  "aria-label": e.messages.table.addRow,
@@ -3873,12 +4118,12 @@ var ta = X({
3873
4118
  height: `${s.value.height}px`
3874
4119
  },
3875
4120
  onMousedown: $,
3876
- onClick: () => U("row")
3877
- }, [G(ai, {
4121
+ onClick: () => ne("row")
4122
+ }, [U(pi, {
3878
4123
  size: 14,
3879
4124
  "aria-hidden": "true"
3880
4125
  })]) : null,
3881
- c.value ? G("button", {
4126
+ c.value ? U("button", {
3882
4127
  type: "button",
3883
4128
  class: "markweave-table-extend-button markweave-table-extend-button--column",
3884
4129
  "aria-label": e.messages.table.addColumn,
@@ -3891,15 +4136,15 @@ var ta = X({
3891
4136
  height: `${c.value.height}px`
3892
4137
  },
3893
4138
  onMousedown: $,
3894
- onClick: () => U("column")
3895
- }, [G(ai, {
4139
+ onClick: () => ne("column")
4140
+ }, [U(pi, {
3896
4141
  size: 14,
3897
4142
  "aria-hidden": "true"
3898
4143
  })]) : null,
3899
- ce()
4144
+ ue()
3900
4145
  ]) : null;
3901
4146
  }
3902
- }), sa = X({
4147
+ }), ya = X({
3903
4148
  name: "MarkweaveVueTableSelectionOverlay",
3904
4149
  props: {
3905
4150
  editor: {
@@ -3912,18 +4157,18 @@ var ta = X({
3912
4157
  }
3913
4158
  },
3914
4159
  setup(e) {
3915
- let t = K(null), n = () => {
4160
+ let t = W(null), n = () => {
3916
4161
  if (e.focusState.mode !== "cell-selection") {
3917
4162
  t.value = null;
3918
4163
  return;
3919
4164
  }
3920
- t.value = Fn(e.editor, dn(e.editor.state));
4165
+ t.value = Gn(e.editor, xn(e.editor.state));
3921
4166
  };
3922
- return rr(() => {
4167
+ return fr(() => {
3923
4168
  n(), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0);
3924
- }), ir(() => {
4169
+ }), J(() => {
3925
4170
  window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
3926
- }), J(() => [
4171
+ }), q(() => [
3927
4172
  e.focusState.activeCellPos,
3928
4173
  e.focusState.anchorCellPos,
3929
4174
  e.focusState.mode,
@@ -3934,7 +4179,7 @@ var ta = X({
3934
4179
  Y(n);
3935
4180
  }, { flush: "post" }), () => {
3936
4181
  let e = t.value;
3937
- return e ? G("div", {
4182
+ return e ? U("div", {
3938
4183
  "aria-hidden": "true",
3939
4184
  class: "markweave-table-selection-overlay",
3940
4185
  "data-axis-target": e.axisTarget ?? "none",
@@ -3956,7 +4201,7 @@ var ta = X({
3956
4201
  }) : null;
3957
4202
  };
3958
4203
  }
3959
- }), ca = X({
4204
+ }), ba = X({
3960
4205
  name: "MarkweaveVueCodeBlockControls",
3961
4206
  props: {
3962
4207
  editor: {
@@ -3985,53 +4230,53 @@ var ta = X({
3985
4230
  }
3986
4231
  },
3987
4232
  setup(e) {
3988
- let t = K(null), n = K(null), r = K(null), i = K(null), a = K(null), o = K(null), s = K(null), c = K(null), l = K([]), u = K(null), d = K(!1), f = K(""), p = K(-1), m = K(null), h = K(!1), g = K(null), _ = K(null), v = K(!1), y = K({
4233
+ let t = W(null), n = W(null), r = W(null), i = W(null), a = W(null), o = W(null), s = W(null), c = W(null), l = W([]), u = W(null), d = W(!1), f = W(""), p = W(-1), m = W(null), h = W(!1), g = W(null), _ = W(null), v = W(!1), y = W({
3989
4234
  active: !1,
3990
4235
  lastX: 0,
3991
4236
  lastY: 0
3992
- }), b = K(0), x = K(0), S = K(0), C = null, w = q(() => (S.value, bt(e.editor, s.value))), T = q(() => !e.readOnly && e.active && e.state.active && e.state.pos !== null ? {
4237
+ }), b = W(0), x = W(0), S = W(0), C = null, w = K(() => (S.value, Ot(e.editor, s.value))), T = K(() => !e.readOnly && e.active && e.state.active && e.state.pos !== null ? {
3993
4238
  ...e.state,
3994
4239
  pos: e.state.pos,
3995
4240
  active: !0
3996
- } : null), E = q(() => w.value ?? T.value), D = q(() => E.value !== null), O = q(() => E.value?.language === "mermaid"), k = q(() => Tt(e.editor, E.value)), A = q(() => D.value && E.value !== null && !k.value), j = q(() => !e.readOnly), M = q(() => E.value ? pt(E.value.language) : pt("text")), ee = q(() => m.value?.status ?? "idle"), N = q(() => E.value?.mermaidPreviewMode ?? e.mermaidMode), P = q(() => O.value && N.value === "preview"), F = q(() => (S.value, b.value, x.value, Ct(e.editor))), I = q(() => `${x.value}|${F.value.map((e) => `${e.pos}:${e.mermaidPreviewMode}:${e.text.length}`).join("|")}`), L = q(() => _t(f.value)), R = q(() => E.value ? `${E.value.pos}:${E.value.language}:${E.value.text}` : "none"), te = () => {
4241
+ } : null), E = K(() => w.value ?? T.value), D = K(() => E.value !== null), O = K(() => E.value?.language === "mermaid"), k = K(() => Nt(e.editor, E.value)), A = K(() => D.value && E.value !== null && !k.value), j = K(() => !e.readOnly), ee = K(() => E.value ? xt(E.value.language) : xt("text")), te = K(() => m.value?.status ?? "idle"), M = K(() => E.value?.mermaidPreviewMode ?? e.mermaidMode), N = K(() => O.value && M.value === "preview"), P = K(() => (S.value, b.value, x.value, jt(e.editor))), F = K(() => `${x.value}|${P.value.map((e) => `${e.pos}:${e.mermaidPreviewMode}:${e.text.length}`).join("|")}`), I = K(() => Tt(f.value)), L = K(() => E.value ? `${E.value.pos}:${E.value.language}:${E.value.text}` : "none"), R = () => {
3997
4242
  C !== null && (window.clearTimeout(C), C = null);
3998
4243
  }, z = (e) => {
3999
- te(), m.value = e, e && (C = window.setTimeout(() => {
4244
+ R(), m.value = e, e && (C = window.setTimeout(() => {
4000
4245
  m.value = null, C = null;
4001
- }, ot));
4246
+ }, mt));
4002
4247
  }, B = () => {
4003
4248
  g.value = null, _.value = null, v.value = !1, y.value = {
4004
4249
  active: !1,
4005
4250
  lastX: 0,
4006
4251
  lastY: 0
4007
4252
  }, e.editor.view.focus();
4008
- }, H = () => {
4253
+ }, V = () => {
4009
4254
  let n = t.value;
4010
4255
  if (!n) return;
4011
- if (!xt(n) || F.value.length === 0) {
4256
+ if (!kt(n) || P.value.length === 0) {
4012
4257
  l.value = [];
4013
4258
  return;
4014
4259
  }
4015
- let r = n.getBoundingClientRect(), i = F.value.flatMap((t) => {
4016
- let n = gt(ht(e.editor, t.pos, t.mermaidPreviewMode), r);
4017
- return n ? [dt(t, n, r)] : [];
4260
+ let r = n.getBoundingClientRect(), i = P.value.flatMap((t) => {
4261
+ let n = wt(Ct(e.editor, t.pos, t.mermaidPreviewMode), r);
4262
+ return n ? [yt(t, n, r)] : [];
4018
4263
  });
4019
- l.value = Et(l.value, i, F.value.map((e) => e.pos));
4020
- }, U = () => {
4264
+ l.value = Pt(l.value, i, P.value.map((e) => e.pos));
4265
+ }, H = () => {
4021
4266
  if (!A.value || !E.value) {
4022
4267
  c.value = null, u.value = null;
4023
4268
  return;
4024
4269
  }
4025
4270
  let i = t.value;
4026
4271
  if (!i) return;
4027
- let a = ht(e.editor, E.value.pos, N.value), o = i.getBoundingClientRect(), s = gt(a, o);
4272
+ let a = Ct(e.editor, E.value.pos, M.value), o = i.getBoundingClientRect(), s = wt(a, o);
4028
4273
  if (!s) {
4029
4274
  c.value = c.value?.pos === E.value.pos ? c.value : null, u.value = d.value ? u.value : null;
4030
4275
  return;
4031
4276
  }
4032
- if (c.value = lt(E.value.pos, s, o), d.value && n.value) {
4277
+ if (c.value = _t(E.value.pos, s, o), d.value && n.value) {
4033
4278
  let e = n.value.getBoundingClientRect(), t = r.value?.getBoundingClientRect().height;
4034
- u.value = it({
4279
+ u.value = ft({
4035
4280
  overlayRect: o,
4036
4281
  buttonRect: e,
4037
4282
  menuHeight: t,
@@ -4042,81 +4287,81 @@ var ta = X({
4042
4287
  }, ne = async () => {
4043
4288
  if (e.readOnly) {
4044
4289
  if (!E.value) return;
4045
- let e = await st(E.value.text);
4046
- z($e(E.value, e ? "copied" : "failed"));
4290
+ let e = await ht(E.value.text);
4291
+ z(st(E.value, e ? "copied" : "failed"));
4047
4292
  return;
4048
4293
  }
4049
- if (!ft(e.editor, E.value)) return;
4050
- let t = await Ze(e.editor);
4051
- z($e(Qe(e.editor), t ? "copied" : "failed")), e.editor.view.focus();
4294
+ if (!bt(e.editor, E.value)) return;
4295
+ let t = await at(e.editor);
4296
+ z(st(ot(e.editor), t ? "copied" : "failed")), e.editor.view.focus();
4052
4297
  }, re = (t, n) => {
4053
4298
  if (e.readOnly) {
4054
- qt(e.editor, t.pos, n) && (x.value += 1, S.value += 1);
4299
+ tn(e.editor, t.pos, n) && (x.value += 1, S.value += 1);
4055
4300
  return;
4056
4301
  }
4057
4302
  let r = e.state.active && e.state.pos === t.pos;
4058
- rt(e.editor, t.pos, n) && (e.onMermaidModeChange(n), S.value += 1, r && e.editor.view.focus());
4303
+ dt(e.editor, t.pos, n) && (e.onMermaidModeChange(n), S.value += 1, r && e.editor.view.focus());
4059
4304
  }, ie = (t) => {
4060
4305
  if (e.readOnly || !E.value) return;
4061
4306
  let n = e.state.active && e.state.pos === E.value.pos;
4062
- nt(e.editor, E.value.pos, t) && (t === "mermaid" && rt(e.editor, E.value.pos, "preview") && e.onMermaidModeChange("preview"), d.value = !1, f.value = "", p.value = -1, S.value += 1, n && e.editor.view.focus());
4063
- }, W = () => {
4064
- d.value = !d.value, d.value && o.value === null && (o.value = ct()), p.value = d.value ? St(L.value, E.value?.language ?? null) : -1;
4065
- }, ae = (e) => {
4066
- let t = _t(e);
4067
- f.value = e, p.value = St(t, e.trim() ? null : E.value?.language ?? null);
4068
- }, oe = (t) => {
4307
+ ut(e.editor, E.value.pos, t) && (t === "mermaid" && dt(e.editor, E.value.pos, "preview") && e.onMermaidModeChange("preview"), d.value = !1, f.value = "", p.value = -1, S.value += 1, n && e.editor.view.focus());
4308
+ }, ae = () => {
4309
+ d.value = !d.value, d.value && o.value === null && (o.value = gt()), p.value = d.value ? At(I.value, E.value?.language ?? null) : -1;
4310
+ }, se = (e) => {
4311
+ let t = Tt(e);
4312
+ f.value = e, p.value = At(t, e.trim() ? null : E.value?.language ?? null);
4313
+ }, ce = (t) => {
4069
4314
  if (!t.isComposing) {
4070
4315
  if (t.key === "ArrowDown" || t.key === "ArrowUp") {
4071
- t.preventDefault(), p.value = Ot(p.value, L.value.length, t.key === "ArrowUp" ? "previous" : "next");
4316
+ t.preventDefault(), p.value = It(p.value, I.value.length, t.key === "ArrowUp" ? "previous" : "next");
4072
4317
  return;
4073
4318
  }
4074
4319
  if (t.key === "Enter") {
4075
- let e = L.value[p.value];
4320
+ let e = I.value[p.value];
4076
4321
  e && (t.preventDefault(), ie(e.language));
4077
4322
  return;
4078
4323
  }
4079
4324
  t.key === "Escape" && (t.preventDefault(), d.value = !1, p.value = -1, e.editor.view.focus());
4080
4325
  }
4081
- }, se = () => {
4082
- e.readOnly || !E.value || tt(e.editor, E.value.pos, !k.value) && (b.value += 1, S.value += 1, s.value = null);
4083
- }, ce = () => {
4326
+ }, le = () => {
4327
+ e.readOnly || !E.value || lt(e.editor, E.value.pos, !k.value) && (b.value += 1, S.value += 1, s.value = null);
4328
+ }, ue = () => {
4084
4329
  if (!E.value) return;
4085
- let t = wt(e.editor, E.value.pos);
4086
- t && V({
4330
+ let t = Mt(e.editor, E.value.pos);
4331
+ t && oe({
4087
4332
  data: new Blob([t], { type: "image/svg+xml" }),
4088
4333
  fileName: "markweave-mermaid.svg",
4089
4334
  onSettled: () => e.editor.view.focus(),
4090
4335
  ownerDocument: document
4091
4336
  });
4092
- }, le = () => {
4337
+ }, de = () => {
4093
4338
  if (!E.value) return;
4094
- let t = wt(e.editor, E.value.pos);
4095
- t && (g.value = ut(t), _.value = null, v.value = !1, y.value = {
4339
+ let t = Mt(e.editor, E.value.pos);
4340
+ t && (g.value = vt(t), _.value = null, v.value = !1, y.value = {
4096
4341
  active: !1,
4097
4342
  lastX: 0,
4098
4343
  lastY: 0
4099
4344
  });
4100
- }, ue = (e) => {
4345
+ }, fe = (e) => {
4101
4346
  g.value = g.value ? {
4102
4347
  ...g.value,
4103
- scale: at(g.value.scale + e)
4348
+ scale: pt(g.value.scale + e)
4104
4349
  } : null;
4105
- }, de = () => {
4106
- g.value = g.value ? ut(g.value.svg) : null, y.value = {
4350
+ }, pe = () => {
4351
+ g.value = g.value ? vt(g.value.svg) : null, y.value = {
4107
4352
  active: !1,
4108
4353
  lastX: 0,
4109
4354
  lastY: 0
4110
4355
  }, v.value = !1;
4111
- }, fe = (e) => {
4112
- e.preventDefault(), ue(e.deltaY < 0 ? Dt : -Dt);
4113
- }, pe = (e) => {
4356
+ }, me = (e) => {
4357
+ e.preventDefault(), fe(e.deltaY < 0 ? Ft : -Ft);
4358
+ }, he = (e) => {
4114
4359
  e.button === 0 && (e.preventDefault(), y.value = {
4115
4360
  active: !0,
4116
4361
  lastX: e.clientX,
4117
4362
  lastY: e.clientY
4118
4363
  }, v.value = !0);
4119
- }, me = (e) => {
4364
+ }, ge = (e) => {
4120
4365
  let t = y.value;
4121
4366
  if (!t.active) return;
4122
4367
  let n = e.clientX - t.lastX, r = e.clientY - t.lastY;
@@ -4124,25 +4369,25 @@ var ta = X({
4124
4369
  active: !0,
4125
4370
  lastX: e.clientX,
4126
4371
  lastY: e.clientY
4127
- }, g.value = kt(g.value, n, r);
4128
- }, he = () => {
4372
+ }, g.value = Lt(g.value, n, r);
4373
+ }, _e = () => {
4129
4374
  y.value = {
4130
4375
  active: !1,
4131
4376
  lastX: 0,
4132
4377
  lastY: 0
4133
4378
  }, v.value = !1;
4134
4379
  };
4135
- J(() => e.readOnly, (e) => {
4380
+ q(() => e.readOnly, (e) => {
4136
4381
  e && (d.value = !1, f.value = "");
4137
- }), J(R, () => {
4382
+ }), q(L, () => {
4138
4383
  z(null), d.value = !1, f.value = "", p.value = -1, g.value = null, _.value = null, v.value = !1;
4139
- }), J(d, async (e) => {
4384
+ }), q(d, async (e) => {
4140
4385
  if (!e) {
4141
4386
  p.value = -1;
4142
4387
  return;
4143
4388
  }
4144
- await Y(), U(), i.value?.focus({ preventScroll: !0 });
4145
- }), J(() => [
4389
+ await Y(), H(), i.value?.focus({ preventScroll: !0 });
4390
+ }), q(() => [
4146
4391
  d.value,
4147
4392
  f.value,
4148
4393
  p.value
@@ -4150,31 +4395,31 @@ var ta = X({
4150
4395
  if (!d.value || p.value < 0) return;
4151
4396
  await Y();
4152
4397
  let e = a.value, t = e?.querySelector(`[data-language-index="${p.value}"]`);
4153
- e && t && At(e, t);
4154
- }, { flush: "post" }), J(() => [
4398
+ e && t && Rt(e, t);
4399
+ }, { flush: "post" }), q(() => [
4155
4400
  A.value,
4156
4401
  b.value,
4157
4402
  E.value?.pos ?? null,
4158
- L.value.length,
4403
+ I.value.length,
4159
4404
  d.value,
4160
- N.value
4405
+ M.value
4161
4406
  ], async () => {
4162
- await Y(), U();
4407
+ await Y(), H();
4163
4408
  }, {
4164
4409
  flush: "post",
4165
4410
  immediate: !0
4166
- }), J(I, async () => {
4167
- await Y(), H(), window.requestAnimationFrame(H);
4411
+ }), q(F, async () => {
4412
+ await Y(), V(), window.requestAnimationFrame(V);
4168
4413
  }, {
4169
4414
  flush: "post",
4170
4415
  immediate: !0
4171
4416
  });
4172
- let ge = null;
4173
- return rr(() => {
4417
+ let ve = null;
4418
+ return fr(() => {
4174
4419
  Y(() => {
4175
4420
  let n = e.editor.view.dom.closest(".markweave-editor-frame"), r = (n) => {
4176
4421
  if (n.target instanceof Node && t.value?.contains(n.target) || d.value) return;
4177
- let r = yt(e.editor, n.target), i = bt(e.editor, r), a = i && !Tt(e.editor, i) ? i.pos : null;
4422
+ let r = Dt(e.editor, n.target), i = Ot(e.editor, r), a = i && !Nt(e.editor, i) ? i.pos : null;
4178
4423
  s.value = s.value === a ? s.value : a;
4179
4424
  }, i = () => {
4180
4425
  d.value || (s.value = null);
@@ -4189,16 +4434,16 @@ var ta = X({
4189
4434
  }, o = (e) => {
4190
4435
  d.value && (e.target instanceof Node && t.value?.contains(e.target) || (d.value = !1, p.value = -1));
4191
4436
  }, c = ({ transaction: e }) => {
4192
- e.getMeta(Xe) && (b.value += 1), (e.docChanged || e.selectionSet || e.getMeta(Xe) || Wt(e)) && (S.value += 1);
4437
+ e.getMeta(it) && (b.value += 1), (e.docChanged || e.selectionSet || e.getMeta(it) || Qt(e)) && (S.value += 1);
4193
4438
  };
4194
- n?.addEventListener("mousemove", r), n?.addEventListener("mouseleave", i), window.addEventListener("resize", U), window.addEventListener("scroll", U, !0), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), document.addEventListener("keydown", a), document.addEventListener("mousedown", o), e.editor.on("transaction", c), ge = () => {
4195
- n?.removeEventListener("mousemove", r), n?.removeEventListener("mouseleave", i), window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0), window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0), document.removeEventListener("keydown", a), document.removeEventListener("mousedown", o), e.editor.off("transaction", c), te();
4439
+ n?.addEventListener("mousemove", r), n?.addEventListener("mouseleave", i), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), window.addEventListener("resize", V), window.addEventListener("scroll", V, !0), document.addEventListener("keydown", a), document.addEventListener("mousedown", o), e.editor.on("transaction", c), ve = () => {
4440
+ n?.removeEventListener("mousemove", r), n?.removeEventListener("mouseleave", i), window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0), window.removeEventListener("resize", V), window.removeEventListener("scroll", V, !0), document.removeEventListener("keydown", a), document.removeEventListener("mousedown", o), e.editor.off("transaction", c), R();
4196
4441
  };
4197
4442
  });
4198
- }), ir(() => {
4199
- ge?.(), ge = null, te();
4443
+ }), J(() => {
4444
+ ve?.(), ve = null, R();
4200
4445
  }), () => {
4201
- if (!A.value && F.value.length === 0 && !g.value) return null;
4446
+ if (!A.value && P.value.length === 0 && !g.value) return null;
4202
4447
  let s = c.value ? {
4203
4448
  top: `${c.value.top}px`,
4204
4449
  right: `${c.value.right}px`
@@ -4206,15 +4451,15 @@ var ta = X({
4206
4451
  left: `${u.value.left}px`,
4207
4452
  top: `${u.value.top}px`
4208
4453
  } : void 0;
4209
- return G("div", {
4454
+ return U("div", {
4210
4455
  ref: t,
4211
4456
  class: "markweave-codeblock-overlay",
4212
4457
  "data-testid": "markweave-codeblock-overlay",
4213
4458
  "data-read-only": e.readOnly ? "true" : "false"
4214
4459
  }, [
4215
- ...F.value.map((e) => {
4460
+ ...P.value.map((e) => {
4216
4461
  let t = l.value.find((t) => t.pos === e.pos);
4217
- return G("div", {
4462
+ return U("div", {
4218
4463
  key: e.pos,
4219
4464
  class: "markweave-mermaid-tabs",
4220
4465
  "data-testid": "markweave-mermaid-tabs",
@@ -4224,7 +4469,7 @@ var ta = X({
4224
4469
  top: `${t.top}px`,
4225
4470
  left: `${t.left}px`
4226
4471
  } : void 0
4227
- }, ["code", "preview"].map((t) => G("button", {
4472
+ }, ["code", "preview"].map((t) => U("button", {
4228
4473
  key: t,
4229
4474
  type: "button",
4230
4475
  "data-testid": `markweave-mermaid-mode-${t}`,
@@ -4233,7 +4478,7 @@ var ta = X({
4233
4478
  onClick: () => re(e, t)
4234
4479
  }, t === "code" ? "Code" : "Preview")));
4235
4480
  }),
4236
- A.value && E.value ? G("div", {
4481
+ A.value && E.value ? U("div", {
4237
4482
  class: "markweave-codeblock-controls",
4238
4483
  "data-testid": "markweave-codeblock-controls",
4239
4484
  "data-positioned": c.value ? "true" : "false",
@@ -4242,11 +4487,11 @@ var ta = X({
4242
4487
  "aria-label": "Code block controls",
4243
4488
  style: s
4244
4489
  }, [
4245
- e.readOnly ? G("span", {
4490
+ e.readOnly ? U("span", {
4246
4491
  class: "markweave-codeblock-language-button markweave-codeblock-language-label",
4247
4492
  "aria-label": "Code block language",
4248
4493
  "data-testid": "markweave-codeblock-language"
4249
- }, [G("span", null, M.value)]) : G("button", {
4494
+ }, [U("span", null, ee.value)]) : U("button", {
4250
4495
  ref: n,
4251
4496
  type: "button",
4252
4497
  class: "markweave-codeblock-language-button",
@@ -4255,9 +4500,9 @@ var ta = X({
4255
4500
  "aria-haspopup": "listbox",
4256
4501
  "data-testid": "markweave-codeblock-language",
4257
4502
  onMousedown: $,
4258
- onClick: W
4259
- }, [G("span", null, M.value), Ji("chevron")]),
4260
- j.value ? G("button", {
4503
+ onClick: ae
4504
+ }, [U("span", null, ee.value), oa("chevron")]),
4505
+ j.value ? U("button", {
4261
4506
  type: "button",
4262
4507
  class: "markweave-codeblock-icon-button markweave-codeblock-collapse-button",
4263
4508
  "aria-label": k.value ? "Expand code block" : "Collapse code block",
@@ -4265,14 +4510,14 @@ var ta = X({
4265
4510
  "data-testid": "markweave-codeblock-collapse",
4266
4511
  "data-collapsed": k.value ? "true" : "false",
4267
4512
  onMousedown: $,
4268
- onClick: se
4269
- }, [Ji("chevron")]) : null,
4270
- G("span", { class: "markweave-codeblock-copy-wrap" }, [G("button", {
4513
+ onClick: le
4514
+ }, [oa("chevron")]) : null,
4515
+ U("span", { class: "markweave-codeblock-copy-wrap" }, [U("button", {
4271
4516
  type: "button",
4272
4517
  class: "markweave-codeblock-icon-button",
4273
4518
  "aria-label": "Copy to clipboard",
4274
4519
  "data-testid": "markweave-codeblock-copy",
4275
- "data-copy-state": ee.value,
4520
+ "data-copy-state": te.value,
4276
4521
  onMousedown: $,
4277
4522
  onMouseenter: () => {
4278
4523
  h.value = !0;
@@ -4289,64 +4534,64 @@ var ta = X({
4289
4534
  onClick: () => {
4290
4535
  ne();
4291
4536
  }
4292
- }, [Ji(ee.value === "copied" ? "check" : "clipboard")]), h.value ? G("span", {
4537
+ }, [oa(te.value === "copied" ? "check" : "clipboard")]), h.value ? U("span", {
4293
4538
  class: "markweave-codeblock-tooltip",
4294
4539
  role: "tooltip",
4295
4540
  "data-testid": "markweave-codeblock-copy-tooltip"
4296
4541
  }, "Copy to clipboard") : null]),
4297
- O.value && N.value === "preview" ? G("div", {
4542
+ O.value && M.value === "preview" ? U("div", {
4298
4543
  class: "markweave-mermaid-preview-actions",
4299
4544
  "data-testid": "markweave-mermaid-preview-actions"
4300
- }, [G("button", {
4545
+ }, [U("button", {
4301
4546
  type: "button",
4302
4547
  class: "markweave-codeblock-icon-button",
4303
4548
  "aria-label": "Fullscreen Mermaid preview",
4304
4549
  "data-testid": "markweave-mermaid-fullscreen",
4305
- disabled: !P.value,
4550
+ disabled: !N.value,
4306
4551
  onMousedown: $,
4307
- onClick: le
4308
- }, [Ji("expand")]), G("button", {
4552
+ onClick: de
4553
+ }, [oa("expand")]), U("button", {
4309
4554
  type: "button",
4310
4555
  class: "markweave-codeblock-icon-button",
4311
4556
  "aria-label": "Download Mermaid SVG",
4312
4557
  "data-testid": "markweave-mermaid-download",
4313
- disabled: !P.value,
4558
+ disabled: !N.value,
4314
4559
  onMousedown: $,
4315
- onClick: ce
4316
- }, [Ji("download")])]) : null
4560
+ onClick: ue
4561
+ }, [oa("download")])]) : null
4317
4562
  ]) : null,
4318
- j.value && A.value && d.value && E.value ? G("div", {
4563
+ j.value && A.value && d.value && E.value ? U("div", {
4319
4564
  ref: r,
4320
4565
  class: "markweave-codeblock-language-menu",
4321
4566
  "data-testid": "markweave-codeblock-language-menu",
4322
4567
  "data-positioned": u.value ? "true" : "false",
4323
4568
  style: m
4324
- }, [G("label", { class: "markweave-codeblock-language-search" }, [G("input", {
4569
+ }, [U("label", { class: "markweave-codeblock-language-search" }, [U("input", {
4325
4570
  ref: i,
4326
4571
  role: "combobox",
4327
4572
  "aria-autocomplete": "list",
4328
4573
  "aria-controls": o.value ?? void 0,
4329
4574
  "aria-expanded": "true",
4330
- "aria-activedescendant": o.value && L.value[p.value] ? vt(o.value, L.value[p.value].language) : void 0,
4575
+ "aria-activedescendant": o.value && I.value[p.value] ? Et(o.value, I.value[p.value].language) : void 0,
4331
4576
  "aria-label": "Search code block languages",
4332
4577
  value: f.value,
4333
4578
  placeholder: "Search...",
4334
4579
  "data-testid": "markweave-codeblock-language-search",
4335
4580
  onInput: (e) => {
4336
- ae(e.target.value);
4581
+ se(e.target.value);
4337
4582
  },
4338
- onKeydown: oe
4339
- }), Ji("search")]), G("div", {
4583
+ onKeydown: ce
4584
+ }), oa("search")]), U("div", {
4340
4585
  ref: a,
4341
4586
  id: o.value ?? void 0,
4342
4587
  class: "markweave-codeblock-language-list",
4343
4588
  role: "listbox",
4344
4589
  "aria-label": "Code block languages"
4345
- }, L.value.map((e, t) => {
4590
+ }, I.value.map((e, t) => {
4346
4591
  let n = E.value?.language === e.language, r = t === p.value;
4347
- return G("button", {
4592
+ return U("button", {
4348
4593
  key: e.language,
4349
- id: o.value ? vt(o.value, e.language) : void 0,
4594
+ id: o.value ? Et(o.value, e.language) : void 0,
4350
4595
  type: "button",
4351
4596
  role: "option",
4352
4597
  "aria-selected": n ? "true" : "false",
@@ -4359,20 +4604,20 @@ var ta = X({
4359
4604
  p.value = t;
4360
4605
  },
4361
4606
  onClick: () => ie(e.language)
4362
- }, [G("span", null, e.label), n ? Ji("check") : null]);
4607
+ }, [U("span", null, e.label), n ? oa("check") : null]);
4363
4608
  }))]) : null,
4364
- g.value ? G("div", {
4609
+ g.value ? U("div", {
4365
4610
  class: "markweave-mermaid-fullscreen-layer",
4366
4611
  role: "dialog",
4367
4612
  "aria-modal": "true",
4368
4613
  "aria-label": "Mermaid preview",
4369
4614
  "data-testid": "markweave-mermaid-fullscreen-layer"
4370
4615
  }, [
4371
- G("div", {
4616
+ U("div", {
4372
4617
  class: "markweave-mermaid-fullscreen-toolbar",
4373
4618
  "data-testid": "markweave-mermaid-fullscreen-toolbar"
4374
4619
  }, [
4375
- G("button", {
4620
+ U("button", {
4376
4621
  type: "button",
4377
4622
  class: "markweave-mermaid-fullscreen-control",
4378
4623
  "aria-label": "Zoom out",
@@ -4389,13 +4634,13 @@ var ta = X({
4389
4634
  onBlur: () => {
4390
4635
  _.value = null;
4391
4636
  },
4392
- onClick: () => ue(-Dt)
4393
- }, [Ji("zoomOut")]),
4394
- G("span", {
4637
+ onClick: () => fe(-Ft)
4638
+ }, [oa("zoomOut")]),
4639
+ U("span", {
4395
4640
  class: "markweave-mermaid-fullscreen-zoom-label",
4396
4641
  "data-testid": "markweave-mermaid-fullscreen-zoom-label"
4397
- }, mt(g.value.scale)),
4398
- G("button", {
4642
+ }, St(g.value.scale)),
4643
+ U("button", {
4399
4644
  type: "button",
4400
4645
  class: "markweave-mermaid-fullscreen-control",
4401
4646
  "aria-label": "Zoom in",
@@ -4412,9 +4657,9 @@ var ta = X({
4412
4657
  onBlur: () => {
4413
4658
  _.value = null;
4414
4659
  },
4415
- onClick: () => ue(Dt)
4416
- }, [Ji("zoomIn")]),
4417
- G("button", {
4660
+ onClick: () => fe(Ft)
4661
+ }, [oa("zoomIn")]),
4662
+ U("button", {
4418
4663
  type: "button",
4419
4664
  class: "markweave-mermaid-fullscreen-control",
4420
4665
  "aria-label": "Reset zoom",
@@ -4431,31 +4676,31 @@ var ta = X({
4431
4676
  onBlur: () => {
4432
4677
  _.value = null;
4433
4678
  },
4434
- onClick: de
4435
- }, [Ji("reset")]),
4436
- _.value ? G("span", {
4679
+ onClick: pe
4680
+ }, [oa("reset")]),
4681
+ _.value ? U("span", {
4437
4682
  class: "markweave-mermaid-fullscreen-tooltip",
4438
4683
  role: "tooltip",
4439
4684
  "data-testid": "markweave-mermaid-fullscreen-tooltip"
4440
4685
  }, _.value === "zoom-out" ? "Zoom out" : _.value === "zoom-in" ? "Zoom in" : "Reset") : null
4441
4686
  ]),
4442
- G("button", {
4687
+ U("button", {
4443
4688
  type: "button",
4444
4689
  class: "markweave-mermaid-fullscreen-close",
4445
4690
  "aria-label": "Close fullscreen Mermaid preview",
4446
4691
  "data-testid": "markweave-mermaid-fullscreen-close",
4447
4692
  onClick: B
4448
- }, [Ji("close")]),
4449
- G("div", {
4693
+ }, [oa("close")]),
4694
+ U("div", {
4450
4695
  class: "markweave-mermaid-fullscreen-viewport",
4451
4696
  "data-testid": "markweave-mermaid-fullscreen-viewport",
4452
4697
  "data-dragging": v.value ? "true" : "false",
4453
- onWheel: fe,
4454
- onMousedown: pe,
4455
- onMousemove: me,
4456
- onMouseup: he,
4457
- onMouseleave: he
4458
- }, [G("div", {
4698
+ onWheel: me,
4699
+ onMousedown: he,
4700
+ onMousemove: ge,
4701
+ onMouseup: _e,
4702
+ onMouseleave: _e
4703
+ }, [U("div", {
4459
4704
  class: "markweave-mermaid-fullscreen-content",
4460
4705
  "data-testid": "markweave-mermaid-fullscreen-content",
4461
4706
  "data-scale-percent": Math.round(g.value.scale * 100),
@@ -4471,7 +4716,7 @@ var ta = X({
4471
4716
  ]);
4472
4717
  };
4473
4718
  }
4474
- }), la = X({
4719
+ }), xa = X({
4475
4720
  name: "MarkweaveVueInnerToc",
4476
4721
  props: {
4477
4722
  editor: {
@@ -4496,29 +4741,29 @@ var ta = X({
4496
4741
  }
4497
4742
  },
4498
4743
  setup(e) {
4499
- let t = K(null), n, r, i = () => {
4500
- n?.(), n = e.placement === "container" && t.value ? qe(t.value) : void 0;
4744
+ let t = W(null), n, r, i = () => {
4745
+ n?.(), n = e.placement === "container" && t.value ? tt(t.value) : void 0;
4501
4746
  }, a = () => {
4502
- r?.(), r = t.value && e.state.items.length ? Je(t.value, e.state.items.length) : void 0;
4747
+ r?.(), r = t.value && e.state.items.length ? nt(t.value, e.state.items.length) : void 0;
4503
4748
  };
4504
- return rr(() => {
4749
+ return fr(() => {
4505
4750
  i(), a();
4506
- }), ir(() => {
4751
+ }), J(() => {
4507
4752
  n?.(), r?.();
4508
- }), J(() => e.placement, i), J(() => e.state.items.length, a, { flush: "post" }), () => e.state.items.length ? G("nav", {
4753
+ }), q(() => e.placement, i), q(() => e.state.items.length, a, { flush: "post" }), () => e.state.items.length ? U("nav", {
4509
4754
  ref: t,
4510
4755
  class: "markweave-inner-toc",
4511
4756
  "data-testid": "markweave-inner-toc",
4512
4757
  "aria-label": e.messages.toc.ariaLabel,
4513
- style: { "--markweave-inner-toc-rail-height": Ue(e.state.items.length) }
4514
- }, [G("div", {
4758
+ style: { "--markweave-inner-toc-rail-height": Ze(e.state.items.length) }
4759
+ }, [U("div", {
4515
4760
  class: "markweave-inner-toc-rail",
4516
4761
  "aria-hidden": "true"
4517
- }, e.state.items.map((e) => G("span", {
4762
+ }, e.state.items.map((e) => U("span", {
4518
4763
  key: e.id,
4519
4764
  "data-level": e.level,
4520
4765
  "data-active": e.active ? "true" : "false"
4521
- }))), G("div", { class: "markweave-inner-toc-panel" }, [G("div", { class: "markweave-inner-toc-list" }, e.state.items.map((t) => G("button", {
4766
+ }))), U("div", { class: "markweave-inner-toc-panel" }, [U("div", { class: "markweave-inner-toc-list" }, e.state.items.map((t) => U("button", {
4522
4767
  key: t.id,
4523
4768
  type: "button",
4524
4769
  class: "markweave-inner-toc-item",
@@ -4527,34 +4772,36 @@ var ta = X({
4527
4772
  "aria-current": t.active ? "location" : void 0,
4528
4773
  "aria-label": `${e.messages.toc.itemAriaLabel}: ${t.text}`,
4529
4774
  title: t.text,
4530
- onClick: () => Ye(e.editor, t, {
4775
+ onClick: () => rt(e.editor, t, {
4531
4776
  behavior: "smooth",
4532
4777
  focus: e.editable
4533
4778
  })
4534
4779
  }, t.text)))])]) : null;
4535
4780
  }
4536
4781
  });
4537
- function ua(e = {}) {
4538
- let i = r(e.lang), o = n(i), s = t(i), c = K(f(e.mode)), l = q(() => be(e.theme)), u = q(() => c.value === "live" && e.editable !== !1), d = K(0), m = nr(null), h = K(an), g = nr(null), _ = nr(null), v = K("code"), y = nr(null), b = nr(fn), x = K(null), S = K(!1), C = nr(null), w = W(e.content === void 0 ? e.defaultContentFormat : e.contentFormat), T = e.content ?? e.defaultContent ?? "", E = typeof T == "string" && T.length >= 2e5, D = null;
4782
+ function Sa(e = {}) {
4783
+ let i = r(e.lang), o = n(i), s = t(i), c = W(f(e.mode)), l = K(() => Oe(e.theme)), u = K(() => c.value === "live" && e.editable !== !1), d = W(0), m = G(null), h = W(hn), g = G(null), _ = G(null), v = W("code"), y = G(null), b = G(Sn), x = W(null), S = W(!1), C = G(null), w = fe(e.content === void 0 ? e.defaultContentFormat : e.contentFormat), T = e.content ?? e.defaultContent ?? "", E = typeof T == "string" && T.length >= 2e5, D = null;
4539
4784
  function O() {
4540
4785
  D !== null && (window.clearTimeout(D), D = null), d.value += 1;
4541
4786
  }
4542
4787
  function k() {
4543
4788
  D !== null && window.clearTimeout(D), D = window.setTimeout(() => {
4544
4789
  D = null, d.value += 1;
4545
- }, _e);
4790
+ }, Te);
4546
4791
  }
4547
- let A = e.onSlashCommandUpload, j = nr(null);
4792
+ let A = e.onSlashCommandUpload, j = G(null);
4548
4793
  j.value = new a({
4549
- extensions: Hi({
4794
+ extensions: ea({
4550
4795
  lang: i,
4551
4796
  linkCardResolver: e.linkCardResolver,
4552
- onImageUpload: (e) => A?.(e) ?? L(e) ?? Promise.reject(/* @__PURE__ */ Error("File upload requires an upload handler.")),
4553
- onVideoUpload: (e) => A?.(e) ?? L(e) ?? Promise.reject(/* @__PURE__ */ Error("File upload requires an upload handler.")),
4797
+ onImageUpload: (e) => A?.(e) ?? H(e) ?? Promise.reject(/* @__PURE__ */ Error("File upload requires an upload handler.")),
4798
+ onVideoUpload: (e) => A?.(e) ?? H(e) ?? Promise.reject(/* @__PURE__ */ Error("File upload requires an upload handler.")),
4799
+ onAttachmentUpload: (t) => e.onSlashCommandUpload?.(t) ?? H(t) ?? Promise.reject(/* @__PURE__ */ Error("File upload requires an upload handler.")),
4800
+ onAttachmentDownload: (t, n) => e.onAttachmentDownload?.(t, n),
4554
4801
  resolveMediaSource: e.resolveMediaSource
4555
4802
  }),
4556
4803
  content: T,
4557
- contentType: ne(w),
4804
+ contentType: le(w),
4558
4805
  editable: u.value,
4559
4806
  autofocus: e.autofocus,
4560
4807
  editorProps: {
@@ -4568,36 +4815,36 @@ function ua(e = {}) {
4568
4815
  translate: "no"
4569
4816
  },
4570
4817
  handleClick: (e, t, n) => {
4571
- if (!u.value) return fe(n);
4572
- let r = Rt(e, n);
4573
- return r ? (n.preventDefault(), n.stopPropagation(), I(), Ht(e, r, !0), Ut(e, r), y.value = r, !0) : (y.value = null, !1);
4818
+ if (!u.value) return be(n);
4819
+ let r = Kt(e, n);
4820
+ return r ? (n.preventDefault(), n.stopPropagation(), F(), Xt(e, r, !0), Zt(e, r), y.value = r, !0) : (y.value = null, !1);
4574
4821
  },
4575
4822
  handleDOMEvents: {
4576
- compositionstart: () => u.value ? (h.value = on(h.value, { type: "composition-start" }), g.value = null, !1) : !1,
4577
- compositionend: (e) => (u.value && window.setTimeout(() => R(e), 0), !1),
4823
+ compositionstart: () => u.value ? (h.value = gn(h.value, { type: "composition-start" }), g.value = null, !1) : !1,
4824
+ compositionend: (e) => (u.value && window.setTimeout(() => I(e), 0), !1),
4578
4825
  click: (e, t) => {
4579
- if (!u.value) return fe(t);
4580
- let n = Rt(e, t);
4581
- return n ? (t.preventDefault(), t.stopPropagation(), I(), Ht(e, n, !0), Ut(e, n), y.value = n, !0) : (y.value = null, !1);
4826
+ if (!u.value) return be(t);
4827
+ let n = Kt(e, t);
4828
+ return n ? (t.preventDefault(), t.stopPropagation(), F(), Xt(e, n, !0), Zt(e, n), y.value = n, !0) : (y.value = null, !1);
4582
4829
  }
4583
4830
  }
4584
4831
  },
4585
- onSelectionUpdate: ({ editor: e }) => z(e),
4832
+ onSelectionUpdate: ({ editor: e }) => R(e),
4586
4833
  onCreate: ({ editor: t }) => {
4587
4834
  p(t, {
4588
4835
  mode: c.value,
4589
4836
  editable: u.value
4590
- }), Gt(t, l.value), Kt(t, u.value ? "live" : "view"), e.autoFocusFirstTableBodyCell && u.value && ln(t), V(t), z(t), O();
4837
+ }), $t(t, l.value), en(t, u.value ? "live" : "view"), e.autoFocusFirstTableBodyCell && u.value && yn(t), z(t), R(t), O();
4591
4838
  },
4592
4839
  onTransaction: ({ editor: e, transaction: t }) => {
4593
- if (V(e), (t.docChanged || Wt(t)) && k(), t.docChanged && y.value) {
4594
- let t = Lt(e, y.value.pos);
4840
+ if (z(e), (t.docChanged || Qt(t)) && k(), t.docChanged && y.value) {
4841
+ let t = Gt(e, y.value.pos);
4595
4842
  y.value = t?.kind === y.value.kind ? t : null;
4596
4843
  }
4597
4844
  },
4598
4845
  onUpdate: ({ editor: t }) => {
4599
- z(t), u.value && te(t), S.value || e.onUpdate?.(U(t, { onContentRead: (n, r) => {
4600
- let i = W(e.contentFormat);
4846
+ R(t), u.value && L(t), S.value || e.onUpdate?.(ce(t, { onContentRead: (n, r) => {
4847
+ let i = fe(e.contentFormat);
4601
4848
  e.content !== void 0 && n === i && (C.value = {
4602
4849
  content: r,
4603
4850
  format: n,
@@ -4606,194 +4853,194 @@ function ua(e = {}) {
4606
4853
  } }));
4607
4854
  }
4608
4855
  });
4609
- let M = j.value, ee = xe(M), N = !1, P = !1;
4856
+ let ee = j.value, te = ke(ee), M = !1, N = !1;
4610
4857
  Y(() => {
4611
- N || j.value !== M || (P = !0, e.onAiEditControllerChange?.(ee));
4858
+ M || j.value !== ee || (N = !0, e.onAiEditControllerChange?.(te));
4612
4859
  });
4613
- let F = q(() => j.value ?? null);
4614
- function I() {
4615
- g.value = null, _.value = null, h.value = an;
4860
+ let P = K(() => j.value ?? null);
4861
+ function F() {
4862
+ g.value = null, _.value = null, h.value = hn;
4616
4863
  }
4617
- function R(e) {
4618
- let t = nn(e.state);
4864
+ function I(e) {
4865
+ let t = fn(e.state);
4619
4866
  if (!t) {
4620
- h.value = h.value.name === "idle" ? h.value : an, g.value = null, _.value = null;
4867
+ h.value = h.value.name === "idle" ? h.value : hn, g.value = null, _.value = null;
4621
4868
  return;
4622
4869
  }
4623
4870
  let n = e.coordsAtPos(t.cursor), r = e.coordsAtPos(t.triggerFrom), i = e.dom.closest(".markweave-editor-frame")?.getBoundingClientRect();
4624
- if (!rn(r, { frameRect: i })) {
4625
- I();
4871
+ if (!mn(r, { frameRect: i })) {
4872
+ F();
4626
4873
  return;
4627
4874
  }
4628
- let a = tn(n, {
4875
+ let a = dn(n, {
4629
4876
  frameRect: i,
4630
4877
  triggerRect: r
4631
4878
  });
4632
- Qt(g.value, a) || (g.value = a), h.value = en(h.value, t);
4879
+ cn(g.value, a) || (g.value = a), h.value = un(h.value, t);
4633
4880
  }
4634
- function te(e) {
4635
- R(e.view);
4881
+ function L(e) {
4882
+ I(e.view);
4636
4883
  }
4637
- function z(e) {
4638
- let t = ge(e);
4639
- me(m.value, t) || (m.value = t);
4640
- let n = zt(e);
4641
- n && (Vt(e, n, !0), y.value = n);
4642
- let r = Qe(e);
4884
+ function R(e) {
4885
+ let t = we(e);
4886
+ Se(m.value, t) || (m.value = t);
4887
+ let n = qt(e);
4888
+ n && (Yt(e, n, !0), y.value = n);
4889
+ let r = ot(e);
4643
4890
  r.active && r.language === "mermaid" && (v.value = r.mermaidPreviewMode);
4644
4891
  }
4645
- function V(e) {
4646
- b.value = Gi(e);
4892
+ function z(e) {
4893
+ b.value = ra(e);
4647
4894
  }
4648
- let ae = q(() => F.value ? Qe(F.value) : Wi), oe = q(() => F.value ? un(F.value.state) : Ui), se = q(() => m.value?.currentNode === "codeBlock"), ce = q(() => se.value && ae.value.language === "mermaid"), le = q(() => F.value ? Jt({
4649
- active: ce.value,
4895
+ let B = K(() => P.value ? ot(P.value) : na), V = K(() => P.value ? bn(P.value.state) : ta), ne = K(() => m.value?.currentNode === "codeBlock"), re = K(() => ne.value && B.value.language === "mermaid"), ie = K(() => P.value ? nn({
4896
+ active: re.value,
4650
4897
  mode: v.value,
4651
- source: ae.value.text
4652
- }) : Jt({
4898
+ source: B.value.text
4899
+ }) : nn({
4653
4900
  active: !1,
4654
4901
  mode: "code",
4655
4902
  source: ""
4656
- })), ue = q(() => F.value && e.onRuntimeStateChange ? cn(F.value.state) : null), de = q(() => F.value ? We(F.value.state) : Ve.items), he = q(() => Ge(de.value, x.value)), ve = q(() => Be(de.value, he.value)), ye = q(() => Yt(h.value.query, s)), Se = q(() => pe({
4903
+ })), oe = K(() => P.value && e.onRuntimeStateChange ? vn(P.value.state) : null), pe = K(() => P.value ? Qe(P.value.state) : Ye.items), me = K(() => $e(pe.value, x.value)), he = K(() => Je(pe.value, me.value)), ge = K(() => rn(h.value.query, s)), _e = K(() => xe({
4657
4904
  revision: d.value,
4658
4905
  mode: c.value,
4659
4906
  editable: u.value,
4660
- toc: ve.value,
4907
+ toc: he.value,
4661
4908
  selection: m.value,
4662
4909
  slash: h.value,
4663
- table: oe.value,
4910
+ table: V.value,
4664
4911
  tableInteraction: b.value,
4665
- codeBlock: ae.value,
4666
- mermaid: le.value,
4667
- tableDebugSnapshot: ue.value
4668
- })), Ce = {
4669
- closeSlashMenu: I,
4670
- focusFirstTableBodyCell: () => F.value ? ln(F.value) : !1,
4912
+ codeBlock: B.value,
4913
+ mermaid: ie.value,
4914
+ tableDebugSnapshot: oe.value
4915
+ })), ve = {
4916
+ closeSlashMenu: F,
4917
+ focusFirstTableBodyCell: () => P.value ? yn(P.value) : !1,
4671
4918
  setContent: (e, t = {}) => {
4672
- if (!F.value) return !1;
4673
- let n = W(t.format);
4674
- return F.value.commands.setContent(e, {
4675
- contentType: ne(n),
4919
+ if (!P.value) return !1;
4920
+ let n = fe(t.format);
4921
+ return P.value.commands.setContent(e, {
4922
+ contentType: le(n),
4676
4923
  emitUpdate: t.emitUpdate ?? !1
4677
- }), t.focusFirstTableBodyCell && ln(F.value), z(F.value), u.value && te(F.value), V(F.value), O(), !0;
4924
+ }), t.focusFirstTableBodyCell && yn(P.value), R(P.value), u.value && L(P.value), z(P.value), O(), !0;
4678
4925
  }
4679
4926
  };
4680
- function we(e, t) {
4681
- if (!(!F.value || !u.value || !Xt(e))) {
4927
+ function ye(e, t) {
4928
+ if (!(!P.value || !u.value || !an(e))) {
4682
4929
  if (e.inputKind && !t?.emoji && !t?.uploadResult) {
4683
4930
  _.value = e;
4684
4931
  return;
4685
4932
  }
4686
- $t(F.value, h.value, e, t), h.value = on(h.value, { type: "execute" }), I();
4933
+ ln(P.value, h.value, e, t), h.value = gn(h.value, { type: "execute" }), F();
4687
4934
  }
4688
4935
  }
4689
- function Te(e) {
4690
- if (!F.value || _.value || !u.value) return;
4691
- let t = Zt(h.value, ye.value, e.key, { isComposing: e.isComposing || B(F.value.state) });
4936
+ function Ce(e) {
4937
+ if (!P.value || _.value || !u.value) return;
4938
+ let t = on(h.value, ge.value, e.key, { isComposing: e.isComposing || ae(P.value.state) });
4692
4939
  if (t.type !== "ignore") {
4693
4940
  if (e.preventDefault(), t.type === "close") {
4694
- h.value = on(h.value, { type: "escape" }), I();
4941
+ h.value = gn(h.value, { type: "escape" }), F();
4695
4942
  return;
4696
4943
  }
4697
4944
  if (t.type === "move-active") {
4698
- h.value = on(h.value, {
4945
+ h.value = gn(h.value, {
4699
4946
  type: "move-active",
4700
4947
  delta: t.delta,
4701
4948
  optionCount: t.optionCount
4702
4949
  });
4703
4950
  return;
4704
4951
  }
4705
- we(t.command);
4952
+ ye(t.command);
4706
4953
  }
4707
4954
  }
4708
- J(() => [e.mode, e.editable], () => {
4709
- c.value = f(e.mode), F.value && (F.value.setEditable(u.value), p(F.value, {
4955
+ q(() => [e.mode, e.editable], () => {
4956
+ c.value = f(e.mode), P.value && (P.value.setEditable(u.value), p(P.value, {
4710
4957
  mode: c.value,
4711
4958
  editable: u.value
4712
- }), Kt(F.value, u.value ? "live" : "view"), O(), u.value || I());
4713
- }, { immediate: !0 }), J(() => e.theme, () => {
4714
- F.value && Gt(F.value, l.value);
4715
- }, { immediate: !0 }), J(() => e.content, (t) => {
4716
- let n = W(e.contentFormat);
4717
- if (!(!F.value || t === void 0)) {
4718
- if (ie(F.value, C.value, t, n)) {
4959
+ }), en(P.value, u.value ? "live" : "view"), O(), u.value || F());
4960
+ }, { immediate: !0 }), q(() => e.theme, () => {
4961
+ P.value && $t(P.value, l.value);
4962
+ }, { immediate: !0 }), q(() => e.content, (t) => {
4963
+ let n = fe(e.contentFormat);
4964
+ if (!(!P.value || t === void 0)) {
4965
+ if (de(P.value, C.value, t, n)) {
4719
4966
  C.value = null;
4720
4967
  return;
4721
4968
  }
4722
- C.value = null, !re(F.value, t, n) && (S.value = !0, F.value.commands.setContent(t, {
4723
- contentType: ne(n),
4969
+ C.value = null, !ue(P.value, t, n) && (S.value = !0, P.value.commands.setContent(t, {
4970
+ contentType: le(n),
4724
4971
  emitUpdate: !1
4725
- }), S.value = !1, z(F.value), u.value && te(F.value), V(F.value), O());
4972
+ }), S.value = !1, R(P.value), u.value && L(P.value), z(P.value), O());
4726
4973
  }
4727
- }), J(Se, (t) => e.onRuntimeStateChange?.(t), { immediate: !0 }), J(ve, (t) => e.onTocChange?.(t), { immediate: !0 }), J(de, (e) => {
4728
- let t = Ge(e, x.value);
4974
+ }), q(_e, (t) => e.onRuntimeStateChange?.(t), { immediate: !0 }), q(he, (t) => e.onTocChange?.(t), { immediate: !0 }), q(pe, (e) => {
4975
+ let t = $e(e, x.value);
4729
4976
  x.value !== t && (x.value = t);
4730
4977
  });
4731
- let Ee = H(() => {
4732
- F.value && g.value && R(F.value.view);
4733
- }), De = () => {
4734
- g.value && Ee.schedule();
4978
+ let Ee = se(() => {
4979
+ P.value && g.value && I(P.value.view);
4980
+ }), De = (e) => {
4981
+ e?.type === "scroll" && pn(e.target) || g.value && Ee.schedule();
4735
4982
  };
4736
- J(g, (e) => {
4983
+ q(g, (e) => {
4737
4984
  e ? De() : Ee.cancel();
4738
- }), rr(() => {
4985
+ }), fr(() => {
4739
4986
  window.addEventListener("resize", De), window.addEventListener("scroll", De, !0);
4740
- }), ir(() => {
4987
+ }), J(() => {
4741
4988
  Ee.cancel(), window.removeEventListener("resize", De), window.removeEventListener("scroll", De, !0);
4742
4989
  });
4743
- let Oe = null;
4744
- return ir(() => {
4990
+ let Ae = null;
4991
+ return J(() => {
4745
4992
  D !== null && window.clearTimeout(D);
4746
- }), rr(() => {
4993
+ }), fr(() => {
4747
4994
  let e = () => {
4748
- if (!F.value || !de.value.length) {
4995
+ if (!P.value || !pe.value.length) {
4749
4996
  x.value = null;
4750
4997
  return;
4751
4998
  }
4752
4999
  let e = null;
4753
5000
  try {
4754
- e = He(F.value, de.value);
5001
+ e = Xe(P.value, pe.value);
4755
5002
  } catch {
4756
5003
  return;
4757
5004
  }
4758
5005
  x.value !== e && (x.value = e);
4759
- }, t = () => window.requestAnimationFrame(e), n = Ki(F.value?.view.dom ?? null);
4760
- window.addEventListener("scroll", t, { passive: !0 }), window.addEventListener("resize", t), n?.addEventListener("scroll", t, { passive: !0 }), t(), Oe = () => {
5006
+ }, t = () => window.requestAnimationFrame(e), n = ia(P.value?.view.dom ?? null);
5007
+ window.addEventListener("scroll", t, { passive: !0 }), window.addEventListener("resize", t), n?.addEventListener("scroll", t, { passive: !0 }), t(), Ae = () => {
4761
5008
  window.removeEventListener("scroll", t), window.removeEventListener("resize", t), n?.removeEventListener("scroll", t);
4762
5009
  };
4763
- }), ir(() => {
4764
- Oe?.(), N = !0, P && e.onAiEditControllerChange?.(null);
5010
+ }), J(() => {
5011
+ Ae?.(), M = !0, N && e.onAiEditControllerChange?.(null);
4765
5012
  let t = j.value;
4766
5013
  j.value = null, Y(() => t?.destroy());
4767
5014
  }), {
4768
- editor: F,
4769
- runtimeSnapshot: Se,
4770
- actions: Ce,
5015
+ editor: P,
5016
+ runtimeSnapshot: _e,
5017
+ actions: ve,
4771
5018
  __render: {
4772
5019
  messages: o,
4773
5020
  effectiveEditable: u,
4774
- tableFocusState: oe,
5021
+ tableFocusState: V,
4775
5022
  tableInteractionState: b,
4776
- codeBlockState: ae,
4777
- isCodeBlockActive: se,
5023
+ codeBlockState: B,
5024
+ isCodeBlockActive: ne,
4778
5025
  mermaidMode: v,
4779
5026
  mathTarget: y,
4780
5027
  setMermaidMode: (e) => {
4781
5028
  v.value = e;
4782
5029
  },
4783
- tocState: ve,
4784
- filteredSlashCommands: ye,
5030
+ tocState: he,
5031
+ filteredSlashCommands: ge,
4785
5032
  slashState: h,
4786
5033
  slashMenuPosition: g,
4787
5034
  slashInputCommand: _,
4788
- runSlashCommand: we,
4789
- handleEditorKeyDown: Te,
5035
+ runSlashCommand: ye,
5036
+ handleEditorKeyDown: Ce,
4790
5037
  setSlashInputCommand: (e) => {
4791
5038
  _.value = e;
4792
5039
  }
4793
5040
  }
4794
5041
  };
4795
5042
  }
4796
- var da = X({
5043
+ var Ca = X({
4797
5044
  name: "MarkweaveEditor",
4798
5045
  props: {
4799
5046
  defaultContent: {
@@ -4888,6 +5135,10 @@ var da = X({
4888
5135
  type: Function,
4889
5136
  default: void 0
4890
5137
  },
5138
+ onAttachmentDownload: {
5139
+ type: Function,
5140
+ default: void 0
5141
+ },
4891
5142
  onTableCopyPayload: {
4892
5143
  type: Function,
4893
5144
  default: void 0
@@ -4910,31 +5161,31 @@ var da = X({
4910
5161
  }
4911
5162
  },
4912
5163
  setup(e) {
4913
- let t = ua(e);
5164
+ let t = Sa(e);
4914
5165
  return () => {
4915
5166
  let n = t.editor.value;
4916
5167
  if (!n) return null;
4917
- let i = t.__render, a = ["markweave-editor-frame", e.className].filter(Boolean).join(" "), s = ye(e.canvasColor);
4918
- return G("section", {
5168
+ let i = t.__render, a = ["markweave-editor-frame", e.className].filter(Boolean).join(" "), s = De(e.canvasColor);
5169
+ return U("section", {
4919
5170
  class: a,
4920
5171
  "aria-label": e.ariaLabel ?? i.messages.common.editorAriaLabel,
4921
5172
  "data-testid": "markweave-editor-frame",
4922
5173
  "data-markweave-mode": t.runtimeSnapshot.value.mode,
4923
- "data-markweave-theme": be(e.theme),
5174
+ "data-markweave-theme": Oe(e.theme),
4924
5175
  style: s ? { "--markweave-canvas": s } : void 0,
4925
5176
  "data-markweave-inner-toc": e.innerToc ? "true" : "false",
4926
- "data-markweave-inner-toc-placement": Ke(e.innerTocPlacement),
5177
+ "data-markweave-inner-toc-placement": et(e.innerTocPlacement),
4927
5178
  "data-mermaid-mode": t.runtimeSnapshot.value.mermaid.mode,
4928
5179
  "data-table-focus-mode": i.tableFocusState.value.mode,
4929
5180
  onKeydownCapture: i.handleEditorKeyDown
4930
5181
  }, [
4931
- i.effectiveEditable.value ? G(ta, {
5182
+ i.effectiveEditable.value ? U(pa, {
4932
5183
  editor: n,
4933
5184
  lang: r(e.lang),
4934
5185
  messages: i.messages,
4935
5186
  askAi: e.askAi
4936
5187
  }) : null,
4937
- i.effectiveEditable.value ? G(ra, {
5188
+ i.effectiveEditable.value ? U(ha, {
4938
5189
  commands: i.filteredSlashCommands.value,
4939
5190
  state: i.slashState.value,
4940
5191
  position: i.slashMenuPosition.value,
@@ -4944,7 +5195,7 @@ var da = X({
4944
5195
  onInputCommandChange: i.setSlashInputCommand,
4945
5196
  onUpload: e.onSlashCommandUpload
4946
5197
  }) : null,
4947
- i.effectiveEditable.value ? G(oa, {
5198
+ i.effectiveEditable.value ? U(va, {
4948
5199
  editor: n,
4949
5200
  active: i.tableFocusState.value.active,
4950
5201
  interactionState: i.tableInteractionState.value,
@@ -4954,11 +5205,11 @@ var da = X({
4954
5205
  onCommandResult: e.onTableCommandResult,
4955
5206
  onEditWithAi: e.onEditWithAi
4956
5207
  }) : null,
4957
- i.effectiveEditable.value ? G(sa, {
5208
+ i.effectiveEditable.value ? U(ya, {
4958
5209
  editor: n,
4959
5210
  focusState: i.tableFocusState.value
4960
5211
  }) : null,
4961
- G(ca, {
5212
+ U(ba, {
4962
5213
  editor: n,
4963
5214
  state: i.codeBlockState.value,
4964
5215
  active: i.effectiveEditable.value && i.isCodeBlockActive.value,
@@ -4966,23 +5217,23 @@ var da = X({
4966
5217
  onMermaidModeChange: i.setMermaidMode,
4967
5218
  readOnly: !i.effectiveEditable.value
4968
5219
  }),
4969
- e.innerToc && i.tocState.value.items.length ? G(la, {
5220
+ e.innerToc && i.tocState.value.items.length ? U(xa, {
4970
5221
  editor: n,
4971
5222
  state: i.tocState.value,
4972
5223
  messages: i.messages,
4973
5224
  editable: i.effectiveEditable.value,
4974
- placement: Ke(e.innerTocPlacement)
5225
+ placement: et(e.innerTocPlacement)
4975
5226
  }) : null,
4976
- i.effectiveEditable.value && i.mathTarget.value ? G(na, {
5227
+ i.effectiveEditable.value && i.mathTarget.value ? U(ma, {
4977
5228
  editor: n,
4978
5229
  messages: i.messages,
4979
5230
  target: i.mathTarget.value,
4980
5231
  onClose: () => i.mathTarget.value = null
4981
5232
  }) : null,
4982
- G(o, { editor: n })
5233
+ U(o, { editor: n })
4983
5234
  ]);
4984
5235
  };
4985
5236
  }
4986
5237
  });
4987
5238
  //#endregion
4988
- export { da as MarkweaveEditor, te as createMarkweaveAiEditController, Hi as createMarkweaveEditorExtensions, Hi as createMarkweaveVue2EditorExtensions, ua as useMarkweaveEditorController };
5239
+ export { Ca as MarkweaveEditor, re as createMarkweaveAiEditController, ea as createMarkweaveEditorExtensions, ea as createMarkweaveVue2EditorExtensions, Sa as useMarkweaveEditorController };