@vibe-tiptap/shadcn-ui 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,113 +4,114 @@ import { PRESET_HIGHLIGHT_COLORS as e, PRESET_TEXT_COLORS as t, TOOLBAR_HEADING_
4
4
  import { TOOLBAR_MARKDOWN_IMPORT_ACCEPT as a, TOOLBAR_MARKDOWN_OPTIONS as o, TOOLBAR_MARKDOWN_OPTIONS as s, copyMarkdown as c, copyMarkdown as l, exportMarkdownFile as u, exportMarkdownFile as d, importMarkdownFile as f, importMarkdownFile as p, resolveMarkdownFileOptions as m } from "@vibe-tiptap/editor-ui/markdown-file";
5
5
  import { printEditorContent as h, printEditorContent as g } from "@vibe-tiptap/editor-ui/print-editor-content";
6
6
  import { DEFAULT_CODE_BLOCK_LANGUAGES as _, DEFAULT_HORIZONTAL_RULES as v, NAIVE_UI_DEFAULT_TOOLBAR as y, TOOLBAR_ALIGN_OPTIONS as b, TOOLBAR_ALIGN_OPTIONS as x, TOOLBAR_HEADING_OPTIONS as S, TOOLBAR_HEADING_OPTIONS as C, TOOLBAR_TABLE_GRID as w, normalizeToolbarConfig as T, normalizeToolbarConfig as E, resolveToolbarMenuOptions as ee } from "@vibe-tiptap/editor-ui/toolbar-config";
7
- import { BubbleMenu as D, EditorContent as O, canSetMediaDisplay as k, createImageDropPasteHandlers as A, detectFileAttachmentType as j, exitSlashCommand as te, formatFileSize as M, getActiveHeadingLevel as ne, getActiveLinkRange as re, getActiveTextAlign as ie, getMediaInsertionNodeType as N, getNativeMarkdownManager as P, getSelectedFileAttachment as F, isFindReplaceOpenTransaction as I, isToolbarCommandActive as ae, isToolbarCommandEnabled as L, normalizeHttpUrl as oe, normalizeSlashCommandInput as se, notifyAssetUploadFailure as R, resolveEditorBehaviorOptions as ce, runSlashCommandItem as z, runToolbarCommand as B, slashCommandPluginKey as le, startWhiteboardDrawing as ue, trackUploadRange as de, useReactEditor as fe, useReactEditorState as V, validateAssetFile as pe } from "@vibe-tiptap/react-adapter";
8
- import { Fragment as me, jsx as H, jsxs as U } from "react/jsx-runtime";
9
- import { getMarkRange as he } from "@tiptap/core";
10
- import { cloneElement as ge, createContext as _e, createElement as ve, forwardRef as ye, memo as be, useCallback as xe, useContext as Se, useEffect as W, useId as Ce, useLayoutEffect as G, useMemo as we, useRef as K, useState as q } from "react";
11
- import { NodeSelection as Te, TextSelection as Ee } from "@tiptap/pm/state";
12
- import { AlignCenter as De, AlignJustify as Oe, AlignLeft as ke, AlignRight as Ae, ArrowDown as je, ArrowLeft as Me, ArrowRight as Ne, ArrowUp as Pe, Bold as Fe, Captions as Ie, CaseSensitive as Le, ChevronDown as Re, ChevronLeft as ze, ChevronRight as Be, ChevronUp as Ve, Code as He, CodeXml as Ue, Copy as We, Download as Ge, Ellipsis as Ke, EllipsisVertical as qe, Eraser as Je, ExternalLink as Ye, Eye as Xe, Film as Ze, Heading1 as Qe, Heading2 as $e, Heading3 as et, Heading4 as tt, Heading5 as nt, Heading6 as rt, Highlighter as it, Image as at, ImagePlay as ot, ImagePlus as st, ImageUp as ct, IndentDecrease as lt, IndentIncrease as ut, Italic as dt, Link as ft, List as pt, ListChecks as mt, ListOrdered as ht, LoaderCircle as gt, Maximize2 as _t, Minimize2 as vt, Minus as yt, Music as bt, Palette as xt, Paperclip as St, Pencil as Ct, PencilRuler as wt, Pilcrow as Tt, Plus as Et, Printer as Dt, Quote as Ot, Redo2 as kt, Replace as At, ReplaceAll as jt, RotateCcw as Mt, RotateCw as Nt, Search as Pt, Strikethrough as Ft, Subscript as It, Superscript as Lt, Table as Rt, TableProperties as zt, Trash2 as Bt, TvMinimalPlay as Vt, Underline as Ht, Undo2 as Ut, Unlink as Wt, Video as Gt, Workflow as Kt, X as qt, ZoomIn as Jt, ZoomOut as Yt } from "lucide-react";
13
- import { twMerge as J } from "tailwind-merge";
14
- import { FIRST_LINE_INDENT_ICON as Xt, MARKDOWN_ACTION_ICON_PATHS as Zt, MARKDOWN_ACTION_ICON_TRANSFORM as Qt, MARKDOWN_ICON as $t, TOOLBAR_ICON_VIEW_BOX as en } from "@vibe-tiptap/editor-ui/custom-icons";
15
- import { TransformComponent as tn, TransformWrapper as nn } from "react-zoom-pan-pinch";
16
- import { createPortal as rn } from "react-dom";
17
- import { TableMap as an, cellAround as on } from "@tiptap/pm/tables";
7
+ import { BubbleMenu as D, EditorContent as O, canSetMediaDisplay as k, createImageDropPasteHandlers as A, detectFileAttachmentType as j, exitMention as te, exitSlashCommand as M, formatFileSize as N, getActiveHeadingLevel as P, getActiveLinkRange as F, getActiveTextAlign as ne, getMediaInsertionNodeType as re, getMentionTarget as ie, getNativeMarkdownManager as ae, getSelectedFileAttachment as I, isFindReplaceOpenTransaction as L, isToolbarCommandActive as oe, isToolbarCommandEnabled as R, normalizeHttpUrl as se, normalizeSlashCommandInput as z, notifyAssetUploadFailure as ce, resolveEditorBehaviorOptions as B, runSlashCommandItem as le, runToolbarCommand as ue, slashCommandPluginKey as de, startWhiteboardDrawing as V, trackUploadRange as fe, useReactEditor as pe, useReactEditorState as H, validateAssetFile as me } from "@vibe-tiptap/react-adapter";
8
+ import { Fragment as he, jsx as U, jsxs as W } from "react/jsx-runtime";
9
+ import { getMarkRange as ge } from "@tiptap/core";
10
+ import { cloneElement as _e, createContext as ve, createElement as ye, forwardRef as be, memo as xe, useCallback as Se, useContext as Ce, useEffect as G, useId as we, useLayoutEffect as K, useMemo as Te, useRef as q, useState as J } from "react";
11
+ import { NodeSelection as Ee, TextSelection as De } from "@tiptap/pm/state";
12
+ import { AlignCenter as Oe, AlignJustify as ke, AlignLeft as Ae, AlignRight as je, ArrowDown as Me, ArrowLeft as Ne, ArrowRight as Pe, ArrowUp as Fe, Bold as Ie, Captions as Le, CaseSensitive as Re, ChevronDown as ze, ChevronLeft as Be, ChevronRight as Ve, ChevronUp as He, Code as Ue, CodeXml as We, Copy as Ge, Download as Ke, Ellipsis as qe, EllipsisVertical as Je, Eraser as Ye, ExternalLink as Xe, Eye as Ze, Film as Qe, Heading1 as $e, Heading2 as et, Heading3 as tt, Heading4 as nt, Heading5 as rt, Heading6 as it, Highlighter as at, Image as ot, ImagePlay as st, ImagePlus as ct, ImageUp as lt, IndentDecrease as ut, IndentIncrease as dt, Italic as ft, Link as pt, List as mt, ListChecks as ht, ListOrdered as gt, LoaderCircle as _t, Maximize2 as vt, Minimize2 as yt, Minus as bt, Music as xt, Palette as St, Paperclip as Ct, Pencil as wt, PencilRuler as Tt, Pilcrow as Et, Plus as Dt, Printer as Ot, Quote as kt, Redo2 as At, Replace as jt, ReplaceAll as Mt, RotateCcw as Nt, RotateCw as Pt, Search as Ft, Strikethrough as It, Subscript as Lt, Superscript as Rt, Table as zt, TableProperties as Bt, Trash2 as Vt, TvMinimalPlay as Ht, Underline as Ut, Undo2 as Wt, Unlink as Gt, Video as Kt, Workflow as qt, X as Jt, ZoomIn as Yt, ZoomOut as Xt } from "lucide-react";
13
+ import { twMerge as Y } from "tailwind-merge";
14
+ import { FIRST_LINE_INDENT_ICON as Zt, MARKDOWN_ACTION_ICON_PATHS as Qt, MARKDOWN_ACTION_ICON_TRANSFORM as $t, MARKDOWN_ICON as en, TOOLBAR_ICON_VIEW_BOX as tn } from "@vibe-tiptap/editor-ui/custom-icons";
15
+ import { TransformComponent as nn, TransformWrapper as rn } from "react-zoom-pan-pinch";
16
+ import { createPortal as an } from "react-dom";
17
+ import { bindMentionHover as on } from "@vibe-tiptap/editor-ui/mention-hover";
18
+ import { TableMap as sn, cellAround as cn } from "@tiptap/pm/tables";
18
19
  // src/editor-content.tsx
19
- function sn({ context: e, className: t, ...n }) {
20
- return /* @__PURE__ */ H(O, {
20
+ function ln({ context: e, className: t, ...n }) {
21
+ return /* @__PURE__ */ U(O, {
21
22
  ...n,
22
23
  editor: e.editor,
23
24
  className: ["vibe-shadcn-tiptap__content", t].filter(Boolean).join(" ")
24
25
  });
25
26
  }
26
- function cn({ context: e }) {
27
- let t = V(e, (e) => e.wordCount.characters) ?? 0;
28
- return /* @__PURE__ */ H("div", {
27
+ function un({ context: e }) {
28
+ let t = H(e, (e) => e.wordCount.characters) ?? 0;
29
+ return /* @__PURE__ */ U("div", {
29
30
  className: "vibe-shadcn-tiptap__status",
30
31
  "aria-live": "polite",
31
32
  children: e.t("wordCount.characters", { count: t })
32
33
  });
33
34
  }
34
35
  // src/components.ts
35
- var ln = _e(void 0), un = ln.Provider;
36
- function Y() {
37
- let e = Se(ln);
36
+ var dn = ve(void 0), fn = dn.Provider;
37
+ function X() {
38
+ let e = Ce(dn);
38
39
  if (!e) throw Error("ShadcnTiptap requires a components mapping.");
39
40
  return e;
40
41
  }
41
42
  // src/ui-styles.ts
42
- var X = "flex flex-wrap items-center gap-1", dn = "rounded-md border border-border bg-[var(--popover,var(--vibe-tiptap-bg))] text-[color:var(--popover-foreground,var(--vibe-tiptap-text))] shadow-md", fn = {
43
+ var Z = "flex flex-wrap items-center gap-1", pn = "rounded-md border border-border bg-[var(--popover,var(--vibe-tiptap-bg))] text-[color:var(--popover-foreground,var(--vibe-tiptap-text))] shadow-md", mn = {
43
44
  default: void 0,
44
45
  outline: "border border-input bg-background dark:bg-background",
45
46
  ghost: "border-transparent bg-transparent shadow-none dark:bg-transparent"
46
- }, pn = _e(void 0), Z = pn.Provider;
47
- function mn(e) {
48
- let t = Se(pn);
47
+ }, hn = ve(void 0), gn = hn.Provider;
48
+ function _n(e) {
49
+ let t = Ce(hn);
49
50
  return {
50
51
  size: e?.size ?? t?.size,
51
52
  variant: e?.variant ?? t?.variant,
52
- className: J(t?.className, e?.className)
53
+ className: Y(t?.className, e?.className)
53
54
  };
54
55
  }
55
- var Q = ye(function({ appearance: e, className: t, defaultSizeClassName: n, size: r, variant: i, ...a }, o) {
56
- let { Button: s } = Y(), c = mn(e);
57
- return /* @__PURE__ */ H(s, {
56
+ var Q = be(function({ appearance: e, className: t, defaultSizeClassName: n, size: r, variant: i, ...a }, o) {
57
+ let { Button: s } = X(), c = _n(e);
58
+ return /* @__PURE__ */ U(s, {
58
59
  ...a,
59
60
  ref: o,
60
61
  size: c.size ?? r,
61
62
  variant: c.variant ?? i,
62
- className: J(t, c.size === void 0 && n, c.className)
63
+ className: Y(t, c.size === void 0 && n, c.className)
63
64
  });
64
65
  });
65
- function hn({ appearance: e, children: t }) {
66
- let { className: n, size: r, variant: i } = mn(e);
67
- return r === void 0 && i === void 0 ? ge(t, { className: J(t.props.className, n) }) : /* @__PURE__ */ H(Q, {
66
+ function vn({ appearance: e, children: t }) {
67
+ let { className: n, size: r, variant: i } = _n(e);
68
+ return r === void 0 && i === void 0 ? _e(t, { className: Y(t.props.className, n) }) : /* @__PURE__ */ U(Q, {
68
69
  asChild: !0,
69
70
  appearance: e,
70
71
  children: t
71
72
  });
72
73
  }
73
- var $ = ye(function({ label: e, overlayTarget: t, className: n, size: r = "icon", variant: i = "ghost", ...a }, o) {
74
- let { Tooltip: s } = Y();
75
- return /* @__PURE__ */ U(s.Root, {
74
+ var $ = be(function({ label: e, overlayTarget: t, className: n, size: r = "icon", variant: i = "ghost", ...a }, o) {
75
+ let { Tooltip: s } = X();
76
+ return /* @__PURE__ */ W(s.Root, {
76
77
  disableHoverableContent: !0,
77
- children: [/* @__PURE__ */ H(s.Trigger, {
78
+ children: [/* @__PURE__ */ U(s.Trigger, {
78
79
  asChild: !0,
79
- children: /* @__PURE__ */ H(Q, {
80
+ children: /* @__PURE__ */ U(Q, {
80
81
  type: "button",
81
82
  size: r,
82
83
  variant: i,
83
84
  ...a,
84
85
  ref: o,
85
86
  "aria-label": e,
86
- className: J("vibe-shadcn-tiptap__button", n)
87
+ className: Y("vibe-shadcn-tiptap__button", n)
87
88
  })
88
- }), t && /* @__PURE__ */ H(s.Content, {
89
+ }), t && /* @__PURE__ */ U(s.Content, {
89
90
  container: t,
90
91
  className: "vibe-shadcn-tiptap__tooltip",
91
92
  sideOffset: 5,
92
93
  children: e
93
94
  })]
94
95
  });
95
- }), gn = [
96
+ }), yn = [
96
97
  ["small", .25],
97
98
  ["medium", .5],
98
99
  ["large", .75],
99
100
  ["original", null]
100
- ], _n = {
101
- left: ke,
102
- center: De,
103
- right: Ae
104
- }, vn = [
101
+ ], bn = {
102
+ left: Ae,
103
+ center: Oe,
104
+ right: je
105
+ }, xn = [
105
106
  "left",
106
107
  "center",
107
108
  "right"
108
- ], yn = {
109
- image: at,
110
- audio: bt,
111
- video: Ze
109
+ ], Sn = {
110
+ image: ot,
111
+ audio: xt,
112
+ video: Qe
112
113
  };
113
- function bn(e, t) {
114
+ function Cn(e, t) {
114
115
  if (typeof e == "string" && e) try {
115
116
  let n = new URL(e, t);
116
117
  if ([
@@ -123,10 +124,10 @@ function bn(e, t) {
123
124
  return;
124
125
  }
125
126
  }
126
- function xn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhiteboardEdit: i, behaviorOptions: a, onCaptionFocus: o, onCopyUrl: s }) {
127
- let { editor: c, commands: l, t: u } = e, { node: d } = t, f = d.type.name, p = c.view.dom.ownerDocument.baseURI, m = K(null), [h, g] = q(!1), _ = f === "image", v = f === "whiteboard", y = f === "audio", b = f === "video", x = bn(d.attrs.src, p), S = c.view.nodeDOM(t.from), C = S instanceof HTMLElement ? S.querySelector(".vibe-tiptap-img-caption, .vibe-tiptap-media-caption") : null;
127
+ function wn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhiteboardEdit: i, behaviorOptions: a, onCaptionFocus: o, onCopyUrl: s }) {
128
+ let { editor: c, commands: l, t: u } = e, { node: d } = t, f = d.type.name, p = c.view.dom.ownerDocument.baseURI, m = q(null), [h, g] = J(!1), _ = f === "image", v = f === "whiteboard", y = f === "audio", b = f === "video", x = Cn(d.attrs.src, p), S = c.view.nodeDOM(t.from), C = S instanceof HTMLElement ? S.querySelector(".vibe-tiptap-img-caption, .vibe-tiptap-media-caption") : null;
128
129
  function w(e, t, r, i) {
129
- return /* @__PURE__ */ H($, {
130
+ return /* @__PURE__ */ U($, {
130
131
  ...i,
131
132
  label: u(e),
132
133
  overlayTarget: n,
@@ -138,19 +139,19 @@ function xn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhit
138
139
  c.isEditable && c.chain().focus().deleteSelection().run();
139
140
  }
140
141
  if (f === "fileAttachment") {
141
- let t = F(c);
142
+ let t = I(c);
142
143
  if (!t) return null;
143
- let n = bn(t.href, p), r = j(t.attrs), i = r === "video" || r === "audio" || r === "pdf", a = H(i ? Ye : Ge, {
144
+ let n = Cn(t.href, p), r = j(t.attrs), i = r === "video" || r === "audio" || r === "pdf", a = U(i ? Xe : Ke, {
144
145
  size: 16,
145
146
  "aria-hidden": !0
146
- }), o = r === "image" || r === "audio" || r === "video" ? r : void 0, d = o && yn[o];
147
- return /* @__PURE__ */ U("div", {
148
- className: J("vibe-shadcn-tiptap__actions", X),
147
+ }), o = r === "image" || r === "audio" || r === "video" ? r : void 0, d = o && Sn[o];
148
+ return /* @__PURE__ */ W("div", {
149
+ className: Y("vibe-shadcn-tiptap__actions", Z),
149
150
  children: [
150
- n && (i || e.fileAttachmentDownload) && /* @__PURE__ */ H(Q, {
151
+ n && (i || e.fileAttachmentDownload) && /* @__PURE__ */ U(Q, {
151
152
  asChild: !0,
152
153
  className: "vibe-shadcn-tiptap__button",
153
- children: /* @__PURE__ */ H("a", {
154
+ children: /* @__PURE__ */ U("a", {
154
155
  href: n,
155
156
  "aria-label": u(i ? "file.action.open" : "file.action.download"),
156
157
  download: i ? void 0 : t.attrs.name ? t.name : "",
@@ -159,7 +160,7 @@ function xn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhit
159
160
  children: a
160
161
  })
161
162
  }),
162
- n && w("file.action.copy", /* @__PURE__ */ H(We, {
163
+ n && w("file.action.copy", /* @__PURE__ */ U(Ge, {
163
164
  size: 16,
164
165
  "aria-hidden": !0
165
166
  }), () => s(n, !0)),
@@ -167,7 +168,7 @@ function xn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhit
167
168
  image: "file.action.showAsImage",
168
169
  audio: "file.action.showAsAudio",
169
170
  video: "file.action.showAsVideo"
170
- }[o], /* @__PURE__ */ H(d, {
171
+ }[o], /* @__PURE__ */ U(d, {
171
172
  size: 16,
172
173
  "aria-hidden": !0
173
174
  }), {
@@ -175,7 +176,7 @@ function xn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhit
175
176
  audio: () => l.setAudioDisplay("player"),
176
177
  video: () => l.setVideoDisplay("player")
177
178
  }[o]),
178
- w("file.action.delete", /* @__PURE__ */ H(Bt, {
179
+ w("file.action.delete", /* @__PURE__ */ U(Vt, {
179
180
  size: 16,
180
181
  "aria-hidden": !0
181
182
  }), T)
@@ -197,11 +198,11 @@ function xn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhit
197
198
  function ee(e) {
198
199
  _ ? l.setImageAlign(e) : v ? c.chain().focus().updateAttributes("whiteboard", { align: e }).run() : y ? l.setAudioAlign(e) : l.setVideoAlign(e);
199
200
  }
200
- let D = y || b ? d.attrs.size : gn.find(([, e]) => e !== null && Math.round(c.view.dom.clientWidth * e) === d.attrs.width)?.[0] ?? (d.attrs.width ? void 0 : "original");
201
- return /* @__PURE__ */ U("div", {
202
- className: J("vibe-shadcn-tiptap__actions", X),
201
+ let D = y || b ? d.attrs.size : yn.find(([, e]) => e !== null && Math.round(c.view.dom.clientWidth * e) === d.attrs.width)?.[0] ?? (d.attrs.width ? void 0 : "original");
202
+ return /* @__PURE__ */ W("div", {
203
+ className: Y("vibe-shadcn-tiptap__actions", Z),
203
204
  children: [
204
- gn.map(([e, t]) => /* @__PURE__ */ H(Q, {
205
+ yn.map(([e, t]) => /* @__PURE__ */ U(Q, {
205
206
  type: "button",
206
207
  className: "vibe-shadcn-tiptap__button",
207
208
  title: u(`image.size.${e}Tooltip`),
@@ -209,42 +210,42 @@ function xn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhit
209
210
  onClick: () => E(e, t),
210
211
  children: u(`image.size.${e}`)
211
212
  }, e)),
212
- /* @__PURE__ */ H("span", {
213
+ /* @__PURE__ */ U("span", {
213
214
  className: "vibe-shadcn-tiptap__bubble-divider",
214
215
  "aria-hidden": "true"
215
216
  }),
216
- vn.map((e) => {
217
- let t = _n[e];
218
- return /* @__PURE__ */ H($, {
217
+ xn.map((e) => {
218
+ let t = bn[e];
219
+ return /* @__PURE__ */ U($, {
219
220
  label: u(`image.align.${e}`),
220
221
  "aria-pressed": (d.attrs.align ?? "center") === e,
221
222
  overlayTarget: n,
222
223
  onClick: () => ee(e),
223
- children: /* @__PURE__ */ H(t, {
224
+ children: /* @__PURE__ */ U(t, {
224
225
  size: 16,
225
226
  "aria-hidden": !0
226
227
  })
227
228
  }, e);
228
229
  }),
229
- /* @__PURE__ */ H("span", {
230
+ /* @__PURE__ */ U("span", {
230
231
  className: "vibe-shadcn-tiptap__bubble-divider",
231
232
  "aria-hidden": "true"
232
233
  }),
233
- C && w("image.caption", /* @__PURE__ */ H(Ie, {
234
+ C && w("image.caption", /* @__PURE__ */ U(Le, {
234
235
  size: 16,
235
236
  "aria-hidden": !0
236
237
  }), () => {
237
238
  C.readOnly || (C.hidden = !1, C.focus(), o());
238
239
  }),
239
- v && r && w("whiteboard.edit", /* @__PURE__ */ H(wt, {
240
+ v && r && w("whiteboard.edit", /* @__PURE__ */ U(Tt, {
240
241
  size: 16,
241
242
  "aria-hidden": !0
242
243
  }), i),
243
- _ && r && /* @__PURE__ */ U(me, { children: [/* @__PURE__ */ H("input", {
244
+ _ && r && /* @__PURE__ */ W(he, { children: [/* @__PURE__ */ U("input", {
244
245
  ref: m,
245
246
  type: "file",
246
247
  hidden: !0,
247
- accept: ce(a).image.accept,
248
+ accept: B(a).image.accept,
248
249
  onChange: async (t) => {
249
250
  let n = t.currentTarget.files?.[0];
250
251
  if (t.currentTarget.value = "", n && !h) {
@@ -252,31 +253,31 @@ function xn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhit
252
253
  try {
253
254
  await l.uploadAndReplaceImage(n);
254
255
  } catch {
255
- c.isDestroyed || R(e.notify, u, "image");
256
+ c.isDestroyed || ce(e.notify, u, "image");
256
257
  } finally {
257
258
  g(!1);
258
259
  }
259
260
  }
260
261
  }
261
- }), w("image.replace", /* @__PURE__ */ H(ct, {
262
+ }), w("image.replace", /* @__PURE__ */ U(lt, {
262
263
  size: 16,
263
264
  "aria-hidden": !0
264
265
  }), () => m.current?.click(), { disabled: h })] }),
265
- x && !v && w("toolbar.link.copy", /* @__PURE__ */ H(We, {
266
+ x && !v && w("toolbar.link.copy", /* @__PURE__ */ U(Ge, {
266
267
  size: 16,
267
268
  "aria-hidden": !0
268
269
  }), () => s(x)),
269
- x && !v && k(c, _ ? "image" : y ? "audio" : "video", "file") && w("video.showAsFile", /* @__PURE__ */ H(St, {
270
+ x && !v && k(c, _ ? "image" : y ? "audio" : "video", "file") && w("video.showAsFile", /* @__PURE__ */ U(Ct, {
270
271
  size: 16,
271
272
  "aria-hidden": !0
272
273
  }), () => {
273
274
  _ ? l.setImageDisplay("file") : y ? l.setAudioDisplay("file") : l.setVideoDisplay("file");
274
275
  }),
275
- (y || b) && x && /* @__PURE__ */ H("span", {
276
+ (y || b) && x && /* @__PURE__ */ U("span", {
276
277
  className: "vibe-shadcn-tiptap__bubble-divider",
277
278
  "aria-hidden": "true"
278
279
  }),
279
- w(_ ? "image.delete" : v ? "whiteboard.delete" : y ? "audio.delete" : "video.delete", /* @__PURE__ */ H(Bt, {
280
+ w(_ ? "image.delete" : v ? "whiteboard.delete" : y ? "audio.delete" : "video.delete", /* @__PURE__ */ U(Vt, {
280
281
  size: 16,
281
282
  "aria-hidden": !0
282
283
  }), _ ? l.removeImage : y ? l.removeAudio : b ? l.removeVideo : T)
@@ -284,50 +285,50 @@ function xn({ context: e, selection: t, overlayTarget: n, uploadAsset: r, onWhit
284
285
  });
285
286
  }
286
287
  // src/color-picker.tsx
287
- var Sn = /^(#[\da-f]{6})ff$/;
288
- function Cn({ appearance: e, context: t, colors: n, kind: r, overlayTarget: a, disabled: o, bubble: s, open: c, onOpenChange: l }) {
289
- let { Popover: u } = Y(), d = mn(), f = {
288
+ var Tn = /^(#[\da-f]{6})ff$/;
289
+ function En({ appearance: e, context: t, colors: n, kind: r, overlayTarget: a, disabled: o, bubble: s, open: c, onOpenChange: l }) {
290
+ let { Popover: u } = X(), d = _n(), f = {
290
291
  size: e?.button?.size ?? d?.size,
291
292
  variant: e?.button?.variant ?? d?.variant,
292
- className: J(d?.className, e?.button?.className)
293
- }, { editor: p, t: m, notify: h } = t, g = p.view.dom.ownerDocument, _ = r === "color" ? "textStyle" : "highlight", { selection: v, storedMarks: y } = p.state, b = v.empty && y ? y.find((e) => e.type.name === _)?.attrs.color : p.getAttributes(_).color, x = typeof b == "string" ? b.trim() : void 0, S = i(x, g), C = S?.replace(Sn, "$1"), w = we(() => {
293
+ className: Y(d?.className, e?.button?.className)
294
+ }, { editor: p, t: m, notify: h } = t, g = p.view.dom.ownerDocument, _ = r === "color" ? "textStyle" : "highlight", { selection: v, storedMarks: y } = p.state, b = v.empty && y ? y.find((e) => e.type.name === _)?.attrs.color : p.getAttributes(_).color, x = typeof b == "string" ? b.trim() : void 0, S = i(x, g), C = S?.replace(Tn, "$1"), w = Te(() => {
294
295
  let e = /* @__PURE__ */ new Set();
295
296
  return n.flatMap((t) => {
296
- let n = i(t, g)?.replace(Sn, "$1"), r = n ?? t.trim();
297
+ let n = i(t, g)?.replace(Tn, "$1"), r = n ?? t.trim();
297
298
  return e.has(r) ? [] : (e.add(r), [{
298
299
  value: t,
299
300
  canonical: n
300
301
  }]);
301
302
  });
302
- }, [n, g]), T = r === "color" ? xt : it;
303
+ }, [n, g]), T = r === "color" ? St : at;
303
304
  function E(e) {
304
- !o && L(t, r, e) && B(t, r, e);
305
+ !o && R(t, r, e) && ue(t, r, e);
305
306
  }
306
- return /* @__PURE__ */ H(Z, {
307
+ return /* @__PURE__ */ U(gn, {
307
308
  value: f,
308
- children: /* @__PURE__ */ U(u.Root, {
309
+ children: /* @__PURE__ */ W(u.Root, {
309
310
  open: c,
310
311
  onOpenChange: l,
311
- children: [/* @__PURE__ */ H(u.Trigger, {
312
+ children: [/* @__PURE__ */ U(u.Trigger, {
312
313
  asChild: !0,
313
- children: /* @__PURE__ */ H($, {
314
+ children: /* @__PURE__ */ U($, {
314
315
  size: "icon",
315
316
  label: m(`command.${r}`),
316
317
  overlayTarget: a,
317
318
  "data-toolbar-key": s ? void 0 : r,
318
319
  disabled: o,
319
320
  onMouseDown: (e) => e.preventDefault(),
320
- children: /* @__PURE__ */ U("span", {
321
+ children: /* @__PURE__ */ W("span", {
321
322
  className: "vibe-shadcn-tiptap__color-icon",
322
- children: [/* @__PURE__ */ H(T, {
323
+ children: [/* @__PURE__ */ U(T, {
323
324
  size: 16,
324
325
  "aria-hidden": !0
325
- }), x && /* @__PURE__ */ H("span", { style: { backgroundColor: x } })]
326
+ }), x && /* @__PURE__ */ U("span", { style: { backgroundColor: x } })]
326
327
  })
327
328
  })
328
- }), a && /* @__PURE__ */ U(u.Content, {
329
+ }), a && /* @__PURE__ */ W(u.Content, {
329
330
  container: a,
330
- className: J("z-3", e?.className),
331
+ className: Y("z-3", e?.className),
331
332
  align: "start",
332
333
  sideOffset: 4,
333
334
  "aria-label": m(`command.${r}`),
@@ -339,13 +340,13 @@ function Cn({ appearance: e, context: t, colors: n, kind: r, overlayTarget: a, d
339
340
  e.target === p.view.dom && e.preventDefault();
340
341
  },
341
342
  onMouseDown: (e) => e.preventDefault(),
342
- children: [/* @__PURE__ */ H("div", {
343
- className: J("vibe-shadcn-tiptap__color-grid grid grid-cols-[repeat(8,max-content)] justify-between gap-1.5 px-2 py-2", e?.gridClassName),
344
- children: w.map(({ value: t, canonical: n }) => /* @__PURE__ */ H(Q, {
343
+ children: [/* @__PURE__ */ U("div", {
344
+ className: Y("vibe-shadcn-tiptap__color-grid grid grid-cols-[repeat(8,max-content)] justify-between gap-1.5 px-2 py-2", e?.gridClassName),
345
+ children: w.map(({ value: t, canonical: n }) => /* @__PURE__ */ U(Q, {
345
346
  type: "button",
346
347
  appearance: {
347
348
  ...e?.swatch,
348
- className: J(e?.swatchClassName, e?.swatch?.className)
349
+ className: Y(e?.swatchClassName, e?.swatch?.className)
349
350
  },
350
351
  defaultSizeClassName: "size-5 p-0",
351
352
  className: "vibe-shadcn-tiptap__swatch rounded-sm border border-border aria-pressed:outline-2 aria-pressed:outline-solid aria-pressed:outline-ring",
@@ -355,9 +356,9 @@ function Cn({ appearance: e, context: t, colors: n, kind: r, overlayTarget: a, d
355
356
  "aria-pressed": x === t || C !== void 0 && C === n,
356
357
  onClick: () => E(t)
357
358
  }, t))
358
- }), /* @__PURE__ */ U("div", {
359
- className: J("vibe-shadcn-tiptap__color-footer flex items-center justify-between gap-2 px-2 text-muted-foreground", e?.footerClassName),
360
- children: [S ? /* @__PURE__ */ U($, {
359
+ }), /* @__PURE__ */ W("div", {
360
+ className: Y("vibe-shadcn-tiptap__color-footer flex items-center justify-between gap-2 px-2 text-muted-foreground", e?.footerClassName),
361
+ children: [S ? /* @__PURE__ */ W($, {
361
362
  size: "sm",
362
363
  label: m("toolbar.color.copyHex", { hex: S }),
363
364
  overlayTarget: a,
@@ -370,15 +371,15 @@ function Cn({ appearance: e, context: t, colors: n, kind: r, overlayTarget: a, d
370
371
  h(m("notify.clipboardUnavailable"), "warning");
371
372
  }
372
373
  },
373
- children: [/* @__PURE__ */ H(We, {
374
+ children: [/* @__PURE__ */ U(Ge, {
374
375
  size: 14,
375
376
  "aria-hidden": !0
376
377
  }), S]
377
- }) : /* @__PURE__ */ H("span", { children: m(r === "color" ? "toolbar.color.default" : "toolbar.highlight.none") }), /* @__PURE__ */ H(Q, {
378
+ }) : /* @__PURE__ */ U("span", { children: m(r === "color" ? "toolbar.color.default" : "toolbar.highlight.none") }), /* @__PURE__ */ U(Q, {
378
379
  type: "button",
379
380
  size: "sm",
380
381
  className: "vibe-shadcn-tiptap__button",
381
- disabled: o || !L(t, r, ""),
382
+ disabled: o || !R(t, r, ""),
382
383
  onClick: () => E(""),
383
384
  children: m(r === "color" ? "toolbar.color.clear" : "toolbar.highlight.clear")
384
385
  })]
@@ -388,20 +389,20 @@ function Cn({ appearance: e, context: t, colors: n, kind: r, overlayTarget: a, d
388
389
  });
389
390
  }
390
391
  // src/insertion-popover.tsx
391
- function wn(e) {
392
- return /* @__PURE__ */ H(Z, {
392
+ function Dn(e) {
393
+ return /* @__PURE__ */ U(gn, {
393
394
  value: e.appearance?.button,
394
- children: e.request.kind === "link" ? /* @__PURE__ */ H(En, {
395
+ children: e.request.kind === "link" ? /* @__PURE__ */ U(kn, {
395
396
  ...e,
396
397
  request: e.request
397
- }) : /* @__PURE__ */ H(kn, {
398
+ }) : /* @__PURE__ */ U(Mn, {
398
399
  ...e,
399
400
  request: e.request
400
401
  })
401
402
  });
402
403
  }
403
- function Tn({ className: e, context: t, anchor: n, overlayTarget: r, title: i, onClose: a, children: o }) {
404
- let { Popover: s } = Y(), { editor: c } = t, l = K(c.state.selection.from), u = we(() => ({ current: {
404
+ function On({ className: e, context: t, anchor: n, overlayTarget: r, title: i, onClose: a, children: o }) {
405
+ let { Popover: s } = X(), { editor: c } = t, l = q(c.state.selection.from), u = Te(() => ({ current: {
405
406
  contextElement: n ?? c.view.dom,
406
407
  getBoundingClientRect() {
407
408
  if (n) return n.getBoundingClientRect();
@@ -412,14 +413,14 @@ function Tn({ className: e, context: t, anchor: n, overlayTarget: r, title: i, o
412
413
  function d() {
413
414
  a(), (n ?? c.view.dom).focus({ preventScroll: !0 });
414
415
  }
415
- return /* @__PURE__ */ U(s.Root, {
416
+ return /* @__PURE__ */ W(s.Root, {
416
417
  open: !0,
417
418
  onOpenChange: (e) => {
418
419
  e || a();
419
420
  },
420
- children: [/* @__PURE__ */ H(s.Anchor, { virtualRef: u }), /* @__PURE__ */ H(s.Content, {
421
+ children: [/* @__PURE__ */ U(s.Anchor, { virtualRef: u }), /* @__PURE__ */ U(s.Content, {
421
422
  container: r,
422
- className: J("z-3 vibe-shadcn-tiptap__insertion w-[min(22rem,calc(100vw-2rem))] p-3", e),
423
+ className: Y("z-3 vibe-shadcn-tiptap__insertion w-[min(22rem,calc(100vw-2rem))] p-3", e),
423
424
  "aria-label": i,
424
425
  side: n ? "top" : "bottom",
425
426
  align: "start",
@@ -447,15 +448,15 @@ function Tn({ className: e, context: t, anchor: n, overlayTarget: r, title: i, o
447
448
  })]
448
449
  });
449
450
  }
450
- function En({ appearance: e, context: t, overlayTarget: n, request: r, onClose: i }) {
451
- let { Input: a, Checkbox: o } = Y(), s = J(fn[e?.input?.variant ?? "default"], e?.input?.className), { editor: c, commands: l, t: u, notify: d } = t, f = Ce(), p = Ce(), m = Ce(), [h] = q(() => r.link ?? re(c)), [g] = q(() => h ? {
451
+ function kn({ appearance: e, context: t, overlayTarget: n, request: r, onClose: i }) {
452
+ let { Input: a, Checkbox: o } = X(), s = Y(mn[e?.input?.variant ?? "default"], e?.input?.className), { editor: c, commands: l, t: u, notify: d } = t, f = we(), p = we(), m = we(), [h] = J(() => r.link ?? F(c)), [g] = J(() => h ? {
452
453
  from: h.from,
453
454
  to: h.to
454
455
  } : {
455
456
  from: c.state.selection.from,
456
457
  to: c.state.selection.to
457
- }), [_, v] = q(() => h?.text ?? c.state.doc.textBetween(g.from, g.to)), [y] = q(() => !!(h || _)), [b, x] = q(h?.href ?? ""), [S, C] = q((h ? h.target : t.defaultLinkTarget) !== "_self");
458
- G(() => {
458
+ }), [_, v] = J(() => h?.text ?? c.state.doc.textBetween(g.from, g.to)), [y] = J(() => !!(h || _)), [b, x] = J(h?.href ?? ""), [S, C] = J((h ? h.target : t.defaultLinkTarget) !== "_self");
459
+ K(() => {
459
460
  let e = ({ transaction: e, appendedTransactions: t }) => {
460
461
  (e.docChanged || t.some(({ docChanged: e }) => e)) && i();
461
462
  };
@@ -465,29 +466,29 @@ function En({ appearance: e, context: t, overlayTarget: n, request: r, onClose:
465
466
  }, [c, i]);
466
467
  function w() {
467
468
  if (!c.isEditable) return;
468
- let e = oe(b);
469
+ let e = se(b);
469
470
  e ? (l.insertLinkText(e, _, {
470
471
  target: S ? "_blank" : "_self",
471
472
  range: g
472
473
  }), i()) : d(u(b.trim() ? "notify.linkInvalid" : "notify.linkEmpty"), "warning");
473
474
  }
474
- return /* @__PURE__ */ H(Tn, {
475
+ return /* @__PURE__ */ U(On, {
475
476
  className: e?.className,
476
477
  context: t,
477
478
  anchor: r.anchor,
478
479
  overlayTarget: n,
479
480
  title: u(y ? "command.link" : "toolbar.link.popoverLabel"),
480
481
  onClose: i,
481
- children: /* @__PURE__ */ U("form", {
482
+ children: /* @__PURE__ */ W("form", {
482
483
  className: "vibe-shadcn-tiptap__fields vibe-shadcn-tiptap__compact-fields grid gap-2.5",
483
484
  onSubmit: (e) => {
484
485
  e.preventDefault(), w();
485
486
  },
486
487
  children: [
487
- /* @__PURE__ */ U("label", {
488
+ /* @__PURE__ */ W("label", {
488
489
  htmlFor: p,
489
490
  className: "grid gap-1.5",
490
- children: [/* @__PURE__ */ H("span", { children: u("toolbar.link.textLabel") }), /* @__PURE__ */ H(a, {
491
+ children: [/* @__PURE__ */ U("span", { children: u("toolbar.link.textLabel") }), /* @__PURE__ */ U(a, {
491
492
  className: s,
492
493
  id: p,
493
494
  value: _,
@@ -495,10 +496,10 @@ function En({ appearance: e, context: t, overlayTarget: n, request: r, onClose:
495
496
  onChange: (e) => v(e.currentTarget.value)
496
497
  })]
497
498
  }),
498
- /* @__PURE__ */ U("label", {
499
+ /* @__PURE__ */ W("label", {
499
500
  htmlFor: m,
500
501
  className: "grid gap-1.5",
501
- children: [/* @__PURE__ */ H("span", { children: u("toolbar.link.hrefLabel") }), /* @__PURE__ */ H(a, {
502
+ children: [/* @__PURE__ */ U("span", { children: u("toolbar.link.hrefLabel") }), /* @__PURE__ */ U(a, {
502
503
  className: s,
503
504
  id: m,
504
505
  "data-initial-focus": !0,
@@ -507,31 +508,31 @@ function En({ appearance: e, context: t, overlayTarget: n, request: r, onClose:
507
508
  onChange: (e) => x(e.currentTarget.value)
508
509
  })]
509
510
  }),
510
- /* @__PURE__ */ U("div", {
511
+ /* @__PURE__ */ W("div", {
511
512
  className: "vibe-shadcn-tiptap__checkbox-field flex items-center gap-1.5",
512
- children: [/* @__PURE__ */ H(hn, {
513
+ children: [/* @__PURE__ */ U(vn, {
513
514
  appearance: e?.checkbox,
514
- children: /* @__PURE__ */ H(o, {
515
+ children: /* @__PURE__ */ U(o, {
515
516
  id: f,
516
517
  checked: S,
517
518
  onCheckedChange: (e) => C(e === !0)
518
519
  })
519
- }), /* @__PURE__ */ H("label", {
520
+ }), /* @__PURE__ */ U("label", {
520
521
  htmlFor: f,
521
522
  children: u("toolbar.link.openInNewWindow")
522
523
  })]
523
524
  }),
524
- /* @__PURE__ */ U("div", {
525
- className: J("vibe-shadcn-tiptap__actions vibe-shadcn-tiptap__insertion-actions justify-end", X),
525
+ /* @__PURE__ */ W("div", {
526
+ className: Y("vibe-shadcn-tiptap__actions vibe-shadcn-tiptap__insertion-actions justify-end", Z),
526
527
  children: [
527
- h && /* @__PURE__ */ H(Q, {
528
+ h && /* @__PURE__ */ U(Q, {
528
529
  type: "button",
529
530
  onClick: () => {
530
531
  c.isEditable && (l.setLink("", { range: g }), d(u("notify.linkRemoved"), "success"), i());
531
532
  },
532
533
  children: u("toolbar.link.remove")
533
534
  }),
534
- /* @__PURE__ */ H(Q, {
535
+ /* @__PURE__ */ U(Q, {
535
536
  type: "button",
536
537
  className: "vibe-shadcn-tiptap__insertion-cancel ms-auto",
537
538
  onClick: () => {
@@ -539,7 +540,7 @@ function En({ appearance: e, context: t, overlayTarget: n, request: r, onClose:
539
540
  },
540
541
  children: u("toolbar.action.cancel")
541
542
  }),
542
- /* @__PURE__ */ H(Q, {
543
+ /* @__PURE__ */ U(Q, {
543
544
  type: "submit",
544
545
  children: u("toolbar.action.confirm")
545
546
  })
@@ -549,27 +550,27 @@ function En({ appearance: e, context: t, overlayTarget: n, request: r, onClose:
549
550
  })
550
551
  });
551
552
  }
552
- var Dn = {
553
+ var An = {
553
554
  image: "notify.invalidImageUrl",
554
555
  video: "notify.invalidVideoUrl",
555
556
  audio: "notify.invalidAudioUrl",
556
557
  attachment: "notify.invalidFileUrl"
557
- }, On = {
558
- image: at,
559
- video: Ze,
560
- audio: bt,
561
- attachment: St
558
+ }, jn = {
559
+ image: ot,
560
+ video: Qe,
561
+ audio: xt,
562
+ attachment: Ct
562
563
  };
563
- function kn({ appearance: e, context: t, request: n, overlayTarget: r, canUpload: i, behaviorOptions: a, onClose: o }) {
564
- let { Input: s, Tabs: c } = Y(), { editor: l, commands: u, t: d, notify: f } = t, { kind: p, anchor: m } = n, h = On[p], g = Ce(), _ = p === "attachment" ? "file" : p, v = ce(a), y = _ === "image" ? v.image : v.media[_], b = !!l.schema.nodes[N(_)], x = b && i, S = b && (p !== "image" || v.image.allowUrl), C = x || S, [w, T] = q(n.tab ?? (x ? "upload" : "url")), E = w === "upload" ? x ? "upload" : "url" : S ? "url" : "upload", [ee, D] = q(""), O = K(void 0), k = K(o);
565
- G(() => {
564
+ function Mn({ appearance: e, context: t, request: n, overlayTarget: r, canUpload: i, behaviorOptions: a, onClose: o }) {
565
+ let { Input: s, Tabs: c } = X(), { editor: l, commands: u, t: d, notify: f } = t, { kind: p, anchor: m } = n, h = jn[p], g = we(), _ = p === "attachment" ? "file" : p, v = B(a), y = _ === "image" ? v.image : v.media[_], b = !!l.schema.nodes[re(_)], x = b && i, S = b && (p !== "image" || v.image.allowUrl), C = x || S, [w, T] = J(n.tab ?? (x ? "upload" : "url")), E = w === "upload" ? x ? "upload" : "url" : S ? "url" : "upload", [ee, D] = J(""), O = q(void 0), k = q(o);
566
+ K(() => {
566
567
  k.current = o;
567
- }, [o]), G(() => {
568
+ }, [o]), K(() => {
568
569
  if (!C) {
569
570
  k.current();
570
571
  return;
571
572
  }
572
- let e = de(l, () => k.current());
573
+ let e = fe(l, () => k.current());
573
574
  return O.current = e, () => {
574
575
  e.dispose(), O.current = void 0;
575
576
  };
@@ -584,66 +585,66 @@ function kn({ appearance: e, context: t, request: n, overlayTarget: r, canUpload
584
585
  attachment: u.uploadAndInsertFile
585
586
  }[p];
586
587
  o(), n(y.multiple ? e : e.slice(0, 1), t).catch(() => {
587
- l.isDestroyed || R(f, d, _);
588
+ l.isDestroyed || ce(f, d, _);
588
589
  });
589
590
  }
590
591
  function j() {
591
592
  let e = O.current?.range;
592
593
  if (!e || !l.isEditable || !S) return;
593
- let t = oe(ee);
594
- if (!t) f(d(Dn[p]), "warning");
594
+ let t = se(ee);
595
+ if (!t) f(d(An[p]), "warning");
595
596
  else {
596
597
  if (p === "video" || p === "audio") {
597
598
  if (!(p === "video" ? u.insertVideoUrl : u.insertAudioUrl)(t, e)) {
598
- f(d(Dn[p]), "warning");
599
+ f(d(An[p]), "warning");
599
600
  return;
600
601
  }
601
602
  } else l.commands.setTextSelection(e), p === "image" ? u.setImage(t) : u.insertFile(t);
602
603
  o();
603
604
  }
604
605
  }
605
- return C ? /* @__PURE__ */ U(Tn, {
606
+ return C ? /* @__PURE__ */ W(On, {
606
607
  className: e?.className,
607
608
  context: t,
608
609
  anchor: m,
609
610
  overlayTarget: r,
610
611
  title: d(`toolbar.${p}.${E}`),
611
612
  onClose: o,
612
- children: [/* @__PURE__ */ U(c.Root, {
613
+ children: [/* @__PURE__ */ W(c.Root, {
613
614
  className: e?.tabs?.className,
614
615
  value: E,
615
616
  onValueChange: (e) => {
616
617
  (e === "upload" || e === "url") && T(e);
617
618
  },
618
619
  children: [
619
- x && S && /* @__PURE__ */ U(c.List, {
620
- className: J("vibe-shadcn-tiptap__media-tabs mb-2 grid w-full grid-cols-2 gap-1", e?.tabs?.listClassName),
620
+ x && S && /* @__PURE__ */ W(c.List, {
621
+ className: Y("vibe-shadcn-tiptap__media-tabs mb-2 grid w-full grid-cols-2 gap-1", e?.tabs?.listClassName),
621
622
  "aria-label": d(`command.${p}`),
622
- children: [/* @__PURE__ */ H(hn, {
623
+ children: [/* @__PURE__ */ U(vn, {
623
624
  appearance: e?.tabs?.trigger,
624
- children: /* @__PURE__ */ H(c.Trigger, {
625
+ children: /* @__PURE__ */ U(c.Trigger, {
625
626
  value: "upload",
626
627
  children: d(`toolbar.${p}.upload`)
627
628
  })
628
- }), /* @__PURE__ */ H(hn, {
629
+ }), /* @__PURE__ */ U(vn, {
629
630
  appearance: e?.tabs?.trigger,
630
- children: /* @__PURE__ */ H(c.Trigger, {
631
+ children: /* @__PURE__ */ U(c.Trigger, {
631
632
  value: "url",
632
633
  children: d(`toolbar.${p}.url`)
633
634
  })
634
635
  })]
635
636
  }),
636
- x && E === "upload" && /* @__PURE__ */ H(c.Content, {
637
+ x && E === "upload" && /* @__PURE__ */ U(c.Content, {
637
638
  value: "upload",
638
639
  className: e?.tabs?.contentClassName,
639
- children: /* @__PURE__ */ U("label", {
640
- className: J("vibe-shadcn-tiptap__drop relative my-2 grid justify-items-center gap-2 rounded-md border-2 border-dashed border-muted-foreground bg-muted p-4 text-center text-foreground hover:border-primary hover:bg-accent has-[:focus-visible]:border-ring", e?.uploadClassName),
640
+ children: /* @__PURE__ */ W("label", {
641
+ className: Y("vibe-shadcn-tiptap__drop relative my-2 grid justify-items-center gap-2 rounded-md border-2 border-dashed border-muted-foreground bg-muted p-4 text-center text-foreground hover:border-primary hover:bg-accent has-[:focus-visible]:border-ring", e?.uploadClassName),
641
642
  onDragOver: (e) => e.preventDefault(),
642
643
  onDrop: (e) => {
643
644
  e.preventDefault(), A(Array.from(e.dataTransfer.files));
644
645
  },
645
646
  children: [
646
- /* @__PURE__ */ H("input", {
647
+ /* @__PURE__ */ U("input", {
647
648
  className: "absolute inset-0 size-full cursor-pointer opacity-0",
648
649
  type: "file",
649
650
  "data-initial-focus": !0,
@@ -651,26 +652,26 @@ function kn({ appearance: e, context: t, request: n, overlayTarget: r, canUpload
651
652
  multiple: y.multiple,
652
653
  onChange: (e) => A(Array.from(e.currentTarget.files ?? []))
653
654
  }),
654
- /* @__PURE__ */ H(h, {
655
+ /* @__PURE__ */ U(h, {
655
656
  size: 28,
656
657
  className: "text-muted-foreground",
657
658
  "aria-hidden": "true"
658
659
  }),
659
- /* @__PURE__ */ H("span", { children: d(`toolbar.${p}.dropHint`) })
660
+ /* @__PURE__ */ U("span", { children: d(`toolbar.${p}.dropHint`) })
660
661
  ]
661
662
  })
662
663
  }),
663
- S && E === "url" && /* @__PURE__ */ H(c.Content, {
664
+ S && E === "url" && /* @__PURE__ */ U(c.Content, {
664
665
  value: "url",
665
666
  className: e?.tabs?.contentClassName,
666
- children: /* @__PURE__ */ H("form", {
667
+ children: /* @__PURE__ */ U("form", {
667
668
  id: g,
668
669
  className: "vibe-shadcn-tiptap__fields vibe-shadcn-tiptap__compact-fields grid gap-2.5",
669
670
  onSubmit: (e) => {
670
671
  e.preventDefault(), j();
671
672
  },
672
- children: /* @__PURE__ */ H(s, {
673
- className: J(fn[e?.input?.variant ?? "default"], e?.input?.className),
673
+ children: /* @__PURE__ */ U(s, {
674
+ className: Y(mn[e?.input?.variant ?? "default"], e?.input?.className),
674
675
  "data-initial-focus": !0,
675
676
  "aria-label": d(`toolbar.${p}.url`),
676
677
  placeholder: d(`toolbar.${p}.urlPlaceholder`),
@@ -680,16 +681,16 @@ function kn({ appearance: e, context: t, request: n, overlayTarget: r, canUpload
680
681
  })
681
682
  })
682
683
  ]
683
- }), /* @__PURE__ */ U("div", {
684
- className: J("vibe-shadcn-tiptap__actions vibe-shadcn-tiptap__insertion-actions vibe-shadcn-tiptap__media-actions mt-2.5 justify-end", X),
685
- children: [/* @__PURE__ */ H(Q, {
684
+ }), /* @__PURE__ */ W("div", {
685
+ className: Y("vibe-shadcn-tiptap__actions vibe-shadcn-tiptap__insertion-actions vibe-shadcn-tiptap__media-actions mt-2.5 justify-end", Z),
686
+ children: [/* @__PURE__ */ U(Q, {
686
687
  type: "button",
687
688
  className: "vibe-shadcn-tiptap__insertion-cancel ms-auto",
688
689
  onClick: () => {
689
690
  o(), (m ?? l.view.dom).focus({ preventScroll: !0 });
690
691
  },
691
692
  children: d("toolbar.action.cancel")
692
- }), E === "url" && /* @__PURE__ */ H(Q, {
693
+ }), E === "url" && /* @__PURE__ */ U(Q, {
693
694
  type: "submit",
694
695
  form: g,
695
696
  children: d("toolbar.action.confirm")
@@ -698,10 +699,10 @@ function kn({ appearance: e, context: t, request: n, overlayTarget: r, canUpload
698
699
  }) : null;
699
700
  }
700
701
  // src/table-picker.tsx
701
- var An = be(function({ row: e, col: t, active: n, current: r, className: i, grid: a, onHover: o, onSelect: s }) {
702
- return /* @__PURE__ */ H("button", {
702
+ var Nn = xe(function({ row: e, col: t, active: n, current: r, className: i, grid: a, onHover: o, onSelect: s }) {
703
+ return /* @__PURE__ */ U("button", {
703
704
  type: "button",
704
- className: J("size-[1.125rem] rounded-xs border border-border bg-background p-0 hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring data-active:bg-accent", i),
705
+ className: Y("size-[1.125rem] rounded-xs border border-border bg-background p-0 hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring data-active:bg-accent", i),
705
706
  "aria-label": `${e} × ${t}`,
706
707
  "data-cell": `${e}-${t}`,
707
708
  "data-active": n || void 0,
@@ -715,14 +716,14 @@ var An = be(function({ row: e, col: t, active: n, current: r, className: i, grid
715
716
  }
716
717
  });
717
718
  });
718
- function jn({ appearance: e, context: t, trigger: n, overlayTarget: r, options: i, disabled: a }) {
719
- let { Popover: o } = Y(), { editor: s, commands: c, t: l } = t, [u, d] = q(!1), [f, p] = q({
719
+ function Pn({ appearance: e, context: t, trigger: n, overlayTarget: r, options: i, disabled: a }) {
720
+ let { Popover: o } = X(), { editor: s, commands: c, t: l } = t, [u, d] = J(!1), [f, p] = J({
720
721
  row: 1,
721
722
  col: 1
722
- }), m = K(void 0), h = K(!1), g = K(null), { maxRows: _, maxCols: v } = i;
723
- G(() => {
723
+ }), m = q(void 0), h = q(!1), g = q(null), { maxRows: _, maxCols: v } = i;
724
+ K(() => {
724
725
  if (!u || a) return;
725
- let e = de(s, () => d(!1));
726
+ let e = fe(s, () => d(!1));
726
727
  return m.current = e, () => {
727
728
  e.dispose(), m.current = void 0;
728
729
  };
@@ -731,12 +732,12 @@ function jn({ appearance: e, context: t, trigger: n, overlayTarget: r, options:
731
732
  s,
732
733
  u
733
734
  ]);
734
- let y = xe((e, t) => {
735
+ let y = Se((e, t) => {
735
736
  p((n) => n.row === e && n.col === t ? n : {
736
737
  row: e,
737
738
  col: t
738
739
  });
739
- }, []), b = xe((e, t) => {
740
+ }, []), b = Se((e, t) => {
740
741
  let n = m.current?.range;
741
742
  n && s.isEditable && !a && (h.current = !0, s.commands.setTextSelection(n), c.insertTable(e, t), d(!1));
742
743
  }, [
@@ -744,7 +745,7 @@ function jn({ appearance: e, context: t, trigger: n, overlayTarget: r, options:
744
745
  a,
745
746
  s
746
747
  ]);
747
- return /* @__PURE__ */ U(o.Root, {
748
+ return /* @__PURE__ */ W(o.Root, {
748
749
  open: u && !a,
749
750
  onOpenChange: (e) => {
750
751
  e && (h.current = !1, p({
@@ -752,32 +753,32 @@ function jn({ appearance: e, context: t, trigger: n, overlayTarget: r, options:
752
753
  col: 1
753
754
  })), d(e);
754
755
  },
755
- children: [/* @__PURE__ */ H(o.Trigger, {
756
+ children: [/* @__PURE__ */ U(o.Trigger, {
756
757
  asChild: !0,
757
758
  children: n
758
- }), r && /* @__PURE__ */ U(o.Content, {
759
+ }), r && /* @__PURE__ */ W(o.Content, {
759
760
  container: r,
760
- className: J("z-3 box-border max-w-[calc(100dvw-1rem)]", e?.className),
761
+ className: Y("z-3 box-border max-w-[calc(100dvw-1rem)]", e?.className),
761
762
  "aria-label": l("command.table"),
762
763
  align: "start",
763
764
  sideOffset: 4,
764
765
  onCloseAutoFocus: (e) => {
765
766
  h.current && e.preventDefault();
766
767
  },
767
- children: [/* @__PURE__ */ U("div", {
768
+ children: [/* @__PURE__ */ W("div", {
768
769
  "aria-live": "polite",
769
770
  children: [
770
771
  f.row,
771
772
  " × ",
772
773
  f.col
773
774
  ]
774
- }), /* @__PURE__ */ H("div", {
775
+ }), /* @__PURE__ */ U("div", {
775
776
  ref: g,
776
777
  className: "vibe-shadcn-tiptap__table-picker grid min-w-0 gap-1 overflow-x-auto p-1",
777
778
  style: { gridTemplateColumns: `repeat(${v}, max-content)` },
778
779
  children: Array.from({ length: _ * v }, (t, n) => {
779
780
  let r = Math.floor(n / v) + 1, i = n % v + 1;
780
- return /* @__PURE__ */ H(An, {
781
+ return /* @__PURE__ */ U(Nn, {
781
782
  row: r,
782
783
  col: i,
783
784
  active: r <= f.row && i <= f.col,
@@ -793,8 +794,8 @@ function jn({ appearance: e, context: t, trigger: n, overlayTarget: r, options:
793
794
  });
794
795
  }
795
796
  // src/vibe-tiptap-provider.tsx
796
- var Mn = _e({});
797
- function Nn(e, t) {
797
+ var Fn = ve({});
798
+ function In(e, t) {
798
799
  return {
799
800
  components: t.components ?? e.components,
800
801
  ui: t.ui ?? e.ui,
@@ -807,15 +808,15 @@ function Nn(e, t) {
807
808
  showWordCount: t.showWordCount ?? e.showWordCount
808
809
  };
809
810
  }
810
- function Pn({ children: e, ...t }) {
811
- let n = Nn(Se(Mn), t);
812
- return /* @__PURE__ */ H(Mn.Provider, {
811
+ function Ln({ children: e, ...t }) {
812
+ let n = In(Ce(Fn), t);
813
+ return /* @__PURE__ */ U(Fn.Provider, {
813
814
  value: n,
814
815
  children: e
815
816
  });
816
817
  }
817
- function Fn(e) {
818
- let { components: t, ...n } = Nn(Se(Mn), e);
818
+ function Rn(e) {
819
+ let { components: t, ...n } = In(Ce(Fn), e);
819
820
  if (!t) throw Error("Pass a components mapping to VibeTiptapProvider or directly to the editor or toolbar.");
820
821
  return {
821
822
  components: t,
@@ -823,17 +824,17 @@ function Fn(e) {
823
824
  };
824
825
  }
825
826
  // src/whiteboard-dialog.tsx
826
- function In({ appearance: e, context: t, uploadAsset: n, overlayTarget: r, edit: i = !1, onClose: a }) {
827
- let { Dialog: o } = Y(), { editor: s, t: c } = t, [l, u] = q(null), [d, f] = q(), [p, m] = q(!1), [h, g] = q(""), [_] = q(() => i ? s.state.doc.nodeAt(s.state.selection.from)?.attrs.sceneData : void 0), v = K(void 0), y = K(a), b = K(!1), x = K(null), S = K(!1);
828
- G(() => {
827
+ function zn({ appearance: e, context: t, uploadAsset: n, overlayTarget: r, edit: i = !1, onClose: a }) {
828
+ let { Dialog: o } = X(), { editor: s, t: c } = t, [l, u] = J(null), [d, f] = J(), [p, m] = J(!1), [h, g] = J(""), [_] = J(() => i ? s.state.doc.nodeAt(s.state.selection.from)?.attrs.sceneData : void 0), v = q(void 0), y = q(a), b = q(!1), x = q(null), S = q(!1);
829
+ K(() => {
829
830
  y.current = a;
830
- }, [a]), W(() => {
831
+ }, [a]), G(() => {
831
832
  if (!l) return;
832
833
  let e = l, n = new AbortController(), r = /* @__PURE__ */ new Map(), a, o;
833
834
  async function u() {
834
835
  if (n.signal.aborted) return;
835
836
  o = t.holdWhiteboardSession();
836
- let l = () => y.current(), u = i ? de(s, l) : void 0, d = i ? void 0 : ue(s, l);
837
+ let l = () => y.current(), u = i ? fe(s, l) : void 0, d = i ? void 0 : V(s, l);
837
838
  if (!(u?.range || d?.active)) l();
838
839
  else {
839
840
  v.current = {
@@ -878,11 +879,11 @@ function In({ appearance: e, context: t, uploadAsset: n, overlayTarget: r, edit:
878
879
  if (!u()) return;
879
880
  let f = s.view.dom.ownerDocument.baseURI, { sceneData: p, file: m } = await e(d, a, n, f, r);
880
881
  if (!u()) return;
881
- let h = pe(m, "whiteboard", { maxSize: t.whiteboardPreviewMaxSize });
882
+ let h = me(m, "whiteboard", { maxSize: t.whiteboardPreviewMaxSize });
882
883
  if (h?.reason === "too-large") {
883
884
  g(c("notify.assetFileTooLarge", {
884
- size: M(h.size),
885
- limit: M(h.maxSize)
885
+ size: N(h.size),
886
+ limit: N(h.maxSize)
886
887
  }));
887
888
  return;
888
889
  }
@@ -906,17 +907,17 @@ function In({ appearance: e, context: t, uploadAsset: n, overlayTarget: r, edit:
906
907
  b.current = !1, r.aborted || m(!1);
907
908
  }
908
909
  }
909
- return /* @__PURE__ */ H(Z, {
910
+ return /* @__PURE__ */ U(gn, {
910
911
  value: e?.button,
911
- children: /* @__PURE__ */ H(o.Root, {
912
+ children: /* @__PURE__ */ U(o.Root, {
912
913
  open: !0,
913
914
  onOpenChange: (e) => {
914
915
  !e && !p && a();
915
916
  },
916
- children: /* @__PURE__ */ U(o.Content, {
917
+ children: /* @__PURE__ */ W(o.Content, {
917
918
  container: r,
918
919
  overlayClassName: "vibe-shadcn-tiptap__backdrop",
919
- className: J("vibe-shadcn-tiptap__whiteboard", e?.className),
920
+ className: Y("vibe-shadcn-tiptap__whiteboard", e?.className),
920
921
  "data-excalidraw-modal-root": !0,
921
922
  "aria-describedby": void 0,
922
923
  onInteractOutside: (e) => e.preventDefault(),
@@ -933,17 +934,17 @@ function In({ appearance: e, context: t, uploadAsset: n, overlayTarget: r, edit:
933
934
  (e && r.parentElement?.contains(e) ? e : s.view.dom).focus();
934
935
  }
935
936
  },
936
- children: [/* @__PURE__ */ U("header", {
937
- className: J("vibe-shadcn-tiptap__actions", X),
937
+ children: [/* @__PURE__ */ W("header", {
938
+ className: Y("vibe-shadcn-tiptap__actions", Z),
938
939
  children: [
939
- /* @__PURE__ */ H(o.Title, { children: c("command.whiteboard") }),
940
- h && /* @__PURE__ */ H("span", {
940
+ /* @__PURE__ */ U(o.Title, { children: c("command.whiteboard") }),
941
+ h && /* @__PURE__ */ U("span", {
941
942
  role: "alert",
942
943
  children: h
943
944
  }),
944
- /* @__PURE__ */ H(o.Close, {
945
+ /* @__PURE__ */ U(o.Close, {
945
946
  asChild: !0,
946
- children: /* @__PURE__ */ H(Q, {
947
+ children: /* @__PURE__ */ U(Q, {
947
948
  type: "button",
948
949
  className: "vibe-shadcn-tiptap__button",
949
950
  defaultSizeClassName: "px-2 py-1",
@@ -951,21 +952,21 @@ function In({ appearance: e, context: t, uploadAsset: n, overlayTarget: r, edit:
951
952
  children: c("toolbar.action.cancel")
952
953
  })
953
954
  }),
954
- /* @__PURE__ */ U(Q, {
955
+ /* @__PURE__ */ W(Q, {
955
956
  type: "button",
956
957
  variant: "default",
957
958
  className: "vibe-shadcn-tiptap__button vibe-shadcn-tiptap__whiteboard-save",
958
959
  disabled: !d || p,
959
960
  "aria-busy": p || void 0,
960
961
  onClick: () => void C(),
961
- children: [p && /* @__PURE__ */ H(gt, {
962
+ children: [p && /* @__PURE__ */ U(_t, {
962
963
  "aria-hidden": "true",
963
964
  className: "vibe-shadcn-tiptap__spinner",
964
965
  size: 16
965
966
  }), c("whiteboard.save")]
966
967
  })
967
968
  ]
968
- }), /* @__PURE__ */ H("div", {
969
+ }), /* @__PURE__ */ U("div", {
969
970
  ref: u,
970
971
  className: "vibe-shadcn-tiptap__whiteboard-canvas",
971
972
  inert: p
@@ -975,131 +976,131 @@ function In({ appearance: e, context: t, uploadAsset: n, overlayTarget: r, edit:
975
976
  });
976
977
  }
977
978
  // src/shadcn-tiptap-toolbar.tsx
978
- var Ln = {
979
- undo: Ut,
980
- redo: kt,
981
- bold: Fe,
982
- italic: dt,
983
- underline: Ht,
984
- strike: Ft,
985
- code: He,
986
- superscript: Lt,
987
- subscript: It,
988
- color: xt,
989
- highlight: it,
990
- clearFormat: Je,
991
- align: ke,
992
- decreaseIndent: lt,
993
- increaseIndent: ut,
994
- firstLineIndent: Bn,
995
- bulletList: pt,
996
- orderedList: ht,
997
- taskList: mt,
998
- blockquote: Ot,
999
- codeBlock: Ue,
1000
- link: ft,
1001
- image: at,
1002
- video: Ze,
1003
- audio: bt,
1004
- attachment: St,
1005
- table: Rt,
1006
- whiteboard: wt,
1007
- hr: yt,
1008
- findReplace: Pt,
1009
- markdown: Vn,
1010
- print: Dt,
1011
- preview: Xe,
1012
- fullscreen: _t
1013
- }, Rn = {
1014
- left: ke,
1015
- center: De,
1016
- right: Ae,
1017
- justify: Oe
1018
- }, zn = {
1019
- 0: Tt,
1020
- 1: Qe,
1021
- 2: $e,
1022
- 3: et,
1023
- 4: tt,
1024
- 5: nt,
1025
- 6: rt
979
+ var Bn = {
980
+ undo: Wt,
981
+ redo: At,
982
+ bold: Ie,
983
+ italic: ft,
984
+ underline: Ut,
985
+ strike: It,
986
+ code: Ue,
987
+ superscript: Rt,
988
+ subscript: Lt,
989
+ color: St,
990
+ highlight: at,
991
+ clearFormat: Ye,
992
+ align: Ae,
993
+ decreaseIndent: ut,
994
+ increaseIndent: dt,
995
+ firstLineIndent: Un,
996
+ bulletList: mt,
997
+ orderedList: gt,
998
+ taskList: ht,
999
+ blockquote: kt,
1000
+ codeBlock: We,
1001
+ link: pt,
1002
+ image: ot,
1003
+ video: Qe,
1004
+ audio: xt,
1005
+ attachment: Ct,
1006
+ table: zt,
1007
+ whiteboard: Tt,
1008
+ hr: bt,
1009
+ findReplace: Ft,
1010
+ markdown: Wn,
1011
+ print: Ot,
1012
+ preview: Ze,
1013
+ fullscreen: vt
1014
+ }, Vn = {
1015
+ left: Ae,
1016
+ center: Oe,
1017
+ right: je,
1018
+ justify: ke
1019
+ }, Hn = {
1020
+ 0: Et,
1021
+ 1: $e,
1022
+ 2: et,
1023
+ 3: tt,
1024
+ 4: nt,
1025
+ 5: rt,
1026
+ 6: it
1026
1027
  };
1027
- function Bn({ size: e }) {
1028
- return /* @__PURE__ */ H("svg", {
1028
+ function Un({ size: e }) {
1029
+ return /* @__PURE__ */ U("svg", {
1029
1030
  width: e,
1030
1031
  height: e,
1031
- viewBox: en,
1032
+ viewBox: tn,
1032
1033
  fill: "none",
1033
1034
  stroke: "currentColor",
1034
- strokeWidth: Xt.strokeWidth,
1035
+ strokeWidth: Zt.strokeWidth,
1035
1036
  strokeLinecap: "round",
1036
1037
  strokeLinejoin: "round",
1037
1038
  "aria-hidden": "true",
1038
1039
  focusable: "false",
1039
- children: Xt.paths.map((e) => /* @__PURE__ */ H("path", { d: e }, e))
1040
+ children: Zt.paths.map((e) => /* @__PURE__ */ U("path", { d: e }, e))
1040
1041
  });
1041
1042
  }
1042
- function Vn({ size: e, action: t }) {
1043
- return /* @__PURE__ */ U("svg", {
1043
+ function Wn({ size: e, action: t }) {
1044
+ return /* @__PURE__ */ W("svg", {
1044
1045
  width: e,
1045
1046
  height: e,
1046
- viewBox: en,
1047
+ viewBox: tn,
1047
1048
  fill: "none",
1048
1049
  stroke: "currentColor",
1049
- strokeWidth: $t.strokeWidth,
1050
+ strokeWidth: en.strokeWidth,
1050
1051
  strokeLinecap: "round",
1051
1052
  strokeLinejoin: "round",
1052
1053
  "aria-hidden": "true",
1053
1054
  focusable: "false",
1054
- children: [/* @__PURE__ */ H("g", {
1055
- transform: t ? Qt : void 0,
1056
- children: $t.paths.map((e) => /* @__PURE__ */ H("path", { d: e }, e))
1057
- }), t && Zt[t].map((e) => /* @__PURE__ */ H("path", { d: e }, e))]
1055
+ children: [/* @__PURE__ */ U("g", {
1056
+ transform: t ? $t : void 0,
1057
+ children: en.paths.map((e) => /* @__PURE__ */ U("path", { d: e }, e))
1058
+ }), t && Qt[t].map((e) => /* @__PURE__ */ U("path", { d: e }, e))]
1058
1059
  });
1059
1060
  }
1060
- function Hn(e) {
1061
+ function Gn(e) {
1061
1062
  let { components: t, showWordCount: n, ...r } = {
1062
1063
  ...e,
1063
- ...Fn(e)
1064
+ ...Rn(e)
1064
1065
  }, { Tooltip: i } = t;
1065
- return /* @__PURE__ */ H(un, {
1066
+ return /* @__PURE__ */ U(fn, {
1066
1067
  value: t,
1067
- children: /* @__PURE__ */ H(i.Provider, {
1068
+ children: /* @__PURE__ */ U(i.Provider, {
1068
1069
  delayDuration: 500,
1069
1070
  skipDelayDuration: 0,
1070
- children: /* @__PURE__ */ H(Un, { ...r }, r.context.editor.instanceId)
1071
+ children: /* @__PURE__ */ U(Kn, { ...r }, r.context.editor.instanceId)
1071
1072
  })
1072
1073
  });
1073
1074
  }
1074
- function Un(e) {
1075
- let { DropdownMenu: t, Select: n } = Y(), i = e.bubble ? void 0 : e.ui?.toolbar, { context: a, preview: o, fullscreen: c, uploadAsset: u } = e, { editor: f, commands: h, t: _ } = a;
1076
- V(a, (e) => e.getToolbarRevision());
1077
- let [v, y] = q(null), [b, S] = q(), [w, T] = q(!1), [D, O] = q(!1), k = K(null), A = e.overlayTarget ?? v ?? void 0, j = f.isEditable, te = ce(e.editorBehaviorOptions), M = ee(e.toolbarOptions, e.codeBlockLanguages, e.horizontalRules), re = we(() => r(e.colors, e.highlights), [e.colors, e.highlights]), F = P(f), I = m(e.markdownOptions), oe = /* @__PURE__ */ new Map(), se = E(e.toolbar).map((e) => {
1078
- let t = e.join(" "), n = oe.get(t) ?? 0;
1079
- return oe.set(t, n + 1), {
1075
+ function Kn(e) {
1076
+ let { DropdownMenu: t, Select: n } = X(), i = e.bubble ? void 0 : e.ui?.toolbar, { context: a, preview: o, fullscreen: c, uploadAsset: u } = e, { editor: f, commands: h, t: _ } = a;
1077
+ H(a, (e) => e.getToolbarRevision());
1078
+ let [v, y] = J(null), [b, S] = J(), [w, T] = J(!1), [D, O] = J(!1), k = q(null), A = e.overlayTarget ?? v ?? void 0, j = f.isEditable, te = B(e.editorBehaviorOptions), M = ee(e.toolbarOptions, e.codeBlockLanguages, e.horizontalRules), N = Te(() => r(e.colors, e.highlights), [e.colors, e.highlights]), F = ae(f), ie = m(e.markdownOptions), I = /* @__PURE__ */ new Map(), L = E(e.toolbar).map((e) => {
1079
+ let t = e.join(" "), n = I.get(t) ?? 0;
1080
+ return I.set(t, n + 1), {
1080
1081
  id: `${t}:${n}`,
1081
- buttons: e.filter(R)
1082
+ buttons: e.filter(se)
1082
1083
  };
1083
1084
  }).filter(({ buttons: e }) => e.length > 0);
1084
- W(() => {
1085
+ G(() => {
1085
1086
  j || (S(void 0), O(!1));
1086
1087
  }, [j]);
1087
- function R(e) {
1088
- return e === "findReplace" ? typeof f.commands.openFindReplace == "function" : e === "markdown" ? !!F : e === "preview" ? o !== void 0 : e === "fullscreen" ? c !== void 0 : o ? e === "print" : e === "whiteboard" ? !!(u && f.schema.nodes.whiteboard) : e === "image" && !u && !te.image.allowUrl ? !1 : e === "image" || e === "video" || e === "audio" || e === "attachment" ? !!f.schema.nodes[N(e === "attachment" ? "file" : e)] : !0;
1088
+ function se(e) {
1089
+ return e === "findReplace" ? typeof f.commands.openFindReplace == "function" : e === "markdown" ? !!F : e === "preview" ? o !== void 0 : e === "fullscreen" ? c !== void 0 : o ? e === "print" : e === "whiteboard" ? !!(u && f.schema.nodes.whiteboard) : e === "image" && !u && !te.image.allowUrl ? !1 : e === "image" || e === "video" || e === "audio" || e === "attachment" ? !!f.schema.nodes[re(e === "attachment" ? "file" : e)] : !0;
1089
1090
  }
1090
1091
  function z(e, t) {
1091
- return f.isDestroyed ? !0 : e === "print" || e === "fullscreen" || e === "markdown" ? !1 : e === "preview" ? !o && !j : !j && e !== "findReplace" || e !== "whiteboard" && !L(a, e, t);
1092
+ return f.isDestroyed ? !0 : e === "print" || e === "fullscreen" || e === "markdown" ? !1 : e === "preview" ? !o && !j : !j && e !== "findReplace" || e !== "whiteboard" && !R(a, e, t);
1092
1093
  }
1093
- function le(e, t) {
1094
+ function ce(e, t) {
1094
1095
  if (e === "preview") return o;
1095
1096
  if (e === "fullscreen") return c;
1096
- if (e !== "print" && e !== "markdown" && e !== "whiteboard") return ae(a, e, t);
1097
+ if (e !== "print" && e !== "markdown" && e !== "whiteboard") return oe(a, e, t);
1097
1098
  }
1098
- function ue(t, n) {
1099
+ function le(t, n) {
1099
1100
  z(t, n) || (t === "preview" ? e.onPreviewChange?.(!o) : t === "fullscreen" ? e.onFullscreenChange?.(!c) : t === "print" ? g(a.getHTML(), {
1100
1101
  ...e.printOptions,
1101
1102
  t: _
1102
- }) : t === "whiteboard" ? e.openWhiteboard ? e.openWhiteboard() : O(!0) : t === "link" ? e.openLinkPopover?.() : t === "image" ? e.openImagePopover?.() : t === "video" ? e.openVideoPopover?.() : t === "audio" ? e.openAudioPopover?.() : t === "findReplace" && a.findReplaceState.open ? h.closeFindReplace() : t !== "markdown" && B(a, t, n));
1103
+ }) : t === "whiteboard" ? e.openWhiteboard ? e.openWhiteboard() : O(!0) : t === "link" ? e.openLinkPopover?.() : t === "image" ? e.openImagePopover?.() : t === "video" ? e.openVideoPopover?.() : t === "audio" ? e.openAudioPopover?.() : t === "findReplace" && a.findReplaceState.open ? h.closeFindReplace() : t !== "markdown" && ue(a, t, n));
1103
1104
  }
1104
1105
  function de(t, n, r) {
1105
1106
  let i = {
@@ -1119,62 +1120,62 @@ function Un(e) {
1119
1120
  anchor: n
1120
1121
  }
1121
1122
  });
1122
- } else ue(t);
1123
+ } else le(t);
1123
1124
  }
1124
- function fe(r, u) {
1125
+ function V(r, u) {
1125
1126
  let p = `${u}:${r}`;
1126
- if (r === "color" || r === "highlight") return /* @__PURE__ */ H(Cn, {
1127
+ if (r === "color" || r === "highlight") return /* @__PURE__ */ U(En, {
1127
1128
  appearance: e.ui?.colorPicker,
1128
1129
  context: a,
1129
1130
  kind: r,
1130
1131
  disabled: z(r),
1131
- colors: r === "color" ? re.colors : re.highlights,
1132
+ colors: r === "color" ? N.colors : N.highlights,
1132
1133
  overlayTarget: A,
1133
1134
  bubble: e.bubble,
1134
1135
  open: e.bubble ? e.openPalette === r : void 0,
1135
1136
  onOpenChange: (t) => e.onPaletteOpenChange?.(r, t)
1136
1137
  }, r);
1137
1138
  if (r === "heading") {
1138
- let t = i?.heading, o = ne(a), s = zn[o], c = o || f.isActive("paragraph") ? String(o) : "", l = (e) => e ? _("toolbar.heading.level", { level: e }) : _("toolbar.heading.body"), u = /* @__PURE__ */ U("span", {
1139
- className: J("vibe-shadcn-tiptap__heading-value inline-flex items-center gap-2 whitespace-nowrap", t?.valueClassName),
1140
- children: [/* @__PURE__ */ H(s, {
1139
+ let t = i?.heading, o = P(a), s = Hn[o], c = o || f.isActive("paragraph") ? String(o) : "", l = (e) => e ? _("toolbar.heading.level", { level: e }) : _("toolbar.heading.body"), u = /* @__PURE__ */ W("span", {
1140
+ className: Y("vibe-shadcn-tiptap__heading-value inline-flex items-center gap-2 whitespace-nowrap", t?.valueClassName),
1141
+ children: [/* @__PURE__ */ U(s, {
1141
1142
  size: 16,
1142
1143
  "aria-hidden": !0
1143
1144
  }), l(o)]
1144
1145
  });
1145
- return /* @__PURE__ */ U(n.Root, {
1146
+ return /* @__PURE__ */ W(n.Root, {
1146
1147
  value: c,
1147
1148
  disabled: z(r),
1148
- onValueChange: (e) => ue(r, Number(e)),
1149
- children: [/* @__PURE__ */ H(n.Trigger, {
1149
+ onValueChange: (e) => le(r, Number(e)),
1150
+ children: [/* @__PURE__ */ U(n.Trigger, {
1150
1151
  asChild: !0,
1151
- children: /* @__PURE__ */ U(Q, {
1152
+ children: /* @__PURE__ */ W(Q, {
1152
1153
  appearance: t?.button,
1153
1154
  type: "button",
1154
1155
  className: "vibe-shadcn-tiptap__button",
1155
1156
  "aria-label": _("command.heading"),
1156
1157
  "data-toolbar-key": e.bubble ? void 0 : r,
1157
1158
  onMouseDown: (e) => e.preventDefault(),
1158
- children: [/* @__PURE__ */ H(n.Value, {
1159
+ children: [/* @__PURE__ */ U(n.Value, {
1159
1160
  placeholder: u,
1160
1161
  children: u
1161
- }), /* @__PURE__ */ H(Re, { size: 12 })]
1162
+ }), /* @__PURE__ */ U(ze, { size: 12 })]
1162
1163
  })
1163
- }), A && /* @__PURE__ */ H(n.Content, {
1164
+ }), A && /* @__PURE__ */ U(n.Content, {
1164
1165
  container: A,
1165
1166
  position: "item-aligned",
1166
- className: J("z-3", t?.contentClassName),
1167
+ className: Y("z-3", t?.contentClassName),
1167
1168
  onCloseAutoFocus: (e) => {
1168
1169
  f.isFocused && e.preventDefault();
1169
1170
  },
1170
1171
  children: C.map(({ level: e }) => {
1171
- let i = zn[e], a = String(e) === c;
1172
- return /* @__PURE__ */ U(n.Item, {
1172
+ let i = Hn[e], a = String(e) === c;
1173
+ return /* @__PURE__ */ W(n.Item, {
1173
1174
  value: String(e),
1174
- className: J("vibe-shadcn-tiptap__menu-item", t?.itemClassName),
1175
+ className: Y("vibe-shadcn-tiptap__menu-item", t?.itemClassName),
1175
1176
  disabled: !a && z(r, e),
1176
1177
  "data-active": a || void 0,
1177
- children: [/* @__PURE__ */ H(i, {
1178
+ children: [/* @__PURE__ */ U(i, {
1178
1179
  size: 16,
1179
1180
  "aria-hidden": !0
1180
1181
  }), l(e)]
@@ -1183,21 +1184,21 @@ function Un(e) {
1183
1184
  })]
1184
1185
  }, r);
1185
1186
  }
1186
- let m = r === "preview" && o ? Ct : r === "fullscreen" && c ? vt : r === "align" ? Rn[ie(a)] : Ln[r], h = _(r === "preview" && o ? "toolbar.preview.edit" : r === "fullscreen" && c ? "toolbar.fullscreen.exit" : `command.${r}`), g = /* @__PURE__ */ H($, {
1187
+ let m = r === "preview" && o ? wt : r === "fullscreen" && c ? yt : r === "align" ? Vn[ne(a)] : Bn[r], h = _(r === "preview" && o ? "toolbar.preview.edit" : r === "fullscreen" && c ? "toolbar.fullscreen.exit" : `command.${r}`), g = /* @__PURE__ */ U($, {
1187
1188
  size: "icon",
1188
1189
  label: h,
1189
1190
  overlayTarget: A,
1190
1191
  "data-toolbar-key": e.bubble ? void 0 : r,
1191
1192
  disabled: z(r),
1192
- "aria-pressed": r === "findReplace" ? void 0 : le(r),
1193
+ "aria-pressed": r === "findReplace" ? void 0 : ce(r),
1193
1194
  "aria-expanded": r === "findReplace" ? a.findReplaceState.open : r === "link" || r === "image" || r === "video" || r === "audio" || r === "attachment" ? b?.triggerId === p : void 0,
1194
1195
  onMouseDown: (e) => e.preventDefault(),
1195
- children: /* @__PURE__ */ H(m, {
1196
+ children: /* @__PURE__ */ U(m, {
1196
1197
  size: 16,
1197
1198
  "aria-hidden": !0
1198
1199
  })
1199
1200
  });
1200
- if (r === "table") return /* @__PURE__ */ H(jn, {
1201
+ if (r === "table") return /* @__PURE__ */ U(Pn, {
1201
1202
  appearance: e.ui?.tablePicker,
1202
1203
  context: a,
1203
1204
  trigger: g,
@@ -1205,26 +1206,26 @@ function Un(e) {
1205
1206
  options: M.tableGrid,
1206
1207
  disabled: z(r)
1207
1208
  }, r);
1208
- if (r === "markdown") return /* @__PURE__ */ U(t.Root, {
1209
+ if (r === "markdown") return /* @__PURE__ */ W(t.Root, {
1209
1210
  modal: !1,
1210
- children: [/* @__PURE__ */ H(t.Trigger, {
1211
+ children: [/* @__PURE__ */ U(t.Trigger, {
1211
1212
  asChild: !0,
1212
1213
  children: g
1213
- }), A && /* @__PURE__ */ H(t.Content, {
1214
+ }), A && /* @__PURE__ */ U(t.Content, {
1214
1215
  container: A,
1215
1216
  className: "z-3",
1216
1217
  sideOffset: 4,
1217
1218
  align: "start",
1218
- children: s.map(({ value: e }) => /* @__PURE__ */ U(t.Item, {
1219
+ children: s.map(({ value: e }) => /* @__PURE__ */ W(t.Item, {
1219
1220
  className: "vibe-shadcn-tiptap__menu-item",
1220
1221
  disabled: e === "import" ? o || !j || w || !F?.parse : !F?.serialize,
1221
1222
  onSelect: () => {
1222
1223
  e === "import" ? k.current?.click() : e === "export" ? d(a, {
1223
- filename: I.exportFilename,
1224
+ filename: ie.exportFilename,
1224
1225
  t: _
1225
1226
  }) : l(a, { t: _ });
1226
1227
  },
1227
- children: [/* @__PURE__ */ H(Vn, {
1228
+ children: [/* @__PURE__ */ U(Wn, {
1228
1229
  size: 16,
1229
1230
  action: e
1230
1231
  }), _(`toolbar.markdown.${e}`)]
@@ -1233,11 +1234,11 @@ function Un(e) {
1233
1234
  }, r);
1234
1235
  let v = (() => {
1235
1236
  if (r === "align") return x.map(({ value: e }) => {
1236
- let t = Rn[e];
1237
+ let t = Vn[e];
1237
1238
  return {
1238
1239
  value: e,
1239
1240
  label: _(`toolbar.align.${e}`),
1240
- icon: /* @__PURE__ */ H(t, {
1241
+ icon: /* @__PURE__ */ U(t, {
1241
1242
  size: 16,
1242
1243
  "aria-hidden": !0
1243
1244
  })
@@ -1246,19 +1247,19 @@ function Un(e) {
1246
1247
  if (r === "codeBlock") return M.codeBlockLanguages;
1247
1248
  if (r === "hr") return M.horizontalRules.map((e) => ({
1248
1249
  ...e,
1249
- icon: /* @__PURE__ */ H("span", {
1250
+ icon: /* @__PURE__ */ U("span", {
1250
1251
  className: "vibe-shadcn-tiptap__divider-icon",
1251
1252
  "data-style": e.value,
1252
1253
  "aria-hidden": !0
1253
1254
  })
1254
1255
  }));
1255
1256
  })();
1256
- return v ? /* @__PURE__ */ U(t.Root, {
1257
+ return v ? /* @__PURE__ */ W(t.Root, {
1257
1258
  modal: !1,
1258
- children: [/* @__PURE__ */ H(t.Trigger, {
1259
+ children: [/* @__PURE__ */ U(t.Trigger, {
1259
1260
  asChild: !0,
1260
1261
  children: g
1261
- }), A && /* @__PURE__ */ H(t.Content, {
1262
+ }), A && /* @__PURE__ */ U(t.Content, {
1262
1263
  container: A,
1263
1264
  align: "start",
1264
1265
  sideOffset: 4,
@@ -1266,40 +1267,40 @@ function Un(e) {
1266
1267
  onCloseAutoFocus: (e) => {
1267
1268
  f.isFocused && e.preventDefault();
1268
1269
  },
1269
- children: v.map(({ value: e, label: n, icon: i }) => /* @__PURE__ */ U(t.Item, {
1270
+ children: v.map(({ value: e, label: n, icon: i }) => /* @__PURE__ */ W(t.Item, {
1270
1271
  className: "vibe-shadcn-tiptap__menu-item",
1271
1272
  disabled: z(r, e),
1272
- "data-active": le(r, e) || void 0,
1273
- onSelect: () => ue(r, e),
1273
+ "data-active": ce(r, e) || void 0,
1274
+ onSelect: () => le(r, e),
1274
1275
  children: [i, n]
1275
1276
  }, e))
1276
1277
  })]
1277
- }, r) : /* @__PURE__ */ ve($, {
1278
+ }, r) : /* @__PURE__ */ ye($, {
1278
1279
  ...g.props,
1279
1280
  key: r,
1280
1281
  onClick: (e) => de(r, e.currentTarget, p)
1281
1282
  });
1282
1283
  }
1283
- return /* @__PURE__ */ H(Z, {
1284
+ return /* @__PURE__ */ U(gn, {
1284
1285
  value: e.bubble ? e.ui?.bubble?.button : i?.button,
1285
- children: /* @__PURE__ */ U("div", {
1286
+ children: /* @__PURE__ */ W("div", {
1286
1287
  ref: y,
1287
- className: J("vibe-shadcn-tiptap__toolbar", X, !e.bubble && "border-b border-border p-1.5", i?.className),
1288
+ className: Y("vibe-shadcn-tiptap__toolbar", Z, !e.bubble && "border-b border-border p-1.5", i?.className),
1288
1289
  role: "toolbar",
1289
1290
  "aria-label": e.bubble ? void 0 : "Editor toolbar",
1290
1291
  children: [
1291
- F && !e.bubble && /* @__PURE__ */ H("input", {
1292
+ F && !e.bubble && /* @__PURE__ */ U("input", {
1292
1293
  ref: k,
1293
1294
  type: "file",
1294
1295
  hidden: !0,
1295
- accept: I.importAccept,
1296
+ accept: ie.importAccept,
1296
1297
  onChange: async (e) => {
1297
1298
  let t = e.currentTarget, n = t.files?.[0];
1298
1299
  if (t.value = "", n && j && F?.parse && !w) {
1299
1300
  T(!0);
1300
1301
  try {
1301
1302
  await p(a, n, {
1302
- strict: I.importStrict,
1303
+ strict: ie.importStrict,
1303
1304
  t: _,
1304
1305
  canImport: () => k.current === t && f.isEditable && !f.isDestroyed
1305
1306
  });
@@ -1309,11 +1310,11 @@ function Un(e) {
1309
1310
  }
1310
1311
  }
1311
1312
  }),
1312
- se.map(({ id: e, buttons: t }, n) => /* @__PURE__ */ H("div", {
1313
- className: J("vibe-shadcn-tiptap__toolbar-group", X, n > 0 && "border-s border-border ps-1", i?.groupClassName),
1314
- children: t.map((t) => fe(t, e))
1313
+ L.map(({ id: e, buttons: t }, n) => /* @__PURE__ */ U("div", {
1314
+ className: Y("vibe-shadcn-tiptap__toolbar-group", Z, n > 0 && "border-s border-border ps-1", i?.groupClassName),
1315
+ children: t.map((t) => V(t, e))
1315
1316
  }, e)),
1316
- j && b && A && /* @__PURE__ */ H(wn, {
1317
+ j && b && A && /* @__PURE__ */ U(Dn, {
1317
1318
  appearance: e.ui?.insertionPopover,
1318
1319
  context: a,
1319
1320
  request: b.request,
@@ -1322,7 +1323,7 @@ function Un(e) {
1322
1323
  behaviorOptions: e.editorBehaviorOptions,
1323
1324
  onClose: () => S(void 0)
1324
1325
  }, b.triggerId),
1325
- j && D && u && A && /* @__PURE__ */ H(In, {
1326
+ j && D && u && A && /* @__PURE__ */ U(zn, {
1326
1327
  appearance: e.ui?.whiteboard,
1327
1328
  context: a,
1328
1329
  uploadAsset: u,
@@ -1334,7 +1335,7 @@ function Un(e) {
1334
1335
  });
1335
1336
  }
1336
1337
  // src/editor-bubble.tsx
1337
- var Wn = "vibeRadixBubble", Gn = 8, Kn = [
1338
+ var qn = "vibeRadixBubble", Jn = 8, Yn = [
1338
1339
  "bold",
1339
1340
  "italic",
1340
1341
  "underline",
@@ -1343,19 +1344,19 @@ var Wn = "vibeRadixBubble", Gn = 8, Kn = [
1343
1344
  "color",
1344
1345
  "highlight",
1345
1346
  "clearFormat"
1346
- ], qn = /* @__PURE__ */ new Set([
1347
+ ], Xn = /* @__PURE__ */ new Set([
1347
1348
  "image",
1348
1349
  "video",
1349
1350
  "audio",
1350
1351
  "fileAttachment",
1351
1352
  "whiteboard"
1352
1353
  ]);
1353
- function Jn(e) {
1354
+ function Zn(e) {
1354
1355
  let { selection: t, schema: n, doc: r } = e.state, i = n.marks.link;
1355
- if (!(t instanceof Ee) || !i) return;
1356
+ if (!(t instanceof De) || !i) return;
1356
1357
  let a = i.isInSet(t.$from.nodeAfter?.marks ?? []), o = a?.attrs.href, s = a?.attrs.target;
1357
1358
  if (!a || typeof o != "string" || !o) return;
1358
- let c = he(t.$from, i, a.attrs);
1359
+ let c = ge(t.$from, i, a.attrs);
1359
1360
  if (!(!c || t.to > c.to || t.from < c.from)) return {
1360
1361
  ...c,
1361
1362
  href: o,
@@ -1363,16 +1364,16 @@ function Jn(e) {
1363
1364
  target: typeof s == "string" ? s : void 0
1364
1365
  };
1365
1366
  }
1366
- function Yn({ editor: e, element: t }) {
1367
+ function Qn({ editor: e, element: t }) {
1367
1368
  if (e.isDestroyed || !e.isEditable) return !1;
1368
1369
  let { view: n, state: { selection: r } } = e, i = n.dom.ownerDocument.activeElement;
1369
- return !n.hasFocus() && !t.contains(i) && i?.closest("[data-bubble-palette]")?.getAttribute("data-bubble-palette") !== String(e.instanceId) || e.isActive("codeBlock") ? !1 : r instanceof Te ? qn.has(r.node.type.name) && r.node.attrs.uploadStatus !== "uploading" : !!Jn(e) || Xn(e);
1370
+ return !n.hasFocus() && !t.contains(i) && i?.closest("[data-bubble-palette]")?.getAttribute("data-bubble-palette") !== String(e.instanceId) || e.isActive("codeBlock") ? !1 : r instanceof Ee ? Xn.has(r.node.type.name) && r.node.attrs.uploadStatus !== "uploading" : !!Zn(e) || $n(e);
1370
1371
  }
1371
- function Xn(e) {
1372
+ function $n(e) {
1372
1373
  let { selection: t, doc: n } = e.state;
1373
- return t instanceof Ee && !t.empty && !e.isActive("table") && !e.isActive("codeBlock") && !!n.textBetween(t.from, t.to);
1374
+ return t instanceof De && !t.empty && !e.isActive("table") && !e.isActive("codeBlock") && !!n.textBetween(t.from, t.to);
1374
1375
  }
1375
- async function Zn(e, t, n = !1) {
1376
+ async function er(e, t, n = !1) {
1376
1377
  let { editor: r, notify: i, t: a } = e;
1377
1378
  try {
1378
1379
  let e = r.view.dom.ownerDocument.defaultView?.navigator.clipboard;
@@ -1382,17 +1383,17 @@ async function Zn(e, t, n = !1) {
1382
1383
  i(a("notify.clipboardUnavailable"), "warning");
1383
1384
  }
1384
1385
  }
1385
- function Qn({ ui: e, context: t, overlayTarget: n, colors: r, highlights: i, uploadAsset: a, behaviorOptions: o, onLink: s, onWhiteboardEdit: c, onPaletteOpenChange: l }) {
1386
+ function tr({ ui: e, context: t, overlayTarget: n, colors: r, highlights: i, uploadAsset: a, behaviorOptions: o, onLink: s, onWhiteboardEdit: c, onPaletteOpenChange: l }) {
1386
1387
  let { editor: u, t: d, commands: f, notify: p } = t;
1387
- V(t, (e) => e.getToolbarRevision());
1388
- let [m, h] = q(), [g, _] = q(null), v = K(null);
1389
- G(() => {
1388
+ H(t, (e) => e.getToolbarRevision());
1389
+ let [m, h] = J(), [g, _] = J(null), v = q(null);
1390
+ K(() => {
1390
1391
  _(u.view.dom.parentElement);
1391
- }, [u]), G(() => {
1392
+ }, [u]), K(() => {
1392
1393
  let e = v.current, t = e?.ownerDocument.defaultView?.ResizeObserver;
1393
1394
  if (!g || !e) return;
1394
1395
  let n = () => {
1395
- e.isConnected && !u.isDestroyed && u.view.dispatch(u.state.tr.setMeta(Wn, "updatePosition"));
1396
+ e.isConnected && !u.isDestroyed && u.view.dispatch(u.state.tr.setMeta(qn, "updatePosition"));
1396
1397
  }, r = t && new t(n);
1397
1398
  r?.observe(e), r?.observe(g);
1398
1399
  let i = g.ownerDocument, a = ({ target: e }) => {
@@ -1402,14 +1403,14 @@ function Qn({ ui: e, context: t, overlayTarget: n, colors: r, highlights: i, upl
1402
1403
  r?.disconnect(), i.removeEventListener("scroll", a, !0);
1403
1404
  };
1404
1405
  }, [u, g]);
1405
- let y = we(() => {
1406
+ let y = Te(() => {
1406
1407
  if (!g) return;
1407
1408
  let e = {
1408
1409
  boundary: g,
1409
- padding: Gn
1410
+ padding: Jn
1410
1411
  };
1411
1412
  return {
1412
- offset: Gn,
1413
+ offset: Jn,
1413
1414
  flip: e,
1414
1415
  shift: {
1415
1416
  ...e,
@@ -1427,15 +1428,15 @@ function Qn({ ui: e, context: t, overlayTarget: n, colors: r, highlights: i, upl
1427
1428
  },
1428
1429
  scrollTarget: g
1429
1430
  };
1430
- }, [g, l]), { selection: b } = u.state, x = Jn(u), S = !x && Xn(u);
1431
- G(() => {
1431
+ }, [g, l]), { selection: b } = u.state, x = Zn(u), S = !x && $n(u);
1432
+ K(() => {
1432
1433
  !S && m && (h(void 0), l(!1));
1433
1434
  }, [
1434
1435
  S,
1435
1436
  m,
1436
1437
  l
1437
1438
  ]);
1438
- let C = Kn.filter((e) => e === "clearFormat" || !!u.schema.marks[e === "color" ? "textStyle" : e]), w;
1439
+ let C = Yn.filter((e) => e === "clearFormat" || !!u.schema.marks[e === "color" ? "textStyle" : e]), w;
1439
1440
  if (x) try {
1440
1441
  let e = new URL(x.href, u.view.dom.ownerDocument.baseURI);
1441
1442
  [
@@ -1448,84 +1449,84 @@ function Qn({ ui: e, context: t, overlayTarget: n, colors: r, highlights: i, upl
1448
1449
  } catch {
1449
1450
  w = void 0;
1450
1451
  }
1451
- return g ? /* @__PURE__ */ H(Z, {
1452
+ return g ? /* @__PURE__ */ U(gn, {
1452
1453
  value: e?.bubble?.button,
1453
- children: /* @__PURE__ */ H(D, {
1454
+ children: /* @__PURE__ */ U(D, {
1454
1455
  editor: u,
1455
- pluginKey: Wn,
1456
+ pluginKey: qn,
1456
1457
  appendTo: n,
1457
1458
  updateDelay: 0,
1458
1459
  resizeDelay: 0,
1459
1460
  options: y,
1460
- shouldShow: Yn,
1461
+ shouldShow: Qn,
1461
1462
  className: "vibe-shadcn-tiptap__bubble-host",
1462
- children: /* @__PURE__ */ H("div", {
1463
+ children: /* @__PURE__ */ U("div", {
1463
1464
  ref: v,
1464
1465
  role: "toolbar",
1465
1466
  "aria-label": "Selection toolbar",
1466
- className: J("z-3 vibe-shadcn-tiptap__bubble p-0.5", dn, e?.bubble?.className),
1467
+ className: Y("z-3 vibe-shadcn-tiptap__bubble p-0.5", pn, e?.bubble?.className),
1467
1468
  onMouseDown: (e) => e.preventDefault(),
1468
- children: b instanceof Te ? /* @__PURE__ */ H(xn, {
1469
+ children: b instanceof Ee ? /* @__PURE__ */ U(wn, {
1469
1470
  context: t,
1470
1471
  selection: b,
1471
1472
  overlayTarget: n,
1472
1473
  uploadAsset: a,
1473
1474
  behaviorOptions: o,
1474
- onCaptionFocus: () => u.view.dispatch(u.state.tr.setMeta(Wn, "hide")),
1475
- onCopyUrl: (e, n) => void Zn(t, e, n),
1475
+ onCaptionFocus: () => u.view.dispatch(u.state.tr.setMeta(qn, "hide")),
1476
+ onCopyUrl: (e, n) => void er(t, e, n),
1476
1477
  onWhiteboardEdit: c
1477
- }) : x ? /* @__PURE__ */ U("div", {
1478
- className: J("vibe-shadcn-tiptap__actions", X),
1478
+ }) : x ? /* @__PURE__ */ W("div", {
1479
+ className: Y("vibe-shadcn-tiptap__actions", Z),
1479
1480
  children: [
1480
- /* @__PURE__ */ H($, {
1481
+ /* @__PURE__ */ U($, {
1481
1482
  label: d("toolbar.link.edit"),
1482
1483
  overlayTarget: n,
1483
1484
  onClick: () => s({
1484
1485
  kind: "link",
1485
1486
  link: x
1486
1487
  }),
1487
- children: /* @__PURE__ */ H(Ct, {
1488
+ children: /* @__PURE__ */ U(wt, {
1488
1489
  size: 16,
1489
1490
  "aria-hidden": !0
1490
1491
  })
1491
1492
  }),
1492
- /* @__PURE__ */ H(Q, {
1493
+ /* @__PURE__ */ U(Q, {
1493
1494
  asChild: !0,
1494
1495
  className: "vibe-shadcn-tiptap__button",
1495
- children: /* @__PURE__ */ H("a", {
1496
+ children: /* @__PURE__ */ U("a", {
1496
1497
  "aria-label": d("toolbar.link.open"),
1497
1498
  href: w,
1498
1499
  "aria-disabled": !w || void 0,
1499
1500
  target: x.target || "_blank",
1500
1501
  rel: "noopener noreferrer",
1501
- children: /* @__PURE__ */ H(Ye, {
1502
+ children: /* @__PURE__ */ U(Xe, {
1502
1503
  size: 16,
1503
1504
  "aria-hidden": !0
1504
1505
  })
1505
1506
  })
1506
1507
  }),
1507
- /* @__PURE__ */ H($, {
1508
+ /* @__PURE__ */ U($, {
1508
1509
  label: d("toolbar.link.copy"),
1509
1510
  overlayTarget: n,
1510
- onClick: () => void Zn(t, x.href),
1511
- children: /* @__PURE__ */ H(We, {
1511
+ onClick: () => void er(t, x.href),
1512
+ children: /* @__PURE__ */ U(Ge, {
1512
1513
  size: 16,
1513
1514
  "aria-hidden": !0
1514
1515
  })
1515
1516
  }),
1516
- /* @__PURE__ */ H($, {
1517
+ /* @__PURE__ */ U($, {
1517
1518
  label: d("toolbar.link.remove"),
1518
1519
  overlayTarget: n,
1519
1520
  onClick: () => {
1520
1521
  f.setLink("", { range: x }), p(d("notify.linkRemoved"), "success");
1521
1522
  },
1522
- children: /* @__PURE__ */ H(Wt, {
1523
+ children: /* @__PURE__ */ U(Gt, {
1523
1524
  size: 16,
1524
1525
  "aria-hidden": !0
1525
1526
  })
1526
1527
  })
1527
1528
  ]
1528
- }) : S ? /* @__PURE__ */ H(Un, {
1529
+ }) : S ? /* @__PURE__ */ U(Kn, {
1529
1530
  context: t,
1530
1531
  ui: e,
1531
1532
  toolbar: [C],
@@ -1544,16 +1545,16 @@ function Qn({ ui: e, context: t, overlayTarget: n, colors: r, highlights: i, upl
1544
1545
  }) : null;
1545
1546
  }
1546
1547
  // src/find-replace.tsx
1547
- function $n({ appearance: e, context: t, editable: n, overlayTarget: r }) {
1548
- let { InputGroup: i } = Y(), { editor: a, commands: o, t: s } = t, c = V(t, (e) => e.findReplaceState), l = K(null), u = K(null), [d, f] = q(0);
1549
- if (W(() => {
1548
+ function nr({ appearance: e, context: t, editable: n, overlayTarget: r }) {
1549
+ let { InputGroup: i } = X(), { editor: a, commands: o, t: s } = t, c = H(t, (e) => e.findReplaceState), l = q(null), u = q(null), [d, f] = J(0);
1550
+ if (G(() => {
1550
1551
  let e = ({ transaction: e }) => {
1551
- I(e) && f((e) => e + 1);
1552
+ L(e) && f((e) => e + 1);
1552
1553
  };
1553
1554
  return a.on("transaction", e), () => {
1554
1555
  a.off("transaction", e);
1555
1556
  };
1556
- }, [a]), G(() => {
1557
+ }, [a]), K(() => {
1557
1558
  if (!c?.open) {
1558
1559
  u.current?.focus({ preventScroll: !0 }), u.current = null;
1559
1560
  return;
@@ -1564,28 +1565,28 @@ function $n({ appearance: e, context: t, editable: n, overlayTarget: r }) {
1564
1565
  function p(e, t) {
1565
1566
  e ? o.findReplacePrevious() : o.findReplaceNext(), t.focus({ preventScroll: !0 });
1566
1567
  }
1567
- let m = c.matches.length > 0, h = J("vibe-shadcn-tiptap__find-field h-8 min-w-0 flex-1", fn[e?.input?.variant ?? "default"], e?.inputGroupClassName), g = J("h-full", e?.input?.className);
1568
- return /* @__PURE__ */ H(Z, {
1568
+ let m = c.matches.length > 0, h = Y("vibe-shadcn-tiptap__find-field h-8 min-w-0 flex-1", mn[e?.input?.variant ?? "default"], e?.inputGroupClassName), g = Y("h-full", e?.input?.className);
1569
+ return /* @__PURE__ */ U(gn, {
1569
1570
  value: e?.button,
1570
- children: /* @__PURE__ */ U("div", {
1571
- className: J("vibe-shadcn-tiptap__find vibe-shadcn-tiptap__compact-fields absolute top-2 right-2 z-2 box-border grid w-[min(400px,calc(100%-16px))] gap-1.5 p-1.5", dn, e?.className),
1571
+ children: /* @__PURE__ */ W("div", {
1572
+ className: Y("vibe-shadcn-tiptap__find vibe-shadcn-tiptap__compact-fields absolute top-2 right-2 z-2 box-border grid w-[min(400px,calc(100%-16px))] gap-1.5 p-1.5", pn, e?.className),
1572
1573
  role: "search",
1573
1574
  "aria-label": s("command.findReplace"),
1574
1575
  onKeyDown: (e) => {
1575
1576
  !e.nativeEvent.isComposing && e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), o.closeFindReplace());
1576
1577
  },
1577
- children: [/* @__PURE__ */ U("div", {
1578
- className: J("vibe-shadcn-tiptap__find-row", X),
1578
+ children: [/* @__PURE__ */ W("div", {
1579
+ className: Y("vibe-shadcn-tiptap__find-row", Z),
1579
1580
  children: [
1580
- /* @__PURE__ */ U(i.Root, {
1581
+ /* @__PURE__ */ W(i.Root, {
1581
1582
  className: h,
1582
1583
  children: [
1583
- /* @__PURE__ */ H(i.Addon, {
1584
+ /* @__PURE__ */ U(i.Addon, {
1584
1585
  align: "inline-start",
1585
1586
  "aria-hidden": !0,
1586
- children: /* @__PURE__ */ H(Pt, { size: 16 })
1587
+ children: /* @__PURE__ */ U(Ft, { size: 16 })
1587
1588
  }),
1588
- /* @__PURE__ */ H(i.Input, {
1589
+ /* @__PURE__ */ U(i.Input, {
1589
1590
  className: g,
1590
1591
  ref: l,
1591
1592
  "aria-label": s("findReplace.query"),
@@ -1596,15 +1597,15 @@ function $n({ appearance: e, context: t, editable: n, overlayTarget: r }) {
1596
1597
  e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), m && p(e.shiftKey, e.currentTarget));
1597
1598
  }
1598
1599
  }),
1599
- /* @__PURE__ */ H(i.Addon, {
1600
+ /* @__PURE__ */ U(i.Addon, {
1600
1601
  align: "inline-end",
1601
- children: /* @__PURE__ */ H($, {
1602
+ children: /* @__PURE__ */ U($, {
1602
1603
  size: "icon-sm",
1603
1604
  label: s("findReplace.caseSensitive"),
1604
1605
  overlayTarget: r,
1605
1606
  "aria-pressed": c.caseSensitive,
1606
1607
  onClick: () => o.setFindReplaceCaseSensitive(!c.caseSensitive),
1607
- children: /* @__PURE__ */ H(Le, {
1608
+ children: /* @__PURE__ */ U(Re, {
1608
1609
  size: 16,
1609
1610
  "aria-hidden": !0
1610
1611
  })
@@ -1612,56 +1613,56 @@ function $n({ appearance: e, context: t, editable: n, overlayTarget: r }) {
1612
1613
  })
1613
1614
  ]
1614
1615
  }),
1615
- /* @__PURE__ */ H("span", {
1616
+ /* @__PURE__ */ U("span", {
1616
1617
  role: "status",
1617
1618
  children: s("findReplace.count", {
1618
1619
  current: m ? c.activeIndex + 1 : 0,
1619
1620
  total: c.matches.length
1620
1621
  })
1621
1622
  }),
1622
- /* @__PURE__ */ H($, {
1623
+ /* @__PURE__ */ U($, {
1623
1624
  size: "icon-sm",
1624
1625
  label: s("findReplace.previous"),
1625
1626
  overlayTarget: r,
1626
1627
  disabled: !m,
1627
1628
  onClick: (e) => p(!0, e.currentTarget),
1628
- children: /* @__PURE__ */ H(Ve, {
1629
+ children: /* @__PURE__ */ U(He, {
1629
1630
  size: 16,
1630
1631
  "aria-hidden": !0
1631
1632
  })
1632
1633
  }),
1633
- /* @__PURE__ */ H($, {
1634
+ /* @__PURE__ */ U($, {
1634
1635
  size: "icon-sm",
1635
1636
  label: s("findReplace.next"),
1636
1637
  overlayTarget: r,
1637
1638
  disabled: !m,
1638
1639
  onClick: (e) => p(!1, e.currentTarget),
1639
- children: /* @__PURE__ */ H(Re, {
1640
+ children: /* @__PURE__ */ U(ze, {
1640
1641
  size: 16,
1641
1642
  "aria-hidden": !0
1642
1643
  })
1643
1644
  }),
1644
- /* @__PURE__ */ H($, {
1645
+ /* @__PURE__ */ U($, {
1645
1646
  size: "icon-sm",
1646
1647
  label: s("findReplace.close"),
1647
1648
  overlayTarget: r,
1648
1649
  onClick: () => o.closeFindReplace(),
1649
- children: /* @__PURE__ */ H(qt, {
1650
+ children: /* @__PURE__ */ U(Jt, {
1650
1651
  size: 16,
1651
1652
  "aria-hidden": !0
1652
1653
  })
1653
1654
  })
1654
1655
  ]
1655
- }), n && /* @__PURE__ */ U("div", {
1656
- className: J("vibe-shadcn-tiptap__find-row", "flex flex-wrap items-center gap-1"),
1656
+ }), n && /* @__PURE__ */ W("div", {
1657
+ className: Y("vibe-shadcn-tiptap__find-row", "flex flex-wrap items-center gap-1"),
1657
1658
  children: [
1658
- /* @__PURE__ */ U(i.Root, {
1659
+ /* @__PURE__ */ W(i.Root, {
1659
1660
  className: h,
1660
- children: [/* @__PURE__ */ H(i.Addon, {
1661
+ children: [/* @__PURE__ */ U(i.Addon, {
1661
1662
  align: "inline-start",
1662
1663
  "aria-hidden": !0,
1663
- children: /* @__PURE__ */ H(At, { size: 16 })
1664
- }), /* @__PURE__ */ H(i.Input, {
1664
+ children: /* @__PURE__ */ U(jt, { size: 16 })
1665
+ }), /* @__PURE__ */ U(i.Input, {
1665
1666
  className: g,
1666
1667
  "aria-label": s("findReplace.replacement"),
1667
1668
  placeholder: s("findReplace.replacement"),
@@ -1672,24 +1673,24 @@ function $n({ appearance: e, context: t, editable: n, overlayTarget: r }) {
1672
1673
  }
1673
1674
  })]
1674
1675
  }),
1675
- /* @__PURE__ */ H($, {
1676
+ /* @__PURE__ */ U($, {
1676
1677
  size: "icon-sm",
1677
1678
  label: s("findReplace.replace"),
1678
1679
  overlayTarget: r,
1679
1680
  disabled: !m,
1680
1681
  onClick: () => o.replaceFindReplaceCurrent(),
1681
- children: /* @__PURE__ */ H(At, {
1682
+ children: /* @__PURE__ */ U(jt, {
1682
1683
  size: 16,
1683
1684
  "aria-hidden": !0
1684
1685
  })
1685
1686
  }),
1686
- /* @__PURE__ */ H($, {
1687
+ /* @__PURE__ */ U($, {
1687
1688
  size: "icon-sm",
1688
1689
  label: s("findReplace.replaceAll"),
1689
1690
  overlayTarget: r,
1690
1691
  disabled: !m,
1691
1692
  onClick: () => o.replaceFindReplaceAll(),
1692
- children: /* @__PURE__ */ H(jt, {
1693
+ children: /* @__PURE__ */ U(Mt, {
1693
1694
  size: 16,
1694
1695
  "aria-hidden": !0
1695
1696
  })
@@ -1700,7 +1701,7 @@ function $n({ appearance: e, context: t, editable: n, overlayTarget: r }) {
1700
1701
  });
1701
1702
  }
1702
1703
  // src/image-preview-dialog.tsx
1703
- function er(e, t) {
1704
+ function rr(e, t) {
1704
1705
  if (!e) return {};
1705
1706
  let n;
1706
1707
  try {
@@ -1721,18 +1722,18 @@ function er(e, t) {
1721
1722
  name: i
1722
1723
  };
1723
1724
  }
1724
- function tr({ appearance: e, context: { editor: t, t: n }, overlayTarget: r, imagePreview: i, onClose: a }) {
1725
- let { Dialog: o } = Y(), { urls: s } = i, [c, l] = q(i.index), [u, d] = q(0), [f, p] = q(100), m = K(null), h = K(null), g = K(null), _ = K(null), v = s.length > 1, y = s[c], { href: b, name: x } = er(y, r.ownerDocument.baseURI), S = i.names?.[c] || x, C = S || n("command.image");
1725
+ function ir({ appearance: e, context: { editor: t, t: n }, overlayTarget: r, imagePreview: i, onClose: a }) {
1726
+ let { Dialog: o } = X(), { urls: s } = i, [c, l] = J(i.index), [u, d] = J(0), [f, p] = J(100), m = q(null), h = q(null), g = q(null), _ = q(null), v = s.length > 1, y = s[c], { href: b, name: x } = rr(y, r.ownerDocument.baseURI), S = i.names?.[c] || x, C = S || n("command.image");
1726
1727
  function w(e) {
1727
1728
  v && (m.current = null, d(0), p(100), l((t) => (t + e + s.length) % s.length));
1728
1729
  }
1729
- return /* @__PURE__ */ H(o.Root, {
1730
+ return /* @__PURE__ */ U(o.Root, {
1730
1731
  open: !0,
1731
1732
  onOpenChange: (e) => !e && a(),
1732
- children: /* @__PURE__ */ U(o.Content, {
1733
+ children: /* @__PURE__ */ W(o.Content, {
1733
1734
  container: r,
1734
1735
  overlayClassName: "vibe-shadcn-tiptap__backdrop",
1735
- className: J("vibe-shadcn-tiptap__image-preview", e?.className),
1736
+ className: Y("vibe-shadcn-tiptap__image-preview", e?.className),
1736
1737
  "aria-describedby": void 0,
1737
1738
  onOpenAutoFocus: (e) => {
1738
1739
  let t = r.ownerDocument.activeElement;
@@ -1746,33 +1747,33 @@ function tr({ appearance: e, context: { editor: t, t: n }, overlayTarget: r, ima
1746
1747
  onKeyDown: (e) => {
1747
1748
  (e.key === "ArrowLeft" || e.key === "ArrowRight") && (e.preventDefault(), w(e.key === "ArrowLeft" ? -1 : 1));
1748
1749
  },
1749
- children: [/* @__PURE__ */ U("header", { children: [/* @__PURE__ */ U("div", {
1750
+ children: [/* @__PURE__ */ W("header", { children: [/* @__PURE__ */ W("div", {
1750
1751
  className: "vibe-shadcn-tiptap__image-title",
1751
- children: [/* @__PURE__ */ H(ot, {
1752
+ children: [/* @__PURE__ */ U(st, {
1752
1753
  size: 16,
1753
1754
  "aria-hidden": "true"
1754
- }), /* @__PURE__ */ H(o.Title, {
1755
+ }), /* @__PURE__ */ U(o.Title, {
1755
1756
  title: C,
1756
1757
  children: C
1757
1758
  })]
1758
- }), /* @__PURE__ */ U("div", {
1759
+ }), /* @__PURE__ */ W("div", {
1759
1760
  className: "vibe-shadcn-tiptap__image-controls",
1760
1761
  children: [
1761
- v && /* @__PURE__ */ U("div", {
1762
+ v && /* @__PURE__ */ W("div", {
1762
1763
  className: "vibe-shadcn-tiptap__image-controls-group",
1763
1764
  children: [
1764
- /* @__PURE__ */ H($, {
1765
+ /* @__PURE__ */ U($, {
1765
1766
  appearance: e?.iconButton,
1766
1767
  size: "icon",
1767
1768
  label: n("image.preview.previous"),
1768
1769
  overlayTarget: r,
1769
1770
  onClick: () => w(-1),
1770
- children: /* @__PURE__ */ H(ze, {
1771
+ children: /* @__PURE__ */ U(Be, {
1771
1772
  size: 16,
1772
1773
  "aria-hidden": "true"
1773
1774
  })
1774
1775
  }),
1775
- /* @__PURE__ */ U("span", {
1776
+ /* @__PURE__ */ W("span", {
1776
1777
  "aria-live": "polite",
1777
1778
  children: [
1778
1779
  c + 1,
@@ -1780,34 +1781,34 @@ function tr({ appearance: e, context: { editor: t, t: n }, overlayTarget: r, ima
1780
1781
  s.length
1781
1782
  ]
1782
1783
  }),
1783
- /* @__PURE__ */ H($, {
1784
+ /* @__PURE__ */ U($, {
1784
1785
  appearance: e?.iconButton,
1785
1786
  size: "icon",
1786
1787
  label: n("image.preview.next"),
1787
1788
  overlayTarget: r,
1788
1789
  onClick: () => w(1),
1789
- children: /* @__PURE__ */ H(Be, {
1790
+ children: /* @__PURE__ */ U(Ve, {
1790
1791
  size: 16,
1791
1792
  "aria-hidden": "true"
1792
1793
  })
1793
1794
  })
1794
1795
  ]
1795
1796
  }),
1796
- /* @__PURE__ */ U("div", {
1797
+ /* @__PURE__ */ W("div", {
1797
1798
  className: "vibe-shadcn-tiptap__image-controls-group",
1798
1799
  children: [
1799
- /* @__PURE__ */ H($, {
1800
+ /* @__PURE__ */ U($, {
1800
1801
  appearance: e?.iconButton,
1801
1802
  size: "icon",
1802
1803
  label: n("image.preview.zoomOut"),
1803
1804
  overlayTarget: r,
1804
1805
  onClick: () => void h.current?.zoomOut(.1),
1805
- children: /* @__PURE__ */ H(Yt, {
1806
+ children: /* @__PURE__ */ U(Xt, {
1806
1807
  size: 16,
1807
1808
  "aria-hidden": "true"
1808
1809
  })
1809
1810
  }),
1810
- /* @__PURE__ */ U($, {
1811
+ /* @__PURE__ */ W($, {
1811
1812
  appearance: e?.button,
1812
1813
  size: "sm",
1813
1814
  label: `${f}% · ${n("image.preview.reset")}`,
@@ -1817,69 +1818,69 @@ function tr({ appearance: e, context: { editor: t, t: n }, overlayTarget: r, ima
1817
1818
  onClick: () => void h.current?.centerView(1),
1818
1819
  children: [f, "%"]
1819
1820
  }),
1820
- /* @__PURE__ */ H($, {
1821
+ /* @__PURE__ */ U($, {
1821
1822
  appearance: e?.iconButton,
1822
1823
  size: "icon",
1823
1824
  label: n("image.preview.zoomIn"),
1824
1825
  overlayTarget: r,
1825
1826
  onClick: () => void h.current?.zoomIn(.1),
1826
- children: /* @__PURE__ */ H(Jt, {
1827
+ children: /* @__PURE__ */ U(Yt, {
1827
1828
  size: 16,
1828
1829
  "aria-hidden": "true"
1829
1830
  })
1830
1831
  })
1831
1832
  ]
1832
1833
  }),
1833
- /* @__PURE__ */ U("div", {
1834
+ /* @__PURE__ */ W("div", {
1834
1835
  className: "vibe-shadcn-tiptap__image-controls-group",
1835
1836
  children: [
1836
- /* @__PURE__ */ H($, {
1837
+ /* @__PURE__ */ U($, {
1837
1838
  appearance: e?.iconButton,
1838
1839
  size: "icon",
1839
1840
  label: n("image.preview.rotateLeft"),
1840
1841
  overlayTarget: r,
1841
1842
  onClick: () => d((e) => (e - 90) % 360),
1842
- children: /* @__PURE__ */ H(Mt, {
1843
+ children: /* @__PURE__ */ U(Nt, {
1843
1844
  size: 16,
1844
1845
  "aria-hidden": "true"
1845
1846
  })
1846
1847
  }),
1847
- /* @__PURE__ */ H($, {
1848
+ /* @__PURE__ */ U($, {
1848
1849
  appearance: e?.iconButton,
1849
1850
  size: "icon",
1850
1851
  label: n("image.preview.rotateRight"),
1851
1852
  overlayTarget: r,
1852
1853
  onClick: () => d((e) => (e + 90) % 360),
1853
- children: /* @__PURE__ */ H(Nt, {
1854
+ children: /* @__PURE__ */ U(Pt, {
1854
1855
  size: 16,
1855
1856
  "aria-hidden": "true"
1856
1857
  })
1857
1858
  }),
1858
- /* @__PURE__ */ H(Q, {
1859
+ /* @__PURE__ */ U(Q, {
1859
1860
  appearance: e?.button,
1860
1861
  asChild: !0,
1861
1862
  className: "vibe-shadcn-tiptap__button vibe-shadcn-tiptap__image-download",
1862
- children: /* @__PURE__ */ U("a", {
1863
+ children: /* @__PURE__ */ W("a", {
1863
1864
  href: b,
1864
1865
  download: S ?? "",
1865
1866
  "aria-disabled": !b || void 0,
1866
1867
  target: "_blank",
1867
1868
  rel: "noreferrer",
1868
- children: [/* @__PURE__ */ H(Ge, {
1869
+ children: [/* @__PURE__ */ U(Ke, {
1869
1870
  size: 16,
1870
1871
  "aria-hidden": "true"
1871
1872
  }), n("image.preview.download")]
1872
1873
  })
1873
1874
  }),
1874
- /* @__PURE__ */ H(o.Close, {
1875
+ /* @__PURE__ */ U(o.Close, {
1875
1876
  asChild: !0,
1876
- children: /* @__PURE__ */ H($, {
1877
+ children: /* @__PURE__ */ U($, {
1877
1878
  appearance: e?.iconButton,
1878
1879
  ref: _,
1879
1880
  size: "icon",
1880
1881
  label: n("image.preview.close"),
1881
1882
  overlayTarget: r,
1882
- children: /* @__PURE__ */ H(qt, {
1883
+ children: /* @__PURE__ */ U(Jt, {
1883
1884
  size: 16,
1884
1885
  "aria-hidden": "true"
1885
1886
  })
@@ -1888,7 +1889,7 @@ function tr({ appearance: e, context: { editor: t, t: n }, overlayTarget: r, ima
1888
1889
  ]
1889
1890
  })
1890
1891
  ]
1891
- })] }), /* @__PURE__ */ H("div", {
1892
+ })] }), /* @__PURE__ */ U("div", {
1892
1893
  className: "vibe-shadcn-tiptap__image-stage",
1893
1894
  onPointerDown: (e) => {
1894
1895
  e.shiftKey && e.button === 0 && e.isPrimary && (m.current = {
@@ -1904,7 +1905,7 @@ function tr({ appearance: e, context: { editor: t, t: n }, overlayTarget: r, ima
1904
1905
  onLostPointerCapture: (e) => {
1905
1906
  m.current?.pointerId === e.pointerId && (m.current = null);
1906
1907
  },
1907
- children: /* @__PURE__ */ H(nn, {
1908
+ children: /* @__PURE__ */ U(rn, {
1908
1909
  ref: h,
1909
1910
  centerOnInit: !0,
1910
1911
  centerZoomedOut: !0,
@@ -1919,10 +1920,10 @@ function tr({ appearance: e, context: { editor: t, t: n }, overlayTarget: r, ima
1919
1920
  activationKeys: (e) => !e.includes("Shift")
1920
1921
  },
1921
1922
  onTransform: (e, { scale: t }) => p(Math.round(t * 100)),
1922
- children: /* @__PURE__ */ H(tn, {
1923
+ children: /* @__PURE__ */ U(nn, {
1923
1924
  wrapperClass: "vibe-shadcn-tiptap__image-viewport",
1924
1925
  contentClass: "vibe-shadcn-tiptap__image-plane",
1925
- children: /* @__PURE__ */ H("img", {
1926
+ children: /* @__PURE__ */ U("img", {
1926
1927
  src: y,
1927
1928
  alt: S ?? "",
1928
1929
  draggable: !1,
@@ -1934,33 +1935,117 @@ function tr({ appearance: e, context: { editor: t, t: n }, overlayTarget: r, ima
1934
1935
  })
1935
1936
  });
1936
1937
  }
1938
+ // src/mention-menu.tsx
1939
+ function ar({ state: e, target: t, t: n, renderItem: r }) {
1940
+ let { editor: i, items: a, selectedIndex: o, mount: s, loading: c } = e, l = `vibe-tiptap-mention-${i.instanceId}`, u = a[o] ? `${l}-${o}` : void 0, d = q(null);
1941
+ return K(() => {
1942
+ let e = d.current;
1943
+ if (e) return s(e);
1944
+ }, [s, t]), K(() => {
1945
+ let e = i.view.dom, t = d.current;
1946
+ if (!u || !t) return;
1947
+ let n = e.getAttribute("aria-activedescendant"), r = e.getAttribute("aria-controls");
1948
+ e.setAttribute("aria-activedescendant", u), e.setAttribute("aria-controls", l);
1949
+ let a = e.ownerDocument.getElementById(u);
1950
+ return a && a.offsetTop < t.scrollTop && (t.scrollTop = a.offsetTop), a && a.offsetTop + a.offsetHeight > t.scrollTop + t.clientHeight && (t.scrollTop = a.offsetTop + a.offsetHeight - t.clientHeight), () => {
1951
+ n === null ? e.removeAttribute("aria-activedescendant") : e.setAttribute("aria-activedescendant", n), r === null ? e.removeAttribute("aria-controls") : e.setAttribute("aria-controls", r);
1952
+ };
1953
+ }, [
1954
+ i,
1955
+ u,
1956
+ l
1957
+ ]), an(/* @__PURE__ */ U("div", {
1958
+ ref: d,
1959
+ className: "z-3 vibe-shadcn-tiptap__mention",
1960
+ children: a.length ? /* @__PURE__ */ U("div", {
1961
+ id: l,
1962
+ role: "listbox",
1963
+ "aria-label": n("mention.label"),
1964
+ children: a.map((t, n) => /* @__PURE__ */ U("button", {
1965
+ id: `${l}-${n}`,
1966
+ type: "button",
1967
+ role: "option",
1968
+ tabIndex: -1,
1969
+ "aria-label": t.label,
1970
+ "aria-selected": n === o,
1971
+ className: "vibe-shadcn-tiptap__menu-item flex min-h-8 w-full items-center gap-1.5 rounded-sm px-3 py-1 text-start text-xs font-medium hover:bg-accent hover:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",
1972
+ onMouseDown: (e) => e.preventDefault(),
1973
+ onClick: () => e.command(t),
1974
+ children: r ? r(t) : /* @__PURE__ */ W(he, { children: [t.avatar && /* @__PURE__ */ U("img", {
1975
+ src: t.avatar,
1976
+ alt: "",
1977
+ className: "vibe-tiptap-mention-avatar"
1978
+ }), /* @__PURE__ */ U("span", { children: t.label })] })
1979
+ }, t.id))
1980
+ }) : /* @__PURE__ */ U("div", {
1981
+ className: "px-3 py-1 text-sm",
1982
+ role: "status",
1983
+ children: n(c ? "mention.loading" : "mention.empty")
1984
+ })
1985
+ }), t);
1986
+ }
1987
+ // src/mention-popover.tsx
1988
+ function or({ editor: e, container: t, render: n, hoverDelay: r }) {
1989
+ let { Popover: i } = X(), [a, o] = J(), s = q(void 0), c = Te(() => ({ current: {
1990
+ contextElement: e,
1991
+ getBoundingClientRect: () => a?.element.getBoundingClientRect() ?? new DOMRect()
1992
+ } }), [e, a]);
1993
+ return G(() => {
1994
+ let t = on(e, o, r);
1995
+ return s.current = t, () => {
1996
+ t.destroy(), s.current = void 0;
1997
+ };
1998
+ }, [e, r]), /* @__PURE__ */ W(i.Root, {
1999
+ open: !!a,
2000
+ onOpenChange: (e) => {
2001
+ e || s.current?.close();
2002
+ },
2003
+ children: [/* @__PURE__ */ U(i.Anchor, { virtualRef: c }), /* @__PURE__ */ U(i.Content, {
2004
+ container: t ?? e.ownerDocument.body,
2005
+ side: "top",
2006
+ align: "center",
2007
+ sideOffset: 6,
2008
+ collisionPadding: 8,
2009
+ className: "z-3 p-2",
2010
+ onOpenAutoFocus: (e) => e.preventDefault(),
2011
+ onCloseAutoFocus: (e) => e.preventDefault(),
2012
+ onFocusOutside: (e) => e.preventDefault(),
2013
+ onPointerDownOutside: (t) => {
2014
+ ie(e, t.target) && t.preventDefault();
2015
+ },
2016
+ onMouseEnter: () => s.current?.keepOpen(),
2017
+ onMouseLeave: () => s.current?.leave(),
2018
+ children: a && n(a)
2019
+ })]
2020
+ });
2021
+ }
1937
2022
  // src/slash-menu.tsx
1938
- var nr = {
1939
- heading1: Qe,
1940
- heading: $e,
1941
- heading3: et,
1942
- heading4: tt,
1943
- todo: mt,
1944
- bulletList: pt,
1945
- orderedList: ht,
1946
- blockquote: Ot,
1947
- table: Rt,
1948
- image: ct,
1949
- imageUrl: st,
1950
- whiteboard: wt,
1951
- video: Gt,
1952
- videoUrl: Vt,
1953
- audio: bt,
1954
- audioUrl: bt,
1955
- upload: St,
1956
- link: ft,
1957
- codeBlock: He,
1958
- mermaid: Kt,
2023
+ var sr = {
2024
+ heading1: $e,
2025
+ heading: et,
2026
+ heading3: tt,
2027
+ heading4: nt,
2028
+ todo: ht,
2029
+ bulletList: mt,
2030
+ orderedList: gt,
2031
+ blockquote: kt,
2032
+ table: zt,
2033
+ image: lt,
2034
+ imageUrl: ct,
2035
+ whiteboard: Tt,
2036
+ video: Kt,
2037
+ videoUrl: Ht,
2038
+ audio: xt,
2039
+ audioUrl: xt,
2040
+ upload: Ct,
2041
+ link: pt,
2042
+ codeBlock: Ue,
2043
+ mermaid: qt,
1959
2044
  divider: "solid",
1960
2045
  dividerThick: "thick",
1961
2046
  dividerDashed: "dashed",
1962
2047
  dividerDotted: "dotted"
1963
- }, rr = {
2048
+ }, cr = {
1964
2049
  heading1: "slashCommand.group.headings",
1965
2050
  heading: "slashCommand.group.headings",
1966
2051
  heading3: "slashCommand.group.headings",
@@ -1986,9 +2071,9 @@ var nr = {
1986
2071
  dividerDashed: "slashCommand.group.dividers",
1987
2072
  dividerDotted: "slashCommand.group.dividers"
1988
2073
  };
1989
- function ir({ appearance: e, state: t, target: n, t: r }) {
1990
- let { editor: i, items: a, query: o, selectedIndex: s, mount: c } = t, l = `vibe-shadcn-tiptap-slash-${i.instanceId}`, u = K(null), d = a[s], f = d && !d.disabledReason ? `${l}-${d.id}` : void 0;
1991
- G(() => {
2074
+ function lr({ appearance: e, state: t, target: n, t: r }) {
2075
+ let { editor: i, items: a, query: o, selectedIndex: s, mount: c } = t, l = `vibe-shadcn-tiptap-slash-${i.instanceId}`, u = q(null), d = a[s], f = d && !d.disabledReason ? `${l}-${d.id}` : void 0;
2076
+ K(() => {
1992
2077
  let e = u.current;
1993
2078
  if (e) return e.style.visibility = "hidden", c(e, { onPosition: ({ x: t, y: n, strategy: r }) => {
1994
2079
  Object.assign(e.style, {
@@ -1998,7 +2083,7 @@ function ir({ appearance: e, state: t, target: n, t: r }) {
1998
2083
  visibility: ""
1999
2084
  });
2000
2085
  } });
2001
- }, [c, n]), G(() => {
2086
+ }, [c, n]), K(() => {
2002
2087
  let e = i.view.dom;
2003
2088
  if (!f) return;
2004
2089
  let t = e.getAttribute("aria-activedescendant"), n = e.getAttribute("aria-controls");
@@ -2013,30 +2098,30 @@ function ir({ appearance: e, state: t, target: n, t: r }) {
2013
2098
  l
2014
2099
  ]);
2015
2100
  let p = [];
2016
- if (se(o)) p.push({ items: a });
2101
+ if (z(o)) p.push({ items: a });
2017
2102
  else for (let e of a) {
2018
- let t = e.disabledReason ? "slashCommand.group.unavailable" : rr[e.id], n = p.at(-1);
2103
+ let t = e.disabledReason ? "slashCommand.group.unavailable" : cr[e.id], n = p.at(-1);
2019
2104
  n?.label === t ? n.items.push(e) : p.push({
2020
2105
  label: t,
2021
2106
  items: [e]
2022
2107
  });
2023
2108
  }
2024
- return rn(/* @__PURE__ */ H("div", {
2109
+ return an(/* @__PURE__ */ U("div", {
2025
2110
  ref: u,
2026
- className: J("z-3 vibe-shadcn-tiptap__slash", e?.className),
2027
- children: a.length ? /* @__PURE__ */ H("div", {
2111
+ className: Y("z-3 vibe-shadcn-tiptap__slash", e?.className),
2112
+ children: a.length ? /* @__PURE__ */ U("div", {
2028
2113
  id: l,
2029
2114
  role: "listbox",
2030
2115
  "aria-label": r("slashCommand.label"),
2031
- children: p.map(({ label: n, items: i }) => /* @__PURE__ */ U("div", {
2116
+ children: p.map(({ label: n, items: i }) => /* @__PURE__ */ W("div", {
2032
2117
  ...n ? {
2033
2118
  role: "group",
2034
2119
  "aria-label": r(n)
2035
2120
  } : {},
2036
- children: [n && /* @__PURE__ */ H("div", {
2121
+ children: [n && /* @__PURE__ */ U("div", {
2037
2122
  className: "vibe-shadcn-tiptap__slash-label",
2038
2123
  children: r(n)
2039
- }), i.map((n) => /* @__PURE__ */ U("button", {
2124
+ }), i.map((n) => /* @__PURE__ */ W("button", {
2040
2125
  id: `${l}-${n.id}`,
2041
2126
  type: "button",
2042
2127
  role: "option",
@@ -2045,94 +2130,94 @@ function ir({ appearance: e, state: t, target: n, t: r }) {
2045
2130
  "aria-selected": n === d && !n.disabledReason,
2046
2131
  "aria-describedby": n.disabledReason || n.hint ? `${l}-${n.id}-hint` : void 0,
2047
2132
  disabled: !!n.disabledReason,
2048
- className: J("vibe-shadcn-tiptap__menu-item flex min-h-8 w-full items-center gap-1.5 rounded-sm px-3 py-1 text-start text-xs font-medium whitespace-nowrap enabled:hover:bg-accent enabled:hover:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground disabled:opacity-40", e?.button?.className),
2133
+ className: Y("vibe-shadcn-tiptap__menu-item flex min-h-8 w-full items-center gap-1.5 rounded-sm px-3 py-1 text-start text-xs font-medium whitespace-nowrap enabled:hover:bg-accent enabled:hover:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground disabled:opacity-40", e?.button?.className),
2049
2134
  onMouseDown: (e) => e.preventDefault(),
2050
2135
  onClick: () => t.command(n),
2051
2136
  children: [
2052
- /* @__PURE__ */ H(ar, { command: n.id }),
2137
+ /* @__PURE__ */ U(ur, { command: n.id }),
2053
2138
  n.label,
2054
- (n.disabledReason || n.hint) && /* @__PURE__ */ H("small", {
2139
+ (n.disabledReason || n.hint) && /* @__PURE__ */ U("small", {
2055
2140
  id: `${l}-${n.id}-hint`,
2056
2141
  children: n.disabledReason || n.hint
2057
2142
  })
2058
2143
  ]
2059
2144
  }, n.id))]
2060
2145
  }, i[0]?.id ?? "results"))
2061
- }) : !t.loading && /* @__PURE__ */ H("div", {
2146
+ }) : !t.loading && /* @__PURE__ */ U("div", {
2062
2147
  role: "status",
2063
2148
  children: r("slashCommand.empty")
2064
2149
  })
2065
2150
  }), n);
2066
2151
  }
2067
- function ar({ command: e }) {
2068
- let t = nr[e];
2069
- return /* @__PURE__ */ H("span", {
2152
+ function ur({ command: e }) {
2153
+ let t = sr[e];
2154
+ return /* @__PURE__ */ U("span", {
2070
2155
  className: "vibe-shadcn-tiptap__slash-icon",
2071
2156
  "aria-hidden": !0,
2072
- children: typeof t == "string" ? /* @__PURE__ */ H("span", {
2157
+ children: typeof t == "string" ? /* @__PURE__ */ U("span", {
2073
2158
  className: "vibe-shadcn-tiptap__divider-icon",
2074
2159
  "data-style": t
2075
- }) : /* @__PURE__ */ H(t, { size: 18 })
2160
+ }) : /* @__PURE__ */ U(t, { size: 18 })
2076
2161
  });
2077
2162
  }
2078
2163
  // src/table-grips.tsx
2079
- var or = ["row", "column"], sr = {
2164
+ var dr = ["row", "column"], fr = {
2080
2165
  row: [
2081
2166
  [
2082
2167
  "addRowBefore",
2083
2168
  "table.insertAbove",
2084
- Et
2169
+ Dt
2085
2170
  ],
2086
2171
  [
2087
2172
  "addRowAfter",
2088
2173
  "table.insertBelow",
2089
- Et
2174
+ Dt
2090
2175
  ],
2091
2176
  [
2092
2177
  "moveRowUp",
2093
2178
  "table.moveUp",
2094
- Pe
2179
+ Fe
2095
2180
  ],
2096
2181
  [
2097
2182
  "moveRowDown",
2098
2183
  "table.moveDown",
2099
- je
2184
+ Me
2100
2185
  ]
2101
2186
  ],
2102
2187
  column: [
2103
2188
  [
2104
2189
  "addColumnBefore",
2105
2190
  "table.insertLeft",
2106
- Et
2191
+ Dt
2107
2192
  ],
2108
2193
  [
2109
2194
  "addColumnAfter",
2110
2195
  "table.insertRight",
2111
- Et
2196
+ Dt
2112
2197
  ],
2113
2198
  [
2114
2199
  "moveColumnLeft",
2115
2200
  "table.moveLeft",
2116
- Me
2201
+ Ne
2117
2202
  ],
2118
2203
  [
2119
2204
  "moveColumnRight",
2120
2205
  "table.moveRight",
2121
- Ne
2206
+ Pe
2122
2207
  ]
2123
2208
  ]
2124
2209
  };
2125
- function cr({ appearance: e, context: t, overlayTarget: n }) {
2126
- let { DropdownMenu: r } = Y(), { editor: i, commands: a, t: o } = t, s = V(t, (e) => e.getToolbarRevision()), [c, l] = q(), [u, d] = q(), [f, p] = q(), m = K(void 0), h = K(!1);
2210
+ function pr({ appearance: e, context: t, overlayTarget: n }) {
2211
+ let { DropdownMenu: r } = X(), { editor: i, commands: a, t: o } = t, s = H(t, (e) => e.getToolbarRevision()), [c, l] = J(), [u, d] = J(), [f, p] = J(), m = q(void 0), h = q(!1);
2127
2212
  function g(e) {
2128
2213
  let { view: t, state: n } = i;
2129
- if (t.dom.contains(e)) return on(n.doc.resolve(t.posAtDOM(e, 0)));
2214
+ if (t.dom.contains(e)) return cn(n.doc.resolve(t.posAtDOM(e, 0)));
2130
2215
  }
2131
2216
  function _(e, t) {
2132
2217
  let n = g(t.cell);
2133
2218
  return !!(n && a.selectTableLineAt(e, n.pos, t[e]));
2134
2219
  }
2135
- if (W(() => {
2220
+ if (G(() => {
2136
2221
  let e = i.view.dom.parentElement, t = e?.parentElement;
2137
2222
  if (!t) return;
2138
2223
  function n() {
@@ -2156,10 +2241,10 @@ function cr({ appearance: e, context: t, overlayTarget: n }) {
2156
2241
  }
2157
2242
  let o = a.closest("table");
2158
2243
  if (!o || !e?.contains(o) || i.isDestroyed) return;
2159
- let s = on(i.state.doc.resolve(i.view.posAtDOM(a, 0)));
2244
+ let s = cn(i.state.doc.resolve(i.view.posAtDOM(a, 0)));
2160
2245
  if (!s) return;
2161
2246
  n();
2162
- let { left: c, right: d, top: f } = an.get(s.node(-1)).findCell(s.pos - s.start(-1)), p = o.querySelectorAll(":scope > colgroup > col"), m = a.getBoundingClientRect(), h = m.width > 0 ? (t.clientX - m.left) / m.width : 0, g = Math.min(d - 1, Math.max(c, c + Math.floor(h * (d - c))));
2247
+ let { left: c, right: d, top: f } = sn.get(s.node(-1)).findCell(s.pos - s.start(-1)), p = o.querySelectorAll(":scope > colgroup > col"), m = a.getBoundingClientRect(), h = m.width > 0 ? (t.clientX - m.left) / m.width : 0, g = Math.min(d - 1, Math.max(c, c + Math.floor(h * (d - c))));
2163
2248
  for (let e = c; e < d; e += 1) {
2164
2249
  let n = p[e]?.getBoundingClientRect();
2165
2250
  if (n && n.width > 0 && t.clientX < n.right) {
@@ -2177,7 +2262,7 @@ function cr({ appearance: e, context: t, overlayTarget: n }) {
2177
2262
  return t.addEventListener("pointermove", a), t.addEventListener("pointerleave", r), () => {
2178
2263
  n(), t.removeEventListener("pointermove", a), t.removeEventListener("pointerleave", r);
2179
2264
  };
2180
- }, [u, i]), G(() => {
2265
+ }, [u, i]), K(() => {
2181
2266
  let e = i.view.dom.parentElement, t = e?.parentElement, n = t?.ownerDocument.defaultView;
2182
2267
  if (!c || !t || !e || !n) {
2183
2268
  p(void 0);
@@ -2186,7 +2271,7 @@ function cr({ appearance: e, context: t, overlayTarget: n }) {
2186
2271
  let r = t, a = e, o = c;
2187
2272
  function s() {
2188
2273
  if (i.isDestroyed) return;
2189
- let { cell: e, table: t, row: n, column: s } = o, c = t.rows[n], u = a.contains(e) ? on(i.state.doc.resolve(i.view.posAtDOM(e, 0))) : void 0;
2274
+ let { cell: e, table: t, row: n, column: s } = o, c = t.rows[n], u = a.contains(e) ? cn(i.state.doc.resolve(i.view.posAtDOM(e, 0))) : void 0;
2190
2275
  if (!c || !u) {
2191
2276
  l(void 0), d(void 0);
2192
2277
  return;
@@ -2196,7 +2281,7 @@ function cr({ appearance: e, context: t, overlayTarget: n }) {
2196
2281
  l(void 0), d(void 0);
2197
2282
  return;
2198
2283
  }
2199
- let g = c.getBoundingClientRect(), _ = t.querySelectorAll(":scope > colgroup > col")[s]?.getBoundingClientRect(), v = e.getBoundingClientRect(), { left: y, right: b } = an.get(u.node(-1)).findCell(u.pos - u.start(-1)), x = _ && _.width > 0 ? _.left + _.width / 2 : v.left + (s - y + .5) * v.width / (b - y);
2284
+ let g = c.getBoundingClientRect(), _ = t.querySelectorAll(":scope > colgroup > col")[s]?.getBoundingClientRect(), v = e.getBoundingClientRect(), { left: y, right: b } = sn.get(u.node(-1)).findCell(u.pos - u.start(-1)), x = _ && _.width > 0 ? _.left + _.width / 2 : v.left + (s - y + .5) * v.width / (b - y);
2200
2285
  p({
2201
2286
  row: {
2202
2287
  left: Math.max(m.left + 11, h.left - 11) - f.left,
@@ -2219,7 +2304,7 @@ function cr({ appearance: e, context: t, overlayTarget: n }) {
2219
2304
  function v(e, t) {
2220
2305
  let n = g(t.cell);
2221
2306
  if (!n) return !1;
2222
- let r = n.node(-1), i = an.get(r);
2307
+ let r = n.node(-1), i = sn.get(r);
2223
2308
  return i.cellsInRect({
2224
2309
  left: 0,
2225
2310
  top: 0,
@@ -2227,20 +2312,20 @@ function cr({ appearance: e, context: t, overlayTarget: n }) {
2227
2312
  bottom: e === "column" ? i.height : 1
2228
2313
  }).every((e) => r.nodeAt(e)?.type.spec.tableRole === "header_cell");
2229
2314
  }
2230
- return or.map((t) => {
2231
- let s = t === "row" ? qe : Ke, p = o(t === "row" ? "table.rowMenu" : "table.columnMenu");
2315
+ return dr.map((t) => {
2316
+ let s = t === "row" ? Je : qe, p = o(t === "row" ? "table.rowMenu" : "table.columnMenu");
2232
2317
  function m(e) {
2233
2318
  c && i.isEditable && _(t, c) && (h.current = !0, e(), l(void 0), d(void 0));
2234
2319
  }
2235
- return /* @__PURE__ */ U(r.Root, {
2320
+ return /* @__PURE__ */ W(r.Root, {
2236
2321
  modal: !1,
2237
2322
  open: u === t,
2238
2323
  onOpenChange: (e) => {
2239
2324
  e ? (h.current = !1, _(t, c) && d(t)) : d(void 0);
2240
2325
  },
2241
- children: [/* @__PURE__ */ H(r.Trigger, {
2326
+ children: [/* @__PURE__ */ U(r.Trigger, {
2242
2327
  asChild: !0,
2243
- children: /* @__PURE__ */ H($, {
2328
+ children: /* @__PURE__ */ U($, {
2244
2329
  label: p,
2245
2330
  appearance: e?.button,
2246
2331
  defaultSizeClassName: "size-5 p-0",
@@ -2248,40 +2333,40 @@ function cr({ appearance: e, context: t, overlayTarget: n }) {
2248
2333
  style: f[t],
2249
2334
  overlayTarget: n,
2250
2335
  onMouseDown: (e) => e.preventDefault(),
2251
- children: /* @__PURE__ */ H(s, {
2336
+ children: /* @__PURE__ */ U(s, {
2252
2337
  size: 16,
2253
2338
  "aria-hidden": !0
2254
2339
  })
2255
2340
  })
2256
- }), /* @__PURE__ */ U(r.Content, {
2341
+ }), /* @__PURE__ */ W(r.Content, {
2257
2342
  container: n,
2258
- className: J("z-3", e?.className),
2343
+ className: Y("z-3", e?.className),
2259
2344
  align: "start",
2260
2345
  side: t === "row" ? "right" : "top",
2261
2346
  onCloseAutoFocus: (e) => {
2262
2347
  h.current && e.preventDefault();
2263
2348
  },
2264
2349
  children: [
2265
- sr[t].map(([e, t, n]) => /* @__PURE__ */ U(r.Item, {
2350
+ fr[t].map(([e, t, n]) => /* @__PURE__ */ W(r.Item, {
2266
2351
  className: "vibe-shadcn-tiptap__menu-item",
2267
2352
  onSelect: () => m(a[e]),
2268
- children: [/* @__PURE__ */ H(n, {
2353
+ children: [/* @__PURE__ */ U(n, {
2269
2354
  size: 15,
2270
2355
  "aria-hidden": !0
2271
2356
  }), o(t)]
2272
2357
  }, e)),
2273
- c[t] === 0 && /* @__PURE__ */ U(r.Item, {
2358
+ c[t] === 0 && /* @__PURE__ */ W(r.Item, {
2274
2359
  className: "vibe-shadcn-tiptap__menu-item",
2275
2360
  onSelect: () => m(t === "row" ? a.toggleHeaderRow : a.toggleHeaderColumn),
2276
- children: [/* @__PURE__ */ H(zt, {
2361
+ children: [/* @__PURE__ */ U(Bt, {
2277
2362
  size: 15,
2278
2363
  "aria-hidden": !0
2279
2364
  }), o(v(t, c) ? "table.unsetHeader" : "table.setHeader")]
2280
2365
  }),
2281
- /* @__PURE__ */ U(r.Item, {
2366
+ /* @__PURE__ */ W(r.Item, {
2282
2367
  className: "vibe-shadcn-tiptap__menu-item",
2283
2368
  onSelect: () => m(() => t === "row" ? a.deleteRow(c.row) : a.deleteColumn(c.column)),
2284
- children: [/* @__PURE__ */ H(Bt, {
2369
+ children: [/* @__PURE__ */ U(Vt, {
2285
2370
  size: 15,
2286
2371
  "aria-hidden": !0
2287
2372
  }), o("table.deleteLine")]
@@ -2292,54 +2377,73 @@ function cr({ appearance: e, context: t, overlayTarget: n }) {
2292
2377
  });
2293
2378
  }
2294
2379
  // src/use-vibe-tiptap.ts
2295
- var lr = Symbol();
2296
- function ur(e = {}) {
2297
- let [t] = q(() => ({ ...e })), [n, r] = q(!1), i = K(void 0), a = K(e), o = K(void 0), s = K(void 0), [c] = q(() => {
2380
+ var mr = Symbol();
2381
+ function hr(e = {}) {
2382
+ let [t] = J(() => ({ ...e })), [n, r] = J(!1), i = q(void 0), a = q(e), o = q(void 0), s = q(void 0), c = q(void 0), [l] = J(() => {
2298
2383
  function e() {
2299
2384
  let e = s.current;
2300
- s.current = void 0, i.current?.onSlash(void 0), e && !e.editor.isDestroyed && te(e.editor.view, (t.slashCommand || void 0)?.pluginKey ?? le);
2385
+ s.current = void 0, i.current?.onSlash(void 0), e && !e.editor.isDestroyed && M(e.editor.view, (t.slashCommand || void 0)?.pluginKey ?? de);
2386
+ }
2387
+ function n() {
2388
+ c.current && te(c.current.editor);
2301
2389
  }
2302
2390
  return {
2303
2391
  bind(t) {
2304
2392
  if (i.current) throw Error("useVibeTiptap already has a mounted editor view");
2305
- return e(), i.current = t, () => {
2306
- i.current = void 0, e(), r(!1);
2393
+ return e(), n(), i.current = t, () => {
2394
+ i.current = void 0, e(), n(), r(!1);
2307
2395
  };
2308
2396
  },
2309
2397
  closeSlashMenu: e
2310
2398
  };
2311
- }), l = {
2312
- onOpen: u,
2313
- onUpdate: u,
2314
- onClose: () => u(void 0),
2399
+ }), u = {
2400
+ onOpen: d,
2401
+ onUpdate: d,
2402
+ onClose: () => d(void 0),
2315
2403
  onExecute: (e) => i.current?.onExecute(e)
2316
2404
  };
2317
- function u(e) {
2405
+ function d(e) {
2318
2406
  s.current = e, i.current?.onSlash(e);
2319
2407
  }
2320
- function d() {
2408
+ function f(e) {
2409
+ c.current = e, i.current?.onMention(e);
2410
+ }
2411
+ let p = t.mention || void 0, m = p && {
2412
+ ...p,
2413
+ onOpen(e) {
2414
+ f(e), p.onOpen?.(e);
2415
+ },
2416
+ onUpdate(e) {
2417
+ f(e), p.onUpdate?.(e);
2418
+ },
2419
+ onClose() {
2420
+ f(void 0), p.onClose?.();
2421
+ }
2422
+ };
2423
+ function h() {
2321
2424
  let e = o.current;
2322
2425
  if (e?.editor.schema.nodes.image) return A(e, () => a.current.uploadAsset, () => a.current.editorBehaviorOptions);
2323
2426
  }
2324
- W(() => {
2427
+ G(() => {
2325
2428
  a.current = e;
2326
2429
  }, [e]);
2327
- let f = fe({
2430
+ let g = pe({
2328
2431
  ...t,
2329
2432
  content: t.initialContent,
2330
2433
  editable: (e.editable ?? !0) && !n,
2331
2434
  uploadAsset: e.uploadAsset,
2332
2435
  editorBehaviorOptions: e.editorBehaviorOptions,
2333
2436
  slashCommand: t.slashCommand ?? {},
2437
+ mention: m,
2334
2438
  editorProps: {
2335
2439
  ...t.editorProps,
2336
2440
  handleDOMEvents: {
2337
2441
  ...t.editorProps?.handleDOMEvents,
2338
2442
  paste(e, t) {
2339
- return a.current.editorProps?.handleDOMEvents?.paste?.(e, t) ? !0 : (d()?.onPaste(t), t.defaultPrevented);
2443
+ return a.current.editorProps?.handleDOMEvents?.paste?.(e, t) ? !0 : (h()?.onPaste(t), t.defaultPrevented);
2340
2444
  },
2341
2445
  drop(e, t) {
2342
- return a.current.editorProps?.handleDOMEvents?.drop?.(e, t) ? !0 : (d()?.onDrop(t), t.defaultPrevented);
2446
+ return a.current.editorProps?.handleDOMEvents?.drop?.(e, t) ? !0 : (h()?.onDrop(t), t.defaultPrevented);
2343
2447
  }
2344
2448
  }
2345
2449
  },
@@ -2350,16 +2454,17 @@ function ur(e = {}) {
2350
2454
  notify(t, n = "info") {
2351
2455
  (e.notify ?? i.current?.notify)?.(t, n);
2352
2456
  }
2353
- }, t.slashCommand === !1 ? void 0 : l);
2354
- return W(() => (o.current = f, () => {
2457
+ }, t.slashCommand === !1 ? void 0 : u);
2458
+ return G(() => (o.current = g, () => {
2355
2459
  o.current = void 0;
2356
- }), [f]), {
2357
- context: f,
2358
- [lr]: {
2359
- bridge: c,
2460
+ }), [g]), {
2461
+ context: g,
2462
+ [mr]: {
2463
+ bridge: l,
2360
2464
  preview: n,
2361
2465
  setPreview: r,
2362
2466
  editable: e.editable ?? !0,
2467
+ mentionHoverDelay: p?.hoverDelay,
2363
2468
  codeBlockLanguages: t.codeBlockLanguages,
2364
2469
  horizontalRules: t.horizontalRules,
2365
2470
  uploadAsset: e.uploadAsset,
@@ -2368,98 +2473,99 @@ function ur(e = {}) {
2368
2473
  };
2369
2474
  }
2370
2475
  // src/shadcn-tiptap-editor.tsx
2371
- function dr(e) {
2372
- let t = Fn(e), { components: n, editor: r, showWordCount: i = !0, toolbar: a, toolbarOptions: o, colors: s, highlights: c, ui: l, markdownOptions: u, printOptions: d, className: f, onKeyDown: p, ...m } = {
2476
+ function gr(e) {
2477
+ let t = Rn(e), { components: n, editor: r, showWordCount: i = !0, toolbar: a, toolbarOptions: o, colors: s, highlights: c, ui: l, markdownOptions: u, renderMentionItem: d, renderMentionPopover: f, printOptions: p, className: m, onKeyDown: h, ...g } = {
2373
2478
  ...e,
2374
2479
  ...t
2375
- }, { context: h } = r, { editable: g, preview: _, setPreview: v, codeBlockLanguages: y, horizontalRules: b, uploadAsset: x, editorBehaviorOptions: S, bridge: C } = r[lr], { Tooltip: w } = n, [T, ee] = q(null), [D, O] = q(null), [k, A] = q(!1), [j, te] = q(), [M, ne] = q(), [re, ie] = q(!1), [N, P] = q(), [F, I] = q(), [ae, L] = q([]), oe = K(0), se = K(/* @__PURE__ */ new Map()), R = K(!1), ce = E(a).some((e) => e.includes("preview")), B = V(h, (e) => e.editor.isEditable) ?? g, le = T?.ownerDocument.fullscreenEnabled && typeof T.requestFullscreen == "function";
2376
- W(() => {
2377
- let e = C.bind({
2378
- onSlash: ne,
2480
+ }, { context: _ } = r, { editable: v, preview: y, setPreview: b, codeBlockLanguages: x, horizontalRules: S, uploadAsset: C, editorBehaviorOptions: w, bridge: T } = r[mr], { Tooltip: ee } = n, [D, O] = J(null), [k, A] = J(null), [j, te] = J(!1), [M, N] = J(), [P, F] = J(), [ne, re] = J(), [ie, ae] = J(!1), [I, L] = J(), [oe, R] = J(), [se, z] = J([]), ce = q(0), B = q(/* @__PURE__ */ new Map()), ue = q(!1), de = E(a).some((e) => e.includes("preview")), V = H(_, (e) => e.editor.isEditable) ?? v, fe = D?.ownerDocument.fullscreenEnabled && typeof D.requestFullscreen == "function";
2481
+ G(() => {
2482
+ let e = T.bind({
2483
+ onSlash: F,
2484
+ onMention: re,
2379
2485
  onExecute: ({ item: e }) => {
2380
- h && z(h, e, {
2381
- onImage: () => P({
2486
+ _ && le(_, e, {
2487
+ onImage: () => L({
2382
2488
  kind: "image",
2383
2489
  tab: "upload"
2384
2490
  }),
2385
- onImageUrl: () => P({
2491
+ onImageUrl: () => L({
2386
2492
  kind: "image",
2387
2493
  tab: "url"
2388
2494
  }),
2389
- onVideo: () => P({
2495
+ onVideo: () => L({
2390
2496
  kind: "video",
2391
2497
  tab: "upload"
2392
2498
  }),
2393
- onVideoUrl: () => P({
2499
+ onVideoUrl: () => L({
2394
2500
  kind: "video",
2395
2501
  tab: "url"
2396
2502
  }),
2397
- onAudio: () => P({
2503
+ onAudio: () => L({
2398
2504
  kind: "audio",
2399
2505
  tab: "upload"
2400
2506
  }),
2401
- onAudioUrl: () => P({
2507
+ onAudioUrl: () => L({
2402
2508
  kind: "audio",
2403
2509
  tab: "url"
2404
2510
  }),
2405
- onUpload: () => P({
2511
+ onUpload: () => L({
2406
2512
  kind: "attachment",
2407
2513
  tab: "upload"
2408
2514
  }),
2409
- onLink: () => P({ kind: "link" }),
2410
- onWhiteboard: () => I("new")
2515
+ onLink: () => L({ kind: "link" }),
2516
+ onWhiteboard: () => R("new")
2411
2517
  });
2412
2518
  },
2413
2519
  onImagePreview(e) {
2414
- te({
2520
+ N({
2415
2521
  ...e,
2416
2522
  urls: [...e.urls],
2417
2523
  names: e.names?.slice()
2418
2524
  });
2419
2525
  },
2420
2526
  notify(e, t = "info") {
2421
- let n = ++oe.current;
2422
- L((r) => [...r, {
2527
+ let n = ++ce.current;
2528
+ z((r) => [...r, {
2423
2529
  id: n,
2424
2530
  message: e,
2425
2531
  type: t
2426
- }]), se.current.set(n, setTimeout(() => {
2427
- se.current.delete(n), L((e) => e.filter((e) => e.id !== n));
2532
+ }]), B.current.set(n, setTimeout(() => {
2533
+ B.current.delete(n), z((e) => e.filter((e) => e.id !== n));
2428
2534
  }, 3e3));
2429
2535
  }
2430
- }), t = se.current;
2536
+ }), t = B.current;
2431
2537
  return () => {
2432
2538
  e();
2433
2539
  for (let e of t.values()) clearTimeout(e);
2434
- t.clear(), L([]), ne(void 0), te(void 0), P(void 0), I(void 0), ie(!1);
2540
+ t.clear(), z([]), F(void 0), re(void 0), N(void 0), L(void 0), R(void 0), ae(!1);
2435
2541
  };
2436
- }, [C, h]), W(() => {
2437
- ce || v(!1);
2438
- }, [ce, v]), W(() => {
2439
- if (!T) return;
2440
- let e = T.ownerDocument, t = () => A(e.fullscreenElement === T);
2542
+ }, [T, _]), G(() => {
2543
+ de || b(!1);
2544
+ }, [de, b]), G(() => {
2545
+ if (!D) return;
2546
+ let e = D.ownerDocument, t = () => te(e.fullscreenElement === D);
2441
2547
  return e.addEventListener("fullscreenchange", t), () => e.removeEventListener("fullscreenchange", t);
2442
- }, [T]), W(() => {
2443
- B || (P(void 0), I(void 0), ie(!1)), !B && M && C.closeSlashMenu();
2548
+ }, [D]), G(() => {
2549
+ V || (L(void 0), R(void 0), ae(!1)), !V && P && T.closeSlashMenu();
2444
2550
  }, [
2445
- C,
2446
- B,
2447
- M
2551
+ T,
2552
+ V,
2553
+ P
2448
2554
  ]);
2449
- async function ue(e) {
2450
- if (T && !R.current && e !== k) {
2451
- R.current = !0;
2555
+ async function pe(e) {
2556
+ if (D && !ue.current && e !== j) {
2557
+ ue.current = !0;
2452
2558
  try {
2453
- e ? await T.requestFullscreen() : await T.ownerDocument.exitFullscreen();
2559
+ e ? await D.requestFullscreen() : await D.ownerDocument.exitFullscreen();
2454
2560
  } catch {
2455
- h && !h.editor.isDestroyed && h.notify(h.t("notify.fullscreenFailed"), "warning");
2561
+ _ && !_.editor.isDestroyed && _.notify(_.t("notify.fullscreenFailed"), "warning");
2456
2562
  } finally {
2457
- R.current = !1;
2563
+ ue.current = !1;
2458
2564
  }
2459
2565
  }
2460
2566
  }
2461
- function de(e) {
2462
- let t = h?.editor;
2567
+ function me(e) {
2568
+ let t = _?.editor;
2463
2569
  if (!t?.isEditable || e.defaultPrevented || e.button !== 0 || e.shiftKey || e.ctrlKey || e.metaKey || e.altKey || !(e.target instanceof Element)) return;
2464
2570
  let n = e.target.closest("a[href]"), { view: r, state: i } = t, a = i.schema.marks.link;
2465
2571
  if (!n || !r.dom.contains(n) || !a) return;
@@ -2467,125 +2573,137 @@ function dr(e) {
2467
2573
  if (!o.nodeAfter?.isText) return;
2468
2574
  let s = a.isInSet(o.nodeAfter.marks);
2469
2575
  if (!s || s.attrs.href !== n.getAttribute("href")) return;
2470
- let c = he(o, a, s.attrs);
2576
+ let c = ge(o, a, s.attrs);
2471
2577
  if (!c) return;
2472
2578
  e.preventDefault();
2473
2579
  let { from: l, to: u } = i.selection;
2474
2580
  (l < c.from || l >= c.to || u > c.to) && t.commands.setTextSelection(c), r.focus();
2475
2581
  }
2476
- return /* @__PURE__ */ H(un, {
2582
+ return /* @__PURE__ */ U(fn, {
2477
2583
  value: n,
2478
- children: /* @__PURE__ */ H(w.Provider, {
2584
+ children: /* @__PURE__ */ U(ee.Provider, {
2479
2585
  delayDuration: 500,
2480
2586
  skipDelayDuration: 0,
2481
- children: /* @__PURE__ */ U("div", {
2482
- ...m,
2483
- ref: ee,
2484
- className: ["vibe-shadcn-tiptap", f].filter(Boolean).join(" "),
2485
- "data-scroll-locked": B && !!(M || N || re) || void 0,
2587
+ children: /* @__PURE__ */ W("div", {
2588
+ ...g,
2589
+ ref: O,
2590
+ className: ["vibe-shadcn-tiptap", m].filter(Boolean).join(" "),
2591
+ "data-scroll-locked": V && !!(P || ne || I || ie) || void 0,
2486
2592
  onKeyDown: (e) => {
2487
- if (p?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing || e.altKey || e.shiftKey || !(e.ctrlKey || e.metaKey) || e.key.toLowerCase() !== "f" || typeof h?.editor.commands.openFindReplace != "function")) {
2593
+ if (h?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing || e.altKey || e.shiftKey || !(e.ctrlKey || e.metaKey) || e.key.toLowerCase() !== "f" || typeof _?.editor.commands.openFindReplace != "function")) {
2488
2594
  if (e.preventDefault(), e.target instanceof Element && e.target.closest(".vibe-shadcn-tiptap__find")) {
2489
- let e = T?.querySelector(".vibe-shadcn-tiptap__find input");
2595
+ let e = D?.querySelector(".vibe-shadcn-tiptap__find input");
2490
2596
  e instanceof HTMLInputElement && (e.focus(), e.select());
2491
- } else h.commands.openFindReplace();
2597
+ } else _.commands.openFindReplace();
2492
2598
  }
2493
2599
  },
2494
- children: [h && /* @__PURE__ */ U(me, { children: [
2495
- a !== !1 && /* @__PURE__ */ H(Un, {
2496
- context: h,
2600
+ children: [_ && /* @__PURE__ */ W(he, { children: [
2601
+ a !== !1 && /* @__PURE__ */ U(Kn, {
2602
+ context: _,
2497
2603
  toolbar: a,
2498
2604
  toolbarOptions: o,
2499
- codeBlockLanguages: y,
2500
- horizontalRules: b,
2605
+ codeBlockLanguages: x,
2606
+ horizontalRules: S,
2501
2607
  colors: s,
2502
2608
  highlights: c,
2503
2609
  ui: l,
2504
2610
  markdownOptions: u,
2505
- printOptions: d,
2506
- uploadAsset: x,
2507
- openWhiteboard: () => I("new"),
2508
- editorBehaviorOptions: S,
2509
- preview: _,
2510
- onPreviewChange: v,
2511
- fullscreen: le || k ? k : void 0,
2512
- onFullscreenChange: ue,
2513
- overlayTarget: D ?? void 0
2514
- }, h.editor.instanceId),
2515
- /* @__PURE__ */ U("div", {
2611
+ printOptions: p,
2612
+ uploadAsset: C,
2613
+ openWhiteboard: () => R("new"),
2614
+ editorBehaviorOptions: w,
2615
+ preview: y,
2616
+ onPreviewChange: b,
2617
+ fullscreen: fe || j ? j : void 0,
2618
+ onFullscreenChange: pe,
2619
+ overlayTarget: k ?? void 0
2620
+ }, _.editor.instanceId),
2621
+ /* @__PURE__ */ W("div", {
2516
2622
  className: "vibe-shadcn-tiptap__body",
2517
2623
  children: [
2518
- /* @__PURE__ */ H($n, {
2519
- context: h,
2624
+ /* @__PURE__ */ U(nr, {
2625
+ context: _,
2520
2626
  appearance: l?.findReplace,
2521
- editable: B,
2522
- overlayTarget: D ?? void 0
2627
+ editable: V,
2628
+ overlayTarget: k ?? void 0
2523
2629
  }),
2524
- /* @__PURE__ */ H(sn, {
2525
- context: h,
2526
- tabIndex: !B && typeof h.editor.commands.openFindReplace == "function" ? 0 : void 0,
2527
- onClick: de,
2630
+ /* @__PURE__ */ U(ln, {
2631
+ context: _,
2632
+ tabIndex: !V && typeof _.editor.commands.openFindReplace == "function" ? 0 : void 0,
2633
+ onClick: me,
2528
2634
  onBlur: (e) => {
2529
- !e.currentTarget.contains(e.relatedTarget) && M && !h.editor.isDestroyed && C.closeSlashMenu();
2635
+ !e.currentTarget.contains(e.relatedTarget) && P && !_.editor.isDestroyed && T.closeSlashMenu();
2530
2636
  }
2531
2637
  }),
2532
- B && D && /* @__PURE__ */ H(cr, {
2638
+ V && k && /* @__PURE__ */ U(pr, {
2533
2639
  appearance: l?.tableGrips,
2534
- context: h,
2535
- overlayTarget: D
2640
+ context: _,
2641
+ overlayTarget: k
2536
2642
  })
2537
2643
  ]
2538
2644
  }),
2539
- i && /* @__PURE__ */ H(cn, { context: h }),
2540
- B && D && /* @__PURE__ */ H(Qn, {
2541
- context: h,
2645
+ i && /* @__PURE__ */ U(un, { context: _ }),
2646
+ V && k && /* @__PURE__ */ U(tr, {
2647
+ context: _,
2542
2648
  ui: l,
2543
- overlayTarget: D,
2649
+ overlayTarget: k,
2544
2650
  colors: s,
2545
2651
  highlights: c,
2546
- uploadAsset: x,
2547
- behaviorOptions: S,
2548
- onLink: P,
2549
- onWhiteboardEdit: () => I("edit"),
2550
- onPaletteOpenChange: ie
2652
+ uploadAsset: C,
2653
+ behaviorOptions: w,
2654
+ onLink: L,
2655
+ onWhiteboardEdit: () => R("edit"),
2656
+ onPaletteOpenChange: ae
2551
2657
  }),
2552
- B && D && x && F && /* @__PURE__ */ H(In, {
2658
+ V && k && C && oe && /* @__PURE__ */ U(zn, {
2553
2659
  appearance: l?.whiteboard,
2554
- context: h,
2555
- uploadAsset: x,
2556
- overlayTarget: D,
2557
- edit: F === "edit",
2558
- onClose: () => I(void 0)
2660
+ context: _,
2661
+ uploadAsset: C,
2662
+ overlayTarget: k,
2663
+ edit: oe === "edit",
2664
+ onClose: () => R(void 0)
2559
2665
  }),
2560
- B && M && D && /* @__PURE__ */ H(ir, {
2666
+ V && P && k && /* @__PURE__ */ U(lr, {
2561
2667
  appearance: l?.slashMenu,
2562
- state: M,
2563
- target: D,
2564
- t: h.t
2668
+ state: P,
2669
+ target: k,
2670
+ t: _.t
2671
+ }),
2672
+ V && ne && k && /* @__PURE__ */ U(ar, {
2673
+ state: ne,
2674
+ target: k,
2675
+ t: _.t,
2676
+ renderItem: d
2565
2677
  }),
2566
- B && N && D && /* @__PURE__ */ H(wn, {
2678
+ f && k && /* @__PURE__ */ U(or, {
2679
+ editor: _.editor.view.dom,
2680
+ container: k,
2681
+ hoverDelay: r[mr].mentionHoverDelay,
2682
+ render: f
2683
+ }, _.editor.instanceId),
2684
+ V && I && k && /* @__PURE__ */ U(Dn, {
2567
2685
  appearance: l?.insertionPopover,
2568
- context: h,
2569
- request: N,
2570
- overlayTarget: D,
2571
- canUpload: !!x,
2572
- behaviorOptions: S,
2573
- onClose: () => P(void 0)
2574
- }, N.kind),
2575
- D && j && /* @__PURE__ */ H(tr, {
2686
+ context: _,
2687
+ request: I,
2688
+ overlayTarget: k,
2689
+ canUpload: !!C,
2690
+ behaviorOptions: w,
2691
+ onClose: () => L(void 0)
2692
+ }, I.kind),
2693
+ k && M && /* @__PURE__ */ U(ir, {
2576
2694
  appearance: l?.imagePreview,
2577
- context: h,
2578
- overlayTarget: D,
2579
- imagePreview: j,
2580
- onClose: () => te(void 0)
2695
+ context: _,
2696
+ overlayTarget: k,
2697
+ imagePreview: M,
2698
+ onClose: () => N(void 0)
2581
2699
  })
2582
- ] }), /* @__PURE__ */ H("div", {
2583
- ref: O,
2700
+ ] }), /* @__PURE__ */ U("div", {
2701
+ ref: A,
2584
2702
  className: "vibe-shadcn-tiptap__overlays",
2585
- children: /* @__PURE__ */ H("div", {
2703
+ children: /* @__PURE__ */ U("div", {
2586
2704
  className: "vibe-shadcn-tiptap__notices",
2587
2705
  "aria-live": "polite",
2588
- children: ae.map(({ id: e, message: t, type: n }) => /* @__PURE__ */ H("div", {
2706
+ children: se.map(({ id: e, message: t, type: n }) => /* @__PURE__ */ U("div", {
2589
2707
  role: n === "error" ? "alert" : "status",
2590
2708
  "data-type": n,
2591
2709
  children: t
@@ -2596,4 +2714,4 @@ function dr(e) {
2596
2714
  })
2597
2715
  });
2598
2716
  }
2599
- export { _ as DEFAULT_CODE_BLOCK_LANGUAGES, v as DEFAULT_HORIZONTAL_RULES, e as PRESET_HIGHLIGHT_COLORS, t as PRESET_TEXT_COLORS, y as SHADCN_UI_DEFAULT_TOOLBAR, sn as ShadcnTiptapContent, dr as ShadcnTiptapEditor, dr as VibeTiptap, cn as ShadcnTiptapStatusBar, Hn as ShadcnTiptapToolbar, b as TOOLBAR_ALIGN_OPTIONS, S as TOOLBAR_HEADING_OPTIONS, n as TOOLBAR_HEADING_PREVIEW_STYLES, a as TOOLBAR_MARKDOWN_IMPORT_ACCEPT, o as TOOLBAR_MARKDOWN_OPTIONS, w as TOOLBAR_TABLE_GRID, Pn as VibeTiptapProvider, c as copyMarkdown, u as exportMarkdownFile, f as importMarkdownFile, T as normalizeToolbarConfig, h as printEditorContent, ur as useVibeTiptap };
2717
+ export { _ as DEFAULT_CODE_BLOCK_LANGUAGES, v as DEFAULT_HORIZONTAL_RULES, e as PRESET_HIGHLIGHT_COLORS, t as PRESET_TEXT_COLORS, y as SHADCN_UI_DEFAULT_TOOLBAR, ln as ShadcnTiptapContent, gr as ShadcnTiptapEditor, gr as VibeTiptap, un as ShadcnTiptapStatusBar, Gn as ShadcnTiptapToolbar, b as TOOLBAR_ALIGN_OPTIONS, S as TOOLBAR_HEADING_OPTIONS, n as TOOLBAR_HEADING_PREVIEW_STYLES, a as TOOLBAR_MARKDOWN_IMPORT_ACCEPT, o as TOOLBAR_MARKDOWN_OPTIONS, w as TOOLBAR_TABLE_GRID, Ln as VibeTiptapProvider, c as copyMarkdown, u as exportMarkdownFile, f as importMarkdownFile, T as normalizeToolbarConfig, h as printEditorContent, hr as useVibeTiptap };