@blocknote/xl-multi-column 0.30.0 → 0.31.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.
@@ -1 +1 @@
1
- {"builtAt":1746802468806,"assets":[{"name":"blocknote-xl-multi-column.cjs","size":20482},{"name":"blocknote-xl-multi-column.cjs.map","size":3791822}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote-xl-multi-column.cjs"],"names":["blocknote-xl-multi-column"]}],"modules":[{"name":"./src/i18n/locales/ar.ts","size":364,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/de.ts","size":400,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/en.ts","size":378,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/es.ts","size":392,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/fr.ts","size":398,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/hr.ts","size":396,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/is.ts","size":376,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ja.ts","size":284,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ko.ts","size":288,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/nl.ts","size":390,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pl.ts","size":394,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pt.ts","size":388,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ru.ts","size":370,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/vi.ts","size":340,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/zh.ts","size":274,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/i18n/dictionary.ts","size":189,"chunks":["a1ee98a"]},{"name":"./src/extensions/ColumnResize/ColumnResizeExtension.ts","size":8309,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Column.ts","size":2567,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/ColumnList.ts","size":1120,"chunks":["a1ee98a"]},{"name":"./src/blocks/Columns/index.ts","size":210,"chunks":["a1ee98a"]},{"name":"./src/blocks/schema.ts","size":425,"chunks":["a1ee98a"]},{"name":"./src/extensions/DropCursor/MultiColumnDropCursorPlugin.ts","size":11715,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@18.3.1/node_modules/react-icons/lib/iconContext.mjs","size":251,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@18.3.1/node_modules/react-icons/lib/iconBase.mjs","size":4003,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@18.3.1/node_modules/react-icons/tb/index.mjs","size":708,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getMultiColumnSlashMenuItems.tsx","size":2073,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]}]}
1
+ {"builtAt":1747754375792,"assets":[{"name":"blocknote-xl-multi-column.cjs","size":20562},{"name":"blocknote-xl-multi-column.cjs.map","size":3791989}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote-xl-multi-column.cjs"],"names":["blocknote-xl-multi-column"]}],"modules":[{"name":"./src/i18n/locales/ar.ts","size":364,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/de.ts","size":400,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/en.ts","size":378,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/es.ts","size":392,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/fr.ts","size":398,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/hr.ts","size":396,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/is.ts","size":376,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ja.ts","size":284,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ko.ts","size":288,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/nl.ts","size":390,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pl.ts","size":394,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pt.ts","size":388,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ru.ts","size":370,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/vi.ts","size":340,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/zh.ts","size":274,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/i18n/dictionary.ts","size":189,"chunks":["a1ee98a"]},{"name":"./src/extensions/ColumnResize/ColumnResizeExtension.ts","size":8309,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Column.ts","size":2611,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/ColumnList.ts","size":1164,"chunks":["a1ee98a"]},{"name":"./src/blocks/Columns/index.ts","size":210,"chunks":["a1ee98a"]},{"name":"./src/blocks/schema.ts","size":425,"chunks":["a1ee98a"]},{"name":"./src/extensions/DropCursor/MultiColumnDropCursorPlugin.ts","size":11715,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@18.3.1/node_modules/react-icons/lib/iconContext.mjs","size":251,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@18.3.1/node_modules/react-icons/lib/iconBase.mjs","size":4003,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@18.3.1/node_modules/react-icons/tb/index.mjs","size":708,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getMultiColumnSlashMenuItems.tsx","size":2073,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]}]}
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "directory": "packages/xl-multi-column"
10
10
  },
11
11
  "license": "AGPL-3.0 OR PROPRIETARY",
12
- "version": "0.30.0",
12
+ "version": "0.31.0",
13
13
  "files": [
14
14
  "dist",
15
15
  "types",
@@ -42,13 +42,13 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@blocknote/core": "0.30.0",
46
- "@blocknote/react": "0.30.0",
47
- "@tiptap/core": "^2.7.1",
45
+ "@blocknote/core": "0.31.0",
46
+ "@blocknote/react": "0.31.0",
47
+ "@tiptap/core": "^2.12.0",
48
48
  "prosemirror-model": "^1.25.1",
49
49
  "prosemirror-state": "^1.4.3",
50
50
  "prosemirror-tables": "^1.3.7",
51
- "prosemirror-transform": "^1.9.0",
51
+ "prosemirror-transform": "^1.10.4",
52
52
  "prosemirror-view": "^1.38.1",
53
53
  "react-icons": "^5.2.1"
54
54
  },
@@ -58,7 +58,6 @@
58
58
  "@vitest/ui": "^2.1.4",
59
59
  "eslint": "^8.10.0",
60
60
  "jsdom": "^21.1.0",
61
- "prettier": "^2.7.1",
62
61
  "react": "^18.3.1",
63
62
  "react-dom": "^18.3.1",
64
63
  "rimraf": "^5.0.5",
@@ -11,5 +11,5 @@ export const ColumnBlock = createBlockSpecFromStronglyTypedTiptapNode(Column, {
11
11
 
12
12
  export const ColumnListBlock = createBlockSpecFromStronglyTypedTiptapNode(
13
13
  ColumnList,
14
- {}
14
+ {},
15
15
  );
@@ -19,9 +19,9 @@ export const multiColumnSchema = BlockNoteSchema.create({
19
19
  export const withMultiColumn = <
20
20
  B extends BlockSchema,
21
21
  I extends InlineContentSchema,
22
- S extends StyleSchema
22
+ S extends StyleSchema,
23
23
  >(
24
- schema: BlockNoteSchema<B, I, S>
24
+ schema: BlockNoteSchema<B, I, S>,
25
25
  ) => {
26
26
  return BlockNoteSchema.create({
27
27
  blockSpecs: {
@@ -54,7 +54,7 @@ class ColumnResizePluginView implements PluginView {
54
54
  }
55
55
 
56
56
  getColumnHoverOrDefaultState = (
57
- event: MouseEvent
57
+ event: MouseEvent,
58
58
  ): ColumnDefaultState | ColumnHoverState => {
59
59
  if (!this.editor.isEditable) {
60
60
  return { type: "default" };
@@ -68,7 +68,7 @@ class ColumnResizePluginView implements PluginView {
68
68
  }
69
69
 
70
70
  const columnElement = target.closest(
71
- ".bn-block-column"
71
+ ".bn-block-column",
72
72
  ) as HTMLElement | null;
73
73
 
74
74
  // Do nothing if a column element does not exist in the event target's
@@ -85,8 +85,8 @@ class ColumnResizePluginView implements PluginView {
85
85
  startPos < columnElementDOMRect.left + this.RESIZE_MARGIN_WIDTH_PX
86
86
  ? "left"
87
87
  : startPos > columnElementDOMRect.right - this.RESIZE_MARGIN_WIDTH_PX
88
- ? "right"
89
- : "none";
88
+ ? "right"
89
+ : "none";
90
90
 
91
91
  // The column element before or after the one hovered by the cursor,
92
92
  // depending on which side the cursor is on.
@@ -94,8 +94,8 @@ class ColumnResizePluginView implements PluginView {
94
94
  cursorElementSide === "left"
95
95
  ? columnElement.previousElementSibling
96
96
  : cursorElementSide === "right"
97
- ? columnElement.nextElementSibling
98
- : undefined;
97
+ ? columnElement.nextElementSibling
98
+ : undefined;
99
99
 
100
100
  // Do nothing if the cursor is not within the resize margin or if there
101
101
  // is no column before or after the one hovered by the cursor, depending
@@ -121,7 +121,7 @@ class ColumnResizePluginView implements PluginView {
121
121
 
122
122
  const rightColumnNodeAndPos = getNodeById(
123
123
  rightColumnId,
124
- this.view.state.doc
124
+ this.view.state.doc,
125
125
  );
126
126
 
127
127
  if (
@@ -186,7 +186,7 @@ class ColumnResizePluginView implements PluginView {
186
186
  };
187
187
 
188
188
  this.view.dispatch(
189
- this.view.state.tr.setMeta(columnResizePluginKey, newState)
189
+ this.view.state.tr.setMeta(columnResizePluginKey, newState),
190
190
  );
191
191
 
192
192
  this.editor.sideMenu.freezeMenu();
@@ -228,7 +228,7 @@ class ColumnResizePluginView implements PluginView {
228
228
 
229
229
  // Update the plugin state.
230
230
  this.view.dispatch(
231
- this.view.state.tr.setMeta(columnResizePluginKey, newState)
231
+ this.view.state.tr.setMeta(columnResizePluginKey, newState),
232
232
  );
233
233
 
234
234
  return;
@@ -269,14 +269,14 @@ class ColumnResizePluginView implements PluginView {
269
269
  .setNodeAttribute(
270
270
  pluginState.leftColumn.posBeforeNode,
271
271
  "width",
272
- newLeftColumnWidth
272
+ newLeftColumnWidth,
273
273
  )
274
274
  .setNodeAttribute(
275
275
  pluginState.rightColumn.posBeforeNode,
276
276
  "width",
277
- newRightColumnWidth
277
+ newRightColumnWidth,
278
278
  )
279
- .setMeta("addToHistory", false)
279
+ .setMeta("addToHistory", false),
280
280
  );
281
281
  };
282
282
 
@@ -294,7 +294,7 @@ class ColumnResizePluginView implements PluginView {
294
294
  // Revert plugin state to default or hover, depending on where the mouse
295
295
  // cursor is.
296
296
  this.view.dispatch(
297
- this.view.state.tr.setMeta(columnResizePluginKey, newState)
297
+ this.view.state.tr.setMeta(columnResizePluginKey, newState),
298
298
  );
299
299
 
300
300
  this.editor.sideMenu.unfreezeMenu();
@@ -326,7 +326,7 @@ const createColumnResizePlugin = (editor: BlockNoteEditor<any, any, any>) =>
326
326
  pluginState.leftColumn.node.nodeSize,
327
327
  {
328
328
  style: "box-shadow: 4px 0 0 #ccc; cursor: col-resize",
329
- }
329
+ },
330
330
  ),
331
331
  Decoration.node(
332
332
  pluginState.rightColumn.posBeforeNode,
@@ -334,13 +334,13 @@ const createColumnResizePlugin = (editor: BlockNoteEditor<any, any, any>) =>
334
334
  pluginState.rightColumn.node.nodeSize,
335
335
  {
336
336
  style: "cursor: col-resize",
337
- }
337
+ },
338
338
  ),
339
339
  ]);
340
340
  },
341
341
  },
342
342
  state: {
343
- init: () => ({ type: "default" } as ColumnState),
343
+ init: () => ({ type: "default" }) as ColumnState,
344
344
  apply: (tr, oldPluginState) => {
345
345
  const newPluginState = tr.getMeta(columnResizePluginKey) as
346
346
  | ColumnState
@@ -353,7 +353,7 @@ const createColumnResizePlugin = (editor: BlockNoteEditor<any, any, any>) =>
353
353
  });
354
354
 
355
355
  export const createColumnResizeExtension = (
356
- editor: BlockNoteEditor<any, any, any>
356
+ editor: BlockNoteEditor<any, any, any>,
357
357
  ) =>
358
358
  Extension.create({
359
359
  name: "columnResize",
@@ -37,7 +37,7 @@ interface DropCursorOptions {
37
37
  export function multiColumnDropCursor(
38
38
  options: DropCursorOptions & {
39
39
  editor: BlockNoteEditor<any, any, any>;
40
- }
40
+ },
41
41
  ): Plugin {
42
42
  const editor = options.editor;
43
43
  return new Plugin({
@@ -80,7 +80,7 @@ export function multiColumnDropCursor(
80
80
 
81
81
  const draggedBlock = nodeToBlock(
82
82
  slice.content.child(0),
83
- editor.pmSchema
83
+ editor.pmSchema,
84
84
  // TODO: cache?
85
85
  );
86
86
 
@@ -93,7 +93,7 @@ export function multiColumnDropCursor(
93
93
 
94
94
  const columnList = nodeToBlock<any, any, any>(
95
95
  parentBlock,
96
- editor.pmSchema
96
+ editor.pmSchema,
97
97
  );
98
98
 
99
99
  // In a `columnList`, we expect that the average width of each column
@@ -123,7 +123,7 @@ export function multiColumnDropCursor(
123
123
  }
124
124
 
125
125
  const index = columnList.children.findIndex(
126
- (b) => b.id === blockInfo.bnBlock.node.attrs.id
126
+ (b) => b.id === blockInfo.bnBlock.node.attrs.id,
127
127
  );
128
128
 
129
129
  const newChildren = columnList.children
@@ -131,7 +131,7 @@ export function multiColumnDropCursor(
131
131
  .map((column) => ({
132
132
  ...column,
133
133
  children: column.children.filter(
134
- (block) => block.id !== draggedBlock.id
134
+ (block) => block.id !== draggedBlock.id,
135
135
  ),
136
136
  }))
137
137
  // Remove empty columns (can happen when dragged block is removed).
@@ -175,7 +175,7 @@ export function multiColumnDropCursor(
175
175
  };
176
176
  }),
177
177
  },
178
- ]
178
+ ],
179
179
  );
180
180
  }
181
181
 
@@ -196,7 +196,10 @@ class DropCursorView {
196
196
  timeout: ReturnType<typeof setTimeout> | undefined = undefined;
197
197
  handlers: { name: string; handler: (event: Event) => void }[];
198
198
 
199
- constructor(readonly editorView: EditorView, options: DropCursorOptions) {
199
+ constructor(
200
+ readonly editorView: EditorView,
201
+ options: DropCursorOptions,
202
+ ) {
200
203
  this.width = options.width ?? 1;
201
204
  this.color = options.color === false ? undefined : options.color || "black";
202
205
  this.class = options.class;
@@ -211,7 +214,7 @@ class DropCursorView {
211
214
  // drop event captured in bubbling phase to make sure
212
215
  // "cursorPos" is set to undefined before the "handleDrop" handler is called
213
216
  // (otherwise an error could be thrown, see https://github.com/TypeCellOS/BlockNote/pull/1240)
214
- name === "drop" ? true : undefined
217
+ name === "drop" ? true : undefined,
215
218
  );
216
219
  return { name, handler };
217
220
  });
@@ -222,8 +225,8 @@ class DropCursorView {
222
225
  this.editorView.dom.removeEventListener(
223
226
  name,
224
227
  handler,
225
- name === "drop" ? true : undefined
226
- )
228
+ name === "drop" ? true : undefined,
229
+ ),
227
230
  );
228
231
  }
229
232
 
@@ -241,7 +244,7 @@ class DropCursorView {
241
244
  setCursor(
242
245
  cursorPos:
243
246
  | { pos: number; position: "left" | "right" | "regular" }
244
- | undefined
247
+ | undefined,
245
248
  ) {
246
249
  if (
247
250
  cursorPos === this.cursorPos ||
@@ -303,7 +306,7 @@ class DropCursorView {
303
306
  } else {
304
307
  // regular logic
305
308
  const node = this.editorView.nodeDOM(
306
- this.cursorPos.pos - (before ? before.nodeSize : 0)
309
+ this.cursorPos.pos - (before ? before.nodeSize : 0),
307
310
  );
308
311
  if (node) {
309
312
  const nodeRect = (node as HTMLElement).getBoundingClientRect();
@@ -362,7 +365,7 @@ class DropCursorView {
362
365
  this.element.classList.toggle("prosemirror-dropcursor-block", isBlock);
363
366
  this.element.classList.toggle(
364
367
  "prosemirror-dropcursor-vertical",
365
- this.cursorPos.position !== "regular"
368
+ this.cursorPos.position !== "regular",
366
369
  );
367
370
  this.element.classList.toggle("prosemirror-dropcursor-inline", !isBlock);
368
371
  let parentLeft, parentTop;
@@ -446,7 +449,7 @@ class DropCursorView {
446
449
  const point = dropPoint(
447
450
  this.editorView.state.doc,
448
451
  target,
449
- this.editorView.dragging.slice
452
+ this.editorView.dragging.slice,
450
453
  );
451
454
 
452
455
  if (point != null) {
@@ -482,7 +485,7 @@ class DropCursorView {
482
485
  */
483
486
  function getTargetPosInfo(
484
487
  state: EditorState,
485
- eventPos: { pos: number; inside: number }
488
+ eventPos: { pos: number; inside: number },
486
489
  ) {
487
490
  const blockPos = getNearestBlockPos(state.doc, eventPos.pos);
488
491
 
@@ -13,9 +13,9 @@ import { getMultiColumnDictionary } from "../../i18n/dictionary.js";
13
13
 
14
14
  export function checkMultiColumnBlocksInSchema<
15
15
  I extends InlineContentSchema,
16
- S extends StyleSchema
16
+ S extends StyleSchema,
17
17
  >(
18
- editor: BlockNoteEditor<any, I, S>
18
+ editor: BlockNoteEditor<any, I, S>,
19
19
  ): editor is BlockNoteEditor<typeof multiColumnSchema.blockSchema, I, S> {
20
20
  return (
21
21
  "column" in editor.schema.blockSchema &&
@@ -30,7 +30,7 @@ export function checkMultiColumnBlocksInSchema<
30
30
  export function getMultiColumnSlashMenuItems<
31
31
  BSchema extends BlockSchema,
32
32
  I extends InlineContentSchema,
33
- S extends StyleSchema
33
+ S extends StyleSchema,
34
34
  >(editor: BlockNoteEditor<BSchema, I, S>) {
35
35
  const items: Omit<DefaultReactSuggestionItem, "key">[] = [];
36
36
 
@@ -97,7 +97,7 @@ export function getMultiColumnSlashMenuItems<
97
97
  ],
98
98
  });
99
99
  },
100
- }
100
+ },
101
101
  );
102
102
  }
103
103
 
@@ -16,7 +16,7 @@ import { BlockNoteEditor } from "@blocknote/core";
16
16
  // }
17
17
 
18
18
  export function getMultiColumnDictionary(
19
- editor: BlockNoteEditor<any, any, any>
19
+ editor: BlockNoteEditor<any, any, any>,
20
20
  ) {
21
21
  if (!(editor.dictionary as any).multi_column) {
22
22
  throw new Error("Multi-column dictionary not found");
@@ -9,6 +9,7 @@ export const Column = createStronglyTypedTiptapNode({
9
9
  content: "blockContainer+",
10
10
  priority: 40,
11
11
  defining: true,
12
+ marks: "deletion insertion modification",
12
13
  addAttributes() {
13
14
  return {
14
15
  width: {
@@ -7,7 +7,7 @@ export const ColumnList = createStronglyTypedTiptapNode({
7
7
  content: "column column+", // min two columns
8
8
  priority: 40, // should be below blockContainer
9
9
  defining: true,
10
-
10
+ marks: "deletion insertion modification",
11
11
  parseHTML() {
12
12
  return [
13
13
  {
@@ -11,7 +11,7 @@ describe("Test insertBlocks", () => {
11
11
  getEditor().insertBlocks(
12
12
  [{ type: "columnList" }],
13
13
  "paragraph-0",
14
- "after"
14
+ "after",
15
15
  );
16
16
  }).toThrow();
17
17
  });
@@ -31,7 +31,7 @@ describe("Test insertBlocks", () => {
31
31
  },
32
32
  ],
33
33
  "paragraph-0",
34
- "after"
34
+ "after",
35
35
  );
36
36
  }).toThrow();
37
37
  });
@@ -57,7 +57,7 @@ describe("Test insertBlocks", () => {
57
57
  },
58
58
  ],
59
59
  "paragraph-0",
60
- "after"
60
+ "after",
61
61
  );
62
62
  }).toThrow();
63
63
  });
@@ -90,7 +90,7 @@ describe("Test insertBlocks", () => {
90
90
  },
91
91
  ],
92
92
  "paragraph-0",
93
- "after"
93
+ "after",
94
94
  );
95
95
 
96
96
  expect(getEditor().document).toMatchSnapshot();
@@ -110,7 +110,7 @@ describe("Test insertBlocks", () => {
110
110
  },
111
111
  ],
112
112
  "column-0",
113
- "before"
113
+ "before",
114
114
  );
115
115
 
116
116
  expect(getEditor().document).toMatchSnapshot();
@@ -144,7 +144,7 @@ describe("Test insertBlocks", () => {
144
144
  },
145
145
  ],
146
146
  "nested-paragraph-0",
147
- "after"
147
+ "after",
148
148
  );
149
149
 
150
150
  expect(getEditor().document).toMatchSnapshot();
@@ -167,7 +167,7 @@ describe("Test insertBlocks", () => {
167
167
  },
168
168
  ],
169
169
  "nested-paragraph-0",
170
- "after"
170
+ "after",
171
171
  );
172
172
  }).toThrow();
173
173
  });
@@ -184,7 +184,7 @@ describe("Test insertBlocks", () => {
184
184
  },
185
185
  ],
186
186
  "column-0",
187
- "after"
187
+ "after",
188
188
  );
189
189
  }).toThrow();
190
190
  });
@@ -198,7 +198,7 @@ describe("Test insertBlocks", () => {
198
198
  },
199
199
  ],
200
200
  "column-paragraph-0",
201
- "after"
201
+ "after",
202
202
  );
203
203
 
204
204
  expect(getEditor().document).toMatchSnapshot();
@@ -32,7 +32,7 @@ describe("Test replaceBlocks", () => {
32
32
  },
33
33
  ],
34
34
  },
35
- ]
35
+ ],
36
36
  );
37
37
 
38
38
  expect(getEditor().document).toMatchSnapshot();
@@ -1,3 +1,5 @@
1
+ // TODO: remove duplicate file
2
+
1
3
  import {
2
4
  Block,
3
5
  BlockNoteSchema,
@@ -17,7 +19,7 @@ import {
17
19
  } from "@blocknote/core";
18
20
 
19
21
  function textShorthandToStyledText(
20
- content: string | StyledText<any>[] = ""
22
+ content: string | StyledText<any>[] = "",
21
23
  ): StyledText<any>[] {
22
24
  if (typeof content === "string") {
23
25
  return [
@@ -36,7 +38,7 @@ function partialContentToInlineContent(
36
38
  | PartialInlineContent<any, any>
37
39
  | PartialTableCell<any, any>
38
40
  | TableContent<any>
39
- | undefined
41
+ | undefined,
40
42
  ):
41
43
  | InlineContent<any, any>[]
42
44
  | TableContent<any>
@@ -76,7 +78,7 @@ function partialContentToInlineContent(
76
78
  rows: content.rows.map((row) => ({
77
79
  ...row,
78
80
  cells: row.cells.map(
79
- (cell) => partialContentToInlineContent(cell) as any
81
+ (cell) => partialContentToInlineContent(cell) as any,
80
82
  ),
81
83
  })),
82
84
  };
@@ -100,23 +102,23 @@ function partialContentToInlineContent(
100
102
  export function partialBlocksToBlocksForTesting<
101
103
  BSchema extends BlockSchema,
102
104
  I extends InlineContentSchema,
103
- S extends StyleSchema
105
+ S extends StyleSchema,
104
106
  >(
105
107
  schema: BlockNoteSchema<BSchema, I, S>,
106
- partialBlocks: Array<PartialBlock<NoInfer<BSchema>, NoInfer<I>, NoInfer<S>>>
108
+ partialBlocks: Array<PartialBlock<NoInfer<BSchema>, NoInfer<I>, NoInfer<S>>>,
107
109
  ): Array<Block<BSchema, I, S>> {
108
110
  return partialBlocks.map((partialBlock) =>
109
- partialBlockToBlockForTesting(schema.blockSchema, partialBlock)
111
+ partialBlockToBlockForTesting(schema.blockSchema, partialBlock),
110
112
  );
111
113
  }
112
114
 
113
115
  export function partialBlockToBlockForTesting<
114
116
  BSchema extends BlockSchema,
115
117
  I extends InlineContentSchema,
116
- S extends StyleSchema
118
+ S extends StyleSchema,
117
119
  >(
118
120
  schema: BSchema,
119
- partialBlock: PartialBlock<BSchema, I, S>
121
+ partialBlock: PartialBlock<BSchema, I, S>,
120
122
  ): Block<BSchema, I, S> {
121
123
  const contentType: "inline" | "table" | "none" =
122
124
  schema[partialBlock.type!].content;
@@ -129,14 +131,14 @@ export function partialBlockToBlockForTesting<
129
131
  contentType === "inline"
130
132
  ? []
131
133
  : contentType === "table"
132
- ? {
133
- type: "tableContent",
134
- columnWidths: undefined,
135
- headerRows: undefined,
136
- headerCols: undefined,
137
- rows: [],
138
- }
139
- : (undefined as any),
134
+ ? {
135
+ type: "tableContent",
136
+ columnWidths: undefined,
137
+ headerRows: undefined,
138
+ headerCols: undefined,
139
+ rows: [],
140
+ }
141
+ : (undefined as any),
140
142
  children: [] as any,
141
143
  ...partialBlock,
142
144
  };
@@ -149,7 +151,7 @@ export function partialBlockToBlockForTesting<
149
151
  ) {
150
152
  (withDefaults.props as any)[propKey] = propValue.default;
151
153
  }
152
- }
154
+ },
153
155
  );
154
156
 
155
157
  if (contentType === "inline") {
@@ -21,12 +21,12 @@ import { multiColumnSchemaTestCases } from "./testCases.js";
21
21
  async function convertToHTMLAndCompareSnapshots<
22
22
  B extends BlockSchema,
23
23
  I extends InlineContentSchema,
24
- S extends StyleSchema
24
+ S extends StyleSchema,
25
25
  >(
26
26
  editor: BlockNoteEditor<B, I, S>,
27
27
  blocks: PartialBlock<B, I, S>[],
28
28
  snapshotDirectory: string,
29
- snapshotName: string
29
+ snapshotName: string,
30
30
  ) {
31
31
  addIdsToBlocks(blocks);
32
32
  const serializer = createInternalHTMLSerializer(editor.pmSchema, editor);
@@ -93,7 +93,7 @@ describe("Test multi-column HTML conversion", () => {
93
93
  editor,
94
94
  document.blocks,
95
95
  nameSplit[0],
96
- nameSplit[1]
96
+ nameSplit[1],
97
97
  );
98
98
  });
99
99
  }
@@ -22,7 +22,7 @@ function addIdsToBlock(block: PartialBlock<any, any, any>) {
22
22
 
23
23
  function validateConversion(
24
24
  block: PartialBlock<any, any, any>,
25
- editor: BlockNoteEditor<any, any, any>
25
+ editor: BlockNoteEditor<any, any, any>,
26
26
  ) {
27
27
  addIdsToBlock(block);
28
28
  const node = blockToNode(block, editor.pmSchema);
@@ -33,7 +33,7 @@ function validateConversion(
33
33
 
34
34
  const fullOriginalBlock = partialBlockToBlockForTesting(
35
35
  editor.schema.blockSchema,
36
- block
36
+ block,
37
37
  );
38
38
 
39
39
  expect(outputBlock).toStrictEqual(fullOriginalBlock);