import React, { useContext } from "react";
import { EditorContext, ModalServiceContext } from "./../ricos-context/index.js";
import { Decoration_Type } from "./../ricos-schema/legacy/wix/rich_content/v1/index.js";
const FONT_FAMILY_MODAL_ID = `${Decoration_Type.FONT_FAMILY}.modal`;
const DEFAULT_FONT_FAMILIES = [
  "Arial",
  "Arial Black",
  "Comic Sans MS",
  "Courier New",
  "Georgia",
  "Helvetica",
  "Impact",
  "Lucida Console",
  "Palatino",
  "Tahoma",
  "Times New Roman",
  "Trebuchet MS",
  "Verdana"
];
const createFontFamilyPicker = (FontFamilyPicker) => () => {
  const { getPublicCommands } = useContext(EditorContext);
  const modalService = useContext(ModalServiceContext);
  const closeModal = () => {
    modalService.closeModal(FONT_FAMILY_MODAL_ID);
  };
  const onFontFamilySelected = (fontFamily) => {
    getPublicCommands()?.insertDecoration("FONT_FAMILY", { value: fontFamily });
    closeModal();
  };
  return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
    FontFamilyPicker,
    {
      current: getPublicCommands()?.getFontFamily() || void 0,
      onChange: onFontFamilySelected
    }
  ));
};
export {
  DEFAULT_FONT_FAMILIES,
  FONT_FAMILY_MODAL_ID,
  createFontFamilyPicker
};
//# sourceMappingURL=font-family-picker.js.map
