@verdant-web/tiptap 4.0.0 → 4.1.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.
- package/dist/esm/extensions/Verdant.d.ts +0 -1
- package/dist/esm/extensions/Verdant.js +1 -1
- package/dist/esm/extensions/Verdant.js.map +1 -1
- package/dist/esm/extensions/VerdantMedia.d.ts +11 -1
- package/dist/esm/extensions/VerdantMedia.js +193 -18
- package/dist/esm/extensions/VerdantMedia.js.map +1 -1
- package/dist/esm/extensions/attributes.d.ts +5 -0
- package/dist/esm/extensions/attributes.js +6 -0
- package/dist/esm/extensions/attributes.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server/index.d.ts +6 -0
- package/dist/esm/server/index.js +27 -0
- package/dist/esm/server/index.js.map +1 -0
- package/package.json +25 -13
- package/src/extensions/Verdant.ts +1 -1
- package/src/extensions/VerdantMedia.ts +206 -19
- package/src/extensions/attributes.ts +6 -0
- package/src/index.ts +1 -0
- package/src/server/index.ts +38 -0
- package/dist/esm/__browserTests__/react.test.d.ts +0 -1
- package/dist/esm/__browserTests__/react.test.js +0 -501
- package/dist/esm/__browserTests__/react.test.js.map +0 -1
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { EditorContent } from '@tiptap/react';
|
|
3
|
-
import { StarterKit } from '@tiptap/starter-kit';
|
|
4
|
-
import { createMigration, schema } from '@verdant-web/common';
|
|
5
|
-
import { createHooks } from '@verdant-web/react';
|
|
6
|
-
import { ClientDescriptor } from '@verdant-web/store';
|
|
7
|
-
import { userEvent } from '@vitest/browser/context';
|
|
8
|
-
import { Suspense } from 'react';
|
|
9
|
-
import { afterAll, beforeAll, expect, it } from 'vitest';
|
|
10
|
-
import { render } from 'vitest-browser-react';
|
|
11
|
-
import { createTipTapFieldSchema, createTipTapFileMapSchema, } from '../fields.js';
|
|
12
|
-
import { useSyncedEditor } from '../react.js';
|
|
13
|
-
const testSchema = schema({
|
|
14
|
-
version: 1,
|
|
15
|
-
collections: {
|
|
16
|
-
posts: schema.collection({
|
|
17
|
-
name: 'post',
|
|
18
|
-
primaryKey: 'id',
|
|
19
|
-
fields: {
|
|
20
|
-
id: schema.fields.id(),
|
|
21
|
-
nullableBody: createTipTapFieldSchema({ default: null }),
|
|
22
|
-
requiredBody: createTipTapFieldSchema({
|
|
23
|
-
default: {
|
|
24
|
-
type: 'doc',
|
|
25
|
-
content: [],
|
|
26
|
-
},
|
|
27
|
-
}),
|
|
28
|
-
files: createTipTapFileMapSchema(),
|
|
29
|
-
},
|
|
30
|
-
}),
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
const hooks = createHooks(testSchema);
|
|
34
|
-
function safeLogger(level, ...args) {
|
|
35
|
-
try {
|
|
36
|
-
if (args.some((arg) => typeof arg === 'string' && arg.includes('Redo')))
|
|
37
|
-
console.debug(...args.map((arg) => typeof arg === 'object' ? JSON.stringify(arg, undefined, ' ') : arg));
|
|
38
|
-
}
|
|
39
|
-
catch (err) {
|
|
40
|
-
console.debug(...args);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
let clientDesc;
|
|
44
|
-
let client;
|
|
45
|
-
beforeAll(async () => {
|
|
46
|
-
clientDesc = new ClientDescriptor({
|
|
47
|
-
schema: testSchema,
|
|
48
|
-
oldSchemas: [testSchema],
|
|
49
|
-
migrations: [createMigration(testSchema)],
|
|
50
|
-
namespace: 'tiptatp-test',
|
|
51
|
-
// log: safeLogger,
|
|
52
|
-
});
|
|
53
|
-
client = await clientDesc.open();
|
|
54
|
-
});
|
|
55
|
-
afterAll(() => client.close());
|
|
56
|
-
function renderWithProvider(content) {
|
|
57
|
-
return render(content, {
|
|
58
|
-
wrapper: ({ children }) => (_jsx(Suspense, { children: _jsx(hooks.Provider, { value: clientDesc, children: _jsx(Suspense, { fallback: _jsx("div", { "data-testid": "suspense", children: "Loading..." }), children: children }) }) })),
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
it('should support non-nullable tiptap schema fields', async () => {
|
|
62
|
-
const testPost = await client.posts.put({});
|
|
63
|
-
const TipTapTest = () => {
|
|
64
|
-
const editor = useSyncedEditor(testPost, 'requiredBody', {
|
|
65
|
-
editorOptions: { extensions: [StarterKit] },
|
|
66
|
-
});
|
|
67
|
-
return (_jsxs("div", { children: [_jsx("div", { children: "Text editor:" }), _jsx(EditorContent, { style: {
|
|
68
|
-
width: 500,
|
|
69
|
-
height: 300,
|
|
70
|
-
}, editor: editor, id: "#editor", "data-testid": "editor" })] }));
|
|
71
|
-
};
|
|
72
|
-
const screen = await renderWithProvider(_jsx(TipTapTest, {}));
|
|
73
|
-
await expect.element(screen.getByTestId('editor')).toBeVisible();
|
|
74
|
-
const editor = screen.getByTestId('editor').getByRole('textbox');
|
|
75
|
-
await expect.element(editor).toHaveTextContent('');
|
|
76
|
-
// send keystrokes to the editor
|
|
77
|
-
await userEvent.type(editor, 'Hello, world!');
|
|
78
|
-
await expect.element(editor).toHaveTextContent('Hello, world!');
|
|
79
|
-
expect(testPost.get('requiredBody').getSnapshot()).toEqual({
|
|
80
|
-
type: 'doc',
|
|
81
|
-
attrs: {},
|
|
82
|
-
from: null,
|
|
83
|
-
to: null,
|
|
84
|
-
content: [
|
|
85
|
-
{
|
|
86
|
-
type: 'paragraph',
|
|
87
|
-
attrs: {},
|
|
88
|
-
content: [
|
|
89
|
-
{
|
|
90
|
-
type: 'text',
|
|
91
|
-
attrs: {},
|
|
92
|
-
content: null,
|
|
93
|
-
marks: null,
|
|
94
|
-
from: null,
|
|
95
|
-
to: null,
|
|
96
|
-
text: 'Hello, world!',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
marks: null,
|
|
100
|
-
from: null,
|
|
101
|
-
to: null,
|
|
102
|
-
text: null,
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
marks: null,
|
|
106
|
-
text: null,
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
it('should support nullable tiptap schema fields with a specified default doc', async () => {
|
|
110
|
-
const testPost = await client.posts.put({});
|
|
111
|
-
const TipTapTest = () => {
|
|
112
|
-
const editor = useSyncedEditor(testPost, 'nullableBody', {
|
|
113
|
-
editorOptions: { extensions: [StarterKit] },
|
|
114
|
-
nullDocumentDefault: {
|
|
115
|
-
type: 'doc',
|
|
116
|
-
content: [],
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
return (_jsxs("div", { children: [_jsx("div", { children: "Text editor:" }), _jsx(EditorContent, { style: {
|
|
120
|
-
width: 500,
|
|
121
|
-
height: 300,
|
|
122
|
-
}, editor: editor, id: "#editor", "data-testid": "editor" })] }));
|
|
123
|
-
};
|
|
124
|
-
const screen = await renderWithProvider(_jsx(TipTapTest, {}));
|
|
125
|
-
await expect.element(screen.getByTestId('editor')).toBeVisible();
|
|
126
|
-
const editor = screen.getByTestId('editor').getByRole('textbox');
|
|
127
|
-
await expect.element(editor).toHaveTextContent('');
|
|
128
|
-
// send keystrokes to the editor
|
|
129
|
-
await userEvent.type(editor, 'Hello, world!');
|
|
130
|
-
await expect.element(editor).toHaveTextContent('Hello, world!');
|
|
131
|
-
expect(testPost.get('nullableBody').getSnapshot()).toEqual({
|
|
132
|
-
type: 'doc',
|
|
133
|
-
attrs: {},
|
|
134
|
-
from: null,
|
|
135
|
-
to: null,
|
|
136
|
-
content: [
|
|
137
|
-
{
|
|
138
|
-
type: 'paragraph',
|
|
139
|
-
attrs: {},
|
|
140
|
-
content: [
|
|
141
|
-
{
|
|
142
|
-
type: 'text',
|
|
143
|
-
attrs: {},
|
|
144
|
-
content: null,
|
|
145
|
-
marks: null,
|
|
146
|
-
from: null,
|
|
147
|
-
to: null,
|
|
148
|
-
text: 'Hello, world!',
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
marks: null,
|
|
152
|
-
from: null,
|
|
153
|
-
to: null,
|
|
154
|
-
text: null,
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
marks: null,
|
|
158
|
-
text: null,
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
it('should support Verdant undo and redo', async () => {
|
|
162
|
-
const testPost = await client.posts.put({});
|
|
163
|
-
// reset history
|
|
164
|
-
await client.entities.flushAllBatches();
|
|
165
|
-
client.undoHistory.clear();
|
|
166
|
-
const TipTapTest = () => {
|
|
167
|
-
const editor = useSyncedEditor(testPost, 'requiredBody', {
|
|
168
|
-
editorOptions: {
|
|
169
|
-
extensions: [
|
|
170
|
-
StarterKit.configure({
|
|
171
|
-
// using Verdant history.
|
|
172
|
-
history: false,
|
|
173
|
-
}),
|
|
174
|
-
],
|
|
175
|
-
},
|
|
176
|
-
// NOTE: this config is not required in regular usage, I'm tweaking batching
|
|
177
|
-
// to be sure it captures the entire testing change in one batch for undo to
|
|
178
|
-
// make the test predictable.
|
|
179
|
-
extensionOptions: {
|
|
180
|
-
batchConfig: {
|
|
181
|
-
// capture up to 100 changes in the batch.
|
|
182
|
-
max: 100,
|
|
183
|
-
timeout: null,
|
|
184
|
-
batchName: 'tiptap',
|
|
185
|
-
undoable: true,
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
});
|
|
189
|
-
return (_jsxs("div", { children: [_jsx("div", { children: "Text editor:" }), _jsx(EditorContent, { style: {
|
|
190
|
-
width: 500,
|
|
191
|
-
height: 300,
|
|
192
|
-
}, editor: editor, id: "#editor", "data-testid": "editor" })] }));
|
|
193
|
-
};
|
|
194
|
-
const screen = await renderWithProvider(_jsx(TipTapTest, {}));
|
|
195
|
-
await expect.element(screen.getByTestId('editor')).toBeVisible();
|
|
196
|
-
const editor = screen.getByTestId('editor').getByRole('textbox');
|
|
197
|
-
await expect.element(editor).toHaveTextContent('');
|
|
198
|
-
// send keystrokes to the editor
|
|
199
|
-
await userEvent.type(editor, 'Hello, world!');
|
|
200
|
-
await expect.element(editor).toHaveTextContent('Hello, world!');
|
|
201
|
-
await client.entities.flushAllBatches();
|
|
202
|
-
expect(client.undoHistory.undoLength).toBe(1);
|
|
203
|
-
await client.undoHistory.undo();
|
|
204
|
-
expect(testPost.get('requiredBody').getSnapshot()).toEqual({
|
|
205
|
-
type: 'doc',
|
|
206
|
-
attrs: {},
|
|
207
|
-
from: null,
|
|
208
|
-
to: null,
|
|
209
|
-
content: [],
|
|
210
|
-
marks: null,
|
|
211
|
-
text: null,
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
it('should support TipTap undo and redo', async () => {
|
|
215
|
-
const testPost = await client.posts.put({});
|
|
216
|
-
// reset history
|
|
217
|
-
await client.entities.flushAllBatches();
|
|
218
|
-
client.undoHistory.clear();
|
|
219
|
-
const TipTapTest = () => {
|
|
220
|
-
const editor = useSyncedEditor(testPost, 'requiredBody', {
|
|
221
|
-
editorOptions: {
|
|
222
|
-
extensions: [StarterKit],
|
|
223
|
-
},
|
|
224
|
-
extensionOptions: {
|
|
225
|
-
batchConfig: {
|
|
226
|
-
undoable: false,
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
return (_jsxs("div", { children: [_jsx("div", { children: "Text editor:" }), _jsx(EditorContent, { style: {
|
|
231
|
-
width: 500,
|
|
232
|
-
height: 300,
|
|
233
|
-
}, editor: editor, id: "#editor", "data-testid": "editor" }), _jsx("button", { "data-testid": "undo", onClick: () => editor.commands.undo(), children: "Undo" })] }));
|
|
234
|
-
};
|
|
235
|
-
const screen = await renderWithProvider(_jsx(TipTapTest, {}));
|
|
236
|
-
await expect.element(screen.getByTestId('editor')).toBeVisible();
|
|
237
|
-
const editor = screen.getByTestId('editor').getByRole('textbox');
|
|
238
|
-
await expect.element(editor).toHaveTextContent('');
|
|
239
|
-
// send keystrokes to the editor
|
|
240
|
-
await userEvent.type(editor, 'Hello, world!');
|
|
241
|
-
await expect.element(editor).toHaveTextContent('Hello, world!');
|
|
242
|
-
await client.entities.flushAllBatches();
|
|
243
|
-
// Verdant did not capture the change in undo history.
|
|
244
|
-
expect(client.undoHistory.undoLength).toBe(0);
|
|
245
|
-
await userEvent.click(screen.getByTestId('undo'));
|
|
246
|
-
await expect.element(editor).toHaveTextContent('');
|
|
247
|
-
// notably, TipTap history doesn't seem to remove the paragraph node,
|
|
248
|
-
// but to the user this behaves as expected.
|
|
249
|
-
expect(testPost.get('requiredBody').getSnapshot()).toEqual({
|
|
250
|
-
type: 'doc',
|
|
251
|
-
attrs: {},
|
|
252
|
-
from: null,
|
|
253
|
-
to: null,
|
|
254
|
-
content: [
|
|
255
|
-
{
|
|
256
|
-
attrs: {},
|
|
257
|
-
content: null,
|
|
258
|
-
from: null,
|
|
259
|
-
marks: null,
|
|
260
|
-
text: null,
|
|
261
|
-
to: null,
|
|
262
|
-
type: 'paragraph',
|
|
263
|
-
},
|
|
264
|
-
],
|
|
265
|
-
marks: null,
|
|
266
|
-
text: null,
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
it('should initialize from an existing document', async () => {
|
|
270
|
-
const testPost = await client.posts.put({
|
|
271
|
-
requiredBody: {
|
|
272
|
-
type: 'doc',
|
|
273
|
-
content: [
|
|
274
|
-
{
|
|
275
|
-
type: 'paragraph',
|
|
276
|
-
content: [
|
|
277
|
-
{
|
|
278
|
-
type: 'text',
|
|
279
|
-
text: 'Hello, world!',
|
|
280
|
-
},
|
|
281
|
-
],
|
|
282
|
-
},
|
|
283
|
-
],
|
|
284
|
-
},
|
|
285
|
-
});
|
|
286
|
-
// reset history
|
|
287
|
-
await client.entities.flushAllBatches();
|
|
288
|
-
client.undoHistory.clear();
|
|
289
|
-
const TipTapTest = () => {
|
|
290
|
-
const editor = useSyncedEditor(testPost, 'requiredBody', {
|
|
291
|
-
editorOptions: {
|
|
292
|
-
extensions: [StarterKit.configure({ history: false })],
|
|
293
|
-
},
|
|
294
|
-
});
|
|
295
|
-
return (_jsxs("div", { children: [_jsx("div", { children: "Text editor:" }), _jsx(EditorContent, { style: {
|
|
296
|
-
width: 500,
|
|
297
|
-
height: 300,
|
|
298
|
-
}, editor: editor, id: "#editor", "data-testid": "editor" })] }));
|
|
299
|
-
};
|
|
300
|
-
const screen = await renderWithProvider(_jsx(TipTapTest, {}));
|
|
301
|
-
await expect.element(screen.getByTestId('editor')).toBeVisible();
|
|
302
|
-
const editor = screen.getByTestId('editor').getByRole('textbox');
|
|
303
|
-
await expect.element(editor).toHaveTextContent('Hello, world!');
|
|
304
|
-
});
|
|
305
|
-
function testLog(...args) {
|
|
306
|
-
console.debug('[TEST]', ...args);
|
|
307
|
-
}
|
|
308
|
-
it('should withstand multiple edits, undo, and redo consistently', async () => {
|
|
309
|
-
const testPost = await client.posts.put({
|
|
310
|
-
requiredBody: {
|
|
311
|
-
type: 'doc',
|
|
312
|
-
content: [
|
|
313
|
-
{
|
|
314
|
-
type: 'paragraph',
|
|
315
|
-
content: [
|
|
316
|
-
{
|
|
317
|
-
type: 'text',
|
|
318
|
-
text: 'Hello, world!',
|
|
319
|
-
},
|
|
320
|
-
],
|
|
321
|
-
},
|
|
322
|
-
],
|
|
323
|
-
},
|
|
324
|
-
});
|
|
325
|
-
// reset history
|
|
326
|
-
await client.entities.flushAllBatches();
|
|
327
|
-
client.undoHistory.clear();
|
|
328
|
-
const TipTapTest = () => {
|
|
329
|
-
const editor = useSyncedEditor(testPost, 'requiredBody', {
|
|
330
|
-
editorOptions: {
|
|
331
|
-
extensions: [StarterKit.configure({ history: false })],
|
|
332
|
-
},
|
|
333
|
-
});
|
|
334
|
-
return (_jsxs("div", { children: [_jsx("div", { children: "Text editor:" }), _jsx(EditorContent, { style: {
|
|
335
|
-
width: 500,
|
|
336
|
-
height: 300,
|
|
337
|
-
}, editor: editor, id: "#editor", "data-testid": "editor" })] }));
|
|
338
|
-
};
|
|
339
|
-
const screen = await renderWithProvider(_jsx(TipTapTest, {}));
|
|
340
|
-
await expect.element(screen.getByTestId('editor')).toBeVisible();
|
|
341
|
-
const editor = screen.getByTestId('editor').getByRole('textbox');
|
|
342
|
-
await expect.element(editor).toHaveTextContent('Hello, world!');
|
|
343
|
-
await userEvent.type(editor, '[pageDown]');
|
|
344
|
-
await userEvent.type(editor, '\nLine 2!');
|
|
345
|
-
await client.entities.flushAllBatches();
|
|
346
|
-
await userEvent.type(editor, '\nLine 3!');
|
|
347
|
-
await client.entities.flushAllBatches();
|
|
348
|
-
expect(client.undoHistory.canUndo).toBe(true);
|
|
349
|
-
await client.undoHistory.undo();
|
|
350
|
-
await client.entities.flushAllBatches();
|
|
351
|
-
await expect.element(editor).toHaveTextContent(/^Hello, world!Line 2!$/);
|
|
352
|
-
await client.undoHistory.redo();
|
|
353
|
-
await client.entities.flushAllBatches();
|
|
354
|
-
await expect
|
|
355
|
-
.element(editor)
|
|
356
|
-
.toHaveTextContent(/^Hello, world!Line 2!Line 3!$/);
|
|
357
|
-
await client.undoHistory.undo();
|
|
358
|
-
await client.entities.flushAllBatches();
|
|
359
|
-
await expect.element(editor).toHaveTextContent(/^Hello, world!Line 2!$/);
|
|
360
|
-
// I've noticed some strangeness when restoring a deleted block
|
|
361
|
-
// when the editor is not on the same line as the deletion,
|
|
362
|
-
// not sure if this is actually related to cursor position but
|
|
363
|
-
// testing anyway.
|
|
364
|
-
await userEvent.type(editor, '[arrowUp]');
|
|
365
|
-
await client.undoHistory.redo();
|
|
366
|
-
await client.entities.flushAllBatches();
|
|
367
|
-
await expect
|
|
368
|
-
.element(editor)
|
|
369
|
-
.toHaveTextContent(/^Hello, world!Line 2!Line 3!$/);
|
|
370
|
-
});
|
|
371
|
-
it('should support media nodes', async () => {
|
|
372
|
-
const testPost = await client.posts.put({});
|
|
373
|
-
// reset history
|
|
374
|
-
await client.entities.flushAllBatches();
|
|
375
|
-
client.undoHistory.clear();
|
|
376
|
-
const user = userEvent.setup();
|
|
377
|
-
const TipTapTest = () => {
|
|
378
|
-
const editor = useSyncedEditor(testPost, 'requiredBody', {
|
|
379
|
-
editorOptions: {
|
|
380
|
-
extensions: [StarterKit.configure({ history: false })],
|
|
381
|
-
},
|
|
382
|
-
files: testPost.get('files'),
|
|
383
|
-
});
|
|
384
|
-
const insertMedia = async (ev) => {
|
|
385
|
-
var _a;
|
|
386
|
-
const file = (_a = ev.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
387
|
-
if (!file)
|
|
388
|
-
return;
|
|
389
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().insertMedia(file).run();
|
|
390
|
-
};
|
|
391
|
-
return (_jsxs("div", { children: [_jsx("input", { type: "file", onChange: insertMedia, "data-testid": "insert-media" }), _jsx("div", { children: "Text editor:" }), _jsx(EditorContent, { style: {
|
|
392
|
-
width: 500,
|
|
393
|
-
height: 300,
|
|
394
|
-
}, editor: editor, id: "#editor", "data-testid": "editor" })] }));
|
|
395
|
-
};
|
|
396
|
-
// load the image fixture to a file
|
|
397
|
-
const imageRes = await fetch('/cat.jpg', { method: 'GET' });
|
|
398
|
-
const imageBlob = await imageRes.blob();
|
|
399
|
-
const screen = await renderWithProvider(_jsx(TipTapTest, {}));
|
|
400
|
-
await expect.element(screen.getByTestId('editor')).toBeVisible();
|
|
401
|
-
const editor = screen.getByTestId('editor').getByRole('textbox');
|
|
402
|
-
await expect.element(editor).toHaveTextContent('');
|
|
403
|
-
// send keystrokes to the editor
|
|
404
|
-
await user.type(editor, 'Hello, world!');
|
|
405
|
-
await expect.element(editor).toHaveTextContent('Hello, world!');
|
|
406
|
-
// simulate paste of an image
|
|
407
|
-
// load the image into the clipboard
|
|
408
|
-
await user.upload(screen.getByTestId('insert-media'), new File([imageBlob], 'cat.jpg', { type: 'image/jpeg' }));
|
|
409
|
-
// the image should be visible in the editor
|
|
410
|
-
await expect.element(screen.getByRole('img')).toBeVisible();
|
|
411
|
-
const audioRes = await fetch('/cat.m4a', { method: 'GET' });
|
|
412
|
-
const audioBlob = await audioRes.blob();
|
|
413
|
-
await user.upload(screen.getByTestId('insert-media'), new File([audioBlob], 'cat.m4a', { type: 'audio/m4a' }));
|
|
414
|
-
// the audio should be visible in the editor
|
|
415
|
-
const audio = screen.container.querySelector('audio');
|
|
416
|
-
expect(audio).not.toBe(null);
|
|
417
|
-
await expect.element(audio).toBeVisible();
|
|
418
|
-
const videoRes = await fetch('/cat.mp4', { method: 'GET' });
|
|
419
|
-
const videoBlob = await videoRes.blob();
|
|
420
|
-
await user.upload(screen.getByTestId('insert-media'), new File([videoBlob], 'cat.mp4', { type: 'video/mp4' }));
|
|
421
|
-
// the video should be visible in the editor
|
|
422
|
-
const video = screen.container.querySelector('video');
|
|
423
|
-
expect(video).not.toBe(null);
|
|
424
|
-
await expect.element(video).toBeVisible();
|
|
425
|
-
const files = testPost.get('files');
|
|
426
|
-
expect(files.values().length).toBe(3);
|
|
427
|
-
// delete all media nodes; the files should also be removed from Verdant.
|
|
428
|
-
await user.keyboard('{Delete}{Delete}{Delete}');
|
|
429
|
-
await expect
|
|
430
|
-
.element(screen.getByTestId('editor'))
|
|
431
|
-
.toHaveTextContent('Hello, world!');
|
|
432
|
-
expect(files.values().length).toBe(0);
|
|
433
|
-
});
|
|
434
|
-
it('can re-render with a different backing entity', async () => {
|
|
435
|
-
const testPost = await client.posts.put({
|
|
436
|
-
requiredBody: {
|
|
437
|
-
type: 'doc',
|
|
438
|
-
content: [
|
|
439
|
-
{
|
|
440
|
-
type: 'paragraph',
|
|
441
|
-
content: [
|
|
442
|
-
{
|
|
443
|
-
type: 'text',
|
|
444
|
-
text: 'Hello, world!',
|
|
445
|
-
},
|
|
446
|
-
],
|
|
447
|
-
},
|
|
448
|
-
],
|
|
449
|
-
},
|
|
450
|
-
});
|
|
451
|
-
const testPost2 = await client.posts.put({
|
|
452
|
-
requiredBody: {
|
|
453
|
-
type: 'doc',
|
|
454
|
-
content: [
|
|
455
|
-
{
|
|
456
|
-
type: 'paragraph',
|
|
457
|
-
content: [
|
|
458
|
-
{
|
|
459
|
-
type: 'text',
|
|
460
|
-
text: 'Goodbye, world!',
|
|
461
|
-
},
|
|
462
|
-
],
|
|
463
|
-
},
|
|
464
|
-
],
|
|
465
|
-
},
|
|
466
|
-
});
|
|
467
|
-
// reset history
|
|
468
|
-
await client.entities.flushAllBatches();
|
|
469
|
-
client.undoHistory.clear();
|
|
470
|
-
const user = userEvent.setup();
|
|
471
|
-
const TipTapTest = ({ post }) => {
|
|
472
|
-
const editor = useSyncedEditor(post, 'requiredBody', {
|
|
473
|
-
editorOptions: {
|
|
474
|
-
extensions: [StarterKit.configure({ history: false })],
|
|
475
|
-
},
|
|
476
|
-
files: post.get('files'),
|
|
477
|
-
});
|
|
478
|
-
const insertMedia = async (ev) => {
|
|
479
|
-
var _a;
|
|
480
|
-
const file = (_a = ev.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
481
|
-
if (!file)
|
|
482
|
-
return;
|
|
483
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().insertMedia(file).run();
|
|
484
|
-
};
|
|
485
|
-
return (_jsxs("div", { children: [_jsx("input", { type: "file", onChange: insertMedia, "data-testid": "insert-media" }), _jsx("div", { children: "Text editor:" }), _jsx(EditorContent, { style: {
|
|
486
|
-
width: 500,
|
|
487
|
-
height: 300,
|
|
488
|
-
}, editor: editor, id: "#editor", "data-testid": "editor" })] }));
|
|
489
|
-
};
|
|
490
|
-
const screen = await renderWithProvider(_jsx(TipTapTest, { post: testPost }));
|
|
491
|
-
await expect.element(screen.getByTestId('editor')).toBeVisible();
|
|
492
|
-
await expect
|
|
493
|
-
.element(screen.getByTestId('editor'))
|
|
494
|
-
.toHaveTextContent('Hello, world!');
|
|
495
|
-
screen.rerender(_jsx(TipTapTest, { post: testPost2 }));
|
|
496
|
-
await expect.element(screen.getByTestId('editor')).toBeVisible();
|
|
497
|
-
await expect
|
|
498
|
-
.element(screen.getByTestId('editor'))
|
|
499
|
-
.toHaveTextContent('Goodbye, world!');
|
|
500
|
-
});
|
|
501
|
-
//# sourceMappingURL=react.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.test.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