@edifice.io/tiptap-extensions 1.5.16-develop-rc.3 → 1.7.4-develop-pedago.20241211160712
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/README.md +8 -5
- package/dist/abbr/abbr.cjs +1 -32
- package/dist/abbr/abbr.cjs.map +1 -1
- package/dist/abbr/abbr.d.ts +12 -12
- package/dist/abbr/abbr.js +13 -17
- package/dist/abbr/abbr.js.map +1 -1
- package/dist/alert/alert.cjs +1 -32
- package/dist/alert/alert.cjs.map +1 -1
- package/dist/alert/alert.js +22 -20
- package/dist/alert/alert.js.map +1 -1
- package/dist/attachment/attachment-transformer.cjs +2 -0
- package/dist/attachment/attachment-transformer.cjs.map +1 -0
- package/dist/attachment/attachment-transformer.d.ts +12 -0
- package/dist/attachment/attachment-transformer.js +76 -0
- package/dist/attachment/attachment-transformer.js.map +1 -0
- package/dist/attachment/attachment.cjs +1 -73
- package/dist/attachment/attachment.cjs.map +1 -1
- package/dist/attachment/attachment.d.ts +6 -6
- package/dist/attachment/attachment.js +29 -40
- package/dist/attachment/attachment.js.map +1 -1
- package/dist/attachment/index.d.ts +1 -0
- package/dist/audio/audio.cjs +2 -52
- package/dist/audio/audio.cjs.map +1 -1
- package/dist/audio/audio.d.ts +13 -17
- package/dist/audio/audio.js +25 -28
- package/dist/audio/audio.js.map +1 -1
- package/dist/font-size/font-size.cjs +1 -48
- package/dist/font-size/font-size.cjs.map +1 -1
- package/dist/font-size/font-size.d.ts +13 -13
- package/dist/font-size/font-size.js +17 -29
- package/dist/font-size/font-size.js.map +1 -1
- package/dist/heading/heading.cjs +1 -61
- package/dist/heading/heading.cjs.map +1 -1
- package/dist/heading/heading.d.ts +12 -10
- package/dist/heading/heading.js +25 -39
- package/dist/heading/heading.js.map +1 -1
- package/dist/highlight/highlight.cjs +1 -25
- package/dist/highlight/highlight.cjs.map +1 -1
- package/dist/highlight/highlight.d.ts +1 -4
- package/dist/highlight/highlight.js +13 -11
- package/dist/highlight/highlight.js.map +1 -1
- package/dist/hyperlink/hyperlink.cjs +1 -47
- package/dist/hyperlink/hyperlink.cjs.map +1 -1
- package/dist/hyperlink/hyperlink.d.ts +24 -27
- package/dist/hyperlink/hyperlink.js +19 -21
- package/dist/hyperlink/hyperlink.js.map +1 -1
- package/dist/iframe/iframe.cjs +1 -69
- package/dist/iframe/iframe.cjs.map +1 -1
- package/dist/iframe/iframe.d.ts +14 -12
- package/dist/iframe/iframe.js +32 -48
- package/dist/iframe/iframe.js.map +1 -1
- package/dist/image/image.cjs +2 -0
- package/dist/image/image.cjs.map +1 -0
- package/dist/image/image.d.ts +26 -0
- package/dist/image/image.js +178 -0
- package/dist/image/image.js.map +1 -0
- package/dist/image/index.d.ts +3 -3
- package/dist/index.cjs +1 -43
- package/dist/index.js +24 -22
- package/dist/index.js.map +1 -1
- package/dist/line-height/line-height.cjs +1 -33
- package/dist/line-height/line-height.cjs.map +1 -1
- package/dist/line-height/line-height.js +15 -18
- package/dist/line-height/line-height.js.map +1 -1
- package/dist/linker/linker.cjs +1 -95
- package/dist/linker/linker.cjs.map +1 -1
- package/dist/linker/linker.d.ts +17 -17
- package/dist/linker/linker.js +49 -57
- package/dist/linker/linker.js.map +1 -1
- package/dist/mathjax/mathjax.cjs +1 -47
- package/dist/mathjax/mathjax.cjs.map +1 -1
- package/dist/mathjax/mathjax.js +20 -30
- package/dist/mathjax/mathjax.js.map +1 -1
- package/dist/paragraph/paragraph.cjs +1 -13
- package/dist/paragraph/paragraph.cjs.map +1 -1
- package/dist/paragraph/paragraph.d.ts +1 -4
- package/dist/paragraph/paragraph.js +8 -6
- package/dist/paragraph/paragraph.js.map +1 -1
- package/dist/speech-recognition/speech-recognition.cjs +1 -76
- package/dist/speech-recognition/speech-recognition.cjs.map +1 -1
- package/dist/speech-recognition/speech-recognition.d.ts +12 -12
- package/dist/speech-recognition/speech-recognition.js +36 -57
- package/dist/speech-recognition/speech-recognition.js.map +1 -1
- package/dist/speech-synthesis/speech-synthesis.cjs +1 -32
- package/dist/speech-synthesis/speech-synthesis.cjs.map +1 -1
- package/dist/speech-synthesis/speech-synthesis.d.ts +9 -9
- package/dist/speech-synthesis/speech-synthesis.js +10 -19
- package/dist/speech-synthesis/speech-synthesis.js.map +1 -1
- package/dist/table-cell/table-cell.cjs +1 -27
- package/dist/table-cell/table-cell.cjs.map +1 -1
- package/dist/table-cell/table-cell.d.ts +1 -4
- package/dist/table-cell/table-cell.js +12 -17
- package/dist/table-cell/table-cell.js.map +1 -1
- package/dist/transform/html-to-json/html-to-json.cjs +1 -4
- package/dist/transform/html-to-json/html-to-json.d.ts +1 -4
- package/dist/transform/html-to-json/html-to-json.js +4 -2
- package/dist/transform/json-to-html/json-to-html.cjs +1 -4
- package/dist/transform/json-to-html/json-to-html.js +4 -2
- package/dist/video/video.cjs +2 -111
- package/dist/video/video.cjs.map +1 -1
- package/dist/video/video.d.ts +19 -28
- package/dist/video/video.js +90 -114
- package/dist/video/video.js.map +1 -1
- package/package.json +24 -16
- package/dist/image/custom-image.cjs +0 -163
- package/dist/image/custom-image.cjs.map +0 -1
- package/dist/image/custom-image.d.ts +0 -27
- package/dist/image/custom-image.js +0 -181
- package/dist/image/custom-image.js.map +0 -1
package/dist/video/video.d.ts
CHANGED
|
@@ -1,34 +1,25 @@
|
|
|
1
1
|
import { Node } from '@tiptap/core';
|
|
2
2
|
export interface VideoOptions {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
url: string;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
HTMLAttributes: Record<string, any>;
|
|
7
7
|
}
|
|
8
8
|
declare module '@tiptap/core' {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
updateSelection: boolean;
|
|
25
|
-
},
|
|
26
|
-
) => ReturnType;
|
|
27
|
-
/**
|
|
28
|
-
* Toggle a video
|
|
29
|
-
*/
|
|
30
|
-
toggleVideo: (src: string) => ReturnType;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
9
|
+
interface Commands<ReturnType> {
|
|
10
|
+
video: {
|
|
11
|
+
/**
|
|
12
|
+
* Set a video node
|
|
13
|
+
* @param options.updateSelection set to true will select the newly inserted content
|
|
14
|
+
*/
|
|
15
|
+
setVideo: (id: string, src: string, isCaptation: boolean, width?: number, height?: number, controls?: boolean, controlslist?: string, options?: {
|
|
16
|
+
updateSelection: boolean;
|
|
17
|
+
}) => ReturnType;
|
|
18
|
+
/**
|
|
19
|
+
* Toggle a video
|
|
20
|
+
*/
|
|
21
|
+
toggleVideo: (src: string) => ReturnType;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
33
24
|
}
|
|
34
25
|
export declare const Video: Node<any, any>;
|
package/dist/video/video.js
CHANGED
|
@@ -1,95 +1,72 @@
|
|
|
1
|
-
import { Node, mergeAttributes, nodeInputRule } from
|
|
2
|
-
const VIDEO_INPUT_REGEX = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return [
|
|
71
|
-
'div',
|
|
72
|
-
{ class: 'video-wrapper' },
|
|
73
|
-
['video', mergeAttributes(HTMLAttributes)],
|
|
74
|
-
];
|
|
75
|
-
},
|
|
76
|
-
addCommands() {
|
|
77
|
-
return {
|
|
78
|
-
setVideo:
|
|
79
|
-
(
|
|
80
|
-
id,
|
|
81
|
-
src,
|
|
82
|
-
isCaptation,
|
|
83
|
-
width = 350,
|
|
84
|
-
height = 197,
|
|
85
|
-
controls = !0,
|
|
86
|
-
controlslist = 'nodownload',
|
|
87
|
-
options,
|
|
88
|
-
) =>
|
|
89
|
-
({ commands, state }) =>
|
|
90
|
-
commands.insertContentAt(
|
|
91
|
-
state.selection,
|
|
92
|
-
`<video
|
|
1
|
+
import { Node, mergeAttributes, nodeInputRule } from "@tiptap/core";
|
|
2
|
+
const VIDEO_INPUT_REGEX = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/, Video = Node.create({
|
|
3
|
+
name: "video",
|
|
4
|
+
group: "block",
|
|
5
|
+
draggable: !0,
|
|
6
|
+
selectable: !0,
|
|
7
|
+
addAttributes() {
|
|
8
|
+
return {
|
|
9
|
+
src: {
|
|
10
|
+
default: null,
|
|
11
|
+
parseHTML: (el) => el.getAttribute("src"),
|
|
12
|
+
renderHTML: (attrs) => ({ src: attrs.src })
|
|
13
|
+
},
|
|
14
|
+
controls: {
|
|
15
|
+
default: !0,
|
|
16
|
+
parseHTML: (el) => el.getAttribute("controls") ? el.getAttribute("controls") : !!el.hasAttribute("controls"),
|
|
17
|
+
renderHTML: (attrs) => ({ controls: attrs.controls })
|
|
18
|
+
},
|
|
19
|
+
documentId: {
|
|
20
|
+
default: "",
|
|
21
|
+
renderHTML: (attributes) => ({ "data-document-id": attributes.documentId }),
|
|
22
|
+
parseHTML: (element) => element.getAttribute("data-document-id")
|
|
23
|
+
},
|
|
24
|
+
isCaptation: {
|
|
25
|
+
default: !1,
|
|
26
|
+
renderHTML: (attributes) => ({ "data-document-is-captation": attributes.isCaptation }),
|
|
27
|
+
parseHTML: (element) => element.getAttribute("data-document-is-captation")
|
|
28
|
+
},
|
|
29
|
+
videoResolution: {
|
|
30
|
+
default: "404x720",
|
|
31
|
+
renderHTML: (attributes) => ({ "data-video-resolution": attributes.videoResolution }),
|
|
32
|
+
parseHTML: (element) => element.getAttribute("data-video-resolution")
|
|
33
|
+
},
|
|
34
|
+
width: {
|
|
35
|
+
renderHTML: (attributes) => ({
|
|
36
|
+
width: parseInt(attributes.width)
|
|
37
|
+
}),
|
|
38
|
+
parseHTML: (element) => element.getAttribute("width")
|
|
39
|
+
},
|
|
40
|
+
height: {
|
|
41
|
+
renderHTML: (attributes) => ({
|
|
42
|
+
height: parseInt(attributes.height)
|
|
43
|
+
}),
|
|
44
|
+
parseHTML: (element) => element.getAttribute("height")
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
parseHTML() {
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
tag: "div.video-wrapper>video,video",
|
|
52
|
+
getAttrs: (el) => ({
|
|
53
|
+
src: el.getAttribute("src")
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
},
|
|
58
|
+
renderHTML({ HTMLAttributes }) {
|
|
59
|
+
return [
|
|
60
|
+
"div",
|
|
61
|
+
{ class: "video-wrapper" },
|
|
62
|
+
["video", mergeAttributes(HTMLAttributes)]
|
|
63
|
+
];
|
|
64
|
+
},
|
|
65
|
+
addCommands() {
|
|
66
|
+
return {
|
|
67
|
+
setVideo: (id, src, isCaptation, width = 350, height = 197, controls = !0, controlslist = "nodownload", options) => ({ commands, state }) => commands.insertContentAt(
|
|
68
|
+
state.selection,
|
|
69
|
+
`<video
|
|
93
70
|
controls="${controls}"
|
|
94
71
|
controlslist="${controlslist}"
|
|
95
72
|
src="${src}"
|
|
@@ -98,26 +75,25 @@ const VIDEO_INPUT_REGEX = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/,
|
|
|
98
75
|
data-document-id="${id}"
|
|
99
76
|
data-document-is-captation="${isCaptation}"
|
|
100
77
|
data-video-resolution="${width}x${height}" />`,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
export { Video };
|
|
78
|
+
options
|
|
79
|
+
),
|
|
80
|
+
toggleVideo: () => ({ commands }) => commands.toggleNode(this.name, "paragraph")
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
addInputRules() {
|
|
84
|
+
return [
|
|
85
|
+
nodeInputRule({
|
|
86
|
+
find: VIDEO_INPUT_REGEX,
|
|
87
|
+
type: this.type,
|
|
88
|
+
getAttributes: (match) => {
|
|
89
|
+
const [, , src] = match;
|
|
90
|
+
return { src };
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
export {
|
|
97
|
+
Video
|
|
98
|
+
};
|
|
123
99
|
//# sourceMappingURL=video.js.map
|
package/dist/video/video.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.js","sources":["../../src/video/video.ts"],"sourcesContent":["import { mergeAttributes, Node, nodeInputRule } from '@tiptap/core';\n\nexport interface VideoOptions {\n url: string;\n width: number;\n height: number;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n video: {\n /**\n * Set a video node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setVideo: (\n id: string,\n src: string,\n isCaptation: boolean,\n width?: number,\n height?: number,\n controls?: boolean,\n controlslist?: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n /**\n * Toggle a video\n */\n toggleVideo: (src: string) => ReturnType;\n };\n }\n}\n\nconst VIDEO_INPUT_REGEX = /!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\)/;\n\nexport const Video = Node.create({\n name: 'video',\n group: 'block',\n draggable: true,\n selectable: 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 controls: {\n default: true,\n parseHTML: (el: any) => {\n if ((el as HTMLSpanElement).getAttribute('controls')) {\n return (el as HTMLSpanElement).getAttribute('controls');\n } else if ((el as HTMLSpanElement).hasAttribute('controls')) {\n return true;\n } else {\n return false;\n }\n },\n renderHTML: (attrs: any) => ({ controls: attrs.controls }),\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 isCaptation: {\n default: false,\n renderHTML: (attributes: any) => {\n return { 'data-document-is-captation': attributes.isCaptation };\n },\n parseHTML: (element: any) =>\n element.getAttribute('data-document-is-captation'),\n },\n videoResolution: {\n default: '404x720',\n renderHTML: (attributes: any) => {\n return { 'data-video-resolution': attributes.videoResolution };\n },\n parseHTML: (element: any) =>\n element.getAttribute('data-video-resolution'),\n },\n width: {\n renderHTML: (attributes: any) => {\n return {\n width: parseInt(attributes.width),\n };\n },\n parseHTML: (element) => element.getAttribute('width'),\n },\n height: {\n renderHTML: (attributes: any) => {\n return {\n height: parseInt(attributes.height),\n };\n },\n parseHTML: (element) => element.getAttribute('height'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'div.video-wrapper>video,video',\n getAttrs: (el: any) => ({\n src: (el as HTMLVideoElement).getAttribute('src'),\n }),\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'div',\n { class: 'video-wrapper' },\n ['video', mergeAttributes(HTMLAttributes)],\n ];\n },\n\n addCommands() {\n return {\n setVideo:\n (\n id: string,\n src: string,\n isCaptation: boolean,\n width = 350,\n height = 197,\n controls = true,\n controlslist = 'nodownload',\n options,\n ) =>\n ({ commands, state }) => {\n return commands.insertContentAt(\n state.selection,\n `<video \n controls=\"${controls}\" \n controlslist=\"${controlslist}\"\n src=\"${src}\" \n width=\"${width}\"\n height=\"${height}\"\n data-document-id=\"${id}\" \n data-document-is-captation=\"${isCaptation}\"\n data-video-resolution=\"${width}x${height}\" />`,\n options,\n );\n },\n\n toggleVideo:\n () =>\n ({ commands }) =>\n commands.toggleNode(this.name, 'paragraph'),\n };\n },\n\n addInputRules() {\n return [\n nodeInputRule({\n find: VIDEO_INPUT_REGEX,\n type: this.type,\n getAttributes: (match) => {\n const [, , src] = match;\n\n return { src };\n },\n }),\n ];\n },\n});\n"],"names":[],"mappings":";AAkCA,MAAM,oBAAoB,iDAEb,QAAQ,KAAK,OAAO;AAAA,EAC/B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,EAEZ,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,UAAU;AAAA,QACR,SAAS;AAAA,QACT,WAAW,CAAC,OACL,GAAuB,aAAa,UAAU,IACzC,GAAuB,aAAa,UAAU,IAC5C,KAAuB,aAAa,UAAU;AAAA,QAM5D,YAAY,CAAC,WAAgB,EAAE,UAAU,MAAM,SAAS;AAAA,MAC1D;AAAA,MACA,YAAY;AAAA,QACV,SAAS;AAAA,QACT,YAAY,CAAC,gBACJ,EAAE,oBAAoB,WAAW;
|
|
1
|
+
{"version":3,"file":"video.js","sources":["../../src/video/video.ts"],"sourcesContent":["import { mergeAttributes, Node, nodeInputRule } from '@tiptap/core';\n\nexport interface VideoOptions {\n url: string;\n width: number;\n height: number;\n HTMLAttributes: Record<string, any>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n video: {\n /**\n * Set a video node\n * @param options.updateSelection set to true will select the newly inserted content\n */\n setVideo: (\n id: string,\n src: string,\n isCaptation: boolean,\n width?: number,\n height?: number,\n controls?: boolean,\n controlslist?: string,\n options?: { updateSelection: boolean },\n ) => ReturnType;\n /**\n * Toggle a video\n */\n toggleVideo: (src: string) => ReturnType;\n };\n }\n}\n\nconst VIDEO_INPUT_REGEX = /!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\)/;\n\nexport const Video = Node.create({\n name: 'video',\n group: 'block',\n draggable: true,\n selectable: 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 controls: {\n default: true,\n parseHTML: (el: any) => {\n if ((el as HTMLSpanElement).getAttribute('controls')) {\n return (el as HTMLSpanElement).getAttribute('controls');\n } else if ((el as HTMLSpanElement).hasAttribute('controls')) {\n return true;\n } else {\n return false;\n }\n },\n renderHTML: (attrs: any) => ({ controls: attrs.controls }),\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 isCaptation: {\n default: false,\n renderHTML: (attributes: any) => {\n return { 'data-document-is-captation': attributes.isCaptation };\n },\n parseHTML: (element: any) =>\n element.getAttribute('data-document-is-captation'),\n },\n videoResolution: {\n default: '404x720',\n renderHTML: (attributes: any) => {\n return { 'data-video-resolution': attributes.videoResolution };\n },\n parseHTML: (element: any) =>\n element.getAttribute('data-video-resolution'),\n },\n width: {\n renderHTML: (attributes: any) => {\n return {\n width: parseInt(attributes.width),\n };\n },\n parseHTML: (element) => element.getAttribute('width'),\n },\n height: {\n renderHTML: (attributes: any) => {\n return {\n height: parseInt(attributes.height),\n };\n },\n parseHTML: (element) => element.getAttribute('height'),\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'div.video-wrapper>video,video',\n getAttrs: (el: any) => ({\n src: (el as HTMLVideoElement).getAttribute('src'),\n }),\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'div',\n { class: 'video-wrapper' },\n ['video', mergeAttributes(HTMLAttributes)],\n ];\n },\n\n addCommands() {\n return {\n setVideo:\n (\n id: string,\n src: string,\n isCaptation: boolean,\n width = 350,\n height = 197,\n controls = true,\n controlslist = 'nodownload',\n options,\n ) =>\n ({ commands, state }) => {\n return commands.insertContentAt(\n state.selection,\n `<video \n controls=\"${controls}\" \n controlslist=\"${controlslist}\"\n src=\"${src}\" \n width=\"${width}\"\n height=\"${height}\"\n data-document-id=\"${id}\" \n data-document-is-captation=\"${isCaptation}\"\n data-video-resolution=\"${width}x${height}\" />`,\n options,\n );\n },\n\n toggleVideo:\n () =>\n ({ commands }) =>\n commands.toggleNode(this.name, 'paragraph'),\n };\n },\n\n addInputRules() {\n return [\n nodeInputRule({\n find: VIDEO_INPUT_REGEX,\n type: this.type,\n getAttributes: (match) => {\n const [, , src] = match;\n\n return { src };\n },\n }),\n ];\n },\n});\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/tiptap-extensions",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.4-develop-pedago.20241211160712",
|
|
4
4
|
"description": "Edifice Rich Text Editor Extensions",
|
|
5
|
-
"homepage": "https://github.com/edificeio/edifice-
|
|
5
|
+
"homepage": "https://github.com/edificeio/edifice-frontend-framework/tree/main/packages/extensions#readme",
|
|
6
6
|
"bugs": {
|
|
7
|
-
"url": "https://github.com/edificeio/edifice-
|
|
7
|
+
"url": "https://github.com/edificeio/edifice-frontend-framework/issues"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/edificeio/edifice-
|
|
11
|
+
"url": "https://github.com/edificeio/edifice-frontend-framework.git",
|
|
12
|
+
"directory": "packages/extensions"
|
|
12
13
|
},
|
|
13
14
|
"license": "AGPL-3.0",
|
|
14
15
|
"author": "Edifice",
|
|
@@ -102,14 +103,6 @@
|
|
|
102
103
|
"files": [
|
|
103
104
|
"dist"
|
|
104
105
|
],
|
|
105
|
-
"scripts": {
|
|
106
|
-
"build": "vite build",
|
|
107
|
-
"fix": "eslint . --ext ts --report-unused-disable-directives --max-warnings 0",
|
|
108
|
-
"format": "pnpm run format:write && pnpm run format:check",
|
|
109
|
-
"format:check": "npx prettier --check .",
|
|
110
|
-
"format:write": "npx prettier --write .",
|
|
111
|
-
"lint": "eslint \"**/*.ts\""
|
|
112
|
-
},
|
|
113
106
|
"dependencies": {
|
|
114
107
|
"@tiptap/core": "2.3.0",
|
|
115
108
|
"@tiptap/extension-bold": "2.3.0",
|
|
@@ -124,13 +117,28 @@
|
|
|
124
117
|
"@tiptap/extension-text-style": "2.3.0",
|
|
125
118
|
"@tiptap/html": "2.3.0",
|
|
126
119
|
"@tiptap/pm": "2.3.0",
|
|
127
|
-
"@tiptap/starter-kit": "2.3.0"
|
|
120
|
+
"@tiptap/starter-kit": "2.3.0",
|
|
121
|
+
"prosemirror-model": "^1.0.0",
|
|
122
|
+
"prosemirror-state": "^1.4.3",
|
|
123
|
+
"prosemirror-transform": "^1.0.0",
|
|
124
|
+
"prosemirror-view": "^1.27.0",
|
|
125
|
+
"vite": "^5.4.11",
|
|
126
|
+
"vite-plugin-dts": "^4.1.0",
|
|
127
|
+
"@edifice.io/utilities": "1.7.4-develop-pedago.20241211160712"
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
|
-
"@types/dom-speech-recognition": "^0.0.1"
|
|
130
|
+
"@types/dom-speech-recognition": "^0.0.1",
|
|
131
|
+
"@edifice.io/client": "1.7.4-develop-pedago.20241211160712"
|
|
131
132
|
},
|
|
132
133
|
"publishConfig": {
|
|
133
134
|
"access": "public"
|
|
134
135
|
},
|
|
135
|
-
"
|
|
136
|
-
|
|
136
|
+
"scripts": {
|
|
137
|
+
"build": "vite build",
|
|
138
|
+
"fix": "eslint . --ext ts --report-unused-disable-directives --max-warnings 0",
|
|
139
|
+
"format": "pnpm run format:write && pnpm run format:check",
|
|
140
|
+
"format:check": "npx prettier --check \"src/**/*.ts\"",
|
|
141
|
+
"format:write": "npx prettier --write \"src/**/*.ts\"",
|
|
142
|
+
"lint": "eslint \"**/*.ts\""
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
-
const core = require('@tiptap/core'),
|
|
4
|
-
Image = require('@tiptap/extension-image'),
|
|
5
|
-
IMAGE_INPUT_REGEX =
|
|
6
|
-
/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,
|
|
7
|
-
CustomImage = Image.extend({
|
|
8
|
-
name: 'custom-image',
|
|
9
|
-
draggable: !0,
|
|
10
|
-
selectable: !0,
|
|
11
|
-
addOptions() {
|
|
12
|
-
var _a;
|
|
13
|
-
return {
|
|
14
|
-
...((_a = this.parent) == null ? void 0 : _a.call(this)),
|
|
15
|
-
inline: !0,
|
|
16
|
-
content: 'inline*',
|
|
17
|
-
sizes: ['small', 'medium', 'large'],
|
|
18
|
-
HTMLAttributes: { class: 'custom-image' },
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
addAttributes() {
|
|
22
|
-
var _a;
|
|
23
|
-
return {
|
|
24
|
-
...((_a = this.parent) == null ? void 0 : _a.call(this)),
|
|
25
|
-
size: { default: 'medium', rendered: !1 },
|
|
26
|
-
alt: {
|
|
27
|
-
renderHTML: (attributes) => ({ alt: attributes.alt }),
|
|
28
|
-
parseHTML: (element) => element.getAttribute('alt'),
|
|
29
|
-
},
|
|
30
|
-
title: {
|
|
31
|
-
renderHTML: (attributes) => ({ title: attributes.title }),
|
|
32
|
-
parseHTML: (element) => element.getAttribute('title'),
|
|
33
|
-
},
|
|
34
|
-
width: {
|
|
35
|
-
default: '350',
|
|
36
|
-
renderHTML: (attributes) =>
|
|
37
|
-
attributes.width !== null &&
|
|
38
|
-
attributes.width !== void 0 &&
|
|
39
|
-
!Number.isNaN(attributes.width)
|
|
40
|
-
? { width: parseInt(attributes.width) }
|
|
41
|
-
: {},
|
|
42
|
-
parseHTML: (element) => element.getAttribute('width'),
|
|
43
|
-
},
|
|
44
|
-
height: {
|
|
45
|
-
renderHTML: (attributes) =>
|
|
46
|
-
attributes.height !== null &&
|
|
47
|
-
attributes.height !== void 0 &&
|
|
48
|
-
!Number.isNaN(attributes.height)
|
|
49
|
-
? { height: parseInt(attributes.height) }
|
|
50
|
-
: {},
|
|
51
|
-
parseHTML: (element) => element.getAttribute('height'),
|
|
52
|
-
},
|
|
53
|
-
style: {
|
|
54
|
-
renderHTML: (attributes) =>
|
|
55
|
-
attributes.style ? { style: attributes.style } : {},
|
|
56
|
-
parseHTML: (element) => {
|
|
57
|
-
const style = element.getAttribute('style');
|
|
58
|
-
return style && typeof style == 'string' && style.length > 0
|
|
59
|
-
? {}
|
|
60
|
-
: null;
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
},
|
|
65
|
-
parseHTML() {
|
|
66
|
-
return [
|
|
67
|
-
{
|
|
68
|
-
tag: 'img[src]:not([src^="data:"])',
|
|
69
|
-
getAttrs: (el) => {
|
|
70
|
-
var _a, _b, _c, _d, _e;
|
|
71
|
-
const attr = { src: el.getAttribute('src') };
|
|
72
|
-
return (
|
|
73
|
-
(_a = el.parentElement) != null &&
|
|
74
|
-
_a.className.includes('image-container') &&
|
|
75
|
-
(_b = el.parentElement.style) != null &&
|
|
76
|
-
_b.width &&
|
|
77
|
-
(attr.width = el.parentElement.style.width),
|
|
78
|
-
(_c = el.style) != null &&
|
|
79
|
-
_c.width &&
|
|
80
|
-
(attr.width = el.style.width),
|
|
81
|
-
[
|
|
82
|
-
'happy',
|
|
83
|
-
'proud',
|
|
84
|
-
'dreamy',
|
|
85
|
-
'love',
|
|
86
|
-
'tired',
|
|
87
|
-
'angry',
|
|
88
|
-
'worried',
|
|
89
|
-
'sick',
|
|
90
|
-
'joker',
|
|
91
|
-
'sad',
|
|
92
|
-
].filter((smiley) => attr.src.includes(smiley + '.png')).length >
|
|
93
|
-
0 &&
|
|
94
|
-
((attr.style = {
|
|
95
|
-
width: '1.5em',
|
|
96
|
-
height: '1.5em',
|
|
97
|
-
fontSize:
|
|
98
|
-
(_e =
|
|
99
|
-
(_d = el.parentElement) == null ? void 0 : _d.style) ==
|
|
100
|
-
null
|
|
101
|
-
? void 0
|
|
102
|
-
: _e.fontSize,
|
|
103
|
-
}),
|
|
104
|
-
(attr.width = 'null'),
|
|
105
|
-
(attr.height = 'null')),
|
|
106
|
-
attr
|
|
107
|
-
);
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
];
|
|
111
|
-
},
|
|
112
|
-
renderHTML({ HTMLAttributes }) {
|
|
113
|
-
return [
|
|
114
|
-
'img',
|
|
115
|
-
core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
|
|
116
|
-
];
|
|
117
|
-
},
|
|
118
|
-
addInputRules() {
|
|
119
|
-
return [
|
|
120
|
-
core.nodeInputRule({
|
|
121
|
-
find: IMAGE_INPUT_REGEX,
|
|
122
|
-
type: this.type,
|
|
123
|
-
getAttributes: (match) => {
|
|
124
|
-
const [, , alt, src, title] = match;
|
|
125
|
-
return { src, alt, title };
|
|
126
|
-
},
|
|
127
|
-
}),
|
|
128
|
-
];
|
|
129
|
-
},
|
|
130
|
-
addCommands() {
|
|
131
|
-
return {
|
|
132
|
-
setNewImage:
|
|
133
|
-
(attrs) =>
|
|
134
|
-
({ tr, dispatch }) => {
|
|
135
|
-
const { selection } = tr,
|
|
136
|
-
node = this.type.create(attrs);
|
|
137
|
-
return (
|
|
138
|
-
dispatch &&
|
|
139
|
-
tr.replaceRangeWith(selection.from, selection.to, node),
|
|
140
|
-
!0
|
|
141
|
-
);
|
|
142
|
-
},
|
|
143
|
-
setAttributes:
|
|
144
|
-
(attributes) =>
|
|
145
|
-
({ tr, dispatch }) => {
|
|
146
|
-
const { selection } = tr,
|
|
147
|
-
options = {
|
|
148
|
-
...tr.doc.nodeAt(tr.selection.from).attrs,
|
|
149
|
-
...attributes,
|
|
150
|
-
},
|
|
151
|
-
node = this.type.create(options);
|
|
152
|
-
return (
|
|
153
|
-
dispatch &&
|
|
154
|
-
tr.replaceRangeWith(selection.from, selection.to, node),
|
|
155
|
-
!0
|
|
156
|
-
);
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
});
|
|
161
|
-
exports.CustomImage = CustomImage;
|
|
162
|
-
exports.IMAGE_INPUT_REGEX = IMAGE_INPUT_REGEX;
|
|
163
|
-
//# sourceMappingURL=custom-image.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"custom-image.cjs","sources":["../../src/image/custom-image.ts"],"sourcesContent":["import { mergeAttributes, nodeInputRule } from '@tiptap/core';\nimport Image from '@tiptap/extension-image';\n\nexport const IMAGE_INPUT_REGEX =\n /(?:^|\\s)(!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\))$/;\n\nexport interface CustomImageOptions {\n HTMLAttributes: Record<string, string>;\n sizes: string[];\n}\n\ninterface AttributesProps {\n width: number | string;\n height: number | string;\n size: string;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n customImage: {\n setAttributes: (options: AttributesProps) => ReturnType;\n setNewImage: (options: {\n src: string;\n alt?: string;\n title?: string;\n }) => ReturnType;\n };\n }\n}\n\nexport const CustomImage = Image.extend<CustomImageOptions>({\n name: 'custom-image',\n draggable: true,\n selectable: true,\n\n addOptions() {\n return {\n ...this.parent?.(),\n inline: true,\n content: 'inline*',\n sizes: ['small', 'medium', 'large'],\n HTMLAttributes: {\n class: 'custom-image',\n },\n };\n },\n\n addAttributes() {\n return {\n ...this.parent?.(),\n size: {\n default: 'medium',\n rendered: false,\n },\n alt: {\n renderHTML: (attributes) => {\n return {\n alt: attributes.alt,\n };\n },\n parseHTML: (element) => element.getAttribute('alt'),\n },\n title: {\n renderHTML: (attributes) => {\n return {\n title: attributes.title,\n };\n },\n parseHTML: (element) => element.getAttribute('title'),\n },\n width: {\n default: '350',\n renderHTML: (attributes) => {\n if (\n attributes.width !== null &&\n attributes.width !== undefined &&\n !Number.isNaN(attributes.width)\n ) {\n return {\n width: parseInt(attributes.width),\n };\n }\n return {};\n },\n parseHTML: (element) => element.getAttribute('width'),\n },\n height: {\n renderHTML: (attributes) => {\n if (\n attributes.height !== null &&\n attributes.height !== undefined &&\n !Number.isNaN(attributes.height)\n ) {\n return {\n height: parseInt(attributes.height),\n };\n }\n return {};\n },\n parseHTML: (element) => element.getAttribute('height'),\n },\n style: {\n renderHTML: (attributes) => {\n return attributes.style\n ? {\n style: attributes.style,\n }\n : {};\n },\n parseHTML: (element) => {\n const style = element.getAttribute('style');\n return style && typeof style === 'string' && style.length > 0\n ? {}\n : null;\n },\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'img[src]:not([src^=\"data:\"])',\n getAttrs: (el: HTMLImageElement) => {\n const attr = { src: el.getAttribute('src') };\n // Check old content format and get the width from the parent element\n if (el.parentElement?.className.includes('image-container')) {\n if (el.parentElement.style?.width) {\n attr['width'] = el.parentElement.style.width;\n }\n }\n if (el.style?.width) {\n attr['width'] = el.style.width;\n }\n\n // Check old content smiley\n const oldSmileyList = [\n 'happy',\n 'proud',\n 'dreamy',\n 'love',\n 'tired',\n 'angry',\n 'worried',\n 'sick',\n 'joker',\n 'sad',\n ];\n if (\n oldSmileyList.filter((smiley) => attr.src.includes(smiley + '.png'))\n .length > 0\n ) {\n attr['style'] = {\n width: '1.5em',\n height: '1.5em',\n fontSize: el.parentElement?.style?.fontSize,\n };\n attr['width'] = 'null';\n attr['height'] = 'null';\n }\n return attr;\n },\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'img',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n ];\n },\n\n addInputRules() {\n return [\n nodeInputRule({\n find: IMAGE_INPUT_REGEX,\n type: this.type,\n getAttributes: (match) => {\n const [, , alt, src, title] = match;\n\n return {\n src,\n alt,\n title,\n };\n },\n }),\n ];\n },\n\n addCommands() {\n return {\n setNewImage:\n (attrs) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\n const node = this.type.create(attrs);\n\n if (dispatch) {\n tr.replaceRangeWith(selection.from, selection.to, node);\n }\n\n return true;\n },\n setAttributes:\n (attributes) =>\n ({ tr, dispatch }) => {\n const { selection } = tr;\n\n const nodeAttrs = tr.doc.nodeAt(tr.selection.from);\n const options = {\n ...nodeAttrs.attrs,\n ...attributes,\n };\n const node = this.type.create(options);\n\n if (dispatch) {\n tr.replaceRangeWith(selection.from, selection.to, node);\n }\n\n return true;\n },\n };\n },\n});\n"],"names":["mergeAttributes","nodeInputRule"],"mappings":"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"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export declare const IMAGE_INPUT_REGEX: RegExp;
|
|
2
|
-
export interface CustomImageOptions {
|
|
3
|
-
HTMLAttributes: Record<string, string>;
|
|
4
|
-
sizes: string[];
|
|
5
|
-
}
|
|
6
|
-
interface AttributesProps {
|
|
7
|
-
width: number | string;
|
|
8
|
-
height: number | string;
|
|
9
|
-
size: string;
|
|
10
|
-
}
|
|
11
|
-
declare module '@tiptap/core' {
|
|
12
|
-
interface Commands<ReturnType> {
|
|
13
|
-
customImage: {
|
|
14
|
-
setAttributes: (options: AttributesProps) => ReturnType;
|
|
15
|
-
setNewImage: (options: {
|
|
16
|
-
src: string;
|
|
17
|
-
alt?: string;
|
|
18
|
-
title?: string;
|
|
19
|
-
}) => ReturnType;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export declare const CustomImage: import('@tiptap/core').Node<
|
|
24
|
-
CustomImageOptions,
|
|
25
|
-
any
|
|
26
|
-
>;
|
|
27
|
-
export {};
|