importmap-rails 1.1.4 → 1.1.5

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: 0ee4ce0d38b4658aee999e41906ae7b054eb0a1318ecd9d5375d3a0bc57daf6a
4
- data.tar.gz: c0c376603d1f7ef38b708565d4fb18a17cde71fff33c9e57421061e130e8431d
3
+ metadata.gz: 4974d66c8d41c99f0470784e6b7c240bc1c71bab54536e31ed14d409d90b6268
4
+ data.tar.gz: 0226cfa08e07bd1a5827d98a30139ce826556f8ee99752131842ffc6d12fb1a7
5
5
  SHA512:
6
- metadata.gz: c5749cad7cf026fe485560d3bfbdc568395bea36ad5b3020a50c55331ec052946f67ac9eaf80e70270139bdf366460e62494d397f434f8f7afaaa856864bdd54
7
- data.tar.gz: 1f4cdd4bdeb93fe0ad0811375f0f750a26b22baaf8c15f9921f87c586e15b01f2847c100bf5ea72727f90b183704b357a7b074b76051fc5e85416f66beb2dce2
6
+ metadata.gz: 543829492f5f98d878fdeaff7d6cca346a5c84eb696c85bc84e42bf80b65b177ab36602b02ab344632039e47a34b81da0ae3a68d3cbd8a18ba8bd37bf51f72d6
7
+ data.tar.gz: 8a7d5db6327c39187c9c3762b3aeb9b7a9bbbf7b5c03746fd4179900d9874f5329a80b9d66d47b33be653deb2eb39a2906a04984e27de66806ed3e36430bc724
@@ -14,7 +14,7 @@ module Importmap::ImportmapTagsHelper
14
14
  # By default, `Rails.application.importmap.to_json(resolver: self)` is used.
15
15
  def javascript_inline_importmap_tag(importmap_json = Rails.application.importmap.to_json(resolver: self))
16
16
  tag.script importmap_json.html_safe,
17
- type: "importmap", "data-turbo-track": "reload", nonce: request&.content_security_policy
17
+ type: "importmap", "data-turbo-track": "reload", nonce: request&.content_security_policy_nonce
18
18
  end
19
19
 
20
20
  # Configure es-modules-shim with nonce support if the application is using a content security policy.
@@ -28,14 +28,14 @@ module Importmap::ImportmapTagsHelper
28
28
  # Include the es-modules-shim needed to make importmaps work in browsers without native support (like Firefox + Safari).
29
29
  def javascript_importmap_shim_tag(minimized: true)
30
30
  javascript_include_tag minimized ? "es-module-shims.min.js" : "es-module-shims.js",
31
- async: true, "data-turbo-track": "reload", nonce: request&.content_security_policy
31
+ async: true, "data-turbo-track": "reload", nonce: request&.content_security_policy_nonce
32
32
  end
33
33
 
34
34
  # Import a named JavaScript module(s) using a script-module tag.
35
35
  def javascript_import_module_tag(*module_names)
36
36
  imports = Array(module_names).collect { |m| %(import "#{m}") }.join("\n")
37
37
  tag.script imports.html_safe,
38
- type: "module", nonce: request&.content_security_policy
38
+ type: "module", nonce: request&.content_security_policy_nonce
39
39
  end
40
40
 
41
41
  # Link tags for preloading all modules marked as preload: true in the `importmap`
@@ -48,7 +48,7 @@ module Importmap::ImportmapTagsHelper
48
48
  # Link tag(s) for preloading the JavaScript module residing in `*paths`. Will return one link tag per path element.
49
49
  def javascript_module_preload_tag(*paths)
50
50
  safe_join(Array(paths).collect { |path|
51
- tag.link rel: "modulepreload", href: path, nonce: request&.content_security_policy
51
+ tag.link rel: "modulepreload", href: path, nonce: request&.content_security_policy_nonce
52
52
  }, "\n")
53
53
  end
54
54
  end
@@ -1,3 +1,3 @@
1
1
  module Importmap
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: importmap-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson