{"version":3,"sources":["../../../src/background-color/deserializer/html.ts"],"sourcesContent":["import { isDOMHTMLElement } from '@editablejs/models'\nimport { HTMLDeserializerWithTransform } from '@editablejs/deserializer/html'\nimport { BACKGROUND_COLOR_KEY } from '../constants'\nimport { BackgroundColor } from '../interfaces/background-color'\n\nexport const withBackgroundColorHTMLDeserializerTransform: HTMLDeserializerWithTransform = next => {\n  return (node, options = {}) => {\n    const { text } = options\n    if (isDOMHTMLElement(node)) {\n      const { backgroundColor } = node.style\n      if (backgroundColor) {\n        const backgroundColorText: Partial<BackgroundColor> = {\n          ...text,\n          [BACKGROUND_COLOR_KEY]: backgroundColor,\n        }\n        return next(node, {\n          ...options,\n          text: backgroundColorText,\n        })\n      }\n    }\n    return next(node, options)\n  }\n}\n"],"mappings":";;;;;AAAA,SAAS,wBAAwB;AAK1B,IAAM,+CAA8E,UAAQ;AACjG,SAAO,CAAC,MAAM,UAAU,CAAC,MAAM;AAC7B,UAAM,EAAE,KAAK,IAAI;AACjB,QAAI,iBAAiB,IAAI,GAAG;AAC1B,YAAM,EAAE,gBAAgB,IAAI,KAAK;AACjC,UAAI,iBAAiB;AACnB,cAAM,sBAAgD;AAAA,UACpD,GAAG;AAAA,UACH,CAAC,uBAAuB;AAAA,QAC1B;AACA,eAAO,KAAK,MAAM;AAAA,UAChB,GAAG;AAAA,UACH,MAAM;AAAA,QACR,CAAC;AAAA,MACH;AAAA,IACF;AACA,WAAO,KAAK,MAAM,OAAO;AAAA,EAC3B;AACF;","names":[]}