@salla.sa/ui-ai-kit-core 2.2.0 → 2.2.1
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 +2 -2
- package/dist/cjs/ai-card.cjs.entry.js +3 -3
- package/dist/cjs/ai-chat-container.cjs.entry.js +29 -3
- package/dist/cjs/ai-chat-header.cjs.entry.js +55 -10
- package/dist/cjs/ai-chat-message.cjs.entry.js +1 -1
- package/dist/cjs/ai-conversation-list.cjs.entry.js +2 -2
- package/dist/cjs/ai-conversation-summary.cjs.entry.js +1 -1
- package/dist/cjs/ai-icon.cjs.entry.js +1 -1
- package/dist/cjs/ai-in-chat-browser.cjs.entry.js +5 -23
- package/dist/cjs/ai-link.cjs.entry.js +2 -2
- package/dist/cjs/ai-loading.cjs.entry.js +2 -2
- package/dist/cjs/ai-message-input.cjs.entry.js +1 -1
- package/dist/cjs/ai-rating.cjs.entry.js +1 -1
- package/dist/cjs/ai-route-decision.cjs.entry.js +2 -2
- package/dist/cjs/ai-suggestion.cjs.entry.js +3 -3
- package/dist/cjs/ai-voice-input.cjs.entry.js +2 -2
- package/dist/cjs/{index-BQ8Az7-D.js → index-Cc05u4ND.js} +15 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/ui-ai-kit.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -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.js +110 -7
- package/dist/collection/components/ai-chat-header/ai-chat-header.js +72 -32
- package/dist/collection/components/ai-conversation-list/ai-conversation-list.js +1 -1
- package/dist/collection/components/ai-in-chat-browser/ai-in-chat-browser.css +0 -10
- package/dist/collection/components/ai-in-chat-browser/ai-in-chat-browser.js +5 -74
- 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-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/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.js +1 -1
- 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-CXJ3iEt8.js → p-BPkf7wZg.js} +1 -1
- package/dist/components/{p-B3gdcdCK.js → p-Ba0urr6Q.js} +1 -1
- package/dist/components/{p-DKsh1ZQX.js → p-CJzVwMlS.js} +1 -1
- package/dist/components/{p-C2LB8D3t.js → p-DZuBxUde.js} +1 -1
- package/dist/components/{p-NKAwri_g.js → p-bGFmyIp1.js} +1 -1
- package/dist/esm/ai-agent-error.entry.js +2 -2
- package/dist/esm/ai-card.entry.js +3 -3
- package/dist/esm/ai-chat-container.entry.js +29 -3
- package/dist/esm/ai-chat-header.entry.js +55 -10
- package/dist/esm/ai-chat-message.entry.js +1 -1
- package/dist/esm/ai-conversation-list.entry.js +2 -2
- package/dist/esm/ai-conversation-summary.entry.js +1 -1
- package/dist/esm/ai-icon.entry.js +1 -1
- package/dist/esm/ai-in-chat-browser.entry.js +5 -23
- package/dist/esm/ai-link.entry.js +2 -2
- package/dist/esm/ai-loading.entry.js +2 -2
- package/dist/esm/ai-message-input.entry.js +1 -1
- package/dist/esm/ai-rating.entry.js +1 -1
- package/dist/esm/ai-route-decision.entry.js +2 -2
- package/dist/esm/ai-suggestion.entry.js +3 -3
- package/dist/esm/ai-voice-input.entry.js +2 -2
- package/dist/esm/{index-BSQ0GkzI.js → index-VMEwYfaX.js} +15 -0
- 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 +21 -1
- package/dist/types/components/ai-chat-header/ai-chat-header.d.ts +15 -3
- package/dist/types/components/ai-in-chat-browser/ai-in-chat-browser.d.ts +1 -10
- package/dist/types/components.d.ts +40 -57
- package/dist/types/index.d.ts +1 -0
- package/dist/ui-ai-kit/{p-1e8e6440.entry.js → p-062cad02.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-b88808a4.entry.js → p-187db371.entry.js} +1 -1
- package/dist/ui-ai-kit/p-1b247096.entry.js +1 -0
- package/dist/ui-ai-kit/{p-39a2d4c3.entry.js → p-338d55d3.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-dac67692.entry.js → p-4359a116.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-3a86919b.entry.js → p-5f005ec5.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-849cd7e2.entry.js → p-6a4b66ed.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-47797619.entry.js → p-6b644d32.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-658d8b24.entry.js → p-6bd54e29.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-eb40ffd0.entry.js → p-83f46030.entry.js} +2 -2
- package/dist/ui-ai-kit/{p-8cb807f3.entry.js → p-8ac8febb.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-c9dca99e.entry.js → p-8fabdbe8.entry.js} +1 -1
- package/dist/ui-ai-kit/p-953d4348.entry.js +1 -0
- package/dist/ui-ai-kit/{p-BSQ0GkzI.js → p-VMEwYfaX.js} +2 -2
- package/dist/ui-ai-kit/{p-73cbb80b.entry.js → p-cae762e0.entry.js} +1 -1
- package/dist/ui-ai-kit/p-d02f2db5.entry.js +1 -0
- package/dist/ui-ai-kit/{p-78fb4ceb.entry.js → p-e6236df2.entry.js} +1 -1
- package/dist/ui-ai-kit/ui-ai-kit.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-D4mVoP6B.js +0 -1
- package/dist/ui-ai-kit/p-29d84924.entry.js +0 -1
- package/dist/ui-ai-kit/p-77ef8015.entry.js +0 -1
- package/dist/ui-ai-kit/p-abd68089.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-VMEwYfaX.js';
|
|
2
2
|
import { i as iconRegistry } from './icon-registry-DlD8m3rf.js';
|
|
3
3
|
|
|
4
4
|
const aiRatingCss = () => `:host{--ai-rating-question-size:16px;--ai-rating-subtitle-size:14px;--ai-rating-gap:8px;--ai-rating-emoji-size:24px;--ai-rating-btn-padding:6px;--ai-rating-btn-border:1px solid var(--ai-border-light);--ai-rating-btn-radius:9999px;--ai-rating-btn-bg-hover:var(--ai-bg-surface);--ai-rating-btn-border-hover:1px solid var(--ai-border-default);--ai-rating-btn-bg-active:var(--ai-warning-bg);--ai-rating-btn-border-active:1px solid var(--ai-warning-border);--ai-rating-btn-shadow-active:var(--ai-shadow-active);--ai-rating-label-size:16px;display:block}.rating{display:flex;flex-direction:column;align-items:center;gap:var(--ai-rating-gap);width:100%}.rating__text{display:flex;flex-direction:column;align-items:center;gap:2px;width:100%;text-align:center}.rating__question{margin:0;font-size:var(--ai-rating-question-size);font-weight:500;line-height:24px;color:var(--ai-text-primary)}.rating__subtitle{margin:0;font-size:var(--ai-rating-subtitle-size);font-weight:400;line-height:20px;color:var(--ai-text-secondary)}.rating__icons{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;flex-wrap:wrap}.emoji-btn{display:inline-flex;align-items:center;justify-content:center;padding:var(--ai-rating-btn-padding);border:var(--ai-rating-btn-border);border-radius:var(--ai-rating-btn-radius);background:transparent;cursor:pointer;transition:background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;outline:none}.emoji-btn:focus-visible{outline:2px solid var(--ai-warning-border);outline-offset:2px}.emoji-btn:hover:not(:disabled),.emoji-btn--hovered{background:var(--ai-rating-btn-bg-hover);border:var(--ai-rating-btn-border-hover);transform:scale(1.1)}.emoji-btn--active{background:var(--ai-rating-btn-bg-active) !important;border:var(--ai-rating-btn-border-active) !important;box-shadow:var(--ai-rating-btn-shadow-active);transform:scale(1.18) !important}.emoji-btn--disabled{opacity:0.45;cursor:not-allowed;pointer-events:none}.emoji-btn__icon{font-size:var(--ai-rating-emoji-size);line-height:1;display:inline-flex;align-items:center;justify-content:center;width:var(--ai-rating-emoji-size);height:var(--ai-rating-emoji-size);pointer-events:none}.rating__hover-label{margin:0;font-size:var(--ai-rating-label-size);font-weight:500;line-height:24px;color:var(--ai-text-primary);text-align:center;width:100%;animation:fadeIn 0.15s ease}.rating--success{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px 0;animation:fadeIn 0.2s ease}.rating__success-message{margin:0;font-size:var(--ai-rating-question-size);font-weight:500;line-height:24px;color:var(--ai-text-primary);text-align:center}@keyframes fadeIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-VMEwYfaX.js';
|
|
2
2
|
import { i as iconRegistry } from './icon-registry-DlD8m3rf.js';
|
|
3
3
|
|
|
4
4
|
const aiRouteDecisionCss = () => `:host{display:inline-block}.icon-wrap{display:inline-flex;align-items:center;justify-content:center;line-height:0}.route-pill{display:inline-flex;flex-direction:column;background:var(--ai-bg-card);border:1px solid var(--ai-border-default);border-radius:9999px;box-shadow:var(--ai-shadow-sm);overflow:hidden;transition:border-radius 0.2s ease}.route-pill.expanded{border-radius:12px}.route-pill-main{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:none;border:none;cursor:pointer;color:var(--ai-text-primary);font-size:13px;font-weight:500;white-space:nowrap;width:100%}.route-icon{color:var(--ai-accent-dark);display:inline-flex;flex-shrink:0}.agent-label{display:inline-flex;align-items:center;gap:4px}.agent-emoji{font-size:14px;line-height:1}.confidence-badge{font-size:11px;font-weight:600;color:var(--ai-accent-dark);background:var(--ai-accent-bg);padding:1px 6px;border-radius:9999px}.expand-icon{display:inline-flex;margin-inline-start:auto;color:var(--ai-text-secondary);transition:transform 0.2s ease;transform:rotate(0deg)}.expand-icon.expanded{transform:rotate(90deg)}.route-details{display:flex;flex-direction:column;gap:8px;padding:8px 12px 12px;border-top:1px solid var(--ai-border-default);animation:fade-in 0.2s ease}@keyframes fade-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.reason-text{margin:0;font-size:12px;color:var(--ai-text-secondary);line-height:1.5}.confidence-bar-wrap{height:4px;border-radius:9999px;background:var(--ai-border-default);overflow:hidden}.confidence-bar{height:100%;border-radius:9999px;background:var(--ai-accent-dark);transition:width 0.4s ease}.meta-row{display:inline-flex;align-items:center;gap:4px;color:var(--ai-text-secondary)}.lang-chip{font-size:11px;color:var(--ai-text-secondary)}`;
|
|
@@ -38,7 +38,7 @@ const AiRouteDecision = class {
|
|
|
38
38
|
this.routeExpand.emit(this._expanded);
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
|
-
return (h(Host, { key: '
|
|
41
|
+
return (h(Host, { key: 'fa9b966cf28225fa458fb00d1114fade995258c5' }, h("div", { key: '5263c969fd1672e1d302f06173dcdbe4450b162e', class: `route-pill ${this._expanded ? 'expanded' : ''}` }, h("button", { key: 'bf7800e828b0b61174f75343fcf9bca3134dfb2a', class: "route-pill-main", onClick: () => this.handleToggle() }, h("span", { key: '8531aeab0872f59417a37294e780d46962b21ead', class: "route-icon" }, this.renderIcon('route', 14, 14)), h("span", { key: '754529860d90a3ceb4f226ff85b1aecb40f4649e', class: "agent-label" }, this.agentIcon && h("span", { key: '39682d3a761d2cd6fae794fcb6036b0044f8f2dc', class: "agent-emoji", "aria-hidden": "true" }, this.agentIcon), this.selectedAgent), this.confidence > 0 && (h("span", { key: '36b3a921ab75c1faa0ece5f286703bf1b0aaca16', class: "confidence-badge" }, this.confidence, "%")), h("span", { key: 'c5199e986bf35d187cad16027f23e62addc45ecb', class: `expand-icon ${this._expanded ? 'expanded' : ''}` }, this.renderIcon('arrow-right', 12, 12))), this._expanded && (h("div", { key: '2a18ae8297ad0d71b14d01d250e15cff452c4b07', class: "route-details" }, this.reason && h("p", { key: '55f5123399929c590fc5c2122fd7220209e5ecac', class: "reason-text" }, this.reason), this.confidence > 0 && (h("div", { key: 'fbc69e8cb7820c87764f46630af8f4a77d2d879b', class: "confidence-bar-wrap" }, h("div", { key: '1db1d454ef64dcf9e4c673d0a26780bd55f563d2', class: "confidence-bar", style: { width: `${this.confidence}%` } }))), this.detectedLanguage && (h("div", { key: '8553d1a20678252b8d4f9a1e9f8b64ce3f509ae5', class: "meta-row" }, this.renderIcon('list', 12, 12), h("span", { key: 'ec104948a04498d06ed73be89778c5b6d84582a2', class: "lang-chip" }, this.detectedLanguage))))))));
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
AiRouteDecision.style = aiRouteDecisionCss();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-VMEwYfaX.js';
|
|
2
2
|
|
|
3
3
|
const aiSuggestionCss = () => `:host{--ai-suggestion-border:1px solid var(--ai-accent);--ai-suggestion-border-hover:1px solid var(--ai-accent);--ai-suggestion-radius:9999px;--ai-suggestion-padding:8px 12px;--ai-suggestion-gap:4px;--ai-suggestion-font-size:14px;--ai-suggestion-line-height:20px;display:inline-block}.chip{display:inline-flex;align-items:center;justify-content:center;gap:var(--ai-suggestion-gap);background:var(--ai-bg-card);border:var(--ai-suggestion-border);border-radius:var(--ai-suggestion-radius);padding:var(--ai-suggestion-padding);color:var(--ai-accent-dark);font-size:var(--ai-suggestion-font-size);font-weight:400;line-height:var(--ai-suggestion-line-height);font-family:inherit;white-space:nowrap;cursor:pointer;transition:background 0.15s ease, border-color 0.15s ease;outline:none;text-align:start}.chip:hover:not(:disabled){background:var(--ai-accent-bg);border:var(--ai-suggestion-border-hover)}.chip:active:not(:disabled){background:var(--ai-accent-bg)}.chip:focus-visible{outline:2px solid var(--ai-accent);outline-offset:2px}.chip--disabled,.chip:disabled{opacity:0.45;cursor:not-allowed;pointer-events:none}.chip__label{display:inline-flex;align-items:center;gap:var(--ai-suggestion-gap)}`;
|
|
4
4
|
|
|
@@ -18,10 +18,10 @@ const AiSuggestion = class {
|
|
|
18
18
|
this.suggestionClick.emit(this.label);
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: '510e649f8778e2298270d320f0555c4d960fb056' }, h("button", { key: 'a4ee17cbd432596804279d8a852635608125452a', class: {
|
|
22
22
|
chip: true,
|
|
23
23
|
'chip--disabled': this.disabled,
|
|
24
|
-
}, disabled: this.disabled, onClick: () => this.handleClick() }, h("span", { key: '
|
|
24
|
+
}, disabled: this.disabled, onClick: () => this.handleClick() }, h("span", { key: 'cb2d97459b0dd6effe83bbfb81a0af9144759477', class: "chip__label" }, this.label, h("slot", { key: 'ce84f07883f24c216c45da9266af5160baea9cdc' })))));
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
AiSuggestion.style = aiSuggestionCss();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, a as getElement, h, H as Host } from './index-VMEwYfaX.js';
|
|
2
2
|
|
|
3
3
|
const aiVoiceInputCss = () => `:host{display:block;width:100%}.wrapper{position:relative;padding:var(--Spacing-Sizes-lg, 12px)}.glow{position:absolute;bottom:20px;left:39px;right:39px;height:29px;border-radius:9999px;background:var(--ai-input-glow);filter:blur(20px);opacity:0;pointer-events:none;transition:opacity 0.2s ease}.glow.visible{opacity:0.9}.input-container{position:relative;background-color:var(--ai-bg-input);border-radius:var(--ai-input-border-radius, 9999px);border:1px solid var(--ai-border-default);box-shadow:var(--ai-shadow-sm);padding:var(--ai-input-padding, 12px);overflow:hidden}.recording-row{display:flex;align-items:center;gap:var(--ai-input-gap, 10px)}.cancel-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:32px;max-height:32px;padding:4px 8px;border-radius:32px;border:2px solid var(--ai-border-default);background-color:var(--ai-border-default);color:var(--ai-text-secondary);cursor:pointer;flex-shrink:0;transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease}.cancel-button:hover{background-color:var(--ai-bg-surface);border-color:var(--ai-bg-surface)}.submit-button{display:inline-flex;align-items:center;justify-content:center;height:32px;width:32px;min-width:32px;padding:4px 8px;border-radius:32px;border:2px solid var(--ai-send-button-active-border, var(--ai-accent));background-color:var(--ai-send-button-active-bg, var(--ai-accent));color:var(--ai-accent-text);cursor:pointer;flex-shrink:0;transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease}.submit-button:hover{background-color:var(--ai-send-button-active-hover-bg, var(--ai-accent));border-color:var(--ai-send-button-active-hover-border, var(--ai-accent))}@keyframes pulse-once{0%{transform:scale(1)}40%{transform:scale(1.18)}100%{transform:scale(1)}}.submit-button.pulse{animation:pulse-once 0.35s ease}.timer{font-size:13px;font-weight:500;color:var(--ai-text-secondary);min-width:36px;text-align:center;flex-shrink:0}.timer.warning{color:var(--ai-voice-timer-warning-color, var(--ai-danger-text))}.waveform{flex:1;min-width:0;height:32px}.error-message{position:absolute;bottom:-40px;left:50%;transform:translateX(-50%);background:var(--ai-voice-error-bg, var(--ai-danger-bg));color:var(--ai-voice-error-color, var(--ai-danger-text));font-size:11px;padding:6px 12px;border-radius:6px;white-space:nowrap;box-shadow:var(--ai-shadow-error);border:1px solid var(--ai-voice-error-border, var(--ai-danger-border));z-index:10}`;
|
|
4
4
|
|
|
@@ -277,7 +277,7 @@ const VoiceInput = class {
|
|
|
277
277
|
};
|
|
278
278
|
render() {
|
|
279
279
|
const remaining = MAX_RECORDING_TIME - this.recordingDuration;
|
|
280
|
-
return (h(Host, { key: '
|
|
280
|
+
return (h(Host, { key: '93565ead1262f192811d4783ac4567b8eb7d59de' }, h("div", { key: '9317e2a24533435e5ac967f3eddaad3d1f6c4613', class: "wrapper" }, h("div", { key: '35631eb88e495be9b2bdabf1b8f15d237d327c4b', class: `glow${this.state === 'recording' ? ' visible' : ''}`, "aria-hidden": "true" }), h("div", { key: 'c65050758e58402c5b341c8d24a0ca58f9f53361', class: "input-container" }, this.state === 'idle' ? (h("div", { class: "recording-row" }, h("button", { type: "button", class: "submit-button", onClick: this.startRecording, disabled: this.disabled, "aria-label": "Start recording" }, h("ai-icon", { name: "mic", size: 16 })), this.error && (h("div", { class: "error-message", role: "alert" }, this.error)))) : (h("div", { class: "recording-row" }, h("button", { type: "button", class: "cancel-button", onClick: this.cancelRecording, "aria-label": "Cancel" }, h("ai-icon", { name: "cancel", size: 14 })), h("div", { class: `timer${remaining <= 5 ? ' warning' : ''}` }, this.formatDuration(this.recordingDuration)), this.showWaveform && h("canvas", { ref: el => (this.canvasRef = el), class: "waveform", height: "32" }), h("button", { type: "button", class: `submit-button${this.submitPulse ? ' pulse' : ''}`, onClick: this.stopRecording, "aria-label": "Send" }, h("ai-icon", { name: "arrow-up", size: 14 }))))))));
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
283
|
VoiceInput.style = aiVoiceInputCss();
|
|
@@ -935,6 +935,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
935
935
|
const isHostElement = isHost(renderFnResults);
|
|
936
936
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
937
937
|
hostTagName = hostElm.tagName;
|
|
938
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
939
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
940
|
+
cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
|
|
941
|
+
{
|
|
942
|
+
rootVnode.$attrs$[attribute] = hostElm[propName];
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
}
|
|
938
946
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
939
947
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
940
948
|
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
@@ -1329,8 +1337,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1329
1337
|
/* @__PURE__ */ new Set([
|
|
1330
1338
|
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1331
1339
|
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
|
|
1340
|
+
var _a2;
|
|
1332
1341
|
const attrName = m[1] || propName;
|
|
1333
1342
|
attrNameToPropName.set(attrName, propName);
|
|
1343
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
1344
|
+
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
1345
|
+
}
|
|
1334
1346
|
return attrName;
|
|
1335
1347
|
})
|
|
1336
1348
|
])
|
|
@@ -1534,6 +1546,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1534
1546
|
{
|
|
1535
1547
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1536
1548
|
}
|
|
1549
|
+
{
|
|
1550
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1551
|
+
}
|
|
1537
1552
|
{
|
|
1538
1553
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
1539
1554
|
cmpMeta.$serializers$ = (_b = compactMeta[5]) != null ? _b : {};
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as globalScripts, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { g as globalScripts, b as bootstrapLazy } from './index-VMEwYfaX.js';
|
|
2
|
+
export { s as setNonce } from './index-VMEwYfaX.js';
|
|
3
3
|
|
|
4
4
|
const defineCustomElements = async (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
6
|
await globalScripts();
|
|
7
|
-
return bootstrapLazy([["ai-
|
|
7
|
+
return bootstrapLazy([["ai-message-input",[[513,"ai-message-input",{"placeholder":[1],"disabled":[4],"showVoiceButton":[4,"show-voice-button"],"maxLength":[2,"max-length"],"isRecording":[4,"is-recording"],"inputValue":[32],"showVoiceRecorder":[32],"isMultiline":[32],"setInputValue":[64]},null,{"isRecording":[{"onIsRecordingChange":0}]}]]],["ai-rating",[[513,"ai-rating",{"question":[1],"subtitle":[1],"successMessage":[1,"success-message"],"value":[1026],"disabled":[4],"hovered":[32],"submitted":[32]}]]],["ai-chat-header",[[513,"ai-chat-header",{"mode":[1],"conversation":[1],"agentName":[1,"agent-name"],"agentStatus":[1,"agent-status"],"agentAvatar":[1,"agent-avatar"],"showBack":[4,"show-back"],"statusIndicator":[1,"status-indicator"],"pageTitle":[1,"page-title"],"pageUrl":[1,"page-url"],"conversationItems":[16],"conversationActiveId":[1,"conversation-active-id"],"conversationLoading":[4,"conversation-loading"],"titleLoading":[4,"title-loading"],"avatarError":[32],"dropdownOpen":[32],"isFloating":[32]},[[4,"click","handleDocumentClick"]]]]],["ai-agent-error",[[513,"ai-agent-error",{"headline":[1],"message":[1],"errorCode":[1,"error-code"],"retryable":[4],"retryLabel":[1,"retry-label"],"dismissible":[4]}]]],["ai-chat-container",[[769,"ai-chat-container",{"isOpen":[4,"is-open"],"position":[1537],"width":[1],"autoScroll":[4,"auto-scroll"],"showWatermark":[4,"show-watermark"],"floatHeight":[1,"float-height"],"theme":[1],"loading":[4],"error":[4],"errorText":[1,"error-text"],"retryLabel":[1,"retry-label"],"direction":[513],"isMobile":[32],"floatLeft":[32],"floatTop":[32],"scrollToBottom":[64],"cyclePosition":[64]},[[0,"headerPositionClick","handleHeaderPositionClick"]],{"isOpen":[{"isOpenChanged":0}],"position":[{"positionChanged":0}]}]]],["ai-chat-message",[[769,"ai-chat-message",{"role":[1],"content":[1],"format":[1],"agentName":[1,"agent-name"],"timestamp":[1],"showActions":[4,"show-actions"],"enableRegenerate":[4,"enable-regenerate"],"feedbackValue":[1025,"feedback-value"],"copySuccess":[32]}]]],["ai-conversation-summary",[[769,"ai-conversation-summary",{"conversation":[1],"summary":[1],"messageCount":[2,"message-count"],"language":[1]}]]],["ai-in-chat-browser",[[513,"ai-in-chat-browser",{"url":[1],"pageTitle":[1,"page-title"],"isLoading":[32],"hasError":[32]},null,{"url":[{"onUrlChange":0}]}]]],["ai-link",[[769,"ai-link",{"label":[1],"href":[1],"target":[1],"rel":[1]}]]],["ai-loading",[[513,"ai-loading",{"mode":[1],"statusText":[1,"status-text"],"thinkingSubtext":[1,"thinking-subtext"],"steps":[16],"headerTitle":[1,"header-title"],"currentAgent":[1,"current-agent"],"showAgentBadges":[4,"show-agent-badges"],"expanded":[1028],"collapsible":[4],"_expanded":[32]}]]],["ai-route-decision",[[513,"ai-route-decision",{"selectedAgent":[1,"selected-agent"],"agentIcon":[1,"agent-icon"],"reason":[1],"confidence":[2],"detectedLanguage":[1,"detected-language"],"expanded":[1028],"_expanded":[32]}]]],["ai-suggestion",[[769,"ai-suggestion",{"label":[1],"disabled":[4]}]]],["ai-voice-input",[[513,"ai-voice-input",{"disabled":[4],"showWaveform":[4,"show-waveform"],"autoStart":[4,"auto-start"],"errorText":[1,"error-text"],"waveformColor":[1,"waveform-color"],"state":[32],"error":[32],"recordingDuration":[32],"submitPulse":[32]}]]],["ai-card",[[769,"ai-card",{"noPadding":[4,"no-padding"],"noShadow":[4,"no-shadow"]}]]],["ai-conversation-list",[[513,"ai-conversation-list",{"items":[16],"activeId":[1,"active-id"],"loading":[4],"emptyText":[1,"empty-text"],"error":[4],"errorText":[1,"error-text"],"retryLabel":[1,"retry-label"]}]]],["ai-icon",[[513,"ai-icon",{"name":[1],"size":[2]}]]]], options);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { defineCustomElements };
|
package/dist/esm/ui-ai-kit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-VMEwYfaX.js';
|
|
2
|
+
export { s as setNonce } from './index-VMEwYfaX.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Patch Browser v4.43.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["ai-
|
|
19
|
+
return bootstrapLazy([["ai-message-input",[[513,"ai-message-input",{"placeholder":[1],"disabled":[4],"showVoiceButton":[4,"show-voice-button"],"maxLength":[2,"max-length"],"isRecording":[4,"is-recording"],"inputValue":[32],"showVoiceRecorder":[32],"isMultiline":[32],"setInputValue":[64]},null,{"isRecording":[{"onIsRecordingChange":0}]}]]],["ai-rating",[[513,"ai-rating",{"question":[1],"subtitle":[1],"successMessage":[1,"success-message"],"value":[1026],"disabled":[4],"hovered":[32],"submitted":[32]}]]],["ai-chat-header",[[513,"ai-chat-header",{"mode":[1],"conversation":[1],"agentName":[1,"agent-name"],"agentStatus":[1,"agent-status"],"agentAvatar":[1,"agent-avatar"],"showBack":[4,"show-back"],"statusIndicator":[1,"status-indicator"],"pageTitle":[1,"page-title"],"pageUrl":[1,"page-url"],"conversationItems":[16],"conversationActiveId":[1,"conversation-active-id"],"conversationLoading":[4,"conversation-loading"],"titleLoading":[4,"title-loading"],"avatarError":[32],"dropdownOpen":[32],"isFloating":[32]},[[4,"click","handleDocumentClick"]]]]],["ai-agent-error",[[513,"ai-agent-error",{"headline":[1],"message":[1],"errorCode":[1,"error-code"],"retryable":[4],"retryLabel":[1,"retry-label"],"dismissible":[4]}]]],["ai-chat-container",[[769,"ai-chat-container",{"isOpen":[4,"is-open"],"position":[1537],"width":[1],"autoScroll":[4,"auto-scroll"],"showWatermark":[4,"show-watermark"],"floatHeight":[1,"float-height"],"theme":[1],"loading":[4],"error":[4],"errorText":[1,"error-text"],"retryLabel":[1,"retry-label"],"direction":[513],"isMobile":[32],"floatLeft":[32],"floatTop":[32],"scrollToBottom":[64],"cyclePosition":[64]},[[0,"headerPositionClick","handleHeaderPositionClick"]],{"isOpen":[{"isOpenChanged":0}],"position":[{"positionChanged":0}]}]]],["ai-chat-message",[[769,"ai-chat-message",{"role":[1],"content":[1],"format":[1],"agentName":[1,"agent-name"],"timestamp":[1],"showActions":[4,"show-actions"],"enableRegenerate":[4,"enable-regenerate"],"feedbackValue":[1025,"feedback-value"],"copySuccess":[32]}]]],["ai-conversation-summary",[[769,"ai-conversation-summary",{"conversation":[1],"summary":[1],"messageCount":[2,"message-count"],"language":[1]}]]],["ai-in-chat-browser",[[513,"ai-in-chat-browser",{"url":[1],"pageTitle":[1,"page-title"],"isLoading":[32],"hasError":[32]},null,{"url":[{"onUrlChange":0}]}]]],["ai-link",[[769,"ai-link",{"label":[1],"href":[1],"target":[1],"rel":[1]}]]],["ai-loading",[[513,"ai-loading",{"mode":[1],"statusText":[1,"status-text"],"thinkingSubtext":[1,"thinking-subtext"],"steps":[16],"headerTitle":[1,"header-title"],"currentAgent":[1,"current-agent"],"showAgentBadges":[4,"show-agent-badges"],"expanded":[1028],"collapsible":[4],"_expanded":[32]}]]],["ai-route-decision",[[513,"ai-route-decision",{"selectedAgent":[1,"selected-agent"],"agentIcon":[1,"agent-icon"],"reason":[1],"confidence":[2],"detectedLanguage":[1,"detected-language"],"expanded":[1028],"_expanded":[32]}]]],["ai-suggestion",[[769,"ai-suggestion",{"label":[1],"disabled":[4]}]]],["ai-voice-input",[[513,"ai-voice-input",{"disabled":[4],"showWaveform":[4,"show-waveform"],"autoStart":[4,"auto-start"],"errorText":[1,"error-text"],"waveformColor":[1,"waveform-color"],"state":[32],"error":[32],"recordingDuration":[32],"submitPulse":[32]}]]],["ai-card",[[769,"ai-card",{"noPadding":[4,"no-padding"],"noShadow":[4,"no-shadow"]}]]],["ai-conversation-list",[[513,"ai-conversation-list",{"items":[16],"activeId":[1,"active-id"],"loading":[4],"emptyText":[1,"empty-text"],"error":[4],"errorText":[1,"error-text"],"retryLabel":[1,"retry-label"]}]]],["ai-icon",[[513,"ai-icon",{"name":[1],"size":[2]}]]]], options);
|
|
20
20
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export type ChatPosition = 'left' | 'right' | 'float';
|
|
2
3
|
export declare class ChatContainer {
|
|
3
4
|
el: HTMLElement;
|
|
4
5
|
/** Controls visibility of the chat panel */
|
|
5
6
|
isOpen: boolean;
|
|
6
7
|
/** Position of the panel: 'left', 'right', or 'float' */
|
|
7
|
-
position:
|
|
8
|
+
position: ChatPosition;
|
|
8
9
|
/** Width of the panel (CSS value, e.g., '400px', '30%', '28rem') */
|
|
9
10
|
width: string;
|
|
10
11
|
/** Enable/disable auto-scroll to latest message */
|
|
@@ -23,8 +24,16 @@ export declare class ChatContainer {
|
|
|
23
24
|
errorText: string;
|
|
24
25
|
/** Retry button label */
|
|
25
26
|
retryLabel: string;
|
|
27
|
+
/**
|
|
28
|
+
* Layout direction set by the host app.
|
|
29
|
+
* - `'rtl'` → valid docked position is `left`; cycle order: left ↔ float
|
|
30
|
+
* - `'ltr'` → valid docked position is `right`; cycle order: right ↔ float
|
|
31
|
+
*/
|
|
32
|
+
direction: 'rtl' | 'ltr';
|
|
26
33
|
/** Event emitted when the retry button is clicked */
|
|
27
34
|
retryClick: EventEmitter<void>;
|
|
35
|
+
/** Fired when the position changes (via cyclePosition or the header button) */
|
|
36
|
+
positionChange: EventEmitter<ChatPosition>;
|
|
28
37
|
isMobile: boolean;
|
|
29
38
|
floatLeft: string;
|
|
30
39
|
floatTop: string;
|
|
@@ -34,6 +43,11 @@ export declare class ChatContainer {
|
|
|
34
43
|
private mutationObserver;
|
|
35
44
|
private resizeObserver;
|
|
36
45
|
private dragListener;
|
|
46
|
+
/**
|
|
47
|
+
* Listen for the composed headerPositionClick event fired by ai-chat-header.
|
|
48
|
+
* Automatically cycles the position so the host app doesn't need to wire it manually.
|
|
49
|
+
*/
|
|
50
|
+
handleHeaderPositionClick(): void;
|
|
37
51
|
componentWillLoad(): void;
|
|
38
52
|
componentDidLoad(): void;
|
|
39
53
|
isOpenChanged(newVal: boolean): void;
|
|
@@ -41,6 +55,12 @@ export declare class ChatContainer {
|
|
|
41
55
|
disconnectedCallback(): void;
|
|
42
56
|
/** Programmatically scroll the messages area to the bottom */
|
|
43
57
|
scrollToBottom(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Cycle to the next valid position based on the current direction.
|
|
60
|
+
* - RTL: left ↔ float
|
|
61
|
+
* - LTR: right ↔ float
|
|
62
|
+
*/
|
|
63
|
+
cyclePosition(): Promise<void>;
|
|
44
64
|
private handleWindowResize;
|
|
45
65
|
private checkMobile;
|
|
46
66
|
/** Re-clamp float position so the panel never ends up off-screen after resize */
|
|
@@ -14,7 +14,6 @@ export declare class AiChatHeader {
|
|
|
14
14
|
agentAvatar: string;
|
|
15
15
|
/** Human mode: show the back button */
|
|
16
16
|
showBack: boolean;
|
|
17
|
-
isDraggable: boolean;
|
|
18
17
|
/** Human mode: status indicator variant */
|
|
19
18
|
statusIndicator: 'online' | 'offline' | 'busy' | 'away';
|
|
20
19
|
/** Browser mode: page title shown in the header */
|
|
@@ -31,14 +30,22 @@ export declare class AiChatHeader {
|
|
|
31
30
|
titleLoading: boolean;
|
|
32
31
|
private avatarError;
|
|
33
32
|
private dropdownOpen;
|
|
33
|
+
/** Internally managed — true when the parent ai-chat-container has position="float" */
|
|
34
|
+
private isFloating;
|
|
35
|
+
private parentPositionObserver;
|
|
34
36
|
/** Cancel / close button */
|
|
35
37
|
closeClick: EventEmitter<void>;
|
|
36
38
|
/** Pencil-edit button (agent mode) */
|
|
37
|
-
|
|
39
|
+
newChatClick: EventEmitter<void>;
|
|
38
40
|
/** Title / chevron click → open conversation list (agent mode) */
|
|
39
41
|
dropdownClick: EventEmitter<void>;
|
|
40
|
-
/** More options button */
|
|
42
|
+
/** More options button — also fires a composed event so ai-chat-container can auto-cycle position */
|
|
41
43
|
positionClick: EventEmitter<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Composed + bubbling event that ai-chat-container listens to internally
|
|
46
|
+
* to automatically cycle its position. Fires alongside positionClick.
|
|
47
|
+
*/
|
|
48
|
+
headerPositionClick: EventEmitter<void>;
|
|
42
49
|
/** Back-arrow button (human mode) */
|
|
43
50
|
backClick: EventEmitter<void>;
|
|
44
51
|
/**
|
|
@@ -56,6 +63,11 @@ export declare class AiChatHeader {
|
|
|
56
63
|
/** Fired when a conversation delete button is clicked */
|
|
57
64
|
conversationDelete: EventEmitter<string>;
|
|
58
65
|
handleDocumentClick(event: Event): void;
|
|
66
|
+
connectedCallback(): void;
|
|
67
|
+
componentDidLoad(): void;
|
|
68
|
+
disconnectedCallback(): void;
|
|
69
|
+
private observeParentPosition;
|
|
70
|
+
private syncFloatingState;
|
|
59
71
|
private renderIcon;
|
|
60
72
|
private renderAvatar;
|
|
61
73
|
private renderDragBtn;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
1
|
export declare class AiInChatBrowser {
|
|
3
2
|
/** The URL to display inside the in-chat browser iframe */
|
|
4
3
|
url: string;
|
|
5
|
-
/** Page title
|
|
4
|
+
/** Page title used as the iframe's accessible title. Defaults to the URL hostname when empty. */
|
|
6
5
|
pageTitle: string;
|
|
7
|
-
/** Show the drag handle in the header (for floating containers) */
|
|
8
|
-
isDraggable: boolean;
|
|
9
|
-
/** Fired when the user clicks the back / close button to dismiss the browser */
|
|
10
|
-
browserClose: EventEmitter<void>;
|
|
11
|
-
/** Fired when the user clicks the external-link button */
|
|
12
|
-
browserOpenExternal: EventEmitter<string>;
|
|
13
6
|
private isLoading;
|
|
14
7
|
private hasError;
|
|
15
8
|
onUrlChange(): void;
|
|
16
9
|
private getDisplayTitle;
|
|
17
10
|
private handleIframeLoad;
|
|
18
11
|
private handleIframeError;
|
|
19
|
-
private handleBack;
|
|
20
|
-
private handleOpenExternal;
|
|
21
12
|
render(): any;
|
|
22
13
|
}
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
+
import { ChatPosition } from "./components/ai-chat-container/ai-chat-container";
|
|
8
9
|
import { ConversationItem } from "./components/ai-conversation-list/ai-conversation-list";
|
|
9
10
|
import { ConversationItem as ConversationItem1 } from "./components/ai-conversation-list/ai-conversation-list";
|
|
10
11
|
import { IconName } from "./utils/icon-registry";
|
|
11
12
|
import { LoadingStep } from "./components/ai-loading/ai-loading";
|
|
12
13
|
import { RatingValue } from "./components/ai-rating/ai-rating";
|
|
14
|
+
export { ChatPosition } from "./components/ai-chat-container/ai-chat-container";
|
|
13
15
|
export { ConversationItem } from "./components/ai-conversation-list/ai-conversation-list";
|
|
14
16
|
export { ConversationItem as ConversationItem1 } from "./components/ai-conversation-list/ai-conversation-list";
|
|
15
17
|
export { IconName } from "./utils/icon-registry";
|
|
@@ -66,6 +68,15 @@ export namespace Components {
|
|
|
66
68
|
* @default true
|
|
67
69
|
*/
|
|
68
70
|
"autoScroll": boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Cycle to the next valid position based on the current direction. - RTL: left ↔ float - LTR: right ↔ float
|
|
73
|
+
*/
|
|
74
|
+
"cyclePosition": () => Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Layout direction set by the host app. - `'rtl'` → valid docked position is `left`; cycle order: left ↔ float - `'ltr'` → valid docked position is `right`; cycle order: right ↔ float
|
|
77
|
+
* @default 'rtl'
|
|
78
|
+
*/
|
|
79
|
+
"direction": 'rtl' | 'ltr';
|
|
69
80
|
/**
|
|
70
81
|
* Show error state (e.g. failed to load conversation)
|
|
71
82
|
* @default false
|
|
@@ -93,9 +104,9 @@ export namespace Components {
|
|
|
93
104
|
"loading": boolean;
|
|
94
105
|
/**
|
|
95
106
|
* Position of the panel: 'left', 'right', or 'float'
|
|
96
|
-
* @default '
|
|
107
|
+
* @default 'left'
|
|
97
108
|
*/
|
|
98
|
-
"position":
|
|
109
|
+
"position": ChatPosition;
|
|
99
110
|
/**
|
|
100
111
|
* Retry button label
|
|
101
112
|
* @default 'إعادة المحاولة'
|
|
@@ -157,10 +168,6 @@ export namespace Components {
|
|
|
157
168
|
* @default false
|
|
158
169
|
*/
|
|
159
170
|
"conversationLoading": boolean;
|
|
160
|
-
/**
|
|
161
|
-
* @default false
|
|
162
|
-
*/
|
|
163
|
-
"isDraggable": boolean;
|
|
164
171
|
/**
|
|
165
172
|
* Layout variant
|
|
166
173
|
* @default 'agent'
|
|
@@ -298,12 +305,7 @@ export namespace Components {
|
|
|
298
305
|
}
|
|
299
306
|
interface AiInChatBrowser {
|
|
300
307
|
/**
|
|
301
|
-
*
|
|
302
|
-
* @default false
|
|
303
|
-
*/
|
|
304
|
-
"isDraggable": boolean;
|
|
305
|
-
/**
|
|
306
|
-
* Page title shown in the browser header. Defaults to the URL hostname when empty.
|
|
308
|
+
* Page title used as the iframe's accessible title. Defaults to the URL hostname when empty.
|
|
307
309
|
* @default ''
|
|
308
310
|
*/
|
|
309
311
|
"pageTitle": string;
|
|
@@ -532,10 +534,6 @@ export interface AiConversationListCustomEvent<T> extends CustomEvent<T> {
|
|
|
532
534
|
detail: T;
|
|
533
535
|
target: HTMLAiConversationListElement;
|
|
534
536
|
}
|
|
535
|
-
export interface AiInChatBrowserCustomEvent<T> extends CustomEvent<T> {
|
|
536
|
-
detail: T;
|
|
537
|
-
target: HTMLAiInChatBrowserElement;
|
|
538
|
-
}
|
|
539
537
|
export interface AiLoadingCustomEvent<T> extends CustomEvent<T> {
|
|
540
538
|
detail: T;
|
|
541
539
|
target: HTMLAiLoadingElement;
|
|
@@ -587,6 +585,7 @@ declare global {
|
|
|
587
585
|
};
|
|
588
586
|
interface HTMLAiChatContainerElementEventMap {
|
|
589
587
|
"retryClick": void;
|
|
588
|
+
"positionChange": ChatPosition;
|
|
590
589
|
}
|
|
591
590
|
interface HTMLAiChatContainerElement extends Components.AiChatContainer, HTMLStencilElement {
|
|
592
591
|
addEventListener<K extends keyof HTMLAiChatContainerElementEventMap>(type: K, listener: (this: HTMLAiChatContainerElement, ev: AiChatContainerCustomEvent<HTMLAiChatContainerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -604,9 +603,10 @@ declare global {
|
|
|
604
603
|
};
|
|
605
604
|
interface HTMLAiChatHeaderElementEventMap {
|
|
606
605
|
"closeClick": void;
|
|
607
|
-
"
|
|
606
|
+
"newChatClick": void;
|
|
608
607
|
"dropdownClick": void;
|
|
609
608
|
"positionClick": void;
|
|
609
|
+
"headerPositionClick": void;
|
|
610
610
|
"backClick": void;
|
|
611
611
|
"headerDragStart": { clientX: number; clientY: number };
|
|
612
612
|
"openExternal": string;
|
|
@@ -677,19 +677,7 @@ declare global {
|
|
|
677
677
|
prototype: HTMLAiIconElement;
|
|
678
678
|
new (): HTMLAiIconElement;
|
|
679
679
|
};
|
|
680
|
-
interface HTMLAiInChatBrowserElementEventMap {
|
|
681
|
-
"browserClose": void;
|
|
682
|
-
"browserOpenExternal": string;
|
|
683
|
-
}
|
|
684
680
|
interface HTMLAiInChatBrowserElement extends Components.AiInChatBrowser, HTMLStencilElement {
|
|
685
|
-
addEventListener<K extends keyof HTMLAiInChatBrowserElementEventMap>(type: K, listener: (this: HTMLAiInChatBrowserElement, ev: AiInChatBrowserCustomEvent<HTMLAiInChatBrowserElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
686
|
-
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
687
|
-
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
688
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
689
|
-
removeEventListener<K extends keyof HTMLAiInChatBrowserElementEventMap>(type: K, listener: (this: HTMLAiInChatBrowserElement, ev: AiInChatBrowserCustomEvent<HTMLAiInChatBrowserElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
690
|
-
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
691
|
-
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
692
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
693
681
|
}
|
|
694
682
|
var HTMLAiInChatBrowserElement: {
|
|
695
683
|
prototype: HTMLAiInChatBrowserElement;
|
|
@@ -878,6 +866,11 @@ declare namespace LocalJSX {
|
|
|
878
866
|
* @default true
|
|
879
867
|
*/
|
|
880
868
|
"autoScroll"?: boolean;
|
|
869
|
+
/**
|
|
870
|
+
* Layout direction set by the host app. - `'rtl'` → valid docked position is `left`; cycle order: left ↔ float - `'ltr'` → valid docked position is `right`; cycle order: right ↔ float
|
|
871
|
+
* @default 'rtl'
|
|
872
|
+
*/
|
|
873
|
+
"direction"?: 'rtl' | 'ltr';
|
|
881
874
|
/**
|
|
882
875
|
* Show error state (e.g. failed to load conversation)
|
|
883
876
|
* @default false
|
|
@@ -903,15 +896,19 @@ declare namespace LocalJSX {
|
|
|
903
896
|
* @default false
|
|
904
897
|
*/
|
|
905
898
|
"loading"?: boolean;
|
|
899
|
+
/**
|
|
900
|
+
* Fired when the position changes (via cyclePosition or the header button)
|
|
901
|
+
*/
|
|
902
|
+
"onPositionChange"?: (event: AiChatContainerCustomEvent<ChatPosition>) => void;
|
|
906
903
|
/**
|
|
907
904
|
* Event emitted when the retry button is clicked
|
|
908
905
|
*/
|
|
909
906
|
"onRetryClick"?: (event: AiChatContainerCustomEvent<void>) => void;
|
|
910
907
|
/**
|
|
911
908
|
* Position of the panel: 'left', 'right', or 'float'
|
|
912
|
-
* @default '
|
|
909
|
+
* @default 'left'
|
|
913
910
|
*/
|
|
914
|
-
"position"?:
|
|
911
|
+
"position"?: ChatPosition;
|
|
915
912
|
/**
|
|
916
913
|
* Retry button label
|
|
917
914
|
* @default 'إعادة المحاولة'
|
|
@@ -969,10 +966,6 @@ declare namespace LocalJSX {
|
|
|
969
966
|
* @default false
|
|
970
967
|
*/
|
|
971
968
|
"conversationLoading"?: boolean;
|
|
972
|
-
/**
|
|
973
|
-
* @default false
|
|
974
|
-
*/
|
|
975
|
-
"isDraggable"?: boolean;
|
|
976
969
|
/**
|
|
977
970
|
* Layout variant
|
|
978
971
|
* @default 'agent'
|
|
@@ -998,20 +991,24 @@ declare namespace LocalJSX {
|
|
|
998
991
|
* Title / chevron click → open conversation list (agent mode)
|
|
999
992
|
*/
|
|
1000
993
|
"onDropdownClick"?: (event: AiChatHeaderCustomEvent<void>) => void;
|
|
1001
|
-
/**
|
|
1002
|
-
* Pencil-edit button (agent mode)
|
|
1003
|
-
*/
|
|
1004
|
-
"onEditClick"?: (event: AiChatHeaderCustomEvent<void>) => void;
|
|
1005
994
|
/**
|
|
1006
995
|
* Fired on pointerdown of the drag handle. Composed + bubbling so ai-chat-container can receive it across shadow roots.
|
|
1007
996
|
*/
|
|
1008
997
|
"onHeaderDragStart"?: (event: AiChatHeaderCustomEvent<{ clientX: number; clientY: number }>) => void;
|
|
998
|
+
/**
|
|
999
|
+
* Composed + bubbling event that ai-chat-container listens to internally to automatically cycle its position. Fires alongside positionClick.
|
|
1000
|
+
*/
|
|
1001
|
+
"onHeaderPositionClick"?: (event: AiChatHeaderCustomEvent<void>) => void;
|
|
1002
|
+
/**
|
|
1003
|
+
* Pencil-edit button (agent mode)
|
|
1004
|
+
*/
|
|
1005
|
+
"onNewChatClick"?: (event: AiChatHeaderCustomEvent<void>) => void;
|
|
1009
1006
|
/**
|
|
1010
1007
|
* Open-external button (browser mode)
|
|
1011
1008
|
*/
|
|
1012
1009
|
"onOpenExternal"?: (event: AiChatHeaderCustomEvent<string>) => void;
|
|
1013
1010
|
/**
|
|
1014
|
-
* More options button
|
|
1011
|
+
* More options button — also fires a composed event so ai-chat-container can auto-cycle position
|
|
1015
1012
|
*/
|
|
1016
1013
|
"onPositionClick"?: (event: AiChatHeaderCustomEvent<void>) => void;
|
|
1017
1014
|
/**
|
|
@@ -1152,20 +1149,7 @@ declare namespace LocalJSX {
|
|
|
1152
1149
|
}
|
|
1153
1150
|
interface AiInChatBrowser {
|
|
1154
1151
|
/**
|
|
1155
|
-
*
|
|
1156
|
-
* @default false
|
|
1157
|
-
*/
|
|
1158
|
-
"isDraggable"?: boolean;
|
|
1159
|
-
/**
|
|
1160
|
-
* Fired when the user clicks the back / close button to dismiss the browser
|
|
1161
|
-
*/
|
|
1162
|
-
"onBrowserClose"?: (event: AiInChatBrowserCustomEvent<void>) => void;
|
|
1163
|
-
/**
|
|
1164
|
-
* Fired when the user clicks the external-link button
|
|
1165
|
-
*/
|
|
1166
|
-
"onBrowserOpenExternal"?: (event: AiInChatBrowserCustomEvent<string>) => void;
|
|
1167
|
-
/**
|
|
1168
|
-
* Page title shown in the browser header. Defaults to the URL hostname when empty.
|
|
1152
|
+
* Page title used as the iframe's accessible title. Defaults to the URL hostname when empty.
|
|
1169
1153
|
* @default ''
|
|
1170
1154
|
*/
|
|
1171
1155
|
"pageTitle"?: string;
|
|
@@ -1405,7 +1389,7 @@ declare namespace LocalJSX {
|
|
|
1405
1389
|
}
|
|
1406
1390
|
interface AiChatContainerAttributes {
|
|
1407
1391
|
"isOpen": boolean;
|
|
1408
|
-
"position":
|
|
1392
|
+
"position": ChatPosition;
|
|
1409
1393
|
"width": string;
|
|
1410
1394
|
"autoScroll": boolean;
|
|
1411
1395
|
"showWatermark": boolean;
|
|
@@ -1415,6 +1399,7 @@ declare namespace LocalJSX {
|
|
|
1415
1399
|
"error": boolean;
|
|
1416
1400
|
"errorText": string;
|
|
1417
1401
|
"retryLabel": string;
|
|
1402
|
+
"direction": 'rtl' | 'ltr';
|
|
1418
1403
|
}
|
|
1419
1404
|
interface AiChatHeaderAttributes {
|
|
1420
1405
|
"mode": 'agent' | 'human' | 'browser';
|
|
@@ -1423,7 +1408,6 @@ declare namespace LocalJSX {
|
|
|
1423
1408
|
"agentStatus": string;
|
|
1424
1409
|
"agentAvatar": string;
|
|
1425
1410
|
"showBack": boolean;
|
|
1426
|
-
"isDraggable": boolean;
|
|
1427
1411
|
"statusIndicator": 'online' | 'offline' | 'busy' | 'away';
|
|
1428
1412
|
"pageTitle": string;
|
|
1429
1413
|
"pageUrl": string;
|
|
@@ -1462,7 +1446,6 @@ declare namespace LocalJSX {
|
|
|
1462
1446
|
interface AiInChatBrowserAttributes {
|
|
1463
1447
|
"url": string;
|
|
1464
1448
|
"pageTitle": string;
|
|
1465
|
-
"isDraggable": boolean;
|
|
1466
1449
|
}
|
|
1467
1450
|
interface AiLinkAttributes {
|
|
1468
1451
|
"label": string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,4 +10,5 @@
|
|
|
10
10
|
export { format } from './utils/utils';
|
|
11
11
|
export type * from './components.d.ts';
|
|
12
12
|
export type { LoadingStep } from './components/ai-loading/ai-loading';
|
|
13
|
+
export type { ChatPosition } from './components/ai-chat-container/ai-chat-container';
|
|
13
14
|
export type { IconName } from './utils/icon-registry';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as e,h as a,H as s}from"./p-
|
|
1
|
+
import{r as i,c as e,h as a,H as s}from"./p-VMEwYfaX.js";const t=class{constructor(a){i(this,a),this.suggestionClick=e(this,"suggestionClick")}label="";disabled=!1;suggestionClick;handleClick(){this.disabled||this.suggestionClick.emit(this.label)}render(){return a(s,{key:"510e649f8778e2298270d320f0555c4d960fb056"},a("button",{key:"a4ee17cbd432596804279d8a852635608125452a",class:{chip:!0,"chip--disabled":this.disabled},disabled:this.disabled,onClick:()=>this.handleClick()},a("span",{key:"cb2d97459b0dd6effe83bbfb81a0af9144759477",class:"chip__label"},this.label,a("slot",{key:"ce84f07883f24c216c45da9266af5160baea9cdc"}))))}};t.style=":host{--ai-suggestion-border:1px solid var(--ai-accent);--ai-suggestion-border-hover:1px solid var(--ai-accent);--ai-suggestion-radius:9999px;--ai-suggestion-padding:8px 12px;--ai-suggestion-gap:4px;--ai-suggestion-font-size:14px;--ai-suggestion-line-height:20px;display:inline-block}.chip{display:inline-flex;align-items:center;justify-content:center;gap:var(--ai-suggestion-gap);background:var(--ai-bg-card);border:var(--ai-suggestion-border);border-radius:var(--ai-suggestion-radius);padding:var(--ai-suggestion-padding);color:var(--ai-accent-dark);font-size:var(--ai-suggestion-font-size);font-weight:400;line-height:var(--ai-suggestion-line-height);font-family:inherit;white-space:nowrap;cursor:pointer;transition:background 0.15s ease, border-color 0.15s ease;outline:none;text-align:start}.chip:hover:not(:disabled){background:var(--ai-accent-bg);border:var(--ai-suggestion-border-hover)}.chip:active:not(:disabled){background:var(--ai-accent-bg)}.chip:focus-visible{outline:2px solid var(--ai-accent);outline-offset:2px}.chip--disabled,.chip:disabled{opacity:0.45;cursor:not-allowed;pointer-events:none}.chip__label{display:inline-flex;align-items:center;gap:var(--ai-suggestion-gap)}";export{t as ai_suggestion}
|