@livepreso/react-plugin-textfield 0.4.3 → 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 CHANGED
@@ -1,6 +1,30 @@
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
+ },
16
+ {
17
+ "version": "0.4.4",
18
+ "tag": "@livepreso/react-plugin-textfield_v0.4.4",
19
+ "date": "Wed, 06 May 2026 23:36:35 GMT",
20
+ "comments": {
21
+ "patch": [
22
+ {
23
+ "comment": "De-dupe tokens before providing to the text editor"
24
+ }
25
+ ]
26
+ }
27
+ },
4
28
  {
5
29
  "version": "0.4.3",
6
30
  "tag": "@livepreso/react-plugin-textfield_v0.4.3",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log - @livepreso/react-plugin-textfield
2
2
 
3
- This log was last generated on Thu, 12 Mar 2026 02:50:05 GMT and should not be manually modified.
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
11
+
12
+ ## 0.4.4
13
+ Wed, 06 May 2026 23:36:35 GMT
14
+
15
+ ### Patches
16
+
17
+ - De-dupe tokens before providing to the text editor
4
18
 
5
19
  ## 0.4.3
6
20
  Thu, 12 Mar 2026 02:50:05 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,
@@ -54,7 +55,7 @@ function EditableTextField({
54
55
  isEditable,
55
56
  textStyles,
56
57
  colors,
57
- tokens,
58
+ tokens: allTokens = [],
58
59
  toolbarConfig = DEFAULT_TOOLBAR_CONFIG,
59
60
  tableToolbarConfig = DEFAULT_TABLE_TOOLBAR_CONFIG,
60
61
  maskSelector,
@@ -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,
@@ -73,6 +77,11 @@ function EditableTextField({
73
77
  const { isUserTemplateLibrary } = useSlide();
74
78
  const [textColor, setTextColor] = useState(null);
75
79
  const initialValue = useRef(value);
80
+ const tokens = allTokens.reduce((acc, token) => {
81
+ const { id } = token;
82
+ if (acc.some((accToken) => accToken.id === id)) return acc;
83
+ return [...acc, token];
84
+ }, []);
76
85
 
77
86
  const isReallyPresoManager = isPresomanager && !isUserTemplateLibrary;
78
87
 
@@ -145,6 +154,17 @@ function EditableTextField({
145
154
  ...baseExtensions,
146
155
  ...toolbarAddedExtensions,
147
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
+ : []),
148
168
  ],
149
169
  editable: isEditable,
150
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livepreso/react-plugin-textfield",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "publishConfig": {