@pstdio/ui 0.2.0 → 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,8 +1,8 @@
1
1
  import { jsx as t, jsxs as K } from "react/jsx-runtime";
2
2
  import { c as Y } from "react/compiler-runtime";
3
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 Dt, d as zt, R as $t, P as jt, R as Wt, g as Ut, f as qt } from "./rich-message-B2gxL8oy.js";
5
- import { Stack as Q, IconButton as D, Text as z, Box as me, Flex as te } from "@chakra-ui/react";
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
6
  import { LexicalCollaboration as _e } from "@lexical/react/LexicalCollaborationContext";
7
7
  import { CollaborationPluginV2__EXPERIMENTAL as Se } from "@lexical/react/LexicalCollaborationPlugin";
8
8
  import { LexicalComposer as fe } from "@lexical/react/LexicalComposer";
@@ -11,23 +11,24 @@ import { HorizontalRulePlugin as pe } from "@lexical/react/LexicalHorizontalRule
11
11
  import { LinkPlugin as he } from "@lexical/react/LexicalLinkPlugin";
12
12
  import { ListPlugin as ge } from "@lexical/react/LexicalListPlugin";
13
13
  import { RichTextPlugin as be } from "@lexical/react/LexicalRichTextPlugin";
14
- import { useState as L, useRef as G, useEffect as q } from "react";
14
+ import { useState as k, useRef as G, useEffect as q } from "react";
15
15
  import { WebsocketProvider as we } from "y-websocket";
16
16
  import * as Re from "yjs";
17
- import { INSERT_UNORDERED_LIST_COMMAND as ke, REMOVE_LIST_COMMAND as ne, INSERT_ORDERED_LIST_COMMAND as Le, $isListNode as Z } from "@lexical/list";
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
18
  import { useLexicalComposerContext as Me } from "@lexical/react/LexicalComposerContext";
19
19
  import { $createHeadingNode as Ie, $isHeadingNode as Pe } from "@lexical/rich-text";
20
20
  import { $setBlocksType as ie } from "@lexical/selection";
21
21
  import { mergeRegister as Be, $findMatchingParent as ve } from "@lexical/utils";
22
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 { createPortal as $e } from "react-dom";
24
- import { T as $ } from "./tooltip-Gm7PLwZG.js";
25
- import { $convertFromMarkdownString as je, $convertToMarkdownString as We } from "@lexical/markdown";
26
- import { AutoFocusPlugin as Ue } from "@lexical/react/LexicalAutoFocusPlugin";
27
- import { HistoryPlugin as qe } from "@lexical/react/LexicalHistoryPlugin";
28
- import { OnChangePlugin as Ve } from "@lexical/react/LexicalOnChangePlugin";
29
- const Ke = 10, Ge = 5;
30
- function re(o, e, n, a = Ke, c = Ge) {
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) {
31
32
  const l = n.parentElement;
32
33
  if (o === null || !l) {
33
34
  e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)";
@@ -37,7 +38,7 @@ function re(o, e, n, a = Ke, c = Ge) {
37
38
  let p = o.top - a, h = o.left - c;
38
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 Ye = -4, Xe = {
41
+ const Qe = -4, Ze = {
41
42
  bullet: "Bulleted List",
42
43
  check: "Check List",
43
44
  code: "Code Block",
@@ -50,26 +51,26 @@ const Ye = -4, Xe = {
50
51
  number: "Numbered List",
51
52
  paragraph: "Normal",
52
53
  quote: "Quote"
53
- }, Qe = (o) => o in Xe ? o : null, Ze = (o) => (o.getKey() === "root" ? o : ve(o, (n) => {
54
+ }, Je = (o) => o in Ze ? o : null, et = (o) => (o.getKey() === "root" ? o : ve(o, (n) => {
54
55
  const a = n.getParent();
55
56
  return a !== null && De(a);
56
- })) ?? o.getTopLevelElementOrThrow(), Je = (o) => {
57
- const e = Ze(o);
57
+ })) ?? o.getTopLevelElementOrThrow(), tt = (o) => {
58
+ const e = et(o);
58
59
  if (Z(e))
59
60
  return e.getListType();
60
61
  const n = ve(o, (c) => Z(c));
61
62
  if (n !== null && Z(n))
62
63
  return n.getListType();
63
64
  const a = Pe(e) ? e.getTag() : e.getType();
64
- return Qe(a);
65
+ return Je(a);
65
66
  };
66
- function et({
67
+ function ot({
67
68
  editor: o,
68
69
  anchorElem: e,
69
70
  isToolbarActive: n,
70
71
  setIsToolbarActive: a
71
72
  }) {
72
- const c = G(null), [l, s] = L("paragraph"), [f, u] = L(!1), [p, h] = L(!1), [d, M] = L(!1), g = G(() => {
73
+ const c = G(null), [l, s] = k("paragraph"), [f, u] = k(!1), [p, h] = k(!1), [d, M] = k(!1), g = G(() => {
73
74
  }), I = (r) => {
74
75
  if (l !== r) {
75
76
  o.update(() => {
@@ -83,14 +84,14 @@ function et({
83
84
  ie(i, () => He());
84
85
  });
85
86
  }, P = () => {
86
- l !== "bullet" ? o.dispatchCommand(ke, void 0) : o.dispatchCommand(ne, void 0);
87
- }, j = () => {
88
- l !== "number" ? o.dispatchCommand(Le, void 0) : o.dispatchCommand(ne, void 0);
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);
89
90
  }, v = () => {
90
91
  const r = U();
91
92
  if (!J(r)) return;
92
93
  u(r.hasFormat("bold")), h(r.hasFormat("italic")), M(r.hasFormat("underline"));
93
- const i = Je(r.anchor.getNode());
94
+ const i = tt(r.anchor.getNode());
94
95
  i && s(i);
95
96
  };
96
97
  return g.current = () => {
@@ -101,8 +102,8 @@ function et({
101
102
  if (r !== null && J(r) && !r.isCollapsed() && b !== null && !b.isCollapsed && m !== null && m.contains(b.anchorNode) && o.isEditable()) {
102
103
  const x = b.getRangeAt(0).getBoundingClientRect();
103
104
  if (x) {
104
- const k = new DOMRect(x.left, x.bottom, 0, 0);
105
- re(k, i, e, Ye);
105
+ const L = new DOMRect(x.left, x.bottom, 0, 0);
106
+ re(L, i, e, Qe);
106
107
  }
107
108
  a(!0);
108
109
  } else
@@ -127,52 +128,52 @@ function et({
127
128
  const i = U();
128
129
  return J(i) && g.current(), !1;
129
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: [
130
- /* @__PURE__ */ t($, { content: "Bold", children: /* @__PURE__ */ t(D, { "data-active": f || void 0, onClick: () => {
131
+ /* @__PURE__ */ t(z, { content: "Bold", children: /* @__PURE__ */ t(D, { "data-active": f || void 0, onClick: () => {
131
132
  o.dispatchCommand(ee, "bold");
132
- }, variant: "ghost", "aria-label": "Bold", size: "xs", children: /* @__PURE__ */ t(z, { fontWeight: "bold", fontSize: ".75rem", children: "B" }) }) }),
133
- /* @__PURE__ */ t($, { content: "Italic", children: /* @__PURE__ */ t(D, { "data-active": p || void 0, onClick: () => {
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: () => {
134
135
  o.dispatchCommand(ee, "italic");
135
- }, variant: "ghost", "aria-label": "Italic", size: "xs", children: /* @__PURE__ */ t(z, { fontStyle: "italic", fontSize: ".75rem", children: "I" }) }) }),
136
- /* @__PURE__ */ t($, { content: "Underline", children: /* @__PURE__ */ t(D, { "data-active": d || void 0, onClick: () => {
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: () => {
137
138
  o.dispatchCommand(ee, "underline");
138
- }, variant: "ghost", "aria-label": "Underline", size: "xs", children: /* @__PURE__ */ t(z, { textDecoration: "underline", fontSize: ".75rem", children: "U" }) }) }),
139
+ }, variant: "ghost", "aria-label": "Underline", size: "xs", children: /* @__PURE__ */ t(W, { textDecoration: "underline", fontSize: ".75rem", children: "U" }) }) }),
139
140
  /* @__PURE__ */ t(Q, { as: "span", height: "1rem", mx: "0.5", children: /* @__PURE__ */ t("span", { style: {
140
141
  borderLeft: "1px solid",
141
142
  height: "100%",
142
143
  borderColor: "var(--chakra-colors-border-muted)"
143
144
  } }) }),
144
- /* @__PURE__ */ t($, { content: "Heading 1", children: /* @__PURE__ */ t(D, { "data-active": l === "h1" || void 0, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: () => {
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: () => {
145
146
  I("h1");
146
- }, children: /* @__PURE__ */ t(z, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }) }) }),
147
- /* @__PURE__ */ t($, { content: "Heading 2", children: /* @__PURE__ */ t(D, { "data-active": l === "h2" || void 0, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: () => {
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: () => {
148
149
  I("h2");
149
- }, children: /* @__PURE__ */ t(z, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }) }) }),
150
- /* @__PURE__ */ t($, { content: "Heading 3", children: /* @__PURE__ */ t(D, { "data-active": l === "h3" || void 0, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: () => {
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: () => {
151
152
  I("h3");
152
- }, children: /* @__PURE__ */ t(z, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }) }) }),
153
+ }, children: /* @__PURE__ */ t(W, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }) }) }),
153
154
  /* @__PURE__ */ t(Q, { as: "span", height: "1rem", mx: "0.5", children: /* @__PURE__ */ t("span", { style: {
154
155
  borderLeft: "1px solid",
155
156
  height: "100%",
156
157
  borderColor: "var(--chakra-colors-border-muted)"
157
158
  } }) }),
158
- /* @__PURE__ */ t($, { 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(z, { fontWeight: "thin", fontSize: ".8rem", children: "•" }) }) }),
159
- /* @__PURE__ */ t($, { content: "Numbered List", children: /* @__PURE__ */ t(D, { "data-active": l === "number" || void 0, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: j, children: /* @__PURE__ */ t(z, { fontWeight: "thin", fontSize: ".8rem", children: "1." }) }) })
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 }) }) })
160
161
  ] }) });
161
162
  }
162
- function tt(o, e) {
163
- const n = Y(7), [a, c] = L(!1);
163
+ function nt(o, e) {
164
+ const n = Y(7), [a, c] = k(!1);
164
165
  let l;
165
- n[0] !== e || n[1] !== o || n[2] !== a ? (l = /* @__PURE__ */ t(et, { editor: o, anchorElem: e, isToolbarActive: a, setIsToolbarActive: c }), n[0] = e, n[1] = o, n[2] = a, n[3] = l) : l = n[3];
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];
166
167
  let s;
167
- return n[4] !== e || n[5] !== l ? (s = $e(l, e), n[4] = e, n[5] = l, n[6] = s) : s = n[6], 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;
168
169
  }
169
170
  function xe(o) {
170
171
  const {
171
172
  anchorElem: e
172
173
  } = o, n = e === void 0 ? document.body : e, [a] = Me();
173
- return tt(a, n);
174
+ return nt(a, n);
174
175
  }
175
- function ot() {
176
+ function it() {
176
177
  const o = Y(1);
177
178
  let e;
178
179
  return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t("style", { children: `
@@ -211,7 +212,7 @@ function ot() {
211
212
  }
212
213
  ` }), o[0] = e) : e = o[0], e;
213
214
  }
214
- function Bt(o) {
215
+ function Ot(o) {
215
216
  const e = Y(37), {
216
217
  roomId: n,
217
218
  wsUrl: a,
@@ -222,7 +223,7 @@ function Bt(o) {
222
223
  } = o;
223
224
  let u;
224
225
  e[0] !== c ? (u = c === void 0 ? {} : c, e[0] = c, e[1] = u) : u = e[1];
225
- const p = u, h = l === void 0 ? "Anonymous" : l, d = s === void 0 ? "#30bced" : s, M = G(null), [g, I] = L(null), [P, j] = L(!1), [v] = L(it);
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);
226
227
  let r;
227
228
  e[2] !== v || e[3] !== n || e[4] !== p || e[5] !== a ? (r = () => {
228
229
  const V = new we(a, n, v, {
@@ -230,30 +231,30 @@ function Bt(o) {
230
231
  connect: !1
231
232
  });
232
233
  return V.on("sync", (X) => {
233
- X && j(!0);
234
+ X && $(!0);
234
235
  }), V;
235
236
  }, e[2] = v, e[3] = n, e[4] = p, e[5] = a, e[6] = r) : r = e[6];
236
- const [i] = L(r);
237
+ const [i] = k(r);
237
238
  let b, m;
238
239
  e[7] !== i ? (b = () => (i.connect(), () => {
239
240
  i.disconnect();
240
241
  }), m = [i], e[7] = i, e[8] = b, e[9] = m) : (b = e[8], m = e[9]), q(b, m);
241
- let x, k;
242
+ let x, L;
242
243
  e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = () => {
243
244
  I(M.current);
244
- }, k = [], e[10] = x, e[11] = k) : (x = e[10], k = e[11]), q(x, k);
245
+ }, L = [], e[10] = x, e[11] = L) : (x = e[10], L = e[11]), q(x, L);
245
246
  let E;
246
247
  e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = {
247
248
  namespace: "COLLABORATIVE_EDITOR",
248
249
  nodes: ae,
249
250
  editorState: null,
250
- onError: nt,
251
+ onError: rt,
251
252
  editable: !0,
252
253
  theme: le
253
254
  }, e[12] = E) : E = e[12];
254
- const W = E;
255
+ const j = E;
255
256
  let B;
256
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ t(ot, {}), e[13] = B) : B = e[13];
257
+ e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ t(it, {}), e[13] = B) : B = e[13];
257
258
  const H = i;
258
259
  let _;
259
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];
@@ -270,7 +271,7 @@ function Bt(o) {
270
271
  let F;
271
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: [
272
273
  B,
273
- /* @__PURE__ */ t(fe, { initialConfig: W, children: /* @__PURE__ */ K(_e, { children: [
274
+ /* @__PURE__ */ t(fe, { initialConfig: j, children: /* @__PURE__ */ K(_e, { children: [
274
275
  _,
275
276
  N,
276
277
  A,
@@ -282,13 +283,13 @@ function Bt(o) {
282
283
  ] }) })
283
284
  ] }), e[33] = _, e[34] = T, e[35] = y, e[36] = F) : F = e[36], F;
284
285
  }
285
- function nt(o) {
286
+ function rt(o) {
286
287
  return console.error(o);
287
288
  }
288
- function it() {
289
+ function lt() {
289
290
  return new Re.Doc();
290
291
  }
291
- function Nt(o) {
292
+ function Ft(o) {
292
293
  const e = Y(41), {
293
294
  autoFocus: n,
294
295
  debug: a,
@@ -302,27 +303,27 @@ function Nt(o) {
302
303
  const {
303
304
  frontmatter: g,
304
305
  body: I
305
- } = M, P = d && !!f, j = G(null), [v, r] = L(null);
306
+ } = M, P = d && !!f, $ = G(null), [v, r] = k(null);
306
307
  let i, b;
307
308
  e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = () => {
308
- r(j.current);
309
+ r($.current);
309
310
  }, b = [], e[2] = i, e[3] = b) : (i = e[2], b = e[3]), q(i, b);
310
311
  let m;
311
- e[4] !== I ? (m = () => je(I, oe, void 0, !1), e[4] = I, e[5] = m) : m = e[5];
312
+ e[4] !== I ? (m = () => Ue(I, oe, void 0, !1), e[4] = I, e[5] = m) : m = e[5];
312
313
  let x;
313
314
  e[6] !== d || e[7] !== m ? (x = {
314
315
  namespace: "MARKDOWN_EDITOR",
315
316
  nodes: ae,
316
317
  editorState: m,
317
- onError: rt,
318
+ onError: at,
318
319
  editable: d,
319
320
  theme: le
320
321
  }, e[6] = d, e[7] = m, e[8] = x) : x = e[8];
321
- const k = x;
322
+ const L = x;
322
323
  let E;
323
- e[9] !== u ? (E = u ? /* @__PURE__ */ t(Ue, {}) : null, e[9] = u, e[10] = E) : E = e[10];
324
- let W, B, H, _, N, A;
325
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ t(qe, {}), B = /* @__PURE__ */ t(he, {}), H = /* @__PURE__ */ t(ge, {}), _ = /* @__PURE__ */ t(pe, {}), N = /* @__PURE__ */ t(se, {}), A = /* @__PURE__ */ t(ce, {}), e[11] = W, e[12] = B, e[13] = H, e[14] = _, e[15] = N, e[16] = A) : (W = e[11], B = e[12], H = e[13], _ = e[14], N = e[15], A = e[16]);
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]);
326
327
  let O;
327
328
  e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ t(de, { fullWidth: !1 }), e[17] = O) : O = e[17];
328
329
  let S;
@@ -332,9 +333,9 @@ function Nt(o) {
332
333
  let R;
333
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];
334
335
  let C;
335
- e[25] !== g || e[26] !== f || e[27] !== P ? (C = P ? /* @__PURE__ */ t(Ve, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (V) => {
336
+ e[25] !== g || e[26] !== f || e[27] !== P ? (C = P ? /* @__PURE__ */ t(Ge, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (V) => {
336
337
  V.read(() => {
337
- const X = ze(), Ce = We(oe, X);
338
+ const X = ze(), Ce = qe(oe, X);
338
339
  f?.(g + Ce);
339
340
  });
340
341
  } }) : null, e[25] = g, e[26] = f, e[27] = P, e[28] = C) : C = e[28];
@@ -343,9 +344,9 @@ function Nt(o) {
343
344
  let y;
344
345
  e[31] !== p ? (y = p && /* @__PURE__ */ t(Ee, {}), e[31] = p, e[32] = y) : y = e[32];
345
346
  let F;
346
- return e[33] !== k || e[34] !== w || e[35] !== R || e[36] !== C || e[37] !== T || e[38] !== y || e[39] !== E ? (F = /* @__PURE__ */ t(te, { ref: j, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: /* @__PURE__ */ K(fe, { initialConfig: k, children: [
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: [
347
348
  E,
348
- W,
349
+ j,
349
350
  B,
350
351
  H,
351
352
  _,
@@ -356,16 +357,16 @@ function Nt(o) {
356
357
  C,
357
358
  T,
358
359
  y
359
- ] }) }), e[33] = k, 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;
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;
360
361
  }
361
- function rt(o) {
362
+ function at(o) {
362
363
  return console.error(o);
363
364
  }
364
- function At(o) {
365
+ function Ht(o) {
365
366
  const e = o.toLowerCase().trim();
366
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";
367
368
  }
368
- const lt = {
369
+ const st = {
369
370
  csv: "text/csv",
370
371
  tsv: "text/tab-separated-values",
371
372
  json: "application/json",
@@ -389,21 +390,21 @@ const lt = {
389
390
  yml: "text/yaml",
390
391
  yaml: "text/yaml"
391
392
  };
392
- function Ot(o) {
393
+ function Dt(o) {
393
394
  const n = (o.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
394
- return n ? lt[n] ?? null : null;
395
+ return n ? st[n] ?? null : null;
395
396
  }
396
397
  export {
397
- Bt as CollaborativeMarkdownEditor,
398
- Dt as DefaultRichTextCodeEditor,
399
- zt as DefaultRichTextDataTable,
400
- Nt as MarkdownEditor,
401
- $t as MarkdownPreview,
402
- jt as PromptEditor,
403
- Wt as RichMessage,
404
- Ut as generateEditorStateFromString,
405
- qt as getTextFromSerializedEditorState,
406
- At as inferResourceTypeFromMediaType,
407
- Ot 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
408
409
  };
409
410
  //# sourceMappingURL=rich-text.js.map