{"version":3,"sources":["../../../src/background-color/serializer/html.ts"],"sourcesContent":["import { HTMLSerializerWithTransform } from '@editablejs/serializer/html'\nimport { BackgroundColor } from '../interfaces/background-color'\n\nexport const withBackgroundColorHTMLSerializerTransform: 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 (BackgroundColor.isBackgroundColor(node)) {\n      const { backgroundColor, text } = node\n      return serializer.create(\n        'span',\n        serializer.mergeOptions(node, attributes, customAttributes),\n        serializer.mergeOptions(node, style, customStyle, { backgroundColor }),\n        text,\n      )\n    }\n    return next(node, options)\n  }\n}\n"],"mappings":";;;;;;AAGO,IAAM,6CAA0E,CACrF,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,gBAAgB,kBAAkB,IAAI,GAAG;AAC3C,YAAM,EAAE,iBAAiB,KAAK,IAAI;AAClC,aAAO,WAAW;AAAA,QAChB;AAAA,QACA,WAAW,aAAa,MAAM,YAAY,gBAAgB;AAAA,QAC1D,WAAW,aAAa,MAAM,OAAO,aAAa,EAAE,gBAAgB,CAAC;AAAA,QACrE;AAAA,MACF;AAAA,IACF;AACA,WAAO,KAAK,MAAM,OAAO;AAAA,EAC3B;AACF;","names":[]}