@pstdio/ui 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/chat-ui.js +12 -11
  2. package/dist/chat-ui.js.map +1 -1
  3. package/dist/components/attached-panel.d.ts +9 -0
  4. package/dist/components/attached-panel.utils.d.ts +6 -0
  5. package/dist/components/bubble-button.d.ts +10 -0
  6. package/dist/components/bubble-panel.d.ts +18 -0
  7. package/dist/components/chat-ui/components/chat-panel-sticky-user-message.d.ts +1 -1
  8. package/dist/components/diff-card.d.ts +3 -0
  9. package/dist/components/diff-drawer.d.ts +1 -0
  10. package/dist/components/layout.d.ts +1 -2
  11. package/dist/components/layout.stories.d.ts +3 -3
  12. package/dist/components/panel-header.constants.d.ts +1 -0
  13. package/dist/components/rich-text/markdown-editor/markdown-editor.d.ts +1 -0
  14. package/dist/components/rich-text/shared/components/content-editable.d.ts +2 -1
  15. package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/resolve-block-type.d.ts +17 -0
  16. package/dist/components/rich-text/shared/transformers/markdown-transformers.d.ts +1 -0
  17. package/dist/components/searchable-menu.d.ts +35 -2
  18. package/dist/components/searchable-menu.stories.d.ts +2 -0
  19. package/dist/components/session-indicator.d.ts +2 -2
  20. package/dist/components/session-indicator.stories.d.ts +1 -0
  21. package/dist/components/sidebar/sidebar-footer.d.ts +6 -0
  22. package/dist/components/sidebar/sidebar-header.d.ts +7 -0
  23. package/dist/components/sidebar/sidebar-project-menu.d.ts +10 -0
  24. package/dist/components/sidebar/sidebar.d.ts +2 -0
  25. package/dist/components/sidebar/sidebar.store.d.ts +47 -0
  26. package/dist/components/{sidebar-next/sidebar-next.stories.d.ts → sidebar/sidebar.stories.d.ts} +4 -3
  27. package/dist/components/{sidebar-next/sidebar-next.types.d.ts → sidebar/sidebar.types.d.ts} +3 -2
  28. package/dist/components/sidebar-tree/sidebar-node-content.d.ts +9 -0
  29. package/dist/components/sidebar-tree/sidebar-tree.d.ts +1 -1
  30. package/dist/components/sidebar-tree/sidebar-tree.types.d.ts +10 -2
  31. package/dist/components/style-guide.stories.d.ts +7 -12
  32. package/dist/components/tickets/ticket-card.d.ts +2 -7
  33. package/dist/components/workspace-badge.d.ts +22 -0
  34. package/dist/components/workspace-badge.stories.d.ts +13 -0
  35. package/dist/get-file-type-icon-CirIyuE8.js +92 -0
  36. package/dist/get-file-type-icon-CirIyuE8.js.map +1 -0
  37. package/dist/index.d.ts +18 -19
  38. package/dist/index.js +1849 -1743
  39. package/dist/index.js.map +1 -1
  40. package/dist/{rich-message-ZT2CEiwt.js → rich-message-Bad4GxH2.js} +520 -503
  41. package/dist/rich-message-Bad4GxH2.js.map +1 -0
  42. package/dist/rich-text.js +276 -272
  43. package/dist/rich-text.js.map +1 -1
  44. package/dist/style.css +1 -1
  45. package/dist/test-utils/local-storage.d.ts +1 -0
  46. package/dist/theme/global.d.ts +3 -0
  47. package/dist/theme/primitives/colors.d.ts +116 -0
  48. package/dist/theme/recipes/button.d.ts +13 -13
  49. package/dist/theme/recipes/dialog.d.ts +1 -1
  50. package/dist/theme/recipes/drawer.d.ts +1 -1
  51. package/dist/theme/recipes/menu.d.ts +1 -1
  52. package/dist/theme/recipes/popover.d.ts +1 -1
  53. package/dist/theme/recipes/tooltip.d.ts +1 -1
  54. package/dist/theme/tokens/colors.d.ts +162 -8
  55. package/dist/{theme-BFV2Q048.js → theme-D0VvFB1Y.js} +292 -154
  56. package/dist/theme-D0VvFB1Y.js.map +1 -0
  57. package/dist/theme.js +1 -1
  58. package/package.json +2 -2
  59. package/dist/components/documentation/docs-changelog.d.ts +0 -20
  60. package/dist/components/documentation/docs-changelog.stories.d.ts +0 -15
  61. package/dist/components/documentation/docs-outline.d.ts +0 -13
  62. package/dist/components/documentation/docs-outline.stories.d.ts +0 -16
  63. package/dist/components/documentation/docs-pagination.d.ts +0 -10
  64. package/dist/components/documentation/docs-pagination.stories.d.ts +0 -14
  65. package/dist/components/documentation/docs-sidebar.d.ts +0 -14
  66. package/dist/components/documentation/docs-sidebar.stories.d.ts +0 -7
  67. package/dist/components/panel-menu.d.ts +0 -9
  68. package/dist/components/panel-menu.stories.d.ts +0 -8
  69. package/dist/components/sidebar-next/sidebar-next-footer.d.ts +0 -6
  70. package/dist/components/sidebar-next/sidebar-next-header.d.ts +0 -7
  71. package/dist/components/sidebar-next/sidebar-next.d.ts +0 -2
  72. package/dist/components/sidebar-next/sidebar-next.store.d.ts +0 -47
  73. package/dist/components/sidebar-next/sidebar-next.store.test.d.ts +0 -1
  74. package/dist/rich-message-ZT2CEiwt.js.map +0 -1
  75. package/dist/theme-BFV2Q048.js.map +0 -1
  76. package/dist/tooltip-Dze4WXVl.js +0 -86
  77. package/dist/tooltip-Dze4WXVl.js.map +0 -1
  78. /package/dist/components/{chat-ui/components/ai-conversation.test.d.ts → attached-panel.utils.test.d.ts} +0 -0
  79. /package/dist/components/{chat-ui/components/chat-panel.sticky-user-message.test.d.ts → rich-text/shared/transformers/markdown-transformers.test.d.ts} +0 -0
  80. /package/dist/components/{searchable-menu.test.d.ts → sidebar/sidebar.store.test.d.ts} +0 -0
package/dist/rich-text.js CHANGED
@@ -1,44 +1,45 @@
1
- import { jsx as t, jsxs as K } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as Z } from "react/jsx-runtime";
2
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-ZT2CEiwt.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-ZT2CEiwt.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-Dze4WXVl.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) {
3
+ import { e as ae, a as se, I as ce, E as de, C as me, s as _e, b as ie, T as Se, c as Re } from "./rich-message-Bad4GxH2.js";
4
+ import { D as Qt, d as Zt, R as Jt, P as eo, R as to, g as oo, f as no } from "./rich-message-Bad4GxH2.js";
5
+ import { Stack as we, IconButton as D, Text as K, Box as fe, Flex as ne } from "@chakra-ui/react";
6
+ import { LexicalCollaboration as ke } from "@lexical/react/LexicalCollaborationContext";
7
+ import { CollaborationPluginV2__EXPERIMENTAL as Le } from "@lexical/react/LexicalCollaborationPlugin";
8
+ import { LexicalComposer as ue } from "@lexical/react/LexicalComposer";
9
+ import { LexicalErrorBoundary as pe } from "@lexical/react/LexicalErrorBoundary";
10
+ import { HorizontalRulePlugin as he } from "@lexical/react/LexicalHorizontalRulePlugin";
11
+ import { LinkPlugin as ge } from "@lexical/react/LexicalLinkPlugin";
12
+ import { ListPlugin as be } from "@lexical/react/LexicalListPlugin";
13
+ import { RichTextPlugin as ve } from "@lexical/react/LexicalRichTextPlugin";
14
+ import { useState as k, useRef as J, useEffect as G } from "react";
15
+ import { WebsocketProvider as Me } from "y-websocket";
16
+ import * as Ie from "yjs";
17
+ import { $isListNode as ee, REMOVE_LIST_COMMAND as Pe, INSERT_CHECK_LIST_COMMAND as Ne, INSERT_ORDERED_LIST_COMMAND as Ae, INSERT_UNORDERED_LIST_COMMAND as Be } from "@lexical/list";
18
+ import { useLexicalComposerContext as Oe } from "@lexical/react/LexicalComposerContext";
19
+ import { $isHeadingNode as He, $createHeadingNode as Fe } from "@lexical/rich-text";
20
+ import { $setBlocksType as De } from "@lexical/selection";
21
+ import { $findMatchingParent as xe, mergeRegister as ze } from "@lexical/utils";
22
+ import { $isRootOrShadowRoot as $e, $getSelection as Q, $isRangeSelection as te, SELECTION_CHANGE_COMMAND as je, COMMAND_PRIORITY_CRITICAL as We, CLICK_COMMAND as Ue, COMMAND_PRIORITY_HIGH as qe, FORMAT_TEXT_COMMAND as oe, $createParagraphNode as Ke, $getRoot as Ve } from "lexical";
23
+ import { List as Ge, ListOrdered as Ye, ListTodo as Xe } from "lucide-react";
24
+ import { createPortal as Qe } from "react-dom";
25
+ import { T as z } from "./get-file-type-icon-CirIyuE8.js";
26
+ import { $convertFromMarkdownString as Ze, $convertToMarkdownString as Je } from "@lexical/markdown";
27
+ import { AutoFocusPlugin as et } from "@lexical/react/LexicalAutoFocusPlugin";
28
+ import { CheckListPlugin as tt } from "@lexical/react/LexicalCheckListPlugin";
29
+ import { HistoryPlugin as ot } from "@lexical/react/LexicalHistoryPlugin";
30
+ import { OnChangePlugin as nt } from "@lexical/react/LexicalOnChangePlugin";
31
+ const it = 10, rt = 5;
32
+ function re(o, e, i, l = it, c = rt) {
33
+ const a = i.parentElement;
34
+ if (o === null || !a) {
34
35
  e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)";
35
36
  return;
36
37
  }
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)`;
38
+ const f = e.getBoundingClientRect(), d = i.getBoundingClientRect(), s = a.getBoundingClientRect();
39
+ let h = o.top - l, g = o.left - c;
40
+ h < s.top && (h += f.height + o.height + l * 2), g + f.width > s.right && (g = s.right - f.width - c), h -= d.top, g -= d.left, e.style.opacity = "1", e.style.transform = `translate(${g}px, ${h}px)`;
40
41
  }
41
- const Qe = -4, Ze = {
42
+ const lt = {
42
43
  bullet: "Bulleted List",
43
44
  check: "Check List",
44
45
  code: "Code Block",
@@ -51,129 +52,128 @@ const Qe = -4, Ze = {
51
52
  number: "Numbered List",
52
53
  paragraph: "Normal",
53
54
  quote: "Quote"
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))
55
+ }, at = (o) => o in lt ? o : null, st = (o) => (o.getKey() === "root" ? o : xe(o, (i) => {
56
+ const l = i.getParent();
57
+ return l !== null && $e(l);
58
+ })) ?? o.getTopLevelElementOrThrow(), ct = (o) => {
59
+ const e = st(o);
60
+ if (ee(e))
60
61
  return e.getListType();
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);
66
- };
67
- function ot({
62
+ const i = xe(o, (c) => ee(c));
63
+ if (i !== null && ee(i))
64
+ return i.getListType();
65
+ const l = He(e) ? e.getTag() : e.getType();
66
+ return at(l);
67
+ }, dt = -4;
68
+ function le() {
69
+ const o = Y(1);
70
+ let e;
71
+ return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t("span", { style: {
72
+ display: "inline-flex",
73
+ height: "1rem",
74
+ margin: "0 0.25rem",
75
+ borderLeft: "1px solid var(--chakra-colors-border-muted)"
76
+ } }), o[0] = e) : e = o[0], e;
77
+ }
78
+ function mt({
68
79
  editor: o,
69
80
  anchorElem: e,
70
- isToolbarActive: n,
71
- setIsToolbarActive: a
81
+ isToolbarActive: i,
82
+ setIsToolbarActive: l
72
83
  }) {
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
- });
80
- return;
81
- }
84
+ const c = J(null), [a, f] = k("paragraph"), [d, s] = k(!1), [h, g] = k(!1), [L, u] = k(!1), p = J(() => {
85
+ }), R = (n) => {
82
86
  o.update(() => {
83
- const i = U();
84
- ie(i, () => He());
87
+ const r = Q();
88
+ De(r, a === n ? Ke : () => Fe(n));
85
89
  });
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);
90
+ }, T = (n) => {
91
+ if (a === n) {
92
+ o.dispatchCommand(Pe, void 0);
93
+ return;
94
+ }
95
+ const r = {
96
+ bullet: Be,
97
+ number: Ae,
98
+ check: Ne
99
+ }[n];
100
+ o.dispatchCommand(r, void 0);
101
+ }, W = () => {
102
+ const n = Q();
103
+ if (!te(n)) return;
104
+ s(n.hasFormat("bold")), g(n.hasFormat("italic")), u(n.hasFormat("underline"));
105
+ const r = ct(n.anchor.getNode());
106
+ r && f(r);
96
107
  };
97
- return g.current = () => {
98
- const r = U(), i = c.current, b = window.getSelection();
99
- if (i === null)
108
+ return p.current = () => {
109
+ const n = Q(), r = c.current, m = window.getSelection();
110
+ if (r === null)
100
111
  return;
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
+ const M = o.getRootElement();
113
+ if (n !== null && te(n) && !n.isCollapsed() && m !== null && !m.isCollapsed && M?.contains(m.anchorNode) && o.isEditable()) {
114
+ const b = m.getRangeAt(0).getBoundingClientRect();
115
+ if (b) {
116
+ const y = new DOMRect(b.left, b.bottom, 0, 0);
117
+ re(y, r, e, dt);
107
118
  }
108
- a(!0);
119
+ l(!0);
109
120
  } else
110
- m !== null && re(null, i, e), a(!1);
111
- return v(), !0;
112
- }, q(() => {
113
- const r = e.parentElement, i = () => {
121
+ M !== null && re(null, r, e), l(!1);
122
+ return W(), !0;
123
+ }, G(() => {
124
+ const n = e.parentElement, r = () => {
114
125
  o.getEditorState().read(() => {
115
- g.current();
126
+ p.current();
116
127
  });
117
128
  };
118
- return window.addEventListener("resize", i), r && r.addEventListener("scroll", i), () => {
119
- window.removeEventListener("resize", i), r && r.removeEventListener("scroll", i);
129
+ return window.addEventListener("resize", r), n && n.addEventListener("scroll", r), () => {
130
+ window.removeEventListener("resize", r), n && n.removeEventListener("scroll", r);
120
131
  };
121
- }, [e, o]), q(() => Be(o.registerUpdateListener(({
122
- editorState: r
132
+ }, [e, o]), G(() => ze(o.registerUpdateListener(({
133
+ editorState: n
123
134
  }) => {
124
- r.read(() => {
125
- g.current();
135
+ n.read(() => {
136
+ p.current();
126
137
  });
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 }) }) })
138
+ }), o.registerCommand(je, (n) => (p.current(), !1), We), o.registerCommand(Ue, (n) => {
139
+ const r = Q();
140
+ return te(r) && p.current(), !1;
141
+ }, qe)), [o]), /* @__PURE__ */ t("div", { ref: c, className: `floating-text-format-toolbar ${i ? "active" : ""}`, children: /* @__PURE__ */ Z(we, { direction: "row", gap: "0.5", alignItems: "center", children: [
142
+ /* @__PURE__ */ t(z, { content: "Bold", children: /* @__PURE__ */ t(D, { "data-active": d || void 0, onClick: () => {
143
+ o.dispatchCommand(oe, "bold");
144
+ }, variant: "ghost", "aria-label": "Bold", size: "xs", children: /* @__PURE__ */ t(K, { fontWeight: "bold", fontSize: ".75rem", children: "B" }) }) }),
145
+ /* @__PURE__ */ t(z, { content: "Italic", children: /* @__PURE__ */ t(D, { "data-active": h || void 0, onClick: () => {
146
+ o.dispatchCommand(oe, "italic");
147
+ }, variant: "ghost", "aria-label": "Italic", size: "xs", children: /* @__PURE__ */ t(K, { fontStyle: "italic", fontSize: ".75rem", children: "I" }) }) }),
148
+ /* @__PURE__ */ t(z, { content: "Underline", children: /* @__PURE__ */ t(D, { "data-active": L || void 0, onClick: () => {
149
+ o.dispatchCommand(oe, "underline");
150
+ }, variant: "ghost", "aria-label": "Underline", size: "xs", children: /* @__PURE__ */ t(K, { textDecoration: "underline", fontSize: ".75rem", children: "U" }) }) }),
151
+ /* @__PURE__ */ t(le, {}),
152
+ /* @__PURE__ */ t(z, { content: "Heading 1", children: /* @__PURE__ */ t(D, { "data-active": a === "h1" || void 0, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: () => {
153
+ R("h1");
154
+ }, children: /* @__PURE__ */ t(K, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }) }) }),
155
+ /* @__PURE__ */ t(z, { content: "Heading 2", children: /* @__PURE__ */ t(D, { "data-active": a === "h2" || void 0, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: () => {
156
+ R("h2");
157
+ }, children: /* @__PURE__ */ t(K, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }) }) }),
158
+ /* @__PURE__ */ t(z, { content: "Heading 3", children: /* @__PURE__ */ t(D, { "data-active": a === "h3" || void 0, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: () => {
159
+ R("h3");
160
+ }, children: /* @__PURE__ */ t(K, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }) }) }),
161
+ /* @__PURE__ */ t(le, {}),
162
+ /* @__PURE__ */ t(z, { content: "Bulleted List", children: /* @__PURE__ */ t(D, { "data-active": a === "bullet" || void 0, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: () => T("bullet"), children: /* @__PURE__ */ t(Ge, { size: 14 }) }) }),
163
+ /* @__PURE__ */ t(z, { content: "Numbered List", children: /* @__PURE__ */ t(D, { "data-active": a === "number" || void 0, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: () => T("number"), children: /* @__PURE__ */ t(Ye, { size: 14 }) }) }),
164
+ /* @__PURE__ */ t(z, { content: "Check List", children: /* @__PURE__ */ t(D, { "data-active": a === "check" || void 0, variant: "ghost", "aria-label": "Check List", size: "xs", onClick: () => T("check"), children: /* @__PURE__ */ t(Xe, { size: 14 }) }) })
161
165
  ] }) });
162
166
  }
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
+ function Ce(o) {
168
+ const e = Y(7), {
169
+ anchorElem: i
170
+ } = o, l = i === void 0 ? document.body : i, [c] = Oe(), [a, f] = k(!1);
171
+ let d;
172
+ e[0] !== l || e[1] !== c || e[2] !== a ? (d = /* @__PURE__ */ t(mt, { editor: c, anchorElem: l, isToolbarActive: a, setIsToolbarActive: f }), e[0] = l, e[1] = c, e[2] = a, e[3] = d) : d = e[3];
167
173
  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;
174
+ return e[4] !== l || e[5] !== d ? (s = Qe(d, l), e[4] = l, e[5] = d, e[6] = s) : s = e[6], s;
169
175
  }
170
- function xe(o) {
171
- const {
172
- anchorElem: e
173
- } = o, n = e === void 0 ? document.body : e, [a] = Me();
174
- return nt(a, n);
175
- }
176
- function it() {
176
+ function ft() {
177
177
  const o = Y(1);
178
178
  let e;
179
179
  return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t("style", { children: `
@@ -212,161 +212,165 @@ function it() {
212
212
  }
213
213
  ` }), o[0] = e) : e = o[0], e;
214
214
  }
215
- function Ot(o) {
215
+ function qt(o) {
216
216
  const e = Y(37), {
217
- roomId: n,
218
- wsUrl: a,
217
+ roomId: i,
218
+ wsUrl: l,
219
219
  wsParams: c,
220
- userName: l,
221
- userColor: s,
222
- placeholder: f
220
+ userName: a,
221
+ userColor: f,
222
+ placeholder: d
223
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);
224
+ let s;
225
+ e[0] !== c ? (s = c === void 0 ? {} : c, e[0] = c, e[1] = s) : s = e[1];
226
+ const h = s, g = a === void 0 ? "Anonymous" : a, L = f === void 0 ? "#30bced" : f, u = J(null), [p, R] = k(null), [T, W] = k(!1), [n] = k(pt);
227
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,
228
+ e[2] !== n || e[3] !== i || e[4] !== h || e[5] !== l ? (r = () => {
229
+ const F = new Me(l, i, n, {
230
+ params: h,
231
231
  connect: !1
232
232
  });
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 = {
233
+ return F.on("sync", (j) => {
234
+ j && W(!0);
235
+ }), F;
236
+ }, e[2] = n, e[3] = i, e[4] = h, e[5] = l, e[6] = r) : r = e[6];
237
+ const [m] = k(r);
238
+ let M, b;
239
+ e[7] !== m ? (M = () => (m.connect(), () => {
240
+ m.disconnect();
241
+ }), b = [m], e[7] = m, e[8] = M, e[9] = b) : (M = e[8], b = e[9]), G(M, b);
242
+ let y, E;
243
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = () => {
244
+ R(u.current);
245
+ }, E = [], e[10] = y, e[11] = E) : (y = e[10], E = e[11]), G(y, E);
246
+ let I;
247
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = {
248
248
  namespace: "COLLABORATIVE_EDITOR",
249
- nodes: ae,
249
+ nodes: se,
250
250
  editorState: null,
251
- onError: rt,
251
+ onError: ut,
252
252
  editable: !0,
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;
253
+ theme: ae
254
+ }, e[12] = I) : I = e[12];
255
+ const V = I;
256
+ let $;
257
+ e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ t(ft, {}), e[13] = $) : $ = e[13];
258
+ const w = m;
259
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];
260
+ e[14] !== n || e[15] !== i || e[16] !== w || e[17] !== L || e[18] !== g ? (_ = /* @__PURE__ */ t(Le, { id: i, doc: n, provider: w, __shouldBootstrapUnsafe: !1, username: g, cursorColor: L }), e[14] = n, e[15] = i, e[16] = w, e[17] = L, e[18] = g, e[19] = _) : _ = e[19];
261
+ let P, N, A, B, O;
262
+ e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ t(ge, {}), N = /* @__PURE__ */ t(be, {}), A = /* @__PURE__ */ t(he, {}), B = /* @__PURE__ */ t(ce, {}), O = /* @__PURE__ */ t(de, {}), e[20] = P, e[21] = N, e[22] = A, e[23] = B, e[24] = O) : (P = e[20], N = e[21], A = e[22], B = e[23], O = e[24]);
263
+ let H;
264
+ e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ t(me, { fullWidth: !1 }), e[25] = H) : H = e[25];
265
+ let v;
266
+ e[26] !== d || e[27] !== T ? (v = T && d ? /* @__PURE__ */ t(fe, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: d }) : null, e[26] = d, e[27] = T, e[28] = v) : v = e[28];
267
+ let x;
268
+ e[29] !== v ? (x = /* @__PURE__ */ t(ve, { contentEditable: H, placeholder: v, ErrorBoundary: pe }), e[29] = v, e[30] = x) : x = e[30];
265
269
  let 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: [
270
+ e[31] !== p ? (C = p ? /* @__PURE__ */ t(Ce, { anchorElem: p }) : null, e[31] = p, e[32] = C) : C = e[32];
271
+ let S;
272
+ return e[33] !== _ || e[34] !== x || e[35] !== C ? (S = /* @__PURE__ */ Z(ne, { ref: u, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
273
+ $,
274
+ /* @__PURE__ */ t(ue, { initialConfig: V, children: /* @__PURE__ */ Z(ke, { children: [
275
275
  _,
276
+ P,
276
277
  N,
277
278
  A,
279
+ B,
278
280
  O,
279
- S,
280
- w,
281
- T,
282
- y
281
+ x,
282
+ C
283
283
  ] }) })
284
- ] }), e[33] = _, e[34] = T, e[35] = y, e[36] = F) : F = e[36], F;
284
+ ] }), e[33] = _, e[34] = x, e[35] = C, e[36] = S) : S = e[36], S;
285
285
  }
286
- function rt(o) {
286
+ function ut(o) {
287
287
  return console.error(o);
288
288
  }
289
- function lt() {
290
- return new Re.Doc();
289
+ function pt() {
290
+ return new Ie.Doc();
291
291
  }
292
- function Ft(o) {
293
- const e = Y(41), {
294
- autoFocus: n,
295
- debug: a,
292
+ function Kt(o) {
293
+ const e = Y(47), {
294
+ autoFocus: i,
295
+ debug: l,
296
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];
297
+ isEditable: a,
298
+ placeholder: f,
299
+ scrollable: d,
300
+ onChange: s
301
+ } = o, h = i === void 0 ? !1 : i, g = l === void 0 ? !1 : l, L = c === void 0 ? "" : c, u = a === void 0 ? !1 : a, p = d === void 0 ? !0 : d;
302
+ let R;
303
+ e[0] !== L ? (R = _e(L), e[0] = L, e[1] = R) : R = e[1];
303
304
  const {
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);
311
- let m;
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;
305
+ frontmatter: T,
306
+ body: W
307
+ } = R, n = u && !!s, r = J(null), [m, M] = k(null);
308
+ let b, y;
309
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = () => {
310
+ M(r.current);
311
+ }, y = [], e[2] = b, e[3] = y) : (b = e[2], y = e[3]), G(b, y);
323
312
  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, padding: "sm" }), e[17] = O) : O = e[17];
329
- let S;
330
- e[18] !== s ? (S = s ? /* @__PURE__ */ t(te, { position: "absolute", padding: "sm", 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];
313
+ e[4] !== W ? (E = () => Ze(W, ie, void 0, !1), e[4] = W, e[5] = E) : E = e[5];
314
+ let I;
315
+ e[6] !== u || e[7] !== E ? (I = {
316
+ namespace: "MARKDOWN_EDITOR",
317
+ nodes: se,
318
+ editorState: E,
319
+ onError: ht,
320
+ editable: u,
321
+ theme: ae
322
+ }, e[6] = u, e[7] = E, e[8] = I) : I = e[8];
323
+ const V = I, $ = p ? "100%" : "auto";
331
324
  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];
325
+ e[9] !== h ? (w = h ? /* @__PURE__ */ t(et, {}) : null, e[9] = h, e[10] = w) : w = e[10];
326
+ let _, P, N, A, B, O, H;
327
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ t(ot, {}), P = /* @__PURE__ */ t(ge, {}), N = /* @__PURE__ */ t(be, {}), A = /* @__PURE__ */ t(tt, {}), B = /* @__PURE__ */ t(he, {}), O = /* @__PURE__ */ t(ce, {}), H = /* @__PURE__ */ t(de, {}), e[11] = _, e[12] = P, e[13] = N, e[14] = A, e[15] = B, e[16] = O, e[17] = H) : (_ = e[11], P = e[12], N = e[13], A = e[14], B = e[15], O = e[16], H = e[17]);
328
+ let v;
329
+ e[18] !== p ? (v = /* @__PURE__ */ t(me, { fullWidth: !1, padding: "sm", scrollable: p }), e[18] = p, e[19] = v) : v = e[19];
330
+ let x;
331
+ e[20] !== f ? (x = f ? /* @__PURE__ */ t(ne, { position: "absolute", padding: "sm", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ t(fe, { width: "100%", maxWidth: "720px", color: "fg.muted", textStyle: "paragraph/M/regular", children: f }) }) : null, e[20] = f, e[21] = x) : x = e[21];
335
332
  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];
333
+ e[22] !== v || e[23] !== x ? (C = /* @__PURE__ */ t(ve, { contentEditable: v, placeholder: x, ErrorBoundary: pe }), e[22] = v, e[23] = x, e[24] = C) : C = e[24];
334
+ let S;
335
+ e[25] !== m || e[26] !== u ? (S = u && m ? /* @__PURE__ */ t(Ce, { anchorElem: m }) : null, e[25] = m, e[26] = u, e[27] = S) : S = e[27];
346
336
  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,
350
- B,
351
- H,
337
+ e[28] !== T || e[29] !== s || e[30] !== n ? (F = n ? /* @__PURE__ */ t(nt, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (Te) => {
338
+ Te.read(() => {
339
+ const ye = Ve(), Ee = Je(ie, ye);
340
+ s?.(T + Ee);
341
+ });
342
+ } }) : null, e[28] = T, e[29] = s, e[30] = n, e[31] = F) : F = e[31];
343
+ let j;
344
+ e[32] !== u ? (j = /* @__PURE__ */ t(Se, { isEditable: u }), e[32] = u, e[33] = j) : j = e[33];
345
+ let U;
346
+ e[34] !== g ? (U = g && /* @__PURE__ */ t(Re, {}), e[34] = g, e[35] = U) : U = e[35];
347
+ let q;
348
+ e[36] !== V || e[37] !== w || e[38] !== C || e[39] !== S || e[40] !== F || e[41] !== j || e[42] !== U ? (q = /* @__PURE__ */ Z(ue, { initialConfig: V, children: [
349
+ w,
352
350
  _,
351
+ P,
353
352
  N,
354
353
  A,
355
- w,
356
- R,
354
+ B,
355
+ O,
356
+ H,
357
357
  C,
358
- T,
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;
358
+ S,
359
+ F,
360
+ j,
361
+ U
362
+ ] }), e[36] = V, e[37] = w, e[38] = C, e[39] = S, e[40] = F, e[41] = j, e[42] = U, e[43] = q) : q = e[43];
363
+ let X;
364
+ return e[44] !== $ || e[45] !== q ? (X = /* @__PURE__ */ t(ne, { ref: r, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: $, position: "relative", direction: "column", overflow: "visible", children: q }), e[44] = $, e[45] = q, e[46] = X) : X = e[46], X;
361
365
  }
362
- function at(o) {
366
+ function ht(o) {
363
367
  return console.error(o);
364
368
  }
365
- function Ht(o) {
369
+ function Vt(o) {
366
370
  const e = o.toLowerCase().trim();
367
371
  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";
368
372
  }
369
- const st = {
373
+ const gt = {
370
374
  csv: "text/csv",
371
375
  tsv: "text/tab-separated-values",
372
376
  json: "application/json",
@@ -390,21 +394,21 @@ const st = {
390
394
  yml: "text/yaml",
391
395
  yaml: "text/yaml"
392
396
  };
393
- function Dt(o) {
394
- const n = (o.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
395
- return n ? st[n] ?? null : null;
397
+ function Gt(o) {
398
+ const i = (o.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
399
+ return i ? gt[i] ?? null : null;
396
400
  }
397
401
  export {
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
402
+ qt as CollaborativeMarkdownEditor,
403
+ Qt as DefaultRichTextCodeEditor,
404
+ Zt as DefaultRichTextDataTable,
405
+ Kt as MarkdownEditor,
406
+ Jt as MarkdownPreview,
407
+ eo as PromptEditor,
408
+ to as RichMessage,
409
+ oo as generateEditorStateFromString,
410
+ no as getTextFromSerializedEditorState,
411
+ Vt as inferResourceTypeFromMediaType,
412
+ Gt as mediaTypeFromPath
409
413
  };
410
414
  //# sourceMappingURL=rich-text.js.map