@syntrologie/adapt-chatbot 2.8.0-canary.281 → 2.8.0-canary.282
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/AdaptiveChatBar.js +2 -2
- package/dist/AdaptiveChatTrail.js +2 -2
- package/dist/ChatAssistantLit.js +1 -1
- package/dist/{chunk-DDZFWNVM.js → chunk-K2IG34L7.js} +35 -3
- package/dist/chunk-K2IG34L7.js.map +7 -0
- package/dist/{chunk-HZ55BLN3.js → chunk-XP2UFKPG.js} +2 -2
- package/dist/runtime.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-DDZFWNVM.js.map +0 -7
- /package/dist/{chunk-HZ55BLN3.js.map → chunk-XP2UFKPG.js.map} +0 -0
package/dist/AdaptiveChatBar.js
CHANGED
package/dist/ChatAssistantLit.js
CHANGED
|
@@ -3096,8 +3096,7 @@ var SyntroChat = class extends LitElement {
|
|
|
3096
3096
|
}
|
|
3097
3097
|
connectedCallback() {
|
|
3098
3098
|
super.connectedCallback();
|
|
3099
|
-
|
|
3100
|
-
injectChatStyles(root instanceof ShadowRoot || root instanceof Document ? root : document);
|
|
3099
|
+
this._ensureStylesInRoot();
|
|
3101
3100
|
if (this.transport) {
|
|
3102
3101
|
this._unsubscribe = this.transport.subscribe(this._handleEvent);
|
|
3103
3102
|
this.transport.connect();
|
|
@@ -3110,9 +3109,42 @@ var SyntroChat = class extends LitElement {
|
|
|
3110
3109
|
this.transport?.disconnect();
|
|
3111
3110
|
}
|
|
3112
3111
|
firstUpdated() {
|
|
3112
|
+
this._ensureStylesInRoot();
|
|
3113
3113
|
this._scrollContainer = this.querySelector("[data-sc-scroll-area]");
|
|
3114
3114
|
this._scrollContainer?.addEventListener("scroll", this._handleScroll);
|
|
3115
3115
|
}
|
|
3116
|
+
/**
|
|
3117
|
+
* Resolve the *effective* rendering root for this chat instance.
|
|
3118
|
+
*
|
|
3119
|
+
* `this.getRootNode()` will follow shadow boundaries, but in the editor
|
|
3120
|
+
* surface the chat is created via `document.createElement('syntro-chat')`
|
|
3121
|
+
* and then committed into the smart-canvas shadow tree by Lit several
|
|
3122
|
+
* frames after `connectedCallback`. During that window
|
|
3123
|
+
* `getRootNode()` returns Document even though the element ultimately
|
|
3124
|
+
* lives in a shadow root (BUG-1779636600).
|
|
3125
|
+
*
|
|
3126
|
+
* Walk the parent chain manually, hopping across shadow boundaries via
|
|
3127
|
+
* `.host`, and return the deepest enclosing `ShadowRoot` we can reach.
|
|
3128
|
+
* Fall back to `getRootNode()` (Document or self) when no shadow root
|
|
3129
|
+
* is in the chain — that's the host-page chatbot case.
|
|
3130
|
+
*/
|
|
3131
|
+
_resolveStyleRoot() {
|
|
3132
|
+
let node = this;
|
|
3133
|
+
while (node) {
|
|
3134
|
+
const parent = node.parentNode;
|
|
3135
|
+
if (parent) {
|
|
3136
|
+
node = parent;
|
|
3137
|
+
continue;
|
|
3138
|
+
}
|
|
3139
|
+
if (node instanceof ShadowRoot) return node;
|
|
3140
|
+
break;
|
|
3141
|
+
}
|
|
3142
|
+
const r = this.getRootNode();
|
|
3143
|
+
return r instanceof ShadowRoot || r instanceof Document ? r : document;
|
|
3144
|
+
}
|
|
3145
|
+
_ensureStylesInRoot() {
|
|
3146
|
+
injectChatStyles(this._resolveStyleRoot());
|
|
3147
|
+
}
|
|
3116
3148
|
updated() {
|
|
3117
3149
|
this._injectCodeCopyButtons();
|
|
3118
3150
|
}
|
|
@@ -3238,4 +3270,4 @@ export {
|
|
|
3238
3270
|
dompurify/dist/purify.es.mjs:
|
|
3239
3271
|
(*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE *)
|
|
3240
3272
|
*/
|
|
3241
|
-
//# sourceMappingURL=chunk-
|
|
3273
|
+
//# sourceMappingURL=chunk-K2IG34L7.js.map
|