@devalok/shilp-sutra 0.31.0 → 0.33.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 (278) hide show
  1. package/LICENSE +21 -0
  2. package/dist/_chunks/badge-group.js +123 -172
  3. package/dist/_chunks/date-time-picker.js +851 -0
  4. package/dist/_chunks/document-preview.js +92 -0
  5. package/dist/_chunks/file-preview.js +511 -0
  6. package/dist/_chunks/image-preview.js +90 -0
  7. package/dist/_chunks/mention-suggestion.js +362 -0
  8. package/dist/_chunks/primitives.js +109 -109
  9. package/dist/_chunks/stat-row.js +144 -124
  10. package/dist/_chunks/tiptap.js +11595 -7731
  11. package/dist/_chunks/use-calendar.js +117 -890
  12. package/dist/_chunks/vendor-client.js +1055 -894
  13. package/dist/ai/block-renderer.d.ts +2 -1
  14. package/dist/ai/block-renderer.d.ts.map +1 -1
  15. package/dist/ai/block-renderer.js +30 -29
  16. package/dist/ai/blocks/block-table.d.ts.map +1 -1
  17. package/dist/ai/blocks/confirm.d.ts.map +1 -1
  18. package/dist/ai/blocks/divider.d.ts.map +1 -1
  19. package/dist/ai/blocks/error.d.ts.map +1 -1
  20. package/dist/ai/blocks/info.d.ts.map +1 -1
  21. package/dist/ai/blocks/loading.d.ts.map +1 -1
  22. package/dist/ai/blocks/stat-row.d.ts.map +1 -1
  23. package/dist/ai/blocks/success.d.ts.map +1 -1
  24. package/dist/ai/blocks/text.d.ts.map +1 -1
  25. package/dist/ai/command-bar.d.ts +18 -0
  26. package/dist/ai/command-bar.d.ts.map +1 -1
  27. package/dist/ai/command-bar.js +126 -125
  28. package/dist/ai/conversation.d.ts +13 -1
  29. package/dist/ai/conversation.d.ts.map +1 -1
  30. package/dist/ai/conversation.js +78 -78
  31. package/dist/ai/types.d.ts +0 -1
  32. package/dist/ai/types.d.ts.map +1 -1
  33. package/dist/ai/types.js +0 -1
  34. package/dist/composed/bulk-action-bar.d.ts +6 -4
  35. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  36. package/dist/composed/bulk-action-bar.js +102 -58
  37. package/dist/composed/command-palette.d.ts +9 -0
  38. package/dist/composed/command-palette.d.ts.map +1 -1
  39. package/dist/composed/command-palette.js +68 -68
  40. package/dist/composed/confirm-dialog.d.ts +1 -1
  41. package/dist/composed/confirm-dialog.d.ts.map +1 -1
  42. package/dist/composed/confirm-dialog.js +10 -10
  43. package/dist/composed/date-picker/date-picker.d.ts +11 -1
  44. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  45. package/dist/composed/date-picker/index.js +9 -8
  46. package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
  47. package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
  48. package/dist/composed/deadline-indicator.d.ts +1 -1
  49. package/dist/composed/deadline-indicator.d.ts.map +1 -1
  50. package/dist/composed/deadline-indicator.js +39 -36
  51. package/dist/composed/emoji-picker.d.ts +14 -2
  52. package/dist/composed/emoji-picker.d.ts.map +1 -1
  53. package/dist/composed/emoji-picker.js +66 -55
  54. package/dist/composed/error-boundary.d.ts +21 -1
  55. package/dist/composed/error-boundary.d.ts.map +1 -1
  56. package/dist/composed/error-boundary.js +47 -32
  57. package/dist/composed/extensions/emoji-data.d.ts +35 -0
  58. package/dist/composed/extensions/emoji-data.d.ts.map +1 -0
  59. package/dist/composed/extensions/emoji-node.d.ts +11 -0
  60. package/dist/composed/extensions/emoji-node.d.ts.map +1 -0
  61. package/dist/composed/extensions/emoji-suggestion.d.ts +4 -6
  62. package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -1
  63. package/dist/composed/extensions/slash-command.d.ts +35 -0
  64. package/dist/composed/extensions/slash-command.d.ts.map +1 -0
  65. package/dist/composed/file-preview/audio-preview.d.ts +7 -0
  66. package/dist/composed/file-preview/audio-preview.d.ts.map +1 -0
  67. package/dist/composed/file-preview/document-preview.d.ts +7 -0
  68. package/dist/composed/file-preview/document-preview.d.ts.map +1 -0
  69. package/dist/composed/file-preview/embed-preview.d.ts +7 -0
  70. package/dist/composed/file-preview/embed-preview.d.ts.map +1 -0
  71. package/dist/composed/file-preview/image-preview.d.ts +7 -0
  72. package/dist/composed/file-preview/image-preview.d.ts.map +1 -0
  73. package/dist/composed/file-preview/shared.d.ts +20 -0
  74. package/dist/composed/file-preview/shared.d.ts.map +1 -0
  75. package/dist/composed/file-preview/video-preview.d.ts +6 -0
  76. package/dist/composed/file-preview/video-preview.d.ts.map +1 -0
  77. package/dist/composed/file-preview.d.ts.map +1 -1
  78. package/dist/composed/file-preview.js +10 -662
  79. package/dist/composed/filter-bar.d.ts +10 -2
  80. package/dist/composed/filter-bar.d.ts.map +1 -1
  81. package/dist/composed/filter-bar.js +42 -43
  82. package/dist/composed/form-section.d.ts +1 -1
  83. package/dist/composed/form-section.d.ts.map +1 -1
  84. package/dist/composed/form-section.js +22 -21
  85. package/dist/composed/index.d.ts +9 -3
  86. package/dist/composed/index.d.ts.map +1 -1
  87. package/dist/composed/index.js +79 -69
  88. package/dist/composed/inline-edit.d.ts +1 -1
  89. package/dist/composed/inline-edit.d.ts.map +1 -1
  90. package/dist/composed/inline-edit.js +33 -32
  91. package/dist/composed/markdown-viewer.d.ts +1 -1
  92. package/dist/composed/markdown-viewer.d.ts.map +1 -1
  93. package/dist/composed/markdown-viewer.js +60 -59
  94. package/dist/composed/master-detail.d.ts +11 -7
  95. package/dist/composed/master-detail.d.ts.map +1 -1
  96. package/dist/composed/master-detail.js +123 -84
  97. package/dist/composed/responsive-overlay.d.ts +8 -0
  98. package/dist/composed/responsive-overlay.d.ts.map +1 -1
  99. package/dist/composed/rich-chat-input/attachment-strip.d.ts +15 -0
  100. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -0
  101. package/dist/composed/rich-chat-input/audio-player.d.ts +11 -0
  102. package/dist/composed/rich-chat-input/audio-player.d.ts.map +1 -0
  103. package/dist/composed/rich-chat-input/audio-waveform.d.ts +24 -0
  104. package/dist/composed/rich-chat-input/audio-waveform.d.ts.map +1 -0
  105. package/dist/composed/rich-chat-input/chat-toolbar.d.ts +51 -0
  106. package/dist/composed/rich-chat-input/chat-toolbar.d.ts.map +1 -0
  107. package/dist/composed/rich-chat-input/recording-overlay.d.ts +15 -0
  108. package/dist/composed/rich-chat-input/recording-overlay.d.ts.map +1 -0
  109. package/dist/composed/rich-chat-input/reply-banner.d.ts +8 -0
  110. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -0
  111. package/dist/composed/rich-chat-input/schedule-send.d.ts +22 -0
  112. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -0
  113. package/dist/composed/rich-chat-input/use-voice-recorder.d.ts +18 -0
  114. package/dist/composed/rich-chat-input/use-voice-recorder.d.ts.map +1 -0
  115. package/dist/composed/rich-chat-input.d.ts +91 -0
  116. package/dist/composed/rich-chat-input.d.ts.map +1 -0
  117. package/dist/composed/rich-chat-input.js +1861 -0
  118. package/dist/composed/rich-text-editor.d.ts +14 -3
  119. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  120. package/dist/composed/rich-text-editor.js +278 -447
  121. package/dist/composed/schedule-view.d.ts +9 -1
  122. package/dist/composed/schedule-view.d.ts.map +1 -1
  123. package/dist/hooks/index.d.ts +2 -0
  124. package/dist/hooks/index.d.ts.map +1 -1
  125. package/dist/hooks/index.js +8 -4
  126. package/dist/hooks/use-touch-device.d.ts +12 -0
  127. package/dist/hooks/use-touch-device.d.ts.map +1 -0
  128. package/dist/hooks/use-touch-device.js +13 -0
  129. package/dist/hooks/use-viewport-height.d.ts +11 -0
  130. package/dist/hooks/use-viewport-height.d.ts.map +1 -0
  131. package/dist/hooks/use-viewport-height.js +16 -0
  132. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  133. package/dist/shell/bottom-navbar.js +72 -63
  134. package/dist/shell/command-registry.d.ts.map +1 -1
  135. package/dist/shell/notification-center.d.ts.map +1 -1
  136. package/dist/shell/notification-center.js +77 -77
  137. package/dist/shell/top-bar.d.ts +2 -2
  138. package/dist/shell/top-bar.d.ts.map +1 -1
  139. package/dist/shell/top-bar.js +61 -60
  140. package/dist/tailwind/index.cjs +51 -7
  141. package/dist/tailwind/preset.d.ts.map +1 -1
  142. package/dist/tailwind/preset.js +51 -7
  143. package/dist/tokens/primitives.css +3 -1
  144. package/dist/tokens/semantic.css +16 -13
  145. package/dist/ui/autocomplete.d.ts.map +1 -1
  146. package/dist/ui/autocomplete.js +38 -39
  147. package/dist/ui/badge.d.ts +104 -2
  148. package/dist/ui/badge.d.ts.map +1 -1
  149. package/dist/ui/banner.d.ts.map +1 -1
  150. package/dist/ui/banner.js +8 -7
  151. package/dist/ui/button-group.d.ts +27 -37
  152. package/dist/ui/button-group.d.ts.map +1 -1
  153. package/dist/ui/button-group.js +95 -29
  154. package/dist/ui/button.d.ts +2 -2
  155. package/dist/ui/button.d.ts.map +1 -1
  156. package/dist/ui/button.js +118 -134
  157. package/dist/ui/card.js +24 -24
  158. package/dist/ui/charts/area-chart.d.ts +2 -0
  159. package/dist/ui/charts/area-chart.d.ts.map +1 -1
  160. package/dist/ui/charts/bar-chart.d.ts +2 -0
  161. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  162. package/dist/ui/charts/chart-container.d.ts +2 -0
  163. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  164. package/dist/ui/charts/index.js +583 -577
  165. package/dist/ui/charts/line-chart.d.ts +2 -0
  166. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  167. package/dist/ui/charts/pie-chart.d.ts +2 -0
  168. package/dist/ui/charts/pie-chart.d.ts.map +1 -1
  169. package/dist/ui/charts/radar-chart.d.ts +2 -0
  170. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  171. package/dist/ui/checkbox.d.ts +2 -0
  172. package/dist/ui/checkbox.d.ts.map +1 -1
  173. package/dist/ui/checkbox.js +36 -27
  174. package/dist/ui/color-input.js +5 -5
  175. package/dist/ui/combobox.d.ts +6 -1
  176. package/dist/ui/combobox.d.ts.map +1 -1
  177. package/dist/ui/combobox.js +1 -1
  178. package/dist/ui/context-menu.js +1 -1
  179. package/dist/ui/data-table-body.d.ts +12 -0
  180. package/dist/ui/data-table-body.d.ts.map +1 -0
  181. package/dist/ui/data-table-body.js +219 -0
  182. package/dist/ui/data-table-bulk-actions.d.ts +19 -0
  183. package/dist/ui/data-table-bulk-actions.d.ts.map +1 -0
  184. package/dist/ui/data-table-bulk-actions.js +61 -0
  185. package/dist/ui/data-table-card.d.ts +9 -0
  186. package/dist/ui/data-table-card.d.ts.map +1 -0
  187. package/dist/ui/data-table-card.js +73 -0
  188. package/dist/ui/data-table-context.d.ts +62 -0
  189. package/dist/ui/data-table-context.d.ts.map +1 -0
  190. package/dist/ui/data-table-context.js +48 -0
  191. package/dist/ui/data-table-header.d.ts +10 -0
  192. package/dist/ui/data-table-header.d.ts.map +1 -0
  193. package/dist/ui/data-table-header.js +141 -0
  194. package/dist/ui/data-table-pagination.d.ts +13 -0
  195. package/dist/ui/data-table-pagination.d.ts.map +1 -0
  196. package/dist/ui/data-table-pagination.js +84 -0
  197. package/dist/ui/data-table.d.ts +11 -9
  198. package/dist/ui/data-table.d.ts.map +1 -1
  199. package/dist/ui/data-table.js +258 -573
  200. package/dist/ui/dialog.d.ts +6 -2
  201. package/dist/ui/dialog.d.ts.map +1 -1
  202. package/dist/ui/dialog.js +84 -82
  203. package/dist/ui/dropdown-menu.js +1 -1
  204. package/dist/ui/hover-card.d.ts +7 -0
  205. package/dist/ui/hover-card.d.ts.map +1 -1
  206. package/dist/ui/hover-card.js +3 -3
  207. package/dist/ui/icon-group.d.ts +2 -4
  208. package/dist/ui/icon-group.d.ts.map +1 -1
  209. package/dist/ui/icon-group.js +22 -23
  210. package/dist/ui/index.d.ts +2 -2
  211. package/dist/ui/index.d.ts.map +1 -1
  212. package/dist/ui/index.js +324 -327
  213. package/dist/ui/label.js +1 -1
  214. package/dist/ui/lib/bottom-sheet.d.ts +16 -0
  215. package/dist/ui/lib/bottom-sheet.d.ts.map +1 -0
  216. package/dist/ui/menubar.d.ts.map +1 -1
  217. package/dist/ui/menubar.js +64 -73
  218. package/dist/ui/navigation-menu.d.ts.map +1 -1
  219. package/dist/ui/navigation-menu.js +40 -44
  220. package/dist/ui/number-input.d.ts.map +1 -1
  221. package/dist/ui/number-input.js +19 -17
  222. package/dist/ui/popover.d.ts.map +1 -1
  223. package/dist/ui/popover.js +107 -32
  224. package/dist/ui/progress-ring.d.ts.map +1 -1
  225. package/dist/ui/progress-ring.js +80 -80
  226. package/dist/ui/progress.js +4 -4
  227. package/dist/ui/radio.d.ts +5 -2
  228. package/dist/ui/radio.d.ts.map +1 -1
  229. package/dist/ui/radio.js +29 -20
  230. package/dist/ui/search-input.d.ts.map +1 -1
  231. package/dist/ui/search-input.js +13 -12
  232. package/dist/ui/segmented-control.d.ts +6 -108
  233. package/dist/ui/segmented-control.d.ts.map +1 -1
  234. package/dist/ui/segmented-control.js +86 -272
  235. package/dist/ui/select.js +5 -5
  236. package/dist/ui/separator.js +5 -5
  237. package/dist/ui/sheet.d.ts +2 -0
  238. package/dist/ui/sheet.d.ts.map +1 -1
  239. package/dist/ui/sheet.js +102 -84
  240. package/dist/ui/sidebar.d.ts.map +1 -1
  241. package/dist/ui/sidebar.js +200 -175
  242. package/dist/ui/slider.js +14 -14
  243. package/dist/ui/split-button.d.ts +45 -0
  244. package/dist/ui/split-button.d.ts.map +1 -0
  245. package/dist/ui/split-button.js +282 -0
  246. package/dist/ui/status-dot.js +8 -8
  247. package/dist/ui/stepper.d.ts.map +1 -1
  248. package/dist/ui/stepper.js +33 -31
  249. package/dist/ui/switch.js +3 -3
  250. package/dist/ui/tabs.js +6 -6
  251. package/dist/ui/toast-types.d.ts +0 -1
  252. package/dist/ui/toast-types.d.ts.map +1 -1
  253. package/dist/ui/toast-types.js +0 -1
  254. package/dist/ui/toast.d.ts.map +1 -1
  255. package/dist/ui/toast.js +156 -150
  256. package/dist/ui/toggle-group.js +1 -1
  257. package/dist/ui/toggle.js +1 -1
  258. package/dist/ui/tooltip.js +3 -3
  259. package/docs/components/composed/emoji-picker.md +9 -0
  260. package/docs/components/composed/rich-chat-input.md +88 -0
  261. package/docs/components/composed/rich-text-editor.md +5 -0
  262. package/docs/components/ui/button-group.md +9 -0
  263. package/docs/components/ui/button.md +4 -0
  264. package/docs/components/ui/data-table-body.md +13 -0
  265. package/docs/components/ui/data-table-bulk-actions.md +13 -0
  266. package/docs/components/ui/data-table-card.md +13 -0
  267. package/docs/components/ui/data-table-context.md +13 -0
  268. package/docs/components/ui/data-table-header.md +13 -0
  269. package/docs/components/ui/data-table-pagination.md +13 -0
  270. package/docs/components/ui/split-button.md +41 -0
  271. package/llms-full.txt +235 -48
  272. package/llms.txt +54 -2
  273. package/package.json +30 -31
  274. package/dist/ui/chip.d.ts +0 -19
  275. package/dist/ui/chip.d.ts.map +0 -1
  276. package/dist/ui/chip.js +0 -14
  277. package/dist/ui/lib/use-ripple.d.ts +0 -14
  278. package/dist/ui/lib/use-ripple.d.ts.map +0 -1
@@ -0,0 +1,90 @@
1
+ "use client";
2
+ import { jsx as t, jsxs as c, Fragment as S } from "react/jsx-runtime";
3
+ import * as n from "react";
4
+ import { cn as u } from "../ui/lib/utils.js";
5
+ import { tweens as R } from "../ui/lib/motion.js";
6
+ import { Skeleton as Z } from "../ui/skeleton.js";
7
+ import { Button as m } from "../ui/button.js";
8
+ import { Icon as l } from "../ui/icon.js";
9
+ import { IconZoomOut as D, IconZoomIn as N, IconZoomReset as T, IconMinimize as j, IconMaximize as L } from "@tabler/icons-react";
10
+ import { TransformWrapper as M, TransformComponent as O } from "react-zoom-pan-pinch";
11
+ import { E as B, T as H, a as k } from "./file-preview.js";
12
+ import { m as K } from "./framer.js";
13
+ function Y({ url: d, alt: g, onError: z }) {
14
+ const [i, w] = n.useState(!1), [y, E] = n.useState(!1), [C, I] = n.useState(100), [o, f] = n.useState(!1), p = n.useRef(null), [h, x] = n.useState(!1), v = n.useRef(null);
15
+ return n.useEffect(() => {
16
+ function s(e) {
17
+ const a = p.current;
18
+ if (!a || !a.contains(document.activeElement) && !h) return;
19
+ const r = v.current;
20
+ r && (e.key === "+" || e.key === "=" ? (e.preventDefault(), r.zoomIn()) : e.key === "-" ? (e.preventDefault(), r.zoomOut()) : e.key === "0" ? (e.preventDefault(), r.resetTransform()) : e.key === "f" || e.key === "F" ? (e.preventDefault(), f((F) => !F)) : e.key === "Escape" && o && (e.preventDefault(), f(!1)));
21
+ }
22
+ return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
23
+ }, [h, o]), y ? /* @__PURE__ */ t(B, { message: "Could not load image", url: d }) : /* @__PURE__ */ t(
24
+ "div",
25
+ {
26
+ ref: p,
27
+ className: o ? "fixed inset-0 z-50 flex flex-col items-center justify-center bg-black/90 backdrop-blur-sm" : "relative flex flex-col items-center gap-ds-03",
28
+ onMouseEnter: () => x(!0),
29
+ onMouseLeave: () => x(!1),
30
+ tabIndex: -1,
31
+ children: /* @__PURE__ */ t(
32
+ M,
33
+ {
34
+ initialScale: 1,
35
+ minScale: 0.1,
36
+ maxScale: 8,
37
+ centerOnInit: !0,
38
+ doubleClick: { mode: "toggle", step: 2 },
39
+ onTransformed: (s, e) => I(Math.round(e.scale * 100)),
40
+ children: ({ zoomIn: s, zoomOut: e, resetTransform: a, centerView: b }) => (v.current = { zoomIn: s, zoomOut: e, resetTransform: a, centerView: b }, /* @__PURE__ */ c(S, { children: [
41
+ /* @__PURE__ */ c("div", { className: u(
42
+ "overflow-hidden rounded-ds-md bg-surface-sunken",
43
+ o ? "flex-1 w-full" : "max-h-[70vh] max-w-full"
44
+ ), children: [
45
+ !i && /* @__PURE__ */ t(Z, { className: "h-64 w-full rounded-ds-md" }),
46
+ /* @__PURE__ */ t(
47
+ O,
48
+ {
49
+ wrapperClass: u("!w-full", o && "!h-full"),
50
+ contentClass: "!w-full !flex !items-center !justify-center",
51
+ children: /* @__PURE__ */ t(
52
+ K.img,
53
+ {
54
+ src: d,
55
+ alt: g ?? "",
56
+ onLoad: () => w(!0),
57
+ onError: () => {
58
+ E(!0), z?.("Image failed to load");
59
+ },
60
+ initial: { opacity: 0 },
61
+ animate: { opacity: i ? 1 : 0 },
62
+ transition: R.fade,
63
+ className: u("max-w-full select-none", !i && "hidden", o && "max-h-[90vh] object-contain"),
64
+ draggable: !1
65
+ }
66
+ )
67
+ }
68
+ )
69
+ ] }),
70
+ i && /* @__PURE__ */ c(H, { className: o ? "absolute bottom-ds-06" : void 0, children: [
71
+ /* @__PURE__ */ t(m, { variant: "ghost", size: "icon-xs", onClick: () => e(), "aria-label": "Zoom out (-)", title: "Zoom out", children: /* @__PURE__ */ t(l, { icon: D, size: "sm" }) }),
72
+ /* @__PURE__ */ c("span", { className: "text-ds-xs font-mono text-surface-fg-muted w-12 text-center tabular-nums select-none", children: [
73
+ C,
74
+ "%"
75
+ ] }),
76
+ /* @__PURE__ */ t(m, { variant: "ghost", size: "icon-xs", onClick: () => s(), "aria-label": "Zoom in (+)", title: "Zoom in", children: /* @__PURE__ */ t(l, { icon: N, size: "sm" }) }),
77
+ /* @__PURE__ */ t(k, {}),
78
+ /* @__PURE__ */ t(m, { variant: "ghost", size: "icon-xs", onClick: () => a(), "aria-label": "Reset zoom (0)", title: "Reset zoom", children: /* @__PURE__ */ t(l, { icon: T, size: "sm" }) }),
79
+ /* @__PURE__ */ t(k, {}),
80
+ /* @__PURE__ */ t(m, { variant: "ghost", size: "icon-xs", onClick: () => f((r) => !r), "aria-label": o ? "Exit fullscreen (Esc)" : "Fullscreen (F)", title: o ? "Exit fullscreen" : "Fullscreen", children: o ? /* @__PURE__ */ t(l, { icon: j, size: "sm" }) : /* @__PURE__ */ t(l, { icon: L, size: "sm" }) })
81
+ ] })
82
+ ] }))
83
+ }
84
+ )
85
+ }
86
+ );
87
+ }
88
+ export {
89
+ Y as default
90
+ };
@@ -0,0 +1,362 @@
1
+ "use client";
2
+ import { jsx as i, jsxs as u } from "react/jsx-runtime";
3
+ import { N as v, R as w, m as N, f as g, g as $, h as S, j as R } from "./tiptap.js";
4
+ import { IconFile as I, IconDownload as A } from "@tabler/icons-react";
5
+ import { Icon as x } from "../ui/icon.js";
6
+ import * as d from "react";
7
+ import { createRoot as j } from "react-dom/client";
8
+ import { cn as k } from "../ui/lib/utils.js";
9
+ import { emojiDataLoaders as h } from "../composed/emoji-picker.js";
10
+ function L(e) {
11
+ return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
12
+ }
13
+ function z({ node: e }) {
14
+ const r = /^https?:\/\//.test(e.attrs.url) ? e.attrs.url : "#";
15
+ return /* @__PURE__ */ i(g, { className: "my-ds-02", children: /* @__PURE__ */ u(
16
+ "a",
17
+ {
18
+ href: r,
19
+ target: "_blank",
20
+ rel: "noopener noreferrer",
21
+ className: "inline-flex items-center gap-ds-03 rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-04 py-ds-03 text-ds-sm text-surface-fg transition-colors hover:border-surface-border-strong hover:bg-surface-raised-hover",
22
+ contentEditable: !1,
23
+ children: [
24
+ /* @__PURE__ */ i(x, { icon: I, size: "sm", className: "shrink-0 text-surface-fg-subtle" }),
25
+ /* @__PURE__ */ i("span", { className: "truncate", children: e.attrs.name }),
26
+ /* @__PURE__ */ u("span", { className: "shrink-0 text-surface-fg-subtle", children: [
27
+ "(",
28
+ L(e.attrs.size),
29
+ ")"
30
+ ] }),
31
+ /* @__PURE__ */ i(x, { icon: A, size: "sm", className: "shrink-0 text-surface-fg-subtle" })
32
+ ]
33
+ }
34
+ ) });
35
+ }
36
+ const O = v.create({
37
+ name: "fileAttachment",
38
+ group: "block",
39
+ atom: !0,
40
+ addAttributes() {
41
+ return {
42
+ url: { default: null },
43
+ name: { default: "Untitled" },
44
+ size: { default: 0 }
45
+ };
46
+ },
47
+ parseHTML() {
48
+ return [{ tag: "div[data-file-attachment]" }];
49
+ },
50
+ renderHTML({ HTMLAttributes: e }) {
51
+ return ["div", N({ "data-file-attachment": "" }, e)];
52
+ },
53
+ addNodeView() {
54
+ return w(z);
55
+ }
56
+ }), E = (e) => `https://cdn.jsdelivr.net/npm/emoji-datasource-${e}@15.0.1/img/${e}/sheets-256/64.png`, f = 61, m = 61;
57
+ let y = null, c = null;
58
+ async function D(e) {
59
+ if (y === e && c) return c;
60
+ const t = await (h[e] ?? h.native)();
61
+ return c = t.default ?? t, y = e, c;
62
+ }
63
+ function W(e, r) {
64
+ const t = e.emojis[r];
65
+ if (!t) return null;
66
+ const s = t.skins[0];
67
+ return s ? {
68
+ id: t.id,
69
+ name: t.name,
70
+ native: s.native,
71
+ x: s.x ?? 0,
72
+ y: s.y ?? 0
73
+ } : null;
74
+ }
75
+ function C(e, r, t = 8) {
76
+ const s = Object.values(e.emojis);
77
+ if (!r)
78
+ return s.slice(0, t).map((n) => ({
79
+ id: n.id,
80
+ name: n.name,
81
+ native: n.skins[0]?.native ?? "",
82
+ x: n.skins[0]?.x ?? 0,
83
+ y: n.skins[0]?.y ?? 0
84
+ }));
85
+ const a = r.toLowerCase(), o = [];
86
+ for (const n of s) {
87
+ if (o.length >= t) break;
88
+ (n.id.includes(a) || n.name.toLowerCase().includes(a) || n.keywords?.some((l) => l.includes(a))) && o.push({
89
+ id: n.id,
90
+ name: n.name,
91
+ native: n.skins[0]?.native ?? "",
92
+ x: n.skins[0]?.x ?? 0,
93
+ y: n.skins[0]?.y ?? 0
94
+ });
95
+ }
96
+ return o;
97
+ }
98
+ function H({ node: e }) {
99
+ const { native: r, set: t, x: s, y: a } = e.attrs;
100
+ if (t === "native")
101
+ return /* @__PURE__ */ i(g, { as: "span", className: "inline", children: /* @__PURE__ */ i("span", { children: r }) });
102
+ const o = `${100 * f}% ${100 * m}%`, n = `${100 / (f - 1) * s}% ${100 / (m - 1) * a}%`;
103
+ return /* @__PURE__ */ i(g, { as: "span", className: "inline", children: /* @__PURE__ */ i(
104
+ "span",
105
+ {
106
+ role: "img",
107
+ "aria-label": r,
108
+ className: "inline-block h-[1.2em] w-[1.2em] align-text-bottom",
109
+ style: {
110
+ backgroundImage: `url(${E(t)})`,
111
+ backgroundSize: o,
112
+ backgroundPosition: n
113
+ }
114
+ }
115
+ ) });
116
+ }
117
+ const q = v.create({
118
+ name: "emojiNode",
119
+ group: "inline",
120
+ inline: !0,
121
+ atom: !0,
122
+ selectable: !1,
123
+ addAttributes() {
124
+ return {
125
+ id: { default: null },
126
+ native: { default: null },
127
+ set: { default: "native" },
128
+ x: { default: 0 },
129
+ y: { default: 0 }
130
+ };
131
+ },
132
+ renderText({ node: e }) {
133
+ return e.attrs.native ?? "";
134
+ },
135
+ parseHTML() {
136
+ return [{
137
+ tag: "span[data-emoji-id]",
138
+ getAttrs: (e) => {
139
+ const r = e;
140
+ return {
141
+ id: r.getAttribute("data-emoji-id"),
142
+ set: r.getAttribute("data-emoji-set") ?? "native",
143
+ x: parseInt(r.getAttribute("data-emoji-x") ?? "0", 10),
144
+ y: parseInt(r.getAttribute("data-emoji-y") ?? "0", 10),
145
+ native: r.textContent ?? ""
146
+ };
147
+ }
148
+ }];
149
+ },
150
+ renderHTML({ node: e }) {
151
+ return ["span", {
152
+ "data-emoji-id": e.attrs.id,
153
+ "data-emoji-set": e.attrs.set,
154
+ "data-emoji-x": e.attrs.x,
155
+ "data-emoji-y": e.attrs.y,
156
+ role: "img",
157
+ "aria-label": e.attrs.native
158
+ }, e.attrs.native ?? ""];
159
+ },
160
+ addNodeView() {
161
+ return w(H);
162
+ }
163
+ });
164
+ function K({ emoji: e, set: r, size: t = "1.2em" }) {
165
+ return r === "native" ? /* @__PURE__ */ i("span", { style: { fontSize: t }, children: e.native }) : /* @__PURE__ */ i(
166
+ "span",
167
+ {
168
+ role: "img",
169
+ "aria-label": e.native,
170
+ className: "inline-block",
171
+ style: {
172
+ width: t,
173
+ height: t,
174
+ backgroundImage: `url(${E(r)})`,
175
+ backgroundSize: `${100 * f}% ${100 * m}%`,
176
+ backgroundPosition: `${100 / (f - 1) * e.x}% ${100 / (m - 1) * e.y}%`
177
+ }
178
+ }
179
+ );
180
+ }
181
+ const p = d.forwardRef(
182
+ ({ items: e, set: r, command: t }, s) => {
183
+ const [a, o] = d.useState(0);
184
+ return d.useEffect(() => o(0), [e]), d.useImperativeHandle(s, () => ({
185
+ onKeyDown: ({ event: n }) => n.key === "ArrowUp" ? (o((l) => (l + e.length - 1) % e.length), !0) : n.key === "ArrowDown" ? (o((l) => (l + 1) % e.length), !0) : n.key === "Enter" ? (e[a] && t(e[a]), !0) : !1
186
+ })), e.length ? /* @__PURE__ */ i("div", { role: "listbox", "aria-label": "Emoji suggestions", className: "z-popover max-h-[200px] overflow-x-hidden overflow-y-auto rounded-ds-md border border-surface-border-strong bg-surface-overlay shadow-raised-hover", children: e.map((n, l) => /* @__PURE__ */ u(
187
+ "button",
188
+ {
189
+ type: "button",
190
+ role: "option",
191
+ "aria-selected": l === a,
192
+ onClick: () => t(n),
193
+ className: k(
194
+ "flex w-full items-center gap-ds-03 px-ds-04 py-ds-02b text-left text-ds-sm",
195
+ l === a ? "bg-surface-raised text-surface-fg" : "text-surface-fg-muted hover:bg-surface-raised"
196
+ ),
197
+ children: [
198
+ /* @__PURE__ */ i(K, { emoji: n, set: r, size: "1.25em" }),
199
+ /* @__PURE__ */ u("span", { className: "truncate", children: [
200
+ ":",
201
+ n.id,
202
+ ":"
203
+ ] })
204
+ ]
205
+ },
206
+ n.id
207
+ )) }) : null;
208
+ }
209
+ );
210
+ p.displayName = "EmojiList";
211
+ function T(e) {
212
+ return () => {
213
+ let r = null, t = null, s = null;
214
+ return {
215
+ onStart: (a) => {
216
+ t = document.createElement("div"), t.style.position = "absolute", t.style.zIndex = "1400";
217
+ const o = a.clientRect?.();
218
+ o && (t.style.left = `${o.left}px`, t.style.top = `${o.bottom + 4}px`), document.body.appendChild(t), r = j(t), r.render(
219
+ /* @__PURE__ */ i(
220
+ p,
221
+ {
222
+ ref: (n) => {
223
+ s = n;
224
+ },
225
+ items: a.items,
226
+ set: e,
227
+ command: (n) => a.command(n)
228
+ }
229
+ )
230
+ );
231
+ },
232
+ onUpdate: (a) => {
233
+ if (!r || !t) return;
234
+ const o = a.clientRect?.();
235
+ o && (t.style.left = `${o.left}px`, t.style.top = `${o.bottom + 4}px`), r.render(
236
+ /* @__PURE__ */ i(
237
+ p,
238
+ {
239
+ ref: (n) => {
240
+ s = n;
241
+ },
242
+ items: a.items,
243
+ set: e,
244
+ command: (n) => a.command(n)
245
+ }
246
+ )
247
+ );
248
+ },
249
+ onKeyDown: (a) => a.event.key === "Escape" ? (t && (r?.unmount(), t.remove(), t = null, r = null), !0) : s?.onKeyDown(a) ?? !1,
250
+ onExit: () => {
251
+ t && (r?.unmount(), t.remove(), t = null, r = null);
252
+ }
253
+ };
254
+ };
255
+ }
256
+ function G(e = "native") {
257
+ return $.create({
258
+ name: "emojiSuggestion",
259
+ addProseMirrorPlugins() {
260
+ return [
261
+ S({
262
+ pluginKey: new R("emojiSuggestion"),
263
+ editor: this.editor,
264
+ char: ":",
265
+ items: async ({ query: r }) => {
266
+ const t = await D(e);
267
+ return C(t, r, 8);
268
+ },
269
+ command: ({ editor: r, range: t, props: s }) => {
270
+ const a = s;
271
+ r.chain().focus().deleteRange(t).insertContent({
272
+ type: "emojiNode",
273
+ attrs: { id: a.id, native: a.native, set: e, x: a.x, y: a.y }
274
+ }).run();
275
+ },
276
+ render: T(e)
277
+ })
278
+ ];
279
+ }
280
+ });
281
+ }
282
+ const b = d.forwardRef(
283
+ ({ items: e, command: r }, t) => {
284
+ const [s, a] = d.useState(0);
285
+ return d.useEffect(() => a(0), [e]), d.useImperativeHandle(t, () => ({
286
+ onKeyDown: ({ event: o }) => o.key === "ArrowUp" ? (a((n) => (n + e.length - 1) % e.length), !0) : o.key === "ArrowDown" ? (a((n) => (n + 1) % e.length), !0) : o.key === "Enter" ? (e[s] && r(e[s]), !0) : !1
287
+ })), e.length ? /* @__PURE__ */ i("div", { role: "listbox", "aria-label": "Mention suggestions", className: "z-popover overflow-hidden rounded-ds-md border border-surface-border-strong bg-surface-overlay shadow-raised-hover", children: e.map((o, n) => /* @__PURE__ */ u(
288
+ "button",
289
+ {
290
+ type: "button",
291
+ role: "option",
292
+ "aria-selected": n === s,
293
+ onClick: () => r(o),
294
+ className: k(
295
+ "flex w-full items-center gap-ds-03 px-ds-04 py-ds-02b text-left text-ds-sm",
296
+ n === s ? "bg-surface-raised text-surface-fg" : "text-surface-fg-muted hover:bg-surface-raised"
297
+ ),
298
+ children: [
299
+ o.avatar ? /* @__PURE__ */ i("img", { src: o.avatar, alt: "", className: "h-ico-md w-ico-md rounded-ds-full object-cover" }) : /* @__PURE__ */ i("span", { className: "flex h-ico-md w-ico-md items-center justify-center rounded-ds-full bg-accent-2 text-[10px] font-semibold text-accent-11", children: o.label.charAt(0).toUpperCase() }),
300
+ /* @__PURE__ */ i("span", { children: o.label })
301
+ ]
302
+ },
303
+ o.id
304
+ )) }) : null;
305
+ }
306
+ );
307
+ b.displayName = "MentionList";
308
+ function J(e) {
309
+ return () => {
310
+ let r = null, t = null, s = null;
311
+ return {
312
+ onStart: (a) => {
313
+ t = document.createElement("div"), t.style.position = "absolute", t.style.zIndex = "1400";
314
+ const o = a.clientRect?.();
315
+ o && (t.style.left = `${o.left}px`, t.style.top = `${o.bottom + 4}px`), document.body.appendChild(t), r = j(t), r.render(
316
+ /* @__PURE__ */ i(
317
+ b,
318
+ {
319
+ ref: (n) => {
320
+ s = n;
321
+ },
322
+ items: a.items,
323
+ command: (n) => {
324
+ a.command({ id: n.id, label: n.label }), e?.(n);
325
+ }
326
+ }
327
+ )
328
+ );
329
+ },
330
+ onUpdate: (a) => {
331
+ if (!r || !t) return;
332
+ const o = a.clientRect?.();
333
+ o && (t.style.left = `${o.left}px`, t.style.top = `${o.bottom + 4}px`), r.render(
334
+ /* @__PURE__ */ i(
335
+ b,
336
+ {
337
+ ref: (n) => {
338
+ s = n;
339
+ },
340
+ items: a.items,
341
+ command: (n) => {
342
+ a.command({ id: n.id, label: n.label }), e?.(n);
343
+ }
344
+ }
345
+ )
346
+ );
347
+ },
348
+ onKeyDown: (a) => a.event.key === "Escape" ? (t && (r?.unmount(), t.remove(), t = null, r = null), !0) : s?.onKeyDown(a) ?? !1,
349
+ onExit: () => {
350
+ t && (r?.unmount(), t.remove(), t = null, r = null);
351
+ }
352
+ };
353
+ };
354
+ }
355
+ export {
356
+ q as E,
357
+ O as F,
358
+ J as a,
359
+ W as b,
360
+ G as c,
361
+ D as l
362
+ };
@@ -6331,118 +6331,118 @@ function It(e) {
6331
6331
  }
6332
6332
  var lh = ol, uh = al, dh = cl, ph = ll, fh = ul, vh = dl, mh = pl, gh = vl;
6333
6333
  export {
6334
- Ym as $,
6334
+ Qm as $,
6335
6335
  vm as A,
6336
- $m as B,
6336
+ Fm as B,
6337
6337
  cm as C,
6338
6338
  hm as D,
6339
- Fm as E,
6339
+ km as E,
6340
6340
  Rm as F,
6341
6341
  Nm as G,
6342
6342
  sm as H,
6343
6343
  am as I,
6344
- km as J,
6345
- Mm as K,
6344
+ Mm as J,
6345
+ xm as K,
6346
6346
  Am as L,
6347
- xm as M,
6348
- Gm as N,
6347
+ Gm as M,
6348
+ tg as N,
6349
6349
  pm as O,
6350
6350
  dm as P,
6351
- tg as Q,
6351
+ og as Q,
6352
6352
  rm as R,
6353
6353
  om as S,
6354
6354
  im as T,
6355
- og as U,
6356
- Hm as V,
6357
- Wm as W,
6358
- Xm as X,
6359
- jm as Y,
6360
- Jm as Z,
6361
- Zm as _,
6355
+ Hm as U,
6356
+ Wm as V,
6357
+ Xm as W,
6358
+ jm as X,
6359
+ Jm as Y,
6360
+ Zm as Z,
6361
+ Ym as _,
6362
6362
  fm as a,
6363
- Zg as a$,
6364
- Qm as a0,
6365
- Um as a1,
6366
- Vm as a2,
6367
- zm as a3,
6368
- qm as a4,
6369
- eg as a5,
6370
- $u as a6,
6371
- ku as a7,
6372
- Lu as a8,
6373
- Fr as a9,
6374
- Mg as aA,
6375
- vg as aB,
6376
- gg as aC,
6377
- Rg as aD,
6378
- Ig as aE,
6379
- Tg as aF,
6380
- Ng as aG,
6381
- Ag as aH,
6382
- Dg as aI,
6383
- Og as aJ,
6384
- kg as aK,
6385
- Bg as aL,
6386
- Vg as aM,
6387
- Kg as aN,
6388
- Fg as aO,
6389
- Gg as aP,
6390
- $g as aQ,
6391
- Lg as aR,
6392
- Ug as aS,
6393
- Hg as aT,
6394
- Wg as aU,
6395
- zg as aV,
6396
- Yg as aW,
6397
- jg as aX,
6398
- ih as aY,
6399
- ch as aZ,
6400
- qg as a_,
6401
- Fu as aa,
6402
- Gu as ab,
6403
- Du as ac,
6404
- Ou as ad,
6405
- ag as ae,
6406
- sg as af,
6407
- rg as ag,
6408
- ng as ah,
6409
- ig as ai,
6410
- cg as aj,
6411
- lg as ak,
6412
- ug as al,
6413
- dg as am,
6414
- pg as an,
6415
- fg as ao,
6416
- mg as ap,
6417
- hg as aq,
6418
- _g as ar,
6419
- xg as as,
6420
- Cg as at,
6421
- bg as au,
6422
- wg as av,
6423
- yg as aw,
6424
- Sg as ax,
6425
- Eg as ay,
6426
- Pg as az,
6363
+ eh as a$,
6364
+ Um as a0,
6365
+ Vm as a1,
6366
+ zm as a2,
6367
+ qm as a3,
6368
+ eg as a4,
6369
+ $u as a5,
6370
+ ku as a6,
6371
+ Lu as a7,
6372
+ Fr as a8,
6373
+ Fu as a9,
6374
+ vg as aA,
6375
+ gg as aB,
6376
+ Rg as aC,
6377
+ Ig as aD,
6378
+ Tg as aE,
6379
+ Ng as aF,
6380
+ Ag as aG,
6381
+ Dg as aH,
6382
+ Og as aI,
6383
+ kg as aJ,
6384
+ Bg as aK,
6385
+ Vg as aL,
6386
+ Kg as aM,
6387
+ Fg as aN,
6388
+ Gg as aO,
6389
+ $g as aP,
6390
+ Lg as aQ,
6391
+ Ug as aR,
6392
+ Hg as aS,
6393
+ Wg as aT,
6394
+ zg as aU,
6395
+ Yg as aV,
6396
+ jg as aW,
6397
+ ih as aX,
6398
+ ch as aY,
6399
+ qg as aZ,
6400
+ Zg as a_,
6401
+ Gu as aa,
6402
+ Du as ab,
6403
+ Ou as ac,
6404
+ ag as ad,
6405
+ sg as ae,
6406
+ rg as af,
6407
+ ng as ag,
6408
+ ig as ah,
6409
+ cg as ai,
6410
+ lg as aj,
6411
+ ug as ak,
6412
+ dg as al,
6413
+ pg as am,
6414
+ fg as an,
6415
+ mg as ao,
6416
+ hg as ap,
6417
+ _g as aq,
6418
+ xg as ar,
6419
+ Cg as as,
6420
+ bg as at,
6421
+ wg as au,
6422
+ yg as av,
6423
+ Sg as aw,
6424
+ Eg as ax,
6425
+ Pg as ay,
6426
+ Mg as az,
6427
6427
  gm as b,
6428
- eh as b0,
6429
- th as b1,
6430
- rh as b2,
6431
- nh as b3,
6432
- Qg as b4,
6433
- ah as b5,
6434
- Jg as b6,
6435
- oh as b7,
6436
- Xg as b8,
6437
- sh as b9,
6438
- lh as ba,
6439
- uh as bb,
6440
- ph as bc,
6441
- mh as bd,
6442
- gh as be,
6443
- vh as bf,
6444
- dh as bg,
6445
- fh as bh,
6428
+ th as b0,
6429
+ rh as b1,
6430
+ nh as b2,
6431
+ Qg as b3,
6432
+ ah as b4,
6433
+ Jg as b5,
6434
+ oh as b6,
6435
+ Xg as b7,
6436
+ sh as b8,
6437
+ lh as b9,
6438
+ uh as ba,
6439
+ ph as bb,
6440
+ mh as bc,
6441
+ gh as bd,
6442
+ vh as be,
6443
+ dh as bf,
6444
+ fh as bg,
6445
+ Sm as bh,
6446
6446
  mm as c,
6447
6447
  lm as d,
6448
6448
  um as e,
@@ -6455,16 +6455,16 @@ export {
6455
6455
  ql as l,
6456
6456
  Xl as m,
6457
6457
  jl as n,
6458
- Em as o,
6459
- _m as p,
6460
- Pm as q,
6461
- ym as r,
6462
- Sm as s,
6463
- Km as t,
6464
- Bm as u,
6465
- Im as v,
6466
- Tm as w,
6467
- Dm as x,
6468
- Om as y,
6469
- Lm as z
6458
+ ym as o,
6459
+ Pm as p,
6460
+ Em as q,
6461
+ _m as r,
6462
+ Km as s,
6463
+ Bm as t,
6464
+ Im as u,
6465
+ Tm as v,
6466
+ Dm as w,
6467
+ Om as x,
6468
+ Lm as y,
6469
+ $m as z
6470
6470
  };