@devalok/shilp-sutra 0.46.0 → 0.48.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.
Files changed (55) hide show
  1. package/AGENTS.md +37 -1
  2. package/BREAKING.json +46 -0
  3. package/MIGRATION.md +45 -0
  4. package/dist/_chunks/emoji-suggestion.js +124 -0
  5. package/dist/_chunks/emoji-suggestion.js.map +1 -0
  6. package/dist/_chunks/emoji.js +1115 -0
  7. package/dist/_chunks/emoji.js.map +1 -0
  8. package/dist/_chunks/tiptap.js.map +1 -1
  9. package/dist/composed/emoji-picker.d.ts +19 -9
  10. package/dist/composed/emoji-picker.d.ts.map +1 -1
  11. package/dist/composed/emoji-picker.js +87 -68
  12. package/dist/composed/emoji-picker.js.map +1 -1
  13. package/dist/composed/extensions/emoji-data.d.ts +1 -14
  14. package/dist/composed/extensions/emoji-data.d.ts.map +1 -1
  15. package/dist/composed/extensions/emoji-node.d.ts +0 -3
  16. package/dist/composed/extensions/emoji-node.d.ts.map +1 -1
  17. package/dist/composed/extensions/emoji-node.js +9 -34
  18. package/dist/composed/extensions/emoji-node.js.map +1 -1
  19. package/dist/composed/extensions/emoji-suggestion.d.ts +2 -2
  20. package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -1
  21. package/dist/composed/extensions/emoji-suggestion.js +2 -116
  22. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  23. package/dist/composed/rich-chat-input.js +554 -575
  24. package/dist/composed/rich-chat-input.js.map +1 -1
  25. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  26. package/dist/composed/rich-text-editor.js +167 -190
  27. package/dist/composed/rich-text-editor.js.map +1 -1
  28. package/docs/components/composed/emoji-picker.md +19 -17
  29. package/docs/components/composed/rich-text-editor.md +1 -1
  30. package/docs/components/ui/table-row-link.md +1 -1
  31. package/docs/recipes/index.md +1 -1
  32. package/docs/recipes/install-astro.md +15 -12
  33. package/docs/recipes/install-next-app-router.md +20 -12
  34. package/docs/recipes/install-next-pages.md +3 -1
  35. package/docs/recipes/install-remix.md +16 -13
  36. package/docs/recipes/install-tanstack-start.md +108 -54
  37. package/docs/recipes/install-vite.md +18 -15
  38. package/docs/recipes/troubleshoot.md +7 -8
  39. package/llms.txt +2 -2
  40. package/mcp-manifest.json +54 -48
  41. package/mcp-manifest.schema.json +6 -0
  42. package/package.json +7 -10
  43. package/scripts/welcome.mjs +4 -2
  44. package/skill/SKILL.md +1 -1
  45. package/skill/references/components.md +2 -2
  46. package/skill/references/setup-astro.md +15 -12
  47. package/skill/references/setup-next-app-router.md +20 -12
  48. package/skill/references/setup-next-pages.md +3 -1
  49. package/skill/references/setup-remix.md +16 -13
  50. package/skill/references/setup-tanstack-start.md +108 -54
  51. package/skill/references/setup-vite.md +18 -15
  52. package/skill/references/troubleshoot.md +7 -8
  53. package/dist/_chunks/emoji-data.js +0 -45
  54. package/dist/_chunks/emoji-data.js.map +0 -1
  55. package/dist/composed/extensions/emoji-suggestion.js.map +0 -1
@@ -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;AAO9B,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,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GAAoG;IACpG,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACnF,+DAA+D;IAC/D,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;IACxB,0EAA0E;IAC1E,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA;IAC3D,sEAAsE;IACtE,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAA;IAC7C,yCAAyC;IACzC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED,QAAA,MAAM,cAAc,4FAwPnB,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"}
@@ -4,16 +4,14 @@ import { Icon as t } from "../ui/icon.js";
4
4
  import { Button as n } from "../ui/button.js";
5
5
  import { t as r } from "../_chunks/mention.js";
6
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";
7
+ import { EmojiNode as m } from "./extensions/emoji-node.js";
8
+ import { t as h } from "../_chunks/emoji-suggestion.js";
9
+ import { n as g, t as _ } from "../_chunks/mention-suggestion.js";
10
+ import * as v from "react";
11
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
12
+ import { IconAlignCenter as x, IconAlignLeft as S, IconAlignRight as C, IconArrowBackUp as w, IconArrowForwardUp as T, IconBlockquote as E, IconBold as D, IconCode as O, IconH2 as k, IconH3 as A, IconHighlight as j, IconItalic as M, IconLineDashed as N, IconLink as P, IconList as F, IconListCheck as I, IconListNumbers as L, IconMoodSmile as R, IconPaperclip as z, IconPhoto as B, IconStrikethrough as V, IconUnderline as H } from "@tabler/icons-react";
15
13
  //#region src/composed/rich-text-editor.tsx
16
- var G = [
14
+ var U = [
17
15
  "prose prose-sm max-w-none",
18
16
  "font-body text-ds-md leading-relaxed text-surface-fg",
19
17
  "[&_h2]:text-ds-xl [&_h2]:mb-ds-03 [&_h2]:mt-ds-05 [&_h2]:text-surface-fg",
@@ -32,8 +30,8 @@ var G = [
32
30
  "[&_img]:max-w-full [&_img]:rounded-control [&_img]:my-ds-03",
33
31
  r
34
32
  ];
35
- function K({ onClick: t, isActive: n = !1, disabled: r = !1, title: i, children: a }) {
36
- return /* @__PURE__ */ S("button", {
33
+ function W({ onClick: t, isActive: n = !1, disabled: r = !1, title: i, children: a }) {
34
+ return /* @__PURE__ */ y("button", {
37
35
  type: "button",
38
36
  onClick: t,
39
37
  disabled: r,
@@ -44,14 +42,14 @@ function K({ onClick: t, isActive: n = !1, disabled: r = !1, title: i, children:
44
42
  children: a
45
43
  });
46
44
  }
47
- function q({ editor: e }) {
48
- let [r, i] = x.useState(!1), [a, o] = x.useState(""), s = x.useRef(null), { isLink: c } = l({
45
+ function G({ editor: e }) {
46
+ let [r, i] = v.useState(!1), [a, o] = v.useState(""), s = v.useRef(null), { isLink: c } = l({
49
47
  editor: e,
50
48
  selector: ({ editor: e }) => ({ isLink: e.isActive("link") })
51
49
  });
52
- return /* @__PURE__ */ C("div", {
50
+ return /* @__PURE__ */ b("div", {
53
51
  className: "relative",
54
- children: [/* @__PURE__ */ S(K, {
52
+ children: [/* @__PURE__ */ y(W, {
55
53
  onClick: () => {
56
54
  if (c) {
57
55
  e.chain().focus().unsetLink().run();
@@ -61,17 +59,17 @@ function q({ editor: e }) {
61
59
  },
62
60
  isActive: c,
63
61
  title: "Link",
64
- children: /* @__PURE__ */ S(t, {
65
- icon: L,
62
+ children: /* @__PURE__ */ y(t, {
63
+ icon: P,
66
64
  size: "sm"
67
65
  })
68
- }), r && /* @__PURE__ */ C("form", {
66
+ }), r && /* @__PURE__ */ b("form", {
69
67
  onSubmit: (t) => {
70
68
  t.preventDefault(), a.trim() && e.chain().focus().setLink({ href: a.trim() }).run(), i(!1), o("");
71
69
  },
72
70
  "aria-label": "Edit link URL",
73
71
  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",
74
- children: [/* @__PURE__ */ S("input", {
72
+ children: [/* @__PURE__ */ y("input", {
75
73
  ref: s,
76
74
  type: "url",
77
75
  value: a,
@@ -81,7 +79,7 @@ function q({ editor: e }) {
81
79
  },
82
80
  placeholder: "https://...",
83
81
  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"
84
- }), /* @__PURE__ */ S(n, {
82
+ }), /* @__PURE__ */ y(n, {
85
83
  type: "submit",
86
84
  variant: "solid",
87
85
  size: "sm",
@@ -90,10 +88,10 @@ function q({ editor: e }) {
90
88
  })]
91
89
  });
92
90
  }
93
- function J() {
94
- return /* @__PURE__ */ S("div", { className: "mx-ds-02 h-[16px] w-px bg-surface-border" });
91
+ function K() {
92
+ return /* @__PURE__ */ y("div", { className: "mx-ds-02 h-[16px] w-px bg-surface-border" });
95
93
  }
96
- function Y({ editor: e, toolbar: n, onImageClick: r, onFileClick: i, onEmojiClick: a }) {
94
+ function q({ editor: e, toolbar: n, onImageClick: r, onFileClick: i, onEmojiClick: a }) {
97
95
  let o = l({
98
96
  editor: e,
99
97
  selector: ({ editor: e }) => ({
@@ -117,250 +115,236 @@ function Y({ editor: e, toolbar: n, onImageClick: r, onFileClick: i, onEmojiClic
117
115
  canRedo: e.can().redo()
118
116
  })
119
117
  }), 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", {
118
+ return /* @__PURE__ */ b("div", {
121
119
  role: "toolbar",
122
120
  "aria-label": "Text formatting",
123
121
  className: "flex flex-wrap items-center gap-ds-01 border-b border-surface-border-strong px-ds-04 py-ds-02b",
124
122
  children: [
125
- s("bold") && /* @__PURE__ */ S(K, {
123
+ s("bold") && /* @__PURE__ */ y(W, {
126
124
  onClick: () => e.chain().focus().toggleBold().run(),
127
125
  isActive: o.isBold,
128
126
  title: "Bold",
129
- children: /* @__PURE__ */ S(t, {
130
- icon: A,
127
+ children: /* @__PURE__ */ y(t, {
128
+ icon: D,
131
129
  size: "sm",
132
130
  stroke: "bold"
133
131
  })
134
132
  }),
135
- s("italic") && /* @__PURE__ */ S(K, {
133
+ s("italic") && /* @__PURE__ */ y(W, {
136
134
  onClick: () => e.chain().focus().toggleItalic().run(),
137
135
  isActive: o.isItalic,
138
136
  title: "Italic",
139
- children: /* @__PURE__ */ S(t, {
140
- icon: F,
137
+ children: /* @__PURE__ */ y(t, {
138
+ icon: M,
141
139
  size: "sm",
142
140
  stroke: "bold"
143
141
  })
144
142
  }),
145
- s("underline") && /* @__PURE__ */ S(K, {
143
+ s("underline") && /* @__PURE__ */ y(W, {
146
144
  onClick: () => e.chain().focus().toggleUnderline().run(),
147
145
  isActive: o.isUnderline,
148
146
  title: "Underline",
149
- children: /* @__PURE__ */ S(t, {
150
- icon: W,
147
+ children: /* @__PURE__ */ y(t, {
148
+ icon: H,
151
149
  size: "sm",
152
150
  stroke: "bold"
153
151
  })
154
152
  }),
155
- s("strike") && /* @__PURE__ */ S(K, {
153
+ s("strike") && /* @__PURE__ */ y(W, {
156
154
  onClick: () => e.chain().focus().toggleStrike().run(),
157
155
  isActive: o.isStrike,
158
156
  title: "Strikethrough",
159
- children: /* @__PURE__ */ S(t, {
160
- icon: ee,
157
+ children: /* @__PURE__ */ y(t, {
158
+ icon: V,
161
159
  size: "sm",
162
160
  stroke: "bold"
163
161
  })
164
162
  }),
165
- s("highlight") && /* @__PURE__ */ S(K, {
163
+ s("highlight") && /* @__PURE__ */ y(W, {
166
164
  onClick: () => e.chain().focus().toggleHighlight().run(),
167
165
  isActive: o.isHighlight,
168
166
  title: "Highlight",
169
- children: /* @__PURE__ */ S(t, {
170
- icon: P,
167
+ children: /* @__PURE__ */ y(t, {
168
+ icon: j,
171
169
  size: "sm",
172
170
  stroke: "bold"
173
171
  })
174
172
  }),
175
- c && u && /* @__PURE__ */ S(J, {}),
176
- s("h2") && /* @__PURE__ */ S(K, {
173
+ c && u && /* @__PURE__ */ y(K, {}),
174
+ s("h2") && /* @__PURE__ */ y(W, {
177
175
  onClick: () => e.chain().focus().toggleHeading({ level: 2 }).run(),
178
176
  isActive: o.isH2,
179
177
  title: "Heading 2",
180
- children: /* @__PURE__ */ S(t, {
181
- icon: M,
178
+ children: /* @__PURE__ */ y(t, {
179
+ icon: k,
182
180
  size: "sm",
183
181
  stroke: "bold"
184
182
  })
185
183
  }),
186
- s("h3") && /* @__PURE__ */ S(K, {
184
+ s("h3") && /* @__PURE__ */ y(W, {
187
185
  onClick: () => e.chain().focus().toggleHeading({ level: 3 }).run(),
188
186
  isActive: o.isH3,
189
187
  title: "Heading 3",
190
- children: /* @__PURE__ */ S(t, {
191
- icon: N,
188
+ children: /* @__PURE__ */ y(t, {
189
+ icon: A,
192
190
  size: "sm",
193
191
  stroke: "bold"
194
192
  })
195
193
  }),
196
- s("blockquote") && /* @__PURE__ */ S(K, {
194
+ s("blockquote") && /* @__PURE__ */ y(W, {
197
195
  onClick: () => e.chain().focus().toggleBlockquote().run(),
198
196
  isActive: o.isBlockquote,
199
197
  title: "Blockquote",
200
- children: /* @__PURE__ */ S(t, {
201
- icon: k,
198
+ children: /* @__PURE__ */ y(t, {
199
+ icon: E,
202
200
  size: "sm",
203
201
  stroke: "bold"
204
202
  })
205
203
  }),
206
- u && d && /* @__PURE__ */ S(J, {}),
207
- s("bulletList") && /* @__PURE__ */ S(K, {
204
+ u && d && /* @__PURE__ */ y(K, {}),
205
+ s("bulletList") && /* @__PURE__ */ y(W, {
208
206
  onClick: () => e.chain().focus().toggleBulletList().run(),
209
207
  isActive: o.isBulletList,
210
208
  title: "Bullet list",
211
- children: /* @__PURE__ */ S(t, {
212
- icon: R,
209
+ children: /* @__PURE__ */ y(t, {
210
+ icon: F,
213
211
  size: "sm",
214
212
  stroke: "bold"
215
213
  })
216
214
  }),
217
- s("orderedList") && /* @__PURE__ */ S(K, {
215
+ s("orderedList") && /* @__PURE__ */ y(W, {
218
216
  onClick: () => e.chain().focus().toggleOrderedList().run(),
219
217
  isActive: o.isOrderedList,
220
218
  title: "Ordered list",
221
- children: /* @__PURE__ */ S(t, {
222
- icon: B,
219
+ children: /* @__PURE__ */ y(t, {
220
+ icon: L,
223
221
  size: "sm",
224
222
  stroke: "bold"
225
223
  })
226
224
  }),
227
- s("taskList") && /* @__PURE__ */ S(K, {
225
+ s("taskList") && /* @__PURE__ */ y(W, {
228
226
  onClick: () => e.chain().focus().toggleTaskList().run(),
229
227
  isActive: o.isTaskList,
230
228
  title: "Task list",
231
- children: /* @__PURE__ */ S(t, {
232
- icon: z,
229
+ children: /* @__PURE__ */ y(t, {
230
+ icon: I,
233
231
  size: "sm",
234
232
  stroke: "bold"
235
233
  })
236
234
  }),
237
- s("codeBlock") && /* @__PURE__ */ S(K, {
235
+ s("codeBlock") && /* @__PURE__ */ y(W, {
238
236
  onClick: () => e.chain().focus().toggleCodeBlock().run(),
239
237
  isActive: o.isCodeBlock,
240
238
  title: "Code block",
241
- children: /* @__PURE__ */ S(t, {
242
- icon: j,
239
+ children: /* @__PURE__ */ y(t, {
240
+ icon: O,
243
241
  size: "sm",
244
242
  stroke: "bold"
245
243
  })
246
244
  }),
247
- d && f && /* @__PURE__ */ S(J, {}),
248
- s("link") && /* @__PURE__ */ S(q, { editor: e }),
249
- r && s("image") && /* @__PURE__ */ S(K, {
245
+ d && f && /* @__PURE__ */ y(K, {}),
246
+ s("link") && /* @__PURE__ */ y(G, { editor: e }),
247
+ r && s("image") && /* @__PURE__ */ y(W, {
250
248
  onClick: r,
251
249
  title: "Insert image",
252
- children: /* @__PURE__ */ S(t, {
253
- icon: U,
250
+ children: /* @__PURE__ */ y(t, {
251
+ icon: B,
254
252
  size: "sm"
255
253
  })
256
254
  }),
257
- i && s("file") && /* @__PURE__ */ S(K, {
255
+ i && s("file") && /* @__PURE__ */ y(W, {
258
256
  onClick: i,
259
257
  title: "Attach file",
260
- children: /* @__PURE__ */ S(t, {
261
- icon: H,
258
+ children: /* @__PURE__ */ y(t, {
259
+ icon: z,
262
260
  size: "sm"
263
261
  })
264
262
  }),
265
- s("hr") && /* @__PURE__ */ S(K, {
263
+ s("hr") && /* @__PURE__ */ y(W, {
266
264
  onClick: () => e.chain().focus().setHorizontalRule().run(),
267
265
  title: "Horizontal rule",
268
- children: /* @__PURE__ */ S(t, {
269
- icon: I,
266
+ children: /* @__PURE__ */ y(t, {
267
+ icon: N,
270
268
  size: "sm"
271
269
  })
272
270
  }),
273
- f && p && /* @__PURE__ */ S(J, {}),
274
- s("alignLeft") && /* @__PURE__ */ S(K, {
271
+ f && p && /* @__PURE__ */ y(K, {}),
272
+ s("alignLeft") && /* @__PURE__ */ y(W, {
275
273
  onClick: () => e.chain().focus().setTextAlign("left").run(),
276
274
  isActive: o.isAlignLeft,
277
275
  title: "Align left",
278
- children: /* @__PURE__ */ S(t, {
279
- icon: T,
276
+ children: /* @__PURE__ */ y(t, {
277
+ icon: S,
280
278
  size: "sm"
281
279
  })
282
280
  }),
283
- s("alignCenter") && /* @__PURE__ */ S(K, {
281
+ s("alignCenter") && /* @__PURE__ */ y(W, {
284
282
  onClick: () => e.chain().focus().setTextAlign("center").run(),
285
283
  isActive: o.isAlignCenter,
286
284
  title: "Align center",
287
- children: /* @__PURE__ */ S(t, {
288
- icon: w,
285
+ children: /* @__PURE__ */ y(t, {
286
+ icon: x,
289
287
  size: "sm"
290
288
  })
291
289
  }),
292
- s("alignRight") && /* @__PURE__ */ S(K, {
290
+ s("alignRight") && /* @__PURE__ */ y(W, {
293
291
  onClick: () => e.chain().focus().setTextAlign("right").run(),
294
292
  isActive: o.isAlignRight,
295
293
  title: "Align right",
296
- children: /* @__PURE__ */ S(t, {
297
- icon: E,
294
+ children: /* @__PURE__ */ y(t, {
295
+ icon: C,
298
296
  size: "sm"
299
297
  })
300
298
  }),
301
- p && (m || h) && /* @__PURE__ */ S(J, {}),
302
- a && s("emoji") && /* @__PURE__ */ S(K, {
299
+ p && (m || h) && /* @__PURE__ */ y(K, {}),
300
+ a && s("emoji") && /* @__PURE__ */ y(W, {
303
301
  onClick: a,
304
302
  title: "Emoji",
305
- children: /* @__PURE__ */ S(t, {
306
- icon: V,
303
+ children: /* @__PURE__ */ y(t, {
304
+ icon: R,
307
305
  size: "sm"
308
306
  })
309
307
  }),
310
- s("undo") && /* @__PURE__ */ S(K, {
308
+ s("undo") && /* @__PURE__ */ y(W, {
311
309
  onClick: () => e.chain().focus().undo().run(),
312
310
  disabled: !o.canUndo,
313
311
  title: "Undo",
314
- children: /* @__PURE__ */ S(t, {
315
- icon: D,
312
+ children: /* @__PURE__ */ y(t, {
313
+ icon: w,
316
314
  size: "sm"
317
315
  })
318
316
  }),
319
- s("redo") && /* @__PURE__ */ S(K, {
317
+ s("redo") && /* @__PURE__ */ y(W, {
320
318
  onClick: () => e.chain().focus().redo().run(),
321
319
  disabled: !o.canRedo,
322
320
  title: "Redo",
323
- children: /* @__PURE__ */ S(t, {
324
- icon: O,
321
+ children: /* @__PURE__ */ y(t, {
322
+ icon: T,
325
323
  size: "sm"
326
324
  })
327
325
  })
328
326
  ]
329
327
  });
330
328
  }
331
- var X = x.lazy(() => import("@emoji-mart/react"));
332
- function Z({ set: e = "native", onSelect: t }) {
333
- let [n, r] = x.useState(null), { colorMode: i } = m();
334
- x.useEffect(() => {
335
- h(e).then((e) => r(e));
336
- }, [e]);
337
- let a = /* @__PURE__ */ S("div", {
338
- className: "flex h-[350px] w-[352px] items-center justify-center rounded-surface bg-surface-overlay shadow-raised-hover",
339
- children: /* @__PURE__ */ S("span", {
329
+ var J = v.lazy(() => import("./emoji-picker.js").then((e) => ({ default: e.EmojiPicker })));
330
+ function Y({ onSelect: e }) {
331
+ let t = /* @__PURE__ */ y("div", {
332
+ className: "flex h-[435px] w-[352px] items-center justify-center rounded-surface bg-surface-overlay shadow-raised-hover",
333
+ children: /* @__PURE__ */ y("span", {
340
334
  className: "text-ds-sm text-surface-fg-subtle",
341
- children: "Loading..."
335
+ children: "Loading"
342
336
  })
343
337
  });
344
- return n ? /* @__PURE__ */ S(x.Suspense, {
345
- fallback: a,
346
- children: /* @__PURE__ */ S(X, {
347
- data: n,
348
- set: e,
349
- onEmojiSelect: (e) => t({
350
- id: e.id,
351
- native: e.native
352
- }),
353
- theme: i === "dark" ? "dark" : "light",
354
- previewPosition: "none",
355
- skinTonePosition: "none"
356
- })
357
- }) : a;
338
+ return /* @__PURE__ */ y(v.Suspense, {
339
+ fallback: t,
340
+ children: /* @__PURE__ */ y(J, { onSelect: e })
341
+ });
358
342
  }
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) => {
361
- let t = N.current;
362
- if (t) if (T) {
363
- let n = await T(e);
343
+ var X = v.forwardRef(function({ content: t = "", placeholder: n = "Start writing...", onChange: r, className: l, editable: x = !0, toolbar: S, onImageUpload: C, onFileUpload: w, mentions: T, onMentionSearch: E, onMentionSelect: D, emojiSet: O = "native", ...k }, A) {
344
+ let j = v.useRef(null), M = v.useRef(!1), [N, P] = v.useState(!1), F = v.useRef(null), I = v.useRef(null), L = v.useRef(null), R = async (e) => {
345
+ let t = j.current;
346
+ if (t) if (C) {
347
+ let n = await C(e);
364
348
  n && /^https?:\/\//i.test(n) && t.chain().focus().setImage({ src: n }).run();
365
349
  } else {
366
350
  let n = new FileReader();
@@ -368,10 +352,10 @@ var Q = x.forwardRef(function({ content: t = "", placeholder: n = "Start writing
368
352
  t.chain().focus().setImage({ src: n.result }).run();
369
353
  }, n.readAsDataURL(e);
370
354
  }
371
- }, V = async (e) => {
372
- let t = N.current;
373
- if (!t || !E) return;
374
- let n = await E(e);
355
+ }, z = async (e) => {
356
+ let t = j.current;
357
+ if (!t || !w) return;
358
+ let n = await w(e);
375
359
  t.chain().focus().insertContent({
376
360
  type: "fileAttachment",
377
361
  attrs: {
@@ -380,7 +364,7 @@ var Q = x.forwardRef(function({ content: t = "", placeholder: n = "Start writing
380
364
  size: n.size
381
365
  }
382
366
  }).run();
383
- }, H = a({
367
+ }, B = a({
384
368
  immediatelyRender: !1,
385
369
  extensions: [
386
370
  d.configure({
@@ -417,111 +401,104 @@ var Q = x.forwardRef(function({ content: t = "", placeholder: n = "Start writing
417
401
  allowBase64: !0,
418
402
  HTMLAttributes: { class: "max-w-full rounded-control" }
419
403
  }),
420
- y,
421
- ...D || O ? [s.configure({
404
+ g,
405
+ ...T || E ? [s.configure({
422
406
  HTMLAttributes: { class: "mention" },
423
407
  suggestion: {
424
- items: async ({ query: e }) => O ? await O(e) : D ? D.filter((t) => t.label.toLowerCase().includes(e.toLowerCase())).slice(0, 8) : [],
425
- render: b(k)
408
+ items: async ({ query: e }) => E ? await E(e) : T ? T.filter((t) => t.label.toLowerCase().includes(e.toLowerCase())).slice(0, 8) : [],
409
+ render: _(D)
426
410
  }
427
411
  })] : [],
428
- _,
429
- v(A)
412
+ m,
413
+ h()
430
414
  ],
431
415
  content: t,
432
- editable: m,
416
+ editable: x,
433
417
  editorProps: {
434
418
  handleDrop: (e, t, n, r) => {
435
419
  if (r || !t.dataTransfer?.files.length) return !1;
436
420
  let i = t.dataTransfer.files[0];
437
- return i ? i.type.startsWith("image/") ? (B(i), !0) : E ? (V(i), !0) : !1 : !1;
421
+ return i ? i.type.startsWith("image/") ? (R(i), !0) : w ? (z(i), !0) : !1 : !1;
438
422
  },
439
423
  handlePaste: (e, t) => {
440
424
  let n = t.clipboardData?.files[0];
441
- return n ? n.type.startsWith("image/") ? (B(n), !0) : E ? (V(n), !0) : !1 : !1;
425
+ return n ? n.type.startsWith("image/") ? (R(n), !0) : w ? (z(n), !0) : !1 : !1;
442
426
  },
443
- attributes: { class: e(...G, "focus:outline-hidden", "min-h-[120px] px-ds-04 py-ds-04") }
427
+ attributes: { class: e(...U, "focus:outline-hidden", "min-h-[120px] px-ds-04 py-ds-04") }
444
428
  },
445
429
  onUpdate: ({ editor: e }) => {
446
- P.current = !0, r?.(e.getHTML()), queueMicrotask(() => {
447
- P.current = !1;
430
+ M.current = !0, r?.(e.getHTML()), queueMicrotask(() => {
431
+ M.current = !1;
448
432
  });
449
433
  }
450
434
  });
451
- return x.useEffect(() => {
452
- N.current = H;
453
- }, [H]), x.useEffect(() => {
454
- if (!F) return;
435
+ return v.useEffect(() => {
436
+ j.current = B;
437
+ }, [B]), v.useEffect(() => {
438
+ if (!N) return;
455
439
  let e = (e) => {
456
- L.current && !L.current.contains(e.target) && I(!1);
440
+ F.current && !F.current.contains(e.target) && P(!1);
457
441
  };
458
442
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
459
- }, [F]), x.useEffect(() => {
460
- P.current || H && t !== H.getHTML() && H.commands.setContent(t, { emitUpdate: !1 });
461
- }, [H, t]), H ? /* @__PURE__ */ C("div", {
462
- ref: M,
463
- ...j,
443
+ }, [N]), v.useEffect(() => {
444
+ M.current || B && t !== B.getHTML() && B.commands.setContent(t, { emitUpdate: !1 });
445
+ }, [B, t]), B ? /* @__PURE__ */ b("div", {
446
+ ref: A,
447
+ ...k,
464
448
  className: e("relative", l),
465
- children: [F && /* @__PURE__ */ S("div", {
466
- ref: L,
449
+ children: [N && /* @__PURE__ */ y("div", {
450
+ ref: F,
467
451
  className: "absolute bottom-full right-0 z-popover mb-ds-02",
468
452
  onKeyDown: (e) => {
469
- e.key === "Escape" && (e.stopPropagation(), I(!1));
453
+ e.key === "Escape" && (e.stopPropagation(), P(!1));
470
454
  },
471
- children: /* @__PURE__ */ S(Z, {
472
- set: A,
473
- onSelect: async ({ id: e, native: t }) => {
474
- let n = g(await h(A), e);
475
- n ? H.chain().focus().insertContent({
476
- type: "emojiNode",
477
- attrs: {
478
- id: e,
479
- native: n.native,
480
- set: A,
481
- x: n.x,
482
- y: n.y
483
- }
484
- }).run() : H.chain().focus().insertContent(t).run(), I(!1);
485
- }
486
- })
487
- }), /* @__PURE__ */ C("div", {
455
+ children: /* @__PURE__ */ y(Y, { onSelect: ({ id: e, native: t }) => {
456
+ B.chain().focus().insertContent({
457
+ type: "emojiNode",
458
+ attrs: {
459
+ id: e,
460
+ native: t
461
+ }
462
+ }).run(), P(!1);
463
+ } })
464
+ }), /* @__PURE__ */ b("div", {
488
465
  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"),
489
466
  children: [
490
- /* @__PURE__ */ S("input", {
491
- ref: R,
467
+ /* @__PURE__ */ y("input", {
468
+ ref: I,
492
469
  type: "file",
493
470
  accept: "image/*",
494
471
  "aria-label": "Upload image",
495
472
  className: "hidden",
496
473
  onChange: (e) => {
497
474
  let t = e.target.files?.[0];
498
- t && B(t), e.target.value = "";
475
+ t && R(t), e.target.value = "";
499
476
  }
500
477
  }),
501
- E && /* @__PURE__ */ S("input", {
502
- ref: z,
478
+ w && /* @__PURE__ */ y("input", {
479
+ ref: L,
503
480
  type: "file",
504
481
  "aria-label": "Upload file",
505
482
  className: "hidden",
506
483
  onChange: (e) => {
507
484
  let t = e.target.files?.[0];
508
- t && V(t), e.target.value = "";
485
+ t && z(t), e.target.value = "";
509
486
  }
510
487
  }),
511
- m && /* @__PURE__ */ S(Y, {
512
- editor: H,
513
- toolbar: w,
514
- onImageClick: () => R.current?.click(),
515
- onFileClick: E ? () => z.current?.click() : void 0,
516
- onEmojiClick: () => I((e) => !e)
488
+ x && /* @__PURE__ */ y(q, {
489
+ editor: B,
490
+ toolbar: S,
491
+ onImageClick: () => I.current?.click(),
492
+ onFileClick: w ? () => L.current?.click() : void 0,
493
+ onEmojiClick: () => P((e) => !e)
517
494
  }),
518
- /* @__PURE__ */ S(i, { editor: H })
495
+ /* @__PURE__ */ y(i, { editor: B })
519
496
  ]
520
497
  })]
521
498
  }) : null;
522
499
  });
523
- Q.displayName = "RichTextEditor";
524
- var $ = x.forwardRef(function({ content: t, className: n, ...r }, o) {
500
+ X.displayName = "RichTextEditor";
501
+ var Z = v.forwardRef(function({ content: t, className: n, ...r }, o) {
525
502
  let l = a({
526
503
  immediatelyRender: !1,
527
504
  extensions: [
@@ -555,20 +532,20 @@ var $ = x.forwardRef(function({ content: t, className: n, ...r }, o) {
555
532
  allowBase64: !0,
556
533
  HTMLAttributes: { class: "max-w-full rounded-control" }
557
534
  }),
558
- y,
535
+ g,
559
536
  s.configure({ HTMLAttributes: { class: "mention" } })
560
537
  ],
561
538
  content: t,
562
539
  editable: !1,
563
- editorProps: { attributes: { class: e(...G) } }
540
+ editorProps: { attributes: { class: e(...U) } }
564
541
  });
565
- return l ? /* @__PURE__ */ S("div", {
542
+ return l ? /* @__PURE__ */ y("div", {
566
543
  ref: o,
567
544
  ...r,
568
545
  className: n,
569
- children: /* @__PURE__ */ S(i, { editor: l })
546
+ children: /* @__PURE__ */ y(i, { editor: l })
570
547
  }) : null;
571
548
  });
572
- $.displayName = "RichTextViewer";
549
+ Z.displayName = "RichTextViewer";
573
550
  //#endregion
574
- export { Q as RichTextEditor, $ as RichTextViewer };
551
+ export { X as RichTextEditor, Z as RichTextViewer };