@syncfusion/ej2-image-editor 22.2.9 → 22.2.11

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.
@@ -5459,6 +5459,9 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
5459
5459
  if (e.type === 'mouseup') {
5460
5460
  this.processPoint(e.clientX - rect.left, e.clientY - rect.top, true, context);
5461
5461
  }
5462
+ else if (e.type === 'touchend' && e.changedTouches) {
5463
+ this.processPoint(e.changedTouches[0].clientX - rect.left, e.changedTouches[0].clientY - rect.top, true, context);
5464
+ }
5462
5465
  else {
5463
5466
  if (!this.isFreehandPointMoved) {
5464
5467
  this.processPoint(this.freehandDownPoint.x - rect.left, this.freehandDownPoint.y - rect.top, true, context);
@@ -9385,8 +9388,10 @@ var Selection = /** @__PURE__ @class */ (function () {
9385
9388
  isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
9386
9389
  }
9387
9390
  else if (parent.activeObj.shape === 'text') {
9388
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
9389
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
9391
+ if (parent.textArea.style.display === 'none') {
9392
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
9393
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
9394
+ }
9390
9395
  }
9391
9396
  else if (this.isFhdEditing) {
9392
9397
  parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
@@ -9403,7 +9408,7 @@ var Selection = /** @__PURE__ @class */ (function () {
9403
9408
  || (parent.activeObj.shape === 'line' || parent.activeObj.shape === 'arrow' || parent.activeObj.shape === 'path')) {
9404
9409
  parent.updateToolbar(parent.element, parent.activeObj.shape);
9405
9410
  }
9406
- else if (parent.activeObj.shape === 'text') {
9411
+ else if (parent.activeObj.shape === 'text' && parent.textArea.style.display === 'none') {
9407
9412
  parent.updateToolbar(parent.element, 'text');
9408
9413
  }
9409
9414
  }
@@ -9730,12 +9735,12 @@ var Selection = /** @__PURE__ @class */ (function () {
9730
9735
  }
9731
9736
  if (obj.keyHistory !== this.tempActiveObj.keyHistory ||
9732
9737
  (strokeColor && (strokeColor !== this.tempActiveObj.strokeSettings.strokeColor)) ||
9733
- obj.textSettings.fontFamily !== this.tempActiveObj.textSettings.fontFamily ||
9734
- Math.round(obj.textSettings.fontSize) !== Math.round(this.tempActiveObj.textSettings.fontSize) ||
9735
- Math.round(obj.textSettings.fontRatio) !== Math.round(this.tempActiveObj.textSettings.fontRatio) ||
9736
- obj.textSettings.bold !== this.tempActiveObj.textSettings.bold ||
9737
- obj.textSettings.italic !== this.tempActiveObj.textSettings.italic ||
9738
- obj.textSettings.underline !== this.tempActiveObj.textSettings.underline) {
9738
+ (obj.textSettings && obj.textSettings.fontFamily !== this.tempActiveObj.textSettings.fontFamily) ||
9739
+ (obj.textSettings && Math.round(obj.textSettings.fontSize) !== Math.round(this.tempActiveObj.textSettings.fontSize)) ||
9740
+ (obj.textSettings && Math.round(obj.textSettings.fontRatio) !== Math.round(this.tempActiveObj.textSettings.fontRatio)) ||
9741
+ (obj.textSettings && obj.textSettings.bold !== this.tempActiveObj.textSettings.bold) ||
9742
+ (obj.textSettings && obj.textSettings.italic !== this.tempActiveObj.textSettings.italic) ||
9743
+ (obj.textSettings && obj.textSettings.underline !== this.tempActiveObj.textSettings.underline)) {
9739
9744
  isApply = true;
9740
9745
  }
9741
9746
  if (this.isInitialTextEdited && !isApply) {
@@ -10483,6 +10488,9 @@ var Selection = /** @__PURE__ @class */ (function () {
10483
10488
  isInside = true;
10484
10489
  }
10485
10490
  }
10491
+ else if (parent.textArea.style.display === 'block') {
10492
+ isInside = true;
10493
+ }
10486
10494
  if (!isInside) {
10487
10495
  if (isNullOrUndefined(parent.activeObj.currIndex)) {
10488
10496
  parent.activeObj.currIndex = 'shape_' + (parent.objColl.length + 1);
@@ -19432,26 +19440,36 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
19432
19440
  ToolbarModule.prototype.renderAnnotationBtn = function (isContextualToolbar) {
19433
19441
  var _this = this;
19434
19442
  var parent = this.parent;
19443
+ var isCustomized = false;
19435
19444
  var items = [];
19436
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Pen') > -1)) {
19445
+ var defItems = ['Ellipse', 'Arrow', 'Line', 'Rectangle', 'Pen', 'Path', 'Text'];
19446
+ if (parent.toolbar) {
19447
+ for (var i = 0; i < defItems.length; i++) {
19448
+ if (parent.toolbar.indexOf(defItems[i]) !== -1) {
19449
+ isCustomized = true;
19450
+ break;
19451
+ }
19452
+ }
19453
+ }
19454
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Pen') > -1)) {
19437
19455
  items.push({ text: this.l10n.getConstant('Pen'), id: 'pen', iconCss: 'e-icons e-free-pen' });
19438
19456
  }
19439
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Line') > -1)) {
19457
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Line') > -1)) {
19440
19458
  items.push({ text: this.l10n.getConstant('Line'), id: 'line', iconCss: 'e-icons e-line' });
19441
19459
  }
19442
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Rectangle') > -1)) {
19460
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Rectangle') > -1)) {
19443
19461
  items.push({ text: this.l10n.getConstant('Rectangle'), id: 'rectangle', iconCss: 'e-icons e-rectangle' });
19444
19462
  }
19445
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Ellipse') > -1)) {
19463
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Ellipse') > -1)) {
19446
19464
  items.push({ text: this.l10n.getConstant('Ellipse'), id: 'ellipse', iconCss: 'e-icons e-circle' });
19447
19465
  }
19448
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Arrow') > -1)) {
19466
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Arrow') > -1)) {
19449
19467
  items.push({ text: this.l10n.getConstant('Arrow'), id: 'arrow', iconCss: 'e-icons e-arrow-right-up' });
19450
19468
  }
19451
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Path') > -1)) {
19469
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Path') > -1)) {
19452
19470
  items.push({ text: this.l10n.getConstant('Path'), id: 'path', iconCss: 'e-icons e-critical-path' });
19453
19471
  }
19454
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Text') > -1)) {
19472
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Text') > -1)) {
19455
19473
  items.push({ text: this.l10n.getConstant('Text'), id: 'text', iconCss: 'e-icons e-add-text' });
19456
19474
  }
19457
19475
  var obj = { freehandDrawSelectedId: null };
@@ -19556,16 +19574,26 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
19556
19574
  var _this = this;
19557
19575
  var parent = this.parent;
19558
19576
  var items = [];
19559
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('CustomSelection') > -1)) {
19577
+ var isCustomized = false;
19578
+ var defItems = ['CustomSelection', 'CircleSelection', 'SquareSelection', 'RatioSelection'];
19579
+ if (parent.toolbar) {
19580
+ for (var i = 0; i < defItems.length; i++) {
19581
+ if (parent.toolbar.indexOf(defItems[i]) !== -1) {
19582
+ isCustomized = true;
19583
+ break;
19584
+ }
19585
+ }
19586
+ }
19587
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('CustomSelection') > -1)) {
19560
19588
  items.push({ text: this.l10n.getConstant('Custom'), id: 'custom', iconCss: 'e-icons e-custom' });
19561
19589
  }
19562
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('CircleSelection') > -1)) {
19590
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('CircleSelection') > -1)) {
19563
19591
  items.push({ text: this.l10n.getConstant('Circle'), id: 'circle', iconCss: 'e-icons e-circle' });
19564
19592
  }
19565
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('SquareSelection') > -1)) {
19593
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('SquareSelection') > -1)) {
19566
19594
  items.push({ text: this.l10n.getConstant('Square'), id: 'square', iconCss: 'e-icons e-square' });
19567
19595
  }
19568
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('RatioSelection') > -1)) {
19596
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('RatioSelection') > -1)) {
19569
19597
  items.push({ text: '3:2', id: '3:2', iconCss: 'e-icons e-custom-a' });
19570
19598
  items.push({ text: '4:3', id: '4:3', iconCss: 'e-icons e-custom-b' });
19571
19599
  items.push({ text: '5:4', id: '5:4', iconCss: 'e-icons e-custom-c' });
@@ -19583,8 +19611,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
19583
19611
  shape = parent.currSelectionPoint.shape;
19584
19612
  }
19585
19613
  else {
19586
- iconCss = 'e-custom';
19587
- shape = 'custom';
19614
+ iconCss = items[0].iconCss;
19615
+ shape = items[0].id;
19588
19616
  }
19589
19617
  var drpDownBtn = new DropDownButton({
19590
19618
  open: function (args) {
@@ -19666,15 +19694,29 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
19666
19694
  template: '<button id="' + parent.element.id + '_cropBtn"></button>'
19667
19695
  });
19668
19696
  toolbarItems.push({ align: 'Center', type: 'Separator' });
19669
- toolbarItems.push({ id: parent.element.id + '_rotateLeft', prefixIcon: 'e-icons e-anti-clock-wise',
19670
- tooltipText: this.l10n.getConstant('RotateLeft'), align: 'Center' });
19671
- toolbarItems.push({ id: parent.element.id + '_rotateRight', prefixIcon: 'e-icons e-clock-wise',
19672
- tooltipText: this.l10n.getConstant('RotateRight'), align: 'Center' });
19673
- toolbarItems.push({ align: 'Center', type: 'Separator' });
19674
- toolbarItems.push({ id: parent.element.id + '_horizontalFlip', prefixIcon: 'e-icons e-horizontal-flip',
19675
- tooltipText: this.l10n.getConstant('HorizontalFlip'), align: 'Center' });
19676
- toolbarItems.push({ id: parent.element.id + '_verticalFlip', prefixIcon: 'e-icons e-vertical-flip',
19677
- tooltipText: this.l10n.getConstant('VerticalFlip'), align: 'Center' });
19697
+ if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
19698
+ parent.toolbar.indexOf('RotateLeft') > -1))) {
19699
+ toolbarItems.push({ id: parent.element.id + '_rotateLeft', prefixIcon: 'e-icons e-anti-clock-wise',
19700
+ tooltipText: this.l10n.getConstant('RotateLeft'), align: 'Center' });
19701
+ }
19702
+ if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
19703
+ parent.toolbar.indexOf('RotateRight') > -1))) {
19704
+ toolbarItems.push({ id: parent.element.id + '_rotateRight', prefixIcon: 'e-icons e-clock-wise',
19705
+ tooltipText: this.l10n.getConstant('RotateRight'), align: 'Center' });
19706
+ }
19707
+ if (toolbarItems.length > 2) {
19708
+ toolbarItems.push({ align: 'Center', type: 'Separator' });
19709
+ }
19710
+ if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
19711
+ parent.toolbar.indexOf('HorizontalFlip') > -1))) {
19712
+ toolbarItems.push({ id: parent.element.id + '_horizontalFlip', prefixIcon: 'e-icons e-horizontal-flip',
19713
+ tooltipText: this.l10n.getConstant('HorizontalFlip'), align: 'Center' });
19714
+ }
19715
+ if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
19716
+ parent.toolbar.indexOf('VerticalFlip') > -1))) {
19717
+ toolbarItems.push({ id: parent.element.id + '_verticalFlip', prefixIcon: 'e-icons e-vertical-flip',
19718
+ tooltipText: this.l10n.getConstant('VerticalFlip'), align: 'Center' });
19719
+ }
19678
19720
  if (!Browser.isDevice) {
19679
19721
  toolbarItems.push({ id: parent.element.id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
19680
19722
  tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
@@ -19780,7 +19822,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
19780
19822
  toolbar.refreshOverflow();
19781
19823
  }
19782
19824
  }
19783
- parent.select('custom');
19825
+ if (document.getElementById(parent.element.id + '_cropBtn')) {
19826
+ parent.select(document.getElementById(parent.element.id + '_cropBtn').textContent.toLowerCase());
19827
+ }
19784
19828
  }
19785
19829
  });
19786
19830
  if (Browser.isDevice) {
@@ -20414,31 +20458,41 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
20414
20458
  ToolbarModule.prototype.getAdjustmentToolbarItem = function () {
20415
20459
  var toolbarItems = [];
20416
20460
  var parent = this.parent;
20417
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Brightness') > -1)) {
20461
+ var isCustomized = false;
20462
+ var defItems = ['Brightness', 'Contrast', 'Hue', 'Saturation', 'Exposure', 'Opacity', 'Blur'];
20463
+ if (parent.toolbar) {
20464
+ for (var i = 0; i < defItems.length; i++) {
20465
+ if (parent.toolbar.indexOf(defItems[i]) !== -1) {
20466
+ isCustomized = true;
20467
+ break;
20468
+ }
20469
+ }
20470
+ }
20471
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Brightness') > -1)) {
20418
20472
  toolbarItems.push({ id: parent.element.id + '_brightness', prefixIcon: 'e-icons e-brightness', cssClass: 'top-icon e-brightness',
20419
20473
  tooltipText: this.l10n.getConstant('Brightness'), align: 'Center' });
20420
20474
  }
20421
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Contrast') > -1)) {
20475
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Contrast') > -1)) {
20422
20476
  toolbarItems.push({ id: parent.element.id + '_contrast', prefixIcon: 'e-icons e-contrast', cssClass: 'top-icon e-contrast',
20423
20477
  tooltipText: this.l10n.getConstant('Contrast'), align: 'Center' });
20424
20478
  }
20425
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Hue') > -1)) {
20479
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Hue') > -1)) {
20426
20480
  toolbarItems.push({ id: parent.element.id + '_hue', prefixIcon: 'e-icons e-fade', cssClass: 'top-icon e-fade',
20427
20481
  tooltipText: this.l10n.getConstant('Hue'), align: 'Center' });
20428
20482
  }
20429
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Saturation') > -1)) {
20483
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Saturation') > -1)) {
20430
20484
  toolbarItems.push({ id: parent.element.id + '_saturation', prefixIcon: 'e-icons e-saturation', cssClass: 'top-icon e-saturation',
20431
20485
  tooltipText: this.l10n.getConstant('Saturation'), align: 'Center' });
20432
20486
  }
20433
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Exposure') > -1)) {
20487
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Exposure') > -1)) {
20434
20488
  toolbarItems.push({ id: parent.element.id + '_exposure', prefixIcon: 'e-icons e-grain', cssClass: 'top-icon e-grain',
20435
20489
  tooltipText: this.l10n.getConstant('Exposure'), align: 'Center' });
20436
20490
  }
20437
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Opacity') > -1)) {
20491
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Opacity') > -1)) {
20438
20492
  toolbarItems.push({ id: parent.element.id + '_opacity', prefixIcon: 'e-icons e-opacity', cssClass: 'top-icon e-opacity',
20439
20493
  tooltipText: this.l10n.getConstant('Opacity'), align: 'Center' });
20440
20494
  }
20441
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Blur') > -1)) {
20495
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Blur') > -1)) {
20442
20496
  toolbarItems.push({ id: parent.element.id + '_blur', prefixIcon: 'e-icons e-tint', cssClass: 'top-icon e-tint',
20443
20497
  tooltipText: this.l10n.getConstant('Blur'), align: 'Center' });
20444
20498
  }
@@ -20457,37 +20511,47 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
20457
20511
  ToolbarModule.prototype.getFilterToolbarItem = function () {
20458
20512
  var toolbarItems = [];
20459
20513
  var parent = this.parent;
20460
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Default') > -1)) {
20514
+ var isCustomized = false;
20515
+ var defItems = ['Default', 'Chrome', 'Cold', 'Warm', 'Grayscale', 'Sepia', 'Invert'];
20516
+ if (parent.toolbar) {
20517
+ for (var i = 0; i < defItems.length; i++) {
20518
+ if (parent.toolbar.indexOf(defItems[i]) !== -1) {
20519
+ isCustomized = true;
20520
+ break;
20521
+ }
20522
+ }
20523
+ }
20524
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Default') > -1)) {
20461
20525
  toolbarItems.push({ id: parent.element.id + '_default', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20462
20526
  tooltipText: this.l10n.getConstant('Default'), align: 'Center',
20463
20527
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_defaultCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Default') + '</span></div></div>' });
20464
20528
  }
20465
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
20529
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
20466
20530
  toolbarItems.push({ id: parent.element.id + '_chrome', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20467
20531
  tooltipText: this.l10n.getConstant('Chrome'), align: 'Center',
20468
20532
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_chromeCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Chrome') + '</span></div></div>' });
20469
20533
  }
20470
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Cold') > -1)) {
20534
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Cold') > -1)) {
20471
20535
  toolbarItems.push({ id: parent.element.id + '_cold', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20472
20536
  tooltipText: this.l10n.getConstant('Cold'), align: 'Center',
20473
20537
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_coldCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Cold') + '</span></div></div>' });
20474
20538
  }
20475
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Warm') > -1)) {
20539
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Warm') > -1)) {
20476
20540
  toolbarItems.push({ id: parent.element.id + '_warm', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20477
20541
  tooltipText: this.l10n.getConstant('Warm'), align: 'Center',
20478
20542
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_warmCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Warm') + '</span></div></div>' });
20479
20543
  }
20480
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Grayscale') > -1)) {
20544
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Grayscale') > -1)) {
20481
20545
  toolbarItems.push({ id: parent.element.id + '_grayscale', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20482
20546
  tooltipText: this.l10n.getConstant('Grayscale'), align: 'Center',
20483
20547
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_grayscaleCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Grayscale') + '</span></div></div>' });
20484
20548
  }
20485
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Sepia') > -1)) {
20549
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Sepia') > -1)) {
20486
20550
  toolbarItems.push({ id: parent.element.id + '_sepia', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20487
20551
  tooltipText: this.l10n.getConstant('Sepia'), align: 'Center',
20488
20552
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_sepiaCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Sepia') + '</span></div></div>' });
20489
20553
  }
20490
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Invert') > -1)) {
20554
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Invert') > -1)) {
20491
20555
  toolbarItems.push({ id: parent.element.id + '_invert', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20492
20556
  tooltipText: this.l10n.getConstant('Invert'), align: 'Center',
20493
20557
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_invertCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Invert') + '</span></div></div>' });
@@ -20761,7 +20825,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
20761
20825
  if (hdrWrapper) {
20762
20826
  hdrWrapper.style.display = 'none';
20763
20827
  }
20764
- document.getElementById(parent.currentFilter + 'Canvas').parentElement.parentElement.classList.add('e-selected');
20828
+ if (document.getElementById(parent.currentFilter + 'Canvas')) {
20829
+ document.getElementById(parent.currentFilter + 'Canvas').parentElement.parentElement.classList.add('e-selected');
20830
+ }
20765
20831
  _this.enableDisableTbrBtn();
20766
20832
  toolbar.refreshOverflow();
20767
20833
  }
@@ -21552,7 +21618,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
21552
21618
  for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) {
21553
21619
  var selector = selectors_1[_i];
21554
21620
  var element = document.querySelector(selector);
21555
- if (element.classList.contains('e-selected-btn')) {
21621
+ if (element && element.classList.contains('e-selected-btn')) {
21556
21622
  element.classList.remove('e-selected-btn');
21557
21623
  break;
21558
21624
  }