slate-react 0.90.0 → 0.91.0-20231918571
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/dist/index.es.js +4 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/plugin/with-react.d.ts +1 -1
- package/dist/plugin/with-react.d.ts.map +1 -1
- package/dist/slate-react.js +3 -2
- package/dist/slate-react.min.js +1 -1
- package/dist/utils/dom.d.ts +1 -1
- package/dist/utils/dom.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -8,5 +8,5 @@ import { ReactEditor } from './react-editor';
|
|
|
8
8
|
*
|
|
9
9
|
* See https://docs.slatejs.org/concepts/11-typescript to learn how.
|
|
10
10
|
*/
|
|
11
|
-
export declare const withReact: <T extends BaseEditor>(editor: T) => T & ReactEditor;
|
|
11
|
+
export declare const withReact: <T extends BaseEditor>(editor: T, clipboardFormatKey?: string) => T & ReactEditor;
|
|
12
12
|
//# sourceMappingURL=with-react.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-react.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/plugin/with-react.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EASX,MAAM,OAAO,CAAA;AA0Bd,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":"AACA,OAAO,EACL,UAAU,EASX,MAAM,OAAO,CAAA;AA0Bd,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C;;;;;;;GAOG;AAEH,eAAO,MAAM,SAAS,mFAsSrB,CAAA"}
|
package/dist/slate-react.js
CHANGED
|
@@ -34189,6 +34189,7 @@
|
|
|
34189
34189
|
*/
|
|
34190
34190
|
|
|
34191
34191
|
var withReact = function withReact(editor) {
|
|
34192
|
+
var clipboardFormatKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'x-slate-fragment';
|
|
34192
34193
|
var e = editor;
|
|
34193
34194
|
var apply = e.apply,
|
|
34194
34195
|
onChange = e.onChange,
|
|
@@ -34419,7 +34420,7 @@
|
|
|
34419
34420
|
var string = JSON.stringify(fragment);
|
|
34420
34421
|
var encoded = window.btoa(encodeURIComponent(string));
|
|
34421
34422
|
attach.setAttribute('data-slate-fragment', encoded);
|
|
34422
|
-
data.setData(
|
|
34423
|
+
data.setData("application/".concat(clipboardFormatKey), encoded); // Add the content to a <div> so that we can get its inner HTML.
|
|
34423
34424
|
|
|
34424
34425
|
var div = contents.ownerDocument.createElement('div');
|
|
34425
34426
|
div.appendChild(contents);
|
|
@@ -34441,7 +34442,7 @@
|
|
|
34441
34442
|
/**
|
|
34442
34443
|
* Checking copied fragment from application/x-slate-fragment or data-slate-fragment
|
|
34443
34444
|
*/
|
|
34444
|
-
var fragment = data.getData(
|
|
34445
|
+
var fragment = data.getData("application/".concat(clipboardFormatKey)) || getSlateFragmentAttribute(data);
|
|
34445
34446
|
|
|
34446
34447
|
if (fragment) {
|
|
34447
34448
|
var decoded = decodeURIComponent(window.atob(fragment));
|