@progress/kendo-vue-editor 2.7.1-dev.202112201220 → 2.7.2
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/es/Editor.d.ts +295 -0
- package/dist/es/Editor.js +697 -0
- package/dist/es/EditorProps.d.ts +176 -0
- package/dist/es/EditorProps.js +0 -0
- package/dist/es/additionalTypes.ts +3 -0
- package/dist/es/config/defaultStyles.d.ts +12 -0
- package/dist/es/config/defaultStyles.js +12 -0
- package/dist/es/config/pasteSettings.d.ts +6 -0
- package/dist/es/config/pasteSettings.js +0 -0
- package/dist/es/config/schema.d.ts +8 -0
- package/dist/es/config/schema.js +51 -0
- package/dist/es/config/shortcuts.d.ts +22 -0
- package/dist/es/config/shortcuts.js +70 -0
- package/dist/es/config/toolsSettings.d.ts +481 -0
- package/dist/es/config/toolsSettings.js +523 -0
- package/dist/es/dialogs/EditorDialogProps.d.ts +26 -0
- package/dist/es/dialogs/EditorDialogProps.js +0 -0
- package/dist/es/dialogs/FindReplace.d.ts +65 -0
- package/dist/es/dialogs/FindReplace.js +789 -0
- package/dist/es/dialogs/insertImage.d.ts +52 -0
- package/dist/es/dialogs/insertImage.js +282 -0
- package/dist/es/dialogs/insertLink.d.ts +50 -0
- package/dist/es/dialogs/insertLink.js +286 -0
- package/dist/es/dialogs/main.d.ts +1 -0
- package/dist/es/dialogs/main.js +42 -0
- package/dist/es/dialogs/viewHtml.d.ts +49 -0
- package/dist/es/dialogs/viewHtml.js +144 -0
- package/dist/es/main.d.ts +166 -1
- package/dist/es/main.js +110 -0
- package/dist/es/messages/index.d.ts +479 -0
- package/dist/es/messages/index.js +485 -0
- package/dist/es/package-metadata.d.ts +5 -0
- package/dist/es/package-metadata.js +11 -0
- package/dist/es/tools/Align.d.ts +37 -0
- package/dist/es/tools/Align.js +116 -0
- package/dist/es/tools/Indent.d.ts +42 -0
- package/dist/es/tools/Indent.js +127 -0
- package/dist/es/tools/InlineFormat.d.ts +72 -0
- package/dist/es/tools/InlineFormat.js +125 -0
- package/dist/es/tools/Outdent.d.ts +42 -0
- package/dist/es/tools/Outdent.js +129 -0
- package/dist/es/tools/ToolProps.d.ts +34 -0
- package/dist/es/tools/ToolProps.js +0 -0
- package/dist/es/tools/applyColor.d.ts +43 -0
- package/dist/es/tools/applyColor.js +92 -0
- package/dist/es/tools/cleanFormatting.d.ts +47 -0
- package/dist/es/tools/cleanFormatting.js +114 -0
- package/dist/es/tools/findReplace.d.ts +41 -0
- package/dist/es/tools/findReplace.js +119 -0
- package/dist/es/tools/fontStyle.d.ts +53 -0
- package/dist/es/tools/fontStyle.js +158 -0
- package/dist/es/tools/formatBlock.d.ts +43 -0
- package/dist/es/tools/formatBlock.js +150 -0
- package/dist/es/tools/history.d.ts +18 -0
- package/dist/es/tools/history.js +4 -0
- package/dist/es/tools/insertImage.d.ts +44 -0
- package/dist/es/tools/insertImage.js +130 -0
- package/dist/es/tools/insertLink.d.ts +44 -0
- package/dist/es/tools/insertLink.js +130 -0
- package/dist/es/tools/insertTable/index.d.ts +1 -0
- package/dist/es/tools/insertTable/index.js +6 -0
- package/dist/es/tools/insertTable/popup.d.ts +78 -0
- package/dist/es/tools/insertTable/popup.js +168 -0
- package/dist/es/tools/insertTable/popupGrid.d.ts +49 -0
- package/dist/es/tools/insertTable/popupGrid.js +131 -0
- package/dist/es/tools/insertTable/tool.d.ts +51 -0
- package/dist/es/tools/insertTable/tool.js +165 -0
- package/dist/es/tools/lists.d.ts +52 -0
- package/dist/es/tools/lists.js +132 -0
- package/dist/es/tools/main.d.ts +137 -0
- package/dist/es/tools/main.js +0 -0
- package/dist/es/tools/pdf.d.ts +56 -0
- package/dist/es/tools/pdf.js +105 -0
- package/dist/es/tools/print.d.ts +47 -0
- package/dist/es/tools/print.js +109 -0
- package/dist/es/tools/proseMirrorTool.d.ts +43 -0
- package/dist/es/tools/proseMirrorTool.js +110 -0
- package/dist/es/tools/selectAll.d.ts +47 -0
- package/dist/es/tools/selectAll.js +102 -0
- package/dist/es/tools/tableEdit.d.ts +51 -0
- package/dist/es/tools/tableEdit.js +42 -0
- package/dist/es/tools/unlink.d.ts +42 -0
- package/dist/es/tools/unlink.js +110 -0
- package/dist/es/tools/utils.d.ts +18 -0
- package/dist/es/tools/utils.js +36 -0
- package/dist/es/tools/viewHtml.d.ts +49 -0
- package/dist/es/tools/viewHtml.js +125 -0
- package/dist/es/utils/browser-detection.d.ts +4 -0
- package/dist/es/utils/browser-detection.js +5 -0
- package/dist/es/utils/controlled-value.d.ts +5 -0
- package/dist/es/utils/controlled-value.js +31 -0
- package/dist/es/utils/index.d.ts +358 -0
- package/dist/es/utils/index.js +422 -0
- package/dist/es/utils/props-key.d.ts +5 -0
- package/dist/es/utils/props-key.js +5 -0
- package/dist/npm/Editor.d.ts +295 -0
- package/dist/npm/Editor.js +738 -0
- package/dist/npm/EditorProps.d.ts +176 -0
- package/dist/npm/EditorProps.js +2 -0
- package/dist/npm/additionalTypes.ts +3 -0
- package/dist/npm/config/defaultStyles.d.ts +12 -0
- package/dist/npm/config/defaultStyles.js +15 -0
- package/dist/npm/config/pasteSettings.d.ts +6 -0
- package/dist/npm/config/pasteSettings.js +2 -0
- package/dist/npm/config/schema.d.ts +8 -0
- package/dist/npm/config/schema.js +55 -0
- package/dist/npm/config/shortcuts.d.ts +22 -0
- package/dist/npm/config/shortcuts.js +79 -0
- package/dist/npm/config/toolsSettings.d.ts +481 -0
- package/dist/npm/config/toolsSettings.js +526 -0
- package/dist/npm/dialogs/EditorDialogProps.d.ts +26 -0
- package/dist/npm/dialogs/EditorDialogProps.js +2 -0
- package/dist/npm/dialogs/FindReplace.d.ts +65 -0
- package/dist/npm/dialogs/FindReplace.js +805 -0
- package/dist/npm/dialogs/insertImage.d.ts +52 -0
- package/dist/npm/dialogs/insertImage.js +296 -0
- package/dist/npm/dialogs/insertLink.d.ts +50 -0
- package/dist/npm/dialogs/insertLink.js +300 -0
- package/dist/npm/dialogs/main.d.ts +1 -0
- package/dist/npm/dialogs/main.js +42 -0
- package/dist/npm/dialogs/viewHtml.d.ts +49 -0
- package/dist/npm/dialogs/viewHtml.js +159 -0
- package/dist/npm/main.d.ts +166 -1
- package/dist/npm/main.js +89 -0
- package/dist/npm/messages/index.d.ts +479 -0
- package/dist/npm/messages/index.js +488 -0
- package/dist/npm/package-metadata.d.ts +5 -0
- package/dist/npm/package-metadata.js +14 -0
- package/dist/npm/tools/Align.d.ts +37 -0
- package/dist/npm/tools/Align.js +130 -0
- package/dist/npm/tools/Indent.d.ts +42 -0
- package/dist/npm/tools/Indent.js +140 -0
- package/dist/npm/tools/InlineFormat.d.ts +72 -0
- package/dist/npm/tools/InlineFormat.js +138 -0
- package/dist/npm/tools/Outdent.d.ts +42 -0
- package/dist/npm/tools/Outdent.js +142 -0
- package/dist/npm/tools/ToolProps.d.ts +34 -0
- package/dist/npm/tools/ToolProps.js +2 -0
- package/dist/npm/tools/applyColor.d.ts +43 -0
- package/dist/npm/tools/applyColor.js +105 -0
- package/dist/npm/tools/cleanFormatting.d.ts +47 -0
- package/dist/npm/tools/cleanFormatting.js +128 -0
- package/dist/npm/tools/findReplace.d.ts +41 -0
- package/dist/npm/tools/findReplace.js +133 -0
- package/dist/npm/tools/fontStyle.d.ts +53 -0
- package/dist/npm/tools/fontStyle.js +172 -0
- package/dist/npm/tools/formatBlock.d.ts +43 -0
- package/dist/npm/tools/formatBlock.js +164 -0
- package/dist/npm/tools/history.d.ts +18 -0
- package/dist/npm/tools/history.js +10 -0
- package/dist/npm/tools/insertImage.d.ts +44 -0
- package/dist/npm/tools/insertImage.js +144 -0
- package/dist/npm/tools/insertLink.d.ts +44 -0
- package/dist/npm/tools/insertLink.js +144 -0
- package/dist/npm/tools/insertTable/index.d.ts +1 -0
- package/dist/npm/tools/insertTable/index.js +6 -0
- package/dist/npm/tools/insertTable/popup.d.ts +78 -0
- package/dist/npm/tools/insertTable/popup.js +179 -0
- package/dist/npm/tools/insertTable/popupGrid.d.ts +49 -0
- package/dist/npm/tools/insertTable/popupGrid.js +141 -0
- package/dist/npm/tools/insertTable/tool.d.ts +51 -0
- package/dist/npm/tools/insertTable/tool.js +180 -0
- package/dist/npm/tools/lists.d.ts +52 -0
- package/dist/npm/tools/lists.js +145 -0
- package/dist/npm/tools/main.d.ts +137 -0
- package/dist/npm/tools/main.js +5 -0
- package/dist/npm/tools/pdf.d.ts +56 -0
- package/dist/npm/tools/pdf.js +119 -0
- package/dist/npm/tools/print.d.ts +47 -0
- package/dist/npm/tools/print.js +122 -0
- package/dist/npm/tools/proseMirrorTool.d.ts +43 -0
- package/dist/npm/tools/proseMirrorTool.js +123 -0
- package/dist/npm/tools/selectAll.d.ts +47 -0
- package/dist/npm/tools/selectAll.js +116 -0
- package/dist/npm/tools/tableEdit.d.ts +51 -0
- package/dist/npm/tools/tableEdit.js +50 -0
- package/dist/npm/tools/unlink.d.ts +42 -0
- package/dist/npm/tools/unlink.js +123 -0
- package/dist/npm/tools/utils.d.ts +18 -0
- package/dist/npm/tools/utils.js +45 -0
- package/dist/npm/tools/viewHtml.d.ts +49 -0
- package/dist/npm/tools/viewHtml.js +138 -0
- package/dist/npm/utils/browser-detection.d.ts +4 -0
- package/dist/npm/utils/browser-detection.js +8 -0
- package/dist/npm/utils/controlled-value.d.ts +5 -0
- package/dist/npm/utils/controlled-value.js +34 -0
- package/dist/npm/utils/index.d.ts +358 -0
- package/dist/npm/utils/index.js +425 -0
- package/dist/npm/utils/props-key.d.ts +5 -0
- package/dist/npm/utils/props-key.js +8 -0
- package/package.json +20 -20
- package/dist/cdn/js/kendo-vue-editor.js +0 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/// <reference types="prosemirror-model" />
|
|
2
|
+
import { EditorState, Plugin, Transaction, EditorView, Schema, Node } from '@progress/kendo-editor-common';
|
|
3
|
+
import { EditorUtils } from './utils';
|
|
4
|
+
interface EditorEvent {
|
|
5
|
+
/**
|
|
6
|
+
* An event target.
|
|
7
|
+
*/
|
|
8
|
+
target: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Represents the object of the `onChange` Editor event.
|
|
12
|
+
*/
|
|
13
|
+
export interface EditorChangeEvent extends EditorEvent {
|
|
14
|
+
/**
|
|
15
|
+
* Represents the [Editor document](https://prosemirror.net/docs/guide/#doc).
|
|
16
|
+
*/
|
|
17
|
+
value: Node;
|
|
18
|
+
/**
|
|
19
|
+
* A getter of the Editor HTML content.
|
|
20
|
+
* Once called, it will convert the Editor document into HTML string.
|
|
21
|
+
* Note that, since onChange event is triggered on every key while typing,
|
|
22
|
+
* this conversion may not be suitable if the Editor is dealing with large amount of content.
|
|
23
|
+
*/
|
|
24
|
+
html: string;
|
|
25
|
+
/**
|
|
26
|
+
* The Editor Schema object.
|
|
27
|
+
*/
|
|
28
|
+
schema: Schema;
|
|
29
|
+
/**
|
|
30
|
+
* The Transaction which causes the change.
|
|
31
|
+
*/
|
|
32
|
+
transaction: Transaction;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Represents the object of the `onMount` Editor event.
|
|
36
|
+
*/
|
|
37
|
+
export interface EditorMountEvent extends EditorEvent {
|
|
38
|
+
/**
|
|
39
|
+
* The content-editable DOM element of the Editor.
|
|
40
|
+
*/
|
|
41
|
+
dom: HTMLDivElement;
|
|
42
|
+
/**
|
|
43
|
+
* The default plugins collection of the Editor.
|
|
44
|
+
*/
|
|
45
|
+
plugins: Array<Plugin>;
|
|
46
|
+
/**
|
|
47
|
+
* The default key bindings of the Editor.
|
|
48
|
+
*/
|
|
49
|
+
shortcuts: EditorUtils.Shortcuts;
|
|
50
|
+
/**
|
|
51
|
+
* The default [viewProps](https://prosemirror.net/docs/ref/#view.DirectEditorProps) object of the Editor.
|
|
52
|
+
*/
|
|
53
|
+
viewProps: {
|
|
54
|
+
state: EditorState;
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Represents the object of the `onPaste` Editor event.
|
|
60
|
+
*/
|
|
61
|
+
export interface EditorPasteEvent extends EditorEvent {
|
|
62
|
+
/**
|
|
63
|
+
* The HTML that will be pasted in the Editor.
|
|
64
|
+
*/
|
|
65
|
+
pastedHtml: string;
|
|
66
|
+
/**
|
|
67
|
+
* The native paste event.
|
|
68
|
+
*/
|
|
69
|
+
nativeEvent: ClipboardEvent;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Represents the object of the `onExecute` Editor event.
|
|
73
|
+
*/
|
|
74
|
+
export interface EditorExecuteEvent extends EditorEvent {
|
|
75
|
+
/**
|
|
76
|
+
* The transaction that will be executed.
|
|
77
|
+
*/
|
|
78
|
+
transaction: Transaction;
|
|
79
|
+
/**
|
|
80
|
+
* The state of the Editor.
|
|
81
|
+
*/
|
|
82
|
+
state: EditorState;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Represents the object of the `onFocus` Editor event.
|
|
86
|
+
*/
|
|
87
|
+
export interface EditorFocusEvent extends EditorEvent {
|
|
88
|
+
/**
|
|
89
|
+
* The native focus event.
|
|
90
|
+
*/
|
|
91
|
+
nativeEvent: FocusEvent;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Represents the object of the `onBlur` Editor event.
|
|
95
|
+
*/
|
|
96
|
+
export interface EditorBlurEvent extends EditorEvent {
|
|
97
|
+
/**
|
|
98
|
+
* The native blur event.
|
|
99
|
+
*/
|
|
100
|
+
nativeEvent: FocusEvent;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Represents the props of the [Kendo UI for Vue Editor component]({% slug overview_editor %}).
|
|
104
|
+
*/
|
|
105
|
+
export interface EditorProps {
|
|
106
|
+
/**
|
|
107
|
+
* Sets the default HTML content of the Editor.
|
|
108
|
+
*/
|
|
109
|
+
defaultContent?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Sets the initial edit mode of the Editor. Defaults to `iframe`.
|
|
112
|
+
*/
|
|
113
|
+
defaultEditMode?: 'iframe' | 'div' | string;
|
|
114
|
+
/**
|
|
115
|
+
* Sets styles to the content element wrapper of the Editor.
|
|
116
|
+
*/
|
|
117
|
+
contentStyle?: object;
|
|
118
|
+
/**
|
|
119
|
+
* Represents the `dir` HTML attribute.
|
|
120
|
+
*/
|
|
121
|
+
dir?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Specifies if the Editor will be resizable.
|
|
124
|
+
*/
|
|
125
|
+
resizable?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Sets the tools of the Editor. By default, the Editor renders no tools.
|
|
128
|
+
*/
|
|
129
|
+
tools?: Array<any>;
|
|
130
|
+
/**
|
|
131
|
+
* Fires each time the Editor is about to mount.
|
|
132
|
+
* Useful for configuring the `EditorView` object.
|
|
133
|
+
* To initialize `EditorView`, use the properties of the `event` object.
|
|
134
|
+
*/
|
|
135
|
+
onMount?: (event: EditorMountEvent) => EditorView | void;
|
|
136
|
+
/**
|
|
137
|
+
* Fires each time the Editor is about to insert pasted content.
|
|
138
|
+
* Useful for modifying pasted content.
|
|
139
|
+
*/
|
|
140
|
+
onPastehtml?: (event: EditorPasteEvent) => string | void;
|
|
141
|
+
/**
|
|
142
|
+
* Fires each time the Editor is about to apply a transaction.
|
|
143
|
+
* To prevent the transaction, return `false`.
|
|
144
|
+
*/
|
|
145
|
+
onExecute?: (event: EditorExecuteEvent) => boolean | void;
|
|
146
|
+
/**
|
|
147
|
+
* Fires when the Editor's content element has received focus.
|
|
148
|
+
*/
|
|
149
|
+
onFocus?: (event: EditorFocusEvent) => void;
|
|
150
|
+
/**
|
|
151
|
+
* Fires when the Editor's content element has lost focus.
|
|
152
|
+
*/
|
|
153
|
+
onBlur?: (event: EditorBlurEvent) => void;
|
|
154
|
+
/**
|
|
155
|
+
* Fires each time the value of the Editor is about to change.
|
|
156
|
+
*/
|
|
157
|
+
onChange?: (event: EditorChangeEvent) => void;
|
|
158
|
+
/**
|
|
159
|
+
* The value of the Editor.
|
|
160
|
+
*/
|
|
161
|
+
value?: Node | string;
|
|
162
|
+
/**
|
|
163
|
+
* If set to `false`, it will turn off the built-in keyboard navigation of the Editor's Toolbar.
|
|
164
|
+
*/
|
|
165
|
+
keyboardNavigation?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Defines the options that will be used for parsing the HTML.
|
|
168
|
+
* If `false` is set, the whitespace is collapsed as per HTML's rules.
|
|
169
|
+
* Pass `true` to preserve whitespace, but normalize newlines to spaces.
|
|
170
|
+
* `full` will preserve whitespace entirely.
|
|
171
|
+
*
|
|
172
|
+
* Defaults to `full`.
|
|
173
|
+
*/
|
|
174
|
+
preserveWhitespace?: boolean | 'full' | string;
|
|
175
|
+
}
|
|
176
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export declare const defaultStyle = "\nhtml, body {\n margin: 0;\n height: 100%;\n padding: 0;\n}\n\nhtml {\n min-height: 100%;\n}\n\nbody {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n}\n\nbody > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n}\n\n.k-content > p {\n margin: 0 0 1em;\n}\n\n.k-content table {\n white-space: pre-wrap;\n}\n\n.k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n}\n\n.k-content .k-text-highlighted {\n background-color: #bbdefb;\n}\n\n.k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n}\n\n.ProseMirror-hideselection *::selection { background: transparent; }\n.ProseMirror-hideselection *::-moz-selection { background: transparent; }\n.ProseMirror-hideselection { caret-color: transparent; }\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n}\n\n.k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n}\n\n.k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n}\n\n.k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n}\n\n.k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n}\n\n.k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n}\n\n.k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n}\n\n.k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n}\n\n.k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n}\n\n.k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n}\n";
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export declare const tablesStyles = "\n .ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n }\n\n .ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n }\n\n .ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n }\n\n .ProseMirror th {\n font-weight: bold;\n text-align: left;\n }\n\n .ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px; top: 0; bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n }\n\n .ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n }\n\n /* Give selected cells a blue overlay */\n .ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: \"\";\n left: 0; right: 0; top: 0; bottom: 0;\n background: rgba(200, 200, 255, 0.4);\n pointer-events: none;\n }\n";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const rtlStyles = "body { direction: rtl }";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export var defaultStyle = "\nhtml, body {\n margin: 0;\n height: 100%;\n padding: 0;\n}\n\nhtml {\n min-height: 100%;\n}\n\nbody {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n}\n\nbody > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n}\n\n.k-content > p {\n margin: 0 0 1em;\n}\n\n.k-content table {\n white-space: pre-wrap;\n}\n\n.k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n}\n\n.k-content .k-text-highlighted {\n background-color: #bbdefb;\n}\n\n.k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n}\n\n.ProseMirror-hideselection *::selection { background: transparent; }\n.ProseMirror-hideselection *::-moz-selection { background: transparent; }\n.ProseMirror-hideselection { caret-color: transparent; }\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n}\n\n.k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n}\n\n.k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n}\n\n.k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n}\n\n.k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n}\n\n.k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n}\n\n.k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n}\n\n.k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n}\n\n.k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n}\n\n.k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n}\n";
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export var tablesStyles = "\n .ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n }\n\n .ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n }\n\n .ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n }\n\n .ProseMirror th {\n font-weight: bold;\n text-align: left;\n }\n\n .ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px; top: 0; bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n }\n\n .ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n }\n\n /* Give selected cells a blue overlay */\n .ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: \"\";\n left: 0; right: 0; top: 0; bottom: 0;\n background: rgba(200, 200, 255, 0.4);\n pointer-events: none;\n }\n";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export var rtlStyles = 'body { direction: rtl }';
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { marks } from '@progress/kendo-editor-common';
|
|
2
|
+
declare const nodes: {
|
|
3
|
+
table: import("prosemirror-model").NodeSpec;
|
|
4
|
+
table_row: import("prosemirror-model").NodeSpec;
|
|
5
|
+
table_cell: import("prosemirror-model").NodeSpec;
|
|
6
|
+
table_header: import("prosemirror-model").NodeSpec;
|
|
7
|
+
};
|
|
8
|
+
export { marks, nodes };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { marks, nodes as commonNodes, tableNodes } from '@progress/kendo-editor-common';
|
|
13
|
+
var cellAttribute = function (name) {
|
|
14
|
+
var _a;
|
|
15
|
+
return _a = {},
|
|
16
|
+
_a[name] = {
|
|
17
|
+
default: null,
|
|
18
|
+
getFromDOM: function (cell) {
|
|
19
|
+
return cell.getAttribute(name);
|
|
20
|
+
},
|
|
21
|
+
setDOMAttr: function (value, attrs) {
|
|
22
|
+
attrs[name] = value;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
_a;
|
|
26
|
+
};
|
|
27
|
+
var getAttrs = function (node) {
|
|
28
|
+
var attrs = {};
|
|
29
|
+
Array.from(node.attributes).forEach(function (attr) {
|
|
30
|
+
attrs[attr.nodeName] = attr.nodeValue;
|
|
31
|
+
});
|
|
32
|
+
return attrs;
|
|
33
|
+
};
|
|
34
|
+
var cellAttributes = __assign(__assign(__assign({}, cellAttribute('style')), cellAttribute('class')), cellAttribute('id'));
|
|
35
|
+
var tNodes = tableNodes({ tableGroup: 'block', cellContent: 'block+', cellAttributes: cellAttributes });
|
|
36
|
+
tNodes.table_row.attrs = tNodes.table_row.attrs || {};
|
|
37
|
+
tNodes.table_row.attrs.style = { default: null };
|
|
38
|
+
tNodes.table_row.attrs.class = { default: null };
|
|
39
|
+
tNodes.table_row.attrs.id = { default: null };
|
|
40
|
+
tNodes.table_row.toDOM = function (node) { return ['tr', node.attrs, 0]; };
|
|
41
|
+
tNodes.table_row.parseDOM = [{ tag: 'tr', getAttrs: getAttrs }];
|
|
42
|
+
tNodes.table.attrs = tNodes.table.attrs || {};
|
|
43
|
+
tNodes.table.attrs.style = { default: null };
|
|
44
|
+
tNodes.table.attrs.class = { default: null };
|
|
45
|
+
tNodes.table.attrs.id = { default: null };
|
|
46
|
+
tNodes.table.toDOM = function (node) {
|
|
47
|
+
return ['table', node.attrs, ['tbody', 0]];
|
|
48
|
+
};
|
|
49
|
+
tNodes.table.parseDOM = [{ tag: 'table', getAttrs: getAttrs }];
|
|
50
|
+
var nodes = __assign(__assign({}, commonNodes), tNodes);
|
|
51
|
+
export { marks, nodes };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EditorState, Transaction, EditorView } from '@progress/kendo-editor-common';
|
|
2
|
+
import { EditorToolsSettings } from './toolsSettings';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export interface Shortcuts {
|
|
7
|
+
[key: string]: (state: EditorState, dispatch: (tr: Transaction) => void, view: EditorView) => boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const getShortcuts: (settings?: {
|
|
13
|
+
types?: {
|
|
14
|
+
listItem: string;
|
|
15
|
+
hardBreak: string;
|
|
16
|
+
};
|
|
17
|
+
toolsSettings?: {
|
|
18
|
+
bold?: EditorToolsSettings.InlineFormatOptions;
|
|
19
|
+
italic?: EditorToolsSettings.InlineFormatOptions;
|
|
20
|
+
underline?: EditorToolsSettings.InlineFormatOptions;
|
|
21
|
+
};
|
|
22
|
+
}) => Shortcuts;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
|
|
6
|
+
for (var p in s) {
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
import { chainCommands, exitCode, splitListItem, undo, redo, undoInputRule, goToNextCell, toggleInlineFormat } from '@progress/kendo-editor-common';
|
|
18
|
+
import { EditorToolsSettings } from './toolsSettings';
|
|
19
|
+
var bold = EditorToolsSettings.bold,
|
|
20
|
+
underline = EditorToolsSettings.underline,
|
|
21
|
+
italic = EditorToolsSettings.italic;
|
|
22
|
+
var mac = typeof navigator !== 'undefined' ? /Mac/.test(navigator.platform) : false;
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export var getShortcuts = function getShortcuts(settings) {
|
|
28
|
+
var insertBr = chainCommands(exitCode, function (state, dispatch) {
|
|
29
|
+
var hardBreak = settings && settings.types && settings.types.hardBreak || 'hard_break';
|
|
30
|
+
var br = state.schema.nodes[hardBreak];
|
|
31
|
+
|
|
32
|
+
if (dispatch) {
|
|
33
|
+
dispatch(state.tr.replaceSelectionWith(br.create()).scrollIntoView());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return true;
|
|
37
|
+
});
|
|
38
|
+
var listItem = settings && settings.types && settings.types.listItem || 'list_item';
|
|
39
|
+
var toolsSettings = settings && settings.toolsSettings || {};
|
|
40
|
+
|
|
41
|
+
var shortcutsSettings = __assign(__assign(__assign(__assign({
|
|
42
|
+
'Mod-b': function ModB(state, dispatch) {
|
|
43
|
+
return toggleInlineFormat(toolsSettings.bold || bold)(state, dispatch);
|
|
44
|
+
},
|
|
45
|
+
'Mod-i': function ModI(state, dispatch) {
|
|
46
|
+
return toggleInlineFormat(toolsSettings.italic || italic)(state, dispatch);
|
|
47
|
+
},
|
|
48
|
+
'Mod-u': function ModU(state, dispatch) {
|
|
49
|
+
return toggleInlineFormat(toolsSettings.underline || underline)(state, dispatch);
|
|
50
|
+
},
|
|
51
|
+
'Mod-z': undo,
|
|
52
|
+
'Shift-Mod-z': redo
|
|
53
|
+
}, __assign({}, !mac ? {
|
|
54
|
+
'Mod-y': redo
|
|
55
|
+
} : {})), {
|
|
56
|
+
'Backspace': undoInputRule,
|
|
57
|
+
'Mod-Enter': insertBr,
|
|
58
|
+
'Shift-Enter': insertBr
|
|
59
|
+
}), __assign({}, mac ? {
|
|
60
|
+
'Ctrl-Enter': insertBr
|
|
61
|
+
} : {})), {
|
|
62
|
+
'Enter': function Enter(state, dispatch) {
|
|
63
|
+
return splitListItem(state.schema.nodes[listItem])(state, dispatch);
|
|
64
|
+
},
|
|
65
|
+
'Tab': goToNextCell(1),
|
|
66
|
+
'Shift-Tab': goToNextCell(-1)
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return shortcutsSettings;
|
|
70
|
+
};
|