@productcloudos/editor 1.0.0

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 (166) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/LICENSE +21 -0
  3. package/README.md +377 -0
  4. package/dist/pc-editor.esm.js +24820 -0
  5. package/dist/pc-editor.esm.js.map +1 -0
  6. package/dist/pc-editor.js +24877 -0
  7. package/dist/pc-editor.js.map +1 -0
  8. package/dist/pc-editor.min.js +2 -0
  9. package/dist/pc-editor.min.js.map +1 -0
  10. package/dist/types/lib/clipboard/ClipboardManager.d.ts +77 -0
  11. package/dist/types/lib/clipboard/ClipboardManager.d.ts.map +1 -0
  12. package/dist/types/lib/clipboard/HtmlConverter.d.ts +43 -0
  13. package/dist/types/lib/clipboard/HtmlConverter.d.ts.map +1 -0
  14. package/dist/types/lib/clipboard/index.d.ts +9 -0
  15. package/dist/types/lib/clipboard/index.d.ts.map +1 -0
  16. package/dist/types/lib/clipboard/types.d.ts +76 -0
  17. package/dist/types/lib/clipboard/types.d.ts.map +1 -0
  18. package/dist/types/lib/controls/BaseControl.d.ts +72 -0
  19. package/dist/types/lib/controls/BaseControl.d.ts.map +1 -0
  20. package/dist/types/lib/controls/index.d.ts +11 -0
  21. package/dist/types/lib/controls/index.d.ts.map +1 -0
  22. package/dist/types/lib/controls/rulers/HorizontalRuler.d.ts +55 -0
  23. package/dist/types/lib/controls/rulers/HorizontalRuler.d.ts.map +1 -0
  24. package/dist/types/lib/controls/rulers/RulerControl.d.ts +98 -0
  25. package/dist/types/lib/controls/rulers/RulerControl.d.ts.map +1 -0
  26. package/dist/types/lib/controls/rulers/VerticalRuler.d.ts +65 -0
  27. package/dist/types/lib/controls/rulers/VerticalRuler.d.ts.map +1 -0
  28. package/dist/types/lib/controls/rulers/index.d.ts +8 -0
  29. package/dist/types/lib/controls/rulers/index.d.ts.map +1 -0
  30. package/dist/types/lib/controls/rulers/types.d.ts +62 -0
  31. package/dist/types/lib/controls/rulers/types.d.ts.map +1 -0
  32. package/dist/types/lib/controls/types.d.ts +51 -0
  33. package/dist/types/lib/controls/types.d.ts.map +1 -0
  34. package/dist/types/lib/core/Document.d.ts +34 -0
  35. package/dist/types/lib/core/Document.d.ts.map +1 -0
  36. package/dist/types/lib/core/PCEditor.d.ts +761 -0
  37. package/dist/types/lib/core/PCEditor.d.ts.map +1 -0
  38. package/dist/types/lib/core/Page.d.ts +40 -0
  39. package/dist/types/lib/core/Page.d.ts.map +1 -0
  40. package/dist/types/lib/data/DataBinder.d.ts +11 -0
  41. package/dist/types/lib/data/DataBinder.d.ts.map +1 -0
  42. package/dist/types/lib/events/EventEmitter.d.ts +11 -0
  43. package/dist/types/lib/events/EventEmitter.d.ts.map +1 -0
  44. package/dist/types/lib/hit-test/HitTestManager.d.ts +81 -0
  45. package/dist/types/lib/hit-test/HitTestManager.d.ts.map +1 -0
  46. package/dist/types/lib/hit-test/index.d.ts +32 -0
  47. package/dist/types/lib/hit-test/index.d.ts.map +1 -0
  48. package/dist/types/lib/hit-test/types.d.ts +113 -0
  49. package/dist/types/lib/hit-test/types.d.ts.map +1 -0
  50. package/dist/types/lib/import/ContentAnalyzer.d.ts +76 -0
  51. package/dist/types/lib/import/ContentAnalyzer.d.ts.map +1 -0
  52. package/dist/types/lib/import/DocumentBuilder.d.ts +44 -0
  53. package/dist/types/lib/import/DocumentBuilder.d.ts.map +1 -0
  54. package/dist/types/lib/import/PDFImporter.d.ts +65 -0
  55. package/dist/types/lib/import/PDFImporter.d.ts.map +1 -0
  56. package/dist/types/lib/import/PDFParser.d.ts +46 -0
  57. package/dist/types/lib/import/PDFParser.d.ts.map +1 -0
  58. package/dist/types/lib/import/index.d.ts +9 -0
  59. package/dist/types/lib/import/index.d.ts.map +1 -0
  60. package/dist/types/lib/import/types.d.ts +182 -0
  61. package/dist/types/lib/import/types.d.ts.map +1 -0
  62. package/dist/types/lib/index.d.ts +16 -0
  63. package/dist/types/lib/index.d.ts.map +1 -0
  64. package/dist/types/lib/layout/FlowManager.d.ts +29 -0
  65. package/dist/types/lib/layout/FlowManager.d.ts.map +1 -0
  66. package/dist/types/lib/layout/LayoutEngine.d.ts +39 -0
  67. package/dist/types/lib/layout/LayoutEngine.d.ts.map +1 -0
  68. package/dist/types/lib/objects/BaseEmbeddedObject.d.ts +133 -0
  69. package/dist/types/lib/objects/BaseEmbeddedObject.d.ts.map +1 -0
  70. package/dist/types/lib/objects/EmbeddedObjectFactory.d.ts +57 -0
  71. package/dist/types/lib/objects/EmbeddedObjectFactory.d.ts.map +1 -0
  72. package/dist/types/lib/objects/ImageObject.d.ts +60 -0
  73. package/dist/types/lib/objects/ImageObject.d.ts.map +1 -0
  74. package/dist/types/lib/objects/TextBoxObject.d.ts +208 -0
  75. package/dist/types/lib/objects/TextBoxObject.d.ts.map +1 -0
  76. package/dist/types/lib/objects/index.d.ts +9 -0
  77. package/dist/types/lib/objects/index.d.ts.map +1 -0
  78. package/dist/types/lib/objects/table/TableCell.d.ts +165 -0
  79. package/dist/types/lib/objects/table/TableCell.d.ts.map +1 -0
  80. package/dist/types/lib/objects/table/TableCellMerger.d.ts +66 -0
  81. package/dist/types/lib/objects/table/TableCellMerger.d.ts.map +1 -0
  82. package/dist/types/lib/objects/table/TableObject.d.ts +434 -0
  83. package/dist/types/lib/objects/table/TableObject.d.ts.map +1 -0
  84. package/dist/types/lib/objects/table/TableResizeHandler.d.ts +80 -0
  85. package/dist/types/lib/objects/table/TableResizeHandler.d.ts.map +1 -0
  86. package/dist/types/lib/objects/table/TableRow.d.ts +65 -0
  87. package/dist/types/lib/objects/table/TableRow.d.ts.map +1 -0
  88. package/dist/types/lib/objects/table/index.d.ts +12 -0
  89. package/dist/types/lib/objects/table/index.d.ts.map +1 -0
  90. package/dist/types/lib/objects/table/types.d.ts +239 -0
  91. package/dist/types/lib/objects/table/types.d.ts.map +1 -0
  92. package/dist/types/lib/objects/types.d.ts +135 -0
  93. package/dist/types/lib/objects/types.d.ts.map +1 -0
  94. package/dist/types/lib/rendering/CanvasManager.d.ts +282 -0
  95. package/dist/types/lib/rendering/CanvasManager.d.ts.map +1 -0
  96. package/dist/types/lib/rendering/FlowingTextRenderer.d.ts +348 -0
  97. package/dist/types/lib/rendering/FlowingTextRenderer.d.ts.map +1 -0
  98. package/dist/types/lib/rendering/PDFGenerator.d.ts +103 -0
  99. package/dist/types/lib/rendering/PDFGenerator.d.ts.map +1 -0
  100. package/dist/types/lib/rendering/pdf-utils.d.ts +54 -0
  101. package/dist/types/lib/rendering/pdf-utils.d.ts.map +1 -0
  102. package/dist/types/lib/text/EditableTextRegion.d.ts +105 -0
  103. package/dist/types/lib/text/EditableTextRegion.d.ts.map +1 -0
  104. package/dist/types/lib/text/EmbeddedObjectManager.d.ts +97 -0
  105. package/dist/types/lib/text/EmbeddedObjectManager.d.ts.map +1 -0
  106. package/dist/types/lib/text/FieldFormatter.d.ts +26 -0
  107. package/dist/types/lib/text/FieldFormatter.d.ts.map +1 -0
  108. package/dist/types/lib/text/FlowingTextContent.d.ts +571 -0
  109. package/dist/types/lib/text/FlowingTextContent.d.ts.map +1 -0
  110. package/dist/types/lib/text/HyperlinkManager.d.ts +110 -0
  111. package/dist/types/lib/text/HyperlinkManager.d.ts.map +1 -0
  112. package/dist/types/lib/text/MarkdownParser.d.ts +55 -0
  113. package/dist/types/lib/text/MarkdownParser.d.ts.map +1 -0
  114. package/dist/types/lib/text/ParagraphFormatting.d.ts +123 -0
  115. package/dist/types/lib/text/ParagraphFormatting.d.ts.map +1 -0
  116. package/dist/types/lib/text/RegionManager.d.ts +75 -0
  117. package/dist/types/lib/text/RegionManager.d.ts.map +1 -0
  118. package/dist/types/lib/text/RepeatingSectionManager.d.ts +99 -0
  119. package/dist/types/lib/text/RepeatingSectionManager.d.ts.map +1 -0
  120. package/dist/types/lib/text/SubstitutionFieldManager.d.ts +153 -0
  121. package/dist/types/lib/text/SubstitutionFieldManager.d.ts.map +1 -0
  122. package/dist/types/lib/text/TextFormatting.d.ts +85 -0
  123. package/dist/types/lib/text/TextFormatting.d.ts.map +1 -0
  124. package/dist/types/lib/text/TextLayout.d.ts +126 -0
  125. package/dist/types/lib/text/TextLayout.d.ts.map +1 -0
  126. package/dist/types/lib/text/TextMeasurer.d.ts +107 -0
  127. package/dist/types/lib/text/TextMeasurer.d.ts.map +1 -0
  128. package/dist/types/lib/text/TextPositionCalculator.d.ts +72 -0
  129. package/dist/types/lib/text/TextPositionCalculator.d.ts.map +1 -0
  130. package/dist/types/lib/text/TextState.d.ts +236 -0
  131. package/dist/types/lib/text/TextState.d.ts.map +1 -0
  132. package/dist/types/lib/text/index.d.ts +27 -0
  133. package/dist/types/lib/text/index.d.ts.map +1 -0
  134. package/dist/types/lib/text/regions/BodyTextRegion.d.ts +68 -0
  135. package/dist/types/lib/text/regions/BodyTextRegion.d.ts.map +1 -0
  136. package/dist/types/lib/text/regions/FooterTextRegion.d.ts +68 -0
  137. package/dist/types/lib/text/regions/FooterTextRegion.d.ts.map +1 -0
  138. package/dist/types/lib/text/regions/HeaderTextRegion.d.ts +68 -0
  139. package/dist/types/lib/text/regions/HeaderTextRegion.d.ts.map +1 -0
  140. package/dist/types/lib/text/regions/index.d.ts +7 -0
  141. package/dist/types/lib/text/regions/index.d.ts.map +1 -0
  142. package/dist/types/lib/text/types.d.ts +268 -0
  143. package/dist/types/lib/text/types.d.ts.map +1 -0
  144. package/dist/types/lib/types/index.d.ts +206 -0
  145. package/dist/types/lib/types/index.d.ts.map +1 -0
  146. package/dist/types/lib/undo/index.d.ts +8 -0
  147. package/dist/types/lib/undo/index.d.ts.map +1 -0
  148. package/dist/types/lib/undo/transaction/ContentDiscovery.d.ts +101 -0
  149. package/dist/types/lib/undo/transaction/ContentDiscovery.d.ts.map +1 -0
  150. package/dist/types/lib/undo/transaction/FocusTracker.d.ts +49 -0
  151. package/dist/types/lib/undo/transaction/FocusTracker.d.ts.map +1 -0
  152. package/dist/types/lib/undo/transaction/MutationUndo.d.ts +57 -0
  153. package/dist/types/lib/undo/transaction/MutationUndo.d.ts.map +1 -0
  154. package/dist/types/lib/undo/transaction/ObjectMutationObserver.d.ts +79 -0
  155. package/dist/types/lib/undo/transaction/ObjectMutationObserver.d.ts.map +1 -0
  156. package/dist/types/lib/undo/transaction/TextMutationObserver.d.ts +60 -0
  157. package/dist/types/lib/undo/transaction/TextMutationObserver.d.ts.map +1 -0
  158. package/dist/types/lib/undo/transaction/TransactionManager.d.ts +148 -0
  159. package/dist/types/lib/undo/transaction/TransactionManager.d.ts.map +1 -0
  160. package/dist/types/lib/undo/transaction/index.d.ts +17 -0
  161. package/dist/types/lib/undo/transaction/index.d.ts.map +1 -0
  162. package/dist/types/lib/undo/transaction/types.d.ts +269 -0
  163. package/dist/types/lib/undo/transaction/types.d.ts.map +1 -0
  164. package/dist/types/lib/utils/blob-utils.d.ts +2 -0
  165. package/dist/types/lib/utils/blob-utils.d.ts.map +1 -0
  166. package/package.json +88 -0
@@ -0,0 +1,85 @@
1
+ import { EventEmitter } from '../events/EventEmitter';
2
+ import { TextFormattingStyle } from './types';
3
+ /**
4
+ * Manages per-character text formatting.
5
+ * Stores formatting overrides for specific character positions.
6
+ */
7
+ export declare class TextFormattingManager extends EventEmitter {
8
+ private formatting;
9
+ private _defaultFormatting;
10
+ private _pendingFormatting;
11
+ constructor(defaultFormatting?: Partial<TextFormattingStyle>);
12
+ /**
13
+ * Get the default formatting applied to unformatted text.
14
+ */
15
+ get defaultFormatting(): TextFormattingStyle;
16
+ /**
17
+ * Update the default formatting.
18
+ */
19
+ setDefaultFormatting(formatting: Partial<TextFormattingStyle>): void;
20
+ /**
21
+ * Get formatting at a specific character position.
22
+ * Returns the position-specific formatting or the default.
23
+ */
24
+ getFormattingAt(position: number): TextFormattingStyle;
25
+ /**
26
+ * Apply formatting to a range of characters.
27
+ * @param start Start position
28
+ * @param end End position
29
+ * @param formatting Formatting to apply
30
+ * @param silent If true, don't emit the formatting-changed event (used for inherited formatting during text insertion)
31
+ */
32
+ applyFormatting(start: number, end: number, formatting: Partial<TextFormattingStyle>, silent?: boolean): void;
33
+ /**
34
+ * Remove formatting from a range, reverting to default.
35
+ */
36
+ clearFormatting(start: number, end: number): void;
37
+ /**
38
+ * Shift formatting positions when text is inserted or deleted.
39
+ * @param fromIndex The position where the change occurred
40
+ * @param delta Positive for insertion, negative for deletion
41
+ */
42
+ shiftFormatting(fromIndex: number, delta: number): void;
43
+ /**
44
+ * Remove formatting for deleted text range and shift remaining.
45
+ * @param start Start of deleted range
46
+ * @param length Length of deleted text
47
+ */
48
+ handleDeletion(start: number, length: number): void;
49
+ /**
50
+ * Get all formatting entries (for serialization).
51
+ */
52
+ getAllFormatting(): Map<number, TextFormattingStyle>;
53
+ /**
54
+ * Restore formatting from a map (for deserialization).
55
+ */
56
+ setAllFormatting(formatting: Map<number, TextFormattingStyle>): void;
57
+ /**
58
+ * Clear all formatting.
59
+ */
60
+ clear(): void;
61
+ /**
62
+ * Set pending formatting to apply to the next inserted character.
63
+ * Used when formatting is applied with just a cursor (no selection).
64
+ */
65
+ setPendingFormatting(formatting: Partial<TextFormattingStyle>): void;
66
+ /**
67
+ * Get the current pending formatting, if any.
68
+ */
69
+ getPendingFormatting(): Partial<TextFormattingStyle> | null;
70
+ /**
71
+ * Check if there is pending formatting.
72
+ */
73
+ hasPendingFormatting(): boolean;
74
+ /**
75
+ * Clear pending formatting.
76
+ */
77
+ clearPendingFormatting(): void;
78
+ /**
79
+ * Apply pending formatting to a range.
80
+ * Called when text is inserted. Does NOT clear pending formatting
81
+ * so it can be applied to subsequent typed characters.
82
+ */
83
+ applyPendingFormatting(start: number, length: number): void;
84
+ }
85
+ //# sourceMappingURL=TextFormatting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextFormatting.d.ts","sourceRoot":"","sources":["../../../../src/lib/text/TextFormatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAsB,M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IAAI,OAAO;IAI/B;;OAEG;IACH,sBAAsB,IAAI,IAAI;IAO9B;;;;OAIG;IACH,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAO5D"}
@@ -0,0 +1,126 @@
1
+ import { TextMeasurer } from './TextMeasurer';
2
+ import { TextFormattingManager } from './TextFormatting';
3
+ import { ParagraphFormattingManager } from './ParagraphFormatting';
4
+ import { SubstitutionFieldManager } from './SubstitutionFieldManager';
5
+ import { EmbeddedObjectManager } from './EmbeddedObjectManager';
6
+ import { FlowedPage } from './types';
7
+ /**
8
+ * Context for text layout operations.
9
+ */
10
+ export interface LayoutContext {
11
+ availableWidth: number;
12
+ availableHeight: number;
13
+ measurer: TextMeasurer;
14
+ formatting: TextFormattingManager;
15
+ paragraphFormatting: ParagraphFormattingManager;
16
+ substitutionFields: SubstitutionFieldManager;
17
+ embeddedObjects: EmbeddedObjectManager;
18
+ content: string;
19
+ }
20
+ /**
21
+ * Handles text layout: line breaking and page flow.
22
+ * This is the core algorithm for flowing text across multiple lines and pages.
23
+ */
24
+ export declare class TextLayout {
25
+ /**
26
+ * Flow text content into pages based on available dimensions.
27
+ */
28
+ flowText(content: string, context: LayoutContext): FlowedPage[];
29
+ /**
30
+ * Split content by newline and page break characters.
31
+ */
32
+ private splitIntoLogicalLines;
33
+ /**
34
+ * Wrap a single logical line into one or more visual lines.
35
+ * Handles per-character formatting by creating separate runs when formatting changes.
36
+ * Uses a segment-based approach for more robust line breaking.
37
+ */
38
+ private wrapLogicalLine;
39
+ /**
40
+ * Create a dedicated line for a block-positioned object.
41
+ */
42
+ private createBlockObjectLine;
43
+ /**
44
+ * Split text into segments at whitespace boundaries, measuring each segment.
45
+ */
46
+ private splitIntoSegments;
47
+ /**
48
+ * Measure a segment of text, creating runs for formatting changes.
49
+ */
50
+ private measureSegment;
51
+ /**
52
+ * Add a segment to a line, adjusting x positions.
53
+ */
54
+ private addSegmentToLine;
55
+ /**
56
+ * Compare two formatting objects for equality.
57
+ */
58
+ private formattingEquals;
59
+ /**
60
+ * Create a new line builder with default values.
61
+ */
62
+ private createLineBuilder;
63
+ /**
64
+ * Finalize a line builder into a FlowedLine.
65
+ */
66
+ private finalizeLineBuilder;
67
+ /**
68
+ * Count word gaps in text (transitions from word to whitespace).
69
+ */
70
+ private countWordGaps;
71
+ /**
72
+ * Get the width of a line excluding trailing whitespace.
73
+ */
74
+ private getTrimmedLineWidth;
75
+ /**
76
+ * Create an empty line for newline-only content.
77
+ */
78
+ private createEmptyLine;
79
+ /**
80
+ * Create an empty page with one empty line.
81
+ */
82
+ private createEmptyPage;
83
+ /**
84
+ * Split lines into pages based on available height.
85
+ */
86
+ private paginateLines;
87
+ /**
88
+ * Find which page and line contains a given text index.
89
+ */
90
+ findPositionForIndex(pages: FlowedPage[], textIndex: number): {
91
+ pageIndex: number;
92
+ lineIndex: number;
93
+ } | null;
94
+ /**
95
+ * Get all paragraph boundaries in the content.
96
+ * Returns indices that are valid start points for repeating sections:
97
+ * - Index 0 (start of content)
98
+ * - Index immediately after each newline character
99
+ */
100
+ getParagraphBoundaries(content: string): number[];
101
+ /**
102
+ * Calculate total indent for a list nesting level.
103
+ */
104
+ private calculateListIndent;
105
+ /**
106
+ * Get the marker text for a list item.
107
+ */
108
+ private getListMarkerText;
109
+ /**
110
+ * Get bullet character based on style and nesting level.
111
+ */
112
+ private getBulletCharacter;
113
+ /**
114
+ * Format a number according to the numbering style.
115
+ */
116
+ private formatNumber;
117
+ /**
118
+ * Convert a number to alphabetic representation (1=a, 2=b, ... 26=z, 27=aa, ...)
119
+ */
120
+ private toAlpha;
121
+ /**
122
+ * Convert a number to Roman numerals.
123
+ */
124
+ private toRoman;
125
+ }
126
+ //# sourceMappingURL=TextLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextLayout.d.ts","sourceRoot":"","sources":["../../../../src/lib/text/TextLayout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA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IAwBvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAiGrB;;OAEG;IACH,oBAAoB,CAClB,KAAK,EAAE,UAAU,EAAE,EACnB,SAAS,EAAE,MAAM,GAChB;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAuBlD;;;;;OAKG;IACH,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;IAiBjD;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IASzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAWpB;;OAEG;IACH,OAAO,CAAC,OAAO;IAUf;;OAEG;IACH,OAAO,CAAC,OAAO;CAgBhB"}
@@ -0,0 +1,107 @@
1
+ import { TextFormattingStyle, SubstitutionField } from './types';
2
+ import { BaseEmbeddedObject } from '../objects';
3
+ /**
4
+ * Result of measuring embedded content at a position.
5
+ */
6
+ export interface EmbeddedMeasurement {
7
+ width: number;
8
+ height: number;
9
+ type: 'field' | 'object' | 'none';
10
+ field?: SubstitutionField;
11
+ object?: BaseEmbeddedObject;
12
+ }
13
+ /**
14
+ * Encapsulates all text measurement operations.
15
+ * Single source of truth for font string generation and text metrics.
16
+ */
17
+ export declare class TextMeasurer {
18
+ private ctx;
19
+ private fontCache;
20
+ constructor(ctx: CanvasRenderingContext2D);
21
+ /**
22
+ * Convert formatting to a CSS font string.
23
+ * This is the canonical implementation - all other code should use this.
24
+ */
25
+ toFontString(formatting: TextFormattingStyle): string;
26
+ /**
27
+ * Measure the width of text with given formatting.
28
+ */
29
+ measureText(text: string, formatting: TextFormattingStyle): number;
30
+ /**
31
+ * Measure a single character width.
32
+ * Handles special characters like tabs.
33
+ */
34
+ measureCharacter(char: string, formatting: TextFormattingStyle): number;
35
+ /**
36
+ * Calculate the line height for given formatting.
37
+ */
38
+ getLineHeight(formatting: TextFormattingStyle): number;
39
+ /**
40
+ * Calculate the baseline offset for given formatting.
41
+ */
42
+ getBaseline(formatting: TextFormattingStyle): number;
43
+ /**
44
+ * Find the character index at a given x position within text.
45
+ * Returns the index of the character at or just before the x position.
46
+ */
47
+ getCharacterIndexAtX(text: string, x: number, formatting: TextFormattingStyle, startIndex?: number): number;
48
+ /**
49
+ * Get the x position for a character index within text.
50
+ */
51
+ getXPositionForIndex(text: string, index: number, formatting: TextFormattingStyle, startIndex?: number): number;
52
+ /**
53
+ * Update the canvas context (e.g., when switching pages).
54
+ */
55
+ setContext(ctx: CanvasRenderingContext2D): void;
56
+ /**
57
+ * Get the display text for a substitution field.
58
+ * @param field The substitution field
59
+ * @param pageNumber Optional current page number (1-based) for page number fields
60
+ * @param pageCount Optional total page count for page count fields
61
+ */
62
+ getFieldDisplayText(field: SubstitutionField, pageNumber?: number, pageCount?: number): string;
63
+ /**
64
+ * Measure a substitution field's display text.
65
+ * @param field The substitution field
66
+ * @param defaultFormatting Default formatting to use if field has none
67
+ * @param pageNumber Optional current page number (1-based) for page number fields
68
+ * @param pageCount Optional total page count for page count fields
69
+ */
70
+ measureSubstitutionField(field: SubstitutionField, defaultFormatting?: TextFormattingStyle, pageNumber?: number, pageCount?: number): {
71
+ width: number;
72
+ height: number;
73
+ };
74
+ /**
75
+ * Measure an embedded object.
76
+ */
77
+ measureEmbeddedObject(object: BaseEmbeddedObject): {
78
+ width: number;
79
+ height: number;
80
+ };
81
+ /**
82
+ * Measure embedded content at a specific position.
83
+ * Checks both substitution fields and embedded objects.
84
+ */
85
+ measureEmbeddedAt(textIndex: number, fields: Map<number, SubstitutionField>, objects: Map<number, BaseEmbeddedObject>, defaultFormatting?: TextFormattingStyle): EmbeddedMeasurement;
86
+ /**
87
+ * Measure a word, accounting for both substitution fields and embedded objects.
88
+ * Returns the total width including all embedded content widths, plus x offsets
89
+ * for each field and object within the word.
90
+ */
91
+ measureWordWithEmbedded(word: string, formatting: TextFormattingStyle, fields: Map<number, SubstitutionField>, objects: Map<number, BaseEmbeddedObject>, wordStartIndex: number): {
92
+ width: number;
93
+ height: number;
94
+ fields: Array<{
95
+ field: SubstitutionField;
96
+ textIndex: number;
97
+ width: number;
98
+ xOffset: number;
99
+ }>;
100
+ objects: Array<{
101
+ object: BaseEmbeddedObject;
102
+ textIndex: number;
103
+ xOffset: number;
104
+ }>;
105
+ };
106
+ }
107
+ //# sourceMappingURL=TextMeasurer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextMeasurer.d.ts","sourceRoot":"","sources":["../../../../src/lib/text/TextMeasurer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAGlB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,GAAG,CAA2B;IACtC,OAAO,CAAC,SAAS,CAAkC;gBAEvC,GAAG,EAAE,wBAAwB;IAIzC;;;OAGG;IACH,YAAY,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM;IAYrD;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,GAAG,MAAM;IAKlE;;;OAGG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,GAAG,MAAM;IAQvE;;OAEG;IACH,aAAa,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM;IAItD;;OAEG;IACH,WAAW,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAA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CAAC,EACxC,cAAc,EAAE,MAAM,GACrB;QACD,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,KAAK,CAAC;YAAE,KAAK,EAAE,iBAAiB,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC/F,OAAO,EAAE,KAAK,CAAC;YAAE,MAAM,EAAE,kBAAkB,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACpF;CA2CF"}
@@ -0,0 +1,72 @@
1
+ import { FlowedLine, TextFormattingStyle } from './types';
2
+ /**
3
+ * Result of finding a line at a Y position.
4
+ */
5
+ export interface LineAtYResult {
6
+ line: FlowedLine;
7
+ lineIndex: number;
8
+ lineY: number;
9
+ }
10
+ /**
11
+ * Utility class for text position calculations.
12
+ * Consolidates duplicated logic from FlowingTextRenderer and TextBoxObject.
13
+ * All methods are static - no instance state required.
14
+ */
15
+ export declare class TextPositionCalculator {
16
+ /**
17
+ * Build a CSS font string from formatting properties.
18
+ */
19
+ static getFontString(formatting: TextFormattingStyle): string;
20
+ /**
21
+ * Calculate the alignment offset for a line.
22
+ * @param line The flowed line
23
+ * @param maxWidth The available width for the line
24
+ * @returns The X offset to apply before rendering the line
25
+ */
26
+ static getAlignmentOffset(line: FlowedLine, maxWidth: number): number;
27
+ /**
28
+ * Find which line is at a given Y position.
29
+ * @param flowedLines Array of flowed lines
30
+ * @param y Y position relative to the top of the first line
31
+ * @returns The line info or null if y is outside the lines
32
+ */
33
+ static findLineAtY(flowedLines: FlowedLine[], y: number): LineAtYResult | null;
34
+ /**
35
+ * Get the X position for a text index within a line.
36
+ * Does NOT include alignment offset - caller should add that separately.
37
+ *
38
+ * @param line The flowed line
39
+ * @param textIndex The text index to find the X position for
40
+ * @param ctx Canvas context for text measurement (must have font set per-run)
41
+ * @returns The X position relative to the line start (before alignment)
42
+ */
43
+ static getXPositionForTextIndex(line: FlowedLine, textIndex: number, ctx: CanvasRenderingContext2D): number;
44
+ /**
45
+ * Get the text index at an X position within a line.
46
+ * The x parameter should NOT include alignment offset - caller should subtract that first.
47
+ *
48
+ * @param line The flowed line
49
+ * @param x X position relative to line start (after removing alignment offset)
50
+ * @param ctx Canvas context for text measurement
51
+ * @returns The text index at that position
52
+ */
53
+ static getTextIndexAtX(line: FlowedLine, x: number, ctx: CanvasRenderingContext2D): number;
54
+ /**
55
+ * Get the width of a character, handling special cases like substitution fields,
56
+ * embedded objects, tabs, and orphaned replacement characters.
57
+ */
58
+ private static getCharWidth;
59
+ /**
60
+ * Build a map of substitution fields by text index for quick lookup.
61
+ */
62
+ private static buildSubstitutionFieldMap;
63
+ /**
64
+ * Build a map of embedded objects by text index for quick lookup.
65
+ */
66
+ private static buildEmbeddedObjectMap;
67
+ /**
68
+ * Count word gaps up to a certain text index for justify spacing calculation.
69
+ */
70
+ private static countWordGapsUpTo;
71
+ }
72
+ //# sourceMappingURL=TextPositionCalculator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextPositionCalculator.d.ts","sourceRoot":"","sources":["../../../../src/lib/text/TextPositionCalculator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiD,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEzG;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,qBAAa,sBAAsB;IACjC;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM;IAI7D;;;;;OAKG;IACH,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAarE;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IA0B9E;;;;;;;;OAQG;IACH,MAAM,CAAC,wBAAwB,CAC7B,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,wBAAwB,GAC5B,MAAM;IA6CT;;;;;;;;OAQG;IACH,MAAM,CAAC,eAAe,CACpB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,MAAM,EACT,GAAG,EAAE,wBAAwB,GAC5B,MAAM;IAyDT;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IA+B3B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAQxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAQrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;CAqBjC"}
@@ -0,0 +1,236 @@
1
+ import { EventEmitter } from '../events/EventEmitter';
2
+ /**
3
+ * Callback to check if a position contains a substitution field.
4
+ */
5
+ export type FieldCheckCallback = (textIndex: number) => boolean;
6
+ /**
7
+ * Pure state container for text content and cursor position.
8
+ * Handles text manipulation operations and emits change events.
9
+ * Supports cursor skipping over substitution fields.
10
+ */
11
+ export declare class TextState extends EventEmitter {
12
+ private content;
13
+ private cursorPosition;
14
+ private fieldCheckCallback;
15
+ private selectionAnchor;
16
+ constructor(initialContent?: string);
17
+ /**
18
+ * Set a callback to check if a position contains a substitution field.
19
+ * Used for cursor skipping behavior.
20
+ */
21
+ setFieldCheckCallback(callback: FieldCheckCallback | null): void;
22
+ /**
23
+ * Check if a character is the object replacement character.
24
+ */
25
+ private isReplacementChar;
26
+ /**
27
+ * Check if a position contains a substitution field.
28
+ */
29
+ private isFieldAt;
30
+ /**
31
+ * Get the current text content.
32
+ */
33
+ getText(): string;
34
+ /**
35
+ * Set the entire text content.
36
+ */
37
+ setText(text: string): void;
38
+ /**
39
+ * Insert text at a specific position or at the cursor.
40
+ * @returns The position after the inserted text
41
+ */
42
+ insertText(text: string, position?: number): number;
43
+ /**
44
+ * Delete text from a range.
45
+ * @returns The removed text
46
+ */
47
+ deleteText(start: number, length: number): string;
48
+ /**
49
+ * Perform a backspace operation at the current cursor position.
50
+ * If cursor is immediately after a substitution field, deletes the entire field.
51
+ * @returns True if something was deleted, false otherwise
52
+ */
53
+ backspace(): boolean;
54
+ /**
55
+ * Perform a delete operation at the current cursor position.
56
+ * If cursor is at a substitution field, deletes the entire field.
57
+ * @returns True if something was deleted, false otherwise
58
+ */
59
+ deleteForward(): boolean;
60
+ /**
61
+ * Get the current cursor position.
62
+ */
63
+ getCursorPosition(): number;
64
+ /**
65
+ * Set the cursor position directly.
66
+ * Note: This does not skip over substitution fields - use moveCursorLeft/Right
67
+ * for navigation that should skip fields.
68
+ */
69
+ setCursorPosition(position: number): void;
70
+ /**
71
+ * Move cursor by a delta, skipping over substitution fields.
72
+ */
73
+ moveCursor(delta: number): void;
74
+ /**
75
+ * Move cursor left, skipping over substitution fields.
76
+ * When cursor is after a field, it moves to before the field.
77
+ */
78
+ moveCursorLeft(): void;
79
+ /**
80
+ * Move cursor right, skipping over substitution fields.
81
+ * When cursor is before a field, it moves to after the field.
82
+ */
83
+ moveCursorRight(): void;
84
+ /**
85
+ * Get the length of the content.
86
+ */
87
+ get length(): number;
88
+ /**
89
+ * Check if the content is empty.
90
+ */
91
+ get isEmpty(): boolean;
92
+ /**
93
+ * Get a character at a specific position.
94
+ */
95
+ charAt(position: number): string;
96
+ /**
97
+ * Get a substring of the content.
98
+ */
99
+ substring(start: number, end?: number): string;
100
+ /**
101
+ * Find the index of a substring.
102
+ */
103
+ indexOf(searchString: string, position?: number): number;
104
+ /**
105
+ * Clear all content.
106
+ */
107
+ clear(): void;
108
+ /**
109
+ * Set the selection anchor point.
110
+ * Call this when starting a selection (e.g., shift key pressed).
111
+ */
112
+ setSelectionAnchor(position?: number): void;
113
+ /**
114
+ * Get the current selection range.
115
+ * Returns null if no selection is active.
116
+ */
117
+ getSelection(): {
118
+ start: number;
119
+ end: number;
120
+ } | null;
121
+ /**
122
+ * Check if there is an active selection.
123
+ */
124
+ hasSelection(): boolean;
125
+ /**
126
+ * Check if the selection anchor is set (even if cursor equals anchor).
127
+ */
128
+ hasSelectionAnchor(): boolean;
129
+ /**
130
+ * Clear the selection anchor.
131
+ */
132
+ clearSelection(): void;
133
+ /**
134
+ * Get the selected text content.
135
+ */
136
+ getSelectedText(): string;
137
+ /**
138
+ * Delete the selected text and clear selection.
139
+ * Returns true if text was deleted.
140
+ */
141
+ deleteSelection(): boolean;
142
+ /**
143
+ * Move cursor left while extending selection.
144
+ */
145
+ selectLeft(): void;
146
+ /**
147
+ * Move cursor right while extending selection.
148
+ */
149
+ selectRight(): void;
150
+ /**
151
+ * Emit selection change event.
152
+ */
153
+ private emitSelectionChange;
154
+ /**
155
+ * Check if character is a word character (alphanumeric or underscore).
156
+ * Includes accented characters common in European languages.
157
+ */
158
+ private isWordChar;
159
+ /**
160
+ * Find word boundaries at a text position.
161
+ * Words are sequences of alphanumeric characters, not including spaces/punctuation.
162
+ */
163
+ getWordBoundaries(position: number): {
164
+ start: number;
165
+ end: number;
166
+ };
167
+ /**
168
+ * Find paragraph boundaries at a text position.
169
+ * Paragraphs are delimited by newline characters.
170
+ */
171
+ getParagraphBoundaries(position: number): {
172
+ start: number;
173
+ end: number;
174
+ };
175
+ /**
176
+ * Select the word at the current cursor position.
177
+ */
178
+ selectWord(): void;
179
+ /**
180
+ * Select the paragraph at the current cursor position.
181
+ */
182
+ selectParagraph(): void;
183
+ /**
184
+ * Select all text content.
185
+ */
186
+ selectAll(): void;
187
+ /**
188
+ * Move cursor to the start of the current line.
189
+ */
190
+ moveCursorToLineStart(): void;
191
+ /**
192
+ * Move cursor to the end of the current line.
193
+ */
194
+ moveCursorToLineEnd(): void;
195
+ /**
196
+ * Move cursor to the start of the document.
197
+ */
198
+ moveCursorToDocumentStart(): void;
199
+ /**
200
+ * Move cursor to the end of the document.
201
+ */
202
+ moveCursorToDocumentEnd(): void;
203
+ /**
204
+ * Select from current cursor to line start.
205
+ */
206
+ selectToLineStart(): void;
207
+ /**
208
+ * Select from current cursor to line end.
209
+ */
210
+ selectToLineEnd(): void;
211
+ /**
212
+ * Select from current cursor to document start.
213
+ */
214
+ selectToDocumentStart(): void;
215
+ /**
216
+ * Select from current cursor to document end.
217
+ */
218
+ selectToDocumentEnd(): void;
219
+ /**
220
+ * Move cursor to the start of the previous word.
221
+ */
222
+ moveCursorWordLeft(): void;
223
+ /**
224
+ * Move cursor to the start of the next word.
225
+ */
226
+ moveCursorWordRight(): void;
227
+ /**
228
+ * Select word left from current position.
229
+ */
230
+ selectWordLeft(): void;
231
+ /**
232
+ * Select word right from current position.
233
+ */
234
+ selectWordRight(): void;
235
+ }
236
+ //# sourceMappingURL=TextState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextState.d.ts","sourceRoot":"","sources":["../../../../src/lib/text/TextState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;AAEhE;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,YAAY;IACzC,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,cAAc,CAAa;IACnC,OAAO,CAAC,kBAAkB,CAAmC;IAC7D,OAAO,CAAC,eAAe,CAAuB;gBAElC,cAAc,CAAC,EAAE,MAAM;IAOnC;;;OAGG;IACH,qBAAqB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,GAAG,IAAI;IAIhE;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,SAAS;IAOjB;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;OAEG;IACH,OAAO,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EG;IACH,eAAe,IAAI,MAAM;IAQzB;;;OAGG;IACH,eAAe,IAAI,OAAO;IAU1B;;OAEG;IACH,UAAU,IAAI,IAAI;IAQlB;;OAEG;IACH,WAAW,IAAI,IAAI;IAQnB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;;OAGG;IACH,OAAO,CAAC,UAAU;IAIlB;;;OAGG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IA4CnE;;;OAGG;IACH,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAoBxE;;OAEG;IACH,UAAU,IAAI,IAAI;IASlB;;OAEG;IACH,eAAe,IAAI,IAAI;IAOvB;;OAEG;IACH,SAAS,IAAI,IAAI;IAWjB;;OAEG;IACH,qBAAqB,IAAI,IAAI;IAQ7B;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAQ3B;;OAEG;IACH,yBAAyB,IAAI,IAAI;IAIjC;;OAEG;IACH,uBAAuB,IAAI,IAAI;IAI/B;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAQzB;;OAEG;IACH,eAAe,IAAI,IAAI;IAQvB;;OAEG;IACH,qBAAqB,IAAI,IAAI;IAQ7B;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAY3B;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAkB1B;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAkB3B;;OAEG;IACH,cAAc,IAAI,IAAI;IAQtB;;OAEG;IACH,eAAe,IAAI,IAAI;CAOxB"}
@@ -0,0 +1,27 @@
1
+ export type { Focusable, TextFormattingStyle, TextRun, SubstitutionField, SubstitutionFieldConfig, FlowedLine, FlowedPage, FlowedSubstitutionField, FlowedEmbeddedObject, RepeatingSection, RepeatingSectionVisualState, ObjectPosition, TextAlignment, ParagraphFormatting, ListFormatting, ListMarker, BulletStyle, NumberStyle, ListType, FieldValueType, FieldFormatConfig, NumberFormatPreset, CurrencyFormatPreset, DateFormatPreset } from './types';
2
+ export { DEFAULT_FORMATTING, OBJECT_REPLACEMENT_CHAR } from './types';
3
+ export { FlowingTextContent } from './FlowingTextContent';
4
+ export { TextState } from './TextState';
5
+ export type { FieldCheckCallback } from './TextState';
6
+ export { TextFormattingManager } from './TextFormatting';
7
+ export { SubstitutionFieldManager } from './SubstitutionFieldManager';
8
+ export { EmbeddedObjectManager } from './EmbeddedObjectManager';
9
+ export type { EmbeddedObjectEntry } from './EmbeddedObjectManager';
10
+ export { RepeatingSectionManager } from './RepeatingSectionManager';
11
+ export { TextMeasurer } from './TextMeasurer';
12
+ export type { EmbeddedMeasurement } from './TextMeasurer';
13
+ export { TextLayout } from './TextLayout';
14
+ export type { LayoutContext } from './TextLayout';
15
+ export { TextPositionCalculator } from './TextPositionCalculator';
16
+ export type { LineAtYResult } from './TextPositionCalculator';
17
+ export { BaseTextRegion } from './EditableTextRegion';
18
+ export type { EditableTextRegion, RegionType } from './EditableTextRegion';
19
+ export { RegionManager } from './RegionManager';
20
+ export { HyperlinkManager } from './HyperlinkManager';
21
+ export type { Hyperlink, HyperlinkData, HyperlinkFormatting, HyperlinkOptions, HyperlinkUpdate } from './HyperlinkManager';
22
+ export { BodyTextRegion, HeaderTextRegion, FooterTextRegion } from './regions';
23
+ export type { PageBoundsProvider, HeaderBoundsProvider, FooterBoundsProvider } from './regions';
24
+ export { formatFieldValue, isMarkdownFormat, getFormatDisplayName } from './FieldFormatter';
25
+ export { parseMarkdown, applyMarkdownFormatting, containsMarkdown, stripMarkdown } from './MarkdownParser';
26
+ export type { MarkdownSegment, MarkdownSegmentType, ParsedMarkdown } from './MarkdownParser';
27
+ //# sourceMappingURL=index.d.ts.map