@edifice.io/tiptap-extensions 2.0.0-develop-rc.8 → 2.0.0-develop-rc.13

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 (100) hide show
  1. package/README.md +1 -1
  2. package/dist/abbr/abbr.cjs +32 -1
  3. package/dist/abbr/abbr.cjs.map +1 -1
  4. package/dist/abbr/abbr.d.ts +12 -12
  5. package/dist/abbr/abbr.js +20 -16
  6. package/dist/abbr/abbr.js.map +1 -1
  7. package/dist/alert/alert.cjs +32 -1
  8. package/dist/alert/alert.cjs.map +1 -1
  9. package/dist/alert/alert.js +22 -24
  10. package/dist/alert/alert.js.map +1 -1
  11. package/dist/attachment/attachment.cjs +73 -1
  12. package/dist/attachment/attachment.cjs.map +1 -1
  13. package/dist/attachment/attachment.d.ts +6 -6
  14. package/dist/attachment/attachment.js +58 -47
  15. package/dist/attachment/attachment.js.map +1 -1
  16. package/dist/audio/audio.cjs +53 -3
  17. package/dist/audio/audio.cjs.map +1 -1
  18. package/dist/audio/audio.d.ts +17 -13
  19. package/dist/audio/audio.js +33 -30
  20. package/dist/audio/audio.js.map +1 -1
  21. package/dist/font-size/font-size.cjs +48 -1
  22. package/dist/font-size/font-size.cjs.map +1 -1
  23. package/dist/font-size/font-size.d.ts +13 -13
  24. package/dist/font-size/font-size.js +32 -20
  25. package/dist/font-size/font-size.js.map +1 -1
  26. package/dist/heading/heading.cjs +61 -1
  27. package/dist/heading/heading.cjs.map +1 -1
  28. package/dist/heading/heading.d.ts +10 -12
  29. package/dist/heading/heading.js +45 -31
  30. package/dist/heading/heading.js.map +1 -1
  31. package/dist/highlight/highlight.cjs +25 -1
  32. package/dist/highlight/highlight.cjs.map +1 -1
  33. package/dist/highlight/highlight.d.ts +4 -1
  34. package/dist/highlight/highlight.js +15 -17
  35. package/dist/highlight/highlight.js.map +1 -1
  36. package/dist/hyperlink/hyperlink.cjs +47 -1
  37. package/dist/hyperlink/hyperlink.cjs.map +1 -1
  38. package/dist/hyperlink/hyperlink.d.ts +27 -24
  39. package/dist/hyperlink/hyperlink.js +26 -24
  40. package/dist/hyperlink/hyperlink.js.map +1 -1
  41. package/dist/iframe/iframe.cjs +69 -1
  42. package/dist/iframe/iframe.cjs.map +1 -1
  43. package/dist/iframe/iframe.d.ts +12 -14
  44. package/dist/iframe/iframe.js +50 -34
  45. package/dist/iframe/iframe.js.map +1 -1
  46. package/dist/image/custom-image.cjs +162 -1
  47. package/dist/image/custom-image.cjs.map +1 -1
  48. package/dist/image/custom-image.d.ts +19 -16
  49. package/dist/image/custom-image.js +179 -130
  50. package/dist/image/custom-image.js.map +1 -1
  51. package/dist/index.cjs +43 -1
  52. package/dist/index.js +41 -41
  53. package/dist/line-height/line-height.cjs +33 -1
  54. package/dist/line-height/line-height.cjs.map +1 -1
  55. package/dist/line-height/line-height.js +21 -18
  56. package/dist/line-height/line-height.js.map +1 -1
  57. package/dist/linker/linker.cjs +95 -1
  58. package/dist/linker/linker.cjs.map +1 -1
  59. package/dist/linker/linker.d.ts +17 -17
  60. package/dist/linker/linker.js +60 -52
  61. package/dist/linker/linker.js.map +1 -1
  62. package/dist/mathjax/mathjax.cjs +47 -1
  63. package/dist/mathjax/mathjax.cjs.map +1 -1
  64. package/dist/mathjax/mathjax.js +33 -23
  65. package/dist/mathjax/mathjax.js.map +1 -1
  66. package/dist/paragraph/paragraph.cjs +13 -1
  67. package/dist/paragraph/paragraph.cjs.map +1 -1
  68. package/dist/paragraph/paragraph.d.ts +4 -1
  69. package/dist/paragraph/paragraph.js +8 -10
  70. package/dist/paragraph/paragraph.js.map +1 -1
  71. package/dist/speech-recognition/speech-recognition.cjs +76 -1
  72. package/dist/speech-recognition/speech-recognition.cjs.map +1 -1
  73. package/dist/speech-recognition/speech-recognition.d.ts +12 -12
  74. package/dist/speech-recognition/speech-recognition.js +61 -45
  75. package/dist/speech-recognition/speech-recognition.js.map +1 -1
  76. package/dist/speech-synthesis/speech-synthesis.cjs +32 -1
  77. package/dist/speech-synthesis/speech-synthesis.cjs.map +1 -1
  78. package/dist/speech-synthesis/speech-synthesis.d.ts +9 -9
  79. package/dist/speech-synthesis/speech-synthesis.js +23 -14
  80. package/dist/speech-synthesis/speech-synthesis.js.map +1 -1
  81. package/dist/table-cell/table-cell.cjs +27 -1
  82. package/dist/table-cell/table-cell.cjs.map +1 -1
  83. package/dist/table-cell/table-cell.d.ts +4 -1
  84. package/dist/table-cell/table-cell.js +21 -16
  85. package/dist/table-cell/table-cell.js.map +1 -1
  86. package/dist/transform/html-to-json/html-to-json.cjs +4 -1
  87. package/dist/transform/html-to-json/html-to-json.cjs.map +1 -1
  88. package/dist/transform/html-to-json/html-to-json.d.ts +4 -1
  89. package/dist/transform/html-to-json/html-to-json.js +3 -5
  90. package/dist/transform/html-to-json/html-to-json.js.map +1 -1
  91. package/dist/transform/json-to-html/json-to-html.cjs +4 -1
  92. package/dist/transform/json-to-html/json-to-html.cjs.map +1 -1
  93. package/dist/transform/json-to-html/json-to-html.js +3 -5
  94. package/dist/transform/json-to-html/json-to-html.js.map +1 -1
  95. package/dist/video/video.cjs +118 -9
  96. package/dist/video/video.cjs.map +1 -1
  97. package/dist/video/video.d.ts +28 -19
  98. package/dist/video/video.js +121 -97
  99. package/dist/video/video.js.map +1 -1
  100. package/package.json +36 -47
@@ -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":["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
+ {"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,19 +1,23 @@
1
1
  import { Node } from '@tiptap/core';
2
2
  export interface AudioOptions {
3
- url: string;
4
- HTMLAttributes: Record<string, any>;
3
+ url: string;
4
+ HTMLAttributes: Record<string, any>;
5
5
  }
6
6
  declare module '@tiptap/core' {
7
- interface Commands<ReturnType> {
8
- audio: {
9
- /**
10
- * Set a audio node
11
- * @param options.updateSelection set to true will select the newly inserted content
12
- */
13
- setAudio: (id: string, src: string, options?: {
14
- updateSelection: boolean;
15
- }) => ReturnType;
16
- };
17
- }
7
+ interface Commands<ReturnType> {
8
+ audio: {
9
+ /**
10
+ * Set a audio node
11
+ * @param options.updateSelection set to true will select the newly inserted content
12
+ */
13
+ setAudio: (
14
+ id: string,
15
+ src: string,
16
+ options?: {
17
+ updateSelection: boolean;
18
+ },
19
+ ) => ReturnType;
20
+ };
21
+ }
18
22
  }
19
23
  export declare const Audio: Node<any, any>;
@@ -1,52 +1,55 @@
1
- import { Node as a, mergeAttributes as o } from "@tiptap/core";
2
- const i = a.create({
3
- name: "audio",
4
- group: "block",
1
+ import { Node, mergeAttributes } from '@tiptap/core';
2
+ const Audio = Node.create({
3
+ name: 'audio',
4
+ group: 'block',
5
5
  addAttributes() {
6
6
  return {
7
7
  src: {
8
8
  default: null,
9
- parseHTML: (t) => t.getAttribute("src"),
10
- renderHTML: (t) => ({ src: t.src })
9
+ parseHTML: (el) => el.getAttribute('src'),
10
+ renderHTML: (attrs) => ({ src: attrs.src }),
11
11
  },
12
12
  documentId: {
13
- default: "",
14
- renderHTML: (t) => ({ "data-document-id": t.documentId }),
15
- parseHTML: (t) => t.getAttribute("data-document-id")
16
- }
13
+ default: '',
14
+ renderHTML: (attributes) => ({
15
+ 'data-document-id': attributes.documentId,
16
+ }),
17
+ parseHTML: (element) => element.getAttribute('data-document-id'),
18
+ },
17
19
  };
18
20
  },
19
21
  parseHTML() {
20
22
  return [
21
23
  {
22
- tag: "div.audio-wrapper>audio,audio",
23
- getAttrs: (t) => ({
24
- src: t.getAttribute("src")
25
- })
26
- }
24
+ tag: 'div.audio-wrapper>audio,audio',
25
+ getAttrs: (el) => ({
26
+ src: el.getAttribute('src'),
27
+ }),
28
+ },
27
29
  ];
28
30
  },
29
- renderHTML({ HTMLAttributes: t }) {
31
+ renderHTML({ HTMLAttributes }) {
30
32
  return [
31
- "div",
32
- { class: "audio-wrapper" },
33
- ["audio", o(t)]
33
+ 'div',
34
+ { class: 'audio-wrapper' },
35
+ ['audio', mergeAttributes(HTMLAttributes)],
34
36
  ];
35
37
  },
36
38
  addCommands() {
37
39
  return {
38
- setAudio: (t, e, r) => ({ commands: d, state: u }) => d.insertContentAt(
39
- u.selection,
40
- `<audio
41
- src="${e}"
40
+ setAudio:
41
+ (id, src, options) =>
42
+ ({ commands, state }) =>
43
+ commands.insertContentAt(
44
+ state.selection,
45
+ `<audio
46
+ src="${src}"
42
47
  controls preload="none"
43
- data-document-id="${t}"></audio>`,
44
- r
45
- )
48
+ data-document-id="${id}"></audio>`,
49
+ options,
50
+ ),
46
51
  };
47
- }
52
+ },
48
53
  });
49
- export {
50
- i as Audio
51
- };
54
+ export { Audio };
52
55
  //# 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":["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
+ {"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,2 +1,49 @@
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;
1
+ 'use strict';
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
+ require('@tiptap/extension-text-style');
4
+ const core = require('@tiptap/core'),
5
+ FontSize = core.Extension.create({
6
+ name: 'fontSize',
7
+ addOptions() {
8
+ return { types: ['textStyle'] };
9
+ },
10
+ addGlobalAttributes() {
11
+ return [
12
+ {
13
+ types: this.options.types,
14
+ attributes: {
15
+ fontSize: {
16
+ default: null,
17
+ parseHTML: (element) => {
18
+ var _a;
19
+ return (_a = element.style.fontSize) == null
20
+ ? void 0
21
+ : _a.replace(/['"]+/g, '');
22
+ },
23
+ renderHTML: (attributes) =>
24
+ attributes.fontSize
25
+ ? { style: `font-size: ${attributes.fontSize}` }
26
+ : {},
27
+ },
28
+ },
29
+ },
30
+ ];
31
+ },
32
+ addCommands() {
33
+ return {
34
+ setFontSize:
35
+ (fontSize) =>
36
+ ({ chain }) =>
37
+ chain().setMark('textStyle', { fontSize }).run(),
38
+ unsetFontSize:
39
+ () =>
40
+ ({ chain }) =>
41
+ chain()
42
+ .setMark('textStyle', { fontSize: null })
43
+ .removeEmptyTextStyle()
44
+ .run(),
45
+ };
46
+ },
47
+ });
48
+ exports.FontSize = FontSize;
2
49
  //# 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":["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
+ {"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,19 +1,19 @@
1
1
  import { Extension } from '@tiptap/core';
2
2
  export type FontSizeOptions = {
3
- types: string[];
3
+ types: string[];
4
4
  };
5
5
  declare module '@tiptap/core' {
6
- interface Commands<ReturnType> {
7
- fontSize: {
8
- /**
9
- * Set the font size
10
- */
11
- setFontSize: (fontSize: string) => ReturnType;
12
- /**
13
- * Unset the font size
14
- */
15
- unsetFontSize: () => ReturnType;
16
- };
17
- }
6
+ interface Commands<ReturnType> {
7
+ fontSize: {
8
+ /**
9
+ * Set the font size
10
+ */
11
+ setFontSize: (fontSize: string) => ReturnType;
12
+ /**
13
+ * Unset the font size
14
+ */
15
+ unsetFontSize: () => ReturnType;
16
+ };
17
+ }
18
18
  }
19
19
  export declare const FontSize: Extension<FontSizeOptions, any>;
@@ -1,10 +1,10 @@
1
- import "@tiptap/extension-text-style";
2
- import { Extension as n } from "@tiptap/core";
3
- const i = n.create({
4
- name: "fontSize",
1
+ import '@tiptap/extension-text-style';
2
+ import { Extension } from '@tiptap/core';
3
+ const FontSize = Extension.create({
4
+ name: 'fontSize',
5
5
  addOptions() {
6
6
  return {
7
- types: ["textStyle"]
7
+ types: ['textStyle'],
8
8
  };
9
9
  },
10
10
  addGlobalAttributes() {
@@ -14,26 +14,38 @@ const i = n.create({
14
14
  attributes: {
15
15
  fontSize: {
16
16
  default: null,
17
- parseHTML: (t) => {
18
- var e;
19
- return (e = t.style.fontSize) == null ? void 0 : e.replace(/['"]+/g, "");
17
+ parseHTML: (element) => {
18
+ var _a;
19
+ return (_a = element.style.fontSize) == null
20
+ ? void 0
21
+ : _a.replace(/['"]+/g, '');
20
22
  },
21
- renderHTML: (t) => t.fontSize ? {
22
- style: `font-size: ${t.fontSize}`
23
- } : {}
24
- }
25
- }
26
- }
23
+ renderHTML: (attributes) =>
24
+ attributes.fontSize
25
+ ? {
26
+ style: `font-size: ${attributes.fontSize}`,
27
+ }
28
+ : {},
29
+ },
30
+ },
31
+ },
27
32
  ];
28
33
  },
29
34
  addCommands() {
30
35
  return {
31
- setFontSize: (t) => ({ chain: e }) => e().setMark("textStyle", { fontSize: t }).run(),
32
- unsetFontSize: () => ({ chain: t }) => t().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
36
+ setFontSize:
37
+ (fontSize) =>
38
+ ({ chain }) =>
39
+ chain().setMark('textStyle', { fontSize }).run(),
40
+ unsetFontSize:
41
+ () =>
42
+ ({ chain }) =>
43
+ chain()
44
+ .setMark('textStyle', { fontSize: null })
45
+ .removeEmptyTextStyle()
46
+ .run(),
33
47
  };
34
- }
48
+ },
35
49
  });
36
- export {
37
- i as FontSize
38
- };
50
+ export { FontSize };
39
51
  //# 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":["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
+ {"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,2 +1,62 @@
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;
1
+ 'use strict';
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
+ const core = require('@tiptap/core'),
4
+ extensionHeading = require('@tiptap/extension-heading');
5
+ require('@tiptap/extension-text-style');
6
+ const CustomHeading = extensionHeading.Heading.extend({
7
+ name: 'customHeading',
8
+ addOptions() {
9
+ var _a;
10
+ return {
11
+ ...((_a = this.parent) == null ? void 0 : _a.call(this)),
12
+ HTMLAttributes: {},
13
+ };
14
+ },
15
+ parseHTML() {
16
+ return this.options.levels.map((level) => ({
17
+ tag: `h${level}`,
18
+ attrs: { level },
19
+ }));
20
+ },
21
+ renderHTML({ node, HTMLAttributes }) {
22
+ return [
23
+ `h${
24
+ this.options.levels.includes(node.attrs.level)
25
+ ? node.attrs.level
26
+ : this.options.levels[0]
27
+ }`,
28
+ core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
29
+ 0,
30
+ ];
31
+ },
32
+ addCommands() {
33
+ return {
34
+ setCustomHeading:
35
+ (attributes) =>
36
+ ({ tr, dispatch, commands }) => {
37
+ if (!this.options.levels.includes(attributes.level)) return !1;
38
+ const { selection } = tr,
39
+ { from, to } = selection;
40
+ return (
41
+ tr.doc.nodesBetween(from, to, (node, pos) => {
42
+ node.isBlock &&
43
+ from >= pos &&
44
+ to <= pos + node.nodeSize &&
45
+ node.content.forEach((content) => {
46
+ content.marks.forEach((mark) => {
47
+ mark.type.name === 'textStyle' &&
48
+ mark.attrs.fontSize &&
49
+ mark.attrs.fontSize !== null &&
50
+ (tr = tr.removeMark(pos, pos + node.nodeSize, mark.type));
51
+ });
52
+ });
53
+ }),
54
+ dispatch && dispatch(tr),
55
+ commands.setHeading({ level: attributes.level })
56
+ );
57
+ },
58
+ };
59
+ },
60
+ });
61
+ exports.CustomHeading = CustomHeading;
2
62
  //# 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":["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
+ {"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,19 +1,17 @@
1
1
  export declare type Level = 1 | 2;
2
2
  interface Options {
3
- levels: Level[];
4
- HTMLAttributes: Record<string, any>;
3
+ levels: Level[];
4
+ HTMLAttributes: Record<string, any>;
5
5
  }
6
6
  declare module '@tiptap/core' {
7
- interface Commands<ReturnType> {
8
- customHeading: {
9
- /**
10
- * Apply Heading Level
11
- */
12
- setCustomHeading: (attributes: {
13
- level: Level;
14
- }) => ReturnType;
15
- };
16
- }
7
+ interface Commands<ReturnType> {
8
+ customHeading: {
9
+ /**
10
+ * Apply Heading Level
11
+ */
12
+ setCustomHeading: (attributes: { level: Level }) => ReturnType;
13
+ };
14
+ }
17
15
  }
18
16
  export declare const CustomHeading: import('@tiptap/core').Node<Options, any>;
19
17
  export {};
@@ -1,46 +1,60 @@
1
- import { mergeAttributes as c } from "@tiptap/core";
2
- import { Heading as d } from "@tiptap/extension-heading";
3
- import "@tiptap/extension-text-style";
4
- const p = d.extend({
5
- name: "customHeading",
1
+ import { mergeAttributes } from '@tiptap/core';
2
+ import { Heading } from '@tiptap/extension-heading';
3
+ import '@tiptap/extension-text-style';
4
+ const CustomHeading = Heading.extend({
5
+ name: 'customHeading',
6
6
  addOptions() {
7
- var e;
7
+ var _a;
8
8
  return {
9
- ...(e = this.parent) == null ? void 0 : e.call(this),
10
- HTMLAttributes: {}
9
+ ...((_a = this.parent) == null ? void 0 : _a.call(this)),
10
+ HTMLAttributes: {},
11
11
  };
12
12
  },
13
13
  parseHTML() {
14
- return this.options.levels.map((e) => ({
15
- tag: `h${e}`,
16
- attrs: { level: e }
14
+ return this.options.levels.map((level) => ({
15
+ tag: `h${level}`,
16
+ attrs: { level },
17
17
  }));
18
18
  },
19
- renderHTML({ node: e, HTMLAttributes: t }) {
19
+ renderHTML({ node, HTMLAttributes }) {
20
20
  return [
21
- `h${this.options.levels.includes(e.attrs.level) ? e.attrs.level : this.options.levels[0]}`,
22
- c(this.options.HTMLAttributes, t),
23
- 0
21
+ `h${
22
+ this.options.levels.includes(node.attrs.level)
23
+ ? node.attrs.level
24
+ : this.options.levels[0]
25
+ }`,
26
+ mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
27
+ 0,
24
28
  ];
25
29
  },
26
30
  addCommands() {
27
31
  return {
28
- setCustomHeading: (e) => ({ tr: t, dispatch: o, commands: l }) => {
29
- if (!this.options.levels.includes(e.level))
30
- return !1;
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
- });
37
- });
38
- }), o && o(t), l.setHeading({ level: e.level });
39
- }
32
+ setCustomHeading:
33
+ (attributes) =>
34
+ ({ tr, dispatch, commands }) => {
35
+ if (!this.options.levels.includes(attributes.level)) return !1;
36
+ const { selection } = tr,
37
+ { from, to } = selection;
38
+ return (
39
+ tr.doc.nodesBetween(from, to, (node, pos) => {
40
+ node.isBlock &&
41
+ from >= pos &&
42
+ to <= pos + node.nodeSize &&
43
+ node.content.forEach((content) => {
44
+ content.marks.forEach((mark) => {
45
+ mark.type.name === 'textStyle' &&
46
+ mark.attrs.fontSize &&
47
+ mark.attrs.fontSize !== null &&
48
+ (tr = tr.removeMark(pos, pos + node.nodeSize, mark.type));
49
+ });
50
+ });
51
+ }),
52
+ dispatch && dispatch(tr),
53
+ commands.setHeading({ level: attributes.level })
54
+ );
55
+ },
40
56
  };
41
- }
57
+ },
42
58
  });
43
- export {
44
- p as CustomHeading
45
- };
59
+ export { CustomHeading };
46
60
  //# sourceMappingURL=heading.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"heading.js","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":";;;AAsBa,MAAAA,IAAgBC,EAAQ,OAAgB;AAAA,EACnD,MAAM;AAAA,EAEN,aAAa;;AACJ,WAAA;AAAA,MACL,IAAGC,IAAA,KAAK,WAAL,gBAAAA,EAAA;AAAA,MACH,gBAAgB,CAAC;AAAA,IAAA;AAAA,EAErB;AAAA,EAEA,YAAY;AACV,WAAO,KAAK,QAAQ,OAAO,IAAI,CAACC,OAAkB;AAAA,MAChD,KAAK,IAAIA,CAAK;AAAA,MACd,OAAO,EAAE,OAAAA,EAAM;AAAA,IACf,EAAA;AAAA,EACJ;AAAA,EAEA,WAAW,EAAE,MAAAC,GAAM,gBAAAC,KAAkB;AAI5B,WAAA;AAAA,MACL,IAJe,KAAK,QAAQ,OAAO,SAASD,EAAK,MAAM,KAAK,IACrCA,EAAK,MAAM,QAAQ,KAAK,QAAQ,OAAO,CAAC,CAGtD;AAAA,MACTE,EAAgB,KAAK,QAAQ,gBAAgBD,CAAc;AAAA,MAC3D;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,kBACE,CAACE,MACD,CAAC,EAAE,IAAAC,GAAI,UAAAC,GAAU,UAAAC,QAAe;AAC9B,YAAI,CAAC,KAAK,QAAQ,OAAO,SAASH,EAAW,KAAK;AACzC,iBAAA;AAGH,cAAA,EAAE,WAAAI,EAAc,IAAAH,GAChB,EAAE,MAAAI,GAAM,IAAAC,EAAO,IAAAF;AAErB,eAAAH,EAAG,IAAI,aAAaI,GAAMC,GAAI,CAACT,GAAMU,MAAQ;AAC3C,UAAIV,EAAK,WAAWQ,KAAQE,KAAOD,KAAMC,IAAMV,EAAK,YAE7CA,EAAA,QAAQ,QAAQ,CAACW,MAAY;AAExB,YAAAA,EAAA,MAAM,QAAQ,CAACC,MAAS;AAE9B,cACEA,EAAK,KAAK,SAAS,eACnBA,EAAK,MAAM,YACXA,EAAK,MAAM,aAAgB,SAG3BR,IAAKA,EAAG,WAAWM,GAAKA,IAAMV,EAAK,UAAUY,EAAK,IAAI;AAAA,YACxD,CACD;AAAA,UAAA,CACF;AAAA,QACH,CACD,GAEGP,KACFA,EAASD,CAAE,GAENE,EAAS,WAAW,EAAE,OAAOH,EAAW,OAAO;AAAA,MACxD;AAAA,IAAA;AAAA,EAEN;AACF,CAAC;"}
1
+ {"version":3,"file":"heading.js","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":[],"mappings":";;;AAsBa,MAAA,gBAAgB,QAAQ,OAAgB;AAAA,EACnD,MAAM;AAAA,EAEN,aAAa;;AACJ,WAAA;AAAA,MACL,IAAG,UAAK,WAAL;AAAA,MACH,gBAAgB,CAAC;AAAA,IAAA;AAAA,EAErB;AAAA,EAEA,YAAY;AACV,WAAO,KAAK,QAAQ,OAAO,IAAI,CAAC,WAAkB;AAAA,MAChD,KAAK,IAAI,KAAK;AAAA,MACd,OAAO,EAAE,MAAM;AAAA,IACf,EAAA;AAAA,EACJ;AAAA,EAEA,WAAW,EAAE,MAAM,kBAAkB;AAI5B,WAAA;AAAA,MACL,IAJe,KAAK,QAAQ,OAAO,SAAS,KAAK,MAAM,KAAK,IACrC,KAAK,MAAM,QAAQ,KAAK,QAAQ,OAAO,CAAC,CAGtD;AAAA,MACT,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc;AAAA,MAC3D;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,kBACE,CAAC,eACD,CAAC,EAAE,IAAI,UAAU,eAAe;AAC9B,YAAI,CAAC,KAAK,QAAQ,OAAO,SAAS,WAAW,KAAK;AACzC,iBAAA;AAGH,cAAA,EAAE,UAAc,IAAA,IAChB,EAAE,MAAM,GAAO,IAAA;AAErB,kBAAG,IAAI,aAAa,MAAM,IAAI,CAAC,MAAM,QAAQ;AAC3C,UAAI,KAAK,WAAW,QAAQ,OAAO,MAAM,MAAM,KAAK,YAE7C,KAAA,QAAQ,QAAQ,CAAC,YAAY;AAExB,oBAAA,MAAM,QAAQ,CAAC,SAAS;AAE9B,cACE,KAAK,KAAK,SAAS,eACnB,KAAK,MAAM,YACX,KAAK,MAAM,aAAgB,SAG3B,KAAK,GAAG,WAAW,KAAK,MAAM,KAAK,UAAU,KAAK,IAAI;AAAA,YACxD,CACD;AAAA,UAAA,CACF;AAAA,QACH,CACD,GAEG,YACF,SAAS,EAAE,GAEN,SAAS,WAAW,EAAE,OAAO,WAAW,OAAO;AAAA,MACxD;AAAA,IAAA;AAAA,EAEN;AACF,CAAC;"}
@@ -1,2 +1,26 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@tiptap/extension-highlight"),i=r.extend({name:"customHighlight",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),multicolor:!0,HTMLAttributes:{}}},parseHTML(){var t;return[{...(t=this.parent)==null?void 0:t.call(this),style:"background-color",getAttrs:e=>({color:e})}]}});exports.CustomHighlight=i;
1
+ 'use strict';
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
+ const Highlight = require('@tiptap/extension-highlight'),
4
+ CustomHighlight = Highlight.extend({
5
+ name: 'customHighlight',
6
+ addOptions() {
7
+ var _a;
8
+ return {
9
+ ...((_a = this.parent) == null ? void 0 : _a.call(this)),
10
+ multicolor: !0,
11
+ HTMLAttributes: {},
12
+ };
13
+ },
14
+ parseHTML() {
15
+ var _a;
16
+ return [
17
+ {
18
+ ...((_a = this.parent) == null ? void 0 : _a.call(this)),
19
+ style: 'background-color',
20
+ getAttrs: (style) => ({ color: style }),
21
+ },
22
+ ];
23
+ },
24
+ });
25
+ exports.CustomHighlight = CustomHighlight;
2
26
  //# sourceMappingURL=highlight.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"highlight.cjs","sources":["../../src/highlight/highlight.ts"],"sourcesContent":["import Highlight from '@tiptap/extension-highlight';\n\nexport const CustomHighlight = Highlight.extend({\n name: 'customHighlight',\n\n addOptions() {\n return {\n ...this.parent?.(),\n multicolor: true,\n HTMLAttributes: {},\n };\n },\n\n parseHTML() {\n return [\n {\n ...this.parent?.(),\n style: 'background-color',\n getAttrs: (style) => {\n return {\n color: style,\n };\n },\n },\n ];\n },\n});\n"],"names":["CustomHighlight","Highlight","_a","style"],"mappings":"+HAEaA,EAAkBC,EAAU,OAAO,CAC9C,KAAM,kBAEN,YAAa,OACJ,MAAA,CACL,IAAGC,EAAA,KAAK,SAAL,YAAAA,EAAA,WACH,WAAY,GACZ,eAAgB,CAAC,CAAA,CAErB,EAEA,WAAY,OACH,MAAA,CACL,CACE,IAAGA,EAAA,KAAK,SAAL,YAAAA,EAAA,WACH,MAAO,mBACP,SAAWC,IACF,CACL,MAAOA,CAAA,EAGb,CAAA,CAEJ,CACF,CAAC"}
1
+ {"version":3,"file":"highlight.cjs","sources":["../../src/highlight/highlight.ts"],"sourcesContent":["import Highlight from '@tiptap/extension-highlight';\n\nexport const CustomHighlight = Highlight.extend({\n name: 'customHighlight',\n\n addOptions() {\n return {\n ...this.parent?.(),\n multicolor: true,\n HTMLAttributes: {},\n };\n },\n\n parseHTML() {\n return [\n {\n ...this.parent?.(),\n style: 'background-color',\n getAttrs: (style) => {\n return {\n color: style,\n };\n },\n },\n ];\n },\n});\n"],"names":[],"mappings":"uIAEa,gBAAkB,UAAU,OAAO,CAC9C,KAAM,kBAEN,YAAa,QACJ,MAAA,CACL,IAAG,QAAK,SAAL,0BACH,WAAY,GACZ,eAAgB,CAAC,CAAA,CAErB,EAEA,WAAY,QACH,MAAA,CACL,CACE,IAAG,QAAK,SAAL,0BACH,MAAO,mBACP,SAAW,QACF,CACL,MAAO,KAAA,EAGb,CAAA,CAEJ,CACF,CAAC"}
@@ -1 +1,4 @@
1
- export declare const CustomHighlight: import('@tiptap/core').Mark<import('@tiptap/extension-highlight').HighlightOptions, any>;
1
+ export declare const CustomHighlight: import('@tiptap/core').Mark<
2
+ import('@tiptap/extension-highlight').HighlightOptions,
3
+ any
4
+ >;