playbook_ui 13.8.0.pre.alpha.play845allkitsbytypes1255 → 13.8.0.pre.alpha.play845allkitsbytypes1258
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/playbook/pb_doc_helper.rb +11 -18
- 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: e5c8dbe877503d2a312add43c4ee5319192494aef32945e9a7c2f32dc254ad9d
|
4
|
+
data.tar.gz: 62a00cbb99b842e8a348dd33da90bedaac35ecc5fff1afc167f882014ef8d76c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 291bc413c5067b82944b7559d216f42a14aba1eb7a750db833c26fc0de76ea8dba1945e71022bc80c104eef3dfc391af8c82de6c0e31673b338625b1b495cbcf
|
7
|
+
data.tar.gz: 1a4abac14b519af6c39bbcb1a769ff6c7bfc41d6eee534d319fa7716fa2666d7dcc19df39749994853da9a0ac15704dc4ab52500f484f1b1c96622d2d13de846
|
@@ -39,7 +39,7 @@ module Playbook
|
|
39
39
|
kits = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml")) || []
|
40
40
|
|
41
41
|
# Filter kits that have at least one component compatible with the type
|
42
|
-
kits.select do |kit|
|
42
|
+
kits["kits"].select do |kit|
|
43
43
|
kit["components"].any? { |component| component["platforms"].include?(type) }
|
44
44
|
end
|
45
45
|
end
|
@@ -47,7 +47,7 @@ module Playbook
|
|
47
47
|
def aggregate_kits
|
48
48
|
all_kits = []
|
49
49
|
|
50
|
-
YAML.load_file(Playbook::Engine.root.join("dist/menu.yml")).each do |kit|
|
50
|
+
YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))["kits"].each do |kit|
|
51
51
|
kit_name = kit["name"]
|
52
52
|
components = kit["components"].map { |c| c["name"] }
|
53
53
|
|
@@ -63,18 +63,14 @@ module Playbook
|
|
63
63
|
|
64
64
|
# rubocop:disable Style/OptionalBooleanParameter
|
65
65
|
def render_pb_doc_kit(kit_name, type, limit_examples, code = true, dark_mode = false)
|
66
|
-
parent_kit = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml")).find { |kit| kit["name"] == kit_name }
|
66
|
+
parent_kit = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))["kits"].find { |kit| kit["name"] == kit_name }
|
67
67
|
|
68
68
|
# Initialize component_content as an empty string
|
69
69
|
component_content = ""
|
70
|
-
title = ""
|
71
70
|
|
72
|
-
# Check if parent_kit is nil
|
73
|
-
if
|
74
|
-
|
75
|
-
component_content = raw("<div class='pb--docItem-ui'>
|
76
|
-
#{pb_kit(kit: kit_name, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}</div>")
|
77
|
-
else
|
71
|
+
# Check if parent_kit is not nil
|
72
|
+
# Check if type is not "swift"
|
73
|
+
if parent_kit && type != "swift"
|
78
74
|
# Filter components based on the specified type
|
79
75
|
components = parent_kit["components"].select { |component| component["platforms"].include?(type) }
|
80
76
|
|
@@ -86,8 +82,8 @@ module Playbook
|
|
86
82
|
|
87
83
|
# Render the component UI content with the same styles/tags as the parent
|
88
84
|
component_ui = raw("<div class='pb--docItem-ui'>
|
89
|
-
|
90
|
-
|
85
|
+
#{pb_kit(kit: component_name, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}
|
86
|
+
</div>")
|
91
87
|
|
92
88
|
# Combine the component name and component UI content
|
93
89
|
"#{title}#{component_ui}"
|
@@ -95,13 +91,10 @@ module Playbook
|
|
95
91
|
end
|
96
92
|
end
|
97
93
|
|
98
|
-
#
|
99
|
-
|
100
|
-
"#{title}#{component_content}".to_s
|
101
|
-
else
|
102
|
-
component_content.to_s.to_s
|
103
|
-
end
|
94
|
+
# Return the component_content
|
95
|
+
component_content.to_s
|
104
96
|
end
|
97
|
+
|
105
98
|
# rubocop:enable Style/OptionalBooleanParameter
|
106
99
|
|
107
100
|
private
|
data/lib/playbook/version.rb
CHANGED