UNPKG

@frontify/fondue

Version:
17 lines (16 loc) 732 B
import { jsx as o } from "react/jsx-runtime"; import { useContext as d, createContext as n, useMemo as m } from "react"; import { PlateWrapper as c } from "../components/EditorPositioningWrapper/PlateWrapper.es.js"; import { useEditorResize as f } from "../hooks/useEditorResize.es.js"; const r = n({ editorWidth: 0, editorRef: null }), l = () => d(r), C = ({ children: i }) => { const { editorRef: e, editorWidth: t } = f(), s = m(() => ({ editorWidth: t, editorRef: e }), [t, e]); return /* @__PURE__ */ o(r.Provider, { value: s, children: /* @__PURE__ */ o(c, { ref: e, children: i }) }); }; export { C as EditorResizeContextProvider, l as useEditorResizeContext }; //# sourceMappingURL=EditorResizeContext.es.js.map