@pstdio/ui 0.17.0 → 0.19.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-BCMQqPqu.js → MermaidComponent-BPiVFNYK.js} +2 -2
- package/dist/{MermaidComponent-BCMQqPqu.js.map → MermaidComponent-BPiVFNYK.js.map} +1 -1
- package/dist/chat-ui.js +941 -899
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/chat-ui/components/chat-message-list-items.d.ts +17 -0
- package/dist/components/chat-ui/components/message-types.d.ts +1 -0
- package/dist/components/chat-ui/components/timeline.d.ts +2 -0
- package/dist/components/chat-ui/tool-rendering/default-renderers.d.ts +1 -0
- package/dist/components/chat-ui/tool-rendering/shared.d.ts +3 -2
- package/dist/components/chat-ui/tool-rendering/standard-renderers.d.ts +1 -0
- package/dist/components/data-table/data-table-column-menu.d.ts +4 -1
- package/dist/components/data-table/data-table-header.d.ts +0 -8
- package/dist/components/data-table/data-table-skeleton.d.ts +13 -0
- package/dist/components/data-table/editable-cells-story.d.ts +9 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/diff-viewer/code-editor.d.ts +2 -0
- package/dist/components/diff-viewer/index.d.ts +1 -1
- package/dist/components/diff-viewer/monaco-browser.d.ts +1 -0
- package/dist/components/overlays/dialog-accept-shortcut.d.ts +12 -0
- package/dist/components/overlays/index.d.ts +1 -0
- package/dist/components/overlays/searchable-menu-input.d.ts +9 -0
- package/dist/components/param-editor/index.d.ts +7 -2
- package/dist/components/param-editor/inputs/action-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/boolean-input.d.ts +13 -0
- package/dist/components/param-editor/inputs/color-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/date-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/file-upload-input.d.ts +15 -0
- package/dist/components/param-editor/inputs/file-upload-value.d.ts +7 -0
- package/dist/components/param-editor/inputs/horizontal-text-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/markdown-input.d.ts +13 -0
- package/dist/components/param-editor/inputs/number-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/range-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/resource-input.d.ts +2 -0
- package/dist/components/param-editor/inputs/segmented-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/selection-input.d.ts +6 -0
- package/dist/components/param-editor/inputs/selection-menu.d.ts +10 -0
- package/dist/components/param-editor/inputs/text-input.d.ts +1 -0
- package/dist/components/param-editor/param-editor-advanced-field.d.ts +14 -0
- package/dist/components/param-editor/param-editor-control-fixtures.d.ts +24 -0
- package/dist/components/param-editor/param-editor-field.d.ts +2 -0
- package/dist/components/param-editor/param-editor-horizontal.d.ts +2 -2
- package/dist/components/param-editor/param-editor-label.d.ts +1 -0
- package/dist/components/param-editor/param-editor-presentation.d.ts +3 -0
- package/dist/components/param-editor/param-editor-row.d.ts +17 -0
- package/dist/components/param-editor/param-editor.types.d.ts +43 -13
- package/dist/components/param-editor/resolve-param-value.d.ts +2 -0
- package/dist/components/primitives/chip.d.ts +4 -0
- package/dist/components/primitives/glyph-icon.d.ts +16 -0
- package/dist/components/primitives/icon-color-picker.d.ts +3 -13
- package/dist/components/primitives/icon-options.d.ts +301 -0
- package/dist/components/primitives/index.d.ts +12 -3
- package/dist/components/primitives/resource-badge.d.ts +12 -10
- package/dist/components/primitives/segmented-control.d.ts +20 -0
- package/dist/components/primitives/tag-swatch.d.ts +10 -0
- package/dist/components/rich-text/index.d.ts +1 -0
- package/dist/components/rich-text/lazy-markdown-editor.d.ts +2 -0
- package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
- package/dist/components/tag-editor/index.d.ts +4 -0
- package/dist/components/tag-editor/tag-editor-heading.d.ts +11 -0
- package/dist/components/tag-editor/tag-editor-row.d.ts +1 -1
- package/dist/components/tag-editor/tag-editor-save-bar.d.ts +13 -0
- package/dist/components/tag-editor/tag-editor.types.d.ts +11 -11
- package/dist/components/tag-editor/tag-settings-panel.d.ts +3 -1
- package/dist/data-table.js +1018 -926
- package/dist/data-table.js.map +1 -1
- package/dist/dialog-accept-shortcut-DAEBsoWW.js +7 -0
- package/dist/dialog-accept-shortcut-DAEBsoWW.js.map +1 -0
- package/dist/diff.js +370 -366
- package/dist/diff.js.map +1 -1
- package/dist/font/css/prompt-studio-icons.css +720 -0
- package/dist/font/prompt-studio-icons.eot +0 -0
- package/dist/font/prompt-studio-icons.svg +1 -0
- package/dist/font/prompt-studio-icons.ttf +0 -0
- package/dist/font/prompt-studio-icons.woff +0 -0
- package/dist/font/prompt-studio-icons.woff2 +0 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1958 -1744
- package/dist/index.js.map +1 -1
- package/dist/{kanban-renderer-toolbar-B9ro-9z1.js → kanban-renderer-toolbar-Bcj_N1qr.js} +66 -66
- package/dist/kanban-renderer-toolbar-Bcj_N1qr.js.map +1 -0
- package/dist/kanban-renderer.js +834 -817
- package/dist/kanban-renderer.js.map +1 -1
- package/dist/lazy-markdown-editor-DwhqQ-NN.js +26 -0
- package/dist/lazy-markdown-editor-DwhqQ-NN.js.map +1 -0
- package/dist/list-row-BtoVJpFs.js +821 -0
- package/dist/list-row-BtoVJpFs.js.map +1 -0
- package/dist/markdown-DDd2ESoH.js +743 -0
- package/dist/markdown-DDd2ESoH.js.map +1 -0
- package/dist/markdown-editor-CYVkzt8t.js +741 -0
- package/dist/markdown-editor-CYVkzt8t.js.map +1 -0
- package/dist/monaco-browser-CO0NxK_Z.js +19 -0
- package/dist/monaco-browser-CO0NxK_Z.js.map +1 -0
- package/dist/param-editor-XRjSu6MT.js +161 -0
- package/dist/param-editor-XRjSu6MT.js.map +1 -0
- package/dist/param-editor-field-B9lEPq8c.js +3028 -0
- package/dist/param-editor-field-B9lEPq8c.js.map +1 -0
- package/dist/resource-badge-CuItchgL.js +98 -0
- package/dist/resource-badge-CuItchgL.js.map +1 -0
- package/dist/rich-message--eRzjWYK.js +730 -0
- package/dist/rich-message--eRzjWYK.js.map +1 -0
- package/dist/rich-text.js +114 -827
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/primitives/fonts.d.ts +3 -0
- package/dist/theme/primitives/sizes.d.ts +59 -0
- package/dist/theme/recipes/badge.d.ts +8 -0
- package/dist/theme/recipes/color-picker.d.ts +18 -1
- package/dist/theme/recipes/segmented-control.d.ts +22 -0
- package/dist/theme/recipes/switch.d.ts +18 -0
- package/dist/theme/recipes/tabs.d.ts +11 -0
- package/dist/{theme-CNhnbvcE.js → theme-7PDdD9OD.js} +403 -195
- package/dist/theme-7PDdD9OD.js.map +1 -0
- package/dist/theme.js +1 -1
- package/dist/{tree-list-CZHLAURU.js → tree-list-B2L0cTj2.js} +2 -2
- package/dist/{tree-list-CZHLAURU.js.map → tree-list-B2L0cTj2.js.map} +1 -1
- package/package.json +3 -2
- package/dist/components/param-editor/inputs/file-accept.d.ts +0 -22
- package/dist/components/param-editor/inputs/file-drop-input.d.ts +0 -14
- package/dist/kanban-renderer-toolbar-B9ro-9z1.js.map +0 -1
- package/dist/list-row-YRUxEcy3.js +0 -808
- package/dist/list-row-YRUxEcy3.js.map +0 -1
- package/dist/param-editor-CYZJbmKu.js +0 -933
- package/dist/param-editor-CYZJbmKu.js.map +0 -1
- package/dist/param-editor-read-only-field-DgtLqcFa.js +0 -925
- package/dist/param-editor-read-only-field-DgtLqcFa.js.map +0 -1
- package/dist/prism-BXb57lxL.js +0 -125
- package/dist/prism-BXb57lxL.js.map +0 -1
- package/dist/resource-badge-qCWHP-wQ.js +0 -99
- package/dist/resource-badge-qCWHP-wQ.js.map +0 -1
- package/dist/rich-message-DBf_5YlW.js +0 -1450
- package/dist/rich-message-DBf_5YlW.js.map +0 -1
- package/dist/theme-CNhnbvcE.js.map +0 -1
|
@@ -0,0 +1,743 @@
|
|
|
1
|
+
import { jsx as l, jsxs as X } from "react/jsx-runtime";
|
|
2
|
+
import { c as y } from "react/compiler-runtime";
|
|
3
|
+
import { chakra as ae, Box as k, Table as N, Text as O, Textarea as le } from "@chakra-ui/react";
|
|
4
|
+
import { ContentEditable as ce } from "@lexical/react/LexicalContentEditable";
|
|
5
|
+
import { S as H } from "./scroll-area-BMbg1WcD.js";
|
|
6
|
+
import { LinkNode as Q, AutoLinkNode as Y, $createLinkNode as de, $isLinkNode as ue, $isAutoLinkNode as Z, $createAutoLinkNode as _e } from "@lexical/link";
|
|
7
|
+
import { ListNode as he, ListItemNode as pe } from "@lexical/list";
|
|
8
|
+
import { CHECK_LIST as me, TRANSFORMERS as fe, LINK as ge } from "@lexical/markdown";
|
|
9
|
+
import { QuoteNode as xe, HeadingNode as be } from "@lexical/rich-text";
|
|
10
|
+
import { CodeNode as ee, CodeHighlightNode as ke, registerCodeHighlighting as Ee } from "@lexical/code";
|
|
11
|
+
import { DecoratorNode as M, $applyNodeReplacement as Ne, ElementNode as Te, TextNode as F, $createTextNode as q, $nodesOfType as ye } from "lexical";
|
|
12
|
+
import $e from "katex";
|
|
13
|
+
import * as Ce from "react";
|
|
14
|
+
import { Suspense as te, lazy as Se, useEffect as j } from "react";
|
|
15
|
+
import { R as we } from "./resource-badge-CuItchgL.js";
|
|
16
|
+
import { useLexicalComposerContext as P } from "@lexical/react/LexicalComposerContext";
|
|
17
|
+
import { TreeView as Re } from "@lexical/react/LexicalTreeView";
|
|
18
|
+
const Ie = ae(ce);
|
|
19
|
+
function Ct(t) {
|
|
20
|
+
const e = y(11), {
|
|
21
|
+
onRef: n,
|
|
22
|
+
fullWidth: r,
|
|
23
|
+
padding: i,
|
|
24
|
+
isRichMessage: o,
|
|
25
|
+
scrollable: s
|
|
26
|
+
} = t, a = r === void 0 ? !1 : r, c = o === void 0 ? !1 : o, h = s === void 0 ? !0 : s, _ = a ? "100%" : "45rem", m = a ? "0" : "auto";
|
|
27
|
+
let d;
|
|
28
|
+
e[0] !== _ || e[1] !== m ? (d = /* @__PURE__ */ l(Ie, { "data-testid": "content-editable", height: "fit-content", minH: "100%", width: "100%", maxWidth: _, marginInline: m, textStyle: "paragraph/M/regular", fontSize: "calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale))", position: "relative", outline: "none" }), e[0] = _, e[1] = m, e[2] = d) : d = e[2];
|
|
29
|
+
let u;
|
|
30
|
+
e[3] !== n || e[4] !== i || e[5] !== d ? (u = /* @__PURE__ */ l(k, { ref: n, width: "100%", minH: "100%", padding: i, children: d }), e[3] = n, e[4] = i, e[5] = d, e[6] = u) : u = e[6];
|
|
31
|
+
const p = u;
|
|
32
|
+
if (!h)
|
|
33
|
+
return p;
|
|
34
|
+
const x = c ? "true" : void 0;
|
|
35
|
+
let b;
|
|
36
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = {
|
|
37
|
+
width: "100%",
|
|
38
|
+
minH: "100%"
|
|
39
|
+
}, e[7] = b) : b = e[7];
|
|
40
|
+
let f;
|
|
41
|
+
return e[8] !== p || e[9] !== x ? (f = /* @__PURE__ */ l(H, { className: "rich-text", "data-rich-message": x, height: "100%", minH: "0", position: "relative", contentProps: b, children: p }), e[8] = p, e[9] = x, e[10] = f) : f = e[10], f;
|
|
42
|
+
}
|
|
43
|
+
class T extends M {
|
|
44
|
+
__href;
|
|
45
|
+
__label;
|
|
46
|
+
static getType() {
|
|
47
|
+
return "reference-link";
|
|
48
|
+
}
|
|
49
|
+
static clone(e) {
|
|
50
|
+
return new T(e.__href, e.__label, e.__key);
|
|
51
|
+
}
|
|
52
|
+
constructor(e, n, r) {
|
|
53
|
+
super(r), this.__href = e, this.__label = n;
|
|
54
|
+
}
|
|
55
|
+
createDOM(e, n) {
|
|
56
|
+
return document.createElement("span");
|
|
57
|
+
}
|
|
58
|
+
updateDOM(e, n, r) {
|
|
59
|
+
return !1;
|
|
60
|
+
}
|
|
61
|
+
getTextContent() {
|
|
62
|
+
return `{{link('${this.__label ?? this.__href}')}}`;
|
|
63
|
+
}
|
|
64
|
+
exportJSON() {
|
|
65
|
+
return {
|
|
66
|
+
type: T.getType(),
|
|
67
|
+
version: 1,
|
|
68
|
+
href: this.__href,
|
|
69
|
+
label: this.__label
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
static importJSON(e) {
|
|
73
|
+
return ne(e.href, e.label);
|
|
74
|
+
}
|
|
75
|
+
decorate(e, n) {
|
|
76
|
+
const r = this.__href, o = r.split("/").pop() || "unknown", s = /^https?:\/\//i.test(r), a = /^#?\$PROJECT\//i.test(r);
|
|
77
|
+
return /* @__PURE__ */ l(k, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ l(we, { fileName: o, onSelect: () => {
|
|
78
|
+
if (s)
|
|
79
|
+
window.open(r, "_blank", "noopener,noreferrer");
|
|
80
|
+
else if (a) {
|
|
81
|
+
const c = r.replace(/^#?\$PROJECT\//i, ""), h = new CustomEvent("ui:open-project-file", {
|
|
82
|
+
detail: c
|
|
83
|
+
});
|
|
84
|
+
window.dispatchEvent(h);
|
|
85
|
+
} else
|
|
86
|
+
window.location.assign(r);
|
|
87
|
+
} }) });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function ne(t, e) {
|
|
91
|
+
return new T(t, e);
|
|
92
|
+
}
|
|
93
|
+
function ve(t) {
|
|
94
|
+
return t instanceof T;
|
|
95
|
+
}
|
|
96
|
+
const U = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, Le = {
|
|
97
|
+
dependencies: [T],
|
|
98
|
+
export: (t) => {
|
|
99
|
+
if (ve(t)) {
|
|
100
|
+
const e = t.__href, n = t.__label ?? e;
|
|
101
|
+
return n ? `{{link('${n}')}}` : `{{link('${e}')}}`;
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
},
|
|
105
|
+
regExp: U,
|
|
106
|
+
importRegExp: U,
|
|
107
|
+
replace: (t, e) => {
|
|
108
|
+
const n = e[2], i = /^(https?:\/\/|\/)/i.test(n) ? n : `#${n}`, o = n;
|
|
109
|
+
t.replace(ne(i, o));
|
|
110
|
+
},
|
|
111
|
+
type: "text-match"
|
|
112
|
+
}, Oe = {
|
|
113
|
+
code: "rich-text__code",
|
|
114
|
+
codeHighlight: {
|
|
115
|
+
atrule: "rich-text__tokenAttr",
|
|
116
|
+
attr: "rich-text__tokenAttr",
|
|
117
|
+
boolean: "rich-text__tokenProperty",
|
|
118
|
+
builtin: "rich-text__tokenSelector",
|
|
119
|
+
cdata: "rich-text__tokenComment",
|
|
120
|
+
char: "rich-text__tokenSelector",
|
|
121
|
+
class: "rich-text__tokenFunction",
|
|
122
|
+
"class-name": "rich-text__tokenFunction",
|
|
123
|
+
comment: "rich-text__tokenComment",
|
|
124
|
+
constant: "rich-text__tokenProperty",
|
|
125
|
+
deleted: "rich-text__tokenProperty",
|
|
126
|
+
doctype: "rich-text__tokenComment",
|
|
127
|
+
entity: "rich-text__tokenOperator",
|
|
128
|
+
function: "rich-text__tokenFunction",
|
|
129
|
+
important: "rich-text__tokenVariable",
|
|
130
|
+
inserted: "rich-text__tokenSelector",
|
|
131
|
+
keyword: "rich-text__tokenAttr",
|
|
132
|
+
namespace: "rich-text__tokenVariable",
|
|
133
|
+
number: "rich-text__tokenProperty",
|
|
134
|
+
operator: "rich-text__tokenOperator",
|
|
135
|
+
prolog: "rich-text__tokenComment",
|
|
136
|
+
property: "rich-text__tokenProperty",
|
|
137
|
+
punctuation: "rich-text__tokenPunctuation",
|
|
138
|
+
regex: "rich-text__tokenVariable",
|
|
139
|
+
selector: "rich-text__tokenSelector",
|
|
140
|
+
string: "rich-text__tokenSelector",
|
|
141
|
+
symbol: "rich-text__tokenProperty",
|
|
142
|
+
tag: "rich-text__tokenProperty",
|
|
143
|
+
url: "rich-text__tokenOperator",
|
|
144
|
+
variable: "rich-text__tokenVariable"
|
|
145
|
+
},
|
|
146
|
+
embedBlock: {
|
|
147
|
+
base: "rich-text__embedBlock",
|
|
148
|
+
focus: "rich-text__embedBlockFocus"
|
|
149
|
+
},
|
|
150
|
+
list: {
|
|
151
|
+
checklist: "rich-text__checklist",
|
|
152
|
+
listitem: "rich-text__listItem",
|
|
153
|
+
listitemChecked: "rich-text__listItemChecked",
|
|
154
|
+
listitemUnchecked: "rich-text__listItemUnchecked",
|
|
155
|
+
nested: {
|
|
156
|
+
listitem: "rich-text__nestedListItem"
|
|
157
|
+
},
|
|
158
|
+
olDepth: ["rich-text__ol1", "rich-text__ol2", "rich-text__ol3", "rich-text__ol4", "rich-text__ol5"],
|
|
159
|
+
ol: "rich-text__ol",
|
|
160
|
+
ul: "rich-text__ul"
|
|
161
|
+
},
|
|
162
|
+
heading: {
|
|
163
|
+
h1: "rich-text__h1",
|
|
164
|
+
h2: "rich-text__h2",
|
|
165
|
+
h3: "rich-text__h3"
|
|
166
|
+
},
|
|
167
|
+
paragraph: "rich-text__p",
|
|
168
|
+
text: {
|
|
169
|
+
underline: "rich-text__textUnderline",
|
|
170
|
+
italic: "rich-text__textItalic",
|
|
171
|
+
code: "rich-text__textCode"
|
|
172
|
+
},
|
|
173
|
+
link: "rich-text__link",
|
|
174
|
+
quote: "rich-text__quote",
|
|
175
|
+
reference: "rich-text__reference",
|
|
176
|
+
table: "rich-text__table",
|
|
177
|
+
tableCell: "rich-text__tableCell",
|
|
178
|
+
tableRow: "rich-text__tableRow",
|
|
179
|
+
tableCellHeader: "rich-text__tableCellHeader",
|
|
180
|
+
layoutContainer: "rich-text__layoutContainer",
|
|
181
|
+
layoutItem: "rich-text__layoutItem",
|
|
182
|
+
draggableBlockDemo: {
|
|
183
|
+
row: "rich-text__row",
|
|
184
|
+
content: "rich-text__content"
|
|
185
|
+
}
|
|
186
|
+
}, D = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", qe = (t) => t == null ? "-" : typeof t == "string" ? t.length ? t : "-" : typeof t == "number" || typeof t == "boolean" ? String(t).toUpperCase() : t instanceof Date ? t.toISOString() : JSON.stringify(t), St = (t) => {
|
|
187
|
+
const e = y(8), {
|
|
188
|
+
defaultCode: n,
|
|
189
|
+
isEditable: r,
|
|
190
|
+
showLineNumbers: i,
|
|
191
|
+
disableScroll: o
|
|
192
|
+
} = t, s = n === void 0 ? "" : n, a = r === void 0 ? !1 : r, c = i === void 0 ? !1 : i, h = o === void 0 ? !1 : o;
|
|
193
|
+
if (a) {
|
|
194
|
+
let u;
|
|
195
|
+
return e[0] !== s ? (u = /* @__PURE__ */ l(le, { defaultValue: s, fontFamily: "mono", fontSize: D, resize: "vertical", minHeight: "100%" }), e[0] = s, e[1] = u) : u = e[1], u;
|
|
196
|
+
}
|
|
197
|
+
let _;
|
|
198
|
+
if (e[2] !== s || e[3] !== h || e[4] !== c) {
|
|
199
|
+
const u = c ? s.split(`
|
|
200
|
+
`) : [s];
|
|
201
|
+
_ = /* @__PURE__ */ l(k, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: D, lineHeight: "1.5", background: "bg.code", borderRadius: "md", width: "100%", overflowY: h ? "hidden" : void 0, children: c ? /* @__PURE__ */ l(k, { as: "code", display: "grid", gridTemplateColumns: "auto 1fr", columnGap: "sm", children: u.map(Ae) }) : /* @__PURE__ */ l(k, { as: "code", children: s }) }), e[2] = s, e[3] = h, e[4] = c, e[5] = _;
|
|
202
|
+
} else
|
|
203
|
+
_ = e[5];
|
|
204
|
+
const m = _;
|
|
205
|
+
if (h)
|
|
206
|
+
return m;
|
|
207
|
+
let d;
|
|
208
|
+
return e[6] !== m ? (d = /* @__PURE__ */ l(H, { width: "100%", background: "bg.code", borderRadius: "md", showHorizontalScrollbar: !0, children: m }), e[6] = m, e[7] = d) : d = e[7], d;
|
|
209
|
+
}, De = (t) => {
|
|
210
|
+
const e = y(26), {
|
|
211
|
+
data: n,
|
|
212
|
+
fullWidth: r,
|
|
213
|
+
noBorder: i,
|
|
214
|
+
hiddenColumns: o
|
|
215
|
+
} = t, s = r === void 0 ? !1 : r, a = i === void 0 ? !1 : i;
|
|
216
|
+
let c;
|
|
217
|
+
e[0] !== o ? (c = o === void 0 ? [] : o, e[0] = o, e[1] = c) : c = e[1];
|
|
218
|
+
const h = c;
|
|
219
|
+
if (!n.length) {
|
|
220
|
+
const g = a ? "0" : "1px";
|
|
221
|
+
let w;
|
|
222
|
+
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ l(O, { textStyle: "label/S/regular", fontSize: D, color: "fg.muted", children: "No data" }), e[2] = w) : w = e[2];
|
|
223
|
+
let E;
|
|
224
|
+
return e[3] !== g ? (E = /* @__PURE__ */ l(k, { padding: "sm", borderWidth: g, borderColor: "border.subtle", children: w }), e[3] = g, e[4] = E) : E = e[4], E;
|
|
225
|
+
}
|
|
226
|
+
let _;
|
|
227
|
+
e[5] !== h ? (_ = new Set(h), e[5] = h, e[6] = _) : _ = e[6];
|
|
228
|
+
const m = _;
|
|
229
|
+
let d;
|
|
230
|
+
e[7] !== n[0] ? (d = Object.keys(n[0] ?? {}), e[7] = n[0], e[8] = d) : d = e[8];
|
|
231
|
+
let u;
|
|
232
|
+
e[9] !== m || e[10] !== d ? (u = d.filter((g) => !m.has(g)), e[9] = m, e[10] = d, e[11] = u) : u = e[11];
|
|
233
|
+
const p = u, x = s ? "100%" : "fit-content", b = a ? "0" : "1px";
|
|
234
|
+
let f;
|
|
235
|
+
e[12] !== p ? (f = /* @__PURE__ */ l(N.Header, { children: /* @__PURE__ */ l(N.Row, { background: "bg.muted", children: p.map(Me) }) }), e[12] = p, e[13] = f) : f = e[13];
|
|
236
|
+
let C;
|
|
237
|
+
if (e[14] !== p || e[15] !== n) {
|
|
238
|
+
let g;
|
|
239
|
+
e[17] !== p ? (g = (w, E) => /* @__PURE__ */ l(N.Row, { children: p.map((B) => /* @__PURE__ */ l(N.Cell, { paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(O, { textStyle: "paragraph/S/regular", fontSize: D, children: qe(w[B]) }) }, `${E}-${B}`)) }, `${E}-${p.join("-")}`), e[17] = p, e[18] = g) : g = e[18], C = n.map(g), e[14] = p, e[15] = n, e[16] = C;
|
|
240
|
+
} else
|
|
241
|
+
C = e[16];
|
|
242
|
+
let S;
|
|
243
|
+
e[19] !== C ? (S = /* @__PURE__ */ l(N.Body, { children: C }), e[19] = C, e[20] = S) : S = e[20];
|
|
244
|
+
let A;
|
|
245
|
+
return e[21] !== S || e[22] !== x || e[23] !== b || e[24] !== f ? (A = /* @__PURE__ */ l(H, { maxWidth: "100%", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ X(N.Root, { size: "sm", width: x, borderWidth: b, borderColor: "border.subtle", children: [
|
|
246
|
+
f,
|
|
247
|
+
S
|
|
248
|
+
] }) }), e[21] = S, e[22] = x, e[23] = b, e[24] = f, e[25] = A) : A = e[25], A;
|
|
249
|
+
};
|
|
250
|
+
function Ae(t, e) {
|
|
251
|
+
return /* @__PURE__ */ X(k, { as: "span", display: "contents", children: [
|
|
252
|
+
/* @__PURE__ */ l(O, { as: "span", color: "fg.muted", textAlign: "right", fontSize: "inherit", children: e + 1 }),
|
|
253
|
+
/* @__PURE__ */ l(O, { as: "span", fontSize: "inherit", children: t.length ? t : " " })
|
|
254
|
+
] }, `${e}-${t}`);
|
|
255
|
+
}
|
|
256
|
+
function Me(t) {
|
|
257
|
+
return /* @__PURE__ */ l(N.ColumnHeader, { textTransform: "none", paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(O, { textStyle: "label/S/medium", fontSize: D, children: t }) }, t);
|
|
258
|
+
}
|
|
259
|
+
class R extends M {
|
|
260
|
+
__data;
|
|
261
|
+
static getType() {
|
|
262
|
+
return "data_table";
|
|
263
|
+
}
|
|
264
|
+
static clone(e) {
|
|
265
|
+
return new R(e.__data, e.__key);
|
|
266
|
+
}
|
|
267
|
+
constructor(e, n) {
|
|
268
|
+
super(n), this.__data = e;
|
|
269
|
+
}
|
|
270
|
+
getData() {
|
|
271
|
+
return this.__data;
|
|
272
|
+
}
|
|
273
|
+
createDOM() {
|
|
274
|
+
return document.createElement("div");
|
|
275
|
+
}
|
|
276
|
+
updateDOM() {
|
|
277
|
+
return !1;
|
|
278
|
+
}
|
|
279
|
+
decorate() {
|
|
280
|
+
return /* @__PURE__ */ l(De, { fullWidth: !0, isReadOnly: !0, data: this.__data });
|
|
281
|
+
}
|
|
282
|
+
exportJSON() {
|
|
283
|
+
return {
|
|
284
|
+
type: "data_table",
|
|
285
|
+
version: 1,
|
|
286
|
+
data: this.__data
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
static importJSON(e) {
|
|
290
|
+
return new R(e.data);
|
|
291
|
+
}
|
|
292
|
+
getTextContent() {
|
|
293
|
+
if (!this.__data.length) return "";
|
|
294
|
+
const e = Object.keys(this.__data[0]), n = e.join(" | "), r = e.map(() => "---").join(" | "), i = this.__data.map((o) => e.map((s) => String(o[s] || "")).join(" | "));
|
|
295
|
+
return [n, r, ...i].join(`
|
|
296
|
+
`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function J(t) {
|
|
300
|
+
return new R(t);
|
|
301
|
+
}
|
|
302
|
+
function V(t) {
|
|
303
|
+
return t instanceof R;
|
|
304
|
+
}
|
|
305
|
+
const Pe = Ce.lazy(() => import("./EquationComponent-DeDYHvqY.js"));
|
|
306
|
+
function K(t) {
|
|
307
|
+
let e = t.getAttribute("data-lexical-equation");
|
|
308
|
+
const n = t.getAttribute("data-lexical-inline") === "true";
|
|
309
|
+
return e = atob(e || ""), e ? {
|
|
310
|
+
node: z(e, n)
|
|
311
|
+
} : null;
|
|
312
|
+
}
|
|
313
|
+
class $ extends M {
|
|
314
|
+
__equation;
|
|
315
|
+
__inline;
|
|
316
|
+
static getType() {
|
|
317
|
+
return "equation";
|
|
318
|
+
}
|
|
319
|
+
static clone(e) {
|
|
320
|
+
return new $(e.__equation, e.__inline, e.__key);
|
|
321
|
+
}
|
|
322
|
+
constructor(e, n, r) {
|
|
323
|
+
super(r), this.__equation = e, this.__inline = n ?? !1;
|
|
324
|
+
}
|
|
325
|
+
static importJSON(e) {
|
|
326
|
+
return z(e.equation, e.inline);
|
|
327
|
+
}
|
|
328
|
+
exportJSON() {
|
|
329
|
+
return {
|
|
330
|
+
equation: this.getEquation(),
|
|
331
|
+
inline: this.__inline,
|
|
332
|
+
type: "equation",
|
|
333
|
+
version: 1
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
createDOM(e) {
|
|
337
|
+
const n = document.createElement(this.__inline ? "span" : "div");
|
|
338
|
+
return n.className = "editor-equation", n;
|
|
339
|
+
}
|
|
340
|
+
exportDOM() {
|
|
341
|
+
const e = document.createElement(this.__inline ? "span" : "div"), n = btoa(this.__equation);
|
|
342
|
+
return e.setAttribute("data-lexical-equation", n), e.setAttribute("data-lexical-inline", `${this.__inline}`), $e.render(this.__equation, e, {
|
|
343
|
+
displayMode: !this.__inline,
|
|
344
|
+
// true === block display //
|
|
345
|
+
errorColor: "#cc0000",
|
|
346
|
+
output: "html",
|
|
347
|
+
strict: "warn",
|
|
348
|
+
throwOnError: !1,
|
|
349
|
+
trust: !1
|
|
350
|
+
}), {
|
|
351
|
+
element: e
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
static importDOM() {
|
|
355
|
+
return {
|
|
356
|
+
div: (e) => e.hasAttribute("data-lexical-equation") ? {
|
|
357
|
+
conversion: K,
|
|
358
|
+
priority: 2
|
|
359
|
+
} : null,
|
|
360
|
+
span: (e) => e.hasAttribute("data-lexical-equation") ? {
|
|
361
|
+
conversion: K,
|
|
362
|
+
priority: 1
|
|
363
|
+
} : null
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
updateDOM(e) {
|
|
367
|
+
return this.__inline !== e.__inline;
|
|
368
|
+
}
|
|
369
|
+
getTextContent() {
|
|
370
|
+
return this.__equation;
|
|
371
|
+
}
|
|
372
|
+
getEquation() {
|
|
373
|
+
return this.__equation;
|
|
374
|
+
}
|
|
375
|
+
setEquation(e) {
|
|
376
|
+
const n = this.getWritable();
|
|
377
|
+
n.__equation = e;
|
|
378
|
+
}
|
|
379
|
+
isInline() {
|
|
380
|
+
return this.__inline;
|
|
381
|
+
}
|
|
382
|
+
decorate() {
|
|
383
|
+
return /* @__PURE__ */ l(te, { fallback: null, children: /* @__PURE__ */ l(Pe, { equation: this.__equation, inline: this.__inline }) });
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function z(t = "", e = !1) {
|
|
387
|
+
const n = new $(t, e);
|
|
388
|
+
return Ne(n);
|
|
389
|
+
}
|
|
390
|
+
function re(t) {
|
|
391
|
+
return t instanceof $;
|
|
392
|
+
}
|
|
393
|
+
const ze = {
|
|
394
|
+
dependencies: [$],
|
|
395
|
+
export: (t) => re(t) && t.isInline() ? `\\( ${t.getEquation().trim()} \\)` : null,
|
|
396
|
+
importRegExp: /\\\((.*?)\\\)/,
|
|
397
|
+
regExp: /\\\((.*?)\\\)/,
|
|
398
|
+
replace: (t, e) => {
|
|
399
|
+
const n = z(e[1].trim(), !0);
|
|
400
|
+
t.replace(n);
|
|
401
|
+
},
|
|
402
|
+
type: "text-match"
|
|
403
|
+
}, Fe = {
|
|
404
|
+
dependencies: [$],
|
|
405
|
+
regExpStart: /\\\[/,
|
|
406
|
+
regExpEnd: /\\]/,
|
|
407
|
+
export: (t) => re(t) && !t.isInline() ? `\\[ ${t.getEquation().trim()} \\]` : null,
|
|
408
|
+
replace: (t, e, n, r, i) => i ? (t.append(z(i.join(" "), !1)), !0) : !1,
|
|
409
|
+
type: "multiline-element"
|
|
410
|
+
};
|
|
411
|
+
function wt() {
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
class v extends Te {
|
|
415
|
+
static getType() {
|
|
416
|
+
return "hr";
|
|
417
|
+
}
|
|
418
|
+
static clone(e) {
|
|
419
|
+
return new v(e?.__key);
|
|
420
|
+
}
|
|
421
|
+
static importJSON(e) {
|
|
422
|
+
return ie();
|
|
423
|
+
}
|
|
424
|
+
exportJSON() {
|
|
425
|
+
return {
|
|
426
|
+
...super.exportJSON()
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
createDOM(e, n) {
|
|
430
|
+
const r = document.createElement("hr");
|
|
431
|
+
return r.style = "margin: 2rem 0;", r;
|
|
432
|
+
}
|
|
433
|
+
updateDOM(e, n, r) {
|
|
434
|
+
return !1;
|
|
435
|
+
}
|
|
436
|
+
decorate(e) {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
function ie() {
|
|
441
|
+
return new v();
|
|
442
|
+
}
|
|
443
|
+
function We(t) {
|
|
444
|
+
return t instanceof v;
|
|
445
|
+
}
|
|
446
|
+
const He = Se(() => import("./MermaidComponent-BPiVFNYK.js"));
|
|
447
|
+
class I extends M {
|
|
448
|
+
__code;
|
|
449
|
+
static getType() {
|
|
450
|
+
return "mermaid";
|
|
451
|
+
}
|
|
452
|
+
static clone(e) {
|
|
453
|
+
return new I(e.__code, e.__key);
|
|
454
|
+
}
|
|
455
|
+
constructor(e, n) {
|
|
456
|
+
super(n), this.__code = e;
|
|
457
|
+
}
|
|
458
|
+
createDOM() {
|
|
459
|
+
return document.createElement("div");
|
|
460
|
+
}
|
|
461
|
+
updateDOM() {
|
|
462
|
+
return !1;
|
|
463
|
+
}
|
|
464
|
+
static importJSON(e) {
|
|
465
|
+
return new I(e.code);
|
|
466
|
+
}
|
|
467
|
+
exportJSON() {
|
|
468
|
+
return {
|
|
469
|
+
type: "mermaid",
|
|
470
|
+
code: this.__code,
|
|
471
|
+
version: 1
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
getTextContent() {
|
|
475
|
+
return `\`\`\`mermaid
|
|
476
|
+
${this.__code}
|
|
477
|
+
\`\`\``;
|
|
478
|
+
}
|
|
479
|
+
getCode() {
|
|
480
|
+
return this.__code;
|
|
481
|
+
}
|
|
482
|
+
setCode(e) {
|
|
483
|
+
const n = this.getWritable();
|
|
484
|
+
n.__code = e;
|
|
485
|
+
}
|
|
486
|
+
decorate() {
|
|
487
|
+
return /* @__PURE__ */ l(te, { fallback: null, children: /* @__PURE__ */ l(He, { code: this.__code, nodeKey: this.__key }) });
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
function Rt(t) {
|
|
491
|
+
return t instanceof I;
|
|
492
|
+
}
|
|
493
|
+
const je = {
|
|
494
|
+
dependencies: [v],
|
|
495
|
+
export: (t) => We(t) ? "***" : null,
|
|
496
|
+
regExp: /^(---|\*\*\*|___)\s?$/,
|
|
497
|
+
replace: (t) => {
|
|
498
|
+
const e = ie();
|
|
499
|
+
t.replace(e);
|
|
500
|
+
},
|
|
501
|
+
type: "element"
|
|
502
|
+
}, Be = {
|
|
503
|
+
dependencies: [],
|
|
504
|
+
export: (t, e) => {
|
|
505
|
+
if (V(t)) {
|
|
506
|
+
const n = t.getData();
|
|
507
|
+
if (!n.length) return "";
|
|
508
|
+
const r = Object.keys(n[0]), i = r.join(" | "), o = r.map(() => "---").join(" | "), s = n.map((a) => r.map((c) => String(a[c] || "")).join(" | "));
|
|
509
|
+
return [`| ${i} |`, `| ${o} |`, ...s.map((a) => `| ${a} |`)].join(`
|
|
510
|
+
`);
|
|
511
|
+
}
|
|
512
|
+
return null;
|
|
513
|
+
},
|
|
514
|
+
regExp: /^\s*(\|.+\|)\s*$/,
|
|
515
|
+
replace: (t, e, n, r) => {
|
|
516
|
+
const i = t.getPreviousSibling();
|
|
517
|
+
if (/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/gm.test(n[0])) {
|
|
518
|
+
t.remove();
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
const s = n[0].split("|").slice(1, -1).map((a) => a.trim());
|
|
522
|
+
if (i?.getType() === "data_table" && V(i)) {
|
|
523
|
+
const a = i.getData(), c = {}, h = a.length === 1 && Object.values(a[0]).every((u) => u === ""), _ = a.length > 0 ? Object.keys(a[0]) : s.map((u, p) => `col_${p}`);
|
|
524
|
+
s.forEach((u, p) => {
|
|
525
|
+
const x = _[p] || `col_${p}`;
|
|
526
|
+
c[x] = u;
|
|
527
|
+
});
|
|
528
|
+
const m = h ? [c] : [...a, c], d = J(m);
|
|
529
|
+
i.replace(d), t.remove();
|
|
530
|
+
} else {
|
|
531
|
+
const a = {};
|
|
532
|
+
s.forEach((h, _) => {
|
|
533
|
+
a[h || `col_${_}`] = "";
|
|
534
|
+
});
|
|
535
|
+
const c = J([a]);
|
|
536
|
+
t.replace(c);
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
type: "element"
|
|
540
|
+
}, Ue = {
|
|
541
|
+
dependencies: [F],
|
|
542
|
+
export: (t, e) => {
|
|
543
|
+
if (t instanceof F) {
|
|
544
|
+
let n = t.getTextContent();
|
|
545
|
+
if (t.hasFormat("bold"))
|
|
546
|
+
n = `**${n}**`;
|
|
547
|
+
else if (t.hasFormat("italic"))
|
|
548
|
+
n = `*${n}*`;
|
|
549
|
+
else if (t.hasFormat("underline"))
|
|
550
|
+
n = `<ins>${n}</ins>`;
|
|
551
|
+
else
|
|
552
|
+
return null;
|
|
553
|
+
return n;
|
|
554
|
+
}
|
|
555
|
+
return null;
|
|
556
|
+
},
|
|
557
|
+
regExp: /<ins>(.*)<\/ins>/,
|
|
558
|
+
importRegExp: /<ins>(.*)<\/ins>/,
|
|
559
|
+
replace: (t, e) => {
|
|
560
|
+
const n = q(e[1]);
|
|
561
|
+
n.toggleFormat("underline"), t.replace(n);
|
|
562
|
+
},
|
|
563
|
+
type: "text-match"
|
|
564
|
+
}, Je = {
|
|
565
|
+
dependencies: [F],
|
|
566
|
+
export: (t, e) => null,
|
|
567
|
+
regExp: /<u>(.*)<\/u>/,
|
|
568
|
+
importRegExp: /<u>(.*)<\/u>/,
|
|
569
|
+
replace: (t, e) => {
|
|
570
|
+
const n = q(e[1]);
|
|
571
|
+
n.toggleFormat("underline"), t.replace(n);
|
|
572
|
+
},
|
|
573
|
+
type: "text-match"
|
|
574
|
+
}, G = /https?:\/\/[^\s<>"']*[^\s<>"'.,:;"')\]}]/, L = (t) => t.replace(/\\([*_`~\\])/g, "$1"), Ve = (t) => t.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Ke = (t) => t?.replace(/\\(["\\])/g, "$1"), oe = (t, e, n) => {
|
|
575
|
+
if (t !== e)
|
|
576
|
+
return n;
|
|
577
|
+
const r = e.replace(/([*_`~\\])/g, "\\$1");
|
|
578
|
+
return n.replace(r, e);
|
|
579
|
+
}, Ge = {
|
|
580
|
+
dependencies: [Q],
|
|
581
|
+
export: (t, e) => {
|
|
582
|
+
if (!ue(t) || Z(t))
|
|
583
|
+
return null;
|
|
584
|
+
const n = t.getTitle(), r = L(t.getURL()), i = oe(t.getTextContent(), r, e(t));
|
|
585
|
+
return n != null ? `[${i}](${r} "${Ve(n)}")` : `[${i}](${r})`;
|
|
586
|
+
},
|
|
587
|
+
importRegExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,
|
|
588
|
+
regExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,
|
|
589
|
+
replace: (t, e) => {
|
|
590
|
+
const [, n, r, i] = e, o = L(r), s = de(o, {
|
|
591
|
+
title: Ke(i)
|
|
592
|
+
}), a = n.split("[").length - 1, c = n.split("]").length - 1;
|
|
593
|
+
let h = n, _ = "";
|
|
594
|
+
if (a < c)
|
|
595
|
+
return;
|
|
596
|
+
if (a > c) {
|
|
597
|
+
const u = n.split("[");
|
|
598
|
+
_ = `[${u[0]}`, h = u.slice(1).join("[");
|
|
599
|
+
}
|
|
600
|
+
const m = L(h), d = q(m === o ? o : m);
|
|
601
|
+
return d.setFormat(t.getFormat()), s.append(d), t.replace(s), _ && s.insertBefore(q(_)), d;
|
|
602
|
+
},
|
|
603
|
+
trigger: ")",
|
|
604
|
+
type: "text-match"
|
|
605
|
+
}, Xe = {
|
|
606
|
+
dependencies: [Y],
|
|
607
|
+
export: (t, e) => {
|
|
608
|
+
if (!Z(t))
|
|
609
|
+
return null;
|
|
610
|
+
const n = L(t.getURL());
|
|
611
|
+
return oe(t.getTextContent(), n, e(t));
|
|
612
|
+
},
|
|
613
|
+
regExp: G,
|
|
614
|
+
importRegExp: G,
|
|
615
|
+
replace: (t, e) => {
|
|
616
|
+
const n = L(e[0]), r = _e(n), i = q(n);
|
|
617
|
+
i.setFormat(t.getFormat()), r.append(i), t.replace(r);
|
|
618
|
+
},
|
|
619
|
+
type: "text-match"
|
|
620
|
+
}, Qe = [Be, je, Ue, Je, Ge, Xe], It = [xe, Q, Y, R, be, he, pe, ee, ke, I, $, v, T], Ye = [me, ...fe.filter((t) => t !== ge), ...Qe, ze, Fe], vt = [...Ye, Le], Lt = Oe;
|
|
621
|
+
function Ze(t) {
|
|
622
|
+
return t.trim().toLowerCase() === "mermaid";
|
|
623
|
+
}
|
|
624
|
+
function et(t) {
|
|
625
|
+
const e = t.getLanguage() ?? "plaintext";
|
|
626
|
+
return Ze(e) ? (t.replace(new I(t.getTextContent())), !0) : !1;
|
|
627
|
+
}
|
|
628
|
+
function Ot() {
|
|
629
|
+
const t = y(3), [e] = P();
|
|
630
|
+
let n, r;
|
|
631
|
+
return t[0] !== e ? (n = () => {
|
|
632
|
+
e.update(tt);
|
|
633
|
+
}, r = [e], t[0] = e, t[1] = n, t[2] = r) : (n = t[1], r = t[2]), j(n, r), null;
|
|
634
|
+
}
|
|
635
|
+
function tt() {
|
|
636
|
+
const t = ye(ee);
|
|
637
|
+
for (const e of t)
|
|
638
|
+
et(e);
|
|
639
|
+
}
|
|
640
|
+
function qt() {
|
|
641
|
+
const t = y(3), [e] = P();
|
|
642
|
+
let n, r;
|
|
643
|
+
return t[0] !== e ? (n = () => Ee(e), r = [e], t[0] = e, t[1] = n, t[2] = r) : (n = t[1], r = t[2]), j(n, r), null;
|
|
644
|
+
}
|
|
645
|
+
function Dt(t) {
|
|
646
|
+
const e = y(4), {
|
|
647
|
+
isEditable: n
|
|
648
|
+
} = t, [r] = P();
|
|
649
|
+
let i, o;
|
|
650
|
+
return e[0] !== r || e[1] !== n ? (i = () => {
|
|
651
|
+
r.setEditable(n);
|
|
652
|
+
}, o = [n, r], e[0] = r, e[1] = n, e[2] = i, e[3] = o) : (i = e[2], o = e[3]), j(i, o), null;
|
|
653
|
+
}
|
|
654
|
+
function At() {
|
|
655
|
+
const t = y(2), [e] = P();
|
|
656
|
+
let n;
|
|
657
|
+
return t[0] !== e ? (n = /* @__PURE__ */ l(k, { fontSize: "xs", color: "fg.muted", padding: "4", children: /* @__PURE__ */ l(Re, { 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 }) }), t[0] = e, t[1] = n) : n = t[1], n;
|
|
658
|
+
}
|
|
659
|
+
const nt = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/, rt = /^```/, it = /^([ \t]*)((?:[-*+])|(?:\d+\.))\s+/, ot = /^([ \t]+)/;
|
|
660
|
+
function se(t) {
|
|
661
|
+
let e = 0;
|
|
662
|
+
for (const n of t)
|
|
663
|
+
e += n === " " ? 4 : 1;
|
|
664
|
+
return e;
|
|
665
|
+
}
|
|
666
|
+
function st(t, e) {
|
|
667
|
+
return [...t].reverse().find((n) => n.sourceIndentWidth < e);
|
|
668
|
+
}
|
|
669
|
+
function W(t, e, n) {
|
|
670
|
+
return e === n && !t.includes(" ") ? t : " ".repeat(e);
|
|
671
|
+
}
|
|
672
|
+
function at(t, e) {
|
|
673
|
+
const n = t.match(ot);
|
|
674
|
+
if (!n)
|
|
675
|
+
return t.trim() !== "" && (e.length = 0), t;
|
|
676
|
+
const r = se(n[1]), i = st(e, r);
|
|
677
|
+
if (!i) return t;
|
|
678
|
+
const o = r + (i.normalizedIndentWidth - i.sourceIndentWidth), s = W(n[1], o, r);
|
|
679
|
+
return s === n[1] ? t : `${s}${t.slice(n[1].length)}`;
|
|
680
|
+
}
|
|
681
|
+
function lt(t, e, n) {
|
|
682
|
+
const r = se(e[1]);
|
|
683
|
+
for (; n.length && n.at(-1).sourceIndentWidth > r; )
|
|
684
|
+
n.pop();
|
|
685
|
+
const i = n.at(-1);
|
|
686
|
+
if (i?.sourceIndentWidth === r)
|
|
687
|
+
return `${W(e[1], i.normalizedIndentWidth, r)}${t.slice(e[1].length)}`;
|
|
688
|
+
const o = n.at(-1), s = r - (o?.sourceIndentWidth ?? 0);
|
|
689
|
+
let a = r;
|
|
690
|
+
return o && s === 2 && !e[1].includes(" ") && (a = o.normalizedIndentWidth + 4), n.push({
|
|
691
|
+
normalizedIndentWidth: a,
|
|
692
|
+
sourceIndentWidth: r
|
|
693
|
+
}), `${W(e[1], a, r)}${t.slice(e[1].length)}`;
|
|
694
|
+
}
|
|
695
|
+
function ct(t, e) {
|
|
696
|
+
if (rt.test(t.trimStart()))
|
|
697
|
+
return e.isInCodeFence = !e.isInCodeFence, t;
|
|
698
|
+
if (e.isInCodeFence) return t;
|
|
699
|
+
const n = t.match(it);
|
|
700
|
+
return n ? lt(t, n, e.activeListIndents) : at(t, e.activeListIndents);
|
|
701
|
+
}
|
|
702
|
+
function Mt(t) {
|
|
703
|
+
const e = t.split(`
|
|
704
|
+
`), n = {
|
|
705
|
+
isInCodeFence: !1,
|
|
706
|
+
activeListIndents: []
|
|
707
|
+
};
|
|
708
|
+
return e.map((r) => ct(r, n)).join(`
|
|
709
|
+
`);
|
|
710
|
+
}
|
|
711
|
+
function Pt(t) {
|
|
712
|
+
const e = t.match(nt);
|
|
713
|
+
return e ? {
|
|
714
|
+
frontmatter: e[0],
|
|
715
|
+
body: t.slice(e[0].length)
|
|
716
|
+
} : {
|
|
717
|
+
frontmatter: "",
|
|
718
|
+
body: t
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
export {
|
|
722
|
+
Rt as $,
|
|
723
|
+
qt as C,
|
|
724
|
+
St as D,
|
|
725
|
+
wt as E,
|
|
726
|
+
v as H,
|
|
727
|
+
Ot as I,
|
|
728
|
+
I as M,
|
|
729
|
+
Dt as T,
|
|
730
|
+
It as a,
|
|
731
|
+
Ct as b,
|
|
732
|
+
De as c,
|
|
733
|
+
vt as d,
|
|
734
|
+
Lt as e,
|
|
735
|
+
At as f,
|
|
736
|
+
R as g,
|
|
737
|
+
$ as h,
|
|
738
|
+
Ye as i,
|
|
739
|
+
Mt as n,
|
|
740
|
+
Pt as s,
|
|
741
|
+
Oe as t
|
|
742
|
+
};
|
|
743
|
+
//# sourceMappingURL=markdown-DDd2ESoH.js.map
|