UNPKG

@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.

61 lines (57 loc) 2.44 kB
'use strict'; var core = require('@liveblocks/core'); var react = require('react'); const ComposerContext = react.createContext(null); const ComposerEditorContext = react.createContext(null); const ComposerAttachmentsContext = react.createContext(null); const ComposerSuggestionsContext = react.createContext(null); const ComposerFloatingToolbarContext = react.createContext(null); function useComposerEditorContext() { const composerEditorContext = react.useContext(ComposerEditorContext); return core.nn( composerEditorContext, "Composer.Form is missing from the React tree." ); } function useComposerAttachmentsContextOrNull() { return react.useContext(ComposerAttachmentsContext); } function useComposerAttachmentsContext() { const composerAttachmentsContext = useComposerAttachmentsContextOrNull(); return core.nn( composerAttachmentsContext, "Composer.Form is missing from the React tree." ); } function useComposerSuggestionsContext(source = "useComposerSuggestionsContext") { const composerSuggestionsContext = react.useContext(ComposerSuggestionsContext); return core.nn( composerSuggestionsContext, `${source} can\u2019t be used outside of Composer.Editor.` ); } function useComposerFloatingToolbarContext(source = "useComposerFloatingToolbarContext") { const composerFloatingToolbarContext = react.useContext( ComposerFloatingToolbarContext ); return core.nn( composerFloatingToolbarContext, `${source} can\u2019t be used outside of Composer.Editor.` ); } function useComposer() { const composerContext = react.useContext(ComposerContext); return core.nn(composerContext, "Composer.Form is missing from the React tree."); } exports.ComposerAttachmentsContext = ComposerAttachmentsContext; exports.ComposerContext = ComposerContext; exports.ComposerEditorContext = ComposerEditorContext; exports.ComposerFloatingToolbarContext = ComposerFloatingToolbarContext; exports.ComposerSuggestionsContext = ComposerSuggestionsContext; exports.useComposer = useComposer; exports.useComposerAttachmentsContext = useComposerAttachmentsContext; exports.useComposerAttachmentsContextOrNull = useComposerAttachmentsContextOrNull; exports.useComposerEditorContext = useComposerEditorContext; exports.useComposerFloatingToolbarContext = useComposerFloatingToolbarContext; exports.useComposerSuggestionsContext = useComposerSuggestionsContext; //# sourceMappingURL=contexts.cjs.map