{"version":3,"sources":["../../../src/color/serializer/html.ts"],"sourcesContent":["import { HTMLSerializerWithTransform } from '@editablejs/serializer/html'\nimport { FontColor } from '../interfaces/font-color'\n\nexport const withFontColorHTMLSerializerTransform: HTMLSerializerWithTransform = (\n  next,\n  serializer,\n  customOptions = {},\n) => {\n  const { attributes: customAttributes, style: customStyle } = customOptions\n  return (node, options) => {\n    const { attributes, style } = options ?? {}\n    if (FontColor.isFontColor(node)) {\n      const { fontColor, text } = node\n      return serializer.create(\n        'span',\n        serializer.mergeOptions(node, attributes, customAttributes),\n        serializer.mergeOptions(node, style, customStyle, { color: fontColor }),\n        text,\n      )\n    }\n    return next(node, options)\n  }\n}\n"],"mappings":";;;;;;AAGO,IAAM,uCAAoE,CAC/E,MACA,YACA,gBAAgB,CAAC,MACd;AACH,QAAM,EAAE,YAAY,kBAAkB,OAAO,YAAY,IAAI;AAC7D,SAAO,CAAC,MAAM,YAAY;AACxB,UAAM,EAAE,YAAY,MAAM,IAAI,WAAW,CAAC;AAC1C,QAAI,UAAU,YAAY,IAAI,GAAG;AAC/B,YAAM,EAAE,WAAW,KAAK,IAAI;AAC5B,aAAO,WAAW;AAAA,QAChB;AAAA,QACA,WAAW,aAAa,MAAM,YAAY,gBAAgB;AAAA,QAC1D,WAAW,aAAa,MAAM,OAAO,aAAa,EAAE,OAAO,UAAU,CAAC;AAAA,QACtE;AAAA,MACF;AAAA,IACF;AACA,WAAO,KAAK,MAAM,OAAO;AAAA,EAC3B;AACF;","names":[]}