@aparte/core 0.29.3 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat/aparte-chat.d.ts +2 -2
- package/dist/components/viewport/aparte-chat-viewport.d.ts +9 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/conversations/conversation-controller.d.ts.map +1 -1
- package/dist/custom-elements.json +1356 -1335
- package/dist/{defer-hydration-DhcT-6MP.js → defer-hydration-rafq3SGv.js} +2 -1
- package/dist/{defer-hydration-DhcT-6MP.js.map → defer-hydration-rafq3SGv.js.map} +1 -1
- package/dist/generated/element-attributes.d.ts +1 -1
- package/dist/generated/element-attributes.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +34 -12
- package/dist/index.js.map +1 -1
- package/dist/index.node.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { K as deferHydrationOf, ac as resolveConfig, am as eventOrigin, an as activeElementIn, ah as subscribeConfigChange, ae as runWithConfig, o as AparteElicitationAbortError, w as buildApprovalPanel, x as buildElicitationPanel, ao as gateGlide, O as escapeAttr, ap as chatBoundaryOf, aq as relabelCodeLanguages, ar as relabelCitations, as as toolCallRenderer, at as toolRendererThatDrew, t as aparteGlobalConfig, au as isMountedRenderer, av as renderingVersionOf, H as cssEscape, aw as onRenderersChange, ax as renderSourceList, ay as mergeSegmentUpdate, P as escapeHtml, $ as isSegmentSettled, az as writeStreamedMarkdown, aA as replaceHighlighted, _ as isSafeUrl, C as copyText, U as getSegmentRenderer, W as installDefaultRenderersOnce, r as AparteMessageRepository, aB as CheckpointStateWatcher, aC as chatIdOf, aD as stampSegmentActivity, aE as stampSegmentOnInsert, aF as stampSegmentOnUpdate, aG as renumberSegments, aH as openSegmentIds, aI as isTerminalStatus, aJ as adoptMessageSegments, Y as isAwaitingReply, a4 as populateBubbleFromMessage, al as uuid, ad as revokeAttachmentUrls, a3 as parseMarkdownToSegments, aK as APARTE_DERIVED_SEGMENTS, aL as rememberConversationStatus, aM as tellConversationStatus, aN as conversationStatusOf, e as APARTE_DEFAULT_LOCALE, aO as usageTokens, q as AparteErrorCode, a0 as measureContext, aP as rootOf, g as APARTE_HOST_ATTR, X as installDialogTriggersOnce } from "./defer-hydration-
|
|
2
|
-
import { A, a, b, c, d, f, h, i, j, k, l, m, n, p, s, u, v, y, z, B, D, E, F, G, I, J, L, M, N, Q, R, S, T, V, Z, a1, a2, a5, a6, a7, a8, a9, aa, ab, af, ag, ai, aj, ak } from "./defer-hydration-
|
|
1
|
+
import { K as deferHydrationOf, ac as resolveConfig, am as eventOrigin, an as activeElementIn, ah as subscribeConfigChange, ae as runWithConfig, o as AparteElicitationAbortError, w as buildApprovalPanel, x as buildElicitationPanel, ao as gateGlide, O as escapeAttr, ap as chatBoundaryOf, aq as relabelCodeLanguages, ar as relabelCitations, as as toolCallRenderer, at as toolRendererThatDrew, t as aparteGlobalConfig, au as isMountedRenderer, av as renderingVersionOf, H as cssEscape, aw as onRenderersChange, ax as renderSourceList, ay as mergeSegmentUpdate, P as escapeHtml, $ as isSegmentSettled, az as writeStreamedMarkdown, aA as replaceHighlighted, _ as isSafeUrl, C as copyText, U as getSegmentRenderer, W as installDefaultRenderersOnce, r as AparteMessageRepository, aB as CheckpointStateWatcher, aC as chatIdOf, aD as stampSegmentActivity, aE as stampSegmentOnInsert, aF as stampSegmentOnUpdate, aG as renumberSegments, aH as openSegmentIds, aI as isTerminalStatus, aJ as adoptMessageSegments, Y as isAwaitingReply, a4 as populateBubbleFromMessage, al as uuid, ad as revokeAttachmentUrls, a3 as parseMarkdownToSegments, aK as APARTE_DERIVED_SEGMENTS, aL as rememberConversationStatus, aM as tellConversationStatus, aN as conversationStatusOf, e as APARTE_DEFAULT_LOCALE, aO as usageTokens, q as AparteErrorCode, a0 as measureContext, aP as rootOf, g as APARTE_HOST_ATTR, X as installDialogTriggersOnce } from "./defer-hydration-rafq3SGv.js";
|
|
2
|
+
import { A, a, b, c, d, f, h, i, j, k, l, m, n, p, s, u, v, y, z, B, D, E, F, G, I, J, L, M, N, Q, R, S, T, V, Z, a1, a2, a5, a6, a7, a8, a9, aa, ab, af, ag, ai, aj, ak } from "./defer-hydration-rafq3SGv.js";
|
|
3
3
|
function presenceOn(value) {
|
|
4
4
|
return value === "" ? true : Boolean(value);
|
|
5
5
|
}
|
|
@@ -3491,10 +3491,12 @@ class AparteChatViewport extends HTMLElement {
|
|
|
3491
3491
|
_onDisclosureToggle = () => {
|
|
3492
3492
|
this._scheduleSpacerUpdate();
|
|
3493
3493
|
};
|
|
3494
|
-
/** The `[overlay-composer]` shell this viewport floats in, if any.
|
|
3494
|
+
/** The `[overlay-composer]` shell this viewport floats in, if any. Followed, not read once: see `_wireOverlay`. */
|
|
3495
3495
|
_overlayRoot = null;
|
|
3496
3496
|
/** Watches the overlay shell's childList, so a stack child that mounts later (elicitation) gets observed too. */
|
|
3497
3497
|
_overlayObserver = null;
|
|
3498
|
+
/** Watches the parent's `overlay-composer` attribute, so the mode follows a binding that lands after connect. */
|
|
3499
|
+
_overlayAttrObserver = null;
|
|
3498
3500
|
/** Last `--aparte-bottom-inset` written, in px — style writes only when it changes. */
|
|
3499
3501
|
_overlayInset = -1;
|
|
3500
3502
|
/** Last `--aparte-transcript-inset` written on the host, in px — same write-on-change rule. */
|
|
@@ -4558,15 +4560,10 @@ class AparteChatViewport extends HTMLElement {
|
|
|
4558
4560
|
this._resizeObserver.observe(this._container);
|
|
4559
4561
|
}
|
|
4560
4562
|
}
|
|
4561
|
-
this.
|
|
4562
|
-
if (this.
|
|
4563
|
-
|
|
4564
|
-
this.
|
|
4565
|
-
for (const child of this._overlayStack()) this._resizeObserver?.observe(child);
|
|
4566
|
-
this._updateOverlayInset();
|
|
4567
|
-
});
|
|
4568
|
-
this._overlayObserver.observe(this._overlayRoot, { childList: true });
|
|
4569
|
-
this._updateOverlayInset();
|
|
4563
|
+
this._wireOverlay();
|
|
4564
|
+
if (this.parentElement) {
|
|
4565
|
+
this._overlayAttrObserver = new MutationObserver(() => this._wireOverlay());
|
|
4566
|
+
this._overlayAttrObserver.observe(this.parentElement, { attributes: true, attributeFilter: ["overlay-composer"] });
|
|
4570
4567
|
}
|
|
4571
4568
|
this._mutationObserver = new MutationObserver((mutations) => {
|
|
4572
4569
|
this._lastMutationAt = performance.now();
|
|
@@ -4607,6 +4604,29 @@ class AparteChatViewport extends HTMLElement {
|
|
|
4607
4604
|
});
|
|
4608
4605
|
}
|
|
4609
4606
|
}
|
|
4607
|
+
/**
|
|
4608
|
+
* Follow the `[overlay-composer]` shell: observe its stack when the attribute is
|
|
4609
|
+
* there, unobserve it and drop the var when it is gone. A no-op while the shell
|
|
4610
|
+
* has not changed — it runs at setup and on every write of the attribute.
|
|
4611
|
+
*/
|
|
4612
|
+
_wireOverlay() {
|
|
4613
|
+
const root = this.closest("[overlay-composer]");
|
|
4614
|
+
if (root === this._overlayRoot) return;
|
|
4615
|
+
for (const child of this._overlayStack()) this._resizeObserver?.unobserve(child);
|
|
4616
|
+
this._overlayObserver?.disconnect();
|
|
4617
|
+
this._overlayObserver = null;
|
|
4618
|
+
this._overlayRoot = root;
|
|
4619
|
+
this._overlayInset = -1;
|
|
4620
|
+
this.style.removeProperty("--aparte-bottom-inset");
|
|
4621
|
+
if (!root || !this._resizeObserver) return;
|
|
4622
|
+
for (const child of this._overlayStack()) this._resizeObserver.observe(child);
|
|
4623
|
+
this._overlayObserver = new MutationObserver(() => {
|
|
4624
|
+
for (const child of this._overlayStack()) this._resizeObserver?.observe(child);
|
|
4625
|
+
this._updateOverlayInset();
|
|
4626
|
+
});
|
|
4627
|
+
this._overlayObserver.observe(root, { childList: true });
|
|
4628
|
+
this._updateOverlayInset();
|
|
4629
|
+
}
|
|
4610
4630
|
/**
|
|
4611
4631
|
* The overlay shell's element children that are the floating bottom stack: not this
|
|
4612
4632
|
* viewport, and not the scroll rail, which floats over the transcript by design —
|
|
@@ -4958,6 +4978,8 @@ class AparteChatViewport extends HTMLElement {
|
|
|
4958
4978
|
this.removeEventListener("toggle", this._onDisclosureToggle, true);
|
|
4959
4979
|
this._overlayObserver?.disconnect();
|
|
4960
4980
|
this._overlayObserver = null;
|
|
4981
|
+
this._overlayAttrObserver?.disconnect();
|
|
4982
|
+
this._overlayAttrObserver = null;
|
|
4961
4983
|
this._overlayRoot = null;
|
|
4962
4984
|
this._overlayInset = -1;
|
|
4963
4985
|
this._transcriptInset = -1;
|