@edifice.io/tiptap-extensions 2.0.0-develop-rc.7 → 2.0.0-develop-rc.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/abbr/abbr.cjs +1 -1
  2. package/dist/abbr/abbr.cjs.map +1 -1
  3. package/dist/abbr/abbr.js +7 -7
  4. package/dist/abbr/abbr.js.map +1 -1
  5. package/dist/alert/alert.cjs +1 -1
  6. package/dist/alert/alert.cjs.map +1 -1
  7. package/dist/alert/alert.js +6 -6
  8. package/dist/alert/alert.js.map +1 -1
  9. package/dist/attachment/attachment.cjs +1 -1
  10. package/dist/attachment/attachment.cjs.map +1 -1
  11. package/dist/attachment/attachment.js +29 -29
  12. package/dist/attachment/attachment.js.map +1 -1
  13. package/dist/audio/audio.cjs +3 -3
  14. package/dist/audio/audio.cjs.map +1 -1
  15. package/dist/audio/audio.js +16 -16
  16. package/dist/audio/audio.js.map +1 -1
  17. package/dist/font-size/font-size.cjs +1 -1
  18. package/dist/font-size/font-size.cjs.map +1 -1
  19. package/dist/font-size/font-size.js +10 -10
  20. package/dist/font-size/font-size.js.map +1 -1
  21. package/dist/heading/heading.cjs +1 -1
  22. package/dist/heading/heading.cjs.map +1 -1
  23. package/dist/heading/heading.js +20 -20
  24. package/dist/heading/heading.js.map +1 -1
  25. package/dist/highlight/highlight.cjs +1 -1
  26. package/dist/highlight/highlight.cjs.map +1 -1
  27. package/dist/highlight/highlight.js +9 -9
  28. package/dist/highlight/highlight.js.map +1 -1
  29. package/dist/hyperlink/hyperlink.cjs +1 -1
  30. package/dist/hyperlink/hyperlink.cjs.map +1 -1
  31. package/dist/hyperlink/hyperlink.js +13 -13
  32. package/dist/hyperlink/hyperlink.js.map +1 -1
  33. package/dist/iframe/iframe.cjs +1 -1
  34. package/dist/iframe/iframe.cjs.map +1 -1
  35. package/dist/iframe/iframe.js +17 -17
  36. package/dist/iframe/iframe.js.map +1 -1
  37. package/dist/image/custom-image.cjs +1 -1
  38. package/dist/image/custom-image.cjs.map +1 -1
  39. package/dist/image/custom-image.js +51 -51
  40. package/dist/image/custom-image.js.map +1 -1
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.js +41 -41
  43. package/dist/line-height/line-height.cjs +1 -1
  44. package/dist/line-height/line-height.cjs.map +1 -1
  45. package/dist/line-height/line-height.js +8 -8
  46. package/dist/line-height/line-height.js.map +1 -1
  47. package/dist/linker/linker.cjs +1 -1
  48. package/dist/linker/linker.cjs.map +1 -1
  49. package/dist/linker/linker.js +16 -16
  50. package/dist/linker/linker.js.map +1 -1
  51. package/dist/mathjax/mathjax.cjs +1 -1
  52. package/dist/mathjax/mathjax.cjs.map +1 -1
  53. package/dist/mathjax/mathjax.js +9 -9
  54. package/dist/mathjax/mathjax.js.map +1 -1
  55. package/dist/paragraph/paragraph.cjs +1 -1
  56. package/dist/paragraph/paragraph.cjs.map +1 -1
  57. package/dist/paragraph/paragraph.js +5 -5
  58. package/dist/paragraph/paragraph.js.map +1 -1
  59. package/dist/speech-recognition/speech-recognition.cjs +1 -1
  60. package/dist/speech-recognition/speech-recognition.cjs.map +1 -1
  61. package/dist/speech-recognition/speech-recognition.js +29 -29
  62. package/dist/speech-recognition/speech-recognition.js.map +1 -1
  63. package/dist/speech-synthesis/speech-synthesis.cjs +1 -1
  64. package/dist/speech-synthesis/speech-synthesis.cjs.map +1 -1
  65. package/dist/speech-synthesis/speech-synthesis.js +8 -8
  66. package/dist/speech-synthesis/speech-synthesis.js.map +1 -1
  67. package/dist/table-cell/table-cell.cjs +1 -1
  68. package/dist/table-cell/table-cell.cjs.map +1 -1
  69. package/dist/table-cell/table-cell.js +10 -10
  70. package/dist/table-cell/table-cell.js.map +1 -1
  71. package/dist/transform/html-to-json/html-to-json.cjs +1 -1
  72. package/dist/transform/html-to-json/html-to-json.cjs.map +1 -1
  73. package/dist/transform/html-to-json/html-to-json.js +3 -3
  74. package/dist/transform/html-to-json/html-to-json.js.map +1 -1
  75. package/dist/transform/json-to-html/json-to-html.cjs +1 -1
  76. package/dist/transform/json-to-html/json-to-html.cjs.map +1 -1
  77. package/dist/transform/json-to-html/json-to-html.js +3 -3
  78. package/dist/transform/json-to-html/json-to-html.js.map +1 -1
  79. package/dist/video/video.cjs +9 -9
  80. package/dist/video/video.cjs.map +1 -1
  81. package/dist/video/video.js +40 -40
  82. package/dist/video/video.js.map +1 -1
  83. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),Abbr=core.Mark.create({name:"abbr",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"abbr"}]},renderHTML({HTMLAttributes}){return["abbr",core.mergeAttributes(this.options.HTMLAttributes,HTMLAttributes),0]},addCommands(){return{setAbbr:()=>({commands})=>commands.setMark(this.name),toggleAbbr:()=>({commands})=>commands.toggleMark(this.name)}}});exports.Abbr=Abbr;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@tiptap/core"),e=t.Mark.create({name:"abbr",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"abbr"}]},renderHTML({HTMLAttributes:r}){return["abbr",t.mergeAttributes(this.options.HTMLAttributes,r),0]},addCommands(){return{setAbbr:()=>({commands:r})=>r.setMark(this.name),toggleAbbr:()=>({commands:r})=>r.toggleMark(this.name)}}});exports.Abbr=e;
2
2
  //# sourceMappingURL=abbr.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"abbr.cjs","sources":["../../src/abbr/abbr.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core';\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n abbr: {\n /**\n * Set an abbr mark\n */\n setAbbr: (src: string) => ReturnType;\n /**\n * Toggle an abbr mark\n */\n toggleAbbr: (src: string) => ReturnType;\n };\n }\n}\n\nexport const Abbr = Mark.create({\n name: 'abbr',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'abbr',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'abbr',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setAbbr:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleAbbr:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n };\n },\n});\n"],"names":["Mark","mergeAttributes"],"mappings":"mHAiBa,KAAOA,UAAK,OAAO,CAC9B,KAAM,OAEN,YAAa,CACJ,MAAA,CACL,eAAgB,CAAC,CAAA,CAErB,EAEA,WAAY,CACH,MAAA,CACL,CACE,IAAK,MACP,CAAA,CAEJ,EAEA,WAAW,CAAE,gBAAkB,CACtB,MAAA,CACL,OACAC,KAAAA,gBAAgB,KAAK,QAAQ,eAAgB,cAAc,EAC3D,CAAA,CAEJ,EAEA,aAAc,CACL,MAAA,CACL,QACE,IACA,CAAC,CAAE,YACM,SAAS,QAAQ,KAAK,IAAI,EAErC,WACE,IACA,CAAC,CAAE,YACM,SAAS,WAAW,KAAK,IAAI,CACtC,CAEN,CACF,CAAC"}
1
+ {"version":3,"file":"abbr.cjs","sources":["../../src/abbr/abbr.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core';\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n abbr: {\n /**\n * Set an abbr mark\n */\n setAbbr: (src: string) => ReturnType;\n /**\n * Toggle an abbr mark\n */\n toggleAbbr: (src: string) => ReturnType;\n };\n }\n}\n\nexport const Abbr = Mark.create({\n name: 'abbr',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'abbr',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'abbr',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setAbbr:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleAbbr:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n };\n },\n});\n"],"names":["Abbr","Mark","HTMLAttributes","mergeAttributes","commands"],"mappings":"gHAiBaA,EAAOC,OAAK,OAAO,CAC9B,KAAM,OAEN,YAAa,CACJ,MAAA,CACL,eAAgB,CAAC,CAAA,CAErB,EAEA,WAAY,CACH,MAAA,CACL,CACE,IAAK,MACP,CAAA,CAEJ,EAEA,WAAW,CAAE,eAAAC,GAAkB,CACtB,MAAA,CACL,OACAC,EAAAA,gBAAgB,KAAK,QAAQ,eAAgBD,CAAc,EAC3D,CAAA,CAEJ,EAEA,aAAc,CACL,MAAA,CACL,QACE,IACA,CAAC,CAAE,SAAAE,KACMA,EAAS,QAAQ,KAAK,IAAI,EAErC,WACE,IACA,CAAC,CAAE,SAAAA,KACMA,EAAS,WAAW,KAAK,IAAI,CACtC,CAEN,CACF,CAAC"}
package/dist/abbr/abbr.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Mark, mergeAttributes } from "@tiptap/core";
2
- const Abbr = Mark.create({
1
+ import { Mark as t, mergeAttributes as e } from "@tiptap/core";
2
+ const b = t.create({
3
3
  name: "abbr",
4
4
  addOptions() {
5
5
  return {
@@ -13,21 +13,21 @@ const Abbr = Mark.create({
13
13
  }
14
14
  ];
15
15
  },
16
- renderHTML({ HTMLAttributes }) {
16
+ renderHTML({ HTMLAttributes: r }) {
17
17
  return [
18
18
  "abbr",
19
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
19
+ e(this.options.HTMLAttributes, r),
20
20
  0
21
21
  ];
22
22
  },
23
23
  addCommands() {
24
24
  return {
25
- setAbbr: () => ({ commands }) => commands.setMark(this.name),
26
- toggleAbbr: () => ({ commands }) => commands.toggleMark(this.name)
25
+ setAbbr: () => ({ commands: r }) => r.setMark(this.name),
26
+ toggleAbbr: () => ({ commands: r }) => r.toggleMark(this.name)
27
27
  };
28
28
  }
29
29
  });
30
30
  export {
31
- Abbr
31
+ b as Abbr
32
32
  };
33
33
  //# sourceMappingURL=abbr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"abbr.js","sources":["../../src/abbr/abbr.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core';\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n abbr: {\n /**\n * Set an abbr mark\n */\n setAbbr: (src: string) => ReturnType;\n /**\n * Toggle an abbr mark\n */\n toggleAbbr: (src: string) => ReturnType;\n };\n }\n}\n\nexport const Abbr = Mark.create({\n name: 'abbr',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'abbr',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'abbr',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setAbbr:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleAbbr:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n };\n },\n});\n"],"names":[],"mappings":";AAiBa,MAAA,OAAO,KAAK,OAAO;AAAA,EAC9B,MAAM;AAAA,EAEN,aAAa;AACJ,WAAA;AAAA,MACL,gBAAgB,CAAC;AAAA,IAAA;AAAA,EAErB;AAAA,EAEA,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACP;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,WAAW,EAAE,kBAAkB;AACtB,WAAA;AAAA,MACL;AAAA,MACA,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc;AAAA,MAC3D;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,SACE,MACA,CAAC,EAAE,eACM,SAAS,QAAQ,KAAK,IAAI;AAAA,MAErC,YACE,MACA,CAAC,EAAE,eACM,SAAS,WAAW,KAAK,IAAI;AAAA,IACtC;AAAA,EAEN;AACF,CAAC;"}
1
+ {"version":3,"file":"abbr.js","sources":["../../src/abbr/abbr.ts"],"sourcesContent":["import { Mark, mergeAttributes } from '@tiptap/core';\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n abbr: {\n /**\n * Set an abbr mark\n */\n setAbbr: (src: string) => ReturnType;\n /**\n * Toggle an abbr mark\n */\n toggleAbbr: (src: string) => ReturnType;\n };\n }\n}\n\nexport const Abbr = Mark.create({\n name: 'abbr',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'abbr',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'abbr',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setAbbr:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleAbbr:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n };\n },\n});\n"],"names":["Abbr","Mark","HTMLAttributes","mergeAttributes","commands"],"mappings":";AAiBa,MAAAA,IAAOC,EAAK,OAAO;AAAA,EAC9B,MAAM;AAAA,EAEN,aAAa;AACJ,WAAA;AAAA,MACL,gBAAgB,CAAC;AAAA,IAAA;AAAA,EAErB;AAAA,EAEA,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACP;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,WAAW,EAAE,gBAAAC,KAAkB;AACtB,WAAA;AAAA,MACL;AAAA,MACAC,EAAgB,KAAK,QAAQ,gBAAgBD,CAAc;AAAA,MAC3D;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,SACE,MACA,CAAC,EAAE,UAAAE,QACMA,EAAS,QAAQ,KAAK,IAAI;AAAA,MAErC,YACE,MACA,CAAC,EAAE,UAAAA,QACMA,EAAS,WAAW,KAAK,IAAI;AAAA,IACtC;AAAA,EAEN;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),Alert=core.Node.create({name:"alert",content:"inline+",marks:"",group:"block",inline:!1,selectable:!0,draggable:!0,parseHTML(){return[{tag:"p.info",priority:60},{tag:"p.warning",priority:60},{tag:"div.info",priority:60},{tag:"div.warning",priority:60}]},addAttributes(){return{class:{default:"info",parseHTML:element=>element.getAttribute("class")}}},renderHTML({HTMLAttributes}){return["div",HTMLAttributes,0]}});exports.Alert=Alert;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@tiptap/core"),t=e.Node.create({name:"alert",content:"inline+",marks:"",group:"block",inline:!1,selectable:!0,draggable:!0,parseHTML(){return[{tag:"p.info",priority:60},{tag:"p.warning",priority:60},{tag:"div.info",priority:60},{tag:"div.warning",priority:60}]},addAttributes(){return{class:{default:"info",parseHTML:r=>r.getAttribute("class")}}},renderHTML({HTMLAttributes:r}){return["div",r,0]}});exports.Alert=t;
2
2
  //# sourceMappingURL=alert.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.cjs","sources":["../../src/alert/alert.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport const Alert = Node.create({\n name: 'alert',\n content: 'inline+',\n marks: '',\n group: 'block',\n\n inline: false,\n selectable: true,\n draggable: true,\n\n parseHTML() {\n return [\n {\n tag: 'p.info',\n priority: 60,\n },\n {\n tag: 'p.warning',\n priority: 60,\n },\n {\n tag: 'div.info',\n priority: 60,\n },\n {\n tag: 'div.warning',\n priority: 60,\n },\n ];\n },\n addAttributes() {\n return {\n class: {\n default: 'info',\n parseHTML: (element) => {\n return element.getAttribute('class');\n },\n },\n };\n },\n renderHTML({ HTMLAttributes }) {\n return ['div', HTMLAttributes, 0];\n },\n});\n"],"names":["Node"],"mappings":"mHAEa,MAAQA,UAAK,OAAO,CAC/B,KAAM,QACN,QAAS,UACT,MAAO,GACP,MAAO,QAEP,OAAQ,GACR,WAAY,GACZ,UAAW,GAEX,WAAY,CACH,MAAA,CACL,CACE,IAAK,SACL,SAAU,EACZ,EACA,CACE,IAAK,YACL,SAAU,EACZ,EACA,CACE,IAAK,WACL,SAAU,EACZ,EACA,CACE,IAAK,cACL,SAAU,EACZ,CAAA,CAEJ,EACA,eAAgB,CACP,MAAA,CACL,MAAO,CACL,QAAS,OACT,UAAY,SACH,QAAQ,aAAa,OAAO,CAEvC,CAAA,CAEJ,EACA,WAAW,CAAE,gBAAkB,CACtB,MAAA,CAAC,MAAO,eAAgB,CAAC,CAClC,CACF,CAAC"}
1
+ {"version":3,"file":"alert.cjs","sources":["../../src/alert/alert.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport const Alert = Node.create({\n name: 'alert',\n content: 'inline+',\n marks: '',\n group: 'block',\n\n inline: false,\n selectable: true,\n draggable: true,\n\n parseHTML() {\n return [\n {\n tag: 'p.info',\n priority: 60,\n },\n {\n tag: 'p.warning',\n priority: 60,\n },\n {\n tag: 'div.info',\n priority: 60,\n },\n {\n tag: 'div.warning',\n priority: 60,\n },\n ];\n },\n addAttributes() {\n return {\n class: {\n default: 'info',\n parseHTML: (element) => {\n return element.getAttribute('class');\n },\n },\n };\n },\n renderHTML({ HTMLAttributes }) {\n return ['div', HTMLAttributes, 0];\n },\n});\n"],"names":["Alert","Node","element","HTMLAttributes"],"mappings":"gHAEaA,EAAQC,OAAK,OAAO,CAC/B,KAAM,QACN,QAAS,UACT,MAAO,GACP,MAAO,QAEP,OAAQ,GACR,WAAY,GACZ,UAAW,GAEX,WAAY,CACH,MAAA,CACL,CACE,IAAK,SACL,SAAU,EACZ,EACA,CACE,IAAK,YACL,SAAU,EACZ,EACA,CACE,IAAK,WACL,SAAU,EACZ,EACA,CACE,IAAK,cACL,SAAU,EACZ,CAAA,CAEJ,EACA,eAAgB,CACP,MAAA,CACL,MAAO,CACL,QAAS,OACT,UAAYC,GACHA,EAAQ,aAAa,OAAO,CAEvC,CAAA,CAEJ,EACA,WAAW,CAAE,eAAAC,GAAkB,CACtB,MAAA,CAAC,MAAOA,EAAgB,CAAC,CAClC,CACF,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Node } from "@tiptap/core";
2
- const Alert = Node.create({
1
+ import { Node as t } from "@tiptap/core";
2
+ const i = t.create({
3
3
  name: "alert",
4
4
  content: "inline+",
5
5
  marks: "",
@@ -31,15 +31,15 @@ const Alert = Node.create({
31
31
  return {
32
32
  class: {
33
33
  default: "info",
34
- parseHTML: (element) => element.getAttribute("class")
34
+ parseHTML: (r) => r.getAttribute("class")
35
35
  }
36
36
  };
37
37
  },
38
- renderHTML({ HTMLAttributes }) {
39
- return ["div", HTMLAttributes, 0];
38
+ renderHTML({ HTMLAttributes: r }) {
39
+ return ["div", r, 0];
40
40
  }
41
41
  });
42
42
  export {
43
- Alert
43
+ i as Alert
44
44
  };
45
45
  //# sourceMappingURL=alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","sources":["../../src/alert/alert.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport const Alert = Node.create({\n name: 'alert',\n content: 'inline+',\n marks: '',\n group: 'block',\n\n inline: false,\n selectable: true,\n draggable: true,\n\n parseHTML() {\n return [\n {\n tag: 'p.info',\n priority: 60,\n },\n {\n tag: 'p.warning',\n priority: 60,\n },\n {\n tag: 'div.info',\n priority: 60,\n },\n {\n tag: 'div.warning',\n priority: 60,\n },\n ];\n },\n addAttributes() {\n return {\n class: {\n default: 'info',\n parseHTML: (element) => {\n return element.getAttribute('class');\n },\n },\n };\n },\n renderHTML({ HTMLAttributes }) {\n return ['div', HTMLAttributes, 0];\n },\n});\n"],"names":[],"mappings":";AAEa,MAAA,QAAQ,KAAK,OAAO;AAAA,EAC/B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EAEP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EAEX,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAAA,IAAA;AAAA,EAEJ;AAAA,EACA,gBAAgB;AACP,WAAA;AAAA,MACL,OAAO;AAAA,QACL,SAAS;AAAA,QACT,WAAW,CAAC,YACH,QAAQ,aAAa,OAAO;AAAA,MAEvC;AAAA,IAAA;AAAA,EAEJ;AAAA,EACA,WAAW,EAAE,kBAAkB;AACtB,WAAA,CAAC,OAAO,gBAAgB,CAAC;AAAA,EAClC;AACF,CAAC;"}
1
+ {"version":3,"file":"alert.js","sources":["../../src/alert/alert.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport const Alert = Node.create({\n name: 'alert',\n content: 'inline+',\n marks: '',\n group: 'block',\n\n inline: false,\n selectable: true,\n draggable: true,\n\n parseHTML() {\n return [\n {\n tag: 'p.info',\n priority: 60,\n },\n {\n tag: 'p.warning',\n priority: 60,\n },\n {\n tag: 'div.info',\n priority: 60,\n },\n {\n tag: 'div.warning',\n priority: 60,\n },\n ];\n },\n addAttributes() {\n return {\n class: {\n default: 'info',\n parseHTML: (element) => {\n return element.getAttribute('class');\n },\n },\n };\n },\n renderHTML({ HTMLAttributes }) {\n return ['div', HTMLAttributes, 0];\n },\n});\n"],"names":["Alert","Node","element","HTMLAttributes"],"mappings":";AAEa,MAAAA,IAAQC,EAAK,OAAO;AAAA,EAC/B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EAEP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EAEX,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAAA,IAAA;AAAA,EAEJ;AAAA,EACA,gBAAgB;AACP,WAAA;AAAA,MACL,OAAO;AAAA,QACL,SAAS;AAAA,QACT,WAAW,CAACC,MACHA,EAAQ,aAAa,OAAO;AAAA,MAEvC;AAAA,IAAA;AAAA,EAEJ;AAAA,EACA,WAAW,EAAE,gBAAAC,KAAkB;AACtB,WAAA,CAAC,OAAOA,GAAgB,CAAC;AAAA,EAClC;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),Attachment=core.Node.create({name:"attachments",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){return{HTMLAttributes:{class:"attachments"}}},parseHTML(){return[{tag:"div[class=attachments]"}]},renderHTML({HTMLAttributes}){const renderedLinks=HTMLAttributes.links.map(el=>["a",{name:el.name,href:el.href,documentId:el.documentId,dataContentType:el.dataContentType},el.name]);return["div",this.options.HTMLAttributes,...renderedLinks]},addAttributes(){return{links:{default:[],parseHTML:element=>{const links=element.getElementsByTagName("a"),parsedLinks=[];for(let i=0;i<links.length;i++){const link=links[i],href=link.getAttribute("href"),name=link.textContent,regexResult=href.match(/([^/]+$)/),documentId=link.getAttribute("data-document-id")||regexResult&&regexResult[0],dataContentType=link.getAttribute("data-content-type");parsedLinks.push({href,name,documentId,dataContentType})}return parsedLinks},renderHTML:attributes=>({links:attributes.links.map(link=>({href:link.href,name:link.name,documentId:link.documentId,dataContentType:link.dataContentType}))})}}},addCommands(){return{setAttachment:(attrs={dataContentType:"",name:"",documentId:"",href:""})=>({chain})=>chain().insertContent({type:this.name,attrs}).run()}}});exports.Attachment=Attachment;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@tiptap/core"),i=m.Node.create({name:"attachments",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){return{HTMLAttributes:{class:"attachments"}}},parseHTML(){return[{tag:"div[class=attachments]"}]},renderHTML({HTMLAttributes:n}){const a=n.links.map(e=>["a",{name:e.name,href:e.href,documentId:e.documentId,dataContentType:e.dataContentType},e.name]);return["div",this.options.HTMLAttributes,...a]},addAttributes(){return{links:{default:[],parseHTML:n=>{const t=n.getElementsByTagName("a"),a=[];for(let e=0;e<t.length;e++){const r=t[e],s=r.getAttribute("href"),d=r.textContent,o=s.match(/([^/]+$)/),c=r.getAttribute("data-document-id")||o&&o[0],u=r.getAttribute("data-content-type");a.push({href:s,name:d,documentId:c,dataContentType:u})}return a},renderHTML:n=>({links:n.links.map(t=>({href:t.href,name:t.name,documentId:t.documentId,dataContentType:t.dataContentType}))})}}},addCommands(){return{setAttachment:(n={dataContentType:"",name:"",documentId:"",href:""})=>({chain:t})=>t().insertContent({type:this.name,attrs:n}).run()}}});exports.Attachment=i;
2
2
  //# sourceMappingURL=attachment.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.cjs","sources":["../../src/attachment/attachment.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface AttachmentOptions {\n HTMLAttributes: Record<string, string>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n attachment: {\n setAttachment: (attachment) => ReturnType;\n };\n }\n}\n\nexport const Attachment = Node.create<AttachmentOptions>({\n name: 'attachments',\n content: '',\n marks: '',\n group: 'block',\n selectable: true,\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n HTMLAttributes: {\n class: 'attachments',\n },\n };\n },\n\n parseHTML() {\n return [{ tag: 'div[class=attachments]' }];\n },\n\n renderHTML({ HTMLAttributes }) {\n const links = HTMLAttributes.links;\n\n const renderedLinks = links.map((el) => {\n return [\n 'a',\n {\n name: el.name,\n href: el.href,\n documentId: el.documentId,\n dataContentType: el.dataContentType,\n },\n el.name,\n ];\n });\n\n return ['div', this.options.HTMLAttributes, ...renderedLinks];\n },\n\n addAttributes() {\n return {\n links: {\n default: [],\n parseHTML: (element) => {\n const links = element.getElementsByTagName('a');\n const parsedLinks = [];\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const href = link.getAttribute('href');\n const name = link.textContent;\n const regexResult = href.match(/([^/]+$)/);\n const documentId =\n link.getAttribute('data-document-id') ||\n (regexResult && regexResult[0]);\n const dataContentType = link.getAttribute('data-content-type');\n\n parsedLinks.push({\n href,\n name,\n documentId,\n dataContentType,\n });\n }\n\n return parsedLinks;\n },\n renderHTML: (attributes) => {\n return {\n links: attributes.links.map((link) => ({\n href: link.href,\n name: link.name,\n documentId: link.documentId,\n dataContentType: link.dataContentType,\n })),\n };\n },\n },\n };\n },\n\n addCommands() {\n return {\n setAttachment:\n (\n attrs = {\n dataContentType: '',\n name: '',\n documentId: '',\n href: '',\n },\n ) =>\n ({ chain }) => {\n return chain().insertContent({ type: this.name, attrs }).run();\n },\n };\n },\n});\n"],"names":["Node"],"mappings":"mHAca,WAAaA,UAAK,OAA0B,CACvD,KAAM,cACN,QAAS,GACT,MAAO,GACP,MAAO,QACP,WAAY,GACZ,KAAM,GACN,UAAW,GAEX,YAAa,CACJ,MAAA,CACL,eAAgB,CACd,MAAO,aACT,CAAA,CAEJ,EAEA,WAAY,CACV,MAAO,CAAC,CAAE,IAAK,wBAAA,CAA0B,CAC3C,EAEA,WAAW,CAAE,gBAAkB,CAG7B,MAAM,cAFQ,eAAe,MAED,IAAK,IACxB,CACL,IACA,CACE,KAAM,GAAG,KACT,KAAM,GAAG,KACT,WAAY,GAAG,WACf,gBAAiB,GAAG,eACtB,EACA,GAAG,IAAA,CAEN,EAED,MAAO,CAAC,MAAO,KAAK,QAAQ,eAAgB,GAAG,aAAa,CAC9D,EAEA,eAAgB,CACP,MAAA,CACL,MAAO,CACL,QAAS,CAAC,EACV,UAAY,SAAY,CAChB,MAAA,MAAQ,QAAQ,qBAAqB,GAAG,EACxC,YAAc,CAAA,EAEpB,QAAS,EAAI,EAAG,EAAI,MAAM,OAAQ,IAAK,CAC/B,MAAA,KAAO,MAAM,CAAC,EACd,KAAO,KAAK,aAAa,MAAM,EAC/B,KAAO,KAAK,YACZ,YAAc,KAAK,MAAM,UAAU,EACnC,WACJ,KAAK,aAAa,kBAAkB,GACnC,aAAe,YAAY,CAAC,EACzB,gBAAkB,KAAK,aAAa,mBAAmB,EAE7D,YAAY,KAAK,CACf,KACA,KACA,WACA,eAAA,CACD,CACH,CAEO,OAAA,WACT,EACA,WAAa,aACJ,CACL,MAAO,WAAW,MAAM,IAAK,OAAU,CACrC,KAAM,KAAK,KACX,KAAM,KAAK,KACX,WAAY,KAAK,WACjB,gBAAiB,KAAK,eAAA,EACtB,CAAA,EAGR,CAAA,CAEJ,EAEA,aAAc,CACL,MAAA,CACL,cACE,CACE,MAAQ,CACN,gBAAiB,GACjB,KAAM,GACN,WAAY,GACZ,KAAM,EAAA,IAGV,CAAC,CAAE,SACM,MAAA,EAAQ,cAAc,CAAE,KAAM,KAAK,KAAM,KAAA,CAAO,EAAE,KAC3D,CAEN,CACF,CAAC"}
1
+ {"version":3,"file":"attachment.cjs","sources":["../../src/attachment/attachment.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface AttachmentOptions {\n HTMLAttributes: Record<string, string>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n attachment: {\n setAttachment: (attachment) => ReturnType;\n };\n }\n}\n\nexport const Attachment = Node.create<AttachmentOptions>({\n name: 'attachments',\n content: '',\n marks: '',\n group: 'block',\n selectable: true,\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n HTMLAttributes: {\n class: 'attachments',\n },\n };\n },\n\n parseHTML() {\n return [{ tag: 'div[class=attachments]' }];\n },\n\n renderHTML({ HTMLAttributes }) {\n const links = HTMLAttributes.links;\n\n const renderedLinks = links.map((el) => {\n return [\n 'a',\n {\n name: el.name,\n href: el.href,\n documentId: el.documentId,\n dataContentType: el.dataContentType,\n },\n el.name,\n ];\n });\n\n return ['div', this.options.HTMLAttributes, ...renderedLinks];\n },\n\n addAttributes() {\n return {\n links: {\n default: [],\n parseHTML: (element) => {\n const links = element.getElementsByTagName('a');\n const parsedLinks = [];\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const href = link.getAttribute('href');\n const name = link.textContent;\n const regexResult = href.match(/([^/]+$)/);\n const documentId =\n link.getAttribute('data-document-id') ||\n (regexResult && regexResult[0]);\n const dataContentType = link.getAttribute('data-content-type');\n\n parsedLinks.push({\n href,\n name,\n documentId,\n dataContentType,\n });\n }\n\n return parsedLinks;\n },\n renderHTML: (attributes) => {\n return {\n links: attributes.links.map((link) => ({\n href: link.href,\n name: link.name,\n documentId: link.documentId,\n dataContentType: link.dataContentType,\n })),\n };\n },\n },\n };\n },\n\n addCommands() {\n return {\n setAttachment:\n (\n attrs = {\n dataContentType: '',\n name: '',\n documentId: '',\n href: '',\n },\n ) =>\n ({ chain }) => {\n return chain().insertContent({ type: this.name, attrs }).run();\n },\n };\n },\n});\n"],"names":["Attachment","Node","HTMLAttributes","renderedLinks","el","element","links","parsedLinks","i","link","href","name","regexResult","documentId","dataContentType","attributes","attrs","chain"],"mappings":"gHAcaA,EAAaC,OAAK,OAA0B,CACvD,KAAM,cACN,QAAS,GACT,MAAO,GACP,MAAO,QACP,WAAY,GACZ,KAAM,GACN,UAAW,GAEX,YAAa,CACJ,MAAA,CACL,eAAgB,CACd,MAAO,aACT,CAAA,CAEJ,EAEA,WAAY,CACV,MAAO,CAAC,CAAE,IAAK,wBAAA,CAA0B,CAC3C,EAEA,WAAW,CAAE,eAAAC,GAAkB,CAG7B,MAAMC,EAFQD,EAAe,MAED,IAAKE,GACxB,CACL,IACA,CACE,KAAMA,EAAG,KACT,KAAMA,EAAG,KACT,WAAYA,EAAG,WACf,gBAAiBA,EAAG,eACtB,EACAA,EAAG,IAAA,CAEN,EAED,MAAO,CAAC,MAAO,KAAK,QAAQ,eAAgB,GAAGD,CAAa,CAC9D,EAEA,eAAgB,CACP,MAAA,CACL,MAAO,CACL,QAAS,CAAC,EACV,UAAYE,GAAY,CAChB,MAAAC,EAAQD,EAAQ,qBAAqB,GAAG,EACxCE,EAAc,CAAA,EAEpB,QAASC,EAAI,EAAGA,EAAIF,EAAM,OAAQE,IAAK,CAC/B,MAAAC,EAAOH,EAAME,CAAC,EACdE,EAAOD,EAAK,aAAa,MAAM,EAC/BE,EAAOF,EAAK,YACZG,EAAcF,EAAK,MAAM,UAAU,EACnCG,EACJJ,EAAK,aAAa,kBAAkB,GACnCG,GAAeA,EAAY,CAAC,EACzBE,EAAkBL,EAAK,aAAa,mBAAmB,EAE7DF,EAAY,KAAK,CACf,KAAAG,EACA,KAAAC,EACA,WAAAE,EACA,gBAAAC,CAAA,CACD,CACH,CAEO,OAAAP,CACT,EACA,WAAaQ,IACJ,CACL,MAAOA,EAAW,MAAM,IAAKN,IAAU,CACrC,KAAMA,EAAK,KACX,KAAMA,EAAK,KACX,WAAYA,EAAK,WACjB,gBAAiBA,EAAK,eAAA,EACtB,CAAA,EAGR,CAAA,CAEJ,EAEA,aAAc,CACL,MAAA,CACL,cACE,CACEO,EAAQ,CACN,gBAAiB,GACjB,KAAM,GACN,WAAY,GACZ,KAAM,EAAA,IAGV,CAAC,CAAE,MAAAC,KACMA,EAAA,EAAQ,cAAc,CAAE,KAAM,KAAK,KAAM,MAAAD,CAAA,CAAO,EAAE,KAC3D,CAEN,CACF,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Node } from "@tiptap/core";
2
- const Attachment = Node.create({
1
+ import { Node as u } from "@tiptap/core";
2
+ const p = u.create({
3
3
  name: "attachments",
4
4
  content: "",
5
5
  marks: "",
@@ -17,42 +17,42 @@ const Attachment = Node.create({
17
17
  parseHTML() {
18
18
  return [{ tag: "div[class=attachments]" }];
19
19
  },
20
- renderHTML({ HTMLAttributes }) {
21
- const renderedLinks = HTMLAttributes.links.map((el) => [
20
+ renderHTML({ HTMLAttributes: n }) {
21
+ const a = n.links.map((e) => [
22
22
  "a",
23
23
  {
24
- name: el.name,
25
- href: el.href,
26
- documentId: el.documentId,
27
- dataContentType: el.dataContentType
24
+ name: e.name,
25
+ href: e.href,
26
+ documentId: e.documentId,
27
+ dataContentType: e.dataContentType
28
28
  },
29
- el.name
29
+ e.name
30
30
  ]);
31
- return ["div", this.options.HTMLAttributes, ...renderedLinks];
31
+ return ["div", this.options.HTMLAttributes, ...a];
32
32
  },
33
33
  addAttributes() {
34
34
  return {
35
35
  links: {
36
36
  default: [],
37
- parseHTML: (element) => {
38
- const links = element.getElementsByTagName("a"), parsedLinks = [];
39
- for (let i = 0; i < links.length; i++) {
40
- const link = links[i], href = link.getAttribute("href"), name = link.textContent, regexResult = href.match(/([^/]+$)/), documentId = link.getAttribute("data-document-id") || regexResult && regexResult[0], dataContentType = link.getAttribute("data-content-type");
41
- parsedLinks.push({
42
- href,
43
- name,
44
- documentId,
45
- dataContentType
37
+ parseHTML: (n) => {
38
+ const t = n.getElementsByTagName("a"), a = [];
39
+ for (let e = 0; e < t.length; e++) {
40
+ const r = t[e], s = r.getAttribute("href"), d = r.textContent, o = s.match(/([^/]+$)/), m = r.getAttribute("data-document-id") || o && o[0], c = r.getAttribute("data-content-type");
41
+ a.push({
42
+ href: s,
43
+ name: d,
44
+ documentId: m,
45
+ dataContentType: c
46
46
  });
47
47
  }
48
- return parsedLinks;
48
+ return a;
49
49
  },
50
- renderHTML: (attributes) => ({
51
- links: attributes.links.map((link) => ({
52
- href: link.href,
53
- name: link.name,
54
- documentId: link.documentId,
55
- dataContentType: link.dataContentType
50
+ renderHTML: (n) => ({
51
+ links: n.links.map((t) => ({
52
+ href: t.href,
53
+ name: t.name,
54
+ documentId: t.documentId,
55
+ dataContentType: t.dataContentType
56
56
  }))
57
57
  })
58
58
  }
@@ -60,16 +60,16 @@ const Attachment = Node.create({
60
60
  },
61
61
  addCommands() {
62
62
  return {
63
- setAttachment: (attrs = {
63
+ setAttachment: (n = {
64
64
  dataContentType: "",
65
65
  name: "",
66
66
  documentId: "",
67
67
  href: ""
68
- }) => ({ chain }) => chain().insertContent({ type: this.name, attrs }).run()
68
+ }) => ({ chain: t }) => t().insertContent({ type: this.name, attrs: n }).run()
69
69
  };
70
70
  }
71
71
  });
72
72
  export {
73
- Attachment
73
+ p as Attachment
74
74
  };
75
75
  //# sourceMappingURL=attachment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.js","sources":["../../src/attachment/attachment.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface AttachmentOptions {\n HTMLAttributes: Record<string, string>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n attachment: {\n setAttachment: (attachment) => ReturnType;\n };\n }\n}\n\nexport const Attachment = Node.create<AttachmentOptions>({\n name: 'attachments',\n content: '',\n marks: '',\n group: 'block',\n selectable: true,\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n HTMLAttributes: {\n class: 'attachments',\n },\n };\n },\n\n parseHTML() {\n return [{ tag: 'div[class=attachments]' }];\n },\n\n renderHTML({ HTMLAttributes }) {\n const links = HTMLAttributes.links;\n\n const renderedLinks = links.map((el) => {\n return [\n 'a',\n {\n name: el.name,\n href: el.href,\n documentId: el.documentId,\n dataContentType: el.dataContentType,\n },\n el.name,\n ];\n });\n\n return ['div', this.options.HTMLAttributes, ...renderedLinks];\n },\n\n addAttributes() {\n return {\n links: {\n default: [],\n parseHTML: (element) => {\n const links = element.getElementsByTagName('a');\n const parsedLinks = [];\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const href = link.getAttribute('href');\n const name = link.textContent;\n const regexResult = href.match(/([^/]+$)/);\n const documentId =\n link.getAttribute('data-document-id') ||\n (regexResult && regexResult[0]);\n const dataContentType = link.getAttribute('data-content-type');\n\n parsedLinks.push({\n href,\n name,\n documentId,\n dataContentType,\n });\n }\n\n return parsedLinks;\n },\n renderHTML: (attributes) => {\n return {\n links: attributes.links.map((link) => ({\n href: link.href,\n name: link.name,\n documentId: link.documentId,\n dataContentType: link.dataContentType,\n })),\n };\n },\n },\n };\n },\n\n addCommands() {\n return {\n setAttachment:\n (\n attrs = {\n dataContentType: '',\n name: '',\n documentId: '',\n href: '',\n },\n ) =>\n ({ chain }) => {\n return chain().insertContent({ type: this.name, attrs }).run();\n },\n };\n },\n});\n"],"names":[],"mappings":";AAca,MAAA,aAAa,KAAK,OAA0B;AAAA,EACvD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,aAAa;AACJ,WAAA;AAAA,MACL,gBAAgB;AAAA,QACd,OAAO;AAAA,MACT;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,YAAY;AACV,WAAO,CAAC,EAAE,KAAK,yBAAA,CAA0B;AAAA,EAC3C;AAAA,EAEA,WAAW,EAAE,kBAAkB;AAG7B,UAAM,gBAFQ,eAAe,MAED,IAAI,CAAC,OACxB;AAAA,MACL;AAAA,MACA;AAAA,QACE,MAAM,GAAG;AAAA,QACT,MAAM,GAAG;AAAA,QACT,YAAY,GAAG;AAAA,QACf,iBAAiB,GAAG;AAAA,MACtB;AAAA,MACA,GAAG;AAAA,IAAA,CAEN;AAED,WAAO,CAAC,OAAO,KAAK,QAAQ,gBAAgB,GAAG,aAAa;AAAA,EAC9D;AAAA,EAEA,gBAAgB;AACP,WAAA;AAAA,MACL,OAAO;AAAA,QACL,SAAS,CAAC;AAAA,QACV,WAAW,CAAC,YAAY;AAChB,gBAAA,QAAQ,QAAQ,qBAAqB,GAAG,GACxC,cAAc,CAAA;AAEpB,mBAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AAC/B,kBAAA,OAAO,MAAM,CAAC,GACd,OAAO,KAAK,aAAa,MAAM,GAC/B,OAAO,KAAK,aACZ,cAAc,KAAK,MAAM,UAAU,GACnC,aACJ,KAAK,aAAa,kBAAkB,KACnC,eAAe,YAAY,CAAC,GACzB,kBAAkB,KAAK,aAAa,mBAAmB;AAE7D,wBAAY,KAAK;AAAA,cACf;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YAAA,CACD;AAAA,UACH;AAEO,iBAAA;AAAA,QACT;AAAA,QACA,YAAY,CAAC,gBACJ;AAAA,UACL,OAAO,WAAW,MAAM,IAAI,CAAC,UAAU;AAAA,YACrC,MAAM,KAAK;AAAA,YACX,MAAM,KAAK;AAAA,YACX,YAAY,KAAK;AAAA,YACjB,iBAAiB,KAAK;AAAA,UAAA,EACtB;AAAA,QAAA;AAAA,MAGR;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,eACE,CACE,QAAQ;AAAA,QACN,iBAAiB;AAAA,QACjB,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,MAAM;AAAA,MAAA,MAGV,CAAC,EAAE,YACM,MAAA,EAAQ,cAAc,EAAE,MAAM,KAAK,MAAM,MAAA,CAAO,EAAE;IAC3D;AAAA,EAEN;AACF,CAAC;"}
1
+ {"version":3,"file":"attachment.js","sources":["../../src/attachment/attachment.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface AttachmentOptions {\n HTMLAttributes: Record<string, string>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n attachment: {\n setAttachment: (attachment) => ReturnType;\n };\n }\n}\n\nexport const Attachment = Node.create<AttachmentOptions>({\n name: 'attachments',\n content: '',\n marks: '',\n group: 'block',\n selectable: true,\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n HTMLAttributes: {\n class: 'attachments',\n },\n };\n },\n\n parseHTML() {\n return [{ tag: 'div[class=attachments]' }];\n },\n\n renderHTML({ HTMLAttributes }) {\n const links = HTMLAttributes.links;\n\n const renderedLinks = links.map((el) => {\n return [\n 'a',\n {\n name: el.name,\n href: el.href,\n documentId: el.documentId,\n dataContentType: el.dataContentType,\n },\n el.name,\n ];\n });\n\n return ['div', this.options.HTMLAttributes, ...renderedLinks];\n },\n\n addAttributes() {\n return {\n links: {\n default: [],\n parseHTML: (element) => {\n const links = element.getElementsByTagName('a');\n const parsedLinks = [];\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const href = link.getAttribute('href');\n const name = link.textContent;\n const regexResult = href.match(/([^/]+$)/);\n const documentId =\n link.getAttribute('data-document-id') ||\n (regexResult && regexResult[0]);\n const dataContentType = link.getAttribute('data-content-type');\n\n parsedLinks.push({\n href,\n name,\n documentId,\n dataContentType,\n });\n }\n\n return parsedLinks;\n },\n renderHTML: (attributes) => {\n return {\n links: attributes.links.map((link) => ({\n href: link.href,\n name: link.name,\n documentId: link.documentId,\n dataContentType: link.dataContentType,\n })),\n };\n },\n },\n };\n },\n\n addCommands() {\n return {\n setAttachment:\n (\n attrs = {\n dataContentType: '',\n name: '',\n documentId: '',\n href: '',\n },\n ) =>\n ({ chain }) => {\n return chain().insertContent({ type: this.name, attrs }).run();\n },\n };\n },\n});\n"],"names":["Attachment","Node","HTMLAttributes","renderedLinks","el","element","links","parsedLinks","i","link","href","name","regexResult","documentId","dataContentType","attributes","attrs","chain"],"mappings":";AAca,MAAAA,IAAaC,EAAK,OAA0B;AAAA,EACvD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,aAAa;AACJ,WAAA;AAAA,MACL,gBAAgB;AAAA,QACd,OAAO;AAAA,MACT;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,YAAY;AACV,WAAO,CAAC,EAAE,KAAK,yBAAA,CAA0B;AAAA,EAC3C;AAAA,EAEA,WAAW,EAAE,gBAAAC,KAAkB;AAG7B,UAAMC,IAFQD,EAAe,MAED,IAAI,CAACE,MACxB;AAAA,MACL;AAAA,MACA;AAAA,QACE,MAAMA,EAAG;AAAA,QACT,MAAMA,EAAG;AAAA,QACT,YAAYA,EAAG;AAAA,QACf,iBAAiBA,EAAG;AAAA,MACtB;AAAA,MACAA,EAAG;AAAA,IAAA,CAEN;AAED,WAAO,CAAC,OAAO,KAAK,QAAQ,gBAAgB,GAAGD,CAAa;AAAA,EAC9D;AAAA,EAEA,gBAAgB;AACP,WAAA;AAAA,MACL,OAAO;AAAA,QACL,SAAS,CAAC;AAAA,QACV,WAAW,CAACE,MAAY;AAChB,gBAAAC,IAAQD,EAAQ,qBAAqB,GAAG,GACxCE,IAAc,CAAA;AAEpB,mBAASC,IAAI,GAAGA,IAAIF,EAAM,QAAQE,KAAK;AAC/B,kBAAAC,IAAOH,EAAME,CAAC,GACdE,IAAOD,EAAK,aAAa,MAAM,GAC/BE,IAAOF,EAAK,aACZG,IAAcF,EAAK,MAAM,UAAU,GACnCG,IACJJ,EAAK,aAAa,kBAAkB,KACnCG,KAAeA,EAAY,CAAC,GACzBE,IAAkBL,EAAK,aAAa,mBAAmB;AAE7D,YAAAF,EAAY,KAAK;AAAA,cACf,MAAAG;AAAA,cACA,MAAAC;AAAA,cACA,YAAAE;AAAA,cACA,iBAAAC;AAAA,YAAA,CACD;AAAA,UACH;AAEO,iBAAAP;AAAA,QACT;AAAA,QACA,YAAY,CAACQ,OACJ;AAAA,UACL,OAAOA,EAAW,MAAM,IAAI,CAACN,OAAU;AAAA,YACrC,MAAMA,EAAK;AAAA,YACX,MAAMA,EAAK;AAAA,YACX,YAAYA,EAAK;AAAA,YACjB,iBAAiBA,EAAK;AAAA,UAAA,EACtB;AAAA,QAAA;AAAA,MAGR;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,eACE,CACEO,IAAQ;AAAA,QACN,iBAAiB;AAAA,QACjB,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,MAAM;AAAA,MAAA,MAGV,CAAC,EAAE,OAAAC,QACMA,EAAA,EAAQ,cAAc,EAAE,MAAM,KAAK,MAAM,OAAAD,EAAA,CAAO,EAAE;IAC3D;AAAA,EAEN;AACF,CAAC;"}
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),Audio=core.Node.create({name:"audio",group:"block",addAttributes(){return{src:{default:null,parseHTML:el=>el.getAttribute("src"),renderHTML:attrs=>({src:attrs.src})},documentId:{default:"",renderHTML:attributes=>({"data-document-id":attributes.documentId}),parseHTML:element=>element.getAttribute("data-document-id")}}},parseHTML(){return[{tag:"div.audio-wrapper>audio,audio",getAttrs:el=>({src:el.getAttribute("src")})}]},renderHTML({HTMLAttributes}){return["div",{class:"audio-wrapper"},["audio",core.mergeAttributes(HTMLAttributes)]]},addCommands(){return{setAudio:(id,src,options)=>({commands,state})=>commands.insertContentAt(state.selection,`<audio
2
- src="${src}"
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@tiptap/core"),a=t.Node.create({name:"audio",group:"block",addAttributes(){return{src:{default:null,parseHTML:e=>e.getAttribute("src"),renderHTML:e=>({src:e.src})},documentId:{default:"",renderHTML:e=>({"data-document-id":e.documentId}),parseHTML:e=>e.getAttribute("data-document-id")}}},parseHTML(){return[{tag:"div.audio-wrapper>audio,audio",getAttrs:e=>({src:e.getAttribute("src")})}]},renderHTML({HTMLAttributes:e}){return["div",{class:"audio-wrapper"},["audio",t.mergeAttributes(e)]]},addCommands(){return{setAudio:(e,r,d)=>({commands:u,state:o})=>u.insertContentAt(o.selection,`<audio
2
+ src="${r}"
3
3
  controls preload="none"
4
- data-document-id="${id}"></audio>`,options)}}});exports.Audio=Audio;
4
+ data-document-id="${e}"></audio>`,d)}}});exports.Audio=a;
5
5
  //# sourceMappingURL=audio.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"audio.cjs","sources":["../../src/audio/audio.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core';\n\nexport interface AudioOptions {\n url: string;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n audio: {\n /**\n * Set a audio node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setAudio: (\n id: string,\n src: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n };\n }\n}\n\nexport const Audio = Node.create({\n name: 'audio',\n\n group: 'block',\n\n addAttributes() {\n return {\n src: {\n default: null,\n parseHTML: (el: any) => (el as HTMLSpanElement).getAttribute('src'),\n renderHTML: (attrs: any) => ({ src: attrs.src }),\n },\n documentId: {\n default: '',\n renderHTML: (attributes: any) => {\n return { 'data-document-id': attributes.documentId };\n },\n parseHTML: (element: any) => element.getAttribute('data-document-id'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'div.audio-wrapper>audio,audio',\n getAttrs: (el: any) => ({\n src: (el as HTMLAudioElement).getAttribute('src'),\n }),\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'div',\n { class: 'audio-wrapper' },\n ['audio', mergeAttributes(HTMLAttributes)],\n ];\n },\n\n addCommands() {\n return {\n setAudio:\n (id, src, options) =>\n ({ commands, state }) => {\n return commands.insertContentAt(\n state.selection,\n `<audio \n src=\"${src}\" \n controls preload=\"none\"\n data-document-id=\"${id}\"></audio>`,\n options,\n );\n },\n };\n },\n});\n"],"names":["Node","mergeAttributes"],"mappings":"mHAuBa,MAAQA,UAAK,OAAO,CAC/B,KAAM,QAEN,MAAO,QAEP,eAAgB,CACP,MAAA,CACL,IAAK,CACH,QAAS,KACT,UAAY,IAAa,GAAuB,aAAa,KAAK,EAClE,WAAa,QAAgB,CAAE,IAAK,MAAM,GAAI,EAChD,EACA,WAAY,CACV,QAAS,GACT,WAAa,aACJ,CAAE,mBAAoB,WAAW,aAE1C,UAAY,SAAiB,QAAQ,aAAa,kBAAkB,CACtE,CAAA,CAEJ,EAEA,WAAY,CACH,MAAA,CACL,CACE,IAAK,gCACL,SAAW,KAAa,CACtB,IAAM,GAAwB,aAAa,KAAK,CAAA,EAEpD,CAAA,CAEJ,EAEA,WAAW,CAAE,gBAAkB,CACtB,MAAA,CACL,MACA,CAAE,MAAO,eAAgB,EACzB,CAAC,QAASC,qBAAgB,cAAc,CAAC,CAAA,CAE7C,EAEA,aAAc,CACL,MAAA,CACL,SACE,CAAC,GAAI,IAAK,UACV,CAAC,CAAE,SAAU,SACJ,SAAS,gBACd,MAAM,UACN;AAAA,qBACS,GAAG;AAAA;AAAA,kCAEU,EAAE,aACxB,OAAA,CAEJ,CAEN,CACF,CAAC"}
1
+ {"version":3,"file":"audio.cjs","sources":["../../src/audio/audio.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core';\n\nexport interface AudioOptions {\n url: string;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n audio: {\n /**\n * Set a audio node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setAudio: (\n id: string,\n src: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n };\n }\n}\n\nexport const Audio = Node.create({\n name: 'audio',\n\n group: 'block',\n\n addAttributes() {\n return {\n src: {\n default: null,\n parseHTML: (el: any) => (el as HTMLSpanElement).getAttribute('src'),\n renderHTML: (attrs: any) => ({ src: attrs.src }),\n },\n documentId: {\n default: '',\n renderHTML: (attributes: any) => {\n return { 'data-document-id': attributes.documentId };\n },\n parseHTML: (element: any) => element.getAttribute('data-document-id'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'div.audio-wrapper>audio,audio',\n getAttrs: (el: any) => ({\n src: (el as HTMLAudioElement).getAttribute('src'),\n }),\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'div',\n { class: 'audio-wrapper' },\n ['audio', mergeAttributes(HTMLAttributes)],\n ];\n },\n\n addCommands() {\n return {\n setAudio:\n (id, src, options) =>\n ({ commands, state }) => {\n return commands.insertContentAt(\n state.selection,\n `<audio \n src=\"${src}\" \n controls preload=\"none\"\n data-document-id=\"${id}\"></audio>`,\n options,\n );\n },\n };\n },\n});\n"],"names":["Audio","Node","el","attrs","attributes","element","HTMLAttributes","mergeAttributes","id","src","options","commands","state"],"mappings":"gHAuBaA,EAAQC,OAAK,OAAO,CAC/B,KAAM,QAEN,MAAO,QAEP,eAAgB,CACP,MAAA,CACL,IAAK,CACH,QAAS,KACT,UAAYC,GAAaA,EAAuB,aAAa,KAAK,EAClE,WAAaC,IAAgB,CAAE,IAAKA,EAAM,GAAI,EAChD,EACA,WAAY,CACV,QAAS,GACT,WAAaC,IACJ,CAAE,mBAAoBA,EAAW,aAE1C,UAAYC,GAAiBA,EAAQ,aAAa,kBAAkB,CACtE,CAAA,CAEJ,EAEA,WAAY,CACH,MAAA,CACL,CACE,IAAK,gCACL,SAAWH,IAAa,CACtB,IAAMA,EAAwB,aAAa,KAAK,CAAA,EAEpD,CAAA,CAEJ,EAEA,WAAW,CAAE,eAAAI,GAAkB,CACtB,MAAA,CACL,MACA,CAAE,MAAO,eAAgB,EACzB,CAAC,QAASC,kBAAgBD,CAAc,CAAC,CAAA,CAE7C,EAEA,aAAc,CACL,MAAA,CACL,SACE,CAACE,EAAIC,EAAKC,IACV,CAAC,CAAE,SAAAC,EAAU,MAAAC,KACJD,EAAS,gBACdC,EAAM,UACN;AAAA,qBACSH,CAAG;AAAA;AAAA,kCAEUD,CAAE,aACxBE,CAAA,CAEJ,CAEN,CACF,CAAC"}
@@ -1,18 +1,18 @@
1
- import { Node, mergeAttributes } from "@tiptap/core";
2
- const Audio = Node.create({
1
+ import { Node as a, mergeAttributes as o } from "@tiptap/core";
2
+ const i = a.create({
3
3
  name: "audio",
4
4
  group: "block",
5
5
  addAttributes() {
6
6
  return {
7
7
  src: {
8
8
  default: null,
9
- parseHTML: (el) => el.getAttribute("src"),
10
- renderHTML: (attrs) => ({ src: attrs.src })
9
+ parseHTML: (t) => t.getAttribute("src"),
10
+ renderHTML: (t) => ({ src: t.src })
11
11
  },
12
12
  documentId: {
13
13
  default: "",
14
- renderHTML: (attributes) => ({ "data-document-id": attributes.documentId }),
15
- parseHTML: (element) => element.getAttribute("data-document-id")
14
+ renderHTML: (t) => ({ "data-document-id": t.documentId }),
15
+ parseHTML: (t) => t.getAttribute("data-document-id")
16
16
  }
17
17
  };
18
18
  },
@@ -20,33 +20,33 @@ const Audio = Node.create({
20
20
  return [
21
21
  {
22
22
  tag: "div.audio-wrapper>audio,audio",
23
- getAttrs: (el) => ({
24
- src: el.getAttribute("src")
23
+ getAttrs: (t) => ({
24
+ src: t.getAttribute("src")
25
25
  })
26
26
  }
27
27
  ];
28
28
  },
29
- renderHTML({ HTMLAttributes }) {
29
+ renderHTML({ HTMLAttributes: t }) {
30
30
  return [
31
31
  "div",
32
32
  { class: "audio-wrapper" },
33
- ["audio", mergeAttributes(HTMLAttributes)]
33
+ ["audio", o(t)]
34
34
  ];
35
35
  },
36
36
  addCommands() {
37
37
  return {
38
- setAudio: (id, src, options) => ({ commands, state }) => commands.insertContentAt(
39
- state.selection,
38
+ setAudio: (t, e, r) => ({ commands: d, state: u }) => d.insertContentAt(
39
+ u.selection,
40
40
  `<audio
41
- src="${src}"
41
+ src="${e}"
42
42
  controls preload="none"
43
- data-document-id="${id}"></audio>`,
44
- options
43
+ data-document-id="${t}"></audio>`,
44
+ r
45
45
  )
46
46
  };
47
47
  }
48
48
  });
49
49
  export {
50
- Audio
50
+ i as Audio
51
51
  };
52
52
  //# sourceMappingURL=audio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"audio.js","sources":["../../src/audio/audio.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core';\n\nexport interface AudioOptions {\n url: string;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n audio: {\n /**\n * Set a audio node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setAudio: (\n id: string,\n src: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n };\n }\n}\n\nexport const Audio = Node.create({\n name: 'audio',\n\n group: 'block',\n\n addAttributes() {\n return {\n src: {\n default: null,\n parseHTML: (el: any) => (el as HTMLSpanElement).getAttribute('src'),\n renderHTML: (attrs: any) => ({ src: attrs.src }),\n },\n documentId: {\n default: '',\n renderHTML: (attributes: any) => {\n return { 'data-document-id': attributes.documentId };\n },\n parseHTML: (element: any) => element.getAttribute('data-document-id'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'div.audio-wrapper>audio,audio',\n getAttrs: (el: any) => ({\n src: (el as HTMLAudioElement).getAttribute('src'),\n }),\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'div',\n { class: 'audio-wrapper' },\n ['audio', mergeAttributes(HTMLAttributes)],\n ];\n },\n\n addCommands() {\n return {\n setAudio:\n (id, src, options) =>\n ({ commands, state }) => {\n return commands.insertContentAt(\n state.selection,\n `<audio \n src=\"${src}\" \n controls preload=\"none\"\n data-document-id=\"${id}\"></audio>`,\n options,\n );\n },\n };\n },\n});\n"],"names":[],"mappings":";AAuBa,MAAA,QAAQ,KAAK,OAAO;AAAA,EAC/B,MAAM;AAAA,EAEN,OAAO;AAAA,EAEP,gBAAgB;AACP,WAAA;AAAA,MACL,KAAK;AAAA,QACH,SAAS;AAAA,QACT,WAAW,CAAC,OAAa,GAAuB,aAAa,KAAK;AAAA,QAClE,YAAY,CAAC,WAAgB,EAAE,KAAK,MAAM,IAAI;AAAA,MAChD;AAAA,MACA,YAAY;AAAA,QACV,SAAS;AAAA,QACT,YAAY,CAAC,gBACJ,EAAE,oBAAoB,WAAW;QAE1C,WAAW,CAAC,YAAiB,QAAQ,aAAa,kBAAkB;AAAA,MACtE;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,KAAK;AAAA,QACL,UAAU,CAAC,QAAa;AAAA,UACtB,KAAM,GAAwB,aAAa,KAAK;AAAA,QAAA;AAAA,MAEpD;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,WAAW,EAAE,kBAAkB;AACtB,WAAA;AAAA,MACL;AAAA,MACA,EAAE,OAAO,gBAAgB;AAAA,MACzB,CAAC,SAAS,gBAAgB,cAAc,CAAC;AAAA,IAAA;AAAA,EAE7C;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,UACE,CAAC,IAAI,KAAK,YACV,CAAC,EAAE,UAAU,YACJ,SAAS;AAAA,QACd,MAAM;AAAA,QACN;AAAA,qBACS,GAAG;AAAA;AAAA,kCAEU,EAAE;AAAA,QACxB;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEN;AACF,CAAC;"}
1
+ {"version":3,"file":"audio.js","sources":["../../src/audio/audio.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core';\n\nexport interface AudioOptions {\n url: string;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n audio: {\n /**\n * Set a audio node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setAudio: (\n id: string,\n src: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n };\n }\n}\n\nexport const Audio = Node.create({\n name: 'audio',\n\n group: 'block',\n\n addAttributes() {\n return {\n src: {\n default: null,\n parseHTML: (el: any) => (el as HTMLSpanElement).getAttribute('src'),\n renderHTML: (attrs: any) => ({ src: attrs.src }),\n },\n documentId: {\n default: '',\n renderHTML: (attributes: any) => {\n return { 'data-document-id': attributes.documentId };\n },\n parseHTML: (element: any) => element.getAttribute('data-document-id'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'div.audio-wrapper>audio,audio',\n getAttrs: (el: any) => ({\n src: (el as HTMLAudioElement).getAttribute('src'),\n }),\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'div',\n { class: 'audio-wrapper' },\n ['audio', mergeAttributes(HTMLAttributes)],\n ];\n },\n\n addCommands() {\n return {\n setAudio:\n (id, src, options) =>\n ({ commands, state }) => {\n return commands.insertContentAt(\n state.selection,\n `<audio \n src=\"${src}\" \n controls preload=\"none\"\n data-document-id=\"${id}\"></audio>`,\n options,\n );\n },\n };\n },\n});\n"],"names":["Audio","Node","el","attrs","attributes","element","HTMLAttributes","mergeAttributes","id","src","options","commands","state"],"mappings":";AAuBa,MAAAA,IAAQC,EAAK,OAAO;AAAA,EAC/B,MAAM;AAAA,EAEN,OAAO;AAAA,EAEP,gBAAgB;AACP,WAAA;AAAA,MACL,KAAK;AAAA,QACH,SAAS;AAAA,QACT,WAAW,CAACC,MAAaA,EAAuB,aAAa,KAAK;AAAA,QAClE,YAAY,CAACC,OAAgB,EAAE,KAAKA,EAAM,IAAI;AAAA,MAChD;AAAA,MACA,YAAY;AAAA,QACV,SAAS;AAAA,QACT,YAAY,CAACC,OACJ,EAAE,oBAAoBA,EAAW;QAE1C,WAAW,CAACC,MAAiBA,EAAQ,aAAa,kBAAkB;AAAA,MACtE;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,KAAK;AAAA,QACL,UAAU,CAACH,OAAa;AAAA,UACtB,KAAMA,EAAwB,aAAa,KAAK;AAAA,QAAA;AAAA,MAEpD;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,WAAW,EAAE,gBAAAI,KAAkB;AACtB,WAAA;AAAA,MACL;AAAA,MACA,EAAE,OAAO,gBAAgB;AAAA,MACzB,CAAC,SAASC,EAAgBD,CAAc,CAAC;AAAA,IAAA;AAAA,EAE7C;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,UACE,CAACE,GAAIC,GAAKC,MACV,CAAC,EAAE,UAAAC,GAAU,OAAAC,QACJD,EAAS;AAAA,QACdC,EAAM;AAAA,QACN;AAAA,qBACSH,CAAG;AAAA;AAAA,kCAEUD,CAAE;AAAA,QACxBE;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEN;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tiptap/extension-text-style");const core=require("@tiptap/core"),FontSize=core.Extension.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:element=>{var _a;return(_a=element.style.fontSize)==null?void 0:_a.replace(/['"]+/g,"")},renderHTML:attributes=>attributes.fontSize?{style:`font-size: ${attributes.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:fontSize=>({chain})=>chain().setMark("textStyle",{fontSize}).run(),unsetFontSize:()=>({chain})=>chain().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}});exports.FontSize=FontSize;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tiptap/extension-text-style");const n=require("@tiptap/core"),r=n.Extension.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>{var t;return(t=e.style.fontSize)==null?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}});exports.FontSize=r;
2
2
  //# sourceMappingURL=font-size.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"font-size.cjs","sources":["../../src/font-size/font-size.ts"],"sourcesContent":["import '@tiptap/extension-text-style';\n\nimport { Extension } from '@tiptap/core';\n\nexport type FontSizeOptions = {\n types: string[];\n};\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n fontSize: {\n /**\n * Set the font size\n */\n setFontSize: (fontSize: string) => ReturnType;\n /**\n * Unset the font size\n */\n unsetFontSize: () => ReturnType;\n };\n }\n}\n\nexport const FontSize = Extension.create<FontSizeOptions>({\n name: 'fontSize',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n fontSize: {\n default: null,\n parseHTML: (element) =>\n element.style.fontSize?.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.fontSize) {\n return {};\n }\n\n return {\n style: `font-size: ${attributes.fontSize}`,\n };\n },\n },\n },\n },\n ];\n },\n\n addCommands() {\n return {\n setFontSize:\n (fontSize) =>\n ({ chain }) => {\n return chain().setMark('textStyle', { fontSize }).run();\n },\n unsetFontSize:\n () =>\n ({ chain }) => {\n return chain()\n .setMark('textStyle', { fontSize: null })\n .removeEmptyTextStyle()\n .run();\n },\n };\n },\n});\n"],"names":["Extension"],"mappings":"2JAuBa,SAAWA,eAAU,OAAwB,CACxD,KAAM,WAEN,YAAa,CACJ,MAAA,CACL,MAAO,CAAC,WAAW,CAAA,CAEvB,EAEA,qBAAsB,CACb,MAAA,CACL,CACE,MAAO,KAAK,QAAQ,MACpB,WAAY,CACV,SAAU,CACR,QAAS,KACT,UAAY,SACV,QAAA,kBAAQ,MAAM,WAAd,eAAwB,QAAQ,SAAU,KAC5C,WAAa,YACN,WAAW,SAIT,CACL,MAAO,cAAc,WAAW,QAAQ,EAAA,EAJjC,EAOb,CACF,CACF,CAAA,CAEJ,EAEA,aAAc,CACL,MAAA,CACL,YACG,UACD,CAAC,CAAE,SACM,QAAQ,QAAQ,YAAa,CAAE,QAAU,CAAA,EAAE,MAEtD,cACE,IACA,CAAC,CAAE,SACM,MACJ,EAAA,QAAQ,YAAa,CAAE,SAAU,IAAA,CAAM,EACvC,uBACA,KACL,CAEN,CACF,CAAC"}
1
+ {"version":3,"file":"font-size.cjs","sources":["../../src/font-size/font-size.ts"],"sourcesContent":["import '@tiptap/extension-text-style';\n\nimport { Extension } from '@tiptap/core';\n\nexport type FontSizeOptions = {\n types: string[];\n};\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n fontSize: {\n /**\n * Set the font size\n */\n setFontSize: (fontSize: string) => ReturnType;\n /**\n * Unset the font size\n */\n unsetFontSize: () => ReturnType;\n };\n }\n}\n\nexport const FontSize = Extension.create<FontSizeOptions>({\n name: 'fontSize',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n fontSize: {\n default: null,\n parseHTML: (element) =>\n element.style.fontSize?.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.fontSize) {\n return {};\n }\n\n return {\n style: `font-size: ${attributes.fontSize}`,\n };\n },\n },\n },\n },\n ];\n },\n\n addCommands() {\n return {\n setFontSize:\n (fontSize) =>\n ({ chain }) => {\n return chain().setMark('textStyle', { fontSize }).run();\n },\n unsetFontSize:\n () =>\n ({ chain }) => {\n return chain()\n .setMark('textStyle', { fontSize: null })\n .removeEmptyTextStyle()\n .run();\n },\n };\n },\n});\n"],"names":["FontSize","Extension","element","_a","attributes","fontSize","chain"],"mappings":"wJAuBaA,EAAWC,YAAU,OAAwB,CACxD,KAAM,WAEN,YAAa,CACJ,MAAA,CACL,MAAO,CAAC,WAAW,CAAA,CAEvB,EAEA,qBAAsB,CACb,MAAA,CACL,CACE,MAAO,KAAK,QAAQ,MACpB,WAAY,CACV,SAAU,CACR,QAAS,KACT,UAAYC,GACV,OAAA,OAAAC,EAAAD,EAAQ,MAAM,WAAd,YAAAC,EAAwB,QAAQ,SAAU,KAC5C,WAAaC,GACNA,EAAW,SAIT,CACL,MAAO,cAAcA,EAAW,QAAQ,EAAA,EAJjC,EAOb,CACF,CACF,CAAA,CAEJ,EAEA,aAAc,CACL,MAAA,CACL,YACGC,GACD,CAAC,CAAE,MAAAC,KACMA,IAAQ,QAAQ,YAAa,CAAE,SAAAD,CAAU,CAAA,EAAE,MAEtD,cACE,IACA,CAAC,CAAE,MAAAC,KACMA,EACJ,EAAA,QAAQ,YAAa,CAAE,SAAU,IAAA,CAAM,EACvC,uBACA,KACL,CAEN,CACF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import "@tiptap/extension-text-style";
2
- import { Extension } from "@tiptap/core";
3
- const FontSize = Extension.create({
2
+ import { Extension as n } from "@tiptap/core";
3
+ const i = n.create({
4
4
  name: "fontSize",
5
5
  addOptions() {
6
6
  return {
@@ -14,12 +14,12 @@ const FontSize = Extension.create({
14
14
  attributes: {
15
15
  fontSize: {
16
16
  default: null,
17
- parseHTML: (element) => {
18
- var _a;
19
- return (_a = element.style.fontSize) == null ? void 0 : _a.replace(/['"]+/g, "");
17
+ parseHTML: (t) => {
18
+ var e;
19
+ return (e = t.style.fontSize) == null ? void 0 : e.replace(/['"]+/g, "");
20
20
  },
21
- renderHTML: (attributes) => attributes.fontSize ? {
22
- style: `font-size: ${attributes.fontSize}`
21
+ renderHTML: (t) => t.fontSize ? {
22
+ style: `font-size: ${t.fontSize}`
23
23
  } : {}
24
24
  }
25
25
  }
@@ -28,12 +28,12 @@ const FontSize = Extension.create({
28
28
  },
29
29
  addCommands() {
30
30
  return {
31
- setFontSize: (fontSize) => ({ chain }) => chain().setMark("textStyle", { fontSize }).run(),
32
- unsetFontSize: () => ({ chain }) => chain().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
31
+ setFontSize: (t) => ({ chain: e }) => e().setMark("textStyle", { fontSize: t }).run(),
32
+ unsetFontSize: () => ({ chain: t }) => t().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
33
33
  };
34
34
  }
35
35
  });
36
36
  export {
37
- FontSize
37
+ i as FontSize
38
38
  };
39
39
  //# sourceMappingURL=font-size.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"font-size.js","sources":["../../src/font-size/font-size.ts"],"sourcesContent":["import '@tiptap/extension-text-style';\n\nimport { Extension } from '@tiptap/core';\n\nexport type FontSizeOptions = {\n types: string[];\n};\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n fontSize: {\n /**\n * Set the font size\n */\n setFontSize: (fontSize: string) => ReturnType;\n /**\n * Unset the font size\n */\n unsetFontSize: () => ReturnType;\n };\n }\n}\n\nexport const FontSize = Extension.create<FontSizeOptions>({\n name: 'fontSize',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n fontSize: {\n default: null,\n parseHTML: (element) =>\n element.style.fontSize?.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.fontSize) {\n return {};\n }\n\n return {\n style: `font-size: ${attributes.fontSize}`,\n };\n },\n },\n },\n },\n ];\n },\n\n addCommands() {\n return {\n setFontSize:\n (fontSize) =>\n ({ chain }) => {\n return chain().setMark('textStyle', { fontSize }).run();\n },\n unsetFontSize:\n () =>\n ({ chain }) => {\n return chain()\n .setMark('textStyle', { fontSize: null })\n .removeEmptyTextStyle()\n .run();\n },\n };\n },\n});\n"],"names":[],"mappings":";;AAuBa,MAAA,WAAW,UAAU,OAAwB;AAAA,EACxD,MAAM;AAAA,EAEN,aAAa;AACJ,WAAA;AAAA,MACL,OAAO,CAAC,WAAW;AAAA,IAAA;AAAA,EAEvB;AAAA,EAEA,sBAAsB;AACb,WAAA;AAAA,MACL;AAAA,QACE,OAAO,KAAK,QAAQ;AAAA,QACpB,YAAY;AAAA,UACV,UAAU;AAAA,YACR,SAAS;AAAA,YACT,WAAW,CAAC,YACV;;AAAA,mCAAQ,MAAM,aAAd,mBAAwB,QAAQ,UAAU;AAAA;AAAA,YAC5C,YAAY,CAAC,eACN,WAAW,WAIT;AAAA,cACL,OAAO,cAAc,WAAW,QAAQ;AAAA,YAAA,IAJjC;UAOb;AAAA,QACF;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,aACE,CAAC,aACD,CAAC,EAAE,YACM,QAAQ,QAAQ,aAAa,EAAE,SAAU,CAAA,EAAE;MAEtD,eACE,MACA,CAAC,EAAE,YACM,MACJ,EAAA,QAAQ,aAAa,EAAE,UAAU,KAAA,CAAM,EACvC,uBACA;IACL;AAAA,EAEN;AACF,CAAC;"}
1
+ {"version":3,"file":"font-size.js","sources":["../../src/font-size/font-size.ts"],"sourcesContent":["import '@tiptap/extension-text-style';\n\nimport { Extension } from '@tiptap/core';\n\nexport type FontSizeOptions = {\n types: string[];\n};\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n fontSize: {\n /**\n * Set the font size\n */\n setFontSize: (fontSize: string) => ReturnType;\n /**\n * Unset the font size\n */\n unsetFontSize: () => ReturnType;\n };\n }\n}\n\nexport const FontSize = Extension.create<FontSizeOptions>({\n name: 'fontSize',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n fontSize: {\n default: null,\n parseHTML: (element) =>\n element.style.fontSize?.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.fontSize) {\n return {};\n }\n\n return {\n style: `font-size: ${attributes.fontSize}`,\n };\n },\n },\n },\n },\n ];\n },\n\n addCommands() {\n return {\n setFontSize:\n (fontSize) =>\n ({ chain }) => {\n return chain().setMark('textStyle', { fontSize }).run();\n },\n unsetFontSize:\n () =>\n ({ chain }) => {\n return chain()\n .setMark('textStyle', { fontSize: null })\n .removeEmptyTextStyle()\n .run();\n },\n };\n },\n});\n"],"names":["FontSize","Extension","element","_a","attributes","fontSize","chain"],"mappings":";;AAuBa,MAAAA,IAAWC,EAAU,OAAwB;AAAA,EACxD,MAAM;AAAA,EAEN,aAAa;AACJ,WAAA;AAAA,MACL,OAAO,CAAC,WAAW;AAAA,IAAA;AAAA,EAEvB;AAAA,EAEA,sBAAsB;AACb,WAAA;AAAA,MACL;AAAA,QACE,OAAO,KAAK,QAAQ;AAAA,QACpB,YAAY;AAAA,UACV,UAAU;AAAA,YACR,SAAS;AAAA,YACT,WAAW,CAACC,MACV;;AAAA,sBAAAC,IAAAD,EAAQ,MAAM,aAAd,gBAAAC,EAAwB,QAAQ,UAAU;AAAA;AAAA,YAC5C,YAAY,CAACC,MACNA,EAAW,WAIT;AAAA,cACL,OAAO,cAAcA,EAAW,QAAQ;AAAA,YAAA,IAJjC;UAOb;AAAA,QACF;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,aACE,CAACC,MACD,CAAC,EAAE,OAAAC,QACMA,IAAQ,QAAQ,aAAa,EAAE,UAAAD,EAAU,CAAA,EAAE;MAEtD,eACE,MACA,CAAC,EAAE,OAAAC,QACMA,EACJ,EAAA,QAAQ,aAAa,EAAE,UAAU,KAAA,CAAM,EACvC,uBACA;IACL;AAAA,EAEN;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),extensionHeading=require("@tiptap/extension-heading");require("@tiptap/extension-text-style");const CustomHeading=extensionHeading.Heading.extend({name:"customHeading",addOptions(){var _a;return{...(_a=this.parent)==null?void 0:_a.call(this),HTMLAttributes:{}}},parseHTML(){return this.options.levels.map(level=>({tag:`h${level}`,attrs:{level}}))},renderHTML({node,HTMLAttributes}){return[`h${this.options.levels.includes(node.attrs.level)?node.attrs.level:this.options.levels[0]}`,core.mergeAttributes(this.options.HTMLAttributes,HTMLAttributes),0]},addCommands(){return{setCustomHeading:attributes=>({tr,dispatch,commands})=>{if(!this.options.levels.includes(attributes.level))return!1;const{selection}=tr,{from,to}=selection;return tr.doc.nodesBetween(from,to,(node,pos)=>{node.isBlock&&from>=pos&&to<=pos+node.nodeSize&&node.content.forEach(content=>{content.marks.forEach(mark=>{mark.type.name==="textStyle"&&mark.attrs.fontSize&&mark.attrs.fontSize!==null&&(tr=tr.removeMark(pos,pos+node.nodeSize,mark.type))})})}),dispatch&&dispatch(tr),commands.setHeading({level:attributes.level})}}}});exports.CustomHeading=CustomHeading;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@tiptap/core"),v=require("@tiptap/extension-heading");require("@tiptap/extension-text-style");const f=v.Heading.extend({name:"customHeading",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,d.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setCustomHeading:e=>({tr:t,dispatch:o,commands:r})=>{if(!this.options.levels.includes(e.level))return!1;const{selection:u}=t,{from:l,to:a}=u;return t.doc.nodesBetween(l,a,(s,n)=>{s.isBlock&&l>=n&&a<=n+s.nodeSize&&s.content.forEach(c=>{c.marks.forEach(i=>{i.type.name==="textStyle"&&i.attrs.fontSize&&i.attrs.fontSize!==null&&(t=t.removeMark(n,n+s.nodeSize,i.type))})})}),o&&o(t),r.setHeading({level:e.level})}}}});exports.CustomHeading=f;
2
2
  //# sourceMappingURL=heading.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"heading.cjs","sources":["../../src/heading/heading.ts"],"sourcesContent":["import { mergeAttributes } from '@tiptap/core';\nimport { Heading } from '@tiptap/extension-heading';\nimport '@tiptap/extension-text-style';\n\nexport declare type Level = 1 | 2;\n\ninterface Options {\n levels: Level[];\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n customHeading: {\n /**\n * Apply Heading Level\n */\n setCustomHeading: (attributes: { level: Level }) => ReturnType;\n };\n }\n}\n\nexport const CustomHeading = Heading.extend<Options>({\n name: 'customHeading',\n\n addOptions() {\n return {\n ...this.parent?.(),\n HTMLAttributes: {},\n };\n },\n\n parseHTML() {\n return this.options.levels.map((level: Level) => ({\n tag: `h${level}`,\n attrs: { level },\n }));\n },\n\n renderHTML({ node, HTMLAttributes }) {\n const hasLevel = this.options.levels.includes(node.attrs.level);\n const level = hasLevel ? node.attrs.level : this.options.levels[0];\n\n return [\n `h${level}`,\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setCustomHeading:\n (attributes) =>\n ({ tr, dispatch, commands }) => {\n if (!this.options.levels.includes(attributes.level)) {\n return false;\n }\n\n const { selection } = tr;\n const { from, to } = selection;\n\n tr.doc.nodesBetween(from, to, (node, pos) => {\n if (node.isBlock && from >= pos && to <= pos + node.nodeSize) {\n /* get node content and iterate through */\n node.content.forEach((content) => {\n /* get content marks and iterate through */\n content.marks.forEach((mark) => {\n /* find textStyle mark and if has fontSize attrs */\n if (\n mark.type.name === 'textStyle' &&\n mark.attrs['fontSize'] &&\n mark.attrs['fontSize'] !== null\n ) {\n /* remove any fontSize attr to reset heading style */\n tr = tr.removeMark(pos, pos + node.nodeSize, mark.type);\n }\n });\n });\n }\n });\n\n if (dispatch) {\n dispatch(tr);\n }\n return commands.setHeading({ level: attributes.level });\n },\n };\n },\n});\n"],"names":["Heading","mergeAttributes"],"mappings":"iNAsBa,MAAA,cAAgBA,yBAAQ,OAAgB,CACnD,KAAM,gBAEN,YAAa,QACJ,MAAA,CACL,IAAG,QAAK,SAAL,0BACH,eAAgB,CAAC,CAAA,CAErB,EAEA,WAAY,CACV,OAAO,KAAK,QAAQ,OAAO,IAAK,QAAkB,CAChD,IAAK,IAAI,KAAK,GACd,MAAO,CAAE,KAAM,CACf,EAAA,CACJ,EAEA,WAAW,CAAE,KAAM,gBAAkB,CAI5B,MAAA,CACL,IAJe,KAAK,QAAQ,OAAO,SAAS,KAAK,MAAM,KAAK,EACrC,KAAK,MAAM,MAAQ,KAAK,QAAQ,OAAO,CAAC,CAGtD,GACTC,KAAAA,gBAAgB,KAAK,QAAQ,eAAgB,cAAc,EAC3D,CAAA,CAEJ,EAEA,aAAc,CACL,MAAA,CACL,iBACG,YACD,CAAC,CAAE,GAAI,SAAU,YAAe,CAC9B,GAAI,CAAC,KAAK,QAAQ,OAAO,SAAS,WAAW,KAAK,EACzC,MAAA,GAGH,KAAA,CAAE,SAAc,EAAA,GAChB,CAAE,KAAM,EAAO,EAAA,UAErB,UAAG,IAAI,aAAa,KAAM,GAAI,CAAC,KAAM,MAAQ,CACvC,KAAK,SAAW,MAAQ,KAAO,IAAM,IAAM,KAAK,UAE7C,KAAA,QAAQ,QAAS,SAAY,CAExB,QAAA,MAAM,QAAS,MAAS,CAG5B,KAAK,KAAK,OAAS,aACnB,KAAK,MAAM,UACX,KAAK,MAAM,WAAgB,OAG3B,GAAK,GAAG,WAAW,IAAK,IAAM,KAAK,SAAU,KAAK,IAAI,EACxD,CACD,CAAA,CACF,CACH,CACD,EAEG,UACF,SAAS,EAAE,EAEN,SAAS,WAAW,CAAE,MAAO,WAAW,MAAO,CACxD,CAAA,CAEN,CACF,CAAC"}
1
+ {"version":3,"file":"heading.cjs","sources":["../../src/heading/heading.ts"],"sourcesContent":["import { mergeAttributes } from '@tiptap/core';\nimport { Heading } from '@tiptap/extension-heading';\nimport '@tiptap/extension-text-style';\n\nexport declare type Level = 1 | 2;\n\ninterface Options {\n levels: Level[];\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n customHeading: {\n /**\n * Apply Heading Level\n */\n setCustomHeading: (attributes: { level: Level }) => ReturnType;\n };\n }\n}\n\nexport const CustomHeading = Heading.extend<Options>({\n name: 'customHeading',\n\n addOptions() {\n return {\n ...this.parent?.(),\n HTMLAttributes: {},\n };\n },\n\n parseHTML() {\n return this.options.levels.map((level: Level) => ({\n tag: `h${level}`,\n attrs: { level },\n }));\n },\n\n renderHTML({ node, HTMLAttributes }) {\n const hasLevel = this.options.levels.includes(node.attrs.level);\n const level = hasLevel ? node.attrs.level : this.options.levels[0];\n\n return [\n `h${level}`,\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setCustomHeading:\n (attributes) =>\n ({ tr, dispatch, commands }) => {\n if (!this.options.levels.includes(attributes.level)) {\n return false;\n }\n\n const { selection } = tr;\n const { from, to } = selection;\n\n tr.doc.nodesBetween(from, to, (node, pos) => {\n if (node.isBlock && from >= pos && to <= pos + node.nodeSize) {\n /* get node content and iterate through */\n node.content.forEach((content) => {\n /* get content marks and iterate through */\n content.marks.forEach((mark) => {\n /* find textStyle mark and if has fontSize attrs */\n if (\n mark.type.name === 'textStyle' &&\n mark.attrs['fontSize'] &&\n mark.attrs['fontSize'] !== null\n ) {\n /* remove any fontSize attr to reset heading style */\n tr = tr.removeMark(pos, pos + node.nodeSize, mark.type);\n }\n });\n });\n }\n });\n\n if (dispatch) {\n dispatch(tr);\n }\n return commands.setHeading({ level: attributes.level });\n },\n };\n },\n});\n"],"names":["CustomHeading","Heading","_a","level","node","HTMLAttributes","mergeAttributes","attributes","tr","dispatch","commands","selection","from","to","pos","content","mark"],"mappings":"+LAsBa,MAAAA,EAAgBC,UAAQ,OAAgB,CACnD,KAAM,gBAEN,YAAa,OACJ,MAAA,CACL,IAAGC,EAAA,KAAK,SAAL,YAAAA,EAAA,WACH,eAAgB,CAAC,CAAA,CAErB,EAEA,WAAY,CACV,OAAO,KAAK,QAAQ,OAAO,IAAKC,IAAkB,CAChD,IAAK,IAAIA,CAAK,GACd,MAAO,CAAE,MAAAA,CAAM,CACf,EAAA,CACJ,EAEA,WAAW,CAAE,KAAAC,EAAM,eAAAC,GAAkB,CAI5B,MAAA,CACL,IAJe,KAAK,QAAQ,OAAO,SAASD,EAAK,MAAM,KAAK,EACrCA,EAAK,MAAM,MAAQ,KAAK,QAAQ,OAAO,CAAC,CAGtD,GACTE,EAAAA,gBAAgB,KAAK,QAAQ,eAAgBD,CAAc,EAC3D,CAAA,CAEJ,EAEA,aAAc,CACL,MAAA,CACL,iBACGE,GACD,CAAC,CAAE,GAAAC,EAAI,SAAAC,EAAU,SAAAC,KAAe,CAC9B,GAAI,CAAC,KAAK,QAAQ,OAAO,SAASH,EAAW,KAAK,EACzC,MAAA,GAGH,KAAA,CAAE,UAAAI,CAAc,EAAAH,EAChB,CAAE,KAAAI,EAAM,GAAAC,CAAO,EAAAF,EAErB,OAAAH,EAAG,IAAI,aAAaI,EAAMC,EAAI,CAACT,EAAMU,IAAQ,CACvCV,EAAK,SAAWQ,GAAQE,GAAOD,GAAMC,EAAMV,EAAK,UAE7CA,EAAA,QAAQ,QAASW,GAAY,CAExBA,EAAA,MAAM,QAASC,GAAS,CAG5BA,EAAK,KAAK,OAAS,aACnBA,EAAK,MAAM,UACXA,EAAK,MAAM,WAAgB,OAG3BR,EAAKA,EAAG,WAAWM,EAAKA,EAAMV,EAAK,SAAUY,EAAK,IAAI,EACxD,CACD,CAAA,CACF,CACH,CACD,EAEGP,GACFA,EAASD,CAAE,EAENE,EAAS,WAAW,CAAE,MAAOH,EAAW,MAAO,CACxD,CAAA,CAEN,CACF,CAAC"}
@@ -1,46 +1,46 @@
1
- import { mergeAttributes } from "@tiptap/core";
2
- import { Heading } from "@tiptap/extension-heading";
1
+ import { mergeAttributes as c } from "@tiptap/core";
2
+ import { Heading as d } from "@tiptap/extension-heading";
3
3
  import "@tiptap/extension-text-style";
4
- const CustomHeading = Heading.extend({
4
+ const p = d.extend({
5
5
  name: "customHeading",
6
6
  addOptions() {
7
- var _a;
7
+ var e;
8
8
  return {
9
- ...(_a = this.parent) == null ? void 0 : _a.call(this),
9
+ ...(e = this.parent) == null ? void 0 : e.call(this),
10
10
  HTMLAttributes: {}
11
11
  };
12
12
  },
13
13
  parseHTML() {
14
- return this.options.levels.map((level) => ({
15
- tag: `h${level}`,
16
- attrs: { level }
14
+ return this.options.levels.map((e) => ({
15
+ tag: `h${e}`,
16
+ attrs: { level: e }
17
17
  }));
18
18
  },
19
- renderHTML({ node, HTMLAttributes }) {
19
+ renderHTML({ node: e, HTMLAttributes: t }) {
20
20
  return [
21
- `h${this.options.levels.includes(node.attrs.level) ? node.attrs.level : this.options.levels[0]}`,
22
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
21
+ `h${this.options.levels.includes(e.attrs.level) ? e.attrs.level : this.options.levels[0]}`,
22
+ c(this.options.HTMLAttributes, t),
23
23
  0
24
24
  ];
25
25
  },
26
26
  addCommands() {
27
27
  return {
28
- setCustomHeading: (attributes) => ({ tr, dispatch, commands }) => {
29
- if (!this.options.levels.includes(attributes.level))
28
+ setCustomHeading: (e) => ({ tr: t, dispatch: o, commands: l }) => {
29
+ if (!this.options.levels.includes(e.level))
30
30
  return !1;
31
- const { selection } = tr, { from, to } = selection;
32
- return tr.doc.nodesBetween(from, to, (node, pos) => {
33
- node.isBlock && from >= pos && to <= pos + node.nodeSize && node.content.forEach((content) => {
34
- content.marks.forEach((mark) => {
35
- mark.type.name === "textStyle" && mark.attrs.fontSize && mark.attrs.fontSize !== null && (tr = tr.removeMark(pos, pos + node.nodeSize, mark.type));
31
+ const { selection: m } = t, { from: r, to: a } = m;
32
+ return t.doc.nodesBetween(r, a, (s, n) => {
33
+ s.isBlock && r >= n && a <= n + s.nodeSize && s.content.forEach((u) => {
34
+ u.marks.forEach((i) => {
35
+ i.type.name === "textStyle" && i.attrs.fontSize && i.attrs.fontSize !== null && (t = t.removeMark(n, n + s.nodeSize, i.type));
36
36
  });
37
37
  });
38
- }), dispatch && dispatch(tr), commands.setHeading({ level: attributes.level });
38
+ }), o && o(t), l.setHeading({ level: e.level });
39
39
  }
40
40
  };
41
41
  }
42
42
  });
43
43
  export {
44
- CustomHeading
44
+ p as CustomHeading
45
45
  };
46
46
  //# sourceMappingURL=heading.js.map