@salla.sa/ui-ai-kit-core 2.1.0 → 2.2.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/cjs/ai-agent-error.cjs.entry.js +3 -3
- package/dist/cjs/ai-card.cjs.entry.js +3 -3
- package/dist/cjs/ai-chat-container.cjs.entry.js +74 -14
- package/dist/cjs/ai-chat-header.cjs.entry.js +64 -8
- package/dist/cjs/ai-chat-message.cjs.entry.js +10 -4
- package/dist/cjs/ai-conversation-list.cjs.entry.js +38 -22
- package/dist/cjs/ai-conversation-summary.cjs.entry.js +3 -3
- package/dist/cjs/ai-icon.cjs.entry.js +2 -2
- package/dist/cjs/ai-in-chat-browser.cjs.entry.js +68 -0
- package/dist/cjs/ai-link.cjs.entry.js +3 -3
- package/dist/cjs/ai-loading.cjs.entry.js +3 -3
- package/dist/cjs/ai-message-input.cjs.entry.js +12 -7
- package/dist/cjs/ai-rating.cjs.entry.js +26 -18
- package/dist/cjs/ai-route-decision.cjs.entry.js +3 -3
- package/dist/cjs/ai-suggestion.cjs.entry.js +3 -3
- package/dist/cjs/ai-voice-input.cjs.entry.js +2 -2
- package/dist/cjs/icon-registry-D-m8GW4D.js +126 -0
- package/dist/cjs/{index-Bs23yVuF.js → index-BQ8Az7-D.js} +71 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/ui-ai-kit.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ai-agent-error/ai-agent-error.js +1 -1
- package/dist/collection/components/ai-card/ai-card.js +2 -2
- package/dist/collection/components/ai-chat-container/ai-chat-container.css +175 -3
- package/dist/collection/components/ai-chat-container/ai-chat-container.js +166 -11
- package/dist/collection/components/ai-chat-header/ai-chat-header.css +107 -0
- package/dist/collection/components/ai-chat-header/ai-chat-header.js +242 -8
- package/dist/collection/components/ai-chat-message/ai-chat-message.js +8 -2
- package/dist/collection/components/ai-conversation-list/ai-conversation-list.css +116 -7
- package/dist/collection/components/ai-conversation-list/ai-conversation-list.js +140 -26
- package/dist/collection/components/ai-conversation-summary/ai-conversation-summary.js +1 -1
- package/dist/collection/components/ai-icon/ai-icon.js +1 -1
- package/dist/collection/components/ai-in-chat-browser/ai-in-chat-browser.css +88 -0
- package/dist/collection/components/ai-in-chat-browser/ai-in-chat-browser.js +171 -0
- package/dist/collection/components/ai-link/ai-link.js +1 -1
- package/dist/collection/components/ai-loading/ai-loading.js +1 -1
- package/dist/collection/components/ai-message-input/ai-message-input.css +46 -5
- package/dist/collection/components/ai-message-input/ai-message-input.js +10 -5
- package/dist/collection/components/ai-rating/ai-rating.css +22 -2
- package/dist/collection/components/ai-rating/ai-rating.js +46 -17
- package/dist/collection/components/ai-route-decision/ai-route-decision.js +1 -1
- package/dist/collection/components/ai-suggestion/ai-suggestion.js +2 -2
- package/dist/collection/components/ai-voice-input/ai-voice-input.js +1 -1
- package/dist/collection/utils/icon-registry.js +27 -7
- package/dist/components/ai-agent-error.js +1 -1
- package/dist/components/ai-card.js +1 -1
- package/dist/components/ai-chat-container.js +1 -1
- package/dist/components/ai-chat-header.js +1 -1
- package/dist/components/ai-chat-message.js +2 -2
- package/dist/components/ai-conversation-list.js +1 -1
- package/dist/components/ai-conversation-summary.js +1 -1
- package/dist/components/ai-icon.js +1 -1
- package/dist/components/ai-in-chat-browser.d.ts +11 -0
- package/dist/components/ai-in-chat-browser.js +1 -0
- package/dist/components/ai-link.js +1 -1
- package/dist/components/ai-loading.js +1 -1
- package/dist/components/ai-message-input.js +1 -1
- package/dist/components/ai-rating.js +1 -1
- package/dist/components/ai-route-decision.js +1 -1
- package/dist/components/ai-suggestion.js +1 -1
- package/dist/components/ai-voice-input.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-B3gdcdCK.js +1 -0
- package/dist/components/{p-Bbmjx9lq.js → p-C2LB8D3t.js} +1 -1
- package/dist/components/p-CXJ3iEt8.js +1 -0
- package/dist/components/p-D4mVoP6B.js +1 -0
- package/dist/components/p-DKsh1ZQX.js +1 -0
- package/dist/components/p-DlD8m3rf.js +1 -0
- package/dist/components/{p-C5gkZloN.js → p-NKAwri_g.js} +1 -1
- package/dist/esm/ai-agent-error.entry.js +3 -3
- package/dist/esm/ai-card.entry.js +3 -3
- package/dist/esm/ai-chat-container.entry.js +74 -14
- package/dist/esm/ai-chat-header.entry.js +64 -8
- package/dist/esm/ai-chat-message.entry.js +10 -4
- package/dist/esm/ai-conversation-list.entry.js +38 -22
- package/dist/esm/ai-conversation-summary.entry.js +3 -3
- package/dist/esm/ai-icon.entry.js +2 -2
- package/dist/esm/ai-in-chat-browser.entry.js +66 -0
- package/dist/esm/ai-link.entry.js +3 -3
- package/dist/esm/ai-loading.entry.js +3 -3
- package/dist/esm/ai-message-input.entry.js +12 -7
- package/dist/esm/ai-rating.entry.js +26 -18
- package/dist/esm/ai-route-decision.entry.js +3 -3
- package/dist/esm/ai-suggestion.entry.js +3 -3
- package/dist/esm/ai-voice-input.entry.js +2 -2
- package/dist/esm/icon-registry-DlD8m3rf.js +124 -0
- package/dist/esm/{index-hxWjzqcH.js → index-BSQ0GkzI.js} +71 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/ui-ai-kit.js +3 -3
- package/dist/types/components/ai-chat-container/ai-chat-container.d.ts +18 -1
- package/dist/types/components/ai-chat-header/ai-chat-header.d.ts +27 -1
- package/dist/types/components/ai-conversation-list/ai-conversation-list.d.ts +12 -2
- package/dist/types/components/ai-in-chat-browser/ai-in-chat-browser.d.ts +22 -0
- package/dist/types/components/ai-rating/ai-rating.d.ts +4 -1
- package/dist/types/components.d.ts +283 -8
- package/dist/types/utils/icon-registry.d.ts +1 -1
- package/dist/ui-ai-kit/{p-889c6b00.entry.js → p-1e8e6440.entry.js} +1 -1
- package/dist/ui-ai-kit/p-29d84924.entry.js +1 -0
- package/dist/ui-ai-kit/p-39a2d4c3.entry.js +1 -0
- package/dist/ui-ai-kit/{p-ccaec7b4.entry.js → p-3a86919b.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-5ea933a4.entry.js → p-47797619.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-b33e92ea.entry.js → p-658d8b24.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-3268aa48.entry.js → p-73cbb80b.entry.js} +1 -1
- package/dist/ui-ai-kit/p-77ef8015.entry.js +1 -0
- package/dist/ui-ai-kit/{p-999dd7c8.entry.js → p-78fb4ceb.entry.js} +1 -1
- package/dist/ui-ai-kit/p-849cd7e2.entry.js +1 -0
- package/dist/ui-ai-kit/p-8cb807f3.entry.js +1 -0
- package/dist/ui-ai-kit/p-BSQ0GkzI.js +2 -0
- package/dist/ui-ai-kit/p-DlD8m3rf.js +1 -0
- package/dist/ui-ai-kit/p-abd68089.entry.js +1 -0
- package/dist/ui-ai-kit/{p-27bf454d.entry.js → p-b88808a4.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-6b9b1022.entry.js → p-c9dca99e.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-2342431f.entry.js → p-dac67692.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-9a4b8c7e.entry.js → p-eb40ffd0.entry.js} +2 -2
- package/dist/ui-ai-kit/ui-ai-kit.css +1 -1
- package/dist/ui-ai-kit/ui-ai-kit.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/icon-registry-BKb9-2Nt.js +0 -106
- package/dist/components/p-CAnlgwx0.js +0 -1
- package/dist/components/p-SJZ6Ujn9.js +0 -1
- package/dist/esm/icon-registry-SJZ6Ujn9.js +0 -104
- package/dist/ui-ai-kit/p-1cce63d4.entry.js +0 -1
- package/dist/ui-ai-kit/p-1e7608ee.entry.js +0 -1
- package/dist/ui-ai-kit/p-2a49ee93.entry.js +0 -1
- package/dist/ui-ai-kit/p-6b61d00f.entry.js +0 -1
- package/dist/ui-ai-kit/p-SJZ6Ujn9.js +0 -1
- package/dist/ui-ai-kit/p-a424e69b.entry.js +0 -1
- package/dist/ui-ai-kit/p-hxWjzqcH.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var iconRegistry = require('./icon-registry-
|
|
3
|
+
var index = require('./index-BQ8Az7-D.js');
|
|
4
|
+
var iconRegistry = require('./icon-registry-D-m8GW4D.js');
|
|
5
5
|
|
|
6
6
|
const aiAgentErrorCss = () => `:host{display:block}.icon-wrap{display:inline-flex;align-items:center;justify-content:center;line-height:0}@keyframes fade-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.error-card{background:var(--ai-danger-bg);border:1px solid var(--ai-danger-border);border-radius:16px;box-shadow:var(--ai-shadow-error);overflow:hidden;animation:fade-in 0.3s ease}.error-body{display:flex;align-items:flex-start;gap:12px;padding:16px}.error-icon-wrap{width:36px;height:36px;border-radius:9999px;background:var(--ai-bg-card);border:1px solid var(--ai-danger-border);display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--ai-danger-text)}.error-content{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0}.error-headline-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.error-headline{font-size:14px;font-weight:600;color:var(--ai-danger-text);line-height:1.4}.error-code-badge{font-size:11px;font-weight:500;color:var(--ai-danger-text);background:var(--ai-bg-card);border:1px solid var(--ai-danger-border);padding:1px 7px;border-radius:9999px;white-space:nowrap;flex-shrink:0;opacity:0.85}.error-message{margin:0;font-size:13px;font-weight:400;color:var(--ai-text-secondary);line-height:1.5}.dismiss-btn{display:inline-flex;align-items:center;justify-content:center;background:none;border:none;padding:4px;cursor:pointer;color:var(--ai-danger-text);opacity:0.6;flex-shrink:0;border-radius:6px;transition:opacity 0.15s ease, background 0.15s ease}.dismiss-btn:hover{opacity:1;background:var(--ai-hover-overlay)}.error-footer{padding:0 16px 14px}.retry-btn{display:inline-flex;align-items:center;gap:6px;background:var(--ai-bg-card);border:1px solid var(--ai-danger-border);border-radius:9999px;padding:6px 14px;font-size:13px;font-weight:500;color:var(--ai-danger-text);cursor:pointer;transition:box-shadow 0.15s ease, opacity 0.15s ease;font-family:inherit}.retry-btn:hover{box-shadow:var(--ai-shadow-active);opacity:0.9}.retry-btn:active{opacity:0.75}`;
|
|
7
7
|
|
|
@@ -33,7 +33,7 @@ const AiAgentError = class {
|
|
|
33
33
|
return index.h("span", { class: "icon-wrap", innerHTML: svg });
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (index.h(index.Host, { key: '
|
|
36
|
+
return (index.h(index.Host, { key: '58e3dfec84f2fcea2f53657dc2b7d16344ada0c2' }, index.h("div", { key: 'c85a02edecb0919d664a01468b4318b3258e126c', class: "error-card" }, index.h("div", { key: '9336d8a342877b2cccc08f1e52aa981d5ecb7e4b', class: "error-body" }, index.h("div", { key: '0e472ff1f226635242feb969b6c897b5a8eb57b8', class: "error-icon-wrap" }, this.renderIcon('warning', 20, 20)), index.h("div", { key: 'bec21585c826378a01a30a1e2c347289fa968b6d', class: "error-content" }, index.h("div", { key: '04030863e65ad1551abd0941709cbc61ef36b4f4', class: "error-headline-row" }, index.h("span", { key: '6044558b93d6e9be50cbf3f251bf8cd615014a2b', class: "error-headline" }, this.headline), this.errorCode && (index.h("span", { key: '33c20307ceb7d55d6b0dd1a2b583456fdb50a947', class: "error-code-badge" }, this.errorCode))), this.message && (index.h("p", { key: '911f62b72bc8b61a2d6bd444d6e6304c6e4adaed', class: "error-message" }, this.message))), this.dismissible && (index.h("button", { key: '76fcb3b7e964f7f1fdebb422c9b056d1631df666', class: "dismiss-btn", "aria-label": "\u0625\u063A\u0644\u0627\u0642", onClick: () => this.dismissClick.emit() }, this.renderIcon('cancel', 16, 16)))), this.retryable && (index.h("div", { key: '670e28d12c27dcfc9ce9c017ae06278fb07906cd', class: "error-footer" }, index.h("button", { key: '2cf7655d43e1d68c6befde8a48b72b10c1077f68', class: "retry-btn", onClick: () => this.retryClick.emit() }, this.renderIcon('reload', 16, 16), index.h("span", { key: 'e28ca18eba500c9d50d7d690889777ad312b9e62' }, this.retryLabel)))))));
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
AiAgentError.style = aiAgentErrorCss();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BQ8Az7-D.js');
|
|
4
4
|
|
|
5
5
|
const aiCardCss = () => `:host{--ai-card-border:1px solid var(--ai-border-default);--ai-card-radius:16px;--ai-card-padding:16px;--ai-card-gap:12px;--ai-card-shadow:var(--ai-shadow-sm);display:block}.card{background:var(--ai-bg-card);border:var(--ai-card-border);border-radius:var(--ai-card-radius);padding:var(--ai-card-padding);box-shadow:var(--ai-card-shadow);box-sizing:border-box;overflow:hidden;color:var(--ai-text-primary);width:100%;display:flex;flex-direction:column;gap:var(--ai-card-gap);text-align:start;font-size:14px;line-height:20px}.card--no-padding{padding:0}.card--no-shadow{box-shadow:none}`;
|
|
6
6
|
|
|
@@ -13,11 +13,11 @@ const AiCard = class {
|
|
|
13
13
|
/** Remove the shadow */
|
|
14
14
|
noShadow = false;
|
|
15
15
|
render() {
|
|
16
|
-
return (index.h(index.Host, { key: '
|
|
16
|
+
return (index.h(index.Host, { key: '1bdd14661b995f51378e67676a44c92730626ffe' }, index.h("div", { key: 'fa15c03048be26793d36bfb8c6a7325b21b04d5c', class: {
|
|
17
17
|
card: true,
|
|
18
18
|
'card--no-padding': this.noPadding,
|
|
19
19
|
'card--no-shadow': this.noShadow,
|
|
20
|
-
} }, index.h("slot", { key: '
|
|
20
|
+
} }, index.h("slot", { key: 'a1d77664d0754f5d71c75ebc658a74c581111091' }))));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
AiCard.style = aiCardCss();
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BQ8Az7-D.js');
|
|
4
4
|
|
|
5
|
-
const aiChatContainerCss = () => `:host{display:contents}.chat-container{font-family:var(--ai-font-family);display:flex;flex-direction:column;overflow:hidden;position:relative;background-color:var(--ai-container-bg, var(--ai-bg-card));border:1px solid var(--ai-border-default);z-index:50;box-sizing:border-box}.messages-area{flex:1;overflow-y:auto;min-height:0;scrollbar-width:thin;padding:var(--ai-spacing-2xl, 16px);scrollbar-color:var(--ai-scrollbar-thumb) transparent}.messages-area::-webkit-scrollbar{width:3px}.messages-area::-webkit-scrollbar-track{background:transparent}.messages-area::-webkit-scrollbar-thumb{background:var(--ai-scrollbar-thumb);border-radius:99px}.messages-area::-webkit-scrollbar-thumb:hover{background:var(--ai-scrollbar-thumb-hover)}.chat-container.left,.chat-container.right{position:fixed;top:0;bottom:0;transition:transform 300ms cubic-bezier(0.4, 0, 0.2, 1)}.chat-container.left{left:0;transform:translateX(-100%)}.chat-container.right{right:0;transform:translateX(100%)}.chat-container.left.open,.chat-container.right.open{transform:translateX(0)}.chat-container.float{position:fixed;border-radius:16px;box-shadow:var(--ai-shadow-float);opacity:0;pointer-events:none;transform:scale(0.95);transform-origin:bottom left;transition:opacity 200ms ease, transform 200ms ease}.chat-container.float.open{opacity:1;pointer-events:auto;transform:scale(1)}.watermark{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}.watermark ai-
|
|
5
|
+
const aiChatContainerCss = () => `:host{display:contents}.chat-container{font-family:var(--ai-font-family);display:flex;flex-direction:column;overflow:hidden;position:relative;background-color:var(--ai-container-bg, var(--ai-bg-card));border:1px solid var(--ai-border-default);z-index:50;box-sizing:border-box}.messages-area{flex:1;overflow-y:auto;min-height:0;scrollbar-width:thin;padding:var(--ai-spacing-2xl, 16px);scrollbar-color:var(--ai-scrollbar-thumb) transparent}.messages-area::-webkit-scrollbar{width:3px}.messages-area::-webkit-scrollbar-track{background:transparent}.messages-area::-webkit-scrollbar-thumb{background:var(--ai-scrollbar-thumb);border-radius:99px}.messages-area::-webkit-scrollbar-thumb:hover{background:var(--ai-scrollbar-thumb-hover)}.chat-container.left,.chat-container.right{position:fixed;top:0;bottom:0;transition:transform 300ms cubic-bezier(0.4, 0, 0.2, 1)}.chat-container.left{left:0;transform:translateX(-100%)}.chat-container.right{right:0;transform:translateX(100%)}.chat-container.left.open,.chat-container.right.open{transform:translateX(0)}.chat-container.float{position:fixed;border-radius:16px;box-shadow:var(--ai-shadow-float);opacity:0;pointer-events:none;transform:scale(0.95);transform-origin:bottom left;transition:opacity 200ms ease, transform 200ms ease}.chat-container.float.open{opacity:1;pointer-events:auto;transform:scale(1)}.watermark{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none;width:133px;height:133px}.watermark .watermark-circle-svg{position:absolute;top:0;left:0}.watermark .watermark-star-svg{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.watermark .watermark-circle{fill:var(--ai-watermark-circle, #FCFCFC)}.watermark .watermark-star{fill:var(--ai-watermark-star, #FAFAFA)}:host(.dark) .watermark .watermark-circle{fill:var(--ai-watermark-circle, #222222)}:host(.dark) .watermark .watermark-star{fill:var(--ai-watermark-star, #292B2C)}.chat-container.mobile{width:100% !important}.chat-container.float.mobile{left:0 !important;right:0 !important;top:0 !important;bottom:0 !important;height:100% !important;border-radius:0 !important}@media (max-width: 767px){.chat-container{width:100% !important}.chat-container.float{left:0 !important;right:0 !important;top:0 !important;bottom:0 !important;height:100% !important;border-radius:0 !important}}@keyframes skeleton-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}.skeleton-messages{display:flex;flex-direction:column;gap:20px;padding:8px 0}.skeleton-row{display:flex;align-items:flex-start;gap:10px}.skeleton-row.agent{flex-direction:row}.skeleton-row.user{flex-direction:row-reverse}.skeleton-avatar{width:32px;height:32px;min-width:32px;border-radius:50%;background:var(--ai-shimmer-gradient, linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.06) 75%));background-size:200% 100%;animation:skeleton-shimmer 1.6s ease-in-out infinite}.skeleton-bubble{display:flex;flex-direction:column;gap:8px;padding:14px 16px;border-radius:16px;background-color:var(--ai-bg-surface, #f9fafb);max-width:75%;min-width:120px}.skeleton-row.user .skeleton-bubble{background-color:var(--ai-user-bubble-bg, var(--ai-accent, #004956));border-radius:16px}.skeleton-line{height:12px;border-radius:6px;background:var(--ai-shimmer-gradient, linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.06) 75%));background-size:200% 100%;animation:skeleton-shimmer 1.6s ease-in-out infinite}.skeleton-row.user .skeleton-line{background:linear-gradient(90deg, rgba(255,255,255,0.08) 25%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.08) 75%);background-size:200% 100%;animation:skeleton-shimmer 1.6s ease-in-out infinite}:host(.dark) .skeleton-avatar{background:var(--ai-shimmer-gradient, linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%));background-size:200% 100%;animation:skeleton-shimmer 1.6s ease-in-out infinite}:host(.dark) .skeleton-bubble{background-color:var(--ai-bg-surface, #1f2937)}:host(.dark) .skeleton-line{background:var(--ai-shimmer-gradient, linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%));background-size:200% 100%;animation:skeleton-shimmer 1.6s ease-in-out infinite}.error-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:48px 24px;flex:1}.error-icon{color:var(--ai-text-muted, #9ca3af);opacity:0.7}.error-text{margin:0;font-size:14px;line-height:1.5;color:var(--ai-text-secondary, #6b7280)}.error-retry-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 20px;border-radius:9999px;border:1px solid var(--ai-border-default);background-color:var(--ai-bg-surface, #f9fafb);color:var(--ai-text-primary);font-size:13px;font-weight:500;font-family:inherit;cursor:pointer;transition:background-color 0.15s ease, border-color 0.15s ease}.error-retry-btn:hover{background-color:var(--ai-hover-overlay, rgba(0, 0, 0, 0.04));border-color:var(--ai-accent, #004956)}.error-retry-btn:focus-visible{outline:2px solid var(--ai-focus-ring-color, var(--ai-focus-ring));outline-offset:2px}:host(.dark) .error-retry-btn{background-color:var(--ai-bg-surface, #1f2937);color:var(--ai-text-primary, #f9fafb)}:host(.dark) .error-retry-btn:hover{background-color:var(--ai-hover-overlay, rgba(255, 255, 255, 0.06))}`;
|
|
6
6
|
|
|
7
7
|
const ChatContainer = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.retryClick = index.createEvent(this, "retryClick");
|
|
11
|
+
}
|
|
8
12
|
get el() { return index.getElement(this); }
|
|
9
13
|
/** Controls visibility of the chat panel */
|
|
10
14
|
isOpen = false;
|
|
@@ -20,14 +24,28 @@ const ChatContainer = class {
|
|
|
20
24
|
floatHeight = '600px';
|
|
21
25
|
/** Color theme for the panel */
|
|
22
26
|
theme = 'light';
|
|
27
|
+
/** Show skeleton loading state (e.g. while loading conversation history) */
|
|
28
|
+
loading = false;
|
|
29
|
+
/** Show error state (e.g. failed to load conversation) */
|
|
30
|
+
error = false;
|
|
31
|
+
/** Error message text */
|
|
32
|
+
errorText = 'تعذّر تحميل المحادثة';
|
|
33
|
+
/** Retry button label */
|
|
34
|
+
retryLabel = 'إعادة المحاولة';
|
|
35
|
+
/** Event emitted when the retry button is clicked */
|
|
36
|
+
retryClick;
|
|
23
37
|
isMobile = false;
|
|
24
38
|
floatLeft = '24px';
|
|
25
39
|
floatTop = '24px';
|
|
26
40
|
containerRef;
|
|
27
41
|
messagesAreaRef;
|
|
28
42
|
dragState = null;
|
|
43
|
+
mutationObserver = null;
|
|
44
|
+
resizeObserver = null;
|
|
29
45
|
// Named arrow so we can reliably add/remove it without leaking
|
|
30
46
|
dragListener = (e) => {
|
|
47
|
+
if (typeof window === 'undefined')
|
|
48
|
+
return;
|
|
31
49
|
const container = this.containerRef;
|
|
32
50
|
if (!container)
|
|
33
51
|
return;
|
|
@@ -66,21 +84,34 @@ const ChatContainer = class {
|
|
|
66
84
|
document.addEventListener('pointermove', onMove);
|
|
67
85
|
document.addEventListener('pointerup', onUp);
|
|
68
86
|
};
|
|
69
|
-
constructor(hostRef) {
|
|
70
|
-
index.registerInstance(this, hostRef);
|
|
71
|
-
// Bind so window.removeEventListener can match the reference
|
|
72
|
-
this.checkMobile = this.checkMobile.bind(this);
|
|
73
|
-
}
|
|
74
87
|
componentWillLoad() {
|
|
75
88
|
this.checkMobile();
|
|
76
89
|
}
|
|
77
90
|
componentDidLoad() {
|
|
78
|
-
if (typeof window
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
91
|
+
if (typeof window === 'undefined')
|
|
92
|
+
return;
|
|
93
|
+
// Use ResizeObserver for responsive mobile detection instead of window.resize
|
|
94
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
95
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
96
|
+
this.checkMobile();
|
|
97
|
+
this.clampFloatPosition();
|
|
98
|
+
});
|
|
99
|
+
this.resizeObserver.observe(this.el);
|
|
83
100
|
}
|
|
101
|
+
// Also listen to window resize for viewport changes (e.g. browser resize)
|
|
102
|
+
window.addEventListener('resize', this.handleWindowResize);
|
|
103
|
+
if (this.position === 'float') {
|
|
104
|
+
this.setupDrag();
|
|
105
|
+
}
|
|
106
|
+
this.mutationObserver = new MutationObserver(() => {
|
|
107
|
+
if (this.autoScroll && this.messagesAreaRef) {
|
|
108
|
+
requestAnimationFrame(() => {
|
|
109
|
+
this.messagesAreaRef.scrollTop = this.messagesAreaRef.scrollHeight;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
// Observe light DOM (this.el) — slotted content lives here, not inside shadow messagesAreaRef
|
|
114
|
+
this.mutationObserver.observe(this.el, { childList: true, subtree: true });
|
|
84
115
|
}
|
|
85
116
|
isOpenChanged(newVal) {
|
|
86
117
|
if (newVal && this.autoScroll && this.messagesAreaRef) {
|
|
@@ -95,8 +126,12 @@ const ChatContainer = class {
|
|
|
95
126
|
}
|
|
96
127
|
}
|
|
97
128
|
disconnectedCallback() {
|
|
98
|
-
window
|
|
129
|
+
if (typeof window !== 'undefined') {
|
|
130
|
+
window.removeEventListener('resize', this.handleWindowResize);
|
|
131
|
+
}
|
|
99
132
|
this.el.removeEventListener('headerDragStart', this.dragListener);
|
|
133
|
+
this.mutationObserver?.disconnect();
|
|
134
|
+
this.resizeObserver?.disconnect();
|
|
100
135
|
}
|
|
101
136
|
/** Programmatically scroll the messages area to the bottom */
|
|
102
137
|
async scrollToBottom() {
|
|
@@ -104,11 +139,30 @@ const ChatContainer = class {
|
|
|
104
139
|
this.messagesAreaRef.scrollTop = this.messagesAreaRef.scrollHeight;
|
|
105
140
|
}
|
|
106
141
|
}
|
|
142
|
+
handleWindowResize = () => {
|
|
143
|
+
this.checkMobile();
|
|
144
|
+
this.clampFloatPosition();
|
|
145
|
+
};
|
|
107
146
|
checkMobile() {
|
|
108
147
|
if (typeof window !== 'undefined') {
|
|
109
148
|
this.isMobile = window.innerWidth < 768;
|
|
110
149
|
}
|
|
111
150
|
}
|
|
151
|
+
/** Re-clamp float position so the panel never ends up off-screen after resize */
|
|
152
|
+
clampFloatPosition() {
|
|
153
|
+
if (typeof window === 'undefined' || this.position !== 'float' || !this.containerRef)
|
|
154
|
+
return;
|
|
155
|
+
const vw = window.innerWidth;
|
|
156
|
+
const vh = window.innerHeight;
|
|
157
|
+
const w = this.containerRef.offsetWidth;
|
|
158
|
+
const h = this.containerRef.offsetHeight;
|
|
159
|
+
let left = parseFloat(this.floatLeft) || 0;
|
|
160
|
+
let top = parseFloat(this.floatTop) || 0;
|
|
161
|
+
left = Math.max(0, Math.min(left, vw - w));
|
|
162
|
+
top = Math.max(0, Math.min(top, vh - h));
|
|
163
|
+
this.floatLeft = `${left}px`;
|
|
164
|
+
this.floatTop = `${top}px`;
|
|
165
|
+
}
|
|
112
166
|
setupDrag() {
|
|
113
167
|
// Remove any existing listener before adding to prevent accumulation
|
|
114
168
|
this.el.removeEventListener('headerDragStart', this.dragListener);
|
|
@@ -148,8 +202,14 @@ const ChatContainer = class {
|
|
|
148
202
|
}
|
|
149
203
|
return false;
|
|
150
204
|
}
|
|
205
|
+
renderSkeleton() {
|
|
206
|
+
return (index.h("div", { class: "skeleton-messages", "aria-busy": "true", "aria-label": "Loading conversation" }, index.h("div", { class: "skeleton-row agent" }, index.h("div", { class: "skeleton-bubble" }, index.h("div", { class: "skeleton-line", style: { width: '80%' } }), index.h("div", { class: "skeleton-line", style: { width: '60%' } }), index.h("div", { class: "skeleton-line", style: { width: '40%' } }))), index.h("div", { class: "skeleton-row user" }, index.h("div", { class: "skeleton-bubble" }, index.h("div", { class: "skeleton-line", style: { width: '70%' } }))), index.h("div", { class: "skeleton-row agent" }, index.h("div", { class: "skeleton-bubble" }, index.h("div", { class: "skeleton-line", style: { width: '90%' } }), index.h("div", { class: "skeleton-line", style: { width: '55%' } }))), index.h("div", { class: "skeleton-row user" }, index.h("div", { class: "skeleton-bubble" }, index.h("div", { class: "skeleton-line", style: { width: '50%' } }), index.h("div", { class: "skeleton-line", style: { width: '35%' } })))));
|
|
207
|
+
}
|
|
208
|
+
renderError() {
|
|
209
|
+
return (index.h("div", { class: "error-state", role: "alert" }, index.h("svg", { class: "error-icon", width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "1.5" }), index.h("path", { d: "M12 7v6", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round" }), index.h("circle", { cx: "12", cy: "16.5", r: "0.75", fill: "currentColor" })), index.h("p", { class: "error-text" }, this.errorText), index.h("button", { class: "error-retry-btn", type: "button", onClick: () => this.retryClick.emit() }, this.retryLabel)));
|
|
210
|
+
}
|
|
151
211
|
render() {
|
|
152
|
-
return (index.h(index.Host, { key: '
|
|
212
|
+
return (index.h(index.Host, { key: '146842c18b30c96eff709262d14f0026b3c0b5f2', class: { dark: this.isDark() } }, index.h("div", { key: '6d138b05c08cf3c01645d2832b9df847ae8fb34e', class: this.getContainerClasses(), style: this.getContainerStyle(), ref: el => (this.containerRef = el) }, this.showWatermark && !this.loading && !this.error && (index.h("div", { key: 'ef54afa1cec6e7589aa559938792429eb0fe76b6', class: "watermark" }, index.h("svg", { key: 'eb5dc8d17a48b73ed28c23d50a77939995efe818', class: "watermark-circle-svg", width: "133", height: "133", viewBox: "0 0 133 133", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("g", { key: 'c2f60242842b2788cfc577a96da595a6588d5dac', filter: "url(#wm_circle_shadow)" }, index.h("circle", { key: '9681bf0e38334eea7978e16854f7572bfc702a7d', cx: "66.415", cy: "66.415", r: "66.415", class: "watermark-circle" })), index.h("defs", { key: 'dfb531e4137c54ae2cb3cd67fc4f48cff578bbd6' }, index.h("filter", { key: '61c6a2e8a4ad2726280fdecea7f416f160e1388c', id: "wm_circle_shadow", x: "0", y: "0", width: "132.83", height: "135.83", filterUnits: "userSpaceOnUse", "color-interpolation-filters": "sRGB" }, index.h("feFlood", { key: 'e001abcfa7ea700a4c9df12f7edb2d77f41a681a', "flood-opacity": "0", result: "BackgroundImageFix" }), index.h("feBlend", { key: 'ab42b31ddffdafbcd0d8b3a1ac3638cad08422de', mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }), index.h("feColorMatrix", { key: 'dbe6cee1b694612115237fe7ba631962b299c17e', in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }), index.h("feOffset", { key: '6e4df9fac567a782676e6ee11124405856e2d216', dy: "3" }), index.h("feGaussianBlur", { key: 'cf3eccf07988f8d35fc22db8dc8acd7efafb9f28', stdDeviation: "3" }), index.h("feComposite", { key: '8ede441bedbc49e505402977ab4787b7f80b8c17', in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }), index.h("feColorMatrix", { key: '4d6286fd6303c018d7c9e37258bc3fe746d716c0', type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0" }), index.h("feBlend", { key: '137f322f9922e682873b3f7c3f44b714793d80bc', mode: "normal", in2: "shape", result: "effect1_innerShadow" })))), index.h("svg", { key: '5ed41b236f120a820e138829fdd86d6d7517953b', class: "watermark-star-svg", width: "78", height: "78", viewBox: "0 0 78 78", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("g", { key: 'bd4a4b26cf740bccb6dfa44c185e1c6ce9281407', filter: "url(#wm_star_shadow)" }, index.h("path", { key: '7b0769a6ef62e35206e0057da58ae0b2187a5aad', d: "M38.7421 0C39.5691 0 40.2689 0.286272 40.8414 0.858815C41.414 1.43136 41.7002 2.13113 41.7002 2.95814C41.7002 8.87442 43.1952 14.3772 46.1851 19.4665C49.1115 24.4285 53.0557 28.3727 58.0177 31.299C63.107 34.289 68.6097 35.7839 74.526 35.7839C75.353 35.7839 76.0528 36.0702 76.6254 36.6428C77.1979 37.2153 77.4842 37.9151 77.4842 38.7421C77.4842 39.5691 77.1979 40.2689 76.6254 40.8414C76.0528 41.414 75.353 41.7002 74.526 41.7002C68.6097 41.7002 63.107 43.1952 58.0177 46.1851C53.0557 49.1115 49.1115 53.0557 46.1851 58.0177C43.1952 63.107 41.7002 68.6097 41.7002 74.526C41.7002 75.353 41.414 76.0528 40.8414 76.6254C40.2689 77.1979 39.5691 77.4842 38.7421 77.4842C37.9151 77.4842 37.2153 77.1979 36.6428 76.6254C36.0702 76.0528 35.7839 75.353 35.7839 74.526C35.7839 68.6097 34.289 63.107 31.299 58.0177C28.3727 53.0557 24.4285 49.1115 19.4665 46.1851C14.3772 43.1952 8.87442 41.7002 2.95814 41.7002C2.13113 41.7002 1.43136 41.414 0.858815 40.8414C0.286272 40.2689 0 39.5691 0 38.7421C0 37.9151 0.286272 37.2153 0.858815 36.6428C1.43136 36.0702 2.13113 35.7839 2.95814 35.7839C8.87442 35.7839 14.3772 34.289 19.4665 31.299C24.4285 28.3727 28.3727 24.4285 31.299 19.4665C34.289 14.3772 35.7839 8.87442 35.7839 2.95814C35.7839 2.13113 36.0702 1.43136 36.6428 0.858815C37.2153 0.286272 37.9151 0 38.7421 0Z", class: "watermark-star" })), index.h("defs", { key: 'a004811963ac78b6c13df187333f3ba525c18f55' }, index.h("filter", { key: '734877af85b6554e27f24720e06bcd59b707362b', id: "wm_star_shadow", x: "0", y: "0", width: "77.4844", height: "79.4841", filterUnits: "userSpaceOnUse", "color-interpolation-filters": "sRGB" }, index.h("feFlood", { key: 'bfa384407eb019aa79be662411bea47097744323', "flood-opacity": "0", result: "BackgroundImageFix" }), index.h("feBlend", { key: '7cd90c875f8bce1780a4eaa899bc222b8cd5991e', mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }), index.h("feColorMatrix", { key: '3edcb0bb26efba7f93e6ea125cc1b21f885cc75e', in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }), index.h("feOffset", { key: '2e18721ab747cedc0a6ae4d422a6b2991e37ed80', dy: "2" }), index.h("feGaussianBlur", { key: '0772cc52ba154b42d7f780d5e9bf16bd2293dee9', stdDeviation: "2" }), index.h("feComposite", { key: '739a5b26667c1745e8d42c33aadedf56b3530a52', in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }), index.h("feColorMatrix", { key: '23ca07f2d016d14aa95a64b581f8804cc43469fb', type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0" }), index.h("feBlend", { key: '66e8b6a28ba77465df00123176f40e9b53a171c0', mode: "normal", in2: "shape", result: "effect1_innerShadow" })))))), index.h("slot", { key: 'd24884b15dfa86c3ccc353587f8bf5b1b0e00bc6', name: "header" }), index.h("div", { key: '4bafceed191d908bebf24a838e5277707831042a', class: "messages-area", ref: el => (this.messagesAreaRef = el) }, this.loading ? this.renderSkeleton() : this.error ? this.renderError() : index.h("slot", null)), index.h("slot", { key: 'ea962c2d9a6cb59c50b785c42e5b9d2103ac8848', name: "footer" }))));
|
|
153
213
|
}
|
|
154
214
|
static get watchers() { return {
|
|
155
215
|
"isOpen": [{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var iconRegistry = require('./icon-registry-
|
|
3
|
+
var index = require('./index-BQ8Az7-D.js');
|
|
4
|
+
var iconRegistry = require('./icon-registry-D-m8GW4D.js');
|
|
5
5
|
|
|
6
|
-
const aiChatHeaderCss = () => `:host{display:block}.header-container{display:flex;align-items:center;gap:8px;padding:16px;background:var(--ai-bg-card);border-bottom:1px solid var(--ai-border-light);width:100%;box-sizing:border-box}.drag-btn{cursor:grab;color:var(--ai-text-muted)}.drag-btn:active{cursor:grabbing}.action-btn,.back-btn{width:40px;height:40px;padding:4px;display:flex;align-items:center;justify-content:center;background:var(--ai-bg-card);border:none;border-radius:8px;cursor:pointer;flex-shrink:0;color:var(--ai-text-primary);transition:background 0.15s ease}.action-btn:hover,.back-btn:hover{background:var(--ai-bg-surface)}.action-btn:focus-visible,.back-btn:focus-visible{outline:2px solid var(--ai-focus-ring);outline-offset:2px}.action-btn:active,.back-btn:active{background:var(--ai-bg-surface)}.actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.content{flex:1 0 0;display:flex;align-items:center;justify-content:flex-start;min-width:0}.content.agent{gap:4px;height:40px}.content.human{gap:8px}.dropdown-trigger{display:flex;align-items:center;gap:4px;background:none;border:none;cursor:pointer;padding:0;flex-shrink:0;color:var(--ai-text-primary)}.dropdown-trigger:focus-visible{outline:2px solid var(--ai-focus-ring);outline-offset:2px}.title{font-size:16px;font-weight:700;color:var(--ai-text-primary);white-space:nowrap;line-height:normal;min-width:0;overflow:hidden;text-overflow:ellipsis}.avatar-wrapper{position:relative;width:40px;height:40px;flex-shrink:0}.avatar{width:40px;height:40px;border-radius:9999px;border:1px solid var(--ai-border-default);object-fit:cover;display:block}.avatar-fallback{width:40px;height:40px;border-radius:9999px;border:1px solid var(--ai-border-default);background:var(--ai-bg-surface);color:var(--ai-text-primary);font-size:16px;font-weight:600;display:flex;align-items:center;justify-content:center;flex-shrink:0}.online-dot{position:absolute;bottom:0;inset-inline-end:0;width:10px;height:10px;display:inline-flex;align-items:center;justify-content:center;color:var(--ai-bg-card);}.online-dot.status-online{color:#22c55e;}.online-dot.status-offline{color:#9ca3af;}.online-dot.status-busy{color:#ef4444;}.online-dot.status-away{color:#f59e0b;}.text-block{display:flex;flex-direction:column;align-items:flex-start;gap:0;flex-shrink:0}.agent-name{font-size:14px;font-weight:500;color:var(--ai-text-primary);line-height:20px;white-space:nowrap}.agent-status{font-size:14px;font-weight:400;color:var(--ai-text-secondary);line-height:20px;white-space:nowrap}.icon-wrap{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.icon-wrap svg{display:block}:host-context([dir='ltr']) .back-btn .icon-wrap,:host([dir='ltr']) .back-btn .icon-wrap{transform:scaleX(-1)}`;
|
|
6
|
+
const aiChatHeaderCss = () => `:host{display:block;position:relative;z-index:10}.header-wrapper{position:relative;display:flex;flex-direction:column}.header-container{display:flex;align-items:center;gap:8px;padding:16px;background:var(--ai-bg-card);border-bottom:1px solid var(--ai-border-light);width:100%;box-sizing:border-box}.drag-btn{cursor:grab;color:var(--ai-text-muted)}.drag-btn:active{cursor:grabbing}.action-btn,.back-btn{width:40px;height:40px;padding:4px;display:flex;align-items:center;justify-content:center;background:var(--ai-bg-card);border:none;border-radius:8px;cursor:pointer;flex-shrink:0;color:var(--ai-text-primary);transition:background 0.15s ease}.action-btn:hover,.back-btn:hover{background:var(--ai-bg-surface)}.action-btn:focus-visible,.back-btn:focus-visible{outline:2px solid var(--ai-focus-ring);outline-offset:2px}.action-btn:active,.back-btn:active{background:var(--ai-bg-surface)}.actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.content{flex:1 0 0;display:flex;align-items:center;justify-content:flex-start;min-width:0}.content.agent{gap:4px;height:40px}.content.human{gap:8px}.content.browser{gap:8px}.dropdown-trigger{display:flex;align-items:center;gap:4px;background:none;border:none;cursor:pointer;padding:0;flex-shrink:0;color:var(--ai-text-primary)}.dropdown-chevron{display:inline-flex;transition:transform 0.2s ease}.dropdown-chevron.open{transform:rotate(180deg)}.dropdown-trigger:focus-visible{outline:2px solid var(--ai-focus-ring);outline-offset:2px}.title{font-size:16px;font-weight:700;color:var(--ai-text-primary);white-space:nowrap;line-height:normal;min-width:0;overflow:hidden;text-overflow:ellipsis}@keyframes title-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}.title-skeleton{display:inline-block;width:120px;height:16px;border-radius:8px;background:var(--ai-shimmer-gradient, linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.06) 75%));background-size:200% 100%;animation:title-shimmer 1.6s ease-in-out infinite}.browser-title{font-size:14px;font-weight:600;color:var(--ai-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;line-height:20px}.browser-link-btn{width:28px;height:28px;padding:0;display:inline-flex;align-items:center;justify-content:center;background:none;border:none;border-radius:8px;cursor:pointer;flex-shrink:0;color:var(--ai-text-secondary)}.browser-link-btn:focus-visible{outline:2px solid var(--ai-focus-ring);outline-offset:2px}.avatar-wrapper{position:relative;width:40px;height:40px;flex-shrink:0}.avatar{width:40px;height:40px;border-radius:9999px;border:1px solid var(--ai-border-default);object-fit:cover;display:block}.avatar-fallback{width:40px;height:40px;border-radius:9999px;border:1px solid var(--ai-border-default);background:var(--ai-bg-surface);color:var(--ai-text-primary);font-size:16px;font-weight:600;display:flex;align-items:center;justify-content:center;flex-shrink:0}.online-dot{position:absolute;bottom:0;inset-inline-end:0;width:10px;height:10px;display:inline-flex;align-items:center;justify-content:center;color:var(--ai-bg-card);}.online-dot.status-online{color:#22c55e;}.online-dot.status-offline{color:#9ca3af;}.online-dot.status-busy{color:#ef4444;}.online-dot.status-away{color:#f59e0b;}.text-block{display:flex;flex-direction:column;align-items:flex-start;gap:0;flex-shrink:0}.agent-name{font-size:14px;font-weight:500;color:var(--ai-text-primary);line-height:20px;white-space:nowrap}.agent-status{font-size:14px;font-weight:400;color:var(--ai-text-secondary);line-height:20px;white-space:nowrap}.icon-wrap{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.icon-wrap svg{display:block}:host-context([dir='ltr']) .back-btn .icon-wrap,:host([dir='ltr']) .back-btn .icon-wrap{transform:scaleX(-1)}.conversation-dropdown{position:absolute;top:100%;left:0;right:0;z-index:20;height:360px;display:flex;flex-direction:column;background:var(--ai-bg-surface);border-bottom:1px solid var(--ai-border-light);box-shadow:var(--ai-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));animation:slideDown 0.2s ease;overflow:hidden}.conversation-dropdown ai-conversation-list{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}@keyframes slideDown{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}`;
|
|
7
7
|
|
|
8
8
|
const AiChatHeader = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -14,7 +14,11 @@ const AiChatHeader = class {
|
|
|
14
14
|
this.positionClick = index.createEvent(this, "positionClick");
|
|
15
15
|
this.backClick = index.createEvent(this, "backClick");
|
|
16
16
|
this.headerDragStart = index.createEvent(this, "headerDragStart");
|
|
17
|
+
this.openExternal = index.createEvent(this, "openExternal");
|
|
18
|
+
this.conversationSelect = index.createEvent(this, "conversationSelect");
|
|
19
|
+
this.conversationDelete = index.createEvent(this, "conversationDelete");
|
|
17
20
|
}
|
|
21
|
+
get el() { return index.getElement(this); }
|
|
18
22
|
/** Layout variant */
|
|
19
23
|
mode = 'agent';
|
|
20
24
|
/** Agent mode: conversation title */
|
|
@@ -30,7 +34,20 @@ const AiChatHeader = class {
|
|
|
30
34
|
isDraggable = false;
|
|
31
35
|
/** Human mode: status indicator variant */
|
|
32
36
|
statusIndicator = 'online';
|
|
37
|
+
/** Browser mode: page title shown in the header */
|
|
38
|
+
pageTitle = '';
|
|
39
|
+
/** Browser mode: the external URL to link to */
|
|
40
|
+
pageUrl = '';
|
|
41
|
+
/** Conversation list: items to display in the dropdown panel */
|
|
42
|
+
conversationItems = [];
|
|
43
|
+
/** Conversation list: ID of the currently active conversation */
|
|
44
|
+
conversationActiveId = '';
|
|
45
|
+
/** Conversation list: show skeleton loading state */
|
|
46
|
+
conversationLoading = false;
|
|
47
|
+
/** Show a shimmer skeleton in place of the conversation title (e.g. while loading conversation) */
|
|
48
|
+
titleLoading = false;
|
|
33
49
|
avatarError = false;
|
|
50
|
+
dropdownOpen = false;
|
|
34
51
|
/** Cancel / close button */
|
|
35
52
|
closeClick;
|
|
36
53
|
/** Pencil-edit button (agent mode) */
|
|
@@ -46,6 +63,17 @@ const AiChatHeader = class {
|
|
|
46
63
|
* Composed + bubbling so ai-chat-container can receive it across shadow roots.
|
|
47
64
|
*/
|
|
48
65
|
headerDragStart;
|
|
66
|
+
/** Open-external button (browser mode) */
|
|
67
|
+
openExternal;
|
|
68
|
+
/** Fired when a conversation is selected from the dropdown list */
|
|
69
|
+
conversationSelect;
|
|
70
|
+
/** Fired when a conversation delete button is clicked */
|
|
71
|
+
conversationDelete;
|
|
72
|
+
handleDocumentClick(event) {
|
|
73
|
+
if (this.dropdownOpen && !this.el.contains(event.target)) {
|
|
74
|
+
this.dropdownOpen = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
49
77
|
renderIcon(name, width, height) {
|
|
50
78
|
const icon = iconRegistry.iconRegistry[name];
|
|
51
79
|
if (!icon)
|
|
@@ -58,18 +86,39 @@ const AiChatHeader = class {
|
|
|
58
86
|
if (!this.agentAvatar || this.avatarError) {
|
|
59
87
|
return index.h("div", { class: "avatar-fallback" }, fallbackLetter);
|
|
60
88
|
}
|
|
61
|
-
return (index.h("img", { class: "avatar", src: this.agentAvatar, alt: this.agentName, onError: () => {
|
|
89
|
+
return (index.h("img", { class: "avatar", src: this.agentAvatar, alt: this.agentName, onError: () => {
|
|
90
|
+
this.avatarError = true;
|
|
91
|
+
} }));
|
|
62
92
|
}
|
|
63
93
|
renderDragBtn() {
|
|
64
|
-
return this.isDraggable && (index.h("button", { class: "action-btn drag-btn", "aria-label": "\u0633\u062D\u0628 / Drag", onPointerDown: (e) => {
|
|
94
|
+
return (this.isDraggable && (index.h("button", { class: "action-btn drag-btn", "aria-label": "\u0633\u062D\u0628 / Drag", onPointerDown: (e) => {
|
|
65
95
|
e.preventDefault();
|
|
66
96
|
this.headerDragStart.emit({ clientX: e.clientX, clientY: e.clientY });
|
|
67
|
-
} }, this.renderIcon('drag', 11, 15)));
|
|
97
|
+
} }, this.renderIcon('drag', 11, 15))));
|
|
98
|
+
}
|
|
99
|
+
handleConversationSelect = (e) => {
|
|
100
|
+
e.stopPropagation();
|
|
101
|
+
this.conversationSelect.emit(e.detail);
|
|
102
|
+
this.dropdownOpen = false;
|
|
103
|
+
};
|
|
104
|
+
handleConversationDelete = (e) => {
|
|
105
|
+
e.stopPropagation();
|
|
106
|
+
this.conversationDelete.emit(e.detail);
|
|
107
|
+
};
|
|
108
|
+
renderConversationDropdown() {
|
|
109
|
+
if (!this.dropdownOpen || this.mode !== 'agent')
|
|
110
|
+
return null;
|
|
111
|
+
return (index.h("div", { class: "conversation-dropdown" }, index.h("ai-conversation-list", { items: this.conversationItems, activeId: this.conversationActiveId, loading: this.conversationLoading, onConversationSelect: this.handleConversationSelect, onConversationDelete: this.handleConversationDelete })));
|
|
68
112
|
}
|
|
69
113
|
renderAgentMode() {
|
|
70
114
|
return [
|
|
71
115
|
this.renderDragBtn(),
|
|
72
|
-
index.h("div", { class: "content agent dropdown-trigger", role: "button", onClick: () =>
|
|
116
|
+
index.h("div", { class: "content agent dropdown-trigger", role: "button", onClick: () => {
|
|
117
|
+
if (this.titleLoading)
|
|
118
|
+
return;
|
|
119
|
+
this.dropdownOpen = !this.dropdownOpen;
|
|
120
|
+
this.dropdownClick.emit();
|
|
121
|
+
}, "aria-haspopup": "listbox", "aria-expanded": this.dropdownOpen, "aria-label": `${this.conversation}, افتح قائمة المحادثات` }, this.titleLoading ? (index.h("span", { class: "title-skeleton", "aria-busy": "true", "aria-label": "\u062C\u0627\u0631\u064A \u0627\u0644\u062A\u062D\u0645\u064A\u0644" })) : (index.h("span", { class: "title" }, this.conversation)), !this.titleLoading && (index.h("span", { class: `dropdown-chevron${this.dropdownOpen ? ' open' : ''}` }, this.renderIcon('chevron-down', 24, 24)))),
|
|
73
122
|
index.h("div", { class: "actions" }, index.h("button", { class: "action-btn", "aria-label": "\u062A\u0639\u062F\u064A\u0644 / Edit", onClick: () => this.editClick.emit() }, this.renderIcon('pencil-edit', 22, 22)), index.h("button", { class: "action-btn", "aria-label": "\u0627\u0644\u0639\u0631\u0636 / Position", onClick: () => this.positionClick.emit() }, this.renderIcon('hand', 22, 22)), index.h("button", { class: "action-btn", "aria-label": "\u0625\u063A\u0644\u0627\u0642 / Close", onClick: () => this.closeClick.emit() }, this.renderIcon('cancel', 22, 22))),
|
|
74
123
|
];
|
|
75
124
|
}
|
|
@@ -80,8 +129,15 @@ const AiChatHeader = class {
|
|
|
80
129
|
index.h("div", { class: "actions" }, index.h("button", { class: "action-btn", "aria-label": "\u0627\u0644\u0639\u0631\u0636 / Position", onClick: () => this.positionClick.emit() }, this.renderIcon('hand', 22, 22)), index.h("button", { class: "action-btn", "aria-label": "\u0625\u063A\u0644\u0627\u0642 / Close", onClick: () => this.closeClick.emit() }, this.renderIcon('cancel', 22, 22))),
|
|
81
130
|
];
|
|
82
131
|
}
|
|
132
|
+
renderBrowserMode() {
|
|
133
|
+
return [
|
|
134
|
+
this.renderDragBtn(),
|
|
135
|
+
index.h("div", { class: "content browser" }, index.h("button", { class: "back-btn", "aria-label": "\u0631\u062C\u0648\u0639 / Back", onClick: () => this.backClick.emit() }, this.renderIcon('arrow-right', 24, 24)), index.h("span", { class: "browser-title" }, this.pageTitle), index.h("button", { class: "browser-link-btn", "aria-label": "\u0641\u062A\u062D \u0641\u064A \u0646\u0627\u0641\u0630\u0629 \u062C\u062F\u064A\u062F\u0629 / Open externally", onClick: () => this.openExternal.emit(this.pageUrl) }, this.renderIcon('link', 14, 14))),
|
|
136
|
+
index.h("div", { class: "actions" }, index.h("button", { class: "action-btn", "aria-label": "\u0627\u0644\u0639\u0631\u0636 / Position", onClick: () => this.positionClick.emit() }, this.renderIcon('hand', 22, 22)), index.h("button", { class: "action-btn", "aria-label": "\u0625\u063A\u0644\u0627\u0642 / Close", onClick: () => this.closeClick.emit() }, this.renderIcon('cancel', 22, 22))),
|
|
137
|
+
];
|
|
138
|
+
}
|
|
83
139
|
render() {
|
|
84
|
-
return (index.h(index.Host, { key: '
|
|
140
|
+
return (index.h(index.Host, { key: '8e1fe67030a0cb1eb94327f093327fb23d4faf01' }, index.h("div", { key: '14766bd663e5fe027f1a3320bd3f16d79e9feb45', class: "header-wrapper" }, index.h("div", { key: 'bef30f621ba3b148f4af055347eb707bc8f64b15', class: "header-container" }, this.mode === 'agent' ? this.renderAgentMode() : this.mode === 'human' ? this.renderHumanMode() : this.renderBrowserMode()), this.renderConversationDropdown())));
|
|
85
141
|
}
|
|
86
142
|
};
|
|
87
143
|
AiChatHeader.style = aiChatHeaderCss();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var iconRegistry = require('./icon-registry-
|
|
3
|
+
var index = require('./index-BQ8Az7-D.js');
|
|
4
|
+
var iconRegistry = require('./icon-registry-D-m8GW4D.js');
|
|
5
5
|
|
|
6
6
|
/*! @license DOMPurify 3.3.3 | (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.3/LICENSE */
|
|
7
7
|
|
|
@@ -1522,7 +1522,13 @@ const AiChatMessage = class {
|
|
|
1522
1522
|
getRenderedContent() {
|
|
1523
1523
|
if (!this.content)
|
|
1524
1524
|
return '';
|
|
1525
|
-
|
|
1525
|
+
try {
|
|
1526
|
+
return purify.sanitize(this.parseMarkdown(this.content), SANITIZE_CONFIG);
|
|
1527
|
+
}
|
|
1528
|
+
catch {
|
|
1529
|
+
// Fallback: render raw text safely if markdown parsing fails
|
|
1530
|
+
return purify.sanitize(`<p>${this.content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\n/g, '<br>')}</p>`, SANITIZE_CONFIG);
|
|
1531
|
+
}
|
|
1526
1532
|
}
|
|
1527
1533
|
getRelativeTime() {
|
|
1528
1534
|
if (!this.timestamp)
|
|
@@ -1591,7 +1597,7 @@ const AiChatMessage = class {
|
|
|
1591
1597
|
} })), index.h("slot", null), showActions && this.renderActionsBar()), (this.agentName || this.timestamp) && (index.h("div", { class: "agent-info" }, this.agentName && index.h("span", { class: "agent-info-name" }, this.agentName), this.agentName && this.timestamp && this.renderIcon('eclipse', 10), this.timestamp && index.h("span", { class: "agent-info-time" }, this.getRelativeTime()))))));
|
|
1592
1598
|
}
|
|
1593
1599
|
render() {
|
|
1594
|
-
return index.h(index.Host, { key: '
|
|
1600
|
+
return index.h(index.Host, { key: 'b6fe466c9830e69c3ae6f405daa9e77ef3f75aca' }, this.role === 'user' ? this.renderUserMessage() : this.renderAgentMessage());
|
|
1595
1601
|
}
|
|
1596
1602
|
};
|
|
1597
1603
|
AiChatMessage.style = aiChatMessageCss();
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var iconRegistry = require('./icon-registry-
|
|
3
|
+
var index = require('./index-BQ8Az7-D.js');
|
|
4
|
+
var iconRegistry = require('./icon-registry-D-m8GW4D.js');
|
|
5
5
|
|
|
6
|
-
const aiConversationListCss = () => `:host{display:
|
|
6
|
+
const aiConversationListCss = () => `:host{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.conversation-list{display:flex;flex-direction:column;gap:8px;flex:1;min-height:0;background:var(--ai-bg-surface)}.list-scroll{flex:1;min-height:0;overflow-y:auto;padding:0 8px 12px;scrollbar-width:thin;scrollbar-color:var(--ai-scrollbar-thumb) transparent}.list-scroll::-webkit-scrollbar{width:3px}.list-scroll::-webkit-scrollbar-track{background:transparent}.list-scroll::-webkit-scrollbar-thumb{background:var(--ai-scrollbar-thumb);border-radius:99px}.list-scroll::-webkit-scrollbar-thumb:hover{background:var(--ai-scrollbar-thumb-hover)}.conv-item{display:flex;align-items:flex-start;gap:6px;margin-top:6px;padding:10px 10px 10px 6px;border-radius:10px;cursor:pointer;transition:background 0.15s;position:relative}.conv-item:hover{background:var(--ai-bg-card)}.conv-item--active{background:var(--ai-bg-card);box-shadow:var(--ai-shadow-sm)}.conv-item__body{flex:1;min-width:0}.conv-item__title{margin:0 0 3px;font-size:13px;font-weight:600;color:var(--ai-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conv-item__preview{margin:0 0 5px;font-size:12px;color:var(--ai-text-muted);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.conv-item__meta{display:flex;align-items:center;gap:8px}.conv-item__time{font-size:11px;color:var(--ai-text-muted);flex-shrink:0}.rating-dots{display:flex;align-items:center;gap:3px}.rating-dot{width:6px;height:6px;border-radius:50%;background:var(--ai-border-default);transition:background 0.15s}.rating-dot--filled{background:var(--ai-accent-warning, #ffaf44)}.delete-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:none;border-radius:6px;cursor:pointer;color:var(--ai-text-muted);opacity:0;transition:opacity 0.15s, background 0.15s, color 0.15s;margin-block-start:2px}.conv-item:hover .delete-btn,.conv-item--active .delete-btn{opacity:1}.delete-btn:hover{background:var(--ai-status-danger-bg, rgba(239, 68, 68, 0.1));color:var(--ai-status-danger, #ef4444)}.delete-btn .icon-wrap{display:inline-flex;align-items:center;line-height:0}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:40px 16px;text-align:center}.empty-state__icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:10px;background:var(--ai-bg-card);color:var(--ai-text-muted);line-height:0}.empty-state__icon .icon-wrap{display:inline-flex;align-items:center;line-height:0}.empty-state__text{margin:0;font-size:13px;color:var(--ai-text-muted);line-height:1.4}.error-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:40px 16px;text-align:center}.error-state__icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:10px;background:var(--ai-status-danger-bg, rgba(239, 68, 68, 0.1));color:var(--ai-status-danger, #ef4444);line-height:0}.error-state__icon .icon-wrap{display:inline-flex;align-items:center;line-height:0}.error-state__text{margin:0;font-size:13px;color:var(--ai-text-muted);line-height:1.4}.error-state__retry{display:inline-flex;align-items:center;gap:4px;margin-top:4px;padding:6px 14px;font-size:12px;font-weight:600;color:var(--ai-text-primary);background:var(--ai-bg-card);border:1px solid var(--ai-border-default);border-radius:8px;cursor:pointer;transition:background 0.15s, box-shadow 0.15s}.error-state__retry:hover{box-shadow:var(--ai-shadow-sm)}.error-state__retry .icon-wrap{display:inline-flex;align-items:center;line-height:0}.skeleton-list{display:flex;flex-direction:column;gap:4px}.skeleton-item{padding:10px;border-radius:10px;display:flex;flex-direction:column;gap:6px}.skeleton-line{border-radius:6px;background:var(--ai-shimmer-gradient, linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.06) 75%));background-size:200% 100%;animation:shimmer 2s linear infinite;height:12px}.skeleton-line--title{width:65%;height:13px}.skeleton-line--preview{width:100%}.skeleton-line--meta{width:35%;height:10px}@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}`;
|
|
7
7
|
|
|
8
8
|
const AiConversationList = class {
|
|
9
9
|
constructor(hostRef) {
|
|
10
10
|
index.registerInstance(this, hostRef);
|
|
11
11
|
this.conversationSelect = index.createEvent(this, "conversationSelect");
|
|
12
12
|
this.conversationDelete = index.createEvent(this, "conversationDelete");
|
|
13
|
+
this.retryClick = index.createEvent(this, "retryClick");
|
|
13
14
|
}
|
|
14
15
|
/** JSON array of ConversationItem */
|
|
15
|
-
items =
|
|
16
|
+
items = [];
|
|
16
17
|
/** ID of the currently active conversation */
|
|
17
18
|
activeId = '';
|
|
18
19
|
/** Show skeleton loading state */
|
|
19
20
|
loading = false;
|
|
21
|
+
/** Text shown when the list is empty */
|
|
22
|
+
emptyText = 'لا توجد محادثات';
|
|
23
|
+
/** Show error state when fetching conversations fails */
|
|
24
|
+
error = false;
|
|
25
|
+
/** Error message text */
|
|
26
|
+
errorText = 'تعذّر تحميل المحادثات';
|
|
27
|
+
/** Retry button label for error state */
|
|
28
|
+
retryLabel = 'إعادة المحاولة';
|
|
20
29
|
conversationSelect;
|
|
21
30
|
conversationDelete;
|
|
31
|
+
retryClick;
|
|
22
32
|
renderIcon(name, width, height) {
|
|
23
33
|
const icon = iconRegistry.iconRegistry[name];
|
|
24
34
|
if (!icon)
|
|
@@ -26,17 +36,13 @@ const AiConversationList = class {
|
|
|
26
36
|
const svg = `<svg width="${width}" height="${height}" viewBox="${icon.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${icon.content}</svg>`;
|
|
27
37
|
return index.h("span", { class: "icon-wrap", innerHTML: svg });
|
|
28
38
|
}
|
|
29
|
-
getItems() {
|
|
30
|
-
try {
|
|
31
|
-
return JSON.parse(this.items) || [];
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
39
|
formatRelativeTime(timestamp) {
|
|
40
|
+
if (!timestamp)
|
|
41
|
+
return '';
|
|
38
42
|
try {
|
|
39
43
|
const date = new Date(timestamp);
|
|
44
|
+
if (isNaN(date.getTime()))
|
|
45
|
+
return timestamp;
|
|
40
46
|
const diffMs = Date.now() - date.getTime();
|
|
41
47
|
const diffMin = Math.floor(diffMs / 60000);
|
|
42
48
|
const diffHour = Math.floor(diffMin / 60);
|
|
@@ -52,7 +58,7 @@ const AiConversationList = class {
|
|
|
52
58
|
return rtf.format(-diffDay, 'day');
|
|
53
59
|
}
|
|
54
60
|
catch {
|
|
55
|
-
return
|
|
61
|
+
return timestamp;
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
64
|
renderRatingDots(rating) {
|
|
@@ -62,17 +68,27 @@ const AiConversationList = class {
|
|
|
62
68
|
renderSkeleton() {
|
|
63
69
|
return (index.h("div", { class: "skeleton-list" }, [1, 2, 3, 4].map(i => (index.h("div", { key: i, class: "skeleton-item" }, index.h("div", { class: "skeleton-line skeleton-line--title" }), index.h("div", { class: "skeleton-line skeleton-line--preview" }), index.h("div", { class: "skeleton-line skeleton-line--meta" }))))));
|
|
64
70
|
}
|
|
71
|
+
renderEmpty() {
|
|
72
|
+
return (index.h("div", { class: "empty-state" }, index.h("div", { class: "empty-state__icon" }, this.renderIcon('list', 24, 24)), index.h("p", { class: "empty-state__text" }, this.emptyText)));
|
|
73
|
+
}
|
|
74
|
+
renderError() {
|
|
75
|
+
return (index.h("div", { class: "error-state" }, index.h("div", { class: "error-state__icon" }, this.renderIcon('wifi-off', 24, 24)), index.h("p", { class: "error-state__text" }, this.errorText), index.h("button", { class: "error-state__retry", onClick: () => this.retryClick.emit() }, this.renderIcon('reload', 14, 14), index.h("span", null, this.retryLabel))));
|
|
76
|
+
}
|
|
65
77
|
render() {
|
|
66
|
-
const
|
|
67
|
-
return (index.h(index.Host, { key: '
|
|
78
|
+
const showEmpty = !this.loading && !this.error && this.items.length === 0;
|
|
79
|
+
return (index.h(index.Host, { key: 'f869a0422848385a43512486a021e3932e51589d' }, index.h("div", { key: 'b0f78202691e6329b9a73987f499c20d89b86c4b', class: "conversation-list" }, index.h("div", { key: '5a007fffa3fe9ef16445395966b1e14d2f516cf9', class: "list-scroll", role: "list" }, this.loading
|
|
68
80
|
? this.renderSkeleton()
|
|
69
|
-
:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
: this.error
|
|
82
|
+
? this.renderError()
|
|
83
|
+
: showEmpty
|
|
84
|
+
? this.renderEmpty()
|
|
85
|
+
: this.items.map(item => {
|
|
86
|
+
const isActive = item.id === this.activeId;
|
|
87
|
+
return (index.h("div", { key: item.id, class: { 'conv-item': true, 'conv-item--active': isActive }, role: "listitem", "aria-current": isActive ? 'true' : undefined, onClick: () => this.conversationSelect.emit(item.id) }, index.h("div", { class: "conv-item__body" }, index.h("p", { class: "conv-item__title" }, item.title), index.h("p", { class: "conv-item__preview" }, item.preview), index.h("div", { class: "conv-item__meta" }, index.h("span", { class: "conv-item__time" }, this.formatRelativeTime(item.timestamp)), item.rating != null && this.renderRatingDots(item.rating))), index.h("button", { class: "delete-btn", "aria-label": "\u062D\u0630\u0641 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629", onClick: e => {
|
|
88
|
+
e.stopPropagation();
|
|
89
|
+
this.conversationDelete.emit(item.id);
|
|
90
|
+
} }, this.renderIcon('cancel', 14, 14))));
|
|
91
|
+
})))));
|
|
76
92
|
}
|
|
77
93
|
};
|
|
78
94
|
AiConversationList.style = aiConversationListCss();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var iconRegistry = require('./icon-registry-
|
|
3
|
+
var index = require('./index-BQ8Az7-D.js');
|
|
4
|
+
var iconRegistry = require('./icon-registry-D-m8GW4D.js');
|
|
5
5
|
|
|
6
6
|
const aiConversationSummaryCss = () => `:host{display:block}.icon-wrap{display:inline-flex;align-items:center;justify-content:center;line-height:0}.summary-card{background:var(--ai-bg-card);border:1px solid var(--ai-border-default);border-radius:16px;box-shadow:var(--ai-shadow-sm);overflow:hidden;animation:fade-in 0.3s ease}@keyframes fade-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.summary-header{display:flex;align-items:center;gap:8px;padding:14px 16px;border-bottom:1px solid var(--ai-border-default)}.sparkle-avatar{width:24px;height:24px;border-radius:9999px;background:var(--ai-bg-surface);box-shadow:var(--ai-shadow-inner);display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--ai-amber)}.summary-title{font-size:15px;font-weight:500;color:var(--ai-text-primary);flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-badges{display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.badge{display:inline-flex;align-items:center;gap:3px;font-size:11px;font-weight:500;color:var(--ai-accent-dark);background:var(--ai-accent-bg);padding:2px 8px;border-radius:9999px;white-space:nowrap}.lang-badge{color:var(--ai-text-secondary);background:var(--ai-bg-surface)}.summary-body{margin:0;padding:12px 16px;font-size:14px;color:var(--ai-text-secondary);line-height:1.6;border-bottom:1px solid var(--ai-border-default)}.summary-slot{padding:12px 16px}.summary-slot:empty{display:none}`;
|
|
7
7
|
|
|
@@ -25,7 +25,7 @@ const AiConversationSummary = class {
|
|
|
25
25
|
return index.h("span", { class: "icon-wrap", innerHTML: svg });
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (index.h(index.Host, { key: '
|
|
28
|
+
return (index.h(index.Host, { key: 'd8dd368f17be91aaef528ae8092cce78bb19e35a' }, index.h("div", { key: '0460dcf3531e947c8ad6ea9d38fc76a1f0ec687d', class: "summary-card" }, index.h("div", { key: '01d46505f838f90ccc4c2d6e57f7b92982f45bd9', class: "summary-header" }, index.h("div", { key: '33afcdbe1f575a31a04ac7a1de948ab32dc76a83', class: "sparkle-avatar" }, this.renderIcon('sparkle', 14, 14)), index.h("span", { key: 'a645e52868e63ddcc8be501ae4d2a680ec6b3b27', class: "summary-title" }, this.conversation), index.h("div", { key: '14ade251a1136afae789c4d097013686f50a18f7', class: "summary-badges" }, this.messageCount > 0 && (index.h("span", { key: '70bf7e43f5d8f2ee38b2627d7f011d686bbb1b49', class: "badge" }, this.renderIcon('list', 12, 12), this.messageCount)), this.language && (index.h("span", { key: '9ad21900a26a59dabb2a25809995500363768692', class: "badge lang-badge" }, this.language)))), this.summary && (index.h("p", { key: '342007bc9de432fb64f71c84b301fbc802f9d119', class: "summary-body", ref: el => el && (el.textContent = this.summary) })), index.h("div", { key: 'c0ca1841f37918e0e1a805b34f53e2f0b204bbda', class: "summary-slot" }, index.h("slot", { key: '24cf0b383924109ed50aded7929320c1d66f3ea1' })))));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
AiConversationSummary.style = aiConversationSummaryCss();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var iconRegistry = require('./icon-registry-
|
|
3
|
+
var index = require('./index-BQ8Az7-D.js');
|
|
4
|
+
var iconRegistry = require('./icon-registry-D-m8GW4D.js');
|
|
5
5
|
|
|
6
6
|
const aiIconCss = () => `:host{display:inline-flex;align-items:center;justify-content:center}svg{display:block}`;
|
|
7
7
|
|