@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.mjs
CHANGED
|
@@ -5351,6 +5351,9 @@ var newSchema = {
|
|
|
5351
5351
|
};
|
|
5352
5352
|
var pmSchema = new Schema(newSchema);
|
|
5353
5353
|
|
|
5354
|
+
// src/yjs/docs-editor/blocks-to-prosemirror.ts
|
|
5355
|
+
import { prosemirrorJSONToYXmlFragment } from "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
|
-
import { prosemirrorJSONToYXmlFragment } from "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 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 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);
|