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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8962b1f5b63702a09832038c0a78be9da51e80bffc9386e15e6540059ba8ccd4
4
- data.tar.gz: 58c742ec7b33680a19c03e94a4d2fae092d2f43f951baac8bc024ce0079cbe78
3
+ metadata.gz: fca3285826a75f3b9d44a0e5726d24854e107cce2b3f7a894eec629c6f397a6c
4
+ data.tar.gz: cd5b05f22467153ea63f45b7f4cfa7abea00b2c3b5122dfdcaf182d9d2eea403
5
5
  SHA512:
6
- metadata.gz: d142a90639215ce17982e9535ef88069b48e510059261b160dbfe07a65ab8c926e81066a1f07251d48a6bb25cee2b3d2ba686327fe9ebc11b744f521c725b92d
7
- data.tar.gz: 4d77bf674d1fe3fdb4645c7b4b9ca3be262fe5bafb28e6839c88cebcaf4a0110dc0522b3775d72f7ac93e1b8857fe888503c781793526d21104fc6c332a536a1
6
+ metadata.gz: 6235ebd6e4f39f1a17832e24bd5d281accd57d0d277131a16d8007bcae0fc6e6a22a3c03dd0a0348e6162e312cbe6d1e282af7dc0ca16c0dce3e845459cf73c9
7
+ data.tar.gz: d51721b0949f7604806a15a5b8d41a8f107a702570586292580325cf5ea844d99e99a149cb80119a50b671df20b83fc7514063d5e9261224c106131de4edca6b
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module PlaybookWebsite
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.nil?
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
- #{pb_kit(kit: component_name, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}
90
- </div>")
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
- if parent_kit.nil?
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
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "13.8.0"
5
- VERSION = "13.8.0.pre.alpha.play845allkitsbytypes1254"
5
+ VERSION = "13.8.0.pre.alpha.play845allkitsbytypes1257"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.8.0.pre.alpha.play845allkitsbytypes1254
4
+ version: 13.8.0.pre.alpha.play845allkitsbytypes1257
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX