@supernova-studio/client 0.9.0 → 0.9.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.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -72,7 +72,9 @@ export function pageToProsemirrorDoc(
72
72
 
73
73
  export function blockDefinitionForBlock(block: PageBlockEditorModel, definitions: PageBlockDefinition[]) {
74
74
  const definition = definitions.find(d => d.id === block.data.packageId);
75
- if (!definition) throw new Error(`Could not find definition for ${block.id} (${block.data.packageId})`);
75
+ if (!definition) {
76
+ throw new Error(`Could not find definition for ${block.id} (${block.data.packageId})`);
77
+ }
76
78
 
77
79
  return definition;
78
80
  }
@@ -253,10 +253,10 @@ function parseRichTextAttribute(mark: ProsemirrorMark): PageBlockTextSpanAttribu
253
253
  case "code":
254
254
  return { type: "Code" };
255
255
  case "link":
256
- const itemIdRaw = parseProsemirrorBlockAttribute(mark, "itemId");
256
+ const itemIdRaw = parseProsemirrorOptionalBlockAttribute(mark, "itemId");
257
257
  const itemId = typeof itemIdRaw === "string" ? itemIdRaw : undefined;
258
258
 
259
- const hrefRaw = parseProsemirrorBlockAttribute(mark, "href");
259
+ const hrefRaw = parseProsemirrorOptionalBlockAttribute(mark, "href");
260
260
  const href = typeof hrefRaw === "string" ? hrefRaw : undefined;
261
261
 
262
262
  return {