@haklex/rich-compose 0.23.0 → 0.25.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/README.md +1 -1
- package/dist/editor.d.ts +2 -1
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.mjs +3 -1
- package/dist/litexml-html-preview-client.css +200 -5
- package/dist/litexml-html-preview-client.js +402 -139
- package/dist/module-Db26fECJ.js +26 -0
- package/dist/modules/dynamic/edit.d.ts +3 -0
- package/dist/modules/dynamic/edit.d.ts.map +1 -0
- package/dist/modules/dynamic/edit.mjs +12 -0
- package/dist/modules/dynamic/index.d.ts +7 -0
- package/dist/modules/dynamic/index.d.ts.map +1 -0
- package/dist/modules/dynamic/index.mjs +3 -0
- package/dist/modules/dynamic/module-config.d.ts +3 -0
- package/dist/modules/dynamic/module-config.d.ts.map +1 -0
- package/dist/modules/dynamic/module.d.ts +2 -0
- package/dist/modules/dynamic/module.d.ts.map +1 -0
- package/dist/modules/dynamic/node.d.ts +6 -0
- package/dist/modules/dynamic/node.d.ts.map +1 -0
- package/dist/modules/dynamic/node.mjs +5 -0
- package/dist/modules/dynamic/renderer.d.ts +4 -0
- package/dist/modules/dynamic/renderer.d.ts.map +1 -0
- package/dist/modules/dynamic/types.d.ts +4 -0
- package/dist/modules/dynamic/types.d.ts.map +1 -0
- package/dist/renderer.d.ts +2 -1
- package/dist/renderer.d.ts.map +1 -1
- package/dist/renderer.mjs +3 -1
- package/dist/style/alert.css +1 -1
- package/dist/style/code-block.css +1 -1
- package/dist/style/code-snippet.css +1 -1
- package/dist/style/embed.css +1 -1
- package/dist/style/image.css +1 -1
- package/dist/style/mermaid.css +1 -1
- package/dist/style/poll.css +1 -1
- package/dist/style/video.css +1 -1
- package/dist/style.css +8 -8
- package/package.json +35 -22
|
@@ -9340,7 +9340,7 @@
|
|
|
9340
9340
|
* @returns {string}
|
|
9341
9341
|
* Serialized node.
|
|
9342
9342
|
*/
|
|
9343
|
-
function root$
|
|
9343
|
+
function root$22(node, _1, _2, state) {
|
|
9344
9344
|
return state.all(node);
|
|
9345
9345
|
}
|
|
9346
9346
|
var init_root$2 = __esmMin((() => {}));
|
|
@@ -9385,7 +9385,7 @@
|
|
|
9385
9385
|
doctype: doctype$3,
|
|
9386
9386
|
element: element$8,
|
|
9387
9387
|
raw: raw$1,
|
|
9388
|
-
root: root$
|
|
9388
|
+
root: root$22,
|
|
9389
9389
|
text: text$14
|
|
9390
9390
|
}
|
|
9391
9391
|
});
|
|
@@ -22712,11 +22712,11 @@
|
|
|
22712
22712
|
var init_shared_css_ts_vanilla = __esmMin((() => {}));
|
|
22713
22713
|
//#endregion
|
|
22714
22714
|
//#region ../rich-editor/src/styles/shared.css.ts
|
|
22715
|
-
var semanticClassNames$
|
|
22715
|
+
var semanticClassNames$12, sharedStyles;
|
|
22716
22716
|
var init_shared_css = __esmMin((() => {
|
|
22717
22717
|
init_vars_css_ts_vanilla();
|
|
22718
22718
|
init_shared_css_ts_vanilla();
|
|
22719
|
-
semanticClassNames$
|
|
22719
|
+
semanticClassNames$12 = {
|
|
22720
22720
|
paragraph: "rich-paragraph",
|
|
22721
22721
|
textBold: "rich-text-bold",
|
|
22722
22722
|
textItalic: "rich-text-italic",
|
|
@@ -22912,17 +22912,17 @@
|
|
|
22912
22912
|
behavior: "smooth",
|
|
22913
22913
|
block: "center"
|
|
22914
22914
|
});
|
|
22915
|
-
target.classList.add(semanticClassNames$
|
|
22915
|
+
target.classList.add(semanticClassNames$12.footnoteHighlight, sharedStyles.footnoteHighlight);
|
|
22916
22916
|
window.setTimeout(() => {
|
|
22917
|
-
target.classList.remove(semanticClassNames$
|
|
22917
|
+
target.classList.remove(semanticClassNames$12.footnoteHighlight, sharedStyles.footnoteHighlight);
|
|
22918
22918
|
}, 1200);
|
|
22919
22919
|
}, [identifier, targetId]);
|
|
22920
22920
|
const label = displayNumber ?? identifier;
|
|
22921
22921
|
return /* @__PURE__ */ (0, import_jsx_runtime$231.jsx)("span", {
|
|
22922
|
-
className: clsx$2(semanticClassNames$
|
|
22922
|
+
className: clsx$2(semanticClassNames$12.footnoteRefWrapper, sharedStyles.footnoteRefWrapper),
|
|
22923
22923
|
children: /* @__PURE__ */ (0, import_jsx_runtime$231.jsx)("a", {
|
|
22924
22924
|
"aria-label": content ? `Footnote ${label}: ${content}` : `Footnote ${label}`,
|
|
22925
|
-
className: clsx$2(semanticClassNames$
|
|
22925
|
+
className: clsx$2(semanticClassNames$12.footnoteRef, sharedStyles.footnoteRef),
|
|
22926
22926
|
"data-footnote-ref": identifier,
|
|
22927
22927
|
href: `#${targetId}`,
|
|
22928
22928
|
id: referenceId,
|
|
@@ -48824,9 +48824,9 @@
|
|
|
48824
48824
|
function RubyRenderer$1({ reading, children }) {
|
|
48825
48825
|
if (!reading) return /* @__PURE__ */ (0, import_jsx_runtime$228.jsx)(import_jsx_runtime$228.Fragment, { children });
|
|
48826
48826
|
return /* @__PURE__ */ (0, import_jsx_runtime$228.jsxs)("ruby", {
|
|
48827
|
-
className: clsx$2(semanticClassNames$
|
|
48827
|
+
className: clsx$2(semanticClassNames$12.ruby, sharedStyles.ruby),
|
|
48828
48828
|
children: [children, /* @__PURE__ */ (0, import_jsx_runtime$228.jsx)("rt", {
|
|
48829
|
-
className: clsx$2(semanticClassNames$
|
|
48829
|
+
className: clsx$2(semanticClassNames$12.rubyRt, sharedStyles.rubyRt),
|
|
48830
48830
|
children: reading
|
|
48831
48831
|
})]
|
|
48832
48832
|
});
|
|
@@ -59622,7 +59622,7 @@
|
|
|
59622
59622
|
//#endregion
|
|
59623
59623
|
//#region ../rich-editor/src/components/LinkFavicon.tsx
|
|
59624
59624
|
function LinkFavicon({ href, source, noIcon = false, className, platformIconMap, getPlatformFromUrl }) {
|
|
59625
|
-
const faviconClassName = clsx$2(semanticClassNames$
|
|
59625
|
+
const faviconClassName = clsx$2(semanticClassNames$12.linkFavicon, sharedStyles.linkFavicon, className);
|
|
59626
59626
|
const [faviconUrl, setFaviconUrl] = (0, import_react$178.useState)(null);
|
|
59627
59627
|
(0, import_react$178.useEffect)(() => {
|
|
59628
59628
|
if (!href) return;
|
|
@@ -64768,11 +64768,11 @@
|
|
|
64768
64768
|
}
|
|
64769
64769
|
createDOM(_config) {
|
|
64770
64770
|
const div = document.createElement("div");
|
|
64771
|
-
div.className = `${semanticClassNames$
|
|
64771
|
+
div.className = `${semanticClassNames$12.alert} ${sharedStyles.alert} rich-alert-${this.__alertType}`;
|
|
64772
64772
|
return div;
|
|
64773
64773
|
}
|
|
64774
64774
|
updateDOM(prevNode, dom) {
|
|
64775
|
-
if (prevNode.__alertType !== this.__alertType) dom.className = `${semanticClassNames$
|
|
64775
|
+
if (prevNode.__alertType !== this.__alertType) dom.className = `${semanticClassNames$12.alert} ${sharedStyles.alert} rich-alert-${this.__alertType}`;
|
|
64776
64776
|
return false;
|
|
64777
64777
|
}
|
|
64778
64778
|
isInline() {
|
|
@@ -65190,7 +65190,7 @@
|
|
|
65190
65190
|
"span": () => ({
|
|
65191
65191
|
conversion: (domNode) => {
|
|
65192
65192
|
if (!(domNode instanceof HTMLElement)) return null;
|
|
65193
|
-
if (!domNode.classList.contains(semanticClassNames$
|
|
65193
|
+
if (!domNode.classList.contains(semanticClassNames$12.comment)) return null;
|
|
65194
65194
|
return { node: $createCommentNode(domNode.dataset.comment ?? domNode.textContent ?? "") };
|
|
65195
65195
|
},
|
|
65196
65196
|
priority: 2
|
|
@@ -65202,13 +65202,13 @@
|
|
|
65202
65202
|
}
|
|
65203
65203
|
createDOM(config) {
|
|
65204
65204
|
const element = super.createDOM(config);
|
|
65205
|
-
element.classList.add(semanticClassNames$
|
|
65205
|
+
element.classList.add(semanticClassNames$12.comment, sharedStyles.comment);
|
|
65206
65206
|
element.dataset.comment = this.__text;
|
|
65207
65207
|
return element;
|
|
65208
65208
|
}
|
|
65209
65209
|
updateDOM(prevNode, dom, config) {
|
|
65210
65210
|
const updated = super.updateDOM(prevNode, dom, config);
|
|
65211
|
-
dom.classList.add(semanticClassNames$
|
|
65211
|
+
dom.classList.add(semanticClassNames$12.comment, sharedStyles.comment);
|
|
65212
65212
|
if (prevNode.__text !== this.__text) dom.dataset.comment = this.__text;
|
|
65213
65213
|
return updated;
|
|
65214
65214
|
}
|
|
@@ -65458,7 +65458,7 @@
|
|
|
65458
65458
|
}
|
|
65459
65459
|
createDOM(_config) {
|
|
65460
65460
|
const sup = document.createElement("sup");
|
|
65461
|
-
sup.className = `${semanticClassNames$
|
|
65461
|
+
sup.className = `${semanticClassNames$12.footnote} ${sharedStyles.footnote}`;
|
|
65462
65462
|
return sup;
|
|
65463
65463
|
}
|
|
65464
65464
|
updateDOM() {
|
|
@@ -65498,9 +65498,9 @@
|
|
|
65498
65498
|
if (sortedEntries.length === 0) return null;
|
|
65499
65499
|
return /* @__PURE__ */ (0, import_jsx_runtime$217.jsxs)("div", {
|
|
65500
65500
|
role: "doc-endnotes",
|
|
65501
|
-
className: clsx$2("rich-footnote-section-content", semanticClassNames$
|
|
65502
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime$217.jsx)("hr", { className: clsx$2(semanticClassNames$
|
|
65503
|
-
className: clsx$2(semanticClassNames$
|
|
65501
|
+
className: clsx$2("rich-footnote-section-content", semanticClassNames$12.footnoteSection, sharedStyles.footnoteSection),
|
|
65502
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime$217.jsx)("hr", { className: clsx$2(semanticClassNames$12.footnoteSectionDivider, sharedStyles.footnoteSectionDivider) }), /* @__PURE__ */ (0, import_jsx_runtime$217.jsx)("ol", {
|
|
65503
|
+
className: clsx$2(semanticClassNames$12.footnoteSectionList, sharedStyles.footnoteSectionList),
|
|
65504
65504
|
children: sortedEntries.map(([identifier, content]) => {
|
|
65505
65505
|
return /* @__PURE__ */ (0, import_jsx_runtime$217.jsx)(FootnoteSectionItem, {
|
|
65506
65506
|
content,
|
|
@@ -65522,13 +65522,13 @@
|
|
|
65522
65522
|
behavior: "smooth",
|
|
65523
65523
|
block: "center"
|
|
65524
65524
|
});
|
|
65525
|
-
refElement.classList.add(semanticClassNames$
|
|
65525
|
+
refElement.classList.add(semanticClassNames$12.footnoteHighlight, sharedStyles.footnoteHighlight);
|
|
65526
65526
|
window.setTimeout(() => {
|
|
65527
|
-
refElement.classList.remove(semanticClassNames$
|
|
65527
|
+
refElement.classList.remove(semanticClassNames$12.footnoteHighlight, sharedStyles.footnoteHighlight);
|
|
65528
65528
|
}, 1200);
|
|
65529
65529
|
}, [refId]);
|
|
65530
65530
|
return /* @__PURE__ */ (0, import_jsx_runtime$217.jsxs)("li", {
|
|
65531
|
-
className: clsx$2(semanticClassNames$
|
|
65531
|
+
className: clsx$2(semanticClassNames$12.footnoteSectionItem, sharedStyles.footnoteSectionItem),
|
|
65532
65532
|
id: targetId,
|
|
65533
65533
|
value: typeof displayNum === "number" ? displayNum : void 0,
|
|
65534
65534
|
children: [/* @__PURE__ */ (0, import_jsx_runtime$217.jsx)("span", {
|
|
@@ -65536,7 +65536,7 @@
|
|
|
65536
65536
|
children: content
|
|
65537
65537
|
}), /* @__PURE__ */ (0, import_jsx_runtime$217.jsx)("a", {
|
|
65538
65538
|
"aria-label": `Back to reference ${displayNum}`,
|
|
65539
|
-
className: clsx$2(semanticClassNames$
|
|
65539
|
+
className: clsx$2(semanticClassNames$12.footnoteBackRef, sharedStyles.footnoteBackRef),
|
|
65540
65540
|
href: `#${refId}`,
|
|
65541
65541
|
role: "doc-backlink",
|
|
65542
65542
|
onClick: handleBackClick,
|
|
@@ -65579,7 +65579,7 @@
|
|
|
65579
65579
|
}
|
|
65580
65580
|
createDOM(_config) {
|
|
65581
65581
|
const div = document.createElement("div");
|
|
65582
|
-
div.className = `${semanticClassNames$
|
|
65582
|
+
div.className = `${semanticClassNames$12.footnoteSection} ${sharedStyles.footnoteSection}`;
|
|
65583
65583
|
return div;
|
|
65584
65584
|
}
|
|
65585
65585
|
updateDOM() {
|
|
@@ -66839,12 +66839,12 @@
|
|
|
66839
66839
|
}
|
|
66840
66840
|
exportDOM() {
|
|
66841
66841
|
const ruby = document.createElement("ruby");
|
|
66842
|
-
ruby.className = `${semanticClassNames$
|
|
66842
|
+
ruby.className = `${semanticClassNames$12.ruby} ${sharedStyles.ruby}`;
|
|
66843
66843
|
const baseText = this.getTextContent();
|
|
66844
66844
|
if (baseText) ruby.append(baseText);
|
|
66845
66845
|
if (this.__reading) {
|
|
66846
66846
|
const rt = document.createElement("rt");
|
|
66847
|
-
rt.className = `${semanticClassNames$
|
|
66847
|
+
rt.className = `${semanticClassNames$12.rubyRt} ${sharedStyles.rubyRt}`;
|
|
66848
66848
|
rt.textContent = this.__reading;
|
|
66849
66849
|
ruby.append(rt);
|
|
66850
66850
|
}
|
|
@@ -66852,7 +66852,7 @@
|
|
|
66852
66852
|
}
|
|
66853
66853
|
createDOM(_config) {
|
|
66854
66854
|
const span = document.createElement("span");
|
|
66855
|
-
span.className = `${semanticClassNames$
|
|
66855
|
+
span.className = `${semanticClassNames$12.ruby} ${sharedStyles.ruby}`;
|
|
66856
66856
|
if (this.__reading) span.dataset.ruby = this.__reading;
|
|
66857
66857
|
return span;
|
|
66858
66858
|
}
|
|
@@ -66900,13 +66900,13 @@
|
|
|
66900
66900
|
}
|
|
66901
66901
|
createDOM(_config) {
|
|
66902
66902
|
const span = document.createElement("span");
|
|
66903
|
-
span.className = `${semanticClassNames$
|
|
66903
|
+
span.className = `${semanticClassNames$12.spoiler} ${sharedStyles.spoiler}`;
|
|
66904
66904
|
span.setAttribute("role", "button");
|
|
66905
66905
|
span.setAttribute("tabindex", "0");
|
|
66906
66906
|
span.setAttribute("aria-label", "Spoiler (click to reveal)");
|
|
66907
66907
|
const toggle = () => {
|
|
66908
66908
|
if (span.isContentEditable) return;
|
|
66909
|
-
span.classList.toggle(semanticClassNames$
|
|
66909
|
+
span.classList.toggle(semanticClassNames$12.spoilerRevealed);
|
|
66910
66910
|
const revealed = span.classList.toggle(sharedStyles.spoilerRevealed);
|
|
66911
66911
|
span.setAttribute("aria-label", revealed ? "Spoiler (revealed)" : "Spoiler (click to reveal)");
|
|
66912
66912
|
};
|
|
@@ -66956,7 +66956,7 @@
|
|
|
66956
66956
|
init_shared_css();
|
|
66957
66957
|
init_tag_color();
|
|
66958
66958
|
init_defineProperty();
|
|
66959
|
-
tagClassName = `${semanticClassNames$
|
|
66959
|
+
tagClassName = `${semanticClassNames$12.tag} ${sharedStyles.tag}`;
|
|
66960
66960
|
TagNode = class TagNode extends Rr$2 {
|
|
66961
66961
|
static getType() {
|
|
66962
66962
|
return "tag";
|
|
@@ -66968,7 +66968,7 @@
|
|
|
66968
66968
|
return { span: () => ({
|
|
66969
66969
|
conversion: (domNode) => {
|
|
66970
66970
|
if (!(domNode instanceof HTMLElement)) return null;
|
|
66971
|
-
if (!domNode.classList.contains(semanticClassNames$
|
|
66971
|
+
if (!domNode.classList.contains(semanticClassNames$12.tag)) return null;
|
|
66972
66972
|
return { node: $createTagNode(domNode.textContent ?? "") };
|
|
66973
66973
|
},
|
|
66974
66974
|
priority: 2
|
|
@@ -66979,13 +66979,13 @@
|
|
|
66979
66979
|
}
|
|
66980
66980
|
createDOM(config) {
|
|
66981
66981
|
const element = super.createDOM(config);
|
|
66982
|
-
element.classList.add(semanticClassNames$
|
|
66982
|
+
element.classList.add(semanticClassNames$12.tag, sharedStyles.tag);
|
|
66983
66983
|
element.style.backgroundColor = getTagBgColor(this.getTextContent());
|
|
66984
66984
|
return element;
|
|
66985
66985
|
}
|
|
66986
66986
|
updateDOM(prevNode, dom, config) {
|
|
66987
66987
|
const updated = super.updateDOM(prevNode, dom, config);
|
|
66988
|
-
dom.classList.add(semanticClassNames$
|
|
66988
|
+
dom.classList.add(semanticClassNames$12.tag, sharedStyles.tag);
|
|
66989
66989
|
if (prevNode.__text !== this.__text) dom.style.backgroundColor = getTagBgColor(this.__text);
|
|
66990
66990
|
return updated;
|
|
66991
66991
|
}
|
|
@@ -67247,7 +67247,7 @@
|
|
|
67247
67247
|
var shared$2, editorTheme;
|
|
67248
67248
|
var init_theme$1 = __esmMin((() => {
|
|
67249
67249
|
init_shared_css();
|
|
67250
|
-
shared$2 = (key) => `${semanticClassNames$
|
|
67250
|
+
shared$2 = (key) => `${semanticClassNames$12[key]} ${sharedStyles[key]}`;
|
|
67251
67251
|
editorTheme = {
|
|
67252
67252
|
text: {
|
|
67253
67253
|
bold: shared$2("textBold"),
|
|
@@ -67463,7 +67463,7 @@
|
|
|
67463
67463
|
//#region src/static-renderer/engine/renderBuiltinNode.tsx
|
|
67464
67464
|
init_static_entry();
|
|
67465
67465
|
init_lucide_react();
|
|
67466
|
-
var shared$1 = (key) => `${semanticClassNames$
|
|
67466
|
+
var shared$1 = (key) => `${semanticClassNames$12[key]} ${sharedStyles[key]}`;
|
|
67467
67467
|
var headingClassNames = {
|
|
67468
67468
|
h1: shared$1("headingH1"),
|
|
67469
67469
|
h2: shared$1("headingH2"),
|
|
@@ -67648,7 +67648,7 @@
|
|
|
67648
67648
|
//#endregion
|
|
67649
67649
|
//#region src/static-renderer/engine/renderTextNode.tsx
|
|
67650
67650
|
init_static_entry();
|
|
67651
|
-
var shared = (key) => `${semanticClassNames$
|
|
67651
|
+
var shared = (key) => `${semanticClassNames$12[key]} ${sharedStyles[key]}`;
|
|
67652
67652
|
var FORMAT_FLAGS = [
|
|
67653
67653
|
[1, "textBold"],
|
|
67654
67654
|
[2, "textItalic"],
|
|
@@ -67720,7 +67720,7 @@
|
|
|
67720
67720
|
init_static_entry();
|
|
67721
67721
|
init_src$40();
|
|
67722
67722
|
init_Lexical_prod();
|
|
67723
|
-
var alertClassName = (type) => `${semanticClassNames$
|
|
67723
|
+
var alertClassName = (type) => `${semanticClassNames$12.alert} ${sharedStyles.alert} rich-alert-${type}`;
|
|
67724
67724
|
function wrapDecoration(serialized, key, decoration) {
|
|
67725
67725
|
switch (serialized.type) {
|
|
67726
67726
|
case "alert-quote": return (0, import_react$186.createElement)("div", {
|
|
@@ -68028,7 +68028,7 @@
|
|
|
68028
68028
|
var init_styles_css_ts_vanilla$4 = __esmMin((() => {}));
|
|
68029
68029
|
//#endregion
|
|
68030
68030
|
//#region ../rich-ext-chat/src/styles.css.ts
|
|
68031
|
-
var container$1, row, rowRight, avatar$2, avatarSmall, avatarDark, avatarImg, bubble, bubbleRightTail, bubbleLeftTail, agent, agentHeader, agentHeaderName, article$2, authorCluster, authorClusterRight, authorLabel, empty$2, semanticClassNames$
|
|
68031
|
+
var container$1, row, rowRight, avatar$2, avatarSmall, avatarDark, avatarImg, bubble, bubbleRightTail, bubbleLeftTail, agent, agentHeader, agentHeaderName, article$2, authorCluster, authorClusterRight, authorLabel, empty$2, semanticClassNames$11;
|
|
68032
68032
|
var init_styles_css$4 = __esmMin((() => {
|
|
68033
68033
|
init_vars_css_ts_vanilla();
|
|
68034
68034
|
init_styles_css_ts_vanilla$4();
|
|
@@ -68050,7 +68050,7 @@
|
|
|
68050
68050
|
authorClusterRight = "_1wforzff";
|
|
68051
68051
|
authorLabel = "_1wforzfg";
|
|
68052
68052
|
empty$2 = "_1wforzfh";
|
|
68053
|
-
semanticClassNames$
|
|
68053
|
+
semanticClassNames$11 = {
|
|
68054
68054
|
container: "rich-chat-container",
|
|
68055
68055
|
row: "rich-chat-row",
|
|
68056
68056
|
bubble: "rich-chat-bubble",
|
|
@@ -79661,7 +79661,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w$60(p), p]));
|
|
|
79661
79661
|
* @returns {Parse5Document}
|
|
79662
79662
|
* Parse5 node.
|
|
79663
79663
|
*/
|
|
79664
|
-
function root$
|
|
79664
|
+
function root$21(node, schema) {
|
|
79665
79665
|
/** @type {Parse5Document} */
|
|
79666
79666
|
const result = {
|
|
79667
79667
|
nodeName: "#document",
|
|
@@ -79869,7 +79869,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w$60(p), p]));
|
|
|
79869
79869
|
emptyOptions$4 = {};
|
|
79870
79870
|
own$5 = {}.hasOwnProperty;
|
|
79871
79871
|
one$3 = zwitch("type", { handlers: {
|
|
79872
|
-
root: root$
|
|
79872
|
+
root: root$21,
|
|
79873
79873
|
element: element$6,
|
|
79874
79874
|
text: text$13,
|
|
79875
79875
|
comment: comment$3,
|
|
@@ -86751,7 +86751,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w$60(p), p]));
|
|
|
86751
86751
|
/** @type {(node: Nodes, state: State) => undefined} */
|
|
86752
86752
|
const one = zwitch("type", {
|
|
86753
86753
|
handlers: {
|
|
86754
|
-
root: root$
|
|
86754
|
+
root: root$20,
|
|
86755
86755
|
element: element$5,
|
|
86756
86756
|
text: text$12,
|
|
86757
86757
|
comment: comment$2,
|
|
@@ -86809,7 +86809,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w$60(p), p]));
|
|
|
86809
86809
|
* @returns {undefined}
|
|
86810
86810
|
* Nothing.
|
|
86811
86811
|
*/
|
|
86812
|
-
function root$
|
|
86812
|
+
function root$20(node, state) {
|
|
86813
86813
|
all$1(node.children, state);
|
|
86814
86814
|
}
|
|
86815
86815
|
/**
|
|
@@ -87454,7 +87454,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w$60(p), p]));
|
|
|
87454
87454
|
case "comment": return comment$1(state, unsafe);
|
|
87455
87455
|
case "doctype": return doctype(state, unsafe);
|
|
87456
87456
|
case "element": return element$4(state, unsafe);
|
|
87457
|
-
case "root": return root$
|
|
87457
|
+
case "root": return root$19(state, unsafe);
|
|
87458
87458
|
case "text": return text$11(state, unsafe);
|
|
87459
87459
|
default:
|
|
87460
87460
|
}
|
|
@@ -87548,7 +87548,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w$60(p), p]));
|
|
|
87548
87548
|
* @returns {Root}
|
|
87549
87549
|
* Safe root.
|
|
87550
87550
|
*/
|
|
87551
|
-
function root$
|
|
87551
|
+
function root$19(state, unsafe) {
|
|
87552
87552
|
/** @type {Root} */
|
|
87553
87553
|
const node = {
|
|
87554
87554
|
type: "root",
|
|
@@ -90007,7 +90007,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w$60(p), p]));
|
|
|
90007
90007
|
* @param {Info} info
|
|
90008
90008
|
* @returns {string}
|
|
90009
90009
|
*/
|
|
90010
|
-
function root$
|
|
90010
|
+
function root$18(node, _, state, info) {
|
|
90011
90011
|
return (node.children.some(function(d) {
|
|
90012
90012
|
return phrasing(d);
|
|
90013
90013
|
}) ? state.containerPhrasing : state.containerFlow).call(state, node, info);
|
|
@@ -90166,7 +90166,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w$60(p), p]));
|
|
|
90166
90166
|
list: list$2,
|
|
90167
90167
|
listItem: listItem$1,
|
|
90168
90168
|
paragraph: paragraph$1,
|
|
90169
|
-
root: root$
|
|
90169
|
+
root: root$18,
|
|
90170
90170
|
strong: strong$1,
|
|
90171
90171
|
text: text$10,
|
|
90172
90172
|
thematicBreak: thematicBreak$2
|
|
@@ -103232,7 +103232,7 @@ $$` : `${n}$$`;
|
|
|
103232
103232
|
if (node.type === "mdxFlowExpression" || node.type === "mdxTextExpression") return mdxExpression(state, node);
|
|
103233
103233
|
if (node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") return mdxJsxElement(state, node, key);
|
|
103234
103234
|
if (node.type === "mdxjsEsm") return mdxEsm(state, node);
|
|
103235
|
-
if (node.type === "root") return root$
|
|
103235
|
+
if (node.type === "root") return root$17(state, node, key);
|
|
103236
103236
|
if (node.type === "text") return text$8(state, node);
|
|
103237
103237
|
}
|
|
103238
103238
|
/**
|
|
@@ -103340,7 +103340,7 @@ $$` : `${n}$$`;
|
|
|
103340
103340
|
* @returns {Child | undefined}
|
|
103341
103341
|
* Child, optional.
|
|
103342
103342
|
*/
|
|
103343
|
-
function root$
|
|
103343
|
+
function root$17(state, node, key) {
|
|
103344
103344
|
/** @type {Props} */
|
|
103345
103345
|
const props = {};
|
|
103346
103346
|
addChildren$1(props, createChildren(state, node));
|
|
@@ -106562,7 +106562,7 @@ $$` : `${n}$$`;
|
|
|
106562
106562
|
* @returns {HastParents}
|
|
106563
106563
|
* hast node.
|
|
106564
106564
|
*/
|
|
106565
|
-
function root$
|
|
106565
|
+
function root$16(state, node) {
|
|
106566
106566
|
/** @type {HastRoot} */
|
|
106567
106567
|
const result = {
|
|
106568
106568
|
type: "root",
|
|
@@ -106903,7 +106903,7 @@ $$` : `${n}$$`;
|
|
|
106903
106903
|
listItem,
|
|
106904
106904
|
list,
|
|
106905
106905
|
paragraph,
|
|
106906
|
-
root: root$
|
|
106906
|
+
root: root$16,
|
|
106907
106907
|
strong,
|
|
106908
106908
|
table: table$1,
|
|
106909
106909
|
tableCell,
|
|
@@ -113629,7 +113629,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
113629
113629
|
avatar$2,
|
|
113630
113630
|
small ? avatarSmall : "",
|
|
113631
113631
|
dark ? avatarDark : "",
|
|
113632
|
-
semanticClassNames$
|
|
113632
|
+
semanticClassNames$11.avatar
|
|
113633
113633
|
].filter(Boolean).join(" ");
|
|
113634
113634
|
if (participant.avatar) return /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)("span", {
|
|
113635
113635
|
className,
|
|
@@ -113653,14 +113653,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
113653
113653
|
const isUser = participant.kind !== "agent";
|
|
113654
113654
|
const displayName = participant.name ?? defaultName(participant.kind);
|
|
113655
113655
|
if (isUser) return /* @__PURE__ */ (0, import_jsx_runtime$208.jsxs)("div", {
|
|
113656
|
-
className: `${row} ${rowRight} ${semanticClassNames$
|
|
113656
|
+
className: `${row} ${rowRight} ${semanticClassNames$11.row}`,
|
|
113657
113657
|
children: [/* @__PURE__ */ (0, import_jsx_runtime$208.jsx)("div", {
|
|
113658
|
-
className: `${bubble} ${bubbleRightTail} ${semanticClassNames$
|
|
113658
|
+
className: `${bubble} ${bubbleRightTail} ${semanticClassNames$11.bubble}`,
|
|
113659
113659
|
children: /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)(Markdown, { content: message.content })
|
|
113660
113660
|
}), /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)(Avatar, { participant })]
|
|
113661
113661
|
});
|
|
113662
113662
|
return /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)("div", {
|
|
113663
|
-
className: `${row} ${semanticClassNames$
|
|
113663
|
+
className: `${row} ${semanticClassNames$11.row}`,
|
|
113664
113664
|
children: /* @__PURE__ */ (0, import_jsx_runtime$208.jsxs)("div", {
|
|
113665
113665
|
className: agent,
|
|
113666
113666
|
children: [/* @__PURE__ */ (0, import_jsx_runtime$208.jsxs)("div", {
|
|
@@ -113674,7 +113674,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
113674
113674
|
children: displayName
|
|
113675
113675
|
})]
|
|
113676
113676
|
}), /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)("div", {
|
|
113677
|
-
className: `${article$2} ${semanticClassNames$
|
|
113677
|
+
className: `${article$2} ${semanticClassNames$11.article}`,
|
|
113678
113678
|
children: /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)(Markdown, { content: message.content })
|
|
113679
113679
|
})]
|
|
113680
113680
|
})
|
|
@@ -113687,32 +113687,32 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
113687
113687
|
const cluster = /* @__PURE__ */ (0, import_jsx_runtime$208.jsxs)("div", {
|
|
113688
113688
|
className: `${authorCluster}${isRight ? ` ${authorClusterRight}` : ""}`,
|
|
113689
113689
|
children: [/* @__PURE__ */ (0, import_jsx_runtime$208.jsx)("span", {
|
|
113690
|
-
className: `${authorLabel} ${semanticClassNames$
|
|
113690
|
+
className: `${authorLabel} ${semanticClassNames$11.author}`,
|
|
113691
113691
|
children: displayName
|
|
113692
113692
|
}), /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)("div", {
|
|
113693
|
-
className: `${bubble} ${tailClass} ${semanticClassNames$
|
|
113693
|
+
className: `${bubble} ${tailClass} ${semanticClassNames$11.bubble}`,
|
|
113694
113694
|
children: /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)(Markdown, { content: message.content })
|
|
113695
113695
|
})]
|
|
113696
113696
|
});
|
|
113697
113697
|
if (isRight) return /* @__PURE__ */ (0, import_jsx_runtime$208.jsxs)("div", {
|
|
113698
|
-
className: `${row} ${rowRight} ${semanticClassNames$
|
|
113698
|
+
className: `${row} ${rowRight} ${semanticClassNames$11.row}`,
|
|
113699
113699
|
children: [cluster, /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)(Avatar, { participant })]
|
|
113700
113700
|
});
|
|
113701
113701
|
return /* @__PURE__ */ (0, import_jsx_runtime$208.jsxs)("div", {
|
|
113702
|
-
className: `${row} ${semanticClassNames$
|
|
113702
|
+
className: `${row} ${semanticClassNames$11.row}`,
|
|
113703
113703
|
children: [/* @__PURE__ */ (0, import_jsx_runtime$208.jsx)(Avatar, { participant }), cluster]
|
|
113704
113704
|
});
|
|
113705
113705
|
};
|
|
113706
113706
|
ChatRenderer = ({ variant, participants, messages }) => {
|
|
113707
113707
|
if (messages.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)("div", {
|
|
113708
|
-
className: `${container$1} ${semanticClassNames$
|
|
113708
|
+
className: `${container$1} ${semanticClassNames$11.container}`,
|
|
113709
113709
|
children: /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)("div", {
|
|
113710
|
-
className: `${empty$2} ${semanticClassNames$
|
|
113710
|
+
className: `${empty$2} ${semanticClassNames$11.empty}`,
|
|
113711
113711
|
children: "Empty chat"
|
|
113712
113712
|
})
|
|
113713
113713
|
});
|
|
113714
113714
|
return /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)("div", {
|
|
113715
|
-
className: `${container$1} ${semanticClassNames$
|
|
113715
|
+
className: `${container$1} ${semanticClassNames$11.container}`,
|
|
113716
113716
|
children: messages.map((message) => {
|
|
113717
113717
|
if (variant === "user-agent") return /* @__PURE__ */ (0, import_jsx_runtime$208.jsx)(UserAgentRow, {
|
|
113718
113718
|
message,
|
|
@@ -113764,12 +113764,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
113764
113764
|
}));
|
|
113765
113765
|
//#endregion
|
|
113766
113766
|
//#region ../rich-ext-code-snippet/src/styles.css.ts.vanilla.css
|
|
113767
|
-
var init_styles_css_ts_vanilla$3 = __esmMin((() => {})), semanticClassNames$
|
|
113767
|
+
var init_styles_css_ts_vanilla$3 = __esmMin((() => {})), semanticClassNames$10, container, header$2, tabs, tab, titleBar, headerActions, copyButton, separator$1, codePanelsWrapper, codePanel, codeScroll, codeBody, fileIcon;
|
|
113768
113768
|
var init_styles_css$3 = __esmMin((() => {
|
|
113769
113769
|
init_vars_css_ts_vanilla();
|
|
113770
113770
|
init_styles_css_ts_vanilla$3();
|
|
113771
113771
|
init_vanilla_extract_recipes_createRuntimeFn_esm();
|
|
113772
|
-
semanticClassNames$
|
|
113772
|
+
semanticClassNames$10 = {
|
|
113773
113773
|
container: "rcs-container",
|
|
113774
113774
|
header: "rcs-header",
|
|
113775
113775
|
tabs: "rcs-tabs",
|
|
@@ -114489,7 +114489,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
114489
114489
|
}, [text]);
|
|
114490
114490
|
return /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("button", {
|
|
114491
114491
|
"aria-label": copied ? "Copied" : "Copy code",
|
|
114492
|
-
className: `${copyButton} ${semanticClassNames$
|
|
114492
|
+
className: `${copyButton} ${semanticClassNames$10.copyButton}`,
|
|
114493
114493
|
type: "button",
|
|
114494
114494
|
onClick: handleCopy,
|
|
114495
114495
|
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)(Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)(Copy, { size: 14 })
|
|
@@ -114523,55 +114523,55 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
114523
114523
|
if (!activeFile) return null;
|
|
114524
114524
|
return /* @__PURE__ */ (0, import_jsx_runtime$204.jsxs)("div", {
|
|
114525
114525
|
"aria-label": "Code snippet",
|
|
114526
|
-
className: `${container} ${semanticClassNames$
|
|
114526
|
+
className: `${container} ${semanticClassNames$10.container}`,
|
|
114527
114527
|
role: "region",
|
|
114528
114528
|
children: [
|
|
114529
114529
|
/* @__PURE__ */ (0, import_jsx_runtime$204.jsxs)("div", {
|
|
114530
|
-
className: `${header$2} ${semanticClassNames$
|
|
114530
|
+
className: `${header$2} ${semanticClassNames$10.header}`,
|
|
114531
114531
|
children: [isMultiFile ? /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("div", {
|
|
114532
114532
|
"aria-label": "Code file tabs",
|
|
114533
|
-
className: `${tabs} ${semanticClassNames$
|
|
114533
|
+
className: `${tabs} ${semanticClassNames$10.tabs}`,
|
|
114534
114534
|
role: "tablist",
|
|
114535
114535
|
children: files.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime$204.jsxs)("button", {
|
|
114536
114536
|
"aria-selected": index === activeIndex,
|
|
114537
|
-
className: `${tab({ active: index === activeIndex })} ${semanticClassNames$
|
|
114537
|
+
className: `${tab({ active: index === activeIndex })} ${semanticClassNames$10.tab} ${index === activeIndex ? semanticClassNames$10.tabActive : ""}`.trim(),
|
|
114538
114538
|
role: "tab",
|
|
114539
114539
|
type: "button",
|
|
114540
114540
|
onClick: () => setActiveIndex(index),
|
|
114541
114541
|
children: [/* @__PURE__ */ (0, import_jsx_runtime$204.jsx)(FileIcon, {
|
|
114542
|
-
className: `${fileIcon} ${semanticClassNames$
|
|
114542
|
+
className: `${fileIcon} ${semanticClassNames$10.fileIcon}`,
|
|
114543
114543
|
filename: file.filename,
|
|
114544
114544
|
size: 14
|
|
114545
114545
|
}), /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("span", { children: file.filename })]
|
|
114546
114546
|
}, file.filename))
|
|
114547
114547
|
}) : /* @__PURE__ */ (0, import_jsx_runtime$204.jsxs)("div", {
|
|
114548
|
-
className: `${titleBar} ${semanticClassNames$
|
|
114548
|
+
className: `${titleBar} ${semanticClassNames$10.titleBar}`,
|
|
114549
114549
|
children: [/* @__PURE__ */ (0, import_jsx_runtime$204.jsx)(FileIcon, {
|
|
114550
|
-
className: `${fileIcon} ${semanticClassNames$
|
|
114550
|
+
className: `${fileIcon} ${semanticClassNames$10.fileIcon}`,
|
|
114551
114551
|
filename: activeFile.filename,
|
|
114552
114552
|
size: 14
|
|
114553
114553
|
}), /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("span", { children: activeFile.filename })]
|
|
114554
114554
|
}), /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("div", {
|
|
114555
|
-
className: `${headerActions} ${semanticClassNames$
|
|
114555
|
+
className: `${headerActions} ${semanticClassNames$10.headerActions}`,
|
|
114556
114556
|
children: /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)(CopyButton, { text: activeFile.code })
|
|
114557
114557
|
})]
|
|
114558
114558
|
}),
|
|
114559
|
-
/* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("div", { className: `${separator$1} ${semanticClassNames$
|
|
114559
|
+
/* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("div", { className: `${separator$1} ${semanticClassNames$10.separator}` }),
|
|
114560
114560
|
/* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("div", {
|
|
114561
|
-
className: `${codePanelsWrapper} ${semanticClassNames$
|
|
114561
|
+
className: `${codePanelsWrapper} ${semanticClassNames$10.codePanelsWrapper}`,
|
|
114562
114562
|
children: files.map((file, index) => {
|
|
114563
114563
|
const html = htmlMap[file.filename];
|
|
114564
114564
|
return /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("div", {
|
|
114565
|
-
className: `${codePanel} ${semanticClassNames$
|
|
114565
|
+
className: `${codePanel} ${semanticClassNames$10.codePanel}`,
|
|
114566
114566
|
"data-active": index === activeIndex,
|
|
114567
114567
|
role: isMultiFile ? "tabpanel" : void 0,
|
|
114568
114568
|
children: /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("div", {
|
|
114569
|
-
className: `${codeScroll} ${semanticClassNames$
|
|
114569
|
+
className: `${codeScroll} ${semanticClassNames$10.codeScroll}`,
|
|
114570
114570
|
children: html ? /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("div", {
|
|
114571
|
-
className: `${codeBody} ${semanticClassNames$
|
|
114571
|
+
className: `${codeBody} ${semanticClassNames$10.codeBody}`,
|
|
114572
114572
|
dangerouslySetInnerHTML: { __html: html }
|
|
114573
114573
|
}) : /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("pre", {
|
|
114574
|
-
className: `${codeBody} ${semanticClassNames$
|
|
114574
|
+
className: `${codeBody} ${semanticClassNames$10.codeBody}`,
|
|
114575
114575
|
children: /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("code", { children: file.code.split("\n").map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime$204.jsx)("span", {
|
|
114576
114576
|
className: "line",
|
|
114577
114577
|
children: line
|
|
@@ -208264,7 +208264,7 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
208264
208264
|
init_note_css_ts_vanilla();
|
|
208265
208265
|
init_grid_css_ts_vanilla();
|
|
208266
208266
|
init_vanilla_extract_recipes_createRuntimeFn_esm();
|
|
208267
|
-
var semanticClassNames$
|
|
208267
|
+
var semanticClassNames$9 = {
|
|
208268
208268
|
root: "rich-alert",
|
|
208269
208269
|
header: "rich-alert-header",
|
|
208270
208270
|
icon: "rich-alert-icon",
|
|
@@ -208324,9 +208324,9 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
208324
208324
|
const Icon = ALERT_ICONS[type];
|
|
208325
208325
|
const label = ALERT_LABELS[type];
|
|
208326
208326
|
return /* @__PURE__ */ (0, import_jsx_runtime$232.jsxs)("div", {
|
|
208327
|
-
className: `${alertHeader} ${alertType({ type })} ${semanticClassNames$
|
|
208328
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(Icon, { className: `${alertIcon} ${semanticClassNames$
|
|
208329
|
-
className: `${alertLabel} ${semanticClassNames$
|
|
208327
|
+
className: `${alertHeader} ${alertType({ type })} ${semanticClassNames$9.header} ${semanticTypeClassNames$1.header[type]}`,
|
|
208328
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(Icon, { className: `${alertIcon} ${semanticClassNames$9.icon}` }), /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("span", {
|
|
208329
|
+
className: `${alertLabel} ${semanticClassNames$9.label}`,
|
|
208330
208330
|
children: label
|
|
208331
208331
|
})]
|
|
208332
208332
|
});
|
|
@@ -208346,7 +208346,7 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
208346
208346
|
init_note_css_ts_vanilla();
|
|
208347
208347
|
init_grid_css_ts_vanilla();
|
|
208348
208348
|
init_vanilla_extract_recipes_createRuntimeFn_esm();
|
|
208349
|
-
var semanticClassNames$
|
|
208349
|
+
var semanticClassNames$8 = {
|
|
208350
208350
|
root: "rich-banner",
|
|
208351
208351
|
inner: "rich-banner-inner",
|
|
208352
208352
|
icon: "rich-banner-icon",
|
|
@@ -208407,7 +208407,7 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
208407
208407
|
var BannerRenderer = ({ type }) => {
|
|
208408
208408
|
const Icon = BANNER_ICONS[type];
|
|
208409
208409
|
return /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("span", {
|
|
208410
|
-
className: `${bannerIcon} ${bannerIconType({ type })} ${semanticClassNames$
|
|
208410
|
+
className: `${bannerIcon} ${bannerIconType({ type })} ${semanticClassNames$8.icon} ${semanticTypeClassNames.icon[type]}`,
|
|
208411
208411
|
children: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(Icon, {
|
|
208412
208412
|
height: "1em",
|
|
208413
208413
|
width: "1em"
|
|
@@ -208956,6 +208956,312 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
208956
208956
|
lazyRenderers: { CodeSnippet: () => Promise.resolve().then(() => (init_renderer$3(), renderer_exports$2)) }
|
|
208957
208957
|
};
|
|
208958
208958
|
//#endregion
|
|
208959
|
+
//#region src/core/configurable-module.tsx
|
|
208960
|
+
function chainProviders(outer, inner) {
|
|
208961
|
+
if (!outer) return inner;
|
|
208962
|
+
const Outer = outer;
|
|
208963
|
+
const Inner = inner;
|
|
208964
|
+
const Chained = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(Outer, { children: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(Inner, { children }) });
|
|
208965
|
+
Chained.displayName = "ChainedProvider";
|
|
208966
|
+
return Chained;
|
|
208967
|
+
}
|
|
208968
|
+
/**
|
|
208969
|
+
* Build a configurable module factory. The config travels to renderers through
|
|
208970
|
+
* a dedicated React Context (the module `Provider`); `useConfig` reads it.
|
|
208971
|
+
* `createModule(base)` produces a `ConfigurableModule` usable directly (default
|
|
208972
|
+
* config) or via `.setup(config)` — the NestJS `DynamicModule` analog.
|
|
208973
|
+
*/
|
|
208974
|
+
function defineConfigurableModule(opts) {
|
|
208975
|
+
const ConfigContext = (0, import_react$186.createContext)(opts.defaultConfig);
|
|
208976
|
+
const useConfig = () => (0, import_react$186.use)(ConfigContext);
|
|
208977
|
+
function createModule(base) {
|
|
208978
|
+
function build(config) {
|
|
208979
|
+
const ConfigProvider = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(ConfigContext, {
|
|
208980
|
+
value: config,
|
|
208981
|
+
children
|
|
208982
|
+
});
|
|
208983
|
+
ConfigProvider.displayName = `${opts.name}ConfigProvider`;
|
|
208984
|
+
return {
|
|
208985
|
+
...base,
|
|
208986
|
+
name: opts.name,
|
|
208987
|
+
Provider: chainProviders(base.Provider, ConfigProvider)
|
|
208988
|
+
};
|
|
208989
|
+
}
|
|
208990
|
+
const configurable = build(opts.defaultConfig);
|
|
208991
|
+
configurable.setup = (config) => build({
|
|
208992
|
+
...opts.defaultConfig,
|
|
208993
|
+
...config
|
|
208994
|
+
});
|
|
208995
|
+
return configurable;
|
|
208996
|
+
}
|
|
208997
|
+
return {
|
|
208998
|
+
createModule,
|
|
208999
|
+
useConfig
|
|
209000
|
+
};
|
|
209001
|
+
}
|
|
209002
|
+
//#endregion
|
|
209003
|
+
//#region src/modules/dynamic/module-config.ts
|
|
209004
|
+
var { createModule: createDynamicModule, useConfig: useDynamicModuleConfig } = defineConfigurableModule({
|
|
209005
|
+
name: "dynamic",
|
|
209006
|
+
defaultConfig: {}
|
|
209007
|
+
});
|
|
209008
|
+
//#endregion
|
|
209009
|
+
//#region ../rich-dynamic-protocol/src/index.ts
|
|
209010
|
+
function isDynamicComponentModule(value) {
|
|
209011
|
+
return typeof value === "object" && value !== null && typeof value.mount === "function";
|
|
209012
|
+
}
|
|
209013
|
+
//#endregion
|
|
209014
|
+
//#region ../rich-ext-dynamic/src/styles.css.ts
|
|
209015
|
+
init_vars_css_ts_vanilla();
|
|
209016
|
+
var semanticClassNames$7 = {
|
|
209017
|
+
root: "rich-dynamic-root",
|
|
209018
|
+
host: "rich-dynamic-host",
|
|
209019
|
+
placeholder: "rich-dynamic-placeholder",
|
|
209020
|
+
error: "rich-dynamic-error",
|
|
209021
|
+
settingsButton: "rich-dynamic-settings-button",
|
|
209022
|
+
editPanel: "rich-dynamic-edit-panel",
|
|
209023
|
+
editField: "rich-dynamic-edit-field",
|
|
209024
|
+
editFieldIcon: "rich-dynamic-edit-field-icon",
|
|
209025
|
+
editInput: "rich-dynamic-edit-input",
|
|
209026
|
+
editTextarea: "rich-dynamic-edit-textarea",
|
|
209027
|
+
editError: "rich-dynamic-edit-error"
|
|
209028
|
+
};
|
|
209029
|
+
var root$15 = "_17z9n250";
|
|
209030
|
+
var host$1 = "_17z9n251";
|
|
209031
|
+
var overlay$1 = "_17z9n252";
|
|
209032
|
+
//#endregion
|
|
209033
|
+
//#region ../rich-ext-dynamic/src/DynamicHostRenderer.tsx
|
|
209034
|
+
init_static_entry();
|
|
209035
|
+
function parseProps(json) {
|
|
209036
|
+
try {
|
|
209037
|
+
const value = JSON.parse(json);
|
|
209038
|
+
return value && typeof value === "object" ? value : {};
|
|
209039
|
+
} catch {
|
|
209040
|
+
return {};
|
|
209041
|
+
}
|
|
209042
|
+
}
|
|
209043
|
+
function DynamicHostRenderer({ url, componentProps, initialHeight, validateUrl }) {
|
|
209044
|
+
const hostRef = (0, import_react$186.useRef)(null);
|
|
209045
|
+
const handleRef = (0, import_react$186.useRef)(null);
|
|
209046
|
+
const latestInputRef = (0, import_react$186.useRef)(null);
|
|
209047
|
+
const [status, setStatus] = (0, import_react$186.useState)("loading");
|
|
209048
|
+
const [attempt, setAttempt] = (0, import_react$186.useState)(0);
|
|
209049
|
+
const theme = useColorScheme();
|
|
209050
|
+
const propsJson = JSON.stringify(componentProps ?? {});
|
|
209051
|
+
(0, import_react$186.useEffect)(() => {
|
|
209052
|
+
const input = {
|
|
209053
|
+
props: parseProps(propsJson),
|
|
209054
|
+
host: { theme }
|
|
209055
|
+
};
|
|
209056
|
+
latestInputRef.current = input;
|
|
209057
|
+
handleRef.current?.update?.(input);
|
|
209058
|
+
}, [propsJson, theme]);
|
|
209059
|
+
(0, import_react$186.useEffect)(() => {
|
|
209060
|
+
const container = hostRef.current?.shadowRoot?.firstElementChild;
|
|
209061
|
+
if (container instanceof HTMLElement) container.style.minHeight = `${initialHeight}px`;
|
|
209062
|
+
}, [initialHeight]);
|
|
209063
|
+
(0, import_react$186.useEffect)(() => {
|
|
209064
|
+
const hostEl = hostRef.current;
|
|
209065
|
+
if (!hostEl || !url) return;
|
|
209066
|
+
if (validateUrl && !validateUrl(url)) {
|
|
209067
|
+
setStatus("error");
|
|
209068
|
+
return;
|
|
209069
|
+
}
|
|
209070
|
+
let cancelled = false;
|
|
209071
|
+
setStatus("loading");
|
|
209072
|
+
const shadow = hostEl.shadowRoot ?? hostEl.attachShadow({ mode: "open" });
|
|
209073
|
+
shadow.replaceChildren();
|
|
209074
|
+
const container = document.createElement("div");
|
|
209075
|
+
container.style.minHeight = `${initialHeight}px`;
|
|
209076
|
+
shadow.append(container);
|
|
209077
|
+
import(
|
|
209078
|
+
/* @vite-ignore */
|
|
209079
|
+
url
|
|
209080
|
+
).then((mod) => {
|
|
209081
|
+
if (cancelled) return;
|
|
209082
|
+
const component = mod?.default;
|
|
209083
|
+
if (!isDynamicComponentModule(component)) throw new Error("module default export does not implement the dynamic mount protocol");
|
|
209084
|
+
const input = latestInputRef.current ?? {
|
|
209085
|
+
props: parseProps(propsJson),
|
|
209086
|
+
host: { theme }
|
|
209087
|
+
};
|
|
209088
|
+
handleRef.current = component.mount(container, input);
|
|
209089
|
+
setStatus("mounted");
|
|
209090
|
+
}).catch((error) => {
|
|
209091
|
+
if (cancelled) return;
|
|
209092
|
+
console.error("[DynamicHostRenderer]", error);
|
|
209093
|
+
setStatus("error");
|
|
209094
|
+
});
|
|
209095
|
+
return () => {
|
|
209096
|
+
cancelled = true;
|
|
209097
|
+
try {
|
|
209098
|
+
handleRef.current?.unmount();
|
|
209099
|
+
} catch (error) {
|
|
209100
|
+
console.error("[DynamicHostRenderer]", error);
|
|
209101
|
+
}
|
|
209102
|
+
handleRef.current = null;
|
|
209103
|
+
};
|
|
209104
|
+
}, [
|
|
209105
|
+
url,
|
|
209106
|
+
attempt,
|
|
209107
|
+
validateUrl
|
|
209108
|
+
]);
|
|
209109
|
+
if (!url) return /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("div", {
|
|
209110
|
+
className: `${root$15} ${semanticClassNames$7.root}`,
|
|
209111
|
+
style: { minHeight: initialHeight },
|
|
209112
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("div", {
|
|
209113
|
+
className: `${overlay$1} ${semanticClassNames$7.placeholder}`,
|
|
209114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("span", { children: "No component URL" })
|
|
209115
|
+
})
|
|
209116
|
+
});
|
|
209117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime$232.jsxs)("div", {
|
|
209118
|
+
className: `${root$15} ${semanticClassNames$7.root}`,
|
|
209119
|
+
style: { minHeight: initialHeight },
|
|
209120
|
+
children: [
|
|
209121
|
+
/* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("div", {
|
|
209122
|
+
className: `${host$1} ${semanticClassNames$7.host}`,
|
|
209123
|
+
ref: hostRef
|
|
209124
|
+
}),
|
|
209125
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("div", {
|
|
209126
|
+
className: `_17z9n252 ${semanticClassNames$7.placeholder}`,
|
|
209127
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("span", { children: "Loading component…" })
|
|
209128
|
+
}),
|
|
209129
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime$232.jsxs)("div", {
|
|
209130
|
+
className: `_17z9n252 ${semanticClassNames$7.error}`,
|
|
209131
|
+
children: [
|
|
209132
|
+
/* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("span", { children: "Failed to load component" }),
|
|
209133
|
+
/* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("span", {
|
|
209134
|
+
className: "_17z9n254",
|
|
209135
|
+
children: url
|
|
209136
|
+
}),
|
|
209137
|
+
/* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("button", {
|
|
209138
|
+
className: "_17z9n253",
|
|
209139
|
+
type: "button",
|
|
209140
|
+
onClick: () => setAttempt((n) => n + 1),
|
|
209141
|
+
children: "Retry"
|
|
209142
|
+
})
|
|
209143
|
+
]
|
|
209144
|
+
})
|
|
209145
|
+
]
|
|
209146
|
+
});
|
|
209147
|
+
}
|
|
209148
|
+
//#endregion
|
|
209149
|
+
//#region ../rich-ext-dynamic/src/DynamicSSRRenderer.tsx
|
|
209150
|
+
init_src$39();
|
|
209151
|
+
var DynamicPlaceholder = ({ initialHeight }) => /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("div", {
|
|
209152
|
+
"aria-label": "Interactive component",
|
|
209153
|
+
className: `${root$15} ${semanticClassNames$7.root}`,
|
|
209154
|
+
style: { minHeight: initialHeight },
|
|
209155
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("div", {
|
|
209156
|
+
className: `${overlay$1} ${semanticClassNames$7.placeholder}`,
|
|
209157
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)("span", { children: "Interactive component" })
|
|
209158
|
+
})
|
|
209159
|
+
});
|
|
209160
|
+
var DynamicSSRRenderer = (props) => {
|
|
209161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(ViewportGate, {
|
|
209162
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(DynamicPlaceholder, { initialHeight: props.initialHeight }),
|
|
209163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(DynamicHostRenderer, { ...props })
|
|
209164
|
+
});
|
|
209165
|
+
};
|
|
209166
|
+
//#endregion
|
|
209167
|
+
//#region ../rich-ext-dynamic/src/slot.ts
|
|
209168
|
+
var DYNAMIC_NODE_KEY = "Dynamic";
|
|
209169
|
+
//#endregion
|
|
209170
|
+
//#region ../rich-ext-dynamic/src/DynamicNode.ts
|
|
209171
|
+
init_static_entry();
|
|
209172
|
+
init_Lexical_prod();
|
|
209173
|
+
init_defineProperty();
|
|
209174
|
+
var DynamicNode = class DynamicNode extends yo$2 {
|
|
209175
|
+
static getType() {
|
|
209176
|
+
return "dynamic";
|
|
209177
|
+
}
|
|
209178
|
+
static clone(node) {
|
|
209179
|
+
return new DynamicNode(node.__url, node.__props, node.__initialHeight, node.__key);
|
|
209180
|
+
}
|
|
209181
|
+
constructor(url, props = {}, initialHeight = 320, key) {
|
|
209182
|
+
super(key);
|
|
209183
|
+
_defineProperty$2(this, "__url", void 0);
|
|
209184
|
+
_defineProperty$2(this, "__props", void 0);
|
|
209185
|
+
_defineProperty$2(this, "__initialHeight", void 0);
|
|
209186
|
+
this.__url = url;
|
|
209187
|
+
this.__props = props;
|
|
209188
|
+
this.__initialHeight = initialHeight;
|
|
209189
|
+
}
|
|
209190
|
+
createDOM(_config) {
|
|
209191
|
+
const div = document.createElement("div");
|
|
209192
|
+
div.className = "rich-dynamic-wrapper";
|
|
209193
|
+
return div;
|
|
209194
|
+
}
|
|
209195
|
+
updateDOM() {
|
|
209196
|
+
return false;
|
|
209197
|
+
}
|
|
209198
|
+
isInline() {
|
|
209199
|
+
return false;
|
|
209200
|
+
}
|
|
209201
|
+
static importJSON(serializedNode) {
|
|
209202
|
+
return $createDynamicNode(serializedNode);
|
|
209203
|
+
}
|
|
209204
|
+
exportJSON() {
|
|
209205
|
+
return {
|
|
209206
|
+
...super.exportJSON(),
|
|
209207
|
+
type: "dynamic",
|
|
209208
|
+
url: this.__url,
|
|
209209
|
+
props: this.__props,
|
|
209210
|
+
initialHeight: this.__initialHeight,
|
|
209211
|
+
version: 1
|
|
209212
|
+
};
|
|
209213
|
+
}
|
|
209214
|
+
getUrl() {
|
|
209215
|
+
return this.getLatest().__url;
|
|
209216
|
+
}
|
|
209217
|
+
setUrl(url) {
|
|
209218
|
+
const writable = this.getWritable();
|
|
209219
|
+
writable.__url = url;
|
|
209220
|
+
}
|
|
209221
|
+
getProps() {
|
|
209222
|
+
return this.getLatest().__props;
|
|
209223
|
+
}
|
|
209224
|
+
setProps(props) {
|
|
209225
|
+
const writable = this.getWritable();
|
|
209226
|
+
writable.__props = props;
|
|
209227
|
+
}
|
|
209228
|
+
getInitialHeight() {
|
|
209229
|
+
return this.getLatest().__initialHeight;
|
|
209230
|
+
}
|
|
209231
|
+
setInitialHeight(initialHeight) {
|
|
209232
|
+
const writable = this.getWritable();
|
|
209233
|
+
writable.__initialHeight = initialHeight;
|
|
209234
|
+
}
|
|
209235
|
+
decorate(_editor, _config) {
|
|
209236
|
+
return createRendererDecoration(DYNAMIC_NODE_KEY, DynamicSSRRenderer, {
|
|
209237
|
+
url: this.__url,
|
|
209238
|
+
componentProps: this.__props,
|
|
209239
|
+
initialHeight: this.__initialHeight
|
|
209240
|
+
});
|
|
209241
|
+
}
|
|
209242
|
+
};
|
|
209243
|
+
function $createDynamicNode(payload = {}) {
|
|
209244
|
+
return new DynamicNode(payload.url ?? "", payload.props ?? {}, payload.initialHeight ?? 320);
|
|
209245
|
+
}
|
|
209246
|
+
//#endregion
|
|
209247
|
+
//#region src/modules/dynamic/node.ts
|
|
209248
|
+
var dynamicNodes = [DynamicNode];
|
|
209249
|
+
//#endregion
|
|
209250
|
+
//#region src/modules/dynamic/renderer.tsx
|
|
209251
|
+
var ComposedDynamicStaticRenderer = (props) => {
|
|
209252
|
+
const { validateUrl } = useDynamicModuleConfig();
|
|
209253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(DynamicSSRRenderer, {
|
|
209254
|
+
...props,
|
|
209255
|
+
validateUrl
|
|
209256
|
+
});
|
|
209257
|
+
};
|
|
209258
|
+
//#endregion
|
|
209259
|
+
//#region src/modules/dynamic/module.ts
|
|
209260
|
+
var dynamicModule = createDynamicModule({
|
|
209261
|
+
nodes: dynamicNodes,
|
|
209262
|
+
renderers: { Dynamic: ComposedDynamicStaticRenderer }
|
|
209263
|
+
});
|
|
209264
|
+
//#endregion
|
|
208959
209265
|
//#region ../rich-ext-embed/src/styles.css.ts
|
|
208960
209266
|
init_vars_css_ts_vanilla();
|
|
208961
209267
|
var semanticClassNames$6 = {
|
|
@@ -210905,7 +211211,7 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
210905
211211
|
var init_types$2 = __esmMin((() => {}));
|
|
210906
211212
|
//#endregion
|
|
210907
211213
|
//#region ../../node_modules/.pnpm/swr@2.4.1_react@19.2.6/node_modules/swr/dist/_internal/index.mjs
|
|
210908
|
-
var import_react$144, enableDevtools, use$
|
|
211214
|
+
var import_react$144, enableDevtools, use$6, setupDevTools, normalize$3, useSWRConfig, middleware$1, BUILT_IN_MIDDLEWARE, withArgs, subscribeCallback;
|
|
210909
211215
|
var init__internal = __esmMin((() => {
|
|
210910
211216
|
init_config_context_12s_CCVTDPOP();
|
|
210911
211217
|
init_events();
|
|
@@ -210913,7 +211219,7 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
210913
211219
|
import_react$144 = /* @__PURE__ */ __toESM$1(require_react(), 1);
|
|
210914
211220
|
init_types$2();
|
|
210915
211221
|
enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;
|
|
210916
|
-
use$
|
|
211222
|
+
use$6 = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
|
|
210917
211223
|
setupDevTools = () => {
|
|
210918
211224
|
if (enableDevtools) window.__SWR_DEVTOOLS_REACT__ = import_react$144.default;
|
|
210919
211225
|
};
|
|
@@ -210943,7 +211249,7 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
210943
211249
|
return req;
|
|
210944
211250
|
}), config);
|
|
210945
211251
|
};
|
|
210946
|
-
BUILT_IN_MIDDLEWARE = use$
|
|
211252
|
+
BUILT_IN_MIDDLEWARE = use$6.concat(middleware$1);
|
|
210947
211253
|
withArgs = (hook) => {
|
|
210948
211254
|
return function useSWRArgs(...args) {
|
|
210949
211255
|
const fallbackConfig = useSWRConfig();
|
|
@@ -210968,12 +211274,12 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
210968
211274
|
};
|
|
210969
211275
|
};
|
|
210970
211276
|
setupDevTools();
|
|
210971
|
-
})), import_react$143, import_shim$1, use$
|
|
211277
|
+
})), import_react$143, import_shim$1, use$5, WITH_DEDUPE, resolvedUndef, sub$1, useSWRHandler, useSWR$1;
|
|
210972
211278
|
var init_index = __esmMin((() => {
|
|
210973
211279
|
import_react$143 = /* @__PURE__ */ __toESM$1(require_react(), 1);
|
|
210974
211280
|
import_shim$1 = require_shim();
|
|
210975
211281
|
init__internal();
|
|
210976
|
-
use$
|
|
211282
|
+
use$5 = import_react$143.use || ((thenable) => {
|
|
210977
211283
|
switch (thenable.status) {
|
|
210978
211284
|
case "pending": throw thenable;
|
|
210979
211285
|
case "fulfilled": return thenable.value;
|
|
@@ -211063,7 +211369,7 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
211063
211369
|
}), [cache, key]), getSnapshot[0], getSnapshot[1]);
|
|
211064
211370
|
const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;
|
|
211065
211371
|
const cachedData = cached.data;
|
|
211066
|
-
const data = isUndefined$2(cachedData) ? fallback && isPromiseLike$2(fallback) ? use$
|
|
211372
|
+
const data = isUndefined$2(cachedData) ? fallback && isPromiseLike$2(fallback) ? use$5(fallback) : fallback : cachedData;
|
|
211067
211373
|
const error = cached.error;
|
|
211068
211374
|
const laggyDataRef = (0, import_react$143.useRef)(data);
|
|
211069
211375
|
const returnedData = keepPreviousData ? isUndefined$2(cachedData) ? isUndefined$2(laggyDataRef.current) ? data : laggyDataRef.current : cachedData : data;
|
|
@@ -211240,14 +211546,14 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
211240
211546
|
unmountedRef.current = false;
|
|
211241
211547
|
}
|
|
211242
211548
|
const req = PRELOAD[key];
|
|
211243
|
-
use$
|
|
211549
|
+
use$5(!isUndefined$2(req) && hasKeyButNoData ? boundMutate(req) : resolvedUndef);
|
|
211244
211550
|
if (!isUndefined$2(error) && hasKeyButNoData) throw error;
|
|
211245
211551
|
const revalidation = hasKeyButNoData ? revalidate(WITH_DEDUPE) : resolvedUndef;
|
|
211246
211552
|
if (!isUndefined$2(returnedData) && hasKeyButNoData) {
|
|
211247
211553
|
revalidation.status = "fulfilled";
|
|
211248
211554
|
revalidation.value = true;
|
|
211249
211555
|
}
|
|
211250
|
-
use$
|
|
211556
|
+
use$5(revalidation);
|
|
211251
211557
|
}
|
|
211252
211558
|
return {
|
|
211253
211559
|
mutate: boundMutate,
|
|
@@ -211958,50 +212264,6 @@ ${seriesRules.join("\n")}${tipRules}
|
|
|
211958
212264
|
nodes: [EmbedNode]
|
|
211959
212265
|
};
|
|
211960
212266
|
//#endregion
|
|
211961
|
-
//#region src/core/configurable-module.tsx
|
|
211962
|
-
function chainProviders(outer, inner) {
|
|
211963
|
-
if (!outer) return inner;
|
|
211964
|
-
const Outer = outer;
|
|
211965
|
-
const Inner = inner;
|
|
211966
|
-
const Chained = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(Outer, { children: /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(Inner, { children }) });
|
|
211967
|
-
Chained.displayName = "ChainedProvider";
|
|
211968
|
-
return Chained;
|
|
211969
|
-
}
|
|
211970
|
-
/**
|
|
211971
|
-
* Build a configurable module factory. The config travels to renderers through
|
|
211972
|
-
* a dedicated React Context (the module `Provider`); `useConfig` reads it.
|
|
211973
|
-
* `createModule(base)` produces a `ConfigurableModule` usable directly (default
|
|
211974
|
-
* config) or via `.setup(config)` — the NestJS `DynamicModule` analog.
|
|
211975
|
-
*/
|
|
211976
|
-
function defineConfigurableModule(opts) {
|
|
211977
|
-
const ConfigContext = (0, import_react$186.createContext)(opts.defaultConfig);
|
|
211978
|
-
const useConfig = () => (0, import_react$186.use)(ConfigContext);
|
|
211979
|
-
function createModule(base) {
|
|
211980
|
-
function build(config) {
|
|
211981
|
-
const ConfigProvider = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(ConfigContext, {
|
|
211982
|
-
value: config,
|
|
211983
|
-
children
|
|
211984
|
-
});
|
|
211985
|
-
ConfigProvider.displayName = `${opts.name}ConfigProvider`;
|
|
211986
|
-
return {
|
|
211987
|
-
...base,
|
|
211988
|
-
name: opts.name,
|
|
211989
|
-
Provider: chainProviders(base.Provider, ConfigProvider)
|
|
211990
|
-
};
|
|
211991
|
-
}
|
|
211992
|
-
const configurable = build(opts.defaultConfig);
|
|
211993
|
-
configurable.setup = (config) => build({
|
|
211994
|
-
...opts.defaultConfig,
|
|
211995
|
-
...config
|
|
211996
|
-
});
|
|
211997
|
-
return configurable;
|
|
211998
|
-
}
|
|
211999
|
-
return {
|
|
212000
|
-
createModule,
|
|
212001
|
-
useConfig
|
|
212002
|
-
};
|
|
212003
|
-
}
|
|
212004
|
-
//#endregion
|
|
212005
212267
|
//#region src/modules/excalidraw/module-config.ts
|
|
212006
212268
|
var { createModule: createExcalidrawModule, useConfig: useExcalidrawModuleConfig } = defineConfigurableModule({
|
|
212007
212269
|
name: "excalidraw",
|
|
@@ -482437,6 +482699,7 @@ TTD mermaid definition render errror: ${M.message}`, "color: yellow"), le("ai",
|
|
|
482437
482699
|
chatModule,
|
|
482438
482700
|
codeBlockModule,
|
|
482439
482701
|
codeSnippetModule,
|
|
482702
|
+
dynamicModule,
|
|
482440
482703
|
embedModule,
|
|
482441
482704
|
excalidrawModule,
|
|
482442
482705
|
galleryModule,
|