@talrace/ngx-noder 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/apart-components/add-link-dialog/add-link-dialog.component.mjs +7 -1
- package/esm2022/lib/apart-components/editor-toolbar/editor-mobile-toolbar/editor-mobile-toolbar.component.mjs +2 -2
- package/esm2022/lib/editor/content/helpers/link.helper.mjs +6 -0
- package/esm2022/lib/editor/display/layers/text.layer.mjs +7 -8
- package/esm2022/lib/editor/execution/edit.session.mjs +18 -5
- package/esm2022/lib/editor/execution/editor.mjs +4 -3
- package/esm2022/lib/editor/execution/helpers/format-style.helper.mjs +42 -1
- package/esm2022/lib/editor/operations/helpers/link-operations.helper.mjs +38 -20
- package/esm2022/lib/editor/operations/operations-helper.helper.mjs +16 -8
- package/esm2022/lib/models/generated/link.model.mjs +1 -1
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/talrace-ngx-noder.mjs +139 -51
- package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
- package/lib/editor/content/helpers/link.helper.d.ts +4 -0
- package/lib/editor/display/layers/text.layer.d.ts +1 -1
- package/lib/editor/execution/edit.session.d.ts +1 -0
- package/lib/editor/execution/helpers/format-style.helper.d.ts +2 -0
- package/lib/editor/operations/helpers/link-operations.helper.d.ts +2 -1
- package/lib/models/generated/link.model.d.ts +3 -1
- package/package.json +8 -8
- package/public-api.d.ts +1 -0
- package/src/styles.scss +0 -1
- package/src/scss/_fonts.scss +0 -3
|
@@ -298,6 +298,17 @@ class ContentStyleHelper {
|
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
class FormatModel {
|
|
302
|
+
constructor(fields) {
|
|
303
|
+
if (fields) {
|
|
304
|
+
if (fields.textStyle) {
|
|
305
|
+
fields.textStyle = new TextStyleModel(fields.textStyle);
|
|
306
|
+
}
|
|
307
|
+
Object.assign(this, fields);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
301
312
|
class FormatStyleHelper {
|
|
302
313
|
static getFormatsAtRange(formats, startIndex, endIndex) {
|
|
303
314
|
const firstIndex = formats.findIndex(x => x.endIndex >= startIndex);
|
|
@@ -327,6 +338,46 @@ class FormatStyleHelper {
|
|
|
327
338
|
const firstIndex = formats.findIndex(x => x.endIndex >= index);
|
|
328
339
|
return firstIndex > 0 ? formats[firstIndex - 1] : null;
|
|
329
340
|
}
|
|
341
|
+
static combineSection(formats, links, startIndex, endIndex) {
|
|
342
|
+
const result = this.getFormatsAtRange(formats, startIndex, endIndex).map(x => new FormatModel({
|
|
343
|
+
...x,
|
|
344
|
+
startIndex: x.startIndex < startIndex ? startIndex : x.startIndex,
|
|
345
|
+
endIndex: x.endIndex > endIndex ? endIndex : x.endIndex
|
|
346
|
+
}));
|
|
347
|
+
const filteredLinks = links.filter(x => x.startIndex <= endIndex && x.endIndex >= startIndex);
|
|
348
|
+
for (let i = result.length - 1; i >= 0; i--) {
|
|
349
|
+
const linksInFormat = filteredLinks.filter(x => x.startIndex <= result[i].endIndex && x.endIndex >= result[i].startIndex);
|
|
350
|
+
if (!linksInFormat.length) {
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
for (let j = linksInFormat.length - 1; j >= 0; j--) {
|
|
354
|
+
if (linksInFormat[j].startIndex <= result[i].startIndex && linksInFormat[j].endIndex >= result[i].endIndex) {
|
|
355
|
+
result.splice(i, 1);
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
if (linksInFormat[j].endIndex > result[i].endIndex && linksInFormat[j].startIndex > result[i].startIndex) {
|
|
359
|
+
result[i].endIndex = linksInFormat[j].startIndex - 1;
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if (linksInFormat[j].startIndex < result[i].startIndex && linksInFormat[j].endIndex < result[i].endIndex) {
|
|
363
|
+
result[i].startIndex = linksInFormat[j].endIndex + 1;
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
if (linksInFormat[j].startIndex >= result[i].startIndex && linksInFormat[j].endIndex <= result[i].endIndex) {
|
|
367
|
+
result.push(new FormatModel({ ...result[i], startIndex: linksInFormat[j].endIndex + 1 }));
|
|
368
|
+
result[i].endIndex = linksInFormat[j].startIndex - 1;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
filteredLinks.forEach(x => {
|
|
373
|
+
const formatsStyles = x.formats
|
|
374
|
+
.filter(y => x.startIndex + y.startIndex <= endIndex)
|
|
375
|
+
.map(y => new FormatModel({ ...y, startIndex: x.startIndex + y.startIndex, endIndex: x.startIndex + y.endIndex }));
|
|
376
|
+
result.push(...formatsStyles);
|
|
377
|
+
});
|
|
378
|
+
result.sort((a, b) => a.startIndex - b.startIndex);
|
|
379
|
+
return result;
|
|
380
|
+
}
|
|
330
381
|
}
|
|
331
382
|
|
|
332
383
|
class ElementDataModel {
|
|
@@ -1076,17 +1127,6 @@ class DocumentHandler extends BaseHandler {
|
|
|
1076
1127
|
}
|
|
1077
1128
|
}
|
|
1078
1129
|
|
|
1079
|
-
class FormatModel {
|
|
1080
|
-
constructor(fields) {
|
|
1081
|
-
if (fields) {
|
|
1082
|
-
if (fields.textStyle) {
|
|
1083
|
-
fields.textStyle = new TextStyleModel(fields.textStyle);
|
|
1084
|
-
}
|
|
1085
|
-
Object.assign(this, fields);
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
1130
|
class FormatHelper {
|
|
1091
1131
|
static sliceSection(formats, startIndex, endIndex) {
|
|
1092
1132
|
let result = [];
|
|
@@ -1416,6 +1456,12 @@ class InsertTabModel {
|
|
|
1416
1456
|
}
|
|
1417
1457
|
}
|
|
1418
1458
|
|
|
1459
|
+
class LinkHelper {
|
|
1460
|
+
static sliceSection(links, startIndex, endIndex) {
|
|
1461
|
+
return links.filter(x => x.startIndex >= startIndex && x.endIndex <= endIndex);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1419
1465
|
class LinkModel {
|
|
1420
1466
|
constructor(fields) {
|
|
1421
1467
|
if (fields) {
|
|
@@ -2809,15 +2855,14 @@ class TextLayer {
|
|
|
2809
2855
|
parent.appendChild(linesContainerElement);
|
|
2810
2856
|
const startIndex = this.session.displayData.positionToIndex({ row, column: 0 });
|
|
2811
2857
|
const endIndex = this.session.displayData.positionToIndex({ row: row + 1, column: 0 }) - 1;
|
|
2812
|
-
const
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
...format,
|
|
2816
|
-
content: this.session.model.content.substring(format.startIndex, format.endIndex + 1)
|
|
2858
|
+
const combinedFormats = FormatStyleHelper.combineSection(this.session.model.formats, this.session.model.links, startIndex, endIndex).map(x => new FormatExtModel({
|
|
2859
|
+
...x,
|
|
2860
|
+
content: this.session.model.content.substring(x.startIndex, x.endIndex + 1)
|
|
2817
2861
|
}));
|
|
2862
|
+
const splits = this.session.displayData.paragraphs[row].nextLineIndexes;
|
|
2818
2863
|
if (splits?.length) {
|
|
2819
2864
|
const distance = new DistanceModel({ start: startIndex, end: endIndex });
|
|
2820
|
-
this.renderingHelper.renderContentWrappedLine({ currentElement: this.element, parentNode: linesContainerElement }, splits, paragraphSettings,
|
|
2865
|
+
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);
|
|
2821
2866
|
}
|
|
2822
2867
|
else {
|
|
2823
2868
|
const numberingOffsetLeft = paragraphSettings.numberingData.numberingId === null
|
|
@@ -2826,7 +2871,7 @@ class TextLayer {
|
|
|
2826
2871
|
const lastLineEl = this.renderingHelper.createLineElement(paragraphSettings.textLinesInfo[0], numberingOffsetLeft, this.session.generalProperties.scalingRatio);
|
|
2827
2872
|
linesContainerElement.appendChild(lastLineEl);
|
|
2828
2873
|
const rowDistance = new DistanceModel({ start: startIndex, end: endIndex });
|
|
2829
|
-
this.renderingHelper.renderContentSimpleLine({ currentElement: this.element, parentNode: lastLineEl },
|
|
2874
|
+
this.renderingHelper.renderContentSimpleLine({ currentElement: this.element, parentNode: lastLineEl }, combinedFormats, rowDistance, this.session.customContentService, this.session.customComponents, this.session.model.breaks);
|
|
2830
2875
|
}
|
|
2831
2876
|
}
|
|
2832
2877
|
}
|
|
@@ -4553,8 +4598,8 @@ class Editor {
|
|
|
4553
4598
|
const elements = IndexedElementHelper.sliceSection(this.session.model.elements, startIndex, endIndex).map(x => new ElementModel(x));
|
|
4554
4599
|
const breaks = IndexedElementHelper.sliceSection(this.session.model.breaks, startIndex, endIndex).map(x => new BreakModel(x));
|
|
4555
4600
|
const tabs = IndexedElementHelper.sliceSection(this.session.model.tabs, startIndex, endIndex).map(x => new TabModel(x));
|
|
4556
|
-
const links =
|
|
4557
|
-
return new RestoreModel({ startIndex, endIndex, text, formats, paragraphs, images, tables, elements, breaks, tabs, links });
|
|
4601
|
+
const links = LinkHelper.sliceSection(this.session.model.links, startIndex, endIndex).map(x => new LinkModel(x));
|
|
4602
|
+
return new RestoreModel({ startIndex, endIndex, text, formats, paragraphs, images, tables, elements, breaks, tabs, links: links });
|
|
4558
4603
|
}
|
|
4559
4604
|
createCustomElement(data) {
|
|
4560
4605
|
const insertIndex = ContentHelper.paragraphToDocumentIndex(this.session.displayData.paragraphs, this.selection.range.start.row, this.selection.range.start.column);
|
|
@@ -8644,10 +8689,15 @@ class ImageOperationsHelper {
|
|
|
8644
8689
|
}
|
|
8645
8690
|
|
|
8646
8691
|
class LinkOperationsHelper {
|
|
8647
|
-
static insert(links, link,
|
|
8648
|
-
LinkOperationsHelper.insertContent(links,
|
|
8649
|
-
const linkModel = new LinkModel({
|
|
8650
|
-
|
|
8692
|
+
static insert(links, link, startIndex, endIndex, textStyle) {
|
|
8693
|
+
LinkOperationsHelper.insertContent(links, startIndex, endIndex - startIndex + 1);
|
|
8694
|
+
const linkModel = new LinkModel({
|
|
8695
|
+
startIndex: startIndex,
|
|
8696
|
+
link,
|
|
8697
|
+
endIndex,
|
|
8698
|
+
formats: [new FormatModel({ startIndex: 0, endIndex: endIndex - startIndex, textStyle })]
|
|
8699
|
+
});
|
|
8700
|
+
const index = links.findIndex(x => x.startIndex > linkModel.startIndex);
|
|
8651
8701
|
if (index < 0) {
|
|
8652
8702
|
links.push(linkModel);
|
|
8653
8703
|
}
|
|
@@ -8657,12 +8707,15 @@ class LinkOperationsHelper {
|
|
|
8657
8707
|
}
|
|
8658
8708
|
static insertContent(links, insertIndex, textLength) {
|
|
8659
8709
|
for (let link of links) {
|
|
8660
|
-
if (link.
|
|
8710
|
+
if (link.startIndex < insertIndex && link.endIndex >= insertIndex) {
|
|
8661
8711
|
link.endIndex += textLength;
|
|
8712
|
+
const indexInLink = insertIndex - link.startIndex;
|
|
8713
|
+
const format = link.formats.find(x => x.startIndex <= indexInLink && x.endIndex >= indexInLink);
|
|
8714
|
+
format.endIndex += textLength;
|
|
8662
8715
|
continue;
|
|
8663
8716
|
}
|
|
8664
|
-
if (link.
|
|
8665
|
-
link.
|
|
8717
|
+
if (link.startIndex >= insertIndex) {
|
|
8718
|
+
link.startIndex += textLength;
|
|
8666
8719
|
link.endIndex += textLength;
|
|
8667
8720
|
}
|
|
8668
8721
|
}
|
|
@@ -8670,32 +8723,40 @@ class LinkOperationsHelper {
|
|
|
8670
8723
|
static removeContent(links, startIndex, endIndex) {
|
|
8671
8724
|
const length = endIndex - startIndex + 1;
|
|
8672
8725
|
for (let i = links.length - 1; i >= 0; i--) {
|
|
8673
|
-
if (links[i].
|
|
8674
|
-
links[i].insertIndex -= length;
|
|
8675
|
-
links[i].endIndex -= length;
|
|
8676
|
-
continue;
|
|
8677
|
-
}
|
|
8678
|
-
if (links[i].insertIndex >= startIndex && links[i].endIndex <= endIndex) {
|
|
8726
|
+
if (links[i].startIndex >= startIndex && links[i].endIndex <= endIndex) {
|
|
8679
8727
|
links.splice(i, 1);
|
|
8680
8728
|
continue;
|
|
8681
8729
|
}
|
|
8682
|
-
if (
|
|
8730
|
+
if (endIndex < links[i].startIndex) {
|
|
8731
|
+
links[i].startIndex -= length;
|
|
8683
8732
|
links[i].endIndex -= length;
|
|
8684
8733
|
continue;
|
|
8685
8734
|
}
|
|
8686
|
-
if (links[i].
|
|
8687
|
-
|
|
8735
|
+
if (links[i].startIndex <= startIndex && links[i].endIndex >= endIndex) {
|
|
8736
|
+
const startInLink = startIndex - links[i].startIndex;
|
|
8737
|
+
const endInLink = startInLink + length - 1;
|
|
8738
|
+
links[i].endIndex -= length;
|
|
8739
|
+
FormatOperationsHelper.removeContent(links[i].formats, startInLink, endInLink);
|
|
8688
8740
|
continue;
|
|
8689
8741
|
}
|
|
8690
|
-
if (links[i].
|
|
8691
|
-
links[i].
|
|
8742
|
+
if (links[i].startIndex >= startIndex && links[i].startIndex <= endIndex) {
|
|
8743
|
+
const endInLink = links[i].startIndex - startIndex - 1;
|
|
8744
|
+
links[i].startIndex = startIndex;
|
|
8692
8745
|
links[i].endIndex -= length;
|
|
8746
|
+
FormatOperationsHelper.removeContent(links[i].formats, 0, endInLink);
|
|
8747
|
+
continue;
|
|
8748
|
+
}
|
|
8749
|
+
if (links[i].endIndex >= startIndex && links[i].endIndex <= endIndex) {
|
|
8750
|
+
const startInLink = startIndex - links[i].startIndex;
|
|
8751
|
+
const endInLink = links[i].formats[links[i].formats.length - 1].endIndex;
|
|
8752
|
+
links[i].endIndex = startIndex - 1;
|
|
8753
|
+
FormatOperationsHelper.removeContent(links[i].formats, startInLink, endInLink);
|
|
8693
8754
|
}
|
|
8694
8755
|
}
|
|
8695
8756
|
}
|
|
8696
8757
|
static restore(links, startIndex, contentLength, newlinks) {
|
|
8697
8758
|
this.insertContent(links, startIndex, contentLength);
|
|
8698
|
-
let indexInElements = links.findIndex(x => x.
|
|
8759
|
+
let indexInElements = links.findIndex(x => x.startIndex >= startIndex);
|
|
8699
8760
|
indexInElements = indexInElements === -1 ? links.length : indexInElements;
|
|
8700
8761
|
links.splice(indexInElements, 0, ...newlinks);
|
|
8701
8762
|
}
|
|
@@ -9370,7 +9431,12 @@ class OperationsHelper {
|
|
|
9370
9431
|
}
|
|
9371
9432
|
case CommandType.InsertLink: {
|
|
9372
9433
|
const model = command.insertLink;
|
|
9373
|
-
this.insertLink(contents, model.linkDataModel.text, model.linkDataModel.link, model.insertIndex, new TextStyleModel({
|
|
9434
|
+
this.insertLink(contents, model.linkDataModel.text, model.linkDataModel.link, model.insertIndex, new TextStyleModel({
|
|
9435
|
+
...DEFAULT_TEXT_STYLE,
|
|
9436
|
+
headingStyleId: HYPERLINK_HEADING_STYLE_ID,
|
|
9437
|
+
underline: true,
|
|
9438
|
+
fontColor: HYPERLINK_FONT_COLOR
|
|
9439
|
+
}));
|
|
9374
9440
|
break;
|
|
9375
9441
|
}
|
|
9376
9442
|
case CommandType.InsertTableColumns: {
|
|
@@ -9533,14 +9599,14 @@ class OperationsHelper {
|
|
|
9533
9599
|
static insertLink(document, text, link, index, style) {
|
|
9534
9600
|
document.content = ContentOperationsHelper.insertContent(document.content, text, index);
|
|
9535
9601
|
document.contentLength = document.content.length;
|
|
9536
|
-
FormatOperationsHelper.
|
|
9602
|
+
FormatOperationsHelper.insertContent(document.formats, index, text.length);
|
|
9537
9603
|
ParagraphOperationsHelper.insertContent(document.paragraphs, text, index);
|
|
9538
9604
|
IndexedElementOperationsHelper.insertContent(document.images, index, text.length);
|
|
9539
9605
|
IndexedElementOperationsHelper.insertContent(document.tables, index, text.length);
|
|
9540
9606
|
IndexedElementOperationsHelper.insertContent(document.elements, index, text.length);
|
|
9541
9607
|
IndexedElementOperationsHelper.insertContent(document.breaks, index, text.length);
|
|
9542
9608
|
IndexedElementOperationsHelper.insertContent(document.tabs, index, text.length);
|
|
9543
|
-
LinkOperationsHelper.insert(document.links, link, index, index + text.length - 1);
|
|
9609
|
+
LinkOperationsHelper.insert(document.links, link, index, index + text.length - 1, style);
|
|
9544
9610
|
}
|
|
9545
9611
|
static addNumbering(target, numberings, startIndex, endIndex, levels) {
|
|
9546
9612
|
const newNumberingId = NumberingOperationsHelper.generateNumberingId(numberings);
|
|
@@ -9605,7 +9671,6 @@ class OperationsHelper {
|
|
|
9605
9671
|
FormatOperationsHelper.restore(document.formats, model.startIndex, model.text.length, model.formats);
|
|
9606
9672
|
IndexedElementOperationsHelper.restore(document.paragraphs, model.startIndex, model.text.length, model.paragraphs);
|
|
9607
9673
|
IndexedElementOperationsHelper.restore(document.images, model.startIndex, model.text.length, model.images);
|
|
9608
|
-
IndexedElementOperationsHelper.restore(document.links, model.startIndex, model.text.length, model.links);
|
|
9609
9674
|
IndexedElementOperationsHelper.restore(document.tables, model.startIndex, model.text.length, model.tables);
|
|
9610
9675
|
IndexedElementOperationsHelper.restore(document.elements, model.startIndex, model.text.length, model.elements);
|
|
9611
9676
|
IndexedElementOperationsHelper.restore(document.breaks, model.startIndex, model.text.length, model.breaks);
|
|
@@ -9631,7 +9696,6 @@ class OperationsHelper {
|
|
|
9631
9696
|
ParagraphOperationsHelper.replace(document.paragraphs, text, startIndex, endIndex);
|
|
9632
9697
|
IndexedElementOperationsHelper.replaceContent(document.images, startIndex, endIndex, text.length);
|
|
9633
9698
|
IndexedElementOperationsHelper.replaceContent(document.tables, startIndex, endIndex, text.length);
|
|
9634
|
-
IndexedElementOperationsHelper.replaceContent(document.links, startIndex, endIndex, text.length);
|
|
9635
9699
|
IndexedElementOperationsHelper.replaceContent(document.elements, startIndex, endIndex, text.length);
|
|
9636
9700
|
IndexedElementOperationsHelper.replaceContent(document.breaks, startIndex, endIndex, text.length);
|
|
9637
9701
|
IndexedElementOperationsHelper.replaceContent(document.tabs, startIndex, endIndex, text.length);
|
|
@@ -9662,7 +9726,12 @@ class OperationsHelper {
|
|
|
9662
9726
|
this.insertTable(document, model.insertTable.insertIndex, model.insertTable, contentWidth);
|
|
9663
9727
|
}
|
|
9664
9728
|
else if (model.insertLink) {
|
|
9665
|
-
this.insertLink(document, model.insertLink.linkDataModel.text, model.insertLink.linkDataModel.link, model.insertLink.insertIndex, new TextStyleModel({
|
|
9729
|
+
this.insertLink(document, model.insertLink.linkDataModel.text, model.insertLink.linkDataModel.link, model.insertLink.insertIndex, new TextStyleModel({
|
|
9730
|
+
...DEFAULT_TEXT_STYLE,
|
|
9731
|
+
headingStyleId: HYPERLINK_HEADING_STYLE_ID,
|
|
9732
|
+
underline: true,
|
|
9733
|
+
fontColor: HYPERLINK_FONT_COLOR
|
|
9734
|
+
}));
|
|
9666
9735
|
}
|
|
9667
9736
|
}
|
|
9668
9737
|
static applyTextStyle(document, startIndex, endIndex, style) {
|
|
@@ -10077,6 +10146,7 @@ class EditSession {
|
|
|
10077
10146
|
insertLink(position, linkData) {
|
|
10078
10147
|
const insertIndex = ContentHelper.paragraphPositionToDocumentIndex(this.displayData.paragraphs, position);
|
|
10079
10148
|
const linkStyle = new TextStyleModel({
|
|
10149
|
+
...DEFAULT_TEXT_STYLE,
|
|
10080
10150
|
headingStyleId: HYPERLINK_HEADING_STYLE_ID,
|
|
10081
10151
|
underline: true,
|
|
10082
10152
|
fontColor: HYPERLINK_FONT_COLOR
|
|
@@ -10168,12 +10238,14 @@ class EditSession {
|
|
|
10168
10238
|
startIndex--;
|
|
10169
10239
|
endIndex--;
|
|
10170
10240
|
}
|
|
10171
|
-
const textStyles = FormatStyleHelper.getFormatsAtRange(this.model.formats, startIndex, endIndex).map(format => format.textStyle);
|
|
10172
10241
|
const paragraphStyles = ParagraphStyleHelper.getParagraphsAtRange(this.model.paragraphs, startIndex, endIndex).map(x => x.paragraphStyle.numberingId
|
|
10173
10242
|
? NumberingHelper.getStyles(x.paragraphStyle, this.generalProperties.numberings)
|
|
10174
10243
|
: new NumberingParagraphStyleModel(x.paragraphStyle));
|
|
10244
|
+
const styles = this.selection.isEmpty
|
|
10245
|
+
? this.getStyleForCursor(startIndex)
|
|
10246
|
+
: FormatStyleHelper.combineSection(this.model.formats, this.model.links, startIndex, endIndex).map(x => x.textStyle);
|
|
10175
10247
|
const result = {};
|
|
10176
|
-
for (let style of [...
|
|
10248
|
+
for (let style of [...styles, ...paragraphStyles]) {
|
|
10177
10249
|
for (let key of Object.keys(style)) {
|
|
10178
10250
|
if (result[key] === undefined) {
|
|
10179
10251
|
result[key] = style[key];
|
|
@@ -10185,6 +10257,16 @@ class EditSession {
|
|
|
10185
10257
|
}
|
|
10186
10258
|
this.editorService.styles = result;
|
|
10187
10259
|
}
|
|
10260
|
+
getStyleForCursor(index) {
|
|
10261
|
+
const link = this.model.links.find(x => x.startIndex <= index && x.endIndex > index);
|
|
10262
|
+
if (link) {
|
|
10263
|
+
const indexInLink = index - link.startIndex;
|
|
10264
|
+
const linkFormat = link.formats.find(x => x.startIndex <= indexInLink && x.endIndex >= indexInLink);
|
|
10265
|
+
return [linkFormat.textStyle];
|
|
10266
|
+
}
|
|
10267
|
+
const format = FormatStyleHelper.getFormatAtIndex(this.model.formats, index);
|
|
10268
|
+
return [format.textStyle];
|
|
10269
|
+
}
|
|
10188
10270
|
restore(model) {
|
|
10189
10271
|
const paragraphPosition = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, model.startIndex);
|
|
10190
10272
|
if (model.startIndex !== model.endIndex) {
|
|
@@ -10230,7 +10312,7 @@ class EditSession {
|
|
|
10230
10312
|
}
|
|
10231
10313
|
getLinkModel(cursor) {
|
|
10232
10314
|
const index = ContentHelper.paragraphPositionToDocumentIndex(this.displayData.paragraphs, cursor);
|
|
10233
|
-
return this.model.links.find(x => x.
|
|
10315
|
+
return this.model.links.find(x => x.startIndex <= index && x.endIndex > index);
|
|
10234
10316
|
}
|
|
10235
10317
|
insertTableRows(insertIndex, rowsCount, targetIndex, inheritIndex) {
|
|
10236
10318
|
const table = this.customComponents.tables.find(x => x.instance.insertIndex === insertIndex);
|
|
@@ -13820,11 +13902,11 @@ class EditorMobileToolbarComponent extends ToolbarActionsComponent {
|
|
|
13820
13902
|
};
|
|
13821
13903
|
}
|
|
13822
13904
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EditorMobileToolbarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: CustomIconService }, { token: EditorService }, { token: i0.Injector }, { token: ToolbarCoreService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13823
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: EditorMobileToolbarComponent, selector: "app-nod-editor-mobile-toolbar", outputs: { openFileFromDisk: "openFileFromDisk", createDocument: "createDocument", saveAs: "saveAs", rename: "rename", delete: "delete", insertPageBreak: "insertPageBreak", textFormat: "textFormat" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"{ mode: toolbarCoreService.mode$ | async, isViewOnly: editorService.isViewOnly$ | async } as data\">\n <div class=\"menu-action\">\n <button\n *ngIf=\"data.mode === editorToolbarMode.Base; else back\"\n mat-button\n id=\"editor-mobile-toolbar-sandwich\"\n (click)=\"toolbarCoreService.openBurgerMenu()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-sandwich\" />\n </button>\n <ng-template #back>\n <div class=\"back-container\">\n <button\n mat-button\n id=\"editor-mobile-toolbar-back\"\n (click)=\"toolbarCoreService.back()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-back\" />\n </button>\n <div class=\"back-title\">{{ toolbarCoreService.backTitle }}</div>\n </div>\n </ng-template>\n </div>\n <div\n *ngIf=\"styles && !data.isViewOnly && actionsMenuMods.includes(data.mode)\"\n class=\"actions\">\n <app-nod-undo-redo\n [canUndo]=\"canUndo\"\n [canRedo]=\"canRedo\"\n (undo)=\"undo.emit()\"\n (redo)=\"redo.emit()\" />\n <div class=\"separator\"></div>\n <div\n class=\"main-actions\"\n [ngSwitch]=\"data.mode\">\n <ng-container *ngSwitchCase=\"editorToolbarMode.Base\">\n <button\n mat-button\n id=\"editor-mobile-toolbar-text-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.TextFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-text\" />\n </button>\n <button\n mat-button\n id=\"editor-mobile-toolbar-style-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.StyleFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-combined\" />\n </button>\n <button\n mat-button\n id=\"editor-mobile-toolbar-align-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.AlignFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignleft\" />\n </button>\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.TextFormat\">\n <app-nod-font\n [isDisabled]=\"data.isViewOnly\"\n [styles]=\"styles\"\n (selectFont)=\"onApplyFontFamily($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-size\n [isDisabled]=\"data.isViewOnly\"\n [fontSize]=\"styles.fontSize\"\n (selectFontSize)=\"onApplyFontSize($event)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.StyleFormat\">\n <app-nod-font-style\n [isDisabled]=\"data.isViewOnly\"\n [bold]=\"styles.bold\"\n [italic]=\"styles.italic\"\n [underline]=\"styles.underline\"\n (toggleBold)=\"onApplyBold($event)\"\n (toggleItalic)=\"onApplyItalic($event)\"\n (toggleUnderline)=\"onApplyUnderline($event)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.AlignFormat\">\n <app-nod-format\n [isDisabled]=\"data.isViewOnly\"\n [alignment]=\"styles.alignment\"\n (selectAlignment)=\"onApplyAlignment($event)\" />\n </ng-container>\n </div>\n </div>\n</ng-container>\n", styles: ["button.mdc-button{min-width:28px;min-height:28px;height:28px;padding:0;margin:0 4px}button.mdc-button mat-icon{font-size:24px;height:24px;width:24px;margin:0}:host::ng-deep{display:flex;position:relative;width:100%;height:32px}:host::ng-deep mat-button-toggle,:host::ng-deep .mat-button-toggle-button{height:32px;width:32px;border-radius:4px}:host::ng-deep mat-button-toggle mat-icon,:host::ng-deep .mat-button-toggle-button mat-icon{font-size:24px;height:24px;width:24px;border-radius:4px}:host::ng-deep mat-button-toggle .mat-button-toggle-label-content,:host::ng-deep .mat-button-toggle-button .mat-button-toggle-label-content{padding:0 2px}.menu-action{z-index:1}.actions{display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%}.main-actions{display:flex;align-items:center;height:100%}.separator{border-left:1px solid;opacity:.1;height:100%;margin:0 8px}app-nod-font{max-width:142px}.back-container{display:flex}.back-title{font-size:14px;font-weight:400;padding-left:10px}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: FontComponent, selector: "app-nod-font", inputs: ["isDisabled", "styles"], outputs: ["selectFont"] }, { kind: "component", type: FontSizeComponent, selector: "app-nod-font-size", inputs: ["isDisabled", "fontSize"], outputs: ["selectFontSize"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: FontStyleComponent, selector: "app-nod-font-style", inputs: ["isDisabled", "bold", "italic", "underline", "fontColor", "highlightColor"], outputs: ["toggleBold", "toggleItalic", "toggleUnderline", "selectFontColor", "selectHighlightColor"] }, { kind: "component", type: FormatComponent, selector: "app-nod-format", inputs: ["isDisabled", "alignment"], outputs: ["selectAlignment"] }, { kind: "component", type: UndoRedoComponent, selector: "app-nod-undo-redo", inputs: ["canUndo", "canRedo"], outputs: ["undo", "redo"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13905
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: EditorMobileToolbarComponent, selector: "app-nod-editor-mobile-toolbar", outputs: { openFileFromDisk: "openFileFromDisk", createDocument: "createDocument", saveAs: "saveAs", rename: "rename", delete: "delete", insertPageBreak: "insertPageBreak", textFormat: "textFormat" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"{ mode: toolbarCoreService.mode$ | async, isViewOnly: editorService.isViewOnly$ | async } as data\">\n <div class=\"menu-action\">\n <button\n *ngIf=\"data.mode === editorToolbarMode.Base; else back\"\n mat-button\n id=\"editor-mobile-toolbar-sandwich\"\n (click)=\"toolbarCoreService.openBurgerMenu()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-sandwich\" />\n </button>\n <ng-template #back>\n <div class=\"back-container\">\n <button\n mat-button\n id=\"editor-mobile-toolbar-back\"\n (click)=\"toolbarCoreService.back()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-back\" />\n </button>\n <div class=\"back-title\">{{ toolbarCoreService.backTitle }}</div>\n </div>\n </ng-template>\n </div>\n <div\n *ngIf=\"styles && !data.isViewOnly && actionsMenuMods.includes(data.mode)\"\n class=\"actions\">\n <app-nod-undo-redo\n [canUndo]=\"canUndo\"\n [canRedo]=\"canRedo\"\n (undo)=\"undo.emit()\"\n (redo)=\"redo.emit()\" />\n <div class=\"separator\"></div>\n <div\n class=\"main-actions\"\n [ngSwitch]=\"data.mode\">\n <ng-container *ngSwitchCase=\"editorToolbarMode.Base\">\n <button\n mat-button\n id=\"editor-mobile-toolbar-text-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.TextFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-text\" />\n </button>\n <button\n mat-button\n id=\"editor-mobile-toolbar-style-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.StyleFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-combined\" />\n </button>\n <button\n mat-button\n id=\"editor-mobile-toolbar-align-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.AlignFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignleft\" />\n </button>\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.TextFormat\">\n <app-nod-font\n [isDisabled]=\"data.isViewOnly\"\n [styles]=\"styles\"\n (selectFont)=\"onApplyFontFamily($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-size\n [isDisabled]=\"data.isViewOnly\"\n [fontSize]=\"styles.fontSize\"\n (selectFontSize)=\"onApplyFontSize($event)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.StyleFormat\">\n <app-nod-font-style\n [isDisabled]=\"data.isViewOnly\"\n [bold]=\"styles.bold\"\n [italic]=\"styles.italic\"\n [underline]=\"styles.underline\"\n (toggleBold)=\"onApplyBold($event)\"\n (toggleItalic)=\"onApplyItalic($event)\"\n (toggleUnderline)=\"onApplyUnderline($event)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.AlignFormat\">\n <app-nod-format\n [isDisabled]=\"data.isViewOnly\"\n [alignment]=\"styles.alignment\"\n (selectAlignment)=\"onApplyAlignment($event)\" />\n </ng-container>\n </div>\n </div>\n</ng-container>\n", styles: ["button.mdc-button{min-width:28px;min-height:28px;height:28px;padding:0;margin:0 4px}button.mdc-button mat-icon{font-size:24px;height:24px;width:24px;margin:0}:host::ng-deep{display:flex;position:relative;width:100%;height:32px}:host::ng-deep mat-button-toggle,:host::ng-deep .mat-button-toggle-button{height:32px;width:32px;border-radius:4px}:host::ng-deep mat-button-toggle mat-icon,:host::ng-deep .mat-button-toggle-button mat-icon{font-size:24px;height:24px;width:24px;border-radius:4px}:host::ng-deep mat-button-toggle .mat-button-toggle-label-content,:host::ng-deep .mat-button-toggle-button .mat-button-toggle-label-content{padding:0 2px}.menu-action{display:flex;align-items:center;z-index:1}.actions{display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%}.main-actions{display:flex;align-items:center;height:100%}.separator{border-left:1px solid;opacity:.1;height:100%;margin:0 8px}app-nod-font{max-width:142px}.back-container{display:flex}.back-title{font-size:14px;font-weight:400;padding-left:10px}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: FontComponent, selector: "app-nod-font", inputs: ["isDisabled", "styles"], outputs: ["selectFont"] }, { kind: "component", type: FontSizeComponent, selector: "app-nod-font-size", inputs: ["isDisabled", "fontSize"], outputs: ["selectFontSize"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: FontStyleComponent, selector: "app-nod-font-style", inputs: ["isDisabled", "bold", "italic", "underline", "fontColor", "highlightColor"], outputs: ["toggleBold", "toggleItalic", "toggleUnderline", "selectFontColor", "selectHighlightColor"] }, { kind: "component", type: FormatComponent, selector: "app-nod-format", inputs: ["isDisabled", "alignment"], outputs: ["selectAlignment"] }, { kind: "component", type: UndoRedoComponent, selector: "app-nod-undo-redo", inputs: ["canUndo", "canRedo"], outputs: ["undo", "redo"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13824
13906
|
}
|
|
13825
13907
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EditorMobileToolbarComponent, decorators: [{
|
|
13826
13908
|
type: Component,
|
|
13827
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'app-nod-editor-mobile-toolbar', template: "<ng-container *ngIf=\"{ mode: toolbarCoreService.mode$ | async, isViewOnly: editorService.isViewOnly$ | async } as data\">\n <div class=\"menu-action\">\n <button\n *ngIf=\"data.mode === editorToolbarMode.Base; else back\"\n mat-button\n id=\"editor-mobile-toolbar-sandwich\"\n (click)=\"toolbarCoreService.openBurgerMenu()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-sandwich\" />\n </button>\n <ng-template #back>\n <div class=\"back-container\">\n <button\n mat-button\n id=\"editor-mobile-toolbar-back\"\n (click)=\"toolbarCoreService.back()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-back\" />\n </button>\n <div class=\"back-title\">{{ toolbarCoreService.backTitle }}</div>\n </div>\n </ng-template>\n </div>\n <div\n *ngIf=\"styles && !data.isViewOnly && actionsMenuMods.includes(data.mode)\"\n class=\"actions\">\n <app-nod-undo-redo\n [canUndo]=\"canUndo\"\n [canRedo]=\"canRedo\"\n (undo)=\"undo.emit()\"\n (redo)=\"redo.emit()\" />\n <div class=\"separator\"></div>\n <div\n class=\"main-actions\"\n [ngSwitch]=\"data.mode\">\n <ng-container *ngSwitchCase=\"editorToolbarMode.Base\">\n <button\n mat-button\n id=\"editor-mobile-toolbar-text-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.TextFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-text\" />\n </button>\n <button\n mat-button\n id=\"editor-mobile-toolbar-style-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.StyleFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-combined\" />\n </button>\n <button\n mat-button\n id=\"editor-mobile-toolbar-align-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.AlignFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignleft\" />\n </button>\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.TextFormat\">\n <app-nod-font\n [isDisabled]=\"data.isViewOnly\"\n [styles]=\"styles\"\n (selectFont)=\"onApplyFontFamily($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-size\n [isDisabled]=\"data.isViewOnly\"\n [fontSize]=\"styles.fontSize\"\n (selectFontSize)=\"onApplyFontSize($event)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.StyleFormat\">\n <app-nod-font-style\n [isDisabled]=\"data.isViewOnly\"\n [bold]=\"styles.bold\"\n [italic]=\"styles.italic\"\n [underline]=\"styles.underline\"\n (toggleBold)=\"onApplyBold($event)\"\n (toggleItalic)=\"onApplyItalic($event)\"\n (toggleUnderline)=\"onApplyUnderline($event)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.AlignFormat\">\n <app-nod-format\n [isDisabled]=\"data.isViewOnly\"\n [alignment]=\"styles.alignment\"\n (selectAlignment)=\"onApplyAlignment($event)\" />\n </ng-container>\n </div>\n </div>\n</ng-container>\n", styles: ["button.mdc-button{min-width:28px;min-height:28px;height:28px;padding:0;margin:0 4px}button.mdc-button mat-icon{font-size:24px;height:24px;width:24px;margin:0}:host::ng-deep{display:flex;position:relative;width:100%;height:32px}:host::ng-deep mat-button-toggle,:host::ng-deep .mat-button-toggle-button{height:32px;width:32px;border-radius:4px}:host::ng-deep mat-button-toggle mat-icon,:host::ng-deep .mat-button-toggle-button mat-icon{font-size:24px;height:24px;width:24px;border-radius:4px}:host::ng-deep mat-button-toggle .mat-button-toggle-label-content,:host::ng-deep .mat-button-toggle-button .mat-button-toggle-label-content{padding:0 2px}.menu-action{z-index:1}.actions{display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%}.main-actions{display:flex;align-items:center;height:100%}.separator{border-left:1px solid;opacity:.1;height:100%;margin:0 8px}app-nod-font{max-width:142px}.back-container{display:flex}.back-title{font-size:14px;font-weight:400;padding-left:10px}\n"] }]
|
|
13909
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'app-nod-editor-mobile-toolbar', template: "<ng-container *ngIf=\"{ mode: toolbarCoreService.mode$ | async, isViewOnly: editorService.isViewOnly$ | async } as data\">\n <div class=\"menu-action\">\n <button\n *ngIf=\"data.mode === editorToolbarMode.Base; else back\"\n mat-button\n id=\"editor-mobile-toolbar-sandwich\"\n (click)=\"toolbarCoreService.openBurgerMenu()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-sandwich\" />\n </button>\n <ng-template #back>\n <div class=\"back-container\">\n <button\n mat-button\n id=\"editor-mobile-toolbar-back\"\n (click)=\"toolbarCoreService.back()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-back\" />\n </button>\n <div class=\"back-title\">{{ toolbarCoreService.backTitle }}</div>\n </div>\n </ng-template>\n </div>\n <div\n *ngIf=\"styles && !data.isViewOnly && actionsMenuMods.includes(data.mode)\"\n class=\"actions\">\n <app-nod-undo-redo\n [canUndo]=\"canUndo\"\n [canRedo]=\"canRedo\"\n (undo)=\"undo.emit()\"\n (redo)=\"redo.emit()\" />\n <div class=\"separator\"></div>\n <div\n class=\"main-actions\"\n [ngSwitch]=\"data.mode\">\n <ng-container *ngSwitchCase=\"editorToolbarMode.Base\">\n <button\n mat-button\n id=\"editor-mobile-toolbar-text-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.TextFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-text\" />\n </button>\n <button\n mat-button\n id=\"editor-mobile-toolbar-style-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.StyleFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-combined\" />\n </button>\n <button\n mat-button\n id=\"editor-mobile-toolbar-align-format\"\n (click)=\"toolbarCoreService.mode = editorToolbarMode.AlignFormat\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignleft\" />\n </button>\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.TextFormat\">\n <app-nod-font\n [isDisabled]=\"data.isViewOnly\"\n [styles]=\"styles\"\n (selectFont)=\"onApplyFontFamily($event)\" />\n <div class=\"separator\"></div>\n <app-nod-font-size\n [isDisabled]=\"data.isViewOnly\"\n [fontSize]=\"styles.fontSize\"\n (selectFontSize)=\"onApplyFontSize($event)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.StyleFormat\">\n <app-nod-font-style\n [isDisabled]=\"data.isViewOnly\"\n [bold]=\"styles.bold\"\n [italic]=\"styles.italic\"\n [underline]=\"styles.underline\"\n (toggleBold)=\"onApplyBold($event)\"\n (toggleItalic)=\"onApplyItalic($event)\"\n (toggleUnderline)=\"onApplyUnderline($event)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"editorToolbarMode.AlignFormat\">\n <app-nod-format\n [isDisabled]=\"data.isViewOnly\"\n [alignment]=\"styles.alignment\"\n (selectAlignment)=\"onApplyAlignment($event)\" />\n </ng-container>\n </div>\n </div>\n</ng-container>\n", styles: ["button.mdc-button{min-width:28px;min-height:28px;height:28px;padding:0;margin:0 4px}button.mdc-button mat-icon{font-size:24px;height:24px;width:24px;margin:0}:host::ng-deep{display:flex;position:relative;width:100%;height:32px}:host::ng-deep mat-button-toggle,:host::ng-deep .mat-button-toggle-button{height:32px;width:32px;border-radius:4px}:host::ng-deep mat-button-toggle mat-icon,:host::ng-deep .mat-button-toggle-button mat-icon{font-size:24px;height:24px;width:24px;border-radius:4px}:host::ng-deep mat-button-toggle .mat-button-toggle-label-content,:host::ng-deep .mat-button-toggle-button .mat-button-toggle-label-content{padding:0 2px}.menu-action{display:flex;align-items:center;z-index:1}.actions{display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%}.main-actions{display:flex;align-items:center;height:100%}.separator{border-left:1px solid;opacity:.1;height:100%;margin:0 8px}app-nod-font{max-width:142px}.back-container{display:flex}.back-title{font-size:14px;font-weight:400;padding-left:10px}\n"] }]
|
|
13828
13910
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: CustomIconService }, { type: EditorService }, { type: i0.Injector }, { type: ToolbarCoreService }], propDecorators: { openFileFromDisk: [{
|
|
13829
13911
|
type: Output
|
|
13830
13912
|
}], createDocument: [{
|
|
@@ -14476,9 +14558,15 @@ class AddLinkDialogComponent {
|
|
|
14476
14558
|
if (this.form.invalid) {
|
|
14477
14559
|
return;
|
|
14478
14560
|
}
|
|
14561
|
+
if (this.form.controls.text.value) {
|
|
14562
|
+
this.form.controls.text.setValue(this.form.controls.text.value.trim());
|
|
14563
|
+
}
|
|
14479
14564
|
if (!this.form.controls.text.value) {
|
|
14480
14565
|
this.form.controls.text.setValue(this.form.controls.link.value);
|
|
14481
14566
|
}
|
|
14567
|
+
if (!this.form.controls.link.value.startsWith('http')) {
|
|
14568
|
+
this.form.controls.link.setValue('http://' + this.form.controls.link.value);
|
|
14569
|
+
}
|
|
14482
14570
|
this.dialogRef.close({ text: this.form.controls.text.value, link: this.form.controls.link.value });
|
|
14483
14571
|
}
|
|
14484
14572
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddLinkDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -14616,5 +14704,5 @@ class OperationModel {
|
|
|
14616
14704
|
* Generated bundle index. Do not edit.
|
|
14617
14705
|
*/
|
|
14618
14706
|
|
|
14619
|
-
export { AddLinkDialogComponent, AddLinkDialogOptions, AddLinkMobileComponent, Alignment, BaseNoderComponent, BreakTypes, CommandModel, CommandType, CommandsService, ConfirmDialogComponent, DEFAULT_BACKGROUND_COLOR, DEFAULT_EDGE_MAX_HEIGHT_MULTIPLIER, DEFAULT_FONT_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_HEADINGS, DEFAULT_HEADING_STYLE_ID, DEFAULT_PARAGRAPH_STYLE, DEFAULT_TAB_WIDTH, DEFAULT_TEXT_STYLE, DEFAULT_TOOLBAR_STYLES, DefaultImageApiService, DestroyComponent, DocumentInfo, DocumentModel, DocumentNameModel, DocxModel, DomHelper, EditorComponent, EditorMobileToolbarComponent, EditorModule, EditorSearchDialogComponent, EditorService, EditorTitleComponent, EditorTitleMobileComponent, EditorToolbarComponent, EditorToolbarMode, EditorToolbarModule, EditorToolbarService, ElementDataModel, ElementModel, ExternalComponent, ExternalElementModel, ExternalElementService, FileSourceModel, FormatStyleHelper, HYPERLINK_FONT_COLOR, HYPERLINK_HEADING_STYLE_ID, ImageApiService, ImageDataModel, LastDocumentRevisionModel, Mode, NEW_LINE_MARKUP, NumberingLevelModel, OperationModel, OperationsHistoryInfoModel, PageType, ParagraphStyleModel, RevisionHelper, RevisionModel, TextStyleModel };
|
|
14707
|
+
export { AddLinkDialogComponent, AddLinkDialogOptions, AddLinkMobileComponent, Alignment, BaseNoderComponent, BreakTypes, CommandModel, CommandType, CommandsService, ConfirmDialogComponent, DEFAULT_BACKGROUND_COLOR, DEFAULT_EDGE_MAX_HEIGHT_MULTIPLIER, DEFAULT_FONT_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_HEADINGS, DEFAULT_HEADING_STYLE_ID, DEFAULT_PARAGRAPH_STYLE, DEFAULT_TAB_WIDTH, DEFAULT_TEXT_STYLE, DEFAULT_TOOLBAR_STYLES, DefaultImageApiService, DestroyComponent, DocumentInfo, DocumentModel, DocumentNameModel, DocxModel, DomHelper, EditorComponent, EditorMobileToolbarComponent, EditorModule, EditorSearchDialogComponent, EditorService, EditorTitleComponent, EditorTitleMobileComponent, EditorToolbarComponent, EditorToolbarMode, EditorToolbarModule, EditorToolbarService, ElementDataModel, ElementModel, ExternalComponent, ExternalElementModel, ExternalElementService, FileSourceModel, FormatStyleHelper, HYPERLINK_FONT_COLOR, HYPERLINK_HEADING_STYLE_ID, ImageApiService, ImageDataModel, LastDocumentRevisionModel, Mode, NEW_LINE_MARKUP, NumberingLevelModel, OperationModel, OperationsHistoryInfoModel, PageType, ParagraphStyleModel, RevisionHelper, RevisionModel, TextFormatMobileComponent, TextStyleModel };
|
|
14620
14708
|
//# sourceMappingURL=talrace-ngx-noder.mjs.map
|