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