@talrace/ngx-noder 0.0.14 → 0.0.16
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/esm2022/lib/apart-components/editor-toolbar/components/toolbar-actions/toolbar-actions.component.mjs +3 -3
- package/esm2022/lib/editor/components/image/components/image.component.mjs +2 -2
- package/esm2022/lib/editor/components/image/input-handler/image-input.handler.mjs +9 -18
- package/esm2022/lib/editor/components/shared/abstract/base.component.mjs +2 -1
- package/esm2022/lib/editor/display/layers/cursor.layer.mjs +2 -2
- package/esm2022/lib/editor/execution/edit.session.mjs +18 -1
- package/esm2022/lib/editor/execution/editor.mjs +37 -50
- package/esm2022/lib/editor/execution/regulator.service.mjs +2 -2
- package/esm2022/lib/editor/interaction/editor.service.mjs +18 -11
- package/esm2022/lib/editor/operations/helpers/link-operations.helper.mjs +5 -2
- package/esm2022/lib/editor/positioning/selection.mjs +35 -1
- package/fesm2022/talrace-ngx-noder.mjs +121 -81
- package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
- package/lib/editor/components/image/input-handler/image-input.handler.d.ts +1 -6
- package/lib/editor/components/shared/abstract/base.component.d.ts +2 -0
- package/lib/editor/execution/edit.session.d.ts +1 -0
- package/lib/editor/execution/editor.d.ts +5 -5
- package/lib/editor/interaction/editor.service.d.ts +10 -8
- package/lib/editor/positioning/selection.d.ts +7 -0
- package/package.json +1 -1
|
@@ -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.
|
|
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.
|
|
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
|
|
646
|
-
return this.
|
|
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
|
|
688
|
-
return this.
|
|
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
|
-
|
|
773
|
-
this.
|
|
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
|
-
|
|
818
|
-
this.
|
|
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;
|
|
@@ -4093,6 +4135,7 @@ class Editor {
|
|
|
4093
4135
|
// Update cursor because tab characters can influence the cursor position.
|
|
4094
4136
|
this.renderer.updateCursor();
|
|
4095
4137
|
};
|
|
4138
|
+
this.subscriptions.push(this.receiveTextStyleSubscription());
|
|
4096
4139
|
this.customElementTagNames = [...this.externalElementTagNames, this.imageTagName, this.tableCellTagName, this.edgeElementTagName];
|
|
4097
4140
|
this.history = new OperationHistory(editorService, regulatorService);
|
|
4098
4141
|
this.selection = new Selection();
|
|
@@ -4108,7 +4151,7 @@ class Editor {
|
|
|
4108
4151
|
this.session.applyToolbarStyles();
|
|
4109
4152
|
this.search = new Search();
|
|
4110
4153
|
this.search.set({ wrap: true });
|
|
4111
|
-
this.subscriptions.push(this.
|
|
4154
|
+
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.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
4155
|
}
|
|
4113
4156
|
destroy() {
|
|
4114
4157
|
this.subscriptions.forEach(s => s?.unsubscribe());
|
|
@@ -4116,7 +4159,7 @@ class Editor {
|
|
|
4116
4159
|
this.mouseHandler.destroy();
|
|
4117
4160
|
this.inputHandler.destroy();
|
|
4118
4161
|
this.documentHandler.destroy();
|
|
4119
|
-
this.
|
|
4162
|
+
this.selection.blur();
|
|
4120
4163
|
}
|
|
4121
4164
|
selectPageDown() {
|
|
4122
4165
|
const config = this.mainRenderer.layerConfig;
|
|
@@ -4334,7 +4377,6 @@ class Editor {
|
|
|
4334
4377
|
this.applyTextStyles(new TextStyleModel({ underline: !this.session.editorService.styles.underline }));
|
|
4335
4378
|
}
|
|
4336
4379
|
applyTextStyles(textStyle) {
|
|
4337
|
-
this.blurCustomComponent();
|
|
4338
4380
|
if (!this.selection.isEmpty) {
|
|
4339
4381
|
const partIndexes = ContentHelper.getSelectedPartDocumentIndexes(this.session.displayData.paragraphs, this.selection.range);
|
|
4340
4382
|
this.saveApplyTextStyleToHistory(partIndexes.startIndex, partIndexes.endIndex, textStyle);
|
|
@@ -4390,7 +4432,9 @@ class Editor {
|
|
|
4390
4432
|
this.renderer.updateCursor();
|
|
4391
4433
|
}
|
|
4392
4434
|
focus() {
|
|
4393
|
-
this.textInput.
|
|
4435
|
+
if (!this.textInput.isFocused && !this.selection.isFocused) {
|
|
4436
|
+
this.textInput.input.focus();
|
|
4437
|
+
}
|
|
4394
4438
|
}
|
|
4395
4439
|
openSearch() {
|
|
4396
4440
|
this.editorService.openSearchDialog = true;
|
|
@@ -4753,6 +4797,7 @@ class Editor {
|
|
|
4753
4797
|
this.removeCustomElementsData();
|
|
4754
4798
|
this.session.remove(this.selection.range);
|
|
4755
4799
|
this.onSelectionChange();
|
|
4800
|
+
this.focus();
|
|
4756
4801
|
}
|
|
4757
4802
|
removeCustomElementsData() {
|
|
4758
4803
|
const startIndex = ContentHelper.paragraphToDocumentIndex(this.session.displayData.paragraphs, this.selection.range.start.row, this.selection.range.start.column);
|
|
@@ -4821,7 +4866,7 @@ class Editor {
|
|
|
4821
4866
|
if (this.textInput.isFocused) {
|
|
4822
4867
|
return;
|
|
4823
4868
|
}
|
|
4824
|
-
this.
|
|
4869
|
+
this.selection.blur();
|
|
4825
4870
|
this.textInput.isFocused = true;
|
|
4826
4871
|
this.renderer.showCursor();
|
|
4827
4872
|
}
|
|
@@ -4831,7 +4876,7 @@ class Editor {
|
|
|
4831
4876
|
this.focusCustomComponent(customElement);
|
|
4832
4877
|
}
|
|
4833
4878
|
else {
|
|
4834
|
-
this.
|
|
4879
|
+
this.selection.blur();
|
|
4835
4880
|
}
|
|
4836
4881
|
}
|
|
4837
4882
|
onLeftClick(event) {
|
|
@@ -4840,15 +4885,17 @@ class Editor {
|
|
|
4840
4885
|
this.focusCustomComponent(customElement);
|
|
4841
4886
|
return;
|
|
4842
4887
|
}
|
|
4843
|
-
this.blurCustomComponent();
|
|
4844
|
-
if (!this.textInput.isFocused) {
|
|
4845
|
-
this.textInput.input.focus();
|
|
4846
|
-
}
|
|
4847
4888
|
const position = this.renderer.screenToTextCoordinatesUsingMidpoint(event.clientX, event.clientY);
|
|
4848
4889
|
if (event.shiftKey) {
|
|
4849
4890
|
this.selection.moveSelection(position);
|
|
4850
4891
|
}
|
|
4851
|
-
else
|
|
4892
|
+
else {
|
|
4893
|
+
this.selection.placeCursor(position);
|
|
4894
|
+
}
|
|
4895
|
+
this.focus();
|
|
4896
|
+
this.onSelectionChange();
|
|
4897
|
+
event.preventDefault();
|
|
4898
|
+
if (event.ctrlKey) {
|
|
4852
4899
|
const link = this.getLinkModel(event);
|
|
4853
4900
|
if (link) {
|
|
4854
4901
|
window.open(link.link);
|
|
@@ -4856,11 +4903,6 @@ class Editor {
|
|
|
4856
4903
|
return;
|
|
4857
4904
|
}
|
|
4858
4905
|
}
|
|
4859
|
-
else {
|
|
4860
|
-
this.selection.placeCursor(position);
|
|
4861
|
-
}
|
|
4862
|
-
this.onSelectionChange();
|
|
4863
|
-
event.preventDefault();
|
|
4864
4906
|
this.mouseHandler.startMousePress(this);
|
|
4865
4907
|
}
|
|
4866
4908
|
onDoubleClick(event) {
|
|
@@ -4877,7 +4919,6 @@ class Editor {
|
|
|
4877
4919
|
this.focusCustomComponent(customElement);
|
|
4878
4920
|
return;
|
|
4879
4921
|
}
|
|
4880
|
-
this.blurCustomComponent();
|
|
4881
4922
|
event.preventDefault();
|
|
4882
4923
|
const position = this.renderer.screenToTextCoordinatesUsingMidpoint(event.clientX, event.clientY);
|
|
4883
4924
|
if (!isEdgeEdit && this.mainSession.customComponents.edges.isEdit) {
|
|
@@ -4895,7 +4936,6 @@ class Editor {
|
|
|
4895
4936
|
this.focusCustomComponent(customElement);
|
|
4896
4937
|
return;
|
|
4897
4938
|
}
|
|
4898
|
-
this.blurCustomComponent();
|
|
4899
4939
|
event.preventDefault();
|
|
4900
4940
|
const position = this.renderer.screenToTextCoordinatesUsingMidpoint(event.clientX, event.clientY);
|
|
4901
4941
|
const start = new CursorParagraph(position.row, 0);
|
|
@@ -4909,7 +4949,6 @@ class Editor {
|
|
|
4909
4949
|
this.focusCustomComponent(customElement);
|
|
4910
4950
|
return;
|
|
4911
4951
|
}
|
|
4912
|
-
this.blurCustomComponent();
|
|
4913
4952
|
event.preventDefault();
|
|
4914
4953
|
this.selection.selectAll(this.session.model);
|
|
4915
4954
|
this.onSelectionChange();
|
|
@@ -4979,11 +5018,12 @@ class Editor {
|
|
|
4979
5018
|
* Returns the string of text currently highlighted.
|
|
4980
5019
|
*/
|
|
4981
5020
|
getSelectedText() {
|
|
4982
|
-
|
|
5021
|
+
const selectionRange = this.selection.selectedRange;
|
|
5022
|
+
if (selectionRange.isEmpty) {
|
|
4983
5023
|
return '';
|
|
4984
5024
|
}
|
|
4985
|
-
const startIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs,
|
|
4986
|
-
const endIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs,
|
|
5025
|
+
const startIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs, selectionRange.start);
|
|
5026
|
+
const endIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs, selectionRange.end);
|
|
4987
5027
|
let elementIndexes = [];
|
|
4988
5028
|
ContentHelper.setIndexesElementsInInterval(this.session.model.breaks, elementIndexes, startIndex, endIndex);
|
|
4989
5029
|
ContentHelper.setIndexesElementsInInterval(this.session.model.tables, elementIndexes, startIndex, endIndex);
|
|
@@ -4991,7 +5031,7 @@ class Editor {
|
|
|
4991
5031
|
ContentHelper.setIndexesElementsInInterval(this.session.model.elements, elementIndexes, startIndex, endIndex);
|
|
4992
5032
|
ContentHelper.setIndexesElementsInInterval(this.session.model.tabs, elementIndexes, startIndex, endIndex);
|
|
4993
5033
|
elementIndexes.sort((a, b) => b - a);
|
|
4994
|
-
let textInterval = this.session.displayData.getTextRange(
|
|
5034
|
+
let textInterval = this.session.displayData.getTextRange(selectionRange);
|
|
4995
5035
|
elementIndexes.forEach(x => {
|
|
4996
5036
|
textInterval = textInterval.slice(0, x) + textInterval.slice(x + 1);
|
|
4997
5037
|
});
|
|
@@ -5005,7 +5045,7 @@ class Editor {
|
|
|
5005
5045
|
}
|
|
5006
5046
|
onSelectionChange() {
|
|
5007
5047
|
this.session.applyToolbarStyles();
|
|
5008
|
-
this.renderer.updateSelection(this.selection.
|
|
5048
|
+
this.renderer.updateSelection(this.selection.selectedRange);
|
|
5009
5049
|
if (this.selection.isEmpty) {
|
|
5010
5050
|
this.renderer.updateCursor();
|
|
5011
5051
|
}
|
|
@@ -5036,22 +5076,13 @@ class Editor {
|
|
|
5036
5076
|
const component = this.session.customComponents.images.find(x => x.instance.insertIndex === index) ??
|
|
5037
5077
|
this.session.customComponents.tables.find(x => x.instance.insertIndex === index) ??
|
|
5038
5078
|
this.session.customComponents.customElements.find(x => x.instance.insertIndex === index);
|
|
5039
|
-
if (!component
|
|
5079
|
+
if (!component) {
|
|
5040
5080
|
return;
|
|
5041
5081
|
}
|
|
5042
|
-
this.focusedComponent?.instance.blur();
|
|
5043
|
-
component.instance.focus();
|
|
5044
|
-
this.focusedComponent = component;
|
|
5045
5082
|
const position = this.session.displayData.indexToPosition(index, 0);
|
|
5046
|
-
this.selection.
|
|
5083
|
+
this.selection.focus(component, position);
|
|
5047
5084
|
this.onSelectionChange();
|
|
5048
5085
|
}
|
|
5049
|
-
blurCustomComponent() {
|
|
5050
|
-
if (this.focusedComponent) {
|
|
5051
|
-
this.focusedComponent.instance.blur();
|
|
5052
|
-
this.focusedComponent = null;
|
|
5053
|
-
}
|
|
5054
|
-
}
|
|
5055
5086
|
isEmptyNumberingParagraph(paragraphIndex) {
|
|
5056
5087
|
const currentLine = this.session.displayData.getParagraphContent(paragraphIndex);
|
|
5057
5088
|
return currentLine.length === 0 && this.session.model.paragraphs[paragraphIndex].paragraphStyle.numberingId !== null;
|
|
@@ -5110,13 +5141,6 @@ class Editor {
|
|
|
5110
5141
|
this.session.removeTableColumns(insertIndex, startIndex, endIndex);
|
|
5111
5142
|
this.changedTableSize(insertIndex, sessionId);
|
|
5112
5143
|
}
|
|
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
5144
|
resizeTableColumns(resizeTableColumns, sessionId) {
|
|
5121
5145
|
this.regulatorService.setCustomSessionAsCurrent(sessionId);
|
|
5122
5146
|
const beforeTable = ContentHelper.documentIndexToParagraphIndex(this.session.displayData.paragraphs, resizeTableColumns.insertIndex);
|
|
@@ -5134,6 +5158,14 @@ class Editor {
|
|
|
5134
5158
|
}
|
|
5135
5159
|
this.scrollCursorIntoMainView();
|
|
5136
5160
|
}
|
|
5161
|
+
provideTextStyle(component) {
|
|
5162
|
+
const session = this.regulatorService.getSession(component.sessionId);
|
|
5163
|
+
const format = session.model.formats.find(x => x.startIndex <= component.insertIndex && x.endIndex >= component.insertIndex);
|
|
5164
|
+
component.receiveStyle(format.textStyle);
|
|
5165
|
+
}
|
|
5166
|
+
receiveTextStyleSubscription() {
|
|
5167
|
+
return this.editorService.receiveTextStyle$.subscribe(x => this.provideTextStyle(x));
|
|
5168
|
+
}
|
|
5137
5169
|
searchOptionSubscription() {
|
|
5138
5170
|
return this.editorService.searchOptions$.subscribe(searchOptions => {
|
|
5139
5171
|
this.find(searchOptions);
|
|
@@ -5246,10 +5278,8 @@ class Editor {
|
|
|
5246
5278
|
this.removeTableColumns(data.insertIndex, data.startIndex, data.endIndex, data.sessionId);
|
|
5247
5279
|
});
|
|
5248
5280
|
}
|
|
5249
|
-
|
|
5250
|
-
return this.editorService.
|
|
5251
|
-
this.removeImage(data.insertIndex);
|
|
5252
|
-
});
|
|
5281
|
+
removeRightSubscription() {
|
|
5282
|
+
return this.editorService.removeRight$.subscribe(() => this.removeRight());
|
|
5253
5283
|
}
|
|
5254
5284
|
resizeTableColumnsSubscription() {
|
|
5255
5285
|
return this.editorService.resizeTableColumns$.subscribe(data => {
|
|
@@ -5263,7 +5293,6 @@ class Editor {
|
|
|
5263
5293
|
}
|
|
5264
5294
|
insertTextSubscription() {
|
|
5265
5295
|
return this.editorService.insertText$.subscribe(x => {
|
|
5266
|
-
this.blurCustomComponent();
|
|
5267
5296
|
this.insert(x);
|
|
5268
5297
|
this.focus();
|
|
5269
5298
|
});
|
|
@@ -5282,8 +5311,8 @@ class Editor {
|
|
|
5282
5311
|
this.scrollCursorIntoMainView();
|
|
5283
5312
|
});
|
|
5284
5313
|
}
|
|
5285
|
-
|
|
5286
|
-
return this.editorService.
|
|
5314
|
+
removeLeftSubscription() {
|
|
5315
|
+
return this.editorService.removeLeft$.subscribe(() => this.removeLeft());
|
|
5287
5316
|
}
|
|
5288
5317
|
printSubscription() {
|
|
5289
5318
|
return this.editorService.print$.subscribe(() => this.onPrint());
|
|
@@ -8269,25 +8298,25 @@ class CustomComponentHelper {
|
|
|
8269
8298
|
}
|
|
8270
8299
|
|
|
8271
8300
|
class ImageInputHandler {
|
|
8272
|
-
constructor(editorService
|
|
8301
|
+
constructor(editorService) {
|
|
8273
8302
|
this.editorService = editorService;
|
|
8274
|
-
this.image = image;
|
|
8275
|
-
this.imageComponentTagName = 'APP-NOD-IMAGE';
|
|
8276
8303
|
this.undoRedoActions = {};
|
|
8277
8304
|
this.imageKeyDownSubscription = fromEvent(document, 'keydown').subscribe(event => this.onKeyDown(event));
|
|
8278
|
-
this.clickSubscription = fromEvent(document, 'click').subscribe(event => this.onClick(event.target));
|
|
8279
8305
|
this.fillUndoRedoActions();
|
|
8280
8306
|
}
|
|
8281
8307
|
destroy() {
|
|
8282
8308
|
this.imageKeyDownSubscription?.unsubscribe();
|
|
8283
|
-
this.clickSubscription?.unsubscribe();
|
|
8284
8309
|
}
|
|
8285
8310
|
onKeyDown(event) {
|
|
8286
8311
|
if (this.editorService.isViewOnly) {
|
|
8287
8312
|
return;
|
|
8288
8313
|
}
|
|
8289
|
-
if (
|
|
8290
|
-
this.editorService.
|
|
8314
|
+
if ('Backspace' === event.code) {
|
|
8315
|
+
this.editorService.removeLeft();
|
|
8316
|
+
return;
|
|
8317
|
+
}
|
|
8318
|
+
if ('Delete' === event.code) {
|
|
8319
|
+
this.editorService.removeRight();
|
|
8291
8320
|
return;
|
|
8292
8321
|
}
|
|
8293
8322
|
const keyCombination = this.getKeyCombination(event);
|
|
@@ -8298,6 +8327,7 @@ class ImageInputHandler {
|
|
|
8298
8327
|
}
|
|
8299
8328
|
if (!event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey && event.key.length === 1) {
|
|
8300
8329
|
this.editorService.insertText(event.key);
|
|
8330
|
+
event.preventDefault();
|
|
8301
8331
|
}
|
|
8302
8332
|
}
|
|
8303
8333
|
getKeyCombination(event) {
|
|
@@ -8310,16 +8340,6 @@ class ImageInputHandler {
|
|
|
8310
8340
|
this.undoRedoActions['Ctrl-KeyY'] = () => this.editorService.redo();
|
|
8311
8341
|
this.undoRedoActions['Command-KeyY'] = () => this.editorService.redo();
|
|
8312
8342
|
}
|
|
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
8343
|
}
|
|
8324
8344
|
|
|
8325
8345
|
var Direction;
|
|
@@ -8548,7 +8568,7 @@ class NoderImageComponent extends BaseNoderComponent {
|
|
|
8548
8568
|
this.cdr.markForCheck();
|
|
8549
8569
|
}
|
|
8550
8570
|
focus() {
|
|
8551
|
-
this.inputHandler = new ImageInputHandler(this.editorService
|
|
8571
|
+
this.inputHandler = new ImageInputHandler(this.editorService);
|
|
8552
8572
|
super.focus();
|
|
8553
8573
|
}
|
|
8554
8574
|
blur() {
|
|
@@ -8893,6 +8913,9 @@ class LinkOperationsHelper {
|
|
|
8893
8913
|
}
|
|
8894
8914
|
static merge(links, start, end) {
|
|
8895
8915
|
const firstIndex = links.findIndex(x => x.endIndex >= start);
|
|
8916
|
+
if (firstIndex === -1) {
|
|
8917
|
+
return;
|
|
8918
|
+
}
|
|
8896
8919
|
for (let link of links) {
|
|
8897
8920
|
if (link.startIndex <= start && link.endIndex >= end) {
|
|
8898
8921
|
const newLink = links[firstIndex + 1];
|
|
@@ -10075,6 +10098,21 @@ class EditSession {
|
|
|
10075
10098
|
this.editorService.changedEdge(this.sessionId);
|
|
10076
10099
|
}
|
|
10077
10100
|
}
|
|
10101
|
+
provideTextStyle(start, end) {
|
|
10102
|
+
const components = this.customComponents.customElements;
|
|
10103
|
+
let i = components.findIndex(x => x.instance.content.insertIndex >= start);
|
|
10104
|
+
if (i === -1) {
|
|
10105
|
+
return;
|
|
10106
|
+
}
|
|
10107
|
+
let j = this.model.formats.findIndex(x => x.endIndex >= components[i].instance.content.insertIndex);
|
|
10108
|
+
while (i < components.length && components[i].instance.content.insertIndex <= end) {
|
|
10109
|
+
while (this.model.formats[j].endIndex < components[i].instance.content.insertIndex) {
|
|
10110
|
+
j++;
|
|
10111
|
+
}
|
|
10112
|
+
components[i].instance.receiveStyle(this.model.formats[j].textStyle);
|
|
10113
|
+
i++;
|
|
10114
|
+
}
|
|
10115
|
+
}
|
|
10078
10116
|
removeByDocumentIndexes(startIndex, endIndex) {
|
|
10079
10117
|
const startParagraphPosition = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex);
|
|
10080
10118
|
const endParagraphPosition = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, endIndex);
|
|
@@ -10118,6 +10156,7 @@ class EditSession {
|
|
|
10118
10156
|
OperationsHelper.applyTextStyle(this.model, startIndex, endIndex, textStyle);
|
|
10119
10157
|
this.displayData.updateNextLineIndexes(startParagraph, endParagraph);
|
|
10120
10158
|
this.setTextStyle(textStyle);
|
|
10159
|
+
this.provideTextStyle(startIndex, endIndex);
|
|
10121
10160
|
}
|
|
10122
10161
|
applyParagraphStyle(startIndex, endIndex, paragraphStyle) {
|
|
10123
10162
|
const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
|
|
@@ -10189,6 +10228,7 @@ class EditSession {
|
|
|
10189
10228
|
this.displayData.updateNextLineIndexes(startParagraph, endPosition.row);
|
|
10190
10229
|
this.selection.placeCursor(endPosition);
|
|
10191
10230
|
this.applyToolbarStyles();
|
|
10231
|
+
this.provideTextStyle(startIndex, endIndex);
|
|
10192
10232
|
}
|
|
10193
10233
|
restoreParagraphStyles(paragraphs) {
|
|
10194
10234
|
const startIndex = paragraphs[0].insertIndex;
|
|
@@ -10562,7 +10602,7 @@ class CursorLayer {
|
|
|
10562
10602
|
this.addAnimationClass();
|
|
10563
10603
|
}
|
|
10564
10604
|
detectVisibility() {
|
|
10565
|
-
const selectionRange = this.session.selection.
|
|
10605
|
+
const selectionRange = this.session.selection.selectedRange;
|
|
10566
10606
|
if (selectionRange.isEmpty) {
|
|
10567
10607
|
DomHelper.removeCssClass(this.layer, 'selecting');
|
|
10568
10608
|
return;
|
|
@@ -11602,7 +11642,7 @@ class RegulatorService {
|
|
|
11602
11642
|
const previous = this.currentSession;
|
|
11603
11643
|
this.selection.clearSelection();
|
|
11604
11644
|
this.currentSession.renderer.hideCursor();
|
|
11605
|
-
this.currentSession.renderer.updateSelection(this.selection.
|
|
11645
|
+
this.currentSession.renderer.updateSelection(this.selection.selectedRange);
|
|
11606
11646
|
this.currentSession = session;
|
|
11607
11647
|
this.currentSession.renderer.showCursor();
|
|
11608
11648
|
this.arrangeEdgesForSessionChange(previous.session, session.session);
|
|
@@ -14099,11 +14139,11 @@ class ToolbarActionsComponent extends BaseToolbarComponent {
|
|
|
14099
14139
|
});
|
|
14100
14140
|
}
|
|
14101
14141
|
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
|
|
14142
|
+
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
14143
|
}
|
|
14104
14144
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToolbarActionsComponent, decorators: [{
|
|
14105
14145
|
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
|
|
14146
|
+
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
14147
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: CustomIconService }, { type: i0.Injector }, { type: EditorService }], propDecorators: { tableInsertMenu: [{
|
|
14108
14148
|
type: ViewChild,
|
|
14109
14149
|
args: ['tableInsert']
|