{"version":3,"file":"PullQuoteExtension.cjs","sources":["../../../../../../../src/components/ui/editor/ihub-editor/extensions/PullQuoteExtension.ts"],"sourcesContent":["import { Node, mergeAttributes } from \"@tiptap/core\";\n\ndeclare module \"@tiptap/core\" {\n  interface Commands<ReturnType> {\n    pullQuote: {\n      setPullQuote: () => ReturnType;\n      togglePullQuote: () => ReturnType;\n    };\n  }\n}\n\nconst PullQuoteExtension = Node.create({\n  name: \"pullQuote\",\n  group: \"block\",\n  content: \"inline*\",\n  defining: true,\n\n  addAttributes() {\n    return {};\n  },\n\n  parseHTML() {\n    return [\n      {\n        tag: 'blockquote[data-type=\"pull-quote\"]',\n      },\n    ];\n  },\n\n  renderHTML({ HTMLAttributes }: any) {\n    return [\n      \"blockquote\",\n      mergeAttributes(HTMLAttributes, {\n        \"data-type\": \"pull-quote\",\n        class: \"ihub-te-pull-quote\",\n      }),\n      0,\n    ];\n  },\n\n  addCommands() {\n    return {\n      setPullQuote:\n        () =>\n        ({ commands }: any) => {\n          return commands.setNode(this.name);\n        },\n      togglePullQuote:\n        () =>\n        ({ commands }: any) => {\n          return commands.toggleNode(this.name, \"paragraph\");\n        },\n    };\n  },\n});\n\nexport default PullQuoteExtension;\n"],"names":["PullQuoteExtension","Node","create","name","group","content","defining","addAttributes","parseHTML","tag","renderHTML","_ref","HTMLAttributes","mergeAttributes","class","addCommands","_this","this","setPullQuote","_ref2","commands","setNode","togglePullQuote","_ref3","toggleNode"],"mappings":"yMAWMA,EAAqBC,EAAIA,KAACC,OAAO,CACrCC,KAAM,YACNC,MAAO,QACPC,QAAS,UACTC,UAAU,EAEVC,cAAa,WACX,MAAO,EACR,EAEDC,UAAS,WACP,MAAO,CACL,CACEC,IAAK,sCAGV,EAEDC,WAAAA,SAAUC,GAAwB,IAArBC,EAAcD,EAAdC,eACX,MAAO,CACL,aACAC,EAAeA,gBAACD,EAAgB,CAC9B,YAAa,aACbE,MAAO,uBAET,EAEH,EAEDC,YAAW,WAAA,IAAAC,EAAAC,KACT,MAAO,CACLC,aACE,WADU,OAEV,SAAAC,GACE,OADSA,EAARC,SACeC,QAAQL,EAAKb,MAC9B,EACHmB,gBACE,WADa,OAEb,SAAAC,GACE,OADSA,EAARH,SACeI,WAAWR,EAAKb,KAAM,aACvC,EAEP"}