markdown-flow-ui 0.3.8 → 0.3.9
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/_virtual/index6.cjs +1 -1
- package/dist/_virtual/index6.es.js +3 -5
- package/dist/_virtual/index6.es.js.map +1 -1
- package/dist/_virtual/index7.cjs +1 -1
- package/dist/_virtual/index7.es.js +5 -3
- package/dist/_virtual/index7.es.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.cjs +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
- package/dist/components/ContentRender/ContentRender.d.ts +0 -2
- package/dist/components/ContentRender/ContentRender.es.js +361 -365
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.cjs +4 -4
- package/dist/components/ContentRender/IframeSandbox.cjs.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.d.ts +0 -2
- package/dist/components/ContentRender/IframeSandbox.es.js +299 -296
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.cjs +2 -2
- package/dist/components/ContentRender/SandboxApp.cjs.map +1 -1
- package/dist/components/ContentRender/SandboxApp.d.ts +4 -3
- package/dist/components/ContentRender/SandboxApp.es.js +110 -141
- package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
- package/dist/components/ContentRender/contentRenderI18n.cjs.map +1 -1
- package/dist/components/ContentRender/contentRenderI18n.d.ts +0 -2
- package/dist/components/ContentRender/contentRenderI18n.es.js.map +1 -1
- package/dist/components/ContentRender/locales/contentRender.json.cjs +1 -1
- package/dist/components/ContentRender/locales/contentRender.json.d.ts +0 -22
- package/dist/components/ContentRender/locales/contentRender.json.es.js +11 -11
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MUBBAK2.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MUBBAK2.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HFQBQIA3.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HFQBQIA3.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-MALGAFMO.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-MALGAFMO.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-23REXITY.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-23REXITY.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-5NDRBG5M.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-5NDRBG5M.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-OMPLPG4O.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-OMPLPG4O.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { d as
|
|
3
|
-
import X, { useMemo as h, useState as
|
|
4
|
-
import { sanitizeInvalidTagName as
|
|
5
|
-
import { stripSvgTextLineBreaks as
|
|
1
|
+
import { jsx as s, jsxs as We, Fragment as ut } from "react/jsx-runtime";
|
|
2
|
+
import { d as ze } from "../../_virtual/index.es.js";
|
|
3
|
+
import X, { useMemo as h, useState as Fe, useRef as T, useEffect as ne } from "react";
|
|
4
|
+
import { sanitizeInvalidTagName as lt } from "./utils/sanitize-invalid-tag-name.es.js";
|
|
5
|
+
import { stripSvgTextLineBreaks as dt } from "./utils/strip-svg-text-line-breaks.es.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { preserveCustomVariableProperties as
|
|
14
|
-
import { subsetLanguages as
|
|
15
|
-
import { parseMarkdownSegments as
|
|
16
|
-
import { getMarkdownSourceAnalysis as
|
|
17
|
-
import { remarkPlugins as
|
|
18
|
-
import { normalizeInlineHtml as
|
|
19
|
-
import { escapeTypedMarkdownMetadata as
|
|
20
|
-
import
|
|
21
|
-
import { getTrailingTypewriterGrapheme as
|
|
22
|
-
import { normalizeWrappedSandboxContent as
|
|
23
|
-
import { getInteractionDefaultValues as
|
|
24
|
-
import { getMarkdownFlowDirection as
|
|
25
|
-
import { getContentRenderLocaleTexts as
|
|
26
|
-
import { createVideoMarkdownRunPlan as
|
|
27
|
-
import { unified as
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import { Markdown as
|
|
33
|
-
const
|
|
10
|
+
import mt, { CodeBlockContext as pt } from "./CodeBlock.es.js";
|
|
11
|
+
import ft from "./plugins/CustomVariable.es.js";
|
|
12
|
+
import Ce from "./plugins/MermaidChart.es.js";
|
|
13
|
+
import { preserveCustomVariableProperties as ht, restoreCustomVariableProperties as gt } from "./utils/custom-variable-props.es.js";
|
|
14
|
+
import { subsetLanguages as vt, highlightLanguages as yt } from "./utils/highlight-languages.es.js";
|
|
15
|
+
import { parseMarkdownSegments as Ge, mermaidBlockIsComplete as xt } from "./utils/mermaid-parse.es.js";
|
|
16
|
+
import { getMarkdownSourceAnalysis as wt, getInlineCodeRanges as Ct } from "./utils/inline-code-ranges.es.js";
|
|
17
|
+
import { remarkPlugins as Qe } from "./utils/markdown-plugins.es.js";
|
|
18
|
+
import { normalizeInlineHtml as xe } from "./utils/normalize-inline-html.es.js";
|
|
19
|
+
import { escapeTypedMarkdownMetadata as ke } from "./utils/escape-typed-metadata.es.js";
|
|
20
|
+
import kt from "./IframeSandbox.es.js";
|
|
21
|
+
import { getTrailingTypewriterGrapheme as we, appendContentAwareTypewriterQueue as _e, consumeContentAwareTypewriterQueue as Tt, CONTENT_AWARE_TYPEWRITER_TICK_BUDGET as bt, isContentAwareTypewriterQueueEmpty as St } from "./utils/typewriter-pacing.es.js";
|
|
22
|
+
import { normalizeWrappedSandboxContent as Rt, splitContentSegments as Bt } from "./utils/split-content.es.js";
|
|
23
|
+
import { getInteractionDefaultValues as Nt } from "../../lib/interaction-defaults.es.js";
|
|
24
|
+
import { getMarkdownFlowDirection as Mt, getMarkdownFlowLanguage as Lt } from "../../lib/locale.es.js";
|
|
25
|
+
import { getContentRenderLocaleTexts as be } from "./contentRenderI18n.es.js";
|
|
26
|
+
import { createVideoMarkdownRunPlan as At, cloneVideoMarkdownSourceTree as Vt, prepareVideoMarkdownRun as $t, projectVideoMarkdownRun as Et, getVideoMarkdownNodeState as Pt } from "./utils/video-markdown-run.es.js";
|
|
27
|
+
import { unified as je } from "../../node_modules/unified/lib/index.es.js";
|
|
28
|
+
import It from "../../node_modules/remark-rehype/lib/index.es.js";
|
|
29
|
+
import Dt from "../../node_modules/rehype-raw/lib/index.es.js";
|
|
30
|
+
import Wt from "../../node_modules/rehype-highlight/lib/index.es.js";
|
|
31
|
+
import zt from "../../node_modules/rehype-katex/lib/index.es.js";
|
|
32
|
+
import { Markdown as Oe } from "../../node_modules/react-markdown/lib/index.es.js";
|
|
33
|
+
const Ft = 2, Te = ({
|
|
34
34
|
svg: t,
|
|
35
35
|
inline: r = !1
|
|
36
36
|
}) => {
|
|
37
|
-
const c =
|
|
38
|
-
return
|
|
37
|
+
const c = T(null), o = r ? "span" : "div";
|
|
38
|
+
return ne(() => {
|
|
39
39
|
const u = c.current;
|
|
40
40
|
if (!u) return;
|
|
41
|
-
const m = u.shadowRoot ?? u.attachShadow({ mode: "open" }),
|
|
42
|
-
let g = m.getElementById(
|
|
43
|
-
g || (g = document.createElement("style"), g.id =
|
|
41
|
+
const m = u.shadowRoot ?? u.attachShadow({ mode: "open" }), x = "content-render-svg-style";
|
|
42
|
+
let g = m.getElementById(x);
|
|
43
|
+
g || (g = document.createElement("style"), g.id = x, g.textContent = `
|
|
44
44
|
svg { height: auto; display: inline-block; }
|
|
45
45
|
svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }
|
|
46
46
|
svg.content-render-svg-el--fixed { max-width: none; }
|
|
47
47
|
`, m.appendChild(g)), Array.from(m.childNodes).filter(
|
|
48
48
|
(i) => i !== g
|
|
49
49
|
).forEach((i) => m.removeChild(i));
|
|
50
|
-
const Q = document.createElement("template"), f =
|
|
50
|
+
const Q = document.createElement("template"), f = dt(t);
|
|
51
51
|
Q.innerHTML = f, m.append(Q.content.cloneNode(!0));
|
|
52
|
-
let
|
|
52
|
+
let b = !1, V = !1;
|
|
53
53
|
m.querySelectorAll("svg").forEach((i) => {
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
const [, , I,
|
|
59
|
-
if (!
|
|
60
|
-
const
|
|
61
|
-
return
|
|
62
|
-
},
|
|
63
|
-
if (!
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
54
|
+
const $ = i.getAttribute("viewBox");
|
|
55
|
+
if (!$) return;
|
|
56
|
+
const z = $.trim().split(/[\s,]+/).map((S) => Number(S));
|
|
57
|
+
if (z.length !== 4 || z.some(Number.isNaN)) return;
|
|
58
|
+
const [, , I, w] = z, O = i.getAttribute("width"), D = i.getAttribute("height"), U = (S) => {
|
|
59
|
+
if (!S) return !1;
|
|
60
|
+
const N = S.trim().toLowerCase();
|
|
61
|
+
return N === "auto" || N.endsWith("%");
|
|
62
|
+
}, re = (S) => {
|
|
63
|
+
if (!S) return null;
|
|
64
|
+
const N = S.trim().toLowerCase();
|
|
65
|
+
if (N === "auto" || N.endsWith("%"))
|
|
66
66
|
return null;
|
|
67
|
-
const
|
|
68
|
-
return Number.isNaN(
|
|
69
|
-
},
|
|
70
|
-
if (
|
|
71
|
-
|
|
67
|
+
const te = Number.parseFloat(N);
|
|
68
|
+
return Number.isNaN(te) ? null : te;
|
|
69
|
+
}, de = U(O), me = U(D), oe = !O || O === "0", se = !D || D === "0", ae = re(O), ce = re(D);
|
|
70
|
+
if (de || me || oe && se || ae === I && ce === w) {
|
|
71
|
+
b = !0, i.classList.add("content-render-svg-el--responsive"), i.classList.remove("content-render-svg-el--fixed"), i.style.width = "100%", i.style.height = "auto", !i.style.aspectRatio && w > 0 && (i.style.aspectRatio = `${I} / ${w}`);
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
V = !0, i.classList.add("content-render-svg-el--fixed"), i.classList.remove("content-render-svg-el--responsive"), oe && I > 0 && i.setAttribute("width", `${I}`), se && w > 0 && i.setAttribute("height", `${w}`);
|
|
75
75
|
});
|
|
76
|
-
const l =
|
|
76
|
+
const l = b && !V;
|
|
77
77
|
u.classList.toggle("content-render-svg--responsive", l), u.classList.toggle("content-render-svg--fixed", !l);
|
|
78
78
|
}, [t]), /* @__PURE__ */ s(o, { className: "content-render-svg-scroll", children: /* @__PURE__ */ s(
|
|
79
79
|
o,
|
|
@@ -84,23 +84,23 @@ const _t = 2, be = ({
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
) });
|
|
87
|
-
},
|
|
87
|
+
}, le = X.createContext(
|
|
88
88
|
null
|
|
89
|
-
),
|
|
90
|
-
const { receivedTree: r, ...c } = t, o = X.useContext(
|
|
89
|
+
), Ue = (t) => {
|
|
90
|
+
const { receivedTree: r, ...c } = t, o = X.useContext(le), u = X.useContext(pt);
|
|
91
91
|
if (!o)
|
|
92
92
|
throw new Error("Markdown code renderer requires ContentRender context.");
|
|
93
|
-
const { className: m, children:
|
|
93
|
+
const { className: m, children: x, ...g } = c;
|
|
94
94
|
if (/language-(\w+)/.exec(m || "")?.[1] === "mermaid") {
|
|
95
|
-
const f =
|
|
95
|
+
const f = x?.toString().replace(/\n$/, "") || "", b = xt(
|
|
96
96
|
o.current.renderContent,
|
|
97
97
|
f
|
|
98
98
|
);
|
|
99
99
|
return /* @__PURE__ */ s(
|
|
100
|
-
|
|
100
|
+
Ce,
|
|
101
101
|
{
|
|
102
102
|
chart: f,
|
|
103
|
-
frozen: r ? !
|
|
103
|
+
frozen: r ? !b : b,
|
|
104
104
|
messages: o.current.mermaidMessages
|
|
105
105
|
}
|
|
106
106
|
);
|
|
@@ -111,123 +111,123 @@ const _t = 2, be = ({
|
|
|
111
111
|
className: m,
|
|
112
112
|
...g,
|
|
113
113
|
dir: g.dir ?? (u ? void 0 : "ltr"),
|
|
114
|
-
children:
|
|
114
|
+
children: x
|
|
115
115
|
}
|
|
116
116
|
);
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
],
|
|
123
|
-
[
|
|
124
|
-
|
|
125
|
-
],
|
|
126
|
-
...
|
|
127
|
-
...
|
|
128
|
-
],
|
|
129
|
-
const o =
|
|
117
|
+
}, Ke = [
|
|
118
|
+
ht,
|
|
119
|
+
Dt,
|
|
120
|
+
lt,
|
|
121
|
+
gt
|
|
122
|
+
], Ye = [
|
|
123
|
+
[Wt, { languages: yt, subset: vt }],
|
|
124
|
+
zt
|
|
125
|
+
], Gt = [
|
|
126
|
+
...Ke,
|
|
127
|
+
...Ye
|
|
128
|
+
], He = ({ content: t, components: r, locale: c }) => {
|
|
129
|
+
const o = be(c);
|
|
130
130
|
return /* @__PURE__ */ s("div", { className: "markdown-renderer", children: /* @__PURE__ */ s(
|
|
131
|
-
|
|
131
|
+
Oe,
|
|
132
132
|
{
|
|
133
|
-
remarkPlugins:
|
|
134
|
-
rehypePlugins:
|
|
133
|
+
remarkPlugins: Qe,
|
|
134
|
+
rehypePlugins: Gt,
|
|
135
135
|
remarkRehypeOptions: {
|
|
136
136
|
footnoteLabel: o.footnoteLabel,
|
|
137
137
|
footnoteBackLabel: (u, m) => {
|
|
138
|
-
const
|
|
139
|
-
return o.footnoteBackLabel.replace("{reference}",
|
|
138
|
+
const x = String(u + 1) + (m > 1 ? `-${m}` : "");
|
|
139
|
+
return o.footnoteBackLabel.replace("{reference}", x);
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
142
|
components: r,
|
|
143
143
|
children: t
|
|
144
144
|
}
|
|
145
145
|
) });
|
|
146
|
-
},
|
|
146
|
+
}, _t = function() {
|
|
147
147
|
this.parser = () => ({ type: "root", children: [] });
|
|
148
|
-
},
|
|
148
|
+
}, jt = ({ plan: t, renderedSegments: r, components: c, locale: o }) => {
|
|
149
149
|
const u = h(() => {
|
|
150
|
-
const f =
|
|
150
|
+
const f = be(o), b = je().use(Qe).use(It, {
|
|
151
151
|
allowDangerousHtml: !0,
|
|
152
152
|
footnoteLabel: f.footnoteLabel,
|
|
153
|
-
footnoteBackLabel: (i,
|
|
153
|
+
footnoteBackLabel: (i, $) => f.footnoteBackLabel.replace(
|
|
154
154
|
"{reference}",
|
|
155
|
-
String(i + 1) + (
|
|
155
|
+
String(i + 1) + ($ > 1 ? `-${$}` : "")
|
|
156
156
|
)
|
|
157
|
-
}).use(
|
|
158
|
-
|
|
157
|
+
}).use(Ke), V = je().use(Ye), l = b.runSync(
|
|
158
|
+
Vt(t),
|
|
159
159
|
t.markdownSource
|
|
160
160
|
);
|
|
161
|
-
return
|
|
161
|
+
return $t(
|
|
162
162
|
t,
|
|
163
163
|
l,
|
|
164
|
-
(i) =>
|
|
164
|
+
(i) => V.runSync(i, t.fullSource)
|
|
165
165
|
);
|
|
166
166
|
}, [t, o]), m = h(
|
|
167
|
-
() =>
|
|
167
|
+
() => Et(u, r),
|
|
168
168
|
[u, r]
|
|
169
|
-
),
|
|
170
|
-
|
|
171
|
-
const g =
|
|
169
|
+
), x = T(c);
|
|
170
|
+
x.current = c;
|
|
171
|
+
const g = T(
|
|
172
172
|
/* @__PURE__ */ new Map()
|
|
173
173
|
), J = h(() => {
|
|
174
|
-
const f = /* @__PURE__ */ new Set(),
|
|
175
|
-
l.type === "element" && f.add(l.tagName), "children" in l && l.children.forEach(
|
|
174
|
+
const f = /* @__PURE__ */ new Set(), b = (l) => {
|
|
175
|
+
l.type === "element" && f.add(l.tagName), "children" in l && l.children.forEach(b);
|
|
176
176
|
};
|
|
177
|
-
|
|
178
|
-
const
|
|
177
|
+
b(u.tree);
|
|
178
|
+
const V = {};
|
|
179
179
|
for (const l of f) {
|
|
180
180
|
if (!g.current.has(l)) {
|
|
181
181
|
const i = ({
|
|
182
|
-
node:
|
|
183
|
-
children:
|
|
182
|
+
node: $,
|
|
183
|
+
children: z,
|
|
184
184
|
...I
|
|
185
185
|
}) => {
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
188
|
-
return
|
|
189
|
-
if (
|
|
190
|
-
return
|
|
191
|
-
if (
|
|
192
|
-
const D =
|
|
186
|
+
const w = Pt($);
|
|
187
|
+
if (w?.svg)
|
|
188
|
+
return w.svgSource ? /* @__PURE__ */ s(Te, { svg: w.svgSource, inline: !0 }) : null;
|
|
189
|
+
if (w?.atomic)
|
|
190
|
+
return w.active ? /* @__PURE__ */ s(ut, { children: z }) : null;
|
|
191
|
+
if (w?.active === !1 && l !== "a") return null;
|
|
192
|
+
const D = x.current[l], U = w?.active === !1 ? { ...I, href: void 0, tabIndex: -1 } : I;
|
|
193
193
|
return D ? X.createElement(
|
|
194
194
|
D,
|
|
195
195
|
{
|
|
196
196
|
...U,
|
|
197
|
-
node:
|
|
198
|
-
...D ===
|
|
197
|
+
node: $,
|
|
198
|
+
...D === Ue ? { receivedTree: !0 } : {}
|
|
199
199
|
},
|
|
200
|
-
|
|
201
|
-
) : X.createElement(l, U,
|
|
200
|
+
z
|
|
201
|
+
) : X.createElement(l, U, z);
|
|
202
202
|
};
|
|
203
203
|
i.displayName = `StableMarkdown(${l})`, g.current.set(l, i);
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
V[l] = g.current.get(l);
|
|
206
206
|
}
|
|
207
|
-
return
|
|
207
|
+
return V;
|
|
208
208
|
}, [u]), Q = h(
|
|
209
209
|
() => [() => () => m],
|
|
210
210
|
[m]
|
|
211
211
|
);
|
|
212
212
|
return /* @__PURE__ */ s("div", { className: "markdown-renderer", children: /* @__PURE__ */ s(
|
|
213
|
-
|
|
213
|
+
Oe,
|
|
214
214
|
{
|
|
215
|
-
remarkPlugins: [
|
|
215
|
+
remarkPlugins: [_t],
|
|
216
216
|
rehypePlugins: Q,
|
|
217
217
|
components: J,
|
|
218
218
|
children: ""
|
|
219
219
|
}
|
|
220
220
|
) });
|
|
221
|
-
},
|
|
221
|
+
}, j = (t) => t.type === "markdown" && t.immediate === !0, Ht = (t) => {
|
|
222
222
|
if (t.length <= 1) return t;
|
|
223
223
|
const r = [];
|
|
224
224
|
return t.forEach((c) => {
|
|
225
|
-
if (c.type === "sandbox" ||
|
|
225
|
+
if (c.type === "sandbox" || j(c)) {
|
|
226
226
|
r.push(c);
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
229
|
const o = r[r.length - 1];
|
|
230
|
-
if (o && o.type !== "sandbox" && !
|
|
230
|
+
if (o && o.type !== "sandbox" && !j(o)) {
|
|
231
231
|
r[r.length - 1] = {
|
|
232
232
|
type: "markdown",
|
|
233
233
|
value: `${o.value}${c.value}`
|
|
@@ -236,10 +236,10 @@ const _t = 2, be = ({
|
|
|
236
236
|
}
|
|
237
237
|
r.push({ type: "markdown", value: c.value });
|
|
238
238
|
}), r;
|
|
239
|
-
},
|
|
239
|
+
}, qt = (t, r, c) => {
|
|
240
240
|
if (t.length >= r.length) return t;
|
|
241
241
|
const o = c.find(
|
|
242
|
-
({ start:
|
|
242
|
+
({ start: x, end: g }) => x < t.length && t.length < g
|
|
243
243
|
);
|
|
244
244
|
if (!o) return t;
|
|
245
245
|
const u = /^`+/.exec(r.slice(o.start))?.[0];
|
|
@@ -247,83 +247,81 @@ const _t = 2, be = ({
|
|
|
247
247
|
return t;
|
|
248
248
|
const m = o.end - u.length;
|
|
249
249
|
return t.length > m ? t + u.slice(t.length - m) : t + (t.endsWith("`") ? " " : "") + u;
|
|
250
|
-
},
|
|
251
|
-
const m =
|
|
252
|
-
return
|
|
253
|
-
},
|
|
250
|
+
}, qe = (t, r, c, o, u = 0) => {
|
|
251
|
+
const m = qt(t, r, c);
|
|
252
|
+
return ke(t, o, u) + m.slice(t.length);
|
|
253
|
+
}, Qt = (t, r) => {
|
|
254
254
|
const c = Math.max(1, r), o = Array.from(t);
|
|
255
255
|
return {
|
|
256
256
|
chunk: o.slice(0, c).join(""),
|
|
257
257
|
rest: o.slice(c).join("")
|
|
258
258
|
};
|
|
259
|
-
},
|
|
260
|
-
const r =
|
|
261
|
-
return
|
|
262
|
-
},
|
|
259
|
+
}, Ot = (t, r) => t === r ? !0 : !t || !r || t.length !== r.length ? !1 : t.every((c, o) => c === r[o]), Ut = (t) => {
|
|
260
|
+
const r = T(t);
|
|
261
|
+
return Ot(r.current, t) || (r.current = t), r.current;
|
|
262
|
+
}, Ln = ({
|
|
263
263
|
onPlaceholderAccepted: t,
|
|
264
264
|
content: r,
|
|
265
265
|
contentType: c,
|
|
266
266
|
locale: o,
|
|
267
267
|
lang: u,
|
|
268
268
|
dir: m,
|
|
269
|
-
customRenderBar:
|
|
269
|
+
customRenderBar: x,
|
|
270
270
|
onSend: g,
|
|
271
271
|
typingSpeed: J = 30,
|
|
272
272
|
enableTypewriter: Q = !1,
|
|
273
273
|
typewriterPacing: f = "fixed",
|
|
274
|
-
onTypeFinished:
|
|
275
|
-
onTypewriterStateChange:
|
|
274
|
+
onTypeFinished: b,
|
|
275
|
+
onTypewriterStateChange: V,
|
|
276
276
|
userInput: l,
|
|
277
277
|
interactionDefaultValueOptions: i,
|
|
278
|
-
defaultButtonText:
|
|
279
|
-
defaultInputText:
|
|
278
|
+
defaultButtonText: $,
|
|
279
|
+
defaultInputText: z,
|
|
280
280
|
defaultSelectedValues: I,
|
|
281
|
-
readonly:
|
|
281
|
+
readonly: w = !1,
|
|
282
282
|
confirmButtonText: O,
|
|
283
283
|
copyButtonText: D,
|
|
284
284
|
copiedButtonText: U,
|
|
285
|
-
sandboxLoadingText:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
onClickCustomButtonAfterContent: me,
|
|
293
|
-
beforeSend: pe
|
|
285
|
+
sandboxLoadingText: re,
|
|
286
|
+
disableSandboxLoadingOverlay: de = !1,
|
|
287
|
+
sandboxFullscreenButtonText: me,
|
|
288
|
+
sandboxExitFullscreenButtonText: oe,
|
|
289
|
+
sandboxMode: se = "content",
|
|
290
|
+
onClickCustomButtonAfterContent: ae,
|
|
291
|
+
beforeSend: ce
|
|
294
292
|
}) => {
|
|
295
|
-
const
|
|
293
|
+
const W = be(o), ee = h(
|
|
296
294
|
() => ({
|
|
297
|
-
loading:
|
|
298
|
-
emptyChart:
|
|
299
|
-
error:
|
|
295
|
+
loading: W.mermaidLoadingText,
|
|
296
|
+
emptyChart: W.mermaidEmptyChartText,
|
|
297
|
+
error: W.mermaidErrorText
|
|
300
298
|
}),
|
|
301
|
-
[
|
|
302
|
-
),
|
|
303
|
-
() =>
|
|
299
|
+
[W]
|
|
300
|
+
), S = m ?? Mt(o), N = u ?? Lt(o), te = O || W.confirmButtonText, Se = D || W.copyButtonText, Re = U || W.copiedButtonText, Xe = me || W.sandboxFullscreenButtonText, Ze = oe || W.sandboxExitFullscreenButtonText, p = !!Q && (!c || c === "text"), R = h(
|
|
301
|
+
() => Rt(r),
|
|
304
302
|
[r]
|
|
305
|
-
),
|
|
306
|
-
() =>
|
|
303
|
+
), M = h(
|
|
304
|
+
() => wt(R),
|
|
307
305
|
[R]
|
|
308
|
-
),
|
|
309
|
-
const e =
|
|
310
|
-
|
|
306
|
+
), C = h(() => {
|
|
307
|
+
const e = Ht(
|
|
308
|
+
Bt(R, !0, !0, M)
|
|
311
309
|
);
|
|
312
|
-
return R !== r && e.length && (e[0].type === "sandbox" ||
|
|
313
|
-
}, [r, R,
|
|
314
|
-
(e) => e.type === "sandbox" ||
|
|
315
|
-
), v = K ?
|
|
316
|
-
(e) => e.type !== "sandbox" && !
|
|
317
|
-
).map((e) => e.value).join("") : R,
|
|
310
|
+
return R !== r && e.length && (e[0].type === "sandbox" || j(e[0])) ? [{ type: "text", value: "" }, ...e] : e;
|
|
311
|
+
}, [r, R, M]), K = C.some(
|
|
312
|
+
(e) => e.type === "sandbox" || j(e)
|
|
313
|
+
), v = K ? C.filter(
|
|
314
|
+
(e) => e.type !== "sandbox" && !j(e)
|
|
315
|
+
).map((e) => e.value).join("") : R, Be = Math.max(0, J), Je = f === "fixed" ? v : void 0, [E, Ne] = Fe(
|
|
318
316
|
() => p ? "" : v
|
|
319
|
-
),
|
|
317
|
+
), ie = T(E), L = T(""), P = T({
|
|
320
318
|
tokens: [],
|
|
321
319
|
head: 0,
|
|
322
320
|
trailingGrapheme: ""
|
|
323
|
-
}), H =
|
|
324
|
-
|
|
325
|
-
const e =
|
|
326
|
-
|
|
321
|
+
}), H = T(0), Me = T(p), Le = T(f), Ae = T(v), pe = T(r), fe = T(!1), [et, tt] = Fe(0);
|
|
322
|
+
ne(() => {
|
|
323
|
+
const e = Me.current, n = Le.current, a = Ae.current, d = !!L.current, k = pe.current !== r, ye = k && r.startsWith(pe.current);
|
|
324
|
+
pe.current = r, Me.current = p, Le.current = f, Ae.current = v, (k || p !== e) && (fe.current = !1);
|
|
327
325
|
const Y = () => {
|
|
328
326
|
L.current = "", P.current = {
|
|
329
327
|
tokens: [],
|
|
@@ -331,61 +329,61 @@ const _t = 2, be = ({
|
|
|
331
329
|
trailingGrapheme: ""
|
|
332
330
|
}, H.current = 0;
|
|
333
331
|
}, Z = (B) => {
|
|
334
|
-
|
|
332
|
+
ie.current = B, Ne(B);
|
|
335
333
|
};
|
|
336
334
|
if (!p) {
|
|
337
335
|
Y(), Z(v);
|
|
338
336
|
return;
|
|
339
337
|
}
|
|
340
338
|
e || (Y(), Z(""));
|
|
341
|
-
let
|
|
342
|
-
if (!v.startsWith(
|
|
339
|
+
let A = e ? ie.current : "";
|
|
340
|
+
if (!v.startsWith(A)) {
|
|
343
341
|
if (Y(), !ye) {
|
|
344
342
|
Z(v), f === "content-aware" && (P.current = {
|
|
345
343
|
tokens: [],
|
|
346
344
|
head: 0,
|
|
347
|
-
trailingGrapheme:
|
|
345
|
+
trailingGrapheme: we(v)
|
|
348
346
|
});
|
|
349
347
|
return;
|
|
350
348
|
}
|
|
351
349
|
let B = 0;
|
|
352
|
-
for (; B <
|
|
350
|
+
for (; B < A.length && B < v.length && A[B] === v[B]; )
|
|
353
351
|
B += 1;
|
|
354
|
-
|
|
352
|
+
A = A.slice(0, B), Z(A);
|
|
355
353
|
}
|
|
356
|
-
let q = v.slice(
|
|
354
|
+
let q = v.slice(A.length);
|
|
357
355
|
if (!q) {
|
|
358
356
|
L.current = "", H.current = 0, P.current = f === "content-aware" ? {
|
|
359
357
|
tokens: [],
|
|
360
358
|
head: 0,
|
|
361
|
-
trailingGrapheme:
|
|
359
|
+
trailingGrapheme: we(A)
|
|
362
360
|
} : { tokens: [], head: 0, trailingGrapheme: "" };
|
|
363
361
|
return;
|
|
364
362
|
}
|
|
365
363
|
if (f === "content-aware") {
|
|
366
364
|
const B = a.slice(
|
|
367
|
-
|
|
365
|
+
A.length
|
|
368
366
|
);
|
|
369
367
|
if (e && n === "content-aware" && v.startsWith(a) && L.current === B) {
|
|
370
|
-
const
|
|
368
|
+
const _ = _e(
|
|
371
369
|
P.current,
|
|
372
370
|
v.slice(a.length)
|
|
373
371
|
);
|
|
374
|
-
P.current =
|
|
375
|
-
|
|
376
|
-
), Z(`${
|
|
372
|
+
P.current = _.queue, _.immediateChunk && (q = q.slice(
|
|
373
|
+
_.immediateChunk.length
|
|
374
|
+
), Z(`${A}${_.immediateChunk}`));
|
|
377
375
|
} else {
|
|
378
|
-
const
|
|
376
|
+
const _ = _e(
|
|
379
377
|
{
|
|
380
378
|
tokens: [],
|
|
381
379
|
head: 0,
|
|
382
|
-
trailingGrapheme:
|
|
380
|
+
trailingGrapheme: we(A)
|
|
383
381
|
},
|
|
384
382
|
q
|
|
385
383
|
);
|
|
386
|
-
P.current =
|
|
387
|
-
|
|
388
|
-
), Z(`${
|
|
384
|
+
P.current = _.queue, _.immediateChunk && (q = q.slice(
|
|
385
|
+
_.immediateChunk.length
|
|
386
|
+
), Z(`${A}${_.immediateChunk}`)), H.current = 0;
|
|
389
387
|
}
|
|
390
388
|
} else
|
|
391
389
|
P.current = {
|
|
@@ -393,16 +391,16 @@ const _t = 2, be = ({
|
|
|
393
391
|
head: 0,
|
|
394
392
|
trailingGrapheme: ""
|
|
395
393
|
}, H.current = 0;
|
|
396
|
-
L.current = q, !d && q &&
|
|
397
|
-
}, [r, v, p, f]),
|
|
398
|
-
p && (
|
|
394
|
+
L.current = q, !d && q && tt((B) => B + 1);
|
|
395
|
+
}, [r, v, p, f]), ne(() => {
|
|
396
|
+
p && (fe.current || L.current || E !== v || (fe.current = !0, b?.()));
|
|
399
397
|
}, [
|
|
400
398
|
r,
|
|
401
399
|
v,
|
|
402
400
|
E,
|
|
403
401
|
p,
|
|
404
|
-
|
|
405
|
-
]),
|
|
402
|
+
b
|
|
403
|
+
]), ne(() => {
|
|
406
404
|
if (!p || !L.current)
|
|
407
405
|
return;
|
|
408
406
|
const e = window.setTimeout(() => {
|
|
@@ -410,15 +408,15 @@ const _t = 2, be = ({
|
|
|
410
408
|
return;
|
|
411
409
|
let n = "";
|
|
412
410
|
if (f === "content-aware") {
|
|
413
|
-
const d =
|
|
411
|
+
const d = Tt(
|
|
414
412
|
P.current,
|
|
415
|
-
H.current +
|
|
413
|
+
H.current + bt
|
|
416
414
|
);
|
|
417
|
-
n = d.chunk, P.current = d.queue,
|
|
415
|
+
n = d.chunk, P.current = d.queue, St(d.queue) ? H.current = 0 : H.current = d.remainingBudget;
|
|
418
416
|
} else
|
|
419
|
-
n =
|
|
417
|
+
n = Qt(
|
|
420
418
|
L.current,
|
|
421
|
-
|
|
419
|
+
Ft
|
|
422
420
|
).chunk;
|
|
423
421
|
if (!n)
|
|
424
422
|
return;
|
|
@@ -427,23 +425,23 @@ const _t = 2, be = ({
|
|
|
427
425
|
head: 0,
|
|
428
426
|
trailingGrapheme: P.current.trailingGrapheme
|
|
429
427
|
} : { tokens: [], head: 0, trailingGrapheme: "" }, H.current = 0);
|
|
430
|
-
const a = `${
|
|
431
|
-
|
|
432
|
-
},
|
|
428
|
+
const a = `${ie.current}${n}`;
|
|
429
|
+
ie.current = a, Ne(a);
|
|
430
|
+
}, Be);
|
|
433
431
|
return () => window.clearTimeout(e);
|
|
434
432
|
}, [
|
|
435
433
|
E,
|
|
436
|
-
|
|
434
|
+
Je,
|
|
437
435
|
p,
|
|
438
436
|
f,
|
|
439
|
-
|
|
440
|
-
|
|
437
|
+
Be,
|
|
438
|
+
et
|
|
441
439
|
]);
|
|
442
|
-
const
|
|
440
|
+
const F = h(() => {
|
|
443
441
|
let e = 0;
|
|
444
|
-
return
|
|
442
|
+
return C.map((n) => {
|
|
445
443
|
if (!p) return n;
|
|
446
|
-
if (n.type === "sandbox" ||
|
|
444
|
+
if (n.type === "sandbox" || j(n))
|
|
447
445
|
return E.length >= e ? n : { ...n, value: "" };
|
|
448
446
|
const a = E.slice(
|
|
449
447
|
e,
|
|
@@ -451,13 +449,13 @@ const _t = 2, be = ({
|
|
|
451
449
|
);
|
|
452
450
|
return e += n.value.length, { ...n, value: a };
|
|
453
451
|
});
|
|
454
|
-
}, [
|
|
452
|
+
}, [C, E, p]), Ve = h(
|
|
455
453
|
() => ({
|
|
456
454
|
isTypewriterEnabled: p,
|
|
457
455
|
isTyping: p && E !== v,
|
|
458
456
|
isComplete: E === v,
|
|
459
|
-
renderedLength: r.length -
|
|
460
|
-
(e, n, a) => e + n.value.length -
|
|
457
|
+
renderedLength: r.length - C.reduce(
|
|
458
|
+
(e, n, a) => e + n.value.length - F[a].value.length,
|
|
461
459
|
0
|
|
462
460
|
),
|
|
463
461
|
totalLength: r.length
|
|
@@ -467,134 +465,134 @@ const _t = 2, be = ({
|
|
|
467
465
|
v,
|
|
468
466
|
E,
|
|
469
467
|
p,
|
|
470
|
-
|
|
471
|
-
|
|
468
|
+
C,
|
|
469
|
+
F
|
|
472
470
|
]
|
|
473
471
|
);
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}, [
|
|
477
|
-
const
|
|
472
|
+
ne(() => {
|
|
473
|
+
V?.(Ve);
|
|
474
|
+
}, [V, Ve]);
|
|
475
|
+
const he = h(() => {
|
|
478
476
|
let e = 0;
|
|
479
|
-
return
|
|
477
|
+
return C.map((n) => {
|
|
480
478
|
const a = e;
|
|
481
479
|
return e += n.value.length, a;
|
|
482
480
|
});
|
|
483
|
-
}, [
|
|
484
|
-
() => p ?
|
|
485
|
-
(e) => e.type === "sandbox" ||
|
|
481
|
+
}, [C]), ue = h(
|
|
482
|
+
() => p ? C.map(
|
|
483
|
+
(e) => e.type === "sandbox" || j(e) ? [] : e.value === R ? M.inline : Ct(e.value)
|
|
486
484
|
) : [],
|
|
487
|
-
[p,
|
|
488
|
-
),
|
|
489
|
-
() => K ?
|
|
490
|
-
(e, n) => e.type === "sandbox" ||
|
|
485
|
+
[p, C, R, M]
|
|
486
|
+
), nt = h(
|
|
487
|
+
() => K ? F.map(
|
|
488
|
+
(e, n) => e.type === "sandbox" || j(e) ? e.value : p ? qe(
|
|
491
489
|
e.value,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
) :
|
|
490
|
+
C[n].value,
|
|
491
|
+
ue[n] ?? [],
|
|
492
|
+
M.metadata,
|
|
493
|
+
he[n]
|
|
494
|
+
) : ke(
|
|
497
495
|
e.value,
|
|
498
|
-
|
|
499
|
-
|
|
496
|
+
M.metadata,
|
|
497
|
+
he[n]
|
|
500
498
|
)
|
|
501
499
|
) : [],
|
|
502
500
|
[
|
|
503
501
|
K,
|
|
504
502
|
p,
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
503
|
+
F,
|
|
504
|
+
ue,
|
|
505
|
+
C,
|
|
506
|
+
M.metadata,
|
|
507
|
+
he
|
|
510
508
|
]
|
|
511
|
-
),
|
|
509
|
+
), rt = h(() => {
|
|
512
510
|
const e = [];
|
|
513
|
-
|
|
511
|
+
C.forEach((n, a) => {
|
|
514
512
|
const d = e.at(-1);
|
|
515
513
|
n.type !== "sandbox" && d && !d.sandbox ? d.indices.push(a) : e.push({ indices: [a], sandbox: n.type === "sandbox" });
|
|
516
514
|
});
|
|
517
515
|
for (const n of e)
|
|
518
|
-
if (!n.sandbox && n.indices.some((a) =>
|
|
519
|
-
const a = n.indices.map((
|
|
520
|
-
n.plan =
|
|
516
|
+
if (!n.sandbox && n.indices.some((a) => j(C[a]))) {
|
|
517
|
+
const a = n.indices.map((k) => C[k]), d = a.map((k) => k.value).join("");
|
|
518
|
+
n.plan = At(
|
|
521
519
|
a,
|
|
522
|
-
d === R ?
|
|
520
|
+
d === R ? M : void 0
|
|
523
521
|
);
|
|
524
522
|
}
|
|
525
523
|
return e;
|
|
526
|
-
}, [
|
|
527
|
-
() =>
|
|
528
|
-
[
|
|
529
|
-
),
|
|
530
|
-
() => K ? "" :
|
|
531
|
-
p ?
|
|
532
|
-
|
|
524
|
+
}, [C, R, M]), G = K ? F.map((e) => e.value).join("") : p ? E : R, ot = h(
|
|
525
|
+
() => x ? xe(G) : "",
|
|
526
|
+
[x, G]
|
|
527
|
+
), $e = h(
|
|
528
|
+
() => K ? "" : xe(
|
|
529
|
+
p ? qe(
|
|
530
|
+
G,
|
|
533
531
|
R,
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
) :
|
|
537
|
-
|
|
538
|
-
|
|
532
|
+
ue[0] ?? [],
|
|
533
|
+
M.metadata
|
|
534
|
+
) : ke(
|
|
535
|
+
G,
|
|
536
|
+
M.metadata
|
|
539
537
|
)
|
|
540
538
|
),
|
|
541
539
|
[
|
|
542
540
|
R,
|
|
543
541
|
K,
|
|
544
542
|
p,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
543
|
+
G,
|
|
544
|
+
ue,
|
|
545
|
+
M.metadata
|
|
548
546
|
]
|
|
549
|
-
),
|
|
550
|
-
() =>
|
|
551
|
-
|
|
547
|
+
), ge = h(
|
|
548
|
+
() => Nt(
|
|
549
|
+
G,
|
|
552
550
|
l,
|
|
553
551
|
i
|
|
554
552
|
),
|
|
555
|
-
[i,
|
|
556
|
-
),
|
|
557
|
-
() => l ? l.split(",").map((e) =>
|
|
553
|
+
[i, G, l]
|
|
554
|
+
), Ee = ($ ? ze.trimVariablePadding($) : void 0) || ge.buttonText, Pe = z?.trim() || ge.inputText, st = h(
|
|
555
|
+
() => l ? l.split(",").map((e) => ze.trimVariablePadding(e)).filter(Boolean) : void 0,
|
|
558
556
|
[l]
|
|
559
|
-
),
|
|
560
|
-
|
|
561
|
-
),
|
|
557
|
+
), at = I?.length ? I : ge.selectedValues || st, Ie = Ut(
|
|
558
|
+
at
|
|
559
|
+
), y = T({
|
|
562
560
|
onPlaceholderAccepted: t,
|
|
563
|
-
direction:
|
|
564
|
-
language:
|
|
565
|
-
mermaidMessages:
|
|
566
|
-
beforeSend:
|
|
561
|
+
direction: S,
|
|
562
|
+
language: N,
|
|
563
|
+
mermaidMessages: ee,
|
|
564
|
+
beforeSend: ce,
|
|
567
565
|
locale: o,
|
|
568
|
-
onClickCustomButtonAfterContent:
|
|
566
|
+
onClickCustomButtonAfterContent: ae,
|
|
569
567
|
onSend: g,
|
|
570
|
-
readonly:
|
|
571
|
-
renderContent:
|
|
572
|
-
resolvedConfirmButtonText:
|
|
573
|
-
resolvedCopiedButtonText:
|
|
574
|
-
resolvedCopyButtonText:
|
|
575
|
-
resolvedDefaultButtonText:
|
|
576
|
-
resolvedDefaultInputText:
|
|
577
|
-
resolvedDefaultSelectedValues:
|
|
568
|
+
readonly: w,
|
|
569
|
+
renderContent: G,
|
|
570
|
+
resolvedConfirmButtonText: te,
|
|
571
|
+
resolvedCopiedButtonText: Re,
|
|
572
|
+
resolvedCopyButtonText: Se,
|
|
573
|
+
resolvedDefaultButtonText: Ee,
|
|
574
|
+
resolvedDefaultInputText: Pe,
|
|
575
|
+
resolvedDefaultSelectedValues: Ie
|
|
578
576
|
});
|
|
579
|
-
|
|
577
|
+
y.current = {
|
|
580
578
|
onPlaceholderAccepted: t,
|
|
581
|
-
direction:
|
|
582
|
-
language:
|
|
583
|
-
mermaidMessages:
|
|
584
|
-
beforeSend:
|
|
579
|
+
direction: S,
|
|
580
|
+
language: N,
|
|
581
|
+
mermaidMessages: ee,
|
|
582
|
+
beforeSend: ce,
|
|
585
583
|
locale: o,
|
|
586
|
-
onClickCustomButtonAfterContent:
|
|
584
|
+
onClickCustomButtonAfterContent: ae,
|
|
587
585
|
onSend: g,
|
|
588
|
-
readonly:
|
|
589
|
-
renderContent:
|
|
590
|
-
resolvedConfirmButtonText:
|
|
591
|
-
resolvedCopiedButtonText:
|
|
592
|
-
resolvedCopyButtonText:
|
|
593
|
-
resolvedDefaultButtonText:
|
|
594
|
-
resolvedDefaultInputText:
|
|
595
|
-
resolvedDefaultSelectedValues:
|
|
586
|
+
readonly: w,
|
|
587
|
+
renderContent: G,
|
|
588
|
+
resolvedConfirmButtonText: te,
|
|
589
|
+
resolvedCopiedButtonText: Re,
|
|
590
|
+
resolvedCopyButtonText: Se,
|
|
591
|
+
resolvedDefaultButtonText: Ee,
|
|
592
|
+
resolvedDefaultInputText: Pe,
|
|
593
|
+
resolvedDefaultSelectedValues: Ie
|
|
596
594
|
};
|
|
597
|
-
const
|
|
595
|
+
const ve = h(
|
|
598
596
|
() => ({
|
|
599
597
|
"custom-button-after-content": ({
|
|
600
598
|
children: e
|
|
@@ -602,28 +600,28 @@ const _t = 2, be = ({
|
|
|
602
600
|
"button",
|
|
603
601
|
{
|
|
604
602
|
className: "content-render-custom-button-after-content",
|
|
605
|
-
onClick:
|
|
603
|
+
onClick: y.current.onClickCustomButtonAfterContent,
|
|
606
604
|
children: /* @__PURE__ */ s("span", { className: "content-render-custom-button-after-content-inner", children: e })
|
|
607
605
|
}
|
|
608
606
|
),
|
|
609
607
|
"custom-variable": (e) => /* @__PURE__ */ s(
|
|
610
|
-
|
|
608
|
+
ft,
|
|
611
609
|
{
|
|
612
610
|
...e,
|
|
613
|
-
readonly:
|
|
614
|
-
defaultButtonText:
|
|
615
|
-
defaultInputText:
|
|
616
|
-
defaultSelectedValues:
|
|
617
|
-
onSend:
|
|
618
|
-
onPlaceholderAccepted:
|
|
619
|
-
beforeSend:
|
|
620
|
-
locale:
|
|
621
|
-
dir:
|
|
622
|
-
lang:
|
|
623
|
-
confirmButtonText:
|
|
611
|
+
readonly: y.current.readonly,
|
|
612
|
+
defaultButtonText: y.current.resolvedDefaultButtonText,
|
|
613
|
+
defaultInputText: y.current.resolvedDefaultInputText,
|
|
614
|
+
defaultSelectedValues: y.current.resolvedDefaultSelectedValues,
|
|
615
|
+
onSend: y.current.onSend,
|
|
616
|
+
onPlaceholderAccepted: y.current.onPlaceholderAccepted,
|
|
617
|
+
beforeSend: y.current.beforeSend,
|
|
618
|
+
locale: y.current.locale,
|
|
619
|
+
dir: y.current.direction,
|
|
620
|
+
lang: y.current.language,
|
|
621
|
+
confirmButtonText: y.current.resolvedConfirmButtonText
|
|
624
622
|
}
|
|
625
623
|
),
|
|
626
|
-
code:
|
|
624
|
+
code: Ue,
|
|
627
625
|
table: ({ ...e }) => /* @__PURE__ */ s("div", { className: "content-render-table-container", children: /* @__PURE__ */ s("table", { className: "content-render-table", ...e }) }),
|
|
628
626
|
th: ({ ...e }) => /* @__PURE__ */ s("th", { className: "content-render-th", ...e }),
|
|
629
627
|
td: ({ ...e }) => /* @__PURE__ */ s("td", { className: "content-render-td", ...e }),
|
|
@@ -645,122 +643,120 @@ const _t = 2, be = ({
|
|
|
645
643
|
) : /* @__PURE__ */ s("input", { ...e }),
|
|
646
644
|
a: ({ children: e, ...n }) => /* @__PURE__ */ s("a", { target: "_blank", rel: "noopener noreferrer", ...n, children: e }),
|
|
647
645
|
pre: (e) => /* @__PURE__ */ s(
|
|
648
|
-
|
|
646
|
+
mt,
|
|
649
647
|
{
|
|
650
648
|
...e,
|
|
651
|
-
copyButtonText:
|
|
652
|
-
copiedButtonText:
|
|
649
|
+
copyButtonText: y.current.resolvedCopyButtonText,
|
|
650
|
+
copiedButtonText: y.current.resolvedCopiedButtonText
|
|
653
651
|
}
|
|
654
652
|
)
|
|
655
653
|
}),
|
|
656
654
|
[]
|
|
657
|
-
),
|
|
658
|
-
() =>
|
|
659
|
-
[
|
|
660
|
-
),
|
|
661
|
-
const a =
|
|
662
|
-
return
|
|
663
|
-
const Y = `${n}-${
|
|
664
|
-
return
|
|
665
|
-
|
|
655
|
+
), ct = h(
|
|
656
|
+
() => Ge($e),
|
|
657
|
+
[$e]
|
|
658
|
+
), it = (e, n) => {
|
|
659
|
+
const a = xe(e);
|
|
660
|
+
return Ge(a).map((k, ye) => {
|
|
661
|
+
const Y = `${n}-${k.type}-${ye}`;
|
|
662
|
+
return k.type === "text" ? /* @__PURE__ */ s(
|
|
663
|
+
le.Provider,
|
|
666
664
|
{
|
|
667
|
-
value:
|
|
665
|
+
value: y,
|
|
668
666
|
children: /* @__PURE__ */ s(
|
|
669
|
-
|
|
667
|
+
He,
|
|
670
668
|
{
|
|
671
669
|
locale: o,
|
|
672
|
-
components:
|
|
673
|
-
content:
|
|
670
|
+
components: ve,
|
|
671
|
+
content: k.value
|
|
674
672
|
}
|
|
675
673
|
)
|
|
676
674
|
},
|
|
677
675
|
Y
|
|
678
|
-
) :
|
|
679
|
-
|
|
676
|
+
) : k.type === "mermaid" ? /* @__PURE__ */ s(
|
|
677
|
+
Ce,
|
|
680
678
|
{
|
|
681
|
-
chart:
|
|
682
|
-
frozen: !
|
|
683
|
-
messages:
|
|
679
|
+
chart: k.value,
|
|
680
|
+
frozen: !k.complete,
|
|
681
|
+
messages: ee
|
|
684
682
|
},
|
|
685
683
|
Y
|
|
686
|
-
) :
|
|
684
|
+
) : k.type === "svg" ? /* @__PURE__ */ s(Te, { svg: k.value }, Y) : null;
|
|
687
685
|
});
|
|
688
|
-
},
|
|
686
|
+
}, De = x ? /* @__PURE__ */ s("div", { className: "content-render-custom-bar", children: X.createElement(x, {
|
|
689
687
|
content: r,
|
|
690
|
-
displayContent:
|
|
688
|
+
displayContent: ot,
|
|
691
689
|
onSend: g
|
|
692
690
|
}) }) : null;
|
|
693
|
-
return K ? /* @__PURE__ */
|
|
691
|
+
return K ? /* @__PURE__ */ We(
|
|
694
692
|
"div",
|
|
695
693
|
{
|
|
696
694
|
className: "content-render markdown-body",
|
|
697
|
-
dir:
|
|
698
|
-
lang:
|
|
695
|
+
dir: S,
|
|
696
|
+
lang: N,
|
|
699
697
|
children: [
|
|
700
|
-
|
|
701
|
-
const n = e.indices[0], a =
|
|
698
|
+
rt.map((e) => {
|
|
699
|
+
const n = e.indices[0], a = F[n];
|
|
702
700
|
return e.sandbox ? a.type === "sandbox" && a.value && !a.pending ? /* @__PURE__ */ s(
|
|
703
|
-
|
|
701
|
+
kt,
|
|
704
702
|
{
|
|
705
703
|
hideFullScreen: !0,
|
|
706
704
|
type: "sandbox",
|
|
707
705
|
content: a.value,
|
|
708
706
|
className: "content-render-iframe",
|
|
709
707
|
locale: o,
|
|
710
|
-
dir:
|
|
711
|
-
lang:
|
|
712
|
-
loadingText:
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
exitFullScreenButtonText: et,
|
|
718
|
-
mode: de
|
|
708
|
+
dir: S,
|
|
709
|
+
lang: N,
|
|
710
|
+
loadingText: re,
|
|
711
|
+
disableLoadingOverlay: de,
|
|
712
|
+
fullScreenButtonText: Xe,
|
|
713
|
+
exitFullScreenButtonText: Ze,
|
|
714
|
+
mode: se
|
|
719
715
|
},
|
|
720
716
|
`sandbox-${n}`
|
|
721
717
|
) : null : e.plan ? /* @__PURE__ */ s(
|
|
722
|
-
|
|
718
|
+
le.Provider,
|
|
723
719
|
{
|
|
724
|
-
value:
|
|
720
|
+
value: y,
|
|
725
721
|
children: /* @__PURE__ */ s(
|
|
726
|
-
|
|
722
|
+
jt,
|
|
727
723
|
{
|
|
728
724
|
locale: o,
|
|
729
|
-
components:
|
|
725
|
+
components: ve,
|
|
730
726
|
plan: e.plan,
|
|
731
727
|
renderedSegments: e.indices.map(
|
|
732
|
-
(d) =>
|
|
728
|
+
(d) => F[d]
|
|
733
729
|
)
|
|
734
730
|
}
|
|
735
731
|
)
|
|
736
732
|
},
|
|
737
733
|
`md-${n}`
|
|
738
|
-
) : e.indices.map((d) => /* @__PURE__ */ s(X.Fragment, { children:
|
|
739
|
-
|
|
734
|
+
) : e.indices.map((d) => /* @__PURE__ */ s(X.Fragment, { children: F[d].type === "markdown" && F[d].pending ? null : it(
|
|
735
|
+
nt[d],
|
|
740
736
|
`md-${d}`
|
|
741
737
|
) }, `md-${d}`));
|
|
742
738
|
}),
|
|
743
|
-
|
|
739
|
+
De
|
|
744
740
|
]
|
|
745
741
|
}
|
|
746
|
-
) : /* @__PURE__ */
|
|
742
|
+
) : /* @__PURE__ */ We(
|
|
747
743
|
"div",
|
|
748
744
|
{
|
|
749
745
|
className: "content-render markdown-body",
|
|
750
|
-
dir:
|
|
751
|
-
lang:
|
|
746
|
+
dir: S,
|
|
747
|
+
lang: N,
|
|
752
748
|
children: [
|
|
753
|
-
|
|
749
|
+
ct.map((e, n) => {
|
|
754
750
|
if (e.type === "text")
|
|
755
751
|
return /* @__PURE__ */ s(
|
|
756
|
-
|
|
752
|
+
le.Provider,
|
|
757
753
|
{
|
|
758
|
-
value:
|
|
754
|
+
value: y,
|
|
759
755
|
children: /* @__PURE__ */ s(
|
|
760
|
-
|
|
756
|
+
He,
|
|
761
757
|
{
|
|
762
758
|
locale: o,
|
|
763
|
-
components:
|
|
759
|
+
components: ve,
|
|
764
760
|
content: e.value
|
|
765
761
|
}
|
|
766
762
|
)
|
|
@@ -769,24 +765,24 @@ const _t = 2, be = ({
|
|
|
769
765
|
);
|
|
770
766
|
if (e.type === "mermaid")
|
|
771
767
|
return /* @__PURE__ */ s(
|
|
772
|
-
|
|
768
|
+
Ce,
|
|
773
769
|
{
|
|
774
770
|
chart: e.value,
|
|
775
771
|
frozen: !e.complete,
|
|
776
|
-
messages:
|
|
772
|
+
messages: ee
|
|
777
773
|
},
|
|
778
774
|
n
|
|
779
775
|
);
|
|
780
776
|
if (e.type === "svg")
|
|
781
|
-
return /* @__PURE__ */ s(
|
|
777
|
+
return /* @__PURE__ */ s(Te, { svg: e.value }, n);
|
|
782
778
|
}),
|
|
783
|
-
|
|
779
|
+
De
|
|
784
780
|
]
|
|
785
781
|
}
|
|
786
782
|
);
|
|
787
783
|
};
|
|
788
784
|
export {
|
|
789
|
-
|
|
790
|
-
|
|
785
|
+
He as MarkdownRenderer,
|
|
786
|
+
Ln as default
|
|
791
787
|
};
|
|
792
788
|
//# sourceMappingURL=ContentRender.es.js.map
|