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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60b1c622bab5811e437d84be4b5aa3269f2b7a3fc4cf11bf8ef325cda4fdbc14
4
- data.tar.gz: 06f4962b4e93e9abf883550181307db371d904c440f821a0b389d0d64bb3aa24
3
+ metadata.gz: e5c8dbe877503d2a312add43c4ee5319192494aef32945e9a7c2f32dc254ad9d
4
+ data.tar.gz: 62a00cbb99b842e8a348dd33da90bedaac35ecc5fff1afc167f882014ef8d76c
5
5
  SHA512:
6
- metadata.gz: cd24107b067f2632eb1dd6d39cea6bcd61867ed69f2ba82803d08b2a1c7ee4bc4894cd7a6cfeb08073524f26901421c13cd4993507053d29f9b226aeb4fd22e0
7
- data.tar.gz: 34aa5ca2497e3e0c09df4ab50aecabac49ad6f46971f0bcca44be15d9126595e4c7054436f19c3b7ecde0ddd1a65ea345e1c57b77123d03223571754c7238687
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 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
+ # 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
- #{pb_kit(kit: component_name, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}
90
- </div>")
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
- # 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
+ # Return the component_content
95
+ component_content.to_s
104
96
  end
97
+
105
98
  # rubocop:enable Style/OptionalBooleanParameter
106
99
 
107
100
  private
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "13.8.0"
5
- VERSION = "13.8.0.pre.alpha.play845allkitsbytypes1255"
5
+ VERSION = "13.8.0.pre.alpha.play845allkitsbytypes1258"
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.play845allkitsbytypes1255
4
+ version: 13.8.0.pre.alpha.play845allkitsbytypes1258
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX