{"version":3,"sources":["../src/lib/JuicePlugin.ts"],"sourcesContent":["import { createSlatePlugin, KEYS } from '@udecode/plate';\nimport juice from 'juice';\n\nexport const JuicePlugin = createSlatePlugin({\n  key: KEYS.juice,\n  editOnly: true,\n  inject: {\n    plugins: {\n      [KEYS.html]: {\n        parser: {\n          transformData: ({ data }) => {\n            // juice ignores the first class when there is <!-- just after <style>, so we remove it\n            let newData = data.replaceAll(/<style>\\s*<!--/g, '<style>');\n            newData = juice(newData);\n\n            return newData;\n          },\n        },\n      },\n    },\n  },\n});\n"],"mappings":";AAAA,SAAS,mBAAmB,YAAY;AACxC,OAAO,WAAW;AAEX,IAAM,cAAc,kBAAkB;AAAA,EAC3C,KAAK,KAAK;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,IACN,SAAS;AAAA,MACP,CAAC,KAAK,IAAI,GAAG;AAAA,QACX,QAAQ;AAAA,UACN,eAAe,CAAC,EAAE,KAAK,MAAM;AAE3B,gBAAI,UAAU,KAAK,WAAW,mBAAmB,SAAS;AAC1D,sBAAU,MAAM,OAAO;AAEvB,mBAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;","names":[]}