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