ckeditor5-elements-menu 49.0.0-alpha.4 → 49.0.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/README.md +7 -7
- package/dist/augmentation.d.ts +7 -7
- package/dist/augmentation.d.ts.map +1 -1
- package/dist/breadcrumbs/{breadcrumbs.d.ts → elementBreadcrumbs.d.ts} +8 -7
- package/dist/breadcrumbs/elementBreadcrumbs.d.ts.map +1 -0
- package/dist/breadcrumbs/{breadcrumbs.js → elementBreadcrumbs.js} +8 -7
- package/dist/breadcrumbs/elementBreadcrumbs.js.map +1 -0
- package/dist/contextMenu/elementContextMenu.d.ts.map +1 -1
- package/dist/contextMenu/elementContextMenu.js +7 -17
- package/dist/contextMenu/elementContextMenu.js.map +1 -1
- package/dist/domTarget.d.ts +8 -0
- package/dist/domTarget.d.ts.map +1 -0
- package/dist/domTarget.js +20 -0
- package/dist/domTarget.js.map +1 -0
- package/dist/elementMenu.d.ts +2 -2
- package/dist/elementMenu.d.ts.map +1 -1
- package/dist/elementMenu.js +4 -26
- package/dist/elementMenu.js.map +1 -1
- package/dist/elementMenuView.d.ts +5 -0
- package/dist/elementMenuView.d.ts.map +1 -1
- package/dist/elementMenuView.js +31 -5
- package/dist/elementMenuView.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/quickInsert/{quickInsert.d.ts → elementQuickInsert.d.ts} +11 -11
- package/dist/quickInsert/elementQuickInsert.d.ts.map +1 -0
- package/dist/quickInsert/{quickInsert.js → elementQuickInsert.js} +19 -29
- package/dist/quickInsert/elementQuickInsert.js.map +1 -0
- package/dist/quickInsert/quickInsertCommand.d.ts +14 -5
- package/dist/quickInsert/quickInsertCommand.d.ts.map +1 -1
- package/dist/quickInsert/quickInsertCommand.js +28 -17
- package/dist/quickInsert/quickInsertCommand.js.map +1 -1
- package/dist/quickInsert/quickInsertPositionCommand.d.ts +7 -2
- package/dist/quickInsert/quickInsertPositionCommand.d.ts.map +1 -1
- package/dist/quickInsert/quickInsertPositionCommand.js +11 -13
- package/dist/quickInsert/quickInsertPositionCommand.js.map +1 -1
- package/package.json +5 -2
- package/src/augmentation.ts +10 -10
- package/src/breadcrumbs/{breadcrumbs.ts → elementBreadcrumbs.ts} +10 -9
- package/src/contextMenu/elementContextMenu.ts +8 -20
- package/src/domTarget.ts +27 -0
- package/src/elementMenu.ts +11 -36
- package/src/elementMenuView.ts +53 -14
- package/src/index.ts +2 -2
- package/src/quickInsert/{quickInsert.ts → elementQuickInsert.ts} +24 -38
- package/src/quickInsert/quickInsertCommand.ts +36 -25
- package/src/quickInsert/quickInsertPositionCommand.ts +13 -17
- package/dist/breadcrumbs/breadcrumbs.d.ts.map +0 -1
- package/dist/breadcrumbs/breadcrumbs.js.map +0 -1
- package/dist/quickInsert/quickInsert.d.ts.map +0 -1
- package/dist/quickInsert/quickInsert.js.map +0 -1
package/src/elementMenu.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type ModelElement,
|
|
11
11
|
type RectSource
|
|
12
12
|
} from 'ckeditor5';
|
|
13
|
-
import {
|
|
13
|
+
import { isInDocument, type ElementOrPositionCommand } from 'ckeditor5-elements-core';
|
|
14
14
|
import ElementMenuView from './elementMenuView.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -39,7 +39,7 @@ export interface ElementSubmenu {
|
|
|
39
39
|
export type ElementMenuItem = ElementOrPositionCommand | ElementSubmenu | '|';
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Returns the items of the menu of the given element, e.g. as the `elementContextMenu` or `
|
|
42
|
+
* Returns the items of the menu of the given element, e.g. as the `elementContextMenu` or `elementBreadcrumbs.menu` editor
|
|
43
43
|
* config option. Missing items (e.g. commands that are not registered) are skipped. No items means no menu.
|
|
44
44
|
*/
|
|
45
45
|
export type ElementMenuConfig = (element: ModelElement, editor: Editor) => (ElementMenuItem | null | undefined)[];
|
|
@@ -119,14 +119,19 @@ export default class ElementMenu extends Plugin {
|
|
|
119
119
|
config: ElementMenuConfig,
|
|
120
120
|
{ label = this.editor.t('Element menu'), isObsolete, ...options }: ElementMenuShowOptions = {}
|
|
121
121
|
): boolean {
|
|
122
|
-
const
|
|
122
|
+
const view = new ElementMenuView(
|
|
123
|
+
this.editor.locale,
|
|
124
|
+
this.editor.ui.view.body,
|
|
125
|
+
config(element, this.editor),
|
|
126
|
+
element
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
if (view.isEmpty) {
|
|
130
|
+
view.destroy();
|
|
123
131
|
|
|
124
|
-
if (!items.length) {
|
|
125
132
|
return false;
|
|
126
133
|
}
|
|
127
134
|
|
|
128
|
-
const view = new ElementMenuView(this.editor.locale, this.editor.ui.view.body, items, element);
|
|
129
|
-
|
|
130
135
|
view.ariaLabel = label;
|
|
131
136
|
|
|
132
137
|
this.show(view, target, {
|
|
@@ -234,36 +239,6 @@ export default class ElementMenu extends Plugin {
|
|
|
234
239
|
}
|
|
235
240
|
}
|
|
236
241
|
|
|
237
|
-
/**
|
|
238
|
-
* Returns the items without missing ones, submenus without items, and separators at the start or the end, or
|
|
239
|
-
* repeated ones.
|
|
240
|
-
*/
|
|
241
|
-
function cleanItems(items: readonly (ElementMenuItem | null | undefined)[]): ElementMenuItem[] {
|
|
242
|
-
const result: ElementMenuItem[] = [];
|
|
243
|
-
|
|
244
|
-
for (const item of items) {
|
|
245
|
-
const cleaned = item === '|' || item instanceof ElementOrPositionCommand || !item ? item : cleanSubmenu(item);
|
|
246
|
-
|
|
247
|
-
if (!cleaned || (cleaned === '|' && (!result.length || result.at(-1) === '|'))) {
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
result.push(cleaned);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (result.at(-1) === '|') {
|
|
255
|
-
result.pop();
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return result;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
function cleanSubmenu(submenu: ElementSubmenu): ElementSubmenu | null {
|
|
262
|
-
const items = cleanItems(submenu.items);
|
|
263
|
-
|
|
264
|
-
return items.length ? { ...submenu, items } : null;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
242
|
/**
|
|
268
243
|
* Returns the panels of the open nested menus of CKEditor's dropdown menu.
|
|
269
244
|
*/
|
package/src/elementMenuView.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { type ElementMenuItem, type ElementSubmenu } from './elementMenu.js';
|
|
|
18
18
|
* reflect the command title, icon and {@link ElementOrPositionCommand#getState state} for the target, and execute the
|
|
19
19
|
* command for it. It also adds the separators, which CKEditor's menu definitions do not have.
|
|
20
20
|
*
|
|
21
|
+
* Missing items are skipped, and submenus without items, and separators at the start or the end, or repeated ones.
|
|
21
22
|
* Submenus are enabled when one of their items is. Right-clicking the menu does not open the native context menu.
|
|
22
23
|
*/
|
|
23
24
|
export default class ElementMenuView extends DropdownMenuRootListView {
|
|
@@ -26,8 +27,13 @@ export default class ElementMenuView extends DropdownMenuRootListView {
|
|
|
26
27
|
*/
|
|
27
28
|
public readonly target: ElementOrPosition;
|
|
28
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Whether the menu has no items: all were missing.
|
|
32
|
+
*/
|
|
33
|
+
public readonly isEmpty: boolean;
|
|
34
|
+
|
|
29
35
|
private readonly _commands: Map<string, ElementOrPositionCommand>;
|
|
30
|
-
private readonly _submenus: Map<string,
|
|
36
|
+
private readonly _submenus: Map<string, MenuSubmenu>;
|
|
31
37
|
|
|
32
38
|
/**
|
|
33
39
|
* The positions of the separators in each list, by the id of the submenu (`''` for the menu itself).
|
|
@@ -41,10 +47,12 @@ export default class ElementMenuView extends DropdownMenuRootListView {
|
|
|
41
47
|
target: ElementOrPosition
|
|
42
48
|
) {
|
|
43
49
|
const maps: DefinitionMaps = { commands: new Map(), submenus: new Map(), separators: new Map() };
|
|
50
|
+
const menuItems = cleanItems(items);
|
|
44
51
|
|
|
45
|
-
super(locale, bodyCollection, createDefinitions(
|
|
52
|
+
super(locale, bodyCollection, createDefinitions(menuItems, '', maps));
|
|
46
53
|
|
|
47
54
|
this.target = target;
|
|
55
|
+
this.isEmpty = !menuItems.length;
|
|
48
56
|
this._commands = maps.commands;
|
|
49
57
|
this._submenus = maps.submenus;
|
|
50
58
|
this._separators = maps.separators;
|
|
@@ -106,42 +114,73 @@ export default class ElementMenuView extends DropdownMenuRootListView {
|
|
|
106
114
|
}
|
|
107
115
|
}
|
|
108
116
|
|
|
109
|
-
private _isEnabled(item:
|
|
117
|
+
private _isEnabled(item: MenuItem): boolean {
|
|
110
118
|
if (item === '|') {
|
|
111
119
|
return false;
|
|
112
120
|
}
|
|
113
121
|
|
|
114
122
|
return item instanceof ElementOrPositionCommand
|
|
115
123
|
? item.getState(this.target).isEnabled
|
|
116
|
-
: item.items.some(child =>
|
|
124
|
+
: item.items.some(child => this._isEnabled(child));
|
|
117
125
|
}
|
|
118
126
|
}
|
|
119
127
|
|
|
128
|
+
/**
|
|
129
|
+
* An item of the menu, as it is shown: none is missing.
|
|
130
|
+
*/
|
|
131
|
+
type MenuItem = ElementOrPositionCommand | MenuSubmenu | '|';
|
|
132
|
+
|
|
133
|
+
interface MenuSubmenu extends Omit<ElementSubmenu, 'items'> {
|
|
134
|
+
items: MenuItem[];
|
|
135
|
+
}
|
|
136
|
+
|
|
120
137
|
interface DefinitionMaps {
|
|
121
138
|
commands: Map<string, ElementOrPositionCommand>;
|
|
122
|
-
submenus: Map<string,
|
|
139
|
+
submenus: Map<string, MenuSubmenu>;
|
|
123
140
|
separators: Map<string, number[]>;
|
|
124
141
|
}
|
|
125
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Returns the items without missing ones, submenus without items, and separators at the start or the end, or
|
|
145
|
+
* repeated ones.
|
|
146
|
+
*/
|
|
147
|
+
function cleanItems(items: readonly (ElementMenuItem | null | undefined)[]): MenuItem[] {
|
|
148
|
+
const result: MenuItem[] = [];
|
|
149
|
+
|
|
150
|
+
for (const item of items) {
|
|
151
|
+
const cleaned = item === '|' || item instanceof ElementOrPositionCommand || !item ? item : cleanSubmenu(item);
|
|
152
|
+
|
|
153
|
+
if (!cleaned || (cleaned === '|' && (!result.length || result.at(-1) === '|'))) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
result.push(cleaned);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (result.at(-1) === '|') {
|
|
161
|
+
result.pop();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function cleanSubmenu(submenu: ElementSubmenu): MenuSubmenu | null {
|
|
168
|
+
const items = cleanItems(submenu.items);
|
|
169
|
+
|
|
170
|
+
return items.length ? { ...submenu, items } : null;
|
|
171
|
+
}
|
|
172
|
+
|
|
126
173
|
/**
|
|
127
174
|
* Creates CKEditor's menu definitions for the items. The ids are paths of positions (e.g. `'2.0'`). Collects the
|
|
128
175
|
* commands and submenus by id, and the positions of the separators by the id of their submenu.
|
|
129
176
|
*/
|
|
130
|
-
function createDefinitions(
|
|
131
|
-
items: readonly (ElementMenuItem | null | undefined)[],
|
|
132
|
-
parentId: string,
|
|
133
|
-
maps: DefinitionMaps
|
|
134
|
-
): DropdownMenuDefinition {
|
|
177
|
+
function createDefinitions(items: readonly MenuItem[], parentId: string, maps: DefinitionMaps): DropdownMenuDefinition {
|
|
135
178
|
const definitions: DropdownMenuDefinition = [];
|
|
136
179
|
let position = 0;
|
|
137
180
|
|
|
138
181
|
for (const item of items) {
|
|
139
182
|
const id = parentId ? `${parentId}.${String(position)}` : String(position);
|
|
140
183
|
|
|
141
|
-
if (!item) {
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
184
|
if (item === '|') {
|
|
146
185
|
maps.separators.set(parentId, [...(maps.separators.get(parentId) ?? []), position]);
|
|
147
186
|
} else if (item instanceof ElementOrPositionCommand) {
|
package/src/index.ts
CHANGED
|
@@ -16,8 +16,8 @@ export {
|
|
|
16
16
|
type ElementSubmenu
|
|
17
17
|
} from './elementMenu.js';
|
|
18
18
|
export { default as ElementContextMenu } from './contextMenu/elementContextMenu.js';
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
19
|
+
export { default as ElementBreadcrumbs, type ElementBreadcrumbsConfig } from './breadcrumbs/elementBreadcrumbs.js';
|
|
20
|
+
export { default as ElementQuickInsert, type ElementQuickInsertConfig } from './quickInsert/elementQuickInsert.js';
|
|
21
21
|
|
|
22
22
|
// Commands.
|
|
23
23
|
export { default as QuickInsertCommand } from './quickInsert/quickInsertCommand.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Plugin, type Editor, type FilteredViewExecuteEvent, type
|
|
1
|
+
import { Plugin, type Editor, type FilteredViewExecuteEvent, type RectSource } from 'ckeditor5';
|
|
2
2
|
import type { ElementOrPosition } from 'ckeditor5-elements-core';
|
|
3
|
+
import { getDomTarget } from '../domTarget.js';
|
|
3
4
|
import ElementMenu from '../elementMenu.js';
|
|
4
5
|
import QuickInsertCommand from './quickInsertCommand.js';
|
|
5
6
|
import QuickInsertPositionCommand from './quickInsertPositionCommand.js';
|
|
@@ -7,9 +8,9 @@ import { type QuickInsertItem } from './quickInsertListView.js';
|
|
|
7
8
|
import QuickInsertView from './quickInsertView.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
|
-
* The configuration of the {@link
|
|
11
|
+
* The configuration of the {@link ElementQuickInsert} plugin.
|
|
11
12
|
*/
|
|
12
|
-
export interface
|
|
13
|
+
export interface ElementQuickInsertConfig {
|
|
13
14
|
/**
|
|
14
15
|
* Labels of the elements, by model name. Elements without a label are listed by their model name.
|
|
15
16
|
*/
|
|
@@ -29,7 +30,7 @@ export interface QuickInsertConfig {
|
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Opens a menu with a search field and the elements allowed at the selection, on Alt+Enter (Option+Enter on macOS; see
|
|
32
|
-
* {@link
|
|
33
|
+
* {@link ElementQuickInsertConfig.keystroke}). Choosing an element inserts it with the `quickInsert` command.
|
|
33
34
|
*
|
|
34
35
|
* The menu is shown by the `ElementMenu` plugin. The `quickInsertBefore` and `quickInsertAfter` commands (see
|
|
35
36
|
* {@link QuickInsertPositionCommand}) open it for the position before or after an element; list them in the
|
|
@@ -37,28 +38,28 @@ export interface QuickInsertConfig {
|
|
|
37
38
|
*
|
|
38
39
|
* The menu closes when the document changes while it is open, so it never inserts at an outdated position.
|
|
39
40
|
*/
|
|
40
|
-
export default class
|
|
41
|
+
export default class ElementQuickInsert extends Plugin {
|
|
41
42
|
public static get requires(): readonly [typeof ElementMenu] {
|
|
42
43
|
return [ElementMenu] as const;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
public static get pluginName(): '
|
|
46
|
-
return '
|
|
46
|
+
public static get pluginName(): 'ElementQuickInsert' {
|
|
47
|
+
return 'ElementQuickInsert' as const;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
constructor(editor: Editor) {
|
|
50
51
|
super(editor);
|
|
51
52
|
|
|
52
|
-
editor.config.define('
|
|
53
|
+
editor.config.define('elementQuickInsert', { labels: {}, exclude: [], keystroke: 'Alt+Enter' });
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
public init(): void {
|
|
56
57
|
const editor = this.editor;
|
|
57
|
-
const keystroke = editor.config.get('
|
|
58
|
+
const keystroke = editor.config.get('elementQuickInsert')?.keystroke;
|
|
58
59
|
|
|
59
60
|
editor.commands.add('quickInsert', new QuickInsertCommand(editor));
|
|
60
|
-
editor.commands.add('quickInsertBefore', new QuickInsertPositionCommand(editor, 'before'));
|
|
61
|
-
editor.commands.add('quickInsertAfter', new QuickInsertPositionCommand(editor, 'after'));
|
|
61
|
+
editor.commands.add('quickInsertBefore', new QuickInsertPositionCommand(editor, 'before', this));
|
|
62
|
+
editor.commands.add('quickInsertAfter', new QuickInsertPositionCommand(editor, 'after', this));
|
|
62
63
|
|
|
63
64
|
if (keystroke) {
|
|
64
65
|
editor.keystrokes.set(keystroke, (data, cancel) => {
|
|
@@ -78,7 +79,7 @@ export default class QuickInsert extends Plugin {
|
|
|
78
79
|
* selection), with their labels.
|
|
79
80
|
*/
|
|
80
81
|
public getItems(elementOrPosition?: ElementOrPosition): QuickInsertItem[] {
|
|
81
|
-
const config = this.editor.config.get('
|
|
82
|
+
const config = this.editor.config.get('elementQuickInsert');
|
|
82
83
|
const labels = config?.labels ?? {};
|
|
83
84
|
const command = this.editor.commands.get('quickInsert');
|
|
84
85
|
|
|
@@ -88,6 +89,16 @@ export default class QuickInsert extends Plugin {
|
|
|
88
89
|
}));
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Whether an element can be inserted at the target (a position, the position before an element, or the selection),
|
|
94
|
+
* as {@link getItems} lists them: it stops at the first one, e.g. for whether a command is enabled.
|
|
95
|
+
*/
|
|
96
|
+
public hasItems(elementOrPosition?: ElementOrPosition): boolean {
|
|
97
|
+
const command = this.editor.commands.get('quickInsert');
|
|
98
|
+
|
|
99
|
+
return !!command?.hasAllowedElements(elementOrPosition, this.editor.config.get('elementQuickInsert')?.exclude);
|
|
100
|
+
}
|
|
101
|
+
|
|
91
102
|
/**
|
|
92
103
|
* Opens the menu for inserting at the target (a position, the position before an element, or the selection), next
|
|
93
104
|
* to the given DOM target. By default, the menu is next to the element, or the selection.
|
|
@@ -99,7 +110,7 @@ export default class QuickInsert extends Plugin {
|
|
|
99
110
|
const editor = this.editor;
|
|
100
111
|
const command = editor.commands.get('quickInsert');
|
|
101
112
|
const position = command?.getInsertPosition(elementOrPosition);
|
|
102
|
-
const menuTarget = domTarget ??
|
|
113
|
+
const menuTarget = domTarget ?? getDomTarget(editor, elementOrPosition);
|
|
103
114
|
|
|
104
115
|
if (!command || !position || !menuTarget || !command.getState(position).isEnabled) {
|
|
105
116
|
return false;
|
|
@@ -121,29 +132,4 @@ export default class QuickInsert extends Plugin {
|
|
|
121
132
|
|
|
122
133
|
return true;
|
|
123
134
|
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Returns the DOM element of the element, or the DOM range of the selection.
|
|
127
|
-
*/
|
|
128
|
-
private _getDomTarget(elementOrPosition?: ElementOrPosition): RectSource | null {
|
|
129
|
-
const editing = this.editor.editing;
|
|
130
|
-
|
|
131
|
-
if (elementOrPosition && !elementOrPosition.is('position')) {
|
|
132
|
-
return this._getDomElement(elementOrPosition);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const viewRange = elementOrPosition
|
|
136
|
-
? editing.view.createRange(editing.mapper.toViewPosition(elementOrPosition))
|
|
137
|
-
: editing.view.document.selection.getFirstRange();
|
|
138
|
-
|
|
139
|
-
return viewRange && editing.view.domConverter.viewRangeToDom(viewRange);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
private _getDomElement(element: ModelElement): HTMLElement | null {
|
|
143
|
-
const editing = this.editor.editing;
|
|
144
|
-
const viewElement = editing.mapper.toViewElement(element);
|
|
145
|
-
const domElement = viewElement && editing.view.domConverter.mapViewToDom(viewElement);
|
|
146
|
-
|
|
147
|
-
return domElement instanceof HTMLElement ? domElement : null;
|
|
148
|
-
}
|
|
149
135
|
}
|
|
@@ -3,14 +3,15 @@ import { ElementOrPositionCommand, selectNewElement, type ElementOrPosition } fr
|
|
|
3
3
|
import { insertIcon } from './icons.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Inserts an element by its model name at a position
|
|
6
|
+
* Inserts an element by its model name at a position: what the quick insert menu does, when an element is chosen. The
|
|
7
|
+
* menu itself is opened by the `ElementQuickInsert` plugin, with its `open()`.
|
|
7
8
|
*
|
|
8
9
|
* The target comes first, as in every {@link ElementOrPositionCommand}: a position, an element (meaning the position
|
|
9
10
|
* before it), or none (the selection).
|
|
10
11
|
*
|
|
11
12
|
* ```ts
|
|
12
13
|
* editor.execute('quickInsert', position, 'heading1'); // Inserts a heading at the position.
|
|
13
|
-
* editor.execute('quickInsert'); //
|
|
14
|
+
* editor.execute('quickInsert', undefined, 'softBreak'); // Inserts a line break at the selection.
|
|
14
15
|
* ```
|
|
15
16
|
*
|
|
16
17
|
* Only elements that the schema allows at exactly that position are inserted (see {@link getAllowedElements}):
|
|
@@ -32,17 +33,15 @@ export default class QuickInsertCommand extends ElementOrPositionCommand {
|
|
|
32
33
|
* were registered. Generic items (such as `$text` or `$block`) and the excluded names are skipped.
|
|
33
34
|
*/
|
|
34
35
|
public getAllowedElements(elementOrPosition?: ElementOrPosition, exclude: readonly string[] = []): string[] {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!target) {
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const schema = this.editor.model.schema;
|
|
36
|
+
return Array.from(this._getAllowedElements(elementOrPosition, exclude));
|
|
37
|
+
}
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Whether an element is allowed at exactly the position (or the selection), as {@link getAllowedElements} returns
|
|
41
|
+
* them: it stops at the first one.
|
|
42
|
+
*/
|
|
43
|
+
public hasAllowedElements(elementOrPosition?: ElementOrPosition, exclude: readonly string[] = []): boolean {
|
|
44
|
+
return !this._getAllowedElements(elementOrPosition, exclude).next().done;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
/**
|
|
@@ -54,20 +53,9 @@ export default class QuickInsertCommand extends ElementOrPositionCommand {
|
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
/**
|
|
57
|
-
* Inserts the element named `name` at the target, when the schema allows it there.
|
|
58
|
-
* insert menu for the target (requires the `QuickInsert` plugin).
|
|
56
|
+
* Inserts the element named `name` at the target, when the schema allows it there.
|
|
59
57
|
*/
|
|
60
|
-
public override execute(elementOrPosition
|
|
61
|
-
if (name === undefined) {
|
|
62
|
-
const plugins = this.editor.plugins;
|
|
63
|
-
|
|
64
|
-
if (plugins.has('QuickInsert')) {
|
|
65
|
-
plugins.get('QuickInsert').open(elementOrPosition);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
58
|
+
public override execute(elementOrPosition: ElementOrPosition | undefined, name: string): void {
|
|
71
59
|
const model = this.editor.model;
|
|
72
60
|
const target = this._getPosition(elementOrPosition);
|
|
73
61
|
|
|
@@ -82,4 +70,27 @@ export default class QuickInsertCommand extends ElementOrPositionCommand {
|
|
|
82
70
|
selectNewElement(writer, element);
|
|
83
71
|
});
|
|
84
72
|
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Yields the names of the elements allowed at exactly the position (or the selection), one by one.
|
|
76
|
+
*/
|
|
77
|
+
private *_getAllowedElements(
|
|
78
|
+
elementOrPosition: ElementOrPosition | undefined,
|
|
79
|
+
exclude: readonly string[]
|
|
80
|
+
): Generator<string> {
|
|
81
|
+
const target = this._getPosition(elementOrPosition);
|
|
82
|
+
|
|
83
|
+
if (!target) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const schema = this.editor.model.schema;
|
|
88
|
+
const excluded = new Set(exclude);
|
|
89
|
+
|
|
90
|
+
for (const name of Object.keys(schema.getDefinitions())) {
|
|
91
|
+
if (!name.startsWith('$') && !excluded.has(name) && schema.checkChild(target, name)) {
|
|
92
|
+
yield name;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
85
96
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type Editor, type ModelPosition } from 'ckeditor5';
|
|
2
2
|
import { ElementOrPositionCommand, type ElementOrPosition } from 'ckeditor5-elements-core';
|
|
3
|
+
import { getDomTarget } from '../domTarget.js';
|
|
4
|
+
import type ElementQuickInsert from './elementQuickInsert.js';
|
|
3
5
|
import { insertAfterIcon, insertBeforeIcon } from './icons.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
@@ -13,7 +15,7 @@ export type QuickInsertPlacement = 'before' | 'after';
|
|
|
13
15
|
* The element is the given one, the parent of the given position, or the selected element or the parent of the
|
|
14
16
|
* selection (see {@link ElementOrPositionCommand}). Enabled when something can be inserted at that position.
|
|
15
17
|
*
|
|
16
|
-
*
|
|
18
|
+
* The `ElementQuickInsert` plugin registers it as `quickInsertBefore` and `quickInsertAfter`, for its menu.
|
|
17
19
|
*/
|
|
18
20
|
export default class QuickInsertPositionCommand extends ElementOrPositionCommand {
|
|
19
21
|
/**
|
|
@@ -21,10 +23,16 @@ export default class QuickInsertPositionCommand extends ElementOrPositionCommand
|
|
|
21
23
|
*/
|
|
22
24
|
public readonly placement: QuickInsertPlacement;
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The plugin whose menu the command opens.
|
|
28
|
+
*/
|
|
29
|
+
private readonly _quickInsert: ElementQuickInsert;
|
|
30
|
+
|
|
31
|
+
constructor(editor: Editor, placement: QuickInsertPlacement, quickInsert: ElementQuickInsert) {
|
|
25
32
|
super(editor);
|
|
26
33
|
|
|
27
34
|
this.placement = placement;
|
|
35
|
+
this._quickInsert = quickInsert;
|
|
28
36
|
this.title = placement === 'before' ? editor.t('Insert before') : editor.t('Insert after');
|
|
29
37
|
this.icon = placement === 'before' ? insertBeforeIcon : insertAfterIcon;
|
|
30
38
|
}
|
|
@@ -33,30 +41,18 @@ export default class QuickInsertPositionCommand extends ElementOrPositionCommand
|
|
|
33
41
|
* Opens the quick insert menu for the position before or after the element, next to the element.
|
|
34
42
|
*/
|
|
35
43
|
public override execute(elementOrPosition?: ElementOrPosition): void {
|
|
36
|
-
const editor = this.editor;
|
|
37
44
|
const element = this._getElement(elementOrPosition);
|
|
38
45
|
const position = this._getInsertPosition(elementOrPosition);
|
|
39
46
|
|
|
40
|
-
if (
|
|
41
|
-
|
|
47
|
+
if (element && position) {
|
|
48
|
+
this._quickInsert.open(position, getDomTarget(this.editor, element) ?? undefined);
|
|
42
49
|
}
|
|
43
|
-
|
|
44
|
-
const viewElement = editor.editing.mapper.toViewElement(element);
|
|
45
|
-
const domElement = viewElement && editor.editing.view.domConverter.mapViewToDom(viewElement);
|
|
46
|
-
|
|
47
|
-
editor.plugins.get('QuickInsert').open(position, domElement ?? undefined);
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
protected override _isEnabledFor(elementOrPosition?: ElementOrPosition): boolean {
|
|
51
53
|
const position = this._getInsertPosition(elementOrPosition);
|
|
52
|
-
const plugins = this.editor.plugins;
|
|
53
54
|
|
|
54
|
-
return (
|
|
55
|
-
!!position &&
|
|
56
|
-
this.editor.model.canEditAt(position) &&
|
|
57
|
-
plugins.has('QuickInsert') &&
|
|
58
|
-
plugins.get('QuickInsert').getItems(position).length > 0
|
|
59
|
-
);
|
|
55
|
+
return !!position && this.editor.model.canEditAt(position) && this._quickInsert.hasItems(position);
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
private _getInsertPosition(elementOrPosition?: ElementOrPosition): ModelPosition | null {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/breadcrumbs/breadcrumbs.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EAEN,KAAK,MAAM,EACX,KAAK,MAAM,EAQX,MAAM,WAAW,CAAC;AAEnB,OAAO,WAAW,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,KAAK,cAAc,EAAsC,MAAM,yBAAyB,CAAC;AAClG,OAAO,eAAqD,MAAM,sBAAsB,CAAC;AASzF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;OAIG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;CACzB;AAWD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM;IAC9C;;;;OAIG;IACY,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAEhD,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