@pstdio/ui 0.1.1 → 0.2.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/rich-text.js CHANGED
@@ -1,43 +1,44 @@
1
- import { jsx as o, jsxs as ge } from "react/jsx-runtime";
2
- import { c as re } from "react/compiler-runtime";
3
- import { e as Be, a as Ne, I as Pe, E as Oe, C as Fe, s as Ye, b as Ie, T as Xe, c as Qe } from "./rich-message-CNDoACE7.js";
4
- import { D as ho, d as go, R as bo, P as vo, R as xo, g as _o, f as yo } from "./rich-message-CNDoACE7.js";
5
- import { Text as U, IconButton as q, Stack as Se, Box as He, Flex as ke } from "@chakra-ui/react";
6
- import { LexicalCollaboration as Ze } from "@lexical/react/LexicalCollaborationContext";
7
- import { CollaborationPluginV2__EXPERIMENTAL as Je } from "@lexical/react/LexicalCollaborationPlugin";
8
- import { LexicalComposer as $e } from "@lexical/react/LexicalComposer";
9
- import { LexicalErrorBoundary as De } from "@lexical/react/LexicalErrorBoundary";
10
- import { HorizontalRulePlugin as ze } from "@lexical/react/LexicalHorizontalRulePlugin";
11
- import { LinkPlugin as je } from "@lexical/react/LexicalLinkPlugin";
12
- import { ListPlugin as We } from "@lexical/react/LexicalListPlugin";
13
- import { RichTextPlugin as Ue } from "@lexical/react/LexicalRichTextPlugin";
14
- import { useState as K, useRef as Le, useEffect as le } from "react";
15
- import { WebsocketProvider as et } from "y-websocket";
16
- import * as tt from "yjs";
17
- import { INSERT_UNORDERED_LIST_COMMAND as ot, REMOVE_LIST_COMMAND as Me, INSERT_ORDERED_LIST_COMMAND as nt, $isListNode as Ee } from "@lexical/list";
18
- import { useLexicalComposerContext as it } from "@lexical/react/LexicalComposerContext";
19
- import { $createHeadingNode as lt, $isHeadingNode as rt } from "@lexical/rich-text";
20
- import { $setBlocksType as qe } from "@lexical/selection";
21
- import { mergeRegister as st, $findMatchingParent as Ve } from "@lexical/utils";
22
- import { $getSelection as ie, $isRangeSelection as we, SELECTION_CHANGE_COMMAND as at, COMMAND_PRIORITY_CRITICAL as ct, CLICK_COMMAND as dt, COMMAND_PRIORITY_HIGH as mt, FORMAT_TEXT_COMMAND as Re, $createParagraphNode as ft, $isRootOrShadowRoot as pt, $getRoot as ut } from "lexical";
23
- import { createPortal as ht } from "react-dom";
24
- import { T as V } from "./tooltip-Gm7PLwZG.js";
25
- import { $convertFromMarkdownString as gt, $convertToMarkdownString as bt } from "@lexical/markdown";
26
- import { AutoFocusPlugin as vt } from "@lexical/react/LexicalAutoFocusPlugin";
27
- import { HistoryPlugin as xt } from "@lexical/react/LexicalHistoryPlugin";
28
- import { OnChangePlugin as _t } from "@lexical/react/LexicalOnChangePlugin";
29
- const yt = 10, Ct = 5;
30
- function Ae(n, e, t, i = yt, h = Ct) {
31
- const a = t.parentElement;
32
- if (n === null || !a) {
1
+ import { jsx as t, jsxs as K } from "react/jsx-runtime";
2
+ import { c as Y } from "react/compiler-runtime";
3
+ import { e as le, a as ae, I as se, E as ce, C as de, s as Te, b as oe, T as ye, c as Ee } from "./rich-message-B2gxL8oy.js";
4
+ import { D as jt, d as Wt, R as Ut, P as qt, R as Vt, g as Kt, f as Gt } from "./rich-message-B2gxL8oy.js";
5
+ import { Stack as Q, IconButton as D, Text as W, Box as me, Flex as te } from "@chakra-ui/react";
6
+ import { LexicalCollaboration as _e } from "@lexical/react/LexicalCollaborationContext";
7
+ import { CollaborationPluginV2__EXPERIMENTAL as Se } from "@lexical/react/LexicalCollaborationPlugin";
8
+ import { LexicalComposer as fe } from "@lexical/react/LexicalComposer";
9
+ import { LexicalErrorBoundary as ue } from "@lexical/react/LexicalErrorBoundary";
10
+ import { HorizontalRulePlugin as pe } from "@lexical/react/LexicalHorizontalRulePlugin";
11
+ import { LinkPlugin as he } from "@lexical/react/LexicalLinkPlugin";
12
+ import { ListPlugin as ge } from "@lexical/react/LexicalListPlugin";
13
+ import { RichTextPlugin as be } from "@lexical/react/LexicalRichTextPlugin";
14
+ import { useState as k, useRef as G, useEffect as q } from "react";
15
+ import { WebsocketProvider as we } from "y-websocket";
16
+ import * as Re from "yjs";
17
+ import { INSERT_UNORDERED_LIST_COMMAND as Le, REMOVE_LIST_COMMAND as ne, INSERT_ORDERED_LIST_COMMAND as ke, $isListNode as Z } from "@lexical/list";
18
+ import { useLexicalComposerContext as Me } from "@lexical/react/LexicalComposerContext";
19
+ import { $createHeadingNode as Ie, $isHeadingNode as Pe } from "@lexical/rich-text";
20
+ import { $setBlocksType as ie } from "@lexical/selection";
21
+ import { mergeRegister as Be, $findMatchingParent as ve } from "@lexical/utils";
22
+ import { $getSelection as U, $isRangeSelection as J, SELECTION_CHANGE_COMMAND as Ne, COMMAND_PRIORITY_CRITICAL as Ae, CLICK_COMMAND as Oe, COMMAND_PRIORITY_HIGH as Fe, FORMAT_TEXT_COMMAND as ee, $createParagraphNode as He, $isRootOrShadowRoot as De, $getRoot as ze } from "lexical";
23
+ import { List as $e, ListOrdered as je } from "lucide-react";
24
+ import { createPortal as We } from "react-dom";
25
+ import { T as z } from "./tooltip-Gm7PLwZG.js";
26
+ import { $convertFromMarkdownString as Ue, $convertToMarkdownString as qe } from "@lexical/markdown";
27
+ import { AutoFocusPlugin as Ve } from "@lexical/react/LexicalAutoFocusPlugin";
28
+ import { HistoryPlugin as Ke } from "@lexical/react/LexicalHistoryPlugin";
29
+ import { OnChangePlugin as Ge } from "@lexical/react/LexicalOnChangePlugin";
30
+ const Ye = 10, Xe = 5;
31
+ function re(o, e, n, a = Ye, c = Xe) {
32
+ const l = n.parentElement;
33
+ if (o === null || !l) {
33
34
  e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)";
34
35
  return;
35
36
  }
36
- const d = e.getBoundingClientRect(), l = t.getBoundingClientRect(), E = a.getBoundingClientRect();
37
- let w = n.top - i, R = n.left - h;
38
- w < E.top && (w += d.height + n.height + i * 2), R + d.width > E.right && (R = E.right - d.width - h), w -= l.top, R -= l.left, e.style.opacity = "1", e.style.transform = `translate(${R}px, ${w}px)`;
37
+ const s = e.getBoundingClientRect(), f = n.getBoundingClientRect(), u = l.getBoundingClientRect();
38
+ let p = o.top - a, h = o.left - c;
39
+ p < u.top && (p += s.height + o.height + a * 2), h + s.width > u.right && (h = u.right - s.width - c), p -= f.top, h -= f.left, e.style.opacity = "1", e.style.transform = `translate(${h}px, ${p}px)`;
39
40
  }
40
- const Tt = -4, St = {
41
+ const Qe = -4, Ze = {
41
42
  bullet: "Bulleted List",
42
43
  check: "Check List",
43
44
  code: "Code Block",
@@ -50,211 +51,132 @@ const Tt = -4, St = {
50
51
  number: "Numbered List",
51
52
  paragraph: "Normal",
52
53
  quote: "Quote"
53
- }, Et = (n) => n in St ? n : null, wt = (n) => (n.getKey() === "root" ? n : Ve(n, (t) => {
54
- const i = t.getParent();
55
- return i !== null && pt(i);
56
- })) ?? n.getTopLevelElementOrThrow(), Rt = (n) => {
57
- const e = wt(n);
58
- if (Ee(e))
54
+ }, Je = (o) => o in Ze ? o : null, et = (o) => (o.getKey() === "root" ? o : ve(o, (n) => {
55
+ const a = n.getParent();
56
+ return a !== null && De(a);
57
+ })) ?? o.getTopLevelElementOrThrow(), tt = (o) => {
58
+ const e = et(o);
59
+ if (Z(e))
59
60
  return e.getListType();
60
- const t = Ve(n, (h) => Ee(h));
61
- if (t !== null && Ee(t))
62
- return t.getListType();
63
- const i = rt(e) ? e.getTag() : e.getType();
64
- return Et(i);
61
+ const n = ve(o, (c) => Z(c));
62
+ if (n !== null && Z(n))
63
+ return n.getListType();
64
+ const a = Pe(e) ? e.getTag() : e.getType();
65
+ return Je(a);
65
66
  };
66
- function kt(n) {
67
- const e = re(81), {
68
- editor: t,
69
- anchorElem: i,
70
- isToolbarActive: h,
71
- setIsToolbarActive: a
72
- } = n, d = Le(null), [l, E] = K("paragraph"), [w, R] = K(!1), [g, j] = K(!1), [D, G] = K(!1);
73
- let O;
74
- e[0] !== l || e[1] !== t ? (O = (s) => {
75
- l !== s ? t.update(() => {
76
- const u = ie();
77
- qe(u, () => lt(s));
78
- }) : t.update(Lt);
79
- }, e[0] = l, e[1] = t, e[2] = O) : O = e[2];
80
- const k = O;
81
- let L;
82
- e[3] !== l || e[4] !== t ? (L = () => {
83
- l !== "bullet" ? t.dispatchCommand(ot, void 0) : t.dispatchCommand(Me, void 0);
84
- }, e[3] = l, e[4] = t, e[5] = L) : L = e[5];
85
- const W = L;
86
- let _;
87
- e[6] !== l || e[7] !== t ? (_ = () => {
88
- l !== "number" ? t.dispatchCommand(nt, void 0) : t.dispatchCommand(Me, void 0);
89
- }, e[6] = l, e[7] = t, e[8] = _) : _ = e[8];
90
- const y = _;
91
- let b;
92
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = () => {
93
- const s = ie();
94
- if (!we(s))
67
+ function ot({
68
+ editor: o,
69
+ anchorElem: e,
70
+ isToolbarActive: n,
71
+ setIsToolbarActive: a
72
+ }) {
73
+ const c = G(null), [l, s] = k("paragraph"), [f, u] = k(!1), [p, h] = k(!1), [d, M] = k(!1), g = G(() => {
74
+ }), I = (r) => {
75
+ if (l !== r) {
76
+ o.update(() => {
77
+ const i = U();
78
+ ie(i, () => Ie(r));
79
+ });
95
80
  return;
96
- R(s.hasFormat("bold")), j(s.hasFormat("italic")), G(s.hasFormat("underline"));
97
- const u = Rt(s.anchor.getNode());
98
- u && E(u);
99
- }, e[9] = b) : b = e[9];
100
- const F = b;
101
- let A;
102
- e[10] !== i || e[11] !== t || e[12] !== a ? (A = () => {
103
- const s = ie(), u = d.current, he = window.getSelection();
104
- if (u === null)
81
+ }
82
+ o.update(() => {
83
+ const i = U();
84
+ ie(i, () => He());
85
+ });
86
+ }, P = () => {
87
+ l !== "bullet" ? o.dispatchCommand(Le, void 0) : o.dispatchCommand(ne, void 0);
88
+ }, $ = () => {
89
+ l !== "number" ? o.dispatchCommand(ke, void 0) : o.dispatchCommand(ne, void 0);
90
+ }, v = () => {
91
+ const r = U();
92
+ if (!J(r)) return;
93
+ u(r.hasFormat("bold")), h(r.hasFormat("italic")), M(r.hasFormat("underline"));
94
+ const i = tt(r.anchor.getNode());
95
+ i && s(i);
96
+ };
97
+ return g.current = () => {
98
+ const r = U(), i = c.current, b = window.getSelection();
99
+ if (i === null)
105
100
  return;
106
- const Ce = t.getRootElement();
107
- if (s !== null && we(s) && !s.isCollapsed() && he !== null && !he.isCollapsed && Ce !== null && Ce.contains(he.anchorNode) && t.isEditable()) {
108
- const Te = he.getRangeAt(0).getBoundingClientRect();
109
- if (Te) {
110
- const Ge = new DOMRect(Te.left, Te.bottom, 0, 0);
111
- Ae(Ge, u, i, Tt);
101
+ const m = o.getRootElement();
102
+ if (r !== null && J(r) && !r.isCollapsed() && b !== null && !b.isCollapsed && m !== null && m.contains(b.anchorNode) && o.isEditable()) {
103
+ const x = b.getRangeAt(0).getBoundingClientRect();
104
+ if (x) {
105
+ const L = new DOMRect(x.left, x.bottom, 0, 0);
106
+ re(L, i, e, Qe);
112
107
  }
113
108
  a(!0);
114
109
  } else
115
- Ce !== null && Ae(null, u, i), a(!1);
116
- return F(), !0;
117
- }, e[10] = i, e[11] = t, e[12] = a, e[13] = A) : A = e[13];
118
- const r = A;
119
- let I, H;
120
- e[14] !== r || e[15] !== i.parentElement || e[16] !== t ? (I = () => {
121
- const s = i.parentElement, u = () => {
122
- t.getEditorState().read(() => {
123
- r();
110
+ m !== null && re(null, i, e), a(!1);
111
+ return v(), !0;
112
+ }, q(() => {
113
+ const r = e.parentElement, i = () => {
114
+ o.getEditorState().read(() => {
115
+ g.current();
124
116
  });
125
117
  };
126
- return window.addEventListener("resize", u), s && s.addEventListener("scroll", u), () => {
127
- window.removeEventListener("resize", u), s && s.removeEventListener("scroll", u);
118
+ return window.addEventListener("resize", i), r && r.addEventListener("scroll", i), () => {
119
+ window.removeEventListener("resize", i), r && r.removeEventListener("scroll", i);
128
120
  };
129
- }, H = [i.parentElement, t, r], e[14] = r, e[15] = i.parentElement, e[16] = t, e[17] = I, e[18] = H) : (I = e[17], H = e[18]), le(I, H);
130
- let M, B;
131
- e[19] !== r || e[20] !== t ? (M = () => st(t.registerUpdateListener((s) => {
132
- const {
133
- editorState: u
134
- } = s;
135
- u.read(() => {
136
- r();
121
+ }, [e, o]), q(() => Be(o.registerUpdateListener(({
122
+ editorState: r
123
+ }) => {
124
+ r.read(() => {
125
+ g.current();
137
126
  });
138
- }), t.registerCommand(at, (s) => (r(), !1), ct), t.registerCommand(dt, (s) => {
139
- const u = ie();
140
- return we(u) && r(), !1;
141
- }, mt)), B = [t, r], e[19] = r, e[20] = t, e[21] = M, e[22] = B) : (M = e[21], B = e[22]), le(M, B);
142
- const C = `floating-text-format-toolbar ${h ? "active" : ""}`, N = w || void 0;
143
- let v;
144
- e[23] !== t ? (v = () => {
145
- t.dispatchCommand(Re, "bold");
146
- }, e[23] = t, e[24] = v) : v = e[24];
147
- let x;
148
- e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ o(U, { fontWeight: "bold", fontSize: ".75rem", children: "B" }), e[25] = x) : x = e[25];
149
- let m;
150
- e[26] !== N || e[27] !== v ? (m = /* @__PURE__ */ o(V, { content: "Bold", children: /* @__PURE__ */ o(q, { "data-active": N, onClick: v, variant: "ghost", "aria-label": "Bold", size: "xs", children: x }) }), e[26] = N, e[27] = v, e[28] = m) : m = e[28];
151
- const T = g || void 0;
152
- let f;
153
- e[29] !== t ? (f = () => {
154
- t.dispatchCommand(Re, "italic");
155
- }, e[29] = t, e[30] = f) : f = e[30];
156
- let p;
157
- e[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ o(U, { fontStyle: "italic", fontSize: ".75rem", children: "I" }), e[31] = p) : p = e[31];
158
- let c;
159
- e[32] !== T || e[33] !== f ? (c = /* @__PURE__ */ o(V, { content: "Italic", children: /* @__PURE__ */ o(q, { "data-active": T, onClick: f, variant: "ghost", "aria-label": "Italic", size: "xs", children: p }) }), e[32] = T, e[33] = f, e[34] = c) : c = e[34];
160
- const S = D || void 0;
161
- let P;
162
- e[35] !== t ? (P = () => {
163
- t.dispatchCommand(Re, "underline");
164
- }, e[35] = t, e[36] = P) : P = e[36];
165
- let $;
166
- e[37] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ o(U, { textDecoration: "underline", fontSize: ".75rem", children: "U" }), e[37] = $) : $ = e[37];
167
- let z;
168
- e[38] !== S || e[39] !== P ? (z = /* @__PURE__ */ o(V, { content: "Underline", children: /* @__PURE__ */ o(q, { "data-active": S, onClick: P, variant: "ghost", "aria-label": "Underline", size: "xs", children: $ }) }), e[38] = S, e[39] = P, e[40] = z) : z = e[40];
169
- let se;
170
- e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ o(Se, { as: "span", height: "1rem", mx: "0.5", children: /* @__PURE__ */ o("span", { style: {
171
- borderLeft: "1px solid",
172
- height: "100%",
173
- borderColor: "var(--chakra-colors-border-muted)"
174
- } }) }), e[41] = se) : se = e[41];
175
- const be = l === "h1" || void 0;
176
- let Y;
177
- e[42] !== k ? (Y = () => {
178
- k("h1");
179
- }, e[42] = k, e[43] = Y) : Y = e[43];
180
- let ae;
181
- e[44] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ae = /* @__PURE__ */ o(U, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }), e[44] = ae) : ae = e[44];
182
- let X;
183
- e[45] !== be || e[46] !== Y ? (X = /* @__PURE__ */ o(V, { content: "Heading 1", children: /* @__PURE__ */ o(q, { "data-active": be, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: Y, children: ae }) }), e[45] = be, e[46] = Y, e[47] = X) : X = e[47];
184
- const ve = l === "h2" || void 0;
185
- let Q;
186
- e[48] !== k ? (Q = () => {
187
- k("h2");
188
- }, e[48] = k, e[49] = Q) : Q = e[49];
189
- let ce;
190
- e[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = /* @__PURE__ */ o(U, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }), e[50] = ce) : ce = e[50];
191
- let Z;
192
- e[51] !== ve || e[52] !== Q ? (Z = /* @__PURE__ */ o(V, { content: "Heading 2", children: /* @__PURE__ */ o(q, { "data-active": ve, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: Q, children: ce }) }), e[51] = ve, e[52] = Q, e[53] = Z) : Z = e[53];
193
- const xe = l === "h3" || void 0;
194
- let J;
195
- e[54] !== k ? (J = () => {
196
- k("h3");
197
- }, e[54] = k, e[55] = J) : J = e[55];
198
- let de;
199
- e[56] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (de = /* @__PURE__ */ o(U, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }), e[56] = de) : de = e[56];
200
- let ee;
201
- e[57] !== xe || e[58] !== J ? (ee = /* @__PURE__ */ o(V, { content: "Heading 3", children: /* @__PURE__ */ o(q, { "data-active": xe, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: J, children: de }) }), e[57] = xe, e[58] = J, e[59] = ee) : ee = e[59];
202
- let me;
203
- e[60] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (me = /* @__PURE__ */ o(Se, { as: "span", height: "1rem", mx: "0.5", children: /* @__PURE__ */ o("span", { style: {
204
- borderLeft: "1px solid",
205
- height: "100%",
206
- borderColor: "var(--chakra-colors-border-muted)"
207
- } }) }), e[60] = me) : me = e[60];
208
- const _e = l === "bullet" || void 0;
209
- let fe;
210
- e[61] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (fe = /* @__PURE__ */ o(U, { fontWeight: "thin", fontSize: ".8rem", children: "•" }), e[61] = fe) : fe = e[61];
211
- let te;
212
- e[62] !== W || e[63] !== _e ? (te = /* @__PURE__ */ o(V, { content: "Bulleted List", children: /* @__PURE__ */ o(q, { "data-active": _e, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: W, children: fe }) }), e[62] = W, e[63] = _e, e[64] = te) : te = e[64];
213
- const ye = l === "number" || void 0;
214
- let pe;
215
- e[65] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (pe = /* @__PURE__ */ o(U, { fontWeight: "thin", fontSize: ".8rem", children: "1." }), e[65] = pe) : pe = e[65];
216
- let oe;
217
- e[66] !== y || e[67] !== ye ? (oe = /* @__PURE__ */ o(V, { content: "Numbered List", children: /* @__PURE__ */ o(q, { "data-active": ye, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: y, children: pe }) }), e[66] = y, e[67] = ye, e[68] = oe) : oe = e[68];
218
- let ne;
219
- e[69] !== m || e[70] !== c || e[71] !== z || e[72] !== X || e[73] !== Z || e[74] !== ee || e[75] !== te || e[76] !== oe ? (ne = /* @__PURE__ */ ge(Se, { direction: "row", gap: "0.5", alignItems: "center", children: [
220
- m,
221
- c,
222
- z,
223
- se,
224
- X,
225
- Z,
226
- ee,
227
- me,
228
- te,
229
- oe
230
- ] }), e[69] = m, e[70] = c, e[71] = z, e[72] = X, e[73] = Z, e[74] = ee, e[75] = te, e[76] = oe, e[77] = ne) : ne = e[77];
231
- let ue;
232
- return e[78] !== C || e[79] !== ne ? (ue = /* @__PURE__ */ o("div", { ref: d, className: C, children: ne }), e[78] = C, e[79] = ne, e[80] = ue) : ue = e[80], ue;
233
- }
234
- function Lt() {
235
- const n = ie();
236
- qe(n, It);
237
- }
238
- function It() {
239
- return ft();
127
+ }), o.registerCommand(Ne, (r) => (g.current(), !1), Ae), o.registerCommand(Oe, (r) => {
128
+ const i = U();
129
+ return J(i) && g.current(), !1;
130
+ }, Fe)), [o]), /* @__PURE__ */ t("div", { ref: c, className: `floating-text-format-toolbar ${n ? "active" : ""}`, children: /* @__PURE__ */ K(Q, { direction: "row", gap: "0.5", alignItems: "center", children: [
131
+ /* @__PURE__ */ t(z, { content: "Bold", children: /* @__PURE__ */ t(D, { "data-active": f || void 0, onClick: () => {
132
+ o.dispatchCommand(ee, "bold");
133
+ }, variant: "ghost", "aria-label": "Bold", size: "xs", children: /* @__PURE__ */ t(W, { fontWeight: "bold", fontSize: ".75rem", children: "B" }) }) }),
134
+ /* @__PURE__ */ t(z, { content: "Italic", children: /* @__PURE__ */ t(D, { "data-active": p || void 0, onClick: () => {
135
+ o.dispatchCommand(ee, "italic");
136
+ }, variant: "ghost", "aria-label": "Italic", size: "xs", children: /* @__PURE__ */ t(W, { fontStyle: "italic", fontSize: ".75rem", children: "I" }) }) }),
137
+ /* @__PURE__ */ t(z, { content: "Underline", children: /* @__PURE__ */ t(D, { "data-active": d || void 0, onClick: () => {
138
+ o.dispatchCommand(ee, "underline");
139
+ }, variant: "ghost", "aria-label": "Underline", size: "xs", children: /* @__PURE__ */ t(W, { textDecoration: "underline", fontSize: ".75rem", children: "U" }) }) }),
140
+ /* @__PURE__ */ t(Q, { as: "span", height: "1rem", mx: "0.5", children: /* @__PURE__ */ t("span", { style: {
141
+ borderLeft: "1px solid",
142
+ height: "100%",
143
+ borderColor: "var(--chakra-colors-border-muted)"
144
+ } }) }),
145
+ /* @__PURE__ */ t(z, { content: "Heading 1", children: /* @__PURE__ */ t(D, { "data-active": l === "h1" || void 0, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: () => {
146
+ I("h1");
147
+ }, children: /* @__PURE__ */ t(W, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }) }) }),
148
+ /* @__PURE__ */ t(z, { content: "Heading 2", children: /* @__PURE__ */ t(D, { "data-active": l === "h2" || void 0, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: () => {
149
+ I("h2");
150
+ }, children: /* @__PURE__ */ t(W, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }) }) }),
151
+ /* @__PURE__ */ t(z, { content: "Heading 3", children: /* @__PURE__ */ t(D, { "data-active": l === "h3" || void 0, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: () => {
152
+ I("h3");
153
+ }, children: /* @__PURE__ */ t(W, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }) }) }),
154
+ /* @__PURE__ */ t(Q, { as: "span", height: "1rem", mx: "0.5", children: /* @__PURE__ */ t("span", { style: {
155
+ borderLeft: "1px solid",
156
+ height: "100%",
157
+ borderColor: "var(--chakra-colors-border-muted)"
158
+ } }) }),
159
+ /* @__PURE__ */ t(z, { content: "Bulleted List", children: /* @__PURE__ */ t(D, { "data-active": l === "bullet" || void 0, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: P, children: /* @__PURE__ */ t($e, { size: 14 }) }) }),
160
+ /* @__PURE__ */ t(z, { content: "Numbered List", children: /* @__PURE__ */ t(D, { "data-active": l === "number" || void 0, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: $, children: /* @__PURE__ */ t(je, { size: 14 }) }) })
161
+ ] }) });
240
162
  }
241
- function Mt(n, e) {
242
- const t = re(7), [i, h] = K(!1);
243
- let a;
244
- t[0] !== e || t[1] !== n || t[2] !== i ? (a = /* @__PURE__ */ o(kt, { editor: n, anchorElem: e, isToolbarActive: i, setIsToolbarActive: h }), t[0] = e, t[1] = n, t[2] = i, t[3] = a) : a = t[3];
245
- let d;
246
- return t[4] !== e || t[5] !== a ? (d = ht(a, e), t[4] = e, t[5] = a, t[6] = d) : d = t[6], d;
163
+ function nt(o, e) {
164
+ const n = Y(7), [a, c] = k(!1);
165
+ let l;
166
+ n[0] !== e || n[1] !== o || n[2] !== a ? (l = /* @__PURE__ */ t(ot, { editor: o, anchorElem: e, isToolbarActive: a, setIsToolbarActive: c }), n[0] = e, n[1] = o, n[2] = a, n[3] = l) : l = n[3];
167
+ let s;
168
+ return n[4] !== e || n[5] !== l ? (s = We(l, e), n[4] = e, n[5] = l, n[6] = s) : s = n[6], s;
247
169
  }
248
- function Ke(n) {
170
+ function xe(o) {
249
171
  const {
250
172
  anchorElem: e
251
- } = n, t = e === void 0 ? document.body : e, [i] = it();
252
- return Mt(i, t);
173
+ } = o, n = e === void 0 ? document.body : e, [a] = Me();
174
+ return nt(a, n);
253
175
  }
254
- function At() {
255
- const n = re(1);
176
+ function it() {
177
+ const o = Y(1);
256
178
  let e;
257
- return n[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ o("style", { children: `
179
+ return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t("style", { children: `
258
180
  .collaboration-cursor-container {
259
181
  position: relative;
260
182
  display: inline;
@@ -288,165 +210,163 @@ function At() {
288
210
  pointer-events: none;
289
211
  opacity: 0.25;
290
212
  }
291
- ` }), n[0] = e) : e = n[0], e;
213
+ ` }), o[0] = e) : e = o[0], e;
292
214
  }
293
- function ao(n) {
294
- const e = re(37), {
295
- roomId: t,
296
- wsUrl: i,
297
- wsParams: h,
298
- userName: a,
299
- userColor: d,
300
- placeholder: l
301
- } = n;
302
- let E;
303
- e[0] !== h ? (E = h === void 0 ? {} : h, e[0] = h, e[1] = E) : E = e[1];
304
- const w = E, R = a === void 0 ? "Anonymous" : a, g = d === void 0 ? "#30bced" : d, j = Le(null), [D, G] = K(null), [O, k] = K(!1);
305
- let L;
306
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = new tt.Doc(), e[2] = L) : L = e[2];
307
- const W = L;
308
- let _;
309
- if (e[3] !== t || e[4] !== w || e[5] !== i) {
310
- _ = new et(i, t, W, {
311
- params: w,
215
+ function Ot(o) {
216
+ const e = Y(37), {
217
+ roomId: n,
218
+ wsUrl: a,
219
+ wsParams: c,
220
+ userName: l,
221
+ userColor: s,
222
+ placeholder: f
223
+ } = o;
224
+ let u;
225
+ e[0] !== c ? (u = c === void 0 ? {} : c, e[0] = c, e[1] = u) : u = e[1];
226
+ const p = u, h = l === void 0 ? "Anonymous" : l, d = s === void 0 ? "#30bced" : s, M = G(null), [g, I] = k(null), [P, $] = k(!1), [v] = k(lt);
227
+ let r;
228
+ e[2] !== v || e[3] !== n || e[4] !== p || e[5] !== a ? (r = () => {
229
+ const V = new we(a, n, v, {
230
+ params: p,
312
231
  connect: !1
313
232
  });
314
- let $;
315
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = (z) => {
316
- z && k(!0);
317
- }, e[7] = $) : $ = e[7], _.on("sync", $), e[3] = t, e[4] = w, e[5] = i, e[6] = _;
318
- } else
319
- _ = e[6];
320
- const y = _;
321
- let b, F;
322
- e[8] !== y ? (b = () => (y.connect(), () => {
323
- y.disconnect();
324
- }), F = [y], e[8] = y, e[9] = b, e[10] = F) : (b = e[9], F = e[10]), le(b, F);
325
- let A, r;
326
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = () => {
327
- G(j.current);
328
- }, r = [], e[11] = A, e[12] = r) : (A = e[11], r = e[12]), le(A, r);
329
- let I;
330
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = {
233
+ return V.on("sync", (X) => {
234
+ X && $(!0);
235
+ }), V;
236
+ }, e[2] = v, e[3] = n, e[4] = p, e[5] = a, e[6] = r) : r = e[6];
237
+ const [i] = k(r);
238
+ let b, m;
239
+ e[7] !== i ? (b = () => (i.connect(), () => {
240
+ i.disconnect();
241
+ }), m = [i], e[7] = i, e[8] = b, e[9] = m) : (b = e[8], m = e[9]), q(b, m);
242
+ let x, L;
243
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = () => {
244
+ I(M.current);
245
+ }, L = [], e[10] = x, e[11] = L) : (x = e[10], L = e[11]), q(x, L);
246
+ let E;
247
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = {
331
248
  namespace: "COLLABORATIVE_EDITOR",
332
- nodes: Ne,
249
+ nodes: ae,
333
250
  editorState: null,
334
- onError: Bt,
251
+ onError: rt,
335
252
  editable: !0,
336
- theme: Be
337
- }, e[13] = I) : I = e[13];
338
- const H = I;
339
- let M;
340
- e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ o(At, {}), e[14] = M) : M = e[14];
341
- const B = y;
253
+ theme: le
254
+ }, e[12] = E) : E = e[12];
255
+ const j = E;
256
+ let B;
257
+ e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ t(it, {}), e[13] = B) : B = e[13];
258
+ const H = i;
259
+ let _;
260
+ e[14] !== v || e[15] !== n || e[16] !== H || e[17] !== d || e[18] !== h ? (_ = /* @__PURE__ */ t(Se, { id: n, doc: v, provider: H, __shouldBootstrapUnsafe: !1, username: h, cursorColor: d }), e[14] = v, e[15] = n, e[16] = H, e[17] = d, e[18] = h, e[19] = _) : _ = e[19];
261
+ let N, A, O, S, w;
262
+ e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ t(he, {}), A = /* @__PURE__ */ t(ge, {}), O = /* @__PURE__ */ t(pe, {}), S = /* @__PURE__ */ t(se, {}), w = /* @__PURE__ */ t(ce, {}), e[20] = N, e[21] = A, e[22] = O, e[23] = S, e[24] = w) : (N = e[20], A = e[21], O = e[22], S = e[23], w = e[24]);
263
+ let R;
264
+ e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ t(de, { fullWidth: !1 }), e[25] = R) : R = e[25];
342
265
  let C;
343
- e[15] !== t || e[16] !== B || e[17] !== g || e[18] !== R ? (C = /* @__PURE__ */ o(Je, { id: t, doc: W, provider: B, __shouldBootstrapUnsafe: !1, username: R, cursorColor: g }), e[15] = t, e[16] = B, e[17] = g, e[18] = R, e[19] = C) : C = e[19];
344
- let N, v, x, m, T;
345
- e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ o(je, {}), v = /* @__PURE__ */ o(We, {}), x = /* @__PURE__ */ o(ze, {}), m = /* @__PURE__ */ o(Pe, {}), T = /* @__PURE__ */ o(Oe, {}), e[20] = N, e[21] = v, e[22] = x, e[23] = m, e[24] = T) : (N = e[20], v = e[21], x = e[22], m = e[23], T = e[24]);
346
- let f;
347
- e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ o(Fe, { fullWidth: !1 }), e[25] = f) : f = e[25];
348
- let p;
349
- e[26] !== l || e[27] !== O ? (p = O && l ? /* @__PURE__ */ o(He, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: l }) : null, e[26] = l, e[27] = O, e[28] = p) : p = e[28];
350
- let c;
351
- e[29] !== p ? (c = /* @__PURE__ */ o(Ue, { contentEditable: f, placeholder: p, ErrorBoundary: De }), e[29] = p, e[30] = c) : c = e[30];
352
- let S;
353
- e[31] !== D ? (S = D ? /* @__PURE__ */ o(Ke, { anchorElem: D }) : null, e[31] = D, e[32] = S) : S = e[32];
354
- let P;
355
- return e[33] !== C || e[34] !== c || e[35] !== S ? (P = /* @__PURE__ */ ge(ke, { ref: j, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
356
- M,
357
- /* @__PURE__ */ o($e, { initialConfig: H, children: /* @__PURE__ */ ge(Ze, { children: [
358
- C,
266
+ e[26] !== f || e[27] !== P ? (C = P && f ? /* @__PURE__ */ t(me, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: f }) : null, e[26] = f, e[27] = P, e[28] = C) : C = e[28];
267
+ let T;
268
+ e[29] !== C ? (T = /* @__PURE__ */ t(be, { contentEditable: R, placeholder: C, ErrorBoundary: ue }), e[29] = C, e[30] = T) : T = e[30];
269
+ let y;
270
+ e[31] !== g ? (y = g ? /* @__PURE__ */ t(xe, { anchorElem: g }) : null, e[31] = g, e[32] = y) : y = e[32];
271
+ let F;
272
+ return e[33] !== _ || e[34] !== T || e[35] !== y ? (F = /* @__PURE__ */ K(te, { ref: M, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
273
+ B,
274
+ /* @__PURE__ */ t(fe, { initialConfig: j, children: /* @__PURE__ */ K(_e, { children: [
275
+ _,
359
276
  N,
360
- v,
361
- x,
362
- m,
277
+ A,
278
+ O,
279
+ S,
280
+ w,
363
281
  T,
364
- c,
365
- S
282
+ y
366
283
  ] }) })
367
- ] }), e[33] = C, e[34] = c, e[35] = S, e[36] = P) : P = e[36], P;
284
+ ] }), e[33] = _, e[34] = T, e[35] = y, e[36] = F) : F = e[36], F;
285
+ }
286
+ function rt(o) {
287
+ return console.error(o);
368
288
  }
369
- function Bt(n) {
370
- return console.error(n);
289
+ function lt() {
290
+ return new Re.Doc();
371
291
  }
372
- function co(n) {
373
- const e = re(41), {
374
- autoFocus: t,
375
- debug: i,
376
- defaultState: h,
377
- isEditable: a,
378
- placeholder: d,
379
- onChange: l
380
- } = n, E = t === void 0 ? !1 : t, w = i === void 0 ? !1 : i, R = h === void 0 ? "" : h, g = a === void 0 ? !1 : a;
381
- let j;
382
- e[0] !== R ? (j = Ye(R), e[0] = R, e[1] = j) : j = e[1];
292
+ function Ft(o) {
293
+ const e = Y(41), {
294
+ autoFocus: n,
295
+ debug: a,
296
+ defaultState: c,
297
+ isEditable: l,
298
+ placeholder: s,
299
+ onChange: f
300
+ } = o, u = n === void 0 ? !1 : n, p = a === void 0 ? !1 : a, h = c === void 0 ? "" : c, d = l === void 0 ? !1 : l;
301
+ let M;
302
+ e[0] !== h ? (M = Te(h), e[0] = h, e[1] = M) : M = e[1];
383
303
  const {
384
- frontmatter: D,
385
- body: G
386
- } = j, O = g && !!l, k = Le(null), [L, W] = K(null);
387
- let _, y;
388
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = () => {
389
- W(k.current);
390
- }, y = [], e[2] = _, e[3] = y) : (_ = e[2], y = e[3]), le(_, y);
391
- let b;
392
- e[4] !== G ? (b = () => gt(G, Ie, void 0, !1), e[4] = G, e[5] = b) : b = e[5];
393
- let F;
394
- e[6] !== g || e[7] !== b ? (F = {
395
- namespace: "MARKDOWN_EDITOR",
396
- nodes: Ne,
397
- editorState: b,
398
- onError: Nt,
399
- editable: g,
400
- theme: Be
401
- }, e[6] = g, e[7] = b, e[8] = F) : F = e[8];
402
- const A = F;
403
- let r;
404
- e[9] !== E ? (r = E ? /* @__PURE__ */ o(vt, {}) : null, e[9] = E, e[10] = r) : r = e[10];
405
- let I, H, M, B, C, N;
406
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ o(xt, {}), H = /* @__PURE__ */ o(je, {}), M = /* @__PURE__ */ o(We, {}), B = /* @__PURE__ */ o(ze, {}), C = /* @__PURE__ */ o(Pe, {}), N = /* @__PURE__ */ o(Oe, {}), e[11] = I, e[12] = H, e[13] = M, e[14] = B, e[15] = C, e[16] = N) : (I = e[11], H = e[12], M = e[13], B = e[14], C = e[15], N = e[16]);
407
- let v;
408
- e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ o(Fe, { fullWidth: !1 }), e[17] = v) : v = e[17];
409
- let x;
410
- e[18] !== d ? (x = d ? /* @__PURE__ */ o(ke, { position: "absolute", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ o(He, { width: "100%", maxWidth: "720px", color: "fg.muted", textStyle: "paragraph/M/regular", children: d }) }) : null, e[18] = d, e[19] = x) : x = e[19];
304
+ frontmatter: g,
305
+ body: I
306
+ } = M, P = d && !!f, $ = G(null), [v, r] = k(null);
307
+ let i, b;
308
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = () => {
309
+ r($.current);
310
+ }, b = [], e[2] = i, e[3] = b) : (i = e[2], b = e[3]), q(i, b);
411
311
  let m;
412
- e[20] !== x ? (m = /* @__PURE__ */ o(Ue, { contentEditable: v, placeholder: x, ErrorBoundary: De }), e[20] = x, e[21] = m) : m = e[21];
413
- let T;
414
- e[22] !== L || e[23] !== g ? (T = g && L ? /* @__PURE__ */ o(Ke, { anchorElem: L }) : null, e[22] = L, e[23] = g, e[24] = T) : T = e[24];
415
- let f;
416
- e[25] !== D || e[26] !== l || e[27] !== O ? (f = O ? /* @__PURE__ */ o(_t, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (P) => {
417
- P.read(() => {
418
- const $ = ut(), z = bt(Ie, $);
419
- l?.(D + z);
420
- });
421
- } }) : null, e[25] = D, e[26] = l, e[27] = O, e[28] = f) : f = e[28];
422
- let p;
423
- e[29] !== g ? (p = /* @__PURE__ */ o(Xe, { isEditable: g }), e[29] = g, e[30] = p) : p = e[30];
424
- let c;
425
- e[31] !== w ? (c = w && /* @__PURE__ */ o(Qe, {}), e[31] = w, e[32] = c) : c = e[32];
312
+ e[4] !== I ? (m = () => Ue(I, oe, void 0, !1), e[4] = I, e[5] = m) : m = e[5];
313
+ let x;
314
+ e[6] !== d || e[7] !== m ? (x = {
315
+ namespace: "MARKDOWN_EDITOR",
316
+ nodes: ae,
317
+ editorState: m,
318
+ onError: at,
319
+ editable: d,
320
+ theme: le
321
+ }, e[6] = d, e[7] = m, e[8] = x) : x = e[8];
322
+ const L = x;
323
+ let E;
324
+ e[9] !== u ? (E = u ? /* @__PURE__ */ t(Ve, {}) : null, e[9] = u, e[10] = E) : E = e[10];
325
+ let j, B, H, _, N, A;
326
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ t(Ke, {}), B = /* @__PURE__ */ t(he, {}), H = /* @__PURE__ */ t(ge, {}), _ = /* @__PURE__ */ t(pe, {}), N = /* @__PURE__ */ t(se, {}), A = /* @__PURE__ */ t(ce, {}), e[11] = j, e[12] = B, e[13] = H, e[14] = _, e[15] = N, e[16] = A) : (j = e[11], B = e[12], H = e[13], _ = e[14], N = e[15], A = e[16]);
327
+ let O;
328
+ e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ t(de, { fullWidth: !1 }), e[17] = O) : O = e[17];
426
329
  let S;
427
- return e[33] !== A || e[34] !== m || e[35] !== T || e[36] !== f || e[37] !== p || e[38] !== c || e[39] !== r ? (S = /* @__PURE__ */ o(ke, { ref: k, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: /* @__PURE__ */ ge($e, { initialConfig: A, children: [
428
- r,
429
- I,
430
- H,
431
- M,
330
+ e[18] !== s ? (S = s ? /* @__PURE__ */ t(te, { position: "absolute", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ t(me, { width: "100%", maxWidth: "720px", color: "fg.muted", textStyle: "paragraph/M/regular", children: s }) }) : null, e[18] = s, e[19] = S) : S = e[19];
331
+ let w;
332
+ e[20] !== S ? (w = /* @__PURE__ */ t(be, { contentEditable: O, placeholder: S, ErrorBoundary: ue }), e[20] = S, e[21] = w) : w = e[21];
333
+ let R;
334
+ e[22] !== v || e[23] !== d ? (R = d && v ? /* @__PURE__ */ t(xe, { anchorElem: v }) : null, e[22] = v, e[23] = d, e[24] = R) : R = e[24];
335
+ let C;
336
+ e[25] !== g || e[26] !== f || e[27] !== P ? (C = P ? /* @__PURE__ */ t(Ge, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (V) => {
337
+ V.read(() => {
338
+ const X = ze(), Ce = qe(oe, X);
339
+ f?.(g + Ce);
340
+ });
341
+ } }) : null, e[25] = g, e[26] = f, e[27] = P, e[28] = C) : C = e[28];
342
+ let T;
343
+ e[29] !== d ? (T = /* @__PURE__ */ t(ye, { isEditable: d }), e[29] = d, e[30] = T) : T = e[30];
344
+ let y;
345
+ e[31] !== p ? (y = p && /* @__PURE__ */ t(Ee, {}), e[31] = p, e[32] = y) : y = e[32];
346
+ let F;
347
+ return e[33] !== L || e[34] !== w || e[35] !== R || e[36] !== C || e[37] !== T || e[38] !== y || e[39] !== E ? (F = /* @__PURE__ */ t(te, { ref: $, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: /* @__PURE__ */ K(fe, { initialConfig: L, children: [
348
+ E,
349
+ j,
432
350
  B,
433
- C,
351
+ H,
352
+ _,
434
353
  N,
435
- m,
354
+ A,
355
+ w,
356
+ R,
357
+ C,
436
358
  T,
437
- f,
438
- p,
439
- c
440
- ] }) }), e[33] = A, e[34] = m, e[35] = T, e[36] = f, e[37] = p, e[38] = c, e[39] = r, e[40] = S) : S = e[40], S;
359
+ y
360
+ ] }) }), e[33] = L, e[34] = w, e[35] = R, e[36] = C, e[37] = T, e[38] = y, e[39] = E, e[40] = F) : F = e[40], F;
441
361
  }
442
- function Nt(n) {
443
- return console.error(n);
362
+ function at(o) {
363
+ return console.error(o);
444
364
  }
445
- function mo(n) {
446
- const e = n.toLowerCase().trim();
365
+ function Ht(o) {
366
+ const e = o.toLowerCase().trim();
447
367
  return e ? e.startsWith("image/") ? "image" : e === "application/pdf" ? "pdf" : e === "text/markdown" ? "markdown" : e === "text/csv" || e === "text/tab-separated-values" ? "table" : e === "application/json" ? "json" : (e.startsWith("text/") || e.startsWith("application/"), "text") : "text";
448
368
  }
449
- const Pt = {
369
+ const st = {
450
370
  csv: "text/csv",
451
371
  tsv: "text/tab-separated-values",
452
372
  json: "application/json",
@@ -470,21 +390,21 @@ const Pt = {
470
390
  yml: "text/yaml",
471
391
  yaml: "text/yaml"
472
392
  };
473
- function fo(n) {
474
- const t = (n.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
475
- return t ? Pt[t] ?? null : null;
393
+ function Dt(o) {
394
+ const n = (o.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
395
+ return n ? st[n] ?? null : null;
476
396
  }
477
397
  export {
478
- ao as CollaborativeMarkdownEditor,
479
- ho as DefaultRichTextCodeEditor,
480
- go as DefaultRichTextDataTable,
481
- co as MarkdownEditor,
482
- bo as MarkdownPreview,
483
- vo as PromptEditor,
484
- xo as RichMessage,
485
- _o as generateEditorStateFromString,
486
- yo as getTextFromSerializedEditorState,
487
- mo as inferResourceTypeFromMediaType,
488
- fo as mediaTypeFromPath
398
+ Ot as CollaborativeMarkdownEditor,
399
+ jt as DefaultRichTextCodeEditor,
400
+ Wt as DefaultRichTextDataTable,
401
+ Ft as MarkdownEditor,
402
+ Ut as MarkdownPreview,
403
+ qt as PromptEditor,
404
+ Vt as RichMessage,
405
+ Kt as generateEditorStateFromString,
406
+ Gt as getTextFromSerializedEditorState,
407
+ Ht as inferResourceTypeFromMediaType,
408
+ Dt as mediaTypeFromPath
489
409
  };
490
410
  //# sourceMappingURL=rich-text.js.map