@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.
- package/dist/_chunks/avatar.js +50 -0
- package/dist/_chunks/button.js +95 -0
- package/dist/_chunks/card.js +40 -0
- package/dist/_chunks/checkbox.js +14 -0
- package/dist/_chunks/form.js +27 -0
- package/dist/_chunks/primitives.js +6965 -0
- package/dist/_chunks/sidebar.js +592 -0
- package/dist/_chunks/spinner.js +34 -0
- package/dist/_chunks/tiptap.js +15254 -0
- package/dist/_chunks/tooltip.js +13 -0
- package/dist/_chunks/tree-view.js +304 -0
- package/dist/_chunks/use-calendar.js +990 -0
- package/dist/_chunks/utils.js +15 -0
- package/dist/_chunks/vendor-client.js +1835 -0
- package/dist/_chunks/vendor-utils.js +3995 -0
- package/dist/composed/avatar-group.js +20 -20
- package/dist/composed/command-palette.js +1 -1
- package/dist/composed/confirm-dialog.js +5 -5
- package/dist/composed/content-card.d.ts +1 -1
- package/dist/composed/content-card.js +2 -2
- package/dist/composed/date-picker/index.js +13 -0
- package/dist/composed/empty-state.js +10 -10
- package/dist/composed/error-boundary.js +2 -2
- package/dist/composed/global-loading.js +4 -4
- package/dist/composed/index.js +45 -53
- package/dist/composed/loading-skeleton.js +2 -2
- package/dist/composed/member-picker.js +5 -5
- package/dist/composed/page-header.js +4 -4
- package/dist/composed/page-skeletons.js +1 -1
- package/dist/composed/priority-indicator.js +6 -6
- package/dist/composed/rich-text-editor.js +422 -209
- package/dist/composed/schedule-view.js +1 -1
- package/dist/composed/simple-tooltip.js +6 -6
- package/dist/composed/status-badge.d.ts +1 -1
- package/dist/composed/status-badge.js +2 -2
- package/dist/shell/bottom-navbar.js +1 -1
- package/dist/shell/notification-center.js +2 -2
- package/dist/shell/notification-preferences.js +32 -33
- package/dist/shell/sidebar.js +24 -24
- package/dist/shell/top-bar.js +22 -22
- package/dist/ui/accordion.js +17 -17
- package/dist/ui/alert-dialog.js +29 -29
- package/dist/ui/alert.d.ts +2 -2
- package/dist/ui/alert.js +65 -44
- package/dist/ui/aspect-ratio.js +1 -1
- package/dist/ui/autocomplete.js +11 -11
- package/dist/ui/avatar.d.ts +1 -1
- package/dist/ui/avatar.js +67 -25
- package/dist/ui/badge.d.ts +2 -2
- package/dist/ui/badge.js +115 -91
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/banner.js +2 -2
- package/dist/ui/breadcrumb.js +14 -14
- package/dist/ui/button-group.js +30 -15
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.js +114 -71
- package/dist/ui/card.js +66 -22
- package/dist/ui/charts/index.js +1221 -18
- package/dist/ui/checkbox.js +25 -5
- package/dist/ui/chip.d.ts +4 -4
- package/dist/ui/chip.js +2 -2
- package/dist/ui/code.js +1 -1
- package/dist/ui/collapsible.js +5 -5
- package/dist/ui/color-input.js +11 -11
- package/dist/ui/combobox.js +12 -12
- package/dist/ui/container.js +4 -4
- package/dist/ui/context-menu.js +37 -37
- package/dist/ui/data-table-toolbar.js +18 -18
- package/dist/ui/data-table.js +2 -2
- package/dist/ui/dialog.js +33 -33
- package/dist/ui/dropdown-menu.js +60 -60
- package/dist/ui/file-upload.js +1 -1
- package/dist/ui/form.js +36 -15
- package/dist/ui/hover-card.js +7 -7
- package/dist/ui/icon-button.js +9 -9
- package/dist/ui/index.js +523 -325
- package/dist/ui/input-otp.d.ts +2 -2
- package/dist/ui/input-otp.js +14 -14
- package/dist/ui/input.js +56 -28
- package/dist/ui/label.js +18 -4
- package/dist/ui/lib/utils.js +4 -5
- package/dist/ui/link.js +9 -9
- package/dist/ui/menubar.js +81 -81
- package/dist/ui/navigation-menu.js +42 -42
- package/dist/ui/number-input.js +13 -13
- package/dist/ui/pagination.js +5 -5
- package/dist/ui/popover.js +9 -9
- package/dist/ui/progress.d.ts +1 -1
- package/dist/ui/progress.js +15 -15
- package/dist/ui/radio.js +10 -10
- package/dist/ui/search-input.js +5 -5
- package/dist/ui/segmented-control.js +91 -83
- package/dist/ui/select.js +52 -52
- package/dist/ui/separator.js +20 -5
- package/dist/ui/sheet.js +28 -28
- package/dist/ui/sidebar.js +36 -560
- package/dist/ui/skeleton.d.ts +1 -1
- package/dist/ui/skeleton.js +7 -7
- package/dist/ui/slider.js +11 -11
- package/dist/ui/spinner.js +37 -2
- package/dist/ui/stack.js +1 -1
- package/dist/ui/stat-card.js +1 -1
- package/dist/ui/stepper.js +15 -15
- package/dist/ui/switch.js +22 -3
- package/dist/ui/table.js +1 -1
- package/dist/ui/tabs.js +59 -32
- package/dist/ui/text.js +2 -2
- package/dist/ui/textarea.js +7 -7
- package/dist/ui/toast.d.ts +1 -1
- package/dist/ui/toast.js +28 -28
- package/dist/ui/toggle-group.js +11 -11
- package/dist/ui/toggle.js +7 -7
- package/dist/ui/tooltip.js +17 -6
- package/dist/ui/transitions.js +68 -58
- package/dist/ui/tree-view/index.js +7 -0
- package/dist/ui/visually-hidden.js +3 -3
- package/llms-full.txt +1 -1
- package/llms.txt +7 -0
- package/package.json +656 -706
- package/dist/_virtual/client.js +0 -5
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/react-dom-client.development.js +0 -5
- package/dist/_virtual/react-dom-client.production.js +0 -5
- package/dist/_virtual/scheduler.development.js +0 -5
- package/dist/_virtual/scheduler.production.js +0 -5
- package/dist/composed/date-picker/calendar-grid.js +0 -194
- package/dist/composed/date-picker/date-picker.js +0 -124
- package/dist/composed/date-picker/date-range-picker.js +0 -167
- package/dist/composed/date-picker/date-time-picker.js +0 -193
- package/dist/composed/date-picker/month-picker.js +0 -53
- package/dist/composed/date-picker/presets.js +0 -84
- package/dist/composed/date-picker/time-picker.js +0 -181
- package/dist/composed/date-picker/use-calendar.js +0 -17
- package/dist/composed/date-picker/year-picker.js +0 -45
- package/dist/composed/extensions/emoji-suggestion.js +0 -119
- package/dist/composed/extensions/file-attachment.js +0 -55
- package/dist/composed/extensions/mention-suggestion.js +0 -79
- package/dist/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js +0 -40141
- 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
- package/dist/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js +0 -2958
- 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
- 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
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +0 -20
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +0 -237
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +0 -234
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +0 -11
- package/dist/primitives/_internal/number.js +0 -6
- package/dist/primitives/_internal/primitive.js +0 -9
- package/dist/primitives/_internal/react-arrow.js +0 -13
- package/dist/primitives/_internal/react-collection.js +0 -48
- package/dist/primitives/_internal/react-compose-refs.js +0 -29
- package/dist/primitives/_internal/react-context.js +0 -76
- package/dist/primitives/_internal/react-direction.js +0 -10
- package/dist/primitives/_internal/react-dismissable-layer.js +0 -103
- package/dist/primitives/_internal/react-focus-guards.js +0 -17
- package/dist/primitives/_internal/react-focus-scope.js +0 -137
- package/dist/primitives/_internal/react-id.js +0 -14
- package/dist/primitives/_internal/react-popper.js +0 -137
- package/dist/primitives/_internal/react-portal.js +0 -16
- package/dist/primitives/_internal/react-presence.js +0 -71
- package/dist/primitives/_internal/react-primitive.js +0 -36
- package/dist/primitives/_internal/react-use-callback-ref.js +0 -13
- package/dist/primitives/_internal/react-use-controllable-state.js +0 -44
- package/dist/primitives/_internal/react-use-escape-keydown.js +0 -14
- package/dist/primitives/_internal/react-use-is-hydrated.js +0 -15
- package/dist/primitives/_internal/react-use-layout-effect.js +0 -6
- package/dist/primitives/_internal/react-use-previous.js +0 -8
- package/dist/primitives/_internal/react-use-size.js +0 -27
- package/dist/primitives/react-accordion.js +0 -239
- package/dist/primitives/react-alert-dialog.js +0 -127
- package/dist/primitives/react-aspect-ratio.js +0 -43
- package/dist/primitives/react-avatar.js +0 -75
- package/dist/primitives/react-checkbox.js +0 -251
- package/dist/primitives/react-collapsible.js +0 -120
- package/dist/primitives/react-context-menu.js +0 -240
- package/dist/primitives/react-dialog.js +0 -262
- package/dist/primitives/react-dropdown-menu.js +0 -227
- package/dist/primitives/react-hover-card.js +0 -187
- package/dist/primitives/react-label.js +0 -20
- package/dist/primitives/react-menu.js +0 -652
- package/dist/primitives/react-menubar.js +0 -355
- package/dist/primitives/react-navigation-menu.js +0 -607
- package/dist/primitives/react-popover.js +0 -243
- package/dist/primitives/react-progress.js +0 -84
- package/dist/primitives/react-radio-group.js +0 -238
- package/dist/primitives/react-roving-focus.js +0 -183
- package/dist/primitives/react-select.js +0 -862
- package/dist/primitives/react-separator.js +0 -24
- package/dist/primitives/react-slider.js +0 -437
- package/dist/primitives/react-slot.js +0 -70
- package/dist/primitives/react-switch.js +0 -132
- package/dist/primitives/react-tabs.js +0 -163
- package/dist/primitives/react-toast.js +0 -446
- package/dist/primitives/react-toggle-group.js +0 -137
- package/dist/primitives/react-toggle.js +0 -33
- package/dist/primitives/react-tooltip.js +0 -338
- package/dist/primitives/react-visually-hidden.js +0 -32
- package/dist/ui/charts/_internal/animation.js +0 -18
- package/dist/ui/charts/_internal/axes.js +0 -42
- package/dist/ui/charts/_internal/colors.js +0 -21
- package/dist/ui/charts/_internal/grid-lines.js +0 -43
- package/dist/ui/charts/_internal/legend.js +0 -29
- package/dist/ui/charts/_internal/tooltip.js +0 -39
- package/dist/ui/charts/_internal/types.js +0 -10
- package/dist/ui/charts/area-chart.js +0 -245
- package/dist/ui/charts/bar-chart.js +0 -153
- package/dist/ui/charts/chart-container.js +0 -27
- package/dist/ui/charts/gauge-chart.js +0 -72
- package/dist/ui/charts/line-chart.js +0 -163
- package/dist/ui/charts/pie-chart.js +0 -132
- package/dist/ui/charts/radar-chart.js +0 -223
- package/dist/ui/charts/sparkline.js +0 -124
- package/dist/ui/lib/motion.js +0 -32
- package/dist/ui/lib/use-reduced-motion.js +0 -15
- package/dist/ui/lib/use-ripple.js +0 -14
- package/dist/ui/tree-view/tree-item.js +0 -139
- package/dist/ui/tree-view/tree-view.js +0 -140
- package/dist/ui/tree-view/use-tree.js +0 -38
|
@@ -1,24 +1,237 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
3
3
|
import * as c from "react";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
41
|
-
onClick:
|
|
253
|
+
function u({
|
|
254
|
+
onClick: e,
|
|
42
255
|
isActive: n = !1,
|
|
43
|
-
disabled:
|
|
44
|
-
title:
|
|
45
|
-
children:
|
|
256
|
+
disabled: s = !1,
|
|
257
|
+
title: i,
|
|
258
|
+
children: l
|
|
46
259
|
}) {
|
|
47
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ t(
|
|
48
261
|
"button",
|
|
49
262
|
{
|
|
50
263
|
type: "button",
|
|
51
|
-
onClick:
|
|
52
|
-
disabled:
|
|
53
|
-
title:
|
|
264
|
+
onClick: e,
|
|
265
|
+
disabled: s,
|
|
266
|
+
title: i,
|
|
54
267
|
"aria-pressed": n,
|
|
55
|
-
className:
|
|
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:
|
|
274
|
+
children: l
|
|
62
275
|
}
|
|
63
276
|
);
|
|
64
277
|
}
|
|
65
|
-
function
|
|
66
|
-
const [n,
|
|
67
|
-
if (
|
|
68
|
-
|
|
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
|
|
72
|
-
|
|
73
|
-
var
|
|
74
|
-
return (
|
|
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
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
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__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
n && /* @__PURE__ */
|
|
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:
|
|
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__ */
|
|
303
|
+
/* @__PURE__ */ t(
|
|
91
304
|
"input",
|
|
92
305
|
{
|
|
93
|
-
ref:
|
|
306
|
+
ref: r,
|
|
94
307
|
type: "url",
|
|
95
|
-
value:
|
|
96
|
-
onChange: (
|
|
97
|
-
onKeyDown:
|
|
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__ */
|
|
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
|
|
109
|
-
return /* @__PURE__ */
|
|
321
|
+
function k() {
|
|
322
|
+
return /* @__PURE__ */ t("div", { className: "mx-ds-02 h-[16px] w-px bg-border" });
|
|
110
323
|
}
|
|
111
|
-
function
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
n && /* @__PURE__ */
|
|
130
|
-
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
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
|
|
143
|
-
function
|
|
144
|
-
const [n,
|
|
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("
|
|
359
|
+
import("@emoji-mart/data").then((r) => s(r.default));
|
|
147
360
|
}, []);
|
|
148
|
-
const
|
|
149
|
-
return n ? /* @__PURE__ */
|
|
150
|
-
|
|
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: (
|
|
154
|
-
theme:
|
|
366
|
+
onEmojiSelect: (r) => e(r.native),
|
|
367
|
+
theme: i === "dark" ? "dark" : "light",
|
|
155
368
|
previewPosition: "none",
|
|
156
369
|
skinTonePosition: "none"
|
|
157
370
|
}
|
|
158
|
-
) }) :
|
|
371
|
+
) }) : l;
|
|
159
372
|
}
|
|
160
|
-
const
|
|
373
|
+
const Pe = c.forwardRef(
|
|
161
374
|
function({
|
|
162
375
|
content: n = "",
|
|
163
|
-
placeholder:
|
|
164
|
-
onChange:
|
|
165
|
-
className:
|
|
166
|
-
editable:
|
|
167
|
-
onImageUpload:
|
|
168
|
-
onFileUpload:
|
|
169
|
-
mentions:
|
|
170
|
-
onMentionSearch:
|
|
171
|
-
onMentionSelect:
|
|
172
|
-
},
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
178
|
-
|
|
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
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
},
|
|
393
|
+
const d = new FileReader();
|
|
394
|
+
d.onload = () => {
|
|
395
|
+
m.chain().focus().setImage({ src: d.result }).run();
|
|
396
|
+
}, d.readAsDataURL(a);
|
|
184
397
|
}
|
|
185
|
-
},
|
|
186
|
-
const
|
|
187
|
-
if (!
|
|
188
|
-
const
|
|
189
|
-
|
|
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:
|
|
404
|
+
attrs: { url: d.url, name: d.name, size: d.size }
|
|
192
405
|
}).run();
|
|
193
|
-
},
|
|
406
|
+
}, h = M({
|
|
194
407
|
extensions: [
|
|
195
|
-
|
|
408
|
+
P.configure({
|
|
196
409
|
heading: { levels: [2, 3] }
|
|
197
410
|
}),
|
|
198
|
-
|
|
199
|
-
placeholder:
|
|
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
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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: (
|
|
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
|
-
|
|
429
|
+
O.configure({
|
|
217
430
|
allowBase64: !0,
|
|
218
431
|
HTMLAttributes: {
|
|
219
432
|
class: "max-w-full rounded-ds-md"
|
|
220
433
|
}
|
|
221
434
|
}),
|
|
222
|
-
|
|
223
|
-
...
|
|
224
|
-
|
|
435
|
+
W,
|
|
436
|
+
...x || f ? [
|
|
437
|
+
V.configure({
|
|
225
438
|
HTMLAttributes: { class: "mention" },
|
|
226
439
|
suggestion: {
|
|
227
|
-
items: async ({ query:
|
|
228
|
-
render:
|
|
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
|
-
|
|
445
|
+
He
|
|
233
446
|
],
|
|
234
447
|
content: n,
|
|
235
|
-
editable:
|
|
448
|
+
editable: r,
|
|
236
449
|
editorProps: {
|
|
237
|
-
handleDrop: (
|
|
238
|
-
var
|
|
239
|
-
if (w || !((
|
|
240
|
-
const
|
|
241
|
-
return
|
|
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: (
|
|
456
|
+
handlePaste: (a, m) => {
|
|
244
457
|
var w;
|
|
245
|
-
const
|
|
246
|
-
return
|
|
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:
|
|
250
|
-
...
|
|
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:
|
|
257
|
-
|
|
469
|
+
onUpdate: ({ editor: a }) => {
|
|
470
|
+
i == null || i(a.getHTML());
|
|
258
471
|
}
|
|
259
472
|
});
|
|
260
473
|
return c.useEffect(() => {
|
|
261
|
-
|
|
262
|
-
}, [
|
|
474
|
+
N.current = h;
|
|
475
|
+
}, [h]), c.useEffect(() => {
|
|
263
476
|
if (!I) return;
|
|
264
|
-
const
|
|
265
|
-
|
|
477
|
+
const a = (m) => {
|
|
478
|
+
L.current && !L.current.contains(m.target) && v(!1);
|
|
266
479
|
};
|
|
267
|
-
return document.addEventListener("mousedown",
|
|
480
|
+
return document.addEventListener("mousedown", a), () => document.removeEventListener("mousedown", a);
|
|
268
481
|
}, [I]), c.useEffect(() => {
|
|
269
|
-
|
|
270
|
-
}, [
|
|
271
|
-
I && /* @__PURE__ */
|
|
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:
|
|
487
|
+
ref: L,
|
|
275
488
|
className: "absolute bottom-full right-0 z-popover mb-ds-02",
|
|
276
|
-
onKeyDown: (
|
|
277
|
-
|
|
489
|
+
onKeyDown: (a) => {
|
|
490
|
+
a.key === "Escape" && (a.stopPropagation(), v(!1));
|
|
278
491
|
},
|
|
279
|
-
children: /* @__PURE__ */
|
|
280
|
-
|
|
492
|
+
children: /* @__PURE__ */ t(
|
|
493
|
+
Be,
|
|
281
494
|
{
|
|
282
|
-
onSelect: (
|
|
283
|
-
|
|
495
|
+
onSelect: (a) => {
|
|
496
|
+
h.chain().focus().insertContent(a).run(), v(!1);
|
|
284
497
|
}
|
|
285
498
|
}
|
|
286
499
|
)
|
|
287
500
|
}
|
|
288
501
|
),
|
|
289
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ g(
|
|
290
503
|
"div",
|
|
291
504
|
{
|
|
292
|
-
className:
|
|
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__ */
|
|
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: (
|
|
306
|
-
var
|
|
307
|
-
const
|
|
308
|
-
|
|
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
|
-
|
|
525
|
+
b && /* @__PURE__ */ t(
|
|
313
526
|
"input",
|
|
314
527
|
{
|
|
315
|
-
ref:
|
|
528
|
+
ref: H,
|
|
316
529
|
type: "file",
|
|
317
530
|
"aria-label": "Upload file",
|
|
318
531
|
className: "hidden",
|
|
319
|
-
onChange: (
|
|
320
|
-
var
|
|
321
|
-
const
|
|
322
|
-
|
|
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
|
-
|
|
327
|
-
|
|
539
|
+
r && /* @__PURE__ */ t(
|
|
540
|
+
Me,
|
|
328
541
|
{
|
|
329
|
-
editor:
|
|
542
|
+
editor: h,
|
|
330
543
|
onImageClick: () => {
|
|
331
|
-
var
|
|
332
|
-
return (
|
|
544
|
+
var a;
|
|
545
|
+
return (a = T.current) == null ? void 0 : a.click();
|
|
333
546
|
},
|
|
334
|
-
onFileClick:
|
|
335
|
-
var
|
|
336
|
-
return (
|
|
547
|
+
onFileClick: b ? () => {
|
|
548
|
+
var a;
|
|
549
|
+
return (a = H.current) == null ? void 0 : a.click();
|
|
337
550
|
} : void 0,
|
|
338
|
-
onEmojiClick: () => v((
|
|
551
|
+
onEmojiClick: () => v((a) => !a)
|
|
339
552
|
}
|
|
340
553
|
),
|
|
341
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ t(q, { editor: h })
|
|
342
555
|
]
|
|
343
556
|
}
|
|
344
557
|
)
|
|
345
558
|
] }) : null;
|
|
346
559
|
}
|
|
347
560
|
);
|
|
348
|
-
|
|
349
|
-
const
|
|
350
|
-
function({ content: n, className:
|
|
351
|
-
const
|
|
561
|
+
Pe.displayName = "RichTextEditor";
|
|
562
|
+
const ze = c.forwardRef(
|
|
563
|
+
function({ content: n, className: s }, i) {
|
|
564
|
+
const l = M({
|
|
352
565
|
extensions: [
|
|
353
|
-
|
|
566
|
+
P.configure({
|
|
354
567
|
heading: { levels: [2, 3] }
|
|
355
568
|
}),
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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: (
|
|
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
|
-
|
|
583
|
+
O.configure({
|
|
371
584
|
allowBase64: !0,
|
|
372
585
|
HTMLAttributes: {
|
|
373
586
|
class: "max-w-full rounded-ds-md"
|
|
374
587
|
}
|
|
375
588
|
}),
|
|
376
|
-
|
|
377
|
-
|
|
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:
|
|
598
|
+
class: p(...G)
|
|
386
599
|
}
|
|
387
600
|
}
|
|
388
601
|
});
|
|
389
|
-
return
|
|
602
|
+
return l ? /* @__PURE__ */ t("div", { ref: i, className: s, children: /* @__PURE__ */ t(q, { editor: l }) }) : null;
|
|
390
603
|
}
|
|
391
604
|
);
|
|
392
|
-
|
|
605
|
+
ze.displayName = "RichTextViewer";
|
|
393
606
|
export {
|
|
394
|
-
|
|
395
|
-
|
|
607
|
+
Pe as RichTextEditor,
|
|
608
|
+
ze as RichTextViewer
|
|
396
609
|
};
|