@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.
- package/CHANGELOG.md +22 -0
- package/dist/ej2-richtexteditor.min.js +10 -0
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +3790 -358
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +3780 -319
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -13
- package/src/common/config.js +2 -0
- package/src/common/types.d.ts +4 -0
- package/src/editor-manager/base/classes.d.ts +16 -0
- package/src/editor-manager/base/classes.js +16 -0
- package/src/editor-manager/base/constant.d.ts +2 -0
- package/src/editor-manager/base/constant.js +2 -0
- package/src/editor-manager/base/editor-manager.d.ts +4 -0
- package/src/editor-manager/base/editor-manager.js +14 -0
- package/src/editor-manager/base/interface.d.ts +2 -0
- package/src/editor-manager/plugin/audio.d.ts +32 -0
- package/src/editor-manager/plugin/audio.js +133 -0
- package/src/editor-manager/plugin/dom-node.js +1 -1
- package/src/editor-manager/plugin/image.js +1 -1
- package/src/editor-manager/plugin/inserthtml.js +1 -1
- package/src/editor-manager/plugin/lists.js +10 -8
- package/src/editor-manager/plugin/ms-word-clean-up.js +18 -18
- package/src/editor-manager/plugin/nodecutter.d.ts +1 -1
- package/src/editor-manager/plugin/nodecutter.js +7 -5
- package/src/editor-manager/plugin/selection-commands.js +3 -2
- package/src/editor-manager/plugin/table.js +3 -2
- package/src/editor-manager/plugin/undo.js +2 -1
- package/src/editor-manager/plugin/video.d.ts +34 -0
- package/src/editor-manager/plugin/video.js +249 -0
- package/src/editor-manager/plugin.d.ts +2 -0
- package/src/editor-manager/plugin.js +2 -0
- package/src/global.js +1 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -1
- package/src/rich-text-editor/actions/base-toolbar.js +1 -1
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
- package/src/rich-text-editor/actions/dropdown-buttons.js +14 -11
- package/src/rich-text-editor/actions/enter-key.d.ts +1 -0
- package/src/rich-text-editor/actions/enter-key.js +157 -103
- package/src/rich-text-editor/actions/html-editor.d.ts +1 -0
- package/src/rich-text-editor/actions/html-editor.js +59 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -1
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +2 -0
- package/src/rich-text-editor/actions/quick-toolbar.js +52 -6
- package/src/rich-text-editor/actions/resize.js +11 -1
- package/src/rich-text-editor/actions/toolbar-action.js +2 -1
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- package/src/rich-text-editor/audio.d.ts +4 -0
- package/src/rich-text-editor/audio.js +4 -0
- package/src/rich-text-editor/base/classes.d.ts +50 -0
- package/src/rich-text-editor/base/classes.js +50 -0
- package/src/rich-text-editor/base/constant.d.ts +74 -14
- package/src/rich-text-editor/base/constant.js +76 -16
- package/src/rich-text-editor/base/enum.d.ts +10 -2
- package/src/rich-text-editor/base/enum.js +10 -2
- package/src/rich-text-editor/base/interface.d.ts +86 -2
- package/src/rich-text-editor/base/interface.js +8 -0
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +130 -29
- package/src/rich-text-editor/base/rich-text-editor.d.ts +150 -30
- package/src/rich-text-editor/base/rich-text-editor.js +200 -6
- package/src/rich-text-editor/formatter/formatter.js +7 -2
- package/src/rich-text-editor/models/default-locale.js +46 -0
- package/src/rich-text-editor/models/items.d.ts +3 -0
- package/src/rich-text-editor/models/items.js +100 -3
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +169 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +143 -1
- package/src/rich-text-editor/models/toolbar-settings.js +88 -0
- package/src/rich-text-editor/renderer/audio-module.d.ts +76 -0
- package/src/rich-text-editor/renderer/audio-module.js +875 -0
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +9 -6
- package/src/rich-text-editor/renderer/link-module.js +2 -1
- package/src/rich-text-editor/renderer/table-module.d.ts +2 -0
- package/src/rich-text-editor/renderer/table-module.js +43 -7
- package/src/rich-text-editor/renderer/video-module.d.ts +105 -0
- package/src/rich-text-editor/renderer/video-module.js +1422 -0
- package/src/rich-text-editor/renderer/view-source.js +2 -0
- package/src/rich-text-editor/renderer.d.ts +2 -0
- package/src/rich-text-editor/renderer.js +2 -0
- package/src/rich-text-editor/video.d.ts +4 -0
- package/src/rich-text-editor/video.js +4 -0
- package/styles/_all.scss +1 -2
- package/styles/bootstrap-dark.css +220 -70
- package/styles/bootstrap.css +220 -70
- package/styles/bootstrap4.css +220 -70
- package/styles/bootstrap5-dark.css +220 -70
- package/styles/bootstrap5.css +220 -70
- package/styles/fabric-dark.css +220 -70
- package/styles/fabric.css +222 -72
- package/styles/fluent-dark.css +222 -72
- package/styles/fluent.css +222 -72
- package/styles/highcontrast-light.css +222 -72
- package/styles/highcontrast.css +222 -72
- package/styles/material-dark.css +220 -70
- package/styles/material.css +220 -70
- package/styles/rich-text-editor/_all.scss +1 -1
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +3 -0
- package/styles/rich-text-editor/_bootstrap-definition.scss +2 -1
- package/styles/rich-text-editor/_bootstrap4-definition.scss +5 -3
- package/styles/rich-text-editor/_bootstrap5-definition.scss +8 -3
- package/styles/rich-text-editor/_fabric-dark-definition.scss +3 -0
- package/styles/rich-text-editor/_fabric-definition.scss +2 -0
- package/styles/rich-text-editor/_fluent-definition.scss +8 -3
- package/styles/rich-text-editor/_fusionnew-definition.scss +8 -3
- package/styles/rich-text-editor/_highcontrast-definition.scss +2 -0
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +2 -0
- package/styles/rich-text-editor/_layout.scss +116 -74
- package/styles/rich-text-editor/_material-dark-definition.scss +3 -0
- package/styles/rich-text-editor/_material-definition.scss +2 -0
- package/styles/rich-text-editor/_material3-definition.scss +8 -3
- package/styles/rich-text-editor/_tailwind-definition.scss +7 -2
- package/styles/rich-text-editor/_theme.scss +74 -15
- package/styles/rich-text-editor/bootstrap-dark.css +220 -70
- package/styles/rich-text-editor/bootstrap.css +220 -70
- package/styles/rich-text-editor/bootstrap4.css +220 -70
- package/styles/rich-text-editor/bootstrap5-dark.css +220 -70
- package/styles/rich-text-editor/bootstrap5.css +220 -70
- package/styles/rich-text-editor/fabric-dark.css +220 -70
- package/styles/rich-text-editor/fabric.css +222 -72
- package/styles/rich-text-editor/fluent-dark.css +222 -72
- package/styles/rich-text-editor/fluent.css +222 -72
- package/styles/rich-text-editor/highcontrast-light.css +222 -72
- package/styles/rich-text-editor/highcontrast.css +222 -72
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +20 -4
- package/styles/rich-text-editor/icons/_bootstrap.scss +20 -4
- package/styles/rich-text-editor/icons/_bootstrap4.scss +20 -4
- package/styles/rich-text-editor/icons/_bootstrap5.scss +20 -4
- package/styles/rich-text-editor/icons/_fabric-dark.scss +20 -4
- package/styles/rich-text-editor/icons/_fabric.scss +20 -4
- package/styles/rich-text-editor/icons/_fluent.scss +20 -4
- package/styles/rich-text-editor/icons/_fusionnew.scss +20 -4
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +20 -4
- package/styles/rich-text-editor/icons/_highcontrast.scss +20 -4
- package/styles/rich-text-editor/icons/_material-dark.scss +20 -4
- package/styles/rich-text-editor/icons/_material.scss +20 -4
- package/styles/rich-text-editor/icons/_material3.scss +20 -4
- package/styles/rich-text-editor/icons/_tailwind.scss +20 -4
- package/styles/rich-text-editor/material-dark.css +220 -70
- package/styles/rich-text-editor/material.css +220 -70
- package/styles/rich-text-editor/tailwind-dark.css +220 -70
- package/styles/rich-text-editor/tailwind.css +220 -70
- package/styles/tailwind-dark.css +220 -70
- package/styles/tailwind.css +220 -70
- package/.eslintrc.json +0 -244
- package/tslint.json +0 -111
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EditorManager } from './../base/editor-manager';
|
|
2
|
+
import { IHtmlItem } from './../base/interface';
|
|
3
|
+
/**
|
|
4
|
+
* Video internal component
|
|
5
|
+
*
|
|
6
|
+
* @hidden
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
export declare class VideoCommand {
|
|
10
|
+
private parent;
|
|
11
|
+
/**
|
|
12
|
+
* Constructor for creating the Video plugin
|
|
13
|
+
*
|
|
14
|
+
* @param {EditorManager} parent - specifies the parent element
|
|
15
|
+
* @hidden
|
|
16
|
+
|
|
17
|
+
*/
|
|
18
|
+
constructor(parent: EditorManager);
|
|
19
|
+
private addEventListener;
|
|
20
|
+
/**
|
|
21
|
+
* videoCommand method
|
|
22
|
+
*
|
|
23
|
+
* @param {IHtmlItem} e - specifies the element
|
|
24
|
+
* @returns {void}
|
|
25
|
+
* @hidden
|
|
26
|
+
|
|
27
|
+
*/
|
|
28
|
+
videoCommand(e: IHtmlItem): void;
|
|
29
|
+
private createVideo;
|
|
30
|
+
private editAreaVideoClick;
|
|
31
|
+
private setStyle;
|
|
32
|
+
private videoDimension;
|
|
33
|
+
private callBack;
|
|
34
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { createElement, isNullOrUndefined as isNOU, detach, addClass, Browser, formatUnit } from '@syncfusion/ej2-base';
|
|
2
|
+
import * as CONSTANT from './../base/constant';
|
|
3
|
+
import * as classes from './../base/classes';
|
|
4
|
+
import { InsertHtml } from './inserthtml';
|
|
5
|
+
/**
|
|
6
|
+
* Video internal component
|
|
7
|
+
*
|
|
8
|
+
* @hidden
|
|
9
|
+
|
|
10
|
+
*/
|
|
11
|
+
var VideoCommand = /** @class */ (function () {
|
|
12
|
+
/**
|
|
13
|
+
* Constructor for creating the Video plugin
|
|
14
|
+
*
|
|
15
|
+
* @param {EditorManager} parent - specifies the parent element
|
|
16
|
+
* @hidden
|
|
17
|
+
|
|
18
|
+
*/
|
|
19
|
+
function VideoCommand(parent) {
|
|
20
|
+
this.parent = parent;
|
|
21
|
+
this.addEventListener();
|
|
22
|
+
}
|
|
23
|
+
VideoCommand.prototype.addEventListener = function () {
|
|
24
|
+
this.parent.observer.on(CONSTANT.VIDEO, this.videoCommand, this);
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* videoCommand method
|
|
28
|
+
*
|
|
29
|
+
* @param {IHtmlItem} e - specifies the element
|
|
30
|
+
* @returns {void}
|
|
31
|
+
* @hidden
|
|
32
|
+
|
|
33
|
+
*/
|
|
34
|
+
VideoCommand.prototype.videoCommand = function (e) {
|
|
35
|
+
var selectNode;
|
|
36
|
+
var videoWrapNode;
|
|
37
|
+
var videoClickElem;
|
|
38
|
+
var value = e.value.toString().toLowerCase();
|
|
39
|
+
if (value !== 'video' && value !== 'videoreplace') {
|
|
40
|
+
selectNode = e.item.selectNode[0];
|
|
41
|
+
videoWrapNode = selectNode.closest('.' + classes.CLASS_EMBED_VIDEO_WRAP);
|
|
42
|
+
videoClickElem = selectNode.closest('.' + classes.CLASS_VIDEO_CLICK_ELEM);
|
|
43
|
+
}
|
|
44
|
+
switch (value) {
|
|
45
|
+
case 'video':
|
|
46
|
+
case 'videoreplace':
|
|
47
|
+
this.createVideo(e);
|
|
48
|
+
break;
|
|
49
|
+
case 'videodimension':
|
|
50
|
+
this.videoDimension(e);
|
|
51
|
+
break;
|
|
52
|
+
case 'inline':
|
|
53
|
+
selectNode.removeAttribute('class');
|
|
54
|
+
if (videoWrapNode) {
|
|
55
|
+
videoWrapNode.style.display = 'inline-block';
|
|
56
|
+
}
|
|
57
|
+
if (videoClickElem) {
|
|
58
|
+
selectNode.parentElement.style.cssFloat = '';
|
|
59
|
+
}
|
|
60
|
+
addClass([selectNode], [classes.CLASS_VIDEO, classes.CLASS_VIDEO_INLINE, classes.CLASS_VIDEO_FOCUS]);
|
|
61
|
+
this.callBack(e);
|
|
62
|
+
break;
|
|
63
|
+
case 'break':
|
|
64
|
+
selectNode.removeAttribute('class');
|
|
65
|
+
if (videoWrapNode) {
|
|
66
|
+
videoWrapNode.style.display = 'block';
|
|
67
|
+
}
|
|
68
|
+
if (videoClickElem) {
|
|
69
|
+
selectNode.parentElement.style.cssFloat = '';
|
|
70
|
+
}
|
|
71
|
+
addClass([selectNode], [classes.CLASS_VIDEO_BREAK, classes.CLASS_VIDEO, classes.CLASS_VIDEO_FOCUS]);
|
|
72
|
+
this.callBack(e);
|
|
73
|
+
break;
|
|
74
|
+
case 'justifyleft':
|
|
75
|
+
selectNode.removeAttribute('class');
|
|
76
|
+
if (videoWrapNode) {
|
|
77
|
+
videoWrapNode.style.display = 'block';
|
|
78
|
+
}
|
|
79
|
+
if (videoClickElem) {
|
|
80
|
+
selectNode.parentElement.style.cssFloat = 'left';
|
|
81
|
+
}
|
|
82
|
+
addClass([selectNode], [classes.CLASS_VIDEO, classes.CLASS_VIDEO_LEFT]);
|
|
83
|
+
this.callBack(e);
|
|
84
|
+
break;
|
|
85
|
+
case 'justifycenter':
|
|
86
|
+
selectNode.removeAttribute('class');
|
|
87
|
+
if (videoWrapNode) {
|
|
88
|
+
videoWrapNode.style.display = 'block';
|
|
89
|
+
}
|
|
90
|
+
if (videoClickElem) {
|
|
91
|
+
selectNode.parentElement.style.cssFloat = '';
|
|
92
|
+
}
|
|
93
|
+
addClass([selectNode], [classes.CLASS_VIDEO, classes.CLASS_VIDEO_CENTER]);
|
|
94
|
+
this.callBack(e);
|
|
95
|
+
break;
|
|
96
|
+
case 'justifyright':
|
|
97
|
+
selectNode.removeAttribute('class');
|
|
98
|
+
if (videoWrapNode) {
|
|
99
|
+
videoWrapNode.style.display = 'block';
|
|
100
|
+
}
|
|
101
|
+
if (videoClickElem) {
|
|
102
|
+
selectNode.parentElement.style.cssFloat = 'right';
|
|
103
|
+
}
|
|
104
|
+
addClass([selectNode], [classes.CLASS_VIDEO, classes.CLASS_VIDEO_RIGHT]);
|
|
105
|
+
this.callBack(e);
|
|
106
|
+
break;
|
|
107
|
+
case 'videoremove':
|
|
108
|
+
detach(selectNode.parentElement);
|
|
109
|
+
this.callBack(e);
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
VideoCommand.prototype.createVideo = function (e) {
|
|
114
|
+
var _this = this;
|
|
115
|
+
var isReplaced = false;
|
|
116
|
+
var wrapElement;
|
|
117
|
+
var vidElement;
|
|
118
|
+
var sourceElement;
|
|
119
|
+
if (e.value === 'VideoReplace' && !isNOU(e.item.selectParent) && (e.item.selectParent[0].tagName === 'VIDEO')) {
|
|
120
|
+
var videoEle = e.item.selectParent[0].querySelector('source');
|
|
121
|
+
this.setStyle(videoEle, e, videoEle);
|
|
122
|
+
isReplaced = true;
|
|
123
|
+
}
|
|
124
|
+
else if (e.value === 'VideoReplace' && !isNOU(e.item.selectParent) &&
|
|
125
|
+
e.item.selectParent[0].classList &&
|
|
126
|
+
e.item.selectParent[0].classList.contains(classes.CLASS_VIDEO_CLICK_ELEM)) {
|
|
127
|
+
e.item.selectParent[0].innerHTML = e.item.fileName;
|
|
128
|
+
this.setStyle(e.item.selectParent[0].firstElementChild, e, e.item.selectParent[0].firstElementChild);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
if (!e.item.isEmbedUrl) {
|
|
132
|
+
wrapElement = createElement('span', { className: classes.CLASS_VIDEO_WRAP, attrs: { contentEditable: 'false', title: e.item.fileName } });
|
|
133
|
+
vidElement = createElement('video', { className: classes.CLASS_VIDEO + ' ' + classes.CLASS_VIDEO_INLINE, attrs: { controls: '' } });
|
|
134
|
+
sourceElement = createElement('source');
|
|
135
|
+
this.setStyle(sourceElement, e, vidElement);
|
|
136
|
+
vidElement.appendChild(sourceElement);
|
|
137
|
+
wrapElement.appendChild(vidElement);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
wrapElement = createElement('span', { className: classes.CLASS_EMBED_VIDEO_WRAP, attrs: { contentEditable: 'false' } });
|
|
141
|
+
var clickElement = createElement('span', { className: classes.CLASS_VIDEO_CLICK_ELEM });
|
|
142
|
+
var temp = createElement('template');
|
|
143
|
+
temp.innerHTML = e.item.fileName;
|
|
144
|
+
clickElement.appendChild(temp.content);
|
|
145
|
+
vidElement = sourceElement = clickElement.firstElementChild;
|
|
146
|
+
this.setStyle(sourceElement, e, vidElement);
|
|
147
|
+
wrapElement.appendChild(clickElement);
|
|
148
|
+
}
|
|
149
|
+
if (!isNOU(e.item.selection)) {
|
|
150
|
+
e.item.selection.restore();
|
|
151
|
+
}
|
|
152
|
+
InsertHtml.Insert(this.parent.currentDocument, wrapElement, this.parent.editableElement);
|
|
153
|
+
if (wrapElement.nextElementSibling === null) {
|
|
154
|
+
var insertElem = createElement('br');
|
|
155
|
+
wrapElement.parentNode.insertBefore(insertElem, wrapElement.nextSibling);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (e.callBack && (isNOU(e.selector) || !isNOU(e.selector) && e.selector !== 'pasteCleanupModule')) {
|
|
159
|
+
var selectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0];
|
|
160
|
+
var videoElm_1 = (e.value === 'VideoReplace' || isReplaced) ? !e.item.isEmbedUrl ? e.item.selectParent[0] : e.item.selectParent[0].querySelector('iframe')
|
|
161
|
+
: (Browser.isIE ? selectedNode : !e.item.isEmbedUrl ? selectedNode.lastElementChild : selectedNode.querySelector('iframe'));
|
|
162
|
+
videoElm_1.addEventListener(videoElm_1.tagName !== 'IFRAME' ? 'loadeddata' : 'load', function () {
|
|
163
|
+
if (e.value !== 'VideoReplace' || !isReplaced) {
|
|
164
|
+
e.callBack({
|
|
165
|
+
requestType: 'Videos',
|
|
166
|
+
editorMode: 'HTML',
|
|
167
|
+
event: e.event,
|
|
168
|
+
range: _this.parent.nodeSelection.getRange(_this.parent.currentDocument),
|
|
169
|
+
elements: [videoElm_1]
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
if (isReplaced) {
|
|
174
|
+
videoElm_1.load();
|
|
175
|
+
}
|
|
176
|
+
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
177
|
+
vidElement.addEventListener('play', function (args) { _this.editAreaVideoClick(e); });
|
|
178
|
+
vidElement.addEventListener('pause', function (args) { _this.editAreaVideoClick(e); });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
VideoCommand.prototype.editAreaVideoClick = function (e) {
|
|
183
|
+
e.callBack({
|
|
184
|
+
requestType: 'VideosPlayPause',
|
|
185
|
+
editorMode: 'HTML',
|
|
186
|
+
event: e.event
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
VideoCommand.prototype.setStyle = function (sourceElement, e, videoEle) {
|
|
190
|
+
if (e.item.url !== '' && !isNOU(e.item.url)) {
|
|
191
|
+
sourceElement.setAttribute('src', e.item.url);
|
|
192
|
+
}
|
|
193
|
+
if (!e.item.isEmbedUrl) {
|
|
194
|
+
sourceElement.type = e.item.fileName && e.item.fileName.split('.').length > 0 ?
|
|
195
|
+
'video/' + e.item.fileName.split('.')[e.item.fileName.split('.').length - 1] :
|
|
196
|
+
e.item.url && e.item.url.split('.').length > 0 ? 'video/' + e.item.url.split('.')[e.item.url.split('.').length - 1] : '';
|
|
197
|
+
}
|
|
198
|
+
if (!isNOU(e.item.width) && !isNOU(e.item.width.width)) {
|
|
199
|
+
videoEle.setAttribute('width', formatUnit(e.item.width.width));
|
|
200
|
+
}
|
|
201
|
+
if (!isNOU(e.item.height) && !isNOU(e.item.height.height)) {
|
|
202
|
+
videoEle.setAttribute('height', formatUnit(e.item.height.height));
|
|
203
|
+
}
|
|
204
|
+
if (!isNOU(e.item.width) && !isNOU(e.item.width.minWidth)) {
|
|
205
|
+
videoEle.style.minWidth = formatUnit(e.item.width.minWidth);
|
|
206
|
+
}
|
|
207
|
+
if (!isNOU(e.item.width) && !isNOU(e.item.width.maxWidth)) {
|
|
208
|
+
videoEle.style.maxWidth = formatUnit(e.item.width.maxWidth);
|
|
209
|
+
}
|
|
210
|
+
if (!isNOU(e.item.height) && !isNOU(e.item.height.minHeight)) {
|
|
211
|
+
videoEle.style.minHeight = formatUnit(e.item.height.minHeight);
|
|
212
|
+
}
|
|
213
|
+
if (!isNOU(e.item.height) && !isNOU(e.item.height.maxHeight)) {
|
|
214
|
+
videoEle.style.maxHeight = formatUnit(e.item.height.maxHeight);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
VideoCommand.prototype.videoDimension = function (e) {
|
|
218
|
+
var selectNode = !(e.item.selectNode[0].classList.contains(classes.CLASS_VIDEO_CLICK_ELEM)) ? e.item.selectNode[0] :
|
|
219
|
+
e.item.selectNode[0].querySelector('iframe');
|
|
220
|
+
selectNode.style.height = '';
|
|
221
|
+
selectNode.style.width = '';
|
|
222
|
+
if (e.item.width !== 'auto') {
|
|
223
|
+
selectNode.style.width = formatUnit(e.item.width);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
selectNode.removeAttribute('width');
|
|
227
|
+
}
|
|
228
|
+
if (e.item.height !== 'auto') {
|
|
229
|
+
selectNode.style.height = formatUnit(e.item.height);
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
selectNode.removeAttribute('height');
|
|
233
|
+
}
|
|
234
|
+
this.callBack(e);
|
|
235
|
+
};
|
|
236
|
+
VideoCommand.prototype.callBack = function (e) {
|
|
237
|
+
if (e.callBack) {
|
|
238
|
+
e.callBack({
|
|
239
|
+
requestType: e.item.subCommand,
|
|
240
|
+
editorMode: 'HTML',
|
|
241
|
+
event: e.event,
|
|
242
|
+
range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
|
|
243
|
+
elements: this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
return VideoCommand;
|
|
248
|
+
}());
|
|
249
|
+
export { VideoCommand };
|
|
@@ -15,6 +15,8 @@ export * from './plugin/isformatted';
|
|
|
15
15
|
export * from './plugin/ms-word-clean-up';
|
|
16
16
|
export * from './plugin/nodecutter';
|
|
17
17
|
export * from './plugin/image';
|
|
18
|
+
export * from './plugin/audio';
|
|
19
|
+
export * from './plugin/video';
|
|
18
20
|
export * from './plugin/selection-commands';
|
|
19
21
|
export * from './plugin/selection-exec';
|
|
20
22
|
export * from './plugin/clearformat-exec';
|
|
@@ -15,6 +15,8 @@ export * from './plugin/isformatted';
|
|
|
15
15
|
export * from './plugin/ms-word-clean-up';
|
|
16
16
|
export * from './plugin/nodecutter';
|
|
17
17
|
export * from './plugin/image';
|
|
18
|
+
export * from './plugin/audio';
|
|
19
|
+
export * from './plugin/video';
|
|
18
20
|
export * from './plugin/selection-commands';
|
|
19
21
|
export * from './plugin/selection-exec';
|
|
20
22
|
export * from './plugin/clearformat-exec';
|
package/src/global.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as index from './index';
|
|
2
|
-
index.RichTextEditor.Inject(index.Toolbar, index.Link, index.Image, index.Count, index.QuickToolbar, index.HtmlEditor, index.MarkdownEditor, index.Table, index.PasteCleanup, index.Resize, index.FileManager);
|
|
2
|
+
index.RichTextEditor.Inject(index.Toolbar, index.Link, index.Image, index.Audio, index.Video, index.Count, index.QuickToolbar, index.HtmlEditor, index.MarkdownEditor, index.Table, index.PasteCleanup, index.Resize, index.FileManager);
|
|
3
3
|
export * from './index';
|
|
@@ -243,7 +243,9 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
243
243
|
parentData: parent_1.getBoundingClientRect(),
|
|
244
244
|
tBarElementHeight: tBarHeight
|
|
245
245
|
};
|
|
246
|
-
if (target.tagName === 'IMG'
|
|
246
|
+
if (target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
247
|
+
(target.classList.contains(classes.CLS_AUDIOWRAP) || target.classList.contains(classes.CLS_CLICKELEM) ||
|
|
248
|
+
target.classList.contains(classes.CLS_VID_CLICK_ELEM)))) {
|
|
247
249
|
_this.setPosition(showPopupData);
|
|
248
250
|
}
|
|
249
251
|
if (!_this.parent.inlineMode.enable) {
|
|
@@ -46,8 +46,8 @@ export declare class DropDownButtons {
|
|
|
46
46
|
private columnDropDown;
|
|
47
47
|
private cellDropDown;
|
|
48
48
|
private verticalAlignDropDown;
|
|
49
|
-
private
|
|
50
|
-
private
|
|
49
|
+
private renderDisplayDropDown;
|
|
50
|
+
private renderAlignmentDropDown;
|
|
51
51
|
private tableStylesDropDown;
|
|
52
52
|
private removeDropDownClasses;
|
|
53
53
|
/**
|
|
@@ -164,10 +164,13 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
164
164
|
});
|
|
165
165
|
break;
|
|
166
166
|
case 'align':
|
|
167
|
-
|
|
167
|
+
case 'videoalign':
|
|
168
|
+
_this.renderAlignmentDropDown(type, tbElement, targetElement, item);
|
|
168
169
|
break;
|
|
169
170
|
case 'display':
|
|
170
|
-
|
|
171
|
+
case 'audiolayoutoption':
|
|
172
|
+
case 'videolayoutoption':
|
|
173
|
+
_this.renderDisplayDropDown(type, tbElement, targetElement, item);
|
|
171
174
|
break;
|
|
172
175
|
case 'tablerows':
|
|
173
176
|
_this.rowDropDown(type, tbElement, targetElement);
|
|
@@ -351,29 +354,29 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
351
354
|
element: targetElement
|
|
352
355
|
});
|
|
353
356
|
};
|
|
354
|
-
DropDownButtons.prototype.
|
|
355
|
-
targetElement = select('#' + this.parent.getID() + '_' + type + '_Display', tbElement);
|
|
357
|
+
DropDownButtons.prototype.renderDisplayDropDown = function (type, tbElement, targetElement, item) {
|
|
358
|
+
targetElement = select('#' + this.parent.getID() + '_' + type + (item === 'display' ? '_Display' : item === 'videolayoutoption' ? '_VideoLayoutOption' : '_AudioLayoutOption'), tbElement);
|
|
356
359
|
if (targetElement.classList.contains(classes.CLS_DROPDOWN_BTN)) {
|
|
357
360
|
return;
|
|
358
361
|
}
|
|
359
362
|
this.displayDropDown = this.toolbarRenderer.renderDropDownButton({
|
|
360
|
-
iconCss: 'e-display e-icons',
|
|
363
|
+
iconCss: item === 'display' ? 'e-display e-icons' : item === 'videolayoutoption' ? 'e-video-display e-icons' : 'e-audio-display e-icons',
|
|
361
364
|
cssClass: classes.CLS_DROPDOWN_POPUP + ' ' + classes.CLS_DROPDOWN_ITEMS + ' ' + classes.CLS_QUICK_DROPDOWN,
|
|
362
|
-
itemName: 'Display',
|
|
363
|
-
items: model.imageDisplayItems,
|
|
365
|
+
itemName: item === 'display' ? 'Display' : item === 'videolayoutoption' ? 'VideoLayoutOption' : 'AudioLayoutOption',
|
|
366
|
+
items: item === 'display' ? model.imageDisplayItems : item === 'videolayoutoption' ? model.videoLayoutOptionItems : model.audioLayoutOptionItems,
|
|
364
367
|
element: targetElement
|
|
365
368
|
});
|
|
366
369
|
};
|
|
367
|
-
DropDownButtons.prototype.
|
|
368
|
-
targetElement = select('#' + this.parent.getID() + '_' + type + '_Align', tbElement);
|
|
370
|
+
DropDownButtons.prototype.renderAlignmentDropDown = function (type, tbElement, targetElement, item) {
|
|
371
|
+
targetElement = select('#' + this.parent.getID() + '_' + type + (item === 'align' ? '_Align' : '_VideoAlign'), tbElement);
|
|
369
372
|
if (targetElement.classList.contains(classes.CLS_DROPDOWN_BTN)) {
|
|
370
373
|
return;
|
|
371
374
|
}
|
|
372
375
|
this.imageAlignDropDown = this.toolbarRenderer.renderDropDownButton({
|
|
373
376
|
iconCss: 'e-justify-left e-icons',
|
|
374
377
|
cssClass: classes.CLS_DROPDOWN_POPUP + ' ' + classes.CLS_DROPDOWN_ICONS + ' ' + classes.CLS_QUICK_DROPDOWN,
|
|
375
|
-
itemName: 'Align',
|
|
376
|
-
items: model.imageAlignItems,
|
|
378
|
+
itemName: item === 'align' ? 'Align' : 'VideoAlign',
|
|
379
|
+
items: item === 'align' ? model.imageAlignItems : model.videoAlignItems,
|
|
377
380
|
element: targetElement
|
|
378
381
|
});
|
|
379
382
|
};
|