@syncfusion/ej2-office-common 35.1.37 → 35.1.42

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,170 @@
1
+ /**
2
+ * Generic owner-aware mutable collection used by every Math collection.
3
+ */
4
+ /**
5
+ * Ordered collection that assigns/detaches owners and notifies the root on change.
6
+ * Items are also reachable by numeric index (`collection[0]`).
7
+ *
8
+ * @public
9
+ */
10
+ var OwnedCollection = /** @class */ (function () {
11
+ function OwnedCollection(owner) {
12
+ this.owner = owner;
13
+ this._items = [];
14
+ this._synced = 0;
15
+ }
16
+ Object.defineProperty(OwnedCollection.prototype, "count", {
17
+ /** Number of items. */
18
+ get: function () {
19
+ return this._items.length;
20
+ },
21
+ enumerable: true,
22
+ configurable: true
23
+ });
24
+ /**
25
+ * Returns the item at `index`.
26
+ *
27
+ * @param index
28
+ */
29
+ OwnedCollection.prototype.getItem = function (index) {
30
+ this.checkIndex(index, this._items.length - 1);
31
+ return this._items[index];
32
+ };
33
+ /**
34
+ * Inserts an item at `index`; throws when it already belongs to a collection.
35
+ *
36
+ * @param index
37
+ * @param item
38
+ */
39
+ OwnedCollection.prototype.insert = function (index, item) {
40
+ this.insertItem(index, item);
41
+ };
42
+ /**
43
+ * Removes the item; no-op when it is not in the collection.
44
+ *
45
+ * @param value
46
+ */
47
+ OwnedCollection.prototype.remove = function (value) {
48
+ var index = this._items.indexOf(value);
49
+ if (index >= 0) {
50
+ this.removeAt(index);
51
+ }
52
+ };
53
+ /**
54
+ * Removes the item at `index`.
55
+ *
56
+ * @param index
57
+ */
58
+ OwnedCollection.prototype.removeAt = function (index) {
59
+ this.checkIndex(index, this._items.length - 1);
60
+ var removed = this._items.splice(index, 1)[0];
61
+ this.detach(removed);
62
+ this.afterChange();
63
+ };
64
+ /** Removes all items. */
65
+ OwnedCollection.prototype.clear = function () {
66
+ var _this = this;
67
+ var removed = this._items.splice(0, this._items.length);
68
+ removed.forEach(function (item) { return _this.detach(item); });
69
+ this.afterChange();
70
+ };
71
+ /** Iterates the items in order. */
72
+ OwnedCollection.prototype[Symbol.iterator] = function () {
73
+ return this._items[Symbol.iterator]();
74
+ };
75
+ /**
76
+ * Snapshot of the items.
77
+ *
78
+ * @private
79
+ */
80
+ OwnedCollection.prototype.toArray = function () {
81
+ return this._items.slice();
82
+ };
83
+ /**
84
+ * Appends without owner assignment or notification (view/internal use).
85
+ *
86
+ * @param item
87
+ * @private
88
+ */
89
+ OwnedCollection.prototype.pushRaw = function (item) {
90
+ this._items.push(item);
91
+ this.syncIndexes();
92
+ };
93
+ /**
94
+ * Inserts with owner assignment but without the matrix guard or validation (synchronization use).
95
+ *
96
+ * @param index
97
+ * @param item
98
+ * @private
99
+ */
100
+ OwnedCollection.prototype.insertRaw = function (index, item) {
101
+ this.attach(item);
102
+ this._items.splice(index, 0, item);
103
+ this.syncIndexes();
104
+ };
105
+ /**
106
+ * Assigns ownership of an item entering the collection.
107
+ *
108
+ * @param item
109
+ */
110
+ OwnedCollection.prototype.attach = function (item) {
111
+ item.setOwner(this.owner);
112
+ };
113
+ /**
114
+ * Removes by index and detaches without notification (synchronization use).
115
+ *
116
+ * @param index
117
+ * @private
118
+ */
119
+ OwnedCollection.prototype.removeRawAt = function (index) {
120
+ var removed = this._items.splice(index, 1)[0];
121
+ this.detach(removed);
122
+ this.syncIndexes();
123
+ return removed;
124
+ };
125
+ /**
126
+ * Inserts after validating index and ownership.
127
+ *
128
+ * @param index
129
+ * @param item
130
+ */
131
+ OwnedCollection.prototype.insertItem = function (index, item) {
132
+ this.checkIndex(index, this._items.length);
133
+ if (this._items.indexOf(item) >= 0 || (item.ownerMathEntity !== undefined && item.ownerMathEntity !== this.owner)) {
134
+ throw new Error('The item already belongs to a Math collection.');
135
+ }
136
+ item.setOwner(this.owner);
137
+ this._items.splice(index, 0, item);
138
+ this.afterChange();
139
+ };
140
+ /** Hook for subclasses after any structural change. */
141
+ OwnedCollection.prototype.afterChange = function () {
142
+ this.syncIndexes();
143
+ this.owner.notifyMutated();
144
+ };
145
+ /**
146
+ * Detaches a removed item.
147
+ *
148
+ * @param item
149
+ */
150
+ OwnedCollection.prototype.detach = function (item) {
151
+ item.setOwner(undefined);
152
+ };
153
+ OwnedCollection.prototype.checkIndex = function (index, max) {
154
+ if (!(index >= 0 && index <= max) || Math.floor(index) !== index) {
155
+ throw new RangeError('Index ' + index + ' is out of range.');
156
+ }
157
+ };
158
+ OwnedCollection.prototype.syncIndexes = function () {
159
+ var self = this;
160
+ for (var i = this._items.length; i < this._synced; i++) {
161
+ delete self[i];
162
+ }
163
+ for (var i = 0; i < this._items.length; i++) {
164
+ self[i] = this._items[i];
165
+ }
166
+ this._synced = this._items.length;
167
+ };
168
+ return OwnedCollection;
169
+ }());
170
+ export { OwnedCollection };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Root contract of every Office Math object.
3
+ */
4
+ /**
5
+ * Participates in the Math owner hierarchy.
6
+ *
7
+ * @public
8
+ */
9
+ export interface OfficeMathEntity {
10
+ /** The entity that contains this object, or `undefined` for a root/detached object. */
11
+ readonly ownerMathEntity: OfficeMathEntity | undefined;
12
+ }
@@ -0,0 +1,3 @@
1
+ /**
2
+ * Root contract of every Office Math object.
3
+ */
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Office Math authoring enumerations.
3
+ *
4
+ * Values mirror the Compression `Syncfusion.Office` Math enums so scratch-level
5
+ * authoring behaves identically to DocIO. OMML token mapping lives in the
6
+ * parser/serializer.
7
+ */
8
+ /** Math paragraph justification. @public */
9
+ export declare enum MathJustification {
10
+ CenterGroup = 0,
11
+ Center = 1,
12
+ Left = 2,
13
+ Right = 3
14
+ }
15
+ /** Math script (font family class) of a run. @public */
16
+ export declare enum MathFontType {
17
+ DoubleStruck = 0,
18
+ Fraktur = 1,
19
+ Monospace = 2,
20
+ Roman = 3,
21
+ SansSerif = 4,
22
+ Script = 5
23
+ }
24
+ /** Math run style. @public */
25
+ export declare enum MathStyleType {
26
+ Italic = 0,
27
+ BoldItalic = 1,
28
+ Bold = 2,
29
+ Regular = 3
30
+ }
31
+ /** Identifies the concrete Math function created by the function factory. @public */
32
+ export declare enum MathFunctionType {
33
+ /** Unrecognized `m:*` element preserved verbatim; never created by the factory. */
34
+ Unknown = 0,
35
+ Accent = 1,
36
+ Bar = 2,
37
+ BorderBox = 3,
38
+ Box = 4,
39
+ Delimiter = 5,
40
+ EquationArray = 6,
41
+ Fraction = 7,
42
+ Function = 8,
43
+ GroupCharacter = 9,
44
+ Limit = 10,
45
+ Matrix = 11,
46
+ NArray = 12,
47
+ Phantom = 13,
48
+ Radical = 14,
49
+ LeftSubSuperscript = 15,
50
+ SubSuperscript = 16,
51
+ RightSubSuperscript = 17,
52
+ RunElement = 18
53
+ }
54
+ /** Delimiter shape. @public */
55
+ export declare enum MathDelimiterShapeType {
56
+ Centered = 0,
57
+ Match = 1
58
+ }
59
+ /** Fraction type. @public */
60
+ export declare enum MathFractionType {
61
+ NormalFractionBar = 0,
62
+ NoFractionBar = 1,
63
+ SkewedFractionBar = 2,
64
+ FractionInline = 3
65
+ }
66
+ /** Horizontal alignment of a matrix column. @public */
67
+ export declare enum MathHorizontalAlignment {
68
+ Center = 0,
69
+ Left = 1,
70
+ Right = 2
71
+ }
72
+ /** Vertical alignment of a matrix or equation array. @public */
73
+ export declare enum MathVerticalAlignment {
74
+ Center = 0,
75
+ Top = 1,
76
+ Bottom = 2
77
+ }
78
+ /** Spacing rule for matrix and equation array spacing. @public */
79
+ export declare enum SpacingRule {
80
+ Single = 0,
81
+ OneAndHalf = 1,
82
+ Double = 2,
83
+ Exactly = 3,
84
+ Multiple = 4
85
+ }
86
+ /** Script type of a single sub/superscript function. @public */
87
+ export declare enum MathScriptType {
88
+ Superscript = 0,
89
+ Subscript = 1
90
+ }
91
+ /** Limit type of a limit function. @public */
92
+ export declare enum MathLimitType {
93
+ LowerLimit = 0,
94
+ UpperLimit = 1
95
+ }
96
+ /** Em constant used by matrix spacing (half-em snapping). */
97
+ export declare const MATH_EM = 12;
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Office Math authoring enumerations.
3
+ *
4
+ * Values mirror the Compression `Syncfusion.Office` Math enums so scratch-level
5
+ * authoring behaves identically to DocIO. OMML token mapping lives in the
6
+ * parser/serializer.
7
+ */
8
+ /** Math paragraph justification. @public */
9
+ export var MathJustification;
10
+ (function (MathJustification) {
11
+ MathJustification[MathJustification["CenterGroup"] = 0] = "CenterGroup";
12
+ MathJustification[MathJustification["Center"] = 1] = "Center";
13
+ MathJustification[MathJustification["Left"] = 2] = "Left";
14
+ MathJustification[MathJustification["Right"] = 3] = "Right";
15
+ })(MathJustification || (MathJustification = {}));
16
+ /** Math script (font family class) of a run. @public */
17
+ export var MathFontType;
18
+ (function (MathFontType) {
19
+ MathFontType[MathFontType["DoubleStruck"] = 0] = "DoubleStruck";
20
+ MathFontType[MathFontType["Fraktur"] = 1] = "Fraktur";
21
+ MathFontType[MathFontType["Monospace"] = 2] = "Monospace";
22
+ MathFontType[MathFontType["Roman"] = 3] = "Roman";
23
+ MathFontType[MathFontType["SansSerif"] = 4] = "SansSerif";
24
+ MathFontType[MathFontType["Script"] = 5] = "Script";
25
+ })(MathFontType || (MathFontType = {}));
26
+ /** Math run style. @public */
27
+ export var MathStyleType;
28
+ (function (MathStyleType) {
29
+ MathStyleType[MathStyleType["Italic"] = 0] = "Italic";
30
+ MathStyleType[MathStyleType["BoldItalic"] = 1] = "BoldItalic";
31
+ MathStyleType[MathStyleType["Bold"] = 2] = "Bold";
32
+ MathStyleType[MathStyleType["Regular"] = 3] = "Regular";
33
+ })(MathStyleType || (MathStyleType = {}));
34
+ /** Identifies the concrete Math function created by the function factory. @public */
35
+ export var MathFunctionType;
36
+ (function (MathFunctionType) {
37
+ /** Unrecognized `m:*` element preserved verbatim; never created by the factory. */
38
+ MathFunctionType[MathFunctionType["Unknown"] = 0] = "Unknown";
39
+ MathFunctionType[MathFunctionType["Accent"] = 1] = "Accent";
40
+ MathFunctionType[MathFunctionType["Bar"] = 2] = "Bar";
41
+ MathFunctionType[MathFunctionType["BorderBox"] = 3] = "BorderBox";
42
+ MathFunctionType[MathFunctionType["Box"] = 4] = "Box";
43
+ MathFunctionType[MathFunctionType["Delimiter"] = 5] = "Delimiter";
44
+ MathFunctionType[MathFunctionType["EquationArray"] = 6] = "EquationArray";
45
+ MathFunctionType[MathFunctionType["Fraction"] = 7] = "Fraction";
46
+ MathFunctionType[MathFunctionType["Function"] = 8] = "Function";
47
+ MathFunctionType[MathFunctionType["GroupCharacter"] = 9] = "GroupCharacter";
48
+ MathFunctionType[MathFunctionType["Limit"] = 10] = "Limit";
49
+ MathFunctionType[MathFunctionType["Matrix"] = 11] = "Matrix";
50
+ MathFunctionType[MathFunctionType["NArray"] = 12] = "NArray";
51
+ MathFunctionType[MathFunctionType["Phantom"] = 13] = "Phantom";
52
+ MathFunctionType[MathFunctionType["Radical"] = 14] = "Radical";
53
+ MathFunctionType[MathFunctionType["LeftSubSuperscript"] = 15] = "LeftSubSuperscript";
54
+ MathFunctionType[MathFunctionType["SubSuperscript"] = 16] = "SubSuperscript";
55
+ MathFunctionType[MathFunctionType["RightSubSuperscript"] = 17] = "RightSubSuperscript";
56
+ MathFunctionType[MathFunctionType["RunElement"] = 18] = "RunElement";
57
+ })(MathFunctionType || (MathFunctionType = {}));
58
+ /** Delimiter shape. @public */
59
+ export var MathDelimiterShapeType;
60
+ (function (MathDelimiterShapeType) {
61
+ MathDelimiterShapeType[MathDelimiterShapeType["Centered"] = 0] = "Centered";
62
+ MathDelimiterShapeType[MathDelimiterShapeType["Match"] = 1] = "Match";
63
+ })(MathDelimiterShapeType || (MathDelimiterShapeType = {}));
64
+ /** Fraction type. @public */
65
+ export var MathFractionType;
66
+ (function (MathFractionType) {
67
+ MathFractionType[MathFractionType["NormalFractionBar"] = 0] = "NormalFractionBar";
68
+ MathFractionType[MathFractionType["NoFractionBar"] = 1] = "NoFractionBar";
69
+ MathFractionType[MathFractionType["SkewedFractionBar"] = 2] = "SkewedFractionBar";
70
+ MathFractionType[MathFractionType["FractionInline"] = 3] = "FractionInline";
71
+ })(MathFractionType || (MathFractionType = {}));
72
+ /** Horizontal alignment of a matrix column. @public */
73
+ export var MathHorizontalAlignment;
74
+ (function (MathHorizontalAlignment) {
75
+ MathHorizontalAlignment[MathHorizontalAlignment["Center"] = 0] = "Center";
76
+ MathHorizontalAlignment[MathHorizontalAlignment["Left"] = 1] = "Left";
77
+ MathHorizontalAlignment[MathHorizontalAlignment["Right"] = 2] = "Right";
78
+ })(MathHorizontalAlignment || (MathHorizontalAlignment = {}));
79
+ /** Vertical alignment of a matrix or equation array. @public */
80
+ export var MathVerticalAlignment;
81
+ (function (MathVerticalAlignment) {
82
+ MathVerticalAlignment[MathVerticalAlignment["Center"] = 0] = "Center";
83
+ MathVerticalAlignment[MathVerticalAlignment["Top"] = 1] = "Top";
84
+ MathVerticalAlignment[MathVerticalAlignment["Bottom"] = 2] = "Bottom";
85
+ })(MathVerticalAlignment || (MathVerticalAlignment = {}));
86
+ /** Spacing rule for matrix and equation array spacing. @public */
87
+ export var SpacingRule;
88
+ (function (SpacingRule) {
89
+ SpacingRule[SpacingRule["Single"] = 0] = "Single";
90
+ SpacingRule[SpacingRule["OneAndHalf"] = 1] = "OneAndHalf";
91
+ SpacingRule[SpacingRule["Double"] = 2] = "Double";
92
+ SpacingRule[SpacingRule["Exactly"] = 3] = "Exactly";
93
+ SpacingRule[SpacingRule["Multiple"] = 4] = "Multiple";
94
+ })(SpacingRule || (SpacingRule = {}));
95
+ /** Script type of a single sub/superscript function. @public */
96
+ export var MathScriptType;
97
+ (function (MathScriptType) {
98
+ MathScriptType[MathScriptType["Superscript"] = 0] = "Superscript";
99
+ MathScriptType[MathScriptType["Subscript"] = 1] = "Subscript";
100
+ })(MathScriptType || (MathScriptType = {}));
101
+ /** Limit type of a limit function. @public */
102
+ export var MathLimitType;
103
+ (function (MathLimitType) {
104
+ MathLimitType[MathLimitType["LowerLimit"] = 0] = "LowerLimit";
105
+ MathLimitType[MathLimitType["UpperLimit"] = 1] = "UpperLimit";
106
+ })(MathLimitType || (MathLimitType = {}));
107
+ /** Em constant used by matrix spacing (half-em snapping). */
108
+ export var MATH_EM = 12;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Math run format (`m:rPr`).
3
+ */
4
+ import { MathFontType, MathStyleType } from './enums';
5
+ import { OwnerHolder } from './owner-holder';
6
+ import { OfficeMathBreak } from './break';
7
+ /**
8
+ * Math-specific run properties, separate from Word character formatting (`w:rPr`).
9
+ *
10
+ * @public
11
+ */
12
+ export declare class OfficeMathFormat extends OwnerHolder {
13
+ private _break;
14
+ /** Aligns the run (`m:aln`). Default false. */
15
+ hasAlignment: boolean;
16
+ /** Literal text (`m:lit`). Default false. */
17
+ hasLiteral: boolean;
18
+ /** Normal text (`m:nor`). Default false. */
19
+ hasNormalText: boolean;
20
+ /** Math font (`m:scr`). Default roman. */
21
+ font: MathFontType;
22
+ /** Math style (`m:sty`). Default italic. */
23
+ style: MathStyleType;
24
+ /** Optional manual break (`m:brk`). Not created automatically. */
25
+ break: OfficeMathBreak | undefined;
26
+ /** Whether any `m:rPr` content must be written. */
27
+ readonly hasContent: boolean;
28
+ }
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Math run format (`m:rPr`).
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 { MathFontType, MathStyleType } from './enums';
18
+ import { K } from './keys';
19
+ import { OwnerHolder } from './owner-holder';
20
+ /**
21
+ * Math-specific run properties, separate from Word character formatting (`w:rPr`).
22
+ *
23
+ * @public
24
+ */
25
+ var OfficeMathFormat = /** @class */ (function (_super) {
26
+ __extends(OfficeMathFormat, _super);
27
+ function OfficeMathFormat() {
28
+ return _super !== null && _super.apply(this, arguments) || this;
29
+ }
30
+ Object.defineProperty(OfficeMathFormat.prototype, "hasAlignment", {
31
+ /** Aligns the run (`m:aln`). Default false. */
32
+ get: function () { return this.getProperty(K.HasAlignment, function () { return false; }); },
33
+ set: function (value) { this.setProperty(K.HasAlignment, value); },
34
+ enumerable: true,
35
+ configurable: true
36
+ });
37
+ Object.defineProperty(OfficeMathFormat.prototype, "hasLiteral", {
38
+ /** Literal text (`m:lit`). Default false. */
39
+ get: function () { return this.getProperty(K.HasLiteral, function () { return false; }); },
40
+ set: function (value) { this.setProperty(K.HasLiteral, value); },
41
+ enumerable: true,
42
+ configurable: true
43
+ });
44
+ Object.defineProperty(OfficeMathFormat.prototype, "hasNormalText", {
45
+ /** Normal text (`m:nor`). Default false. */
46
+ get: function () { return this.getProperty(K.HasNormalText, function () { return false; }); },
47
+ set: function (value) { this.setProperty(K.HasNormalText, value); },
48
+ enumerable: true,
49
+ configurable: true
50
+ });
51
+ Object.defineProperty(OfficeMathFormat.prototype, "font", {
52
+ /** Math font (`m:scr`). Default roman. */
53
+ get: function () { return this.getProperty(K.Script, function () { return MathFontType.Roman; }); },
54
+ set: function (value) { this.setProperty(K.Script, value); },
55
+ enumerable: true,
56
+ configurable: true
57
+ });
58
+ Object.defineProperty(OfficeMathFormat.prototype, "style", {
59
+ /** Math style (`m:sty`). Default italic. */
60
+ get: function () { return this.getProperty(K.Style, function () { return MathStyleType.Italic; }); },
61
+ set: function (value) { this.setProperty(K.Style, value); },
62
+ enumerable: true,
63
+ configurable: true
64
+ });
65
+ Object.defineProperty(OfficeMathFormat.prototype, "break", {
66
+ /** Optional manual break (`m:brk`). Not created automatically. */
67
+ get: function () { return this._break; },
68
+ set: function (value) {
69
+ this._break = value;
70
+ if (value !== undefined) {
71
+ value.setOwner(this);
72
+ }
73
+ this.notifyMutated();
74
+ },
75
+ enumerable: true,
76
+ configurable: true
77
+ });
78
+ Object.defineProperty(OfficeMathFormat.prototype, "hasContent", {
79
+ /** Whether any `m:rPr` content must be written. */
80
+ get: function () {
81
+ var _this = this;
82
+ return this._break !== undefined || [K.HasAlignment, K.HasLiteral, K.HasNormalText, K.Script, K.Style]
83
+ .some(function (key) { return _this.isExplicit(key); });
84
+ },
85
+ enumerable: true,
86
+ configurable: true
87
+ });
88
+ return OfficeMathFormat;
89
+ }(OwnerHolder));
90
+ export { OfficeMathFormat };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Base class of every Math function.
3
+ */
4
+ import { OfficeRunFormat } from './adapter';
5
+ import { MathFunctionType } from './enums';
6
+ import { OwnerHolder } from './owner-holder';
7
+ /**
8
+ * Base of all concrete Math functions.
9
+ *
10
+ * @public
11
+ */
12
+ export declare abstract class OfficeMathFunctionBase extends OwnerHolder {
13
+ private _controlProperties;
14
+ /** The concrete function type. */
15
+ abstract readonly type: MathFunctionType;
16
+ /**
17
+ * Character format of the function (`m:ctrlPr`). Created from the paragraph default on first access.
18
+ */
19
+ controlProperties: OfficeRunFormat;
20
+ /**
21
+ * Whether control properties exist (assigned, parsed or accessed).
22
+ *
23
+ * @private
24
+ */
25
+ readonly hasControlProperties: boolean;
26
+ private getDefaultControlProperties;
27
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Base class of every Math 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 { OwnerHolder } from './owner-holder';
18
+ /**
19
+ * Base of all concrete Math functions.
20
+ *
21
+ * @public
22
+ */
23
+ var OfficeMathFunctionBase = /** @class */ (function (_super) {
24
+ __extends(OfficeMathFunctionBase, _super);
25
+ function OfficeMathFunctionBase() {
26
+ return _super !== null && _super.apply(this, arguments) || this;
27
+ }
28
+ Object.defineProperty(OfficeMathFunctionBase.prototype, "controlProperties", {
29
+ /**
30
+ * Character format of the function (`m:ctrlPr`). Created from the paragraph default on first access.
31
+ */
32
+ get: function () {
33
+ if (this._controlProperties === undefined) {
34
+ this._controlProperties = this.getDefaultControlProperties();
35
+ }
36
+ return this._controlProperties;
37
+ },
38
+ set: function (value) {
39
+ this._controlProperties = value;
40
+ this.notifyMutated();
41
+ },
42
+ enumerable: true,
43
+ configurable: true
44
+ });
45
+ Object.defineProperty(OfficeMathFunctionBase.prototype, "hasControlProperties", {
46
+ /**
47
+ * Whether control properties exist (assigned, parsed or accessed).
48
+ *
49
+ * @private
50
+ */
51
+ get: function () {
52
+ return this._controlProperties !== undefined;
53
+ },
54
+ enumerable: true,
55
+ configurable: true
56
+ });
57
+ OfficeMathFunctionBase.prototype.getDefaultControlProperties = function () {
58
+ var entity = this.ownerMathEntity;
59
+ while (entity !== undefined && !('defaultMathCharacterFormat' in entity)) {
60
+ entity = entity.ownerMathEntity;
61
+ }
62
+ if (entity === undefined) {
63
+ throw new Error('Math function is not attached to a Math paragraph.');
64
+ }
65
+ return entity.defaultMathCharacterFormat.clone();
66
+ };
67
+ return OfficeMathFunctionBase;
68
+ }(OwnerHolder));
69
+ export { OfficeMathFunctionBase };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Collection and factory of Math functions.
3
+ */
4
+ import { OwnedCollection, CollectionOwner } from './collection';
5
+ import { MathFunctionType, MathLimitType, MathScriptType } from './enums';
6
+ import { OfficeMathFunctionBase } from './function-base';
7
+ /**
8
+ * Creates an unattached function of the given type.
9
+ *
10
+ * @param type
11
+ * @private
12
+ */
13
+ export declare function createMathFunction(type: MathFunctionType): OfficeMathFunctionBase;
14
+ /**
15
+ * Ordered collection of Math functions with a type-based factory.
16
+ *
17
+ * @public
18
+ */
19
+ export declare class OfficeMathFunctionCollection extends OwnedCollection<OfficeMathFunctionBase> {
20
+ constructor(owner: CollectionOwner);
21
+ /**
22
+ * Creates a function of the given type and appends it, or inserts it at `index`.
23
+ *
24
+ * @param type
25
+ * @param index
26
+ */
27
+ add(type: MathFunctionType, index?: number): OfficeMathFunctionBase;
28
+ }
29
+ export { MathLimitType, MathScriptType };