Skip to content

Commit 57602da

Browse files
committed
Merge remote-tracking branch 'origin/zod-tests' into refactor/zod-props-v2
2 parents 94f2317 + e3d9917 commit 57602da

File tree

18 files changed

+176
-1
lines changed

18 files changed

+176
-1
lines changed

packages/core/src/blocks/Code/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export const createCodeBlockSpec = createBlockSpec(
171171
contentDOM: code,
172172
};
173173
},
174+
runsBefore: [],
174175
}),
175176
(options) => {
176177
return [

packages/core/src/blocks/Divider/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const createDividerBlockSpec = createBlockSpec(
3737
dom,
3838
};
3939
},
40+
runsBefore: [],
4041
},
4142
[
4243
createBlockNoteExtension({

packages/core/src/blocks/File/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,5 @@ export const createFileBlockSpec = createBlockSpec(createFileBlockConfig, {
100100
dom: fileSrcLink,
101101
};
102102
},
103+
runsBefore: [],
103104
});

packages/core/src/blocks/Heading/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const createHeadingBlockSpec = createBlockSpec(
103103
contentDOM: dom,
104104
};
105105
},
106+
runsBefore: [],
106107
}),
107108
({ levels = HEADING_LEVELS }: HeadingOptions = {}) => [
108109
createBlockNoteExtension({

packages/core/src/blocks/ListItem/BulletListItem/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const createBulletListItemBlockSpec = createBlockSpec(
7474
contentDOM: p,
7575
};
7676
},
77+
runsBefore: [],
7778
},
7879
[
7980
createBlockNoteExtension({

packages/core/src/blocks/ListItem/NumberedListItem/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export const createNumberedListItemBlockSpec = createBlockSpec(
9595
contentDOM: p,
9696
};
9797
},
98+
runsBefore: [],
9899
},
99100
[
100101
createBlockNoteExtension({

packages/core/src/blocks/ListItem/ToggleListItem/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const createToggleListItemBlockSpec = createBlockSpec(
4646
contentDOM: p,
4747
};
4848
},
49+
runsBefore: [],
4950
},
5051
[
5152
createBlockNoteExtension({

packages/core/src/blocks/PageBreak/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const createPageBreakBlockSpec = createBlockSpec(
5353
dom: pageBreak,
5454
};
5555
},
56+
runsBefore: [],
5657
},
5758
);
5859

packages/core/src/blocks/Quote/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const createQuoteBlockSpec = createBlockSpec(
5858
contentDOM: quote,
5959
};
6060
},
61+
runsBefore: [],
6162
},
6263
[
6364
createBlockNoteExtension({

packages/core/src/schema/blocks/createSpec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ export function createBlockSpec<
385385
config: blockConfig,
386386
implementation: {
387387
...blockImplementation,
388+
// If the block implementation does not specify a runsBefore, we default to ["default"]
389+
// This allows for custom blocks to always be prioritized over default blocks.
390+
runsBefore: blockImplementation.runsBefore ?? ["default"],
388391
// TODO: this should not have wrapInBlockStructure and generally be a lot simpler
389392
// post-processing in externalHTMLExporter should not be necessary
390393
toExternalHTML(block, editor) {

0 commit comments

Comments
 (0)