playbook_ui_docs 13.10.0.pre.alpha.webpackerregistercomponents1463 → 13.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ import { useEditor, EditorContent } from "@tiptap/react";
3
+
4
+ import { RichTextEditor } from "../..";
5
+
6
+ import Document from "@tiptap/extension-document";
7
+ import Paragraph from "@tiptap/extension-paragraph";
8
+ import Text from "@tiptap/extension-text";
9
+
10
+ const RichTextEditorToolbarDisabled = (props) => {
11
+ const editor = useEditor({
12
+ extensions: [Document, Paragraph, Text],
13
+ content:
14
+ "Add your text here. You can format your text, add links, quotes, and bullets.",
15
+ });
16
+ if (!editor) {
17
+ return null;
18
+ }
19
+
20
+ return (
21
+ <div>
22
+ <RichTextEditor
23
+ advancedEditor={editor}
24
+ advancedEditorToolbar={false}
25
+ {...props}
26
+ >
27
+ <EditorContent editor={editor} />
28
+ </RichTextEditor>
29
+ </div>
30
+ );
31
+ };
32
+
33
+ export default RichTextEditorToolbarDisabled;
@@ -0,0 +1,3 @@
1
+ Because our default variant's toolbar requires [Tiptap's StarterKit](https://tiptap.dev/api/extensions/starter-kit) which may include features that are not relevant to your project or even block some custom extensions, optionally setting `advancedEditorToolbar` to `false` creates an editor without a toolbar, using only the minimum requirements.
2
+
3
+ __NOTE__: Omitting the Starter Kit requires that the editor’s default extensions (`document`, `paragraph`, and `text`) __must__ be imported directly from Tiptap or as a custom extensions.
@@ -15,6 +15,7 @@ examples:
15
15
  - rich_text_editor_default: Default
16
16
  - rich_text_editor_advanced_default: Advanced Default
17
17
  - rich_text_editor_more_extensions: Advanced (Extra Extensions)
18
+ - rich_text_editor_toolbar_disabled: Advanced (Toolbar disabled)
18
19
  - rich_text_editor_simple: Simple
19
20
  - rich_text_editor_attributes: Attributes
20
21
  - rich_text_editor_focus: Focus
@@ -8,4 +8,5 @@ export { default as RichTextEditorToolbarBottom } from './_rich_text_editor_tool
8
8
  export { default as RichTextEditorInline } from './_rich_text_editor_inline.jsx'
9
9
  export { default as RichTextEditorPreview } from './_rich_text_editor_preview.jsx'
10
10
  export { default as RichTextEditorAdvancedDefault } from './_rich_text_editor_advanced_default.jsx'
11
- export { default as RichTextEditorMoreExtensions } from './_rich_text_editor_more_extensions.jsx'
11
+ export { default as RichTextEditorMoreExtensions } from './_rich_text_editor_more_extensions.jsx'
12
+ export { default as RichTextEditorToolbarDisabled } from './_rich_text_editor_toolbar_disabled.jsx'
@@ -1,7 +1,7 @@
1
1
  <% example_html = ERB.new(example).result %>
2
2
 
3
3
  <%= pb_rails("card", props: { classname: "pb--doc", padding: "none", dark: dark }) do %>
4
- <% unless (action_name == "kit_show_swift") %>
4
+ <% unless (type == "swift") %>
5
5
  <div class="pb--kit-example">
6
6
  <%= pb_rails("caption", props: { text: example_title, dark: dark }) %>
7
7
  <br />
@@ -9,12 +9,12 @@
9
9
  <br>
10
10
  </div>
11
11
  <% else %>
12
- <div class="pb--kit-example-markdown pt_none markdown <%= dark ? "dark" : "" %>">
12
+ <div class="pb--kit-example-markdown pt_none markdown kit_show_swift <%= dark ? "dark" : "" %>">
13
13
  <%= pb_rails("caption", props: { text: example_title, dark: dark, margin_top: "md" }) %>
14
14
  <%= render_markdown(description) %>
15
15
  </div>
16
16
  <% end %>
17
- <% if show_code %>
17
+ <% if show_code && type != "swift" %>
18
18
  <div class="markdown pb--kit-example-markdown markdown <%= dark ? "dark" : "" %>">
19
19
  <%= render_markdown(description) %>
20
20
  </div>
data/dist/menu.yml CHANGED
@@ -1,111 +1,285 @@
1
+ web: &web ["rails", "react"]
2
+ all: &all ["rails", "react", "swift"]
3
+ rails_swift: &rails_swift ["rails", "swift"]
4
+ react_swift: &react_swift ["swift", "react"]
5
+ rails_only: &rails_only ["rails"]
6
+ react_only: &react_only ["react"]
7
+ swift_only: &swift_only ["swift"]
8
+
1
9
  kits:
2
- - avatars:
3
- - avatar
4
- - avatar_action_button
5
- - multiple_users
6
- - multiple_users_stacked
7
- - user
8
- - background
9
- - bread_crumbs
10
- - buttons:
11
- - button
12
- - button_toolbar
13
- - circle_icon_button
14
- - card
15
- - collapsible
16
- - charts_and_graphs:
17
- - bar_graph
18
- - circle_chart
19
- - distribution_bar
20
- - gauge
21
- - legend
22
- - line_graph
23
- - treemap_chart
24
- - dialog
25
- - filter
26
- - fixed_confirmation_toast
27
- - forms:
28
- - checkbox
29
- - date_picker
30
- - file_upload
31
- - form
32
- - form_group
33
- - form_pill
34
- - multi_level_select
35
- - passphrase
36
- - phone_number_input
37
- - radio
38
- - rich_text_editor
39
- - select
40
- - selectable_card
41
- - selectable_card_icon
42
- - selectable_icon
43
- - selectable_list
44
- - text_input
45
- - textarea
46
- - toggle
47
- - typeahead
48
- - highlight
49
- - icon
50
- - icon_circle
51
- - icon_stat_value
52
- - icon_value
53
- - image
54
- - layouts:
55
- - flex
56
- - layout
57
- - lightbox
58
- - list
59
- - loading_inline
60
- - map
61
- - nav
62
- - tags:
63
- - badge
64
- - hashtag
65
- - pill
66
- - pagination
67
- - popover
68
- - progress:
69
- - progress_pills
70
- - progress_simple
71
- - progress_step
72
- - section_separator
73
- - star_rating
74
- - table
75
- - timeline
76
- - time_and_date:
77
- - date
78
- - date_range_inline
79
- - date_range_stacked
80
- - date_stacked
81
- - date_time
82
- - date_time_stacked
83
- - date_year_stacked
84
- - time
85
- - time_range_inline
86
- - time_stacked
87
- - timestamp
88
- - weekday_stacked
89
- - tooltip
90
- - typography:
91
- - body
92
- - caption
93
- - detail
94
- - title
95
- - typography_patterns:
96
- - contact
97
- - currency
98
- - dashboard_value
99
- - home_address_street
100
- - label_pill
101
- - label_value
102
- - message
103
- - person
104
- - person_contact
105
- - source
106
- - stat_change
107
- - stat_value
108
- - title_count
109
- - title_detail
110
- - user_badge
111
- - walkthrough
10
+ - name: "avatars"
11
+ components:
12
+ - name: "avatar"
13
+ platforms: *all
14
+ - name: "avatar_action_button"
15
+ platforms: *web
16
+ - name: "multiple_users"
17
+ platforms: *web
18
+ - name: "multiple_users_stacked"
19
+ platforms: *web
20
+ - name: "user"
21
+ platforms: *web
22
+ - name: "background"
23
+ components:
24
+ - name: "background"
25
+ platforms: *web
26
+ - name: "bread_crumbs"
27
+ components:
28
+ - name: "bread_crumbs"
29
+ platforms: *web
30
+ - name: "buttons"
31
+ components:
32
+ - name: "button"
33
+ platforms: *web
34
+ - name: "button_toolbar"
35
+ platforms: *web
36
+ - name: "circle_icon_button"
37
+ platforms: *web
38
+ - name: "card"
39
+ components:
40
+ - name: "card"
41
+ platforms: *all
42
+ - name: "collapsible"
43
+ components:
44
+ - name: "collapsible"
45
+ platforms: *web
46
+ - name: "charts_and_graphs"
47
+ components:
48
+ - name: "bar_graph"
49
+ platforms: *web
50
+ - name: "circle_chart"
51
+ platforms: *web
52
+ - name: "distribution_bar"
53
+ platforms: *web
54
+ - name: "gauge"
55
+ platforms: *web
56
+ - name: "legend"
57
+ platforms: *web
58
+ - name: "line_graph"
59
+ platforms: *web
60
+ - name: "treemap_chart"
61
+ platforms: *web
62
+ - name: "dialog"
63
+ components:
64
+ - name: "dialog"
65
+ platforms: *web
66
+ - name: "filter"
67
+ components:
68
+ - name: "filter"
69
+ platforms: *web
70
+ - name: "fixed_confirmation_toast"
71
+ components:
72
+ - name: "fixed_confirmation_toast"
73
+ platforms: *web
74
+ - name: "forms"
75
+ components:
76
+ - name: "checkbox"
77
+ platforms: *web
78
+ - name: "date_picker"
79
+ platforms: *web
80
+ - name: "file_upload"
81
+ platforms: *web
82
+ - name: "form"
83
+ platforms: *rails_only
84
+ - name: "form_group"
85
+ platforms: *web
86
+ - name: "form_pill"
87
+ platforms: *web
88
+ - name: "multi_level_select"
89
+ platforms: *web
90
+ - name: "passphrase"
91
+ platforms: *web
92
+ - name: "phone_number_input"
93
+ platforms: *web
94
+ - name: "radio"
95
+ platforms: *all
96
+ - name: "rich_text_editor"
97
+ platforms: *web
98
+ - name: "select"
99
+ platforms: *web
100
+ - name: "selectable_card"
101
+ platforms: *web
102
+ - name: "selectable_card_icon"
103
+ platforms: *web
104
+ - name: "selectable_icon"
105
+ platforms: *web
106
+ - name: "selectable_list"
107
+ platforms: *web
108
+ - name: "text_input"
109
+ platforms: *web
110
+ - name: "textarea"
111
+ platforms: *web
112
+ - name: "toggle"
113
+ platforms: *web
114
+ - name: "typeahead"
115
+ platforms: *web
116
+ - name: "highlight"
117
+ components:
118
+ - name: "highlight"
119
+ platforms: *web
120
+ - name: "icon"
121
+ components:
122
+ - name: "icon"
123
+ platforms: *web
124
+ - name: "icon_circle"
125
+ components:
126
+ - name: "icon_circle"
127
+ platforms: *web
128
+ - name: "icon_stat_value"
129
+ components:
130
+ - name: "icon_stat_value"
131
+ platforms: *web
132
+ - name: "icon_value"
133
+ components:
134
+ - name: "icon_value"
135
+ platforms: *web
136
+ - name: "image"
137
+ components:
138
+ - name: "image"
139
+ platforms: *web
140
+ - name: "layouts"
141
+ components:
142
+ - name: "flex"
143
+ platforms: *web
144
+ - name: "layout"
145
+ platforms: *web
146
+ - name: "lightbox"
147
+ components:
148
+ - name: "lightbox"
149
+ platforms: *react_only
150
+ - name: "list"
151
+ components:
152
+ - name: "list"
153
+ platforms: *web
154
+ - name: "loading_inline"
155
+ components:
156
+ - name: "loading_inline"
157
+ platforms: *web
158
+ - name: "map"
159
+ components:
160
+ - name: "map"
161
+ platforms: *react_only
162
+ - name: "nav"
163
+ components:
164
+ - name: "nav"
165
+ platforms: *web
166
+ - name: "pagination"
167
+ components:
168
+ - name: "pagination"
169
+ platforms: *rails_only
170
+ - name: "popover"
171
+ components:
172
+ - name: "popover"
173
+ platforms: *web
174
+ - name: "progress"
175
+ components:
176
+ - name: "progress_pills"
177
+ platforms: *web
178
+ - name: "progress_simple"
179
+ platforms: *web
180
+ - name: "progress_step"
181
+ platforms: *web
182
+ - name: "section_separator"
183
+ components:
184
+ - name: "section_separator"
185
+ platforms: *web
186
+ - name: "star_rating"
187
+ components:
188
+ - name: "star_rating"
189
+ platforms: *web
190
+ - name: "table"
191
+ components:
192
+ - name: "table"
193
+ platforms: *web
194
+ - name: "tags"
195
+ components:
196
+ - name: "tags"
197
+ platforms: *web
198
+ - name: "badge"
199
+ platforms: *web
200
+ - name: "hashtag"
201
+ platforms: *web
202
+ - name: "pill"
203
+ platforms: *all
204
+ - name: "timeline"
205
+ components:
206
+ - name: "timeline"
207
+ platforms: *web
208
+ - name: "time_and_date"
209
+ components:
210
+ - name: "date"
211
+ platforms: *web
212
+ - name: "date_range_inline"
213
+ platforms: *web
214
+ - name: "date_range_stacked"
215
+ platforms: *web
216
+ - name: "date_stacked"
217
+ platforms: *web
218
+ - name: "date_time"
219
+ platforms: *web
220
+ - name: "date_time_stacked"
221
+ platforms: *web
222
+ - name: "date_year_stacked"
223
+ platforms: *web
224
+ - name: "time"
225
+ platforms: *web
226
+ - name: "time_range_inline"
227
+ platforms: *web
228
+ - name: "time_stacked"
229
+ platforms: *web
230
+ - name: "timestamp"
231
+ platforms: *all
232
+ - name: "weekday_stacked"
233
+ platforms: *web
234
+ - name: "tooltip"
235
+ components:
236
+ - name: "tooltip"
237
+ platforms: *web
238
+ - name: "typography"
239
+ components:
240
+ - name: "body"
241
+ platforms: *web
242
+ - name: "caption"
243
+ platforms: *web
244
+ - name: "detail"
245
+ platforms: *web
246
+ - name: "title"
247
+ platforms: *web
248
+ - name: "typography_patterns"
249
+ components:
250
+ - name: "contact"
251
+ platforms: *web
252
+ - name: "currency"
253
+ platforms: *web
254
+ - name: "dashboard_value"
255
+ platforms: *web
256
+ - name: "home_address_street"
257
+ platforms: *web
258
+ - name: "label_pill"
259
+ platforms: *web
260
+ - name: "label_value"
261
+ platforms: *web
262
+ - name: "message"
263
+ platforms: *web
264
+ - name: "person"
265
+ platforms: *web
266
+ - name: "person_contact"
267
+ platforms: *web
268
+ - name: "source"
269
+ platforms: *web
270
+ - name: "stat_change"
271
+ platforms: *web
272
+ - name: "stat_value"
273
+ platforms: *web
274
+ - name: "title_count"
275
+ platforms: *web
276
+ - name: "title_detail"
277
+ platforms: *web
278
+ - name: "user_badge"
279
+ components:
280
+ - name: "user_badge"
281
+ platforms: *web
282
+ - name: "walkthrough"
283
+ components:
284
+ - name: "walkthrough"
285
+ platforms: *web
@@ -33,9 +33,9 @@ module PlaybookWebsite
33
33
  kits.each do |kit|
34
34
  if kit.is_a?(Hash)
35
35
  nav_hash_array(kit).each do |sub_kit|
36
- display_kits << render_pb_doc_kit(sub_kit, type, limit_examples, false, dark_mode)
36
+ display_kits << render_pb_doc_kit(sub_kit, type, limit_examples, false, dark_mode) if pb_doc_has_kit_type?(sub_kit, type)
37
37
  end
38
- else
38
+ elsif pb_doc_has_kit_type?(kit, type)
39
39
  display_kits << render_pb_doc_kit(kit, type, limit_examples, false, dark_mode)
40
40
  end
41
41
  end
@@ -44,9 +44,9 @@ module PlaybookWebsite
44
44
  # rubocop:enable Style/StringConcatenation
45
45
 
46
46
  # rubocop:disable Naming/AccessorMethodName
47
- def get_kits
48
- menu = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))
49
- menu["kits"]
47
+ def get_kits(_type = "rails")
48
+ aggregate_kits || []
49
+ # Filter kits that have at least one component compatible with the type
50
50
  end
51
51
 
52
52
  def get_kits_pb_website