@supernova-studio/client 0.25.0 → 0.25.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/client",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -525,7 +525,7 @@ export function serializeAsCustomBlock(block: PageBlockEditorModel, definition:
525
525
  const columns = block.data.appearance?.numberOfColumns;
526
526
 
527
527
  return {
528
- type: "blockNode",
528
+ type: serializeCustomBlockNodeType(block, definition),
529
529
  attrs: {
530
530
  id: block.id,
531
531
  definitionId: block.data.packageId,
@@ -537,6 +537,16 @@ export function serializeAsCustomBlock(block: PageBlockEditorModel, definition:
537
537
  };
538
538
  }
539
539
 
540
+ function serializeCustomBlockNodeType(block: PageBlockEditorModel, definition: PageBlockDefinition): string {
541
+ switch (block.data.packageId) {
542
+ case "io.supernova.block.image":
543
+ return "image";
544
+
545
+ default:
546
+ return "blockNode";
547
+ }
548
+ }
549
+
540
550
  function nonNullFilter<T>(item: T | null): item is T {
541
551
  return !!item;
542
552
  }