@salla.sa/ui-ai-kit-core 1.1.0 → 2.0.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-card.cjs.entry.js +2 -2
- package/dist/cjs/ai-chat-container.cjs.entry.js +84 -57
- package/dist/cjs/ai-chat-header.cjs.entry.js +29 -19
- package/dist/cjs/ai-chat-message.cjs.entry.js +1456 -21
- package/dist/cjs/ai-conversation-list.cjs.entry.js +80 -0
- package/dist/cjs/ai-conversation-summary.cjs.entry.js +33 -0
- package/dist/cjs/ai-icon.cjs.entry.js +2 -2
- package/dist/cjs/ai-link.cjs.entry.js +4 -4
- package/dist/cjs/ai-loading.cjs.entry.js +35 -22
- package/dist/cjs/ai-message-input.cjs.entry.js +48 -15
- package/dist/cjs/ai-rating.cjs.entry.js +2 -2
- package/dist/cjs/ai-route-decision.cjs.entry.js +48 -0
- package/dist/cjs/ai-suggestion.cjs.entry.js +4 -4
- package/dist/cjs/ai-voice-input.cjs.entry.js +75 -21
- package/dist/cjs/{icon-registry-dmfLA-Dj.js → icon-registry-BKb9-2Nt.js} +24 -0
- package/dist/cjs/{index-DLJcLHFH.js → index-BkNg07SW.js} +1 -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 +3 -0
- package/dist/collection/components/ai-card/ai-card.css +5 -8
- package/dist/collection/components/ai-chat-container/ai-chat-container.css +17 -14
- package/dist/collection/components/ai-chat-container/ai-chat-container.js +125 -53
- package/dist/collection/components/ai-chat-header/ai-chat-header.css +50 -17
- package/dist/collection/components/ai-chat-header/ai-chat-header.js +53 -18
- package/dist/collection/components/ai-chat-message/ai-chat-message.css +47 -38
- package/dist/collection/components/ai-chat-message/ai-chat-message.js +68 -18
- package/dist/collection/components/ai-conversation-list/ai-conversation-list.css +196 -0
- package/dist/collection/components/ai-conversation-list/ai-conversation-list.js +176 -0
- package/dist/collection/components/ai-conversation-summary/ai-conversation-summary.css +103 -0
- package/dist/collection/components/ai-conversation-summary/ai-conversation-summary.js +118 -0
- package/dist/collection/components/ai-icon/ai-icon.js +1 -1
- package/dist/collection/components/ai-link/ai-link.css +3 -7
- package/dist/collection/components/ai-link/ai-link.js +1 -1
- package/dist/collection/components/ai-loading/ai-loading.css +149 -20
- package/dist/collection/components/ai-loading/ai-loading.js +100 -23
- package/dist/collection/components/ai-message-input/ai-message-input.css +41 -37
- package/dist/collection/components/ai-message-input/ai-message-input.js +100 -19
- package/dist/collection/components/ai-rating/ai-rating.css +8 -14
- package/dist/collection/components/ai-route-decision/ai-route-decision.css +132 -0
- package/dist/collection/components/ai-route-decision/ai-route-decision.js +195 -0
- package/dist/collection/components/ai-suggestion/ai-suggestion.css +5 -11
- package/dist/collection/components/ai-suggestion/ai-suggestion.js +2 -2
- package/dist/collection/components/ai-voice-input/ai-voice-input.css +27 -22
- package/dist/collection/components/ai-voice-input/ai-voice-input.js +116 -20
- package/dist/collection/utils/icon-registry.js +24 -0
- 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 -1
- package/dist/components/ai-conversation-list.d.ts +11 -0
- package/dist/components/ai-conversation-list.js +1 -0
- package/dist/components/ai-conversation-summary.d.ts +11 -0
- package/dist/components/ai-conversation-summary.js +1 -0
- package/dist/components/ai-icon.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.d.ts +11 -0
- package/dist/components/ai-route-decision.js +1 -0
- 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-CX1Yp79q.js +1 -0
- package/dist/components/p-DnO4dikr.js +1 -0
- package/dist/components/{p-CY6emva2.js → p-Dr2tAPV7.js} +1 -1
- package/dist/{ui-ai-kit/p-DYv5ef4M.js → components/p-SJZ6Ujn9.js} +1 -1
- package/dist/esm/ai-card.entry.js +2 -2
- package/dist/esm/ai-chat-container.entry.js +84 -57
- package/dist/esm/ai-chat-header.entry.js +29 -19
- package/dist/esm/ai-chat-message.entry.js +1456 -21
- package/dist/esm/ai-conversation-list.entry.js +78 -0
- package/dist/esm/ai-conversation-summary.entry.js +31 -0
- package/dist/esm/ai-icon.entry.js +2 -2
- package/dist/esm/ai-link.entry.js +4 -4
- package/dist/esm/ai-loading.entry.js +35 -22
- package/dist/esm/ai-message-input.entry.js +48 -15
- package/dist/esm/ai-rating.entry.js +2 -2
- package/dist/esm/ai-route-decision.entry.js +46 -0
- package/dist/esm/ai-suggestion.entry.js +4 -4
- package/dist/esm/ai-voice-input.entry.js +75 -21
- package/dist/esm/{icon-registry-DYv5ef4M.js → icon-registry-SJZ6Ujn9.js} +24 -0
- package/dist/esm/{index-7hrZ8FOQ.js → index-B0yIzgh4.js} +1 -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 +11 -1
- package/dist/types/components/ai-chat-header/ai-chat-header.d.ts +7 -2
- package/dist/types/components/ai-conversation-list/ai-conversation-list.d.ts +24 -0
- package/dist/types/components/ai-conversation-summary/ai-conversation-summary.d.ts +12 -0
- package/dist/types/components/ai-loading/ai-loading.d.ts +12 -6
- package/dist/types/components/ai-message-input/ai-message-input.d.ts +17 -3
- package/dist/types/components/ai-route-decision/ai-route-decision.d.ts +21 -0
- package/dist/types/components/ai-voice-input/ai-voice-input.d.ts +7 -0
- package/dist/types/components.d.ts +335 -11
- package/dist/types/index.d.ts +2 -0
- package/dist/types/utils/icon-registry.d.ts +1 -1
- package/dist/ui-ai-kit/p-2955439f.entry.js +1 -0
- package/dist/ui-ai-kit/p-5c9e9822.entry.js +1 -0
- package/dist/ui-ai-kit/p-5caf1c38.entry.js +1 -0
- package/dist/ui-ai-kit/p-74c5c83f.entry.js +1 -0
- package/dist/ui-ai-kit/p-76195745.entry.js +1 -0
- package/dist/ui-ai-kit/p-79c78d8e.entry.js +1 -0
- package/dist/ui-ai-kit/p-87e9739b.entry.js +1 -0
- package/dist/ui-ai-kit/p-9c4c6c01.entry.js +1 -0
- package/dist/ui-ai-kit/p-B0yIzgh4.js +2 -0
- package/dist/{components/p-DYv5ef4M.js → ui-ai-kit/p-SJZ6Ujn9.js} +1 -1
- package/dist/ui-ai-kit/p-a099fcfb.entry.js +1 -0
- package/dist/ui-ai-kit/p-b28af13a.entry.js +1 -0
- package/dist/ui-ai-kit/p-d1bb1ad0.entry.js +1 -0
- package/dist/ui-ai-kit/p-eb0c7e7a.entry.js +1 -0
- package/dist/ui-ai-kit/{p-455daa17.entry.js → p-eec6f083.entry.js} +1 -1
- package/dist/ui-ai-kit/p-ef07638f.entry.js +2 -0
- 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 +5 -13
- package/dist/collection/components/ai-card/ai-card.stories.js +0 -52
- package/dist/collection/components/ai-chat-container/ai-chat-container.stories.js +0 -160
- package/dist/collection/components/ai-chat-header/ai-chat-header.stories.js +0 -138
- package/dist/collection/components/ai-chat-message/ai-chat-message.stories.js +0 -164
- package/dist/collection/components/ai-link/ai-link.stories.js +0 -79
- package/dist/collection/components/ai-loading/ai-loading.stories.js +0 -145
- package/dist/collection/components/ai-message-input/ai-message-input.stories.js +0 -125
- package/dist/collection/components/ai-rating/ai-rating.stories.js +0 -78
- package/dist/collection/components/ai-suggestion/ai-suggestion.stories.js +0 -62
- package/dist/collection/components/ai-voice-input/ai-voice-input.stories.js +0 -118
- package/dist/components/p-CWjXxYJI.js +0 -1
- package/dist/types/components/ai-card/ai-card.stories.d.ts +0 -7
- package/dist/types/components/ai-chat-container/ai-chat-container.stories.d.ts +0 -7
- package/dist/types/components/ai-chat-header/ai-chat-header.stories.d.ts +0 -8
- package/dist/types/components/ai-chat-message/ai-chat-message.stories.d.ts +0 -10
- package/dist/types/components/ai-link/ai-link.stories.d.ts +0 -8
- package/dist/types/components/ai-loading/ai-loading.stories.d.ts +0 -10
- package/dist/types/components/ai-message-input/ai-message-input.stories.d.ts +0 -13
- package/dist/types/components/ai-rating/ai-rating.stories.d.ts +0 -8
- package/dist/types/components/ai-suggestion/ai-suggestion.stories.d.ts +0 -8
- package/dist/types/components/ai-voice-input/ai-voice-input.stories.d.ts +0 -9
- package/dist/ui-ai-kit/p-11facfad.entry.js +0 -1
- package/dist/ui-ai-kit/p-128a2ed4.entry.js +0 -1
- package/dist/ui-ai-kit/p-227bdb8f.entry.js +0 -1
- package/dist/ui-ai-kit/p-56163e8c.entry.js +0 -1
- package/dist/ui-ai-kit/p-6d21d0fd.entry.js +0 -1
- package/dist/ui-ai-kit/p-6ddcd77b.entry.js +0 -1
- package/dist/ui-ai-kit/p-7hrZ8FOQ.js +0 -2
- package/dist/ui-ai-kit/p-8e90143e.entry.js +0 -1
- package/dist/ui-ai-kit/p-9938c277.entry.js +0 -1
- package/dist/ui-ai-kit/p-dc5b4a7f.entry.js +0 -1
- package/dist/ui-ai-kit/p-fb1702de.entry.js +0 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { iconRegistry } from "../../utils/icon-registry";
|
|
3
|
+
export class AiConversationList {
|
|
4
|
+
/** JSON array of ConversationItem */
|
|
5
|
+
items = '[]';
|
|
6
|
+
/** ID of the currently active conversation */
|
|
7
|
+
activeId = '';
|
|
8
|
+
/** Show skeleton loading state */
|
|
9
|
+
loading = false;
|
|
10
|
+
conversationSelect;
|
|
11
|
+
conversationDelete;
|
|
12
|
+
renderIcon(name, width, height) {
|
|
13
|
+
const icon = iconRegistry[name];
|
|
14
|
+
if (!icon)
|
|
15
|
+
return null;
|
|
16
|
+
const svg = `<svg width="${width}" height="${height}" viewBox="${icon.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${icon.content}</svg>`;
|
|
17
|
+
return h("span", { class: "icon-wrap", innerHTML: svg });
|
|
18
|
+
}
|
|
19
|
+
getItems() {
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(this.items) || [];
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
formatRelativeTime(timestamp) {
|
|
28
|
+
try {
|
|
29
|
+
const date = new Date(timestamp);
|
|
30
|
+
const diffMs = Date.now() - date.getTime();
|
|
31
|
+
const diffMin = Math.floor(diffMs / 60000);
|
|
32
|
+
const diffHour = Math.floor(diffMin / 60);
|
|
33
|
+
const diffDay = Math.floor(diffHour / 24);
|
|
34
|
+
const lang = (typeof document !== 'undefined' && document.documentElement.lang) || 'ar';
|
|
35
|
+
const rtf = new Intl.RelativeTimeFormat(lang, { numeric: 'auto' });
|
|
36
|
+
if (diffMin < 1)
|
|
37
|
+
return rtf.format(0, 'second');
|
|
38
|
+
if (diffMin < 60)
|
|
39
|
+
return rtf.format(-diffMin, 'minute');
|
|
40
|
+
if (diffHour < 24)
|
|
41
|
+
return rtf.format(-diffHour, 'hour');
|
|
42
|
+
return rtf.format(-diffDay, 'day');
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
renderRatingDots(rating) {
|
|
49
|
+
const total = 5;
|
|
50
|
+
return (h("div", { class: "rating-dots", "aria-label": rating ? `تقييم ${rating} من 5` : undefined }, Array.from({ length: total }, (_, i) => (h("span", { class: `rating-dot ${i < (rating ?? 0) ? 'rating-dot--filled' : ''}` })))));
|
|
51
|
+
}
|
|
52
|
+
renderSkeleton() {
|
|
53
|
+
return (h("div", { class: "skeleton-list" }, [1, 2, 3, 4].map(i => (h("div", { key: i, class: "skeleton-item" }, h("div", { class: "skeleton-line skeleton-line--title" }), h("div", { class: "skeleton-line skeleton-line--preview" }), h("div", { class: "skeleton-line skeleton-line--meta" }))))));
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
const list = this.getItems();
|
|
57
|
+
return (h(Host, { key: '4baef00dae7b30e73168684fce1dc512c35e8855' }, h("div", { key: '4da38479ba7a29b4f8d95aca4f9c0644361eb486', class: "conversation-list" }, h("div", { key: '671e0f54f45ceae32ce4424c1aa4bc72eed851e0', class: "list-scroll", role: "list" }, this.loading
|
|
58
|
+
? this.renderSkeleton()
|
|
59
|
+
: list.map(item => {
|
|
60
|
+
const isActive = item.id === this.activeId;
|
|
61
|
+
return (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) }, h("div", { class: "conv-item__body" }, h("p", { class: "conv-item__title" }, item.title), h("p", { class: "conv-item__preview" }, item.preview), h("div", { class: "conv-item__meta" }, h("span", { class: "conv-item__time" }, this.formatRelativeTime(item.timestamp)), item.rating != null && this.renderRatingDots(item.rating))), h("button", { class: "delete-btn", "aria-label": "\u062D\u0630\u0641 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629", onClick: e => {
|
|
62
|
+
e.stopPropagation();
|
|
63
|
+
this.conversationDelete.emit(item.id);
|
|
64
|
+
} }, this.renderIcon('cancel', 14, 14))));
|
|
65
|
+
})))));
|
|
66
|
+
}
|
|
67
|
+
static get is() { return "ai-conversation-list"; }
|
|
68
|
+
static get encapsulation() { return "shadow"; }
|
|
69
|
+
static get originalStyleUrls() {
|
|
70
|
+
return {
|
|
71
|
+
"$": ["ai-conversation-list.css"]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
static get styleUrls() {
|
|
75
|
+
return {
|
|
76
|
+
"$": ["ai-conversation-list.css"]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
static get properties() {
|
|
80
|
+
return {
|
|
81
|
+
"items": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "string",
|
|
86
|
+
"resolved": "string",
|
|
87
|
+
"references": {}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "JSON array of ConversationItem"
|
|
94
|
+
},
|
|
95
|
+
"getter": false,
|
|
96
|
+
"setter": false,
|
|
97
|
+
"reflect": false,
|
|
98
|
+
"attribute": "items",
|
|
99
|
+
"defaultValue": "'[]'"
|
|
100
|
+
},
|
|
101
|
+
"activeId": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "string",
|
|
106
|
+
"resolved": "string",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": "ID of the currently active conversation"
|
|
114
|
+
},
|
|
115
|
+
"getter": false,
|
|
116
|
+
"setter": false,
|
|
117
|
+
"reflect": false,
|
|
118
|
+
"attribute": "active-id",
|
|
119
|
+
"defaultValue": "''"
|
|
120
|
+
},
|
|
121
|
+
"loading": {
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"mutable": false,
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "boolean",
|
|
126
|
+
"resolved": "boolean",
|
|
127
|
+
"references": {}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": false,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "Show skeleton loading state"
|
|
134
|
+
},
|
|
135
|
+
"getter": false,
|
|
136
|
+
"setter": false,
|
|
137
|
+
"reflect": false,
|
|
138
|
+
"attribute": "loading",
|
|
139
|
+
"defaultValue": "false"
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
static get events() {
|
|
144
|
+
return [{
|
|
145
|
+
"method": "conversationSelect",
|
|
146
|
+
"name": "conversationSelect",
|
|
147
|
+
"bubbles": true,
|
|
148
|
+
"cancelable": true,
|
|
149
|
+
"composed": true,
|
|
150
|
+
"docs": {
|
|
151
|
+
"tags": [],
|
|
152
|
+
"text": ""
|
|
153
|
+
},
|
|
154
|
+
"complexType": {
|
|
155
|
+
"original": "string",
|
|
156
|
+
"resolved": "string",
|
|
157
|
+
"references": {}
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
"method": "conversationDelete",
|
|
161
|
+
"name": "conversationDelete",
|
|
162
|
+
"bubbles": true,
|
|
163
|
+
"cancelable": true,
|
|
164
|
+
"composed": true,
|
|
165
|
+
"docs": {
|
|
166
|
+
"tags": [],
|
|
167
|
+
"text": ""
|
|
168
|
+
},
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "string",
|
|
171
|
+
"resolved": "string",
|
|
172
|
+
"references": {}
|
|
173
|
+
}
|
|
174
|
+
}];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* ── Icon wrapper ───────────────────────────────────────── */
|
|
6
|
+
.icon-wrap {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
line-height: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* ── Card shell ─────────────────────────────────────────── */
|
|
14
|
+
.summary-card {
|
|
15
|
+
background: var(--ai-bg-card);
|
|
16
|
+
border: 1px solid var(--ai-border-default);
|
|
17
|
+
border-radius: 16px;
|
|
18
|
+
box-shadow: var(--ai-shadow-sm);
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
animation: fade-in 0.3s ease;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes fade-in {
|
|
24
|
+
from { opacity: 0; transform: translateY(4px); }
|
|
25
|
+
to { opacity: 1; transform: translateY(0); }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* ── Header ─────────────────────────────────────────────── */
|
|
29
|
+
.summary-header {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: 8px;
|
|
33
|
+
padding: 14px 16px;
|
|
34
|
+
border-bottom: 1px solid var(--ai-border-default);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.sparkle-avatar {
|
|
38
|
+
width: 24px;
|
|
39
|
+
height: 24px;
|
|
40
|
+
border-radius: 9999px;
|
|
41
|
+
background: var(--ai-bg-surface);
|
|
42
|
+
box-shadow: var(--ai-shadow-inner);
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
color: var(--ai-amber);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.summary-title {
|
|
51
|
+
font-size: 15px;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
color: var(--ai-text-primary);
|
|
54
|
+
flex: 1;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
text-overflow: ellipsis;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* ── Badges ─────────────────────────────────────────────── */
|
|
61
|
+
.summary-badges {
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 6px;
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.badge {
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 3px;
|
|
72
|
+
font-size: 11px;
|
|
73
|
+
font-weight: 500;
|
|
74
|
+
color: var(--ai-accent-dark);
|
|
75
|
+
background: var(--ai-accent-bg);
|
|
76
|
+
padding: 2px 8px;
|
|
77
|
+
border-radius: 9999px;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.lang-badge {
|
|
82
|
+
color: var(--ai-text-secondary);
|
|
83
|
+
background: var(--ai-bg-surface);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* ── Summary body ───────────────────────────────────────── */
|
|
87
|
+
.summary-body {
|
|
88
|
+
margin: 0;
|
|
89
|
+
padding: 12px 16px;
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
color: var(--ai-text-secondary);
|
|
92
|
+
line-height: 1.6;
|
|
93
|
+
border-bottom: 1px solid var(--ai-border-default);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* ── Slot (ai-rating) ───────────────────────────────────── */
|
|
97
|
+
.summary-slot {
|
|
98
|
+
padding: 12px 16px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.summary-slot:empty {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { iconRegistry } from "../../utils/icon-registry";
|
|
3
|
+
export class AiConversationSummary {
|
|
4
|
+
/** Card heading */
|
|
5
|
+
conversation = 'ملخص المحادثة';
|
|
6
|
+
/** Summary body text */
|
|
7
|
+
summary = '';
|
|
8
|
+
/** Total message count shown as a badge */
|
|
9
|
+
messageCount = 0;
|
|
10
|
+
/** Conversation language label */
|
|
11
|
+
language = '';
|
|
12
|
+
renderIcon(name, width, height) {
|
|
13
|
+
const icon = iconRegistry[name];
|
|
14
|
+
if (!icon)
|
|
15
|
+
return null;
|
|
16
|
+
const svg = `<svg width="${width}" height="${height}" viewBox="${icon.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${icon.content}</svg>`;
|
|
17
|
+
return h("span", { class: "icon-wrap", innerHTML: svg });
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return (h(Host, { key: 'ba825419953fd661993da1d66225739ebef76d74' }, h("div", { key: 'fe04fdadafde04a068c26b312f806d072d8d1bf7', class: "summary-card" }, h("div", { key: '4f3ec735cb2ac9dcd6a2f9692e1e4969a39a0131', class: "summary-header" }, h("div", { key: '4ba618456b44073d8ac93d79c29818fb9252b822', class: "sparkle-avatar" }, this.renderIcon('sparkle', 14, 14)), h("span", { key: 'bf6d22cfc8c5fc40b0199f46b36fcaceca8dc944', class: "summary-title" }, this.conversation), h("div", { key: '2a96497dcaa02da9e6f8a2bdcd3ec9f0e2f78b57', class: "summary-badges" }, this.messageCount > 0 && (h("span", { key: '679c9d24f8d34fc0d5b4dfe0c7ef1f5564c7eff9', class: "badge" }, this.renderIcon('list', 12, 12), this.messageCount)), this.language && (h("span", { key: '8a0f13ed6d7ec584ed22c9316af2758cb1ea5b24', class: "badge lang-badge" }, this.language)))), this.summary && (h("p", { key: '5a51b1b00c35daf289690c526de3525c9de40f7e', class: "summary-body", ref: el => el && (el.textContent = this.summary) })), h("div", { key: 'ccbb381d21d7c3e6ac8ebddc4a9a3ed26e1aa874', class: "summary-slot" }, h("slot", { key: '58a86a50dcef6c5d2534e664d309c194eb5c89df' })))));
|
|
21
|
+
}
|
|
22
|
+
static get is() { return "ai-conversation-summary"; }
|
|
23
|
+
static get encapsulation() { return "shadow"; }
|
|
24
|
+
static get originalStyleUrls() {
|
|
25
|
+
return {
|
|
26
|
+
"$": ["ai-conversation-summary.css"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static get styleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["ai-conversation-summary.css"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get properties() {
|
|
35
|
+
return {
|
|
36
|
+
"conversation": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"mutable": false,
|
|
39
|
+
"complexType": {
|
|
40
|
+
"original": "string",
|
|
41
|
+
"resolved": "string",
|
|
42
|
+
"references": {}
|
|
43
|
+
},
|
|
44
|
+
"required": false,
|
|
45
|
+
"optional": false,
|
|
46
|
+
"docs": {
|
|
47
|
+
"tags": [],
|
|
48
|
+
"text": "Card heading"
|
|
49
|
+
},
|
|
50
|
+
"getter": false,
|
|
51
|
+
"setter": false,
|
|
52
|
+
"reflect": false,
|
|
53
|
+
"attribute": "conversation",
|
|
54
|
+
"defaultValue": "'\u0645\u0644\u062E\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629'"
|
|
55
|
+
},
|
|
56
|
+
"summary": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"mutable": false,
|
|
59
|
+
"complexType": {
|
|
60
|
+
"original": "string",
|
|
61
|
+
"resolved": "string",
|
|
62
|
+
"references": {}
|
|
63
|
+
},
|
|
64
|
+
"required": false,
|
|
65
|
+
"optional": false,
|
|
66
|
+
"docs": {
|
|
67
|
+
"tags": [],
|
|
68
|
+
"text": "Summary body text"
|
|
69
|
+
},
|
|
70
|
+
"getter": false,
|
|
71
|
+
"setter": false,
|
|
72
|
+
"reflect": false,
|
|
73
|
+
"attribute": "summary",
|
|
74
|
+
"defaultValue": "''"
|
|
75
|
+
},
|
|
76
|
+
"messageCount": {
|
|
77
|
+
"type": "number",
|
|
78
|
+
"mutable": false,
|
|
79
|
+
"complexType": {
|
|
80
|
+
"original": "number",
|
|
81
|
+
"resolved": "number",
|
|
82
|
+
"references": {}
|
|
83
|
+
},
|
|
84
|
+
"required": false,
|
|
85
|
+
"optional": false,
|
|
86
|
+
"docs": {
|
|
87
|
+
"tags": [],
|
|
88
|
+
"text": "Total message count shown as a badge"
|
|
89
|
+
},
|
|
90
|
+
"getter": false,
|
|
91
|
+
"setter": false,
|
|
92
|
+
"reflect": false,
|
|
93
|
+
"attribute": "message-count",
|
|
94
|
+
"defaultValue": "0"
|
|
95
|
+
},
|
|
96
|
+
"language": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "string",
|
|
101
|
+
"resolved": "string",
|
|
102
|
+
"references": {}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": false,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": "Conversation language label"
|
|
109
|
+
},
|
|
110
|
+
"getter": false,
|
|
111
|
+
"setter": false,
|
|
112
|
+
"reflect": false,
|
|
113
|
+
"attribute": "language",
|
|
114
|
+
"defaultValue": "''"
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -30,7 +30,7 @@ export class AiIcon {
|
|
|
30
30
|
"mutable": false,
|
|
31
31
|
"complexType": {
|
|
32
32
|
"original": "IconName",
|
|
33
|
-
"resolved": "\"arrow-right\" | \"arrow-up\" | \"cancel\" | \"check\" | \"chevron-down\" | \"copy\" | \"drag\" | \"eclipse\" | \"hand\" | \"mic\" | \"online-dot\" | \"pencil-edit\" | \"reload\" | \"send\" | \"share\" | \"sparkle\" | \"thumbs-down\" | \"thumbs-up\" | \"watermark\"",
|
|
33
|
+
"resolved": "\"arrow-right\" | \"arrow-up\" | \"cancel\" | \"check\" | \"check-circle\" | \"chevron-down\" | \"copy\" | \"drag\" | \"eclipse\" | \"ellipsis\" | \"hand\" | \"list\" | \"mic\" | \"online-dot\" | \"pencil-edit\" | \"reload\" | \"route\" | \"send\" | \"share\" | \"sparkle\" | \"thumbs-down\" | \"thumbs-up\" | \"warning\" | \"watermark\" | \"wifi-off\"",
|
|
34
34
|
"references": {
|
|
35
35
|
"IconName": {
|
|
36
36
|
"location": "import",
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/* ─── Custom Properties ──────────────────────────────────────────────────── */
|
|
2
2
|
:host {
|
|
3
|
-
--ai-link-color: var(--ai-accent-dark);
|
|
4
|
-
--ai-link-color-hover: var(--ai-accent-dark);
|
|
5
3
|
--ai-link-font-size: 14px;
|
|
6
4
|
--ai-link-font-weight: 700;
|
|
7
5
|
--ai-link-line-height: 20px;
|
|
@@ -11,8 +9,6 @@
|
|
|
11
9
|
display: flex;
|
|
12
10
|
align-items: center;
|
|
13
11
|
gap: var(--ai-link-gap);
|
|
14
|
-
direction: rtl;
|
|
15
|
-
font-family: var(--ai-font-family, 'PingARLT', sans-serif);
|
|
16
12
|
}
|
|
17
13
|
|
|
18
14
|
/* ─── Anchor ─────────────────────────────────────────────────────────────── */
|
|
@@ -21,7 +17,7 @@
|
|
|
21
17
|
align-items: center;
|
|
22
18
|
justify-content: flex-end;
|
|
23
19
|
gap: var(--ai-link-gap);
|
|
24
|
-
color: var(--ai-
|
|
20
|
+
color: var(--ai-accent-dark);
|
|
25
21
|
font-size: var(--ai-link-font-size);
|
|
26
22
|
font-weight: var(--ai-link-font-weight);
|
|
27
23
|
font-family: inherit;
|
|
@@ -34,7 +30,7 @@
|
|
|
34
30
|
}
|
|
35
31
|
|
|
36
32
|
.link:hover {
|
|
37
|
-
color: var(--ai-
|
|
33
|
+
color: var(--ai-accent-dark);
|
|
38
34
|
text-decoration: underline;
|
|
39
35
|
}
|
|
40
36
|
|
|
@@ -57,6 +53,6 @@
|
|
|
57
53
|
|
|
58
54
|
/* ─── Label ──────────────────────────────────────────────────────────────── */
|
|
59
55
|
.link__label {
|
|
60
|
-
color: var(--ai-
|
|
56
|
+
color: var(--ai-accent-dark);
|
|
61
57
|
font-weight: bold;
|
|
62
58
|
}
|
|
@@ -18,7 +18,7 @@ export class AiLink {
|
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
20
|
const rel = this.rel || (this.target === '_blank' ? 'noopener noreferrer' : undefined);
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: 'c35f0fd1f17170d32846ebf7066177ca3a6b68f1' }, h("span", { key: '34c01b7fa4122659ca01402c76a67dbca5878ffe', class: "link__label" }, this.label, h("slot", { key: 'd9dd28b4bfba8c1cb5e6f977262942daf504fdc8' })), h("a", { key: 'b4da5e53ee8df0b40417c0d0a80a9647ae0b93d2', class: "link", href: this.href, target: this.target, rel: rel }, this.renderShareIcon())));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "ai-link"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|