@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/dist/index.js +44 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +72 -65
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/docs-editor/blocks-to-prosemirror.ts +3 -1
- package/src/docs-editor/mock.ts +2 -2
- package/src/docs-editor/prosemirror-to-blocks.ts +2 -2
package/package.json
CHANGED
|
@@ -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)
|
|
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
|
}
|
package/src/docs-editor/mock.ts
CHANGED
|
@@ -389,7 +389,7 @@ const blocks: PageBlockDefinition[] = [
|
|
|
389
389
|
{
|
|
390
390
|
id: "text",
|
|
391
391
|
name: "Text",
|
|
392
|
-
type: "
|
|
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: "
|
|
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 =
|
|
256
|
+
const itemIdRaw = parseProsemirrorOptionalBlockAttribute(mark, "itemId");
|
|
257
257
|
const itemId = typeof itemIdRaw === "string" ? itemIdRaw : undefined;
|
|
258
258
|
|
|
259
|
-
const hrefRaw =
|
|
259
|
+
const hrefRaw = parseProsemirrorOptionalBlockAttribute(mark, "href");
|
|
260
260
|
const href = typeof hrefRaw === "string" ? hrefRaw : undefined;
|
|
261
261
|
|
|
262
262
|
return {
|