prosemirror-menu 1.2.0 → 1.2.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 1.2.2 (2023-05-17)
2
+
3
+ ### Bug fixes
4
+
5
+ Include CommonJS type declarations in the package to please new TypeScript resolution settings.
6
+
7
+ ## 1.2.1 (2022-06-22)
8
+
9
+ ### Bug fixes
10
+
11
+ Export CSS file from package.json.
12
+
1
13
  ## 1.2.0 (2022-05-30)
2
14
 
3
15
  ### New features
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2015-2017 by Marijn Haverbeke <marijnh@gmail.com> and others
1
+ Copyright (C) 2015-2017 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.cjs CHANGED
@@ -233,7 +233,7 @@ var Dropdown = function () {
233
233
  var done = false;
234
234
 
235
235
  function close() {
236
- if (done) return;
236
+ if (done) return false;
237
237
  done = true;
238
238
  dom.removeChild(menuDOM);
239
239
  return true;
@@ -0,0 +1,266 @@
1
+ import { EditorView } from 'prosemirror-view';
2
+ import { EditorState, Transaction, Plugin } from 'prosemirror-state';
3
+ import { NodeType, Attrs } from 'prosemirror-model';
4
+
5
+ /**
6
+ The types defined in this module aren't the only thing you can
7
+ display in your menu. Anything that conforms to this interface can
8
+ be put into a menu structure.
9
+ */
10
+ interface MenuElement {
11
+ /**
12
+ Render the element for display in the menu. Must return a DOM
13
+ element and a function that can be used to update the element to
14
+ a new state. The `update` function must return false if the
15
+ update hid the entire element.
16
+ */
17
+ render(pm: EditorView): {
18
+ dom: HTMLElement;
19
+ update: (state: EditorState) => boolean;
20
+ };
21
+ }
22
+ /**
23
+ An icon or label that, when clicked, executes a command.
24
+ */
25
+ declare class MenuItem implements MenuElement {
26
+ /**
27
+ The spec used to create this item.
28
+ */
29
+ readonly spec: MenuItemSpec;
30
+ /**
31
+ Create a menu item.
32
+ */
33
+ constructor(
34
+ /**
35
+ The spec used to create this item.
36
+ */
37
+ spec: MenuItemSpec);
38
+ /**
39
+ Renders the icon according to its [display
40
+ spec](https://prosemirror.net/docs/ref/#menu.MenuItemSpec.display), and adds an event handler which
41
+ executes the command when the representation is clicked.
42
+ */
43
+ render(view: EditorView): {
44
+ dom: HTMLElement;
45
+ update: (state: EditorState) => boolean;
46
+ };
47
+ }
48
+ /**
49
+ Specifies an icon. May be either an SVG icon, in which case its
50
+ `path` property should be an [SVG path
51
+ spec](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d),
52
+ and `width` and `height` should provide the viewbox in which that
53
+ path exists. Alternatively, it may have a `text` property
54
+ specifying a string of text that makes up the icon, with an
55
+ optional `css` property giving additional CSS styling for the
56
+ text. _Or_ it may contain `dom` property containing a DOM node.
57
+ */
58
+ declare type IconSpec = {
59
+ path: string;
60
+ width: number;
61
+ height: number;
62
+ } | {
63
+ text: string;
64
+ css?: string;
65
+ } | {
66
+ dom: Node;
67
+ };
68
+ /**
69
+ The configuration object passed to the `MenuItem` constructor.
70
+ */
71
+ interface MenuItemSpec {
72
+ /**
73
+ The function to execute when the menu item is activated.
74
+ */
75
+ run: (state: EditorState, dispatch: (tr: Transaction) => void, view: EditorView, event: Event) => void;
76
+ /**
77
+ Optional function that is used to determine whether the item is
78
+ appropriate at the moment. Deselected items will be hidden.
79
+ */
80
+ select?: (state: EditorState) => boolean;
81
+ /**
82
+ Function that is used to determine if the item is enabled. If
83
+ given and returning false, the item will be given a disabled
84
+ styling.
85
+ */
86
+ enable?: (state: EditorState) => boolean;
87
+ /**
88
+ A predicate function to determine whether the item is 'active' (for
89
+ example, the item for toggling the strong mark might be active then
90
+ the cursor is in strong text).
91
+ */
92
+ active?: (state: EditorState) => boolean;
93
+ /**
94
+ A function that renders the item. You must provide either this,
95
+ [`icon`](https://prosemirror.net/docs/ref/#menu.MenuItemSpec.icon), or [`label`](https://prosemirror.net/docs/ref/#MenuItemSpec.label).
96
+ */
97
+ render?: (view: EditorView) => HTMLElement;
98
+ /**
99
+ Describes an icon to show for this item.
100
+ */
101
+ icon?: IconSpec;
102
+ /**
103
+ Makes the item show up as a text label. Mostly useful for items
104
+ wrapped in a [drop-down](https://prosemirror.net/docs/ref/#menu.Dropdown) or similar menu. The object
105
+ should have a `label` property providing the text to display.
106
+ */
107
+ label?: string;
108
+ /**
109
+ Defines DOM title (mouseover) text for the item.
110
+ */
111
+ title?: string | ((state: EditorState) => string);
112
+ /**
113
+ Optionally adds a CSS class to the item's DOM representation.
114
+ */
115
+ class?: string;
116
+ /**
117
+ Optionally adds a string of inline CSS to the item's DOM
118
+ representation.
119
+ */
120
+ css?: string;
121
+ }
122
+ /**
123
+ A drop-down menu, displayed as a label with a downwards-pointing
124
+ triangle to the right of it.
125
+ */
126
+ declare class Dropdown implements MenuElement {
127
+ /**
128
+ Create a dropdown wrapping the elements.
129
+ */
130
+ constructor(content: readonly MenuElement[] | MenuElement,
131
+ /**
132
+ @internal
133
+ */
134
+ options?: {
135
+ /**
136
+ The label to show on the drop-down control.
137
+ */
138
+ label?: string;
139
+ /**
140
+ Sets the
141
+ [`title`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title)
142
+ attribute given to the menu control.
143
+ */
144
+ title?: string;
145
+ /**
146
+ When given, adds an extra CSS class to the menu control.
147
+ */
148
+ class?: string;
149
+ /**
150
+ When given, adds an extra set of CSS styles to the menu control.
151
+ */
152
+ css?: string;
153
+ });
154
+ /**
155
+ Render the dropdown menu and sub-items.
156
+ */
157
+ render(view: EditorView): {
158
+ dom: HTMLElement;
159
+ update: (state: EditorState) => boolean;
160
+ };
161
+ }
162
+ /**
163
+ Represents a submenu wrapping a group of elements that start
164
+ hidden and expand to the right when hovered over or tapped.
165
+ */
166
+ declare class DropdownSubmenu implements MenuElement {
167
+ /**
168
+ Creates a submenu for the given group of menu elements. The
169
+ following options are recognized:
170
+ */
171
+ constructor(content: readonly MenuElement[] | MenuElement,
172
+ /**
173
+ @internal
174
+ */
175
+ options?: {
176
+ /**
177
+ The label to show on the submenu.
178
+ */
179
+ label?: string;
180
+ });
181
+ /**
182
+ Renders the submenu.
183
+ */
184
+ render(view: EditorView): {
185
+ dom: HTMLElement;
186
+ update: (state: EditorState) => boolean;
187
+ };
188
+ }
189
+ /**
190
+ Render the given, possibly nested, array of menu elements into a
191
+ document fragment, placing separators between them (and ensuring no
192
+ superfluous separators appear when some of the groups turn out to
193
+ be empty).
194
+ */
195
+ declare function renderGrouped(view: EditorView, content: readonly (readonly MenuElement[])[]): {
196
+ dom: DocumentFragment;
197
+ update: (state: EditorState) => boolean;
198
+ };
199
+ /**
200
+ A set of basic editor-related icons. Contains the properties
201
+ `join`, `lift`, `selectParentNode`, `undo`, `redo`, `strong`, `em`,
202
+ `code`, `link`, `bulletList`, `orderedList`, and `blockquote`, each
203
+ holding an object that can be used as the `icon` option to
204
+ `MenuItem`.
205
+ */
206
+ declare const icons: {
207
+ [name: string]: IconSpec;
208
+ };
209
+ /**
210
+ Menu item for the `joinUp` command.
211
+ */
212
+ declare const joinUpItem: MenuItem;
213
+ /**
214
+ Menu item for the `lift` command.
215
+ */
216
+ declare const liftItem: MenuItem;
217
+ /**
218
+ Menu item for the `selectParentNode` command.
219
+ */
220
+ declare const selectParentNodeItem: MenuItem;
221
+ /**
222
+ Menu item for the `undo` command.
223
+ */
224
+ declare let undoItem: MenuItem;
225
+ /**
226
+ Menu item for the `redo` command.
227
+ */
228
+ declare let redoItem: MenuItem;
229
+ /**
230
+ Build a menu item for wrapping the selection in a given node type.
231
+ Adds `run` and `select` properties to the ones present in
232
+ `options`. `options.attrs` may be an object that provides
233
+ attributes for the wrapping node.
234
+ */
235
+ declare function wrapItem(nodeType: NodeType, options: Partial<MenuItemSpec> & {
236
+ attrs?: Attrs | null;
237
+ }): MenuItem;
238
+ /**
239
+ Build a menu item for changing the type of the textblock around the
240
+ selection to the given type. Provides `run`, `active`, and `select`
241
+ properties. Others must be given in `options`. `options.attrs` may
242
+ be an object to provide the attributes for the textblock node.
243
+ */
244
+ declare function blockTypeItem(nodeType: NodeType, options: Partial<MenuItemSpec> & {
245
+ attrs?: Attrs | null;
246
+ }): MenuItem;
247
+
248
+ /**
249
+ A plugin that will place a menu bar above the editor. Note that
250
+ this involves wrapping the editor in an additional `<div>`.
251
+ */
252
+ declare function menuBar(options: {
253
+ /**
254
+ Provides the content of the menu, as a nested array to be
255
+ passed to `renderGrouped`.
256
+ */
257
+ content: readonly (readonly MenuElement[])[];
258
+ /**
259
+ Determines whether the menu floats, i.e. whether it sticks to
260
+ the top of the viewport when the editor is partially scrolled
261
+ out of view.
262
+ */
263
+ floating?: boolean;
264
+ }): Plugin;
265
+
266
+ export { Dropdown, DropdownSubmenu, IconSpec, MenuElement, MenuItem, MenuItemSpec, blockTypeItem, icons, joinUpItem, liftItem, menuBar, redoItem, renderGrouped, selectParentNodeItem, undoItem, wrapItem };
package/dist/index.js CHANGED
@@ -190,7 +190,7 @@ class Dropdown {
190
190
  let done = false;
191
191
  function close() {
192
192
  if (done)
193
- return;
193
+ return false;
194
194
  done = true;
195
195
  dom.removeChild(menuDOM);
196
196
  return true;
package/package.json CHANGED
@@ -1,22 +1,25 @@
1
1
  {
2
2
  "name": "prosemirror-menu",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Simple menu elements for ProseMirror",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "exports": {
10
- "import": "./dist/index.js",
11
- "require": "./dist/index.cjs"
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ },
14
+ "./style/menu.css": "./style/menu.css"
12
15
  },
13
- "sideEffects": false,
16
+ "sideEffects": ["./style/menu.css"],
14
17
  "style": "style/menu.css",
15
18
  "license": "MIT",
16
19
  "maintainers": [
17
20
  {
18
21
  "name": "Marijn Haverbeke",
19
- "email": "marijnh@gmail.com",
22
+ "email": "marijn@haverbeke.berlin",
20
23
  "web": "http://marijnhaverbeke.nl"
21
24
  }
22
25
  ],
package/src/menu.ts CHANGED
@@ -177,7 +177,7 @@ export class Dropdown implements MenuElement {
177
177
  translate(view, this.options.label || ""))
178
178
  if (this.options.title) label.setAttribute("title", translate(view, this.options.title))
179
179
  let wrap = crel("div", {class: prefix + "-dropdown-wrap"}, label)
180
- let open: {close: () => void, node: HTMLElement} | null = null
180
+ let open: {close: () => boolean, node: HTMLElement} | null = null
181
181
  let listeningOnClose: (() => void) | null = null
182
182
  let close = () => {
183
183
  if (open && open.close()) {
@@ -212,8 +212,8 @@ export class Dropdown implements MenuElement {
212
212
  let menuDOM = crel("div", {class: prefix + "-dropdown-menu " + (this.options.class || "")}, items)
213
213
 
214
214
  let done = false
215
- function close() {
216
- if (done) return
215
+ function close(): boolean {
216
+ if (done) return false
217
217
  done = true
218
218
  dom.removeChild(menuDOM)
219
219
  return true
package/dist/index.es.js DELETED
@@ -1,639 +0,0 @@
1
- import crel from 'crelt';
2
- import { joinUp, lift, selectParentNode, setBlockType, wrapIn } from 'prosemirror-commands';
3
- import { undo, redo } from 'prosemirror-history';
4
- import { Plugin } from 'prosemirror-state';
5
-
6
- var SVG = "http://www.w3.org/2000/svg";
7
- var XLINK = "http://www.w3.org/1999/xlink";
8
-
9
- var prefix$2 = "ProseMirror-icon";
10
-
11
- function hashPath(path) {
12
- var hash = 0;
13
- for (var i = 0; i < path.length; i++)
14
- { hash = (((hash << 5) - hash) + path.charCodeAt(i)) | 0; }
15
- return hash
16
- }
17
-
18
- function getIcon(icon) {
19
- var node = document.createElement("div");
20
- node.className = prefix$2;
21
- if (icon.path) {
22
- var name = "pm-icon-" + hashPath(icon.path).toString(16);
23
- if (!document.getElementById(name)) { buildSVG(name, icon); }
24
- var svg = node.appendChild(document.createElementNS(SVG, "svg"));
25
- svg.style.width = (icon.width / icon.height) + "em";
26
- var use = svg.appendChild(document.createElementNS(SVG, "use"));
27
- use.setAttributeNS(XLINK, "href", /([^#]*)/.exec(document.location)[1] + "#" + name);
28
- } else if (icon.dom) {
29
- node.appendChild(icon.dom.cloneNode(true));
30
- } else {
31
- node.appendChild(document.createElement("span")).textContent = icon.text || '';
32
- if (icon.css) { node.firstChild.style.cssText = icon.css; }
33
- }
34
- return node
35
- }
36
-
37
- function buildSVG(name, data) {
38
- var collection = document.getElementById(prefix$2 + "-collection");
39
- if (!collection) {
40
- collection = document.createElementNS(SVG, "svg");
41
- collection.id = prefix$2 + "-collection";
42
- collection.style.display = "none";
43
- document.body.insertBefore(collection, document.body.firstChild);
44
- }
45
- var sym = document.createElementNS(SVG, "symbol");
46
- sym.id = name;
47
- sym.setAttribute("viewBox", "0 0 " + data.width + " " + data.height);
48
- var path = sym.appendChild(document.createElementNS(SVG, "path"));
49
- path.setAttribute("d", data.path);
50
- collection.appendChild(sym);
51
- }
52
-
53
- var prefix$1 = "ProseMirror-menu";
54
-
55
- // ::- An icon or label that, when clicked, executes a command.
56
- var MenuItem = function MenuItem(spec) {
57
- // :: MenuItemSpec
58
- // The spec used to create the menu item.
59
- this.spec = spec;
60
- };
61
-
62
- // :: (EditorView) → {dom: dom.Node, update: (EditorState) → bool}
63
- // Renders the icon according to its [display
64
- // spec](#menu.MenuItemSpec.display), and adds an event handler which
65
- // executes the command when the representation is clicked.
66
- MenuItem.prototype.render = function render (view) {
67
- var spec = this.spec;
68
- var dom = spec.render ? spec.render(view)
69
- : spec.icon ? getIcon(spec.icon)
70
- : spec.label ? crel("div", null, translate(view, spec.label))
71
- : null;
72
- if (!dom) { throw new RangeError("MenuItem without icon or label property") }
73
- if (spec.title) {
74
- var title = (typeof spec.title === "function" ? spec.title(view.state) : spec.title);
75
- dom.setAttribute("title", translate(view, title));
76
- }
77
- if (spec.class) { dom.classList.add(spec.class); }
78
- if (spec.css) { dom.style.cssText += spec.css; }
79
-
80
- dom.addEventListener("mousedown", function (e) {
81
- e.preventDefault();
82
- if (!dom.classList.contains(prefix$1 + "-disabled"))
83
- { spec.run(view.state, view.dispatch, view, e); }
84
- });
85
-
86
- function update(state) {
87
- if (spec.select) {
88
- var selected = spec.select(state);
89
- dom.style.display = selected ? "" : "none";
90
- if (!selected) { return false }
91
- }
92
- var enabled = true;
93
- if (spec.enable) {
94
- enabled = spec.enable(state) || false;
95
- setClass(dom, prefix$1 + "-disabled", !enabled);
96
- }
97
- if (spec.active) {
98
- var active = enabled && spec.active(state) || false;
99
- setClass(dom, prefix$1 + "-active", active);
100
- }
101
- return true
102
- }
103
-
104
- return {dom: dom, update: update}
105
- };
106
-
107
- function translate(view, text) {
108
- return view._props.translate ? view._props.translate(text) : text
109
- }
110
-
111
- // MenuItemSpec:: interface
112
- // The configuration object passed to the `MenuItem` constructor.
113
- //
114
- // run:: (EditorState, (Transaction), EditorView, dom.Event)
115
- // The function to execute when the menu item is activated.
116
- //
117
- // select:: ?(EditorState) → bool
118
- // Optional function that is used to determine whether the item is
119
- // appropriate at the moment. Deselected items will be hidden.
120
- //
121
- // enable:: ?(EditorState) → bool
122
- // Function that is used to determine if the item is enabled. If
123
- // given and returning false, the item will be given a disabled
124
- // styling.
125
- //
126
- // active:: ?(EditorState) → bool
127
- // A predicate function to determine whether the item is 'active' (for
128
- // example, the item for toggling the strong mark might be active then
129
- // the cursor is in strong text).
130
- //
131
- // render:: ?(EditorView) → dom.Node
132
- // A function that renders the item. You must provide either this,
133
- // [`icon`](#menu.MenuItemSpec.icon), or [`label`](#MenuItemSpec.label).
134
- //
135
- // icon:: ?Object
136
- // Describes an icon to show for this item. The object may specify
137
- // an SVG icon, in which case its `path` property should be an [SVG
138
- // path
139
- // spec](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d),
140
- // and `width` and `height` should provide the viewbox in which that
141
- // path exists. Alternatively, it may have a `text` property
142
- // specifying a string of text that makes up the icon, with an
143
- // optional `css` property giving additional CSS styling for the
144
- // text. _Or_ it may contain `dom` property containing a DOM node.
145
- //
146
- // label:: ?string
147
- // Makes the item show up as a text label. Mostly useful for items
148
- // wrapped in a [drop-down](#menu.Dropdown) or similar menu. The object
149
- // should have a `label` property providing the text to display.
150
- //
151
- // title:: ?union<string, (EditorState) → string>
152
- // Defines DOM title (mouseover) text for the item.
153
- //
154
- // class:: ?string
155
- // Optionally adds a CSS class to the item's DOM representation.
156
- //
157
- // css:: ?string
158
- // Optionally adds a string of inline CSS to the item's DOM
159
- // representation.
160
-
161
- var lastMenuEvent = {time: 0, node: null};
162
- function markMenuEvent(e) {
163
- lastMenuEvent.time = Date.now();
164
- lastMenuEvent.node = e.target;
165
- }
166
- function isMenuEvent(wrapper) {
167
- return Date.now() - 100 < lastMenuEvent.time &&
168
- lastMenuEvent.node && wrapper.contains(lastMenuEvent.node)
169
- }
170
-
171
- // ::- A drop-down menu, displayed as a label with a downwards-pointing
172
- // triangle to the right of it.
173
- var Dropdown = function Dropdown(content, options) {
174
- this.options = options || {};
175
- this.content = Array.isArray(content) ? content : [content];
176
- };
177
-
178
- // :: (EditorView) → {dom: dom.Node, update: (EditorState)}
179
- // Render the dropdown menu and sub-items.
180
- Dropdown.prototype.render = function render (view) {
181
- var this$1$1 = this;
182
-
183
- var content = renderDropdownItems(this.content, view);
184
-
185
- var label = crel("div", {class: prefix$1 + "-dropdown " + (this.options.class || ""),
186
- style: this.options.css},
187
- translate(view, this.options.label));
188
- if (this.options.title) { label.setAttribute("title", translate(view, this.options.title)); }
189
- var wrap = crel("div", {class: prefix$1 + "-dropdown-wrap"}, label);
190
- var open = null, listeningOnClose = null;
191
- var close = function () {
192
- if (open && open.close()) {
193
- open = null;
194
- window.removeEventListener("mousedown", listeningOnClose);
195
- }
196
- };
197
- label.addEventListener("mousedown", function (e) {
198
- e.preventDefault();
199
- markMenuEvent(e);
200
- if (open) {
201
- close();
202
- } else {
203
- open = this$1$1.expand(wrap, content.dom);
204
- window.addEventListener("mousedown", listeningOnClose = function () {
205
- if (!isMenuEvent(wrap)) { close(); }
206
- });
207
- }
208
- });
209
-
210
- function update(state) {
211
- var inner = content.update(state);
212
- wrap.style.display = inner ? "" : "none";
213
- return inner
214
- }
215
-
216
- return {dom: wrap, update: update}
217
- };
218
-
219
- Dropdown.prototype.expand = function expand (dom, items) {
220
- var menuDOM = crel("div", {class: prefix$1 + "-dropdown-menu " + (this.options.class || "")}, items);
221
-
222
- var done = false;
223
- function close() {
224
- if (done) { return }
225
- done = true;
226
- dom.removeChild(menuDOM);
227
- return true
228
- }
229
- dom.appendChild(menuDOM);
230
- return {close: close, node: menuDOM}
231
- };
232
-
233
- function renderDropdownItems(items, view) {
234
- var rendered = [], updates = [];
235
- for (var i = 0; i < items.length; i++) {
236
- var ref = items[i].render(view);
237
- var dom = ref.dom;
238
- var update = ref.update;
239
- rendered.push(crel("div", {class: prefix$1 + "-dropdown-item"}, dom));
240
- updates.push(update);
241
- }
242
- return {dom: rendered, update: combineUpdates(updates, rendered)}
243
- }
244
-
245
- function combineUpdates(updates, nodes) {
246
- return function (state) {
247
- var something = false;
248
- for (var i = 0; i < updates.length; i++) {
249
- var up = updates[i](state);
250
- nodes[i].style.display = up ? "" : "none";
251
- if (up) { something = true; }
252
- }
253
- return something
254
- }
255
- }
256
-
257
- // ::- Represents a submenu wrapping a group of elements that start
258
- // hidden and expand to the right when hovered over or tapped.
259
- var DropdownSubmenu = function DropdownSubmenu(content, options) {
260
- this.options = options || {};
261
- this.content = Array.isArray(content) ? content : [content];
262
- };
263
-
264
- // :: (EditorView) → {dom: dom.Node, update: (EditorState) → bool}
265
- // Renders the submenu.
266
- DropdownSubmenu.prototype.render = function render (view) {
267
- var items = renderDropdownItems(this.content, view);
268
-
269
- var label = crel("div", {class: prefix$1 + "-submenu-label"}, translate(view, this.options.label));
270
- var wrap = crel("div", {class: prefix$1 + "-submenu-wrap"}, label,
271
- crel("div", {class: prefix$1 + "-submenu"}, items.dom));
272
- var listeningOnClose = null;
273
- label.addEventListener("mousedown", function (e) {
274
- e.preventDefault();
275
- markMenuEvent(e);
276
- setClass(wrap, prefix$1 + "-submenu-wrap-active");
277
- if (!listeningOnClose)
278
- { window.addEventListener("mousedown", listeningOnClose = function () {
279
- if (!isMenuEvent(wrap)) {
280
- wrap.classList.remove(prefix$1 + "-submenu-wrap-active");
281
- window.removeEventListener("mousedown", listeningOnClose);
282
- listeningOnClose = null;
283
- }
284
- }); }
285
- });
286
-
287
- function update(state) {
288
- var inner = items.update(state);
289
- wrap.style.display = inner ? "" : "none";
290
- return inner
291
- }
292
- return {dom: wrap, update: update}
293
- };
294
-
295
- // :: (EditorView, [[MenuElement]]) → {dom: dom.DocumentFragment, update: (EditorState) → bool}
296
- // Render the given, possibly nested, array of menu elements into a
297
- // document fragment, placing separators between them (and ensuring no
298
- // superfluous separators appear when some of the groups turn out to
299
- // be empty).
300
- function renderGrouped(view, content) {
301
- var result = document.createDocumentFragment();
302
- var updates = [], separators = [];
303
- for (var i = 0; i < content.length; i++) {
304
- var items = content[i], localUpdates = [], localNodes = [];
305
- for (var j = 0; j < items.length; j++) {
306
- var ref = items[j].render(view);
307
- var dom = ref.dom;
308
- var update$1 = ref.update;
309
- var span = crel("span", {class: prefix$1 + "item"}, dom);
310
- result.appendChild(span);
311
- localNodes.push(span);
312
- localUpdates.push(update$1);
313
- }
314
- if (localUpdates.length) {
315
- updates.push(combineUpdates(localUpdates, localNodes));
316
- if (i < content.length - 1)
317
- { separators.push(result.appendChild(separator())); }
318
- }
319
- }
320
-
321
- function update(state) {
322
- var something = false, needSep = false;
323
- for (var i = 0; i < updates.length; i++) {
324
- var hasContent = updates[i](state);
325
- if (i) { separators[i - 1].style.display = needSep && hasContent ? "" : "none"; }
326
- needSep = hasContent;
327
- if (hasContent) { something = true; }
328
- }
329
- return something
330
- }
331
- return {dom: result, update: update}
332
- }
333
-
334
- function separator() {
335
- return crel("span", {class: prefix$1 + "separator"})
336
- }
337
-
338
- // :: Object
339
- // A set of basic editor-related icons. Contains the properties
340
- // `join`, `lift`, `selectParentNode`, `undo`, `redo`, `strong`, `em`,
341
- // `code`, `link`, `bulletList`, `orderedList`, and `blockquote`, each
342
- // holding an object that can be used as the `icon` option to
343
- // `MenuItem`.
344
- var icons = {
345
- join: {
346
- width: 800, height: 900,
347
- path: "M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z"
348
- },
349
- lift: {
350
- width: 1024, height: 1024,
351
- path: "M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z"
352
- },
353
- selectParentNode: {text: "\u2b1a", css: "font-weight: bold"},
354
- undo: {
355
- width: 1024, height: 1024,
356
- path: "M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z"
357
- },
358
- redo: {
359
- width: 1024, height: 1024,
360
- path: "M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z"
361
- },
362
- strong: {
363
- width: 805, height: 1024,
364
- path: "M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z"
365
- },
366
- em: {
367
- width: 585, height: 1024,
368
- path: "M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z"
369
- },
370
- code: {
371
- width: 896, height: 1024,
372
- path: "M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z"
373
- },
374
- link: {
375
- width: 951, height: 1024,
376
- path: "M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z"
377
- },
378
- bulletList: {
379
- width: 768, height: 896,
380
- path: "M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z"
381
- },
382
- orderedList: {
383
- width: 768, height: 896,
384
- path: "M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z"
385
- },
386
- blockquote: {
387
- width: 640, height: 896,
388
- path: "M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z"
389
- }
390
- };
391
-
392
- // :: MenuItem
393
- // Menu item for the `joinUp` command.
394
- var joinUpItem = new MenuItem({
395
- title: "Join with above block",
396
- run: joinUp,
397
- select: function (state) { return joinUp(state); },
398
- icon: icons.join
399
- });
400
-
401
- // :: MenuItem
402
- // Menu item for the `lift` command.
403
- var liftItem = new MenuItem({
404
- title: "Lift out of enclosing block",
405
- run: lift,
406
- select: function (state) { return lift(state); },
407
- icon: icons.lift
408
- });
409
-
410
- // :: MenuItem
411
- // Menu item for the `selectParentNode` command.
412
- var selectParentNodeItem = new MenuItem({
413
- title: "Select parent node",
414
- run: selectParentNode,
415
- select: function (state) { return selectParentNode(state); },
416
- icon: icons.selectParentNode
417
- });
418
-
419
- // :: MenuItem
420
- // Menu item for the `undo` command.
421
- var undoItem = new MenuItem({
422
- title: "Undo last change",
423
- run: undo,
424
- enable: function (state) { return undo(state); },
425
- icon: icons.undo
426
- });
427
-
428
- // :: MenuItem
429
- // Menu item for the `redo` command.
430
- var redoItem = new MenuItem({
431
- title: "Redo last undone change",
432
- run: redo,
433
- enable: function (state) { return redo(state); },
434
- icon: icons.redo
435
- });
436
-
437
- // :: (NodeType, Object) → MenuItem
438
- // Build a menu item for wrapping the selection in a given node type.
439
- // Adds `run` and `select` properties to the ones present in
440
- // `options`. `options.attrs` may be an object or a function.
441
- function wrapItem(nodeType, options) {
442
- var passedOptions = {
443
- run: function run(state, dispatch) {
444
- // FIXME if (options.attrs instanceof Function) options.attrs(state, attrs => wrapIn(nodeType, attrs)(state))
445
- return wrapIn(nodeType, options.attrs)(state, dispatch)
446
- },
447
- select: function select(state) {
448
- return wrapIn(nodeType, options.attrs instanceof Function ? null : options.attrs)(state)
449
- }
450
- };
451
- for (var prop in options) { passedOptions[prop] = options[prop]; }
452
- return new MenuItem(passedOptions)
453
- }
454
-
455
- // :: (NodeType, Object) → MenuItem
456
- // Build a menu item for changing the type of the textblock around the
457
- // selection to the given type. Provides `run`, `active`, and `select`
458
- // properties. Others must be given in `options`. `options.attrs` may
459
- // be an object to provide the attributes for the textblock node.
460
- function blockTypeItem(nodeType, options) {
461
- var command = setBlockType(nodeType, options.attrs);
462
- var passedOptions = {
463
- run: command,
464
- enable: function enable(state) { return command(state) },
465
- active: function active(state) {
466
- var ref = state.selection;
467
- var $from = ref.$from;
468
- var to = ref.to;
469
- var node = ref.node;
470
- if (node) { return node.hasMarkup(nodeType, options.attrs) }
471
- return to <= $from.end() && $from.parent.hasMarkup(nodeType, options.attrs)
472
- }
473
- };
474
- for (var prop in options) { passedOptions[prop] = options[prop]; }
475
- return new MenuItem(passedOptions)
476
- }
477
-
478
- // Work around classList.toggle being broken in IE11
479
- function setClass(dom, cls, on) {
480
- if (on) { dom.classList.add(cls); }
481
- else { dom.classList.remove(cls); }
482
- }
483
-
484
- var prefix = "ProseMirror-menubar";
485
-
486
- function isIOS() {
487
- if (typeof navigator == "undefined") { return false }
488
- var agent = navigator.userAgent;
489
- return !/Edge\/\d/.test(agent) && /AppleWebKit/.test(agent) && /Mobile\/\w+/.test(agent)
490
- }
491
-
492
- // :: (Object) → Plugin
493
- // A plugin that will place a menu bar above the editor. Note that
494
- // this involves wrapping the editor in an additional `<div>`.
495
- //
496
- // options::-
497
- // Supports the following options:
498
- //
499
- // content:: [[MenuElement]]
500
- // Provides the content of the menu, as a nested array to be
501
- // passed to `renderGrouped`.
502
- //
503
- // floating:: ?bool
504
- // Determines whether the menu floats, i.e. whether it sticks to
505
- // the top of the viewport when the editor is partially scrolled
506
- // out of view.
507
- function menuBar(options) {
508
- return new Plugin({
509
- view: function view(editorView) { return new MenuBarView(editorView, options) }
510
- })
511
- }
512
-
513
- var MenuBarView = function MenuBarView(editorView, options) {
514
- var this$1$1 = this;
515
-
516
- this.editorView = editorView;
517
- this.options = options;
518
-
519
- this.wrapper = crel("div", {class: prefix + "-wrapper"});
520
- this.menu = this.wrapper.appendChild(crel("div", {class: prefix}));
521
- this.menu.className = prefix;
522
- this.spacer = null;
523
-
524
- if (editorView.dom.parentNode)
525
- { editorView.dom.parentNode.replaceChild(this.wrapper, editorView.dom); }
526
- this.wrapper.appendChild(editorView.dom);
527
-
528
- this.maxHeight = 0;
529
- this.widthForMaxHeight = 0;
530
- this.floating = false;
531
-
532
- var ref = renderGrouped(this.editorView, this.options.content);
533
- var dom = ref.dom;
534
- var update = ref.update;
535
- this.contentUpdate = update;
536
- this.menu.appendChild(dom);
537
- this.update();
538
-
539
- if (options.floating && !isIOS()) {
540
- this.updateFloat();
541
- var potentialScrollers = getAllWrapping(this.wrapper);
542
- this.scrollFunc = function (e) {
543
- var root = this$1$1.editorView.root;
544
- if (!(root.body || root).contains(this$1$1.wrapper)) {
545
- potentialScrollers.forEach(function (el) { return el.removeEventListener("scroll", this$1$1.scrollFunc); });
546
- } else {
547
- this$1$1.updateFloat(e.target.getBoundingClientRect && e.target);
548
- }
549
- };
550
- potentialScrollers.forEach(function (el) { return el.addEventListener('scroll', this$1$1.scrollFunc); });
551
- }
552
- };
553
-
554
- MenuBarView.prototype.update = function update () {
555
- this.contentUpdate(this.editorView.state);
556
-
557
- if (this.floating) {
558
- this.updateScrollCursor();
559
- } else {
560
- if (this.menu.offsetWidth != this.widthForMaxHeight) {
561
- this.widthForMaxHeight = this.menu.offsetWidth;
562
- this.maxHeight = 0;
563
- }
564
- if (this.menu.offsetHeight > this.maxHeight) {
565
- this.maxHeight = this.menu.offsetHeight;
566
- this.menu.style.minHeight = this.maxHeight + "px";
567
- }
568
- }
569
- };
570
-
571
- MenuBarView.prototype.updateScrollCursor = function updateScrollCursor () {
572
- var selection = this.editorView.root.getSelection();
573
- if (!selection.focusNode) { return }
574
- var rects = selection.getRangeAt(0).getClientRects();
575
- var selRect = rects[selectionIsInverted(selection) ? 0 : rects.length - 1];
576
- if (!selRect) { return }
577
- var menuRect = this.menu.getBoundingClientRect();
578
- if (selRect.top < menuRect.bottom && selRect.bottom > menuRect.top) {
579
- var scrollable = findWrappingScrollable(this.wrapper);
580
- if (scrollable) { scrollable.scrollTop -= (menuRect.bottom - selRect.top); }
581
- }
582
- };
583
-
584
- MenuBarView.prototype.updateFloat = function updateFloat (scrollAncestor) {
585
- var parent = this.wrapper, editorRect = parent.getBoundingClientRect(),
586
- top = scrollAncestor ? Math.max(0, scrollAncestor.getBoundingClientRect().top) : 0;
587
-
588
- if (this.floating) {
589
- if (editorRect.top >= top || editorRect.bottom < this.menu.offsetHeight + 10) {
590
- this.floating = false;
591
- this.menu.style.position = this.menu.style.left = this.menu.style.top = this.menu.style.width = "";
592
- this.menu.style.display = "";
593
- this.spacer.parentNode.removeChild(this.spacer);
594
- this.spacer = null;
595
- } else {
596
- var border = (parent.offsetWidth - parent.clientWidth) / 2;
597
- this.menu.style.left = (editorRect.left + border) + "px";
598
- this.menu.style.display = (editorRect.top > window.innerHeight ? "none" : "");
599
- if (scrollAncestor) { this.menu.style.top = top + "px"; }
600
- }
601
- } else {
602
- if (editorRect.top < top && editorRect.bottom >= this.menu.offsetHeight + 10) {
603
- this.floating = true;
604
- var menuRect = this.menu.getBoundingClientRect();
605
- this.menu.style.left = menuRect.left + "px";
606
- this.menu.style.width = menuRect.width + "px";
607
- if (scrollAncestor) { this.menu.style.top = top + "px"; }
608
- this.menu.style.position = "fixed";
609
- this.spacer = crel("div", {class: prefix + "-spacer", style: ("height: " + (menuRect.height) + "px")});
610
- parent.insertBefore(this.spacer, this.menu);
611
- }
612
- }
613
- };
614
-
615
- MenuBarView.prototype.destroy = function destroy () {
616
- if (this.wrapper.parentNode)
617
- { this.wrapper.parentNode.replaceChild(this.editorView.dom, this.wrapper); }
618
- };
619
-
620
- // Not precise, but close enough
621
- function selectionIsInverted(selection) {
622
- if (selection.anchorNode == selection.focusNode) { return selection.anchorOffset > selection.focusOffset }
623
- return selection.anchorNode.compareDocumentPosition(selection.focusNode) == Node.DOCUMENT_POSITION_FOLLOWING
624
- }
625
-
626
- function findWrappingScrollable(node) {
627
- for (var cur = node.parentNode; cur; cur = cur.parentNode)
628
- { if (cur.scrollHeight > cur.clientHeight) { return cur } }
629
- }
630
-
631
- function getAllWrapping(node) {
632
- var res = [window];
633
- for (var cur = node.parentNode; cur; cur = cur.parentNode)
634
- { res.push(cur); }
635
- return res
636
- }
637
-
638
- export { Dropdown, DropdownSubmenu, MenuItem, blockTypeItem, icons, joinUpItem, liftItem, menuBar, redoItem, renderGrouped, selectParentNodeItem, undoItem, wrapItem };
639
- //# sourceMappingURL=index.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/icons.js","../src/menu.js","../src/menubar.js"],"sourcesContent":["const SVG = \"http://www.w3.org/2000/svg\"\nconst XLINK = \"http://www.w3.org/1999/xlink\"\n\nconst prefix = \"ProseMirror-icon\"\n\nfunction hashPath(path) {\n let hash = 0\n for (let i = 0; i < path.length; i++)\n hash = (((hash << 5) - hash) + path.charCodeAt(i)) | 0\n return hash\n}\n\nexport function getIcon(icon) {\n let node = document.createElement(\"div\")\n node.className = prefix\n if (icon.path) {\n let name = \"pm-icon-\" + hashPath(icon.path).toString(16)\n if (!document.getElementById(name)) buildSVG(name, icon)\n let svg = node.appendChild(document.createElementNS(SVG, \"svg\"))\n svg.style.width = (icon.width / icon.height) + \"em\"\n let use = svg.appendChild(document.createElementNS(SVG, \"use\"))\n use.setAttributeNS(XLINK, \"href\", /([^#]*)/.exec(document.location)[1] + \"#\" + name)\n } else if (icon.dom) {\n node.appendChild(icon.dom.cloneNode(true))\n } else {\n node.appendChild(document.createElement(\"span\")).textContent = icon.text || ''\n if (icon.css) node.firstChild.style.cssText = icon.css\n }\n return node\n}\n\nfunction buildSVG(name, data) {\n let collection = document.getElementById(prefix + \"-collection\")\n if (!collection) {\n collection = document.createElementNS(SVG, \"svg\")\n collection.id = prefix + \"-collection\"\n collection.style.display = \"none\"\n document.body.insertBefore(collection, document.body.firstChild)\n }\n let sym = document.createElementNS(SVG, \"symbol\")\n sym.id = name\n sym.setAttribute(\"viewBox\", \"0 0 \" + data.width + \" \" + data.height)\n let path = sym.appendChild(document.createElementNS(SVG, \"path\"))\n path.setAttribute(\"d\", data.path)\n collection.appendChild(sym)\n}\n","import crel from \"crelt\"\nimport {lift, joinUp, selectParentNode, wrapIn, setBlockType} from \"prosemirror-commands\"\nimport {undo, redo} from \"prosemirror-history\"\n\nimport {getIcon} from \"./icons\"\n\nconst prefix = \"ProseMirror-menu\"\n\n// ::- An icon or label that, when clicked, executes a command.\nexport class MenuItem {\n // :: (MenuItemSpec)\n constructor(spec) {\n // :: MenuItemSpec\n // The spec used to create the menu item.\n this.spec = spec\n }\n\n // :: (EditorView) → {dom: dom.Node, update: (EditorState) → bool}\n // Renders the icon according to its [display\n // spec](#menu.MenuItemSpec.display), and adds an event handler which\n // executes the command when the representation is clicked.\n render(view) {\n let spec = this.spec\n let dom = spec.render ? spec.render(view)\n : spec.icon ? getIcon(spec.icon)\n : spec.label ? crel(\"div\", null, translate(view, spec.label))\n : null\n if (!dom) throw new RangeError(\"MenuItem without icon or label property\")\n if (spec.title) {\n const title = (typeof spec.title === \"function\" ? spec.title(view.state) : spec.title)\n dom.setAttribute(\"title\", translate(view, title))\n }\n if (spec.class) dom.classList.add(spec.class)\n if (spec.css) dom.style.cssText += spec.css\n\n dom.addEventListener(\"mousedown\", e => {\n e.preventDefault()\n if (!dom.classList.contains(prefix + \"-disabled\"))\n spec.run(view.state, view.dispatch, view, e)\n })\n\n function update(state) {\n if (spec.select) {\n let selected = spec.select(state)\n dom.style.display = selected ? \"\" : \"none\"\n if (!selected) return false\n }\n let enabled = true\n if (spec.enable) {\n enabled = spec.enable(state) || false\n setClass(dom, prefix + \"-disabled\", !enabled)\n }\n if (spec.active) {\n let active = enabled && spec.active(state) || false\n setClass(dom, prefix + \"-active\", active)\n }\n return true\n }\n\n return {dom, update}\n }\n}\n\nfunction translate(view, text) {\n return view._props.translate ? view._props.translate(text) : text\n}\n\n// MenuItemSpec:: interface\n// The configuration object passed to the `MenuItem` constructor.\n//\n// run:: (EditorState, (Transaction), EditorView, dom.Event)\n// The function to execute when the menu item is activated.\n//\n// select:: ?(EditorState) → bool\n// Optional function that is used to determine whether the item is\n// appropriate at the moment. Deselected items will be hidden.\n//\n// enable:: ?(EditorState) → bool\n// Function that is used to determine if the item is enabled. If\n// given and returning false, the item will be given a disabled\n// styling.\n//\n// active:: ?(EditorState) → bool\n// A predicate function to determine whether the item is 'active' (for\n// example, the item for toggling the strong mark might be active then\n// the cursor is in strong text).\n//\n// render:: ?(EditorView) → dom.Node\n// A function that renders the item. You must provide either this,\n// [`icon`](#menu.MenuItemSpec.icon), or [`label`](#MenuItemSpec.label).\n//\n// icon:: ?Object\n// Describes an icon to show for this item. The object may specify\n// an SVG icon, in which case its `path` property should be an [SVG\n// path\n// spec](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d),\n// and `width` and `height` should provide the viewbox in which that\n// path exists. Alternatively, it may have a `text` property\n// specifying a string of text that makes up the icon, with an\n// optional `css` property giving additional CSS styling for the\n// text. _Or_ it may contain `dom` property containing a DOM node.\n//\n// label:: ?string\n// Makes the item show up as a text label. Mostly useful for items\n// wrapped in a [drop-down](#menu.Dropdown) or similar menu. The object\n// should have a `label` property providing the text to display.\n//\n// title:: ?union<string, (EditorState) → string>\n// Defines DOM title (mouseover) text for the item.\n//\n// class:: ?string\n// Optionally adds a CSS class to the item's DOM representation.\n//\n// css:: ?string\n// Optionally adds a string of inline CSS to the item's DOM\n// representation.\n\nlet lastMenuEvent = {time: 0, node: null}\nfunction markMenuEvent(e) {\n lastMenuEvent.time = Date.now()\n lastMenuEvent.node = e.target\n}\nfunction isMenuEvent(wrapper) {\n return Date.now() - 100 < lastMenuEvent.time &&\n lastMenuEvent.node && wrapper.contains(lastMenuEvent.node)\n}\n\n// ::- A drop-down menu, displayed as a label with a downwards-pointing\n// triangle to the right of it.\nexport class Dropdown {\n // :: ([MenuElement], ?Object)\n // Create a dropdown wrapping the elements. Options may include\n // the following properties:\n //\n // **`label`**`: string`\n // : The label to show on the drop-down control.\n //\n // **`title`**`: string`\n // : Sets the\n // [`title`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title)\n // attribute given to the menu control.\n //\n // **`class`**`: string`\n // : When given, adds an extra CSS class to the menu control.\n //\n // **`css`**`: string`\n // : When given, adds an extra set of CSS styles to the menu control.\n constructor(content, options) {\n this.options = options || {}\n this.content = Array.isArray(content) ? content : [content]\n }\n\n // :: (EditorView) → {dom: dom.Node, update: (EditorState)}\n // Render the dropdown menu and sub-items.\n render(view) {\n let content = renderDropdownItems(this.content, view)\n\n let label = crel(\"div\", {class: prefix + \"-dropdown \" + (this.options.class || \"\"),\n style: this.options.css},\n translate(view, this.options.label))\n if (this.options.title) label.setAttribute(\"title\", translate(view, this.options.title))\n let wrap = crel(\"div\", {class: prefix + \"-dropdown-wrap\"}, label)\n let open = null, listeningOnClose = null\n let close = () => {\n if (open && open.close()) {\n open = null\n window.removeEventListener(\"mousedown\", listeningOnClose)\n }\n }\n label.addEventListener(\"mousedown\", e => {\n e.preventDefault()\n markMenuEvent(e)\n if (open) {\n close()\n } else {\n open = this.expand(wrap, content.dom)\n window.addEventListener(\"mousedown\", listeningOnClose = () => {\n if (!isMenuEvent(wrap)) close()\n })\n }\n })\n\n function update(state) {\n let inner = content.update(state)\n wrap.style.display = inner ? \"\" : \"none\"\n return inner\n }\n\n return {dom: wrap, update}\n }\n\n expand(dom, items) {\n let menuDOM = crel(\"div\", {class: prefix + \"-dropdown-menu \" + (this.options.class || \"\")}, items)\n\n let done = false\n function close() {\n if (done) return\n done = true\n dom.removeChild(menuDOM)\n return true\n }\n dom.appendChild(menuDOM)\n return {close, node: menuDOM}\n }\n}\n\nfunction renderDropdownItems(items, view) {\n let rendered = [], updates = []\n for (let i = 0; i < items.length; i++) {\n let {dom, update} = items[i].render(view)\n rendered.push(crel(\"div\", {class: prefix + \"-dropdown-item\"}, dom))\n updates.push(update)\n }\n return {dom: rendered, update: combineUpdates(updates, rendered)}\n}\n\nfunction combineUpdates(updates, nodes) {\n return state => {\n let something = false\n for (let i = 0; i < updates.length; i++) {\n let up = updates[i](state)\n nodes[i].style.display = up ? \"\" : \"none\"\n if (up) something = true\n }\n return something\n }\n}\n\n// ::- Represents a submenu wrapping a group of elements that start\n// hidden and expand to the right when hovered over or tapped.\nexport class DropdownSubmenu {\n // :: ([MenuElement], ?Object)\n // Creates a submenu for the given group of menu elements. The\n // following options are recognized:\n //\n // **`label`**`: string`\n // : The label to show on the submenu.\n constructor(content, options) {\n this.options = options || {}\n this.content = Array.isArray(content) ? content : [content]\n }\n\n // :: (EditorView) → {dom: dom.Node, update: (EditorState) → bool}\n // Renders the submenu.\n render(view) {\n let items = renderDropdownItems(this.content, view)\n\n let label = crel(\"div\", {class: prefix + \"-submenu-label\"}, translate(view, this.options.label))\n let wrap = crel(\"div\", {class: prefix + \"-submenu-wrap\"}, label,\n crel(\"div\", {class: prefix + \"-submenu\"}, items.dom))\n let listeningOnClose = null\n label.addEventListener(\"mousedown\", e => {\n e.preventDefault()\n markMenuEvent(e)\n setClass(wrap, prefix + \"-submenu-wrap-active\")\n if (!listeningOnClose)\n window.addEventListener(\"mousedown\", listeningOnClose = () => {\n if (!isMenuEvent(wrap)) {\n wrap.classList.remove(prefix + \"-submenu-wrap-active\")\n window.removeEventListener(\"mousedown\", listeningOnClose)\n listeningOnClose = null\n }\n })\n })\n\n function update(state) {\n let inner = items.update(state)\n wrap.style.display = inner ? \"\" : \"none\"\n return inner\n }\n return {dom: wrap, update}\n }\n}\n\n// :: (EditorView, [[MenuElement]]) → {dom: dom.DocumentFragment, update: (EditorState) → bool}\n// Render the given, possibly nested, array of menu elements into a\n// document fragment, placing separators between them (and ensuring no\n// superfluous separators appear when some of the groups turn out to\n// be empty).\nexport function renderGrouped(view, content) {\n let result = document.createDocumentFragment()\n let updates = [], separators = []\n for (let i = 0; i < content.length; i++) {\n let items = content[i], localUpdates = [], localNodes = []\n for (let j = 0; j < items.length; j++) {\n let {dom, update} = items[j].render(view)\n let span = crel(\"span\", {class: prefix + \"item\"}, dom)\n result.appendChild(span)\n localNodes.push(span)\n localUpdates.push(update)\n }\n if (localUpdates.length) {\n updates.push(combineUpdates(localUpdates, localNodes))\n if (i < content.length - 1)\n separators.push(result.appendChild(separator()))\n }\n }\n\n function update(state) {\n let something = false, needSep = false\n for (let i = 0; i < updates.length; i++) {\n let hasContent = updates[i](state)\n if (i) separators[i - 1].style.display = needSep && hasContent ? \"\" : \"none\"\n needSep = hasContent\n if (hasContent) something = true\n }\n return something\n }\n return {dom: result, update}\n}\n\nfunction separator() {\n return crel(\"span\", {class: prefix + \"separator\"})\n}\n\n// :: Object\n// A set of basic editor-related icons. Contains the properties\n// `join`, `lift`, `selectParentNode`, `undo`, `redo`, `strong`, `em`,\n// `code`, `link`, `bulletList`, `orderedList`, and `blockquote`, each\n// holding an object that can be used as the `icon` option to\n// `MenuItem`.\nexport const icons = {\n join: {\n width: 800, height: 900,\n path: \"M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z\"\n },\n lift: {\n width: 1024, height: 1024,\n path: \"M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z\"\n },\n selectParentNode: {text: \"\\u2b1a\", css: \"font-weight: bold\"},\n undo: {\n width: 1024, height: 1024,\n path: \"M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z\"\n },\n redo: {\n width: 1024, height: 1024,\n path: \"M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z\"\n },\n strong: {\n width: 805, height: 1024,\n path: \"M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z\"\n },\n em: {\n width: 585, height: 1024,\n path: \"M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z\"\n },\n code: {\n width: 896, height: 1024,\n path: \"M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z\"\n },\n link: {\n width: 951, height: 1024,\n path: \"M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z\"\n },\n bulletList: {\n width: 768, height: 896,\n path: \"M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z\"\n },\n orderedList: {\n width: 768, height: 896,\n path: \"M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z\"\n },\n blockquote: {\n width: 640, height: 896,\n path: \"M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z\"\n }\n}\n\n// :: MenuItem\n// Menu item for the `joinUp` command.\nexport const joinUpItem = new MenuItem({\n title: \"Join with above block\",\n run: joinUp,\n select: state => joinUp(state),\n icon: icons.join\n})\n\n// :: MenuItem\n// Menu item for the `lift` command.\nexport const liftItem = new MenuItem({\n title: \"Lift out of enclosing block\",\n run: lift,\n select: state => lift(state),\n icon: icons.lift\n})\n\n// :: MenuItem\n// Menu item for the `selectParentNode` command.\nexport const selectParentNodeItem = new MenuItem({\n title: \"Select parent node\",\n run: selectParentNode,\n select: state => selectParentNode(state),\n icon: icons.selectParentNode\n})\n\n// :: MenuItem\n// Menu item for the `undo` command.\nexport let undoItem = new MenuItem({\n title: \"Undo last change\",\n run: undo,\n enable: state => undo(state),\n icon: icons.undo\n})\n\n// :: MenuItem\n// Menu item for the `redo` command.\nexport let redoItem = new MenuItem({\n title: \"Redo last undone change\",\n run: redo,\n enable: state => redo(state),\n icon: icons.redo\n})\n\n// :: (NodeType, Object) → MenuItem\n// Build a menu item for wrapping the selection in a given node type.\n// Adds `run` and `select` properties to the ones present in\n// `options`. `options.attrs` may be an object or a function.\nexport function wrapItem(nodeType, options) {\n let passedOptions = {\n run(state, dispatch) {\n // FIXME if (options.attrs instanceof Function) options.attrs(state, attrs => wrapIn(nodeType, attrs)(state))\n return wrapIn(nodeType, options.attrs)(state, dispatch)\n },\n select(state) {\n return wrapIn(nodeType, options.attrs instanceof Function ? null : options.attrs)(state)\n }\n }\n for (let prop in options) passedOptions[prop] = options[prop]\n return new MenuItem(passedOptions)\n}\n\n// :: (NodeType, Object) → MenuItem\n// Build a menu item for changing the type of the textblock around the\n// selection to the given type. Provides `run`, `active`, and `select`\n// properties. Others must be given in `options`. `options.attrs` may\n// be an object to provide the attributes for the textblock node.\nexport function blockTypeItem(nodeType, options) {\n let command = setBlockType(nodeType, options.attrs)\n let passedOptions = {\n run: command,\n enable(state) { return command(state) },\n active(state) {\n let {$from, to, node} = state.selection\n if (node) return node.hasMarkup(nodeType, options.attrs)\n return to <= $from.end() && $from.parent.hasMarkup(nodeType, options.attrs)\n }\n }\n for (let prop in options) passedOptions[prop] = options[prop]\n return new MenuItem(passedOptions)\n}\n\n// Work around classList.toggle being broken in IE11\nfunction setClass(dom, cls, on) {\n if (on) dom.classList.add(cls)\n else dom.classList.remove(cls)\n}\n","import crel from \"crelt\"\nimport {Plugin} from \"prosemirror-state\"\n\nimport {renderGrouped} from \"./menu\"\n\nconst prefix = \"ProseMirror-menubar\"\n\nfunction isIOS() {\n if (typeof navigator == \"undefined\") return false\n let agent = navigator.userAgent\n return !/Edge\\/\\d/.test(agent) && /AppleWebKit/.test(agent) && /Mobile\\/\\w+/.test(agent)\n}\n\n// :: (Object) → Plugin\n// A plugin that will place a menu bar above the editor. Note that\n// this involves wrapping the editor in an additional `<div>`.\n//\n// options::-\n// Supports the following options:\n//\n// content:: [[MenuElement]]\n// Provides the content of the menu, as a nested array to be\n// passed to `renderGrouped`.\n//\n// floating:: ?bool\n// Determines whether the menu floats, i.e. whether it sticks to\n// the top of the viewport when the editor is partially scrolled\n// out of view.\nexport function menuBar(options) {\n return new Plugin({\n view(editorView) { return new MenuBarView(editorView, options) }\n })\n}\n\nclass MenuBarView {\n constructor(editorView, options) {\n this.editorView = editorView\n this.options = options\n\n this.wrapper = crel(\"div\", {class: prefix + \"-wrapper\"})\n this.menu = this.wrapper.appendChild(crel(\"div\", {class: prefix}))\n this.menu.className = prefix\n this.spacer = null\n\n if (editorView.dom.parentNode)\n editorView.dom.parentNode.replaceChild(this.wrapper, editorView.dom)\n this.wrapper.appendChild(editorView.dom)\n\n this.maxHeight = 0\n this.widthForMaxHeight = 0\n this.floating = false\n\n let {dom, update} = renderGrouped(this.editorView, this.options.content)\n this.contentUpdate = update\n this.menu.appendChild(dom)\n this.update()\n\n if (options.floating && !isIOS()) {\n this.updateFloat()\n let potentialScrollers = getAllWrapping(this.wrapper)\n this.scrollFunc = (e) => {\n let root = this.editorView.root\n if (!(root.body || root).contains(this.wrapper)) {\n potentialScrollers.forEach(el => el.removeEventListener(\"scroll\", this.scrollFunc))\n } else {\n this.updateFloat(e.target.getBoundingClientRect && e.target)\n }\n }\n potentialScrollers.forEach(el => el.addEventListener('scroll', this.scrollFunc))\n }\n }\n\n update() {\n this.contentUpdate(this.editorView.state)\n\n if (this.floating) {\n this.updateScrollCursor()\n } else {\n if (this.menu.offsetWidth != this.widthForMaxHeight) {\n this.widthForMaxHeight = this.menu.offsetWidth\n this.maxHeight = 0\n }\n if (this.menu.offsetHeight > this.maxHeight) {\n this.maxHeight = this.menu.offsetHeight\n this.menu.style.minHeight = this.maxHeight + \"px\"\n }\n }\n }\n\n updateScrollCursor() {\n let selection = this.editorView.root.getSelection()\n if (!selection.focusNode) return\n let rects = selection.getRangeAt(0).getClientRects()\n let selRect = rects[selectionIsInverted(selection) ? 0 : rects.length - 1]\n if (!selRect) return\n let menuRect = this.menu.getBoundingClientRect()\n if (selRect.top < menuRect.bottom && selRect.bottom > menuRect.top) {\n let scrollable = findWrappingScrollable(this.wrapper)\n if (scrollable) scrollable.scrollTop -= (menuRect.bottom - selRect.top)\n }\n }\n\n updateFloat(scrollAncestor) {\n let parent = this.wrapper, editorRect = parent.getBoundingClientRect(),\n top = scrollAncestor ? Math.max(0, scrollAncestor.getBoundingClientRect().top) : 0\n\n if (this.floating) {\n if (editorRect.top >= top || editorRect.bottom < this.menu.offsetHeight + 10) {\n this.floating = false\n this.menu.style.position = this.menu.style.left = this.menu.style.top = this.menu.style.width = \"\"\n this.menu.style.display = \"\"\n this.spacer.parentNode.removeChild(this.spacer)\n this.spacer = null\n } else {\n let border = (parent.offsetWidth - parent.clientWidth) / 2\n this.menu.style.left = (editorRect.left + border) + \"px\"\n this.menu.style.display = (editorRect.top > window.innerHeight ? \"none\" : \"\")\n if (scrollAncestor) this.menu.style.top = top + \"px\"\n }\n } else {\n if (editorRect.top < top && editorRect.bottom >= this.menu.offsetHeight + 10) {\n this.floating = true\n let menuRect = this.menu.getBoundingClientRect()\n this.menu.style.left = menuRect.left + \"px\"\n this.menu.style.width = menuRect.width + \"px\"\n if (scrollAncestor) this.menu.style.top = top + \"px\"\n this.menu.style.position = \"fixed\"\n this.spacer = crel(\"div\", {class: prefix + \"-spacer\", style: `height: ${menuRect.height}px`})\n parent.insertBefore(this.spacer, this.menu)\n }\n }\n }\n\n destroy() {\n if (this.wrapper.parentNode)\n this.wrapper.parentNode.replaceChild(this.editorView.dom, this.wrapper)\n }\n}\n\n// Not precise, but close enough\nfunction selectionIsInverted(selection) {\n if (selection.anchorNode == selection.focusNode) return selection.anchorOffset > selection.focusOffset\n return selection.anchorNode.compareDocumentPosition(selection.focusNode) == Node.DOCUMENT_POSITION_FOLLOWING\n}\n\nfunction findWrappingScrollable(node) {\n for (let cur = node.parentNode; cur; cur = cur.parentNode)\n if (cur.scrollHeight > cur.clientHeight) return cur\n}\n\nfunction getAllWrapping(node) {\n let res = [window]\n for (let cur = node.parentNode; cur; cur = cur.parentNode)\n res.push(cur)\n return res\n}\n"],"names":["const","prefix","let","this","update"],"mappings":";;;;;AAAAA,IAAM,GAAG,GAAG,6BAA4B;AACxCA,IAAM,KAAK,GAAG,+BAA8B;AAC5C;AACAA,IAAMC,QAAM,GAAG,mBAAkB;AACjC;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE;AACxB,EAAEC,IAAI,IAAI,GAAG,EAAC;AACd,EAAE,KAAKA,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;AACtC,IAAI,EAAA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A,IAAI,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,UAAU;AAC7D,QAAA,EAAQ,GAAG,CAAC,IAAI,CAAC,GAAG,EAAC,EAAA;AACrB,IAAI,OAAO,GAAG;AACd;;;;"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/icons.js","../src/menu.js","../src/menubar.js"],"sourcesContent":["const SVG = \"http://www.w3.org/2000/svg\"\nconst XLINK = \"http://www.w3.org/1999/xlink\"\n\nconst prefix = \"ProseMirror-icon\"\n\nfunction hashPath(path) {\n let hash = 0\n for (let i = 0; i < path.length; i++)\n hash = (((hash << 5) - hash) + path.charCodeAt(i)) | 0\n return hash\n}\n\nexport function getIcon(icon) {\n let node = document.createElement(\"div\")\n node.className = prefix\n if (icon.path) {\n let name = \"pm-icon-\" + hashPath(icon.path).toString(16)\n if (!document.getElementById(name)) buildSVG(name, icon)\n let svg = node.appendChild(document.createElementNS(SVG, \"svg\"))\n svg.style.width = (icon.width / icon.height) + \"em\"\n let use = svg.appendChild(document.createElementNS(SVG, \"use\"))\n use.setAttributeNS(XLINK, \"href\", /([^#]*)/.exec(document.location)[1] + \"#\" + name)\n } else if (icon.dom) {\n node.appendChild(icon.dom.cloneNode(true))\n } else {\n node.appendChild(document.createElement(\"span\")).textContent = icon.text || ''\n if (icon.css) node.firstChild.style.cssText = icon.css\n }\n return node\n}\n\nfunction buildSVG(name, data) {\n let collection = document.getElementById(prefix + \"-collection\")\n if (!collection) {\n collection = document.createElementNS(SVG, \"svg\")\n collection.id = prefix + \"-collection\"\n collection.style.display = \"none\"\n document.body.insertBefore(collection, document.body.firstChild)\n }\n let sym = document.createElementNS(SVG, \"symbol\")\n sym.id = name\n sym.setAttribute(\"viewBox\", \"0 0 \" + data.width + \" \" + data.height)\n let path = sym.appendChild(document.createElementNS(SVG, \"path\"))\n path.setAttribute(\"d\", data.path)\n collection.appendChild(sym)\n}\n","import crel from \"crelt\"\nimport {lift, joinUp, selectParentNode, wrapIn, setBlockType} from \"prosemirror-commands\"\nimport {undo, redo} from \"prosemirror-history\"\n\nimport {getIcon} from \"./icons\"\n\nconst prefix = \"ProseMirror-menu\"\n\n// ::- An icon or label that, when clicked, executes a command.\nexport class MenuItem {\n // :: (MenuItemSpec)\n constructor(spec) {\n // :: MenuItemSpec\n // The spec used to create the menu item.\n this.spec = spec\n }\n\n // :: (EditorView) → {dom: dom.Node, update: (EditorState) → bool}\n // Renders the icon according to its [display\n // spec](#menu.MenuItemSpec.display), and adds an event handler which\n // executes the command when the representation is clicked.\n render(view) {\n let spec = this.spec\n let dom = spec.render ? spec.render(view)\n : spec.icon ? getIcon(spec.icon)\n : spec.label ? crel(\"div\", null, translate(view, spec.label))\n : null\n if (!dom) throw new RangeError(\"MenuItem without icon or label property\")\n if (spec.title) {\n const title = (typeof spec.title === \"function\" ? spec.title(view.state) : spec.title)\n dom.setAttribute(\"title\", translate(view, title))\n }\n if (spec.class) dom.classList.add(spec.class)\n if (spec.css) dom.style.cssText += spec.css\n\n dom.addEventListener(\"mousedown\", e => {\n e.preventDefault()\n if (!dom.classList.contains(prefix + \"-disabled\"))\n spec.run(view.state, view.dispatch, view, e)\n })\n\n function update(state) {\n if (spec.select) {\n let selected = spec.select(state)\n dom.style.display = selected ? \"\" : \"none\"\n if (!selected) return false\n }\n let enabled = true\n if (spec.enable) {\n enabled = spec.enable(state) || false\n setClass(dom, prefix + \"-disabled\", !enabled)\n }\n if (spec.active) {\n let active = enabled && spec.active(state) || false\n setClass(dom, prefix + \"-active\", active)\n }\n return true\n }\n\n return {dom, update}\n }\n}\n\nfunction translate(view, text) {\n return view._props.translate ? view._props.translate(text) : text\n}\n\n// MenuItemSpec:: interface\n// The configuration object passed to the `MenuItem` constructor.\n//\n// run:: (EditorState, (Transaction), EditorView, dom.Event)\n// The function to execute when the menu item is activated.\n//\n// select:: ?(EditorState) → bool\n// Optional function that is used to determine whether the item is\n// appropriate at the moment. Deselected items will be hidden.\n//\n// enable:: ?(EditorState) → bool\n// Function that is used to determine if the item is enabled. If\n// given and returning false, the item will be given a disabled\n// styling.\n//\n// active:: ?(EditorState) → bool\n// A predicate function to determine whether the item is 'active' (for\n// example, the item for toggling the strong mark might be active then\n// the cursor is in strong text).\n//\n// render:: ?(EditorView) → dom.Node\n// A function that renders the item. You must provide either this,\n// [`icon`](#menu.MenuItemSpec.icon), or [`label`](#MenuItemSpec.label).\n//\n// icon:: ?Object\n// Describes an icon to show for this item. The object may specify\n// an SVG icon, in which case its `path` property should be an [SVG\n// path\n// spec](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d),\n// and `width` and `height` should provide the viewbox in which that\n// path exists. Alternatively, it may have a `text` property\n// specifying a string of text that makes up the icon, with an\n// optional `css` property giving additional CSS styling for the\n// text. _Or_ it may contain `dom` property containing a DOM node.\n//\n// label:: ?string\n// Makes the item show up as a text label. Mostly useful for items\n// wrapped in a [drop-down](#menu.Dropdown) or similar menu. The object\n// should have a `label` property providing the text to display.\n//\n// title:: ?union<string, (EditorState) → string>\n// Defines DOM title (mouseover) text for the item.\n//\n// class:: ?string\n// Optionally adds a CSS class to the item's DOM representation.\n//\n// css:: ?string\n// Optionally adds a string of inline CSS to the item's DOM\n// representation.\n\nlet lastMenuEvent = {time: 0, node: null}\nfunction markMenuEvent(e) {\n lastMenuEvent.time = Date.now()\n lastMenuEvent.node = e.target\n}\nfunction isMenuEvent(wrapper) {\n return Date.now() - 100 < lastMenuEvent.time &&\n lastMenuEvent.node && wrapper.contains(lastMenuEvent.node)\n}\n\n// ::- A drop-down menu, displayed as a label with a downwards-pointing\n// triangle to the right of it.\nexport class Dropdown {\n // :: ([MenuElement], ?Object)\n // Create a dropdown wrapping the elements. Options may include\n // the following properties:\n //\n // **`label`**`: string`\n // : The label to show on the drop-down control.\n //\n // **`title`**`: string`\n // : Sets the\n // [`title`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title)\n // attribute given to the menu control.\n //\n // **`class`**`: string`\n // : When given, adds an extra CSS class to the menu control.\n //\n // **`css`**`: string`\n // : When given, adds an extra set of CSS styles to the menu control.\n constructor(content, options) {\n this.options = options || {}\n this.content = Array.isArray(content) ? content : [content]\n }\n\n // :: (EditorView) → {dom: dom.Node, update: (EditorState)}\n // Render the dropdown menu and sub-items.\n render(view) {\n let content = renderDropdownItems(this.content, view)\n\n let label = crel(\"div\", {class: prefix + \"-dropdown \" + (this.options.class || \"\"),\n style: this.options.css},\n translate(view, this.options.label))\n if (this.options.title) label.setAttribute(\"title\", translate(view, this.options.title))\n let wrap = crel(\"div\", {class: prefix + \"-dropdown-wrap\"}, label)\n let open = null, listeningOnClose = null\n let close = () => {\n if (open && open.close()) {\n open = null\n window.removeEventListener(\"mousedown\", listeningOnClose)\n }\n }\n label.addEventListener(\"mousedown\", e => {\n e.preventDefault()\n markMenuEvent(e)\n if (open) {\n close()\n } else {\n open = this.expand(wrap, content.dom)\n window.addEventListener(\"mousedown\", listeningOnClose = () => {\n if (!isMenuEvent(wrap)) close()\n })\n }\n })\n\n function update(state) {\n let inner = content.update(state)\n wrap.style.display = inner ? \"\" : \"none\"\n return inner\n }\n\n return {dom: wrap, update}\n }\n\n expand(dom, items) {\n let menuDOM = crel(\"div\", {class: prefix + \"-dropdown-menu \" + (this.options.class || \"\")}, items)\n\n let done = false\n function close() {\n if (done) return\n done = true\n dom.removeChild(menuDOM)\n return true\n }\n dom.appendChild(menuDOM)\n return {close, node: menuDOM}\n }\n}\n\nfunction renderDropdownItems(items, view) {\n let rendered = [], updates = []\n for (let i = 0; i < items.length; i++) {\n let {dom, update} = items[i].render(view)\n rendered.push(crel(\"div\", {class: prefix + \"-dropdown-item\"}, dom))\n updates.push(update)\n }\n return {dom: rendered, update: combineUpdates(updates, rendered)}\n}\n\nfunction combineUpdates(updates, nodes) {\n return state => {\n let something = false\n for (let i = 0; i < updates.length; i++) {\n let up = updates[i](state)\n nodes[i].style.display = up ? \"\" : \"none\"\n if (up) something = true\n }\n return something\n }\n}\n\n// ::- Represents a submenu wrapping a group of elements that start\n// hidden and expand to the right when hovered over or tapped.\nexport class DropdownSubmenu {\n // :: ([MenuElement], ?Object)\n // Creates a submenu for the given group of menu elements. The\n // following options are recognized:\n //\n // **`label`**`: string`\n // : The label to show on the submenu.\n constructor(content, options) {\n this.options = options || {}\n this.content = Array.isArray(content) ? content : [content]\n }\n\n // :: (EditorView) → {dom: dom.Node, update: (EditorState) → bool}\n // Renders the submenu.\n render(view) {\n let items = renderDropdownItems(this.content, view)\n\n let label = crel(\"div\", {class: prefix + \"-submenu-label\"}, translate(view, this.options.label))\n let wrap = crel(\"div\", {class: prefix + \"-submenu-wrap\"}, label,\n crel(\"div\", {class: prefix + \"-submenu\"}, items.dom))\n let listeningOnClose = null\n label.addEventListener(\"mousedown\", e => {\n e.preventDefault()\n markMenuEvent(e)\n setClass(wrap, prefix + \"-submenu-wrap-active\")\n if (!listeningOnClose)\n window.addEventListener(\"mousedown\", listeningOnClose = () => {\n if (!isMenuEvent(wrap)) {\n wrap.classList.remove(prefix + \"-submenu-wrap-active\")\n window.removeEventListener(\"mousedown\", listeningOnClose)\n listeningOnClose = null\n }\n })\n })\n\n function update(state) {\n let inner = items.update(state)\n wrap.style.display = inner ? \"\" : \"none\"\n return inner\n }\n return {dom: wrap, update}\n }\n}\n\n// :: (EditorView, [[MenuElement]]) → {dom: dom.DocumentFragment, update: (EditorState) → bool}\n// Render the given, possibly nested, array of menu elements into a\n// document fragment, placing separators between them (and ensuring no\n// superfluous separators appear when some of the groups turn out to\n// be empty).\nexport function renderGrouped(view, content) {\n let result = document.createDocumentFragment()\n let updates = [], separators = []\n for (let i = 0; i < content.length; i++) {\n let items = content[i], localUpdates = [], localNodes = []\n for (let j = 0; j < items.length; j++) {\n let {dom, update} = items[j].render(view)\n let span = crel(\"span\", {class: prefix + \"item\"}, dom)\n result.appendChild(span)\n localNodes.push(span)\n localUpdates.push(update)\n }\n if (localUpdates.length) {\n updates.push(combineUpdates(localUpdates, localNodes))\n if (i < content.length - 1)\n separators.push(result.appendChild(separator()))\n }\n }\n\n function update(state) {\n let something = false, needSep = false\n for (let i = 0; i < updates.length; i++) {\n let hasContent = updates[i](state)\n if (i) separators[i - 1].style.display = needSep && hasContent ? \"\" : \"none\"\n needSep = hasContent\n if (hasContent) something = true\n }\n return something\n }\n return {dom: result, update}\n}\n\nfunction separator() {\n return crel(\"span\", {class: prefix + \"separator\"})\n}\n\n// :: Object\n// A set of basic editor-related icons. Contains the properties\n// `join`, `lift`, `selectParentNode`, `undo`, `redo`, `strong`, `em`,\n// `code`, `link`, `bulletList`, `orderedList`, and `blockquote`, each\n// holding an object that can be used as the `icon` option to\n// `MenuItem`.\nexport const icons = {\n join: {\n width: 800, height: 900,\n path: \"M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z\"\n },\n lift: {\n width: 1024, height: 1024,\n path: \"M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z\"\n },\n selectParentNode: {text: \"\\u2b1a\", css: \"font-weight: bold\"},\n undo: {\n width: 1024, height: 1024,\n path: \"M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z\"\n },\n redo: {\n width: 1024, height: 1024,\n path: \"M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z\"\n },\n strong: {\n width: 805, height: 1024,\n path: \"M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z\"\n },\n em: {\n width: 585, height: 1024,\n path: \"M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z\"\n },\n code: {\n width: 896, height: 1024,\n path: \"M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z\"\n },\n link: {\n width: 951, height: 1024,\n path: \"M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z\"\n },\n bulletList: {\n width: 768, height: 896,\n path: \"M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z\"\n },\n orderedList: {\n width: 768, height: 896,\n path: \"M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z\"\n },\n blockquote: {\n width: 640, height: 896,\n path: \"M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z\"\n }\n}\n\n// :: MenuItem\n// Menu item for the `joinUp` command.\nexport const joinUpItem = new MenuItem({\n title: \"Join with above block\",\n run: joinUp,\n select: state => joinUp(state),\n icon: icons.join\n})\n\n// :: MenuItem\n// Menu item for the `lift` command.\nexport const liftItem = new MenuItem({\n title: \"Lift out of enclosing block\",\n run: lift,\n select: state => lift(state),\n icon: icons.lift\n})\n\n// :: MenuItem\n// Menu item for the `selectParentNode` command.\nexport const selectParentNodeItem = new MenuItem({\n title: \"Select parent node\",\n run: selectParentNode,\n select: state => selectParentNode(state),\n icon: icons.selectParentNode\n})\n\n// :: MenuItem\n// Menu item for the `undo` command.\nexport let undoItem = new MenuItem({\n title: \"Undo last change\",\n run: undo,\n enable: state => undo(state),\n icon: icons.undo\n})\n\n// :: MenuItem\n// Menu item for the `redo` command.\nexport let redoItem = new MenuItem({\n title: \"Redo last undone change\",\n run: redo,\n enable: state => redo(state),\n icon: icons.redo\n})\n\n// :: (NodeType, Object) → MenuItem\n// Build a menu item for wrapping the selection in a given node type.\n// Adds `run` and `select` properties to the ones present in\n// `options`. `options.attrs` may be an object or a function.\nexport function wrapItem(nodeType, options) {\n let passedOptions = {\n run(state, dispatch) {\n // FIXME if (options.attrs instanceof Function) options.attrs(state, attrs => wrapIn(nodeType, attrs)(state))\n return wrapIn(nodeType, options.attrs)(state, dispatch)\n },\n select(state) {\n return wrapIn(nodeType, options.attrs instanceof Function ? null : options.attrs)(state)\n }\n }\n for (let prop in options) passedOptions[prop] = options[prop]\n return new MenuItem(passedOptions)\n}\n\n// :: (NodeType, Object) → MenuItem\n// Build a menu item for changing the type of the textblock around the\n// selection to the given type. Provides `run`, `active`, and `select`\n// properties. Others must be given in `options`. `options.attrs` may\n// be an object to provide the attributes for the textblock node.\nexport function blockTypeItem(nodeType, options) {\n let command = setBlockType(nodeType, options.attrs)\n let passedOptions = {\n run: command,\n enable(state) { return command(state) },\n active(state) {\n let {$from, to, node} = state.selection\n if (node) return node.hasMarkup(nodeType, options.attrs)\n return to <= $from.end() && $from.parent.hasMarkup(nodeType, options.attrs)\n }\n }\n for (let prop in options) passedOptions[prop] = options[prop]\n return new MenuItem(passedOptions)\n}\n\n// Work around classList.toggle being broken in IE11\nfunction setClass(dom, cls, on) {\n if (on) dom.classList.add(cls)\n else dom.classList.remove(cls)\n}\n","import crel from \"crelt\"\nimport {Plugin} from \"prosemirror-state\"\n\nimport {renderGrouped} from \"./menu\"\n\nconst prefix = \"ProseMirror-menubar\"\n\nfunction isIOS() {\n if (typeof navigator == \"undefined\") return false\n let agent = navigator.userAgent\n return !/Edge\\/\\d/.test(agent) && /AppleWebKit/.test(agent) && /Mobile\\/\\w+/.test(agent)\n}\n\n// :: (Object) → Plugin\n// A plugin that will place a menu bar above the editor. Note that\n// this involves wrapping the editor in an additional `<div>`.\n//\n// options::-\n// Supports the following options:\n//\n// content:: [[MenuElement]]\n// Provides the content of the menu, as a nested array to be\n// passed to `renderGrouped`.\n//\n// floating:: ?bool\n// Determines whether the menu floats, i.e. whether it sticks to\n// the top of the viewport when the editor is partially scrolled\n// out of view.\nexport function menuBar(options) {\n return new Plugin({\n view(editorView) { return new MenuBarView(editorView, options) }\n })\n}\n\nclass MenuBarView {\n constructor(editorView, options) {\n this.editorView = editorView\n this.options = options\n\n this.wrapper = crel(\"div\", {class: prefix + \"-wrapper\"})\n this.menu = this.wrapper.appendChild(crel(\"div\", {class: prefix}))\n this.menu.className = prefix\n this.spacer = null\n\n if (editorView.dom.parentNode)\n editorView.dom.parentNode.replaceChild(this.wrapper, editorView.dom)\n this.wrapper.appendChild(editorView.dom)\n\n this.maxHeight = 0\n this.widthForMaxHeight = 0\n this.floating = false\n\n let {dom, update} = renderGrouped(this.editorView, this.options.content)\n this.contentUpdate = update\n this.menu.appendChild(dom)\n this.update()\n\n if (options.floating && !isIOS()) {\n this.updateFloat()\n let potentialScrollers = getAllWrapping(this.wrapper)\n this.scrollFunc = (e) => {\n let root = this.editorView.root\n if (!(root.body || root).contains(this.wrapper)) {\n potentialScrollers.forEach(el => el.removeEventListener(\"scroll\", this.scrollFunc))\n } else {\n this.updateFloat(e.target.getBoundingClientRect && e.target)\n }\n }\n potentialScrollers.forEach(el => el.addEventListener('scroll', this.scrollFunc))\n }\n }\n\n update() {\n this.contentUpdate(this.editorView.state)\n\n if (this.floating) {\n this.updateScrollCursor()\n } else {\n if (this.menu.offsetWidth != this.widthForMaxHeight) {\n this.widthForMaxHeight = this.menu.offsetWidth\n this.maxHeight = 0\n }\n if (this.menu.offsetHeight > this.maxHeight) {\n this.maxHeight = this.menu.offsetHeight\n this.menu.style.minHeight = this.maxHeight + \"px\"\n }\n }\n }\n\n updateScrollCursor() {\n let selection = this.editorView.root.getSelection()\n if (!selection.focusNode) return\n let rects = selection.getRangeAt(0).getClientRects()\n let selRect = rects[selectionIsInverted(selection) ? 0 : rects.length - 1]\n if (!selRect) return\n let menuRect = this.menu.getBoundingClientRect()\n if (selRect.top < menuRect.bottom && selRect.bottom > menuRect.top) {\n let scrollable = findWrappingScrollable(this.wrapper)\n if (scrollable) scrollable.scrollTop -= (menuRect.bottom - selRect.top)\n }\n }\n\n updateFloat(scrollAncestor) {\n let parent = this.wrapper, editorRect = parent.getBoundingClientRect(),\n top = scrollAncestor ? Math.max(0, scrollAncestor.getBoundingClientRect().top) : 0\n\n if (this.floating) {\n if (editorRect.top >= top || editorRect.bottom < this.menu.offsetHeight + 10) {\n this.floating = false\n this.menu.style.position = this.menu.style.left = this.menu.style.top = this.menu.style.width = \"\"\n this.menu.style.display = \"\"\n this.spacer.parentNode.removeChild(this.spacer)\n this.spacer = null\n } else {\n let border = (parent.offsetWidth - parent.clientWidth) / 2\n this.menu.style.left = (editorRect.left + border) + \"px\"\n this.menu.style.display = (editorRect.top > window.innerHeight ? \"none\" : \"\")\n if (scrollAncestor) this.menu.style.top = top + \"px\"\n }\n } else {\n if (editorRect.top < top && editorRect.bottom >= this.menu.offsetHeight + 10) {\n this.floating = true\n let menuRect = this.menu.getBoundingClientRect()\n this.menu.style.left = menuRect.left + \"px\"\n this.menu.style.width = menuRect.width + \"px\"\n if (scrollAncestor) this.menu.style.top = top + \"px\"\n this.menu.style.position = \"fixed\"\n this.spacer = crel(\"div\", {class: prefix + \"-spacer\", style: `height: ${menuRect.height}px`})\n parent.insertBefore(this.spacer, this.menu)\n }\n }\n }\n\n destroy() {\n if (this.wrapper.parentNode)\n this.wrapper.parentNode.replaceChild(this.editorView.dom, this.wrapper)\n }\n}\n\n// Not precise, but close enough\nfunction selectionIsInverted(selection) {\n if (selection.anchorNode == selection.focusNode) return selection.anchorOffset > selection.focusOffset\n return selection.anchorNode.compareDocumentPosition(selection.focusNode) == Node.DOCUMENT_POSITION_FOLLOWING\n}\n\nfunction findWrappingScrollable(node) {\n for (let cur = node.parentNode; cur; cur = cur.parentNode)\n if (cur.scrollHeight > cur.clientHeight) return cur\n}\n\nfunction getAllWrapping(node) {\n let res = [window]\n for (let cur = node.parentNode; cur; cur = cur.parentNode)\n res.push(cur)\n return res\n}\n"],"names":["const","prefix","let","crel","this","update","joinUp","lift","selectParentNode","undo","redo","wrapIn","setBlockType","Plugin"],"mappings":";;;;;;;;;;;;;AAAAA,IAAM,GAAG,GAAG,6BAA4B;AACxCA,IAAM,KAAK,GAAG,+BAA8B;AAC5C;AACAA,IAAMC,QAAM,GAAG,mBAAkB;AACjC;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE;AACxB,EAAEC,IAAI,IAAI,GAAG,EAAC;AACd,EAAE,KAAKA,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;AACtC,IAAI,EAAA,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAC,EAAA;AAC1D,EAAE,OAAO,IAAI;AACb,CAAC;AACD;AACO,SAAS,OAAO,CAAC,IAAI,EAAE;AAC9B,EAAEA,IAAI,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAC;AAC1C,EAAE,IAAI,CAAC,SAAS,GAAGD,SAAM;AACzB,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE;AACjB,IAAIC,IAAI,IAAI,GAAG,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAC;AAC5D,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,EAAA,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAC,EAAA;AAC5D,IAAIA,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