@pstdio/ui 0.2.2 → 0.2.3
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 +417 -407
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/chat-ui/components/chat-panel-sticky-user-message.d.ts +4 -0
- package/dist/components/chat-ui/components/chat-panel.sticky-user-message.test.d.ts +1 -0
- package/dist/components/chat-ui/components/chat-panel.stories.d.ts +1 -0
- package/dist/components/rich-text/shared/components/content-editable.d.ts +2 -1
- package/dist/empty-state-kQR0gd4j.js +232 -0
- package/dist/empty-state-kQR0gd4j.js.map +1 -0
- package/dist/index.js +37 -36
- package/dist/index.js.map +1 -1
- package/dist/{rich-message-C0_i-4Ux.js → rich-message-ZT2CEiwt.js} +413 -404
- package/dist/rich-message-ZT2CEiwt.js.map +1 -0
- package/dist/rich-text.js +5 -5
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tooltip-Dze4WXVl.js +86 -0
- package/dist/tooltip-Dze4WXVl.js.map +1 -0
- package/package.json +2 -2
- package/dist/rich-message-C0_i-4Ux.js.map +0 -1
- package/dist/scroll-area-DZs-GiIp.js +0 -267
- package/dist/scroll-area-DZs-GiIp.js.map +0 -1
- package/dist/tooltip-Gm7PLwZG.js +0 -51
- package/dist/tooltip-Gm7PLwZG.js.map +0 -1
|
@@ -1,49 +1,58 @@
|
|
|
1
|
-
import { CodeNode as
|
|
2
|
-
import { LinkNode as
|
|
3
|
-
import { ListNode as
|
|
4
|
-
import { TRANSFORMERS as
|
|
5
|
-
import { QuoteNode as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { chakra as
|
|
8
|
-
import { DecoratorNode as G, $applyNodeReplacement as
|
|
1
|
+
import { CodeNode as de } from "@lexical/code";
|
|
2
|
+
import { LinkNode as Te } from "@lexical/link";
|
|
3
|
+
import { ListNode as Re, ListItemNode as Ne } from "@lexical/list";
|
|
4
|
+
import { TRANSFORMERS as Ce, $convertFromMarkdownString as Oe, $convertToMarkdownString as rt } from "@lexical/markdown";
|
|
5
|
+
import { QuoteNode as ke, HeadingNode as $e } from "@lexical/rich-text";
|
|
6
|
+
import { jsx as s, jsxs as L, Fragment as pe } from "react/jsx-runtime";
|
|
7
|
+
import { chakra as se, Flex as ne, Text as w, Spacer as ot, IconButton as it, Box as P, Table as H, Textarea as st, Tooltip as Z, Kbd as lt } from "@chakra-ui/react";
|
|
8
|
+
import { DecoratorNode as G, $applyNodeReplacement as ct, ElementNode as Ie, TextNode as ee, $createTextNode as ve, $nodesOfType as at, createCommand as k, isHTMLElement as dt, $createParagraphNode as le, COMMAND_PRIORITY_LOW as we, $getSelection as ut, $isRangeSelection as ft, $isElementNode as mt, KEY_DOWN_COMMAND as _t, COMMAND_PRIORITY_HIGH as pt, $getRoot as Pe } from "lexical";
|
|
9
9
|
import { c as C } from "react/compiler-runtime";
|
|
10
|
-
import { MarkNode as
|
|
11
|
-
import { LexicalComposer as
|
|
12
|
-
import { LexicalErrorBoundary as
|
|
13
|
-
import { HistoryPlugin as
|
|
14
|
-
import { OnChangePlugin as
|
|
15
|
-
import { RichTextPlugin as
|
|
16
|
-
import * as
|
|
17
|
-
import { Suspense as
|
|
10
|
+
import { MarkNode as ht } from "@lexical/mark";
|
|
11
|
+
import { LexicalComposer as Le } from "@lexical/react/LexicalComposer";
|
|
12
|
+
import { LexicalErrorBoundary as Me } from "@lexical/react/LexicalErrorBoundary";
|
|
13
|
+
import { HistoryPlugin as gt } from "@lexical/react/LexicalHistoryPlugin";
|
|
14
|
+
import { OnChangePlugin as De } from "@lexical/react/LexicalOnChangePlugin";
|
|
15
|
+
import { RichTextPlugin as Ae } from "@lexical/react/LexicalRichTextPlugin";
|
|
16
|
+
import * as xt from "react";
|
|
17
|
+
import { Suspense as Et, useEffect as j, useImperativeHandle as bt, useState as St, forwardRef as yt, useRef as Tt } from "react";
|
|
18
18
|
import { useLexicalComposerContext as M } from "@lexical/react/LexicalComposerContext";
|
|
19
|
-
import { $setBlocksType as
|
|
20
|
-
import { addClassNamesToElement as
|
|
21
|
-
import { LexicalTypeaheadMenuPlugin as
|
|
22
|
-
import * as
|
|
23
|
-
import { HorizontalRulePlugin as
|
|
24
|
-
import { LinkPlugin as
|
|
25
|
-
import { ListPlugin as
|
|
26
|
-
import { ContentEditable as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
const
|
|
32
|
-
function
|
|
33
|
-
const e = C(
|
|
19
|
+
import { $setBlocksType as Rt } from "@lexical/selection";
|
|
20
|
+
import { addClassNamesToElement as Fe, mergeRegister as ue } from "@lexical/utils";
|
|
21
|
+
import { LexicalTypeaheadMenuPlugin as Nt } from "@lexical/react/LexicalTypeaheadMenuPlugin";
|
|
22
|
+
import * as Ct from "react-dom";
|
|
23
|
+
import { HorizontalRulePlugin as Ot } from "@lexical/react/LexicalHorizontalRulePlugin";
|
|
24
|
+
import { LinkPlugin as kt } from "@lexical/react/LexicalLinkPlugin";
|
|
25
|
+
import { ListPlugin as $t } from "@lexical/react/LexicalListPlugin";
|
|
26
|
+
import { ContentEditable as It } from "@lexical/react/LexicalContentEditable";
|
|
27
|
+
import { S as vt, T as wt } from "./tooltip-Dze4WXVl.js";
|
|
28
|
+
import Pt from "katex";
|
|
29
|
+
import { TreeView as Lt } from "@lexical/react/LexicalTreeView";
|
|
30
|
+
import { FileSpreadsheet as Mt, FileCode as Dt, FileChartLine as At, FileJson as Ft, FileText as qt, FileCog as Ht, FileImage as jt, FileArchive as Bt, File as Ut, X as Jt } from "lucide-react";
|
|
31
|
+
const zt = se(It);
|
|
32
|
+
function qe(n) {
|
|
33
|
+
const e = C(11), {
|
|
34
34
|
onRef: t,
|
|
35
35
|
fullWidth: r,
|
|
36
|
-
padding: o
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
padding: o,
|
|
37
|
+
isRichMessage: i
|
|
38
|
+
} = n, l = r === void 0 ? !1 : r, c = (i === void 0 ? !1 : i) ? "true" : void 0;
|
|
39
|
+
let m;
|
|
40
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = {
|
|
41
|
+
width: "100%",
|
|
42
|
+
minH: "100%"
|
|
43
|
+
}, e[0] = m) : m = e[0];
|
|
44
|
+
const _ = l ? "flex-start" : "center", p = l ? "100%" : "720px";
|
|
40
45
|
let u;
|
|
41
|
-
|
|
46
|
+
e[1] !== p ? (u = /* @__PURE__ */ s(zt, { "data-testid": "content-editable", height: "fit-content", minH: "100%", width: "100%", maxWidth: p, textStyle: "paragraph/M/regular", fontSize: "calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale))", position: "relative", outline: "none" }), e[1] = p, e[2] = u) : u = e[2];
|
|
47
|
+
let d;
|
|
48
|
+
e[3] !== t || e[4] !== o || e[5] !== _ || e[6] !== u ? (d = /* @__PURE__ */ s(ne, { ref: t, width: "100%", minH: "100%", padding: o, justifyContent: _, children: u }), e[3] = t, e[4] = o, e[5] = _, e[6] = u, e[7] = d) : d = e[7];
|
|
49
|
+
let f;
|
|
50
|
+
return e[8] !== c || e[9] !== d ? (f = /* @__PURE__ */ s(vt, { className: "rich-text", "data-rich-message": c, height: "100%", minH: "0", position: "relative", contentProps: m, children: d }), e[8] = c, e[9] = d, e[10] = f) : f = e[10], f;
|
|
42
51
|
}
|
|
43
|
-
const
|
|
52
|
+
const Wt = (n) => {
|
|
44
53
|
const e = n.split(".").pop()?.toLowerCase() ?? "";
|
|
45
|
-
return ["csv", "tsv", "xlsx", "xls", "parquet"].includes(e) ?
|
|
46
|
-
},
|
|
54
|
+
return ["csv", "tsv", "xlsx", "xls", "parquet"].includes(e) ? Mt : ["sql", "py", "js", "ts", "jsx", "tsx", "java", "cpp", "c", "h", "css", "scss", "sass", "php", "rb", "go", "rs", "kt", "swift"].includes(e) ? Dt : ["json", "jsonl", "ndjson"].includes(e) ? n.includes("/visualizations/") ? At : Ft : ["md", "txt", "rst", "org", "pdf", "doc", "docx", "rtf"].includes(e) ? qt : ["yaml", "yml", "toml", "ini", "conf", "config"].includes(e) ? Ht : ["png", "jpg", "jpeg", "gif", "svg", "webp", "ico"].includes(e) ? jt : ["zip", "tar", "gz", "rar", "7z"].includes(e) ? Bt : Ut;
|
|
55
|
+
}, Kt = {
|
|
47
56
|
sm: {
|
|
48
57
|
container: {
|
|
49
58
|
height: "20px",
|
|
@@ -66,7 +75,7 @@ const Jt = (n) => {
|
|
|
66
75
|
iconSize: 14,
|
|
67
76
|
textStyle: "sm"
|
|
68
77
|
}
|
|
69
|
-
},
|
|
78
|
+
}, Vt = {
|
|
70
79
|
neutral: {
|
|
71
80
|
color: "color.primary",
|
|
72
81
|
bg: "bg.muted",
|
|
@@ -81,9 +90,9 @@ const Jt = (n) => {
|
|
|
81
90
|
bg: "var(--schub-accent-subtle)"
|
|
82
91
|
}
|
|
83
92
|
}
|
|
84
|
-
},
|
|
93
|
+
}, Xt = "md", Gt = "neutral", He = (n) => {
|
|
85
94
|
const e = C(39);
|
|
86
|
-
let t, r, o, i,
|
|
95
|
+
let t, r, o, i, l, a, c;
|
|
87
96
|
e[0] !== n ? ({
|
|
88
97
|
fileName: t,
|
|
89
98
|
onSelect: i,
|
|
@@ -91,52 +100,52 @@ const Jt = (n) => {
|
|
|
91
100
|
size: a,
|
|
92
101
|
tone: c,
|
|
93
102
|
icon: r,
|
|
94
|
-
...
|
|
95
|
-
} = n, e[0] = n, e[1] = t, e[2] = r, e[3] = o, e[4] = i, e[5] =
|
|
96
|
-
const
|
|
97
|
-
let
|
|
98
|
-
e[8] !== t ? (
|
|
99
|
-
const
|
|
103
|
+
...l
|
|
104
|
+
} = n, e[0] = n, e[1] = t, e[2] = r, e[3] = o, e[4] = i, e[5] = l, e[6] = a, e[7] = c) : (t = e[1], r = e[2], o = e[3], i = e[4], l = e[5], a = e[6], c = e[7]);
|
|
105
|
+
const m = a === void 0 ? Xt : a, _ = c === void 0 ? Gt : c;
|
|
106
|
+
let p;
|
|
107
|
+
e[8] !== t ? (p = Wt(t), e[8] = t, e[9] = p) : p = e[9];
|
|
108
|
+
const u = p, d = Kt[m], f = Vt[_], g = i ? "pointer" : "default";
|
|
100
109
|
let x;
|
|
101
110
|
e[10] !== t || e[11] !== i ? (x = (O) => {
|
|
102
111
|
O.stopPropagation(), i?.(t);
|
|
103
112
|
}, e[10] = t, e[11] = i, e[12] = x) : x = e[12];
|
|
104
|
-
let
|
|
105
|
-
e[13] !==
|
|
113
|
+
let y;
|
|
114
|
+
e[13] !== u || e[14] !== r || e[15] !== d.iconSize ? (y = r ?? /* @__PURE__ */ s(u, { size: d.iconSize }), e[13] = u, e[14] = r, e[15] = d.iconSize, e[16] = y) : y = e[16];
|
|
106
115
|
let N;
|
|
107
|
-
e[17] !==
|
|
116
|
+
e[17] !== y ? (N = /* @__PURE__ */ s(se.span, { mr: "xs", display: "inline-flex", children: y }), e[17] = y, e[18] = N) : N = e[18];
|
|
108
117
|
let b;
|
|
109
118
|
e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = {
|
|
110
119
|
base: "14rem"
|
|
111
120
|
}, e[19] = b) : b = e[19];
|
|
112
121
|
let T;
|
|
113
|
-
e[20] !== t || e[21] !== d.textStyle ? (T = /* @__PURE__ */
|
|
122
|
+
e[20] !== t || e[21] !== d.textStyle ? (T = /* @__PURE__ */ s(w, { maxW: b, textOverflow: "ellipsis", whiteSpace: "nowrap", overflow: "hidden", textStyle: d.textStyle, children: t }), e[20] = t, e[21] = d.textStyle, e[22] = T) : T = e[22];
|
|
114
123
|
let E;
|
|
115
|
-
e[23] !== t || e[24] !== T ? (E = /* @__PURE__ */
|
|
124
|
+
e[23] !== t || e[24] !== T ? (E = /* @__PURE__ */ s(wt, { content: t, children: T }), e[23] = t, e[24] = T, e[25] = E) : E = e[25];
|
|
116
125
|
let R;
|
|
117
|
-
e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */
|
|
118
|
-
let
|
|
119
|
-
e[27] !== t || e[28] !== o ? (
|
|
126
|
+
e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ s(ot, {}), e[26] = R) : R = e[26];
|
|
127
|
+
let S;
|
|
128
|
+
e[27] !== t || e[28] !== o ? (S = o && /* @__PURE__ */ s(it, { "aria-label": "Remove reference", size: "2xs", ml: "xs", variant: "ghost", _hover: {
|
|
120
129
|
bg: "transparent"
|
|
121
130
|
}, onClick: (O) => {
|
|
122
131
|
O.stopPropagation(), o?.(t);
|
|
123
|
-
}, children: /* @__PURE__ */
|
|
132
|
+
}, children: /* @__PURE__ */ s(Jt, { size: 12 }) }), e[27] = t, e[28] = o, e[29] = S) : S = e[29];
|
|
124
133
|
let h;
|
|
125
|
-
return e[30] !==
|
|
134
|
+
return e[30] !== l || e[31] !== d.container || e[32] !== S || e[33] !== g || e[34] !== x || e[35] !== N || e[36] !== E || e[37] !== f ? (h = /* @__PURE__ */ L(se.span, { display: "flex", flexDirection: "row", alignItems: "center", borderRadius: "xs", gap: "2xs", cursor: g, ...f, ...d.container, onClick: x, ...l, children: [
|
|
126
135
|
N,
|
|
127
136
|
E,
|
|
128
137
|
R,
|
|
129
|
-
|
|
130
|
-
] }), e[30] =
|
|
138
|
+
S
|
|
139
|
+
] }), e[30] = l, e[31] = d.container, e[32] = S, e[33] = g, e[34] = x, e[35] = N, e[36] = E, e[37] = f, e[38] = h) : h = e[38], h;
|
|
131
140
|
};
|
|
132
|
-
let
|
|
141
|
+
let re = class ce extends G {
|
|
133
142
|
__href;
|
|
134
143
|
__label;
|
|
135
144
|
static getType() {
|
|
136
145
|
return "reference-link";
|
|
137
146
|
}
|
|
138
147
|
static clone(e) {
|
|
139
|
-
return new
|
|
148
|
+
return new ce(e.__href, e.__label, e.__key);
|
|
140
149
|
}
|
|
141
150
|
constructor(e, t, r) {
|
|
142
151
|
super(r), this.__href = e, this.__label = t;
|
|
@@ -152,53 +161,53 @@ let ne = class le extends G {
|
|
|
152
161
|
}
|
|
153
162
|
exportJSON() {
|
|
154
163
|
return {
|
|
155
|
-
type:
|
|
164
|
+
type: ce.getType(),
|
|
156
165
|
version: 1,
|
|
157
166
|
href: this.__href,
|
|
158
167
|
label: this.__label
|
|
159
168
|
};
|
|
160
169
|
}
|
|
161
170
|
static importJSON(e) {
|
|
162
|
-
return
|
|
171
|
+
return je(e.href, e.label);
|
|
163
172
|
}
|
|
164
173
|
decorate(e, t) {
|
|
165
|
-
const r = this.__href, i = r.split("/").pop() || "unknown",
|
|
166
|
-
return /* @__PURE__ */
|
|
167
|
-
if (
|
|
174
|
+
const r = this.__href, i = r.split("/").pop() || "unknown", l = /^https?:\/\//i.test(r), a = /^#?\$PROJECT\//i.test(r);
|
|
175
|
+
return /* @__PURE__ */ s(P, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ s(He, { fileName: i, onSelect: () => {
|
|
176
|
+
if (l)
|
|
168
177
|
window.open(r, "_blank", "noopener,noreferrer");
|
|
169
178
|
else if (a) {
|
|
170
|
-
const c = r.replace(/^#?\$PROJECT\//i, ""),
|
|
179
|
+
const c = r.replace(/^#?\$PROJECT\//i, ""), m = new CustomEvent("ui:open-project-file", {
|
|
171
180
|
detail: c
|
|
172
181
|
});
|
|
173
|
-
window.dispatchEvent(
|
|
182
|
+
window.dispatchEvent(m);
|
|
174
183
|
} else
|
|
175
184
|
window.location.assign(r);
|
|
176
185
|
} }) });
|
|
177
186
|
}
|
|
178
187
|
};
|
|
179
|
-
function
|
|
180
|
-
return new
|
|
188
|
+
function je(n, e) {
|
|
189
|
+
return new re(n, e);
|
|
181
190
|
}
|
|
182
|
-
function
|
|
183
|
-
return n instanceof
|
|
191
|
+
function Yt(n) {
|
|
192
|
+
return n instanceof re;
|
|
184
193
|
}
|
|
185
|
-
const
|
|
186
|
-
dependencies: [
|
|
194
|
+
const he = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, Qt = {
|
|
195
|
+
dependencies: [re],
|
|
187
196
|
export: (n) => {
|
|
188
|
-
if (
|
|
197
|
+
if (Yt(n)) {
|
|
189
198
|
const e = n.__href, t = n.__label ?? e;
|
|
190
199
|
return t ? `{{link('${t}')}}` : `{{link('${e}')}}`;
|
|
191
200
|
}
|
|
192
201
|
return null;
|
|
193
202
|
},
|
|
194
|
-
regExp:
|
|
195
|
-
importRegExp:
|
|
203
|
+
regExp: he,
|
|
204
|
+
importRegExp: he,
|
|
196
205
|
replace: (n, e) => {
|
|
197
206
|
const t = e[2], o = /^(https?:\/\/|\/)/i.test(t) ? t : `#${t}`, i = t;
|
|
198
|
-
n.replace(
|
|
207
|
+
n.replace(je(o, i));
|
|
199
208
|
},
|
|
200
209
|
type: "text-match"
|
|
201
|
-
},
|
|
210
|
+
}, fe = {
|
|
202
211
|
code: "rich-text__code",
|
|
203
212
|
codeHighlight: {
|
|
204
213
|
atrule: "rich-text__tokenAttr",
|
|
@@ -272,74 +281,74 @@ const _e = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, Gt = {
|
|
|
272
281
|
row: "rich-text__row",
|
|
273
282
|
content: "rich-text__content"
|
|
274
283
|
}
|
|
275
|
-
},
|
|
284
|
+
}, V = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", Zt = (n) => n == null ? "-" : typeof n == "string" ? n.length ? n : "-" : typeof n == "number" || typeof n == "boolean" ? String(n).toUpperCase() : n instanceof Date ? n.toISOString() : JSON.stringify(n), en = (n) => {
|
|
276
285
|
const e = C(6), {
|
|
277
286
|
defaultCode: t,
|
|
278
287
|
isEditable: r,
|
|
279
288
|
showLineNumbers: o,
|
|
280
289
|
disableScroll: i
|
|
281
|
-
} = n,
|
|
290
|
+
} = n, l = t === void 0 ? "" : t, a = r === void 0 ? !1 : r, c = o === void 0 ? !1 : o, m = i === void 0 ? !1 : i;
|
|
282
291
|
if (a) {
|
|
283
|
-
let
|
|
284
|
-
return e[0] !==
|
|
292
|
+
let p;
|
|
293
|
+
return e[0] !== l ? (p = /* @__PURE__ */ s(st, { defaultValue: l, fontFamily: "mono", fontSize: V, resize: "vertical", minHeight: "100%" }), e[0] = l, e[1] = p) : p = e[1], p;
|
|
285
294
|
}
|
|
286
|
-
let
|
|
287
|
-
if (e[2] !==
|
|
288
|
-
const
|
|
289
|
-
`) : [
|
|
290
|
-
|
|
295
|
+
let _;
|
|
296
|
+
if (e[2] !== l || e[3] !== m || e[4] !== c) {
|
|
297
|
+
const p = c ? l.split(`
|
|
298
|
+
`) : [l];
|
|
299
|
+
_ = /* @__PURE__ */ s(P, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: V, lineHeight: "1.5", overflowY: m ? "hidden" : "auto", background: "bg.muted", borderRadius: "md", width: "100%", children: c ? /* @__PURE__ */ s(P, { as: "code", display: "grid", gridTemplateColumns: "auto 1fr", columnGap: "sm", children: p.map(nn) }) : /* @__PURE__ */ s(P, { as: "code", children: l }) }), e[2] = l, e[3] = m, e[4] = c, e[5] = _;
|
|
291
300
|
} else
|
|
292
|
-
|
|
293
|
-
return
|
|
294
|
-
},
|
|
301
|
+
_ = e[5];
|
|
302
|
+
return _;
|
|
303
|
+
}, tn = (n) => {
|
|
295
304
|
const e = C(26), {
|
|
296
305
|
data: t,
|
|
297
306
|
fullWidth: r,
|
|
298
307
|
noBorder: o,
|
|
299
308
|
hiddenColumns: i
|
|
300
|
-
} = n,
|
|
309
|
+
} = n, l = r === void 0 ? !1 : r, a = o === void 0 ? !1 : o;
|
|
301
310
|
let c;
|
|
302
311
|
e[0] !== i ? (c = i === void 0 ? [] : i, e[0] = i, e[1] = c) : c = e[1];
|
|
303
|
-
const
|
|
312
|
+
const m = c;
|
|
304
313
|
if (!t.length) {
|
|
305
314
|
const E = a ? "0" : "1px";
|
|
306
315
|
let R;
|
|
307
|
-
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */
|
|
308
|
-
let
|
|
309
|
-
return e[3] !== E ? (
|
|
316
|
+
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ s(w, { textStyle: "label/S/regular", fontSize: V, color: "fg.muted", children: "No data" }), e[2] = R) : R = e[2];
|
|
317
|
+
let S;
|
|
318
|
+
return e[3] !== E ? (S = /* @__PURE__ */ s(P, { padding: "sm", borderWidth: E, borderColor: "border.muted", children: R }), e[3] = E, e[4] = S) : S = e[4], S;
|
|
310
319
|
}
|
|
311
|
-
let
|
|
312
|
-
e[5] !==
|
|
313
|
-
const
|
|
314
|
-
let
|
|
315
|
-
e[7] !== t[0] ? (
|
|
320
|
+
let _;
|
|
321
|
+
e[5] !== m ? (_ = new Set(m), e[5] = m, e[6] = _) : _ = e[6];
|
|
322
|
+
const p = _;
|
|
323
|
+
let u;
|
|
324
|
+
e[7] !== t[0] ? (u = Object.keys(t[0] ?? {}), e[7] = t[0], e[8] = u) : u = e[8];
|
|
316
325
|
let d;
|
|
317
|
-
e[9] !==
|
|
318
|
-
const f = d, g =
|
|
319
|
-
let
|
|
320
|
-
e[12] !== f ? (
|
|
326
|
+
e[9] !== p || e[10] !== u ? (d = u.filter((E) => !p.has(E)), e[9] = p, e[10] = u, e[11] = d) : d = e[11];
|
|
327
|
+
const f = d, g = l ? "100%" : "fit-content", x = a ? "0" : "1px";
|
|
328
|
+
let y;
|
|
329
|
+
e[12] !== f ? (y = /* @__PURE__ */ s(H.Header, { children: /* @__PURE__ */ s(H.Row, { background: "bg.muted", children: f.map(rn) }) }), e[12] = f, e[13] = y) : y = e[13];
|
|
321
330
|
let N;
|
|
322
331
|
if (e[14] !== f || e[15] !== t) {
|
|
323
332
|
let E;
|
|
324
|
-
e[17] !== f ? (E = (R,
|
|
333
|
+
e[17] !== f ? (E = (R, S) => /* @__PURE__ */ s(H.Row, { children: f.map((h) => /* @__PURE__ */ s(H.Cell, { paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ s(w, { textStyle: "paragraph/S/regular", fontSize: V, children: Zt(R[h]) }) }, `${S}-${h}`)) }, `${S}-${f.join("-")}`), e[17] = f, e[18] = E) : E = e[18], N = t.map(E), e[14] = f, e[15] = t, e[16] = N;
|
|
325
334
|
} else
|
|
326
335
|
N = e[16];
|
|
327
336
|
let b;
|
|
328
|
-
e[19] !== N ? (b = /* @__PURE__ */
|
|
337
|
+
e[19] !== N ? (b = /* @__PURE__ */ s(H.Body, { children: N }), e[19] = N, e[20] = b) : b = e[20];
|
|
329
338
|
let T;
|
|
330
|
-
return e[21] !== b || e[22] !== g || e[23] !== x || e[24] !==
|
|
331
|
-
|
|
339
|
+
return e[21] !== b || e[22] !== g || e[23] !== x || e[24] !== y ? (T = /* @__PURE__ */ s(H.ScrollArea, { overflowX: "auto", maxWidth: "100%", children: /* @__PURE__ */ L(H.Root, { size: "sm", width: g, borderWidth: x, borderColor: "border.muted", children: [
|
|
340
|
+
y,
|
|
332
341
|
b
|
|
333
|
-
] }) }), e[21] = b, e[22] = g, e[23] = x, e[24] =
|
|
342
|
+
] }) }), e[21] = b, e[22] = g, e[23] = x, e[24] = y, e[25] = T) : T = e[25], T;
|
|
334
343
|
};
|
|
335
|
-
function
|
|
344
|
+
function nn(n, e) {
|
|
336
345
|
return /* @__PURE__ */ L(P, { as: "span", display: "contents", children: [
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ s(w, { as: "span", color: "fg.muted", textAlign: "right", fontSize: "inherit", children: e + 1 }),
|
|
347
|
+
/* @__PURE__ */ s(w, { as: "span", fontSize: "inherit", children: n.length ? n : " " })
|
|
339
348
|
] }, `${e}-${n}`);
|
|
340
349
|
}
|
|
341
|
-
function
|
|
342
|
-
return /* @__PURE__ */
|
|
350
|
+
function rn(n) {
|
|
351
|
+
return /* @__PURE__ */ s(H.ColumnHeader, { textTransform: "none", paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ s(w, { textStyle: "label/S/medium", fontSize: V, children: n }) }, n);
|
|
343
352
|
}
|
|
344
353
|
class U extends G {
|
|
345
354
|
__data;
|
|
@@ -362,7 +371,7 @@ class U extends G {
|
|
|
362
371
|
return !1;
|
|
363
372
|
}
|
|
364
373
|
decorate() {
|
|
365
|
-
return /* @__PURE__ */
|
|
374
|
+
return /* @__PURE__ */ s(tn, { fullWidth: !0, isReadOnly: !0, data: this.__data });
|
|
366
375
|
}
|
|
367
376
|
exportJSON() {
|
|
368
377
|
return {
|
|
@@ -376,15 +385,15 @@ class U extends G {
|
|
|
376
385
|
}
|
|
377
386
|
getTextContent() {
|
|
378
387
|
if (!this.__data.length) return "";
|
|
379
|
-
const e = Object.keys(this.__data[0]), t = e.join(" | "), r = e.map(() => "---").join(" | "), o = this.__data.map((i) => e.map((
|
|
388
|
+
const e = Object.keys(this.__data[0]), t = e.join(" | "), r = e.map(() => "---").join(" | "), o = this.__data.map((i) => e.map((l) => String(i[l] || "")).join(" | "));
|
|
380
389
|
return [t, r, ...o].join(`
|
|
381
390
|
`);
|
|
382
391
|
}
|
|
383
392
|
}
|
|
384
|
-
function
|
|
393
|
+
function ge(n) {
|
|
385
394
|
return new U(n);
|
|
386
395
|
}
|
|
387
|
-
function
|
|
396
|
+
function xe(n) {
|
|
388
397
|
return n instanceof U;
|
|
389
398
|
}
|
|
390
399
|
class K extends G {
|
|
@@ -427,15 +436,15 @@ ${this.__code}
|
|
|
427
436
|
\`\`\``;
|
|
428
437
|
}
|
|
429
438
|
decorate() {
|
|
430
|
-
return /* @__PURE__ */
|
|
439
|
+
return /* @__PURE__ */ s(P, { borderRadius: "md", overflow: "hidden", children: /* @__PURE__ */ s(en, { language: this.__language || "plaintext", defaultCode: this.__code, isEditable: !1, showLineNumbers: !0, disableScroll: !0 }) });
|
|
431
440
|
}
|
|
432
441
|
}
|
|
433
|
-
const
|
|
434
|
-
function
|
|
442
|
+
const on = xt.lazy(() => import("./EquationComponent-DeDYHvqY.js"));
|
|
443
|
+
function Ee(n) {
|
|
435
444
|
let e = n.getAttribute("data-lexical-equation");
|
|
436
445
|
const t = n.getAttribute("data-lexical-inline") === "true";
|
|
437
446
|
return e = atob(e || ""), e ? {
|
|
438
|
-
node:
|
|
447
|
+
node: oe(e, t)
|
|
439
448
|
} : null;
|
|
440
449
|
}
|
|
441
450
|
class B extends G {
|
|
@@ -451,7 +460,7 @@ class B extends G {
|
|
|
451
460
|
super(r), this.__equation = e, this.__inline = t ?? !1;
|
|
452
461
|
}
|
|
453
462
|
static importJSON(e) {
|
|
454
|
-
return
|
|
463
|
+
return oe(e.equation, e.inline);
|
|
455
464
|
}
|
|
456
465
|
exportJSON() {
|
|
457
466
|
return {
|
|
@@ -467,7 +476,7 @@ class B extends G {
|
|
|
467
476
|
}
|
|
468
477
|
exportDOM() {
|
|
469
478
|
const e = document.createElement(this.__inline ? "span" : "div"), t = btoa(this.__equation);
|
|
470
|
-
return e.setAttribute("data-lexical-equation", t), e.setAttribute("data-lexical-inline", `${this.__inline}`),
|
|
479
|
+
return e.setAttribute("data-lexical-equation", t), e.setAttribute("data-lexical-inline", `${this.__inline}`), Pt.render(this.__equation, e, {
|
|
471
480
|
displayMode: !this.__inline,
|
|
472
481
|
// true === block display //
|
|
473
482
|
errorColor: "#cc0000",
|
|
@@ -482,11 +491,11 @@ class B extends G {
|
|
|
482
491
|
static importDOM() {
|
|
483
492
|
return {
|
|
484
493
|
div: (e) => e.hasAttribute("data-lexical-equation") ? {
|
|
485
|
-
conversion:
|
|
494
|
+
conversion: Ee,
|
|
486
495
|
priority: 2
|
|
487
496
|
} : null,
|
|
488
497
|
span: (e) => e.hasAttribute("data-lexical-equation") ? {
|
|
489
|
-
conversion:
|
|
498
|
+
conversion: Ee,
|
|
490
499
|
priority: 1
|
|
491
500
|
} : null
|
|
492
501
|
};
|
|
@@ -508,46 +517,46 @@ class B extends G {
|
|
|
508
517
|
return this.__inline;
|
|
509
518
|
}
|
|
510
519
|
decorate() {
|
|
511
|
-
return /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ s(Et, { fallback: null, children: /* @__PURE__ */ s(on, { equation: this.__equation, inline: this.__inline }) });
|
|
512
521
|
}
|
|
513
522
|
}
|
|
514
|
-
function
|
|
523
|
+
function oe(n = "", e = !1) {
|
|
515
524
|
const t = new B(n, e);
|
|
516
|
-
return
|
|
525
|
+
return ct(t);
|
|
517
526
|
}
|
|
518
|
-
function
|
|
527
|
+
function Be(n) {
|
|
519
528
|
return n instanceof B;
|
|
520
529
|
}
|
|
521
|
-
const
|
|
530
|
+
const Ue = {
|
|
522
531
|
dependencies: [B],
|
|
523
|
-
export: (n) =>
|
|
532
|
+
export: (n) => Be(n) && n.isInline() ? `\\( ${n.getEquation().trim()} \\)` : null,
|
|
524
533
|
importRegExp: /\\\((.*?)\\\)/,
|
|
525
534
|
regExp: /\\\((.*?)\\\)/,
|
|
526
535
|
replace: (n, e) => {
|
|
527
|
-
const t =
|
|
536
|
+
const t = oe(e[1].trim(), !0);
|
|
528
537
|
n.replace(t);
|
|
529
538
|
},
|
|
530
539
|
type: "text-match"
|
|
531
|
-
},
|
|
540
|
+
}, Je = {
|
|
532
541
|
dependencies: [B],
|
|
533
542
|
regExpStart: /\\\[/,
|
|
534
543
|
regExpEnd: /\\]/,
|
|
535
|
-
export: (n) =>
|
|
536
|
-
replace: (n, e, t, r, o) => o ? (n.append(
|
|
544
|
+
export: (n) => Be(n) && !n.isInline() ? `\\[ ${n.getEquation().trim()} \\]` : null,
|
|
545
|
+
replace: (n, e, t, r, o) => o ? (n.append(oe(o.join(" "), !1)), !0) : !1,
|
|
537
546
|
type: "multiline-element"
|
|
538
547
|
};
|
|
539
|
-
function
|
|
548
|
+
function sn() {
|
|
540
549
|
return null;
|
|
541
550
|
}
|
|
542
|
-
class
|
|
551
|
+
class z extends Ie {
|
|
543
552
|
static getType() {
|
|
544
553
|
return "hr";
|
|
545
554
|
}
|
|
546
555
|
static clone(e) {
|
|
547
|
-
return new
|
|
556
|
+
return new z(e?.__key);
|
|
548
557
|
}
|
|
549
558
|
static importJSON(e) {
|
|
550
|
-
return
|
|
559
|
+
return ze();
|
|
551
560
|
}
|
|
552
561
|
exportJSON() {
|
|
553
562
|
return {
|
|
@@ -565,29 +574,29 @@ class W extends $e {
|
|
|
565
574
|
return null;
|
|
566
575
|
}
|
|
567
576
|
}
|
|
568
|
-
function
|
|
569
|
-
return new
|
|
577
|
+
function ze() {
|
|
578
|
+
return new z();
|
|
570
579
|
}
|
|
571
|
-
function
|
|
572
|
-
return n instanceof
|
|
580
|
+
function ln(n) {
|
|
581
|
+
return n instanceof z;
|
|
573
582
|
}
|
|
574
|
-
const
|
|
575
|
-
dependencies: [
|
|
576
|
-
export: (n) =>
|
|
583
|
+
const cn = {
|
|
584
|
+
dependencies: [z],
|
|
585
|
+
export: (n) => ln(n) ? "***" : null,
|
|
577
586
|
regExp: /^(---|\*\*\*|___)\s?$/,
|
|
578
587
|
replace: (n) => {
|
|
579
|
-
const e =
|
|
588
|
+
const e = ze();
|
|
580
589
|
n.replace(e);
|
|
581
590
|
},
|
|
582
591
|
type: "element"
|
|
583
|
-
},
|
|
592
|
+
}, an = {
|
|
584
593
|
dependencies: [],
|
|
585
594
|
export: (n, e) => {
|
|
586
|
-
if (
|
|
595
|
+
if (xe(n)) {
|
|
587
596
|
const t = n.getData();
|
|
588
597
|
if (!t.length) return "";
|
|
589
|
-
const r = Object.keys(t[0]), o = r.join(" | "), i = r.map(() => "---").join(" | "),
|
|
590
|
-
return [`| ${o} |`, `| ${i} |`, ...
|
|
598
|
+
const r = Object.keys(t[0]), o = r.join(" | "), i = r.map(() => "---").join(" | "), l = t.map((a) => r.map((c) => String(a[c] || "")).join(" | "));
|
|
599
|
+
return [`| ${o} |`, `| ${i} |`, ...l.map((a) => `| ${a} |`)].join(`
|
|
591
600
|
`);
|
|
592
601
|
}
|
|
593
602
|
return null;
|
|
@@ -599,26 +608,26 @@ const sn = {
|
|
|
599
608
|
n.remove();
|
|
600
609
|
return;
|
|
601
610
|
}
|
|
602
|
-
const
|
|
603
|
-
if (o?.getType() === "data_table" &&
|
|
604
|
-
const a = o.getData(), c = {},
|
|
605
|
-
|
|
606
|
-
const g =
|
|
611
|
+
const l = t[0].split("|").slice(1, -1).map((a) => a.trim());
|
|
612
|
+
if (o?.getType() === "data_table" && xe(o)) {
|
|
613
|
+
const a = o.getData(), c = {}, m = a.length === 1 && Object.values(a[0]).every((d) => d === ""), _ = a.length > 0 ? Object.keys(a[0]) : l.map((d, f) => `col_${f}`);
|
|
614
|
+
l.forEach((d, f) => {
|
|
615
|
+
const g = _[f] || `col_${f}`;
|
|
607
616
|
c[g] = d;
|
|
608
617
|
});
|
|
609
|
-
const
|
|
610
|
-
o.replace(
|
|
618
|
+
const p = m ? [c] : [...a, c], u = ge(p);
|
|
619
|
+
o.replace(u), n.remove();
|
|
611
620
|
} else {
|
|
612
621
|
const a = {};
|
|
613
|
-
|
|
614
|
-
a[
|
|
622
|
+
l.forEach((m, _) => {
|
|
623
|
+
a[m || `col_${_}`] = "";
|
|
615
624
|
});
|
|
616
|
-
const c =
|
|
625
|
+
const c = ge([a]);
|
|
617
626
|
n.replace(c);
|
|
618
627
|
}
|
|
619
628
|
},
|
|
620
629
|
type: "element"
|
|
621
|
-
},
|
|
630
|
+
}, dn = {
|
|
622
631
|
dependencies: [ee],
|
|
623
632
|
export: (n, e) => {
|
|
624
633
|
if (n instanceof ee) {
|
|
@@ -638,36 +647,36 @@ const sn = {
|
|
|
638
647
|
regExp: /<ins>(.*)<\/ins>/,
|
|
639
648
|
importRegExp: /<ins>(.*)<\/ins>/,
|
|
640
649
|
replace: (n, e) => {
|
|
641
|
-
const t =
|
|
650
|
+
const t = ve(e[1]);
|
|
642
651
|
t.toggleFormat("underline"), n.replace(t);
|
|
643
652
|
},
|
|
644
653
|
type: "text-match"
|
|
645
|
-
},
|
|
654
|
+
}, un = {
|
|
646
655
|
dependencies: [ee],
|
|
647
656
|
export: (n, e) => null,
|
|
648
657
|
regExp: /<u>(.*)<\/u>/,
|
|
649
658
|
importRegExp: /<u>(.*)<\/u>/,
|
|
650
659
|
replace: (n, e) => {
|
|
651
|
-
const t =
|
|
660
|
+
const t = ve(e[1]);
|
|
652
661
|
t.toggleFormat("underline"), n.replace(t);
|
|
653
662
|
},
|
|
654
663
|
type: "text-match"
|
|
655
|
-
}, We = [
|
|
656
|
-
function
|
|
664
|
+
}, We = [an, cn, dn, un], Kr = [ke, Te, U, $e, Re, Ne, de, K, B, z, re], Vr = [...Ce, ...We, Ue, Je, Qt], Xr = fe;
|
|
665
|
+
function fn() {
|
|
657
666
|
const n = C(3), [e] = M();
|
|
658
667
|
let t, r;
|
|
659
668
|
return n[0] !== e ? (t = () => {
|
|
660
|
-
e.update(
|
|
669
|
+
e.update(mn);
|
|
661
670
|
}, r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), j(t, r), null;
|
|
662
671
|
}
|
|
663
|
-
function
|
|
664
|
-
const n =
|
|
672
|
+
function mn() {
|
|
673
|
+
const n = at(de);
|
|
665
674
|
for (const e of n) {
|
|
666
675
|
const t = e.getLanguage() ?? "plaintext", r = e.getTextContent();
|
|
667
676
|
e.replace(new K(t, r));
|
|
668
677
|
}
|
|
669
678
|
}
|
|
670
|
-
function
|
|
679
|
+
function Ke(n) {
|
|
671
680
|
const e = C(4), {
|
|
672
681
|
isEditable: t
|
|
673
682
|
} = n, [r] = M();
|
|
@@ -676,14 +685,14 @@ function ze(n) {
|
|
|
676
685
|
r.setEditable(t);
|
|
677
686
|
}, i = [t, r], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), j(o, i), null;
|
|
678
687
|
}
|
|
679
|
-
function
|
|
688
|
+
function Ve() {
|
|
680
689
|
const n = C(2), [e] = M();
|
|
681
690
|
let t;
|
|
682
|
-
return n[0] !== e ? (t = /* @__PURE__ */
|
|
691
|
+
return n[0] !== e ? (t = /* @__PURE__ */ s(P, { fontSize: "xs", color: "fg.muted", padding: "4", children: /* @__PURE__ */ s(Lt, { treeTypeButtonClassName: "debug-treetype-button", timeTravelButtonClassName: "debug-timetravel-button", timeTravelPanelButtonClassName: "debug-timetravel-button", timeTravelPanelClassName: "debug-timetravel-panel", timeTravelPanelSliderClassName: "debug-timetravel-slider", viewClassName: "tree-view-output", editor: e }) }), n[0] = e, n[1] = t) : t = n[1], t;
|
|
683
692
|
}
|
|
684
|
-
const
|
|
685
|
-
function
|
|
686
|
-
const e = n.match(
|
|
693
|
+
const _n = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/;
|
|
694
|
+
function pn(n) {
|
|
695
|
+
const e = n.match(_n);
|
|
687
696
|
return e ? {
|
|
688
697
|
frontmatter: e[0],
|
|
689
698
|
body: n.slice(e[0].length)
|
|
@@ -692,29 +701,29 @@ function fn(n) {
|
|
|
692
701
|
body: n
|
|
693
702
|
};
|
|
694
703
|
}
|
|
695
|
-
const
|
|
696
|
-
k(pn);
|
|
697
|
-
k(_n);
|
|
704
|
+
const hn = "UPLOAD_FILE", gn = "OPEN_CONTEXT", xn = "RUN_PROMPT", En = "UPDATE_FORMAT", bn = "UPDATE_BEHAVIOR", Sn = "INSERT_PROMPT", yn = "RENAME_PROMPT", Tn = "DUPLICATE_PROMPT", Rn = "DELETE_PROMPT", Nn = "DELETE_REFERENCES", Cn = "RENAME_REFERENCES", On = "INSERT_REFERENCE", kn = "INSERT_BLOCK";
|
|
698
705
|
k(hn);
|
|
699
706
|
k(gn);
|
|
700
707
|
k(xn);
|
|
701
708
|
k(En);
|
|
702
709
|
k(bn);
|
|
703
|
-
k(yn);
|
|
704
710
|
k(Sn);
|
|
711
|
+
k(yn);
|
|
705
712
|
k(Tn);
|
|
706
713
|
k(Rn);
|
|
707
|
-
|
|
708
|
-
k(
|
|
709
|
-
k($n);
|
|
714
|
+
k(Nn);
|
|
715
|
+
k(Cn);
|
|
716
|
+
const Xe = k(On), $n = k(kn), In = "INSERT_NEW_FILE_PLACEHOLDER", vn = "INSERT_NEW_TEXT_PLACEHOLDER", wn = "INSERT_PLACEHOLDER_REFERENCE";
|
|
710
717
|
k(In);
|
|
711
|
-
|
|
718
|
+
k(vn);
|
|
719
|
+
k(wn);
|
|
720
|
+
function Pn(n) {
|
|
712
721
|
const e = te();
|
|
713
722
|
return n.style !== null && e.setFormat(n.style.textAlign), {
|
|
714
723
|
node: e
|
|
715
724
|
};
|
|
716
725
|
}
|
|
717
|
-
class Y extends
|
|
726
|
+
class Y extends Ie {
|
|
718
727
|
static getType() {
|
|
719
728
|
return "comment";
|
|
720
729
|
}
|
|
@@ -723,7 +732,7 @@ class Y extends $e {
|
|
|
723
732
|
}
|
|
724
733
|
createDOM(e) {
|
|
725
734
|
const t = document.createElement("blockquote");
|
|
726
|
-
return
|
|
735
|
+
return Fe(t, e.theme.comment), t;
|
|
727
736
|
}
|
|
728
737
|
updateDOM() {
|
|
729
738
|
return !1;
|
|
@@ -731,7 +740,7 @@ class Y extends $e {
|
|
|
731
740
|
static importDOM() {
|
|
732
741
|
return {
|
|
733
742
|
blockquote: () => ({
|
|
734
|
-
conversion:
|
|
743
|
+
conversion: Pn,
|
|
735
744
|
priority: 0
|
|
736
745
|
})
|
|
737
746
|
};
|
|
@@ -740,7 +749,7 @@ class Y extends $e {
|
|
|
740
749
|
const {
|
|
741
750
|
element: t
|
|
742
751
|
} = super.exportDOM(e);
|
|
743
|
-
if (t &&
|
|
752
|
+
if (t && dt(t)) {
|
|
744
753
|
this.isEmpty() && t.append(document.createElement("br"));
|
|
745
754
|
const r = this.getFormatType();
|
|
746
755
|
t.style.textAlign = r;
|
|
@@ -766,11 +775,11 @@ class Y extends $e {
|
|
|
766
775
|
}
|
|
767
776
|
// mutation
|
|
768
777
|
insertNewAfter(e, t) {
|
|
769
|
-
const r =
|
|
778
|
+
const r = le(), o = this.getDirection();
|
|
770
779
|
return r.setDirection(o), this.insertAfter(r, t), r;
|
|
771
780
|
}
|
|
772
781
|
collapseAtStart() {
|
|
773
|
-
const e =
|
|
782
|
+
const e = le();
|
|
774
783
|
return this.getChildren().forEach((r) => {
|
|
775
784
|
e.append(r);
|
|
776
785
|
}), this.replace(e), !0;
|
|
@@ -779,46 +788,46 @@ class Y extends $e {
|
|
|
779
788
|
function te() {
|
|
780
789
|
return new Y();
|
|
781
790
|
}
|
|
782
|
-
const
|
|
783
|
-
const t =
|
|
791
|
+
const Ln = (n, e) => {
|
|
792
|
+
const t = ut(), r = te();
|
|
784
793
|
if (e) {
|
|
785
794
|
e.getParent()?.replace(r, !0), e.remove(), r.selectEnd();
|
|
786
795
|
return;
|
|
787
796
|
}
|
|
788
|
-
|
|
797
|
+
ft(t) && Rt(t, te);
|
|
789
798
|
};
|
|
790
|
-
function
|
|
799
|
+
function Mn() {
|
|
791
800
|
const n = C(3), [e] = M();
|
|
792
801
|
let t, r;
|
|
793
|
-
return n[0] !== e ? (t = () =>
|
|
802
|
+
return n[0] !== e ? (t = () => ue(e.registerCommand($n, Dn, we)), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), j(t, r), null;
|
|
794
803
|
}
|
|
795
|
-
function
|
|
804
|
+
function Dn(n) {
|
|
796
805
|
const {
|
|
797
806
|
optionId: e,
|
|
798
807
|
nodeToReplace: t
|
|
799
808
|
} = n;
|
|
800
|
-
return
|
|
809
|
+
return Ln(e, t), !1;
|
|
801
810
|
}
|
|
802
|
-
const
|
|
811
|
+
const An = () => {
|
|
803
812
|
const n = C(3), [e] = M();
|
|
804
813
|
let t, r;
|
|
805
|
-
n[0] !== e ? (t = () =>
|
|
806
|
-
const
|
|
807
|
-
|
|
808
|
-
|
|
814
|
+
n[0] !== e ? (t = () => ue(e.registerNodeTransform(Y, (o) => {
|
|
815
|
+
const l = o.getChildren().filter(Fn);
|
|
816
|
+
l.length > 0 && e.update(() => {
|
|
817
|
+
l.forEach(qn);
|
|
809
818
|
});
|
|
810
819
|
})), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), j(t, r);
|
|
811
820
|
};
|
|
812
|
-
function
|
|
821
|
+
function Fn(n) {
|
|
813
822
|
return n.getType() === "comment";
|
|
814
823
|
}
|
|
815
|
-
function
|
|
816
|
-
n.replace(
|
|
824
|
+
function qn(n) {
|
|
825
|
+
n.replace(le(), !0);
|
|
817
826
|
}
|
|
818
|
-
function
|
|
819
|
-
return
|
|
827
|
+
function Hn() {
|
|
828
|
+
return An(), Mn(), null;
|
|
820
829
|
}
|
|
821
|
-
const
|
|
830
|
+
const jn = (n) => {
|
|
822
831
|
let e = "";
|
|
823
832
|
const t = n.getChildren(), r = t.length;
|
|
824
833
|
for (let o = 0; o < r; o++) {
|
|
@@ -827,10 +836,10 @@ const qn = (n) => {
|
|
|
827
836
|
`);
|
|
828
837
|
}
|
|
829
838
|
return e;
|
|
830
|
-
},
|
|
839
|
+
}, Bn = (n) => n.type !== "reference" ? null : `#${n.name ?? n.referenceId ?? ""}`, Un = (n) => n.type === "paragraph" && !!n.children?.length, Ge = (n) => {
|
|
831
840
|
if (n.type === "comment")
|
|
832
841
|
return "";
|
|
833
|
-
const e =
|
|
842
|
+
const e = Bn(n);
|
|
834
843
|
if (e !== null)
|
|
835
844
|
return e;
|
|
836
845
|
let t = typeof n.text == "string" ? n.text : "";
|
|
@@ -838,24 +847,24 @@ const qn = (n) => {
|
|
|
838
847
|
if (!Array.isArray(r)) return t;
|
|
839
848
|
const o = r.length;
|
|
840
849
|
for (let i = 0; i < o; i += 1) {
|
|
841
|
-
const
|
|
842
|
-
if (
|
|
850
|
+
const l = r[i];
|
|
851
|
+
if (l.type === "comment") {
|
|
843
852
|
i !== o - 1 && (t += `
|
|
844
853
|
`);
|
|
845
854
|
continue;
|
|
846
855
|
}
|
|
847
|
-
t +=
|
|
856
|
+
t += Ge(l), Un(l) && (t += `
|
|
848
857
|
`);
|
|
849
858
|
}
|
|
850
859
|
return t;
|
|
851
|
-
},
|
|
860
|
+
}, Ye = (n) => {
|
|
852
861
|
try {
|
|
853
862
|
const e = JSON.parse(n);
|
|
854
|
-
return
|
|
863
|
+
return Ge(e.root ?? {});
|
|
855
864
|
} catch {
|
|
856
865
|
return "";
|
|
857
866
|
}
|
|
858
|
-
},
|
|
867
|
+
}, Jn = {
|
|
859
868
|
root: {
|
|
860
869
|
direction: "ltr",
|
|
861
870
|
format: "",
|
|
@@ -873,7 +882,7 @@ const qn = (n) => {
|
|
|
873
882
|
}]
|
|
874
883
|
}
|
|
875
884
|
};
|
|
876
|
-
function
|
|
885
|
+
function zn(n = "") {
|
|
877
886
|
return n.trim() ? {
|
|
878
887
|
root: {
|
|
879
888
|
direction: "ltr",
|
|
@@ -899,106 +908,106 @@ function Un(n = "") {
|
|
|
899
908
|
}] : []
|
|
900
909
|
}))
|
|
901
910
|
}
|
|
902
|
-
} : JSON.parse(JSON.stringify(
|
|
911
|
+
} : JSON.parse(JSON.stringify(Jn));
|
|
903
912
|
}
|
|
904
|
-
function
|
|
913
|
+
function Wn(n) {
|
|
905
914
|
const e = C(4), {
|
|
906
915
|
editorRef: t,
|
|
907
916
|
previousTextRef: r
|
|
908
917
|
} = n, [o] = M();
|
|
909
|
-
let i,
|
|
918
|
+
let i, l;
|
|
910
919
|
return e[0] !== o || e[1] !== r ? (i = () => ({
|
|
911
920
|
setEditorValue: (a) => {
|
|
912
|
-
const c = o.parseEditorState(JSON.stringify(
|
|
913
|
-
o.setEditorState(c), r.current =
|
|
921
|
+
const c = o.parseEditorState(JSON.stringify(zn(a)));
|
|
922
|
+
o.setEditorState(c), r.current = Ye(a), o.focus(void 0, {
|
|
914
923
|
defaultSelection: "rootEnd"
|
|
915
924
|
});
|
|
916
925
|
}
|
|
917
|
-
}),
|
|
926
|
+
}), l = [o, r], e[0] = o, e[1] = r, e[2] = i, e[3] = l) : (i = e[2], l = e[3]), bt(t, i, l), null;
|
|
918
927
|
}
|
|
919
|
-
const
|
|
920
|
-
function
|
|
928
|
+
const Kn = (n) => n.key !== "Enter" ? !1 : !n.ctrlKey && !n.metaKey && !n.shiftKey && !n.altKey;
|
|
929
|
+
function Vn(n) {
|
|
921
930
|
const e = C(4), {
|
|
922
931
|
onSubmit: t
|
|
923
932
|
} = n, [r] = M();
|
|
924
933
|
let o, i;
|
|
925
|
-
return e[0] !== r || e[1] !== t ? (o = () => r.registerCommand(
|
|
934
|
+
return e[0] !== r || e[1] !== t ? (o = () => r.registerCommand(_t, (l) => Kn(l) ? (l.preventDefault(), t?.(), !0) : !1, pt), i = [r, t], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), j(o, i), null;
|
|
926
935
|
}
|
|
927
|
-
const
|
|
936
|
+
const be = ["table", "connector"], Xn = (n) => n.sort((r, o) => be.indexOf(r.group) - be.indexOf(o.group)).map((r, o) => ({
|
|
928
937
|
...r,
|
|
929
938
|
index: o
|
|
930
939
|
})).reduce((r, o) => {
|
|
931
940
|
const i = r[o.group] ?? [];
|
|
932
941
|
return i.push(o), r[o.group] = i, r;
|
|
933
942
|
}, {});
|
|
934
|
-
function
|
|
943
|
+
function Se(n) {
|
|
935
944
|
const e = C(19), {
|
|
936
945
|
id: t,
|
|
937
946
|
isSelected: r,
|
|
938
947
|
onClick: o,
|
|
939
948
|
onMouseEnter: i,
|
|
940
|
-
setRefElement:
|
|
949
|
+
setRefElement: l,
|
|
941
950
|
secondaryLabel: a,
|
|
942
951
|
primaryLabel: c,
|
|
943
|
-
tabIndex:
|
|
944
|
-
} = n,
|
|
945
|
-
let
|
|
946
|
-
e[0] !== c ? (
|
|
952
|
+
tabIndex: m
|
|
953
|
+
} = n, _ = m === void 0 ? -1 : m, p = r ? "bg.muted" : "transparent";
|
|
954
|
+
let u;
|
|
955
|
+
e[0] !== c ? (u = /* @__PURE__ */ s(Z.Trigger, { children: /* @__PURE__ */ s(w, { mt: "1px", lineClamp: 1, textOverflow: "ellipsis", textStyle: "label/M/regular", children: c }) }), e[0] = c, e[1] = u) : u = e[1];
|
|
947
956
|
let d;
|
|
948
|
-
e[2] !== c ? (d = /* @__PURE__ */
|
|
957
|
+
e[2] !== c ? (d = /* @__PURE__ */ s(Z.Positioner, { children: /* @__PURE__ */ s(Z.Content, { children: c }) }), e[2] = c, e[3] = d) : d = e[3];
|
|
949
958
|
let f;
|
|
950
|
-
e[4] !==
|
|
951
|
-
|
|
959
|
+
e[4] !== u || e[5] !== d ? (f = /* @__PURE__ */ L(Z.Root, { children: [
|
|
960
|
+
u,
|
|
952
961
|
d
|
|
953
|
-
] }), e[4] =
|
|
962
|
+
] }), e[4] = u, e[5] = d, e[6] = f) : f = e[6];
|
|
954
963
|
let g;
|
|
955
|
-
e[7] !== a ? (g = a && /* @__PURE__ */
|
|
964
|
+
e[7] !== a ? (g = a && /* @__PURE__ */ s(w, { lineClamp: 2, textOverflow: "ellipsis", textStyle: "label/S/regular", color: "fg.muted", children: a }), e[7] = a, e[8] = g) : g = e[8];
|
|
956
965
|
let x;
|
|
957
|
-
return e[9] !== t || e[10] !== r || e[11] !== o || e[12] !== i || e[13] !==
|
|
966
|
+
return e[9] !== t || e[10] !== r || e[11] !== o || e[12] !== i || e[13] !== l || e[14] !== p || e[15] !== f || e[16] !== g || e[17] !== _ ? (x = /* @__PURE__ */ L(ne, { direction: "column", cursor: "pointer", gap: "2xs", padding: "2xs", paddingX: "sm", bg: p, tabIndex: _, ref: l, role: "option", "aria-selected": r, id: t, onMouseEnter: i, onClick: o, children: [
|
|
958
967
|
f,
|
|
959
968
|
g
|
|
960
|
-
] }), e[9] = t, e[10] = r, e[11] = o, e[12] = i, e[13] =
|
|
969
|
+
] }), e[9] = t, e[10] = r, e[11] = o, e[12] = i, e[13] = l, e[14] = p, e[15] = f, e[16] = g, e[17] = _, e[18] = x) : x = e[18], x;
|
|
961
970
|
}
|
|
962
|
-
const
|
|
971
|
+
const Gn = (n) => {
|
|
963
972
|
const e = C(12), {
|
|
964
973
|
options: t,
|
|
965
974
|
selectedIndex: r,
|
|
966
975
|
onSelectItem: o,
|
|
967
976
|
onMouseEnterItem: i
|
|
968
977
|
} = n, {
|
|
969
|
-
table:
|
|
978
|
+
table: l,
|
|
970
979
|
connector: a
|
|
971
|
-
} =
|
|
972
|
-
let
|
|
973
|
-
e[0] !== r ? (
|
|
980
|
+
} = Xn(t), c = l === void 0 ? [] : l, m = a === void 0 ? [] : a, _ = [...c, ...m].length;
|
|
981
|
+
let p, u;
|
|
982
|
+
e[0] !== r ? (p = () => {
|
|
974
983
|
document.getElementById(`typeahead-item-${r}`)?.scrollIntoView({
|
|
975
984
|
behavior: "instant",
|
|
976
985
|
block: "nearest"
|
|
977
986
|
});
|
|
978
|
-
},
|
|
979
|
-
const d = P, f = "1000", g = "absolute", x = "modal",
|
|
987
|
+
}, u = [r], e[0] = r, e[1] = p, e[2] = u) : (p = e[1], u = e[2]), j(p, u);
|
|
988
|
+
const d = P, f = "1000", g = "absolute", x = "modal", y = "auto", N = "24rem";
|
|
980
989
|
let b;
|
|
981
990
|
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = {
|
|
982
991
|
base: "100vw",
|
|
983
992
|
md: "264px"
|
|
984
993
|
}, e[3] = b) : b = e[3];
|
|
985
994
|
let T;
|
|
986
|
-
e[4] !==
|
|
995
|
+
e[4] !== _ ? (T = !_ && /* @__PURE__ */ s(w, { children: "No results" }), e[4] = _, e[5] = T) : T = e[5];
|
|
987
996
|
const E = !!c.length && /* @__PURE__ */ L(pe, { children: [
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
/* @__PURE__ */
|
|
990
|
-
] }), R = !!
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
997
|
+
/* @__PURE__ */ s(w, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Tables" }),
|
|
998
|
+
/* @__PURE__ */ s(P, { children: c.map((h) => /* @__PURE__ */ s(Se, { id: `typeahead-item-${h.index}`, isSelected: r === h.index, onClick: () => o(h, h.index), onMouseEnter: () => i(h.index), primaryLabel: h.name, secondaryLabel: h.description, setRefElement: h.setRefElement, tabIndex: -1 }, h.id)) })
|
|
999
|
+
] }), R = !!m.length && /* @__PURE__ */ L(pe, { children: [
|
|
1000
|
+
/* @__PURE__ */ s(w, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Data Sources" }),
|
|
1001
|
+
/* @__PURE__ */ s(P, { children: m.map((h) => /* @__PURE__ */ s(Se, { id: `typeahead-item-${h.index}`, isSelected: r === h.index, onClick: () => o(h, h.index), onMouseEnter: () => i(h.index), primaryLabel: h.name, secondaryLabel: h.description, setRefElement: h.setRefElement, tabIndex: -1 }, h.id)) })
|
|
993
1002
|
] });
|
|
994
|
-
let
|
|
995
|
-
return e[6] !== d || e[7] !== T || e[8] !== E || e[9] !== R || e[10] !== b ? (
|
|
1003
|
+
let S;
|
|
1004
|
+
return e[6] !== d || e[7] !== T || e[8] !== E || e[9] !== R || e[10] !== b ? (S = /* @__PURE__ */ L(d, { zIndex: f, position: g, layerStyle: x, overflow: y, maxHeight: N, minWidth: b, children: [
|
|
996
1005
|
T,
|
|
997
1006
|
E,
|
|
998
1007
|
R
|
|
999
|
-
] }), e[6] = d, e[7] = T, e[8] = E, e[9] = R, e[10] = b, e[11] =
|
|
1000
|
-
},
|
|
1001
|
-
function
|
|
1008
|
+
] }), e[6] = d, e[7] = T, e[8] = E, e[9] = R, e[10] = b, e[11] = S) : S = e[11], S;
|
|
1009
|
+
}, Yn = (n, e) => n.filter((t) => t.name.replace(/ /g, "_").toLowerCase().includes(e.toLowerCase()));
|
|
1010
|
+
function Qn(n, e = []) {
|
|
1002
1011
|
const t = e.map((r, o) => ({
|
|
1003
1012
|
id: r.resourceId,
|
|
1004
1013
|
key: r.resourceId,
|
|
@@ -1009,12 +1018,12 @@ function Gn(n, e = []) {
|
|
|
1009
1018
|
setRefElement: () => {
|
|
1010
1019
|
}
|
|
1011
1020
|
}));
|
|
1012
|
-
return n == null || n === "" ? t :
|
|
1021
|
+
return n == null || n === "" ? t : Yn(t, n);
|
|
1013
1022
|
}
|
|
1014
|
-
const
|
|
1015
|
-
function
|
|
1016
|
-
let t =
|
|
1017
|
-
if (t === null && (t =
|
|
1023
|
+
const Qe = "\\.\\-<>_:", me = ["#"].join(""), Ze = `[^${me}${Qe}\\s]`, Zn = `(?:[${Qe}]|)`, et = 75, er = new RegExp(`(^|\\s|\\()([${me}]((?:${Ze}${Zn}){0,${et}}))$`), tr = new RegExp(`(^|\\s|\\()([${me}]((?:${Ze}){0,${et}}))$`);
|
|
1024
|
+
function nr(n, e) {
|
|
1025
|
+
let t = er.exec(n);
|
|
1026
|
+
if (t === null && (t = tr.exec(n)), t !== null) {
|
|
1018
1027
|
const r = t[1], o = t[3];
|
|
1019
1028
|
if (o.length >= e)
|
|
1020
1029
|
return {
|
|
@@ -1025,47 +1034,47 @@ function er(n, e) {
|
|
|
1025
1034
|
}
|
|
1026
1035
|
return null;
|
|
1027
1036
|
}
|
|
1028
|
-
const
|
|
1029
|
-
function
|
|
1037
|
+
const rr = 20;
|
|
1038
|
+
function or(n) {
|
|
1030
1039
|
const e = C(9), {
|
|
1031
1040
|
items: t
|
|
1032
1041
|
} = n;
|
|
1033
1042
|
let r;
|
|
1034
1043
|
e[0] !== t ? (r = t === void 0 ? [] : t, e[0] = t, e[1] = r) : r = e[1];
|
|
1035
|
-
const o = r, [i,
|
|
1036
|
-
let
|
|
1037
|
-
e[2] !== a ? (
|
|
1044
|
+
const o = r, [i, l] = St(null), [a] = M(), c = Qn(i, o);
|
|
1045
|
+
let m;
|
|
1046
|
+
e[2] !== a ? (m = (g, x, y) => {
|
|
1038
1047
|
a.update(() => {
|
|
1039
|
-
x && (a.dispatchCommand(
|
|
1048
|
+
x && (a.dispatchCommand(Xe, {
|
|
1040
1049
|
resourceId: g.id,
|
|
1041
1050
|
resourceType: g.group,
|
|
1042
1051
|
name: g.name,
|
|
1043
1052
|
nodeToReplace: x
|
|
1044
|
-
}),
|
|
1053
|
+
}), y());
|
|
1045
1054
|
});
|
|
1046
|
-
}, e[2] = a, e[3] =
|
|
1047
|
-
const
|
|
1048
|
-
let
|
|
1049
|
-
e[4] !== c ? (
|
|
1050
|
-
const d =
|
|
1055
|
+
}, e[2] = a, e[3] = m) : m = e[3];
|
|
1056
|
+
const _ = m, p = sr;
|
|
1057
|
+
let u;
|
|
1058
|
+
e[4] !== c ? (u = c.slice(0, rr), e[4] = c, e[5] = u) : u = e[5];
|
|
1059
|
+
const d = u;
|
|
1051
1060
|
let f;
|
|
1052
|
-
return e[6] !== d || e[7] !==
|
|
1061
|
+
return e[6] !== d || e[7] !== _ ? (f = /* @__PURE__ */ s(Nt, { onQueryChange: l, onSelectOption: _, triggerFn: p, options: d, menuRenderFn: ir }), e[6] = d, e[7] = _, e[8] = f) : f = e[8], f;
|
|
1053
1062
|
}
|
|
1054
|
-
function
|
|
1063
|
+
function ir(n, e) {
|
|
1055
1064
|
const {
|
|
1056
1065
|
options: t,
|
|
1057
1066
|
selectedIndex: r,
|
|
1058
1067
|
selectOptionAndCleanUp: o,
|
|
1059
1068
|
setHighlightedIndex: i
|
|
1060
1069
|
} = e;
|
|
1061
|
-
return n.current ?
|
|
1062
|
-
i(a), o(
|
|
1063
|
-
}, onMouseEnterItem: (
|
|
1064
|
-
i(
|
|
1070
|
+
return n.current ? Ct.createPortal(/* @__PURE__ */ s(Gn, { options: t, selectedIndex: r, onSelectItem: (l, a) => {
|
|
1071
|
+
i(a), o(l);
|
|
1072
|
+
}, onMouseEnterItem: (l) => {
|
|
1073
|
+
i(l);
|
|
1065
1074
|
} }), n.current) : null;
|
|
1066
1075
|
}
|
|
1067
|
-
function
|
|
1068
|
-
return
|
|
1076
|
+
function sr(n) {
|
|
1077
|
+
return nr(n, 0);
|
|
1069
1078
|
}
|
|
1070
1079
|
class X extends ee {
|
|
1071
1080
|
__referenceId;
|
|
@@ -1093,7 +1102,7 @@ class X extends ee {
|
|
|
1093
1102
|
}
|
|
1094
1103
|
createDOM(e) {
|
|
1095
1104
|
const t = document.createElement("span");
|
|
1096
|
-
return
|
|
1105
|
+
return Fe(t, e.theme.reference), t.setAttribute("data-reference-id", this.__referenceId), t.setAttribute("data-name", this.__name), t.textContent = `#${this.__name}`, t;
|
|
1097
1106
|
}
|
|
1098
1107
|
updateDOM(e, t) {
|
|
1099
1108
|
return (e.__name !== this.__name || e.__referenceId !== this.__referenceId) && (t.setAttribute("data-reference-id", this.__referenceId), t.setAttribute("data-name", this.__name), t.textContent = `#${this.__name}`), !1;
|
|
@@ -1119,103 +1128,103 @@ class X extends ee {
|
|
|
1119
1128
|
return `#${this.__name}`;
|
|
1120
1129
|
}
|
|
1121
1130
|
}
|
|
1122
|
-
function
|
|
1131
|
+
function lr(n, e) {
|
|
1123
1132
|
return new X(n, e);
|
|
1124
1133
|
}
|
|
1125
|
-
const
|
|
1126
|
-
const r =
|
|
1134
|
+
const cr = (n, e, t) => {
|
|
1135
|
+
const r = lr(e, t);
|
|
1127
1136
|
if (n) {
|
|
1128
1137
|
n?.replace(r), n.remove(), r.selectEnd();
|
|
1129
1138
|
return;
|
|
1130
1139
|
}
|
|
1131
1140
|
};
|
|
1132
|
-
function
|
|
1141
|
+
function ar(n) {
|
|
1133
1142
|
const e = C(4), {
|
|
1134
1143
|
onAddReference: t
|
|
1135
1144
|
} = n, [r] = M();
|
|
1136
1145
|
let o, i;
|
|
1137
|
-
return e[0] !== r || e[1] !== t ? (o = () =>
|
|
1146
|
+
return e[0] !== r || e[1] !== t ? (o = () => ue(r.registerCommand(Xe, (l) => {
|
|
1138
1147
|
const {
|
|
1139
1148
|
resourceId: a,
|
|
1140
1149
|
resourceType: c,
|
|
1141
|
-
name:
|
|
1142
|
-
nodeToReplace:
|
|
1143
|
-
} =
|
|
1150
|
+
name: m,
|
|
1151
|
+
nodeToReplace: _
|
|
1152
|
+
} = l;
|
|
1144
1153
|
return r.update(() => {
|
|
1145
|
-
|
|
1154
|
+
cr(_, a, m);
|
|
1146
1155
|
}), t?.(a, c), !0;
|
|
1147
|
-
},
|
|
1156
|
+
}, we)), i = [r, t], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), j(o, i), null;
|
|
1148
1157
|
}
|
|
1149
|
-
const
|
|
1150
|
-
...
|
|
1158
|
+
const dr = {
|
|
1159
|
+
...fe,
|
|
1151
1160
|
// Override paragraph class to remove margins specifically for prompt input
|
|
1152
1161
|
paragraph: "rich-text__p rich-text__p--no-margin"
|
|
1153
|
-
},
|
|
1162
|
+
}, ur = [Y, ht, X], fr = (n, e) => {
|
|
1154
1163
|
const t = C(39), {
|
|
1155
1164
|
defaultState: r,
|
|
1156
1165
|
debug: o,
|
|
1157
1166
|
isEditable: i,
|
|
1158
|
-
placeholder:
|
|
1167
|
+
placeholder: l
|
|
1159
1168
|
} = n, a = o === void 0 ? !1 : o, c = i === void 0 ? !0 : i, {
|
|
1160
|
-
onChange:
|
|
1161
|
-
onError:
|
|
1162
|
-
onSubmit:
|
|
1163
|
-
references:
|
|
1169
|
+
onChange: m,
|
|
1170
|
+
onError: _,
|
|
1171
|
+
onSubmit: p,
|
|
1172
|
+
references: u,
|
|
1164
1173
|
onAddReference: d
|
|
1165
|
-
} = n, f =
|
|
1174
|
+
} = n, f = _ === void 0 ? mr : _;
|
|
1166
1175
|
let g;
|
|
1167
|
-
t[0] !==
|
|
1176
|
+
t[0] !== u ? (g = u === void 0 ? [] : u, t[0] = u, t[1] = g) : g = t[1];
|
|
1168
1177
|
const x = g;
|
|
1169
|
-
let
|
|
1170
|
-
t[2] !== r || t[3] !== c || t[4] !== f ? (
|
|
1178
|
+
let y;
|
|
1179
|
+
t[2] !== r || t[3] !== c || t[4] !== f ? (y = {
|
|
1171
1180
|
namespace: "PROMPT_EDITOR",
|
|
1172
|
-
nodes:
|
|
1181
|
+
nodes: ur,
|
|
1173
1182
|
editorState: r,
|
|
1174
1183
|
editable: c,
|
|
1175
1184
|
onError: f,
|
|
1176
|
-
theme:
|
|
1177
|
-
}, t[2] = r, t[3] = c, t[4] = f, t[5] =
|
|
1178
|
-
const N =
|
|
1185
|
+
theme: dr
|
|
1186
|
+
}, t[2] = r, t[3] = c, t[4] = f, t[5] = y) : y = t[5];
|
|
1187
|
+
const N = y;
|
|
1179
1188
|
let b;
|
|
1180
|
-
t[6] !== r ? (b =
|
|
1181
|
-
const T =
|
|
1189
|
+
t[6] !== r ? (b = Ye(r), t[6] = r, t[7] = b) : b = t[7];
|
|
1190
|
+
const T = Tt(b);
|
|
1182
1191
|
let E;
|
|
1183
|
-
t[8] !==
|
|
1192
|
+
t[8] !== l ? (E = l ?? /* @__PURE__ */ L(w, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: [
|
|
1184
1193
|
"Type your query here or press ",
|
|
1185
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ s(lt, { color: "fg.subtle", children: "#" }),
|
|
1186
1195
|
" to add a reference."
|
|
1187
|
-
] }), t[8] =
|
|
1196
|
+
] }), t[8] = l, t[9] = E) : E = t[9];
|
|
1188
1197
|
const R = E;
|
|
1189
|
-
let
|
|
1190
|
-
t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1198
|
+
let S;
|
|
1199
|
+
t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ s(gt, {}), t[10] = S) : S = t[10];
|
|
1191
1200
|
let h;
|
|
1192
|
-
t[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */
|
|
1201
|
+
t[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ s(qe, { fullWidth: !0 }), t[11] = h) : h = t[11];
|
|
1193
1202
|
let O;
|
|
1194
|
-
t[12] !== R ? (O = /* @__PURE__ */
|
|
1203
|
+
t[12] !== R ? (O = /* @__PURE__ */ s(Ae, { contentEditable: h, placeholder: R, ErrorBoundary: Me }), t[12] = R, t[13] = O) : O = t[13];
|
|
1195
1204
|
let $;
|
|
1196
|
-
t[14] !==
|
|
1197
|
-
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1205
|
+
t[14] !== m ? ($ = /* @__PURE__ */ s(De, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (_e) => {
|
|
1206
|
+
_e.read(() => {
|
|
1207
|
+
const nt = Pe(), ie = jn(nt);
|
|
1208
|
+
ie !== T.current && (T.current = ie, m?.(ie, _e.toJSON()));
|
|
1200
1209
|
});
|
|
1201
|
-
} }), t[14] =
|
|
1210
|
+
} }), t[14] = m, t[15] = $) : $ = t[15];
|
|
1202
1211
|
let I;
|
|
1203
|
-
t[16] !== e ? (I = /* @__PURE__ */
|
|
1212
|
+
t[16] !== e ? (I = /* @__PURE__ */ s(Wn, { editorRef: e, previousTextRef: T }), t[16] = e, t[17] = I) : I = t[17];
|
|
1204
1213
|
let v;
|
|
1205
|
-
t[18] !== c ? (v = /* @__PURE__ */
|
|
1214
|
+
t[18] !== c ? (v = /* @__PURE__ */ s(Ke, { isEditable: c }), t[18] = c, t[19] = v) : v = t[19];
|
|
1206
1215
|
let D;
|
|
1207
|
-
t[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */
|
|
1216
|
+
t[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ s(Hn, {}), t[20] = D) : D = t[20];
|
|
1208
1217
|
let A;
|
|
1209
|
-
t[21] !==
|
|
1218
|
+
t[21] !== p ? (A = /* @__PURE__ */ s(Vn, { onSubmit: p }), t[21] = p, t[22] = A) : A = t[22];
|
|
1210
1219
|
let F;
|
|
1211
|
-
t[23] !== x ? (F = /* @__PURE__ */
|
|
1220
|
+
t[23] !== x ? (F = /* @__PURE__ */ s(or, { items: x }), t[23] = x, t[24] = F) : F = t[24];
|
|
1212
1221
|
let q;
|
|
1213
|
-
t[25] !== d ? (q = /* @__PURE__ */
|
|
1214
|
-
let
|
|
1215
|
-
t[27] !== a ? (
|
|
1222
|
+
t[25] !== d ? (q = /* @__PURE__ */ s(ar, { onAddReference: d }), t[25] = d, t[26] = q) : q = t[26];
|
|
1223
|
+
let W;
|
|
1224
|
+
t[27] !== a ? (W = a ? /* @__PURE__ */ s(Ve, {}) : "", t[27] = a, t[28] = W) : W = t[28];
|
|
1216
1225
|
let Q;
|
|
1217
|
-
return t[29] !== N || t[30] !== O || t[31] !== $ || t[32] !== I || t[33] !== v || t[34] !== A || t[35] !== F || t[36] !== q || t[37] !==
|
|
1218
|
-
|
|
1226
|
+
return t[29] !== N || t[30] !== O || t[31] !== $ || t[32] !== I || t[33] !== v || t[34] !== A || t[35] !== F || t[36] !== q || t[37] !== W ? (Q = /* @__PURE__ */ s(ne, { direction: "column", justifyContent: "space-between", width: "100%", position: "relative", children: /* @__PURE__ */ L(Le, { initialConfig: N, children: [
|
|
1227
|
+
S,
|
|
1219
1228
|
O,
|
|
1220
1229
|
$,
|
|
1221
1230
|
I,
|
|
@@ -1224,22 +1233,22 @@ const cr = {
|
|
|
1224
1233
|
A,
|
|
1225
1234
|
F,
|
|
1226
1235
|
q,
|
|
1227
|
-
|
|
1228
|
-
] }) }), t[29] = N, t[30] = O, t[31] = $, t[32] = I, t[33] = v, t[34] = A, t[35] = F, t[36] = q, t[37] =
|
|
1229
|
-
},
|
|
1230
|
-
function
|
|
1236
|
+
W
|
|
1237
|
+
] }) }), t[29] = N, t[30] = O, t[31] = $, t[32] = I, t[33] = v, t[34] = A, t[35] = F, t[36] = q, t[37] = W, t[38] = Q) : Q = t[38], Q;
|
|
1238
|
+
}, Gr = yt(fr);
|
|
1239
|
+
function mr() {
|
|
1231
1240
|
}
|
|
1232
|
-
function
|
|
1241
|
+
function _r(n) {
|
|
1233
1242
|
const e = C(5), {
|
|
1234
1243
|
value: t,
|
|
1235
1244
|
onUpdate: r
|
|
1236
1245
|
} = n, [o] = M();
|
|
1237
|
-
let i,
|
|
1246
|
+
let i, l;
|
|
1238
1247
|
return e[0] !== o || e[1] !== r || e[2] !== t ? (i = () => {
|
|
1239
1248
|
o && o.update(() => r(t), {
|
|
1240
1249
|
tag: "history-merge"
|
|
1241
1250
|
});
|
|
1242
|
-
},
|
|
1251
|
+
}, l = [t, o, r], e[0] = o, e[1] = r, e[2] = t, e[3] = i, e[4] = l) : (i = e[3], l = e[4]), j(i, l), null;
|
|
1243
1252
|
}
|
|
1244
1253
|
class J extends G {
|
|
1245
1254
|
__href;
|
|
@@ -1271,33 +1280,33 @@ class J extends G {
|
|
|
1271
1280
|
};
|
|
1272
1281
|
}
|
|
1273
1282
|
static importJSON(e) {
|
|
1274
|
-
return
|
|
1283
|
+
return tt(e.href, e.label);
|
|
1275
1284
|
}
|
|
1276
1285
|
decorate(e, t) {
|
|
1277
|
-
const r = this.__href, i = r.split("/").pop() || "unknown",
|
|
1278
|
-
return /* @__PURE__ */
|
|
1279
|
-
if (
|
|
1286
|
+
const r = this.__href, i = r.split("/").pop() || "unknown", l = /^https?:\/\//i.test(r), a = /^#?\$PROJECT\//i.test(r);
|
|
1287
|
+
return /* @__PURE__ */ s(P, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ s(He, { fileName: i, onSelect: () => {
|
|
1288
|
+
if (l)
|
|
1280
1289
|
window.open(r, "_blank", "noopener,noreferrer");
|
|
1281
1290
|
else if (a) {
|
|
1282
|
-
const c = r.replace(/^#?\$PROJECT\//i, ""),
|
|
1291
|
+
const c = r.replace(/^#?\$PROJECT\//i, ""), m = new CustomEvent("ui:open-project-file", {
|
|
1283
1292
|
detail: c
|
|
1284
1293
|
});
|
|
1285
|
-
window.dispatchEvent(
|
|
1294
|
+
window.dispatchEvent(m);
|
|
1286
1295
|
} else
|
|
1287
1296
|
window.location.assign(r);
|
|
1288
1297
|
} }) });
|
|
1289
1298
|
}
|
|
1290
1299
|
}
|
|
1291
|
-
function
|
|
1300
|
+
function tt(n, e) {
|
|
1292
1301
|
return new J(n, e);
|
|
1293
1302
|
}
|
|
1294
|
-
function
|
|
1303
|
+
function pr(n) {
|
|
1295
1304
|
return n instanceof J;
|
|
1296
1305
|
}
|
|
1297
|
-
const ye = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/,
|
|
1306
|
+
const ye = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, hr = {
|
|
1298
1307
|
dependencies: [J],
|
|
1299
1308
|
export: (n) => {
|
|
1300
|
-
if (
|
|
1309
|
+
if (pr(n)) {
|
|
1301
1310
|
const e = n.__href, t = n.__label ?? e;
|
|
1302
1311
|
return t ? `{{link('${t}')}}` : `{{link('${e}')}}`;
|
|
1303
1312
|
}
|
|
@@ -1307,91 +1316,91 @@ const ye = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, pr = {
|
|
|
1307
1316
|
importRegExp: ye,
|
|
1308
1317
|
replace: (n, e) => {
|
|
1309
1318
|
const t = e[2], o = /^(https?:\/\/|\/)/i.test(t) ? t : `#${t}`, i = t;
|
|
1310
|
-
n.replace(
|
|
1319
|
+
n.replace(tt(o, i));
|
|
1311
1320
|
},
|
|
1312
1321
|
type: "text-match"
|
|
1313
|
-
},
|
|
1314
|
-
function
|
|
1322
|
+
}, ae = [...Ce, ...We, Ue, Je, hr];
|
|
1323
|
+
function Yr(n) {
|
|
1315
1324
|
const e = C(32), {
|
|
1316
1325
|
debug: t,
|
|
1317
1326
|
defaultState: r,
|
|
1318
1327
|
fullWidth: o,
|
|
1319
1328
|
isEditable: i,
|
|
1320
|
-
onChange:
|
|
1321
|
-
} = n, a = t === void 0 ? !1 : t, c = r === void 0 ? "" : r,
|
|
1322
|
-
let
|
|
1323
|
-
e[0] !== c ? (
|
|
1329
|
+
onChange: l
|
|
1330
|
+
} = n, a = t === void 0 ? !1 : t, c = r === void 0 ? "" : r, m = o === void 0 ? !1 : o, _ = i === void 0 ? !1 : i;
|
|
1331
|
+
let p;
|
|
1332
|
+
e[0] !== c ? (p = pn(c), e[0] = c, e[1] = p) : p = e[1];
|
|
1324
1333
|
const {
|
|
1325
|
-
frontmatter:
|
|
1334
|
+
frontmatter: u,
|
|
1326
1335
|
body: d
|
|
1327
|
-
} =
|
|
1336
|
+
} = p, f = _ && !!l;
|
|
1328
1337
|
let g;
|
|
1329
|
-
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = [
|
|
1338
|
+
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = [ke, Te, U, $e, Re, Ne, de, K, B, z, J], e[2] = g) : g = e[2];
|
|
1330
1339
|
let x;
|
|
1331
|
-
e[3] !== d ? (x = () =>
|
|
1332
|
-
let
|
|
1333
|
-
e[5] !==
|
|
1340
|
+
e[3] !== d ? (x = () => Oe(d, ae, void 0, !1), e[3] = d, e[4] = x) : x = e[4];
|
|
1341
|
+
let y;
|
|
1342
|
+
e[5] !== _ || e[6] !== x ? (y = {
|
|
1334
1343
|
namespace: "RICH_MESSAGE",
|
|
1335
1344
|
nodes: g,
|
|
1336
1345
|
editorState: x,
|
|
1337
|
-
onError:
|
|
1338
|
-
editable:
|
|
1339
|
-
theme:
|
|
1340
|
-
}, e[5] =
|
|
1341
|
-
const N =
|
|
1346
|
+
onError: xr,
|
|
1347
|
+
editable: _,
|
|
1348
|
+
theme: fe
|
|
1349
|
+
}, e[5] = _, e[6] = x, e[7] = y) : y = e[7];
|
|
1350
|
+
const N = y;
|
|
1342
1351
|
let b;
|
|
1343
|
-
e[8] !== d ? (b = /* @__PURE__ */
|
|
1344
|
-
let T, E, R,
|
|
1345
|
-
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */
|
|
1352
|
+
e[8] !== d ? (b = /* @__PURE__ */ s(_r, { value: d, onUpdate: gr }), e[8] = d, e[9] = b) : b = e[9];
|
|
1353
|
+
let T, E, R, S, h;
|
|
1354
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ s(kt, {}), T = /* @__PURE__ */ s($t, {}), E = /* @__PURE__ */ s(Ot, {}), R = /* @__PURE__ */ s(fn, {}), S = /* @__PURE__ */ s(sn, {}), e[10] = T, e[11] = E, e[12] = R, e[13] = S, e[14] = h) : (T = e[10], E = e[11], R = e[12], S = e[13], h = e[14]);
|
|
1346
1355
|
let O;
|
|
1347
|
-
e[15] !==
|
|
1356
|
+
e[15] !== m ? (O = /* @__PURE__ */ s(Ae, { contentEditable: /* @__PURE__ */ s(qe, { fullWidth: m, isRichMessage: !0 }), ErrorBoundary: Me }), e[15] = m, e[16] = O) : O = e[16];
|
|
1348
1357
|
let $;
|
|
1349
|
-
e[17] !==
|
|
1358
|
+
e[17] !== u || e[18] !== l || e[19] !== f ? ($ = f ? /* @__PURE__ */ s(De, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (A) => {
|
|
1350
1359
|
A.read(() => {
|
|
1351
|
-
const F =
|
|
1352
|
-
|
|
1360
|
+
const F = Pe(), q = rt(ae, F);
|
|
1361
|
+
l?.(u + q);
|
|
1353
1362
|
});
|
|
1354
|
-
} }) : null, e[17] =
|
|
1363
|
+
} }) : null, e[17] = u, e[18] = l, e[19] = f, e[20] = $) : $ = e[20];
|
|
1355
1364
|
let I;
|
|
1356
|
-
e[21] !==
|
|
1365
|
+
e[21] !== _ ? (I = /* @__PURE__ */ s(Ke, { isEditable: _ }), e[21] = _, e[22] = I) : I = e[22];
|
|
1357
1366
|
let v;
|
|
1358
|
-
e[23] !== a ? (v = a && /* @__PURE__ */
|
|
1367
|
+
e[23] !== a ? (v = a && /* @__PURE__ */ s(Ve, {}), e[23] = a, e[24] = v) : v = e[24];
|
|
1359
1368
|
let D;
|
|
1360
|
-
return e[25] !== N || e[26] !== O || e[27] !== $ || e[28] !== I || e[29] !== v || e[30] !== b ? (D = /* @__PURE__ */
|
|
1369
|
+
return e[25] !== N || e[26] !== O || e[27] !== $ || e[28] !== I || e[29] !== v || e[30] !== b ? (D = /* @__PURE__ */ s(ne, { className: "rich-text", "data-rich-message": "true", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "hidden", children: /* @__PURE__ */ L(Le, { initialConfig: N, children: [
|
|
1361
1370
|
b,
|
|
1362
1371
|
h,
|
|
1363
1372
|
T,
|
|
1364
1373
|
E,
|
|
1365
1374
|
R,
|
|
1366
|
-
|
|
1375
|
+
S,
|
|
1367
1376
|
O,
|
|
1368
1377
|
$,
|
|
1369
1378
|
I,
|
|
1370
1379
|
v
|
|
1371
1380
|
] }) }), e[25] = N, e[26] = O, e[27] = $, e[28] = I, e[29] = v, e[30] = b, e[31] = D) : D = e[31], D;
|
|
1372
1381
|
}
|
|
1373
|
-
function
|
|
1374
|
-
|
|
1382
|
+
function gr(n) {
|
|
1383
|
+
Oe(n, ae, void 0, !1);
|
|
1375
1384
|
}
|
|
1376
|
-
function
|
|
1385
|
+
function xr(n) {
|
|
1377
1386
|
return console.error(n);
|
|
1378
1387
|
}
|
|
1379
1388
|
export {
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1389
|
+
qe as C,
|
|
1390
|
+
en as D,
|
|
1391
|
+
sn as E,
|
|
1392
|
+
fn as I,
|
|
1393
|
+
Gr as P,
|
|
1394
|
+
Yr as R,
|
|
1395
|
+
Ke as T,
|
|
1396
|
+
Kr as a,
|
|
1397
|
+
Vr as b,
|
|
1398
|
+
Ve as c,
|
|
1399
|
+
tn as d,
|
|
1400
|
+
Xr as e,
|
|
1401
|
+
Ye as f,
|
|
1402
|
+
zn as g,
|
|
1403
|
+
He as h,
|
|
1404
|
+
pn as s
|
|
1396
1405
|
};
|
|
1397
|
-
//# sourceMappingURL=rich-message-
|
|
1406
|
+
//# sourceMappingURL=rich-message-ZT2CEiwt.js.map
|