@vibe-tiptap/naive-ui 1.1.0 → 1.1.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
@@ -1,13 +1,13 @@
1
1
  import { CODE_BLOCK_LANGUAGES as e, getMentionTarget as t, resolveLocale as n } from "@vibe-tiptap/core";
2
- import { Fragment as r, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, h, inject as g, markRaw as _, mergeProps as v, normalizeClass as y, normalizeProps as b, normalizeStyle as x, onBeforeUnmount as S, onMounted as C, onScopeDispose as w, openBlock as T, provide as E, ref as D, renderList as O, renderSlot as k, resolveDynamicComponent as A, shallowRef as j, toDisplayString as M, toValue as N, unref as P, watch as F, watchEffect as I, watchPostEffect as L, withCtx as R, withKeys as z, withModifiers as B } from "vue";
3
- import { NButton as V, NCard as H, NCheckbox as ee, NDropdown as U, NIcon as W, NImageGroup as te, NInput as G, NMessageProvider as ne, NModal as K, NPopover as q, NSelect as re, NTab as J, NTabs as ie, NText as ae, NTooltip as Y, NUpload as oe, NUploadDragger as se, darkTheme as ce, useMessage as le, useThemeVars as ue } from "naive-ui";
4
- import { getMarkRange as de } from "@tiptap/core";
5
- import { canSetMediaDisplay as X, createImageDropPasteHandlers as fe, detectFileAttachmentType as pe, exitMention as me, exitSlashCommand as he, formatFileSize as ge, getActiveHeadingLevel as _e, getActiveLinkRange as ve, getActiveTextAlign as ye, getMediaInsertionNodeType as be, getMentionTarget as xe, getNativeMarkdownManager as Se, getSelectedFileAttachment as Ce, isFindReplaceOpenTransaction as we, isToolbarCommandActive as Te, isToolbarCommandEnabled as Ee, normalizeHttpUrl as De, normalizeSlashCommandInput as Oe, notifyAssetUploadFailure as ke, resolveEditorBehaviorOptions as Ae, runSlashCommandItem as je, runToolbarCommand as Me, slashCommandPluginKey as Ne, startWhiteboardDrawing as Pe, trackUploadRange as Fe, useVueEditor as Ie, validateAssetFile as Le } from "@vibe-tiptap/vue-adapter";
6
- import { NodeSelection as Re, TextSelection as ze } from "@tiptap/pm/state";
7
- import { BubbleMenuPlugin as Be } from "@tiptap/extension-bubble-menu";
8
- import { TableMap as Ve, cellAround as He } from "@tiptap/pm/tables";
2
+ import { Fragment as r, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, h, hasInjectionContext as g, inject as _, markRaw as v, mergeProps as y, normalizeClass as b, normalizeProps as x, normalizeStyle as S, onBeforeUnmount as C, onMounted as w, onScopeDispose as T, openBlock as E, provide as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as j, shallowRef as M, toDisplayString as N, toValue as P, unref as F, watch as I, watchEffect as L, watchPostEffect as R, withCtx as z, withKeys as ee, withModifiers as B } from "vue";
3
+ import { NButton as V, NCard as H, NCheckbox as U, NDropdown as te, NIcon as W, NImageGroup as ne, NInput as G, NMessageProvider as K, NModal as q, NPopover as J, NSelect as re, NTab as ie, NTabs as ae, NText as Y, NTooltip as X, NUpload as oe, NUploadDragger as Z, darkTheme as se, useMessage as ce, useThemeVars as le } from "naive-ui";
4
+ import { getMarkRange as ue } from "@tiptap/core";
5
+ import { canSetMediaDisplay as de, createImageDropPasteHandlers as fe, detectFileAttachmentType as pe, exitMention as me, exitSlashCommand as he, formatFileSize as ge, getActiveHeadingLevel as _e, getActiveLinkRange as ve, getActiveTextAlign as ye, getMediaInsertionNodeType as be, getMentionTarget as xe, getNativeMarkdownManager as Se, getSelectedFileAttachment as Ce, isFindReplaceOpenTransaction as we, isToolbarCommandActive as Te, isToolbarCommandEnabled as Ee, normalizeHttpUrl as De, normalizeSlashCommandInput as Oe, notifyAssetUploadFailure as ke, resolveEditorBehaviorOptions as Ae, resolveMediaResourcePath as je, runSlashCommandItem as Me, runToolbarCommand as Ne, slashCommandPluginKey as Pe, startWhiteboardDrawing as Fe, trackUploadRange as Ie, useVueEditor as Le, validateAssetFile as Re } from "@vibe-tiptap/vue-adapter";
6
+ import { NodeSelection as ze, TextSelection as Be } from "@tiptap/pm/state";
7
+ import { BubbleMenuPlugin as Ve } from "@tiptap/extension-bubble-menu";
8
+ import { TableMap as He, cellAround as Ue } from "@tiptap/pm/tables";
9
9
  // ../editor-ui/dist/editor-theme.js
10
- var Ue = {
10
+ var We = {
11
11
  0: {
12
12
  fontSize: "13px",
13
13
  fontWeight: 400
@@ -36,14 +36,14 @@ var Ue = {
36
36
  fontSize: "12px",
37
37
  fontWeight: 500
38
38
  }
39
- }, We = /* @__PURE__ */ "#000000.#434343.#666666.#999999.#b7b7b7.#cccccc.#d9d9d9.#efefef.#e03131.#e8590c.#f08c00.#fcc419.#d9480f.#f76707.#fa5252.#ff6b6b.#2f9e44.#40c057.#82c91e.#a9e34b.#0c8599.#1098ad.#15aabf.#22b8cf.#1864ab.#1971c2.#228be6.#4dabf7.#5f3dc4.#6741d9.#7048e8.#9775fa.#a61e4d.#c2255c.#d6336c.#f06595.#5c2f14.#7b4019.#a0522d.#c08456".split("."), Ge = /* @__PURE__ */ "#fff3bf.#ffe8cc.#ffe066.#fab005.#ffc9c9.#ffa8a8.#ff8787.#fa5252.#d3f9d8.#b2f2bb.#8ce99a.#40c057.#c3fae8.#96f2d7.#63e6be.#0ca678.#d0ebff.#a5d8ff.#74c0fc.#1c7ed6.#e5dbff.#d0bfff.#b197fc.#7048e8.#fcc2d7.#faa2c1.#f783ac.#d6336c.#fff0f6.#ffdeeb.#f8b4cd.#e64980".split(".");
40
- function Ke(e, t) {
39
+ }, Ge = /* @__PURE__ */ "#000000.#434343.#666666.#999999.#b7b7b7.#cccccc.#d9d9d9.#efefef.#e03131.#e8590c.#f08c00.#fcc419.#d9480f.#f76707.#fa5252.#ff6b6b.#2f9e44.#40c057.#82c91e.#a9e34b.#0c8599.#1098ad.#15aabf.#22b8cf.#1864ab.#1971c2.#228be6.#4dabf7.#5f3dc4.#6741d9.#7048e8.#9775fa.#a61e4d.#c2255c.#d6336c.#f06595.#5c2f14.#7b4019.#a0522d.#c08456".split("."), Ke = /* @__PURE__ */ "#fff3bf.#ffe8cc.#ffe066.#fab005.#ffc9c9.#ffa8a8.#ff8787.#fa5252.#d3f9d8.#b2f2bb.#8ce99a.#40c057.#c3fae8.#96f2d7.#63e6be.#0ca678.#d0ebff.#a5d8ff.#74c0fc.#1c7ed6.#e5dbff.#d0bfff.#b197fc.#7048e8.#fcc2d7.#faa2c1.#f783ac.#d6336c.#fff0f6.#ffdeeb.#f8b4cd.#e64980".split(".");
40
+ function qe(e, t) {
41
41
  return {
42
- colors: [...e ?? We],
43
- highlights: [...t ?? Ge]
42
+ colors: [...e ?? Ge],
43
+ highlights: [...t ?? Ke]
44
44
  };
45
45
  }
46
- function qe(e, t) {
46
+ function Je(e, t) {
47
47
  let n = e?.trim().toLowerCase();
48
48
  if (!n) return;
49
49
  if (/^#(?:[\da-f]{6}|[\da-f]{8})$/.test(n)) return n;
@@ -61,7 +61,7 @@ function qe(e, t) {
61
61
  return s ? (o = s.slice(1, 4).map(Number), o.push(Math.round(Number(s[4]) * 255))) : (i.fillRect(0, 0, 1, 1), o = Array.from(i.getImageData(0, 0, 1, 1).data)), o[3] === 255 && o.pop(), `#${o.map((e) => e.toString(16).padStart(2, "0")).join("")}`;
62
62
  }
63
63
  // ../editor-ui/dist/markdown-file.js
64
- var Je = ".md,.markdown,text/markdown,text/plain", Ye = [
64
+ var Ye = ".md,.markdown,text/markdown,text/plain", Xe = [
65
65
  {
66
66
  label: "导入",
67
67
  value: "import"
@@ -75,17 +75,17 @@ var Je = ".md,.markdown,text/markdown,text/plain", Ye = [
75
75
  value: "copy"
76
76
  }
77
77
  ];
78
- function Xe(e = {}) {
78
+ function Ze(e = {}) {
79
79
  return {
80
80
  importAccept: e.importAccept ?? ".md,.markdown,text/markdown,text/plain",
81
81
  importStrict: e.importStrict,
82
82
  exportFilename: e.exportFilename
83
83
  };
84
84
  }
85
- function Ze(e) {
85
+ function Qe(e) {
86
86
  return (typeof e == "function" ? e() : e)?.trim() || `content-${Date.now()}.md`;
87
87
  }
88
- async function Qe(e, t, r = {}) {
88
+ async function $e(e, t, r = {}) {
89
89
  let { t: i } = n(r.locale), a = r.t ?? i, o;
90
90
  try {
91
91
  o = await t.text();
@@ -100,13 +100,13 @@ async function Qe(e, t, r = {}) {
100
100
  e.notify(a("notify.markdownImportFailed"), "error");
101
101
  }
102
102
  }
103
- function $e(e, t = {}) {
103
+ function et(e, t = {}) {
104
104
  let { t: r } = n(t.locale), i = t.t ?? r, a = e.getMarkdown();
105
105
  if (!a) return e.notify(i("notify.markdownExportUnavailable"), "warning"), !1;
106
106
  let o = new Blob([a], { type: "text/markdown;charset=utf-8" }), s = URL.createObjectURL(o), c = document.createElement("a");
107
- return c.href = s, c.download = Ze(t.filename), c.click(), URL.revokeObjectURL(s), !0;
107
+ return c.href = s, c.download = Qe(t.filename), c.click(), URL.revokeObjectURL(s), !0;
108
108
  }
109
- async function et(e, t = {}) {
109
+ async function tt(e, t = {}) {
110
110
  let { t: r } = n(t.locale), i = t.t ?? r, a = e.getMarkdown();
111
111
  if (!a) return e.notify(i("notify.markdownCopyUnavailable"), "warning"), !1;
112
112
  let o = t.clipboard ?? globalThis.navigator?.clipboard;
@@ -118,25 +118,25 @@ async function et(e, t = {}) {
118
118
  }
119
119
  }
120
120
  // src/naive-tiptap-content.vue
121
- var tt = /* @__PURE__ */ p({
121
+ var nt = /* @__PURE__ */ p({
122
122
  __name: "naive-tiptap-content",
123
123
  props: { context: {} },
124
124
  setup(e) {
125
- let t = e, n = D();
126
- return L((e) => {
125
+ let t = e, n = O();
126
+ return R((e) => {
127
127
  let r = n.value;
128
128
  if (!r || t.context.editor.isDestroyed) return;
129
129
  let i = t.context.editor.view.dom;
130
130
  r.appendChild(i), e(() => {
131
131
  i.parentNode === r && i.remove();
132
132
  });
133
- }), (e, t) => (T(), c("div", {
133
+ }), (e, t) => (E(), c("div", {
134
134
  ref_key: "host",
135
135
  ref: n,
136
136
  class: "vibe-naive-tiptap__content"
137
137
  }, null, 512));
138
138
  }
139
- }), nt = {
139
+ }), rt = {
140
140
  xmlns: "http://www.w3.org/2000/svg",
141
141
  width: 24,
142
142
  height: 24,
@@ -146,24 +146,24 @@ var tt = /* @__PURE__ */ p({
146
146
  "stroke-width": 2,
147
147
  "stroke-linecap": "round",
148
148
  "stroke-linejoin": "round"
149
- }, rt = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim();
149
+ }, it = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim();
150
150
  // ../../node_modules/.pnpm/@lucide+vue@1.72.0_vue@3.5.42_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/build/buildLucideIconNode.mjs
151
- function it(e) {
151
+ function at(e) {
152
152
  return e != null;
153
153
  }
154
- function at(e, t = {}) {
155
- let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ?? nt.width, a = e.size ?? e.height ?? nt.height, o = e.aliases?.filter((e) => typeof e == "string" && e.trim() !== "").map((e) => `lucide-${e}`) ?? [], s = [...e.name ? [`lucide-${e.name}`] : [], ...o], c = t.className?.split(" ").filter(Boolean) ?? [], l = t.includeDefaultClasses === !1 ? rt(...c) : rt("lucide", ...s, ...c), u = t.absoluteStrokeWidth ? Number(t.strokeWidth ?? nt["stroke-width"]) * Number(e.size ?? e.width ?? nt.width) / Number(t.size ?? t.width ?? nt.width) : t.strokeWidth ?? nt["stroke-width"];
154
+ function ot(e, t = {}) {
155
+ let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ?? rt.width, a = e.size ?? e.height ?? rt.height, o = e.aliases?.filter((e) => typeof e == "string" && e.trim() !== "").map((e) => `lucide-${e}`) ?? [], s = [...e.name ? [`lucide-${e.name}`] : [], ...o], c = t.className?.split(" ").filter(Boolean) ?? [], l = t.includeDefaultClasses === !1 ? it(...c) : it("lucide", ...s, ...c), u = t.absoluteStrokeWidth ? Number(t.strokeWidth ?? rt["stroke-width"]) * Number(e.size ?? e.width ?? rt.width) / Number(t.size ?? t.width ?? rt.width) : t.strokeWidth ?? rt["stroke-width"];
156
156
  return [
157
157
  "svg",
158
158
  {
159
- ...Object.entries(nt).reduce((e, [t, n]) => (e[r(t)] = n, e), {}),
159
+ ...Object.entries(rt).reduce((e, [t, n]) => (e[r(t)] = n, e), {}),
160
160
  ..."color" in t && t.color && { [r("stroke")]: t.color },
161
- ..."size" in t && it(t.size) && {
161
+ ..."size" in t && at(t.size) && {
162
162
  [r("width")]: t.size,
163
163
  [r("height")]: t.size
164
164
  },
165
- ..."width" in t && it(t.width) && { [r("width")]: t.width },
166
- ..."height" in t && it(t.height) && { [r("height")]: t.height },
165
+ ..."width" in t && at(t.width) && { [r("width")]: t.width },
166
+ ..."height" in t && at(t.height) && { [r("height")]: t.height },
167
167
  [r("stroke-width")]: u,
168
168
  ...l && { [r("class")]: l },
169
169
  [r("viewBox")]: `0 0 ${i} ${a}`,
@@ -184,23 +184,23 @@ function at(e, t = {}) {
184
184
  ];
185
185
  }
186
186
  // ../../node_modules/.pnpm/@lucide+vue@1.72.0_vue@3.5.42_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/utils/hasA11yProp.mjs
187
- var ot = (e) => {
187
+ var st = (e) => {
188
188
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
189
189
  return !1;
190
- }, st = (e) => e === "", ct = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), lt = /* @__PURE__ */ Symbol("lucide-icons");
191
- function ut() {
192
- return g(lt, {});
190
+ }, ct = (e) => e === "", lt = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ut = /* @__PURE__ */ Symbol("lucide-icons");
191
+ function dt() {
192
+ return _(ut, {});
193
193
  }
194
194
  // ../../node_modules/.pnpm/@lucide+vue@1.72.0_vue@3.5.42_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/Icon.mjs
195
- var dt = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
196
- name: e && ct(e),
195
+ var ft = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
196
+ name: e && lt(e),
197
197
  node: t ?? n ?? [],
198
198
  size: 24,
199
199
  aliases: []
200
200
  }, absoluteStrokeWidth: i, "absolute-stroke-width": a, nonScalingStroke: o, "non-scaling-stroke": s, strokeWidth: c, "stroke-width": l, size: u, width: d = u, height: f = u, color: p, ...m }, { slots: g }) => {
201
- let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = ut(), C = st(i) || st(a) || i === !0 || a === !0 || b === !0, w = st(o) || st(s) || o === !0 || s === !0 || x === !0;
201
+ let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = dt(), C = ct(i) || ct(a) || i === !0 || a === !0 || b === !0, w = ct(o) || ct(s) || o === !0 || s === !0 || x === !0;
202
202
  delete m.class;
203
- let T = g.default?.(), [, E, D = []] = at(r, {
203
+ let T = g.default?.(), [, E, D = []] = ot(r, {
204
204
  color: p ?? v,
205
205
  width: d ?? u ?? _,
206
206
  height: f ?? u ?? _,
@@ -208,23 +208,23 @@ var dt = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
208
208
  absoluteStrokeWidth: C,
209
209
  nonScalingStroke: w,
210
210
  className: S,
211
- hasA11yProp: T != null && T.length > 0 || ot(m),
211
+ hasA11yProp: T != null && T.length > 0 || st(m),
212
212
  attributes: m
213
213
  });
214
214
  return h("svg", E, [...D.map(([e, t]) => h(e, t)), ...T ?? []]);
215
215
  };
216
216
  // ../../node_modules/.pnpm/@lucide+vue@1.72.0_vue@3.5.42_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/createLucideIcon.mjs
217
- function Z(e, t = []) {
217
+ function Q(e, t = []) {
218
218
  let n = typeof e == "string" ? {
219
219
  name: e,
220
220
  node: t
221
221
  } : e;
222
- return (e, { slots: t }) => h(dt, {
222
+ return (e, { slots: t }) => h(ft, {
223
223
  ...e,
224
224
  icon: n
225
225
  }, t.default ? { default: t.default } : void 0);
226
226
  }
227
- var ft = Z({
227
+ var pt = Q({
228
228
  name: "arrow-down",
229
229
  size: 24,
230
230
  node: [["path", {
@@ -234,7 +234,7 @@ var ft = Z({
234
234
  d: "m19 12-7 7-7-7",
235
235
  key: "1idqje"
236
236
  }]]
237
- }), pt = Z({
237
+ }), mt = Q({
238
238
  name: "arrow-left",
239
239
  size: 24,
240
240
  node: [["path", {
@@ -244,7 +244,7 @@ var ft = Z({
244
244
  d: "M19 12H5",
245
245
  key: "x3x0zl"
246
246
  }]]
247
- }), mt = Z({
247
+ }), ht = Q({
248
248
  name: "arrow-right",
249
249
  size: 24,
250
250
  node: [["path", {
@@ -254,7 +254,7 @@ var ft = Z({
254
254
  d: "m12 5 7 7-7 7",
255
255
  key: "xquz4c"
256
256
  }]]
257
- }), ht = Z({
257
+ }), gt = Q({
258
258
  name: "arrow-up",
259
259
  size: 24,
260
260
  node: [["path", {
@@ -264,7 +264,7 @@ var ft = Z({
264
264
  d: "M12 19V5",
265
265
  key: "x0mq9r"
266
266
  }]]
267
- }), gt = Z({
267
+ }), _t = Q({
268
268
  name: "captions",
269
269
  size: 24,
270
270
  node: [["rect", {
@@ -280,7 +280,7 @@ var ft = Z({
280
280
  key: "1ueiar"
281
281
  }]],
282
282
  aliases: ["subtitles"]
283
- }), _t = Z({
283
+ }), vt = Q({
284
284
  name: "case-sensitive",
285
285
  size: 24,
286
286
  node: [
@@ -303,21 +303,21 @@ var ft = Z({
303
303
  key: "z97x68"
304
304
  }]
305
305
  ]
306
- }), vt = Z({
306
+ }), yt = Q({
307
307
  name: "chevron-down",
308
308
  size: 24,
309
309
  node: [["path", {
310
310
  d: "m6 9 6 6 6-6",
311
311
  key: "qrunsl"
312
312
  }]]
313
- }), yt = Z({
313
+ }), bt = Q({
314
314
  name: "chevron-up",
315
315
  size: 24,
316
316
  node: [["path", {
317
317
  d: "m18 15-6-6-6 6",
318
318
  key: "153udz"
319
319
  }]]
320
- }), bt = Z({
320
+ }), xt = Q({
321
321
  name: "code-xml",
322
322
  size: 24,
323
323
  node: [
@@ -335,7 +335,7 @@ var ft = Z({
335
335
  }]
336
336
  ],
337
337
  aliases: ["code-2"]
338
- }), xt = Z({
338
+ }), St = Q({
339
339
  name: "code",
340
340
  size: 24,
341
341
  node: [["path", {
@@ -345,7 +345,7 @@ var ft = Z({
345
345
  d: "m8 6-6 6 6 6",
346
346
  key: "ppft3o"
347
347
  }]]
348
- }), St = Z({
348
+ }), Ct = Q({
349
349
  name: "copy",
350
350
  size: 24,
351
351
  node: [["rect", {
@@ -360,7 +360,7 @@ var ft = Z({
360
360
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
361
361
  key: "zix9uf"
362
362
  }]]
363
- }), Ct = Z({
363
+ }), wt = Q({
364
364
  name: "download",
365
365
  size: 24,
366
366
  node: [
@@ -377,7 +377,7 @@ var ft = Z({
377
377
  key: "brsn70"
378
378
  }]
379
379
  ]
380
- }), wt = Z({
380
+ }), Tt = Q({
381
381
  name: "eighth-notes",
382
382
  size: 24,
383
383
  node: [
@@ -399,7 +399,7 @@ var ft = Z({
399
399
  }]
400
400
  ],
401
401
  aliases: ["music"]
402
- }), Tt = Z({
402
+ }), Et = Q({
403
403
  name: "ellipsis-vertical",
404
404
  size: 24,
405
405
  node: [
@@ -423,7 +423,7 @@ var ft = Z({
423
423
  }]
424
424
  ],
425
425
  aliases: ["more-vertical"]
426
- }), Et = Z({
426
+ }), Dt = Q({
427
427
  name: "ellipsis",
428
428
  size: 24,
429
429
  node: [
@@ -447,7 +447,7 @@ var ft = Z({
447
447
  }]
448
448
  ],
449
449
  aliases: ["more-horizontal"]
450
- }), Dt = Z({
450
+ }), Ot = Q({
451
451
  name: "eraser",
452
452
  size: 24,
453
453
  node: [["path", {
@@ -457,7 +457,7 @@ var ft = Z({
457
457
  d: "m5.082 11.09 8.828 8.828",
458
458
  key: "1wx5vj"
459
459
  }]]
460
- }), Ot = Z({
460
+ }), kt = Q({
461
461
  name: "external-link",
462
462
  size: 24,
463
463
  node: [
@@ -474,7 +474,7 @@ var ft = Z({
474
474
  key: "a6xqqp"
475
475
  }]
476
476
  ]
477
- }), kt = Z({
477
+ }), At = Q({
478
478
  name: "eye",
479
479
  size: 24,
480
480
  node: [["path", {
@@ -486,7 +486,7 @@ var ft = Z({
486
486
  r: "3",
487
487
  key: "1v7zrd"
488
488
  }]]
489
- }), At = Z({
489
+ }), jt = Q({
490
490
  name: "film",
491
491
  size: 24,
492
492
  node: [
@@ -527,7 +527,7 @@ var ft = Z({
527
527
  key: "go4c1d"
528
528
  }]
529
529
  ]
530
- }), jt = Z({
530
+ }), Mt = Q({
531
531
  name: "heading-2",
532
532
  size: 24,
533
533
  node: [
@@ -548,7 +548,7 @@ var ft = Z({
548
548
  key: "9jr5yi"
549
549
  }]
550
550
  ]
551
- }), Mt = Z({
551
+ }), Nt = Q({
552
552
  name: "heading-4",
553
553
  size: 24,
554
554
  node: [
@@ -573,7 +573,7 @@ var ft = Z({
573
573
  key: "1rz3zl"
574
574
  }]
575
575
  ]
576
- }), Nt = Z({
576
+ }), Pt = Q({
577
577
  name: "heading-3",
578
578
  size: 24,
579
579
  node: [
@@ -598,7 +598,7 @@ var ft = Z({
598
598
  key: "1ejuhz"
599
599
  }]
600
600
  ]
601
- }), Pt = Z({
601
+ }), Ft = Q({
602
602
  name: "heading-1",
603
603
  size: 24,
604
604
  node: [
@@ -619,7 +619,7 @@ var ft = Z({
619
619
  key: "1hhhft"
620
620
  }]
621
621
  ]
622
- }), Ft = Z({
622
+ }), It = Q({
623
623
  name: "heading-5",
624
624
  size: 24,
625
625
  node: [
@@ -644,7 +644,7 @@ var ft = Z({
644
644
  key: "2nebdn"
645
645
  }]
646
646
  ]
647
- }), It = Z({
647
+ }), Lt = Q({
648
648
  name: "heading-6",
649
649
  size: 24,
650
650
  node: [
@@ -671,7 +671,7 @@ var ft = Z({
671
671
  key: "f35dl0"
672
672
  }]
673
673
  ]
674
- }), Lt = Z({
674
+ }), Rt = Q({
675
675
  name: "highlighter",
676
676
  size: 24,
677
677
  node: [["path", {
@@ -681,7 +681,7 @@ var ft = Z({
681
681
  d: "m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",
682
682
  key: "14a9rk"
683
683
  }]]
684
- }), Rt = Z({
684
+ }), zt = Q({
685
685
  name: "image-plus",
686
686
  size: 24,
687
687
  node: [
@@ -708,7 +708,7 @@ var ft = Z({
708
708
  key: "af1f0g"
709
709
  }]
710
710
  ]
711
- }), zt = Z({
711
+ }), Bt = Q({
712
712
  name: "image-up",
713
713
  size: 24,
714
714
  node: [
@@ -731,7 +731,7 @@ var ft = Z({
731
731
  key: "af1f0g"
732
732
  }]
733
733
  ]
734
- }), Bt = Z({
734
+ }), Vt = Q({
735
735
  name: "image",
736
736
  size: 24,
737
737
  node: [
@@ -755,7 +755,7 @@ var ft = Z({
755
755
  key: "1xmnt7"
756
756
  }]
757
757
  ]
758
- }), Vt = Z({
758
+ }), Ht = Q({
759
759
  name: "italic",
760
760
  size: 24,
761
761
  node: [
@@ -781,7 +781,7 @@ var ft = Z({
781
781
  key: "uljnxc"
782
782
  }]
783
783
  ]
784
- }), Ht = Z({
784
+ }), Ut = Q({
785
785
  name: "letter-b",
786
786
  size: 24,
787
787
  node: [["path", {
@@ -789,7 +789,7 @@ var ft = Z({
789
789
  key: "n8tvfh"
790
790
  }]],
791
791
  aliases: ["bold"]
792
- }), Ut = Z({
792
+ }), Wt = Q({
793
793
  name: "letter-h",
794
794
  size: 24,
795
795
  node: [
@@ -807,7 +807,7 @@ var ft = Z({
807
807
  }]
808
808
  ],
809
809
  aliases: ["heading"]
810
- }), Wt = Z({
810
+ }), Gt = Q({
811
811
  name: "link",
812
812
  size: 24,
813
813
  node: [["path", {
@@ -817,7 +817,7 @@ var ft = Z({
817
817
  d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",
818
818
  key: "19qd67"
819
819
  }]]
820
- }), Gt = Z({
820
+ }), Kt = Q({
821
821
  name: "list-checks",
822
822
  size: 24,
823
823
  node: [
@@ -842,7 +842,7 @@ var ft = Z({
842
842
  key: "1obspn"
843
843
  }]
844
844
  ]
845
- }), Kt = Z({
845
+ }), qt = Q({
846
846
  name: "list-indent-increase",
847
847
  size: 24,
848
848
  node: [
@@ -864,7 +864,7 @@ var ft = Z({
864
864
  }]
865
865
  ],
866
866
  aliases: ["indent", "indent-increase"]
867
- }), qt = Z({
867
+ }), Jt = Q({
868
868
  name: "list-indent-decrease",
869
869
  size: 24,
870
870
  node: [
@@ -886,7 +886,7 @@ var ft = Z({
886
886
  }]
887
887
  ],
888
888
  aliases: ["outdent", "indent-decrease"]
889
- }), Jt = Z({
889
+ }), Yt = Q({
890
890
  name: "list-ordered",
891
891
  size: 24,
892
892
  node: [
@@ -915,7 +915,7 @@ var ft = Z({
915
915
  key: "xtkcd5"
916
916
  }]
917
917
  ]
918
- }), Yt = Z({
918
+ }), Xt = Q({
919
919
  name: "list",
920
920
  size: 24,
921
921
  node: [
@@ -944,7 +944,7 @@ var ft = Z({
944
944
  key: "m83p4d"
945
945
  }]
946
946
  ]
947
- }), Xt = Z({
947
+ }), Zt = Q({
948
948
  name: "maximize-2",
949
949
  size: 24,
950
950
  node: [
@@ -965,7 +965,7 @@ var ft = Z({
965
965
  key: "wtvkvv"
966
966
  }]
967
967
  ]
968
- }), Zt = Z({
968
+ }), Qt = Q({
969
969
  name: "minimize-2",
970
970
  size: 24,
971
971
  node: [
@@ -986,14 +986,14 @@ var ft = Z({
986
986
  key: "rmj7iw"
987
987
  }]
988
988
  ]
989
- }), Qt = Z({
989
+ }), $t = Q({
990
990
  name: "minus",
991
991
  size: 24,
992
992
  node: [["path", {
993
993
  d: "M5 12h14",
994
994
  key: "1ays0h"
995
995
  }]]
996
- }), $t = Z({
996
+ }), en = Q({
997
997
  name: "palette",
998
998
  size: 24,
999
999
  node: [
@@ -1030,14 +1030,14 @@ var ft = Z({
1030
1030
  key: "fotxhn"
1031
1031
  }]
1032
1032
  ]
1033
- }), en = Z({
1033
+ }), tn = Q({
1034
1034
  name: "paperclip",
1035
1035
  size: 24,
1036
1036
  node: [["path", {
1037
1037
  d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
1038
1038
  key: "1miecu"
1039
1039
  }]]
1040
- }), tn = Z({
1040
+ }), nn = Q({
1041
1041
  name: "pencil-ruler",
1042
1042
  size: 24,
1043
1043
  node: [
@@ -1066,7 +1066,7 @@ var ft = Z({
1066
1066
  key: "1mk7zo"
1067
1067
  }]
1068
1068
  ]
1069
- }), nn = Z({
1069
+ }), rn = Q({
1070
1070
  name: "pencil",
1071
1071
  size: 24,
1072
1072
  node: [["path", {
@@ -1076,7 +1076,7 @@ var ft = Z({
1076
1076
  d: "m15 5 4 4",
1077
1077
  key: "1mk7zo"
1078
1078
  }]]
1079
- }), rn = Z({
1079
+ }), an = Q({
1080
1080
  name: "pilcrow",
1081
1081
  size: 24,
1082
1082
  node: [
@@ -1093,7 +1093,7 @@ var ft = Z({
1093
1093
  key: "sh4n9v"
1094
1094
  }]
1095
1095
  ]
1096
- }), an = Z({
1096
+ }), on = Q({
1097
1097
  name: "plus",
1098
1098
  size: 24,
1099
1099
  node: [["path", {
@@ -1103,7 +1103,7 @@ var ft = Z({
1103
1103
  d: "M12 5v14",
1104
1104
  key: "s699le"
1105
1105
  }]]
1106
- }), on = Z({
1106
+ }), sn = Q({
1107
1107
  name: "printer",
1108
1108
  size: 24,
1109
1109
  node: [
@@ -1124,7 +1124,7 @@ var ft = Z({
1124
1124
  key: "1ue0tg"
1125
1125
  }]
1126
1126
  ]
1127
- }), sn = Z({
1127
+ }), cn = Q({
1128
1128
  name: "quote",
1129
1129
  size: 24,
1130
1130
  node: [["path", {
@@ -1134,7 +1134,7 @@ var ft = Z({
1134
1134
  d: "M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
1135
1135
  key: "1ymkrd"
1136
1136
  }]]
1137
- }), cn = Z({
1137
+ }), ln = Q({
1138
1138
  name: "redo-2",
1139
1139
  size: 24,
1140
1140
  node: [["path", {
@@ -1144,7 +1144,7 @@ var ft = Z({
1144
1144
  d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",
1145
1145
  key: "6uklza"
1146
1146
  }]]
1147
- }), ln = Z({
1147
+ }), un = Q({
1148
1148
  name: "replace-all",
1149
1149
  size: 24,
1150
1150
  node: [
@@ -1189,7 +1189,7 @@ var ft = Z({
1189
1189
  key: "1bkyp8"
1190
1190
  }]
1191
1191
  ]
1192
- }), un = Z({
1192
+ }), dn = Q({
1193
1193
  name: "replace",
1194
1194
  size: 24,
1195
1195
  node: [
@@ -1226,7 +1226,7 @@ var ft = Z({
1226
1226
  key: "1bkyp8"
1227
1227
  }]
1228
1228
  ]
1229
- }), dn = Z({
1229
+ }), fn = Q({
1230
1230
  name: "search",
1231
1231
  size: 24,
1232
1232
  node: [["path", {
@@ -1238,7 +1238,7 @@ var ft = Z({
1238
1238
  r: "8",
1239
1239
  key: "4ej97u"
1240
1240
  }]]
1241
- }), fn = Z({
1241
+ }), pn = Q({
1242
1242
  name: "strikethrough",
1243
1243
  size: 24,
1244
1244
  node: [
@@ -1258,7 +1258,7 @@ var ft = Z({
1258
1258
  key: "1e0a9i"
1259
1259
  }]
1260
1260
  ]
1261
- }), pn = Z({
1261
+ }), mn = Q({
1262
1262
  name: "subscript",
1263
1263
  size: 24,
1264
1264
  node: [
@@ -1275,7 +1275,7 @@ var ft = Z({
1275
1275
  key: "e8ta8j"
1276
1276
  }]
1277
1277
  ]
1278
- }), mn = Z({
1278
+ }), hn = Q({
1279
1279
  name: "superscript",
1280
1280
  size: 24,
1281
1281
  node: [
@@ -1292,7 +1292,7 @@ var ft = Z({
1292
1292
  key: "1dfcux"
1293
1293
  }]
1294
1294
  ]
1295
- }), hn = Z({
1295
+ }), gn = Q({
1296
1296
  name: "table-properties",
1297
1297
  size: 24,
1298
1298
  node: [
@@ -1317,7 +1317,7 @@ var ft = Z({
1317
1317
  key: "9uk58r"
1318
1318
  }]
1319
1319
  ]
1320
- }), gn = Z({
1320
+ }), _n = Q({
1321
1321
  name: "table",
1322
1322
  size: 24,
1323
1323
  node: [
@@ -1342,7 +1342,7 @@ var ft = Z({
1342
1342
  key: "5xshup"
1343
1343
  }]
1344
1344
  ]
1345
- }), _n = Z({
1345
+ }), vn = Q({
1346
1346
  name: "text-align-center",
1347
1347
  size: 24,
1348
1348
  node: [
@@ -1360,7 +1360,7 @@ var ft = Z({
1360
1360
  }]
1361
1361
  ],
1362
1362
  aliases: ["align-center"]
1363
- }), vn = Z({
1363
+ }), yn = Q({
1364
1364
  name: "text-align-end",
1365
1365
  size: 24,
1366
1366
  node: [
@@ -1378,7 +1378,7 @@ var ft = Z({
1378
1378
  }]
1379
1379
  ],
1380
1380
  aliases: ["align-right"]
1381
- }), yn = Z({
1381
+ }), bn = Q({
1382
1382
  name: "text-align-justify",
1383
1383
  size: 24,
1384
1384
  node: [
@@ -1396,7 +1396,7 @@ var ft = Z({
1396
1396
  }]
1397
1397
  ],
1398
1398
  aliases: ["align-justify"]
1399
- }), bn = Z({
1399
+ }), xn = Q({
1400
1400
  name: "text-align-start",
1401
1401
  size: 24,
1402
1402
  node: [
@@ -1414,7 +1414,7 @@ var ft = Z({
1414
1414
  }]
1415
1415
  ],
1416
1416
  aliases: ["text", "align-left"]
1417
- }), xn = Z({
1417
+ }), Sn = Q({
1418
1418
  name: "text-cursor-input",
1419
1419
  size: 24,
1420
1420
  node: [
@@ -1439,7 +1439,7 @@ var ft = Z({
1439
1439
  key: "velyjx"
1440
1440
  }]
1441
1441
  ]
1442
- }), Sn = Z({
1442
+ }), Cn = Q({
1443
1443
  name: "trash",
1444
1444
  size: 24,
1445
1445
  node: [
@@ -1465,7 +1465,7 @@ var ft = Z({
1465
1465
  }]
1466
1466
  ],
1467
1467
  aliases: ["trash-2"]
1468
- }), Cn = Z({
1468
+ }), wn = Q({
1469
1469
  name: "tv-minimal-play",
1470
1470
  size: 24,
1471
1471
  node: [
@@ -1486,7 +1486,7 @@ var ft = Z({
1486
1486
  key: "48i651"
1487
1487
  }]
1488
1488
  ]
1489
- }), wn = Z({
1489
+ }), Tn = Q({
1490
1490
  name: "underline",
1491
1491
  size: 24,
1492
1492
  node: [["path", {
@@ -1499,7 +1499,7 @@ var ft = Z({
1499
1499
  y2: "20",
1500
1500
  key: "nun2al"
1501
1501
  }]]
1502
- }), Tn = Z({
1502
+ }), En = Q({
1503
1503
  name: "undo-2",
1504
1504
  size: 24,
1505
1505
  node: [["path", {
@@ -1509,7 +1509,7 @@ var ft = Z({
1509
1509
  d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",
1510
1510
  key: "f3b9sd"
1511
1511
  }]]
1512
- }), En = Z({
1512
+ }), Dn = Q({
1513
1513
  name: "unlink",
1514
1514
  size: 24,
1515
1515
  node: [
@@ -1550,7 +1550,7 @@ var ft = Z({
1550
1550
  key: "ox905f"
1551
1551
  }]
1552
1552
  ]
1553
- }), Dn = Z({
1553
+ }), On = Q({
1554
1554
  name: "video",
1555
1555
  size: 24,
1556
1556
  node: [["path", {
@@ -1564,7 +1564,7 @@ var ft = Z({
1564
1564
  rx: "2",
1565
1565
  key: "158x01"
1566
1566
  }]]
1567
- }), On = Z({
1567
+ }), kn = Q({
1568
1568
  name: "workflow",
1569
1569
  size: 24,
1570
1570
  node: [
@@ -1589,7 +1589,7 @@ var ft = Z({
1589
1589
  key: "1cgmvn"
1590
1590
  }]
1591
1591
  ]
1592
- }), kn = Z({
1592
+ }), An = Q({
1593
1593
  name: "x",
1594
1594
  size: 24,
1595
1595
  node: [["path", {
@@ -1599,12 +1599,12 @@ var ft = Z({
1599
1599
  d: "m6 6 12 12",
1600
1600
  key: "d8bk6v"
1601
1601
  }]]
1602
- }), An = {
1603
- image: Bt,
1604
- video: At,
1605
- audio: wt,
1606
- attachment: en
1607
- }, jn = [
1602
+ }), jn = {
1603
+ image: Vt,
1604
+ video: jt,
1605
+ audio: Tt,
1606
+ attachment: tn
1607
+ }, Mn = [
1608
1608
  {
1609
1609
  key: "small",
1610
1610
  ratio: .25
@@ -1621,30 +1621,30 @@ var ft = Z({
1621
1621
  key: "original",
1622
1622
  ratio: null
1623
1623
  }
1624
- ], Mn = [
1624
+ ], Nn = [
1625
1625
  {
1626
1626
  key: "left",
1627
- icon: bn
1627
+ icon: xn
1628
1628
  },
1629
1629
  {
1630
1630
  key: "center",
1631
- icon: _n
1631
+ icon: vn
1632
1632
  },
1633
1633
  {
1634
1634
  key: "right",
1635
- icon: vn
1635
+ icon: yn
1636
1636
  }
1637
- ], Q = {
1637
+ ], $ = {
1638
1638
  delay: 500,
1639
1639
  showArrow: !1,
1640
1640
  themeOverrides: {
1641
1641
  padding: "4px 8px",
1642
1642
  peers: { Popover: { fontSize: "12px" } }
1643
1643
  }
1644
- }, Nn = {
1644
+ }, Pn = {
1645
1645
  class: "vibe-naive-tiptap__color-icon",
1646
1646
  "aria-hidden": "true"
1647
- }, Pn = /* @__PURE__ */ p({
1647
+ }, Fn = /* @__PURE__ */ p({
1648
1648
  __name: "naive-tiptap-color-picker",
1649
1649
  props: {
1650
1650
  context: {},
@@ -1666,7 +1666,7 @@ var ft = Z({
1666
1666
  t.value;
1667
1667
  let r = n.kind === "color" ? "textStyle" : "highlight", { selection: i, storedMarks: a } = e.state, o = i.empty && a ? a.find((e) => e.type.name === r)?.attrs.color : e.getAttributes(r).color;
1668
1668
  return typeof o == "string" && o.trim() || void 0;
1669
- }), m = a(() => qe(p.value, n.context.editor.view.dom.ownerDocument)), h = a(() => new Map(n.colors.map((e) => [e, qe(e, n.context.editor.view.dom.ownerDocument)?.replace(u, "$1")]))), g = a(() => {
1669
+ }), m = a(() => Je(p.value, n.context.editor.view.dom.ownerDocument)), h = a(() => new Map(n.colors.map((e) => [e, Je(e, n.context.editor.view.dom.ownerDocument)?.replace(u, "$1")]))), g = a(() => {
1670
1670
  let e = /* @__PURE__ */ new Set();
1671
1671
  return n.colors.filter((t) => {
1672
1672
  let n = h.value.get(t) ?? t.trim();
@@ -1677,14 +1677,14 @@ var ft = Z({
1677
1677
  let t = m.value?.replace(u, "$1");
1678
1678
  return p.value === e || t !== void 0 && t === h.value.get(e);
1679
1679
  }
1680
- function y(e) {
1680
+ function v(e) {
1681
1681
  let { context: t, kind: r } = n;
1682
- !n.disabled && Ee(t, r, e) && Me(t, r, e);
1682
+ !n.disabled && Ee(t, r, e) && Ne(t, r, e);
1683
1683
  }
1684
1684
  function b(e) {
1685
1685
  n.bubble && e.preventDefault();
1686
1686
  }
1687
- async function S() {
1687
+ async function x() {
1688
1688
  let e = m.value;
1689
1689
  if (!e) return;
1690
1690
  let { notify: t, t: r } = n.context;
@@ -1694,15 +1694,15 @@ var ft = Z({
1694
1694
  t(r("notify.clipboardUnavailable"), "warning");
1695
1695
  }
1696
1696
  }
1697
- return (t, n) => (T(), o(P(q), {
1697
+ return (t, n) => (E(), o(F(J), {
1698
1698
  to: e.overlayTarget,
1699
1699
  show: e.show,
1700
1700
  disabled: e.disabled,
1701
1701
  trigger: "click",
1702
1702
  "onUpdate:show": n[2] ||= (e) => i("update:show", e)
1703
1703
  }, {
1704
- trigger: R(() => [f(P(Y), v({ to: e.overlayTarget }, P(Q)), {
1705
- trigger: R(() => [f(P(V), {
1704
+ trigger: z(() => [f(F(X), y({ to: e.overlayTarget }, F($)), {
1705
+ trigger: z(() => [f(F(V), {
1706
1706
  quaternary: !e.bubble,
1707
1707
  text: e.bubble,
1708
1708
  size: "small",
@@ -1711,13 +1711,13 @@ var ft = Z({
1711
1711
  "aria-expanded": e.show,
1712
1712
  disabled: e.disabled
1713
1713
  }, {
1714
- icon: R(() => [l("span", Nn, [f(P(W), {
1714
+ icon: z(() => [l("span", Pn, [f(F(W), {
1715
1715
  component: e.icon,
1716
1716
  size: 16
1717
- }, null, 8, ["component"]), p.value ? (T(), c("span", {
1717
+ }, null, 8, ["component"]), p.value ? (E(), c("span", {
1718
1718
  key: 0,
1719
1719
  class: "vibe-naive-tiptap__color-indicator",
1720
- style: x({ backgroundColor: p.value })
1720
+ style: S({ backgroundColor: p.value })
1721
1721
  }, null, 4)) : s("", !0)])]),
1722
1722
  _: 1
1723
1723
  }, 8, [
@@ -1728,57 +1728,57 @@ var ft = Z({
1728
1728
  "aria-expanded",
1729
1729
  "disabled"
1730
1730
  ])]),
1731
- default: R(() => [d(" " + M(e.context.t(`command.${e.kind}`)), 1)]),
1731
+ default: z(() => [d(" " + N(e.context.t(`command.${e.kind}`)), 1)]),
1732
1732
  _: 1
1733
1733
  }, 16, ["to"])]),
1734
- default: R(() => [l("div", {
1734
+ default: z(() => [l("div", {
1735
1735
  class: "vibe-naive-tiptap__color-grid",
1736
1736
  onMousedown: b
1737
- }, [(T(!0), c(r, null, O(g.value, (t) => (T(), o(P(Y), v({
1737
+ }, [(E(!0), c(r, null, k(g.value, (t) => (E(), o(F(X), y({
1738
1738
  to: e.overlayTarget,
1739
1739
  key: t
1740
- }, { ref_for: !0 }, P(Q)), {
1741
- trigger: R(() => [f(P(V), {
1740
+ }, { ref_for: !0 }, F($)), {
1741
+ trigger: z(() => [f(F(V), {
1742
1742
  class: "vibe-naive-tiptap__color-swatch",
1743
1743
  text: "",
1744
- style: x({ backgroundColor: t }),
1744
+ style: S({ backgroundColor: t }),
1745
1745
  "aria-label": t,
1746
1746
  "aria-pressed": _(t),
1747
- onClick: (e) => y(t)
1747
+ onClick: (e) => v(t)
1748
1748
  }, null, 8, [
1749
1749
  "style",
1750
1750
  "aria-label",
1751
1751
  "aria-pressed",
1752
1752
  "onClick"
1753
1753
  ])]),
1754
- default: R(() => [d(" " + M(t), 1)]),
1754
+ default: z(() => [d(" " + N(t), 1)]),
1755
1755
  _: 2
1756
1756
  }, 1040, ["to"]))), 128))], 32), l("div", {
1757
1757
  class: "vibe-naive-tiptap__color-footer",
1758
1758
  onMousedown: b
1759
- }, [m.value ? (T(), o(P(V), {
1759
+ }, [m.value ? (E(), o(F(V), {
1760
1760
  key: 0,
1761
1761
  class: "vibe-naive-tiptap__color-hex",
1762
1762
  size: "tiny",
1763
1763
  quaternary: "",
1764
1764
  "aria-label": e.context.t("toolbar.color.copyHex", { hex: m.value }),
1765
- onClick: n[0] ||= (e) => S()
1765
+ onClick: n[0] ||= (e) => x()
1766
1766
  }, {
1767
- icon: R(() => [f(P(W), { component: P(St) }, null, 8, ["component"])]),
1768
- default: R(() => [d(" " + M(m.value), 1)]),
1767
+ icon: z(() => [f(F(W), { component: F(Ct) }, null, 8, ["component"])]),
1768
+ default: z(() => [d(" " + N(m.value), 1)]),
1769
1769
  _: 1
1770
- }, 8, ["aria-label"])) : (T(), o(P(ae), {
1770
+ }, 8, ["aria-label"])) : (E(), o(F(Y), {
1771
1771
  key: 1,
1772
1772
  depth: "3"
1773
1773
  }, {
1774
- default: R(() => [d(M(e.context.t(e.kind === "color" ? "toolbar.color.default" : "toolbar.highlight.none")), 1)]),
1774
+ default: z(() => [d(N(e.context.t(e.kind === "color" ? "toolbar.color.default" : "toolbar.highlight.none")), 1)]),
1775
1775
  _: 1
1776
- })), f(P(V), {
1776
+ })), f(F(V), {
1777
1777
  size: "tiny",
1778
- disabled: e.disabled || !P(Ee)(e.context, e.kind, ""),
1779
- onClick: n[1] ||= (e) => y("")
1778
+ disabled: e.disabled || !F(Ee)(e.context, e.kind, ""),
1779
+ onClick: n[1] ||= (e) => v("")
1780
1780
  }, {
1781
- default: R(() => [d(M(e.context.t(e.kind === "color" ? "toolbar.color.clear" : "toolbar.highlight.clear")), 1)]),
1781
+ default: z(() => [d(N(e.context.t(e.kind === "color" ? "toolbar.color.clear" : "toolbar.highlight.clear")), 1)]),
1782
1782
  _: 1
1783
1783
  }, 8, ["disabled"])], 32)]),
1784
1784
  _: 1
@@ -1788,18 +1788,18 @@ var ft = Z({
1788
1788
  "disabled"
1789
1789
  ]));
1790
1790
  }
1791
- }), Fn = 8;
1792
- function In(e, t) {
1791
+ }), In = 8;
1792
+ function Ln(e, t) {
1793
1793
  let { editor: n, element: r, pluginKey: i } = t, a = {
1794
1794
  boundary: e,
1795
- padding: Fn
1795
+ padding: In
1796
1796
  };
1797
- n.registerPlugin(Be({
1797
+ n.registerPlugin(Ve({
1798
1798
  ...t,
1799
1799
  options: {
1800
1800
  ...t.options,
1801
1801
  scrollTarget: e,
1802
- offset: Fn,
1802
+ offset: In,
1803
1803
  flip: a,
1804
1804
  shift: {
1805
1805
  ...a,
@@ -1828,10 +1828,10 @@ function In(e, t) {
1828
1828
  };
1829
1829
  }
1830
1830
  // src/whiteboard-dialog.vue?vue&type=script&setup=true&lang.ts
1831
- var Ln = ["aria-label"], Rn = {
1831
+ var Rn = ["aria-label"], zn = {
1832
1832
  key: 0,
1833
1833
  role: "alert"
1834
- }, zn = ["inert"], Bn = /* @__PURE__ */ p({
1834
+ }, Bn = ["inert"], Vn = /* @__PURE__ */ p({
1835
1835
  __name: "whiteboard-dialog",
1836
1836
  props: {
1837
1837
  context: {},
@@ -1841,109 +1841,112 @@ var Ln = ["aria-label"], Rn = {
1841
1841
  },
1842
1842
  emits: ["close"],
1843
1843
  setup(e, { emit: t }) {
1844
- let n = e, r = t, { core: i, editor: a, t: u } = n.context, p = i.holdWhiteboardSession(), m = D(), h = j(), g = D(!1), _ = D(""), v = new AbortController(), y = /* @__PURE__ */ new Map(), b = n.edit ? Fe(a, () => r("close")) : void 0, x = n.edit ? a.state.doc.nodeAt(a.state.selection.from)?.attrs.sceneData : void 0, w, E;
1845
- function O() {
1846
- return n.edit ? !!b?.range : !!E?.active;
1844
+ let n = e, r = t, { core: i, editor: u, t: p } = n.context, m = i.holdWhiteboardSession(), h = O(), g = M(), _ = O(!1), v = O(""), y = new AbortController(), b = /* @__PURE__ */ new Map(), x = n.edit ? Ie(u, () => r("close")) : void 0, S = n.edit ? u.state.doc.nodeAt(u.state.selection.from)?.attrs : void 0, T = S?.sceneData, D = S?.caption, k = a(() => typeof D == "string" && D.trim() || p("command.whiteboard")), A, j;
1845
+ function P() {
1846
+ return n.edit ? !!x?.range : !!j?.active;
1847
1847
  }
1848
- C(() => {
1849
- n.edit || (E = Pe(a, () => r("close")), E || r("close"));
1850
- }), F(m, async (e) => {
1848
+ w(() => {
1849
+ n.edit || (j = Fe(u, () => r("close")), j || r("close"));
1850
+ }), I(h, async (e) => {
1851
1851
  if (e) try {
1852
1852
  let { mountWhiteboard: t } = await import("./whiteboard-canvas-BCe25SuG.js");
1853
- if (v.signal.aborted || !O()) return;
1854
- if (n.edit && typeof x != "string") throw Error();
1855
- let r = await t(e, typeof x == "string" ? x : void 0, y, v.signal, (e) => {
1856
- h.value = e;
1853
+ if (y.signal.aborted || !P()) return;
1854
+ if (n.edit && typeof T != "string") throw Error();
1855
+ let r = await t(e, typeof T == "string" ? T : void 0, b, y.signal, (e) => {
1856
+ g.value = e;
1857
1857
  });
1858
- O() && !v.signal.aborted ? w = r : r?.();
1858
+ P() && !y.signal.aborted ? A = r : r?.();
1859
1859
  } catch {
1860
- v.signal.aborted || (_.value = u("whiteboard.loadFailed"));
1860
+ y.signal.aborted || (v.value = p("whiteboard.loadFailed"));
1861
1861
  }
1862
- }, { flush: "post" }), S(() => {
1863
- v.abort(), b?.dispose(), E?.cancel(), w?.(), p();
1862
+ }, { flush: "post" }), C(() => {
1863
+ y.abort(), x?.dispose(), j?.cancel(), A?.(), m();
1864
1864
  });
1865
- async function k() {
1866
- if (h.value && !g.value && a.isEditable) {
1867
- g.value = !0, _.value = "";
1865
+ async function L() {
1866
+ if (g.value && !_.value && u.isEditable) {
1867
+ _.value = !0, v.value = "";
1868
1868
  try {
1869
1869
  let { exportWhiteboard: e } = await import("./whiteboard-canvas-BCe25SuG.js");
1870
- if (!O() || v.signal.aborted) return;
1871
- let t = a.view.dom.ownerDocument.baseURI, { sceneData: o, file: s } = await e(h.value, y, n.uploadAsset, t, v.signal);
1872
- if (!O() || !a.isEditable || v.signal.aborted) return;
1873
- let c = Le(s, "whiteboard", { maxSize: i.whiteboardPreviewMaxSize });
1874
- if (c?.reason === "too-large") {
1875
- _.value = u("notify.assetFileTooLarge", {
1876
- size: ge(c.size),
1877
- limit: ge(c.maxSize)
1870
+ if (!P() || y.signal.aborted) return;
1871
+ let t = u.view.dom.ownerDocument.baseURI, { sceneData: a, file: o } = await e(g.value, b, n.uploadAsset, t, y.signal);
1872
+ if (!P() || !u.isEditable || y.signal.aborted) return;
1873
+ let s = Re(o, "whiteboard", { maxSize: i.whiteboardPreviewMaxSize });
1874
+ if (s?.reason === "too-large") {
1875
+ v.value = p("notify.assetFileTooLarge", {
1876
+ size: ge(s.size),
1877
+ limit: ge(s.maxSize)
1878
1878
  });
1879
1879
  return;
1880
1880
  }
1881
- let l = await n.uploadAsset(s, "whiteboard"), d = (typeof l == "string" ? l : l?.url)?.trim();
1882
- if (!O() || !a.isEditable || a.isDestroyed || v.signal.aborted) return;
1883
- if (!d || new URL(d, t).protocol === "data:") throw Error();
1881
+ let c = await n.uploadAsset(o, "whiteboard"), l = (typeof c == "string" ? c : c?.url)?.trim();
1882
+ if (!P() || !u.isEditable || u.isDestroyed || y.signal.aborted) return;
1883
+ if (!l || new URL(l, t).protocol === "data:") throw Error();
1884
1884
  if (n.edit) {
1885
- let e = b?.range;
1885
+ let e = x?.range;
1886
1886
  if (!e) return;
1887
- let t = a.state.doc.nodeAt(e.from);
1888
- if (t?.type.name !== "whiteboard" || t.attrs.sceneData !== x) throw Error();
1889
- a.view.dispatch(a.state.tr.setNodeAttribute(e.from, "src", d).setNodeAttribute(e.from, "sceneData", o));
1887
+ let t = u.state.doc.nodeAt(e.from);
1888
+ if (t?.type.name !== "whiteboard" || t.attrs.sceneData !== T) throw Error();
1889
+ u.view.dispatch(u.state.tr.setNodeAttribute(e.from, "src", l).setNodeAttribute(e.from, "sceneData", a));
1890
1890
  } else {
1891
- if (!E?.complete({
1892
- src: d,
1893
- sceneData: o
1891
+ if (!j?.complete({
1892
+ src: l,
1893
+ sceneData: a
1894
1894
  })) throw Error();
1895
- E = void 0;
1895
+ j = void 0;
1896
1896
  }
1897
- r("close"), a.commands.focus();
1897
+ r("close"), u.commands.focus();
1898
1898
  } catch {
1899
- v.signal.aborted || (_.value = u("whiteboard.saveFailed"));
1899
+ y.signal.aborted || (v.value = p("whiteboard.saveFailed"));
1900
1900
  } finally {
1901
- g.value = !1;
1901
+ _.value = !1;
1902
1902
  }
1903
1903
  }
1904
1904
  }
1905
- return (t, n) => (T(), o(P(K), {
1905
+ return (t, n) => (E(), o(F(q), {
1906
1906
  show: "",
1907
- to: e.overlayTarget ?? P(a).view.dom.ownerDocument.body,
1907
+ to: e.overlayTarget ?? F(u).view.dom.ownerDocument.body,
1908
1908
  "mask-closable": !1,
1909
- "close-on-esc": !g.value,
1909
+ "close-on-esc": !_.value,
1910
1910
  "onUpdate:show": n[1] ||= (e) => !e && r("close")
1911
1911
  }, {
1912
- default: R(() => [l("div", {
1912
+ default: z(() => [l("div", {
1913
1913
  class: "vibe-whiteboard",
1914
1914
  "data-excalidraw-modal-root": "",
1915
1915
  role: "dialog",
1916
1916
  "aria-modal": "true",
1917
- "aria-label": P(u)("command.whiteboard")
1917
+ "aria-label": k.value
1918
1918
  }, [l("header", null, [
1919
- l("strong", null, M(P(u)("command.whiteboard")), 1),
1920
- _.value ? (T(), c("span", Rn, M(_.value), 1)) : s("", !0),
1921
- f(P(V), {
1922
- disabled: g.value,
1919
+ l("strong", null, [f(F(nn), {
1920
+ size: 16,
1921
+ "aria-hidden": "true"
1922
+ }), l("span", null, N(k.value), 1)]),
1923
+ v.value ? (E(), c("span", zn, N(v.value), 1)) : s("", !0),
1924
+ f(F(V), {
1925
+ disabled: _.value,
1923
1926
  onClick: n[0] ||= (e) => r("close")
1924
1927
  }, {
1925
- default: R(() => [d(M(P(u)("toolbar.action.cancel")), 1)]),
1928
+ default: z(() => [d(N(F(p)("toolbar.action.cancel")), 1)]),
1926
1929
  _: 1
1927
1930
  }, 8, ["disabled"]),
1928
- f(P(V), {
1931
+ f(F(V), {
1929
1932
  type: "primary",
1930
- disabled: !h.value,
1931
- loading: g.value,
1932
- onClick: k
1933
+ disabled: !g.value,
1934
+ loading: _.value,
1935
+ onClick: L
1933
1936
  }, {
1934
- default: R(() => [d(M(P(u)("whiteboard.save")), 1)]),
1937
+ default: z(() => [d(N(F(p)("whiteboard.save")), 1)]),
1935
1938
  _: 1
1936
1939
  }, 8, ["disabled", "loading"])
1937
1940
  ]), l("div", {
1938
1941
  ref_key: "canvas",
1939
- ref: m,
1942
+ ref: h,
1940
1943
  class: "vibe-whiteboard__canvas",
1941
- inert: g.value
1942
- }, null, 8, zn)], 8, Ln)]),
1944
+ inert: _.value
1945
+ }, null, 8, Bn)], 8, Rn)]),
1943
1946
  _: 1
1944
1947
  }, 8, ["to", "close-on-esc"]));
1945
1948
  }
1946
- }), Vn = "imageBubbleMenu", Hn = /* @__PURE__ */ p({
1949
+ }), Hn = "imageBubbleMenu", Un = /* @__PURE__ */ p({
1947
1950
  __name: "naive-tiptap-image-bubble-menu",
1948
1951
  props: {
1949
1952
  context: {},
@@ -1952,19 +1955,19 @@ var Ln = ["aria-label"], Rn = {
1952
1955
  overlayTarget: {}
1953
1956
  },
1954
1957
  setup(e) {
1955
- let t = e, n = D(!1), i = D(), u = D(!1), p = D(), m = D(!1), h = a(() => {
1958
+ let t = e, n = O(!1), i = O(), u = O(!1), p = O(), m = O(!1), h = a(() => {
1956
1959
  let { editor: e, revision: n } = t.context;
1957
1960
  n.value;
1958
1961
  let r = e.state.selection;
1959
- if (!(r instanceof Re)) return;
1962
+ if (!(r instanceof ze)) return;
1960
1963
  let { name: i } = r.node.type;
1961
1964
  if (i !== "image" && i !== "whiteboard") return;
1962
- let { align: a, width: o, height: s } = r.node.attrs, c = e.view.nodeDOM(r.from), l = o == null && s == null ? "original" : jn.find(({ ratio: t }) => t !== null && o === Math.round(e.view.dom.clientWidth * t))?.key;
1965
+ let { align: a, width: o, height: s } = r.node.attrs, c = e.view.nodeDOM(r.from), l = o == null && s == null ? "original" : Mn.find(({ ratio: t }) => t !== null && o === Math.round(e.view.dom.clientWidth * t))?.key;
1963
1966
  return {
1964
1967
  align: a ?? "center",
1965
1968
  size: l,
1966
1969
  whiteboard: i === "whiteboard",
1967
- canShowAsFile: X(e, "image", "file"),
1970
+ canShowAsFile: de(e, "image", "file"),
1968
1971
  caption: c instanceof HTMLElement ? c.querySelector(".vibe-tiptap-img-caption") : null
1969
1972
  };
1970
1973
  }), g = a(() => t.context.t(h.value?.whiteboard ? "whiteboard.delete" : "image.delete"));
@@ -1973,7 +1976,7 @@ var Ln = ["aria-label"], Rn = {
1973
1976
  if (!h.value?.whiteboard) return n.setImageAlign(e);
1974
1977
  r.chain().focus().updateAttributes("whiteboard", { align: e }).run();
1975
1978
  }
1976
- function y(e, n) {
1979
+ function v(e, n) {
1977
1980
  let { commands: r, editor: i } = t.context;
1978
1981
  if (!h.value?.whiteboard) return r.setImageSize(e);
1979
1982
  let a = i.view.dom.clientWidth;
@@ -1993,9 +1996,9 @@ var Ln = ["aria-label"], Rn = {
1993
1996
  let e = h.value?.caption;
1994
1997
  if (!e || e.readOnly) return;
1995
1998
  let { editor: n } = t.context;
1996
- e.hidden = !1, e.focus(), e.ownerDocument.activeElement === e && n.view.dispatch(n.state.tr.setMeta(Vn, "hide"));
1999
+ e.hidden = !1, e.focus(), e.ownerDocument.activeElement === e && n.view.dispatch(n.state.tr.setMeta(Hn, "hide"));
1997
2000
  }
1998
- async function w(e) {
2001
+ async function S(e) {
1999
2002
  if (!t.canUpload || !(e.target instanceof HTMLInputElement)) return;
2000
2003
  let n = e.target.files?.[0];
2001
2004
  if (e.target.value = "", !n || m.value) return;
@@ -2009,13 +2012,13 @@ var Ln = ["aria-label"], Rn = {
2009
2012
  m.value = !1;
2010
2013
  }
2011
2014
  }
2012
- let E;
2013
- return C(() => {
2015
+ let T;
2016
+ return w(() => {
2014
2017
  let { editor: e } = t.context, n = i.value, r = e.view.dom.parentElement, a = r?.parentElement;
2015
- n?.remove(), n && r && a && (e.schema.nodes.image || e.schema.nodes.whiteboard) && (E = In(r, {
2018
+ n?.remove(), n && r && a && (e.schema.nodes.image || e.schema.nodes.whiteboard) && (T = Ln(r, {
2016
2019
  editor: e,
2017
2020
  element: n,
2018
- pluginKey: Vn,
2021
+ pluginKey: Hn,
2019
2022
  appendTo: a,
2020
2023
  updateDelay: 0,
2021
2024
  options: {
@@ -2026,23 +2029,23 @@ var Ln = ["aria-label"], Rn = {
2026
2029
  u.value = !1;
2027
2030
  }
2028
2031
  },
2029
- shouldShow: ({ view: t, element: n, state: r }) => e.isEditable && r.selection instanceof Re && (r.selection.node.type.name === "image" || r.selection.node.type.name === "whiteboard" && r.selection.node.attrs.uploadStatus !== "uploading") && (t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement))
2032
+ shouldShow: ({ view: t, element: n, state: r }) => e.isEditable && r.selection instanceof ze && (r.selection.node.type.name === "image" || r.selection.node.type.name === "whiteboard" && r.selection.node.attrs.uploadStatus !== "uploading") && (t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement))
2030
2033
  }));
2031
- }), S(() => E?.()), (t, a) => (T(), c(r, null, [l("div", {
2034
+ }), C(() => T?.()), (t, a) => (E(), c(r, null, [l("div", {
2032
2035
  ref_key: "imageMenu",
2033
2036
  ref: i,
2034
2037
  class: "vibe-naive-tiptap__bubble vibe-naive-tiptap__image-bubble",
2035
2038
  onMousedown: a[3] ||= B(() => {}, ["prevent"])
2036
2039
  }, [
2037
- (T(!0), c(r, null, O(P(jn), (t) => (T(), o(P(V), {
2040
+ (E(!0), c(r, null, k(F(Mn), (t) => (E(), o(F(V), {
2038
2041
  key: t.key,
2039
2042
  text: "",
2040
2043
  title: e.context.t(`image.size.${t.key}Tooltip`),
2041
2044
  "aria-pressed": h.value?.size === t.key,
2042
2045
  type: h.value?.size === t.key ? "primary" : "default",
2043
- onClick: (e) => y(t.key, t.ratio)
2046
+ onClick: (e) => v(t.key, t.ratio)
2044
2047
  }, {
2045
- default: R(() => [d(M(e.context.t(`image.size.${t.key}`)), 1)]),
2048
+ default: z(() => [d(N(e.context.t(`image.size.${t.key}`)), 1)]),
2046
2049
  _: 2
2047
2050
  }, 1032, [
2048
2051
  "title",
@@ -2054,19 +2057,19 @@ var Ln = ["aria-label"], Rn = {
2054
2057
  class: "vibe-naive-tiptap__bubble-divider",
2055
2058
  "aria-hidden": "true"
2056
2059
  }, null, -1),
2057
- (T(!0), c(r, null, O(P(Mn), (t) => (T(), o(P(Y), v({
2060
+ (E(!0), c(r, null, k(F(Nn), (t) => (E(), o(F(X), y({
2058
2061
  key: t.key,
2059
2062
  to: e.overlayTarget,
2060
2063
  disabled: !u.value
2061
- }, { ref_for: !0 }, P(Q)), {
2062
- trigger: R(() => [f(P(V), {
2064
+ }, { ref_for: !0 }, F($)), {
2065
+ trigger: z(() => [f(F(V), {
2063
2066
  text: "",
2064
2067
  "aria-label": e.context.t(`image.align.${t.key}`),
2065
2068
  "aria-pressed": h.value?.align === t.key,
2066
2069
  type: h.value?.align === t.key ? "primary" : "default",
2067
2070
  onClick: (e) => _(t.key)
2068
2071
  }, {
2069
- default: R(() => [(T(), o(A(t.icon), { size: 16 }))]),
2072
+ default: z(() => [(E(), o(j(t.icon), { size: 16 }))]),
2070
2073
  _: 2
2071
2074
  }, 1032, [
2072
2075
  "aria-label",
@@ -2074,97 +2077,97 @@ var Ln = ["aria-label"], Rn = {
2074
2077
  "type",
2075
2078
  "onClick"
2076
2079
  ])]),
2077
- default: R(() => [d(" " + M(e.context.t(`image.align.${t.key}`)), 1)]),
2080
+ default: z(() => [d(" " + N(e.context.t(`image.align.${t.key}`)), 1)]),
2078
2081
  _: 2
2079
2082
  }, 1040, ["to", "disabled"]))), 128)),
2080
2083
  a[6] ||= l("span", {
2081
2084
  class: "vibe-naive-tiptap__bubble-divider",
2082
2085
  "aria-hidden": "true"
2083
2086
  }, null, -1),
2084
- h.value?.caption ? (T(), o(P(Y), v({
2087
+ h.value?.caption ? (E(), o(F(X), y({
2085
2088
  key: 0,
2086
2089
  to: e.overlayTarget,
2087
2090
  disabled: !u.value
2088
- }, P(Q)), {
2089
- trigger: R(() => [f(P(V), {
2091
+ }, F($)), {
2092
+ trigger: z(() => [f(F(V), {
2090
2093
  text: "",
2091
2094
  "aria-label": e.context.t("image.caption"),
2092
2095
  onClick: x
2093
2096
  }, {
2094
- default: R(() => [f(P(gt), { size: 16 })]),
2097
+ default: z(() => [f(F(_t), { size: 16 })]),
2095
2098
  _: 1
2096
2099
  }, 8, ["aria-label"])]),
2097
- default: R(() => [d(" " + M(e.context.t("image.caption")), 1)]),
2100
+ default: z(() => [d(" " + N(e.context.t("image.caption")), 1)]),
2098
2101
  _: 1
2099
2102
  }, 16, ["to", "disabled"])) : s("", !0),
2100
- h.value?.whiteboard && e.uploadAsset ? (T(), o(P(V), {
2103
+ h.value?.whiteboard && e.uploadAsset ? (E(), o(F(V), {
2101
2104
  key: 1,
2102
2105
  text: "",
2103
2106
  "aria-label": e.context.t("whiteboard.edit"),
2104
2107
  title: e.context.t("whiteboard.edit"),
2105
2108
  onClick: a[0] ||= (e) => n.value = !0
2106
2109
  }, {
2107
- default: R(() => [f(P(tn), { size: 16 })]),
2110
+ default: z(() => [f(F(nn), { size: 16 })]),
2108
2111
  _: 1
2109
2112
  }, 8, ["aria-label", "title"])) : s("", !0),
2110
- e.canUpload && !h.value?.whiteboard ? (T(), o(P(Y), v({
2113
+ e.canUpload && !h.value?.whiteboard ? (E(), o(F(X), y({
2111
2114
  key: 2,
2112
2115
  to: e.overlayTarget,
2113
2116
  disabled: !u.value
2114
- }, P(Q)), {
2115
- trigger: R(() => [f(P(V), {
2117
+ }, F($)), {
2118
+ trigger: z(() => [f(F(V), {
2116
2119
  text: "",
2117
2120
  "aria-label": e.context.t("image.replace"),
2118
2121
  loading: m.value,
2119
2122
  onClick: a[1] ||= (e) => p.value?.click()
2120
2123
  }, {
2121
- default: R(() => [f(P(zt), { size: 16 })]),
2124
+ default: z(() => [f(F(Bt), { size: 16 })]),
2122
2125
  _: 1
2123
2126
  }, 8, ["aria-label", "loading"])]),
2124
- default: R(() => [d(" " + M(e.context.t("image.replace")), 1)]),
2127
+ default: z(() => [d(" " + N(e.context.t("image.replace")), 1)]),
2125
2128
  _: 1
2126
2129
  }, 16, ["to", "disabled"])) : s("", !0),
2127
- e.canUpload ? (T(), c("input", {
2130
+ e.canUpload ? (E(), c("input", {
2128
2131
  key: 3,
2129
2132
  ref_key: "imageFileInput",
2130
2133
  ref: p,
2131
2134
  type: "file",
2132
2135
  accept: "image/*",
2133
2136
  hidden: "",
2134
- onChange: w
2137
+ onChange: S
2135
2138
  }, null, 544)) : s("", !0),
2136
- h.value?.canShowAsFile ? (T(), o(P(Y), v({
2139
+ h.value?.canShowAsFile ? (E(), o(F(X), y({
2137
2140
  key: 4,
2138
2141
  to: e.overlayTarget,
2139
2142
  disabled: !u.value
2140
- }, P(Q)), {
2141
- trigger: R(() => [f(P(V), {
2143
+ }, F($)), {
2144
+ trigger: z(() => [f(F(V), {
2142
2145
  text: "",
2143
2146
  "aria-label": e.context.t("video.showAsFile"),
2144
2147
  onClick: a[2] ||= (t) => e.context.commands.setImageDisplay("file")
2145
2148
  }, {
2146
- default: R(() => [f(P(en), { size: 16 })]),
2149
+ default: z(() => [f(F(tn), { size: 16 })]),
2147
2150
  _: 1
2148
2151
  }, 8, ["aria-label"])]),
2149
- default: R(() => [d(" " + M(e.context.t("video.showAsFile")), 1)]),
2152
+ default: z(() => [d(" " + N(e.context.t("video.showAsFile")), 1)]),
2150
2153
  _: 1
2151
2154
  }, 16, ["to", "disabled"])) : s("", !0),
2152
- f(P(Y), v({
2155
+ f(F(X), y({
2153
2156
  to: e.overlayTarget,
2154
2157
  disabled: !u.value
2155
- }, P(Q)), {
2156
- trigger: R(() => [f(P(V), {
2158
+ }, F($)), {
2159
+ trigger: z(() => [f(F(V), {
2157
2160
  text: "",
2158
2161
  "aria-label": g.value,
2159
2162
  onClick: b
2160
2163
  }, {
2161
- default: R(() => [f(P(Sn), { size: 16 })]),
2164
+ default: z(() => [f(F(Cn), { size: 16 })]),
2162
2165
  _: 1
2163
2166
  }, 8, ["aria-label"])]),
2164
- default: R(() => [d(" " + M(g.value), 1)]),
2167
+ default: z(() => [d(" " + N(g.value), 1)]),
2165
2168
  _: 1
2166
2169
  }, 16, ["to", "disabled"])
2167
- ], 544), n.value && e.uploadAsset ? (T(), o(Bn, {
2170
+ ], 544), n.value && e.uploadAsset ? (E(), o(Vn, {
2168
2171
  key: 0,
2169
2172
  context: e.context,
2170
2173
  "upload-asset": e.uploadAsset,
@@ -2177,7 +2180,7 @@ var Ln = ["aria-label"], Rn = {
2177
2180
  "overlay-target"
2178
2181
  ])) : s("", !0)], 64));
2179
2182
  }
2180
- }), Un = "naiveTextBubbleMenu", Wn = "naiveLinkBubbleMenu", Gn = "videoBubbleMenu", Kn = "naiveFileBubbleMenu", qn = /* @__PURE__ */ p({
2183
+ }), Wn = "naiveTextBubbleMenu", Gn = "naiveLinkBubbleMenu", Kn = "videoBubbleMenu", qn = "naiveFileBubbleMenu", Jn = /* @__PURE__ */ p({
2181
2184
  __name: "naive-tiptap-bubble-menus",
2182
2185
  props: {
2183
2186
  context: {},
@@ -2188,56 +2191,56 @@ var Ln = ["aria-label"], Rn = {
2188
2191
  },
2189
2192
  emits: ["open-link", "palette-visibility-change"],
2190
2193
  setup(e, { emit: t }) {
2191
- let n = e, i = t, u = D(), p = D(), m = D(!1), h = D(), g = D(!1), _ = D(), b = D(!1), x = D(), w = D();
2192
- F(() => !!w.value, (e) => i("palette-visibility-change", e));
2193
- let E = [
2194
+ let n = e, i = t, u = O(), p = O(), m = O(!1), h = O(), g = O(!1), _ = O(), v = O(!1), x = O(), S = O();
2195
+ I(() => !!S.value, (e) => i("palette-visibility-change", e));
2196
+ let T = [
2194
2197
  {
2195
2198
  key: "bold",
2196
- icon: Ht,
2199
+ icon: Ut,
2197
2200
  commands: ["toggleBold"]
2198
2201
  },
2199
2202
  {
2200
2203
  key: "italic",
2201
- icon: Vt,
2204
+ icon: Ht,
2202
2205
  commands: ["toggleItalic"]
2203
2206
  },
2204
2207
  {
2205
2208
  key: "underline",
2206
- icon: wn,
2209
+ icon: Tn,
2207
2210
  commands: ["toggleUnderline"]
2208
2211
  },
2209
2212
  {
2210
2213
  key: "strike",
2211
- icon: fn,
2214
+ icon: pn,
2212
2215
  commands: ["toggleStrike"]
2213
2216
  },
2214
2217
  {
2215
2218
  key: "link",
2216
- icon: Wt,
2219
+ icon: Gt,
2217
2220
  commands: ["setLink", "unsetLink"]
2218
2221
  },
2219
2222
  {
2220
2223
  key: "color",
2221
- icon: $t,
2224
+ icon: en,
2222
2225
  commands: ["setColor", "unsetColor"]
2223
2226
  },
2224
2227
  {
2225
2228
  key: "highlight",
2226
- icon: Lt,
2229
+ icon: Rt,
2227
2230
  commands: ["toggleHighlight", "unsetHighlight"]
2228
2231
  },
2229
2232
  {
2230
2233
  key: "clearFormat",
2231
- icon: Dt,
2234
+ icon: Ot,
2232
2235
  commands: ["clearNodes", "unsetAllMarks"]
2233
2236
  }
2234
2237
  ];
2235
- function k(e) {
2238
+ function D(e) {
2236
2239
  let { selection: t, schema: n, doc: r } = e, i = n.marks.link;
2237
- if (!(t instanceof ze) || !i) return;
2240
+ if (!(t instanceof Be) || !i) return;
2238
2241
  let { $from: a, from: o, to: s } = t, c = i.isInSet(a.nodeAfter?.marks ?? []), l = c?.attrs.href, u = c?.attrs.target;
2239
2242
  if (!c || typeof l != "string" || !l) return;
2240
- let d = de(a, i, c.attrs);
2243
+ let d = ue(a, i, c.attrs);
2241
2244
  if (!(!d || s > d.to || o < d.from)) return {
2242
2245
  ...d,
2243
2246
  href: l,
@@ -2245,11 +2248,11 @@ var Ln = ["aria-label"], Rn = {
2245
2248
  text: r.textBetween(d.from, d.to, " ")
2246
2249
  };
2247
2250
  }
2248
- let j = a(() => {
2251
+ let A = a(() => {
2249
2252
  let { editor: e, revision: t } = n.context;
2250
- return t.value, k(e.state);
2251
- }), N = a(() => {
2252
- let e = j.value;
2253
+ return t.value, D(e.state);
2254
+ }), M = a(() => {
2255
+ let e = A.value;
2253
2256
  if (!e) return;
2254
2257
  let { ownerDocument: t } = n.context.editor.view.dom;
2255
2258
  try {
@@ -2265,15 +2268,15 @@ var Ln = ["aria-label"], Rn = {
2265
2268
  return;
2266
2269
  }
2267
2270
  });
2268
- function I() {
2269
- let e = j.value;
2271
+ function P() {
2272
+ let e = A.value;
2270
2273
  e && i("open-link", e);
2271
2274
  }
2272
2275
  function L() {
2273
- let e = j.value;
2274
- if (e) return z(e.href, n.context.t("notify.linkCopied"));
2276
+ let e = A.value;
2277
+ if (e) return R(e.href, n.context.t("notify.linkCopied"));
2275
2278
  }
2276
- async function z(e, t) {
2279
+ async function R(e, t) {
2277
2280
  let { editor: r, notify: i, t: a } = n.context;
2278
2281
  try {
2279
2282
  let n = r.view.dom.ownerDocument.defaultView?.navigator.clipboard;
@@ -2286,21 +2289,21 @@ var Ln = ["aria-label"], Rn = {
2286
2289
  i(a("notify.clipboardUnavailable"), "warning");
2287
2290
  }
2288
2291
  }
2289
- function H() {
2290
- let e = j.value;
2292
+ function ee() {
2293
+ let e = A.value;
2291
2294
  if (!e) return;
2292
2295
  let { commands: t, notify: r, t: i } = n.context;
2293
2296
  t.setLink("", { range: e }), r(i("notify.linkRemoved"), "success");
2294
2297
  }
2295
- function ee(e) {
2296
- return e instanceof Re && (e.node.type.name === "video" || e.node.type.name === "audio");
2298
+ function H(e) {
2299
+ return e instanceof ze && (e.node.type.name === "video" || e.node.type.name === "audio");
2297
2300
  }
2298
2301
  let U = a(() => {
2299
2302
  let { editor: e, revision: t } = n.context;
2300
2303
  t.value;
2301
2304
  let { selection: r } = e.state;
2302
- if (!ee(r)) return;
2303
- let { node: i } = r, a = e.view.nodeDOM(r.from), o = i.attrs.src, s;
2305
+ if (!H(r)) return;
2306
+ let { node: i } = r, a = e.view.nodeDOM(r.from), o = je(e, i.type.name, i.attrs), s;
2304
2307
  if (typeof o == "string" && o) try {
2305
2308
  let t = new URL(o, e.view.dom.ownerDocument.baseURI);
2306
2309
  [
@@ -2313,32 +2316,32 @@ var Ln = ["aria-label"], Rn = {
2313
2316
  let c = i.type.name === "video" ? "video" : "audio";
2314
2317
  return {
2315
2318
  kind: c,
2316
- canShowAsFile: X(e, c, "file"),
2319
+ canShowAsFile: de(e, c, "file"),
2317
2320
  align: i.attrs.align,
2318
2321
  size: i.attrs.size,
2319
2322
  caption: a instanceof HTMLElement ? a.querySelector(".vibe-tiptap-media-caption") : null,
2320
2323
  url: s
2321
2324
  };
2322
2325
  });
2323
- function W() {
2326
+ function te() {
2324
2327
  let e = U.value?.caption;
2325
2328
  if (e && !e.readOnly && (e.hidden = !1, e.focus(), e.ownerDocument.activeElement === e)) {
2326
2329
  let { editor: e } = n.context;
2327
- e.view.dispatch(e.state.tr.setMeta(Gn, "hide"));
2330
+ e.view.dispatch(e.state.tr.setMeta(Kn, "hide"));
2328
2331
  }
2329
2332
  }
2330
- function te() {
2333
+ function W() {
2331
2334
  let e = U.value?.url;
2332
- if (e) return z(e, n.context.t("notify.linkCopied"));
2335
+ if (e) return R(e, n.context.t("notify.linkCopied"));
2333
2336
  }
2334
- function G({ selection: e }) {
2335
- return e instanceof Re && e.node.type.name === "fileAttachment";
2337
+ function ne({ selection: e }) {
2338
+ return e instanceof ze && e.node.type.name === "fileAttachment";
2336
2339
  }
2337
- let ne = a(() => {
2340
+ let G = a(() => {
2338
2341
  let { editor: e, revision: t } = n.context;
2339
2342
  return t.value, Ce(e);
2340
2343
  }), K = a(() => {
2341
- let e = ne.value?.href;
2344
+ let e = G.value?.href;
2342
2345
  if (!e) return;
2343
2346
  let { ownerDocument: t } = n.context.editor.view.dom;
2344
2347
  try {
@@ -2353,23 +2356,23 @@ var Ln = ["aria-label"], Rn = {
2353
2356
  return;
2354
2357
  }
2355
2358
  }), q = a(() => {
2356
- let e = ne.value, t = K.value;
2359
+ let e = G.value, t = K.value;
2357
2360
  if (!e || !t) return;
2358
2361
  let r = pe(e.attrs), i = r === "video" || r === "audio" || r === "pdf";
2359
2362
  if (i || n.context.core.fileAttachmentDownload) return {
2360
2363
  href: t,
2361
2364
  label: n.context.t(i ? "file.action.open" : "file.action.download"),
2362
- icon: i ? Ot : Ct,
2365
+ icon: i ? kt : wt,
2363
2366
  download: i ? void 0 : e.attrs.name ? e.name : ""
2364
2367
  };
2365
2368
  });
2366
- function re() {
2367
- if (K.value) return z(K.value, n.context.t("notify.fileCopied"));
2369
+ function J() {
2370
+ if (K.value) return R(K.value, n.context.t("notify.fileCopied"));
2368
2371
  }
2369
- let J = a(() => {
2370
- if (!ne.value) return;
2371
- let { editor: e, commands: t, t: r } = n.context, i = pe(ne.value.attrs);
2372
- if ((i === "image" || i === "audio" || i === "video") && X(e, i, "media")) return {
2372
+ let re = a(() => {
2373
+ if (!G.value) return;
2374
+ let { editor: e, commands: t, t: r } = n.context, i = pe(G.value.attrs);
2375
+ if ((i === "image" || i === "audio" || i === "video") && de(e, i, "media")) return {
2373
2376
  ...{
2374
2377
  image: {
2375
2378
  label: r("file.action.showAsImage"),
@@ -2384,43 +2387,43 @@ var Ln = ["aria-label"], Rn = {
2384
2387
  run: () => t.setVideoDisplay("player")
2385
2388
  }
2386
2389
  }[i],
2387
- icon: An[i]
2390
+ icon: jn[i]
2388
2391
  };
2389
2392
  });
2390
2393
  function ie() {
2391
2394
  let { editor: e } = n.context;
2392
- e.isEditable && G(e.state) && e.chain().focus().deleteSelection().run();
2395
+ e.isEditable && ne(e.state) && e.chain().focus().deleteSelection().run();
2393
2396
  }
2394
2397
  let ae = a(() => {
2395
2398
  let { editor: e } = n.context, t = e.commands;
2396
- return E.filter(({ key: n, commands: r }) => {
2399
+ return T.filter(({ key: n, commands: r }) => {
2397
2400
  let i = n === "color" ? "textStyle" : n;
2398
2401
  return n !== "clearFormat" && !e.schema.marks[i] ? !1 : r.every((e) => typeof Reflect.get(t, e) == "function");
2399
2402
  });
2400
2403
  });
2401
- function oe(e, t) {
2402
- t ? w.value = e : w.value === e && (w.value = void 0);
2404
+ function Y(e, t) {
2405
+ t ? S.value = e : S.value === e && (S.value = void 0);
2403
2406
  }
2404
- function se(e) {
2405
- e === "link" ? i("open-link") : Me(n.context, e);
2407
+ function oe(e) {
2408
+ e === "link" ? i("open-link") : Ne(n.context, e);
2406
2409
  }
2407
- let ce = [];
2408
- return C(() => {
2410
+ let Z = [];
2411
+ return w(() => {
2409
2412
  let { editor: e } = n.context, t = u.value, r = p.value, i = h.value, a = _.value, o = e.view.dom.parentElement, s = o?.parentElement;
2410
- t?.remove(), r?.remove(), i?.remove(), a?.remove(), t && o && s && (ce.push(In(o, {
2413
+ t?.remove(), r?.remove(), i?.remove(), a?.remove(), t && o && s && (Z.push(Ln(o, {
2411
2414
  editor: e,
2412
2415
  element: t,
2413
- pluginKey: Un,
2416
+ pluginKey: Wn,
2414
2417
  appendTo: s,
2415
2418
  updateDelay: 100,
2416
2419
  options: { onHide: () => {
2417
- w.value = void 0;
2420
+ S.value = void 0;
2418
2421
  } },
2419
- shouldShow: ({ view: t, element: n, state: r }) => e.isEditable && ae.value.length > 0 && (t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement)) && r.selection instanceof ze && !r.selection.empty && !!r.doc.textBetween(r.selection.from, r.selection.to) && !k(r) && !e.isActive("table") && !e.isActive("codeBlock")
2420
- })), r && e.schema.marks.link && ce.push(In(o, {
2422
+ shouldShow: ({ view: t, element: n, state: r }) => e.isEditable && ae.value.length > 0 && (t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement)) && r.selection instanceof Be && !r.selection.empty && !!r.doc.textBetween(r.selection.from, r.selection.to) && !D(r) && !e.isActive("table") && !e.isActive("codeBlock")
2423
+ })), r && e.schema.marks.link && Z.push(Ln(o, {
2421
2424
  editor: e,
2422
2425
  element: r,
2423
- pluginKey: Wn,
2426
+ pluginKey: Gn,
2424
2427
  appendTo: s,
2425
2428
  updateDelay: 0,
2426
2429
  options: {
@@ -2431,26 +2434,26 @@ var Ln = ["aria-label"], Rn = {
2431
2434
  m.value = !1;
2432
2435
  }
2433
2436
  },
2434
- shouldShow: ({ view: t, element: n, state: r }) => e.isEditable && (t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement)) && !!k(r) && !e.isActive("codeBlock")
2435
- })), a && x.value && e.schema.nodes.fileAttachment && ce.push(In(o, {
2437
+ shouldShow: ({ view: t, element: n, state: r }) => e.isEditable && (t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement)) && !!D(r) && !e.isActive("codeBlock")
2438
+ })), a && x.value && e.schema.nodes.fileAttachment && Z.push(Ln(o, {
2436
2439
  editor: e,
2437
2440
  element: a,
2438
- pluginKey: Kn,
2441
+ pluginKey: qn,
2439
2442
  appendTo: x.value,
2440
2443
  updateDelay: 0,
2441
2444
  options: {
2442
2445
  onShow: () => {
2443
- b.value = !0;
2446
+ v.value = !0;
2444
2447
  },
2445
2448
  onHide: () => {
2446
- b.value = !1;
2449
+ v.value = !1;
2447
2450
  }
2448
2451
  },
2449
- shouldShow: ({ view: t, element: n, state: r }) => e.isEditable && G(r) && !!Ce(e) && (t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement))
2450
- })), i && (e.schema.nodes.video || e.schema.nodes.audio) && ce.push(In(o, {
2452
+ shouldShow: ({ view: t, element: n, state: r }) => e.isEditable && ne(r) && !!Ce(e) && (t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement))
2453
+ })), i && (e.schema.nodes.video || e.schema.nodes.audio) && Z.push(Ln(o, {
2451
2454
  editor: e,
2452
2455
  element: i,
2453
- pluginKey: Gn,
2456
+ pluginKey: Kn,
2454
2457
  appendTo: s,
2455
2458
  updateDelay: 0,
2456
2459
  options: {
@@ -2463,28 +2466,28 @@ var Ln = ["aria-label"], Rn = {
2463
2466
  },
2464
2467
  shouldShow: ({ view: t, element: n, state: r }) => {
2465
2468
  let { selection: i } = r;
2466
- return !e.isEditable || !ee(i) || i.node.attrs.uploadStatus === "uploading" ? !1 : t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement);
2469
+ return !e.isEditable || !H(i) || i.node.attrs.uploadStatus === "uploading" ? !1 : t.hasFocus() || n.contains(t.dom.ownerDocument.activeElement);
2467
2470
  }
2468
2471
  })));
2469
- }), S(() => {
2472
+ }), C(() => {
2470
2473
  i("palette-visibility-change", !1);
2471
- for (let e of ce) e();
2472
- }), (t, n) => (T(), c(r, null, [
2474
+ for (let e of Z) e();
2475
+ }), (t, n) => (E(), c(r, null, [
2473
2476
  l("div", {
2474
2477
  ref_key: "textMenu",
2475
2478
  ref: u,
2476
2479
  class: "vibe-naive-tiptap__bubble",
2477
2480
  onMousedown: n[0] ||= B(() => {}, ["prevent"])
2478
- }, [(T(!0), c(r, null, O(ae.value, (t) => (T(), c(r, { key: t.key }, [t.key === "color" || t.key === "highlight" ? (T(), o(Pn, {
2481
+ }, [(E(!0), c(r, null, k(ae.value, (t) => (E(), c(r, { key: t.key }, [t.key === "color" || t.key === "highlight" ? (E(), o(Fn, {
2479
2482
  key: 0,
2480
2483
  context: e.context,
2481
2484
  kind: t.key,
2482
2485
  icon: t.icon,
2483
2486
  colors: t.key === "color" ? e.palette.colors : e.palette.highlights,
2484
2487
  "overlay-target": e.overlayTarget,
2485
- show: w.value === t.key,
2488
+ show: S.value === t.key,
2486
2489
  bubble: "",
2487
- "onUpdate:show": (e) => oe(t.key, e)
2490
+ "onUpdate:show": (e) => Y(t.key, e)
2488
2491
  }, null, 8, [
2489
2492
  "context",
2490
2493
  "kind",
@@ -2493,15 +2496,15 @@ var Ln = ["aria-label"], Rn = {
2493
2496
  "overlay-target",
2494
2497
  "show",
2495
2498
  "onUpdate:show"
2496
- ])) : (T(), o(P(V), {
2499
+ ])) : (E(), o(F(V), {
2497
2500
  key: 1,
2498
2501
  text: "",
2499
2502
  "aria-label": e.context.t(`command.${t.key}`),
2500
- type: P(Te)(e.context, t.key) ? "primary" : "default",
2501
- disabled: !P(Ee)(e.context, t.key),
2502
- onClick: (e) => se(t.key)
2503
+ type: F(Te)(e.context, t.key) ? "primary" : "default",
2504
+ disabled: !F(Ee)(e.context, t.key),
2505
+ onClick: (e) => oe(t.key)
2503
2506
  }, {
2504
- default: R(() => [(T(), o(A(t.icon), { size: 16 }))]),
2507
+ default: z(() => [(E(), o(j(t.icon), { size: 16 }))]),
2505
2508
  _: 2
2506
2509
  }, 1032, [
2507
2510
  "aria-label",
@@ -2515,35 +2518,35 @@ var Ln = ["aria-label"], Rn = {
2515
2518
  class: "vibe-naive-tiptap__bubble vibe-naive-tiptap__link-bubble",
2516
2519
  onMousedown: n[1] ||= B(() => {}, ["prevent"])
2517
2520
  }, [
2518
- f(P(Y), v({
2521
+ f(F(X), y({
2519
2522
  to: e.overlayTarget,
2520
2523
  disabled: !m.value
2521
- }, P(Q)), {
2522
- trigger: R(() => [f(P(V), {
2524
+ }, F($)), {
2525
+ trigger: z(() => [f(F(V), {
2523
2526
  text: "",
2524
2527
  "aria-label": e.context.t("toolbar.link.edit"),
2525
- onClick: I
2528
+ onClick: P
2526
2529
  }, {
2527
- default: R(() => [f(P(nn), { size: 16 })]),
2530
+ default: z(() => [f(F(rn), { size: 16 })]),
2528
2531
  _: 1
2529
2532
  }, 8, ["aria-label"])]),
2530
- default: R(() => [d(" " + M(e.context.t("toolbar.link.edit")), 1)]),
2533
+ default: z(() => [d(" " + N(e.context.t("toolbar.link.edit")), 1)]),
2531
2534
  _: 1
2532
2535
  }, 16, ["to", "disabled"]),
2533
- f(P(Y), v({
2536
+ f(F(X), y({
2534
2537
  to: e.overlayTarget,
2535
2538
  disabled: !m.value
2536
- }, P(Q)), {
2537
- trigger: R(() => [f(P(V), {
2539
+ }, F($)), {
2540
+ trigger: z(() => [f(F(V), {
2538
2541
  text: "",
2539
- tag: N.value ? "a" : "button",
2540
- href: N.value,
2541
- target: j.value?.target || "_blank",
2542
+ tag: M.value ? "a" : "button",
2543
+ href: M.value,
2544
+ target: A.value?.target || "_blank",
2542
2545
  rel: "noopener noreferrer",
2543
- disabled: !N.value,
2546
+ disabled: !M.value,
2544
2547
  "aria-label": e.context.t("toolbar.link.open")
2545
2548
  }, {
2546
- default: R(() => [f(P(Ot), { size: 16 })]),
2549
+ default: z(() => [f(F(kt), { size: 16 })]),
2547
2550
  _: 1
2548
2551
  }, 8, [
2549
2552
  "tag",
@@ -2552,41 +2555,41 @@ var Ln = ["aria-label"], Rn = {
2552
2555
  "disabled",
2553
2556
  "aria-label"
2554
2557
  ])]),
2555
- default: R(() => [d(" " + M(e.context.t("toolbar.link.open")), 1)]),
2558
+ default: z(() => [d(" " + N(e.context.t("toolbar.link.open")), 1)]),
2556
2559
  _: 1
2557
2560
  }, 16, ["to", "disabled"]),
2558
- f(P(Y), v({
2561
+ f(F(X), y({
2559
2562
  to: e.overlayTarget,
2560
2563
  disabled: !m.value
2561
- }, P(Q)), {
2562
- trigger: R(() => [f(P(V), {
2564
+ }, F($)), {
2565
+ trigger: z(() => [f(F(V), {
2563
2566
  text: "",
2564
2567
  "aria-label": e.context.t("toolbar.link.copy"),
2565
2568
  onClick: L
2566
2569
  }, {
2567
- default: R(() => [f(P(St), { size: 16 })]),
2570
+ default: z(() => [f(F(Ct), { size: 16 })]),
2568
2571
  _: 1
2569
2572
  }, 8, ["aria-label"])]),
2570
- default: R(() => [d(" " + M(e.context.t("toolbar.link.copy")), 1)]),
2573
+ default: z(() => [d(" " + N(e.context.t("toolbar.link.copy")), 1)]),
2571
2574
  _: 1
2572
2575
  }, 16, ["to", "disabled"]),
2573
- f(P(Y), v({
2576
+ f(F(X), y({
2574
2577
  to: e.overlayTarget,
2575
2578
  disabled: !m.value
2576
- }, P(Q)), {
2577
- trigger: R(() => [f(P(V), {
2579
+ }, F($)), {
2580
+ trigger: z(() => [f(F(V), {
2578
2581
  text: "",
2579
2582
  "aria-label": e.context.t("toolbar.link.remove"),
2580
- onClick: H
2583
+ onClick: ee
2581
2584
  }, {
2582
- default: R(() => [f(P(En), { size: 16 })]),
2585
+ default: z(() => [f(F(Dn), { size: 16 })]),
2583
2586
  _: 1
2584
2587
  }, 8, ["aria-label"])]),
2585
- default: R(() => [d(" " + M(e.context.t("toolbar.link.remove")), 1)]),
2588
+ default: z(() => [d(" " + N(e.context.t("toolbar.link.remove")), 1)]),
2586
2589
  _: 1
2587
2590
  }, 16, ["to", "disabled"])
2588
2591
  ], 544),
2589
- f(Hn, {
2592
+ f(Un, {
2590
2593
  context: e.context,
2591
2594
  "can-upload": e.canUploadImage,
2592
2595
  "upload-asset": e.uploadAsset,
@@ -2600,10 +2603,10 @@ var Ln = ["aria-label"], Rn = {
2600
2603
  l("div", {
2601
2604
  ref_key: "videoMenu",
2602
2605
  ref: h,
2603
- class: y(["vibe-naive-tiptap__bubble vibe-naive-tiptap__video-bubble", { "vibe-naive-tiptap__audio-bubble": U.value?.kind === "audio" }]),
2606
+ class: b(["vibe-naive-tiptap__bubble vibe-naive-tiptap__video-bubble", { "vibe-naive-tiptap__audio-bubble": U.value?.kind === "audio" }]),
2604
2607
  onMousedown: n[4] ||= B(() => {}, ["prevent"])
2605
2608
  }, [
2606
- (T(!0), c(r, null, O(P(jn), (t) => (T(), o(P(V), {
2609
+ (E(!0), c(r, null, k(F(Mn), (t) => (E(), o(F(V), {
2607
2610
  key: t.key,
2608
2611
  text: "",
2609
2612
  title: e.context.t(`image.size.${t.key}Tooltip`),
@@ -2611,7 +2614,7 @@ var Ln = ["aria-label"], Rn = {
2611
2614
  type: U.value?.size === t.key ? "primary" : "default",
2612
2615
  onClick: (n) => e.context.commands.setMediaSize(t.key)
2613
2616
  }, {
2614
- default: R(() => [d(M(e.context.t(`image.size.${t.key}`)), 1)]),
2617
+ default: z(() => [d(N(e.context.t(`image.size.${t.key}`)), 1)]),
2615
2618
  _: 2
2616
2619
  }, 1032, [
2617
2620
  "title",
@@ -2623,19 +2626,19 @@ var Ln = ["aria-label"], Rn = {
2623
2626
  class: "vibe-naive-tiptap__bubble-divider",
2624
2627
  "aria-hidden": "true"
2625
2628
  }, null, -1),
2626
- (T(!0), c(r, null, O(P(Mn), (t) => (T(), o(P(Y), v({
2629
+ (E(!0), c(r, null, k(F(Nn), (t) => (E(), o(F(X), y({
2627
2630
  key: t.key,
2628
2631
  to: e.overlayTarget,
2629
2632
  disabled: !g.value
2630
- }, { ref_for: !0 }, P(Q)), {
2631
- trigger: R(() => [f(P(V), {
2633
+ }, { ref_for: !0 }, F($)), {
2634
+ trigger: z(() => [f(F(V), {
2632
2635
  text: "",
2633
2636
  "aria-label": e.context.t(`image.align.${t.key}`),
2634
2637
  "aria-pressed": U.value?.align === t.key,
2635
2638
  type: U.value?.align === t.key ? "primary" : "default",
2636
2639
  onClick: (n) => U.value?.kind === "audio" ? e.context.commands.setAudioAlign(t.key) : e.context.commands.setVideoAlign(t.key)
2637
2640
  }, {
2638
- default: R(() => [(T(), o(A(t.icon), { size: 16 }))]),
2641
+ default: z(() => [(E(), o(j(t.icon), { size: 16 }))]),
2639
2642
  _: 2
2640
2643
  }, 1032, [
2641
2644
  "aria-label",
@@ -2643,59 +2646,59 @@ var Ln = ["aria-label"], Rn = {
2643
2646
  "type",
2644
2647
  "onClick"
2645
2648
  ])]),
2646
- default: R(() => [d(" " + M(e.context.t(`image.align.${t.key}`)), 1)]),
2649
+ default: z(() => [d(" " + N(e.context.t(`image.align.${t.key}`)), 1)]),
2647
2650
  _: 2
2648
2651
  }, 1040, ["to", "disabled"]))), 128)),
2649
2652
  n[8] ||= l("span", {
2650
2653
  class: "vibe-naive-tiptap__bubble-divider",
2651
2654
  "aria-hidden": "true"
2652
2655
  }, null, -1),
2653
- U.value?.caption ? (T(), o(P(Y), v({
2656
+ U.value?.caption ? (E(), o(F(X), y({
2654
2657
  key: 0,
2655
2658
  to: e.overlayTarget,
2656
2659
  disabled: !g.value
2657
- }, P(Q)), {
2658
- trigger: R(() => [f(P(V), {
2660
+ }, F($)), {
2661
+ trigger: z(() => [f(F(V), {
2659
2662
  text: "",
2660
2663
  "aria-label": e.context.t("image.caption"),
2661
- onClick: W
2664
+ onClick: te
2662
2665
  }, {
2663
- default: R(() => [f(P(gt), { size: 16 })]),
2666
+ default: z(() => [f(F(_t), { size: 16 })]),
2664
2667
  _: 1
2665
2668
  }, 8, ["aria-label"])]),
2666
- default: R(() => [d(" " + M(e.context.t("image.caption")), 1)]),
2669
+ default: z(() => [d(" " + N(e.context.t("image.caption")), 1)]),
2667
2670
  _: 1
2668
2671
  }, 16, ["to", "disabled"])) : s("", !0),
2669
- U.value?.url ? (T(), c(r, { key: 1 }, [
2670
- f(P(Y), v({
2672
+ U.value?.url ? (E(), c(r, { key: 1 }, [
2673
+ f(F(X), y({
2671
2674
  to: e.overlayTarget,
2672
2675
  disabled: !g.value
2673
- }, P(Q)), {
2674
- trigger: R(() => [f(P(V), {
2676
+ }, F($)), {
2677
+ trigger: z(() => [f(F(V), {
2675
2678
  text: "",
2676
2679
  "aria-label": e.context.t("toolbar.link.copy"),
2677
- onClick: te
2680
+ onClick: W
2678
2681
  }, {
2679
- default: R(() => [f(P(St), { size: 16 })]),
2682
+ default: z(() => [f(F(Ct), { size: 16 })]),
2680
2683
  _: 1
2681
2684
  }, 8, ["aria-label"])]),
2682
- default: R(() => [d(" " + M(e.context.t("toolbar.link.copy")), 1)]),
2685
+ default: z(() => [d(" " + N(e.context.t("toolbar.link.copy")), 1)]),
2683
2686
  _: 1
2684
2687
  }, 16, ["to", "disabled"]),
2685
- U.value.canShowAsFile ? (T(), o(P(Y), v({
2688
+ U.value.canShowAsFile ? (E(), o(F(X), y({
2686
2689
  key: 0,
2687
2690
  to: e.overlayTarget,
2688
2691
  disabled: !g.value
2689
- }, P(Q)), {
2690
- trigger: R(() => [f(P(V), {
2692
+ }, F($)), {
2693
+ trigger: z(() => [f(F(V), {
2691
2694
  text: "",
2692
2695
  "aria-label": e.context.t("video.showAsFile"),
2693
2696
  onClick: n[2] ||= (t) => U.value.kind === "audio" ? e.context.commands.setAudioDisplay("file") : e.context.commands.setVideoDisplay("file")
2694
2697
  }, {
2695
- default: R(() => [f(P(en), { size: 16 })]),
2698
+ default: z(() => [f(F(tn), { size: 16 })]),
2696
2699
  _: 1
2697
2700
  }, 8, ["aria-label"])]),
2698
- default: R(() => [d(" " + M(e.context.t("video.showAsFile")), 1)]),
2701
+ default: z(() => [d(" " + N(e.context.t("video.showAsFile")), 1)]),
2699
2702
  _: 1
2700
2703
  }, 16, ["to", "disabled"])) : s("", !0),
2701
2704
  n[6] ||= l("span", {
@@ -2703,19 +2706,19 @@ var Ln = ["aria-label"], Rn = {
2703
2706
  "aria-hidden": "true"
2704
2707
  }, null, -1)
2705
2708
  ], 64)) : s("", !0),
2706
- f(P(Y), v({
2709
+ f(F(X), y({
2707
2710
  to: e.overlayTarget,
2708
2711
  disabled: !g.value
2709
- }, P(Q)), {
2710
- trigger: R(() => [f(P(V), {
2712
+ }, F($)), {
2713
+ trigger: z(() => [f(F(V), {
2711
2714
  text: "",
2712
2715
  "aria-label": e.context.t(U.value?.kind === "audio" ? "audio.delete" : "video.delete"),
2713
2716
  onClick: n[3] ||= (t) => U.value?.kind === "audio" ? e.context.commands.removeAudio() : e.context.commands.removeVideo()
2714
2717
  }, {
2715
- default: R(() => [f(P(Sn), { size: 16 })]),
2718
+ default: z(() => [f(F(Cn), { size: 16 })]),
2716
2719
  _: 1
2717
2720
  }, 8, ["aria-label"])]),
2718
- default: R(() => [d(" " + M(e.context.t(U.value?.kind === "audio" ? "audio.delete" : "video.delete")), 1)]),
2721
+ default: z(() => [d(" " + N(e.context.t(U.value?.kind === "audio" ? "audio.delete" : "video.delete")), 1)]),
2719
2722
  _: 1
2720
2723
  }, 16, ["to", "disabled"])
2721
2724
  ], 34),
@@ -2729,12 +2732,12 @@ var Ln = ["aria-label"], Rn = {
2729
2732
  class: "vibe-naive-tiptap__bubble vibe-naive-tiptap__file-bubble",
2730
2733
  onMousedown: n[5] ||= B(() => {}, ["prevent"])
2731
2734
  }, [
2732
- q.value ? (T(), o(P(Y), v({
2735
+ q.value ? (E(), o(F(X), y({
2733
2736
  key: 0,
2734
2737
  to: e.overlayTarget,
2735
- disabled: !b.value
2736
- }, P(Q)), {
2737
- trigger: R(() => [f(P(V), {
2738
+ disabled: !v.value
2739
+ }, F($)), {
2740
+ trigger: z(() => [f(F(V), {
2738
2741
  text: "",
2739
2742
  tag: "a",
2740
2743
  href: q.value.href,
@@ -2743,73 +2746,73 @@ var Ln = ["aria-label"], Rn = {
2743
2746
  rel: "noopener noreferrer",
2744
2747
  "aria-label": q.value.label
2745
2748
  }, {
2746
- default: R(() => [(T(), o(A(q.value.icon), { size: 16 }))]),
2749
+ default: z(() => [(E(), o(j(q.value.icon), { size: 16 }))]),
2747
2750
  _: 1
2748
2751
  }, 8, [
2749
2752
  "href",
2750
2753
  "download",
2751
2754
  "aria-label"
2752
2755
  ])]),
2753
- default: R(() => [d(" " + M(q.value.label), 1)]),
2756
+ default: z(() => [d(" " + N(q.value.label), 1)]),
2754
2757
  _: 1
2755
2758
  }, 16, ["to", "disabled"])) : s("", !0),
2756
- f(P(Y), v({
2759
+ f(F(X), y({
2757
2760
  to: e.overlayTarget,
2758
- disabled: !b.value
2759
- }, P(Q)), {
2760
- trigger: R(() => [f(P(V), {
2761
+ disabled: !v.value
2762
+ }, F($)), {
2763
+ trigger: z(() => [f(F(V), {
2761
2764
  text: "",
2762
2765
  disabled: !K.value,
2763
2766
  "aria-label": e.context.t("file.action.copy"),
2764
- onClick: re
2767
+ onClick: J
2765
2768
  }, {
2766
- default: R(() => [f(P(St), { size: 16 })]),
2769
+ default: z(() => [f(F(Ct), { size: 16 })]),
2767
2770
  _: 1
2768
2771
  }, 8, ["disabled", "aria-label"])]),
2769
- default: R(() => [d(" " + M(e.context.t("file.action.copy")), 1)]),
2772
+ default: z(() => [d(" " + N(e.context.t("file.action.copy")), 1)]),
2770
2773
  _: 1
2771
2774
  }, 16, ["to", "disabled"]),
2772
- J.value ? (T(), o(P(Y), v({
2775
+ re.value ? (E(), o(F(X), y({
2773
2776
  key: 1,
2774
2777
  to: e.overlayTarget,
2775
- disabled: !b.value
2776
- }, P(Q)), {
2777
- trigger: R(() => [f(P(V), {
2778
+ disabled: !v.value
2779
+ }, F($)), {
2780
+ trigger: z(() => [f(F(V), {
2778
2781
  text: "",
2779
- "aria-label": J.value.label,
2780
- onClick: J.value.run
2782
+ "aria-label": re.value.label,
2783
+ onClick: re.value.run
2781
2784
  }, {
2782
- default: R(() => [(T(), o(A(J.value.icon), { size: 16 }))]),
2785
+ default: z(() => [(E(), o(j(re.value.icon), { size: 16 }))]),
2783
2786
  _: 1
2784
2787
  }, 8, ["aria-label", "onClick"])]),
2785
- default: R(() => [d(" " + M(J.value.label), 1)]),
2788
+ default: z(() => [d(" " + N(re.value.label), 1)]),
2786
2789
  _: 1
2787
2790
  }, 16, ["to", "disabled"])) : s("", !0),
2788
- f(P(Y), v({
2791
+ f(F(X), y({
2789
2792
  to: e.overlayTarget,
2790
- disabled: !b.value
2791
- }, P(Q)), {
2792
- trigger: R(() => [f(P(V), {
2793
+ disabled: !v.value
2794
+ }, F($)), {
2795
+ trigger: z(() => [f(F(V), {
2793
2796
  text: "",
2794
2797
  "aria-label": e.context.t("file.action.delete"),
2795
2798
  onClick: ie
2796
2799
  }, {
2797
- default: R(() => [f(P(Sn), { size: 16 })]),
2800
+ default: z(() => [f(F(Cn), { size: 16 })]),
2798
2801
  _: 1
2799
2802
  }, 8, ["aria-label"])]),
2800
- default: R(() => [d(" " + M(e.context.t("file.action.delete")), 1)]),
2803
+ default: z(() => [d(" " + N(e.context.t("file.action.delete")), 1)]),
2801
2804
  _: 1
2802
2805
  }, 16, ["to", "disabled"])
2803
2806
  ], 544)], 512)
2804
2807
  ], 64));
2805
2808
  }
2806
- }), Jn = ["aria-label"], Yn = { class: "vibe-naive-tiptap__find-row" }, Xn = {
2809
+ }), Yn = ["aria-label"], Xn = { class: "vibe-naive-tiptap__find-row" }, Zn = {
2807
2810
  class: "vibe-naive-tiptap__find-count",
2808
2811
  role: "status"
2809
- }, Zn = {
2812
+ }, Qn = {
2810
2813
  key: 0,
2811
2814
  class: "vibe-naive-tiptap__find-row"
2812
- }, Qn = 16, $n = /* @__PURE__ */ p({
2815
+ }, $n = 16, er = /* @__PURE__ */ p({
2813
2816
  __name: "naive-tiptap-find-replace",
2814
2817
  props: {
2815
2818
  context: {},
@@ -2817,17 +2820,17 @@ var Ln = ["aria-label"], Rn = {
2817
2820
  overlayTarget: {}
2818
2821
  },
2819
2822
  setup(e, { expose: t }) {
2820
- let n = e, r = a(() => n.context.findReplaceState.value), i = D(), o = a(() => r.value.matches.length > 0), u = a(() => n.context.t("findReplace.count", {
2823
+ let n = e, r = a(() => n.context.findReplaceState.value), i = O(), o = a(() => r.value.matches.length > 0), u = a(() => n.context.t("findReplace.count", {
2821
2824
  current: o.value ? r.value.activeIndex + 1 : 0,
2822
2825
  total: r.value.matches.length
2823
- })), p, m = D(0);
2824
- I((e) => {
2826
+ })), p, m = O(0);
2827
+ L((e) => {
2825
2828
  let { editor: t } = n.context;
2826
2829
  t.on("transaction", r), e(() => t.off("transaction", r));
2827
2830
  function r({ transaction: e }) {
2828
2831
  we(e) && (m.value += 1);
2829
2832
  }
2830
- }), F([() => r.value.open, m], ([e], [t]) => {
2833
+ }), I([() => r.value.open, m], ([e], [t]) => {
2831
2834
  if (e) {
2832
2835
  if (!t) {
2833
2836
  let e = n.context.editor.view.dom.ownerDocument.activeElement;
@@ -2848,7 +2851,7 @@ var Ln = ["aria-label"], Rn = {
2848
2851
  let { commands: r } = n.context;
2849
2852
  e ? r.findReplacePrevious() : r.findReplaceNext(), t.target instanceof HTMLInputElement ? t.target.focus({ preventScroll: !0 }) : t.currentTarget instanceof HTMLElement && t.currentTarget.focus({ preventScroll: !0 });
2850
2853
  }
2851
- function y(e) {
2854
+ function v(e) {
2852
2855
  !e.isComposing && e.key === "Enter" && e.target instanceof HTMLInputElement && (e.preventDefault(), _(e.shiftKey, e));
2853
2856
  }
2854
2857
  function b(e) {
@@ -2857,14 +2860,14 @@ var Ln = ["aria-label"], Rn = {
2857
2860
  function x(e) {
2858
2861
  e.isComposing || e.key !== "Escape" || (e.preventDefault(), e.stopPropagation(), g());
2859
2862
  }
2860
- return (t, n) => r.value.open ? (T(), c("div", {
2863
+ return (t, n) => r.value.open ? (E(), c("div", {
2861
2864
  key: 0,
2862
2865
  class: "vibe-naive-tiptap__find",
2863
2866
  role: "search",
2864
2867
  "aria-label": e.context.t("command.findReplace"),
2865
2868
  onKeydown: x
2866
- }, [l("div", Yn, [
2867
- f(P(G), {
2869
+ }, [l("div", Xn, [
2870
+ f(F(G), {
2868
2871
  ref_key: "queryInput",
2869
2872
  ref: i,
2870
2873
  class: "vibe-naive-tiptap__find-input",
@@ -2873,15 +2876,15 @@ var Ln = ["aria-label"], Rn = {
2873
2876
  placeholder: e.context.t("findReplace.query"),
2874
2877
  "input-props": { "aria-label": e.context.t("findReplace.query") },
2875
2878
  "onUpdate:value": e.context.commands.setFindReplaceQuery,
2876
- onKeydown: y
2879
+ onKeydown: v
2877
2880
  }, {
2878
- prefix: R(() => [f(P(W), {
2879
- component: P(dn),
2880
- size: Qn,
2881
+ prefix: z(() => [f(F(W), {
2882
+ component: F(fn),
2883
+ size: $n,
2881
2884
  "aria-hidden": "true"
2882
2885
  }, null, 8, ["component"])]),
2883
- suffix: R(() => [f(P(Y), v({ to: e.overlayTarget }, P(Q)), {
2884
- trigger: R(() => [f(P(V), {
2886
+ suffix: z(() => [f(F(X), y({ to: e.overlayTarget }, F($)), {
2887
+ trigger: z(() => [f(F(V), {
2885
2888
  size: "tiny",
2886
2889
  quaternary: !r.value.caseSensitive,
2887
2890
  secondary: r.value.caseSensitive,
@@ -2890,7 +2893,7 @@ var Ln = ["aria-label"], Rn = {
2890
2893
  "aria-pressed": r.value.caseSensitive,
2891
2894
  onClick: n[0] ||= (t) => e.context.commands.setFindReplaceCaseSensitive(!r.value.caseSensitive)
2892
2895
  }, {
2893
- icon: R(() => [f(P(W), { component: P(_t) }, null, 8, ["component"])]),
2896
+ icon: z(() => [f(F(W), { component: F(vt) }, null, 8, ["component"])]),
2894
2897
  _: 1
2895
2898
  }, 8, [
2896
2899
  "quaternary",
@@ -2899,7 +2902,7 @@ var Ln = ["aria-label"], Rn = {
2899
2902
  "aria-label",
2900
2903
  "aria-pressed"
2901
2904
  ])]),
2902
- default: R(() => [d(" " + M(e.context.t("findReplace.caseSensitive")), 1)]),
2905
+ default: z(() => [d(" " + N(e.context.t("findReplace.caseSensitive")), 1)]),
2903
2906
  _: 1
2904
2907
  }, 16, ["to"])]),
2905
2908
  _: 1
@@ -2909,12 +2912,12 @@ var Ln = ["aria-label"], Rn = {
2909
2912
  "input-props",
2910
2913
  "onUpdate:value"
2911
2914
  ]),
2912
- l("span", Xn, M(u.value), 1),
2913
- f(P(Y), v({
2915
+ l("span", Zn, N(u.value), 1),
2916
+ f(F(X), y({
2914
2917
  to: e.overlayTarget,
2915
2918
  placement: "top"
2916
- }, P(Q)), {
2917
- trigger: R(() => [f(P(V), {
2919
+ }, F($)), {
2920
+ trigger: z(() => [f(F(V), {
2918
2921
  circle: "",
2919
2922
  quaternary: "",
2920
2923
  size: "small",
@@ -2922,20 +2925,20 @@ var Ln = ["aria-label"], Rn = {
2922
2925
  disabled: !o.value,
2923
2926
  onClick: n[1] ||= (e) => _(!0, e)
2924
2927
  }, {
2925
- icon: R(() => [f(P(W), {
2926
- component: P(yt),
2927
- size: Qn
2928
+ icon: z(() => [f(F(W), {
2929
+ component: F(bt),
2930
+ size: $n
2928
2931
  }, null, 8, ["component"])]),
2929
2932
  _: 1
2930
2933
  }, 8, ["aria-label", "disabled"])]),
2931
- default: R(() => [d(" " + M(e.context.t("findReplace.previous")), 1)]),
2934
+ default: z(() => [d(" " + N(e.context.t("findReplace.previous")), 1)]),
2932
2935
  _: 1
2933
2936
  }, 16, ["to"]),
2934
- f(P(Y), v({
2937
+ f(F(X), y({
2935
2938
  to: e.overlayTarget,
2936
2939
  placement: "top"
2937
- }, P(Q)), {
2938
- trigger: R(() => [f(P(V), {
2940
+ }, F($)), {
2941
+ trigger: z(() => [f(F(V), {
2939
2942
  circle: "",
2940
2943
  quaternary: "",
2941
2944
  size: "small",
@@ -2943,34 +2946,34 @@ var Ln = ["aria-label"], Rn = {
2943
2946
  disabled: !o.value,
2944
2947
  onClick: n[2] ||= (e) => _(!1, e)
2945
2948
  }, {
2946
- icon: R(() => [f(P(W), {
2947
- component: P(vt),
2948
- size: Qn
2949
+ icon: z(() => [f(F(W), {
2950
+ component: F(yt),
2951
+ size: $n
2949
2952
  }, null, 8, ["component"])]),
2950
2953
  _: 1
2951
2954
  }, 8, ["aria-label", "disabled"])]),
2952
- default: R(() => [d(" " + M(e.context.t("findReplace.next")), 1)]),
2955
+ default: z(() => [d(" " + N(e.context.t("findReplace.next")), 1)]),
2953
2956
  _: 1
2954
2957
  }, 16, ["to"]),
2955
- f(P(Y), v({ to: e.overlayTarget }, P(Q)), {
2956
- trigger: R(() => [f(P(V), {
2958
+ f(F(X), y({ to: e.overlayTarget }, F($)), {
2959
+ trigger: z(() => [f(F(V), {
2957
2960
  circle: "",
2958
2961
  quaternary: "",
2959
2962
  size: "small",
2960
2963
  "aria-label": e.context.t("findReplace.close"),
2961
2964
  onClick: g
2962
2965
  }, {
2963
- icon: R(() => [f(P(W), {
2964
- component: P(kn),
2965
- size: Qn
2966
+ icon: z(() => [f(F(W), {
2967
+ component: F(An),
2968
+ size: $n
2966
2969
  }, null, 8, ["component"])]),
2967
2970
  _: 1
2968
2971
  }, 8, ["aria-label"])]),
2969
- default: R(() => [d(" " + M(e.context.t("findReplace.close")), 1)]),
2972
+ default: z(() => [d(" " + N(e.context.t("findReplace.close")), 1)]),
2970
2973
  _: 1
2971
2974
  }, 16, ["to"])
2972
- ]), e.editable ? (T(), c("div", Zn, [
2973
- f(P(G), {
2975
+ ]), e.editable ? (E(), c("div", Qn, [
2976
+ f(F(G), {
2974
2977
  class: "vibe-naive-tiptap__find-input vibe-naive-tiptap__find-input--replacement",
2975
2978
  size: "small",
2976
2979
  value: r.value.replacement,
@@ -2979,8 +2982,8 @@ var Ln = ["aria-label"], Rn = {
2979
2982
  "onUpdate:value": e.context.commands.setFindReplaceReplacement,
2980
2983
  onKeydown: b
2981
2984
  }, {
2982
- prefix: R(() => [f(P(W), {
2983
- component: P(xn),
2985
+ prefix: z(() => [f(F(W), {
2986
+ component: F(Sn),
2984
2987
  "aria-hidden": "true"
2985
2988
  }, null, 8, ["component"])]),
2986
2989
  _: 1
@@ -2990,11 +2993,11 @@ var Ln = ["aria-label"], Rn = {
2990
2993
  "input-props",
2991
2994
  "onUpdate:value"
2992
2995
  ]),
2993
- f(P(Y), v({
2996
+ f(F(X), y({
2994
2997
  to: e.overlayTarget,
2995
2998
  placement: "top"
2996
- }, P(Q)), {
2997
- trigger: R(() => [f(P(V), {
2999
+ }, F($)), {
3000
+ trigger: z(() => [f(F(V), {
2998
3001
  circle: "",
2999
3002
  quaternary: "",
3000
3003
  size: "small",
@@ -3002,20 +3005,20 @@ var Ln = ["aria-label"], Rn = {
3002
3005
  disabled: !o.value,
3003
3006
  onClick: n[3] ||= (t) => e.context.commands.replaceFindReplaceCurrent()
3004
3007
  }, {
3005
- icon: R(() => [f(P(W), {
3006
- component: P(un),
3007
- size: Qn
3008
+ icon: z(() => [f(F(W), {
3009
+ component: F(dn),
3010
+ size: $n
3008
3011
  }, null, 8, ["component"])]),
3009
3012
  _: 1
3010
3013
  }, 8, ["aria-label", "disabled"])]),
3011
- default: R(() => [d(" " + M(e.context.t("findReplace.replace")), 1)]),
3014
+ default: z(() => [d(" " + N(e.context.t("findReplace.replace")), 1)]),
3012
3015
  _: 1
3013
3016
  }, 16, ["to"]),
3014
- f(P(Y), v({
3017
+ f(F(X), y({
3015
3018
  to: e.overlayTarget,
3016
3019
  placement: "top"
3017
- }, P(Q)), {
3018
- trigger: R(() => [f(P(V), {
3020
+ }, F($)), {
3021
+ trigger: z(() => [f(F(V), {
3019
3022
  circle: "",
3020
3023
  quaternary: "",
3021
3024
  size: "small",
@@ -3023,31 +3026,31 @@ var Ln = ["aria-label"], Rn = {
3023
3026
  disabled: !o.value,
3024
3027
  onClick: n[4] ||= (t) => e.context.commands.replaceFindReplaceAll()
3025
3028
  }, {
3026
- icon: R(() => [f(P(W), {
3027
- component: P(ln),
3028
- size: Qn
3029
+ icon: z(() => [f(F(W), {
3030
+ component: F(un),
3031
+ size: $n
3029
3032
  }, null, 8, ["component"])]),
3030
3033
  _: 1
3031
3034
  }, 8, ["aria-label", "disabled"])]),
3032
- default: R(() => [d(" " + M(e.context.t("findReplace.replaceAll")), 1)]),
3035
+ default: z(() => [d(" " + N(e.context.t("findReplace.replaceAll")), 1)]),
3033
3036
  _: 1
3034
3037
  }, 16, ["to"])
3035
- ])) : s("", !0)], 40, Jn)) : s("", !0);
3038
+ ])) : s("", !0)], 40, Yn)) : s("", !0);
3036
3039
  }
3037
- }), er = Symbol("popover group");
3038
- function tr() {
3039
- let e = g(er, () => j(), !0), t = Symbol(), n = a({
3040
+ }), tr = Symbol("popover group");
3041
+ function nr() {
3042
+ let e = _(tr, () => M(), !0), t = Symbol(), n = a({
3040
3043
  get: () => e.value === t,
3041
3044
  set: (n) => {
3042
3045
  n ? e.value = t : e.value === t && (e.value = void 0);
3043
3046
  }
3044
3047
  });
3045
- return w(() => {
3048
+ return T(() => {
3046
3049
  n.value = !1;
3047
3050
  }), n;
3048
3051
  }
3049
3052
  // src/naive-tiptap-link-popover.vue?vue&type=script&setup=true&lang.ts
3050
- var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-fields" }, ir = { class: "vibe-naive-tiptap__popover-actions" }, ar = /* @__PURE__ */ p({
3053
+ var rr = ["aria-label", "onKeydown"], ir = { class: "vibe-naive-tiptap__popover-fields" }, ar = { class: "vibe-naive-tiptap__popover-actions" }, or = /* @__PURE__ */ p({
3051
3054
  __name: "naive-tiptap-link-popover",
3052
3055
  props: {
3053
3056
  context: {},
@@ -3056,13 +3059,13 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3056
3059
  overlayTarget: {}
3057
3060
  },
3058
3061
  setup(e, { expose: t }) {
3059
- let n = e, r = tr(), i = D({
3062
+ let n = e, r = nr(), i = O({
3060
3063
  x: 0,
3061
3064
  y: 0
3062
- }), c = D(), p = D(""), m = D(""), h = D(!0), g = D({
3065
+ }), c = O(), p = O(""), m = O(""), h = O(!0), g = O({
3063
3066
  from: 0,
3064
3067
  to: 0
3065
- }), _ = D(!1), v = D(!1), y = a(() => n.context.t(v.value ? "command.link" : "toolbar.link.popoverLabel")), b;
3068
+ }), _ = O(!1), v = O(!1), y = a(() => n.context.t(v.value ? "command.link" : "toolbar.link.popoverLabel")), b;
3066
3069
  function x(e, t) {
3067
3070
  let { editor: a } = n.context;
3068
3071
  if (!n.editable || !a.schema.marks.link) return;
@@ -3096,14 +3099,14 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3096
3099
  range: g.value
3097
3100
  }), S()) : e.notify(e.t(p.value.trim() ? "notify.linkInvalid" : "notify.linkEmpty"), "warning");
3098
3101
  }
3099
- function E() {
3102
+ function T() {
3100
3103
  if (!r.value || !n.editable || !_.value) return;
3101
3104
  let { context: e } = n;
3102
3105
  e.commands.setLink("", { range: g.value }), e.notify(e.t("notify.linkRemoved"), "success"), S();
3103
3106
  }
3104
- return F(() => n.editable, (e) => {
3107
+ return I(() => n.editable, (e) => {
3105
3108
  e || S();
3106
- }), F([() => n.context, () => n.context.documentRevision.value], S, { flush: "sync" }), F([r, c], ([e, t], n, r) => {
3109
+ }), I([() => n.context, () => n.context.documentRevision.value], S, { flush: "sync" }), I([r, c], ([e, t], n, r) => {
3107
3110
  let i = t?.ownerDocument.defaultView;
3108
3111
  if (!e || !t || !i) return;
3109
3112
  let a = i.requestAnimationFrame(() => {
@@ -3113,9 +3116,9 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3113
3116
  }, { flush: "post" }), t({
3114
3117
  open: x,
3115
3118
  visible: r
3116
- }), (t, n) => (T(), o(P(q), {
3119
+ }), (t, n) => (E(), o(F(J), {
3117
3120
  to: e.overlayTarget,
3118
- show: P(r),
3121
+ show: F(r),
3119
3122
  x: t.$slots.trigger ? void 0 : i.value.x,
3120
3123
  y: t.$slots.trigger ? void 0 : i.value.y,
3121
3124
  "show-arrow": !1,
@@ -3124,44 +3127,44 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3124
3127
  raw: "",
3125
3128
  onClickoutside: S
3126
3129
  }, u({
3127
- default: R(() => [l("div", {
3130
+ default: z(() => [l("div", {
3128
3131
  role: "dialog",
3129
3132
  "aria-label": y.value,
3130
- onKeydown: z(B(C, ["stop", "prevent"]), ["esc"])
3131
- }, [f(P(H), {
3133
+ onKeydown: ee(B(C, ["stop", "prevent"]), ["esc"])
3134
+ }, [f(F(H), {
3132
3135
  class: "vibe-naive-tiptap__popover",
3133
3136
  size: "small"
3134
3137
  }, {
3135
- footer: R(() => [l("div", ir, [
3136
- _.value ? (T(), o(P(V), {
3138
+ footer: z(() => [l("div", ar, [
3139
+ _.value ? (E(), o(F(V), {
3137
3140
  key: 0,
3138
3141
  type: "error",
3139
3142
  secondary: "",
3140
3143
  size: "small",
3141
- onClick: E
3144
+ onClick: T
3142
3145
  }, {
3143
- default: R(() => [d(M(e.context.t("toolbar.link.remove")), 1)]),
3146
+ default: z(() => [d(N(e.context.t("toolbar.link.remove")), 1)]),
3144
3147
  _: 1
3145
3148
  })) : s("", !0),
3146
3149
  n[3] ||= l("span", { class: "vibe-naive-tiptap__popover-spacer" }, null, -1),
3147
- f(P(V), {
3150
+ f(F(V), {
3148
3151
  size: "small",
3149
3152
  onClick: C
3150
3153
  }, {
3151
- default: R(() => [d(M(e.context.t("toolbar.action.cancel")), 1)]),
3154
+ default: z(() => [d(N(e.context.t("toolbar.action.cancel")), 1)]),
3152
3155
  _: 1
3153
3156
  }),
3154
- f(P(V), {
3157
+ f(F(V), {
3155
3158
  type: "primary",
3156
3159
  size: "small",
3157
3160
  onClick: w
3158
3161
  }, {
3159
- default: R(() => [d(M(e.context.t("toolbar.action.confirm")), 1)]),
3162
+ default: z(() => [d(N(e.context.t("toolbar.action.confirm")), 1)]),
3160
3163
  _: 1
3161
3164
  })
3162
3165
  ])]),
3163
- default: R(() => [l("div", rr, [
3164
- l("label", null, [l("span", null, M(e.context.t("toolbar.link.textLabel")), 1), f(P(G), {
3166
+ default: z(() => [l("div", ir, [
3167
+ l("label", null, [l("span", null, N(e.context.t("toolbar.link.textLabel")), 1), f(F(G), {
3165
3168
  value: m.value,
3166
3169
  "onUpdate:value": n[0] ||= (e) => m.value = e,
3167
3170
  placeholder: e.context.t("toolbar.link.textPlaceholder"),
@@ -3170,27 +3173,27 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3170
3173
  l("label", {
3171
3174
  ref_key: "hrefField",
3172
3175
  ref: c
3173
- }, [l("span", null, M(e.context.t("toolbar.link.hrefLabel")), 1), f(P(G), {
3176
+ }, [l("span", null, N(e.context.t("toolbar.link.hrefLabel")), 1), f(F(G), {
3174
3177
  value: p.value,
3175
3178
  "onUpdate:value": n[1] ||= (e) => p.value = e,
3176
3179
  placeholder: "https://example.com",
3177
3180
  size: "small",
3178
- onKeyup: z(w, ["enter"])
3181
+ onKeyup: ee(w, ["enter"])
3179
3182
  }, null, 8, ["value"])], 512),
3180
- f(P(ee), {
3183
+ f(F(U), {
3181
3184
  checked: h.value,
3182
3185
  "onUpdate:checked": n[2] ||= (e) => h.value = e
3183
3186
  }, {
3184
- default: R(() => [d(M(e.context.t("toolbar.link.openInNewWindow")), 1)]),
3187
+ default: z(() => [d(N(e.context.t("toolbar.link.openInNewWindow")), 1)]),
3185
3188
  _: 1
3186
3189
  }, 8, ["checked"])
3187
3190
  ])]),
3188
3191
  _: 1
3189
- })], 40, nr)]),
3192
+ })], 40, rr)]),
3190
3193
  _: 2
3191
3194
  }, [t.$slots.trigger ? {
3192
3195
  name: "trigger",
3193
- fn: R(() => [k(t.$slots, "trigger", { open: x })]),
3196
+ fn: z(() => [A(t.$slots, "trigger", { open: x })]),
3194
3197
  key: "0"
3195
3198
  } : void 0]), 1032, [
3196
3199
  "to",
@@ -3200,7 +3203,7 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3200
3203
  "placement"
3201
3204
  ]));
3202
3205
  }
3203
- }), or = ["aria-label", "onKeydown"], sr = { class: "vibe-naive-tiptap__popover-actions" }, cr = /* @__PURE__ */ p({
3206
+ }), sr = ["aria-label", "onKeydown"], cr = { class: "vibe-naive-tiptap__popover-actions" }, lr = /* @__PURE__ */ p({
3204
3207
  __name: "naive-tiptap-media-popover",
3205
3208
  props: {
3206
3209
  context: {},
@@ -3217,10 +3220,10 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3217
3220
  }), c = a(() => {
3218
3221
  let e = be(n.kind === "attachment" ? "file" : n.kind);
3219
3222
  return !!n.context.editor.schema.nodes[e];
3220
- }), p = a(() => c.value && n.canUpload), m = a(() => c.value && (n.kind !== "image" || r.value.image.allowUrl)), h = tr(), g = D({
3223
+ }), p = a(() => c.value && n.canUpload), m = a(() => c.value && (n.kind !== "image" || r.value.image.allowUrl)), h = nr(), g = O({
3221
3224
  x: 0,
3222
3225
  y: 0
3223
- }), _ = D(), v = D("upload"), y = D(""), b, x = [], S;
3226
+ }), _ = O(), v = O("upload"), y = O(""), b, x = [], S;
3224
3227
  function C({ file: e }) {
3225
3228
  if (!h.value || !n.editable || !p.value || !e.file) return !1;
3226
3229
  let t = b;
@@ -3242,7 +3245,7 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3242
3245
  });
3243
3246
  }
3244
3247
  }
3245
- function E(e, t = p.value ? "upload" : "url") {
3248
+ function w(e, t = p.value ? "upload" : "url") {
3246
3249
  if (!n.editable || !(t === "upload" ? p.value : m.value)) return;
3247
3250
  let { editor: r } = n.context;
3248
3251
  if (r.isDestroyed) return;
@@ -3254,13 +3257,13 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3254
3257
  y: t
3255
3258
  };
3256
3259
  }
3257
- S = e ?? a.dom, N(), b = Fe(r, O), v.value = t, y.value = "", h.value = !0;
3260
+ S = e ?? a.dom, M(), b = Ie(r, D), v.value = t, y.value = "", h.value = !0;
3258
3261
  }
3259
- function O() {
3262
+ function D() {
3260
3263
  h.value = !1;
3261
3264
  }
3262
- function A() {
3263
- O(), S?.focus({ preventScroll: !0 });
3265
+ function k() {
3266
+ D(), S?.focus({ preventScroll: !0 });
3264
3267
  }
3265
3268
  function j() {
3266
3269
  if (!b?.range || !h.value || !n.editable || !m.value || v.value !== "url") return;
@@ -3285,16 +3288,16 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3285
3288
  return i ? (t.editor.commands.setTextSelection(e), r(i), !0) : !1;
3286
3289
  }
3287
3290
  }
3288
- function N() {
3291
+ function M() {
3289
3292
  b?.dispose(), b = void 0, x = [];
3290
3293
  }
3291
- return F(h, (e) => {
3292
- e || N();
3293
- }, { flush: "sync" }), F(() => n.context, O, { flush: "sync" }), w(N), F(() => n.editable, (e) => {
3294
+ return I(h, (e) => {
3295
+ e || M();
3296
+ }, { flush: "sync" }), I(() => n.context, D, { flush: "sync" }), T(M), I(() => n.editable, (e) => {
3294
3297
  e || (h.value = !1);
3295
- }), F([p, m], ([e, t]) => {
3296
- !h.value || (v.value === "upload" ? e : t) || (e || t ? v.value = e ? "upload" : "url" : O());
3297
- }), F([h, _], ([e, t], n, r) => {
3298
+ }), I([p, m], ([e, t]) => {
3299
+ !h.value || (v.value === "upload" ? e : t) || (e || t ? v.value = e ? "upload" : "url" : D());
3300
+ }), I([h, _], ([e, t], n, r) => {
3298
3301
  let i = t?.ownerDocument.defaultView;
3299
3302
  if (!e || !t || !i) return;
3300
3303
  let a = i.requestAnimationFrame(() => {
@@ -3303,52 +3306,52 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3303
3306
  });
3304
3307
  r(() => i.cancelAnimationFrame(a));
3305
3308
  }, { flush: "post" }), t({
3306
- open: E,
3309
+ open: w,
3307
3310
  visible: h
3308
- }), (t, n) => (T(), o(P(q), {
3311
+ }), (t, n) => (E(), o(F(J), {
3309
3312
  to: e.overlayTarget,
3310
- show: P(h),
3313
+ show: F(h),
3311
3314
  x: t.$slots.trigger ? void 0 : g.value.x,
3312
3315
  y: t.$slots.trigger ? void 0 : g.value.y,
3313
3316
  "show-arrow": !1,
3314
3317
  trigger: "manual",
3315
3318
  placement: t.$slots.trigger ? "top" : "bottom-start",
3316
3319
  raw: "",
3317
- onClickoutside: O
3320
+ onClickoutside: D
3318
3321
  }, u({
3319
- default: R(() => [l("div", {
3322
+ default: z(() => [l("div", {
3320
3323
  ref_key: "panel",
3321
3324
  ref: _,
3322
3325
  role: "dialog",
3323
3326
  "aria-label": e.context.t(`toolbar.${e.kind}.${v.value}`),
3324
3327
  tabindex: "-1",
3325
- onKeydown: z(B(A, ["stop", "prevent"]), ["esc"])
3326
- }, [f(P(H), {
3328
+ onKeydown: ee(B(k, ["stop", "prevent"]), ["esc"])
3329
+ }, [f(F(H), {
3327
3330
  class: "vibe-naive-tiptap__popover vibe-naive-tiptap__media-popover",
3328
3331
  size: "small",
3329
- onClose: O
3332
+ onClose: D
3330
3333
  }, u({
3331
- footer: R(() => [l("div", sr, [
3334
+ footer: z(() => [l("div", cr, [
3332
3335
  n[2] ||= l("span", { class: "vibe-naive-tiptap__popover-spacer" }, null, -1),
3333
- f(P(V), {
3334
- onClick: O,
3336
+ f(F(V), {
3337
+ onClick: D,
3335
3338
  size: "small"
3336
3339
  }, {
3337
- default: R(() => [d(M(e.context.t("toolbar.action.cancel")), 1)]),
3340
+ default: z(() => [d(N(e.context.t("toolbar.action.cancel")), 1)]),
3338
3341
  _: 1
3339
3342
  }),
3340
- m.value && v.value === "url" ? (T(), o(P(V), {
3343
+ m.value && v.value === "url" ? (E(), o(F(V), {
3341
3344
  key: 0,
3342
3345
  type: "primary",
3343
3346
  disabled: !e.editable,
3344
3347
  size: "small",
3345
3348
  onClick: j
3346
3349
  }, {
3347
- default: R(() => [d(M(e.context.t("toolbar.action.confirm")), 1)]),
3350
+ default: z(() => [d(N(e.context.t("toolbar.action.confirm")), 1)]),
3348
3351
  _: 1
3349
3352
  }, 8, ["disabled"])) : s("", !0)
3350
3353
  ])]),
3351
- default: R(() => [p.value && v.value === "upload" ? (T(), o(P(oe), {
3354
+ default: z(() => [p.value && v.value === "upload" ? (E(), o(F(oe), {
3352
3355
  key: 0,
3353
3356
  accept: i.value.accept,
3354
3357
  multiple: i.value.multiple,
@@ -3357,13 +3360,13 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3357
3360
  "default-upload": !1,
3358
3361
  "on-before-upload": C
3359
3362
  }, {
3360
- default: R(() => [f(P(se), { style: { padding: "16px" } }, {
3361
- default: R(() => [l("div", null, [f(P(W), {
3362
- component: P(An)[e.kind],
3363
+ default: z(() => [f(F(Z), { style: { padding: "16px" } }, {
3364
+ default: z(() => [l("div", null, [f(F(W), {
3365
+ component: F(jn)[e.kind],
3363
3366
  size: 28,
3364
3367
  depth: 3
3365
- }, null, 8, ["component"])]), f(P(ae), { style: { "font-size": "16px" } }, {
3366
- default: R(() => [d(M(e.context.t(`toolbar.${e.kind}.dropHint`)), 1)]),
3368
+ }, null, 8, ["component"])]), f(F(Y), { style: { "font-size": "16px" } }, {
3369
+ default: z(() => [d(N(e.context.t(`toolbar.${e.kind}.dropHint`)), 1)]),
3367
3370
  _: 1
3368
3371
  })]),
3369
3372
  _: 1
@@ -3373,37 +3376,37 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3373
3376
  "accept",
3374
3377
  "multiple",
3375
3378
  "disabled"
3376
- ])) : m.value && v.value === "url" ? (T(), o(P(G), {
3379
+ ])) : m.value && v.value === "url" ? (E(), o(F(G), {
3377
3380
  key: 1,
3378
3381
  value: y.value,
3379
3382
  "onUpdate:value": n[1] ||= (e) => y.value = e,
3380
3383
  placeholder: e.context.t(`toolbar.${e.kind}.urlPlaceholder`),
3381
- onKeyup: z(j, ["enter"])
3384
+ onKeyup: ee(j, ["enter"])
3382
3385
  }, null, 8, ["value", "placeholder"])) : s("", !0)]),
3383
3386
  _: 2
3384
3387
  }, [p.value && m.value ? {
3385
3388
  name: "header",
3386
- fn: R(() => [f(P(ie), {
3389
+ fn: z(() => [f(F(ae), {
3387
3390
  value: v.value,
3388
3391
  "onUpdate:value": n[0] ||= (e) => v.value = e,
3389
3392
  size: "small",
3390
3393
  type: "segment"
3391
3394
  }, {
3392
- default: R(() => [f(P(J), {
3395
+ default: z(() => [f(F(ie), {
3393
3396
  name: "upload",
3394
3397
  tab: e.context.t(`toolbar.${e.kind}.upload`)
3395
- }, null, 8, ["tab"]), f(P(J), {
3398
+ }, null, 8, ["tab"]), f(F(ie), {
3396
3399
  name: "url",
3397
3400
  tab: e.context.t(`toolbar.${e.kind}.url`)
3398
3401
  }, null, 8, ["tab"])]),
3399
3402
  _: 1
3400
3403
  }, 8, ["value"])]),
3401
3404
  key: "0"
3402
- } : void 0]), 1024)], 40, or)]),
3405
+ } : void 0]), 1024)], 40, sr)]),
3403
3406
  _: 2
3404
3407
  }, [t.$slots.trigger ? {
3405
3408
  name: "trigger",
3406
- fn: R(() => [k(t.$slots, "trigger", { open: E })]),
3409
+ fn: z(() => [A(t.$slots, "trigger", { open: w })]),
3407
3410
  key: "0"
3408
3411
  } : void 0]), 1032, [
3409
3412
  "to",
@@ -3413,7 +3416,7 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3413
3416
  "placement"
3414
3417
  ]));
3415
3418
  }
3416
- }), lr = /* @__PURE__ */ p({
3419
+ }), ur = /* @__PURE__ */ p({
3417
3420
  __name: "naive-tiptap-media-popovers",
3418
3421
  props: {
3419
3422
  context: {},
@@ -3428,14 +3431,14 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3428
3431
  "video",
3429
3432
  "audio",
3430
3433
  "attachment"
3431
- ], i = D([]), o = a(() => i.value.some((e) => e.visible));
3434
+ ], i = O([]), o = a(() => i.value.some((e) => e.visible));
3432
3435
  function s(e, t, n) {
3433
3436
  i.value.find((t) => t.$props.kind === e)?.open(t, n);
3434
3437
  }
3435
3438
  return t({
3436
3439
  open: s,
3437
3440
  visible: o
3438
- }), (t, a) => (T(), c(r, null, O(n, (t) => f(cr, {
3441
+ }), (t, a) => (E(), c(r, null, k(n, (t) => f(lr, {
3439
3442
  key: t,
3440
3443
  ref_for: !0,
3441
3444
  ref_key: "popovers",
@@ -3455,16 +3458,16 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3455
3458
  "can-upload"
3456
3459
  ])), 64));
3457
3460
  }
3458
- }), ur = ["aria-label"], dr = [
3461
+ }), dr = ["aria-label"], fr = ["role", "aria-labelledby"], pr = ["id"], mr = [
3459
3462
  "id",
3460
3463
  "aria-label",
3461
3464
  "aria-selected",
3462
3465
  "onClick"
3463
- ], fr = ["src"], pr = {
3466
+ ], hr = ["src"], gr = {
3464
3467
  key: 1,
3465
3468
  class: "vibe-naive-tiptap__mention-status",
3466
3469
  role: "status"
3467
- }, mr = /* @__PURE__ */ p({
3470
+ }, _r = /* @__PURE__ */ p({
3468
3471
  __name: "naive-tiptap-mention-menu",
3469
3472
  props: {
3470
3473
  state: {},
@@ -3473,14 +3476,14 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3473
3476
  t: { type: Function }
3474
3477
  },
3475
3478
  setup(e) {
3476
- let t = e, n = `vibe-tiptap-mention-${t.state.editor.instanceId}`, u = D(), d = t.state.editor.view.dom, f = a(() => t.overlayTarget ?? d.ownerDocument.body);
3477
- return F([
3479
+ let t = e, n = `vibe-tiptap-mention-${t.state.editor.instanceId}`, u = O(), d = t.state.editor.view.dom, f = a(() => t.overlayTarget ?? d.ownerDocument.body);
3480
+ return I([
3478
3481
  u,
3479
3482
  f,
3480
3483
  () => t.state.mount
3481
3484
  ], ([e, , t], n, r) => {
3482
3485
  e && r(t(e));
3483
- }, { flush: "post" }), F([
3486
+ }, { flush: "post" }), I([
3484
3487
  u,
3485
3488
  () => t.state.items,
3486
3489
  () => t.state.selectedIndex
@@ -3492,37 +3495,45 @@ var nr = ["aria-label", "onKeydown"], rr = { class: "vibe-naive-tiptap__popover-
3492
3495
  d.setAttribute("aria-activedescendant", o), d.setAttribute("aria-controls", n), a(() => {
3493
3496
  c === null ? d.removeAttribute("aria-activedescendant") : d.setAttribute("aria-activedescendant", c), l === null ? d.removeAttribute("aria-controls") : d.setAttribute("aria-controls", l);
3494
3497
  }), s.offsetTop < e.scrollTop ? e.scrollTop = s.offsetTop : s.offsetTop + s.offsetHeight > e.scrollTop + e.clientHeight && (e.scrollTop = s.offsetTop + s.offsetHeight - e.clientHeight);
3495
- }, { flush: "post" }), (t, a) => (T(), o(i, { to: f.value }, [l("div", {
3498
+ }, { flush: "post" }), (t, a) => (E(), o(i, { to: f.value }, [l("div", {
3496
3499
  ref_key: "menu",
3497
3500
  ref: u,
3498
3501
  class: "vibe-naive-tiptap__mention-menu",
3499
- style: x(e.themeStyle),
3502
+ style: S(e.themeStyle),
3500
3503
  onMousedown: a[1] ||= B(() => {}, ["prevent"])
3501
- }, [e.state.items.length ? (T(), c("div", {
3504
+ }, [e.state.items.length ? (E(), c("div", {
3502
3505
  key: 0,
3503
3506
  id: n,
3504
3507
  role: "listbox",
3505
3508
  "aria-label": e.t("mention.label")
3506
- }, [(T(!0), c(r, null, O(e.state.items, (r, i) => (T(), c("button", {
3507
- id: `${n}-${i}`,
3509
+ }, [(E(!0), c(r, null, k(e.state.groups, ({ name: i, label: o, items: u, startIndex: d }) => (E(), c("div", {
3510
+ key: i === void 0 ? "ungrouped" : `group-${i}`,
3511
+ role: o ? "group" : "presentation",
3512
+ "aria-labelledby": o ? `${n}-group-${d}` : void 0
3513
+ }, [o ? (E(), c("div", {
3514
+ key: 0,
3515
+ id: `${n}-group-${d}`,
3516
+ class: "vibe-naive-tiptap__mention-group-label"
3517
+ }, N(o), 9, pr)) : s("", !0), (E(!0), c(r, null, k(u, (r, i) => (E(), c("button", {
3518
+ id: `${n}-${d + i}`,
3508
3519
  key: r.id,
3509
3520
  type: "button",
3510
3521
  role: "option",
3511
3522
  tabindex: "-1",
3512
3523
  "aria-label": r.label,
3513
- "aria-selected": i === e.state.selectedIndex,
3524
+ "aria-selected": d + i === e.state.selectedIndex,
3514
3525
  class: "vibe-naive-tiptap__mention-option",
3515
3526
  onMousedown: a[0] ||= B(() => {}, ["prevent"]),
3516
3527
  onClick: (t) => e.state.command(r)
3517
- }, [k(t.$slots, "mention-item", { item: r }, () => [r.avatar ? (T(), c("img", {
3528
+ }, [A(t.$slots, "mention-item", { item: r }, () => [r.avatar ? (E(), c("img", {
3518
3529
  key: 0,
3519
3530
  src: r.avatar,
3520
3531
  alt: "",
3521
3532
  class: "vibe-tiptap-mention-avatar"
3522
- }, null, 8, fr)) : s("", !0), l("span", null, M(r.label), 1)])], 40, dr))), 128))], 8, ur)) : (T(), c("div", pr, M(e.t(e.state.loading ? "mention.loading" : "mention.empty")), 1))], 36)], 8, ["to"]));
3533
+ }, null, 8, hr)) : s("", !0), l("span", null, N(r.label), 1)])], 40, mr))), 128))], 8, fr))), 128))], 8, dr)) : (E(), c("div", gr, N(e.t(e.state.loading ? "mention.loading" : "mention.empty")), 1))], 36)], 8, ["to"]));
3523
3534
  }
3524
- }), hr = 500, gr = 150;
3525
- function _r(e, n, r = hr) {
3535
+ }), vr = 500, yr = 150;
3536
+ function br(e, n, r = vr) {
3526
3537
  let i, a, o, s, c = () => clearTimeout(s);
3527
3538
  function l() {
3528
3539
  clearTimeout(o), o = void 0, a = void 0;
@@ -3531,7 +3542,7 @@ function _r(e, n, r = hr) {
3531
3542
  c(), l(), i && (i = void 0, n(void 0));
3532
3543
  }
3533
3544
  function d() {
3534
- c(), s = setTimeout(u, gr);
3545
+ c(), s = setTimeout(u, yr);
3535
3546
  }
3536
3547
  function f(s) {
3537
3548
  let d = t(e, s.target);
@@ -3562,7 +3573,7 @@ function _r(e, n, r = hr) {
3562
3573
  };
3563
3574
  }
3564
3575
  // src/naive-tiptap-mention-popover.vue
3565
- var vr = /* @__PURE__ */ p({
3576
+ var xr = /* @__PURE__ */ p({
3566
3577
  __name: "naive-tiptap-mention-popover",
3567
3578
  props: {
3568
3579
  editor: {},
@@ -3570,7 +3581,7 @@ var vr = /* @__PURE__ */ p({
3570
3581
  hoverDelay: {}
3571
3582
  },
3572
3583
  setup(e) {
3573
- let t = e, n = j(), r = j({
3584
+ let t = e, n = M(), r = M({
3574
3585
  x: 0,
3575
3586
  y: 0
3576
3587
  }), i;
@@ -3581,13 +3592,13 @@ var vr = /* @__PURE__ */ p({
3581
3592
  y: t.top
3582
3593
  };
3583
3594
  }
3584
- C(() => {
3585
- I((e) => {
3586
- let r = _r(t.editor, (e) => {
3595
+ w(() => {
3596
+ L((e) => {
3597
+ let r = br(t.editor, (e) => {
3587
3598
  e && a(e.element), n.value = e;
3588
3599
  }, t.hoverDelay);
3589
3600
  i = r, e(r.destroy);
3590
- }), I((e) => {
3601
+ }), L((e) => {
3591
3602
  let t = n.value?.element, r = t?.ownerDocument.defaultView;
3592
3603
  if (!t || !r) return;
3593
3604
  let i = () => a(t);
@@ -3599,7 +3610,7 @@ var vr = /* @__PURE__ */ p({
3599
3610
  function l(e) {
3600
3611
  xe(t.editor, e.target) || i?.close();
3601
3612
  }
3602
- return (t, a) => (T(), o(P(q), {
3613
+ return (t, a) => (E(), o(F(J), {
3603
3614
  to: e.overlayTarget,
3604
3615
  show: !!n.value,
3605
3616
  x: r.value.x,
@@ -3609,11 +3620,11 @@ var vr = /* @__PURE__ */ p({
3609
3620
  "show-arrow": !1,
3610
3621
  onClickoutside: l
3611
3622
  }, {
3612
- default: R(() => [n.value ? (T(), c("div", {
3623
+ default: z(() => [n.value ? (E(), c("div", {
3613
3624
  key: 0,
3614
- onMouseenter: a[0] ||= (e) => P(i)?.keepOpen(),
3615
- onMouseleave: a[1] ||= (e) => P(i)?.leave()
3616
- }, [k(t.$slots, "default", { target: n.value })], 32)) : s("", !0)]),
3625
+ onMouseenter: a[0] ||= (e) => F(i)?.keepOpen(),
3626
+ onMouseleave: a[1] ||= (e) => F(i)?.leave()
3627
+ }, [A(t.$slots, "default", { target: n.value })], 32)) : s("", !0)]),
3617
3628
  _: 3
3618
3629
  }, 8, [
3619
3630
  "to",
@@ -3622,21 +3633,21 @@ var vr = /* @__PURE__ */ p({
3622
3633
  "y"
3623
3634
  ]));
3624
3635
  }
3625
- }), yr = ["aria-label"], br = ["role", "aria-labelledby"], xr = ["id"], Sr = [
3636
+ }), Sr = ["aria-label"], Cr = ["role", "aria-labelledby"], wr = ["id"], Tr = [
3626
3637
  "id",
3627
3638
  "aria-label",
3628
3639
  "aria-describedby",
3629
3640
  "aria-selected",
3630
3641
  "disabled",
3631
3642
  "onClick"
3632
- ], Cr = {
3643
+ ], Er = {
3633
3644
  class: "vibe-naive-tiptap__slash-icon",
3634
3645
  "aria-hidden": "true"
3635
- }, wr = ["id"], Tr = {
3646
+ }, Dr = ["id"], Or = {
3636
3647
  key: 1,
3637
3648
  class: "vibe-naive-tiptap__slash-empty",
3638
3649
  role: "status"
3639
- }, Er = /* @__PURE__ */ p({
3650
+ }, kr = /* @__PURE__ */ p({
3640
3651
  __name: "naive-tiptap-slash-menu",
3641
3652
  props: {
3642
3653
  state: {},
@@ -3653,26 +3664,26 @@ var vr = /* @__PURE__ */ p({
3653
3664
  dividerDashed: "dashed",
3654
3665
  dividerDotted: "dotted"
3655
3666
  }, u = {
3656
- heading1: Pt,
3657
- heading: jt,
3658
- heading3: Nt,
3659
- heading4: Mt,
3660
- todo: Gt,
3661
- bulletList: Yt,
3662
- orderedList: Jt,
3663
- blockquote: sn,
3664
- table: gn,
3665
- image: zt,
3666
- imageUrl: Rt,
3667
- whiteboard: tn,
3668
- video: Dn,
3669
- videoUrl: Cn,
3670
- audio: wt,
3671
- audioUrl: wt,
3672
- upload: en,
3673
- link: Wt,
3674
- codeBlock: xt,
3675
- mermaid: On
3667
+ heading1: Ft,
3668
+ heading: Mt,
3669
+ heading3: Pt,
3670
+ heading4: Nt,
3671
+ todo: Kt,
3672
+ bulletList: Xt,
3673
+ orderedList: Yt,
3674
+ blockquote: cn,
3675
+ table: _n,
3676
+ image: Bt,
3677
+ imageUrl: zt,
3678
+ whiteboard: nn,
3679
+ video: On,
3680
+ videoUrl: wn,
3681
+ audio: Tt,
3682
+ audioUrl: Tt,
3683
+ upload: tn,
3684
+ link: Gt,
3685
+ codeBlock: St,
3686
+ mermaid: kn
3676
3687
  }, d = {
3677
3688
  heading1: "slashCommand.group.headings",
3678
3689
  heading: "slashCommand.group.headings",
@@ -3698,7 +3709,7 @@ var vr = /* @__PURE__ */ p({
3698
3709
  dividerThick: "slashCommand.group.dividers",
3699
3710
  dividerDashed: "slashCommand.group.dividers",
3700
3711
  dividerDotted: "slashCommand.group.dividers"
3701
- }, f = `vibe-tiptap-slash-${t.state.editor.instanceId}`, p = D(), m = t.state.editor.view.dom, h = a(() => t.overlayTarget ?? m.ownerDocument.body), g = a(() => t.state.items[t.state.selectedIndex]), _ = a(() => {
3712
+ }, f = `vibe-tiptap-slash-${t.state.editor.instanceId}`, p = O(), m = t.state.editor.view.dom, h = a(() => t.overlayTarget ?? m.ownerDocument.body), g = a(() => t.state.items[t.state.selectedIndex]), _ = a(() => {
3702
3713
  let { items: e, query: n } = t.state;
3703
3714
  if (Oe(n)) return [{
3704
3715
  label: void 0,
@@ -3714,14 +3725,14 @@ var vr = /* @__PURE__ */ p({
3714
3725
  }
3715
3726
  return r;
3716
3727
  });
3717
- return F([
3728
+ return I([
3718
3729
  p,
3719
3730
  h,
3720
3731
  () => t.state.text,
3721
3732
  () => t.state.range.from
3722
3733
  ], ([e], n, r) => {
3723
3734
  e && r(t.state.mount(e));
3724
- }, { flush: "post" }), F([
3735
+ }, { flush: "post" }), I([
3725
3736
  p,
3726
3737
  g,
3727
3738
  () => t.state.items
@@ -3733,27 +3744,27 @@ var vr = /* @__PURE__ */ p({
3733
3744
  m.setAttribute("aria-activedescendant", i), m.setAttribute("aria-controls", f), r(() => {
3734
3745
  o === null ? m.removeAttribute("aria-activedescendant") : m.setAttribute("aria-activedescendant", o), s === null ? m.removeAttribute("aria-controls") : m.setAttribute("aria-controls", s);
3735
3746
  }), a.offsetTop < e.scrollTop ? e.scrollTop = a.offsetTop : a.offsetTop + a.offsetHeight > e.scrollTop + e.clientHeight && (e.scrollTop = a.offsetTop + a.offsetHeight - e.clientHeight);
3736
- }, { flush: "post" }), (t, a) => (T(), o(i, { to: h.value }, [l("div", {
3747
+ }, { flush: "post" }), (t, a) => (E(), o(i, { to: h.value }, [l("div", {
3737
3748
  ref_key: "menu",
3738
3749
  ref: p,
3739
3750
  class: "vibe-naive-tiptap__slash-menu",
3740
- style: x(e.themeStyle),
3751
+ style: S(e.themeStyle),
3741
3752
  onMousedown: a[0] ||= B(() => {}, ["prevent"])
3742
- }, [e.state.items.length ? (T(), c("div", {
3753
+ }, [e.state.items.length ? (E(), c("div", {
3743
3754
  key: 0,
3744
3755
  id: f,
3745
3756
  role: "listbox",
3746
3757
  "aria-label": e.label
3747
- }, [(T(!0), c(r, null, O(_.value, (t) => (T(), c("div", {
3758
+ }, [(E(!0), c(r, null, k(_.value, (t) => (E(), c("div", {
3748
3759
  key: t.label ?? "results",
3749
3760
  role: t.label ? "group" : "presentation",
3750
3761
  "aria-labelledby": t.label ? `${f}-${t.label}` : void 0,
3751
- class: y({ "vibe-naive-tiptap__slash-group": t.label })
3752
- }, [t.label ? (T(), c("div", {
3762
+ class: b({ "vibe-naive-tiptap__slash-group": t.label })
3763
+ }, [t.label ? (E(), c("div", {
3753
3764
  key: 0,
3754
3765
  id: `${f}-${t.label}`,
3755
3766
  class: "vibe-naive-tiptap__slash-group-label"
3756
- }, M(e.translate(t.label)), 9, xr)) : s("", !0), (T(!0), c(r, null, O(t.items, (t) => (T(), c("button", {
3767
+ }, N(e.translate(t.label)), 9, wr)) : s("", !0), (E(!0), c(r, null, k(t.items, (t) => (E(), c("button", {
3757
3768
  id: `${f}-${t.id}`,
3758
3769
  key: t.id,
3759
3770
  type: "button",
@@ -3766,32 +3777,32 @@ var vr = /* @__PURE__ */ p({
3766
3777
  class: "vibe-naive-tiptap__slash-option",
3767
3778
  onClick: (n) => e.state.command(t)
3768
3779
  }, [
3769
- l("span", Cr, [n[t.id] ? (T(), c("span", {
3780
+ l("span", Er, [n[t.id] ? (E(), c("span", {
3770
3781
  key: 0,
3771
- class: y(["vibe-naive-tiptap__divider-icon", `vibe-naive-tiptap__divider-icon--${n[t.id]}`])
3772
- }, null, 2)) : (T(), o(A(u[t.id]), {
3782
+ class: b(["vibe-naive-tiptap__divider-icon", `vibe-naive-tiptap__divider-icon--${n[t.id]}`])
3783
+ }, null, 2)) : (E(), o(j(u[t.id]), {
3773
3784
  key: 1,
3774
3785
  size: 18
3775
3786
  }))]),
3776
- l("span", null, M(t.label), 1),
3777
- t.disabledReason || t.hint ? (T(), c("small", {
3787
+ l("span", null, N(t.label), 1),
3788
+ t.disabledReason || t.hint ? (E(), c("small", {
3778
3789
  key: 0,
3779
3790
  id: `${f}-${t.id}-description`,
3780
3791
  class: "vibe-naive-tiptap__slash-description"
3781
- }, M(t.disabledReason || t.hint), 9, wr)) : s("", !0)
3782
- ], 8, Sr))), 128))], 10, br))), 128))], 8, yr)) : e.state.loading ? s("", !0) : (T(), c("div", Tr, M(e.emptyLabel), 1))], 36)], 8, ["to"]));
3792
+ }, N(t.disabledReason || t.hint), 9, Dr)) : s("", !0)
3793
+ ], 8, Tr))), 128))], 10, Cr))), 128))], 8, Sr)) : e.state.loading ? s("", !0) : (E(), c("div", Or, N(e.emptyLabel), 1))], 36)], 8, ["to"]));
3783
3794
  }
3784
- }), Dr = {
3795
+ }), Ar = {
3785
3796
  class: "vibe-naive-tiptap__status",
3786
3797
  "aria-live": "polite"
3787
- }, Or = /* @__PURE__ */ p({
3798
+ }, jr = /* @__PURE__ */ p({
3788
3799
  __name: "naive-tiptap-status-bar",
3789
3800
  props: { context: {} },
3790
3801
  setup(e) {
3791
3802
  let t = e, n = a(() => t.context.wordCount.value.characters);
3792
- return (t, r) => (T(), c("div", Dr, M(e.context.t("wordCount.characters", { count: n.value })), 1));
3803
+ return (t, r) => (E(), c("div", Ar, N(e.context.t("wordCount.characters", { count: n.value })), 1));
3793
3804
  }
3794
- }), kr = /* @__PURE__ */ p({
3805
+ }), Mr = /* @__PURE__ */ p({
3795
3806
  __name: "naive-tiptap-table-grips",
3796
3807
  props: {
3797
3808
  context: {},
@@ -3801,51 +3812,51 @@ var vr = /* @__PURE__ */ p({
3801
3812
  let t = e, n = {
3802
3813
  addRowBefore: {
3803
3814
  label: "table.insertAbove",
3804
- icon: an
3815
+ icon: on
3805
3816
  },
3806
3817
  addRowAfter: {
3807
3818
  label: "table.insertBelow",
3808
- icon: an
3819
+ icon: on
3809
3820
  },
3810
3821
  moveRowUp: {
3811
3822
  label: "table.moveUp",
3812
- icon: ht
3823
+ icon: gt
3813
3824
  },
3814
3825
  moveRowDown: {
3815
3826
  label: "table.moveDown",
3816
- icon: ft
3827
+ icon: pt
3817
3828
  },
3818
3829
  toggleHeaderRow: {
3819
3830
  label: "table.setHeader",
3820
- icon: hn
3831
+ icon: gn
3821
3832
  },
3822
3833
  deleteRow: {
3823
3834
  label: "table.deleteLine",
3824
- icon: Sn
3835
+ icon: Cn
3825
3836
  },
3826
3837
  addColumnBefore: {
3827
3838
  label: "table.insertLeft",
3828
- icon: an
3839
+ icon: on
3829
3840
  },
3830
3841
  addColumnAfter: {
3831
3842
  label: "table.insertRight",
3832
- icon: an
3843
+ icon: on
3833
3844
  },
3834
3845
  moveColumnLeft: {
3835
3846
  label: "table.moveLeft",
3836
- icon: pt
3847
+ icon: mt
3837
3848
  },
3838
3849
  moveColumnRight: {
3839
3850
  label: "table.moveRight",
3840
- icon: mt
3851
+ icon: ht
3841
3852
  },
3842
3853
  toggleHeaderColumn: {
3843
3854
  label: "table.setHeader",
3844
- icon: hn
3855
+ icon: gn
3845
3856
  },
3846
3857
  deleteColumn: {
3847
3858
  label: "table.deleteLine",
3848
- icon: Sn
3859
+ icon: Cn
3849
3860
  }
3850
3861
  }, i = ["row", "column"], l = {
3851
3862
  row: [
@@ -3865,7 +3876,7 @@ var vr = /* @__PURE__ */ p({
3865
3876
  }, u = {
3866
3877
  row: "toggleHeaderRow",
3867
3878
  column: "toggleHeaderColumn"
3868
- }, d = j(), p = D(), m = D(), g, _, v, y, b = a(() => {
3879
+ }, d = M(), p = O(), m = O(), g, _, v, y, b = a(() => {
3869
3880
  function e(e) {
3870
3881
  let t = l[e];
3871
3882
  return d.value?.[e] === 0 ? [
@@ -3878,12 +3889,12 @@ var vr = /* @__PURE__ */ p({
3878
3889
  row: e("row"),
3879
3890
  column: e("column")
3880
3891
  };
3881
- }), w = a(() => {
3892
+ }), x = a(() => {
3882
3893
  let e = d.value;
3883
3894
  t.context.documentRevision.value;
3884
3895
  function r(r) {
3885
3896
  return b.value[r].flatMap((i, a) => {
3886
- let o = n[i], s = i === u[r] && e && k(r, e) ? "table.unsetHeader" : o.label, c = {
3897
+ let o = n[i], s = i === u[r] && e && D(r, e) ? "table.unsetHeader" : o.label, c = {
3887
3898
  key: i,
3888
3899
  label: () => h("span", { class: "vibe-naive-tiptap__menu-label" }, [h(o.icon, { size: 15 }), t.context.t(s)])
3889
3900
  };
@@ -3898,14 +3909,14 @@ var vr = /* @__PURE__ */ p({
3898
3909
  column: r("column")
3899
3910
  };
3900
3911
  });
3901
- function E(e) {
3912
+ function T(e) {
3902
3913
  let { editor: n } = t.context;
3903
3914
  if (!n.isDestroyed && n.view.dom.contains(e)) return n.state.doc.resolve(n.view.posAtDOM(e, 0));
3904
3915
  }
3905
- function k(e, t) {
3906
- let n = E(t.cell), r = n && He(n);
3916
+ function D(e, t) {
3917
+ let n = T(t.cell), r = n && Ue(n);
3907
3918
  if (!r) return !1;
3908
- let i = r.node(-1), a = Ve.get(i);
3919
+ let i = r.node(-1), a = He.get(i);
3909
3920
  return a.cellsInRect({
3910
3921
  left: 0,
3911
3922
  top: 0,
@@ -3914,9 +3925,9 @@ var vr = /* @__PURE__ */ p({
3914
3925
  }).every((e) => i.nodeAt(e)?.type.spec.tableRole === "header_cell");
3915
3926
  }
3916
3927
  function A(e, t) {
3917
- let n = e.closest("table"), r = E(e), i = r && He(r);
3928
+ let n = e.closest("table"), r = T(e), i = r && Ue(r);
3918
3929
  if (!n || !i) return;
3919
- let a = Ve.get(i.node(-1)).findCell(i.pos - i.start(-1)), o = n.querySelectorAll(":scope > colgroup > col");
3930
+ let a = He.get(i.node(-1)).findCell(i.pos - i.start(-1)), o = n.querySelectorAll(":scope > colgroup > col");
3920
3931
  for (let r = a.left; r < a.right; r += 1) {
3921
3932
  let i = o[r]?.getBoundingClientRect();
3922
3933
  if (i && i.width > 0 && t < i.right) return {
@@ -3934,7 +3945,7 @@ var vr = /* @__PURE__ */ p({
3934
3945
  column: l
3935
3946
  };
3936
3947
  }
3937
- function M() {
3948
+ function j() {
3938
3949
  let e = d.value;
3939
3950
  if (!e || !_ || !g) return;
3940
3951
  let t = e.table.rows[e.row];
@@ -3947,12 +3958,12 @@ var vr = /* @__PURE__ */ p({
3947
3958
  N();
3948
3959
  return;
3949
3960
  }
3950
- let a = t.getBoundingClientRect(), o = e.table.querySelectorAll(":scope > colgroup > col")[e.column]?.getBoundingClientRect(), s = e.cell.getBoundingClientRect(), c = E(e.cell), l = c && He(c);
3961
+ let a = t.getBoundingClientRect(), o = e.table.querySelectorAll(":scope > colgroup > col")[e.column]?.getBoundingClientRect(), s = e.cell.getBoundingClientRect(), c = T(e.cell), l = c && Ue(c);
3951
3962
  if (!l) {
3952
3963
  N();
3953
3964
  return;
3954
3965
  }
3955
- let u = Ve.get(l.node(-1)).findCell(l.pos - l.start(-1)), f = s.width / (u.right - u.left), p = o && o.width > 0 ? o.left + o.width / 2 : s.left + (e.column - u.left + .5) * f;
3966
+ let u = He.get(l.node(-1)).findCell(l.pos - l.start(-1)), f = s.width / (u.right - u.left), p = o && o.width > 0 ? o.left + o.width / 2 : s.left + (e.column - u.left + .5) * f;
3956
3967
  m.value = {
3957
3968
  row: {
3958
3969
  left: `${Math.max(r.left + 11, i.left - 11) - n.left}px`,
@@ -3967,7 +3978,7 @@ var vr = /* @__PURE__ */ p({
3967
3978
  function N() {
3968
3979
  clearTimeout(v), v = void 0, p.value = void 0, d.value = void 0, m.value = void 0;
3969
3980
  }
3970
- function I() {
3981
+ function P() {
3971
3982
  p.value || v !== void 0 || (v = setTimeout(() => {
3972
3983
  v = void 0, p.value || N();
3973
3984
  }, 200));
@@ -3980,26 +3991,26 @@ var vr = /* @__PURE__ */ p({
3980
3991
  }
3981
3992
  let t = e.target.closest("td, th");
3982
3993
  if (!(t instanceof HTMLTableCellElement)) {
3983
- I();
3994
+ P();
3984
3995
  return;
3985
3996
  }
3986
3997
  clearTimeout(v), v = void 0;
3987
3998
  let n = A(t, e.clientX);
3988
- n ? (d.value = n, M()) : N();
3999
+ n ? (d.value = n, j()) : N();
3989
4000
  }
3990
- function z(e, n) {
3991
- let r = E(n.cell), i = r && He(r);
4001
+ function R(e, n) {
4002
+ let r = T(n.cell), i = r && Ue(r);
3992
4003
  return i ? t.context.commands.selectTableLineAt(e, i.pos, n[e]) : !1;
3993
4004
  }
3994
- function H(e, t) {
4005
+ function ee(e, t) {
3995
4006
  if (!t) {
3996
4007
  p.value === e && N();
3997
4008
  return;
3998
4009
  }
3999
4010
  let n = d.value;
4000
- n && (clearTimeout(v), v = void 0, z(e, n) && (p.value = e));
4011
+ n && (clearTimeout(v), v = void 0, R(e, n) && (p.value = e));
4001
4012
  }
4002
- function ee(e, n) {
4013
+ function H(e, n) {
4003
4014
  let r = d.value;
4004
4015
  if (!r) return;
4005
4016
  let i = b.value[e].find((e) => e === n);
@@ -4008,38 +4019,38 @@ var vr = /* @__PURE__ */ p({
4008
4019
  if (N(), i === "deleteRow" || i === "deleteColumn") {
4009
4020
  let { doc: t, selection: n } = a.state;
4010
4021
  clearTimeout(y), y = setTimeout(() => {
4011
- !a.isDestroyed && a.isEditable && a.state.doc === t && a.state.selection.eq(n) && z(e, r) && o[i](r[e]);
4022
+ !a.isDestroyed && a.isEditable && a.state.doc === t && a.state.selection.eq(n) && R(e, r) && o[i](r[e]);
4012
4023
  }, 240);
4013
- } else z(e, r) && o[i]();
4024
+ } else R(e, r) && o[i]();
4014
4025
  }
4015
- function W(e) {
4026
+ function U(e) {
4016
4027
  e.target instanceof Element && e.target.closest(".vibe-naive-tiptap__grip") || p.value && N();
4017
4028
  }
4018
- return F(() => t.context.revision.value, M, { flush: "post" }), C(() => {
4019
- g = t.context.editor.view.dom.parentElement ?? void 0, _ = g?.parentElement ?? void 0, _?.addEventListener("pointermove", L), _?.addEventListener("pointerleave", I), g?.addEventListener("pointerdown", W), g?.addEventListener("scroll", M, { passive: !0 }), window.addEventListener("resize", M);
4020
- }), S(() => {
4021
- clearTimeout(v), clearTimeout(y), _?.removeEventListener("pointermove", L), _?.removeEventListener("pointerleave", I), g?.removeEventListener("pointerdown", W), g?.removeEventListener("scroll", M), window.removeEventListener("resize", M);
4022
- }), (t, n) => m.value ? (T(), c(r, { key: 0 }, O(i, (t) => f(P(U), {
4029
+ return I(() => t.context.revision.value, j, { flush: "post" }), w(() => {
4030
+ g = t.context.editor.view.dom.parentElement ?? void 0, _ = g?.parentElement ?? void 0, _?.addEventListener("pointermove", L), _?.addEventListener("pointerleave", P), g?.addEventListener("pointerdown", U), g?.addEventListener("scroll", j, { passive: !0 }), window.addEventListener("resize", j);
4031
+ }), C(() => {
4032
+ clearTimeout(v), clearTimeout(y), _?.removeEventListener("pointermove", L), _?.removeEventListener("pointerleave", P), g?.removeEventListener("pointerdown", U), g?.removeEventListener("scroll", j), window.removeEventListener("resize", j);
4033
+ }), (t, n) => m.value ? (E(), c(r, { key: 0 }, k(i, (t) => f(F(te), {
4023
4034
  key: t,
4024
4035
  to: e.overlayTarget,
4025
4036
  trigger: "click",
4026
4037
  placement: t === "row" ? "right-start" : "top-start",
4027
- options: w.value[t],
4038
+ options: x.value[t],
4028
4039
  show: p.value === t,
4029
- "onUpdate:show": (e) => H(t, e),
4030
- onSelect: (e) => ee(t, e)
4040
+ "onUpdate:show": (e) => ee(t, e),
4041
+ onSelect: (e) => H(t, e)
4031
4042
  }, {
4032
- default: R(() => [f(P(V), {
4043
+ default: z(() => [f(F(V), {
4033
4044
  text: "",
4034
4045
  class: "vibe-naive-tiptap__grip",
4035
- style: x(m.value[t]),
4046
+ style: S(m.value[t]),
4036
4047
  "aria-label": e.context.t(t === "row" ? "table.rowMenu" : "table.columnMenu"),
4037
4048
  onMousedown: n[0] ||= B(() => {}, ["prevent"])
4038
4049
  }, {
4039
- default: R(() => [t === "row" ? (T(), o(P(Tt), {
4050
+ default: z(() => [t === "row" ? (E(), o(F(Et), {
4040
4051
  key: 0,
4041
4052
  size: 20
4042
- })) : (T(), o(P(Et), {
4053
+ })) : (E(), o(F(Dt), {
4043
4054
  key: 1,
4044
4055
  size: 20
4045
4056
  }))]),
@@ -4055,7 +4066,7 @@ var vr = /* @__PURE__ */ p({
4055
4066
  "onSelect"
4056
4067
  ])), 64)) : s("", !0);
4057
4068
  }
4058
- }), Ar = "0 0 24 24", jr = {
4069
+ }), Nr = "0 0 24 24", Pr = {
4059
4070
  strokeWidth: 2,
4060
4071
  paths: [
4061
4072
  "m4 3 3 3-3 3",
@@ -4063,68 +4074,68 @@ var vr = /* @__PURE__ */ p({
4063
4074
  "M4 12h16",
4064
4075
  "M4 18h16"
4065
4076
  ]
4066
- }, Mr = {
4077
+ }, Fr = {
4067
4078
  strokeWidth: 1.75,
4068
4079
  paths: [
4069
4080
  "M4 5h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z",
4070
4081
  "M5.5 15v-6l2.5 3 2.5-3v6",
4071
4082
  "M16.5 9v6m-2.5-2.5 2.5 2.5 2.5-2.5"
4072
4083
  ]
4073
- }, Nr = "translate(0 -3.5)", Pr = {
4084
+ }, Ir = "translate(0 -3.5)", Lr = {
4074
4085
  import: ["M12 18v4.5m-3-3 3 3 3-3"],
4075
4086
  export: ["M12 22.5V18m-3 3 3-3 3 3"],
4076
4087
  copy: ["M11.75 18.5h3.5a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-.75.75h-3.5a.75.75 0 0 1-.75-.75v-2.5a.75.75 0 0 1 .75-.75Z", "M8.5 21v-3.5h5"]
4077
- }, Fr = [
4088
+ }, Rr = [
4078
4089
  "width",
4079
4090
  "height",
4080
4091
  "viewBox",
4081
4092
  "stroke-width"
4082
- ], Ir = ["d"], Lr = /* @__PURE__ */ p({
4093
+ ], zr = ["d"], Br = /* @__PURE__ */ p({
4083
4094
  __name: "first-line-indent-icon",
4084
4095
  props: { size: { default: 18 } },
4085
4096
  setup(e) {
4086
- return (t, n) => (T(), c("svg", {
4097
+ return (t, n) => (E(), c("svg", {
4087
4098
  xmlns: "http://www.w3.org/2000/svg",
4088
4099
  width: e.size,
4089
4100
  height: e.size,
4090
- viewBox: P(Ar),
4101
+ viewBox: F(Nr),
4091
4102
  fill: "none",
4092
4103
  stroke: "currentColor",
4093
- "stroke-width": P(jr).strokeWidth,
4104
+ "stroke-width": F(Pr).strokeWidth,
4094
4105
  "stroke-linecap": "round",
4095
4106
  "stroke-linejoin": "round",
4096
4107
  "aria-hidden": "true",
4097
4108
  focusable: "false"
4098
- }, [(T(!0), c(r, null, O(P(jr).paths, (e) => (T(), c("path", {
4109
+ }, [(E(!0), c(r, null, k(F(Pr).paths, (e) => (E(), c("path", {
4099
4110
  key: e,
4100
4111
  d: e
4101
- }, null, 8, Ir))), 128))], 8, Fr));
4112
+ }, null, 8, zr))), 128))], 8, Rr));
4102
4113
  }
4103
- }), Rr = ["viewBox", "stroke-width"], zr = ["transform"], Br = ["d"], Vr = ["d"], Hr = /* @__PURE__ */ p({
4114
+ }), Vr = ["viewBox", "stroke-width"], Hr = ["transform"], Ur = ["d"], Wr = ["d"], Gr = /* @__PURE__ */ p({
4104
4115
  __name: "markdown-icon",
4105
4116
  props: { action: {} },
4106
4117
  setup(e) {
4107
- return (t, n) => (T(), c("svg", {
4118
+ return (t, n) => (E(), c("svg", {
4108
4119
  xmlns: "http://www.w3.org/2000/svg",
4109
4120
  width: "1em",
4110
4121
  height: "1em",
4111
- viewBox: P(Ar),
4122
+ viewBox: F(Nr),
4112
4123
  fill: "none",
4113
4124
  stroke: "currentColor",
4114
- "stroke-width": P(Mr).strokeWidth,
4125
+ "stroke-width": F(Fr).strokeWidth,
4115
4126
  "stroke-linecap": "round",
4116
4127
  "stroke-linejoin": "round",
4117
4128
  "aria-hidden": "true",
4118
4129
  focusable: "false"
4119
- }, [l("g", { transform: e.action ? P(Nr) : void 0 }, [(T(!0), c(r, null, O(P(Mr).paths, (e) => (T(), c("path", {
4130
+ }, [l("g", { transform: e.action ? F(Ir) : void 0 }, [(E(!0), c(r, null, k(F(Fr).paths, (e) => (E(), c("path", {
4120
4131
  key: e,
4121
4132
  d: e
4122
- }, null, 8, Br))), 128))], 8, zr), e.action ? (T(!0), c(r, { key: 0 }, O(P(Pr)[e.action], (e) => (T(), c("path", {
4133
+ }, null, 8, Ur))), 128))], 8, Hr), e.action ? (E(!0), c(r, { key: 0 }, k(F(Lr)[e.action], (e) => (E(), c("path", {
4123
4134
  key: e,
4124
4135
  d: e
4125
- }, null, 8, Vr))), 128)) : s("", !0)], 8, Rr));
4136
+ }, null, 8, Wr))), 128)) : s("", !0)], 8, Vr));
4126
4137
  }
4127
- }), Ur = ["accept", "disabled"], Wr = 16, Gr = /* @__PURE__ */ p({
4138
+ }), Kr = ["accept", "disabled"], qr = 16, Jr = /* @__PURE__ */ p({
4128
4139
  __name: "naive-tiptap-markdown-menu",
4129
4140
  props: {
4130
4141
  context: {},
@@ -4133,21 +4144,21 @@ var vr = /* @__PURE__ */ p({
4133
4144
  overlayTarget: {}
4134
4145
  },
4135
4146
  setup(e) {
4136
- let t = e, n = a(() => Se(t.context.editor)), i = a(() => t.context.t("command.markdown")), o = D(), s = D(!1), u = a(() => {
4147
+ let t = e, n = a(() => Se(t.context.editor)), i = a(() => t.context.t("command.markdown")), o = O(), s = O(!1), u = a(() => {
4137
4148
  let { editor: e, revision: r } = t.context;
4138
4149
  return r.value, !t.preview && e.isEditable && !!n.value?.parse && !e.isDestroyed;
4139
- }), p = a(() => Ye.map(({ value: e }) => ({
4150
+ }), p = a(() => Xe.map(({ value: e }) => ({
4140
4151
  key: e,
4141
4152
  label: t.context.t(`toolbar.markdown.${e}`),
4142
- icon: () => h(W, { size: Wr }, () => h(Hr, { action: e })),
4153
+ icon: () => h(W, { size: qr }, () => h(Gr, { action: e })),
4143
4154
  disabled: e === "import" ? !u.value || s.value : !n.value?.serialize
4144
4155
  })));
4145
4156
  function m(e) {
4146
4157
  let r = t.context;
4147
- r.editor.isDestroyed || (e === "import" ? u.value && !s.value && o.value?.click() : n.value?.serialize && (e === "export" ? $e(r, {
4158
+ r.editor.isDestroyed || (e === "import" ? u.value && !s.value && o.value?.click() : n.value?.serialize && (e === "export" ? et(r, {
4148
4159
  filename: t.options.exportFilename,
4149
4160
  t: r.t
4150
- }) : e === "copy" && et(r, { t: r.t })));
4161
+ }) : e === "copy" && tt(r, { t: r.t })));
4151
4162
  }
4152
4163
  async function g(e) {
4153
4164
  let n = e.currentTarget;
@@ -4157,7 +4168,7 @@ var vr = /* @__PURE__ */ p({
4157
4168
  let i = t.context;
4158
4169
  s.value = !0;
4159
4170
  try {
4160
- await Qe(i, r, {
4171
+ await $e(i, r, {
4161
4172
  strict: t.options.importStrict,
4162
4173
  t: i.t,
4163
4174
  canImport: () => o.value === n && t.context === i && u.value
@@ -4166,7 +4177,7 @@ var vr = /* @__PURE__ */ p({
4166
4177
  s.value = !1;
4167
4178
  }
4168
4179
  }
4169
- return (t, n) => (T(), c(r, null, [l("input", {
4180
+ return (t, n) => (E(), c(r, null, [l("input", {
4170
4181
  ref_key: "markdownInput",
4171
4182
  ref: o,
4172
4183
  type: "file",
@@ -4174,38 +4185,38 @@ var vr = /* @__PURE__ */ p({
4174
4185
  accept: e.options.importAccept,
4175
4186
  disabled: !u.value,
4176
4187
  onChange: g
4177
- }, null, 40, Ur), f(P(U), {
4188
+ }, null, 40, Kr), f(F(te), {
4178
4189
  to: e.overlayTarget,
4179
4190
  trigger: "click",
4180
4191
  options: p.value,
4181
4192
  onSelect: m
4182
4193
  }, {
4183
- default: R(() => [f(P(Y), v({ to: e.overlayTarget }, P(Q)), {
4184
- trigger: R(() => [f(P(V), {
4194
+ default: z(() => [f(F(X), y({ to: e.overlayTarget }, F($)), {
4195
+ trigger: z(() => [f(F(V), {
4185
4196
  quaternary: "",
4186
4197
  size: "small",
4187
4198
  "data-toolbar-key": "markdown",
4188
4199
  "aria-label": i.value,
4189
4200
  "aria-haspopup": "menu"
4190
4201
  }, {
4191
- icon: R(() => [f(P(W), {
4192
- component: Hr,
4193
- size: Wr
4202
+ icon: z(() => [f(F(W), {
4203
+ component: Gr,
4204
+ size: qr
4194
4205
  })]),
4195
4206
  _: 1
4196
4207
  }, 8, ["aria-label"])]),
4197
- default: R(() => [d(" " + M(i.value), 1)]),
4208
+ default: z(() => [d(" " + N(i.value), 1)]),
4198
4209
  _: 1
4199
4210
  }, 16, ["to"])]),
4200
4211
  _: 1
4201
4212
  }, 8, ["to", "options"])], 64));
4202
4213
  }
4203
- }), Kr = { class: "vibe-naive-tiptap__table-picker" }, qr = { class: "vibe-naive-tiptap__table-size" }, Jr = [
4214
+ }), Yr = { class: "vibe-naive-tiptap__table-picker" }, Xr = { class: "vibe-naive-tiptap__table-size" }, Zr = [
4204
4215
  "aria-label",
4205
4216
  "onMouseenter",
4206
4217
  "onFocus",
4207
4218
  "onClick"
4208
- ], Yr = /* @__PURE__ */ p({
4219
+ ], Qr = /* @__PURE__ */ p({
4209
4220
  __name: "naive-tiptap-table-picker",
4210
4221
  props: {
4211
4222
  context: {},
@@ -4214,7 +4225,7 @@ var vr = /* @__PURE__ */ p({
4214
4225
  overlayTarget: {}
4215
4226
  },
4216
4227
  setup(e) {
4217
- let t = e, n = a(() => t.context.t("command.table")), i = D({
4228
+ let t = e, n = a(() => t.context.t("command.table")), i = O({
4218
4229
  from: 0,
4219
4230
  to: 0
4220
4231
  });
@@ -4226,7 +4237,7 @@ var vr = /* @__PURE__ */ p({
4226
4237
  to: r
4227
4238
  };
4228
4239
  }
4229
- let u = D({
4240
+ let u = O({
4230
4241
  rows: 0,
4231
4242
  cols: 0
4232
4243
  }), p = a(() => {
@@ -4243,39 +4254,39 @@ var vr = /* @__PURE__ */ p({
4243
4254
  cols: 0
4244
4255
  });
4245
4256
  }
4246
- return (t, i) => (T(), o(P(q), {
4257
+ return (t, i) => (E(), o(F(J), {
4247
4258
  to: e.overlayTarget,
4248
4259
  trigger: "click",
4249
4260
  disabled: e.disabled,
4250
4261
  "onUpdate:show": s
4251
4262
  }, {
4252
- trigger: R(() => [f(P(Y), v({ to: e.overlayTarget }, P(Q)), {
4253
- trigger: R(() => [f(P(V), {
4263
+ trigger: z(() => [f(F(X), y({ to: e.overlayTarget }, F($)), {
4264
+ trigger: z(() => [f(F(V), {
4254
4265
  quaternary: "",
4255
4266
  size: "small",
4256
4267
  "data-toolbar-key": "table",
4257
4268
  "aria-label": n.value,
4258
4269
  disabled: e.disabled
4259
4270
  }, {
4260
- icon: R(() => [f(P(W), {
4261
- component: P(gn),
4271
+ icon: z(() => [f(F(W), {
4272
+ component: F(_n),
4262
4273
  size: 16
4263
4274
  }, null, 8, ["component"])]),
4264
4275
  _: 1
4265
4276
  }, 8, ["aria-label", "disabled"])]),
4266
- default: R(() => [d(" " + M(n.value), 1)]),
4277
+ default: z(() => [d(" " + N(n.value), 1)]),
4267
4278
  _: 1
4268
4279
  }, 16, ["to"])]),
4269
- default: R(() => [l("div", Kr, [l("div", qr, M(u.value.rows || 1) + " × " + M(u.value.cols || 1), 1), l("div", {
4280
+ default: z(() => [l("div", Yr, [l("div", Xr, N(u.value.rows || 1) + " × " + N(u.value.cols || 1), 1), l("div", {
4270
4281
  class: "vibe-naive-tiptap__table-grid",
4271
- style: x(m.value)
4272
- }, [(T(!0), c(r, null, O(p.value, (t) => (T(), o(P(Y), v({
4282
+ style: S(m.value)
4283
+ }, [(E(!0), c(r, null, k(p.value, (t) => (E(), o(F(X), y({
4273
4284
  to: e.overlayTarget,
4274
4285
  key: `${t.row}-${t.col}`
4275
- }, { ref_for: !0 }, P(Q)), {
4276
- trigger: R(() => [l("button", {
4286
+ }, { ref_for: !0 }, F($)), {
4287
+ trigger: z(() => [l("button", {
4277
4288
  type: "button",
4278
- class: y(["vibe-naive-tiptap__table-cell", { "vibe-naive-tiptap__table-cell--active": t.row <= u.value.rows && t.col <= u.value.cols }]),
4289
+ class: b(["vibe-naive-tiptap__table-cell", { "vibe-naive-tiptap__table-cell--active": t.row <= u.value.rows && t.col <= u.value.cols }]),
4279
4290
  "aria-label": `${t.row} × ${t.col}`,
4280
4291
  onMouseenter: (e) => u.value = {
4281
4292
  rows: t.row,
@@ -4286,29 +4297,29 @@ var vr = /* @__PURE__ */ p({
4286
4297
  cols: t.col
4287
4298
  },
4288
4299
  onClick: (e) => h(t.row, t.col)
4289
- }, null, 42, Jr)]),
4290
- default: R(() => [d(" " + M(`${t.row} × ${t.col}`), 1)]),
4300
+ }, null, 42, Zr)]),
4301
+ default: z(() => [d(" " + N(`${t.row} × ${t.col}`), 1)]),
4291
4302
  _: 2
4292
4303
  }, 1040, ["to"]))), 128))], 4)])]),
4293
4304
  _: 1
4294
4305
  }, 8, ["to", "disabled"]));
4295
4306
  }
4296
- }), Xr = 500, Zr = "body{font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif;padding:24px;line-height:1.6}img{max-width:100%}table{border-collapse:collapse;width:100%}th,td{border:1px solid #ddd;padding:6px 10px}pre{background:#f5f7fa;padding:12px;border-radius:4px;overflow-x:auto}code{background:#f5f7fa;padding:1px 4px;border-radius:3px}blockquote{border-left:3px solid #ddd;padding-left:1em;color:#666}";
4297
- function Qr(e, t = {}) {
4307
+ }), $r = 500, ei = "body{font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif;padding:24px;line-height:1.6}img{max-width:100%}table{border-collapse:collapse;width:100%}th,td{border:1px solid #ddd;padding:6px 10px}pre{background:#f5f7fa;padding:12px;border-radius:4px;overflow-x:auto}code{background:#f5f7fa;padding:1px 4px;border-radius:3px}blockquote{border-left:3px solid #ddd;padding-left:1em;color:#666}";
4308
+ function ti(e, t = {}) {
4298
4309
  let { t: r } = n(t.locale), i = t.t ?? r, a = document.createElement("iframe");
4299
4310
  a.style.position = "fixed", a.style.right = "0", a.style.bottom = "0", a.style.width = "0", a.style.height = "0", a.style.border = "0", document.body.appendChild(a);
4300
4311
  let o = a.contentWindow?.document;
4301
4312
  if (!o) throw a.remove(), Error("Unable to access print iframe document");
4302
4313
  o.open(), o.write(`<!DOCTYPE html><html><head><meta charset="utf-8"><title></title>
4303
- <style>${Zr}</style>
4314
+ <style>${ei}</style>
4304
4315
  </head><body>${e}</body></html>`), o.title = t.title ?? i("print.defaultTitle");
4305
4316
  let s = () => a.remove();
4306
4317
  return a.onload = () => {
4307
- a.onload = null, a.contentWindow?.focus(), a.contentWindow?.print(), setTimeout(s, t.cleanupDelay ?? Xr);
4318
+ a.onload = null, a.contentWindow?.focus(), a.contentWindow?.print(), setTimeout(s, t.cleanupDelay ?? $r);
4308
4319
  }, o.close(), a;
4309
4320
  }
4310
4321
  // ../editor-ui/dist/toolbar-config.js
4311
- var $r = [
4322
+ var ni = [
4312
4323
  ["undo", "redo"],
4313
4324
  ["heading"],
4314
4325
  [
@@ -4355,10 +4366,10 @@ var $r = [
4355
4366
  ],
4356
4367
  ["preview", "fullscreen"]
4357
4368
  ];
4358
- function ei(e) {
4359
- return e === !1 ? [] : (e ?? $r).filter((e) => e.length > 0).map((e) => [...e]);
4369
+ function ri(e) {
4370
+ return e === !1 ? [] : (e ?? ni).filter((e) => e.length > 0).map((e) => [...e]);
4360
4371
  }
4361
- var ti = [
4372
+ var ii = [
4362
4373
  {
4363
4374
  label: "正文",
4364
4375
  level: 0
@@ -4387,7 +4398,7 @@ var ti = [
4387
4398
  label: "标题 6",
4388
4399
  level: 6
4389
4400
  }
4390
- ], ni = e.map((e) => ({ ...e })), ri = [
4401
+ ], ai = e.map((e) => ({ ...e })), oi = [
4391
4402
  {
4392
4403
  label: "实线",
4393
4404
  value: "solid"
@@ -4404,10 +4415,10 @@ var ti = [
4404
4415
  label: "点线",
4405
4416
  value: "dotted"
4406
4417
  }
4407
- ], ii = {
4418
+ ], si = {
4408
4419
  maxRows: 8,
4409
4420
  maxCols: 10
4410
- }, ai = [
4421
+ }, ci = [
4411
4422
  {
4412
4423
  label: "左对齐",
4413
4424
  value: "left"
@@ -4425,27 +4436,48 @@ var ti = [
4425
4436
  value: "justify"
4426
4437
  }
4427
4438
  ];
4428
- function oi(e, t) {
4439
+ function li(e, t) {
4429
4440
  if (typeof e != "number" || !Number.isFinite(e)) return t;
4430
4441
  let n = Math.floor(e);
4431
4442
  return n > 0 ? n : t;
4432
4443
  }
4433
- function si(e = {}, t = ni, n = ri) {
4444
+ function ui(e = {}, t = ai, n = oi) {
4434
4445
  return {
4435
4446
  codeBlockLanguages: [...t],
4436
4447
  horizontalRules: [...n],
4437
4448
  tableGrid: {
4438
- maxRows: oi(e.tableGrid?.maxRows, ii.maxRows),
4439
- maxCols: oi(e.tableGrid?.maxCols, ii.maxCols)
4449
+ maxRows: li(e.tableGrid?.maxRows, si.maxRows),
4450
+ maxCols: li(e.tableGrid?.maxCols, si.maxCols)
4440
4451
  }
4441
4452
  };
4442
4453
  }
4454
+ // src/vibe-tiptap-defaults.ts
4455
+ var di = Symbol();
4456
+ function fi() {
4457
+ return g() ? _(di, void 0) : void 0;
4458
+ }
4459
+ function pi(e, t) {
4460
+ return {
4461
+ toolbar: e.toolbar ?? t?.toolbar,
4462
+ toolbarOptions: e.toolbarOptions ?? t?.toolbarOptions,
4463
+ colors: e.colors ?? t?.colors,
4464
+ highlights: e.highlights ?? t?.highlights,
4465
+ markdownOptions: e.markdownOptions ?? t?.markdownOptions,
4466
+ printOptions: e.printOptions ?? t?.printOptions,
4467
+ showWordCount: e.showWordCount ?? t?.showWordCount
4468
+ };
4469
+ }
4470
+ function mi(e) {
4471
+ let t = fi();
4472
+ return a(() => pi(e, t?.value));
4473
+ }
4443
4474
  // src/naive-tiptap-toolbar.vue?vue&type=script&setup=true&lang.ts
4444
- var ci = {
4475
+ var hi = {
4476
+ key: 0,
4445
4477
  class: "vibe-naive-tiptap__toolbar",
4446
4478
  role: "toolbar",
4447
4479
  "aria-label": "Editor toolbar"
4448
- }, $ = 16, li = /* @__PURE__ */ p({
4480
+ }, gi = 16, _i = /* @__PURE__ */ p({
4449
4481
  __name: "naive-tiptap-toolbar",
4450
4482
  props: {
4451
4483
  context: {},
@@ -4479,9 +4511,9 @@ var ci = {
4479
4511
  },
4480
4512
  emits: ["update:preview", "update:fullscreen"],
4481
4513
  setup(e, { emit: t }) {
4482
- let n = e, i = t, l = j(!1), u = ue();
4483
- E(er, g(er, () => j(), !0));
4484
- let p = [
4514
+ let n = e, i = mi(n), l = t, u = M(!1), p = le();
4515
+ D(tr, _(tr, () => M(), !0));
4516
+ let m = [
4485
4517
  0,
4486
4518
  1,
4487
4519
  2,
@@ -4489,56 +4521,56 @@ var ci = {
4489
4521
  4,
4490
4522
  5,
4491
4523
  6
4492
- ], m = [
4524
+ ], g = [
4493
4525
  "left",
4494
4526
  "center",
4495
4527
  "right",
4496
4528
  "justify"
4497
- ], _ = {
4498
- 0: rn,
4499
- 1: Pt,
4500
- 2: jt,
4501
- 3: Nt,
4502
- 4: Mt,
4503
- 5: Ft,
4504
- 6: It
4505
- }, y = {
4506
- left: bn,
4507
- center: _n,
4508
- right: vn,
4509
- justify: yn
4529
+ ], v = {
4530
+ 0: an,
4531
+ 1: Ft,
4532
+ 2: Mt,
4533
+ 3: Pt,
4534
+ 4: Nt,
4535
+ 5: It,
4536
+ 6: Lt
4510
4537
  }, b = {
4511
- undo: Tn,
4512
- redo: cn,
4513
- heading: Ut,
4514
- bold: Ht,
4515
- italic: Vt,
4516
- strike: fn,
4517
- underline: wn,
4518
- code: xt,
4519
- superscript: mn,
4520
- subscript: pn,
4521
- color: $t,
4522
- highlight: Lt,
4523
- align: bn,
4524
- decreaseIndent: qt,
4525
- increaseIndent: Kt,
4526
- firstLineIndent: Lr,
4527
- bulletList: Yt,
4528
- orderedList: Jt,
4529
- taskList: Gt,
4530
- blockquote: sn,
4531
- codeBlock: bt,
4532
- hr: Qt,
4533
- link: Wt,
4534
- whiteboard: tn,
4535
- ...An,
4536
- clearFormat: Dt,
4537
- findReplace: dn,
4538
- print: on,
4539
- preview: kt,
4540
- fullscreen: Xt
4541
- }, x = /* @__PURE__ */ new Set([
4538
+ left: xn,
4539
+ center: vn,
4540
+ right: yn,
4541
+ justify: bn
4542
+ }, x = {
4543
+ undo: En,
4544
+ redo: ln,
4545
+ heading: Wt,
4546
+ bold: Ut,
4547
+ italic: Ht,
4548
+ strike: pn,
4549
+ underline: Tn,
4550
+ code: St,
4551
+ superscript: hn,
4552
+ subscript: mn,
4553
+ color: en,
4554
+ highlight: Rt,
4555
+ align: xn,
4556
+ decreaseIndent: Jt,
4557
+ increaseIndent: qt,
4558
+ firstLineIndent: Br,
4559
+ bulletList: Xt,
4560
+ orderedList: Yt,
4561
+ taskList: Kt,
4562
+ blockquote: cn,
4563
+ codeBlock: xt,
4564
+ hr: $t,
4565
+ link: Gt,
4566
+ whiteboard: nn,
4567
+ ...jn,
4568
+ clearFormat: Ot,
4569
+ findReplace: fn,
4570
+ print: sn,
4571
+ preview: At,
4572
+ fullscreen: Zt
4573
+ }, S = /* @__PURE__ */ new Set([
4542
4574
  "undo",
4543
4575
  "redo",
4544
4576
  "bold",
@@ -4560,115 +4592,115 @@ var ci = {
4560
4592
  "print",
4561
4593
  "preview",
4562
4594
  "fullscreen"
4563
- ]), S = a(() => Se(n.context.editor)), C = a(() => {
4564
- let e = n.toolbar === !1 ? [] : n.toolbar ?? $r, t = typeof n.context.editor.commands.openFindReplace == "function";
4565
- return e.flatMap((e, r) => {
4566
- let i = e.filter((e) => e === "findReplace" ? t : e === "markdown" ? !!S.value : e === "preview" ? n.preview !== void 0 : e === "fullscreen" ? n.fullscreen !== void 0 : n.preview ? e === "print" : e === "whiteboard" ? !!(n.uploadAsset && n.context.editor.schema.nodes.whiteboard) : e === "image" || e === "video" || e === "audio" || e === "attachment" ? le(e) : !0);
4595
+ ]), C = a(() => Se(n.context.editor)), w = a(() => {
4596
+ let { toolbar: e } = i.value, t = e === !1 ? [] : e ?? ni, r = typeof n.context.editor.commands.openFindReplace == "function";
4597
+ return t.flatMap((e, t) => {
4598
+ let i = e.filter((e) => e === "findReplace" ? r : e === "markdown" ? !!C.value : e === "preview" ? n.preview !== void 0 : e === "fullscreen" ? n.fullscreen !== void 0 : n.preview ? e === "print" : e === "whiteboard" ? !!(n.uploadAsset && n.context.editor.schema.nodes.whiteboard) : e === "image" || e === "video" || e === "audio" || e === "attachment" ? ce(e) : !0);
4567
4599
  return i.length ? [{
4568
- index: r,
4600
+ index: t,
4569
4601
  keys: i
4570
4602
  }] : [];
4571
4603
  });
4572
- }), w = a(() => n.context.findReplaceState.value.open), D = a(() => si(n.toolbarOptions, n.codeBlockLanguages, n.horizontalRules)), k = a(() => Ke(n.colors, n.highlights)), A = a(() => Xe(n.markdownOptions)), N = a(() => Ae(n.editorBehaviorOptions)), F = a(() => n.context.revision.value), I = a(() => (F.value, n.context.editor.isEditable));
4573
- function L(e) {
4604
+ }), T = a(() => n.context.findReplaceState.value.open), O = a(() => ui(i.value.toolbarOptions, n.codeBlockLanguages, n.horizontalRules)), A = a(() => qe(i.value.colors, i.value.highlights)), j = a(() => Ze(i.value.markdownOptions)), P = a(() => Ae(n.editorBehaviorOptions)), I = a(() => n.context.revision.value), L = a(() => (I.value, n.context.editor.isEditable));
4605
+ function R(e) {
4574
4606
  return e === "preview" && n.preview ? n.context.t("toolbar.preview.edit") : e === "fullscreen" && n.fullscreen ? n.context.t("toolbar.fullscreen.exit") : n.context.t(`command.${e}`);
4575
4607
  }
4576
- function z(e) {
4577
- if (e !== "markdown" && e !== "table") return e === "preview" && n.preview ? nn : e === "fullscreen" && n.fullscreen ? Zt : b[e];
4608
+ function ee(e) {
4609
+ if (e !== "markdown" && e !== "table") return e === "preview" && n.preview ? rn : e === "fullscreen" && n.fullscreen ? Qt : x[e];
4578
4610
  }
4579
4611
  function B(e) {
4580
- return x.has(e);
4612
+ return S.has(e);
4581
4613
  }
4582
4614
  function H(e, t) {
4583
- return F.value, e === "print" || e === "fullscreen" ? n.context.editor.isDestroyed : e === "preview" ? n.context.editor.isDestroyed || !n.preview && !I.value : !I.value && e !== "findReplace" ? !0 : e === "whiteboard" || e === "markdown" ? !1 : !Ee(n.context, e, t);
4615
+ return I.value, e === "print" || e === "fullscreen" ? n.context.editor.isDestroyed : e === "preview" ? n.context.editor.isDestroyed || !n.preview && !L.value : !L.value && e !== "findReplace" ? !0 : e === "whiteboard" || e === "markdown" ? !1 : !Ee(n.context, e, t);
4584
4616
  }
4585
- function ee(e, t) {
4586
- return e === "preview" ? n.preview === !0 : e === "fullscreen" ? n.fullscreen === !0 : e === "print" || e === "markdown" || e === "whiteboard" ? !1 : (F.value, Te(n.context, e, t));
4617
+ function U(e, t) {
4618
+ return e === "preview" ? n.preview === !0 : e === "fullscreen" ? n.fullscreen === !0 : e === "print" || e === "markdown" || e === "whiteboard" ? !1 : (I.value, Te(n.context, e, t));
4587
4619
  }
4588
- function te(e, t) {
4620
+ function ne(e, t) {
4589
4621
  if (!H(e, t)) {
4590
- if (e === "whiteboard") n.openWhiteboard ? n.openWhiteboard() : l.value = !0;
4591
- else if (e === "preview") i("update:preview", !n.preview);
4592
- else if (e === "fullscreen") i("update:fullscreen", !n.fullscreen);
4622
+ if (e === "whiteboard") n.openWhiteboard ? n.openWhiteboard() : u.value = !0;
4623
+ else if (e === "preview") l("update:preview", !n.preview);
4624
+ else if (e === "fullscreen") l("update:fullscreen", !n.fullscreen);
4593
4625
  else if (e === "print") {
4594
4626
  let { getHTML: e, t } = n.context;
4595
- Qr(e(), {
4596
- ...n.printOptions,
4627
+ ti(e(), {
4628
+ ...i.value.printOptions,
4597
4629
  t
4598
4630
  });
4599
- } else e !== "markdown" && Me(n.context, e, t);
4631
+ } else e !== "markdown" && Ne(n.context, e, t);
4600
4632
  }
4601
4633
  }
4602
4634
  function G() {
4603
- w.value ? n.context.commands.closeFindReplace() : Me(n.context, "findReplace");
4635
+ T.value ? n.context.commands.closeFindReplace() : Ne(n.context, "findReplace");
4604
4636
  }
4605
- let ne = a(() => (F.value, _e(n.context))), K = a(() => p.map((e) => {
4637
+ let K = a(() => (I.value, _e(n.context))), q = a(() => m.map((e) => {
4606
4638
  let t = e === 0 ? n.context.t("toolbar.heading.body") : n.context.t("toolbar.heading.level", { level: e });
4607
4639
  return {
4608
4640
  label: () => h("span", { class: "vibe-naive-tiptap__heading-label" }, [h(W, {
4609
- component: _[e],
4610
- size: $,
4641
+ component: v[e],
4642
+ size: gi,
4611
4643
  "aria-hidden": !0
4612
4644
  }), t]),
4613
4645
  value: e,
4614
4646
  disabled: H("heading", e)
4615
4647
  };
4616
- })), q = a(() => (F.value, y[ye(n.context)])), J = a(() => m.map((e) => ({
4648
+ })), J = a(() => (I.value, b[ye(n.context)])), ie = a(() => g.map((e) => ({
4617
4649
  label: n.context.t(`toolbar.align.${e}`),
4618
4650
  key: e,
4619
4651
  icon: () => h(W, {
4620
- component: y[e],
4621
- size: $,
4652
+ component: b[e],
4653
+ size: gi,
4622
4654
  "aria-hidden": !0
4623
4655
  })
4624
- }))), ie = a(() => D.value.codeBlockLanguages.map((e) => ({
4656
+ }))), ae = a(() => O.value.codeBlockLanguages.map((e) => ({
4625
4657
  label: e.label,
4626
4658
  key: e.value
4627
- }))), ae = a(() => D.value.horizontalRules.map((e) => ({
4659
+ }))), Y = a(() => O.value.horizontalRules.map((e) => ({
4628
4660
  label: e.label,
4629
4661
  key: e.value,
4630
4662
  icon: () => h("span", {
4631
4663
  class: ["vibe-naive-tiptap__divider-icon", `vibe-naive-tiptap__divider-icon--${e.value}`],
4632
- style: { borderTopColor: `var(--vibe-tiptap-border, ${u.value.borderColor})` },
4664
+ style: { borderTopColor: `var(--vibe-tiptap-border, ${p.value.borderColor})` },
4633
4665
  "aria-hidden": !0
4634
4666
  })
4635
4667
  })));
4636
4668
  function oe(e, t) {
4637
- te(e, t);
4669
+ ne(e, t);
4638
4670
  }
4639
- function se(e, t, n) {
4671
+ function Z(e, t, n) {
4640
4672
  n ? n() : e.currentTarget instanceof HTMLElement && t(e.currentTarget);
4641
4673
  }
4642
- let ce = a(() => ({
4674
+ let se = a(() => ({
4643
4675
  attachment: void 0,
4644
4676
  image: n.openImagePopover,
4645
4677
  video: n.openVideoPopover,
4646
4678
  audio: n.openAudioPopover
4647
4679
  }));
4648
- function le(e) {
4649
- if (e === "image" && !n.uploadAsset && !N.value.image.allowUrl) return !1;
4680
+ function ce(e) {
4681
+ if (e === "image" && !n.uploadAsset && !P.value.image.allowUrl) return !1;
4650
4682
  let t = be(e === "attachment" ? "file" : e);
4651
4683
  return !!n.context.editor.schema.nodes[t];
4652
4684
  }
4653
- return (t, i) => (T(), c("div", ci, [(T(!0), c(r, null, O(C.value, ({ index: t, keys: a }) => (T(), c("div", {
4685
+ return (t, a) => F(i).toolbar === !1 ? s("", !0) : (E(), c("div", hi, [(E(!0), c(r, null, k(w.value, ({ index: t, keys: i }) => (E(), c("div", {
4654
4686
  key: t,
4655
4687
  class: "vibe-naive-tiptap__toolbar-group"
4656
- }, [(T(!0), c(r, null, O(a, (t) => (T(), c(r, { key: t }, [B(t) ? (T(), o(P(Y), v({
4688
+ }, [(E(!0), c(r, null, k(i, (t) => (E(), c(r, { key: t }, [B(t) ? (E(), o(F(X), y({
4657
4689
  key: 0,
4658
4690
  to: e.overlayTarget
4659
- }, { ref_for: !0 }, P(Q)), {
4660
- trigger: R(() => [f(P(V), {
4691
+ }, { ref_for: !0 }, F($)), {
4692
+ trigger: z(() => [f(F(V), {
4661
4693
  quaternary: "",
4662
4694
  size: "small",
4663
4695
  "data-toolbar-key": t,
4664
- "aria-label": L(t),
4696
+ "aria-label": R(t),
4665
4697
  disabled: H(t),
4666
- type: ee(t) ? "primary" : "default",
4667
- onClick: (e) => te(t)
4698
+ type: U(t) ? "primary" : "default",
4699
+ onClick: (e) => ne(t)
4668
4700
  }, {
4669
- icon: R(() => [f(P(W), {
4670
- component: z(t),
4671
- size: $
4701
+ icon: z(() => [f(F(W), {
4702
+ component: ee(t),
4703
+ size: gi
4672
4704
  }, null, 8, ["component"])]),
4673
4705
  _: 2
4674
4706
  }, 1032, [
@@ -4678,25 +4710,25 @@ var ci = {
4678
4710
  "type",
4679
4711
  "onClick"
4680
4712
  ])]),
4681
- default: R(() => [d(" " + M(L(t)), 1)]),
4713
+ default: z(() => [d(" " + N(R(t)), 1)]),
4682
4714
  _: 2
4683
- }, 1040, ["to"])) : t === "findReplace" ? (T(), o(P(Y), v({
4715
+ }, 1040, ["to"])) : t === "findReplace" ? (E(), o(F(X), y({
4684
4716
  key: 1,
4685
4717
  to: e.overlayTarget
4686
- }, { ref_for: !0 }, P(Q)), {
4687
- trigger: R(() => [f(P(V), {
4718
+ }, { ref_for: !0 }, F($)), {
4719
+ trigger: z(() => [f(F(V), {
4688
4720
  quaternary: "",
4689
4721
  size: "small",
4690
4722
  "data-toolbar-key": "findReplace",
4691
- "aria-label": L(t),
4692
- "aria-expanded": w.value,
4723
+ "aria-label": R(t),
4724
+ "aria-expanded": T.value,
4693
4725
  disabled: H(t),
4694
- type: w.value ? "primary" : "default",
4726
+ type: T.value ? "primary" : "default",
4695
4727
  onClick: G
4696
4728
  }, {
4697
- icon: R(() => [f(P(W), {
4698
- component: b.findReplace,
4699
- size: $
4729
+ icon: z(() => [f(F(W), {
4730
+ component: x.findReplace,
4731
+ size: gi
4700
4732
  }, null, 8, ["component"])]),
4701
4733
  _: 1
4702
4734
  }, 8, [
@@ -4705,22 +4737,22 @@ var ci = {
4705
4737
  "disabled",
4706
4738
  "type"
4707
4739
  ])]),
4708
- default: R(() => [d(" " + M(L(t)), 1)]),
4740
+ default: z(() => [d(" " + N(R(t)), 1)]),
4709
4741
  _: 2
4710
- }, 1040, ["to"])) : t === "heading" ? (T(), o(P(Y), v({
4742
+ }, 1040, ["to"])) : t === "heading" ? (E(), o(F(X), y({
4711
4743
  key: 2,
4712
4744
  to: e.overlayTarget
4713
- }, { ref_for: !0 }, P(Q)), {
4714
- trigger: R(() => [f(P(re), {
4745
+ }, { ref_for: !0 }, F($)), {
4746
+ trigger: z(() => [f(F(re), {
4715
4747
  to: e.overlayTarget,
4716
4748
  class: "vibe-naive-tiptap__heading-select",
4717
4749
  size: "small",
4718
- "aria-label": L(t),
4719
- value: ne.value,
4720
- options: K.value,
4750
+ "aria-label": R(t),
4751
+ value: K.value,
4752
+ options: q.value,
4721
4753
  disabled: H(t),
4722
4754
  "consistent-menu-width": !1,
4723
- "onUpdate:value": i[0] ||= (e) => te("heading", e)
4755
+ "onUpdate:value": a[0] ||= (e) => ne("heading", e)
4724
4756
  }, null, 8, [
4725
4757
  "to",
4726
4758
  "aria-label",
@@ -4728,14 +4760,14 @@ var ci = {
4728
4760
  "options",
4729
4761
  "disabled"
4730
4762
  ])]),
4731
- default: R(() => [d(" " + M(L(t)), 1)]),
4763
+ default: z(() => [d(" " + N(R(t)), 1)]),
4732
4764
  _: 2
4733
- }, 1040, ["to"])) : t === "color" || t === "highlight" ? (T(), o(Pn, {
4765
+ }, 1040, ["to"])) : t === "color" || t === "highlight" ? (E(), o(Fn, {
4734
4766
  key: 3,
4735
4767
  context: e.context,
4736
4768
  kind: t,
4737
- icon: b[t],
4738
- colors: t === "color" ? k.value.colors : k.value.highlights,
4769
+ icon: x[t],
4770
+ colors: t === "color" ? A.value.colors : A.value.highlights,
4739
4771
  "overlay-target": e.overlayTarget,
4740
4772
  disabled: H(t)
4741
4773
  }, null, 8, [
@@ -4745,29 +4777,29 @@ var ci = {
4745
4777
  "colors",
4746
4778
  "overlay-target",
4747
4779
  "disabled"
4748
- ])) : t === "align" ? (T(), o(P(U), {
4780
+ ])) : t === "align" ? (E(), o(F(te), {
4749
4781
  key: 4,
4750
4782
  to: e.overlayTarget,
4751
4783
  trigger: "click",
4752
- options: J.value,
4784
+ options: ie.value,
4753
4785
  disabled: H(t),
4754
- onSelect: i[1] ||= (e) => oe("align", e)
4786
+ onSelect: a[1] ||= (e) => oe("align", e)
4755
4787
  }, {
4756
- default: R(() => [f(P(Y), v({ to: e.overlayTarget }, { ref_for: !0 }, P(Q)), {
4757
- trigger: R(() => [f(P(V), {
4788
+ default: z(() => [f(F(X), y({ to: e.overlayTarget }, { ref_for: !0 }, F($)), {
4789
+ trigger: z(() => [f(F(V), {
4758
4790
  quaternary: "",
4759
4791
  size: "small",
4760
4792
  "data-toolbar-key": "align",
4761
- "aria-label": L(t),
4793
+ "aria-label": R(t),
4762
4794
  disabled: H(t)
4763
4795
  }, {
4764
- icon: R(() => [f(P(W), {
4765
- component: q.value,
4766
- size: $
4796
+ icon: z(() => [f(F(W), {
4797
+ component: J.value,
4798
+ size: gi
4767
4799
  }, null, 8, ["component"])]),
4768
4800
  _: 1
4769
4801
  }, 8, ["aria-label", "disabled"])]),
4770
- default: R(() => [d(" " + M(L(t)), 1)]),
4802
+ default: z(() => [d(" " + N(R(t)), 1)]),
4771
4803
  _: 2
4772
4804
  }, 1040, ["to"])]),
4773
4805
  _: 2
@@ -4775,26 +4807,26 @@ var ci = {
4775
4807
  "to",
4776
4808
  "options",
4777
4809
  "disabled"
4778
- ])) : t === "codeBlock" ? (T(), o(P(U), {
4810
+ ])) : t === "codeBlock" ? (E(), o(F(te), {
4779
4811
  key: 5,
4780
4812
  to: e.overlayTarget,
4781
4813
  trigger: "click",
4782
- options: ie.value,
4814
+ options: ae.value,
4783
4815
  disabled: H(t),
4784
- onSelect: i[2] ||= (e) => oe("codeBlock", e)
4816
+ onSelect: a[2] ||= (e) => oe("codeBlock", e)
4785
4817
  }, {
4786
- default: R(() => [f(P(Y), v({ to: e.overlayTarget }, { ref_for: !0 }, P(Q)), {
4787
- trigger: R(() => [f(P(V), {
4818
+ default: z(() => [f(F(X), y({ to: e.overlayTarget }, { ref_for: !0 }, F($)), {
4819
+ trigger: z(() => [f(F(V), {
4788
4820
  quaternary: "",
4789
4821
  size: "small",
4790
4822
  "data-toolbar-key": "codeBlock",
4791
- "aria-label": L(t),
4823
+ "aria-label": R(t),
4792
4824
  disabled: H(t),
4793
- type: ee("codeBlock") ? "primary" : "default"
4825
+ type: U("codeBlock") ? "primary" : "default"
4794
4826
  }, {
4795
- icon: R(() => [f(P(W), {
4796
- component: b.codeBlock,
4797
- size: $
4827
+ icon: z(() => [f(F(W), {
4828
+ component: x.codeBlock,
4829
+ size: gi
4798
4830
  }, null, 8, ["component"])]),
4799
4831
  _: 1
4800
4832
  }, 8, [
@@ -4802,7 +4834,7 @@ var ci = {
4802
4834
  "disabled",
4803
4835
  "type"
4804
4836
  ])]),
4805
- default: R(() => [d(" " + M(L(t)), 1)]),
4837
+ default: z(() => [d(" " + N(R(t)), 1)]),
4806
4838
  _: 2
4807
4839
  }, 1040, ["to"])]),
4808
4840
  _: 2
@@ -4810,29 +4842,29 @@ var ci = {
4810
4842
  "to",
4811
4843
  "options",
4812
4844
  "disabled"
4813
- ])) : t === "hr" ? (T(), o(P(U), {
4845
+ ])) : t === "hr" ? (E(), o(F(te), {
4814
4846
  key: 6,
4815
4847
  to: e.overlayTarget,
4816
4848
  trigger: "click",
4817
- options: ae.value,
4849
+ options: Y.value,
4818
4850
  disabled: H(t),
4819
- onSelect: i[3] ||= (e) => oe("hr", e)
4851
+ onSelect: a[3] ||= (e) => oe("hr", e)
4820
4852
  }, {
4821
- default: R(() => [f(P(Y), v({ to: e.overlayTarget }, { ref_for: !0 }, P(Q)), {
4822
- trigger: R(() => [f(P(V), {
4853
+ default: z(() => [f(F(X), y({ to: e.overlayTarget }, { ref_for: !0 }, F($)), {
4854
+ trigger: z(() => [f(F(V), {
4823
4855
  quaternary: "",
4824
4856
  size: "small",
4825
4857
  "data-toolbar-key": "hr",
4826
- "aria-label": L(t),
4858
+ "aria-label": R(t),
4827
4859
  disabled: H(t)
4828
4860
  }, {
4829
- icon: R(() => [f(P(W), {
4830
- component: b.hr,
4831
- size: $
4861
+ icon: z(() => [f(F(W), {
4862
+ component: x.hr,
4863
+ size: gi
4832
4864
  }, null, 8, ["component"])]),
4833
4865
  _: 1
4834
4866
  }, 8, ["aria-label", "disabled"])]),
4835
- default: R(() => [d(" " + M(L(t)), 1)]),
4867
+ default: z(() => [d(" " + N(R(t)), 1)]),
4836
4868
  _: 2
4837
4869
  }, 1040, ["to"])]),
4838
4870
  _: 2
@@ -4840,10 +4872,10 @@ var ci = {
4840
4872
  "to",
4841
4873
  "options",
4842
4874
  "disabled"
4843
- ])) : t === "markdown" ? (T(), o(Gr, {
4875
+ ])) : t === "markdown" ? (E(), o(Jr, {
4844
4876
  key: 7,
4845
4877
  context: e.context,
4846
- options: A.value,
4878
+ options: j.value,
4847
4879
  preview: e.preview,
4848
4880
  "overlay-target": e.overlayTarget
4849
4881
  }, null, 8, [
@@ -4851,26 +4883,26 @@ var ci = {
4851
4883
  "options",
4852
4884
  "preview",
4853
4885
  "overlay-target"
4854
- ])) : t === "link" ? (T(), o(ar, {
4886
+ ])) : t === "link" ? (E(), o(or, {
4855
4887
  key: 8,
4856
4888
  context: e.context,
4857
- editable: I.value,
4889
+ editable: L.value,
4858
4890
  "default-target": e.context.core.defaultLinkTarget,
4859
4891
  "overlay-target": e.overlayTarget
4860
4892
  }, {
4861
- trigger: R(({ open: r }) => [f(P(Y), v({ to: e.overlayTarget }, { ref_for: !0 }, P(Q)), {
4862
- trigger: R(() => [f(P(V), {
4893
+ trigger: z(({ open: r }) => [f(F(X), y({ to: e.overlayTarget }, { ref_for: !0 }, F($)), {
4894
+ trigger: z(() => [f(F(V), {
4863
4895
  quaternary: "",
4864
4896
  size: "small",
4865
4897
  "data-toolbar-key": t,
4866
- "aria-label": L(t),
4898
+ "aria-label": R(t),
4867
4899
  disabled: H(t),
4868
4900
  type: e.context.isActive("link") ? "primary" : "default",
4869
- onClick: (e) => se(e, r, n.openLinkPopover)
4901
+ onClick: (e) => Z(e, r, n.openLinkPopover)
4870
4902
  }, {
4871
- icon: R(() => [f(P(W), {
4872
- component: b[t],
4873
- size: $
4903
+ icon: z(() => [f(F(W), {
4904
+ component: x[t],
4905
+ size: gi
4874
4906
  }, null, 8, ["component"])]),
4875
4907
  _: 2
4876
4908
  }, 1032, [
@@ -4880,7 +4912,7 @@ var ci = {
4880
4912
  "type",
4881
4913
  "onClick"
4882
4914
  ])]),
4883
- default: R(() => [d(" " + M(L(t)), 1)]),
4915
+ default: z(() => [d(" " + N(R(t)), 1)]),
4884
4916
  _: 2
4885
4917
  }, 1040, ["to"])]),
4886
4918
  _: 2
@@ -4889,27 +4921,27 @@ var ci = {
4889
4921
  "editable",
4890
4922
  "default-target",
4891
4923
  "overlay-target"
4892
- ])) : t === "image" || t === "video" || t === "audio" || t === "attachment" ? (T(), o(cr, {
4924
+ ])) : t === "image" || t === "video" || t === "audio" || t === "attachment" ? (E(), o(lr, {
4893
4925
  key: 9,
4894
4926
  context: e.context,
4895
- editable: I.value,
4927
+ editable: L.value,
4896
4928
  "overlay-target": e.overlayTarget,
4897
4929
  kind: t,
4898
4930
  "editor-behavior-options": e.editorBehaviorOptions,
4899
4931
  "can-upload": !!e.uploadAsset
4900
4932
  }, {
4901
- trigger: R(({ open: n }) => [f(P(Y), v({ to: e.overlayTarget }, { ref_for: !0 }, P(Q)), {
4902
- trigger: R(() => [f(P(V), {
4933
+ trigger: z(({ open: n }) => [f(F(X), y({ to: e.overlayTarget }, { ref_for: !0 }, F($)), {
4934
+ trigger: z(() => [f(F(V), {
4903
4935
  quaternary: "",
4904
4936
  size: "small",
4905
4937
  "data-toolbar-key": t,
4906
- "aria-label": L(t),
4907
- disabled: !I.value,
4908
- onClick: (e) => se(e, n, ce.value[t])
4938
+ "aria-label": R(t),
4939
+ disabled: !L.value,
4940
+ onClick: (e) => Z(e, n, se.value[t])
4909
4941
  }, {
4910
- icon: R(() => [f(P(W), {
4911
- component: b[t],
4912
- size: $
4942
+ icon: z(() => [f(F(W), {
4943
+ component: x[t],
4944
+ size: gi
4913
4945
  }, null, 8, ["component"])]),
4914
4946
  _: 2
4915
4947
  }, 1032, [
@@ -4918,7 +4950,7 @@ var ci = {
4918
4950
  "disabled",
4919
4951
  "onClick"
4920
4952
  ])]),
4921
- default: R(() => [d(" " + M(L(t)), 1)]),
4953
+ default: z(() => [d(" " + N(R(t)), 1)]),
4922
4954
  _: 2
4923
4955
  }, 1040, ["to"])]),
4924
4956
  _: 2
@@ -4929,10 +4961,10 @@ var ci = {
4929
4961
  "kind",
4930
4962
  "editor-behavior-options",
4931
4963
  "can-upload"
4932
- ])) : t === "table" ? (T(), o(Yr, {
4964
+ ])) : t === "table" ? (E(), o(Qr, {
4933
4965
  key: 10,
4934
4966
  context: e.context,
4935
- options: D.value.tableGrid,
4967
+ options: O.value.tableGrid,
4936
4968
  disabled: H("table"),
4937
4969
  "overlay-target": e.overlayTarget
4938
4970
  }, null, 8, [
@@ -4940,115 +4972,116 @@ var ci = {
4940
4972
  "options",
4941
4973
  "disabled",
4942
4974
  "overlay-target"
4943
- ])) : s("", !0)], 64))), 128))]))), 128)), l.value && I.value && e.uploadAsset ? (T(), o(Bn, {
4975
+ ])) : s("", !0)], 64))), 128))]))), 128)), u.value && L.value && e.uploadAsset ? (E(), o(Vn, {
4944
4976
  key: 0,
4945
4977
  context: e.context,
4946
4978
  "upload-asset": e.uploadAsset,
4947
4979
  "overlay-target": e.overlayTarget,
4948
- onClose: i[4] ||= (e) => l.value = !1
4980
+ onClose: a[4] ||= (e) => u.value = !1
4949
4981
  }, null, 8, [
4950
4982
  "context",
4951
4983
  "upload-asset",
4952
4984
  "overlay-target"
4953
4985
  ])) : s("", !0)]));
4954
4986
  }
4955
- }), ui = Symbol();
4956
- function di(e = {}) {
4957
- let t = { ...N(e) }, n = a(() => N(e)), r = D(!1), i, o, s;
4958
- function c(e) {
4959
- o = e, i?.onSlash(e);
4960
- }
4961
- function l() {
4962
- let e = o;
4963
- c(void 0), e && !e.editor.isDestroyed && he(e.editor.view, (t.slashCommand || void 0)?.pluginKey ?? Ne);
4987
+ }), vi = Symbol();
4988
+ function yi(e = {}) {
4989
+ let t = { ...P(e) }, n = fi(), r = a(() => P(e)), i = O(!1), o, s, c;
4990
+ function l(e) {
4991
+ s = e, o?.onSlash(e);
4964
4992
  }
4965
4993
  function u() {
4966
- s && me(s.editor);
4994
+ let e = s;
4995
+ l(void 0), e && !e.editor.isDestroyed && he(e.editor.view, (t.slashCommand || void 0)?.pluginKey ?? Pe);
4967
4996
  }
4968
- function d(e) {
4969
- if (i) throw Error("useVibeTiptap already has a mounted editor view");
4970
- return l(), u(), i = e, () => {
4971
- i = void 0, l(), u(), r.value = !1;
4997
+ function d() {
4998
+ c && me(c.editor);
4999
+ }
5000
+ function f(e) {
5001
+ if (o) throw Error("useVibeTiptap already has a mounted editor view");
5002
+ return u(), d(), o = e, () => {
5003
+ o = void 0, u(), d(), i.value = !1;
4972
5004
  };
4973
5005
  }
4974
- let f = {
4975
- onOpen: c,
4976
- onUpdate: c,
4977
- onClose: () => c(void 0),
4978
- onExecute: (e) => i?.onExecute(e)
5006
+ let p = {
5007
+ onOpen: l,
5008
+ onUpdate: l,
5009
+ onClose: () => l(void 0),
5010
+ onExecute: (e) => o?.onExecute(e)
4979
5011
  };
4980
- function p(e) {
4981
- s = e, i?.onMention(e);
5012
+ function m(e) {
5013
+ c = e, o?.onMention(e);
4982
5014
  }
4983
- let m = t.mention || void 0, h = m && {
4984
- ...m,
5015
+ let h = t.mention || void 0, g = h && {
5016
+ ...h,
4985
5017
  onOpen(e) {
4986
- p(e), m.onOpen?.(e);
5018
+ m(e), h.onOpen?.(e);
4987
5019
  },
4988
5020
  onUpdate(e) {
4989
- p(e), m.onUpdate?.(e);
5021
+ m(e), h.onUpdate?.(e);
4990
5022
  },
4991
5023
  onClose() {
4992
- p(void 0), m.onClose?.();
5024
+ m(void 0), h.onClose?.();
4993
5025
  }
4994
- }, g = Ie({
5026
+ }, _ = Le({
4995
5027
  ...t,
4996
5028
  content: t.initialContent,
4997
- editable: () => (n.value.editable ?? !0) && !r.value,
5029
+ mediaResources: t.mediaResources ?? n?.value.mediaResources,
5030
+ editable: () => (r.value.editable ?? !0) && !i.value,
4998
5031
  get uploadAsset() {
4999
- return n.value.uploadAsset;
5032
+ return r.value.uploadAsset;
5000
5033
  },
5001
5034
  get editorBehaviorOptions() {
5002
- return n.value.editorBehaviorOptions;
5035
+ return r.value.editorBehaviorOptions;
5003
5036
  },
5004
5037
  slashCommand: t.slashCommand ?? {},
5005
- mention: h,
5038
+ mention: g,
5006
5039
  editorProps: {
5007
5040
  ...t.editorProps,
5008
5041
  handleDOMEvents: {
5009
5042
  ...t.editorProps?.handleDOMEvents,
5010
5043
  paste(e, t) {
5011
- return n.value.editorProps?.handleDOMEvents?.paste?.(e, t) ? !0 : (v.value?.onPaste(t), t.defaultPrevented);
5044
+ return r.value.editorProps?.handleDOMEvents?.paste?.(e, t) ? !0 : (y.value?.onPaste(t), t.defaultPrevented);
5012
5045
  },
5013
5046
  drop(e, t) {
5014
- return n.value.editorProps?.handleDOMEvents?.drop?.(e, t) ? !0 : (v.value?.onDrop(t), t.defaultPrevented);
5047
+ return r.value.editorProps?.handleDOMEvents?.drop?.(e, t) ? !0 : (y.value?.onDrop(t), t.defaultPrevented);
5015
5048
  }
5016
5049
  }
5017
5050
  },
5018
- onUpdate: (...e) => n.value.onUpdate?.(...e),
5051
+ onUpdate: (...e) => r.value.onUpdate?.(...e),
5019
5052
  onImagePreview(e) {
5020
- i?.onImagePreview(e), n.value.onImagePreview?.(e);
5053
+ o?.onImagePreview(e), r.value.onImagePreview?.(e);
5021
5054
  },
5022
5055
  notify(e, t = "info") {
5023
- (n.value.notify ?? i?.notify)?.(e, t);
5056
+ (r.value.notify ?? o?.notify)?.(e, t);
5024
5057
  }
5025
- }, t.slashCommand === !1 ? void 0 : f), v = a(() => {
5026
- let e = g.value;
5027
- if (e?.editor.schema.nodes.image) return fe(e.core, () => n.value.uploadAsset, () => n.value.editorBehaviorOptions);
5058
+ }, t.slashCommand === !1 ? void 0 : p), y = a(() => {
5059
+ let e = _.value;
5060
+ if (e?.editor.schema.nodes.image) return fe(e.core, () => r.value.uploadAsset, () => r.value.editorBehaviorOptions);
5028
5061
  });
5029
- return _({
5030
- context: g,
5031
- [ui]: {
5032
- bind: d,
5033
- closeSlashMenu: l,
5034
- preview: r,
5035
- editable: a(() => n.value.editable ?? !0),
5036
- mentionHoverDelay: m?.hoverDelay,
5062
+ return v({
5063
+ context: _,
5064
+ [vi]: {
5065
+ bind: f,
5066
+ closeSlashMenu: u,
5067
+ preview: i,
5068
+ editable: a(() => r.value.editable ?? !0),
5069
+ mentionHoverDelay: h?.hoverDelay,
5037
5070
  codeBlockLanguages: t.codeBlockLanguages,
5038
5071
  horizontalRules: t.horizontalRules,
5039
- uploadAsset: a(() => n.value.uploadAsset),
5040
- editorBehaviorOptions: a(() => n.value.editorBehaviorOptions)
5072
+ uploadAsset: a(() => r.value.uploadAsset),
5073
+ editorBehaviorOptions: a(() => r.value.editorBehaviorOptions)
5041
5074
  }
5042
5075
  });
5043
5076
  }
5044
5077
  // src/naive-tiptap-editor-inner.vue?vue&type=script&setup=true&lang.ts
5045
- var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi = /* @__PURE__ */ p({
5078
+ var bi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], xi = /* @__PURE__ */ p({
5046
5079
  inheritAttrs: !1,
5047
5080
  __name: "naive-tiptap-editor-inner",
5048
5081
  props: {
5049
5082
  editor: {},
5050
- showWordCount: { type: Boolean },
5051
5083
  renderMentionPopover: { type: Function },
5084
+ showWordCount: { type: Boolean },
5052
5085
  toolbar: { type: [Array, Boolean] },
5053
5086
  toolbarOptions: {},
5054
5087
  colors: {},
@@ -5058,14 +5091,14 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5058
5091
  },
5059
5092
  emits: ["fullscreen-target"],
5060
5093
  setup(e, { emit: t }) {
5061
- let n = e, i = ({ target: e }) => n.renderMentionPopover?.(e), l = t, d = a(() => n.editor[ui]), p = a(() => n.editor.context.value), h = a({
5094
+ let n = e, i = ({ target: e }) => n.renderMentionPopover?.(e), l = t, d = a(() => n.editor[vi]), p = a(() => n.editor.context.value), h = a({
5062
5095
  get: () => d.value.preview.value,
5063
5096
  set: (e) => {
5064
5097
  d.value.preview.value = e;
5065
5098
  }
5066
- }), _ = a(() => d.value.uploadAsset.value), y = a(() => d.value.editorBehaviorOptions.value), x = le(), S = ue();
5067
- E(er, j());
5068
- let C = g("n-config-provider", null), w = a(() => C?.mergedThemeRef.value?.name === ce.name ? "dark" : "light"), O = a(() => ({
5099
+ }), g = a(() => d.value.uploadAsset.value), v = a(() => d.value.editorBehaviorOptions.value), b = ce(), S = le();
5100
+ D(tr, M());
5101
+ let C = _("n-config-provider", null), w = a(() => C?.mergedThemeRef.value?.name === se.name ? "dark" : "light"), T = a(() => ({
5069
5102
  colorScheme: w.value,
5070
5103
  "--vibe-tiptap-bg": S.value.cardColor,
5071
5104
  "--vibe-tiptap-bg-soft": S.value.hoverColor,
@@ -5075,47 +5108,47 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5075
5108
  "--vibe-tiptap-text-muted": S.value.textColor3,
5076
5109
  "--vibe-tiptap-primary": S.value.primaryColor,
5077
5110
  "--vibe-tiptap-code-bg": S.value.codeColor
5078
- })), A = a(() => !!_.value), M = a(() => Ke(n.colors, n.highlights)), N = j([]), I = D(0), z = D(!1);
5079
- function B(e) {
5080
- N.value = [...e.urls], I.value = e.index, z.value = !0;
5111
+ })), k = a(() => !!g.value), j = a(() => qe(n.colors, n.highlights)), N = M([]), P = O(0), L = O(!1);
5112
+ function ee(e) {
5113
+ N.value = [...e.urls], P.value = e.index, L.value = !0;
5081
5114
  }
5082
- let V = D(), H = D(!1), ee = a(() => {
5083
- let e = V.value;
5115
+ let B = O(), V = O(!1), H = a(() => {
5116
+ let e = B.value;
5084
5117
  return e?.ownerDocument.fullscreenEnabled && typeof e.requestFullscreen == "function";
5085
- }), U = a(() => H.value ? V.value : void 0), W = !1;
5086
- function G(e) {
5087
- let t = V.value;
5088
- t && e.target === t && (H.value = t.ownerDocument.fullscreenElement === t, l("fullscreen-target", U.value));
5118
+ }), U = a(() => V.value ? B.value : void 0), te = !1;
5119
+ function W(e) {
5120
+ let t = B.value;
5121
+ t && e.target === t && (V.value = t.ownerDocument.fullscreenElement === t, l("fullscreen-target", U.value));
5089
5122
  }
5090
- async function ne(e) {
5091
- let t = V.value;
5092
- if (t && !W && e !== H.value) {
5093
- W = !0;
5123
+ async function G(e) {
5124
+ let t = B.value;
5125
+ if (t && !te && e !== V.value) {
5126
+ te = !0;
5094
5127
  try {
5095
5128
  e ? await t.requestFullscreen() : await t.ownerDocument.exitFullscreen();
5096
5129
  } catch {
5097
5130
  let e = p.value;
5098
5131
  e && e.notify(e.t("notify.fullscreenFailed"), "warning");
5099
5132
  } finally {
5100
- W = !1;
5133
+ te = !1;
5101
5134
  }
5102
5135
  }
5103
5136
  }
5104
- F(() => n.toolbar !== !1 && (n.toolbar?.some((e) => e.includes("preview")) ?? !0), (e) => {
5137
+ I(() => n.toolbar !== !1 && (n.toolbar?.some((e) => e.includes("preview")) ?? !0), (e) => {
5105
5138
  e || (h.value = !1);
5106
5139
  });
5107
- let K = j(), q = j(), re = D(!1);
5108
- function J() {
5109
- re.value = !0;
5140
+ let K = M(), q = M(), J = O(!1);
5141
+ function re() {
5142
+ J.value = !0;
5110
5143
  }
5111
- let ie = D(!1), ae = D(), Y = D(), oe = D(), se = D(!1), X = a(() => {
5144
+ let ie = O(!1), ae = O(), Y = O(), X = O(), oe = O(!1), Z = a(() => {
5112
5145
  let e = p.value;
5113
5146
  return e ? (e.revision.value, e.editor.isEditable) : d.value.editable.value;
5114
- }), fe = a(() => X.value && !!(q.value || K.value || ie.value || Y.value?.visible || se.value && oe.value?.visible));
5115
- function pe() {
5147
+ }), de = a(() => Z.value && !!(q.value || K.value || ie.value || Y.value?.visible || oe.value && X.value?.visible));
5148
+ function fe() {
5116
5149
  d.value.closeSlashMenu();
5117
5150
  }
5118
- L((e) => {
5151
+ R((e) => {
5119
5152
  let t = d.value.bind({
5120
5153
  onMention: (e) => {
5121
5154
  K.value = e;
@@ -5124,36 +5157,36 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5124
5157
  q.value = e;
5125
5158
  },
5126
5159
  onExecute: ({ item: e }) => {
5127
- p.value && je(p.value, e, {
5160
+ p.value && Me(p.value, e, {
5128
5161
  onImage: () => Y.value?.open("image"),
5129
5162
  onImageUrl: () => Y.value?.open("image", void 0, "url"),
5130
- onWhiteboard: J,
5163
+ onWhiteboard: re,
5131
5164
  onVideo: () => Y.value?.open("video"),
5132
5165
  onVideoUrl: () => Y.value?.open("video", void 0, "url"),
5133
5166
  onAudio: () => Y.value?.open("audio"),
5134
5167
  onAudioUrl: () => Y.value?.open("audio", void 0, "url"),
5135
5168
  onUpload: () => Y.value?.open("attachment"),
5136
- onLink: () => he(void 0, !0)
5169
+ onLink: () => me(void 0, !0)
5137
5170
  });
5138
5171
  },
5139
- onImagePreview: B,
5140
- notify: (e, t = "info") => x[t](e)
5172
+ onImagePreview: ee,
5173
+ notify: (e, t = "info") => b[t](e)
5141
5174
  });
5142
5175
  e(() => {
5143
- t(), q.value = void 0, K.value = void 0, z.value = !1, N.value = [], re.value = !1, ie.value = !1, se.value = !1;
5176
+ t(), q.value = void 0, K.value = void 0, L.value = !1, N.value = [], J.value = !1, ie.value = !1, oe.value = !1;
5144
5177
  });
5145
- }), F(X, (e) => {
5146
- e || pe();
5178
+ }), I(Z, (e) => {
5179
+ e || fe();
5147
5180
  });
5148
- function me(e) {
5181
+ function pe(e) {
5149
5182
  if (e.defaultPrevented || e.isComposing || e.altKey || e.shiftKey || !(e.ctrlKey || e.metaKey) || e.key.toLowerCase() !== "f") return;
5150
5183
  let t = p.value;
5151
5184
  t && typeof t.editor.commands.openFindReplace == "function" && (e.preventDefault(), e.target instanceof Element && e.target.closest(".vibe-naive-tiptap__find") ? ae.value?.focusQuery() : t.commands.openFindReplace());
5152
5185
  }
5153
- function he(e, t = !1) {
5154
- se.value = t, oe.value?.open(void 0, e);
5186
+ function me(e, t = !1) {
5187
+ oe.value = t, X.value?.open(void 0, e);
5155
5188
  }
5156
- function ge(e) {
5189
+ function he(e) {
5157
5190
  let t = p.value?.editor;
5158
5191
  if (!t?.isEditable || e.defaultPrevented || e.button !== 0 || e.shiftKey || e.ctrlKey || e.metaKey || e.altKey || !(e.target instanceof Element)) return;
5159
5192
  let n = e.target.closest("a[href]"), { view: r, state: i } = t, a = i.schema.marks.link;
@@ -5164,28 +5197,28 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5164
5197
  if (!c) return;
5165
5198
  let l = c.attrs.href;
5166
5199
  if (typeof l != "string" || !l || l !== n.getAttribute("href")) return;
5167
- let u = de(o, a, c.attrs);
5200
+ let u = ue(o, a, c.attrs);
5168
5201
  if (!u) return;
5169
5202
  e.preventDefault();
5170
5203
  let { from: d, to: f } = i.selection;
5171
5204
  (d < u.from || d >= u.to || f > u.to) && t.commands.setTextSelection(u), r.focus();
5172
5205
  }
5173
- return (t, n) => (T(), c("div", v({
5206
+ return (t, n) => (E(), c("div", y({
5174
5207
  ref_key: "root",
5175
- ref: V,
5208
+ ref: B,
5176
5209
  class: "vibe-naive-tiptap"
5177
5210
  }, t.$attrs, {
5178
5211
  "data-vibe-tiptap-color-scheme": w.value,
5179
- "data-vibe-tiptap-scroll-locked": fe.value ? "" : void 0,
5180
- style: O.value,
5181
- onKeydown: me,
5182
- onFullscreenchange: G
5183
- }), [p.value ? (T(), c(r, { key: 0 }, [
5184
- e.toolbar === !1 ? s("", !0) : (T(), o(li, {
5212
+ "data-vibe-tiptap-scroll-locked": de.value ? "" : void 0,
5213
+ style: T.value,
5214
+ onKeydown: pe,
5215
+ onFullscreenchange: W
5216
+ }), [p.value ? (E(), c(r, { key: 0 }, [
5217
+ e.toolbar === !1 ? s("", !0) : (E(), o(_i, {
5185
5218
  key: 0,
5186
5219
  preview: h.value,
5187
5220
  "onUpdate:preview": n[0] ||= (e) => h.value = e,
5188
- fullscreen: ee.value || H.value ? H.value : void 0,
5221
+ fullscreen: H.value || V.value ? V.value : void 0,
5189
5222
  "overlay-target": U.value,
5190
5223
  context: p.value,
5191
5224
  toolbar: e.toolbar,
@@ -5196,10 +5229,10 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5196
5229
  highlights: e.highlights,
5197
5230
  "markdown-options": e.markdownOptions,
5198
5231
  "print-options": e.printOptions,
5199
- "editor-behavior-options": y.value,
5200
- "upload-asset": _.value,
5201
- "open-whiteboard": J,
5202
- "onUpdate:fullscreen": ne
5232
+ "editor-behavior-options": v.value,
5233
+ "upload-asset": g.value,
5234
+ "open-whiteboard": re,
5235
+ "onUpdate:fullscreen": G
5203
5236
  }, null, 8, [
5204
5237
  "preview",
5205
5238
  "fullscreen",
@@ -5216,32 +5249,32 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5216
5249
  "editor-behavior-options",
5217
5250
  "upload-asset"
5218
5251
  ])),
5219
- (T(), c("div", {
5252
+ (E(), c("div", {
5220
5253
  key: p.value.editor.instanceId,
5221
5254
  class: "vibe-naive-tiptap__body"
5222
5255
  }, [
5223
- f($n, {
5256
+ f(er, {
5224
5257
  ref_key: "findPanel",
5225
5258
  ref: ae,
5226
5259
  context: p.value,
5227
- editable: X.value,
5260
+ editable: Z.value,
5228
5261
  "overlay-target": U.value
5229
5262
  }, null, 8, [
5230
5263
  "context",
5231
5264
  "editable",
5232
5265
  "overlay-target"
5233
5266
  ]),
5234
- f(tt, {
5267
+ f(nt, {
5235
5268
  context: p.value,
5236
- tabindex: !X.value && typeof p.value.editor.commands.openFindReplace == "function" ? 0 : void 0,
5237
- onClick: ge,
5238
- onFocusout: pe
5269
+ tabindex: !Z.value && typeof p.value.editor.commands.openFindReplace == "function" ? 0 : void 0,
5270
+ onClick: he,
5271
+ onFocusout: fe
5239
5272
  }, null, 8, ["context", "tabindex"]),
5240
- f(P(te), {
5241
- show: z.value,
5242
- "onUpdate:show": n[1] ||= (e) => z.value = e,
5243
- current: I.value,
5244
- "onUpdate:current": n[2] ||= (e) => I.value = e,
5273
+ f(F(ne), {
5274
+ show: L.value,
5275
+ "onUpdate:show": n[1] ||= (e) => L.value = e,
5276
+ current: P.value,
5277
+ "onUpdate:current": n[2] ||= (e) => P.value = e,
5245
5278
  "show-toolbar-tooltip": "",
5246
5279
  "src-list": N.value
5247
5280
  }, null, 8, [
@@ -5249,24 +5282,24 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5249
5282
  "current",
5250
5283
  "src-list"
5251
5284
  ]),
5252
- e.renderMentionPopover || t.$slots["mention-popover"] ? (T(), o(vr, {
5285
+ e.renderMentionPopover || t.$slots["mention-popover"] ? (E(), o(xr, {
5253
5286
  key: 0,
5254
5287
  editor: p.value.editor.view.dom,
5255
5288
  "overlay-target": U.value,
5256
5289
  "hover-delay": d.value.mentionHoverDelay
5257
5290
  }, {
5258
- default: R((e) => [k(t.$slots, "mention-popover", b(m(e)), () => [f(i, { target: e.target }, null, 8, ["target"])])]),
5291
+ default: z((e) => [A(t.$slots, "mention-popover", x(m(e)), () => [f(i, { target: e.target }, null, 8, ["target"])])]),
5259
5292
  _: 3
5260
5293
  }, 8, [
5261
5294
  "editor",
5262
5295
  "overlay-target",
5263
5296
  "hover-delay"
5264
5297
  ])) : s("", !0),
5265
- X.value ? (T(), c(r, { key: 1 }, [
5266
- q.value ? (T(), o(Er, {
5298
+ Z.value ? (E(), c(r, { key: 1 }, [
5299
+ q.value ? (E(), o(kr, {
5267
5300
  key: 0,
5268
5301
  state: q.value,
5269
- "theme-style": O.value,
5302
+ "theme-style": T.value,
5270
5303
  "overlay-target": U.value,
5271
5304
  label: p.value.t("slashCommand.label"),
5272
5305
  "empty-label": p.value.t("slashCommand.empty"),
@@ -5279,15 +5312,15 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5279
5312
  "empty-label",
5280
5313
  "translate"
5281
5314
  ])) : s("", !0),
5282
- K.value ? (T(), o(mr, {
5315
+ K.value ? (E(), o(_r, {
5283
5316
  key: 1,
5284
5317
  state: K.value,
5285
- "theme-style": O.value,
5318
+ "theme-style": T.value,
5286
5319
  "overlay-target": U.value,
5287
5320
  t: p.value.t
5288
5321
  }, u({ _: 2 }, [t.$slots["mention-item"] ? {
5289
5322
  name: "mention-item",
5290
- fn: R((e) => [k(t.$slots, "mention-item", b(m(e)))]),
5323
+ fn: z((e) => [A(t.$slots, "mention-item", x(m(e)))]),
5291
5324
  key: "0"
5292
5325
  } : void 0]), 1032, [
5293
5326
  "state",
@@ -5295,13 +5328,13 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5295
5328
  "overlay-target",
5296
5329
  "t"
5297
5330
  ])) : s("", !0),
5298
- f(qn, {
5331
+ f(Jn, {
5299
5332
  context: p.value,
5300
- "can-upload-image": A.value,
5301
- "upload-asset": _.value,
5302
- palette: M.value,
5333
+ "can-upload-image": k.value,
5334
+ "upload-asset": g.value,
5335
+ palette: j.value,
5303
5336
  "overlay-target": U.value,
5304
- onOpenLink: he,
5337
+ onOpenLink: me,
5305
5338
  onPaletteVisibilityChange: n[3] ||= (e) => ie.value = e
5306
5339
  }, null, 8, [
5307
5340
  "context",
@@ -5310,18 +5343,18 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5310
5343
  "palette",
5311
5344
  "overlay-target"
5312
5345
  ]),
5313
- f(kr, {
5346
+ f(Mr, {
5314
5347
  context: p.value,
5315
5348
  "overlay-target": U.value
5316
5349
  }, null, 8, ["context", "overlay-target"])
5317
5350
  ], 64)) : s("", !0)
5318
5351
  ])),
5319
- f(ar, {
5352
+ f(or, {
5320
5353
  ref_key: "linkPopover",
5321
- ref: oe,
5354
+ ref: X,
5322
5355
  context: p.value,
5323
5356
  "default-target": p.value.core.defaultLinkTarget,
5324
- editable: X.value,
5357
+ editable: Z.value,
5325
5358
  "overlay-target": U.value
5326
5359
  }, null, 8, [
5327
5360
  "context",
@@ -5329,14 +5362,14 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5329
5362
  "editable",
5330
5363
  "overlay-target"
5331
5364
  ]),
5332
- f(lr, {
5365
+ f(ur, {
5333
5366
  ref_key: "mediaPopovers",
5334
5367
  ref: Y,
5335
5368
  context: p.value,
5336
- editable: X.value,
5369
+ editable: Z.value,
5337
5370
  "overlay-target": U.value,
5338
- "editor-behavior-options": y.value,
5339
- "can-upload": A.value
5371
+ "editor-behavior-options": v.value,
5372
+ "can-upload": k.value
5340
5373
  }, null, 8, [
5341
5374
  "context",
5342
5375
  "editable",
@@ -5344,33 +5377,33 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5344
5377
  "editor-behavior-options",
5345
5378
  "can-upload"
5346
5379
  ]),
5347
- re.value && X.value && _.value ? (T(), o(Bn, {
5380
+ J.value && Z.value && g.value ? (E(), o(Vn, {
5348
5381
  key: 1,
5349
5382
  context: p.value,
5350
- "upload-asset": _.value,
5383
+ "upload-asset": g.value,
5351
5384
  "overlay-target": U.value,
5352
- onClose: n[4] ||= (e) => re.value = !1
5385
+ onClose: n[4] ||= (e) => J.value = !1
5353
5386
  }, null, 8, [
5354
5387
  "context",
5355
5388
  "upload-asset",
5356
5389
  "overlay-target"
5357
5390
  ])) : s("", !0),
5358
- e.showWordCount ?? !0 ? (T(), o(Or, {
5391
+ e.showWordCount ?? !0 ? (E(), o(jr, {
5359
5392
  key: 2,
5360
5393
  context: p.value
5361
5394
  }, null, 8, ["context"])) : s("", !0)
5362
- ], 64)) : s("", !0)], 16, fi));
5395
+ ], 64)) : s("", !0)], 16, bi));
5363
5396
  }
5364
- }), mi = /* @__PURE__ */ p({
5397
+ }), Si = /* @__PURE__ */ p({
5365
5398
  inheritAttrs: !1,
5366
5399
  __name: "naive-tiptap-editor",
5367
5400
  props: {
5368
5401
  editor: {},
5402
+ renderMentionPopover: {},
5369
5403
  showWordCount: {
5370
5404
  type: Boolean,
5371
- default: !0
5405
+ default: void 0
5372
5406
  },
5373
- renderMentionPopover: {},
5374
5407
  toolbar: {
5375
5408
  type: [Array, Boolean],
5376
5409
  default: void 0
@@ -5382,22 +5415,49 @@ var fi = ["data-vibe-tiptap-color-scheme", "data-vibe-tiptap-scroll-locked"], pi
5382
5415
  printOptions: {}
5383
5416
  },
5384
5417
  setup(e) {
5385
- let t = D();
5386
- return (e, n) => (T(), o(P(ne), { to: t.value }, {
5387
- default: R(() => [f(pi, v({
5418
+ let t = mi(e), n = O();
5419
+ return (e, r) => (E(), o(F(K), { to: n.value }, {
5420
+ default: z(() => [f(xi, y({
5388
5421
  ...e.$props,
5422
+ ...F(t),
5423
+ showWordCount: F(t).showWordCount ?? !0,
5389
5424
  ...e.$attrs
5390
- }, { onFullscreenTarget: n[0] ||= (e) => t.value = e }), u({ _: 2 }, [e.$slots["mention-item"] ? {
5425
+ }, { onFullscreenTarget: r[0] ||= (e) => n.value = e }), u({ _: 2 }, [e.$slots["mention-item"] ? {
5391
5426
  name: "mention-item",
5392
- fn: R((t) => [k(e.$slots, "mention-item", b(m(t)))]),
5427
+ fn: z((t) => [A(e.$slots, "mention-item", x(m(t)))]),
5393
5428
  key: "0"
5394
5429
  } : void 0, e.$slots["mention-popover"] ? {
5395
5430
  name: "mention-popover",
5396
- fn: R((t) => [k(e.$slots, "mention-popover", b(m(t)))]),
5431
+ fn: z((t) => [A(e.$slots, "mention-popover", x(m(t)))]),
5397
5432
  key: "1"
5398
5433
  } : void 0]), 1040)]),
5399
5434
  _: 3
5400
5435
  }, 8, ["to"]));
5401
5436
  }
5437
+ }), Ci = /* @__PURE__ */ p({
5438
+ __name: "vibe-tiptap-provider",
5439
+ props: {
5440
+ mediaResources: {},
5441
+ showWordCount: {
5442
+ type: Boolean,
5443
+ default: void 0
5444
+ },
5445
+ toolbar: {
5446
+ type: [Array, Boolean],
5447
+ default: void 0
5448
+ },
5449
+ toolbarOptions: {},
5450
+ colors: {},
5451
+ highlights: {},
5452
+ markdownOptions: {},
5453
+ printOptions: {}
5454
+ },
5455
+ setup(e) {
5456
+ let t = e, n = fi();
5457
+ return D(di, a(() => ({
5458
+ ...pi(t, n?.value),
5459
+ mediaResources: t.mediaResources ?? n?.value.mediaResources
5460
+ }))), (e, t) => A(e.$slots, "default");
5461
+ }
5402
5462
  });
5403
- export { ni as DEFAULT_CODE_BLOCK_LANGUAGES, ri as DEFAULT_HORIZONTAL_RULES, $r as NAIVE_UI_DEFAULT_TOOLBAR, tt as NaiveTiptapContent, mi as NaiveTiptapEditor, mi as VibeTiptap, Or as NaiveTiptapStatusBar, li as NaiveTiptapToolbar, Ge as PRESET_HIGHLIGHT_COLORS, We as PRESET_TEXT_COLORS, ai as TOOLBAR_ALIGN_OPTIONS, ti as TOOLBAR_HEADING_OPTIONS, Ue as TOOLBAR_HEADING_PREVIEW_STYLES, Je as TOOLBAR_MARKDOWN_IMPORT_ACCEPT, Ye as TOOLBAR_MARKDOWN_OPTIONS, ii as TOOLBAR_TABLE_GRID, et as copyMarkdown, $e as exportMarkdownFile, Qe as importMarkdownFile, ei as normalizeToolbarConfig, Qr as printEditorContent, di as useVibeTiptap };
5463
+ export { ai as DEFAULT_CODE_BLOCK_LANGUAGES, oi as DEFAULT_HORIZONTAL_RULES, ni as NAIVE_UI_DEFAULT_TOOLBAR, nt as NaiveTiptapContent, Si as NaiveTiptapEditor, Si as VibeTiptap, jr as NaiveTiptapStatusBar, _i as NaiveTiptapToolbar, Ke as PRESET_HIGHLIGHT_COLORS, Ge as PRESET_TEXT_COLORS, ci as TOOLBAR_ALIGN_OPTIONS, ii as TOOLBAR_HEADING_OPTIONS, We as TOOLBAR_HEADING_PREVIEW_STYLES, Ye as TOOLBAR_MARKDOWN_IMPORT_ACCEPT, Xe as TOOLBAR_MARKDOWN_OPTIONS, si as TOOLBAR_TABLE_GRID, Ci as VibeTiptapProvider, tt as copyMarkdown, et as exportMarkdownFile, $e as importMarkdownFile, ri as normalizeToolbarConfig, ti as printEditorContent, yi as useVibeTiptap };