@syncfusion/ej2-office-common 35.1.37 → 35.1.43

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 (226) hide show
  1. package/dist/ej2-office-common.umd.min.js +2 -2
  2. package/dist/ej2-office-common.umd.min.js.map +1 -1
  3. package/dist/es6/ej2-office-common.es2015.js +5421 -6017
  4. package/dist/es6/ej2-office-common.es2015.js.map +1 -1
  5. package/dist/es6/ej2-office-common.es5.js +6270 -7203
  6. package/dist/es6/ej2-office-common.es5.js.map +1 -1
  7. package/dist/global/ej2-office-common.min.js +2 -2
  8. package/dist/global/ej2-office-common.min.js.map +1 -1
  9. package/dist/global/index.d.ts +1 -1
  10. package/office-common.js +4 -0
  11. package/package.json +11 -7
  12. package/src/index.d.ts +3 -17
  13. package/src/index.js +3 -18
  14. package/src/office-common/features/index.d.ts +6 -0
  15. package/src/office-common/features/index.js +6 -0
  16. package/src/office-common/features/mathml/index.d.ts +25 -0
  17. package/src/office-common/features/mathml/index.js +22 -0
  18. package/src/office-common/features/mathml/latex/latex-generator.d.ts +8 -0
  19. package/src/office-common/features/mathml/latex/latex-generator.js +357 -0
  20. package/src/office-common/features/mathml/latex/latex-parser.d.ts +87 -0
  21. package/src/office-common/features/mathml/latex/latex-parser.js +1206 -0
  22. package/src/office-common/features/mathml/latex/latex-symbols.d.ts +13 -0
  23. package/src/office-common/features/mathml/latex/latex-symbols.js +681 -0
  24. package/src/office-common/features/mathml/math-settings.d.ts +54 -0
  25. package/src/office-common/features/mathml/math-settings.js +174 -0
  26. package/src/office-common/features/mathml/office-math/adapter.d.ts +59 -0
  27. package/src/office-common/features/mathml/office-math/adapter.js +6 -0
  28. package/src/office-common/features/mathml/office-math/basic.d.ts +91 -0
  29. package/src/office-common/features/mathml/office-math/basic.js +93 -0
  30. package/src/office-common/features/mathml/office-math/break.d.ts +30 -0
  31. package/src/office-common/features/mathml/office-math/break.js +75 -0
  32. package/src/office-common/features/mathml/office-math/collection.d.ts +104 -0
  33. package/src/office-common/features/mathml/office-math/collection.js +170 -0
  34. package/src/office-common/features/mathml/office-math/entity.d.ts +12 -0
  35. package/src/office-common/features/mathml/office-math/entity.js +3 -0
  36. package/src/office-common/features/mathml/office-math/enums.d.ts +97 -0
  37. package/src/office-common/features/mathml/office-math/enums.js +108 -0
  38. package/src/office-common/features/mathml/office-math/format.d.ts +28 -0
  39. package/src/office-common/features/mathml/office-math/format.js +90 -0
  40. package/src/office-common/features/mathml/office-math/function-base.d.ts +27 -0
  41. package/src/office-common/features/mathml/office-math/function-base.js +69 -0
  42. package/src/office-common/features/mathml/office-math/function-collection.d.ts +29 -0
  43. package/src/office-common/features/mathml/office-math/function-collection.js +76 -0
  44. package/src/office-common/features/mathml/office-math/functions-basic.d.ts +118 -0
  45. package/src/office-common/features/mathml/office-math/functions-basic.js +331 -0
  46. package/src/office-common/features/mathml/office-math/functions-multi.d.ts +156 -0
  47. package/src/office-common/features/mathml/office-math/functions-multi.js +407 -0
  48. package/src/office-common/features/mathml/office-math/index.d.ts +27 -0
  49. package/src/office-common/features/mathml/office-math/index.js +25 -0
  50. package/src/office-common/features/mathml/office-math/keys.d.ts +6 -0
  51. package/src/office-common/features/mathml/office-math/keys.js +20 -0
  52. package/src/office-common/features/mathml/office-math/math-clone.d.ts +20 -0
  53. package/src/office-common/features/mathml/office-math/math-clone.js +203 -0
  54. package/src/office-common/features/mathml/office-math/math-collection.d.ts +19 -0
  55. package/src/office-common/features/mathml/office-math/math-collection.js +41 -0
  56. package/src/office-common/features/mathml/office-math/math-equality.d.ts +21 -0
  57. package/src/office-common/features/mathml/office-math/math-equality.js +115 -0
  58. package/src/office-common/features/mathml/office-math/math-paragraph.d.ts +58 -0
  59. package/src/office-common/features/mathml/office-math/math-paragraph.js +126 -0
  60. package/src/office-common/features/mathml/office-math/math-traversal.d.ts +23 -0
  61. package/src/office-common/features/mathml/office-math/math-traversal.js +95 -0
  62. package/src/office-common/features/mathml/office-math/matrix-collections.d.ts +54 -0
  63. package/src/office-common/features/mathml/office-math/matrix-collections.js +113 -0
  64. package/src/office-common/features/mathml/office-math/matrix-column.d.ts +43 -0
  65. package/src/office-common/features/mathml/office-math/matrix-column.js +96 -0
  66. package/src/office-common/features/mathml/office-math/matrix-row.d.ts +38 -0
  67. package/src/office-common/features/mathml/office-math/matrix-row.js +71 -0
  68. package/src/office-common/features/mathml/office-math/matrix.d.ts +62 -0
  69. package/src/office-common/features/mathml/office-math/matrix.js +158 -0
  70. package/src/office-common/features/mathml/office-math/office-math.d.ts +55 -0
  71. package/src/office-common/features/mathml/office-math/office-math.js +116 -0
  72. package/src/office-common/features/mathml/office-math/owner-holder.d.ts +42 -0
  73. package/src/office-common/features/mathml/office-math/owner-holder.js +87 -0
  74. package/src/office-common/features/mathml/office-math/property-store.d.ts +66 -0
  75. package/src/office-common/features/mathml/office-math/property-store.js +99 -0
  76. package/src/office-common/features/mathml/office-math/run-element.d.ts +31 -0
  77. package/src/office-common/features/mathml/office-math/run-element.js +97 -0
  78. package/src/office-common/features/mathml/office-math/unknown-element.d.ts +37 -0
  79. package/src/office-common/features/mathml/office-math/unknown-element.js +62 -0
  80. package/src/office-common/features/mathml/office-math/xml-equal.d.ts +13 -0
  81. package/src/office-common/features/mathml/office-math/xml-equal.js +24 -0
  82. package/src/office-common/features/mathml/parse/office-math-parser.d.ts +24 -0
  83. package/src/office-common/features/mathml/parse/office-math-parser.js +396 -0
  84. package/src/office-common/features/mathml/parse/office-math-properties.d.ts +165 -0
  85. package/src/office-common/features/mathml/parse/office-math-properties.js +432 -0
  86. package/src/office-common/features/mathml/parse/parse-options.d.ts +22 -0
  87. package/src/office-common/features/mathml/parse/parse-options.js +3 -0
  88. package/src/office-common/features/mathml/serialize/office-math-properties-writer.d.ts +38 -0
  89. package/src/office-common/features/mathml/serialize/office-math-properties-writer.js +267 -0
  90. package/src/office-common/features/mathml/serialize/office-math-serializer.d.ts +23 -0
  91. package/src/office-common/features/mathml/serialize/office-math-serializer.js +306 -0
  92. package/src/office-common/features/mathml/serialize/omml-writer.d.ts +123 -0
  93. package/src/office-common/features/mathml/serialize/omml-writer.js +135 -0
  94. package/src/office-common/index.d.ts +10 -0
  95. package/src/office-common/index.js +10 -0
  96. package/.eslintrc.json +0 -263
  97. package/.prettierrc.json +0 -5
  98. package/api-extractor.json +0 -35
  99. package/core.js +0 -4
  100. package/encryption.js +0 -4
  101. package/features.js +0 -4
  102. package/global.json +0 -6
  103. package/nuget.config +0 -7
  104. package/src/all.d.ts +0 -41
  105. package/src/all.js +0 -38
  106. package/src/features/index.d.ts +0 -11
  107. package/src/features/index.js +0 -11
  108. package/src/features/mathml/index.d.ts +0 -30
  109. package/src/features/mathml/index.js +0 -22
  110. package/src/features/mathml/math-factory.d.ts +0 -26
  111. package/src/features/mathml/math-factory.js +0 -568
  112. package/src/features/mathml/model/controls.d.ts +0 -896
  113. package/src/features/mathml/model/controls.js +0 -1541
  114. package/src/features/mathml/model/math-element.d.ts +0 -173
  115. package/src/features/mathml/model/math-element.js +0 -315
  116. package/src/features/mathml/model/roots.d.ts +0 -82
  117. package/src/features/mathml/model/roots.js +0 -177
  118. package/src/features/mathml/parse/math-parser.d.ts +0 -43
  119. package/src/features/mathml/parse/math-parser.js +0 -636
  120. package/src/features/mathml/serialize/math-serializer.d.ts +0 -34
  121. package/src/features/mathml/serialize/math-serializer.js +0 -749
  122. package/tsconfig.build.json +0 -13
  123. package/tsconfig.harness.json +0 -32
  124. package/tslint.json +0 -111
  125. /package/src/{core → office-common/core}/index.d.ts +0 -0
  126. /package/src/{core → office-common/core}/index.js +0 -0
  127. /package/src/{core → office-common/core}/xml/index.d.ts +0 -0
  128. /package/src/{core → office-common/core}/xml/index.js +0 -0
  129. /package/src/{core → office-common/core}/xml/model.d.ts +0 -0
  130. /package/src/{core → office-common/core}/xml/model.js +0 -0
  131. /package/src/{encryption → office-common/encryption}/agile-constants.d.ts +0 -0
  132. /package/src/{encryption → office-common/encryption}/agile-constants.js +0 -0
  133. /package/src/{encryption → office-common/encryption}/agile-encryption-info.d.ts +0 -0
  134. /package/src/{encryption → office-common/encryption}/agile-encryption-info.js +0 -0
  135. /package/src/{encryption → office-common/encryption}/agile-password.d.ts +0 -0
  136. /package/src/{encryption → office-common/encryption}/agile-password.js +0 -0
  137. /package/src/{encryption → office-common/encryption}/cfb-reader.d.ts +0 -0
  138. /package/src/{encryption → office-common/encryption}/cfb-reader.js +0 -0
  139. /package/src/{encryption → office-common/encryption}/crypto-primitives.d.ts +0 -0
  140. /package/src/{encryption → office-common/encryption}/crypto-primitives.js +0 -0
  141. /package/src/{encryption → office-common/encryption}/decrypt-encrypted-package.d.ts +0 -0
  142. /package/src/{encryption → office-common/encryption}/decrypt-encrypted-package.js +0 -0
  143. /package/src/{encryption → office-common/encryption}/encryption-info-xml.d.ts +0 -0
  144. /package/src/{encryption → office-common/encryption}/encryption-info-xml.js +0 -0
  145. /package/src/{encryption → office-common/encryption}/errors.d.ts +0 -0
  146. /package/src/{encryption → office-common/encryption}/errors.js +0 -0
  147. /package/src/{encryption → office-common/encryption}/index.d.ts +0 -0
  148. /package/src/{encryption → office-common/encryption}/index.js +0 -0
  149. /package/src/{features → office-common/features}/diagrams/constants.d.ts +0 -0
  150. /package/src/{features → office-common/features}/diagrams/constants.js +0 -0
  151. /package/src/{features → office-common/features}/diagrams/diagram-data-model.d.ts +0 -0
  152. /package/src/{features → office-common/features}/diagrams/diagram-data-model.js +0 -0
  153. /package/src/{features → office-common/features}/diagrams/diagram-parsers.d.ts +0 -0
  154. /package/src/{features → office-common/features}/diagrams/diagram-parsers.js +0 -0
  155. /package/src/{features → office-common/features}/diagrams/diagram-serializers.d.ts +0 -0
  156. /package/src/{features → office-common/features}/diagrams/diagram-serializers.js +0 -0
  157. /package/src/{features → office-common/features}/diagrams/diagram-views.d.ts +0 -0
  158. /package/src/{features → office-common/features}/diagrams/diagram-views.js +0 -0
  159. /package/src/{features → office-common/features}/diagrams/element-tree.d.ts +0 -0
  160. /package/src/{features → office-common/features}/diagrams/element-tree.js +0 -0
  161. /package/src/{features → office-common/features}/diagrams/errors.d.ts +0 -0
  162. /package/src/{features → office-common/features}/diagrams/errors.js +0 -0
  163. /package/src/{features → office-common/features}/diagrams/index.d.ts +0 -0
  164. /package/src/{features → office-common/features}/diagrams/index.js +0 -0
  165. /package/src/{features → office-common/features}/diagrams/smart-art-catalog.d.ts +0 -0
  166. /package/src/{features → office-common/features}/diagrams/smart-art-catalog.js +0 -0
  167. /package/src/{features → office-common/features}/diagrams/smart-art-diagram.d.ts +0 -0
  168. /package/src/{features → office-common/features}/diagrams/smart-art-diagram.js +0 -0
  169. /package/src/{features → office-common/features}/ink/constants.d.ts +0 -0
  170. /package/src/{features → office-common/features}/ink/constants.js +0 -0
  171. /package/src/{features → office-common/features}/ink/index.d.ts +0 -0
  172. /package/src/{features → office-common/features}/ink/index.js +0 -0
  173. /package/src/{features → office-common/features}/ink/ink-effects.d.ts +0 -0
  174. /package/src/{features → office-common/features}/ink/ink-effects.js +0 -0
  175. /package/src/{features → office-common/features}/ink/ink-model.d.ts +0 -0
  176. /package/src/{features → office-common/features}/ink/ink-model.js +0 -0
  177. /package/src/{features → office-common/features}/ink/ink-parser.d.ts +0 -0
  178. /package/src/{features → office-common/features}/ink/ink-parser.js +0 -0
  179. /package/src/{features → office-common/features}/ink/ink-serializer.d.ts +0 -0
  180. /package/src/{features → office-common/features}/ink/ink-serializer.js +0 -0
  181. /package/src/{features → office-common/features}/ink/ink-units.d.ts +0 -0
  182. /package/src/{features → office-common/features}/ink/ink-units.js +0 -0
  183. /package/src/{features → office-common/features}/ink/ink-xml.d.ts +0 -0
  184. /package/src/{features → office-common/features}/ink/ink-xml.js +0 -0
  185. /package/src/{features → office-common/features}/ink/trace-codec.d.ts +0 -0
  186. /package/src/{features → office-common/features}/ink/trace-codec.js +0 -0
  187. /package/src/{features → office-common/features}/mathml/constants.d.ts +0 -0
  188. /package/src/{features → office-common/features}/mathml/constants.js +0 -0
  189. /package/src/{features → office-common/features}/mathml/errors.d.ts +0 -0
  190. /package/src/{features → office-common/features}/mathml/errors.js +0 -0
  191. /package/src/{features → office-common/features}/mathml/model/enums.d.ts +0 -0
  192. /package/src/{features → office-common/features}/mathml/model/enums.js +0 -0
  193. /package/src/{features → office-common/features}/mathml/openxml.d.ts +0 -0
  194. /package/src/{features → office-common/features}/mathml/openxml.js +0 -0
  195. /package/src/{features → office-common/features}/smart-art/diagram-xml.d.ts +0 -0
  196. /package/src/{features → office-common/features}/smart-art/diagram-xml.js +0 -0
  197. /package/src/{features → office-common/features}/smart-art/errors.d.ts +0 -0
  198. /package/src/{features → office-common/features}/smart-art/errors.js +0 -0
  199. /package/src/{features → office-common/features}/smart-art/index.d.ts +0 -0
  200. /package/src/{features → office-common/features}/smart-art/index.js +0 -0
  201. /package/src/{features → office-common/features}/smart-art/minimal-samples.d.ts +0 -0
  202. /package/src/{features → office-common/features}/smart-art/minimal-samples.js +0 -0
  203. /package/src/{features → office-common/features}/smart-art/mutators.d.ts +0 -0
  204. /package/src/{features → office-common/features}/smart-art/mutators.js +0 -0
  205. /package/src/{features → office-common/features}/smart-art/namespaces.d.ts +0 -0
  206. /package/src/{features → office-common/features}/smart-art/namespaces.js +0 -0
  207. /package/src/{features → office-common/features}/smart-art/package-graph.d.ts +0 -0
  208. /package/src/{features → office-common/features}/smart-art/package-graph.js +0 -0
  209. /package/src/{features → office-common/features}/smart-art/parse-colors.d.ts +0 -0
  210. /package/src/{features → office-common/features}/smart-art/parse-colors.js +0 -0
  211. /package/src/{features → office-common/features}/smart-art/parse-data.d.ts +0 -0
  212. /package/src/{features → office-common/features}/smart-art/parse-data.js +0 -0
  213. /package/src/{features → office-common/features}/smart-art/parse-layout.d.ts +0 -0
  214. /package/src/{features → office-common/features}/smart-art/parse-layout.js +0 -0
  215. /package/src/{features → office-common/features}/smart-art/parse-rel-ids.d.ts +0 -0
  216. /package/src/{features → office-common/features}/smart-art/parse-rel-ids.js +0 -0
  217. /package/src/{features → office-common/features}/smart-art/parse-style.d.ts +0 -0
  218. /package/src/{features → office-common/features}/smart-art/parse-style.js +0 -0
  219. /package/src/{features → office-common/features}/smart-art/point-text.d.ts +0 -0
  220. /package/src/{features → office-common/features}/smart-art/point-text.js +0 -0
  221. /package/src/{features → office-common/features}/smart-art/register.d.ts +0 -0
  222. /package/src/{features → office-common/features}/smart-art/register.js +0 -0
  223. /package/src/{features → office-common/features}/smart-art/serialize.d.ts +0 -0
  224. /package/src/{features → office-common/features}/smart-art/serialize.js +0 -0
  225. /package/src/{features → office-common/features}/smart-art/types.d.ts +0 -0
  226. /package/src/{features → office-common/features}/smart-art/types.js +0 -0
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Matrix (`m:m`) function.
3
+ */
4
+ var __extends = (this && this.__extends) || (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics = Object.setPrototypeOf ||
7
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
9
+ return extendStatics(d, b);
10
+ };
11
+ return function (d, b) {
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ import { MathFunctionType, MathVerticalAlignment, SpacingRule } from './enums';
18
+ import { K } from './keys';
19
+ import { checkRowSpacing } from './functions-multi';
20
+ import { OfficeMathFunctionBase } from './function-base';
21
+ import { OfficeMathMatrixRowCollection, OfficeMathMatrixColumnCollection } from './matrix-collections';
22
+ /**
23
+ * Matrix whose rows and columns are kept synchronized: every row always has one cell per column.
24
+ *
25
+ * @public
26
+ */
27
+ var OfficeMathMatrix = /** @class */ (function (_super) {
28
+ __extends(OfficeMathMatrix, _super);
29
+ function OfficeMathMatrix(owner) {
30
+ var _this = _super.call(this, owner) || this;
31
+ _this.type = MathFunctionType.Matrix;
32
+ _this._rows = new OfficeMathMatrixRowCollection(_this);
33
+ _this._columns = new OfficeMathMatrixColumnCollection(_this);
34
+ return _this;
35
+ }
36
+ Object.defineProperty(OfficeMathMatrix.prototype, "rows", {
37
+ /** Rows of the matrix. */
38
+ get: function () { return this._rows; },
39
+ enumerable: true,
40
+ configurable: true
41
+ });
42
+ Object.defineProperty(OfficeMathMatrix.prototype, "columns", {
43
+ /** Columns of the matrix. */
44
+ get: function () { return this._columns; },
45
+ enumerable: true,
46
+ configurable: true
47
+ });
48
+ Object.defineProperty(OfficeMathMatrix.prototype, "verticalAlignment", {
49
+ /** Vertical alignment. Default center. */
50
+ get: function () { return this.getProperty(K.MatrixAlign, function () { return MathVerticalAlignment.Center; }); },
51
+ set: function (value) { this.setProperty(K.MatrixAlign, value); },
52
+ enumerable: true,
53
+ configurable: true
54
+ });
55
+ Object.defineProperty(OfficeMathMatrix.prototype, "hidePlaceholder", {
56
+ /** Hides placeholders for empty cells. Default false. */
57
+ get: function () { return this.getProperty(K.PlaceHoldHidden, function () { return false; }); },
58
+ set: function (value) { this.setProperty(K.PlaceHoldHidden, value); },
59
+ enumerable: true,
60
+ configurable: true
61
+ });
62
+ Object.defineProperty(OfficeMathMatrix.prototype, "rowSpacing", {
63
+ /** Row spacing; unit depends on `rowSpacingRule`. Default 0. */
64
+ get: function () { return this.getProperty(K.RowSpacing, function () { return 0; }); },
65
+ set: function (value) {
66
+ checkRowSpacing(value, this.rowSpacingRule);
67
+ this.setProperty(K.RowSpacing, value);
68
+ },
69
+ enumerable: true,
70
+ configurable: true
71
+ });
72
+ Object.defineProperty(OfficeMathMatrix.prototype, "rowSpacingRule", {
73
+ /** Row spacing rule (`m:rSpRule`). Default single. */
74
+ get: function () { return this.getProperty(K.RowSpacingRule, function () { return SpacingRule.Single; }); },
75
+ set: function (value) { this.setProperty(K.RowSpacingRule, value); },
76
+ enumerable: true,
77
+ configurable: true
78
+ });
79
+ Object.defineProperty(OfficeMathMatrix.prototype, "columnGap", {
80
+ /** Column gap (`m:cGp`). Default 0. */
81
+ get: function () { return this.getProperty(K.ColumnGap, function () { return 0; }); },
82
+ set: function (value) { this.setProperty(K.ColumnGap, value); },
83
+ enumerable: true,
84
+ configurable: true
85
+ });
86
+ Object.defineProperty(OfficeMathMatrix.prototype, "columnGapRule", {
87
+ /** Column gap rule (`m:cGpRule`). Default single. */
88
+ get: function () { return this.getProperty(K.ColumnGapRule, function () { return SpacingRule.Single; }); },
89
+ set: function (value) { this.setProperty(K.ColumnGapRule, value); },
90
+ enumerable: true,
91
+ configurable: true
92
+ });
93
+ Object.defineProperty(OfficeMathMatrix.prototype, "hidePlaceHolders", {
94
+ /** DocIO-compatible alias of `hidePlaceholder` (`m:plcHide`). */
95
+ get: function () { return this.hidePlaceholder; },
96
+ set: function (value) { this.hidePlaceholder = value; },
97
+ enumerable: true,
98
+ configurable: true
99
+ });
100
+ Object.defineProperty(OfficeMathMatrix.prototype, "columnSpacingRule", {
101
+ /** DocIO-compatible alias of `columnGapRule` (`m:cGpRule`). */
102
+ get: function () { return this.columnGapRule; },
103
+ set: function (value) { this.columnGapRule = value; },
104
+ enumerable: true,
105
+ configurable: true
106
+ });
107
+ Object.defineProperty(OfficeMathMatrix.prototype, "columnWidth", {
108
+ /** DocIO-compatible name for the column width (`m:cSp`); shares storage with `columnSpacing`. */
109
+ get: function () { return this.columnSpacing; },
110
+ set: function (value) { this.columnSpacing = value; },
111
+ enumerable: true,
112
+ configurable: true
113
+ });
114
+ Object.defineProperty(OfficeMathMatrix.prototype, "columnSpacing", {
115
+ /** Column spacing (`m:cSp`). Default 0. */
116
+ get: function () { return this.getProperty(K.ColumnSpacing, function () { return 0; }); },
117
+ set: function (value) { this.setProperty(K.ColumnSpacing, value); },
118
+ enumerable: true,
119
+ configurable: true
120
+ });
121
+ Object.defineProperty(OfficeMathMatrix.prototype, "columnGroups", {
122
+ /** Column groups: consecutive columns with identical alignment, in order. */
123
+ get: function () {
124
+ var groups = [];
125
+ this._columns.toArray().forEach(function (column, index) {
126
+ var last = groups[groups.length - 1];
127
+ if (last !== undefined && last.horizontalAlignment === column.horizontalAlignment) {
128
+ last.count++;
129
+ }
130
+ else {
131
+ groups.push({ startIndex: index, count: 1, horizontalAlignment: column.horizontalAlignment });
132
+ }
133
+ });
134
+ return groups;
135
+ },
136
+ enumerable: true,
137
+ configurable: true
138
+ });
139
+ /**
140
+ * Re-links every cell to its row and column after a structural change.
141
+ *
142
+ * @private
143
+ */
144
+ OfficeMathMatrix.prototype.relink = function () {
145
+ var columns = this._columns.toArray();
146
+ this._rows.toArray().forEach(function (row) {
147
+ row.arguments.toArray().forEach(function (cell, i) { return cell.setOwnerColumn(columns[i]); });
148
+ });
149
+ };
150
+ Object.defineProperty(OfficeMathMatrix.prototype, "rowItems", {
151
+ /** @private */
152
+ get: function () { return this._rows.toArray(); },
153
+ enumerable: true,
154
+ configurable: true
155
+ });
156
+ return OfficeMathMatrix;
157
+ }(OfficeMathFunctionBase));
158
+ export { OfficeMathMatrix };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Office Math equation (`m:oMath`): a container of Math functions.
3
+ */
4
+ import { OwnerHolder } from './owner-holder';
5
+ import { OfficeMathEntity } from './entity';
6
+ import { OfficeMathFunctionCollection } from './function-collection';
7
+ import { OfficeMathBreakCollection } from './break';
8
+ import { OpenXmlElement } from '../openxml';
9
+ /** Column back-reference used by matrix synchronization. */
10
+ interface ColumnLink {
11
+ readonly columnIndex: number;
12
+ }
13
+ /**
14
+ * Equation that holds an ordered list of Math functions.
15
+ *
16
+ * @public
17
+ */
18
+ export declare class OfficeMath extends OwnerHolder {
19
+ private readonly _functions;
20
+ private readonly _breaks;
21
+ private _column;
22
+ private _preservedControl;
23
+ constructor(owner?: OfficeMathEntity);
24
+ /** Manual breaks owned by this equation; a box references one of them. */
25
+ readonly breaks: OfficeMathBreakCollection;
26
+ /** Functions of this equation. */
27
+ readonly functions: OfficeMathFunctionCollection;
28
+ /**
29
+ * Argument size (`m:argPr/m:argSz`), from -2 to 2. Default 0.
30
+ *
31
+ * @returns {number} The argument size.
32
+ */
33
+ argumentSize: number;
34
+ /**
35
+ * The original `m:ctrlPr` of an argument, kept verbatim for round trips.
36
+ *
37
+ * @returns {OpenXmlElement | undefined} The preserved element, when present.
38
+ * @private
39
+ */
40
+ preservedControlProperties: OpenXmlElement | undefined;
41
+ /** The nearest enclosing equation, or `undefined` for a top-level equation. */
42
+ readonly ownerMath: OfficeMath | undefined;
43
+ /** The matrix row that owns this cell, or `undefined` when it is not a matrix cell. */
44
+ readonly ownerRow: OfficeMathEntity | undefined;
45
+ /** The matrix column that contains this cell, or `undefined` when it is not a matrix cell. */
46
+ readonly ownerColumn: ColumnLink | undefined;
47
+ /**
48
+ * @private
49
+ *
50
+ * @param {ColumnLink | undefined} column The column the equation belongs to.
51
+ * @returns {void}
52
+ */
53
+ setOwnerColumn(column: ColumnLink | undefined): void;
54
+ }
55
+ export {};
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Office Math equation (`m:oMath`): a container of Math functions.
3
+ */
4
+ var __extends = (this && this.__extends) || (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics = Object.setPrototypeOf ||
7
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
9
+ return extendStatics(d, b);
10
+ };
11
+ return function (d, b) {
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ import { OwnerHolder } from './owner-holder';
18
+ import { OfficeMathFunctionCollection } from './function-collection';
19
+ import { OfficeMathBreakCollection } from './break';
20
+ import { K } from './keys';
21
+ /**
22
+ * Equation that holds an ordered list of Math functions.
23
+ *
24
+ * @public
25
+ */
26
+ var OfficeMath = /** @class */ (function (_super) {
27
+ __extends(OfficeMath, _super);
28
+ function OfficeMath(owner) {
29
+ var _this = _super.call(this, owner) || this;
30
+ _this._functions = new OfficeMathFunctionCollection(_this);
31
+ _this._breaks = new OfficeMathBreakCollection(_this);
32
+ return _this;
33
+ }
34
+ Object.defineProperty(OfficeMath.prototype, "breaks", {
35
+ /** Manual breaks owned by this equation; a box references one of them. */
36
+ get: function () { return this._breaks; },
37
+ enumerable: true,
38
+ configurable: true
39
+ });
40
+ Object.defineProperty(OfficeMath.prototype, "functions", {
41
+ /** Functions of this equation. */
42
+ get: function () { return this._functions; },
43
+ enumerable: true,
44
+ configurable: true
45
+ });
46
+ Object.defineProperty(OfficeMath.prototype, "argumentSize", {
47
+ /**
48
+ * Argument size (`m:argPr/m:argSz`), from -2 to 2. Default 0.
49
+ *
50
+ * @returns {number} The argument size.
51
+ */
52
+ get: function () { return this.getProperty(K.ArgumentSize, function () { return 0; }); },
53
+ set: function (value) {
54
+ if (value < -2 || value > 2 || Math.floor(value) !== value) {
55
+ throw new RangeError('ArgumentSize must be an integer between -2 and 2.');
56
+ }
57
+ this.setProperty(K.ArgumentSize, value);
58
+ },
59
+ enumerable: true,
60
+ configurable: true
61
+ });
62
+ Object.defineProperty(OfficeMath.prototype, "preservedControlProperties", {
63
+ /**
64
+ * The original `m:ctrlPr` of an argument, kept verbatim for round trips.
65
+ *
66
+ * @returns {OpenXmlElement | undefined} The preserved element, when present.
67
+ * @private
68
+ */
69
+ get: function () { return this._preservedControl; },
70
+ set: function (value) {
71
+ this._preservedControl = value;
72
+ this.notifyMutated();
73
+ },
74
+ enumerable: true,
75
+ configurable: true
76
+ });
77
+ Object.defineProperty(OfficeMath.prototype, "ownerMath", {
78
+ /** The nearest enclosing equation, or `undefined` for a top-level equation. */
79
+ get: function () {
80
+ var entity = this.ownerMathEntity;
81
+ while (entity !== undefined) {
82
+ if (entity instanceof OfficeMath) {
83
+ return entity;
84
+ }
85
+ entity = entity.ownerMathEntity;
86
+ }
87
+ return undefined;
88
+ },
89
+ enumerable: true,
90
+ configurable: true
91
+ });
92
+ Object.defineProperty(OfficeMath.prototype, "ownerRow", {
93
+ /** The matrix row that owns this cell, or `undefined` when it is not a matrix cell. */
94
+ get: function () {
95
+ var owner = this.ownerMathEntity;
96
+ return owner !== undefined && 'arguments' in owner ? owner : undefined;
97
+ },
98
+ enumerable: true,
99
+ configurable: true
100
+ });
101
+ Object.defineProperty(OfficeMath.prototype, "ownerColumn", {
102
+ /** The matrix column that contains this cell, or `undefined` when it is not a matrix cell. */
103
+ get: function () { return this._column; },
104
+ enumerable: true,
105
+ configurable: true
106
+ });
107
+ /**
108
+ * @private
109
+ *
110
+ * @param {ColumnLink | undefined} column The column the equation belongs to.
111
+ * @returns {void}
112
+ */
113
+ OfficeMath.prototype.setOwnerColumn = function (column) { this._column = column; };
114
+ return OfficeMath;
115
+ }(OwnerHolder));
116
+ export { OfficeMath };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Base class of every owner-aware Math object.
3
+ */
4
+ import { OfficeMathEntity } from './entity';
5
+ import { ExplicitPropertyStore } from './property-store';
6
+ /**
7
+ * Holds the owner reference, bubbles mutations to the root and tracks explicit properties.
8
+ *
9
+ * @public
10
+ */
11
+ export declare abstract class OwnerHolder extends ExplicitPropertyStore implements OfficeMathEntity {
12
+ private _owner;
13
+ constructor(owner?: OfficeMathEntity);
14
+ /** The containing entity, or `undefined` for a root or detached object. */
15
+ readonly ownerMathEntity: OfficeMathEntity | undefined;
16
+ /**
17
+ * Re-parents this object.
18
+ *
19
+ * @param owner
20
+ * @private
21
+ */
22
+ setOwner(owner: OfficeMathEntity | undefined): void;
23
+ /**
24
+ * True when this object is a matrix row or column, whose arguments are managed by synchronization.
25
+ *
26
+ * @private
27
+ */
28
+ readonly isMatrixArgumentOwner: boolean;
29
+ /**
30
+ * Root-level mutation sink. The Math paragraph overrides it to notify the host.
31
+ *
32
+ * @private
33
+ */
34
+ protected rootMutated(): void;
35
+ /**
36
+ * Notifies the root that something below it changed.
37
+ *
38
+ * @private
39
+ */
40
+ notifyMutated(): void;
41
+ protected propertyChanged(): void;
42
+ }
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Base class of every owner-aware Math object.
3
+ */
4
+ var __extends = (this && this.__extends) || (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics = Object.setPrototypeOf ||
7
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
9
+ return extendStatics(d, b);
10
+ };
11
+ return function (d, b) {
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ import { ExplicitPropertyStore } from './property-store';
18
+ /**
19
+ * Holds the owner reference, bubbles mutations to the root and tracks explicit properties.
20
+ *
21
+ * @public
22
+ */
23
+ var OwnerHolder = /** @class */ (function (_super) {
24
+ __extends(OwnerHolder, _super);
25
+ function OwnerHolder(owner) {
26
+ var _this = _super.call(this) || this;
27
+ _this._owner = owner;
28
+ return _this;
29
+ }
30
+ Object.defineProperty(OwnerHolder.prototype, "ownerMathEntity", {
31
+ /** The containing entity, or `undefined` for a root or detached object. */
32
+ get: function () {
33
+ return this._owner;
34
+ },
35
+ enumerable: true,
36
+ configurable: true
37
+ });
38
+ /**
39
+ * Re-parents this object.
40
+ *
41
+ * @param owner
42
+ * @private
43
+ */
44
+ OwnerHolder.prototype.setOwner = function (owner) {
45
+ this._owner = owner;
46
+ };
47
+ Object.defineProperty(OwnerHolder.prototype, "isMatrixArgumentOwner", {
48
+ /**
49
+ * True when this object is a matrix row or column, whose arguments are managed by synchronization.
50
+ *
51
+ * @private
52
+ */
53
+ get: function () {
54
+ return false;
55
+ },
56
+ enumerable: true,
57
+ configurable: true
58
+ });
59
+ /**
60
+ * Root-level mutation sink. The Math paragraph overrides it to notify the host.
61
+ *
62
+ * @private
63
+ */
64
+ OwnerHolder.prototype.rootMutated = function () {
65
+ // no-op unless this object is the root
66
+ };
67
+ /**
68
+ * Notifies the root that something below it changed.
69
+ *
70
+ * @private
71
+ */
72
+ OwnerHolder.prototype.notifyMutated = function () {
73
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
74
+ var current = this;
75
+ var next = current._owner;
76
+ while (next instanceof OwnerHolder) {
77
+ current = next;
78
+ next = current._owner;
79
+ }
80
+ current.rootMutated();
81
+ };
82
+ OwnerHolder.prototype.propertyChanged = function () {
83
+ this.notifyMutated();
84
+ };
85
+ return OwnerHolder;
86
+ }(ExplicitPropertyStore));
87
+ export { OwnerHolder };
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Explicit-value tracking for Math properties.
3
+ *
4
+ * Public getters return effective (Compression-compatible) defaults while the
5
+ * store separately remembers which keys were assigned or parsed, so the
6
+ * serializer emits only explicit values.
7
+ */
8
+ /**
9
+ * Reusable keyed property store.
10
+ *
11
+ * @public
12
+ */
13
+ export declare class ExplicitPropertyStore {
14
+ private readonly _values;
15
+ /**
16
+ * Whether the key was explicitly assigned or parsed.
17
+ *
18
+ * @param key
19
+ */
20
+ protected hasProperty(key: number): boolean;
21
+ /**
22
+ * Returns the explicit value, or the lazily computed effective default.
23
+ *
24
+ * @param key
25
+ * @param defaultValue
26
+ */
27
+ protected getProperty<T>(key: number, defaultValue: () => T): T;
28
+ /**
29
+ * Assigns a value and marks it explicit, even when equal to the default.
30
+ *
31
+ * @param key
32
+ * @param value
33
+ */
34
+ protected setProperty<T>(key: number, value: T): void;
35
+ /**
36
+ * Removes the explicit value so the effective default applies again.
37
+ *
38
+ * @param key
39
+ */
40
+ protected clearProperty(key: number): void;
41
+ /**
42
+ * Whether a property was explicitly set or parsed from source.
43
+ * Serializers use this to emit only explicit values.
44
+ *
45
+ * @param key
46
+ */
47
+ isExplicit(key: number): boolean;
48
+ /**
49
+ * Copies every explicit property of `source` into this store, keeping explicitness.
50
+ *
51
+ * @param {ExplicitPropertyStore} source Store to copy from.
52
+ * @returns {void}
53
+ * @private
54
+ */
55
+ copyExplicitFrom(source: ExplicitPropertyStore): void;
56
+ /**
57
+ * Whether both stores hold the same explicit keys with equal values.
58
+ *
59
+ * @param {ExplicitPropertyStore} other Store to compare with.
60
+ * @returns {boolean} True when the explicit properties are identical.
61
+ * @private
62
+ */
63
+ explicitEquals(other: ExplicitPropertyStore): boolean;
64
+ /** Hook invoked after any mutation of the store. */
65
+ protected propertyChanged(): void;
66
+ }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Explicit-value tracking for Math properties.
3
+ *
4
+ * Public getters return effective (Compression-compatible) defaults while the
5
+ * store separately remembers which keys were assigned or parsed, so the
6
+ * serializer emits only explicit values.
7
+ */
8
+ /**
9
+ * Reusable keyed property store.
10
+ *
11
+ * @public
12
+ */
13
+ var ExplicitPropertyStore = /** @class */ (function () {
14
+ function ExplicitPropertyStore() {
15
+ this._values = new Map();
16
+ }
17
+ /**
18
+ * Whether the key was explicitly assigned or parsed.
19
+ *
20
+ * @param key
21
+ */
22
+ ExplicitPropertyStore.prototype.hasProperty = function (key) {
23
+ return this._values.has(key);
24
+ };
25
+ /**
26
+ * Returns the explicit value, or the lazily computed effective default.
27
+ *
28
+ * @param key
29
+ * @param defaultValue
30
+ */
31
+ ExplicitPropertyStore.prototype.getProperty = function (key, defaultValue) {
32
+ return this._values.has(key) ? this._values.get(key) : defaultValue();
33
+ };
34
+ /**
35
+ * Assigns a value and marks it explicit, even when equal to the default.
36
+ *
37
+ * @param key
38
+ * @param value
39
+ */
40
+ ExplicitPropertyStore.prototype.setProperty = function (key, value) {
41
+ this._values.set(key, value);
42
+ this.propertyChanged();
43
+ };
44
+ /**
45
+ * Removes the explicit value so the effective default applies again.
46
+ *
47
+ * @param key
48
+ */
49
+ ExplicitPropertyStore.prototype.clearProperty = function (key) {
50
+ if (this._values.delete(key)) {
51
+ this.propertyChanged();
52
+ }
53
+ };
54
+ /**
55
+ * Whether a property was explicitly set or parsed from source.
56
+ * Serializers use this to emit only explicit values.
57
+ *
58
+ * @param key
59
+ */
60
+ ExplicitPropertyStore.prototype.isExplicit = function (key) {
61
+ return this.hasProperty(key);
62
+ };
63
+ /**
64
+ * Copies every explicit property of `source` into this store, keeping explicitness.
65
+ *
66
+ * @param {ExplicitPropertyStore} source Store to copy from.
67
+ * @returns {void}
68
+ * @private
69
+ */
70
+ ExplicitPropertyStore.prototype.copyExplicitFrom = function (source) {
71
+ var _this = this;
72
+ source._values.forEach(function (value, key) { return _this._values.set(key, value); });
73
+ };
74
+ /**
75
+ * Whether both stores hold the same explicit keys with equal values.
76
+ *
77
+ * @param {ExplicitPropertyStore} other Store to compare with.
78
+ * @returns {boolean} True when the explicit properties are identical.
79
+ * @private
80
+ */
81
+ ExplicitPropertyStore.prototype.explicitEquals = function (other) {
82
+ if (this._values.size !== other._values.size) {
83
+ return false;
84
+ }
85
+ var equal = true;
86
+ this._values.forEach(function (value, key) {
87
+ if (!other._values.has(key) || other._values.get(key) !== value) {
88
+ equal = false;
89
+ }
90
+ });
91
+ return equal;
92
+ };
93
+ /** Hook invoked after any mutation of the store. */
94
+ ExplicitPropertyStore.prototype.propertyChanged = function () {
95
+ // overridden by owner-aware subclasses
96
+ };
97
+ return ExplicitPropertyStore;
98
+ }());
99
+ export { ExplicitPropertyStore };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Run element (`m:r`) holding a document-native run.
3
+ */
4
+ import { MathFunctionType } from './enums';
5
+ import { OfficeMathFunctionBase } from './function-base';
6
+ import { OfficeMathFormat } from './format';
7
+ import { OfficeRun } from './adapter';
8
+ import { OfficeMathEntity } from './entity';
9
+ /**
10
+ * Math run: native document run plus Math format (`m:rPr`).
11
+ *
12
+ * @public
13
+ */
14
+ export declare class OfficeMathRunElement extends OfficeMathFunctionBase {
15
+ readonly type = MathFunctionType.RunElement;
16
+ private _item;
17
+ private readonly _mathFormat;
18
+ constructor(owner?: OfficeMathEntity);
19
+ /** The native document run. */
20
+ item: OfficeRun | undefined;
21
+ /**
22
+ * Text of the run (`m:t`). Uses the host adapter when the run is attached to a paragraph
23
+ * that has one, otherwise a standalone run. Empty when no run exists yet.
24
+ *
25
+ * @returns {string} The run text.
26
+ */
27
+ text: string;
28
+ private findAdapter;
29
+ /** Math run format (`m:rPr`). */
30
+ readonly mathFormat: OfficeMathFormat;
31
+ }