import React, { createContext, useContext } from 'react';
var EditorToolbarContext = /*#__PURE__*/createContext({
  editorView: null,
  editorAppearance: undefined,
  editorViewMode: undefined,
  editorToolbarDockingPreference: undefined
});

/**
 * Access editor specific config and state within a toolbar component
 */
export var useEditorToolbar = function useEditorToolbar() {
  var context = useContext(EditorToolbarContext);
  if (!context) {
    throw new Error('useEditorToolbar must be used within EditorToolbarContext');
  }
  return context;
};
export var EditorToolbarProvider = function EditorToolbarProvider(_ref) {
  var children = _ref.children,
    editorView = _ref.editorView,
    editorAppearance = _ref.editorAppearance,
    editorViewMode = _ref.editorViewMode,
    editorToolbarDockingPreference = _ref.editorToolbarDockingPreference,
    isOffline = _ref.isOffline;
  return /*#__PURE__*/React.createElement(EditorToolbarContext.Provider, {
    value: {
      editorView: editorView,
      editorAppearance: editorAppearance,
      editorViewMode: editorViewMode,
      editorToolbarDockingPreference: editorToolbarDockingPreference,
      isOffline: isOffline
    }
  }, children);
};