ooxml-core 1.41.0 → 1.42.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 (126) hide show
  1. package/README.md +4 -0
  2. package/dist/PptxHandler-73QIJ6SD.cjs +14 -0
  3. package/dist/{PptxHandler-3AGIITR7.mjs → PptxHandler-A2J4PCOB.mjs} +2 -2
  4. package/dist/PptxHandler-OGLVLX2T.mjs +5 -0
  5. package/dist/{PresentationBuilder-MZBKYOYD.cjs → PresentationBuilder-6S5PJXXF.cjs} +6 -6
  6. package/dist/{PresentationBuilder-JNID4B4Z.mjs → PresentationBuilder-APJKCMVS.mjs} +2 -2
  7. package/dist/{PresentationBuilder-5DPKFUXP.mjs → PresentationBuilder-F3BWDERK.mjs} +3 -3
  8. package/dist/automation/index.cjs +75 -89
  9. package/dist/automation/index.mjs +75 -89
  10. package/dist/chart/index.cjs +5 -5
  11. package/dist/chart/index.mjs +5 -5
  12. package/dist/{chunk-LRBWCRQ3.cjs → chunk-3J6VIKLP.cjs} +3 -3
  13. package/dist/chunk-CODMW5KF.cjs +110 -0
  14. package/dist/{chunk-KKVD3R6O.mjs → chunk-CPSTCCRD.mjs} +4 -4
  15. package/dist/{chunk-P3WAKBVS.mjs → chunk-IPV3J3I5.mjs} +82 -90
  16. package/dist/{chunk-6LGRRQ3K.mjs → chunk-MXA67O7R.mjs} +1 -1
  17. package/dist/{chunk-JXR6YWBW.mjs → chunk-N6X5CJZP.mjs} +125 -126
  18. package/dist/chunk-O3YGBYGZ.mjs +104 -0
  19. package/dist/{chunk-75KBNUKS.cjs → chunk-QZPOPUI5.cjs} +82 -89
  20. package/dist/{chunk-UE23HF2N.mjs → chunk-VKFKEVHK.mjs} +1 -1
  21. package/dist/{chunk-DD7COXWR.mjs → chunk-VV724DWE.mjs} +19 -7
  22. package/dist/{chunk-HTELXT2N.mjs → chunk-XVB3CBNM.mjs} +19 -6
  23. package/dist/{chunk-3BIFRTU4.cjs → chunk-YNQRXFTC.cjs} +1283 -1270
  24. package/dist/{chunk-ZYCBJKAE.mjs → chunk-ZUEN4RQG.mjs} +1 -1
  25. package/dist/diagram/index.cjs +499 -370
  26. package/dist/diagram/index.d.ts +1 -0
  27. package/dist/diagram/index.d.ts.map +1 -1
  28. package/dist/diagram/index.mjs +495 -371
  29. package/dist/docx/embedded.cjs +67 -89
  30. package/dist/docx/embedded.mjs +67 -89
  31. package/dist/docx/index.cjs +118 -106
  32. package/dist/docx/index.mjs +118 -106
  33. package/dist/docx/layout/index.cjs +118 -106
  34. package/dist/docx/layout/index.mjs +118 -106
  35. package/dist/docx/load/index.cjs +67 -89
  36. package/dist/docx/load/index.mjs +67 -89
  37. package/dist/docx/shape-svg.d.ts.map +1 -1
  38. package/dist/docx/ui/index.cjs +72 -94
  39. package/dist/docx/ui/index.mjs +72 -94
  40. package/dist/drawingml/dash-pattern.d.ts +61 -0
  41. package/dist/drawingml/dash-pattern.d.ts.map +1 -0
  42. package/dist/drawingml/index.cjs +249 -43
  43. package/dist/drawingml/index.d.ts +3 -0
  44. package/dist/drawingml/index.d.ts.map +1 -1
  45. package/dist/drawingml/index.mjs +241 -44
  46. package/dist/drawingml/rect-path-gradient.d.ts +5 -0
  47. package/dist/drawingml/rect-path-gradient.d.ts.map +1 -1
  48. package/dist/drawingml/shape-path-gradient.d.ts +57 -0
  49. package/dist/drawingml/shape-path-gradient.d.ts.map +1 -0
  50. package/dist/geometry/index.cjs +68 -90
  51. package/dist/geometry/index.mjs +68 -90
  52. package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts +2 -2
  53. package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts.map +1 -1
  54. package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts.map +1 -1
  55. package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts.map +1 -1
  56. package/dist/index.cjs +686 -489
  57. package/dist/index.mjs +686 -489
  58. package/dist/pptx/automation/index.cjs +355 -191
  59. package/dist/pptx/automation/index.d.ts +11 -17
  60. package/dist/pptx/automation/index.d.ts.map +1 -1
  61. package/dist/pptx/automation/index.mjs +156 -71
  62. package/dist/pptx/chunks/{elements-6BMEOo7i.d.ts → elements-PBugbKtv.d.ts} +3 -873
  63. package/dist/pptx/chunks/elements-PBugbKtv.d.ts.map +1 -0
  64. package/dist/pptx/chunks/{index-BbXLv6As.d.ts → index-BJuR8GLL.d.ts} +4 -4
  65. package/dist/pptx/chunks/{index-BbXLv6As.d.ts.map → index-BJuR8GLL.d.ts.map} +1 -1
  66. package/dist/pptx/chunks/{index-DvN0TkJJ.d.ts → index-Rbvl2WaM.d.ts} +14 -10
  67. package/dist/pptx/chunks/index-Rbvl2WaM.d.ts.map +1 -0
  68. package/dist/pptx/chunks/{index-Dija_Wth.d.ts → index-xoJGYTgQ.d.ts} +5 -3
  69. package/dist/pptx/chunks/index-xoJGYTgQ.d.ts.map +1 -0
  70. package/dist/pptx/chunks/table-C7ITXL3Y.d.ts +875 -0
  71. package/dist/pptx/chunks/table-C7ITXL3Y.d.ts.map +1 -0
  72. package/dist/pptx/chunks/{text-operations-DorONr3h.d.ts → text-operations-BNJr7aGa.d.ts} +3 -2
  73. package/dist/pptx/chunks/text-operations-BNJr7aGa.d.ts.map +1 -0
  74. package/dist/pptx/cli/index.cjs +169 -96
  75. package/dist/pptx/cli/index.d.ts +1 -1
  76. package/dist/pptx/cli/index.mjs +4 -4
  77. package/dist/pptx/converter/index.cjs +69 -91
  78. package/dist/pptx/converter/index.d.ts +1 -1
  79. package/dist/pptx/converter/index.mjs +2 -2
  80. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  81. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  82. package/dist/pptx/editor/render/find-replace.cjs +15 -15
  83. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  84. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  85. package/dist/pptx/editor/render/slide-operations.cjs +9 -9
  86. package/dist/pptx/editor/render/slide-operations.mjs +3 -3
  87. package/dist/pptx/editor/render/table-data-grid-ops.cjs +5 -5
  88. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  89. package/dist/pptx/editor/render/table-layout.cjs +6 -6
  90. package/dist/pptx/editor/render/table-layout.d.ts +8 -37
  91. package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
  92. package/dist/pptx/editor/render/table-layout.mjs +1 -1
  93. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
  94. package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
  95. package/dist/pptx/index.cjs +214 -129
  96. package/dist/pptx/index.d.ts +6 -5
  97. package/dist/pptx/index.mjs +5 -5
  98. package/dist/pptx/node/index.d.ts +1 -1
  99. package/dist/teams/index.cjs +136 -91
  100. package/dist/teams/index.mjs +136 -91
  101. package/dist/text/font-metrics/design-advances.generated.d.ts +3 -1
  102. package/dist/text/font-metrics/design-advances.generated.d.ts.map +1 -1
  103. package/dist/text/index.cjs +8 -0
  104. package/dist/text/index.mjs +8 -0
  105. package/dist/visio/index.cjs +8 -0
  106. package/dist/visio/index.mjs +8 -0
  107. package/dist/visio/ui/index.cjs +8 -0
  108. package/dist/visio/ui/index.mjs +8 -0
  109. package/dist/xlsx/collab/index.cjs +67 -89
  110. package/dist/xlsx/collab/index.mjs +67 -89
  111. package/dist/xlsx/index.cjs +116 -108
  112. package/dist/xlsx/index.mjs +116 -108
  113. package/dist/xlsx/layout/shape-paint.d.ts.map +1 -1
  114. package/dist/xlsx/load/index.cjs +67 -89
  115. package/dist/xlsx/load/index.mjs +67 -89
  116. package/dist/xlsx/ui/index.cjs +72 -94
  117. package/dist/xlsx/ui/index.mjs +72 -94
  118. package/package.json +1 -1
  119. package/dist/PptxHandler-EL4E4SPH.mjs +0 -5
  120. package/dist/PptxHandler-OIZ3R3DJ.cjs +0 -14
  121. package/dist/chunk-3IT6ZD7K.mjs +0 -213
  122. package/dist/chunk-FRUB573B.cjs +0 -219
  123. package/dist/pptx/chunks/elements-6BMEOo7i.d.ts.map +0 -1
  124. package/dist/pptx/chunks/index-Dija_Wth.d.ts.map +0 -1
  125. package/dist/pptx/chunks/index-DvN0TkJJ.d.ts.map +0 -1
  126. package/dist/pptx/chunks/text-operations-DorONr3h.d.ts.map +0 -1
@@ -4347,7 +4347,7 @@ function lerpStops(a, b, t) {
4347
4347
  opacity: oa + (ob - oa) * t
4348
4348
  };
4349
4349
  }
4350
- function colorAt(stops, position2) {
4350
+ function gradientColorAt(stops, position2) {
4351
4351
  const first3 = stops[0];
4352
4352
  const last = stops[stops.length - 1];
4353
4353
  if (position2 <= first3.position) {
@@ -4402,7 +4402,7 @@ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options2) {
4402
4402
  if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
4403
4403
  for (let i = bands; i >= 0; i -= 1) {
4404
4404
  const t = i / bands;
4405
- const { color, opacity } = colorAt(sorted, t * 100);
4405
+ const { color, opacity } = gradientColorAt(sorted, t * 100);
4406
4406
  const left = lerpEdge(inner.left, 0, t);
4407
4407
  const top = lerpEdge(inner.top, 0, t);
4408
4408
  const right = lerpEdge(inner.right, 100, t);
@@ -5247,84 +5247,22 @@ var triangle = (g2, dir) => g2.poly([
5247
5247
  [D * dir, 0],
5248
5248
  [-D * dir, D]
5249
5249
  ]);
5250
- var QUESTION = [
5251
- [-4.8, -33.7],
5252
- [-6.3, -31.5],
5253
- [-7.8, -31.5],
5254
- [-12.3, -28.5],
5255
- [-14.5, -28.5],
5256
- [-15.3, -27.7],
5257
- [-15.3, -25.5],
5258
- [-18.3, -21],
5259
- [-19, -17.2],
5260
- [-20.5, -16.5],
5261
- [-20.5, -12.7],
5262
- [-19, -12.7],
5263
- [-18.3, -14.2],
5264
- [-10.8, -14.2],
5265
- [-10, -13.5],
5266
- [-8.5, -13.5],
5267
- [-9.3, -17.2],
5268
- [-7.8, -19.5],
5269
- [-4, -22.5],
5270
- [-3.3, -21.7],
5271
- [-1.8, -21.7],
5272
- [-1, -23.2],
5273
- [0.5, -23.2],
5274
- [1.2, -21.7],
5275
- [2.7, -21.7],
5276
- [3.5, -22.5],
5277
- [8, -18.7],
5278
- [8.7, -17.2],
5279
- [8, -16.5],
5280
- [8, -15],
5281
- [9.5, -14.2],
5282
- [9.5, -13.5],
5283
- [8, -12.7],
5284
- [8.7, -9.7],
5285
- [5, -6],
5286
- [2, -6],
5287
- [-2.5, -2.2],
5288
- [-3.3, 0.8],
5289
- [-5.5, 2.3],
5290
- [-4.8, 6.8],
5291
- [-6.3, 7.5],
5292
- [-6.3, 18],
5293
- [-4.8, 18],
5294
- [-4, 17.3],
5295
- [4.2, 17.3],
5296
- [4.2, 6.8],
5297
- [6.5, 5.3],
5298
- [6.5, 3.8],
5299
- [8, 3],
5300
- [8, 1.5],
5301
- [8.7, 0.8],
5302
- [13.2, 0],
5303
- [17, -4.5],
5304
- [18.5, -4.5],
5305
- [18.5, -6],
5306
- [17.7, -6.7],
5307
- [18.5, -8.2],
5308
- [18.5, -15],
5309
- [20, -15.7],
5310
- [20, -18],
5311
- [17.7, -19.5],
5312
- [17.7, -21],
5313
- [15.5, -24.7],
5314
- [15.5, -27],
5315
- [14, -27],
5316
- [13.2, -27.7],
5317
- [13.2, -29.2],
5318
- [9.5, -30],
5319
- [8.7, -30.7],
5320
- [8.7, -32.2],
5321
- [5.7, -31.5],
5322
- [4.2, -33.7],
5323
- [2.7, -33.7],
5324
- [2, -32.2],
5325
- [-2.5, -32.2],
5326
- [-3.3, -33.7]
5327
- ];
5250
+ var U = 90;
5251
+ var question = (g2) => {
5252
+ const x = (v) => g2.x(v * U);
5253
+ const y = (v) => g2.y(v * U);
5254
+ const r = (v) => g2.len(v * U);
5255
+ return [
5256
+ `M ${x(-0.214)} ${y(-0.162)} A ${r(0.214)} ${r(0.2125)} 10800000 10800000`,
5257
+ `A ${r(0.108)} ${r(0.162)} 0 5400000`,
5258
+ `A ${r(0.053)} ${r(0.085)} 16200000 -5400000`,
5259
+ `L ${x(0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.08)}`,
5260
+ `A ${r(0.108)} ${r(0.16)} 10800000 5400000`,
5261
+ `A ${r(0.052)} ${r(0.082)} 5400000 -5400000`,
5262
+ `A ${r(0.107)} ${r(0.1065)} 0 -10800000`,
5263
+ `L ${x(-0.214)} ${y(-0.162)} Z`
5264
+ ].join(" ");
5265
+ };
5328
5266
  var MOVIE = [
5329
5267
  [-33.75, -16.5],
5330
5268
  [-33.75, -3],
@@ -5431,8 +5369,8 @@ var buttons = {
5431
5369
  )
5432
5370
  ]),
5433
5371
  actionButtonHelp: build("actionButtonHelp", (g2) => [
5434
- darken(g2.poly(QUESTION)),
5435
- darken(g2.circle(-0.2, 27.4, 7))
5372
+ darken(question(g2)),
5373
+ darken(g2.circle(0, 0.295 * U, 0.08 * U))
5436
5374
  ]),
5437
5375
  actionButtonInformation: build("actionButtonInformation", (g2) => [
5438
5376
  darken(g2.circle(0, 0.4, 34)),
@@ -8755,12 +8693,46 @@ var leftRightUpArrow2 = exactDef(
8755
8693
  )
8756
8694
  ]
8757
8695
  );
8696
+ var swooshArrow3 = exactDef(
8697
+ "swooshArrow",
8698
+ { adj1: 25e3, adj2: 16667 },
8699
+ [
8700
+ "a1 pin 1 adj1 75000",
8701
+ "maxAdj2 */ 70000 w ss",
8702
+ "a2 pin 0 adj2 maxAdj2",
8703
+ "ad1 */ h a1 100000",
8704
+ "ad2 */ ss a2 100000",
8705
+ "xB +- r 0 ad2",
8706
+ "yB +- t ssd8 0",
8707
+ "alfa */ cd4 1 14",
8708
+ "dx0 tan ssd8 alfa",
8709
+ "xC +- xB 0 dx0",
8710
+ "dx1 tan ad1 alfa",
8711
+ "yF +- yB ad1 0",
8712
+ "xF +- xB dx1 0",
8713
+ "xE +- xF dx0 0",
8714
+ "yE +- yF ssd8 0",
8715
+ "dy2 +- yE 0 t",
8716
+ "dy22 */ dy2 1 2",
8717
+ "dy3 */ h 1 20",
8718
+ "yD +- dy22 0 dy3",
8719
+ "dy4 */ hd6 1 1",
8720
+ "yP1 +- hd6 dy4 0",
8721
+ "xP1 val wd6",
8722
+ "dy5 */ hd6 1 2",
8723
+ "yP2 +- yF dy5 0",
8724
+ "xP2 val wd4"
8725
+ ],
8726
+ "l t r b",
8727
+ [p("M l b Q xP1 yP1 xB yB L xC t L r yD L xE yE L xF yF Q xP2 yP2 l b Z")]
8728
+ );
8758
8729
  var EXACT_ARROW_PRESET_DEFINITIONS = {
8759
8730
  leftRightArrow: leftRightArrow2,
8760
8731
  upDownArrow: upDownArrow2,
8761
8732
  quadArrow: quadArrow2,
8762
8733
  leftUpArrow: leftUpArrow2,
8763
- leftRightUpArrow: leftRightUpArrow2
8734
+ leftRightUpArrow: leftRightUpArrow2,
8735
+ swooshArrow: swooshArrow3
8764
8736
  };
8765
8737
 
8766
8738
  // geometry/preset-shape-definitions-exact-circular.ts
@@ -9566,10 +9538,13 @@ var verticalScroll = exactDef(
9566
9538
  p(
9567
9539
  "M ch ch2 A ch2 ch2 10800000 5400000 L x6 t A ch2 ch2 16200000 10800000 L x4 ch L x4 y4 A ch2 ch2 0 5400000 L ch2 b A ch2 ch2 5400000 10800000 L ch y3 Z"
9568
9540
  ),
9569
- p("M l y4 A ch2 ch2 10800000 21600000 Z M xsw cy3 A ch4 ch4 0 21600000 Z", {
9570
- fill: "darkenLess",
9571
- stroke: false
9572
- }),
9541
+ p(
9542
+ "M ch y4 A ch2 ch2 0 5400000 A ch2 ch2 5400000 10800000 A ch4 ch4 16200000 10800000 Z M x3b ch2 A ch2 ch2 0 5400000 A ch4 ch4 5400000 10800000 Z",
9543
+ {
9544
+ fill: "darkenLess",
9545
+ stroke: false
9546
+ }
9547
+ ),
9573
9548
  p(
9574
9549
  "M x3 t A ch2 ch2 16200000 10800000 L x4 ch M ch2 y4 L ch y4 M x3b ch2 L x3 ch2 A ch4 ch4 16200000 -10800000",
9575
9550
  { fill: "none" }
@@ -9585,10 +9560,13 @@ var horizontalScroll = exactDef(
9585
9560
  p(
9586
9561
  "M ch2 ch A ch2 ch2 16200000 -5400000 L l x6 A ch2 ch2 10800000 -10800000 L ch x4 L y4 x4 A ch2 ch2 5400000 -5400000 L r ch2 A ch2 ch2 0 -10800000 L y3 ch Z"
9587
9562
  ),
9588
- p("M y4 t A ch2 ch2 16200000 21600000 Z M ch cyw A ch4 ch4 0 21600000 Z", {
9589
- fill: "darkenLess",
9590
- stroke: false
9591
- }),
9563
+ p(
9564
+ "M y4 ch A ch2 ch2 5400000 -5400000 A ch2 ch2 0 -10800000 A ch4 ch4 10800000 -10800000 Z M ch2 x3b A ch2 ch2 5400000 -5400000 A ch4 ch4 0 -10800000 Z",
9565
+ {
9566
+ fill: "darkenLess",
9567
+ stroke: false
9568
+ }
9569
+ ),
9592
9570
  p(
9593
9571
  "M l x3 A ch2 ch2 10800000 -10800000 L ch x4 M y4 ch2 L y4 ch M ch2 x3b L ch2 x3 A ch4 ch4 10800000 10800000",
9594
9572
  { fill: "none" }
@@ -28698,7 +28676,7 @@ function radarSvg(model, area) {
28698
28676
  }
28699
28677
 
28700
28678
  // chart/render/chart-svg-hierarchy.ts
28701
- var colorAt2 = (model, index) => {
28679
+ var colorAt = (model, index) => {
28702
28680
  const first3 = model.series[0];
28703
28681
  const colors = first3?.pointColors;
28704
28682
  return (colors && colors.length > 0 ? colors[index % colors.length] : void 0) ?? first3?.color ?? "#4472C4";
@@ -28727,7 +28705,7 @@ function treemapSvg(model, area) {
28727
28705
  }
28728
28706
  out.push(`<g data-chart-series="${cell.seriesIndex}" data-chart-point="${cell.pointIndex}">`);
28729
28707
  out.push(
28730
- rect2(cell.x, cell.y, cell.w, cell.h, colorAt2(model, cell.colorIndex)).replace(
28708
+ rect2(cell.x, cell.y, cell.w, cell.h, colorAt(model, cell.colorIndex)).replace(
28731
28709
  "/>",
28732
28710
  ' rx="2"/>'
28733
28711
  )
@@ -28766,7 +28744,7 @@ function sunburstSvg(model, area) {
28766
28744
  );
28767
28745
  for (const arc3 of arcs)
28768
28746
  out.push(
28769
- `<path d="${arc3.d}" fill="${colorAt2(model, arc3.colorIndex)}" stroke="#FFFFFF" stroke-width="1.5"${arc3.pointIndex === void 0 ? "" : ` data-chart-series="0" data-chart-point="${arc3.pointIndex}"`}/>`
28747
+ `<path d="${arc3.d}" fill="${colorAt(model, arc3.colorIndex)}" stroke="#FFFFFF" stroke-width="1.5"${arc3.pointIndex === void 0 ? "" : ` data-chart-series="0" data-chart-point="${arc3.pointIndex}"`}/>`
28770
28748
  );
28771
28749
  const flatLabels = levels.length > 1 || model.series.length !== 1 ? void 0 : model.categories;
28772
28750
  for (const arc3 of model.hierarchy?.labels === false ? [] : arcs) {
@@ -0,0 +1,61 @@
1
+ /**
2
+ * PowerPoint's dash patterns, measured from its own 1280x720 exports.
3
+ *
4
+ * Every preset is a fixed run of (dash, gap) lengths in units of the pen width:
5
+ *
6
+ * | preset | dash, gap, ... |
7
+ * | --------------------------- | ---------------------------------- |
8
+ * | `dash` | 4 3 |
9
+ * | `dot` | 1 3 |
10
+ * | `lgDash` | 8 3 |
11
+ * | `dashDot` | 4 3 1 3 |
12
+ * | `lgDashDot` | 8 3 1 3 |
13
+ * | `lgDashDotDot` | 8 3 1 3 1 3 |
14
+ * | `sysDash` | 3 1 |
15
+ * | `sysDot` | 1 1 |
16
+ * | `sysDashDot` | 3 1 1 1 |
17
+ * | `sysDashDotDot` | 3 1 1 1 1 1 |
18
+ * | `custDash` (`a:ds d sp`) | d, sp in 1000ths of a percent |
19
+ *
20
+ * Three behaviours the numbers alone do not say:
21
+ *
22
+ * - The unit is the pen width rounded to WHOLE device pixels (at least one),
23
+ * the same rounding the line itself gets: at 1280 px a 2 pt line (2.67 px)
24
+ * dashes as a 3 px pen, 1 pt (1.33 px) as 1 px. See {@link dashPenWidth}.
25
+ * - The pattern starts at the first point of the path with a dash.
26
+ * - Caps are part of the dash, not added to it. A `rnd` dash is the pattern's
27
+ * dash length INCLUDING its round ends (a `dot` is a circle one pen wide and
28
+ * the period is unchanged), and `sq` adds nothing to interior dashes: they
29
+ * are the flat dashes, only the line's own ends overshoot. SVG draws a cap
30
+ * on top of the dash, so {@link capCompensatedDashArray} shortens round dashes
31
+ * by one pen width, and the stroke uses a `butt` cap for dashed square lines
32
+ * (`svgLineCap(cap, true)`).
33
+ *
34
+ * Pure and framework-agnostic.
35
+ *
36
+ * @module render/dash-pattern
37
+ */
38
+ /** A `custDash` segment: lengths in 1000ths of a percent of the line width. */
39
+ export interface DashSegmentInput {
40
+ dash: number;
41
+ space: number;
42
+ }
43
+ /**
44
+ * The pen width dash lengths scale with: the stroke width rounded to whole
45
+ * pixels, at least one (ties round down: 4.5 px dashes as 4 px, measured).
46
+ */
47
+ export declare function dashPenWidth(strokeWidth: number): number;
48
+ /**
49
+ * The dash pattern of a preset or custom dash in pen widths, or `undefined` for
50
+ * a solid line.
51
+ */
52
+ export declare function dashPatternUnits(dashType: string | undefined, customSegments?: ReadonlyArray<DashSegmentInput>): readonly number[] | undefined;
53
+ /** Whether an `a:ln` dash token paints a dashed (not solid) line. */
54
+ export declare function isDashedStroke(dashType: string | undefined): boolean;
55
+ /**
56
+ * The SVG dash array (user units) for a pattern at a stroke width. With a
57
+ * `rnd` cap each dash gives up one pen width to its two round ends, and the gap
58
+ * gains it back, so dots and dashes land where PowerPoint puts them.
59
+ */
60
+ export declare function capCompensatedDashArray(pattern: readonly number[], strokeWidth: number, lineCap?: 'flat' | 'rnd' | 'sq'): string;
61
+ //# sourceMappingURL=dash-pattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dash-pattern.d.ts","sourceRoot":"","sources":["../../drawingml/dash-pattern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAgBH,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACd;AAQD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,cAAc,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,GAC9C,SAAS,MAAM,EAAE,GAAG,SAAS,CAU/B;AAED,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,GAC7B,MAAM,CAiBR"}