@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/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +11 -1
package/package.json
CHANGED
|
@@ -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:
|
|
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
|
}
|