playbook_ui 15.5.0.pre.rc.1 → 15.5.0.pre.rc.3

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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +21 -8
  3. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_icon_variant.jsx +24 -0
  4. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_icon_variant_react.md +1 -0
  5. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +1 -0
  6. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +1 -0
  7. data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.md +1 -0
  8. data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_rails.md +1 -0
  9. data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_react.md +1 -0
  10. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +10 -0
  11. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +10 -0
  12. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.md +1 -0
  13. data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_rails.md +1 -0
  14. data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_react.md +1 -0
  15. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +7 -0
  16. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +7 -0
  17. data/app/pb_kits/playbook/pb_currency/docs/_description.md +2 -2
  18. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +3 -0
  19. data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -0
  20. data/app/pb_kits/playbook/pb_date_time/date_time.rb +1 -0
  21. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.html.erb +4 -0
  22. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.jsx +14 -0
  23. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_rails.md +1 -0
  24. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_react.md +1 -0
  25. data/app/pb_kits/playbook/pb_date_time/docs/example.yml +3 -1
  26. data/app/pb_kits/playbook/pb_date_time/docs/index.js +1 -0
  27. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +3 -0
  28. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +2 -2
  29. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +2 -0
  30. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +33 -0
  31. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.html.erb +4 -0
  32. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.jsx +22 -0
  33. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.md +1 -0
  34. data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +3 -1
  35. data/app/pb_kits/playbook/pb_date_time_stacked/docs/index.js +1 -0
  36. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +384 -262
  37. data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +1 -5
  38. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.html.erb +14 -0
  39. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.jsx +29 -0
  40. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.md +3 -0
  41. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.jsx +31 -0
  42. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.md +1 -0
  43. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +4 -1
  44. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +14 -3
  45. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.md +3 -0
  46. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.md +3 -0
  47. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.html.erb +1 -7
  48. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.md +1 -0
  49. data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +3 -0
  50. data/app/pb_kits/playbook/pb_progress_step/docs/index.js +2 -0
  51. data/app/pb_kits/playbook/pb_progress_step/progress_step.test.js +41 -0
  52. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
  53. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +8 -61
  54. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +2 -10
  55. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +11 -19
  56. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +1 -5
  57. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -1
  58. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -2
  59. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +7 -16
  60. data/app/pb_kits/playbook/pb_table/_table.tsx +28 -26
  61. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +4 -0
  62. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -0
  63. data/app/pb_kits/playbook/utilities/_truncate.scss +2 -0
  64. data/app/pb_kits/playbook/utilities/globalProps.ts +26 -8
  65. data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +18 -0
  66. data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +18 -0
  67. data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +18 -0
  68. data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +18 -0
  69. data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +18 -0
  70. data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +18 -0
  71. data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +18 -0
  72. data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +18 -0
  73. data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +18 -0
  74. data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +18 -0
  75. data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +18 -0
  76. data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +18 -0
  77. data/dist/chunks/{_line_graph-8BUASxIP.js → _line_graph-Co6PvNPL.js} +1 -1
  78. data/dist/chunks/_typeahead-D0OX5RuZ.js +6 -0
  79. data/dist/chunks/{_weekday_stacked-EQMaMJvC.js → _weekday_stacked-HzVLtvcd.js} +2 -2
  80. data/dist/chunks/{lib-CzQFzKzw.js → lib-COXg9aPA.js} +1 -1
  81. data/dist/chunks/{pb_form_validation-Bf9TK15t.js → pb_form_validation-DR765aoq.js} +1 -1
  82. data/dist/chunks/vendor.js +1 -1
  83. data/dist/playbook-doc.js +19 -1
  84. data/dist/playbook-rails-react-bindings.js +1 -1
  85. data/dist/playbook-rails.js +1 -1
  86. data/dist/playbook.css +1 -1
  87. data/lib/playbook/version.rb +1 -1
  88. metadata +30 -10
  89. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default_rails.md +0 -7
  90. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline_rails.md +0 -1
  91. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky_rails.md +0 -1
  92. data/dist/chunks/_typeahead-DESMSfUO.js +0 -24
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+
3
+ import ProgressStep from '../_progress_step.tsx'
4
+ import ProgressStepItem from '../_progress_step_item.tsx'
5
+ import Caption from '../../pb_caption/_caption'
6
+
7
+ const ProgressStepColor = (props) => (
8
+ <div>
9
+ <br />
10
+ <ProgressStep
11
+ color="info"
12
+ icon
13
+ variant="tracker"
14
+ {...props}
15
+ >
16
+ <ProgressStepItem status="complete">
17
+ <Caption>{'Ordered'}</Caption>
18
+ </ProgressStepItem>
19
+ <ProgressStepItem status="active">
20
+ <Caption>{'Shipped'}</Caption>
21
+ </ProgressStepItem>
22
+ <ProgressStepItem status="inactive">
23
+ <Caption>{'Delivered'}</Caption>
24
+ </ProgressStepItem>
25
+ </ProgressStep>
26
+ </div>
27
+ )
28
+
29
+ export default ProgressStepColor
@@ -0,0 +1,3 @@
1
+ The `color` prop can also be used to set color for the tracker variant. Options for color are `primary` and `info` with default being set to `primary`.
2
+
3
+ **NOTE**: The `color` prop is only available with the `tracker` variant.
@@ -0,0 +1,31 @@
1
+ import React from 'react'
2
+
3
+ import ProgressStep from '../_progress_step.tsx'
4
+ import ProgressStepItem from '../_progress_step_item.tsx'
5
+ import Caption from '../../pb_caption/_caption'
6
+
7
+ const ProgressStepCustomIcon = (props) => (
8
+ <div>
9
+ <br />
10
+ <ProgressStep
11
+ icon
12
+ variant="tracker"
13
+ {...props}
14
+ >
15
+ <ProgressStepItem status="complete">
16
+ <Caption>{'Ordered'}</Caption>
17
+ </ProgressStepItem>
18
+ <ProgressStepItem
19
+ icon="exclamation-triangle"
20
+ status="active"
21
+ >
22
+ <Caption>{'Shipped'}</Caption>
23
+ </ProgressStepItem>
24
+ <ProgressStepItem status="inactive">
25
+ <Caption>{'Delivered'}</Caption>
26
+ </ProgressStepItem>
27
+ </ProgressStep>
28
+ </div>
29
+ )
30
+
31
+ export default ProgressStepCustomIcon
@@ -0,0 +1 @@
1
+ Custom icons can also be set for individual steps. Simply use the `icon` prop for the relevant `ProgressStepItem`/`progress_step_item` as shown here.
@@ -39,7 +39,10 @@
39
39
  <%= pb_rails("progress_step/progress_step_item", props: {status: "complete"}) do %>
40
40
  step 2
41
41
  <% end %>
42
- <%= pb_rails("progress_step/progress_step_item", props: {status: "complete"}) do %>
42
+ <%= pb_rails("progress_step/progress_step_item", props: {status: "active"}) do %>
43
43
  step 3
44
+ <% end %>
45
+ <%= pb_rails("progress_step/progress_step_item", props: {status: "inactive"}) do %>
46
+ step 4
44
47
  <% end %>
45
48
  <% end %>
@@ -6,7 +6,6 @@ import ProgressStepItem from '../_progress_step_item.tsx'
6
6
  const ProgressStepDefault = (props) => (
7
7
  <div>
8
8
  <ProgressStep
9
- icon
10
9
  {...props}
11
10
  >
12
11
  <ProgressStepItem status="complete" />
@@ -19,12 +18,24 @@ const ProgressStepDefault = (props) => (
19
18
 
20
19
  <ProgressStep {...props}>
21
20
  <ProgressStepItem status="complete">{'Step 1'}</ProgressStepItem>
22
- <ProgressStepItem status="active">{'Step 2'}</ProgressStepItem>
23
- <ProgressStepItem status="inactive">{'Step 3'}</ProgressStepItem>
21
+ <ProgressStepItem status="complete">{'Step 2'}</ProgressStepItem>
22
+ <ProgressStepItem status="active">{'Step 3'}</ProgressStepItem>
23
+ <ProgressStepItem status="inactive">{'Step 4'}</ProgressStepItem>
24
+ <ProgressStepItem status="inactive">{'Step 5'}</ProgressStepItem>
24
25
  </ProgressStep>
25
26
 
26
27
  <br />
27
28
  <br />
29
+
30
+ <ProgressStep
31
+ icon
32
+ {...props}
33
+ >
34
+ <ProgressStepItem status="complete">{'Step 1'}</ProgressStepItem>
35
+ <ProgressStepItem status="complete">{'Step 2'}</ProgressStepItem>
36
+ <ProgressStepItem status="active">{'Step 3'}</ProgressStepItem>
37
+ <ProgressStepItem status="inactive">{'Step 4'}</ProgressStepItem>
38
+ </ProgressStep>
28
39
  </div>
29
40
  )
30
41
 
@@ -0,0 +1,3 @@
1
+ The default Progress Step kit sets orientation to horizontal and can be used with completed, active, and inactive steps as shown here.
2
+
3
+ `icon` is a boolean prop that can also be set to true to render icons within the steps indicator. `icon` is false by default.
@@ -0,0 +1,3 @@
1
+ The `variant` prop can be set to `tracker` to achieve this UI. Tracker is only available with the horizontal orientation and it is also recommended that you set the `icon` prop to true for this variant.
2
+
3
+ This variant takes children just like the default progress step, however, it is best to use the caption kit for children in this variant.
@@ -25,13 +25,7 @@
25
25
  Child
26
26
  <% end %>
27
27
  <%= pb_rails("progress_step/progress_step_item", props: {status: "active"}) do %>
28
- <%= pb_rails("card", props: {highlight: {position: "side", color:"windows"}}) do %>
29
- Card content
30
- <% end %>
31
- <br>
32
- <%= pb_rails("card", props: {highlight: {position: "side", color:"windows"}}) do %>
33
- Card content
34
- <% end %>
28
+ Child
35
29
  <% end %>
36
30
  <%= pb_rails("progress_step/progress_step_item", props: {status: "inactive"}) do %>
37
31
  Child
@@ -0,0 +1 @@
1
+ `orientation` can also be set to `vertical` as shown here. By default, this is set to `horizontal`.
@@ -3,6 +3,7 @@ examples:
3
3
  - progress_step_default: Default
4
4
  - progress_step_vertical: Vertical
5
5
  - progress_step_tracker: Tracker
6
+ - progress_step_color: Color
6
7
  - progress_step_custom_icon: Custom Icon
7
8
  - progress_step_tooltip: Tooltip
8
9
 
@@ -10,4 +11,6 @@ examples:
10
11
  - progress_step_default: Default
11
12
  - progress_step_vertical: Vertical
12
13
  - progress_step_tracker: Tracker
14
+ - progress_step_color: Color
15
+ - progress_step_custom_icon: Custom Icon
13
16
  - progress_step_tracker_click_events: Using State
@@ -2,3 +2,5 @@ export { default as ProgressStepDefault } from './_progress_step_default.jsx'
2
2
  export { default as ProgressStepVertical } from './_progress_step_vertical.jsx'
3
3
  export { default as ProgressStepTracker } from './_progress_step_tracker.jsx'
4
4
  export { default as ProgressStepTrackerClickEvents } from './_progress_step_tracker_click_events.jsx'
5
+ export { default as ProgressStepColor } from './_progress_step_color.jsx'
6
+ export { default as ProgressStepCustomIcon } from './_progress_step_custom_icon.jsx'
@@ -107,3 +107,44 @@ test('should render the children elements', () => {
107
107
  expect(step2Kit).toHaveClass('pb_progress_step_item_active')
108
108
  expect(step3Kit).toHaveClass('pb_progress_step_item_inactive')
109
109
  })
110
+
111
+ test('should render info color', () => {
112
+ render(
113
+ <ProgressStep
114
+ aria={{ label: testId }}
115
+ color="info"
116
+ data={{ testid: testId }}
117
+ variant="tracker"
118
+ >
119
+ <ProgressStepItem status="complete">{'Step 1'}</ProgressStepItem>
120
+ <ProgressStepItem status="active">{'Step 2'}</ProgressStepItem>
121
+ <ProgressStepItem status="inactive">{'Step 3'}</ProgressStepItem>
122
+ </ProgressStep>
123
+ )
124
+
125
+ const kit = screen.getByTestId(testId)
126
+ expect(kit).toHaveClass('pb_progress_step_kit_horizontal_tracker_info')
127
+ })
128
+
129
+ test('should render custom icon', () => {
130
+ render(
131
+ <ProgressStep
132
+ aria={{ label: testId }}
133
+ data={{ testid: testId }}
134
+ variant="tracker"
135
+ >
136
+ <ProgressStepItem icon="exclamation-triangle"
137
+ status="complete"
138
+ >
139
+ {'Step 1'}
140
+ </ProgressStepItem>
141
+ <ProgressStepItem status="active">{'Step 2'}</ProgressStepItem>
142
+ <ProgressStepItem status="inactive">{'Step 3'}</ProgressStepItem>
143
+ </ProgressStep>
144
+ )
145
+
146
+ const kit = screen.getByTestId(testId)
147
+ expect(kit).toHaveClass('pb_progress_step_kit_horizontal_tracker')
148
+ const icon = kit.getAttribute('aria-label', "exclamation-triangle-icon")
149
+ expect(icon).toBeDefined()
150
+ })
@@ -96,7 +96,7 @@ const EditorToolbar = ({ editor, extensions, simple, sticky }: any): React.React
96
96
  <SectionSeparator orientation="vertical" />
97
97
  <ToolbarNodes editor={editor} />
98
98
  {
99
- extensions && extensions.length > 0 && (
99
+ extensions && (
100
100
  <>
101
101
  <MoreExtensionsDropdown extensions={extensions}/>
102
102
  </>
@@ -2,10 +2,6 @@ import React, { useEffect, useState, useRef } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { TrixEditor } from 'react-trix'
4
4
 
5
- import { useEditor, EditorContent } from '@tiptap/react'
6
- import StarterKit from '@tiptap/starter-kit'
7
- import Link from '@tiptap/extension-link'
8
-
9
5
  import inlineFocus from './inlineFocus'
10
6
  import useFocus from './useFocus'
11
7
  import { globalProps, GlobalProps } from '../utilities/globalProps'
@@ -52,8 +48,7 @@ type RichTextEditorProps = {
52
48
  sticky?: boolean,
53
49
  template: string,
54
50
  value?: string,
55
- maxWidth?: string,
56
- railsEditor?: boolean
51
+ maxWidth?: string
57
52
  } & GlobalProps
58
53
 
59
54
  const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
@@ -86,27 +81,6 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
86
81
  [showToolbarOnFocus, setShowToolbarOnFocus] = useState(false),
87
82
  containerRef = useRef<HTMLDivElement>(null)
88
83
 
89
- const isRails = !advancedEditor && props.railsEditor === true
90
-
91
- // TipTap editor for Rails (hook always runs per React rules, but only used when isRails is true)
92
- const railsTipTapEditor = useEditor({
93
- extensions: [StarterKit, Link],
94
- content: value || '',
95
- onUpdate: ({ editor }) => {
96
- if (!isRails) return
97
-
98
- const html = editor.getHTML()
99
- const text = editor.getText()
100
- onChange(html, text)
101
-
102
- // Update hidden input for TipTap Rails form submission
103
- const hiddenInput = document.getElementById(`hidden-input-${props.id || 'rich-text-editor'}`)
104
- if (hiddenInput) {
105
- (hiddenInput as HTMLInputElement).value = html ?? ''
106
- }
107
- },
108
- }, [isRails, value])
109
-
110
84
  const htmlProps = buildHtmlProps(htmlOptions)
111
85
 
112
86
  const handleOnEditorReady = (editorInstance: Editor) => {
@@ -166,8 +140,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
166
140
  }
167
141
 
168
142
  useEffect(() => {
169
- const tiptapEditor = advancedEditor || railsTipTapEditor
170
- if (!tiptapEditor || !focus) return
143
+ if (!advancedEditor || !focus) return
171
144
 
172
145
  const handleFocus = () => setShowToolbarOnFocus(true)
173
146
 
@@ -176,7 +149,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
176
149
  setShowToolbarOnFocus(false)
177
150
  }
178
151
 
179
- const editorElement = tiptapEditor?.view?.dom
152
+ const editorElement = advancedEditor?.view?.dom
180
153
  if (editorElement) {
181
154
  editorElement.addEventListener('focus', handleFocus)
182
155
  }
@@ -189,7 +162,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
189
162
  }
190
163
  document.removeEventListener('mousedown', handleClickOutside)
191
164
  }
192
- }, [advancedEditor, railsTipTapEditor, focus])
165
+ }, [advancedEditor, focus])
193
166
 
194
167
  //============= end focus prop with advanced editor=================
195
168
 
@@ -200,17 +173,6 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
200
173
  editor.insertHTML(template)
201
174
  }, [editor, template])
202
175
 
203
- // Handle value prop changes for Rails TipTap editor
204
- useEffect(() => {
205
- if (!railsTipTapEditor) return
206
- const currentContent = railsTipTapEditor.getHTML()
207
- const newValue = value || ''
208
-
209
- if (currentContent !== newValue) {
210
- railsTipTapEditor.commands.setContent(newValue)
211
- }
212
- }, [railsTipTapEditor, value])
213
-
214
176
  useEffect(() => {
215
177
  if (!editor?.element) return
216
178
  editor.element.addEventListener('click', ({ target }: Event) => {
@@ -238,11 +200,8 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
238
200
  className
239
201
  )
240
202
 
241
- // Get the TipTap editor instance (either passed from React or auto-initialized for Rails)
242
- const tipTapEditor = advancedEditor || (isRails ? railsTipTapEditor : null)
243
-
244
203
  // Determine if toolbar should be shown
245
- const shouldShowToolbar = focus && tipTapEditor ? showToolbarOnFocus : advancedEditorToolbar
204
+ const shouldShowToolbar = focus && advancedEditor ? showToolbarOnFocus : advancedEditorToolbar
246
205
 
247
206
  return (
248
207
  <div
@@ -253,32 +212,20 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
253
212
  ref={focus ? containerRef : undefined}
254
213
  >
255
214
  {
256
- // Render TipTap editor if indicated (React with advancedEditor or Rails by default (railsEditor is true), otherwise Trix
257
- tipTapEditor ? (
215
+ advancedEditor ? (
258
216
  <div
259
217
  className={classnames("pb_rich_text_editor_advanced_container", {
260
218
  ["toolbar-active"]: shouldShowToolbar,
261
219
  })}
262
220
  >
263
221
  {shouldShowToolbar && (
264
- <EditorToolbar editor={tipTapEditor}
222
+ <EditorToolbar editor={advancedEditor}
265
223
  extensions={extensions}
266
224
  simple={simple}
267
225
  sticky={sticky}
268
226
  />
269
227
  )}
270
- {/* EditorContent for Rails railsTipTapEditor, children for React TipTap advancedEditor */}
271
- {railsTipTapEditor ? <EditorContent editor={tipTapEditor} /> : <>{children}</>}
272
-
273
- {/* Set up hidden input for TipTap Rails form submission */}
274
- {railsTipTapEditor && (
275
- <input
276
- id={`hidden-input-${props.id || 'rich-text-editor'}`}
277
- name={name || 'content'}
278
- type="hidden"
279
- value={tipTapEditor?.getHTML() ?? ''}
280
- />
281
- )}
228
+ { children }
282
229
  </div>
283
230
  ) : (
284
231
  <TrixEditor
@@ -1,11 +1,3 @@
1
- <%= pb_rails("rich_text_editor", props: {
2
- id: "focus-editor-1",
3
- focus: true,
4
- value: "Click inside to see the toolbar. Click outside to hide it."
5
- }) %>
1
+ <%= pb_rails("rich_text_editor", props: {focus: true}) %>
6
2
  <br>
7
- <%= pb_rails("rich_text_editor", props: {
8
- id: "focus-editor-2",
9
- focus: true,
10
- value: "When the optional focus prop is set to true, the toolbar will only show once you click in to the RichTextEditor."
11
- }) %>
3
+ <%= pb_rails("rich_text_editor", props: {focus: true}) %>
@@ -1,38 +1,30 @@
1
- <%= pb_rails("rich_text_editor", props: {
2
- id: "content-preview-editor",
3
- margin_bottom: "md",
4
- value: "Add text here, format it, and press \"Preview Output\" to see what your stylized output will look like on the page."
5
- }) %>
6
-
7
- <%= pb_rails("button", props: { id: "preview-button", text: "Preview Output", variant: "secondary" }) %>
8
1
 
2
+ <%= pb_rails("rich_text_editor", props: { id: "content-preview-editor" }) %>
9
3
  <div id="card-obfuscation" style="display:none">
10
4
  <%= pb_rails("card", props: { margin_top: "md", max_width: "md", padding: "sm" }) do %>
11
- <div id="content-preview" class="tiptap-content">
5
+ <div id="content-preview" class="trix-content">
12
6
  </div>
13
7
  <% end %>
14
8
  </div>
9
+ <%= pb_rails("button", props: { id: "preview-button", variant: "secondary", margin_top: "md" }) do %>
10
+ <span>Preview Output</span>
11
+ <% end %>
15
12
 
16
13
  <script>
17
14
  document.addEventListener('DOMContentLoaded', () => {
18
15
  function handleButtonClick() {
19
- // Find the specific TipTap editor container by ID
20
16
  const editorContainer = [...document.querySelectorAll('[data-pb-react-props]')]
21
17
  .find(element => element.getAttribute('data-pb-react-props')?.includes('"id":"content-preview-editor"'))
22
18
 
23
- if (!editorContainer) {
24
- console.log('Editor container not found')
25
- return
26
- }
27
-
28
- // Find the TipTap editor content
29
- const tiptapEditor = editorContainer.querySelector('.ProseMirror')
19
+ const editorElement = editorContainer?.querySelector('trix-editor')
20
+ const inputId = editorElement?.getAttribute('input')
21
+ const inputElement = inputId && document.getElementById(inputId)
22
+
23
+ const editorContent = inputElement?.value || ''
30
24
  const previewArea = document.getElementById('content-preview')
31
25
  const cardDiv = document.getElementById('card-obfuscation')
32
26
 
33
- if (tiptapEditor && previewArea && cardDiv) {
34
- // Get the HTML content from the TipTap editor
35
- const editorContent = tiptapEditor.innerHTML || ''
27
+ if (previewArea && cardDiv) {
36
28
  previewArea.innerHTML = editorContent
37
29
  cardDiv.style.display = 'block'
38
30
  }
@@ -1,5 +1 @@
1
- <%= pb_rails("rich_text_editor", props: {
2
- id: "simple-editor",
3
- simple: true,
4
- value: "Add your text here. Use the simple toolbar above to format your text."
5
- }) %>
1
+ <%= pb_rails("rich_text_editor", props: {simple: true, id: "simple"}) %>
@@ -1 +1 @@
1
- <%= pb_rails("rich_text_editor", props: {id: "sticky-editor", sticky: true, value: "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."}) %>
1
+ <%= pb_rails("rich_text_editor", props: {id: "sticky", sticky: true, value: "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."}) %>
@@ -3,10 +3,10 @@ examples:
3
3
  rails:
4
4
  - rich_text_editor_default: Default
5
5
  - rich_text_editor_simple: Simple
6
- # - rich_text_editor_attributes: Attributes
6
+ - rich_text_editor_attributes: Attributes
7
7
  - rich_text_editor_focus: Focus
8
8
  - rich_text_editor_sticky: Sticky
9
- # - rich_text_editor_templates: Templates
9
+ - rich_text_editor_templates: Templates
10
10
  # - rich_text_editor_toolbar_bottom: Toolbar Bottom
11
11
  - rich_text_editor_inline: Inline
12
12
  - rich_text_editor_preview: Preview
@@ -18,15 +18,9 @@ module Playbook
18
18
  default: false
19
19
 
20
20
  prop :value
21
+ prop :template
21
22
  prop :placeholder
22
23
  prop :input_options
23
- prop :advanced_editor_toolbar, type: Playbook::Props::Boolean,
24
- default: true
25
- prop :extensions, type: Playbook::Props::HashArray,
26
- default: []
27
- prop :max_width, type: Playbook::Props::Enum,
28
- values: %w[xs sm md lg xl],
29
- default: "md"
30
24
 
31
25
  def classname
32
26
  generate_classname("pb_rich_text_editor_kit", simple_class, focus_class, sticky_class, separator: " ")
@@ -46,20 +40,17 @@ module Playbook
46
40
 
47
41
  def rich_text_options
48
42
  {
49
- advancedEditorToolbar: advanced_editor_toolbar,
50
- className: classname,
51
- extensions: extensions,
52
- focus: focus,
53
43
  id: id,
54
44
  inline: inline,
55
- inputOptions: input_options,
56
- maxWidth: max_width,
57
- placeholder: placeholder,
58
- railsEditor: true,
45
+ className: classname,
46
+ focus: focus,
59
47
  simple: simple,
60
48
  sticky: sticky,
61
49
  toolbarBottom: toolbar_bottom,
62
- value: value || "",
50
+ value: value,
51
+ template: template,
52
+ placeholder: placeholder,
53
+ inputOptions: input_options,
63
54
  }
64
55
  end
65
56
  end
@@ -119,21 +119,22 @@ const Table = (props: TableProps): React.ReactElement => {
119
119
  header.classList.add('sticky-left-shadow');
120
120
  }
121
121
 
122
- accumulatedWidth += (header as HTMLElement).offsetWidth;
123
- }
122
+ const headerWidth = (header as HTMLElement).offsetWidth;
123
+ accumulatedWidth += headerWidth;
124
124
 
125
- cells.forEach((cell) => {
126
- cell.classList.add('sticky');
127
- (cell as HTMLElement).style.left = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
125
+ cells.forEach((cell) => {
126
+ cell.classList.add('sticky');
127
+ (cell as HTMLElement).style.left = `${accumulatedWidth - headerWidth}px`;
128
128
 
129
- if (!isLastColumn) {
130
- cell.classList.add('with-border-right');
131
- cell.classList.remove('sticky-left-shadow');
132
- } else {
133
- cell.classList.remove('with-border-right');
134
- cell.classList.add('sticky-left-shadow');
135
- }
136
- });
129
+ if (!isLastColumn) {
130
+ cell.classList.add('with-border-right');
131
+ cell.classList.remove('sticky-left-shadow');
132
+ } else {
133
+ cell.classList.remove('with-border-right');
134
+ cell.classList.add('sticky-left-shadow');
135
+ }
136
+ });
137
+ }
137
138
  });
138
139
  };
139
140
 
@@ -170,21 +171,22 @@ const Table = (props: TableProps): React.ReactElement => {
170
171
  header.classList.add('sticky-right-shadow');
171
172
  }
172
173
 
173
- accumulatedWidth += (header as HTMLElement).offsetWidth;
174
- }
174
+ const headerWidth = (header as HTMLElement).offsetWidth;
175
+ accumulatedWidth += headerWidth;
175
176
 
176
- cells.forEach((cell) => {
177
- cell.classList.add('sticky');
178
- (cell as HTMLElement).style.right = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
177
+ cells.forEach((cell) => {
178
+ cell.classList.add('sticky');
179
+ (cell as HTMLElement).style.right = `${accumulatedWidth - headerWidth}px`;
179
180
 
180
- if (!isLastColumn) {
181
- cell.classList.add('with-border-left');
182
- cell.classList.remove('sticky-right-shadow');
183
- } else {
184
- cell.classList.remove('with-border-left');
185
- cell.classList.add('sticky-right-shadow');
186
- }
187
- });
181
+ if (!isLastColumn) {
182
+ cell.classList.add('with-border-left');
183
+ cell.classList.remove('sticky-right-shadow');
184
+ } else {
185
+ cell.classList.remove('with-border-left');
186
+ cell.classList.add('sticky-right-shadow');
187
+ }
188
+ });
189
+ }
188
190
  });
189
191
  };
190
192
 
@@ -161,6 +161,10 @@
161
161
  .typeahead-plus-icon {
162
162
  color: $text_lt_lighter;
163
163
  }
164
+ .pb_badge_kit_primary {
165
+ margin-bottom: 2px;
166
+ margin-top: 2px;
167
+ }
164
168
  .pb_badge_kit_primary span {
165
169
  line-height: 16.5px;
166
170
  letter-spacing: normal;
@@ -62,6 +62,7 @@ const MultiValue = (props: Props) => {
62
62
  className={pillClassName}
63
63
  closeProps={removeProps}
64
64
  htmlOptions={{onKeyDown:handleKeyDown}}
65
+ marginRight="xs"
65
66
  removeIcon
66
67
  tabIndex={0}
67
68
  text={label}
@@ -11,6 +11,8 @@ $truncate-styles: (
11
11
  display: -webkit-box;
12
12
  -webkit-line-clamp: $number;
13
13
  -webkit-box-orient: vertical;
14
+ overflow-wrap: anywhere;
15
+ word-break: break-all;
14
16
  }
15
17
 
16
18
  @each $class, $number in $truncate-styles {