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