@portabletext/editor 2.1.5 → 2.1.6

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/lib/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { c } from "react-compiler-runtime";
2
2
  import React, { useEffect, createContext, useContext, useState, useRef, Component, useMemo, startTransition, useCallback, forwardRef, useImperativeHandle } from "react";
3
- import { useEffectEvent } from "use-effect-event";
4
3
  import { useEditor, EditorContext } from "./_chunks-es/use-editor.js";
5
4
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
6
5
  import { useSelector, useActorRef } from "@xstate/react";
@@ -36,16 +35,14 @@ import { defineType, defineField } from "@sanity/types";
36
35
  import startCase from "lodash.startcase";
37
36
  import isPlainObject from "lodash/isPlainObject.js";
38
37
  function EditorEventListener(props) {
39
- const $ = c(5), editor = useEditor(), on = useEffectEvent(props.on);
40
- let t0;
41
- $[0] !== editor || $[1] !== on ? (t0 = () => {
42
- const subscription = editor.on("*", on);
38
+ const $ = c(4), editor = useEditor();
39
+ let t0, t1;
40
+ return $[0] !== editor || $[1] !== props.on ? (t0 = () => {
41
+ const subscription = editor.on("*", props.on);
43
42
  return () => {
44
43
  subscription.unsubscribe();
45
44
  };
46
- }, $[0] = editor, $[1] = on, $[2] = t0) : t0 = $[2];
47
- let t1;
48
- return $[3] !== editor ? (t1 = [editor], $[3] = editor, $[4] = t1) : t1 = $[4], useEffect(t0, t1), null;
45
+ }, t1 = [editor, props.on], $[0] = editor, $[1] = props.on, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), useEffect(t0, t1), null;
49
46
  }
50
47
  const rootName = "sanity-pte:";
51
48
  debug$f(rootName);