playbook_ui 15.7.0.pre.alpha.PLAY2678emojimask13284 → 15.7.0.pre.alpha.play2607setheightofeditor13370
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +9 -7
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js +3 -8
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +8 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +53 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.jsx +71 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_heigh.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx +71 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +3 -1
- data/dist/chunks/{_typeahead-CSCNg6cp.js → _typeahead-D0GNUBXn.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f960f22bca9b3635502362441b26a13583eb183fcdebab46ebbca3f5b2b64d33
|
|
4
|
+
data.tar.gz: 37dd6c333df8bc2149be578ef208c32fea70e3ebdec053a8ab180ec5bf56e1d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 694f79e8ddf8ab1bd308e0d0f85faacbd856f66dfbb52f728074ff1721d673b0d4d32513c0aa5dd4c05f652aeb73d1ae4f5c77258fedbdb26b17f80fdcbf1e3d
|
|
7
|
+
data.tar.gz: b8cb5e6390f7a57b562a29dfa341ec33860bdee17c24df89ead92d06d01ae82bf9283600c0d0f4aedcf9b6dafc1b0cddb2eebd4bebdf5118b4fd10a356e65004
|
|
@@ -30,10 +30,6 @@ module Playbook
|
|
|
30
30
|
closeable.present? ? " remove_toast" : ""
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def auto_close_class
|
|
34
|
-
auto_close.present? ? " auto_close_#{auto_close}" : ""
|
|
35
|
-
end
|
|
36
|
-
|
|
37
33
|
def position_class
|
|
38
34
|
horizontal && vertical ? " positioned_toast #{vertical} #{horizontal}" : ""
|
|
39
35
|
end
|
|
@@ -42,6 +38,14 @@ module Playbook
|
|
|
42
38
|
multi_line.present? ? "multi_line" : nil
|
|
43
39
|
end
|
|
44
40
|
|
|
41
|
+
def auto_close_attribute
|
|
42
|
+
auto_close.present? ? { "pb-auto-close": auto_close } : {}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def data
|
|
46
|
+
Hash(prop(:data)).merge(auto_close_attribute)
|
|
47
|
+
end
|
|
48
|
+
|
|
45
49
|
def icon_value
|
|
46
50
|
icon || case status
|
|
47
51
|
when "success"
|
|
@@ -61,9 +65,7 @@ module Playbook
|
|
|
61
65
|
|
|
62
66
|
def classname
|
|
63
67
|
default_z_index = z_index.present? ? "" : " z_index_max"
|
|
64
|
-
|
|
65
|
-
# Changing the order will break the auto_close functionality
|
|
66
|
-
generate_classname("pb_fixed_confirmation_toast_kit", status, multi_line_class) + close_class + position_class + icon_class + default_z_index + auto_close_class
|
|
68
|
+
generate_classname("pb_fixed_confirmation_toast_kit", status, multi_line_class) + close_class + position_class + icon_class + default_z_index
|
|
67
69
|
end
|
|
68
70
|
end
|
|
69
71
|
end
|
|
@@ -21,17 +21,12 @@ export default class PbFixedConfirmationToast extends PbEnhancedElement {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
autoCloseToast(element) {
|
|
24
|
-
const
|
|
25
|
-
const hasAutoCloseClass = classListValues.includes('auto_close')
|
|
26
|
-
|
|
27
|
-
if (hasAutoCloseClass) {
|
|
28
|
-
const classList = classListValues.split(' ')
|
|
29
|
-
const autoCloseValue = classList[classList.length - 1].split('_')[2]
|
|
30
|
-
const autoCloseIntValue = parseInt(autoCloseValue)
|
|
24
|
+
const autoCloseDataAttr = element.getAttribute('data-pb-auto-close')
|
|
31
25
|
|
|
26
|
+
if (autoCloseDataAttr) {
|
|
32
27
|
setTimeout(() => {
|
|
33
28
|
this.removeToast(element)
|
|
34
|
-
},
|
|
29
|
+
}, parseInt(autoCloseDataAttr))
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
32
|
}
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
|
|
91
91
|
<%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
|
|
92
92
|
<%= form.typeahead :example_typeahead, props: { data: { typeahead_example1: true, user: {} }, label: true, placeholder: "Search for a user" } %>
|
|
93
|
-
<%= form.text_field :example_text_field, props: { label:
|
|
93
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
|
94
94
|
<%= form.text_field :example_text_field_2, props: { label: "Text Field Custom Label" } %>
|
|
95
95
|
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field", hidden_inputs: true } %>
|
|
96
96
|
<%= form.email_field :example_email_field, props: { label: true } %>
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
<%= form.search_field :example_search_field, props: { label: true } %>
|
|
99
99
|
<%= form.password_field :example_password_field, props: { label: true } %>
|
|
100
100
|
<%= form.url_field :example_url_field, props: { label: true } %>
|
|
101
|
-
<%= form.text_area :example_text_area, props: { label:
|
|
101
|
+
<%= form.text_area :example_text_area, props: { label: true } %>
|
|
102
102
|
<%= form.dropdown_field :example_dropdown, props: { label: true, options: example_dropdown_options } %>
|
|
103
103
|
<%= form.dropdown_field :example_dropdown_multi, props: { label: true, options: example_dropdown_options, multi_select: true } %>
|
|
104
104
|
<%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true } %>
|
|
@@ -4,7 +4,7 @@ import Flex from "../../pb_flex/_flex";
|
|
|
4
4
|
import FlexItem from "../../pb_flex/_flex_item";
|
|
5
5
|
import SectionSeparator from "../../pb_section_separator/_section_separator";
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import EditorButton from "./EditorButton";
|
|
8
8
|
import ToolbarDropdown from "./ToolbarDropdown";
|
|
9
9
|
import ToolbarNodes from "./ToolbarNodes";
|
|
10
10
|
import { ToolbarTypes } from "./EditorTypes";
|
|
@@ -44,6 +44,8 @@ type RichTextEditorProps = {
|
|
|
44
44
|
name?: string,
|
|
45
45
|
onChange: (html: string, text: string) => void,
|
|
46
46
|
placeholder?: string,
|
|
47
|
+
inputHeight?: "sm" | "md" | "lg",
|
|
48
|
+
inputMinHeight?: "sm" | "md" | "lg",
|
|
47
49
|
simple?: boolean,
|
|
48
50
|
sticky?: boolean,
|
|
49
51
|
template: string,
|
|
@@ -68,6 +70,8 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
|
|
|
68
70
|
name,
|
|
69
71
|
onChange = noop,
|
|
70
72
|
placeholder,
|
|
73
|
+
inputHeight,
|
|
74
|
+
inputMinHeight,
|
|
71
75
|
simple = false,
|
|
72
76
|
sticky = false,
|
|
73
77
|
template = '',
|
|
@@ -214,9 +218,10 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
|
|
|
214
218
|
{
|
|
215
219
|
advancedEditor ? (
|
|
216
220
|
<div
|
|
217
|
-
className={classnames(
|
|
218
|
-
|
|
219
|
-
|
|
221
|
+
className={classnames(
|
|
222
|
+
"pb_rich_text_editor_advanced_container",
|
|
223
|
+
{ [`input_height_${inputHeight}`]: !!inputHeight,[`input_min_height_${inputMinHeight}`]: !!inputMinHeight ,["toolbar-active"]: shouldShowToolbar }
|
|
224
|
+
)}
|
|
220
225
|
>
|
|
221
226
|
{shouldShowToolbar && (
|
|
222
227
|
<EditorToolbar editor={advancedEditor}
|
|
@@ -205,6 +205,59 @@
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
+
|
|
209
|
+
.pb_rich_text_editor_advanced_container.input_height_sm {
|
|
210
|
+
div {
|
|
211
|
+
.tiptap.ProseMirror {
|
|
212
|
+
height: 131px;
|
|
213
|
+
overflow: auto;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.pb_rich_text_editor_advanced_container.input_height_md {
|
|
219
|
+
div {
|
|
220
|
+
.tiptap.ProseMirror {
|
|
221
|
+
height: 180px;
|
|
222
|
+
overflow: auto;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.pb_rich_text_editor_advanced_container.input_height_lg {
|
|
228
|
+
div {
|
|
229
|
+
.tiptap.ProseMirror {
|
|
230
|
+
height: 230px;
|
|
231
|
+
overflow: auto;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.pb_rich_text_editor_advanced_container.input_min_height_sm {
|
|
237
|
+
div {
|
|
238
|
+
.tiptap.ProseMirror {
|
|
239
|
+
min-height: 131px;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.pb_rich_text_editor_advanced_container.input_min_height_md {
|
|
245
|
+
div {
|
|
246
|
+
.tiptap.ProseMirror {
|
|
247
|
+
min-height: 180px;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.pb_rich_text_editor_advanced_container.input_min_height_lg {
|
|
253
|
+
div {
|
|
254
|
+
.tiptap.ProseMirror {
|
|
255
|
+
min-height: 230px;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
|
|
208
261
|
.tiptap-content {
|
|
209
262
|
@include preview_tiptap_first_child;
|
|
210
263
|
a {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import RichTextEditor from '../_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
|
+
import { Caption } from "playbook-ui"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const RichTextEditorAdvancedHeight = (props) => {
|
|
10
|
+
|
|
11
|
+
const editor = useEditor({
|
|
12
|
+
extensions: [
|
|
13
|
+
StarterKit,
|
|
14
|
+
Link
|
|
15
|
+
],
|
|
16
|
+
content: "Add your text here. You can format your text, add links, quotes, and bullets."
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const editor2 = useEditor({
|
|
20
|
+
extensions: [
|
|
21
|
+
StarterKit,
|
|
22
|
+
Link
|
|
23
|
+
],
|
|
24
|
+
content: "Add your text here. You can format your text, add links, quotes, and bullets."
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const editor3 = useEditor({
|
|
28
|
+
extensions: [
|
|
29
|
+
StarterKit,
|
|
30
|
+
Link
|
|
31
|
+
],
|
|
32
|
+
content: "Add your text here. You can format your text, add links, quotes, and bullets."
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div>
|
|
37
|
+
<Caption>sm</Caption>
|
|
38
|
+
<RichTextEditor
|
|
39
|
+
advancedEditor={editor}
|
|
40
|
+
inputHeight="sm"
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
<EditorContent editor={editor} />
|
|
44
|
+
</RichTextEditor>
|
|
45
|
+
|
|
46
|
+
<br />
|
|
47
|
+
|
|
48
|
+
<Caption>md</Caption>
|
|
49
|
+
<RichTextEditor
|
|
50
|
+
advancedEditor={editor2}
|
|
51
|
+
inputHeight="md"
|
|
52
|
+
{...props}
|
|
53
|
+
>
|
|
54
|
+
<EditorContent editor={editor2} />
|
|
55
|
+
</RichTextEditor>
|
|
56
|
+
|
|
57
|
+
<br />
|
|
58
|
+
|
|
59
|
+
<Caption>lg</Caption>
|
|
60
|
+
<RichTextEditor
|
|
61
|
+
advancedEditor={editor3}
|
|
62
|
+
inputHeight="lg"
|
|
63
|
+
{...props}
|
|
64
|
+
>
|
|
65
|
+
<EditorContent editor={editor3} />
|
|
66
|
+
</RichTextEditor>
|
|
67
|
+
</div>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default RichTextEditorAdvancedHeight
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Use the `inputHeight` prop to keep the text area a specific height. If the text exceeds the text area, it will automatically add a scrollbar to maintain the fixed height.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Use the inputMinHeight prop to render the text area with a minimum height. If the text exceeds the text area, the text area will grow to accommodate it.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import RichTextEditor from '../_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
|
+
import { Caption } from "playbook-ui"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const RichTextEditorAdvancedMinHeight = (props) => {
|
|
10
|
+
|
|
11
|
+
const editor1 = useEditor({
|
|
12
|
+
extensions: [
|
|
13
|
+
StarterKit,
|
|
14
|
+
Link
|
|
15
|
+
],
|
|
16
|
+
content: "Add your text here. You can format your text, add links, quotes, and bullets."
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const editor2 = useEditor({
|
|
20
|
+
extensions: [
|
|
21
|
+
StarterKit,
|
|
22
|
+
Link
|
|
23
|
+
],
|
|
24
|
+
content: "Add your text here. You can format your text, add links, quotes, and bullets."
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const editor3 = useEditor({
|
|
28
|
+
extensions: [
|
|
29
|
+
StarterKit,
|
|
30
|
+
Link
|
|
31
|
+
],
|
|
32
|
+
content: "Add your text here. You can format your text, add links, quotes, and bullets."
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div>
|
|
37
|
+
<Caption>sm</Caption>
|
|
38
|
+
<RichTextEditor
|
|
39
|
+
advancedEditor={editor1}
|
|
40
|
+
inputMinHeight="sm"
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
<EditorContent editor={editor1} />
|
|
44
|
+
</RichTextEditor>
|
|
45
|
+
|
|
46
|
+
<br />
|
|
47
|
+
|
|
48
|
+
<Caption>md</Caption>
|
|
49
|
+
<RichTextEditor
|
|
50
|
+
advancedEditor={editor2}
|
|
51
|
+
inputMinHeight="md"
|
|
52
|
+
{...props}
|
|
53
|
+
>
|
|
54
|
+
<EditorContent editor={editor2} />
|
|
55
|
+
</RichTextEditor>
|
|
56
|
+
|
|
57
|
+
<br />
|
|
58
|
+
|
|
59
|
+
<Caption>lg</Caption>
|
|
60
|
+
<RichTextEditor
|
|
61
|
+
advancedEditor={editor3}
|
|
62
|
+
inputMinHeight="lg"
|
|
63
|
+
{...props}
|
|
64
|
+
>
|
|
65
|
+
<EditorContent editor={editor3} />
|
|
66
|
+
</RichTextEditor>
|
|
67
|
+
</div>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default RichTextEditorAdvancedMinHeight
|
|
@@ -29,5 +29,7 @@ examples:
|
|
|
29
29
|
# - rich_text_editor_toolbar_bottom: Toolbar Bottom
|
|
30
30
|
- rich_text_editor_inline: Inline
|
|
31
31
|
- rich_text_editor_advanced_inline: Advanced (Inline)
|
|
32
|
+
- rich_text_editor_advanced_height: Advanced Height
|
|
33
|
+
- rich_text_editor_advanced_min_height: Advanced Min Height
|
|
32
34
|
- rich_text_editor_preview: Preview
|
|
33
35
|
- rich_text_editor_advanced_preview: Advanced Preview
|
|
@@ -16,4 +16,6 @@ export { default as RichTextEditorAdvancedFocus } from './_rich_text_editor_adva
|
|
|
16
16
|
export { default as RichTextEditorAdvancedTemplates } from './_rich_text_editor_advanced_templates.jsx'
|
|
17
17
|
export { default as RichTextEditorAdvancedAttributes } from './_rich_text_editor_advanced_attributes.jsx'
|
|
18
18
|
export { default as RichTextEditorAdvancedSticky } from './_rich_text_editor_advanced_sticky.jsx'
|
|
19
|
-
export { default as RichTextEditorAdvancedInline } from './_rich_text_editor_advanced_inline.jsx'
|
|
19
|
+
export { default as RichTextEditorAdvancedInline } from './_rich_text_editor_advanced_inline.jsx'
|
|
20
|
+
export { default as RichTextEditorAdvancedHeight } from './_rich_text_editor_advanced_height.jsx'
|
|
21
|
+
export { default as RichTextEditorAdvancedMinHeight } from './_rich_text_editor_advanced_min_height.jsx'
|