import { useMemo } from "react";
import { Slate, getBaseBreakpoint } from "@makeswift/controls";
import { DefaultBreakpointID } from "../../../../../state/modules/breakpoints";
import { useBreakpoints } from "../../../hooks/use-breakpoints";
import { RichText } from "../../../../../controls";
function usePresetValue(definition) {
  const breakpoints = useBreakpoints();
  return useMemo(
    () => [
      {
        type: Slate.BlockType.Default,
        children: [
          {
            text: definition.config.defaultValue ?? "",
            ...definition.config.mode === RichText.Mode.Inline ? {} : {
              typography: {
                style: [
                  {
                    deviceId: getBaseBreakpoint(breakpoints).id,
                    value: {
                      fontWeight: 400,
                      fontSize: { value: 18, unit: "px" },
                      lineHeight: 1.5
                    }
                  },
                  ...breakpoints.some(({ id }) => id === DefaultBreakpointID.Mobile) ? [
                    {
                      deviceId: DefaultBreakpointID.Mobile,
                      value: { fontSize: { value: 16, unit: "px" } }
                    }
                  ] : []
                ]
              }
            }
          }
        ]
      }
    ],
    [definition.config.mode, definition.config.defaultValue, breakpoints]
  );
}
const defaultValue = [
  {
    type: Slate.BlockType.Default,
    children: [
      {
        text: ""
      }
    ]
  }
];
export {
  defaultValue,
  usePresetValue
};
//# sourceMappingURL=usePresetValue.js.map