@supernova-studio/client 0.8.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.8.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
  }
@@ -389,7 +389,7 @@ const blocks: PageBlockDefinition[] = [
389
389
  {
390
390
  id: "text",
391
391
  name: "Text",
392
- type: "RichText",
392
+ type: "MultiRichText",
393
393
  options: {
394
394
  multiRichTextStyle: "OL",
395
395
  },
@@ -450,7 +450,7 @@ const blocks: PageBlockDefinition[] = [
450
450
  {
451
451
  id: "text",
452
452
  name: "Text",
453
- type: "RichText",
453
+ type: "MultiRichText",
454
454
  options: {
455
455
  multiRichTextStyle: "UL",
456
456
  },
@@ -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 {