text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.usePortableTextEditorSelection = exports.PortableTextEditorSelectionContext = void 0;
  const react_1 = require("react");
  /**
   * A React context for sharing the editor selection.
   */
  exports.PortableTextEditorSelectionContext = react_1.createContext(null);
  /**
   * Get the current editor selection from the React context.
   */
  exports.usePortableTextEditorSelection = () => {
      const selection = react_1.useContext(exports.PortableTextEditorSelectionContext);
      if (selection === undefined) {
          throw new Error(`The \`usePortableTextEditorSelection\` hook must be used inside the <PortableTextEditor> component's context.`);
      }
      return selection;
  };
  //# sourceMappingURL=usePortableTextEditorSelection.js.map