playbook_ui 13.8.0.pre.alpha.play845allkitsbytypes1254 → 13.8.0.pre.alpha.play845allkitsbytypes1257
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 +9 -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: fca3285826a75f3b9d44a0e5726d24854e107cce2b3f7a894eec629c6f397a6c
|
4
|
+
data.tar.gz: cd5b05f22467153ea63f45b7f4cfa7abea00b2c3b5122dfdcaf182d9d2eea403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6235ebd6e4f39f1a17832e24bd5d281accd57d0d277131a16d8007bcae0fc6e6a22a3c03dd0a0348e6162e312cbe6d1e282af7dc0ca16c0dce3e845459cf73c9
|
7
|
+
data.tar.gz: d51721b0949f7604806a15a5b8d41a8f107a702570586292580325cf5ea844d99e99a149cb80119a50b671df20b83fc7514063d5e9261224c106131de4edca6b
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module Playbook
|
4
4
|
module PbDocHelper
|
5
5
|
def pb_kit_title(title)
|
6
6
|
title.remove("pb_").titleize.tr("_", " ")
|
@@ -39,7 +39,7 @@ module PlaybookWebsite
|
|
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 PlaybookWebsite
|
|
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,13 @@ module PlaybookWebsite
|
|
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 parent_kit
|
74
|
-
title = pb_doc_render_clickable_title(kit_name, type)
|
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
|
+
if parent_kit
|
78
73
|
# Filter components based on the specified type
|
79
74
|
components = parent_kit["components"].select { |component| component["platforms"].include?(type) }
|
80
75
|
|
@@ -86,8 +81,8 @@ module PlaybookWebsite
|
|
86
81
|
|
87
82
|
# Render the component UI content with the same styles/tags as the parent
|
88
83
|
component_ui = raw("<div class='pb--docItem-ui'>
|
89
|
-
|
90
|
-
|
84
|
+
#{pb_kit(kit: component_name, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}
|
85
|
+
</div>")
|
91
86
|
|
92
87
|
# Combine the component name and component UI content
|
93
88
|
"#{title}#{component_ui}"
|
@@ -96,11 +91,7 @@ module PlaybookWebsite
|
|
96
91
|
end
|
97
92
|
|
98
93
|
# Combine the component content and UI content for the parent kit
|
99
|
-
|
100
|
-
"#{title}#{component_content}".to_s
|
101
|
-
else
|
102
|
-
component_content.to_s.to_s
|
103
|
-
end
|
94
|
+
component_content.to_s.to_s
|
104
95
|
end
|
105
96
|
# rubocop:enable Style/OptionalBooleanParameter
|
106
97
|
|
data/lib/playbook/version.rb
CHANGED