@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.
- package/dist/ej2-office-common.umd.min.js +2 -2
- package/dist/ej2-office-common.umd.min.js.map +1 -1
- package/dist/es6/ej2-office-common.es2015.js +5421 -6017
- package/dist/es6/ej2-office-common.es2015.js.map +1 -1
- package/dist/es6/ej2-office-common.es5.js +6270 -7203
- package/dist/es6/ej2-office-common.es5.js.map +1 -1
- package/dist/global/ej2-office-common.min.js +2 -2
- package/dist/global/ej2-office-common.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/office-common.js +4 -0
- package/package.json +11 -7
- package/src/index.d.ts +3 -17
- package/src/index.js +3 -18
- package/src/office-common/features/index.d.ts +6 -0
- package/src/office-common/features/index.js +6 -0
- package/src/office-common/features/mathml/index.d.ts +25 -0
- package/src/office-common/features/mathml/index.js +22 -0
- package/src/office-common/features/mathml/latex/latex-generator.d.ts +8 -0
- package/src/office-common/features/mathml/latex/latex-generator.js +357 -0
- package/src/office-common/features/mathml/latex/latex-parser.d.ts +87 -0
- package/src/office-common/features/mathml/latex/latex-parser.js +1206 -0
- package/src/office-common/features/mathml/latex/latex-symbols.d.ts +13 -0
- package/src/office-common/features/mathml/latex/latex-symbols.js +681 -0
- package/src/office-common/features/mathml/math-settings.d.ts +54 -0
- package/src/office-common/features/mathml/math-settings.js +174 -0
- package/src/office-common/features/mathml/office-math/adapter.d.ts +59 -0
- package/src/office-common/features/mathml/office-math/adapter.js +6 -0
- package/src/office-common/features/mathml/office-math/basic.d.ts +91 -0
- package/src/office-common/features/mathml/office-math/basic.js +93 -0
- package/src/office-common/features/mathml/office-math/break.d.ts +30 -0
- package/src/office-common/features/mathml/office-math/break.js +75 -0
- package/src/office-common/features/mathml/office-math/collection.d.ts +104 -0
- package/src/office-common/features/mathml/office-math/collection.js +170 -0
- package/src/office-common/features/mathml/office-math/entity.d.ts +12 -0
- package/src/office-common/features/mathml/office-math/entity.js +3 -0
- package/src/office-common/features/mathml/office-math/enums.d.ts +97 -0
- package/src/office-common/features/mathml/office-math/enums.js +108 -0
- package/src/office-common/features/mathml/office-math/format.d.ts +28 -0
- package/src/office-common/features/mathml/office-math/format.js +90 -0
- package/src/office-common/features/mathml/office-math/function-base.d.ts +27 -0
- package/src/office-common/features/mathml/office-math/function-base.js +69 -0
- package/src/office-common/features/mathml/office-math/function-collection.d.ts +29 -0
- package/src/office-common/features/mathml/office-math/function-collection.js +76 -0
- package/src/office-common/features/mathml/office-math/functions-basic.d.ts +118 -0
- package/src/office-common/features/mathml/office-math/functions-basic.js +331 -0
- package/src/office-common/features/mathml/office-math/functions-multi.d.ts +156 -0
- package/src/office-common/features/mathml/office-math/functions-multi.js +407 -0
- package/src/office-common/features/mathml/office-math/index.d.ts +27 -0
- package/src/office-common/features/mathml/office-math/index.js +25 -0
- package/src/office-common/features/mathml/office-math/keys.d.ts +6 -0
- package/src/office-common/features/mathml/office-math/keys.js +20 -0
- package/src/office-common/features/mathml/office-math/math-clone.d.ts +20 -0
- package/src/office-common/features/mathml/office-math/math-clone.js +203 -0
- package/src/office-common/features/mathml/office-math/math-collection.d.ts +19 -0
- package/src/office-common/features/mathml/office-math/math-collection.js +41 -0
- package/src/office-common/features/mathml/office-math/math-equality.d.ts +21 -0
- package/src/office-common/features/mathml/office-math/math-equality.js +115 -0
- package/src/office-common/features/mathml/office-math/math-paragraph.d.ts +58 -0
- package/src/office-common/features/mathml/office-math/math-paragraph.js +126 -0
- package/src/office-common/features/mathml/office-math/math-traversal.d.ts +23 -0
- package/src/office-common/features/mathml/office-math/math-traversal.js +95 -0
- package/src/office-common/features/mathml/office-math/matrix-collections.d.ts +54 -0
- package/src/office-common/features/mathml/office-math/matrix-collections.js +113 -0
- package/src/office-common/features/mathml/office-math/matrix-column.d.ts +43 -0
- package/src/office-common/features/mathml/office-math/matrix-column.js +96 -0
- package/src/office-common/features/mathml/office-math/matrix-row.d.ts +38 -0
- package/src/office-common/features/mathml/office-math/matrix-row.js +71 -0
- package/src/office-common/features/mathml/office-math/matrix.d.ts +62 -0
- package/src/office-common/features/mathml/office-math/matrix.js +158 -0
- package/src/office-common/features/mathml/office-math/office-math.d.ts +55 -0
- package/src/office-common/features/mathml/office-math/office-math.js +116 -0
- package/src/office-common/features/mathml/office-math/owner-holder.d.ts +42 -0
- package/src/office-common/features/mathml/office-math/owner-holder.js +87 -0
- package/src/office-common/features/mathml/office-math/property-store.d.ts +66 -0
- package/src/office-common/features/mathml/office-math/property-store.js +99 -0
- package/src/office-common/features/mathml/office-math/run-element.d.ts +31 -0
- package/src/office-common/features/mathml/office-math/run-element.js +97 -0
- package/src/office-common/features/mathml/office-math/unknown-element.d.ts +37 -0
- package/src/office-common/features/mathml/office-math/unknown-element.js +62 -0
- package/src/office-common/features/mathml/office-math/xml-equal.d.ts +13 -0
- package/src/office-common/features/mathml/office-math/xml-equal.js +24 -0
- package/src/office-common/features/mathml/parse/office-math-parser.d.ts +24 -0
- package/src/office-common/features/mathml/parse/office-math-parser.js +396 -0
- package/src/office-common/features/mathml/parse/office-math-properties.d.ts +165 -0
- package/src/office-common/features/mathml/parse/office-math-properties.js +432 -0
- package/src/office-common/features/mathml/parse/parse-options.d.ts +22 -0
- package/src/office-common/features/mathml/parse/parse-options.js +3 -0
- package/src/office-common/features/mathml/serialize/office-math-properties-writer.d.ts +38 -0
- package/src/office-common/features/mathml/serialize/office-math-properties-writer.js +267 -0
- package/src/office-common/features/mathml/serialize/office-math-serializer.d.ts +23 -0
- package/src/office-common/features/mathml/serialize/office-math-serializer.js +306 -0
- package/src/office-common/features/mathml/serialize/omml-writer.d.ts +123 -0
- package/src/office-common/features/mathml/serialize/omml-writer.js +135 -0
- package/src/office-common/index.d.ts +10 -0
- package/src/office-common/index.js +10 -0
- package/.eslintrc.json +0 -263
- package/.prettierrc.json +0 -5
- package/api-extractor.json +0 -35
- package/core.js +0 -4
- package/encryption.js +0 -4
- package/features.js +0 -4
- package/global.json +0 -6
- package/nuget.config +0 -7
- package/src/all.d.ts +0 -41
- package/src/all.js +0 -38
- package/src/features/index.d.ts +0 -11
- package/src/features/index.js +0 -11
- package/src/features/mathml/index.d.ts +0 -30
- package/src/features/mathml/index.js +0 -22
- package/src/features/mathml/math-factory.d.ts +0 -26
- package/src/features/mathml/math-factory.js +0 -568
- package/src/features/mathml/model/controls.d.ts +0 -896
- package/src/features/mathml/model/controls.js +0 -1541
- package/src/features/mathml/model/math-element.d.ts +0 -173
- package/src/features/mathml/model/math-element.js +0 -315
- package/src/features/mathml/model/roots.d.ts +0 -82
- package/src/features/mathml/model/roots.js +0 -177
- package/src/features/mathml/parse/math-parser.d.ts +0 -43
- package/src/features/mathml/parse/math-parser.js +0 -636
- package/src/features/mathml/serialize/math-serializer.d.ts +0 -34
- package/src/features/mathml/serialize/math-serializer.js +0 -749
- package/tsconfig.build.json +0 -13
- package/tsconfig.harness.json +0 -32
- package/tslint.json +0 -111
- /package/src/{core → office-common/core}/index.d.ts +0 -0
- /package/src/{core → office-common/core}/index.js +0 -0
- /package/src/{core → office-common/core}/xml/index.d.ts +0 -0
- /package/src/{core → office-common/core}/xml/index.js +0 -0
- /package/src/{core → office-common/core}/xml/model.d.ts +0 -0
- /package/src/{core → office-common/core}/xml/model.js +0 -0
- /package/src/{encryption → office-common/encryption}/agile-constants.d.ts +0 -0
- /package/src/{encryption → office-common/encryption}/agile-constants.js +0 -0
- /package/src/{encryption → office-common/encryption}/agile-encryption-info.d.ts +0 -0
- /package/src/{encryption → office-common/encryption}/agile-encryption-info.js +0 -0
- /package/src/{encryption → office-common/encryption}/agile-password.d.ts +0 -0
- /package/src/{encryption → office-common/encryption}/agile-password.js +0 -0
- /package/src/{encryption → office-common/encryption}/cfb-reader.d.ts +0 -0
- /package/src/{encryption → office-common/encryption}/cfb-reader.js +0 -0
- /package/src/{encryption → office-common/encryption}/crypto-primitives.d.ts +0 -0
- /package/src/{encryption → office-common/encryption}/crypto-primitives.js +0 -0
- /package/src/{encryption → office-common/encryption}/decrypt-encrypted-package.d.ts +0 -0
- /package/src/{encryption → office-common/encryption}/decrypt-encrypted-package.js +0 -0
- /package/src/{encryption → office-common/encryption}/encryption-info-xml.d.ts +0 -0
- /package/src/{encryption → office-common/encryption}/encryption-info-xml.js +0 -0
- /package/src/{encryption → office-common/encryption}/errors.d.ts +0 -0
- /package/src/{encryption → office-common/encryption}/errors.js +0 -0
- /package/src/{encryption → office-common/encryption}/index.d.ts +0 -0
- /package/src/{encryption → office-common/encryption}/index.js +0 -0
- /package/src/{features → office-common/features}/diagrams/constants.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/constants.js +0 -0
- /package/src/{features → office-common/features}/diagrams/diagram-data-model.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/diagram-data-model.js +0 -0
- /package/src/{features → office-common/features}/diagrams/diagram-parsers.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/diagram-parsers.js +0 -0
- /package/src/{features → office-common/features}/diagrams/diagram-serializers.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/diagram-serializers.js +0 -0
- /package/src/{features → office-common/features}/diagrams/diagram-views.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/diagram-views.js +0 -0
- /package/src/{features → office-common/features}/diagrams/element-tree.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/element-tree.js +0 -0
- /package/src/{features → office-common/features}/diagrams/errors.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/errors.js +0 -0
- /package/src/{features → office-common/features}/diagrams/index.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/index.js +0 -0
- /package/src/{features → office-common/features}/diagrams/smart-art-catalog.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/smart-art-catalog.js +0 -0
- /package/src/{features → office-common/features}/diagrams/smart-art-diagram.d.ts +0 -0
- /package/src/{features → office-common/features}/diagrams/smart-art-diagram.js +0 -0
- /package/src/{features → office-common/features}/ink/constants.d.ts +0 -0
- /package/src/{features → office-common/features}/ink/constants.js +0 -0
- /package/src/{features → office-common/features}/ink/index.d.ts +0 -0
- /package/src/{features → office-common/features}/ink/index.js +0 -0
- /package/src/{features → office-common/features}/ink/ink-effects.d.ts +0 -0
- /package/src/{features → office-common/features}/ink/ink-effects.js +0 -0
- /package/src/{features → office-common/features}/ink/ink-model.d.ts +0 -0
- /package/src/{features → office-common/features}/ink/ink-model.js +0 -0
- /package/src/{features → office-common/features}/ink/ink-parser.d.ts +0 -0
- /package/src/{features → office-common/features}/ink/ink-parser.js +0 -0
- /package/src/{features → office-common/features}/ink/ink-serializer.d.ts +0 -0
- /package/src/{features → office-common/features}/ink/ink-serializer.js +0 -0
- /package/src/{features → office-common/features}/ink/ink-units.d.ts +0 -0
- /package/src/{features → office-common/features}/ink/ink-units.js +0 -0
- /package/src/{features → office-common/features}/ink/ink-xml.d.ts +0 -0
- /package/src/{features → office-common/features}/ink/ink-xml.js +0 -0
- /package/src/{features → office-common/features}/ink/trace-codec.d.ts +0 -0
- /package/src/{features → office-common/features}/ink/trace-codec.js +0 -0
- /package/src/{features → office-common/features}/mathml/constants.d.ts +0 -0
- /package/src/{features → office-common/features}/mathml/constants.js +0 -0
- /package/src/{features → office-common/features}/mathml/errors.d.ts +0 -0
- /package/src/{features → office-common/features}/mathml/errors.js +0 -0
- /package/src/{features → office-common/features}/mathml/model/enums.d.ts +0 -0
- /package/src/{features → office-common/features}/mathml/model/enums.js +0 -0
- /package/src/{features → office-common/features}/mathml/openxml.d.ts +0 -0
- /package/src/{features → office-common/features}/mathml/openxml.js +0 -0
- /package/src/{features → office-common/features}/smart-art/diagram-xml.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/diagram-xml.js +0 -0
- /package/src/{features → office-common/features}/smart-art/errors.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/errors.js +0 -0
- /package/src/{features → office-common/features}/smart-art/index.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/index.js +0 -0
- /package/src/{features → office-common/features}/smart-art/minimal-samples.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/minimal-samples.js +0 -0
- /package/src/{features → office-common/features}/smart-art/mutators.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/mutators.js +0 -0
- /package/src/{features → office-common/features}/smart-art/namespaces.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/namespaces.js +0 -0
- /package/src/{features → office-common/features}/smart-art/package-graph.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/package-graph.js +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-colors.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-colors.js +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-data.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-data.js +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-layout.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-layout.js +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-rel-ids.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-rel-ids.js +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-style.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/parse-style.js +0 -0
- /package/src/{features → office-common/features}/smart-art/point-text.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/point-text.js +0 -0
- /package/src/{features → office-common/features}/smart-art/register.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/register.js +0 -0
- /package/src/{features → office-common/features}/smart-art/serialize.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/serialize.js +0 -0
- /package/src/{features → office-common/features}/smart-art/types.d.ts +0 -0
- /package/src/{features → office-common/features}/smart-art/types.js +0 -0
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MathElement base hierarchy for OMML typed DOM.
|
|
3
|
-
*
|
|
4
|
-
* Source: mathml-spec §7; ECMA-376-4 Annex A.8.1.
|
|
5
|
-
*/
|
|
6
|
-
import { OpenXmlElement } from '../openxml';
|
|
7
|
-
/**
|
|
8
|
-
* Discriminator for every typed math node (OMML local name or synthetic type).
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare type MathElementType = 'oMathPara' | 'oMath' | 'arg' | 't' | 'r' | 'acc' | 'bar' | 'box' | 'borderBox' | 'd' | 'eqArr' | 'f' | 'func' | 'groupChr' | 'limLow' | 'limUpp' | 'm' | 'mr' | 'nary' | 'phant' | 'rad' | 'sPre' | 'sSub' | 'sSubSup' | 'sSup' | 'unknown';
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export declare type MathElementKind = MathElementType;
|
|
18
|
-
/**
|
|
19
|
-
* Abstract base for every OMML model node.
|
|
20
|
-
*
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export declare abstract class MathElement {
|
|
24
|
-
/**
|
|
25
|
-
* Math element type matching the OMML local name (or a synthetic type such as `unknown`).
|
|
26
|
-
*/
|
|
27
|
-
abstract readonly type: MathElementType;
|
|
28
|
-
/** When true, mutation is blocked (preserve-only degradation). */
|
|
29
|
-
private _preserveOnly;
|
|
30
|
-
/** Original element retained for preserve-only / unknown nodes. */
|
|
31
|
-
private _preservedXml;
|
|
32
|
-
/** Optional dirty listener injected by docx host (document-agnostic). */
|
|
33
|
-
private _onMutate;
|
|
34
|
-
/**
|
|
35
|
-
* Whether this node is locked in preserve-only mode (mutations blocked; original OpenXML is re-emitted).
|
|
36
|
-
*
|
|
37
|
-
* @private
|
|
38
|
-
* Framework/parser state used for round-trip fidelity and host dirty tracking.
|
|
39
|
-
*/
|
|
40
|
-
readonly preserveOnly: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Captured original OpenXML tree when the node is preserve-only or cannot be fully represented.
|
|
43
|
-
*
|
|
44
|
-
* @private
|
|
45
|
-
* Used by the serializer and hosts to round-trip unmodified structure.
|
|
46
|
-
*/
|
|
47
|
-
readonly preservedXml: OpenXmlElement | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Registers an internal mutation callback for change tracking and document synchronization.
|
|
50
|
-
*
|
|
51
|
-
* @private
|
|
52
|
-
* Hosts (for example docx `MathInline`) inject dirty tracking; not part of the authoring API.
|
|
53
|
-
*/
|
|
54
|
-
setMutationListener(listener: (() => void) | undefined): void;
|
|
55
|
-
/**
|
|
56
|
-
* Marks this node preserve-only and stores the original OpenXML for round-trip preservation.
|
|
57
|
-
*
|
|
58
|
-
* @private
|
|
59
|
-
* Used by the OMML parser for structural degradation and by document hosts to bubble a
|
|
60
|
-
* child-level preserve-only lock up to the equation root.
|
|
61
|
-
*/
|
|
62
|
-
markPreserveOnly(xml: OpenXmlElement): void;
|
|
63
|
-
/**
|
|
64
|
-
* Attach preserved XML without locking mutation (UnknownMathElement).
|
|
65
|
-
*
|
|
66
|
-
* @private
|
|
67
|
-
*/
|
|
68
|
-
attachPreservedXml(xml: OpenXmlElement): void;
|
|
69
|
-
/** Guard + notify after a successful mutation. */
|
|
70
|
-
protected notifyMutated(): void;
|
|
71
|
-
/** Throw if preserve-only before a mutation begins. */
|
|
72
|
-
protected assertMutable(): void;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Math text leaf (`m:t`) — literal character content inside a math run.
|
|
76
|
-
*
|
|
77
|
-
* Source: ECMA-376-1 §22.1.2.116 `CT_Text` — UTF-8 passthrough, no substitution.
|
|
78
|
-
*
|
|
79
|
-
* @public
|
|
80
|
-
*/
|
|
81
|
-
export declare class MathText extends MathElement {
|
|
82
|
-
/**
|
|
83
|
-
* Math element type for this text leaf (`t`).
|
|
84
|
-
*/
|
|
85
|
-
readonly type = "t";
|
|
86
|
-
private _value;
|
|
87
|
-
private _xmlSpace;
|
|
88
|
-
constructor(value?: string, xmlSpace?: 'default' | 'preserve');
|
|
89
|
-
/**
|
|
90
|
-
* Raw text content of this math text element (full UTF-8, no substitution).
|
|
91
|
-
*/
|
|
92
|
-
value: string;
|
|
93
|
-
/**
|
|
94
|
-
* Optional `xml:space` on `m:t` (`default` | `preserve`), same policy as Word `w:t`.
|
|
95
|
-
*
|
|
96
|
-
* @private
|
|
97
|
-
* Serialization attribute for whitespace fidelity; prefer setting text via {@link value}.
|
|
98
|
-
*/
|
|
99
|
-
xmlSpace: 'default' | 'preserve' | undefined;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Argument-size property bag (`m:argPr` → `m:argSz`).
|
|
103
|
-
*
|
|
104
|
-
* Source: ECMA-376-4 Annex A.8.1 `CT_OMathArgPr` / `ST_Integer2` (−2..2).
|
|
105
|
-
*
|
|
106
|
-
* @public
|
|
107
|
-
*/
|
|
108
|
-
export interface MathArgProperties {
|
|
109
|
-
readonly argSz?: number;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Argument container that holds ordered math elements inside a larger structure.
|
|
113
|
-
*
|
|
114
|
-
* @public
|
|
115
|
-
*/
|
|
116
|
-
export declare class MathArgument extends MathElement {
|
|
117
|
-
/**
|
|
118
|
-
* Discriminator for this math argument container.
|
|
119
|
-
*
|
|
120
|
-
* @public
|
|
121
|
-
*/
|
|
122
|
-
readonly type = "arg";
|
|
123
|
-
private _properties;
|
|
124
|
-
private _item;
|
|
125
|
-
private _ctrlPr;
|
|
126
|
-
constructor(properties?: MathArgProperties, item?: ReadonlyArray<MathElement>, ctrlPr?: OpenXmlElement);
|
|
127
|
-
/**
|
|
128
|
-
* Gets or sets argument properties such as script size.
|
|
129
|
-
*
|
|
130
|
-
* @throws MathmlValidationError when script size is outside the allowed integer range.
|
|
131
|
-
*
|
|
132
|
-
* @public
|
|
133
|
-
*/
|
|
134
|
-
properties: Readonly<MathArgProperties>;
|
|
135
|
-
/**
|
|
136
|
-
* Gets or sets the ordered math elements inside this argument.
|
|
137
|
-
*
|
|
138
|
-
* @public
|
|
139
|
-
*/
|
|
140
|
-
item: ReadonlyArray<MathElement>;
|
|
141
|
-
/**
|
|
142
|
-
* Opaque control properties (`m:ctrlPr`) carried on the argument, when present.
|
|
143
|
-
*
|
|
144
|
-
* @private
|
|
145
|
-
* Wire-fidelity carrier for WML run properties; not part of the public authoring API.
|
|
146
|
-
*/
|
|
147
|
-
/**
|
|
148
|
-
* @private
|
|
149
|
-
*/
|
|
150
|
-
ctrlPr: OpenXmlElement | undefined;
|
|
151
|
-
/**
|
|
152
|
-
* Appends one math element at the end of {@link MathArgument.item}.
|
|
153
|
-
*/
|
|
154
|
-
appendItem(child: MathElement): MathElement;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Escape hatch for unrecognized `m:*` elements.
|
|
158
|
-
*
|
|
159
|
-
* Source: mathml-spec §8.5 — re-serializes verbatim.
|
|
160
|
-
*
|
|
161
|
-
* @public
|
|
162
|
-
*/
|
|
163
|
-
export declare class UnknownMathElement extends MathElement {
|
|
164
|
-
readonly type = "unknown";
|
|
165
|
-
readonly localName: string;
|
|
166
|
-
constructor(localName: string, xml: OpenXmlElement);
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Convenience: build MathArgument from a list of elements.
|
|
170
|
-
*
|
|
171
|
-
* @private
|
|
172
|
-
*/
|
|
173
|
-
export declare function mathArg(...elements: MathElement[]): MathArgument;
|
|
@@ -1,315 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
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
|
-
}
|