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.
@@ -7,7 +7,7 @@ import { ReactEditor } from '../plugin/react-editor';
7
7
  */
8
8
  export declare const Slate: (props: {
9
9
  editor: ReactEditor;
10
- value: Descendant[];
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;WACZ,UAAU,EAAE;cACT,MAAM,SAAS;wBACN,UAAU,EAAE,KAAK,IAAI;iBAwFzC,CAAA"}
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", "value"];
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
- value
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(value)) {
4713
- throw new Error("[Slate] value is invalid! Expected a list of elements but got: ".concat(Scrubber.stringify(value)));
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 = value;
4720
+ editor.children = initialValue;
4721
4721
  Object.assign(editor, rest);
4722
4722
  return {
4723
4723
  v: 0,