avo-icons 0.1.3 → 0.1.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/lib/avo/icons/configuration.rb +0 -1
- data/lib/avo/icons/helpers.rb +2 -2
- data/lib/avo/icons/svg_finder.rb +4 -2
- data/lib/avo/icons/version.rb +1 -1
- data/lib/avo/icons.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0804ba0dacb221d4b02e49d550e5c2a1e58527f2dffe5bf21779f37ed6359655'
|
|
4
|
+
data.tar.gz: 0b9ad1b3eefe21c05f02d3bed0c0733a73fa6dadead0dae0cacb3eb216e9fc89
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 229478a6201fe6a21ae21ab5eefdf62d1ec46a46bf96209790d2a8affa2e6ca2d9c7dc2771c2a4f2f13594b86d4a98f436e7eb23d1e276e4a5de1b9adfa1fdfd
|
|
7
|
+
data.tar.gz: 7db4d43b9986e37c0ef604ee25cb147efc0fd8f7f516eb13aca39d3f8e6764034ece58d79faada6c459e700bca7f409187951485d9ad06b9121ca403b5d6cda2
|
data/lib/avo/icons/helpers.rb
CHANGED
|
@@ -24,8 +24,9 @@ module Avo
|
|
|
24
24
|
# https://github.com/jamesmartin/inline_svg/blob/main/lib/inline_svg/action_view/helpers.rb#L61
|
|
25
25
|
def placeholder(filename)
|
|
26
26
|
css_class = "avo-missing-svg"
|
|
27
|
+
escaped_filename = ERB::Util.html_escape_once(filename.to_s)
|
|
27
28
|
missing_icon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-ice-cream-off"><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path d="M12 21.5v-4.5" /><path d="M8 8v9h8v-1m0 -4v-5a4 4 0 0 0 -7.277 -2.294" /><path d="M8 10.5l1.74 -.76m2.79 -1.222l3.47 -1.518" /><path d="M8 14.5l4.488 -1.964" /><path d="M3 3l18 18" /></svg>'
|
|
28
|
-
"<div data-tippy='tooltip' class='#{css_class}' style='width: 2rem; height: 2rem; color: #ef4444;' title='SVG file not found: #{
|
|
29
|
+
"<div data-tippy='tooltip' class='#{css_class}' style='width: 2rem; height: 2rem; color: #ef4444;' title='SVG file not found: #{escaped_filename}'><!-- SVG file not found: '#{escaped_filename}' -->#{missing_icon}</div>".html_safe
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# Taken from the original library
|
|
@@ -40,4 +41,3 @@ module Avo
|
|
|
40
41
|
end
|
|
41
42
|
end
|
|
42
43
|
end
|
|
43
|
-
|
data/lib/avo/icons/svg_finder.rb
CHANGED
|
@@ -37,7 +37,7 @@ module Avo
|
|
|
37
37
|
Avo::Icons.root.join("assets", "svgs", "heroicons", "mini", @filename),
|
|
38
38
|
Avo::Icons.root.join("assets", "svgs", "heroicons", "micro", @filename),
|
|
39
39
|
# Add all paths from Rails including engines
|
|
40
|
-
*Rails.application.config.assets&.paths&.map { |path| File.join(path, @filename) }
|
|
40
|
+
*Rails.application.config.try(:assets)&.paths&.map { |path| File.join(path, @filename) }
|
|
41
41
|
]
|
|
42
42
|
|
|
43
43
|
# Add custom paths from configuration
|
|
@@ -53,6 +53,9 @@ module Avo
|
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
def default_strategy
|
|
56
|
+
# Return nil if the app doesn't have assets configured
|
|
57
|
+
return unless Rails.application.config.respond_to?(:assets)
|
|
58
|
+
|
|
56
59
|
# If the app uses Propshaft, grab it from there
|
|
57
60
|
if defined?(Propshaft)
|
|
58
61
|
asset_path = ::Rails.application.assets.load_path.find(@filename)
|
|
@@ -73,4 +76,3 @@ module Avo
|
|
|
73
76
|
end
|
|
74
77
|
end
|
|
75
78
|
end
|
|
76
|
-
|
data/lib/avo/icons/version.rb
CHANGED
data/lib/avo/icons.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: avo-icons
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paul Bob
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-
|
|
12
|
+
date: 2026-06-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: inline_svg
|