testimonials 0.5.0 → 0.5.1

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: ca58a272237a30e2e3ee55569c294e97039950fa5f00086fcd51c5e22865186c
4
- data.tar.gz: 13fef42c58a7eec18cc3e570172f38e89ed4a12910089b60e9cfa78c2464ce1d
3
+ metadata.gz: 49da88f23d3967043d08ff98641b737b357b67b1bffc65cf4ac2f5e9ffad181c
4
+ data.tar.gz: '091174dcf7d158e560f6c047593ef9d8b9dd7c1a4be3461f4cde4d1923c9ea84'
5
5
  SHA512:
6
- metadata.gz: 3ca5deb1aea7f9f244eeaf41ea8b6ef7194a5454fd95ad15648cf8b3598a0ea161288925d221b3d43672e60c7928d030ce4e7ae8c0cd5e0884e8dadad73c051d
7
- data.tar.gz: 1ed4726b786f199e93c9a467c5097fe97f326e8f1d659fb70b002fdcc85b7395637740ab9b40aba51b6f8c5eb2534c0180e5a6f5583a47734b5d5b1762d06ccd
6
+ metadata.gz: e45f348b081c38c7e85bcad7fa2823594c75100e4ace6be42390e793f7438e748a4048a0a753d5f246222333fc241ddd227e8059e6e94ea0f63c11899269335d
7
+ data.tar.gz: 17c9adb10e7922c9d32fc7931e809c3f398983571f109e1705e6f224f22328463d1d06ff8e7416ed210a802a841822bfa3d84d3f060f7cc9b01c7d1897d8aaa6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1
4
+
5
+ - The widget's injected stylesheet now refreshes when its content changes
6
+ instead of once-and-never-again — so a shipped widget update takes effect on
7
+ the next Turbo visit instead of needing a full page reload (Turbo keeps
8
+ `<head>` across visits, which could otherwise pin old CSS while fresh
9
+ widget.js runs). Backported from livechat 0.4.5.
10
+
3
11
  ## 0.5.0
4
12
 
5
13
  - **Multi-tenancy.** Scope testimonials to a tenant — each Organization (or
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Testimonials
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
@@ -1052,7 +1052,6 @@
1052
1052
  // --- styles -------------------------------------------------------------------
1053
1053
 
1054
1054
  function injectStyles() {
1055
- if (document.getElementById("tml-styles")) return;
1056
1055
  var css = [
1057
1056
  "#tml-overlay{position:fixed;inset:0;z-index:" + Z + ";background:rgba(0,0,0,.45);",
1058
1057
  "display:flex;align-items:center;justify-content:center;padding:16px}",
@@ -1154,6 +1153,13 @@
1154
1153
  "#tml-dialog .tml-actions{padding-bottom:calc(0px + env(safe-area-inset-bottom))}",
1155
1154
  "}"
1156
1155
  ].join("");
1156
+ // Re-inject only when the CSS changed. Turbo keeps <head> across visits, so
1157
+ // a stale <style> would otherwise pin old CSS after a shipped update, even
1158
+ // while fresh widget.js runs — as self-freshening as the fingerprinted URL.
1159
+ var existing = document.getElementById("tml-styles");
1160
+ if (existing && existing.textContent === css) return;
1161
+ if (existing) existing.remove();
1162
+
1157
1163
  var style = document.createElement("style");
1158
1164
  style.id = "tml-styles";
1159
1165
  style.textContent = css;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testimonials
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov