@progress/kendo-vue-editor 3.0.0-dev.202201161025 → 3.0.0-dev.202201170830
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/cdn/js/kendo-vue-editor.js +1 -1
- package/dist/es/Editor.js +25 -20
- package/dist/es/dialogs/FindReplace.js +11 -0
- package/dist/es/dialogs/insertImage.js +10 -4
- package/dist/es/dialogs/insertLink.js +10 -4
- package/dist/es/dialogs/viewHtml.js +0 -4
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/tools/fontStyle.js +17 -54
- package/dist/es/tools/formatBlock.js +17 -49
- package/dist/npm/Editor.js +25 -20
- package/dist/npm/dialogs/FindReplace.js +11 -0
- package/dist/npm/dialogs/insertImage.js +10 -4
- package/dist/npm/dialogs/insertLink.js +10 -4
- package/dist/npm/dialogs/viewHtml.js +0 -4
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/tools/fontStyle.js +17 -55
- package/dist/npm/tools/formatBlock.js +17 -50
- package/package.json +12 -12
package/dist/es/Editor.js
CHANGED
|
@@ -267,12 +267,13 @@ var EditorVue2 = {
|
|
|
267
267
|
},
|
|
268
268
|
data: function data() {
|
|
269
269
|
return {
|
|
270
|
+
updateGuid: guid(),
|
|
270
271
|
view: undefined,
|
|
271
272
|
linkDialog: false
|
|
272
273
|
};
|
|
273
274
|
},
|
|
274
275
|
created: function created() {
|
|
275
|
-
this.
|
|
276
|
+
this.view = undefined;
|
|
276
277
|
validatePackage(packageMetadata);
|
|
277
278
|
},
|
|
278
279
|
mounted: function mounted() {
|
|
@@ -290,7 +291,7 @@ var EditorVue2 = {
|
|
|
290
291
|
},
|
|
291
292
|
updated: function updated() {
|
|
292
293
|
var value = this.$props.value;
|
|
293
|
-
var view = this.
|
|
294
|
+
var view = this.view;
|
|
294
295
|
|
|
295
296
|
if (value === undefined || !view) {
|
|
296
297
|
return;
|
|
@@ -309,8 +310,8 @@ var EditorVue2 = {
|
|
|
309
310
|
},
|
|
310
311
|
// @ts-ignore
|
|
311
312
|
unmounted: function unmounted() {
|
|
312
|
-
if (this.
|
|
313
|
-
this.
|
|
313
|
+
if (this.view) {
|
|
314
|
+
this.view.destroy();
|
|
314
315
|
}
|
|
315
316
|
|
|
316
317
|
this.view = undefined;
|
|
@@ -321,8 +322,8 @@ var EditorVue2 = {
|
|
|
321
322
|
return this.trOnChange.doc;
|
|
322
323
|
} else if (this.$props.value !== undefined) {
|
|
323
324
|
return this.$props.value;
|
|
324
|
-
} else if (this.
|
|
325
|
-
return this.
|
|
325
|
+
} else if (this.view) {
|
|
326
|
+
return this.view.state.doc;
|
|
326
327
|
}
|
|
327
328
|
|
|
328
329
|
return this.$props.defaultContent || '';
|
|
@@ -340,6 +341,7 @@ var EditorVue2 = {
|
|
|
340
341
|
var _this = this;
|
|
341
342
|
|
|
342
343
|
var h = gh || createElement;
|
|
344
|
+
var toolindex = 100;
|
|
343
345
|
var _a = this.$props,
|
|
344
346
|
_b = _a.tools,
|
|
345
347
|
tools = _b === void 0 ? [] : _b,
|
|
@@ -381,14 +383,17 @@ var EditorVue2 = {
|
|
|
381
383
|
});
|
|
382
384
|
};
|
|
383
385
|
|
|
384
|
-
var renderTool = function renderTool(currentTool,
|
|
386
|
+
var renderTool = function renderTool(currentTool, _index) {
|
|
385
387
|
var ct = allTools[currentTool] || currentTool;
|
|
386
388
|
|
|
387
389
|
if (allTools[currentTool]) {
|
|
390
|
+
toolindex++;
|
|
391
|
+
|
|
388
392
|
var toolProps = __assign({
|
|
389
393
|
view: view,
|
|
390
394
|
dir: this.$props.dir,
|
|
391
|
-
key:
|
|
395
|
+
key: toolindex,
|
|
396
|
+
updateGuid: this.updateGuid,
|
|
392
397
|
settings: allTools[currentTool].props
|
|
393
398
|
}, allTools[currentTool].props);
|
|
394
399
|
|
|
@@ -398,7 +403,7 @@ var EditorVue2 = {
|
|
|
398
403
|
} else if (ct === 'Separator') {
|
|
399
404
|
return (// @ts-ignore
|
|
400
405
|
h(ToolbarSeparator, {
|
|
401
|
-
key:
|
|
406
|
+
key: toolindex
|
|
402
407
|
})
|
|
403
408
|
);
|
|
404
409
|
} else {
|
|
@@ -411,7 +416,8 @@ var EditorVue2 = {
|
|
|
411
416
|
additionalProps: {
|
|
412
417
|
view: view,
|
|
413
418
|
dir: this.$props.dir,
|
|
414
|
-
|
|
419
|
+
updateGuid: this.updateGuid,
|
|
420
|
+
key: toolindex,
|
|
415
421
|
settings: ct.props
|
|
416
422
|
}
|
|
417
423
|
});
|
|
@@ -477,7 +483,7 @@ var EditorVue2 = {
|
|
|
477
483
|
},
|
|
478
484
|
methods: {
|
|
479
485
|
getView: function getView() {
|
|
480
|
-
return this.
|
|
486
|
+
return this.view;
|
|
481
487
|
},
|
|
482
488
|
getHTML: function getHTML() {
|
|
483
489
|
var view = this.getView();
|
|
@@ -496,16 +502,15 @@ var EditorVue2 = {
|
|
|
496
502
|
}
|
|
497
503
|
},
|
|
498
504
|
focus: function focus() {
|
|
499
|
-
if (this.
|
|
500
|
-
this.
|
|
505
|
+
if (this.view) {
|
|
506
|
+
this.view.focus();
|
|
501
507
|
}
|
|
502
508
|
},
|
|
503
509
|
updateTools: function updateTools(view) {
|
|
504
510
|
this.view = view;
|
|
505
511
|
|
|
506
512
|
if (this.v3) {
|
|
507
|
-
this.
|
|
508
|
-
this.$forceUpdate();
|
|
513
|
+
this.updateGuid = guid();
|
|
509
514
|
}
|
|
510
515
|
},
|
|
511
516
|
iframeLoad: function iframeLoad() {
|
|
@@ -584,7 +589,7 @@ var EditorVue2 = {
|
|
|
584
589
|
})), {
|
|
585
590
|
'Mod-k': function ModK() {
|
|
586
591
|
var linkDialog = _this.$data.linkDialog;
|
|
587
|
-
var editorView = _this.
|
|
592
|
+
var editorView = _this.view;
|
|
588
593
|
|
|
589
594
|
if (editorView) {
|
|
590
595
|
var editorState = editorView.state;
|
|
@@ -632,10 +637,10 @@ var EditorVue2 = {
|
|
|
632
637
|
dom: dom
|
|
633
638
|
};
|
|
634
639
|
this.$emit('loaded', mountEvent);
|
|
635
|
-
var view = this
|
|
640
|
+
var view = this.$props.extendView && this.$props.extendView(mountEvent) || new EditorView({
|
|
636
641
|
mount: dom
|
|
637
642
|
}, viewProps);
|
|
638
|
-
this.view = view;
|
|
643
|
+
this.view = this.v3 ? markRaw(view) : view;
|
|
639
644
|
},
|
|
640
645
|
filterTransaction: function filterTransaction(transaction, state) {
|
|
641
646
|
var event = {
|
|
@@ -689,8 +694,8 @@ var EditorVue2 = {
|
|
|
689
694
|
this.$emit('change', event_2);
|
|
690
695
|
}
|
|
691
696
|
|
|
692
|
-
if (this.
|
|
693
|
-
this.
|
|
697
|
+
if (this.view && (this.$props.value === undefined || !docChanged)) {
|
|
698
|
+
this.view.updateState(this.view.state.apply(transaction));
|
|
694
699
|
}
|
|
695
700
|
},
|
|
696
701
|
onFocus: function onFocus(_view, nativeEvent) {
|
|
@@ -16,6 +16,10 @@ var settings = EditorToolsSettings.findAndReplace; // tslint:enable:max-line-len
|
|
|
16
16
|
|
|
17
17
|
var FindAndReplaceDialogVue2 = {
|
|
18
18
|
name: 'KendoFindAndReplaceDialog',
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
emits: {
|
|
21
|
+
close: null
|
|
22
|
+
},
|
|
19
23
|
props: {
|
|
20
24
|
view: Object,
|
|
21
25
|
settings: {
|
|
@@ -55,6 +59,13 @@ var FindAndReplaceDialogVue2 = {
|
|
|
55
59
|
|
|
56
60
|
this.setNextState();
|
|
57
61
|
this.hasMounted = true;
|
|
62
|
+
setTimeout(function () {
|
|
63
|
+
var findInput = document.getElementById('findWhatFind');
|
|
64
|
+
|
|
65
|
+
if (findInput) {
|
|
66
|
+
findInput.focus();
|
|
67
|
+
}
|
|
68
|
+
}, 10);
|
|
58
69
|
},
|
|
59
70
|
|
|
60
71
|
/**
|
|
@@ -10,6 +10,10 @@ import { messages } from './../messages'; // tslint:enable:max-line-length
|
|
|
10
10
|
|
|
11
11
|
var InsertImageDialogVue2 = {
|
|
12
12
|
name: 'KendoInsertImageDialog',
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
emits: {
|
|
15
|
+
close: null
|
|
16
|
+
},
|
|
13
17
|
props: {
|
|
14
18
|
view: Object,
|
|
15
19
|
settings: Object,
|
|
@@ -26,6 +30,10 @@ var InsertImageDialogVue2 = {
|
|
|
26
30
|
this.title = this.v3 ? this.titleRef : this.$refs.title;
|
|
27
31
|
this.width = this.v3 ? this.widthRef : this.$refs.width;
|
|
28
32
|
this.height = this.v3 ? this.heightRef : this.$refs.height;
|
|
33
|
+
|
|
34
|
+
if (this.src) {
|
|
35
|
+
this.src.focus();
|
|
36
|
+
}
|
|
29
37
|
},
|
|
30
38
|
// @ts-ignore
|
|
31
39
|
setup: !gh ? undefined : function () {
|
|
@@ -79,8 +87,7 @@ var InsertImageDialogVue2 = {
|
|
|
79
87
|
type: "text",
|
|
80
88
|
attrs: this.v3 ? undefined : {
|
|
81
89
|
type: "text",
|
|
82
|
-
id: "k-editor-image-url"
|
|
83
|
-
autoFocus: true
|
|
90
|
+
id: "k-editor-image-url"
|
|
84
91
|
},
|
|
85
92
|
"class": "k-input-inner",
|
|
86
93
|
id: "k-editor-image-url",
|
|
@@ -90,8 +97,7 @@ var InsertImageDialogVue2 = {
|
|
|
90
97
|
},
|
|
91
98
|
ref: this.v3 ? function (el) {
|
|
92
99
|
_this.srcRef = el;
|
|
93
|
-
} : 'src'
|
|
94
|
-
autoFocus: true
|
|
100
|
+
} : 'src'
|
|
95
101
|
})])]), h("div", {
|
|
96
102
|
"class": "k-edit-label"
|
|
97
103
|
}, [h("label", {
|
|
@@ -10,6 +10,10 @@ import { messages } from './../messages'; // tslint:enable:max-line-length
|
|
|
10
10
|
|
|
11
11
|
var InsertLinkDialogVue2 = {
|
|
12
12
|
name: 'KendoInsertLinkDialog',
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
emits: {
|
|
15
|
+
close: null
|
|
16
|
+
},
|
|
13
17
|
props: {
|
|
14
18
|
view: Object,
|
|
15
19
|
settings: Object,
|
|
@@ -31,6 +35,10 @@ var InsertLinkDialogVue2 = {
|
|
|
31
35
|
this.href = this.v3 ? this.hrefRef : this.$refs.href;
|
|
32
36
|
this.title = this.v3 ? this.titleRef : this.$refs.title;
|
|
33
37
|
this.target = this.v3 ? this.targetRef : this.$refs.target;
|
|
38
|
+
|
|
39
|
+
if (this.href) {
|
|
40
|
+
this.href.focus();
|
|
41
|
+
}
|
|
34
42
|
},
|
|
35
43
|
// @ts-ignore
|
|
36
44
|
render: function render(createElement) {
|
|
@@ -69,8 +77,7 @@ var InsertLinkDialogVue2 = {
|
|
|
69
77
|
type: "text",
|
|
70
78
|
attrs: this.v3 ? undefined : {
|
|
71
79
|
type: "text",
|
|
72
|
-
id: "k-editor-link-url"
|
|
73
|
-
autoFocus: true
|
|
80
|
+
id: "k-editor-link-url"
|
|
74
81
|
},
|
|
75
82
|
"class": "k-input-inner",
|
|
76
83
|
ref: this.v3 ? function (el) {
|
|
@@ -80,8 +87,7 @@ var InsertLinkDialogVue2 = {
|
|
|
80
87
|
value: this.v3 ? linkMark && linkMark.attrs.href || undefined : null,
|
|
81
88
|
domProps: this.v3 ? undefined : {
|
|
82
89
|
"value": linkMark && linkMark.attrs.href || undefined
|
|
83
|
-
}
|
|
84
|
-
autoFocus: true
|
|
90
|
+
}
|
|
85
91
|
})])]), h("div", {
|
|
86
92
|
"class": "k-edit-label k-editor-link-text-row"
|
|
87
93
|
}, [h("label", {
|
|
@@ -59,10 +59,6 @@ var ViewHtmlDialogVue2 = {
|
|
|
59
59
|
value: this.v3 ? indentHtml(getHtml(view.state)) : null,
|
|
60
60
|
domProps: this.v3 ? undefined : {
|
|
61
61
|
"value": indentHtml(getHtml(view.state))
|
|
62
|
-
},
|
|
63
|
-
autoFocus: true,
|
|
64
|
-
attrs: this.v3 ? undefined : {
|
|
65
|
-
autoFocus: true
|
|
66
62
|
}
|
|
67
63
|
});
|
|
68
64
|
var actionButtons = [// @ts-ignore function children
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-editor',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1642407570,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -47,7 +47,6 @@ var allVue = Vue;
|
|
|
47
47
|
var gh = allVue.h;
|
|
48
48
|
import { DropDownList } from '@progress/kendo-vue-dropdowns';
|
|
49
49
|
import { getInlineStyles, applyInlineStyle } from '@progress/kendo-editor-common';
|
|
50
|
-
import { Keys } from '@progress/kendo-vue-common';
|
|
51
50
|
import { userSelectNone } from './utils';
|
|
52
51
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
53
52
|
import { messages } from './../messages'; // tslint:enable:max-line-length
|
|
@@ -77,30 +76,6 @@ var FontNameVue2 = {
|
|
|
77
76
|
v3: v3
|
|
78
77
|
};
|
|
79
78
|
},
|
|
80
|
-
data: function data() {
|
|
81
|
-
return {
|
|
82
|
-
currentValue: null,
|
|
83
|
-
currentOpened: false
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
computed: {
|
|
87
|
-
computedValue: function computedValue() {
|
|
88
|
-
var _a = this.$props,
|
|
89
|
-
view = _a.view,
|
|
90
|
-
settings = _a.settings,
|
|
91
|
-
dataItems = _a.dataItems;
|
|
92
|
-
var style = settings.style;
|
|
93
|
-
var items = dataItems || settings.items;
|
|
94
|
-
var styles = view ? getInlineStyles(view.state, {
|
|
95
|
-
name: style,
|
|
96
|
-
value: /^.+$/
|
|
97
|
-
}) : [];
|
|
98
|
-
var value = new Set(styles).size === 1 ? styles[0] : null;
|
|
99
|
-
return this.currentValue ? this.currentValue : value ? items.find(function (i) {
|
|
100
|
-
return i.value === value;
|
|
101
|
-
}) : value;
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
79
|
// @ts-ignore
|
|
105
80
|
render: function render(createElement) {
|
|
106
81
|
var h = gh || createElement;
|
|
@@ -113,6 +88,12 @@ var FontNameVue2 = {
|
|
|
113
88
|
defaultItemProps = _a.defaultItem,
|
|
114
89
|
other = __rest(_a, ["view", "render", "dataItems", "settings", "defaultItem"]);
|
|
115
90
|
|
|
91
|
+
var style = settings.style;
|
|
92
|
+
var styles = view ? getInlineStyles(view.state, {
|
|
93
|
+
name: style,
|
|
94
|
+
value: /^.+$/
|
|
95
|
+
}) : [];
|
|
96
|
+
var value = new Set(styles).size === 1 ? styles[0] : null;
|
|
116
97
|
var items = dataItems || settings.items;
|
|
117
98
|
var defaultItem = defaultItemProps || settings.defaultItem;
|
|
118
99
|
var localization = provideLocalizationService(this);
|
|
@@ -123,7 +104,9 @@ var FontNameVue2 = {
|
|
|
123
104
|
}
|
|
124
105
|
|
|
125
106
|
var ddlProps = __assign(__assign(__assign({}, other), {
|
|
126
|
-
value:
|
|
107
|
+
value: value ? items.find(function (i) {
|
|
108
|
+
return i.value === value;
|
|
109
|
+
}) : value,
|
|
127
110
|
dataItems: items,
|
|
128
111
|
defaultItem: defaultItem,
|
|
129
112
|
itemRender: this.customItemRender,
|
|
@@ -135,12 +118,8 @@ var FontNameVue2 = {
|
|
|
135
118
|
var dropdown = h(DropDownList, __assign({
|
|
136
119
|
onChange: this.onChange,
|
|
137
120
|
on: this.v3 ? undefined : {
|
|
138
|
-
'change': this.onChange
|
|
139
|
-
'close': this.onClose,
|
|
140
|
-
'open': this.onOpen
|
|
121
|
+
'change': this.onChange
|
|
141
122
|
},
|
|
142
|
-
onClose: this.onClose,
|
|
143
|
-
onOpen: this.onOpen,
|
|
144
123
|
style: userSelectNone,
|
|
145
124
|
attrs: this.v3 ? undefined : ddlProps
|
|
146
125
|
}, ddlProps));
|
|
@@ -163,35 +142,19 @@ var FontNameVue2 = {
|
|
|
163
142
|
view = _a.view,
|
|
164
143
|
settings = _a.settings;
|
|
165
144
|
var style = settings.style;
|
|
145
|
+
var item = e.target.value;
|
|
166
146
|
|
|
167
|
-
if (
|
|
147
|
+
if (view) {
|
|
168
148
|
applyInlineStyle({
|
|
169
149
|
style: style,
|
|
170
|
-
value:
|
|
150
|
+
value: item.value
|
|
171
151
|
}, settings.commandName)(view.state, view.dispatch);
|
|
172
|
-
|
|
173
|
-
this.currentValue = null;
|
|
174
|
-
} else {
|
|
175
|
-
this.currentValue = e.target.value;
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
onClose: function onClose(e) {
|
|
179
|
-
var _a = this.$props,
|
|
180
|
-
view = _a.view,
|
|
181
|
-
settings = _a.settings;
|
|
182
|
-
var style = settings.style;
|
|
152
|
+
var event_1 = e.event;
|
|
183
153
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
value: this.computedValue.value
|
|
188
|
-
}, settings.commandName)(view.state, view.dispatch);
|
|
189
|
-
view.focus();
|
|
190
|
-
this.currentValue = null;
|
|
154
|
+
if (event_1 && event_1.type === 'click') {
|
|
155
|
+
view.focus();
|
|
156
|
+
}
|
|
191
157
|
}
|
|
192
|
-
},
|
|
193
|
-
onOpen: function onOpen() {
|
|
194
|
-
this.currentOpened = true;
|
|
195
158
|
}
|
|
196
159
|
}
|
|
197
160
|
};
|
|
@@ -47,7 +47,6 @@ var allVue = Vue;
|
|
|
47
47
|
var gh = allVue.h;
|
|
48
48
|
import { DropDownList } from '@progress/kendo-vue-dropdowns';
|
|
49
49
|
import { getBlockFormats, formatBlockElements } from '@progress/kendo-editor-common';
|
|
50
|
-
import { Keys } from '@progress/kendo-vue-common';
|
|
51
50
|
import { userSelectNone } from './utils';
|
|
52
51
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
53
52
|
import { messages } from './../messages'; // tslint:enable:max-line-length
|
|
@@ -70,27 +69,6 @@ var FormatBlockVue2 = {
|
|
|
70
69
|
default: null
|
|
71
70
|
}
|
|
72
71
|
},
|
|
73
|
-
data: function data() {
|
|
74
|
-
return {
|
|
75
|
-
currentValue: null,
|
|
76
|
-
currentOpened: false
|
|
77
|
-
};
|
|
78
|
-
},
|
|
79
|
-
computed: {
|
|
80
|
-
computedValue: function computedValue() {
|
|
81
|
-
var _a = this.$props,
|
|
82
|
-
view = _a.view,
|
|
83
|
-
settings = _a.settings,
|
|
84
|
-
dataItems = _a.dataItems;
|
|
85
|
-
var items = dataItems || settings.items;
|
|
86
|
-
var state = view && view.state;
|
|
87
|
-
var formats = state ? getBlockFormats(state) : [];
|
|
88
|
-
var value = new Set(formats).size === 1 ? formats[0] : null;
|
|
89
|
-
return this.currentValue ? this.currentValue : value ? items.find(function (i) {
|
|
90
|
-
return i.value === value;
|
|
91
|
-
}) : value;
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
72
|
// @ts-ignore
|
|
95
73
|
setup: !gh ? undefined : function () {
|
|
96
74
|
var v3 = !!gh;
|
|
@@ -111,6 +89,9 @@ var FormatBlockVue2 = {
|
|
|
111
89
|
other = __rest(_a, ["view", "render", "dataItems", "settings", "defaultItem"]);
|
|
112
90
|
|
|
113
91
|
var items = dataItems || settings.items;
|
|
92
|
+
var state = view && view.state;
|
|
93
|
+
var formats = state ? getBlockFormats(state) : [];
|
|
94
|
+
var value = new Set(formats).size === 1 ? formats[0] : null;
|
|
114
95
|
var defaultItem = defaultItemProps || settings.defaultItem;
|
|
115
96
|
var localization = provideLocalizationService(this);
|
|
116
97
|
|
|
@@ -120,24 +101,25 @@ var FormatBlockVue2 = {
|
|
|
120
101
|
}
|
|
121
102
|
|
|
122
103
|
var ddlProps = __assign(__assign(__assign({}, other), {
|
|
123
|
-
value:
|
|
104
|
+
value: value ? items.find(function (i) {
|
|
105
|
+
return i.value === value;
|
|
106
|
+
}) : value,
|
|
124
107
|
dataItems: items,
|
|
125
108
|
defaultItem: defaultItem,
|
|
126
109
|
itemRender: this.customItemRender,
|
|
127
110
|
textField: 'text',
|
|
128
111
|
dataItemKey: 'value',
|
|
129
|
-
leftRightKeysNavigation: false
|
|
112
|
+
leftRightKeysNavigation: false,
|
|
113
|
+
popupSettings: {
|
|
114
|
+
width: '170px'
|
|
115
|
+
}
|
|
130
116
|
}), settings.props);
|
|
131
117
|
|
|
132
118
|
var dropdown = h(DropDownList, __assign({
|
|
133
119
|
onChange: this.onChange,
|
|
134
120
|
on: this.v3 ? undefined : {
|
|
135
|
-
'change': this.onChange
|
|
136
|
-
'close': this.onClose,
|
|
137
|
-
'open': this.onOpen
|
|
121
|
+
'change': this.onChange
|
|
138
122
|
},
|
|
139
|
-
onClose: this.onClose,
|
|
140
|
-
onOpen: this.onOpen,
|
|
141
123
|
style: userSelectNone,
|
|
142
124
|
attrs: this.v3 ? undefined : ddlProps
|
|
143
125
|
}, ddlProps));
|
|
@@ -159,29 +141,15 @@ var FormatBlockVue2 = {
|
|
|
159
141
|
var _a = this.$props,
|
|
160
142
|
view = _a.view,
|
|
161
143
|
settings = _a.settings;
|
|
144
|
+
var item = e.target.value;
|
|
162
145
|
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
view.focus();
|
|
166
|
-
this.currentValue = null;
|
|
167
|
-
} else {
|
|
168
|
-
this.currentValue = e.target.value;
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
onClose: function onClose(e) {
|
|
172
|
-
var _a = this.$props,
|
|
173
|
-
view = _a.view,
|
|
174
|
-
settings = _a.settings;
|
|
175
|
-
this.currentOpened = false;
|
|
146
|
+
if (view && formatBlockElements(item.value, settings.commandName)(view.state, view.dispatch)) {
|
|
147
|
+
var event_1 = e.event;
|
|
176
148
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
this.currentValue = null;
|
|
149
|
+
if (event_1 && event_1.type === 'click') {
|
|
150
|
+
view.focus();
|
|
151
|
+
}
|
|
181
152
|
}
|
|
182
|
-
},
|
|
183
|
-
onOpen: function onOpen() {
|
|
184
|
-
this.currentOpened = true;
|
|
185
153
|
}
|
|
186
154
|
}
|
|
187
155
|
};
|
package/dist/npm/Editor.js
CHANGED
|
@@ -307,12 +307,13 @@ var EditorVue2 = {
|
|
|
307
307
|
},
|
|
308
308
|
data: function data() {
|
|
309
309
|
return {
|
|
310
|
+
updateGuid: kendo_vue_common_1.guid(),
|
|
310
311
|
view: undefined,
|
|
311
312
|
linkDialog: false
|
|
312
313
|
};
|
|
313
314
|
},
|
|
314
315
|
created: function created() {
|
|
315
|
-
this.
|
|
316
|
+
this.view = undefined;
|
|
316
317
|
kendo_vue_common_1.validatePackage(package_metadata_1.packageMetadata);
|
|
317
318
|
},
|
|
318
319
|
mounted: function mounted() {
|
|
@@ -330,7 +331,7 @@ var EditorVue2 = {
|
|
|
330
331
|
},
|
|
331
332
|
updated: function updated() {
|
|
332
333
|
var value = this.$props.value;
|
|
333
|
-
var view = this.
|
|
334
|
+
var view = this.view;
|
|
334
335
|
|
|
335
336
|
if (value === undefined || !view) {
|
|
336
337
|
return;
|
|
@@ -349,8 +350,8 @@ var EditorVue2 = {
|
|
|
349
350
|
},
|
|
350
351
|
// @ts-ignore
|
|
351
352
|
unmounted: function unmounted() {
|
|
352
|
-
if (this.
|
|
353
|
-
this.
|
|
353
|
+
if (this.view) {
|
|
354
|
+
this.view.destroy();
|
|
354
355
|
}
|
|
355
356
|
|
|
356
357
|
this.view = undefined;
|
|
@@ -361,8 +362,8 @@ var EditorVue2 = {
|
|
|
361
362
|
return this.trOnChange.doc;
|
|
362
363
|
} else if (this.$props.value !== undefined) {
|
|
363
364
|
return this.$props.value;
|
|
364
|
-
} else if (this.
|
|
365
|
-
return this.
|
|
365
|
+
} else if (this.view) {
|
|
366
|
+
return this.view.state.doc;
|
|
366
367
|
}
|
|
367
368
|
|
|
368
369
|
return this.$props.defaultContent || '';
|
|
@@ -380,6 +381,7 @@ var EditorVue2 = {
|
|
|
380
381
|
var _this = this;
|
|
381
382
|
|
|
382
383
|
var h = gh || createElement;
|
|
384
|
+
var toolindex = 100;
|
|
383
385
|
var _a = this.$props,
|
|
384
386
|
_b = _a.tools,
|
|
385
387
|
tools = _b === void 0 ? [] : _b,
|
|
@@ -421,14 +423,17 @@ var EditorVue2 = {
|
|
|
421
423
|
});
|
|
422
424
|
};
|
|
423
425
|
|
|
424
|
-
var renderTool = function renderTool(currentTool,
|
|
426
|
+
var renderTool = function renderTool(currentTool, _index) {
|
|
425
427
|
var ct = exports.allTools[currentTool] || currentTool;
|
|
426
428
|
|
|
427
429
|
if (exports.allTools[currentTool]) {
|
|
430
|
+
toolindex++;
|
|
431
|
+
|
|
428
432
|
var toolProps = __assign({
|
|
429
433
|
view: view,
|
|
430
434
|
dir: this.$props.dir,
|
|
431
|
-
key:
|
|
435
|
+
key: toolindex,
|
|
436
|
+
updateGuid: this.updateGuid,
|
|
432
437
|
settings: exports.allTools[currentTool].props
|
|
433
438
|
}, exports.allTools[currentTool].props);
|
|
434
439
|
|
|
@@ -438,7 +443,7 @@ var EditorVue2 = {
|
|
|
438
443
|
} else if (ct === 'Separator') {
|
|
439
444
|
return (// @ts-ignore
|
|
440
445
|
h(kendo_vue_buttons_1.ToolbarSeparator, {
|
|
441
|
-
key:
|
|
446
|
+
key: toolindex
|
|
442
447
|
})
|
|
443
448
|
);
|
|
444
449
|
} else {
|
|
@@ -451,7 +456,8 @@ var EditorVue2 = {
|
|
|
451
456
|
additionalProps: {
|
|
452
457
|
view: view,
|
|
453
458
|
dir: this.$props.dir,
|
|
454
|
-
|
|
459
|
+
updateGuid: this.updateGuid,
|
|
460
|
+
key: toolindex,
|
|
455
461
|
settings: ct.props
|
|
456
462
|
}
|
|
457
463
|
});
|
|
@@ -517,7 +523,7 @@ var EditorVue2 = {
|
|
|
517
523
|
},
|
|
518
524
|
methods: {
|
|
519
525
|
getView: function getView() {
|
|
520
|
-
return this.
|
|
526
|
+
return this.view;
|
|
521
527
|
},
|
|
522
528
|
getHTML: function getHTML() {
|
|
523
529
|
var view = this.getView();
|
|
@@ -536,16 +542,15 @@ var EditorVue2 = {
|
|
|
536
542
|
}
|
|
537
543
|
},
|
|
538
544
|
focus: function focus() {
|
|
539
|
-
if (this.
|
|
540
|
-
this.
|
|
545
|
+
if (this.view) {
|
|
546
|
+
this.view.focus();
|
|
541
547
|
}
|
|
542
548
|
},
|
|
543
549
|
updateTools: function updateTools(view) {
|
|
544
550
|
this.view = view;
|
|
545
551
|
|
|
546
552
|
if (this.v3) {
|
|
547
|
-
this.
|
|
548
|
-
this.$forceUpdate();
|
|
553
|
+
this.updateGuid = kendo_vue_common_1.guid();
|
|
549
554
|
}
|
|
550
555
|
},
|
|
551
556
|
iframeLoad: function iframeLoad() {
|
|
@@ -624,7 +629,7 @@ var EditorVue2 = {
|
|
|
624
629
|
})), {
|
|
625
630
|
'Mod-k': function ModK() {
|
|
626
631
|
var linkDialog = _this.$data.linkDialog;
|
|
627
|
-
var editorView = _this.
|
|
632
|
+
var editorView = _this.view;
|
|
628
633
|
|
|
629
634
|
if (editorView) {
|
|
630
635
|
var editorState = editorView.state;
|
|
@@ -672,10 +677,10 @@ var EditorVue2 = {
|
|
|
672
677
|
dom: dom
|
|
673
678
|
};
|
|
674
679
|
this.$emit('loaded', mountEvent);
|
|
675
|
-
var view = this
|
|
680
|
+
var view = this.$props.extendView && this.$props.extendView(mountEvent) || new kendo_editor_common_1.EditorView({
|
|
676
681
|
mount: dom
|
|
677
682
|
}, viewProps);
|
|
678
|
-
this.view = view;
|
|
683
|
+
this.view = this.v3 ? markRaw(view) : view;
|
|
679
684
|
},
|
|
680
685
|
filterTransaction: function filterTransaction(transaction, state) {
|
|
681
686
|
var event = {
|
|
@@ -729,8 +734,8 @@ var EditorVue2 = {
|
|
|
729
734
|
this.$emit('change', event_2);
|
|
730
735
|
}
|
|
731
736
|
|
|
732
|
-
if (this.
|
|
733
|
-
this.
|
|
737
|
+
if (this.view && (this.$props.value === undefined || !docChanged)) {
|
|
738
|
+
this.view.updateState(this.view.state.apply(transaction));
|
|
734
739
|
}
|
|
735
740
|
},
|
|
736
741
|
onFocus: function onFocus(_view, nativeEvent) {
|
|
@@ -32,6 +32,10 @@ var settings = toolsSettings_1.EditorToolsSettings.findAndReplace; // tslint:ena
|
|
|
32
32
|
|
|
33
33
|
var FindAndReplaceDialogVue2 = {
|
|
34
34
|
name: 'KendoFindAndReplaceDialog',
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
emits: {
|
|
37
|
+
close: null
|
|
38
|
+
},
|
|
35
39
|
props: {
|
|
36
40
|
view: Object,
|
|
37
41
|
settings: {
|
|
@@ -71,6 +75,13 @@ var FindAndReplaceDialogVue2 = {
|
|
|
71
75
|
|
|
72
76
|
this.setNextState();
|
|
73
77
|
this.hasMounted = true;
|
|
78
|
+
setTimeout(function () {
|
|
79
|
+
var findInput = document.getElementById('findWhatFind');
|
|
80
|
+
|
|
81
|
+
if (findInput) {
|
|
82
|
+
findInput.focus();
|
|
83
|
+
}
|
|
84
|
+
}, 10);
|
|
74
85
|
},
|
|
75
86
|
|
|
76
87
|
/**
|