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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd6a72ade19436355c068f67d4c036f6f84b66e32cd163e36f3022619fa1587c
4
- data.tar.gz: c7936d6b60c1bdc5f509f44e186a16e21368b1b2328d54ac7dc7918ee2ab7893
3
+ metadata.gz: 4a3607a4c4f442eea6743e28545ee7fc731118d6d7c967c48f44956479164fa1
4
+ data.tar.gz: 2a5c9ac8ced8c0a0ab24c3dda2892dd89fff4af3a2eaba07618987538572d7ae
5
5
  SHA512:
6
- metadata.gz: 44f6a47b5879c17554031dc0d0f5a1e92943c180aaa08c855edc803682b3a558a3b232ab9fac16982f6bf2423505a72ca83e3173ad4e07491dc618bda43e24ef
7
- data.tar.gz: 9c025865ff9824eac83660af0775e74e08a508472056ca29dffc5c129f6b69f3c291db006a31a1f8b26a43ba0dfea9f29bdfb992eb0f30ee6a91b5db4cf1d8bd
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Livechat
4
- VERSION = '0.4.4'
4
+ VERSION = '0.4.5'
5
5
  end
@@ -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;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov