@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.
package/dist/iframe/iframe.cjs
CHANGED
|
@@ -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:{
|
|
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
|
|
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"}
|
package/dist/iframe/iframe.js
CHANGED
|
@@ -26,39 +26,16 @@ const Iframe = Node.create({
|
|
|
26
26
|
parseHTML: () => this.options.allowFullscreen
|
|
27
27
|
},
|
|
28
28
|
width: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
|
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,EAC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E,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.
|
|
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.
|
|
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.
|
|
161
|
+
"@edifice.io/client": "2.4.2-develop-pedago.20251126123720"
|
|
162
162
|
},
|
|
163
163
|
"publishConfig": {
|
|
164
164
|
"access": "public"
|