@blocknote/xl-multi-column 0.32.0 → 0.34.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":1750769786672,"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"]}]}
1
+ {"builtAt":1752763373623,"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@19.1.0/node_modules/react-icons/lib/iconContext.mjs","size":251,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.1.0/node_modules/react-icons/lib/iconBase.mjs","size":4003,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.1.0/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.32.0",
12
+ "version": "0.34.0",
13
13
  "files": [
14
14
  "dist",
15
15
  "types",
@@ -42,8 +42,8 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@blocknote/core": "0.32.0",
46
- "@blocknote/react": "0.32.0",
45
+ "@blocknote/core": "0.34.0",
46
+ "@blocknote/react": "0.34.0",
47
47
  "@tiptap/core": "^2.12.0",
48
48
  "prosemirror-model": "^1.25.1",
49
49
  "prosemirror-state": "^1.4.3",
@@ -53,13 +53,13 @@
53
53
  "react-icons": "^5.2.1"
54
54
  },
55
55
  "devDependencies": {
56
- "@types/react": "^18.3.1",
57
- "@types/react-dom": "^18.3.1",
56
+ "@types/react": "^19.1.0",
57
+ "@types/react-dom": "^19.1.0",
58
58
  "@vitest/ui": "^2.1.4",
59
59
  "eslint": "^8.10.0",
60
60
  "jsdom": "^21.1.0",
61
- "react": "^18.3.1",
62
- "react-dom": "^18.3.1",
61
+ "react": "^19.1.0",
62
+ "react-dom": "^19.1.0",
63
63
  "rimraf": "^5.0.5",
64
64
  "rollup-plugin-webpack-stats": "^0.2.2",
65
65
  "typescript": "^5.3.3",
@@ -9,12 +9,12 @@ import {
9
9
  createExternalHTMLExporter,
10
10
  createInternalHTMLSerializer,
11
11
  } from "@blocknote/core";
12
- import { afterEach, beforeEach, describe, expect, it } from "vitest";
13
-
14
12
  import {
15
13
  addIdsToBlocks,
16
14
  partialBlocksToBlocksForTesting,
17
- } from "./formatConversionTestUtil.js";
15
+ } from "@shared/formatConversionTestUtil.js";
16
+ import { afterEach, beforeEach, describe, expect, it } from "vitest";
17
+
18
18
  import { multiColumnSchemaTestCases } from "./testCases.js";
19
19
 
20
20
  // TODO: code same from @blocknote/core, maybe create separate test util package
@@ -7,8 +7,8 @@ import {
7
7
  blockToNode,
8
8
  nodeToBlock,
9
9
  } from "@blocknote/core";
10
+ import { partialBlockToBlockForTesting } from "@shared/formatConversionTestUtil.js";
10
11
 
11
- import { partialBlockToBlockForTesting } from "./formatConversionTestUtil.js";
12
12
  import { multiColumnSchemaTestCases } from "./testCases.js";
13
13
 
14
14
  function addIdsToBlock(block: PartialBlock<any, any, any>) {
@@ -1,199 +0,0 @@
1
- // TODO: remove duplicate file
2
-
3
- import {
4
- Block,
5
- BlockNoteSchema,
6
- BlockSchema,
7
- InlineContent,
8
- InlineContentSchema,
9
- isPartialLinkInlineContent,
10
- isStyledTextInlineContent,
11
- PartialBlock,
12
- PartialInlineContent,
13
- PartialTableCell,
14
- StyledText,
15
- StyleSchema,
16
- TableCell,
17
- TableContent,
18
- UniqueID,
19
- } from "@blocknote/core";
20
-
21
- function textShorthandToStyledText(
22
- content: string | StyledText<any>[] = "",
23
- ): StyledText<any>[] {
24
- if (typeof content === "string") {
25
- return [
26
- {
27
- type: "text",
28
- text: content,
29
- styles: {},
30
- },
31
- ];
32
- }
33
- return content;
34
- }
35
-
36
- function partialContentToInlineContent(
37
- content:
38
- | PartialInlineContent<any, any>
39
- | PartialTableCell<any, any>
40
- | TableContent<any>
41
- | undefined,
42
- ):
43
- | InlineContent<any, any>[]
44
- | TableContent<any>
45
- | TableCell<any, any>
46
- | undefined {
47
- if (typeof content === "string") {
48
- return textShorthandToStyledText(content);
49
- }
50
-
51
- if (Array.isArray(content)) {
52
- return content.flatMap((partialContent) => {
53
- if (typeof partialContent === "string") {
54
- return textShorthandToStyledText(partialContent);
55
- } else if (isPartialLinkInlineContent(partialContent)) {
56
- return {
57
- ...partialContent,
58
- content: textShorthandToStyledText(partialContent.content),
59
- };
60
- } else if (isStyledTextInlineContent(partialContent)) {
61
- return partialContent;
62
- } else {
63
- // custom inline content
64
-
65
- return {
66
- props: {},
67
- ...partialContent,
68
- content: partialContentToInlineContent(partialContent.content),
69
- } as any;
70
- }
71
- });
72
- } else if (content?.type === "tableContent") {
73
- return {
74
- type: "tableContent",
75
- columnWidths: content.columnWidths,
76
- headerRows: content.headerRows,
77
- headerCols: content.headerCols,
78
- rows: content.rows.map((row) => ({
79
- ...row,
80
- cells: row.cells.map(
81
- (cell) => partialContentToInlineContent(cell) as any,
82
- ),
83
- })),
84
- };
85
- } else if (content?.type === "tableCell") {
86
- return {
87
- type: "tableCell",
88
- content: partialContentToInlineContent(content.content) as any[],
89
- props: {
90
- backgroundColor: content.props?.backgroundColor ?? "default",
91
- textColor: content.props?.textColor ?? "default",
92
- textAlignment: content.props?.textAlignment ?? "left",
93
- colspan: content.props?.colspan ?? 1,
94
- rowspan: content.props?.rowspan ?? 1,
95
- },
96
- } satisfies TableCell<any, any>;
97
- }
98
-
99
- return content;
100
- }
101
-
102
- export function partialBlocksToBlocksForTesting<
103
- BSchema extends BlockSchema,
104
- I extends InlineContentSchema,
105
- S extends StyleSchema,
106
- >(
107
- schema: BlockNoteSchema<BSchema, I, S>,
108
- partialBlocks: Array<PartialBlock<NoInfer<BSchema>, NoInfer<I>, NoInfer<S>>>,
109
- ): Array<Block<BSchema, I, S>> {
110
- return partialBlocks.map((partialBlock) =>
111
- partialBlockToBlockForTesting(schema.blockSchema, partialBlock),
112
- );
113
- }
114
-
115
- export function partialBlockToBlockForTesting<
116
- BSchema extends BlockSchema,
117
- I extends InlineContentSchema,
118
- S extends StyleSchema,
119
- >(
120
- schema: BSchema,
121
- partialBlock: PartialBlock<BSchema, I, S>,
122
- ): Block<BSchema, I, S> {
123
- const contentType: "inline" | "table" | "none" =
124
- schema[partialBlock.type!].content;
125
-
126
- const withDefaults: Block<BSchema, I, S> = {
127
- id: "",
128
- type: partialBlock.type!,
129
- props: {} as any,
130
- content:
131
- contentType === "inline"
132
- ? []
133
- : contentType === "table"
134
- ? {
135
- type: "tableContent",
136
- columnWidths: undefined,
137
- headerRows: undefined,
138
- headerCols: undefined,
139
- rows: [],
140
- }
141
- : (undefined as any),
142
- children: [] as any,
143
- ...partialBlock,
144
- };
145
-
146
- Object.entries(schema[partialBlock.type!].propSchema).forEach(
147
- ([propKey, propValue]) => {
148
- if (
149
- withDefaults.props[propKey] === undefined &&
150
- propValue.default !== undefined
151
- ) {
152
- (withDefaults.props as any)[propKey] = propValue.default;
153
- }
154
- },
155
- );
156
-
157
- if (contentType === "inline") {
158
- const content = withDefaults.content as InlineContent<I, S>[] | undefined;
159
- withDefaults.content = partialContentToInlineContent(content) as any;
160
- } else if (contentType === "table") {
161
- const content = withDefaults.content as TableContent<I, S> | undefined;
162
- withDefaults.content = {
163
- type: "tableContent",
164
- columnWidths:
165
- content?.columnWidths ||
166
- content?.rows[0]?.cells.map(() => undefined) ||
167
- [],
168
- headerRows: content?.headerRows || undefined,
169
- headerCols: content?.headerCols || undefined,
170
- rows:
171
- content?.rows.map((row) => ({
172
- cells: row.cells.map((cell) => partialContentToInlineContent(cell)),
173
- })) || [],
174
- } as any;
175
- }
176
-
177
- return {
178
- ...withDefaults,
179
- content: partialContentToInlineContent(withDefaults.content),
180
- children: withDefaults.children.map((c) => {
181
- return partialBlockToBlockForTesting(schema, c);
182
- }),
183
- } as any;
184
- }
185
-
186
- export function addIdsToBlock(block: PartialBlock<any, any, any>) {
187
- if (!block.id) {
188
- block.id = UniqueID.options.generateID();
189
- }
190
- if (block.children) {
191
- addIdsToBlocks(block.children);
192
- }
193
- }
194
-
195
- export function addIdsToBlocks(blocks: PartialBlock<any, any, any>[]) {
196
- for (const block of blocks) {
197
- addIdsToBlock(block);
198
- }
199
- }
@@ -1,5 +0,0 @@
1
- import { Block, BlockNoteSchema, BlockSchema, InlineContentSchema, PartialBlock, StyleSchema } from "@blocknote/core";
2
- export declare function partialBlocksToBlocksForTesting<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BlockNoteSchema<BSchema, I, S>, partialBlocks: Array<PartialBlock<NoInfer<BSchema>, NoInfer<I>, NoInfer<S>>>): Array<Block<BSchema, I, S>>;
3
- export declare function partialBlockToBlockForTesting<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BSchema, partialBlock: PartialBlock<BSchema, I, S>): Block<BSchema, I, S>;
4
- export declare function addIdsToBlock(block: PartialBlock<any, any, any>): void;
5
- export declare function addIdsToBlocks(blocks: PartialBlock<any, any, any>[]): void;