@devalok/shilp-sutra 0.45.0 → 0.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-editor.d.ts","sourceRoot":"","sources":["../../src/composed/rich-text-editor.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAsV9C,MAAM,MAAM,WAAW,GACnB,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GACxD,IAAI,GAAG,IAAI,GAAG,YAAY,GAC1B,YAAY,GAAG,aAAa,GAAG,UAAU,GAAG,WAAW,GACvD,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAChC,WAAW,GAAG,aAAa,GAAG,YAAY,GAC1C,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAE7B,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9G,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sGAAsG;IACtG,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IA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,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED,QAAA,MAAM,cAAc,4FA6PnB,CAAA;AAID,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IACjG,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,cAAc,4FAuDnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA"}
@@ -2,15 +2,16 @@
2
2
  import { cn as e } from "../ui/lib/utils.js";
3
3
  import { Icon as t } from "../ui/icon.js";
4
4
  import { Button as n } from "../ui/button.js";
5
- import { a as r, c as i, d as a, f as o, h as s, l as c, m as l, n as u, r as d, t as f } from "../_chunks/tiptap.js";
6
- import { useColorMode as p } from "../hooks/use-color-mode.js";
7
- import { n as m, r as h } from "../_chunks/emoji-data.js";
8
- import { EmojiNode as g } from "./extensions/emoji-node.js";
9
- import { createEmojiSuggestion as _ } from "./extensions/emoji-suggestion.js";
10
- import { n as v, t as y } from "../_chunks/mention-suggestion.js";
11
- import * as b from "react";
12
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
13
- import { IconAlignCenter as C, IconAlignLeft as w, IconAlignRight as T, IconArrowBackUp as E, IconArrowForwardUp as D, IconBlockquote as O, IconBold as k, IconCode as A, IconH2 as j, IconH3 as M, IconHighlight as N, IconItalic as P, IconLineDashed as F, IconLink as I, IconList as L, IconListCheck as R, IconListNumbers as z, IconMoodSmile as B, IconPaperclip as V, IconPhoto as H, IconStrikethrough as U, IconUnderline as W } from "@tabler/icons-react";
5
+ import { t as r } from "../_chunks/mention.js";
6
+ import { a as i, c as a, d as o, f as s, h as c, l, m as u, n as d, r as f, t as p } from "../_chunks/tiptap.js";
7
+ import { useColorMode as m } from "../hooks/use-color-mode.js";
8
+ import { n as h, r as g } from "../_chunks/emoji-data.js";
9
+ import { EmojiNode as _ } from "./extensions/emoji-node.js";
10
+ import { createEmojiSuggestion as v } from "./extensions/emoji-suggestion.js";
11
+ import { n as y, t as b } from "../_chunks/mention-suggestion.js";
12
+ import * as x from "react";
13
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
14
+ import { IconAlignCenter as w, IconAlignLeft as T, IconAlignRight as E, IconArrowBackUp as D, IconArrowForwardUp as O, IconBlockquote as k, IconBold as A, IconCode as j, IconH2 as M, IconH3 as N, IconHighlight as P, IconItalic as F, IconLineDashed as I, IconLink as L, IconList as R, IconListCheck as z, IconListNumbers as B, IconMoodSmile as V, IconPaperclip as H, IconPhoto as U, IconStrikethrough as ee, IconUnderline as W } from "@tabler/icons-react";
14
15
  //#region src/composed/rich-text-editor.tsx
15
16
  var G = [
16
17
  "prose prose-sm max-w-none",
@@ -29,10 +30,10 @@ var G = [
29
30
  "[&_hr]:my-ds-04 [&_hr]:border-surface-border-strong",
30
31
  "[&_a]:text-accent-11 [&_a]:underline [&_a]:decoration-accent-6 hover:[&_a]:decoration-accent-11",
31
32
  "[&_img]:max-w-full [&_img]:rounded-control [&_img]:my-ds-03",
32
- "[&_.mention]:rounded-control-inner [&_.mention]:bg-accent-2 [&_.mention]:px-ds-02 [&_.mention]:py-[1px] [&_.mention]:font-medium [&_.mention]:text-accent-11"
33
+ r
33
34
  ];
34
35
  function K({ onClick: t, isActive: n = !1, disabled: r = !1, title: i, children: a }) {
35
- return /* @__PURE__ */ x("button", {
36
+ return /* @__PURE__ */ S("button", {
36
37
  type: "button",
37
38
  onClick: t,
38
39
  disabled: r,
@@ -44,33 +45,33 @@ function K({ onClick: t, isActive: n = !1, disabled: r = !1, title: i, children:
44
45
  });
45
46
  }
46
47
  function q({ editor: e }) {
47
- let [r, i] = b.useState(!1), [a, o] = b.useState(""), s = b.useRef(null), { isLink: l } = c({
48
+ let [r, i] = x.useState(!1), [a, o] = x.useState(""), s = x.useRef(null), { isLink: c } = l({
48
49
  editor: e,
49
50
  selector: ({ editor: e }) => ({ isLink: e.isActive("link") })
50
51
  });
51
- return /* @__PURE__ */ S("div", {
52
+ return /* @__PURE__ */ C("div", {
52
53
  className: "relative",
53
- children: [/* @__PURE__ */ x(K, {
54
+ children: [/* @__PURE__ */ S(K, {
54
55
  onClick: () => {
55
- if (l) {
56
+ if (c) {
56
57
  e.chain().focus().unsetLink().run();
57
58
  return;
58
59
  }
59
60
  o(e.getAttributes("link").href || ""), i(!0), setTimeout(() => s.current?.focus(), 0);
60
61
  },
61
- isActive: l,
62
+ isActive: c,
62
63
  title: "Link",
63
- children: /* @__PURE__ */ x(t, {
64
- icon: I,
64
+ children: /* @__PURE__ */ S(t, {
65
+ icon: L,
65
66
  size: "sm"
66
67
  })
67
- }), r && /* @__PURE__ */ S("form", {
68
+ }), r && /* @__PURE__ */ C("form", {
68
69
  onSubmit: (t) => {
69
70
  t.preventDefault(), a.trim() && e.chain().focus().setLink({ href: a.trim() }).run(), i(!1), o("");
70
71
  },
71
72
  "aria-label": "Edit link URL",
72
73
  className: "absolute left-0 top-full z-popover mt-ds-01 flex items-center gap-ds-02 rounded-control bg-surface-overlay p-ds-02 shadow-raised-hover",
73
- children: [/* @__PURE__ */ x("input", {
74
+ children: [/* @__PURE__ */ S("input", {
74
75
  ref: s,
75
76
  type: "url",
76
77
  value: a,
@@ -80,7 +81,7 @@ function q({ editor: e }) {
80
81
  },
81
82
  placeholder: "https://...",
82
83
  className: "h-ds-sm w-[240px] rounded-control-inner border border-surface-border-strong bg-surface-overlay px-ds-03 text-ds-sm text-surface-fg focus:border-accent-7 focus:outline-hidden"
83
- }), /* @__PURE__ */ x(n, {
84
+ }), /* @__PURE__ */ S(n, {
84
85
  type: "submit",
85
86
  variant: "solid",
86
87
  size: "sm",
@@ -90,10 +91,10 @@ function q({ editor: e }) {
90
91
  });
91
92
  }
92
93
  function J() {
93
- return /* @__PURE__ */ x("div", { className: "mx-ds-02 h-[16px] w-px bg-surface-border" });
94
+ return /* @__PURE__ */ S("div", { className: "mx-ds-02 h-[16px] w-px bg-surface-border" });
94
95
  }
95
96
  function Y({ editor: e, toolbar: n, onImageClick: r, onFileClick: i, onEmojiClick: a }) {
96
- let o = c({
97
+ let o = l({
97
98
  editor: e,
98
99
  selector: ({ editor: e }) => ({
99
100
  isBold: e.isActive("bold"),
@@ -115,234 +116,234 @@ function Y({ editor: e, toolbar: n, onImageClick: r, onFileClick: i, onEmojiClic
115
116
  canUndo: e.can().undo(),
116
117
  canRedo: e.can().redo()
117
118
  })
118
- }), s = (e) => !n || n.includes(e), l = s("bold") || s("italic") || s("underline") || s("strike") || s("highlight"), u = s("h2") || s("h3") || s("blockquote"), d = s("bulletList") || s("orderedList") || s("taskList") || s("codeBlock"), f = s("link") || !!r && s("image") || !!i && s("file") || s("hr"), p = s("alignLeft") || s("alignCenter") || s("alignRight"), m = !!a && s("emoji"), h = s("undo") || s("redo");
119
- return /* @__PURE__ */ S("div", {
119
+ }), s = (e) => !n || n.includes(e), c = s("bold") || s("italic") || s("underline") || s("strike") || s("highlight"), u = s("h2") || s("h3") || s("blockquote"), d = s("bulletList") || s("orderedList") || s("taskList") || s("codeBlock"), f = s("link") || !!r && s("image") || !!i && s("file") || s("hr"), p = s("alignLeft") || s("alignCenter") || s("alignRight"), m = !!a && s("emoji"), h = s("undo") || s("redo");
120
+ return /* @__PURE__ */ C("div", {
120
121
  role: "toolbar",
121
122
  "aria-label": "Text formatting",
122
123
  className: "flex flex-wrap items-center gap-ds-01 border-b border-surface-border-strong px-ds-04 py-ds-02b",
123
124
  children: [
124
- s("bold") && /* @__PURE__ */ x(K, {
125
+ s("bold") && /* @__PURE__ */ S(K, {
125
126
  onClick: () => e.chain().focus().toggleBold().run(),
126
127
  isActive: o.isBold,
127
128
  title: "Bold",
128
- children: /* @__PURE__ */ x(t, {
129
- icon: k,
129
+ children: /* @__PURE__ */ S(t, {
130
+ icon: A,
130
131
  size: "sm",
131
132
  stroke: "bold"
132
133
  })
133
134
  }),
134
- s("italic") && /* @__PURE__ */ x(K, {
135
+ s("italic") && /* @__PURE__ */ S(K, {
135
136
  onClick: () => e.chain().focus().toggleItalic().run(),
136
137
  isActive: o.isItalic,
137
138
  title: "Italic",
138
- children: /* @__PURE__ */ x(t, {
139
- icon: P,
139
+ children: /* @__PURE__ */ S(t, {
140
+ icon: F,
140
141
  size: "sm",
141
142
  stroke: "bold"
142
143
  })
143
144
  }),
144
- s("underline") && /* @__PURE__ */ x(K, {
145
+ s("underline") && /* @__PURE__ */ S(K, {
145
146
  onClick: () => e.chain().focus().toggleUnderline().run(),
146
147
  isActive: o.isUnderline,
147
148
  title: "Underline",
148
- children: /* @__PURE__ */ x(t, {
149
+ children: /* @__PURE__ */ S(t, {
149
150
  icon: W,
150
151
  size: "sm",
151
152
  stroke: "bold"
152
153
  })
153
154
  }),
154
- s("strike") && /* @__PURE__ */ x(K, {
155
+ s("strike") && /* @__PURE__ */ S(K, {
155
156
  onClick: () => e.chain().focus().toggleStrike().run(),
156
157
  isActive: o.isStrike,
157
158
  title: "Strikethrough",
158
- children: /* @__PURE__ */ x(t, {
159
- icon: U,
159
+ children: /* @__PURE__ */ S(t, {
160
+ icon: ee,
160
161
  size: "sm",
161
162
  stroke: "bold"
162
163
  })
163
164
  }),
164
- s("highlight") && /* @__PURE__ */ x(K, {
165
+ s("highlight") && /* @__PURE__ */ S(K, {
165
166
  onClick: () => e.chain().focus().toggleHighlight().run(),
166
167
  isActive: o.isHighlight,
167
168
  title: "Highlight",
168
- children: /* @__PURE__ */ x(t, {
169
- icon: N,
169
+ children: /* @__PURE__ */ S(t, {
170
+ icon: P,
170
171
  size: "sm",
171
172
  stroke: "bold"
172
173
  })
173
174
  }),
174
- l && u && /* @__PURE__ */ x(J, {}),
175
- s("h2") && /* @__PURE__ */ x(K, {
175
+ c && u && /* @__PURE__ */ S(J, {}),
176
+ s("h2") && /* @__PURE__ */ S(K, {
176
177
  onClick: () => e.chain().focus().toggleHeading({ level: 2 }).run(),
177
178
  isActive: o.isH2,
178
179
  title: "Heading 2",
179
- children: /* @__PURE__ */ x(t, {
180
- icon: j,
180
+ children: /* @__PURE__ */ S(t, {
181
+ icon: M,
181
182
  size: "sm",
182
183
  stroke: "bold"
183
184
  })
184
185
  }),
185
- s("h3") && /* @__PURE__ */ x(K, {
186
+ s("h3") && /* @__PURE__ */ S(K, {
186
187
  onClick: () => e.chain().focus().toggleHeading({ level: 3 }).run(),
187
188
  isActive: o.isH3,
188
189
  title: "Heading 3",
189
- children: /* @__PURE__ */ x(t, {
190
- icon: M,
190
+ children: /* @__PURE__ */ S(t, {
191
+ icon: N,
191
192
  size: "sm",
192
193
  stroke: "bold"
193
194
  })
194
195
  }),
195
- s("blockquote") && /* @__PURE__ */ x(K, {
196
+ s("blockquote") && /* @__PURE__ */ S(K, {
196
197
  onClick: () => e.chain().focus().toggleBlockquote().run(),
197
198
  isActive: o.isBlockquote,
198
199
  title: "Blockquote",
199
- children: /* @__PURE__ */ x(t, {
200
- icon: O,
200
+ children: /* @__PURE__ */ S(t, {
201
+ icon: k,
201
202
  size: "sm",
202
203
  stroke: "bold"
203
204
  })
204
205
  }),
205
- u && d && /* @__PURE__ */ x(J, {}),
206
- s("bulletList") && /* @__PURE__ */ x(K, {
206
+ u && d && /* @__PURE__ */ S(J, {}),
207
+ s("bulletList") && /* @__PURE__ */ S(K, {
207
208
  onClick: () => e.chain().focus().toggleBulletList().run(),
208
209
  isActive: o.isBulletList,
209
210
  title: "Bullet list",
210
- children: /* @__PURE__ */ x(t, {
211
- icon: L,
211
+ children: /* @__PURE__ */ S(t, {
212
+ icon: R,
212
213
  size: "sm",
213
214
  stroke: "bold"
214
215
  })
215
216
  }),
216
- s("orderedList") && /* @__PURE__ */ x(K, {
217
+ s("orderedList") && /* @__PURE__ */ S(K, {
217
218
  onClick: () => e.chain().focus().toggleOrderedList().run(),
218
219
  isActive: o.isOrderedList,
219
220
  title: "Ordered list",
220
- children: /* @__PURE__ */ x(t, {
221
- icon: z,
221
+ children: /* @__PURE__ */ S(t, {
222
+ icon: B,
222
223
  size: "sm",
223
224
  stroke: "bold"
224
225
  })
225
226
  }),
226
- s("taskList") && /* @__PURE__ */ x(K, {
227
+ s("taskList") && /* @__PURE__ */ S(K, {
227
228
  onClick: () => e.chain().focus().toggleTaskList().run(),
228
229
  isActive: o.isTaskList,
229
230
  title: "Task list",
230
- children: /* @__PURE__ */ x(t, {
231
- icon: R,
231
+ children: /* @__PURE__ */ S(t, {
232
+ icon: z,
232
233
  size: "sm",
233
234
  stroke: "bold"
234
235
  })
235
236
  }),
236
- s("codeBlock") && /* @__PURE__ */ x(K, {
237
+ s("codeBlock") && /* @__PURE__ */ S(K, {
237
238
  onClick: () => e.chain().focus().toggleCodeBlock().run(),
238
239
  isActive: o.isCodeBlock,
239
240
  title: "Code block",
240
- children: /* @__PURE__ */ x(t, {
241
- icon: A,
241
+ children: /* @__PURE__ */ S(t, {
242
+ icon: j,
242
243
  size: "sm",
243
244
  stroke: "bold"
244
245
  })
245
246
  }),
246
- d && f && /* @__PURE__ */ x(J, {}),
247
- s("link") && /* @__PURE__ */ x(q, { editor: e }),
248
- r && s("image") && /* @__PURE__ */ x(K, {
247
+ d && f && /* @__PURE__ */ S(J, {}),
248
+ s("link") && /* @__PURE__ */ S(q, { editor: e }),
249
+ r && s("image") && /* @__PURE__ */ S(K, {
249
250
  onClick: r,
250
251
  title: "Insert image",
251
- children: /* @__PURE__ */ x(t, {
252
- icon: H,
252
+ children: /* @__PURE__ */ S(t, {
253
+ icon: U,
253
254
  size: "sm"
254
255
  })
255
256
  }),
256
- i && s("file") && /* @__PURE__ */ x(K, {
257
+ i && s("file") && /* @__PURE__ */ S(K, {
257
258
  onClick: i,
258
259
  title: "Attach file",
259
- children: /* @__PURE__ */ x(t, {
260
- icon: V,
260
+ children: /* @__PURE__ */ S(t, {
261
+ icon: H,
261
262
  size: "sm"
262
263
  })
263
264
  }),
264
- s("hr") && /* @__PURE__ */ x(K, {
265
+ s("hr") && /* @__PURE__ */ S(K, {
265
266
  onClick: () => e.chain().focus().setHorizontalRule().run(),
266
267
  title: "Horizontal rule",
267
- children: /* @__PURE__ */ x(t, {
268
- icon: F,
268
+ children: /* @__PURE__ */ S(t, {
269
+ icon: I,
269
270
  size: "sm"
270
271
  })
271
272
  }),
272
- f && p && /* @__PURE__ */ x(J, {}),
273
- s("alignLeft") && /* @__PURE__ */ x(K, {
273
+ f && p && /* @__PURE__ */ S(J, {}),
274
+ s("alignLeft") && /* @__PURE__ */ S(K, {
274
275
  onClick: () => e.chain().focus().setTextAlign("left").run(),
275
276
  isActive: o.isAlignLeft,
276
277
  title: "Align left",
277
- children: /* @__PURE__ */ x(t, {
278
- icon: w,
278
+ children: /* @__PURE__ */ S(t, {
279
+ icon: T,
279
280
  size: "sm"
280
281
  })
281
282
  }),
282
- s("alignCenter") && /* @__PURE__ */ x(K, {
283
+ s("alignCenter") && /* @__PURE__ */ S(K, {
283
284
  onClick: () => e.chain().focus().setTextAlign("center").run(),
284
285
  isActive: o.isAlignCenter,
285
286
  title: "Align center",
286
- children: /* @__PURE__ */ x(t, {
287
- icon: C,
287
+ children: /* @__PURE__ */ S(t, {
288
+ icon: w,
288
289
  size: "sm"
289
290
  })
290
291
  }),
291
- s("alignRight") && /* @__PURE__ */ x(K, {
292
+ s("alignRight") && /* @__PURE__ */ S(K, {
292
293
  onClick: () => e.chain().focus().setTextAlign("right").run(),
293
294
  isActive: o.isAlignRight,
294
295
  title: "Align right",
295
- children: /* @__PURE__ */ x(t, {
296
- icon: T,
296
+ children: /* @__PURE__ */ S(t, {
297
+ icon: E,
297
298
  size: "sm"
298
299
  })
299
300
  }),
300
- p && (m || h) && /* @__PURE__ */ x(J, {}),
301
- a && s("emoji") && /* @__PURE__ */ x(K, {
301
+ p && (m || h) && /* @__PURE__ */ S(J, {}),
302
+ a && s("emoji") && /* @__PURE__ */ S(K, {
302
303
  onClick: a,
303
304
  title: "Emoji",
304
- children: /* @__PURE__ */ x(t, {
305
- icon: B,
305
+ children: /* @__PURE__ */ S(t, {
306
+ icon: V,
306
307
  size: "sm"
307
308
  })
308
309
  }),
309
- s("undo") && /* @__PURE__ */ x(K, {
310
+ s("undo") && /* @__PURE__ */ S(K, {
310
311
  onClick: () => e.chain().focus().undo().run(),
311
312
  disabled: !o.canUndo,
312
313
  title: "Undo",
313
- children: /* @__PURE__ */ x(t, {
314
- icon: E,
314
+ children: /* @__PURE__ */ S(t, {
315
+ icon: D,
315
316
  size: "sm"
316
317
  })
317
318
  }),
318
- s("redo") && /* @__PURE__ */ x(K, {
319
+ s("redo") && /* @__PURE__ */ S(K, {
319
320
  onClick: () => e.chain().focus().redo().run(),
320
321
  disabled: !o.canRedo,
321
322
  title: "Redo",
322
- children: /* @__PURE__ */ x(t, {
323
- icon: D,
323
+ children: /* @__PURE__ */ S(t, {
324
+ icon: O,
324
325
  size: "sm"
325
326
  })
326
327
  })
327
328
  ]
328
329
  });
329
330
  }
330
- var X = b.lazy(() => import("@emoji-mart/react"));
331
+ var X = x.lazy(() => import("@emoji-mart/react"));
331
332
  function Z({ set: e = "native", onSelect: t }) {
332
- let [n, r] = b.useState(null), { colorMode: i } = p();
333
- b.useEffect(() => {
334
- m(e).then((e) => r(e));
333
+ let [n, r] = x.useState(null), { colorMode: i } = m();
334
+ x.useEffect(() => {
335
+ h(e).then((e) => r(e));
335
336
  }, [e]);
336
- let a = /* @__PURE__ */ x("div", {
337
+ let a = /* @__PURE__ */ S("div", {
337
338
  className: "flex h-[350px] w-[352px] items-center justify-center rounded-surface bg-surface-overlay shadow-raised-hover",
338
- children: /* @__PURE__ */ x("span", {
339
+ children: /* @__PURE__ */ S("span", {
339
340
  className: "text-ds-sm text-surface-fg-subtle",
340
341
  children: "Loading..."
341
342
  })
342
343
  });
343
- return n ? /* @__PURE__ */ x(b.Suspense, {
344
+ return n ? /* @__PURE__ */ S(x.Suspense, {
344
345
  fallback: a,
345
- children: /* @__PURE__ */ x(X, {
346
+ children: /* @__PURE__ */ S(X, {
346
347
  data: n,
347
348
  set: e,
348
349
  onEmojiSelect: (e) => t({
@@ -355,8 +356,8 @@ function Z({ set: e = "native", onSelect: t }) {
355
356
  })
356
357
  }) : a;
357
358
  }
358
- var Q = b.forwardRef(function({ content: t = "", placeholder: n = "Start writing...", onChange: c, className: p, editable: C = !0, toolbar: w, onImageUpload: T, onFileUpload: E, mentions: D, onMentionSearch: O, onMentionSelect: k, emojiSet: A = "native", ...j }, M) {
359
- let N = b.useRef(null), P = b.useRef(!1), [F, I] = b.useState(!1), L = b.useRef(null), R = b.useRef(null), z = b.useRef(null), B = async (e) => {
359
+ var Q = x.forwardRef(function({ content: t = "", placeholder: n = "Start writing...", onChange: r, className: l, editable: m = !0, toolbar: w, onImageUpload: T, onFileUpload: E, mentions: D, onMentionSearch: O, onMentionSelect: k, emojiSet: A = "native", ...j }, M) {
360
+ let N = x.useRef(null), P = x.useRef(!1), [F, I] = x.useState(!1), L = x.useRef(null), R = x.useRef(null), z = x.useRef(null), B = async (e) => {
360
361
  let t = N.current;
361
362
  if (t) if (T) {
362
363
  let n = await T(e);
@@ -379,10 +380,10 @@ var Q = b.forwardRef(function({ content: t = "", placeholder: n = "Start writing
379
380
  size: n.size
380
381
  }
381
382
  }).run();
382
- }, H = i({
383
+ }, H = a({
383
384
  immediatelyRender: !1,
384
385
  extensions: [
385
- u.configure({
386
+ d.configure({
386
387
  heading: { levels: [2, 3] },
387
388
  link: {
388
389
  openOnClick: !1,
@@ -398,12 +399,12 @@ var Q = b.forwardRef(function({ content: t = "", placeholder: n = "Start writing
398
399
  }
399
400
  }
400
401
  }),
401
- a.configure({
402
+ o.configure({
402
403
  placeholder: n,
403
404
  emptyEditorClass: "before:content-[attr(data-placeholder)] before:text-surface-fg-subtle before:float-left before:h-0 before:pointer-events-none"
404
405
  }),
405
- s.configure({ multicolor: !1 }),
406
- d.configure({
406
+ c.configure({ multicolor: !1 }),
407
+ f.configure({
407
408
  bulletList: !1,
408
409
  orderedList: !1,
409
410
  listItem: !1,
@@ -411,24 +412,24 @@ var Q = b.forwardRef(function({ content: t = "", placeholder: n = "Start writing
411
412
  taskList: {},
412
413
  taskItem: { nested: !0 }
413
414
  }),
414
- f.configure({ types: ["heading", "paragraph"] }),
415
- l.configure({
415
+ p.configure({ types: ["heading", "paragraph"] }),
416
+ u.configure({
416
417
  allowBase64: !0,
417
418
  HTMLAttributes: { class: "max-w-full rounded-control" }
418
419
  }),
419
- v,
420
- ...D || O ? [o.configure({
420
+ y,
421
+ ...D || O ? [s.configure({
421
422
  HTMLAttributes: { class: "mention" },
422
423
  suggestion: {
423
424
  items: async ({ query: e }) => O ? await O(e) : D ? D.filter((t) => t.label.toLowerCase().includes(e.toLowerCase())).slice(0, 8) : [],
424
- render: y(k)
425
+ render: b(k)
425
426
  }
426
427
  })] : [],
427
- g,
428
- _(A)
428
+ _,
429
+ v(A)
429
430
  ],
430
431
  content: t,
431
- editable: C,
432
+ editable: m,
432
433
  editorProps: {
433
434
  handleDrop: (e, t, n, r) => {
434
435
  if (r || !t.dataTransfer?.files.length) return !1;
@@ -442,35 +443,35 @@ var Q = b.forwardRef(function({ content: t = "", placeholder: n = "Start writing
442
443
  attributes: { class: e(...G, "focus:outline-hidden", "min-h-[120px] px-ds-04 py-ds-04") }
443
444
  },
444
445
  onUpdate: ({ editor: e }) => {
445
- P.current = !0, c?.(e.getHTML()), queueMicrotask(() => {
446
+ P.current = !0, r?.(e.getHTML()), queueMicrotask(() => {
446
447
  P.current = !1;
447
448
  });
448
449
  }
449
450
  });
450
- return b.useEffect(() => {
451
+ return x.useEffect(() => {
451
452
  N.current = H;
452
- }, [H]), b.useEffect(() => {
453
+ }, [H]), x.useEffect(() => {
453
454
  if (!F) return;
454
455
  let e = (e) => {
455
456
  L.current && !L.current.contains(e.target) && I(!1);
456
457
  };
457
458
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
458
- }, [F]), b.useEffect(() => {
459
+ }, [F]), x.useEffect(() => {
459
460
  P.current || H && t !== H.getHTML() && H.commands.setContent(t, { emitUpdate: !1 });
460
- }, [H, t]), H ? /* @__PURE__ */ S("div", {
461
+ }, [H, t]), H ? /* @__PURE__ */ C("div", {
461
462
  ref: M,
462
463
  ...j,
463
- className: e("relative", p),
464
- children: [F && /* @__PURE__ */ x("div", {
464
+ className: e("relative", l),
465
+ children: [F && /* @__PURE__ */ S("div", {
465
466
  ref: L,
466
467
  className: "absolute bottom-full right-0 z-popover mb-ds-02",
467
468
  onKeyDown: (e) => {
468
469
  e.key === "Escape" && (e.stopPropagation(), I(!1));
469
470
  },
470
- children: /* @__PURE__ */ x(Z, {
471
+ children: /* @__PURE__ */ S(Z, {
471
472
  set: A,
472
473
  onSelect: async ({ id: e, native: t }) => {
473
- let n = h(await m(A), e);
474
+ let n = g(await h(A), e);
474
475
  n ? H.chain().focus().insertContent({
475
476
  type: "emojiNode",
476
477
  attrs: {
@@ -483,10 +484,10 @@ var Q = b.forwardRef(function({ content: t = "", placeholder: n = "Start writing
483
484
  }).run() : H.chain().focus().insertContent(t).run(), I(!1);
484
485
  }
485
486
  })
486
- }), /* @__PURE__ */ S("div", {
487
+ }), /* @__PURE__ */ C("div", {
487
488
  className: e("overflow-hidden rounded-surface border border-surface-border-strong bg-surface-raised", "transition-colors ease-productive-standard focus-within:border-surface-border-strong"),
488
489
  children: [
489
- /* @__PURE__ */ x("input", {
490
+ /* @__PURE__ */ S("input", {
490
491
  ref: R,
491
492
  type: "file",
492
493
  accept: "image/*",
@@ -497,7 +498,7 @@ var Q = b.forwardRef(function({ content: t = "", placeholder: n = "Start writing
497
498
  t && B(t), e.target.value = "";
498
499
  }
499
500
  }),
500
- E && /* @__PURE__ */ x("input", {
501
+ E && /* @__PURE__ */ S("input", {
501
502
  ref: z,
502
503
  type: "file",
503
504
  "aria-label": "Upload file",
@@ -507,24 +508,24 @@ var Q = b.forwardRef(function({ content: t = "", placeholder: n = "Start writing
507
508
  t && V(t), e.target.value = "";
508
509
  }
509
510
  }),
510
- C && /* @__PURE__ */ x(Y, {
511
+ m && /* @__PURE__ */ S(Y, {
511
512
  editor: H,
512
513
  toolbar: w,
513
514
  onImageClick: () => R.current?.click(),
514
515
  onFileClick: E ? () => z.current?.click() : void 0,
515
516
  onEmojiClick: () => I((e) => !e)
516
517
  }),
517
- /* @__PURE__ */ x(r, { editor: H })
518
+ /* @__PURE__ */ S(i, { editor: H })
518
519
  ]
519
520
  })]
520
521
  }) : null;
521
522
  });
522
523
  Q.displayName = "RichTextEditor";
523
- var $ = b.forwardRef(function({ content: t, className: n, ...a }, c) {
524
- let p = i({
524
+ var $ = x.forwardRef(function({ content: t, className: n, ...r }, o) {
525
+ let l = a({
525
526
  immediatelyRender: !1,
526
527
  extensions: [
527
- u.configure({
528
+ d.configure({
528
529
  heading: { levels: [2, 3] },
529
530
  link: {
530
531
  openOnClick: !0,
@@ -540,8 +541,8 @@ var $ = b.forwardRef(function({ content: t, className: n, ...a }, c) {
540
541
  }
541
542
  }
542
543
  }),
543
- s.configure({ multicolor: !1 }),
544
- d.configure({
544
+ c.configure({ multicolor: !1 }),
545
+ f.configure({
545
546
  bulletList: !1,
546
547
  orderedList: !1,
547
548
  listItem: !1,
@@ -549,23 +550,23 @@ var $ = b.forwardRef(function({ content: t, className: n, ...a }, c) {
549
550
  taskList: {},
550
551
  taskItem: { nested: !0 }
551
552
  }),
552
- f.configure({ types: ["heading", "paragraph"] }),
553
- l.configure({
553
+ p.configure({ types: ["heading", "paragraph"] }),
554
+ u.configure({
554
555
  allowBase64: !0,
555
556
  HTMLAttributes: { class: "max-w-full rounded-control" }
556
557
  }),
557
- v,
558
- o.configure({ HTMLAttributes: { class: "mention" } })
558
+ y,
559
+ s.configure({ HTMLAttributes: { class: "mention" } })
559
560
  ],
560
561
  content: t,
561
562
  editable: !1,
562
563
  editorProps: { attributes: { class: e(...G) } }
563
564
  });
564
- return p ? /* @__PURE__ */ x("div", {
565
- ref: c,
566
- ...a,
565
+ return l ? /* @__PURE__ */ S("div", {
566
+ ref: o,
567
+ ...r,
567
568
  className: n,
568
- children: /* @__PURE__ */ x(r, { editor: p })
569
+ children: /* @__PURE__ */ S(i, { editor: l })
569
570
  }) : null;
570
571
  });
571
572
  $.displayName = "RichTextViewer";