@talrace/ngx-noder 0.0.20 → 0.0.22
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/fesm2022/talrace-ngx-noder.mjs +113 -186
- package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
- package/lib/editor/components/external-element/external.component.d.ts +0 -4
- package/lib/editor/components/external-element/models/element-data.model.d.ts +1 -3
- package/lib/editor/components/external-element/models/external-element.model.d.ts +0 -4
- package/lib/editor/components/image/components/image.component.d.ts +1 -3
- package/lib/editor/components/shared/abstract/base.component.d.ts +6 -4
- package/lib/editor/components/tab/tab.component.d.ts +2 -4
- package/lib/editor/components/table/components/table.component.d.ts +1 -3
- package/lib/editor/execution/edit.session.d.ts +1 -2
- package/lib/editor/execution/editor.d.ts +1 -4
- package/lib/editor/gadgets/history/operation-history.d.ts +0 -2
- package/lib/editor/interaction/editor.service.d.ts +3 -3
- package/lib/editor/operations/enums/command-type.enum.d.ts +16 -17
- package/lib/editor/operations/operations-helper.helper.d.ts +0 -2
- package/lib/editor/operations/save-commands.helper.d.ts +0 -2
- package/lib/models/generated/command.model.d.ts +0 -2
- package/lib/models/generated/element.model.d.ts +0 -2
- package/package.json +1 -1
- package/src/_ngx-noder.theme.scss +10 -10
- package/src/lib/apart-components/editor-toolbar/_theme.scss +11 -11
- package/src/lib/editor/_theme.scss +1 -1
- package/src/styles.scss +2 -2
- package/lib/models/generated/apply-element-style.model.d.ts +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, inject, ChangeDetectorRef, HostBinding, Input,
|
|
2
|
+
import { Directive, Injectable, inject, ChangeDetectorRef, HostBinding, Input, InjectionToken, createComponent, Component, ChangeDetectionStrategy, ViewChild, EventEmitter, Output, HostListener, NgModule, Inject } from '@angular/core';
|
|
3
3
|
import { Subject, BehaviorSubject, fromEvent, throttleTime, filter, take, startWith, takeUntil, catchError, debounceTime, distinctUntilChanged } from 'rxjs';
|
|
4
4
|
import * as i1$1 from '@angular/common/http';
|
|
5
5
|
import { HttpHeaders } from '@angular/common/http';
|
|
@@ -385,10 +385,8 @@ class FormatStyleHelper {
|
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
class ElementDataModel {
|
|
388
|
-
constructor(type,
|
|
388
|
+
constructor(type, guid) {
|
|
389
389
|
this.type = type;
|
|
390
|
-
this.width = width;
|
|
391
|
-
this.height = height;
|
|
392
390
|
this.guid = guid;
|
|
393
391
|
}
|
|
394
392
|
}
|
|
@@ -419,63 +417,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
419
417
|
type: Directive
|
|
420
418
|
}] });
|
|
421
419
|
|
|
422
|
-
class BaseNoderComponent extends DestroyComponent {
|
|
423
|
-
constructor() {
|
|
424
|
-
super(...arguments);
|
|
425
|
-
this._isFocused = false;
|
|
426
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
427
|
-
}
|
|
428
|
-
get focused() {
|
|
429
|
-
return this._isFocused;
|
|
430
|
-
}
|
|
431
|
-
get insertIndex() {
|
|
432
|
-
return this.content.insertIndex;
|
|
433
|
-
}
|
|
434
|
-
set insertIndex(val) {
|
|
435
|
-
this.content.insertIndex = val;
|
|
436
|
-
}
|
|
437
|
-
get height() {
|
|
438
|
-
return this._height;
|
|
439
|
-
}
|
|
440
|
-
get width() {
|
|
441
|
-
return this._width;
|
|
442
|
-
}
|
|
443
|
-
get isFocused() {
|
|
444
|
-
return this._isFocused;
|
|
445
|
-
}
|
|
446
|
-
focus() {
|
|
447
|
-
this._isFocused = true;
|
|
448
|
-
this.cdr.detectChanges();
|
|
449
|
-
}
|
|
450
|
-
blur() {
|
|
451
|
-
this._isFocused = false;
|
|
452
|
-
this.cdr.detectChanges();
|
|
453
|
-
}
|
|
454
|
-
receiveStyle(_textStyle) { }
|
|
455
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BaseNoderComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
456
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: BaseNoderComponent, isStandalone: true, 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 }); }
|
|
457
|
-
}
|
|
458
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BaseNoderComponent, decorators: [{
|
|
459
|
-
type: Directive
|
|
460
|
-
}], propDecorators: { focused: [{
|
|
461
|
-
type: HostBinding,
|
|
462
|
-
args: ['class.focused']
|
|
463
|
-
}], content: [{
|
|
464
|
-
type: Input
|
|
465
|
-
}], sessionId: [{
|
|
466
|
-
type: Input
|
|
467
|
-
}, {
|
|
468
|
-
type: HostBinding,
|
|
469
|
-
args: ['attr.data-session-id']
|
|
470
|
-
}], insertIndex: [{
|
|
471
|
-
type: HostBinding,
|
|
472
|
-
args: ['attr.data-insert-index']
|
|
473
|
-
}], contentWidth: [{
|
|
474
|
-
type: Input
|
|
475
|
-
}], generalProperties: [{
|
|
476
|
-
type: Input
|
|
477
|
-
}] } });
|
|
478
|
-
|
|
479
420
|
class OperationsHistoryInfoModel {
|
|
480
421
|
constructor(step, storageLength) {
|
|
481
422
|
this.step = step;
|
|
@@ -502,7 +443,7 @@ class EditorService {
|
|
|
502
443
|
this._setNumberingTemplateType$ = new Subject();
|
|
503
444
|
this._removeNumberings$ = new Subject();
|
|
504
445
|
this._changeImageStyle$ = new Subject();
|
|
505
|
-
this.
|
|
446
|
+
this._rerender$ = new Subject();
|
|
506
447
|
this._createCustomComponent$ = new Subject();
|
|
507
448
|
this._insertBreak$ = new Subject();
|
|
508
449
|
this._insertImage$ = new Subject();
|
|
@@ -608,8 +549,8 @@ class EditorService {
|
|
|
608
549
|
get setImageStyle$() {
|
|
609
550
|
return this._changeImageStyle$.asObservable();
|
|
610
551
|
}
|
|
611
|
-
get
|
|
612
|
-
return this.
|
|
552
|
+
get rerender$() {
|
|
553
|
+
return this._rerender$.asObservable();
|
|
613
554
|
}
|
|
614
555
|
get createCustomComponent$() {
|
|
615
556
|
return this._createCustomComponent$.asObservable();
|
|
@@ -753,8 +694,8 @@ class EditorService {
|
|
|
753
694
|
changeImageStyle(value) {
|
|
754
695
|
this._changeImageStyle$.next(value);
|
|
755
696
|
}
|
|
756
|
-
|
|
757
|
-
this.
|
|
697
|
+
rerender(index = 0) {
|
|
698
|
+
this._rerender$.next(index);
|
|
758
699
|
}
|
|
759
700
|
createCustomComponent(model) {
|
|
760
701
|
this._createCustomComponent$.next(model);
|
|
@@ -865,19 +806,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
865
806
|
type: Injectable
|
|
866
807
|
}] });
|
|
867
808
|
|
|
868
|
-
class
|
|
869
|
-
constructor(fields) {
|
|
870
|
-
if (fields) {
|
|
871
|
-
Object.assign(this, fields);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
class ExternalComponent extends BaseNoderComponent {
|
|
809
|
+
class BaseNoderComponent extends DestroyComponent {
|
|
877
810
|
constructor() {
|
|
878
811
|
super(...arguments);
|
|
812
|
+
this._isFocused = false;
|
|
813
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
879
814
|
this.editorService = inject(EditorService);
|
|
880
815
|
}
|
|
816
|
+
get focused() {
|
|
817
|
+
return this._isFocused;
|
|
818
|
+
}
|
|
819
|
+
get insertIndex() {
|
|
820
|
+
return this.content.insertIndex;
|
|
821
|
+
}
|
|
822
|
+
set insertIndex(val) {
|
|
823
|
+
this.content.insertIndex = val;
|
|
824
|
+
}
|
|
825
|
+
get isFocused() {
|
|
826
|
+
return this._isFocused;
|
|
827
|
+
}
|
|
828
|
+
focus() {
|
|
829
|
+
this._isFocused = true;
|
|
830
|
+
this.cdr.detectChanges();
|
|
831
|
+
}
|
|
832
|
+
blur() {
|
|
833
|
+
this._isFocused = false;
|
|
834
|
+
this.cdr.detectChanges();
|
|
835
|
+
}
|
|
836
|
+
receiveStyle(_textStyle) { }
|
|
837
|
+
requestStyle() {
|
|
838
|
+
this.editorService.receiveTextStyle(this);
|
|
839
|
+
}
|
|
840
|
+
rerender() {
|
|
841
|
+
this.editorService.rerender(this.insertIndex);
|
|
842
|
+
}
|
|
843
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BaseNoderComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
844
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: BaseNoderComponent, isStandalone: true, 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 }); }
|
|
845
|
+
}
|
|
846
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BaseNoderComponent, decorators: [{
|
|
847
|
+
type: Directive
|
|
848
|
+
}], propDecorators: { focused: [{
|
|
849
|
+
type: HostBinding,
|
|
850
|
+
args: ['class.focused']
|
|
851
|
+
}], content: [{
|
|
852
|
+
type: Input
|
|
853
|
+
}], sessionId: [{
|
|
854
|
+
type: Input
|
|
855
|
+
}, {
|
|
856
|
+
type: HostBinding,
|
|
857
|
+
args: ['attr.data-session-id']
|
|
858
|
+
}], insertIndex: [{
|
|
859
|
+
type: HostBinding,
|
|
860
|
+
args: ['attr.data-insert-index']
|
|
861
|
+
}], contentWidth: [{
|
|
862
|
+
type: Input
|
|
863
|
+
}], generalProperties: [{
|
|
864
|
+
type: Input
|
|
865
|
+
}] } });
|
|
866
|
+
|
|
867
|
+
class ExternalComponent extends BaseNoderComponent {
|
|
881
868
|
focus() {
|
|
882
869
|
super.focus();
|
|
883
870
|
if (this.editorService.isViewOnly) {
|
|
@@ -892,16 +879,6 @@ class ExternalComponent extends BaseNoderComponent {
|
|
|
892
879
|
}
|
|
893
880
|
this.editorService.closeSidenav();
|
|
894
881
|
}
|
|
895
|
-
changeElementHeight(height) {
|
|
896
|
-
if (this._height !== height) {
|
|
897
|
-
this.editorService.changeElementStyle(new ElementModel({ ...this.content, height }));
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
changeElementWidth(width) {
|
|
901
|
-
if (this._width !== width) {
|
|
902
|
-
this.editorService.changeElementStyle(new ElementModel({ ...this.content, width }));
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
882
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ExternalComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
906
883
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: ExternalComponent, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
|
|
907
884
|
}
|
|
@@ -961,23 +938,22 @@ var CommandType;
|
|
|
961
938
|
CommandType[CommandType["ApplyParagraphStyle"] = 8] = "ApplyParagraphStyle";
|
|
962
939
|
CommandType[CommandType["InsertElement"] = 9] = "InsertElement";
|
|
963
940
|
CommandType[CommandType["InsertBreak"] = 10] = "InsertBreak";
|
|
964
|
-
CommandType[CommandType["
|
|
965
|
-
CommandType[CommandType["
|
|
966
|
-
CommandType[CommandType["
|
|
967
|
-
CommandType[CommandType["
|
|
968
|
-
CommandType[CommandType["
|
|
969
|
-
CommandType[CommandType["
|
|
970
|
-
CommandType[CommandType["
|
|
971
|
-
CommandType[CommandType["
|
|
972
|
-
CommandType[CommandType["
|
|
973
|
-
CommandType[CommandType["
|
|
974
|
-
CommandType[CommandType["
|
|
975
|
-
CommandType[CommandType["
|
|
976
|
-
CommandType[CommandType["
|
|
977
|
-
CommandType[CommandType["
|
|
978
|
-
CommandType[CommandType["
|
|
979
|
-
CommandType[CommandType["
|
|
980
|
-
CommandType[CommandType["InsertParagraph"] = 27] = "InsertParagraph";
|
|
941
|
+
CommandType[CommandType["ApplyImageStyle"] = 11] = "ApplyImageStyle";
|
|
942
|
+
CommandType[CommandType["AddNumbering"] = 12] = "AddNumbering";
|
|
943
|
+
CommandType[CommandType["InsertTab"] = 13] = "InsertTab";
|
|
944
|
+
CommandType[CommandType["InsertTableColumns"] = 14] = "InsertTableColumns";
|
|
945
|
+
CommandType[CommandType["InsertTableRows"] = 15] = "InsertTableRows";
|
|
946
|
+
CommandType[CommandType["RemoveTableColumns"] = 16] = "RemoveTableColumns";
|
|
947
|
+
CommandType[CommandType["RemoveTableRows"] = 17] = "RemoveTableRows";
|
|
948
|
+
CommandType[CommandType["ResizeTableColumns"] = 18] = "ResizeTableColumns";
|
|
949
|
+
CommandType[CommandType["RestoreTable"] = 19] = "RestoreTable";
|
|
950
|
+
CommandType[CommandType["InsertTable"] = 20] = "InsertTable";
|
|
951
|
+
CommandType[CommandType["InsertImage"] = 21] = "InsertImage";
|
|
952
|
+
CommandType[CommandType["RemoveNumberings"] = 22] = "RemoveNumberings";
|
|
953
|
+
CommandType[CommandType["RestoreNumberings"] = 23] = "RestoreNumberings";
|
|
954
|
+
CommandType[CommandType["Replace"] = 24] = "Replace";
|
|
955
|
+
CommandType[CommandType["InsertLink"] = 25] = "InsertLink";
|
|
956
|
+
CommandType[CommandType["InsertParagraph"] = 26] = "InsertParagraph";
|
|
981
957
|
})(CommandType || (CommandType = {}));
|
|
982
958
|
|
|
983
959
|
class PageNumbersModel {
|
|
@@ -1007,14 +983,6 @@ class AddNumberingModel {
|
|
|
1007
983
|
}
|
|
1008
984
|
}
|
|
1009
985
|
|
|
1010
|
-
class ApplyElementStyleModel {
|
|
1011
|
-
constructor(fields) {
|
|
1012
|
-
if (fields) {
|
|
1013
|
-
Object.assign(this, fields);
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
986
|
class ApplyImageStyleModel {
|
|
1019
987
|
constructor(fields) {
|
|
1020
988
|
if (fields) {
|
|
@@ -1181,6 +1149,14 @@ class DocumentHandler extends BaseHandler {
|
|
|
1181
1149
|
}
|
|
1182
1150
|
}
|
|
1183
1151
|
|
|
1152
|
+
class ElementModel {
|
|
1153
|
+
constructor(fields) {
|
|
1154
|
+
if (fields) {
|
|
1155
|
+
Object.assign(this, fields);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1184
1160
|
class FormatHelper {
|
|
1185
1161
|
static sliceSection(formats, startIndex, endIndex) {
|
|
1186
1162
|
let result = [];
|
|
@@ -1759,11 +1735,6 @@ class OperationHistory {
|
|
|
1759
1735
|
const undoStep = new RestoreParagraphStylesModel({ paragraphs });
|
|
1760
1736
|
this.addToHistory(undoStep, redoStep);
|
|
1761
1737
|
}
|
|
1762
|
-
pushApplyElementStyle(previous, current) {
|
|
1763
|
-
const redoStep = new ApplyElementStyleModel({ insertIndex: current.insertIndex, width: current.width, height: current.height });
|
|
1764
|
-
const undoStep = new ApplyElementStyleModel({ insertIndex: previous.insertIndex, width: previous.width, height: previous.height });
|
|
1765
|
-
this.addToHistory(undoStep, redoStep);
|
|
1766
|
-
}
|
|
1767
1738
|
pushInsertTableRows(insertIndex, rowsCount, targetIndex, inheritIndex, table) {
|
|
1768
1739
|
const oldTable = JSON.parse(JSON.stringify(table));
|
|
1769
1740
|
const redoStep = new InsertTableRowsModel({ insertIndex, rowsCount, targetIndex, inheritIndex });
|
|
@@ -3300,9 +3271,6 @@ class CommandModel {
|
|
|
3300
3271
|
if (fields.addNumbering) {
|
|
3301
3272
|
fields.addNumbering = new AddNumberingModel(fields.addNumbering);
|
|
3302
3273
|
}
|
|
3303
|
-
if (fields.applyElementStyle) {
|
|
3304
|
-
fields.applyElementStyle = new ApplyElementStyleModel(fields.applyElementStyle);
|
|
3305
|
-
}
|
|
3306
3274
|
if (fields.applyImageStyle) {
|
|
3307
3275
|
fields.applyImageStyle = new ApplyImageStyleModel(fields.applyImageStyle);
|
|
3308
3276
|
}
|
|
@@ -3492,9 +3460,6 @@ class SaveCommandsHelper {
|
|
|
3492
3460
|
static getResizeTableColumnsCommand(resizeTableColumns, targets) {
|
|
3493
3461
|
return new CommandModel({ commandType: CommandType.ResizeTableColumns, resizeTableColumns, targets });
|
|
3494
3462
|
}
|
|
3495
|
-
static getApplyElementStyleCommand(applyElementStyle, targets) {
|
|
3496
|
-
return new CommandModel({ commandType: CommandType.ApplyElementStyle, applyElementStyle, targets });
|
|
3497
|
-
}
|
|
3498
3463
|
}
|
|
3499
3464
|
|
|
3500
3465
|
class SearchOptions {
|
|
@@ -4193,7 +4158,7 @@ class Editor {
|
|
|
4193
4158
|
this.session.applyToolbarStyles();
|
|
4194
4159
|
this.search = new Search();
|
|
4195
4160
|
this.search.set({ wrap: true });
|
|
4196
|
-
this.subscriptions.push(this.changedEdgeSizeSubscription(), this.changedEdgeSubscription(), this.changedTableSizeSubscription(), this.
|
|
4161
|
+
this.subscriptions.push(this.changedEdgeSizeSubscription(), this.changedEdgeSubscription(), this.changedTableSizeSubscription(), 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.rerenderSubscription(), this.resizeTableColumnsSubscription(), this.searchOptionSubscription(), this.selectAllSubscription(), this.setImageStyleSubscription(), this.setNumberingTemplateTypeSubscription(), this.setParagraphStylesSubscription(), this.setTextStylesSubscription(), this.undoSubscription(), this.updateEdgeSubscription());
|
|
4197
4162
|
}
|
|
4198
4163
|
destroy() {
|
|
4199
4164
|
this.subscriptions.forEach(s => s?.unsubscribe());
|
|
@@ -4447,10 +4412,6 @@ class Editor {
|
|
|
4447
4412
|
this.saveApplyParagraphStyleToHistory(startIndex, endIndex, paragraphStyle);
|
|
4448
4413
|
this.session.applyParagraphStyle(startIndex, endIndex, paragraphStyle);
|
|
4449
4414
|
}
|
|
4450
|
-
applyElementStyle(current) {
|
|
4451
|
-
this.saveApplyElementStyleToHistory(current);
|
|
4452
|
-
this.session.applyElementStyle(new ApplyElementStyleModel(current));
|
|
4453
|
-
}
|
|
4454
4415
|
setNumberingTemplate(templateLevels) {
|
|
4455
4416
|
const range = this.selection.range;
|
|
4456
4417
|
const startIndex = this.session.model.paragraphs[range.start.row].insertIndex;
|
|
@@ -4622,10 +4583,6 @@ class Editor {
|
|
|
4622
4583
|
this.session.insertBreakByDocumentIndex(operation);
|
|
4623
4584
|
command = SaveCommandsHelper.getInsertBreakCommand(operation, this.targets);
|
|
4624
4585
|
}
|
|
4625
|
-
else if (operation instanceof ApplyElementStyleModel) {
|
|
4626
|
-
this.session.applyElementStyle(operation);
|
|
4627
|
-
command = SaveCommandsHelper.getApplyElementStyleCommand(operation, this.targets);
|
|
4628
|
-
}
|
|
4629
4586
|
else if (operation instanceof InsertTabModel) {
|
|
4630
4587
|
this.session.insertTabByDocumentIndex(operation);
|
|
4631
4588
|
command = SaveCommandsHelper.getInsertTabCommand(operation, this.targets);
|
|
@@ -4766,11 +4723,6 @@ class Editor {
|
|
|
4766
4723
|
this.history.pushApplyParagraphStyle(startIndex, endIndex, paragraphStyle, paragraphsDeepCopy);
|
|
4767
4724
|
this.commandsService.createCommand(SaveCommandsHelper.getApplyParagraphStyleCommand(startIndex, endIndex, paragraphStyle, this.targets));
|
|
4768
4725
|
}
|
|
4769
|
-
saveApplyElementStyleToHistory(current) {
|
|
4770
|
-
const previous = this.session.model.elements.find(x => x.insertIndex === current.insertIndex);
|
|
4771
|
-
this.history.pushApplyElementStyle(previous, current);
|
|
4772
|
-
this.commandsService.createCommand(SaveCommandsHelper.getApplyElementStyleCommand(current, this.targets));
|
|
4773
|
-
}
|
|
4774
4726
|
saveAddNumberingToHistory(templateLevels, startIndex, endIndex) {
|
|
4775
4727
|
const paragraphs = IndexedElementHelper.sliceSection(this.session.model.paragraphs, startIndex, endIndex);
|
|
4776
4728
|
const paragraphsDeepCopy = paragraphs.map(x => new ParagraphModel({ insertIndex: x.insertIndex, paragraphStyle: new ParagraphStyleModel({ ...x.paragraphStyle }) }));
|
|
@@ -5248,8 +5200,8 @@ class Editor {
|
|
|
5248
5200
|
setImageStyleSubscription() {
|
|
5249
5201
|
return this.editorService.setImageStyle$.subscribe(image => this.applyImageStyles(image));
|
|
5250
5202
|
}
|
|
5251
|
-
|
|
5252
|
-
return this.editorService.
|
|
5203
|
+
rerenderSubscription() {
|
|
5204
|
+
return this.editorService.rerender$.subscribe(index => this.session.rerender(index));
|
|
5253
5205
|
}
|
|
5254
5206
|
createCustomComponentSubscription() {
|
|
5255
5207
|
return this.editorService.createCustomComponent$.subscribe(model => {
|
|
@@ -6521,10 +6473,9 @@ class NoderTableComponent extends BaseNoderComponent {
|
|
|
6521
6473
|
set table(val) {
|
|
6522
6474
|
this.content = val;
|
|
6523
6475
|
}
|
|
6524
|
-
constructor(componentService,
|
|
6476
|
+
constructor(componentService, el, overlayService, regulatorService) {
|
|
6525
6477
|
super();
|
|
6526
6478
|
this.componentService = componentService;
|
|
6527
|
-
this.editorService = editorService;
|
|
6528
6479
|
this.el = el;
|
|
6529
6480
|
this.overlayService = overlayService;
|
|
6530
6481
|
this.regulatorService = regulatorService;
|
|
@@ -6592,7 +6543,7 @@ class NoderTableComponent extends BaseNoderComponent {
|
|
|
6592
6543
|
const cellWidth = this.getCellWidth(tableRow, cellIndex, absoluteCellIndex);
|
|
6593
6544
|
if (tableRow.cells[cellIndex].widthType === 'pct') {
|
|
6594
6545
|
tableRow.cells[cellIndex].widthType = 'dxa';
|
|
6595
|
-
return (cellWidth * this.
|
|
6546
|
+
return (cellWidth * this.width) / 5000; // 5000 is equal to 100% in docx units of measurement
|
|
6596
6547
|
}
|
|
6597
6548
|
return ScalingHelper.scale(cellWidth, this.generalProperties.scalingRatio);
|
|
6598
6549
|
}
|
|
@@ -6618,7 +6569,7 @@ class NoderTableComponent extends BaseNoderComponent {
|
|
|
6618
6569
|
this.initialize();
|
|
6619
6570
|
}
|
|
6620
6571
|
insertRows(rowsCount, targetIndex) {
|
|
6621
|
-
this.
|
|
6572
|
+
this.width = this.getTableWidth();
|
|
6622
6573
|
let rowIndex = 0;
|
|
6623
6574
|
while (rowIndex < rowsCount) {
|
|
6624
6575
|
const targetRowIndex = targetIndex + rowIndex;
|
|
@@ -6790,7 +6741,7 @@ class NoderTableComponent extends BaseNoderComponent {
|
|
|
6790
6741
|
bordersHeight += this.borderSize;
|
|
6791
6742
|
}
|
|
6792
6743
|
}
|
|
6793
|
-
this.
|
|
6744
|
+
this.height = rowsHeight + bordersHeight;
|
|
6794
6745
|
}
|
|
6795
6746
|
processSplit(leftSpaceOnPage, spaceBetweenPagesContent, contentHeight) {
|
|
6796
6747
|
this.removeSplits();
|
|
@@ -6903,13 +6854,13 @@ class NoderTableComponent extends BaseNoderComponent {
|
|
|
6903
6854
|
}
|
|
6904
6855
|
}
|
|
6905
6856
|
}
|
|
6906
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderTableComponent, deps: [{ token: ComponentService }, { token:
|
|
6857
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderTableComponent, deps: [{ token: ComponentService }, { token: i0.ElementRef }, { token: OverlayService }, { token: RegulatorService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6907
6858
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: NoderTableComponent, isStandalone: false, selector: "app-nod-table", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{position:relative}:host::ng-deep table{position:relative;border-collapse:collapse;background:transparent;empty-cells:show;border-spacing:0;overflow:visible;table-layout:fixed}:host::ng-deep td{position:relative;vertical-align:top;border:1px solid #000;margin:0;padding:0;height:inherit}:host::ng-deep .hidden-cell{display:none;cursor:not-allowed}:host::ng-deep .resizer-border{position:absolute;border:solid .5px blue;z-index:1}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6908
6859
|
}
|
|
6909
6860
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderTableComponent, decorators: [{
|
|
6910
6861
|
type: Component,
|
|
6911
6862
|
args: [{ selector: 'app-nod-table', template: '', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, styles: [":host{position:relative}:host::ng-deep table{position:relative;border-collapse:collapse;background:transparent;empty-cells:show;border-spacing:0;overflow:visible;table-layout:fixed}:host::ng-deep td{position:relative;vertical-align:top;border:1px solid #000;margin:0;padding:0;height:inherit}:host::ng-deep .hidden-cell{display:none;cursor:not-allowed}:host::ng-deep .resizer-border{position:absolute;border:solid .5px blue;z-index:1}\n"] }]
|
|
6912
|
-
}], ctorParameters: () => [{ type: ComponentService }, { type:
|
|
6863
|
+
}], ctorParameters: () => [{ type: ComponentService }, { type: i0.ElementRef }, { type: OverlayService }, { type: RegulatorService }] });
|
|
6913
6864
|
|
|
6914
6865
|
class NumberingDataModel {
|
|
6915
6866
|
constructor(fields) {
|
|
@@ -8593,19 +8544,18 @@ class NoderImageComponent extends BaseNoderComponent {
|
|
|
8593
8544
|
this.content = val;
|
|
8594
8545
|
}
|
|
8595
8546
|
get size() {
|
|
8596
|
-
return { width: this.
|
|
8547
|
+
return { width: this.width, height: this.height };
|
|
8597
8548
|
}
|
|
8598
|
-
constructor(elementRef, apiService
|
|
8549
|
+
constructor(elementRef, apiService) {
|
|
8599
8550
|
super();
|
|
8600
8551
|
this.elementRef = elementRef;
|
|
8601
8552
|
this.apiService = apiService;
|
|
8602
|
-
this.editorService = editorService;
|
|
8603
8553
|
this.isCanvas = false;
|
|
8604
8554
|
}
|
|
8605
8555
|
initialize() {
|
|
8606
8556
|
const url = this.image.content?.replace('/api/', '') ?? '';
|
|
8607
|
-
this.
|
|
8608
|
-
this.
|
|
8557
|
+
this.height = ScalingHelper.scale(this.image.height, this.generalProperties.scalingRatio);
|
|
8558
|
+
this.width = ScalingHelper.scale(this.image.width, this.generalProperties.scalingRatio);
|
|
8609
8559
|
this.apiService.getFile(url).subscribe(x => {
|
|
8610
8560
|
const fileSource = URL.createObjectURL(x);
|
|
8611
8561
|
const image = this.createImage(fileSource);
|
|
@@ -8619,8 +8569,8 @@ class NoderImageComponent extends BaseNoderComponent {
|
|
|
8619
8569
|
this.editorService.changeImageStyle(resizedImage);
|
|
8620
8570
|
}
|
|
8621
8571
|
resize(size) {
|
|
8622
|
-
this.
|
|
8623
|
-
this.
|
|
8572
|
+
this.width = size.width;
|
|
8573
|
+
this.height = size.height;
|
|
8624
8574
|
this.isCanvas ? this.resizeCanvas(size) : this.resizeImage(size);
|
|
8625
8575
|
this.cdr.markForCheck();
|
|
8626
8576
|
}
|
|
@@ -8638,8 +8588,8 @@ class NoderImageComponent extends BaseNoderComponent {
|
|
|
8638
8588
|
}
|
|
8639
8589
|
createImage(fileSource) {
|
|
8640
8590
|
const imageEl = document.createElement('img');
|
|
8641
|
-
imageEl.width = this.
|
|
8642
|
-
imageEl.height = this.
|
|
8591
|
+
imageEl.width = this.width;
|
|
8592
|
+
imageEl.height = this.height;
|
|
8643
8593
|
imageEl.src = fileSource;
|
|
8644
8594
|
return imageEl;
|
|
8645
8595
|
}
|
|
@@ -8653,27 +8603,15 @@ class NoderImageComponent extends BaseNoderComponent {
|
|
|
8653
8603
|
image.style.width = `${size.width}px`;
|
|
8654
8604
|
image.style.height = `${size.height}px`;
|
|
8655
8605
|
}
|
|
8656
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderImageComponent, deps: [{ token: i0.ElementRef }, { token: ImageApiService }
|
|
8606
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderImageComponent, deps: [{ token: i0.ElementRef }, { token: ImageApiService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8657
8607
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: NoderImageComponent, isStandalone: false, selector: "app-nod-image", usesInheritance: true, ngImport: i0, template: "<app-nod-resizer\n *ngIf=\"isFocused\"\n class=\"resizer\"\n [isDisabled]=\"isViewOnly$ | async\"\n [size]=\"size\"\n (resizeEnd)=\"onResizeEnd($event)\" />\n", styles: [":host{position:relative;outline:none}.resizer{position:absolute;z-index:1}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ResizerComponent, selector: "app-nod-resizer", inputs: ["isDisabled", "size"], outputs: ["resizeEnd"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8658
8608
|
}
|
|
8659
8609
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderImageComponent, decorators: [{
|
|
8660
8610
|
type: Component,
|
|
8661
8611
|
args: [{ selector: 'app-nod-image', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<app-nod-resizer\n *ngIf=\"isFocused\"\n class=\"resizer\"\n [isDisabled]=\"isViewOnly$ | async\"\n [size]=\"size\"\n (resizeEnd)=\"onResizeEnd($event)\" />\n", styles: [":host{position:relative;outline:none}.resizer{position:absolute;z-index:1}\n"] }]
|
|
8662
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: ImageApiService }
|
|
8612
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: ImageApiService }] });
|
|
8663
8613
|
|
|
8664
8614
|
class NoderTabComponent extends BaseNoderComponent {
|
|
8665
|
-
get width() {
|
|
8666
|
-
return this._width;
|
|
8667
|
-
}
|
|
8668
|
-
set width(value) {
|
|
8669
|
-
this._width = value;
|
|
8670
|
-
}
|
|
8671
|
-
get height() {
|
|
8672
|
-
return this._height;
|
|
8673
|
-
}
|
|
8674
|
-
set height(value) {
|
|
8675
|
-
this._height = value;
|
|
8676
|
-
}
|
|
8677
8615
|
get tab() {
|
|
8678
8616
|
return this.content;
|
|
8679
8617
|
}
|
|
@@ -8684,8 +8622,8 @@ class NoderTabComponent extends BaseNoderComponent {
|
|
|
8684
8622
|
this.calculateProperties();
|
|
8685
8623
|
}
|
|
8686
8624
|
calculateProperties() {
|
|
8687
|
-
this.
|
|
8688
|
-
this.
|
|
8625
|
+
this.height = this.tab.fontSize;
|
|
8626
|
+
this.width = ScalingHelper.scale(this.tab.width, this.generalProperties.scalingRatio);
|
|
8689
8627
|
}
|
|
8690
8628
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderTabComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
8691
8629
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: NoderTabComponent, isStandalone: false, selector: "app-nod-tab", host: { properties: { "style.width.px": "this.width", "style.fontSize.pt": "this.height" } }, usesInheritance: true, ngImport: i0, template: " \n", styles: [":host{position:relative;outline:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -9641,9 +9579,6 @@ class OperationsHelper {
|
|
|
9641
9579
|
this.applyParagraphStyle(contents, model.startIndex, model.endIndex, model.paragraphStyle);
|
|
9642
9580
|
break;
|
|
9643
9581
|
}
|
|
9644
|
-
case CommandType.ApplyElementStyle:
|
|
9645
|
-
this.applyElementStyle(contents, command.applyElementStyle);
|
|
9646
|
-
break;
|
|
9647
9582
|
case CommandType.InsertElement: {
|
|
9648
9583
|
const model = command.insertElement;
|
|
9649
9584
|
this.insertElement(contents, model);
|
|
@@ -9986,11 +9921,6 @@ class OperationsHelper {
|
|
|
9986
9921
|
static applyParagraphStyle(document, startIndex, endIndex, style) {
|
|
9987
9922
|
ParagraphOperationsHelper.apply(document.paragraphs, startIndex, endIndex, style);
|
|
9988
9923
|
}
|
|
9989
|
-
static applyElementStyle(document, model) {
|
|
9990
|
-
const element = document.elements.find(x => x.insertIndex == model.insertIndex);
|
|
9991
|
-
element.width = model.width ?? element.width;
|
|
9992
|
-
element.height = model.height ?? element.height;
|
|
9993
|
-
}
|
|
9994
9924
|
static applyImageStyle(document, image) {
|
|
9995
9925
|
ImageOperationsHelper.apply(document.images, image);
|
|
9996
9926
|
}
|
|
@@ -10211,9 +10141,9 @@ class EditSession {
|
|
|
10211
10141
|
const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
|
|
10212
10142
|
const endParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, endIndex).row;
|
|
10213
10143
|
OperationsHelper.applyTextStyle(this.model, startIndex, endIndex, textStyle);
|
|
10144
|
+
this.provideTextStyle(startIndex, endIndex);
|
|
10214
10145
|
this.displayData.updateNextLineIndexes(startParagraph, endParagraph);
|
|
10215
10146
|
this.setTextStyle(textStyle);
|
|
10216
|
-
this.provideTextStyle(startIndex, endIndex);
|
|
10217
10147
|
}
|
|
10218
10148
|
applyParagraphStyle(startIndex, endIndex, paragraphStyle) {
|
|
10219
10149
|
const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
|
|
@@ -10222,12 +10152,9 @@ class EditSession {
|
|
|
10222
10152
|
this.displayData.updateNextLineIndexes(startParagraph, endParagraph);
|
|
10223
10153
|
this.applyToolbarStyles();
|
|
10224
10154
|
}
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
imageComponentRef.instance.initialize();
|
|
10229
|
-
const paragraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, model.insertIndex).row;
|
|
10230
|
-
this.displayData.updateNextLineIndexes(paragraph, paragraph);
|
|
10155
|
+
rerender(insertIndex) {
|
|
10156
|
+
const paragraphIndex = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, insertIndex).row;
|
|
10157
|
+
this.displayData.updateNextLineIndexes(paragraphIndex, paragraphIndex);
|
|
10231
10158
|
}
|
|
10232
10159
|
addNumbering(levels, startIndex, endIndex) {
|
|
10233
10160
|
const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
|
|
@@ -10282,10 +10209,10 @@ class EditSession {
|
|
|
10282
10209
|
const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
|
|
10283
10210
|
const endPosition = ContentHelper.documentIndexToParagraphWithOffset(this.displayData.paragraphs, endIndex);
|
|
10284
10211
|
OperationsHelper.restoreTextStyles(this.model, formats, linkFormats);
|
|
10212
|
+
this.provideTextStyle(startIndex, endIndex);
|
|
10285
10213
|
this.displayData.updateNextLineIndexes(startParagraph, endPosition.row);
|
|
10286
10214
|
this.selection.placeCursor(endPosition);
|
|
10287
10215
|
this.applyToolbarStyles();
|
|
10288
|
-
this.provideTextStyle(startIndex, endIndex);
|
|
10289
10216
|
}
|
|
10290
10217
|
restoreParagraphStyles(paragraphs) {
|
|
10291
10218
|
const startIndex = paragraphs[0].insertIndex;
|
|
@@ -12532,7 +12459,7 @@ class BaseToolbarComponent extends DestroyComponent {
|
|
|
12532
12459
|
}
|
|
12533
12460
|
async onCreateElement(model) {
|
|
12534
12461
|
const data = await model.factoryMethod();
|
|
12535
|
-
const element = new ElementDataModel(model.type, data.
|
|
12462
|
+
const element = new ElementDataModel(model.type, data.guid);
|
|
12536
12463
|
this.createElement.emit(element);
|
|
12537
12464
|
}
|
|
12538
12465
|
checkFontLoadedAndApplyStyle(style) {
|