@talrace/ngx-noder 0.0.47 → 19.0.25
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/README.md +650 -649
- package/fesm2022/talrace-ngx-noder.mjs +191 -63
- package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
- package/lib/editor/components/editor.component.d.ts +3 -1
- package/lib/editor/components/shared/services/overlay.service.d.ts +1 -0
- package/lib/editor/content/display-data/text-line-info.d.ts +1 -0
- package/lib/editor/editor.module.d.ts +6 -0
- package/lib/editor/execution/editor.d.ts +6 -1
- package/lib/editor/gadgets/insert-overlays/insert-overlay-component.interface.d.ts +3 -0
- package/lib/editor/gadgets/insert-overlays/insert-overlays.d.ts +10 -0
- package/lib/editor/interaction/editor.service.d.ts +6 -0
- package/lib/editor/positioning/position.helper.d.ts +3 -0
- package/lib/editor/positioning/selection.d.ts +3 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -30,7 +30,7 @@ import { marker } from '@biesbjerg/ngx-translate-extract-marker';
|
|
|
30
30
|
import * as i7 from '@angular/material/select';
|
|
31
31
|
import { MatSelectModule } from '@angular/material/select';
|
|
32
32
|
import * as i3$2 from '@angular/material/core';
|
|
33
|
-
import * as
|
|
33
|
+
import * as i10 from '@angular/material/sidenav';
|
|
34
34
|
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
35
35
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
36
36
|
import * as i4$1 from '@angular/material/menu';
|
|
@@ -46,7 +46,7 @@ import * as i5$3 from 'ngx-colors';
|
|
|
46
46
|
import { NgxColorsModule } from 'ngx-colors';
|
|
47
47
|
import * as i3$3 from '@angular/material/button-toggle';
|
|
48
48
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
49
|
-
import * as i10 from '@angular/material/checkbox';
|
|
49
|
+
import * as i10$1 from '@angular/material/checkbox';
|
|
50
50
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
51
51
|
import * as i12 from '@angular/material/radio';
|
|
52
52
|
import { MatRadioModule } from '@angular/material/radio';
|
|
@@ -561,6 +561,7 @@ class EditorService {
|
|
|
561
561
|
this._changeImageStyle$ = new Subject();
|
|
562
562
|
this._rerender$ = new Subject();
|
|
563
563
|
this._createCustomComponent$ = new Subject();
|
|
564
|
+
this._replaceByCustomComponent$ = new Subject();
|
|
564
565
|
this._insertBreak$ = new Subject();
|
|
565
566
|
this._insertImage$ = new Subject();
|
|
566
567
|
this._insertLink$ = new Subject();
|
|
@@ -705,6 +706,9 @@ class EditorService {
|
|
|
705
706
|
get createCustomComponent$() {
|
|
706
707
|
return this._createCustomComponent$.asObservable();
|
|
707
708
|
}
|
|
709
|
+
get replaceByCustomComponent$() {
|
|
710
|
+
return this._replaceByCustomComponent$.asObservable();
|
|
711
|
+
}
|
|
708
712
|
get insertBreak$() {
|
|
709
713
|
return this._insertBreak$.asObservable();
|
|
710
714
|
}
|
|
@@ -941,6 +945,9 @@ class EditorService {
|
|
|
941
945
|
createCustomComponent(model) {
|
|
942
946
|
this._createCustomComponent$.next(model);
|
|
943
947
|
}
|
|
948
|
+
replaceByCustomComponent(textKey, model) {
|
|
949
|
+
this._replaceByCustomComponent$.next({ textKey, model });
|
|
950
|
+
}
|
|
944
951
|
insertBreak(value) {
|
|
945
952
|
this._insertBreak$.next(value);
|
|
946
953
|
}
|
|
@@ -1711,11 +1718,11 @@ class OverlayService {
|
|
|
1711
1718
|
this.openedSubscription = fromEvent(document, 'mousedown')
|
|
1712
1719
|
.pipe(filter(event => {
|
|
1713
1720
|
const clickTarget = event.target;
|
|
1714
|
-
return this.overlayRef &&
|
|
1721
|
+
return (this.overlayRef &&
|
|
1722
|
+
!this.overlayRef.overlayElement.contains(clickTarget) &&
|
|
1723
|
+
this.overlayRef.overlayElement.parentElement.parentElement.children.length === 1);
|
|
1715
1724
|
}), take(1))
|
|
1716
|
-
.subscribe(() =>
|
|
1717
|
-
this.close();
|
|
1718
|
-
});
|
|
1725
|
+
.subscribe(() => this.close());
|
|
1719
1726
|
}
|
|
1720
1727
|
getOverlayConfig(xPosition, yPosition) {
|
|
1721
1728
|
return new OverlayConfig({
|
|
@@ -1728,6 +1735,16 @@ class OverlayService {
|
|
|
1728
1735
|
getOverlayPosition(xPosition, yPosition) {
|
|
1729
1736
|
return this.overlay.position().global().left(`${xPosition}px`).top(`${yPosition}px`);
|
|
1730
1737
|
}
|
|
1738
|
+
scroll(deltaY) {
|
|
1739
|
+
// todo: close overlay when out of visible area
|
|
1740
|
+
if (!this.overlayRef) {
|
|
1741
|
+
return;
|
|
1742
|
+
}
|
|
1743
|
+
const x = this.overlayRef.overlayElement.offsetLeft;
|
|
1744
|
+
const y = this.overlayRef.overlayElement.offsetTop - deltaY;
|
|
1745
|
+
const strategy = this.overlay.position().global().left(`${x}px`).top(`${y}px`);
|
|
1746
|
+
this.overlayRef.updatePositionStrategy(strategy);
|
|
1747
|
+
}
|
|
1731
1748
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OverlayService, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1732
1749
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OverlayService }); }
|
|
1733
1750
|
}
|
|
@@ -4832,7 +4849,7 @@ class TableOperationsHelper {
|
|
|
4832
4849
|
return null;
|
|
4833
4850
|
}
|
|
4834
4851
|
return new ApplyTableCellsStylesModel({
|
|
4835
|
-
cellsData: this.getCellDataFromBorderCells(cellsMap, new BordersStyleModel({ lineStyle: style })),
|
|
4852
|
+
cellsData: this.getCellDataFromBorderCells(cellsMap, (oldBorder) => new BordersStyleModel({ ...oldBorder, ...new BordersStyleModel({ lineStyle: style }) })),
|
|
4836
4853
|
insertIndex: table.insertIndex
|
|
4837
4854
|
});
|
|
4838
4855
|
}
|
|
@@ -4847,13 +4864,13 @@ class TableOperationsHelper {
|
|
|
4847
4864
|
return null;
|
|
4848
4865
|
}
|
|
4849
4866
|
return new ApplyTableCellsStylesModel({
|
|
4850
|
-
cellsData: this.getCellDataFromBorderCells(cellsMap, new BordersStyleModel({ width })),
|
|
4867
|
+
cellsData: this.getCellDataFromBorderCells(cellsMap, (oldBorder) => new BordersStyleModel({ ...oldBorder, ...new BordersStyleModel({ width }) })),
|
|
4851
4868
|
insertIndex: table.insertIndex
|
|
4852
4869
|
});
|
|
4853
4870
|
}
|
|
4854
4871
|
static getApplyTableCellsBorders(border, table, selection) {
|
|
4855
4872
|
let cellsMap = new Map();
|
|
4856
|
-
let targetBorderStyle = new BordersStyleModel(
|
|
4873
|
+
let targetBorderStyle = new BordersStyleModel();
|
|
4857
4874
|
switch (border) {
|
|
4858
4875
|
case Borders.Top:
|
|
4859
4876
|
// Upper border - only for the top row and their upper neighbors
|
|
@@ -4918,8 +4935,15 @@ class TableOperationsHelper {
|
|
|
4918
4935
|
if (!cellsMap.size) {
|
|
4919
4936
|
return null;
|
|
4920
4937
|
}
|
|
4938
|
+
const getNewBorder = (oldBorder) => {
|
|
4939
|
+
if (!targetBorderStyle.lineStyle) {
|
|
4940
|
+
targetBorderStyle.lineStyle =
|
|
4941
|
+
oldBorder.lineStyle && oldBorder.lineStyle !== LineStyles.Nil ? oldBorder.lineStyle : LineStyles.Single;
|
|
4942
|
+
}
|
|
4943
|
+
return new BordersStyleModel({ ...oldBorder, ...targetBorderStyle });
|
|
4944
|
+
};
|
|
4921
4945
|
return new ApplyTableCellsStylesModel({
|
|
4922
|
-
cellsData: this.getCellDataFromBorderCells(cellsMap,
|
|
4946
|
+
cellsData: this.getCellDataFromBorderCells(cellsMap, getNewBorder),
|
|
4923
4947
|
insertIndex: table.insertIndex
|
|
4924
4948
|
});
|
|
4925
4949
|
}
|
|
@@ -4981,7 +5005,7 @@ class TableOperationsHelper {
|
|
|
4981
5005
|
cellsMap.set(key, { cell, rowIndex, cellIndex, updatePositions: [...positions] });
|
|
4982
5006
|
}
|
|
4983
5007
|
}
|
|
4984
|
-
static getCellDataFromBorderCells(cellsMap,
|
|
5008
|
+
static getCellDataFromBorderCells(cellsMap, getNewBorder) {
|
|
4985
5009
|
if (!cellsMap.size) {
|
|
4986
5010
|
return [];
|
|
4987
5011
|
}
|
|
@@ -4993,7 +5017,7 @@ class TableOperationsHelper {
|
|
|
4993
5017
|
cellData.updatePositions.forEach(x => {
|
|
4994
5018
|
const border = existingBorders.find(y => y.position === x) ??
|
|
4995
5019
|
new BordersStyleModel({ position: x, lineStyle: LineStyles.Single, width: 1 });
|
|
4996
|
-
newBorders.push(
|
|
5020
|
+
newBorders.push(getNewBorder(border));
|
|
4997
5021
|
});
|
|
4998
5022
|
// Add existing borders without updates
|
|
4999
5023
|
existingBorders
|
|
@@ -5736,8 +5760,8 @@ class PositionHelper {
|
|
|
5736
5760
|
const paragraph = paragraphs[paragraphInfo.paragraphIndex];
|
|
5737
5761
|
const paragraphTop = paragraph.paragraphSettings.distanceFromTop || 0;
|
|
5738
5762
|
const linePaddingLeft = paragraph.paragraphSettings.textLinesInfo[paragraphInfo.lineIndex].paddingLeft;
|
|
5739
|
-
const markerWidth = paragraphInfo.lineIndex === 0 ? (paragraph.paragraphSettings.textLinesInfo[paragraphInfo.lineIndex].markerWidth ?? 0) : 0;
|
|
5740
5763
|
const offsetMargin = paragraph.paragraphSettings.textLinesInfo[paragraphInfo.lineIndex].offsetMargin;
|
|
5764
|
+
const markerWidth = this.getMarkerWidth(paragraph.paragraphSettings, paragraph.paragraphSettings.textLinesInfo[0], paragraphInfo.lineIndex);
|
|
5741
5765
|
return {
|
|
5742
5766
|
pageX: lineWidthToPosition + linePaddingLeft + offsetMargin + markerWidth,
|
|
5743
5767
|
pageY: paragraphTop + paragraphInfo.lineTopOffset - session.scrollTop,
|
|
@@ -5789,7 +5813,7 @@ class PositionHelper {
|
|
|
5789
5813
|
return { line, indexInLine: 0 };
|
|
5790
5814
|
}
|
|
5791
5815
|
let indexInLine = 0;
|
|
5792
|
-
const markerWidth =
|
|
5816
|
+
const markerWidth = this.getMarkerWidth(paragraphSettings, lineInfo, lineIndex);
|
|
5793
5817
|
let relativeX = xPixel - leftOffset - marginLeft - lineInfo.paddingLeft - lineInfo.offsetMargin - markerWidth;
|
|
5794
5818
|
const wordSpacing = lineInfo.wordSpacing ?? 0;
|
|
5795
5819
|
while (indexInLine < tokens.length) {
|
|
@@ -5817,7 +5841,7 @@ class PositionHelper {
|
|
|
5817
5841
|
return { line, indexInLine: 0 };
|
|
5818
5842
|
}
|
|
5819
5843
|
let indexInLine = 0;
|
|
5820
|
-
const markerWidth =
|
|
5844
|
+
const markerWidth = this.getMarkerWidth(paragraphSettings, lineInfo, lineIndex);
|
|
5821
5845
|
let relativeX = xPixel - leftOffset - marginLeft - lineInfo.paddingLeft - lineInfo.offsetMargin - markerWidth;
|
|
5822
5846
|
const wordSpacing = lineInfo.wordSpacing ?? 0;
|
|
5823
5847
|
while (indexInLine < tokens.length) {
|
|
@@ -5856,7 +5880,7 @@ class PositionHelper {
|
|
|
5856
5880
|
}
|
|
5857
5881
|
const textLineInfo = paragraphs[paragraphIndex].paragraphSettings.textLinesInfo[lineIndex];
|
|
5858
5882
|
const wordSpacing = textLineInfo.wordSpacing ?? 0;
|
|
5859
|
-
const markerWidth =
|
|
5883
|
+
const markerWidth = this.getMarkerWidth(paragraphs[paragraphIndex].paragraphSettings, textLineInfo, lineIndex);
|
|
5860
5884
|
let width = positionWidth - textLineInfo.paddingLeft - marginLeft - textLineInfo.offsetMargin - markerWidth;
|
|
5861
5885
|
while (column < tokens.length) {
|
|
5862
5886
|
const token = tokens[column];
|
|
@@ -5869,6 +5893,18 @@ class PositionHelper {
|
|
|
5869
5893
|
}
|
|
5870
5894
|
return column;
|
|
5871
5895
|
}
|
|
5896
|
+
static getMarkerWidth(paragraphSettings, textLineInfo, lineIndex) {
|
|
5897
|
+
const numberingOffsetLeft = paragraphSettings.numberingData.numberingId === null
|
|
5898
|
+
? 0
|
|
5899
|
+
: paragraphSettings.numberingData.width + paragraphSettings.numberingData.paddingLeft;
|
|
5900
|
+
if (lineIndex === 0 &&
|
|
5901
|
+
(textLineInfo.indentFirstLine ||
|
|
5902
|
+
(numberingOffsetLeft - textLineInfo.indentLeft > 0 &&
|
|
5903
|
+
numberingOffsetLeft - textLineInfo.indentLeft < textLineInfo.markerWidth))) {
|
|
5904
|
+
return textLineInfo.markerWidth;
|
|
5905
|
+
}
|
|
5906
|
+
return 0;
|
|
5907
|
+
}
|
|
5872
5908
|
}
|
|
5873
5909
|
|
|
5874
5910
|
class DistanceModel {
|
|
@@ -5971,7 +6007,13 @@ class RenderingHelper {
|
|
|
5971
6007
|
const numberingOffsetLeft = currentParagraph.numberingData.numberingId === null
|
|
5972
6008
|
? 0
|
|
5973
6009
|
: currentParagraph.numberingData.width + currentParagraph.numberingData.paddingLeft;
|
|
5974
|
-
let
|
|
6010
|
+
let markerWidth = 0;
|
|
6011
|
+
if (currentParagraph.textLinesInfo[0].indentFirstLine ||
|
|
6012
|
+
(numberingOffsetLeft - currentParagraph.textLinesInfo[0].indentLeft > 0 &&
|
|
6013
|
+
numberingOffsetLeft - currentParagraph.textLinesInfo[0].indentLeft < currentParagraph.textLinesInfo[0].markerWidth)) {
|
|
6014
|
+
markerWidth = currentParagraph.textLinesInfo[0].markerWidth;
|
|
6015
|
+
}
|
|
6016
|
+
let lineEl = RenderingHelper.createLineElement(currentParagraph.textLinesInfo[splitIndex], numberingOffsetLeft - markerWidth, scalingRatio);
|
|
5975
6017
|
domContent.parentNode.appendChild(lineEl);
|
|
5976
6018
|
const valueFragment = DomHelper.createFragment(domContent.currentElement);
|
|
5977
6019
|
let isLastLineFragment = false;
|
|
@@ -6836,13 +6878,17 @@ class TextLayer {
|
|
|
6836
6878
|
this.renderingHelper.renderContentWrappedLine({ currentElement: this.element, parentNode: linesContainerElement }, splits, paragraphSettings, combinedFormats, distance, this.session.customContentService, this.session.customComponents, this.session.generalProperties.scalingRatio, this.session.model.breaks);
|
|
6837
6879
|
}
|
|
6838
6880
|
else {
|
|
6881
|
+
const markerWidth = paragraphSettings.textLinesInfo[0].indentFirstLine ? paragraphSettings.textLinesInfo[0].markerWidth : 0;
|
|
6839
6882
|
const numberingOffsetLeft = paragraphSettings.numberingData.numberingId === null
|
|
6840
6883
|
? 0
|
|
6841
|
-
: paragraphSettings.numberingData.width +
|
|
6842
|
-
|
|
6843
|
-
|
|
6884
|
+
: paragraphSettings.numberingData.width + paragraphSettings.numberingData.paddingLeft - markerWidth;
|
|
6885
|
+
let offset = 0;
|
|
6886
|
+
if (numberingOffsetLeft - paragraphSettings.textLinesInfo[0].indentLeft > 0 &&
|
|
6887
|
+
numberingOffsetLeft - paragraphSettings.textLinesInfo[0].indentLeft < paragraphSettings.textLinesInfo[0].markerWidth) {
|
|
6888
|
+
offset = paragraphSettings.textLinesInfo[0].markerWidth;
|
|
6889
|
+
}
|
|
6844
6890
|
const lineInfo = paragraphSettings.textLinesInfo[0];
|
|
6845
|
-
const lastLineEl = this.renderingHelper.createLineElement(lineInfo, numberingOffsetLeft, this.session.generalProperties.scalingRatio);
|
|
6891
|
+
const lastLineEl = this.renderingHelper.createLineElement(lineInfo, numberingOffsetLeft - offset, this.session.generalProperties.scalingRatio);
|
|
6846
6892
|
linesContainerElement.appendChild(lastLineEl);
|
|
6847
6893
|
const rowDistance = new DistanceModel({ start: startIndex, end: endIndex });
|
|
6848
6894
|
this.renderingHelper.renderContentSimpleLine({ currentElement: this.element, parentNode: lastLineEl }, combinedFormats, rowDistance, this.session.customContentService, this.session.customComponents, lineInfo, this.session.model.breaks);
|
|
@@ -7726,13 +7772,6 @@ class Search {
|
|
|
7726
7772
|
}
|
|
7727
7773
|
|
|
7728
7774
|
class Selection {
|
|
7729
|
-
constructor() {
|
|
7730
|
-
this.anchor = null;
|
|
7731
|
-
this.cursor = new CursorParagraph(0, 0);
|
|
7732
|
-
this.isDisabled = false;
|
|
7733
|
-
this.focusedComponent = null;
|
|
7734
|
-
this.keepLinePositionX = null;
|
|
7735
|
-
}
|
|
7736
7775
|
get isFocused() {
|
|
7737
7776
|
return !!this.focusedComponent;
|
|
7738
7777
|
}
|
|
@@ -7757,6 +7796,14 @@ class Selection {
|
|
|
7757
7796
|
const anchor = new CursorParagraph(this.anchor.row, this.anchor.column);
|
|
7758
7797
|
return this.isBackwards ? new Range(cursor, anchor) : new Range(anchor, cursor);
|
|
7759
7798
|
}
|
|
7799
|
+
constructor(overlayService) {
|
|
7800
|
+
this.overlayService = overlayService;
|
|
7801
|
+
this.anchor = null;
|
|
7802
|
+
this.cursor = new CursorParagraph(0, 0);
|
|
7803
|
+
this.isDisabled = false;
|
|
7804
|
+
this.focusedComponent = null;
|
|
7805
|
+
this.keepLinePositionX = null;
|
|
7806
|
+
}
|
|
7760
7807
|
focus(component, position) {
|
|
7761
7808
|
if (component === this.focusedComponent) {
|
|
7762
7809
|
return;
|
|
@@ -7773,17 +7820,15 @@ class Selection {
|
|
|
7773
7820
|
this.focusedComponent = null;
|
|
7774
7821
|
}
|
|
7775
7822
|
placeCursor(cursor) {
|
|
7776
|
-
this.cursor = cursor;
|
|
7777
7823
|
this.anchor = null;
|
|
7778
|
-
this.
|
|
7779
|
-
this.focusedComponent?.instance.blur();
|
|
7780
|
-
this.focusedComponent = null;
|
|
7824
|
+
this.moveCursor(cursor);
|
|
7781
7825
|
}
|
|
7782
7826
|
moveCursor(cursor) {
|
|
7783
7827
|
this.cursor = cursor;
|
|
7784
7828
|
this.keepLinePositionX = null;
|
|
7785
7829
|
this.focusedComponent?.instance.blur();
|
|
7786
7830
|
this.focusedComponent = null;
|
|
7831
|
+
this.overlayService.close();
|
|
7787
7832
|
}
|
|
7788
7833
|
placeSelection(cursor, anchor) {
|
|
7789
7834
|
this.cursor = cursor;
|
|
@@ -7791,6 +7836,7 @@ class Selection {
|
|
|
7791
7836
|
this.keepLinePositionX = null;
|
|
7792
7837
|
this.focusedComponent?.instance.blur();
|
|
7793
7838
|
this.focusedComponent = null;
|
|
7839
|
+
this.overlayService.close();
|
|
7794
7840
|
}
|
|
7795
7841
|
moveSelection(position) {
|
|
7796
7842
|
if (!this.anchor) {
|
|
@@ -7803,6 +7849,7 @@ class Selection {
|
|
|
7803
7849
|
this.keepLinePositionX = null;
|
|
7804
7850
|
this.focusedComponent?.instance.blur();
|
|
7805
7851
|
this.focusedComponent = null;
|
|
7852
|
+
this.overlayService.close();
|
|
7806
7853
|
}
|
|
7807
7854
|
disableSelection() {
|
|
7808
7855
|
this.isDisabled = true;
|
|
@@ -8177,7 +8224,7 @@ class Editor {
|
|
|
8177
8224
|
get grammarChecker() {
|
|
8178
8225
|
return this.regulatorService.grammarChecker;
|
|
8179
8226
|
}
|
|
8180
|
-
constructor(model, container, editorService, overlayService, regulatorService, commandsService, clipboard, externalElementTagNames, customPageWidth) {
|
|
8227
|
+
constructor(model, container, editorService, overlayService, regulatorService, commandsService, clipboard, externalElementTagNames, insertOverlays, customPageWidth) {
|
|
8181
8228
|
this.model = model;
|
|
8182
8229
|
this.container = container;
|
|
8183
8230
|
this.editorService = editorService;
|
|
@@ -8186,6 +8233,7 @@ class Editor {
|
|
|
8186
8233
|
this.commandsService = commandsService;
|
|
8187
8234
|
this.clipboard = clipboard;
|
|
8188
8235
|
this.externalElementTagNames = externalElementTagNames;
|
|
8236
|
+
this.insertOverlays = insertOverlays;
|
|
8189
8237
|
this.customPageWidth = customPageWidth;
|
|
8190
8238
|
this.MAX_COUNT = 999;
|
|
8191
8239
|
this.parentTagName = 'APP-NOD-EDITOR';
|
|
@@ -8207,7 +8255,7 @@ class Editor {
|
|
|
8207
8255
|
this.subscriptions.push(this.receiveTextStyleSubscription());
|
|
8208
8256
|
this.customElementTagNames = [...this.externalElementTagNames, this.imageTagName, this.tableCellTagName, this.edgeElementTagName];
|
|
8209
8257
|
this.history = new OperationHistory(editorService, regulatorService);
|
|
8210
|
-
this.selection = new Selection();
|
|
8258
|
+
this.selection = new Selection(this.overlayService);
|
|
8211
8259
|
this.regulatorService.setSelection(this.selection);
|
|
8212
8260
|
this.initMainSession();
|
|
8213
8261
|
this.textInput = new TextInput(this.mainRenderer.container);
|
|
@@ -8221,7 +8269,7 @@ class Editor {
|
|
|
8221
8269
|
this.focus();
|
|
8222
8270
|
this.session.applyToolbarStyles();
|
|
8223
8271
|
this.search = new Search(editorService);
|
|
8224
|
-
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.updateTableBorderStyleSubscription(), this.updateTableBorderWidthSubscription(), this.updateTableBordersSubscription(), this.insertTextSubscription(), this.pasteFromClipboardSubscription(), this.printSubscription(), this.redoSubscription(), this.removeLeftSubscription(), this.removeNumberingsSubscription(), this.removeRightSubscription(), this.removeSelectedSubscription(), this.removeTableColumnsSubscription(), this.removeTableRowsSubscription(), this.removeTableSubscription(), this.rerenderSubscription(), this.resizeTableColumnsSubscription(), ...this.searchOptionSubscriptions(), ...this.replaceSubscription(), this.grammarReplaceSubscription(), this.ignoreGrammarErrorSubscription(), this.selectAllSubscription(), this.setImageStyleSubscription(), this.setNumberingTemplateTypeSubscription(), this.setParagraphStylesSubscription(), this.setTextStylesSubscription(), this.undoSubscription(), this.updateEdgeSubscription(), this.viewOnlyModeSubscription(), this.applyPageFormatSubscription(), this.applyRightMarginPageFormatSubscription(), this.applyLeftMarginPageFormatSubscription(), this.insertPageFormatSubscription(), this.applyDocumentPageFormatSubscription(), this.dragMoveSubscription(), this.dragDropSubscription(), this.applyFirstLinePositionSubscription(), this.applyRightIndentParagraphSubscription(), this.applyLeftIndentParagraphSubscription(), this.applyTabSettingsSubscription(), this.commandCreatedForEdges());
|
|
8272
|
+
this.subscriptions.push(this.changedEdgeSizeSubscription(), this.changedEdgeSubscription(), this.changedTableSizeSubscription(), this.clipboardDataSubscription(), this.copySelectedSubscription(), this.createCustomComponentSubscription(), this.replaceByCustomComponentSubscription(), this.cutSelectedSubscription(), this.disableSelectionSubscription(), this.endMousePressSubscription(), this.imageLoadedSubscription(), this.insertBreakSubscription(), this.insertImageSubscription(), this.insertLinkSubscription(), this.insertTableColumnsSubscription(), this.insertTableRowsSubscription(), this.insertTableSubscription(), this.updateTableBorderStyleSubscription(), this.updateTableBorderWidthSubscription(), this.updateTableBordersSubscription(), this.insertTextSubscription(), this.pasteFromClipboardSubscription(), this.printSubscription(), this.redoSubscription(), this.removeLeftSubscription(), this.removeNumberingsSubscription(), this.removeRightSubscription(), this.removeSelectedSubscription(), this.removeTableColumnsSubscription(), this.removeTableRowsSubscription(), this.removeTableSubscription(), this.rerenderSubscription(), this.resizeTableColumnsSubscription(), ...this.searchOptionSubscriptions(), ...this.replaceSubscription(), this.grammarReplaceSubscription(), this.ignoreGrammarErrorSubscription(), this.selectAllSubscription(), this.setImageStyleSubscription(), this.setNumberingTemplateTypeSubscription(), this.setParagraphStylesSubscription(), this.setTextStylesSubscription(), this.undoSubscription(), this.updateEdgeSubscription(), this.viewOnlyModeSubscription(), this.applyPageFormatSubscription(), this.applyRightMarginPageFormatSubscription(), this.applyLeftMarginPageFormatSubscription(), this.insertPageFormatSubscription(), this.applyDocumentPageFormatSubscription(), this.dragMoveSubscription(), this.dragDropSubscription(), this.applyFirstLinePositionSubscription(), this.applyRightIndentParagraphSubscription(), this.applyLeftIndentParagraphSubscription(), this.applyTabSettingsSubscription(), this.commandCreatedForEdges());
|
|
8225
8273
|
}
|
|
8226
8274
|
destroy() {
|
|
8227
8275
|
this.subscriptions.forEach(s => s?.unsubscribe());
|
|
@@ -8269,6 +8317,17 @@ class Editor {
|
|
|
8269
8317
|
this.scrollCursorIntoMainView(0.5);
|
|
8270
8318
|
this.onSelectionChange();
|
|
8271
8319
|
}
|
|
8320
|
+
showInsertOverlay(textKey) {
|
|
8321
|
+
const component = this.insertOverlays.getComponent(textKey);
|
|
8322
|
+
if (!component) {
|
|
8323
|
+
return;
|
|
8324
|
+
}
|
|
8325
|
+
const cursor = PositionHelper.documentToPixel(this.session, this.session.selection.cursor);
|
|
8326
|
+
const rect = this.renderer.container.getBoundingClientRect();
|
|
8327
|
+
const x = rect.left + cursor.pageX;
|
|
8328
|
+
const y = rect.top + cursor.pageY + cursor.lineHeight;
|
|
8329
|
+
this.overlayService.open(component, { textKey }, x, y);
|
|
8330
|
+
}
|
|
8272
8331
|
cut() {
|
|
8273
8332
|
this.removeSelected();
|
|
8274
8333
|
}
|
|
@@ -8337,6 +8396,7 @@ class Editor {
|
|
|
8337
8396
|
this.renderer.updateCursor();
|
|
8338
8397
|
this.rerenderMarker();
|
|
8339
8398
|
this.scrollCursorIntoMainView(0.1);
|
|
8399
|
+
this.onContentChange();
|
|
8340
8400
|
}
|
|
8341
8401
|
insertTab() {
|
|
8342
8402
|
const insertIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs, this.selection.range.start);
|
|
@@ -8345,6 +8405,18 @@ class Editor {
|
|
|
8345
8405
|
this.replaceBy(new ReplaceModel({ insertTab }));
|
|
8346
8406
|
return;
|
|
8347
8407
|
}
|
|
8408
|
+
if (this.selection.range.start.column === 0) {
|
|
8409
|
+
const paragraph = this.session.displayData.paragraphs[this.selection.range.start.row];
|
|
8410
|
+
if (paragraph.paragraphSettings.numberingData.numberingId) {
|
|
8411
|
+
this.applyParagraphStyles(new ParagraphStyleModel({
|
|
8412
|
+
numberingLevel: paragraph.paragraphSettings.numberingData.level + 1,
|
|
8413
|
+
indentLeft: 0,
|
|
8414
|
+
indentFirstLine: 0,
|
|
8415
|
+
indentHanging: 0
|
|
8416
|
+
}));
|
|
8417
|
+
return;
|
|
8418
|
+
}
|
|
8419
|
+
}
|
|
8348
8420
|
this.saveInsertTabToHistory(insertTab);
|
|
8349
8421
|
const endPoint = this.session.insertTab(this.selection.cursor);
|
|
8350
8422
|
this.onDocumentChange(new Range(this.selection.cursor, endPoint));
|
|
@@ -8366,6 +8438,7 @@ class Editor {
|
|
|
8366
8438
|
this.renderer.updateLines(this.selection.cursor.row, lastRow);
|
|
8367
8439
|
this.renderer.updateCursor();
|
|
8368
8440
|
this.rerenderMarker();
|
|
8441
|
+
this.onContentChange();
|
|
8369
8442
|
}
|
|
8370
8443
|
insertLink(linkDataModel) {
|
|
8371
8444
|
const insertIndex = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs, this.selection.range.start);
|
|
@@ -8378,6 +8451,7 @@ class Editor {
|
|
|
8378
8451
|
this.session.insertLink(this.selection.cursor, linkDataModel);
|
|
8379
8452
|
this.renderer.updateCursor();
|
|
8380
8453
|
this.rerenderMarker();
|
|
8454
|
+
this.onContentChange();
|
|
8381
8455
|
}
|
|
8382
8456
|
insertTable(tableData) {
|
|
8383
8457
|
const start = this.selection.range.start;
|
|
@@ -8419,6 +8493,7 @@ class Editor {
|
|
|
8419
8493
|
const selection = tableComponent.tableSelection.selectionRange
|
|
8420
8494
|
? tableComponent.tableSelection.selectionRange
|
|
8421
8495
|
: new SelectionRangeModel({ startIndex: source.cellComponent.rowIndex, endIndex: source.cellComponent.rowIndex }, { startIndex: source.cellComponent.cellIndex, endIndex: source.cellComponent.cellIndex });
|
|
8496
|
+
tableComponent.tableSelection.removeMouseSubscriptions();
|
|
8422
8497
|
const applyModel = handler(data, tableComponent.table, selection);
|
|
8423
8498
|
if (!applyModel) {
|
|
8424
8499
|
return;
|
|
@@ -8432,6 +8507,7 @@ class Editor {
|
|
|
8432
8507
|
// restore table cells selection and highlight
|
|
8433
8508
|
this.selection.disableSelection();
|
|
8434
8509
|
tableComponent.tableSelection.selectionRange = selection;
|
|
8510
|
+
tableComponent.tableSelection.addDocumentMouseDownSubscriptions();
|
|
8435
8511
|
tableComponent.tableSelection.highlightCurrentSelectionCells();
|
|
8436
8512
|
}
|
|
8437
8513
|
replaceBy(model) {
|
|
@@ -8953,6 +9029,15 @@ class Editor {
|
|
|
8953
9029
|
this.onSelectionChange();
|
|
8954
9030
|
this.onContentChange();
|
|
8955
9031
|
}
|
|
9032
|
+
replaceByCustomElement(textKey, model) {
|
|
9033
|
+
const index = ContentHelper.paragraphPositionToDocumentIndex(this.session.displayData.paragraphs, this.selection.cursor);
|
|
9034
|
+
const text = this.session.model.content.slice(index - textKey.length, index);
|
|
9035
|
+
if (text === textKey) {
|
|
9036
|
+
const position = new CursorParagraph(this.selection.cursor.row, this.selection.cursor.column - textKey.length);
|
|
9037
|
+
this.selection.moveSelection(position);
|
|
9038
|
+
}
|
|
9039
|
+
this.createCustomElement(model);
|
|
9040
|
+
}
|
|
8956
9041
|
removeSelected() {
|
|
8957
9042
|
const range = this.selection.range;
|
|
8958
9043
|
const isNumbering = this.session.paragraphIsNumbering(range.end.row);
|
|
@@ -9014,6 +9099,7 @@ class Editor {
|
|
|
9014
9099
|
}
|
|
9015
9100
|
this.insert(text);
|
|
9016
9101
|
this.scrollCursorIntoMainView();
|
|
9102
|
+
this.showInsertOverlay(text);
|
|
9017
9103
|
}
|
|
9018
9104
|
onCut(event) {
|
|
9019
9105
|
event.preventDefault();
|
|
@@ -9112,16 +9198,13 @@ class Editor {
|
|
|
9112
9198
|
this.onSelectionChange();
|
|
9113
9199
|
const paragraph = this.session.displayData.paragraphs[position.row];
|
|
9114
9200
|
const error = this.grammarChecker.getError(this.session.sessionId, paragraph.id, position.column);
|
|
9115
|
-
if (!this.editorService.isViewOnly && error
|
|
9116
|
-
const
|
|
9117
|
-
const
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
this.overlayService.open(GrammarPopupComponent, { error, paragraphIndex: position.row }, event.clientX - 100, hintTop);
|
|
9123
|
-
event.stopPropagation();
|
|
9124
|
-
}
|
|
9201
|
+
if (!this.editorService.isViewOnly && error) {
|
|
9202
|
+
const cursor = PositionHelper.documentToPixel(this.session, this.session.selection.cursor);
|
|
9203
|
+
const rect = this.renderer.container.getBoundingClientRect();
|
|
9204
|
+
const hintLeft = rect.left + cursor.pageX;
|
|
9205
|
+
const hintTop = rect.top + cursor.pageY - POPUP_HEIGHT;
|
|
9206
|
+
this.overlayService.open(GrammarPopupComponent, { error, paragraphIndex: position.row }, hintLeft - 100, hintTop);
|
|
9207
|
+
event.stopPropagation();
|
|
9125
9208
|
}
|
|
9126
9209
|
event.preventDefault();
|
|
9127
9210
|
if (event.ctrlKey) {
|
|
@@ -9198,7 +9281,7 @@ class Editor {
|
|
|
9198
9281
|
const scrollSpeed = 4;
|
|
9199
9282
|
const deltaY = event.deltaY * factor * scrollSpeed;
|
|
9200
9283
|
this.onScroll(deltaY);
|
|
9201
|
-
this.overlayService.
|
|
9284
|
+
this.overlayService.scroll(deltaY);
|
|
9202
9285
|
event.stopPropagation();
|
|
9203
9286
|
event.preventDefault();
|
|
9204
9287
|
}
|
|
@@ -9360,7 +9443,6 @@ class Editor {
|
|
|
9360
9443
|
this.rerenderMarker();
|
|
9361
9444
|
}
|
|
9362
9445
|
onContentChange() {
|
|
9363
|
-
this.overlayService.close();
|
|
9364
9446
|
if (this.search.term) {
|
|
9365
9447
|
this.find(this.search.term);
|
|
9366
9448
|
}
|
|
@@ -9409,6 +9491,7 @@ class Editor {
|
|
|
9409
9491
|
session.displayData.updateNextLineIndexes(paragraph, paragraph);
|
|
9410
9492
|
session.displayData.updateNumberingsDataOnChange(paragraph + 1);
|
|
9411
9493
|
this.focus();
|
|
9494
|
+
this.onContentChange();
|
|
9412
9495
|
}
|
|
9413
9496
|
insertTableRows(insertIndex, rowsCount, targetIndex, inheritIndex, sessionId) {
|
|
9414
9497
|
this.regulatorService.setCustomSessionAsCurrent(sessionId);
|
|
@@ -9418,6 +9501,7 @@ class Editor {
|
|
|
9418
9501
|
this.commandsService.createCommand(SaveCommandsHelper.getInsertTableRowsCommand(rowsCount, inheritIndex, insertIndex, targetIndex, this.targets));
|
|
9419
9502
|
this.session.insertTableRows(insertIndex, rowsCount, targetIndex, inheritIndex);
|
|
9420
9503
|
this.changedTableSize(insertIndex, sessionId);
|
|
9504
|
+
this.onContentChange();
|
|
9421
9505
|
}
|
|
9422
9506
|
insertTableColumns(insertIndex, columnsCount, targetIndex, inheritIndex, sessionId) {
|
|
9423
9507
|
this.regulatorService.setCustomSessionAsCurrent(sessionId);
|
|
@@ -9427,6 +9511,7 @@ class Editor {
|
|
|
9427
9511
|
this.commandsService.createCommand(SaveCommandsHelper.getInsertTableColumnsCommand(columnsCount, inheritIndex, insertIndex, targetIndex, this.targets));
|
|
9428
9512
|
this.session.insertTableColumns(insertIndex, columnsCount, targetIndex, inheritIndex);
|
|
9429
9513
|
this.changedTableSize(insertIndex, sessionId);
|
|
9514
|
+
this.onContentChange();
|
|
9430
9515
|
}
|
|
9431
9516
|
removeTableRows(insertIndex, startIndex, endIndex, sessionId) {
|
|
9432
9517
|
this.regulatorService.setCustomSessionAsCurrent(sessionId);
|
|
@@ -9436,6 +9521,7 @@ class Editor {
|
|
|
9436
9521
|
this.commandsService.createCommand(SaveCommandsHelper.getRemoveTableRowsCommand(startIndex, endIndex, insertIndex, this.targets));
|
|
9437
9522
|
this.session.removeTableRows(insertIndex, startIndex, endIndex);
|
|
9438
9523
|
this.changedTableSize(insertIndex, sessionId);
|
|
9524
|
+
this.onContentChange();
|
|
9439
9525
|
}
|
|
9440
9526
|
removeTableColumns(insertIndex, startIndex, endIndex, sessionId) {
|
|
9441
9527
|
this.regulatorService.setCustomSessionAsCurrent(sessionId);
|
|
@@ -9445,6 +9531,7 @@ class Editor {
|
|
|
9445
9531
|
this.commandsService.createCommand(SaveCommandsHelper.getRemoveTableColumnsCommand(startIndex, endIndex, insertIndex, this.targets));
|
|
9446
9532
|
this.session.removeTableColumns(insertIndex, startIndex, endIndex);
|
|
9447
9533
|
this.changedTableSize(insertIndex, sessionId);
|
|
9534
|
+
this.onContentChange();
|
|
9448
9535
|
}
|
|
9449
9536
|
resizeTableColumns(resizeTableColumns, sessionId) {
|
|
9450
9537
|
this.regulatorService.setCustomSessionAsCurrent(sessionId);
|
|
@@ -9454,6 +9541,7 @@ class Editor {
|
|
|
9454
9541
|
this.commandsService.createCommand(SaveCommandsHelper.getResizeTableColumnsCommand(resizeTableColumns, this.targets));
|
|
9455
9542
|
this.session.resizeTableColumns(resizeTableColumns);
|
|
9456
9543
|
this.changedTableSize(resizeTableColumns.insertIndex, sessionId);
|
|
9544
|
+
this.onContentChange();
|
|
9457
9545
|
}
|
|
9458
9546
|
onMousePressedMove(event) {
|
|
9459
9547
|
const position = this.renderer.screenToTextCoordinatesUsingMidpoint(event.clientX, event.clientY);
|
|
@@ -9651,6 +9739,12 @@ class Editor {
|
|
|
9651
9739
|
this.focus();
|
|
9652
9740
|
});
|
|
9653
9741
|
}
|
|
9742
|
+
replaceByCustomComponentSubscription() {
|
|
9743
|
+
return this.editorService.replaceByCustomComponent$.subscribe(data => {
|
|
9744
|
+
this.replaceByCustomElement(data.textKey, data.model);
|
|
9745
|
+
this.focus();
|
|
9746
|
+
});
|
|
9747
|
+
}
|
|
9654
9748
|
insertBreakSubscription() {
|
|
9655
9749
|
return this.editorService.insertBreak$.subscribe(breakType => {
|
|
9656
9750
|
this.insertBreak(breakType);
|
|
@@ -9752,6 +9846,7 @@ class Editor {
|
|
|
9752
9846
|
return this.editorService.insertText$.subscribe(x => {
|
|
9753
9847
|
this.insert(x);
|
|
9754
9848
|
this.focus();
|
|
9849
|
+
this.showInsertOverlay(x);
|
|
9755
9850
|
});
|
|
9756
9851
|
}
|
|
9757
9852
|
undoSubscription() {
|
|
@@ -9894,6 +9989,7 @@ class Editor {
|
|
|
9894
9989
|
this.initResizeListener();
|
|
9895
9990
|
this.focus();
|
|
9896
9991
|
this.session.applyToolbarStyles();
|
|
9992
|
+
this.onContentChange();
|
|
9897
9993
|
}
|
|
9898
9994
|
changeColumnsWidth(columns, widthScale) {
|
|
9899
9995
|
columns.forEach(column => (column.width = Math.round(column.width / widthScale)));
|
|
@@ -11684,6 +11780,7 @@ class TextLineInfo {
|
|
|
11684
11780
|
if (fields) {
|
|
11685
11781
|
Object.assign(this, fields);
|
|
11686
11782
|
}
|
|
11783
|
+
this.indentFirstLine = indent.firstLine;
|
|
11687
11784
|
this.offsetMargin = offsetMargin;
|
|
11688
11785
|
this.indentLeft = indent.left;
|
|
11689
11786
|
const diff = contentWidth - this.width;
|
|
@@ -12258,6 +12355,8 @@ class DisplayData extends EventEmitting {
|
|
|
12258
12355
|
lineSpacing: DEFAULT_PARAGRAPH_STYLE.lineSpacing,
|
|
12259
12356
|
isAfterPageBreak: false,
|
|
12260
12357
|
isEndedByPageBreak: false,
|
|
12358
|
+
markerWidth: 0,
|
|
12359
|
+
isNumbering: false,
|
|
12261
12360
|
backgroundColor: DEFAULT_PARAGRAPH_STYLE.backgroundColor
|
|
12262
12361
|
});
|
|
12263
12362
|
return { splits: [], rowInfos: [defaultRowInfo] };
|
|
@@ -12366,7 +12465,7 @@ class DisplayData extends EventEmitting {
|
|
|
12366
12465
|
displayValue,
|
|
12367
12466
|
align: lineInfo.align,
|
|
12368
12467
|
indentFirstLine: isFirstCharacter ? lineInfo.indent.firstLine : DEFAULT_PARAGRAPH_STYLE.indentFirstLine,
|
|
12369
|
-
indentHanging: isFirstCharacter ? lineInfo.indent.hanging : DEFAULT_PARAGRAPH_STYLE.indentHanging,
|
|
12468
|
+
indentHanging: isFirstCharacter && !lineInfo.isNumbering ? lineInfo.indent.hanging : DEFAULT_PARAGRAPH_STYLE.indentHanging,
|
|
12370
12469
|
indentLeft: lineInfo.indent.left,
|
|
12371
12470
|
indentRight: lineInfo.indent.right,
|
|
12372
12471
|
indentBefore: lineInfo.offsetBefore,
|
|
@@ -12497,7 +12596,7 @@ class DisplayData extends EventEmitting {
|
|
|
12497
12596
|
displayValue,
|
|
12498
12597
|
align: lineInfo.align,
|
|
12499
12598
|
indentFirstLine: isFirstCharacter ? lineInfo.indent.firstLine : DEFAULT_PARAGRAPH_STYLE.indentFirstLine,
|
|
12500
|
-
indentHanging: isFirstCharacter ? lineInfo.indent.hanging : DEFAULT_PARAGRAPH_STYLE.indentHanging,
|
|
12599
|
+
indentHanging: isFirstCharacter && !lineInfo.isNumbering ? lineInfo.indent.hanging : DEFAULT_PARAGRAPH_STYLE.indentHanging,
|
|
12501
12600
|
indentLeft: lineInfo.indent.left,
|
|
12502
12601
|
indentRight: lineInfo.indent.right,
|
|
12503
12602
|
indentBefore: lineInfo.offsetBefore,
|
|
@@ -12578,7 +12677,7 @@ class DisplayData extends EventEmitting {
|
|
|
12578
12677
|
displayValue: DisplayValue.emptyLine,
|
|
12579
12678
|
align: lineInfo.align,
|
|
12580
12679
|
indentFirstLine: lineInfo.indent.firstLine,
|
|
12581
|
-
indentHanging: lineInfo.indent.hanging,
|
|
12680
|
+
indentHanging: lineInfo.isNumbering ? 0 : lineInfo.indent.hanging,
|
|
12582
12681
|
indentLeft: lineInfo.indent.left,
|
|
12583
12682
|
indentRight: lineInfo.indent.right,
|
|
12584
12683
|
indentBefore: lineInfo.offsetBefore,
|
|
@@ -13863,7 +13962,9 @@ class EditSession {
|
|
|
13863
13962
|
const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
|
|
13864
13963
|
const endPosition = ContentHelper.documentIndexToParagraphWithOffset(this.displayData.paragraphs, endIndex);
|
|
13865
13964
|
OperationsHelper.applyParagraphs(this.model, paragraphs);
|
|
13965
|
+
this.displayData.resetAllNumberingInfo(startParagraph);
|
|
13866
13966
|
this.displayData.updateNextLineIndexes(startParagraph, endPosition.row);
|
|
13967
|
+
this.displayData.updateNumberingsDataOnChange(startParagraph + 1);
|
|
13867
13968
|
this.applyToolbarStyles();
|
|
13868
13969
|
}
|
|
13869
13970
|
setTextStyle(textStyle) {
|
|
@@ -14349,8 +14450,8 @@ class GrammarChecker {
|
|
|
14349
14450
|
}
|
|
14350
14451
|
processGrammarCheckResults(result) {
|
|
14351
14452
|
const session = this.sessionMap.get(this.getSessionIdFromKey(result.paragraphId));
|
|
14352
|
-
|
|
14353
|
-
|
|
14453
|
+
const paragraphId = +result.paragraphId.split('-')[1];
|
|
14454
|
+
if (session && session.session.displayData.paragraphs.some(x => x.id === paragraphId)) {
|
|
14354
14455
|
if (this.checkedParagraphs.has(session.sessionId)) {
|
|
14355
14456
|
this.checkedParagraphs.get(session.sessionId).add(paragraphId);
|
|
14356
14457
|
}
|
|
@@ -14372,7 +14473,7 @@ class GrammarChecker {
|
|
|
14372
14473
|
}
|
|
14373
14474
|
this.grammarService.removeParagraph(session.sessionId, id);
|
|
14374
14475
|
this.paragraphErrorMap.delete(`${session.sessionId}-${id}`);
|
|
14375
|
-
this.checkedParagraphs.get(session.sessionId)
|
|
14476
|
+
this.checkedParagraphs.get(session.sessionId)?.delete(id);
|
|
14376
14477
|
}
|
|
14377
14478
|
return;
|
|
14378
14479
|
}
|
|
@@ -14563,7 +14664,9 @@ class HighlightLayer {
|
|
|
14563
14664
|
const paragraphs = this.session.displayData.paragraphs;
|
|
14564
14665
|
const visibleParagraphs = paragraphs.filter(x => x.paragraphSettings.lastScreenLine >= start && x.paragraphSettings.firstScreenLine <= end);
|
|
14565
14666
|
const textLinesInfo = visibleParagraphs
|
|
14566
|
-
.map(x => x.paragraphSettings.textLinesInfo
|
|
14667
|
+
.map(x => x.paragraphSettings.textLinesInfo
|
|
14668
|
+
.filter(l => start <= l.screenLine && l.screenLine <= end)
|
|
14669
|
+
.map(y => ({ textLinesInfo: y, paragraphSettings: x.paragraphSettings })))
|
|
14567
14670
|
.flat();
|
|
14568
14671
|
const paragraphInfo = PositionHelper.getParagraphInfoByRow(paragraphs, start);
|
|
14569
14672
|
let top = paragraphs[paragraphInfo.paragraphIndex].paragraphSettings.distanceFromTop +
|
|
@@ -14571,12 +14674,22 @@ class HighlightLayer {
|
|
|
14571
14674
|
this.session.scrollTop;
|
|
14572
14675
|
const padding = this.session.displayData.pagesFormat[this.session.displayData.pagesFormat.length - 1].pageFormatModel.marginLeft;
|
|
14573
14676
|
for (let i = 0; i < textLinesInfo.length; i++) {
|
|
14574
|
-
const lineInfo = textLinesInfo[i];
|
|
14677
|
+
const lineInfo = textLinesInfo[i].textLinesInfo;
|
|
14678
|
+
const paragraphLineIndex = textLinesInfo[i].paragraphSettings.textLinesInfo.findIndex(x => x === textLinesInfo[i].textLinesInfo);
|
|
14575
14679
|
if (i !== 0) {
|
|
14576
14680
|
top += lineInfo.firstLinePageOffset;
|
|
14577
14681
|
top += lineInfo.offsetBefore;
|
|
14578
14682
|
}
|
|
14579
|
-
|
|
14683
|
+
let markerWidth = 0;
|
|
14684
|
+
const numberingOffsetLeft = textLinesInfo[i].paragraphSettings.numberingData.numberingId === null
|
|
14685
|
+
? 0
|
|
14686
|
+
: textLinesInfo[i].paragraphSettings.numberingData.width + textLinesInfo[i].paragraphSettings.numberingData.paddingLeft;
|
|
14687
|
+
if (paragraphLineIndex === 0 &&
|
|
14688
|
+
(lineInfo.indentFirstLine ||
|
|
14689
|
+
(numberingOffsetLeft - lineInfo.indentLeft > 0 && numberingOffsetLeft - lineInfo.indentLeft < lineInfo.markerWidth))) {
|
|
14690
|
+
markerWidth = lineInfo.markerWidth ?? 0;
|
|
14691
|
+
}
|
|
14692
|
+
const left = lineInfo.paddingLeft + padding + lineInfo.offsetMargin + markerWidth;
|
|
14580
14693
|
let style;
|
|
14581
14694
|
if (i === 0) {
|
|
14582
14695
|
const rangeInfo = this.getRangeInfo(this.session, range);
|
|
@@ -14647,6 +14760,9 @@ class GrammarHighlightLayer extends HighlightLayer {
|
|
|
14647
14760
|
this.selectionIndex = 0;
|
|
14648
14761
|
for (const [paragraphId, grammarErrors] of this.errorsByParagraph.entries()) {
|
|
14649
14762
|
const index = this.session.displayData.paragraphs.findIndex(x => x.id === paragraphId);
|
|
14763
|
+
if (index < 0) {
|
|
14764
|
+
continue;
|
|
14765
|
+
}
|
|
14650
14766
|
for (const error of grammarErrors) {
|
|
14651
14767
|
const range = new Range(new CursorParagraph(index, error.offset), new CursorParagraph(index, error.offset + error.length)).toScreenRange(this.session);
|
|
14652
14768
|
if (config.visibleRange &&
|
|
@@ -15744,7 +15860,7 @@ class CustomContentService {
|
|
|
15744
15860
|
multiplier: 0,
|
|
15745
15861
|
align: lineInfo.align,
|
|
15746
15862
|
indentFirstLine: isFirst ? lineInfo.indent.firstLine : DEFAULT_PARAGRAPH_STYLE.indentFirstLine,
|
|
15747
|
-
indentHanging: isFirst ? lineInfo.indent.hanging : DEFAULT_PARAGRAPH_STYLE.indentHanging,
|
|
15863
|
+
indentHanging: isFirst && !lineInfo.isNumbering ? lineInfo.indent.hanging : DEFAULT_PARAGRAPH_STYLE.indentHanging,
|
|
15748
15864
|
indentLeft: lineInfo.indent.left,
|
|
15749
15865
|
indentRight: lineInfo.indent.right,
|
|
15750
15866
|
indentBefore: lineInfo.offsetBefore,
|
|
@@ -16060,6 +16176,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
16060
16176
|
type: Injectable
|
|
16061
16177
|
}] });
|
|
16062
16178
|
|
|
16179
|
+
class InsertOverlays {
|
|
16180
|
+
constructor(models = []) {
|
|
16181
|
+
this.componentMap = {};
|
|
16182
|
+
models.forEach(x => (this.componentMap[x.key] = x.component));
|
|
16183
|
+
}
|
|
16184
|
+
getComponent(key) {
|
|
16185
|
+
return this.componentMap[key];
|
|
16186
|
+
}
|
|
16187
|
+
}
|
|
16188
|
+
|
|
16063
16189
|
class TabSettingModel {
|
|
16064
16190
|
constructor(fields) {
|
|
16065
16191
|
if (fields) {
|
|
@@ -16453,7 +16579,7 @@ class EditorComponent {
|
|
|
16453
16579
|
get content() {
|
|
16454
16580
|
return this._content;
|
|
16455
16581
|
}
|
|
16456
|
-
constructor(cdr, componentService, editorService, overlayService, injector, regulatorService, commandsService, clipboard) {
|
|
16582
|
+
constructor(cdr, componentService, editorService, overlayService, injector, regulatorService, commandsService, clipboard, insertOverlays) {
|
|
16457
16583
|
this.cdr = cdr;
|
|
16458
16584
|
this.componentService = componentService;
|
|
16459
16585
|
this.editorService = editorService;
|
|
@@ -16462,6 +16588,7 @@ class EditorComponent {
|
|
|
16462
16588
|
this.regulatorService = regulatorService;
|
|
16463
16589
|
this.commandsService = commandsService;
|
|
16464
16590
|
this.clipboard = clipboard;
|
|
16591
|
+
this.insertOverlays = insertOverlays;
|
|
16465
16592
|
this.isMobile = false;
|
|
16466
16593
|
this.externalElementTagNames = ['APP-NODER-INPUT', 'APP-NODER-SIGNATURE', 'APP-NODER-DATEPICKER'];
|
|
16467
16594
|
this.rulerUnit = input.required();
|
|
@@ -16479,7 +16606,7 @@ class EditorComponent {
|
|
|
16479
16606
|
}
|
|
16480
16607
|
initEditor(content) {
|
|
16481
16608
|
this.ngOnDestroy();
|
|
16482
|
-
this.editor = new Editor(content, this.container, this.editorService, this.overlayService, this.regulatorService, this.commandsService, this.clipboard, this.externalElementTagNames, this.customPageWidth);
|
|
16609
|
+
this.editor = new Editor(content, this.container, this.editorService, this.overlayService, this.regulatorService, this.commandsService, this.clipboard, this.externalElementTagNames, this.insertOverlays, this.customPageWidth);
|
|
16483
16610
|
this.subscriptions.push(this.toggleSidenavSubscription(), this.searchBarSubscription());
|
|
16484
16611
|
}
|
|
16485
16612
|
toggleSidenavSubscription() {
|
|
@@ -16527,13 +16654,13 @@ class EditorComponent {
|
|
|
16527
16654
|
this.componentService.removeComponent(this.sidenavComponentRef);
|
|
16528
16655
|
this.sidenavComponentRef = null;
|
|
16529
16656
|
}
|
|
16530
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: EditorComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: ComponentService }, { token: EditorService }, { token: OverlayService }, { token: i0.Injector }, { token: RegulatorService }, { token: CommandsService }, { token: i6$1.Clipboard }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16531
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: EditorComponent, isStandalone: false, selector: "app-nod-editor", inputs: { isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: false, isRequired: false, transformFunction: null }, externalElementTagNames: { classPropertyName: "externalElementTagNames", publicName: "externalElementTagNames", isSignal: false, isRequired: false, transformFunction: null }, customPageWidth: { classPropertyName: "customPageWidth", publicName: "customPageWidth", isSignal: false, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: false, isRequired: false, transformFunction: null }, rulerUnit: { classPropertyName: "rulerUnit", publicName: "rulerUnit", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }, { propertyName: "sidenavContainer", first: true, predicate: ["drawerContainer"], descendants: true, static: true }, { propertyName: "sidenav", first: true, predicate: ["drawer"], descendants: true, static: true }, { propertyName: "searchBar", first: true, predicate: EditorSearchBarComponent, descendants: true }], ngImport: i0, template: "<mat-drawer-container\n class=\"sidenav-container\"\n [hasBackdrop]=\"sidenavProperties.hasBackdrop\">\n <mat-drawer-content>\n <div class=\"editor\">\n <app-nod-editor-ruler\n [unit]=\"rulerUnit()\"\n [disabled]=\"isViewOnly$ | async\" />\n @if (showSearchBar) {\n <app-nod-editor-search-bar />\n }\n <div class=\"container\">\n <div\n #container\n class=\"edit-container\"></div>\n </div>\n </div>\n </mat-drawer-content>\n <mat-drawer\n #drawer\n [class.drawer-mobile]=\"isMobile\"\n [autoFocus]=\"sidenavProperties.autoFocus\"\n [position]=\"sidenavProperties.position\"\n [mode]=\"sidenavProperties.mode\">\n <div\n #drawerContainer\n class=\"drawer-container\"></div>\n </mat-drawer>\n</mat-drawer-container>\n", styles: [":host{flex:1;display:flex;position:relative}.sidenav-container{width:100%}.mat-drawer-content{overflow:auto hidden;position:initial}.container{display:inline-block;height:100%}.editor{display:inline-block;height:100%;min-width:100%;text-align:center}.drawer-container{height:100%}.drawer-mobile{width:100%}app-nod-editor-search-bar{position:absolute;right:15px;top:0;z-index:2}\n"], dependencies: [{ kind: "component", type: EditorRulerComponent, selector: "app-nod-editor-ruler", inputs: ["unit", "disabled"] }, { kind: "component", type: EditorSearchBarComponent, selector: "app-nod-editor-search-bar" }, { kind: "component", type:
|
|
16657
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: EditorComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: ComponentService }, { token: EditorService }, { token: OverlayService }, { token: i0.Injector }, { token: RegulatorService }, { token: CommandsService }, { token: i6$1.Clipboard }, { token: InsertOverlays }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16658
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: EditorComponent, isStandalone: false, selector: "app-nod-editor", inputs: { isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: false, isRequired: false, transformFunction: null }, externalElementTagNames: { classPropertyName: "externalElementTagNames", publicName: "externalElementTagNames", isSignal: false, isRequired: false, transformFunction: null }, customPageWidth: { classPropertyName: "customPageWidth", publicName: "customPageWidth", isSignal: false, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: false, isRequired: false, transformFunction: null }, rulerUnit: { classPropertyName: "rulerUnit", publicName: "rulerUnit", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }, { propertyName: "sidenavContainer", first: true, predicate: ["drawerContainer"], descendants: true, static: true }, { propertyName: "sidenav", first: true, predicate: ["drawer"], descendants: true, static: true }, { propertyName: "searchBar", first: true, predicate: EditorSearchBarComponent, descendants: true }], ngImport: i0, template: "<mat-drawer-container\n class=\"sidenav-container\"\n [hasBackdrop]=\"sidenavProperties.hasBackdrop\">\n <mat-drawer-content>\n <div class=\"editor\">\n <app-nod-editor-ruler\n [unit]=\"rulerUnit()\"\n [disabled]=\"isViewOnly$ | async\" />\n @if (showSearchBar) {\n <app-nod-editor-search-bar />\n }\n <div class=\"container\">\n <div\n #container\n class=\"edit-container\"></div>\n </div>\n </div>\n </mat-drawer-content>\n <mat-drawer\n #drawer\n [class.drawer-mobile]=\"isMobile\"\n [autoFocus]=\"sidenavProperties.autoFocus\"\n [position]=\"sidenavProperties.position\"\n [mode]=\"sidenavProperties.mode\">\n <div\n #drawerContainer\n class=\"drawer-container\"></div>\n </mat-drawer>\n</mat-drawer-container>\n", styles: [":host{flex:1;display:flex;position:relative}.sidenav-container{width:100%}.mat-drawer-content{overflow:auto hidden;position:initial}.container{display:inline-block;height:100%}.editor{display:inline-block;height:100%;min-width:100%;text-align:center}.drawer-container{height:100%}.drawer-mobile{width:100%}app-nod-editor-search-bar{position:absolute;right:15px;top:0;z-index:2}\n"], dependencies: [{ kind: "component", type: EditorRulerComponent, selector: "app-nod-editor-ruler", inputs: ["unit", "disabled"] }, { kind: "component", type: EditorSearchBarComponent, selector: "app-nod-editor-search-bar" }, { kind: "component", type: i10.MatDrawer, selector: "mat-drawer", inputs: ["position", "mode", "disableClose", "autoFocus", "opened"], outputs: ["openedChange", "opened", "openedStart", "closed", "closedStart", "positionChanged"], exportAs: ["matDrawer"] }, { kind: "component", type: i10.MatDrawerContainer, selector: "mat-drawer-container", inputs: ["autosize", "hasBackdrop"], outputs: ["backdropClick"], exportAs: ["matDrawerContainer"] }, { kind: "component", type: i10.MatDrawerContent, selector: "mat-drawer-content" }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16532
16659
|
}
|
|
16533
16660
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: EditorComponent, decorators: [{
|
|
16534
16661
|
type: Component,
|
|
16535
16662
|
args: [{ selector: 'app-nod-editor', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<mat-drawer-container\n class=\"sidenav-container\"\n [hasBackdrop]=\"sidenavProperties.hasBackdrop\">\n <mat-drawer-content>\n <div class=\"editor\">\n <app-nod-editor-ruler\n [unit]=\"rulerUnit()\"\n [disabled]=\"isViewOnly$ | async\" />\n @if (showSearchBar) {\n <app-nod-editor-search-bar />\n }\n <div class=\"container\">\n <div\n #container\n class=\"edit-container\"></div>\n </div>\n </div>\n </mat-drawer-content>\n <mat-drawer\n #drawer\n [class.drawer-mobile]=\"isMobile\"\n [autoFocus]=\"sidenavProperties.autoFocus\"\n [position]=\"sidenavProperties.position\"\n [mode]=\"sidenavProperties.mode\">\n <div\n #drawerContainer\n class=\"drawer-container\"></div>\n </mat-drawer>\n</mat-drawer-container>\n", styles: [":host{flex:1;display:flex;position:relative}.sidenav-container{width:100%}.mat-drawer-content{overflow:auto hidden;position:initial}.container{display:inline-block;height:100%}.editor{display:inline-block;height:100%;min-width:100%;text-align:center}.drawer-container{height:100%}.drawer-mobile{width:100%}app-nod-editor-search-bar{position:absolute;right:15px;top:0;z-index:2}\n"] }]
|
|
16536
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: ComponentService }, { type: EditorService }, { type: OverlayService }, { type: i0.Injector }, { type: RegulatorService }, { type: CommandsService }, { type: i6$1.Clipboard }], propDecorators: { isMobile: [{
|
|
16663
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: ComponentService }, { type: EditorService }, { type: OverlayService }, { type: i0.Injector }, { type: RegulatorService }, { type: CommandsService }, { type: i6$1.Clipboard }, { type: InsertOverlays }], propDecorators: { isMobile: [{
|
|
16537
16664
|
type: Input
|
|
16538
16665
|
}], externalElementTagNames: [{
|
|
16539
16666
|
type: Input
|
|
@@ -16580,6 +16707,7 @@ class EditorModule {
|
|
|
16580
16707
|
providers: [
|
|
16581
16708
|
{ provide: EXTERNAL_ELEMENT_SIDENAV, useValue: new ExternalSidenavModel(options?.sidenav) },
|
|
16582
16709
|
{ provide: EXTERNAL_ELEMENT_SERVICE, useClass: options?.elementService ?? ExternalElementService },
|
|
16710
|
+
{ provide: InsertOverlays, useValue: new InsertOverlays(options?.insertOverlays) },
|
|
16583
16711
|
{ provide: ImageApiService, useClass: options?.imageApiService ?? DefaultImageApiService }
|
|
16584
16712
|
]
|
|
16585
16713
|
};
|
|
@@ -18729,7 +18857,7 @@ class PageSetupComponent {
|
|
|
18729
18857
|
return customPageSize;
|
|
18730
18858
|
}
|
|
18731
18859
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: PageSetupComponent, deps: [{ token: EditorService }, { token: ToolbarCoreService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
18732
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: PageSetupComponent, isStandalone: true, selector: "app-nod-page-setup", viewQueries: [{ propertyName: "pageSizeForm", first: true, predicate: ["pageSizeForm"], descendants: true }], ngImport: i0, template: "<div class=\"title\">\n <mat-icon\n fontSet=\"noder-icon\"\n (click)=\"onClose()\"\n fontIcon=\"icon-arrow-forward\" />\n <span>{{ 'NODER.LABEL.PAGE_SETUP' | translate }}</span>\n</div>\n<form #pageSizeForm=\"ngForm\">\n <div class=\"content\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{ 'NODER.LABEL.APPLY_TO' | translate }}</mat-label>\n <mat-select [(value)]=\"selectedDocumentArea\">\n <mat-option [value]=\"documentAreas.WholeDocument\">{{ 'NODER.LABEL.WHOLE_DOCUMENT' | translate }}</mat-option>\n <mat-option [value]=\"documentAreas.ThisSection\">{{ 'NODER.LABEL.THIS_SECTION' | translate }}</mat-option>\n @if (hasSelection$ | async) {\n <mat-option [value]=\"documentAreas.SelectedText\">{{ 'NODER.LABEL.SELECTED_TEXT' | translate }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n <div class=\"orientation\">\n <div class=\"label\">{{ 'NODER.LABEL.ORIENTATION' | translate }}</div>\n <mat-radio-group\n aria-label=\"Select an option\"\n [(ngModel)]=\"pageSize.orientation\"\n name=\"orientation\"\n (change)=\"onPageOrientationChanged()\">\n <mat-radio-button [value]=\"pageOrientations.Portrait\">\n <span>{{ 'NODER.LABEL.PORTRAIT' | translate }}</span>\n </mat-radio-button>\n <mat-radio-button [value]=\"pageOrientations.Landscape\">\n <span>{{ 'NODER.LABEL.LANDSCAPE' | translate }}</span>\n </mat-radio-button>\n </mat-radio-group>\n </div>\n <div class=\"page-format\">\n <div class=\"page-format-tile\">\n <div class=\"label\">{{ 'NODER.LABEL.PAGE_FORMAT' | translate }}</div>\n <div class=\"checkbox-area\">\n <div class=\"checkbox-label\">{{ 'NODER.LABEL.CUSTOM_SIZE' | translate }}</div>\n <mat-checkbox\n [checked]=\"pageSize.isCustom\"\n (change)=\"toggleCustomSize($event)\" />\n </div>\n </div>\n @if (!pageSize.isCustom) {\n <div class=\"page-size\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{ 'NODER.LABEL.SIZE' | translate }}</mat-label>\n <mat-select\n [(value)]=\"pageSizeName\"\n (selectionChange)=\"onPageSizeChange()\">\n @for (option of pageSizes; track option) {\n <mat-option [value]=\"option.name\">\n <div class=\"size-option\">\n <span class=\"option-name\">{{ option.name + ' ' }}</span>\n <span class=\"option-size\">{{ option.size }}</span>\n </div>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n } @else {\n <div class=\"page-custom-size\">\n <mat-form-field\n appearance=\"outline\"\n class=\"size-unit\">\n <mat-label>{{ 'NODER.LABEL.MEASURE' | translate }}</mat-label>\n <mat-select\n [(ngModel)]=\"pageSize.unit\"\n name=\"unit\"\n (valueChange)=\"onUnitChanged($event)\">\n <mat-option [value]=\"sizeUnits.Millimeters\">{{ 'NODER.LABEL.MILLIMETERS' | translate }}</mat-option>\n <mat-option [value]=\"sizeUnits.Inches\">{{ 'NODER.LABEL.INCHES' | translate }}</mat-option>\n </mat-select>\n </mat-form-field>\n <div class=\"size-panel\">\n <mat-form-field\n appearance=\"outline\"\n class=\"custom-width\">\n <mat-label>{{ ('NODER.LABEL.WIDTH' | translate) + currentUnit }}</mat-label>\n <input\n matInput\n [(ngModel)]=\"pageSize.customWidth\"\n name=\"customWidth\" />\n </mat-form-field>\n <button\n mat-button\n (click)=\"onIncrementWidth()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n </button>\n <button\n mat-button\n (click)=\"onDecrementWidth()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-remove\"></mat-icon>\n </button>\n </div>\n <div class=\"size-panel\">\n <mat-form-field\n appearance=\"outline\"\n class=\"custom-height\">\n <mat-label>{{ ('NODER.LABEL.HEIGHT' | translate) + currentUnit }}</mat-label>\n <input\n matInput\n [(ngModel)]=\"pageSize.customHeight\"\n name=\"customHeight\" />\n </mat-form-field>\n <button\n mat-button\n (click)=\"onIncrementHeight()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n </button>\n <button\n mat-button\n (click)=\"onDecrementHeight()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-remove\"></mat-icon>\n </button>\n </div>\n </div>\n }\n </div>\n </div>\n <div class=\"actions\">\n <button\n mat-stroked-button\n (click)=\"onClose()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-cancel-thin\" />\n </button>\n <button\n mat-flat-button\n color=\"primary\"\n (click)=\"onApply()\"\n [disabled]=\"pageSizeForm.pristine\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-done-thin\" />\n </button>\n </div>\n</form>\n", styles: [":host{display:flex;flex-direction:column;height:100%;width:400px}.title{margin:12px 16px;height:32px;display:flex;align-items:center;gap:8px}.title span{overflow:hidden;text-overflow:ellipsis;font-size:16px;font-style:normal;font-weight:500;line-height:normal}.content{display:flex;flex-direction:column;height:100%;overflow:hidden;padding:8px 16px 0;gap:24px}.actions{display:flex;justify-content:flex-end;margin:0 16px 16px;gap:10px}.actions .mdc-button{width:32px;height:32px;min-width:32px;padding:0}.actions .mdc-button .mat-icon{margin-right:0;margin-left:0}.orientation{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orientation mat-radio-group{display:flex;width:100%;gap:16px}.label{font-size:14px;font-style:normal;font-weight:400;line-height:normal}.page-format{display:flex;flex-direction:column;gap:16px}.page-format-tile{display:flex;align-items:center;justify-content:space-between}.page-format-tile .checkbox-area{display:flex;align-items:center}.checkbox-label{font-size:12px;font-style:normal;font-weight:400;line-height:normal}.custom-width,.custom-height,.size-unit{width:120px}.page-custom-size{display:flex;flex-direction:column}.size-panel{display:flex;gap:10px}.size-panel .mdc-button{width:40px;height:40px;min-width:40px;padding:0}.size-panel .mdc-button .mat-icon{margin-right:0;margin-left:0}.size-option{display:flex;flex-direction:column}.option-name{font-weight:400}.option-size{font-size:12px}form{display:flex;flex-direction:column;flex:1}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i10.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i12.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i12.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
18860
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: PageSetupComponent, isStandalone: true, selector: "app-nod-page-setup", viewQueries: [{ propertyName: "pageSizeForm", first: true, predicate: ["pageSizeForm"], descendants: true }], ngImport: i0, template: "<div class=\"title\">\n <mat-icon\n fontSet=\"noder-icon\"\n (click)=\"onClose()\"\n fontIcon=\"icon-arrow-forward\" />\n <span>{{ 'NODER.LABEL.PAGE_SETUP' | translate }}</span>\n</div>\n<form #pageSizeForm=\"ngForm\">\n <div class=\"content\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{ 'NODER.LABEL.APPLY_TO' | translate }}</mat-label>\n <mat-select [(value)]=\"selectedDocumentArea\">\n <mat-option [value]=\"documentAreas.WholeDocument\">{{ 'NODER.LABEL.WHOLE_DOCUMENT' | translate }}</mat-option>\n <mat-option [value]=\"documentAreas.ThisSection\">{{ 'NODER.LABEL.THIS_SECTION' | translate }}</mat-option>\n @if (hasSelection$ | async) {\n <mat-option [value]=\"documentAreas.SelectedText\">{{ 'NODER.LABEL.SELECTED_TEXT' | translate }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n <div class=\"orientation\">\n <div class=\"label\">{{ 'NODER.LABEL.ORIENTATION' | translate }}</div>\n <mat-radio-group\n aria-label=\"Select an option\"\n [(ngModel)]=\"pageSize.orientation\"\n name=\"orientation\"\n (change)=\"onPageOrientationChanged()\">\n <mat-radio-button [value]=\"pageOrientations.Portrait\">\n <span>{{ 'NODER.LABEL.PORTRAIT' | translate }}</span>\n </mat-radio-button>\n <mat-radio-button [value]=\"pageOrientations.Landscape\">\n <span>{{ 'NODER.LABEL.LANDSCAPE' | translate }}</span>\n </mat-radio-button>\n </mat-radio-group>\n </div>\n <div class=\"page-format\">\n <div class=\"page-format-tile\">\n <div class=\"label\">{{ 'NODER.LABEL.PAGE_FORMAT' | translate }}</div>\n <div class=\"checkbox-area\">\n <div class=\"checkbox-label\">{{ 'NODER.LABEL.CUSTOM_SIZE' | translate }}</div>\n <mat-checkbox\n [checked]=\"pageSize.isCustom\"\n (change)=\"toggleCustomSize($event)\" />\n </div>\n </div>\n @if (!pageSize.isCustom) {\n <div class=\"page-size\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{ 'NODER.LABEL.SIZE' | translate }}</mat-label>\n <mat-select\n [(value)]=\"pageSizeName\"\n (selectionChange)=\"onPageSizeChange()\">\n @for (option of pageSizes; track option) {\n <mat-option [value]=\"option.name\">\n <div class=\"size-option\">\n <span class=\"option-name\">{{ option.name + ' ' }}</span>\n <span class=\"option-size\">{{ option.size }}</span>\n </div>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n } @else {\n <div class=\"page-custom-size\">\n <mat-form-field\n appearance=\"outline\"\n class=\"size-unit\">\n <mat-label>{{ 'NODER.LABEL.MEASURE' | translate }}</mat-label>\n <mat-select\n [(ngModel)]=\"pageSize.unit\"\n name=\"unit\"\n (valueChange)=\"onUnitChanged($event)\">\n <mat-option [value]=\"sizeUnits.Millimeters\">{{ 'NODER.LABEL.MILLIMETERS' | translate }}</mat-option>\n <mat-option [value]=\"sizeUnits.Inches\">{{ 'NODER.LABEL.INCHES' | translate }}</mat-option>\n </mat-select>\n </mat-form-field>\n <div class=\"size-panel\">\n <mat-form-field\n appearance=\"outline\"\n class=\"custom-width\">\n <mat-label>{{ ('NODER.LABEL.WIDTH' | translate) + currentUnit }}</mat-label>\n <input\n matInput\n [(ngModel)]=\"pageSize.customWidth\"\n name=\"customWidth\" />\n </mat-form-field>\n <button\n mat-button\n (click)=\"onIncrementWidth()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n </button>\n <button\n mat-button\n (click)=\"onDecrementWidth()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-remove\"></mat-icon>\n </button>\n </div>\n <div class=\"size-panel\">\n <mat-form-field\n appearance=\"outline\"\n class=\"custom-height\">\n <mat-label>{{ ('NODER.LABEL.HEIGHT' | translate) + currentUnit }}</mat-label>\n <input\n matInput\n [(ngModel)]=\"pageSize.customHeight\"\n name=\"customHeight\" />\n </mat-form-field>\n <button\n mat-button\n (click)=\"onIncrementHeight()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n </button>\n <button\n mat-button\n (click)=\"onDecrementHeight()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-remove\"></mat-icon>\n </button>\n </div>\n </div>\n }\n </div>\n </div>\n <div class=\"actions\">\n <button\n mat-stroked-button\n (click)=\"onClose()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-cancel-thin\" />\n </button>\n <button\n mat-flat-button\n color=\"primary\"\n (click)=\"onApply()\"\n [disabled]=\"pageSizeForm.pristine\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-done-thin\" />\n </button>\n </div>\n</form>\n", styles: [":host{display:flex;flex-direction:column;height:100%;width:400px}.title{margin:12px 16px;height:32px;display:flex;align-items:center;gap:8px}.title span{overflow:hidden;text-overflow:ellipsis;font-size:16px;font-style:normal;font-weight:500;line-height:normal}.content{display:flex;flex-direction:column;height:100%;overflow:hidden;padding:8px 16px 0;gap:24px}.actions{display:flex;justify-content:flex-end;margin:0 16px 16px;gap:10px}.actions .mdc-button{width:32px;height:32px;min-width:32px;padding:0}.actions .mdc-button .mat-icon{margin-right:0;margin-left:0}.orientation{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orientation mat-radio-group{display:flex;width:100%;gap:16px}.label{font-size:14px;font-style:normal;font-weight:400;line-height:normal}.page-format{display:flex;flex-direction:column;gap:16px}.page-format-tile{display:flex;align-items:center;justify-content:space-between}.page-format-tile .checkbox-area{display:flex;align-items:center}.checkbox-label{font-size:12px;font-style:normal;font-weight:400;line-height:normal}.custom-width,.custom-height,.size-unit{width:120px}.page-custom-size{display:flex;flex-direction:column}.size-panel{display:flex;gap:10px}.size-panel .mdc-button{width:40px;height:40px;min-width:40px;padding:0}.size-panel .mdc-button .mat-icon{margin-right:0;margin-left:0}.size-option{display:flex;flex-direction:column}.option-name{font-weight:400}.option-size{font-size:12px}form{display:flex;flex-direction:column;flex:1}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i10$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i12.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i12.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
18733
18861
|
}
|
|
18734
18862
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: PageSetupComponent, decorators: [{
|
|
18735
18863
|
type: Component,
|