@supernova-studio/client 0.38.0 → 0.40.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.
- package/dist/index.d.mts +1 -29
- package/dist/index.d.ts +1 -29
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +20 -18
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +8 -2
package/dist/index.d.mts
CHANGED
|
@@ -17188,35 +17188,7 @@ declare function getMockPageBlockDefinitions(): PageBlockDefinition[];
|
|
|
17188
17188
|
declare function yDocToPage(yDoc: Y.Doc, definitions: PageBlockDefinition[]): DocumentationPageEditorModel;
|
|
17189
17189
|
declare function yXmlFragmentToPage(fragment: Y.XmlFragment, definitions: PageBlockDefinition[]): DocumentationPageEditorModel;
|
|
17190
17190
|
declare function prosemirrorDocToPage(prosemirrorDoc: ProsemirrorNode, definitions: PageBlockDefinition[]): DocumentationPageEditorModel;
|
|
17191
|
-
declare function shallowProsemirrorNodeToBlock(prosemirrorNode: ProsemirrorNode, definition: PageBlockDefinition):
|
|
17192
|
-
id: string;
|
|
17193
|
-
type: "Block";
|
|
17194
|
-
data: {
|
|
17195
|
-
items: {
|
|
17196
|
-
id: string;
|
|
17197
|
-
props: Record<string, {
|
|
17198
|
-
value?: any;
|
|
17199
|
-
} & Record<string, any>>;
|
|
17200
|
-
linksTo?: {
|
|
17201
|
-
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
17202
|
-
documentationItemId?: string | undefined;
|
|
17203
|
-
pageHeadingId?: string | undefined;
|
|
17204
|
-
url?: string | undefined;
|
|
17205
|
-
openInNewTab?: boolean | undefined;
|
|
17206
|
-
} | undefined;
|
|
17207
|
-
}[];
|
|
17208
|
-
packageId: string;
|
|
17209
|
-
indentLevel: number;
|
|
17210
|
-
variantId?: string | undefined;
|
|
17211
|
-
appearance?: {
|
|
17212
|
-
itemBackgroundColor?: {
|
|
17213
|
-
value: string;
|
|
17214
|
-
referencedTokenId?: string | undefined;
|
|
17215
|
-
} | undefined;
|
|
17216
|
-
numberOfColumns?: number | undefined;
|
|
17217
|
-
} | undefined;
|
|
17218
|
-
};
|
|
17219
|
-
}[];
|
|
17191
|
+
declare function shallowProsemirrorNodeToBlock(prosemirrorNode: ProsemirrorNode, definition: PageBlockDefinition): PageBlockEditorModel | null;
|
|
17220
17192
|
declare function prosemirrorNodeToSection(prosemirrorNode: ProsemirrorNode, definitions: PageBlockDefinition[]): PageSectionEditorModel | null;
|
|
17221
17193
|
declare function prosemirrorNodesToBlocks(prosemirrorNodes: ProsemirrorNode[], definitions: PageBlockDefinition[]): {
|
|
17222
17194
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -17188,35 +17188,7 @@ declare function getMockPageBlockDefinitions(): PageBlockDefinition[];
|
|
|
17188
17188
|
declare function yDocToPage(yDoc: Y.Doc, definitions: PageBlockDefinition[]): DocumentationPageEditorModel;
|
|
17189
17189
|
declare function yXmlFragmentToPage(fragment: Y.XmlFragment, definitions: PageBlockDefinition[]): DocumentationPageEditorModel;
|
|
17190
17190
|
declare function prosemirrorDocToPage(prosemirrorDoc: ProsemirrorNode, definitions: PageBlockDefinition[]): DocumentationPageEditorModel;
|
|
17191
|
-
declare function shallowProsemirrorNodeToBlock(prosemirrorNode: ProsemirrorNode, definition: PageBlockDefinition):
|
|
17192
|
-
id: string;
|
|
17193
|
-
type: "Block";
|
|
17194
|
-
data: {
|
|
17195
|
-
items: {
|
|
17196
|
-
id: string;
|
|
17197
|
-
props: Record<string, {
|
|
17198
|
-
value?: any;
|
|
17199
|
-
} & Record<string, any>>;
|
|
17200
|
-
linksTo?: {
|
|
17201
|
-
type: "DocumentationItem" | "PageHeading" | "Url";
|
|
17202
|
-
documentationItemId?: string | undefined;
|
|
17203
|
-
pageHeadingId?: string | undefined;
|
|
17204
|
-
url?: string | undefined;
|
|
17205
|
-
openInNewTab?: boolean | undefined;
|
|
17206
|
-
} | undefined;
|
|
17207
|
-
}[];
|
|
17208
|
-
packageId: string;
|
|
17209
|
-
indentLevel: number;
|
|
17210
|
-
variantId?: string | undefined;
|
|
17211
|
-
appearance?: {
|
|
17212
|
-
itemBackgroundColor?: {
|
|
17213
|
-
value: string;
|
|
17214
|
-
referencedTokenId?: string | undefined;
|
|
17215
|
-
} | undefined;
|
|
17216
|
-
numberOfColumns?: number | undefined;
|
|
17217
|
-
} | undefined;
|
|
17218
|
-
};
|
|
17219
|
-
}[];
|
|
17191
|
+
declare function shallowProsemirrorNodeToBlock(prosemirrorNode: ProsemirrorNode, definition: PageBlockDefinition): PageBlockEditorModel | null;
|
|
17220
17192
|
declare function prosemirrorNodeToSection(prosemirrorNode: ProsemirrorNode, definitions: PageBlockDefinition[]): PageSectionEditorModel | null;
|
|
17221
17193
|
declare function prosemirrorNodesToBlocks(prosemirrorNodes: ProsemirrorNode[], definitions: PageBlockDefinition[]): {
|
|
17222
17194
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -5351,6 +5351,9 @@ var newSchema = {
|
|
|
5351
5351
|
};
|
|
5352
5352
|
var pmSchema = new (0, _prosemirrormodel.Schema)(newSchema);
|
|
5353
5353
|
|
|
5354
|
+
// src/yjs/docs-editor/blocks-to-prosemirror.ts
|
|
5355
|
+
var _yprosemirror = require('y-prosemirror');
|
|
5356
|
+
|
|
5354
5357
|
// src/yjs/docs-editor/utils.ts
|
|
5355
5358
|
var BlockParsingUtils = {
|
|
5356
5359
|
singleBlockItem(block) {
|
|
@@ -5436,9 +5439,6 @@ var BlockDefinitionUtils = {
|
|
|
5436
5439
|
}
|
|
5437
5440
|
};
|
|
5438
5441
|
|
|
5439
|
-
// src/yjs/docs-editor/blocks-to-prosemirror.ts
|
|
5440
|
-
var _yprosemirror = require('y-prosemirror');
|
|
5441
|
-
|
|
5442
5442
|
// src/yjs/docs-editor/list-tree-builder.ts
|
|
5443
5443
|
var ListTreeBuilder = class {
|
|
5444
5444
|
addWithProperty(block, multiRichTextProperty) {
|
|
@@ -5543,7 +5543,9 @@ function pageToProsemirrorDoc(page, definitions) {
|
|
|
5543
5543
|
};
|
|
5544
5544
|
}
|
|
5545
5545
|
function blockToProsemirrorNode(block, definition) {
|
|
5546
|
-
|
|
5546
|
+
const definitionsMap = /* @__PURE__ */ new Map([[definition.id, definition]]);
|
|
5547
|
+
const nodes = internalBlocksToProsemirrorNodes([block], definitionsMap);
|
|
5548
|
+
return _nullishCoalesce(nodes[0], () => ( null));
|
|
5547
5549
|
}
|
|
5548
5550
|
function internalSectionToProsemirrorNode(section, definitionsMap) {
|
|
5549
5551
|
return {
|
|
@@ -7667,7 +7669,7 @@ function prosemirrorDocToPage(prosemirrorDoc, definitions) {
|
|
|
7667
7669
|
};
|
|
7668
7670
|
}
|
|
7669
7671
|
function shallowProsemirrorNodeToBlock(prosemirrorNode, definition) {
|
|
7670
|
-
return prosemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition, /* @__PURE__ */ new Map([[definition.id, definition]]), 0);
|
|
7672
|
+
return _nullishCoalesce(prosemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition, /* @__PURE__ */ new Map([[definition.id, definition]]), 0)[0], () => ( null));
|
|
7671
7673
|
}
|
|
7672
7674
|
function prosemirrorNodeToSection(prosemirrorNode, definitions) {
|
|
7673
7675
|
const definitionsById = mapByUnique2(definitions, (d) => d.id);
|