@syncfusion/ej2-richtexteditor 21.2.10 → 22.1.34
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/.eslintrc.json +1 -0
- package/CHANGELOG.md +18 -0
- package/dist/ej2-richtexteditor.min.js +2 -2
- 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 +1558 -186
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +1571 -189
- 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 +12 -12
- package/src/common/config.js +2 -2
- package/src/common/constant.d.ts +6 -0
- package/src/common/constant.js +6 -0
- package/src/common/interface.d.ts +2 -2
- package/src/common/util.js +2 -0
- package/src/editor-manager/base/editor-manager.d.ts +4 -3
- package/src/editor-manager/base/editor-manager.js +6 -1
- package/src/editor-manager/base/interface.d.ts +44 -9
- package/src/editor-manager/plugin/clearformat.d.ts +1 -0
- package/src/editor-manager/plugin/clearformat.js +1 -0
- package/src/editor-manager/plugin/dom-node.js +10 -6
- package/src/editor-manager/plugin/emoji-picker-action.d.ts +8 -0
- package/src/editor-manager/plugin/emoji-picker-action.js +62 -0
- package/src/editor-manager/plugin/format-painter-actions.d.ts +19 -36
- package/src/editor-manager/plugin/format-painter-actions.js +224 -81
- package/src/editor-manager/plugin/inserthtml.js +6 -1
- package/src/editor-manager/plugin/link.js +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +3 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +40 -7
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
- package/src/editor-manager/plugin/selection-commands.js +48 -23
- package/src/editor-manager/plugin/table.js +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +6 -0
- package/src/editor-manager/plugin/undo.d.ts +1 -0
- package/src/editor-manager/plugin/undo.js +26 -5
- package/src/editor-manager/plugin.d.ts +1 -0
- package/src/editor-manager/plugin.js +1 -0
- package/src/global.js +1 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.js +8 -1
- package/src/rich-text-editor/actions/base-toolbar.js +3 -2
- package/src/rich-text-editor/actions/emoji-picker.d.ts +48 -0
- package/src/rich-text-editor/actions/emoji-picker.js +778 -0
- package/src/rich-text-editor/actions/enter-key.js +2 -2
- package/src/rich-text-editor/actions/execute-command-callback.js +3 -1
- package/src/rich-text-editor/actions/file-manager.js +1 -0
- package/src/rich-text-editor/actions/format-painter.d.ts +2 -2
- package/src/rich-text-editor/actions/format-painter.js +11 -9
- package/src/rich-text-editor/actions/full-screen.js +6 -0
- package/src/rich-text-editor/actions/html-editor.js +11 -2
- package/src/rich-text-editor/actions/paste-clean-up.js +1 -0
- package/src/rich-text-editor/actions/resize.js +1 -1
- package/src/rich-text-editor/actions.d.ts +1 -0
- package/src/rich-text-editor/actions.js +1 -0
- package/src/rich-text-editor/base/constant.d.ts +10 -0
- package/src/rich-text-editor/base/constant.js +10 -0
- package/src/rich-text-editor/base/enum.d.ts +0 -4
- package/src/rich-text-editor/base/interface.d.ts +44 -6
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +13 -7
- package/src/rich-text-editor/base/rich-text-editor.d.ts +27 -7
- package/src/rich-text-editor/base/rich-text-editor.js +42 -12
- package/src/rich-text-editor/base/util.js +2 -2
- package/src/rich-text-editor/formatter/formatter.js +7 -5
- package/src/rich-text-editor/models/default-locale.js +14 -2
- package/src/rich-text-editor/models/items.d.ts +2 -1
- package/src/rich-text-editor/models/items.js +188 -1
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +212 -9
- package/src/rich-text-editor/models/toolbar-settings.d.ts +209 -11
- package/src/rich-text-editor/models/toolbar-settings.js +23 -6
- package/src/rich-text-editor/renderer/audio-module.js +3 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +11 -6
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +2 -0
- package/src/rich-text-editor/renderer/toolbar-renderer.js +7 -2
- package/src/rich-text-editor/renderer/video-module.js +14 -9
- package/styles/bootstrap-dark.css +299 -137
- package/styles/bootstrap.css +305 -140
- package/styles/bootstrap4.css +304 -133
- package/styles/bootstrap5-dark.css +310 -165
- package/styles/bootstrap5.css +310 -165
- package/styles/fabric-dark.css +297 -136
- package/styles/fabric.css +294 -133
- package/styles/fluent-dark.css +311 -170
- package/styles/fluent.css +311 -170
- package/styles/highcontrast-light.css +289 -128
- package/styles/highcontrast.css +296 -135
- package/styles/material-dark.css +295 -129
- package/styles/material.css +300 -134
- package/styles/material3-dark.css +3082 -0
- package/styles/material3-dark.scss +3 -0
- package/styles/material3.css +3138 -0
- package/styles/material3.scss +3 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +54 -12
- package/styles/rich-text-editor/_bootstrap-definition.scss +57 -13
- package/styles/rich-text-editor/_bootstrap4-definition.scss +50 -7
- package/styles/rich-text-editor/_bootstrap5-definition.scss +56 -13
- package/styles/rich-text-editor/_fabric-dark-definition.scss +53 -10
- package/styles/rich-text-editor/_fabric-definition.scss +52 -9
- package/styles/rich-text-editor/_fluent-definition.scss +56 -15
- package/styles/rich-text-editor/_fusionnew-definition.scss +46 -4
- package/styles/rich-text-editor/_highcontrast-definition.scss +52 -9
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +48 -5
- package/styles/rich-text-editor/_layout.scss +280 -68
- package/styles/rich-text-editor/_material-dark-definition.scss +48 -5
- package/styles/rich-text-editor/_material-definition.scss +50 -6
- package/styles/rich-text-editor/_material3-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_material3-definition.scss +262 -0
- package/styles/rich-text-editor/_tailwind-definition.scss +63 -23
- package/styles/rich-text-editor/_theme.scss +103 -19
- package/styles/rich-text-editor/bootstrap-dark.css +299 -137
- package/styles/rich-text-editor/bootstrap.css +305 -140
- package/styles/rich-text-editor/bootstrap4.css +304 -133
- package/styles/rich-text-editor/bootstrap5-dark.css +310 -165
- package/styles/rich-text-editor/bootstrap5.css +310 -165
- package/styles/rich-text-editor/fabric-dark.css +297 -136
- package/styles/rich-text-editor/fabric.css +294 -133
- package/styles/rich-text-editor/fluent-dark.css +311 -170
- package/styles/rich-text-editor/fluent.css +311 -170
- package/styles/rich-text-editor/highcontrast-light.css +289 -128
- package/styles/rich-text-editor/highcontrast.css +296 -135
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap4.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap5.scss +1 -1
- package/styles/rich-text-editor/icons/_fabric-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_fabric.scss +1 -1
- package/styles/rich-text-editor/icons/_fluent.scss +1 -1
- package/styles/rich-text-editor/icons/_fusionnew.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast.scss +1 -1
- package/styles/rich-text-editor/icons/_material-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_material.scss +1 -1
- package/styles/rich-text-editor/icons/_material3-dark.scss +1 -0
- package/styles/rich-text-editor/icons/_material3.scss +1 -1
- package/styles/rich-text-editor/icons/_tailwind.scss +1 -1
- package/styles/rich-text-editor/material-dark.css +295 -129
- package/styles/rich-text-editor/material.css +300 -134
- package/styles/rich-text-editor/material3-dark.css +3082 -0
- package/styles/rich-text-editor/material3-dark.scss +5 -0
- package/styles/rich-text-editor/material3.css +3138 -0
- package/styles/rich-text-editor/material3.scss +5 -0
- package/styles/rich-text-editor/tailwind-dark.css +313 -157
- package/styles/rich-text-editor/tailwind.css +313 -157
- package/styles/tailwind-dark.css +313 -157
- package/styles/tailwind.css +313 -157
|
@@ -44,7 +44,7 @@ import { RendererFactory } from '../services/renderer-factory';
|
|
|
44
44
|
import { RenderType, ToolbarType, DialogType } from './enum';
|
|
45
45
|
import { ExecCommandCallBack } from '../actions/execute-command-callback';
|
|
46
46
|
import { KeyboardEvents } from '../actions/keyboard';
|
|
47
|
-
import { ToolbarSettings, ImageSettings, AudioSettings, VideoSettings, QuickToolbarSettings, FontFamily, FontSize, Format, NumberFormatList, BulletFormatList, FormatPainterSettings } from '../models/toolbar-settings';
|
|
47
|
+
import { ToolbarSettings, ImageSettings, AudioSettings, VideoSettings, QuickToolbarSettings, FontFamily, FontSize, Format, NumberFormatList, BulletFormatList, FormatPainterSettings, EmojiSettings } from '../models/toolbar-settings';
|
|
48
48
|
import { FileManagerSettings } from '../models/toolbar-settings';
|
|
49
49
|
import { TableSettings, PasteCleanupSettings } from '../models/toolbar-settings';
|
|
50
50
|
import { FontColor, BackgroundColor } from '../models/toolbar-settings';
|
|
@@ -122,6 +122,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
122
122
|
member: 'formatPainter',
|
|
123
123
|
args: [this]
|
|
124
124
|
});
|
|
125
|
+
modules.push({
|
|
126
|
+
member: 'emojiPicker',
|
|
127
|
+
args: [this, this.serviceLocator]
|
|
128
|
+
});
|
|
125
129
|
}
|
|
126
130
|
if (this.fileManagerSettings.enable) {
|
|
127
131
|
modules.push({ member: 'fileManager', args: [this, this.serviceLocator] });
|
|
@@ -321,6 +325,20 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
321
325
|
});
|
|
322
326
|
return str;
|
|
323
327
|
};
|
|
328
|
+
/**
|
|
329
|
+
* Shows the emoji picker
|
|
330
|
+
*
|
|
331
|
+
* @param {number} x - specifies the number value.
|
|
332
|
+
* @param {number} y - specifies the number value.
|
|
333
|
+
* @returns {void}
|
|
334
|
+
* @public
|
|
335
|
+
*/
|
|
336
|
+
RichTextEditor.prototype.showEmojiPicker = function (x, y) {
|
|
337
|
+
if (this.readonly) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
this.notify(events.emojiPicker, { x: x, y: y });
|
|
341
|
+
};
|
|
324
342
|
/**
|
|
325
343
|
* Executes the commands
|
|
326
344
|
*
|
|
@@ -556,7 +574,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
556
574
|
this.valueContainer.defaultValue = this.value;
|
|
557
575
|
}
|
|
558
576
|
// eslint-disable-next-line
|
|
559
|
-
(!this.
|
|
577
|
+
(this.enabled && !this.readonly) ? this.eventInitializer() : this.unWireEvents();
|
|
560
578
|
this.notify(events.bindCssClass, { cssClass: this.cssClass });
|
|
561
579
|
this.addAudioVideoWrapper();
|
|
562
580
|
this.notify(events.tableclass, {});
|
|
@@ -642,6 +660,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
642
660
|
var currentEndContainer = range.endContainer;
|
|
643
661
|
var currentStartOffset = range.startOffset;
|
|
644
662
|
var isSameContainer = currentStartContainer === currentEndContainer ? true : false;
|
|
663
|
+
// eslint-disable-next-line
|
|
645
664
|
var currentEndOffset = currentEndContainer.textContent.length;
|
|
646
665
|
var endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
|
|
647
666
|
range.endContainer;
|
|
@@ -724,7 +743,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
724
743
|
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), range.startContainer, range.startOffset);
|
|
725
744
|
}
|
|
726
745
|
}
|
|
727
|
-
|
|
746
|
+
var notFormatPainterCopy = !isNOU(e.action) && e.action !== 'format-copy';
|
|
747
|
+
if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy) {
|
|
728
748
|
this.formatter.saveData();
|
|
729
749
|
}
|
|
730
750
|
if (e.action !== 'insert-link' &&
|
|
@@ -756,8 +776,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
756
776
|
if ((!isNOU(this.placeHolderWrapper)) && (this.inputElement.textContent.length !== 1)) {
|
|
757
777
|
this.placeHolderWrapper.style.display = 'none';
|
|
758
778
|
}
|
|
759
|
-
else if (this.iframeSettings.enable && this.inputElement.classList.contains(
|
|
760
|
-
removeClass([this.inputElement],
|
|
779
|
+
else if (this.iframeSettings.enable && this.inputElement.classList.contains('e-rte-placeholder')) {
|
|
780
|
+
removeClass([this.inputElement], 'e-rte-placeholder');
|
|
761
781
|
}
|
|
762
782
|
else {
|
|
763
783
|
this.setPlaceHolder();
|
|
@@ -786,7 +806,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
786
806
|
this.inputElement.innerHTML = getEditValue(getDefaultValue(this), this);
|
|
787
807
|
}
|
|
788
808
|
var allowedKeys = e.which === 32 || e.which === 13 || e.which === 8 || e.which === 46;
|
|
789
|
-
|
|
809
|
+
var formatPainterCopy = e.key === 'C' && e.altKey && e.shiftKey;
|
|
810
|
+
var formatPainterPaste = e.key === 'V' && e.altKey && e.shiftKey;
|
|
811
|
+
if ((!formatPainterCopy && !formatPainterPaste) && ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
|
|
790
812
|
&& ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys)) && !this.inlineMode.enable) {
|
|
791
813
|
this.formatter.onKeyHandler(this, e);
|
|
792
814
|
}
|
|
@@ -1337,6 +1359,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1337
1359
|
newProp.quickToolbarSettings.showOnRightClick ? this.wireContextEvent() : this.unWireContextEvent();
|
|
1338
1360
|
this.notify(events.modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
1339
1361
|
break;
|
|
1362
|
+
case 'formatPainterSettings':
|
|
1363
|
+
this.formatter.editorManager.observer.notify(CONSTANT.MODEL_CHANGED, { module: 'formatPainter', newProp: newProp });
|
|
1364
|
+
break;
|
|
1340
1365
|
default:
|
|
1341
1366
|
this.notify(events.modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
1342
1367
|
break;
|
|
@@ -1466,11 +1491,11 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1466
1491
|
if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNOU(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
1467
1492
|
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNOU(this.inputElement.firstChild.firstChild) &&
|
|
1468
1493
|
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
1469
|
-
addClass([this.inputElement],
|
|
1494
|
+
addClass([this.inputElement], 'e-rte-placeholder');
|
|
1470
1495
|
this.inputElement.setAttribute('placeholder', this.placeholder);
|
|
1471
1496
|
}
|
|
1472
1497
|
else {
|
|
1473
|
-
removeClass([this.inputElement],
|
|
1498
|
+
removeClass([this.inputElement], 'e-rte-placeholder');
|
|
1474
1499
|
}
|
|
1475
1500
|
}
|
|
1476
1501
|
};
|
|
@@ -1700,7 +1725,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1700
1725
|
var _this = this;
|
|
1701
1726
|
if (this.valueTemplate) {
|
|
1702
1727
|
var regEx = new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);
|
|
1703
|
-
if (regEx.test(this.valueTemplate)) {
|
|
1728
|
+
if (typeof this.valueTemplate === 'string' && regEx.test(this.valueTemplate)) {
|
|
1704
1729
|
this.setProperties({ value: this.valueTemplate });
|
|
1705
1730
|
}
|
|
1706
1731
|
else {
|
|
@@ -2199,7 +2224,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2199
2224
|
this.timeInterval = null;
|
|
2200
2225
|
}
|
|
2201
2226
|
if (!isNOU(this.placeHolderWrapper) && this.element.querySelector('[title = Preview]')) {
|
|
2202
|
-
this.placeHolderWrapper.style.display =
|
|
2227
|
+
this.placeHolderWrapper.style.display = 'none';
|
|
2203
2228
|
}
|
|
2204
2229
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
2205
2230
|
}
|
|
@@ -2258,7 +2283,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2258
2283
|
EventHandler.add(element, 'scroll', this.scrollHandler, this);
|
|
2259
2284
|
}
|
|
2260
2285
|
if (!this.iframeSettings.enable) {
|
|
2261
|
-
|
|
2286
|
+
// Add the scroll event handler from the inputElement
|
|
2287
|
+
EventHandler.add(this.inputElement, 'scroll', this.contentScrollHandler, this);
|
|
2262
2288
|
}
|
|
2263
2289
|
};
|
|
2264
2290
|
RichTextEditor.prototype.wireContextEvent = function () {
|
|
@@ -2287,7 +2313,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2287
2313
|
EventHandler.remove(element, 'scroll', this.scrollHandler);
|
|
2288
2314
|
}
|
|
2289
2315
|
if (!this.iframeSettings.enable) {
|
|
2290
|
-
|
|
2316
|
+
// Remove the scroll event handler from the inputElement
|
|
2317
|
+
EventHandler.remove(this.inputElement, 'scroll', this.contentScrollHandler);
|
|
2291
2318
|
}
|
|
2292
2319
|
};
|
|
2293
2320
|
RichTextEditor.prototype.touchHandler = function (e) {
|
|
@@ -2470,6 +2497,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2470
2497
|
__decorate([
|
|
2471
2498
|
Complex({}, FormatPainterSettings)
|
|
2472
2499
|
], RichTextEditor.prototype, "formatPainterSettings", void 0);
|
|
2500
|
+
__decorate([
|
|
2501
|
+
Complex({}, EmojiSettings)
|
|
2502
|
+
], RichTextEditor.prototype, "emojiPickerSettings", void 0);
|
|
2473
2503
|
__decorate([
|
|
2474
2504
|
Complex({}, IFrameSettings)
|
|
2475
2505
|
], RichTextEditor.prototype, "iframeSettings", void 0);
|
|
@@ -152,7 +152,8 @@ export function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
152
152
|
var item = e.tbItems[j].subCommand;
|
|
153
153
|
var itemStr = item && item.toLocaleLowerCase();
|
|
154
154
|
if (item && (itemStr === key) || (item === 'UL' && key === 'unorderedlist') || (item === 'OL' && key === 'orderedlist') ||
|
|
155
|
-
(itemStr === 'pre' && key === 'insertcode')
|
|
155
|
+
(itemStr === 'pre' && key === 'insertcode') || (item === 'NumberFormatList' && key === 'numberFormatList' ||
|
|
156
|
+
item === 'BulletFormatList' && key === 'bulletFormatList')) {
|
|
156
157
|
if (typeof data["" + key] === 'boolean') {
|
|
157
158
|
if (data["" + key] === true) {
|
|
158
159
|
addClass([e.tbElements[j]], [classes.CLS_ACTIVE]);
|
|
@@ -204,7 +205,6 @@ export function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
204
205
|
var fontNameContent = isNOU(e.parent.fontFamily.default) ? fontNameItems[0].text :
|
|
205
206
|
e.parent.fontFamily.default;
|
|
206
207
|
var name_1 = (isNOU(result) ? fontNameContent : result);
|
|
207
|
-
e.tbElements[j].title = name_1;
|
|
208
208
|
dropDown.fontNameDropDown.content = ('<span style="display: inline-flex;' +
|
|
209
209
|
'width:' + e.parent.fontFamily.width + '" >' +
|
|
210
210
|
'<span class="e-rte-dropdown-btn-text' + (isNOU(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
|
|
@@ -45,6 +45,7 @@ var Formatter = /** @class */ (function () {
|
|
|
45
45
|
&& args.item.command !== 'Files'
|
|
46
46
|
&& args.item.command !== 'Audios'
|
|
47
47
|
&& args.item.command !== 'Videos'
|
|
48
|
+
&& args.item.command !== 'EmojiPicker'
|
|
48
49
|
&& range
|
|
49
50
|
&& !(self.contentModule.getEditPanel().contains(this.getAncestorNode(range.commonAncestorContainer))
|
|
50
51
|
|| self.contentModule.getEditPanel() === range.commonAncestorContainer
|
|
@@ -110,13 +111,14 @@ var Formatter = /** @class */ (function () {
|
|
|
110
111
|
&& args.item.command !== 'Font')
|
|
111
112
|
|| ((args.item.subCommand === 'FontName' || args.item.subCommand === 'FontSize') && args.name === 'dropDownSelect')
|
|
112
113
|
|| ((args.item.subCommand === 'BackgroundColor' || args.item.subCommand === 'FontColor')
|
|
113
|
-
&& args.name === 'colorPickerChanged') || args.item.subCommand === 'FormatPainter')) {
|
|
114
|
+
&& args.name === 'colorPickerChanged') || args.item.subCommand === 'FormatPainter' || args.item.subCommand === 'EmojiPicker')) {
|
|
114
115
|
extend(args, args, { requestType: args.item.subCommand, cancel: false, itemCollection: value, selectType: args.name }, true);
|
|
115
116
|
self.trigger(CONSTANT.actionBegin, args, function (actionBeginArgs) {
|
|
116
117
|
if (!actionBeginArgs.cancel) {
|
|
117
|
-
var
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
var formatPainterCopy = !isNOU(actionBeginArgs.requestType) && actionBeginArgs.requestType === 'FormatPainter' && actionBeginArgs.name === 'format-copy';
|
|
119
|
+
var formatPainterPaste = !isNOU(actionBeginArgs.requestType) && actionBeginArgs.requestType === 'FormatPainter' && actionBeginArgs.name === 'format-paste';
|
|
120
|
+
if ((_this.getUndoRedoStack().length === 0 && actionBeginArgs.item.command !== 'Links' && actionBeginArgs.item.command !== 'Images' && !formatPainterCopy)
|
|
121
|
+
|| formatPainterPaste) {
|
|
120
122
|
_this.saveData();
|
|
121
123
|
}
|
|
122
124
|
self.isBlur = false;
|
|
@@ -138,7 +140,7 @@ var Formatter = /** @class */ (function () {
|
|
|
138
140
|
}
|
|
139
141
|
});
|
|
140
142
|
}
|
|
141
|
-
if (isNOU(event) || event && event.action !== 'copy') {
|
|
143
|
+
if ((isNOU(event) || event && event.action !== 'copy')) {
|
|
142
144
|
this.enableUndo(self);
|
|
143
145
|
}
|
|
144
146
|
};
|
|
@@ -191,7 +191,13 @@ export var defaultLocale = {
|
|
|
191
191
|
'bulletFormatListSquare': 'Square',
|
|
192
192
|
'numberFormatListNone': 'None',
|
|
193
193
|
'bulletFormatListNone': 'None',
|
|
194
|
-
'formatPainter': 'Format Painter'
|
|
194
|
+
'formatPainter': 'Format Painter',
|
|
195
|
+
'emojiPicker': 'Emoji Picker',
|
|
196
|
+
'embeddedCode': 'Embedded Code',
|
|
197
|
+
'pasteEmbeddedCodeHere': 'Paste Embedded Code here',
|
|
198
|
+
'emojiPickerTypeToFind': 'Type to find',
|
|
199
|
+
'emojiPickerNoResultFound': 'No results found',
|
|
200
|
+
'emojiPickerTrySomethingElse': 'Try something else',
|
|
195
201
|
};
|
|
196
202
|
export var toolsLocale = {
|
|
197
203
|
'alignments': 'alignments',
|
|
@@ -279,7 +285,13 @@ export var toolsLocale = {
|
|
|
279
285
|
'insertrowbefore': 'insertRowBefore',
|
|
280
286
|
'insertrowafter': 'insertRowAfter',
|
|
281
287
|
'deleterow': 'deleteRow',
|
|
282
|
-
'formatpainter': 'formatPainter'
|
|
288
|
+
'formatpainter': 'formatPainter',
|
|
289
|
+
'emojipicker': 'emojiPicker',
|
|
290
|
+
'embeddedCode': 'Embedded Code',
|
|
291
|
+
'pasteEmbeddedCodeHere': 'Paste Embedded Code here',
|
|
292
|
+
'emojiPickerTypeToFind': 'Type to find',
|
|
293
|
+
'emojiPickerNoResultFound': 'No results found',
|
|
294
|
+
'emojiPickerTrySomethingElse': 'Try something else',
|
|
283
295
|
};
|
|
284
296
|
export var fontNameLocale = [
|
|
285
297
|
{ locale: 'fontNameSegoeUI', value: 'Segoe UI' },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Export items model
|
|
3
3
|
*/
|
|
4
|
-
import { IToolsItems, IDropDownItemModel, IRichTextEditor, IListDropDownModel } from '../base/interface';
|
|
4
|
+
import { IToolsItems, IDropDownItemModel, IRichTextEditor, IListDropDownModel, EmojiIconsSet } from '../base/interface';
|
|
5
5
|
export declare let templateItems: string[];
|
|
6
6
|
export declare let tools: {
|
|
7
7
|
[key: string]: IToolsItems;
|
|
@@ -33,3 +33,4 @@ export declare function updateDropDownLocale(self: IRichTextEditor): void;
|
|
|
33
33
|
export declare let windowKeys: {
|
|
34
34
|
[key: string]: string;
|
|
35
35
|
};
|
|
36
|
+
export declare const defaultEmojiIcons: EmojiIconsSet[];
|
|
@@ -558,6 +558,13 @@ export var tools = {
|
|
|
558
558
|
'tooltip': 'Format Painter',
|
|
559
559
|
'command': 'FormatPainter',
|
|
560
560
|
'subCommand': 'FormatPainter'
|
|
561
|
+
},
|
|
562
|
+
'emojipicker': {
|
|
563
|
+
'id': 'EmojiPicker',
|
|
564
|
+
'icon': 'e-emoji',
|
|
565
|
+
'tooltip': 'Emoji Icon',
|
|
566
|
+
'command': 'EmojiPicker',
|
|
567
|
+
'subCommand': 'EmojiPicker'
|
|
561
568
|
}
|
|
562
569
|
};
|
|
563
570
|
var alignmentLocale = [
|
|
@@ -770,5 +777,185 @@ export var windowKeys = {
|
|
|
770
777
|
'Clear Format': 'Ctrl + Shift + R',
|
|
771
778
|
'Numbered List': 'Ctrl + Shift + O',
|
|
772
779
|
'Bulleted List': 'Ctrl + Alt + O',
|
|
773
|
-
'Format Painter': '
|
|
780
|
+
'Format Painter': 'Alt + Shift + C, Alt + Shift + V'
|
|
774
781
|
};
|
|
782
|
+
export var defaultEmojiIcons = [{
|
|
783
|
+
name: 'Smilies & People', code: '1F600', iconCss: 'e-emoji', icons: [{ code: '1F600', desc: 'Grinning face' },
|
|
784
|
+
{ code: '1F603', desc: 'Grinning face with big eyes' },
|
|
785
|
+
{ code: '1F604', desc: 'Grinning face with smiling eyes' },
|
|
786
|
+
{ code: '1F606', desc: 'Grinning squinting face' },
|
|
787
|
+
{ code: '1F605', desc: 'Grinning face with sweat' },
|
|
788
|
+
{ code: '1F602', desc: 'Face with tears of joy' },
|
|
789
|
+
{ code: '1F923', desc: 'Rolling on the floor laughing' },
|
|
790
|
+
{ code: '1F60A', desc: 'Smiling face with smiling eyes' },
|
|
791
|
+
{ code: '1F607', desc: 'Smiling face with halo' },
|
|
792
|
+
{ code: '1F642', desc: 'Slightly smiling face' },
|
|
793
|
+
{ code: '1F643', desc: 'Upside-down face' },
|
|
794
|
+
{ code: '1F60D', desc: 'Smiling face with heart-eyes' },
|
|
795
|
+
{ code: '1F618', desc: 'Face blowing a kiss' },
|
|
796
|
+
{ code: '1F61B', desc: 'Face with tongue' },
|
|
797
|
+
{ code: '1F61C', desc: 'Winking face with tongue' },
|
|
798
|
+
{ code: '1F604', desc: 'Grinning face with smiling eyes' },
|
|
799
|
+
{ code: '1F469', desc: 'Woman' },
|
|
800
|
+
{ code: '1F468', desc: 'Man' },
|
|
801
|
+
{ code: '1F467', desc: 'Girl' },
|
|
802
|
+
{ code: '1F466', desc: 'Boy' },
|
|
803
|
+
{ code: '1F476', desc: 'Baby' },
|
|
804
|
+
{ code: '1F475', desc: 'Old woman' },
|
|
805
|
+
{ code: '1F474', desc: 'Old man' },
|
|
806
|
+
{ code: '1F46E', desc: 'Police officer' },
|
|
807
|
+
{ code: '1F477', desc: 'Construction worker' },
|
|
808
|
+
{ code: '1F482', desc: 'Guard' },
|
|
809
|
+
{ code: '1F575', desc: 'Detective' },
|
|
810
|
+
{ code: '1F9D1', desc: 'Cook' }]
|
|
811
|
+
}, {
|
|
812
|
+
name: 'Animals & Nature', code: '1F435', iconCss: 'e-animals', icons: [{ code: '1F436', desc: 'Dog face' },
|
|
813
|
+
{ code: '1F431', desc: 'Cat face' },
|
|
814
|
+
{ code: '1F42D', desc: 'Mouse face' },
|
|
815
|
+
{ code: '1F439', desc: 'Hamster face' },
|
|
816
|
+
{ code: '1F430', desc: 'Rabbit face' },
|
|
817
|
+
{ code: '1F98A', desc: 'Fox face' },
|
|
818
|
+
{ code: '1F43B', desc: 'Bear face' },
|
|
819
|
+
{ code: '1F43C', desc: 'Panda face' },
|
|
820
|
+
{ code: '1F428', desc: 'Koala' },
|
|
821
|
+
{ code: '1F42F', desc: 'Tiger face' },
|
|
822
|
+
{ code: '1F981', desc: 'Lion face' },
|
|
823
|
+
{ code: '1F42E', desc: 'Cow face' },
|
|
824
|
+
{ code: '1F437', desc: 'Pig face' },
|
|
825
|
+
{ code: '1F43D', desc: 'Pig nose' },
|
|
826
|
+
{ code: '1F438', desc: 'Frog face' },
|
|
827
|
+
{ code: '1F435', desc: 'Monkey face' },
|
|
828
|
+
{ code: '1F649', desc: 'Hear-no-evil monkey' },
|
|
829
|
+
{ code: '1F64A', desc: 'Speak-no-evil monkey' },
|
|
830
|
+
{ code: '1F412', desc: 'Monkey' },
|
|
831
|
+
{ code: '1F414', desc: 'Chicken' },
|
|
832
|
+
{ code: '1F427', desc: 'Penguin' },
|
|
833
|
+
{ code: '1F426', desc: 'Bird' },
|
|
834
|
+
{ code: '1F424', desc: 'Baby chick' },
|
|
835
|
+
{ code: '1F986', desc: 'Duck' },
|
|
836
|
+
{ code: '1F985', desc: 'Eagle' }]
|
|
837
|
+
}, {
|
|
838
|
+
name: 'Food & Drink', code: '1F347', iconCss: 'e-food-and-drinks', icons: [{ code: '1F34E', desc: 'Red apple' },
|
|
839
|
+
{ code: '1F34C', desc: 'Banana' },
|
|
840
|
+
{ code: '1F347', desc: 'Grapes' },
|
|
841
|
+
{ code: '1F353', desc: 'Strawberry' },
|
|
842
|
+
{ code: '1F35E', desc: 'Bread' },
|
|
843
|
+
{ code: '1F950', desc: 'Croissant' },
|
|
844
|
+
{ code: '1F955', desc: 'Carrot' },
|
|
845
|
+
{ code: '1F354', desc: 'Hamburger' },
|
|
846
|
+
{ code: '1F355', desc: 'Pizza' },
|
|
847
|
+
{ code: '1F32D', desc: 'Hot dog' },
|
|
848
|
+
{ code: '1F35F', desc: 'French fries' },
|
|
849
|
+
{ code: '1F37F', desc: 'Popcorn' },
|
|
850
|
+
{ code: '1F366', desc: 'Soft ice cream' },
|
|
851
|
+
{ code: '1F367', desc: 'Shaved ice' },
|
|
852
|
+
{ code: '1F36A', desc: 'Cookie' },
|
|
853
|
+
{ code: '1F382', desc: 'Birthday cake' },
|
|
854
|
+
{ code: '1F370', desc: 'Shortcake' },
|
|
855
|
+
{ code: '1F36B', desc: 'Chocolate bar' },
|
|
856
|
+
{ code: '1F369', desc: 'Donut' },
|
|
857
|
+
{ code: '1F36E', desc: 'Custard' },
|
|
858
|
+
{ code: '1F36D', desc: 'Lollipop' },
|
|
859
|
+
{ code: '1F36C', desc: 'Candy' },
|
|
860
|
+
{ code: '1F377', desc: 'Wine glass' },
|
|
861
|
+
{ code: '1F37A', desc: 'Beer mug' },
|
|
862
|
+
{ code: '1F37E', desc: 'Bottle with popping cork' }]
|
|
863
|
+
}, {
|
|
864
|
+
name: 'Activities', code: '1F383', iconCss: 'e-activities', icons: [{ code: '26BD', desc: 'Soccer ball' },
|
|
865
|
+
{ code: '1F3C0', desc: 'Basketball' },
|
|
866
|
+
{ code: '1F3C8', desc: 'American football' },
|
|
867
|
+
{ code: '26BE', desc: 'Baseball' },
|
|
868
|
+
{ code: '1F3BE', desc: 'Tennis' },
|
|
869
|
+
{ code: '1F3D0', desc: 'Volleyball' },
|
|
870
|
+
{ code: '1F3C9', desc: 'Rugby football' },
|
|
871
|
+
{ code: '1F3B1', desc: 'Pool 8 ball' },
|
|
872
|
+
{ code: '1F3D3', desc: 'Ping pong' },
|
|
873
|
+
{ code: '1F3F8', desc: 'Badminton' },
|
|
874
|
+
{ code: '1F94A', desc: 'Boxing glove' },
|
|
875
|
+
{ code: '1F3CA', desc: 'Swimmer' },
|
|
876
|
+
{ code: '1F3CB', desc: 'Weightlifter' },
|
|
877
|
+
{ code: '1F6B4', desc: 'Bicyclist' },
|
|
878
|
+
{ code: '1F6F9', desc: 'Skateboard' },
|
|
879
|
+
{ code: '1F3AE', desc: 'Video game' },
|
|
880
|
+
{ code: '1F579', desc: 'Joystick' },
|
|
881
|
+
{ code: '1F3CF', desc: 'Cricket' },
|
|
882
|
+
{ code: '1F3C7', desc: 'Horse racing' },
|
|
883
|
+
{ code: '1F3AF', desc: 'Direct hit' },
|
|
884
|
+
{ code: '1F3D1', desc: 'Field hockey' },
|
|
885
|
+
{ code: '1F3B0', desc: 'Slot machine' },
|
|
886
|
+
{ code: '1F3B3', desc: 'Bowling' },
|
|
887
|
+
{ code: '1F3B2', desc: 'Game die' },
|
|
888
|
+
{ code: '265F', desc: 'Chess pawn' }]
|
|
889
|
+
}, {
|
|
890
|
+
name: 'Travel & Places', code: '1F30D', iconCss: 'e-travel-and-places', icons: [{ code: '2708', desc: 'Airplane' },
|
|
891
|
+
{ code: '1F697', desc: 'Automobile' },
|
|
892
|
+
{ code: '1F695', desc: 'Taxi' },
|
|
893
|
+
{ code: '1F6B2', desc: 'Bicycle' },
|
|
894
|
+
{ code: '1F68C', desc: 'Bus' },
|
|
895
|
+
{ code: '1F682', desc: 'Locomotive' },
|
|
896
|
+
{ code: '1F6F3', desc: 'Passenger ship' },
|
|
897
|
+
{ code: '1F680', desc: 'Rocket' },
|
|
898
|
+
{ code: '1F681', desc: 'Helicopter' },
|
|
899
|
+
{ code: '1F6A2', desc: 'Ship' },
|
|
900
|
+
{ code: '1F3DF', desc: 'Stadium' },
|
|
901
|
+
{ code: '1F54C', desc: 'Mosque' },
|
|
902
|
+
{ code: '26EA', desc: 'Church' },
|
|
903
|
+
{ code: '1F6D5', desc: 'Hindu Temple' },
|
|
904
|
+
{ code: '1F3D4', desc: 'Snow-capped mountain' },
|
|
905
|
+
{ code: '1F3EB', desc: 'School' },
|
|
906
|
+
{ code: '1F30B', desc: 'Volcano' },
|
|
907
|
+
{ code: '1F3D6', desc: 'Beach with umbrella' },
|
|
908
|
+
{ code: '1F3DD', desc: 'Desert island' },
|
|
909
|
+
{ code: '1F3DE', desc: 'National park' },
|
|
910
|
+
{ code: '1F3F0', desc: 'Castle' },
|
|
911
|
+
{ code: '1F5FC', desc: 'Tokyo tower' },
|
|
912
|
+
{ code: '1F5FD', desc: 'Statue of liberty' },
|
|
913
|
+
{ code: '26E9', desc: 'Shinto shrine' },
|
|
914
|
+
{ code: '1F3EF', desc: 'Japanese castle' },
|
|
915
|
+
{ code: '1F3A2', desc: 'Roller coaster' }]
|
|
916
|
+
}, {
|
|
917
|
+
name: 'Objects', code: '1F507', iconCss: 'e-objects', icons: [{ code: '1F4A1', desc: 'Light bulb' },
|
|
918
|
+
{ code: '1F526', desc: 'Flashlight' },
|
|
919
|
+
{ code: '1F4BB', desc: 'Laptop computer' },
|
|
920
|
+
{ code: '1F5A5', desc: 'Desktop computer' },
|
|
921
|
+
{ code: '1F5A8', desc: 'Printer' },
|
|
922
|
+
{ code: '1F4F7', desc: 'Camera' },
|
|
923
|
+
{ code: '1F4F8', desc: 'Camera with flash' },
|
|
924
|
+
{ code: '1F4FD', desc: 'Film projector' },
|
|
925
|
+
{ code: '1F3A5', desc: 'Movie camera' },
|
|
926
|
+
{ code: '1F4FA', desc: 'Television' },
|
|
927
|
+
{ code: '1F4FB', desc: 'Radio' },
|
|
928
|
+
{ code: '1F50B', desc: 'Battery' },
|
|
929
|
+
{ code: '231A', desc: 'Watch' },
|
|
930
|
+
{ code: '1F4F1', desc: 'Mobile phone' },
|
|
931
|
+
{ code: '260E', desc: 'Telephone' },
|
|
932
|
+
{ code: '1F4BE', desc: 'Floppy disk' },
|
|
933
|
+
{ code: '1F4BF', desc: 'Optical disk' },
|
|
934
|
+
{ code: '1F4C0', desc: 'Digital versatile disc' },
|
|
935
|
+
{ code: '1F4BD', desc: 'Computer disk' },
|
|
936
|
+
{ code: '1F3A7', desc: 'Headphone' },
|
|
937
|
+
{ code: '1F3A4', desc: 'Microphone' },
|
|
938
|
+
{ code: '1F3B6', desc: 'Multiple musical notes' },
|
|
939
|
+
{ code: '1F4DA', desc: 'Books' }]
|
|
940
|
+
}, {
|
|
941
|
+
name: 'Symbols', code: '1F3E7', iconCss: 'e-symbols', icons: [{ code: '274C', desc: 'Cross mark' },
|
|
942
|
+
{ code: '2714', desc: 'Check mark' },
|
|
943
|
+
{ code: '26A0', desc: 'Warning sign' },
|
|
944
|
+
{ code: '1F6AB', desc: 'Prohibited' },
|
|
945
|
+
{ code: '2139', desc: 'Information' },
|
|
946
|
+
{ code: '267B', desc: 'Recycling symbol' },
|
|
947
|
+
{ code: '1F6AD', desc: 'No smoking' },
|
|
948
|
+
{ code: '1F4F5', desc: 'No mobile phones' },
|
|
949
|
+
{ code: '1F6AF', desc: 'No littering' },
|
|
950
|
+
{ code: '1F6B3', desc: 'No bicycles' },
|
|
951
|
+
{ code: '1F6B7', desc: 'No pedestrians' },
|
|
952
|
+
{ code: '2795', desc: 'Plus' },
|
|
953
|
+
{ code: '2796', desc: 'Minus' },
|
|
954
|
+
{ code: '2797', desc: 'Divide' },
|
|
955
|
+
{ code: '2716', desc: 'Multiplication' },
|
|
956
|
+
{ code: '1F4B2', desc: 'Dollar banknote' },
|
|
957
|
+
{ code: '1F4AC', desc: 'Speech balloon' },
|
|
958
|
+
{ code: '2755', desc: 'White exclamation mark' },
|
|
959
|
+
{ code: '2754', desc: 'White question mark' },
|
|
960
|
+
{ code: '2764', desc: 'Red heart' }]
|
|
961
|
+
}];
|