docx 9.8.0 → 9.8.1
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/index.cjs +108 -57
- package/dist/index.d.cts +83 -16
- package/dist/index.d.ts +83 -16
- package/dist/index.iife.js +108 -57
- package/dist/index.mjs +109 -55
- package/dist/index.umd.cjs +108 -57
- package/dist/math.cjs +2235 -5
- package/dist/math.d.cts +316 -0
- package/dist/math.d.ts +316 -0
- package/dist/math.iife.js +2235 -5
- package/dist/math.mjs +2230 -7
- package/dist/math.umd.cjs +2235 -5
- package/package.json +3 -3
package/dist/index.iife.js
CHANGED
|
@@ -8224,12 +8224,6 @@ var docx = (function(exports) {
|
|
|
8224
8224
|
}
|
|
8225
8225
|
};
|
|
8226
8226
|
//#endregion
|
|
8227
|
-
//#region src/file/xml-components/xmlable-object.ts
|
|
8228
|
-
/**
|
|
8229
|
-
* @ignore
|
|
8230
|
-
*/
|
|
8231
|
-
var WORKAROUND3 = "";
|
|
8232
|
-
//#endregion
|
|
8233
8227
|
//#region src/file/xml-components/initializable-xml-component.ts
|
|
8234
8228
|
/**
|
|
8235
8229
|
* Initializable XML Component module.
|
|
@@ -19218,6 +19212,28 @@ MAX: 9026 };
|
|
|
19218
19212
|
}
|
|
19219
19213
|
};
|
|
19220
19214
|
//#endregion
|
|
19215
|
+
//#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
19216
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
19217
|
+
if (null == r) return {};
|
|
19218
|
+
var t = {};
|
|
19219
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
19220
|
+
if (e.includes(n)) continue;
|
|
19221
|
+
t[n] = r[n];
|
|
19222
|
+
}
|
|
19223
|
+
return t;
|
|
19224
|
+
}
|
|
19225
|
+
//#endregion
|
|
19226
|
+
//#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutProperties.js
|
|
19227
|
+
function _objectWithoutProperties(e, t) {
|
|
19228
|
+
if (null == e) return {};
|
|
19229
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
19230
|
+
if (Object.getOwnPropertySymbols) {
|
|
19231
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
19232
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
19233
|
+
}
|
|
19234
|
+
return i;
|
|
19235
|
+
}
|
|
19236
|
+
//#endregion
|
|
19221
19237
|
//#region src/file/paragraph/math/math-run.ts
|
|
19222
19238
|
/**
|
|
19223
19239
|
* Math Run module for Office MathML.
|
|
@@ -19228,6 +19244,33 @@ MAX: 9026 };
|
|
|
19228
19244
|
*
|
|
19229
19245
|
* @module
|
|
19230
19246
|
*/
|
|
19247
|
+
var _excluded$3 = [
|
|
19248
|
+
"text",
|
|
19249
|
+
"normalText",
|
|
19250
|
+
"script",
|
|
19251
|
+
"literal"
|
|
19252
|
+
];
|
|
19253
|
+
var STYLES = {
|
|
19254
|
+
plain: "p",
|
|
19255
|
+
bold: "b",
|
|
19256
|
+
italic: "i",
|
|
19257
|
+
boldItalic: "bi"
|
|
19258
|
+
};
|
|
19259
|
+
var SCRIPTS = {
|
|
19260
|
+
roman: "roman",
|
|
19261
|
+
script: "script",
|
|
19262
|
+
fraktur: "fraktur",
|
|
19263
|
+
doubleStruck: "double-struck",
|
|
19264
|
+
sansSerif: "sans-serif",
|
|
19265
|
+
monospace: "monospace"
|
|
19266
|
+
};
|
|
19267
|
+
var createValueElement = (name, value) => new BuilderElement({
|
|
19268
|
+
name,
|
|
19269
|
+
attributes: { value: {
|
|
19270
|
+
key: "m:val",
|
|
19271
|
+
value
|
|
19272
|
+
} }
|
|
19273
|
+
});
|
|
19231
19274
|
/**
|
|
19232
19275
|
* Represents a run of text within a math equation.
|
|
19233
19276
|
*
|
|
@@ -19256,24 +19299,28 @@ MAX: 9026 };
|
|
|
19256
19299
|
* ```typescript
|
|
19257
19300
|
* new MathRun("x + y");
|
|
19258
19301
|
* new MathRun({ text: "if ", normalText: true });
|
|
19302
|
+
* new MathRun({ text: "R", script: "doubleStruck" });
|
|
19303
|
+
* new MathRun({ text: "d", style: "plain" });
|
|
19259
19304
|
* ```
|
|
19260
19305
|
*/
|
|
19261
19306
|
var MathRun = class extends XmlComponent {
|
|
19262
19307
|
constructor(options) {
|
|
19308
|
+
var _rest$style;
|
|
19263
19309
|
super("m:r");
|
|
19264
|
-
const
|
|
19265
|
-
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
if (
|
|
19310
|
+
const _ref = typeof options === "string" ? { text: options } : options, { text, normalText, script, literal } = _ref;
|
|
19311
|
+
const style = (_rest$style = _objectWithoutProperties(_ref, _excluded$3).style) !== null && _rest$style !== void 0 ? _rest$style : script === void 0 || script === "roman" ? void 0 : "plain";
|
|
19312
|
+
if (normalText && (style !== void 0 || script !== void 0)) throw new Error("MathRun: normalText can't be given with style or script, which are for math. Give one or the other");
|
|
19313
|
+
if (style !== void 0 && !Object.keys(STYLES).includes(style)) throw new Error(`MathRun: style is "${style}", which isn't one of ${Object.keys(STYLES).join(", ")}`);
|
|
19314
|
+
if (script !== void 0 && !Object.keys(SCRIPTS).includes(script)) throw new Error(`MathRun: script is "${script}", which isn't one of ${Object.keys(SCRIPTS).join(", ")}`);
|
|
19315
|
+
const properties = [
|
|
19316
|
+
...literal ? [createValueElement("m:lit", 1)] : [],
|
|
19317
|
+
...normalText ? [createValueElement("m:nor", 1)] : [],
|
|
19318
|
+
...script === void 0 ? [] : [createValueElement("m:scr", SCRIPTS[script])],
|
|
19319
|
+
...style === void 0 ? [] : [createValueElement("m:sty", STYLES[style])]
|
|
19320
|
+
];
|
|
19321
|
+
if (properties.length > 0) this.root.push(new BuilderElement({
|
|
19269
19322
|
name: "m:rPr",
|
|
19270
|
-
children:
|
|
19271
|
-
name: "m:nor",
|
|
19272
|
-
attributes: { on: {
|
|
19273
|
-
key: "m:val",
|
|
19274
|
-
value: 1
|
|
19275
|
-
} }
|
|
19276
|
-
})]
|
|
19323
|
+
children: properties
|
|
19277
19324
|
}));
|
|
19278
19325
|
this.root.push(new MathText(text));
|
|
19279
19326
|
}
|
|
@@ -19329,6 +19376,12 @@ MAX: 9026 };
|
|
|
19329
19376
|
*
|
|
19330
19377
|
* @module
|
|
19331
19378
|
*/
|
|
19379
|
+
var TYPES = {
|
|
19380
|
+
stacked: "bar",
|
|
19381
|
+
skewed: "skw",
|
|
19382
|
+
linear: "lin",
|
|
19383
|
+
noBar: "noBar"
|
|
19384
|
+
};
|
|
19332
19385
|
/**
|
|
19333
19386
|
* Represents a fraction in a math equation.
|
|
19334
19387
|
*
|
|
@@ -19355,11 +19408,29 @@ MAX: 9026 };
|
|
|
19355
19408
|
* numerator: [new MathRun("a + b")],
|
|
19356
19409
|
* denominator: [new MathRun("c")],
|
|
19357
19410
|
* });
|
|
19411
|
+
*
|
|
19412
|
+
* // n over k, as a binomial coefficient, in brackets
|
|
19413
|
+
* new MathRoundBrackets({
|
|
19414
|
+
* children: [new MathFraction({ numerator: [new MathRun("n")], denominator: [new MathRun("k")], type: "noBar" })],
|
|
19415
|
+
* });
|
|
19358
19416
|
* ```
|
|
19359
19417
|
*/
|
|
19360
19418
|
var MathFraction = class extends XmlComponent {
|
|
19361
19419
|
constructor(options) {
|
|
19362
19420
|
super("m:f");
|
|
19421
|
+
if (options.type !== void 0) {
|
|
19422
|
+
if (!Object.keys(TYPES).includes(options.type)) throw new Error(`MathFraction: type is "${options.type}", which isn't one of ${Object.keys(TYPES).join(", ")}`);
|
|
19423
|
+
this.root.push(new BuilderElement({
|
|
19424
|
+
name: "m:fPr",
|
|
19425
|
+
children: [new BuilderElement({
|
|
19426
|
+
name: "m:type",
|
|
19427
|
+
attributes: { value: {
|
|
19428
|
+
key: "m:val",
|
|
19429
|
+
value: TYPES[options.type]
|
|
19430
|
+
} }
|
|
19431
|
+
})]
|
|
19432
|
+
}));
|
|
19433
|
+
}
|
|
19363
19434
|
this.root.push(new MathNumerator(options.numerator));
|
|
19364
19435
|
this.root.push(new MathDenominator(options.denominator));
|
|
19365
19436
|
}
|
|
@@ -19609,6 +19680,22 @@ MAX: 9026 };
|
|
|
19609
19680
|
children
|
|
19610
19681
|
});
|
|
19611
19682
|
//#endregion
|
|
19683
|
+
//#region src/file/paragraph/math/n-ary/limit-location-value.ts
|
|
19684
|
+
var LOCATIONS = {
|
|
19685
|
+
aboveBelow: "undOvr",
|
|
19686
|
+
side: "subSup"
|
|
19687
|
+
};
|
|
19688
|
+
/**
|
|
19689
|
+
* The value of `m:limLoc` for where limits go, or the default when none is given.
|
|
19690
|
+
*
|
|
19691
|
+
* @throws If the position isn't one of those allowed, for code that isn't type checked
|
|
19692
|
+
*/
|
|
19693
|
+
var limitLocationValue = (owner, limits, defaultValue) => {
|
|
19694
|
+
if (limits === void 0) return defaultValue;
|
|
19695
|
+
if (!Object.keys(LOCATIONS).includes(limits)) throw new Error(`${owner}: limits is "${limits}", which isn't one of ${Object.keys(LOCATIONS).join(", ")}`);
|
|
19696
|
+
return LOCATIONS[limits];
|
|
19697
|
+
};
|
|
19698
|
+
//#endregion
|
|
19612
19699
|
//#region src/file/paragraph/math/n-ary/math-super-script.ts
|
|
19613
19700
|
/**
|
|
19614
19701
|
* Math SuperScript Element module for Office MathML.
|
|
@@ -19691,7 +19778,8 @@ MAX: 9026 };
|
|
|
19691
19778
|
this.root.push(createMathNAryProperties({
|
|
19692
19779
|
accent: "∑",
|
|
19693
19780
|
hasSuperScript: !!options.superScript,
|
|
19694
|
-
hasSubScript: !!options.subScript
|
|
19781
|
+
hasSubScript: !!options.subScript,
|
|
19782
|
+
limitLocationVal: limitLocationValue("MathSum", options.limits, "undOvr")
|
|
19695
19783
|
}));
|
|
19696
19784
|
this.root.push(createMathSubScriptElement({ children: (_options$subScript = options.subScript) !== null && _options$subScript !== void 0 ? _options$subScript : [] }));
|
|
19697
19785
|
this.root.push(createMathSuperScriptElement({ children: (_options$superScript = options.superScript) !== null && _options$superScript !== void 0 ? _options$superScript : [] }));
|
|
@@ -19748,7 +19836,7 @@ MAX: 9026 };
|
|
|
19748
19836
|
accent: "",
|
|
19749
19837
|
hasSuperScript: !!options.superScript,
|
|
19750
19838
|
hasSubScript: !!options.subScript,
|
|
19751
|
-
limitLocationVal: "subSup"
|
|
19839
|
+
limitLocationVal: limitLocationValue("MathIntegral", options.limits, "subSup")
|
|
19752
19840
|
}));
|
|
19753
19841
|
this.root.push(createMathSubScriptElement({ children: (_options$subScript = options.subScript) !== null && _options$subScript !== void 0 ? _options$subScript : [] }));
|
|
19754
19842
|
this.root.push(createMathSuperScriptElement({ children: (_options$superScript = options.superScript) !== null && _options$superScript !== void 0 ? _options$superScript : [] }));
|
|
@@ -20208,12 +20296,6 @@ MAX: 9026 };
|
|
|
20208
20296
|
}
|
|
20209
20297
|
};
|
|
20210
20298
|
//#endregion
|
|
20211
|
-
//#region src/file/paragraph/math/math-component.ts
|
|
20212
|
-
/**
|
|
20213
|
-
* @ignore
|
|
20214
|
-
*/
|
|
20215
|
-
var WORKAROUND4 = "";
|
|
20216
|
-
//#endregion
|
|
20217
20299
|
//#region src/file/paragraph/math/radical/math-degree.ts
|
|
20218
20300
|
/**
|
|
20219
20301
|
* Math Degree module for Office MathML.
|
|
@@ -25968,12 +26050,6 @@ MAX: 9026 };
|
|
|
25968
26050
|
}
|
|
25969
26051
|
};
|
|
25970
26052
|
//#endregion
|
|
25971
|
-
//#region src/file/media/data.ts
|
|
25972
|
-
/**
|
|
25973
|
-
* @ignore
|
|
25974
|
-
*/
|
|
25975
|
-
var WORKAROUND2 = "";
|
|
25976
|
-
//#endregion
|
|
25977
26053
|
//#region src/file/numbering/level.ts
|
|
25978
26054
|
/**
|
|
25979
26055
|
* Numbering level definitions module for WordprocessingML documents.
|
|
@@ -29307,28 +29383,6 @@ MAX: 9026 };
|
|
|
29307
29383
|
}
|
|
29308
29384
|
};
|
|
29309
29385
|
//#endregion
|
|
29310
|
-
//#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
29311
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
29312
|
-
if (null == r) return {};
|
|
29313
|
-
var t = {};
|
|
29314
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
29315
|
-
if (e.includes(n)) continue;
|
|
29316
|
-
t[n] = r[n];
|
|
29317
|
-
}
|
|
29318
|
-
return t;
|
|
29319
|
-
}
|
|
29320
|
-
//#endregion
|
|
29321
|
-
//#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutProperties.js
|
|
29322
|
-
function _objectWithoutProperties(e, t) {
|
|
29323
|
-
if (null == e) return {};
|
|
29324
|
-
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
29325
|
-
if (Object.getOwnPropertySymbols) {
|
|
29326
|
-
var s = Object.getOwnPropertySymbols(e);
|
|
29327
|
-
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
29328
|
-
}
|
|
29329
|
-
return i;
|
|
29330
|
-
}
|
|
29331
|
-
//#endregion
|
|
29332
29386
|
//#region src/file/table-of-contents/table-of-contents.ts
|
|
29333
29387
|
/**
|
|
29334
29388
|
* Table of Contents module for WordprocessingML documents.
|
|
@@ -36078,9 +36132,6 @@ while (n === a[++i] && n === a[++i] && n === a[++i] && n === a[++i] && n === a[+
|
|
|
36078
36132
|
exports.VerticalMergeType = VerticalMergeType;
|
|
36079
36133
|
exports.VerticalPositionAlign = VerticalPositionAlign;
|
|
36080
36134
|
exports.VerticalPositionRelativeFrom = VerticalPositionRelativeFrom;
|
|
36081
|
-
exports.WORKAROUND2 = WORKAROUND2;
|
|
36082
|
-
exports.WORKAROUND3 = WORKAROUND3;
|
|
36083
|
-
exports.WORKAROUND4 = WORKAROUND4;
|
|
36084
36135
|
exports.WidthType = WidthType;
|
|
36085
36136
|
exports.WpgGroupRun = WpgGroupRun;
|
|
36086
36137
|
exports.WpsShapeRun = WpsShapeRun;
|
package/dist/index.mjs
CHANGED
|
@@ -8226,12 +8226,6 @@ var ImportedRootElementAttributes = class extends XmlComponent {
|
|
|
8226
8226
|
}
|
|
8227
8227
|
};
|
|
8228
8228
|
//#endregion
|
|
8229
|
-
//#region src/file/xml-components/xmlable-object.ts
|
|
8230
|
-
/**
|
|
8231
|
-
* @ignore
|
|
8232
|
-
*/
|
|
8233
|
-
var WORKAROUND3 = "";
|
|
8234
|
-
//#endregion
|
|
8235
8229
|
//#region src/file/xml-components/initializable-xml-component.ts
|
|
8236
8230
|
/**
|
|
8237
8231
|
* Initializable XML Component module.
|
|
@@ -19220,6 +19214,28 @@ var MathText = class extends XmlComponent {
|
|
|
19220
19214
|
}
|
|
19221
19215
|
};
|
|
19222
19216
|
//#endregion
|
|
19217
|
+
//#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
19218
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
19219
|
+
if (null == r) return {};
|
|
19220
|
+
var t = {};
|
|
19221
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
19222
|
+
if (e.includes(n)) continue;
|
|
19223
|
+
t[n] = r[n];
|
|
19224
|
+
}
|
|
19225
|
+
return t;
|
|
19226
|
+
}
|
|
19227
|
+
//#endregion
|
|
19228
|
+
//#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutProperties.js
|
|
19229
|
+
function _objectWithoutProperties(e, t) {
|
|
19230
|
+
if (null == e) return {};
|
|
19231
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
19232
|
+
if (Object.getOwnPropertySymbols) {
|
|
19233
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
19234
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
19235
|
+
}
|
|
19236
|
+
return i;
|
|
19237
|
+
}
|
|
19238
|
+
//#endregion
|
|
19223
19239
|
//#region src/file/paragraph/math/math-run.ts
|
|
19224
19240
|
/**
|
|
19225
19241
|
* Math Run module for Office MathML.
|
|
@@ -19230,6 +19246,33 @@ var MathText = class extends XmlComponent {
|
|
|
19230
19246
|
*
|
|
19231
19247
|
* @module
|
|
19232
19248
|
*/
|
|
19249
|
+
var _excluded$3 = [
|
|
19250
|
+
"text",
|
|
19251
|
+
"normalText",
|
|
19252
|
+
"script",
|
|
19253
|
+
"literal"
|
|
19254
|
+
];
|
|
19255
|
+
var STYLES = {
|
|
19256
|
+
plain: "p",
|
|
19257
|
+
bold: "b",
|
|
19258
|
+
italic: "i",
|
|
19259
|
+
boldItalic: "bi"
|
|
19260
|
+
};
|
|
19261
|
+
var SCRIPTS = {
|
|
19262
|
+
roman: "roman",
|
|
19263
|
+
script: "script",
|
|
19264
|
+
fraktur: "fraktur",
|
|
19265
|
+
doubleStruck: "double-struck",
|
|
19266
|
+
sansSerif: "sans-serif",
|
|
19267
|
+
monospace: "monospace"
|
|
19268
|
+
};
|
|
19269
|
+
var createValueElement = (name, value) => new BuilderElement({
|
|
19270
|
+
name,
|
|
19271
|
+
attributes: { value: {
|
|
19272
|
+
key: "m:val",
|
|
19273
|
+
value
|
|
19274
|
+
} }
|
|
19275
|
+
});
|
|
19233
19276
|
/**
|
|
19234
19277
|
* Represents a run of text within a math equation.
|
|
19235
19278
|
*
|
|
@@ -19258,24 +19301,28 @@ var MathText = class extends XmlComponent {
|
|
|
19258
19301
|
* ```typescript
|
|
19259
19302
|
* new MathRun("x + y");
|
|
19260
19303
|
* new MathRun({ text: "if ", normalText: true });
|
|
19304
|
+
* new MathRun({ text: "R", script: "doubleStruck" });
|
|
19305
|
+
* new MathRun({ text: "d", style: "plain" });
|
|
19261
19306
|
* ```
|
|
19262
19307
|
*/
|
|
19263
19308
|
var MathRun = class extends XmlComponent {
|
|
19264
19309
|
constructor(options) {
|
|
19310
|
+
var _rest$style;
|
|
19265
19311
|
super("m:r");
|
|
19266
|
-
const
|
|
19267
|
-
|
|
19268
|
-
|
|
19269
|
-
|
|
19270
|
-
if (
|
|
19312
|
+
const _ref = typeof options === "string" ? { text: options } : options, { text, normalText, script, literal } = _ref;
|
|
19313
|
+
const style = (_rest$style = _objectWithoutProperties(_ref, _excluded$3).style) !== null && _rest$style !== void 0 ? _rest$style : script === void 0 || script === "roman" ? void 0 : "plain";
|
|
19314
|
+
if (normalText && (style !== void 0 || script !== void 0)) throw new Error("MathRun: normalText can't be given with style or script, which are for math. Give one or the other");
|
|
19315
|
+
if (style !== void 0 && !Object.keys(STYLES).includes(style)) throw new Error(`MathRun: style is "${style}", which isn't one of ${Object.keys(STYLES).join(", ")}`);
|
|
19316
|
+
if (script !== void 0 && !Object.keys(SCRIPTS).includes(script)) throw new Error(`MathRun: script is "${script}", which isn't one of ${Object.keys(SCRIPTS).join(", ")}`);
|
|
19317
|
+
const properties = [
|
|
19318
|
+
...literal ? [createValueElement("m:lit", 1)] : [],
|
|
19319
|
+
...normalText ? [createValueElement("m:nor", 1)] : [],
|
|
19320
|
+
...script === void 0 ? [] : [createValueElement("m:scr", SCRIPTS[script])],
|
|
19321
|
+
...style === void 0 ? [] : [createValueElement("m:sty", STYLES[style])]
|
|
19322
|
+
];
|
|
19323
|
+
if (properties.length > 0) this.root.push(new BuilderElement({
|
|
19271
19324
|
name: "m:rPr",
|
|
19272
|
-
children:
|
|
19273
|
-
name: "m:nor",
|
|
19274
|
-
attributes: { on: {
|
|
19275
|
-
key: "m:val",
|
|
19276
|
-
value: 1
|
|
19277
|
-
} }
|
|
19278
|
-
})]
|
|
19325
|
+
children: properties
|
|
19279
19326
|
}));
|
|
19280
19327
|
this.root.push(new MathText(text));
|
|
19281
19328
|
}
|
|
@@ -19331,6 +19378,12 @@ var MathNumerator = class extends XmlComponent {
|
|
|
19331
19378
|
*
|
|
19332
19379
|
* @module
|
|
19333
19380
|
*/
|
|
19381
|
+
var TYPES = {
|
|
19382
|
+
stacked: "bar",
|
|
19383
|
+
skewed: "skw",
|
|
19384
|
+
linear: "lin",
|
|
19385
|
+
noBar: "noBar"
|
|
19386
|
+
};
|
|
19334
19387
|
/**
|
|
19335
19388
|
* Represents a fraction in a math equation.
|
|
19336
19389
|
*
|
|
@@ -19357,11 +19410,29 @@ var MathNumerator = class extends XmlComponent {
|
|
|
19357
19410
|
* numerator: [new MathRun("a + b")],
|
|
19358
19411
|
* denominator: [new MathRun("c")],
|
|
19359
19412
|
* });
|
|
19413
|
+
*
|
|
19414
|
+
* // n over k, as a binomial coefficient, in brackets
|
|
19415
|
+
* new MathRoundBrackets({
|
|
19416
|
+
* children: [new MathFraction({ numerator: [new MathRun("n")], denominator: [new MathRun("k")], type: "noBar" })],
|
|
19417
|
+
* });
|
|
19360
19418
|
* ```
|
|
19361
19419
|
*/
|
|
19362
19420
|
var MathFraction = class extends XmlComponent {
|
|
19363
19421
|
constructor(options) {
|
|
19364
19422
|
super("m:f");
|
|
19423
|
+
if (options.type !== void 0) {
|
|
19424
|
+
if (!Object.keys(TYPES).includes(options.type)) throw new Error(`MathFraction: type is "${options.type}", which isn't one of ${Object.keys(TYPES).join(", ")}`);
|
|
19425
|
+
this.root.push(new BuilderElement({
|
|
19426
|
+
name: "m:fPr",
|
|
19427
|
+
children: [new BuilderElement({
|
|
19428
|
+
name: "m:type",
|
|
19429
|
+
attributes: { value: {
|
|
19430
|
+
key: "m:val",
|
|
19431
|
+
value: TYPES[options.type]
|
|
19432
|
+
} }
|
|
19433
|
+
})]
|
|
19434
|
+
}));
|
|
19435
|
+
}
|
|
19365
19436
|
this.root.push(new MathNumerator(options.numerator));
|
|
19366
19437
|
this.root.push(new MathDenominator(options.denominator));
|
|
19367
19438
|
}
|
|
@@ -19611,6 +19682,22 @@ var createMathSubScriptElement = ({ children }) => new BuilderElement({
|
|
|
19611
19682
|
children
|
|
19612
19683
|
});
|
|
19613
19684
|
//#endregion
|
|
19685
|
+
//#region src/file/paragraph/math/n-ary/limit-location-value.ts
|
|
19686
|
+
var LOCATIONS = {
|
|
19687
|
+
aboveBelow: "undOvr",
|
|
19688
|
+
side: "subSup"
|
|
19689
|
+
};
|
|
19690
|
+
/**
|
|
19691
|
+
* The value of `m:limLoc` for where limits go, or the default when none is given.
|
|
19692
|
+
*
|
|
19693
|
+
* @throws If the position isn't one of those allowed, for code that isn't type checked
|
|
19694
|
+
*/
|
|
19695
|
+
var limitLocationValue = (owner, limits, defaultValue) => {
|
|
19696
|
+
if (limits === void 0) return defaultValue;
|
|
19697
|
+
if (!Object.keys(LOCATIONS).includes(limits)) throw new Error(`${owner}: limits is "${limits}", which isn't one of ${Object.keys(LOCATIONS).join(", ")}`);
|
|
19698
|
+
return LOCATIONS[limits];
|
|
19699
|
+
};
|
|
19700
|
+
//#endregion
|
|
19614
19701
|
//#region src/file/paragraph/math/n-ary/math-super-script.ts
|
|
19615
19702
|
/**
|
|
19616
19703
|
* Math SuperScript Element module for Office MathML.
|
|
@@ -19693,7 +19780,8 @@ var MathSum = class extends XmlComponent {
|
|
|
19693
19780
|
this.root.push(createMathNAryProperties({
|
|
19694
19781
|
accent: "∑",
|
|
19695
19782
|
hasSuperScript: !!options.superScript,
|
|
19696
|
-
hasSubScript: !!options.subScript
|
|
19783
|
+
hasSubScript: !!options.subScript,
|
|
19784
|
+
limitLocationVal: limitLocationValue("MathSum", options.limits, "undOvr")
|
|
19697
19785
|
}));
|
|
19698
19786
|
this.root.push(createMathSubScriptElement({ children: (_options$subScript = options.subScript) !== null && _options$subScript !== void 0 ? _options$subScript : [] }));
|
|
19699
19787
|
this.root.push(createMathSuperScriptElement({ children: (_options$superScript = options.superScript) !== null && _options$superScript !== void 0 ? _options$superScript : [] }));
|
|
@@ -19750,7 +19838,7 @@ var MathIntegral = class extends XmlComponent {
|
|
|
19750
19838
|
accent: "",
|
|
19751
19839
|
hasSuperScript: !!options.superScript,
|
|
19752
19840
|
hasSubScript: !!options.subScript,
|
|
19753
|
-
limitLocationVal: "subSup"
|
|
19841
|
+
limitLocationVal: limitLocationValue("MathIntegral", options.limits, "subSup")
|
|
19754
19842
|
}));
|
|
19755
19843
|
this.root.push(createMathSubScriptElement({ children: (_options$subScript = options.subScript) !== null && _options$subScript !== void 0 ? _options$subScript : [] }));
|
|
19756
19844
|
this.root.push(createMathSuperScriptElement({ children: (_options$superScript = options.superScript) !== null && _options$superScript !== void 0 ? _options$superScript : [] }));
|
|
@@ -20210,12 +20298,6 @@ var MathPreSubSuperScript = class extends BuilderElement {
|
|
|
20210
20298
|
}
|
|
20211
20299
|
};
|
|
20212
20300
|
//#endregion
|
|
20213
|
-
//#region src/file/paragraph/math/math-component.ts
|
|
20214
|
-
/**
|
|
20215
|
-
* @ignore
|
|
20216
|
-
*/
|
|
20217
|
-
var WORKAROUND4 = "";
|
|
20218
|
-
//#endregion
|
|
20219
20301
|
//#region src/file/paragraph/math/radical/math-degree.ts
|
|
20220
20302
|
/**
|
|
20221
20303
|
* Math Degree module for Office MathML.
|
|
@@ -25970,12 +26052,6 @@ var Media = class {
|
|
|
25970
26052
|
}
|
|
25971
26053
|
};
|
|
25972
26054
|
//#endregion
|
|
25973
|
-
//#region src/file/media/data.ts
|
|
25974
|
-
/**
|
|
25975
|
-
* @ignore
|
|
25976
|
-
*/
|
|
25977
|
-
var WORKAROUND2 = "";
|
|
25978
|
-
//#endregion
|
|
25979
26055
|
//#region src/file/numbering/level.ts
|
|
25980
26056
|
/**
|
|
25981
26057
|
* Numbering level definitions module for WordprocessingML documents.
|
|
@@ -29309,28 +29385,6 @@ var StructuredDocumentTagProperties = class extends XmlComponent {
|
|
|
29309
29385
|
}
|
|
29310
29386
|
};
|
|
29311
29387
|
//#endregion
|
|
29312
|
-
//#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
29313
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
29314
|
-
if (null == r) return {};
|
|
29315
|
-
var t = {};
|
|
29316
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
29317
|
-
if (e.includes(n)) continue;
|
|
29318
|
-
t[n] = r[n];
|
|
29319
|
-
}
|
|
29320
|
-
return t;
|
|
29321
|
-
}
|
|
29322
|
-
//#endregion
|
|
29323
|
-
//#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutProperties.js
|
|
29324
|
-
function _objectWithoutProperties(e, t) {
|
|
29325
|
-
if (null == e) return {};
|
|
29326
|
-
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
29327
|
-
if (Object.getOwnPropertySymbols) {
|
|
29328
|
-
var s = Object.getOwnPropertySymbols(e);
|
|
29329
|
-
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
29330
|
-
}
|
|
29331
|
-
return i;
|
|
29332
|
-
}
|
|
29333
|
-
//#endregion
|
|
29334
29388
|
//#region src/file/table-of-contents/table-of-contents.ts
|
|
29335
29389
|
/**
|
|
29336
29390
|
* Table of Contents module for WordprocessingML documents.
|
|
@@ -35861,4 +35915,4 @@ var findPatchKeys = (text) => {
|
|
|
35861
35915
|
return (_text$match = text.match(pattern)) !== null && _text$match !== void 0 ? _text$match : [];
|
|
35862
35916
|
};
|
|
35863
35917
|
//#endregion
|
|
35864
|
-
export { AbstractNumbering, AlignmentType, AnnotationReference, Attributes, BaseXmlComponent, Body, Bookmark, BookmarkEnd, BookmarkStart, Border, BorderStyle, BuilderElement, CarriageReturn, CellMerge, CellMergeAttributes, CharacterSet, CheckBox, CheckBoxSymbolElement, CheckBoxUtil, Column, ColumnBreak, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments, CommentsExtended, CommentsIds, ConcreteHyperlink, ConcreteNumbering, ContinuationSeparator, DayLong, DayShort, DeletedTableCell, DeletedTableRow, DeletedTextRun, File as Document, File, DocumentAttributeNamespaces, DocumentAttributes, DocumentBackground, DocumentBackgroundAttributes, DocumentDefaults, DocumentGridType, Drawing, DrawingPatch, DropCapType, EMPTY_OBJECT, EmphasisMarkType, EmptyElement, EndnoteIdReference, EndnoteReference, EndnoteReferenceRun, EndnoteReferenceRunAttributes, Endnotes, ExternalHyperlink, FileChild, FootNoteReferenceRunAttributes, FootNotes, Footer, FooterWrapper, FootnoteReference, FootnoteReferenceElement, FootnoteReferenceRun, FrameAnchorType, FrameWrap, GridSpan, Header, HeaderFooterReferenceType, HeaderFooterType, HeaderWrapper, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionRelativeFrom, HpsMeasureElement, HyperlinkType, IgnoreIfEmptyXmlComponent, ImageRun, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, InsertedTableCell, InsertedTableRow, InsertedTextRun, InternalHyperlink, LastRenderedPageBreak, LeaderType, Level, LevelBase, LevelForOverride, LevelFormat, LevelOverride, LevelSuffix, LineNumberRestartFormat, LineRuleType, Math$1 as Math, MathAngledBrackets, MathCurlyBrackets, MathDegree, MathDenominator, MathFraction, MathFunction, MathFunctionName, MathFunctionProperties, MathIntegral, MathLimit, MathLimitLower, MathLimitUpper, MathNumerator, MathPreSubSuperScript, MathRadical, MathRadicalProperties, MathRoundBrackets, MathRun, MathSquareBrackets, MathSubScript, MathSubSuperScript, MathSum, MathSuperScript, Media, MonthLong, MonthShort, NextAttributeComponent, NoBreakHyphen, NonVisualDrawingProperties, NumberFormat, NumberProperties, NumberValueElement, NumberedItemReference, NumberedItemReferenceFormat, Numbering, OnOffElement, OverlapType, PackagePart, Packer, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageBorders, PageBreak, PageBreakBefore, PageNumber, PageNumberElement, PageNumberSeparator, PageOrientation, PageReference, PageTextDirection, PageTextDirectionType, Paragraph, ParagraphProperties, ParagraphPropertiesChange, ParagraphPropertiesDefaults, ParagraphRunProperties, PatchType, PositionalTab, PositionalTabAlignment, PositionalTabLeader, PositionalTabRelativeTo, PrettifyType, RelativeHorizontalPosition, RelativeVerticalPosition, Run, RunProperties, RunPropertiesChange, RunPropertiesDefaults, SchemeColor, SectionProperties, SectionPropertiesChange, SectionType, Separator, SequentialIdentifier, ShadingType, SimpleField, SimpleMailMergeField, SoftHyphen, SpaceType, StringContainer, StringEnumValueElement, StringValueElement, StyleForCharacter, StyleForParagraph, StyleLevel, Styles, SymbolRun, TDirection, Tab, TabStopPosition, TabStopType, Table, TableAnchorType, TableBorders, TableCell, TableCellBorders, TableLayoutType, TableOfContents, TableProperties, TableRow, TableRowProperties, TableRowPropertiesChange, TextDirection, TextEffect, TextRun, TextWrappingSide, TextWrappingType, Textbox, ThematicBreak, Theme, UnderlineType, VerticalAlign, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMerge, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionRelativeFrom,
|
|
35918
|
+
export { AbstractNumbering, AlignmentType, AnnotationReference, Attributes, BaseXmlComponent, Body, Bookmark, BookmarkEnd, BookmarkStart, Border, BorderStyle, BuilderElement, CarriageReturn, CellMerge, CellMergeAttributes, CharacterSet, CheckBox, CheckBoxSymbolElement, CheckBoxUtil, Column, ColumnBreak, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments, CommentsExtended, CommentsIds, ConcreteHyperlink, ConcreteNumbering, ContinuationSeparator, DayLong, DayShort, DeletedTableCell, DeletedTableRow, DeletedTextRun, File as Document, File, DocumentAttributeNamespaces, DocumentAttributes, DocumentBackground, DocumentBackgroundAttributes, DocumentDefaults, DocumentGridType, Drawing, DrawingPatch, DropCapType, EMPTY_OBJECT, EmphasisMarkType, EmptyElement, EndnoteIdReference, EndnoteReference, EndnoteReferenceRun, EndnoteReferenceRunAttributes, Endnotes, ExternalHyperlink, FileChild, FootNoteReferenceRunAttributes, FootNotes, Footer, FooterWrapper, FootnoteReference, FootnoteReferenceElement, FootnoteReferenceRun, FrameAnchorType, FrameWrap, GridSpan, Header, HeaderFooterReferenceType, HeaderFooterType, HeaderWrapper, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionRelativeFrom, HpsMeasureElement, HyperlinkType, IgnoreIfEmptyXmlComponent, ImageRun, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, InsertedTableCell, InsertedTableRow, InsertedTextRun, InternalHyperlink, LastRenderedPageBreak, LeaderType, Level, LevelBase, LevelForOverride, LevelFormat, LevelOverride, LevelSuffix, LineNumberRestartFormat, LineRuleType, Math$1 as Math, MathAngledBrackets, MathCurlyBrackets, MathDegree, MathDenominator, MathFraction, MathFunction, MathFunctionName, MathFunctionProperties, MathIntegral, MathLimit, MathLimitLower, MathLimitUpper, MathNumerator, MathPreSubSuperScript, MathRadical, MathRadicalProperties, MathRoundBrackets, MathRun, MathSquareBrackets, MathSubScript, MathSubSuperScript, MathSum, MathSuperScript, Media, MonthLong, MonthShort, NextAttributeComponent, NoBreakHyphen, NonVisualDrawingProperties, NumberFormat, NumberProperties, NumberValueElement, NumberedItemReference, NumberedItemReferenceFormat, Numbering, OnOffElement, OverlapType, PackagePart, Packer, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageBorders, PageBreak, PageBreakBefore, PageNumber, PageNumberElement, PageNumberSeparator, PageOrientation, PageReference, PageTextDirection, PageTextDirectionType, Paragraph, ParagraphProperties, ParagraphPropertiesChange, ParagraphPropertiesDefaults, ParagraphRunProperties, PatchType, PositionalTab, PositionalTabAlignment, PositionalTabLeader, PositionalTabRelativeTo, PrettifyType, RelativeHorizontalPosition, RelativeVerticalPosition, Run, RunProperties, RunPropertiesChange, RunPropertiesDefaults, SchemeColor, SectionProperties, SectionPropertiesChange, SectionType, Separator, SequentialIdentifier, ShadingType, SimpleField, SimpleMailMergeField, SoftHyphen, SpaceType, StringContainer, StringEnumValueElement, StringValueElement, StyleForCharacter, StyleForParagraph, StyleLevel, Styles, SymbolRun, TDirection, Tab, TabStopPosition, TabStopType, Table, TableAnchorType, TableBorders, TableCell, TableCellBorders, TableLayoutType, TableOfContents, TableProperties, TableRow, TableRowProperties, TableRowPropertiesChange, TextDirection, TextEffect, TextRun, TextWrappingSide, TextWrappingType, Textbox, ThematicBreak, Theme, UnderlineType, VerticalAlign, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMerge, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionRelativeFrom, WidthType, WpgGroupRun, WpsShapeRun, XmlAttributeComponent, XmlComponent, YearLong, YearShort, abstractNumUniqueNumericIdGen, bookmarkUniqueNumericId, bookmarkUniqueNumericIdGen, commentIdToParaId, concreteNumUniqueNumericIdGen, convertInchesToTwip, convertMillimetersToTwip, convertToXmlComponent, createAlignment, createBodyProperties, createBorderElement, createColumns, createDocumentGrid, createDotEmphasisMark, createEmphasisMark, createFrameProperties, createHeaderFooterReference, createHorizontalPosition, createIndent, createLineNumberType, createMathAccentCharacter, createMathBase, createMathLimitLocation, createMathNAryProperties, createMathPreSubSuperScriptProperties, createMathSubScriptElement, createMathSubScriptProperties, createMathSubSuperScriptProperties, createMathSuperScriptElement, createMathSuperScriptProperties, createOutlineLevel, createPageMargin, createPageNumberType, createPageSize, createParagraphStyle, createRunFonts, createSectionType, createShading, createSimplePos, createSpacing, createStringElement, createTabStop, createTabStopItem, createTableFloatProperties, createTableLayout, createTableLook, createTableRowHeight, createTableWidthElement, createTransformation, createUnderline, createVerticalAlign, createVerticalPosition, createVmlShape, createWrapNone, createWrapSquare, createWrapThrough, createWrapTight, createWrapTopAndBottom, dateTimeValue, decimalNumber, docPropertiesUniqueNumericId, docPropertiesUniqueNumericIdGen, eighthPointMeasureValue, encodeUtf8, hashedId, hexColorValue, hpsMeasureValue, longHexNumber, measurementOrPercentValue, patchDetector, patchDocument, percentageValue, pointMeasureValue, positiveUniversalMeasureValue, sectionMarginDefaults, sectionPageSizeDefaults, shortHexNumber, signedHpsMeasureValue, signedTwipsMeasureValue, standardizeData, twipsMeasureValue, uCharHexNumber, uniqueId, uniqueNumericIdCreator, uniqueUuid, universalMeasureToTwips, universalMeasureValue, unsignedDecimalNumber };
|