@edifice.io/tiptap-extensions 2.4.2-develop-pedago.20251126113601 → 2.4.2-develop-pedago.20251126123720

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),index=require("./transformers/index.cjs"),Iframe=core.Node.create({name:"iframe",group:"block",atom:!0,draggable:!0,addOptions(){return{allowFullscreen:!0,HTMLAttributes:{class:"iframe-wrapper"}}},addAttributes(){return{src:{default:null},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},width:{default:"600",parseHTML:element=>{const width=element.getAttribute("width"),height=element.getAttribute("height");if(!width)return"600";const widthValue=parseInt(width),maxWidth=600;if(widthValue>maxWidth&&height){const ratio=parseInt(height)/widthValue;element.dataset.aspectRatio=ratio.toString()}return Math.min(widthValue,maxWidth).toString()},renderHTML:attributes=>{if(!attributes.width)return{};const widthValue=parseInt(attributes.width);return{width:Math.min(widthValue,600)}}},height:{parseHTML:element=>{const height=element.getAttribute("height"),width=element.getAttribute("width");if(!height)return null;const heightValue=parseInt(height),widthValue=parseInt(width||"600"),maxWidth=600;if(widthValue>maxWidth){const ratio=heightValue/widthValue;return Math.round(maxWidth*ratio).toString()}return height},renderHTML:attributes=>attributes.height?{height:parseInt(attributes.height)}:{}},style:{renderHTML:attributes=>attributes.style?{style:attributes.style}:{},parseHTML:element=>element.getAttribute("style")}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes}){return index.iframeTransformer.onRenderHTML({HTMLAttributes}),["div",this.options.HTMLAttributes,["iframe",HTMLAttributes]]},addCommands(){return{setIframe:options=>({tr,dispatch})=>{const{selection}=tr,node=this.type.create(options);return dispatch&&tr.replaceRangeWith(selection.from,selection.to,node),!0}}}});exports.Iframe=Iframe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),index=require("./transformers/index.cjs"),Iframe=core.Node.create({name:"iframe",group:"block",atom:!0,draggable:!0,addOptions(){return{allowFullscreen:!0,HTMLAttributes:{class:"iframe-wrapper"}}},addAttributes(){return{src:{default:null},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},width:{renderHTML:attributes=>attributes.width?{width:attributes.width==="100%"?"100%":parseInt(attributes.width)}:{},parseHTML:element=>element.getAttribute("width")},height:{renderHTML:attributes=>attributes.height?{height:parseInt(attributes.height)}:{},parseHTML:element=>element.getAttribute("height")},style:{renderHTML:attributes=>attributes.style?{style:attributes.style}:{},parseHTML:element=>element.getAttribute("style")}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes}){return index.iframeTransformer.onRenderHTML({HTMLAttributes}),["div",this.options.HTMLAttributes,["iframe",HTMLAttributes]]},addCommands(){return{setIframe:options=>({tr,dispatch})=>{const{selection}=tr,node=this.type.create(options);return dispatch&&tr.replaceRangeWith(selection.from,selection.to,node),!0}}}});exports.Iframe=Iframe;
2
2
  //# sourceMappingURL=iframe.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"iframe.cjs","sources":["../../src/iframe/iframe.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\nimport { iframeTransformer } from './transformers';\n\nexport interface IframeOptions {\n allowFullscreen: boolean;\n HTMLAttributes: {\n [key: string]: any;\n };\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n iframe: {\n /**\n * Add an iframe\n */\n setIframe: (options: { src: string }) => ReturnType;\n };\n }\n}\n\nexport const Iframe = Node.create<IframeOptions>({\n name: 'iframe',\n group: 'block',\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n allowFullscreen: true,\n HTMLAttributes: {\n class: 'iframe-wrapper',\n },\n };\n },\n\n addAttributes() {\n return {\n src: {\n default: null,\n },\n frameborder: {\n default: 0,\n },\n allowfullscreen: {\n default: this.options.allowFullscreen,\n parseHTML: () => this.options.allowFullscreen,\n },\n width: {\n default: '600',\n parseHTML: (element) => {\n const width = element.getAttribute('width');\n const height = element.getAttribute('height');\n if (!width) return '600';\n \n const widthValue = parseInt(width);\n const maxWidth = 600;\n \n // Si la largeur dépasse le max, on la limite et on stocke le ratio\n if (widthValue > maxWidth && height) {\n const heightValue = parseInt(height);\n const ratio = heightValue / widthValue;\n // Stocker le ratio dans un attribut custom pour calculer la hauteur\n element.dataset.aspectRatio = ratio.toString();\n }\n \n return Math.min(widthValue, maxWidth).toString();\n },\n renderHTML: (attributes) => {\n if (!attributes.width) return {};\n \n const widthValue = parseInt(attributes.width);\n const maxWidth = 600;\n return {\n width: Math.min(widthValue, maxWidth),\n };\n },\n },\n height: {\n parseHTML: (element) => {\n const height = element.getAttribute('height');\n const width = element.getAttribute('width');\n \n if (!height) return null;\n \n const heightValue = parseInt(height);\n const widthValue = parseInt(width || '600');\n const maxWidth = 600;\n \n if (widthValue > maxWidth) {\n const ratio = heightValue / widthValue;\n return Math.round(maxWidth * ratio).toString();\n }\n \n return height;\n },\n renderHTML: (attributes) => {\n return attributes.height\n ? {\n height: parseInt(attributes.height),\n }\n : {};\n },\n },\n style: {\n renderHTML: (attributes) => {\n return attributes.style\n ? {\n style: attributes.style,\n }\n : {};\n },\n parseHTML: (element) => element.getAttribute('style'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'iframe',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n // Call the onRenderHTML method from the iframeTransformer before rendering the iframe\n iframeTransformer.onRenderHTML({ HTMLAttributes });\n return ['div', this.options.HTMLAttributes, ['iframe', HTMLAttributes]];\n },\n\n addCommands() {\n return {\n setIframe:\n (options: { src: string }) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\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":["Node","iframeTransformer"],"mappings":"6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EAEpC,CAAA,CACN,EAEF,MAAO,CACL,WAAa,YACJ,WAAW,MACd,CACE,MAAO,WAAW,KAAA,EAEpB,CAAA,EAEN,UAAY,SAAY,QAAQ,aAAa,OAAO,CAAA,CACtD,CAEJ,EAEA,WAAY,CACV,MAAO,CACL,CACE,IAAK,QAAA,CACP,CAEJ,EAEA,WAAW,CAAE,gBAAkB,CAE7BC,+BAAkB,aAAa,CAAE,eAAgB,EAC1C,CAAC,MAAO,KAAK,QAAQ,eAAgB,CAAC,SAAU,cAAc,CAAC,CACxE,EAEA,aAAc,CACZ,MAAO,CACL,UACG,SACD,CAAC,CAAE,GAAI,YAAe,CACpB,KAAM,CAAE,WAAc,GAChB,KAAO,KAAK,KAAK,OAAO,OAAO,EAErC,OAAI,UACF,GAAG,iBAAiB,UAAU,KAAM,UAAU,GAAI,IAAI,EAGjD,EACT,CAAA,CAEN,CACF,CAAC"}
1
+ {"version":3,"file":"iframe.cjs","sources":["../../src/iframe/iframe.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\nimport { iframeTransformer } from './transformers';\n\nexport interface IframeOptions {\n allowFullscreen: boolean;\n HTMLAttributes: {\n [key: string]: any;\n };\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n iframe: {\n /**\n * Add an iframe\n */\n setIframe: (options: { src: string }) => ReturnType;\n };\n }\n}\n\nexport const Iframe = Node.create<IframeOptions>({\n name: 'iframe',\n group: 'block',\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n allowFullscreen: true,\n HTMLAttributes: {\n class: 'iframe-wrapper',\n },\n };\n },\n\n addAttributes() {\n return {\n src: {\n default: null,\n },\n frameborder: {\n default: 0,\n },\n allowfullscreen: {\n default: this.options.allowFullscreen,\n parseHTML: () => this.options.allowFullscreen,\n },\n width: {\n renderHTML: (attributes) => {\n return attributes.width\n ? {\n width:\n attributes.width === '100%'\n ? '100%'\n : parseInt(attributes.width),\n }\n : {};\n },\n parseHTML: (element) => element.getAttribute('width'),\n },\n height: {\n renderHTML: (attributes) => {\n return attributes.height\n ? {\n height: parseInt(attributes.height),\n }\n : {};\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) => element.getAttribute('style'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'iframe',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n // Call the onRenderHTML method from the iframeTransformer before rendering the iframe\n iframeTransformer.onRenderHTML({ HTMLAttributes });\n return ['div', this.options.HTMLAttributes, ['iframe', HTMLAttributes]];\n },\n\n addCommands() {\n return {\n setIframe:\n (options: { src: string }) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\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":["Node","iframeTransformer"],"mappings":"6JAqBa,OAASA,KAAAA,KAAK,OAAsB,CAC/C,KAAM,SACN,MAAO,QACP,KAAM,GACN,UAAW,GAEX,YAAa,CACX,MAAO,CACL,gBAAiB,GACjB,eAAgB,CACd,MAAO,gBAAA,CACT,CAEJ,EAEA,eAAgB,CACd,MAAO,CACL,IAAK,CACH,QAAS,IAAA,EAEX,YAAa,CACX,QAAS,CAAA,EAEX,gBAAiB,CACf,QAAS,KAAK,QAAQ,gBACtB,UAAW,IAAM,KAAK,QAAQ,eAAA,EAEhC,MAAO,CACL,WAAa,YACJ,WAAW,MACd,CACE,MACE,WAAW,QAAU,OACjB,OACA,SAAS,WAAW,KAAK,CAAA,EAEjC,CAAA,EAEN,UAAY,SAAY,QAAQ,aAAa,OAAO,CAAA,EAEtD,OAAQ,CACN,WAAa,YACJ,WAAW,OACd,CACE,OAAQ,SAAS,WAAW,MAAM,CAAA,EAEpC,CAAA,EAEN,UAAY,SAAY,QAAQ,aAAa,QAAQ,CAAA,EAEvD,MAAO,CACL,WAAa,YACJ,WAAW,MACd,CACE,MAAO,WAAW,KAAA,EAEpB,CAAA,EAEN,UAAY,SAAY,QAAQ,aAAa,OAAO,CAAA,CACtD,CAEJ,EAEA,WAAY,CACV,MAAO,CACL,CACE,IAAK,QAAA,CACP,CAEJ,EAEA,WAAW,CAAE,gBAAkB,CAE7BC,+BAAkB,aAAa,CAAE,eAAgB,EAC1C,CAAC,MAAO,KAAK,QAAQ,eAAgB,CAAC,SAAU,cAAc,CAAC,CACxE,EAEA,aAAc,CACZ,MAAO,CACL,UACG,SACD,CAAC,CAAE,GAAI,YAAe,CACpB,KAAM,CAAE,WAAc,GAChB,KAAO,KAAK,KAAK,OAAO,OAAO,EAErC,OAAI,UACF,GAAG,iBAAiB,UAAU,KAAM,UAAU,GAAI,IAAI,EAGjD,EACT,CAAA,CAEN,CACF,CAAC"}
@@ -26,39 +26,16 @@ const Iframe = Node.create({
26
26
  parseHTML: () => this.options.allowFullscreen
27
27
  },
28
28
  width: {
29
- default: "600",
30
- parseHTML: (element) => {
31
- const width = element.getAttribute("width"), height = element.getAttribute("height");
32
- if (!width) return "600";
33
- const widthValue = parseInt(width), maxWidth = 600;
34
- if (widthValue > maxWidth && height) {
35
- const ratio = parseInt(height) / widthValue;
36
- element.dataset.aspectRatio = ratio.toString();
37
- }
38
- return Math.min(widthValue, maxWidth).toString();
39
- },
40
- renderHTML: (attributes) => {
41
- if (!attributes.width) return {};
42
- const widthValue = parseInt(attributes.width);
43
- return {
44
- width: Math.min(widthValue, 600)
45
- };
46
- }
29
+ renderHTML: (attributes) => attributes.width ? {
30
+ width: attributes.width === "100%" ? "100%" : parseInt(attributes.width)
31
+ } : {},
32
+ parseHTML: (element) => element.getAttribute("width")
47
33
  },
48
34
  height: {
49
- parseHTML: (element) => {
50
- const height = element.getAttribute("height"), width = element.getAttribute("width");
51
- if (!height) return null;
52
- const heightValue = parseInt(height), widthValue = parseInt(width || "600"), maxWidth = 600;
53
- if (widthValue > maxWidth) {
54
- const ratio = heightValue / widthValue;
55
- return Math.round(maxWidth * ratio).toString();
56
- }
57
- return height;
58
- },
59
35
  renderHTML: (attributes) => attributes.height ? {
60
36
  height: parseInt(attributes.height)
61
- } : {}
37
+ } : {},
38
+ parseHTML: (element) => element.getAttribute("height")
62
39
  },
63
40
  style: {
64
41
  renderHTML: (attributes) => attributes.style ? {
@@ -1 +1 @@
1
- {"version":3,"file":"iframe.js","sources":["../../src/iframe/iframe.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\nimport { iframeTransformer } from './transformers';\n\nexport interface IframeOptions {\n allowFullscreen: boolean;\n HTMLAttributes: {\n [key: string]: any;\n };\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n iframe: {\n /**\n * Add an iframe\n */\n setIframe: (options: { src: string }) => ReturnType;\n };\n }\n}\n\nexport const Iframe = Node.create<IframeOptions>({\n name: 'iframe',\n group: 'block',\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n allowFullscreen: true,\n HTMLAttributes: {\n class: 'iframe-wrapper',\n },\n };\n },\n\n addAttributes() {\n return {\n src: {\n default: null,\n },\n frameborder: {\n default: 0,\n },\n allowfullscreen: {\n default: this.options.allowFullscreen,\n parseHTML: () => this.options.allowFullscreen,\n },\n width: {\n default: '600',\n parseHTML: (element) => {\n const width = element.getAttribute('width');\n const height = element.getAttribute('height');\n if (!width) return '600';\n \n const widthValue = parseInt(width);\n const maxWidth = 600;\n \n // Si la largeur dépasse le max, on la limite et on stocke le ratio\n if (widthValue > maxWidth && height) {\n const heightValue = parseInt(height);\n const ratio = heightValue / widthValue;\n // Stocker le ratio dans un attribut custom pour calculer la hauteur\n element.dataset.aspectRatio = ratio.toString();\n }\n \n return Math.min(widthValue, maxWidth).toString();\n },\n renderHTML: (attributes) => {\n if (!attributes.width) return {};\n \n const widthValue = parseInt(attributes.width);\n const maxWidth = 600;\n return {\n width: Math.min(widthValue, maxWidth),\n };\n },\n },\n height: {\n parseHTML: (element) => {\n const height = element.getAttribute('height');\n const width = element.getAttribute('width');\n \n if (!height) return null;\n \n const heightValue = parseInt(height);\n const widthValue = parseInt(width || '600');\n const maxWidth = 600;\n \n if (widthValue > maxWidth) {\n const ratio = heightValue / widthValue;\n return Math.round(maxWidth * ratio).toString();\n }\n \n return height;\n },\n renderHTML: (attributes) => {\n return attributes.height\n ? {\n height: parseInt(attributes.height),\n }\n : {};\n },\n },\n style: {\n renderHTML: (attributes) => {\n return attributes.style\n ? {\n style: attributes.style,\n }\n : {};\n },\n parseHTML: (element) => element.getAttribute('style'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'iframe',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n // Call the onRenderHTML method from the iframeTransformer before rendering the iframe\n iframeTransformer.onRenderHTML({ HTMLAttributes });\n return ['div', this.options.HTMLAttributes, ['iframe', HTMLAttributes]];\n },\n\n addCommands() {\n return {\n setIframe:\n (options: { src: string }) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\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":";;AAqBO,MAAM,SAAS,KAAK,OAAsB;AAAA,EAC/C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,aAAa;AACX,WAAO;AAAA,MACL,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,QACd,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,EAEJ;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,MACL,KAAK;AAAA,QACH,SAAS;AAAA,MAAA;AAAA,MAEX,aAAa;AAAA,QACX,SAAS;AAAA,MAAA;AAAA,MAEX,iBAAiB;AAAA,QACf,SAAS,KAAK,QAAQ;AAAA,QACtB,WAAW,MAAM,KAAK,QAAQ;AAAA,MAAA;AAAA,MAEhC,OAAO;AAAA,QACL,SAAS;AAAA,QACT,WAAW,CAAC,YAAY;AACtB,gBAAM,QAAQ,Q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QACE,KAAK;AAAA,MAAA;AAAA,IACP;AAAA,EAEJ;AAAA,EAEA,WAAW,EAAE,kBAAkB;AAE7B,6BAAkB,aAAa,EAAE,gBAAgB,GAC1C,CAAC,OAAO,KAAK,QAAQ,gBAAgB,CAAC,UAAU,cAAc,CAAC;AAAA,EACxE;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,WACE,CAAC,YACD,CAAC,EAAE,IAAI,eAAe;AACpB,cAAM,EAAE,cAAc,IAChB,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":"iframe.js","sources":["../../src/iframe/iframe.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\nimport { iframeTransformer } from './transformers';\n\nexport interface IframeOptions {\n allowFullscreen: boolean;\n HTMLAttributes: {\n [key: string]: any;\n };\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n iframe: {\n /**\n * Add an iframe\n */\n setIframe: (options: { src: string }) => ReturnType;\n };\n }\n}\n\nexport const Iframe = Node.create<IframeOptions>({\n name: 'iframe',\n group: 'block',\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n allowFullscreen: true,\n HTMLAttributes: {\n class: 'iframe-wrapper',\n },\n };\n },\n\n addAttributes() {\n return {\n src: {\n default: null,\n },\n frameborder: {\n default: 0,\n },\n allowfullscreen: {\n default: this.options.allowFullscreen,\n parseHTML: () => this.options.allowFullscreen,\n },\n width: {\n renderHTML: (attributes) => {\n return attributes.width\n ? {\n width:\n attributes.width === '100%'\n ? '100%'\n : parseInt(attributes.width),\n }\n : {};\n },\n parseHTML: (element) => element.getAttribute('width'),\n },\n height: {\n renderHTML: (attributes) => {\n return attributes.height\n ? {\n height: parseInt(attributes.height),\n }\n : {};\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) => element.getAttribute('style'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'iframe',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n // Call the onRenderHTML method from the iframeTransformer before rendering the iframe\n iframeTransformer.onRenderHTML({ HTMLAttributes });\n return ['div', this.options.HTMLAttributes, ['iframe', HTMLAttributes]];\n },\n\n addCommands() {\n return {\n setIframe:\n (options: { src: string }) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\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":";;AAqBO,MAAM,SAAS,KAAK,OAAsB;AAAA,EAC/C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,aAAa;AACX,WAAO;AAAA,MACL,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,QACd,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,EAEJ;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,MACL,KAAK;AAAA,QACH,SAAS;AAAA,MAAA;AAAA,MAEX,aAAa;AAAA,QACX,SAAS;AAAA,MAAA;AAAA,MAEX,iBAAiB;AAAA,QACf,SAAS,KAAK,QAAQ;AAAA,QACtB,WAAW,MAAM,KAAK,QAAQ;AAAA,MAAA;AAAA,MAEhC,OAAO;AAAA,QACL,YAAY,CAAC,eACJ,WAAW,QACd;AAAA,UACE,OACE,WAAW,UAAU,SACjB,SACA,SAAS,WAAW,KAAK;AAAA,QAAA,IAEjC,CAAA;AAAA,QAEN,WAAW,CAAC,YAAY,QAAQ,aAAa,OAAO;AAAA,MAAA;AAAA,MAEtD,QAAQ;AAAA,QACN,YAAY,CAAC,eACJ,WAAW,SACd;AAAA,UACE,QAAQ,SAAS,WAAW,MAAM;AAAA,QAAA,IAEpC,CAAA;AAAA,QAEN,WAAW,CAAC,YAAY,QAAQ,aAAa,QAAQ;AAAA,MAAA;AAAA,MAEvD,OAAO;AAAA,QACL,YAAY,CAAC,eACJ,WAAW,QACd;AAAA,UACE,OAAO,WAAW;AAAA,QAAA,IAEpB,CAAA;AAAA,QAEN,WAAW,CAAC,YAAY,QAAQ,aAAa,OAAO;AAAA,MAAA;AAAA,IACtD;AAAA,EAEJ;AAAA,EAEA,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MAAA;AAAA,IACP;AAAA,EAEJ;AAAA,EAEA,WAAW,EAAE,kBAAkB;AAE7B,6BAAkB,aAAa,EAAE,gBAAgB,GAC1C,CAAC,OAAO,KAAK,QAAQ,gBAAgB,CAAC,UAAU,cAAc,CAAC;AAAA,EACxE;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,WACE,CAAC,YACD,CAAC,EAAE,IAAI,eAAe;AACpB,cAAM,EAAE,cAAc,IAChB,OAAO,KAAK,KAAK,OAAO,OAAO;AAErC,eAAI,YACF,GAAG,iBAAiB,UAAU,MAAM,UAAU,IAAI,IAAI,GAGjD;AAAA,MACT;AAAA,IAAA;AAAA,EAEN;AACF,CAAC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/tiptap-extensions",
3
- "version": "2.4.2-develop-pedago.20251126113601",
3
+ "version": "2.4.2-develop-pedago.20251126123720",
4
4
  "description": "Edifice Rich Text Editor Extensions",
5
5
  "keywords": [
6
6
  "edifice",
@@ -154,11 +154,11 @@
154
154
  "prosemirror-view": "^1.27.0",
155
155
  "vite": "^5.4.11",
156
156
  "vite-plugin-dts": "^4.1.0",
157
- "@edifice.io/utilities": "2.4.2-develop-pedago.20251126113601"
157
+ "@edifice.io/utilities": "2.4.2-develop-pedago.20251126123720"
158
158
  },
159
159
  "devDependencies": {
160
160
  "@types/dom-speech-recognition": "^0.0.1",
161
- "@edifice.io/client": "2.4.2-develop-pedago.20251126113601"
161
+ "@edifice.io/client": "2.4.2-develop-pedago.20251126123720"
162
162
  },
163
163
  "publishConfig": {
164
164
  "access": "public"