@pstdio/ui 0.14.0 → 0.15.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/{MermaidComponent-CatfVUxA.js → MermaidComponent-DBJsTOmj.js} +3 -3
- package/dist/{MermaidComponent-CatfVUxA.js.map → MermaidComponent-DBJsTOmj.js.map} +1 -1
- package/dist/chat-ui.js +441 -442
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/bubble-button.d.ts +1 -1
- package/dist/components/data-renderer/data-renderer-enum-helpers.d.ts +3 -3
- package/dist/components/data-renderer/data-renderer-helpers.d.ts +2 -0
- package/dist/components/diff-viewer/diff-viewer-options-menu.d.ts +16 -0
- package/dist/components/icon-color-picker.d.ts +2 -6
- package/dist/components/list-row/list-row.types.d.ts +1 -1
- package/dist/components/notification-center/index.d.ts +2 -0
- package/dist/components/notification-center/notification-center.d.ts +2 -0
- package/dist/components/notification-center/notification-center.types.d.ts +37 -0
- package/dist/components/search-modal-content.d.ts +20 -0
- package/dist/components/style-guide-data.d.ts +0 -6
- package/dist/components/tab-strip/tab-visibility-filter.d.ts +4 -2
- package/dist/components/tree-list/tree-list-visibility-filter.d.ts +11 -3
- package/dist/components/tree-list/tree-list.types.d.ts +7 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +4471 -4328
- package/dist/index.js.map +1 -1
- package/dist/mermaid-renderer-CPGj6vsb.js +570 -0
- package/dist/mermaid-renderer-CPGj6vsb.js.map +1 -0
- package/dist/{resource-badge-D33IFv74.js → resource-badge-CeJTOn8F.js} +41 -41
- package/dist/resource-badge-CeJTOn8F.js.map +1 -0
- package/dist/{rich-message-BFtvH9H7.js → rich-message-DNSEhxXh.js} +4 -4
- package/dist/{rich-message-BFtvH9H7.js.map → rich-message-DNSEhxXh.js.map} +1 -1
- package/dist/rich-text.js +405 -399
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/shadowless-default-config.d.ts +2 -0
- package/dist/{theme-C5qHTCU9.js → theme-25P7ij4C.js} +209 -239
- package/dist/theme-25P7ij4C.js.map +1 -0
- package/dist/theme.js +1 -1
- package/package.json +1 -1
- package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -7
- package/dist/mermaid-renderer-DYEiYmYQ.js +0 -411
- package/dist/mermaid-renderer-DYEiYmYQ.js.map +0 -1
- package/dist/resource-badge-D33IFv74.js.map +0 -1
- package/dist/theme/tokens/shadows.d.ts +0 -64
- package/dist/theme-C5qHTCU9.js.map +0 -1
package/dist/rich-text.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
1
|
+
import { jsx as n, jsxs as le, Fragment as ft } from "react/jsx-runtime";
|
|
2
2
|
import { c as te } from "react/compiler-runtime";
|
|
3
|
-
import { T as Ke, e as We, a as Ve, C as Ge, I as qe, E as Ye, b as Xe, s as mt, n as ut, c as
|
|
4
|
-
import { D as
|
|
5
|
-
import { IconButton as
|
|
3
|
+
import { T as Ke, e as We, a as Ve, C as Ge, I as qe, E as Ye, b as Xe, s as mt, n as ut, c as Te, d as ht, f as pt } from "./rich-message-DNSEhxXh.js";
|
|
4
|
+
import { D as mo, g as uo, R as ho, P as po, R as go, h as bo, i as vo } from "./rich-message-DNSEhxXh.js";
|
|
5
|
+
import { IconButton as K, Text as ue, Stack as Ae, Box as De, Flex as Be, Input as gt, Link as bt } from "@chakra-ui/react";
|
|
6
6
|
import { LexicalCollaboration as vt } from "@lexical/react/LexicalCollaborationContext";
|
|
7
7
|
import { CollaborationPluginV2__EXPERIMENTAL as Ct } from "@lexical/react/LexicalCollaborationPlugin";
|
|
8
8
|
import { LexicalComposer as Qe } from "@lexical/react/LexicalComposer";
|
|
@@ -12,39 +12,40 @@ import { LinkPlugin as et } from "@lexical/react/LexicalLinkPlugin";
|
|
|
12
12
|
import { ListPlugin as tt } from "@lexical/react/LexicalListPlugin";
|
|
13
13
|
import { RichTextPlugin as nt } from "@lexical/react/LexicalRichTextPlugin";
|
|
14
14
|
import { TabIndentationPlugin as ot } from "@lexical/react/LexicalTabIndentationPlugin";
|
|
15
|
-
import { useState as
|
|
16
|
-
import { WebsocketProvider as
|
|
17
|
-
import * as
|
|
18
|
-
import { useLexicalComposerContext as
|
|
19
|
-
import { mergeRegister as
|
|
20
|
-
import { SELECTION_CHANGE_COMMAND as
|
|
21
|
-
import { Check as rt, Copy as Rt, Link as wt, Code2 as Nt, List as It, ListOrdered as Pt, ListTodo as At, X as Bt, Pencil as
|
|
22
|
-
import { createPortal as
|
|
23
|
-
import { T as
|
|
24
|
-
import { $isCodeNode as
|
|
25
|
-
import { $isLinkNode as
|
|
26
|
-
import { $isListNode as
|
|
15
|
+
import { useState as A, useRef as ie, useEffect as Y, useLayoutEffect as _t } from "react";
|
|
16
|
+
import { WebsocketProvider as kt } from "y-websocket";
|
|
17
|
+
import * as Et from "yjs";
|
|
18
|
+
import { useLexicalComposerContext as Oe } from "@lexical/react/LexicalComposerContext";
|
|
19
|
+
import { mergeRegister as Se, $findMatchingParent as Z } from "@lexical/utils";
|
|
20
|
+
import { SELECTION_CHANGE_COMMAND as ye, COMMAND_PRIORITY_CRITICAL as Ue, $getSelection as ee, $isRangeSelection as Q, FORMAT_TEXT_COMMAND as Re, $isRootOrShadowRoot as St, CLICK_COMMAND as it, COMMAND_PRIORITY_HIGH as lt, $createParagraphNode as Fe, COMMAND_PRIORITY_LOW as Me, KEY_ESCAPE_COMMAND as yt, $isLineBreakNode as Lt, $setSelection as xt, $getRoot as Tt } from "lexical";
|
|
21
|
+
import { Check as rt, Copy as Rt, Link as wt, Code2 as Nt, List as It, ListOrdered as Pt, ListTodo as At, X as Bt, Pencil as Mt, Trash2 as zt } from "lucide-react";
|
|
22
|
+
import { createPortal as He } from "react-dom";
|
|
23
|
+
import { T as W } from "./resource-badge-CeJTOn8F.js";
|
|
24
|
+
import { $isCodeNode as we, $createCodeNode as $t } from "@lexical/code";
|
|
25
|
+
import { $isLinkNode as re, $isAutoLinkNode as pe, TOGGLE_LINK_COMMAND as ze, $createLinkNode as Dt } from "@lexical/link";
|
|
26
|
+
import { $isListNode as Ne, REMOVE_LIST_COMMAND as Ot, INSERT_CHECK_LIST_COMMAND as Ut, INSERT_ORDERED_LIST_COMMAND as Ht, INSERT_UNORDERED_LIST_COMMAND as Ft } from "@lexical/list";
|
|
27
27
|
import { $isHeadingNode as jt, $createHeadingNode as Kt } from "@lexical/rich-text";
|
|
28
28
|
import { $isAtNodeEnd as je, $setBlocksType as _e } from "@lexical/selection";
|
|
29
29
|
import { $convertFromMarkdownString as Wt, $convertToMarkdownString as Vt } from "@lexical/markdown";
|
|
30
30
|
import { AutoFocusPlugin as Gt } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
31
31
|
import { CheckListPlugin as qt } from "@lexical/react/LexicalCheckListPlugin";
|
|
32
32
|
import { HistoryPlugin as Yt } from "@lexical/react/LexicalHistoryPlugin";
|
|
33
|
-
import {
|
|
34
|
-
|
|
33
|
+
import { MarkdownShortcutPlugin as Xt } from "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
34
|
+
import { OnChangePlugin as Qt } from "@lexical/react/LexicalOnChangePlugin";
|
|
35
|
+
function Ie(t) {
|
|
35
36
|
const e = ee();
|
|
36
37
|
if (!Q(e))
|
|
37
38
|
return null;
|
|
38
|
-
const r = e.anchor.getNode(), o =
|
|
39
|
-
if (!
|
|
39
|
+
const r = e.anchor.getNode(), o = we(r) ? r : Z(r, (u) => we(u));
|
|
40
|
+
if (!we(o))
|
|
40
41
|
return null;
|
|
41
42
|
const l = t.getElementByKey(o.getKey());
|
|
42
43
|
return l instanceof HTMLElement ? l : null;
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function Zt(t) {
|
|
45
46
|
return t instanceof HTMLElement ? t.closest(".rich-text__code") : null;
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function Jt(t, e) {
|
|
48
49
|
const r = t.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
49
50
|
return {
|
|
50
51
|
top: o.top - r.top + 6,
|
|
@@ -54,49 +55,49 @@ function Zt(t, e) {
|
|
|
54
55
|
function st(t) {
|
|
55
56
|
const e = te(31), {
|
|
56
57
|
anchorElem: r
|
|
57
|
-
} = t, [o] =
|
|
58
|
-
let p,
|
|
58
|
+
} = t, [o] = Oe(), [l, u] = A(null), [S, h] = A(!1), a = ie(null);
|
|
59
|
+
let p, k;
|
|
59
60
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => () => {
|
|
60
61
|
a.current !== null && window.clearTimeout(a.current);
|
|
61
|
-
},
|
|
62
|
-
let b,
|
|
62
|
+
}, k = [], e[0] = p, e[1] = k) : (p = e[0], k = e[1]), Y(p, k);
|
|
63
|
+
let b, d;
|
|
63
64
|
e[2] !== o ? (b = () => {
|
|
64
65
|
const _ = o.getRootElement();
|
|
65
66
|
if (!_)
|
|
66
67
|
return;
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
68
|
+
const E = (I) => {
|
|
69
|
+
const B = Zt(I.target);
|
|
70
|
+
u(B instanceof HTMLElement ? B : null);
|
|
70
71
|
}, N = () => {
|
|
71
72
|
o.getEditorState().read(() => {
|
|
72
|
-
const I =
|
|
73
|
-
|
|
73
|
+
const I = Ie(o);
|
|
74
|
+
u(I);
|
|
74
75
|
});
|
|
75
76
|
};
|
|
76
|
-
return _.addEventListener("pointermove",
|
|
77
|
-
_.removeEventListener("pointermove",
|
|
77
|
+
return _.addEventListener("pointermove", E), _.addEventListener("pointerleave", N), () => {
|
|
78
|
+
_.removeEventListener("pointermove", E), _.removeEventListener("pointerleave", N);
|
|
78
79
|
};
|
|
79
|
-
},
|
|
80
|
+
}, d = [o], e[2] = o, e[3] = b, e[4] = d) : (b = e[3], d = e[4]), Y(b, d);
|
|
80
81
|
let C, R;
|
|
81
|
-
if (e[5] !== o ? (C = () =>
|
|
82
|
+
if (e[5] !== o ? (C = () => Se(o.registerUpdateListener((_) => {
|
|
82
83
|
const {
|
|
83
|
-
editorState:
|
|
84
|
+
editorState: E
|
|
84
85
|
} = _;
|
|
85
|
-
|
|
86
|
-
const N =
|
|
87
|
-
N &&
|
|
86
|
+
E.read(() => {
|
|
87
|
+
const N = Ie(o);
|
|
88
|
+
N && u(N);
|
|
88
89
|
});
|
|
89
|
-
}), o.registerCommand(
|
|
90
|
-
const _ =
|
|
90
|
+
}), o.registerCommand(ye, () => (o.getEditorState().read(() => {
|
|
91
|
+
const _ = Ie(o);
|
|
91
92
|
if (!_) {
|
|
92
|
-
|
|
93
|
+
u(en);
|
|
93
94
|
return;
|
|
94
95
|
}
|
|
95
|
-
|
|
96
|
-
}), !1),
|
|
96
|
+
u(_);
|
|
97
|
+
}), !1), Ue)), R = [o], e[5] = o, e[6] = C, e[7] = R) : (C = e[6], R = e[7]), Y(C, R), !r || !l)
|
|
97
98
|
return null;
|
|
98
99
|
let c;
|
|
99
|
-
e[8] !== l || e[9] !== r ? (c =
|
|
100
|
+
e[8] !== l || e[9] !== r ? (c = Jt(r, l), e[8] = l, e[9] = r, e[10] = c) : c = e[10];
|
|
100
101
|
const w = c;
|
|
101
102
|
let v;
|
|
102
103
|
e[11] !== w.left || e[12] !== w.top ? (v = {
|
|
@@ -104,48 +105,48 @@ function st(t) {
|
|
|
104
105
|
top: w.top,
|
|
105
106
|
left: w.left
|
|
106
107
|
}, e[11] = w.left, e[12] = w.top, e[13] = v) : v = e[13];
|
|
107
|
-
const
|
|
108
|
+
const y = v, g = S ? "Copied" : "Copy code", f = S ? "Copied" : "Copy code";
|
|
108
109
|
let i;
|
|
109
110
|
e[14] !== l.textContent ? (i = async () => {
|
|
110
111
|
const _ = l.textContent ?? "";
|
|
111
112
|
try {
|
|
112
|
-
await navigator.clipboard.writeText(_),
|
|
113
|
-
|
|
113
|
+
await navigator.clipboard.writeText(_), h(!0), a.current !== null && window.clearTimeout(a.current), a.current = window.setTimeout(() => {
|
|
114
|
+
h(!1);
|
|
114
115
|
}, 1200);
|
|
115
116
|
} catch {
|
|
116
|
-
|
|
117
|
+
h(!1);
|
|
117
118
|
}
|
|
118
119
|
}, e[14] = l.textContent, e[15] = i) : i = e[15];
|
|
119
120
|
let s;
|
|
120
|
-
e[16] !==
|
|
121
|
-
let
|
|
122
|
-
e[18] !==
|
|
123
|
-
let
|
|
124
|
-
e[22] !==
|
|
121
|
+
e[16] !== S ? (s = S ? /* @__PURE__ */ n(rt, { size: 14 }) : /* @__PURE__ */ n(Rt, { size: 14 }), e[16] = S, e[17] = s) : s = e[17];
|
|
122
|
+
let m;
|
|
123
|
+
e[18] !== f || e[19] !== i || e[20] !== s ? (m = /* @__PURE__ */ n(K, { "aria-label": f, variant: "surface", size: "xs", onClick: i, children: s }), e[18] = f, e[19] = i, e[20] = s, e[21] = m) : m = e[21];
|
|
124
|
+
let L;
|
|
125
|
+
e[22] !== m || e[23] !== g ? (L = /* @__PURE__ */ n(W, { content: g, children: m }), e[22] = m, e[23] = g, e[24] = L) : L = e[24];
|
|
125
126
|
let x;
|
|
126
|
-
e[25] !==
|
|
127
|
+
e[25] !== y || e[26] !== L ? (x = /* @__PURE__ */ n("div", { className: "code-block-actions", style: y, children: L }), e[25] = y, e[26] = L, e[27] = x) : x = e[27];
|
|
127
128
|
let T;
|
|
128
|
-
return e[28] !== r || e[29] !== x ? (T =
|
|
129
|
+
return e[28] !== r || e[29] !== x ? (T = He(x, r), e[28] = r, e[29] = x, e[30] = T) : T = e[30], T;
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
+
function en(t) {
|
|
131
132
|
return t?.matches(":hover") ? t : null;
|
|
132
133
|
}
|
|
133
|
-
function
|
|
134
|
+
function ge(t) {
|
|
134
135
|
const e = t.anchor, r = t.focus, o = t.anchor.getNode(), l = t.focus.getNode();
|
|
135
136
|
return o === l ? o : t.isBackward() ? je(r) ? o : l : je(e) ? o : l;
|
|
136
137
|
}
|
|
137
|
-
const
|
|
138
|
-
function
|
|
139
|
-
const
|
|
140
|
-
if (t === null || !
|
|
138
|
+
const tn = 10, nn = 5;
|
|
139
|
+
function Ee(t, e, r, o = tn, l = nn, u = "legacy") {
|
|
140
|
+
const S = r.parentElement;
|
|
141
|
+
if (t === null || !S) {
|
|
141
142
|
e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)";
|
|
142
143
|
return;
|
|
143
144
|
}
|
|
144
|
-
const
|
|
145
|
-
let
|
|
146
|
-
|
|
145
|
+
const h = e.getBoundingClientRect(), a = r.getBoundingClientRect(), p = S.getBoundingClientRect();
|
|
146
|
+
let k = u === "above" ? t.top - h.height - o : t.top - o, b = t.left - l;
|
|
147
|
+
k < p.top && (k = u === "above" ? t.bottom + o : k + h.height + t.height + o * 2), b + h.width > p.right && (b = p.right - h.width - l), k -= a.top, b -= a.left, e.style.opacity = "1", e.style.transform = `translate(${b}px, ${k}px)`;
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
+
function Pe() {
|
|
149
150
|
const t = te(1);
|
|
150
151
|
let e;
|
|
151
152
|
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n("span", { style: {
|
|
@@ -155,118 +156,118 @@ function Ie() {
|
|
|
155
156
|
borderLeft: "1px solid var(--chakra-colors-border-muted)"
|
|
156
157
|
} }), t[0] = e) : e = t[0], e;
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function on(t) {
|
|
159
160
|
const e = te(81), {
|
|
160
161
|
editor: r,
|
|
161
162
|
blockType: o,
|
|
162
163
|
isBold: l,
|
|
163
|
-
isItalic:
|
|
164
|
-
isUnderline:
|
|
165
|
-
isLink:
|
|
164
|
+
isItalic: u,
|
|
165
|
+
isUnderline: S,
|
|
166
|
+
isLink: h,
|
|
166
167
|
formatHeading: a,
|
|
167
168
|
formatList: p,
|
|
168
|
-
formatCodeBlock:
|
|
169
|
+
formatCodeBlock: k,
|
|
169
170
|
insertLink: b
|
|
170
|
-
} = t,
|
|
171
|
+
} = t, d = l || void 0;
|
|
171
172
|
let C;
|
|
172
|
-
e[0] !== r ? (C = () => r.dispatchCommand(
|
|
173
|
+
e[0] !== r ? (C = () => r.dispatchCommand(Re, "bold"), e[0] = r, e[1] = C) : C = e[1];
|
|
173
174
|
let R;
|
|
174
|
-
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n(
|
|
175
|
+
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n(ue, { fontWeight: "bold", fontSize: ".75rem", children: "B" }), e[2] = R) : R = e[2];
|
|
175
176
|
let c;
|
|
176
|
-
e[3] !==
|
|
177
|
-
const w =
|
|
177
|
+
e[3] !== d || e[4] !== C ? (c = /* @__PURE__ */ n(W, { content: "Bold", children: /* @__PURE__ */ n(K, { "data-active": d, onClick: C, variant: "ghost", "aria-label": "Bold", size: "xs", children: R }) }), e[3] = d, e[4] = C, e[5] = c) : c = e[5];
|
|
178
|
+
const w = u || void 0;
|
|
178
179
|
let v;
|
|
179
|
-
e[6] !== r ? (v = () => r.dispatchCommand(
|
|
180
|
-
let
|
|
181
|
-
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
180
|
+
e[6] !== r ? (v = () => r.dispatchCommand(Re, "italic"), e[6] = r, e[7] = v) : v = e[7];
|
|
181
|
+
let y;
|
|
182
|
+
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ n(ue, { fontStyle: "italic", fontSize: ".75rem", children: "I" }), e[8] = y) : y = e[8];
|
|
182
183
|
let g;
|
|
183
|
-
e[9] !== w || e[10] !== v ? (g = /* @__PURE__ */ n(
|
|
184
|
-
const
|
|
184
|
+
e[9] !== w || e[10] !== v ? (g = /* @__PURE__ */ n(W, { content: "Italic", children: /* @__PURE__ */ n(K, { "data-active": w, onClick: v, variant: "ghost", "aria-label": "Italic", size: "xs", children: y }) }), e[9] = w, e[10] = v, e[11] = g) : g = e[11];
|
|
185
|
+
const f = S || void 0;
|
|
185
186
|
let i;
|
|
186
|
-
e[12] !== r ? (i = () => r.dispatchCommand(
|
|
187
|
+
e[12] !== r ? (i = () => r.dispatchCommand(Re, "underline"), e[12] = r, e[13] = i) : i = e[13];
|
|
187
188
|
let s;
|
|
188
|
-
e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ n(
|
|
189
|
-
let
|
|
190
|
-
e[15] !==
|
|
191
|
-
const
|
|
189
|
+
e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ n(ue, { textDecoration: "underline", fontSize: ".75rem", children: "U" }), e[14] = s) : s = e[14];
|
|
190
|
+
let m;
|
|
191
|
+
e[15] !== f || e[16] !== i ? (m = /* @__PURE__ */ n(W, { content: "Underline", children: /* @__PURE__ */ n(K, { "data-active": f, onClick: i, variant: "ghost", "aria-label": "Underline", size: "xs", children: s }) }), e[15] = f, e[16] = i, e[17] = m) : m = e[17];
|
|
192
|
+
const L = h ? "Remove Link" : "Insert Link", x = h || void 0, T = h ? "Remove Link" : "Insert Link";
|
|
192
193
|
let _;
|
|
193
194
|
e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(wt, { size: 14 }), e[18] = _) : _ = e[18];
|
|
194
|
-
let
|
|
195
|
-
e[19] !== b || e[20] !== x || e[21] !== T ? (
|
|
195
|
+
let E;
|
|
196
|
+
e[19] !== b || e[20] !== x || e[21] !== T ? (E = /* @__PURE__ */ n(K, { "data-active": x, variant: "ghost", "aria-label": T, size: "xs", onClick: b, children: _ }), e[19] = b, e[20] = x, e[21] = T, e[22] = E) : E = e[22];
|
|
196
197
|
let N;
|
|
197
|
-
e[23] !==
|
|
198
|
+
e[23] !== L || e[24] !== E ? (N = /* @__PURE__ */ n(W, { content: L, children: E }), e[23] = L, e[24] = E, e[25] = N) : N = e[25];
|
|
198
199
|
let I;
|
|
199
|
-
e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n(
|
|
200
|
-
const
|
|
200
|
+
e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n(Pe, {}), e[26] = I) : I = e[26];
|
|
201
|
+
const B = o === "h1" || void 0;
|
|
202
|
+
let $;
|
|
203
|
+
e[27] !== a ? ($ = () => a("h1"), e[27] = a, e[28] = $) : $ = e[28];
|
|
201
204
|
let D;
|
|
202
|
-
e[
|
|
203
|
-
let W;
|
|
204
|
-
e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ n(me, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }), e[29] = W) : W = e[29];
|
|
205
|
+
e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }), e[29] = D) : D = e[29];
|
|
205
206
|
let O;
|
|
206
|
-
e[30] !==
|
|
207
|
-
const
|
|
208
|
-
let M;
|
|
209
|
-
e[33] !== a ? (M = () => a("h2"), e[33] = a, e[34] = M) : M = e[34];
|
|
210
|
-
let V;
|
|
211
|
-
e[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n(me, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }), e[35] = V) : V = e[35];
|
|
212
|
-
let P;
|
|
213
|
-
e[36] !== K || e[37] !== M ? (P = /* @__PURE__ */ n(j, { content: "Heading 2", children: /* @__PURE__ */ n(F, { "data-active": K, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: M, children: V }) }), e[36] = K, e[37] = M, e[38] = P) : P = e[38];
|
|
214
|
-
const $ = o === "h3" || void 0;
|
|
215
|
-
let A;
|
|
216
|
-
e[39] !== a ? (A = () => a("h3"), e[39] = a, e[40] = A) : A = e[40];
|
|
207
|
+
e[30] !== B || e[31] !== $ ? (O = /* @__PURE__ */ n(W, { content: "Heading 1", children: /* @__PURE__ */ n(K, { "data-active": B, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: $, children: D }) }), e[30] = B, e[31] = $, e[32] = O) : O = e[32];
|
|
208
|
+
const V = o === "h2" || void 0;
|
|
217
209
|
let U;
|
|
218
|
-
e[
|
|
210
|
+
e[33] !== a ? (U = () => a("h2"), e[33] = a, e[34] = U) : U = e[34];
|
|
219
211
|
let H;
|
|
220
|
-
e[
|
|
212
|
+
e[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }), e[35] = H) : H = e[35];
|
|
213
|
+
let M;
|
|
214
|
+
e[36] !== V || e[37] !== U ? (M = /* @__PURE__ */ n(W, { content: "Heading 2", children: /* @__PURE__ */ n(K, { "data-active": V, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: U, children: H }) }), e[36] = V, e[37] = U, e[38] = M) : M = e[38];
|
|
215
|
+
const z = o === "h3" || void 0;
|
|
216
|
+
let P;
|
|
217
|
+
e[39] !== a ? (P = () => a("h3"), e[39] = a, e[40] = P) : P = e[40];
|
|
218
|
+
let F;
|
|
219
|
+
e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }), e[41] = F) : F = e[41];
|
|
220
|
+
let j;
|
|
221
|
+
e[42] !== z || e[43] !== P ? (j = /* @__PURE__ */ n(W, { content: "Heading 3", children: /* @__PURE__ */ n(K, { "data-active": z, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: P, children: F }) }), e[42] = z, e[43] = P, e[44] = j) : j = e[44];
|
|
221
222
|
let G;
|
|
222
|
-
e[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ n(
|
|
223
|
+
e[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ n(Pe, {}), e[45] = G) : G = e[45];
|
|
223
224
|
const J = o === "code" || void 0;
|
|
224
|
-
let Y;
|
|
225
|
-
e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Y = /* @__PURE__ */ n(Nt, { size: 14 }), e[46] = Y) : Y = e[46];
|
|
226
225
|
let X;
|
|
227
|
-
e[
|
|
228
|
-
let
|
|
229
|
-
e[
|
|
230
|
-
const ue = o === "bullet" || void 0;
|
|
226
|
+
e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ n(Nt, { size: 14 }), e[46] = X) : X = e[46];
|
|
227
|
+
let q;
|
|
228
|
+
e[47] !== k || e[48] !== J ? (q = /* @__PURE__ */ n(W, { content: "Code Block", children: /* @__PURE__ */ n(K, { "data-active": J, variant: "ghost", "aria-label": "Code Block", size: "xs", onClick: k, children: X }) }), e[47] = k, e[48] = J, e[49] = q) : q = e[49];
|
|
231
229
|
let ne;
|
|
232
|
-
e[
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
e[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ne = /* @__PURE__ */ n(Pe, {}), e[50] = ne) : ne = e[50];
|
|
231
|
+
const he = o === "bullet" || void 0;
|
|
232
|
+
let oe;
|
|
233
|
+
e[51] !== p ? (oe = () => p("bullet"), e[51] = p, e[52] = oe) : oe = e[52];
|
|
235
234
|
let se;
|
|
236
|
-
e[
|
|
237
|
-
const ye = o === "number" || void 0;
|
|
235
|
+
e[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ n(It, { size: 14 }), e[53] = se) : se = e[53];
|
|
238
236
|
let ae;
|
|
239
|
-
e[
|
|
237
|
+
e[54] !== he || e[55] !== oe ? (ae = /* @__PURE__ */ n(W, { content: "Bulleted List", children: /* @__PURE__ */ n(K, { "data-active": he, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: oe, children: se }) }), e[54] = he, e[55] = oe, e[56] = ae) : ae = e[56];
|
|
238
|
+
const Le = o === "number" || void 0;
|
|
239
|
+
let ce;
|
|
240
|
+
e[57] !== p ? (ce = () => p("number"), e[57] = p, e[58] = ce) : ce = e[58];
|
|
240
241
|
let be;
|
|
241
242
|
e[59] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (be = /* @__PURE__ */ n(Pt, { size: 14 }), e[59] = be) : be = e[59];
|
|
242
|
-
let ce;
|
|
243
|
-
e[60] !== ye || e[61] !== ae ? (ce = /* @__PURE__ */ n(j, { content: "Numbered List", children: /* @__PURE__ */ n(F, { "data-active": ye, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: ae, children: be }) }), e[60] = ye, e[61] = ae, e[62] = ce) : ce = e[62];
|
|
244
|
-
const xe = o === "check" || void 0;
|
|
245
243
|
let de;
|
|
246
|
-
e[
|
|
244
|
+
e[60] !== Le || e[61] !== ce ? (de = /* @__PURE__ */ n(W, { content: "Numbered List", children: /* @__PURE__ */ n(K, { "data-active": Le, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: ce, children: be }) }), e[60] = Le, e[61] = ce, e[62] = de) : de = e[62];
|
|
245
|
+
const xe = o === "check" || void 0;
|
|
246
|
+
let fe;
|
|
247
|
+
e[63] !== p ? (fe = () => p("check"), e[63] = p, e[64] = fe) : fe = e[64];
|
|
247
248
|
let ve;
|
|
248
249
|
e[65] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ve = /* @__PURE__ */ n(At, { size: 14 }), e[65] = ve) : ve = e[65];
|
|
249
|
-
let
|
|
250
|
-
e[66] !== xe || e[67] !==
|
|
250
|
+
let me;
|
|
251
|
+
e[66] !== xe || e[67] !== fe ? (me = /* @__PURE__ */ n(W, { content: "Check List", children: /* @__PURE__ */ n(K, { "data-active": xe, variant: "ghost", "aria-label": "Check List", size: "xs", onClick: fe, children: ve }) }), e[66] = xe, e[67] = fe, e[68] = me) : me = e[68];
|
|
251
252
|
let Ce;
|
|
252
|
-
return e[69] !==
|
|
253
|
+
return e[69] !== m || e[70] !== N || e[71] !== O || e[72] !== M || e[73] !== c || e[74] !== j || e[75] !== q || e[76] !== ae || e[77] !== de || e[78] !== me || e[79] !== g ? (Ce = /* @__PURE__ */ le(Ae, { direction: "row", gap: "0.5", alignItems: "center", children: [
|
|
253
254
|
c,
|
|
254
255
|
g,
|
|
255
|
-
|
|
256
|
+
m,
|
|
256
257
|
N,
|
|
257
258
|
I,
|
|
258
259
|
O,
|
|
259
|
-
|
|
260
|
-
|
|
260
|
+
M,
|
|
261
|
+
j,
|
|
261
262
|
G,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
] }), e[69] =
|
|
268
|
-
}
|
|
269
|
-
const
|
|
263
|
+
q,
|
|
264
|
+
ne,
|
|
265
|
+
ae,
|
|
266
|
+
de,
|
|
267
|
+
me
|
|
268
|
+
] }), e[69] = m, e[70] = N, e[71] = O, e[72] = M, e[73] = c, e[74] = j, e[75] = q, e[76] = ae, e[77] = de, e[78] = me, e[79] = g, e[80] = Ce) : Ce = e[80], Ce;
|
|
269
|
+
}
|
|
270
|
+
const ln = {
|
|
270
271
|
bullet: "Bulleted List",
|
|
271
272
|
check: "Check List",
|
|
272
273
|
code: "Code Block",
|
|
@@ -279,44 +280,44 @@ const on = {
|
|
|
279
280
|
number: "Numbered List",
|
|
280
281
|
paragraph: "Normal",
|
|
281
282
|
quote: "Quote"
|
|
282
|
-
},
|
|
283
|
+
}, rn = (t) => t in ln ? t : null, sn = (t) => (t.getKey() === "root" ? t : Z(t, (r) => {
|
|
283
284
|
const o = r.getParent();
|
|
284
|
-
return o !== null &&
|
|
285
|
-
})) ?? t.getTopLevelElementOrThrow(),
|
|
286
|
-
const e =
|
|
287
|
-
if (
|
|
285
|
+
return o !== null && St(o);
|
|
286
|
+
})) ?? t.getTopLevelElementOrThrow(), an = (t) => {
|
|
287
|
+
const e = sn(t);
|
|
288
|
+
if (Ne(e))
|
|
288
289
|
return e.getListType();
|
|
289
|
-
const r = Z(t, (l) =>
|
|
290
|
-
if (r !== null &&
|
|
290
|
+
const r = Z(t, (l) => Ne(l));
|
|
291
|
+
if (r !== null && Ne(r))
|
|
291
292
|
return r.getListType();
|
|
292
293
|
const o = jt(e) ? e.getTag() : e.getType();
|
|
293
|
-
return
|
|
294
|
+
return rn(o);
|
|
294
295
|
};
|
|
295
|
-
function
|
|
296
|
+
function cn(t) {
|
|
296
297
|
const {
|
|
297
298
|
hasSelection: e,
|
|
298
299
|
isRangeSelection: r,
|
|
299
300
|
isCollapsed: o,
|
|
300
301
|
hasNativeSelection: l,
|
|
301
|
-
hasNativeRange:
|
|
302
|
-
isAnchorInsideEditor:
|
|
303
|
-
isEditorEditable:
|
|
302
|
+
hasNativeRange: u,
|
|
303
|
+
isAnchorInsideEditor: S,
|
|
304
|
+
isEditorEditable: h
|
|
304
305
|
} = t;
|
|
305
|
-
return e && r && !o && l &&
|
|
306
|
+
return e && r && !o && l && u && S && h;
|
|
306
307
|
}
|
|
307
|
-
const
|
|
308
|
-
function
|
|
308
|
+
const dn = -4;
|
|
309
|
+
function fn({
|
|
309
310
|
editor: t,
|
|
310
311
|
anchorElem: e,
|
|
311
312
|
isToolbarActive: r,
|
|
312
313
|
setIsToolbarActive: o
|
|
313
314
|
}) {
|
|
314
|
-
const l =
|
|
315
|
+
const l = ie(null), [u, S] = A("paragraph"), [h, a] = A(!1), [p, k] = A(!1), [b, d] = A(!1), [C, R] = A(!1), c = ie(() => {
|
|
315
316
|
}), w = (i) => {
|
|
316
317
|
t.update(() => {
|
|
317
318
|
const s = ee();
|
|
318
319
|
if (Q(s)) {
|
|
319
|
-
if (
|
|
320
|
+
if (u === i) {
|
|
320
321
|
_e(s, Fe);
|
|
321
322
|
return;
|
|
322
323
|
}
|
|
@@ -324,7 +325,7 @@ function dn({
|
|
|
324
325
|
}
|
|
325
326
|
});
|
|
326
327
|
}, v = (i) => {
|
|
327
|
-
if (
|
|
328
|
+
if (u === i) {
|
|
328
329
|
t.dispatchCommand(Ot, void 0);
|
|
329
330
|
return;
|
|
330
331
|
}
|
|
@@ -334,11 +335,11 @@ function dn({
|
|
|
334
335
|
check: Ut
|
|
335
336
|
}[i];
|
|
336
337
|
t.dispatchCommand(s, void 0);
|
|
337
|
-
},
|
|
338
|
+
}, y = () => {
|
|
338
339
|
t.update(() => {
|
|
339
340
|
const i = ee();
|
|
340
341
|
if (Q(i)) {
|
|
341
|
-
if (
|
|
342
|
+
if (u === "code") {
|
|
342
343
|
_e(i, Fe);
|
|
343
344
|
return;
|
|
344
345
|
}
|
|
@@ -351,21 +352,21 @@ function dn({
|
|
|
351
352
|
return;
|
|
352
353
|
}
|
|
353
354
|
t.dispatchCommand(Ke, !0);
|
|
354
|
-
},
|
|
355
|
+
}, f = () => {
|
|
355
356
|
const i = ee();
|
|
356
357
|
if (!Q(i)) return;
|
|
357
|
-
a(i.hasFormat("bold")),
|
|
358
|
-
const s =
|
|
359
|
-
R(
|
|
360
|
-
const x =
|
|
361
|
-
x &&
|
|
358
|
+
a(i.hasFormat("bold")), k(i.hasFormat("italic")), d(i.hasFormat("underline"));
|
|
359
|
+
const s = ge(i), m = Z(s, re), L = Z(s, pe);
|
|
360
|
+
R(m !== null || L !== null);
|
|
361
|
+
const x = an(i.anchor.getNode());
|
|
362
|
+
x && S(x);
|
|
362
363
|
};
|
|
363
364
|
return c.current = () => {
|
|
364
|
-
const i = ee(), s = l.current,
|
|
365
|
+
const i = ee(), s = l.current, m = window.getSelection();
|
|
365
366
|
if (s === null)
|
|
366
367
|
return;
|
|
367
|
-
const
|
|
368
|
-
if (
|
|
368
|
+
const L = t.getRootElement(), x = m !== null, T = x && m.rangeCount > 0, _ = !!L?.contains(x ? m.anchorNode : null);
|
|
369
|
+
if (cn({
|
|
369
370
|
hasSelection: i !== null,
|
|
370
371
|
isRangeSelection: Q(i),
|
|
371
372
|
isCollapsed: Q(i) ? i.isCollapsed() : !1,
|
|
@@ -373,17 +374,17 @@ function dn({
|
|
|
373
374
|
hasNativeRange: T,
|
|
374
375
|
isAnchorInsideEditor: _,
|
|
375
376
|
isEditorEditable: t.isEditable()
|
|
376
|
-
}) &&
|
|
377
|
-
const
|
|
378
|
-
if (
|
|
379
|
-
const N = new DOMRect(
|
|
380
|
-
|
|
377
|
+
}) && m) {
|
|
378
|
+
const E = m.getRangeAt(0).getBoundingClientRect();
|
|
379
|
+
if (E) {
|
|
380
|
+
const N = new DOMRect(E.left, E.bottom, 0, 0);
|
|
381
|
+
Ee(N, s, e, dn);
|
|
381
382
|
}
|
|
382
383
|
o(!0);
|
|
383
384
|
} else
|
|
384
|
-
|
|
385
|
-
return
|
|
386
|
-
},
|
|
385
|
+
L !== null && Ee(null, s, e), o(!1);
|
|
386
|
+
return f(), !0;
|
|
387
|
+
}, Y(() => {
|
|
387
388
|
const i = e.parentElement, s = () => {
|
|
388
389
|
t.getEditorState().read(() => {
|
|
389
390
|
c.current();
|
|
@@ -392,27 +393,27 @@ function dn({
|
|
|
392
393
|
return window.addEventListener("resize", s), i && i.addEventListener("scroll", s), () => {
|
|
393
394
|
window.removeEventListener("resize", s), i && i.removeEventListener("scroll", s);
|
|
394
395
|
};
|
|
395
|
-
}, [e, t]),
|
|
396
|
+
}, [e, t]), Y(() => Se(t.registerUpdateListener(({
|
|
396
397
|
editorState: i
|
|
397
398
|
}) => {
|
|
398
399
|
i.read(() => {
|
|
399
400
|
c.current();
|
|
400
401
|
});
|
|
401
|
-
}), t.registerCommand(
|
|
402
|
+
}), t.registerCommand(ye, (i) => (c.current(), !1), Ue), t.registerCommand(it, (i) => {
|
|
402
403
|
const s = ee();
|
|
403
404
|
return Q(s) && c.current(), !1;
|
|
404
|
-
}, lt)), [t]), /* @__PURE__ */ n("div", { ref: l, className: `floating-text-format-toolbar ${r ? "active" : ""}`, children: /* @__PURE__ */ n(
|
|
405
|
+
}, lt)), [t]), /* @__PURE__ */ n("div", { ref: l, className: `floating-text-format-toolbar ${r ? "active" : ""}`, children: /* @__PURE__ */ n(on, { editor: t, blockType: u, isBold: h, isItalic: p, isUnderline: b, isLink: C, formatHeading: w, formatList: v, formatCodeBlock: y, insertLink: g }) });
|
|
405
406
|
}
|
|
406
407
|
function at(t) {
|
|
407
408
|
const e = te(7), {
|
|
408
409
|
anchorElem: r
|
|
409
|
-
} = t, o = r === void 0 ? document.body : r, [l] =
|
|
410
|
-
let
|
|
411
|
-
e[0] !== o || e[1] !== l || e[2] !==
|
|
410
|
+
} = t, o = r === void 0 ? document.body : r, [l] = Oe(), [u, S] = A(!1);
|
|
411
|
+
let h;
|
|
412
|
+
e[0] !== o || e[1] !== l || e[2] !== u ? (h = /* @__PURE__ */ n(fn, { editor: l, anchorElem: o, isToolbarActive: u, setIsToolbarActive: S }), e[0] = o, e[1] = l, e[2] = u, e[3] = h) : h = e[3];
|
|
412
413
|
let a;
|
|
413
|
-
return e[4] !== o || e[5] !==
|
|
414
|
+
return e[4] !== o || e[5] !== h ? (a = He(h, o), e[4] = o, e[5] = h, e[6] = a) : a = e[6], a;
|
|
414
415
|
}
|
|
415
|
-
function
|
|
416
|
+
function mn() {
|
|
416
417
|
const t = te(1);
|
|
417
418
|
let e;
|
|
418
419
|
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n("style", { children: `
|
|
@@ -451,161 +452,161 @@ function fn() {
|
|
|
451
452
|
}
|
|
452
453
|
` }), t[0] = e) : e = t[0], e;
|
|
453
454
|
}
|
|
454
|
-
function
|
|
455
|
+
function lo(t) {
|
|
455
456
|
const e = te(42), {
|
|
456
457
|
roomId: r,
|
|
457
458
|
wsUrl: o,
|
|
458
459
|
wsParams: l,
|
|
459
|
-
userName:
|
|
460
|
-
userColor:
|
|
461
|
-
placeholder:
|
|
460
|
+
userName: u,
|
|
461
|
+
userColor: S,
|
|
462
|
+
placeholder: h
|
|
462
463
|
} = t;
|
|
463
464
|
let a;
|
|
464
465
|
e[0] !== l ? (a = l === void 0 ? {} : l, e[0] = l, e[1] = a) : a = e[1];
|
|
465
|
-
const p = a,
|
|
466
|
-
let
|
|
467
|
-
e[2] !== v || e[3] !== r || e[4] !== p || e[5] !== o ? (
|
|
468
|
-
const
|
|
466
|
+
const p = a, k = u === void 0 ? "Anonymous" : u, b = S === void 0 ? "#30bced" : S, d = ie(null), [C, R] = A(null), [c, w] = A(!1), [v] = A(hn);
|
|
467
|
+
let y;
|
|
468
|
+
e[2] !== v || e[3] !== r || e[4] !== p || e[5] !== o ? (y = () => {
|
|
469
|
+
const j = new kt(o, r, v, {
|
|
469
470
|
params: p,
|
|
470
471
|
connect: !1
|
|
471
472
|
});
|
|
472
|
-
return
|
|
473
|
+
return j.on("sync", (G) => {
|
|
473
474
|
G && w(!0);
|
|
474
|
-
}),
|
|
475
|
-
}, e[2] = v, e[3] = r, e[4] = p, e[5] = o, e[6] =
|
|
476
|
-
const [g] =
|
|
477
|
-
let
|
|
478
|
-
e[7] !== g ? (
|
|
475
|
+
}), j;
|
|
476
|
+
}, e[2] = v, e[3] = r, e[4] = p, e[5] = o, e[6] = y) : y = e[6];
|
|
477
|
+
const [g] = A(y);
|
|
478
|
+
let f, i;
|
|
479
|
+
e[7] !== g ? (f = () => (g.connect(), () => {
|
|
479
480
|
g.disconnect();
|
|
480
|
-
}), i = [g], e[7] = g, e[8] =
|
|
481
|
-
let s,
|
|
481
|
+
}), i = [g], e[7] = g, e[8] = f, e[9] = i) : (f = e[8], i = e[9]), Y(f, i);
|
|
482
|
+
let s, m;
|
|
482
483
|
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = () => {
|
|
483
|
-
R(
|
|
484
|
-
},
|
|
485
|
-
let
|
|
486
|
-
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
484
|
+
R(d.current);
|
|
485
|
+
}, m = [], e[10] = s, e[11] = m) : (s = e[10], m = e[11]), Y(s, m);
|
|
486
|
+
let L;
|
|
487
|
+
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = {
|
|
487
488
|
namespace: "COLLABORATIVE_EDITOR",
|
|
488
489
|
nodes: Ve,
|
|
489
490
|
editorState: null,
|
|
490
|
-
onError:
|
|
491
|
+
onError: un,
|
|
491
492
|
editable: !0,
|
|
492
493
|
theme: We
|
|
493
|
-
}, e[12] =
|
|
494
|
-
const x =
|
|
494
|
+
}, e[12] = L) : L = e[12];
|
|
495
|
+
const x = L;
|
|
495
496
|
let T;
|
|
496
|
-
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ n(
|
|
497
|
+
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ n(mn, {}), e[13] = T) : T = e[13];
|
|
497
498
|
const _ = g;
|
|
498
|
-
let
|
|
499
|
-
e[14] !== v || e[15] !== r || e[16] !== _ || e[17] !== b || e[18] !==
|
|
500
|
-
let N, I,
|
|
501
|
-
e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n(et, {}), I = /* @__PURE__ */ n(tt, {}),
|
|
502
|
-
let K;
|
|
503
|
-
e[26] !== C ? (K = /* @__PURE__ */ n(st, { anchorElem: C }), e[26] = C, e[27] = K) : K = e[27];
|
|
504
|
-
let M;
|
|
505
|
-
e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ n(Ye, {}), e[28] = M) : M = e[28];
|
|
499
|
+
let E;
|
|
500
|
+
e[14] !== v || e[15] !== r || e[16] !== _ || e[17] !== b || e[18] !== k ? (E = /* @__PURE__ */ n(Ct, { id: r, doc: v, provider: _, __shouldBootstrapUnsafe: !1, username: k, cursorColor: b }), e[14] = v, e[15] = r, e[16] = _, e[17] = b, e[18] = k, e[19] = E) : E = e[19];
|
|
501
|
+
let N, I, B, $, D, O;
|
|
502
|
+
e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n(et, {}), I = /* @__PURE__ */ n(tt, {}), B = /* @__PURE__ */ n(ot, { maxIndent: 7 }), $ = /* @__PURE__ */ n(Je, {}), D = /* @__PURE__ */ n(Ge, {}), O = /* @__PURE__ */ n(qe, {}), e[20] = N, e[21] = I, e[22] = B, e[23] = $, e[24] = D, e[25] = O) : (N = e[20], I = e[21], B = e[22], $ = e[23], D = e[24], O = e[25]);
|
|
506
503
|
let V;
|
|
507
|
-
e[
|
|
508
|
-
let P;
|
|
509
|
-
e[30] !== u || e[31] !== c ? (P = c && u ? /* @__PURE__ */ n($e, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: u }) : null, e[30] = u, e[31] = c, e[32] = P) : P = e[32];
|
|
510
|
-
let $;
|
|
511
|
-
e[33] !== P ? ($ = /* @__PURE__ */ n(nt, { contentEditable: V, placeholder: P, ErrorBoundary: Ze }), e[33] = P, e[34] = $) : $ = e[34];
|
|
512
|
-
let A;
|
|
513
|
-
e[35] !== C ? (A = C ? /* @__PURE__ */ n(at, { anchorElem: C }) : null, e[35] = C, e[36] = A) : A = e[36];
|
|
504
|
+
e[26] !== C ? (V = /* @__PURE__ */ n(st, { anchorElem: C }), e[26] = C, e[27] = V) : V = e[27];
|
|
514
505
|
let U;
|
|
515
|
-
|
|
506
|
+
e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ n(Ye, {}), e[28] = U) : U = e[28];
|
|
507
|
+
let H;
|
|
508
|
+
e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ n(Xe, { fullWidth: !1 }), e[29] = H) : H = e[29];
|
|
509
|
+
let M;
|
|
510
|
+
e[30] !== h || e[31] !== c ? (M = c && h ? /* @__PURE__ */ n(De, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: h }) : null, e[30] = h, e[31] = c, e[32] = M) : M = e[32];
|
|
511
|
+
let z;
|
|
512
|
+
e[33] !== M ? (z = /* @__PURE__ */ n(nt, { contentEditable: H, placeholder: M, ErrorBoundary: Ze }), e[33] = M, e[34] = z) : z = e[34];
|
|
513
|
+
let P;
|
|
514
|
+
e[35] !== C ? (P = C ? /* @__PURE__ */ n(at, { anchorElem: C }) : null, e[35] = C, e[36] = P) : P = e[36];
|
|
515
|
+
let F;
|
|
516
|
+
return e[37] !== E || e[38] !== V || e[39] !== z || e[40] !== P ? (F = /* @__PURE__ */ le(Be, { ref: d, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
|
|
516
517
|
T,
|
|
517
|
-
/* @__PURE__ */ n(Qe, { initialConfig: x, children: /* @__PURE__ */
|
|
518
|
-
|
|
518
|
+
/* @__PURE__ */ n(Qe, { initialConfig: x, children: /* @__PURE__ */ le(vt, { children: [
|
|
519
|
+
E,
|
|
519
520
|
N,
|
|
520
521
|
I,
|
|
521
|
-
|
|
522
|
+
B,
|
|
523
|
+
$,
|
|
522
524
|
D,
|
|
523
|
-
W,
|
|
524
525
|
O,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
526
|
+
V,
|
|
527
|
+
U,
|
|
528
|
+
z,
|
|
529
|
+
P
|
|
529
530
|
] }) })
|
|
530
|
-
] }), e[37] =
|
|
531
|
+
] }), e[37] = E, e[38] = V, e[39] = z, e[40] = P, e[41] = F) : F = e[41], F;
|
|
531
532
|
}
|
|
532
|
-
function
|
|
533
|
+
function un(t) {
|
|
533
534
|
return console.error(t);
|
|
534
535
|
}
|
|
535
|
-
function
|
|
536
|
-
return new
|
|
536
|
+
function hn() {
|
|
537
|
+
return new Et.Doc();
|
|
537
538
|
}
|
|
538
539
|
function pn(t) {
|
|
539
540
|
const e = te(32), {
|
|
540
541
|
isActive: r,
|
|
541
542
|
isLinkEditMode: o,
|
|
542
543
|
editedLinkUrl: l,
|
|
543
|
-
editedLinkUrlIsValid:
|
|
544
|
-
linkUrl:
|
|
545
|
-
href:
|
|
544
|
+
editedLinkUrlIsValid: u,
|
|
545
|
+
linkUrl: S,
|
|
546
|
+
href: h,
|
|
546
547
|
inputRef: a,
|
|
547
548
|
onEditedLinkUrlChange: p,
|
|
548
|
-
onInputKeyDown:
|
|
549
|
+
onInputKeyDown: k,
|
|
549
550
|
onClose: b,
|
|
550
|
-
onSubmit:
|
|
551
|
+
onSubmit: d,
|
|
551
552
|
onEdit: C,
|
|
552
553
|
onRemove: R
|
|
553
554
|
} = t;
|
|
554
555
|
if (!r)
|
|
555
556
|
return null;
|
|
556
557
|
if (o) {
|
|
557
|
-
const i = !
|
|
558
|
+
const i = !u;
|
|
558
559
|
let s;
|
|
559
560
|
e[0] !== p ? (s = (I) => {
|
|
560
561
|
p(I.target.value);
|
|
561
562
|
}, e[0] = p, e[1] = s) : s = e[1];
|
|
562
|
-
let
|
|
563
|
-
e[2] !== l || e[3] !== a || e[4] !==
|
|
564
|
-
let
|
|
565
|
-
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
563
|
+
let m;
|
|
564
|
+
e[2] !== l || e[3] !== a || e[4] !== k || e[5] !== i || e[6] !== s ? (m = /* @__PURE__ */ n(gt, { ref: a, className: "link-editor-url-field", size: "sm", fontSize: "sm", value: l, placeholder: "https://", "aria-label": "Link URL", "aria-invalid": i, onChange: s, onKeyDown: k }), e[2] = l, e[3] = a, e[4] = k, e[5] = i, e[6] = s, e[7] = m) : m = e[7];
|
|
565
|
+
let L;
|
|
566
|
+
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ n(Bt, { size: 14 }), e[8] = L) : L = e[8];
|
|
566
567
|
let x;
|
|
567
|
-
e[9] !== b ? (x = /* @__PURE__ */ n(
|
|
568
|
-
const T = !
|
|
568
|
+
e[9] !== b ? (x = /* @__PURE__ */ n(W, { content: "Cancel", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Cancel link edit", onMouseDown: ke, onClick: b, children: L }) }), e[9] = b, e[10] = x) : x = e[10];
|
|
569
|
+
const T = !u;
|
|
569
570
|
let _;
|
|
570
571
|
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(rt, { size: 14 }), e[11] = _) : _ = e[11];
|
|
571
|
-
let
|
|
572
|
-
e[12] !==
|
|
572
|
+
let E;
|
|
573
|
+
e[12] !== d || e[13] !== T ? (E = /* @__PURE__ */ n(W, { content: "Confirm", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Confirm link edit", disabled: T, onMouseDown: ke, onClick: d, children: _ }) }), e[12] = d, e[13] = T, e[14] = E) : E = e[14];
|
|
573
574
|
let N;
|
|
574
|
-
return e[15] !==
|
|
575
|
-
|
|
575
|
+
return e[15] !== m || e[16] !== x || e[17] !== E ? (N = /* @__PURE__ */ le(Ae, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
|
|
576
|
+
m,
|
|
576
577
|
x,
|
|
577
|
-
|
|
578
|
-
] }), e[15] =
|
|
578
|
+
E
|
|
579
|
+
] }), e[15] = m, e[16] = x, e[17] = E, e[18] = N) : N = e[18], N;
|
|
579
580
|
}
|
|
580
581
|
let c;
|
|
581
|
-
e[19] !==
|
|
582
|
+
e[19] !== h || e[20] !== S ? (c = /* @__PURE__ */ n(bt, { href: h, target: "_blank", rel: "noopener noreferrer", className: "link-editor-url-field", fontSize: "sm", textDecoration: "underline", px: "2", truncate: !0, children: S }), e[19] = h, e[20] = S, e[21] = c) : c = e[21];
|
|
582
583
|
let w;
|
|
583
|
-
e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(
|
|
584
|
+
e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(Mt, { size: 14 }), e[22] = w) : w = e[22];
|
|
584
585
|
let v;
|
|
585
|
-
e[23] !== C ? (v = /* @__PURE__ */ n(
|
|
586
|
-
let
|
|
587
|
-
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
586
|
+
e[23] !== C ? (v = /* @__PURE__ */ n(W, { content: "Edit link", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Edit link", onMouseDown: ke, onClick: C, children: w }) }), e[23] = C, e[24] = v) : v = e[24];
|
|
587
|
+
let y;
|
|
588
|
+
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ n(zt, { size: 14 }), e[25] = y) : y = e[25];
|
|
588
589
|
let g;
|
|
589
|
-
e[26] !== R ? (g = /* @__PURE__ */ n(
|
|
590
|
-
let
|
|
591
|
-
return e[28] !== c || e[29] !== v || e[30] !== g ? (
|
|
590
|
+
e[26] !== R ? (g = /* @__PURE__ */ n(W, { content: "Remove link", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Remove link", onMouseDown: ke, onClick: R, children: y }) }), e[26] = R, e[27] = g) : g = e[27];
|
|
591
|
+
let f;
|
|
592
|
+
return e[28] !== c || e[29] !== v || e[30] !== g ? (f = /* @__PURE__ */ le(Ae, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
|
|
592
593
|
c,
|
|
593
594
|
v,
|
|
594
595
|
g
|
|
595
|
-
] }), e[28] = c, e[29] = v, e[30] = g, e[31] =
|
|
596
|
+
] }), e[28] = c, e[29] = v, e[30] = g, e[31] = f) : f = e[31], f;
|
|
596
597
|
}
|
|
597
|
-
function
|
|
598
|
+
function ke(t) {
|
|
598
599
|
t.preventDefault();
|
|
599
600
|
}
|
|
600
|
-
function
|
|
601
|
+
function gn(t, e, r) {
|
|
601
602
|
return t && e && r === "";
|
|
602
603
|
}
|
|
603
|
-
function
|
|
604
|
-
const e =
|
|
605
|
-
return r ? r.getURL() :
|
|
604
|
+
function bn(t) {
|
|
605
|
+
const e = ge(t), r = Z(e, re);
|
|
606
|
+
return r ? r.getURL() : re(e) ? e.getURL() : "";
|
|
606
607
|
}
|
|
607
608
|
const ct = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
|
|
608
|
-
function
|
|
609
|
+
function $e(t) {
|
|
609
610
|
try {
|
|
610
611
|
const e = new URL(t);
|
|
611
612
|
if (!ct.has(e.protocol))
|
|
@@ -623,47 +624,47 @@ function dt(t) {
|
|
|
623
624
|
return !1;
|
|
624
625
|
}
|
|
625
626
|
}
|
|
626
|
-
const
|
|
627
|
-
function
|
|
627
|
+
const vn = 8;
|
|
628
|
+
function Cn({
|
|
628
629
|
editor: t,
|
|
629
630
|
isLink: e,
|
|
630
631
|
setIsLink: r,
|
|
631
632
|
anchorElem: o,
|
|
632
633
|
isLinkEditMode: l,
|
|
633
|
-
setIsLinkEditMode:
|
|
634
|
+
setIsLinkEditMode: u
|
|
634
635
|
}) {
|
|
635
|
-
const
|
|
636
|
-
}), [p,
|
|
636
|
+
const S = ie(null), h = ie(null), a = ie(() => {
|
|
637
|
+
}), [p, k] = A(""), [b, d] = A("https://"), [C, R] = A(null), c = e || l, w = dt(b);
|
|
637
638
|
a.current = () => {
|
|
638
|
-
const
|
|
639
|
-
if (Q(
|
|
640
|
-
const T =
|
|
641
|
-
|
|
639
|
+
const f = ee();
|
|
640
|
+
if (Q(f)) {
|
|
641
|
+
const T = bn(f);
|
|
642
|
+
k(T), gn(l, e, T) && y(), l && T !== "" && d(T);
|
|
642
643
|
}
|
|
643
|
-
const i =
|
|
644
|
+
const i = S.current, s = window.getSelection(), m = document.activeElement;
|
|
644
645
|
if (i === null)
|
|
645
646
|
return;
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
647
|
+
const L = t.getRootElement(), x = s !== null && s.rangeCount > 0;
|
|
648
|
+
if (f !== null && s !== null && x && L?.contains(s.anchorNode) && t.isEditable()) {
|
|
648
649
|
const T = s.getRangeAt(0).getBoundingClientRect(), _ = new DOMRect(T.left, T.top, 0, T.height);
|
|
649
|
-
|
|
650
|
-
} else i.contains(
|
|
651
|
-
},
|
|
652
|
-
const
|
|
650
|
+
Ee(_, i, o, vn, void 0, "above"), R(f);
|
|
651
|
+
} else i.contains(m) || (L !== null && Ee(null, i, o), R(null), u(!1), k(""));
|
|
652
|
+
}, Y(() => {
|
|
653
|
+
const f = o.parentElement, i = () => {
|
|
653
654
|
t.getEditorState().read(() => {
|
|
654
655
|
a.current();
|
|
655
656
|
});
|
|
656
657
|
};
|
|
657
|
-
return window.addEventListener("resize", i),
|
|
658
|
-
window.removeEventListener("resize", i),
|
|
658
|
+
return window.addEventListener("resize", i), f && f.addEventListener("scroll", i), () => {
|
|
659
|
+
window.removeEventListener("resize", i), f && f.removeEventListener("scroll", i);
|
|
659
660
|
};
|
|
660
|
-
}, [o.parentElement, t]),
|
|
661
|
-
editorState:
|
|
661
|
+
}, [o.parentElement, t]), Y(() => Se(t.registerUpdateListener(({
|
|
662
|
+
editorState: f
|
|
662
663
|
}) => {
|
|
663
|
-
|
|
664
|
+
f.read(() => {
|
|
664
665
|
a.current();
|
|
665
666
|
});
|
|
666
|
-
}), t.registerCommand(
|
|
667
|
+
}), t.registerCommand(ye, () => (a.current(), !0), Me), t.registerCommand(yt, () => e ? (r(!1), !0) : !1, lt)), [t, r, e]), Y(() => {
|
|
667
668
|
t.getEditorState().read(() => {
|
|
668
669
|
a.current();
|
|
669
670
|
});
|
|
@@ -671,20 +672,20 @@ function vn({
|
|
|
671
672
|
c && t.getEditorState().read(() => {
|
|
672
673
|
a.current();
|
|
673
674
|
});
|
|
674
|
-
}, [t, c]),
|
|
675
|
-
l &&
|
|
675
|
+
}, [t, c]), Y(() => {
|
|
676
|
+
l && h.current && h.current.focus();
|
|
676
677
|
}, [l]);
|
|
677
|
-
const v = (
|
|
678
|
-
|
|
679
|
-
},
|
|
680
|
-
|
|
678
|
+
const v = (f) => {
|
|
679
|
+
f.key === "Enter" ? (f.preventDefault(), g()) : f.key === "Escape" && (f.preventDefault(), y());
|
|
680
|
+
}, y = () => {
|
|
681
|
+
d("https://"), u(!1);
|
|
681
682
|
}, g = () => {
|
|
682
683
|
C === null || !w || (t.update(() => {
|
|
683
684
|
xt(C);
|
|
684
|
-
}), t.dispatchCommand(ze,
|
|
685
|
-
const
|
|
686
|
-
if (Q(
|
|
687
|
-
const i =
|
|
685
|
+
}), t.dispatchCommand(ze, $e(b)), t.update(() => {
|
|
686
|
+
const f = ee();
|
|
687
|
+
if (Q(f)) {
|
|
688
|
+
const i = ge(f).getParent();
|
|
688
689
|
if (pe(i)) {
|
|
689
690
|
const s = Dt(i.getURL(), {
|
|
690
691
|
rel: i.__rel,
|
|
@@ -694,166 +695,171 @@ function vn({
|
|
|
694
695
|
i.replace(s, !0);
|
|
695
696
|
}
|
|
696
697
|
}
|
|
697
|
-
}),
|
|
698
|
+
}), y());
|
|
698
699
|
};
|
|
699
|
-
return /* @__PURE__ */ n(
|
|
700
|
-
|
|
700
|
+
return /* @__PURE__ */ n(De, { ref: S, className: `link-editor ${c ? "active" : ""}`, children: /* @__PURE__ */ n(pn, { isActive: c, isLinkEditMode: l, editedLinkUrl: b, editedLinkUrlIsValid: w, linkUrl: p, href: $e(p), inputRef: h, onEditedLinkUrlChange: d, onInputKeyDown: v, onClose: y, onSubmit: g, onEdit: () => {
|
|
701
|
+
d(p), u(!0);
|
|
701
702
|
}, onRemove: () => {
|
|
702
703
|
t.dispatchCommand(ze, null);
|
|
703
704
|
} }) });
|
|
704
705
|
}
|
|
705
|
-
function
|
|
706
|
-
const l = te(13), [
|
|
707
|
-
let p,
|
|
706
|
+
function _n(t, e, r, o) {
|
|
707
|
+
const l = te(13), [u, S] = A(t), [h, a] = A(!1);
|
|
708
|
+
let p, k;
|
|
708
709
|
l[0] !== t || l[1] !== o ? (p = () => {
|
|
709
710
|
const C = function() {
|
|
710
711
|
const c = ee();
|
|
711
712
|
if (Q(c)) {
|
|
712
|
-
const w =
|
|
713
|
-
if (!(v ||
|
|
713
|
+
const w = ge(c), v = Z(w, re), y = Z(w, pe);
|
|
714
|
+
if (!(v || y)) {
|
|
714
715
|
a(!1);
|
|
715
716
|
return;
|
|
716
717
|
}
|
|
717
|
-
const g = c.getNodes().filter(En).find((
|
|
718
|
-
const i = Z(
|
|
719
|
-
return v && !v.is(i) || i && !i.is(v) ||
|
|
718
|
+
const g = c.getNodes().filter(En).find((f) => {
|
|
719
|
+
const i = Z(f, re), s = Z(f, pe), m = pe(s) && s.getIsUnlinked();
|
|
720
|
+
return v && !v.is(i) || i && !i.is(v) || y && !y.is(s) || s && (!s.is(y) || m);
|
|
720
721
|
});
|
|
721
722
|
a(!g);
|
|
722
723
|
}
|
|
723
724
|
};
|
|
724
|
-
return
|
|
725
|
+
return Se(t.registerUpdateListener((R) => {
|
|
725
726
|
const {
|
|
726
727
|
editorState: c
|
|
727
728
|
} = R;
|
|
728
729
|
c.read(() => {
|
|
729
730
|
C();
|
|
730
731
|
});
|
|
731
|
-
}), t.registerCommand(
|
|
732
|
-
},
|
|
732
|
+
}), t.registerCommand(ye, (R, c) => (C(), S(c), !1), Ue), t.registerCommand(it, kn, Me), t.registerCommand(Ke, (R) => (o(R), !0), Me));
|
|
733
|
+
}, k = [t, o], l[0] = t, l[1] = o, l[2] = p, l[3] = k) : (p = l[2], k = l[3]), Y(p, k);
|
|
733
734
|
let b;
|
|
734
|
-
l[4] !==
|
|
735
|
-
let
|
|
736
|
-
return l[10] !== e || l[11] !== b ? (
|
|
735
|
+
l[4] !== u || l[5] !== e || l[6] !== h || l[7] !== r || l[8] !== o ? (b = /* @__PURE__ */ n(Cn, { editor: u, isLink: h, anchorElem: e, setIsLink: a, isLinkEditMode: r, setIsLinkEditMode: o }), l[4] = u, l[5] = e, l[6] = h, l[7] = r, l[8] = o, l[9] = b) : b = l[9];
|
|
736
|
+
let d;
|
|
737
|
+
return l[10] !== e || l[11] !== b ? (d = He(b, e), l[10] = e, l[11] = b, l[12] = d) : d = l[12], d;
|
|
737
738
|
}
|
|
738
|
-
function
|
|
739
|
+
function kn(t) {
|
|
739
740
|
const e = ee();
|
|
740
741
|
if (Q(e)) {
|
|
741
|
-
const r =
|
|
742
|
-
if (
|
|
743
|
-
return window.open(
|
|
742
|
+
const r = ge(e), o = Z(r, re);
|
|
743
|
+
if (re(o) && (t.metaKey || t.ctrlKey))
|
|
744
|
+
return window.open($e(o.getURL()), "_blank", "noopener,noreferrer"), !0;
|
|
744
745
|
}
|
|
745
746
|
return !1;
|
|
746
747
|
}
|
|
747
748
|
function En(t) {
|
|
748
|
-
return !
|
|
749
|
+
return !Lt(t);
|
|
749
750
|
}
|
|
750
|
-
function
|
|
751
|
+
function Sn(t) {
|
|
751
752
|
const {
|
|
752
753
|
anchorElem: e
|
|
753
|
-
} = t, r = e === void 0 ? document.body : e, [o, l] =
|
|
754
|
-
return
|
|
754
|
+
} = t, r = e === void 0 ? document.body : e, [o, l] = A(!1), [u] = Oe();
|
|
755
|
+
return _n(u, r, o, l);
|
|
755
756
|
}
|
|
756
|
-
function
|
|
757
|
+
function yn() {
|
|
757
758
|
const t = te(1);
|
|
758
759
|
let e;
|
|
759
760
|
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(et, { validateUrl: dt }), t[0] = e) : e = t[0], e;
|
|
760
761
|
}
|
|
761
|
-
function
|
|
762
|
-
const e = te(
|
|
762
|
+
function ro(t) {
|
|
763
|
+
const e = te(57), {
|
|
763
764
|
autoFocus: r,
|
|
764
765
|
debug: o,
|
|
765
766
|
defaultState: l,
|
|
766
|
-
isEditable:
|
|
767
|
-
placeholder:
|
|
768
|
-
scrollable:
|
|
767
|
+
isEditable: u,
|
|
768
|
+
placeholder: S,
|
|
769
|
+
scrollable: h,
|
|
769
770
|
onChange: a
|
|
770
|
-
} = t, p = r === void 0 ? !1 : r,
|
|
771
|
+
} = t, p = r === void 0 ? !1 : r, k = o === void 0 ? !1 : o, b = l === void 0 ? "" : l, d = u === void 0 ? !1 : u, C = h === void 0 ? !0 : h;
|
|
771
772
|
let R;
|
|
772
773
|
e[0] !== b ? (R = mt(b), e[0] = b, e[1] = R) : R = e[1];
|
|
773
774
|
const {
|
|
774
775
|
frontmatter: c,
|
|
775
776
|
body: w
|
|
776
|
-
} = R, v =
|
|
777
|
+
} = R, v = d && !!a, y = ie(null), [g, f] = A(null);
|
|
777
778
|
let i, s;
|
|
778
779
|
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = () => {
|
|
779
|
-
|
|
780
|
-
}, s = [], e[2] = i, e[3] = s) : (i = e[2], s = e[3]),
|
|
781
|
-
let
|
|
782
|
-
e[4] !== w ? (
|
|
783
|
-
let
|
|
784
|
-
e[6] !==
|
|
780
|
+
f(y.current);
|
|
781
|
+
}, s = [], e[2] = i, e[3] = s) : (i = e[2], s = e[3]), Y(i, s);
|
|
782
|
+
let m;
|
|
783
|
+
e[4] !== w ? (m = () => Wt(ut(w), Te, void 0, !1), e[4] = w, e[5] = m) : m = e[5];
|
|
784
|
+
let L;
|
|
785
|
+
e[6] !== d || e[7] !== m ? (L = {
|
|
785
786
|
namespace: "MARKDOWN_EDITOR",
|
|
786
787
|
nodes: Ve,
|
|
787
|
-
editorState:
|
|
788
|
-
onError:
|
|
789
|
-
editable:
|
|
788
|
+
editorState: m,
|
|
789
|
+
onError: Ln,
|
|
790
|
+
editable: d,
|
|
790
791
|
theme: We
|
|
791
|
-
}, e[6] =
|
|
792
|
-
const x =
|
|
792
|
+
}, e[6] = d, e[7] = m, e[8] = L) : L = e[8];
|
|
793
|
+
const x = L, T = C ? "100%" : "auto";
|
|
793
794
|
let _;
|
|
794
795
|
e[9] !== p ? (_ = p ? /* @__PURE__ */ n(Gt, {}) : null, e[9] = p, e[10] = _) : _ = e[10];
|
|
795
|
-
let
|
|
796
|
-
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
797
|
-
let
|
|
798
|
-
e[14] !==
|
|
799
|
-
let
|
|
800
|
-
e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
796
|
+
let E, N, I;
|
|
797
|
+
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ n(Yt, {}), N = /* @__PURE__ */ n(yn, {}), I = /* @__PURE__ */ n(tt, {}), e[11] = E, e[12] = N, e[13] = I) : (E = e[11], N = e[12], I = e[13]);
|
|
798
|
+
let B;
|
|
799
|
+
e[14] !== d ? (B = d ? /* @__PURE__ */ n(ot, { maxIndent: 7 }) : null, e[14] = d, e[15] = B) : B = e[15];
|
|
800
|
+
let $;
|
|
801
|
+
e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ n(qt, {}), e[16] = $) : $ = e[16];
|
|
802
|
+
let D;
|
|
803
|
+
e[17] !== d ? (D = d ? /* @__PURE__ */ n(Xt, { transformers: Te }) : null, e[17] = d, e[18] = D) : D = e[18];
|
|
804
|
+
let O, V, U;
|
|
805
|
+
e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ n(Je, {}), V = /* @__PURE__ */ n(Ge, {}), U = /* @__PURE__ */ n(qe, {}), e[19] = O, e[20] = V, e[21] = U) : (O = e[19], V = e[20], U = e[21]);
|
|
806
|
+
let H;
|
|
807
|
+
e[22] !== g ? (H = /* @__PURE__ */ n(st, { anchorElem: g }), e[22] = g, e[23] = H) : H = e[23];
|
|
801
808
|
let M;
|
|
802
|
-
e[
|
|
803
|
-
let
|
|
804
|
-
e[
|
|
809
|
+
e[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ n(Ye, {}), e[24] = M) : M = e[24];
|
|
810
|
+
let z;
|
|
811
|
+
e[25] !== C ? (z = /* @__PURE__ */ n(Xe, { fullWidth: !1, padding: "sm", scrollable: C }), e[25] = C, e[26] = z) : z = e[26];
|
|
805
812
|
let P;
|
|
806
|
-
e[
|
|
807
|
-
let
|
|
808
|
-
e[
|
|
809
|
-
let
|
|
810
|
-
e[
|
|
811
|
-
let U;
|
|
812
|
-
e[30] !== g || e[31] !== h ? (U = h && g ? /* @__PURE__ */ ie(ft, { children: [
|
|
813
|
+
e[27] !== S ? (P = S ? /* @__PURE__ */ n(Be, { position: "absolute", padding: "sm", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ n(De, { width: "100%", maxWidth: "45rem", color: "fg.muted", textStyle: "paragraph/M/regular", children: S }) }) : null, e[27] = S, e[28] = P) : P = e[28];
|
|
814
|
+
let F;
|
|
815
|
+
e[29] !== z || e[30] !== P ? (F = /* @__PURE__ */ n(nt, { contentEditable: z, placeholder: P, ErrorBoundary: Ze }), e[29] = z, e[30] = P, e[31] = F) : F = e[31];
|
|
816
|
+
let j;
|
|
817
|
+
e[32] !== g || e[33] !== d ? (j = d && g ? /* @__PURE__ */ le(ft, { children: [
|
|
813
818
|
/* @__PURE__ */ n(at, { anchorElem: g }),
|
|
814
|
-
/* @__PURE__ */ n(
|
|
815
|
-
] }) : null, e[
|
|
816
|
-
let H;
|
|
817
|
-
e[33] !== c || e[34] !== a || e[35] !== v ? (H = v ? /* @__PURE__ */ n(Xt, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (re) => {
|
|
818
|
-
re.read(() => {
|
|
819
|
-
const ue = Tt(), ne = Vt(He, ue);
|
|
820
|
-
a?.(c + ne);
|
|
821
|
-
});
|
|
822
|
-
} }) : null, e[33] = c, e[34] = a, e[35] = v, e[36] = H) : H = e[36];
|
|
819
|
+
/* @__PURE__ */ n(Sn, { anchorElem: g })
|
|
820
|
+
] }) : null, e[32] = g, e[33] = d, e[34] = j) : j = e[34];
|
|
823
821
|
let G;
|
|
824
|
-
e[37] !==
|
|
822
|
+
e[35] !== c || e[36] !== a || e[37] !== v ? (G = v ? /* @__PURE__ */ n(Qt, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (he) => {
|
|
823
|
+
he.read(() => {
|
|
824
|
+
const oe = Tt(), se = Vt(Te, oe);
|
|
825
|
+
a?.(c + se);
|
|
826
|
+
});
|
|
827
|
+
} }) : null, e[35] = c, e[36] = a, e[37] = v, e[38] = G) : G = e[38];
|
|
825
828
|
let J;
|
|
826
|
-
e[39] !==
|
|
827
|
-
let
|
|
828
|
-
e[41] !==
|
|
829
|
+
e[39] !== d ? (J = /* @__PURE__ */ n(ht, { isEditable: d }), e[39] = d, e[40] = J) : J = e[40];
|
|
830
|
+
let X;
|
|
831
|
+
e[41] !== k ? (X = k && /* @__PURE__ */ n(pt, {}), e[41] = k, e[42] = X) : X = e[42];
|
|
832
|
+
let q;
|
|
833
|
+
e[43] !== x || e[44] !== _ || e[45] !== B || e[46] !== D || e[47] !== H || e[48] !== F || e[49] !== j || e[50] !== G || e[51] !== J || e[52] !== X ? (q = /* @__PURE__ */ le(Qe, { initialConfig: x, children: [
|
|
829
834
|
_,
|
|
830
|
-
|
|
835
|
+
E,
|
|
831
836
|
N,
|
|
832
837
|
I,
|
|
833
|
-
|
|
838
|
+
B,
|
|
839
|
+
$,
|
|
834
840
|
D,
|
|
835
|
-
W,
|
|
836
841
|
O,
|
|
837
|
-
K,
|
|
838
|
-
M,
|
|
839
842
|
V,
|
|
840
|
-
A,
|
|
841
843
|
U,
|
|
842
844
|
H,
|
|
845
|
+
M,
|
|
846
|
+
F,
|
|
847
|
+
j,
|
|
843
848
|
G,
|
|
844
|
-
J
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
849
|
+
J,
|
|
850
|
+
X
|
|
851
|
+
] }), e[43] = x, e[44] = _, e[45] = B, e[46] = D, e[47] = H, e[48] = F, e[49] = j, e[50] = G, e[51] = J, e[52] = X, e[53] = q) : q = e[53];
|
|
852
|
+
let ne;
|
|
853
|
+
return e[54] !== T || e[55] !== q ? (ne = /* @__PURE__ */ n(Be, { ref: y, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: T, position: "relative", direction: "column", overflow: "visible", children: q }), e[54] = T, e[55] = q, e[56] = ne) : ne = e[56], ne;
|
|
848
854
|
}
|
|
849
|
-
function
|
|
855
|
+
function Ln(t) {
|
|
850
856
|
return console.error(t);
|
|
851
857
|
}
|
|
852
|
-
function
|
|
858
|
+
function so(t) {
|
|
853
859
|
const e = t.toLowerCase().trim();
|
|
854
860
|
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";
|
|
855
861
|
}
|
|
856
|
-
const
|
|
862
|
+
const xn = {
|
|
857
863
|
csv: "text/csv",
|
|
858
864
|
tsv: "text/tab-separated-values",
|
|
859
865
|
json: "application/json",
|
|
@@ -877,21 +883,21 @@ const yn = {
|
|
|
877
883
|
yml: "text/yaml",
|
|
878
884
|
yaml: "text/yaml"
|
|
879
885
|
};
|
|
880
|
-
function
|
|
886
|
+
function ao(t) {
|
|
881
887
|
const r = (t.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
|
|
882
|
-
return r ?
|
|
888
|
+
return r ? xn[r] ?? null : null;
|
|
883
889
|
}
|
|
884
890
|
export {
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
891
|
+
lo as CollaborativeMarkdownEditor,
|
|
892
|
+
mo as DefaultRichTextCodeEditor,
|
|
893
|
+
uo as DefaultRichTextDataTable,
|
|
894
|
+
ro as MarkdownEditor,
|
|
895
|
+
ho as MarkdownPreview,
|
|
896
|
+
po as PromptEditor,
|
|
897
|
+
go as RichMessage,
|
|
898
|
+
bo as generateEditorStateFromString,
|
|
899
|
+
vo as getTextFromSerializedEditorState,
|
|
900
|
+
so as inferResourceTypeFromMediaType,
|
|
901
|
+
ao as mediaTypeFromPath
|
|
896
902
|
};
|
|
897
903
|
//# sourceMappingURL=rich-text.js.map
|