docx 9.5.0 → 9.5.2

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 CHANGED
@@ -3234,58 +3234,61 @@ function requireSetFunctionLength() {
3234
3234
  };
3235
3235
  return setFunctionLength;
3236
3236
  }
3237
+ var applyBind;
3238
+ var hasRequiredApplyBind;
3239
+ function requireApplyBind() {
3240
+ if (hasRequiredApplyBind) return applyBind;
3241
+ hasRequiredApplyBind = 1;
3242
+ var bind = requireFunctionBind();
3243
+ var $apply = requireFunctionApply();
3244
+ var actualApply2 = requireActualApply();
3245
+ applyBind = function applyBind2() {
3246
+ return actualApply2(bind, $apply, arguments);
3247
+ };
3248
+ return applyBind;
3249
+ }
3237
3250
  var hasRequiredCallBind;
3238
3251
  function requireCallBind() {
3239
3252
  if (hasRequiredCallBind) return callBind.exports;
3240
3253
  hasRequiredCallBind = 1;
3241
3254
  (function(module2) {
3242
- var bind = requireFunctionBind();
3243
- var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic();
3244
3255
  var setFunctionLength2 = /* @__PURE__ */ requireSetFunctionLength();
3245
- var $TypeError = /* @__PURE__ */ requireType();
3246
- var $apply = GetIntrinsic("%Function.prototype.apply%");
3247
- var $call = GetIntrinsic("%Function.prototype.call%");
3248
- var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
3249
3256
  var $defineProperty = /* @__PURE__ */ requireEsDefineProperty();
3250
- var $max = GetIntrinsic("%Math.max%");
3257
+ var callBindBasic = requireCallBindApplyHelpers();
3258
+ var applyBind2 = requireApplyBind();
3251
3259
  module2.exports = function callBind2(originalFunction) {
3252
- if (typeof originalFunction !== "function") {
3253
- throw new $TypeError("a function is required");
3254
- }
3255
- var func = $reflectApply(bind, $call, arguments);
3260
+ var func = callBindBasic(arguments);
3261
+ var adjustedLength = originalFunction.length - (arguments.length - 1);
3256
3262
  return setFunctionLength2(
3257
3263
  func,
3258
- 1 + $max(0, originalFunction.length - (arguments.length - 1)),
3264
+ 1 + (adjustedLength > 0 ? adjustedLength : 0),
3259
3265
  true
3260
3266
  );
3261
3267
  };
3262
- var applyBind = function applyBind2() {
3263
- return $reflectApply(bind, $apply, arguments);
3264
- };
3265
3268
  if ($defineProperty) {
3266
- $defineProperty(module2.exports, "apply", { value: applyBind });
3269
+ $defineProperty(module2.exports, "apply", { value: applyBind2 });
3267
3270
  } else {
3268
- module2.exports.apply = applyBind;
3271
+ module2.exports.apply = applyBind2;
3269
3272
  }
3270
3273
  })(callBind);
3271
3274
  return callBind.exports;
3272
3275
  }
3273
- var callBound;
3274
- var hasRequiredCallBound;
3275
- function requireCallBound() {
3276
- if (hasRequiredCallBound) return callBound;
3277
- hasRequiredCallBound = 1;
3276
+ var callBound$1;
3277
+ var hasRequiredCallBound$1;
3278
+ function requireCallBound$1() {
3279
+ if (hasRequiredCallBound$1) return callBound$1;
3280
+ hasRequiredCallBound$1 = 1;
3278
3281
  var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic();
3279
3282
  var callBind2 = requireCallBind();
3280
3283
  var $indexOf = callBind2(GetIntrinsic("String.prototype.indexOf"));
3281
- callBound = function callBoundIntrinsic(name, allowMissing) {
3284
+ callBound$1 = function callBoundIntrinsic(name, allowMissing) {
3282
3285
  var intrinsic = GetIntrinsic(name, !!allowMissing);
3283
3286
  if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
3284
3287
  return callBind2(intrinsic);
3285
3288
  }
3286
3289
  return intrinsic;
3287
3290
  };
3288
- return callBound;
3291
+ return callBound$1;
3289
3292
  }
3290
3293
  var isArguments;
3291
3294
  var hasRequiredIsArguments;
@@ -3293,7 +3296,7 @@ function requireIsArguments() {
3293
3296
  if (hasRequiredIsArguments) return isArguments;
3294
3297
  hasRequiredIsArguments = 1;
3295
3298
  var hasToStringTag = requireShams()();
3296
- var callBound2 = requireCallBound();
3299
+ var callBound2 = requireCallBound$1();
3297
3300
  var $toString = callBound2("Object.prototype.toString");
3298
3301
  var isStandardArguments = function isArguments2(value) {
3299
3302
  if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) {
@@ -3473,10 +3476,10 @@ function requireIsCallable() {
3473
3476
  };
3474
3477
  return isCallable;
3475
3478
  }
3476
- var forEach_1;
3479
+ var forEach;
3477
3480
  var hasRequiredForEach;
3478
3481
  function requireForEach() {
3479
- if (hasRequiredForEach) return forEach_1;
3482
+ if (hasRequiredForEach) return forEach;
3480
3483
  hasRequiredForEach = 1;
3481
3484
  var isCallable2 = requireIsCallable();
3482
3485
  var toStr = Object.prototype.toString;
@@ -3512,7 +3515,10 @@ function requireForEach() {
3512
3515
  }
3513
3516
  }
3514
3517
  };
3515
- var forEach = function forEach2(list, iterator, thisArg) {
3518
+ function isArray(x) {
3519
+ return toStr.call(x) === "[object Array]";
3520
+ }
3521
+ forEach = function forEach2(list, iterator, thisArg) {
3516
3522
  if (!isCallable2(iterator)) {
3517
3523
  throw new TypeError("iterator must be a function");
3518
3524
  }
@@ -3520,7 +3526,7 @@ function requireForEach() {
3520
3526
  if (arguments.length >= 3) {
3521
3527
  receiver = thisArg;
3522
3528
  }
3523
- if (toStr.call(list) === "[object Array]") {
3529
+ if (isArray(list)) {
3524
3530
  forEachArray(list, iterator, receiver);
3525
3531
  } else if (typeof list === "string") {
3526
3532
  forEachString(list, iterator, receiver);
@@ -3528,8 +3534,7 @@ function requireForEach() {
3528
3534
  forEachObject(list, iterator, receiver);
3529
3535
  }
3530
3536
  };
3531
- forEach_1 = forEach;
3532
- return forEach_1;
3537
+ return forEach;
3533
3538
  }
3534
3539
  var possibleTypedArrayNames;
3535
3540
  var hasRequiredPossibleTypedArrayNames;
@@ -3569,22 +3574,45 @@ function requireAvailableTypedArrays() {
3569
3574
  };
3570
3575
  return availableTypedArrays;
3571
3576
  }
3577
+ var callBound;
3578
+ var hasRequiredCallBound;
3579
+ function requireCallBound() {
3580
+ if (hasRequiredCallBound) return callBound;
3581
+ hasRequiredCallBound = 1;
3582
+ var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic();
3583
+ var callBindBasic = requireCallBindApplyHelpers();
3584
+ var $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);
3585
+ callBound = function callBoundIntrinsic(name, allowMissing) {
3586
+ var intrinsic = (
3587
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
3588
+ GetIntrinsic(name, !!allowMissing)
3589
+ );
3590
+ if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
3591
+ return callBindBasic(
3592
+ /** @type {const} */
3593
+ [intrinsic]
3594
+ );
3595
+ }
3596
+ return intrinsic;
3597
+ };
3598
+ return callBound;
3599
+ }
3572
3600
  var whichTypedArray;
3573
3601
  var hasRequiredWhichTypedArray;
3574
3602
  function requireWhichTypedArray() {
3575
3603
  if (hasRequiredWhichTypedArray) return whichTypedArray;
3576
3604
  hasRequiredWhichTypedArray = 1;
3577
- var forEach = requireForEach();
3605
+ var forEach2 = requireForEach();
3578
3606
  var availableTypedArrays2 = /* @__PURE__ */ requireAvailableTypedArrays();
3579
3607
  var callBind2 = requireCallBind();
3580
- var callBound2 = requireCallBound();
3608
+ var callBound2 = /* @__PURE__ */ requireCallBound();
3581
3609
  var gOPD2 = /* @__PURE__ */ requireGopd();
3610
+ var getProto2 = requireGetProto();
3582
3611
  var $toString = callBound2("Object.prototype.toString");
3583
3612
  var hasToStringTag = requireShams()();
3584
3613
  var g = typeof globalThis === "undefined" ? commonjsGlobal : globalThis;
3585
3614
  var typedArrays = availableTypedArrays2();
3586
3615
  var $slice = callBound2("String.prototype.slice");
3587
- var getPrototypeOf = Object.getPrototypeOf;
3588
3616
  var $indexOf = callBound2("Array.prototype.indexOf", true) || function indexOf(array, value) {
3589
3617
  for (var i = 0; i < array.length; i += 1) {
3590
3618
  if (array[i] === value) {
@@ -3594,41 +3622,45 @@ function requireWhichTypedArray() {
3594
3622
  return -1;
3595
3623
  };
3596
3624
  var cache = { __proto__: null };
3597
- if (hasToStringTag && gOPD2 && getPrototypeOf) {
3598
- forEach(typedArrays, function(typedArray) {
3625
+ if (hasToStringTag && gOPD2 && getProto2) {
3626
+ forEach2(typedArrays, function(typedArray) {
3599
3627
  var arr = new g[typedArray]();
3600
- if (Symbol.toStringTag in arr) {
3601
- var proto = getPrototypeOf(arr);
3628
+ if (Symbol.toStringTag in arr && getProto2) {
3629
+ var proto = getProto2(arr);
3602
3630
  var descriptor = gOPD2(proto, Symbol.toStringTag);
3603
- if (!descriptor) {
3604
- var superProto = getPrototypeOf(proto);
3631
+ if (!descriptor && proto) {
3632
+ var superProto = getProto2(proto);
3605
3633
  descriptor = gOPD2(superProto, Symbol.toStringTag);
3606
3634
  }
3607
3635
  cache["$" + typedArray] = callBind2(descriptor.get);
3608
3636
  }
3609
3637
  });
3610
3638
  } else {
3611
- forEach(typedArrays, function(typedArray) {
3639
+ forEach2(typedArrays, function(typedArray) {
3612
3640
  var arr = new g[typedArray]();
3613
3641
  var fn = arr.slice || arr.set;
3614
3642
  if (fn) {
3615
- cache["$" + typedArray] = callBind2(fn);
3643
+ cache[
3644
+ /** @type {`$${import('.').TypedArrayName}`} */
3645
+ "$" + typedArray
3646
+ ] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */
3647
+ // @ts-expect-error TODO FIXME
3648
+ callBind2(fn);
3616
3649
  }
3617
3650
  });
3618
3651
  }
3619
3652
  var tryTypedArrays = function tryAllTypedArrays(value) {
3620
3653
  var found = false;
3621
- forEach(
3622
- // eslint-disable-next-line no-extra-parens
3623
- /** @type {Record<`\$${TypedArrayName}`, Getter>} */
3624
- /** @type {any} */
3654
+ forEach2(
3655
+ /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */
3625
3656
  cache,
3626
3657
  /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
3627
3658
  function(getter, typedArray) {
3628
3659
  if (!found) {
3629
3660
  try {
3630
3661
  if ("$" + getter(value) === typedArray) {
3631
- found = $slice(typedArray, 1);
3662
+ found = /** @type {import('.').TypedArrayName} */
3663
+ $slice(typedArray, 1);
3632
3664
  }
3633
3665
  } catch (e) {
3634
3666
  }
@@ -3639,17 +3671,16 @@ function requireWhichTypedArray() {
3639
3671
  };
3640
3672
  var trySlices = function tryAllSlices(value) {
3641
3673
  var found = false;
3642
- forEach(
3643
- // eslint-disable-next-line no-extra-parens
3644
- /** @type {Record<`\$${TypedArrayName}`, Getter>} */
3645
- /** @type {any} */
3674
+ forEach2(
3675
+ /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */
3646
3676
  cache,
3647
- /** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */
3677
+ /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
3648
3678
  function(getter, name) {
3649
3679
  if (!found) {
3650
3680
  try {
3651
3681
  getter(value);
3652
- found = $slice(name, 1);
3682
+ found = /** @type {import('.').TypedArrayName} */
3683
+ $slice(name, 1);
3653
3684
  } catch (e) {
3654
3685
  }
3655
3686
  }
@@ -9364,9 +9395,10 @@ class ImportedXmlComponent extends XmlComponent {
9364
9395
  return convertToXmlComponent(xmlObj);
9365
9396
  }
9366
9397
  /**
9367
- * Converts the xml string to a XmlComponent tree.
9398
+ * Creates an ImportedXmlComponent.
9368
9399
  *
9369
- * @param importedContent xml content of the imported component
9400
+ * @param rootKey the root element name
9401
+ * @param _attr optional attributes for the root element
9370
9402
  */
9371
9403
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9372
9404
  constructor(rootKey, _attr) {
@@ -9658,6 +9690,9 @@ class Border extends IgnoreIfEmptyXmlComponent {
9658
9690
  if (options.right) {
9659
9691
  this.root.push(new BorderElement("w:right", options.right));
9660
9692
  }
9693
+ if (options.between) {
9694
+ this.root.push(new BorderElement("w:between", options.between));
9695
+ }
9661
9696
  }
9662
9697
  }
9663
9698
  class ThematicBreak extends XmlComponent {
@@ -10125,8 +10160,17 @@ class RunProperties extends IgnoreIfEmptyXmlComponent {
10125
10160
  if (!options) {
10126
10161
  return;
10127
10162
  }
10128
- if (options.noProof !== void 0) {
10129
- this.push(new OnOffElement("w:noProof", options.noProof));
10163
+ if (options.style) {
10164
+ this.push(new StringValueElement("w:rStyle", options.style));
10165
+ }
10166
+ if (options.font) {
10167
+ if (typeof options.font === "string") {
10168
+ this.push(new RunFonts(options.font));
10169
+ } else if ("name" in options.font) {
10170
+ this.push(new RunFonts(options.font.name, options.font.hint));
10171
+ } else {
10172
+ this.push(new RunFonts(options.font));
10173
+ }
10130
10174
  }
10131
10175
  if (options.bold !== void 0) {
10132
10176
  this.push(new OnOffElement("w:b", options.bold));
@@ -10140,18 +10184,41 @@ class RunProperties extends IgnoreIfEmptyXmlComponent {
10140
10184
  if (options.italicsComplexScript === void 0 && options.italics !== void 0 || options.italicsComplexScript) {
10141
10185
  this.push(new OnOffElement("w:iCs", (_b = options.italicsComplexScript) != null ? _b : options.italics));
10142
10186
  }
10143
- if (options.underline) {
10144
- this.push(new Underline(options.underline.type, options.underline.color));
10187
+ if (options.smallCaps !== void 0) {
10188
+ this.push(new OnOffElement("w:smallCaps", options.smallCaps));
10189
+ } else if (options.allCaps !== void 0) {
10190
+ this.push(new OnOffElement("w:caps", options.allCaps));
10145
10191
  }
10146
- if (options.effect) {
10147
- this.push(new StringValueElement("w:effect", options.effect));
10192
+ if (options.strike !== void 0) {
10193
+ this.push(new OnOffElement("w:strike", options.strike));
10148
10194
  }
10149
- if (options.emphasisMark) {
10150
- this.push(new EmphasisMark(options.emphasisMark.type));
10195
+ if (options.doubleStrike !== void 0) {
10196
+ this.push(new OnOffElement("w:dstrike", options.doubleStrike));
10197
+ }
10198
+ if (options.emboss !== void 0) {
10199
+ this.push(new OnOffElement("w:emboss", options.emboss));
10200
+ }
10201
+ if (options.imprint !== void 0) {
10202
+ this.push(new OnOffElement("w:imprint", options.imprint));
10203
+ }
10204
+ if (options.noProof !== void 0) {
10205
+ this.push(new OnOffElement("w:noProof", options.noProof));
10206
+ }
10207
+ if (options.snapToGrid !== void 0) {
10208
+ this.push(new OnOffElement("w:snapToGrid", options.snapToGrid));
10209
+ }
10210
+ if (options.vanish) {
10211
+ this.push(new OnOffElement("w:vanish", options.vanish));
10151
10212
  }
10152
10213
  if (options.color) {
10153
10214
  this.push(new Color(options.color));
10154
10215
  }
10216
+ if (options.characterSpacing) {
10217
+ this.push(new CharacterSpacing(options.characterSpacing));
10218
+ }
10219
+ if (options.scale !== void 0) {
10220
+ this.push(new NumberValueElement("w:w", options.scale));
10221
+ }
10155
10222
  if (options.kern) {
10156
10223
  this.push(new HpsMeasureElement("w:kern", options.kern));
10157
10224
  }
@@ -10165,38 +10232,6 @@ class RunProperties extends IgnoreIfEmptyXmlComponent {
10165
10232
  if (szCs) {
10166
10233
  this.push(new HpsMeasureElement("w:szCs", szCs));
10167
10234
  }
10168
- if (options.rightToLeft !== void 0) {
10169
- this.push(new OnOffElement("w:rtl", options.rightToLeft));
10170
- }
10171
- if (options.smallCaps !== void 0) {
10172
- this.push(new OnOffElement("w:smallCaps", options.smallCaps));
10173
- } else if (options.allCaps !== void 0) {
10174
- this.push(new OnOffElement("w:caps", options.allCaps));
10175
- }
10176
- if (options.strike !== void 0) {
10177
- this.push(new OnOffElement("w:strike", options.strike));
10178
- }
10179
- if (options.doubleStrike !== void 0) {
10180
- this.push(new OnOffElement("w:dstrike", options.doubleStrike));
10181
- }
10182
- if (options.subScript) {
10183
- this.push(new SubScript());
10184
- }
10185
- if (options.superScript) {
10186
- this.push(new SuperScript());
10187
- }
10188
- if (options.style) {
10189
- this.push(new StringValueElement("w:rStyle", options.style));
10190
- }
10191
- if (options.font) {
10192
- if (typeof options.font === "string") {
10193
- this.push(new RunFonts(options.font));
10194
- } else if ("name" in options.font) {
10195
- this.push(new RunFonts(options.font.name, options.font.hint));
10196
- } else {
10197
- this.push(new RunFonts(options.font));
10198
- }
10199
- }
10200
10235
  if (options.highlight) {
10201
10236
  this.push(new Highlight(options.highlight));
10202
10237
  }
@@ -10204,42 +10239,42 @@ class RunProperties extends IgnoreIfEmptyXmlComponent {
10204
10239
  if (highlightCs) {
10205
10240
  this.push(new HighlightComplexScript(highlightCs));
10206
10241
  }
10207
- if (options.characterSpacing) {
10208
- this.push(new CharacterSpacing(options.characterSpacing));
10242
+ if (options.underline) {
10243
+ this.push(new Underline(options.underline.type, options.underline.color));
10209
10244
  }
10210
- if (options.emboss !== void 0) {
10211
- this.push(new OnOffElement("w:emboss", options.emboss));
10245
+ if (options.effect) {
10246
+ this.push(new StringValueElement("w:effect", options.effect));
10212
10247
  }
10213
- if (options.imprint !== void 0) {
10214
- this.push(new OnOffElement("w:imprint", options.imprint));
10248
+ if (options.border) {
10249
+ this.push(new BorderElement("w:bdr", options.border));
10215
10250
  }
10216
10251
  if (options.shading) {
10217
10252
  this.push(new Shading(options.shading));
10218
10253
  }
10219
- if (options.revision) {
10220
- this.push(new RunPropertiesChange(options.revision));
10221
- }
10222
- if (options.border) {
10223
- this.push(new BorderElement("w:bdr", options.border));
10224
- }
10225
- if (options.snapToGrid !== void 0) {
10226
- this.push(new OnOffElement("w:snapToGrid", options.snapToGrid));
10254
+ if (options.subScript) {
10255
+ this.push(new SubScript());
10227
10256
  }
10228
- if (options.vanish) {
10229
- this.push(new OnOffElement("w:vanish", options.vanish));
10257
+ if (options.superScript) {
10258
+ this.push(new SuperScript());
10230
10259
  }
10231
- if (options.specVanish) {
10232
- this.push(new OnOffElement("w:specVanish", options.vanish));
10260
+ if (options.rightToLeft !== void 0) {
10261
+ this.push(new OnOffElement("w:rtl", options.rightToLeft));
10233
10262
  }
10234
- if (options.scale !== void 0) {
10235
- this.push(new NumberValueElement("w:w", options.scale));
10263
+ if (options.emphasisMark) {
10264
+ this.push(new EmphasisMark(options.emphasisMark.type));
10236
10265
  }
10237
10266
  if (options.language) {
10238
10267
  this.push(createLanguageComponent(options.language));
10239
10268
  }
10269
+ if (options.specVanish) {
10270
+ this.push(new OnOffElement("w:specVanish", options.vanish));
10271
+ }
10240
10272
  if (options.math) {
10241
10273
  this.push(new OnOffElement("w:oMath", options.math));
10242
10274
  }
10275
+ if (options.revision) {
10276
+ this.push(new RunPropertiesChange(options.revision));
10277
+ }
10243
10278
  }
10244
10279
  push(item) {
10245
10280
  this.root.push(item);
@@ -12898,17 +12933,12 @@ class Drawing extends XmlComponent {
12898
12933
  }
12899
12934
  }
12900
12935
  const convertDataURIToBinary = (dataURI) => {
12901
- if (typeof atob === "function") {
12902
- const BASE64_MARKER = ";base64,";
12903
- const base64Index = dataURI.indexOf(BASE64_MARKER);
12904
- const base64IndexWithOffset = base64Index === -1 ? 0 : base64Index + BASE64_MARKER.length;
12905
- return new Uint8Array(
12906
- atob(dataURI.substring(base64IndexWithOffset)).split("").map((c) => c.charCodeAt(0))
12907
- );
12908
- } else {
12909
- const b = require("buffer");
12910
- return new b.Buffer(dataURI, "base64");
12911
- }
12936
+ const BASE64_MARKER = ";base64,";
12937
+ const base64Index = dataURI.indexOf(BASE64_MARKER);
12938
+ const base64IndexWithOffset = base64Index === -1 ? 0 : base64Index + BASE64_MARKER.length;
12939
+ return new Uint8Array(
12940
+ atob(dataURI.substring(base64IndexWithOffset)).split("").map((c) => c.charCodeAt(0))
12941
+ );
12912
12942
  };
12913
12943
  const standardizeData = (data) => typeof data === "string" ? convertDataURIToBinary(data) : data;
12914
12944
  const createImageData = (options, key) => ({
@@ -13556,6 +13586,44 @@ class BookmarkEnd extends XmlComponent {
13556
13586
  this.root.push(attributes);
13557
13587
  }
13558
13588
  }
13589
+ var NumberedItemReferenceFormat = /* @__PURE__ */ ((NumberedItemReferenceFormat2) => {
13590
+ NumberedItemReferenceFormat2["NONE"] = "none";
13591
+ NumberedItemReferenceFormat2["RELATIVE"] = "relative";
13592
+ NumberedItemReferenceFormat2["NO_CONTEXT"] = "no_context";
13593
+ NumberedItemReferenceFormat2["FULL_CONTEXT"] = "full_context";
13594
+ return NumberedItemReferenceFormat2;
13595
+ })(NumberedItemReferenceFormat || {});
13596
+ const SWITCH_MAP = {
13597
+ [
13598
+ "relative"
13599
+ /* RELATIVE */
13600
+ ]: "\\r",
13601
+ [
13602
+ "no_context"
13603
+ /* NO_CONTEXT */
13604
+ ]: "\\n",
13605
+ [
13606
+ "full_context"
13607
+ /* FULL_CONTEXT */
13608
+ ]: "\\w",
13609
+ [
13610
+ "none"
13611
+ /* NONE */
13612
+ ]: void 0
13613
+ };
13614
+ class NumberedItemReference extends SimpleField {
13615
+ constructor(bookmarkId, cachedValue, options = {}) {
13616
+ const {
13617
+ hyperlink = true,
13618
+ referenceFormat = "full_context"
13619
+ /* FULL_CONTEXT */
13620
+ } = options;
13621
+ const baseInstruction = `REF ${bookmarkId}`;
13622
+ const switches = [...hyperlink ? ["\\h"] : [], ...[SWITCH_MAP[referenceFormat]].filter((a) => !!a)];
13623
+ const instruction = `${baseInstruction} ${switches.join(" ")}`;
13624
+ super(instruction, cachedValue);
13625
+ }
13626
+ }
13559
13627
  class OutlineLevel extends XmlComponent {
13560
13628
  constructor(level) {
13561
13629
  super("w:outlineLvl");
@@ -21685,6 +21753,8 @@ exports.NoBreakHyphen = NoBreakHyphen;
21685
21753
  exports.NumberFormat = NumberFormat$1;
21686
21754
  exports.NumberProperties = NumberProperties;
21687
21755
  exports.NumberValueElement = NumberValueElement;
21756
+ exports.NumberedItemReference = NumberedItemReference;
21757
+ exports.NumberedItemReferenceFormat = NumberedItemReferenceFormat;
21688
21758
  exports.Numbering = Numbering;
21689
21759
  exports.OnOffElement = OnOffElement;
21690
21760
  exports.OutlineLevel = OutlineLevel;
package/dist/index.d.cts CHANGED
@@ -861,6 +861,7 @@ export declare type IBordersOptions = {
861
861
  readonly bottom?: IBorderOptions;
862
862
  readonly left?: IBorderOptions;
863
863
  readonly right?: IBorderOptions;
864
+ readonly between?: IBorderOptions;
864
865
  };
865
866
 
866
867
  declare type IChangedAttributesProperties = {
@@ -1315,6 +1316,11 @@ export declare class InternalHyperlink extends ConcreteHyperlink {
1315
1316
  });
1316
1317
  }
1317
1318
 
1319
+ export declare type INumberedItemReferenceOptions = {
1320
+ readonly hyperlink?: boolean;
1321
+ readonly referenceFormat?: NumberedItemReferenceFormat;
1322
+ };
1323
+
1318
1324
  export declare type INumberingOptions = {
1319
1325
  readonly config: readonly {
1320
1326
  readonly levels: readonly ILevelsOptions[];
@@ -2038,6 +2044,17 @@ export declare class NoBreakHyphen extends EmptyElement {
2038
2044
  constructor();
2039
2045
  }
2040
2046
 
2047
+ export declare class NumberedItemReference extends SimpleField {
2048
+ constructor(bookmarkId: string, cachedValue?: string, options?: INumberedItemReferenceOptions);
2049
+ }
2050
+
2051
+ export declare enum NumberedItemReferenceFormat {
2052
+ NONE = "none",
2053
+ RELATIVE = "relative",
2054
+ NO_CONTEXT = "no_context",
2055
+ FULL_CONTEXT = "full_context"
2056
+ }
2057
+
2041
2058
  export declare const NumberFormat: {
2042
2059
  readonly DECIMAL: "decimal";
2043
2060
  readonly UPPER_ROMAN: "upperRoman";
package/dist/index.d.ts CHANGED
@@ -861,6 +861,7 @@ export declare type IBordersOptions = {
861
861
  readonly bottom?: IBorderOptions;
862
862
  readonly left?: IBorderOptions;
863
863
  readonly right?: IBorderOptions;
864
+ readonly between?: IBorderOptions;
864
865
  };
865
866
 
866
867
  declare type IChangedAttributesProperties = {
@@ -1315,6 +1316,11 @@ export declare class InternalHyperlink extends ConcreteHyperlink {
1315
1316
  });
1316
1317
  }
1317
1318
 
1319
+ export declare type INumberedItemReferenceOptions = {
1320
+ readonly hyperlink?: boolean;
1321
+ readonly referenceFormat?: NumberedItemReferenceFormat;
1322
+ };
1323
+
1318
1324
  export declare type INumberingOptions = {
1319
1325
  readonly config: readonly {
1320
1326
  readonly levels: readonly ILevelsOptions[];
@@ -2038,6 +2044,17 @@ export declare class NoBreakHyphen extends EmptyElement {
2038
2044
  constructor();
2039
2045
  }
2040
2046
 
2047
+ export declare class NumberedItemReference extends SimpleField {
2048
+ constructor(bookmarkId: string, cachedValue?: string, options?: INumberedItemReferenceOptions);
2049
+ }
2050
+
2051
+ export declare enum NumberedItemReferenceFormat {
2052
+ NONE = "none",
2053
+ RELATIVE = "relative",
2054
+ NO_CONTEXT = "no_context",
2055
+ FULL_CONTEXT = "full_context"
2056
+ }
2057
+
2041
2058
  export declare const NumberFormat: {
2042
2059
  readonly DECIMAL: "decimal";
2043
2060
  readonly UPPER_ROMAN: "upperRoman";