@supernova-studio/client 0.10.2 → 0.11.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.
@@ -107,11 +107,6 @@ export function prosemirrorNodeToBlock(
107
107
  return parseAsMultiRichText(prosemirrorNode, definition, multiRichTextProperty);
108
108
  }
109
109
 
110
- const embedProperty = BlockDefinitionUtils.firstEmbedProperty(definition);
111
- if (prosemirrorNode.type === "embed" && embedProperty) {
112
- return parseAsEmbed(prosemirrorNode, definition, embedProperty);
113
- }
114
-
115
110
  const tableProperty = BlockDefinitionUtils.firstTableProperty(definition);
116
111
  if (tableProperty) {
117
112
  return parseAsTable(prosemirrorNode, definition, tableProperty);
@@ -214,7 +209,7 @@ function parseAsMultiRichText(
214
209
  // Required
215
210
  value: (prosemirrorNode.content ?? [])
216
211
  .map(listItem => {
217
- if (listItem.type !== "listitem") return null;
212
+ if (listItem.type !== "listItem") return null;
218
213
  if (!listItem.content?.length) return parseRichText([]);
219
214
 
220
215
  const paragraph = listItem.content[0];
@@ -327,6 +322,7 @@ function parseAsTable(
327
322
  data: {
328
323
  packageId: "io.supernova.block.table",
329
324
  indentLevel: 0,
325
+ variantId: "default",
330
326
 
331
327
  ...(variantId && { variantId: variantId }),
332
328
 
@@ -454,48 +450,6 @@ function emptyTableCellContent(): PageBlockItemTableNode[] {
454
450
  ];
455
451
  }
456
452
 
457
- //
458
- // Embed
459
- //
460
-
461
- function parseAsEmbed(
462
- prosemirrorNode: ProsemirrorNode,
463
- definition: PageBlockDefinition,
464
- property: PageBlockDefinitionProperty
465
- ): PageBlockEditorModel | null {
466
- const id = getProsemirrorBlockId(prosemirrorNode);
467
- if (!id) return null;
468
-
469
- const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
470
-
471
- const url = getProsemirrorAttribute(prosemirrorNode, "url", z.string().optional());
472
- const caption = getProsemirrorAttribute(prosemirrorNode, "caption", z.string().optional());
473
- const height = getProsemirrorAttribute(prosemirrorNode, "height", z.number().optional());
474
-
475
- return {
476
- id: id,
477
- data: {
478
- packageId: definition.id,
479
- indentLevel: 0,
480
-
481
- ...(variantId && { variantId: variantId }),
482
-
483
- items: [
484
- {
485
- id: id,
486
- props: {
487
- [property.id]: {
488
- value: url,
489
- caption: caption,
490
- height: height ?? 200,
491
- } as PageBlockItemEmbedValue,
492
- },
493
- },
494
- ],
495
- },
496
- };
497
- }
498
-
499
453
  //
500
454
  // Divider
501
455
  //
@@ -613,7 +567,7 @@ function parseItem(rawItem: unknown, definition: PageBlockDefinition): PageBlock
613
567
 
614
568
  return {
615
569
  id: parsedItem.data.id,
616
- linksTo: parsedItem.data.linksTo,
570
+ ...(parsedItem.data.linksTo && { linksTo: parsedItem.data.linksTo }),
617
571
  props: sanitizedProps,
618
572
  };
619
573
  }