Skip to content

Commit dc8373b

Browse files
committed
Fixed tests
1 parent 8b46780 commit dc8373b

File tree

2 files changed

+13
-286
lines changed

2 files changed

+13
-286
lines changed

packages/core/src/editor/managers/ExtensionManager/extensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export function getDefaultExtensions(
186186
ShowSelectionExtension(options),
187187
SideMenuExtension(options),
188188
SuggestionMenu(options),
189-
TrailingNodeExtension(),
189+
...(options.trailingBlock !== false ? [TrailingNodeExtension()] : []),
190190
] as ExtensionFactoryInstance[];
191191

192192
if (options.collaboration) {

tests/src/unit/core/schema/__snapshots__/blocks.json

Lines changed: 12 additions & 285 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,7 @@
6060
"type": "bulletListItem",
6161
},
6262
"extensions": [
63-
BlockNoteExtension {
64-
"inputRules": [
65-
{
66-
"find": /\^\[-\+\*\]\\s\$/,
67-
"replace": [Function],
68-
},
69-
],
70-
"key": "bullet-list-item-shortcuts",
71-
"keyboardShortcuts": {
72-
"Enter": [Function],
73-
"Mod-Shift-8": [Function],
74-
},
75-
"plugins": [],
76-
"tiptapExtensions": undefined,
77-
},
63+
[Function],
7864
],
7965
"implementation": {
8066
"meta": {
@@ -114,25 +100,7 @@
114100
"type": "checkListItem",
115101
},
116102
"extensions": [
117-
BlockNoteExtension {
118-
"inputRules": [
119-
{
120-
"find": /\\\[\\s\*\\\]\\s\$/,
121-
"replace": [Function],
122-
},
123-
{
124-
"find": /\\\[\[Xx\]\\\]\\s\$/,
125-
"replace": [Function],
126-
},
127-
],
128-
"key": "check-list-item-shortcuts",
129-
"keyboardShortcuts": {
130-
"Enter": [Function],
131-
"Mod-Shift-9": [Function],
132-
},
133-
"plugins": [],
134-
"tiptapExtensions": undefined,
135-
},
103+
[Function],
136104
],
137105
"implementation": {
138106
"meta": {
@@ -159,50 +127,8 @@
159127
"type": "codeBlock",
160128
},
161129
"extensions": [
162-
BlockNoteExtension {
163-
"inputRules": undefined,
164-
"key": "code-block-highlighter",
165-
"keyboardShortcuts": undefined,
166-
"plugins": [
167-
Plugin {
168-
"key": "prosemirror-highlight$1",
169-
"props": {
170-
"decorations": [Function],
171-
},
172-
"spec": {
173-
"key": PluginKey {
174-
"key": "prosemirror-highlight$1",
175-
},
176-
"props": {
177-
"decorations": [Function],
178-
},
179-
"state": {
180-
"apply": [Function],
181-
"init": [Function],
182-
},
183-
"view": [Function],
184-
},
185-
},
186-
],
187-
"tiptapExtensions": undefined,
188-
},
189-
BlockNoteExtension {
190-
"inputRules": [
191-
{
192-
"find": /\^```\(\.\*\?\)\\s\$/,
193-
"replace": [Function],
194-
},
195-
],
196-
"key": "code-block-keyboard-shortcuts",
197-
"keyboardShortcuts": {
198-
"Delete": [Function],
199-
"Enter": [Function],
200-
"Shift-Enter": [Function],
201-
"Tab": [Function],
202-
},
203-
"plugins": [],
204-
"tiptapExtensions": undefined,
205-
},
130+
[Function],
131+
[Function],
206132
],
207133
"implementation": {
208134
"meta": {
@@ -254,18 +180,7 @@
254180
"type": "divider",
255181
},
256182
"extensions": [
257-
BlockNoteExtension {
258-
"inputRules": [
259-
{
260-
"find": /\^---\$/,
261-
"replace": [Function],
262-
},
263-
],
264-
"key": "divider-block-shortcuts",
265-
"keyboardShortcuts": undefined,
266-
"plugins": [],
267-
"tiptapExtensions": undefined,
268-
},
183+
[Function],
269184
],
270185
"implementation": {
271186
"meta": {
@@ -347,45 +262,7 @@
347262
"type": "heading",
348263
},
349264
"extensions": [
350-
BlockNoteExtension {
351-
"inputRules": [
352-
{
353-
"find": /\^\(#\{1\}\)\\s\$/,
354-
"replace": [Function],
355-
},
356-
{
357-
"find": /\^\(#\{2\}\)\\s\$/,
358-
"replace": [Function],
359-
},
360-
{
361-
"find": /\^\(#\{3\}\)\\s\$/,
362-
"replace": [Function],
363-
},
364-
{
365-
"find": /\^\(#\{4\}\)\\s\$/,
366-
"replace": [Function],
367-
},
368-
{
369-
"find": /\^\(#\{5\}\)\\s\$/,
370-
"replace": [Function],
371-
},
372-
{
373-
"find": /\^\(#\{6\}\)\\s\$/,
374-
"replace": [Function],
375-
},
376-
],
377-
"key": "heading-shortcuts",
378-
"keyboardShortcuts": {
379-
"Mod-Alt-1": [Function],
380-
"Mod-Alt-2": [Function],
381-
"Mod-Alt-3": [Function],
382-
"Mod-Alt-4": [Function],
383-
"Mod-Alt-5": [Function],
384-
"Mod-Alt-6": [Function],
385-
},
386-
"plugins": [],
387-
"tiptapExtensions": undefined,
388-
},
265+
[Function],
389266
],
390267
"implementation": {
391268
"meta": {
@@ -475,40 +352,7 @@
475352
"type": "numberedListItem",
476353
},
477354
"extensions": [
478-
BlockNoteExtension {
479-
"inputRules": [
480-
{
481-
"find": /\^\(\\d\+\)\\\.\\s\$/,
482-
"replace": [Function],
483-
},
484-
],
485-
"key": "numbered-list-item-shortcuts",
486-
"keyboardShortcuts": {
487-
"Enter": [Function],
488-
"Mod-Shift-7": [Function],
489-
},
490-
"plugins": [
491-
Plugin {
492-
"key": "numbered-list-indexing-decorations$",
493-
"props": {
494-
"decorations": [Function],
495-
},
496-
"spec": {
497-
"key": PluginKey {
498-
"key": "numbered-list-indexing-decorations$",
499-
},
500-
"props": {
501-
"decorations": [Function],
502-
},
503-
"state": {
504-
"apply": [Function],
505-
"init": [Function],
506-
},
507-
},
508-
},
509-
],
510-
"tiptapExtensions": undefined,
511-
},
355+
[Function],
512356
],
513357
"implementation": {
514358
"meta": {
@@ -558,15 +402,7 @@
558402
"type": "paragraph",
559403
},
560404
"extensions": [
561-
BlockNoteExtension {
562-
"inputRules": undefined,
563-
"key": "paragraph-shortcuts",
564-
"keyboardShortcuts": {
565-
"Mod-Alt-0": [Function],
566-
},
567-
"plugins": [],
568-
"tiptapExtensions": undefined,
569-
},
405+
[Function],
570406
],
571407
"implementation": {
572408
"meta": {
@@ -595,20 +431,7 @@
595431
"type": "quote",
596432
},
597433
"extensions": [
598-
BlockNoteExtension {
599-
"inputRules": [
600-
{
601-
"find": /\^>\\s\$/,
602-
"replace": [Function],
603-
},
604-
],
605-
"key": "quote-block-shortcuts",
606-
"keyboardShortcuts": {
607-
"Mod-Alt-q": [Function],
608-
},
609-
"plugins": [],
610-
"tiptapExtensions": undefined,
611-
},
434+
[Function],
612435
],
613436
"implementation": {
614437
"meta": {
@@ -702,95 +525,8 @@
702525
"type": "table",
703526
},
704527
"extensions": [
705-
BlockNoteExtension {
706-
"inputRules": undefined,
707-
"key": "table-extensions",
708-
"keyboardShortcuts": undefined,
709-
"plugins": [],
710-
"tiptapExtensions": [
711-
_Extension {
712-
"child": null,
713-
"config": {
714-
"addKeyboardShortcuts": [Function],
715-
"addProseMirrorPlugins": [Function],
716-
"extendNodeSchema": [Function],
717-
"name": "BlockNoteTableExtension",
718-
},
719-
"name": "BlockNoteTableExtension",
720-
"parent": null,
721-
"type": "extension",
722-
},
723-
_Node {
724-
"child": null,
725-
"config": {
726-
"content": "inline*",
727-
"group": "tableContent",
728-
"name": "tableParagraph",
729-
"parseHTML": [Function],
730-
"renderHTML": [Function],
731-
},
732-
"name": "tableParagraph",
733-
"parent": null,
734-
"type": "node",
735-
},
736-
_Node {
737-
"child": null,
738-
"config": {
739-
"addAttributes": [Function],
740-
"addOptions": [Function],
741-
"content": "tableContent+",
742-
"isolating": true,
743-
"name": "tableHeader",
744-
"parseHTML": [Function],
745-
"renderHTML": [Function],
746-
"tableRole": "header_cell",
747-
},
748-
"name": "tableHeader",
749-
"parent": null,
750-
"type": "node",
751-
},
752-
_Node {
753-
"child": null,
754-
"config": {
755-
"addAttributes": [Function],
756-
"addOptions": [Function],
757-
"content": "tableContent+",
758-
"isolating": true,
759-
"name": "tableCell",
760-
"parseHTML": [Function],
761-
"renderHTML": [Function],
762-
"tableRole": "cell",
763-
},
764-
"name": "tableCell",
765-
"parent": null,
766-
"type": "node",
767-
},
768-
_Node {
769-
"child": null,
770-
"config": {
771-
"addOptions": [Function],
772-
"content": "(tableCell | tableHeader)+",
773-
"marks": "deletion insertion modification",
774-
"name": "tableRow",
775-
"parseHTML": [Function],
776-
"renderHTML": [Function],
777-
"tableRole": "row",
778-
},
779-
"name": "tableRow",
780-
"parent": null,
781-
"type": "node",
782-
},
783-
],
784-
},
785-
BlockNoteExtension {
786-
"inputRules": undefined,
787-
"key": "table-keyboard-delete",
788-
"keyboardShortcuts": {
789-
"Backspace": [Function],
790-
},
791-
"plugins": [],
792-
"tiptapExtensions": undefined,
793-
},
528+
[Function],
529+
[Function],
794530
],
795531
"implementation": {
796532
"node": null,
@@ -821,16 +557,7 @@
821557
"type": "toggleListItem",
822558
},
823559
"extensions": [
824-
BlockNoteExtension {
825-
"inputRules": undefined,
826-
"key": "toggle-list-item-shortcuts",
827-
"keyboardShortcuts": {
828-
"Enter": [Function],
829-
"Mod-Shift-6": [Function],
830-
},
831-
"plugins": [],
832-
"tiptapExtensions": undefined,
833-
},
560+
[Function],
834561
],
835562
"implementation": {
836563
"meta": {

0 commit comments

Comments
 (0)