prosemirror-menu 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +1 -1
- package/dist/menu.js +2 -2
- package/package.json +4 -4
- package/src/menu.js +2 -2
- package/style/menu.css +4 -0
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ An icon or label that, when clicked, executes a command.
|
|
|
77
77
|
|
|
78
78
|
The configuration object passed to the `MenuItem` constructor.
|
|
79
79
|
|
|
80
|
-
* `run(EditorState, fn(Action), EditorView)`\
|
|
80
|
+
* `run(EditorState, fn(Action), EditorView, dom.Event)`\
|
|
81
81
|
The function to execute when the menu item is activated.
|
|
82
82
|
|
|
83
83
|
* `select(EditorState) → bool`\
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
;var assign;
|
|
2
|
-
((assign = require("./menu"), exports.MenuItem = assign.MenuItem, exports.Dropdown = assign.Dropdown, exports.DropdownSubmenu = assign.DropdownSubmenu, exports.renderGrouped = assign.renderGrouped, exports.icons = assign.icons, exports.joinUpItem = assign.joinUpItem, exports.liftItem = assign.liftItem, exports.selectParentNodeItem = assign.selectParentNodeItem, exports.undoItem = assign.undoItem, exports.redoItem = assign.redoItem, exports.wrapItem = assign.wrapItem, exports.blockTypeItem = assign.blockTypeItem))
|
|
2
|
+
((assign = require("./menu"), exports.MenuItem = assign.MenuItem, exports.Dropdown = assign.Dropdown, exports.DropdownSubmenu = assign.DropdownSubmenu, exports.renderGrouped = assign.renderGrouped, exports.icons = assign.icons, exports.joinUpItem = assign.joinUpItem, exports.liftItem = assign.liftItem, exports.selectParentNodeItem = assign.selectParentNodeItem, exports.undoItem = assign.undoItem, exports.redoItem = assign.redoItem, exports.wrapItem = assign.wrapItem, exports.blockTypeItem = assign.blockTypeItem, assign))
|
|
3
3
|
exports.menuBar = require("./menubar").menuBar
|
|
4
4
|
|
|
5
5
|
// !! This module defines a number of building blocks for ProseMirror
|
package/dist/menu.js
CHANGED
|
@@ -51,7 +51,7 @@ MenuItem.prototype.render = function render (view) {
|
|
|
51
51
|
if (spec.css) { dom.style.cssText += spec.css }
|
|
52
52
|
if (!disabled) { dom.addEventListener(spec.execEvent || "mousedown", function (e) {
|
|
53
53
|
e.preventDefault()
|
|
54
|
-
spec.run(view.state, view.dispatch, view)
|
|
54
|
+
spec.run(view.state, view.dispatch, view, e)
|
|
55
55
|
}) }
|
|
56
56
|
return dom
|
|
57
57
|
};
|
|
@@ -64,7 +64,7 @@ function translate(view, text) {
|
|
|
64
64
|
// MenuItemSpec:: interface
|
|
65
65
|
// The configuration object passed to the `MenuItem` constructor.
|
|
66
66
|
//
|
|
67
|
-
// run:: (EditorState, (Transaction), EditorView)
|
|
67
|
+
// run:: (EditorState, (Transaction), EditorView, dom.Event)
|
|
68
68
|
// The function to execute when the menu item is activated.
|
|
69
69
|
//
|
|
70
70
|
// select:: ?(EditorState) → bool
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prosemirror-menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Simple menu elements for ProseMirror",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"style": "style/menu.css",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"crel": "^3.0.0",
|
|
21
|
-
"prosemirror-state": "^0.
|
|
22
|
-
"prosemirror-commands": "^0.
|
|
23
|
-
"prosemirror-history": "^0.
|
|
21
|
+
"prosemirror-state": "^0.20.0",
|
|
22
|
+
"prosemirror-commands": "^0.20.0",
|
|
23
|
+
"prosemirror-history": "^0.20.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"buble": "^0.15.1",
|
package/src/menu.js
CHANGED
|
@@ -45,7 +45,7 @@ class MenuItem {
|
|
|
45
45
|
if (spec.css) dom.style.cssText += spec.css
|
|
46
46
|
if (!disabled) dom.addEventListener(spec.execEvent || "mousedown", e => {
|
|
47
47
|
e.preventDefault()
|
|
48
|
-
spec.run(view.state, view.dispatch, view)
|
|
48
|
+
spec.run(view.state, view.dispatch, view, e)
|
|
49
49
|
})
|
|
50
50
|
return dom
|
|
51
51
|
}
|
|
@@ -59,7 +59,7 @@ function translate(view, text) {
|
|
|
59
59
|
// MenuItemSpec:: interface
|
|
60
60
|
// The configuration object passed to the `MenuItem` constructor.
|
|
61
61
|
//
|
|
62
|
-
// run:: (EditorState, (Transaction), EditorView)
|
|
62
|
+
// run:: (EditorState, (Transaction), EditorView, dom.Event)
|
|
63
63
|
// The function to execute when the menu item is activated.
|
|
64
64
|
//
|
|
65
65
|
// select:: ?(EditorState) → bool
|