@pstdio/ui 0.3.1 → 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.
- package/dist/chat-ui.js +12 -11
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/attached-panel.d.ts +9 -0
- package/dist/components/attached-panel.utils.d.ts +6 -0
- package/dist/components/bubble-button.d.ts +10 -0
- package/dist/components/bubble-panel.d.ts +18 -0
- package/dist/components/chat-ui/components/chat-panel-sticky-user-message.d.ts +1 -1
- package/dist/components/diff-card.d.ts +3 -0
- package/dist/components/diff-drawer.d.ts +1 -0
- package/dist/components/layout.d.ts +1 -2
- package/dist/components/layout.stories.d.ts +3 -3
- package/dist/components/panel-header.constants.d.ts +1 -0
- package/dist/components/rich-text/markdown-editor/markdown-editor.d.ts +1 -0
- package/dist/components/rich-text/shared/components/content-editable.d.ts +2 -1
- package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/resolve-block-type.d.ts +17 -0
- package/dist/components/rich-text/shared/transformers/markdown-transformers.d.ts +1 -0
- package/dist/components/searchable-menu.d.ts +35 -2
- package/dist/components/searchable-menu.stories.d.ts +2 -0
- package/dist/components/session-indicator.d.ts +2 -2
- package/dist/components/session-indicator.stories.d.ts +1 -0
- package/dist/components/sidebar/sidebar-footer.d.ts +6 -0
- package/dist/components/sidebar/sidebar-header.d.ts +7 -0
- package/dist/components/sidebar/sidebar-project-menu.d.ts +10 -0
- package/dist/components/sidebar/sidebar.d.ts +2 -0
- package/dist/components/sidebar/sidebar.store.d.ts +47 -0
- package/dist/components/{sidebar-next/sidebar-next.stories.d.ts → sidebar/sidebar.stories.d.ts} +4 -3
- package/dist/components/{sidebar-next/sidebar-next.types.d.ts → sidebar/sidebar.types.d.ts} +3 -2
- package/dist/components/sidebar-tree/sidebar-node-content.d.ts +9 -0
- package/dist/components/sidebar-tree/sidebar-tree.d.ts +1 -1
- package/dist/components/sidebar-tree/sidebar-tree.types.d.ts +10 -2
- package/dist/components/style-guide.stories.d.ts +6 -11
- package/dist/components/tickets/ticket-card.d.ts +2 -7
- package/dist/components/workspace-badge.d.ts +22 -0
- package/dist/components/workspace-badge.stories.d.ts +13 -0
- package/dist/get-file-type-icon-CirIyuE8.js +92 -0
- package/dist/get-file-type-icon-CirIyuE8.js.map +1 -0
- package/dist/index.d.ts +18 -19
- package/dist/index.js +1849 -1743
- package/dist/index.js.map +1 -1
- package/dist/{rich-message-ZT2CEiwt.js → rich-message-Bad4GxH2.js} +520 -503
- package/dist/rich-message-Bad4GxH2.js.map +1 -0
- package/dist/rich-text.js +276 -272
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/test-utils/local-storage.d.ts +1 -0
- package/dist/theme/global.d.ts +3 -0
- package/dist/theme/primitives/colors.d.ts +116 -0
- package/dist/theme/recipes/button.d.ts +13 -13
- package/dist/theme/recipes/dialog.d.ts +1 -1
- package/dist/theme/recipes/drawer.d.ts +1 -1
- package/dist/theme/recipes/menu.d.ts +1 -1
- package/dist/theme/recipes/popover.d.ts +1 -1
- package/dist/theme/recipes/tooltip.d.ts +1 -1
- package/dist/theme/tokens/colors.d.ts +162 -8
- package/dist/{theme-BFV2Q048.js → theme-D0VvFB1Y.js} +292 -154
- package/dist/theme-D0VvFB1Y.js.map +1 -0
- package/dist/theme.js +1 -1
- package/package.json +2 -2
- package/dist/components/documentation/docs-changelog.d.ts +0 -20
- package/dist/components/documentation/docs-changelog.stories.d.ts +0 -15
- package/dist/components/documentation/docs-outline.d.ts +0 -13
- package/dist/components/documentation/docs-outline.stories.d.ts +0 -16
- package/dist/components/documentation/docs-pagination.d.ts +0 -10
- package/dist/components/documentation/docs-pagination.stories.d.ts +0 -14
- package/dist/components/documentation/docs-sidebar.d.ts +0 -14
- package/dist/components/documentation/docs-sidebar.stories.d.ts +0 -7
- package/dist/components/panel-menu.d.ts +0 -9
- package/dist/components/panel-menu.stories.d.ts +0 -8
- package/dist/components/sidebar-next/sidebar-next-footer.d.ts +0 -6
- package/dist/components/sidebar-next/sidebar-next-header.d.ts +0 -7
- package/dist/components/sidebar-next/sidebar-next.d.ts +0 -2
- package/dist/components/sidebar-next/sidebar-next.store.d.ts +0 -47
- package/dist/components/sidebar-next/sidebar-next.store.test.d.ts +0 -1
- package/dist/rich-message-ZT2CEiwt.js.map +0 -1
- package/dist/theme-BFV2Q048.js.map +0 -1
- package/dist/tooltip-Dze4WXVl.js +0 -86
- package/dist/tooltip-Dze4WXVl.js.map +0 -1
- /package/dist/components/{chat-ui/components/ai-conversation.test.d.ts → attached-panel.utils.test.d.ts} +0 -0
- /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
- /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
|
|
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
|
|
4
|
-
import { D as
|
|
5
|
-
import { Stack as
|
|
6
|
-
import { LexicalCollaboration as
|
|
7
|
-
import { CollaborationPluginV2__EXPERIMENTAL as
|
|
8
|
-
import { LexicalComposer as
|
|
9
|
-
import { LexicalErrorBoundary as
|
|
10
|
-
import { HorizontalRulePlugin as
|
|
11
|
-
import { LinkPlugin as
|
|
12
|
-
import { ListPlugin as
|
|
13
|
-
import { RichTextPlugin as
|
|
14
|
-
import { useState as k, useRef as
|
|
15
|
-
import { WebsocketProvider as
|
|
16
|
-
import * as
|
|
17
|
-
import {
|
|
18
|
-
import { useLexicalComposerContext as
|
|
19
|
-
import { $
|
|
20
|
-
import { $setBlocksType as
|
|
21
|
-
import {
|
|
22
|
-
import { $getSelection as
|
|
23
|
-
import { List as
|
|
24
|
-
import { createPortal as
|
|
25
|
-
import { T as z } from "./
|
|
26
|
-
import { $convertFromMarkdownString as
|
|
27
|
-
import { AutoFocusPlugin as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
38
|
-
let
|
|
39
|
-
|
|
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
|
|
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
|
-
},
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
})) ?? o.getTopLevelElementOrThrow(),
|
|
58
|
-
const e =
|
|
59
|
-
if (
|
|
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
|
|
62
|
-
if (
|
|
63
|
-
return
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
};
|
|
67
|
-
function
|
|
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:
|
|
71
|
-
setIsToolbarActive:
|
|
81
|
+
isToolbarActive: i,
|
|
82
|
+
setIsToolbarActive: l
|
|
72
83
|
}) {
|
|
73
|
-
const c =
|
|
74
|
-
}),
|
|
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
|
|
84
|
-
|
|
87
|
+
const r = Q();
|
|
88
|
+
De(r, a === n ? Ke : () => Fe(n));
|
|
85
89
|
});
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const r =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
108
|
+
return p.current = () => {
|
|
109
|
+
const n = Q(), r = c.current, m = window.getSelection();
|
|
110
|
+
if (r === null)
|
|
100
111
|
return;
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
re(
|
|
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
|
-
|
|
119
|
+
l(!0);
|
|
109
120
|
} else
|
|
110
|
-
|
|
111
|
-
return
|
|
112
|
-
},
|
|
113
|
-
const
|
|
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
|
-
|
|
126
|
+
p.current();
|
|
116
127
|
});
|
|
117
128
|
};
|
|
118
|
-
return window.addEventListener("resize",
|
|
119
|
-
window.removeEventListener("resize",
|
|
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]),
|
|
122
|
-
editorState:
|
|
132
|
+
}, [e, o]), G(() => ze(o.registerUpdateListener(({
|
|
133
|
+
editorState: n
|
|
123
134
|
}) => {
|
|
124
|
-
|
|
125
|
-
|
|
135
|
+
n.read(() => {
|
|
136
|
+
p.current();
|
|
126
137
|
});
|
|
127
|
-
}), o.registerCommand(
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
},
|
|
131
|
-
/* @__PURE__ */ t(z, { content: "Bold", children: /* @__PURE__ */ t(D, { "data-active":
|
|
132
|
-
o.dispatchCommand(
|
|
133
|
-
}, variant: "ghost", "aria-label": "Bold", size: "xs", children: /* @__PURE__ */ t(
|
|
134
|
-
/* @__PURE__ */ t(z, { content: "Italic", children: /* @__PURE__ */ t(D, { "data-active":
|
|
135
|
-
o.dispatchCommand(
|
|
136
|
-
}, variant: "ghost", "aria-label": "Italic", size: "xs", children: /* @__PURE__ */ t(
|
|
137
|
-
/* @__PURE__ */ t(z, { content: "Underline", children: /* @__PURE__ */ t(D, { "data-active":
|
|
138
|
-
o.dispatchCommand(
|
|
139
|
-
}, variant: "ghost", "aria-label": "Underline", size: "xs", children: /* @__PURE__ */ t(
|
|
140
|
-
/* @__PURE__ */ t(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
/* @__PURE__ */ t(z, { content: "
|
|
152
|
-
|
|
153
|
-
|
|
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
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
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
|
|
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
|
|
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
|
|
215
|
+
function qt(o) {
|
|
216
216
|
const e = Y(37), {
|
|
217
|
-
roomId:
|
|
218
|
-
wsUrl:
|
|
217
|
+
roomId: i,
|
|
218
|
+
wsUrl: l,
|
|
219
219
|
wsParams: c,
|
|
220
|
-
userName:
|
|
221
|
-
userColor:
|
|
222
|
-
placeholder:
|
|
220
|
+
userName: a,
|
|
221
|
+
userColor: f,
|
|
222
|
+
placeholder: d
|
|
223
223
|
} = o;
|
|
224
|
-
let
|
|
225
|
-
e[0] !== c ? (
|
|
226
|
-
const
|
|
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] !==
|
|
229
|
-
const
|
|
230
|
-
params:
|
|
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
|
|
234
|
-
|
|
235
|
-
}),
|
|
236
|
-
}, e[2] =
|
|
237
|
-
const [
|
|
238
|
-
let
|
|
239
|
-
e[7] !==
|
|
240
|
-
|
|
241
|
-
}), b = [
|
|
242
|
-
let
|
|
243
|
-
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
let
|
|
247
|
-
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
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:
|
|
249
|
+
nodes: se,
|
|
250
250
|
editorState: null,
|
|
251
|
-
onError:
|
|
251
|
+
onError: ut,
|
|
252
252
|
editable: !0,
|
|
253
|
-
theme:
|
|
254
|
-
}, e[12] =
|
|
255
|
-
const
|
|
256
|
-
let
|
|
257
|
-
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
258
|
-
const
|
|
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] !==
|
|
261
|
-
let N, A,
|
|
262
|
-
e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
263
|
-
let
|
|
264
|
-
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
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[
|
|
267
|
-
let
|
|
268
|
-
e[
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
280
|
-
|
|
281
|
-
T,
|
|
282
|
-
y
|
|
281
|
+
x,
|
|
282
|
+
C
|
|
283
283
|
] }) })
|
|
284
|
-
] }), e[33] = _, e[34] =
|
|
284
|
+
] }), e[33] = _, e[34] = x, e[35] = C, e[36] = S) : S = e[36], S;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function ut(o) {
|
|
287
287
|
return console.error(o);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
return new
|
|
289
|
+
function pt() {
|
|
290
|
+
return new Ie.Doc();
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
const e = Y(
|
|
294
|
-
autoFocus:
|
|
295
|
-
debug:
|
|
292
|
+
function Kt(o) {
|
|
293
|
+
const e = Y(47), {
|
|
294
|
+
autoFocus: i,
|
|
295
|
+
debug: l,
|
|
296
296
|
defaultState: c,
|
|
297
|
-
isEditable:
|
|
298
|
-
placeholder:
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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:
|
|
305
|
-
body:
|
|
306
|
-
} =
|
|
307
|
-
let
|
|
308
|
-
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
309
|
-
r
|
|
310
|
-
},
|
|
311
|
-
let b;
|
|
312
|
-
e[4] !== I ? (b = () => Ue(I, oe, void 0, !1), e[4] = I, e[5] = b) : b = e[5];
|
|
313
|
-
let x;
|
|
314
|
-
e[6] !== d || e[7] !== b ? (x = {
|
|
315
|
-
namespace: "MARKDOWN_EDITOR",
|
|
316
|
-
nodes: ae,
|
|
317
|
-
editorState: b,
|
|
318
|
-
onError: at,
|
|
319
|
-
editable: d,
|
|
320
|
-
theme: le
|
|
321
|
-
}, e[6] = d, e[7] = b, 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[
|
|
325
|
-
let
|
|
326
|
-
e[
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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[
|
|
333
|
-
let
|
|
334
|
-
e[
|
|
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[
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
m?.(h + Ce);
|
|
340
|
-
});
|
|
341
|
-
} }) : null, e[25] = h, e[26] = m, 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] !== u ? (y = u && /* @__PURE__ */ t(Ee, {}), e[31] = u, 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
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
-
|
|
356
|
-
|
|
354
|
+
B,
|
|
355
|
+
O,
|
|
356
|
+
H,
|
|
357
357
|
C,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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
|
|
366
|
+
function ht(o) {
|
|
363
367
|
return console.error(o);
|
|
364
368
|
}
|
|
365
|
-
function
|
|
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
|
|
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
|
|
394
|
-
const
|
|
395
|
-
return
|
|
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
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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
|