@talrace/ngx-noder 0.0.14 → 0.0.15

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.
@@ -447,6 +447,7 @@ class BaseNoderComponent extends DestroyComponent {
447
447
  this._isFocused = false;
448
448
  this.cdr.detectChanges();
449
449
  }
450
+ receiveStyle(_textStyle) { }
450
451
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseNoderComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
451
452
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: BaseNoderComponent, inputs: { content: "content", sessionId: "sessionId", contentWidth: "contentWidth", generalProperties: "generalProperties" }, host: { properties: { "class.focused": "this.focused", "attr.data-session-id": "this.sessionId", "attr.data-insert-index": "this.insertIndex" } }, usesInheritance: true, ngImport: i0 }); }
452
453
  }
@@ -481,6 +482,7 @@ class OperationsHistoryInfoModel {
481
482
  class EditorService {
482
483
  constructor() {
483
484
  this._styles$ = new BehaviorSubject({});
485
+ this._receiveTextStyle$ = new Subject();
484
486
  this._isViewOnly$ = new BehaviorSubject(false);
485
487
  this._isViewOnly = false;
486
488
  this._clipboardData$ = new BehaviorSubject('');
@@ -511,7 +513,7 @@ class EditorService {
511
513
  this._insertTableColumns$ = new Subject();
512
514
  this._removeTableRows$ = new Subject();
513
515
  this._removeTableColumns$ = new Subject();
514
- this._removeImage$ = new Subject();
516
+ this._removeRight$ = new Subject();
515
517
  this._resizeTableColumns$ = new Subject();
516
518
  this._insertTable$ = new Subject();
517
519
  this._redo$ = new Subject();
@@ -525,7 +527,7 @@ class EditorService {
525
527
  this._keyDown$ = new Subject();
526
528
  this._updateEdges$ = new Subject();
527
529
  this._insertText$ = new Subject();
528
- this._blurCustomComponent$ = new Subject();
530
+ this._removeLeft$ = new Subject();
529
531
  this._removeCustomElementsData$ = new Subject();
530
532
  }
531
533
  set styles(value) {
@@ -537,6 +539,9 @@ class EditorService {
537
539
  get styles$() {
538
540
  return this._styles$.asObservable();
539
541
  }
542
+ get receiveTextStyle$() {
543
+ return this._receiveTextStyle$.asObservable();
544
+ }
540
545
  get isViewOnly$() {
541
546
  return this._isViewOnly$.asObservable();
542
547
  }
@@ -642,8 +647,8 @@ class EditorService {
642
647
  get removeTableColumns$() {
643
648
  return this._removeTableColumns$.asObservable();
644
649
  }
645
- get removeImage$() {
646
- return this._removeImage$.asObservable();
650
+ get removeRight$() {
651
+ return this._removeRight$.asObservable();
647
652
  }
648
653
  get resizeTableColumns$() {
649
654
  return this._resizeTableColumns$.asObservable();
@@ -684,12 +689,15 @@ class EditorService {
684
689
  get insertText$() {
685
690
  return this._insertText$.asObservable();
686
691
  }
687
- get blurCustomComponent$() {
688
- return this._blurCustomComponent$.asObservable();
692
+ get removeLeft$() {
693
+ return this._removeLeft$.asObservable();
689
694
  }
690
695
  get removeCustomElementsData$() {
691
696
  return this._removeCustomElementsData$.asObservable();
692
697
  }
698
+ receiveTextStyle(component) {
699
+ this._receiveTextStyle$.next(component);
700
+ }
693
701
  setIsViewOnly(value) {
694
702
  this._isViewOnly = value;
695
703
  this._isViewOnly$.next(value);
@@ -769,8 +777,8 @@ class EditorService {
769
777
  removeTableColumns(insertIndex, startIndex, endIndex, sessionId) {
770
778
  this._removeTableColumns$.next({ insertIndex, startIndex, endIndex, sessionId });
771
779
  }
772
- removeImage(insertIndex) {
773
- this._removeImage$.next({ insertIndex });
780
+ removeRight() {
781
+ this._removeRight$.next();
774
782
  }
775
783
  resizeTableColumns(resizeTableColumns, sessionId) {
776
784
  this._resizeTableColumns$.next({
@@ -814,8 +822,8 @@ class EditorService {
814
822
  insertText(text) {
815
823
  this._insertText$.next(text);
816
824
  }
817
- blurCustomComponent() {
818
- this._blurCustomComponent$.next();
825
+ removeLeft() {
826
+ this._removeLeft$.next();
819
827
  }
820
828
  removeCustomElementsData(elements) {
821
829
  this._removeCustomElementsData$.next(elements);
@@ -3681,14 +3689,25 @@ class Selection {
3681
3689
  this.anchor = null;
3682
3690
  this.cursor = new CursorParagraph(0, 0);
3683
3691
  this.isDisabled = false;
3692
+ this.focusedComponent = null;
3684
3693
  this.keepLinePositionX = null;
3685
3694
  }
3695
+ get isFocused() {
3696
+ return !!this.focusedComponent;
3697
+ }
3686
3698
  get isEmpty() {
3687
3699
  return this.anchor === null || (this.anchor.row === this.cursor.row && this.anchor.column === this.cursor.column);
3688
3700
  }
3689
3701
  get isBackwards() {
3690
3702
  return this.anchor.row > this.cursor.row || (this.anchor.row === this.cursor.row && this.anchor.column > this.cursor.column);
3691
3703
  }
3704
+ get selectedRange() {
3705
+ if (!this.focusedComponent) {
3706
+ return this.range;
3707
+ }
3708
+ const cursor = new CursorParagraph(this.cursor.row, this.cursor.column);
3709
+ return new Range(cursor, cursor);
3710
+ }
3692
3711
  get range() {
3693
3712
  const cursor = new CursorParagraph(this.cursor.row, this.cursor.column);
3694
3713
  if (this.isEmpty) {
@@ -3697,19 +3716,40 @@ class Selection {
3697
3716
  const anchor = new CursorParagraph(this.anchor.row, this.anchor.column);
3698
3717
  return this.isBackwards ? new Range(cursor, anchor) : new Range(anchor, cursor);
3699
3718
  }
3719
+ focus(component, position) {
3720
+ if (component === this.focusedComponent) {
3721
+ return;
3722
+ }
3723
+ this.focusedComponent?.instance.blur();
3724
+ component.instance.focus();
3725
+ this.focusedComponent = component;
3726
+ this.cursor = position;
3727
+ this.anchor = new CursorParagraph(position.row, position.column + 1);
3728
+ this.keepLinePositionX = null;
3729
+ }
3730
+ blur() {
3731
+ this.focusedComponent?.instance.blur();
3732
+ this.focusedComponent = null;
3733
+ }
3700
3734
  placeCursor(cursor) {
3701
3735
  this.cursor = cursor;
3702
3736
  this.anchor = null;
3703
3737
  this.keepLinePositionX = null;
3738
+ this.focusedComponent?.instance.blur();
3739
+ this.focusedComponent = null;
3704
3740
  }
3705
3741
  moveCursor(cursor) {
3706
3742
  this.cursor = cursor;
3707
3743
  this.keepLinePositionX = null;
3744
+ this.focusedComponent?.instance.blur();
3745
+ this.focusedComponent = null;
3708
3746
  }
3709
3747
  placeSelection(cursor, anchor) {
3710
3748
  this.cursor = cursor;
3711
3749
  this.anchor = anchor;
3712
3750
  this.keepLinePositionX = null;
3751
+ this.focusedComponent?.instance.blur();
3752
+ this.focusedComponent = null;
3713
3753
  }
3714
3754
  moveSelection(position) {
3715
3755
  if (!this.anchor) {
@@ -3720,6 +3760,8 @@ class Selection {
3720
3760
  clearSelection() {
3721
3761
  this.anchor = null;
3722
3762
  this.keepLinePositionX = null;
3763
+ this.focusedComponent?.instance.blur();
3764
+ this.focusedComponent = null;
3723
3765
  }
3724
3766
  disableSelection() {
3725
3767
  this.isDisabled = true;
@@ -4108,7 +4150,7 @@ class Editor {
4108
4150
  this.session.applyToolbarStyles();
4109
4151
  this.search = new Search();
4110
4152
  this.search.set({ wrap: true });
4111
- this.subscriptions.push(this.searchOptionSubscription(), this.replaceSubscription(), this.setTextStylesSubscription(), this.setParagraphStylesSubscription(), this.changeElementStyleSubscription(), this.setNumberingTemplateTypeSubscription(), this.removeNumberingsSubscription(), this.setImageStyleSubscription(), this.createCustomComponentSubscription(), this.insertBreakSubscription(), this.insertImageSubscription(), this.insertLinkSubscription(), this.insertTextSubscription(), this.endMousePressSubscription(), this.disableSelectionSubscription(), this.changedTableSizeSubscription(), this.changedEdgeSizeSubscription(), this.imageLoadedSubscription(), this.changedEdgeSubscription(), this.insertTableRowsSubscription(), this.insertTableColumnsSubscription(), this.removeTableRowsSubscription(), this.removeTableColumnsSubscription(), this.removedImageSubscription(), this.resizeTableColumnsSubscription(), this.insertTableSubscription(), this.undoSubscription(), this.redoSubscription(), this.clipboardDataSubscription(), this.cutSelectedSubscription(), this.copySelectedSubscription(), this.pasteFromClipboardSubscription(), this.selectAllSubscription(), this.removeSelectedSubscription(), this.printSubscription(), this.updateEdgeSubscription(), this.blurCustomComponentSubscription());
4153
+ this.subscriptions.push(this.changedEdgeSizeSubscription(), this.changedEdgeSubscription(), this.changedTableSizeSubscription(), this.changeElementStyleSubscription(), this.clipboardDataSubscription(), this.copySelectedSubscription(), this.createCustomComponentSubscription(), this.cutSelectedSubscription(), this.disableSelectionSubscription(), this.endMousePressSubscription(), this.imageLoadedSubscription(), this.insertBreakSubscription(), this.insertImageSubscription(), this.insertLinkSubscription(), this.insertTableColumnsSubscription(), this.insertTableRowsSubscription(), this.insertTableSubscription(), this.insertTextSubscription(), this.pasteFromClipboardSubscription(), this.printSubscription(), this.receiveTextStyleSubscription(), this.redoSubscription(), this.removeLeftSubscription(), this.removeNumberingsSubscription(), this.removeRightSubscription(), this.removeSelectedSubscription(), this.removeTableColumnsSubscription(), this.removeTableRowsSubscription(), this.replaceSubscription(), this.resizeTableColumnsSubscription(), this.searchOptionSubscription(), this.selectAllSubscription(), this.setImageStyleSubscription(), this.setNumberingTemplateTypeSubscription(), this.setParagraphStylesSubscription(), this.setTextStylesSubscription(), this.undoSubscription(), this.updateEdgeSubscription());
4112
4154
  }
4113
4155
  destroy() {
4114
4156
  this.subscriptions.forEach(s => s?.unsubscribe());
@@ -4116,7 +4158,7 @@ class Editor {
4116
4158
  this.mouseHandler.destroy();
4117
4159
  this.inputHandler.destroy();
4118
4160
  this.documentHandler.destroy();
4119
- this.blurCustomComponent();
4161
+ this.selection.blur();
4120
4162
  }
4121
4163
  selectPageDown() {
4122
4164
  const config = this.mainRenderer.layerConfig;
@@ -4334,7 +4376,6 @@ class Editor {
4334
4376
  this.applyTextStyles(new TextStyleModel({ underline: !this.session.editorService.styles.underline }));
4335
4377
  }
4336
4378
  applyTextStyles(textStyle) {
4337
- this.blurCustomComponent();
4338
4379
  if (!this.selection.isEmpty) {
4339
4380
  const partIndexes = ContentHelper.getSelectedPartDocumentIndexes(this.session.displayData.paragraphs, this.selection.range);
4340
4381
  this.saveApplyTextStyleToHistory(partIndexes.startIndex, partIndexes.endIndex, textStyle);
@@ -4390,7 +4431,9 @@ class Editor {
4390
4431
  this.renderer.updateCursor();
4391
4432
  }
4392
4433
  focus() {
4393
- this.textInput.input.focus();
4434
+ if (!this.textInput.isFocused && !this.selection.isFocused) {
4435
+ this.textInput.input.focus();
4436
+ }
4394
4437
  }
4395
4438
  openSearch() {
4396
4439
  this.editorService.openSearchDialog = true;
@@ -4753,6 +4796,7 @@ class Editor {
4753
4796
  this.removeCustomElementsData();
4754
4797
  this.session.remove(this.selection.range);
4755
4798
  this.onSelectionChange();
4799
+ this.focus();
4756
4800
  }
4757
4801
  removeCustomElementsData() {
4758
4802
  const startIndex = ContentHelper.paragraphToDocumentIndex(this.session.displayData.paragraphs, this.selection.range.start.row, this.selection.range.start.column);
@@ -4821,7 +4865,7 @@ class Editor {
4821
4865
  if (this.textInput.isFocused) {
4822
4866
  return;
4823
4867
  }
4824
- this.blurCustomComponent();
4868
+ this.selection.blur();
4825
4869
  this.textInput.isFocused = true;
4826
4870
  this.renderer.showCursor();
4827
4871
  }
@@ -4831,7 +4875,7 @@ class Editor {
4831
4875
  this.focusCustomComponent(customElement);
4832
4876
  }
4833
4877
  else {
4834
- this.blurCustomComponent();
4878
+ this.selection.blur();
4835
4879
  }
4836
4880
  }
4837
4881
  onLeftClick(event) {
@@ -4840,15 +4884,17 @@ class Editor {
4840
4884
  this.focusCustomComponent(customElement);
4841
4885
  return;
4842
4886
  }
4843
- this.blurCustomComponent();
4844
- if (!this.textInput.isFocused) {
4845
- this.textInput.input.focus();
4846
- }
4847
4887
  const position = this.renderer.screenToTextCoordinatesUsingMidpoint(event.clientX, event.clientY);
4848
4888
  if (event.shiftKey) {
4849
4889
  this.selection.moveSelection(position);
4850
4890
  }
4851
- else if (event.ctrlKey) {
4891
+ else {
4892
+ this.selection.placeCursor(position);
4893
+ }
4894
+ this.focus();
4895
+ this.onSelectionChange();
4896
+ event.preventDefault();
4897
+ if (event.ctrlKey) {
4852
4898
  const link = this.getLinkModel(event);
4853
4899
  if (link) {
4854
4900
  window.open(link.link);
@@ -4856,11 +4902,6 @@ class Editor {
4856
4902
  return;
4857
4903
  }
4858
4904
  }
4859
- else {
4860
- this.selection.placeCursor(position);
4861
- }
4862
- this.onSelectionChange();
4863
- event.preventDefault();
4864
4905
  this.mouseHandler.startMousePress(this);
4865
4906
  }
4866
4907
  onDoubleClick(event) {
@@ -4877,7 +4918,6 @@ class Editor {
4877
4918
  this.focusCustomComponent(customElement);
4878
4919
  return;
4879
4920
  }
4880
- this.blurCustomComponent();
4881
4921
  event.preventDefault();
4882
4922
  const position = this.renderer.screenToTextCoordinatesUsingMidpoint(event.clientX, event.clientY);
4883
4923
  if (!isEdgeEdit && this.mainSession.customComponents.edges.isEdit) {
@@ -4895,7 +4935,6 @@ class Editor {
4895
4935
  this.focusCustomComponent(customElement);
4896
4936
  return;
4897
4937
  }
4898
- this.blurCustomComponent();
4899
4938
  event.preventDefault();
4900
4939
  const position = this.renderer.screenToTextCoordinatesUsingMidpoint(event.clientX, event.clientY);
4901
4940
  const start = new CursorParagraph(position.row, 0);
@@ -4909,7 +4948,6 @@ class Editor {
4909
4948
  this.focusCustomComponent(customElement);
4910
4949
  return;
4911
4950
  }
4912
- this.blurCustomComponent();
4913
4951
  event.preventDefault();
4914
4952
  this.selection.selectAll(this.session.model);
4915
4953
  this.onSelectionChange();
@@ -4979,11 +5017,12 @@ class Editor {
4979
5017
  * Returns the string of text currently highlighted.
4980
5018
  */
4981
5019
  getSelectedText() {
4982
- if (this.selection.isEmpty) {
5020
+ const selectionRange = this.selection.selectedRange;
5021
+ if (selectionRange.isEmpty) {
4983
5022
  return '';
4984
5023
  }
4985
- const startIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs, this.selection.range.start);
4986
- const endIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs, this.selection.range.end);
5024
+ const startIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs, selectionRange.start);
5025
+ const endIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs, selectionRange.end);
4987
5026
  let elementIndexes = [];
4988
5027
  ContentHelper.setIndexesElementsInInterval(this.session.model.breaks, elementIndexes, startIndex, endIndex);
4989
5028
  ContentHelper.setIndexesElementsInInterval(this.session.model.tables, elementIndexes, startIndex, endIndex);
@@ -4991,7 +5030,7 @@ class Editor {
4991
5030
  ContentHelper.setIndexesElementsInInterval(this.session.model.elements, elementIndexes, startIndex, endIndex);
4992
5031
  ContentHelper.setIndexesElementsInInterval(this.session.model.tabs, elementIndexes, startIndex, endIndex);
4993
5032
  elementIndexes.sort((a, b) => b - a);
4994
- let textInterval = this.session.displayData.getTextRange(this.selection.range);
5033
+ let textInterval = this.session.displayData.getTextRange(selectionRange);
4995
5034
  elementIndexes.forEach(x => {
4996
5035
  textInterval = textInterval.slice(0, x) + textInterval.slice(x + 1);
4997
5036
  });
@@ -5005,7 +5044,7 @@ class Editor {
5005
5044
  }
5006
5045
  onSelectionChange() {
5007
5046
  this.session.applyToolbarStyles();
5008
- this.renderer.updateSelection(this.selection.range);
5047
+ this.renderer.updateSelection(this.selection.selectedRange);
5009
5048
  if (this.selection.isEmpty) {
5010
5049
  this.renderer.updateCursor();
5011
5050
  }
@@ -5036,22 +5075,13 @@ class Editor {
5036
5075
  const component = this.session.customComponents.images.find(x => x.instance.insertIndex === index) ??
5037
5076
  this.session.customComponents.tables.find(x => x.instance.insertIndex === index) ??
5038
5077
  this.session.customComponents.customElements.find(x => x.instance.insertIndex === index);
5039
- if (!component || component === this.focusedComponent) {
5078
+ if (!component) {
5040
5079
  return;
5041
5080
  }
5042
- this.focusedComponent?.instance.blur();
5043
- component.instance.focus();
5044
- this.focusedComponent = component;
5045
5081
  const position = this.session.displayData.indexToPosition(index, 0);
5046
- this.selection.placeCursor(position);
5082
+ this.selection.focus(component, position);
5047
5083
  this.onSelectionChange();
5048
5084
  }
5049
- blurCustomComponent() {
5050
- if (this.focusedComponent) {
5051
- this.focusedComponent.instance.blur();
5052
- this.focusedComponent = null;
5053
- }
5054
- }
5055
5085
  isEmptyNumberingParagraph(paragraphIndex) {
5056
5086
  const currentLine = this.session.displayData.getParagraphContent(paragraphIndex);
5057
5087
  return currentLine.length === 0 && this.session.model.paragraphs[paragraphIndex].paragraphStyle.numberingId !== null;
@@ -5110,13 +5140,6 @@ class Editor {
5110
5140
  this.session.removeTableColumns(insertIndex, startIndex, endIndex);
5111
5141
  this.changedTableSize(insertIndex, sessionId);
5112
5142
  }
5113
- removeImage(insertIndex) {
5114
- const range = this.session.displayData.indexesToRange(insertIndex, insertIndex + 1);
5115
- this.saveRemoveToHistory(range);
5116
- this.session.remove(range);
5117
- this.renderer.updateCursor();
5118
- this.textInput.input.focus();
5119
- }
5120
5143
  resizeTableColumns(resizeTableColumns, sessionId) {
5121
5144
  this.regulatorService.setCustomSessionAsCurrent(sessionId);
5122
5145
  const beforeTable = ContentHelper.documentIndexToParagraphIndex(this.session.displayData.paragraphs, resizeTableColumns.insertIndex);
@@ -5134,6 +5157,14 @@ class Editor {
5134
5157
  }
5135
5158
  this.scrollCursorIntoMainView();
5136
5159
  }
5160
+ provideTextStyle(component) {
5161
+ const session = this.regulatorService.getSession(component.sessionId);
5162
+ const format = session.model.formats.find(x => x.startIndex <= component.insertIndex && x.endIndex >= component.insertIndex);
5163
+ component.receiveStyle(format.textStyle);
5164
+ }
5165
+ receiveTextStyleSubscription() {
5166
+ return this.editorService.receiveTextStyle$.subscribe(x => this.provideTextStyle(x));
5167
+ }
5137
5168
  searchOptionSubscription() {
5138
5169
  return this.editorService.searchOptions$.subscribe(searchOptions => {
5139
5170
  this.find(searchOptions);
@@ -5246,10 +5277,8 @@ class Editor {
5246
5277
  this.removeTableColumns(data.insertIndex, data.startIndex, data.endIndex, data.sessionId);
5247
5278
  });
5248
5279
  }
5249
- removedImageSubscription() {
5250
- return this.editorService.removeImage$.subscribe(data => {
5251
- this.removeImage(data.insertIndex);
5252
- });
5280
+ removeRightSubscription() {
5281
+ return this.editorService.removeRight$.subscribe(() => this.removeRight());
5253
5282
  }
5254
5283
  resizeTableColumnsSubscription() {
5255
5284
  return this.editorService.resizeTableColumns$.subscribe(data => {
@@ -5263,7 +5292,6 @@ class Editor {
5263
5292
  }
5264
5293
  insertTextSubscription() {
5265
5294
  return this.editorService.insertText$.subscribe(x => {
5266
- this.blurCustomComponent();
5267
5295
  this.insert(x);
5268
5296
  this.focus();
5269
5297
  });
@@ -5282,8 +5310,8 @@ class Editor {
5282
5310
  this.scrollCursorIntoMainView();
5283
5311
  });
5284
5312
  }
5285
- blurCustomComponentSubscription() {
5286
- return this.editorService.blurCustomComponent$.subscribe(() => this.blurCustomComponent());
5313
+ removeLeftSubscription() {
5314
+ return this.editorService.removeLeft$.subscribe(() => this.removeLeft());
5287
5315
  }
5288
5316
  printSubscription() {
5289
5317
  return this.editorService.print$.subscribe(() => this.onPrint());
@@ -8269,25 +8297,25 @@ class CustomComponentHelper {
8269
8297
  }
8270
8298
 
8271
8299
  class ImageInputHandler {
8272
- constructor(editorService, image) {
8300
+ constructor(editorService) {
8273
8301
  this.editorService = editorService;
8274
- this.image = image;
8275
- this.imageComponentTagName = 'APP-NOD-IMAGE';
8276
8302
  this.undoRedoActions = {};
8277
8303
  this.imageKeyDownSubscription = fromEvent(document, 'keydown').subscribe(event => this.onKeyDown(event));
8278
- this.clickSubscription = fromEvent(document, 'click').subscribe(event => this.onClick(event.target));
8279
8304
  this.fillUndoRedoActions();
8280
8305
  }
8281
8306
  destroy() {
8282
8307
  this.imageKeyDownSubscription?.unsubscribe();
8283
- this.clickSubscription?.unsubscribe();
8284
8308
  }
8285
8309
  onKeyDown(event) {
8286
8310
  if (this.editorService.isViewOnly) {
8287
8311
  return;
8288
8312
  }
8289
- if (['Backspace', 'Delete'].includes(event.code)) {
8290
- this.editorService.removeImage(this.image.insertIndex);
8313
+ if ('Backspace' === event.code) {
8314
+ this.editorService.removeLeft();
8315
+ return;
8316
+ }
8317
+ if ('Delete' === event.code) {
8318
+ this.editorService.removeRight();
8291
8319
  return;
8292
8320
  }
8293
8321
  const keyCombination = this.getKeyCombination(event);
@@ -8298,6 +8326,7 @@ class ImageInputHandler {
8298
8326
  }
8299
8327
  if (!event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey && event.key.length === 1) {
8300
8328
  this.editorService.insertText(event.key);
8329
+ event.preventDefault();
8301
8330
  }
8302
8331
  }
8303
8332
  getKeyCombination(event) {
@@ -8310,16 +8339,6 @@ class ImageInputHandler {
8310
8339
  this.undoRedoActions['Ctrl-KeyY'] = () => this.editorService.redo();
8311
8340
  this.undoRedoActions['Command-KeyY'] = () => this.editorService.redo();
8312
8341
  }
8313
- onClick(element) {
8314
- let currentElement = element;
8315
- while (currentElement) {
8316
- if (currentElement.tagName === this.imageComponentTagName) {
8317
- return;
8318
- }
8319
- currentElement = currentElement.parentElement;
8320
- }
8321
- this.editorService.blurCustomComponent();
8322
- }
8323
8342
  }
8324
8343
 
8325
8344
  var Direction;
@@ -8548,7 +8567,7 @@ class NoderImageComponent extends BaseNoderComponent {
8548
8567
  this.cdr.markForCheck();
8549
8568
  }
8550
8569
  focus() {
8551
- this.inputHandler = new ImageInputHandler(this.editorService, this);
8570
+ this.inputHandler = new ImageInputHandler(this.editorService);
8552
8571
  super.focus();
8553
8572
  }
8554
8573
  blur() {
@@ -8893,6 +8912,9 @@ class LinkOperationsHelper {
8893
8912
  }
8894
8913
  static merge(links, start, end) {
8895
8914
  const firstIndex = links.findIndex(x => x.endIndex >= start);
8915
+ if (firstIndex === -1) {
8916
+ return;
8917
+ }
8896
8918
  for (let link of links) {
8897
8919
  if (link.startIndex <= start && link.endIndex >= end) {
8898
8920
  const newLink = links[firstIndex + 1];
@@ -10075,6 +10097,21 @@ class EditSession {
10075
10097
  this.editorService.changedEdge(this.sessionId);
10076
10098
  }
10077
10099
  }
10100
+ provideTextStyle(start, end) {
10101
+ const components = this.customComponents.customElements;
10102
+ let i = components.findIndex(x => x.instance.content.insertIndex >= start);
10103
+ if (i === -1) {
10104
+ return;
10105
+ }
10106
+ let j = this.model.formats.findIndex(x => x.endIndex >= components[i].instance.content.insertIndex);
10107
+ while (i < components.length && components[i].instance.content.insertIndex <= end) {
10108
+ while (this.model.formats[j].endIndex < components[i].instance.content.insertIndex) {
10109
+ j++;
10110
+ }
10111
+ components[i].instance.receiveStyle(this.model.formats[j].textStyle);
10112
+ i++;
10113
+ }
10114
+ }
10078
10115
  removeByDocumentIndexes(startIndex, endIndex) {
10079
10116
  const startParagraphPosition = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex);
10080
10117
  const endParagraphPosition = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, endIndex);
@@ -10118,6 +10155,7 @@ class EditSession {
10118
10155
  OperationsHelper.applyTextStyle(this.model, startIndex, endIndex, textStyle);
10119
10156
  this.displayData.updateNextLineIndexes(startParagraph, endParagraph);
10120
10157
  this.setTextStyle(textStyle);
10158
+ this.provideTextStyle(startIndex, endIndex);
10121
10159
  }
10122
10160
  applyParagraphStyle(startIndex, endIndex, paragraphStyle) {
10123
10161
  const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
@@ -10189,6 +10227,7 @@ class EditSession {
10189
10227
  this.displayData.updateNextLineIndexes(startParagraph, endPosition.row);
10190
10228
  this.selection.placeCursor(endPosition);
10191
10229
  this.applyToolbarStyles();
10230
+ this.provideTextStyle(startIndex, endIndex);
10192
10231
  }
10193
10232
  restoreParagraphStyles(paragraphs) {
10194
10233
  const startIndex = paragraphs[0].insertIndex;
@@ -10562,7 +10601,7 @@ class CursorLayer {
10562
10601
  this.addAnimationClass();
10563
10602
  }
10564
10603
  detectVisibility() {
10565
- const selectionRange = this.session.selection.range;
10604
+ const selectionRange = this.session.selection.selectedRange;
10566
10605
  if (selectionRange.isEmpty) {
10567
10606
  DomHelper.removeCssClass(this.layer, 'selecting');
10568
10607
  return;
@@ -11602,7 +11641,7 @@ class RegulatorService {
11602
11641
  const previous = this.currentSession;
11603
11642
  this.selection.clearSelection();
11604
11643
  this.currentSession.renderer.hideCursor();
11605
- this.currentSession.renderer.updateSelection(this.selection.range);
11644
+ this.currentSession.renderer.updateSelection(this.selection.selectedRange);
11606
11645
  this.currentSession = session;
11607
11646
  this.currentSession.renderer.showCursor();
11608
11647
  this.arrangeEdgesForSessionChange(previous.session, session.session);
@@ -14099,11 +14138,11 @@ class ToolbarActionsComponent extends BaseToolbarComponent {
14099
14138
  });
14100
14139
  }
14101
14140
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToolbarActionsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: CustomIconService }, { token: i0.Injector }, { token: EditorService }], target: i0.ɵɵFactoryTarget.Component }); }
14102
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ToolbarActionsComponent, selector: "app-nod-toolbar-actions", viewQueries: [{ propertyName: "tableInsertMenu", first: true, predicate: ["tableInsert"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"{ isViewOnly: editorService.isViewOnly$ | async } as data\">\n <app-nod-undo-redo\n [canUndo]=\"canUndo\"\n [canRedo]=\"canRedo\"\n (undo)=\"undo.emit()\"\n (redo)=\"redo.emit()\" />\n <app-nod-print (print)=\"print.emit()\" />\n <div class=\"separator\"></div>\n <app-nod-font\n [isDisabled]=\"data.isViewOnly\"\n [styles]=\"styles\"\n (selectFont)=\"onApplyFontFamily($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-size\n [isDisabled]=\"data.isViewOnly\"\n [fontSize]=\"styles.fontSize\"\n (selectFontSize)=\"onApplyFontSize($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-style\n [isDisabled]=\"data.isViewOnly\"\n [bold]=\"styles.bold\"\n [italic]=\"styles.italic\"\n [underline]=\"styles.underline\"\n [fontColor]=\"styles.fontColor\"\n [highlightColor]=\"styles.highlightColor\"\n (selectFontColor)=\"onApplyFontColor($event)\"\n (toggleBold)=\"onApplyBold()\"\n (toggleItalic)=\"onApplyItalic()\"\n (toggleUnderline)=\"onApplyUnderline()\"\n (selectHighlightColor)=\"onApplyHighlightColor($event)\" />\n <div class=\"separator\"></div>\n <div class=\"insert-buttons\">\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-image\"\n [disabled]=\"data.isViewOnly\"\n (click)=\"insertImage.emit()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-image\" />\n </button>\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-table\"\n [class.active-button]=\"showInsertTableMenu\"\n [disabled]=\"data.isViewOnly\"\n [matMenuTriggerFor]=\"tableInsert\"\n (menuOpened)=\"showInsertTableMenu = true\"\n (menuClosed)=\"onTableInsertMenuClosed()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-table\" />\n </button>\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-link\"\n [disabled]=\"data.isViewOnly\"\n (click)=\"insertLink.emit()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-link-on\" />\n </button>\n </div>\n <div class=\"separator\"></div>\n <div\n *ngIf=\"elements.length\"\n class=\"custom-elements\">\n <button\n *ngFor=\"let element of elements\"\n mat-button\n [disabled]=\"data.isViewOnly\"\n (click)=\"onCreateElement(element)\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"{{ element.icon }}\"></mat-icon>\n </button>\n <div class=\"separator\"></div>\n </div>\n <app-nod-format\n [isDisabled]=\"data.isViewOnly\"\n [alignment]=\"styles.alignment\"\n (selectAlignment)=\"onApplyAlignment($event)\" />\n <div class=\"separator\"></div>\n <app-nod-numbering\n [isDisabled]=\"data.isViewOnly\"\n [selectedNumberingType]=\"numberingType\"\n [selectedNumberingTemplate]=\"numberingTemplateType\"\n (selectNumberingTemplate)=\"onSetNumberingTemplateType($event)\"\n (removeNumberings)=\"removeNumberings.emit()\" />\n</ng-container>\n<mat-menu\n #tableInsert=\"matMenu\"\n class=\"insert-table noder-modal\">\n <app-nod-insert-table\n *ngIf=\"showInsertTableMenu\"\n (selectSizes)=\"insertTable.emit($event)\" />\n</mat-menu>\n", styles: [":host::ng-deep mat-button-toggle,:host::ng-deep .mat-button-toggle-button{height:32px;width:32px;border-radius:4px}:host::ng-deep mat-button-toggle mat-icon,:host::ng-deep .mat-button-toggle-button mat-icon{font-size:24px;height:24px;width:24px;border-radius:4px}:host::ng-deep mat-button-toggle .mat-button-toggle-label-content,:host::ng-deep .mat-button-toggle-button .mat-button-toggle-label-content{padding:0 2px}.separator{border-left:1px solid;opacity:.1;height:100%;margin:0 8px}.mdc-button{width:28px;height:28px;padding:0}.mat-mdc-button>.mat-icon{margin-right:0}.do-action{padding-right:1px;justify-content:center;display:flex}.custom-elements,.insert-buttons{display:flex;align-items:center;height:100%}.custom-elements .mdc-button,.insert-buttons .mdc-button{min-width:32px;min-height:32px;width:32px;height:32px;padding:0}.custom-elements .mdc-button>.mat-icon,.insert-buttons .mdc-button>.mat-icon{margin-right:0;font-size:24px;height:24px;width:24px}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FontComponent, selector: "app-nod-font", inputs: ["isDisabled", "styles"], outputs: ["selectFont"] }, { kind: "component", type: FontSizeComponent, selector: "app-nod-font-size", inputs: ["isDisabled", "fontSize"], outputs: ["selectFontSize"] }, { kind: "component", type: InsertTableComponent, selector: "app-nod-insert-table", outputs: ["selectSizes"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i4$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: FontStyleComponent, selector: "app-nod-font-style", inputs: ["isDisabled", "bold", "italic", "underline", "fontColor", "highlightColor"], outputs: ["toggleBold", "toggleItalic", "toggleUnderline", "selectFontColor", "selectHighlightColor"] }, { kind: "component", type: FormatComponent, selector: "app-nod-format", inputs: ["isDisabled", "alignment"], outputs: ["selectAlignment"] }, { kind: "component", type: NumberingComponent, selector: "app-nod-numbering", inputs: ["isDisabled", "selectedNumberingType", "selectedNumberingTemplate"], outputs: ["selectNumberingTemplate", "removeNumberings"] }, { kind: "component", type: PrintComponent, selector: "app-nod-print", outputs: ["print"] }, { kind: "component", type: UndoRedoComponent, selector: "app-nod-undo-redo", inputs: ["canUndo", "canRedo"], outputs: ["undo", "redo"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14141
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ToolbarActionsComponent, selector: "app-nod-toolbar-actions", viewQueries: [{ propertyName: "tableInsertMenu", first: true, predicate: ["tableInsert"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"{ isViewOnly: editorService.isViewOnly$ | async } as data\">\n <app-nod-undo-redo\n [canUndo]=\"canUndo\"\n [canRedo]=\"canRedo\"\n (undo)=\"undo.emit()\"\n (redo)=\"redo.emit()\" />\n <app-nod-print (print)=\"print.emit()\" />\n <div class=\"separator\"></div>\n <app-nod-font\n [isDisabled]=\"data.isViewOnly\"\n [styles]=\"styles\"\n (selectFont)=\"onApplyFontFamily($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-size\n [isDisabled]=\"data.isViewOnly\"\n [fontSize]=\"styles.fontSize\"\n (selectFontSize)=\"onApplyFontSize($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-style\n [isDisabled]=\"data.isViewOnly\"\n [bold]=\"styles.bold\"\n [italic]=\"styles.italic\"\n [underline]=\"styles.underline\"\n [fontColor]=\"styles.fontColor\"\n [highlightColor]=\"styles.highlightColor\"\n (selectFontColor)=\"onApplyFontColor($event)\"\n (toggleBold)=\"onApplyBold()\"\n (toggleItalic)=\"onApplyItalic()\"\n (toggleUnderline)=\"onApplyUnderline()\"\n (selectHighlightColor)=\"onApplyHighlightColor($event)\" />\n <div class=\"separator\"></div>\n <app-nod-format\n [isDisabled]=\"data.isViewOnly\"\n [alignment]=\"styles.alignment\"\n (selectAlignment)=\"onApplyAlignment($event)\" />\n <div class=\"separator\"></div>\n <app-nod-numbering\n [isDisabled]=\"data.isViewOnly\"\n [selectedNumberingType]=\"numberingType\"\n [selectedNumberingTemplate]=\"numberingTemplateType\"\n (selectNumberingTemplate)=\"onSetNumberingTemplateType($event)\"\n (removeNumberings)=\"removeNumberings.emit()\" />\n <div class=\"separator\"></div>\n <div class=\"insert-buttons\">\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-image\"\n [disabled]=\"data.isViewOnly\"\n (click)=\"insertImage.emit()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-image\" />\n </button>\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-table\"\n [class.active-button]=\"showInsertTableMenu\"\n [disabled]=\"data.isViewOnly\"\n [matMenuTriggerFor]=\"tableInsert\"\n (menuOpened)=\"showInsertTableMenu = true\"\n (menuClosed)=\"onTableInsertMenuClosed()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-table\" />\n </button>\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-link\"\n [disabled]=\"data.isViewOnly\"\n (click)=\"insertLink.emit()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-link-on\" />\n </button>\n </div>\n <div\n *ngIf=\"elements.length\"\n class=\"separator\"></div>\n <div\n *ngIf=\"elements.length\"\n class=\"custom-elements\">\n <button\n *ngFor=\"let element of elements\"\n mat-button\n [disabled]=\"data.isViewOnly\"\n (click)=\"onCreateElement(element)\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"{{ element.icon }}\"></mat-icon>\n </button>\n </div>\n</ng-container>\n<mat-menu\n #tableInsert=\"matMenu\"\n class=\"insert-table noder-modal\">\n <app-nod-insert-table\n *ngIf=\"showInsertTableMenu\"\n (selectSizes)=\"insertTable.emit($event)\" />\n</mat-menu>\n", styles: [":host::ng-deep mat-button-toggle,:host::ng-deep .mat-button-toggle-button{height:32px;width:32px;border-radius:4px}:host::ng-deep mat-button-toggle mat-icon,:host::ng-deep .mat-button-toggle-button mat-icon{font-size:24px;height:24px;width:24px;border-radius:4px}:host::ng-deep mat-button-toggle .mat-button-toggle-label-content,:host::ng-deep .mat-button-toggle-button .mat-button-toggle-label-content{padding:0 2px}.separator{border-left:1px solid;opacity:.1;height:100%;margin:0 8px}.mdc-button{width:28px;height:28px;padding:0}.mat-mdc-button>.mat-icon{margin-right:0}.do-action{padding-right:1px;justify-content:center;display:flex}.custom-elements,.insert-buttons{display:flex;align-items:center;height:100%}.custom-elements .mdc-button,.insert-buttons .mdc-button{min-width:32px;min-height:32px;width:32px;height:32px;padding:0}.custom-elements .mdc-button>.mat-icon,.insert-buttons .mdc-button>.mat-icon{margin-right:0;font-size:24px;height:24px;width:24px}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FontComponent, selector: "app-nod-font", inputs: ["isDisabled", "styles"], outputs: ["selectFont"] }, { kind: "component", type: FontSizeComponent, selector: "app-nod-font-size", inputs: ["isDisabled", "fontSize"], outputs: ["selectFontSize"] }, { kind: "component", type: InsertTableComponent, selector: "app-nod-insert-table", outputs: ["selectSizes"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i4$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: FontStyleComponent, selector: "app-nod-font-style", inputs: ["isDisabled", "bold", "italic", "underline", "fontColor", "highlightColor"], outputs: ["toggleBold", "toggleItalic", "toggleUnderline", "selectFontColor", "selectHighlightColor"] }, { kind: "component", type: FormatComponent, selector: "app-nod-format", inputs: ["isDisabled", "alignment"], outputs: ["selectAlignment"] }, { kind: "component", type: NumberingComponent, selector: "app-nod-numbering", inputs: ["isDisabled", "selectedNumberingType", "selectedNumberingTemplate"], outputs: ["selectNumberingTemplate", "removeNumberings"] }, { kind: "component", type: PrintComponent, selector: "app-nod-print", outputs: ["print"] }, { kind: "component", type: UndoRedoComponent, selector: "app-nod-undo-redo", inputs: ["canUndo", "canRedo"], outputs: ["undo", "redo"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14103
14142
  }
14104
14143
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToolbarActionsComponent, decorators: [{
14105
14144
  type: Component,
14106
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'app-nod-toolbar-actions', template: "<ng-container *ngIf=\"{ isViewOnly: editorService.isViewOnly$ | async } as data\">\n <app-nod-undo-redo\n [canUndo]=\"canUndo\"\n [canRedo]=\"canRedo\"\n (undo)=\"undo.emit()\"\n (redo)=\"redo.emit()\" />\n <app-nod-print (print)=\"print.emit()\" />\n <div class=\"separator\"></div>\n <app-nod-font\n [isDisabled]=\"data.isViewOnly\"\n [styles]=\"styles\"\n (selectFont)=\"onApplyFontFamily($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-size\n [isDisabled]=\"data.isViewOnly\"\n [fontSize]=\"styles.fontSize\"\n (selectFontSize)=\"onApplyFontSize($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-style\n [isDisabled]=\"data.isViewOnly\"\n [bold]=\"styles.bold\"\n [italic]=\"styles.italic\"\n [underline]=\"styles.underline\"\n [fontColor]=\"styles.fontColor\"\n [highlightColor]=\"styles.highlightColor\"\n (selectFontColor)=\"onApplyFontColor($event)\"\n (toggleBold)=\"onApplyBold()\"\n (toggleItalic)=\"onApplyItalic()\"\n (toggleUnderline)=\"onApplyUnderline()\"\n (selectHighlightColor)=\"onApplyHighlightColor($event)\" />\n <div class=\"separator\"></div>\n <div class=\"insert-buttons\">\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-image\"\n [disabled]=\"data.isViewOnly\"\n (click)=\"insertImage.emit()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-image\" />\n </button>\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-table\"\n [class.active-button]=\"showInsertTableMenu\"\n [disabled]=\"data.isViewOnly\"\n [matMenuTriggerFor]=\"tableInsert\"\n (menuOpened)=\"showInsertTableMenu = true\"\n (menuClosed)=\"onTableInsertMenuClosed()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-table\" />\n </button>\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-link\"\n [disabled]=\"data.isViewOnly\"\n (click)=\"insertLink.emit()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-link-on\" />\n </button>\n </div>\n <div class=\"separator\"></div>\n <div\n *ngIf=\"elements.length\"\n class=\"custom-elements\">\n <button\n *ngFor=\"let element of elements\"\n mat-button\n [disabled]=\"data.isViewOnly\"\n (click)=\"onCreateElement(element)\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"{{ element.icon }}\"></mat-icon>\n </button>\n <div class=\"separator\"></div>\n </div>\n <app-nod-format\n [isDisabled]=\"data.isViewOnly\"\n [alignment]=\"styles.alignment\"\n (selectAlignment)=\"onApplyAlignment($event)\" />\n <div class=\"separator\"></div>\n <app-nod-numbering\n [isDisabled]=\"data.isViewOnly\"\n [selectedNumberingType]=\"numberingType\"\n [selectedNumberingTemplate]=\"numberingTemplateType\"\n (selectNumberingTemplate)=\"onSetNumberingTemplateType($event)\"\n (removeNumberings)=\"removeNumberings.emit()\" />\n</ng-container>\n<mat-menu\n #tableInsert=\"matMenu\"\n class=\"insert-table noder-modal\">\n <app-nod-insert-table\n *ngIf=\"showInsertTableMenu\"\n (selectSizes)=\"insertTable.emit($event)\" />\n</mat-menu>\n", styles: [":host::ng-deep mat-button-toggle,:host::ng-deep .mat-button-toggle-button{height:32px;width:32px;border-radius:4px}:host::ng-deep mat-button-toggle mat-icon,:host::ng-deep .mat-button-toggle-button mat-icon{font-size:24px;height:24px;width:24px;border-radius:4px}:host::ng-deep mat-button-toggle .mat-button-toggle-label-content,:host::ng-deep .mat-button-toggle-button .mat-button-toggle-label-content{padding:0 2px}.separator{border-left:1px solid;opacity:.1;height:100%;margin:0 8px}.mdc-button{width:28px;height:28px;padding:0}.mat-mdc-button>.mat-icon{margin-right:0}.do-action{padding-right:1px;justify-content:center;display:flex}.custom-elements,.insert-buttons{display:flex;align-items:center;height:100%}.custom-elements .mdc-button,.insert-buttons .mdc-button{min-width:32px;min-height:32px;width:32px;height:32px;padding:0}.custom-elements .mdc-button>.mat-icon,.insert-buttons .mdc-button>.mat-icon{margin-right:0;font-size:24px;height:24px;width:24px}\n"] }]
14145
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'app-nod-toolbar-actions', template: "<ng-container *ngIf=\"{ isViewOnly: editorService.isViewOnly$ | async } as data\">\n <app-nod-undo-redo\n [canUndo]=\"canUndo\"\n [canRedo]=\"canRedo\"\n (undo)=\"undo.emit()\"\n (redo)=\"redo.emit()\" />\n <app-nod-print (print)=\"print.emit()\" />\n <div class=\"separator\"></div>\n <app-nod-font\n [isDisabled]=\"data.isViewOnly\"\n [styles]=\"styles\"\n (selectFont)=\"onApplyFontFamily($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-size\n [isDisabled]=\"data.isViewOnly\"\n [fontSize]=\"styles.fontSize\"\n (selectFontSize)=\"onApplyFontSize($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-style\n [isDisabled]=\"data.isViewOnly\"\n [bold]=\"styles.bold\"\n [italic]=\"styles.italic\"\n [underline]=\"styles.underline\"\n [fontColor]=\"styles.fontColor\"\n [highlightColor]=\"styles.highlightColor\"\n (selectFontColor)=\"onApplyFontColor($event)\"\n (toggleBold)=\"onApplyBold()\"\n (toggleItalic)=\"onApplyItalic()\"\n (toggleUnderline)=\"onApplyUnderline()\"\n (selectHighlightColor)=\"onApplyHighlightColor($event)\" />\n <div class=\"separator\"></div>\n <app-nod-format\n [isDisabled]=\"data.isViewOnly\"\n [alignment]=\"styles.alignment\"\n (selectAlignment)=\"onApplyAlignment($event)\" />\n <div class=\"separator\"></div>\n <app-nod-numbering\n [isDisabled]=\"data.isViewOnly\"\n [selectedNumberingType]=\"numberingType\"\n [selectedNumberingTemplate]=\"numberingTemplateType\"\n (selectNumberingTemplate)=\"onSetNumberingTemplateType($event)\"\n (removeNumberings)=\"removeNumberings.emit()\" />\n <div class=\"separator\"></div>\n <div class=\"insert-buttons\">\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-image\"\n [disabled]=\"data.isViewOnly\"\n (click)=\"insertImage.emit()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-image\" />\n </button>\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-table\"\n [class.active-button]=\"showInsertTableMenu\"\n [disabled]=\"data.isViewOnly\"\n [matMenuTriggerFor]=\"tableInsert\"\n (menuOpened)=\"showInsertTableMenu = true\"\n (menuClosed)=\"onTableInsertMenuClosed()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-table\" />\n </button>\n <button\n mat-button\n id=\"toolbar-actions-menu-item-insert-link\"\n [disabled]=\"data.isViewOnly\"\n (click)=\"insertLink.emit()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-link-on\" />\n </button>\n </div>\n <div\n *ngIf=\"elements.length\"\n class=\"separator\"></div>\n <div\n *ngIf=\"elements.length\"\n class=\"custom-elements\">\n <button\n *ngFor=\"let element of elements\"\n mat-button\n [disabled]=\"data.isViewOnly\"\n (click)=\"onCreateElement(element)\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"{{ element.icon }}\"></mat-icon>\n </button>\n </div>\n</ng-container>\n<mat-menu\n #tableInsert=\"matMenu\"\n class=\"insert-table noder-modal\">\n <app-nod-insert-table\n *ngIf=\"showInsertTableMenu\"\n (selectSizes)=\"insertTable.emit($event)\" />\n</mat-menu>\n", styles: [":host::ng-deep mat-button-toggle,:host::ng-deep .mat-button-toggle-button{height:32px;width:32px;border-radius:4px}:host::ng-deep mat-button-toggle mat-icon,:host::ng-deep .mat-button-toggle-button mat-icon{font-size:24px;height:24px;width:24px;border-radius:4px}:host::ng-deep mat-button-toggle .mat-button-toggle-label-content,:host::ng-deep .mat-button-toggle-button .mat-button-toggle-label-content{padding:0 2px}.separator{border-left:1px solid;opacity:.1;height:100%;margin:0 8px}.mdc-button{width:28px;height:28px;padding:0}.mat-mdc-button>.mat-icon{margin-right:0}.do-action{padding-right:1px;justify-content:center;display:flex}.custom-elements,.insert-buttons{display:flex;align-items:center;height:100%}.custom-elements .mdc-button,.insert-buttons .mdc-button{min-width:32px;min-height:32px;width:32px;height:32px;padding:0}.custom-elements .mdc-button>.mat-icon,.insert-buttons .mdc-button>.mat-icon{margin-right:0;font-size:24px;height:24px;width:24px}\n"] }]
14107
14146
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: CustomIconService }, { type: i0.Injector }, { type: EditorService }], propDecorators: { tableInsertMenu: [{
14108
14147
  type: ViewChild,
14109
14148
  args: ['tableInsert']