preflex 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d6368ab0c49bb287538ac42ef210be3e67c595c94817322d72a6d441bf9778f
4
- data.tar.gz: 810ca7627ba94316f6a5137988c05fb46e771a8490f4a5eb314cbd741c133461
3
+ metadata.gz: 480b69bc648fbfeb5a69a9b4bc9d0bc99b954bd0e7b9476af0a5f03b9f6b9159
4
+ data.tar.gz: 6ccbd7b123a353b71a3f90ebe61fb124dfbf39e146fec0217ff557c9f656cb64
5
5
  SHA512:
6
- metadata.gz: 8b2d91ef11be51e074c20d1f1697c6cb1df1d0281f4994f872c12b5282671ccc079ef8286dc10abb27cae511c2597aa5afeeeb28612d906f8f21e11a61190cf4
7
- data.tar.gz: 9536a14bdcd37d480413db8179b85896ab412752893b4fe70c87e473afc786b27c02429d229a940d6f4beb975091cbdd38507bc271853092d40df4ac35d92d2b
6
+ metadata.gz: 33c6c7bea76a5cc28a57c55a1f9534446c8acfb5e513a9b7b64f56986a7c6519004b068a8f98b99e7ff00f98087584bd5cfdd221fba4737c9d1e08ed05c670a1
7
+ data.tar.gz: d40abca380a989b8894a9a1dd30503c46362472dab7ff72dbea5fe3849d09f9cb56b1d1f3448df356c22d581192d205f22fda2ecf66fb9ba5e03621429391e57
@@ -3,7 +3,7 @@ module Preflex
3
3
  extend self
4
4
 
5
5
  # PREFLEX_PREFERENCE_JS = File.read(Preferences::Preflex::Engine.root.join("app", "static", "preflex_preference.js"))
6
- def script_tag(*preference_klasses)
6
+ def script_raw(*preference_klasses)
7
7
  return ''.html_safe if preference_klasses.empty?
8
8
 
9
9
  base = <<~JS
@@ -72,7 +72,13 @@ module Preflex
72
72
  "window['#{klass.name}'] = new PreflexPreference('#{klass.name}', #{klass.current.data_for_js});"
73
73
  end
74
74
 
75
- "<script>#{js.join("\n")}</script>".html_safe
75
+ js.join("\n")
76
+ end
77
+
78
+ def script_tag(*preference_klasses)
79
+ return ''.html_safe if preference_klasses.empty?
80
+
81
+ "<script data-turbo-eval=\"false\">#{script_raw(*preference_klasses)}</script>".html_safe
76
82
  end
77
83
  end
78
84
  end
@@ -1,3 +1,3 @@
1
1
  module Preflex
2
- VERSION = "1.0.5"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owais
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-15 00:00:00.000000000 Z
11
+ date: 2024-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails