@progress/kendo-angular-editor 2.5.0 → 3.0.0-dev.202201191455
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/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-editor.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/error-messages.js +4 -3
- package/dist/es/config/command-icons.js +1 -0
- package/dist/es/config/commands.js +18 -17
- package/dist/es/config/schema.js +2 -4
- package/dist/es/config/table-commands.js +1 -363
- package/dist/es/dialogs/colorpicker-dialog.component.js +1 -1
- package/dist/es/dialogs/file-link-dialog.component.js +1 -1
- package/dist/es/dialogs/image-dialog.component.js +1 -1
- package/dist/es/editor-toolbar-state.js +12 -2
- package/dist/es/editor.component.js +103 -75
- package/dist/es/editor.module.js +6 -3
- package/dist/es/index.js +2 -0
- package/dist/es/localization/messages.js +4 -0
- package/dist/es/main.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/{es2015/config/table-nodes.d.ts → es/preventable-events/paste-event-data.js} +0 -5
- package/dist/es/preventable-events/paste-event.js +25 -0
- package/dist/es/tools/blockquote/editor-blockquote-button.directive.js +48 -0
- package/dist/es/tools/colorpicker/editor-colorpicker.component.js +24 -7
- package/dist/es/tools/format/editor-format-dropdownlist.component.js +1 -1
- package/dist/es/tools/format/editor-format.component.js +0 -1
- package/dist/es/tools/tables/popup-table-grid.component.js +1 -1
- package/dist/es2015/common/commands.d.ts +1 -1
- package/dist/es2015/common/error-messages.js +4 -3
- package/dist/es2015/common/format-item.interface.d.ts +1 -1
- package/dist/es2015/common/paste-cleanup-settings.d.ts +14 -0
- package/dist/es2015/config/command-icons.js +1 -0
- package/dist/es2015/config/commands.js +18 -17
- package/dist/es2015/config/schema.d.ts +1 -1
- package/dist/es2015/config/schema.js +2 -3
- package/dist/es2015/config/table-commands.d.ts +0 -36
- package/dist/es2015/config/table-commands.js +1 -357
- package/dist/es2015/dialogs/colorpicker-dialog.component.js +1 -1
- package/dist/es2015/dialogs/file-link-dialog.component.js +4 -4
- package/dist/es2015/dialogs/image-dialog.component.js +4 -4
- package/dist/es2015/editor-toolbar-state.js +12 -2
- package/dist/es2015/editor.component.d.ts +16 -11
- package/dist/es2015/editor.component.js +105 -75
- package/dist/es2015/editor.module.js +6 -3
- package/dist/es2015/index.d.ts +2 -0
- package/dist/es2015/index.js +2 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/localization/messages.d.ts +4 -0
- package/dist/es2015/localization/messages.js +4 -0
- package/dist/es2015/main.d.ts +2 -0
- package/dist/es2015/main.js +1 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/preventable-events/paste-event-data.d.ts +21 -0
- package/dist/es2015/preventable-events/paste-event-data.js +4 -0
- package/dist/es2015/preventable-events/paste-event.d.ts +27 -0
- package/dist/es2015/preventable-events/paste-event.js +20 -0
- package/dist/es2015/tools/blockquote/editor-blockquote-button.directive.d.ts +30 -0
- package/dist/es2015/tools/blockquote/editor-blockquote-button.directive.js +45 -0
- package/dist/es2015/tools/colorpicker/editor-colorpicker.component.d.ts +8 -2
- package/dist/es2015/tools/colorpicker/editor-colorpicker.component.js +20 -7
- package/dist/es2015/tools/format/editor-format-dropdownlist.component.js +0 -4
- package/dist/es2015/tools/format/editor-format.component.js +0 -1
- package/dist/es2015/tools/tables/popup-table-grid.component.js +2 -2
- package/dist/fesm2015/index.js +354 -1624
- package/dist/fesm5/index.js +365 -1649
- package/dist/npm/common/error-messages.js +4 -2
- package/dist/npm/config/command-icons.js +1 -0
- package/dist/npm/config/commands.js +16 -14
- package/dist/npm/config/schema.js +2 -4
- package/dist/npm/config/table-commands.js +1 -368
- package/dist/npm/dialogs/colorpicker-dialog.component.js +1 -1
- package/dist/npm/dialogs/file-link-dialog.component.js +1 -1
- package/dist/npm/dialogs/image-dialog.component.js +1 -1
- package/dist/npm/editor-toolbar-state.js +11 -1
- package/dist/npm/editor.component.js +99 -71
- package/dist/npm/editor.module.js +7 -4
- package/dist/npm/index.js +5 -0
- package/dist/npm/localization/messages.js +4 -0
- package/dist/npm/main.js +2 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/preventable-events/paste-event-data.js +6 -0
- package/dist/npm/preventable-events/paste-event.js +27 -0
- package/dist/npm/tools/blockquote/editor-blockquote-button.directive.js +50 -0
- package/dist/npm/tools/colorpicker/editor-colorpicker.component.js +24 -7
- package/dist/npm/tools/format/editor-format-dropdownlist.component.js +1 -1
- package/dist/npm/tools/format/editor-format.component.js +0 -1
- package/dist/npm/tools/tables/popup-table-grid.component.js +1 -1
- package/dist/systemjs/kendo-angular-editor.js +1 -1
- package/package.json +18 -18
- package/dist/es/config/table-nodes.js +0 -146
- package/dist/es/config/tables/CellSelection.js +0 -268
- package/dist/es/config/tables/TableMap.js +0 -333
- package/dist/es/config/tables/table-utils.js +0 -302
- package/dist/es2015/config/table-nodes.js +0 -145
- package/dist/es2015/config/tables/CellSelection.d.ts +0 -35
- package/dist/es2015/config/tables/CellSelection.js +0 -256
- package/dist/es2015/config/tables/TableMap.d.ts +0 -35
- package/dist/es2015/config/tables/TableMap.js +0 -329
- package/dist/es2015/config/tables/table-utils.d.ts +0 -77
- package/dist/es2015/config/tables/table-utils.js +0 -299
- package/dist/npm/config/table-nodes.js +0 -157
- package/dist/npm/config/tables/CellSelection.js +0 -270
- package/dist/npm/config/tables/TableMap.js +0 -338
- package/dist/npm/config/tables/table-utils.js +0 -307
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { Component, HostBinding, ViewChild, ContentChild, ViewContainerRef, Output, ElementRef, EventEmitter, forwardRef, Input, ChangeDetectorRef, NgZone, isDevMode } from '@angular/core';
|
|
7
7
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
|
-
import { BehaviorSubject, fromEvent,
|
|
9
|
-
import { map, filter,
|
|
8
|
+
import { BehaviorSubject, fromEvent, Subject, zip } from 'rxjs';
|
|
9
|
+
import { map, filter, take } from 'rxjs/operators';
|
|
10
10
|
import { ToolBarComponent } from '@progress/kendo-angular-toolbar';
|
|
11
11
|
import { DialogService } from '@progress/kendo-angular-dialog';
|
|
12
|
-
import { isDocumentAvailable, KendoInput } from '@progress/kendo-angular-common';
|
|
13
|
-
import { buildKeymap, buildListKeymap,
|
|
12
|
+
import { hasObservers, isDocumentAvailable, KendoInput } from '@progress/kendo-angular-common';
|
|
13
|
+
import { buildKeymap, buildListKeymap, getHtml, pasteCleanup, sanitize, removeComments, sanitizeClassAttr, sanitizeStyleAttr, removeAttribute, placeholder, EditorView, EditorState, baseKeymap, keymap, history, parseContent, Plugin, PluginKey, TextSelection, Schema, AllSelection, gapCursor, getSelectionText, imageResizing, tableEditing } from '@progress/kendo-editor-common';
|
|
14
14
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
15
15
|
import { packageMetadata } from './package-metadata';
|
|
16
16
|
import { schema } from './config/schema';
|
|
@@ -25,15 +25,16 @@ import { EditorLocalizationService } from './localization/editor-localization.se
|
|
|
25
25
|
import { defaultStyle, tablesStyles, rtlStyles } from './common/styles';
|
|
26
26
|
import { EditorErrorMessages } from './common/error-messages';
|
|
27
27
|
import { EditorToolsService } from './tools/tools.service';
|
|
28
|
+
import { EditorPasteEvent } from './preventable-events/paste-event';
|
|
28
29
|
var EMPTY_PARAGRAPH = '<p></p>';
|
|
29
30
|
var defaultPasteCleanupSettings = {
|
|
30
31
|
convertMsLists: false,
|
|
31
32
|
removeAttributes: [],
|
|
32
33
|
removeHtmlComments: false,
|
|
33
|
-
removeInvalidHTML:
|
|
34
|
+
removeInvalidHTML: true,
|
|
34
35
|
removeMsClasses: false,
|
|
35
36
|
removeMsStyles: false,
|
|
36
|
-
stripTags: [
|
|
37
|
+
stripTags: []
|
|
37
38
|
};
|
|
38
39
|
var removeCommentsIf = conditionallyExecute(removeComments);
|
|
39
40
|
var removeInvalidHTMLIf = conditionallyExecute(sanitize);
|
|
@@ -74,14 +75,6 @@ var EditorComponent = /** @class */ (function () {
|
|
|
74
75
|
* @default false
|
|
75
76
|
*/
|
|
76
77
|
this.applyToWord = false;
|
|
77
|
-
/**
|
|
78
|
-
* By design, the Editor emits `valueChange`, updates the model and the ToolBar state on each keystroke.
|
|
79
|
-
* When you are interested in ignoring the new values for a given amout of time and take only the most recent one, you can use the `updateInterval` property.
|
|
80
|
-
* A possible use case is to get the new values and to update the ToolBar state at a maximum rate per second in order to speed up your application.
|
|
81
|
-
* The specified interval (in milliseconds) should be a positive number.
|
|
82
|
-
* By default the `updateInterval` is set to 100 miliseconds. If set to zero the delay will be disabled entirely.
|
|
83
|
-
*/
|
|
84
|
-
this.updateInterval = 100;
|
|
85
78
|
/**
|
|
86
79
|
* By default, whitespace is collapsed as per HTML's rules.
|
|
87
80
|
* Set to `true` to preserve whitespace, but normalize newlines to spaces.
|
|
@@ -107,6 +100,11 @@ var EditorComponent = /** @class */ (function () {
|
|
|
107
100
|
* Fires when the content area of the Editor is focused ([see example]({% slug overview_editor %}#toc-events)).
|
|
108
101
|
*/
|
|
109
102
|
this.onFocus = new EventEmitter();
|
|
103
|
+
/**
|
|
104
|
+
* Fires when the user performs paste in the content area of the Editor ([see example]({% slug overview_editor %}#toc-events)).
|
|
105
|
+
* The event is preventable. If you cancel it, the Editor content will not change.
|
|
106
|
+
*/
|
|
107
|
+
this.paste = new EventEmitter();
|
|
110
108
|
/**
|
|
111
109
|
* Fires when the content area of the Editor is blurred ([see example]({% slug overview_editor %}#toc-events)).
|
|
112
110
|
*/
|
|
@@ -122,10 +120,76 @@ var EditorComponent = /** @class */ (function () {
|
|
|
122
120
|
this.valueModified = new Subject();
|
|
123
121
|
this._readonly = false;
|
|
124
122
|
this._placeholder = '';
|
|
123
|
+
this.inForm = false;
|
|
125
124
|
this.afterViewInit = new Subject();
|
|
126
125
|
this.contentAreaLoaded = new Subject();
|
|
127
|
-
this.
|
|
126
|
+
this.dispatchTransaction = function (tr) {
|
|
127
|
+
var docChanged = tr.docChanged;
|
|
128
|
+
if (_this.disabled || (_this.readonly && docChanged)) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (docChanged) {
|
|
132
|
+
var doc = tr.doc;
|
|
133
|
+
var html_1 = getHtml({ doc: doc });
|
|
134
|
+
_this.trOnChange = tr;
|
|
135
|
+
_this.htmlOnChange = html_1;
|
|
136
|
+
_this.ngZone.run(function () {
|
|
137
|
+
_this.valueModified.next(html_1);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (!docChanged || _this.inForm) {
|
|
141
|
+
_this.view.updateState(_this.view.state.apply(tr));
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
this.transformPastedHTML = function (dirtyHtml) {
|
|
145
|
+
var pasteCleanupSettings = tslib_1.__assign({}, defaultPasteCleanupSettings, _this.pasteCleanupSettings);
|
|
146
|
+
var html = pipe(removeInvalidHTMLIf(pasteCleanupSettings.removeInvalidHTML), removeCommentsIf(pasteCleanupSettings.removeHtmlComments))(dirtyHtml);
|
|
147
|
+
var clean = pasteCleanup(html, {
|
|
148
|
+
convertMsLists: pasteCleanupSettings.convertMsLists,
|
|
149
|
+
stripTags: pasteCleanupSettings.stripTags.join('|'),
|
|
150
|
+
attributes: getPasteCleanupAttributes(pasteCleanupSettings)
|
|
151
|
+
});
|
|
152
|
+
if (hasObservers(_this.paste)) {
|
|
153
|
+
var event_1 = new EditorPasteEvent(clean, dirtyHtml, _this._pasteEvent);
|
|
154
|
+
_this.ngZone.run(function () { return _this.paste.emit(event_1); });
|
|
155
|
+
return event_1.isDefaultPrevented() ? '' : event_1.cleanedHtml;
|
|
156
|
+
}
|
|
157
|
+
return clean;
|
|
158
|
+
};
|
|
159
|
+
this.changeValue = function (value) {
|
|
160
|
+
var prev = _this._value;
|
|
161
|
+
_this._value = value;
|
|
162
|
+
if (!_this._view) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (_this.htmlOnChange === value && _this.trOnChange) {
|
|
166
|
+
_this.view.updateState(_this.view.state.apply(_this.trOnChange));
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
if ((prev || '') !== (value || '')) {
|
|
170
|
+
var iframeContentWindowNotPresent = _this.iframe && !_this.container.element.nativeElement.contentWindow;
|
|
171
|
+
if (iframeContentWindowNotPresent) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
var state = _this.view.state;
|
|
175
|
+
var nextDoc = parseContent(value || '', state.schema, { preserveWhitespace: _this.preserveWhitespace });
|
|
176
|
+
var tr = state.tr
|
|
177
|
+
.setSelection(new AllSelection(state.doc))
|
|
178
|
+
.replaceSelectionWith(nextDoc);
|
|
179
|
+
_this.view.updateState(state.apply(tr));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
_this.trOnChange = null;
|
|
183
|
+
_this.htmlOnChange = null;
|
|
184
|
+
};
|
|
185
|
+
this.onChangeCallback = function (value) {
|
|
186
|
+
_this.changeValue(value);
|
|
187
|
+
};
|
|
128
188
|
this.onTouchedCallback = function (_) { }; // tslint:disable-line:no-empty
|
|
189
|
+
this.onPaste = function (_view, nativeEvent) {
|
|
190
|
+
_this._pasteEvent = nativeEvent;
|
|
191
|
+
return false;
|
|
192
|
+
};
|
|
129
193
|
validatePackage(packageMetadata);
|
|
130
194
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
131
195
|
// https://stackoverflow.com/questions/56572483/chrome-is-synchronously-handling-iframe-loading-whereas-firefox-handles-it-asyn
|
|
@@ -134,6 +198,9 @@ var EditorComponent = /** @class */ (function () {
|
|
|
134
198
|
EditorComponent_1 = EditorComponent;
|
|
135
199
|
Object.defineProperty(EditorComponent.prototype, "value", {
|
|
136
200
|
get: function () {
|
|
201
|
+
if (this.trOnChange) {
|
|
202
|
+
return this.htmlOnChange;
|
|
203
|
+
}
|
|
137
204
|
var value = this._view ? this.getSource() : this._value;
|
|
138
205
|
if (value === EMPTY_PARAGRAPH) {
|
|
139
206
|
return this._value ? '' : this._value;
|
|
@@ -146,23 +213,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
146
213
|
* Sets the value of the Editor ([see example]({% slug overview_editor %}#toc-basic-usage)).
|
|
147
214
|
*/
|
|
148
215
|
set: function (value) {
|
|
149
|
-
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
this._value = value;
|
|
153
|
-
this._previousValue = value;
|
|
154
|
-
if (this._view) {
|
|
155
|
-
var iframeContentWindowNotPresent = this.iframe && !this.container.element.nativeElement.contentWindow;
|
|
156
|
-
if (iframeContentWindowNotPresent) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
this.exec('setHTML', {
|
|
160
|
-
content: this._value || '',
|
|
161
|
-
parseOptions: {
|
|
162
|
-
preserveWhitespace: this.preserveWhitespace
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}
|
|
216
|
+
this.changeValue(value);
|
|
166
217
|
},
|
|
167
218
|
enumerable: true,
|
|
168
219
|
configurable: true
|
|
@@ -423,6 +474,9 @@ var EditorComponent = /** @class */ (function () {
|
|
|
423
474
|
};
|
|
424
475
|
EditorComponent.prototype.ngOnChanges = function (changes) {
|
|
425
476
|
var _this = this;
|
|
477
|
+
if (changes.value && this.view) {
|
|
478
|
+
this.changeValue(changes.value.currentValue);
|
|
479
|
+
}
|
|
426
480
|
if (changes.iframe && !changes.iframe.isFirstChange()) {
|
|
427
481
|
this.ngZone.onStable.pipe(take(1)).subscribe(function () { return _this.initialize(); });
|
|
428
482
|
}
|
|
@@ -450,7 +504,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
450
504
|
* @param {any} attr - Optional parameters for the command. Apart from the following list,
|
|
451
505
|
* the parameters do not expect specific attributes when you call them:
|
|
452
506
|
* - `format` - Accepts an object with the `tag` property.
|
|
453
|
-
* The supported tags are `p
|
|
507
|
+
* The supported tags are `p` and any of the `h1` to `h6` heading tags.
|
|
454
508
|
* - `createLink` - Accepts an object with the `href`, `title`, and `target` properties. The `href` property is mandatory.
|
|
455
509
|
* - `setHTML` - Accepts a `string` parameter.
|
|
456
510
|
* - `insertTable` - Accepts an object with the `rows` and `cols` properties. The number values are zero based.
|
|
@@ -508,8 +562,6 @@ var EditorComponent = /** @class */ (function () {
|
|
|
508
562
|
var command = editorCommands[commandName](attr);
|
|
509
563
|
// Executes a ProseMirror command.
|
|
510
564
|
command(this._view.state, this._view.dispatch, this._view);
|
|
511
|
-
// See the `dispatchTransaction` comments.
|
|
512
|
-
// this.stateChange.emit(updateToolBar(this.view));
|
|
513
565
|
};
|
|
514
566
|
/**
|
|
515
567
|
* Opens a dialog.
|
|
@@ -594,6 +646,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
594
646
|
* @hidden
|
|
595
647
|
*/
|
|
596
648
|
EditorComponent.prototype.writeValue = function (value) {
|
|
649
|
+
this.inForm = true;
|
|
597
650
|
// To avoid confusion, non-existent values are always undefined.
|
|
598
651
|
this.value = value === null ? undefined : value;
|
|
599
652
|
};
|
|
@@ -622,7 +675,6 @@ var EditorComponent = /** @class */ (function () {
|
|
|
622
675
|
return;
|
|
623
676
|
}
|
|
624
677
|
var currentSchema = this.schema || schema;
|
|
625
|
-
var that = this;
|
|
626
678
|
var containerNativeElement = this.container.element.nativeElement;
|
|
627
679
|
var contentNode = parseContent((this.value || '').trim(), currentSchema, { preserveWhitespace: this.preserveWhitespace });
|
|
628
680
|
if (this.iframe) {
|
|
@@ -664,16 +716,13 @@ var EditorComponent = /** @class */ (function () {
|
|
|
664
716
|
}
|
|
665
717
|
}); }
|
|
666
718
|
}),
|
|
667
|
-
new Plugin({
|
|
668
|
-
key: new PluginKey('editor-filter-disabled-state'),
|
|
669
|
-
filterTransaction: function () { return !_this.disabled; }
|
|
670
|
-
}),
|
|
671
719
|
history(),
|
|
672
720
|
keymap(buildListKeymap(currentSchema)),
|
|
673
721
|
keymap(buildKeymap(currentSchema, { applyToWord: this.applyToWord })),
|
|
674
722
|
keymap(baseKeymap),
|
|
675
723
|
gapCursor(),
|
|
676
|
-
imageResizing()
|
|
724
|
+
imageResizing(),
|
|
725
|
+
tableEditing()
|
|
677
726
|
];
|
|
678
727
|
if (this.placeholder) {
|
|
679
728
|
defaultPlugins.push(placeholder(this.placeholder));
|
|
@@ -693,31 +742,10 @@ var EditorComponent = /** @class */ (function () {
|
|
|
693
742
|
_this._view = new EditorView({ mount: _this.viewMountElement }, {
|
|
694
743
|
state: state,
|
|
695
744
|
editable: function () { return !_this.readonly; },
|
|
696
|
-
dispatchTransaction:
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
// When the user utilizes keyboard shortcuts—for example, `Ctrl`+`b`—
|
|
701
|
-
// `tr.docChanged` is `true` and the toolbar is not updated.
|
|
702
|
-
// A possible future solution is to move the keymaps to the service.
|
|
703
|
-
// if (!tr.docChanged) {
|
|
704
|
-
// that.stateChange.emit(updateToolBar(that.view));
|
|
705
|
-
// }
|
|
706
|
-
var value = that.value;
|
|
707
|
-
if (!hasSameMarkup(value, that._previousValue, this.state.schema)) {
|
|
708
|
-
that._previousValue = value;
|
|
709
|
-
that.ngZone.run(function () { return that.valueModified.next(value); });
|
|
710
|
-
}
|
|
711
|
-
},
|
|
712
|
-
transformPastedHTML: function (html) {
|
|
713
|
-
var pasteCleanupSettings = tslib_1.__assign({}, defaultPasteCleanupSettings, _this.pasteCleanupSettings);
|
|
714
|
-
var clean = pipe(removeCommentsIf(pasteCleanupSettings.removeHtmlComments), removeInvalidHTMLIf(pasteCleanupSettings.removeInvalidHTML))(html);
|
|
715
|
-
var attributes = getPasteCleanupAttributes(pasteCleanupSettings);
|
|
716
|
-
return pasteCleanup(clean, {
|
|
717
|
-
convertMsLists: pasteCleanupSettings.convertMsLists,
|
|
718
|
-
stripTags: pasteCleanupSettings.stripTags.join('|'),
|
|
719
|
-
attributes: attributes
|
|
720
|
-
});
|
|
745
|
+
dispatchTransaction: _this.dispatchTransaction,
|
|
746
|
+
transformPastedHTML: _this.transformPastedHTML,
|
|
747
|
+
handleDOMEvents: {
|
|
748
|
+
paste: _this.onPaste
|
|
721
749
|
}
|
|
722
750
|
});
|
|
723
751
|
});
|
|
@@ -733,7 +761,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
733
761
|
this.subs.add(fromEvent(containerElement, 'focusin')
|
|
734
762
|
.subscribe(function () {
|
|
735
763
|
if (_this.readonly) {
|
|
736
|
-
contentAreaClasslist_1.add('k-
|
|
764
|
+
contentAreaClasslist_1.add('k-focus');
|
|
737
765
|
}
|
|
738
766
|
if (!_this.focusChangedProgrammatically || _this.shouldEmitFocus) {
|
|
739
767
|
_this.ngZone.run(function () { return _this.onFocus.emit(); });
|
|
@@ -743,7 +771,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
743
771
|
this.subs.add(fromEvent(containerElement, 'focusout')
|
|
744
772
|
.subscribe(function () {
|
|
745
773
|
if (_this.readonly) {
|
|
746
|
-
contentAreaClasslist_1.remove('k-
|
|
774
|
+
contentAreaClasslist_1.remove('k-focus');
|
|
747
775
|
}
|
|
748
776
|
if (!_this.focusChangedProgrammatically) {
|
|
749
777
|
_this.ngZone.run(function () { return _this.onBlur.emit(); });
|
|
@@ -758,7 +786,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
758
786
|
_this.cdr.detectChanges();
|
|
759
787
|
}
|
|
760
788
|
}));
|
|
761
|
-
this.subs.add(
|
|
789
|
+
this.subs.add(this.valueModified.subscribe(function (value) {
|
|
762
790
|
_this.onChangeCallback(value);
|
|
763
791
|
_this.valueChange.emit(value);
|
|
764
792
|
_this.cdr.markForCheck();
|
|
@@ -852,10 +880,6 @@ var EditorComponent = /** @class */ (function () {
|
|
|
852
880
|
tslib_1.__metadata("design:type", String),
|
|
853
881
|
tslib_1.__metadata("design:paramtypes", [String])
|
|
854
882
|
], EditorComponent.prototype, "placeholder", null);
|
|
855
|
-
tslib_1.__decorate([
|
|
856
|
-
Input(),
|
|
857
|
-
tslib_1.__metadata("design:type", Number)
|
|
858
|
-
], EditorComponent.prototype, "updateInterval", void 0);
|
|
859
883
|
tslib_1.__decorate([
|
|
860
884
|
Input(),
|
|
861
885
|
tslib_1.__metadata("design:type", Object)
|
|
@@ -876,6 +900,10 @@ var EditorComponent = /** @class */ (function () {
|
|
|
876
900
|
Output('focus'),
|
|
877
901
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
878
902
|
], EditorComponent.prototype, "onFocus", void 0);
|
|
903
|
+
tslib_1.__decorate([
|
|
904
|
+
Output(),
|
|
905
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
906
|
+
], EditorComponent.prototype, "paste", void 0);
|
|
879
907
|
tslib_1.__decorate([
|
|
880
908
|
Output('blur'),
|
|
881
909
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -890,7 +918,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
890
918
|
tslib_1.__metadata("design:paramtypes", [])
|
|
891
919
|
], EditorComponent.prototype, "resizableClass", null);
|
|
892
920
|
tslib_1.__decorate([
|
|
893
|
-
HostBinding('class.k-
|
|
921
|
+
HostBinding('class.k-disabled'),
|
|
894
922
|
tslib_1.__metadata("design:type", Boolean),
|
|
895
923
|
tslib_1.__metadata("design:paramtypes", [])
|
|
896
924
|
], EditorComponent.prototype, "isDisabled", null);
|
|
@@ -983,7 +1011,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
983
1011
|
}
|
|
984
1012
|
],
|
|
985
1013
|
/* tslint:disable:max-line-length */
|
|
986
|
-
template: "\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter=\"kendo.editor.alignCenter|The title of the tool that aligns text in the center.\"\n alignCenter=\"Center text\"\n i18n-alignJustify=\"kendo.editor.alignJustify|The title of the tool that justifies text both left and right.\"\n alignJustify=\"Justify\"\n i18n-alignLeft=\"kendo.editor.alignLeft|The title of the tool that aligns text on the left.\"\n alignLeft=\"Align text left\"\n i18n-alignRight=\"kendo.editor.alignRight|The title of the tool that aligns text on the right.\"\n alignRight=\"Align text right\"\n i18n-backColor=\"kendo.editor.backColor|The title of the tool that changes the text background color.\"\n backColor=\"Background color\"\n i18n-bold=\"kendo.editor.bold|The title of the tool that makes text bold.\"\n bold=\"Bold\"\n i18n-cleanFormatting=\"kendo.editor.cleanFormatting|The title of the Clean Formatting tool.\"\n cleanFormatting=\"Clean formatting\"\n i18n-createLink=\"kendo.editor.createLink|The title of the tool that creates hyperlinks.\"\n createLink=\"Insert link\"\n i18n-dialogApply=\"kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs.\"\n dialogApply=\"Apply\"\n i18n-dialogCancel=\"kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs.\"\n dialogCancel=\"Cancel\"\n i18n-dialogInsert=\"kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs.\"\n dialogInsert=\"Insert\"\n i18n-dialogUpdate=\"kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs.\"\n dialogUpdate=\"Update\"\n i18n-fileText=\"kendo.editor.fileText|The caption for the file text in the insertFile dialog.\"\n fileText=\"Text\"\n i18n-fileTitle=\"kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog.\"\n fileTitle=\"Title\"\n i18n-fileWebAddress=\"kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog.\"\n fileWebAddress=\"Web address\"\n i18n-fontFamily=\"kendo.editor.fontFamily|The title of the tool that changes the text font.\"\n fontFamily=\"Select font family\"\n i18n-fontSize=\"kendo.editor.fontSize|The title of the tool that changes the text size.\"\n fontSize=\"Select font size\"\n i18n-foreColor=\"kendo.editor.foreColor|The title of the tool that changes the text color.\"\n foreColor=\"Color\"\n i18n-format=\"kendo.editor.format|The title of the tool that lets users choose block formats.\"\n format=\"Format\"\n i18n-imageAltText=\"kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog.\"\n imageAltText=\"Alternate text\"\n i18n-imageHeight=\"kendo.editor.imageHeight|The caption for the image height in the insertImage dialog.\"\n imageHeight=\"Height (px)\"\n i18n-imageWebAddress=\"kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog.\"\n imageWebAddress=\"Web address\"\n i18n-imageWidth=\"kendo.editor.imageWidth|The caption for the image width in the insertImage dialog.\"\n imageWidth=\"Width (px)\"\n i18n-indent=\"kendo.editor.indent|The title of the tool that indents the content.\"\n indent=\"Indent\"\n i18n-insertFile=\"kendo.editor.insertFile|The title of the tool that inserts links to files.\"\n insertFile=\"Insert file\"\n i18n-insertImage=\"kendo.editor.insertImage|The title of the tool that inserts images.\"\n insertImage=\"Insert image\"\n i18n-insertOrderedList=\"kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list.\"\n insertOrderedList=\"Insert ordered list\"\n i18n-insertUnorderedList=\"kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list.\"\n insertUnorderedList=\"Insert unordered list\"\n i18n-italic=\"kendo.editor.italic|The title of the tool that makes text italicized.\"\n italic=\"Italic\"\n i18n-linkOpenInNewWindow=\"kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog.\"\n linkOpenInNewWindow=\"Open link in new window\"\n i18n-linkText=\"kendo.editor.linkText|The caption for the link text in the createLink dialog.\"\n linkText=\"Text\"\n i18n-linkTitle=\"kendo.editor.linkTitle|The caption for the link title in the createLink dialog.\"\n linkTitle=\"Title\"\n i18n-linkWebAddress=\"kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog.\"\n linkWebAddress=\"Web address\"\n i18n-outdent=\"kendo.editor.outdent|The title of the tool that outdents the content.\"\n outdent=\"Outdent\"\n i18n-print=\"kendo.editor.print|The title of the print tool.\"\n print=\"Print\"\n i18n-redo=\"kendo.editor.redo|The title of the tool that undos the last action.\"\n redo=\"Redo\"\n i18n-selectAll=\"kendo.editor.selectAll|The title of the tool that selects all content.\"\n selectAll=\"Select All\"\n i18n-strikethrough=\"kendo.editor.strikethrough|The title of the tool that strikes through text.\"\n strikethrough=\"Strikethrough\"\n i18n-subscript=\"kendo.editor.subscript|The title of the tool that makes text subscript.\"\n subscript=\"Subscript\"\n i18n-superscript=\"kendo.editor.superscript|The title of the tool that makes text superscript.\"\n superscript=\"Superscript\"\n i18n-underline=\"kendo.editor.underline|The title of the tool that underlines text.\"\n underline=\"Underline\"\n i18n-unlink=\"kendo.editor.unlink|The title of the tool that removes hyperlinks.\"\n unlink=\"Remove Link\"\n i18n-undo=\"kendo.editor.undo|The title of the tool that undos the last action.\"\n undo=\"Undo\"\n i18n-viewSource=\"kendo.editor.viewSource|The title of the tool that shows the editor value as HTML.\"\n viewSource=\"View source\"\n i18n-insertTable=\"kendo.editor.insertTable|The title of the tool that inserts table.\"\n insertTable=\"Insert Table\"\n i18n-addColumnBefore=\"kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column.\"\n addColumnBefore=\"Add column before\"\n i18n-addColumnAfter=\"kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column.\"\n addColumnAfter=\"Add column after\"\n i18n-addRowBefore=\"kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row.\"\n addRowBefore=\"Add row before\"\n i18n-addRowAfter=\"kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row.\"\n addRowAfter=\"Add row after\"\n i18n-deleteColumn=\"kendo.editor.deleteColumn|The title of the tool that deletes a table column.\"\n deleteColumn=\"Delete column\"\n i18n-deleteRow=\"kendo.editor.deleteRow|The title of the tool that deletes a table row.\"\n deleteRow=\"Delete row\"\n i18n-deleteTable=\"kendo.editor.deleteTable|The title of the tool that deletes a table.\"\n deleteTable=\"Delete table\"\n >\n </ng-container>\n\n <ng-content select=\"kendo-toolbar\"></ng-content>\n <kendo-toolbar [overflow]=\"true\" [tabindex]=\"readonly ? -1 : 0\" *ngIf=\"!userToolBarElement\" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf=\"!iframe\" #content [attr.dir]=\"direction\" class=\"k-editor-content\"></div>\n\n <div class=\"k-editor-content\" *ngIf=\"iframe\">\n <iframe #content frameborder=\"0\" class=\"k-iframe\" (load)=\"iframeOnLoad()\"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ",
|
|
1014
|
+
template: "\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter=\"kendo.editor.alignCenter|The title of the tool that aligns text in the center.\"\n alignCenter=\"Center text\"\n i18n-alignJustify=\"kendo.editor.alignJustify|The title of the tool that justifies text both left and right.\"\n alignJustify=\"Justify\"\n i18n-alignLeft=\"kendo.editor.alignLeft|The title of the tool that aligns text on the left.\"\n alignLeft=\"Align text left\"\n i18n-alignRight=\"kendo.editor.alignRight|The title of the tool that aligns text on the right.\"\n alignRight=\"Align text right\"\n i18n-backColor=\"kendo.editor.backColor|The title of the tool that changes the text background color.\"\n backColor=\"Background color\"\n i18n-blockquote=\"kendo.editor.blockquote|The title of the tool that wraps an element in a blockquote\"\n blockquote=\"Quotation\"\n i18n-bold=\"kendo.editor.bold|The title of the tool that makes text bold.\"\n bold=\"Bold\"\n i18n-cleanFormatting=\"kendo.editor.cleanFormatting|The title of the Clean Formatting tool.\"\n cleanFormatting=\"Clean formatting\"\n i18n-createLink=\"kendo.editor.createLink|The title of the tool that creates hyperlinks.\"\n createLink=\"Insert link\"\n i18n-dialogApply=\"kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs.\"\n dialogApply=\"Apply\"\n i18n-dialogCancel=\"kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs.\"\n dialogCancel=\"Cancel\"\n i18n-dialogInsert=\"kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs.\"\n dialogInsert=\"Insert\"\n i18n-dialogUpdate=\"kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs.\"\n dialogUpdate=\"Update\"\n i18n-fileText=\"kendo.editor.fileText|The caption for the file text in the insertFile dialog.\"\n fileText=\"Text\"\n i18n-fileTitle=\"kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog.\"\n fileTitle=\"Title\"\n i18n-fileWebAddress=\"kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog.\"\n fileWebAddress=\"Web address\"\n i18n-fontFamily=\"kendo.editor.fontFamily|The title of the tool that changes the text font.\"\n fontFamily=\"Select font family\"\n i18n-fontSize=\"kendo.editor.fontSize|The title of the tool that changes the text size.\"\n fontSize=\"Select font size\"\n i18n-foreColor=\"kendo.editor.foreColor|The title of the tool that changes the text color.\"\n foreColor=\"Color\"\n i18n-format=\"kendo.editor.format|The title of the tool that lets users choose block formats.\"\n format=\"Format\"\n i18n-imageAltText=\"kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog.\"\n imageAltText=\"Alternate text\"\n i18n-imageHeight=\"kendo.editor.imageHeight|The caption for the image height in the insertImage dialog.\"\n imageHeight=\"Height (px)\"\n i18n-imageWebAddress=\"kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog.\"\n imageWebAddress=\"Web address\"\n i18n-imageWidth=\"kendo.editor.imageWidth|The caption for the image width in the insertImage dialog.\"\n imageWidth=\"Width (px)\"\n i18n-indent=\"kendo.editor.indent|The title of the tool that indents the content.\"\n indent=\"Indent\"\n i18n-insertFile=\"kendo.editor.insertFile|The title of the tool that inserts links to files.\"\n insertFile=\"Insert file\"\n i18n-insertImage=\"kendo.editor.insertImage|The title of the tool that inserts images.\"\n insertImage=\"Insert image\"\n i18n-insertOrderedList=\"kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list.\"\n insertOrderedList=\"Insert ordered list\"\n i18n-insertUnorderedList=\"kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list.\"\n insertUnorderedList=\"Insert unordered list\"\n i18n-italic=\"kendo.editor.italic|The title of the tool that makes text italicized.\"\n italic=\"Italic\"\n i18n-linkOpenInNewWindow=\"kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog.\"\n linkOpenInNewWindow=\"Open link in new window\"\n i18n-linkText=\"kendo.editor.linkText|The caption for the link text in the createLink dialog.\"\n linkText=\"Text\"\n i18n-linkTitle=\"kendo.editor.linkTitle|The caption for the link title in the createLink dialog.\"\n linkTitle=\"Title\"\n i18n-linkWebAddress=\"kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog.\"\n linkWebAddress=\"Web address\"\n i18n-outdent=\"kendo.editor.outdent|The title of the tool that outdents the content.\"\n outdent=\"Outdent\"\n i18n-print=\"kendo.editor.print|The title of the print tool.\"\n print=\"Print\"\n i18n-redo=\"kendo.editor.redo|The title of the tool that undos the last action.\"\n redo=\"Redo\"\n i18n-selectAll=\"kendo.editor.selectAll|The title of the tool that selects all content.\"\n selectAll=\"Select All\"\n i18n-strikethrough=\"kendo.editor.strikethrough|The title of the tool that strikes through text.\"\n strikethrough=\"Strikethrough\"\n i18n-subscript=\"kendo.editor.subscript|The title of the tool that makes text subscript.\"\n subscript=\"Subscript\"\n i18n-superscript=\"kendo.editor.superscript|The title of the tool that makes text superscript.\"\n superscript=\"Superscript\"\n i18n-underline=\"kendo.editor.underline|The title of the tool that underlines text.\"\n underline=\"Underline\"\n i18n-unlink=\"kendo.editor.unlink|The title of the tool that removes hyperlinks.\"\n unlink=\"Remove Link\"\n i18n-undo=\"kendo.editor.undo|The title of the tool that undos the last action.\"\n undo=\"Undo\"\n i18n-viewSource=\"kendo.editor.viewSource|The title of the tool that shows the editor value as HTML.\"\n viewSource=\"View source\"\n i18n-insertTable=\"kendo.editor.insertTable|The title of the tool that inserts table.\"\n insertTable=\"Insert Table\"\n i18n-addColumnBefore=\"kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column.\"\n addColumnBefore=\"Add column before\"\n i18n-addColumnAfter=\"kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column.\"\n addColumnAfter=\"Add column after\"\n i18n-addRowBefore=\"kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row.\"\n addRowBefore=\"Add row before\"\n i18n-addRowAfter=\"kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row.\"\n addRowAfter=\"Add row after\"\n i18n-deleteColumn=\"kendo.editor.deleteColumn|The title of the tool that deletes a table column.\"\n deleteColumn=\"Delete column\"\n i18n-deleteRow=\"kendo.editor.deleteRow|The title of the tool that deletes a table row.\"\n deleteRow=\"Delete row\"\n i18n-deleteTable=\"kendo.editor.deleteTable|The title of the tool that deletes a table.\"\n deleteTable=\"Delete table\"\n >\n </ng-container>\n\n <ng-content select=\"kendo-toolbar\"></ng-content>\n <kendo-toolbar [overflow]=\"true\" [tabindex]=\"readonly ? -1 : 0\" *ngIf=\"!userToolBarElement\" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf=\"!iframe\" #content [attr.dir]=\"direction\" class=\"k-editor-content\"></div>\n\n <div class=\"k-editor-content\" *ngIf=\"iframe\">\n <iframe #content srcdoc=\"<!DOCTYPE html>\" frameborder=\"0\" class=\"k-iframe\" (load)=\"iframeOnLoad()\"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ",
|
|
987
1015
|
styles: [
|
|
988
1016
|
"\n >>> .k-editor-content > .ProseMirror {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n outline: none;\n overflow: auto;\n }\n\n .k-iframe {\n width: 100%;\n height: 100%;\n display: block;\n }\n "
|
|
989
1017
|
]
|
package/dist/es/editor.module.js
CHANGED
|
@@ -10,8 +10,7 @@ import { ToolBarModule } from '@progress/kendo-angular-toolbar';
|
|
|
10
10
|
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
|
|
11
11
|
import { DialogModule } from '@progress/kendo-angular-dialog';
|
|
12
12
|
import { ButtonModule } from '@progress/kendo-angular-buttons';
|
|
13
|
-
import { ColorPickerModule } from '@progress/kendo-angular-inputs';
|
|
14
|
-
import { NumericTextBoxModule, TextBoxModule } from '@progress/kendo-angular-inputs';
|
|
13
|
+
import { NumericTextBoxModule, TextBoxModule, ColorPickerModule, CheckBoxModule } from '@progress/kendo-angular-inputs';
|
|
15
14
|
import { EditorComponent } from './editor.component';
|
|
16
15
|
import { ImageDialogComponent } from './dialogs/image-dialog.component';
|
|
17
16
|
import { SourceDialogComponent } from './dialogs/source-dialog.component';
|
|
@@ -30,6 +29,7 @@ import { EditorAlignLeftButtonDirective } from './tools/alignment/editor-align-l
|
|
|
30
29
|
import { EditorAlignCenterButtonDirective } from './tools/alignment/editor-align-center-button.directive';
|
|
31
30
|
import { EditorAlignRightButtonDirective } from './tools/alignment/editor-align-right-button.directive';
|
|
32
31
|
import { EditorAlignJustifyButtonDirective } from './tools/alignment/editor-align-justify-button.directive';
|
|
32
|
+
import { EditorBlockquoteDirective } from './tools/blockquote/editor-blockquote-button.directive';
|
|
33
33
|
import { EditorRedoButtonDirective } from './tools/history/editor-redo-button.directive';
|
|
34
34
|
import { EditorUndoButtonDirective } from './tools/history/editor-undo-button.directive';
|
|
35
35
|
import { EditorInsertImageButtonDirective } from './tools/image/editor-insert-image-button.directive';
|
|
@@ -123,7 +123,9 @@ var COMPONENT_DIRECTIVES = [
|
|
|
123
123
|
// print
|
|
124
124
|
EditorPrintDirective,
|
|
125
125
|
// select all
|
|
126
|
-
EditorSelectAllButtonDirective
|
|
126
|
+
EditorSelectAllButtonDirective,
|
|
127
|
+
// blockquote
|
|
128
|
+
EditorBlockquoteDirective
|
|
127
129
|
];
|
|
128
130
|
var TOOLBAR_TOOLS = [
|
|
129
131
|
EditorFontSizeComponent,
|
|
@@ -228,6 +230,7 @@ var EditorModule = /** @class */ (function () {
|
|
|
228
230
|
DialogModule,
|
|
229
231
|
DropDownsModule,
|
|
230
232
|
NumericTextBoxModule,
|
|
233
|
+
CheckBoxModule,
|
|
231
234
|
ToolBarModule,
|
|
232
235
|
TextBoxModule
|
|
233
236
|
]
|
package/dist/es/index.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Generated bundle index. Do not edit.
|
|
7
7
|
*/
|
|
8
8
|
export * from './main';
|
|
9
|
+
export { semanticNodes, semanticTagNames } from './config/semantic-nodes';
|
|
9
10
|
export { ColorPickerDialogComponent } from './dialogs/colorpicker-dialog.component';
|
|
10
11
|
export { FileLinkDialogComponent } from './dialogs/file-link-dialog.component';
|
|
11
12
|
export { FontFamilyDialogComponent } from './dialogs/font-family-dialog.component';
|
|
@@ -22,6 +23,7 @@ export { EditorAlignCenterButtonDirective } from './tools/alignment/editor-align
|
|
|
22
23
|
export { EditorAlignJustifyButtonDirective } from './tools/alignment/editor-align-justify-button.directive';
|
|
23
24
|
export { EditorAlignLeftButtonDirective } from './tools/alignment/editor-align-left-button.directive';
|
|
24
25
|
export { EditorAlignRightButtonDirective } from './tools/alignment/editor-align-right-button.directive';
|
|
26
|
+
export { EditorBlockquoteDirective } from './tools/blockquote/editor-blockquote-button.directive';
|
|
25
27
|
export { EditorBackColorDirective } from './tools/colorpicker/editor-back-color.directive';
|
|
26
28
|
export { EditorColorPickerComponent } from './tools/colorpicker/editor-colorpicker.component';
|
|
27
29
|
export { EditorForeColorDirective } from './tools/colorpicker/editor-fore-color.directive';
|
|
@@ -33,6 +33,10 @@ var Messages = /** @class */ (function (_super) {
|
|
|
33
33
|
Input(),
|
|
34
34
|
tslib_1.__metadata("design:type", String)
|
|
35
35
|
], Messages.prototype, "backColor", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
Input(),
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
39
|
+
], Messages.prototype, "blockquote", void 0);
|
|
36
40
|
tslib_1.__decorate([
|
|
37
41
|
Input(),
|
|
38
42
|
tslib_1.__metadata("design:type", String)
|
package/dist/es/main.js
CHANGED
|
@@ -6,3 +6,4 @@ export { EditorComponent } from './editor.component';
|
|
|
6
6
|
export { EditorModule } from './editor.module';
|
|
7
7
|
export { schema, Schema } from './config/schema';
|
|
8
8
|
export { EditorState, Plugin, PluginKey, Transaction, EditorView, Decoration, DecorationSet, NodeType, Node, MarkType, Mark, InputRule, inputRules, wrappingInputRule, textblockTypeInputRule, keymap, baseKeymap, history, dropCursor, gapCursor, tableNodes, getSelectionText } from '@progress/kendo-editor-common';
|
|
9
|
+
export { EditorPasteEvent } from './preventable-events/paste-event';
|
|
@@ -9,7 +9,7 @@ export var packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-editor',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1642603748,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -2,8 +2,3 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { NodeSpec } from '@progress/kendo-editor-common';
|
|
6
|
-
/**
|
|
7
|
-
* @hidden
|
|
8
|
-
*/
|
|
9
|
-
export declare const tableNodes: Record<string, NodeSpec>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { PreventableEvent } from "@progress/kendo-angular-common";
|
|
7
|
+
/**
|
|
8
|
+
* The Editor [`paste`]({% slug api_editor_editorcomponent %}#toc-paste) event.
|
|
9
|
+
*/
|
|
10
|
+
var EditorPasteEvent = /** @class */ (function (_super) {
|
|
11
|
+
tslib_1.__extends(EditorPasteEvent, _super);
|
|
12
|
+
/**
|
|
13
|
+
* Constructs the event arguments for the `paste` event.
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
function EditorPasteEvent(cleanedHtml, originalHtml, originalEvent) {
|
|
17
|
+
var _this = _super.call(this) || this;
|
|
18
|
+
_this.cleanedHtml = cleanedHtml;
|
|
19
|
+
_this.originalHtml = originalHtml;
|
|
20
|
+
_this.originalEvent = originalEvent;
|
|
21
|
+
return _this;
|
|
22
|
+
}
|
|
23
|
+
return EditorPasteEvent;
|
|
24
|
+
}(PreventableEvent));
|
|
25
|
+
export { EditorPasteEvent };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Directive, Host } from '@angular/core';
|
|
7
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
+
import { EditorComponent } from '../../editor.component';
|
|
9
|
+
import { EditorCommandButton } from '../shared/editor-command-button';
|
|
10
|
+
import { EditorLocalizationService } from '../../localization/editor-localization.service';
|
|
11
|
+
import { EditorToolsService } from '../tools.service';
|
|
12
|
+
/**
|
|
13
|
+
* A directive which configures an existing `ToolBarButtonComponent` as an Editor Blockquote tool
|
|
14
|
+
* ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
|
|
15
|
+
* The directive will predefine the `icon` and `click` event handlers of the button.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts-no-run
|
|
19
|
+
* <kendo-toolbar-button kendoEditorBlockquoteButton></kendo-toolbar-button>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* The following example demonstrates how to change the default icon that is applied by the directive.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts-no-run
|
|
26
|
+
* <kendo-toolbar-button kendoEditorBlockquoteButton icon="blogger"></kendo-toolbar-button>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
var EditorBlockquoteDirective = /** @class */ (function (_super) {
|
|
30
|
+
tslib_1.__extends(EditorBlockquoteDirective, _super);
|
|
31
|
+
function EditorBlockquoteDirective(button, editor, localization, toolsService) {
|
|
32
|
+
var _this = _super.call(this, 'blockquote', button, editor, localization, toolsService) || this;
|
|
33
|
+
_this.editor = editor;
|
|
34
|
+
return _this;
|
|
35
|
+
}
|
|
36
|
+
EditorBlockquoteDirective = tslib_1.__decorate([
|
|
37
|
+
Directive({
|
|
38
|
+
selector: 'kendo-toolbar-button[kendoEditorBlockquoteButton]'
|
|
39
|
+
}),
|
|
40
|
+
tslib_1.__param(1, Host()),
|
|
41
|
+
tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
|
|
42
|
+
EditorComponent,
|
|
43
|
+
EditorLocalizationService,
|
|
44
|
+
EditorToolsService])
|
|
45
|
+
], EditorBlockquoteDirective);
|
|
46
|
+
return EditorBlockquoteDirective;
|
|
47
|
+
}(EditorCommandButton));
|
|
48
|
+
export { EditorBlockquoteDirective };
|
|
@@ -32,14 +32,26 @@ var EditorColorPickerComponent = /** @class */ (function (_super) {
|
|
|
32
32
|
*/
|
|
33
33
|
_this.disabled = false;
|
|
34
34
|
/**
|
|
35
|
-
* Specifies whether the ColorPicker will render a gradient, palette or
|
|
35
|
+
* Specifies whether the ColorPicker will render a gradient, palette, or both in its popup.
|
|
36
36
|
*
|
|
37
|
-
* @default 'palette'
|
|
37
|
+
* @default ['palette']
|
|
38
38
|
*/
|
|
39
|
-
_this.
|
|
39
|
+
_this.views = ['palette'];
|
|
40
40
|
return _this;
|
|
41
41
|
}
|
|
42
42
|
EditorColorPickerComponent_1 = EditorColorPickerComponent;
|
|
43
|
+
Object.defineProperty(EditorColorPickerComponent.prototype, "view", {
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
*
|
|
47
|
+
* For backward compatibility with configurations using the deprecated "view" input.
|
|
48
|
+
*/
|
|
49
|
+
set: function (view) {
|
|
50
|
+
this.views = [view];
|
|
51
|
+
},
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true
|
|
54
|
+
});
|
|
43
55
|
Object.defineProperty(EditorColorPickerComponent.prototype, "title", {
|
|
44
56
|
/**
|
|
45
57
|
* @hidden
|
|
@@ -121,7 +133,7 @@ var EditorColorPickerComponent = /** @class */ (function (_super) {
|
|
|
121
133
|
editorCommand: this.editorCommand,
|
|
122
134
|
paletteSettings: this.paletteSettings,
|
|
123
135
|
icon: this.icon,
|
|
124
|
-
|
|
136
|
+
views: this.views
|
|
125
137
|
});
|
|
126
138
|
};
|
|
127
139
|
/**
|
|
@@ -172,8 +184,13 @@ var EditorColorPickerComponent = /** @class */ (function (_super) {
|
|
|
172
184
|
], EditorColorPickerComponent.prototype, "disabled", void 0);
|
|
173
185
|
tslib_1.__decorate([
|
|
174
186
|
Input(),
|
|
175
|
-
tslib_1.__metadata("design:type",
|
|
176
|
-
], EditorColorPickerComponent.prototype, "
|
|
187
|
+
tslib_1.__metadata("design:type", Array)
|
|
188
|
+
], EditorColorPickerComponent.prototype, "views", void 0);
|
|
189
|
+
tslib_1.__decorate([
|
|
190
|
+
Input(),
|
|
191
|
+
tslib_1.__metadata("design:type", String),
|
|
192
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
193
|
+
], EditorColorPickerComponent.prototype, "view", null);
|
|
177
194
|
tslib_1.__decorate([
|
|
178
195
|
ViewChild('toolbarTemplate', { static: true }),
|
|
179
196
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
@@ -198,7 +215,7 @@ var EditorColorPickerComponent = /** @class */ (function (_super) {
|
|
|
198
215
|
Component({
|
|
199
216
|
providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(function () { return EditorColorPickerComponent_1; }) }],
|
|
200
217
|
selector: 'kendo-toolbar-colorpicker',
|
|
201
|
-
template: "\n <ng-template #toolbarTemplate>\n <kendo-colorpicker\n #colorpicker\n [
|
|
218
|
+
template: "\n <ng-template #toolbarTemplate>\n <kendo-colorpicker\n #colorpicker\n [views]=\"['palette']\"\n [format]=\"'hex'\"\n [attr.title]=\"title\"\n [icon]=\"icon\"\n [value]=\"value\"\n [paletteSettings]=\"paletteSettings\"\n [disabled]=\"disabled\"\n [tabindex]=\"tabindex\"\n (valueChange)=\"handleValueChange($event)\"\n (activeColorClick)=\"handleActiveColorClick($event)\"\n (open)=\"onOpen(colorpicker)\"\n (close)=\"onClose(colorpicker)\"\n >\n </kendo-colorpicker>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex=\"-1\"\n type=\"button\"\n kendoButton\n #colorPickerButton\n class=\"k-overflow-button\"\n [icon]=\"icon\"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [tabindex]=\"tabindex\"\n (click)=\"openDialog()\"\n >\n {{ title }}\n </button>\n </ng-template>\n "
|
|
202
219
|
}),
|
|
203
220
|
tslib_1.__param(0, Host()),
|
|
204
221
|
tslib_1.__metadata("design:paramtypes", [EditorComponent,
|