ooxml-core 0.4.0 → 0.5.0

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 (50) hide show
  1. package/NOTICE +2 -0
  2. package/dist/docx/embedded.cjs +23 -6
  3. package/dist/docx/embedded.mjs +23 -6
  4. package/dist/docx/index.cjs +23 -6
  5. package/dist/docx/index.mjs +23 -6
  6. package/dist/docx/load/index.cjs +23 -6
  7. package/dist/docx/load/index.mjs +23 -6
  8. package/dist/docx/parse-table.d.ts.map +1 -1
  9. package/dist/docx/write-table-properties.d.ts +3 -1
  10. package/dist/docx/write-table-properties.d.ts.map +1 -1
  11. package/dist/docx/write-table.d.ts.map +1 -1
  12. package/dist/index.cjs +2042 -13
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.mjs +2042 -14
  16. package/dist/math/index.cjs +2050 -0
  17. package/dist/math/index.d.ts +15 -0
  18. package/dist/math/index.d.ts.map +1 -0
  19. package/dist/math/index.mjs +1985 -0
  20. package/dist/math/latex-omml-siblings.d.ts +21 -0
  21. package/dist/math/latex-omml-siblings.d.ts.map +1 -0
  22. package/dist/math/latex-omml-symbols.d.ts +42 -0
  23. package/dist/math/latex-omml-symbols.d.ts.map +1 -0
  24. package/dist/math/latex-to-omml-commands.d.ts +9 -0
  25. package/dist/math/latex-to-omml-commands.d.ts.map +1 -0
  26. package/dist/math/latex-to-omml-constructs.d.ts +39 -0
  27. package/dist/math/latex-to-omml-constructs.d.ts.map +1 -0
  28. package/dist/math/latex-to-omml-environments.d.ts +28 -0
  29. package/dist/math/latex-to-omml-environments.d.ts.map +1 -0
  30. package/dist/math/latex-to-omml.d.ts +9 -0
  31. package/dist/math/latex-to-omml.d.ts.map +1 -0
  32. package/dist/math/omml-color.d.ts +11 -0
  33. package/dist/math/omml-color.d.ts.map +1 -0
  34. package/dist/math/omml-dom.d.ts +7 -0
  35. package/dist/math/omml-dom.d.ts.map +1 -0
  36. package/dist/math/omml-mathml-converters.d.ts +39 -0
  37. package/dist/math/omml-mathml-converters.d.ts.map +1 -0
  38. package/dist/math/omml-mathml-helpers.d.ts +23 -0
  39. package/dist/math/omml-mathml-helpers.d.ts.map +1 -0
  40. package/dist/math/omml-node.d.ts +7 -0
  41. package/dist/math/omml-node.d.ts.map +1 -0
  42. package/dist/math/omml-to-latex-helpers.d.ts +41 -0
  43. package/dist/math/omml-to-latex-helpers.d.ts.map +1 -0
  44. package/dist/math/omml-to-latex-layout.d.ts +18 -0
  45. package/dist/math/omml-to-latex-layout.d.ts.map +1 -0
  46. package/dist/math/omml-to-latex.d.ts +6 -0
  47. package/dist/math/omml-to-latex.d.ts.map +1 -0
  48. package/dist/math/omml-to-mathml.d.ts +21 -0
  49. package/dist/math/omml-to-mathml.d.ts.map +1 -0
  50. package/package.json +6 -1
@@ -0,0 +1,21 @@
1
+ import type { OmmlNode } from './omml-to-mathml.js';
2
+ export interface Token {
3
+ type: 'command' | 'text' | 'group_start' | 'group_end' | 'superscript' | 'subscript' | 'whitespace';
4
+ value: string;
5
+ }
6
+ export declare function tokenize(latex: string): Token[];
7
+ /**
8
+ * Merge parsed sibling nodes into a single OMML container object.
9
+ *
10
+ * When tags interleave (`m:sSup`, `m:r`, `m:sSup`, ... for a^2+b^2=c^2), the
11
+ * collapsed tag-keyed shape cannot represent the sibling order under plain
12
+ * keys, so repeated tags get position-marked keys (`m:r#pptx-order-1`, via
13
+ * core's `orderedXmlKey`): object insertion order then carries the true
14
+ * sequence. This is the same convention core's load pipeline applies to real
15
+ * decks (`omml-sibling-order.ts`), and core's save-side XMLBuilder strips the
16
+ * markers from emitted tag names, so the serialized OOXML is the natural
17
+ * interleaved sequence PowerPoint itself writes. Grouped-by-tag sequences
18
+ * keep the compact merged shape.
19
+ */
20
+ export declare function mergeSiblings(nodes: OmmlNode[]): OmmlNode;
21
+ //# sourceMappingURL=latex-omml-siblings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latex-omml-siblings.d.ts","sourceRoot":"","sources":["../../src/math/latex-omml-siblings.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIpD,MAAM,WAAW,KAAK;IACrB,IAAI,EACD,SAAS,GACT,MAAM,GACN,aAAa,GACb,WAAW,GACX,aAAa,GACb,WAAW,GACX,YAAY,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd;AAKD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,CA0C/C;AA0BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAoCzD"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * latex-omml-symbols: the symbol tables shared by both directions of the
3
+ * LaTeX <-> OMML converters (`latex-to-omml.ts`, `omml-to-latex.ts`).
4
+ *
5
+ * Forward maps go from a LaTeX command to the Unicode character OMML stores in
6
+ * `m:t` / `m:chr`; the `REVERSE_*` maps invert them (first command wins for
7
+ * characters reachable from several aliases, e.g. `\le` and `\leq`).
8
+ */
9
+ export declare const GREEK_MAP: Record<string, string>;
10
+ export declare const OPERATOR_MAP: Record<string, string>;
11
+ /**
12
+ * LaTeX escapes for characters that are syntax in the LaTeX grammar but plain
13
+ * text in an OMML run. `omml-to-latex` emits these so a run holding `{` or
14
+ * `_` survives the trip through the tokenizer.
15
+ */
16
+ export declare const ESCAPE_MAP: Record<string, string>;
17
+ export declare const NARY_MAP: Record<string, string>;
18
+ export declare const FUNC_NAMES: Set<string>;
19
+ /**
20
+ * Function names whose `_{...}` argument typesets beneath the name (LaTeX
21
+ * "limits" operators). `\lim_{x \to 0}` becomes `m:limLow`, not `m:sSub`,
22
+ * which is the structure PowerPoint itself writes for a limit.
23
+ */
24
+ export declare const LIMIT_FUNC_NAMES: Set<string>;
25
+ /** LaTeX accent command -> combining character stored in `m:accPr/m:chr`. */
26
+ export declare const ACCENT_MAP: Record<string, string>;
27
+ /** Accent characters that are aliases of a mapped one (macron == overline). */
28
+ export declare const ACCENT_ALIASES: Record<string, string>;
29
+ /** LaTeX delimiter command -> the character stored in `m:begChr` / `m:endChr`. */
30
+ export declare const DELIM_MAP: Record<string, string>;
31
+ /** Matrix environments -> the delimiter pair (empty for none). */
32
+ export declare const MATRIX_ENVS: Record<string, [string, string]>;
33
+ /** Equation-array environments (aligned rows, `m:eqArr`). */
34
+ export declare const EQARR_ENVS: Set<string>;
35
+ export declare const REVERSE_GREEK: Record<string, string>;
36
+ export declare const REVERSE_OPERATOR: Record<string, string>;
37
+ export declare const REVERSE_NARY: Record<string, string>;
38
+ export declare const REVERSE_ACCENT: Record<string, string>;
39
+ export declare const REVERSE_DELIM: Record<string, string>;
40
+ /** Characters a run must escape so the LaTeX tokenizer treats them as text. */
41
+ export declare const REVERSE_ESCAPE: Record<string, string>;
42
+ //# sourceMappingURL=latex-omml-symbols.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latex-omml-symbols.d.ts","sourceRoot":"","sources":["../../src/math/latex-omml-symbols.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqC5C,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2C/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoB7C,CAAC;AAIF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAY3C,CAAC;AAIF,eAAO,MAAM,UAAU,aA6BrB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,aAA6D,CAAC;AAI3F,6EAA6E;AAC7E,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAc7C,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKjD,CAAC;AAIF,kFAAkF;AAClF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkB5C,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAQxD,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,UAAU,aAUrB,CAAC;AAcH,eAAO,MAAM,aAAa,wBAAoB,CAAC;AAC/C,eAAO,MAAM,gBAAgB,wBAAuB,CAAC;AACrD,eAAO,MAAM,YAAY,wBAAmB,CAAC;AAC7C,eAAO,MAAM,cAAc,wBAAqB,CAAC;AACjD,eAAO,MAAM,aAAa,wBAAoB,CAAC;AAE/C,+EAA+E;AAC/E,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAUjD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { LatexParserContext } from './latex-to-omml-constructs.js';
2
+ import type { OmmlNode } from './omml-to-mathml.js';
3
+ /**
4
+ * Build the construct for an already-consumed `\command` token. Returns null
5
+ * for commands that produce no node of their own (`\right`, `\\`, `\limits`,
6
+ * spacing that collapses to nothing, ...).
7
+ */
8
+ export declare function parseCommand(ctx: LatexParserContext, cmd: string): OmmlNode | null;
9
+ //# sourceMappingURL=latex-to-omml-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latex-to-omml-commands.d.ts","sourceRoot":"","sources":["../../src/math/latex-to-omml-commands.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAkBxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAgDpD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAyElF"}
@@ -0,0 +1,39 @@
1
+ import type { Token } from './latex-omml-siblings.js';
2
+ import type { OmmlNode } from './omml-to-mathml.js';
3
+ export interface LatexParserContext {
4
+ peek: () => Token | undefined;
5
+ next: () => Token | undefined;
6
+ parseGroup: () => OmmlNode[];
7
+ parseSingleOrGroup: () => OmmlNode[];
8
+ parseAtom: () => OmmlNode | null;
9
+ wrapE: (nodes: OmmlNode[]) => OmmlNode;
10
+ makeRun: (text: string, normal?: boolean) => OmmlNode;
11
+ }
12
+ export interface ScriptArgs {
13
+ sub: OmmlNode[];
14
+ sup: OmmlNode[];
15
+ hasSub: boolean;
16
+ hasSup: boolean;
17
+ }
18
+ /** Consume up to one `_{...}` and one `^{...}` in either order (whitespace between is ignored). */
19
+ export declare function parseScriptArgs(ctx: LatexParserContext): ScriptArgs;
20
+ /** Wrap `base` in sSub / sSup / sSubSup according to the parsed script args. */
21
+ export declare function applyScripts(ctx: LatexParserContext, base: OmmlNode, args: ScriptArgs): OmmlNode;
22
+ /** Try to parse trailing ^ and _ to wrap the base in superscript/subscript. */
23
+ export declare function tryParseScripts(ctx: LatexParserContext, base: OmmlNode): OmmlNode;
24
+ /** Parse an n-ary operator with optional `\limits`, sub/superscripts and body. */
25
+ export declare function parseNary(ctx: LatexParserContext, operatorChar: string): OmmlNode;
26
+ /** Parse a \left...\right delimiter pair. */
27
+ export declare function parseDelimiter(ctx: LatexParserContext): OmmlNode;
28
+ /**
29
+ * Parse a function application like `\sin{x}`, `\sin^{2}{x}` or
30
+ * `\lim_{x \to 0}{f}`. Limit-style names put a lone subscript beneath the
31
+ * name (`m:limLow`), matching PowerPoint's own structure for a limit.
32
+ */
33
+ export declare function parseFuncApplication(ctx: LatexParserContext, name: string): OmmlNode;
34
+ /**
35
+ * Read the raw text of a `\text{...}` argument, keeping spaces and mapping
36
+ * escapes (`\{`, `\%`) and symbol commands back to their characters.
37
+ */
38
+ export declare function parseTextArgument(ctx: LatexParserContext): string;
39
+ //# sourceMappingURL=latex-to-omml-constructs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latex-to-omml-constructs.d.ts","sourceRoot":"","sources":["../../src/math/latex-to-omml-constructs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAOtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,KAAK,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,MAAM,KAAK,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE,MAAM,QAAQ,EAAE,CAAC;IAC7B,kBAAkB,EAAE,MAAM,QAAQ,EAAE,CAAC;IACrC,SAAS,EAAE,MAAM,QAAQ,GAAG,IAAI,CAAC;IACjC,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,QAAQ,CAAC;IACvC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,QAAQ,CAAC;CACtD;AAED,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,QAAQ,EAAE,CAAC;IAChB,GAAG,EAAE,QAAQ,EAAE,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CAChB;AAED,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,GAAG,EAAE,kBAAkB,GAAG,UAAU,CAkBnE;AAED,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,QAAQ,CA2BhG;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAEjF;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,GAAG,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,GAAG,QAAQ,CAmCjF;AAgBD,6CAA6C;AAC7C,wBAAgB,cAAc,CAAC,GAAG,EAAE,kBAAkB,GAAG,QAAQ,CA+BhE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAkCpF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CA0BjE"}
@@ -0,0 +1,28 @@
1
+ import type { LatexParserContext } from './latex-to-omml-constructs.js';
2
+ import type { OmmlNode } from './omml-to-mathml.js';
3
+ /** Wrap `inner` in an `m:d` with the given (possibly empty) delimiters. */
4
+ export declare function wrapDelimited(ctx: LatexParserContext, inner: OmmlNode, open: string, close: string): OmmlNode;
5
+ /** Parse `\begin{env} ... \end{env}` into a matrix, delimited matrix, eqArr or cases. */
6
+ export declare function parseEnvironment(ctx: LatexParserContext): OmmlNode | null;
7
+ /** `\hat{x}` and friends: `m:acc` with the combining character in `m:chr`. */
8
+ export declare function parseAccent(ctx: LatexParserContext, chr: string): OmmlNode;
9
+ /** `\overline{x}` / `\underline{x}`: `m:bar` with an explicit position. */
10
+ export declare function parseBar(ctx: LatexParserContext, pos: 'top' | 'bot'): OmmlNode;
11
+ /**
12
+ * `\underbrace{x}_{n}` / `\overbrace{x}^{n}`: `m:groupChr`, wrapped in
13
+ * `m:limLow` / `m:limUpp` when a label follows on the matching side.
14
+ */
15
+ export declare function parseGroupChr(ctx: LatexParserContext, chr: string, pos: 'top' | 'bot'): OmmlNode;
16
+ /** `\underset{lim}{base}` -> `m:limLow`; `\overset{lim}{base}` -> `m:limUpp`. */
17
+ export declare function parseUnderOverset(ctx: LatexParserContext, tag: 'm:limLow' | 'm:limUpp'): OmmlNode;
18
+ /** `\boxed{x}` -> `m:borderBox`. */
19
+ export declare function parseBoxed(ctx: LatexParserContext): OmmlNode;
20
+ /** `\phantom` / `\hphantom` / `\vphantom` -> `m:phant` with the matching flags. */
21
+ export declare function parsePhantom(ctx: LatexParserContext, kind: 'full' | 'h' | 'v'): OmmlNode;
22
+ /** Build `m:sPre` from already-parsed sub/sup arguments and the base atom. */
23
+ export declare function buildPrescript(ctx: LatexParserContext, sub: OmmlNode[], sup: OmmlNode[]): OmmlNode;
24
+ /** `\prescript{sup}{sub}{base}` (mathtools). */
25
+ export declare function parsePrescript(ctx: LatexParserContext): OmmlNode;
26
+ /** `\operatorname{name}{arg}`: an arbitrary function name in `m:func`. */
27
+ export declare function parseOperatorName(ctx: LatexParserContext): OmmlNode;
28
+ //# sourceMappingURL=latex-to-omml-environments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latex-to-omml-environments.d.ts","sourceRoot":"","sources":["../../src/math/latex-to-omml-environments.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAOxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAMpD,2EAA2E;AAC3E,wBAAgB,aAAa,CAC5B,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACX,QAAQ,CAcV;AAyED,yFAAyF;AACzF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,kBAAkB,GAAG,QAAQ,GAAG,IAAI,CAqBzE;AAID,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAO1E;AAED,2EAA2E;AAC3E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,CAO9E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,CAmBhG;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,GAAG,QAAQ,CAKjG;AAED,oCAAoC;AACpC,wBAAgB,UAAU,CAAC,GAAG,EAAE,kBAAkB,GAAG,QAAQ,CAE5D;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,QAAQ,CAcxF;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,CAC7B,GAAG,EAAE,kBAAkB,EACvB,GAAG,EAAE,QAAQ,EAAE,EACf,GAAG,EAAE,QAAQ,EAAE,GACb,QAAQ,CASV;AAED,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,GAAG,EAAE,kBAAkB,GAAG,QAAQ,CAIhE;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,kBAAkB,GAAG,QAAQ,CAEnE"}
@@ -0,0 +1,9 @@
1
+ export { convertOmmlToLatex } from './omml-to-latex.js';
2
+ /**
3
+ * Convert a LaTeX math string into an OMML XML object (fast-xml-parser shape).
4
+ *
5
+ * The returned object has the shape `{ "m:oMathPara": { "m:oMath": { … } } }`,
6
+ * matching what the core pipeline stores as `TextSegment.equationXml`.
7
+ */
8
+ export declare function convertLatexToOmml(latex: string): Record<string, unknown>;
9
+ //# sourceMappingURL=latex-to-omml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latex-to-omml.d.ts","sourceRoot":"","sources":["../../src/math/latex-to-omml.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAiLxD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBzE"}
@@ -0,0 +1,11 @@
1
+ import type { OmmlNode as XmlObject } from './omml-node.js';
2
+ /**
3
+ * Read the first explicit DrawingML run colour nested inside an OMML tree.
4
+ * Office Math stores formatting in `a:rPr`, not in `m:rPr`, so this colour
5
+ * must travel with the generated MathML rather than the text shape's default
6
+ * paragraph style.
7
+ */
8
+ export declare function getOmmlMathColor(node: XmlObject | undefined): string | undefined;
9
+ /** Read the first explicit DrawingML run size, stored in hundredths of a point. */
10
+ export declare function getOmmlMathFontSize(node: XmlObject | undefined): number | undefined;
11
+ //# sourceMappingURL=omml-color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omml-color.d.ts","sourceRoot":"","sources":["../../src/math/omml-color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAqChF;AAED,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAgCnF"}
@@ -0,0 +1,7 @@
1
+ import { type XmlElement } from '../xml/index.js';
2
+ import type { OmmlNode } from './omml-node.js';
3
+ /** Adapt an ordered, namespace-aware OOXML DOM without a product parser. */
4
+ export declare function ommlFromElement(element: XmlElement): OmmlNode;
5
+ /** Parse standalone OMML using the shared XML parser's validation and DTD rejection. */
6
+ export declare function parseOmml(xml: string): OmmlNode;
7
+ //# sourceMappingURL=omml-dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omml-dom.d.ts","sourceRoot":"","sources":["../../src/math/omml-dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAS/C,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,QAAQ,CAiB7D;AAED,wFAAwF;AACxF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAE/C"}
@@ -0,0 +1,39 @@
1
+ import type { OmmlNode } from './omml-node.js';
2
+ import { type ChildrenConverter } from './omml-mathml-helpers.js';
3
+ /** m:r : text run: classify as identifier, number, or operator. */
4
+ export declare function convertRun(node: OmmlNode): string;
5
+ /** m:f : fraction. */
6
+ export declare function convertFraction(node: OmmlNode, cc: ChildrenConverter): string;
7
+ /** m:rad : radical: square root or nth root. */
8
+ export declare function convertRadical(node: OmmlNode, cc: ChildrenConverter): string;
9
+ /** m:sSup : superscript. */
10
+ export declare function convertSuperscript(node: OmmlNode, cc: ChildrenConverter): string;
11
+ /** m:sSub : subscript. */
12
+ export declare function convertSubscript(node: OmmlNode, cc: ChildrenConverter): string;
13
+ /** m:sSubSup : simultaneous subscript and superscript. */
14
+ export declare function convertSubSup(node: OmmlNode, cc: ChildrenConverter): string;
15
+ /** m:sPre : pre-sub-superscript (e.g. isotope notation). */
16
+ export declare function convertPreSubSup(node: OmmlNode, cc: ChildrenConverter): string;
17
+ /** m:nary : n-ary operator (sum, integral, product, etc.). */
18
+ export declare function convertNary(node: OmmlNode, cc: ChildrenConverter): string;
19
+ /** m:d : delimiter (parentheses, brackets, pipes, etc.). */
20
+ export declare function convertDelimiter(node: OmmlNode, cc: ChildrenConverter): string;
21
+ /** m:m : matrix / array layout. */
22
+ export declare function convertMatrix(node: OmmlNode, cc: ChildrenConverter): string;
23
+ /** m:acc : accent mark (hat, bar, tilde, dot, etc.). */
24
+ export declare function convertAccent(node: OmmlNode, cc: ChildrenConverter): string;
25
+ /** m:bar : overbar or underbar. */
26
+ export declare function convertBar(node: OmmlNode, cc: ChildrenConverter): string;
27
+ /** m:limLow : lower limit. */
28
+ export declare function convertLimLow(node: OmmlNode, cc: ChildrenConverter): string;
29
+ /** m:limUpp : upper limit. */
30
+ export declare function convertLimUpp(node: OmmlNode, cc: ChildrenConverter): string;
31
+ /** m:groupChr : grouping character (brace under/over). */
32
+ export declare function convertGroupChr(node: OmmlNode, cc: ChildrenConverter): string;
33
+ /** m:eqArr : equation array (aligned equations). */
34
+ export declare function convertEqArr(node: OmmlNode, cc: ChildrenConverter): string;
35
+ /** m:box / m:borderBox : grouping box (transparent container). */
36
+ export declare function convertBox(node: OmmlNode, cc: ChildrenConverter): string;
37
+ /** m:func : function application (sin, cos, log, lim, etc.). */
38
+ export declare function convertFunc(node: OmmlNode, cc: ChildrenConverter): string;
39
+ //# sourceMappingURL=omml-mathml-converters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omml-mathml-converters.d.ts","sourceRoot":"","sources":["../../src/math/omml-mathml-converters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAYN,KAAK,iBAAiB,EACtB,MAAM,0BAA0B,CAAC;AAGlC,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAqBjD;AAED,sBAAsB;AACtB,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAa7E;AAED,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAU5E;AAED,4BAA4B;AAC5B,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAIhF;AAED,0BAA0B;AAC1B,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAI9E;AAED,0DAA0D;AAC1D,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAK3E;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAK9E;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAwCzE;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CA0B9E;AAED,mCAAmC;AACnC,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAc3E;AAED,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAQ3E;AAED,mCAAmC;AACnC,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CASxE;AAED,8BAA8B;AAC9B,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAI3E;AAED,8BAA8B;AAC9B,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAI3E;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAY7E;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAS1E;AAED,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAExE;AAED,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAIzE"}
@@ -0,0 +1,23 @@
1
+ import type { OmmlNode } from './omml-node.js';
2
+ export type ChildrenConverter = (node: OmmlNode) => string;
3
+ /** Safely retrieve a child node, always returning an object (never undefined). */
4
+ export declare function child(node: OmmlNode | undefined, key: string): OmmlNode;
5
+ /** Ensure a value is an array of OmmlNode. */
6
+ export declare function ensureArray(value: OmmlNode[keyof OmmlNode]): OmmlNode[];
7
+ /** Read a string attribute from a node. */
8
+ export declare function attr(node: OmmlNode | undefined, name: string): string;
9
+ /** Read the `@_val` attribute (extremely common in OMML property nodes). */
10
+ export declare function val(node: OmmlNode | undefined): string;
11
+ /** Escape angle brackets and ampersands for safe embedding in MathML. */
12
+ export declare function escapeXml(text: string): string;
13
+ /** Read an `m:t` text run value (object/string/number) as a string. */
14
+ export declare function readText(node: OmmlNode): string;
15
+ /** Set of characters treated as mathematical operators. */
16
+ export declare const OPERATOR_CHARS: Set<string>;
17
+ export declare function isOperator(ch: string): boolean;
18
+ export declare function isNumeric(text: string): boolean;
19
+ export declare const ACCENT_MAP: Record<string, string>;
20
+ export declare const NARY_CHAR_MAP: Record<string, string>;
21
+ export declare const DELIM_BEGIN_MAP: Record<string, string>;
22
+ export declare const DELIM_END_MAP: Record<string, string>;
23
+ //# sourceMappingURL=omml-mathml-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omml-mathml-helpers.d.ts","sourceRoot":"","sources":["../../src/math/omml-mathml-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;AAG3D,kFAAkF;AAClF,wBAAgB,KAAK,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CASvE;AAED,8CAA8C;AAC9C,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAWvE;AAED,2CAA2C;AAC3C,wBAAgB,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrE;AAED,4EAA4E;AAC5E,wBAAgB,GAAG,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAEtD;AAED,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,uEAAuE;AACvE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAa/C;AAID,2DAA2D;AAC3D,eAAO,MAAM,cAAc,aAyDzB,CAAC;AAEH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/C;AAID,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgB7C,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAYhD,CAAC;AAIF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASlD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAShD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** OMML compatibility tree: attributes use `@_`, text uses `#text`. */
2
+ export type OmmlNode = Record<string, unknown>;
3
+ /** Retain the established encoded key spelling when returning legacy object trees. */
4
+ export declare function orderedXmlKey(baseName: string, order: number): string;
5
+ /** Accept both the legacy spelling and the neutral DOM adapter's ordered keys. */
6
+ export declare function stripXmlOrderSuffix(tagName: string): string;
7
+ //# sourceMappingURL=omml-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omml-node.d.ts","sourceRoot":"","sources":["../../src/math/omml-node.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/C,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D"}
@@ -0,0 +1,41 @@
1
+ export type XmlRecord = Record<string, unknown>;
2
+ export declare function ensureArr(val: unknown): XmlRecord[];
3
+ export declare function childNode(node: XmlRecord | undefined, key: string): XmlRecord;
4
+ export declare function attrVal(node: XmlRecord | undefined): string;
5
+ /** True when the property node exists (even with an empty `m:val`). */
6
+ export declare function hasAttr(node: XmlRecord | undefined): boolean;
7
+ /** OMML boolean property: `1`, `on`, `true` (or a bare presence) are truthy. */
8
+ export declare function isOn(node: XmlRecord | undefined): boolean;
9
+ /** Read an `m:t` value (string / number / `{ '#text' }` object) as a string. */
10
+ export declare function readRunText(run: XmlRecord): string;
11
+ /** Content keys of a container: everything but attributes and `*Pr` property nodes. */
12
+ export declare function contentKeys(node: XmlRecord): string[];
13
+ /**
14
+ * When `container` holds exactly one child element, return its tag and node;
15
+ * otherwise `null`. Used to recognise `m:d( m:m )` as `pmatrix`, etc.
16
+ */
17
+ export declare function soleChild(container: XmlRecord | undefined): {
18
+ tag: string;
19
+ node: XmlRecord;
20
+ } | null;
21
+ /** Escape one character of run text for the LaTeX tokenizer. */
22
+ export declare function escapeChar(ch: string): string;
23
+ /** Escape a whole run of math text (symbols become commands, syntax is escaped). */
24
+ export declare function escapeMathText(text: string): string;
25
+ /**
26
+ * Escape text destined for a `\text{...}` argument: only the brace syntax
27
+ * matters. One pass over a character class, so the backslash a brace escape
28
+ * introduces is never itself re-escaped by a later pass.
29
+ */
30
+ export declare function escapeTextArgument(text: string): string;
31
+ /**
32
+ * True when the LaTeX for `container` is a single atom that can take a script
33
+ * directly (`x^{2}`); multi-atom bases need braces (`{10}^{2}`, `{ab}_{i}`).
34
+ */
35
+ export declare function isSingleAtom(container: XmlRecord | undefined): boolean;
36
+ /**
37
+ * Graceful fallback for constructs with no LaTeX spelling: collect every
38
+ * `m:t` in document order so the user still sees (and keeps) the content.
39
+ */
40
+ export declare function collectText(node: unknown): string;
41
+ //# sourceMappingURL=omml-to-latex-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omml-to-latex-helpers.d.ts","sourceRoot":"","sources":["../../src/math/omml-to-latex-helpers.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEhD,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,EAAE,CAWnD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAY7E;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAS3D;AAED,uEAAuE;AACvE,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAE5D;AAED,gFAAgF;AAChF,wBAAgB,IAAI,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAGzD;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAgBlD;AAED,uFAAuF;AACvF,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,EAAE,CAQrD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACxB,SAAS,EAAE,SAAS,GAAG,SAAS,GAC9B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CAazC;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAQ7C;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AASD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAatE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CA6BjD"}
@@ -0,0 +1,18 @@
1
+ import type { XmlRecord } from './omml-to-latex-helpers.js';
2
+ /** Recursive emitters supplied by `omml-to-latex.ts`. */
3
+ export interface LatexEmitter {
4
+ /** All content children of a container, in document order. */
5
+ children(node: XmlRecord | undefined): string;
6
+ /** The content of one named child (`m:e`, `m:num`, ...). */
7
+ arg(node: XmlRecord, key: string): string;
8
+ }
9
+ export declare function naryToLatex(emit: LatexEmitter, node: XmlRecord): string;
10
+ export declare function rowsToLatex(emit: LatexEmitter, rows: XmlRecord[]): string;
11
+ export declare function matrixToLatex(emit: LatexEmitter, node: XmlRecord, env: string): string;
12
+ export declare function eqArrToLatex(emit: LatexEmitter, node: XmlRecord): string;
13
+ /**
14
+ * `m:d`: a `\begin{pmatrix}`-style environment, `\begin{cases}` or `\binom`
15
+ * when the delimiters and sole child match, otherwise `\left ... \right`.
16
+ */
17
+ export declare function delimiterToLatex(emit: LatexEmitter, node: XmlRecord): string;
18
+ //# sourceMappingURL=omml-to-latex-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omml-to-latex-layout.d.ts","sourceRoot":"","sources":["../../src/math/omml-to-latex-layout.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAW5D,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC5B,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IAC9C,4DAA4D;IAC5D,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1C;AAMD,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAgBvE;AA0BD,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,CAEzE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAOtF;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAExE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CA4B5E"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Reverse-convert an OMML node back to LaTeX for editing. Accepts the object at
3
+ * the `m:oMathPara` level, at `m:oMath`, or a bare content container.
4
+ */
5
+ export declare function convertOmmlToLatex(omml: Record<string, unknown>): string;
6
+ //# sourceMappingURL=omml-to-latex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omml-to-latex.d.ts","sourceRoot":"","sources":["../../src/math/omml-to-latex.ts"],"names":[],"mappings":"AA6NA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAgBxE"}
@@ -0,0 +1,21 @@
1
+ /** Pure OMML to MathML conversion, with no browser or document-format dependency. */
2
+ import type { OmmlNode } from './omml-node.js';
3
+ export type { OmmlNode } from './omml-node.js';
4
+ /**
5
+ * Convert an OMML XML node (from fast-xml-parser) into a MathML string.
6
+ *
7
+ * Accepts the object at the `<a14:m>` / `<m:oMathPara>` level or directly at
8
+ * `<m:oMath>`. Returns a `<math>` element string, or empty string if the input
9
+ * is empty / unparseable.
10
+ */
11
+ export declare function convertOmmlToMathMl(ommlNode: OmmlNode): string;
12
+ /**
13
+ * Convenience alias used by the Vue viewer: `ommlToMathml(omml)`.
14
+ *
15
+ * Accepts the parsed OMML object (the shape stored on
16
+ * {@link TextSegment.equationXml}) or a raw OMML markup string. String inputs
17
+ * are not re-parsed here (no XML parser dependency in this pure module) : they
18
+ * are returned wrapped so callers can still surface raw markup if needed.
19
+ */
20
+ export declare function ommlToMathml(omml: OmmlNode | string): string;
21
+ //# sourceMappingURL=omml-to-mathml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omml-to-mathml.d.ts","sourceRoot":"","sources":["../../src/math/omml-to-mathml.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA4H/C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAqB9D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAO5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ooxml-core",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Shared OOXML logic for the Word, PowerPoint and Excel viewers: everything except the UI",
5
5
  "keywords": [
6
6
  "charts",
@@ -140,6 +140,11 @@
140
140
  "types": "./dist/pptx/signature-node/index.d.ts",
141
141
  "import": "./dist/pptx/signature-node/index.mjs",
142
142
  "require": "./dist/pptx/signature-node/index.cjs"
143
+ },
144
+ "./math": {
145
+ "types": "./dist/math/index.d.ts",
146
+ "import": "./dist/math/index.mjs",
147
+ "require": "./dist/math/index.cjs"
143
148
  }
144
149
  },
145
150
  "publishConfig": {