ai12z 3.14.1-alpha.0 → 3.14.2

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.
@@ -55,10 +55,18 @@ const Ai12zChatMessage = class {
55
55
  botHelpers.initializeScript(event.detail.id, this.mainObject);
56
56
  }
57
57
  componentWillLoad() {
58
+ var _a, _b;
58
59
  this.loadScriptsSequentially();
60
+ // Adopt customCSS in this shadow root using the shared CSSStyleSheet
61
+ // already constructed by the parent knowledge-box (zero extra fetches).
62
+ if ((_a = this.kbSettings) === null || _a === void 0 ? void 0 : _a.customCSS) {
63
+ styleSheetRegistry.adoptStyleSheet(this.kbSettings.customCSS, this.el.shadowRoot);
64
+ }
65
+ if ((_b = this.kbSettings) === null || _b === void 0 ? void 0 : _b.customJS) {
66
+ styleSheetRegistry.loadScriptOnce(this.kbSettings.customJS, this.el.shadowRoot);
67
+ }
59
68
  }
60
69
  componentDidLoad() {
61
- var _a, _b;
62
70
  // Initialise the ai12z global exactly once; never overwrite an existing value.
63
71
  if (!window["ai12z"]) {
64
72
  window["ai12z"] = {};
@@ -67,14 +75,6 @@ const Ai12zChatMessage = class {
67
75
  ai12zHeading.text = `var ai12zChat = window["ai12z"] = {}`;
68
76
  this.el.shadowRoot.appendChild(ai12zHeading);
69
77
  this.checkOverflow();
70
- // Adopt customCSS in this shadow root using the shared CSSStyleSheet
71
- // already constructed by the parent knowledge-box (zero extra fetches).
72
- if ((_a = this.kbSettings) === null || _a === void 0 ? void 0 : _a.customCSS) {
73
- styleSheetRegistry.adoptStyleSheet(this.kbSettings.customCSS, this.el.shadowRoot);
74
- }
75
- if ((_b = this.kbSettings) === null || _b === void 0 ? void 0 : _b.customJS) {
76
- styleSheetRegistry.loadScriptOnce(this.kbSettings.customJS, this.el.shadowRoot);
77
- }
78
78
  }
79
79
  async loadScriptsSequentially() {
80
80
  try {
@@ -156,9 +156,9 @@ const Ai12zChatMessage = class {
156
156
  render() {
157
157
  var _a, _b, _c, _d;
158
158
  const lineClamp = (_b = (_a = this.kbSettings) === null || _a === void 0 ? void 0 : _a.numberOfLines) !== null && _b !== void 0 ? _b : 10;
159
- return (index.h("div", { key: '2d24739583f2f73daa28590c6c121531cf6ab4ce', class: "chat-message" }, index.h("div", { key: '9e8ca0a62a0de746f367164ff51ea9b9a22e93a0', ref: (el) => this.messageRef = el, class: { 'message-text': true, "custom-line-clamp": !this.isExpanded && !this.isCollapsing && this.showButton }, style: {
159
+ return (index.h("div", { key: '54f51ffb7c06bbb20fc1088c0fb63a8669d7ba45', class: "chat-message" }, index.h("div", { key: '281bc75361bcfadb4611eefeb9697d525b9e2d27', ref: (el) => this.messageRef = el, class: { 'message-text': true, "custom-line-clamp": !this.isExpanded && !this.isCollapsing && this.showButton }, style: {
160
160
  "--line-clamp": `${lineClamp}`,
161
- }, innerHTML: this.text, onClick: this.showButton ? this.toggleExpand : undefined }), !this.isExpanded && this.showButton && this.canExpand && index.h("div", { key: '12f386a03fc84f97d2e585ea21cf4f8d31964c34', class: "fade-overlay" }), this.showButton && this.canExpand && index.h("button", { key: '1633be8cd35334eae64f75d7ce5fd87b30054849', class: "show-more-btn", onClick: this.toggleExpand }, this.isExpanded ? (((_c = this.kbSettings) === null || _c === void 0 ? void 0 : _c.showLessButtonLabel) || "Show less") : (((_d = this.kbSettings) === null || _d === void 0 ? void 0 : _d.showMoreButtonLabel) || "Show more"), this.isExpanded ? index.h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("polyline", { points: "6 9 12 15 18 9" })) : index.h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("polyline", { points: "18 15 12 9 6 15" })))));
161
+ }, innerHTML: this.text, onClick: this.showButton ? this.toggleExpand : undefined }), !this.isExpanded && this.showButton && this.canExpand && index.h("div", { key: 'd6e262dbca0934b97fafb3dd7723b3b9333d8e10', class: "fade-overlay" }), this.showButton && this.canExpand && index.h("button", { key: 'e1e711b71656763ecdeb1cb6f73166528f023914', class: "show-more-btn", onClick: this.toggleExpand }, this.isExpanded ? (((_c = this.kbSettings) === null || _c === void 0 ? void 0 : _c.showLessButtonLabel) || "Show less") : (((_d = this.kbSettings) === null || _d === void 0 ? void 0 : _d.showMoreButtonLabel) || "Show more"), this.isExpanded ? index.h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("polyline", { points: "6 9 12 15 18 9" })) : index.h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("polyline", { points: "18 15 12 9 6 15" })))));
162
162
  }
163
163
  get el() { return index.getElement(this); }
164
164
  static get watchers() { return {
@@ -48,10 +48,18 @@ export class Ai12zChatMessage {
48
48
  initializeScriptHelper(event.detail.id, this.mainObject);
49
49
  }
50
50
  componentWillLoad() {
51
+ var _a, _b;
51
52
  this.loadScriptsSequentially();
53
+ // Adopt customCSS in this shadow root using the shared CSSStyleSheet
54
+ // already constructed by the parent knowledge-box (zero extra fetches).
55
+ if ((_a = this.kbSettings) === null || _a === void 0 ? void 0 : _a.customCSS) {
56
+ adoptStyleSheet(this.kbSettings.customCSS, this.el.shadowRoot);
57
+ }
58
+ if ((_b = this.kbSettings) === null || _b === void 0 ? void 0 : _b.customJS) {
59
+ loadScriptOnce(this.kbSettings.customJS, this.el.shadowRoot);
60
+ }
52
61
  }
53
62
  componentDidLoad() {
54
- var _a, _b;
55
63
  // Initialise the ai12z global exactly once; never overwrite an existing value.
56
64
  if (!window["ai12z"]) {
57
65
  window["ai12z"] = {};
@@ -60,14 +68,6 @@ export class Ai12zChatMessage {
60
68
  ai12zHeading.text = `var ai12zChat = window["ai12z"] = {}`;
61
69
  this.el.shadowRoot.appendChild(ai12zHeading);
62
70
  this.checkOverflow();
63
- // Adopt customCSS in this shadow root using the shared CSSStyleSheet
64
- // already constructed by the parent knowledge-box (zero extra fetches).
65
- if ((_a = this.kbSettings) === null || _a === void 0 ? void 0 : _a.customCSS) {
66
- adoptStyleSheet(this.kbSettings.customCSS, this.el.shadowRoot);
67
- }
68
- if ((_b = this.kbSettings) === null || _b === void 0 ? void 0 : _b.customJS) {
69
- loadScriptOnce(this.kbSettings.customJS, this.el.shadowRoot);
70
- }
71
71
  }
72
72
  async loadScriptsSequentially() {
73
73
  try {
@@ -149,9 +149,9 @@ export class Ai12zChatMessage {
149
149
  render() {
150
150
  var _a, _b, _c, _d;
151
151
  const lineClamp = (_b = (_a = this.kbSettings) === null || _a === void 0 ? void 0 : _a.numberOfLines) !== null && _b !== void 0 ? _b : 10;
152
- return (h("div", { key: '2d24739583f2f73daa28590c6c121531cf6ab4ce', class: "chat-message" }, h("div", { key: '9e8ca0a62a0de746f367164ff51ea9b9a22e93a0', ref: (el) => this.messageRef = el, class: { 'message-text': true, "custom-line-clamp": !this.isExpanded && !this.isCollapsing && this.showButton }, style: {
152
+ return (h("div", { key: '54f51ffb7c06bbb20fc1088c0fb63a8669d7ba45', class: "chat-message" }, h("div", { key: '281bc75361bcfadb4611eefeb9697d525b9e2d27', ref: (el) => this.messageRef = el, class: { 'message-text': true, "custom-line-clamp": !this.isExpanded && !this.isCollapsing && this.showButton }, style: {
153
153
  "--line-clamp": `${lineClamp}`,
154
- }, innerHTML: this.text, onClick: this.showButton ? this.toggleExpand : undefined }), !this.isExpanded && this.showButton && this.canExpand && h("div", { key: '12f386a03fc84f97d2e585ea21cf4f8d31964c34', class: "fade-overlay" }), this.showButton && this.canExpand && h("button", { key: '1633be8cd35334eae64f75d7ce5fd87b30054849', class: "show-more-btn", onClick: this.toggleExpand }, this.isExpanded ? (((_c = this.kbSettings) === null || _c === void 0 ? void 0 : _c.showLessButtonLabel) || "Show less") : (((_d = this.kbSettings) === null || _d === void 0 ? void 0 : _d.showMoreButtonLabel) || "Show more"), this.isExpanded ? h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polyline", { points: "6 9 12 15 18 9" })) : h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polyline", { points: "18 15 12 9 6 15" })))));
154
+ }, innerHTML: this.text, onClick: this.showButton ? this.toggleExpand : undefined }), !this.isExpanded && this.showButton && this.canExpand && h("div", { key: 'd6e262dbca0934b97fafb3dd7723b3b9333d8e10', class: "fade-overlay" }), this.showButton && this.canExpand && h("button", { key: 'e1e711b71656763ecdeb1cb6f73166528f023914', class: "show-more-btn", onClick: this.toggleExpand }, this.isExpanded ? (((_c = this.kbSettings) === null || _c === void 0 ? void 0 : _c.showLessButtonLabel) || "Show less") : (((_d = this.kbSettings) === null || _d === void 0 ? void 0 : _d.showMoreButtonLabel) || "Show more"), this.isExpanded ? h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polyline", { points: "6 9 12 15 18 9" })) : h("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polyline", { points: "18 15 12 9 6 15" })))));
155
155
  }
156
156
  static get is() { return "ai12z-chat-message"; }
157
157
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- import{A as o,d as s}from"./p-C_wQhGjc.js";const p=o,r=s;export{p as Ai12zChatMessage,r as defineCustomElement}
1
+ import{A as o,d as s}from"./p-m0Ed3g6I.js";const m=o,p=s;export{m as Ai12zChatMessage,p as defineCustomElement}
@@ -1 +1 @@
1
- import{A as o,d as s}from"./p-BP6_06aA.js";const a=o,p=s;export{a as Ai12zKnowledgeBox,p as defineCustomElement}
1
+ import{A as o,d as s}from"./p-mBjDeFh_.js";const m=o,p=s;export{m as Ai12zKnowledgeBox,p as defineCustomElement}
@@ -1 +1 @@
1
- import{g as o}from"./p-ZGVz1_9H.js";export{a as getAssetPath,r as render,s as setAssetPath,b as setNonce,c as setPlatformOptions}from"./p-ZGVz1_9H.js";export{A as Ai12zBot}from"./p-B9IJbo4G.js";export{A as Ai12zCta}from"./p-BaXs0IIw.js";export{A as Ai12zKnowledgeBox}from"./p-BP6_06aA.js";export{S as Ai12zSearchPanel}from"./p-AQ1MS6Ps.js";export{S as Ai12zSearchResultsPage}from"./p-BwqXbNCx.js";export{A as Ai12zInlineSearch}from"./p-BwpiW24r.js";export{A as Ai12zForm}from"./p-Ci85xHWQ.js";export{A as Ai12zContainer}from"./p-DkRAkHLI.js";o();
1
+ import{g as e}from"./p-ZGVz1_9H.js";export{a as getAssetPath,r as render,s as setAssetPath,b as setNonce,c as setPlatformOptions}from"./p-ZGVz1_9H.js";export{A as Ai12zBot}from"./p-B9IJbo4G.js";export{A as Ai12zCta}from"./p-BaXs0IIw.js";export{A as Ai12zKnowledgeBox}from"./p-mBjDeFh_.js";export{S as Ai12zSearchPanel}from"./p-AQ1MS6Ps.js";export{S as Ai12zSearchResultsPage}from"./p-BwqXbNCx.js";export{A as Ai12zInlineSearch}from"./p-BwpiW24r.js";export{A as Ai12zForm}from"./p-Ci85xHWQ.js";export{A as Ai12zContainer}from"./p-DkRAkHLI.js";e();