playbook_ui 14.3.0.pre.rc.9 → 14.3.0.pre.rc.10
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/app/pb_kits/playbook/pb_icon/icon.rb +8 -0
- data/lib/playbook/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 802ad05cc819086feec002c5a2528144dd9996654e668eccec3bc02beb2d6521
|
4
|
+
data.tar.gz: c0b4e44c40893d27244309b0e24ee3c8708746a91d15dffe565fe41e07d14b03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e7a1200079126289d171fa6e6a26bda62b629aeef8ebcc880a28ca3a494d23810dc27a70a12bdb9a4081a98a8a37c7ae648b7f0c6a3d2552d7ee343c9b9fb5a
|
7
|
+
data.tar.gz: 3b89ba5afc4d031b92e19cae2ef8e3517e081d44784b135e49c0fff824f0ba576e505a57f230302ddee822c7428a1bbf4188853cf32d19b4273b5c6e52dcbd0c
|
@@ -102,6 +102,11 @@ module Playbook
|
|
102
102
|
def render_svg
|
103
103
|
doc = Nokogiri::XML(URI.open(asset_path || icon || custom_icon)) # rubocop:disable Security/Open
|
104
104
|
svg = doc.at_css "svg"
|
105
|
+
|
106
|
+
unless svg
|
107
|
+
return "" # Return an empty string if SVG element is not found
|
108
|
+
end
|
109
|
+
|
105
110
|
svg["class"] = %w[pb_custom_icon svg-inline--fa].concat([object.custom_icon_classname]).join(" ")
|
106
111
|
svg["id"] = object.id
|
107
112
|
svg["data"] = object.data
|
@@ -112,6 +117,9 @@ module Playbook
|
|
112
117
|
fill_color = object.color || "currentColor"
|
113
118
|
doc.at_css("path")["fill"] = fill_color
|
114
119
|
raw doc
|
120
|
+
rescue OpenURI::HTTPError, StandardError
|
121
|
+
# Handle any exceptions and return an empty string
|
122
|
+
""
|
115
123
|
end
|
116
124
|
|
117
125
|
def is_svg?
|
data/lib/playbook/version.rb
CHANGED