import React from "react";
import { Decoration_Type } from "./../ricos-schema/legacy/wix/rich_content/v1/index.js";
import { withFallbackFontFamily } from "./with-fallback-font-family.js";
const nodeViewDecorator = (fallbackFontFamily) => ({
  rule: (node) => !!node.textData?.decorations?.find(
    (dec) => dec.type === Decoration_Type.FONT_FAMILY
  ),
  decorate: ({ element, node }) => {
    const fontFamily = node.textData?.decorations?.find(
      (dec) => dec.type === Decoration_Type.FONT_FAMILY
    )?.fontFamilyData?.value;
    return /* @__PURE__ */ React.createElement("span", { style: { fontFamily: withFallbackFontFamily(fontFamily, fallbackFontFamily) } }, element);
  }
});
export {
  nodeViewDecorator
};
//# sourceMappingURL=node-view-decorator.js.map
