@seed-hypermedia/client 0.0.24 → 0.0.25

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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -2
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -546,13 +546,18 @@ function annotationsToPublishable(annotations) {
546
546
  });
547
547
  }
548
548
  function blockToPublishable(blockNode) {
549
+ var _a;
549
550
  const block = blockNode.block;
550
551
  if (block.type === "Paragraph") {
551
- if (block.text === "" || block.text === void 0) return null;
552
+ const hasChildren = (blockNode.children || []).length > 0;
553
+ const isListContainer = ((_a = block.attributes) == null ? void 0 : _a.childrenType) !== void 0;
554
+ if ((block.text === "" || block.text === void 0) && !hasChildren && !isListContainer) {
555
+ return null;
556
+ }
552
557
  return {
553
558
  id: block.id,
554
559
  type: "Paragraph",
555
- text: block.text,
560
+ text: block.text || "",
556
561
  annotations: annotationsToPublishable(block.annotations || []),
557
562
  ...block.attributes,
558
563
  children: blocksToPublishable(blockNode.children || [])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-hypermedia/client",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/seed-hypermedia/seed",