Skip to content

Commit 8e44f6f

Browse files
committed
fix: same id for nodes of same type
1 parent c9695f3 commit 8e44f6f

9 files changed

Lines changed: 16 additions & 9 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/super-editor/src/extensions/block-node/block-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Extension } from '@core/Extension.js';
22
import { helpers } from '@core/index.js';
33
const { findChildren } = helpers;
4-
import { Plugin, PluginKey } from 'prosemirror-state';
4+
import { Plugin } from 'prosemirror-state';
55
import { generateBlockUniqueId } from '@core/utilities/index.js';
66

77
export const BlockNode = Extension.create({

packages/super-editor/src/extensions/bullet-list/bullet-list.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export const BulletList = Node.create({
5151
},
5252

5353
sdBlockId: {
54-
default: () => null,
54+
default: null,
55+
keepOnSplit: false,
5556
parseDOM: (elem) => elem.getAttribute('data-sd-block-id'),
5657
renderDOM: (attrs) => {
5758
return attrs.sdBlockId ? { 'data-sd-block-id': attrs.sdBlockId } : {};

packages/super-editor/src/extensions/heading/heading.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export const Heading = Node.create({
2626
},
2727
tabStops: { rendered: false },
2828
sdBlockId: {
29-
default: () => null,
29+
default: null,
30+
keepOnSplit: false,
3031
parseDOM: (elem) => elem.getAttribute('data-sd-block-id'),
3132
renderDOM: (attrs) => {
3233
return attrs.sdBlockId ? { 'data-sd-block-id': attrs.sdBlockId } : {};

packages/super-editor/src/extensions/ordered-list/ordered-list.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export const OrderedList = Node.create({
4444
},
4545

4646
sdBlockId: {
47-
default: () => null,
47+
default: null,
48+
keepOnSplit: false,
4849
parseDOM: (elem) => elem.getAttribute('data-sd-block-id'),
4950
renderDOM: (attrs) => {
5051
return attrs.sdBlockId ? { 'data-sd-block-id': attrs.sdBlockId } : {};

packages/super-editor/src/extensions/shape-container/shape-container.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export const ShapeContainer = Node.create({
2929
},
3030
},
3131
sdBlockId: {
32-
default: () => null,
32+
default: null,
33+
keepOnSplit: false,
3334
parseDOM: (elem) => elem.getAttribute('data-sd-block-id'),
3435
renderDOM: (attrs) => {
3536
return attrs.sdBlockId ? { 'data-sd-block-id': attrs.sdBlockId } : {};

packages/super-editor/src/extensions/shape-textbox/shape-textbox.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export const ShapeTextbox = Node.create({
2121
addAttributes() {
2222
return {
2323
sdBlockId: {
24-
default: () => null,
24+
default: null,
25+
keepOnSplit: false,
2526
parseDOM: (elem) => elem.getAttribute('data-sd-block-id'),
2627
renderDOM: (attrs) => {
2728
return attrs.sdBlockId ? { 'data-sd-block-id': attrs.sdBlockId } : {};

packages/super-editor/src/extensions/structured-content/document-section.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export const DocumentSection = Node.create({
3838
return {
3939
id: {},
4040
sdBlockId: {
41-
default: () => null,
41+
default: null,
42+
keepOnSplit: false,
4243
parseDOM: (elem) => elem.getAttribute('data-sd-block-id'),
4344
renderDOM: (attrs) => {
4445
return attrs.sdBlockId ? { 'data-sd-block-id': attrs.sdBlockId } : {};

packages/super-editor/src/extensions/table/table.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ export const Table = Node.create({
7373
},
7474
}, */
7575
sdBlockId: {
76-
default: () => null,
76+
default: null,
77+
keepOnSplit: false,
7778
parseDOM: (elem) => elem.getAttribute('data-sd-block-id'),
7879
renderDOM: (attrs) => {
7980
return attrs.sdBlockId ? { 'data-sd-block-id': attrs.sdBlockId } : {};

0 commit comments

Comments
 (0)