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

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 +1 @@
1
- {"version":3,"file":"custom-image.js","sources":["../../src/image/custom-image.ts"],"sourcesContent":["import { mergeAttributes, nodeInputRule } from '@tiptap/core';\nimport Image from '@tiptap/extension-image';\n\nexport const IMAGE_INPUT_REGEX =\n /(?:^|\\s)(!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\))$/;\n\nexport interface CustomImageOptions {\n HTMLAttributes: Record<string, string>;\n sizes: string[];\n}\n\ninterface AttributesProps {\n width: number | string;\n height: number | string;\n size: string;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n customImage: {\n setAttributes: (options: AttributesProps) => ReturnType;\n setNewImage: (options: {\n src: string;\n alt?: string;\n title?: string;\n }) => ReturnType;\n };\n }\n}\n\nexport const CustomImage = Image.extend<CustomImageOptions>({\n name: 'custom-image',\n draggable: true,\n selectable: true,\n\n addOptions() {\n return {\n ...this.parent?.(),\n inline: true,\n content: 'inline*',\n sizes: ['small', 'medium', 'large'],\n HTMLAttributes: {\n class: 'custom-image',\n },\n };\n },\n\n addAttributes() {\n return {\n ...this.parent?.(),\n size: {\n default: 'medium',\n rendered: false,\n },\n alt: {\n renderHTML: (attributes) => {\n return {\n alt: attributes.alt,\n };\n },\n parseHTML: (element) => element.getAttribute('alt'),\n },\n title: {\n renderHTML: (attributes) => {\n return {\n title: attributes.title,\n };\n },\n parseHTML: (element) => element.getAttribute('title'),\n },\n width: {\n default: '350',\n renderHTML: (attributes) => {\n if (\n attributes.width !== null &&\n attributes.width !== undefined &&\n !Number.isNaN(attributes.width)\n ) {\n return {\n width: parseInt(attributes.width),\n };\n }\n return {};\n },\n parseHTML: (element) => element.getAttribute('width'),\n },\n height: {\n renderHTML: (attributes) => {\n if (\n attributes.height !== null &&\n attributes.height !== undefined &&\n !Number.isNaN(attributes.height)\n ) {\n return {\n height: parseInt(attributes.height),\n };\n }\n return {};\n },\n parseHTML: (element) => element.getAttribute('height'),\n },\n style: {\n renderHTML: (attributes) => {\n return attributes.style\n ? {\n style: attributes.style,\n }\n : {};\n },\n parseHTML: (element) => {\n const style = element.getAttribute('style');\n return style && typeof style === 'string' && style.length > 0\n ? {}\n : null;\n },\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'img[src]:not([src^=\"data:\"])',\n getAttrs: (el: HTMLImageElement) => {\n const attr = { src: el.getAttribute('src') };\n // Check old content format and get the width from the parent element\n if (el.parentElement?.className.includes('image-container')) {\n if (el.parentElement.style?.width) {\n attr['width'] = el.parentElement.style.width;\n }\n }\n if (el.style?.width) {\n attr['width'] = el.style.width;\n }\n\n // Check old content smiley\n const oldSmileyList = [\n 'happy',\n 'proud',\n 'dreamy',\n 'love',\n 'tired',\n 'angry',\n 'worried',\n 'sick',\n 'joker',\n 'sad',\n ];\n if (\n oldSmileyList.filter((smiley) => attr.src.includes(smiley + '.png'))\n .length > 0\n ) {\n attr['style'] = {\n width: '1.5em',\n height: '1.5em',\n fontSize: el.parentElement?.style?.fontSize,\n };\n attr['width'] = 'null';\n attr['height'] = 'null';\n }\n return attr;\n },\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'img',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n ];\n },\n\n addInputRules() {\n return [\n nodeInputRule({\n find: IMAGE_INPUT_REGEX,\n type: this.type,\n getAttributes: (match) => {\n const [, , alt, src, title] = match;\n\n return {\n src,\n alt,\n title,\n };\n },\n }),\n ];\n },\n\n addCommands() {\n return {\n setNewImage:\n (attrs) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\n const node = this.type.create(attrs);\n\n if (dispatch) {\n tr.replaceRangeWith(selection.from, selection.to, node);\n }\n\n return true;\n },\n setAttributes:\n (attributes) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\n\n const nodeAttrs = tr.doc.nodeAt(tr.selection.from);\n const options = {\n ...nodeAttrs.attrs,\n ...attributes,\n };\n const node = this.type.create(options);\n\n if (dispatch) {\n tr.replaceRangeWith(selection.from, selection.to, node);\n }\n\n return true;\n },\n };\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,oBACX,4DA0BW,cAAc,MAAM,OAA2B;AAAA,EAC1D,MAAM;AAAA,EACN,WAAW;AAAA,EACX,YAAY;AAAA,EAEZ,aAAa;;AACJ,WAAA;AAAA,MACL,IAAG,UAAK,WAAL;AAAA,MACH,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,OAAO,CAAC,SAAS,UAAU,OAAO;AAAA,MAClC,gBAAgB;AAAA,QACd,OAAO;AAAA,MACT;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,gBAAgB;;AACP,WAAA;AAAA,MACL,IAAG,UAAK,WAAL;AAAA,MACH,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA,KAAK;AAAA,QACH,YAAY,CAAC,gBACJ;AAAA,UACL,KAAK,WAAW;AAAA,QAAA;AAAA,QAGpB,WAAW,CAAC,YAAY,QAAQ,aAAa,KAAK;AAAA,MACpD;AAAA,MACA,OAAO;AAAA,QACL,YAAY,CAAC,gBACJ;AAAA,UACL,OAAO,WAAW;AAAA,QAAA;AAAA,QAGtB,WAAW,CAAC,YAAY,QAAQ,aAAa,OAAO;AAAA,MACtD;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,QACT,YAAY,CAAC,eAET,WAAW,UAAU,QACrB,WAAW,UAAU,UACrB,CAAC,OAAO,MAAM,WAAW,KAAK,IAEvB;AAAA,UACL,OAAO,SAAS,WAAW,KAAK;AA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Y,SAEZ;AAAA,QACT;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,WAAW,EAAE,kBAAkB;AACtB,WAAA;AAAA,MACL;AAAA,MACA,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc;AAAA,IAAA;AAAA,EAE/D;AAAA,EAEA,gBAAgB;AACP,WAAA;AAAA,MACL,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM,KAAK;AAAA,QACX,eAAe,CAAC,UAAU;AACxB,gBAAM,CAAK,EAAA,EAAA,KAAK,KAAK,KAAK,IAAI;AAEvB,iBAAA;AAAA,YACL;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA,CACD;AAAA,IAAA;AAAA,EAEL;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,aACE,CAAC,UACD,CAAC,EAAE,IAAI,eAAe;AACd,cAAA,EAAE,UAAc,IAAA,IAChB,OAAO,KAAK,KAAK,OAAO,KAAK;AAEnC,eAAI,YACF,GAAG,iBAAiB,UAAU,MAAM,UAAU,IAAI,IAAI,GAGjD;AAAA,MACT;AAAA,MACF,eACE,CAAC,eACD,CAAC,EAAE,IAAI,eAAe;AACd,cAAA,EAAE,UAAc,IAAA,IAGhB,UAAU;AAAA,UACd,GAFgB,GAAG,IAAI,OAAO,GAAG,UAAU,IAAI,EAElC;AAAA,UACb,GAAG;AAAA,QAAA,GAEC,OAAO,KAAK,KAAK,OAAO,OAAO;AAErC,eAAI,YACF,GAAG,iBAAiB,UAAU,MAAM,UAAU,IAAI,IAAI,GAGjD;AAAA,MACT;AAAA,IAAA;AAAA,EAEN;AACF,CAAC;"}
1
+ {"version":3,"file":"custom-image.js","sources":["../../src/image/custom-image.ts"],"sourcesContent":["import { mergeAttributes, nodeInputRule } from '@tiptap/core';\nimport Image from '@tiptap/extension-image';\n\nexport const IMAGE_INPUT_REGEX =\n /(?:^|\\s)(!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\))$/;\n\nexport interface CustomImageOptions {\n HTMLAttributes: Record<string, string>;\n sizes: string[];\n}\n\ninterface AttributesProps {\n width: number | string;\n height: number | string;\n size: string;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n customImage: {\n setAttributes: (options: AttributesProps) => ReturnType;\n setNewImage: (options: {\n src: string;\n alt?: string;\n title?: string;\n }) => ReturnType;\n };\n }\n}\n\nexport const CustomImage = Image.extend<CustomImageOptions>({\n name: 'custom-image',\n draggable: true,\n selectable: true,\n\n addOptions() {\n return {\n ...this.parent?.(),\n inline: true,\n content: 'inline*',\n sizes: ['small', 'medium', 'large'],\n HTMLAttributes: {\n class: 'custom-image',\n },\n };\n },\n\n addAttributes() {\n return {\n ...this.parent?.(),\n size: {\n default: 'medium',\n rendered: false,\n },\n alt: {\n renderHTML: (attributes) => {\n return {\n alt: attributes.alt,\n };\n },\n parseHTML: (element) => element.getAttribute('alt'),\n },\n title: {\n renderHTML: (attributes) => {\n return {\n title: attributes.title,\n };\n },\n parseHTML: (element) => element.getAttribute('title'),\n },\n width: {\n default: '350',\n renderHTML: (attributes) => {\n if (\n attributes.width !== null &&\n attributes.width !== undefined &&\n !Number.isNaN(attributes.width)\n ) {\n return {\n width: parseInt(attributes.width),\n };\n }\n return {};\n },\n parseHTML: (element) => element.getAttribute('width'),\n },\n height: {\n renderHTML: (attributes) => {\n if (\n attributes.height !== null &&\n attributes.height !== undefined &&\n !Number.isNaN(attributes.height)\n ) {\n return {\n height: parseInt(attributes.height),\n };\n }\n return {};\n },\n parseHTML: (element) => element.getAttribute('height'),\n },\n style: {\n renderHTML: (attributes) => {\n return attributes.style\n ? {\n style: attributes.style,\n }\n : {};\n },\n parseHTML: (element) => {\n const style = element.getAttribute('style');\n return style && typeof style === 'string' && style.length > 0\n ? {}\n : null;\n },\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'img[src]:not([src^=\"data:\"])',\n getAttrs: (el: HTMLImageElement) => {\n const attr = { src: el.getAttribute('src') };\n // Check old content format and get the width from the parent element\n if (el.parentElement?.className.includes('image-container')) {\n if (el.parentElement.style?.width) {\n attr['width'] = el.parentElement.style.width;\n }\n }\n if (el.style?.width) {\n attr['width'] = el.style.width;\n }\n\n // Check old content smiley\n const oldSmileyList = [\n 'happy',\n 'proud',\n 'dreamy',\n 'love',\n 'tired',\n 'angry',\n 'worried',\n 'sick',\n 'joker',\n 'sad',\n ];\n if (\n oldSmileyList.filter((smiley) => attr.src.includes(smiley + '.png'))\n .length > 0\n ) {\n attr['style'] = {\n width: '1.5em',\n height: '1.5em',\n fontSize: el.parentElement?.style?.fontSize,\n };\n attr['width'] = 'null';\n attr['height'] = 'null';\n }\n return attr;\n },\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'img',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n ];\n },\n\n addInputRules() {\n return [\n nodeInputRule({\n find: IMAGE_INPUT_REGEX,\n type: this.type,\n getAttributes: (match) => {\n const [, , alt, src, title] = match;\n\n return {\n src,\n alt,\n title,\n };\n },\n }),\n ];\n },\n\n addCommands() {\n return {\n setNewImage:\n (attrs) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\n const node = this.type.create(attrs);\n\n if (dispatch) {\n tr.replaceRangeWith(selection.from, selection.to, node);\n }\n\n return true;\n },\n setAttributes:\n (attributes) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\n\n const nodeAttrs = tr.doc.nodeAt(tr.selection.from);\n const options = {\n ...nodeAttrs.attrs,\n ...attributes,\n };\n const node = this.type.create(options);\n\n if (dispatch) {\n tr.replaceRangeWith(selection.from, selection.to, node);\n }\n\n return true;\n },\n };\n },\n});\n"],"names":["IMAGE_INPUT_REGEX","CustomImage","Image","_a","attributes","element","style","el","attr","_b","_c","smiley","_e","_d","HTMLAttributes","mergeAttributes","nodeInputRule","match","alt","src","title","attrs","tr","dispatch","selection","node","options"],"mappings":";;AAGO,MAAMA,IACX,4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EA,gBAAgB;AACP,WAAA;AAAA,MACLE,EAAc;AAAA,QACZ,MAAMhB;AAAA,QACN,MAAM,KAAK;AAAA,QACX,eAAe,CAACiB,MAAU;AACxB,gBAAM,CAAK,EAAA,EAAAC,GAAKC,GAAKC,CAAK,IAAIH;AAEvB,iBAAA;AAAA,YACL,KAAAE;AAAA,YACA,KAAAD;AAAA,YACA,OAAAE;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA,CACD;AAAA,IAAA;AAAA,EAEL;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,aACE,CAACC,MACD,CAAC,EAAE,IAAAC,GAAI,UAAAC,QAAe;AACd,cAAA,EAAE,WAAAC,EAAc,IAAAF,GAChBG,IAAO,KAAK,KAAK,OAAOJ,CAAK;AAEnC,eAAIE,KACFD,EAAG,iBAAiBE,EAAU,MAAMA,EAAU,IAAIC,CAAI,GAGjD;AAAA,MACT;AAAA,MACF,eACE,CAACrB,MACD,CAAC,EAAE,IAAAkB,GAAI,UAAAC,QAAe;AACd,cAAA,EAAE,WAAAC,EAAc,IAAAF,GAGhBI,IAAU;AAAA,UACd,GAFgBJ,EAAG,IAAI,OAAOA,EAAG,UAAU,IAAI,EAElC;AAAA,UACb,GAAGlB;AAAA,QAAA,GAECqB,IAAO,KAAK,KAAK,OAAOC,CAAO;AAErC,eAAIH,KACFD,EAAG,iBAAiBE,EAAU,MAAMA,EAAU,IAAIC,CAAI,GAGjD;AAAA,MACT;AAAA,IAAA;AAAA,EAEN;AACF,CAAC;"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const abbr=require("./abbr/abbr.cjs"),alert=require("./alert/alert.cjs"),attachment=require("./attachment/attachment.cjs"),audio=require("./audio/audio.cjs"),fontSize=require("./font-size/font-size.cjs"),heading=require("./heading/heading.cjs"),highlight=require("./highlight/highlight.cjs"),hyperlink=require("./hyperlink/hyperlink.cjs"),iframe=require("./iframe/iframe.cjs"),customImage=require("./image/custom-image.cjs"),lineHeight=require("./line-height/line-height.cjs"),linker=require("./linker/linker.cjs"),mathjax=require("./mathjax/mathjax.cjs"),paragraph=require("./paragraph/paragraph.cjs"),speechRecognition=require("./speech-recognition/speech-recognition.cjs"),speechSynthesis=require("./speech-synthesis/speech-synthesis.cjs"),tableCell=require("./table-cell/table-cell.cjs"),htmlToJson=require("./transform/html-to-json/html-to-json.cjs"),jsonToHtml=require("./transform/json-to-html/json-to-html.cjs"),video=require("./video/video.cjs");exports.Abbr=abbr.Abbr;exports.Alert=alert.Alert;exports.Attachment=attachment.Attachment;exports.Audio=audio.Audio;exports.FontSize=fontSize.FontSize;exports.CustomHeading=heading.CustomHeading;exports.CustomHighlight=highlight.CustomHighlight;exports.Hyperlink=hyperlink.Hyperlink;exports.Iframe=iframe.Iframe;exports.CustomImage=customImage.CustomImage;exports.IMAGE_INPUT_REGEX=customImage.IMAGE_INPUT_REGEX;exports.LineHeight=lineHeight.LineHeight;exports.Linker=linker.Linker;exports.MathJax=mathjax.MathJax;exports.Paragraph=paragraph.Paragraph;exports.SpeechRecognition=speechRecognition.SpeechRecognition;exports.SpeechSynthesis=speechSynthesis.SpeechSynthesis;exports.TableCell=tableCell.TableCell;exports.htmlToJson=htmlToJson;exports.jsonToHtml=jsonToHtml;exports.Video=video.Video;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./abbr/abbr.cjs"),r=require("./alert/alert.cjs"),i=require("./attachment/attachment.cjs"),o=require("./audio/audio.cjs"),n=require("./font-size/font-size.cjs"),s=require("./heading/heading.cjs"),a=require("./highlight/highlight.cjs"),c=require("./hyperlink/hyperlink.cjs"),u=require("./iframe/iframe.cjs"),e=require("./image/custom-image.cjs"),h=require("./line-height/line-height.cjs"),l=require("./linker/linker.cjs"),g=require("./mathjax/mathjax.cjs"),m=require("./paragraph/paragraph.cjs"),q=require("./speech-recognition/speech-recognition.cjs"),p=require("./speech-synthesis/speech-synthesis.cjs"),S=require("./table-cell/table-cell.cjs"),b=require("./transform/html-to-json/html-to-json.cjs"),d=require("./transform/json-to-html/json-to-html.cjs"),H=require("./video/video.cjs");exports.Abbr=t.Abbr;exports.Alert=r.Alert;exports.Attachment=i.Attachment;exports.Audio=o.Audio;exports.FontSize=n.FontSize;exports.CustomHeading=s.CustomHeading;exports.CustomHighlight=a.CustomHighlight;exports.Hyperlink=c.Hyperlink;exports.Iframe=u.Iframe;exports.CustomImage=e.CustomImage;exports.IMAGE_INPUT_REGEX=e.IMAGE_INPUT_REGEX;exports.LineHeight=h.LineHeight;exports.Linker=l.Linker;exports.MathJax=g.MathJax;exports.Paragraph=m.Paragraph;exports.SpeechRecognition=q.SpeechRecognition;exports.SpeechSynthesis=p.SpeechSynthesis;exports.TableCell=S.TableCell;exports.htmlToJson=b;exports.jsonToHtml=d;exports.Video=H.Video;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,44 +1,44 @@
1
- import { Abbr } from "./abbr/abbr.js";
2
- import { Alert } from "./alert/alert.js";
3
- import { Attachment } from "./attachment/attachment.js";
4
- import { Audio } from "./audio/audio.js";
5
- import { FontSize } from "./font-size/font-size.js";
6
- import { CustomHeading } from "./heading/heading.js";
7
- import { CustomHighlight } from "./highlight/highlight.js";
8
- import { Hyperlink } from "./hyperlink/hyperlink.js";
9
- import { Iframe } from "./iframe/iframe.js";
10
- import { CustomImage, IMAGE_INPUT_REGEX } from "./image/custom-image.js";
11
- import { LineHeight } from "./line-height/line-height.js";
12
- import { Linker } from "./linker/linker.js";
13
- import { MathJax } from "./mathjax/mathjax.js";
14
- import { Paragraph } from "./paragraph/paragraph.js";
15
- import { SpeechRecognition } from "./speech-recognition/speech-recognition.js";
16
- import { SpeechSynthesis } from "./speech-synthesis/speech-synthesis.js";
17
- import { TableCell } from "./table-cell/table-cell.js";
18
- import { default as default2 } from "./transform/html-to-json/html-to-json.js";
19
- import { default as default3 } from "./transform/json-to-html/json-to-html.js";
20
- import { Video } from "./video/video.js";
1
+ import { Abbr as e } from "./abbr/abbr.js";
2
+ import { Alert as m } from "./alert/alert.js";
3
+ import { Attachment as f } from "./attachment/attachment.js";
4
+ import { Audio as a } from "./audio/audio.js";
5
+ import { FontSize as n } from "./font-size/font-size.js";
6
+ import { CustomHeading as l } from "./heading/heading.js";
7
+ import { CustomHighlight as g } from "./highlight/highlight.js";
8
+ import { Hyperlink as d } from "./hyperlink/hyperlink.js";
9
+ import { Iframe as H } from "./iframe/iframe.js";
10
+ import { CustomImage as C, IMAGE_INPUT_REGEX as I } from "./image/custom-image.js";
11
+ import { LineHeight as T } from "./line-height/line-height.js";
12
+ import { Linker as E } from "./linker/linker.js";
13
+ import { MathJax as y } from "./mathjax/mathjax.js";
14
+ import { Paragraph as J } from "./paragraph/paragraph.js";
15
+ import { SpeechRecognition as M } from "./speech-recognition/speech-recognition.js";
16
+ import { SpeechSynthesis as R } from "./speech-synthesis/speech-synthesis.js";
17
+ import { TableCell as j } from "./table-cell/table-cell.js";
18
+ import { default as F } from "./transform/html-to-json/html-to-json.js";
19
+ import { default as U } from "./transform/json-to-html/json-to-html.js";
20
+ import { Video as X } from "./video/video.js";
21
21
  export {
22
- Abbr,
23
- Alert,
24
- Attachment,
25
- Audio,
26
- CustomHeading,
27
- CustomHighlight,
28
- CustomImage,
29
- FontSize,
30
- Hyperlink,
31
- IMAGE_INPUT_REGEX,
32
- Iframe,
33
- LineHeight,
34
- Linker,
35
- MathJax,
36
- Paragraph,
37
- SpeechRecognition,
38
- SpeechSynthesis,
39
- TableCell,
40
- Video,
41
- default2 as htmlToJson,
42
- default3 as jsonToHtml
22
+ e as Abbr,
23
+ m as Alert,
24
+ f as Attachment,
25
+ a as Audio,
26
+ l as CustomHeading,
27
+ g as CustomHighlight,
28
+ C as CustomImage,
29
+ n as FontSize,
30
+ d as Hyperlink,
31
+ I as IMAGE_INPUT_REGEX,
32
+ H as Iframe,
33
+ T as LineHeight,
34
+ E as Linker,
35
+ y as MathJax,
36
+ J as Paragraph,
37
+ M as SpeechRecognition,
38
+ R as SpeechSynthesis,
39
+ j as TableCell,
40
+ X as Video,
41
+ F as htmlToJson,
42
+ U as jsonToHtml
43
43
  };
44
44
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tiptap/extension-text-style");const core=require("@tiptap/core"),LineHeight=core.Extension.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:element=>{var _a;return(_a=element.style.lineHeight)==null?void 0:_a.replace(/['"]+/g,"")},renderHTML:attributes=>attributes.lineHeight?{style:`line-height: ${attributes.lineHeight}`}:{}}}}]}});exports.LineHeight=LineHeight;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tiptap/extension-text-style");const i=require("@tiptap/core"),n=i.Extension.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>{var t;return(t=e.style.lineHeight)==null?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]}});exports.LineHeight=n;
2
2
  //# sourceMappingURL=line-height.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"line-height.cjs","sources":["../../src/line-height/line-height.ts"],"sourcesContent":["import '@tiptap/extension-text-style';\n\nimport { Extension } from '@tiptap/core';\n\nexport const LineHeight = Extension.create({\n name: 'lineHeight',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n lineHeight: {\n default: null,\n parseHTML: (element) =>\n element.style.lineHeight?.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.lineHeight) {\n return {};\n }\n\n return {\n style: `line-height: ${attributes.lineHeight}`,\n };\n },\n },\n },\n },\n ];\n },\n});\n"],"names":["Extension"],"mappings":"2JAIa,WAAaA,eAAU,OAAO,CACzC,KAAM,aAEN,YAAa,CACJ,MAAA,CACL,MAAO,CAAC,WAAW,CAAA,CAEvB,EAEA,qBAAsB,CACb,MAAA,CACL,CACE,MAAO,KAAK,QAAQ,MACpB,WAAY,CACV,WAAY,CACV,QAAS,KACT,UAAY,SACV,QAAA,kBAAQ,MAAM,aAAd,eAA0B,QAAQ,SAAU,KAC9C,WAAa,YACN,WAAW,WAIT,CACL,MAAO,gBAAgB,WAAW,UAAU,EAAA,EAJrC,EAOb,CACF,CACF,CAAA,CAEJ,CACF,CAAC"}
1
+ {"version":3,"file":"line-height.cjs","sources":["../../src/line-height/line-height.ts"],"sourcesContent":["import '@tiptap/extension-text-style';\n\nimport { Extension } from '@tiptap/core';\n\nexport const LineHeight = Extension.create({\n name: 'lineHeight',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n lineHeight: {\n default: null,\n parseHTML: (element) =>\n element.style.lineHeight?.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.lineHeight) {\n return {};\n }\n\n return {\n style: `line-height: ${attributes.lineHeight}`,\n };\n },\n },\n },\n },\n ];\n },\n});\n"],"names":["LineHeight","Extension","element","_a","attributes"],"mappings":"wJAIaA,EAAaC,YAAU,OAAO,CACzC,KAAM,aAEN,YAAa,CACJ,MAAA,CACL,MAAO,CAAC,WAAW,CAAA,CAEvB,EAEA,qBAAsB,CACb,MAAA,CACL,CACE,MAAO,KAAK,QAAQ,MACpB,WAAY,CACV,WAAY,CACV,QAAS,KACT,UAAYC,GACV,OAAA,OAAAC,EAAAD,EAAQ,MAAM,aAAd,YAAAC,EAA0B,QAAQ,SAAU,KAC9C,WAAaC,GACNA,EAAW,WAIT,CACL,MAAO,gBAAgBA,EAAW,UAAU,EAAA,EAJrC,EAOb,CACF,CACF,CAAA,CAEJ,CACF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import "@tiptap/extension-text-style";
2
- import { Extension } from "@tiptap/core";
3
- const LineHeight = Extension.create({
2
+ import { Extension as i } from "@tiptap/core";
3
+ const l = i.create({
4
4
  name: "lineHeight",
5
5
  addOptions() {
6
6
  return {
@@ -14,12 +14,12 @@ const LineHeight = Extension.create({
14
14
  attributes: {
15
15
  lineHeight: {
16
16
  default: null,
17
- parseHTML: (element) => {
18
- var _a;
19
- return (_a = element.style.lineHeight) == null ? void 0 : _a.replace(/['"]+/g, "");
17
+ parseHTML: (e) => {
18
+ var t;
19
+ return (t = e.style.lineHeight) == null ? void 0 : t.replace(/['"]+/g, "");
20
20
  },
21
- renderHTML: (attributes) => attributes.lineHeight ? {
22
- style: `line-height: ${attributes.lineHeight}`
21
+ renderHTML: (e) => e.lineHeight ? {
22
+ style: `line-height: ${e.lineHeight}`
23
23
  } : {}
24
24
  }
25
25
  }
@@ -28,6 +28,6 @@ const LineHeight = Extension.create({
28
28
  }
29
29
  });
30
30
  export {
31
- LineHeight
31
+ l as LineHeight
32
32
  };
33
33
  //# sourceMappingURL=line-height.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"line-height.js","sources":["../../src/line-height/line-height.ts"],"sourcesContent":["import '@tiptap/extension-text-style';\n\nimport { Extension } from '@tiptap/core';\n\nexport const LineHeight = Extension.create({\n name: 'lineHeight',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n lineHeight: {\n default: null,\n parseHTML: (element) =>\n element.style.lineHeight?.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.lineHeight) {\n return {};\n }\n\n return {\n style: `line-height: ${attributes.lineHeight}`,\n };\n },\n },\n },\n },\n ];\n },\n});\n"],"names":[],"mappings":";;AAIa,MAAA,aAAa,UAAU,OAAO;AAAA,EACzC,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,YAAY;AAAA,YACV,SAAS;AAAA,YACT,WAAW,CAAC,YACV;;AAAA,mCAAQ,MAAM,eAAd,mBAA0B,QAAQ,UAAU;AAAA;AAAA,YAC9C,YAAY,CAAC,eACN,WAAW,aAIT;AAAA,cACL,OAAO,gBAAgB,WAAW,UAAU;AAAA,YAAA,IAJrC;UAOb;AAAA,QACF;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
1
+ {"version":3,"file":"line-height.js","sources":["../../src/line-height/line-height.ts"],"sourcesContent":["import '@tiptap/extension-text-style';\n\nimport { Extension } from '@tiptap/core';\n\nexport const LineHeight = Extension.create({\n name: 'lineHeight',\n\n addOptions() {\n return {\n types: ['textStyle'],\n };\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n lineHeight: {\n default: null,\n parseHTML: (element) =>\n element.style.lineHeight?.replace(/['\"]+/g, ''),\n renderHTML: (attributes) => {\n if (!attributes.lineHeight) {\n return {};\n }\n\n return {\n style: `line-height: ${attributes.lineHeight}`,\n };\n },\n },\n },\n },\n ];\n },\n});\n"],"names":["LineHeight","Extension","element","_a","attributes"],"mappings":";;AAIa,MAAAA,IAAaC,EAAU,OAAO;AAAA,EACzC,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,YAAY;AAAA,YACV,SAAS;AAAA,YACT,WAAW,CAACC,MACV;;AAAA,sBAAAC,IAAAD,EAAQ,MAAM,eAAd,gBAAAC,EAA0B,QAAQ,UAAU;AAAA;AAAA,YAC9C,YAAY,CAACC,MACNA,EAAW,aAIT;AAAA,cACL,OAAO,gBAAgBA,EAAW,UAAU;AAAA,YAAA,IAJrC;UAOb;AAAA,QACF;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),Linker=core.Node.create({name:"linker",content:"text*",marks:"",group:"inline",inline:!0,selectable:!0,atom:!0,draggable:!0,isolating:!0,allowGapCursor:!1,priority:1100,keepOnSplit:!1,addOptions(){return{openOnClick:!0,HTMLAttributes:{target:null,title:null,class:null,"data-id":null,"data-app-prefix":null},validate:void 0}},addAttributes(){return{href:{default:null},class:{default:this.options.HTMLAttributes.class},target:{default:this.options.HTMLAttributes.target,parseHTML:element=>element.getAttribute("target")!=="_blank"?null:"_blank"},title:{default:this.options.HTMLAttributes.title},"data-id":{default:this.options.HTMLAttributes["data-id"]},"data-app-prefix":{default:this.options.HTMLAttributes["data-app-prefix"]}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])[data-id][data-app-prefix]'}]},renderHTML({HTMLAttributes}){var _a;return(_a=HTMLAttributes.href)!=null&&_a.startsWith("javascript:")?["a",core.mergeAttributes(this.options.HTMLAttributes,{...HTMLAttributes,href:""}),0]:["a",core.mergeAttributes(this.options.HTMLAttributes,HTMLAttributes),0]},addCommands(){return{setLinker:attrs=>({commands})=>(commands.insertContent({type:this.name,attrs,content:[{type:"text",text:attrs.title}]}),!0),unsetLinker:()=>({state,tr})=>{const{node,from,to}=state.selection;return(node==null?void 0:node.type.name)==="linker"&&tr.delete(from,to).scrollIntoView(),!0}}}});exports.Linker=Linker;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@tiptap/core"),s=i.Node.create({name:"linker",content:"text*",marks:"",group:"inline",inline:!0,selectable:!0,atom:!0,draggable:!0,isolating:!0,allowGapCursor:!1,priority:1100,keepOnSplit:!1,addOptions(){return{openOnClick:!0,HTMLAttributes:{target:null,title:null,class:null,"data-id":null,"data-app-prefix":null},validate:void 0}},addAttributes(){return{href:{default:null},class:{default:this.options.HTMLAttributes.class},target:{default:this.options.HTMLAttributes.target,parseHTML:t=>t.getAttribute("target")!=="_blank"?null:"_blank"},title:{default:this.options.HTMLAttributes.title},"data-id":{default:this.options.HTMLAttributes["data-id"]},"data-app-prefix":{default:this.options.HTMLAttributes["data-app-prefix"]}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])[data-id][data-app-prefix]'}]},renderHTML({HTMLAttributes:t}){var e;return(e=t.href)!=null&&e.startsWith("javascript:")?["a",i.mergeAttributes(this.options.HTMLAttributes,{...t,href:""}),0]:["a",i.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setLinker:t=>({commands:e})=>(e.insertContent({type:this.name,attrs:t,content:[{type:"text",text:t.title}]}),!0),unsetLinker:()=>({state:t,tr:e})=>{const{node:r,from:a,to:n}=t.selection;return(r==null?void 0:r.type.name)==="linker"&&e.delete(a,n).scrollIntoView(),!0}}}});exports.Linker=s;
2
2
  //# sourceMappingURL=linker.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"linker.cjs","sources":["../../src/linker/linker.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core';\nimport { NodeSelection } from '@tiptap/pm/state';\n\n/* Our own model of a link in a rich document. */\nexport type LinkerAttributes = {\n href: string | null;\n target: '_blank' | null;\n title: string | null;\n 'data-id': string | null;\n 'data-app-prefix': string | null;\n};\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n linker: {\n /**\n * Set a linker node\n */\n setLinker: (attributes: LinkerAttributes) => ReturnType;\n /**\n * Unset a linker node\n */\n unsetLinker: () => ReturnType;\n };\n }\n}\n\n/**\n * Internal links extension.\n * Reproduces the legacy angularJs \"linker\" directive.\n *\n * Links to internal resources MAY have a `title` and MUST HAVE `data-id` and `data-app-prefix` attributes :\n * `<a href=\"/blog#/view/35fa4198-blog_id/5e654c71-article_id\" data-app-prefix=\"blog\" data-id=\"35fa4198-blog_id\" target=\"_blank\" title=\"Voir ce billet de blog\" class=\"ng-scope\">/blog#/view/35fa4198-57fe-45eb-94f4-a5e4defff305/5e654c71-1e61-4f84-86dc-6fcfaf33f513</a>`\n */\nexport const Linker = Node.create({\n name: 'linker',\n content: 'text*',\n marks: '',\n group: 'inline',\n\n inline: true,\n selectable: true,\n atom: true,\n draggable: true,\n isolating: true,\n allowGapCursor: false,\n\n priority: 1100,\n keepOnSplit: false,\n\n addOptions() {\n return {\n openOnClick: true,\n HTMLAttributes: {\n target: null,\n title: null,\n class: null,\n 'data-id': null,\n 'data-app-prefix': null,\n },\n validate: undefined,\n };\n },\n\n addAttributes() {\n return {\n href: {\n default: null,\n },\n class: {\n default: this.options.HTMLAttributes.class,\n },\n target: {\n default: this.options.HTMLAttributes.target,\n // Sanitize target value\n parseHTML: (element) =>\n element.getAttribute('target') !== '_blank' ? null : '_blank',\n },\n title: {\n default: this.options.HTMLAttributes.title,\n },\n 'data-id': {\n default: this.options.HTMLAttributes['data-id'],\n },\n 'data-app-prefix': {\n default: this.options.HTMLAttributes['data-app-prefix'],\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'a[href]:not([href *= \"javascript:\" i])[data-id][data-app-prefix]',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n if (HTMLAttributes.href?.startsWith('javascript:')) {\n return [\n 'a',\n mergeAttributes(this.options.HTMLAttributes, {\n ...HTMLAttributes,\n href: '',\n }),\n 0,\n ];\n }\n return [\n 'a',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setLinker:\n (attrs) =>\n ({ commands }) => {\n // Insert a Linker node with inner text node\n commands.insertContent({\n type: this.name,\n attrs,\n content: [\n {\n type: 'text',\n text: attrs.title,\n },\n ],\n });\n return true;\n },\n\n unsetLinker:\n () =>\n ({ state, tr }) => {\n // Which Linker node is actually selected ?\n const { node, from, to } = state.selection as NodeSelection;\n // Delete any selected Linker node\n if (node?.type.name === 'linker') {\n /* The following does not work as one would expected.\n commands.deleteNode(this.name);\n commands.deleteCurrentNode();\n * Replaced by : */\n tr.delete(from, to).scrollIntoView();\n }\n return true;\n },\n };\n },\n});\n"],"names":["Node","mergeAttributes"],"mappings":"mHAkCa,OAASA,UAAK,OAAO,CAChC,KAAM,SACN,QAAS,QACT,MAAO,GACP,MAAO,SAEP,OAAQ,GACR,WAAY,GACZ,KAAM,GACN,UAAW,GACX,UAAW,GACX,eAAgB,GAEhB,SAAU,KACV,YAAa,GAEb,YAAa,CACJ,MAAA,CACL,YAAa,GACb,eAAgB,CACd,OAAQ,KACR,MAAO,KACP,MAAO,KACP,UAAW,KACX,kBAAmB,IACrB,EACA,SAAU,MAAA,CAEd,EAEA,eAAgB,CACP,MAAA,CACL,KAAM,CACJ,QAAS,IACX,EACA,MAAO,CACL,QAAS,KAAK,QAAQ,eAAe,KACvC,EACA,OAAQ,CACN,QAAS,KAAK,QAAQ,eAAe,OAErC,UAAY,SACV,QAAQ,aAAa,QAAQ,IAAM,SAAW,KAAO,QACzD,EACA,MAAO,CACL,QAAS,KAAK,QAAQ,eAAe,KACvC,EACA,UAAW,CACT,QAAS,KAAK,QAAQ,eAAe,SAAS,CAChD,EACA,kBAAmB,CACjB,QAAS,KAAK,QAAQ,eAAe,iBAAiB,CACxD,CAAA,CAEJ,EAEA,WAAY,CACH,MAAA,CACL,CACE,IAAK,kEACP,CAAA,CAEJ,EAEA,WAAW,CAAE,gBAAkB,QAC7B,OAAI,kBAAe,OAAf,SAAqB,WAAW,eAC3B,CACL,IACAC,qBAAgB,KAAK,QAAQ,eAAgB,CAC3C,GAAG,eACH,KAAM,EAAA,CACP,EACD,CAAA,EAGG,CACL,IACAA,KAAAA,gBAAgB,KAAK,QAAQ,eAAgB,cAAc,EAC3D,CAAA,CAEJ,EAEA,aAAc,CACL,MAAA,CACL,UACG,OACD,CAAC,CAAE,aAED,SAAS,cAAc,CACrB,KAAM,KAAK,KACX,MACA,QAAS,CACP,CACE,KAAM,OACN,KAAM,MAAM,KACd,CACF,CAAA,CACD,EACM,IAGX,YACE,IACA,CAAC,CAAE,MAAO,MAAS,CAEjB,KAAM,CAAE,KAAM,KAAM,EAAA,EAAO,MAAM,UAE7B,OAAA,uBAAM,KAAK,QAAS,UAKtB,GAAG,OAAO,KAAM,EAAE,EAAE,eAAe,EAE9B,EACT,CAAA,CAEN,CACF,CAAC"}
1
+ {"version":3,"file":"linker.cjs","sources":["../../src/linker/linker.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core';\nimport { NodeSelection } from '@tiptap/pm/state';\n\n/* Our own model of a link in a rich document. */\nexport type LinkerAttributes = {\n href: string | null;\n target: '_blank' | null;\n title: string | null;\n 'data-id': string | null;\n 'data-app-prefix': string | null;\n};\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n linker: {\n /**\n * Set a linker node\n */\n setLinker: (attributes: LinkerAttributes) => ReturnType;\n /**\n * Unset a linker node\n */\n unsetLinker: () => ReturnType;\n };\n }\n}\n\n/**\n * Internal links extension.\n * Reproduces the legacy angularJs \"linker\" directive.\n *\n * Links to internal resources MAY have a `title` and MUST HAVE `data-id` and `data-app-prefix` attributes :\n * `<a href=\"/blog#/view/35fa4198-blog_id/5e654c71-article_id\" data-app-prefix=\"blog\" data-id=\"35fa4198-blog_id\" target=\"_blank\" title=\"Voir ce billet de blog\" class=\"ng-scope\">/blog#/view/35fa4198-57fe-45eb-94f4-a5e4defff305/5e654c71-1e61-4f84-86dc-6fcfaf33f513</a>`\n */\nexport const Linker = Node.create({\n name: 'linker',\n content: 'text*',\n marks: '',\n group: 'inline',\n\n inline: true,\n selectable: true,\n atom: true,\n draggable: true,\n isolating: true,\n allowGapCursor: false,\n\n priority: 1100,\n keepOnSplit: false,\n\n addOptions() {\n return {\n openOnClick: true,\n HTMLAttributes: {\n target: null,\n title: null,\n class: null,\n 'data-id': null,\n 'data-app-prefix': null,\n },\n validate: undefined,\n };\n },\n\n addAttributes() {\n return {\n href: {\n default: null,\n },\n class: {\n default: this.options.HTMLAttributes.class,\n },\n target: {\n default: this.options.HTMLAttributes.target,\n // Sanitize target value\n parseHTML: (element) =>\n element.getAttribute('target') !== '_blank' ? null : '_blank',\n },\n title: {\n default: this.options.HTMLAttributes.title,\n },\n 'data-id': {\n default: this.options.HTMLAttributes['data-id'],\n },\n 'data-app-prefix': {\n default: this.options.HTMLAttributes['data-app-prefix'],\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'a[href]:not([href *= \"javascript:\" i])[data-id][data-app-prefix]',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n if (HTMLAttributes.href?.startsWith('javascript:')) {\n return [\n 'a',\n mergeAttributes(this.options.HTMLAttributes, {\n ...HTMLAttributes,\n href: '',\n }),\n 0,\n ];\n }\n return [\n 'a',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setLinker:\n (attrs) =>\n ({ commands }) => {\n // Insert a Linker node with inner text node\n commands.insertContent({\n type: this.name,\n attrs,\n content: [\n {\n type: 'text',\n text: attrs.title,\n },\n ],\n });\n return true;\n },\n\n unsetLinker:\n () =>\n ({ state, tr }) => {\n // Which Linker node is actually selected ?\n const { node, from, to } = state.selection as NodeSelection;\n // Delete any selected Linker node\n if (node?.type.name === 'linker') {\n /* The following does not work as one would expected.\n commands.deleteNode(this.name);\n commands.deleteCurrentNode();\n * Replaced by : */\n tr.delete(from, to).scrollIntoView();\n }\n return true;\n },\n };\n },\n});\n"],"names":["Linker","Node","element","HTMLAttributes","_a","mergeAttributes","attrs","commands","state","tr","node","from","to"],"mappings":"gHAkCaA,EAASC,OAAK,OAAO,CAChC,KAAM,SACN,QAAS,QACT,MAAO,GACP,MAAO,SAEP,OAAQ,GACR,WAAY,GACZ,KAAM,GACN,UAAW,GACX,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AG,OAAOE,EAAMC,CAAE,EAAE,eAAe,EAE9B,EACT,CAAA,CAEN,CACF,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Node, mergeAttributes } from "@tiptap/core";
2
- const Linker = Node.create({
1
+ import { Node as s, mergeAttributes as a } from "@tiptap/core";
2
+ const u = s.create({
3
3
  name: "linker",
4
4
  content: "text*",
5
5
  marks: "",
@@ -36,7 +36,7 @@ const Linker = Node.create({
36
36
  target: {
37
37
  default: this.options.HTMLAttributes.target,
38
38
  // Sanitize target value
39
- parseHTML: (element) => element.getAttribute("target") !== "_blank" ? null : "_blank"
39
+ parseHTML: (t) => t.getAttribute("target") !== "_blank" ? null : "_blank"
40
40
  },
41
41
  title: {
42
42
  default: this.options.HTMLAttributes.title
@@ -56,41 +56,41 @@ const Linker = Node.create({
56
56
  }
57
57
  ];
58
58
  },
59
- renderHTML({ HTMLAttributes }) {
60
- var _a;
61
- return (_a = HTMLAttributes.href) != null && _a.startsWith("javascript:") ? [
59
+ renderHTML({ HTMLAttributes: t }) {
60
+ var e;
61
+ return (e = t.href) != null && e.startsWith("javascript:") ? [
62
62
  "a",
63
- mergeAttributes(this.options.HTMLAttributes, {
64
- ...HTMLAttributes,
63
+ a(this.options.HTMLAttributes, {
64
+ ...t,
65
65
  href: ""
66
66
  }),
67
67
  0
68
68
  ] : [
69
69
  "a",
70
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
70
+ a(this.options.HTMLAttributes, t),
71
71
  0
72
72
  ];
73
73
  },
74
74
  addCommands() {
75
75
  return {
76
- setLinker: (attrs) => ({ commands }) => (commands.insertContent({
76
+ setLinker: (t) => ({ commands: e }) => (e.insertContent({
77
77
  type: this.name,
78
- attrs,
78
+ attrs: t,
79
79
  content: [
80
80
  {
81
81
  type: "text",
82
- text: attrs.title
82
+ text: t.title
83
83
  }
84
84
  ]
85
85
  }), !0),
86
- unsetLinker: () => ({ state, tr }) => {
87
- const { node, from, to } = state.selection;
88
- return (node == null ? void 0 : node.type.name) === "linker" && tr.delete(from, to).scrollIntoView(), !0;
86
+ unsetLinker: () => ({ state: t, tr: e }) => {
87
+ const { node: r, from: i, to: n } = t.selection;
88
+ return (r == null ? void 0 : r.type.name) === "linker" && e.delete(i, n).scrollIntoView(), !0;
89
89
  }
90
90
  };
91
91
  }
92
92
  });
93
93
  export {
94
- Linker
94
+ u as Linker
95
95
  };
96
96
  //# sourceMappingURL=linker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"linker.js","sources":["../../src/linker/linker.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core';\nimport { NodeSelection } from '@tiptap/pm/state';\n\n/* Our own model of a link in a rich document. */\nexport type LinkerAttributes = {\n href: string | null;\n target: '_blank' | null;\n title: string | null;\n 'data-id': string | null;\n 'data-app-prefix': string | null;\n};\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n linker: {\n /**\n * Set a linker node\n */\n setLinker: (attributes: LinkerAttributes) => ReturnType;\n /**\n * Unset a linker node\n */\n unsetLinker: () => ReturnType;\n };\n }\n}\n\n/**\n * Internal links extension.\n * Reproduces the legacy angularJs \"linker\" directive.\n *\n * Links to internal resources MAY have a `title` and MUST HAVE `data-id` and `data-app-prefix` attributes :\n * `<a href=\"/blog#/view/35fa4198-blog_id/5e654c71-article_id\" data-app-prefix=\"blog\" data-id=\"35fa4198-blog_id\" target=\"_blank\" title=\"Voir ce billet de blog\" class=\"ng-scope\">/blog#/view/35fa4198-57fe-45eb-94f4-a5e4defff305/5e654c71-1e61-4f84-86dc-6fcfaf33f513</a>`\n */\nexport const Linker = Node.create({\n name: 'linker',\n content: 'text*',\n marks: '',\n group: 'inline',\n\n inline: true,\n selectable: true,\n atom: true,\n draggable: true,\n isolating: true,\n allowGapCursor: false,\n\n priority: 1100,\n keepOnSplit: false,\n\n addOptions() {\n return {\n openOnClick: true,\n HTMLAttributes: {\n target: null,\n title: null,\n class: null,\n 'data-id': null,\n 'data-app-prefix': null,\n },\n validate: undefined,\n };\n },\n\n addAttributes() {\n return {\n href: {\n default: null,\n },\n class: {\n default: this.options.HTMLAttributes.class,\n },\n target: {\n default: this.options.HTMLAttributes.target,\n // Sanitize target value\n parseHTML: (element) =>\n element.getAttribute('target') !== '_blank' ? null : '_blank',\n },\n title: {\n default: this.options.HTMLAttributes.title,\n },\n 'data-id': {\n default: this.options.HTMLAttributes['data-id'],\n },\n 'data-app-prefix': {\n default: this.options.HTMLAttributes['data-app-prefix'],\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'a[href]:not([href *= \"javascript:\" i])[data-id][data-app-prefix]',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n if (HTMLAttributes.href?.startsWith('javascript:')) {\n return [\n 'a',\n mergeAttributes(this.options.HTMLAttributes, {\n ...HTMLAttributes,\n href: '',\n }),\n 0,\n ];\n }\n return [\n 'a',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setLinker:\n (attrs) =>\n ({ commands }) => {\n // Insert a Linker node with inner text node\n commands.insertContent({\n type: this.name,\n attrs,\n content: [\n {\n type: 'text',\n text: attrs.title,\n },\n ],\n });\n return true;\n },\n\n unsetLinker:\n () =>\n ({ state, tr }) => {\n // Which Linker node is actually selected ?\n const { node, from, to } = state.selection as NodeSelection;\n // Delete any selected Linker node\n if (node?.type.name === 'linker') {\n /* The following does not work as one would expected.\n commands.deleteNode(this.name);\n commands.deleteCurrentNode();\n * Replaced by : */\n tr.delete(from, to).scrollIntoView();\n }\n return true;\n },\n };\n },\n});\n"],"names":[],"mappings":";AAkCa,MAAA,SAAS,KAAK,OAAO;AAAA,EAChC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EAEP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,WAAW;AAAA,EACX,WAAW;AAAA,EACX,gBAAgB;AAAA,EAEhB,UAAU;AAAA,EACV,aAAa;AAA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AAK;AAAA,QACX;AAAA,QACA,SAAS;AAAA,UACP;AAAA,YACE,MAAM;AAAA,YACN,MAAM,MAAM;AAAA,UACd;AAAA,QACF;AAAA,MAAA,CACD,GACM;AAAA,MAGX,aACE,MACA,CAAC,EAAE,OAAO,SAAS;AAEjB,cAAM,EAAE,MAAM,MAAM,GAAA,IAAO,MAAM;AAE7B,gBAAA,6BAAM,KAAK,UAAS,YAKtB,GAAG,OAAO,MAAM,EAAE,EAAE,eAAe,GAE9B;AAAA,MACT;AAAA,IAAA;AAAA,EAEN;AACF,CAAC;"}
1
+ {"version":3,"file":"linker.js","sources":["../../src/linker/linker.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core';\nimport { NodeSelection } from '@tiptap/pm/state';\n\n/* Our own model of a link in a rich document. */\nexport type LinkerAttributes = {\n href: string | null;\n target: '_blank' | null;\n title: string | null;\n 'data-id': string | null;\n 'data-app-prefix': string | null;\n};\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n linker: {\n /**\n * Set a linker node\n */\n setLinker: (attributes: LinkerAttributes) => ReturnType;\n /**\n * Unset a linker node\n */\n unsetLinker: () => ReturnType;\n };\n }\n}\n\n/**\n * Internal links extension.\n * Reproduces the legacy angularJs \"linker\" directive.\n *\n * Links to internal resources MAY have a `title` and MUST HAVE `data-id` and `data-app-prefix` attributes :\n * `<a href=\"/blog#/view/35fa4198-blog_id/5e654c71-article_id\" data-app-prefix=\"blog\" data-id=\"35fa4198-blog_id\" target=\"_blank\" title=\"Voir ce billet de blog\" class=\"ng-scope\">/blog#/view/35fa4198-57fe-45eb-94f4-a5e4defff305/5e654c71-1e61-4f84-86dc-6fcfaf33f513</a>`\n */\nexport const Linker = Node.create({\n name: 'linker',\n content: 'text*',\n marks: '',\n group: 'inline',\n\n inline: true,\n selectable: true,\n atom: true,\n draggable: true,\n isolating: true,\n allowGapCursor: false,\n\n priority: 1100,\n keepOnSplit: false,\n\n addOptions() {\n return {\n openOnClick: true,\n HTMLAttributes: {\n target: null,\n title: null,\n class: null,\n 'data-id': null,\n 'data-app-prefix': null,\n },\n validate: undefined,\n };\n },\n\n addAttributes() {\n return {\n href: {\n default: null,\n },\n class: {\n default: this.options.HTMLAttributes.class,\n },\n target: {\n default: this.options.HTMLAttributes.target,\n // Sanitize target value\n parseHTML: (element) =>\n element.getAttribute('target') !== '_blank' ? null : '_blank',\n },\n title: {\n default: this.options.HTMLAttributes.title,\n },\n 'data-id': {\n default: this.options.HTMLAttributes['data-id'],\n },\n 'data-app-prefix': {\n default: this.options.HTMLAttributes['data-app-prefix'],\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'a[href]:not([href *= \"javascript:\" i])[data-id][data-app-prefix]',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n if (HTMLAttributes.href?.startsWith('javascript:')) {\n return [\n 'a',\n mergeAttributes(this.options.HTMLAttributes, {\n ...HTMLAttributes,\n href: '',\n }),\n 0,\n ];\n }\n return [\n 'a',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n 0,\n ];\n },\n\n addCommands() {\n return {\n setLinker:\n (attrs) =>\n ({ commands }) => {\n // Insert a Linker node with inner text node\n commands.insertContent({\n type: this.name,\n attrs,\n content: [\n {\n type: 'text',\n text: attrs.title,\n },\n ],\n });\n return true;\n },\n\n unsetLinker:\n () =>\n ({ state, tr }) => {\n // Which Linker node is actually selected ?\n const { node, from, to } = state.selection as NodeSelection;\n // Delete any selected Linker node\n if (node?.type.name === 'linker') {\n /* The following does not work as one would expected.\n commands.deleteNode(this.name);\n commands.deleteCurrentNode();\n * Replaced by : */\n tr.delete(from, to).scrollIntoView();\n }\n return true;\n },\n };\n },\n});\n"],"names":["Linker","Node","element","HTMLAttributes","_a","mergeAttributes","attrs","commands","state","tr","node","from","to"],"mappings":";AAkCa,MAAAA,IAASC,EAAK,OAAO;AAAA,EAChC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EA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AQ,gBAAgBF,CAAc;AAAA,MAC3D;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,WACE,CAACG,MACD,CAAC,EAAE,UAAAC,SAEDA,EAAS,cAAc;AAAA,QACrB,MAAM,KAAK;AAAA,QACX,OAAAD;AAAA,QACA,SAAS;AAAA,UACP;AAAA,YACE,MAAM;AAAA,YACN,MAAMA,EAAM;AAAA,UACd;AAAA,QACF;AAAA,MAAA,CACD,GACM;AAAA,MAGX,aACE,MACA,CAAC,EAAE,OAAAE,GAAO,IAAAC,QAAS;AAEjB,cAAM,EAAE,MAAAC,GAAM,MAAAC,GAAM,IAAAC,EAAA,IAAOJ,EAAM;AAE7B,gBAAAE,KAAA,gBAAAA,EAAM,KAAK,UAAS,YAKtBD,EAAG,OAAOE,GAAMC,CAAE,EAAE,eAAe,GAE9B;AAAA,MACT;AAAA,IAAA;AAAA,EAEN;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),MathJax=core.Node.create({name:"mathjaxnode",group:"inline",inline:!0,atom:!1,selectable:!0,parseHTML(){return[{tag:"mathjax"}]},addAttributes(){return{equation:{default:null,parseHTML:element=>{const textNodes=[...element.childNodes].filter(child=>child.nodeType===3);return textNodes.length>0?textNodes[textNodes.length-1].nodeValue:null}}}},renderHTML({HTMLAttributes}){let equation=(HTMLAttributes.equation||"").replaceAll(/(?:\\)?begin{equation}\s*\n?\s*{(.+?)}\n?\s*?(?:\\)?end{equation}/gm,"$$$1$$").replaceAll(/(?:\\)?begin{equation}\s*\n?\s*(.+?)\n?\s*?(?:\\)?end{equation}/gm,"$$$1$$");return equation.length>0&&(equation.charAt(0)!=="$"&&(equation=`$${equation}`),equation.charAt(equation.length-1)!=="$"&&(equation=`${equation}$`)),["span",{},equation]}});exports.MathJax=MathJax;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@tiptap/core"),l=r.Node.create({name:"mathjaxnode",group:"inline",inline:!0,atom:!1,selectable:!0,parseHTML(){return[{tag:"mathjax"}]},addAttributes(){return{equation:{default:null,parseHTML:t=>{const n=[...t.childNodes].filter(a=>a.nodeType===3);return n.length>0?n[n.length-1].nodeValue:null}}}},renderHTML({HTMLAttributes:t}){let e=(t.equation||"").replaceAll(/(?:\\)?begin{equation}\s*\n?\s*{(.+?)}\n?\s*?(?:\\)?end{equation}/gm,"$$$1$$").replaceAll(/(?:\\)?begin{equation}\s*\n?\s*(.+?)\n?\s*?(?:\\)?end{equation}/gm,"$$$1$$");return e.length>0&&(e.charAt(0)!=="$"&&(e=`$${e}`),e.charAt(e.length-1)!=="$"&&(e=`${e}$`)),["span",{},e]}});exports.MathJax=l;
2
2
  //# sourceMappingURL=mathjax.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mathjax.cjs","sources":["../../src/mathjax/mathjax.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport const MathJax = Node.create({\n name: 'mathjaxnode',\n group: 'inline',\n inline: true,\n atom: false,\n selectable: true,\n\n parseHTML() {\n return [\n {\n tag: 'mathjax',\n },\n ];\n },\n\n addAttributes() {\n return {\n equation: {\n default: null,\n parseHTML: (element: any) => {\n const children = [...element.childNodes];\n const textNodes = children.filter((child) => child.nodeType === 3);\n return textNodes.length > 0\n ? textNodes[textNodes.length - 1].nodeValue\n : null;\n },\n },\n };\n },\n\n renderHTML({ HTMLAttributes }) {\n let equation = (HTMLAttributes.equation || '')\n // Get what is between \\begin{equation}{... ...}\\end{equation}\n // Or between \\begin{equation}... ...\\end{equation} without enclosing brackets\n .replaceAll(\n /(?:\\\\)?begin{equation}\\s*\\n?\\s*{(.+?)}\\n?\\s*?(?:\\\\)?end{equation}/gm,\n '$$$1$$',\n )\n .replaceAll(\n /(?:\\\\)?begin{equation}\\s*\\n?\\s*(.+?)\\n?\\s*?(?:\\\\)?end{equation}/gm,\n '$$$1$$',\n );\n if (equation.length > 0) {\n if (equation.charAt(0) !== '$') {\n equation = `$${equation}`;\n }\n if (equation.charAt(equation.length - 1) !== '$') {\n equation = `${equation}$`;\n }\n }\n return ['span', {}, equation];\n },\n});\n"],"names":["Node"],"mappings":"mHAEa,QAAUA,UAAK,OAAO,CACjC,KAAM,cACN,MAAO,SACP,OAAQ,GACR,KAAM,GACN,WAAY,GAEZ,WAAY,CACH,MAAA,CACL,CACE,IAAK,SACP,CAAA,CAEJ,EAEA,eAAgB,CACP,MAAA,CACL,SAAU,CACR,QAAS,KACT,UAAY,SAAiB,CAE3B,MAAM,UADW,CAAC,GAAG,QAAQ,UAAU,EACZ,OAAQ,OAAU,MAAM,WAAa,CAAC,EAC1D,OAAA,UAAU,OAAS,EACtB,UAAU,UAAU,OAAS,CAAC,EAAE,UAChC,IACN,CACF,CAAA,CAEJ,EAEA,WAAW,CAAE,gBAAkB,CACzB,IAAA,UAAY,eAAe,UAAY,IAGxC,WACC,sEACA,QAAA,EAED,WACC,oEACA,QAAA,EAEA,OAAA,SAAS,OAAS,IAChB,SAAS,OAAO,CAAC,IAAM,MACzB,SAAW,IAAI,QAAQ,IAErB,SAAS,OAAO,SAAS,OAAS,CAAC,IAAM,MAC3C,SAAW,GAAG,QAAQ,MAGnB,CAAC,OAAQ,GAAI,QAAQ,CAC9B,CACF,CAAC"}
1
+ {"version":3,"file":"mathjax.cjs","sources":["../../src/mathjax/mathjax.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport const MathJax = Node.create({\n name: 'mathjaxnode',\n group: 'inline',\n inline: true,\n atom: false,\n selectable: true,\n\n parseHTML() {\n return [\n {\n tag: 'mathjax',\n },\n ];\n },\n\n addAttributes() {\n return {\n equation: {\n default: null,\n parseHTML: (element: any) => {\n const children = [...element.childNodes];\n const textNodes = children.filter((child) => child.nodeType === 3);\n return textNodes.length > 0\n ? textNodes[textNodes.length - 1].nodeValue\n : null;\n },\n },\n };\n },\n\n renderHTML({ HTMLAttributes }) {\n let equation = (HTMLAttributes.equation || '')\n // Get what is between \\begin{equation}{... ...}\\end{equation}\n // Or between \\begin{equation}... ...\\end{equation} without enclosing brackets\n .replaceAll(\n /(?:\\\\)?begin{equation}\\s*\\n?\\s*{(.+?)}\\n?\\s*?(?:\\\\)?end{equation}/gm,\n '$$$1$$',\n )\n .replaceAll(\n /(?:\\\\)?begin{equation}\\s*\\n?\\s*(.+?)\\n?\\s*?(?:\\\\)?end{equation}/gm,\n '$$$1$$',\n );\n if (equation.length > 0) {\n if (equation.charAt(0) !== '$') {\n equation = `$${equation}`;\n }\n if (equation.charAt(equation.length - 1) !== '$') {\n equation = `${equation}$`;\n }\n }\n return ['span', {}, equation];\n },\n});\n"],"names":["MathJax","Node","element","textNodes","child","HTMLAttributes","equation"],"mappings":"gHAEaA,EAAUC,OAAK,OAAO,CACjC,KAAM,cACN,MAAO,SACP,OAAQ,GACR,KAAM,GACN,WAAY,GAEZ,WAAY,CACH,MAAA,CACL,CACE,IAAK,SACP,CAAA,CAEJ,EAEA,eAAgB,CACP,MAAA,CACL,SAAU,CACR,QAAS,KACT,UAAYC,GAAiB,CAE3B,MAAMC,EADW,CAAC,GAAGD,EAAQ,UAAU,EACZ,OAAQE,GAAUA,EAAM,WAAa,CAAC,EAC1D,OAAAD,EAAU,OAAS,EACtBA,EAAUA,EAAU,OAAS,CAAC,EAAE,UAChC,IACN,CACF,CAAA,CAEJ,EAEA,WAAW,CAAE,eAAAE,GAAkB,CACzB,IAAAC,GAAYD,EAAe,UAAY,IAGxC,WACC,sEACA,QAAA,EAED,WACC,oEACA,QAAA,EAEA,OAAAC,EAAS,OAAS,IAChBA,EAAS,OAAO,CAAC,IAAM,MACzBA,EAAW,IAAIA,CAAQ,IAErBA,EAAS,OAAOA,EAAS,OAAS,CAAC,IAAM,MAC3CA,EAAW,GAAGA,CAAQ,MAGnB,CAAC,OAAQ,GAAIA,CAAQ,CAC9B,CACF,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Node } from "@tiptap/core";
2
- const MathJax = Node.create({
1
+ import { Node as r } from "@tiptap/core";
2
+ const i = r.create({
3
3
  name: "mathjaxnode",
4
4
  group: "inline",
5
5
  inline: !0,
@@ -16,25 +16,25 @@ const MathJax = Node.create({
16
16
  return {
17
17
  equation: {
18
18
  default: null,
19
- parseHTML: (element) => {
20
- const textNodes = [...element.childNodes].filter((child) => child.nodeType === 3);
21
- return textNodes.length > 0 ? textNodes[textNodes.length - 1].nodeValue : null;
19
+ parseHTML: (n) => {
20
+ const t = [...n.childNodes].filter((a) => a.nodeType === 3);
21
+ return t.length > 0 ? t[t.length - 1].nodeValue : null;
22
22
  }
23
23
  }
24
24
  };
25
25
  },
26
- renderHTML({ HTMLAttributes }) {
27
- let equation = (HTMLAttributes.equation || "").replaceAll(
26
+ renderHTML({ HTMLAttributes: n }) {
27
+ let e = (n.equation || "").replaceAll(
28
28
  /(?:\\)?begin{equation}\s*\n?\s*{(.+?)}\n?\s*?(?:\\)?end{equation}/gm,
29
29
  "$$$1$$"
30
30
  ).replaceAll(
31
31
  /(?:\\)?begin{equation}\s*\n?\s*(.+?)\n?\s*?(?:\\)?end{equation}/gm,
32
32
  "$$$1$$"
33
33
  );
34
- return equation.length > 0 && (equation.charAt(0) !== "$" && (equation = `$${equation}`), equation.charAt(equation.length - 1) !== "$" && (equation = `${equation}$`)), ["span", {}, equation];
34
+ return e.length > 0 && (e.charAt(0) !== "$" && (e = `$${e}`), e.charAt(e.length - 1) !== "$" && (e = `${e}$`)), ["span", {}, e];
35
35
  }
36
36
  });
37
37
  export {
38
- MathJax
38
+ i as MathJax
39
39
  };
40
40
  //# sourceMappingURL=mathjax.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mathjax.js","sources":["../../src/mathjax/mathjax.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport const MathJax = Node.create({\n name: 'mathjaxnode',\n group: 'inline',\n inline: true,\n atom: false,\n selectable: true,\n\n parseHTML() {\n return [\n {\n tag: 'mathjax',\n },\n ];\n },\n\n addAttributes() {\n return {\n equation: {\n default: null,\n parseHTML: (element: any) => {\n const children = [...element.childNodes];\n const textNodes = children.filter((child) => child.nodeType === 3);\n return textNodes.length > 0\n ? textNodes[textNodes.length - 1].nodeValue\n : null;\n },\n },\n };\n },\n\n renderHTML({ HTMLAttributes }) {\n let equation = (HTMLAttributes.equation || '')\n // Get what is between \\begin{equation}{... ...}\\end{equation}\n // Or between \\begin{equation}... ...\\end{equation} without enclosing brackets\n .replaceAll(\n /(?:\\\\)?begin{equation}\\s*\\n?\\s*{(.+?)}\\n?\\s*?(?:\\\\)?end{equation}/gm,\n '$$$1$$',\n )\n .replaceAll(\n /(?:\\\\)?begin{equation}\\s*\\n?\\s*(.+?)\\n?\\s*?(?:\\\\)?end{equation}/gm,\n '$$$1$$',\n );\n if (equation.length > 0) {\n if (equation.charAt(0) !== '$') {\n equation = `$${equation}`;\n }\n if (equation.charAt(equation.length - 1) !== '$') {\n equation = `${equation}$`;\n }\n }\n return ['span', {}, equation];\n },\n});\n"],"names":[],"mappings":";AAEa,MAAA,UAAU,KAAK,OAAO;AAAA,EACjC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,YAAY;AAAA,EAEZ,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACP;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,gBAAgB;AACP,WAAA;AAAA,MACL,UAAU;AAAA,QACR,SAAS;AAAA,QACT,WAAW,CAAC,YAAiB;AAE3B,gBAAM,YADW,CAAC,GAAG,QAAQ,UAAU,EACZ,OAAO,CAAC,UAAU,MAAM,aAAa,CAAC;AAC1D,iBAAA,UAAU,SAAS,IACtB,UAAU,UAAU,SAAS,CAAC,EAAE,YAChC;AAAA,QACN;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,WAAW,EAAE,kBAAkB;AACzB,QAAA,YAAY,eAAe,YAAY,IAGxC;AAAA,MACC;AAAA,MACA;AAAA,IAAA,EAED;AAAA,MACC;AAAA,MACA;AAAA,IAAA;AAEA,WAAA,SAAS,SAAS,MAChB,SAAS,OAAO,CAAC,MAAM,QACzB,WAAW,IAAI,QAAQ,KAErB,SAAS,OAAO,SAAS,SAAS,CAAC,MAAM,QAC3C,WAAW,GAAG,QAAQ,OAGnB,CAAC,QAAQ,IAAI,QAAQ;AAAA,EAC9B;AACF,CAAC;"}
1
+ {"version":3,"file":"mathjax.js","sources":["../../src/mathjax/mathjax.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport const MathJax = Node.create({\n name: 'mathjaxnode',\n group: 'inline',\n inline: true,\n atom: false,\n selectable: true,\n\n parseHTML() {\n return [\n {\n tag: 'mathjax',\n },\n ];\n },\n\n addAttributes() {\n return {\n equation: {\n default: null,\n parseHTML: (element: any) => {\n const children = [...element.childNodes];\n const textNodes = children.filter((child) => child.nodeType === 3);\n return textNodes.length > 0\n ? textNodes[textNodes.length - 1].nodeValue\n : null;\n },\n },\n };\n },\n\n renderHTML({ HTMLAttributes }) {\n let equation = (HTMLAttributes.equation || '')\n // Get what is between \\begin{equation}{... ...}\\end{equation}\n // Or between \\begin{equation}... ...\\end{equation} without enclosing brackets\n .replaceAll(\n /(?:\\\\)?begin{equation}\\s*\\n?\\s*{(.+?)}\\n?\\s*?(?:\\\\)?end{equation}/gm,\n '$$$1$$',\n )\n .replaceAll(\n /(?:\\\\)?begin{equation}\\s*\\n?\\s*(.+?)\\n?\\s*?(?:\\\\)?end{equation}/gm,\n '$$$1$$',\n );\n if (equation.length > 0) {\n if (equation.charAt(0) !== '$') {\n equation = `$${equation}`;\n }\n if (equation.charAt(equation.length - 1) !== '$') {\n equation = `${equation}$`;\n }\n }\n return ['span', {}, equation];\n },\n});\n"],"names":["MathJax","Node","element","textNodes","child","HTMLAttributes","equation"],"mappings":";AAEa,MAAAA,IAAUC,EAAK,OAAO;AAAA,EACjC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,YAAY;AAAA,EAEZ,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACP;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,gBAAgB;AACP,WAAA;AAAA,MACL,UAAU;AAAA,QACR,SAAS;AAAA,QACT,WAAW,CAACC,MAAiB;AAE3B,gBAAMC,IADW,CAAC,GAAGD,EAAQ,UAAU,EACZ,OAAO,CAACE,MAAUA,EAAM,aAAa,CAAC;AAC1D,iBAAAD,EAAU,SAAS,IACtBA,EAAUA,EAAU,SAAS,CAAC,EAAE,YAChC;AAAA,QACN;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,WAAW,EAAE,gBAAAE,KAAkB;AACzB,QAAAC,KAAYD,EAAe,YAAY,IAGxC;AAAA,MACC;AAAA,MACA;AAAA,IAAA,EAED;AAAA,MACC;AAAA,MACA;AAAA,IAAA;AAEA,WAAAC,EAAS,SAAS,MAChBA,EAAS,OAAO,CAAC,MAAM,QACzBA,IAAW,IAAIA,CAAQ,KAErBA,EAAS,OAAOA,EAAS,SAAS,CAAC,MAAM,QAC3CA,IAAW,GAAGA,CAAQ,OAGnB,CAAC,QAAQ,IAAIA,CAAQ;AAAA,EAC9B;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const extensionParagraph=require("@tiptap/extension-paragraph"),Paragraph=extensionParagraph.Paragraph.extend({parseHTML(){var _a;return[...((_a=this.parent)==null?void 0:_a.call(this))??[],{tag:"div[style]:has(> span)"}]}});exports.Paragraph=Paragraph;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@tiptap/extension-paragraph"),r=e.Paragraph.extend({parseHTML(){var a;return[...((a=this.parent)==null?void 0:a.call(this))??[],{tag:"div[style]:has(> span)"}]}});exports.Paragraph=r;
2
2
  //# sourceMappingURL=paragraph.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"paragraph.cjs","sources":["../../src/paragraph/paragraph.ts"],"sourcesContent":["import { Paragraph as TiptapParagraph } from '@tiptap/extension-paragraph';\n\n/**\n * Extends `Paragraph` extension from TipTap.\n *\n * This extension is used to parse documents in old-format (version 0),\n * where text alignments were applied on a <div> wrapping a <span>.\n * The new format is a <p> with style attributes.\n *\n * For example :\n * `<div style=\"text-align: right;\"><span style=\"font-size: 20pt;\">A right-aligned text</span></div>`\n * is now parsed and rendered as\n * `<p style=\"text-align: right;\"><span style=\"font-size: 20pt;\">A right-aligned text</span></p>`\n */\nexport const Paragraph = TiptapParagraph.extend({\n parseHTML() {\n const parentRules = this.parent?.() ?? [];\n return [\n ...parentRules,\n {\n tag: 'div[style]:has(> span)',\n },\n ];\n },\n});\n"],"names":["TiptapParagraph"],"mappings":"gJAca,UAAYA,6BAAgB,OAAO,CAC9C,WAAY,QAEH,MAAA,CACL,KAFkB,QAAK,SAAL,4BAAmB,CAAA,EAGrC,CACE,IAAK,wBACP,CAAA,CAEJ,CACF,CAAC"}
1
+ {"version":3,"file":"paragraph.cjs","sources":["../../src/paragraph/paragraph.ts"],"sourcesContent":["import { Paragraph as TiptapParagraph } from '@tiptap/extension-paragraph';\n\n/**\n * Extends `Paragraph` extension from TipTap.\n *\n * This extension is used to parse documents in old-format (version 0),\n * where text alignments were applied on a <div> wrapping a <span>.\n * The new format is a <p> with style attributes.\n *\n * For example :\n * `<div style=\"text-align: right;\"><span style=\"font-size: 20pt;\">A right-aligned text</span></div>`\n * is now parsed and rendered as\n * `<p style=\"text-align: right;\"><span style=\"font-size: 20pt;\">A right-aligned text</span></p>`\n */\nexport const Paragraph = TiptapParagraph.extend({\n parseHTML() {\n const parentRules = this.parent?.() ?? [];\n return [\n ...parentRules,\n {\n tag: 'div[style]:has(> span)',\n },\n ];\n },\n});\n"],"names":["Paragraph","TiptapParagraph","_a"],"mappings":"+HAcaA,EAAYC,YAAgB,OAAO,CAC9C,WAAY,OAEH,MAAA,CACL,KAFkBC,EAAA,KAAK,SAAL,YAAAA,EAAA,aAAmB,CAAA,EAGrC,CACE,IAAK,wBACP,CAAA,CAEJ,CACF,CAAC"}
@@ -1,9 +1,9 @@
1
- import { Paragraph as Paragraph$1 } from "@tiptap/extension-paragraph";
2
- const Paragraph = Paragraph$1.extend({
1
+ import { Paragraph as r } from "@tiptap/extension-paragraph";
2
+ const p = r.extend({
3
3
  parseHTML() {
4
- var _a;
4
+ var a;
5
5
  return [
6
- ...((_a = this.parent) == null ? void 0 : _a.call(this)) ?? [],
6
+ ...((a = this.parent) == null ? void 0 : a.call(this)) ?? [],
7
7
  {
8
8
  tag: "div[style]:has(> span)"
9
9
  }
@@ -11,6 +11,6 @@ const Paragraph = Paragraph$1.extend({
11
11
  }
12
12
  });
13
13
  export {
14
- Paragraph
14
+ p as Paragraph
15
15
  };
16
16
  //# sourceMappingURL=paragraph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"paragraph.js","sources":["../../src/paragraph/paragraph.ts"],"sourcesContent":["import { Paragraph as TiptapParagraph } from '@tiptap/extension-paragraph';\n\n/**\n * Extends `Paragraph` extension from TipTap.\n *\n * This extension is used to parse documents in old-format (version 0),\n * where text alignments were applied on a <div> wrapping a <span>.\n * The new format is a <p> with style attributes.\n *\n * For example :\n * `<div style=\"text-align: right;\"><span style=\"font-size: 20pt;\">A right-aligned text</span></div>`\n * is now parsed and rendered as\n * `<p style=\"text-align: right;\"><span style=\"font-size: 20pt;\">A right-aligned text</span></p>`\n */\nexport const Paragraph = TiptapParagraph.extend({\n parseHTML() {\n const parentRules = this.parent?.() ?? [];\n return [\n ...parentRules,\n {\n tag: 'div[style]:has(> span)',\n },\n ];\n },\n});\n"],"names":["TiptapParagraph"],"mappings":";AAca,MAAA,YAAYA,YAAgB,OAAO;AAAA,EAC9C,YAAY;;AAEH,WAAA;AAAA,MACL,KAFkB,UAAK,WAAL,kCAAmB,CAAA;AAAA,MAGrC;AAAA,QACE,KAAK;AAAA,MACP;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
1
+ {"version":3,"file":"paragraph.js","sources":["../../src/paragraph/paragraph.ts"],"sourcesContent":["import { Paragraph as TiptapParagraph } from '@tiptap/extension-paragraph';\n\n/**\n * Extends `Paragraph` extension from TipTap.\n *\n * This extension is used to parse documents in old-format (version 0),\n * where text alignments were applied on a <div> wrapping a <span>.\n * The new format is a <p> with style attributes.\n *\n * For example :\n * `<div style=\"text-align: right;\"><span style=\"font-size: 20pt;\">A right-aligned text</span></div>`\n * is now parsed and rendered as\n * `<p style=\"text-align: right;\"><span style=\"font-size: 20pt;\">A right-aligned text</span></p>`\n */\nexport const Paragraph = TiptapParagraph.extend({\n parseHTML() {\n const parentRules = this.parent?.() ?? [];\n return [\n ...parentRules,\n {\n tag: 'div[style]:has(> span)',\n },\n ];\n },\n});\n"],"names":["Paragraph","TiptapParagraph","_a"],"mappings":";AAca,MAAAA,IAAYC,EAAgB,OAAO;AAAA,EAC9C,YAAY;;AAEH,WAAA;AAAA,MACL,KAFkBC,IAAA,KAAK,WAAL,gBAAAA,EAAA,eAAmB,CAAA;AAAA,MAGrC;AAAA,QACE,KAAK;AAAA,MACP;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core");class SR_Node extends core.Node{constructor(){super();__publicField(this,"recognition");__publicField(this,"isStarted",!1)}static create(config){return core.Node.create(config)}}const SpeechRecognition=SR_Node.create({name:"SpeechRecognition",addOptions(){return{lang:"fr-FR"}},onCreate(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window||console.warn('"speechrecognition extension from @edifice.io/tiptap-extensions" requires a browser supporting the SpeechRecognition API".')},addCommands(){return{startSpeechRecognition:()=>({commands})=>{const SpeechRecognition2=window.SpeechRecognition||window.webkitSpeechRecognition;this.recognition=new SpeechRecognition2,this.recognition.lang=this.options.lang,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.continuous=!0,this.recognition.start();let{from,to}=this.editor.state.selection;return this.recognition.onresult=event=>{let currentResult="";for(let i=event.resultIndex;i<event.results.length;i++)currentResult+=event.results[i][0].transcript;const isFinal=event.results[event.results.length-1].isFinal;this.editor.commands.deleteRange({from,to}),this.editor.commands.insertContentAt(from,isFinal?currentResult:`<code>${currentResult}</code>`,{updateSelection:!isFinal}),to=this.editor.state.selection.to,isFinal&&(from=to)},this.recognition.onerror=event=>{console.log(`[speechrecognition from @edifice.io/tiptap-extensions][error][${event.error}]: ${event.message}`)},this.recognition.onstart=()=>{this.isStarted=!0},this.recognition.onend=()=>{this.isStarted=!1},commands},stopSpeechRecognition:()=>({commands})=>(this.recognition.stop(),this.editor.commands.focus(),commands),isSpeechRecognitionStarted:()=>()=>this.isStarted}}});exports.SpeechRecognition=SpeechRecognition;
1
+ "use strict";var h=Object.defineProperty;var d=(e,t,i)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var a=(e,t,i)=>d(e,typeof t!="symbol"?t+"":t,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@tiptap/core");class l extends g.Node{constructor(){super();a(this,"recognition");a(this,"isStarted",!1)}static create(i){return g.Node.create(i)}}const u=l.create({name:"SpeechRecognition",addOptions(){return{lang:"fr-FR"}},onCreate(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window||console.warn('"speechrecognition extension from @edifice.io/tiptap-extensions" requires a browser supporting the SpeechRecognition API".')},addCommands(){return{startSpeechRecognition:()=>({commands:e})=>{const t=window.SpeechRecognition||window.webkitSpeechRecognition;this.recognition=new t,this.recognition.lang=this.options.lang,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.continuous=!0,this.recognition.start();let{from:i,to:n}=this.editor.state.selection;return this.recognition.onresult=o=>{let s="";for(let c=o.resultIndex;c<o.results.length;c++)s+=o.results[c][0].transcript;const r=o.results[o.results.length-1].isFinal;this.editor.commands.deleteRange({from:i,to:n}),this.editor.commands.insertContentAt(i,r?s:`<code>${s}</code>`,{updateSelection:!r}),n=this.editor.state.selection.to,r&&(i=n)},this.recognition.onerror=o=>{console.log(`[speechrecognition from @edifice.io/tiptap-extensions][error][${o.error}]: ${o.message}`)},this.recognition.onstart=()=>{this.isStarted=!0},this.recognition.onend=()=>{this.isStarted=!1},e},stopSpeechRecognition:()=>({commands:e})=>(this.recognition.stop(),this.editor.commands.focus(),e),isSpeechRecognitionStarted:()=>()=>this.isStarted}}});exports.SpeechRecognition=u;
2
2
  //# sourceMappingURL=speech-recognition.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"speech-recognition.cjs","sources":["../../src/speech-recognition/speech-recognition.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface SpeechRecognitionOptions {\n lang: string;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n SpeechRecognition: {\n startSpeechRecognition: () => ReturnType;\n stopSpeechRecognition: () => ReturnType;\n isSpeechRecognitionStarted: () => boolean;\n };\n }\n}\n\nclass SR_Node<O = any, S = any> extends Node<O, S> {\n protected constructor() {\n super();\n }\n\n recognition: SpeechRecognition | undefined;\n readonly isStarted: boolean = false;\n\n static create<O = any, S = any>(config?: any) {\n return Node.create(config) as SR_Node<O, S>;\n }\n}\n\nexport const SpeechRecognition = SR_Node.create<SpeechRecognitionOptions>({\n name: 'SpeechRecognition',\n\n addOptions() {\n return {\n lang: 'fr-FR',\n };\n },\n\n onCreate() {\n if (\n !('SpeechRecognition' in window || 'webkitSpeechRecognition' in window)\n ) {\n console.warn(\n '\"speechrecognition extension from @edifice.io/tiptap-extensions\" requires a browser supporting the SpeechRecognition API\".',\n );\n }\n },\n\n addCommands() {\n return {\n startSpeechRecognition:\n () =>\n ({ commands }) => {\n const SpeechRecognition =\n window.SpeechRecognition || window.webkitSpeechRecognition;\n this.recognition = new SpeechRecognition();\n\n this.recognition.lang = this.options.lang;\n this.recognition.interimResults = true;\n this.recognition.maxAlternatives = 1;\n this.recognition.continuous = true;\n\n this.recognition.start();\n\n // Memoize initial caret positions\n let { from, to } = this.editor.state.selection;\n\n this.recognition.onresult = (event: SpeechRecognitionEvent) => {\n let currentResult = '';\n\n // Add to the currentResult variable the content of the last recognized sentence\n for (let i = event.resultIndex; i < event.results.length; i++) {\n currentResult += event.results[i][0].transcript;\n }\n\n // Is this the final recognition ?\n const isFinal = event.results[event.results.length - 1].isFinal;\n\n // Replace selection by the last recognized sentence (+ style and select, if not final)\n this.editor.commands.deleteRange({ from, to });\n this.editor.commands.insertContentAt(\n from,\n isFinal ? currentResult : `<code>${currentResult}</code>`,\n { updateSelection: !isFinal },\n );\n to = this.editor.state.selection.to;\n\n if (isFinal) {\n // Next content will go after last insertion\n from = to;\n }\n };\n\n this.recognition.onerror = (event: SpeechRecognitionErrorEvent) => {\n // TODO create a \"feedback\" tiptap extension, to display user friendly error messages ?\n console.log(\n `[speechrecognition from @edifice.io/tiptap-extensions][error][${event.error}]: ${event.message}`,\n );\n };\n\n this.recognition.onstart = () => {\n this.isStarted = true;\n };\n\n this.recognition.onend = () => {\n this.isStarted = false;\n };\n\n return commands;\n },\n\n stopSpeechRecognition:\n () =>\n ({ commands }) => {\n this.recognition.stop();\n this.editor.commands.focus();\n return commands;\n },\n\n isSpeechRecognitionStarted: () => () => this.isStarted,\n };\n },\n});\n"],"names":["Node","SpeechRecognition"],"mappings":"yXAgBA,MAAM,gBAAkCA,KAAAA,IAAW,CACvC,aAAc,CAChB,QAGR,kCACS,+BAAqB,GAH9B,CAKA,OAAO,OAAyB,OAAc,CACrC,OAAAA,KAAA,KAAK,OAAO,MAAM,CAC3B,CACF,CAEa,MAAA,kBAAoB,QAAQ,O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CACF,CAAC"}
1
+ {"version":3,"file":"speech-recognition.cjs","sources":["../../src/speech-recognition/speech-recognition.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface SpeechRecognitionOptions {\n lang: string;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n SpeechRecognition: {\n startSpeechRecognition: () => ReturnType;\n stopSpeechRecognition: () => ReturnType;\n isSpeechRecognitionStarted: () => boolean;\n };\n }\n}\n\nclass SR_Node<O = any, S = any> extends Node<O, S> {\n protected constructor() {\n super();\n }\n\n recognition: SpeechRecognition | undefined;\n readonly isStarted: boolean = false;\n\n static create<O = any, S = any>(config?: any) {\n return Node.create(config) as SR_Node<O, S>;\n }\n}\n\nexport const SpeechRecognition = SR_Node.create<SpeechRecognitionOptions>({\n name: 'SpeechRecognition',\n\n addOptions() {\n return {\n lang: 'fr-FR',\n };\n },\n\n onCreate() {\n if (\n !('SpeechRecognition' in window || 'webkitSpeechRecognition' in window)\n ) {\n console.warn(\n '\"speechrecognition extension from @edifice.io/tiptap-extensions\" requires a browser supporting the SpeechRecognition API\".',\n );\n }\n },\n\n addCommands() {\n return {\n startSpeechRecognition:\n () =>\n ({ commands }) => {\n const SpeechRecognition =\n window.SpeechRecognition || window.webkitSpeechRecognition;\n this.recognition = new SpeechRecognition();\n\n this.recognition.lang = this.options.lang;\n this.recognition.interimResults = true;\n this.recognition.maxAlternatives = 1;\n this.recognition.continuous = true;\n\n this.recognition.start();\n\n // Memoize initial caret positions\n let { from, to } = this.editor.state.selection;\n\n this.recognition.onresult = (event: SpeechRecognitionEvent) => {\n let currentResult = '';\n\n // Add to the currentResult variable the content of the last recognized sentence\n for (let i = event.resultIndex; i < event.results.length; i++) {\n currentResult += event.results[i][0].transcript;\n }\n\n // Is this the final recognition ?\n const isFinal = event.results[event.results.length - 1].isFinal;\n\n // Replace selection by the last recognized sentence (+ style and select, if not final)\n this.editor.commands.deleteRange({ from, to });\n this.editor.commands.insertContentAt(\n from,\n isFinal ? currentResult : `<code>${currentResult}</code>`,\n { updateSelection: !isFinal },\n );\n to = this.editor.state.selection.to;\n\n if (isFinal) {\n // Next content will go after last insertion\n from = to;\n }\n };\n\n this.recognition.onerror = (event: SpeechRecognitionErrorEvent) => {\n // TODO create a \"feedback\" tiptap extension, to display user friendly error messages ?\n console.log(\n `[speechrecognition from @edifice.io/tiptap-extensions][error][${event.error}]: ${event.message}`,\n );\n };\n\n this.recognition.onstart = () => {\n this.isStarted = true;\n };\n\n this.recognition.onend = () => {\n this.isStarted = false;\n };\n\n return commands;\n },\n\n stopSpeechRecognition:\n () =>\n ({ commands }) => {\n this.recognition.stop();\n this.editor.commands.focus();\n return commands;\n },\n\n isSpeechRecognitionStarted: () => () => this.isStarted,\n };\n },\n});\n"],"names":["SR_Node","Node","__publicField","config","SpeechRecognition","commands","from","to","event","currentResult","i","isFinal"],"mappings":"oRAgBA,MAAMA,UAAkCC,EAAAA,IAAW,CACvC,aAAc,CAChB,QAGRC,EAAA,oBACSA,EAAA,iBAAqB,GAH9B,CAKA,OAAO,OAAyBC,EAAc,CACrC,OAAAF,EAAA,KAAK,OAAOE,CAAM,CAC3B,CACF,CAEa,MAAAC,EAAoBJ,EAAQ,OAAiC,CACxE,KAAM,oBAEN,YAAa,CACJ,MAAA,CACL,KAAM,OAAA,CAEV,EAEA,UAAW,CAEL,sBAAuB,QAAU,4BAA6B,QAExD,QAAA,KACN,4HAAA,CAGN,EAEA,aAAc,CACL,MAAA,CACL,uBACE,IACA,CAAC,CAAE,SAAAK,KAAe,CACVD,MAAAA,EACJ,OAAO,mBAAqB,OAAO,wBAChC,KAAA,YAAc,IAAIA,EAElB,KAAA,YAAY,KAAO,KAAK,QAAQ,KACrC,KAAK,YAAY,eAAiB,GAClC,KAAK,YAAY,gBAAkB,EACnC,KAAK,YAAY,WAAa,GAE9B,KAAK,YAAY,QAGjB,GAAI,CAAE,KAAAE,EAAM,GAAAC,CAAO,EAAA,KAAK,OAAO,MAAM,UAEhC,YAAA,Y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