@use-kona/editor 0.1.21 → 0.1.22
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/plugins/DnDPlugin/DnDPlugin.js +35 -26
- package/dist/plugins/ListsPlugin/ListsPlugin.js +15 -39
- package/dist/plugins/ListsPlugin/styles_module.css +1 -0
- package/dist/plugins/TableOfContentsPlugin/TableOfContentsPlugin.js +2 -2
- package/dist/{plugins → src/plugins}/CodeBlockPlugin/CodeBlockPlugin.d.ts +1 -2
- package/dist/{plugins → src/plugins}/HeadingsPlugin/HeadingsPlugin.d.ts +1 -1
- package/dist/{plugins → src/plugins}/LinksPlugin/LinksPlugin.d.ts +1 -1
- package/dist/{plugins → src/plugins}/ListsPlugin/ListsPlugin.d.ts +1 -3
- package/dist/src/plugins/MenuPlugin/MenuPlugin.d.ts +7 -0
- package/dist/src/types.d.ts +60 -0
- package/dist/types.d.ts +5 -58
- package/dist/utils.js +1 -1
- package/package.json +11 -11
- package/src/plugins/DnDPlugin/DnDPlugin.tsx +45 -35
- package/src/plugins/ListsPlugin/ListsPlugin.spec.tsx +166 -6
- package/src/plugins/ListsPlugin/ListsPlugin.tsx +27 -63
- package/src/plugins/ListsPlugin/styles.module.css +1 -0
- package/src/plugins/TableOfContentsPlugin/TableOfContentsPlugin.tsx +2 -2
- package/src/utils.ts +4 -2
- package/LICENSE +0 -21
- package/dist/plugins/CommandsPlugin/resolveCommands.spec.d.ts +0 -1
- package/dist/plugins/CommandsPlugin/resolveCommands.spec.js +0 -323
- package/dist/plugins/ListsPlugin/ListsPlugin.spec.d.ts +0 -3
- package/dist/plugins/ListsPlugin/ListsPlugin.spec.js +0 -47
- package/dist/plugins/MenuPlugin/MenuPlugin.d.ts +0 -7
- /package/dist/{constants.d.ts → src/constants.d.ts} +0 -0
- /package/dist/{core → src/core}/createEditable.d.ts +0 -0
- /package/dist/{core → src/core}/createEditor.d.ts +0 -0
- /package/dist/{core → src/core}/deserialize.d.ts +0 -0
- /package/dist/{core → src/core}/queries.d.ts +0 -0
- /package/dist/{core → src/core}/serialize.d.ts +0 -0
- /package/dist/{defaultValue.d.ts → src/defaultValue.d.ts} +0 -0
- /package/dist/{editor.d.ts → src/editor.d.ts} +0 -0
- /package/dist/{elements → src/elements}/BaseElement.d.ts +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{plugins → src/plugins}/AttachmentsPlugin/AttachmentsPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/AttachmentsPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/AttachmentsPlugin/types.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/BasicFormattingPlugin/BasicFormattingPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/BasicFormattingPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/BreaksPlugin/BreaksPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/BreaksPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CodeBlockPlugin/CodeBlock.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CodeBlockPlugin/CodeBlockLine.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CodeBlockPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CodeBlockPlugin/types.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CodeBlockPlugin/utils.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CommandsPlugin/CommandsPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CommandsPlugin/Menu.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CommandsPlugin/actions.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CommandsPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CommandsPlugin/resolveCommands.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CommandsPlugin/types.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/CommandsPlugin/useResolvedCommands.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/DnDPlugin/DnDPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/DnDPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/EmojiPlugin/EmojiPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/EmojiPlugin/Menu.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/EmojiPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/EmojiPlugin/types.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/FloatingMenuPlugin/FloatingMenu.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/FloatingMenuPlugin/FloatingMenuPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/FloatingMenuPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/FloatingMenuPlugin/types.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/HeadingsPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/HighlightsPlugin/HighlightsPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/HighlightsPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/LinksPlugin/Link.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/LinksPlugin/constants.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/LinksPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/LinksPlugin/types.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/ListsPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/MenuPlugin/Menu.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/MenuPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/MenuPlugin/types.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/NodeIdPlugin/NodeIdPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/NodeIdPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/PlaceholderPlugin/PlaceholderPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/PlaceholderPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/ShortcutsPlugin/ShortcutsPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/ShortcutsPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/TableOfContentsPlugin/TableOfContentsPlugin.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/TableOfContentsPlugin/index.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/index.d.ts +0 -0
- /package/dist/{queries → src/queries}/getMatchedGroups.d.ts +0 -0
- /package/dist/{utils.d.ts → src/utils.d.ts} +0 -0
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { CommandsResolver } from "./resolveCommands.js";
|
|
3
|
-
const editor = {};
|
|
4
|
-
const leaf = (params)=>({
|
|
5
|
-
name: params.name,
|
|
6
|
-
title: params.title,
|
|
7
|
-
commandName: params.commandName ?? params.title.toLocaleLowerCase(),
|
|
8
|
-
icon: null,
|
|
9
|
-
action: ()=>{}
|
|
10
|
-
});
|
|
11
|
-
const deferred = ()=>{
|
|
12
|
-
let resolve = ()=>{};
|
|
13
|
-
let reject = ()=>{};
|
|
14
|
-
const promise = new Promise((res, rej)=>{
|
|
15
|
-
resolve = res;
|
|
16
|
-
reject = rej;
|
|
17
|
-
});
|
|
18
|
-
return {
|
|
19
|
-
promise,
|
|
20
|
-
resolve,
|
|
21
|
-
reject
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
describe('CommandsResolver', ()=>{
|
|
25
|
-
it('keeps leaf-only legacy behavior', async ()=>{
|
|
26
|
-
const resolver = new CommandsResolver();
|
|
27
|
-
const rootCommands = [
|
|
28
|
-
leaf({
|
|
29
|
-
name: 'paragraph',
|
|
30
|
-
title: 'Paragraph'
|
|
31
|
-
}),
|
|
32
|
-
leaf({
|
|
33
|
-
name: 'code',
|
|
34
|
-
title: 'Code'
|
|
35
|
-
})
|
|
36
|
-
];
|
|
37
|
-
const request = resolver.resolve({
|
|
38
|
-
rootCommands,
|
|
39
|
-
filter: '',
|
|
40
|
-
path: [],
|
|
41
|
-
editor
|
|
42
|
-
});
|
|
43
|
-
const result = await request.promise;
|
|
44
|
-
expect(result.commands.map((item)=>item.command.name)).toEqual([
|
|
45
|
-
'paragraph',
|
|
46
|
-
'code'
|
|
47
|
-
]);
|
|
48
|
-
});
|
|
49
|
-
it('resolves static submenu with sync getCommands', async ()=>{
|
|
50
|
-
const resolver = new CommandsResolver();
|
|
51
|
-
const rootCommands = [
|
|
52
|
-
{
|
|
53
|
-
name: 'insert',
|
|
54
|
-
title: 'Insert',
|
|
55
|
-
commandName: 'insert',
|
|
56
|
-
icon: null,
|
|
57
|
-
getCommands: ()=>[
|
|
58
|
-
leaf({
|
|
59
|
-
name: 'heading-1',
|
|
60
|
-
title: 'Heading 1'
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
];
|
|
65
|
-
const request = resolver.resolve({
|
|
66
|
-
rootCommands,
|
|
67
|
-
filter: '',
|
|
68
|
-
path: [
|
|
69
|
-
{
|
|
70
|
-
name: 'insert',
|
|
71
|
-
title: 'Insert',
|
|
72
|
-
commandName: 'insert'
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
editor
|
|
76
|
-
});
|
|
77
|
-
const result = await request.promise;
|
|
78
|
-
expect(result.commands).toHaveLength(1);
|
|
79
|
-
expect(result.commands[0]?.command.name).toBe('heading-1');
|
|
80
|
-
});
|
|
81
|
-
it('resolves async submenu', async ()=>{
|
|
82
|
-
const resolver = new CommandsResolver();
|
|
83
|
-
const rootCommands = [
|
|
84
|
-
{
|
|
85
|
-
name: 'remote',
|
|
86
|
-
title: 'Remote',
|
|
87
|
-
commandName: 'remote',
|
|
88
|
-
icon: null,
|
|
89
|
-
getCommands: async ()=>[
|
|
90
|
-
leaf({
|
|
91
|
-
name: 'code',
|
|
92
|
-
title: 'Code'
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
];
|
|
97
|
-
const request = resolver.resolve({
|
|
98
|
-
rootCommands,
|
|
99
|
-
filter: '',
|
|
100
|
-
path: [
|
|
101
|
-
{
|
|
102
|
-
name: 'remote',
|
|
103
|
-
title: 'Remote',
|
|
104
|
-
commandName: 'remote'
|
|
105
|
-
}
|
|
106
|
-
],
|
|
107
|
-
editor
|
|
108
|
-
});
|
|
109
|
-
const result = await request.promise;
|
|
110
|
-
expect(result.commands).toHaveLength(1);
|
|
111
|
-
expect(result.commands[0]?.command.name).toBe('code');
|
|
112
|
-
});
|
|
113
|
-
it('searches only root level when path is empty', async ()=>{
|
|
114
|
-
const resolver = new CommandsResolver();
|
|
115
|
-
const rootCommands = [
|
|
116
|
-
{
|
|
117
|
-
name: 'insert',
|
|
118
|
-
title: 'Insert',
|
|
119
|
-
commandName: 'insert',
|
|
120
|
-
icon: null,
|
|
121
|
-
getCommands: ()=>[
|
|
122
|
-
leaf({
|
|
123
|
-
name: 'code',
|
|
124
|
-
title: 'Code'
|
|
125
|
-
})
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
leaf({
|
|
129
|
-
name: 'paragraph',
|
|
130
|
-
title: 'Paragraph'
|
|
131
|
-
})
|
|
132
|
-
];
|
|
133
|
-
const request = resolver.resolve({
|
|
134
|
-
rootCommands,
|
|
135
|
-
filter: 'code',
|
|
136
|
-
path: [],
|
|
137
|
-
editor
|
|
138
|
-
});
|
|
139
|
-
const result = await request.promise;
|
|
140
|
-
expect(result.commands).toHaveLength(0);
|
|
141
|
-
});
|
|
142
|
-
it('searches only current nested level', async ()=>{
|
|
143
|
-
const resolver = new CommandsResolver();
|
|
144
|
-
const rootCommands = [
|
|
145
|
-
{
|
|
146
|
-
name: 'insert',
|
|
147
|
-
title: 'Insert',
|
|
148
|
-
commandName: 'insert',
|
|
149
|
-
icon: null,
|
|
150
|
-
getCommands: ()=>[
|
|
151
|
-
leaf({
|
|
152
|
-
name: 'code',
|
|
153
|
-
title: 'Code'
|
|
154
|
-
})
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
];
|
|
158
|
-
const request = resolver.resolve({
|
|
159
|
-
rootCommands,
|
|
160
|
-
filter: 'code',
|
|
161
|
-
path: [
|
|
162
|
-
{
|
|
163
|
-
name: 'insert',
|
|
164
|
-
title: 'Insert',
|
|
165
|
-
commandName: 'insert'
|
|
166
|
-
}
|
|
167
|
-
],
|
|
168
|
-
editor
|
|
169
|
-
});
|
|
170
|
-
const result = await request.promise;
|
|
171
|
-
expect(result.commands).toHaveLength(1);
|
|
172
|
-
expect(result.commands[0]?.command.name).toBe('code');
|
|
173
|
-
});
|
|
174
|
-
it('returns matching submenu commands in query mode', async ()=>{
|
|
175
|
-
const resolver = new CommandsResolver();
|
|
176
|
-
const rootCommands = [
|
|
177
|
-
{
|
|
178
|
-
name: 'advanced',
|
|
179
|
-
title: 'Advanced',
|
|
180
|
-
commandName: 'advanced',
|
|
181
|
-
icon: null,
|
|
182
|
-
getCommands: ()=>[
|
|
183
|
-
leaf({
|
|
184
|
-
name: 'code',
|
|
185
|
-
title: 'Code'
|
|
186
|
-
})
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
];
|
|
190
|
-
const request = resolver.resolve({
|
|
191
|
-
rootCommands,
|
|
192
|
-
filter: 'adv',
|
|
193
|
-
path: [],
|
|
194
|
-
editor
|
|
195
|
-
});
|
|
196
|
-
const result = await request.promise;
|
|
197
|
-
expect(result.commands).toHaveLength(1);
|
|
198
|
-
expect(result.commands[0]?.command.name).toBe('advanced');
|
|
199
|
-
expect(result.commands[0]?.isSubmenu).toBe(true);
|
|
200
|
-
});
|
|
201
|
-
it('ignores stale out-of-order async responses', async ()=>{
|
|
202
|
-
const resolver = new CommandsResolver();
|
|
203
|
-
const searchA = deferred();
|
|
204
|
-
const searchB = deferred();
|
|
205
|
-
const rootCommands = [
|
|
206
|
-
{
|
|
207
|
-
name: 'remote',
|
|
208
|
-
title: 'Remote',
|
|
209
|
-
commandName: 'remote',
|
|
210
|
-
icon: null,
|
|
211
|
-
getCommands: ({ query })=>{
|
|
212
|
-
if ('a' === query) return searchA.promise;
|
|
213
|
-
return searchB.promise;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
];
|
|
217
|
-
const firstRequest = resolver.resolve({
|
|
218
|
-
rootCommands,
|
|
219
|
-
filter: 'a',
|
|
220
|
-
path: [
|
|
221
|
-
{
|
|
222
|
-
name: 'remote',
|
|
223
|
-
title: 'Remote',
|
|
224
|
-
commandName: 'remote'
|
|
225
|
-
}
|
|
226
|
-
],
|
|
227
|
-
editor
|
|
228
|
-
});
|
|
229
|
-
const secondRequest = resolver.resolve({
|
|
230
|
-
rootCommands,
|
|
231
|
-
filter: 'b',
|
|
232
|
-
path: [
|
|
233
|
-
{
|
|
234
|
-
name: 'remote',
|
|
235
|
-
title: 'Remote',
|
|
236
|
-
commandName: 'remote'
|
|
237
|
-
}
|
|
238
|
-
],
|
|
239
|
-
editor
|
|
240
|
-
});
|
|
241
|
-
searchB.resolve([
|
|
242
|
-
leaf({
|
|
243
|
-
name: 'b',
|
|
244
|
-
title: 'Result B',
|
|
245
|
-
commandName: 'b'
|
|
246
|
-
})
|
|
247
|
-
]);
|
|
248
|
-
const secondResult = await secondRequest.promise;
|
|
249
|
-
expect(secondResult.commands.map((item)=>item.command.name)).toEqual([
|
|
250
|
-
'b'
|
|
251
|
-
]);
|
|
252
|
-
searchA.resolve([
|
|
253
|
-
leaf({
|
|
254
|
-
name: 'a',
|
|
255
|
-
title: 'Result A',
|
|
256
|
-
commandName: 'a'
|
|
257
|
-
})
|
|
258
|
-
]);
|
|
259
|
-
const firstResult = await firstRequest.promise;
|
|
260
|
-
expect(firstResult.commands.map((item)=>item.command.name)).toEqual([
|
|
261
|
-
'b'
|
|
262
|
-
]);
|
|
263
|
-
expect(resolver.getState().commands.map((item)=>item.command.name)).toEqual([
|
|
264
|
-
'b'
|
|
265
|
-
]);
|
|
266
|
-
});
|
|
267
|
-
it('clears visible commands while loading new results', async ()=>{
|
|
268
|
-
const resolver = new CommandsResolver();
|
|
269
|
-
const remoteDeferred = deferred();
|
|
270
|
-
const rootCommands = [
|
|
271
|
-
leaf({
|
|
272
|
-
name: 'paragraph',
|
|
273
|
-
title: 'Paragraph'
|
|
274
|
-
}),
|
|
275
|
-
{
|
|
276
|
-
name: 'remote',
|
|
277
|
-
title: 'Remote',
|
|
278
|
-
commandName: 'remote',
|
|
279
|
-
icon: null,
|
|
280
|
-
getCommands: ({ query })=>{
|
|
281
|
-
if (query) return remoteDeferred.promise;
|
|
282
|
-
return [
|
|
283
|
-
leaf({
|
|
284
|
-
name: 'code',
|
|
285
|
-
title: 'Code'
|
|
286
|
-
})
|
|
287
|
-
];
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
];
|
|
291
|
-
const initial = await resolver.resolve({
|
|
292
|
-
rootCommands,
|
|
293
|
-
filter: '',
|
|
294
|
-
path: [],
|
|
295
|
-
editor
|
|
296
|
-
}).promise;
|
|
297
|
-
const loadingRequest = resolver.resolve({
|
|
298
|
-
rootCommands,
|
|
299
|
-
filter: 'code',
|
|
300
|
-
path: [
|
|
301
|
-
{
|
|
302
|
-
name: 'remote',
|
|
303
|
-
title: 'Remote',
|
|
304
|
-
commandName: 'remote'
|
|
305
|
-
}
|
|
306
|
-
],
|
|
307
|
-
editor
|
|
308
|
-
});
|
|
309
|
-
expect(loadingRequest.state.isLoading).toBe(true);
|
|
310
|
-
expect(initial.commands.length).toBeGreaterThan(0);
|
|
311
|
-
expect(loadingRequest.state.commands).toEqual([]);
|
|
312
|
-
remoteDeferred.resolve([
|
|
313
|
-
leaf({
|
|
314
|
-
name: 'code',
|
|
315
|
-
title: 'Code'
|
|
316
|
-
})
|
|
317
|
-
]);
|
|
318
|
-
const settled = await loadingRequest.promise;
|
|
319
|
-
expect(settled.isLoading).toBe(false);
|
|
320
|
-
expect(settled.commands).toHaveLength(1);
|
|
321
|
-
expect(settled.commands[0]?.command.name).toBe('code');
|
|
322
|
-
});
|
|
323
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { createHyperscript, createText } from "slate-hyperscript";
|
|
2
|
-
import { describe, expect, it } from "vitest";
|
|
3
|
-
import { createEditor } from "../../core/createEditor.js";
|
|
4
|
-
import { ListsPlugin } from "./ListsPlugin.js";
|
|
5
|
-
const ListsPlugin_spec_elements = {
|
|
6
|
-
paragraph: {
|
|
7
|
-
type: 'paragraph'
|
|
8
|
-
},
|
|
9
|
-
numberedList: {
|
|
10
|
-
type: ListsPlugin.NUMBERED_LIST_ELEMENT
|
|
11
|
-
},
|
|
12
|
-
bulletedList: {
|
|
13
|
-
type: ListsPlugin.BULLETED_LIST_ELEMENT
|
|
14
|
-
},
|
|
15
|
-
listItem: {
|
|
16
|
-
type: ListsPlugin.LIST_ITEM_ELEMENT
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const jsx = createHyperscript({
|
|
20
|
-
elements: ListsPlugin_spec_elements,
|
|
21
|
-
creators: {
|
|
22
|
-
text: createText
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const createEditorWithPlugin = (children)=>{
|
|
26
|
-
const editorState = /*#__PURE__*/ jsx("editor", null, children);
|
|
27
|
-
const editor = createEditor([
|
|
28
|
-
new ListsPlugin()
|
|
29
|
-
])();
|
|
30
|
-
editor.children = editorState.children;
|
|
31
|
-
editor.selection = editorState.selection;
|
|
32
|
-
return editor;
|
|
33
|
-
};
|
|
34
|
-
describe('ListsPlugin', ()=>{
|
|
35
|
-
it('should change current block to bulleted list', ()=>{
|
|
36
|
-
const editor = createEditorWithPlugin(/*#__PURE__*/ jsx("paragraph", null, /*#__PURE__*/ jsx("cursor", null), /*#__PURE__*/ jsx("text", null, "Hello world")));
|
|
37
|
-
ListsPlugin.toggleList(editor, ListsPlugin.BULLETED_LIST_ELEMENT);
|
|
38
|
-
const output = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("bulletedList", null, /*#__PURE__*/ jsx("listItem", null, /*#__PURE__*/ jsx("text", null, "Hello world"))), /*#__PURE__*/ jsx("paragraph", null, /*#__PURE__*/ jsx("text", null)));
|
|
39
|
-
expect(editor.children).toEqual(output.children);
|
|
40
|
-
});
|
|
41
|
-
it('should change current block to numbered list', ()=>{
|
|
42
|
-
const editor = createEditorWithPlugin(/*#__PURE__*/ jsx("paragraph", null, /*#__PURE__*/ jsx("cursor", null), /*#__PURE__*/ jsx("text", null, "Hello world")));
|
|
43
|
-
ListsPlugin.toggleList(editor, ListsPlugin.NUMBERED_LIST_ELEMENT);
|
|
44
|
-
const output = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("numberedList", null, /*#__PURE__*/ jsx("listItem", null, /*#__PURE__*/ jsx("text", null, "Hello world"))), /*#__PURE__*/ jsx("paragraph", null, /*#__PURE__*/ jsx("text", null)));
|
|
45
|
-
expect(editor.children).toEqual(output.children);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { IPlugin, UiParams } from '../../types';
|
|
2
|
-
import type { Options } from './types';
|
|
3
|
-
export declare class MenuPlugin implements IPlugin {
|
|
4
|
-
private options;
|
|
5
|
-
constructor(options: Options);
|
|
6
|
-
ui: (params: UiParams) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|