slate-react 0.68.1 → 0.69.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 +6 -0
- package/dist/components/editable.d.ts.map +1 -1
- package/dist/index.es.js +16 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/dist/plugin/react-editor.d.ts +4 -4
- package/dist/plugin/react-editor.d.ts.map +1 -1
- package/dist/plugin/with-react.d.ts.map +1 -1
- package/dist/slate-react.js +16 -6
- package/dist/slate-react.min.js +1 -1
- package/package.json +1 -1
|
@@ -6,8 +6,8 @@ import { DOMNode, DOMPoint, DOMRange, DOMSelection, DOMStaticRange } from '../ut
|
|
|
6
6
|
*/
|
|
7
7
|
export interface ReactEditor extends BaseEditor {
|
|
8
8
|
insertData: (data: DataTransfer) => void;
|
|
9
|
-
insertFragmentData: (data: DataTransfer) =>
|
|
10
|
-
insertTextData: (data: DataTransfer) =>
|
|
9
|
+
insertFragmentData: (data: DataTransfer) => boolean;
|
|
10
|
+
insertTextData: (data: DataTransfer) => boolean;
|
|
11
11
|
setFragmentData: (data: DataTransfer) => void;
|
|
12
12
|
hasRange: (editor: ReactEditor, range: Range) => boolean;
|
|
13
13
|
}
|
|
@@ -61,11 +61,11 @@ export declare const ReactEditor: {
|
|
|
61
61
|
/**
|
|
62
62
|
* Insert fragment data from a `DataTransfer` into the editor.
|
|
63
63
|
*/
|
|
64
|
-
insertFragmentData(editor: ReactEditor, data: DataTransfer):
|
|
64
|
+
insertFragmentData(editor: ReactEditor, data: DataTransfer): boolean;
|
|
65
65
|
/**
|
|
66
66
|
* Insert text data from a `DataTransfer` into the editor.
|
|
67
67
|
*/
|
|
68
|
-
insertTextData(editor: ReactEditor, data: DataTransfer):
|
|
68
|
+
insertTextData(editor: ReactEditor, data: DataTransfer): boolean;
|
|
69
69
|
/**
|
|
70
70
|
* Sets data from the currently selected fragment on a `DataTransfer`.
|
|
71
71
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-editor.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/plugin/react-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAc,UAAU,EAAE,MAAM,OAAO,CAAA;AAEhF,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAYlC,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,cAAc,EAKf,MAAM,cAAc,CAAA;AAGrB;;GAEG;AAEH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IACxC,kBAAkB,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,
|
|
1
|
+
{"version":3,"file":"react-editor.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/plugin/react-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAc,UAAU,EAAE,MAAM,OAAO,CAAA;AAEhF,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAYlC,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,cAAc,EAKf,MAAM,cAAc,CAAA;AAGrB;;GAEG;AAEH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IACxC,kBAAkB,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAA;IACnD,cAAc,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAA;IAC/C,eAAe,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,K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sourceRoot":"","sources":["../packages/slate-react/src/plugin/with-react.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAc5C;;;;;;;GAOG;AAEH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"with-react.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/plugin/with-react.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAc5C;;;;;;;GAOG;AAEH,eAAO,MAAM,SAAS,uDAsOrB,CAAA"}
|
package/dist/slate-react.js
CHANGED
|
@@ -2775,7 +2775,10 @@
|
|
|
2775
2775
|
slate.Transforms.select(editor, range);
|
|
2776
2776
|
|
|
2777
2777
|
if (state.isDraggingInternally) {
|
|
2778
|
-
if (draggedRange) {
|
|
2778
|
+
if (draggedRange && !slate.Range.equals(draggedRange, range) && !slate.Editor["void"](editor, {
|
|
2779
|
+
at: range,
|
|
2780
|
+
voids: true
|
|
2781
|
+
})) {
|
|
2779
2782
|
slate.Transforms["delete"](editor, {
|
|
2780
2783
|
at: draggedRange
|
|
2781
2784
|
});
|
|
@@ -3442,14 +3445,14 @@
|
|
|
3442
3445
|
* Insert fragment data from a `DataTransfer` into the editor.
|
|
3443
3446
|
*/
|
|
3444
3447
|
insertFragmentData: function insertFragmentData(editor, data) {
|
|
3445
|
-
editor.insertFragmentData(data);
|
|
3448
|
+
return editor.insertFragmentData(data);
|
|
3446
3449
|
},
|
|
3447
3450
|
|
|
3448
3451
|
/**
|
|
3449
3452
|
* Insert text data from a `DataTransfer` into the editor.
|
|
3450
3453
|
*/
|
|
3451
3454
|
insertTextData: function insertTextData(editor, data) {
|
|
3452
|
-
editor.insertTextData(data);
|
|
3455
|
+
return editor.insertTextData(data);
|
|
3453
3456
|
},
|
|
3454
3457
|
|
|
3455
3458
|
/**
|
|
@@ -32661,8 +32664,9 @@
|
|
|
32661
32664
|
};
|
|
32662
32665
|
|
|
32663
32666
|
e.insertData = function (data) {
|
|
32664
|
-
e.insertFragmentData(data)
|
|
32665
|
-
|
|
32667
|
+
if (!e.insertFragmentData(data)) {
|
|
32668
|
+
e.insertTextData(data);
|
|
32669
|
+
}
|
|
32666
32670
|
};
|
|
32667
32671
|
|
|
32668
32672
|
e.insertFragmentData = function (data) {
|
|
@@ -32675,8 +32679,10 @@
|
|
|
32675
32679
|
var decoded = decodeURIComponent(window.atob(fragment));
|
|
32676
32680
|
var parsed = JSON.parse(decoded);
|
|
32677
32681
|
e.insertFragment(parsed);
|
|
32678
|
-
return;
|
|
32682
|
+
return true;
|
|
32679
32683
|
}
|
|
32684
|
+
|
|
32685
|
+
return false;
|
|
32680
32686
|
};
|
|
32681
32687
|
|
|
32682
32688
|
e.insertTextData = function (data) {
|
|
@@ -32707,7 +32713,11 @@
|
|
|
32707
32713
|
} finally {
|
|
32708
32714
|
_iterator4.f();
|
|
32709
32715
|
}
|
|
32716
|
+
|
|
32717
|
+
return true;
|
|
32710
32718
|
}
|
|
32719
|
+
|
|
32720
|
+
return false;
|
|
32711
32721
|
};
|
|
32712
32722
|
|
|
32713
32723
|
e.onChange = function () {
|