@liveblocks/react-ui
Version:
A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.
42 lines (38 loc) • 1.1 kB
JavaScript
"use client";
import { jsx } from 'react/jsx-runtime';
import { createContext, useContext, useMemo } from 'react';
import { ComponentsProvider } from './components.js';
import { OverridesProvider } from './overrides.js';
const LiveblocksUiConfigContext = createContext({});
function useLiveblocksUiConfig() {
return useContext(LiveblocksUiConfigContext);
}
function LiveblocksUiConfig({
overrides,
components,
portalContainer,
preventUnsavedComposerChanges = true,
emojibaseUrl,
children
}) {
const liveblocksUiConfig = useMemo(
() => ({
portalContainer,
preventUnsavedComposerChanges,
emojibaseUrl
}),
[portalContainer, preventUnsavedComposerChanges, emojibaseUrl]
);
return /* @__PURE__ */ jsx(LiveblocksUiConfigContext.Provider, {
value: liveblocksUiConfig,
children: /* @__PURE__ */ jsx(OverridesProvider, {
overrides,
children: /* @__PURE__ */ jsx(ComponentsProvider, {
components,
children
})
})
});
}
export { LiveblocksUiConfig, useLiveblocksUiConfig };
//# sourceMappingURL=config.js.map