playbook_ui 13.9.0.pre.alpha.play845allkitsbytypes1260 → 13.9.0.pre.alpha.play845allkitsbytypes1262
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/playbook/pb_doc_helper.rb +16 -17
- 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: f4efefad3fac932098f8436a5ba32e7949aa5aaa5bb9aef4d876ad35ddec3f25
|
4
|
+
data.tar.gz: 456d83d00606bee916bce37e4a358985db6c234200e6e71465204b4317f18ba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1c9517925cac47db7868497da8792b01b7acd6542b6ee9b2aef3880241acc1f62efc356fe47e6f3a72d6f1e4f102dbeb827782ea84fc48b93b99a0d07034a94
|
7
|
+
data.tar.gz: 9a0df5e8ec261a2d26ec5a6686529c8e5f7688b739e5cf751350567e531782645b47507bb7a4734f9fe2bc09526fb633dbb7009f0cd17a434f20e48bdce2c2ba
|
@@ -36,6 +36,8 @@ module Playbook
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def get_kits(type = "rails")
|
39
|
+
return [] if type == "swift"
|
40
|
+
|
39
41
|
kits = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml")) || []
|
40
42
|
|
41
43
|
# Filter kits that have at least one component compatible with the type
|
@@ -69,26 +71,23 @@ module Playbook
|
|
69
71
|
component_content = ""
|
70
72
|
|
71
73
|
# Check if parent_kit is not nil
|
72
|
-
#
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
# Render the component UI content with the same styles/tags as the parent
|
84
|
-
component_ui = raw("<div class='pb--docItem-ui'>
|
74
|
+
# Filter components based on the specified type
|
75
|
+
components = parent_kit["components"].select { |component| component["platforms"].include?(type) }
|
76
|
+
|
77
|
+
# If it's a parent with components, accumulate the UI content for child components
|
78
|
+
if components.any?
|
79
|
+
component_content = components.map do |component|
|
80
|
+
component_name = component["name"]
|
81
|
+
title = pb_doc_render_clickable_title(component_name, type) # Use component_name for the title
|
82
|
+
|
83
|
+
# Render the component UI content with the same styles/tags as the parent
|
84
|
+
component_ui = raw("<div class='pb--docItem-ui'>
|
85
85
|
#{pb_kit(kit: component_name, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}
|
86
86
|
</div>")
|
87
87
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
end
|
88
|
+
# Combine the component name and component UI content
|
89
|
+
"#{title}#{component_ui}"
|
90
|
+
end.join.to_s
|
92
91
|
end
|
93
92
|
|
94
93
|
# Return the component_content
|
data/lib/playbook/version.rb
CHANGED