playbook_ui 13.8.0 → 13.9.0.pre.alpha.play845allkitsbytypes1260
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_button/_button.tsx +1 -6
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -7
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -0
- data/app/pb_kits/playbook/utilities/validEmojiChecker.ts +6 -0
- data/dist/menu.yml +281 -110
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/pb_doc_helper.rb +61 -28
- data/lib/playbook/version.rb +2 -2
- metadata +8 -7
@@ -26,42 +26,75 @@ module Playbook
|
|
26
26
|
end
|
27
27
|
|
28
28
|
# Deal with lists of kits, used in Playbook doc and Externally
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
kits
|
33
|
-
kits.
|
34
|
-
|
35
|
-
|
36
|
-
display_kits << render_pb_doc_kit(sub_kit, type, limit_examples, false, dark_mode)
|
37
|
-
end
|
38
|
-
else
|
39
|
-
display_kits << render_pb_doc_kit(kit, type, limit_examples, false, dark_mode)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
raw("<div class='pb--docItem'>" + display_kits.join("</div><div class='pb--docItem'>") + "</div>")
|
29
|
+
def pb_kits(type: "rails", limit_examples: false, dark_mode: false)
|
30
|
+
kits = get_kits(type)
|
31
|
+
|
32
|
+
# Iterate through the filtered kits and render them
|
33
|
+
kits.map do |kit|
|
34
|
+
render_pb_doc_kit(kit["name"], type, limit_examples, true, dark_mode)
|
35
|
+
end.join.html_safe
|
43
36
|
end
|
44
|
-
# rubocop:enable Style/StringConcatenation
|
45
37
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
38
|
+
def get_kits(type = "rails")
|
39
|
+
kits = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml")) || []
|
40
|
+
|
41
|
+
# Filter kits that have at least one component compatible with the type
|
42
|
+
kits["kits"].select do |kit|
|
43
|
+
kit["components"].any? { |component| component["platforms"].include?(type) }
|
44
|
+
end
|
50
45
|
end
|
51
46
|
|
52
|
-
def
|
53
|
-
|
54
|
-
|
47
|
+
def aggregate_kits
|
48
|
+
all_kits = []
|
49
|
+
|
50
|
+
YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))["kits"].each do |kit|
|
51
|
+
kit_name = kit["name"]
|
52
|
+
components = kit["components"].map { |c| c["name"] }
|
53
|
+
|
54
|
+
all_kits << if components.size == 1
|
55
|
+
components.first
|
56
|
+
else
|
57
|
+
{ kit_name => components }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
all_kits
|
55
62
|
end
|
56
|
-
# rubocop:enable Naming/AccessorMethodName
|
57
63
|
|
58
64
|
# rubocop:disable Style/OptionalBooleanParameter
|
59
|
-
def render_pb_doc_kit(
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
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"))["kits"].find { |kit| kit["name"] == kit_name }
|
67
|
+
|
68
|
+
# Initialize component_content as an empty string
|
69
|
+
component_content = ""
|
70
|
+
|
71
|
+
# Check if parent_kit is not nil
|
72
|
+
# Check if type is not "swift"
|
73
|
+
if parent_kit && type != "swift"
|
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
|
+
#{pb_kit(kit: component_name, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}
|
86
|
+
</div>")
|
87
|
+
|
88
|
+
# Combine the component name and component UI content
|
89
|
+
"#{title}#{component_ui}"
|
90
|
+
end.join.to_s
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# Return the component_content
|
95
|
+
component_content.to_s
|
64
96
|
end
|
97
|
+
|
65
98
|
# rubocop:enable Style/OptionalBooleanParameter
|
66
99
|
|
67
100
|
private
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.
|
4
|
+
version: 13.9.0.pre.alpha.play845allkitsbytypes1260
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
8
8
|
- Power Devs
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -2571,6 +2571,7 @@ files:
|
|
2571
2571
|
- app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js
|
2572
2572
|
- app/pb_kits/playbook/utilities/test/globalProps/order.test.js
|
2573
2573
|
- app/pb_kits/playbook/utilities/text.ts
|
2574
|
+
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
2574
2575
|
- dist/menu.yml
|
2575
2576
|
- dist/playbook-rails.js
|
2576
2577
|
- dist/reset.css
|
@@ -2638,7 +2639,7 @@ homepage: https://playbook.powerapp.cloud/
|
|
2638
2639
|
licenses:
|
2639
2640
|
- ISC
|
2640
2641
|
metadata: {}
|
2641
|
-
post_install_message:
|
2642
|
+
post_install_message:
|
2642
2643
|
rdoc_options: []
|
2643
2644
|
require_paths:
|
2644
2645
|
- lib
|
@@ -2649,12 +2650,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2649
2650
|
version: '0'
|
2650
2651
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2651
2652
|
requirements:
|
2652
|
-
- - "
|
2653
|
+
- - ">"
|
2653
2654
|
- !ruby/object:Gem::Version
|
2654
|
-
version:
|
2655
|
+
version: 1.3.1
|
2655
2656
|
requirements: []
|
2656
2657
|
rubygems_version: 3.3.7
|
2657
|
-
signing_key:
|
2658
|
+
signing_key:
|
2658
2659
|
specification_version: 4
|
2659
2660
|
summary: Playbook Design System
|
2660
2661
|
test_files: []
|