livechat 0.4.3 → 0.4.5
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/config/locales/livechat.ar.yml +2 -0
- data/config/locales/livechat.bg.yml +2 -0
- data/config/locales/livechat.bn.yml +2 -0
- data/config/locales/livechat.de.yml +2 -0
- data/config/locales/livechat.el.yml +2 -0
- data/config/locales/livechat.en.yml +2 -0
- data/config/locales/livechat.es.yml +2 -0
- data/config/locales/livechat.fr.yml +2 -0
- data/config/locales/livechat.hi.yml +2 -0
- data/config/locales/livechat.hr.yml +2 -0
- data/config/locales/livechat.id.yml +2 -0
- data/config/locales/livechat.it.yml +2 -0
- data/config/locales/livechat.ja.yml +2 -0
- data/config/locales/livechat.ko.yml +2 -0
- data/config/locales/livechat.lb.yml +2 -0
- data/config/locales/livechat.nl.yml +2 -0
- data/config/locales/livechat.pl.yml +2 -0
- data/config/locales/livechat.pt.yml +2 -0
- data/config/locales/livechat.ro.yml +2 -0
- data/config/locales/livechat.ru.yml +2 -0
- data/config/locales/livechat.th.yml +2 -0
- data/config/locales/livechat.tr.yml +2 -0
- data/config/locales/livechat.uk.yml +2 -0
- data/config/locales/livechat.ur.yml +2 -0
- data/config/locales/livechat.vi.yml +2 -0
- data/config/locales/livechat.zh-CN.yml +2 -0
- data/lib/livechat/version.rb +1 -1
- data/lib/livechat/widget.js +86 -8
- data/lib/livechat/widget.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a3607a4c4f442eea6743e28545ee7fc731118d6d7c967c48f44956479164fa1
|
|
4
|
+
data.tar.gz: 2a5c9ac8ced8c0a0ab24c3dda2892dd89fff4af3a2eaba07618987538572d7ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d2f1f8f74451e5c7b4d6520f523e0822f2cb9c9324789e9c659e93b4064e990529b330eba75ccd947ac883b81e5037f28c1f7a3c1f0be3062b5b91cfeae551ee
|
|
7
|
+
data.tar.gz: 159e74cf7ba33baf90e78f8ed6c256eb9a348605e8edce6b690ca9e34fad484292ba5ff6ad9bdbc2ff389e8618484edd9930b714c2102b7c0e6811f78a9365c1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.5
|
|
4
|
+
|
|
5
|
+
- The widget's injected stylesheet now refreshes itself when its content
|
|
6
|
+
changes, instead of being injected once and never replaced. Turbo keeps
|
|
7
|
+
`<head>` across visits, so a tab that moved from an old widget build to a new
|
|
8
|
+
one (after you ship an update) could keep the stale `<style>` and show new
|
|
9
|
+
markup with old CSS until a full reload — now the styles are as
|
|
10
|
+
self-freshening as the fingerprinted script URL. (Fixes 0.4.4's composer and
|
|
11
|
+
header CSS not taking effect until a hard reload.)
|
|
12
|
+
|
|
13
|
+
## 0.4.4
|
|
14
|
+
|
|
15
|
+
- Expand / collapse the chat on desktop. A new header control grows the panel
|
|
16
|
+
to a roomier size (and back) for long threads and image-heavy chats; the
|
|
17
|
+
choice is remembered across Turbo visits. Hidden on phones, where the panel
|
|
18
|
+
is already full-screen. Translated across all 26 locales.
|
|
19
|
+
- Composer polish: dropped the doubled focus ring (one quiet accent border
|
|
20
|
+
now), and flattened Safari's default textarea bevel that showed as a second
|
|
21
|
+
box inside the composer.
|
|
22
|
+
- Fixed a message bubble bleeding over the header's bottom edge while scrolling
|
|
23
|
+
a long thread (a flexbox scroll-containment + stacking fix).
|
|
24
|
+
|
|
3
25
|
## 0.4.3
|
|
4
26
|
|
|
5
27
|
- Unified composer. The message box, attach button and send button are now one
|
|
@@ -20,6 +20,8 @@ bg:
|
|
|
20
20
|
attach: "Прикачване на файлове"
|
|
21
21
|
remove_file: "Премахване на файла"
|
|
22
22
|
attachment_error: "Някои файлове не можаха да бъдат изпратени."
|
|
23
|
+
expand: "Уголеми"
|
|
24
|
+
collapse: "Смали"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Твърде много файлове (макс. %{count})."
|
|
25
27
|
too_large: "%{name} е твърде голям."
|
|
@@ -20,6 +20,8 @@ de:
|
|
|
20
20
|
attach: "Dateien anhängen"
|
|
21
21
|
remove_file: "Datei entfernen"
|
|
22
22
|
attachment_error: "Einige Dateien konnten nicht gesendet werden."
|
|
23
|
+
expand: "Vergrößern"
|
|
24
|
+
collapse: "Verkleinern"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Zu viele Dateien (max. %{count})."
|
|
25
27
|
too_large: "%{name} ist zu groß."
|
|
@@ -20,6 +20,8 @@ el:
|
|
|
20
20
|
attach: "Επισύναψη αρχείων"
|
|
21
21
|
remove_file: "Αφαίρεση αρχείου"
|
|
22
22
|
attachment_error: "Ορισμένα αρχεία δεν ήταν δυνατό να σταλούν."
|
|
23
|
+
expand: "Μεγέθυνση"
|
|
24
|
+
collapse: "Σμίκρυνση"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Πάρα πολλά αρχεία (έως %{count})."
|
|
25
27
|
too_large: "Το %{name} είναι πολύ μεγάλο."
|
|
@@ -20,6 +20,8 @@ es:
|
|
|
20
20
|
attach: "Adjuntar archivos"
|
|
21
21
|
remove_file: "Quitar archivo"
|
|
22
22
|
attachment_error: "No se pudieron enviar algunos archivos."
|
|
23
|
+
expand: "Ampliar"
|
|
24
|
+
collapse: "Reducir"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Demasiados archivos (máx. %{count})."
|
|
25
27
|
too_large: "%{name} es demasiado grande."
|
|
@@ -20,6 +20,8 @@ fr:
|
|
|
20
20
|
attach: "Joindre des fichiers"
|
|
21
21
|
remove_file: "Retirer le fichier"
|
|
22
22
|
attachment_error: "Certains fichiers n'ont pas pu être envoyés."
|
|
23
|
+
expand: "Agrandir"
|
|
24
|
+
collapse: "Réduire"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Trop de fichiers (max %{count})."
|
|
25
27
|
too_large: "%{name} est trop volumineux."
|
|
@@ -20,6 +20,8 @@ hi:
|
|
|
20
20
|
attach: "फ़ाइलें संलग्न करें"
|
|
21
21
|
remove_file: "फ़ाइल हटाएं"
|
|
22
22
|
attachment_error: "कुछ फ़ाइलें भेजी नहीं जा सकीं।"
|
|
23
|
+
expand: "बड़ा करें"
|
|
24
|
+
collapse: "छोटा करें"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "बहुत सारी फ़ाइलें (अधिकतम %{count})।"
|
|
25
27
|
too_large: "%{name} बहुत बड़ी है।"
|
|
@@ -20,6 +20,8 @@ hr:
|
|
|
20
20
|
attach: "Priloži datoteke"
|
|
21
21
|
remove_file: "Ukloni datoteku"
|
|
22
22
|
attachment_error: "Neke datoteke nije bilo moguće poslati."
|
|
23
|
+
expand: "Povećaj"
|
|
24
|
+
collapse: "Smanji"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Previše datoteka (najviše %{count})."
|
|
25
27
|
too_large: "%{name} je prevelika."
|
|
@@ -20,6 +20,8 @@ id:
|
|
|
20
20
|
attach: "Lampirkan file"
|
|
21
21
|
remove_file: "Hapus file"
|
|
22
22
|
attachment_error: "Beberapa file tidak dapat dikirim."
|
|
23
|
+
expand: "Perbesar"
|
|
24
|
+
collapse: "Perkecil"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Terlalu banyak file (maks. %{count})."
|
|
25
27
|
too_large: "%{name} terlalu besar."
|
|
@@ -20,6 +20,8 @@ it:
|
|
|
20
20
|
attach: "Allega file"
|
|
21
21
|
remove_file: "Rimuovi file"
|
|
22
22
|
attachment_error: "Non è stato possibile inviare alcuni file."
|
|
23
|
+
expand: "Ingrandisci"
|
|
24
|
+
collapse: "Riduci"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Troppi file (max %{count})."
|
|
25
27
|
too_large: "%{name} è troppo grande."
|
|
@@ -20,6 +20,8 @@ lb:
|
|
|
20
20
|
attach: "Dateien uschléissen"
|
|
21
21
|
remove_file: "Datei ewechhuelen"
|
|
22
22
|
attachment_error: "E puer Dateie konnten net geschéckt ginn."
|
|
23
|
+
expand: "Vergréisseren"
|
|
24
|
+
collapse: "Verklengeren"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Ze vill Dateien (max %{count})."
|
|
25
27
|
too_large: "%{name} ass ze grouss."
|
|
@@ -20,6 +20,8 @@ nl:
|
|
|
20
20
|
attach: "Bestanden bijvoegen"
|
|
21
21
|
remove_file: "Bestand verwijderen"
|
|
22
22
|
attachment_error: "Sommige bestanden konden niet worden verzonden."
|
|
23
|
+
expand: "Vergroten"
|
|
24
|
+
collapse: "Verkleinen"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Te veel bestanden (max. %{count})."
|
|
25
27
|
too_large: "%{name} is te groot."
|
|
@@ -20,6 +20,8 @@ pl:
|
|
|
20
20
|
attach: "Załącz pliki"
|
|
21
21
|
remove_file: "Usuń plik"
|
|
22
22
|
attachment_error: "Nie udało się wysłać niektórych plików."
|
|
23
|
+
expand: "Powiększ"
|
|
24
|
+
collapse: "Zmniejsz"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Zbyt wiele plików (maks. %{count})."
|
|
25
27
|
too_large: "%{name} jest za duży."
|
|
@@ -20,6 +20,8 @@ pt:
|
|
|
20
20
|
attach: "Anexar arquivos"
|
|
21
21
|
remove_file: "Remover arquivo"
|
|
22
22
|
attachment_error: "Não foi possível enviar alguns arquivos."
|
|
23
|
+
expand: "Ampliar"
|
|
24
|
+
collapse: "Reduzir"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Muitos arquivos (máx. %{count})."
|
|
25
27
|
too_large: "%{name} é muito grande."
|
|
@@ -20,6 +20,8 @@ ro:
|
|
|
20
20
|
attach: "Atașează fișiere"
|
|
21
21
|
remove_file: "Elimină fișierul"
|
|
22
22
|
attachment_error: "Unele fișiere nu au putut fi trimise."
|
|
23
|
+
expand: "Mărește"
|
|
24
|
+
collapse: "Micșorează"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Prea multe fișiere (max. %{count})."
|
|
25
27
|
too_large: "%{name} este prea mare."
|
|
@@ -20,6 +20,8 @@ ru:
|
|
|
20
20
|
attach: "Прикрепить файлы"
|
|
21
21
|
remove_file: "Удалить файл"
|
|
22
22
|
attachment_error: "Некоторые файлы не удалось отправить."
|
|
23
|
+
expand: "Развернуть"
|
|
24
|
+
collapse: "Свернуть"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Слишком много файлов (макс. %{count})."
|
|
25
27
|
too_large: "%{name} слишком большой."
|
|
@@ -20,6 +20,8 @@ uk:
|
|
|
20
20
|
attach: "Прикріпити файли"
|
|
21
21
|
remove_file: "Видалити файл"
|
|
22
22
|
attachment_error: "Деякі файли не вдалося надіслати."
|
|
23
|
+
expand: "Розгорнути"
|
|
24
|
+
collapse: "Згорнути"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "Забагато файлів (максимум %{count})."
|
|
25
27
|
too_large: "%{name} завеликий."
|
|
@@ -20,6 +20,8 @@ ur:
|
|
|
20
20
|
attach: "فائلیں منسلک کریں"
|
|
21
21
|
remove_file: "فائل ہٹائیں"
|
|
22
22
|
attachment_error: "کچھ فائلیں نہیں بھیجی جا سکیں۔"
|
|
23
|
+
expand: "بڑا کریں"
|
|
24
|
+
collapse: "چھوٹا کریں"
|
|
23
25
|
attachments:
|
|
24
26
|
too_many: "بہت زیادہ فائلیں (زیادہ سے زیادہ %{count})۔"
|
|
25
27
|
too_large: "%{name} بہت بڑی ہے۔"
|
data/lib/livechat/version.rb
CHANGED
data/lib/livechat/widget.js
CHANGED
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
var pendingFiles = [];
|
|
40
40
|
var isOpen = false;
|
|
41
41
|
var lastFocused = null;
|
|
42
|
+
var expandBtnEl = null;
|
|
43
|
+
// Desktop-only: a bigger panel, remembered across Turbo visits. Never
|
|
44
|
+
// applied on phones, where the panel is already full-screen.
|
|
45
|
+
var expanded = false;
|
|
42
46
|
// On phones the panel is a full-screen modal (focus trapped, page scroll
|
|
43
47
|
// locked); on desktop it stays a non-modal popover you can chat alongside.
|
|
44
48
|
var mobileModal = window.matchMedia ? window.matchMedia("(max-width: 480px)") : null;
|
|
@@ -70,6 +74,7 @@
|
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
ready(function () {
|
|
77
|
+
expanded = sessionGet("livechat_expanded") === "1";
|
|
73
78
|
document.addEventListener("keydown", function (event) {
|
|
74
79
|
if (event.key === "Escape" && isOpen) closePanel();
|
|
75
80
|
});
|
|
@@ -100,6 +105,7 @@
|
|
|
100
105
|
injectStyles();
|
|
101
106
|
mount();
|
|
102
107
|
applyBrandColor();
|
|
108
|
+
applyExpanded(); // a Turbo swap makes a fresh root — restore the size class
|
|
103
109
|
syncOpenerBadges(); // a Turbo visit brings fresh openers — restamp them
|
|
104
110
|
|
|
105
111
|
if (sessionGet("livechat_open") === "1") {
|
|
@@ -206,14 +212,27 @@
|
|
|
206
212
|
titles.appendChild(subtitle);
|
|
207
213
|
header.appendChild(titles);
|
|
208
214
|
|
|
215
|
+
var actions = document.createElement("div");
|
|
216
|
+
actions.id = "lvc-actions";
|
|
217
|
+
|
|
218
|
+
// Grow/shrink the desktop panel. Hidden on phones (already full-screen).
|
|
219
|
+
expandBtnEl = document.createElement("button");
|
|
220
|
+
expandBtnEl.type = "button";
|
|
221
|
+
expandBtnEl.id = "lvc-expand";
|
|
222
|
+
expandBtnEl.addEventListener("click", toggleExpand);
|
|
223
|
+
actions.appendChild(expandBtnEl);
|
|
224
|
+
|
|
209
225
|
var close = document.createElement("button");
|
|
210
226
|
close.type = "button";
|
|
211
227
|
close.id = "lvc-close";
|
|
212
228
|
close.setAttribute("aria-label", config.labels.close);
|
|
213
229
|
close.innerHTML = "×";
|
|
214
230
|
close.addEventListener("click", closePanel);
|
|
215
|
-
|
|
231
|
+
actions.appendChild(close);
|
|
232
|
+
|
|
233
|
+
header.appendChild(actions);
|
|
216
234
|
panel.appendChild(header);
|
|
235
|
+
applyExpanded(); // set the panel size + the button's icon/label
|
|
217
236
|
|
|
218
237
|
listEl = document.createElement("div");
|
|
219
238
|
listEl.id = "lvc-list";
|
|
@@ -465,6 +484,38 @@
|
|
|
465
484
|
return !!(mobileModal && mobileModal.matches);
|
|
466
485
|
}
|
|
467
486
|
|
|
487
|
+
// --- expand / collapse (desktop) --------------------------------------------
|
|
488
|
+
|
|
489
|
+
var EXPAND_ICON =
|
|
490
|
+
'<svg viewBox="0 0 24 24" width="15" height="15" fill="none" stroke="currentColor" ' +
|
|
491
|
+
'stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' +
|
|
492
|
+
'<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/>' +
|
|
493
|
+
'<line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>';
|
|
494
|
+
var COLLAPSE_ICON =
|
|
495
|
+
'<svg viewBox="0 0 24 24" width="15" height="15" fill="none" stroke="currentColor" ' +
|
|
496
|
+
'stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' +
|
|
497
|
+
'<polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/>' +
|
|
498
|
+
'<line x1="14" y1="10" x2="21" y2="3"/><line x1="10" y1="14" x2="3" y2="21"/></svg>';
|
|
499
|
+
|
|
500
|
+
function toggleExpand() {
|
|
501
|
+
if (isMobileModal()) return;
|
|
502
|
+
expanded = !expanded;
|
|
503
|
+
sessionSet("livechat_expanded", expanded ? "1" : "");
|
|
504
|
+
applyExpanded();
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// Reflect the current state onto the panel and the header button. A no-op on
|
|
508
|
+
// phones — the class is never added there, so the full-screen panel stands.
|
|
509
|
+
function applyExpanded() {
|
|
510
|
+
var on = expanded && !isMobileModal();
|
|
511
|
+
if (root) root.classList.toggle("lvc-expanded", on);
|
|
512
|
+
if (!expandBtnEl) return;
|
|
513
|
+
var label = on ? config.labels.collapse : config.labels.expand;
|
|
514
|
+
expandBtnEl.setAttribute("aria-label", label);
|
|
515
|
+
expandBtnEl.title = label;
|
|
516
|
+
expandBtnEl.innerHTML = on ? COLLAPSE_ICON : EXPAND_ICON;
|
|
517
|
+
}
|
|
518
|
+
|
|
468
519
|
// Tab cycles inside the panel only while it is the full-screen mobile
|
|
469
520
|
// modal; the desktop popover deliberately lets focus reach the page.
|
|
470
521
|
function trapFocus(event) {
|
|
@@ -780,7 +831,6 @@
|
|
|
780
831
|
// --- styles -------------------------------------------------------------------
|
|
781
832
|
|
|
782
833
|
function injectStyles() {
|
|
783
|
-
if (document.getElementById("lvc-styles")) return;
|
|
784
834
|
var css =
|
|
785
835
|
"#lvc-root{--lvc-accent:#2563eb;--lvc-accent-text:#fff;--lvc-surface:#fff;" +
|
|
786
836
|
"--lvc-text:#1c2024;--lvc-muted:#6b7280;--lvc-border:#e5e7eb;--lvc-bg:#f6f7f9;" +
|
|
@@ -803,14 +853,28 @@
|
|
|
803
853
|
"#lvc-panel[hidden]{display:none}" +
|
|
804
854
|
"#lvc-root[dir=rtl] #lvc-panel{right:auto;left:20px}" +
|
|
805
855
|
"#lvc-root.lvc-no-launcher #lvc-panel{bottom:20px;max-height:calc(100dvh - 40px)}" +
|
|
806
|
-
|
|
807
|
-
|
|
856
|
+
// position/z-index keep the header above the scrolling list, and
|
|
857
|
+
// flex-shrink:0 stops it collapsing — together they stop a message
|
|
858
|
+
// bubble from bleeding over the header's rounded bottom edge.
|
|
859
|
+
"#lvc-header{position:relative;z-index:2;flex-shrink:0;display:flex;align-items:flex-start;" +
|
|
860
|
+
"justify-content:space-between;gap:8px;padding:14px 16px;background:var(--lvc-accent);" +
|
|
861
|
+
"color:var(--lvc-accent-text)}" +
|
|
808
862
|
"#lvc-header strong{display:block;font-size:15px}" +
|
|
809
863
|
"#lvc-header span{display:block;font-size:12px;opacity:.85;margin-top:2px}" +
|
|
864
|
+
"#lvc-actions{display:flex;align-items:center;gap:2px}" +
|
|
810
865
|
"#lvc-close{border:none;background:none;color:var(--lvc-accent-text);font-size:22px;" +
|
|
811
866
|
"line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px}" +
|
|
812
867
|
"#lvc-close:hover{background:rgba(255,255,255,.15)}" +
|
|
813
|
-
"#lvc-
|
|
868
|
+
"#lvc-root #lvc-expand{border:none;background:none;color:var(--lvc-accent-text);cursor:pointer;" +
|
|
869
|
+
"padding:5px 6px;border-radius:6px;display:flex;align-items:center;justify-content:center;opacity:.9}" +
|
|
870
|
+
"#lvc-root #lvc-expand:hover{background:rgba(255,255,255,.15);opacity:1}" +
|
|
871
|
+
// Desktop only: a roomier panel for long threads and image-heavy chats.
|
|
872
|
+
// Guarded by min-width so it can never shrink the full-screen mobile panel.
|
|
873
|
+
"@media(min-width:481px){#lvc-root.lvc-expanded #lvc-panel{width:min(460px,92vw);" +
|
|
874
|
+
"height:min(680px,88dvh);max-height:88dvh}}" +
|
|
875
|
+
// min-height:0 lets this flex child actually scroll within the panel
|
|
876
|
+
// instead of overflowing it (the classic flexbox scroll gotcha).
|
|
877
|
+
"#lvc-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px;" +
|
|
814
878
|
"background:var(--lvc-bg);display:flex;flex-direction:column;gap:4px}" +
|
|
815
879
|
// Class rules carry the #lvc-root prefix so they outrank the
|
|
816
880
|
// id-level `#lvc-root *` reset above.
|
|
@@ -841,9 +905,12 @@
|
|
|
841
905
|
// single control.
|
|
842
906
|
"#lvc-form{display:flex;flex-direction:column;gap:6px;margin:10px 12px;padding:8px 10px;" +
|
|
843
907
|
"border:1px solid var(--lvc-border);border-radius:16px;background:var(--lvc-bg)}" +
|
|
844
|
-
|
|
845
|
-
"#lvc-
|
|
846
|
-
|
|
908
|
+
// A single, quiet accent border on focus — no extra ring.
|
|
909
|
+
"#lvc-form:focus-within{border-color:var(--lvc-accent)}" +
|
|
910
|
+
// appearance:none flattens Safari's default textarea bevel, which would
|
|
911
|
+
// otherwise show as a second inset box inside the composer.
|
|
912
|
+
"#lvc-root #lvc-input{-webkit-appearance:none;appearance:none;border:none;background:none;" +
|
|
913
|
+
"resize:none;font:inherit;color:var(--lvc-text);padding:4px 4px 0;max-height:120px;outline:none}" +
|
|
847
914
|
"#lvc-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px}" +
|
|
848
915
|
"#lvc-tools{display:flex;align-items:center;gap:2px}" +
|
|
849
916
|
// Tool buttons (attach, and room for more) are quiet — the accent is the
|
|
@@ -882,6 +949,8 @@
|
|
|
882
949
|
"#lvc-root #lvc-panel,#lvc-root[dir=rtl] #lvc-panel,#lvc-root.lvc-no-launcher #lvc-panel" +
|
|
883
950
|
"{left:0;right:0;top:0;bottom:0;width:100%;max-width:100%;height:100dvh;max-height:100dvh;" +
|
|
884
951
|
"border-radius:0;border:none}" +
|
|
952
|
+
// The panel is already full-screen here, so there's nothing to expand.
|
|
953
|
+
"#lvc-expand{display:none}" +
|
|
885
954
|
// 16px stops iOS Safari from zoom-jumping into focused fields.
|
|
886
955
|
"#lvc-root #lvc-input,#lvc-root #lvc-email input{font-size:16px}" +
|
|
887
956
|
// Keep the composer box above the iPhone home indicator.
|
|
@@ -893,6 +962,15 @@
|
|
|
893
962
|
"font-size:11px;font-weight:700;line-height:18px;align-items:center;" +
|
|
894
963
|
"justify-content:center;vertical-align:middle}";
|
|
895
964
|
|
|
965
|
+
// Re-inject only when the stylesheet content actually changed. Turbo keeps
|
|
966
|
+
// <head> across visits, so a tab that transitions from an old widget build
|
|
967
|
+
// to a new one (a shipped update) would otherwise keep the stale <style>
|
|
968
|
+
// and pin old CSS even while fresh widget.js runs. Comparing content makes
|
|
969
|
+
// the styles as self-freshening as the fingerprinted script URL.
|
|
970
|
+
var existing = document.getElementById("lvc-styles");
|
|
971
|
+
if (existing && existing.textContent === css) return;
|
|
972
|
+
if (existing) existing.remove();
|
|
973
|
+
|
|
896
974
|
var style = document.createElement("style");
|
|
897
975
|
style.id = "lvc-styles";
|
|
898
976
|
style.textContent = css;
|
data/lib/livechat/widget.rb
CHANGED
|
@@ -104,7 +104,9 @@ module Livechat
|
|
|
104
104
|
unreadAria: t(:unread_aria, 'unread messages'),
|
|
105
105
|
attach: t(:attach, 'Attach files'),
|
|
106
106
|
removeFile: t(:remove_file, 'Remove file'),
|
|
107
|
-
attachmentError: t(:attachment_error, 'Some files could not be sent.')
|
|
107
|
+
attachmentError: t(:attachment_error, 'Some files could not be sent.'),
|
|
108
|
+
expand: t(:expand, 'Expand'),
|
|
109
|
+
collapse: t(:collapse, 'Collapse')
|
|
108
110
|
}
|
|
109
111
|
end
|
|
110
112
|
|