@blocknote/xl-multi-column 0.38.0 → 0.39.1
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.
- package/dist/blocknote-xl-multi-column.cjs +1 -1
- package/dist/blocknote-xl-multi-column.cjs.map +1 -1
- package/dist/blocknote-xl-multi-column.js +86 -78
- package/dist/blocknote-xl-multi-column.js.map +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/blocks/Columns/index.ts +18 -7
- package/src/blocks/schema.ts +2 -13
- package/src/pm-nodes/Column.ts +2 -2
- package/src/pm-nodes/ColumnList.ts +2 -2
- package/src/test/conversions/__snapshots__/nodeConversion.test.ts.snap +8 -8
- package/src/test/conversions/htmlConversion.test.ts +0 -1
- package/src/test/conversions/nodeConversion.test.ts +0 -1
- package/src/test/setupTestEnv.ts +7 -3
- package/types/src/blocks/Columns/index.d.ts +5 -31
- package/types/src/blocks/schema.d.ts +39 -53
- package/types/src/pm-nodes/Column.d.ts +2 -6
- package/types/src/pm-nodes/ColumnList.d.ts +2 -6
- package/types/src/test/setupTestEnv.d.ts +442 -1110
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1758287653045,"assets":[{"name":"blocknote-xl-multi-column.cjs","size":20516},{"name":"blocknote-xl-multi-column.cjs.map","size":3791854}],"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":2591,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/ColumnList.ts","size":1144,"chunks":["a1ee98a"]},{"name":"./src/blocks/Columns/index.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/blocks/schema.ts","size":295,"chunks":["a1ee98a"]},{"name":"./src/extensions/DropCursor/MultiColumnDropCursorPlugin.ts","size":11843,"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": "GPL-3.0 OR PROPRIETARY",
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.39.1",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
15
|
"types",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@blocknote/core": "0.
|
|
46
|
-
"@blocknote/react": "0.
|
|
47
|
-
"@tiptap/core": "^
|
|
45
|
+
"@blocknote/core": "0.39.1",
|
|
46
|
+
"@blocknote/react": "0.39.1",
|
|
47
|
+
"@tiptap/core": "^3.4.3",
|
|
48
48
|
"prosemirror-model": "^1.25.3",
|
|
49
49
|
"prosemirror-state": "^1.4.3",
|
|
50
50
|
"prosemirror-tables": "^1.3.7",
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { Column } from "../../pm-nodes/Column.js";
|
|
2
2
|
import { ColumnList } from "../../pm-nodes/ColumnList.js";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { createBlockSpecFromTiptapNode } from "@blocknote/core";
|
|
5
5
|
|
|
6
|
-
export const ColumnBlock =
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const ColumnBlock = createBlockSpecFromTiptapNode(
|
|
7
|
+
{
|
|
8
|
+
node: Column,
|
|
9
|
+
type: "column",
|
|
10
|
+
content: "none",
|
|
9
11
|
},
|
|
10
|
-
|
|
12
|
+
{
|
|
13
|
+
width: {
|
|
14
|
+
default: 1,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
);
|
|
11
18
|
|
|
12
|
-
export const ColumnListBlock =
|
|
13
|
-
|
|
19
|
+
export const ColumnListBlock = createBlockSpecFromTiptapNode(
|
|
20
|
+
{
|
|
21
|
+
node: ColumnList,
|
|
22
|
+
type: "columnList",
|
|
23
|
+
content: "none",
|
|
24
|
+
},
|
|
14
25
|
{},
|
|
15
26
|
);
|
package/src/blocks/schema.ts
CHANGED
|
@@ -23,21 +23,10 @@ export const withMultiColumn = <
|
|
|
23
23
|
>(
|
|
24
24
|
schema: BlockNoteSchema<B, I, S>,
|
|
25
25
|
) => {
|
|
26
|
-
return
|
|
26
|
+
return schema.extend({
|
|
27
27
|
blockSpecs: {
|
|
28
|
-
...schema.blockSpecs,
|
|
29
28
|
column: ColumnBlock,
|
|
30
29
|
columnList: ColumnListBlock,
|
|
31
30
|
},
|
|
32
|
-
|
|
33
|
-
styleSpecs: schema.styleSpecs,
|
|
34
|
-
}) as any as BlockNoteSchema<
|
|
35
|
-
// typescript needs some help here
|
|
36
|
-
B & {
|
|
37
|
-
column: typeof ColumnBlock.config;
|
|
38
|
-
columnList: typeof ColumnListBlock.config;
|
|
39
|
-
},
|
|
40
|
-
I,
|
|
41
|
-
S
|
|
42
|
-
>;
|
|
31
|
+
});
|
|
43
32
|
};
|
package/src/pm-nodes/Column.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
2
|
|
|
3
3
|
import { createColumnResizeExtension } from "../extensions/ColumnResize/ColumnResizeExtension.js";
|
|
4
4
|
|
|
5
|
-
export const Column =
|
|
5
|
+
export const Column = Node.create({
|
|
6
6
|
name: "column",
|
|
7
7
|
group: "bnBlock childContainer",
|
|
8
8
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
2
|
|
|
3
|
-
export const ColumnList =
|
|
3
|
+
export const ColumnList = Node.create({
|
|
4
4
|
name: "columnList",
|
|
5
5
|
group: "childContainer bnBlock blockGroupChild",
|
|
6
6
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -14,14 +14,14 @@ exports[`Test BlockNote-Prosemirror conversion > Case: multi-column-schema > Con
|
|
|
14
14
|
"content": [
|
|
15
15
|
{
|
|
16
16
|
"attrs": {
|
|
17
|
-
"backgroundColor": "default",
|
|
18
17
|
"id": "3",
|
|
19
|
-
"textColor": "default",
|
|
20
18
|
},
|
|
21
19
|
"content": [
|
|
22
20
|
{
|
|
23
21
|
"attrs": {
|
|
22
|
+
"backgroundColor": "default",
|
|
24
23
|
"textAlignment": "left",
|
|
24
|
+
"textColor": "default",
|
|
25
25
|
},
|
|
26
26
|
"content": [
|
|
27
27
|
{
|
|
@@ -36,14 +36,14 @@ exports[`Test BlockNote-Prosemirror conversion > Case: multi-column-schema > Con
|
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"attrs": {
|
|
39
|
-
"backgroundColor": "default",
|
|
40
39
|
"id": "4",
|
|
41
|
-
"textColor": "default",
|
|
42
40
|
},
|
|
43
41
|
"content": [
|
|
44
42
|
{
|
|
45
43
|
"attrs": {
|
|
44
|
+
"backgroundColor": "default",
|
|
46
45
|
"textAlignment": "left",
|
|
46
|
+
"textColor": "default",
|
|
47
47
|
},
|
|
48
48
|
"content": [
|
|
49
49
|
{
|
|
@@ -67,14 +67,14 @@ exports[`Test BlockNote-Prosemirror conversion > Case: multi-column-schema > Con
|
|
|
67
67
|
"content": [
|
|
68
68
|
{
|
|
69
69
|
"attrs": {
|
|
70
|
-
"backgroundColor": "default",
|
|
71
70
|
"id": "6",
|
|
72
|
-
"textColor": "default",
|
|
73
71
|
},
|
|
74
72
|
"content": [
|
|
75
73
|
{
|
|
76
74
|
"attrs": {
|
|
75
|
+
"backgroundColor": "default",
|
|
77
76
|
"textAlignment": "left",
|
|
77
|
+
"textColor": "default",
|
|
78
78
|
},
|
|
79
79
|
"content": [
|
|
80
80
|
{
|
|
@@ -89,14 +89,14 @@ exports[`Test BlockNote-Prosemirror conversion > Case: multi-column-schema > Con
|
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"attrs": {
|
|
92
|
-
"backgroundColor": "default",
|
|
93
92
|
"id": "7",
|
|
94
|
-
"textColor": "default",
|
|
95
93
|
},
|
|
96
94
|
"content": [
|
|
97
95
|
{
|
|
98
96
|
"attrs": {
|
|
97
|
+
"backgroundColor": "default",
|
|
99
98
|
"textAlignment": "left",
|
|
99
|
+
"textColor": "default",
|
|
100
100
|
},
|
|
101
101
|
"content": [
|
|
102
102
|
{
|
package/src/test/setupTestEnv.ts
CHANGED
|
@@ -5,9 +5,14 @@ import {
|
|
|
5
5
|
} from "@blocknote/core";
|
|
6
6
|
import { afterAll, beforeAll, beforeEach } from "vitest";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { ColumnBlock, ColumnListBlock } from "../blocks/Columns/index.js";
|
|
9
9
|
|
|
10
|
-
export const testEditorSchema =
|
|
10
|
+
export const testEditorSchema = BlockNoteSchema.create().extend({
|
|
11
|
+
blockSpecs: {
|
|
12
|
+
column: ColumnBlock,
|
|
13
|
+
columnList: ColumnListBlock,
|
|
14
|
+
} as const,
|
|
15
|
+
});
|
|
11
16
|
|
|
12
17
|
export function setupTestEnv() {
|
|
13
18
|
let editor: BlockNoteEditor<
|
|
@@ -25,7 +30,6 @@ export function setupTestEnv() {
|
|
|
25
30
|
});
|
|
26
31
|
|
|
27
32
|
afterAll(() => {
|
|
28
|
-
editor.mount(undefined);
|
|
29
33
|
editor._tiptapEditor.destroy();
|
|
30
34
|
editor = undefined as any;
|
|
31
35
|
});
|
|
@@ -1,32 +1,6 @@
|
|
|
1
|
-
export declare const ColumnBlock: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
content: "none";
|
|
5
|
-
propSchema: {
|
|
6
|
-
width: {
|
|
7
|
-
default: number;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
1
|
+
export declare const ColumnBlock: import("@blocknote/core").LooseBlockSpec<"column", {
|
|
2
|
+
width: {
|
|
3
|
+
default: number;
|
|
10
4
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
content: "none";
|
|
14
|
-
propSchema: {
|
|
15
|
-
width: {
|
|
16
|
-
default: number;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
20
|
-
};
|
|
21
|
-
export declare const ColumnListBlock: {
|
|
22
|
-
config: {
|
|
23
|
-
type: "columnList";
|
|
24
|
-
content: "none";
|
|
25
|
-
propSchema: {};
|
|
26
|
-
};
|
|
27
|
-
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
28
|
-
type: "columnList";
|
|
29
|
-
content: "none";
|
|
30
|
-
propSchema: {};
|
|
31
|
-
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
32
|
-
};
|
|
5
|
+
}, "none">;
|
|
6
|
+
export declare const ColumnListBlock: import("@blocknote/core").LooseBlockSpec<"columnList", {}, "none">;
|
|
@@ -1,38 +1,11 @@
|
|
|
1
1
|
import { BlockNoteSchema, BlockSchema, InlineContentSchema, StyleSchema } from "@blocknote/core";
|
|
2
|
-
import { ColumnBlock, ColumnListBlock } from "./Columns/index.js";
|
|
3
2
|
export declare const multiColumnSchema: BlockNoteSchema<import("@blocknote/core").BlockSchemaFromSpecs<{
|
|
4
|
-
column: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
content: "none";
|
|
8
|
-
propSchema: {
|
|
9
|
-
width: {
|
|
10
|
-
default: number;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
15
|
-
type: "column";
|
|
16
|
-
content: "none";
|
|
17
|
-
propSchema: {
|
|
18
|
-
width: {
|
|
19
|
-
default: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}, any, InlineContentSchema, StyleSchema>;
|
|
23
|
-
};
|
|
24
|
-
columnList: {
|
|
25
|
-
config: {
|
|
26
|
-
type: "columnList";
|
|
27
|
-
content: "none";
|
|
28
|
-
propSchema: {};
|
|
3
|
+
column: import("@blocknote/core").LooseBlockSpec<"column", {
|
|
4
|
+
width: {
|
|
5
|
+
default: number;
|
|
29
6
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
content: "none";
|
|
33
|
-
propSchema: {};
|
|
34
|
-
}, any, InlineContentSchema, StyleSchema>;
|
|
35
|
-
};
|
|
7
|
+
}, "none">;
|
|
8
|
+
columnList: import("@blocknote/core").LooseBlockSpec<"columnList", {}, "none">;
|
|
36
9
|
}>, import("@blocknote/core").InlineContentSchemaFromSpecs<{
|
|
37
10
|
text: {
|
|
38
11
|
config: "text";
|
|
@@ -48,55 +21,68 @@ export declare const multiColumnSchema: BlockNoteSchema<import("@blocknote/core"
|
|
|
48
21
|
type: string;
|
|
49
22
|
propSchema: "boolean";
|
|
50
23
|
};
|
|
51
|
-
implementation: import("@blocknote/core").StyleImplementation
|
|
24
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
25
|
+
type: string;
|
|
26
|
+
propSchema: "boolean";
|
|
27
|
+
}>;
|
|
52
28
|
};
|
|
53
29
|
italic: {
|
|
54
30
|
config: {
|
|
55
31
|
type: string;
|
|
56
32
|
propSchema: "boolean";
|
|
57
33
|
};
|
|
58
|
-
implementation: import("@blocknote/core").StyleImplementation
|
|
34
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
35
|
+
type: string;
|
|
36
|
+
propSchema: "boolean";
|
|
37
|
+
}>;
|
|
59
38
|
};
|
|
60
39
|
underline: {
|
|
61
40
|
config: {
|
|
62
41
|
type: string;
|
|
63
42
|
propSchema: "boolean";
|
|
64
43
|
};
|
|
65
|
-
implementation: import("@blocknote/core").StyleImplementation
|
|
44
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
45
|
+
type: string;
|
|
46
|
+
propSchema: "boolean";
|
|
47
|
+
}>;
|
|
66
48
|
};
|
|
67
49
|
strike: {
|
|
68
50
|
config: {
|
|
69
51
|
type: string;
|
|
70
52
|
propSchema: "boolean";
|
|
71
53
|
};
|
|
72
|
-
implementation: import("@blocknote/core").StyleImplementation
|
|
54
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
55
|
+
type: string;
|
|
56
|
+
propSchema: "boolean";
|
|
57
|
+
}>;
|
|
73
58
|
};
|
|
74
59
|
code: {
|
|
75
60
|
config: {
|
|
76
61
|
type: string;
|
|
77
62
|
propSchema: "boolean";
|
|
78
63
|
};
|
|
79
|
-
implementation: import("@blocknote/core").StyleImplementation
|
|
80
|
-
};
|
|
81
|
-
textColor: {
|
|
82
|
-
config: {
|
|
64
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
83
65
|
type: string;
|
|
84
|
-
propSchema: "
|
|
85
|
-
}
|
|
86
|
-
implementation: import("@blocknote/core").StyleImplementation;
|
|
87
|
-
};
|
|
88
|
-
backgroundColor: {
|
|
89
|
-
config: {
|
|
90
|
-
type: string;
|
|
91
|
-
propSchema: "string";
|
|
92
|
-
};
|
|
93
|
-
implementation: import("@blocknote/core").StyleImplementation;
|
|
66
|
+
propSchema: "boolean";
|
|
67
|
+
}>;
|
|
94
68
|
};
|
|
69
|
+
textColor: import("@blocknote/core").StyleSpec<{
|
|
70
|
+
readonly type: "textColor";
|
|
71
|
+
readonly propSchema: "string";
|
|
72
|
+
}>;
|
|
73
|
+
backgroundColor: import("@blocknote/core").StyleSpec<{
|
|
74
|
+
readonly type: "backgroundColor";
|
|
75
|
+
readonly propSchema: "string";
|
|
76
|
+
}>;
|
|
95
77
|
}>>;
|
|
96
78
|
/**
|
|
97
79
|
* Adds multi-column support to the given schema.
|
|
98
80
|
*/
|
|
99
|
-
export declare const withMultiColumn: <B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BlockNoteSchema<B, I, S>) =>
|
|
100
|
-
column:
|
|
101
|
-
|
|
81
|
+
export declare const withMultiColumn: <B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BlockNoteSchema<B, I, S>) => import("@blocknote/core").CustomBlockNoteSchema<B & {
|
|
82
|
+
column: import("@blocknote/core").BlockConfig<"column", {
|
|
83
|
+
width: {
|
|
84
|
+
default: number;
|
|
85
|
+
};
|
|
86
|
+
}, "none">;
|
|
87
|
+
columnList: import("@blocknote/core").BlockConfig<"columnList", {}, "none">;
|
|
102
88
|
}, I, S>;
|