@syncfusion/ej2-richtexteditor 20.2.49 → 20.3.47

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 (150) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/ej2-richtexteditor.min.js +10 -0
  3. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  4. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-richtexteditor.es2015.js +3790 -358
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +3780 -319
  8. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  9. package/dist/global/ej2-richtexteditor.min.js +2 -2
  10. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/common/config.js +2 -0
  14. package/src/common/types.d.ts +4 -0
  15. package/src/editor-manager/base/classes.d.ts +16 -0
  16. package/src/editor-manager/base/classes.js +16 -0
  17. package/src/editor-manager/base/constant.d.ts +2 -0
  18. package/src/editor-manager/base/constant.js +2 -0
  19. package/src/editor-manager/base/editor-manager.d.ts +4 -0
  20. package/src/editor-manager/base/editor-manager.js +14 -0
  21. package/src/editor-manager/base/interface.d.ts +2 -0
  22. package/src/editor-manager/plugin/audio.d.ts +32 -0
  23. package/src/editor-manager/plugin/audio.js +133 -0
  24. package/src/editor-manager/plugin/dom-node.js +1 -1
  25. package/src/editor-manager/plugin/image.js +1 -1
  26. package/src/editor-manager/plugin/inserthtml.js +1 -1
  27. package/src/editor-manager/plugin/lists.js +10 -8
  28. package/src/editor-manager/plugin/ms-word-clean-up.js +18 -18
  29. package/src/editor-manager/plugin/nodecutter.d.ts +1 -1
  30. package/src/editor-manager/plugin/nodecutter.js +7 -5
  31. package/src/editor-manager/plugin/selection-commands.js +3 -2
  32. package/src/editor-manager/plugin/table.js +3 -2
  33. package/src/editor-manager/plugin/undo.js +2 -1
  34. package/src/editor-manager/plugin/video.d.ts +34 -0
  35. package/src/editor-manager/plugin/video.js +249 -0
  36. package/src/editor-manager/plugin.d.ts +2 -0
  37. package/src/editor-manager/plugin.js +2 -0
  38. package/src/global.js +1 -1
  39. package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -1
  40. package/src/rich-text-editor/actions/base-toolbar.js +1 -1
  41. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
  42. package/src/rich-text-editor/actions/dropdown-buttons.js +14 -11
  43. package/src/rich-text-editor/actions/enter-key.d.ts +1 -0
  44. package/src/rich-text-editor/actions/enter-key.js +157 -103
  45. package/src/rich-text-editor/actions/html-editor.d.ts +1 -0
  46. package/src/rich-text-editor/actions/html-editor.js +59 -1
  47. package/src/rich-text-editor/actions/paste-clean-up.js +2 -1
  48. package/src/rich-text-editor/actions/quick-toolbar.d.ts +2 -0
  49. package/src/rich-text-editor/actions/quick-toolbar.js +52 -6
  50. package/src/rich-text-editor/actions/resize.js +11 -1
  51. package/src/rich-text-editor/actions/toolbar-action.js +2 -1
  52. package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
  53. package/src/rich-text-editor/audio.d.ts +4 -0
  54. package/src/rich-text-editor/audio.js +4 -0
  55. package/src/rich-text-editor/base/classes.d.ts +50 -0
  56. package/src/rich-text-editor/base/classes.js +50 -0
  57. package/src/rich-text-editor/base/constant.d.ts +74 -14
  58. package/src/rich-text-editor/base/constant.js +76 -16
  59. package/src/rich-text-editor/base/enum.d.ts +10 -2
  60. package/src/rich-text-editor/base/enum.js +10 -2
  61. package/src/rich-text-editor/base/interface.d.ts +86 -2
  62. package/src/rich-text-editor/base/interface.js +8 -0
  63. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +130 -29
  64. package/src/rich-text-editor/base/rich-text-editor.d.ts +150 -30
  65. package/src/rich-text-editor/base/rich-text-editor.js +200 -6
  66. package/src/rich-text-editor/formatter/formatter.js +7 -2
  67. package/src/rich-text-editor/models/default-locale.js +46 -0
  68. package/src/rich-text-editor/models/items.d.ts +3 -0
  69. package/src/rich-text-editor/models/items.js +100 -3
  70. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +169 -1
  71. package/src/rich-text-editor/models/toolbar-settings.d.ts +143 -1
  72. package/src/rich-text-editor/models/toolbar-settings.js +88 -0
  73. package/src/rich-text-editor/renderer/audio-module.d.ts +76 -0
  74. package/src/rich-text-editor/renderer/audio-module.js +875 -0
  75. package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
  76. package/src/rich-text-editor/renderer/image-module.js +9 -6
  77. package/src/rich-text-editor/renderer/link-module.js +2 -1
  78. package/src/rich-text-editor/renderer/table-module.d.ts +2 -0
  79. package/src/rich-text-editor/renderer/table-module.js +43 -7
  80. package/src/rich-text-editor/renderer/video-module.d.ts +105 -0
  81. package/src/rich-text-editor/renderer/video-module.js +1422 -0
  82. package/src/rich-text-editor/renderer/view-source.js +2 -0
  83. package/src/rich-text-editor/renderer.d.ts +2 -0
  84. package/src/rich-text-editor/renderer.js +2 -0
  85. package/src/rich-text-editor/video.d.ts +4 -0
  86. package/src/rich-text-editor/video.js +4 -0
  87. package/styles/_all.scss +1 -2
  88. package/styles/bootstrap-dark.css +220 -70
  89. package/styles/bootstrap.css +220 -70
  90. package/styles/bootstrap4.css +220 -70
  91. package/styles/bootstrap5-dark.css +220 -70
  92. package/styles/bootstrap5.css +220 -70
  93. package/styles/fabric-dark.css +220 -70
  94. package/styles/fabric.css +222 -72
  95. package/styles/fluent-dark.css +222 -72
  96. package/styles/fluent.css +222 -72
  97. package/styles/highcontrast-light.css +222 -72
  98. package/styles/highcontrast.css +222 -72
  99. package/styles/material-dark.css +220 -70
  100. package/styles/material.css +220 -70
  101. package/styles/rich-text-editor/_all.scss +1 -1
  102. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +3 -0
  103. package/styles/rich-text-editor/_bootstrap-definition.scss +2 -1
  104. package/styles/rich-text-editor/_bootstrap4-definition.scss +5 -3
  105. package/styles/rich-text-editor/_bootstrap5-definition.scss +8 -3
  106. package/styles/rich-text-editor/_fabric-dark-definition.scss +3 -0
  107. package/styles/rich-text-editor/_fabric-definition.scss +2 -0
  108. package/styles/rich-text-editor/_fluent-definition.scss +8 -3
  109. package/styles/rich-text-editor/_fusionnew-definition.scss +8 -3
  110. package/styles/rich-text-editor/_highcontrast-definition.scss +2 -0
  111. package/styles/rich-text-editor/_highcontrast-light-definition.scss +2 -0
  112. package/styles/rich-text-editor/_layout.scss +116 -74
  113. package/styles/rich-text-editor/_material-dark-definition.scss +3 -0
  114. package/styles/rich-text-editor/_material-definition.scss +2 -0
  115. package/styles/rich-text-editor/_material3-definition.scss +8 -3
  116. package/styles/rich-text-editor/_tailwind-definition.scss +7 -2
  117. package/styles/rich-text-editor/_theme.scss +74 -15
  118. package/styles/rich-text-editor/bootstrap-dark.css +220 -70
  119. package/styles/rich-text-editor/bootstrap.css +220 -70
  120. package/styles/rich-text-editor/bootstrap4.css +220 -70
  121. package/styles/rich-text-editor/bootstrap5-dark.css +220 -70
  122. package/styles/rich-text-editor/bootstrap5.css +220 -70
  123. package/styles/rich-text-editor/fabric-dark.css +220 -70
  124. package/styles/rich-text-editor/fabric.css +222 -72
  125. package/styles/rich-text-editor/fluent-dark.css +222 -72
  126. package/styles/rich-text-editor/fluent.css +222 -72
  127. package/styles/rich-text-editor/highcontrast-light.css +222 -72
  128. package/styles/rich-text-editor/highcontrast.css +222 -72
  129. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +20 -4
  130. package/styles/rich-text-editor/icons/_bootstrap.scss +20 -4
  131. package/styles/rich-text-editor/icons/_bootstrap4.scss +20 -4
  132. package/styles/rich-text-editor/icons/_bootstrap5.scss +20 -4
  133. package/styles/rich-text-editor/icons/_fabric-dark.scss +20 -4
  134. package/styles/rich-text-editor/icons/_fabric.scss +20 -4
  135. package/styles/rich-text-editor/icons/_fluent.scss +20 -4
  136. package/styles/rich-text-editor/icons/_fusionnew.scss +20 -4
  137. package/styles/rich-text-editor/icons/_highcontrast-light.scss +20 -4
  138. package/styles/rich-text-editor/icons/_highcontrast.scss +20 -4
  139. package/styles/rich-text-editor/icons/_material-dark.scss +20 -4
  140. package/styles/rich-text-editor/icons/_material.scss +20 -4
  141. package/styles/rich-text-editor/icons/_material3.scss +20 -4
  142. package/styles/rich-text-editor/icons/_tailwind.scss +20 -4
  143. package/styles/rich-text-editor/material-dark.css +220 -70
  144. package/styles/rich-text-editor/material.css +220 -70
  145. package/styles/rich-text-editor/tailwind-dark.css +220 -70
  146. package/styles/rich-text-editor/tailwind.css +220 -70
  147. package/styles/tailwind-dark.css +220 -70
  148. package/styles/tailwind.css +220 -70
  149. package/.eslintrc.json +0 -244
  150. package/tslint.json +0 -111
@@ -17,10 +17,14 @@ export declare enum RenderType {
17
17
  TextToolbar = 4,
18
18
  /** Defines RenderType as ImageToolbar */
19
19
  ImageToolbar = 5,
20
+ /** Defines RenderType as AudioToolbar */
21
+ AudioToolbar = 6,
22
+ /** Defines RenderType as AudioToolbar */
23
+ VideoToolbar = 7,
20
24
  /** Defines RenderType as InlineToolbar */
21
- InlineToolbar = 6,
25
+ InlineToolbar = 8,
22
26
  /** Defines RenderType as TableToolbar */
23
- TableToolbar = 7
27
+ TableToolbar = 9
24
28
  }
25
29
  /**
26
30
  * Defines types of action to be done on a quick toolbar scroll.
@@ -45,6 +49,10 @@ export declare enum DialogType {
45
49
  InsertLink = "InsertLink",
46
50
  /** Defines ToolbarType as MultiRow */
47
51
  InsertImage = "InsertImage",
52
+ /** Defines DialogType as Audio*/
53
+ InsertAudio = "InsertAudio",
54
+ /** Defines DialogType as Video*/
55
+ InsertVideo = "InsertVideo",
48
56
  /** Defines ToolbarType as Scrollable */
49
57
  InsertTable = "InsertTable"
50
58
  }
@@ -19,10 +19,14 @@ export var RenderType;
19
19
  RenderType[RenderType["TextToolbar"] = 4] = "TextToolbar";
20
20
  /** Defines RenderType as ImageToolbar */
21
21
  RenderType[RenderType["ImageToolbar"] = 5] = "ImageToolbar";
22
+ /** Defines RenderType as AudioToolbar */
23
+ RenderType[RenderType["AudioToolbar"] = 6] = "AudioToolbar";
24
+ /** Defines RenderType as AudioToolbar */
25
+ RenderType[RenderType["VideoToolbar"] = 7] = "VideoToolbar";
22
26
  /** Defines RenderType as InlineToolbar */
23
- RenderType[RenderType["InlineToolbar"] = 6] = "InlineToolbar";
27
+ RenderType[RenderType["InlineToolbar"] = 8] = "InlineToolbar";
24
28
  /** Defines RenderType as TableToolbar */
25
- RenderType[RenderType["TableToolbar"] = 7] = "TableToolbar";
29
+ RenderType[RenderType["TableToolbar"] = 9] = "TableToolbar";
26
30
  /* eslint-enable */
27
31
  })(RenderType || (RenderType = {}));
28
32
  /**
@@ -49,6 +53,10 @@ export var DialogType;
49
53
  DialogType["InsertLink"] = "InsertLink";
50
54
  /** Defines ToolbarType as MultiRow */
51
55
  DialogType["InsertImage"] = "InsertImage";
56
+ /** Defines DialogType as Audio*/
57
+ DialogType["InsertAudio"] = "InsertAudio";
58
+ /** Defines DialogType as Video*/
59
+ DialogType["InsertVideo"] = "InsertVideo";
52
60
  /** Defines ToolbarType as Scrollable */
53
61
  DialogType["InsertTable"] = "InsertTable";
54
62
  /* eslint-enable */
@@ -10,12 +10,14 @@ import { BaseQuickToolbar } from '../actions/base-quick-toolbar';
10
10
  import { NodeSelection } from '../../selection/selection';
11
11
  import { EditorMode, EnterKey, ShiftEnterKey } from './../../common/types';
12
12
  import { MarkdownSelection } from './../../markdown-parser/plugin/markdown-selection';
13
- import { ToolbarSettingsModel, IFrameSettingsModel, ImageSettingsModel, TableSettingsModel } from '../models/models';
13
+ import { ToolbarSettingsModel, IFrameSettingsModel, ImageSettingsModel, AudioSettingsModel, VideoSettingsModel, TableSettingsModel } from '../models/models';
14
14
  import { QuickToolbarSettingsModel, InlineModeModel, PasteCleanupSettingsModel, FileManagerSettingsModel } from '../models/models';
15
15
  import { Count } from '../actions/count';
16
16
  import { ColorPicker, ColorPickerEventArgs, ColorPickerModel, FileInfo } from '@syncfusion/ej2-inputs';
17
17
  import { Link } from '../renderer/link-module';
18
18
  import { Image } from '../renderer/image-module';
19
+ import { Audio } from '../renderer/audio-module';
20
+ import { Video } from '../renderer/video-module';
19
21
  import { Table } from '../renderer/table-module';
20
22
  import { ServiceLocator } from '../services/service-locator';
21
23
  import { UndoRedoCommands } from '../../markdown-parser/plugin/undo';
@@ -55,6 +57,28 @@ export interface IRichTextEditor extends Component<HTMLElement> {
55
57
  * }
56
58
  */
57
59
  insertImageSettings: ImageSettingsModel;
60
+ /**
61
+ * Configures the image settings of the RTE.
62
+ *
63
+ * @default
64
+ * {
65
+ * allowedTypes: ['wav', 'mp3', 'm4a','wma'],
66
+ * layoutOption: 'Inline', saveFormat: 'Blob',
67
+ * saveUrl:null, path: null,
68
+ * }
69
+ */
70
+ insertAudioSettings: AudioSettingsModel;
71
+ /**
72
+ * Configures the video settings of the RTE.
73
+ *
74
+ * @default
75
+ * {
76
+ * allowedTypes: ['mp4', 'mov', 'wmv', 'avi'],
77
+ * layoutOption: 'Inline', width: '200px', saveFormat: 'Blob',
78
+ * height: '200px', saveUrl:null, path: null, resize: false
79
+ * }
80
+ */
81
+ insertVideoSettings: VideoSettingsModel;
58
82
  fileManagerSettings: FileManagerSettingsModel;
59
83
  tableSettings: TableSettingsModel;
60
84
  pasteCleanupSettings: PasteCleanupSettingsModel;
@@ -97,6 +121,8 @@ export interface IRichTextEditor extends Component<HTMLElement> {
97
121
  enterKeyModule?: EnterKeyAction;
98
122
  enterKey?: EnterKey;
99
123
  shiftEnterKey?: ShiftEnterKey;
124
+ audioModule?: Audio;
125
+ videoModule?: Video;
100
126
  pasteCleanupModule?: PasteCleanup;
101
127
  undoRedoModule?: UndoRedoManager;
102
128
  quickToolbarModule?: QuickToolbar;
@@ -139,6 +165,7 @@ export interface IRichTextEditor extends Component<HTMLElement> {
139
165
  clipboardAction?: Function;
140
166
  localeObj?: L10n;
141
167
  invokeChangeEvent?(): void;
168
+ addAudioVideoWrapper?(): void;
142
169
  preventDefaultResize?(e?: FocusEvent | MouseEvent): void;
143
170
  autoResize?(): void;
144
171
  executeCommand?(commandName: CommandName, value?: string | HTMLElement): void;
@@ -158,6 +185,8 @@ export interface IRichTextEditor extends Component<HTMLElement> {
158
185
  export interface IRenderer {
159
186
  linkQTBar?: BaseQuickToolbar;
160
187
  imageQTBar?: BaseQuickToolbar;
188
+ audioQTBar?: BaseQuickToolbar;
189
+ videoQTBar?: BaseQuickToolbar;
161
190
  tableQTBar?: BaseQuickToolbar;
162
191
  textQTBar?: BaseQuickToolbar;
163
192
  inlineQTBar?: BaseQuickToolbar;
@@ -306,6 +335,8 @@ export interface IImageNotifyArgs {
306
335
  properties?: object;
307
336
  selection?: NodeSelection;
308
337
  selfImage?: Image;
338
+ selfAudio?: Audio;
339
+ selfVideo?: Video;
309
340
  link?: HTMLInputElement | HTMLElement;
310
341
  selectNode?: Node[];
311
342
  selectParent?: Node[];
@@ -343,6 +374,50 @@ export interface IImageCommandsArgs {
343
374
  /** Defines the image element to be edited */
344
375
  selectParent?: Node[];
345
376
  }
377
+ /**
378
+ * Provides information about a Audio added in the Rich Text Editor.
379
+ */
380
+ export interface IAudioCommandsArgs {
381
+ /** Defines the src attribute of the audio */
382
+ url?: string;
383
+ /** Defines the instance of the current selection */
384
+ selection?: NodeSelection;
385
+ /** Defines the fileName of the audio */
386
+ fileName?: string;
387
+ /** Defines the class name to be added to the audio */
388
+ cssClass?: string;
389
+ /** Defines the audio element to be edited */
390
+ selectParent?: Node[];
391
+ }
392
+ /**
393
+ * Provides information about a Video added in the Rich Text Editor.
394
+ */
395
+ export interface IVideoCommandsArgs {
396
+ /** Defines the src attribute of the video */
397
+ url?: string;
398
+ /** Defines the instance of the current selection */
399
+ selection?: NodeSelection;
400
+ /** Defines the minWidth, maxWidth and width of the video */
401
+ width?: {
402
+ minWidth?: string | number;
403
+ maxWidth?: string | number;
404
+ width?: string | number;
405
+ };
406
+ /** Defines the minHeight, maxHeight and height of the video */
407
+ height?: {
408
+ minHeight?: string | number;
409
+ maxHeight?: string | number;
410
+ height?: string | number;
411
+ };
412
+ /** Defines the fileName of the video */
413
+ fileName?: string | DocumentFragment;
414
+ /** Defines the type of video link added */
415
+ isEmbedUrl?: boolean;
416
+ /** Defines the class name to be added to the video */
417
+ cssClass?: string;
418
+ /** Defines the video element to be edited */
419
+ selectParent?: Node[];
420
+ }
346
421
  /**
347
422
 
348
423
  */
@@ -687,6 +762,15 @@ export interface AfterImageDeleteEventArgs {
687
762
  /** Defines the src attribute of the image element deleted */
688
763
  src: string;
689
764
  }
765
+ /**
766
+ * Provides information about a AfterMediaDeleteEvent event.
767
+ */
768
+ export interface AfterMediaDeleteEventArgs {
769
+ /** Defines the audio/video element deleted */
770
+ element: Node;
771
+ /** Defines the src attribute of the audio/video element deleted */
772
+ src: string;
773
+ }
690
774
  /**
691
775
  * Provides information about a QuickToolbar event.
692
776
  */
@@ -1191,7 +1275,7 @@ export declare const executeGroup: {
1191
1275
  /**
1192
1276
  * Defines types to be used as CommandName.
1193
1277
  */
1194
- export declare type CommandName = 'bold' | 'italic' | 'underline' | 'strikeThrough' | 'superscript' | 'subscript' | 'uppercase' | 'lowercase' | 'fontColor' | 'fontName' | 'fontSize' | 'backColor' | 'justifyCenter' | 'justifyFull' | 'justifyLeft' | 'justifyRight' | 'undo' | 'createLink' | 'formatBlock' | 'heading' | 'indent' | 'insertHTML' | 'insertOrderedList' | 'insertUnorderedList' | 'insertParagraph' | 'outdent' | 'redo' | 'removeFormat' | 'insertText' | 'insertImage' | 'insertHorizontalRule' | 'insertBrOnReturn' | 'insertCode' | 'insertTable' | 'editImage' | 'editLink';
1278
+ export declare type CommandName = 'bold' | 'italic' | 'underline' | 'strikeThrough' | 'superscript' | 'subscript' | 'uppercase' | 'lowercase' | 'fontColor' | 'fontName' | 'fontSize' | 'backColor' | 'justifyCenter' | 'justifyFull' | 'justifyLeft' | 'justifyRight' | 'undo' | 'createLink' | 'formatBlock' | 'heading' | 'indent' | 'insertHTML' | 'insertOrderedList' | 'insertUnorderedList' | 'insertParagraph' | 'outdent' | 'redo' | 'removeFormat' | 'insertText' | 'insertImage' | 'insertAudio' | 'insertVideo' | 'insertHorizontalRule' | 'insertBrOnReturn' | 'insertCode' | 'insertTable' | 'editImage' | 'editLink';
1195
1279
  /**
1196
1280
  * @hidden
1197
1281
 
@@ -137,6 +137,14 @@ export var executeGroup = {
137
137
  command: 'Images',
138
138
  subCommand: 'Image'
139
139
  },
140
+ 'insertAudio': {
141
+ command: 'Audios',
142
+ subCommand: 'Audio'
143
+ },
144
+ 'insertVideo': {
145
+ command: 'Videos',
146
+ subCommand: 'Video'
147
+ },
140
148
  'editImage': {
141
149
  command: 'Images',
142
150
  subCommand: 'Image'
@@ -1,4 +1,4 @@
1
- import { Component, ModuleDeclaration, EventHandler, Complex, Browser, EmitType, addClass, select, detach } from '@syncfusion/ej2-base';import { Property, NotifyPropertyChanges, INotifyPropertyChanged, formatUnit, L10n, closest } from '@syncfusion/ej2-base';import { setStyleAttribute, Event, removeClass, print as printWindow, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, compile, append, extend, debounce } from '@syncfusion/ej2-base';import { Touch as EJ2Touch, TapEventArgs } from '@syncfusion/ej2-base';import { getScrollableParent, BeforeOpenEventArgs, BeforeCloseEventArgs } from '@syncfusion/ej2-popups';import * as events from '../base/constant';import * as classes from '../base/classes';import { Render } from '../renderer/render';import { ViewSource } from '../renderer/view-source';import { IRenderer, IFormatter, PrintEventArgs, ActionCompleteEventArgs, ActionBeginEventArgs, ImageDropEventArgs } from './interface';import { IExecutionGroup, executeGroup, CommandName, ResizeArgs, StatusArgs, ToolbarStatusEventArgs } from './interface';import { BeforeQuickToolbarOpenArgs, ChangeEventArgs, AfterImageDeleteEventArgs, PasteCleanupArgs } from './interface';import { ILinkCommandsArgs, IImageCommandsArgs, BeforeSanitizeHtmlArgs, ITableCommandsArgs, ExecuteCommandOption } from './interface';import { ServiceLocator } from '../services/service-locator';import { RendererFactory } from '../services/renderer-factory';import { RenderType, ToolbarType, DialogType } from './enum';import { EditorMode, ShiftEnterKey, EnterKey } from './../../common/types';import { Toolbar } from '../actions/toolbar';import { ExecCommandCallBack } from '../actions/execute-command-callback';import { KeyboardEvents, KeyboardEventArgs } from '../actions/keyboard';import { FontFamilyModel, FontSizeModel, FontColorModel, FormatModel, BackgroundColorModel, NumberFormatListModel, BulletFormatListModel } from '../models/models';import { ToolbarSettingsModel, IFrameSettingsModel, ImageSettingsModel, TableSettingsModel } from '../models/models';import { QuickToolbarSettingsModel, InlineModeModel, PasteCleanupSettingsModel, FileManagerSettingsModel } from '../models/models';import { ToolbarSettings, ImageSettings, QuickToolbarSettings, FontFamily, FontSize, Format, NumberFormatList, BulletFormatList } from '../models/toolbar-settings';import { FileManagerSettings } from '../models/toolbar-settings';import { TableSettings, PasteCleanupSettings } from '../models/toolbar-settings';import { FontColor, BackgroundColor } from '../models/toolbar-settings';import { IFrameSettings } from '../models/iframe-settings';import { InlineMode } from '../models/inline-mode';import { Link } from '../renderer/link-module';import { Image } from '../renderer/image-module';import { Table } from '../renderer/table-module';import { Count } from '../actions/count';import { HtmlEditor } from '../actions/html-editor';import { MarkdownEditor } from '../actions/markdown-editor';import { defaultLocale } from '../models/default-locale';import { setAttributes } from '../actions/html-attributes';import { BaseToolbar } from '../actions/base-toolbar';import { QuickToolbar } from '../actions/quick-toolbar';import { FullScreen } from '../actions/full-screen';import { PasteCleanup } from '../actions/paste-clean-up';import { EnterKeyAction } from '../actions/enter-key';import * as CONSTANT from '../../common/constant';import { IHtmlKeyboardEvent } from '../../editor-manager/base/interface';import { dispatchEvent, getEditValue, isIDevice, decode, isEditableValueEmpty, getDefaultValue } from '../base/util';import { DialogRenderer } from '../renderer/dialog-renderer';import { SelectedEventArgs, RemovingEventArgs, UploadingEventArgs, BeforeUploadEventArgs } from '@syncfusion/ej2-inputs';import { Resize } from '../actions/resize';import { FileManager } from '../actions/file-manager';import { EditorManager } from '../../editor-manager';
1
+ import { Component, ModuleDeclaration, EventHandler, Complex, Browser, EmitType, addClass, select, detach } from '@syncfusion/ej2-base';import { Property, NotifyPropertyChanges, INotifyPropertyChanged, formatUnit, L10n, closest } from '@syncfusion/ej2-base';import { setStyleAttribute, Event, removeClass, print as printWindow, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, compile, append, extend, debounce } from '@syncfusion/ej2-base';import { Touch as EJ2Touch, TapEventArgs } from '@syncfusion/ej2-base';import { getScrollableParent, BeforeOpenEventArgs, BeforeCloseEventArgs } from '@syncfusion/ej2-popups';import * as events from '../base/constant';import * as classes from '../base/classes';import { Render } from '../renderer/render';import { ViewSource } from '../renderer/view-source';import { IRenderer, IFormatter, PrintEventArgs, ActionCompleteEventArgs, ActionBeginEventArgs, ImageDropEventArgs } from './interface';import { IExecutionGroup, executeGroup, CommandName, ResizeArgs, StatusArgs, ToolbarStatusEventArgs } from './interface';import { BeforeQuickToolbarOpenArgs, ChangeEventArgs, AfterImageDeleteEventArgs, AfterMediaDeleteEventArgs, PasteCleanupArgs } from './interface';import { ILinkCommandsArgs, IImageCommandsArgs, IAudioCommandsArgs, IVideoCommandsArgs, BeforeSanitizeHtmlArgs, ITableCommandsArgs, ExecuteCommandOption } from './interface';import { ServiceLocator } from '../services/service-locator';import { RendererFactory } from '../services/renderer-factory';import { RenderType, ToolbarType, DialogType } from './enum';import { EditorMode, ShiftEnterKey, EnterKey } from './../../common/types';import { Toolbar } from '../actions/toolbar';import { ExecCommandCallBack } from '../actions/execute-command-callback';import { KeyboardEvents, KeyboardEventArgs } from '../actions/keyboard';import { FontFamilyModel, FontSizeModel, FontColorModel, FormatModel, BackgroundColorModel, NumberFormatListModel, BulletFormatListModel } from '../models/models';import { ToolbarSettingsModel, IFrameSettingsModel, ImageSettingsModel, AudioSettingsModel, VideoSettingsModel, TableSettingsModel } from '../models/models';import { QuickToolbarSettingsModel, InlineModeModel, PasteCleanupSettingsModel, FileManagerSettingsModel } from '../models/models';import { ToolbarSettings, ImageSettings, AudioSettings, VideoSettings, QuickToolbarSettings, FontFamily, FontSize, Format, NumberFormatList, BulletFormatList } from '../models/toolbar-settings';import { FileManagerSettings } from '../models/toolbar-settings';import { TableSettings, PasteCleanupSettings } from '../models/toolbar-settings';import { FontColor, BackgroundColor } from '../models/toolbar-settings';import { IFrameSettings } from '../models/iframe-settings';import { InlineMode } from '../models/inline-mode';import { Link } from '../renderer/link-module';import { Image } from '../renderer/image-module';import { Audio } from '../renderer/audio-module';import { Video } from '../renderer/video-module';import { Table } from '../renderer/table-module';import { Count } from '../actions/count';import { HtmlEditor } from '../actions/html-editor';import { MarkdownEditor } from '../actions/markdown-editor';import { defaultLocale } from '../models/default-locale';import { setAttributes } from '../actions/html-attributes';import { BaseToolbar } from '../actions/base-toolbar';import { QuickToolbar } from '../actions/quick-toolbar';import { FullScreen } from '../actions/full-screen';import { PasteCleanup } from '../actions/paste-clean-up';import { EnterKeyAction } from '../actions/enter-key';import * as CONSTANT from '../../common/constant';import { IHtmlKeyboardEvent } from '../../editor-manager/base/interface';import { dispatchEvent, getEditValue, isIDevice, decode, isEditableValueEmpty, getDefaultValue } from '../base/util';import { DialogRenderer } from '../renderer/dialog-renderer';import { SelectedEventArgs, RemovingEventArgs, UploadingEventArgs, BeforeUploadEventArgs } from '@syncfusion/ej2-inputs';import { Resize } from '../actions/resize';import { FileManager } from '../actions/file-manager';import { EditorManager } from '../../editor-manager';
2
2
  import {ComponentModel} from '@syncfusion/ej2-base';
3
3
 
4
4
  /**
@@ -56,6 +56,8 @@ export interface RichTextEditorModel extends ComponentModel{
56
56
  * actionOnScroll: 'hide',
57
57
  * link: ['Open', 'Edit', 'UnLink'],
58
58
  * image: ['Replace', 'Align', 'Caption', 'Remove', '-', 'InsertLink', 'Display', 'AltText', 'Dimension'],
59
+ * audio: ['AudioReplace', 'AudioRemove', 'AudioLayoutOption'],
60
+ * video: ['VideoReplace', 'VideoAlign', 'VideoRemove', 'VideoLayoutOption', 'VideoDimension'],
59
61
  * }
60
62
  */
61
63
  quickToolbarSettings?: QuickToolbarSettingsModel;
@@ -138,6 +140,56 @@ export interface RichTextEditorModel extends ComponentModel{
138
140
  */
139
141
  insertImageSettings?: ImageSettingsModel;
140
142
 
143
+ /**
144
+ * Specifies the audio insert options in Rich Text Editor component and control with the following properties.
145
+ * * allowedTypes - Specifies the extensions of the audio types allowed to insert on bowering and
146
+ * passing the extensions with comma separators. For example, pass allowedTypes as .jpg and .png.
147
+ * * layoutOption - Sets the default display for an audio when it is inserted in to the RichTextEditor.
148
+ * Possible options are: 'Inline' and 'Break'.
149
+ * * saveFormat - Specifies the format to store the audio in the Rich Text Editor (Base64 or Blob).
150
+ * > If you want to insert a lot of tiny audios in the editor and don't want a specific physical location for
151
+ * saving audios, you can opt to save format as Base64.
152
+ * * saveUrl - Specifies the service URL of save action that will receive the uploaded files and save them in the server.
153
+ * * path - Specifies the path of the location to store the audios and refer it to display the audios.
154
+ *
155
+ * @default
156
+ * {
157
+ * allowedTypes: ['.wav', '.mp3', '.m4a','.wma'],
158
+ * layoutOption: 'Inline',
159
+ * saveFormat: 'Blob'
160
+ * saveUrl: null,
161
+ * path: null,
162
+ * }
163
+ */
164
+ insertAudioSettings?: AudioSettingsModel;
165
+
166
+ /**
167
+ * Specifies the video insert options in Rich Text Editor component and control with the following properties.
168
+ * * allowedTypes - Specifies the extensions of the video types allowed to insert on bowering and
169
+ * passing the extensions with comma separators. For example, pass allowedTypes as .jpg and .png.
170
+ * * layoutOption - Sets the default display for an video when it is inserted in to the RichTextEditor.
171
+ * Possible options are: 'Inline' and 'Break'.
172
+ * * width - Sets the default width of the video when it is inserted in the RichTextEditor.
173
+ * * saveFormat - Specifies the format to store the video in the Rich Text Editor (Base64 or Blob).
174
+ * > If you want to insert a lot of tiny videos in the editor and don't want a specific physical location for
175
+ * saving videos, you can opt to save format as Base64.
176
+ * * height - Sets the default height of the video when it is inserted in the RichTextEditor.
177
+ * * saveUrl - Specifies the service URL of save action that will receive the uploaded files and save them in the server.
178
+ * * path - Specifies the path of the location to store the videos and refer it to display the videos.
179
+ *
180
+ * @default
181
+ * {
182
+ * allowedTypes: ['.mp4', '.mov', '.wmv','.avi'],
183
+ * layoutOption: 'Inline',
184
+ * width: 'auto',
185
+ * height: 'auto',
186
+ * saveFormat: 'Blob'
187
+ * saveUrl: null,
188
+ * path: null,
189
+ * }
190
+ */
191
+ insertVideoSettings?: VideoSettingsModel;
192
+
141
193
  /**
142
194
  * Specifies the table insert options in Rich Text Editor component and control with the following properties.
143
195
  * * styles - Class name should be appended by default in table element.
@@ -618,7 +670,7 @@ export interface RichTextEditorModel extends ComponentModel{
618
670
  * If you cancel this event, the dialog remains closed.
619
671
  * Set the cancel argument to true to cancel the open of a dialog.
620
672
  *
621
- * @event 'object'
673
+ * @event 'beforeDialogOpen'
622
674
  * @blazorProperty 'OnDialogOpen'
623
675
  * @blazorType Syncfusion.EJ2.Blazor.Popups.BeforeOpenEventArgs
624
676
  */
@@ -628,7 +680,7 @@ export interface RichTextEditorModel extends ComponentModel{
628
680
  /**
629
681
  * Event triggers when a dialog is opened.
630
682
  *
631
- * @event 'object'
683
+ * @event 'dialogOpen'
632
684
  * @blazorProperty 'DialogOpened'
633
685
  * @blazorType DialogOpenEventArgs
634
686
  */
@@ -639,7 +691,7 @@ export interface RichTextEditorModel extends ComponentModel{
639
691
  * If you cancel this event, the dialog remains opened.
640
692
  * Set the cancel argument to true to prevent closing a dialog.
641
693
  *
642
- * @event 'object'
694
+ * @event 'beforeDialogClose'
643
695
  * @blazorProperty 'OnDialogClose'
644
696
  * @blazorType Syncfusion.EJ2.Blazor.Popups.BeforeOpenEventArgs
645
697
  */
@@ -648,7 +700,7 @@ export interface RichTextEditorModel extends ComponentModel{
648
700
  /**
649
701
  * Event triggers after the dialog has been closed.
650
702
  *
651
- * @event 'object'
703
+ * @event 'dialogClose'
652
704
  * @blazorProperty 'DialogClosed'
653
705
  * @blazorType DialogCloseEventArgs
654
706
  */
@@ -657,7 +709,7 @@ export interface RichTextEditorModel extends ComponentModel{
657
709
  /**
658
710
  * Event triggers when the quick toolbar is being opened.
659
711
  *
660
- * @event 'object'
712
+ * @event 'beforeQuickToolbarOpen'
661
713
  * @blazorProperty 'OnQuickToolbarOpen'
662
714
  */
663
715
  beforeQuickToolbarOpen?: EmitType<BeforeQuickToolbarOpenArgs>;
@@ -665,7 +717,7 @@ export interface RichTextEditorModel extends ComponentModel{
665
717
  /**
666
718
  * Event triggers when a quick toolbar is opened.
667
719
  *
668
- * @event 'object'
720
+ * @event 'quickToolbarOpen'
669
721
  * @blazorProperty 'QuickToolbarOpened'
670
722
  * @blazorType QuickToolbarEventArgs
671
723
  */
@@ -674,7 +726,7 @@ export interface RichTextEditorModel extends ComponentModel{
674
726
  /**
675
727
  * Event triggers after the quick toolbar has been closed.
676
728
  *
677
- * @event 'object'
729
+ * @event 'quickToolbarClose'
678
730
  * @blazorProperty 'QuickToolbarClosed'
679
731
  * @blazorType QuickToolbarEventArgs
680
732
  */
@@ -684,14 +736,14 @@ export interface RichTextEditorModel extends ComponentModel{
684
736
  * This event is deprecated and no longer works. Use `updatedToolbarStatus` event to get the undo and redo status.
685
737
  *
686
738
 
687
- * @event 'object'
739
+ * @event 'toolbarStatusUpdate'
688
740
  */
689
741
  toolbarStatusUpdate?: EmitType<Object>;
690
742
 
691
743
  /**
692
744
  * Triggers when the toolbar items status is updated.
693
745
  *
694
- * @event 'object'
746
+ * @event 'updatedToolbarStatus'
695
747
  * @blazorType ToolbarUpdateEventArgs
696
748
  */
697
749
  updatedToolbarStatus?: EmitType<ToolbarStatusEventArgs>;
@@ -699,7 +751,7 @@ export interface RichTextEditorModel extends ComponentModel{
699
751
  /**
700
752
  * Event triggers when the image is selected or dragged into the insert image dialog.
701
753
  *
702
- * @event 'object'
754
+ * @event 'imageSelected'
703
755
  * @blazorProperty 'OnImageSelected'
704
756
  */
705
757
  imageSelected?: EmitType<SelectedEventArgs>;
@@ -714,7 +766,7 @@ export interface RichTextEditorModel extends ComponentModel{
714
766
  /**
715
767
  * Event triggers when the selected image begins to upload in the insert image dialog.
716
768
  *
717
- * @event 'object'
769
+ * @event 'imageUploading'
718
770
  * @blazorProperty 'OnImageUploading'
719
771
  */
720
772
  imageUploading?: EmitType<UploadingEventArgs>;
@@ -722,7 +774,7 @@ export interface RichTextEditorModel extends ComponentModel{
722
774
  /**
723
775
  * Event triggers when the image is successfully uploaded to the server side.
724
776
  *
725
- * @event 'object'
777
+ * @event 'imageUploadSuccess'
726
778
  * @blazorProperty 'OnImageUploadSuccess'
727
779
  * @blazorType ImageSuccessEventArgs
728
780
  */
@@ -731,7 +783,7 @@ export interface RichTextEditorModel extends ComponentModel{
731
783
  /**
732
784
  * Event triggers when there is an error in the image upload.
733
785
  *
734
- * @event 'object'
786
+ * @event 'imageUploadFailed'
735
787
  * @blazorProperty 'OnImageUploadFailed'
736
788
  * @blazorType ImageFailedEventArgs
737
789
  */
@@ -740,7 +792,7 @@ export interface RichTextEditorModel extends ComponentModel{
740
792
  /**
741
793
  * Event triggers when the selected image is cleared from the insert image dialog.
742
794
  *
743
- * @event 'object'
795
+ * @event 'imageRemoving'
744
796
  * @blazorProperty 'OnImageRemoving'
745
797
  */
746
798
  imageRemoving?: EmitType<RemovingEventArgs>;
@@ -748,15 +800,64 @@ export interface RichTextEditorModel extends ComponentModel{
748
800
  /**
749
801
  * Event triggers when the selected image is cleared from the Rich Text Editor Content.
750
802
  *
751
- * @event 'object'
803
+ * @event 'afterImageDelete'
752
804
  * @blazorProperty 'OnImageDelete'
753
805
  */
754
806
  afterImageDelete?: EmitType<AfterImageDeleteEventArgs>;
755
807
 
808
+ /**
809
+ * Event triggers when the media is selected or dragged into the insert media audio/video dialog.
810
+ *
811
+ * @event 'fileSelected'
812
+ */
813
+ fileSelected?: EmitType<SelectedEventArgs>;
814
+
815
+ /**
816
+ * Event triggers before the media audio/video upload process.
817
+ *
818
+ * @event 'beforeFileUpload'
819
+ */
820
+ beforeFileUpload?: EmitType<BeforeUploadEventArgs>;
821
+
822
+ /**
823
+ * Event triggers when the selected media begins to upload in the insert media audio/video dialog.
824
+ *
825
+ * @event 'fileUploading'
826
+ */
827
+ fileUploading?: EmitType<UploadingEventArgs>;
828
+
829
+ /**
830
+ * Event triggers when the media is successfully uploaded to the server side.
831
+ *
832
+ * @event 'fileUploadSuccess'
833
+ */
834
+ fileUploadSuccess?: EmitType<Object>;
835
+
836
+ /**
837
+ * Event triggers when there is an error in the media upload.
838
+ *
839
+ * @event 'fileUploadFailed'
840
+ */
841
+ fileUploadFailed?: EmitType<Object>;
842
+
843
+ /**
844
+ * Event triggers when the selected media is cleared from the insert audio/video dialog.
845
+ *
846
+ * @event 'fileRemoving'
847
+ */
848
+ fileRemoving?: EmitType<RemovingEventArgs>;
849
+
850
+ /**
851
+ * Event triggers when the selected media is cleared from the Rich Text Editor Content.
852
+ *
853
+ * @event 'afterMediaDelete'
854
+ */
855
+ afterMediaDelete?: EmitType<AfterMediaDeleteEventArgs>;
856
+
756
857
  /**
757
858
  * Triggers when the Rich Text Editor is rendered.
758
859
  *
759
- * @event 'object'
860
+ * @event 'created'
760
861
  * @blazorProperty 'Created'
761
862
  */
762
863
  created?: EmitType<Object>;
@@ -764,7 +865,7 @@ export interface RichTextEditorModel extends ComponentModel{
764
865
  /**
765
866
  * Triggers when the Rich Text Editor is destroyed.
766
867
  *
767
- * @event 'object'
868
+ * @event 'destroyed'
768
869
  * @blazorProperty 'Destroyed'
769
870
  * @blazorType DestroyedEventArgs
770
871
  */
@@ -773,7 +874,7 @@ export interface RichTextEditorModel extends ComponentModel{
773
874
  /**
774
875
  * Event triggers before sanitize the value. It's only applicable to editorMode as `HTML`.
775
876
  *
776
- * @event 'object'
877
+ * @event 'beforeSanitizeHtml'
777
878
  * @blazorProperty 'OnSanitizeHtml'
778
879
  */
779
880
  beforeSanitizeHtml?: EmitType<BeforeSanitizeHtmlArgs>;
@@ -781,7 +882,7 @@ export interface RichTextEditorModel extends ComponentModel{
781
882
  /**
782
883
  * Triggers when Rich Text Editor is focused out.
783
884
  *
784
- * @event 'object'
885
+ * @event 'blur'
785
886
  * @blazorType BlurEventArgs
786
887
  */
787
888
  blur?: EmitType<Object>;
@@ -789,7 +890,7 @@ export interface RichTextEditorModel extends ComponentModel{
789
890
  /**
790
891
  * Triggers when Rich Text Editor Toolbar items is clicked.
791
892
  *
792
- * @event 'object'
893
+ * @event 'toolbarClick'
793
894
  * @blazorProperty 'OnToolbarClick'
794
895
  * @blazorType ToolbarClickEventArgs
795
896
  */
@@ -798,7 +899,7 @@ export interface RichTextEditorModel extends ComponentModel{
798
899
  /**
799
900
  * Triggers when Rich Text Editor is focused in
800
901
  *
801
- * @event 'object'
902
+ * @event 'focus'
802
903
  * @blazorType FocusEventArgs
803
904
  */
804
905
  focus?: EmitType<Object>;
@@ -806,7 +907,7 @@ export interface RichTextEditorModel extends ComponentModel{
806
907
  /**
807
908
  * Triggers only when Rich Text Editor is blurred and changes are done to the content.
808
909
  *
809
- * @event 'object'
910
+ * @event 'change'
810
911
  * @blazorProperty 'ValueChange'
811
912
  */
812
913
  change?: EmitType<ChangeEventArgs>;
@@ -814,7 +915,7 @@ export interface RichTextEditorModel extends ComponentModel{
814
915
  /**
815
916
  * Triggers only when resizing the image.
816
917
  *
817
- * @event 'object'
918
+ * @event 'resizing'
818
919
  * @blazorProperty 'Resizing'
819
920
  */
820
921
  resizing?: EmitType<ResizeArgs>;
@@ -822,7 +923,7 @@ export interface RichTextEditorModel extends ComponentModel{
822
923
  /**
823
924
  * Triggers only when start resize the image.
824
925
  *
825
- * @event 'object'
926
+ * @event 'resizeStart'
826
927
  * @blazorProperty 'OnResizeStart'
827
928
  */
828
929
  resizeStart?: EmitType<ResizeArgs>;
@@ -830,7 +931,7 @@ export interface RichTextEditorModel extends ComponentModel{
830
931
  /**
831
932
  * Triggers only when stop resize the image.
832
933
  *
833
- * @event 'object'
934
+ * @event 'resizeStop'
834
935
  * @blazorProperty 'OnResizeStop'
835
936
  */
836
937
  resizeStop?: EmitType<ResizeArgs>;
@@ -838,21 +939,21 @@ export interface RichTextEditorModel extends ComponentModel{
838
939
  /**
839
940
  * Triggers before cleanup the copied content.
840
941
  *
841
- * @event 'object'
942
+ * @event 'beforePasteCleanup'
842
943
  */
843
944
  beforePasteCleanup?: EmitType<PasteCleanupArgs>;
844
945
 
845
946
  /**
846
947
  * Triggers after cleanup the copied content.
847
948
  *
848
- * @event 'object'
949
+ * @event 'afterPasteCleanup'
849
950
  */
850
951
  afterPasteCleanup?: EmitType<object>;
851
952
 
852
953
  /**
853
954
  * Triggers before drop the image.
854
955
  *
855
- * @event 'object'
956
+ * @event 'beforeImageDrop'
856
957
  * @blazorProperty 'OnImageDrop'
857
958
  */
858
959
  beforeImageDrop?: EmitType<ImageDropEventArgs>;