@progress/kendo-angular-editor 2.5.0 → 3.0.0-dev.202112211443
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-angular-editor.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/error-messages.js +3 -2
- package/dist/es/editor.component.js +95 -67
- package/dist/es/main.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/preventable-events/paste-event-data.js +4 -0
- package/dist/es/preventable-events/paste-event.js +25 -0
- package/dist/es2015/common/error-messages.js +3 -2
- package/dist/es2015/common/paste-cleanup-settings.d.ts +14 -0
- package/dist/es2015/editor.component.d.ts +15 -10
- package/dist/es2015/editor.component.js +95 -67
- package/dist/es2015/index.metadata.json +1 -1
- 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/fesm2015/index.js +114 -70
- package/dist/fesm5/index.js +117 -70
- package/dist/npm/common/error-messages.js +3 -1
- package/dist/npm/editor.component.js +91 -63
- 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/systemjs/kendo-angular-editor.js +1 -1
- package/package.json +1 -1
|
@@ -27,15 +27,16 @@ var editor_localization_service_1 = require("./localization/editor-localization.
|
|
|
27
27
|
var styles_1 = require("./common/styles");
|
|
28
28
|
var error_messages_1 = require("./common/error-messages");
|
|
29
29
|
var tools_service_1 = require("./tools/tools.service");
|
|
30
|
+
var paste_event_1 = require("./preventable-events/paste-event");
|
|
30
31
|
var EMPTY_PARAGRAPH = '<p></p>';
|
|
31
32
|
var defaultPasteCleanupSettings = {
|
|
32
33
|
convertMsLists: false,
|
|
33
34
|
removeAttributes: [],
|
|
34
35
|
removeHtmlComments: false,
|
|
35
|
-
removeInvalidHTML:
|
|
36
|
+
removeInvalidHTML: true,
|
|
36
37
|
removeMsClasses: false,
|
|
37
38
|
removeMsStyles: false,
|
|
38
|
-
stripTags: [
|
|
39
|
+
stripTags: []
|
|
39
40
|
};
|
|
40
41
|
var removeCommentsIf = util_1.conditionallyExecute(kendo_editor_common_1.removeComments);
|
|
41
42
|
var removeInvalidHTMLIf = util_1.conditionallyExecute(kendo_editor_common_1.sanitize);
|
|
@@ -77,14 +78,6 @@ var EditorComponent = /** @class */ (function () {
|
|
|
77
78
|
* @default false
|
|
78
79
|
*/
|
|
79
80
|
this.applyToWord = false;
|
|
80
|
-
/**
|
|
81
|
-
* By design, the Editor emits `valueChange`, updates the model and the ToolBar state on each keystroke.
|
|
82
|
-
* 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.
|
|
83
|
-
* 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.
|
|
84
|
-
* The specified interval (in milliseconds) should be a positive number.
|
|
85
|
-
* By default the `updateInterval` is set to 100 miliseconds. If set to zero the delay will be disabled entirely.
|
|
86
|
-
*/
|
|
87
|
-
this.updateInterval = 100;
|
|
88
81
|
/**
|
|
89
82
|
* By default, whitespace is collapsed as per HTML's rules.
|
|
90
83
|
* Set to `true` to preserve whitespace, but normalize newlines to spaces.
|
|
@@ -110,6 +103,11 @@ var EditorComponent = /** @class */ (function () {
|
|
|
110
103
|
* Fires when the content area of the Editor is focused ([see example]({% slug overview_editor %}#toc-events)).
|
|
111
104
|
*/
|
|
112
105
|
this.onFocus = new core_1.EventEmitter();
|
|
106
|
+
/**
|
|
107
|
+
* Fires when the user performs paste in the content area of the Editor ([see example]({% slug overview_editor %}#toc-events)).
|
|
108
|
+
* The event is preventable. If you cancel it, the Editor content will not change.
|
|
109
|
+
*/
|
|
110
|
+
this.paste = new core_1.EventEmitter();
|
|
113
111
|
/**
|
|
114
112
|
* Fires when the content area of the Editor is blurred ([see example]({% slug overview_editor %}#toc-events)).
|
|
115
113
|
*/
|
|
@@ -125,10 +123,73 @@ var EditorComponent = /** @class */ (function () {
|
|
|
125
123
|
this.valueModified = new rxjs_1.Subject();
|
|
126
124
|
this._readonly = false;
|
|
127
125
|
this._placeholder = '';
|
|
126
|
+
this.inForm = false;
|
|
128
127
|
this.afterViewInit = new rxjs_1.Subject();
|
|
129
128
|
this.contentAreaLoaded = new rxjs_1.Subject();
|
|
130
|
-
this.
|
|
129
|
+
this.dispatchTransaction = function (tr) {
|
|
130
|
+
var docChanged = tr.docChanged;
|
|
131
|
+
if (docChanged) {
|
|
132
|
+
var doc = tr.doc;
|
|
133
|
+
var html_1 = kendo_editor_common_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 = util_1.pipe(removeInvalidHTMLIf(pasteCleanupSettings.removeInvalidHTML), removeCommentsIf(pasteCleanupSettings.removeHtmlComments))(dirtyHtml);
|
|
147
|
+
var clean = kendo_editor_common_1.pasteCleanup(html, {
|
|
148
|
+
convertMsLists: pasteCleanupSettings.convertMsLists,
|
|
149
|
+
stripTags: pasteCleanupSettings.stripTags.join('|'),
|
|
150
|
+
attributes: getPasteCleanupAttributes(pasteCleanupSettings)
|
|
151
|
+
});
|
|
152
|
+
if (kendo_angular_common_1.hasObservers(_this.paste)) {
|
|
153
|
+
var event_1 = new paste_event_1.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 = kendo_editor_common_1.parseContent(value || '', state.schema, { preserveWhitespace: _this.preserveWhitespace });
|
|
176
|
+
var tr = state.tr
|
|
177
|
+
.setSelection(new kendo_editor_common_1.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
|
+
};
|
|
131
188
|
this.onTouchedCallback = function (_) { }; // tslint:disable-line:no-empty
|
|
189
|
+
this.onPaste = function (_view, nativeEvent) {
|
|
190
|
+
_this._pasteEvent = nativeEvent;
|
|
191
|
+
return false;
|
|
192
|
+
};
|
|
132
193
|
kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
|
|
133
194
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
134
195
|
// https://stackoverflow.com/questions/56572483/chrome-is-synchronously-handling-iframe-loading-whereas-firefox-handles-it-asyn
|
|
@@ -137,6 +198,9 @@ var EditorComponent = /** @class */ (function () {
|
|
|
137
198
|
EditorComponent_1 = EditorComponent;
|
|
138
199
|
Object.defineProperty(EditorComponent.prototype, "value", {
|
|
139
200
|
get: function () {
|
|
201
|
+
if (this.trOnChange) {
|
|
202
|
+
return this.htmlOnChange;
|
|
203
|
+
}
|
|
140
204
|
var value = this._view ? this.getSource() : this._value;
|
|
141
205
|
if (value === EMPTY_PARAGRAPH) {
|
|
142
206
|
return this._value ? '' : this._value;
|
|
@@ -149,23 +213,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
149
213
|
* Sets the value of the Editor ([see example]({% slug overview_editor %}#toc-basic-usage)).
|
|
150
214
|
*/
|
|
151
215
|
set: function (value) {
|
|
152
|
-
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
this._value = value;
|
|
156
|
-
this._previousValue = value;
|
|
157
|
-
if (this._view) {
|
|
158
|
-
var iframeContentWindowNotPresent = this.iframe && !this.container.element.nativeElement.contentWindow;
|
|
159
|
-
if (iframeContentWindowNotPresent) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
this.exec('setHTML', {
|
|
163
|
-
content: this._value || '',
|
|
164
|
-
parseOptions: {
|
|
165
|
-
preserveWhitespace: this.preserveWhitespace
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
}
|
|
216
|
+
this.changeValue(value);
|
|
169
217
|
},
|
|
170
218
|
enumerable: true,
|
|
171
219
|
configurable: true
|
|
@@ -426,6 +474,9 @@ var EditorComponent = /** @class */ (function () {
|
|
|
426
474
|
};
|
|
427
475
|
EditorComponent.prototype.ngOnChanges = function (changes) {
|
|
428
476
|
var _this = this;
|
|
477
|
+
if (changes.value && this.view) {
|
|
478
|
+
this.changeValue(changes.value.currentValue);
|
|
479
|
+
}
|
|
429
480
|
if (changes.iframe && !changes.iframe.isFirstChange()) {
|
|
430
481
|
this.ngZone.onStable.pipe(operators_1.take(1)).subscribe(function () { return _this.initialize(); });
|
|
431
482
|
}
|
|
@@ -511,8 +562,6 @@ var EditorComponent = /** @class */ (function () {
|
|
|
511
562
|
var command = commands_1.editorCommands[commandName](attr);
|
|
512
563
|
// Executes a ProseMirror command.
|
|
513
564
|
command(this._view.state, this._view.dispatch, this._view);
|
|
514
|
-
// See the `dispatchTransaction` comments.
|
|
515
|
-
// this.stateChange.emit(updateToolBar(this.view));
|
|
516
565
|
};
|
|
517
566
|
/**
|
|
518
567
|
* Opens a dialog.
|
|
@@ -597,6 +646,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
597
646
|
* @hidden
|
|
598
647
|
*/
|
|
599
648
|
EditorComponent.prototype.writeValue = function (value) {
|
|
649
|
+
this.inForm = true;
|
|
600
650
|
// To avoid confusion, non-existent values are always undefined.
|
|
601
651
|
this.value = value === null ? undefined : value;
|
|
602
652
|
};
|
|
@@ -625,7 +675,6 @@ var EditorComponent = /** @class */ (function () {
|
|
|
625
675
|
return;
|
|
626
676
|
}
|
|
627
677
|
var currentSchema = this.schema || schema_1.schema;
|
|
628
|
-
var that = this;
|
|
629
678
|
var containerNativeElement = this.container.element.nativeElement;
|
|
630
679
|
var contentNode = kendo_editor_common_1.parseContent((this.value || '').trim(), currentSchema, { preserveWhitespace: this.preserveWhitespace });
|
|
631
680
|
if (this.iframe) {
|
|
@@ -669,7 +718,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
669
718
|
}),
|
|
670
719
|
new kendo_editor_common_1.Plugin({
|
|
671
720
|
key: new kendo_editor_common_1.PluginKey('editor-filter-disabled-state'),
|
|
672
|
-
filterTransaction: function () { return !_this.disabled; }
|
|
721
|
+
filterTransaction: function () { return !_this.disabled || _this.inForm; }
|
|
673
722
|
}),
|
|
674
723
|
kendo_editor_common_1.history(),
|
|
675
724
|
kendo_editor_common_1.keymap(kendo_editor_common_1.buildListKeymap(currentSchema)),
|
|
@@ -696,31 +745,10 @@ var EditorComponent = /** @class */ (function () {
|
|
|
696
745
|
_this._view = new kendo_editor_common_1.EditorView({ mount: _this.viewMountElement }, {
|
|
697
746
|
state: state,
|
|
698
747
|
editable: function () { return !_this.readonly; },
|
|
699
|
-
dispatchTransaction:
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
// When the user utilizes keyboard shortcuts—for example, `Ctrl`+`b`—
|
|
704
|
-
// `tr.docChanged` is `true` and the toolbar is not updated.
|
|
705
|
-
// A possible future solution is to move the keymaps to the service.
|
|
706
|
-
// if (!tr.docChanged) {
|
|
707
|
-
// that.stateChange.emit(updateToolBar(that.view));
|
|
708
|
-
// }
|
|
709
|
-
var value = that.value;
|
|
710
|
-
if (!kendo_editor_common_1.hasSameMarkup(value, that._previousValue, this.state.schema)) {
|
|
711
|
-
that._previousValue = value;
|
|
712
|
-
that.ngZone.run(function () { return that.valueModified.next(value); });
|
|
713
|
-
}
|
|
714
|
-
},
|
|
715
|
-
transformPastedHTML: function (html) {
|
|
716
|
-
var pasteCleanupSettings = tslib_1.__assign({}, defaultPasteCleanupSettings, _this.pasteCleanupSettings);
|
|
717
|
-
var clean = util_1.pipe(removeCommentsIf(pasteCleanupSettings.removeHtmlComments), removeInvalidHTMLIf(pasteCleanupSettings.removeInvalidHTML))(html);
|
|
718
|
-
var attributes = getPasteCleanupAttributes(pasteCleanupSettings);
|
|
719
|
-
return kendo_editor_common_1.pasteCleanup(clean, {
|
|
720
|
-
convertMsLists: pasteCleanupSettings.convertMsLists,
|
|
721
|
-
stripTags: pasteCleanupSettings.stripTags.join('|'),
|
|
722
|
-
attributes: attributes
|
|
723
|
-
});
|
|
748
|
+
dispatchTransaction: _this.dispatchTransaction,
|
|
749
|
+
transformPastedHTML: _this.transformPastedHTML,
|
|
750
|
+
handleDOMEvents: {
|
|
751
|
+
paste: _this.onPaste
|
|
724
752
|
}
|
|
725
753
|
});
|
|
726
754
|
});
|
|
@@ -761,7 +789,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
761
789
|
_this.cdr.detectChanges();
|
|
762
790
|
}
|
|
763
791
|
}));
|
|
764
|
-
this.subs.add(
|
|
792
|
+
this.subs.add(this.valueModified.subscribe(function (value) {
|
|
765
793
|
_this.onChangeCallback(value);
|
|
766
794
|
_this.valueChange.emit(value);
|
|
767
795
|
_this.cdr.markForCheck();
|
|
@@ -855,10 +883,6 @@ var EditorComponent = /** @class */ (function () {
|
|
|
855
883
|
tslib_1.__metadata("design:type", String),
|
|
856
884
|
tslib_1.__metadata("design:paramtypes", [String])
|
|
857
885
|
], EditorComponent.prototype, "placeholder", null);
|
|
858
|
-
tslib_1.__decorate([
|
|
859
|
-
core_1.Input(),
|
|
860
|
-
tslib_1.__metadata("design:type", Number)
|
|
861
|
-
], EditorComponent.prototype, "updateInterval", void 0);
|
|
862
886
|
tslib_1.__decorate([
|
|
863
887
|
core_1.Input(),
|
|
864
888
|
tslib_1.__metadata("design:type", Object)
|
|
@@ -879,6 +903,10 @@ var EditorComponent = /** @class */ (function () {
|
|
|
879
903
|
core_1.Output('focus'),
|
|
880
904
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
881
905
|
], EditorComponent.prototype, "onFocus", void 0);
|
|
906
|
+
tslib_1.__decorate([
|
|
907
|
+
core_1.Output(),
|
|
908
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
909
|
+
], EditorComponent.prototype, "paste", void 0);
|
|
882
910
|
tslib_1.__decorate([
|
|
883
911
|
core_1.Output('blur'),
|
|
884
912
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -986,7 +1014,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
986
1014
|
}
|
|
987
1015
|
],
|
|
988
1016
|
/* tslint:disable:max-line-length */
|
|
989
|
-
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 ",
|
|
1017
|
+
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 srcdoc=\"<!DOCTYPE html>\" frameborder=\"0\" class=\"k-iframe\" (load)=\"iframeOnLoad()\"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ",
|
|
990
1018
|
styles: [
|
|
991
1019
|
"\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 "
|
|
992
1020
|
]
|
package/dist/npm/main.js
CHANGED
|
@@ -34,3 +34,5 @@ exports.dropCursor = kendo_editor_common_1.dropCursor;
|
|
|
34
34
|
exports.gapCursor = kendo_editor_common_1.gapCursor;
|
|
35
35
|
exports.tableNodes = kendo_editor_common_1.tableNodes;
|
|
36
36
|
exports.getSelectionText = kendo_editor_common_1.getSelectionText;
|
|
37
|
+
var paste_event_1 = require("./preventable-events/paste-event");
|
|
38
|
+
exports.EditorPasteEvent = paste_event_1.EditorPasteEvent;
|
|
@@ -11,7 +11,7 @@ exports.packageMetadata = {
|
|
|
11
11
|
name: '@progress/kendo-angular-editor',
|
|
12
12
|
productName: 'Kendo UI for Angular',
|
|
13
13
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
14
|
-
publishDate:
|
|
14
|
+
publishDate: 1640097479,
|
|
15
15
|
version: '',
|
|
16
16
|
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'
|
|
17
17
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
9
|
+
/**
|
|
10
|
+
* The Editor [`paste`]({% slug api_editor_editorcomponent %}#toc-paste) event.
|
|
11
|
+
*/
|
|
12
|
+
var EditorPasteEvent = /** @class */ (function (_super) {
|
|
13
|
+
tslib_1.__extends(EditorPasteEvent, _super);
|
|
14
|
+
/**
|
|
15
|
+
* Constructs the event arguments for the `paste` event.
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
function EditorPasteEvent(cleanedHtml, originalHtml, originalEvent) {
|
|
19
|
+
var _this = _super.call(this) || this;
|
|
20
|
+
_this.cleanedHtml = cleanedHtml;
|
|
21
|
+
_this.originalHtml = originalHtml;
|
|
22
|
+
_this.originalEvent = originalEvent;
|
|
23
|
+
return _this;
|
|
24
|
+
}
|
|
25
|
+
return EditorPasteEvent;
|
|
26
|
+
}(kendo_angular_common_1.PreventableEvent));
|
|
27
|
+
exports.EditorPasteEvent = EditorPasteEvent;
|