@genesislcap/ai-assistant 15.52.0 → 15.53.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.
|
@@ -77,7 +77,9 @@ export declare class AiChatBubble extends GenesisElement {
|
|
|
77
77
|
disconnectedCallback(): void;
|
|
78
78
|
dialogOpenChanged(_: boolean, next: boolean): void;
|
|
79
79
|
dialogContentChanged(_: HTMLElement[], next: HTMLElement[]): void;
|
|
80
|
+
private findAssistant;
|
|
80
81
|
private injectCloseButton;
|
|
82
|
+
private removeCloseButton;
|
|
81
83
|
onBubbleMouseDown(e: MouseEvent): void;
|
|
82
84
|
onDialogHeaderMouseDown(e: CustomEvent<{
|
|
83
85
|
clientX: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-bubble.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-bubble/chat-bubble.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,cAAc,EAAoB,MAAM,uBAAuB,CAAC;AAK9F;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAExD;AAkCD;;;;;;;;;GASG;AACH,qBAOa,YAAa,SAAQ,cAAc;IAChB,KAAK,EAAE,MAAM,CAAkB;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IACP,kBAAkB,EAAE,MAAM,CAAW;IAElF,gBAAgB;IACJ,aAAa,EAAE,WAAW,EAAE,CAAM;IAC9C,gBAAgB;IACJ,oBAAoB,EAAE,MAAM,CAAK;IAC7C,iFAAiF;IACrE,UAAU,EAAE,MAAM,CAAK;IACnC,+EAA+E;IACnE,SAAS,EAAE,MAAM,CAAK;IAClC,mFAAmF;IACvE,UAAU,EAAE,MAAM,CAAK;IACnC,iFAAiF;IACrE,SAAS,EAAE,MAAM,CAAK;IAClC,iEAAiE;IACrD,WAAW,EAAE,MAAM,CAAwB;IACvD,kEAAkE;IACtD,YAAY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,WAAW,EAAE;IAa1D,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,iBAAiB;IAMzB,iBAAiB,CAAC,CAAC,EAAE,UAAU;IAa/B,uBAAuB,CAAC,CAAC,EAAE,WAAW,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAkB5E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA8B;IAO9D,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,gBAAgB;IAkCxB,OAAO,CAAC,cAAc,CAOpB;IASF,OAAO,CAAC,cAAc,CAuBpB;IAMF,OAAO,CAAC,YAAY,CA0ClB;IAEF,QAAQ;IAIR,aAAa;IAiBb,IAAI,YAAY,IAAI,MAAM,CAazB;CACF"}
|
|
@@ -210,22 +210,20 @@ let AiChatBubble = class AiChatBubble extends GenesisElement {
|
|
|
210
210
|
this.hovered = false;
|
|
211
211
|
}
|
|
212
212
|
disconnectedCallback() {
|
|
213
|
-
var _a, _b, _c
|
|
213
|
+
var _a, _b, _c;
|
|
214
214
|
super.disconnectedCallback();
|
|
215
215
|
document.removeEventListener('mousemove', this.onDocMouseMove);
|
|
216
216
|
document.removeEventListener('mouseup', this.onDocMouseUp);
|
|
217
217
|
(_a = this.unsubBus) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
218
218
|
this.unsubBus = undefined;
|
|
219
|
-
|
|
220
|
-
(
|
|
221
|
-
this.injectedCloseBtn = undefined;
|
|
222
|
-
(_d = this.resizeObserver) === null || _d === void 0 ? void 0 : _d.disconnect();
|
|
219
|
+
this.removeCloseButton();
|
|
220
|
+
(_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
223
221
|
this.resizeObserver = undefined;
|
|
224
222
|
if (this.rafHandle !== undefined) {
|
|
225
223
|
cancelAnimationFrame(this.rafHandle);
|
|
226
224
|
this.rafHandle = undefined;
|
|
227
225
|
}
|
|
228
|
-
(
|
|
226
|
+
(_c = this.closeAbort) === null || _c === void 0 ? void 0 : _c.abort();
|
|
229
227
|
this.closeAbort = undefined;
|
|
230
228
|
}
|
|
231
229
|
dialogOpenChanged(_, next) {
|
|
@@ -269,18 +267,30 @@ let AiChatBubble = class AiChatBubble extends GenesisElement {
|
|
|
269
267
|
}
|
|
270
268
|
}
|
|
271
269
|
dialogContentChanged(_, next) {
|
|
272
|
-
|
|
273
|
-
if (!
|
|
270
|
+
const assistant = this.findAssistant(next);
|
|
271
|
+
if (!assistant) {
|
|
272
|
+
this.removeCloseButton();
|
|
274
273
|
return;
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
}
|
|
275
|
+
if (this.injectedCloseBtn) {
|
|
276
|
+
if (this.injectedCloseBtn.parentElement === assistant)
|
|
277
|
+
return;
|
|
278
|
+
this.removeCloseButton();
|
|
279
|
+
}
|
|
280
|
+
this.injectCloseButton(assistant);
|
|
281
|
+
}
|
|
282
|
+
findAssistant(nodes) {
|
|
283
|
+
var _a, _b, _c, _d;
|
|
284
|
+
if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))
|
|
285
|
+
return null;
|
|
286
|
+
for (const el of nodes) {
|
|
287
|
+
const assistant = ((_a = el.tagName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'foundation-ai-assistant'
|
|
277
288
|
? el
|
|
278
|
-
: (
|
|
279
|
-
if (assistant)
|
|
280
|
-
|
|
281
|
-
break;
|
|
282
|
-
}
|
|
289
|
+
: ((_c = (_b = el.querySelector) === null || _b === void 0 ? void 0 : _b.call(el, 'foundation-ai-assistant')) !== null && _c !== void 0 ? _c : (_d = el.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector('foundation-ai-assistant'));
|
|
290
|
+
if (assistant)
|
|
291
|
+
return assistant;
|
|
283
292
|
}
|
|
293
|
+
return null;
|
|
284
294
|
}
|
|
285
295
|
injectCloseButton(assistant) {
|
|
286
296
|
const prefix = this.designSystemPrefix;
|
|
@@ -295,6 +305,12 @@ let AiChatBubble = class AiChatBubble extends GenesisElement {
|
|
|
295
305
|
assistant.appendChild(btn);
|
|
296
306
|
this.injectedCloseBtn = btn;
|
|
297
307
|
}
|
|
308
|
+
removeCloseButton() {
|
|
309
|
+
var _a, _b;
|
|
310
|
+
(_a = this.injectedCloseBtn) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', this.onCloseBtnClick);
|
|
311
|
+
(_b = this.injectedCloseBtn) === null || _b === void 0 ? void 0 : _b.remove();
|
|
312
|
+
this.injectedCloseBtn = undefined;
|
|
313
|
+
}
|
|
298
314
|
onBubbleMouseDown(e) {
|
|
299
315
|
e.preventDefault();
|
|
300
316
|
this.dragging = true;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/ai-assistant",
|
|
3
3
|
"description": "Genesis AI Assistant micro-frontend",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.53.0",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/ai-assistant.d.ts",
|
|
@@ -92,31 +92,31 @@
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@genesislcap/foundation-comms": "15.
|
|
96
|
-
"@genesislcap/foundation-testing": "15.
|
|
97
|
-
"@genesislcap/genx": "15.
|
|
98
|
-
"@genesislcap/ts-builder": "15.
|
|
99
|
-
"@genesislcap/uvu-playwright-builder": "15.
|
|
100
|
-
"@genesislcap/vite-builder": "15.
|
|
101
|
-
"@genesislcap/webpack-builder": "15.
|
|
95
|
+
"@genesislcap/foundation-comms": "15.53.0",
|
|
96
|
+
"@genesislcap/foundation-testing": "15.53.0",
|
|
97
|
+
"@genesislcap/genx": "15.53.0",
|
|
98
|
+
"@genesislcap/ts-builder": "15.53.0",
|
|
99
|
+
"@genesislcap/uvu-playwright-builder": "15.53.0",
|
|
100
|
+
"@genesislcap/vite-builder": "15.53.0",
|
|
101
|
+
"@genesislcap/webpack-builder": "15.53.0",
|
|
102
102
|
"@types/dompurify": "^3.0.5",
|
|
103
103
|
"@types/marked": "^5.0.2",
|
|
104
104
|
"esbuild": "0.25.12"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@genesislcap/foundation-ai": "15.
|
|
108
|
-
"@genesislcap/foundation-logger": "15.
|
|
109
|
-
"@genesislcap/foundation-notifications": "15.
|
|
110
|
-
"@genesislcap/foundation-redux": "15.
|
|
111
|
-
"@genesislcap/foundation-ui": "15.
|
|
112
|
-
"@genesislcap/foundation-utils": "15.
|
|
113
|
-
"@genesislcap/rapid-design-system": "15.
|
|
114
|
-
"@genesislcap/web-core": "15.
|
|
107
|
+
"@genesislcap/foundation-ai": "15.53.0",
|
|
108
|
+
"@genesislcap/foundation-logger": "15.53.0",
|
|
109
|
+
"@genesislcap/foundation-notifications": "15.53.0",
|
|
110
|
+
"@genesislcap/foundation-redux": "15.53.0",
|
|
111
|
+
"@genesislcap/foundation-ui": "15.53.0",
|
|
112
|
+
"@genesislcap/foundation-utils": "15.53.0",
|
|
113
|
+
"@genesislcap/rapid-design-system": "15.53.0",
|
|
114
|
+
"@genesislcap/web-core": "15.53.0",
|
|
115
115
|
"dompurify": "^3.3.1",
|
|
116
116
|
"marked": "^17.0.3"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
|
-
"@genesislcap/foundation-comms": "^15.
|
|
119
|
+
"@genesislcap/foundation-comms": "^15.53.0"
|
|
120
120
|
},
|
|
121
121
|
"peerDependenciesMeta": {
|
|
122
122
|
"@genesislcap/foundation-comms": {
|