playbook_ui_docs 15.2.0.pre.alpha.PLAY236711413 → 15.2.0.pre.alpha.advancedtableicons11557

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +39 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +1 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.md +3 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +3 -3
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +3 -3
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +2 -2
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +1 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers_rails.html.erb +2 -2
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +2 -2
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +1 -1
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row_rails.html.erb +51 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row_rails.md +1 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_rails.html.erb +40 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_rails.md +1 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +1 -1
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_react.md +1 -1
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb +2 -2
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
  20. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +1 -1
  21. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_description.md +2 -0
  22. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +2 -2
  23. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_attributes.jsx +38 -0
  24. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_attributes.md +1 -0
  25. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.jsx +34 -0
  26. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.md +1 -0
  27. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.jsx +37 -0
  28. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.md +1 -0
  29. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_simple.jsx +37 -0
  30. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.jsx +38 -0
  31. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.md +1 -0
  32. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_templates.jsx +69 -0
  33. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_templates.md +1 -0
  34. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +8 -2
  35. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +6 -0
  36. data/dist/playbook-doc.js +2 -2
  37. metadata +19 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36a35e17a0394e3bbc7a5c6881e3aa83de3f5087b98d15c815e61e713eb6585b
4
- data.tar.gz: 706ce3b90ccd79a4fa7c1448cbb8059bb254f7d4b240330ef34d1e3c7aa63995
3
+ metadata.gz: b3d4ec97c8e08eaf484f8573a8e0683ce85e89a157b528b93794d57b40e90c79
4
+ data.tar.gz: d2dbb0a4b6c2339ec8e5007718049601063167b306efbd6b0df250a662fb04ae
5
5
  SHA512:
6
- metadata.gz: d08bf04ecddf22bc2ff2a4c7e14776b15fee070dc019fb5b5181a07cc636a227bdf47725b4e1c9dedc21e0ce3a5e62afea9ca82343e3e0cb0d852aee43f6fe2b
7
- data.tar.gz: 5742dd1e87ca5069549a96d31aea0f71a02b6eb44f93786c8485d9619ae07686c070931ccc8e33f40b757143c41e9fda94db9fbb96a163cadeb5628e7b72161d
6
+ metadata.gz: 3d955871afd2db7fc8b0e9811d04f376f5e3ba7c28e9f2061122c6c7454ffe76fcd406bcf00d83201d065b3a6e42969ae73a7a9ef1ca84bf9320a316a97be7df
7
+ data.tar.gz: 87c6b0f4d634ec6abab3cd219a3a6f5aae6417796312462009e8867ef28a3bcfc3aa3db3fd663de934b6e5cf5e3b75587bdf4680c96a218a346f2c3bfc999aea
@@ -0,0 +1,39 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ column_styling: {
11
+ cell_background_color: ->(row) { row[:newEnrollments].to_i > 20 ? "success_secondary" : "warning_secondary" }
12
+ }
13
+ },
14
+ {
15
+ accessor: "scheduledMeetings",
16
+ label: "Scheduled Meetings",
17
+ },
18
+ {
19
+ accessor: "attendanceRate",
20
+ label: "Attendance Rate",
21
+ },
22
+ {
23
+ accessor: "completedClasses",
24
+ label: "Completed Classes",
25
+ },
26
+ {
27
+ accessor: "classCompletionRate",
28
+ label: "Class Completion Rate",
29
+ },
30
+ {
31
+ accessor: "graduatedStudents",
32
+ label: "Graduated Students",
33
+ }
34
+ ] %>
35
+
36
+ <%= pb_rails("advanced_table", props: { id: "background-control", table_data: @table_data, column_definitions: column_definitions }) do %>
37
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "background-control", column_definitions: column_definitions }) %>
38
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "background-control", table_data: @table_data, column_definitions: column_definitions }) %>
39
+ <% end %>
@@ -0,0 +1 @@
1
+ `column_styling` can also be used to control the background color on all cells in a given column via the use of the `cell_background_color` key/value pair. Use `cell_background_color` to achieve custom background colors for individual cells as seen here.
@@ -2,7 +2,9 @@ The AdvancedTable kit accepts tree data and automatically renders expansion cont
2
2
 
3
3
  ### id
4
4
 
5
- A unique `id` is required to allow the table functionality to work properly. Without it, certain functions like the action bar will not be able to properly reference the correct table.
5
+ A unique `id` is required to allow the table functionality to work properly. Without it, certain functions like the action bar, expand/collapse caching, or selectable rows will not be able to properly reference the correct table.
6
+
7
+ You must also set `table_id` when using subcomponents like `table_header` or `table_body`.
6
8
 
7
9
  ### table_data
8
10
 
@@ -51,7 +51,7 @@
51
51
  ]
52
52
  %>
53
53
 
54
- <%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions, id: "beta_sort" }) do %>
55
- <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
56
- <%= pb_rails("advanced_table/table_body", props: { id: "beta_sort", table_data: @table_data, column_definitions: column_definitions, enable_toggle_expansion: "all" }) %>
54
+ <%= pb_rails("advanced_table", props: { id: "sort", table_data: @table_data, column_definitions: column_definitions, id: "beta_sort" }) do %>
55
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "sort", column_definitions: column_definitions }) %>
56
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "sort", table_data: @table_data, column_definitions: column_definitions, enable_toggle_expansion: "all" }) %>
57
57
  <% end %>
@@ -34,7 +34,7 @@
34
34
  subrow_headers = ["Quarter", "Month", "Day"]
35
35
  %>
36
36
 
37
- <%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions, id: "test_table" }) do %>
38
- <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
39
- <%= pb_rails("advanced_table/table_body", props: { id: "test_table", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
37
+ <%= pb_rails("advanced_table", props: { id: "subrow-headers", table_data: @table_data, column_definitions: column_definitions, id: "test_table" }) do %>
38
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "subrow-headers", column_definitions: column_definitions }) %>
39
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "subrow-headers", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
40
40
  <% end %>
@@ -31,6 +31,6 @@
31
31
  ] %>
32
32
 
33
33
  <%= pb_rails("advanced_table", props: { id: "collapsible_trail", table_data: @table_data, column_definitions: column_definitions }) do %>
34
- <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
35
- <%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions, collapsible_trail: false }) %>
34
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "collapsible_trail", column_definitions: column_definitions }) %>
35
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "collapsible_trail", table_data: @table_data, column_definitions: column_definitions, collapsible_trail: false }) %>
36
36
  <% end %>
@@ -1,4 +1,4 @@
1
- The `columnStyling` prop is an optional item that can be used within `columnDefinitions` as shown in the code snippet below. It is an object that has 2 optional key/value pairs:
1
+ The `columnStyling` prop is an optional item that can be used within `columnDefinitions` as shown in the code snippet below. It is an object that has several optional key/value pairs, this doc example highlights the following:
2
2
 
3
3
  1) `headerAlignment`: This will allow you to control alignment of header content which is set to right aligned by default. you can set this to `left`, `right` or `center`.
4
4
 
@@ -58,6 +58,6 @@
58
58
  ] %>
59
59
 
60
60
  <%= pb_rails("advanced_table", props: { id: "column-styling-multi", table_data: @table_data, column_definitions: column_definitions }) do %>
61
- <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
62
- <%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions }) %>
61
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "column-styling-multi", column_definitions: column_definitions }) %>
62
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "column-styling-multi", table_data: @table_data, column_definitions: column_definitions }) %>
63
63
  <% end %>
@@ -33,6 +33,6 @@
33
33
  ] %>
34
34
 
35
35
  <%= pb_rails("advanced_table", props: { id: "column-styling", table_data: @table_data, column_definitions: column_definitions }) do %>
36
- <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
37
- <%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions }) %>
36
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "column-styling", column_definitions: column_definitions }) %>
37
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "column-styling", table_data: @table_data, column_definitions: column_definitions }) %>
38
38
  <% end %>
@@ -1,4 +1,4 @@
1
- The `column_styling` prop is an optional item that can be used within `column_definitions` as shown in the code snippet below. It is an object that has 2 optional key/value pairs:
1
+ The `column_styling` prop is an optional item that can be used within `column_definitions` as shown in the code snippet below. It is an object that has several optional key/value pairs, this doc example highlights the following:
2
2
 
3
3
  1) `header_alignment`: This will allow you to control alignment of header content which is set to right aligned by default. you can set this to `left`, `right` or `center`.
4
4
 
@@ -0,0 +1,51 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ },
11
+ {
12
+ accessor: "scheduledMeetings",
13
+ label: "Scheduled Meetings",
14
+ },
15
+ {
16
+ accessor: "attendanceRate",
17
+ label: "Attendance Rate",
18
+ },
19
+ {
20
+ accessor: "completedClasses",
21
+ label: "Completed Classes",
22
+ },
23
+ {
24
+ accessor: "classCompletionRate",
25
+ label: "Class Completion Rate",
26
+ },
27
+ {
28
+ accessor: "graduatedStudents",
29
+ label: "Graduated Students",
30
+ }
31
+ ] %>
32
+
33
+ <% row_styling = [
34
+ {
35
+ row_id: "1",
36
+ cell_padding: "md"
37
+ },
38
+ {
39
+ row_id: "3",
40
+ cell_padding: "lg"
41
+ },
42
+ {
43
+ row_id: "5",
44
+ cell_padding: "none"
45
+ },
46
+ ] %>
47
+
48
+ <%= pb_rails("advanced_table", props: { id: "padding-control-per-row", table_data: @table_data_with_id, column_definitions: column_definitions, row_styling: row_styling }) do %>
49
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "padding-control-per-row", column_definitions: column_definitions }) %>
50
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "padding-control-per-row", table_data: @table_data_with_id, column_definitions: column_definitions, row_styling: row_styling }) %>
51
+ <% end %>
@@ -0,0 +1 @@
1
+ `row_styling` can also be used to control padding on all cells in a given row via the use of the `cell_padding` key/value pair as shown here. `cell_padding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
@@ -0,0 +1,40 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ column_styling: {
11
+ cell_padding: "none",
12
+ }
13
+ },
14
+ {
15
+ accessor: "scheduledMeetings",
16
+ label: "Scheduled Meetings",
17
+ },
18
+ {
19
+ accessor: "attendanceRate",
20
+ label: "Attendance Rate",
21
+ column_styling: { cell_padding: "md" },
22
+ },
23
+ {
24
+ accessor: "completedClasses",
25
+ label: "Completed Classes",
26
+ },
27
+ {
28
+ accessor: "classCompletionRate",
29
+ label: "Class Completion Rate",
30
+ },
31
+ {
32
+ accessor: "graduatedStudents",
33
+ label: "Graduated Students",
34
+ }
35
+ ] %>
36
+
37
+ <%= pb_rails("advanced_table", props: { id: "padding-control", table_data: @table_data, column_definitions: column_definitions }) do %>
38
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "padding-control", column_definitions: column_definitions }) %>
39
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "padding-control", table_data: @table_data, column_definitions: column_definitions }) %>
40
+ <% end %>
@@ -0,0 +1 @@
1
+ `column_styling` can also be used to control padding on all cells in a given column via the use of the `cell_padding` key/value pair. `cell_padding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
@@ -1,4 +1,4 @@
1
- The `row_styling` prop can be used in conjunction with row ids to control certain styling options on individual rows. Currently, `row_styling` gives you 3 optional controls:
1
+ The `row_styling` prop can be used in conjunction with row ids to control certain styling options on individual rows. It is an object that has several optional key/value pairs, this doc example highlights the following:
2
2
 
3
3
  - `background_color` : use this to control the background color of the row
4
4
  - `font_color`: use this to control font color for each row if needed, for example if using a darker background color.
@@ -1,4 +1,4 @@
1
- The `rowStyling` prop can be used in conjunction with row ids to control certain styling options on individual rows. Currently, `rowStyling` gives you 3 optional controls:
1
+ The `rowStyling` prop can be used in conjunction with row ids to control certain styling options on individual rows. It is an object that has several optional key/value pairs, this doc example highlights the following:
2
2
 
3
3
  - `backgroundColor` : use this to control the background color of the row
4
4
  - `fontColor`: use this to control font color for each row if needed, for example if using a darker background color.
@@ -34,6 +34,6 @@
34
34
  %>
35
35
 
36
36
  <%= pb_rails("advanced_table", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, selectable_rows: true }) do %>
37
- <%= pb_rails("advanced_table/table_header", props: { id: "selectable_rows", column_definitions: column_definitions, selectable_rows: true }) %>
38
- <%= pb_rails("advanced_table/table_body", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all", selectable_rows: true }) %>
37
+ <%= pb_rails("advanced_table/table_header", props: { table_id: "selectable_rows", column_definitions: column_definitions, selectable_rows: true }) %>
38
+ <%= pb_rails("advanced_table/table_body", props: { table_id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all", selectable_rows: true }) %>
39
39
  <% end %>
@@ -21,8 +21,11 @@ examples:
21
21
  - advanced_table_selectable_rows_header_rails: Selectable Rows (No Actions Bar)
22
22
  - advanced_table_scrollbar_none: Advanced Table Scrollbar None
23
23
  - advanced_table_row_styling: Row Styling
24
+ - advanced_table_padding_control_per_row_rails: Padding Control using Row Styling
24
25
  - advanced_table_column_styling_rails: Column Styling
25
26
  - advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
27
+ - advanced_table_padding_control_rails: Padding Control using Column Styling
28
+ - advanced_table_background_control_rails: Background Control using Column Styling
26
29
  - advanced_table_column_border_color_rails: Column Group Border Color
27
30
 
28
31
 
@@ -23,7 +23,7 @@ const DatePickerRangePattern = (props) => {
23
23
 
24
24
  <DatePicker
25
25
  pickerId="end-date-picker"
26
- placeholder="Select a End Date"
26
+ placeholder="Select an End Date"
27
27
  syncEndWith="quickpick-for-range"
28
28
  {...props}
29
29
  />
@@ -1,2 +1,4 @@
1
1
 
2
2
  Fixed Confirmation Toast is used as an alert. Success is used when a user successfully completes an action. Error is used when there is an error and the user cannot proceed. Neutral is used to display information to a user to complete a task.
3
+
4
+ **NOTE**: z index for Fixed Confirmation Toast is set to 'max' by default which has the value of `999999`. the z Index global prop can be used to override this if you want to set it to a different value.
@@ -28,9 +28,9 @@
28
28
  popoverButton.onclick = () => {
29
29
  buttonClicked = !buttonClicked
30
30
  if (buttonClicked) {
31
- arrowDiv.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="auto" height="auto" viewBox="0 0 31 25" fill="none" class="pb_custom_icon svg-inline--fa pb_icon_kit svg_fw" id="" data="{}" aria="{}" tabindex=""><path d="M14.2031 5.70312C14.625 5.28125 15.3281 5.28125 15.75 5.70312L24.7969 14.7031C25.2188 15.1719 25.2188 15.875 24.7969 16.2969C24.3281 16.7656 23.625 16.7656 23.2031 16.2969L15 8.09375L6.79688 16.2969C6.32812 16.7656 5.625 16.7656 5.20312 16.2969C4.73438 15.875 4.73438 15.1719 5.20312 14.75L14.2031 5.70312Z" fill="currentColor"/></svg>'
31
+ arrowDiv.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" viewBox="0 0 31 25" fill="none" class="pb_custom_icon svg-inline--fa pb_icon_kit svg_fw" id="" data="{}" aria="{}" tabindex=""><path d="M14.2031 5.70312C14.625 5.28125 15.3281 5.28125 15.75 5.70312L24.7969 14.7031C25.2188 15.1719 25.2188 15.875 24.7969 16.2969C24.3281 16.7656 23.625 16.7656 23.2031 16.2969L15 8.09375L6.79688 16.2969C6.32812 16.7656 5.625 16.7656 5.20312 16.2969C4.73438 15.875 4.73438 15.1719 5.20312 14.75L14.2031 5.70312Z" fill="currentColor"/></svg>'
32
32
  } else {
33
- arrowDiv.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="auto" height="auto" viewBox="0 0 31 25" fill="none" class="pb_custom_icon svg-inline--fa pb_icon_kit svg_fw" id="" data="{}" aria="{}" tabindex=""><path d="M14.2031 19.2969L5.20312 10.2969C4.73438 9.875 4.73438 9.17188 5.20312 8.70312C5.625 8.28125 6.32812 8.28125 6.79688 8.70312L15 16.9531L23.2031 8.75C23.625 8.28125 24.3281 8.28125 24.7969 8.75C25.2188 9.17188 25.2188 9.875 24.7969 10.2969L15.75 19.2969C15.3281 19.7656 14.625 19.7656 14.2031 19.2969Z" fill="currentColor"/></svg>'
33
+ arrowDiv.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" viewBox="0 0 31 25" fill="none" class="pb_custom_icon svg-inline--fa pb_icon_kit svg_fw" id="" data="{}" aria="{}" tabindex=""><path d="M14.2031 19.2969L5.20312 10.2969C4.73438 9.875 4.73438 9.17188 5.20312 8.70312C5.625 8.28125 6.32812 8.28125 6.79688 8.70312L15 16.9531L23.2031 8.75C23.625 8.28125 24.3281 8.28125 24.7969 8.75C25.2188 9.17188 25.2188 9.875 24.7969 10.2969L15.75 19.2969C15.3281 19.7656 14.625 19.7656 14.2031 19.2969Z" fill="currentColor"/></svg>'
34
34
  }
35
35
  }
36
36
  </script>
@@ -0,0 +1,38 @@
1
+ import React from 'react'
2
+ import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
+ import { useEditor, EditorContent } from "@tiptap/react"
4
+ import StarterKit from "@tiptap/starter-kit"
5
+ import Link from '@tiptap/extension-link'
6
+
7
+
8
+ const RichTextEditorAdvancedAttributes = (props) => {
9
+
10
+ const editor = useEditor({
11
+ extensions: [
12
+ StarterKit,
13
+ Link
14
+ ],
15
+ content:"Add your text here. You can format your text, add links, quotes, and bullets."
16
+ })
17
+ if (!editor) {
18
+ return null
19
+ }
20
+
21
+
22
+
23
+
24
+ return (
25
+ <div>
26
+ <RichTextEditor
27
+ advancedEditor={editor}
28
+ aria={{ label: 'I am a rich text editor' }}
29
+ data={{ 'test-data': 'value', 'test-data2': 'value2' }}
30
+ {...props}
31
+ >
32
+ <EditorContent editor={editor}/>
33
+ </RichTextEditor>
34
+ </div>
35
+ )
36
+ }
37
+
38
+ export default RichTextEditorAdvancedAttributes
@@ -0,0 +1 @@
1
+ Aria labels and data attributes can also be added to the top level div for the RichTextEditor.
@@ -0,0 +1,34 @@
1
+ import React from 'react'
2
+ import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
+ import { useEditor, EditorContent } from "@tiptap/react"
4
+ import StarterKit from "@tiptap/starter-kit"
5
+ import Link from '@tiptap/extension-link'
6
+
7
+
8
+ const RichTextEditorAdvancedFocus = (props) => {
9
+ const editor = useEditor({
10
+ extensions: [
11
+ StarterKit,
12
+ Link
13
+ ],
14
+ content:"Click inside to see the toolbar. Click outside to hide it."
15
+ })
16
+
17
+ if (!editor) {
18
+ return null
19
+ }
20
+
21
+ return (
22
+ <div>
23
+ <RichTextEditor
24
+ advancedEditor={editor}
25
+ focus
26
+ {...props}
27
+ >
28
+ <EditorContent editor={editor}/>
29
+ </RichTextEditor>
30
+ </div>
31
+ )
32
+ }
33
+
34
+ export default RichTextEditorAdvancedFocus
@@ -0,0 +1 @@
1
+ When the optional `focus` prop is set to true, the toolbar will only show once you click in to the RichTextEditor.
@@ -0,0 +1,37 @@
1
+ import React from 'react'
2
+ import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
+ import { useEditor, EditorContent } from "@tiptap/react"
4
+ import StarterKit from "@tiptap/starter-kit"
5
+ import Link from '@tiptap/extension-link'
6
+
7
+
8
+ const RichTextEditorAdvancedInline = (props) => {
9
+
10
+ const editor = useEditor({
11
+ extensions: [
12
+ StarterKit,
13
+ Link
14
+ ],
15
+ content:"Add your text here. You can format your text, add links, quotes, and bullets."
16
+ })
17
+ if (!editor) {
18
+ return null
19
+ }
20
+
21
+
22
+
23
+
24
+ return (
25
+ <div>
26
+ <RichTextEditor
27
+ advancedEditor={editor}
28
+ inline
29
+ {...props}
30
+ >
31
+ <EditorContent editor={editor}/>
32
+ </RichTextEditor>
33
+ </div>
34
+ )
35
+ }
36
+
37
+ export default RichTextEditorAdvancedInline
@@ -0,0 +1 @@
1
+ When the optional `inline` prop is set to true, the editor borders and the toolbar will only be visible when hovered or focused on.
@@ -0,0 +1,37 @@
1
+ import React from 'react'
2
+ import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
+ import { useEditor, EditorContent } from "@tiptap/react"
4
+ import StarterKit from "@tiptap/starter-kit"
5
+ import Link from '@tiptap/extension-link'
6
+
7
+
8
+ const RichTextEditorAdvancedSimple = (props) => {
9
+
10
+ const editor = useEditor({
11
+ extensions: [
12
+ StarterKit,
13
+ Link
14
+ ],
15
+ content:"Add your text here. Use the simple toolbar above to format your text"
16
+ })
17
+ if (!editor) {
18
+ return null
19
+ }
20
+
21
+
22
+
23
+
24
+ return (
25
+ <div>
26
+ <RichTextEditor
27
+ advancedEditor={editor}
28
+ simple
29
+ {...props}
30
+ >
31
+ <EditorContent editor={editor}/>
32
+ </RichTextEditor>
33
+ </div>
34
+ )
35
+ }
36
+
37
+ export default RichTextEditorAdvancedSimple
@@ -0,0 +1,38 @@
1
+ import React from 'react'
2
+ import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
+ import { useEditor, EditorContent } from "@tiptap/react"
4
+ import StarterKit from "@tiptap/starter-kit"
5
+ import Link from '@tiptap/extension-link'
6
+
7
+
8
+ const RichTextEditorAdvancedSticky = (props) => {
9
+
10
+ const editor = useEditor({
11
+ extensions: [
12
+ StarterKit,
13
+ Link
14
+ ],
15
+ content:"In this example, when you scroll down, the rich text editor's toolbar will scroll along with the page and it will no longer be visible at the top of the page. Dummy text to enable scroll.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis."
16
+
17
+ })
18
+ if (!editor) {
19
+ return null
20
+ }
21
+
22
+
23
+
24
+
25
+ return (
26
+ <div>
27
+ <RichTextEditor
28
+ advancedEditor={editor}
29
+ sticky
30
+ {...props}
31
+ >
32
+ <EditorContent editor={editor}/>
33
+ </RichTextEditor>
34
+ </div>
35
+ )
36
+ }
37
+
38
+ export default RichTextEditorAdvancedSticky
@@ -0,0 +1 @@
1
+ Use the optional `sticky` prop to make the toolbar sticky on scroll.
@@ -0,0 +1,69 @@
1
+ import React, {useState, useEffect} from 'react'
2
+ import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
+ import { useEditor, EditorContent } from "@tiptap/react"
4
+ import StarterKit from "@tiptap/starter-kit"
5
+ import Link from '@tiptap/extension-link'
6
+
7
+ import Select from '../../pb_select/_select'
8
+ import { changelog, release } from './templates.js'
9
+
10
+ const RichTextEditorAdvancedTemplates = (props) => {
11
+
12
+ const [editorContent, setEditorContent] = useState('')
13
+
14
+ const handleChange = (event) => {
15
+ setEditorContent(event.target.value)
16
+ }
17
+ const templatesOptions = [
18
+ {
19
+ value: release,
20
+ text: 'Playbook Release',
21
+ },
22
+ {
23
+ value: changelog,
24
+ text: 'Changelog',
25
+ },
26
+ ]
27
+
28
+ const editor = useEditor({
29
+ extensions: [
30
+ StarterKit,
31
+ Link
32
+ ],
33
+ content: editorContent
34
+ })
35
+
36
+ // Update editor content when editorContent state changes
37
+ useEffect(() => {
38
+ if (editor && editorContent) {
39
+ editor.commands.setContent(editorContent)
40
+ }
41
+ }, [editor, editorContent])
42
+
43
+ if (!editor) {
44
+ return null
45
+ }
46
+
47
+
48
+
49
+
50
+ return (
51
+ <div>
52
+ <Select
53
+ blankSelection="Select a template..."
54
+ label="Template"
55
+ onChange={handleChange}
56
+ options={templatesOptions}
57
+ {...props}
58
+ />
59
+ <RichTextEditor
60
+ advancedEditor={editor}
61
+ {...props}
62
+ >
63
+ <EditorContent editor={editor}/>
64
+ </RichTextEditor>
65
+ </div>
66
+ )
67
+ }
68
+
69
+ export default RichTextEditorAdvancedTemplates
@@ -0,0 +1 @@
1
+ Tiptap allows you to set content within the editor using the 'content' prop within useEditor. See the code snippet below to see how this can be done.
@@ -7,7 +7,7 @@ examples:
7
7
  - rich_text_editor_focus: Focus
8
8
  - rich_text_editor_sticky: Sticky
9
9
  - rich_text_editor_templates: Templates
10
- - rich_text_editor_toolbar_bottom: Toolbar Bottom
10
+ # - rich_text_editor_toolbar_bottom: Toolbar Bottom
11
11
  - rich_text_editor_inline: Inline
12
12
  - rich_text_editor_preview: Preview
13
13
 
@@ -17,11 +17,17 @@ examples:
17
17
  - rich_text_editor_more_extensions: Advanced (Extra Extensions)
18
18
  - rich_text_editor_toolbar_disabled: Advanced (Toolbar disabled)
19
19
  - rich_text_editor_simple: Simple
20
+ - rich_text_editor_advanced_simple: Advanced (Simple)
20
21
  - rich_text_editor_attributes: Attributes
22
+ - rich_text_editor_advanced_attributes: Advanced (Attributes)
21
23
  - rich_text_editor_focus: Focus
24
+ - rich_text_editor_advanced_focus: Advanced (Focus)
22
25
  - rich_text_editor_sticky: Sticky
26
+ - rich_text_editor_advanced_sticky: Advanced (Sticky)
23
27
  - rich_text_editor_templates: Templates
24
- - rich_text_editor_toolbar_bottom: Toolbar Bottom
28
+ - rich_text_editor_advanced_templates: Advanced (Templates)
29
+ # - rich_text_editor_toolbar_bottom: Toolbar Bottom
25
30
  - rich_text_editor_inline: Inline
31
+ - rich_text_editor_advanced_inline: Advanced (Inline)
26
32
  - rich_text_editor_preview: Preview
27
33
  - rich_text_editor_advanced_preview: Advanced Preview