@hachther/akilio-widget 0.6.6 → 0.7.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.
@@ -1,4 +1,4 @@
1
- import type { AkilioAuthConfig, AkilioChatRequest, AkilioChatResponse, AkilioChatStreamHandlers, AkilioCommerceEvent, AkilioConversationResponse, AkilioFeedbackRating, AkilioMode, AkilioProjectConfig } from '../types';
1
+ import type { AkilioAuthConfig, AkilioChatRequest, AkilioChatResponse, AkilioChatStreamHandlers, AkilioCommerceEvent, AkilioContactRequest, AkilioContactRequestResponse, AkilioConversationResponse, AkilioFeedbackRating, AkilioMode, AkilioProjectConfig } from '../types';
2
2
  export interface AkilioClientOptions {
3
3
  apiBaseUrl: string;
4
4
  auth?: AkilioAuthConfig;
@@ -45,4 +45,5 @@ export declare class AkilioClient {
45
45
  ok: boolean;
46
46
  feedback_id: string;
47
47
  }>;
48
+ sendContactRequest(projectKey: string, subject: string | undefined, request: AkilioContactRequest): Promise<AkilioContactRequestResponse>;
48
49
  }
package/dist/style.css CHANGED
@@ -28,6 +28,7 @@
28
28
  }
29
29
 
30
30
  .akilio-launcher,
31
+ .akilio-contextual-prompt,
31
32
  .akilio-overlay,
32
33
  .akilio-panel {
33
34
  pointer-events: auto;
@@ -124,6 +125,173 @@
124
125
  letter-spacing: -0.01em;
125
126
  }
126
127
 
128
+ .akilio-contextual-prompt {
129
+ position: fixed;
130
+ left: 50%;
131
+ bottom: max(28px, env(safe-area-inset-bottom));
132
+ z-index: calc(var(--akilio-z-index) - 5);
133
+ width: min(640px, calc(100vw - 190px));
134
+ transform: translateX(-50%);
135
+ border: 1px solid color-mix(in srgb, var(--akilio-primary) 22%, #d4d4d8);
136
+ border-radius: 18px;
137
+ background: rgba(255, 255, 255, 0.97);
138
+ padding: 7px 42px 7px 8px;
139
+ box-shadow:
140
+ 0 20px 60px rgba(15, 23, 42, 0.2),
141
+ 0 0 0 1px rgba(15, 118, 110, 0.04);
142
+ backdrop-filter: blur(16px);
143
+ animation: akilio-contextual-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
144
+ }
145
+
146
+ .akilio-contextual-prompt form {
147
+ display: flex;
148
+ align-items: center;
149
+ gap: 8px;
150
+ }
151
+
152
+ .akilio-contextual-prompt input {
153
+ width: 100%;
154
+ min-width: 0;
155
+ height: 42px;
156
+ border: 0;
157
+ outline: 0;
158
+ background: transparent;
159
+ color: #18181b;
160
+ padding: 0 8px;
161
+ font-size: 14px;
162
+ }
163
+
164
+ .akilio-contextual-prompt input::placeholder {
165
+ color: #71717a;
166
+ opacity: 1;
167
+ }
168
+
169
+ .akilio-root .akilio-contextual-prompt input:focus,
170
+ .akilio-root .akilio-contextual-prompt input:focus-visible {
171
+ border: 0;
172
+ outline: none;
173
+ box-shadow: none;
174
+ }
175
+
176
+ .akilio-contextual-prompt:focus-within {
177
+ border-color: color-mix(in srgb, var(--akilio-primary) 58%, #d4d4d8);
178
+ box-shadow:
179
+ 0 20px 60px rgba(15, 23, 42, 0.2),
180
+ 0 0 0 3px color-mix(in srgb, var(--akilio-primary) 15%, transparent);
181
+ }
182
+
183
+ .akilio-contextual-submit {
184
+ display: grid;
185
+ flex: 0 0 34px;
186
+ width: 34px;
187
+ height: 34px;
188
+ place-items: center;
189
+ border: 0;
190
+ border-radius: 999px;
191
+ background: var(--akilio-primary);
192
+ color: var(--akilio-primary-foreground);
193
+ cursor: pointer;
194
+ }
195
+
196
+ .akilio-contextual-submit:hover:not(:disabled) {
197
+ background: var(--akilio-primary-hover);
198
+ }
199
+
200
+ .akilio-contextual-submit:disabled {
201
+ cursor: not-allowed;
202
+ opacity: 0.45;
203
+ }
204
+
205
+ .akilio-contextual-submit svg {
206
+ width: 17px;
207
+ height: 17px;
208
+ }
209
+
210
+ .akilio-contextual-dismiss {
211
+ position: absolute;
212
+ top: 50%;
213
+ right: 8px;
214
+ display: grid;
215
+ width: 28px;
216
+ height: 28px;
217
+ transform: translateY(-50%);
218
+ place-items: center;
219
+ border: 0;
220
+ border-radius: 999px;
221
+ background: transparent;
222
+ color: #71717a;
223
+ cursor: pointer;
224
+ font-size: 20px;
225
+ line-height: 1;
226
+ }
227
+
228
+ .akilio-contextual-dismiss:hover {
229
+ background: #f4f4f5;
230
+ color: #18181b;
231
+ }
232
+
233
+ @keyframes akilio-contextual-in {
234
+ from {
235
+ transform: translate(-50%, 12px) scale(0.98);
236
+ opacity: 0;
237
+ }
238
+ to {
239
+ transform: translate(-50%, 0) scale(1);
240
+ opacity: 1;
241
+ }
242
+ }
243
+
244
+ /* Optional edge tab launcher. The desktop widget becomes a full-height drawer;
245
+ the mobile media rules below restore the compact bottom launcher. */
246
+ .akilio-root[data-akilio-launcher-position='bottom-left'] .akilio-launcher {
247
+ right: auto;
248
+ left: 22px;
249
+ }
250
+
251
+ .akilio-root[data-akilio-launcher-position='right-middle'] .akilio-launcher {
252
+ top: 50%;
253
+ right: 0;
254
+ bottom: auto;
255
+ min-width: 52px;
256
+ min-height: 164px;
257
+ flex-direction: column;
258
+ justify-content: center;
259
+ gap: 9px;
260
+ transform: translateY(-50%);
261
+ border-right: 0;
262
+ border-radius: 18px 0 0 18px;
263
+ padding: 13px 10px 15px;
264
+ }
265
+
266
+ .akilio-root[data-akilio-launcher-position='right-middle']
267
+ .akilio-launcher:hover {
268
+ transform: translate(-3px, -50%);
269
+ }
270
+
271
+ .akilio-root[data-akilio-launcher-position='right-middle']
272
+ .akilio-launcher
273
+ strong {
274
+ writing-mode: vertical-rl;
275
+ transform: rotate(180deg);
276
+ letter-spacing: 0.02em;
277
+ }
278
+
279
+ .akilio-root[data-akilio-launcher-position='right-middle'] .akilio-coachmark {
280
+ top: 50%;
281
+ right: 72px;
282
+ bottom: auto;
283
+ transform: translateY(-50%);
284
+ animation: akilio-coachmark-side-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
285
+ }
286
+
287
+ .akilio-root[data-akilio-launcher-position='right-middle']
288
+ .akilio-coachmark::after {
289
+ top: 50%;
290
+ right: -7px;
291
+ bottom: auto;
292
+ transform: translateY(-50%) rotate(-45deg);
293
+ }
294
+
127
295
  .akilio-overlay {
128
296
  position: fixed;
129
297
  inset: 0;
@@ -185,6 +353,13 @@
185
353
  pointer-events: auto;
186
354
  }
187
355
 
356
+ .akilio-root[data-akilio-mode='floating'][data-akilio-launcher-position='bottom-left']
357
+ .akilio-panel {
358
+ right: auto;
359
+ left: 22px;
360
+ transform-origin: left bottom;
361
+ }
362
+
188
363
  .akilio-panel-glow {
189
364
  position: absolute;
190
365
  inset: 0 0 auto 0;
@@ -457,7 +632,7 @@
457
632
  .akilio-bubble-meta {
458
633
  display: flex;
459
634
  align-items: center;
460
- gap: 7px;
635
+ gap: 5px;
461
636
  margin-bottom: 8px;
462
637
  color: var(--akilio-primary);
463
638
  font-size: 10px;
@@ -663,6 +838,33 @@
663
838
  color: var(--akilio-primary);
664
839
  }
665
840
 
841
+ .akilio-feedback button:disabled {
842
+ cursor: wait;
843
+ opacity: 0.62;
844
+ }
845
+
846
+ .akilio-feedback .akilio-feedback-pending {
847
+ border-color: color-mix(in srgb, var(--akilio-primary) 35%, #d4d4d8);
848
+ color: var(--akilio-primary);
849
+ opacity: 1;
850
+ }
851
+
852
+ .akilio-feedback-spinner {
853
+ display: block;
854
+ width: 13px;
855
+ height: 13px;
856
+ border: 2px solid color-mix(in srgb, var(--akilio-primary) 24%, transparent);
857
+ border-top-color: currentColor;
858
+ border-radius: 999px;
859
+ animation: akilio-feedback-spin 650ms linear infinite;
860
+ }
861
+
862
+ @keyframes akilio-feedback-spin {
863
+ to {
864
+ transform: rotate(360deg);
865
+ }
866
+ }
867
+
666
868
  .akilio-feedback svg {
667
869
  width: 14px;
668
870
  height: 14px;
@@ -883,6 +1085,11 @@
883
1085
  text-align: center;
884
1086
  }
885
1087
 
1088
+ .akilio-powered-by a {
1089
+ text-decoration: none;
1090
+ font-weight: 700;
1091
+ }
1092
+
886
1093
  .akilio-coachmark {
887
1094
  position: fixed;
888
1095
  right: 22px;
@@ -998,7 +1205,109 @@
998
1205
  }
999
1206
  }
1000
1207
 
1208
+ @keyframes akilio-coachmark-side-in {
1209
+ from {
1210
+ transform: translate(8px, -50%) scale(0.98);
1211
+ opacity: 0;
1212
+ }
1213
+ to {
1214
+ transform: translate(0, -50%) scale(1);
1215
+ opacity: 1;
1216
+ }
1217
+ }
1218
+
1219
+ @media (max-width: 1279px) {
1220
+ .akilio-root[data-akilio-launcher-position='right-middle'] .akilio-launcher {
1221
+ top: auto;
1222
+ right: 22px;
1223
+ bottom: 22px;
1224
+ min-width: 0;
1225
+ min-height: 0;
1226
+ flex-direction: row;
1227
+ transform: none;
1228
+ border-right: 1px solid rgba(255, 255, 255, 0.22);
1229
+ border-radius: 999px;
1230
+ padding: 11px 16px 11px 12px;
1231
+ }
1232
+
1233
+ .akilio-root[data-akilio-launcher-position='right-middle']
1234
+ .akilio-launcher:hover {
1235
+ transform: translateY(-2px);
1236
+ }
1237
+
1238
+ .akilio-root[data-akilio-launcher-position='right-middle']
1239
+ .akilio-launcher
1240
+ strong {
1241
+ writing-mode: initial;
1242
+ transform: none;
1243
+ }
1244
+
1245
+ .akilio-root[data-akilio-launcher-position='right-middle']
1246
+ .akilio-coachmark {
1247
+ top: auto;
1248
+ right: 22px;
1249
+ bottom: 94px;
1250
+ transform: none;
1251
+ animation: akilio-coachmark-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
1252
+ }
1253
+
1254
+ .akilio-root[data-akilio-launcher-position='right-middle']
1255
+ .akilio-coachmark::after {
1256
+ top: auto;
1257
+ right: 30px;
1258
+ bottom: -7px;
1259
+ transform: rotate(45deg);
1260
+ }
1261
+ }
1262
+
1001
1263
  @media (max-width: 640px) {
1264
+ .akilio-contextual-prompt {
1265
+ bottom: calc(78px + env(safe-area-inset-bottom));
1266
+ width: calc(100vw - 28px);
1267
+ padding-left: 6px;
1268
+ }
1269
+
1270
+ .akilio-root[data-akilio-launcher-position='right-middle'] .akilio-launcher {
1271
+ top: auto;
1272
+ right: 16px;
1273
+ bottom: 16px;
1274
+ left: auto;
1275
+ min-width: 0;
1276
+ min-height: 0;
1277
+ flex-direction: row;
1278
+ transform: none;
1279
+ border-right: 1px solid rgba(255, 255, 255, 0.22);
1280
+ border-radius: 999px;
1281
+ }
1282
+
1283
+ .akilio-root[data-akilio-launcher-position='right-middle']
1284
+ .akilio-launcher:hover {
1285
+ transform: translateY(-2px);
1286
+ }
1287
+
1288
+ .akilio-root[data-akilio-launcher-position='right-middle']
1289
+ .akilio-launcher
1290
+ strong {
1291
+ writing-mode: initial;
1292
+ transform: none;
1293
+ }
1294
+
1295
+ .akilio-root[data-akilio-launcher-position='right-middle']
1296
+ .akilio-coachmark {
1297
+ top: auto;
1298
+ right: 16px;
1299
+ bottom: 82px;
1300
+ animation: akilio-coachmark-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
1301
+ }
1302
+
1303
+ .akilio-root[data-akilio-launcher-position='right-middle']
1304
+ .akilio-coachmark::after {
1305
+ top: auto;
1306
+ right: 30px;
1307
+ bottom: -7px;
1308
+ transform: rotate(45deg);
1309
+ }
1310
+
1002
1311
  .akilio-launcher {
1003
1312
  right: 16px;
1004
1313
  bottom: 16px;
@@ -1221,6 +1530,10 @@
1221
1530
  }
1222
1531
 
1223
1532
  @media (max-width: 640px) {
1533
+ .akilio-root[data-akilio-launcher-position='bottom-left'] .akilio-launcher {
1534
+ right: auto;
1535
+ left: 14px;
1536
+ }
1224
1537
  .akilio-launcher {
1225
1538
  right: 14px;
1226
1539
  bottom: max(14px, env(safe-area-inset-bottom));
@@ -1243,6 +1556,11 @@
1243
1556
  border: 1px solid rgba(212, 212, 216, 0.9);
1244
1557
  border-radius: 18px;
1245
1558
  }
1559
+ .akilio-root[data-akilio-mode='floating'][data-akilio-launcher-position='bottom-left']
1560
+ .akilio-panel {
1561
+ right: auto;
1562
+ left: 14px;
1563
+ }
1246
1564
  .akilio-panel-header {
1247
1565
  padding-top: max(10px, env(safe-area-inset-top));
1248
1566
  }
@@ -1297,6 +1615,43 @@
1297
1615
  color: #fafafa;
1298
1616
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
1299
1617
  }
1618
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contextual-prompt {
1619
+ border-color: color-mix(in srgb, var(--akilio-primary) 34%, #3f3f46);
1620
+ background: rgba(24, 24, 27, 0.97);
1621
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
1622
+ }
1623
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contextual-prompt input {
1624
+ color: #fafafa;
1625
+ }
1626
+ .akilio-root[data-akilio-color-mode='dark']
1627
+ .akilio-contextual-prompt
1628
+ input::placeholder {
1629
+ color: #a1a1aa;
1630
+ }
1631
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contextual-dismiss {
1632
+ color: #a1a1aa;
1633
+ }
1634
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contextual-dismiss:hover {
1635
+ background: #27272a;
1636
+ color: #fafafa;
1637
+ }
1638
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contact-options a,
1639
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contact-form {
1640
+ border-color: #3f3f46;
1641
+ background: #18181b;
1642
+ color: #e4e4e7;
1643
+ }
1644
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contact-options span,
1645
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contact-form label {
1646
+ color: #a1a1aa;
1647
+ }
1648
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contact-form input,
1649
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contact-form select,
1650
+ .akilio-root[data-akilio-color-mode='dark'] .akilio-contact-form textarea {
1651
+ border-color: #52525b;
1652
+ background-color: #27272a;
1653
+ color: #fafafa;
1654
+ }
1300
1655
  .akilio-root[data-akilio-color-mode='dark'] .akilio-coachmark::after {
1301
1656
  border-color: color-mix(in srgb, var(--akilio-primary) 34%, #3f3f46);
1302
1657
  background: #18181b;
@@ -1357,6 +1712,178 @@
1357
1712
  padding: 0;
1358
1713
  }
1359
1714
 
1715
+ .akilio-contact {
1716
+ display: grid;
1717
+ gap: 9px;
1718
+ margin-top: 12px;
1719
+ }
1720
+ .akilio-contact-options {
1721
+ display: grid;
1722
+ grid-auto-rows: 1fr;
1723
+ gap: 7px;
1724
+ }
1725
+ .akilio-contact-options a {
1726
+ display: flex;
1727
+ min-height: 54px;
1728
+ flex-direction: column;
1729
+ align-items: stretch;
1730
+ justify-content: flex-start;
1731
+ gap: 4px;
1732
+ border: 1px solid #e2e8f0;
1733
+ border-radius: 10px;
1734
+ background: #fff;
1735
+ color: #334155;
1736
+ padding: 7px 9px;
1737
+ text-decoration: none;
1738
+ }
1739
+ .akilio-contact-options strong {
1740
+ align-self: flex-start;
1741
+ font-size: 11px;
1742
+ line-height: 1.25;
1743
+ text-align: left;
1744
+ }
1745
+ .akilio-contact-options a:hover {
1746
+ border-color: color-mix(in srgb, var(--akilio-primary) 40%, #e2e8f0);
1747
+ color: var(--akilio-primary);
1748
+ }
1749
+ .akilio-contact-options span {
1750
+ align-self: flex-end;
1751
+ max-width: 100%;
1752
+ margin-top: auto;
1753
+ overflow: hidden;
1754
+ color: #64748b;
1755
+ font-size: 10px;
1756
+ line-height: 1.2;
1757
+ text-align: right;
1758
+ text-overflow: ellipsis;
1759
+ white-space: nowrap;
1760
+ }
1761
+ .akilio-contact-start,
1762
+ .akilio-contact-submit {
1763
+ justify-self: start;
1764
+ border: 0;
1765
+ border-radius: 999px;
1766
+ background: var(--akilio-primary);
1767
+ color: var(--akilio-primary-foreground) !important;
1768
+ padding: 8px 13px;
1769
+ cursor: pointer;
1770
+ font-size: 12px;
1771
+ font-weight: 700;
1772
+ }
1773
+ .akilio-contact-start:hover,
1774
+ .akilio-contact-submit:hover:not(:disabled) {
1775
+ background: var(--akilio-primary-hover);
1776
+ }
1777
+ .akilio-contact-form {
1778
+ display: grid;
1779
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1780
+ gap: 9px;
1781
+ border: 1px solid #e2e8f0;
1782
+ border-radius: 14px;
1783
+ background: #fff;
1784
+ padding: 12px;
1785
+ }
1786
+ .akilio-contact-form label {
1787
+ display: grid;
1788
+ gap: 4px;
1789
+ color: #475569;
1790
+ font-size: 11px;
1791
+ font-weight: 650;
1792
+ }
1793
+ .akilio-contact-form label > span {
1794
+ overflow: hidden;
1795
+ text-overflow: ellipsis;
1796
+ white-space: nowrap;
1797
+ }
1798
+ .akilio-contact-name,
1799
+ .akilio-contact-message,
1800
+ .akilio-contact-consent,
1801
+ .akilio-contact-error,
1802
+ .akilio-contact-submit {
1803
+ grid-column: 1 / -1;
1804
+ }
1805
+ .akilio-contact-form input,
1806
+ .akilio-contact-form select,
1807
+ .akilio-contact-form textarea {
1808
+ width: 100%;
1809
+ min-width: 0;
1810
+ border: 1px solid #d4d4d8;
1811
+ border-radius: 9px;
1812
+ background: #fff;
1813
+ color: #18181b;
1814
+ padding: 8px 9px;
1815
+ outline: 0;
1816
+ font-size: 12px;
1817
+ }
1818
+ .akilio-contact-form input:not([type='checkbox']),
1819
+ .akilio-contact-form select {
1820
+ height: 36px;
1821
+ }
1822
+ .akilio-contact-form select {
1823
+ appearance: none;
1824
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath d='m5 7.5 5 5 5-5' fill='none' stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E");
1825
+ background-position: right 9px center;
1826
+ background-repeat: no-repeat;
1827
+ padding-right: 28px;
1828
+ }
1829
+ .akilio-contact-form textarea {
1830
+ resize: vertical;
1831
+ }
1832
+ .akilio-contact-form input:focus,
1833
+ .akilio-contact-form select:focus,
1834
+ .akilio-contact-form textarea:focus {
1835
+ border-color: var(--akilio-primary);
1836
+ box-shadow: 0 0 0 2px
1837
+ color-mix(in srgb, var(--akilio-primary) 14%, transparent);
1838
+ }
1839
+ .akilio-root .akilio-contact-form input:not([type='checkbox']):focus,
1840
+ .akilio-root .akilio-contact-form input:not([type='checkbox']):focus-visible,
1841
+ .akilio-root .akilio-contact-form select:focus,
1842
+ .akilio-root .akilio-contact-form select:focus-visible,
1843
+ .akilio-root .akilio-contact-form textarea:focus,
1844
+ .akilio-root .akilio-contact-form textarea:focus-visible {
1845
+ outline: none;
1846
+ }
1847
+ .akilio-contact-form .akilio-contact-consent {
1848
+ display: flex;
1849
+ grid-template-columns: none;
1850
+ align-items: flex-start;
1851
+ gap: 7px;
1852
+ font-weight: 500;
1853
+ }
1854
+ .akilio-contact-form .akilio-contact-consent > span {
1855
+ overflow: visible;
1856
+ text-overflow: clip;
1857
+ white-space: normal;
1858
+ }
1859
+ .akilio-contact-consent input {
1860
+ width: 15px;
1861
+ margin-top: 1px;
1862
+ accent-color: var(--akilio-primary);
1863
+ }
1864
+ .akilio-contact-submit:disabled {
1865
+ cursor: wait;
1866
+ opacity: 0.55;
1867
+ }
1868
+ .akilio-contact-success,
1869
+ .akilio-contact-error {
1870
+ margin: 0;
1871
+ font-size: 12px;
1872
+ font-weight: 650;
1873
+ }
1874
+ .akilio-contact-success {
1875
+ color: #047857;
1876
+ }
1877
+ .akilio-contact-error {
1878
+ color: #b91c1c;
1879
+ }
1880
+
1881
+ @media (max-width: 640px) {
1882
+ .akilio-contact-form {
1883
+ grid-template-columns: 1fr;
1884
+ }
1885
+ }
1886
+
1360
1887
  /* Commerce product results */
1361
1888
  .akilio-products {
1362
1889
  margin-top: 14px;