@talrace/ngx-noder 0.0.8 → 0.0.9

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.
Files changed (93) hide show
  1. package/esm2022/lib/apart-components/add-link-dialog/add-link-dialog.component.mjs +15 -9
  2. package/esm2022/lib/apart-components/editor-toolbar/components/base-toolbar.component.mjs +8 -2
  3. package/esm2022/lib/apart-components/editor-toolbar/components/buttons/font/font.component.mjs +2 -2
  4. package/esm2022/lib/apart-components/editor-toolbar/components/buttons/font-size/font-size.component.mjs +3 -3
  5. package/esm2022/lib/apart-components/editor-toolbar/shared/toolbar-styles.helper.mjs +1 -8
  6. package/esm2022/lib/editor/components/edges/edge.component.mjs +2 -2
  7. package/esm2022/lib/editor/components/edges/edges.mjs +21 -2
  8. package/esm2022/lib/editor/components/image/input-handler/image-input.handler.mjs +18 -1
  9. package/esm2022/lib/editor/components/shared/services/custom-content.service.mjs +22 -56
  10. package/esm2022/lib/editor/components/table/components/table-cell.component.mjs +6 -6
  11. package/esm2022/lib/editor/components/table/components/table.component.mjs +13 -4
  12. package/esm2022/lib/editor/components/table/models/cell-data.model.mjs +3 -4
  13. package/esm2022/lib/editor/components/table/selection/table-selection.mjs +15 -5
  14. package/esm2022/lib/editor/content/constants/editor.const.mjs +9 -1
  15. package/esm2022/lib/editor/content/display-data/display-data.mjs +839 -0
  16. package/esm2022/lib/editor/content/display-data/general-properties.model.mjs +1 -1
  17. package/esm2022/lib/editor/content/display-data/models/paragraph-info.model.mjs +8 -0
  18. package/esm2022/lib/editor/content/display-data/paragraph.mjs +5 -1
  19. package/esm2022/lib/editor/content/display-data/text-line-info.mjs +2 -1
  20. package/esm2022/lib/editor/content/display-data/toolbar-styles.interface.mjs +1 -1
  21. package/esm2022/lib/editor/content/helpers/content-style.helper.mjs +12 -30
  22. package/esm2022/lib/editor/content/helpers/display-token.helper.mjs +62 -0
  23. package/esm2022/lib/editor/display/layers/cursor.layer.mjs +9 -8
  24. package/esm2022/lib/editor/display/layers/pages.layer.mjs +5 -5
  25. package/esm2022/lib/editor/display/layers/print.text.layer.mjs +2 -2
  26. package/esm2022/lib/editor/display/layers/selection.layer.mjs +15 -9
  27. package/esm2022/lib/editor/display/layers/text.layer.mjs +25 -27
  28. package/esm2022/lib/editor/display/print/print.renderer.mjs +8 -8
  29. package/esm2022/lib/editor/display/renderer.mjs +10 -10
  30. package/esm2022/lib/editor/display/rendering.helper.mjs +2 -4
  31. package/esm2022/lib/editor/display/virtual.renderer.mjs +5 -5
  32. package/esm2022/lib/editor/execution/edit.session.mjs +199 -755
  33. package/esm2022/lib/editor/execution/editor.mjs +116 -75
  34. package/esm2022/lib/editor/execution/helpers/format-style.helper.mjs +1 -33
  35. package/esm2022/lib/editor/execution/helpers/image.helpet.mjs +12 -0
  36. package/esm2022/lib/editor/execution/helpers/paragraph.helper.mjs +11 -3
  37. package/esm2022/lib/editor/execution/regulator.service.mjs +28 -20
  38. package/esm2022/lib/editor/gadgets/numbering/numbering-paragraph-style.model.mjs +13 -0
  39. package/esm2022/lib/editor/gadgets/numbering/numbering.helper.mjs +77 -10
  40. package/esm2022/lib/editor/gadgets/search/search.mjs +6 -6
  41. package/esm2022/lib/editor/interaction/editor.service.mjs +27 -6
  42. package/esm2022/lib/editor/interaction/input.handler.mjs +8 -5
  43. package/esm2022/lib/editor/interaction/mouse.handler.mjs +2 -1
  44. package/esm2022/lib/editor/operations/helpers/format-operations.helper.mjs +32 -2
  45. package/esm2022/lib/editor/operations/helpers/link-operations.helper.mjs +47 -12
  46. package/esm2022/lib/editor/operations/operations-helper.helper.mjs +13 -14
  47. package/esm2022/lib/editor/operations/save-commands.helper.mjs +2 -2
  48. package/esm2022/lib/editor/positioning/content.helper.mjs +15 -15
  49. package/esm2022/lib/editor/positioning/line-width.helper.mjs +5 -5
  50. package/esm2022/lib/editor/positioning/position.helper.mjs +34 -32
  51. package/esm2022/lib/editor/positioning/selection.mjs +42 -32
  52. package/esm2022/lib/editor/revision.helper.mjs +4 -3
  53. package/fesm2022/talrace-ngx-noder.mjs +3765 -3548
  54. package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
  55. package/lib/apart-components/add-link-dialog/add-link-dialog.component.d.ts +0 -1
  56. package/lib/apart-components/editor-toolbar/shared/toolbar-styles.helper.d.ts +0 -2
  57. package/lib/editor/components/image/input-handler/image-input.handler.d.ts +3 -0
  58. package/lib/editor/components/shared/services/custom-content.service.d.ts +3 -5
  59. package/lib/editor/components/table/components/table-cell.component.d.ts +1 -1
  60. package/lib/editor/components/table/components/table.component.d.ts +1 -0
  61. package/lib/editor/components/table/models/cell-data.model.d.ts +1 -1
  62. package/lib/editor/components/table/selection/table-selection.d.ts +2 -0
  63. package/lib/editor/content/constants/editor.const.d.ts +2 -0
  64. package/lib/editor/content/display-data/display-data.d.ts +103 -0
  65. package/lib/editor/content/display-data/general-properties.model.d.ts +5 -0
  66. package/lib/editor/content/display-data/models/paragraph-info.model.d.ts +9 -0
  67. package/lib/editor/content/display-data/paragraph.d.ts +1 -0
  68. package/lib/editor/content/display-data/text-line-info.d.ts +1 -0
  69. package/lib/editor/content/display-data/toolbar-styles.interface.d.ts +1 -1
  70. package/lib/editor/content/helpers/content-style.helper.d.ts +1 -2
  71. package/lib/editor/content/helpers/display-token.helper.d.ts +6 -0
  72. package/lib/editor/display/layers/text.layer.d.ts +1 -2
  73. package/lib/editor/display/print/print.renderer.d.ts +0 -2
  74. package/lib/editor/execution/edit.session.d.ts +11 -59
  75. package/lib/editor/execution/editor.d.ts +9 -6
  76. package/lib/editor/execution/helpers/format-style.helper.d.ts +0 -2
  77. package/lib/editor/execution/helpers/image.helpet.d.ts +4 -0
  78. package/lib/editor/execution/regulator.service.d.ts +1 -1
  79. package/lib/editor/gadgets/numbering/numbering-paragraph-style.model.d.ts +6 -0
  80. package/lib/editor/gadgets/numbering/numbering.helper.d.ts +10 -3
  81. package/lib/editor/interaction/editor.service.d.ts +12 -3
  82. package/lib/editor/operations/helpers/link-operations.helper.d.ts +5 -3
  83. package/lib/editor/positioning/content.helper.d.ts +6 -5
  84. package/lib/editor/positioning/position.helper.d.ts +3 -3
  85. package/lib/editor/positioning/selection.d.ts +3 -0
  86. package/package.json +1 -1
  87. package/src/_ngx-noder.theme.scss +31 -2
  88. package/esm2022/lib/editor/content/display-data/document.mjs +0 -134
  89. package/esm2022/lib/editor/content/display-data/pages.wrap.mjs +0 -226
  90. package/esm2022/lib/editor/execution/helpers/delta.helper.mjs +0 -18
  91. package/lib/editor/content/display-data/document.d.ts +0 -56
  92. package/lib/editor/content/display-data/pages.wrap.d.ts +0 -42
  93. package/lib/editor/execution/helpers/delta.helper.d.ts +0 -6
@@ -1,18 +0,0 @@
1
- import { CursorParagraph } from '../../positioning/cursor-paragraph';
2
- export class DeltaHelper {
3
- static remove(paragraphs, start, end) {
4
- const paragraph = paragraphs[start.row].slice(0, start.column) + paragraphs[end.row].slice(end.column);
5
- paragraphs.splice(start.row, end.row - start.row + 1, paragraph);
6
- }
7
- static insertTextAndReturnEndCursorPosition(paragraphs, text, position) {
8
- const left = paragraphs[position.row].slice(0, position.column);
9
- const right = paragraphs[position.row].slice(position.column);
10
- const insertParagraphs = this.splitByParagraphs(`${left}${text}${right}`);
11
- paragraphs.splice(position.row, 1, ...insertParagraphs);
12
- return new CursorParagraph(position.row + insertParagraphs.length - 1, insertParagraphs[insertParagraphs.length - 1].length - right.length);
13
- }
14
- static splitByParagraphs(text) {
15
- return text.split(/\r\n|\r|\n/);
16
- }
17
- }
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVsdGEuaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LW5vZGVyL3NyYy9saWIvZWRpdG9yL2V4ZWN1dGlvbi9oZWxwZXJzL2RlbHRhLmhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIj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yaW5nW10sIHRleHQ6IHN0cmluZywgcG9zaXRpb246IEN1cnNvclBhcmFncmFwaCk6IEN1cnNvclBhcmFncmFwaCB7XG4gICAgICAgIGNvbnN0IGxlZnQgPSBwYXJhZ3JhcGhzW3Bvc2l0aW9uLnJvd10uc2xpY2UoMCwgcG9zaXRpb24uY29sdW1uKTtcbiAgICAgICAgY29uc3QgcmlnaHQgPSBwYXJhZ3JhcGhzW3Bvc2l0aW9uLnJvd10uc2xpY2UocG9zaXRpb24uY29sdW1uKTtcbiAgICAgICAgY29uc3QgaW5zZXJ0UGFyYWdyYXBocyA9IHRoaXMuc3BsaXRCeVBhcmFncmFwaHMoYCR7bGVmdH0ke3RleHR9JHtyaWdodH1gKTtcbiAgICAgICAgcGFyYWdyYXBocy5zcGxpY2UocG9zaXRpb24ucm93LCAxLCAuLi5pbnNlcnRQYXJhZ3JhcGhzKTtcbiAgICAgICAgcmV0dXJuIG5ldyBDdXJzb3JQYXJhZ3JhcGgoXG4gICAgICAgICAgICBwb3NpdGlvbi5yb3cgKyBpbnNlcnRQYXJhZ3JhcGhzLmxlbmd0aCAtIDEsXG4gICAgICAgICAgICBpbnNlcnRQYXJhZ3JhcGhzW2luc2VydFBhcmFncmFwaHMubGVuZ3RoIC0gMV0ubGVuZ3RoIC0gcmlnaHQubGVuZ3RoXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgc3RhdGljIHNwbGl0QnlQYXJhZ3JhcGhzKHRleHQ6IHN0cmluZyk6IHN0cmluZ1tdIHtcbiAgICAgICAgcmV0dXJuIHRleHQuc3BsaXQoL1xcclxcbnxcXHJ8XFxuLyk7XG4gICAgfVxufVxuIl19
@@ -1,56 +0,0 @@
1
- import { BreakTypes } from '../../gadgets/page-break/break-types.enum';
2
- import { ContentsInterface } from '../contents.interface';
3
- import { CursorParagraph } from '../../positioning/cursor-paragraph';
4
- import { MarginModel } from '../margin.model';
5
- import { Range } from '../../positioning/range';
6
- export declare class Document {
7
- private model;
8
- pageMargin: MarginModel;
9
- pagesSpace: number;
10
- pageWidth: number;
11
- pageHeight?: number;
12
- lines: string[];
13
- /**
14
- * Returns all the lines in the document as a single string, joined by the new line character.
15
- **/
16
- get text(): string;
17
- get length(): number;
18
- constructor(model: ContentsInterface, pageMargin: MarginModel, pagesSpace: number, pageWidth: number, pageHeight?: number);
19
- insertText(position: CursorParagraph, text: string): CursorParagraph;
20
- /**
21
- * Removes the `range` from the document.
22
- **/
23
- removeRange(range: Range): void;
24
- getLine(lines: string[], index: number): string;
25
- getAllLines(): string[];
26
- getLinesCount(): number;
27
- getLines(firstRow: number, lastRow: number): string[];
28
- /**
29
- * Returns all the text within `range` as an array of lines.
30
- **/
31
- getLinesForRange(range: Range): string[];
32
- /**
33
- * Returns all the text within `range` as a single string.
34
- **/
35
- getTextRange(range: Range): string;
36
- /**
37
- * Converts the position in a document to the character's index.
38
- */
39
- positionToIndex(position: CursorParagraph, startRow?: number): number;
40
- /**
41
- * Converts an index position in a document to the position.
42
- * See 'positionToIndex' for more information.
43
- */
44
- indexToPosition(positionIndex: number, startRow: number): CursorParagraph;
45
- indexesToRange(startIndex: number, endIndex: number): Range;
46
- isNewLineSymbol(index: number): boolean;
47
- /**
48
- * Converts the selection range in a document to the selected paragraphs indexes (start and end of paragraphs).
49
- * start/end refers to the "absolute position" of a character in the document.
50
- */
51
- getSelectedParagraphsByRange(range: Range): {
52
- start: number;
53
- end: number;
54
- };
55
- getPositionAfterBreak(position: CursorParagraph, breakType: BreakTypes): CursorParagraph;
56
- }
@@ -1,42 +0,0 @@
1
- import { DisplayToken } from './display-token.model';
2
- import { EdgeType } from '../../components/edges/edge-type.enum';
3
- import { EventEmitting } from '../../core/event-emitting';
4
- import { ICustomComponents } from '../../components/shared/custom-components.interface';
5
- import { LineInfoModel } from './line-info.model';
6
- import { MarginModel } from '../margin.model';
7
- import { NumberingModel } from '../../../models/generated/numbering.model';
8
- import { PageVerticalDataModel } from '../page-vertical-data.model';
9
- import { Paragraph } from './paragraph';
10
- import { ParagraphModel } from '../../../models/generated/paragraph.model';
11
- import { VisibleRange } from '../../display/visible-range.interface';
12
- export declare class PagesWrap extends EventEmitting {
13
- pagesSpace: number;
14
- documentMargin: MarginModel;
15
- pageWidth: number;
16
- pageHeight: number;
17
- customComponents: ICustomComponents;
18
- contentWidth: number;
19
- allPagesHeight: number;
20
- minHeight: number;
21
- paragraphs: Paragraph[];
22
- tabTokens: DisplayToken[];
23
- pagesVerticalData: PageVerticalDataModel[];
24
- get defaultVerticalData(): PageVerticalDataModel;
25
- private processTextLinesProperties;
26
- constructor(pagesSpace: number, documentMargin: MarginModel, pageWidth: number, pageHeight: number, customComponents: ICustomComponents);
27
- getParagraphTop(index: number): number;
28
- getParagraphTopForPrint(index: number): number;
29
- getParagraphHeight(index: number): number;
30
- remove(index: number, length: number): void;
31
- reset(paragraphsLength: number): void;
32
- set(row: number, lineInfos: LineInfoModel[], numberings: NumberingModel[], docParagraphs: ParagraphModel[]): void;
33
- getVisibleRange(offsetTop: number, scrollerHeight: number): VisibleRange;
34
- processParagraphsProperties(startParagraphIndex: number, wrapParagraphIndex: number[]): void;
35
- getAllParagraphsHeight(): number;
36
- destroy(): void;
37
- updatePageVerticalData(edgeType: EdgeType, page: number, wrapParagraphIndex: number[]): void;
38
- private getPreviousParagraphInfo;
39
- private getVisiblePages;
40
- private initPagesVerticalData;
41
- private setParagraphIndexes;
42
- }
@@ -1,6 +0,0 @@
1
- import { CursorParagraph } from '../../positioning/cursor-paragraph';
2
- export declare class DeltaHelper {
3
- static remove(paragraphs: string[], start: CursorParagraph, end: CursorParagraph): void;
4
- static insertTextAndReturnEndCursorPosition(paragraphs: string[], text: string, position: CursorParagraph): CursorParagraph;
5
- static splitByParagraphs(text: string): string[];
6
- }