@aparte/core 0.13.0 → 0.13.1
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/client/aparte-client.d.ts.map +1 -1
- package/dist/client/stream-adapter.d.ts.map +1 -1
- package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +2 -0
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/custom-elements.json +6634 -6592
- package/dist/index.css +27 -2
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/dist/index.node.js +1 -1
- package/dist/{is-awaiting-reply-DrO_oR32.js → is-awaiting-reply-CWp1ffHh.js} +15 -25
- package/dist/is-awaiting-reply-CWp1ffHh.js.map +1 -0
- package/dist/renderers/segment-renderers.d.ts +18 -0
- package/dist/renderers/segment-renderers.d.ts.map +1 -1
- package/dist/renderers/segments/tool-call.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/is-awaiting-reply-DrO_oR32.js.map +0 -1
package/dist/index.node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6 } from "./is-awaiting-reply-
|
|
1
|
+
import { A, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6 } from "./is-awaiting-reply-CWp1ffHh.js";
|
|
2
2
|
function registerAllComponents() {
|
|
3
3
|
}
|
|
4
4
|
export {
|
|
@@ -2539,6 +2539,7 @@ const toolCallRenderer = {
|
|
|
2539
2539
|
const toolCallId = segment.toolCall?.id ?? "";
|
|
2540
2540
|
const customRenderer = contextConfig().getToolRenderer(segment.toolCall?.name);
|
|
2541
2541
|
if (customRenderer) {
|
|
2542
|
+
injectToolRendererStyles(segment.toolCall?.name ?? "", customRenderer);
|
|
2542
2543
|
const out = customRenderer.render(segment);
|
|
2543
2544
|
if (out) return out;
|
|
2544
2545
|
}
|
|
@@ -3440,6 +3441,17 @@ function injectRendererStyles(config = contextConfig()) {
|
|
|
3440
3441
|
}
|
|
3441
3442
|
if (added) styleElement.textContent = Array.from(injectedRendererStyles).join("\n");
|
|
3442
3443
|
}
|
|
3444
|
+
function injectToolRendererStyles(toolName, renderer) {
|
|
3445
|
+
if (typeof document === "undefined") return;
|
|
3446
|
+
const css = renderer.getStyles?.();
|
|
3447
|
+
if (!css) return;
|
|
3448
|
+
const id = `aparte-tool-renderer-${toolName}`;
|
|
3449
|
+
if (document.getElementById(id)) return;
|
|
3450
|
+
const el2 = document.createElement("style");
|
|
3451
|
+
el2.id = id;
|
|
3452
|
+
el2.textContent = css;
|
|
3453
|
+
document.head.appendChild(el2);
|
|
3454
|
+
}
|
|
3443
3455
|
function registerDefaultRenderers(config = contextConfig()) {
|
|
3444
3456
|
const reg = registryFor(config);
|
|
3445
3457
|
reg.defaultsInstalled = true;
|
|
@@ -5203,18 +5215,7 @@ function createStreamAdapter(opts) {
|
|
|
5203
5215
|
};
|
|
5204
5216
|
const renderer = config.getToolRenderer(e.name);
|
|
5205
5217
|
if (renderer) {
|
|
5206
|
-
|
|
5207
|
-
const styles = renderer.getStyles();
|
|
5208
|
-
if (styles) {
|
|
5209
|
-
const styleId = `aparte-tool-renderer-${e.name}`;
|
|
5210
|
-
if (!document.getElementById(styleId)) {
|
|
5211
|
-
const styleEl = document.createElement("style");
|
|
5212
|
-
styleEl.id = styleId;
|
|
5213
|
-
styleEl.textContent = styles;
|
|
5214
|
-
document.head.appendChild(styleEl);
|
|
5215
|
-
}
|
|
5216
|
-
}
|
|
5217
|
-
}
|
|
5218
|
+
injectToolRendererStyles(e.name, renderer);
|
|
5218
5219
|
const html = renderer.render(toolSeg);
|
|
5219
5220
|
if (html) target.addSegment?.(toolSeg);
|
|
5220
5221
|
} else {
|
|
@@ -6751,18 +6752,7 @@ ${content}
|
|
|
6751
6752
|
};
|
|
6752
6753
|
const toolRenderer = this._config.getToolRenderer(event.name);
|
|
6753
6754
|
if (toolRenderer) {
|
|
6754
|
-
|
|
6755
|
-
const styles = toolRenderer.getStyles();
|
|
6756
|
-
if (styles) {
|
|
6757
|
-
const styleId = `aparte-tool-renderer-${event.name}`;
|
|
6758
|
-
if (!document.getElementById(styleId)) {
|
|
6759
|
-
const el2 = document.createElement("style");
|
|
6760
|
-
el2.id = styleId;
|
|
6761
|
-
el2.textContent = styles;
|
|
6762
|
-
document.head.appendChild(el2);
|
|
6763
|
-
}
|
|
6764
|
-
}
|
|
6765
|
-
}
|
|
6755
|
+
injectToolRendererStyles(event.name, toolRenderer);
|
|
6766
6756
|
const html = toolRenderer.render(toolSeg);
|
|
6767
6757
|
if (html) {
|
|
6768
6758
|
targetElement.addSegment?.(toolSeg);
|
|
@@ -7683,4 +7673,4 @@ export {
|
|
|
7683
7673
|
buildElicitationPanel as y,
|
|
7684
7674
|
collectRendererStyles as z
|
|
7685
7675
|
};
|
|
7686
|
-
//# sourceMappingURL=is-awaiting-reply-
|
|
7676
|
+
//# sourceMappingURL=is-awaiting-reply-CWp1ffHh.js.map
|