@edifice.io/tiptap-extensions 2.1.0-develop-enabling.0 → 2.1.0-develop-wl.20250204154502
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/attachment/attachment.cjs +1 -1
- package/dist/attachment/attachment.cjs.map +1 -1
- package/dist/attachment/attachment.d.ts +1 -0
- package/dist/attachment/attachment.js +16 -1
- package/dist/attachment/attachment.js.map +1 -1
- package/dist/audio/audio.cjs +1 -1
- package/dist/audio/audio.cjs.map +1 -1
- package/dist/audio/audio.js +4 -1
- package/dist/audio/audio.js.map +1 -1
- package/dist/image/image.js +1 -1
- package/dist/video/video.js +1 -1
- package/package.json +27 -21
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),Attachment=core.Node.create({name:"attachments",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){return{HTMLAttributes:{class:"attachments"}}},parseHTML(){return[{tag:"div[class=attachments]"}]},renderHTML({HTMLAttributes}){const renderedLinks=HTMLAttributes.links.map(el=>["a",{name:el.name,href:el.href,documentId:el.documentId,dataContentType:el.dataContentType},el.name]);return["div",this.options.HTMLAttributes,...renderedLinks]},addAttributes(){return{links:{default:[],parseHTML:element=>{const links=element.getElementsByTagName("a"),parsedLinks=[];for(let i=0;i<links.length;i++){const link=links[i],href=link.getAttribute("href"),name=link.textContent,regexResult=href.match(/([^/]+$)/),documentId=link.getAttribute("data-document-id")||regexResult&®exResult[0],dataContentType=link.getAttribute("data-content-type");parsedLinks.push({href,name,documentId,dataContentType})}return parsedLinks},renderHTML:attributes=>({links:attributes.links.map(link=>({href:link.href,name:link.name,documentId:link.documentId,dataContentType:link.dataContentType}))})}}},addCommands(){return{setAttachment:(attrs={dataContentType:"",name:"",documentId:"",href:""})=>({chain})=>chain().insertContent({type:this.name,attrs}).run()}}});exports.Attachment=Attachment;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),Attachment=core.Node.create({name:"attachments",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){return{HTMLAttributes:{class:"attachments"}}},parseHTML(){return[{tag:"div[class=attachments]"}]},renderHTML({HTMLAttributes}){const renderedLinks=HTMLAttributes.links.map(el=>["a",{name:el.name,href:el.href,documentId:el.documentId,dataContentType:el.dataContentType},el.name]);return["div",this.options.HTMLAttributes,...renderedLinks]},addAttributes(){return{links:{default:[],parseHTML:element=>{const links=element.getElementsByTagName("a"),parsedLinks=[];for(let i=0;i<links.length;i++){const link=links[i],href=link.getAttribute("href"),name=link.textContent,regexResult=href.match(/([^/]+$)/),documentId=link.getAttribute("data-document-id")||regexResult&®exResult[0],dataContentType=link.getAttribute("data-content-type");parsedLinks.push({href,name,documentId,dataContentType})}return parsedLinks},renderHTML:attributes=>({links:attributes.links.map(link=>({href:link.href,name:link.name,documentId:link.documentId,dataContentType:link.dataContentType}))})}}},addCommands(){return{setAttachment:(attrs={dataContentType:"",name:"",documentId:"",href:""})=>({chain})=>chain().insertContent({type:this.name,attrs}).run(),unsetAttachment:documentId=>({state,dispatch})=>{const{selection}=state,{from,to}=selection;return state.doc.nodesBetween(from,to,(node,pos)=>{if(node.type.name===this.name&&node.attrs.links.length>1){const newLinks=node.attrs.links.filter(link=>link.documentId!==documentId);if(newLinks.length!==node.attrs.links.length){const newAttrs={...node.attrs,links:newLinks};dispatch(state.tr.setNodeMarkup(pos,void 0,newAttrs))}}else dispatch(state.tr.delete(from,to))}),!0}}}});exports.Attachment=Attachment;
|
|
2
2
|
//# sourceMappingURL=attachment.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.cjs","sources":["../../src/attachment/attachment.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface AttachmentOptions {\n HTMLAttributes: Record<string, string>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n attachment: {\n setAttachment: (attachment) => ReturnType;\n };\n }\n}\n\nexport const Attachment = Node.create<AttachmentOptions>({\n name: 'attachments',\n content: '',\n marks: '',\n group: 'block',\n selectable: true,\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n HTMLAttributes: {\n class: 'attachments',\n },\n };\n },\n\n parseHTML() {\n return [{ tag: 'div[class=attachments]' }];\n },\n\n renderHTML({ HTMLAttributes }) {\n const links = HTMLAttributes.links;\n\n const renderedLinks = links.map((el) => {\n return [\n 'a',\n {\n name: el.name,\n href: el.href,\n documentId: el.documentId,\n dataContentType: el.dataContentType,\n },\n el.name,\n ];\n });\n\n return ['div', this.options.HTMLAttributes, ...renderedLinks];\n },\n\n addAttributes() {\n return {\n links: {\n default: [],\n parseHTML: (element) => {\n const links = element.getElementsByTagName('a');\n const parsedLinks = [];\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const href = link.getAttribute('href');\n const name = link.textContent;\n const regexResult = href.match(/([^/]+$)/);\n const documentId =\n link.getAttribute('data-document-id') ||\n (regexResult && regexResult[0]);\n const dataContentType = link.getAttribute('data-content-type');\n\n parsedLinks.push({\n href,\n name,\n documentId,\n dataContentType,\n });\n }\n\n return parsedLinks;\n },\n renderHTML: (attributes) => {\n return {\n links: attributes.links.map((link) => ({\n href: link.href,\n name: link.name,\n documentId: link.documentId,\n dataContentType: link.dataContentType,\n })),\n };\n },\n },\n };\n },\n\n addCommands() {\n return {\n setAttachment:\n (\n attrs = {\n dataContentType: '',\n name: '',\n documentId: '',\n href: '',\n },\n ) =>\n ({ chain }) => {\n return chain().insertContent({ type: this.name, attrs }).run();\n },\n };\n },\n});\n"],"names":["Node"],"mappings":"
|
|
1
|
+
{"version":3,"file":"attachment.cjs","sources":["../../src/attachment/attachment.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface AttachmentOptions {\n HTMLAttributes: Record<string, string>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n attachment: {\n setAttachment: (attachment) => ReturnType;\n unsetAttachment: (documentId: string) => ReturnType; // Modification de la commande\n };\n }\n}\n\nexport const Attachment = Node.create<AttachmentOptions>({\n name: 'attachments',\n content: '',\n marks: '',\n group: 'block',\n selectable: true,\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n HTMLAttributes: {\n class: 'attachments',\n },\n };\n },\n\n parseHTML() {\n return [{ tag: 'div[class=attachments]' }];\n },\n\n renderHTML({ HTMLAttributes }) {\n const links = HTMLAttributes.links;\n\n const renderedLinks = links.map((el) => {\n return [\n 'a',\n {\n name: el.name,\n href: el.href,\n documentId: el.documentId,\n dataContentType: el.dataContentType,\n },\n el.name,\n ];\n });\n\n return ['div', this.options.HTMLAttributes, ...renderedLinks];\n },\n\n addAttributes() {\n return {\n links: {\n default: [],\n parseHTML: (element) => {\n const links = element.getElementsByTagName('a');\n const parsedLinks = [];\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const href = link.getAttribute('href');\n const name = link.textContent;\n const regexResult = href.match(/([^/]+$)/);\n const documentId =\n link.getAttribute('data-document-id') ||\n (regexResult && regexResult[0]);\n const dataContentType = link.getAttribute('data-content-type');\n\n parsedLinks.push({\n href,\n name,\n documentId,\n dataContentType,\n });\n }\n\n return parsedLinks;\n },\n renderHTML: (attributes) => {\n return {\n links: attributes.links.map((link) => ({\n href: link.href,\n name: link.name,\n documentId: link.documentId,\n dataContentType: link.dataContentType,\n })),\n };\n },\n },\n };\n },\n\n addCommands() {\n return {\n setAttachment:\n (\n attrs = {\n dataContentType: '',\n name: '',\n documentId: '',\n href: '',\n },\n ) =>\n ({ chain }) => {\n return chain().insertContent({ type: this.name, attrs }).run();\n },\n unsetAttachment:\n (documentId: string) =>\n ({ state, dispatch }) => {\n const { selection } = state;\n const { from, to } = selection;\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (node.type.name === this.name && node.attrs.links.length > 1) {\n const newLinks = node.attrs.links.filter(\n (link) => link.documentId !== documentId,\n );\n if (newLinks.length !== node.attrs.links.length) {\n const newAttrs = { ...node.attrs, links: newLinks };\n dispatch(state.tr.setNodeMarkup(pos, undefined, newAttrs));\n }\n } else {\n dispatch(state.tr.delete(from, to));\n }\n });\n return true;\n },\n };\n },\n});\n"],"names":["Node"],"mappings":"mHAea,WAAaA,UAAK,OAA0B,CACvD,KAAM,cACN,QAAS,GACT,MAAO,GACP,MAAO,QACP,WAAY,GACZ,KAAM,GACN,UAAW,GAEX,YAAa,CACJ,MAAA,CACL,eAAgB,CACd,MAAO,aAAA,CAEX,CACF,EAEA,WAAY,CACV,MAAO,CAAC,CAAE,IAAK,yBAA0B,CAC3C,EAEA,WAAW,CAAE,gBAAkB,CAG7B,MAAM,cAFQ,eAAe,MAED,IAAK,IACxB,CACL,IACA,CACE,KAAM,GAAG,KACT,KAAM,GAAG,KACT,WAAY,GAAG,WACf,gBAAiB,GAAG,eACtB,EACA,GAAG,IACL,CACD,EAED,MAAO,CAAC,MAAO,KAAK,QAAQ,eAAgB,GAAG,aAAa,CAC9D,EAEA,eAAgB,CACP,MAAA,CACL,MAAO,CACL,QAAS,CAAC,EACV,UAAY,SAAY,CAChB,MAAA,MAAQ,QAAQ,qBAAqB,GAAG,EACxC,YAAc,CAAC,EAErB,QAAS,EAAI,EAAG,EAAI,MAAM,OAAQ,IAAK,CAC/B,MAAA,KAAO,MAAM,CAAC,EACd,KAAO,KAAK,aAAa,MAAM,EAC/B,KAAO,KAAK,YACZ,YAAc,KAAK,MAAM,UAAU,EACnC,WACJ,KAAK,aAAa,kBAAkB,GACnC,aAAe,YAAY,CAAC,EACzB,gBAAkB,KAAK,aAAa,mBAAmB,EAE7D,YAAY,KAAK,CACf,KACA,KACA,WACA,eAAA,CACD,CAAA,CAGI,OAAA,WACT,EACA,WAAa,aACJ,CACL,MAAO,WAAW,MAAM,IAAK,OAAU,CACrC,KAAM,KAAK,KACX,KAAM,KAAK,KACX,WAAY,KAAK,WACjB,gBAAiB,KAAK,eAAA,EACtB,CACJ,EACF,CAEJ,CACF,EAEA,aAAc,CACL,MAAA,CACL,cACE,CACE,MAAQ,CACN,gBAAiB,GACjB,KAAM,GACN,WAAY,GACZ,KAAM,EAAA,IAGV,CAAC,CAAE,SACM,MAAA,EAAQ,cAAc,CAAE,KAAM,KAAK,KAAM,MAAO,EAAE,IAAI,EAEjE,gBACG,YACD,CAAC,CAAE,MAAO,YAAe,CACjB,KAAA,CAAE,WAAc,MAChB,CAAE,KAAM,EAAA,EAAO,UACrB,aAAM,IAAI,aAAa,KAAM,GAAI,CAAC,KAAM,MAAQ,CAC1C,GAAA,KAAK,KAAK,OAAS,KAAK,MAAQ,KAAK,MAAM,MAAM,OAAS,EAAG,CACzD,MAAA,SAAW,KAAK,MAAM,MAAM,OAC/B,MAAS,KAAK,aAAe,UAChC,EACA,GAAI,SAAS,SAAW,KAAK,MAAM,MAAM,OAAQ,CAC/C,MAAM,SAAW,CAAE,GAAG,KAAK,MAAO,MAAO,QAAS,EAClD,SAAS,MAAM,GAAG,cAAc,IAAK,OAAW,QAAQ,CAAC,CAAA,CAC3D,MAEA,SAAS,MAAM,GAAG,OAAO,KAAM,EAAE,CAAC,CACpC,CACD,EACM,EAAA,CAEb,CAAA,CAEJ,CAAC"}
|
|
@@ -65,7 +65,22 @@ const Attachment = Node.create({
|
|
|
65
65
|
name: "",
|
|
66
66
|
documentId: "",
|
|
67
67
|
href: ""
|
|
68
|
-
}) => ({ chain }) => chain().insertContent({ type: this.name, attrs }).run()
|
|
68
|
+
}) => ({ chain }) => chain().insertContent({ type: this.name, attrs }).run(),
|
|
69
|
+
unsetAttachment: (documentId) => ({ state, dispatch }) => {
|
|
70
|
+
const { selection } = state, { from, to } = selection;
|
|
71
|
+
return state.doc.nodesBetween(from, to, (node, pos) => {
|
|
72
|
+
if (node.type.name === this.name && node.attrs.links.length > 1) {
|
|
73
|
+
const newLinks = node.attrs.links.filter(
|
|
74
|
+
(link) => link.documentId !== documentId
|
|
75
|
+
);
|
|
76
|
+
if (newLinks.length !== node.attrs.links.length) {
|
|
77
|
+
const newAttrs = { ...node.attrs, links: newLinks };
|
|
78
|
+
dispatch(state.tr.setNodeMarkup(pos, void 0, newAttrs));
|
|
79
|
+
}
|
|
80
|
+
} else
|
|
81
|
+
dispatch(state.tr.delete(from, to));
|
|
82
|
+
}), !0;
|
|
83
|
+
}
|
|
69
84
|
};
|
|
70
85
|
}
|
|
71
86
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.js","sources":["../../src/attachment/attachment.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface AttachmentOptions {\n HTMLAttributes: Record<string, string>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n attachment: {\n setAttachment: (attachment) => ReturnType;\n };\n }\n}\n\nexport const Attachment = Node.create<AttachmentOptions>({\n name: 'attachments',\n content: '',\n marks: '',\n group: 'block',\n selectable: true,\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n HTMLAttributes: {\n class: 'attachments',\n },\n };\n },\n\n parseHTML() {\n return [{ tag: 'div[class=attachments]' }];\n },\n\n renderHTML({ HTMLAttributes }) {\n const links = HTMLAttributes.links;\n\n const renderedLinks = links.map((el) => {\n return [\n 'a',\n {\n name: el.name,\n href: el.href,\n documentId: el.documentId,\n dataContentType: el.dataContentType,\n },\n el.name,\n ];\n });\n\n return ['div', this.options.HTMLAttributes, ...renderedLinks];\n },\n\n addAttributes() {\n return {\n links: {\n default: [],\n parseHTML: (element) => {\n const links = element.getElementsByTagName('a');\n const parsedLinks = [];\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const href = link.getAttribute('href');\n const name = link.textContent;\n const regexResult = href.match(/([^/]+$)/);\n const documentId =\n link.getAttribute('data-document-id') ||\n (regexResult && regexResult[0]);\n const dataContentType = link.getAttribute('data-content-type');\n\n parsedLinks.push({\n href,\n name,\n documentId,\n dataContentType,\n });\n }\n\n return parsedLinks;\n },\n renderHTML: (attributes) => {\n return {\n links: attributes.links.map((link) => ({\n href: link.href,\n name: link.name,\n documentId: link.documentId,\n dataContentType: link.dataContentType,\n })),\n };\n },\n },\n };\n },\n\n addCommands() {\n return {\n setAttachment:\n (\n attrs = {\n dataContentType: '',\n name: '',\n documentId: '',\n href: '',\n },\n ) =>\n ({ chain }) => {\n return chain().insertContent({ type: this.name, attrs }).run();\n },\n };\n },\n});\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"attachment.js","sources":["../../src/attachment/attachment.ts"],"sourcesContent":["import { Node } from '@tiptap/core';\n\nexport interface AttachmentOptions {\n HTMLAttributes: Record<string, string>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n attachment: {\n setAttachment: (attachment) => ReturnType;\n unsetAttachment: (documentId: string) => ReturnType; // Modification de la commande\n };\n }\n}\n\nexport const Attachment = Node.create<AttachmentOptions>({\n name: 'attachments',\n content: '',\n marks: '',\n group: 'block',\n selectable: true,\n atom: true,\n draggable: true,\n\n addOptions() {\n return {\n HTMLAttributes: {\n class: 'attachments',\n },\n };\n },\n\n parseHTML() {\n return [{ tag: 'div[class=attachments]' }];\n },\n\n renderHTML({ HTMLAttributes }) {\n const links = HTMLAttributes.links;\n\n const renderedLinks = links.map((el) => {\n return [\n 'a',\n {\n name: el.name,\n href: el.href,\n documentId: el.documentId,\n dataContentType: el.dataContentType,\n },\n el.name,\n ];\n });\n\n return ['div', this.options.HTMLAttributes, ...renderedLinks];\n },\n\n addAttributes() {\n return {\n links: {\n default: [],\n parseHTML: (element) => {\n const links = element.getElementsByTagName('a');\n const parsedLinks = [];\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const href = link.getAttribute('href');\n const name = link.textContent;\n const regexResult = href.match(/([^/]+$)/);\n const documentId =\n link.getAttribute('data-document-id') ||\n (regexResult && regexResult[0]);\n const dataContentType = link.getAttribute('data-content-type');\n\n parsedLinks.push({\n href,\n name,\n documentId,\n dataContentType,\n });\n }\n\n return parsedLinks;\n },\n renderHTML: (attributes) => {\n return {\n links: attributes.links.map((link) => ({\n href: link.href,\n name: link.name,\n documentId: link.documentId,\n dataContentType: link.dataContentType,\n })),\n };\n },\n },\n };\n },\n\n addCommands() {\n return {\n setAttachment:\n (\n attrs = {\n dataContentType: '',\n name: '',\n documentId: '',\n href: '',\n },\n ) =>\n ({ chain }) => {\n return chain().insertContent({ type: this.name, attrs }).run();\n },\n unsetAttachment:\n (documentId: string) =>\n ({ state, dispatch }) => {\n const { selection } = state;\n const { from, to } = selection;\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (node.type.name === this.name && node.attrs.links.length > 1) {\n const newLinks = node.attrs.links.filter(\n (link) => link.documentId !== documentId,\n );\n if (newLinks.length !== node.attrs.links.length) {\n const newAttrs = { ...node.attrs, links: newLinks };\n dispatch(state.tr.setNodeMarkup(pos, undefined, newAttrs));\n }\n } else {\n dispatch(state.tr.delete(from, to));\n }\n });\n return true;\n },\n };\n },\n});\n"],"names":[],"mappings":";AAea,MAAA,aAAa,KAAK,OAA0B;AAAA,EACvD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,aAAa;AACJ,WAAA;AAAA,MACL,gBAAgB;AAAA,QACd,OAAO;AAAA,MAAA;AAAA,IAEX;AAAA,EACF;AAAA,EAEA,YAAY;AACV,WAAO,CAAC,EAAE,KAAK,0BAA0B;AAAA,EAC3C;AAAA,EAEA,WAAW,EAAE,kBAAkB;AAG7B,UAAM,gBAFQ,eAAe,MAED,IAAI,CAAC,OACxB;AAAA,MACL;AAAA,MACA;AAAA,QACE,MAAM,GAAG;AAAA,QACT,MAAM,GAAG;AAAA,QACT,YAAY,GAAG;AAAA,QACf,iBAAiB,GAAG;AAAA,MACtB;AAAA,MACA,GAAG;AAAA,IACL,CACD;AAED,WAAO,CAAC,OAAO,KAAK,QAAQ,gBAAgB,GAAG,aAAa;AAAA,EAC9D;AAAA,EAEA,gBAAgB;AACP,WAAA;AAAA,MACL,OAAO;AAAA,QACL,SAAS,CAAC;AAAA,QACV,WAAW,CAAC,YAAY;AAChB,gBAAA,QAAQ,QAAQ,qBAAqB,GAAG,GACxC,cAAc,CAAC;AAErB,mBAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AAC/B,kBAAA,OAAO,MAAM,CAAC,GACd,OAAO,KAAK,aAAa,MAAM,GAC/B,OAAO,KAAK,aACZ,cAAc,KAAK,MAAM,UAAU,GACnC,aACJ,KAAK,aAAa,kBAAkB,KACnC,eAAe,YAAY,CAAC,GACzB,kBAAkB,KAAK,aAAa,mBAAmB;AAE7D,wBAAY,KAAK;AAAA,cACf;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YAAA,CACD;AAAA,UAAA;AAGI,iBAAA;AAAA,QACT;AAAA,QACA,YAAY,CAAC,gBACJ;AAAA,UACL,OAAO,WAAW,MAAM,IAAI,CAAC,UAAU;AAAA,YACrC,MAAM,KAAK;AAAA,YACX,MAAM,KAAK;AAAA,YACX,YAAY,KAAK;AAAA,YACjB,iBAAiB,KAAK;AAAA,UAAA,EACtB;AAAA,QACJ;AAAA,MACF;AAAA,IAEJ;AAAA,EACF;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,eACE,CACE,QAAQ;AAAA,QACN,iBAAiB;AAAA,QACjB,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,MAAM;AAAA,MAAA,MAGV,CAAC,EAAE,YACM,MAAA,EAAQ,cAAc,EAAE,MAAM,KAAK,MAAM,OAAO,EAAE,IAAI;AAAA,MAEjE,iBACE,CAAC,eACD,CAAC,EAAE,OAAO,eAAe;AACjB,cAAA,EAAE,cAAc,OAChB,EAAE,MAAM,GAAA,IAAO;AACrB,qBAAM,IAAI,aAAa,MAAM,IAAI,CAAC,MAAM,QAAQ;AAC1C,cAAA,KAAK,KAAK,SAAS,KAAK,QAAQ,KAAK,MAAM,MAAM,SAAS,GAAG;AACzD,kBAAA,WAAW,KAAK,MAAM,MAAM;AAAA,cAChC,CAAC,SAAS,KAAK,eAAe;AAAA,YAChC;AACA,gBAAI,SAAS,WAAW,KAAK,MAAM,MAAM,QAAQ;AAC/C,oBAAM,WAAW,EAAE,GAAG,KAAK,OAAO,OAAO,SAAS;AAClD,uBAAS,MAAM,GAAG,cAAc,KAAK,QAAW,QAAQ,CAAC;AAAA,YAAA;AAAA,UAC3D;AAEA,qBAAS,MAAM,GAAG,OAAO,MAAM,EAAE,CAAC;AAAA,QACpC,CACD,GACM;AAAA,MAAA;AAAA,IAEb;AAAA,EAAA;AAEJ,CAAC;"}
|
package/dist/audio/audio.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),Audio=core.Node.create({name:"audio",group:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),Audio=core.Node.create({name:"audio",group:"inline",inline:!0,selectable:!0,draggable:!0,addAttributes(){return{src:{default:null,parseHTML:el=>el.getAttribute("src"),renderHTML:attrs=>({src:attrs.src})},documentId:{default:"",renderHTML:attributes=>({"data-document-id":attributes.documentId}),parseHTML:element=>element.getAttribute("data-document-id")}}},parseHTML(){return[{tag:"div.audio-wrapper>audio,audio",getAttrs:el=>({src:el.getAttribute("src")})}]},renderHTML({HTMLAttributes}){return["div",{class:"audio-wrapper"},["audio",core.mergeAttributes(HTMLAttributes)]]},addCommands(){return{setAudio:(id,src,options)=>({commands,state})=>commands.insertContentAt(state.selection,`<audio
|
|
2
2
|
src="${src}"
|
|
3
3
|
controls preload="none"
|
|
4
4
|
data-document-id="${id}"></audio>`,options)}}});exports.Audio=Audio;
|
package/dist/audio/audio.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio.cjs","sources":["../../src/audio/audio.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core';\n\nexport interface AudioOptions {\n url: string;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n audio: {\n /**\n * Set a audio node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setAudio: (\n id: string,\n src: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n };\n }\n}\n\nexport const Audio = Node.create({\n name: 'audio',\n
|
|
1
|
+
{"version":3,"file":"audio.cjs","sources":["../../src/audio/audio.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core';\n\nexport interface AudioOptions {\n url: string;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n audio: {\n /**\n * Set a audio node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setAudio: (\n id: string,\n src: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n };\n }\n}\n\nexport const Audio = Node.create({\n name: 'audio',\n group: 'inline',\n\n inline: true,\n selectable: true,\n draggable: true,\n\n addAttributes() {\n return {\n src: {\n default: null,\n parseHTML: (el: any) => (el as HTMLSpanElement).getAttribute('src'),\n renderHTML: (attrs: any) => ({ src: attrs.src }),\n },\n documentId: {\n default: '',\n renderHTML: (attributes: any) => {\n return { 'data-document-id': attributes.documentId };\n },\n parseHTML: (element: any) => element.getAttribute('data-document-id'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'div.audio-wrapper>audio,audio',\n getAttrs: (el: any) => ({\n src: (el as HTMLAudioElement).getAttribute('src'),\n }),\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'div',\n { class: 'audio-wrapper' },\n ['audio', mergeAttributes(HTMLAttributes)],\n ];\n },\n\n addCommands() {\n return {\n setAudio:\n (id, src, options) =>\n ({ commands, state }) => {\n return commands.insertContentAt(\n state.selection,\n `<audio \n src=\"${src}\" \n controls preload=\"none\"\n data-document-id=\"${id}\"></audio>`,\n options,\n );\n },\n };\n },\n});\n"],"names":["Node","mergeAttributes"],"mappings":"mHAuBa,MAAQA,UAAK,OAAO,CAC/B,KAAM,QACN,MAAO,SAEP,OAAQ,GACR,WAAY,GACZ,UAAW,GAEX,eAAgB,CACP,MAAA,CACL,IAAK,CACH,QAAS,KACT,UAAY,IAAa,GAAuB,aAAa,KAAK,EAClE,WAAa,QAAgB,CAAE,IAAK,MAAM,GAAI,EAChD,EACA,WAAY,CACV,QAAS,GACT,WAAa,aACJ,CAAE,mBAAoB,WAAW,UAAW,GAErD,UAAY,SAAiB,QAAQ,aAAa,kBAAkB,CAAA,CAExE,CACF,EAEA,WAAY,CACH,MAAA,CACL,CACE,IAAK,gCACL,SAAW,KAAa,CACtB,IAAM,GAAwB,aAAa,KAAK,CAClD,EAAA,CAEJ,CACF,EAEA,WAAW,CAAE,gBAAkB,CACtB,MAAA,CACL,MACA,CAAE,MAAO,eAAgB,EACzB,CAAC,QAASC,KAAgB,gBAAA,cAAc,CAAC,CAC3C,CACF,EAEA,aAAc,CACL,MAAA,CACL,SACE,CAAC,GAAI,IAAK,UACV,CAAC,CAAE,SAAU,SACJ,SAAS,gBACd,MAAM,UACN;AAAA,qBACS,GAAG;AAAA;AAAA,kCAEU,EAAE,aACxB,OACF,CAEN,CAAA,CAEJ,CAAC"}
|
package/dist/audio/audio.js
CHANGED
package/dist/audio/audio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio.js","sources":["../../src/audio/audio.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core';\n\nexport interface AudioOptions {\n url: string;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n audio: {\n /**\n * Set a audio node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setAudio: (\n id: string,\n src: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n };\n }\n}\n\nexport const Audio = Node.create({\n name: 'audio',\n
|
|
1
|
+
{"version":3,"file":"audio.js","sources":["../../src/audio/audio.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core';\n\nexport interface AudioOptions {\n url: string;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n audio: {\n /**\n * Set a audio node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setAudio: (\n id: string,\n src: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n };\n }\n}\n\nexport const Audio = Node.create({\n name: 'audio',\n group: 'inline',\n\n inline: true,\n selectable: true,\n draggable: true,\n\n addAttributes() {\n return {\n src: {\n default: null,\n parseHTML: (el: any) => (el as HTMLSpanElement).getAttribute('src'),\n renderHTML: (attrs: any) => ({ src: attrs.src }),\n },\n documentId: {\n default: '',\n renderHTML: (attributes: any) => {\n return { 'data-document-id': attributes.documentId };\n },\n parseHTML: (element: any) => element.getAttribute('data-document-id'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'div.audio-wrapper>audio,audio',\n getAttrs: (el: any) => ({\n src: (el as HTMLAudioElement).getAttribute('src'),\n }),\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'div',\n { class: 'audio-wrapper' },\n ['audio', mergeAttributes(HTMLAttributes)],\n ];\n },\n\n addCommands() {\n return {\n setAudio:\n (id, src, options) =>\n ({ commands, state }) => {\n return commands.insertContentAt(\n state.selection,\n `<audio \n src=\"${src}\" \n controls preload=\"none\"\n data-document-id=\"${id}\"></audio>`,\n options,\n );\n },\n };\n },\n});\n"],"names":[],"mappings":";AAuBa,MAAA,QAAQ,KAAK,OAAO;AAAA,EAC/B,MAAM;AAAA,EACN,OAAO;AAAA,EAEP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EAEX,gBAAgB;AACP,WAAA;AAAA,MACL,KAAK;AAAA,QACH,SAAS;AAAA,QACT,WAAW,CAAC,OAAa,GAAuB,aAAa,KAAK;AAAA,QAClE,YAAY,CAAC,WAAgB,EAAE,KAAK,MAAM,IAAI;AAAA,MAChD;AAAA,MACA,YAAY;AAAA,QACV,SAAS;AAAA,QACT,YAAY,CAAC,gBACJ,EAAE,oBAAoB,WAAW,WAAW;AAAA,QAErD,WAAW,CAAC,YAAiB,QAAQ,aAAa,kBAAkB;AAAA,MAAA;AAAA,IAExE;AAAA,EACF;AAAA,EAEA,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,KAAK;AAAA,QACL,UAAU,CAAC,QAAa;AAAA,UACtB,KAAM,GAAwB,aAAa,KAAK;AAAA,QAClD;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,kBAAkB;AACtB,WAAA;AAAA,MACL;AAAA,MACA,EAAE,OAAO,gBAAgB;AAAA,MACzB,CAAC,SAAS,gBAAgB,cAAc,CAAC;AAAA,IAC3C;AAAA,EACF;AAAA,EAEA,cAAc;AACL,WAAA;AAAA,MACL,UACE,CAAC,IAAI,KAAK,YACV,CAAC,EAAE,UAAU,YACJ,SAAS;AAAA,QACd,MAAM;AAAA,QACN;AAAA,qBACS,GAAG;AAAA;AAAA,kCAEU,EAAE;AAAA,QACxB;AAAA,MACF;AAAA,IAEN;AAAA,EAAA;AAEJ,CAAC;"}
|
package/dist/image/image.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageResizer } from "@edifice.io/utilities";
|
|
2
|
-
import {
|
|
2
|
+
import { nodeInputRule, mergeAttributes } from "@tiptap/core";
|
|
3
3
|
import TiptapImage from "@tiptap/extension-image";
|
|
4
4
|
import { Plugin } from "prosemirror-state";
|
|
5
5
|
const IMAGE_INPUT_REGEX = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Image = TiptapImage.extend({
|
package/dist/video/video.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node,
|
|
1
|
+
import { Node, nodeInputRule, mergeAttributes } from "@tiptap/core";
|
|
2
2
|
const VIDEO_INPUT_REGEX = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/, Video = Node.create({
|
|
3
3
|
name: "video",
|
|
4
4
|
group: "block",
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/tiptap-extensions",
|
|
3
|
-
"version": "2.1.0-develop-
|
|
3
|
+
"version": "2.1.0-develop-wl.20250204154502",
|
|
4
4
|
"description": "Edifice Rich Text Editor Extensions",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"edifice",
|
|
7
|
+
"rich text editor",
|
|
8
|
+
"tiptap",
|
|
9
|
+
"extensions"
|
|
10
|
+
],
|
|
5
11
|
"homepage": "https://github.com/edificeio/edifice-frontend-framework/tree/main/packages/extensions#readme",
|
|
6
12
|
"bugs": {
|
|
7
13
|
"url": "https://github.com/edificeio/edifice-frontend-framework/issues"
|
|
@@ -104,41 +110,41 @@
|
|
|
104
110
|
"dist"
|
|
105
111
|
],
|
|
106
112
|
"dependencies": {
|
|
107
|
-
"@tiptap/core": "2.
|
|
108
|
-
"@tiptap/extension-bold": "2.
|
|
109
|
-
"@tiptap/extension-document": "2.
|
|
110
|
-
"@tiptap/extension-heading": "2.
|
|
111
|
-
"@tiptap/extension-highlight": "2.
|
|
112
|
-
"@tiptap/extension-image": "2.
|
|
113
|
-
"@tiptap/extension-link": "2.
|
|
114
|
-
"@tiptap/extension-paragraph": "2.
|
|
115
|
-
"@tiptap/extension-table-cell": "2.
|
|
116
|
-
"@tiptap/extension-text": "2.
|
|
117
|
-
"@tiptap/extension-text-style": "2.
|
|
118
|
-
"@tiptap/html": "2.
|
|
119
|
-
"@tiptap/pm": "2.
|
|
120
|
-
"@tiptap/starter-kit": "2.
|
|
113
|
+
"@tiptap/core": "2.11.0",
|
|
114
|
+
"@tiptap/extension-bold": "2.11.0",
|
|
115
|
+
"@tiptap/extension-document": "2.11.0",
|
|
116
|
+
"@tiptap/extension-heading": "2.11.0",
|
|
117
|
+
"@tiptap/extension-highlight": "2.11.0",
|
|
118
|
+
"@tiptap/extension-image": "2.11.0",
|
|
119
|
+
"@tiptap/extension-link": "2.11.0",
|
|
120
|
+
"@tiptap/extension-paragraph": "2.11.0",
|
|
121
|
+
"@tiptap/extension-table-cell": "2.11.0",
|
|
122
|
+
"@tiptap/extension-text": "2.11.0",
|
|
123
|
+
"@tiptap/extension-text-style": "2.11.0",
|
|
124
|
+
"@tiptap/html": "2.11.0",
|
|
125
|
+
"@tiptap/pm": "2.11.0",
|
|
126
|
+
"@tiptap/starter-kit": "2.11.0",
|
|
121
127
|
"prosemirror-model": "^1.0.0",
|
|
122
128
|
"prosemirror-state": "^1.4.3",
|
|
123
129
|
"prosemirror-transform": "^1.0.0",
|
|
124
130
|
"prosemirror-view": "^1.27.0",
|
|
125
|
-
"vite": "
|
|
126
|
-
"vite-plugin-dts": "
|
|
127
|
-
"@edifice.io/utilities": "2.1.0-develop-
|
|
131
|
+
"vite": "^5.4.11",
|
|
132
|
+
"vite-plugin-dts": "^4.1.0",
|
|
133
|
+
"@edifice.io/utilities": "2.1.0-develop-wl.20250204154502"
|
|
128
134
|
},
|
|
129
135
|
"devDependencies": {
|
|
130
136
|
"@types/dom-speech-recognition": "^0.0.1",
|
|
131
|
-
"@edifice.io/client": "2.1.0-develop-
|
|
137
|
+
"@edifice.io/client": "2.1.0-develop-wl.20250204154502"
|
|
132
138
|
},
|
|
133
139
|
"publishConfig": {
|
|
134
140
|
"access": "public"
|
|
135
141
|
},
|
|
136
142
|
"scripts": {
|
|
137
143
|
"build": "vite build",
|
|
138
|
-
"fix": "eslint
|
|
144
|
+
"fix": "eslint --fix --report-unused-disable-directives --max-warnings 0",
|
|
139
145
|
"format": "pnpm run format:write && pnpm run format:check",
|
|
140
146
|
"format:check": "npx prettier --check \"src/**/*.ts\"",
|
|
141
147
|
"format:write": "npx prettier --write \"src/**/*.ts\"",
|
|
142
|
-
"lint": "eslint
|
|
148
|
+
"lint": "eslint"
|
|
143
149
|
}
|
|
144
150
|
}
|