Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
var AUTO_FOCUS_DELAY = 350;
// Default custom node views.
var DEFAULT_NODE_VIEWS = exports.DEFAULT_NODE_VIEWS = (0, _freeze2.default)((_Object$freeze2 = {}, (0, _defineProperty3.default)(_Object$freeze2, _NodeNames.IMAGE, _ImageNodeView2.default), (0, _defineProperty3.default)(_Object$freeze2, _NodeNames.MATH, _MathNodeView2.default), (0, _defineProperty3.default)(_Object$freeze2, _NodeNames.BOOKMARK, _BookmarkNodeView2.default), (0, _defineProperty3.default)(_Object$freeze2, _NodeNames.LIST_ITEM, _ListItemNodeView2.default), _Object$freeze2));
var EDITOR_EMPTY_STATE = (0, _freeze2.default)((0, _createEmptyEditorState2.default)());
// Monkey patch the `scrollIntoView` mathod of 'Transaction'.
// Why this is necessary?
// It appears that promse-mirror does call `scrollIntoView` extensively
// from many of the built-in transformations, thus cause unwanted page
// scrolls. To make the behavior more manageable, this patched method asks
// developer to explicitly use `scrollIntoView(true)` to enforce page scroll.
var scrollIntoView = _prosemirrorState.Transaction.prototype.scrollIntoView;
var scrollIntoViewPatched = function scrollIntoViewPatched(forced) {
if (forced === true && scrollIntoView) {
return scrollIntoView.call(this);
} else {
return this;
}
};
_prosemirrorState.Transaction.prototype.scrollIntoView = scrollIntoViewPatched;
// Sets the implementation so that `FontTypeMarkSpec` can load custom fonts.
_WebFontLoader2.default.setImplementation(_webfontloader2.default);
var handleDOMEvents = {
drop: _handleEditorDrop2.default,
keydown: _handleEditorKeyDown2.default,
paste: _handleEditorPaste2.default
// Monkey patch the `scrollIntoView` mathod of 'Transaction'.
// Why this is necessary?
// It appears that promse-mirror does call `scrollIntoView` extensively
// from many of the built-in transformations, thus cause unwanted page
// scrolls. To make the behavior more manageable, this patched method asks
// developer to explicitly use `scrollIntoView(true)` to enforce page scroll.
var scrollIntoView = _prosemirrorState.Transaction.prototype.scrollIntoView;
var scrollIntoViewPatched = function scrollIntoViewPatched(forced) {
if (forced === true && scrollIntoView) {
return scrollIntoView.call(this);
} else {
return this;
}
};
_prosemirrorState.Transaction.prototype.scrollIntoView = scrollIntoViewPatched;
// Sets the implementation so that `FontTypeMarkSpec` can load custom fonts.
_WebFontLoader2.default.setImplementation(_webfontloader2.default);
var handleDOMEvents = {
drop: _handleEditorDrop2.default,
keydown: _handleEditorKeyDown2.default,
paste: _handleEditorPaste2.default
};
function bindNodeView(NodeView) {
return function (node, view, getPos, decorations) {
return new NodeView(node, view, getPos, decorations);
};
}