@pstdio/ui 0.5.2 → 0.6.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-DDCxR-Gs.js → MermaidComponent-D7Baqkwx.js} +2 -2
- package/dist/{MermaidComponent-DDCxR-Gs.js.map → MermaidComponent-D7Baqkwx.js.map} +1 -1
- package/dist/chat-ui.js +11 -9
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/activity/activity-avatar.d.ts +9 -0
- package/dist/components/activity/activity-comment.d.ts +19 -0
- package/dist/components/activity/activity-composer.d.ts +18 -0
- package/dist/components/activity/activity-event.d.ts +12 -0
- package/dist/components/activity/activity-root.d.ts +15 -0
- package/dist/components/activity/activity-timeline.d.ts +6 -0
- package/dist/components/activity/activity.types.d.ts +5 -0
- package/dist/components/activity/index.d.ts +25 -0
- package/dist/components/chat-ui/components/ai-conversation.d.ts +4 -4
- package/dist/components/rich-text/shared/editor-config.d.ts +1 -0
- package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/floating-toolbar-buttons.d.ts +16 -0
- package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/commands.d.ts +2 -0
- package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/index.d.ts +3 -0
- package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/link-editor-content.d.ts +18 -0
- package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/link-edit-state.d.ts +1 -0
- package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/selection-link-url.d.ts +2 -0
- package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/setFloatingElemPos.d.ts +1 -1
- package/dist/components/rich-text/shared/transformers/markdown-transformers-test-utils.d.ts +3 -0
- package/dist/components/rich-text/shared/transformers/markdown-transformers.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2047 -1786
- package/dist/index.js.map +1 -1
- package/dist/{rich-message-DeJwzVeV.js → rich-message-33DPxuWJ.js} +502 -464
- package/dist/rich-message-33DPxuWJ.js.map +1 -0
- package/dist/rich-text.js +738 -414
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/recipes/alert.d.ts +1 -1
- package/dist/theme/recipes/dialog.d.ts +1 -1
- package/dist/theme/recipes/drawer.d.ts +1 -1
- package/dist/theme/recipes/menu.d.ts +1 -1
- package/dist/theme/recipes/popover.d.ts +1 -1
- package/dist/theme/tokens/borders.d.ts +6 -24
- package/dist/theme/tokens/colors.d.ts +168 -168
- package/dist/theme/tokens/shadows.d.ts +5 -5
- package/dist/{theme-Dq4r3aRE.js → theme-0SQvHr1t.js} +140 -158
- package/dist/theme-0SQvHr1t.js.map +1 -0
- package/dist/theme.js +1 -1
- package/package.json +1 -1
- package/dist/rich-message-DeJwzVeV.js.map +0 -1
- package/dist/theme-Dq4r3aRE.js.map +0 -1
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ListNode as ke, ListItemNode as $e } from "@lexical/list";
|
|
4
|
-
import { CHECK_LIST as ht, TRANSFORMERS as ve, $convertFromMarkdownString as we, $convertToMarkdownString as pt } from "@lexical/markdown";
|
|
5
|
-
import { QuoteNode as Pe, HeadingNode as Le } from "@lexical/rich-text";
|
|
6
|
-
import { jsx as l, jsxs as F, Fragment as Ee } from "react/jsx-runtime";
|
|
7
|
-
import { chakra as se, Box as w, Text as P, Spacer as _t, IconButton as gt, Table as B, Textarea as Et, Tooltip as ee, Flex as fe, Kbd as xt } from "@chakra-ui/react";
|
|
8
|
-
import { DecoratorNode as Y, $applyNodeReplacement as bt, ElementNode as Me, TextNode as te, $createTextNode as he, $nodesOfType as St, createCommand as I, isHTMLElement as yt, $createParagraphNode as le, COMMAND_PRIORITY_LOW as Ae, $getSelection as Tt, $isRangeSelection as Rt, $isElementNode as Nt, KEY_DOWN_COMMAND as Ct, COMMAND_PRIORITY_HIGH as It, $getRoot as De } from "lexical";
|
|
1
|
+
import { DecoratorNode as Z, $applyNodeReplacement as ut, ElementNode as $e, TextNode as re, $createTextNode as X, $nodesOfType as mt, createCommand as I, isHTMLElement as ft, $createParagraphNode as ce, COMMAND_PRIORITY_LOW as Oe, $getSelection as pt, $isRangeSelection as ht, $isElementNode as _t, KEY_DOWN_COMMAND as gt, COMMAND_PRIORITY_HIGH as Et, $getRoot as Le } from "lexical";
|
|
2
|
+
import { jsx as l, jsxs as F, Fragment as be } from "react/jsx-runtime";
|
|
9
3
|
import { c as C } from "react/compiler-runtime";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
4
|
+
import { chakra as ae, Box as v, Text as w, Spacer as xt, IconButton as bt, Table as z, Textarea as Tt, Tooltip as ne, Flex as fe, Kbd as St } from "@chakra-ui/react";
|
|
5
|
+
import { MarkNode as yt } from "@lexical/mark";
|
|
6
|
+
import { LexicalComposer as ve } from "@lexical/react/LexicalComposer";
|
|
7
|
+
import { LexicalErrorBoundary as we } from "@lexical/react/LexicalErrorBoundary";
|
|
8
|
+
import { HistoryPlugin as Rt } from "@lexical/react/LexicalHistoryPlugin";
|
|
9
|
+
import { OnChangePlugin as Pe } from "@lexical/react/LexicalOnChangePlugin";
|
|
10
|
+
import { RichTextPlugin as Me } from "@lexical/react/LexicalRichTextPlugin";
|
|
11
|
+
import * as Nt from "react";
|
|
12
|
+
import { Suspense as Ae, lazy as Ct, useEffect as B, useImperativeHandle as It, useState as kt, forwardRef as $t, useRef as Ot } from "react";
|
|
18
13
|
import { useLexicalComposerContext as H } from "@lexical/react/LexicalComposerContext";
|
|
19
|
-
import { $setBlocksType as
|
|
20
|
-
import { addClassNamesToElement as
|
|
21
|
-
import { LexicalTypeaheadMenuPlugin as
|
|
22
|
-
import * as
|
|
23
|
-
import {
|
|
14
|
+
import { $setBlocksType as Lt } from "@lexical/selection";
|
|
15
|
+
import { addClassNamesToElement as De, mergeRegister as pe } from "@lexical/utils";
|
|
16
|
+
import { LexicalTypeaheadMenuPlugin as vt } from "@lexical/react/LexicalTypeaheadMenuPlugin";
|
|
17
|
+
import * as wt from "react-dom";
|
|
18
|
+
import { CodeNode as he, CodeHighlightNode as Fe, registerCodeHighlighting as Pt } from "@lexical/code";
|
|
19
|
+
import { LinkNode as _e, AutoLinkNode as ge, $createLinkNode as Mt, $isLinkNode as At, $isAutoLinkNode as He, $createAutoLinkNode as Dt } from "@lexical/link";
|
|
20
|
+
import { ListNode as Be, ListItemNode as Ue } from "@lexical/list";
|
|
21
|
+
import { CHECK_LIST as Ft, TRANSFORMERS as Ht, LINK as Bt, $convertFromMarkdownString as ze, $convertToMarkdownString as Ut } from "@lexical/markdown";
|
|
22
|
+
import { ClickableLinkPlugin as zt } from "@lexical/react/LexicalClickableLinkPlugin";
|
|
24
23
|
import { HorizontalRulePlugin as qt } from "@lexical/react/LexicalHorizontalRulePlugin";
|
|
25
|
-
import { LinkPlugin as
|
|
26
|
-
import { ListPlugin as
|
|
27
|
-
import { TabIndentationPlugin as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import Vt from "
|
|
31
|
-
import {
|
|
32
|
-
import
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
import { LinkPlugin as Wt } from "@lexical/react/LexicalLinkPlugin";
|
|
25
|
+
import { ListPlugin as Jt } from "@lexical/react/LexicalListPlugin";
|
|
26
|
+
import { TabIndentationPlugin as jt } from "@lexical/react/LexicalTabIndentationPlugin";
|
|
27
|
+
import { QuoteNode as qe, HeadingNode as We } from "@lexical/rich-text";
|
|
28
|
+
import { ContentEditable as Kt } from "@lexical/react/LexicalContentEditable";
|
|
29
|
+
import { S as Gt, g as Vt, T as Xt } from "./get-file-type-icon-Bwqf1WXA.js";
|
|
30
|
+
import { X as Yt } from "lucide-react";
|
|
31
|
+
import Qt from "katex";
|
|
32
|
+
import { TreeView as Zt } from "@lexical/react/LexicalTreeView";
|
|
33
|
+
const en = ae(Kt);
|
|
34
|
+
function Je(n) {
|
|
35
35
|
const e = C(11), {
|
|
36
36
|
onRef: t,
|
|
37
37
|
fullWidth: r,
|
|
38
38
|
padding: o,
|
|
39
39
|
isRichMessage: i,
|
|
40
40
|
scrollable: s
|
|
41
|
-
} = n, c = r === void 0 ? !1 : r, a = i === void 0 ? !1 : i,
|
|
42
|
-
let
|
|
43
|
-
e[0] !== u || e[1] !==
|
|
41
|
+
} = n, c = r === void 0 ? !1 : r, a = i === void 0 ? !1 : i, p = s === void 0 ? !0 : s, u = c ? "100%" : "720px", h = c ? "0" : "auto";
|
|
42
|
+
let m;
|
|
43
|
+
e[0] !== u || e[1] !== h ? (m = /* @__PURE__ */ l(en, { "data-testid": "content-editable", height: "fit-content", minH: "100%", width: "100%", maxWidth: u, marginInline: h, textStyle: "paragraph/M/regular", fontSize: "calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale))", position: "relative", outline: "none" }), e[0] = u, e[1] = h, e[2] = m) : m = e[2];
|
|
44
44
|
let d;
|
|
45
|
-
e[3] !== t || e[4] !== o || e[5] !==
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
return
|
|
45
|
+
e[3] !== t || e[4] !== o || e[5] !== m ? (d = /* @__PURE__ */ l(v, { ref: t, width: "100%", minH: "100%", padding: o, children: m }), e[3] = t, e[4] = o, e[5] = m, e[6] = d) : d = e[6];
|
|
46
|
+
const f = d;
|
|
47
|
+
if (!p)
|
|
48
|
+
return f;
|
|
49
49
|
const x = a ? "true" : void 0;
|
|
50
50
|
let g;
|
|
51
51
|
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = {
|
|
@@ -53,9 +53,9 @@ function Ue(n) {
|
|
|
53
53
|
minH: "100%"
|
|
54
54
|
}, e[7] = g) : g = e[7];
|
|
55
55
|
let _;
|
|
56
|
-
return e[8] !==
|
|
56
|
+
return e[8] !== f || e[9] !== x ? (_ = /* @__PURE__ */ l(Gt, { className: "rich-text", "data-rich-message": x, height: "100%", minH: "0", position: "relative", contentProps: g, children: f }), e[8] = f, e[9] = x, e[10] = _) : _ = e[10], _;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const tn = {
|
|
59
59
|
sm: {
|
|
60
60
|
container: {
|
|
61
61
|
height: "20px",
|
|
@@ -78,7 +78,7 @@ const Qt = {
|
|
|
78
78
|
iconSize: 14,
|
|
79
79
|
textStyle: "sm"
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, nn = {
|
|
82
82
|
neutral: {
|
|
83
83
|
color: "color.primary",
|
|
84
84
|
bg: "bg.muted",
|
|
@@ -93,7 +93,7 @@ const Qt = {
|
|
|
93
93
|
bg: "var(--schub-accent-subtle)"
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
},
|
|
96
|
+
}, rn = "md", on = "neutral", je = (n) => {
|
|
97
97
|
const e = C(39);
|
|
98
98
|
let t, r, o, i, s, c, a;
|
|
99
99
|
e[0] !== n ? ({
|
|
@@ -105,50 +105,50 @@ const Qt = {
|
|
|
105
105
|
icon: r,
|
|
106
106
|
...s
|
|
107
107
|
} = n, e[0] = n, e[1] = t, e[2] = r, e[3] = o, e[4] = i, e[5] = s, e[6] = c, e[7] = a) : (t = e[1], r = e[2], o = e[3], i = e[4], s = e[5], c = e[6], a = e[7]);
|
|
108
|
-
const
|
|
109
|
-
let
|
|
110
|
-
e[8] !== t ? (
|
|
111
|
-
const
|
|
108
|
+
const p = c === void 0 ? rn : c, u = a === void 0 ? on : a;
|
|
109
|
+
let h;
|
|
110
|
+
e[8] !== t ? (h = Vt(t), e[8] = t, e[9] = h) : h = e[9];
|
|
111
|
+
const m = h, d = tn[p], f = nn[u], x = i ? "pointer" : "default";
|
|
112
112
|
let g;
|
|
113
|
-
e[10] !== t || e[11] !== i ? (g = (
|
|
114
|
-
|
|
113
|
+
e[10] !== t || e[11] !== i ? (g = (k) => {
|
|
114
|
+
k.stopPropagation(), i?.(t);
|
|
115
115
|
}, e[10] = t, e[11] = i, e[12] = g) : g = e[12];
|
|
116
116
|
let _;
|
|
117
|
-
e[13] !==
|
|
118
|
-
let T;
|
|
119
|
-
e[17] !== _ ? (T = /* @__PURE__ */ l(se.span, { mr: "xs", display: "inline-flex", children: _ }), e[17] = _, e[18] = T) : T = e[18];
|
|
117
|
+
e[13] !== m || e[14] !== r || e[15] !== d.iconSize ? (_ = r ?? /* @__PURE__ */ l(m, { size: d.iconSize }), e[13] = m, e[14] = r, e[15] = d.iconSize, e[16] = _) : _ = e[16];
|
|
120
118
|
let y;
|
|
121
|
-
e[
|
|
119
|
+
e[17] !== _ ? (y = /* @__PURE__ */ l(ae.span, { mr: "xs", display: "inline-flex", children: _ }), e[17] = _, e[18] = y) : y = e[18];
|
|
120
|
+
let S;
|
|
121
|
+
e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = {
|
|
122
122
|
base: "14rem"
|
|
123
|
-
}, e[19] =
|
|
123
|
+
}, e[19] = S) : S = e[19];
|
|
124
124
|
let R;
|
|
125
|
-
e[20] !== t || e[21] !== d.textStyle ? (R = /* @__PURE__ */ l(
|
|
125
|
+
e[20] !== t || e[21] !== d.textStyle ? (R = /* @__PURE__ */ l(w, { maxW: S, textOverflow: "ellipsis", whiteSpace: "nowrap", overflow: "hidden", textStyle: d.textStyle, children: t }), e[20] = t, e[21] = d.textStyle, e[22] = R) : R = e[22];
|
|
126
126
|
let b;
|
|
127
|
-
e[23] !== t || e[24] !== R ? (b = /* @__PURE__ */ l(
|
|
127
|
+
e[23] !== t || e[24] !== R ? (b = /* @__PURE__ */ l(Xt, { content: t, children: R }), e[23] = t, e[24] = R, e[25] = b) : b = e[25];
|
|
128
128
|
let N;
|
|
129
|
-
e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(
|
|
130
|
-
let
|
|
131
|
-
e[27] !== t || e[28] !== o ? (
|
|
129
|
+
e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(xt, {}), e[26] = N) : N = e[26];
|
|
130
|
+
let T;
|
|
131
|
+
e[27] !== t || e[28] !== o ? (T = o && /* @__PURE__ */ l(bt, { "aria-label": "Remove reference", size: "2xs", ml: "xs", variant: "ghost", _hover: {
|
|
132
132
|
bg: "transparent"
|
|
133
|
-
}, onClick: (
|
|
134
|
-
|
|
135
|
-
}, children: /* @__PURE__ */ l(
|
|
133
|
+
}, onClick: (k) => {
|
|
134
|
+
k.stopPropagation(), o?.(t);
|
|
135
|
+
}, children: /* @__PURE__ */ l(Yt, { size: 12 }) }), e[27] = t, e[28] = o, e[29] = T) : T = e[29];
|
|
136
136
|
let E;
|
|
137
|
-
return e[30] !== s || e[31] !== d.container || e[32] !==
|
|
138
|
-
|
|
137
|
+
return e[30] !== s || e[31] !== d.container || e[32] !== T || e[33] !== x || e[34] !== g || e[35] !== y || e[36] !== b || e[37] !== f ? (E = /* @__PURE__ */ F(ae.span, { display: "flex", flexDirection: "row", alignItems: "center", borderRadius: "xs", gap: "2xs", cursor: x, ...f, ...d.container, onClick: g, ...s, children: [
|
|
138
|
+
y,
|
|
139
139
|
b,
|
|
140
140
|
N,
|
|
141
|
-
|
|
142
|
-
] }), e[30] = s, e[31] = d.container, e[32] =
|
|
141
|
+
T
|
|
142
|
+
] }), e[30] = s, e[31] = d.container, e[32] = T, e[33] = x, e[34] = g, e[35] = y, e[36] = b, e[37] = f, e[38] = E) : E = e[38], E;
|
|
143
143
|
};
|
|
144
|
-
let
|
|
144
|
+
let ie = class de extends Z {
|
|
145
145
|
__href;
|
|
146
146
|
__label;
|
|
147
147
|
static getType() {
|
|
148
148
|
return "reference-link";
|
|
149
149
|
}
|
|
150
150
|
static clone(e) {
|
|
151
|
-
return new
|
|
151
|
+
return new de(e.__href, e.__label, e.__key);
|
|
152
152
|
}
|
|
153
153
|
constructor(e, t, r) {
|
|
154
154
|
super(r), this.__href = e, this.__label = t;
|
|
@@ -164,53 +164,53 @@ let re = class ce extends Y {
|
|
|
164
164
|
}
|
|
165
165
|
exportJSON() {
|
|
166
166
|
return {
|
|
167
|
-
type:
|
|
167
|
+
type: de.getType(),
|
|
168
168
|
version: 1,
|
|
169
169
|
href: this.__href,
|
|
170
170
|
label: this.__label
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
static importJSON(e) {
|
|
174
|
-
return
|
|
174
|
+
return Ke(e.href, e.label);
|
|
175
175
|
}
|
|
176
176
|
decorate(e, t) {
|
|
177
177
|
const r = this.__href, i = r.split("/").pop() || "unknown", s = /^https?:\/\//i.test(r), c = /^#?\$PROJECT\//i.test(r);
|
|
178
|
-
return /* @__PURE__ */ l(
|
|
178
|
+
return /* @__PURE__ */ l(v, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ l(je, { fileName: i, onSelect: () => {
|
|
179
179
|
if (s)
|
|
180
180
|
window.open(r, "_blank", "noopener,noreferrer");
|
|
181
181
|
else if (c) {
|
|
182
|
-
const a = r.replace(/^#?\$PROJECT\//i, ""),
|
|
182
|
+
const a = r.replace(/^#?\$PROJECT\//i, ""), p = new CustomEvent("ui:open-project-file", {
|
|
183
183
|
detail: a
|
|
184
184
|
});
|
|
185
|
-
window.dispatchEvent(
|
|
185
|
+
window.dispatchEvent(p);
|
|
186
186
|
} else
|
|
187
187
|
window.location.assign(r);
|
|
188
188
|
} }) });
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
-
function
|
|
192
|
-
return new
|
|
191
|
+
function Ke(n, e) {
|
|
192
|
+
return new ie(n, e);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
return n instanceof
|
|
194
|
+
function sn(n) {
|
|
195
|
+
return n instanceof ie;
|
|
196
196
|
}
|
|
197
|
-
const
|
|
198
|
-
dependencies: [
|
|
197
|
+
const Te = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, ln = {
|
|
198
|
+
dependencies: [ie],
|
|
199
199
|
export: (n) => {
|
|
200
|
-
if (
|
|
200
|
+
if (sn(n)) {
|
|
201
201
|
const e = n.__href, t = n.__label ?? e;
|
|
202
202
|
return t ? `{{link('${t}')}}` : `{{link('${e}')}}`;
|
|
203
203
|
}
|
|
204
204
|
return null;
|
|
205
205
|
},
|
|
206
|
-
regExp:
|
|
207
|
-
importRegExp:
|
|
206
|
+
regExp: Te,
|
|
207
|
+
importRegExp: Te,
|
|
208
208
|
replace: (n, e) => {
|
|
209
209
|
const t = e[2], o = /^(https?:\/\/|\/)/i.test(t) ? t : `#${t}`, i = t;
|
|
210
|
-
n.replace(
|
|
210
|
+
n.replace(Ke(o, i));
|
|
211
211
|
},
|
|
212
212
|
type: "text-match"
|
|
213
|
-
},
|
|
213
|
+
}, Ee = {
|
|
214
214
|
code: "rich-text__code",
|
|
215
215
|
codeHighlight: {
|
|
216
216
|
atrule: "rich-text__tokenAttr",
|
|
@@ -284,26 +284,26 @@ const xe = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, rn = {
|
|
|
284
284
|
row: "rich-text__row",
|
|
285
285
|
content: "rich-text__content"
|
|
286
286
|
}
|
|
287
|
-
},
|
|
287
|
+
}, Y = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", cn = (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), To = (n) => {
|
|
288
288
|
const e = C(6), {
|
|
289
289
|
defaultCode: t,
|
|
290
290
|
isEditable: r,
|
|
291
291
|
showLineNumbers: o,
|
|
292
292
|
disableScroll: i
|
|
293
|
-
} = n, s = t === void 0 ? "" : t, c = r === void 0 ? !1 : r, a = o === void 0 ? !1 : o,
|
|
293
|
+
} = n, s = t === void 0 ? "" : t, c = r === void 0 ? !1 : r, a = o === void 0 ? !1 : o, p = i === void 0 ? !1 : i;
|
|
294
294
|
if (c) {
|
|
295
|
-
let
|
|
296
|
-
return e[0] !== s ? (
|
|
295
|
+
let h;
|
|
296
|
+
return e[0] !== s ? (h = /* @__PURE__ */ l(Tt, { defaultValue: s, fontFamily: "mono", fontSize: Y, resize: "vertical", minHeight: "100%" }), e[0] = s, e[1] = h) : h = e[1], h;
|
|
297
297
|
}
|
|
298
298
|
let u;
|
|
299
|
-
if (e[2] !== s || e[3] !==
|
|
300
|
-
const
|
|
299
|
+
if (e[2] !== s || e[3] !== p || e[4] !== a) {
|
|
300
|
+
const h = a ? s.split(`
|
|
301
301
|
`) : [s];
|
|
302
|
-
u = /* @__PURE__ */ l(
|
|
302
|
+
u = /* @__PURE__ */ l(v, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: Y, lineHeight: "1.5", overflowY: p ? "hidden" : "auto", background: "bg.code", borderRadius: "md", width: "100%", children: a ? /* @__PURE__ */ l(v, { as: "code", display: "grid", gridTemplateColumns: "auto 1fr", columnGap: "sm", children: h.map(dn) }) : /* @__PURE__ */ l(v, { as: "code", children: s }) }), e[2] = s, e[3] = p, e[4] = a, e[5] = u;
|
|
303
303
|
} else
|
|
304
304
|
u = e[5];
|
|
305
305
|
return u;
|
|
306
|
-
},
|
|
306
|
+
}, an = (n) => {
|
|
307
307
|
const e = C(26), {
|
|
308
308
|
data: t,
|
|
309
309
|
fullWidth: r,
|
|
@@ -312,54 +312,54 @@ const xe = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, rn = {
|
|
|
312
312
|
} = n, s = r === void 0 ? !1 : r, c = o === void 0 ? !1 : o;
|
|
313
313
|
let a;
|
|
314
314
|
e[0] !== i ? (a = i === void 0 ? [] : i, e[0] = i, e[1] = a) : a = e[1];
|
|
315
|
-
const
|
|
315
|
+
const p = a;
|
|
316
316
|
if (!t.length) {
|
|
317
317
|
const b = c ? "0" : "1px";
|
|
318
318
|
let N;
|
|
319
|
-
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(
|
|
320
|
-
let
|
|
321
|
-
return e[3] !== b ? (
|
|
319
|
+
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(w, { textStyle: "label/S/regular", fontSize: Y, color: "fg.muted", children: "No data" }), e[2] = N) : N = e[2];
|
|
320
|
+
let T;
|
|
321
|
+
return e[3] !== b ? (T = /* @__PURE__ */ l(v, { padding: "sm", borderWidth: b, borderColor: "border.muted", children: N }), e[3] = b, e[4] = T) : T = e[4], T;
|
|
322
322
|
}
|
|
323
323
|
let u;
|
|
324
|
-
e[5] !==
|
|
325
|
-
const
|
|
326
|
-
let
|
|
327
|
-
e[7] !== t[0] ? (
|
|
324
|
+
e[5] !== p ? (u = new Set(p), e[5] = p, e[6] = u) : u = e[6];
|
|
325
|
+
const h = u;
|
|
326
|
+
let m;
|
|
327
|
+
e[7] !== t[0] ? (m = Object.keys(t[0] ?? {}), e[7] = t[0], e[8] = m) : m = e[8];
|
|
328
328
|
let d;
|
|
329
|
-
e[9] !==
|
|
330
|
-
const
|
|
329
|
+
e[9] !== h || e[10] !== m ? (d = m.filter((b) => !h.has(b)), e[9] = h, e[10] = m, e[11] = d) : d = e[11];
|
|
330
|
+
const f = d, x = s ? "100%" : "fit-content", g = c ? "0" : "1px";
|
|
331
331
|
let _;
|
|
332
|
-
e[12] !==
|
|
333
|
-
let
|
|
334
|
-
if (e[14] !==
|
|
332
|
+
e[12] !== f ? (_ = /* @__PURE__ */ l(z.Header, { children: /* @__PURE__ */ l(z.Row, { background: "bg.muted", children: f.map(un) }) }), e[12] = f, e[13] = _) : _ = e[13];
|
|
333
|
+
let y;
|
|
334
|
+
if (e[14] !== f || e[15] !== t) {
|
|
335
335
|
let b;
|
|
336
|
-
e[17] !==
|
|
336
|
+
e[17] !== f ? (b = (N, T) => /* @__PURE__ */ l(z.Row, { children: f.map((E) => /* @__PURE__ */ l(z.Cell, { paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(w, { textStyle: "paragraph/S/regular", fontSize: Y, children: cn(N[E]) }) }, `${T}-${E}`)) }, `${T}-${f.join("-")}`), e[17] = f, e[18] = b) : b = e[18], y = t.map(b), e[14] = f, e[15] = t, e[16] = y;
|
|
337
337
|
} else
|
|
338
|
-
|
|
339
|
-
let
|
|
340
|
-
e[19] !==
|
|
338
|
+
y = e[16];
|
|
339
|
+
let S;
|
|
340
|
+
e[19] !== y ? (S = /* @__PURE__ */ l(z.Body, { children: y }), e[19] = y, e[20] = S) : S = e[20];
|
|
341
341
|
let R;
|
|
342
|
-
return e[21] !==
|
|
342
|
+
return e[21] !== S || e[22] !== x || e[23] !== g || e[24] !== _ ? (R = /* @__PURE__ */ l(z.ScrollArea, { overflowX: "auto", maxWidth: "100%", children: /* @__PURE__ */ F(z.Root, { size: "sm", width: x, borderWidth: g, borderColor: "border.muted", children: [
|
|
343
343
|
_,
|
|
344
|
-
|
|
345
|
-
] }) }), e[21] =
|
|
344
|
+
S
|
|
345
|
+
] }) }), e[21] = S, e[22] = x, e[23] = g, e[24] = _, e[25] = R) : R = e[25], R;
|
|
346
346
|
};
|
|
347
|
-
function
|
|
348
|
-
return /* @__PURE__ */ F(
|
|
349
|
-
/* @__PURE__ */ l(
|
|
350
|
-
/* @__PURE__ */ l(
|
|
347
|
+
function dn(n, e) {
|
|
348
|
+
return /* @__PURE__ */ F(v, { as: "span", display: "contents", children: [
|
|
349
|
+
/* @__PURE__ */ l(w, { as: "span", color: "fg.muted", textAlign: "right", fontSize: "inherit", children: e + 1 }),
|
|
350
|
+
/* @__PURE__ */ l(w, { as: "span", fontSize: "inherit", children: n.length ? n : " " })
|
|
351
351
|
] }, `${e}-${n}`);
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
return /* @__PURE__ */ l(
|
|
353
|
+
function un(n) {
|
|
354
|
+
return /* @__PURE__ */ l(z.ColumnHeader, { textTransform: "none", paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(w, { textStyle: "label/S/medium", fontSize: Y, children: n }) }, n);
|
|
355
355
|
}
|
|
356
|
-
class
|
|
356
|
+
class W extends Z {
|
|
357
357
|
__data;
|
|
358
358
|
static getType() {
|
|
359
359
|
return "data_table";
|
|
360
360
|
}
|
|
361
361
|
static clone(e) {
|
|
362
|
-
return new
|
|
362
|
+
return new W(e.__data, e.__key);
|
|
363
363
|
}
|
|
364
364
|
constructor(e, t) {
|
|
365
365
|
super(t), this.__data = e;
|
|
@@ -374,7 +374,7 @@ class U extends Y {
|
|
|
374
374
|
return !1;
|
|
375
375
|
}
|
|
376
376
|
decorate() {
|
|
377
|
-
return /* @__PURE__ */ l(
|
|
377
|
+
return /* @__PURE__ */ l(an, { fullWidth: !0, isReadOnly: !0, data: this.__data });
|
|
378
378
|
}
|
|
379
379
|
exportJSON() {
|
|
380
380
|
return {
|
|
@@ -384,7 +384,7 @@ class U extends Y {
|
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
386
|
static importJSON(e) {
|
|
387
|
-
return new
|
|
387
|
+
return new W(e.data);
|
|
388
388
|
}
|
|
389
389
|
getTextContent() {
|
|
390
390
|
if (!this.__data.length) return "";
|
|
@@ -393,34 +393,34 @@ class U extends Y {
|
|
|
393
393
|
`);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
function be(n) {
|
|
397
|
-
return new U(n);
|
|
398
|
-
}
|
|
399
396
|
function Se(n) {
|
|
400
|
-
return n
|
|
397
|
+
return new W(n);
|
|
401
398
|
}
|
|
402
|
-
const an = $t.lazy(() => import("./EquationComponent-DeDYHvqY.js"));
|
|
403
399
|
function ye(n) {
|
|
400
|
+
return n instanceof W;
|
|
401
|
+
}
|
|
402
|
+
const mn = Nt.lazy(() => import("./EquationComponent-DeDYHvqY.js"));
|
|
403
|
+
function Re(n) {
|
|
404
404
|
let e = n.getAttribute("data-lexical-equation");
|
|
405
405
|
const t = n.getAttribute("data-lexical-inline") === "true";
|
|
406
406
|
return e = atob(e || ""), e ? {
|
|
407
|
-
node:
|
|
407
|
+
node: se(e, t)
|
|
408
408
|
} : null;
|
|
409
409
|
}
|
|
410
|
-
class
|
|
410
|
+
class q extends Z {
|
|
411
411
|
__equation;
|
|
412
412
|
__inline;
|
|
413
413
|
static getType() {
|
|
414
414
|
return "equation";
|
|
415
415
|
}
|
|
416
416
|
static clone(e) {
|
|
417
|
-
return new
|
|
417
|
+
return new q(e.__equation, e.__inline, e.__key);
|
|
418
418
|
}
|
|
419
419
|
constructor(e, t, r) {
|
|
420
420
|
super(r), this.__equation = e, this.__inline = t ?? !1;
|
|
421
421
|
}
|
|
422
422
|
static importJSON(e) {
|
|
423
|
-
return
|
|
423
|
+
return se(e.equation, e.inline);
|
|
424
424
|
}
|
|
425
425
|
exportJSON() {
|
|
426
426
|
return {
|
|
@@ -436,7 +436,7 @@ class W extends Y {
|
|
|
436
436
|
}
|
|
437
437
|
exportDOM() {
|
|
438
438
|
const e = document.createElement(this.__inline ? "span" : "div"), t = btoa(this.__equation);
|
|
439
|
-
return e.setAttribute("data-lexical-equation", t), e.setAttribute("data-lexical-inline", `${this.__inline}`),
|
|
439
|
+
return e.setAttribute("data-lexical-equation", t), e.setAttribute("data-lexical-inline", `${this.__inline}`), Qt.render(this.__equation, e, {
|
|
440
440
|
displayMode: !this.__inline,
|
|
441
441
|
// true === block display //
|
|
442
442
|
errorColor: "#cc0000",
|
|
@@ -451,11 +451,11 @@ class W extends Y {
|
|
|
451
451
|
static importDOM() {
|
|
452
452
|
return {
|
|
453
453
|
div: (e) => e.hasAttribute("data-lexical-equation") ? {
|
|
454
|
-
conversion:
|
|
454
|
+
conversion: Re,
|
|
455
455
|
priority: 2
|
|
456
456
|
} : null,
|
|
457
457
|
span: (e) => e.hasAttribute("data-lexical-equation") ? {
|
|
458
|
-
conversion:
|
|
458
|
+
conversion: Re,
|
|
459
459
|
priority: 1
|
|
460
460
|
} : null
|
|
461
461
|
};
|
|
@@ -477,38 +477,38 @@ class W extends Y {
|
|
|
477
477
|
return this.__inline;
|
|
478
478
|
}
|
|
479
479
|
decorate() {
|
|
480
|
-
return /* @__PURE__ */ l(
|
|
480
|
+
return /* @__PURE__ */ l(Ae, { fallback: null, children: /* @__PURE__ */ l(mn, { equation: this.__equation, inline: this.__inline }) });
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
const t = new
|
|
485
|
-
return
|
|
483
|
+
function se(n = "", e = !1) {
|
|
484
|
+
const t = new q(n, e);
|
|
485
|
+
return ut(t);
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
return n instanceof
|
|
487
|
+
function Ge(n) {
|
|
488
|
+
return n instanceof q;
|
|
489
489
|
}
|
|
490
|
-
const
|
|
491
|
-
dependencies: [
|
|
492
|
-
export: (n) =>
|
|
490
|
+
const fn = {
|
|
491
|
+
dependencies: [q],
|
|
492
|
+
export: (n) => Ge(n) && n.isInline() ? `\\( ${n.getEquation().trim()} \\)` : null,
|
|
493
493
|
importRegExp: /\\\((.*?)\\\)/,
|
|
494
494
|
regExp: /\\\((.*?)\\\)/,
|
|
495
495
|
replace: (n, e) => {
|
|
496
|
-
const t =
|
|
496
|
+
const t = se(e[1].trim(), !0);
|
|
497
497
|
n.replace(t);
|
|
498
498
|
},
|
|
499
499
|
type: "text-match"
|
|
500
|
-
},
|
|
501
|
-
dependencies: [
|
|
500
|
+
}, pn = {
|
|
501
|
+
dependencies: [q],
|
|
502
502
|
regExpStart: /\\\[/,
|
|
503
503
|
regExpEnd: /\\]/,
|
|
504
|
-
export: (n) =>
|
|
505
|
-
replace: (n, e, t, r, o) => o ? (n.append(
|
|
504
|
+
export: (n) => Ge(n) && !n.isInline() ? `\\[ ${n.getEquation().trim()} \\]` : null,
|
|
505
|
+
replace: (n, e, t, r, o) => o ? (n.append(se(o.join(" "), !1)), !0) : !1,
|
|
506
506
|
type: "multiline-element"
|
|
507
507
|
};
|
|
508
|
-
function
|
|
508
|
+
function hn() {
|
|
509
509
|
return null;
|
|
510
510
|
}
|
|
511
|
-
class K extends
|
|
511
|
+
class K extends $e {
|
|
512
512
|
static getType() {
|
|
513
513
|
return "hr";
|
|
514
514
|
}
|
|
@@ -516,7 +516,7 @@ class K extends Me {
|
|
|
516
516
|
return new K(e?.__key);
|
|
517
517
|
}
|
|
518
518
|
static importJSON(e) {
|
|
519
|
-
return
|
|
519
|
+
return Ve();
|
|
520
520
|
}
|
|
521
521
|
exportJSON() {
|
|
522
522
|
return {
|
|
@@ -534,14 +534,14 @@ class K extends Me {
|
|
|
534
534
|
return null;
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function Ve() {
|
|
538
538
|
return new K();
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function _n(n) {
|
|
541
541
|
return n instanceof K;
|
|
542
542
|
}
|
|
543
|
-
const
|
|
544
|
-
class J extends
|
|
543
|
+
const gn = Ct(() => import("./MermaidComponent-D7Baqkwx.js"));
|
|
544
|
+
class J extends Z {
|
|
545
545
|
__code;
|
|
546
546
|
static getType() {
|
|
547
547
|
return "mermaid";
|
|
@@ -581,25 +581,25 @@ ${this.__code}
|
|
|
581
581
|
t.__code = e;
|
|
582
582
|
}
|
|
583
583
|
decorate() {
|
|
584
|
-
return /* @__PURE__ */ l(
|
|
584
|
+
return /* @__PURE__ */ l(Ae, { fallback: null, children: /* @__PURE__ */ l(gn, { code: this.__code, nodeKey: this.__key }) });
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function So(n) {
|
|
588
588
|
return n instanceof J;
|
|
589
589
|
}
|
|
590
|
-
const
|
|
590
|
+
const En = {
|
|
591
591
|
dependencies: [K],
|
|
592
|
-
export: (n) =>
|
|
592
|
+
export: (n) => _n(n) ? "***" : null,
|
|
593
593
|
regExp: /^(---|\*\*\*|___)\s?$/,
|
|
594
594
|
replace: (n) => {
|
|
595
|
-
const e =
|
|
595
|
+
const e = Ve();
|
|
596
596
|
n.replace(e);
|
|
597
597
|
},
|
|
598
598
|
type: "element"
|
|
599
|
-
},
|
|
599
|
+
}, xn = {
|
|
600
600
|
dependencies: [],
|
|
601
601
|
export: (n, e) => {
|
|
602
|
-
if (
|
|
602
|
+
if (ye(n)) {
|
|
603
603
|
const t = n.getData();
|
|
604
604
|
if (!t.length) return "";
|
|
605
605
|
const r = Object.keys(t[0]), o = r.join(" | "), i = r.map(() => "---").join(" | "), s = t.map((c) => r.map((a) => String(c[a] || "")).join(" | "));
|
|
@@ -616,28 +616,28 @@ const fn = {
|
|
|
616
616
|
return;
|
|
617
617
|
}
|
|
618
618
|
const s = t[0].split("|").slice(1, -1).map((c) => c.trim());
|
|
619
|
-
if (o?.getType() === "data_table" &&
|
|
620
|
-
const c = o.getData(), a = {},
|
|
621
|
-
s.forEach((d,
|
|
622
|
-
const x = u[
|
|
619
|
+
if (o?.getType() === "data_table" && ye(o)) {
|
|
620
|
+
const c = o.getData(), a = {}, p = c.length === 1 && Object.values(c[0]).every((d) => d === ""), u = c.length > 0 ? Object.keys(c[0]) : s.map((d, f) => `col_${f}`);
|
|
621
|
+
s.forEach((d, f) => {
|
|
622
|
+
const x = u[f] || `col_${f}`;
|
|
623
623
|
a[x] = d;
|
|
624
624
|
});
|
|
625
|
-
const
|
|
626
|
-
o.replace(
|
|
625
|
+
const h = p ? [a] : [...c, a], m = Se(h);
|
|
626
|
+
o.replace(m), n.remove();
|
|
627
627
|
} else {
|
|
628
628
|
const c = {};
|
|
629
|
-
s.forEach((
|
|
630
|
-
c[
|
|
629
|
+
s.forEach((p, u) => {
|
|
630
|
+
c[p || `col_${u}`] = "";
|
|
631
631
|
});
|
|
632
|
-
const a =
|
|
632
|
+
const a = Se([c]);
|
|
633
633
|
n.replace(a);
|
|
634
634
|
}
|
|
635
635
|
},
|
|
636
636
|
type: "element"
|
|
637
|
-
},
|
|
638
|
-
dependencies: [
|
|
637
|
+
}, bn = {
|
|
638
|
+
dependencies: [re],
|
|
639
639
|
export: (n, e) => {
|
|
640
|
-
if (n instanceof
|
|
640
|
+
if (n instanceof re) {
|
|
641
641
|
let t = n.getTextContent();
|
|
642
642
|
if (n.hasFormat("bold"))
|
|
643
643
|
t = `**${t}**`;
|
|
@@ -654,55 +654,92 @@ const fn = {
|
|
|
654
654
|
regExp: /<ins>(.*)<\/ins>/,
|
|
655
655
|
importRegExp: /<ins>(.*)<\/ins>/,
|
|
656
656
|
replace: (n, e) => {
|
|
657
|
-
const t =
|
|
657
|
+
const t = X(e[1]);
|
|
658
658
|
t.toggleFormat("underline"), n.replace(t);
|
|
659
659
|
},
|
|
660
660
|
type: "text-match"
|
|
661
|
-
},
|
|
662
|
-
dependencies: [
|
|
661
|
+
}, Tn = {
|
|
662
|
+
dependencies: [re],
|
|
663
663
|
export: (n, e) => null,
|
|
664
664
|
regExp: /<u>(.*)<\/u>/,
|
|
665
665
|
importRegExp: /<u>(.*)<\/u>/,
|
|
666
666
|
replace: (n, e) => {
|
|
667
|
-
const t =
|
|
667
|
+
const t = X(e[1]);
|
|
668
668
|
t.toggleFormat("underline"), n.replace(t);
|
|
669
669
|
},
|
|
670
670
|
type: "text-match"
|
|
671
|
-
},
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
671
|
+
}, Ne = /https?:\/\/[^\s<>"']*[^\s<>"'.,:;"')\]}]/, V = (n) => n.replace(/\\([*_`~\\])/g, "$1"), Sn = (n) => n.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), yn = (n) => n?.replace(/\\(["\\])/g, "$1"), Xe = (n, e, t) => {
|
|
672
|
+
if (n !== e)
|
|
673
|
+
return t;
|
|
674
|
+
const r = e.replace(/([*_`~\\])/g, "\\$1");
|
|
675
|
+
return t.replace(r, e);
|
|
676
|
+
}, Rn = {
|
|
677
|
+
dependencies: [_e],
|
|
678
|
+
export: (n, e) => {
|
|
679
|
+
if (!At(n) || He(n))
|
|
680
|
+
return null;
|
|
681
|
+
const t = n.getTitle(), r = V(n.getURL()), o = Xe(n.getTextContent(), r, e(n));
|
|
682
|
+
return t != null ? `[${o}](${r} "${Sn(t)}")` : `[${o}](${r})`;
|
|
683
|
+
},
|
|
684
|
+
importRegExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,
|
|
685
|
+
regExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,
|
|
686
|
+
replace: (n, e) => {
|
|
687
|
+
const [, t, r, o] = e, i = V(r), s = Mt(i, {
|
|
688
|
+
title: yn(o)
|
|
689
|
+
}), c = t.split("[").length - 1, a = t.split("]").length - 1;
|
|
690
|
+
let p = t, u = "";
|
|
691
|
+
if (c < a)
|
|
692
|
+
return;
|
|
693
|
+
if (c > a) {
|
|
694
|
+
const d = t.split("[");
|
|
695
|
+
u = `[${d[0]}`, p = d.slice(1).join("[");
|
|
696
|
+
}
|
|
697
|
+
const h = V(p), m = X(h === i ? i : h);
|
|
698
|
+
return m.setFormat(n.getFormat()), s.append(m), n.replace(s), u && s.insertBefore(X(u)), m;
|
|
699
|
+
},
|
|
700
|
+
trigger: ")",
|
|
701
|
+
type: "text-match"
|
|
702
|
+
}, Nn = {
|
|
703
|
+
dependencies: [ge],
|
|
704
|
+
export: (n, e) => {
|
|
705
|
+
if (!He(n))
|
|
706
|
+
return null;
|
|
707
|
+
const t = V(n.getURL());
|
|
708
|
+
return Xe(n.getTextContent(), t, e(n));
|
|
709
|
+
},
|
|
710
|
+
regExp: Ne,
|
|
711
|
+
importRegExp: Ne,
|
|
676
712
|
replace: (n, e) => {
|
|
677
|
-
const t = e[0], r =
|
|
713
|
+
const t = V(e[0]), r = Dt(t), o = X(t);
|
|
678
714
|
o.setFormat(n.getFormat()), r.append(o), n.replace(r);
|
|
679
715
|
},
|
|
680
716
|
type: "text-match"
|
|
681
|
-
},
|
|
682
|
-
function
|
|
717
|
+
}, Cn = [xn, En, bn, Tn, Rn, Nn], yo = [qe, _e, ge, W, We, Be, Ue, he, Fe, J, q, K, ie], Ye = [Ft, ...Ht.filter((n) => n !== Bt), ...Cn, fn, pn], Ro = [...Ye, ln], No = Ee;
|
|
718
|
+
function In(n) {
|
|
683
719
|
return n.trim().toLowerCase() === "mermaid";
|
|
684
720
|
}
|
|
685
|
-
function
|
|
721
|
+
function kn(n) {
|
|
686
722
|
const e = n.getLanguage() ?? "plaintext";
|
|
687
|
-
return
|
|
723
|
+
return In(e) ? (n.replace(new J(n.getTextContent())), !0) : !1;
|
|
688
724
|
}
|
|
689
|
-
function
|
|
725
|
+
function $n() {
|
|
690
726
|
const n = C(3), [e] = H();
|
|
691
727
|
let t, r;
|
|
692
728
|
return n[0] !== e ? (t = () => {
|
|
693
|
-
e.update(
|
|
694
|
-
}, r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]),
|
|
729
|
+
e.update(On);
|
|
730
|
+
}, r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r), null;
|
|
695
731
|
}
|
|
696
|
-
function
|
|
697
|
-
const n =
|
|
732
|
+
function On() {
|
|
733
|
+
const n = mt(he);
|
|
698
734
|
for (const e of n)
|
|
699
|
-
|
|
735
|
+
kn(e);
|
|
700
736
|
}
|
|
701
|
-
function
|
|
737
|
+
function Ln() {
|
|
702
738
|
const n = C(3), [e] = H();
|
|
703
739
|
let t, r;
|
|
704
|
-
return n[0] !== e ? (t = () =>
|
|
740
|
+
return n[0] !== e ? (t = () => Pt(e), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r), null;
|
|
705
741
|
}
|
|
742
|
+
const Co = I("TOGGLE_LINK_EDIT_MODE_COMMAND");
|
|
706
743
|
function Qe(n) {
|
|
707
744
|
const e = C(4), {
|
|
708
745
|
isEditable: t
|
|
@@ -710,55 +747,55 @@ function Qe(n) {
|
|
|
710
747
|
let o, i;
|
|
711
748
|
return e[0] !== r || e[1] !== t ? (o = () => {
|
|
712
749
|
r.setEditable(t);
|
|
713
|
-
}, i = [t, r], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]),
|
|
750
|
+
}, i = [t, r], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), B(o, i), null;
|
|
714
751
|
}
|
|
715
752
|
function Ze() {
|
|
716
753
|
const n = C(2), [e] = H();
|
|
717
754
|
let t;
|
|
718
|
-
return n[0] !== e ? (t = /* @__PURE__ */ l(
|
|
755
|
+
return n[0] !== e ? (t = /* @__PURE__ */ l(v, { fontSize: "xs", color: "fg.muted", padding: "4", children: /* @__PURE__ */ l(Zt, { 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;
|
|
719
756
|
}
|
|
720
|
-
const
|
|
757
|
+
const vn = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/, wn = /^```/, Pn = /^([ \t]*)((?:[-*+])|(?:\d+\.))\s+/, Mn = /^([ \t]+)/;
|
|
721
758
|
function et(n) {
|
|
722
759
|
let e = 0;
|
|
723
760
|
for (const t of n)
|
|
724
761
|
e += t === " " ? 4 : 1;
|
|
725
762
|
return e;
|
|
726
763
|
}
|
|
727
|
-
function
|
|
764
|
+
function An(n, e) {
|
|
728
765
|
return [...n].reverse().find((t) => t.sourceIndentWidth < e);
|
|
729
766
|
}
|
|
730
|
-
function
|
|
767
|
+
function ue(n, e, t) {
|
|
731
768
|
return e === t && !n.includes(" ") ? n : " ".repeat(e);
|
|
732
769
|
}
|
|
733
|
-
function
|
|
734
|
-
const t = n.match(
|
|
770
|
+
function Dn(n, e) {
|
|
771
|
+
const t = n.match(Mn);
|
|
735
772
|
if (!t)
|
|
736
773
|
return n.trim() !== "" && (e.length = 0), n;
|
|
737
|
-
const r = et(t[1]), o =
|
|
774
|
+
const r = et(t[1]), o = An(e, r);
|
|
738
775
|
if (!o) return n;
|
|
739
|
-
const i = r + (o.normalizedIndentWidth - o.sourceIndentWidth), s =
|
|
776
|
+
const i = r + (o.normalizedIndentWidth - o.sourceIndentWidth), s = ue(t[1], i, r);
|
|
740
777
|
return s === t[1] ? n : `${s}${n.slice(t[1].length)}`;
|
|
741
778
|
}
|
|
742
|
-
function
|
|
779
|
+
function Fn(n, e, t) {
|
|
743
780
|
const r = et(e[1]);
|
|
744
781
|
for (; t.length && t.at(-1).sourceIndentWidth > r; )
|
|
745
782
|
t.pop();
|
|
746
783
|
const o = t.at(-1);
|
|
747
784
|
if (o?.sourceIndentWidth === r)
|
|
748
|
-
return `${
|
|
785
|
+
return `${ue(e[1], o.normalizedIndentWidth, r)}${n.slice(e[1].length)}`;
|
|
749
786
|
const i = t.at(-1), s = r - (i?.sourceIndentWidth ?? 0);
|
|
750
787
|
let c = r;
|
|
751
788
|
return i && s === 2 && !e[1].includes(" ") && (c = i.normalizedIndentWidth + 4), t.push({
|
|
752
789
|
normalizedIndentWidth: c,
|
|
753
790
|
sourceIndentWidth: r
|
|
754
|
-
}), `${
|
|
791
|
+
}), `${ue(e[1], c, r)}${n.slice(e[1].length)}`;
|
|
755
792
|
}
|
|
756
|
-
function
|
|
757
|
-
if (
|
|
793
|
+
function Hn(n, e) {
|
|
794
|
+
if (wn.test(n.trimStart()))
|
|
758
795
|
return e.isInCodeFence = !e.isInCodeFence, n;
|
|
759
796
|
if (e.isInCodeFence) return n;
|
|
760
|
-
const t = n.match(
|
|
761
|
-
return t ?
|
|
797
|
+
const t = n.match(Pn);
|
|
798
|
+
return t ? Fn(n, t, e.activeListIndents) : Dn(n, e.activeListIndents);
|
|
762
799
|
}
|
|
763
800
|
function tt(n) {
|
|
764
801
|
const e = n.split(`
|
|
@@ -766,11 +803,11 @@ function tt(n) {
|
|
|
766
803
|
isInCodeFence: !1,
|
|
767
804
|
activeListIndents: []
|
|
768
805
|
};
|
|
769
|
-
return e.map((r) =>
|
|
806
|
+
return e.map((r) => Hn(r, t)).join(`
|
|
770
807
|
`);
|
|
771
808
|
}
|
|
772
|
-
function
|
|
773
|
-
const e = n.match(
|
|
809
|
+
function Bn(n) {
|
|
810
|
+
const e = n.match(vn);
|
|
774
811
|
return e ? {
|
|
775
812
|
frontmatter: e[0],
|
|
776
813
|
body: n.slice(e[0].length)
|
|
@@ -779,38 +816,38 @@ function vn(n) {
|
|
|
779
816
|
body: n
|
|
780
817
|
};
|
|
781
818
|
}
|
|
782
|
-
const
|
|
783
|
-
I(
|
|
784
|
-
I(Pn);
|
|
785
|
-
I(Ln);
|
|
786
|
-
I(Mn);
|
|
787
|
-
I(An);
|
|
788
|
-
I(Dn);
|
|
789
|
-
I(Fn);
|
|
790
|
-
I(Hn);
|
|
791
|
-
I(qn);
|
|
819
|
+
const Un = "UPLOAD_FILE", zn = "OPEN_CONTEXT", qn = "RUN_PROMPT", Wn = "UPDATE_FORMAT", Jn = "UPDATE_BEHAVIOR", jn = "INSERT_PROMPT", Kn = "RENAME_PROMPT", Gn = "DUPLICATE_PROMPT", Vn = "DELETE_PROMPT", Xn = "DELETE_REFERENCES", Yn = "RENAME_REFERENCES", Qn = "INSERT_REFERENCE", Zn = "INSERT_BLOCK";
|
|
820
|
+
I(Un);
|
|
792
821
|
I(zn);
|
|
793
|
-
I(
|
|
794
|
-
|
|
822
|
+
I(qn);
|
|
823
|
+
I(Wn);
|
|
824
|
+
I(Jn);
|
|
795
825
|
I(jn);
|
|
796
826
|
I(Kn);
|
|
827
|
+
I(Gn);
|
|
797
828
|
I(Vn);
|
|
798
|
-
|
|
799
|
-
|
|
829
|
+
I(Xn);
|
|
830
|
+
I(Yn);
|
|
831
|
+
const nt = I(Qn), er = I(Zn), tr = "INSERT_NEW_FILE_PLACEHOLDER", nr = "INSERT_NEW_TEXT_PLACEHOLDER", rr = "INSERT_PLACEHOLDER_REFERENCE";
|
|
832
|
+
I(tr);
|
|
833
|
+
I(nr);
|
|
834
|
+
I(rr);
|
|
835
|
+
function or(n) {
|
|
836
|
+
const e = oe();
|
|
800
837
|
return n.style !== null && e.setFormat(n.style.textAlign), {
|
|
801
838
|
node: e
|
|
802
839
|
};
|
|
803
840
|
}
|
|
804
|
-
class
|
|
841
|
+
class ee extends $e {
|
|
805
842
|
static getType() {
|
|
806
843
|
return "comment";
|
|
807
844
|
}
|
|
808
845
|
static clone(e) {
|
|
809
|
-
return new
|
|
846
|
+
return new ee(e.__key);
|
|
810
847
|
}
|
|
811
848
|
createDOM(e) {
|
|
812
849
|
const t = document.createElement("blockquote");
|
|
813
|
-
return
|
|
850
|
+
return De(t, e.theme.comment), t;
|
|
814
851
|
}
|
|
815
852
|
updateDOM() {
|
|
816
853
|
return !1;
|
|
@@ -818,7 +855,7 @@ class Q extends Me {
|
|
|
818
855
|
static importDOM() {
|
|
819
856
|
return {
|
|
820
857
|
blockquote: () => ({
|
|
821
|
-
conversion:
|
|
858
|
+
conversion: or,
|
|
822
859
|
priority: 0
|
|
823
860
|
})
|
|
824
861
|
};
|
|
@@ -827,7 +864,7 @@ class Q extends Me {
|
|
|
827
864
|
const {
|
|
828
865
|
element: t
|
|
829
866
|
} = super.exportDOM(e);
|
|
830
|
-
if (t &&
|
|
867
|
+
if (t && ft(t)) {
|
|
831
868
|
this.isEmpty() && t.append(document.createElement("br"));
|
|
832
869
|
const r = this.getFormatType();
|
|
833
870
|
t.style.textAlign = r;
|
|
@@ -839,7 +876,7 @@ class Q extends Me {
|
|
|
839
876
|
};
|
|
840
877
|
}
|
|
841
878
|
static importJSON(e) {
|
|
842
|
-
const t =
|
|
879
|
+
const t = oe();
|
|
843
880
|
return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t;
|
|
844
881
|
}
|
|
845
882
|
exportJSON() {
|
|
@@ -853,71 +890,71 @@ class Q extends Me {
|
|
|
853
890
|
}
|
|
854
891
|
// mutation
|
|
855
892
|
insertNewAfter(e, t) {
|
|
856
|
-
const r =
|
|
893
|
+
const r = ce(), o = this.getDirection();
|
|
857
894
|
return r.setDirection(o), this.insertAfter(r, t), r;
|
|
858
895
|
}
|
|
859
896
|
collapseAtStart() {
|
|
860
|
-
const e =
|
|
897
|
+
const e = ce();
|
|
861
898
|
return this.getChildren().forEach((r) => {
|
|
862
899
|
e.append(r);
|
|
863
900
|
}), this.replace(e), !0;
|
|
864
901
|
}
|
|
865
902
|
}
|
|
866
|
-
function
|
|
867
|
-
return new
|
|
903
|
+
function oe() {
|
|
904
|
+
return new ee();
|
|
868
905
|
}
|
|
869
|
-
const
|
|
870
|
-
const t =
|
|
906
|
+
const ir = (n, e) => {
|
|
907
|
+
const t = pt(), r = oe();
|
|
871
908
|
if (e) {
|
|
872
909
|
e.getParent()?.replace(r, !0), e.remove(), r.selectEnd();
|
|
873
910
|
return;
|
|
874
911
|
}
|
|
875
|
-
|
|
912
|
+
ht(t) && Lt(t, oe);
|
|
876
913
|
};
|
|
877
|
-
function
|
|
914
|
+
function sr() {
|
|
878
915
|
const n = C(3), [e] = H();
|
|
879
916
|
let t, r;
|
|
880
|
-
return n[0] !== e ? (t = () => pe(e.registerCommand(
|
|
917
|
+
return n[0] !== e ? (t = () => pe(e.registerCommand(er, lr, Oe)), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r), null;
|
|
881
918
|
}
|
|
882
|
-
function
|
|
919
|
+
function lr(n) {
|
|
883
920
|
const {
|
|
884
921
|
optionId: e,
|
|
885
922
|
nodeToReplace: t
|
|
886
923
|
} = n;
|
|
887
|
-
return
|
|
924
|
+
return ir(e, t), !1;
|
|
888
925
|
}
|
|
889
|
-
const
|
|
926
|
+
const cr = () => {
|
|
890
927
|
const n = C(3), [e] = H();
|
|
891
928
|
let t, r;
|
|
892
|
-
n[0] !== e ? (t = () => pe(e.registerNodeTransform(
|
|
893
|
-
const s = o.getChildren().filter(
|
|
929
|
+
n[0] !== e ? (t = () => pe(e.registerNodeTransform(ee, (o) => {
|
|
930
|
+
const s = o.getChildren().filter(ar);
|
|
894
931
|
s.length > 0 && e.update(() => {
|
|
895
|
-
s.forEach(
|
|
932
|
+
s.forEach(dr);
|
|
896
933
|
});
|
|
897
|
-
})), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]),
|
|
934
|
+
})), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r);
|
|
898
935
|
};
|
|
899
|
-
function
|
|
936
|
+
function ar(n) {
|
|
900
937
|
return n.getType() === "comment";
|
|
901
938
|
}
|
|
902
|
-
function
|
|
903
|
-
n.replace(
|
|
939
|
+
function dr(n) {
|
|
940
|
+
n.replace(ce(), !0);
|
|
904
941
|
}
|
|
905
|
-
function
|
|
906
|
-
return
|
|
942
|
+
function ur() {
|
|
943
|
+
return cr(), sr(), null;
|
|
907
944
|
}
|
|
908
|
-
const
|
|
945
|
+
const mr = (n) => {
|
|
909
946
|
let e = "";
|
|
910
947
|
const t = n.getChildren(), r = t.length;
|
|
911
948
|
for (let o = 0; o < r; o++) {
|
|
912
949
|
const i = t[o];
|
|
913
|
-
e += i.getTextContent(),
|
|
950
|
+
e += i.getTextContent(), _t(i) && o !== r - 1 && !i.isInline() && (e += `
|
|
914
951
|
`);
|
|
915
952
|
}
|
|
916
953
|
return e;
|
|
917
|
-
},
|
|
954
|
+
}, fr = (n) => n.type !== "reference" ? null : `#${n.name ?? n.referenceId ?? ""}`, pr = (n) => n.type === "paragraph" && !!n.children?.length, rt = (n) => {
|
|
918
955
|
if (n.type === "comment")
|
|
919
956
|
return "";
|
|
920
|
-
const e =
|
|
957
|
+
const e = fr(n);
|
|
921
958
|
if (e !== null)
|
|
922
959
|
return e;
|
|
923
960
|
let t = typeof n.text == "string" ? n.text : "";
|
|
@@ -931,7 +968,7 @@ const rr = (n) => {
|
|
|
931
968
|
`);
|
|
932
969
|
continue;
|
|
933
970
|
}
|
|
934
|
-
t += rt(s),
|
|
971
|
+
t += rt(s), pr(s) && (t += `
|
|
935
972
|
`);
|
|
936
973
|
}
|
|
937
974
|
return t;
|
|
@@ -942,7 +979,7 @@ const rr = (n) => {
|
|
|
942
979
|
} catch {
|
|
943
980
|
return "";
|
|
944
981
|
}
|
|
945
|
-
},
|
|
982
|
+
}, hr = {
|
|
946
983
|
root: {
|
|
947
984
|
direction: "ltr",
|
|
948
985
|
format: "",
|
|
@@ -960,7 +997,7 @@ const rr = (n) => {
|
|
|
960
997
|
}]
|
|
961
998
|
}
|
|
962
999
|
};
|
|
963
|
-
function
|
|
1000
|
+
function _r(n = "") {
|
|
964
1001
|
return n.trim() ? {
|
|
965
1002
|
root: {
|
|
966
1003
|
direction: "ltr",
|
|
@@ -986,9 +1023,9 @@ function lr(n = "") {
|
|
|
986
1023
|
}] : []
|
|
987
1024
|
}))
|
|
988
1025
|
}
|
|
989
|
-
} : JSON.parse(JSON.stringify(
|
|
1026
|
+
} : JSON.parse(JSON.stringify(hr));
|
|
990
1027
|
}
|
|
991
|
-
function
|
|
1028
|
+
function gr(n) {
|
|
992
1029
|
const e = C(4), {
|
|
993
1030
|
editorRef: t,
|
|
994
1031
|
previousTextRef: r
|
|
@@ -996,29 +1033,29 @@ function cr(n) {
|
|
|
996
1033
|
let i, s;
|
|
997
1034
|
return e[0] !== o || e[1] !== r ? (i = () => ({
|
|
998
1035
|
setEditorValue: (c) => {
|
|
999
|
-
const a = o.parseEditorState(JSON.stringify(
|
|
1036
|
+
const a = o.parseEditorState(JSON.stringify(_r(c)));
|
|
1000
1037
|
o.setEditorState(a), r.current = ot(c), o.focus(void 0, {
|
|
1001
1038
|
defaultSelection: "rootEnd"
|
|
1002
1039
|
});
|
|
1003
1040
|
}
|
|
1004
|
-
}), s = [o, r], e[0] = o, e[1] = r, e[2] = i, e[3] = s) : (i = e[2], s = e[3]),
|
|
1041
|
+
}), s = [o, r], e[0] = o, e[1] = r, e[2] = i, e[3] = s) : (i = e[2], s = e[3]), It(t, i, s), null;
|
|
1005
1042
|
}
|
|
1006
|
-
const
|
|
1007
|
-
function
|
|
1043
|
+
const Er = (n) => n.key !== "Enter" ? !1 : !n.ctrlKey && !n.metaKey && !n.shiftKey && !n.altKey;
|
|
1044
|
+
function xr(n) {
|
|
1008
1045
|
const e = C(4), {
|
|
1009
1046
|
onSubmit: t
|
|
1010
1047
|
} = n, [r] = H();
|
|
1011
1048
|
let o, i;
|
|
1012
|
-
return e[0] !== r || e[1] !== t ? (o = () => r.registerCommand(
|
|
1049
|
+
return e[0] !== r || e[1] !== t ? (o = () => r.registerCommand(gt, (s) => Er(s) ? (s.preventDefault(), t?.(), !0) : !1, Et), i = [r, t], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), B(o, i), null;
|
|
1013
1050
|
}
|
|
1014
|
-
const
|
|
1051
|
+
const Ce = ["table", "connector"], br = (n) => n.sort((r, o) => Ce.indexOf(r.group) - Ce.indexOf(o.group)).map((r, o) => ({
|
|
1015
1052
|
...r,
|
|
1016
1053
|
index: o
|
|
1017
1054
|
})).reduce((r, o) => {
|
|
1018
1055
|
const i = r[o.group] ?? [];
|
|
1019
1056
|
return i.push(o), r[o.group] = i, r;
|
|
1020
1057
|
}, {});
|
|
1021
|
-
function
|
|
1058
|
+
function Ie(n) {
|
|
1022
1059
|
const e = C(22), {
|
|
1023
1060
|
id: t,
|
|
1024
1061
|
isSelected: r,
|
|
@@ -1027,30 +1064,30 @@ function Ne(n) {
|
|
|
1027
1064
|
setRefElement: s,
|
|
1028
1065
|
secondaryLabel: c,
|
|
1029
1066
|
primaryLabel: a,
|
|
1030
|
-
tabIndex:
|
|
1031
|
-
} = n, u =
|
|
1067
|
+
tabIndex: p
|
|
1068
|
+
} = n, u = p === void 0 ? -1 : p, h = r ? "bg.active" : "transparent", m = r ? "bg.active" : "bg.hover";
|
|
1032
1069
|
let d;
|
|
1033
|
-
e[0] !==
|
|
1034
|
-
bg:
|
|
1035
|
-
}, e[0] =
|
|
1036
|
-
let
|
|
1037
|
-
e[2] !== a ? (
|
|
1070
|
+
e[0] !== m ? (d = {
|
|
1071
|
+
bg: m
|
|
1072
|
+
}, e[0] = m, e[1] = d) : d = e[1];
|
|
1073
|
+
let f;
|
|
1074
|
+
e[2] !== a ? (f = /* @__PURE__ */ l(ne.Trigger, { children: /* @__PURE__ */ l(w, { mt: "1px", lineClamp: 1, textOverflow: "ellipsis", textStyle: "label/M/regular", children: a }) }), e[2] = a, e[3] = f) : f = e[3];
|
|
1038
1075
|
let x;
|
|
1039
|
-
e[4] !== a ? (x = /* @__PURE__ */ l(
|
|
1076
|
+
e[4] !== a ? (x = /* @__PURE__ */ l(ne.Positioner, { children: /* @__PURE__ */ l(ne.Content, { children: a }) }), e[4] = a, e[5] = x) : x = e[5];
|
|
1040
1077
|
let g;
|
|
1041
|
-
e[6] !==
|
|
1042
|
-
|
|
1078
|
+
e[6] !== f || e[7] !== x ? (g = /* @__PURE__ */ F(ne.Root, { children: [
|
|
1079
|
+
f,
|
|
1043
1080
|
x
|
|
1044
|
-
] }), e[6] =
|
|
1081
|
+
] }), e[6] = f, e[7] = x, e[8] = g) : g = e[8];
|
|
1045
1082
|
let _;
|
|
1046
|
-
e[9] !== c ? (_ = c && /* @__PURE__ */ l(
|
|
1047
|
-
let
|
|
1048
|
-
return e[11] !== t || e[12] !== r || e[13] !== o || e[14] !== i || e[15] !== s || e[16] !==
|
|
1083
|
+
e[9] !== c ? (_ = c && /* @__PURE__ */ l(w, { lineClamp: 2, textOverflow: "ellipsis", textStyle: "label/S/regular", color: "fg.muted", children: c }), e[9] = c, e[10] = _) : _ = e[10];
|
|
1084
|
+
let y;
|
|
1085
|
+
return e[11] !== t || e[12] !== r || e[13] !== o || e[14] !== i || e[15] !== s || e[16] !== h || e[17] !== d || e[18] !== g || e[19] !== _ || e[20] !== u ? (y = /* @__PURE__ */ F(fe, { direction: "column", cursor: "pointer", gap: "2xs", padding: "2xs", paddingX: "sm", bg: h, _hover: d, tabIndex: u, ref: s, role: "option", "aria-selected": r, id: t, onMouseEnter: i, onClick: o, children: [
|
|
1049
1086
|
g,
|
|
1050
1087
|
_
|
|
1051
|
-
] }), e[11] = t, e[12] = r, e[13] = o, e[14] = i, e[15] = s, e[16] =
|
|
1088
|
+
] }), e[11] = t, e[12] = r, e[13] = o, e[14] = i, e[15] = s, e[16] = h, e[17] = d, e[18] = g, e[19] = _, e[20] = u, e[21] = y) : y = e[21], y;
|
|
1052
1089
|
}
|
|
1053
|
-
const
|
|
1090
|
+
const Tr = (n) => {
|
|
1054
1091
|
const e = C(12), {
|
|
1055
1092
|
options: t,
|
|
1056
1093
|
selectedIndex: r,
|
|
@@ -1059,37 +1096,37 @@ const mr = (n) => {
|
|
|
1059
1096
|
} = n, {
|
|
1060
1097
|
table: s,
|
|
1061
1098
|
connector: c
|
|
1062
|
-
} =
|
|
1063
|
-
let
|
|
1064
|
-
e[0] !== r ? (
|
|
1099
|
+
} = br(t), a = s === void 0 ? [] : s, p = c === void 0 ? [] : c, u = [...a, ...p].length;
|
|
1100
|
+
let h, m;
|
|
1101
|
+
e[0] !== r ? (h = () => {
|
|
1065
1102
|
document.getElementById(`typeahead-item-${r}`)?.scrollIntoView({
|
|
1066
1103
|
behavior: "instant",
|
|
1067
1104
|
block: "nearest"
|
|
1068
1105
|
});
|
|
1069
|
-
},
|
|
1070
|
-
const d =
|
|
1071
|
-
let
|
|
1072
|
-
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1106
|
+
}, m = [r], e[0] = r, e[1] = h, e[2] = m) : (h = e[1], m = e[2]), B(h, m);
|
|
1107
|
+
const d = v, f = "1000", x = "absolute", g = "modal", _ = "auto", y = "24rem";
|
|
1108
|
+
let S;
|
|
1109
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = {
|
|
1073
1110
|
base: "100vw",
|
|
1074
1111
|
md: "264px"
|
|
1075
|
-
}, e[3] =
|
|
1112
|
+
}, e[3] = S) : S = e[3];
|
|
1076
1113
|
let R;
|
|
1077
|
-
e[4] !== u ? (R = !u && /* @__PURE__ */ l(
|
|
1078
|
-
const b = !!a.length && /* @__PURE__ */ F(
|
|
1079
|
-
/* @__PURE__ */ l(
|
|
1080
|
-
/* @__PURE__ */ l(
|
|
1081
|
-
] }), N = !!
|
|
1082
|
-
/* @__PURE__ */ l(
|
|
1083
|
-
/* @__PURE__ */ l(
|
|
1114
|
+
e[4] !== u ? (R = !u && /* @__PURE__ */ l(w, { children: "No results" }), e[4] = u, e[5] = R) : R = e[5];
|
|
1115
|
+
const b = !!a.length && /* @__PURE__ */ F(be, { children: [
|
|
1116
|
+
/* @__PURE__ */ l(w, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Tables" }),
|
|
1117
|
+
/* @__PURE__ */ l(v, { children: a.map((E) => /* @__PURE__ */ l(Ie, { id: `typeahead-item-${E.index}`, isSelected: r === E.index, onClick: () => o(E, E.index), onMouseEnter: () => i(E.index), primaryLabel: E.name, secondaryLabel: E.description, setRefElement: E.setRefElement, tabIndex: -1 }, E.id)) })
|
|
1118
|
+
] }), N = !!p.length && /* @__PURE__ */ F(be, { children: [
|
|
1119
|
+
/* @__PURE__ */ l(w, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Data Sources" }),
|
|
1120
|
+
/* @__PURE__ */ l(v, { children: p.map((E) => /* @__PURE__ */ l(Ie, { id: `typeahead-item-${E.index}`, isSelected: r === E.index, onClick: () => o(E, E.index), onMouseEnter: () => i(E.index), primaryLabel: E.name, secondaryLabel: E.description, setRefElement: E.setRefElement, tabIndex: -1 }, E.id)) })
|
|
1084
1121
|
] });
|
|
1085
|
-
let
|
|
1086
|
-
return e[6] !== d || e[7] !== R || e[8] !== b || e[9] !== N || e[10] !==
|
|
1122
|
+
let T;
|
|
1123
|
+
return e[6] !== d || e[7] !== R || e[8] !== b || e[9] !== N || e[10] !== S ? (T = /* @__PURE__ */ F(d, { zIndex: f, position: x, layerStyle: g, overflow: _, maxHeight: y, minWidth: S, children: [
|
|
1087
1124
|
R,
|
|
1088
1125
|
b,
|
|
1089
1126
|
N
|
|
1090
|
-
] }), e[6] = d, e[7] = R, e[8] = b, e[9] = N, e[10] =
|
|
1091
|
-
},
|
|
1092
|
-
function
|
|
1127
|
+
] }), e[6] = d, e[7] = R, e[8] = b, e[9] = N, e[10] = S, e[11] = T) : T = e[11], T;
|
|
1128
|
+
}, Sr = (n, e) => n.filter((t) => t.name.replace(/ /g, "_").toLowerCase().includes(e.toLowerCase()));
|
|
1129
|
+
function yr(n, e = []) {
|
|
1093
1130
|
const t = e.map((r, o) => ({
|
|
1094
1131
|
id: r.resourceId,
|
|
1095
1132
|
key: r.resourceId,
|
|
@@ -1100,12 +1137,12 @@ function hr(n, e = []) {
|
|
|
1100
1137
|
setRefElement: () => {
|
|
1101
1138
|
}
|
|
1102
1139
|
}));
|
|
1103
|
-
return n == null || n === "" ? t :
|
|
1140
|
+
return n == null || n === "" ? t : Sr(t, n);
|
|
1104
1141
|
}
|
|
1105
|
-
const it = "\\.\\-<>_:",
|
|
1106
|
-
function
|
|
1107
|
-
let t =
|
|
1108
|
-
if (t === null && (t =
|
|
1142
|
+
const it = "\\.\\-<>_:", xe = ["#"].join(""), st = `[^${xe}${it}\\s]`, Rr = `(?:[${it}]|)`, lt = 75, Nr = new RegExp(`(^|\\s|\\()([${xe}]((?:${st}${Rr}){0,${lt}}))$`), Cr = new RegExp(`(^|\\s|\\()([${xe}]((?:${st}){0,${lt}}))$`);
|
|
1143
|
+
function Ir(n, e) {
|
|
1144
|
+
let t = Nr.exec(n);
|
|
1145
|
+
if (t === null && (t = Cr.exec(n)), t !== null) {
|
|
1109
1146
|
const r = t[1], o = t[3];
|
|
1110
1147
|
if (o.length >= e)
|
|
1111
1148
|
return {
|
|
@@ -1116,16 +1153,16 @@ function Er(n, e) {
|
|
|
1116
1153
|
}
|
|
1117
1154
|
return null;
|
|
1118
1155
|
}
|
|
1119
|
-
const
|
|
1120
|
-
function
|
|
1156
|
+
const kr = 20;
|
|
1157
|
+
function $r(n) {
|
|
1121
1158
|
const e = C(9), {
|
|
1122
1159
|
items: t
|
|
1123
1160
|
} = n;
|
|
1124
1161
|
let r;
|
|
1125
1162
|
e[0] !== t ? (r = t === void 0 ? [] : t, e[0] = t, e[1] = r) : r = e[1];
|
|
1126
|
-
const o = r, [i, s] =
|
|
1127
|
-
let
|
|
1128
|
-
e[2] !== c ? (
|
|
1163
|
+
const o = r, [i, s] = kt(null), [c] = H(), a = yr(i, o);
|
|
1164
|
+
let p;
|
|
1165
|
+
e[2] !== c ? (p = (x, g, _) => {
|
|
1129
1166
|
c.update(() => {
|
|
1130
1167
|
g && (c.dispatchCommand(nt, {
|
|
1131
1168
|
resourceId: x.id,
|
|
@@ -1134,38 +1171,38 @@ function br(n) {
|
|
|
1134
1171
|
nodeToReplace: g
|
|
1135
1172
|
}), _());
|
|
1136
1173
|
});
|
|
1137
|
-
}, e[2] = c, e[3] =
|
|
1138
|
-
const u =
|
|
1139
|
-
let f;
|
|
1140
|
-
e[4] !== a ? (f = a.slice(0, xr), e[4] = a, e[5] = f) : f = e[5];
|
|
1141
|
-
const d = f;
|
|
1174
|
+
}, e[2] = c, e[3] = p) : p = e[3];
|
|
1175
|
+
const u = p, h = Lr;
|
|
1142
1176
|
let m;
|
|
1143
|
-
|
|
1177
|
+
e[4] !== a ? (m = a.slice(0, kr), e[4] = a, e[5] = m) : m = e[5];
|
|
1178
|
+
const d = m;
|
|
1179
|
+
let f;
|
|
1180
|
+
return e[6] !== d || e[7] !== u ? (f = /* @__PURE__ */ l(vt, { onQueryChange: s, onSelectOption: u, triggerFn: h, options: d, menuRenderFn: Or }), e[6] = d, e[7] = u, e[8] = f) : f = e[8], f;
|
|
1144
1181
|
}
|
|
1145
|
-
function
|
|
1182
|
+
function Or(n, e) {
|
|
1146
1183
|
const {
|
|
1147
1184
|
options: t,
|
|
1148
1185
|
selectedIndex: r,
|
|
1149
1186
|
selectOptionAndCleanUp: o,
|
|
1150
1187
|
setHighlightedIndex: i
|
|
1151
1188
|
} = e;
|
|
1152
|
-
return n.current ?
|
|
1189
|
+
return n.current ? wt.createPortal(/* @__PURE__ */ l(Tr, { options: t, selectedIndex: r, onSelectItem: (s, c) => {
|
|
1153
1190
|
i(c), o(s);
|
|
1154
1191
|
}, onMouseEnterItem: (s) => {
|
|
1155
1192
|
i(s);
|
|
1156
1193
|
} }), n.current) : null;
|
|
1157
1194
|
}
|
|
1158
|
-
function
|
|
1159
|
-
return
|
|
1195
|
+
function Lr(n) {
|
|
1196
|
+
return Ir(n, 0);
|
|
1160
1197
|
}
|
|
1161
|
-
class
|
|
1198
|
+
class Q extends re {
|
|
1162
1199
|
__referenceId;
|
|
1163
1200
|
__name;
|
|
1164
1201
|
static getType() {
|
|
1165
1202
|
return "reference";
|
|
1166
1203
|
}
|
|
1167
1204
|
static clone(e) {
|
|
1168
|
-
return new
|
|
1205
|
+
return new Q(e.__referenceId, e.__name, e.__key);
|
|
1169
1206
|
}
|
|
1170
1207
|
constructor(e, t, r) {
|
|
1171
1208
|
super(t, r), this.__referenceId = e, this.__name = t;
|
|
@@ -1184,7 +1221,7 @@ class G extends te {
|
|
|
1184
1221
|
}
|
|
1185
1222
|
createDOM(e) {
|
|
1186
1223
|
const t = document.createElement("span");
|
|
1187
|
-
return
|
|
1224
|
+
return De(t, e.theme.reference), t.setAttribute("data-reference-id", this.__referenceId), t.setAttribute("data-name", this.__name), t.textContent = `#${this.__name}`, t;
|
|
1188
1225
|
}
|
|
1189
1226
|
updateDOM(e, t) {
|
|
1190
1227
|
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;
|
|
@@ -1198,13 +1235,13 @@ class G extends te {
|
|
|
1198
1235
|
static importDOM() {
|
|
1199
1236
|
return {
|
|
1200
1237
|
span: (e) => !e.hasAttribute("data-reference-id") || !e.hasAttribute("data-name") ? null : {
|
|
1201
|
-
conversion:
|
|
1238
|
+
conversion: vr,
|
|
1202
1239
|
priority: 1
|
|
1203
1240
|
}
|
|
1204
1241
|
};
|
|
1205
1242
|
}
|
|
1206
1243
|
static importJSON(e) {
|
|
1207
|
-
return new
|
|
1244
|
+
return new Q(e.referenceId, e.name);
|
|
1208
1245
|
}
|
|
1209
1246
|
exportJSON() {
|
|
1210
1247
|
return {
|
|
@@ -1218,23 +1255,23 @@ class G extends te {
|
|
|
1218
1255
|
return `#${this.__name}`;
|
|
1219
1256
|
}
|
|
1220
1257
|
}
|
|
1221
|
-
function
|
|
1258
|
+
function vr(n) {
|
|
1222
1259
|
const e = n.getAttribute("data-reference-id"), t = n.getAttribute("data-name");
|
|
1223
1260
|
return !e || !t ? null : {
|
|
1224
1261
|
node: ct(e, t)
|
|
1225
1262
|
};
|
|
1226
1263
|
}
|
|
1227
1264
|
function ct(n, e) {
|
|
1228
|
-
return new
|
|
1265
|
+
return new Q(n, e);
|
|
1229
1266
|
}
|
|
1230
|
-
const
|
|
1267
|
+
const wr = (n, e, t) => {
|
|
1231
1268
|
const r = ct(e, t);
|
|
1232
1269
|
if (n) {
|
|
1233
1270
|
n?.replace(r), n.remove(), r.selectEnd();
|
|
1234
1271
|
return;
|
|
1235
1272
|
}
|
|
1236
1273
|
};
|
|
1237
|
-
function
|
|
1274
|
+
function Pr(n) {
|
|
1238
1275
|
const e = C(4), {
|
|
1239
1276
|
onAddReference: t
|
|
1240
1277
|
} = n, [r] = H();
|
|
@@ -1243,98 +1280,98 @@ function Nr(n) {
|
|
|
1243
1280
|
const {
|
|
1244
1281
|
resourceId: c,
|
|
1245
1282
|
resourceType: a,
|
|
1246
|
-
name:
|
|
1283
|
+
name: p,
|
|
1247
1284
|
nodeToReplace: u
|
|
1248
1285
|
} = s;
|
|
1249
1286
|
return r.update(() => {
|
|
1250
|
-
|
|
1287
|
+
wr(u, c, p);
|
|
1251
1288
|
}), t?.(c, a), !0;
|
|
1252
|
-
},
|
|
1289
|
+
}, Oe)), i = [r, t], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), B(o, i), null;
|
|
1253
1290
|
}
|
|
1254
|
-
const
|
|
1255
|
-
...
|
|
1291
|
+
const Mr = {
|
|
1292
|
+
...Ee,
|
|
1256
1293
|
// Override paragraph class to remove margins specifically for prompt input
|
|
1257
1294
|
paragraph: "rich-text__p rich-text__p--no-margin"
|
|
1258
|
-
},
|
|
1295
|
+
}, Ar = [ee, yt, Q], Dr = (n, e) => {
|
|
1259
1296
|
const t = C(39), {
|
|
1260
1297
|
defaultState: r,
|
|
1261
1298
|
debug: o,
|
|
1262
1299
|
isEditable: i,
|
|
1263
1300
|
placeholder: s
|
|
1264
1301
|
} = n, c = o === void 0 ? !1 : o, a = i === void 0 ? !0 : i, {
|
|
1265
|
-
onChange:
|
|
1302
|
+
onChange: p,
|
|
1266
1303
|
onError: u,
|
|
1267
|
-
onSubmit:
|
|
1268
|
-
references:
|
|
1304
|
+
onSubmit: h,
|
|
1305
|
+
references: m,
|
|
1269
1306
|
onAddReference: d
|
|
1270
|
-
} = n,
|
|
1307
|
+
} = n, f = u === void 0 ? Fr : u;
|
|
1271
1308
|
let x;
|
|
1272
|
-
t[0] !==
|
|
1309
|
+
t[0] !== m ? (x = m === void 0 ? [] : m, t[0] = m, t[1] = x) : x = t[1];
|
|
1273
1310
|
const g = x;
|
|
1274
1311
|
let _;
|
|
1275
|
-
t[2] !== r || t[3] !== a || t[4] !==
|
|
1312
|
+
t[2] !== r || t[3] !== a || t[4] !== f ? (_ = {
|
|
1276
1313
|
namespace: "PROMPT_EDITOR",
|
|
1277
|
-
nodes:
|
|
1314
|
+
nodes: Ar,
|
|
1278
1315
|
editorState: r,
|
|
1279
1316
|
editable: a,
|
|
1280
|
-
onError:
|
|
1281
|
-
theme:
|
|
1282
|
-
}, t[2] = r, t[3] = a, t[4] =
|
|
1283
|
-
const
|
|
1284
|
-
let
|
|
1285
|
-
t[6] !== r ? (
|
|
1286
|
-
const R =
|
|
1317
|
+
onError: f,
|
|
1318
|
+
theme: Mr
|
|
1319
|
+
}, t[2] = r, t[3] = a, t[4] = f, t[5] = _) : _ = t[5];
|
|
1320
|
+
const y = _;
|
|
1321
|
+
let S;
|
|
1322
|
+
t[6] !== r ? (S = ot(r), t[6] = r, t[7] = S) : S = t[7];
|
|
1323
|
+
const R = Ot(S);
|
|
1287
1324
|
let b;
|
|
1288
|
-
t[8] !== s ? (b = s ?? /* @__PURE__ */ F(
|
|
1325
|
+
t[8] !== s ? (b = s ?? /* @__PURE__ */ F(w, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: [
|
|
1289
1326
|
"Type your query here or press ",
|
|
1290
|
-
/* @__PURE__ */ l(
|
|
1327
|
+
/* @__PURE__ */ l(St, { color: "fg.subtle", children: "#" }),
|
|
1291
1328
|
" to add a reference."
|
|
1292
1329
|
] }), t[8] = s, t[9] = b) : b = t[9];
|
|
1293
1330
|
const N = b;
|
|
1294
|
-
let
|
|
1295
|
-
t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1331
|
+
let T;
|
|
1332
|
+
t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ l(Rt, {}), t[10] = T) : T = t[10];
|
|
1296
1333
|
let E;
|
|
1297
|
-
t[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ l(
|
|
1298
|
-
let
|
|
1299
|
-
t[12] !== N ? (
|
|
1300
|
-
let
|
|
1301
|
-
t[14] !==
|
|
1302
|
-
|
|
1303
|
-
const dt =
|
|
1304
|
-
|
|
1334
|
+
t[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ l(Je, { fullWidth: !0 }), t[11] = E) : E = t[11];
|
|
1335
|
+
let k;
|
|
1336
|
+
t[12] !== N ? (k = /* @__PURE__ */ l(Me, { contentEditable: E, placeholder: N, ErrorBoundary: we }), t[12] = N, t[13] = k) : k = t[13];
|
|
1337
|
+
let P;
|
|
1338
|
+
t[14] !== p ? (P = /* @__PURE__ */ l(Pe, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (te) => {
|
|
1339
|
+
te.read(() => {
|
|
1340
|
+
const dt = Le(), le = mr(dt);
|
|
1341
|
+
le !== R.current && (R.current = le, p?.(le, te.toJSON()));
|
|
1305
1342
|
});
|
|
1306
|
-
} }), t[14] =
|
|
1343
|
+
} }), t[14] = p, t[15] = P) : P = t[15];
|
|
1307
1344
|
let M;
|
|
1308
|
-
t[16] !== e ? (M = /* @__PURE__ */ l(
|
|
1309
|
-
let k;
|
|
1310
|
-
t[18] !== a ? (k = /* @__PURE__ */ l(Qe, { isEditable: a }), t[18] = a, t[19] = k) : k = t[19];
|
|
1311
|
-
let A;
|
|
1312
|
-
t[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ l(nr, {}), t[20] = A) : A = t[20];
|
|
1345
|
+
t[16] !== e ? (M = /* @__PURE__ */ l(gr, { editorRef: e, previousTextRef: R }), t[16] = e, t[17] = M) : M = t[17];
|
|
1313
1346
|
let $;
|
|
1314
|
-
t[
|
|
1315
|
-
let
|
|
1316
|
-
t[
|
|
1347
|
+
t[18] !== a ? ($ = /* @__PURE__ */ l(Qe, { isEditable: a }), t[18] = a, t[19] = $) : $ = t[19];
|
|
1348
|
+
let A;
|
|
1349
|
+
t[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ l(ur, {}), t[20] = A) : A = t[20];
|
|
1350
|
+
let O;
|
|
1351
|
+
t[21] !== h ? (O = /* @__PURE__ */ l(xr, { onSubmit: h }), t[21] = h, t[22] = O) : O = t[22];
|
|
1352
|
+
let L;
|
|
1353
|
+
t[23] !== g ? (L = /* @__PURE__ */ l($r, { items: g }), t[23] = g, t[24] = L) : L = t[24];
|
|
1317
1354
|
let D;
|
|
1318
|
-
t[25] !== d ? (D = /* @__PURE__ */ l(
|
|
1319
|
-
let
|
|
1320
|
-
t[27] !== c ? (
|
|
1321
|
-
let
|
|
1322
|
-
return t[29] !==
|
|
1323
|
-
|
|
1324
|
-
O,
|
|
1325
|
-
L,
|
|
1326
|
-
M,
|
|
1355
|
+
t[25] !== d ? (D = /* @__PURE__ */ l(Pr, { onAddReference: d }), t[25] = d, t[26] = D) : D = t[26];
|
|
1356
|
+
let U;
|
|
1357
|
+
t[27] !== c ? (U = c ? /* @__PURE__ */ l(Ze, {}) : "", t[27] = c, t[28] = U) : U = t[28];
|
|
1358
|
+
let G;
|
|
1359
|
+
return t[29] !== y || t[30] !== k || t[31] !== P || t[32] !== M || t[33] !== $ || t[34] !== O || t[35] !== L || t[36] !== D || t[37] !== U ? (G = /* @__PURE__ */ l(fe, { direction: "column", justifyContent: "space-between", width: "100%", position: "relative", children: /* @__PURE__ */ F(ve, { initialConfig: y, children: [
|
|
1360
|
+
T,
|
|
1327
1361
|
k,
|
|
1328
|
-
|
|
1362
|
+
P,
|
|
1363
|
+
M,
|
|
1329
1364
|
$,
|
|
1330
|
-
|
|
1365
|
+
A,
|
|
1366
|
+
O,
|
|
1367
|
+
L,
|
|
1331
1368
|
D,
|
|
1332
|
-
|
|
1333
|
-
] }) }), t[29] =
|
|
1334
|
-
},
|
|
1335
|
-
function
|
|
1369
|
+
U
|
|
1370
|
+
] }) }), t[29] = y, t[30] = k, t[31] = P, t[32] = M, t[33] = $, t[34] = O, t[35] = L, t[36] = D, t[37] = U, t[38] = G) : G = t[38], G;
|
|
1371
|
+
}, Io = $t(Dr);
|
|
1372
|
+
function Fr() {
|
|
1336
1373
|
}
|
|
1337
|
-
function
|
|
1374
|
+
function Hr(n) {
|
|
1338
1375
|
const e = C(5), {
|
|
1339
1376
|
value: t,
|
|
1340
1377
|
onUpdate: r
|
|
@@ -1344,9 +1381,9 @@ function $r(n) {
|
|
|
1344
1381
|
o && o.update(() => r(t), {
|
|
1345
1382
|
tag: "history-merge"
|
|
1346
1383
|
});
|
|
1347
|
-
}, s = [t, o, r], e[0] = o, e[1] = r, e[2] = t, e[3] = i, e[4] = s) : (i = e[3], s = e[4]),
|
|
1384
|
+
}, s = [t, o, r], e[0] = o, e[1] = r, e[2] = t, e[3] = i, e[4] = s) : (i = e[3], s = e[4]), B(i, s), null;
|
|
1348
1385
|
}
|
|
1349
|
-
class j extends
|
|
1386
|
+
class j extends Z {
|
|
1350
1387
|
__href;
|
|
1351
1388
|
__label;
|
|
1352
1389
|
static getType() {
|
|
@@ -1380,14 +1417,14 @@ class j extends Y {
|
|
|
1380
1417
|
}
|
|
1381
1418
|
decorate(e, t) {
|
|
1382
1419
|
const r = this.__href, i = r.split("/").pop() || "unknown", s = /^https?:\/\//i.test(r), c = /^#?\$PROJECT\//i.test(r);
|
|
1383
|
-
return /* @__PURE__ */ l(
|
|
1420
|
+
return /* @__PURE__ */ l(v, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ l(je, { fileName: i, onSelect: () => {
|
|
1384
1421
|
if (s)
|
|
1385
1422
|
window.open(r, "_blank", "noopener,noreferrer");
|
|
1386
1423
|
else if (c) {
|
|
1387
|
-
const a = r.replace(/^#?\$PROJECT\//i, ""),
|
|
1424
|
+
const a = r.replace(/^#?\$PROJECT\//i, ""), p = new CustomEvent("ui:open-project-file", {
|
|
1388
1425
|
detail: a
|
|
1389
1426
|
});
|
|
1390
|
-
window.dispatchEvent(
|
|
1427
|
+
window.dispatchEvent(p);
|
|
1391
1428
|
} else
|
|
1392
1429
|
window.location.assign(r);
|
|
1393
1430
|
} }) });
|
|
@@ -1396,117 +1433,118 @@ class j extends Y {
|
|
|
1396
1433
|
function at(n, e) {
|
|
1397
1434
|
return new j(n, e);
|
|
1398
1435
|
}
|
|
1399
|
-
function
|
|
1436
|
+
function Br(n) {
|
|
1400
1437
|
return n instanceof j;
|
|
1401
1438
|
}
|
|
1402
|
-
const
|
|
1439
|
+
const ke = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, Ur = {
|
|
1403
1440
|
dependencies: [j],
|
|
1404
1441
|
export: (n) => {
|
|
1405
|
-
if (
|
|
1442
|
+
if (Br(n)) {
|
|
1406
1443
|
const e = n.__href, t = n.__label ?? e;
|
|
1407
1444
|
return t ? `{{link('${t}')}}` : `{{link('${e}')}}`;
|
|
1408
1445
|
}
|
|
1409
1446
|
return null;
|
|
1410
1447
|
},
|
|
1411
|
-
regExp:
|
|
1412
|
-
importRegExp:
|
|
1448
|
+
regExp: ke,
|
|
1449
|
+
importRegExp: ke,
|
|
1413
1450
|
replace: (n, e) => {
|
|
1414
1451
|
const t = e[2], o = /^(https?:\/\/|\/)/i.test(t) ? t : `#${t}`, i = t;
|
|
1415
1452
|
n.replace(at(o, i));
|
|
1416
1453
|
},
|
|
1417
1454
|
type: "text-match"
|
|
1418
|
-
},
|
|
1419
|
-
function
|
|
1455
|
+
}, me = [...Ye, Ur];
|
|
1456
|
+
function ko(n) {
|
|
1420
1457
|
const e = C(37), {
|
|
1421
1458
|
debug: t,
|
|
1422
1459
|
defaultState: r,
|
|
1423
1460
|
fullWidth: o,
|
|
1424
1461
|
isEditable: i,
|
|
1425
1462
|
onChange: s
|
|
1426
|
-
} = n, c = t === void 0 ? !1 : t, a = r === void 0 ? "" : r,
|
|
1427
|
-
let
|
|
1428
|
-
e[0] !== a ? (
|
|
1463
|
+
} = n, c = t === void 0 ? !1 : t, a = r === void 0 ? "" : r, p = o === void 0 ? !1 : o, u = i === void 0 ? !1 : i;
|
|
1464
|
+
let h;
|
|
1465
|
+
e[0] !== a ? (h = Bn(a), e[0] = a, e[1] = h) : h = e[1];
|
|
1429
1466
|
const {
|
|
1430
|
-
frontmatter:
|
|
1467
|
+
frontmatter: m,
|
|
1431
1468
|
body: d
|
|
1432
|
-
} =
|
|
1469
|
+
} = h, f = u && !!s;
|
|
1433
1470
|
let x;
|
|
1434
|
-
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = [
|
|
1471
|
+
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = [qe, _e, ge, W, We, Be, Ue, he, Fe, J, q, K, j], e[2] = x) : x = e[2];
|
|
1435
1472
|
let g;
|
|
1436
|
-
e[3] !== d ? (g = () =>
|
|
1473
|
+
e[3] !== d ? (g = () => ze(tt(d), me, void 0, !1), e[3] = d, e[4] = g) : g = e[4];
|
|
1437
1474
|
let _;
|
|
1438
1475
|
e[5] !== u || e[6] !== g ? (_ = {
|
|
1439
1476
|
namespace: "RICH_MESSAGE",
|
|
1440
1477
|
nodes: x,
|
|
1441
1478
|
editorState: g,
|
|
1442
|
-
onError:
|
|
1479
|
+
onError: qr,
|
|
1443
1480
|
editable: u,
|
|
1444
|
-
theme:
|
|
1481
|
+
theme: Ee
|
|
1445
1482
|
}, e[5] = u, e[6] = g, e[7] = _) : _ = e[7];
|
|
1446
|
-
const
|
|
1447
|
-
let y;
|
|
1448
|
-
e[8] !== d ? (y = /* @__PURE__ */ l($r, { value: d, onUpdate: Pr }), e[8] = d, e[9] = y) : y = e[9];
|
|
1449
|
-
let R, b, N;
|
|
1450
|
-
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(zt, {}), R = /* @__PURE__ */ l(Ht, { newTab: !0 }), b = /* @__PURE__ */ l(Bt, {}), e[10] = R, e[11] = b, e[12] = N) : (R = e[10], b = e[11], N = e[12]);
|
|
1483
|
+
const y = _;
|
|
1451
1484
|
let S;
|
|
1452
|
-
e[
|
|
1453
|
-
let
|
|
1454
|
-
e[
|
|
1455
|
-
let
|
|
1456
|
-
e[
|
|
1485
|
+
e[8] !== d ? (S = /* @__PURE__ */ l(Hr, { value: d, onUpdate: zr }), e[8] = d, e[9] = S) : S = e[9];
|
|
1486
|
+
let R, b, N;
|
|
1487
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(Wt, {}), R = /* @__PURE__ */ l(zt, { newTab: !0 }), b = /* @__PURE__ */ l(Jt, {}), e[10] = R, e[11] = b, e[12] = N) : (R = e[10], b = e[11], N = e[12]);
|
|
1488
|
+
let T;
|
|
1489
|
+
e[13] !== u ? (T = u ? /* @__PURE__ */ l(jt, { maxIndent: 7 }) : null, e[13] = u, e[14] = T) : T = e[14];
|
|
1490
|
+
let E, k, P, M;
|
|
1491
|
+
e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ l(qt, {}), k = /* @__PURE__ */ l(Ln, {}), P = /* @__PURE__ */ l($n, {}), M = /* @__PURE__ */ l(hn, {}), e[15] = E, e[16] = k, e[17] = P, e[18] = M) : (E = e[15], k = e[16], P = e[17], M = e[18]);
|
|
1492
|
+
let $;
|
|
1493
|
+
e[19] !== p ? ($ = /* @__PURE__ */ l(Me, { contentEditable: /* @__PURE__ */ l(Je, { fullWidth: p, isRichMessage: !0 }), ErrorBoundary: we }), e[19] = p, e[20] = $) : $ = e[20];
|
|
1457
1494
|
let A;
|
|
1458
|
-
e[21] !==
|
|
1459
|
-
|
|
1460
|
-
const
|
|
1461
|
-
s?.(
|
|
1495
|
+
e[21] !== m || e[22] !== s || e[23] !== f ? (A = f ? /* @__PURE__ */ l(Pe, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (U) => {
|
|
1496
|
+
U.read(() => {
|
|
1497
|
+
const G = Le(), te = Ut(me, G);
|
|
1498
|
+
s?.(m + te);
|
|
1462
1499
|
});
|
|
1463
|
-
} }) : null, e[21] =
|
|
1464
|
-
let
|
|
1465
|
-
e[25] !== u ? (
|
|
1466
|
-
let
|
|
1467
|
-
e[27] !== c ? (
|
|
1500
|
+
} }) : null, e[21] = m, e[22] = s, e[23] = f, e[24] = A) : A = e[24];
|
|
1501
|
+
let O;
|
|
1502
|
+
e[25] !== u ? (O = /* @__PURE__ */ l(Qe, { isEditable: u }), e[25] = u, e[26] = O) : O = e[26];
|
|
1503
|
+
let L;
|
|
1504
|
+
e[27] !== c ? (L = c && /* @__PURE__ */ l(Ze, {}), e[27] = c, e[28] = L) : L = e[28];
|
|
1468
1505
|
let D;
|
|
1469
|
-
return e[29] !==
|
|
1470
|
-
|
|
1506
|
+
return e[29] !== y || e[30] !== T || e[31] !== $ || e[32] !== A || e[33] !== O || e[34] !== L || e[35] !== S ? (D = /* @__PURE__ */ l(fe, { className: "rich-text", "data-rich-message": "true", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "hidden", children: /* @__PURE__ */ F(ve, { initialConfig: y, children: [
|
|
1507
|
+
S,
|
|
1471
1508
|
N,
|
|
1472
1509
|
R,
|
|
1473
1510
|
b,
|
|
1474
|
-
|
|
1511
|
+
T,
|
|
1475
1512
|
E,
|
|
1476
|
-
O,
|
|
1477
|
-
L,
|
|
1478
|
-
M,
|
|
1479
1513
|
k,
|
|
1480
|
-
|
|
1514
|
+
P,
|
|
1515
|
+
M,
|
|
1481
1516
|
$,
|
|
1482
|
-
|
|
1483
|
-
|
|
1517
|
+
A,
|
|
1518
|
+
O,
|
|
1519
|
+
L
|
|
1520
|
+
] }) }), e[29] = y, e[30] = T, e[31] = $, e[32] = A, e[33] = O, e[34] = L, e[35] = S, e[36] = D) : D = e[36], D;
|
|
1484
1521
|
}
|
|
1485
|
-
function
|
|
1486
|
-
|
|
1522
|
+
function zr(n) {
|
|
1523
|
+
ze(tt(n), me, void 0, !1);
|
|
1487
1524
|
}
|
|
1488
|
-
function
|
|
1525
|
+
function qr(n) {
|
|
1489
1526
|
return console.error(n);
|
|
1490
1527
|
}
|
|
1491
1528
|
export {
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1529
|
+
So as $,
|
|
1530
|
+
Ln as C,
|
|
1531
|
+
To as D,
|
|
1532
|
+
hn as E,
|
|
1533
|
+
$n as I,
|
|
1534
|
+
Io as P,
|
|
1535
|
+
ko as R,
|
|
1536
|
+
Co as T,
|
|
1537
|
+
yo as a,
|
|
1538
|
+
Je as b,
|
|
1539
|
+
Ro as c,
|
|
1540
|
+
Qe as d,
|
|
1541
|
+
No as e,
|
|
1542
|
+
Ze as f,
|
|
1543
|
+
an as g,
|
|
1544
|
+
_r as h,
|
|
1545
|
+
ot as i,
|
|
1546
|
+
je as j,
|
|
1509
1547
|
tt as n,
|
|
1510
|
-
|
|
1548
|
+
Bn as s
|
|
1511
1549
|
};
|
|
1512
|
-
//# sourceMappingURL=rich-message-
|
|
1550
|
+
//# sourceMappingURL=rich-message-33DPxuWJ.js.map
|