@kerebron/extension-basic-editor 0.4.31 → 0.5.1
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 +4 -4
- package/esm/BasicEditorKit.d.ts +5 -0
- package/esm/BasicEditorKit.d.ts.map +1 -0
- package/esm/BasicEditorKit.js +97 -0
- package/esm/BasicEditorKit.js.map +1 -0
- package/esm/ExtensionBasicEditor.d.ts +1 -44
- package/esm/ExtensionBasicEditor.d.ts.map +1 -1
- package/esm/ExtensionBasicEditor.js +3 -90
- package/esm/ExtensionBasicEditor.js.map +1 -1
- package/esm/NodeIframe.d.ts +8 -0
- package/esm/NodeIframe.d.ts.map +1 -0
- package/esm/NodeIframe.js +35 -0
- package/esm/NodeIframe.js.map +1 -0
- package/esm/NodeImage.d.ts +3 -0
- package/esm/NodeImage.d.ts.map +1 -1
- package/esm/NodeImage.js +190 -2
- package/esm/NodeImage.js.map +1 -1
- package/esm/NodeInlineShortCode.d.ts +3 -0
- package/esm/NodeInlineShortCode.d.ts.map +1 -1
- package/esm/NodeInlineShortCode.js +42 -4
- package/esm/NodeInlineShortCode.js.map +1 -1
- package/package.json +11 -5
- package/src/BasicEditorKit.ts +101 -0
- package/src/ExtensionBasicEditor.ts +3 -91
- package/src/NodeIframe.ts +37 -0
- package/src/NodeImage.ts +209 -2
- package/src/NodeInlineShortCode.ts +72 -7
package/README.md
CHANGED
|
@@ -12,12 +12,12 @@ Features:
|
|
|
12
12
|
## Usage:
|
|
13
13
|
|
|
14
14
|
```js
|
|
15
|
-
import {
|
|
15
|
+
import { AdvancedEditorKit } from '@kerebron/editor-kits/AdvancedEditorKit';
|
|
16
16
|
|
|
17
|
-
this.editor =
|
|
17
|
+
this.editor = CoreEditor.create({
|
|
18
18
|
element: htmlElement,
|
|
19
|
-
|
|
20
|
-
new
|
|
19
|
+
editorKits: [
|
|
20
|
+
new AdvancedEditorKit(),
|
|
21
21
|
],
|
|
22
22
|
});
|
|
23
23
|
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasicEditorKit.d.ts","sourceRoot":"","sources":["../src/BasicEditorKit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAiDhE,qBAAa,cAAe,YAAW,SAAS;IAC9C,aAAa,IAAI,iBAAiB,EAAE;CAkDrC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ExtensionSelection } from './ExtensionSelection.js';
|
|
2
|
+
import { ExtensionBaseKeymap } from './ExtensionBaseKeymap.js';
|
|
3
|
+
import { ExtensionDropcursor } from './ExtensionDropcursor.js';
|
|
4
|
+
import { ExtensionGapcursor } from './ExtensionGapcursor.js';
|
|
5
|
+
import { ExtensionHtml } from './ExtensionHtml.js';
|
|
6
|
+
import { ExtensionMediaUpload } from './ExtensionMediaUpload.js';
|
|
7
|
+
import { ExtensionRemoteSelection } from './remote-selection/ExtensionRemoteSelection.js';
|
|
8
|
+
import { ExtensionTextAlign } from './ExtensionTextAlign.js';
|
|
9
|
+
import { MarkLink } from './MarkLink.js';
|
|
10
|
+
import { MarkStrong } from './MarkStrong.js';
|
|
11
|
+
import { MarkItalic } from './MarkItalic.js';
|
|
12
|
+
import { MarkUnderline } from './MarkUnderline.js';
|
|
13
|
+
import { MarkStrike } from './MarkStrike.js';
|
|
14
|
+
import { MarkCode } from './MarkCode.js';
|
|
15
|
+
import { MarkChange } from './MarkChange.js';
|
|
16
|
+
import { MarkBookmark } from './MarkBookmark.js';
|
|
17
|
+
import { MarkTextColor } from './MarkTextColor.js';
|
|
18
|
+
import { MarkHighlight } from './MarkHighlight.js';
|
|
19
|
+
import { MarkSuperscript } from './MarkSuperscript.js';
|
|
20
|
+
import { MarkSubscript } from './MarkSubscript.js';
|
|
21
|
+
import { NodeDocument } from './NodeDocument.js';
|
|
22
|
+
import { NodeText } from './NodeText.js';
|
|
23
|
+
import { NodeCodeBlock } from './NodeCodeBlock.js';
|
|
24
|
+
import { NodeBookmark } from './NodeBookmark.js';
|
|
25
|
+
import { NodeParagraph } from './NodeParagraph.js';
|
|
26
|
+
import { NodeHardBreak } from './NodeHardBreak.js';
|
|
27
|
+
import { NodeHorizontalRule } from './NodeHorizontalRule.js';
|
|
28
|
+
import { NodeOrderedList } from './NodeOrderedList.js';
|
|
29
|
+
import { NodeBulletList } from './NodeBulletList.js';
|
|
30
|
+
import { NodeListItem } from './NodeListItem.js';
|
|
31
|
+
import { NodeImage } from './NodeImage.js';
|
|
32
|
+
import { NodeVideo } from './NodeVideo.js';
|
|
33
|
+
import { NodeBlockquote } from './NodeBlockquote.js';
|
|
34
|
+
import { NodeAside } from './NodeAside.js';
|
|
35
|
+
import { NodeHeading } from './NodeHeading.js';
|
|
36
|
+
import { NodeMath } from './NodeMath.js';
|
|
37
|
+
import { NodeDefinitionList } from './NodeDefinitionList.js';
|
|
38
|
+
import { NodeDefinitionTerm } from './NodeDefinitionTerm.js';
|
|
39
|
+
import { NodeDefinitionDesc } from './NodeDefinitionDesc.js';
|
|
40
|
+
import { NodeFrontmatter } from './NodeFrontmatter.js';
|
|
41
|
+
import { NodeTaskList } from './NodeTaskList.js';
|
|
42
|
+
import { NodeTaskItem } from './NodeTaskItem.js';
|
|
43
|
+
import { NodeInlineShortCode } from './NodeInlineShortCode.js';
|
|
44
|
+
import { NodeIframe } from './NodeIframe.js';
|
|
45
|
+
export class BasicEditorKit {
|
|
46
|
+
getExtensions() {
|
|
47
|
+
return [
|
|
48
|
+
new ExtensionBaseKeymap(),
|
|
49
|
+
new ExtensionDropcursor(),
|
|
50
|
+
new ExtensionGapcursor(),
|
|
51
|
+
new ExtensionHtml(),
|
|
52
|
+
new ExtensionMediaUpload(),
|
|
53
|
+
new ExtensionRemoteSelection(),
|
|
54
|
+
new ExtensionSelection(),
|
|
55
|
+
new ExtensionTextAlign(),
|
|
56
|
+
new NodeDocument(),
|
|
57
|
+
new NodeText(),
|
|
58
|
+
new NodeParagraph(),
|
|
59
|
+
new NodeHardBreak(),
|
|
60
|
+
new NodeCodeBlock(),
|
|
61
|
+
new NodeBookmark(),
|
|
62
|
+
new NodeHorizontalRule(),
|
|
63
|
+
new NodeOrderedList(),
|
|
64
|
+
new NodeBulletList(),
|
|
65
|
+
new NodeListItem(),
|
|
66
|
+
new NodeTaskList(),
|
|
67
|
+
new NodeTaskItem(),
|
|
68
|
+
new NodeDefinitionList(),
|
|
69
|
+
new NodeDefinitionTerm(),
|
|
70
|
+
new NodeDefinitionDesc(),
|
|
71
|
+
new NodeTaskList(),
|
|
72
|
+
new NodeTaskItem(),
|
|
73
|
+
new NodeFrontmatter(),
|
|
74
|
+
new NodeImage(),
|
|
75
|
+
new NodeVideo(),
|
|
76
|
+
new NodeBlockquote(),
|
|
77
|
+
new NodeAside(),
|
|
78
|
+
new NodeHeading(),
|
|
79
|
+
new NodeMath(),
|
|
80
|
+
new NodeInlineShortCode(),
|
|
81
|
+
new NodeIframe(),
|
|
82
|
+
new MarkLink(),
|
|
83
|
+
new MarkItalic(),
|
|
84
|
+
new MarkStrong(),
|
|
85
|
+
new MarkUnderline(),
|
|
86
|
+
new MarkStrike(),
|
|
87
|
+
new MarkCode(),
|
|
88
|
+
new MarkChange(),
|
|
89
|
+
new MarkBookmark(),
|
|
90
|
+
new MarkTextColor(),
|
|
91
|
+
new MarkHighlight(),
|
|
92
|
+
new MarkSuperscript(),
|
|
93
|
+
new MarkSubscript(),
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=BasicEditorKit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasicEditorKit.js","sourceRoot":"","sources":["../src/BasicEditorKit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,E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E;YACnB,IAAI,aAAa,EAAE;YACnB,IAAI,aAAa,EAAE;YACnB,IAAI,YAAY,EAAE;YAClB,IAAI,kBAAkB,EAAE;YACxB,IAAI,eAAe,EAAE;YACrB,IAAI,cAAc,EAAE;YACpB,IAAI,YAAY,EAAE;YAClB,IAAI,YAAY,EAAE;YAClB,IAAI,YAAY,EAAE;YAClB,IAAI,kBAAkB,EAAE;YACxB,IAAI,kBAAkB,EAAE;YACxB,IAAI,kBAAkB,EAAE;YACxB,IAAI,YAAY,EAAE;YAClB,IAAI,YAAY,EAAE;YAClB,IAAI,eAAe,EAAE;YACrB,IAAI,SAAS,EAAE;YACf,IAAI,SAAS,EAAE;YACf,IAAI,cAAc,EAAE;YACpB,IAAI,SAAS,EAAE;YACf,IAAI,WAAW,EAAE;YACjB,IAAI,QAAQ,EAAE;YACd,IAAI,mBAAmB,EAAE;YACzB,IAAI,UAAU,EAAE;YAChB,IAAI,QAAQ,EAAE;YACd,IAAI,UAAU,EAAE;YAChB,IAAI,UAAU,EAAE;YAChB,IAAI,aAAa,EAAE;YACnB,IAAI,UAAU,EAAE;YAChB,IAAI,QAAQ,EAAE;YACd,IAAI,UAAU,EAAE;YAChB,IAAI,YAAY,EAAE;YAClB,IAAI,aAAa,EAAE;YACnB,IAAI,aAAa,EAAE;YACnB,IAAI,eAAe,EAAE;YACrB,IAAI,aAAa,EAAE;SACpB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,49 +1,6 @@
|
|
|
1
1
|
import { Extension } from '@kerebron/editor';
|
|
2
|
-
import { ExtensionSelection } from './ExtensionSelection.js';
|
|
3
|
-
import { ExtensionBaseKeymap } from './ExtensionBaseKeymap.js';
|
|
4
|
-
import { ExtensionDropcursor } from './ExtensionDropcursor.js';
|
|
5
|
-
import { ExtensionGapcursor } from './ExtensionGapcursor.js';
|
|
6
|
-
import { ExtensionHtml } from './ExtensionHtml.js';
|
|
7
|
-
import { ExtensionMediaUpload } from './ExtensionMediaUpload.js';
|
|
8
|
-
import { ExtensionRemoteSelection } from './remote-selection/ExtensionRemoteSelection.js';
|
|
9
|
-
import { ExtensionTextAlign } from './ExtensionTextAlign.js';
|
|
10
|
-
import { MarkLink } from './MarkLink.js';
|
|
11
|
-
import { MarkStrong } from './MarkStrong.js';
|
|
12
|
-
import { MarkItalic } from './MarkItalic.js';
|
|
13
|
-
import { MarkUnderline } from './MarkUnderline.js';
|
|
14
|
-
import { MarkStrike } from './MarkStrike.js';
|
|
15
|
-
import { MarkCode } from './MarkCode.js';
|
|
16
|
-
import { MarkChange } from './MarkChange.js';
|
|
17
|
-
import { MarkBookmark } from './MarkBookmark.js';
|
|
18
|
-
import { MarkTextColor } from './MarkTextColor.js';
|
|
19
|
-
import { MarkHighlight } from './MarkHighlight.js';
|
|
20
|
-
import { MarkSuperscript } from './MarkSuperscript.js';
|
|
21
|
-
import { MarkSubscript } from './MarkSubscript.js';
|
|
22
|
-
import { NodeDocument } from './NodeDocument.js';
|
|
23
|
-
import { NodeText } from './NodeText.js';
|
|
24
|
-
import { NodeCodeBlock } from './NodeCodeBlock.js';
|
|
25
|
-
import { NodeBookmark } from './NodeBookmark.js';
|
|
26
|
-
import { NodeParagraph } from './NodeParagraph.js';
|
|
27
|
-
import { NodeHardBreak } from './NodeHardBreak.js';
|
|
28
|
-
import { NodeHorizontalRule } from './NodeHorizontalRule.js';
|
|
29
|
-
import { NodeOrderedList } from './NodeOrderedList.js';
|
|
30
|
-
import { NodeBulletList } from './NodeBulletList.js';
|
|
31
|
-
import { NodeListItem } from './NodeListItem.js';
|
|
32
|
-
import { NodeImage } from './NodeImage.js';
|
|
33
|
-
import { NodeVideo } from './NodeVideo.js';
|
|
34
|
-
import { NodeBlockquote } from './NodeBlockquote.js';
|
|
35
|
-
import { NodeAside } from './NodeAside.js';
|
|
36
|
-
import { NodeHeading } from './NodeHeading.js';
|
|
37
|
-
import { NodeMath } from './NodeMath.js';
|
|
38
|
-
import { NodeDefinitionList } from './NodeDefinitionList.js';
|
|
39
|
-
import { NodeDefinitionTerm } from './NodeDefinitionTerm.js';
|
|
40
|
-
import { NodeDefinitionDesc } from './NodeDefinitionDesc.js';
|
|
41
|
-
import { NodeFrontmatter } from './NodeFrontmatter.js';
|
|
42
|
-
import { NodeTaskList } from './NodeTaskList.js';
|
|
43
|
-
import { NodeTaskItem } from './NodeTaskItem.js';
|
|
44
|
-
import { NodeInlineShortCode } from './NodeInlineShortCode.js';
|
|
45
2
|
export declare class ExtensionBasicEditor extends Extension {
|
|
46
3
|
name: string;
|
|
47
|
-
requires:
|
|
4
|
+
requires: AnyExtensionOrReq[];
|
|
48
5
|
}
|
|
49
6
|
//# sourceMappingURL=ExtensionBasicEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionBasicEditor.d.ts","sourceRoot":"","sources":["../src/ExtensionBasicEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExtensionBasicEditor.d.ts","sourceRoot":"","sources":["../src/ExtensionBasicEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAK7C,qBAAa,oBAAqB,SAAQ,SAAS;IACjD,IAAI,SAAkB;IACtB,QAAQ,sBAAuB;CAChC"}
|
|
@@ -1,95 +1,8 @@
|
|
|
1
1
|
import { Extension } from '@kerebron/editor';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { ExtensionDropcursor } from './ExtensionDropcursor.js';
|
|
5
|
-
import { ExtensionGapcursor } from './ExtensionGapcursor.js';
|
|
6
|
-
import { ExtensionHtml } from './ExtensionHtml.js';
|
|
7
|
-
import { ExtensionMediaUpload } from './ExtensionMediaUpload.js';
|
|
8
|
-
import { ExtensionRemoteSelection } from './remote-selection/ExtensionRemoteSelection.js';
|
|
9
|
-
import { ExtensionTextAlign } from './ExtensionTextAlign.js';
|
|
10
|
-
import { MarkLink } from './MarkLink.js';
|
|
11
|
-
import { MarkStrong } from './MarkStrong.js';
|
|
12
|
-
import { MarkItalic } from './MarkItalic.js';
|
|
13
|
-
import { MarkUnderline } from './MarkUnderline.js';
|
|
14
|
-
import { MarkStrike } from './MarkStrike.js';
|
|
15
|
-
import { MarkCode } from './MarkCode.js';
|
|
16
|
-
import { MarkChange } from './MarkChange.js';
|
|
17
|
-
import { MarkBookmark } from './MarkBookmark.js';
|
|
18
|
-
import { MarkTextColor } from './MarkTextColor.js';
|
|
19
|
-
import { MarkHighlight } from './MarkHighlight.js';
|
|
20
|
-
import { MarkSuperscript } from './MarkSuperscript.js';
|
|
21
|
-
import { MarkSubscript } from './MarkSubscript.js';
|
|
22
|
-
import { NodeDocument } from './NodeDocument.js';
|
|
23
|
-
import { NodeText } from './NodeText.js';
|
|
24
|
-
import { NodeCodeBlock } from './NodeCodeBlock.js';
|
|
25
|
-
import { NodeBookmark } from './NodeBookmark.js';
|
|
26
|
-
import { NodeParagraph } from './NodeParagraph.js';
|
|
27
|
-
import { NodeHardBreak } from './NodeHardBreak.js';
|
|
28
|
-
import { NodeHorizontalRule } from './NodeHorizontalRule.js';
|
|
29
|
-
import { NodeOrderedList } from './NodeOrderedList.js';
|
|
30
|
-
import { NodeBulletList } from './NodeBulletList.js';
|
|
31
|
-
import { NodeListItem } from './NodeListItem.js';
|
|
32
|
-
import { NodeImage } from './NodeImage.js';
|
|
33
|
-
import { NodeVideo } from './NodeVideo.js';
|
|
34
|
-
import { NodeBlockquote } from './NodeBlockquote.js';
|
|
35
|
-
import { NodeAside } from './NodeAside.js';
|
|
36
|
-
import { NodeHeading } from './NodeHeading.js';
|
|
37
|
-
import { NodeMath } from './NodeMath.js';
|
|
38
|
-
import { NodeDefinitionList } from './NodeDefinitionList.js';
|
|
39
|
-
import { NodeDefinitionTerm } from './NodeDefinitionTerm.js';
|
|
40
|
-
import { NodeDefinitionDesc } from './NodeDefinitionDesc.js';
|
|
41
|
-
import { NodeFrontmatter } from './NodeFrontmatter.js';
|
|
42
|
-
import { NodeTaskList } from './NodeTaskList.js';
|
|
43
|
-
import { NodeTaskItem } from './NodeTaskItem.js';
|
|
44
|
-
import { NodeInlineShortCode } from './NodeInlineShortCode.js';
|
|
2
|
+
import { BasicEditorKit } from './BasicEditorKit.js';
|
|
3
|
+
const kit = new BasicEditorKit();
|
|
45
4
|
export class ExtensionBasicEditor extends Extension {
|
|
46
5
|
name = 'basic-editor';
|
|
47
|
-
requires =
|
|
48
|
-
new ExtensionBaseKeymap(),
|
|
49
|
-
new ExtensionDropcursor(),
|
|
50
|
-
new ExtensionGapcursor(),
|
|
51
|
-
new ExtensionHtml(),
|
|
52
|
-
new ExtensionMediaUpload(),
|
|
53
|
-
new ExtensionRemoteSelection(),
|
|
54
|
-
new ExtensionSelection(),
|
|
55
|
-
new ExtensionTextAlign(),
|
|
56
|
-
new NodeDocument(),
|
|
57
|
-
new NodeText(),
|
|
58
|
-
new NodeParagraph(),
|
|
59
|
-
new NodeHardBreak(),
|
|
60
|
-
new NodeCodeBlock(),
|
|
61
|
-
new NodeBookmark(),
|
|
62
|
-
new NodeHorizontalRule(),
|
|
63
|
-
new NodeOrderedList(),
|
|
64
|
-
new NodeBulletList(),
|
|
65
|
-
new NodeListItem(),
|
|
66
|
-
new NodeTaskList(),
|
|
67
|
-
new NodeTaskItem(),
|
|
68
|
-
new NodeDefinitionList(),
|
|
69
|
-
new NodeDefinitionTerm(),
|
|
70
|
-
new NodeDefinitionDesc(),
|
|
71
|
-
new NodeTaskList(),
|
|
72
|
-
new NodeTaskItem(),
|
|
73
|
-
new NodeFrontmatter(),
|
|
74
|
-
new NodeImage(),
|
|
75
|
-
new NodeVideo(),
|
|
76
|
-
new NodeBlockquote(),
|
|
77
|
-
new NodeAside(),
|
|
78
|
-
new NodeHeading(),
|
|
79
|
-
new NodeMath(),
|
|
80
|
-
new NodeInlineShortCode(),
|
|
81
|
-
new MarkLink(),
|
|
82
|
-
new MarkItalic(),
|
|
83
|
-
new MarkStrong(),
|
|
84
|
-
new MarkUnderline(),
|
|
85
|
-
new MarkStrike(),
|
|
86
|
-
new MarkCode(),
|
|
87
|
-
new MarkChange(),
|
|
88
|
-
new MarkBookmark(),
|
|
89
|
-
new MarkTextColor(),
|
|
90
|
-
new MarkHighlight(),
|
|
91
|
-
new MarkSuperscript(),
|
|
92
|
-
new MarkSubscript(),
|
|
93
|
-
];
|
|
6
|
+
requires = kit.getExtensions();
|
|
94
7
|
}
|
|
95
8
|
//# sourceMappingURL=ExtensionBasicEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionBasicEditor.js","sourceRoot":"","sources":["../src/ExtensionBasicEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ExtensionBasicEditor.js","sourceRoot":"","sources":["../src/ExtensionBasicEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;AAEjC,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IACjD,IAAI,GAAG,cAAc,CAAC;IACtB,QAAQ,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeIframe.d.ts","sourceRoot":"","sources":["../src/NodeIframe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,qBAAa,UAAW,SAAQ,IAAI;IACzB,IAAI,SAAY;IACzB,QAAQ,WAAW;IAEV,WAAW,IAAI,QAAQ;CA6BjC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Node } from '@kerebron/editor';
|
|
2
|
+
export class NodeIframe extends Node {
|
|
3
|
+
name = 'iframe';
|
|
4
|
+
requires = ['doc'];
|
|
5
|
+
getNodeSpec() {
|
|
6
|
+
return {
|
|
7
|
+
inline: true,
|
|
8
|
+
attrs: {
|
|
9
|
+
src: {},
|
|
10
|
+
class: { default: null },
|
|
11
|
+
alt: { default: null },
|
|
12
|
+
title: { default: null },
|
|
13
|
+
},
|
|
14
|
+
group: 'inline',
|
|
15
|
+
draggable: true,
|
|
16
|
+
parseDOM: [
|
|
17
|
+
{
|
|
18
|
+
tag: 'iframe[src]',
|
|
19
|
+
getAttrs(dom) {
|
|
20
|
+
return {
|
|
21
|
+
src: dom.getAttribute('src'),
|
|
22
|
+
title: dom.getAttribute('title'),
|
|
23
|
+
alt: dom.getAttribute('alt'),
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
toDOM(node) {
|
|
29
|
+
const { src, alt, title } = node.attrs;
|
|
30
|
+
return ['iframe', { src, alt, title, class: node.attrs.class }];
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=NodeIframe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeIframe.js","sourceRoot":"","sources":["../src/NodeIframe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,MAAM,OAAO,UAAW,SAAQ,IAAI;IACzB,IAAI,GAAG,QAAQ,CAAC;IACzB,QAAQ,GAAG,CAAC,KAAK,CAAC,CAAC;IAEV,WAAW;QAClB,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE;gBACL,GAAG,EAAE,EAAE;gBACP,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBACxB,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBACtB,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;aACzB;YACD,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,aAAa;oBAClB,QAAQ,CAAC,GAAgB;wBACvB,OAAO;4BACL,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC;4BAC5B,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC;4BAChC,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC;yBAC7B,CAAC;oBACJ,CAAC;iBACF;aACF;YACD,KAAK,CAAC,IAAI;gBACR,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;gBACvC,OAAO,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;YAClE,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
package/esm/NodeImage.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type NodeSpec } from 'prosemirror-model';
|
|
2
|
+
import type { NodeViewConstructor } from 'prosemirror-view';
|
|
2
3
|
import { Node } from '@kerebron/editor';
|
|
4
|
+
import type { CoreEditor } from '@kerebron/editor';
|
|
3
5
|
export declare class NodeImage extends Node {
|
|
4
6
|
name: string;
|
|
5
7
|
requires: string[];
|
|
6
8
|
getNodeSpec(): NodeSpec;
|
|
9
|
+
getNodeView(editor: CoreEditor): NodeViewConstructor;
|
|
7
10
|
}
|
|
8
11
|
//# sourceMappingURL=NodeImage.d.ts.map
|
package/esm/NodeImage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeImage.d.ts","sourceRoot":"","sources":["../src/NodeImage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"NodeImage.d.ts","sourceRoot":"","sources":["../src/NodeImage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAc,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,qBAAa,SAAU,SAAQ,IAAI;IACxB,IAAI,SAAW;IACxB,QAAQ,WAAW;IAEV,WAAW,IAAI,QAAQ;IAsCvB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,mBAAmB;CAkM9D"}
|
package/esm/NodeImage.js
CHANGED
|
@@ -9,6 +9,8 @@ export class NodeImage extends Node {
|
|
|
9
9
|
src: {},
|
|
10
10
|
alt: { default: null },
|
|
11
11
|
title: { default: null },
|
|
12
|
+
width: { default: null },
|
|
13
|
+
height: { default: null },
|
|
12
14
|
},
|
|
13
15
|
group: 'inline',
|
|
14
16
|
draggable: true,
|
|
@@ -20,15 +22,201 @@ export class NodeImage extends Node {
|
|
|
20
22
|
src: dom.getAttribute('src'),
|
|
21
23
|
title: dom.getAttribute('title'),
|
|
22
24
|
alt: dom.getAttribute('alt'),
|
|
25
|
+
width: dom.getAttribute('width') || dom.style.width || null,
|
|
26
|
+
height: dom.getAttribute('height') || dom.style.height || null,
|
|
23
27
|
};
|
|
24
28
|
},
|
|
25
29
|
},
|
|
26
30
|
],
|
|
27
31
|
toDOM(node) {
|
|
28
|
-
const { src, alt, title } = node.attrs;
|
|
29
|
-
|
|
32
|
+
const { src, alt, title, width, height } = node.attrs;
|
|
33
|
+
const attrs = { src };
|
|
34
|
+
if (alt)
|
|
35
|
+
attrs.alt = alt;
|
|
36
|
+
if (title)
|
|
37
|
+
attrs.title = title;
|
|
38
|
+
if (width)
|
|
39
|
+
attrs.width = width;
|
|
40
|
+
if (height)
|
|
41
|
+
attrs.height = height;
|
|
42
|
+
return ['img', attrs];
|
|
30
43
|
},
|
|
31
44
|
};
|
|
32
45
|
}
|
|
46
|
+
getNodeView(editor) {
|
|
47
|
+
return (node, view, getPos) => {
|
|
48
|
+
// Create wrapper div for the image with resize handles
|
|
49
|
+
const wrapper = document.createElement('span');
|
|
50
|
+
wrapper.className = 'kb-image-wrapper';
|
|
51
|
+
wrapper.contentEditable = 'false';
|
|
52
|
+
// Create the image element
|
|
53
|
+
const img = document.createElement('img');
|
|
54
|
+
img.src = node.attrs.src;
|
|
55
|
+
if (node.attrs.alt)
|
|
56
|
+
img.alt = node.attrs.alt;
|
|
57
|
+
if (node.attrs.title)
|
|
58
|
+
img.title = node.attrs.title;
|
|
59
|
+
if (node.attrs.width) {
|
|
60
|
+
img.style.width = typeof node.attrs.width === 'number'
|
|
61
|
+
? `${node.attrs.width}px`
|
|
62
|
+
: node.attrs.width;
|
|
63
|
+
}
|
|
64
|
+
if (node.attrs.height) {
|
|
65
|
+
img.style.height = typeof node.attrs.height === 'number'
|
|
66
|
+
? `${node.attrs.height}px`
|
|
67
|
+
: node.attrs.height;
|
|
68
|
+
}
|
|
69
|
+
img.draggable = false;
|
|
70
|
+
wrapper.appendChild(img);
|
|
71
|
+
// Create resize handles
|
|
72
|
+
const positions = ['nw', 'ne', 'sw', 'se'];
|
|
73
|
+
const handles = [];
|
|
74
|
+
for (const pos of positions) {
|
|
75
|
+
const handle = document.createElement('span');
|
|
76
|
+
handle.className =
|
|
77
|
+
`kb-image-resize-handle kb-image-resize-handle-${pos}`;
|
|
78
|
+
handle.dataset.position = pos;
|
|
79
|
+
handles.push(handle);
|
|
80
|
+
wrapper.appendChild(handle);
|
|
81
|
+
}
|
|
82
|
+
let isResizing = false;
|
|
83
|
+
let startX = 0;
|
|
84
|
+
let startY = 0;
|
|
85
|
+
let startWidth = 0;
|
|
86
|
+
let startHeight = 0;
|
|
87
|
+
let aspectRatio = 1;
|
|
88
|
+
let activeHandle = null;
|
|
89
|
+
const onMouseDown = (e) => {
|
|
90
|
+
const target = e.target;
|
|
91
|
+
if (!target.classList.contains('kb-image-resize-handle'))
|
|
92
|
+
return;
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
isResizing = true;
|
|
96
|
+
activeHandle = target.dataset.position || null;
|
|
97
|
+
startX = e.clientX;
|
|
98
|
+
startY = e.clientY;
|
|
99
|
+
const rect = img.getBoundingClientRect();
|
|
100
|
+
startWidth = rect.width;
|
|
101
|
+
startHeight = rect.height;
|
|
102
|
+
aspectRatio = startWidth / startHeight;
|
|
103
|
+
wrapper.classList.add('kb-image-resizing');
|
|
104
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
105
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
106
|
+
};
|
|
107
|
+
const onMouseMove = (e) => {
|
|
108
|
+
if (!isResizing)
|
|
109
|
+
return;
|
|
110
|
+
const deltaX = e.clientX - startX;
|
|
111
|
+
const deltaY = e.clientY - startY;
|
|
112
|
+
let newWidth = startWidth;
|
|
113
|
+
let newHeight = startHeight;
|
|
114
|
+
// Calculate new dimensions based on which handle is being dragged
|
|
115
|
+
switch (activeHandle) {
|
|
116
|
+
case 'se':
|
|
117
|
+
newWidth = startWidth + deltaX;
|
|
118
|
+
newHeight = e.shiftKey
|
|
119
|
+
? startHeight + deltaY
|
|
120
|
+
: newWidth / aspectRatio;
|
|
121
|
+
break;
|
|
122
|
+
case 'sw':
|
|
123
|
+
newWidth = startWidth - deltaX;
|
|
124
|
+
newHeight = e.shiftKey
|
|
125
|
+
? startHeight + deltaY
|
|
126
|
+
: newWidth / aspectRatio;
|
|
127
|
+
break;
|
|
128
|
+
case 'ne':
|
|
129
|
+
newWidth = startWidth + deltaX;
|
|
130
|
+
newHeight = e.shiftKey
|
|
131
|
+
? startHeight - deltaY
|
|
132
|
+
: newWidth / aspectRatio;
|
|
133
|
+
break;
|
|
134
|
+
case 'nw':
|
|
135
|
+
newWidth = startWidth - deltaX;
|
|
136
|
+
newHeight = e.shiftKey
|
|
137
|
+
? startHeight - deltaY
|
|
138
|
+
: newWidth / aspectRatio;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
// Ensure minimum size
|
|
142
|
+
newWidth = Math.max(50, newWidth);
|
|
143
|
+
newHeight = Math.max(50, newHeight);
|
|
144
|
+
img.style.width = `${Math.round(newWidth)}px`;
|
|
145
|
+
img.style.height = `${Math.round(newHeight)}px`;
|
|
146
|
+
};
|
|
147
|
+
const onMouseUp = () => {
|
|
148
|
+
if (!isResizing)
|
|
149
|
+
return;
|
|
150
|
+
isResizing = false;
|
|
151
|
+
activeHandle = null;
|
|
152
|
+
wrapper.classList.remove('kb-image-resizing');
|
|
153
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
154
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
155
|
+
// Get the new dimensions and update the node
|
|
156
|
+
const newWidth = Math.round(img.getBoundingClientRect().width);
|
|
157
|
+
const newHeight = Math.round(img.getBoundingClientRect().height);
|
|
158
|
+
const pos = getPos();
|
|
159
|
+
if (typeof pos === 'number') {
|
|
160
|
+
const tr = view.state.tr.setNodeMarkup(pos, undefined, {
|
|
161
|
+
...node.attrs,
|
|
162
|
+
width: `${newWidth}px`,
|
|
163
|
+
height: `${newHeight}px`,
|
|
164
|
+
});
|
|
165
|
+
view.dispatch(tr);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
wrapper.addEventListener('mousedown', onMouseDown);
|
|
169
|
+
// Add click handler to select the image
|
|
170
|
+
wrapper.addEventListener('click', (e) => {
|
|
171
|
+
e.preventDefault();
|
|
172
|
+
const pos = getPos();
|
|
173
|
+
if (typeof pos === 'number') {
|
|
174
|
+
const $pos = view.state.doc.resolve(pos);
|
|
175
|
+
const selection = view.state.selection.constructor.near($pos);
|
|
176
|
+
view.dispatch(view.state.tr.setSelection(selection));
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
return {
|
|
180
|
+
dom: wrapper,
|
|
181
|
+
update: (updatedNode) => {
|
|
182
|
+
if (updatedNode.type.name !== 'image')
|
|
183
|
+
return false;
|
|
184
|
+
img.src = updatedNode.attrs.src;
|
|
185
|
+
if (updatedNode.attrs.alt)
|
|
186
|
+
img.alt = updatedNode.attrs.alt;
|
|
187
|
+
if (updatedNode.attrs.title)
|
|
188
|
+
img.title = updatedNode.attrs.title;
|
|
189
|
+
if (updatedNode.attrs.width) {
|
|
190
|
+
img.style.width = typeof updatedNode.attrs.width === 'number'
|
|
191
|
+
? `${updatedNode.attrs.width}px`
|
|
192
|
+
: updatedNode.attrs.width;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
img.style.width = '';
|
|
196
|
+
}
|
|
197
|
+
if (updatedNode.attrs.height) {
|
|
198
|
+
img.style.height = typeof updatedNode.attrs.height === 'number'
|
|
199
|
+
? `${updatedNode.attrs.height}px`
|
|
200
|
+
: updatedNode.attrs.height;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
img.style.height = '';
|
|
204
|
+
}
|
|
205
|
+
return true;
|
|
206
|
+
},
|
|
207
|
+
destroy: () => {
|
|
208
|
+
wrapper.removeEventListener('mousedown', onMouseDown);
|
|
209
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
210
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
211
|
+
},
|
|
212
|
+
stopEvent: (event) => {
|
|
213
|
+
// Allow selection events to pass through
|
|
214
|
+
return event.type === 'mousedown' &&
|
|
215
|
+
event.target.classList.contains('kb-image-resize-handle');
|
|
216
|
+
},
|
|
217
|
+
ignoreMutation: () => true,
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
}
|
|
33
221
|
}
|
|
34
222
|
//# sourceMappingURL=NodeImage.js.map
|
package/esm/NodeImage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeImage.js","sourceRoot":"","sources":["../src/NodeImage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeImage.js","sourceRoot":"","sources":["../src/NodeImage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGxC,MAAM,OAAO,SAAU,SAAQ,IAAI;IACxB,IAAI,GAAG,OAAO,CAAC;IACxB,QAAQ,GAAG,CAAC,KAAK,CAAC,CAAC;IAEV,WAAW;QAClB,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE;gBACL,GAAG,EAAE,EAAE;gBACP,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBACtB,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBACxB,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBACxB,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;aAC1B;YACD,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,UAAU;oBACf,QAAQ,CAAC,GAAgB;wBACvB,OAAO;4BACL,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC;4BAC5B,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC;4BAChC,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC;4BAC5B,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI;4BAC3D,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI;yBAC/D,CAAC;oBACJ,CAAC;iBACF;aACF;YACD,KAAK,CAAC,IAAI;gBACR,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EA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AM,IAAI;4BACjC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC;oBAC/B,CAAC;yBAAM,CAAC;wBACN,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;oBACxB,CAAC;oBAED,OAAO,IAAI,CAAC;gBACd,CAAC;gBACD,OAAO,EAAE,GAAG,EAAE;oBACZ,OAAO,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;oBACtD,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;oBACvD,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;gBACrD,CAAC;gBACD,SAAS,EAAE,CAAC,KAAY,EAAE,EAAE;oBAC1B,yCAAyC;oBACzC,OAAO,KAAK,CAAC,IAAI,KAAK,WAAW;wBAC9B,KAAK,CAAC,MAAsB,CAAC,SAAS,CAAC,QAAQ,CAC9C,wBAAwB,CACzB,CAAC;gBACN,CAAC;gBACD,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI;aAC3B,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { NodeSpec, NodeType } from 'prosemirror-model';
|
|
2
2
|
import { Node } from '@kerebron/editor';
|
|
3
3
|
import { type InputRule } from '@kerebron/editor/plugins/input-rules';
|
|
4
|
+
import { CoreEditor } from '@kerebron/editor';
|
|
5
|
+
import { CommandFactories } from '@kerebron/editor';
|
|
4
6
|
export declare function fixCharacters(text: string): string;
|
|
5
7
|
export declare class NodeInlineShortCode extends Node {
|
|
6
8
|
name: string;
|
|
7
9
|
requires: string[];
|
|
8
10
|
getNodeSpec(): NodeSpec;
|
|
9
11
|
getInputRules(type: NodeType): InputRule[];
|
|
12
|
+
getCommandFactories(editor: CoreEditor, type: NodeType): Partial<CommandFactories>;
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=NodeInlineShortCode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeInlineShortCode.d.ts","sourceRoot":"","sources":["../src/NodeInlineShortCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"NodeInlineShortCode.d.ts","sourceRoot":"","sources":["../src/NodeInlineShortCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,QAAQ,EAAU,MAAM,mBAAmB,CAAC;AAG/E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,UASzC;AA6BD,qBAAa,mBAAoB,SAAQ,IAAI;IAClC,IAAI,SAAsB;IACnC,QAAQ,WAAW;IAEV,WAAW,IAAI,QAAQ;IAyBvB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE;IAe1C,mBAAmB,CAC1B,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,gBAAgB,CAAC;CAsB7B"}
|