@syncfusion/ej2-office-common 35.1.37

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 (147) hide show
  1. package/.eslintrc.json +263 -0
  2. package/.prettierrc.json +5 -0
  3. package/README.md +167 -0
  4. package/api-extractor.json +35 -0
  5. package/core.js +4 -0
  6. package/dist/ej2-office-common.umd.min.js +11 -0
  7. package/dist/ej2-office-common.umd.min.js.map +1 -0
  8. package/dist/es6/ej2-office-common.es2015.js +6585 -0
  9. package/dist/es6/ej2-office-common.es2015.js.map +1 -0
  10. package/dist/es6/ej2-office-common.es5.js +7955 -0
  11. package/dist/es6/ej2-office-common.es5.js.map +1 -0
  12. package/dist/global/ej2-office-common.min.js +11 -0
  13. package/dist/global/ej2-office-common.min.js.map +1 -0
  14. package/dist/global/index.d.ts +14 -0
  15. package/encryption.js +4 -0
  16. package/features.js +4 -0
  17. package/global.json +6 -0
  18. package/index.js +4 -0
  19. package/license +10 -0
  20. package/nuget.config +7 -0
  21. package/package.json +23 -0
  22. package/src/all.d.ts +41 -0
  23. package/src/all.js +38 -0
  24. package/src/core/index.d.ts +6 -0
  25. package/src/core/index.js +6 -0
  26. package/src/core/xml/index.d.ts +7 -0
  27. package/src/core/xml/index.js +6 -0
  28. package/src/core/xml/model.d.ts +71 -0
  29. package/src/core/xml/model.js +20 -0
  30. package/src/encryption/agile-constants.d.ts +61 -0
  31. package/src/encryption/agile-constants.js +71 -0
  32. package/src/encryption/agile-encryption-info.d.ts +46 -0
  33. package/src/encryption/agile-encryption-info.js +333 -0
  34. package/src/encryption/agile-password.d.ts +8 -0
  35. package/src/encryption/agile-password.js +58 -0
  36. package/src/encryption/cfb-reader.d.ts +11 -0
  37. package/src/encryption/cfb-reader.js +345 -0
  38. package/src/encryption/crypto-primitives.d.ts +74 -0
  39. package/src/encryption/crypto-primitives.js +302 -0
  40. package/src/encryption/decrypt-encrypted-package.d.ts +16 -0
  41. package/src/encryption/decrypt-encrypted-package.js +138 -0
  42. package/src/encryption/encryption-info-xml.d.ts +21 -0
  43. package/src/encryption/encryption-info-xml.js +282 -0
  44. package/src/encryption/errors.d.ts +66 -0
  45. package/src/encryption/errors.js +124 -0
  46. package/src/encryption/index.d.ts +35 -0
  47. package/src/encryption/index.js +100 -0
  48. package/src/features/diagrams/constants.d.ts +83 -0
  49. package/src/features/diagrams/constants.js +101 -0
  50. package/src/features/diagrams/diagram-data-model.d.ts +148 -0
  51. package/src/features/diagrams/diagram-data-model.js +446 -0
  52. package/src/features/diagrams/diagram-parsers.d.ts +28 -0
  53. package/src/features/diagrams/diagram-parsers.js +182 -0
  54. package/src/features/diagrams/diagram-serializers.d.ts +20 -0
  55. package/src/features/diagrams/diagram-serializers.js +110 -0
  56. package/src/features/diagrams/diagram-views.d.ts +60 -0
  57. package/src/features/diagrams/diagram-views.js +213 -0
  58. package/src/features/diagrams/element-tree.d.ts +55 -0
  59. package/src/features/diagrams/element-tree.js +197 -0
  60. package/src/features/diagrams/errors.d.ts +17 -0
  61. package/src/features/diagrams/errors.js +59 -0
  62. package/src/features/diagrams/index.d.ts +17 -0
  63. package/src/features/diagrams/index.js +17 -0
  64. package/src/features/diagrams/smart-art-catalog.d.ts +107 -0
  65. package/src/features/diagrams/smart-art-catalog.js +422 -0
  66. package/src/features/diagrams/smart-art-diagram.d.ts +96 -0
  67. package/src/features/diagrams/smart-art-diagram.js +258 -0
  68. package/src/features/index.d.ts +11 -0
  69. package/src/features/index.js +11 -0
  70. package/src/features/ink/constants.d.ts +54 -0
  71. package/src/features/ink/constants.js +54 -0
  72. package/src/features/ink/index.d.ts +18 -0
  73. package/src/features/ink/index.js +15 -0
  74. package/src/features/ink/ink-effects.d.ts +35 -0
  75. package/src/features/ink/ink-effects.js +45 -0
  76. package/src/features/ink/ink-model.d.ts +237 -0
  77. package/src/features/ink/ink-model.js +406 -0
  78. package/src/features/ink/ink-parser.d.ts +59 -0
  79. package/src/features/ink/ink-parser.js +671 -0
  80. package/src/features/ink/ink-serializer.d.ts +16 -0
  81. package/src/features/ink/ink-serializer.js +281 -0
  82. package/src/features/ink/ink-units.d.ts +33 -0
  83. package/src/features/ink/ink-units.js +92 -0
  84. package/src/features/ink/ink-xml.d.ts +26 -0
  85. package/src/features/ink/ink-xml.js +165 -0
  86. package/src/features/ink/trace-codec.d.ts +127 -0
  87. package/src/features/ink/trace-codec.js +266 -0
  88. package/src/features/mathml/constants.d.ts +47 -0
  89. package/src/features/mathml/constants.js +47 -0
  90. package/src/features/mathml/errors.d.ts +50 -0
  91. package/src/features/mathml/errors.js +69 -0
  92. package/src/features/mathml/index.d.ts +30 -0
  93. package/src/features/mathml/index.js +22 -0
  94. package/src/features/mathml/math-factory.d.ts +26 -0
  95. package/src/features/mathml/math-factory.js +568 -0
  96. package/src/features/mathml/model/controls.d.ts +896 -0
  97. package/src/features/mathml/model/controls.js +1541 -0
  98. package/src/features/mathml/model/enums.d.ts +153 -0
  99. package/src/features/mathml/model/enums.js +133 -0
  100. package/src/features/mathml/model/math-element.d.ts +173 -0
  101. package/src/features/mathml/model/math-element.js +315 -0
  102. package/src/features/mathml/model/roots.d.ts +82 -0
  103. package/src/features/mathml/model/roots.js +177 -0
  104. package/src/features/mathml/openxml.d.ts +56 -0
  105. package/src/features/mathml/openxml.js +87 -0
  106. package/src/features/mathml/parse/math-parser.d.ts +43 -0
  107. package/src/features/mathml/parse/math-parser.js +636 -0
  108. package/src/features/mathml/serialize/math-serializer.d.ts +34 -0
  109. package/src/features/mathml/serialize/math-serializer.js +749 -0
  110. package/src/features/smart-art/diagram-xml.d.ts +63 -0
  111. package/src/features/smart-art/diagram-xml.js +459 -0
  112. package/src/features/smart-art/errors.d.ts +24 -0
  113. package/src/features/smart-art/errors.js +47 -0
  114. package/src/features/smart-art/index.d.ts +26 -0
  115. package/src/features/smart-art/index.js +26 -0
  116. package/src/features/smart-art/minimal-samples.d.ts +18 -0
  117. package/src/features/smart-art/minimal-samples.js +40 -0
  118. package/src/features/smart-art/mutators.d.ts +60 -0
  119. package/src/features/smart-art/mutators.js +566 -0
  120. package/src/features/smart-art/namespaces.d.ts +153 -0
  121. package/src/features/smart-art/namespaces.js +163 -0
  122. package/src/features/smart-art/package-graph.d.ts +61 -0
  123. package/src/features/smart-art/package-graph.js +413 -0
  124. package/src/features/smart-art/parse-colors.d.ts +19 -0
  125. package/src/features/smart-art/parse-colors.js +39 -0
  126. package/src/features/smart-art/parse-data.d.ts +21 -0
  127. package/src/features/smart-art/parse-data.js +121 -0
  128. package/src/features/smart-art/parse-layout.d.ts +20 -0
  129. package/src/features/smart-art/parse-layout.js +40 -0
  130. package/src/features/smart-art/parse-rel-ids.d.ts +71 -0
  131. package/src/features/smart-art/parse-rel-ids.js +233 -0
  132. package/src/features/smart-art/parse-style.d.ts +19 -0
  133. package/src/features/smart-art/parse-style.js +39 -0
  134. package/src/features/smart-art/point-text.d.ts +80 -0
  135. package/src/features/smart-art/point-text.js +424 -0
  136. package/src/features/smart-art/register.d.ts +33 -0
  137. package/src/features/smart-art/register.js +95 -0
  138. package/src/features/smart-art/serialize.d.ts +40 -0
  139. package/src/features/smart-art/serialize.js +48 -0
  140. package/src/features/smart-art/types.d.ts +403 -0
  141. package/src/features/smart-art/types.js +28 -0
  142. package/src/global.js +1 -0
  143. package/src/index.d.ts +21 -0
  144. package/src/index.js +22 -0
  145. package/tsconfig.build.json +13 -0
  146. package/tsconfig.harness.json +32 -0
  147. package/tslint.json +111 -0
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Pure InkML trace codec (W3C InkML §3.2.1 via [MS-ODRAWXML] §1.2.1 / §2.1.4).
3
+ *
4
+ * Decodes differential-prefix packet text into absolute channel rows and plane
5
+ * points; encodes points as absolute `"x y, x y, …"` text. No XML dependency.
6
+ */
7
+ /**
8
+ * Plane point used by ink traces and scaled path helpers.
9
+ *
10
+ * @private
11
+ */
12
+ export interface InkPoint {
13
+ /** Horizontal coordinate in the active ink plane units. */
14
+ readonly x: number;
15
+ /** Vertical coordinate in the active ink plane units. */
16
+ readonly y: number;
17
+ }
18
+ /**
19
+ * Axis-aligned bounding box over decoded plane points.
20
+ *
21
+ * @private
22
+ */
23
+ export interface InkBounds {
24
+ /** Minimum horizontal coordinate among the points. */
25
+ readonly minX: number;
26
+ /** Minimum vertical coordinate among the points. */
27
+ readonly minY: number;
28
+ /** Maximum horizontal coordinate among the points. */
29
+ readonly maxX: number;
30
+ /** Maximum vertical coordinate among the points. */
31
+ readonly maxY: number;
32
+ }
33
+ /**
34
+ * Width and height extent in the same coordinate space as plane points.
35
+ *
36
+ * @private
37
+ */
38
+ export interface InkExtent {
39
+ /** Horizontal span of the drawing area. */
40
+ readonly width: number;
41
+ /** Vertical span of the drawing area. */
42
+ readonly height: number;
43
+ }
44
+ /**
45
+ * Security / guard counters for a decode pass.
46
+ *
47
+ * Consumers enforce hard limits; this module only surfaces counts so empty or
48
+ * whitespace-only input cannot loop unbounded without observability.
49
+ *
50
+ * @public
51
+ */
52
+ export interface TraceDecodeStats {
53
+ readonly packetCount: number;
54
+ readonly channelValueCount: number;
55
+ readonly pointCount: number;
56
+ }
57
+ /**
58
+ * Result of decoding a trace string to channel rows and plane points.
59
+ *
60
+ * @public
61
+ */
62
+ export interface TraceDecodeResult {
63
+ /** Absolute channel rows in document channel order (default X, Y, …). */
64
+ readonly channelRows: ReadonlyArray<ReadonlyArray<number>>;
65
+ /** Plane points from X/Y reduction (missing X or Y → point omitted). */
66
+ readonly points: ReadonlyArray<InkPoint>;
67
+ /** Guard counters for the decode pass. */
68
+ readonly stats: TraceDecodeStats;
69
+ }
70
+ /**
71
+ * Decode InkML trace text into absolute channel rows and X/Y plane points.
72
+ *
73
+ * Rules (W3C InkML §3.2.1):
74
+ * - Packets are comma-separated.
75
+ * - Channel values are whitespace-separated.
76
+ * - A `!` / `'` / `"` prefix before a value switches interpretation for the
77
+ * **rest of that packet** (absolute, first-difference, second-difference).
78
+ * - First differences apply against the previous packet's same-channel value.
79
+ * - Second differences accumulate per channel across packets.
80
+ * - Default channel order when no context is supplied: X then Y.
81
+ * - Extra channels are tolerated; reduction uses the first two as X/Y when
82
+ * present. A row missing X or Y does not produce a plane point.
83
+ *
84
+ * Empty / whitespace-only input yields zero packets and zero points (guarded).
85
+ *
86
+ * @public
87
+ */
88
+ export declare function decodeTrace(traceText: string): TraceDecodeResult;
89
+ /**
90
+ * Encode plane points as absolute InkML trace text (`"x y, x y, …"`).
91
+ *
92
+ * Always absolute (no differential prefixes). Generated from points only —
93
+ * never from stored markup (DOM mandate).
94
+ *
95
+ * @public
96
+ */
97
+ export declare function encodeTrace(points: ReadonlyArray<InkPoint>): string;
98
+ /**
99
+ * Compute axis-aligned bounds over plane points.
100
+ * Empty input returns a zero box (min=max=0) so callers can branch on count.
101
+ *
102
+ * @public
103
+ */
104
+ export declare function computeInkBounds(points: ReadonlyArray<InkPoint>): InkBounds;
105
+ /**
106
+ * Uniform scale of decoded strokes into an extent **without re-zeroing**.
107
+ *
108
+ * scale = min(extent.w / (maxX−minX), extent.h / (maxY−minY)) when the span
109
+ * is positive; origin of the coordinate system is preserved (decoded path).
110
+ * Degenerate (zero-span) axes map to the extent origin for that axis only.
111
+ *
112
+ * Source: cross-repo ink spec § Parser behavior — uniform scale for decoded
113
+ * strokes.
114
+ *
115
+ * @public
116
+ */
117
+ export declare function scalePointsUniform(points: ReadonlyArray<InkPoint>, extent: InkExtent): ReadonlyArray<InkPoint>;
118
+ /**
119
+ * Stretch-to-fit scale for **authored** strokes: re-zero to minX/minY, then
120
+ * stretch independently to the extent.
121
+ *
122
+ * Source: cross-repo ink spec § Parser behavior — authored strokes re-zero
123
+ * and stretch to the extent.
124
+ *
125
+ * @public
126
+ */
127
+ export declare function scalePointsStretch(points: ReadonlyArray<InkPoint>, extent: InkExtent): ReadonlyArray<InkPoint>;
@@ -0,0 +1,266 @@
1
+ /**
2
+ * Pure InkML trace codec (W3C InkML §3.2.1 via [MS-ODRAWXML] §1.2.1 / §2.1.4).
3
+ *
4
+ * Decodes differential-prefix packet text into absolute channel rows and plane
5
+ * points; encodes points as absolute `"x y, x y, …"` text. No XML dependency.
6
+ */
7
+ var __values = (this && this.__values) || function (o) {
8
+ var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
9
+ if (m) return m.call(o);
10
+ return {
11
+ next: function () {
12
+ if (o && i >= o.length) o = void 0;
13
+ return { value: o && o[i++], done: !o };
14
+ }
15
+ };
16
+ };
17
+ var PREFIX_ABSOLUTE = '!';
18
+ var PREFIX_FIRST_DIFF = "'";
19
+ var PREFIX_SECOND_DIFF = '"';
20
+ /**
21
+ * Tokenize a single channel value, stripping an optional InkML prefix.
22
+ * Source: W3C InkML §3.2.1 — `!` absolute, `'` first difference, `"` second difference.
23
+ */
24
+ function splitPrefix(token) {
25
+ if (token.length === 0) {
26
+ return { prefix: undefined, raw: token };
27
+ }
28
+ var head = token.charAt(0);
29
+ if (head === PREFIX_ABSOLUTE) {
30
+ return { prefix: 'absolute', raw: token.slice(1) };
31
+ }
32
+ if (head === PREFIX_FIRST_DIFF) {
33
+ return { prefix: 'first', raw: token.slice(1) };
34
+ }
35
+ if (head === PREFIX_SECOND_DIFF) {
36
+ return { prefix: 'second', raw: token.slice(1) };
37
+ }
38
+ return { prefix: undefined, raw: token };
39
+ }
40
+ function parseNumber(raw) {
41
+ if (raw.length === 0) {
42
+ return undefined;
43
+ }
44
+ var n = Number(raw);
45
+ return Number.isFinite(n) ? n : undefined;
46
+ }
47
+ /**
48
+ * Decode InkML trace text into absolute channel rows and X/Y plane points.
49
+ *
50
+ * Rules (W3C InkML §3.2.1):
51
+ * - Packets are comma-separated.
52
+ * - Channel values are whitespace-separated.
53
+ * - A `!` / `'` / `"` prefix before a value switches interpretation for the
54
+ * **rest of that packet** (absolute, first-difference, second-difference).
55
+ * - First differences apply against the previous packet's same-channel value.
56
+ * - Second differences accumulate per channel across packets.
57
+ * - Default channel order when no context is supplied: X then Y.
58
+ * - Extra channels are tolerated; reduction uses the first two as X/Y when
59
+ * present. A row missing X or Y does not produce a plane point.
60
+ *
61
+ * Empty / whitespace-only input yields zero packets and zero points (guarded).
62
+ *
63
+ * @public
64
+ */
65
+ export function decodeTrace(traceText) {
66
+ var e_1, _a;
67
+ var trimmed = traceText.trim();
68
+ if (trimmed.length === 0) {
69
+ return {
70
+ channelRows: [],
71
+ points: [],
72
+ stats: { packetCount: 0, channelValueCount: 0, pointCount: 0 },
73
+ };
74
+ }
75
+ var packetStrings = trimmed.split(',');
76
+ var channelRows = [];
77
+ var points = [];
78
+ var channelValueCount = 0;
79
+ // Previous absolute channel values (for first-difference).
80
+ var previous = [];
81
+ // Running second-difference deltas per channel (mutated in place per index).
82
+ var secondDelta = [];
83
+ // Default mode between packets is absolute until a prefix appears.
84
+ var defaultMode = 'absolute';
85
+ try {
86
+ for (var packetStrings_1 = __values(packetStrings), packetStrings_1_1 = packetStrings_1.next(); !packetStrings_1_1.done; packetStrings_1_1 = packetStrings_1.next()) {
87
+ var packetString = packetStrings_1_1.value;
88
+ var tokens = packetString.trim().split(/\s+/).filter(function (t) { return t.length > 0; });
89
+ if (tokens.length === 0) {
90
+ // Empty packet (e.g. trailing comma) — skip without inventing channels.
91
+ continue;
92
+ }
93
+ var mode = defaultMode;
94
+ var row = [];
95
+ for (var i = 0; i < tokens.length; i++) {
96
+ var token = tokens[i];
97
+ if (token === undefined) {
98
+ continue;
99
+ }
100
+ var _b = splitPrefix(token), prefix = _b.prefix, raw = _b.raw;
101
+ if (prefix !== undefined) {
102
+ mode = prefix;
103
+ // Prefix mode persists for subsequent packets until another prefix.
104
+ defaultMode = prefix;
105
+ }
106
+ var value = parseNumber(raw);
107
+ channelValueCount += 1;
108
+ if (value === undefined) {
109
+ // Malformed token: skip channel slot (best-effort; no invented number).
110
+ continue;
111
+ }
112
+ var absolute = void 0;
113
+ if (mode === 'absolute') {
114
+ absolute = value;
115
+ // Reset second-diff accumulator for this channel when absolute is used.
116
+ secondDelta[i] = 0;
117
+ }
118
+ else if (mode === 'first') {
119
+ var base = (previous[i] != null ? previous[i] : 0);
120
+ absolute = base + value;
121
+ secondDelta[i] = value;
122
+ }
123
+ else {
124
+ // second difference: accumulate delta, then add to previous absolute
125
+ var prevDelta = (secondDelta[i] != null ? secondDelta[i] : 0);
126
+ var newDelta = prevDelta + value;
127
+ secondDelta[i] = newDelta;
128
+ var base = (previous[i] != null ? previous[i] : 0);
129
+ absolute = base + newDelta;
130
+ }
131
+ row[i] = absolute;
132
+ }
133
+ channelRows.push(row);
134
+ previous = row.slice();
135
+ var x = row[0];
136
+ var y = row[1];
137
+ if (x !== undefined && y !== undefined) {
138
+ points.push({ x: x, y: y });
139
+ }
140
+ }
141
+ }
142
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
143
+ finally {
144
+ try {
145
+ if (packetStrings_1_1 && !packetStrings_1_1.done && (_a = packetStrings_1.return)) _a.call(packetStrings_1);
146
+ }
147
+ finally { if (e_1) throw e_1.error; }
148
+ }
149
+ return {
150
+ channelRows: channelRows,
151
+ points: points,
152
+ stats: {
153
+ packetCount: channelRows.length,
154
+ channelValueCount: channelValueCount,
155
+ pointCount: points.length,
156
+ },
157
+ };
158
+ }
159
+ /**
160
+ * Encode plane points as absolute InkML trace text (`"x y, x y, …"`).
161
+ *
162
+ * Always absolute (no differential prefixes). Generated from points only —
163
+ * never from stored markup (DOM mandate).
164
+ *
165
+ * @public
166
+ */
167
+ export function encodeTrace(points) {
168
+ if (points.length === 0) {
169
+ return '';
170
+ }
171
+ return points.map(function (p) { return formatCoord(p.x) + " " + formatCoord(p.y); }).join(', ');
172
+ }
173
+ function formatCoord(n) {
174
+ // Prefer compact integer form when exact; otherwise default number string.
175
+ if (Number.isInteger(n)) {
176
+ return String(n);
177
+ }
178
+ return String(n);
179
+ }
180
+ /**
181
+ * Compute axis-aligned bounds over plane points.
182
+ * Empty input returns a zero box (min=max=0) so callers can branch on count.
183
+ *
184
+ * @public
185
+ */
186
+ export function computeInkBounds(points) {
187
+ var first = points[0];
188
+ if (first === undefined) {
189
+ return { minX: 0, minY: 0, maxX: 0, maxY: 0 };
190
+ }
191
+ var minX = first.x;
192
+ var minY = first.y;
193
+ var maxX = minX;
194
+ var maxY = minY;
195
+ for (var i = 1; i < points.length; i++) {
196
+ var p = points[i];
197
+ if (p === undefined) {
198
+ continue;
199
+ }
200
+ if (p.x < minX)
201
+ minX = p.x;
202
+ if (p.y < minY)
203
+ minY = p.y;
204
+ if (p.x > maxX)
205
+ maxX = p.x;
206
+ if (p.y > maxY)
207
+ maxY = p.y;
208
+ }
209
+ return { minX: minX, minY: minY, maxX: maxX, maxY: maxY };
210
+ }
211
+ /**
212
+ * Uniform scale of decoded strokes into an extent **without re-zeroing**.
213
+ *
214
+ * scale = min(extent.w / (maxX−minX), extent.h / (maxY−minY)) when the span
215
+ * is positive; origin of the coordinate system is preserved (decoded path).
216
+ * Degenerate (zero-span) axes map to the extent origin for that axis only.
217
+ *
218
+ * Source: cross-repo ink spec § Parser behavior — uniform scale for decoded
219
+ * strokes.
220
+ *
221
+ * @public
222
+ */
223
+ export function scalePointsUniform(points, extent) {
224
+ if (points.length === 0) {
225
+ return [];
226
+ }
227
+ var bounds = computeInkBounds(points);
228
+ var spanX = bounds.maxX - bounds.minX;
229
+ var spanY = bounds.maxY - bounds.minY;
230
+ var scaleX = spanX > 0 ? extent.width / spanX : 0;
231
+ var scaleY = spanY > 0 ? extent.height / spanY : 0;
232
+ var scale = spanX > 0 && spanY > 0
233
+ ? Math.min(scaleX, scaleY)
234
+ : spanX > 0
235
+ ? scaleX
236
+ : spanY > 0
237
+ ? scaleY
238
+ : 0;
239
+ return points.map(function (p) { return ({
240
+ x: p.x * scale,
241
+ y: p.y * scale,
242
+ }); });
243
+ }
244
+ /**
245
+ * Stretch-to-fit scale for **authored** strokes: re-zero to minX/minY, then
246
+ * stretch independently to the extent.
247
+ *
248
+ * Source: cross-repo ink spec § Parser behavior — authored strokes re-zero
249
+ * and stretch to the extent.
250
+ *
251
+ * @public
252
+ */
253
+ export function scalePointsStretch(points, extent) {
254
+ if (points.length === 0) {
255
+ return [];
256
+ }
257
+ var bounds = computeInkBounds(points);
258
+ var spanX = bounds.maxX - bounds.minX;
259
+ var spanY = bounds.maxY - bounds.minY;
260
+ var scaleX = spanX > 0 ? extent.width / spanX : 0;
261
+ var scaleY = spanY > 0 ? extent.height / spanY : 0;
262
+ return points.map(function (p) { return ({
263
+ x: spanX > 0 ? (p.x - bounds.minX) * scaleX : 0,
264
+ y: spanY > 0 ? (p.y - bounds.minY) * scaleY : 0,
265
+ }); });
266
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Cited Office Math Markup Language (OMML) constants.
3
+ *
4
+ * Sources:
5
+ * - ECMA-376 Part 1 §22.1 (Office Math)
6
+ * - ECMA-376 Part 4 Annex A.8.1 `shared-math.xsd`
7
+ * - ECMA-376 Part 1 WordprocessingML transitional namespace
8
+ * - W3C XML 1.0 `xml:` namespace (xml:space on m:t)
9
+ */
10
+ /**
11
+ * Office Math namespace URI (`m:`).
12
+ *
13
+ * Source: ECMA-376-1 §22.1 /
14
+ * `http://schemas.openxmlformats.org/officeDocument/2006/math`.
15
+ *
16
+ * @public
17
+ */
18
+ export declare const MATH_NAMESPACE = "http://schemas.openxmlformats.org/officeDocument/2006/math";
19
+ /**
20
+ * Preferred math prefix candidates for save-scoped registry.
21
+ * First unused candidate wins: `m`, then `m1`, `m2`, …
22
+ *
23
+ * Source: mathml-spec §1.9 / §9.3.
24
+ *
25
+ * @public
26
+ */
27
+ export declare const MATH_PREFIX_FALLBACKS: string[];
28
+ /**
29
+ * WordprocessingML transitional namespace (`w:`).
30
+ *
31
+ * Used when bridging `w:rPr` / run content under `m:r` and `m:ctrlPr`
32
+ * (ECMA-376-4 Annex A.8.1 `CT_R` / `CT_CtrlPr`).
33
+ *
34
+ * Source: ECMA-376-1 —
35
+ * `http://schemas.openxmlformats.org/wordprocessingml/2006/main`.
36
+ *
37
+ * @public
38
+ */
39
+ export declare const WML_TRANSITIONAL_NAMESPACE = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
40
+ /**
41
+ * XML namespace used by `xml:space` on `m:t` (same policy as `w:t`).
42
+ *
43
+ * Source: W3C XML 1.0 — `http://www.w3.org/XML/1998/namespace`.
44
+ *
45
+ * @public
46
+ */
47
+ export declare const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Cited Office Math Markup Language (OMML) constants.
3
+ *
4
+ * Sources:
5
+ * - ECMA-376 Part 1 §22.1 (Office Math)
6
+ * - ECMA-376 Part 4 Annex A.8.1 `shared-math.xsd`
7
+ * - ECMA-376 Part 1 WordprocessingML transitional namespace
8
+ * - W3C XML 1.0 `xml:` namespace (xml:space on m:t)
9
+ */
10
+ /**
11
+ * Office Math namespace URI (`m:`).
12
+ *
13
+ * Source: ECMA-376-1 §22.1 /
14
+ * `http://schemas.openxmlformats.org/officeDocument/2006/math`.
15
+ *
16
+ * @public
17
+ */
18
+ export var MATH_NAMESPACE = 'http://schemas.openxmlformats.org/officeDocument/2006/math';
19
+ /**
20
+ * Preferred math prefix candidates for save-scoped registry.
21
+ * First unused candidate wins: `m`, then `m1`, `m2`, …
22
+ *
23
+ * Source: mathml-spec §1.9 / §9.3.
24
+ *
25
+ * @public
26
+ */
27
+ export var MATH_PREFIX_FALLBACKS = ['m', 'm1', 'm2', 'm3', 'm4', 'm5'];
28
+ /**
29
+ * WordprocessingML transitional namespace (`w:`).
30
+ *
31
+ * Used when bridging `w:rPr` / run content under `m:r` and `m:ctrlPr`
32
+ * (ECMA-376-4 Annex A.8.1 `CT_R` / `CT_CtrlPr`).
33
+ *
34
+ * Source: ECMA-376-1 —
35
+ * `http://schemas.openxmlformats.org/wordprocessingml/2006/main`.
36
+ *
37
+ * @public
38
+ */
39
+ export var WML_TRANSITIONAL_NAMESPACE = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
40
+ /**
41
+ * XML namespace used by `xml:space` on `m:t` (same policy as `w:t`).
42
+ *
43
+ * Source: W3C XML 1.0 — `http://www.w3.org/XML/1998/namespace`.
44
+ *
45
+ * @public
46
+ */
47
+ export var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Typed mathml errors (mathml-spec Errors section).
3
+ *
4
+ * Common-owned; docx-js passes them through untouched.
5
+ */
6
+ /**
7
+ * Constraint categories for {@link MathmlValidationError}.
8
+ *
9
+ * @private
10
+ * Internal error detail; not part of the public authoring API.
11
+ */
12
+ export declare type MathmlConstraintKind = 'child-order' | 'enum-value' | 'required-child' | 'value-range';
13
+ /**
14
+ * Schema violation detected on author/serialize of a typed math tree.
15
+ *
16
+ * Source: mathml-spec Errors section —
17
+ * `elementPath` dotted model path (e.g. `'oMath.f.den'`),
18
+ * `constraintKind` one of child-order | enum-value | required-child | value-range.
19
+ *
20
+ * @private
21
+ * Internal error contract between the mathml model, parser, and serializer;
22
+ * not part of the public authoring API.
23
+ */
24
+ export declare class MathmlValidationError extends Error {
25
+ /**
26
+ * Dotted model path of the violating element (e.g. `'oMath.f.den'`).
27
+ */
28
+ readonly elementPath: string;
29
+ /**
30
+ * Constraint category that was violated.
31
+ */
32
+ readonly constraintKind: MathmlConstraintKind;
33
+ constructor(message: string, elementPath: string, constraintKind: MathmlConstraintKind);
34
+ }
35
+ /**
36
+ * Mutation attempted on a preserve-only (degraded) math equation.
37
+ *
38
+ * Source: mathml-spec §8b — malformed load degrades; later mutate throws.
39
+ *
40
+ * @private
41
+ * Internal error contract between the mathml model, parser, and serializer;
42
+ * not part of the public authoring API.
43
+ */
44
+ export declare class MathmlReadOnlyError extends Error {
45
+ /**
46
+ * Always `true` — the equation is locked in preserve-only mode and mutations are blocked.
47
+ */
48
+ readonly isPreserveOnly: true;
49
+ constructor(message?: string);
50
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Typed mathml errors (mathml-spec Errors section).
3
+ *
4
+ * Common-owned; docx-js passes them through untouched.
5
+ */
6
+ var __extends = (this && this.__extends) || (function () {
7
+ var extendStatics = function (d, b) {
8
+ extendStatics = Object.setPrototypeOf ||
9
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
10
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
11
+ return extendStatics(d, b);
12
+ };
13
+ return function (d, b) {
14
+ extendStatics(d, b);
15
+ function __() { this.constructor = d; }
16
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
17
+ };
18
+ })();
19
+ /**
20
+ * Schema violation detected on author/serialize of a typed math tree.
21
+ *
22
+ * Source: mathml-spec Errors section —
23
+ * `elementPath` dotted model path (e.g. `'oMath.f.den'`),
24
+ * `constraintKind` one of child-order | enum-value | required-child | value-range.
25
+ *
26
+ * @private
27
+ * Internal error contract between the mathml model, parser, and serializer;
28
+ * not part of the public authoring API.
29
+ */
30
+ var MathmlValidationError = /** @class */ (function (_super) {
31
+ __extends(MathmlValidationError, _super);
32
+ function MathmlValidationError(message, elementPath, constraintKind) {
33
+ var _newTarget = this.constructor;
34
+ var _this = _super.call(this, message) || this;
35
+ _this.name = 'MathmlValidationError';
36
+ _this.elementPath = elementPath;
37
+ _this.constraintKind = constraintKind;
38
+ Object.setPrototypeOf(_this, _newTarget.prototype);
39
+ return _this;
40
+ }
41
+ return MathmlValidationError;
42
+ }(Error));
43
+ export { MathmlValidationError };
44
+ /**
45
+ * Mutation attempted on a preserve-only (degraded) math equation.
46
+ *
47
+ * Source: mathml-spec §8b — malformed load degrades; later mutate throws.
48
+ *
49
+ * @private
50
+ * Internal error contract between the mathml model, parser, and serializer;
51
+ * not part of the public authoring API.
52
+ */
53
+ var MathmlReadOnlyError = /** @class */ (function (_super) {
54
+ __extends(MathmlReadOnlyError, _super);
55
+ function MathmlReadOnlyError(message) {
56
+ var _newTarget = this.constructor;
57
+ if (message === void 0) { message = 'Math equation is preserve-only and cannot be mutated'; }
58
+ var _this = _super.call(this, message) || this;
59
+ /**
60
+ * Always `true` — the equation is locked in preserve-only mode and mutations are blocked.
61
+ */
62
+ _this.isPreserveOnly = true;
63
+ _this.name = 'MathmlReadOnlyError';
64
+ Object.setPrototypeOf(_this, _newTarget.prototype);
65
+ return _this;
66
+ }
67
+ return MathmlReadOnlyError;
68
+ }(Error));
69
+ export { MathmlReadOnlyError };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Optional Office Math Markup Language (OMML) feature module
3
+ * (`@syncfusion/ej2-office-common/mathml`).
4
+ *
5
+ * Provides the shared typed Math* DOM, tolerant OMML parser, strict
6
+ * serializer, clone/equality helpers, and cited constants. "MathML" here
7
+ * means OMML (`m:*` per ECMA-376-1 §22.1 / Part 4 Annex A.8.1) — not W3C MathML.
8
+ *
9
+ * Docx integration (`MathInline`, paragraph accessors, save hook) is TASK-9011.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ export { MATH_NAMESPACE, MATH_PREFIX_FALLBACKS, WML_TRANSITIONAL_NAMESPACE, XML_NAMESPACE, } from './constants';
14
+ export { MathBreakBin, MathBreakBinSub, MathFractionType, MathJc, MathLimLoc, MathScript, MathShape, MathSpacingRule, MathStyle, MathTopBot, } from './model/enums';
15
+ export { MATH_BREAKBIN_VALUES, MATH_BREAKBINSUB_VALUES, MATH_FTYPE_VALUES, MATH_JC_VALUES, MATH_LIMLOC_VALUES, MATH_SCRIPT_VALUES, MATH_SHP_VALUES, MATH_SPACING_RULE_VALUES, MATH_STYLE_VALUES, MATH_TOPBOT_VALUES, emitOnOff, isInteger2, isInteger255, isSpacingRule, isUnSignedInteger, parseMathBreakBin, parseMathBreakBinSub, parseMathFractionType, parseMathJc, parseMathLimLoc, parseMathScript, parseMathShape, parseMathStyle, parseMathTopBot, parseOnOff, } from './model/enums';
16
+ export { MathArgProperties, MathElementKind, MathElementType, } from './model/math-element';
17
+ export { MathArgument, MathElement, MathText, UnknownMathElement, mathArg, } from './model/math-element';
18
+ export { MathParaProperties } from './model/roots';
19
+ export { MathOMath, MathParagraph } from './model/roots';
20
+ export { MathAccentProperties, MathBarProperties, MathBorderBoxProperties, MathBoxProperties, MathCtrlPr, MathDelimiterProperties, MathEquationArrayProperties, MathFractionProperties, MathFunctionProperties, MathGroupCharacterProperties, MathLimitProperties, MathMatrixProperties, MathNaryProperties, MathPhantomProperties, MathRadicalProperties, MathRunProperties, MathScriptControlProperties, } from './model/controls';
21
+ export { MathAccent, MathBar, MathBorderBox, MathBox, MathDelimiter, MathEquationArray, MathFraction, MathFunction, MathGroupCharacter, MathLimitLower, MathLimitUpper, MathMatrix, MathMatrixRow, MathNaryOperator, MathPhantom, MathPreSubSuperscript, MathRadical, MathRun, MathSubscript, MathSubSuperscript, MathSuperscript, } from './model/controls';
22
+ export { MathParseDiagnostic, ParseMathOptions } from './parse/math-parser';
23
+ export { parseMathElement, parseMathElements } from './parse/math-parser';
24
+ export { SerializeMathOptions } from './serialize/math-serializer';
25
+ export { mathElementToOpenXml } from './serialize/math-serializer';
26
+ export { cloneMathElement, mathEqual } from './math-factory';
27
+ export { MathmlConstraintKind } from './errors';
28
+ export { MathmlReadOnlyError, MathmlValidationError } from './errors';
29
+ export { NamespaceDeclaration, OpenXmlAttribute, OpenXmlChild, OpenXmlElement, OpenXmlText, } from './openxml';
30
+ export { attrValue, attrValueNs, childElements, createElement, createText, textContent, } from './openxml';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Optional Office Math Markup Language (OMML) feature module
3
+ * (`@syncfusion/ej2-office-common/mathml`).
4
+ *
5
+ * Provides the shared typed Math* DOM, tolerant OMML parser, strict
6
+ * serializer, clone/equality helpers, and cited constants. "MathML" here
7
+ * means OMML (`m:*` per ECMA-376-1 §22.1 / Part 4 Annex A.8.1) — not W3C MathML.
8
+ *
9
+ * Docx integration (`MathInline`, paragraph accessors, save hook) is TASK-9011.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ export { MATH_NAMESPACE, MATH_PREFIX_FALLBACKS, WML_TRANSITIONAL_NAMESPACE, XML_NAMESPACE, } from './constants';
14
+ export { MATH_BREAKBIN_VALUES, MATH_BREAKBINSUB_VALUES, MATH_FTYPE_VALUES, MATH_JC_VALUES, MATH_LIMLOC_VALUES, MATH_SCRIPT_VALUES, MATH_SHP_VALUES, MATH_SPACING_RULE_VALUES, MATH_STYLE_VALUES, MATH_TOPBOT_VALUES, emitOnOff, isInteger2, isInteger255, isSpacingRule, isUnSignedInteger, parseMathBreakBin, parseMathBreakBinSub, parseMathFractionType, parseMathJc, parseMathLimLoc, parseMathScript, parseMathShape, parseMathStyle, parseMathTopBot, parseOnOff, } from './model/enums';
15
+ export { MathArgument, MathElement, MathText, UnknownMathElement, mathArg, } from './model/math-element';
16
+ export { MathOMath, MathParagraph } from './model/roots';
17
+ export { MathAccent, MathBar, MathBorderBox, MathBox, MathDelimiter, MathEquationArray, MathFraction, MathFunction, MathGroupCharacter, MathLimitLower, MathLimitUpper, MathMatrix, MathMatrixRow, MathNaryOperator, MathPhantom, MathPreSubSuperscript, MathRadical, MathRun, MathSubscript, MathSubSuperscript, MathSuperscript, } from './model/controls';
18
+ export { parseMathElement, parseMathElements } from './parse/math-parser';
19
+ export { mathElementToOpenXml } from './serialize/math-serializer';
20
+ export { cloneMathElement, mathEqual } from './math-factory';
21
+ export { MathmlReadOnlyError, MathmlValidationError } from './errors';
22
+ export { attrValue, attrValueNs, childElements, createElement, createText, textContent, } from './openxml';