@progress/kendo-angular-editor 2.5.0-dev.202111161123 → 2.5.0-dev.202111231749

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.
Files changed (52) hide show
  1. package/dist/cdn/js/kendo-angular-editor.js +2 -2
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/common/error-messages.js +2 -1
  4. package/dist/es/config/command-icons.js +4 -2
  5. package/dist/es/config/commands.js +32 -31
  6. package/dist/es/editor-toolbar-state.js +20 -2
  7. package/dist/es/editor.component.js +4 -3
  8. package/dist/es/editor.module.js +7 -1
  9. package/dist/es/index.js +2 -0
  10. package/dist/es/localization/messages.js +8 -0
  11. package/dist/es/package-metadata.js +1 -1
  12. package/dist/es/tools/print/editor-print-button.directive.js +67 -0
  13. package/dist/es/tools/select-all/select-all-button.directive.js +48 -0
  14. package/dist/es/tools/shared/editor-command-base.js +7 -5
  15. package/dist/es2015/common/commands.d.ts +5 -1
  16. package/dist/es2015/common/error-messages.js +2 -1
  17. package/dist/es2015/config/command-icons.d.ts +2 -2
  18. package/dist/es2015/config/command-icons.js +4 -2
  19. package/dist/es2015/config/commands.js +31 -30
  20. package/dist/es2015/editor-toolbar-state.js +20 -2
  21. package/dist/es2015/editor.component.d.ts +5 -0
  22. package/dist/es2015/editor.component.js +7 -2
  23. package/dist/es2015/editor.module.js +7 -1
  24. package/dist/es2015/index.d.ts +2 -0
  25. package/dist/es2015/index.js +2 -0
  26. package/dist/es2015/index.metadata.json +1 -1
  27. package/dist/es2015/localization/messages.d.ts +8 -0
  28. package/dist/es2015/localization/messages.js +8 -0
  29. package/dist/es2015/package-metadata.js +1 -1
  30. package/dist/es2015/tools/print/editor-print-button.directive.d.ts +33 -0
  31. package/dist/es2015/tools/print/editor-print-button.directive.js +64 -0
  32. package/dist/es2015/tools/select-all/select-all-button.directive.d.ts +29 -0
  33. package/dist/es2015/tools/select-all/select-all-button.directive.js +46 -0
  34. package/dist/es2015/tools/shared/editor-command-base.d.ts +4 -3
  35. package/dist/es2015/tools/shared/editor-command-base.js +6 -4
  36. package/dist/es2015/tools/shared/editor-command-button.d.ts +3 -3
  37. package/dist/fesm2015/index.js +173 -43
  38. package/dist/fesm5/index.js +177 -46
  39. package/dist/npm/common/error-messages.js +2 -1
  40. package/dist/npm/config/command-icons.js +4 -2
  41. package/dist/npm/config/commands.js +33 -31
  42. package/dist/npm/editor-toolbar-state.js +20 -2
  43. package/dist/npm/editor.component.js +4 -3
  44. package/dist/npm/editor.module.js +7 -1
  45. package/dist/npm/index.js +4 -0
  46. package/dist/npm/localization/messages.js +8 -0
  47. package/dist/npm/package-metadata.js +1 -1
  48. package/dist/npm/tools/print/editor-print-button.directive.js +69 -0
  49. package/dist/npm/tools/select-all/select-all-button.directive.js +50 -0
  50. package/dist/npm/tools/shared/editor-command-base.js +7 -5
  51. package/dist/systemjs/kendo-angular-editor.js +1 -1
  52. package/package.json +1 -1
@@ -83,10 +83,18 @@ export declare class Messages extends ComponentMessages {
83
83
  * The title of the tool that outdents the content.
84
84
  */
85
85
  outdent: string;
86
+ /**
87
+ * The title of the print tool.
88
+ */
89
+ print: string;
86
90
  /**
87
91
  * The title of the tool that redos the last action.
88
92
  */
89
93
  redo: string;
94
+ /**
95
+ * The title of the tool that selects all content.
96
+ */
97
+ selectAll: string;
90
98
  /**
91
99
  * The title of the tool that strikes through text.
92
100
  */
@@ -86,10 +86,18 @@ tslib_1.__decorate([
86
86
  Input(),
87
87
  tslib_1.__metadata("design:type", String)
88
88
  ], Messages.prototype, "outdent", void 0);
89
+ tslib_1.__decorate([
90
+ Input(),
91
+ tslib_1.__metadata("design:type", String)
92
+ ], Messages.prototype, "print", void 0);
89
93
  tslib_1.__decorate([
90
94
  Input(),
91
95
  tslib_1.__metadata("design:type", String)
92
96
  ], Messages.prototype, "redo", void 0);
97
+ tslib_1.__decorate([
98
+ Input(),
99
+ tslib_1.__metadata("design:type", String)
100
+ ], Messages.prototype, "selectAll", void 0);
93
101
  tslib_1.__decorate([
94
102
  Input(),
95
103
  tslib_1.__metadata("design:type", String)
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-editor',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1637061495,
12
+ publishDate: 1637689470,
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
  };
@@ -0,0 +1,33 @@
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 { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
6
+ import { EditorComponent } from '../../editor.component';
7
+ import { EditorCommandButton } from '../shared/editor-command-button';
8
+ import { EditorLocalizationService } from '../../localization/editor-localization.service';
9
+ /**
10
+ * A directive which configures an existing `ToolBarButtonComponent` as an Editor Print tool
11
+ * ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
12
+ * The directive will predefine the `icon` and `click` event handlers of the button.
13
+ *
14
+ * > The Editor Print tool is supported in the default [`iframe`](https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorComponent/#toc-iframe) mode only.
15
+ *
16
+ * @example
17
+ * ```ts-no-run
18
+ * <kendo-toolbar-button kendoEditorPrintButton></kendo-toolbar-button>
19
+ * ```
20
+ *
21
+ * The following example demonstrates how to change the default icon that is applied by the directive.
22
+ *
23
+ * @example
24
+ * ```ts-no-run
25
+ * <kendo-toolbar-button kendoEditorPrintButton icon="blogger"></kendo-toolbar-button>
26
+ * ```
27
+ */
28
+ export declare class EditorPrintDirective extends EditorCommandButton {
29
+ protected editor: EditorComponent;
30
+ constructor(button: ToolBarButtonComponent, editor: EditorComponent, localization: EditorLocalizationService);
31
+ ngAfterViewInit(): void;
32
+ protected clickHandler(): void;
33
+ }
@@ -0,0 +1,64 @@
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, isDevMode } 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 { EditorErrorMessages } from '../../common/error-messages';
12
+ /**
13
+ * A directive which configures an existing `ToolBarButtonComponent` as an Editor Print 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
+ * > The Editor Print tool is supported in the default [`iframe`](https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorComponent/#toc-iframe) mode only.
18
+ *
19
+ * @example
20
+ * ```ts-no-run
21
+ * <kendo-toolbar-button kendoEditorPrintButton></kendo-toolbar-button>
22
+ * ```
23
+ *
24
+ * The following example demonstrates how to change the default icon that is applied by the directive.
25
+ *
26
+ * @example
27
+ * ```ts-no-run
28
+ * <kendo-toolbar-button kendoEditorPrintButton icon="blogger"></kendo-toolbar-button>
29
+ * ```
30
+ */
31
+ let EditorPrintDirective = class EditorPrintDirective extends EditorCommandButton {
32
+ constructor(button, editor, localization) {
33
+ super('print', button, editor, localization);
34
+ this.editor = editor;
35
+ }
36
+ ngAfterViewInit() {
37
+ if (isDevMode) {
38
+ if (!this.editor.iframe) {
39
+ throw new Error(EditorErrorMessages.printTool);
40
+ }
41
+ }
42
+ }
43
+ clickHandler() {
44
+ if (this.editor.iframe) {
45
+ const view = this.editor.view;
46
+ const dom = view && view.dom;
47
+ const doc = dom && dom.ownerDocument;
48
+ const editorWindow = doc && doc.defaultView;
49
+ if (editorWindow) {
50
+ editorWindow.print();
51
+ }
52
+ }
53
+ }
54
+ };
55
+ EditorPrintDirective = tslib_1.__decorate([
56
+ Directive({
57
+ selector: 'kendo-toolbar-button[kendoEditorPrintButton]'
58
+ }),
59
+ tslib_1.__param(1, Host()),
60
+ tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
61
+ EditorComponent,
62
+ EditorLocalizationService])
63
+ ], EditorPrintDirective);
64
+ export { EditorPrintDirective };
@@ -0,0 +1,29 @@
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 { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
6
+ import { EditorComponent } from '../../editor.component';
7
+ import { EditorCommandButton } from '../shared/editor-command-button';
8
+ import { EditorLocalizationService } from '../../localization/editor-localization.service';
9
+ /**
10
+ * A directive which configures an existing `ToolBarButtonComponent` as an Editor SelectAll tool
11
+ * ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
12
+ * The directive will predefine the `icon` and `click` event handlers of the button.
13
+ *
14
+ * @example
15
+ * ```ts-no-run
16
+ * <kendo-toolbar-button kendoEditorSelectAllButton></kendo-toolbar-button>
17
+ * ```
18
+ *
19
+ * The following example demonstrates how to change the default icon that is applied by the directive.
20
+ *
21
+ * @example
22
+ * ```ts-no-run
23
+ * <kendo-toolbar-button kendoEditorSelectAllButton icon="blogger"></kendo-toolbar-button>
24
+ * ```
25
+ */
26
+ export declare class EditorSelectAllButtonDirective extends EditorCommandButton {
27
+ constructor(button: ToolBarButtonComponent, editor: EditorComponent, localization: EditorLocalizationService);
28
+ protected clickHandler(): void;
29
+ }
@@ -0,0 +1,46 @@
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
+ /**
12
+ * A directive which configures an existing `ToolBarButtonComponent` as an Editor SelectAll tool
13
+ * ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
14
+ * The directive will predefine the `icon` and `click` event handlers of the button.
15
+ *
16
+ * @example
17
+ * ```ts-no-run
18
+ * <kendo-toolbar-button kendoEditorSelectAllButton></kendo-toolbar-button>
19
+ * ```
20
+ *
21
+ * The following example demonstrates how to change the default icon that is applied by the directive.
22
+ *
23
+ * @example
24
+ * ```ts-no-run
25
+ * <kendo-toolbar-button kendoEditorSelectAllButton icon="blogger"></kendo-toolbar-button>
26
+ * ```
27
+ */
28
+ let EditorSelectAllButtonDirective = class EditorSelectAllButtonDirective extends EditorCommandButton {
29
+ constructor(button, editor, localization) {
30
+ super('selectAll', button, editor, localization);
31
+ }
32
+ clickHandler() {
33
+ this.editor.shouldEmitFocus = true;
34
+ super.clickHandler();
35
+ }
36
+ };
37
+ EditorSelectAllButtonDirective = tslib_1.__decorate([
38
+ Directive({
39
+ selector: 'kendo-toolbar-button[kendoEditorSelectAllButton]'
40
+ }),
41
+ tslib_1.__param(1, Host()),
42
+ tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
43
+ EditorComponent,
44
+ EditorLocalizationService])
45
+ ], EditorSelectAllButtonDirective);
46
+ export { EditorSelectAllButtonDirective };
@@ -5,19 +5,20 @@
5
5
  import { Subscription } from 'rxjs';
6
6
  import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
7
7
  import { EditorComponent } from '../../editor.component';
8
- import { EditorCommand, DialogCommand } from '../../common/commands';
8
+ import { EditorCommand, DialogCommand, EditorInternalCommand } from '../../common/commands';
9
9
  import { LocalizationService } from '@progress/kendo-angular-l10n';
10
10
  /**
11
11
  * @hidden
12
12
  */
13
13
  export declare abstract class EditorCommandBase {
14
- protected command: DialogCommand | EditorCommand;
14
+ protected command: DialogCommand | EditorCommand | EditorInternalCommand;
15
15
  protected button: ToolBarButtonComponent;
16
16
  protected editor: EditorComponent;
17
17
  protected localization: LocalizationService;
18
18
  protected subs: Subscription;
19
- constructor(command: DialogCommand | EditorCommand, button: ToolBarButtonComponent, editor: EditorComponent, localization: LocalizationService);
19
+ constructor(command: DialogCommand | EditorCommand | EditorInternalCommand, button: ToolBarButtonComponent, editor: EditorComponent, localization: LocalizationService);
20
20
  ngOnInit(): void;
21
+ ngAfterViewInit(): void;
21
22
  ngOnDestroy(): void;
22
23
  protected clickHandler(): void;
23
24
  protected pointerdownHandler(_event: PointerEvent): void;
@@ -17,14 +17,16 @@ export class EditorCommandBase {
17
17
  this.subs = this.editor.stateChange.subscribe(this.onStateChange.bind(this));
18
18
  this.subs.add(this.button.click.subscribe((this.clickHandler.bind(this))));
19
19
  this.subs.add(this.button.pointerdown.subscribe((this.pointerdownHandler.bind(this))));
20
- Promise.resolve(null).then(() => {
20
+ }
21
+ ngAfterViewInit() {
22
+ setTimeout(() => {
21
23
  const text = this.localization.get(this.command);
22
24
  if (text) {
23
- this.button.showText = "overflow";
24
- this.button.showIcon = "both";
25
+ this.button.showText = 'overflow';
26
+ this.button.showIcon = 'both';
25
27
  this.button.text = text;
26
28
  }
27
- if (!this.button.icon) {
29
+ if (!this.button.toolbarOptions.icon) {
28
30
  this.button.icon = commandIcons[this.command];
29
31
  }
30
32
  this.button.title = text;
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
6
- import { EditorCommand } from '../../common/commands';
6
+ import { EditorCommand, EditorInternalCommand } from '../../common/commands';
7
7
  import { EditorComponent } from '../../editor.component';
8
8
  import { EditorCommandBase } from './editor-command-base';
9
9
  import { LocalizationService } from '@progress/kendo-angular-l10n';
@@ -11,11 +11,11 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
11
11
  * @hidden
12
12
  */
13
13
  export declare abstract class EditorCommandButton extends EditorCommandBase {
14
- protected command: EditorCommand;
14
+ protected command: EditorCommand | EditorInternalCommand;
15
15
  protected button: ToolBarButtonComponent;
16
16
  protected editor: EditorComponent;
17
17
  protected localization: LocalizationService;
18
- constructor(command: EditorCommand, button: ToolBarButtonComponent, editor: EditorComponent, localization: LocalizationService);
18
+ constructor(command: EditorCommand | EditorInternalCommand, button: ToolBarButtonComponent, editor: EditorComponent, localization: LocalizationService);
19
19
  protected clickHandler(): void;
20
20
  protected pointerdownHandler(e: PointerEvent): void;
21
21
  protected onStateChange(toolBarState: any): void;