@openleaf-editor/ui 0.1.0-beta.1 → 0.1.0-beta.3
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 +85 -0
- package/dist/block-type.d.ts +5 -0
- package/dist/block-type.d.ts.map +1 -0
- package/dist/block-type.js +133 -0
- package/dist/block-type.js.map +1 -0
- package/dist/content-css.d.ts +31 -0
- package/dist/content-css.d.ts.map +1 -0
- package/dist/content-css.js +272 -0
- package/dist/content-css.js.map +1 -0
- package/dist/css.d.ts +23 -0
- package/dist/css.d.ts.map +1 -0
- package/dist/css.js +813 -0
- package/dist/css.js.map +1 -0
- package/dist/dialog.d.ts +158 -18
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +605 -130
- package/dist/dialog.js.map +1 -1
- package/dist/floating.d.ts +29 -0
- package/dist/floating.d.ts.map +1 -0
- package/dist/floating.js +130 -0
- package/dist/floating.js.map +1 -0
- package/dist/help.d.ts +9 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +97 -0
- package/dist/help.js.map +1 -0
- package/dist/i18n.d.ts +39 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +114 -0
- package/dist/i18n.js.map +1 -0
- package/dist/icons.d.ts +7 -1
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +10 -2
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/items.d.ts +2 -1
- package/dist/items.d.ts.map +1 -1
- package/dist/items.js +263 -17
- package/dist/items.js.map +1 -1
- package/dist/live.d.ts +42 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +83 -0
- package/dist/live.js.map +1 -0
- package/dist/menu.d.ts +85 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +500 -0
- package/dist/menu.js.map +1 -0
- package/dist/openleaf.css +325 -7
- package/dist/overflow.d.ts +44 -0
- package/dist/overflow.d.ts.map +1 -0
- package/dist/overflow.js +323 -0
- package/dist/overflow.js.map +1 -0
- package/dist/pickers.d.ts +43 -0
- package/dist/pickers.d.ts.map +1 -0
- package/dist/pickers.js +52 -0
- package/dist/pickers.js.map +1 -0
- package/dist/registry.d.ts +72 -18
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +7 -6
- package/dist/registry.js.map +1 -1
- package/dist/skins.d.ts.map +1 -1
- package/dist/skins.js +48 -14
- package/dist/skins.js.map +1 -1
- package/dist/styles.d.ts +61 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +77 -421
- package/dist/styles.js.map +1 -1
- package/dist/testing.d.ts +3 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +3 -0
- package/dist/testing.js.map +1 -0
- package/dist/toolbar.d.ts +91 -12
- package/dist/toolbar.d.ts.map +1 -1
- package/dist/toolbar.js +459 -127
- package/dist/toolbar.js.map +1 -1
- package/dist/upload.d.ts +11 -0
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +15 -1
- package/dist/upload.js.map +1 -1
- package/package.json +17 -3
package/dist/menu.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Menubar and popup menus.
|
|
3
|
+
*
|
|
4
|
+
* Built with `role="menubar"` / `role="menu"` rather than a toolbar, because
|
|
5
|
+
* the two widgets have different keyboard contracts: a toolbar is one tab stop
|
|
6
|
+
* of peer buttons, a menubar is a row of menus that open on Down/Enter and
|
|
7
|
+
* close on Escape. Mixing them is what makes "the File menu is also a toolbar
|
|
8
|
+
* button" feel broken to a screen reader.
|
|
9
|
+
*
|
|
10
|
+
* Items are toolbar ids. The same command a button runs is the command a menu
|
|
11
|
+
* item runs, so a host that hides the toolbar still has a complete Edit menu.
|
|
12
|
+
*/
|
|
13
|
+
import type { EditorView } from 'prosemirror-view';
|
|
14
|
+
export interface MenuItemRef {
|
|
15
|
+
id: string;
|
|
16
|
+
/** Override the toolbar item's label. */
|
|
17
|
+
label?: string;
|
|
18
|
+
}
|
|
19
|
+
export type MenuEntry = MenuItemRef | '|';
|
|
20
|
+
export interface MenuSpec {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
items: readonly MenuEntry[];
|
|
24
|
+
}
|
|
25
|
+
export declare const DEFAULT_MENUBAR: readonly MenuSpec[];
|
|
26
|
+
export declare const LINK_CONTEXT_ITEMS: readonly MenuEntry[];
|
|
27
|
+
export declare const IMAGE_CONTEXT_ITEMS: readonly MenuEntry[];
|
|
28
|
+
export declare const TABLE_CONTEXT_ITEMS: readonly MenuEntry[];
|
|
29
|
+
export interface PopupMenuOptions {
|
|
30
|
+
/** The control that opened this menu. Owns the name and the focus return. */
|
|
31
|
+
trigger?: HTMLElement;
|
|
32
|
+
/** Accessible name, when there is no trigger to borrow one from. */
|
|
33
|
+
label?: string;
|
|
34
|
+
onClose?: () => void;
|
|
35
|
+
}
|
|
36
|
+
export declare class PopupMenu {
|
|
37
|
+
#private;
|
|
38
|
+
readonly el: HTMLDivElement;
|
|
39
|
+
constructor(host: HTMLElement, doc: Document);
|
|
40
|
+
attach(view: EditorView): void;
|
|
41
|
+
destroy(): void;
|
|
42
|
+
get open(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Open at a point, named by whatever opened it.
|
|
45
|
+
*
|
|
46
|
+
* `trigger` is not optional decoration: without it the menu has no accessible
|
|
47
|
+
* name at all -- a screen reader announces "menu", with nothing to say which
|
|
48
|
+
* one -- and Escape has nowhere to put focus back, so it lands on the document
|
|
49
|
+
* and the author is out of the menubar entirely.
|
|
50
|
+
*/
|
|
51
|
+
show(items: readonly MenuEntry[], x: number, y: number, options?: PopupMenuOptions): void;
|
|
52
|
+
/**
|
|
53
|
+
* Close, and put focus somewhere real.
|
|
54
|
+
*
|
|
55
|
+
* `replaceChildren()` removes the node that currently has focus, and a browser
|
|
56
|
+
* whose focused element disappears falls back to `<body>` -- so without the
|
|
57
|
+
* return the author's next Tab starts from the top of the page.
|
|
58
|
+
*/
|
|
59
|
+
close(returnFocus?: boolean): void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The menus an integrator asked for, in the order they asked for them.
|
|
63
|
+
*
|
|
64
|
+
* `menubar` with no value means "give me the menubar", so an empty list is every
|
|
65
|
+
* default menu. Named ids are honoured as written: `menubar="edit help"` used to
|
|
66
|
+
* render Insert, Format and View as well, because the attribute was read as a
|
|
67
|
+
* boolean and the list thrown away. An unknown id is skipped rather than fatal,
|
|
68
|
+
* so a layout written against a later version degrades instead of breaking.
|
|
69
|
+
*/
|
|
70
|
+
export declare function selectMenus(attr: string | null | undefined, menus?: readonly MenuSpec[]): readonly MenuSpec[];
|
|
71
|
+
export declare class MenuBar {
|
|
72
|
+
#private;
|
|
73
|
+
readonly el: HTMLDivElement;
|
|
74
|
+
constructor(host: HTMLElement, doc: Document, menus?: readonly MenuSpec[], locale?: string | null);
|
|
75
|
+
mount(view: EditorView): void;
|
|
76
|
+
/**
|
|
77
|
+
* Detach the menubar AND take its DOM with it -- see `Toolbar.destroy()`.
|
|
78
|
+
* The host reads its own `innerHTML` back as content when it rebuilds, so a
|
|
79
|
+
* menubar row left behind here would become the author's document.
|
|
80
|
+
*
|
|
81
|
+
* Idempotent: `.remove()` on a detached node is a no-op.
|
|
82
|
+
*/
|
|
83
|
+
destroy(): void;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../src/menu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAKlD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM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AE,cAAc,CAAA;gBAWzB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,QAAQ,EACb,KAAK,GAAE,SAAS,QAAQ,EAAoB,EAC5C,MAAM,GAAE,MAAM,GAAG,IAAW;IAmB9B,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAM7B;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;CA0GhB"}
|
package/dist/menu.js
ADDED
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Menubar and popup menus.
|
|
3
|
+
*
|
|
4
|
+
* Built with `role="menubar"` / `role="menu"` rather than a toolbar, because
|
|
5
|
+
* the two widgets have different keyboard contracts: a toolbar is one tab stop
|
|
6
|
+
* of peer buttons, a menubar is a row of menus that open on Down/Enter and
|
|
7
|
+
* close on Escape. Mixing them is what makes "the File menu is also a toolbar
|
|
8
|
+
* button" feel broken to a screen reader.
|
|
9
|
+
*
|
|
10
|
+
* Items are toolbar ids. The same command a button runs is the command a menu
|
|
11
|
+
* item runs, so a host that hides the toolbar still has a complete Edit menu.
|
|
12
|
+
*/
|
|
13
|
+
import { t, withLocale } from './i18n.js';
|
|
14
|
+
import { getToolbarItem } from './registry.js';
|
|
15
|
+
import { ensureStyles } from './styles.js';
|
|
16
|
+
export const DEFAULT_MENUBAR = [
|
|
17
|
+
{
|
|
18
|
+
id: 'edit',
|
|
19
|
+
label: 'Edit',
|
|
20
|
+
items: [
|
|
21
|
+
{ id: 'undo' },
|
|
22
|
+
{ id: 'redo' },
|
|
23
|
+
'|',
|
|
24
|
+
{ id: 'bold' },
|
|
25
|
+
{ id: 'italic' },
|
|
26
|
+
{ id: 'underline' },
|
|
27
|
+
{ id: 'strikethrough' },
|
|
28
|
+
{ id: 'code' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'insert',
|
|
33
|
+
label: 'Insert',
|
|
34
|
+
items: [{ id: 'link' }, { id: 'image' }, { id: 'horizontalRule' }, { id: 'insertTable' }],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'format',
|
|
38
|
+
label: 'Format',
|
|
39
|
+
items: [
|
|
40
|
+
{ id: 'alignLeft' },
|
|
41
|
+
{ id: 'alignCenter' },
|
|
42
|
+
{ id: 'alignRight' },
|
|
43
|
+
{ id: 'alignJustify' },
|
|
44
|
+
'|',
|
|
45
|
+
{ id: 'indent' },
|
|
46
|
+
{ id: 'outdent' },
|
|
47
|
+
'|',
|
|
48
|
+
{ id: 'bulletList' },
|
|
49
|
+
{ id: 'orderedList' },
|
|
50
|
+
{ id: 'blockquote' },
|
|
51
|
+
{ id: 'codeBlock' },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'view',
|
|
56
|
+
label: 'View',
|
|
57
|
+
items: [{ id: 'source' }, { id: 'fullscreen' }, { id: 'visualAids' }],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'help',
|
|
61
|
+
label: 'Help',
|
|
62
|
+
items: [{ id: 'help' }],
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
export const LINK_CONTEXT_ITEMS = [{ id: 'link' }, { id: 'unlink' }];
|
|
66
|
+
export const IMAGE_CONTEXT_ITEMS = [{ id: 'image' }];
|
|
67
|
+
export const TABLE_CONTEXT_ITEMS = [
|
|
68
|
+
{ id: 'addRowBefore' },
|
|
69
|
+
{ id: 'addRowAfter' },
|
|
70
|
+
{ id: 'deleteRow' },
|
|
71
|
+
'|',
|
|
72
|
+
{ id: 'addColumnBefore' },
|
|
73
|
+
{ id: 'addColumnAfter' },
|
|
74
|
+
{ id: 'deleteColumn' },
|
|
75
|
+
'|',
|
|
76
|
+
{ id: 'deleteTable' },
|
|
77
|
+
];
|
|
78
|
+
function invoke(spec, view, host) {
|
|
79
|
+
if (host.hasAttribute('readonly'))
|
|
80
|
+
return;
|
|
81
|
+
try {
|
|
82
|
+
if (spec.run) {
|
|
83
|
+
spec.run({ view, host });
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (spec.command) {
|
|
87
|
+
spec.command(view.state, view.dispatch, view);
|
|
88
|
+
view.focus();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
console.error(`@openleaf-editor/ui: menu item "${spec.id}" threw`, error);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function enabled(spec, state, host) {
|
|
96
|
+
if (host.hasAttribute('readonly'))
|
|
97
|
+
return false;
|
|
98
|
+
if (spec.isEnabled) {
|
|
99
|
+
try {
|
|
100
|
+
return spec.isEnabled(state);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (spec.command)
|
|
107
|
+
return spec.command(state);
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
/** Menus are named after the trigger that opened them, which needs an id. */
|
|
111
|
+
let menuCounter = 0;
|
|
112
|
+
/**
|
|
113
|
+
* Separate from `menuCounter`, because one menu is opened by MANY triggers.
|
|
114
|
+
*
|
|
115
|
+
* A menubar shares a single `PopupMenu` across every menu on it, so an id
|
|
116
|
+
* derived from the popup's own name was the same string for every trigger:
|
|
117
|
+
* open Edit, then Insert, and two buttons carried one DOM id. `aria-labelledby`
|
|
118
|
+
* resolves to the first match in tree order, so every menu after the first was
|
|
119
|
+
* announced under the first one's name.
|
|
120
|
+
*/
|
|
121
|
+
let triggerCounter = 0;
|
|
122
|
+
export class PopupMenu {
|
|
123
|
+
el;
|
|
124
|
+
#doc;
|
|
125
|
+
#host;
|
|
126
|
+
#view = null;
|
|
127
|
+
#items = [];
|
|
128
|
+
#onClose;
|
|
129
|
+
#trigger = null;
|
|
130
|
+
constructor(host, doc) {
|
|
131
|
+
this.#host = host;
|
|
132
|
+
this.#doc = doc;
|
|
133
|
+
ensureStyles(doc);
|
|
134
|
+
this.el = doc.createElement('div');
|
|
135
|
+
this.el.className = 'ol-menu';
|
|
136
|
+
this.el.id = `ol-menu-${(menuCounter += 1)}`;
|
|
137
|
+
this.el.setAttribute('role', 'menu');
|
|
138
|
+
this.el.hidden = true;
|
|
139
|
+
this.el.addEventListener('keydown', this.#onKeydown);
|
|
140
|
+
this.el.addEventListener('click', this.#onClick);
|
|
141
|
+
}
|
|
142
|
+
attach(view) {
|
|
143
|
+
this.#view = view;
|
|
144
|
+
}
|
|
145
|
+
destroy() {
|
|
146
|
+
this.close();
|
|
147
|
+
this.el.removeEventListener('keydown', this.#onKeydown);
|
|
148
|
+
this.el.removeEventListener('click', this.#onClick);
|
|
149
|
+
this.el.remove();
|
|
150
|
+
}
|
|
151
|
+
get open() {
|
|
152
|
+
return !this.el.hidden;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Open at a point, named by whatever opened it.
|
|
156
|
+
*
|
|
157
|
+
* `trigger` is not optional decoration: without it the menu has no accessible
|
|
158
|
+
* name at all -- a screen reader announces "menu", with nothing to say which
|
|
159
|
+
* one -- and Escape has nowhere to put focus back, so it lands on the document
|
|
160
|
+
* and the author is out of the menubar entirely.
|
|
161
|
+
*/
|
|
162
|
+
show(items, x, y, options = {}) {
|
|
163
|
+
this.#items = items;
|
|
164
|
+
this.#onClose = options.onClose;
|
|
165
|
+
const trigger = options.trigger ?? null;
|
|
166
|
+
this.#trigger = trigger;
|
|
167
|
+
if (trigger) {
|
|
168
|
+
if (!trigger.id)
|
|
169
|
+
trigger.id = `${this.el.id}-trigger-${(triggerCounter += 1)}`;
|
|
170
|
+
this.el.setAttribute('aria-labelledby', trigger.id);
|
|
171
|
+
this.el.removeAttribute('aria-label');
|
|
172
|
+
trigger.setAttribute('aria-controls', this.el.id);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
this.el.removeAttribute('aria-labelledby');
|
|
176
|
+
this.el.setAttribute('aria-label', t(options.label ?? 'Editor menu'));
|
|
177
|
+
}
|
|
178
|
+
this.#render();
|
|
179
|
+
this.el.hidden = false;
|
|
180
|
+
this.#place(x, y);
|
|
181
|
+
this.#focusItem(this.el.querySelector('[role="menuitem"]'));
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Keep the menu on screen.
|
|
185
|
+
*
|
|
186
|
+
* A right-click near the bottom of the viewport otherwise renders it below the
|
|
187
|
+
* fold, where the item the author asked for cannot be seen or scrolled to --
|
|
188
|
+
* the menu is positioned, so the page does not grow to contain it.
|
|
189
|
+
*
|
|
190
|
+
* Flipping is measured against the TRIGGER, not against the point the menu was
|
|
191
|
+
* asked to open at. Those differ by the height of the trigger, and using the
|
|
192
|
+
* point puts a flipped menu on top of the menubar it came from -- covering the
|
|
193
|
+
* next menu along, which is exactly where the pointer is going.
|
|
194
|
+
*/
|
|
195
|
+
#place(x, y) {
|
|
196
|
+
const hostBox = this.#host.getBoundingClientRect();
|
|
197
|
+
const box = this.el.getBoundingClientRect();
|
|
198
|
+
const win = this.#doc.defaultView;
|
|
199
|
+
const vw = win?.innerWidth ?? 0;
|
|
200
|
+
const vh = win?.innerHeight ?? 0;
|
|
201
|
+
const left = vw > 0 ? Math.max(4, Math.min(x, vw - box.width - 4)) : x;
|
|
202
|
+
let top = y;
|
|
203
|
+
if (vh > 0 && y + box.height > vh) {
|
|
204
|
+
const above = (this.#trigger?.getBoundingClientRect().top ?? y) - 4 - box.height;
|
|
205
|
+
// Above only when it genuinely fits there. Sliding a menu that fits
|
|
206
|
+
// NEITHER side up to the viewport edge lands it on its own menubar, which
|
|
207
|
+
// trades a menu below the fold for a menubar that cannot be clicked. The
|
|
208
|
+
// stylesheet caps the height, so this is the rare deep menu on a short
|
|
209
|
+
// window rather than the normal case.
|
|
210
|
+
if (above >= 4)
|
|
211
|
+
top = above;
|
|
212
|
+
}
|
|
213
|
+
this.el.style.left = `${Math.round(left - hostBox.left)}px`;
|
|
214
|
+
this.el.style.top = `${Math.round(top - hostBox.top)}px`;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Close, and put focus somewhere real.
|
|
218
|
+
*
|
|
219
|
+
* `replaceChildren()` removes the node that currently has focus, and a browser
|
|
220
|
+
* whose focused element disappears falls back to `<body>` -- so without the
|
|
221
|
+
* return the author's next Tab starts from the top of the page.
|
|
222
|
+
*/
|
|
223
|
+
close(returnFocus = false) {
|
|
224
|
+
if (this.el.hidden)
|
|
225
|
+
return;
|
|
226
|
+
const trigger = this.#trigger;
|
|
227
|
+
if (returnFocus && trigger?.isConnected)
|
|
228
|
+
trigger.focus();
|
|
229
|
+
this.el.hidden = true;
|
|
230
|
+
this.el.replaceChildren();
|
|
231
|
+
trigger?.removeAttribute('aria-controls');
|
|
232
|
+
this.#trigger = null;
|
|
233
|
+
const close = this.#onClose;
|
|
234
|
+
this.#onClose = undefined;
|
|
235
|
+
close?.();
|
|
236
|
+
}
|
|
237
|
+
#focusItem(next) {
|
|
238
|
+
if (!next)
|
|
239
|
+
return;
|
|
240
|
+
// Roving, so Tab leaves the menu instead of walking through every item in it.
|
|
241
|
+
for (const item of this.el.querySelectorAll('[role="menuitem"]')) {
|
|
242
|
+
item.tabIndex = item === next ? 0 : -1;
|
|
243
|
+
}
|
|
244
|
+
next.focus();
|
|
245
|
+
}
|
|
246
|
+
#render() {
|
|
247
|
+
this.el.replaceChildren();
|
|
248
|
+
const view = this.#view;
|
|
249
|
+
if (!view)
|
|
250
|
+
return;
|
|
251
|
+
for (const entry of this.#items) {
|
|
252
|
+
if (entry === '|') {
|
|
253
|
+
const sep = this.#doc.createElement('div');
|
|
254
|
+
sep.setAttribute('role', 'separator');
|
|
255
|
+
sep.className = 'ol-menu-sep';
|
|
256
|
+
this.el.appendChild(sep);
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
const spec = getToolbarItem(entry.id);
|
|
260
|
+
if (!spec)
|
|
261
|
+
continue;
|
|
262
|
+
const button = this.#doc.createElement('button');
|
|
263
|
+
button.type = 'button';
|
|
264
|
+
button.className = 'ol-menu-item';
|
|
265
|
+
button.setAttribute('role', 'menuitem');
|
|
266
|
+
button.dataset['olId'] = spec.id;
|
|
267
|
+
button.textContent = t(entry.label ?? spec.labelFor?.(view.state) ?? spec.label);
|
|
268
|
+
const isEnabled = enabled(spec, view.state, this.#host);
|
|
269
|
+
button.setAttribute('aria-disabled', isEnabled ? 'false' : 'true');
|
|
270
|
+
button.tabIndex = -1;
|
|
271
|
+
this.el.appendChild(button);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
#onClick = (event) => {
|
|
275
|
+
const target = event.target?.closest('[data-ol-id]');
|
|
276
|
+
if (!target || target.getAttribute('aria-disabled') === 'true')
|
|
277
|
+
return;
|
|
278
|
+
const spec = getToolbarItem(target.dataset['olId'] ?? '');
|
|
279
|
+
const view = this.#view;
|
|
280
|
+
if (!spec || !view)
|
|
281
|
+
return;
|
|
282
|
+
// Closed first, but with focus put back on the trigger before the item is
|
|
283
|
+
// removed. Running the command first instead would let `close()` steal focus
|
|
284
|
+
// from a dialog the command had just opened.
|
|
285
|
+
this.close(true);
|
|
286
|
+
invoke(spec, view, this.#host);
|
|
287
|
+
};
|
|
288
|
+
#onKeydown = (event) => {
|
|
289
|
+
const items = [...this.el.querySelectorAll('[role="menuitem"]')];
|
|
290
|
+
const index = items.indexOf(event.target);
|
|
291
|
+
// Tab closes rather than walking on through the menu: a menu left open
|
|
292
|
+
// behind a keyboard user is a widget with no exit.
|
|
293
|
+
if (event.key === 'Escape' || event.key === 'Tab') {
|
|
294
|
+
event.preventDefault();
|
|
295
|
+
const trigger = this.#trigger;
|
|
296
|
+
this.close(true);
|
|
297
|
+
if (!trigger)
|
|
298
|
+
this.#view?.focus();
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
302
|
+
event.preventDefault();
|
|
303
|
+
if (items.length === 0)
|
|
304
|
+
return;
|
|
305
|
+
const delta = event.key === 'ArrowDown' ? 1 : -1;
|
|
306
|
+
this.#focusItem(items[(index + delta + items.length) % items.length]);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (event.key === 'Home' || event.key === 'End') {
|
|
310
|
+
event.preventDefault();
|
|
311
|
+
this.#focusItem(event.key === 'Home' ? items[0] : items[items.length - 1]);
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
315
|
+
event.preventDefault();
|
|
316
|
+
event.target.click();
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
// Typeahead. A menubar user looking for "Italic" presses I, the way they do
|
|
320
|
+
// in every other menu they have ever used.
|
|
321
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
322
|
+
const char = event.key.toLowerCase();
|
|
323
|
+
const from = index + 1;
|
|
324
|
+
const found = [...items.slice(from), ...items.slice(0, Math.max(0, from))].find((item) => (item.textContent ?? '').trim().toLowerCase().startsWith(char));
|
|
325
|
+
if (found) {
|
|
326
|
+
event.preventDefault();
|
|
327
|
+
this.#focusItem(found);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* The menus an integrator asked for, in the order they asked for them.
|
|
334
|
+
*
|
|
335
|
+
* `menubar` with no value means "give me the menubar", so an empty list is every
|
|
336
|
+
* default menu. Named ids are honoured as written: `menubar="edit help"` used to
|
|
337
|
+
* render Insert, Format and View as well, because the attribute was read as a
|
|
338
|
+
* boolean and the list thrown away. An unknown id is skipped rather than fatal,
|
|
339
|
+
* so a layout written against a later version degrades instead of breaking.
|
|
340
|
+
*/
|
|
341
|
+
export function selectMenus(attr, menus = DEFAULT_MENUBAR) {
|
|
342
|
+
const ids = (attr ?? '')
|
|
343
|
+
.split(/[\s,]+/)
|
|
344
|
+
.map((id) => id.trim())
|
|
345
|
+
.filter((id) => id !== '');
|
|
346
|
+
if (ids.length === 0)
|
|
347
|
+
return menus;
|
|
348
|
+
const byId = new Map(menus.map((menu) => [menu.id, menu]));
|
|
349
|
+
const picked = [];
|
|
350
|
+
for (const id of ids) {
|
|
351
|
+
const menu = byId.get(id);
|
|
352
|
+
if (menu && !picked.includes(menu))
|
|
353
|
+
picked.push(menu);
|
|
354
|
+
}
|
|
355
|
+
return picked;
|
|
356
|
+
}
|
|
357
|
+
export class MenuBar {
|
|
358
|
+
el;
|
|
359
|
+
#doc;
|
|
360
|
+
#host;
|
|
361
|
+
#view = null;
|
|
362
|
+
#menus;
|
|
363
|
+
#popup;
|
|
364
|
+
#openId = null;
|
|
365
|
+
#locale;
|
|
366
|
+
constructor(host, doc, menus = DEFAULT_MENUBAR, locale = null) {
|
|
367
|
+
this.#host = host;
|
|
368
|
+
this.#doc = doc;
|
|
369
|
+
this.#menus = menus;
|
|
370
|
+
this.#locale = locale;
|
|
371
|
+
ensureStyles(doc);
|
|
372
|
+
this.el = doc.createElement('div');
|
|
373
|
+
this.el.className = 'ol-menubar';
|
|
374
|
+
this.el.setAttribute('role', 'menubar');
|
|
375
|
+
withLocale(locale, () => {
|
|
376
|
+
this.el.setAttribute('aria-label', t('Editor menu'));
|
|
377
|
+
});
|
|
378
|
+
this.#popup = new PopupMenu(host, doc);
|
|
379
|
+
this.#render();
|
|
380
|
+
this.el.addEventListener('keydown', this.#onKeydown);
|
|
381
|
+
doc.addEventListener('pointerdown', this.#onPointerDown, true);
|
|
382
|
+
}
|
|
383
|
+
mount(view) {
|
|
384
|
+
this.#view = view;
|
|
385
|
+
this.#popup.attach(view);
|
|
386
|
+
if (!this.#popup.el.isConnected)
|
|
387
|
+
this.#host.appendChild(this.#popup.el);
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Detach the menubar AND take its DOM with it -- see `Toolbar.destroy()`.
|
|
391
|
+
* The host reads its own `innerHTML` back as content when it rebuilds, so a
|
|
392
|
+
* menubar row left behind here would become the author's document.
|
|
393
|
+
*
|
|
394
|
+
* Idempotent: `.remove()` on a detached node is a no-op.
|
|
395
|
+
*/
|
|
396
|
+
destroy() {
|
|
397
|
+
this.#doc.removeEventListener('pointerdown', this.#onPointerDown, true);
|
|
398
|
+
this.el.removeEventListener('keydown', this.#onKeydown);
|
|
399
|
+
this.#popup.destroy();
|
|
400
|
+
this.el.remove();
|
|
401
|
+
}
|
|
402
|
+
#render() {
|
|
403
|
+
withLocale(this.#locale, () => this.#renderScoped());
|
|
404
|
+
}
|
|
405
|
+
#renderScoped() {
|
|
406
|
+
this.el.replaceChildren();
|
|
407
|
+
for (const menu of this.#menus) {
|
|
408
|
+
const button = this.#doc.createElement('button');
|
|
409
|
+
button.type = 'button';
|
|
410
|
+
button.className = 'ol-menu-trigger';
|
|
411
|
+
button.setAttribute('role', 'menuitem');
|
|
412
|
+
button.setAttribute('aria-haspopup', 'true');
|
|
413
|
+
button.setAttribute('aria-expanded', 'false');
|
|
414
|
+
button.dataset['olMenu'] = menu.id;
|
|
415
|
+
button.textContent = t(menu.label);
|
|
416
|
+
// Roving: `role="menubar"` is ONE tab stop, and five native buttons at the
|
|
417
|
+
// default tabindex made it five -- so Tab from the content walked the
|
|
418
|
+
// author through every menu before reaching anything they wanted.
|
|
419
|
+
button.tabIndex = this.el.childElementCount === 0 ? 0 : -1;
|
|
420
|
+
button.addEventListener('click', () => this.#toggle(menu, button));
|
|
421
|
+
this.el.appendChild(button);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
#focusTrigger(next) {
|
|
425
|
+
if (!next)
|
|
426
|
+
return;
|
|
427
|
+
for (const button of this.el.querySelectorAll('.ol-menu-trigger')) {
|
|
428
|
+
button.tabIndex = button === next ? 0 : -1;
|
|
429
|
+
}
|
|
430
|
+
next.focus();
|
|
431
|
+
}
|
|
432
|
+
#toggle(menu, trigger) {
|
|
433
|
+
if (this.#openId === menu.id && this.#popup.open) {
|
|
434
|
+
this.#close();
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
this.#open(menu, trigger);
|
|
438
|
+
}
|
|
439
|
+
#open(menu, trigger) {
|
|
440
|
+
this.#close();
|
|
441
|
+
this.#openId = menu.id;
|
|
442
|
+
trigger.setAttribute('aria-expanded', 'true');
|
|
443
|
+
const rect = trigger.getBoundingClientRect();
|
|
444
|
+
this.#popup.show(menu.items, rect.left, rect.bottom + 2, {
|
|
445
|
+
trigger,
|
|
446
|
+
onClose: () => {
|
|
447
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
448
|
+
this.#openId = null;
|
|
449
|
+
},
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
#close(returnFocus = false) {
|
|
453
|
+
this.#popup.close(returnFocus);
|
|
454
|
+
for (const button of this.el.querySelectorAll('[aria-expanded]')) {
|
|
455
|
+
button.setAttribute('aria-expanded', 'false');
|
|
456
|
+
}
|
|
457
|
+
this.#openId = null;
|
|
458
|
+
}
|
|
459
|
+
#onKeydown = (event) => {
|
|
460
|
+
const triggers = [...this.el.querySelectorAll('.ol-menu-trigger')];
|
|
461
|
+
const index = triggers.indexOf(event.target);
|
|
462
|
+
if (index < 0)
|
|
463
|
+
return;
|
|
464
|
+
if (event.key === 'ArrowRight' || event.key === 'ArrowLeft' || event.key === 'Home' || event.key === 'End') {
|
|
465
|
+
event.preventDefault();
|
|
466
|
+
const next = event.key === 'Home'
|
|
467
|
+
? triggers[0]
|
|
468
|
+
: event.key === 'End'
|
|
469
|
+
? triggers[triggers.length - 1]
|
|
470
|
+
: triggers[(index + (event.key === 'ArrowRight' ? 1 : -1) + triggers.length) % triggers.length];
|
|
471
|
+
this.#focusTrigger(next);
|
|
472
|
+
if (this.#popup.open && next) {
|
|
473
|
+
const menu = this.#menus.find((m) => m.id === next.dataset['olMenu']);
|
|
474
|
+
if (menu)
|
|
475
|
+
this.#open(menu, next);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {
|
|
479
|
+
event.preventDefault();
|
|
480
|
+
const menu = this.#menus.find((m) => m.id === triggers[index]?.dataset['olMenu']);
|
|
481
|
+
const trigger = triggers[index];
|
|
482
|
+
if (menu && trigger)
|
|
483
|
+
this.#open(menu, trigger);
|
|
484
|
+
}
|
|
485
|
+
if (event.key === 'Escape') {
|
|
486
|
+
event.preventDefault();
|
|
487
|
+
this.#close();
|
|
488
|
+
this.#view?.focus();
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
#onPointerDown = (event) => {
|
|
492
|
+
if (!this.#popup.open)
|
|
493
|
+
return;
|
|
494
|
+
const target = event.target;
|
|
495
|
+
if (target && (this.el.contains(target) || this.#popup.el.contains(target)))
|
|
496
|
+
return;
|
|
497
|
+
this.#close();
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
//# sourceMappingURL=menu.js.map
|
package/dist/menu.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../src/menu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,cAAc,EAAwB,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAgB1C,MAAM,CAAC,MAAM,eAAe,GAAwB;IAClD;QACE,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,KAAK,EAAE;YACL,EAAE,EAAE,EAAE,MAAM,EAAE;YACd,EAAE,EAAE,EAAE,MAAM,EAAE;YACd,GAAG;YACH,EAAE,EAAE,EAAE,MAAM,EAAE;YACd,EAAE,EAAE,EAAE,QAAQ,EAAE;YAChB,EAAE,EAAE,EAAE,WAAW,EAAE;YACnB,EAAE,EAAE,EAAE,eAAe,EAAE;YACvB,EAAE,EAAE,EAAE,MAAM,EAAE;SACf;KACF;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MA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