@devalok/shilp-sutra 0.8.4 → 0.9.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.
Files changed (218) hide show
  1. package/dist/_chunks/avatar.js +50 -0
  2. package/dist/_chunks/button.js +95 -0
  3. package/dist/_chunks/card.js +40 -0
  4. package/dist/_chunks/checkbox.js +14 -0
  5. package/dist/_chunks/form.js +27 -0
  6. package/dist/_chunks/primitives.js +6965 -0
  7. package/dist/_chunks/sidebar.js +592 -0
  8. package/dist/_chunks/spinner.js +34 -0
  9. package/dist/_chunks/tiptap.js +15254 -0
  10. package/dist/_chunks/tooltip.js +13 -0
  11. package/dist/_chunks/tree-view.js +304 -0
  12. package/dist/_chunks/use-calendar.js +990 -0
  13. package/dist/_chunks/utils.js +15 -0
  14. package/dist/_chunks/vendor-client.js +1835 -0
  15. package/dist/_chunks/vendor-utils.js +3995 -0
  16. package/dist/composed/avatar-group.js +20 -20
  17. package/dist/composed/command-palette.js +1 -1
  18. package/dist/composed/confirm-dialog.js +5 -5
  19. package/dist/composed/content-card.d.ts +1 -1
  20. package/dist/composed/content-card.js +2 -2
  21. package/dist/composed/date-picker/index.js +13 -0
  22. package/dist/composed/empty-state.js +10 -10
  23. package/dist/composed/error-boundary.js +2 -2
  24. package/dist/composed/global-loading.js +4 -4
  25. package/dist/composed/index.js +45 -53
  26. package/dist/composed/loading-skeleton.js +2 -2
  27. package/dist/composed/member-picker.js +5 -5
  28. package/dist/composed/page-header.js +4 -4
  29. package/dist/composed/page-skeletons.js +1 -1
  30. package/dist/composed/priority-indicator.js +6 -6
  31. package/dist/composed/rich-text-editor.js +422 -209
  32. package/dist/composed/schedule-view.js +1 -1
  33. package/dist/composed/simple-tooltip.js +6 -6
  34. package/dist/composed/status-badge.d.ts +1 -1
  35. package/dist/composed/status-badge.js +2 -2
  36. package/dist/shell/bottom-navbar.js +1 -1
  37. package/dist/shell/notification-center.js +2 -2
  38. package/dist/shell/notification-preferences.js +32 -33
  39. package/dist/shell/sidebar.js +24 -24
  40. package/dist/shell/top-bar.js +22 -22
  41. package/dist/ui/accordion.js +17 -17
  42. package/dist/ui/alert-dialog.js +29 -29
  43. package/dist/ui/alert.d.ts +2 -2
  44. package/dist/ui/alert.js +65 -44
  45. package/dist/ui/aspect-ratio.js +1 -1
  46. package/dist/ui/autocomplete.js +11 -11
  47. package/dist/ui/avatar.d.ts +1 -1
  48. package/dist/ui/avatar.js +67 -25
  49. package/dist/ui/badge.d.ts +2 -2
  50. package/dist/ui/badge.js +115 -91
  51. package/dist/ui/banner.d.ts +1 -1
  52. package/dist/ui/banner.js +2 -2
  53. package/dist/ui/breadcrumb.js +14 -14
  54. package/dist/ui/button-group.js +30 -15
  55. package/dist/ui/button.d.ts +2 -2
  56. package/dist/ui/button.js +114 -71
  57. package/dist/ui/card.js +66 -22
  58. package/dist/ui/charts/index.js +1221 -18
  59. package/dist/ui/checkbox.js +25 -5
  60. package/dist/ui/chip.d.ts +4 -4
  61. package/dist/ui/chip.js +2 -2
  62. package/dist/ui/code.js +1 -1
  63. package/dist/ui/collapsible.js +5 -5
  64. package/dist/ui/color-input.js +11 -11
  65. package/dist/ui/combobox.js +12 -12
  66. package/dist/ui/container.js +4 -4
  67. package/dist/ui/context-menu.js +37 -37
  68. package/dist/ui/data-table-toolbar.js +18 -18
  69. package/dist/ui/data-table.js +2 -2
  70. package/dist/ui/dialog.js +33 -33
  71. package/dist/ui/dropdown-menu.js +60 -60
  72. package/dist/ui/file-upload.js +1 -1
  73. package/dist/ui/form.js +36 -15
  74. package/dist/ui/hover-card.js +7 -7
  75. package/dist/ui/icon-button.js +9 -9
  76. package/dist/ui/index.js +523 -325
  77. package/dist/ui/input-otp.d.ts +2 -2
  78. package/dist/ui/input-otp.js +14 -14
  79. package/dist/ui/input.js +56 -28
  80. package/dist/ui/label.js +18 -4
  81. package/dist/ui/lib/utils.js +4 -5
  82. package/dist/ui/link.js +9 -9
  83. package/dist/ui/menubar.js +81 -81
  84. package/dist/ui/navigation-menu.js +42 -42
  85. package/dist/ui/number-input.js +13 -13
  86. package/dist/ui/pagination.js +5 -5
  87. package/dist/ui/popover.js +9 -9
  88. package/dist/ui/progress.d.ts +1 -1
  89. package/dist/ui/progress.js +15 -15
  90. package/dist/ui/radio.js +10 -10
  91. package/dist/ui/search-input.js +5 -5
  92. package/dist/ui/segmented-control.js +91 -83
  93. package/dist/ui/select.js +52 -52
  94. package/dist/ui/separator.js +20 -5
  95. package/dist/ui/sheet.js +28 -28
  96. package/dist/ui/sidebar.js +36 -560
  97. package/dist/ui/skeleton.d.ts +1 -1
  98. package/dist/ui/skeleton.js +7 -7
  99. package/dist/ui/slider.js +11 -11
  100. package/dist/ui/spinner.js +37 -2
  101. package/dist/ui/stack.js +1 -1
  102. package/dist/ui/stat-card.js +1 -1
  103. package/dist/ui/stepper.js +15 -15
  104. package/dist/ui/switch.js +22 -3
  105. package/dist/ui/table.js +1 -1
  106. package/dist/ui/tabs.js +59 -32
  107. package/dist/ui/text.js +2 -2
  108. package/dist/ui/textarea.js +7 -7
  109. package/dist/ui/toast.d.ts +1 -1
  110. package/dist/ui/toast.js +28 -28
  111. package/dist/ui/toggle-group.js +11 -11
  112. package/dist/ui/toggle.js +7 -7
  113. package/dist/ui/tooltip.js +17 -6
  114. package/dist/ui/transitions.js +68 -58
  115. package/dist/ui/tree-view/index.js +7 -0
  116. package/dist/ui/visually-hidden.js +3 -3
  117. package/llms-full.txt +1 -1
  118. package/llms.txt +7 -0
  119. package/package.json +656 -706
  120. package/dist/_virtual/client.js +0 -5
  121. package/dist/_virtual/index.js +0 -5
  122. package/dist/_virtual/react-dom-client.development.js +0 -5
  123. package/dist/_virtual/react-dom-client.production.js +0 -5
  124. package/dist/_virtual/scheduler.development.js +0 -5
  125. package/dist/_virtual/scheduler.production.js +0 -5
  126. package/dist/composed/date-picker/calendar-grid.js +0 -194
  127. package/dist/composed/date-picker/date-picker.js +0 -124
  128. package/dist/composed/date-picker/date-range-picker.js +0 -167
  129. package/dist/composed/date-picker/date-time-picker.js +0 -193
  130. package/dist/composed/date-picker/month-picker.js +0 -53
  131. package/dist/composed/date-picker/presets.js +0 -84
  132. package/dist/composed/date-picker/time-picker.js +0 -181
  133. package/dist/composed/date-picker/use-calendar.js +0 -17
  134. package/dist/composed/date-picker/year-picker.js +0 -45
  135. package/dist/composed/extensions/emoji-suggestion.js +0 -119
  136. package/dist/composed/extensions/file-attachment.js +0 -55
  137. package/dist/composed/extensions/mention-suggestion.js +0 -79
  138. package/dist/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js +0 -40141
  139. package/dist/node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js +0 -17
  140. package/dist/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js +0 -2958
  141. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +0 -17062
  142. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +0 -9790
  143. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +0 -20
  144. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +0 -237
  145. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +0 -234
  146. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +0 -11
  147. package/dist/primitives/_internal/number.js +0 -6
  148. package/dist/primitives/_internal/primitive.js +0 -9
  149. package/dist/primitives/_internal/react-arrow.js +0 -13
  150. package/dist/primitives/_internal/react-collection.js +0 -48
  151. package/dist/primitives/_internal/react-compose-refs.js +0 -29
  152. package/dist/primitives/_internal/react-context.js +0 -76
  153. package/dist/primitives/_internal/react-direction.js +0 -10
  154. package/dist/primitives/_internal/react-dismissable-layer.js +0 -103
  155. package/dist/primitives/_internal/react-focus-guards.js +0 -17
  156. package/dist/primitives/_internal/react-focus-scope.js +0 -137
  157. package/dist/primitives/_internal/react-id.js +0 -14
  158. package/dist/primitives/_internal/react-popper.js +0 -137
  159. package/dist/primitives/_internal/react-portal.js +0 -16
  160. package/dist/primitives/_internal/react-presence.js +0 -71
  161. package/dist/primitives/_internal/react-primitive.js +0 -36
  162. package/dist/primitives/_internal/react-use-callback-ref.js +0 -13
  163. package/dist/primitives/_internal/react-use-controllable-state.js +0 -44
  164. package/dist/primitives/_internal/react-use-escape-keydown.js +0 -14
  165. package/dist/primitives/_internal/react-use-is-hydrated.js +0 -15
  166. package/dist/primitives/_internal/react-use-layout-effect.js +0 -6
  167. package/dist/primitives/_internal/react-use-previous.js +0 -8
  168. package/dist/primitives/_internal/react-use-size.js +0 -27
  169. package/dist/primitives/react-accordion.js +0 -239
  170. package/dist/primitives/react-alert-dialog.js +0 -127
  171. package/dist/primitives/react-aspect-ratio.js +0 -43
  172. package/dist/primitives/react-avatar.js +0 -75
  173. package/dist/primitives/react-checkbox.js +0 -251
  174. package/dist/primitives/react-collapsible.js +0 -120
  175. package/dist/primitives/react-context-menu.js +0 -240
  176. package/dist/primitives/react-dialog.js +0 -262
  177. package/dist/primitives/react-dropdown-menu.js +0 -227
  178. package/dist/primitives/react-hover-card.js +0 -187
  179. package/dist/primitives/react-label.js +0 -20
  180. package/dist/primitives/react-menu.js +0 -652
  181. package/dist/primitives/react-menubar.js +0 -355
  182. package/dist/primitives/react-navigation-menu.js +0 -607
  183. package/dist/primitives/react-popover.js +0 -243
  184. package/dist/primitives/react-progress.js +0 -84
  185. package/dist/primitives/react-radio-group.js +0 -238
  186. package/dist/primitives/react-roving-focus.js +0 -183
  187. package/dist/primitives/react-select.js +0 -862
  188. package/dist/primitives/react-separator.js +0 -24
  189. package/dist/primitives/react-slider.js +0 -437
  190. package/dist/primitives/react-slot.js +0 -70
  191. package/dist/primitives/react-switch.js +0 -132
  192. package/dist/primitives/react-tabs.js +0 -163
  193. package/dist/primitives/react-toast.js +0 -446
  194. package/dist/primitives/react-toggle-group.js +0 -137
  195. package/dist/primitives/react-toggle.js +0 -33
  196. package/dist/primitives/react-tooltip.js +0 -338
  197. package/dist/primitives/react-visually-hidden.js +0 -32
  198. package/dist/ui/charts/_internal/animation.js +0 -18
  199. package/dist/ui/charts/_internal/axes.js +0 -42
  200. package/dist/ui/charts/_internal/colors.js +0 -21
  201. package/dist/ui/charts/_internal/grid-lines.js +0 -43
  202. package/dist/ui/charts/_internal/legend.js +0 -29
  203. package/dist/ui/charts/_internal/tooltip.js +0 -39
  204. package/dist/ui/charts/_internal/types.js +0 -10
  205. package/dist/ui/charts/area-chart.js +0 -245
  206. package/dist/ui/charts/bar-chart.js +0 -153
  207. package/dist/ui/charts/chart-container.js +0 -27
  208. package/dist/ui/charts/gauge-chart.js +0 -72
  209. package/dist/ui/charts/line-chart.js +0 -163
  210. package/dist/ui/charts/pie-chart.js +0 -132
  211. package/dist/ui/charts/radar-chart.js +0 -223
  212. package/dist/ui/charts/sparkline.js +0 -124
  213. package/dist/ui/lib/motion.js +0 -32
  214. package/dist/ui/lib/use-reduced-motion.js +0 -15
  215. package/dist/ui/lib/use-ripple.js +0 -14
  216. package/dist/ui/tree-view/tree-item.js +0 -139
  217. package/dist/ui/tree-view/tree-view.js +0 -140
  218. package/dist/ui/tree-view/use-tree.js +0 -38
@@ -1,24 +1,237 @@
1
1
  "use client";
2
- import { jsxs as b, jsx as e } from "react/jsx-runtime";
2
+ import { jsx as t, jsxs as g } from "react/jsx-runtime";
3
3
  import * as c from "react";
4
- import { useEditor as S, EditorContent as H } from "@tiptap/react";
5
- import B from "@tiptap/starter-kit";
6
- import G from "@tiptap/extension-placeholder";
7
- import P from "@tiptap/extension-underline";
8
- import M from "@tiptap/extension-highlight";
9
- import j from "@tiptap/extension-task-list";
10
- import D from "@tiptap/extension-task-item";
11
- import z from "@tiptap/extension-text-align";
12
- import q from "@tiptap/extension-link";
13
- import U from "@tiptap/extension-image";
14
- import O from "@tiptap/extension-mention";
15
- import { FileAttachment as K } from "./extensions/file-attachment.js";
16
- import { createSuggestionRenderer as J } from "./extensions/mention-suggestion.js";
17
- import { EmojiSuggestion as Q } from "./extensions/emoji-suggestion.js";
18
- import { useColorMode as X } from "../hooks/use-color-mode.js";
19
- import { cn as k } from "../ui/lib/utils.js";
20
- import { IconBold as Y, IconItalic as Z, IconUnderline as $, IconStrikethrough as F, IconHighlight as ee, IconH2 as te, IconH3 as ie, IconBlockquote as se, IconList as re, IconListNumbers as oe, IconListCheck as ne, IconCode as ce, IconPhoto as le, IconPaperclip as ae, IconLineDashed as de, IconAlignLeft as ue, IconAlignCenter as me, IconAlignRight as fe, IconMoodSmile as he, IconArrowBackUp as ge, IconArrowForwardUp as pe, IconLink as ke } from "@tabler/icons-react";
21
- const V = [
4
+ import { N as Q, R as X, m as Y, a as Z, E as ee, S as te, u as M, U as D, T as B, b as P, P as ne, H as z, c as U, d as K, L as $, I as O, M as V, e as q } from "../_chunks/tiptap.js";
5
+ import { IconFile as ie, IconDownload as re, IconBold as se, IconItalic as le, IconUnderline as oe, IconStrikethrough as ae, IconHighlight as ce, IconH2 as de, IconH3 as ue, IconBlockquote as me, IconList as fe, IconListNumbers as he, IconListCheck as ge, IconCode as be, IconPhoto as pe, IconPaperclip as xe, IconLineDashed as ke, IconAlignLeft as ve, IconAlignCenter as we, IconAlignRight as ye, IconMoodSmile as Ae, IconArrowBackUp as _e, IconArrowForwardUp as Ne, IconLink as Ie } from "@tabler/icons-react";
6
+ import { createRoot as F } from "react-dom/client";
7
+ import { c as p } from "../_chunks/utils.js";
8
+ import { useColorMode as Le } from "../hooks/use-color-mode.js";
9
+ function Ce(e) {
10
+ return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
11
+ }
12
+ function Ee({ node: e }) {
13
+ const n = /^https?:\/\//.test(e.attrs.url) ? e.attrs.url : "#";
14
+ return /* @__PURE__ */ t(Z, { className: "my-ds-02", children: /* @__PURE__ */ g(
15
+ "a",
16
+ {
17
+ href: n,
18
+ target: "_blank",
19
+ rel: "noopener noreferrer",
20
+ className: "inline-flex items-center gap-ds-03 rounded-ds-md border border-border bg-layer-02 px-ds-04 py-ds-03 text-ds-sm text-text-primary transition-colors hover:border-border-strong hover:bg-layer-03",
21
+ contentEditable: !1,
22
+ children: [
23
+ /* @__PURE__ */ t(ie, { className: "h-ico-sm w-ico-sm shrink-0 text-text-placeholder" }),
24
+ /* @__PURE__ */ t("span", { className: "truncate", children: e.attrs.name }),
25
+ /* @__PURE__ */ g("span", { className: "shrink-0 text-text-placeholder", children: [
26
+ "(",
27
+ Ce(e.attrs.size),
28
+ ")"
29
+ ] }),
30
+ /* @__PURE__ */ t(re, { className: "h-ico-sm w-ico-sm shrink-0 text-text-placeholder" })
31
+ ]
32
+ }
33
+ ) });
34
+ }
35
+ const W = Q.create({
36
+ name: "fileAttachment",
37
+ group: "block",
38
+ atom: !0,
39
+ addAttributes() {
40
+ return {
41
+ url: { default: null },
42
+ name: { default: "Untitled" },
43
+ size: { default: 0 }
44
+ };
45
+ },
46
+ parseHTML() {
47
+ return [{ tag: "div[data-file-attachment]" }];
48
+ },
49
+ renderHTML({ HTMLAttributes: e }) {
50
+ return ["div", Y({ "data-file-attachment": "" }, e)];
51
+ },
52
+ addNodeView() {
53
+ return X(Ee);
54
+ }
55
+ }), R = c.forwardRef(
56
+ ({ items: e, command: n }, s) => {
57
+ const [i, l] = c.useState(0);
58
+ return c.useEffect(() => l(0), [e]), c.useImperativeHandle(s, () => ({
59
+ onKeyDown: ({ event: r }) => r.key === "ArrowUp" ? (l((o) => (o + e.length - 1) % e.length), !0) : r.key === "ArrowDown" ? (l((o) => (o + 1) % e.length), !0) : r.key === "Enter" ? (e[i] && n(e[i]), !0) : !1
60
+ })), e.length ? /* @__PURE__ */ t("div", { role: "listbox", "aria-label": "Mention suggestions", className: "z-popover overflow-hidden rounded-ds-md border border-border bg-layer-01 shadow-02", children: e.map((r, o) => /* @__PURE__ */ g(
61
+ "button",
62
+ {
63
+ type: "button",
64
+ role: "option",
65
+ "aria-selected": o === i,
66
+ onClick: () => n(r),
67
+ className: p(
68
+ "flex w-full items-center gap-ds-03 px-ds-04 py-ds-02b text-left text-ds-sm",
69
+ o === i ? "bg-layer-02 text-text-primary" : "text-text-secondary hover:bg-layer-02"
70
+ ),
71
+ children: [
72
+ r.avatar ? /* @__PURE__ */ t("img", { src: r.avatar, alt: "", className: "h-ico-md w-ico-md rounded-ds-full object-cover" }) : /* @__PURE__ */ t("span", { className: "flex h-ico-md w-ico-md items-center justify-center rounded-ds-full bg-interactive/10 text-[10px] font-semibold text-interactive", children: r.label.charAt(0).toUpperCase() }),
73
+ /* @__PURE__ */ t("span", { children: r.label })
74
+ ]
75
+ },
76
+ r.id
77
+ )) }) : null;
78
+ }
79
+ );
80
+ R.displayName = "MentionList";
81
+ function Re() {
82
+ return () => {
83
+ let e = null, n = null, s = null;
84
+ return {
85
+ onStart: (i) => {
86
+ var r;
87
+ n = document.createElement("div"), n.style.position = "absolute", n.style.zIndex = "1400";
88
+ const l = (r = i.clientRect) == null ? void 0 : r.call(i);
89
+ l && (n.style.left = `${l.left}px`, n.style.top = `${l.bottom + 4}px`), document.body.appendChild(n), e = F(n), e.render(
90
+ /* @__PURE__ */ t(
91
+ R,
92
+ {
93
+ ref: (o) => {
94
+ s = o;
95
+ },
96
+ items: i.items,
97
+ command: (o) => i.command({ id: o.id, label: o.label })
98
+ }
99
+ )
100
+ );
101
+ },
102
+ onUpdate: (i) => {
103
+ var r;
104
+ if (!e || !n) return;
105
+ const l = (r = i.clientRect) == null ? void 0 : r.call(i);
106
+ l && (n.style.left = `${l.left}px`, n.style.top = `${l.bottom + 4}px`), e.render(
107
+ /* @__PURE__ */ t(
108
+ R,
109
+ {
110
+ ref: (o) => {
111
+ s = o;
112
+ },
113
+ items: i.items,
114
+ command: (o) => i.command({ id: o.id, label: o.label })
115
+ }
116
+ )
117
+ );
118
+ },
119
+ onKeyDown: (i) => i.event.key === "Escape" ? (n && (e == null || e.unmount(), n.remove(), n = null, e = null), !0) : (s == null ? void 0 : s.onKeyDown(i)) ?? !1,
120
+ onExit: () => {
121
+ n && (e == null || e.unmount(), n.remove(), n = null, e = null);
122
+ }
123
+ };
124
+ };
125
+ }
126
+ let A = null;
127
+ async function Se() {
128
+ if (A) return A;
129
+ const e = await import("@emoji-mart/data"), n = e.default ?? e;
130
+ return A = Object.values(n.emojis).map((s) => {
131
+ var i;
132
+ return {
133
+ id: s.id,
134
+ name: s.name,
135
+ native: ((i = s.skins[0]) == null ? void 0 : i.native) ?? ""
136
+ };
137
+ }), A;
138
+ }
139
+ const S = c.forwardRef(
140
+ ({ items: e, command: n }, s) => {
141
+ const [i, l] = c.useState(0);
142
+ return c.useEffect(() => l(0), [e]), c.useImperativeHandle(s, () => ({
143
+ onKeyDown: ({ event: r }) => r.key === "ArrowUp" ? (l((o) => (o + e.length - 1) % e.length), !0) : r.key === "ArrowDown" ? (l((o) => (o + 1) % e.length), !0) : r.key === "Enter" ? (e[i] && n(e[i]), !0) : !1
144
+ })), e.length ? /* @__PURE__ */ t("div", { role: "listbox", "aria-label": "Emoji suggestions", className: "z-popover max-h-[200px] overflow-x-hidden overflow-y-auto rounded-ds-md border border-border bg-layer-01 shadow-02", children: e.map((r, o) => /* @__PURE__ */ g(
145
+ "button",
146
+ {
147
+ type: "button",
148
+ role: "option",
149
+ "aria-selected": o === i,
150
+ onClick: () => n(r),
151
+ className: p(
152
+ "flex w-full items-center gap-ds-03 px-ds-04 py-ds-02b text-left text-ds-sm",
153
+ o === i ? "bg-layer-02 text-text-primary" : "text-text-secondary hover:bg-layer-02"
154
+ ),
155
+ children: [
156
+ /* @__PURE__ */ t("span", { className: "text-ds-base", children: r.native }),
157
+ /* @__PURE__ */ g("span", { className: "truncate", children: [
158
+ ":",
159
+ r.id,
160
+ ":"
161
+ ] })
162
+ ]
163
+ },
164
+ r.id
165
+ )) }) : null;
166
+ }
167
+ );
168
+ S.displayName = "EmojiList";
169
+ function Te() {
170
+ return () => {
171
+ let e = null, n = null, s = null;
172
+ return {
173
+ onStart: (i) => {
174
+ var r;
175
+ n = document.createElement("div"), n.style.position = "absolute", n.style.zIndex = "1400";
176
+ const l = (r = i.clientRect) == null ? void 0 : r.call(i);
177
+ l && (n.style.left = `${l.left}px`, n.style.top = `${l.bottom + 4}px`), document.body.appendChild(n), e = F(n), e.render(
178
+ /* @__PURE__ */ t(
179
+ S,
180
+ {
181
+ ref: (o) => {
182
+ s = o;
183
+ },
184
+ items: i.items,
185
+ command: (o) => i.command(o)
186
+ }
187
+ )
188
+ );
189
+ },
190
+ onUpdate: (i) => {
191
+ var r;
192
+ if (!e || !n) return;
193
+ const l = (r = i.clientRect) == null ? void 0 : r.call(i);
194
+ l && (n.style.left = `${l.left}px`, n.style.top = `${l.bottom + 4}px`), e.render(
195
+ /* @__PURE__ */ t(
196
+ S,
197
+ {
198
+ ref: (o) => {
199
+ s = o;
200
+ },
201
+ items: i.items,
202
+ command: (o) => i.command(o)
203
+ }
204
+ )
205
+ );
206
+ },
207
+ onKeyDown: (i) => i.event.key === "Escape" ? (n && (e == null || e.unmount(), n.remove(), n = null, e = null), !0) : (s == null ? void 0 : s.onKeyDown(i)) ?? !1,
208
+ onExit: () => {
209
+ n && (e == null || e.unmount(), n.remove(), n = null, e = null);
210
+ }
211
+ };
212
+ };
213
+ }
214
+ const He = ee.create({
215
+ name: "emojiSuggestion",
216
+ addProseMirrorPlugins() {
217
+ return [
218
+ te({
219
+ editor: this.editor,
220
+ char: ":",
221
+ items: async ({ query: e }) => {
222
+ const n = await Se();
223
+ return e ? n.filter(
224
+ (s) => s.id.includes(e.toLowerCase()) || s.name.toLowerCase().includes(e.toLowerCase())
225
+ ).slice(0, 8) : n.slice(0, 8);
226
+ },
227
+ command: ({ editor: e, range: n, props: s }) => {
228
+ e.chain().focus().deleteRange(n).insertContent(s.native).run();
229
+ },
230
+ render: Te()
231
+ })
232
+ ];
233
+ }
234
+ }), G = [
22
235
  "prose prose-sm max-w-none",
23
236
  "font-body text-ds-md leading-relaxed text-text-primary",
24
237
  "[&_h2]:text-ds-xl [&_h2]:mb-ds-03 [&_h2]:mt-ds-05 [&_h2]:text-text-primary",
@@ -37,264 +250,264 @@ const V = [
37
250
  "[&_img]:max-w-full [&_img]:rounded-ds-md [&_img]:my-ds-03",
38
251
  "[&_.mention]:rounded-ds-sm [&_.mention]:bg-interactive/10 [&_.mention]:px-ds-02 [&_.mention]:py-[1px] [&_.mention]:font-medium [&_.mention]:text-interactive"
39
252
  ];
40
- function r({
41
- onClick: t,
253
+ function u({
254
+ onClick: e,
42
255
  isActive: n = !1,
43
- disabled: a = !1,
44
- title: l,
45
- children: d
256
+ disabled: s = !1,
257
+ title: i,
258
+ children: l
46
259
  }) {
47
- return /* @__PURE__ */ e(
260
+ return /* @__PURE__ */ t(
48
261
  "button",
49
262
  {
50
263
  type: "button",
51
- onClick: t,
52
- disabled: a,
53
- title: l,
264
+ onClick: e,
265
+ disabled: s,
266
+ title: i,
54
267
  "aria-pressed": n,
55
- className: k(
268
+ className: p(
56
269
  "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors",
57
270
  "hover:bg-field",
58
271
  "disabled:pointer-events-none disabled:opacity-[0.38]",
59
272
  n ? "bg-field text-interactive" : "text-text-placeholder"
60
273
  ),
61
- children: d
274
+ children: l
62
275
  }
63
276
  );
64
277
  }
65
- function be({ editor: t }) {
66
- const [n, a] = c.useState(!1), [l, d] = c.useState(""), u = c.useRef(null), x = () => {
67
- if (t.isActive("link")) {
68
- t.chain().focus().unsetLink().run();
278
+ function je({ editor: e }) {
279
+ const [n, s] = c.useState(!1), [i, l] = c.useState(""), r = c.useRef(null), o = () => {
280
+ if (e.isActive("link")) {
281
+ e.chain().focus().unsetLink().run();
69
282
  return;
70
283
  }
71
- const m = t.getAttributes("link").href || "";
72
- d(m), a(!0), setTimeout(() => {
73
- var A;
74
- return (A = u.current) == null ? void 0 : A.focus();
284
+ const f = e.getAttributes("link").href || "";
285
+ l(f), s(!0), setTimeout(() => {
286
+ var _;
287
+ return (_ = r.current) == null ? void 0 : _.focus();
75
288
  }, 0);
76
- }, h = (m) => {
77
- m.preventDefault(), l.trim() && t.chain().focus().setLink({ href: l.trim() }).run(), a(!1), d("");
78
- }, g = (m) => {
79
- m.key === "Escape" && (a(!1), d(""), t.commands.focus());
289
+ }, b = (f) => {
290
+ f.preventDefault(), i.trim() && e.chain().focus().setLink({ href: i.trim() }).run(), s(!1), l("");
291
+ }, x = (f) => {
292
+ f.key === "Escape" && (s(!1), l(""), e.commands.focus());
80
293
  };
81
- return /* @__PURE__ */ b("div", { className: "relative", children: [
82
- /* @__PURE__ */ e(r, { onClick: x, isActive: t.isActive("link"), title: "Link", children: /* @__PURE__ */ e(ke, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
83
- n && /* @__PURE__ */ b(
294
+ return /* @__PURE__ */ g("div", { className: "relative", children: [
295
+ /* @__PURE__ */ t(u, { onClick: o, isActive: e.isActive("link"), title: "Link", children: /* @__PURE__ */ t(Ie, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
296
+ n && /* @__PURE__ */ g(
84
297
  "form",
85
298
  {
86
- onSubmit: h,
299
+ onSubmit: b,
87
300
  "aria-label": "Edit link URL",
88
301
  className: "absolute left-0 top-full z-popover mt-ds-01 flex items-center gap-ds-02 rounded-ds-md border border-border bg-layer-01 p-ds-02 shadow-02",
89
302
  children: [
90
- /* @__PURE__ */ e(
303
+ /* @__PURE__ */ t(
91
304
  "input",
92
305
  {
93
- ref: u,
306
+ ref: r,
94
307
  type: "url",
95
- value: l,
96
- onChange: (m) => d(m.target.value),
97
- onKeyDown: g,
308
+ value: i,
309
+ onChange: (f) => l(f.target.value),
310
+ onKeyDown: x,
98
311
  placeholder: "https://...",
99
312
  className: "h-ds-sm w-[240px] rounded-ds-sm border border-border bg-layer-01 px-ds-03 text-ds-sm text-text-primary focus:border-interactive focus:outline-none"
100
313
  }
101
314
  ),
102
- /* @__PURE__ */ e("button", { type: "submit", className: "h-ds-sm rounded-ds-sm bg-interactive px-ds-03 text-ds-sm text-text-on-color hover:bg-interactive/90", children: "Apply" })
315
+ /* @__PURE__ */ t("button", { type: "submit", className: "h-ds-sm rounded-ds-sm bg-interactive px-ds-03 text-ds-sm text-text-on-color hover:bg-interactive/90", children: "Apply" })
103
316
  ]
104
317
  }
105
318
  )
106
319
  ] });
107
320
  }
108
- function p() {
109
- return /* @__PURE__ */ e("div", { className: "mx-ds-02 h-[16px] w-px bg-border" });
321
+ function k() {
322
+ return /* @__PURE__ */ t("div", { className: "mx-ds-02 h-[16px] w-px bg-border" });
110
323
  }
111
- function xe({ editor: t, onImageClick: n, onFileClick: a, onEmojiClick: l }) {
112
- return /* @__PURE__ */ b("div", { className: "flex flex-wrap items-center gap-ds-01 border-b border-border px-ds-04 py-ds-02b", children: [
113
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleBold().run(), isActive: t.isActive("bold"), title: "Bold", children: /* @__PURE__ */ e(Y, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
114
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleItalic().run(), isActive: t.isActive("italic"), title: "Italic", children: /* @__PURE__ */ e(Z, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
115
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleUnderline().run(), isActive: t.isActive("underline"), title: "Underline", children: /* @__PURE__ */ e($, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
116
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleStrike().run(), isActive: t.isActive("strike"), title: "Strikethrough", children: /* @__PURE__ */ e(F, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
117
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleHighlight().run(), isActive: t.isActive("highlight"), title: "Highlight", children: /* @__PURE__ */ e(ee, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
118
- /* @__PURE__ */ e(p, {}),
119
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleHeading({ level: 2 }).run(), isActive: t.isActive("heading", { level: 2 }), title: "Heading 2", children: /* @__PURE__ */ e(te, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
120
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleHeading({ level: 3 }).run(), isActive: t.isActive("heading", { level: 3 }), title: "Heading 3", children: /* @__PURE__ */ e(ie, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
121
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleBlockquote().run(), isActive: t.isActive("blockquote"), title: "Blockquote", children: /* @__PURE__ */ e(se, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
122
- /* @__PURE__ */ e(p, {}),
123
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleBulletList().run(), isActive: t.isActive("bulletList"), title: "Bullet list", children: /* @__PURE__ */ e(re, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
124
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleOrderedList().run(), isActive: t.isActive("orderedList"), title: "Ordered list", children: /* @__PURE__ */ e(oe, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
125
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleTaskList().run(), isActive: t.isActive("taskList"), title: "Task list", children: /* @__PURE__ */ e(ne, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
126
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().toggleCodeBlock().run(), isActive: t.isActive("codeBlock"), title: "Code block", children: /* @__PURE__ */ e(ce, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
127
- /* @__PURE__ */ e(p, {}),
128
- /* @__PURE__ */ e(be, { editor: t }),
129
- n && /* @__PURE__ */ e(r, { onClick: n, title: "Insert image", children: /* @__PURE__ */ e(le, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
130
- a && /* @__PURE__ */ e(r, { onClick: a, title: "Attach file", children: /* @__PURE__ */ e(ae, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
131
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().setHorizontalRule().run(), title: "Horizontal rule", children: /* @__PURE__ */ e(de, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
132
- /* @__PURE__ */ e(p, {}),
133
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().setTextAlign("left").run(), isActive: t.isActive({ textAlign: "left" }), title: "Align left", children: /* @__PURE__ */ e(ue, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
134
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().setTextAlign("center").run(), isActive: t.isActive({ textAlign: "center" }), title: "Align center", children: /* @__PURE__ */ e(me, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
135
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().setTextAlign("right").run(), isActive: t.isActive({ textAlign: "right" }), title: "Align right", children: /* @__PURE__ */ e(fe, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
136
- /* @__PURE__ */ e(p, {}),
137
- l && /* @__PURE__ */ e(r, { onClick: l, title: "Emoji", children: /* @__PURE__ */ e(he, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
138
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().undo().run(), disabled: !t.can().undo(), title: "Undo", children: /* @__PURE__ */ e(ge, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
139
- /* @__PURE__ */ e(r, { onClick: () => t.chain().focus().redo().run(), disabled: !t.can().redo(), title: "Redo", children: /* @__PURE__ */ e(pe, { className: "h-ico-sm w-ico-sm", stroke: 2 }) })
324
+ function Me({ editor: e, onImageClick: n, onFileClick: s, onEmojiClick: i }) {
325
+ return /* @__PURE__ */ g("div", { className: "flex flex-wrap items-center gap-ds-01 border-b border-border px-ds-04 py-ds-02b", children: [
326
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleBold().run(), isActive: e.isActive("bold"), title: "Bold", children: /* @__PURE__ */ t(se, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
327
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleItalic().run(), isActive: e.isActive("italic"), title: "Italic", children: /* @__PURE__ */ t(le, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
328
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleUnderline().run(), isActive: e.isActive("underline"), title: "Underline", children: /* @__PURE__ */ t(oe, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
329
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleStrike().run(), isActive: e.isActive("strike"), title: "Strikethrough", children: /* @__PURE__ */ t(ae, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
330
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleHighlight().run(), isActive: e.isActive("highlight"), title: "Highlight", children: /* @__PURE__ */ t(ce, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
331
+ /* @__PURE__ */ t(k, {}),
332
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleHeading({ level: 2 }).run(), isActive: e.isActive("heading", { level: 2 }), title: "Heading 2", children: /* @__PURE__ */ t(de, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
333
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleHeading({ level: 3 }).run(), isActive: e.isActive("heading", { level: 3 }), title: "Heading 3", children: /* @__PURE__ */ t(ue, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
334
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleBlockquote().run(), isActive: e.isActive("blockquote"), title: "Blockquote", children: /* @__PURE__ */ t(me, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
335
+ /* @__PURE__ */ t(k, {}),
336
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleBulletList().run(), isActive: e.isActive("bulletList"), title: "Bullet list", children: /* @__PURE__ */ t(fe, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
337
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleOrderedList().run(), isActive: e.isActive("orderedList"), title: "Ordered list", children: /* @__PURE__ */ t(he, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
338
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleTaskList().run(), isActive: e.isActive("taskList"), title: "Task list", children: /* @__PURE__ */ t(ge, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
339
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().toggleCodeBlock().run(), isActive: e.isActive("codeBlock"), title: "Code block", children: /* @__PURE__ */ t(be, { className: "h-ico-sm w-ico-sm", stroke: 2.5 }) }),
340
+ /* @__PURE__ */ t(k, {}),
341
+ /* @__PURE__ */ t(je, { editor: e }),
342
+ n && /* @__PURE__ */ t(u, { onClick: n, title: "Insert image", children: /* @__PURE__ */ t(pe, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
343
+ s && /* @__PURE__ */ t(u, { onClick: s, title: "Attach file", children: /* @__PURE__ */ t(xe, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
344
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().setHorizontalRule().run(), title: "Horizontal rule", children: /* @__PURE__ */ t(ke, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
345
+ /* @__PURE__ */ t(k, {}),
346
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().setTextAlign("left").run(), isActive: e.isActive({ textAlign: "left" }), title: "Align left", children: /* @__PURE__ */ t(ve, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
347
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().setTextAlign("center").run(), isActive: e.isActive({ textAlign: "center" }), title: "Align center", children: /* @__PURE__ */ t(we, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
348
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().setTextAlign("right").run(), isActive: e.isActive({ textAlign: "right" }), title: "Align right", children: /* @__PURE__ */ t(ye, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
349
+ /* @__PURE__ */ t(k, {}),
350
+ i && /* @__PURE__ */ t(u, { onClick: i, title: "Emoji", children: /* @__PURE__ */ t(Ae, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
351
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().undo().run(), disabled: !e.can().undo(), title: "Undo", children: /* @__PURE__ */ t(_e, { className: "h-ico-sm w-ico-sm", stroke: 2 }) }),
352
+ /* @__PURE__ */ t(u, { onClick: () => e.chain().focus().redo().run(), disabled: !e.can().redo(), title: "Redo", children: /* @__PURE__ */ t(Ne, { className: "h-ico-sm w-ico-sm", stroke: 2 }) })
140
353
  ] });
141
354
  }
142
- const ve = c.lazy(() => import("../node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js"));
143
- function we({ onSelect: t }) {
144
- const [n, a] = c.useState(null), { colorMode: l } = X();
355
+ const De = c.lazy(() => import("@emoji-mart/react"));
356
+ function Be({ onSelect: e }) {
357
+ const [n, s] = c.useState(null), { colorMode: i } = Le();
145
358
  c.useEffect(() => {
146
- import("../node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js").then((u) => a(u.default));
359
+ import("@emoji-mart/data").then((r) => s(r.default));
147
360
  }, []);
148
- const d = /* @__PURE__ */ e("div", { className: "flex h-[350px] w-[352px] items-center justify-center rounded-ds-lg border border-border bg-layer-01 shadow-02", children: /* @__PURE__ */ e("span", { className: "text-ds-sm text-text-placeholder", children: "Loading..." }) });
149
- return n ? /* @__PURE__ */ e(c.Suspense, { fallback: d, children: /* @__PURE__ */ e(
150
- ve,
361
+ const l = /* @__PURE__ */ t("div", { className: "flex h-[350px] w-[352px] items-center justify-center rounded-ds-lg border border-border bg-layer-01 shadow-02", children: /* @__PURE__ */ t("span", { className: "text-ds-sm text-text-placeholder", children: "Loading..." }) });
362
+ return n ? /* @__PURE__ */ t(c.Suspense, { fallback: l, children: /* @__PURE__ */ t(
363
+ De,
151
364
  {
152
365
  data: n,
153
- onEmojiSelect: (u) => t(u.native),
154
- theme: l === "dark" ? "dark" : "light",
366
+ onEmojiSelect: (r) => e(r.native),
367
+ theme: i === "dark" ? "dark" : "light",
155
368
  previewPosition: "none",
156
369
  skinTonePosition: "none"
157
370
  }
158
- ) }) : d;
371
+ ) }) : l;
159
372
  }
160
- const _e = c.forwardRef(
373
+ const Pe = c.forwardRef(
161
374
  function({
162
375
  content: n = "",
163
- placeholder: a = "Start writing...",
164
- onChange: l,
165
- className: d,
166
- editable: u = !0,
167
- onImageUpload: x,
168
- onFileUpload: h,
169
- mentions: g,
170
- onMentionSearch: m,
171
- onMentionSelect: A
172
- }, W) {
173
- const y = c.useRef(null), [I, v] = c.useState(!1), N = c.useRef(null), T = c.useRef(null), R = c.useRef(null), C = async (i) => {
174
- const o = y.current;
175
- if (o)
176
- if (x) {
177
- const s = await x(i);
178
- s && /^https?:\/\//i.test(s) && o.chain().focus().setImage({ src: s }).run();
376
+ placeholder: s = "Start writing...",
377
+ onChange: i,
378
+ className: l,
379
+ editable: r = !0,
380
+ onImageUpload: o,
381
+ onFileUpload: b,
382
+ mentions: x,
383
+ onMentionSearch: f,
384
+ onMentionSelect: _
385
+ }, J) {
386
+ const N = c.useRef(null), [I, v] = c.useState(!1), L = c.useRef(null), T = c.useRef(null), H = c.useRef(null), C = async (a) => {
387
+ const m = N.current;
388
+ if (m)
389
+ if (o) {
390
+ const d = await o(a);
391
+ d && /^https?:\/\//i.test(d) && m.chain().focus().setImage({ src: d }).run();
179
392
  } else {
180
- const s = new FileReader();
181
- s.onload = () => {
182
- o.chain().focus().setImage({ src: s.result }).run();
183
- }, s.readAsDataURL(i);
393
+ const d = new FileReader();
394
+ d.onload = () => {
395
+ m.chain().focus().setImage({ src: d.result }).run();
396
+ }, d.readAsDataURL(a);
184
397
  }
185
- }, L = async (i) => {
186
- const o = y.current;
187
- if (!o || !h) return;
188
- const s = await h(i);
189
- o.chain().focus().insertContent({
398
+ }, E = async (a) => {
399
+ const m = N.current;
400
+ if (!m || !b) return;
401
+ const d = await b(a);
402
+ m.chain().focus().insertContent({
190
403
  type: "fileAttachment",
191
- attrs: { url: s.url, name: s.name, size: s.size }
404
+ attrs: { url: d.url, name: d.name, size: d.size }
192
405
  }).run();
193
- }, f = S({
406
+ }, h = M({
194
407
  extensions: [
195
- B.configure({
408
+ P.configure({
196
409
  heading: { levels: [2, 3] }
197
410
  }),
198
- G.configure({
199
- placeholder: a,
411
+ ne.configure({
412
+ placeholder: s,
200
413
  emptyEditorClass: "before:content-[attr(data-placeholder)] before:text-text-placeholder before:float-left before:h-0 before:pointer-events-none"
201
414
  }),
202
- P,
203
- M.configure({ multicolor: !1 }),
204
- j,
205
- D.configure({ nested: !0 }),
206
- z.configure({ types: ["heading", "paragraph"] }),
207
- q.configure({
415
+ D,
416
+ z.configure({ multicolor: !1 }),
417
+ B,
418
+ U.configure({ nested: !0 }),
419
+ K.configure({ types: ["heading", "paragraph"] }),
420
+ $.configure({
208
421
  openOnClick: !1,
209
422
  protocols: ["http", "https", "mailto"],
210
- validate: (i) => /^(https?:\/\/|mailto:)/i.test(i),
423
+ validate: (a) => /^(https?:\/\/|mailto:)/i.test(a),
211
424
  HTMLAttributes: {
212
425
  rel: "noopener noreferrer",
213
426
  target: "_blank"
214
427
  }
215
428
  }),
216
- U.configure({
429
+ O.configure({
217
430
  allowBase64: !0,
218
431
  HTMLAttributes: {
219
432
  class: "max-w-full rounded-ds-md"
220
433
  }
221
434
  }),
222
- K,
223
- ...g || m ? [
224
- O.configure({
435
+ W,
436
+ ...x || f ? [
437
+ V.configure({
225
438
  HTMLAttributes: { class: "mention" },
226
439
  suggestion: {
227
- items: async ({ query: i }) => m ? await m(i) : g ? g.filter((o) => o.label.toLowerCase().includes(i.toLowerCase())).slice(0, 8) : [],
228
- render: J()
440
+ items: async ({ query: a }) => f ? await f(a) : x ? x.filter((m) => m.label.toLowerCase().includes(a.toLowerCase())).slice(0, 8) : [],
441
+ render: Re()
229
442
  }
230
443
  })
231
444
  ] : [],
232
- Q
445
+ He
233
446
  ],
234
447
  content: n,
235
- editable: u,
448
+ editable: r,
236
449
  editorProps: {
237
- handleDrop: (i, o, s, w) => {
238
- var E;
239
- if (w || !((E = o.dataTransfer) != null && E.files.length)) return !1;
240
- const _ = o.dataTransfer.files[0];
241
- return _ ? _.type.startsWith("image/") ? (C(_), !0) : h ? (L(_), !0) : !1 : !1;
450
+ handleDrop: (a, m, d, w) => {
451
+ var j;
452
+ if (w || !((j = m.dataTransfer) != null && j.files.length)) return !1;
453
+ const y = m.dataTransfer.files[0];
454
+ return y ? y.type.startsWith("image/") ? (C(y), !0) : b ? (E(y), !0) : !1 : !1;
242
455
  },
243
- handlePaste: (i, o) => {
456
+ handlePaste: (a, m) => {
244
457
  var w;
245
- const s = (w = o.clipboardData) == null ? void 0 : w.files[0];
246
- return s ? s.type.startsWith("image/") ? (C(s), !0) : h ? (L(s), !0) : !1 : !1;
458
+ const d = (w = m.clipboardData) == null ? void 0 : w.files[0];
459
+ return d ? d.type.startsWith("image/") ? (C(d), !0) : b ? (E(d), !0) : !1 : !1;
247
460
  },
248
461
  attributes: {
249
- class: k(
250
- ...V,
462
+ class: p(
463
+ ...G,
251
464
  "focus:outline-none",
252
465
  "min-h-[120px] px-ds-04 py-ds-04"
253
466
  )
254
467
  }
255
468
  },
256
- onUpdate: ({ editor: i }) => {
257
- l == null || l(i.getHTML());
469
+ onUpdate: ({ editor: a }) => {
470
+ i == null || i(a.getHTML());
258
471
  }
259
472
  });
260
473
  return c.useEffect(() => {
261
- y.current = f;
262
- }, [f]), c.useEffect(() => {
474
+ N.current = h;
475
+ }, [h]), c.useEffect(() => {
263
476
  if (!I) return;
264
- const i = (o) => {
265
- N.current && !N.current.contains(o.target) && v(!1);
477
+ const a = (m) => {
478
+ L.current && !L.current.contains(m.target) && v(!1);
266
479
  };
267
- return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
480
+ return document.addEventListener("mousedown", a), () => document.removeEventListener("mousedown", a);
268
481
  }, [I]), c.useEffect(() => {
269
- f && n !== f.getHTML() && f.commands.setContent(n, !1);
270
- }, [f, n]), f ? /* @__PURE__ */ b("div", { ref: W, className: k("relative", d), children: [
271
- I && /* @__PURE__ */ e(
482
+ h && n !== h.getHTML() && h.commands.setContent(n, !1);
483
+ }, [h, n]), h ? /* @__PURE__ */ g("div", { ref: J, className: p("relative", l), children: [
484
+ I && /* @__PURE__ */ t(
272
485
  "div",
273
486
  {
274
- ref: N,
487
+ ref: L,
275
488
  className: "absolute bottom-full right-0 z-popover mb-ds-02",
276
- onKeyDown: (i) => {
277
- i.key === "Escape" && (i.stopPropagation(), v(!1));
489
+ onKeyDown: (a) => {
490
+ a.key === "Escape" && (a.stopPropagation(), v(!1));
278
491
  },
279
- children: /* @__PURE__ */ e(
280
- we,
492
+ children: /* @__PURE__ */ t(
493
+ Be,
281
494
  {
282
- onSelect: (i) => {
283
- f.chain().focus().insertContent(i).run(), v(!1);
495
+ onSelect: (a) => {
496
+ h.chain().focus().insertContent(a).run(), v(!1);
284
497
  }
285
498
  }
286
499
  )
287
500
  }
288
501
  ),
289
- /* @__PURE__ */ b(
502
+ /* @__PURE__ */ g(
290
503
  "div",
291
504
  {
292
- className: k(
505
+ className: p(
293
506
  "overflow-hidden rounded-ds-lg border border-border bg-layer-01",
294
507
  "transition-colors focus-within:border-border-strong"
295
508
  ),
296
509
  children: [
297
- /* @__PURE__ */ e(
510
+ /* @__PURE__ */ t(
298
511
  "input",
299
512
  {
300
513
  ref: T,
@@ -302,79 +515,79 @@ const _e = c.forwardRef(
302
515
  accept: "image/*",
303
516
  "aria-label": "Upload image",
304
517
  className: "hidden",
305
- onChange: (i) => {
306
- var s;
307
- const o = (s = i.target.files) == null ? void 0 : s[0];
308
- o && C(o), i.target.value = "";
518
+ onChange: (a) => {
519
+ var d;
520
+ const m = (d = a.target.files) == null ? void 0 : d[0];
521
+ m && C(m), a.target.value = "";
309
522
  }
310
523
  }
311
524
  ),
312
- h && /* @__PURE__ */ e(
525
+ b && /* @__PURE__ */ t(
313
526
  "input",
314
527
  {
315
- ref: R,
528
+ ref: H,
316
529
  type: "file",
317
530
  "aria-label": "Upload file",
318
531
  className: "hidden",
319
- onChange: (i) => {
320
- var s;
321
- const o = (s = i.target.files) == null ? void 0 : s[0];
322
- o && L(o), i.target.value = "";
532
+ onChange: (a) => {
533
+ var d;
534
+ const m = (d = a.target.files) == null ? void 0 : d[0];
535
+ m && E(m), a.target.value = "";
323
536
  }
324
537
  }
325
538
  ),
326
- u && /* @__PURE__ */ e(
327
- xe,
539
+ r && /* @__PURE__ */ t(
540
+ Me,
328
541
  {
329
- editor: f,
542
+ editor: h,
330
543
  onImageClick: () => {
331
- var i;
332
- return (i = T.current) == null ? void 0 : i.click();
544
+ var a;
545
+ return (a = T.current) == null ? void 0 : a.click();
333
546
  },
334
- onFileClick: h ? () => {
335
- var i;
336
- return (i = R.current) == null ? void 0 : i.click();
547
+ onFileClick: b ? () => {
548
+ var a;
549
+ return (a = H.current) == null ? void 0 : a.click();
337
550
  } : void 0,
338
- onEmojiClick: () => v((i) => !i)
551
+ onEmojiClick: () => v((a) => !a)
339
552
  }
340
553
  ),
341
- /* @__PURE__ */ e(H, { editor: f })
554
+ /* @__PURE__ */ t(q, { editor: h })
342
555
  ]
343
556
  }
344
557
  )
345
558
  ] }) : null;
346
559
  }
347
560
  );
348
- _e.displayName = "RichTextEditor";
349
- const Ae = c.forwardRef(
350
- function({ content: n, className: a }, l) {
351
- const d = S({
561
+ Pe.displayName = "RichTextEditor";
562
+ const ze = c.forwardRef(
563
+ function({ content: n, className: s }, i) {
564
+ const l = M({
352
565
  extensions: [
353
- B.configure({
566
+ P.configure({
354
567
  heading: { levels: [2, 3] }
355
568
  }),
356
- P,
357
- M.configure({ multicolor: !1 }),
358
- j,
359
- D.configure({ nested: !0 }),
360
- z.configure({ types: ["heading", "paragraph"] }),
361
- q.configure({
569
+ D,
570
+ z.configure({ multicolor: !1 }),
571
+ B,
572
+ U.configure({ nested: !0 }),
573
+ K.configure({ types: ["heading", "paragraph"] }),
574
+ $.configure({
362
575
  openOnClick: !0,
363
576
  protocols: ["http", "https", "mailto"],
364
- validate: (u) => /^(https?:\/\/|mailto:)/i.test(u),
577
+ validate: (r) => /^(https?:\/\/|mailto:)/i.test(r),
365
578
  HTMLAttributes: {
366
579
  rel: "noopener noreferrer",
367
580
  target: "_blank"
368
581
  }
369
582
  }),
370
- U.configure({
583
+ O.configure({
371
584
  allowBase64: !0,
372
585
  HTMLAttributes: {
373
586
  class: "max-w-full rounded-ds-md"
374
587
  }
375
588
  }),
376
- K,
377
- O.configure({
589
+ W,
590
+ V.configure({
378
591
  HTMLAttributes: { class: "mention" }
379
592
  })
380
593
  ],
@@ -382,15 +595,15 @@ const Ae = c.forwardRef(
382
595
  editable: !1,
383
596
  editorProps: {
384
597
  attributes: {
385
- class: k(...V)
598
+ class: p(...G)
386
599
  }
387
600
  }
388
601
  });
389
- return d ? /* @__PURE__ */ e("div", { ref: l, className: a, children: /* @__PURE__ */ e(H, { editor: d }) }) : null;
602
+ return l ? /* @__PURE__ */ t("div", { ref: i, className: s, children: /* @__PURE__ */ t(q, { editor: l }) }) : null;
390
603
  }
391
604
  );
392
- Ae.displayName = "RichTextViewer";
605
+ ze.displayName = "RichTextViewer";
393
606
  export {
394
- _e as RichTextEditor,
395
- Ae as RichTextViewer
607
+ Pe as RichTextEditor,
608
+ ze as RichTextViewer
396
609
  };