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