@pstdio/ui 0.2.0 → 0.2.2
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 +691 -637
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/chat-ui/agent-types.d.ts +1 -0
- package/dist/components/chat-ui/components/ai-conversation.d.ts +21 -579
- package/dist/components/chat-ui/components/ai-conversation.test.d.ts +1 -0
- package/dist/components/chat-ui/components/ai-message.d.ts +8 -8
- package/dist/components/chat-ui/components/chat-panel.d.ts +2 -0
- package/dist/components/chat-ui/components/message-parts-renderer.stories.d.ts +1 -0
- package/dist/components/chat-ui/components/message-types.d.ts +8 -0
- package/dist/components/menu-item.d.ts +3 -1
- package/dist/components/menu-item.stories.d.ts +1 -1
- package/dist/components/rich-text/rich-message/rich-message.d.ts +1 -0
- package/dist/components/rich-text/shared/plugins/CodePlugin/CodeNode.d.ts +2 -0
- package/dist/components/rich-text/shared/plugins/CodePlugin/CodeNode.test.d.ts +1 -0
- package/dist/components/scroll-area.d.ts +1 -0
- package/dist/components/sidebar-next/sidebar-next-header.d.ts +1 -1
- package/dist/components/sidebar-next/sidebar-next.types.d.ts +3 -1
- package/dist/components/sidebar-tree/sidebar-tree.d.ts +2 -1
- package/dist/components/sidebar-tree/sidebar-tree.types.d.ts +9 -1
- package/dist/components/tickets/display-menu.d.ts +15 -0
- package/dist/components/tickets/display-menu.stories.d.ts +6 -0
- package/dist/components/tickets/filter-menu.d.ts +11 -0
- package/dist/components/tickets/filter-menu.stories.d.ts +6 -0
- package/dist/components/tickets/ticket-board.d.ts +7 -0
- package/dist/components/tickets/ticket-grouping.d.ts +22 -0
- package/dist/components/tickets/ticket-grouping.test.d.ts +1 -0
- package/dist/components/tickets/tickets-workspace.d.ts +29 -0
- package/dist/components/tickets/tickets-workspace.stories.d.ts +10 -0
- package/dist/components/tickets/types.d.ts +49 -0
- package/dist/components/tickets/use-workspace-store.d.ts +51 -0
- package/dist/components/tickets/use-workspace-store.test.d.ts +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +2077 -1211
- package/dist/index.js.map +1 -1
- package/dist/{rich-message-B2gxL8oy.js → rich-message-C0_i-4Ux.js} +323 -308
- package/dist/rich-message-C0_i-4Ux.js.map +1 -0
- package/dist/rich-text.js +89 -88
- package/dist/rich-text.js.map +1 -1
- package/dist/scroll-area-DZs-GiIp.js +267 -0
- package/dist/scroll-area-DZs-GiIp.js.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/empty-state-B8mbv7ZH.js +0 -128
- package/dist/empty-state-B8mbv7ZH.js.map +0 -1
- package/dist/rich-message-B2gxL8oy.js.map +0 -1
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
|
-
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-
|
|
4
|
-
import { D as
|
|
5
|
-
import { Stack as Q, IconButton as D, Text as
|
|
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-C0_i-4Ux.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-C0_i-4Ux.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
|
|
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
|
|
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 {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
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
|
-
},
|
|
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(),
|
|
57
|
-
const e =
|
|
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
|
|
65
|
+
return Je(a);
|
|
65
66
|
};
|
|
66
|
-
function
|
|
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] =
|
|
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(
|
|
87
|
-
},
|
|
88
|
-
l !== "number" ? o.dispatchCommand(
|
|
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 =
|
|
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
|
|
105
|
-
re(
|
|
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(
|
|
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(
|
|
133
|
-
/* @__PURE__ */ t(
|
|
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(
|
|
136
|
-
/* @__PURE__ */ t(
|
|
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(
|
|
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(
|
|
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(
|
|
147
|
-
/* @__PURE__ */ t(
|
|
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(
|
|
150
|
-
/* @__PURE__ */ t(
|
|
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(
|
|
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(
|
|
159
|
-
/* @__PURE__ */ t(
|
|
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
|
|
163
|
-
const n = Y(7), [a, c] =
|
|
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(
|
|
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 =
|
|
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
|
|
174
|
+
return nt(a, n);
|
|
174
175
|
}
|
|
175
|
-
function
|
|
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
|
|
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] =
|
|
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 &&
|
|
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] =
|
|
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,
|
|
242
|
+
let x, L;
|
|
242
243
|
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = () => {
|
|
243
244
|
I(M.current);
|
|
244
|
-
},
|
|
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:
|
|
251
|
+
onError: rt,
|
|
251
252
|
editable: !0,
|
|
252
253
|
theme: le
|
|
253
254
|
}, e[12] = E) : E = e[12];
|
|
254
|
-
const
|
|
255
|
+
const j = E;
|
|
255
256
|
let B;
|
|
256
|
-
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ t(
|
|
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:
|
|
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
|
|
286
|
+
function rt(o) {
|
|
286
287
|
return console.error(o);
|
|
287
288
|
}
|
|
288
|
-
function
|
|
289
|
+
function lt() {
|
|
289
290
|
return new Re.Doc();
|
|
290
291
|
}
|
|
291
|
-
function
|
|
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,
|
|
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(
|
|
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 = () =>
|
|
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:
|
|
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
|
|
322
|
+
const L = x;
|
|
322
323
|
let E;
|
|
323
|
-
e[9] !== u ? (E = u ? /* @__PURE__ */ t(
|
|
324
|
-
let
|
|
325
|
-
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
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(
|
|
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 =
|
|
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] !==
|
|
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
|
-
|
|
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] =
|
|
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
|
|
362
|
+
function at(o) {
|
|
362
363
|
return console.error(o);
|
|
363
364
|
}
|
|
364
|
-
function
|
|
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
|
|
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
|
|
393
|
+
function Dt(o) {
|
|
393
394
|
const n = (o.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
|
|
394
|
-
return n ?
|
|
395
|
+
return n ? st[n] ?? null : null;
|
|
395
396
|
}
|
|
396
397
|
export {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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
|