slate-react 0.95.0-2023426145958 → 0.95.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/dist/components/slate.d.ts +1 -1
- package/dist/components/slate.d.ts.map +1 -1
- package/dist/index.es.js +5 -5
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/slate-react.js +5 -5
- package/dist/slate-react.min.js +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { ReactEditor } from '../plugin/react-editor';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const Slate: (props: {
|
|
9
9
|
editor: ReactEditor;
|
|
10
|
-
|
|
10
|
+
initialValue: Descendant[];
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
onChange?: ((value: Descendant[]) => void) | undefined;
|
|
13
13
|
}) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/slate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,UAAU,EAA0B,MAAM,OAAO,CAAA;AAS1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAIpD;;;GAGG;AAEH,eAAO,MAAM,KAAK;YACR,WAAW;
|
|
1
|
+
{"version":3,"file":"slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/slate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,UAAU,EAA0B,MAAM,OAAO,CAAA;AAS1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAIpD;;;GAGG;AAEH,eAAO,MAAM,KAAK;YACR,WAAW;kBACL,UAAU,EAAE;cAChB,MAAM,SAAS;wBACN,UAAU,EAAE,KAAK,IAAI;iBAwFzC,CAAA"}
|
package/dist/index.es.js
CHANGED
|
@@ -4692,7 +4692,7 @@ function useSelectorContext(editor) {
|
|
|
4692
4692
|
};
|
|
4693
4693
|
}
|
|
4694
4694
|
|
|
4695
|
-
var _excluded = ["editor", "children", "onChange", "
|
|
4695
|
+
var _excluded = ["editor", "children", "onChange", "initialValue"];
|
|
4696
4696
|
/**
|
|
4697
4697
|
* A wrapper around the provider to handle `onChange` events, because the editor
|
|
4698
4698
|
* is a mutable singleton so it won't ever register as "changed" otherwise.
|
|
@@ -4703,21 +4703,21 @@ var Slate = props => {
|
|
|
4703
4703
|
editor,
|
|
4704
4704
|
children,
|
|
4705
4705
|
onChange,
|
|
4706
|
-
|
|
4706
|
+
initialValue
|
|
4707
4707
|
} = props,
|
|
4708
4708
|
rest = _objectWithoutProperties(props, _excluded);
|
|
4709
4709
|
|
|
4710
4710
|
var unmountRef = useRef(false);
|
|
4711
4711
|
var [context, setContext] = React.useState(() => {
|
|
4712
|
-
if (!Node.isNodeList(
|
|
4713
|
-
throw new Error("[Slate]
|
|
4712
|
+
if (!Node.isNodeList(initialValue)) {
|
|
4713
|
+
throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(Scrubber.stringify(initialValue)));
|
|
4714
4714
|
}
|
|
4715
4715
|
|
|
4716
4716
|
if (!Editor.isEditor(editor)) {
|
|
4717
4717
|
throw new Error("[Slate] editor is invalid! You passed: ".concat(Scrubber.stringify(editor)));
|
|
4718
4718
|
}
|
|
4719
4719
|
|
|
4720
|
-
editor.children =
|
|
4720
|
+
editor.children = initialValue;
|
|
4721
4721
|
Object.assign(editor, rest);
|
|
4722
4722
|
return {
|
|
4723
4723
|
v: 0,
|