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

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 (62) hide show
  1. package/README.md +1 -1
  2. package/dist/abbr/abbr.cjs +1 -32
  3. package/dist/abbr/abbr.d.ts +12 -12
  4. package/dist/abbr/abbr.js +13 -17
  5. package/dist/alert/alert.cjs +1 -32
  6. package/dist/alert/alert.js +22 -20
  7. package/dist/attachment/attachment.cjs +1 -73
  8. package/dist/attachment/attachment.d.ts +6 -6
  9. package/dist/attachment/attachment.js +29 -40
  10. package/dist/audio/audio.cjs +2 -52
  11. package/dist/audio/audio.d.ts +13 -17
  12. package/dist/audio/audio.js +25 -28
  13. package/dist/font-size/font-size.cjs +1 -48
  14. package/dist/font-size/font-size.d.ts +13 -13
  15. package/dist/font-size/font-size.js +17 -29
  16. package/dist/heading/heading.cjs +1 -61
  17. package/dist/heading/heading.d.ts +12 -10
  18. package/dist/heading/heading.js +25 -39
  19. package/dist/highlight/highlight.cjs +1 -25
  20. package/dist/highlight/highlight.d.ts +1 -4
  21. package/dist/highlight/highlight.js +13 -11
  22. package/dist/hyperlink/hyperlink.cjs +1 -47
  23. package/dist/hyperlink/hyperlink.d.ts +24 -27
  24. package/dist/hyperlink/hyperlink.js +19 -21
  25. package/dist/iframe/iframe.cjs +1 -69
  26. package/dist/iframe/iframe.d.ts +14 -12
  27. package/dist/iframe/iframe.js +32 -48
  28. package/dist/image/custom-image.cjs +1 -162
  29. package/dist/image/custom-image.d.ts +16 -19
  30. package/dist/image/custom-image.js +130 -179
  31. package/dist/index.cjs +1 -43
  32. package/dist/index.js +21 -21
  33. package/dist/line-height/line-height.cjs +1 -33
  34. package/dist/line-height/line-height.js +15 -18
  35. package/dist/linker/linker.cjs +1 -95
  36. package/dist/linker/linker.d.ts +17 -17
  37. package/dist/linker/linker.js +49 -57
  38. package/dist/mathjax/mathjax.cjs +1 -47
  39. package/dist/mathjax/mathjax.js +20 -30
  40. package/dist/paragraph/paragraph.cjs +1 -13
  41. package/dist/paragraph/paragraph.d.ts +1 -4
  42. package/dist/paragraph/paragraph.js +8 -6
  43. package/dist/speech-recognition/speech-recognition.cjs +1 -76
  44. package/dist/speech-recognition/speech-recognition.cjs.map +1 -1
  45. package/dist/speech-recognition/speech-recognition.d.ts +12 -12
  46. package/dist/speech-recognition/speech-recognition.js +41 -57
  47. package/dist/speech-recognition/speech-recognition.js.map +1 -1
  48. package/dist/speech-synthesis/speech-synthesis.cjs +1 -32
  49. package/dist/speech-synthesis/speech-synthesis.d.ts +9 -9
  50. package/dist/speech-synthesis/speech-synthesis.js +10 -19
  51. package/dist/table-cell/table-cell.cjs +1 -27
  52. package/dist/table-cell/table-cell.d.ts +1 -4
  53. package/dist/table-cell/table-cell.js +12 -17
  54. package/dist/transform/html-to-json/html-to-json.cjs +1 -4
  55. package/dist/transform/html-to-json/html-to-json.d.ts +1 -4
  56. package/dist/transform/html-to-json/html-to-json.js +4 -2
  57. package/dist/transform/json-to-html/json-to-html.cjs +1 -4
  58. package/dist/transform/json-to-html/json-to-html.js +4 -2
  59. package/dist/video/video.cjs +2 -111
  60. package/dist/video/video.d.ts +19 -28
  61. package/dist/video/video.js +90 -114
  62. package/package.json +47 -36
@@ -1,77 +1,2 @@
1
- 'use strict';
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
- const core = require('@tiptap/core');
4
- class SR_Node extends core.Node {
5
- constructor() {
6
- super(), (this.isStarted = !1);
7
- }
8
- static create(config) {
9
- return core.Node.create(config);
10
- }
11
- }
12
- const SpeechRecognition = SR_Node.create({
13
- name: 'SpeechRecognition',
14
- addOptions() {
15
- return { lang: 'fr-FR' };
16
- },
17
- onCreate() {
18
- 'SpeechRecognition' in window ||
19
- 'webkitSpeechRecognition' in window ||
20
- console.warn(
21
- '"speechrecognition extension from @edifice.io/tiptap-extensions" requires a browser supporting the SpeechRecognition API".',
22
- );
23
- },
24
- addCommands() {
25
- return {
26
- startSpeechRecognition:
27
- () =>
28
- ({ commands }) => {
29
- const SpeechRecognition2 =
30
- window.SpeechRecognition || window.webkitSpeechRecognition;
31
- (this.recognition = new SpeechRecognition2()),
32
- (this.recognition.lang = this.options.lang),
33
- (this.recognition.interimResults = !0),
34
- (this.recognition.maxAlternatives = 1),
35
- (this.recognition.continuous = !0),
36
- this.recognition.start();
37
- let { from, to } = this.editor.state.selection;
38
- return (
39
- (this.recognition.onresult = (event) => {
40
- let currentResult = '';
41
- for (let i = event.resultIndex; i < event.results.length; i++)
42
- currentResult += event.results[i][0].transcript;
43
- const isFinal = event.results[event.results.length - 1].isFinal;
44
- this.editor.commands.deleteRange({ from, to }),
45
- this.editor.commands.insertContentAt(
46
- from,
47
- isFinal ? currentResult : `<code>${currentResult}</code>`,
48
- { updateSelection: !isFinal },
49
- ),
50
- (to = this.editor.state.selection.to),
51
- isFinal && (from = to);
52
- }),
53
- (this.recognition.onerror = (event) => {
54
- console.log(
55
- `[speechrecognition from @edifice.io/tiptap-extensions][error][${event.error}]: ${event.message}`,
56
- );
57
- }),
58
- (this.recognition.onstart = () => {
59
- this.isStarted = !0;
60
- }),
61
- (this.recognition.onend = () => {
62
- this.isStarted = !1;
63
- }),
64
- commands
65
- );
66
- },
67
- stopSpeechRecognition:
68
- () =>
69
- ({ commands }) => (
70
- this.recognition.stop(), this.editor.commands.focus(), commands
71
- ),
72
- isSpeechRecognitionStarted: () => () => this.isStarted,
73
- };
74
- },
75
- });
76
- exports.SpeechRecognition = SpeechRecognition;
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;
77
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":"mHAgBA,MAAM,gBAAkCA,KAAAA,IAAW,CACvC,aAAc,CAChB,QAIR,KAAS,UAAqB,EAH9B,CAKA,OAAO,OAAyB,OAAc,CACrC,OAAAA,KAAA,KAAK,OAAO,MAAM,CAC3B,CACF,CAEa,MAAA,kBAAoB,QAAQ,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,YAAe,CACVC,MAAAA,mBACJ,OAAO,mBAAqB,OAAO,wBAChC,KAAA,YAAc,IAAIA,mBAElB,KAAA,YAAY,KAAO,KAAK,QAAQ,KACrC,KAAK,YAAY,eAAiB,GAClC,KAAK,YAAY,gBAAkB,EACnC,KAAK,YAAY,WAAa,GAE9B,KAAK,YAAY,QAGjB,GAAI,CAAE,KAAM,EAAO,EAAA,KAAK,OAAO,MAAM,UAEhC,YAAA,YAAY,SAAY,OAAkC,CAC7D,IAAI,cAAgB,GAGpB,QAAS,EAAI,MAAM,YAAa,EAAI,MAAM,QAAQ,OAAQ,IACxD,eAAiB,MAAM,QAAQ,CAAC,EAAE,CAAC,EAAE,WAIvC,MAAM,QAAU,MAAM,QAAQ,MAAM,QAAQ,OAAS,CAAC,EAAE,QAGxD,KAAK,OAAO,SAAS,YAAY,CAAE,KAAM,GAAI,EAC7C,KAAK,OAAO,SAAS,gBACnB,KACA,QAAU,cAAgB,SAAS,aAAa,UAChD,CAAE,gBAAiB,CAAC,OAAQ,CAAA,EAEzB,GAAA,KAAK,OAAO,MAAM,UAAU,GAE7B,UAEK,KAAA,GACT,EAGG,KAAA,YAAY,QAAW,OAAuC,CAEzD,QAAA,IACN,iEAAiE,MAAM,KAAK,MAAM,MAAM,OAAO,EAAA,CACjG,EAGG,KAAA,YAAY,QAAU,IAAM,CAC/B,KAAK,UAAY,EAAA,EAGd,KAAA,YAAY,MAAQ,IAAM,CAC7B,KAAK,UAAY,EAAA,EAGZ,QACT,EAEF,sBACE,IACA,CAAC,CAAE,aACD,KAAK,YAAY,OACZ,KAAA,OAAO,SAAS,QACd,UAGX,2BAA4B,IAAM,IAAM,KAAK,SAAA,CAEjD,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":["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,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,YAAe,CACVC,MAAAA,mBACJ,OAAO,mBAAqB,OAAO,wBAChC,KAAA,YAAc,IAAIA,mBAElB,KAAA,YAAY,KAAO,KAAK,QAAQ,KACrC,KAAK,YAAY,eAAiB,GAClC,KAAK,YAAY,gBAAkB,EACnC,KAAK,YAAY,WAAa,GAE9B,KAAK,YAAY,QAGjB,GAAI,CAAE,KAAM,EAAO,EAAA,KAAK,OAAO,MAAM,UAEhC,YAAA,YAAY,SAAY,OAAkC,CAC7D,IAAI,cAAgB,GAGpB,QAAS,EAAI,MAAM,YAAa,EAAI,MAAM,QAAQ,OAAQ,IACxD,eAAiB,MAAM,QAAQ,CAAC,EAAE,CAAC,EAAE,WAIvC,MAAM,QAAU,MAAM,QAAQ,MAAM,QAAQ,OAAS,CAAC,EAAE,QAGxD,KAAK,OAAO,SAAS,YAAY,CAAE,KAAM,GAAI,EAC7C,KAAK,OAAO,SAAS,gBACnB,KACA,QAAU,cAAgB,SAAS,aAAa,UAChD,CAAE,gBAAiB,CAAC,OAAQ,CAAA,EAEzB,GAAA,KAAK,OAAO,MAAM,UAAU,GAE7B,UAEK,KAAA,GACT,EAGG,KAAA,YAAY,QAAW,OAAuC,CAEzD,QAAA,IACN,iEAAiE,MAAM,KAAK,MAAM,MAAM,OAAO,EAAA,CACjG,EAGG,KAAA,YAAY,QAAU,IAAM,CAC/B,KAAK,UAAY,EAAA,EAGd,KAAA,YAAY,MAAQ,IAAM,CAC7B,KAAK,UAAY,EAAA,EAGZ,QACT,EAEF,sBACE,IACA,CAAC,CAAE,aACD,KAAK,YAAY,OACZ,KAAA,OAAO,SAAS,QACd,UAGX,2BAA4B,IAAM,IAAM,KAAK,SAAA,CAEjD,CACF,CAAC"}
@@ -1,21 +1,21 @@
1
1
  import { Node } from '@tiptap/core';
2
2
  export interface SpeechRecognitionOptions {
3
- lang: string;
3
+ lang: string;
4
4
  }
5
5
  declare module '@tiptap/core' {
6
- interface Commands<ReturnType> {
7
- SpeechRecognition: {
8
- startSpeechRecognition: () => ReturnType;
9
- stopSpeechRecognition: () => ReturnType;
10
- isSpeechRecognitionStarted: () => boolean;
11
- };
12
- }
6
+ interface Commands<ReturnType> {
7
+ SpeechRecognition: {
8
+ startSpeechRecognition: () => ReturnType;
9
+ stopSpeechRecognition: () => ReturnType;
10
+ isSpeechRecognitionStarted: () => boolean;
11
+ };
12
+ }
13
13
  }
14
14
  declare class SR_Node<O = any, S = any> extends Node<O, S> {
15
- protected constructor();
16
- recognition: SpeechRecognition | undefined;
17
- readonly isStarted: boolean;
18
- static create<O = any, S = any>(config?: any): SR_Node<O, S>;
15
+ protected constructor();
16
+ recognition: SpeechRecognition | undefined;
17
+ readonly isStarted: boolean;
18
+ static create<O = any, S = any>(config?: any): SR_Node<O, S>;
19
19
  }
20
20
  export declare const SpeechRecognition: SR_Node<SpeechRecognitionOptions, any>;
21
21
  export {};
@@ -1,77 +1,61 @@
1
- import { Node } from '@tiptap/core';
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
4
+ import { Node } from "@tiptap/core";
2
5
  class SR_Node extends Node {
3
6
  constructor() {
4
- super(), (this.isStarted = !1);
7
+ super();
8
+ __publicField(this, "recognition");
9
+ __publicField(this, "isStarted", !1);
5
10
  }
6
11
  static create(config) {
7
12
  return Node.create(config);
8
13
  }
9
14
  }
10
15
  const SpeechRecognition = SR_Node.create({
11
- name: 'SpeechRecognition',
16
+ name: "SpeechRecognition",
12
17
  addOptions() {
13
18
  return {
14
- lang: 'fr-FR',
19
+ lang: "fr-FR"
15
20
  };
16
21
  },
17
22
  onCreate() {
18
- 'SpeechRecognition' in window ||
19
- 'webkitSpeechRecognition' in window ||
20
- console.warn(
21
- '"speechrecognition extension from @edifice.io/tiptap-extensions" requires a browser supporting the SpeechRecognition API".',
22
- );
23
+ "SpeechRecognition" in window || "webkitSpeechRecognition" in window || console.warn(
24
+ '"speechrecognition extension from @edifice.io/tiptap-extensions" requires a browser supporting the SpeechRecognition API".'
25
+ );
23
26
  },
24
27
  addCommands() {
25
28
  return {
26
- startSpeechRecognition:
27
- () =>
28
- ({ commands }) => {
29
- const SpeechRecognition2 =
30
- window.SpeechRecognition || window.webkitSpeechRecognition;
31
- (this.recognition = new SpeechRecognition2()),
32
- (this.recognition.lang = this.options.lang),
33
- (this.recognition.interimResults = !0),
34
- (this.recognition.maxAlternatives = 1),
35
- (this.recognition.continuous = !0),
36
- this.recognition.start();
37
- let { from, to } = this.editor.state.selection;
38
- return (
39
- (this.recognition.onresult = (event) => {
40
- let currentResult = '';
41
- for (let i = event.resultIndex; i < event.results.length; i++)
42
- currentResult += event.results[i][0].transcript;
43
- const isFinal = event.results[event.results.length - 1].isFinal;
44
- this.editor.commands.deleteRange({ from, to }),
45
- this.editor.commands.insertContentAt(
46
- from,
47
- isFinal ? currentResult : `<code>${currentResult}</code>`,
48
- { updateSelection: !isFinal },
49
- ),
50
- (to = this.editor.state.selection.to),
51
- isFinal && (from = to);
52
- }),
53
- (this.recognition.onerror = (event) => {
54
- console.log(
55
- `[speechrecognition from @edifice.io/tiptap-extensions][error][${event.error}]: ${event.message}`,
56
- );
57
- }),
58
- (this.recognition.onstart = () => {
59
- this.isStarted = !0;
60
- }),
61
- (this.recognition.onend = () => {
62
- this.isStarted = !1;
63
- }),
64
- commands
29
+ startSpeechRecognition: () => ({ commands }) => {
30
+ const SpeechRecognition2 = window.SpeechRecognition || window.webkitSpeechRecognition;
31
+ 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();
32
+ let { from, to } = this.editor.state.selection;
33
+ return this.recognition.onresult = (event) => {
34
+ let currentResult = "";
35
+ for (let i = event.resultIndex; i < event.results.length; i++)
36
+ currentResult += event.results[i][0].transcript;
37
+ const isFinal = event.results[event.results.length - 1].isFinal;
38
+ this.editor.commands.deleteRange({ from, to }), this.editor.commands.insertContentAt(
39
+ from,
40
+ isFinal ? currentResult : `<code>${currentResult}</code>`,
41
+ { updateSelection: !isFinal }
42
+ ), to = this.editor.state.selection.to, isFinal && (from = to);
43
+ }, this.recognition.onerror = (event) => {
44
+ console.log(
45
+ `[speechrecognition from @edifice.io/tiptap-extensions][error][${event.error}]: ${event.message}`
65
46
  );
66
- },
67
- stopSpeechRecognition:
68
- () =>
69
- ({ commands }) => (
70
- this.recognition.stop(), this.editor.commands.focus(), commands
71
- ),
72
- isSpeechRecognitionStarted: () => () => this.isStarted,
47
+ }, this.recognition.onstart = () => {
48
+ this.isStarted = !0;
49
+ }, this.recognition.onend = () => {
50
+ this.isStarted = !1;
51
+ }, commands;
52
+ },
53
+ stopSpeechRecognition: () => ({ commands }) => (this.recognition.stop(), this.editor.commands.focus(), commands),
54
+ isSpeechRecognitionStarted: () => () => this.isStarted
73
55
  };
74
- },
56
+ }
75
57
  });
76
- export { SpeechRecognition };
58
+ export {
59
+ SpeechRecognition
60
+ };
77
61
  //# sourceMappingURL=speech-recognition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"speech-recognition.js","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":["SpeechRecognition"],"mappings":";AAgBA,MAAM,gBAAkC,KAAW;AAAA,EACvC,cAAc;AAChB,aAIR,KAAS,YAAqB;AAAA,EAH9B;AAAA,EAKA,OAAO,OAAyB,QAAc;AACrC,WAAA,KAAK,OAAO,MAAM;AAAA,EAC3B;AACF;AAEa,MAAA,oBAAoB,QAAQ,OAAiC;AAAA,EACxE,MAAM;AAAA,EAEN,aAAa;AACJ,WAAA;AAAA,MACL,MAAM;AAAA,IAAA;AAAA,EAEV;AAAA,EAEA,WAAW;AACT,IACI,uBAAuB,UAAU,6BAA6B,UAExD,QAAA;AAAA,MACN;AAAA,IAAA;AAAA,EAGN;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,wBACE,MACA,CAAC,EAAE,eAAe;AACVA,cAAAA,qBACJ,OAAO,qBAAqB,OAAO;AAChC,aAAA,cAAc,IAAIA,sBAElB,KAAA,YAAY,OAAO,KAAK,QAAQ,MACrC,KAAK,YAAY,iBAAiB,IAClC,KAAK,YAAY,kBAAkB,GACnC,KAAK,YAAY,aAAa,IAE9B,KAAK,YAAY;AAGjB,YAAI,EAAE,MAAM,GAAO,IAAA,KAAK,OAAO,MAAM;AAEhC,oBAAA,YAAY,WAAW,CAAC,UAAkC;AAC7D,cAAI,gBAAgB;AAGpB,mBAAS,IAAI,MAAM,aAAa,IAAI,MAAM,QAAQ,QAAQ;AACxD,6BAAiB,MAAM,QAAQ,CAAC,EAAE,CAAC,EAAE;AAIvC,gBAAM,UAAU,MAAM,QAAQ,MAAM,QAAQ,SAAS,CAAC,EAAE;AAGxD,eAAK,OAAO,SAAS,YAAY,EAAE,MAAM,IAAI,GAC7C,KAAK,OAAO,SAAS;AAAA,YACnB;AAAA,YACA,UAAU,gBAAgB,SAAS,aAAa;AAAA,YAChD,EAAE,iBAAiB,CAAC,QAAQ;AAAA,UAAA,GAEzB,KAAA,KAAK,OAAO,MAAM,UAAU,IAE7B,YAEK,OAAA;AAAA,QACT,GAGG,KAAA,YAAY,UAAU,CAAC,UAAuC;AAEzD,kBAAA;AAAA,YACN,iEAAiE,MAAM,KAAK,MAAM,MAAM,OAAO;AAAA,UAAA;AAAA,QACjG,GAGG,KAAA,YAAY,UAAU,MAAM;AAC/B,eAAK,YAAY;AAAA,QAAA,GAGd,KAAA,YAAY,QAAQ,MAAM;AAC7B,eAAK,YAAY;AAAA,QAAA,GAGZ;AAAA,MACT;AAAA,MAEF,uBACE,MACA,CAAC,EAAE,gBACD,KAAK,YAAY,QACZ,KAAA,OAAO,SAAS,SACd;AAAA,MAGX,4BAA4B,MAAM,MAAM,KAAK;AAAA,IAAA;AAAA,EAEjD;AACF,CAAC;"}
1
+ {"version":3,"file":"speech-recognition.js","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":["SpeechRecognition"],"mappings":";;;;AAgBA,MAAM,gBAAkC,KAAW;AAAA,EACvC,cAAc;AAChB;AAGR;AACS,qCAAqB;AAAA,EAH9B;AAAA,EAKA,OAAO,OAAyB,QAAc;AACrC,WAAA,KAAK,OAAO,MAAM;AAAA,EAC3B;AACF;AAEa,MAAA,oBAAoB,QAAQ,OAAiC;AAAA,EACxE,MAAM;AAAA,EAEN,aAAa;AACJ,WAAA;AAAA,MACL,MAAM;AAAA,IAAA;AAAA,EAEV;AAAA,EAEA,WAAW;AACT,IACI,uBAAuB,UAAU,6BAA6B,UAExD,QAAA;AAAA,MACN;AAAA,IAAA;AAAA,EAGN;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,wBACE,MACA,CAAC,EAAE,eAAe;AACVA,cAAAA,qBACJ,OAAO,qBAAqB,OAAO;AAChC,aAAA,cAAc,IAAIA,sBAElB,KAAA,YAAY,OAAO,KAAK,QAAQ,MACrC,KAAK,YAAY,iBAAiB,IAClC,KAAK,YAAY,kBAAkB,GACnC,KAAK,YAAY,aAAa,IAE9B,KAAK,YAAY;AAGjB,YAAI,EAAE,MAAM,GAAO,IAAA,KAAK,OAAO,MAAM;AAEhC,oBAAA,YAAY,WAAW,CAAC,UAAkC;AAC7D,cAAI,gBAAgB;AAGpB,mBAAS,IAAI,MAAM,aAAa,IAAI,MAAM,QAAQ,QAAQ;AACxD,6BAAiB,MAAM,QAAQ,CAAC,EAAE,CAAC,EAAE;AAIvC,gBAAM,UAAU,MAAM,QAAQ,MAAM,QAAQ,SAAS,CAAC,EAAE;AAGxD,eAAK,OAAO,SAAS,YAAY,EAAE,MAAM,IAAI,GAC7C,KAAK,OAAO,SAAS;AAAA,YACnB;AAAA,YACA,UAAU,gBAAgB,SAAS,aAAa;AAAA,YAChD,EAAE,iBAAiB,CAAC,QAAQ;AAAA,UAAA,GAEzB,KAAA,KAAK,OAAO,MAAM,UAAU,IAE7B,YAEK,OAAA;AAAA,QACT,GAGG,KAAA,YAAY,UAAU,CAAC,UAAuC;AAEzD,kBAAA;AAAA,YACN,iEAAiE,MAAM,KAAK,MAAM,MAAM,OAAO;AAAA,UAAA;AAAA,QACjG,GAGG,KAAA,YAAY,UAAU,MAAM;AAC/B,eAAK,YAAY;AAAA,QAAA,GAGd,KAAA,YAAY,QAAQ,MAAM;AAC7B,eAAK,YAAY;AAAA,QAAA,GAGZ;AAAA,MACT;AAAA,MAEF,uBACE,MACA,CAAC,EAAE,gBACD,KAAK,YAAY,QACZ,KAAA,OAAO,SAAS,SACd;AAAA,MAGX,4BAA4B,MAAM,MAAM,KAAK;AAAA,IAAA;AAAA,EAEjD;AACF,CAAC;"}
@@ -1,33 +1,2 @@
1
- 'use strict';
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
- const core = require('@tiptap/core');
4
- class SS_Node extends core.Node {
5
- static create(config) {
6
- return core.Node.create(config);
7
- }
8
- }
9
- const SpeechSynthesis = SS_Node.create({
10
- name: 'speechSynthesis',
11
- addOptions() {
12
- return { lang: 'fr-FR', pitch: 1 };
13
- },
14
- addCommands() {
15
- return {
16
- startSpeechSynthesis:
17
- () =>
18
- ({ commands }) => (
19
- (this.speechSynthesis = new SpeechSynthesisUtterance()),
20
- (this.speechSynthesis.lang = this.options.lang),
21
- (this.speechSynthesis.pitch = this.options.pitch),
22
- (this.speechSynthesis.text = this.editor.getText()),
23
- window.speechSynthesis.speak(this.speechSynthesis),
24
- commands
25
- ),
26
- stopSpeechSynthesis:
27
- () =>
28
- ({ commands }) => (window.speechSynthesis.cancel(), commands),
29
- };
30
- },
31
- });
32
- exports.SpeechSynthesis = SpeechSynthesis;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core");class SS_Node extends core.Node{static create(config){return core.Node.create(config)}}const SpeechSynthesis=SS_Node.create({name:"speechSynthesis",addOptions(){return{lang:"fr-FR",pitch:1}},addCommands(){return{startSpeechSynthesis:()=>({commands})=>(this.speechSynthesis=new SpeechSynthesisUtterance,this.speechSynthesis.lang=this.options.lang,this.speechSynthesis.pitch=this.options.pitch,this.speechSynthesis.text=this.editor.getText(),window.speechSynthesis.speak(this.speechSynthesis),commands),stopSpeechSynthesis:()=>({commands})=>(window.speechSynthesis.cancel(),commands)}}});exports.SpeechSynthesis=SpeechSynthesis;
33
2
  //# sourceMappingURL=speech-synthesis.cjs.map
@@ -1,18 +1,18 @@
1
1
  import { Node } from '@tiptap/core';
2
2
  export interface SpeechSynthesisOptions {
3
- lang: string;
4
- pitch: number;
3
+ lang: string;
4
+ pitch: number;
5
5
  }
6
6
  declare module '@tiptap/core' {
7
- interface Commands<ReturnType> {
8
- speechSynthesis: {
9
- startSpeechSynthesis: () => ReturnType;
10
- stopSpeechSynthesis: () => ReturnType;
11
- };
12
- }
7
+ interface Commands<ReturnType> {
8
+ speechSynthesis: {
9
+ startSpeechSynthesis: () => ReturnType;
10
+ stopSpeechSynthesis: () => ReturnType;
11
+ };
12
+ }
13
13
  }
14
14
  declare class SS_Node<O = any, S = any> extends Node<O, S> {
15
- static create<O = any, S = any>(config?: any): SS_Node<O, S>;
15
+ static create<O = any, S = any>(config?: any): SS_Node<O, S>;
16
16
  }
17
17
  export declare const SpeechSynthesis: SS_Node<SpeechSynthesisOptions, any>;
18
18
  export {};
@@ -1,34 +1,25 @@
1
- import { Node } from '@tiptap/core';
1
+ import { Node } from "@tiptap/core";
2
2
  class SS_Node extends Node {
3
3
  static create(config) {
4
4
  return Node.create(config);
5
5
  }
6
6
  }
7
7
  const SpeechSynthesis = SS_Node.create({
8
- name: 'speechSynthesis',
8
+ name: "speechSynthesis",
9
9
  addOptions() {
10
10
  return {
11
- lang: 'fr-FR',
12
- pitch: 1,
11
+ lang: "fr-FR",
12
+ pitch: 1
13
13
  };
14
14
  },
15
15
  addCommands() {
16
16
  return {
17
- startSpeechSynthesis:
18
- () =>
19
- ({ commands }) => (
20
- (this.speechSynthesis = new SpeechSynthesisUtterance()),
21
- (this.speechSynthesis.lang = this.options.lang),
22
- (this.speechSynthesis.pitch = this.options.pitch),
23
- (this.speechSynthesis.text = this.editor.getText()),
24
- window.speechSynthesis.speak(this.speechSynthesis),
25
- commands
26
- ),
27
- stopSpeechSynthesis:
28
- () =>
29
- ({ commands }) => (window.speechSynthesis.cancel(), commands),
17
+ startSpeechSynthesis: () => ({ commands }) => (this.speechSynthesis = new SpeechSynthesisUtterance(), this.speechSynthesis.lang = this.options.lang, this.speechSynthesis.pitch = this.options.pitch, this.speechSynthesis.text = this.editor.getText(), window.speechSynthesis.speak(this.speechSynthesis), commands),
18
+ stopSpeechSynthesis: () => ({ commands }) => (window.speechSynthesis.cancel(), commands)
30
19
  };
31
- },
20
+ }
32
21
  });
33
- export { SpeechSynthesis };
22
+ export {
23
+ SpeechSynthesis
24
+ };
34
25
  //# sourceMappingURL=speech-synthesis.js.map
@@ -1,28 +1,2 @@
1
- 'use strict';
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
- const extensionTableCell = require('@tiptap/extension-table-cell'),
4
- TableCell = extensionTableCell.TableCell.extend({
5
- addAttributes() {
6
- var _a;
7
- return {
8
- ...((_a = this.parent) == null ? void 0 : _a.call(this)),
9
- backgroundColor: {
10
- default: null,
11
- renderHTML: (attributes) =>
12
- attributes.backgroundColor
13
- ? { style: `background-color: ${attributes.backgroundColor}` }
14
- : {},
15
- parseHTML: (element) => {
16
- var _a2, _b;
17
- return (_b =
18
- (_a2 = element.style) == null ? void 0 : _a2.backgroundColor) ==
19
- null
20
- ? void 0
21
- : _b.replace(/['"]+/g, '');
22
- },
23
- },
24
- };
25
- },
26
- });
27
- exports.TableCell = TableCell;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const extensionTableCell=require("@tiptap/extension-table-cell"),TableCell=extensionTableCell.TableCell.extend({addAttributes(){var _a;return{...(_a=this.parent)==null?void 0:_a.call(this),backgroundColor:{default:null,renderHTML:attributes=>attributes.backgroundColor?{style:`background-color: ${attributes.backgroundColor}`}:{},parseHTML:element=>{var _a2,_b;return(_b=(_a2=element.style)==null?void 0:_a2.backgroundColor)==null?void 0:_b.replace(/['"]+/g,"")}}}}});exports.TableCell=TableCell;
28
2
  //# sourceMappingURL=table-cell.cjs.map
@@ -2,7 +2,4 @@
2
2
  * This custom extension allows setting a background-color to table cells.
3
3
  * Apply with ̀`editor.chain().focus().setCellAttribute("backgroundColor", color).run()`
4
4
  */
5
- export declare const TableCell: import('@tiptap/core').Node<
6
- import('@tiptap/extension-table-cell').TableCellOptions,
7
- any
8
- >;
5
+ export declare const TableCell: import('@tiptap/core').Node<import('@tiptap/extension-table-cell').TableCellOptions, any>;
@@ -1,28 +1,23 @@
1
- import { TableCell as TableCell$1 } from '@tiptap/extension-table-cell';
1
+ import { TableCell as TableCell$1 } from "@tiptap/extension-table-cell";
2
2
  const TableCell = TableCell$1.extend({
3
3
  addAttributes() {
4
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
  backgroundColor: {
8
8
  default: null,
9
- renderHTML: (attributes) =>
10
- attributes.backgroundColor
11
- ? {
12
- style: `background-color: ${attributes.backgroundColor}`,
13
- }
14
- : {},
9
+ renderHTML: (attributes) => attributes.backgroundColor ? {
10
+ style: `background-color: ${attributes.backgroundColor}`
11
+ } : {},
15
12
  parseHTML: (element) => {
16
13
  var _a2, _b;
17
- return (_b =
18
- (_a2 = element.style) == null ? void 0 : _a2.backgroundColor) ==
19
- null
20
- ? void 0
21
- : _b.replace(/['"]+/g, '');
22
- },
23
- },
14
+ return (_b = (_a2 = element.style) == null ? void 0 : _a2.backgroundColor) == null ? void 0 : _b.replace(/['"]+/g, "");
15
+ }
16
+ }
24
17
  };
25
- },
18
+ }
26
19
  });
27
- export { TableCell };
20
+ export {
21
+ TableCell
22
+ };
28
23
  //# sourceMappingURL=table-cell.js.map
@@ -1,5 +1,2 @@
1
- 'use strict';
2
- const core = require('@tiptap/core'),
3
- htmlToJson = (html, extensions) => core.generateJSON(html, extensions);
4
- module.exports = htmlToJson;
1
+ "use strict";const core=require("@tiptap/core"),htmlToJson=(html,extensions)=>core.generateJSON(html,extensions);module.exports=htmlToJson;
5
2
  //# sourceMappingURL=html-to-json.cjs.map
@@ -1,6 +1,3 @@
1
1
  import { Extensions, HTMLContent } from '@tiptap/core';
2
- declare const _default: (
3
- html: HTMLContent,
4
- extensions: Extensions,
5
- ) => Record<string, any>;
2
+ declare const _default: (html: HTMLContent, extensions: Extensions) => Record<string, any>;
6
3
  export default _default;
@@ -1,4 +1,6 @@
1
- import { generateJSON } from '@tiptap/core';
1
+ import { generateJSON } from "@tiptap/core";
2
2
  const htmlToJson = (html, extensions) => generateJSON(html, extensions);
3
- export { htmlToJson as default };
3
+ export {
4
+ htmlToJson as default
5
+ };
4
6
  //# sourceMappingURL=html-to-json.js.map
@@ -1,5 +1,2 @@
1
- 'use strict';
2
- const core = require('@tiptap/core'),
3
- jsonToHtml = (json, extensions) => core.generateHTML(json, extensions);
4
- module.exports = jsonToHtml;
1
+ "use strict";const core=require("@tiptap/core"),jsonToHtml=(json,extensions)=>core.generateHTML(json,extensions);module.exports=jsonToHtml;
5
2
  //# sourceMappingURL=json-to-html.cjs.map
@@ -1,4 +1,6 @@
1
- import { generateHTML } from '@tiptap/core';
1
+ import { generateHTML } from "@tiptap/core";
2
2
  const jsonToHtml = (json, extensions) => generateHTML(json, extensions);
3
- export { jsonToHtml as default };
3
+ export {
4
+ jsonToHtml as default
5
+ };
4
6
  //# sourceMappingURL=json-to-html.js.map