slate-react 0.56.1 → 0.57.3
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 +2 -2
- package/dist/components/editable.d.ts.map +1 -1
- package/dist/components/slate.d.ts +3 -2
- package/dist/components/slate.d.ts.map +1 -1
- package/dist/components/text.d.ts.map +1 -1
- package/dist/hooks/use-editor.d.ts +5 -5
- package/dist/hooks/use-editor.d.ts.map +1 -1
- package/dist/hooks/use-slate.d.ts +5 -5
- package/dist/hooks/use-slate.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +1712 -1535
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1709 -1533
- package/dist/index.js.map +1 -1
- package/dist/plugin/react-editor.d.ts +13 -0
- package/dist/plugin/react-editor.d.ts.map +1 -1
- package/dist/plugin/with-react.d.ts +2 -1
- package/dist/plugin/with-react.d.ts.map +1 -1
- package/dist/slate-react.js +10436 -9604
- package/dist/slate-react.min.js +1 -6
- package/dist/utils/dom.d.ts +11 -0
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/environment.d.ts +1 -0
- package/dist/utils/environment.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/plugin/react-command.d.ts +0 -18
- package/dist/plugin/react-command.d.ts.map +0 -1
package/Readme.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
This package contains the React-specific logic for Slate. It's separated further into a series of directories:
|
|
2
2
|
|
|
3
3
|
- [**Components**](./src/components) — containing the React components for rendering Slate editors.
|
|
4
|
-
- [**
|
|
5
|
-
- [**Plugins**](./src/
|
|
4
|
+
- [**Hooks**](./src/hooks) — containing a few React hooks for Slate editors.
|
|
5
|
+
- [**Plugins**](./src/plugin) — containing the React-specific plugins for Slate editors.
|
|
6
6
|
- [**Utils**](./src/utils) — containing a few private convenience modules.
|
|
7
7
|
|
|
8
8
|
Feel free to poke around in each of them to learn more!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editable.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/editable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAA;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"editable.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/editable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAA;AACtE,OAAO,EAEL,OAAO,EACP,SAAS,EAET,KAAK,EACL,IAAI,EAEL,MAAM,OAAO,CAAA;AAiCd;;GAEG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,GAAG,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE;QACV,iBAAiB,EAAE,SAAS,CAAA;QAC5B,mBAAmB,CAAC,EAAE,IAAI,CAAA;QAC1B,iBAAiB,CAAC,EAAE,IAAI,CAAA;QACxB,GAAG,CAAC,EAAE,KAAK,CAAA;QACX,GAAG,EAAE,GAAG,CAAA;KACT,CAAA;CACF;AAED;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,GAAG,CAAA;IACb,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;IACV,UAAU,EAAE;QACV,iBAAiB,EAAE,IAAI,CAAA;KACxB,CAAA;CACF;AAED;;GAEG;AAEH,oBAAY,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,KAAK,EAAE,CAAA;IACxC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IACzC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,GAAG,CAAC,OAAO,CAAA;IAC1D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,GAAG,CAAC,OAAO,CAAA;IACpD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CACvB,GAAG,KAAK,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAA;AAEhD;;GAEG;AAEH,eAAO,MAAM,QAAQ,uCAs0BpB,CAAA"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Node } from 'slate';
|
|
3
|
+
import { ReactEditor } from '../plugin/react-editor';
|
|
3
4
|
/**
|
|
4
5
|
* A wrapper around the provider to handle `onChange` events, because the editor
|
|
5
6
|
* is a mutable singleton so it won't ever register as "changed" otherwise.
|
|
6
7
|
*/
|
|
7
8
|
export declare const Slate: (props: {
|
|
8
9
|
[key: string]: any;
|
|
9
|
-
editor:
|
|
10
|
+
editor: ReactEditor;
|
|
10
11
|
value: Node[];
|
|
11
12
|
children: React.ReactNode;
|
|
12
13
|
onChange: (value: Node[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/slate.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/slate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAMpD;;;GAGG;AAEH,eAAO,MAAM,KAAK;;;;;;iBAqCjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,OAAO,CAAA;AAIzD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,OAAO,CAAA;AAIzD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA4D5C,QAAA,MAAM,YAAY;;;;;;kBAOhB,CAAA;AAEF,eAAe,YAAY,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ReactEditor } from '../plugin/react-editor';
|
|
3
3
|
/**
|
|
4
|
-
* A React context for sharing the
|
|
4
|
+
* A React context for sharing the editor object.
|
|
5
5
|
*/
|
|
6
|
-
export declare const EditorContext: import("react").Context<
|
|
6
|
+
export declare const EditorContext: import("react").Context<ReactEditor | null>;
|
|
7
7
|
/**
|
|
8
|
-
* Get the current
|
|
8
|
+
* Get the current editor object from the React context.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useEditor: () =>
|
|
10
|
+
export declare const useEditor: () => ReactEditor;
|
|
11
11
|
//# sourceMappingURL=use-editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-editor.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-editor.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"use-editor.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-editor.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AAEH,eAAO,MAAM,aAAa,6CAA0C,CAAA;AAEpE;;GAEG;AAEH,eAAO,MAAM,SAAS,mBAUrB,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ReactEditor } from '../plugin/react-editor';
|
|
3
3
|
/**
|
|
4
|
-
* A React context for sharing the
|
|
4
|
+
* A React context for sharing the editor object, in a way that re-renders the
|
|
5
5
|
* context whenever changes occur.
|
|
6
6
|
*/
|
|
7
|
-
export declare const SlateContext: import("react").Context<[
|
|
7
|
+
export declare const SlateContext: import("react").Context<[ReactEditor] | null>;
|
|
8
8
|
/**
|
|
9
|
-
* Get the current
|
|
9
|
+
* Get the current editor object from the React context.
|
|
10
10
|
*/
|
|
11
|
-
export declare const useSlate: () =>
|
|
11
|
+
export declare const useSlate: () => ReactEditor;
|
|
12
12
|
//# sourceMappingURL=use-slate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-slate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"use-slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/hooks/use-slate.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;;GAGG;AAEH,eAAO,MAAM,YAAY,+CAA4C,CAAA;AAErE;;GAEG;AAEH,eAAO,MAAM,QAAQ,mBAWpB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export { useFocused } from './hooks/use-focused';
|
|
|
7
7
|
export { useReadOnly } from './hooks/use-read-only';
|
|
8
8
|
export { useSelected } from './hooks/use-selected';
|
|
9
9
|
export { useSlate } from './hooks/use-slate';
|
|
10
|
-
export { InsertDataCommand, ReactCommand } from './plugin/react-command';
|
|
11
10
|
export { ReactEditor } from './plugin/react-editor';
|
|
12
11
|
export { withReact } from './plugin/with-react';
|
|
13
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["packages/slate-react/src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["packages/slate-react/src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA"}
|