@progress/kendo-vue-editor 3.5.0 → 3.5.1-dev.202208150613
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 +1 -1
- package/dist/cdn/js/kendo-vue-editor.js +1 -1
- package/dist/es/Editor.d.ts +41 -41
- package/dist/es/Editor.js +7 -11
- package/dist/es/EditorProps.js +1 -0
- package/dist/es/config/pasteSettings.js +1 -0
- package/dist/es/config/toolsSettings.js +13 -11
- package/dist/es/dialogs/EditorDialogProps.js +1 -0
- package/dist/es/dialogs/FindReplace.js +4 -4
- package/dist/es/main.d.ts +0 -1
- package/dist/es/main.js +115 -28
- package/dist/es/messages/index.d.ts +0 -313
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/tools/ToolProps.d.ts +2 -1
- package/dist/es/tools/ToolProps.js +1 -0
- package/dist/es/tools/fontStyle.js +7 -11
- package/dist/es/tools/formatBlock.js +7 -11
- package/dist/es/tools/insertTable/popupGrid.js +1 -1
- package/dist/es/tools/main.js +1 -0
- package/dist/esm/Editor.d.ts +283 -0
- package/dist/esm/Editor.js +813 -0
- package/dist/esm/EditorProps.d.ts +182 -0
- package/dist/esm/EditorProps.js +1 -0
- package/dist/esm/additionalTypes.ts +21 -0
- package/dist/esm/config/defaultStyles.d.ts +12 -0
- package/dist/esm/config/defaultStyles.js +12 -0
- package/dist/esm/config/pasteSettings.d.ts +6 -0
- package/dist/esm/config/pasteSettings.js +1 -0
- package/dist/esm/config/schema.d.ts +8 -0
- package/dist/esm/config/schema.js +51 -0
- package/dist/esm/config/shortcuts.d.ts +22 -0
- package/dist/esm/config/shortcuts.js +70 -0
- package/dist/esm/config/toolsSettings.d.ts +485 -0
- package/dist/esm/config/toolsSettings.js +525 -0
- package/dist/esm/dialogs/EditorDialogProps.d.ts +23 -0
- package/dist/esm/dialogs/EditorDialogProps.js +1 -0
- package/dist/esm/dialogs/FindReplace.d.ts +70 -0
- package/dist/esm/dialogs/FindReplace.js +880 -0
- package/dist/esm/dialogs/insertImage.d.ts +54 -0
- package/dist/esm/dialogs/insertImage.js +299 -0
- package/dist/esm/dialogs/insertLink.d.ts +52 -0
- package/dist/esm/dialogs/insertLink.js +313 -0
- package/dist/esm/dialogs/main.d.ts +1 -0
- package/dist/esm/dialogs/main.js +42 -0
- package/dist/esm/dialogs/viewHtml.d.ts +51 -0
- package/dist/esm/dialogs/viewHtml.js +149 -0
- package/dist/esm/main.d.ts +184 -0
- package/dist/esm/main.js +216 -0
- package/dist/esm/messages/index.d.ts +166 -0
- package/dist/esm/messages/index.js +485 -0
- package/dist/esm/package-metadata.d.ts +5 -0
- package/dist/esm/package-metadata.js +11 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/tools/ToolProps.d.ts +35 -0
- package/dist/esm/tools/ToolProps.js +1 -0
- package/dist/esm/tools/align.d.ts +42 -0
- package/dist/esm/tools/align.js +124 -0
- package/dist/esm/tools/applyColor.d.ts +45 -0
- package/dist/esm/tools/applyColor.js +107 -0
- package/dist/esm/tools/cleanFormatting.d.ts +49 -0
- package/dist/esm/tools/cleanFormatting.js +122 -0
- package/dist/esm/tools/findReplace.d.ts +43 -0
- package/dist/esm/tools/findReplace.js +127 -0
- package/dist/esm/tools/fontStyle.d.ts +55 -0
- package/dist/esm/tools/fontStyle.js +166 -0
- package/dist/esm/tools/formatBlock.d.ts +45 -0
- package/dist/esm/tools/formatBlock.js +161 -0
- package/dist/esm/tools/history.d.ts +18 -0
- package/dist/esm/tools/history.js +5 -0
- package/dist/esm/tools/indent.d.ts +44 -0
- package/dist/esm/tools/indent.js +135 -0
- package/dist/esm/tools/inlineFormat.d.ts +74 -0
- package/dist/esm/tools/inlineFormat.js +133 -0
- package/dist/esm/tools/insertImage.d.ts +46 -0
- package/dist/esm/tools/insertImage.js +138 -0
- package/dist/esm/tools/insertLink.d.ts +46 -0
- package/dist/esm/tools/insertLink.js +138 -0
- package/dist/esm/tools/insertTable/index.d.ts +1 -0
- package/dist/esm/tools/insertTable/index.js +6 -0
- package/dist/esm/tools/insertTable/popup.d.ts +80 -0
- package/dist/esm/tools/insertTable/popup.js +176 -0
- package/dist/esm/tools/insertTable/popupGrid.d.ts +51 -0
- package/dist/esm/tools/insertTable/popupGrid.js +139 -0
- package/dist/esm/tools/insertTable/tool.d.ts +53 -0
- package/dist/esm/tools/insertTable/tool.js +173 -0
- package/dist/esm/tools/lists.d.ts +48 -0
- package/dist/esm/tools/lists.js +140 -0
- package/dist/esm/tools/main.d.ts +95 -0
- package/dist/esm/tools/main.js +1 -0
- package/dist/esm/tools/outdent.d.ts +44 -0
- package/dist/esm/tools/outdent.js +137 -0
- package/dist/esm/tools/pdf.d.ts +58 -0
- package/dist/esm/tools/pdf.js +113 -0
- package/dist/esm/tools/print.d.ts +49 -0
- package/dist/esm/tools/print.js +117 -0
- package/dist/esm/tools/proseMirrorTool.d.ts +48 -0
- package/dist/esm/tools/proseMirrorTool.js +118 -0
- package/dist/esm/tools/selectAll.d.ts +49 -0
- package/dist/esm/tools/selectAll.js +110 -0
- package/dist/esm/tools/tableEdit.d.ts +51 -0
- package/dist/esm/tools/tableEdit.js +43 -0
- package/dist/esm/tools/unlink.d.ts +47 -0
- package/dist/esm/tools/unlink.js +118 -0
- package/dist/esm/tools/utils.d.ts +18 -0
- package/dist/esm/tools/utils.js +36 -0
- package/dist/esm/tools/viewHtml.d.ts +54 -0
- package/dist/esm/tools/viewHtml.js +133 -0
- package/dist/esm/utils/browser-detection.d.ts +4 -0
- package/dist/esm/utils/browser-detection.js +5 -0
- package/dist/esm/utils/controlled-value.d.ts +5 -0
- package/dist/esm/utils/controlled-value.js +31 -0
- package/dist/esm/utils/index.d.ts +358 -0
- package/dist/esm/utils/index.js +422 -0
- package/dist/esm/utils/props-key.d.ts +5 -0
- package/dist/esm/utils/props-key.js +5 -0
- package/dist/npm/Editor.d.ts +41 -41
- package/dist/npm/Editor.js +18 -22
- package/dist/npm/config/schema.js +1 -1
- package/dist/npm/config/shortcuts.js +11 -9
- package/dist/npm/config/toolsSettings.js +13 -11
- package/dist/npm/dialogs/FindReplace.js +11 -11
- package/dist/npm/dialogs/insertImage.js +12 -12
- package/dist/npm/dialogs/insertLink.js +9 -9
- package/dist/npm/dialogs/viewHtml.js +7 -7
- package/dist/npm/main.d.ts +0 -1
- package/dist/npm/main.js +116 -29
- package/dist/npm/messages/index.d.ts +0 -313
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/tools/ToolProps.d.ts +2 -1
- package/dist/npm/tools/align.js +4 -4
- package/dist/npm/tools/applyColor.js +2 -2
- package/dist/npm/tools/cleanFormatting.js +2 -2
- package/dist/npm/tools/findReplace.js +1 -1
- package/dist/npm/tools/fontStyle.js +10 -14
- package/dist/npm/tools/formatBlock.js +10 -14
- package/dist/npm/tools/indent.js +11 -11
- package/dist/npm/tools/inlineFormat.js +3 -3
- package/dist/npm/tools/insertImage.js +2 -2
- package/dist/npm/tools/insertLink.js +2 -2
- package/dist/npm/tools/insertTable/popupGrid.js +2 -2
- package/dist/npm/tools/insertTable/tool.js +5 -5
- package/dist/npm/tools/lists.js +4 -4
- package/dist/npm/tools/outdent.js +7 -7
- package/dist/npm/tools/pdf.js +2 -2
- package/dist/npm/tools/print.js +1 -1
- package/dist/npm/tools/proseMirrorTool.js +1 -1
- package/dist/npm/tools/selectAll.js +2 -2
- package/dist/npm/tools/tableEdit.js +4 -4
- package/dist/npm/tools/unlink.js +3 -3
- package/dist/npm/tools/viewHtml.js +1 -1
- package/dist/npm/utils/controlled-value.js +2 -1
- package/dist/npm/utils/index.js +35 -35
- package/package.json +18 -12
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
import { Dialog, DialogActionsBar } from '@progress/kendo-vue-dialogs';
|
|
7
|
+
import { Button as KButton } from '@progress/kendo-vue-buttons';
|
|
8
|
+
import { getMark, applyLink } from '@progress/kendo-editor-common';
|
|
9
|
+
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
10
|
+
import { messages } from './../messages.js';
|
|
11
|
+
import { getRef, setRef } from '@progress/kendo-vue-common';
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
var InsertLinkDialogVue2 = {
|
|
17
|
+
name: 'KendoInsertLinkDialog',
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
emits: {
|
|
20
|
+
close: null
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
view: Object,
|
|
24
|
+
settings: Object,
|
|
25
|
+
dir: String
|
|
26
|
+
},
|
|
27
|
+
inject: {
|
|
28
|
+
kendoLocalizationService: {
|
|
29
|
+
default: null
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
setup: !isV3 ? undefined : function () {
|
|
34
|
+
var v3 = !!isV3;
|
|
35
|
+
return {
|
|
36
|
+
v3: v3
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
mounted: function mounted() {
|
|
40
|
+
this.href = getRef(this, 'href');
|
|
41
|
+
this.title = getRef(this, 'title');
|
|
42
|
+
this.target = getRef(this, 'target');
|
|
43
|
+
|
|
44
|
+
if (this.href) {
|
|
45
|
+
this.href.focus();
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
render: function render(createElement) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
|
|
52
|
+
var h = gh || createElement;
|
|
53
|
+
var _a = this.$props,
|
|
54
|
+
view = _a.view,
|
|
55
|
+
settings = _a.settings,
|
|
56
|
+
dir = _a.dir;
|
|
57
|
+
var localization = provideLocalizationService(this);
|
|
58
|
+
var _b = settings.messages,
|
|
59
|
+
insertHyperlinkDialogTitle = _b.insertHyperlinkDialogTitle,
|
|
60
|
+
insertHyperlinkAddress = _b.insertHyperlinkAddress,
|
|
61
|
+
insertHyperlinkTitle = _b.insertHyperlinkTitle,
|
|
62
|
+
insertHyperlinkNewWindow = _b.insertHyperlinkNewWindow,
|
|
63
|
+
insertHyperlinkCancel = _b.insertHyperlinkCancel,
|
|
64
|
+
insertHyperlinkInsert = _b.insertHyperlinkInsert;
|
|
65
|
+
var linkMark = view ? getMark(view.state, view.state.schema.marks[settings.mark]) : false;
|
|
66
|
+
var content = h("div", {
|
|
67
|
+
"class": "k-edit-form-container"
|
|
68
|
+
}, [h("div", {
|
|
69
|
+
"class": "k-edit-label"
|
|
70
|
+
}, [h("label", {
|
|
71
|
+
"for": "k-editor-link-url",
|
|
72
|
+
attrs: this.v3 ? undefined : {
|
|
73
|
+
"for": "k-editor-link-url"
|
|
74
|
+
}
|
|
75
|
+
}, [localization.toLanguageString(insertHyperlinkAddress, messages[insertHyperlinkAddress])])]), h("div", {
|
|
76
|
+
"class": "k-edit-field"
|
|
77
|
+
}, [h("span", {
|
|
78
|
+
"class": "k-textbox k-input k-input-md k-rounded-md k-input-solid"
|
|
79
|
+
}, [h("input", {
|
|
80
|
+
type: "text",
|
|
81
|
+
attrs: this.v3 ? undefined : {
|
|
82
|
+
type: "text",
|
|
83
|
+
id: "k-editor-link-url"
|
|
84
|
+
},
|
|
85
|
+
"class": "k-input-inner",
|
|
86
|
+
ref: setRef(this, 'href'),
|
|
87
|
+
id: "k-editor-link-url",
|
|
88
|
+
value: this.v3 ? linkMark && linkMark.attrs.href || undefined : null,
|
|
89
|
+
domProps: this.v3 ? undefined : {
|
|
90
|
+
"value": linkMark && linkMark.attrs.href || undefined
|
|
91
|
+
}
|
|
92
|
+
})])]), h("div", {
|
|
93
|
+
"class": "k-edit-label k-editor-link-text-row"
|
|
94
|
+
}, [h("label", {
|
|
95
|
+
"for": "k-editor-link-text",
|
|
96
|
+
attrs: this.v3 ? undefined : {
|
|
97
|
+
"for": "k-editor-link-text"
|
|
98
|
+
}
|
|
99
|
+
}, [localization.toLanguageString(insertHyperlinkTitle, messages[insertHyperlinkTitle])])]), h("div", {
|
|
100
|
+
"class": "k-edit-field k-editor-link-text-row"
|
|
101
|
+
}, [h("span", {
|
|
102
|
+
"class": "k-textbox k-input k-input-md k-rounded-md k-input-solid"
|
|
103
|
+
}, [h("input", {
|
|
104
|
+
type: "text",
|
|
105
|
+
attrs: this.v3 ? undefined : {
|
|
106
|
+
type: "text",
|
|
107
|
+
id: "k-editor-link-text"
|
|
108
|
+
},
|
|
109
|
+
"class": "k-input-inner",
|
|
110
|
+
id: "k-editor-link-text",
|
|
111
|
+
ref: setRef(this, 'title'),
|
|
112
|
+
value: this.v3 ? linkMark && linkMark.attrs.title || undefined : null,
|
|
113
|
+
domProps: this.v3 ? undefined : {
|
|
114
|
+
"value": linkMark && linkMark.attrs.title || undefined
|
|
115
|
+
}
|
|
116
|
+
})])]), settings.linkTarget !== false && h("div", {
|
|
117
|
+
"class": "k-edit-field"
|
|
118
|
+
}, [h("input", {
|
|
119
|
+
type: "checkbox",
|
|
120
|
+
attrs: this.v3 ? undefined : {
|
|
121
|
+
type: "checkbox",
|
|
122
|
+
id: "k-editor-link-target"
|
|
123
|
+
},
|
|
124
|
+
"class": "k-checkbox k-checkbox-md k-rounded-md",
|
|
125
|
+
id: "k-editor-link-target",
|
|
126
|
+
ref: setRef(this, 'target'),
|
|
127
|
+
checked: this.v3 ? linkMark && !!linkMark.attrs.target || undefined : null,
|
|
128
|
+
domProps: this.v3 ? undefined : {
|
|
129
|
+
"checked": linkMark && !!linkMark.attrs.target || undefined
|
|
130
|
+
}
|
|
131
|
+
}), h("label", {
|
|
132
|
+
"for": "k-editor-link-target",
|
|
133
|
+
attrs: this.v3 ? undefined : {
|
|
134
|
+
"for": "k-editor-link-target"
|
|
135
|
+
},
|
|
136
|
+
"class": "k-checkbox-label"
|
|
137
|
+
}, [localization.toLanguageString(insertHyperlinkNewWindow, messages[insertHyperlinkNewWindow])])])]);
|
|
138
|
+
var dialog = // @ts-ignore function children
|
|
139
|
+
h(Dialog, {
|
|
140
|
+
title: localization.toLanguageString(insertHyperlinkDialogTitle, messages[insertHyperlinkDialogTitle]),
|
|
141
|
+
attrs: this.v3 ? undefined : {
|
|
142
|
+
title: localization.toLanguageString(insertHyperlinkDialogTitle, messages[insertHyperlinkDialogTitle]),
|
|
143
|
+
closeIcon: true,
|
|
144
|
+
dir: dir
|
|
145
|
+
},
|
|
146
|
+
onClose: this.onClose,
|
|
147
|
+
on: this.v3 ? undefined : {
|
|
148
|
+
"close": this.onClose
|
|
149
|
+
},
|
|
150
|
+
closeIcon: true,
|
|
151
|
+
dir: dir,
|
|
152
|
+
style: dir === 'rtl' ? {
|
|
153
|
+
textAlign: 'right'
|
|
154
|
+
} : undefined
|
|
155
|
+
}, this.v3 ? function () {
|
|
156
|
+
return [content, // @ts-ignore function children
|
|
157
|
+
h(DialogActionsBar, _this.v3 ? function () {
|
|
158
|
+
return [// @ts-ignore function children
|
|
159
|
+
h(KButton, {
|
|
160
|
+
type: "button",
|
|
161
|
+
attrs: _this.v3 ? undefined : {
|
|
162
|
+
type: "button",
|
|
163
|
+
dir: dir
|
|
164
|
+
},
|
|
165
|
+
onClick: _this.onClose,
|
|
166
|
+
on: _this.v3 ? undefined : {
|
|
167
|
+
"click": _this.onClose
|
|
168
|
+
},
|
|
169
|
+
dir: dir,
|
|
170
|
+
key: "cancel"
|
|
171
|
+
}, _this.v3 ? function () {
|
|
172
|
+
return [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])];
|
|
173
|
+
} : [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])]), // @ts-ignore function children
|
|
174
|
+
h(KButton, {
|
|
175
|
+
type: "button",
|
|
176
|
+
attrs: _this.v3 ? undefined : {
|
|
177
|
+
type: "button",
|
|
178
|
+
themeColor: 'primary',
|
|
179
|
+
dir: dir
|
|
180
|
+
},
|
|
181
|
+
onClick: _this.onInsert,
|
|
182
|
+
on: _this.v3 ? undefined : {
|
|
183
|
+
"click": _this.onInsert
|
|
184
|
+
},
|
|
185
|
+
themeColor: 'primary',
|
|
186
|
+
dir: dir,
|
|
187
|
+
key: "insert"
|
|
188
|
+
}, _this.v3 ? function () {
|
|
189
|
+
return [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])];
|
|
190
|
+
} : [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])])];
|
|
191
|
+
} : [h(KButton, {
|
|
192
|
+
type: "button",
|
|
193
|
+
attrs: _this.v3 ? undefined : {
|
|
194
|
+
type: "button",
|
|
195
|
+
dir: dir
|
|
196
|
+
},
|
|
197
|
+
onClick: _this.onClose,
|
|
198
|
+
on: _this.v3 ? undefined : {
|
|
199
|
+
"click": _this.onClose
|
|
200
|
+
},
|
|
201
|
+
dir: dir,
|
|
202
|
+
key: "cancel"
|
|
203
|
+
}, _this.v3 ? function () {
|
|
204
|
+
return [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])];
|
|
205
|
+
} : [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])]), h(KButton, {
|
|
206
|
+
type: "button",
|
|
207
|
+
attrs: _this.v3 ? undefined : {
|
|
208
|
+
type: "button",
|
|
209
|
+
themeColor: 'primary',
|
|
210
|
+
dir: dir
|
|
211
|
+
},
|
|
212
|
+
onClick: _this.onInsert,
|
|
213
|
+
on: _this.v3 ? undefined : {
|
|
214
|
+
"click": _this.onInsert
|
|
215
|
+
},
|
|
216
|
+
themeColor: 'primary',
|
|
217
|
+
dir: dir,
|
|
218
|
+
key: "insert"
|
|
219
|
+
}, _this.v3 ? function () {
|
|
220
|
+
return [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])];
|
|
221
|
+
} : [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])])])];
|
|
222
|
+
} : [content, h(DialogActionsBar, _this.v3 ? function () {
|
|
223
|
+
return [h(KButton, {
|
|
224
|
+
type: "button",
|
|
225
|
+
attrs: _this.v3 ? undefined : {
|
|
226
|
+
type: "button",
|
|
227
|
+
dir: dir
|
|
228
|
+
},
|
|
229
|
+
onClick: _this.onClose,
|
|
230
|
+
on: _this.v3 ? undefined : {
|
|
231
|
+
"click": _this.onClose
|
|
232
|
+
},
|
|
233
|
+
dir: dir,
|
|
234
|
+
key: "cancel"
|
|
235
|
+
}, _this.v3 ? function () {
|
|
236
|
+
return [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])];
|
|
237
|
+
} : [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])]), h(KButton, {
|
|
238
|
+
type: "button",
|
|
239
|
+
attrs: _this.v3 ? undefined : {
|
|
240
|
+
type: "button",
|
|
241
|
+
themeColor: 'primary',
|
|
242
|
+
dir: dir
|
|
243
|
+
},
|
|
244
|
+
onClick: _this.onInsert,
|
|
245
|
+
on: _this.v3 ? undefined : {
|
|
246
|
+
"click": _this.onInsert
|
|
247
|
+
},
|
|
248
|
+
themeColor: 'primary',
|
|
249
|
+
dir: dir,
|
|
250
|
+
key: "insert"
|
|
251
|
+
}, _this.v3 ? function () {
|
|
252
|
+
return [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])];
|
|
253
|
+
} : [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])])];
|
|
254
|
+
} : [h(KButton, {
|
|
255
|
+
type: "button",
|
|
256
|
+
attrs: _this.v3 ? undefined : {
|
|
257
|
+
type: "button",
|
|
258
|
+
dir: dir
|
|
259
|
+
},
|
|
260
|
+
onClick: _this.onClose,
|
|
261
|
+
on: _this.v3 ? undefined : {
|
|
262
|
+
"click": _this.onClose
|
|
263
|
+
},
|
|
264
|
+
dir: dir,
|
|
265
|
+
key: "cancel"
|
|
266
|
+
}, _this.v3 ? function () {
|
|
267
|
+
return [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])];
|
|
268
|
+
} : [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])]), h(KButton, {
|
|
269
|
+
type: "button",
|
|
270
|
+
attrs: _this.v3 ? undefined : {
|
|
271
|
+
type: "button",
|
|
272
|
+
themeColor: 'primary',
|
|
273
|
+
dir: dir
|
|
274
|
+
},
|
|
275
|
+
onClick: _this.onInsert,
|
|
276
|
+
on: _this.v3 ? undefined : {
|
|
277
|
+
"click": _this.onInsert
|
|
278
|
+
},
|
|
279
|
+
themeColor: 'primary',
|
|
280
|
+
dir: dir,
|
|
281
|
+
key: "insert"
|
|
282
|
+
}, _this.v3 ? function () {
|
|
283
|
+
return [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])];
|
|
284
|
+
} : [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])])])]);
|
|
285
|
+
return dialog;
|
|
286
|
+
},
|
|
287
|
+
methods: {
|
|
288
|
+
onClose: function onClose() {
|
|
289
|
+
this.$props.view.focus();
|
|
290
|
+
this.$emit('close');
|
|
291
|
+
},
|
|
292
|
+
onInsert: function onInsert() {
|
|
293
|
+
var view = this.$props.view;
|
|
294
|
+
var mark = this.$props.settings.mark;
|
|
295
|
+
var attrs = {
|
|
296
|
+
href: this.href ? this.href.value : undefined,
|
|
297
|
+
title: this.title ? this.title.value : undefined,
|
|
298
|
+
target: this.target && this.target.checked ? '_blank' : undefined
|
|
299
|
+
};
|
|
300
|
+
applyLink({
|
|
301
|
+
mark: mark,
|
|
302
|
+
attrs: attrs
|
|
303
|
+
}, this.$props.settings.commandName)(view.state, view.dispatch);
|
|
304
|
+
this.onClose();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* @hidden
|
|
310
|
+
*/
|
|
311
|
+
|
|
312
|
+
var InsertLinkDialog = InsertLinkDialogVue2;
|
|
313
|
+
export { InsertLinkDialog, InsertLinkDialogVue2 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// import { InsertLinkDialog as LinkDialog, InsertLinkDialogProps as LinkDialogProps } from './insertLink.js';
|
|
2
|
+
// import { InsertImageDialog as ImageDialog, InsertImageDialogProps as ImageDialogProps } from './insertImage.js';
|
|
3
|
+
// import { ViewHtmlDialog as ViewHtmlDialogX, ViewHtmlDialogProps as ViewHtmlDialogPropsX } from './viewHtml.js';
|
|
4
|
+
// import { FindAndReplaceDialog as FindAndReplaceDialogX,
|
|
5
|
+
// FindAndReplaceDialogProps as FindAndReplaceDialogPropsX } from './FindReplace.js';
|
|
6
|
+
// /**
|
|
7
|
+
// * Represents a wrapping namespace for the dialog components and props of the Editor.
|
|
8
|
+
// */
|
|
9
|
+
// export namespace EditorDialogs {
|
|
10
|
+
// /**
|
|
11
|
+
// * The InsertLinkDialog component.
|
|
12
|
+
// */
|
|
13
|
+
// export class InsertLinkDialog extends LinkDialog { }
|
|
14
|
+
// /**
|
|
15
|
+
// * The props for the InsertLinkDialog component.
|
|
16
|
+
// */
|
|
17
|
+
// export interface InsertLinkDialogProps extends LinkDialogProps { }
|
|
18
|
+
// /**
|
|
19
|
+
// * The InsertImageDialog component.
|
|
20
|
+
// */
|
|
21
|
+
// export class InsertImageDialog extends ImageDialog { }
|
|
22
|
+
// /**
|
|
23
|
+
// * The props for the InsertImageDialog component.
|
|
24
|
+
// */
|
|
25
|
+
// export interface InsertImageDialogProps extends ImageDialogProps { }
|
|
26
|
+
// /**
|
|
27
|
+
// * The ViewHtmlDialog component.
|
|
28
|
+
// */
|
|
29
|
+
// export class ViewHtmlDialog extends ViewHtmlDialogX { }
|
|
30
|
+
// /**
|
|
31
|
+
// * The props for the ViewHtmlDialog component.
|
|
32
|
+
// */
|
|
33
|
+
// export interface ViewHtmlDialogProps extends ViewHtmlDialogPropsX { }
|
|
34
|
+
// /**
|
|
35
|
+
// * The FindAndReplaceDialog component.
|
|
36
|
+
// */
|
|
37
|
+
// export class FindAndReplaceDialog extends FindAndReplaceDialogX { }
|
|
38
|
+
// /**
|
|
39
|
+
// * The props for the FindAndReplaceDialog component.
|
|
40
|
+
// */
|
|
41
|
+
// export interface FindAndReplaceDialogProps extends FindAndReplaceDialogPropsX { }
|
|
42
|
+
// }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
2
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
3
|
+
declare type DefaultMethods<V> = {
|
|
4
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
import { EditorToolsSettings } from '../config/toolsSettings';
|
|
7
|
+
import { EditorDialogProps } from './EditorDialogProps';
|
|
8
|
+
export interface ViewHtmlDialogProps extends EditorDialogProps {
|
|
9
|
+
/**
|
|
10
|
+
* The `ViewHtmlSettings` object.
|
|
11
|
+
*/
|
|
12
|
+
settings: EditorToolsSettings.ViewHtmlSettings;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export interface ViewHtmlDialogState {
|
|
18
|
+
htmlArea: HTMLTextAreaElement | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export interface ViewHtmlDialogComputed {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
export interface ViewHtmlDialogMethods {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
*/
|
|
35
|
+
export interface ViewHtmlDialogData {
|
|
36
|
+
currentActive: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
export interface ViewHtmlDialogAll extends Vue2type, ViewHtmlDialogMethods, ViewHtmlDialogData, ViewHtmlDialogComputed, ViewHtmlDialogState {
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
declare let ViewHtmlDialogVue2: ComponentOptions<ViewHtmlDialogAll, DefaultData<ViewHtmlDialogData>, DefaultMethods<ViewHtmlDialogAll>, ViewHtmlDialogComputed, RecordPropsDefinition<ViewHtmlDialogProps>>;
|
|
47
|
+
/**
|
|
48
|
+
* @hidden
|
|
49
|
+
*/
|
|
50
|
+
declare const ViewHtmlDialog: DefineComponent<ViewHtmlDialogProps, any, ViewHtmlDialogData, ViewHtmlDialogComputed, ViewHtmlDialogMethods, {}, {}, {}, string, ViewHtmlDialogProps, ViewHtmlDialogProps, {}>;
|
|
51
|
+
export { ViewHtmlDialog, ViewHtmlDialogVue2 };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
import { Dialog, DialogActionsBar } from '@progress/kendo-vue-dialogs';
|
|
7
|
+
import { Button as KButton } from '@progress/kendo-vue-buttons';
|
|
8
|
+
import { getHtml, setHtml, indentHtml, trimWhitespace } from '@progress/kendo-editor-common';
|
|
9
|
+
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
10
|
+
import { messages } from './../messages.js';
|
|
11
|
+
import { editorPropsKey } from './../utils/props-key.js';
|
|
12
|
+
import { getRef, setRef } from '@progress/kendo-vue-common';
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var ViewHtmlDialogVue2 = {
|
|
18
|
+
name: 'KendoViewHtmlDialog',
|
|
19
|
+
props: {
|
|
20
|
+
view: Object,
|
|
21
|
+
settings: Object,
|
|
22
|
+
dir: String
|
|
23
|
+
},
|
|
24
|
+
inject: {
|
|
25
|
+
kendoLocalizationService: {
|
|
26
|
+
default: null
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
mounted: function mounted() {
|
|
30
|
+
this.htmlArea = getRef(this, 'htmlArea');
|
|
31
|
+
},
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
setup: !isV3 ? undefined : function () {
|
|
34
|
+
var v3 = !!isV3;
|
|
35
|
+
return {
|
|
36
|
+
v3: v3
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
render: function render(createElement) {
|
|
41
|
+
var _this = this;
|
|
42
|
+
|
|
43
|
+
var h = gh || createElement;
|
|
44
|
+
var _a = this.$props,
|
|
45
|
+
view = _a.view,
|
|
46
|
+
settings = _a.settings,
|
|
47
|
+
dir = _a.dir;
|
|
48
|
+
var localization = provideLocalizationService(this);
|
|
49
|
+
var _b = settings.messages,
|
|
50
|
+
viewHtmlDialogTitle = _b.viewHtmlDialogTitle,
|
|
51
|
+
viewHtmlCancel = _b.viewHtmlCancel,
|
|
52
|
+
viewHtmlUpdate = _b.viewHtmlUpdate;
|
|
53
|
+
var content = h("textarea", {
|
|
54
|
+
"class": "k-textarea k-editor-textarea",
|
|
55
|
+
style: {
|
|
56
|
+
height: '280px',
|
|
57
|
+
width: '490px'
|
|
58
|
+
},
|
|
59
|
+
ref: setRef(this, 'htmlArea'),
|
|
60
|
+
value: this.v3 ? indentHtml(getHtml(view.state)) : null,
|
|
61
|
+
domProps: this.v3 ? undefined : {
|
|
62
|
+
"value": indentHtml(getHtml(view.state))
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
var actionButtons = [// @ts-ignore function children
|
|
66
|
+
h(KButton, {
|
|
67
|
+
type: "button",
|
|
68
|
+
attrs: this.v3 ? undefined : {
|
|
69
|
+
type: "button",
|
|
70
|
+
dir: dir
|
|
71
|
+
},
|
|
72
|
+
onClick: this.onClose,
|
|
73
|
+
on: this.v3 ? undefined : {
|
|
74
|
+
"click": this.onClose
|
|
75
|
+
},
|
|
76
|
+
dir: dir,
|
|
77
|
+
key: "cancel"
|
|
78
|
+
}, this.v3 ? function () {
|
|
79
|
+
return [localization.toLanguageString(viewHtmlCancel, messages[viewHtmlCancel])];
|
|
80
|
+
} : [localization.toLanguageString(viewHtmlCancel, messages[viewHtmlCancel])]), // @ts-ignore function children
|
|
81
|
+
h(KButton, {
|
|
82
|
+
type: "button",
|
|
83
|
+
attrs: this.v3 ? undefined : {
|
|
84
|
+
type: "button",
|
|
85
|
+
themeColor: 'primary',
|
|
86
|
+
dir: dir
|
|
87
|
+
},
|
|
88
|
+
onClick: this.onUpdate,
|
|
89
|
+
on: this.v3 ? undefined : {
|
|
90
|
+
"click": this.onUpdate
|
|
91
|
+
},
|
|
92
|
+
themeColor: 'primary',
|
|
93
|
+
dir: dir,
|
|
94
|
+
key: "update"
|
|
95
|
+
}, this.v3 ? function () {
|
|
96
|
+
return [localization.toLanguageString(viewHtmlUpdate, messages[viewHtmlUpdate])];
|
|
97
|
+
} : [localization.toLanguageString(viewHtmlUpdate, messages[viewHtmlUpdate])])];
|
|
98
|
+
var dialog = // @ts-ignore function children
|
|
99
|
+
h(Dialog, {
|
|
100
|
+
title: localization.toLanguageString(viewHtmlDialogTitle, messages[viewHtmlDialogTitle]),
|
|
101
|
+
attrs: this.v3 ? undefined : {
|
|
102
|
+
title: localization.toLanguageString(viewHtmlDialogTitle, messages[viewHtmlDialogTitle]),
|
|
103
|
+
closeIcon: true,
|
|
104
|
+
dir: dir
|
|
105
|
+
},
|
|
106
|
+
onClose: this.onClose,
|
|
107
|
+
on: this.v3 ? undefined : {
|
|
108
|
+
"close": this.onClose
|
|
109
|
+
},
|
|
110
|
+
key: "dialog",
|
|
111
|
+
closeIcon: true,
|
|
112
|
+
dir: dir,
|
|
113
|
+
style: dir === 'rtl' ? {
|
|
114
|
+
textAlign: 'right'
|
|
115
|
+
} : undefined
|
|
116
|
+
}, this.v3 ? function () {
|
|
117
|
+
return [content, // @ts-ignore function children
|
|
118
|
+
h(DialogActionsBar, _this.v3 ? function () {
|
|
119
|
+
return [actionButtons];
|
|
120
|
+
} : [actionButtons])];
|
|
121
|
+
} : [content, h(DialogActionsBar, _this.v3 ? function () {
|
|
122
|
+
return [actionButtons];
|
|
123
|
+
} : [actionButtons])]);
|
|
124
|
+
return dialog;
|
|
125
|
+
},
|
|
126
|
+
methods: {
|
|
127
|
+
onUpdate: function onUpdate() {
|
|
128
|
+
var _a = this.$props,
|
|
129
|
+
view = _a.view,
|
|
130
|
+
settings = _a.settings;
|
|
131
|
+
var html = trimWhitespace(this.htmlArea ? this.htmlArea.value : '');
|
|
132
|
+
var preserveWhitespace = editorPropsKey.getState(view.state).preserveWhitespace;
|
|
133
|
+
setHtml(html, settings.commandName, {
|
|
134
|
+
preserveWhitespace: preserveWhitespace
|
|
135
|
+
})(view.state, view.dispatch);
|
|
136
|
+
this.onClose();
|
|
137
|
+
},
|
|
138
|
+
onClose: function onClose() {
|
|
139
|
+
this.$props.view.focus();
|
|
140
|
+
this.$emit('close');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* @hidden
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
var ViewHtmlDialog = ViewHtmlDialogVue2;
|
|
149
|
+
export { ViewHtmlDialog, ViewHtmlDialogVue2 };
|