prosemirror-view 1.22.0 → 1.23.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/CHANGELOG.md +10 -0
- package/dist/index.es.js +17 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/clipboard.js +7 -1
- package/src/decoration.js +1 -1
- package/src/index.js +8 -0
package/dist/index.js
CHANGED
|
@@ -2979,7 +2979,13 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
2979
2979
|
var sliceData = contextNode && /^(\d+) (\d+) (.*)/.exec(contextNode.getAttribute("data-pm-slice"));
|
|
2980
2980
|
if (!slice) {
|
|
2981
2981
|
var parser = view.someProp("clipboardParser") || view.someProp("domParser") || prosemirrorModel.DOMParser.fromSchema(view.state.schema);
|
|
2982
|
-
slice = parser.parseSlice(dom, {
|
|
2982
|
+
slice = parser.parseSlice(dom, {
|
|
2983
|
+
preserveWhitespace: !!(asText || sliceData),
|
|
2984
|
+
context: $context,
|
|
2985
|
+
ruleFromNode: function ruleFromNode(dom) {
|
|
2986
|
+
if (dom.nodeName == "BR" && !dom.nextSibling) { return {ignore: true} }
|
|
2987
|
+
}
|
|
2988
|
+
});
|
|
2983
2989
|
}
|
|
2984
2990
|
if (sliceData) {
|
|
2985
2991
|
slice = addContext(closeSlice(slice, +sliceData[1], +sliceData[2]), sliceData[3]);
|
|
@@ -4265,7 +4271,7 @@ Decoration.prototype.map = function map (mapping, offset, oldOffset) {
|
|
|
4265
4271
|
// key are interchangeable—if widgets differ in, for example,
|
|
4266
4272
|
// the behavior of some event handler, they should get
|
|
4267
4273
|
// different keys.
|
|
4268
|
-
//
|
|
4274
|
+
//
|
|
4269
4275
|
// destroy:: ?(node: dom.Node)
|
|
4270
4276
|
// Called when the widget decoration is removed as a result of
|
|
4271
4277
|
// mapping
|
|
@@ -4864,7 +4870,7 @@ var EditorView = function EditorView(place, props) {
|
|
|
4864
4870
|
this.updatePluginViews();
|
|
4865
4871
|
};
|
|
4866
4872
|
|
|
4867
|
-
var prototypeAccessors$2 = { props: { configurable: true },root: { configurable: true } };
|
|
4873
|
+
var prototypeAccessors$2 = { props: { configurable: true },root: { configurable: true },isDestroyed: { configurable: true } };
|
|
4868
4874
|
|
|
4869
4875
|
// composing:: boolean
|
|
4870
4876
|
// Holds `true` when a
|
|
@@ -5174,6 +5180,14 @@ EditorView.prototype.destroy = function destroy () {
|
|
|
5174
5180
|
this.docView = null;
|
|
5175
5181
|
};
|
|
5176
5182
|
|
|
5183
|
+
// :: boolean
|
|
5184
|
+
// This is true when the view has been
|
|
5185
|
+
// [destroyed](#view.EditorView.destroy) (and thus should not be
|
|
5186
|
+
// used anymore).
|
|
5187
|
+
prototypeAccessors$2.isDestroyed.get = function () {
|
|
5188
|
+
return this.docView == null
|
|
5189
|
+
};
|
|
5190
|
+
|
|
5177
5191
|
// Used for testing.
|
|
5178
5192
|
EditorView.prototype.dispatchEvent = function dispatchEvent$1 (event) {
|
|
5179
5193
|
return dispatchEvent(this, event)
|