@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,315 @@
1
+ /**
2
+ * MathElement base hierarchy for OMML typed DOM.
3
+ *
4
+ * Source: mathml-spec §7; ECMA-376-4 Annex A.8.1.
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
+ var __assign = (this && this.__assign) || function () {
20
+ __assign = Object.assign || function(t) {
21
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
22
+ s = arguments[i];
23
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
24
+ t[p] = s[p];
25
+ }
26
+ return t;
27
+ };
28
+ return __assign.apply(this, arguments);
29
+ };
30
+ var __read = (this && this.__read) || function (o, n) {
31
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
32
+ if (!m) return o;
33
+ var i = m.call(o), r, ar = [], e;
34
+ try {
35
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
36
+ }
37
+ catch (error) { e = { error: error }; }
38
+ finally {
39
+ try {
40
+ if (r && !r.done && (m = i["return"])) m.call(i);
41
+ }
42
+ finally { if (e) throw e.error; }
43
+ }
44
+ return ar;
45
+ };
46
+ var __spread = (this && this.__spread) || function () {
47
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
48
+ return ar;
49
+ };
50
+ import { MathmlReadOnlyError, MathmlValidationError } from '../errors';
51
+ import { isInteger2 } from './enums';
52
+ /**
53
+ * Abstract base for every OMML model node.
54
+ *
55
+ * @public
56
+ */
57
+ var MathElement = /** @class */ (function () {
58
+ function MathElement() {
59
+ /** When true, mutation is blocked (preserve-only degradation). */
60
+ this._preserveOnly = false;
61
+ }
62
+ Object.defineProperty(MathElement.prototype, "preserveOnly", {
63
+ /**
64
+ * Whether this node is locked in preserve-only mode (mutations blocked; original OpenXML is re-emitted).
65
+ *
66
+ * @private
67
+ * Framework/parser state used for round-trip fidelity and host dirty tracking.
68
+ */
69
+ get: function () {
70
+ return this._preserveOnly;
71
+ },
72
+ enumerable: true,
73
+ configurable: true
74
+ });
75
+ Object.defineProperty(MathElement.prototype, "preservedXml", {
76
+ /**
77
+ * Captured original OpenXML tree when the node is preserve-only or cannot be fully represented.
78
+ *
79
+ * @private
80
+ * Used by the serializer and hosts to round-trip unmodified structure.
81
+ */
82
+ get: function () {
83
+ return this._preservedXml;
84
+ },
85
+ enumerable: true,
86
+ configurable: true
87
+ });
88
+ /**
89
+ * Registers an internal mutation callback for change tracking and document synchronization.
90
+ *
91
+ * @private
92
+ * Hosts (for example docx `MathInline`) inject dirty tracking; not part of the authoring API.
93
+ */
94
+ MathElement.prototype.setMutationListener = function (listener) {
95
+ this._onMutate = listener;
96
+ };
97
+ /**
98
+ * Marks this node preserve-only and stores the original OpenXML for round-trip preservation.
99
+ *
100
+ * @private
101
+ * Used by the OMML parser for structural degradation and by document hosts to bubble a
102
+ * child-level preserve-only lock up to the equation root.
103
+ */
104
+ MathElement.prototype.markPreserveOnly = function (xml) {
105
+ this._preserveOnly = true;
106
+ this._preservedXml = xml;
107
+ };
108
+ /**
109
+ * Attach preserved XML without locking mutation (UnknownMathElement).
110
+ *
111
+ * @private
112
+ */
113
+ MathElement.prototype.attachPreservedXml = function (xml) {
114
+ this._preservedXml = xml;
115
+ };
116
+ /** Guard + notify after a successful mutation. */
117
+ MathElement.prototype.notifyMutated = function () {
118
+ if (this._preserveOnly) {
119
+ throw new MathmlReadOnlyError();
120
+ }
121
+ this._onMutate == null ? void 0 : this._onMutate();
122
+ };
123
+ /** Throw if preserve-only before a mutation begins. */
124
+ MathElement.prototype.assertMutable = function () {
125
+ if (this._preserveOnly) {
126
+ throw new MathmlReadOnlyError();
127
+ }
128
+ };
129
+ return MathElement;
130
+ }());
131
+ export { MathElement };
132
+ /**
133
+ * Math text leaf (`m:t`) — literal character content inside a math run.
134
+ *
135
+ * Source: ECMA-376-1 §22.1.2.116 `CT_Text` — UTF-8 passthrough, no substitution.
136
+ *
137
+ * @public
138
+ */
139
+ var MathText = /** @class */ (function (_super) {
140
+ __extends(MathText, _super);
141
+ function MathText(value, xmlSpace) {
142
+ if (value === void 0) { value = ''; }
143
+ var _this = _super.call(this) || this;
144
+ /**
145
+ * Math element type for this text leaf (`t`).
146
+ */
147
+ _this.type = 't';
148
+ _this._value = value;
149
+ _this._xmlSpace = xmlSpace;
150
+ return _this;
151
+ }
152
+ Object.defineProperty(MathText.prototype, "value", {
153
+ /**
154
+ * Raw text content of this math text element (full UTF-8, no substitution).
155
+ */
156
+ get: function () {
157
+ return this._value;
158
+ },
159
+ set: function (next) {
160
+ this.assertMutable();
161
+ this._value = next;
162
+ this.notifyMutated();
163
+ },
164
+ enumerable: true,
165
+ configurable: true
166
+ });
167
+ Object.defineProperty(MathText.prototype, "xmlSpace", {
168
+ /**
169
+ * Optional `xml:space` on `m:t` (`default` | `preserve`), same policy as Word `w:t`.
170
+ *
171
+ * @private
172
+ * Serialization attribute for whitespace fidelity; prefer setting text via {@link value}.
173
+ */
174
+ get: function () {
175
+ return this._xmlSpace;
176
+ },
177
+ set: function (next) {
178
+ this.assertMutable();
179
+ this._xmlSpace = next;
180
+ this.notifyMutated();
181
+ },
182
+ enumerable: true,
183
+ configurable: true
184
+ });
185
+ return MathText;
186
+ }(MathElement));
187
+ export { MathText };
188
+ /**
189
+ * Argument container that holds ordered math elements inside a larger structure.
190
+ *
191
+ * @public
192
+ */
193
+ var MathArgument = /** @class */ (function (_super) {
194
+ __extends(MathArgument, _super);
195
+ function MathArgument(properties, item, ctrlPr) {
196
+ if (properties === void 0) { properties = {}; }
197
+ if (item === void 0) { item = []; }
198
+ var _this = _super.call(this) || this;
199
+ /**
200
+ * Discriminator for this math argument container.
201
+ *
202
+ * @public
203
+ */
204
+ _this.type = 'arg';
205
+ if (properties.argSz !== undefined && !isInteger2(properties.argSz)) {
206
+ throw new MathmlValidationError("argSz must be an integer in \u22122..2 (ST_Integer2), got " + String(properties.argSz), 'arg.argPr.argSz', 'value-range');
207
+ }
208
+ _this._properties = Object.freeze(__assign({}, properties));
209
+ _this._item = __spread(item);
210
+ _this._ctrlPr = ctrlPr;
211
+ return _this;
212
+ }
213
+ Object.defineProperty(MathArgument.prototype, "properties", {
214
+ /**
215
+ * Gets or sets argument properties such as script size.
216
+ *
217
+ * @throws MathmlValidationError when script size is outside the allowed integer range.
218
+ *
219
+ * @public
220
+ */
221
+ get: function () {
222
+ return this._properties;
223
+ },
224
+ set: function (next) {
225
+ this.assertMutable();
226
+ if (next.argSz !== undefined && !isInteger2(next.argSz)) {
227
+ throw new MathmlValidationError("argSz must be an integer in \u22122..2 (ST_Integer2), got " + String(next.argSz), 'arg.argPr.argSz', 'value-range');
228
+ }
229
+ this._properties = Object.freeze(__assign({}, next));
230
+ this.notifyMutated();
231
+ },
232
+ enumerable: true,
233
+ configurable: true
234
+ });
235
+ Object.defineProperty(MathArgument.prototype, "item", {
236
+ /**
237
+ * Gets or sets the ordered math elements inside this argument.
238
+ *
239
+ * @public
240
+ */
241
+ get: function () {
242
+ return this._item;
243
+ },
244
+ set: function (next) {
245
+ this.assertMutable();
246
+ this._item = __spread(next);
247
+ this.notifyMutated();
248
+ },
249
+ enumerable: true,
250
+ configurable: true
251
+ });
252
+ Object.defineProperty(MathArgument.prototype, "ctrlPr", {
253
+ /**
254
+ * Opaque control properties (`m:ctrlPr`) carried on the argument, when present.
255
+ *
256
+ * @private
257
+ * Wire-fidelity carrier for WML run properties; not part of the public authoring API.
258
+ */
259
+ get: function () {
260
+ return this._ctrlPr;
261
+ },
262
+ /**
263
+ * @private
264
+ */
265
+ set: function (next) {
266
+ this.assertMutable();
267
+ this._ctrlPr = next;
268
+ this.notifyMutated();
269
+ },
270
+ enumerable: true,
271
+ configurable: true
272
+ });
273
+ /**
274
+ * Appends one math element at the end of {@link MathArgument.item}.
275
+ */
276
+ MathArgument.prototype.appendItem = function (child) {
277
+ this.assertMutable();
278
+ this._item.push(child);
279
+ this.notifyMutated();
280
+ return child;
281
+ };
282
+ return MathArgument;
283
+ }(MathElement));
284
+ export { MathArgument };
285
+ /**
286
+ * Escape hatch for unrecognized `m:*` elements.
287
+ *
288
+ * Source: mathml-spec §8.5 — re-serializes verbatim.
289
+ *
290
+ * @public
291
+ */
292
+ var UnknownMathElement = /** @class */ (function (_super) {
293
+ __extends(UnknownMathElement, _super);
294
+ function UnknownMathElement(localName, xml) {
295
+ var _this = _super.call(this) || this;
296
+ _this.type = 'unknown';
297
+ _this.localName = localName;
298
+ _this.attachPreservedXml(xml);
299
+ return _this;
300
+ }
301
+ return UnknownMathElement;
302
+ }(MathElement));
303
+ export { UnknownMathElement };
304
+ /**
305
+ * Convenience: build MathArgument from a list of elements.
306
+ *
307
+ * @private
308
+ */
309
+ export function mathArg() {
310
+ var elements = [];
311
+ for (var _i = 0; _i < arguments.length; _i++) {
312
+ elements[_i] = arguments[_i];
313
+ }
314
+ return new MathArgument({}, elements);
315
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Math root containers: `m:oMathPara`, `m:oMath`.
3
+ *
4
+ * Source: ECMA-376-4 Annex A.8.1 `CT_OMathPara`, `CT_OMath`.
5
+ */
6
+ import { MathJc } from './enums';
7
+ import { MathElement } from './math-element';
8
+ /**
9
+ * Paragraph-level math properties (`m:oMathParaPr` → `m:jc`).
10
+ *
11
+ * @public
12
+ */
13
+ export interface MathParaProperties {
14
+ readonly jc?: MathJc;
15
+ }
16
+ /**
17
+ * Display-math paragraph (`m:oMathPara`) — a block of one or more office-math equations.
18
+ *
19
+ * Child sequence: `oMathParaPr?`, `oMath` (1..∞).
20
+ *
21
+ * @public
22
+ */
23
+ export declare class MathParagraph extends MathElement {
24
+ /**
25
+ * Math element type for this root (`oMathPara`).
26
+ */
27
+ readonly type = "oMathPara";
28
+ private _properties;
29
+ private _equations;
30
+ constructor(properties?: MathParaProperties, equations?: ReadonlyArray<MathOMath>);
31
+ /**
32
+ * Paragraph-level math configuration (`m:oMathParaPr`), such as justification (`m:jc`).
33
+ */
34
+ properties: Readonly<MathParaProperties>;
35
+ /**
36
+ * Ordered office-math equations in this paragraph (`m:oMath`), each a {@link MathOMath}.
37
+ * At least one equation is required on serialize.
38
+ */
39
+ readonly equations: ReadonlyArray<MathOMath>;
40
+ /**
41
+ * Replaces the ordered `m:oMath` equations in this paragraph.
42
+ */
43
+ setEquations(next: ReadonlyArray<MathOMath>): void;
44
+ /**
45
+ * Appends one office-math equation (`m:oMath`) at the end of this paragraph.
46
+ */
47
+ appendEquation(equation: MathOMath): void;
48
+ /**
49
+ * Validates that this paragraph has at least one `m:oMath` before serialization.
50
+ *
51
+ * @private
52
+ * Called by the OMML serializer; not part of the public authoring API.
53
+ */
54
+ assertSerializable(path?: string): void;
55
+ }
56
+ /**
57
+ * Inline office-math root (`m:oMath`) — one equation body of math elements.
58
+ *
59
+ * Child sequence: `EG_OMathElements` (0..∞).
60
+ *
61
+ * @public
62
+ */
63
+ export declare class MathOMath extends MathElement {
64
+ /**
65
+ * Math element type for this root (`oMath`).
66
+ */
67
+ readonly type = "oMath";
68
+ private _children;
69
+ constructor(children?: ReadonlyArray<MathElement>);
70
+ /**
71
+ * Ordered math children of this equation (`EG_OMathElements`).
72
+ */
73
+ readonly children: ReadonlyArray<MathElement>;
74
+ /**
75
+ * Replaces the ordered math children of this equation.
76
+ */
77
+ setChildren(next: ReadonlyArray<MathElement>): void;
78
+ /**
79
+ * Appends one math element at the end of this equation.
80
+ */
81
+ appendChild(child: MathElement): void;
82
+ }
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Math root containers: `m:oMathPara`, `m:oMath`.
3
+ *
4
+ * Source: ECMA-376-4 Annex A.8.1 `CT_OMathPara`, `CT_OMath`.
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
+ var __assign = (this && this.__assign) || function () {
20
+ __assign = Object.assign || function(t) {
21
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
22
+ s = arguments[i];
23
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
24
+ t[p] = s[p];
25
+ }
26
+ return t;
27
+ };
28
+ return __assign.apply(this, arguments);
29
+ };
30
+ var __read = (this && this.__read) || function (o, n) {
31
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
32
+ if (!m) return o;
33
+ var i = m.call(o), r, ar = [], e;
34
+ try {
35
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
36
+ }
37
+ catch (error) { e = { error: error }; }
38
+ finally {
39
+ try {
40
+ if (r && !r.done && (m = i["return"])) m.call(i);
41
+ }
42
+ finally { if (e) throw e.error; }
43
+ }
44
+ return ar;
45
+ };
46
+ var __spread = (this && this.__spread) || function () {
47
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
48
+ return ar;
49
+ };
50
+ import { MathElement } from './math-element';
51
+ import { MathmlValidationError } from '../errors';
52
+ /**
53
+ * Display-math paragraph (`m:oMathPara`) — a block of one or more office-math equations.
54
+ *
55
+ * Child sequence: `oMathParaPr?`, `oMath` (1..∞).
56
+ *
57
+ * @public
58
+ */
59
+ var MathParagraph = /** @class */ (function (_super) {
60
+ __extends(MathParagraph, _super);
61
+ function MathParagraph(properties, equations) {
62
+ if (properties === void 0) { properties = {}; }
63
+ if (equations === void 0) { equations = []; }
64
+ var _this = _super.call(this) || this;
65
+ /**
66
+ * Math element type for this root (`oMathPara`).
67
+ */
68
+ _this.type = 'oMathPara';
69
+ _this._properties = Object.freeze(__assign({}, properties));
70
+ _this._equations = __spread(equations);
71
+ return _this;
72
+ }
73
+ Object.defineProperty(MathParagraph.prototype, "properties", {
74
+ /**
75
+ * Paragraph-level math configuration (`m:oMathParaPr`), such as justification (`m:jc`).
76
+ */
77
+ get: function () {
78
+ return this._properties;
79
+ },
80
+ set: function (next) {
81
+ this.assertMutable();
82
+ this._properties = Object.freeze(__assign({}, next));
83
+ this.notifyMutated();
84
+ },
85
+ enumerable: true,
86
+ configurable: true
87
+ });
88
+ Object.defineProperty(MathParagraph.prototype, "equations", {
89
+ /**
90
+ * Ordered office-math equations in this paragraph (`m:oMath`), each a {@link MathOMath}.
91
+ * At least one equation is required on serialize.
92
+ */
93
+ get: function () {
94
+ return this._equations;
95
+ },
96
+ enumerable: true,
97
+ configurable: true
98
+ });
99
+ /**
100
+ * Replaces the ordered `m:oMath` equations in this paragraph.
101
+ */
102
+ MathParagraph.prototype.setEquations = function (next) {
103
+ this.assertMutable();
104
+ this._equations = __spread(next);
105
+ this.notifyMutated();
106
+ };
107
+ /**
108
+ * Appends one office-math equation (`m:oMath`) at the end of this paragraph.
109
+ */
110
+ MathParagraph.prototype.appendEquation = function (equation) {
111
+ this.assertMutable();
112
+ this._equations.push(equation);
113
+ this.notifyMutated();
114
+ };
115
+ /**
116
+ * Validates that this paragraph has at least one `m:oMath` before serialization.
117
+ *
118
+ * @private
119
+ * Called by the OMML serializer; not part of the public authoring API.
120
+ */
121
+ MathParagraph.prototype.assertSerializable = function (path) {
122
+ if (path === void 0) { path = 'oMathPara'; }
123
+ if (this._equations.length < 1) {
124
+ throw new MathmlValidationError('m:oMathPara requires at least one m:oMath (CT_OMathPara)', path, 'required-child');
125
+ }
126
+ };
127
+ return MathParagraph;
128
+ }(MathElement));
129
+ export { MathParagraph };
130
+ /**
131
+ * Inline office-math root (`m:oMath`) — one equation body of math elements.
132
+ *
133
+ * Child sequence: `EG_OMathElements` (0..∞).
134
+ *
135
+ * @public
136
+ */
137
+ var MathOMath = /** @class */ (function (_super) {
138
+ __extends(MathOMath, _super);
139
+ function MathOMath(children) {
140
+ if (children === void 0) { children = []; }
141
+ var _this = _super.call(this) || this;
142
+ /**
143
+ * Math element type for this root (`oMath`).
144
+ */
145
+ _this.type = 'oMath';
146
+ _this._children = __spread(children);
147
+ return _this;
148
+ }
149
+ Object.defineProperty(MathOMath.prototype, "children", {
150
+ /**
151
+ * Ordered math children of this equation (`EG_OMathElements`).
152
+ */
153
+ get: function () {
154
+ return this._children;
155
+ },
156
+ enumerable: true,
157
+ configurable: true
158
+ });
159
+ /**
160
+ * Replaces the ordered math children of this equation.
161
+ */
162
+ MathOMath.prototype.setChildren = function (next) {
163
+ this.assertMutable();
164
+ this._children = __spread(next);
165
+ this.notifyMutated();
166
+ };
167
+ /**
168
+ * Appends one math element at the end of this equation.
169
+ */
170
+ MathOMath.prototype.appendChild = function (child) {
171
+ this.assertMutable();
172
+ this._children.push(child);
173
+ this.notifyMutated();
174
+ };
175
+ return MathOMath;
176
+ }(MathElement));
177
+ export { MathOMath };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Local structural OpenXml element-tree contract for mathml parse/serialize.
3
+ *
4
+ * office-common has no shared `src/core/xml` yet (TASK-9002/9003). This
5
+ * mirrors ej2-docx `src/core/xml/model.ts` so TASK-9011 can pass the same
6
+ * tree shape across the boundary. Unify when core XML lands.
7
+ *
8
+ * These types are part of the public `@syncfusion/ej2-office-common/mathml` surface
9
+ * (parse/serialize boundary). Keep them public under stripInternal builds —
10
+ * never tag this module as internal.
11
+ */
12
+ /** Attribute on an OpenXml element. */
13
+ export interface OpenXmlAttribute {
14
+ readonly namespaceUri: string;
15
+ readonly localName: string;
16
+ readonly prefix: string;
17
+ readonly value: string;
18
+ }
19
+ /** Namespace declaration (`xmlns` / `xmlns:prefix`). */
20
+ export interface NamespaceDeclaration {
21
+ readonly prefix: string;
22
+ readonly namespaceUri: string;
23
+ }
24
+ /** Element node. */
25
+ export interface OpenXmlElement {
26
+ readonly kind: 'element';
27
+ readonly namespaceUri: string;
28
+ readonly localName: string;
29
+ readonly prefix: string;
30
+ readonly attributes: ReadonlyArray<OpenXmlAttribute>;
31
+ readonly namespaceDeclarations: ReadonlyArray<NamespaceDeclaration>;
32
+ readonly children: ReadonlyArray<OpenXmlChild>;
33
+ }
34
+ /** Text node. */
35
+ export interface OpenXmlText {
36
+ readonly kind: 'text';
37
+ readonly value: string;
38
+ }
39
+ /** Child of an element. */
40
+ export declare type OpenXmlChild = OpenXmlElement | OpenXmlText;
41
+ /** Create an immutable element node. */
42
+ export declare function createElement(namespaceUri: string, localName: string, prefix: string, options?: {
43
+ readonly attributes?: ReadonlyArray<OpenXmlAttribute>;
44
+ readonly namespaceDeclarations?: ReadonlyArray<NamespaceDeclaration>;
45
+ readonly children?: ReadonlyArray<OpenXmlChild>;
46
+ }): OpenXmlElement;
47
+ /** Create a text node. */
48
+ export declare function createText(value: string): OpenXmlText;
49
+ /** Filter element children only. */
50
+ export declare function childElements(element: OpenXmlElement): ReadonlyArray<OpenXmlElement>;
51
+ /** Read the first matching attribute value by local name (any namespace). */
52
+ export declare function attrValue(element: OpenXmlElement, localName: string): string | undefined;
53
+ /** Read attribute value restricted to a namespace URI. */
54
+ export declare function attrValueNs(element: OpenXmlElement, namespaceUri: string, localName: string): string | undefined;
55
+ /** Concatenate direct text-node children. */
56
+ export declare function textContent(element: OpenXmlElement): string;