playbook_ui 13.9.0.pre.alpha.play845allkitsbytypes1260 → 13.9.0.pre.alpha.play845allkitsbytypes1263
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 +18 -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: 46007f2f1ef36ad550a50a69cb3cba12635054933359cf2e3e213a899b274a56
|
4
|
+
data.tar.gz: a960f5d51bf2219ab25bf9bcb50b1c6b1eb9f27498a585ad4238fdd898413407
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dd6619147cda00d230a6dc4f2010a96936f482d2d70d367c32ebe2bda44831cc5face8947d7e9ac8ba3bc4d1bde7da38dbff35845ec649dff79fadacfa71680
|
7
|
+
data.tar.gz: 434f294ee2b796ffa2d4ea5fce5bafa8d38d85026102ffc633f7ad4158b2b37f1a69ea898591a42052a579251a01d280b2175854f0f71d77b12984920167f8b8
|
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbDocHelper
|
5
|
+
def render_markdown(text)
|
6
|
+
PlaybookWebsite::Markdown::Helper.markdown(text)
|
7
|
+
end
|
8
|
+
|
5
9
|
def pb_kit_title(title)
|
6
10
|
title.remove("pb_").titleize.tr("_", " ")
|
7
11
|
end
|
@@ -69,26 +73,23 @@ module Playbook
|
|
69
73
|
component_content = ""
|
70
74
|
|
71
75
|
# 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'>
|
76
|
+
# Filter components based on the specified type
|
77
|
+
components = parent_kit["components"].select { |component| component["platforms"].include?(type) }
|
78
|
+
|
79
|
+
# If it's a parent with components, accumulate the UI content for child components
|
80
|
+
if components.any?
|
81
|
+
component_content = components.map do |component|
|
82
|
+
component_name = component["name"]
|
83
|
+
title = pb_doc_render_clickable_title(component_name, type) # Use component_name for the title
|
84
|
+
|
85
|
+
# Render the component UI content with the same styles/tags as the parent
|
86
|
+
component_ui = raw("<div class='pb--docItem-ui'>
|
85
87
|
#{pb_kit(kit: component_name, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}
|
86
88
|
</div>")
|
87
89
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
end
|
90
|
+
# Combine the component name and component UI content
|
91
|
+
"#{title}#{component_ui}"
|
92
|
+
end.join.to_s
|
92
93
|
end
|
93
94
|
|
94
95
|
# Return the component_content
|
data/lib/playbook/version.rb
CHANGED