@lofcz/platejs-utils 53.1.1 → 53.2.4

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.
@@ -241,6 +241,7 @@ const BlockPlaceholderPlugin = createTPlatePlugin({
241
241
  editOnly: true,
242
242
  options: {
243
243
  _target: null,
244
+ className: void 0,
244
245
  placeholders: { [KEYS.p]: "Type something..." },
245
246
  query: ({ path }) => path.length === 1
246
247
  },
@@ -264,12 +265,14 @@ const BlockPlaceholderPlugin = createTPlatePlugin({
264
265
  }
265
266
  const { placeholders, query } = getOptions();
266
267
  const [element, path] = entry;
268
+ const firstNode = editor.children[0];
269
+ const isPristineEmptyEditor = editor.children.length === 1 && editor.api.isEmpty(firstNode) && editor.api.isElementStateEmpty(firstNode);
267
270
  const placeholder = Object.keys(placeholders).find((key) => editor.getType(key) === element.type);
268
271
  if (query({
269
272
  ...ctx,
270
273
  node: element,
271
274
  path
272
- }) && placeholder && editor.api.isEmpty(element) && !editor.api.isEmpty()) setOption("_target", {
275
+ }) && placeholder && editor.api.isEmpty(element) && !isPristineEmptyEditor) setOption("_target", {
273
276
  node: element,
274
277
  placeholder: placeholders[placeholder]
275
278
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lofcz/platejs-utils",
3
- "version": "53.1.1",
3
+ "version": "53.2.4",
4
4
  "description": "Plate utils",
5
5
  "keywords": [
6
6
  "plate",
@@ -32,8 +32,8 @@
32
32
  "clsx": "^2.1.1",
33
33
  "lodash": "^4.17.21",
34
34
  "react-compiler-runtime": "^1.0.0",
35
- "@platejs/core": "npm:@lofcz/platejs-core@53.1.1",
36
- "@platejs/slate": "npm:@lofcz/platejs-slate@53.1.1",
35
+ "@platejs/core": "npm:@lofcz/platejs-core@53.2.4",
36
+ "@platejs/slate": "npm:@lofcz/platejs-slate@53.1.7",
37
37
  "@udecode/react-utils": "npm:@lofcz/udecode-react-utils@52.3.4",
38
38
  "@udecode/utils": "npm:@lofcz/udecode-utils@52.3.4"
39
39
  },