@talrace/ngx-noder 19.0.27 → 19.0.29

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.
@@ -179,13 +179,6 @@ const NEW_LINE_MARKUP = '\n';
179
179
  const DEFAULT_TAB_WIDTH = 48;
180
180
  const DEFAULT_EDGE_MAX_HEIGHT_MULTIPLIER = 0.4;
181
181
 
182
- var BreakTypes;
183
- (function (BreakTypes) {
184
- BreakTypes[BreakTypes["Page"] = 0] = "Page";
185
- BreakTypes[BreakTypes["Column"] = 1] = "Column";
186
- BreakTypes[BreakTypes["TextWrapping"] = 2] = "TextWrapping";
187
- })(BreakTypes || (BreakTypes = {}));
188
-
189
182
  var PageType;
190
183
  (function (PageType) {
191
184
  PageType[PageType["Default"] = 0] = "Default";
@@ -193,6 +186,63 @@ var PageType;
193
186
  PageType[PageType["Even"] = 2] = "Even";
194
187
  })(PageType || (PageType = {}));
195
188
 
189
+ var Borders;
190
+ (function (Borders) {
191
+ Borders[Borders["Bottom"] = 0] = "Bottom";
192
+ Borders[Borders["Top"] = 1] = "Top";
193
+ Borders[Borders["Left"] = 2] = "Left";
194
+ Borders[Borders["Right"] = 3] = "Right";
195
+ Borders[Borders["Empty"] = 4] = "Empty";
196
+ Borders[Borders["All"] = 5] = "All";
197
+ Borders[Borders["Outside"] = 6] = "Outside";
198
+ Borders[Borders["Inside"] = 7] = "Inside";
199
+ })(Borders || (Borders = {}));
200
+
201
+ var LineStyles;
202
+ (function (LineStyles) {
203
+ LineStyles[LineStyles["SolidLine"] = 0] = "SolidLine";
204
+ LineStyles[LineStyles["RoundDot"] = 1] = "RoundDot";
205
+ LineStyles[LineStyles["SquareDot"] = 2] = "SquareDot";
206
+ LineStyles[LineStyles["Dash"] = 3] = "Dash";
207
+ LineStyles[LineStyles["DashDot"] = 4] = "DashDot";
208
+ LineStyles[LineStyles["LongDash"] = 5] = "LongDash";
209
+ LineStyles[LineStyles["LongDashDot"] = 6] = "LongDashDot";
210
+ LineStyles[LineStyles["LongDashDotDot"] = 7] = "LongDashDotDot";
211
+ LineStyles[LineStyles["Single"] = 8] = "Single";
212
+ LineStyles[LineStyles["Thick"] = 9] = "Thick";
213
+ LineStyles[LineStyles["Double"] = 10] = "Double";
214
+ LineStyles[LineStyles["Dotted"] = 11] = "Dotted";
215
+ LineStyles[LineStyles["Dashed"] = 12] = "Dashed";
216
+ LineStyles[LineStyles["DotDash"] = 13] = "DotDash";
217
+ LineStyles[LineStyles["DotDotDash"] = 14] = "DotDotDash";
218
+ LineStyles[LineStyles["Triple"] = 15] = "Triple";
219
+ LineStyles[LineStyles["ThinThickSmallGap"] = 16] = "ThinThickSmallGap";
220
+ LineStyles[LineStyles["ThickThinSmallGap"] = 17] = "ThickThinSmallGap";
221
+ LineStyles[LineStyles["ThinThickThinSmallGap"] = 18] = "ThinThickThinSmallGap";
222
+ LineStyles[LineStyles["ThinThickMediumGap"] = 19] = "ThinThickMediumGap";
223
+ LineStyles[LineStyles["ThickThinMediumGap"] = 20] = "ThickThinMediumGap";
224
+ LineStyles[LineStyles["ThinThickThinMediumGap"] = 21] = "ThinThickThinMediumGap";
225
+ LineStyles[LineStyles["ThinThickLargeGap"] = 22] = "ThinThickLargeGap";
226
+ LineStyles[LineStyles["ThickThinLargeGap"] = 23] = "ThickThinLargeGap";
227
+ LineStyles[LineStyles["ThinThickThinLargeGap"] = 24] = "ThinThickThinLargeGap";
228
+ LineStyles[LineStyles["Wave"] = 25] = "Wave";
229
+ LineStyles[LineStyles["DoubleWave"] = 26] = "DoubleWave";
230
+ LineStyles[LineStyles["DashSmallGap"] = 27] = "DashSmallGap";
231
+ LineStyles[LineStyles["DashDotStroked"] = 28] = "DashDotStroked";
232
+ LineStyles[LineStyles["ThreeDEmboss"] = 29] = "ThreeDEmboss";
233
+ LineStyles[LineStyles["ThreeDEngrave"] = 30] = "ThreeDEngrave";
234
+ LineStyles[LineStyles["Outset"] = 31] = "Outset";
235
+ LineStyles[LineStyles["Inset"] = 32] = "Inset";
236
+ LineStyles[LineStyles["Nil"] = 33] = "Nil";
237
+ })(LineStyles || (LineStyles = {}));
238
+
239
+ var BreakTypes;
240
+ (function (BreakTypes) {
241
+ BreakTypes[BreakTypes["Page"] = 0] = "Page";
242
+ BreakTypes[BreakTypes["Column"] = 1] = "Column";
243
+ BreakTypes[BreakTypes["TextWrapping"] = 2] = "TextWrapping";
244
+ })(BreakTypes || (BreakTypes = {}));
245
+
196
246
  class DomHelper {
197
247
  static translate(element, tx, ty) {
198
248
  element.style.top = `${Math.round(ty)}px`;
@@ -596,6 +646,7 @@ class EditorService {
596
646
  this._insertText$ = new Subject();
597
647
  this._removeLeft$ = new Subject();
598
648
  this._removeCustomElementsData$ = new Subject();
649
+ this._restoreCustomElementsData$ = new Subject();
599
650
  this._currentPage$ = new BehaviorSubject(1);
600
651
  this._lastPageNumber$ = new BehaviorSubject(1);
601
652
  this._applyDocumentPageFormat$ = new Subject();
@@ -811,10 +862,16 @@ class EditorService {
811
862
  get removeLeft$() {
812
863
  return this._removeLeft$.asObservable();
813
864
  }
814
- // Will be used by Project which use Library. To manage the delete of the external custom elements associated with the local custom elements
865
+ // Will be used by Project which use Library. To manage the delete of the external custom elements associated with the local custom elements.
866
+ // Should not delete entities but hide them instead. Because of possible synchronous restore
815
867
  get removeCustomElementsData$() {
816
868
  return this._removeCustomElementsData$.asObservable();
817
869
  }
870
+ // Will be used by Project which use Library. To manage the restore of the external custom elements associated with the local custom elements.
871
+ // Should not create entities but unhide them instead. Because its synchronous
872
+ get restoreCustomElementsData$() {
873
+ return this._restoreCustomElementsData$.asObservable();
874
+ }
818
875
  get currentPage() {
819
876
  return this._currentPage$.value;
820
877
  }
@@ -1065,6 +1122,9 @@ class EditorService {
1065
1122
  removeCustomElementsData(elements) {
1066
1123
  this._removeCustomElementsData$.next(elements);
1067
1124
  }
1125
+ restoreCustomElementsData(elements) {
1126
+ this._restoreCustomElementsData$.next(elements);
1127
+ }
1068
1128
  setNewSearchTerm(term) {
1069
1129
  this._searchTerm$.next(term);
1070
1130
  }
@@ -2660,7 +2720,7 @@ class ContentsOperationsHelper {
2660
2720
  const paragraphs = IndexedElementHelper.sliceSection(contents.paragraphs, startIndex, endIndex).map(x => new ParagraphModel(x));
2661
2721
  const images = IndexedElementHelper.sliceSection(contents.images, startIndex, endIndex).map(x => new ImageModel(x));
2662
2722
  const tables = IndexedElementHelper.sliceSection(contents.tables, startIndex, endIndex).map(x => new TableModel(x));
2663
- const elements = IndexedElementHelper.sliceSection(contents.elements, startIndex, endIndex).map(x => new ElementModel({ ...x, id: 0, guid: '' }));
2723
+ const elements = IndexedElementHelper.sliceSection(contents.elements, startIndex, endIndex).map(x => new ElementModel(x));
2664
2724
  const breaks = IndexedElementHelper.sliceSection(contents.breaks, startIndex, endIndex).map(x => new BreakModel(x));
2665
2725
  const tabs = IndexedElementHelper.sliceSection(contents.tabs, startIndex, endIndex).map(x => new TabModel(x));
2666
2726
  const links = LinkHelper.sliceSection(contents.links, startIndex, endIndex).map(x => new LinkModel(x));
@@ -4381,18 +4441,6 @@ class ParagraphOperationsHelper {
4381
4441
  }
4382
4442
  }
4383
4443
 
4384
- var Borders;
4385
- (function (Borders) {
4386
- Borders[Borders["Bottom"] = 0] = "Bottom";
4387
- Borders[Borders["Top"] = 1] = "Top";
4388
- Borders[Borders["Left"] = 2] = "Left";
4389
- Borders[Borders["Right"] = 3] = "Right";
4390
- Borders[Borders["Empty"] = 4] = "Empty";
4391
- Borders[Borders["All"] = 5] = "All";
4392
- Borders[Borders["Outside"] = 6] = "Outside";
4393
- Borders[Borders["Inside"] = 7] = "Inside";
4394
- })(Borders || (Borders = {}));
4395
-
4396
4444
  class ColumnModel {
4397
4445
  constructor(fields) {
4398
4446
  if (fields) {
@@ -4401,44 +4449,6 @@ class ColumnModel {
4401
4449
  }
4402
4450
  }
4403
4451
 
4404
- var LineStyles;
4405
- (function (LineStyles) {
4406
- LineStyles[LineStyles["SolidLine"] = 0] = "SolidLine";
4407
- LineStyles[LineStyles["RoundDot"] = 1] = "RoundDot";
4408
- LineStyles[LineStyles["SquareDot"] = 2] = "SquareDot";
4409
- LineStyles[LineStyles["Dash"] = 3] = "Dash";
4410
- LineStyles[LineStyles["DashDot"] = 4] = "DashDot";
4411
- LineStyles[LineStyles["LongDash"] = 5] = "LongDash";
4412
- LineStyles[LineStyles["LongDashDot"] = 6] = "LongDashDot";
4413
- LineStyles[LineStyles["LongDashDotDot"] = 7] = "LongDashDotDot";
4414
- LineStyles[LineStyles["Single"] = 8] = "Single";
4415
- LineStyles[LineStyles["Thick"] = 9] = "Thick";
4416
- LineStyles[LineStyles["Double"] = 10] = "Double";
4417
- LineStyles[LineStyles["Dotted"] = 11] = "Dotted";
4418
- LineStyles[LineStyles["Dashed"] = 12] = "Dashed";
4419
- LineStyles[LineStyles["DotDash"] = 13] = "DotDash";
4420
- LineStyles[LineStyles["DotDotDash"] = 14] = "DotDotDash";
4421
- LineStyles[LineStyles["Triple"] = 15] = "Triple";
4422
- LineStyles[LineStyles["ThinThickSmallGap"] = 16] = "ThinThickSmallGap";
4423
- LineStyles[LineStyles["ThickThinSmallGap"] = 17] = "ThickThinSmallGap";
4424
- LineStyles[LineStyles["ThinThickThinSmallGap"] = 18] = "ThinThickThinSmallGap";
4425
- LineStyles[LineStyles["ThinThickMediumGap"] = 19] = "ThinThickMediumGap";
4426
- LineStyles[LineStyles["ThickThinMediumGap"] = 20] = "ThickThinMediumGap";
4427
- LineStyles[LineStyles["ThinThickThinMediumGap"] = 21] = "ThinThickThinMediumGap";
4428
- LineStyles[LineStyles["ThinThickLargeGap"] = 22] = "ThinThickLargeGap";
4429
- LineStyles[LineStyles["ThickThinLargeGap"] = 23] = "ThickThinLargeGap";
4430
- LineStyles[LineStyles["ThinThickThinLargeGap"] = 24] = "ThinThickThinLargeGap";
4431
- LineStyles[LineStyles["Wave"] = 25] = "Wave";
4432
- LineStyles[LineStyles["DoubleWave"] = 26] = "DoubleWave";
4433
- LineStyles[LineStyles["DashSmallGap"] = 27] = "DashSmallGap";
4434
- LineStyles[LineStyles["DashDotStroked"] = 28] = "DashDotStroked";
4435
- LineStyles[LineStyles["ThreeDEmboss"] = 29] = "ThreeDEmboss";
4436
- LineStyles[LineStyles["ThreeDEngrave"] = 30] = "ThreeDEngrave";
4437
- LineStyles[LineStyles["Outset"] = 31] = "Outset";
4438
- LineStyles[LineStyles["Inset"] = 32] = "Inset";
4439
- LineStyles[LineStyles["Nil"] = 33] = "Nil";
4440
- })(LineStyles || (LineStyles = {}));
4441
-
4442
4452
  var Positions;
4443
4453
  (function (Positions) {
4444
4454
  Positions[Positions["Top"] = 0] = "Top";
@@ -8745,8 +8755,10 @@ class Editor {
8745
8755
  command = SaveCommandsHelper.getInsertStyledTextCommand(text, insertIndex, textStyle, this.targets);
8746
8756
  }
8747
8757
  else if (operation instanceof RestoreModel) {
8748
- this.session.restore(structuredClone(operation));
8749
- command = SaveCommandsHelper.getRestoreCommand(structuredClone(operation), this.targets);
8758
+ const deepCopy = structuredClone(operation);
8759
+ this.editorService.restoreCustomElementsData(deepCopy.elements);
8760
+ this.session.restore(deepCopy);
8761
+ command = SaveCommandsHelper.getRestoreCommand(deepCopy, this.targets);
8750
8762
  }
8751
8763
  else if (operation instanceof ApplyTextStyleModel) {
8752
8764
  this.session.applyTextStyle(operation.startIndex, operation.endIndex, new TextStyleModel(operation.textStyle));
@@ -8858,8 +8870,10 @@ class Editor {
8858
8870
  command = SaveCommandsHelper.getRemoveWithParagraphCommand(operation, this.targets);
8859
8871
  }
8860
8872
  else if (operation instanceof RestoreWithParagraphModel) {
8861
- this.session.restoreWithParagraph(operation);
8862
- command = SaveCommandsHelper.getRestoreWithParagraphCommand(operation, this.targets);
8873
+ const deepCopy = structuredClone(operation);
8874
+ this.editorService.restoreCustomElementsData(deepCopy.restore.elements);
8875
+ this.session.restoreWithParagraph(deepCopy);
8876
+ command = SaveCommandsHelper.getRestoreWithParagraphCommand(deepCopy, this.targets);
8863
8877
  }
8864
8878
  else if (operation instanceof MoveRangeModel) {
8865
8879
  this.moveRange(operation);
@@ -8891,8 +8905,10 @@ class Editor {
8891
8905
  this.recreateMainSession();
8892
8906
  }
8893
8907
  else if (operation instanceof ReplaceByRestoreModel) {
8894
- this.session.replaceByRestore(structuredClone(operation));
8895
- command = SaveCommandsHelper.getReplaceByRestoreCommand(structuredClone(operation), this.targets);
8908
+ const deepCopy = structuredClone(operation);
8909
+ this.editorService.restoreCustomElementsData(deepCopy.restore.elements);
8910
+ this.session.replaceByRestore(structuredClone(deepCopy));
8911
+ command = SaveCommandsHelper.getReplaceByRestoreCommand(structuredClone(deepCopy), this.targets);
8896
8912
  }
8897
8913
  else if (operation instanceof ApplyParagraphsModel) {
8898
8914
  const deepCopy = structuredClone(operation);
@@ -19196,5 +19212,5 @@ class OperationModel {
19196
19212
  * Generated bundle index. Do not edit.
19197
19213
  */
19198
19214
 
19199
- export { AddLinkDialogComponent, 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, EditorService, EditorTitleComponent, EditorTitleMobileComponent, EditorToolbarComponent, EditorToolbarMode, EditorToolbarModule, EditorToolbarService, ElementDataModel, ElementModel, ExternalComponent, ExternalElementModel, ExternalElementService, FileSourceModel, FontMetrics, FormatStyleHelper, GrammarService, HYPERLINK_FONT_COLOR, HYPERLINK_HEADING_STYLE_ID, ImageApiService, ImageDataModel, LastDocumentRevisionModel, MenuDropdownsComponent, MenuDropdownsMobileComponent, Mode, NEW_LINE_MARKUP, NoderTranslateLoader, NumberingLevelModel, OperationModel, OperationsHistoryInfoModel, PageSetupComponent, PageType, ParagraphStyleModel, RevisionHelper, RevisionModel, SearchResultLocation, TextFormatMobileComponent, TextStyleModel, ToolbarActionsComponent };
19215
+ export { AddLinkDialogComponent, AddLinkMobileComponent, Alignment, BaseNoderComponent, Borders, 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, EditorService, EditorTitleComponent, EditorTitleMobileComponent, EditorToolbarComponent, EditorToolbarMode, EditorToolbarModule, EditorToolbarService, ElementDataModel, ElementModel, ExternalComponent, ExternalElementModel, ExternalElementService, FileSourceModel, FontMetrics, FormatStyleHelper, GrammarService, HYPERLINK_FONT_COLOR, HYPERLINK_HEADING_STYLE_ID, ImageApiService, ImageDataModel, LastDocumentRevisionModel, LineStyles, MenuDropdownsComponent, MenuDropdownsMobileComponent, Mode, NEW_LINE_MARKUP, NoderTranslateLoader, NumberingLevelModel, OperationModel, OperationsHistoryInfoModel, PageSetupComponent, PageType, ParagraphStyleModel, RevisionHelper, RevisionModel, SearchResultLocation, TextFormatMobileComponent, TextStyleModel, ToolbarActionsComponent };
19200
19216
  //# sourceMappingURL=talrace-ngx-noder.mjs.map