playbook_ui 15.7.0.pre.alpha.play2607setheightofeditor13370 → 15.7.0.pre.alpha.play258013248
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_rich_text_editor/TipTap/Toolbar.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +3 -8
- data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +0 -53
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +3 -41
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_text_input/index.js +8 -49
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +1 -5
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +0 -53
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +2 -38
- data/app/pb_kits/playbook/pb_textarea/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_textarea/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_textarea/index.ts +5 -62
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +0 -1
- data/app/pb_kits/playbook/pb_textarea/textarea.rb +0 -8
- data/app/pb_kits/playbook/pb_textarea/textarea.test.js +2 -57
- data/dist/chunks/{_typeahead-D0GNUBXn.js → _typeahead-Ckz1ce-2.js} +2 -2
- data/dist/chunks/{lib-DxCgrqqG.js → lib-DxDBrGZX.js} +1 -1
- data/dist/chunks/vendor.js +3 -3
- 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/forms/builder/form_field_builder.rb +0 -2
- data/lib/playbook/version.rb +1 -1
- metadata +4 -15
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.jsx +0 -71
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_heigh.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx +0 -71
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_mask.html.erb +0 -7
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_mask.jsx +0 -24
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_mask.md +0 -2
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.html.erb +0 -5
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.jsx +0 -24
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.md +0 -1
- data/app/pb_kits/playbook/utilities/emojiMask.ts +0 -42
|
@@ -46,8 +46,6 @@ module Playbook
|
|
|
46
46
|
options[:data] = (options[:data] || {}).merge(message: validation[:message]) if validation[:message].present?
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
options[:data] = (options[:data] || {}).merge(pb_emoji_mask: true) if props.key?(:emoji_mask) && props[:emoji_mask]
|
|
50
|
-
|
|
51
49
|
input = super(name, **options, &block)
|
|
52
50
|
|
|
53
51
|
input_id = input[/\bid="([^"]+)"/, 1] || "#{@object_name}_#{name}"
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: playbook_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 15.7.0.pre.alpha.
|
|
4
|
+
version: 15.7.0.pre.alpha.play258013248
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Power UX
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-01-
|
|
12
|
+
date: 2026-01-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: actionpack
|
|
@@ -2863,12 +2863,8 @@ files:
|
|
|
2863
2863
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.md
|
|
2864
2864
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.jsx
|
|
2865
2865
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.md
|
|
2866
|
-
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.jsx
|
|
2867
|
-
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.md
|
|
2868
2866
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.jsx
|
|
2869
2867
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.md
|
|
2870
|
-
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_heigh.md
|
|
2871
|
-
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx
|
|
2872
2868
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_preview.jsx
|
|
2873
2869
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_simple.jsx
|
|
2874
2870
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.jsx
|
|
@@ -3372,9 +3368,6 @@ files:
|
|
|
3372
3368
|
- app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled.html.erb
|
|
3373
3369
|
- app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled.jsx
|
|
3374
3370
|
- app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled_swift.md
|
|
3375
|
-
- app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_mask.html.erb
|
|
3376
|
-
- app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_mask.jsx
|
|
3377
|
-
- app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_mask.md
|
|
3378
3371
|
- app/pb_kits/playbook/pb_text_input/docs/_text_input_error.html.erb
|
|
3379
3372
|
- app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx
|
|
3380
3373
|
- app/pb_kits/playbook/pb_text_input/docs/_text_input_error.md
|
|
@@ -3412,9 +3405,6 @@ files:
|
|
|
3412
3405
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_default.html.erb
|
|
3413
3406
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_default.jsx
|
|
3414
3407
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_default_swift.md
|
|
3415
|
-
- app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.html.erb
|
|
3416
|
-
- app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.jsx
|
|
3417
|
-
- app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.md
|
|
3418
3408
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_error.html.erb
|
|
3419
3409
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx
|
|
3420
3410
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_error.md
|
|
@@ -3912,7 +3902,6 @@ files:
|
|
|
3912
3902
|
- app/pb_kits/playbook/utilities/_vertical_align.scss
|
|
3913
3903
|
- app/pb_kits/playbook/utilities/_width.scss
|
|
3914
3904
|
- app/pb_kits/playbook/utilities/deprecated.ts
|
|
3915
|
-
- app/pb_kits/playbook/utilities/emojiMask.ts
|
|
3916
3905
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_content.scss
|
|
3917
3906
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_items.scss
|
|
3918
3907
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_self.scss
|
|
@@ -3952,9 +3941,9 @@ files:
|
|
|
3952
3941
|
- app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
|
|
3953
3942
|
- app/pb_kits/playbook/utilities/text.ts
|
|
3954
3943
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
|
3955
|
-
- dist/chunks/_typeahead-
|
|
3944
|
+
- dist/chunks/_typeahead-Ckz1ce-2.js
|
|
3956
3945
|
- dist/chunks/lazysizes-B7xYodB-.js
|
|
3957
|
-
- dist/chunks/lib-
|
|
3946
|
+
- dist/chunks/lib-DxDBrGZX.js
|
|
3958
3947
|
- dist/chunks/vendor.js
|
|
3959
3948
|
- dist/menu.yml
|
|
3960
3949
|
- dist/playbook-rails-react-bindings.js
|
|
@@ -1,71 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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.
|
|
@@ -1 +0,0 @@
|
|
|
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.
|
data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
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
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
|
|
3
|
-
import TextInput from '../../pb_text_input/_text_input'
|
|
4
|
-
|
|
5
|
-
const TextInputEmojiMask = (props) => {
|
|
6
|
-
const [basicValue, setBasicValue] = useState('')
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<div>
|
|
10
|
-
<TextInput
|
|
11
|
-
emojiMask
|
|
12
|
-
label="Emoji Mask"
|
|
13
|
-
onChange={({ target }) => setBasicValue(target.value)}
|
|
14
|
-
placeholder="Try typing or pasting emojis..."
|
|
15
|
-
value={basicValue}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default TextInputEmojiMask
|
|
23
|
-
|
|
24
|
-
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
|
|
3
|
-
import Textarea from '../../pb_textarea/_textarea'
|
|
4
|
-
|
|
5
|
-
const TextareaEmojiMask = (props) => {
|
|
6
|
-
const [basicValue, setBasicValue] = useState('')
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<div>
|
|
10
|
-
<Textarea
|
|
11
|
-
emojiMask
|
|
12
|
-
label="Emoji Mask"
|
|
13
|
-
onChange={({ target }) => setBasicValue(target.value)}
|
|
14
|
-
placeholder="Try typing or pasting emojis..."
|
|
15
|
-
value={basicValue}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default TextareaEmojiMask
|
|
23
|
-
|
|
24
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Use the `emojiMask` / `emoji_mask` prop to prevent users from entering emoji characters (🐸 🐈 🏄♂️) in typed or pasted content. It allows accented characters and other non-ASCII letters (é, ü, 文).
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// Regex to match emoji/pictographic characters
|
|
2
|
-
// With modifiers: Zero Width Joiner, Variation Selectors, Skin Tone Modifiers
|
|
3
|
-
export const EMOJI_REGEX = /\p{Extended_Pictographic}|\u200D|\uFE0F|[\u{1F3FB}-\u{1F3FF}]/gu
|
|
4
|
-
|
|
5
|
-
// Utility function to strip emojis from text when typing emojis
|
|
6
|
-
export const stripEmojisForTyping = (text: string): string => {
|
|
7
|
-
return text.replace(EMOJI_REGEX, '')
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// Utility function to strip emojis and clean up whitespace when pasting emojis
|
|
11
|
-
export const stripEmojisForPaste = (text: string): string => {
|
|
12
|
-
return stripEmojisForTyping(text)
|
|
13
|
-
.replace(/\s+/g, ' ')
|
|
14
|
-
.trim()
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
type EmojiMaskResult = {
|
|
18
|
-
value: string
|
|
19
|
-
cursor: number | null
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Union type for elements that support emoji masking
|
|
23
|
-
type TextInputElement = HTMLInputElement | HTMLTextAreaElement
|
|
24
|
-
|
|
25
|
-
export const applyEmojiMask = (
|
|
26
|
-
element: TextInputElement
|
|
27
|
-
): EmojiMaskResult => {
|
|
28
|
-
const cursor = element.selectionStart
|
|
29
|
-
const original = element.value
|
|
30
|
-
const filtered = stripEmojisForTyping(original)
|
|
31
|
-
|
|
32
|
-
if (original !== filtered) {
|
|
33
|
-
const beforeCursor = original.slice(0, cursor || 0)
|
|
34
|
-
const newCursor = stripEmojisForTyping(beforeCursor).length
|
|
35
|
-
element.value = filtered
|
|
36
|
-
element.selectionStart = element.selectionEnd = newCursor
|
|
37
|
-
return { value: filtered, cursor: newCursor }
|
|
38
|
-
}
|
|
39
|
-
return { value: original, cursor }
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|