@akinon/ui-editor 1.1.0 → 1.1.2-beta.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.
|
@@ -4,11 +4,21 @@ import Paragraph from '@tiptap/extension-paragraph';
|
|
|
4
4
|
import { Table, TableRow } from '@tiptap/extension-table';
|
|
5
5
|
import Text from '@tiptap/extension-text';
|
|
6
6
|
import { NodeType } from '@tiptap/pm/model';
|
|
7
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
7
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
8
8
|
|
|
9
9
|
import { CustomTableCell } from '../custom-table-cell-extension';
|
|
10
10
|
import { CustomTableHeader } from '../custom-table-header-extension';
|
|
11
11
|
|
|
12
|
+
// ProseMirror's DOMObserver schedules a flush via setTimeout after the editor
|
|
13
|
+
// mounts. If the editor is not destroyed before the happy-dom environment is
|
|
14
|
+
// torn down, that timer fires post-teardown and throws "document is not
|
|
15
|
+
// defined", failing the pipeline step even though every test passed. Tracking
|
|
16
|
+
// every Editor instance and destroying it in afterEach cancels the timer.
|
|
17
|
+
const editors: Editor[] = [];
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
while (editors.length) editors.pop()?.destroy();
|
|
20
|
+
});
|
|
21
|
+
|
|
12
22
|
describe('CustomTableCell', () => {
|
|
13
23
|
it('should render with custom attributes', () => {
|
|
14
24
|
const editor = new Editor({
|
|
@@ -31,6 +41,7 @@ describe('CustomTableCell', () => {
|
|
|
31
41
|
</table>
|
|
32
42
|
`
|
|
33
43
|
});
|
|
44
|
+
editors.push(editor);
|
|
34
45
|
|
|
35
46
|
const cell = editor.view.dom.querySelector('td');
|
|
36
47
|
expect(cell).not.toBeNull();
|
|
@@ -55,6 +66,7 @@ describe('CustomTableCell', () => {
|
|
|
55
66
|
CustomTableHeader
|
|
56
67
|
]
|
|
57
68
|
});
|
|
69
|
+
editors.push(editor2);
|
|
58
70
|
|
|
59
71
|
expect(() => {
|
|
60
72
|
editor2.commands.insertTable({ rows: 3, cols: 3 });
|
|
@@ -4,11 +4,21 @@ import Paragraph from '@tiptap/extension-paragraph';
|
|
|
4
4
|
import { Table, TableRow } from '@tiptap/extension-table';
|
|
5
5
|
import Text from '@tiptap/extension-text';
|
|
6
6
|
import { NodeType } from '@tiptap/pm/model';
|
|
7
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
7
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
8
8
|
|
|
9
9
|
import { CustomTableCell } from '../custom-table-cell-extension';
|
|
10
10
|
import { CustomTableHeader } from '../custom-table-header-extension';
|
|
11
11
|
|
|
12
|
+
// ProseMirror's DOMObserver schedules a flush via setTimeout after the editor
|
|
13
|
+
// mounts. If the editor is not destroyed before the happy-dom environment is
|
|
14
|
+
// torn down, that timer fires post-teardown and throws "document is not
|
|
15
|
+
// defined", failing the pipeline step even though every test passed. Tracking
|
|
16
|
+
// every Editor instance and destroying it in afterEach cancels the timer.
|
|
17
|
+
const editors: Editor[] = [];
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
while (editors.length) editors.pop()?.destroy();
|
|
20
|
+
});
|
|
21
|
+
|
|
12
22
|
describe('CustomTableCell', () => {
|
|
13
23
|
it('should render with custom attributes', () => {
|
|
14
24
|
const editor = new Editor({
|
|
@@ -31,6 +41,7 @@ describe('CustomTableCell', () => {
|
|
|
31
41
|
</table>
|
|
32
42
|
`
|
|
33
43
|
});
|
|
44
|
+
editors.push(editor);
|
|
34
45
|
|
|
35
46
|
const cell = editor.view.dom.querySelector('td');
|
|
36
47
|
expect(cell).not.toBeNull();
|
|
@@ -55,6 +66,7 @@ describe('CustomTableCell', () => {
|
|
|
55
66
|
CustomTableHeader
|
|
56
67
|
]
|
|
57
68
|
});
|
|
69
|
+
editors.push(editor2);
|
|
58
70
|
|
|
59
71
|
expect(() => {
|
|
60
72
|
editor2.commands.insertTable({ rows: 3, cols: 3 });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/ui-editor",
|
|
3
|
-
"version": "1.1.0",
|
|
3
|
+
"version": "1.1.2-beta.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A headless lightweight text editor for Akinon.",
|
|
6
6
|
"type": "module",
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
"prettier": "^3.6.2",
|
|
54
54
|
"y-protocols": "^1.0.7",
|
|
55
55
|
"yjs": "^13.6.29",
|
|
56
|
-
"@akinon/ui-button": "1.5.0",
|
|
57
|
-
"@akinon/ui-color-picker": "1.1.8",
|
|
58
56
|
"@akinon/akilocale": "1.2.8",
|
|
57
|
+
"@akinon/ui-button": "1.5.2-beta.0",
|
|
58
|
+
"@akinon/ui-color-picker": "1.1.8",
|
|
59
59
|
"@akinon/ui-dropdown": "1.1.8",
|
|
60
60
|
"@akinon/ui-input": "1.2.9",
|
|
61
61
|
"@akinon/ui-popover": "1.1.8",
|
|
62
|
-
"@akinon/ui-select": "1.4.
|
|
62
|
+
"@akinon/ui-select": "1.4.12-beta.0",
|
|
63
63
|
"@akinon/ui-theme": "1.3.0",
|
|
64
|
-
"@akinon/ui-upload": "1.5.0"
|
|
64
|
+
"@akinon/ui-upload": "1.5.2-beta.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"clean-package": "^2.2.0",
|