@livepreso/react-plugin-textfield 0.4.4 → 0.5.0
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.
- package/CHANGELOG.json +12 -0
- package/CHANGELOG.md +8 -1
- package/index.js +15 -0
- package/index.module.scss +12 -0
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livepreso/react-plugin-textfield",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.5.0",
|
|
6
|
+
"tag": "@livepreso/react-plugin-textfield_v0.5.0",
|
|
7
|
+
"date": "Mon, 27 Jul 2026 04:05:41 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Add placeholder property"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.4.4",
|
|
6
18
|
"tag": "@livepreso/react-plugin-textfield_v0.4.4",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Change Log - @livepreso/react-plugin-textfield
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 27 Jul 2026 04:05:41 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.5.0
|
|
6
|
+
Mon, 27 Jul 2026 04:05:41 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- Add placeholder property
|
|
4
11
|
|
|
5
12
|
## 0.4.4
|
|
6
13
|
Wed, 06 May 2026 23:36:35 GMT
|
package/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import Document from "@tiptap/extension-document";
|
|
|
19
19
|
import HardBreak from "@tiptap/extension-hard-break";
|
|
20
20
|
import Paragraph from "@tiptap/extension-paragraph";
|
|
21
21
|
import Text from "@tiptap/extension-text";
|
|
22
|
+
import { Placeholder } from "@tiptap/extensions";
|
|
22
23
|
import {
|
|
23
24
|
EditorContent,
|
|
24
25
|
EditorContext,
|
|
@@ -64,6 +65,9 @@ function EditableTextField({
|
|
|
64
65
|
disableSpellcheck = false,
|
|
65
66
|
mode,
|
|
66
67
|
tokenConfig = {},
|
|
68
|
+
// Faint prompt shown while the field is empty and editable. Destructured here
|
|
69
|
+
// so it drives the Placeholder extension rather than landing on the DOM node.
|
|
70
|
+
placeholder,
|
|
67
71
|
// TODO implement an equivalent to the EditableText handler
|
|
68
72
|
// for editables inside tab handlers / accordion headers etc
|
|
69
73
|
// stopPropagation = false,
|
|
@@ -150,6 +154,17 @@ function EditableTextField({
|
|
|
150
154
|
...baseExtensions,
|
|
151
155
|
...toolbarAddedExtensions,
|
|
152
156
|
...otherExtensions,
|
|
157
|
+
...(placeholder
|
|
158
|
+
? [
|
|
159
|
+
Placeholder.configure({
|
|
160
|
+
placeholder,
|
|
161
|
+
// only while editable (present/PDF stay blank); show on any
|
|
162
|
+
// empty field, not just the focused one
|
|
163
|
+
showOnlyWhenEditable: true,
|
|
164
|
+
showOnlyCurrent: false,
|
|
165
|
+
}),
|
|
166
|
+
]
|
|
167
|
+
: []),
|
|
153
168
|
],
|
|
154
169
|
editable: isEditable,
|
|
155
170
|
autofocus: false,
|
package/index.module.scss
CHANGED
|
@@ -68,6 +68,18 @@
|
|
|
68
68
|
cursor: ew-resize;
|
|
69
69
|
cursor: col-resize;
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
// Placeholder text (from the Placeholder extension, active only when a
|
|
73
|
+
// `placeholder` prop is set). Faint and derived from the field's own
|
|
74
|
+
// text colour so it reads correctly on any background.
|
|
75
|
+
.is-editor-empty:first-child::before {
|
|
76
|
+
content: attr(data-placeholder);
|
|
77
|
+
color: currentColor;
|
|
78
|
+
opacity: 0.4;
|
|
79
|
+
float: left;
|
|
80
|
+
height: 0;
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
71
83
|
}
|
|
72
84
|
|
|
73
85
|
.tableWrapper {
|