livechat 0.4.4 → 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 +10 -0
- data/lib/livechat/version.rb +1 -1
- data/lib/livechat/widget.js +9 -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,15 @@
|
|
|
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
|
+
|
|
3
13
|
## 0.4.4
|
|
4
14
|
|
|
5
15
|
- Expand / collapse the chat on desktop. A new header control grows the panel
|
data/lib/livechat/version.rb
CHANGED
data/lib/livechat/widget.js
CHANGED
|
@@ -831,7 +831,6 @@
|
|
|
831
831
|
// --- styles -------------------------------------------------------------------
|
|
832
832
|
|
|
833
833
|
function injectStyles() {
|
|
834
|
-
if (document.getElementById("lvc-styles")) return;
|
|
835
834
|
var css =
|
|
836
835
|
"#lvc-root{--lvc-accent:#2563eb;--lvc-accent-text:#fff;--lvc-surface:#fff;" +
|
|
837
836
|
"--lvc-text:#1c2024;--lvc-muted:#6b7280;--lvc-border:#e5e7eb;--lvc-bg:#f6f7f9;" +
|
|
@@ -963,6 +962,15 @@
|
|
|
963
962
|
"font-size:11px;font-weight:700;line-height:18px;align-items:center;" +
|
|
964
963
|
"justify-content:center;vertical-align:middle}";
|
|
965
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
|
+
|
|
966
974
|
var style = document.createElement("style");
|
|
967
975
|
style.id = "lvc-styles";
|
|
968
976
|
style.textContent = css;
|