ooxml-core 1.48.0 → 1.48.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.
Files changed (208) hide show
  1. package/dist/pptx/automation/index.d.ts +5 -12
  2. package/dist/pptx/automation/index.d.ts.map +1 -1
  3. package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts +1 -1
  4. package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts.map +1 -1
  5. package/dist/pptx/automation/schemas/chart-schemas.d.ts +1 -1
  6. package/dist/pptx/automation/schemas/chart-schemas.d.ts.map +1 -1
  7. package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts +1 -1
  8. package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts.map +1 -1
  9. package/dist/pptx/automation/schemas/element-schemas.d.ts +1 -1
  10. package/dist/pptx/automation/schemas/element-schemas.d.ts.map +1 -1
  11. package/dist/pptx/automation/schemas/export-schemas.d.ts +1 -1
  12. package/dist/pptx/automation/schemas/export-schemas.d.ts.map +1 -1
  13. package/dist/pptx/automation/schemas/geometry-schemas.d.ts +1 -1
  14. package/dist/pptx/automation/schemas/geometry-schemas.d.ts.map +1 -1
  15. package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts +1 -1
  16. package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts.map +1 -1
  17. package/dist/pptx/automation/schemas/index.d.ts +8 -8
  18. package/dist/pptx/automation/schemas/index.d.ts.map +1 -1
  19. package/dist/pptx/automation/schemas/json-schemas.d.ts +1 -1
  20. package/dist/pptx/automation/schemas/json-schemas.d.ts.map +1 -1
  21. package/dist/pptx/automation/schemas/layout-schemas.d.ts +1 -1
  22. package/dist/pptx/automation/schemas/layout-schemas.d.ts.map +1 -1
  23. package/dist/pptx/automation/schemas/lock-schemas.d.ts +1 -1
  24. package/dist/pptx/automation/schemas/lock-schemas.d.ts.map +1 -1
  25. package/dist/pptx/automation/schemas/metadata-schemas.d.ts +1 -1
  26. package/dist/pptx/automation/schemas/metadata-schemas.d.ts.map +1 -1
  27. package/dist/pptx/automation/schemas/ole-schemas.d.ts +1 -1
  28. package/dist/pptx/automation/schemas/ole-schemas.d.ts.map +1 -1
  29. package/dist/pptx/automation/schemas/presentation-schemas.d.ts +1 -1
  30. package/dist/pptx/automation/schemas/presentation-schemas.d.ts.map +1 -1
  31. package/dist/pptx/automation/schemas/section-schemas.d.ts +1 -1
  32. package/dist/pptx/automation/schemas/section-schemas.d.ts.map +1 -1
  33. package/dist/pptx/automation/schemas/slide-schemas.d.ts +1 -1
  34. package/dist/pptx/automation/schemas/slide-schemas.d.ts.map +1 -1
  35. package/dist/pptx/automation/schemas/smartart-schemas.d.ts +1 -1
  36. package/dist/pptx/automation/schemas/smartart-schemas.d.ts.map +1 -1
  37. package/dist/pptx/automation/schemas/table-style-schemas.d.ts +1 -1
  38. package/dist/pptx/automation/schemas/table-style-schemas.d.ts.map +1 -1
  39. package/dist/pptx/automation/schemas/template-schemas.d.ts +1 -1
  40. package/dist/pptx/automation/schemas/template-schemas.d.ts.map +1 -1
  41. package/dist/pptx/automation/schemas/theme-schemas.d.ts +1 -1
  42. package/dist/pptx/automation/schemas/theme-schemas.d.ts.map +1 -1
  43. package/dist/pptx/automation/schemas/validation-schemas.d.ts +1 -1
  44. package/dist/pptx/automation/schemas/validation-schemas.d.ts.map +1 -1
  45. package/dist/pptx/chunks/color-primitives-DHyz14D9.d.ts +151 -0
  46. package/dist/pptx/chunks/color-primitives-DHyz14D9.d.ts.map +1 -0
  47. package/dist/pptx/chunks/{index-ClHCBGOf.d.ts → index-7tA9HqRL.d.ts} +10057 -1222
  48. package/dist/pptx/chunks/index-7tA9HqRL.d.ts.map +1 -0
  49. package/dist/pptx/chunks/{index-DqkBjVqR.d.ts → index-CAzt1jbx.d.ts} +4 -5
  50. package/dist/pptx/chunks/index-CAzt1jbx.d.ts.map +1 -0
  51. package/dist/pptx/chunks/{schemas-LHsDbVOw.d.ts → index-CyAgQ2zG.d.ts} +6 -2
  52. package/dist/pptx/chunks/index-CyAgQ2zG.d.ts.map +1 -0
  53. package/dist/pptx/chunks/index-cJSPBkU1.d.ts +185 -0
  54. package/dist/pptx/chunks/index-cJSPBkU1.d.ts.map +1 -0
  55. package/dist/pptx/chunks/index-cr_sgz1w.d.ts +94 -0
  56. package/dist/pptx/chunks/index-cr_sgz1w.d.ts.map +1 -0
  57. package/dist/pptx/chunks/presentation-Be108jrz.d.ts +12521 -0
  58. package/dist/pptx/chunks/presentation-Be108jrz.d.ts.map +1 -0
  59. package/dist/pptx/chunks/{inspection-status-TKac7eqb.d.ts → signature-inspection-status-TKac7eqb.d.ts} +1 -1
  60. package/dist/pptx/chunks/signature-inspection-status-TKac7eqb.d.ts.map +1 -0
  61. package/dist/pptx/chunks/text-operations-a1cqBYk9.d.ts +111 -0
  62. package/dist/pptx/chunks/text-operations-a1cqBYk9.d.ts.map +1 -0
  63. package/dist/pptx/cli/index.d.ts +17 -1
  64. package/dist/pptx/cli/index.d.ts.map +1 -1
  65. package/dist/pptx/converter/index.d.ts +1 -1
  66. package/dist/pptx/editor/ai/table-merge.d.ts +16 -0
  67. package/dist/pptx/editor/ai/table-merge.d.ts.map +1 -1
  68. package/dist/pptx/editor/loader/element-patch-walker.d.ts +15 -0
  69. package/dist/pptx/editor/loader/element-patch-walker.d.ts.map +1 -1
  70. package/dist/pptx/editor/loader/lazy-image-resolution.d.ts +15 -0
  71. package/dist/pptx/editor/loader/lazy-image-resolution.d.ts.map +1 -1
  72. package/dist/pptx/editor/loader/load-content-helpers.d.ts +7 -0
  73. package/dist/pptx/editor/loader/load-content-helpers.d.ts.map +1 -1
  74. package/dist/pptx/editor/loader/table-style-image-paths.d.ts +20 -0
  75. package/dist/pptx/editor/loader/table-style-image-paths.d.ts.map +1 -1
  76. package/dist/pptx/editor/loader/text-fill-image-paths.d.ts +19 -0
  77. package/dist/pptx/editor/loader/text-fill-image-paths.d.ts.map +1 -1
  78. package/dist/pptx/editor/render/bullet-autonum.d.ts +14 -0
  79. package/dist/pptx/editor/render/bullet-list.d.ts +8 -0
  80. package/dist/pptx/editor/render/bullet-list.d.ts.map +1 -1
  81. package/dist/pptx/editor/render/bullet-toggle.d.ts +4 -0
  82. package/dist/pptx/editor/render/bullet-toggle.d.ts.map +1 -1
  83. package/dist/pptx/editor/render/chart-user-shape-edit.d.ts +12 -0
  84. package/dist/pptx/editor/render/chart-user-shape-edit.d.ts.map +1 -1
  85. package/dist/pptx/editor/render/clone.d.ts +20 -0
  86. package/dist/pptx/editor/render/clone.d.ts.map +1 -1
  87. package/dist/pptx/editor/render/collaboration-assets.d.ts +17 -0
  88. package/dist/pptx/editor/render/collaboration-live-patch-target.d.ts +9 -0
  89. package/dist/pptx/editor/render/collaboration-live-patch-target.d.ts.map +1 -1
  90. package/dist/pptx/editor/render/collaboration-reconcile.d.ts +21 -0
  91. package/dist/pptx/editor/render/collaboration-reconcile.d.ts.map +1 -1
  92. package/dist/pptx/editor/render/collaboration-sync.d.ts +32 -4
  93. package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
  94. package/dist/pptx/editor/render/collaboration-text-codec.d.ts +33 -2
  95. package/dist/pptx/editor/render/collaboration-text-codec.d.ts.map +1 -0
  96. package/dist/pptx/editor/render/collaboration-text-merge.d.ts +36 -2
  97. package/dist/pptx/editor/render/collaboration-text-merge.d.ts.map +1 -0
  98. package/dist/pptx/editor/render/collaboration-text-native-edit.d.ts +2 -2
  99. package/dist/pptx/editor/render/collaboration-text-positions.d.ts +34 -2
  100. package/dist/pptx/editor/render/collaboration-text-positions.d.ts.map +1 -0
  101. package/dist/pptx/editor/render/collaboration-text-projection.d.ts +1 -1
  102. package/dist/pptx/editor/render/collaboration-text-session-apply.d.ts +3 -3
  103. package/dist/pptx/editor/render/collaboration-text-session-delta.d.ts +36 -2
  104. package/dist/pptx/editor/render/collaboration-text-session-delta.d.ts.map +1 -0
  105. package/dist/pptx/editor/render/collaboration-text-session-paragraph.d.ts +1 -1
  106. package/dist/pptx/editor/render/collaboration-text-session.d.ts +40 -2
  107. package/dist/pptx/editor/render/collaboration-text-session.d.ts.map +1 -0
  108. package/dist/pptx/editor/render/collaboration-text-snapshot-positions.d.ts +2 -2
  109. package/dist/pptx/editor/render/custom-show-operations.d.ts +14 -0
  110. package/dist/pptx/editor/render/custom-show-operations.d.ts.map +1 -1
  111. package/dist/pptx/editor/render/deck-save-encryption.d.ts +24 -0
  112. package/dist/pptx/editor/render/deck-save-encryption.d.ts.map +1 -1
  113. package/dist/pptx/editor/render/element-locks.d.ts +25 -0
  114. package/dist/pptx/editor/render/element-locks.d.ts.map +1 -1
  115. package/dist/pptx/editor/render/element-operations.d.ts +11 -0
  116. package/dist/pptx/editor/render/element-operations.d.ts.map +1 -1
  117. package/dist/pptx/editor/render/element.d.ts +12 -0
  118. package/dist/pptx/editor/render/element.d.ts.map +1 -1
  119. package/dist/pptx/editor/render/find-replace.d.ts +8 -2
  120. package/dist/pptx/editor/render/find-replace.d.ts.map +1 -1
  121. package/dist/pptx/editor/render/font-family-update.d.ts +32 -1
  122. package/dist/pptx/editor/render/font-family-update.d.ts.map +1 -1
  123. package/dist/pptx/editor/render/group-drill.d.ts +26 -0
  124. package/dist/pptx/editor/render/group-drill.d.ts.map +1 -1
  125. package/dist/pptx/editor/render/group-ops.d.ts +24 -0
  126. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +21 -1
  127. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts.map +1 -1
  128. package/dist/pptx/editor/render/remap-text.d.ts +5 -0
  129. package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
  130. package/dist/pptx/editor/render/section-operations.d.ts +14 -0
  131. package/dist/pptx/editor/render/section-operations.d.ts.map +1 -1
  132. package/dist/pptx/editor/render/slide-background-patch.d.ts +15 -0
  133. package/dist/pptx/editor/render/slide-background-patch.d.ts.map +1 -1
  134. package/dist/pptx/editor/render/slide-operations.d.ts +12 -0
  135. package/dist/pptx/editor/render/slide-operations.d.ts.map +1 -1
  136. package/dist/pptx/editor/render/slide-search.d.ts +6 -0
  137. package/dist/pptx/editor/render/slide-search.d.ts.map +1 -1
  138. package/dist/pptx/editor/render/slide-size-rescale.d.ts +18 -0
  139. package/dist/pptx/editor/render/slide-size-rescale.d.ts.map +1 -1
  140. package/dist/pptx/editor/render/slide-transition-edits.d.ts +15 -0
  141. package/dist/pptx/editor/render/slide-transition-edits.d.ts.map +1 -1
  142. package/dist/pptx/editor/render/table-cell-edit.d.ts +8 -0
  143. package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
  144. package/dist/pptx/editor/render/table-cell-merge.d.ts +15 -0
  145. package/dist/pptx/editor/render/table-cell-merge.d.ts.map +1 -1
  146. package/dist/pptx/editor/render/table-data-grid-ops.d.ts +26 -0
  147. package/dist/pptx/editor/render/table-data-grid-ops.d.ts.map +1 -1
  148. package/dist/pptx/editor/render/table-layout.d.ts +3 -1
  149. package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
  150. package/dist/pptx/editor/render/table-merge.d.ts +16 -0
  151. package/dist/pptx/editor/render/table-merge.d.ts.map +1 -1
  152. package/dist/pptx/editor/render/table-style-editor-descriptor.d.ts +13 -0
  153. package/dist/pptx/editor/render/table-style-editor-descriptor.d.ts.map +1 -1
  154. package/dist/pptx/editor/render/table-style-editor-edit.d.ts +13 -0
  155. package/dist/pptx/editor/render/table-style-editor-edit.d.ts.map +1 -1
  156. package/dist/pptx/editor/render/table-style-editor-parts.d.ts +10 -0
  157. package/dist/pptx/editor/render/table-style-editor-parts.d.ts.map +1 -1
  158. package/dist/pptx/editor/render/table-style-map-edits.d.ts +20 -0
  159. package/dist/pptx/editor/render/table-style-map-edits.d.ts.map +1 -1
  160. package/dist/pptx/editor/render/text-content-style.d.ts +2 -1
  161. package/dist/pptx/editor/render/text-content-style.d.ts.map +1 -1
  162. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +2 -2
  163. package/dist/pptx/editor/render/text-segment-paragraph-break.d.ts +23 -0
  164. package/dist/pptx/editor/render/text-segment-paragraph-break.d.ts.map +1 -1
  165. package/dist/pptx/editor/render/text-style-scope.d.ts +20 -2
  166. package/dist/pptx/editor/render/text-style-scope.d.ts.map +1 -1
  167. package/dist/pptx/editor/render/text-theme.d.ts +11 -0
  168. package/dist/pptx/editor/render/text-theme.d.ts.map +1 -1
  169. package/dist/pptx/editor/render/theme-editor-presets.d.ts +9 -0
  170. package/dist/pptx/editor/render/theme-editor-presets.d.ts.map +1 -1
  171. package/dist/pptx/editor/render/update-text-segment-style.d.ts +2 -1
  172. package/dist/pptx/editor/render/update-text-segment-style.d.ts.map +1 -1
  173. package/dist/pptx/index.d.ts +23 -9
  174. package/dist/pptx/node/index.d.ts +17 -1
  175. package/dist/pptx/node/index.d.ts.map +1 -1
  176. package/dist/pptx/signature-node/index.d.ts +8 -1
  177. package/dist/pptx/signature-node/index.d.ts.map +1 -1
  178. package/dist/pptx/smartart-layouts/index.d.ts +8 -1
  179. package/dist/pptx/smartart-layouts/index.d.ts.map +1 -1
  180. package/dist/pptx/ui/index.d.ts +2 -0
  181. package/dist/pptx/ui/index.d.ts.map +1 -1
  182. package/package.json +8 -8
  183. package/dist/pptx/chunks/collaboration-text-codec-1VmwD3yq.d.ts +0 -34
  184. package/dist/pptx/chunks/collaboration-text-codec-1VmwD3yq.d.ts.map +0 -1
  185. package/dist/pptx/chunks/collaboration-text-merge-B-tth-0W.d.ts +0 -19
  186. package/dist/pptx/chunks/collaboration-text-merge-B-tth-0W.d.ts.map +0 -1
  187. package/dist/pptx/chunks/collaboration-text-positions-D-1Jo1Fz.d.ts +0 -34
  188. package/dist/pptx/chunks/collaboration-text-positions-D-1Jo1Fz.d.ts.map +0 -1
  189. package/dist/pptx/chunks/collaboration-text-session-CWHTaWF4.d.ts +0 -41
  190. package/dist/pptx/chunks/collaboration-text-session-CWHTaWF4.d.ts.map +0 -1
  191. package/dist/pptx/chunks/collaboration-text-session-delta-Dxzybssp.d.ts +0 -37
  192. package/dist/pptx/chunks/collaboration-text-session-delta-Dxzybssp.d.ts.map +0 -1
  193. package/dist/pptx/chunks/elements-CValElsy.d.ts +0 -3568
  194. package/dist/pptx/chunks/elements-CValElsy.d.ts.map +0 -1
  195. package/dist/pptx/chunks/index-BaBgJR8i.d.ts +0 -9913
  196. package/dist/pptx/chunks/index-BaBgJR8i.d.ts.map +0 -1
  197. package/dist/pptx/chunks/index-ClHCBGOf.d.ts.map +0 -1
  198. package/dist/pptx/chunks/index-DqkBjVqR.d.ts.map +0 -1
  199. package/dist/pptx/chunks/inspection-status-TKac7eqb.d.ts.map +0 -1
  200. package/dist/pptx/chunks/schemas-LHsDbVOw.d.ts.map +0 -1
  201. package/dist/pptx/chunks/smart-art-DB37AsFP.d.ts +0 -1817
  202. package/dist/pptx/chunks/smart-art-DB37AsFP.d.ts.map +0 -1
  203. package/dist/pptx/chunks/table-DUO1H9-r.d.ts +0 -1798
  204. package/dist/pptx/chunks/table-DUO1H9-r.d.ts.map +0 -1
  205. package/dist/pptx/chunks/text-operations-B3lZjvs_.d.ts +0 -3363
  206. package/dist/pptx/chunks/text-operations-B3lZjvs_.d.ts.map +0 -1
  207. package/dist/pptx/chunks/text-t_wJ2OwM.d.ts +0 -1452
  208. package/dist/pptx/chunks/text-t_wJ2OwM.d.ts.map +0 -1
@@ -1,1798 +0,0 @@
1
- import { C as ConnectorConnectionPoint, D as StrokeDashType, E as ShadowEffect, S as ConnectorArrowType, i as TextStyle, k as XmlObject, l as EffectDagContainer, v as Pptx3DShape, x as DrawingScene3D } from "./text-t_wJ2OwM.js";
2
- import { t as PptxThemeColorRef } from "./color-ref-CwUQoKPJ.js";
3
- /**
4
- * Image recolour/adjustment properties parsed from blip extensions.
5
- *
6
- * These effects are stored in the OpenXML `<a:blip>` extension list
7
- * and applied non-destructively to the original image data.
8
- *
9
- * @example
10
- * ```ts
11
- * const fx: PptxImageEffects = {
12
- * brightness: 20,
13
- * contrast: -10,
14
- * grayscale: true,
15
- * };
16
- * // => { brightness: 20, contrast: -10, grayscale: true } satisfies PptxImageEffects
17
- * ```
18
- */
19
- /**
20
- * One `a14:foregroundMark` / `a14:backgroundMark` polyline hint recorded while
21
- * the user painted over the picture in PowerPoint's "Remove Background" mode.
22
- * Coordinates are 0..1 fractions of the image.
23
- */
24
- interface PptxBackgroundRemovalMark {
25
- x1: number;
26
- y1: number;
27
- x2: number;
28
- y2: number;
29
- }
30
- /**
31
- * PowerPoint "Remove Background" state (`a14:backgroundRemoval`).
32
- *
33
- * The four edges are the RETAINED rectangle as 0..1 fractions of the image
34
- * (OOXML stores them as per-100000 relative units), and the mark lists are the
35
- * segmentation hints the user painted.
36
- *
37
- * **This is edit-time metadata, not a render instruction.** PowerPoint bakes the
38
- * removal into the bitmap referenced by the main `a:blip/@r:embed` and keeps the
39
- * pristine original in `a14:imgLayer/@r:embed`. Verified against PowerPoint COM:
40
- * a slide exported with and without this element is byte-identical. A renderer
41
- * that clips to the retained rectangle would clip an image whose background has
42
- * already been removed.
43
- *
44
- * @example
45
- * ```ts
46
- * const removal: PptxBackgroundRemoval = { top: 0.12, bottom: 0.88, left: 0.07, right: 0.93 };
47
- * // => retains the middle of the image; the marks list stays empty
48
- * ```
49
- */
50
- /**
51
- * Snapshot of the a14 Corrections / Color panel values as they were read from
52
- * the file, kept on {@link PptxImageEffects.prerenderedCorrections} so a
53
- * renderer can tell a baked-in value from one changed in this library.
54
- */
55
- interface PptxImagePrerenderedCorrections {
56
- sharpenSoften?: {
57
- amount: number;
58
- };
59
- brightnessContrast?: {
60
- bright?: number;
61
- contrast?: number;
62
- };
63
- colorTemperature?: {
64
- colorTemp: number;
65
- };
66
- colorSaturation?: {
67
- sat: number;
68
- };
69
- }
70
- interface PptxBackgroundRemoval {
71
- /** Top edge of the retained rectangle (0..1 fraction of the image height). */
72
- top: number;
73
- /** Bottom edge of the retained rectangle (0..1 fraction of the image height). */
74
- bottom: number;
75
- /** Left edge of the retained rectangle (0..1 fraction of the image width). */
76
- left: number;
77
- /** Right edge of the retained rectangle (0..1 fraction of the image width). */
78
- right: number;
79
- /** Strokes marking regions the user forced to be foreground. */
80
- foregroundMarks?: PptxBackgroundRemovalMark[];
81
- /** Strokes marking regions the user forced to be background. */
82
- backgroundMarks?: PptxBackgroundRemovalMark[];
83
- /** Original effect XML, retained for lossless re-emission. */
84
- rawXml?: XmlObject;
85
- }
86
- interface PptxImageEffects {
87
- /** Brightness adjustment (-100 to 100). */
88
- brightness?: number;
89
- /** Contrast adjustment (-100 to 100). */
90
- contrast?: number;
91
- /** Duotone colour pair. */
92
- duotone?: {
93
- color1: string;
94
- color2: string;
95
- /** Original effect XML, retained while the resolved colours are unchanged. */
96
- rawXml?: XmlObject;
97
- };
98
- /** Grayscale flag. */
99
- grayscale?: boolean;
100
- /** Saturation adjustment (-100 to 100). */
101
- saturation?: number;
102
- /** Color wash overlay. */
103
- colorWash?: {
104
- color: string;
105
- opacity: number;
106
- };
107
- /** Artistic effect name (blur, pencilGrayscale, paintStrokes, etc.). */
108
- artisticEffect?: string;
109
- /** Artistic effect radius/amount, normalised to 0..100. */
110
- artisticRadius?: number;
111
- /**
112
- * Every numeric attribute of the source `a14:artistic*` element, raw and
113
- * un-normalised (`trans`, `pencilSize`, `crackSpacing`, …). The attribute set
114
- * differs per effect, so this is the lossless companion to the single
115
- * {@link PptxImageEffects.artisticRadius} number.
116
- */
117
- artisticParams?: Record<string, number>;
118
- /**
119
- * Name of the artistic effect ALREADY baked into the image data, which a
120
- * renderer must not apply a second time. Set from the `a14` blip extension,
121
- * which PowerPoint writes alongside a pre-rendered bitmap (see
122
- * {@link PptxBackgroundRemoval}), and normally equal to
123
- * {@link PptxImageEffects.artisticEffect}.
124
- *
125
- * It records the NAME rather than a boolean so that picking a different
126
- * effect in this library's inspector (which patches `artisticEffect` alone)
127
- * still renders: the two names then differ.
128
- */
129
- artisticPrerenderedEffect?: string;
130
- /**
131
- * PowerPoint "Remove Background" state (`a14:backgroundRemoval`). Edit-time
132
- * metadata: the removal is already baked into the image data.
133
- */
134
- backgroundRemoval?: PptxBackgroundRemoval;
135
- /**
136
- * `a14:imgLayer/@r:embed`: relationship id of the PRISTINE original image
137
- * the baked effects were derived from (PowerPoint stores it as an HD Photo
138
- * `.wdp` part, which browsers cannot decode).
139
- */
140
- originalImageRelId?: string;
141
- /**
142
- * PowerPoint 2010+ Corrections panel "Sharpen/Soften"
143
- * (`a14:sharpenSoften/@amount`). Raw as the XML carries it: 1/1000ths of a
144
- * percent, `-100000` (fully softened) .. `100000` (fully sharpened).
145
- * Edit-time metadata like the artistic effects: PowerPoint bakes the result
146
- * into the stored bitmap.
147
- */
148
- sharpenSoften?: {
149
- amount: number;
150
- };
151
- /**
152
- * PowerPoint 2010+ Corrections panel "Brightness/Contrast"
153
- * (`a14:brightnessContrast/@bright`, `@contrast`). Raw 1/1000ths of a
154
- * percent, `-100000` .. `100000`. Distinct from the legacy `a:blip/@bright`
155
- * + `@contrast` pair in {@link PptxImageEffects.brightness} /
156
- * {@link PptxImageEffects.contrast}, which PowerPoint 2007 wrote and which
157
- * a renderer still applies.
158
- */
159
- brightnessContrast?: {
160
- bright?: number;
161
- contrast?: number;
162
- };
163
- /**
164
- * PowerPoint 2010+ Color panel "Color Tone"
165
- * (`a14:colorTemperature/@colorTemp`). Raw Kelvin value, `1500` .. `11500`;
166
- * `6500` is neutral.
167
- */
168
- colorTemperature?: {
169
- colorTemp: number;
170
- };
171
- /**
172
- * PowerPoint 2010+ Color panel "Color Saturation" (`a14:saturation/@sat`).
173
- * Raw 1/1000ths of a percent: `100000` is unchanged, `0` is grayscale,
174
- * `400000` the maximum. Named `colorSaturation` because
175
- * {@link PptxImageEffects.saturation} is the viewer-side -100..100 knob
176
- * that has no OOXML counterpart.
177
- */
178
- colorSaturation?: {
179
- sat: number;
180
- };
181
- /**
182
- * The Corrections / Color panel values ALREADY baked into the image data,
183
- * which a renderer must not apply a second time. The a14 counterpart of
184
- * {@link PptxImageEffects.artisticPrerenderedEffect}: PowerPoint writes the
185
- * corrected bitmap to the main `a:blip` and keeps the pristine original in
186
- * `a14:imgLayer` (measured on a real deck: the stored PNG is a monotone tonal
187
- * transform of the `.wdp` original, slope 0.7 for `contrast="-40000"`).
188
- *
189
- * Holds the VALUES rather than a boolean so that changing one of the four
190
- * fields in this library's inspector still renders: a field that differs
191
- * from its snapshot is applied, one that matches is skipped.
192
- */
193
- prerenderedCorrections?: PptxImagePrerenderedCorrections;
194
- /** Alpha modulation fixed: non-negative percentage (100 means unchanged opacity). */
195
- alphaModFix?: number;
196
- /** Original alpha modulation fixed node, including foreign attributes. */
197
- alphaModFixRawXml?: XmlObject;
198
- /** Bi-level threshold: converts to 1-bit black/white (0-100). */
199
- biLevel?: number;
200
- /** Colour change: swap one colour range for another (used for transparency keying). */
201
- clrChange?: {
202
- clrFrom: string;
203
- clrTo: string;
204
- /** Whether the target colour is fully transparent (alpha = 0). */
205
- clrToTransparent?: boolean;
206
- /** Original effect XML, including colour transforms and extensions. */
207
- rawXml?: XmlObject;
208
- };
209
- /** Original grayscale node, including extension or foreign attributes. */
210
- grayscaleRawXml?: XmlObject;
211
- /** Original bi-level node, including extension or foreign attributes. */
212
- biLevelRawXml?: XmlObject;
213
- /**
214
- * Alpha inverse effect (`a:alphaInv`). Inverts the alpha channel; an optional
215
- * colour child shifts the inversion baseline.
216
- */
217
- alphaInv?: {
218
- /** Optional baseline colour (hex). */
219
- color?: string;
220
- /** Original effect XML, including colour transforms and foreign attributes. */
221
- rawXml?: XmlObject;
222
- };
223
- /** Alpha ceiling (`a:alphaCeiling`): clamps any non-zero alpha to fully opaque. Boolean flag. */
224
- alphaCeiling?: boolean;
225
- /** Original alpha ceiling node, including foreign attributes. */
226
- alphaCeilingRawXml?: XmlObject;
227
- /** Alpha floor (`a:alphaFloor`): clamps any non-fully-opaque alpha to fully transparent. Boolean flag. */
228
- alphaFloor?: boolean;
229
- /** Original alpha floor node, including foreign attributes. */
230
- alphaFloorRawXml?: XmlObject;
231
- /**
232
- * Alpha modulate (`a:alphaMod`). The schema requires a single `cont` (effect
233
- * container) child; we preserve the inner XML opaquely for round-trip.
234
- */
235
- alphaMod?: {
236
- /** Raw opaque XML for the `a:cont` child to preserve on save. */
237
- contRawXml?: Record<string, unknown>;
238
- /** Original effect XML, including foreign attributes. */
239
- rawXml?: XmlObject;
240
- /**
241
- * Multiplicative alpha percentage (0..100+), read from a nested
242
- * `<a:alphaModFix>` inside `contRawXml` when present - the common
243
- * real-world shape of `a:alphaMod` (`<a:cont><a:alphaModFix amt="…"/>
244
- * </a:cont>`). Derived/read-only: a renderer multiplies the source alpha
245
- * by this, distinct from the top-level {@link alphaModFix} sibling
246
- * effect. Not written back independently on save; `contRawXml` is what
247
- * round-trips.
248
- */
249
- amt?: number;
250
- };
251
- /** Alpha replace (`a:alphaRepl`): replaces alpha with the given fixed-percent value (0..100). */
252
- alphaRepl?: number;
253
- /** Original alpha replace node, including foreign attributes. */
254
- alphaReplRawXml?: XmlObject;
255
- /** Alpha bi-level (`a:alphaBiLevel`): threshold (0..100) above which alpha becomes fully opaque. */
256
- alphaBiLevel?: number;
257
- /** Original alpha bi-level node, including foreign attributes. */
258
- alphaBiLevelRawXml?: XmlObject;
259
- /**
260
- * Colour replace (`a:clrRepl`): replaces all colour information in an image
261
- * with the given solid colour. Stores the raw colour child to preserve scheme
262
- * colour references and modifiers.
263
- */
264
- clrRepl?: {
265
- /** Resolved hex colour. */
266
- color: string;
267
- /** Raw opaque colour XML for round-trip. */
268
- rawXml?: Record<string, unknown>;
269
- };
270
- /** Luminance modulation (`a:lum`): bright/contrast as fixed percentages (0..100). */
271
- lum?: {
272
- bright?: number;
273
- contrast?: number;
274
- };
275
- /** HSL modulation (`a:hsl`): hue (0..360 degrees), saturation/luminance (-100..100). */
276
- hsl?: {
277
- hue?: number;
278
- sat?: number;
279
- lum?: number;
280
- };
281
- /** Image-effect tint (`a:tint` inside blip): hue (0..360), amount (-100..100). */
282
- tint?: {
283
- hue?: number;
284
- amt?: number;
285
- };
286
- /**
287
- * Fill overlay (`a:fillOverlay`): overlays a fill on top of the blip.
288
- * Stores blend mode and the raw inner fill XML for round-trip.
289
- */
290
- fillOverlay?: {
291
- blend: 'over' | 'mult' | 'screen' | 'darken' | 'lighten';
292
- /** Raw opaque fill XML preserved for round-trip. */
293
- fillRawXml?: Record<string, unknown>;
294
- /**
295
- * Resolved hex colour, when the overlay fill is a plain `a:solidFill`
296
- * (the common case for a picture-style colour overlay). `undefined` for
297
- * a gradient/pattern/picture overlay fill - see {@link resolvedGradient} /
298
- * {@link resolvedPattern} instead. `fillRawXml` still round-trips
299
- * losslessly regardless of which of the three resolved.
300
- */
301
- resolvedColor?: string;
302
- /** Resolved opacity (0-1) of the `a:solidFill` overlay colour, when resolved. */
303
- resolvedOpacity?: number;
304
- /**
305
- * Resolved gradient, when the overlay fill is `a:gradFill`. A renderer
306
- * composites this as an SVG paint server (`<linearGradient>` /
307
- * `<radialGradient>`) rather than a flat flood colour.
308
- */
309
- resolvedGradient?: {
310
- type: 'linear' | 'radial';
311
- /** Gradient angle in degrees (`a:lin/@ang`), for a linear gradient. */
312
- angle?: number;
313
- stops: Array<{
314
- color: string;
315
- position: number;
316
- opacity?: number;
317
- }>;
318
- };
319
- /**
320
- * Resolved preset pattern, when the overlay fill is `a:pattFill`. A
321
- * renderer composites this as a tiled SVG paint server.
322
- */
323
- resolvedPattern?: {
324
- preset: string;
325
- foreground?: string;
326
- background?: string;
327
- };
328
- };
329
- /** Blur (`a:blur`): radius in EMU and grow flag. */
330
- blur?: {
331
- rad?: number;
332
- grow?: boolean;
333
- };
334
- }
335
- /**
336
- * Shape names used for crop-to-shape (CSS `clip-path` equivalent).
337
- *
338
- * @example
339
- * ```ts
340
- * const shape: PptxCropShape = "ellipse";
341
- * // => "ellipse": one of: none | ellipse | roundedRect | triangle | diamond | pentagon | hexagon | star
342
- * ```
343
- */
344
- type PptxCropShape = 'none' | 'ellipse' | 'roundedRect' | 'triangle' | 'diamond' | 'pentagon' | 'hexagon' | 'star';
345
- /**
346
- * Image content mixin: present on image and picture elements.
347
- *
348
- * Contains the decoded image data (base64 data URL or archive path),
349
- * alt text, crop insets, tiling settings, and image effects.
350
- *
351
- * @example
352
- * ```ts
353
- * const props: PptxImageProperties = {
354
- * imagePath: "ppt/media/image1.png",
355
- * altText: "Company logo",
356
- * cropLeft: 0.05,
357
- * cropRight: 0.05,
358
- * };
359
- * // => { imagePath: "ppt/media/image1.png", altText: "Company logo", cropLeft: 0.05, cropRight: 0.05 }
360
- * ```
361
- */
362
- interface PptxImageProperties {
363
- /** Base64 data-URL for the decoded image. */
364
- imageData?: string;
365
- /** Path within the PPTX ZIP archive. */
366
- imagePath?: string;
367
- /** Base64 data-URL for an SVG variant (from blip extension asvg:svgBlip). Preferred over raster when available. */
368
- svgData?: string;
369
- /** Path to the SVG file within the PPTX ZIP archive. */
370
- svgPath?: string;
371
- /** Alt text / description from `p:cNvPr/@descr`. */
372
- altText?: string;
373
- /** Crop from left edge as 0..1 fraction (OOXML `a:srcRect/@l`). */
374
- cropLeft?: number;
375
- /** Crop from top edge as 0..1 fraction (OOXML `a:srcRect/@t`). */
376
- cropTop?: number;
377
- /** Crop from right edge as 0..1 fraction (OOXML `a:srcRect/@r`). */
378
- cropRight?: number;
379
- /** Crop from bottom edge as 0..1 fraction (OOXML `a:srcRect/@b`). */
380
- cropBottom?: number;
381
- /**
382
- * Stretch target inset from the left frame edge as a signed fraction
383
- * (OOXML `a:stretch/a:fillRect/@l`). Unlike `cropLeft` (which selects a
384
- * region of the SOURCE bitmap), a fill-rect selects the region of the
385
- * FRAME the whole image is stretched into; negative values push the
386
- * image beyond the frame edge, and the overflow is clipped.
387
- */
388
- fillRectLeft?: number;
389
- /** Stretch target inset from the top frame edge (`a:fillRect/@t`). */
390
- fillRectTop?: number;
391
- /** Stretch target inset from the right frame edge (`a:fillRect/@r`). */
392
- fillRectRight?: number;
393
- /** Stretch target inset from the bottom frame edge (`a:fillRect/@b`). */
394
- fillRectBottom?: number;
395
- /** Image tiling offset X in px. */
396
- tileOffsetX?: number;
397
- /** Image tiling offset Y in px. */
398
- tileOffsetY?: number;
399
- /** Image tiling scale X as a fraction of the image's own width (1 = 100%, `a:tile/@sx`). */
400
- tileScaleX?: number;
401
- /** Image tiling scale Y as a fraction of the image's own height (1 = 100%, `a:tile/@sy`). */
402
- tileScaleY?: number;
403
- /** Image tiling flip mode. */
404
- tileFlip?: 'none' | 'x' | 'y' | 'xy';
405
- /** Image tiling alignment. */
406
- tileAlignment?: string;
407
- /**
408
- * Print-resolution hint in DPI (`a:blipFill/@dpi`). PowerPoint records this
409
- * when it downsamples an embedded image for a target print quality; it has
410
- * no on-screen rendering effect (a `0`/absent value means "use the source
411
- * image's native resolution"). Parsed for round-trip / API fidelity only.
412
- */
413
- dpi?: number;
414
- /** Image recolour/artistic effect properties. */
415
- imageEffects?: PptxImageEffects;
416
- /**
417
- * Crop-to-shape (CSS clip-path shape name).
418
- *
419
- * PowerPoint implements "Crop to Shape" by writing the picture's own
420
- * `a:prstGeom`, so this is a typed view over `shapeType`: on load it is
421
- * derived from the preset (`ellipse` -> `'ellipse'`, `roundRect` ->
422
- * `'roundedRect'`, `star5` -> `'star'`, ...; see
423
- * `utils/crop-shape-geometry`), and on save a changed value rewrites the
424
- * preset. `'none'` / `undefined` leaves the geometry alone.
425
- */
426
- cropShape?: PptxCropShape;
427
- }
428
- /**
429
- * How a picture fills its frame: the `a:tile` or `a:stretch/a:fillRect`
430
- * fields of {@link PptxImageProperties}, which a shape's picture fill
431
- * carries as `ShapeStyle.fillImageLayout`. Tile fields win over the
432
- * fill rectangle.
433
- */
434
- type PptxImageLayout = Pick<PptxImageProperties, 'tileOffsetX' | 'tileOffsetY' | 'tileScaleX' | 'tileScaleY' | 'tileFlip' | 'tileAlignment' | 'fillRectLeft' | 'fillRectTop' | 'fillRectRight' | 'fillRectBottom'>;
435
- interface PptxCustomDashSegment {
436
- /** Dash length as a non-negative percentage in thousandths of one percent. */
437
- dash: number;
438
- /** Space length as a non-negative percentage in thousandths of one percent. */
439
- space: number;
440
- }
441
- /**
442
- * Comprehensive visual style for a shape, connector, or image element.
443
- *
444
- * All fields are optional. When absent, the element inherits from theme
445
- * or layout defaults. The interface models both simple styling (solid fill +
446
- * basic stroke) and advanced effects (multiple shadow layers, gradient
447
- * fills, 3-D extrusion).
448
- *
449
- * @example
450
- * ```ts
451
- * // Simple blue filled shape with a thin black outline:
452
- * const simple: ShapeStyle = {
453
- * fillColor: "#0055AA",
454
- * fillMode: "solid",
455
- * strokeColor: "#000000",
456
- * strokeWidth: 1,
457
- * };
458
- *
459
- * // Gradient fill with a soft shadow:
460
- * const fancy: ShapeStyle = {
461
- * fillMode: "gradient",
462
- * fillGradientType: "linear",
463
- * fillGradientAngle: 135,
464
- * fillGradientStops: [
465
- * { color: "#FF6B6B", position: 0 },
466
- * { color: "#556270", position: 1 },
467
- * ],
468
- * shadowColor: "#000000",
469
- * shadowBlur: 10,
470
- * shadowOffsetX: 4,
471
- * shadowOffsetY: 4,
472
- * shadowOpacity: 0.3,
473
- * };
474
- * // => both satisfy the ShapeStyle interface
475
- * ```
476
- */
477
- interface ShapeStyle {
478
- fillColor?: string;
479
- /**
480
- * Raw XML colour-choice node preserved from `a:solidFill` for round-trip
481
- * serialisation. Captures `a:schemeClr` / `a:sysClr` / `a:prstClr` /
482
- * `a:srgbClr` plus colour transforms (`lumMod`, `lumOff`, `tint`,
483
- * `shade`, `satMod`, `alpha`, …). On save we re-emit verbatim when the
484
- * resolved {@link fillColor} still matches this node, otherwise we fall
485
- * back to canonical `<a:srgbClr>`.
486
- */
487
- fillColorXml?: XmlObject;
488
- /**
489
- * Typed theme colour reference for the fill, set when {@link fillColorXml}
490
- * is a plain `a:schemeClr` (see `themeColorRefFromColorChoice`). When
491
- * present it WINS on save: the writer emits `<a:schemeClr>` from this ref
492
- * instead of the resolved {@link fillColor}, so the fill keeps following
493
- * the theme palette after a later theme change. `undefined` means the fill
494
- * is a plain hex (or a colour kind a ref cannot express).
495
- */
496
- fillColorRef?: PptxThemeColorRef;
497
- fillGradient?: string;
498
- /** Original `gradFill` XML retained for unknown-child and extension round-tripping. */
499
- fillGradientXml?: XmlObject;
500
- fillMode?: 'solid' | 'gradient' | 'pattern' | 'none' | 'image' | 'theme' | 'group';
501
- /**
502
- * `<p:sp useBgFill="1">`: the shape paints with the SLIDE BACKGROUND's fill
503
- * rather than its own or its theme style's.
504
- *
505
- * PowerPoint's designer emits full-bleed rectangles this way, and they also
506
- * carry an `a:fillRef` pointing at `accent1`. Ignoring the attribute painted
507
- * those panels in the accent colour, so a black-and-white title slide came out
508
- * black-and-blue. The load pipeline copies the resolved slide background onto
509
- * the fill fields; the flag stays for round-trip and for renderers that want
510
- * to re-resolve against a changed background.
511
- */
512
- useBackgroundFill?: boolean;
513
- fillPatternPreset?: string;
514
- fillPatternBackgroundColor?: string;
515
- /** Original `pattFill` XML retained for unknown-child round-tripping. */
516
- fillPatternXml?: XmlObject;
517
- /** Raw XML node for pattern fill foreground colour (preserves color transforms). */
518
- fillPatternFgClrXml?: XmlObject;
519
- /** Raw XML node for pattern fill background colour (preserves color transforms). */
520
- fillPatternBgClrXml?: XmlObject;
521
- /** Data-URI or URL for image fill (when fillMode === "image"). */
522
- fillImageUrl?: string;
523
- /** How the image is sized within the shape: stretch to fill, or tile/repeat. */
524
- fillImageMode?: 'stretch' | 'tile';
525
- /**
526
- * Tile placement or stretch insets of a NEW picture fill, written as
527
- * `a:tile` / `a:stretch/a:fillRect`. A loaded picture fill keeps its
528
- * authored `a:blipFill` instead (it loads as a picture element, which
529
- * carries these fields itself).
530
- */
531
- fillImageLayout?: PptxImageLayout;
532
- /** Whether the image fill rotates/flips with the shape (`a:blipFill/@rotWithShape`).
533
- * Defaults to true per the schema; preserved for round-trip when the source
534
- * authored the attribute explicitly. When false, the shape's own geometry
535
- * (clip-path/outline) still carries the shape's rotation/flip, but the
536
- * picture content inside stays fixed to the page frame (upright), matching
537
- * PowerPoint. See `pptx-viewer-shared`'s `getImageFillCounterTransform`. */
538
- fillImageRotWithShape?: boolean;
539
- fillGradientStops?: Array<{
540
- color: string;
541
- position: number;
542
- opacity?: number;
543
- /** Raw XML colour node preserved for round-trip (e.g. a:schemeClr with transforms). */
544
- originalColorXml?: XmlObject;
545
- /**
546
- * Typed theme colour reference for this stop, set when
547
- * {@link originalColorXml} is a plain `a:schemeClr`. Wins on save, same
548
- * as {@link ShapeStyle.fillColorRef}.
549
- */
550
- colorRef?: PptxThemeColorRef;
551
- }>;
552
- fillGradientAngle?: number;
553
- fillGradientType?: 'linear' | 'radial';
554
- /** Path gradient sub-type from `a:path/@path` (e.g. "circle", "rect", "shape"). */
555
- fillGradientPathType?: 'circle' | 'rect' | 'shape';
556
- /** Focal point for path (radial) gradients, derived from `a:fillToRect`.
557
- * Values are 0..1 fractions relative to shape bounds. */
558
- fillGradientFocalPoint?: {
559
- x: number;
560
- y: number;
561
- };
562
- /** Raw fillToRect LTRB values (0..1 fractions) from `a:fillToRect`.
563
- * Defines the inner rectangle where the gradient reaches its final stop.
564
- * l/t are insets from left/top edges; r/b are insets from right/bottom edges. */
565
- fillGradientFillToRect?: {
566
- l: number;
567
- t: number;
568
- r: number;
569
- b: number;
570
- };
571
- /** Raw tileRect LTRB values (0..1 fractions, may be negative) from
572
- * `a:gradFill/a:tileRect`. Defines the rectangle the gradient tile occupies
573
- * before any flip/tiling is applied. */
574
- fillGradientTileRect?: {
575
- l: number;
576
- t: number;
577
- r: number;
578
- b: number;
579
- };
580
- /** Gradient tile flip mode (`a:gradFill/@flip`).
581
- * `none` = no tiling flip (default), `x|y|xy` = mirror in the named axis. */
582
- fillGradientFlip?: 'none' | 'x' | 'y' | 'xy';
583
- /** Whether the gradient rotates with the shape (`a:gradFill/@rotWithShape`).
584
- * Defaults to true per the schema; preserved for round-trip when the source
585
- * authored the attribute explicitly. */
586
- fillGradientRotWithShape?: boolean;
587
- /** Whether the linear gradient is scaled to the shape (`a:lin/@scaled`).
588
- * Defaults to true per the schema; preserved for round-trip. */
589
- fillGradientScaled?: boolean;
590
- fillOpacity?: number;
591
- strokeColor?: string;
592
- /**
593
- * Raw XML colour-choice node preserved from `a:ln/a:solidFill` for
594
- * round-trip serialisation. See {@link fillColorXml} for the rationale.
595
- */
596
- strokeColorXml?: XmlObject;
597
- /**
598
- * Typed theme colour reference for the outline, mirroring
599
- * {@link fillColorRef}: set when {@link strokeColorXml} is a plain
600
- * `a:schemeClr`, and wins on save.
601
- */
602
- strokeColorRef?: PptxThemeColorRef;
603
- /**
604
- * Kind of fill painted on the outline (`a:ln` child). Distinguishes a solid
605
- * outline from a gradient/pattern/none outline so save can emit the correct
606
- * single line fill instead of collapsing every outline to `a:solidFill`
607
- * (which, alongside a preserved `a:gradFill`/`a:pattFill`, produces an
608
- * invalid dual-fill `<a:ln>`).
609
- */
610
- strokeFillMode?: 'solid' | 'gradient' | 'pattern' | 'none';
611
- /** Raw `a:ln/a:gradFill` XML preserved for round-trip when the outline is
612
- * gradient-filled. Re-emitted verbatim as the line's single fill on save. */
613
- strokeGradientXml?: XmlObject;
614
- /** Raw `a:ln/a:pattFill` XML preserved for round-trip when the outline is
615
- * pattern-filled. Re-emitted verbatim as the line's single fill on save. */
616
- strokePatternXml?: XmlObject;
617
- /**
618
- * Structured stops of a gradient outline (`a:ln/a:gradFill/a:gsLst`), in the
619
- * same shape as {@link fillGradientStops}.
620
- *
621
- * The raw XML above round-trips a gradient outline on save, but a renderer
622
- * cannot paint from it: it needs resolved colours and positions. Without
623
- * these, every binding fell back to {@link strokeColor} - a single averaged
624
- * colour - so a two-tone outline painted flat and a fade-to-transparent
625
- * outline painted fully opaque.
626
- */
627
- strokeGradientStops?: ShapeStyle['fillGradientStops'];
628
- /** Gradient outline angle in OOXML degrees (`a:lin/@ang`), 0 = left to right. */
629
- strokeGradientAngle?: number;
630
- /** Gradient outline kind: `linear` (`a:lin`) or `radial` (`a:path`). */
631
- strokeGradientType?: ShapeStyle['fillGradientType'];
632
- /** Path-gradient shape for a radial outline (`a:path/@path`). */
633
- strokeGradientPathType?: ShapeStyle['fillGradientPathType'];
634
- /** Preset name of a pattern outline (`a:ln/a:pattFill/@prst`). */
635
- strokePatternPreset?: string;
636
- /** Background colour of a pattern outline (`a:ln/a:pattFill/a:bgClr`). */
637
- strokePatternBackgroundColor?: string;
638
- strokeWidth?: number;
639
- strokeOpacity?: number;
640
- strokeDash?: StrokeDashType;
641
- /** Line join style (`a:ln/@join`): round, bevel, or miter. */
642
- lineJoin?: 'round' | 'bevel' | 'miter';
643
- /** Miter limit (`a:miter/@lim`) in EMU-percent units (default 800000 = 8.0). Only meaningful when lineJoin is 'miter'. */
644
- miterLimit?: number;
645
- /** Line cap style (`a:ln/@cap`): flat, rnd, or sq. */
646
- lineCap?: 'flat' | 'rnd' | 'sq';
647
- /** Compound line type (`a:ln/@cmpd`). */
648
- compoundLine?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
649
- /** Pen line alignment (`a:ln/@algn`): `ctr` (centre, default) or `in` (inside). */
650
- lineAlignment?: 'ctr' | 'in';
651
- shadowColor?: string;
652
- /** Preserved source `a:effectLst`, including unknown effects and extensions. */
653
- effectListXml?: XmlObject;
654
- /** Original outer-shadow node used for lossless surgical updates. */
655
- outerShadowXml?: XmlObject;
656
- /** Resolved source shadow colour used to detect colour edits. */
657
- outerShadowOriginalColor?: string;
658
- /** Source shadow opacity used to detect alpha edits. */
659
- outerShadowOriginalOpacity?: number;
660
- shadowBlur?: number;
661
- shadowOffsetX?: number;
662
- shadowOffsetY?: number;
663
- shadowOpacity?: number;
664
- /** Preset shadow name from `a:prstShdw/@prst` (e.g. "shdw1"..."shdw20"). */
665
- presetShadowName?: string;
666
- /** Shadow angle in degrees (0-360). Parsed from `@_dir` (60000ths of a degree). */
667
- shadowAngle?: number;
668
- /** Shadow distance in pixels. Parsed from `@_dist` (EMUs). */
669
- shadowDistance?: number;
670
- /** Whether shadow rotates with shape. Parsed from `@_rotWithShape`. */
671
- shadowRotateWithShape?: boolean;
672
- /** Outer-shadow horizontal scaling (`a:outerShdw/@sx`) in 1000ths of a percent (default 100000 = 100%). */
673
- shadowScaleX?: number;
674
- /** Outer-shadow vertical scaling (`a:outerShdw/@sy`). */
675
- shadowScaleY?: number;
676
- /** Outer-shadow horizontal skew (`a:outerShdw/@kx`) in 60000ths of a degree. */
677
- shadowSkewX?: number;
678
- /** Outer-shadow vertical skew (`a:outerShdw/@ky`). */
679
- shadowSkewY?: number;
680
- /** Outer-shadow alignment (`a:outerShdw/@algn`). */
681
- shadowAlignment?: 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';
682
- /** Inner-shadow rotateWithShape (`a:innerShdw/@rotWithShape`). */
683
- innerShadowRotateWithShape?: boolean;
684
- /** Reflection fade direction (`a:reflection/@fadeDir`) in 60000ths of a degree. */
685
- reflectionFadeDirection?: number;
686
- /** Reflection horizontal scaling (`a:reflection/@sx`). */
687
- reflectionScaleX?: number;
688
- /** Reflection vertical scaling (`a:reflection/@sy`). */
689
- reflectionScaleY?: number;
690
- /** Reflection horizontal skew (`a:reflection/@kx`). */
691
- reflectionSkewX?: number;
692
- /** Reflection vertical skew (`a:reflection/@ky`). */
693
- reflectionSkewY?: number;
694
- /** Reflection alignment (`a:reflection/@algn`). */
695
- reflectionAlignment?: 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';
696
- /** Reflection rotateWithShape (`a:reflection/@rotWithShape`). */
697
- reflectionRotateWithShape?: boolean;
698
- /** Reflection start position (`a:reflection/@stPos`) as 0-1 fraction. */
699
- reflectionStartPosition?: number;
700
- /** Multiple shadow layers (for advanced effects). */
701
- shadows?: ShadowEffect[];
702
- glowColor?: string;
703
- /** Original glow node used for lossless surgical updates. */
704
- glowXml?: XmlObject;
705
- /** Resolved source glow colour used to detect colour edits. */
706
- glowOriginalColor?: string;
707
- /** Source glow opacity used to detect alpha edits. */
708
- glowOriginalOpacity?: number;
709
- glowRadius?: number;
710
- glowOpacity?: number;
711
- softEdgeRadius?: number;
712
- /** Inner shadow colour (`a:innerShdw`). */
713
- innerShadowColor?: string;
714
- /** Original inner-shadow node used for lossless surgical updates. */
715
- innerShadowXml?: XmlObject;
716
- /** Resolved source inner-shadow colour used to detect colour edits. */
717
- innerShadowOriginalColor?: string;
718
- /** Source inner-shadow opacity used to detect alpha edits. */
719
- innerShadowOriginalOpacity?: number;
720
- /** Inner shadow opacity (0-1). */
721
- innerShadowOpacity?: number;
722
- /** Inner shadow blur radius in px. */
723
- innerShadowBlur?: number;
724
- /** Inner shadow horizontal offset in px. */
725
- innerShadowOffsetX?: number;
726
- /** Inner shadow vertical offset in px. */
727
- innerShadowOffsetY?: number;
728
- /** Original soft-edge node, including vendor attributes and extensions. */
729
- softEdgeXml?: XmlObject;
730
- /** Reflection effect — distance from shape bottom in px. */
731
- reflectionBlurRadius?: number;
732
- /** Original reflection node, including vendor attributes and extensions. */
733
- reflectionXml?: XmlObject;
734
- /** Reflection start opacity (0-1). */
735
- reflectionStartOpacity?: number;
736
- /** Reflection end opacity (0-1). */
737
- reflectionEndOpacity?: number;
738
- /** Reflection end position (0-1 fraction of shape height). */
739
- reflectionEndPosition?: number;
740
- /** Reflection direction in degrees. */
741
- reflectionDirection?: number;
742
- /** Reflection rotation in degrees (`a:reflection/@rot` in 60000ths). */
743
- reflectionRotation?: number;
744
- /** Reflection distance in px. */
745
- reflectionDistance?: number;
746
- /** Standalone blur effect radius in px (`a:effectLst > a:blur`). */
747
- blurRadius?: number;
748
- /** Whether the blur effect grows the bounds of the shape (`a:blur/@grow`). */
749
- blurGrow?: boolean;
750
- connectorStartArrow?: ConnectorArrowType;
751
- /** Start arrow width size ('sm' | 'med' | 'lg'). */
752
- connectorStartArrowWidth?: 'sm' | 'med' | 'lg';
753
- /** Start arrow length size ('sm' | 'med' | 'lg'). */
754
- connectorStartArrowLength?: 'sm' | 'med' | 'lg';
755
- connectorEndArrow?: ConnectorArrowType;
756
- /** End arrow width size ('sm' | 'med' | 'lg'). */
757
- connectorEndArrowWidth?: 'sm' | 'med' | 'lg';
758
- /** End arrow length size ('sm' | 'med' | 'lg'). */
759
- connectorEndArrowLength?: 'sm' | 'med' | 'lg';
760
- /** Connection point for the start of a connector. */
761
- connectorStartConnection?: ConnectorConnectionPoint;
762
- /** Connection point for the end of a connector. */
763
- connectorEndConnection?: ConnectorConnectionPoint;
764
- /** Custom dash pattern, measured relative to line width in thousandths of one percent. */
765
- customDashSegments?: PptxCustomDashSegment[];
766
- /** Original `a:ds` payloads retained by index for lossless edits. */
767
- customDashSegmentXml?: XmlObject[];
768
- /** Original `a:custDash` payload retained for lossless edits. */
769
- customDashXml?: XmlObject;
770
- /** 3D scene/camera settings from `a:scene3d`. */
771
- scene3d?: DrawingScene3D;
772
- /** 3D shape extrusion/bevel from `a:sp3d`. */
773
- shape3d?: Pptx3DShape;
774
- /** Line-level shadow colour from `a:ln/a:effectLst/a:outerShdw`. */
775
- lineShadowColor?: string;
776
- /** Line-level shadow opacity (0-1). */
777
- lineShadowOpacity?: number;
778
- /** Line-level shadow blur radius in px. */
779
- lineShadowBlur?: number;
780
- /** Line-level shadow horizontal offset in px. */
781
- lineShadowOffsetX?: number;
782
- /** Line-level shadow vertical offset in px. */
783
- lineShadowOffsetY?: number;
784
- /** Line-level glow colour from `a:ln/a:effectLst/a:glow`. */
785
- lineGlowColor?: string;
786
- /** Line-level glow radius in px. */
787
- lineGlowRadius?: number;
788
- /** Line-level glow opacity (0-1). */
789
- lineGlowOpacity?: number;
790
- /** Raw `a:effectDag` XML node preserved for round-trip serialisation. */
791
- effectDagXml?: XmlObject;
792
- /**
793
- * Typed effect graph parsed from {@link ShapeStyle.effectDagXml}. The four
794
- * structural container nodes (`a:cont`, `a:blend`, `a:xfrmEffect`,
795
- * `a:relOff`) are fully typed; any other leaf effect (e.g. `a:outerShdw`,
796
- * `a:glow`, `a:alphaInv`) is captured as
797
- * {@link import('./effect-dag').EffectDagRawLeaf} so we never have to
798
- * recurse into the full effect taxonomy.
799
- */
800
- effectDagTree?: EffectDagContainer;
801
- /** Grayscale flag from effectDag `a:grayscl`. */
802
- dagGrayscale?: boolean;
803
- /** Bi-level threshold (0-100) from effectDag `a:biLevel`. */
804
- dagBiLevel?: number;
805
- /** Brightness adjustment (-100 to 100) from effectDag `a:lum/@bright`. */
806
- dagLumBrightness?: number;
807
- /** Contrast adjustment (-100 to 100) from effectDag `a:lum/@contrast`. */
808
- dagLumContrast?: number;
809
- /** Hue rotation in degrees (0-360) from effectDag `a:hsl/@hue`. */
810
- dagHslHue?: number;
811
- /** Saturation adjustment from effectDag `a:hsl/@sat`. */
812
- dagHslSaturation?: number;
813
- /** Luminance adjustment from effectDag `a:hsl/@lum`. */
814
- dagHslLuminance?: number;
815
- /** Alpha modulation fixed (0-100) from effectDag `a:alphaModFix`. */
816
- dagAlphaModFix?: number;
817
- /** Tint hue in degrees from effectDag `a:tint/@hue`. */
818
- dagTintHue?: number;
819
- /** Tint amount (0-100) from effectDag `a:tint/@amt`. */
820
- dagTintAmount?: number;
821
- /** Duotone colour pair from effectDag `a:duotone`. */
822
- dagDuotone?: {
823
- color1: string;
824
- color2: string;
825
- };
826
- /** Fill overlay blend mode from effectDag `a:fillOverlay/@blend`. */
827
- dagFillOverlayBlend?: 'over' | 'mult' | 'screen' | 'darken' | 'lighten';
828
- /**
829
- * Fill overlay tint colour (hex `#RRGGBB`) from effectDag `a:fillOverlay`'s
830
- * `a:solidFill`/`a:gradFill`. Painted as a blended overlay layer over the
831
- * element; the blend mode comes from {@link dagFillOverlayBlend}.
832
- */
833
- dagFillOverlayColor?: string;
834
- /** Fill overlay tint opacity (0-1), from the overlay fill colour's alpha. */
835
- dagFillOverlayOpacity?: number;
836
- /** Fill overlay blend mode from a direct `a:effectLst/a:fillOverlay/@blend`. */
837
- shapeFillOverlayBlend?: 'over' | 'mult' | 'screen' | 'darken' | 'lighten';
838
- /**
839
- * Fill overlay tint colour (hex `#RRGGBB`) from a direct
840
- * `a:effectLst/a:fillOverlay`'s `a:solidFill`/`a:gradFill`.
841
- */
842
- shapeFillOverlayColor?: string;
843
- /** Fill overlay tint opacity (0-1), from the overlay fill colour's alpha. */
844
- shapeFillOverlayOpacity?: number;
845
- /** Original source `a:fillOverlay` node, preserved for lossless surgical updates. */
846
- fillOverlayXml?: XmlObject;
847
- /** Resolved source fill-overlay colour used to detect colour edits. */
848
- shapeFillOverlayOriginalColor?: string;
849
- /** Source fill-overlay opacity used to detect alpha edits. */
850
- shapeFillOverlayOriginalOpacity?: number;
851
- /** `<a:lnRef @idx>` — 1-based index into the theme's lnStyleLst. */
852
- lnRefIdx?: number;
853
- /** Raw XML colour child of `<a:lnRef>` (e.g. `<a:schemeClr>` with transforms). */
854
- lnRefColorXml?: XmlObject;
855
- /** `<a:fillRef @idx>` — 1-based index into fillStyleLst (1-3) or bgFillStyleLst (1001-1003). */
856
- fillRefIdx?: number;
857
- /** Raw XML colour child of `<a:fillRef>`. */
858
- fillRefColorXml?: XmlObject;
859
- /** `<a:effectRef @idx>` — 1-based index into the theme's effectStyleLst. */
860
- effectRefIdx?: number;
861
- /** Raw XML colour child of `<a:effectRef>`. */
862
- effectRefColorXml?: XmlObject;
863
- /** `<a:fontRef @idx>` — typically `major`, `minor`, or `none`. */
864
- fontRefIdx?: string;
865
- /** Raw XML colour child of `<a:fontRef>`. */
866
- fontRefColorXml?: XmlObject;
867
- /**
868
- * The fill `<a:fillRef>` resolved to, recorded ONLY when the shape's own
869
- * `spPr` authored no fill at all, so the reference is what paints it.
870
- *
871
- * Its absence therefore means "the fill is the shape's own", and its
872
- * presence plus an unchanged flat fill means "still purely inherited": see
873
- * `authored-shape-style.ts`, the shape-scope twin of `TextStyle`'s
874
- * `inheritedRunStyle`.
875
- */
876
- inheritedFillStyle?: ShapeStyle;
877
- /**
878
- * The outline `<a:lnRef>` resolved to, recorded before `spPr/a:ln` was
879
- * layered on top. A property that still equals this baseline was never
880
- * authored on the shape and must not be written back as if it were.
881
- */
882
- inheritedLineStyle?: ShapeStyle;
883
- /**
884
- * The shadow/glow/reflection/soft-edge/3D properties `<a:effectRef>`
885
- * resolved from the theme's `effectStyleLst`, recorded ONLY for the
886
- * properties the shape had not already authored itself. A shape whose
887
- * effects still match this baseline was never given its own effects and
888
- * must not have them written back as a literal `spPr/a:effectLst`; see
889
- * `authored-shape-style.ts`'s `effectIsPurelyStyleMatrix`.
890
- */
891
- inheritedEffectStyle?: ShapeStyle;
892
- /**
893
- * Set by a style-matrix pick (the Shape Styles gallery): the shape's own
894
- * `spPr` fill, outline and effects were replaced by `<p:style>`, so the
895
- * writer clears whatever the retained `spPr` still authored before it
896
- * writes the (now reference-owned) style. Never parsed; editor state only.
897
- */
898
- styleMatrixReset?: boolean;
899
- }
900
- /**
901
- * The result of resolving a `<p:style>` block against the loaded theme.
902
- *
903
- * `shapeStyle` is exactly what the load pipeline would have produced for a
904
- * shape whose `spPr` authors nothing and whose `<p:style>` is `styleXml`:
905
- * the flat fill/outline/effect values a renderer needs, the reference indices
906
- * and colours the writer re-emits, and the inheritance baselines that tell the
907
- * writer to leave `spPr` empty while the flat values still agree with them.
908
- */
909
- interface ResolvedStyleMatrix {
910
- shapeStyle: ShapeStyle;
911
- /** The text colour `<a:fontRef>` names, resolved to hex. */
912
- fontColor?: string;
913
- }
914
- /**
915
- * A `a:fillRef`/`a:lnRef`/`a:effectRef`-style style-matrix reference: an
916
- * index into the theme's format scheme (`a:fmtScheme/a:fillStyleLst`, 1-based
917
- * per ECMA-376 §20.1.4.1.12) plus an optional colour transform child.
918
- *
919
- * Distinct from an already-resolved {@link ParsedTableStyleFill}: a fill ref
920
- * points AT a theme style-matrix entry rather than carrying a colour choice
921
- * directly, though the two commonly appear together (`<a:fillRef idx="2">
922
- * <a:schemeClr val="accent1"/></a:fillRef>`).
923
- *
924
- * @example
925
- * ```ts
926
- * const ref: ParsedTableFillRef = { idx: 2, color: { schemeColor: 'accent1' } };
927
- * // => satisfies ParsedTableFillRef
928
- * ```
929
- */
930
- interface ParsedTableFillRef {
931
- /** 1-based index into the theme format scheme's fill style list. */
932
- idx: number;
933
- /** Colour transform child (`a:schemeClr`/`a:srgbClr`) applied to the referenced style. */
934
- color?: ParsedTableStyleFill;
935
- }
936
- /**
937
- * One leaf (or `effectDag`-wrapped) node of an `a:effectLst`/`a:effectDag`
938
- * effect chain, kept mostly opaque: {@link kind} names the OOXML element so a
939
- * consumer can recognise common effects (`outerShdw`, `glow`, `softEdge`,
940
- * `reflection`, `blur`, `innerShdw`, `prstShdw`, `fillOverlay`, `alphaModFix`,
941
- * `alphaInv`, `grayscl`, `biLevel`, `duotone`, `hsl`, `lum`, `tint`) without
942
- * this module re-deriving the full shape-effect taxonomy already modelled on
943
- * `ShapeStyle`; {@link xml} preserves the node verbatim for lossless re-emit.
944
- *
945
- * @example
946
- * ```ts
947
- * const effect: ParsedTableStyleEffect = {
948
- * kind: 'outerShdw',
949
- * xml: { '@_blurRad': '40000', '@_dist': '20000', '@_dir': '5400000' },
950
- * };
951
- * // => satisfies ParsedTableStyleEffect
952
- * ```
953
- */
954
- interface ParsedTableStyleEffect {
955
- /** The OOXML element's local name, e.g. `outerShdw`, `glow`, `softEdge`. */
956
- kind: string;
957
- /** Verbatim XML node (attributes + children) for lossless round-trip. */
958
- xml: XmlObject;
959
- }
960
- /**
961
- * A patch to apply to ONE `CT_TableStyle` section (`a:wholeTbl`, `a:band1H`,
962
- * `a:firstRow`, a corner cell, ...) when editing an existing table style.
963
- * Every field is independently optional: an absent field leaves that facet
964
- * of the section untouched, `null` (currently only supported for
965
- * {@link fill}/{@link text}/{@link borders}/{@link cell3D} at the top level)
966
- * is not accepted here (delete a whole style with
967
- * `deleteTableStyleFromMap` / `tableStylesToDelete` instead of clearing every
968
- * facet of every section).
969
- *
970
- * @example
971
- * ```ts
972
- * const patch: TableStyleSectionPatch = {
973
- * fill: { schemeColor: 'accent2', tint: 40000 },
974
- * text: { bold: true },
975
- * };
976
- * // => satisfies TableStyleSectionPatch
977
- * ```
978
- */
979
- interface TableStyleSectionPatch {
980
- fill?: ParsedTableStyleFill;
981
- text?: ParsedTableStyleText;
982
- borders?: ParsedTableStyleBorders;
983
- cell3D?: PptxTableCell3D;
984
- }
985
- /**
986
- * Options for creating a brand-new `a:tblStyle` entry with
987
- * `createTableStyleEntry` (`packages/core/.../table-style-editor.ts`).
988
- *
989
- * @example
990
- * ```ts
991
- * const opts: CreateTableStyleOptions = { styleName: 'My Custom Style' };
992
- * // => satisfies CreateTableStyleOptions
993
- * ```
994
- */
995
- interface CreateTableStyleOptions {
996
- /** Display name for the new style (`a:tblStyle/@styleName`). */
997
- styleName: string;
998
- /**
999
- * An existing entry to deep-clone section-by-section as the starting
1000
- * point (all fill/text/border/cell3D/background sections), with a fresh
1001
- * `styleId` substituted in. Omit for a blank style with no sections.
1002
- */
1003
- basedOn?: ParsedTableStyleEntry;
1004
- /**
1005
- * Explicit style GUID (braced, e.g. `{...}`). When omitted a new GUID is
1006
- * generated (`globalThis.crypto.randomUUID()` when available).
1007
- */
1008
- styleId?: string;
1009
- }
1010
- /**
1011
- * Per-cell visual style for a table cell.
1012
- *
1013
- * All fields are optional - unset values inherit from the table style.
1014
- *
1015
- * @example
1016
- * ```ts
1017
- * const header: PptxTableCellStyle = {
1018
- * bold: true,
1019
- * fontSize: 14,
1020
- * color: "#FFFFFF",
1021
- * backgroundColor: "#0055AA",
1022
- * align: "center",
1023
- * };
1024
- * // => satisfies PptxTableCellStyle
1025
- * ```
1026
- */
1027
- interface PptxTableCellStyle {
1028
- /** Font size in points (`a:rPr@sz / 100`). */
1029
- fontSize?: number;
1030
- bold?: boolean;
1031
- italic?: boolean;
1032
- underline?: boolean;
1033
- color?: string;
1034
- /**
1035
- * Font family from the first run's `a:rPr/a:latin@typeface` (falling back to
1036
- * `a:ea` / `a:cs`). Per-run families live on {@link PptxTableCellTextRun}.
1037
- */
1038
- fontFamily?: string;
1039
- /**
1040
- * Raw XML colour-choice node preserved from `a:tc/a:txBody/.../a:rPr/a:solidFill`
1041
- * for round-trip serialisation. Currently unused by the cell-level writer
1042
- * (cell text colour falls through `writeCellTextFormatting`), reserved for
1043
- * future expansion alongside the run-properties round-trip path.
1044
- */
1045
- colorXml?: XmlObject;
1046
- /**
1047
- * Typed theme colour reference for the cell text colour, set when
1048
- * {@link colorXml} is a plain `a:schemeClr`. Wins on save, mirroring
1049
- * `TextStyle.colorRef`. Distinct from {@link ParsedTableStyleFill.schemeColor},
1050
- * which describes a `ppt/tableStyles.xml` section fill rather than an
1051
- * individual cell override.
1052
- */
1053
- colorRef?: PptxThemeColorRef;
1054
- backgroundColor?: string;
1055
- /**
1056
- * Raw XML colour-choice node preserved from cell `a:tcPr/a:solidFill` for
1057
- * round-trip serialisation. Re-emitted verbatim when the resolved
1058
- * {@link backgroundColor} still matches the original colour.
1059
- */
1060
- backgroundColorXml?: XmlObject;
1061
- /**
1062
- * Typed theme colour reference for the cell fill, set when
1063
- * {@link backgroundColorXml} is a plain `a:schemeClr`. Wins on save,
1064
- * mirroring `ShapeStyle.fillColorRef`.
1065
- */
1066
- backgroundColorRef?: PptxThemeColorRef;
1067
- borderColor?: string;
1068
- /** Top border width in px. */
1069
- borderTopWidth?: number;
1070
- /** Bottom border width in px. */
1071
- borderBottomWidth?: number;
1072
- /** Left border width in px. */
1073
- borderLeftWidth?: number;
1074
- /** Right border width in px. */
1075
- borderRightWidth?: number;
1076
- /** Top border color as hex. */
1077
- borderTopColor?: string;
1078
- /** Bottom border color as hex. */
1079
- borderBottomColor?: string;
1080
- /** Left border color as hex. */
1081
- borderLeftColor?: string;
1082
- /** Right border color as hex. */
1083
- borderRightColor?: string;
1084
- align?: TextStyle['align'];
1085
- vAlign?: 'top' | 'middle' | 'bottom';
1086
- /** Text direction from `a:tcPr/@vert` (spec values from CT_TextVerticalType). */
1087
- textDirection?: 'vert' | 'vert270' | 'eaVert' | 'wordArtVert' | 'wordArtVertRtl' | 'mongolianVert';
1088
- /** Cell left margin in px (from a:tcPr > a:tcMar > a:marL). */
1089
- marginLeft?: number;
1090
- /** Cell right margin in px. */
1091
- marginRight?: number;
1092
- /** Cell top margin in px. */
1093
- marginTop?: number;
1094
- /** Cell bottom margin in px. */
1095
- marginBottom?: number;
1096
- /** Diagonal border top-left to bottom-right color. */
1097
- borderDiagDownColor?: string;
1098
- /** Diagonal border top-left to bottom-right width in px. */
1099
- borderDiagDownWidth?: number;
1100
- /** Diagonal border bottom-left to top-right color. */
1101
- borderDiagUpColor?: string;
1102
- /** Diagonal border bottom-left to top-right width in px. */
1103
- borderDiagUpWidth?: number;
1104
- /** Table cell border dash style (legacy single value). */
1105
- borderDash?: string;
1106
- /**
1107
- * Per-edge border dash styles: an `a:prstDash` value, or `'custom'` for an
1108
- * `a:custDash`, whose pattern is in the edge's `...DashSegments`.
1109
- */
1110
- borderTopDash?: string;
1111
- borderBottomDash?: string;
1112
- borderLeftDash?: string;
1113
- borderRightDash?: string;
1114
- /**
1115
- * Per-edge custom dash patterns (`a:custDash/a:ds`), read and written when
1116
- * the edge's dash is `'custom'`: lengths relative to the line width, in
1117
- * thousandths of one percent (100000 is one line width).
1118
- */
1119
- borderTopDashSegments?: PptxCustomDashSegment[];
1120
- borderBottomDashSegments?: PptxCustomDashSegment[];
1121
- borderLeftDashSegments?: PptxCustomDashSegment[];
1122
- borderRightDashSegments?: PptxCustomDashSegment[];
1123
- /** Cell text shadow colour. */
1124
- textShadowColor?: string;
1125
- /** Cell text shadow blur radius in px. */
1126
- textShadowBlur?: number;
1127
- /** Cell text shadow horizontal offset in px. */
1128
- textShadowOffsetX?: number;
1129
- /** Cell text shadow vertical offset in px. */
1130
- textShadowOffsetY?: number;
1131
- /** Cell text shadow opacity (0-1). */
1132
- textShadowOpacity?: number;
1133
- /** Cell text glow colour. */
1134
- textGlowColor?: string;
1135
- /** Cell text glow radius in px. */
1136
- textGlowRadius?: number;
1137
- /** Cell text glow opacity (0-1). */
1138
- textGlowOpacity?: number;
1139
- /** Cell fill mode: solid, gradient, pattern, image, or none. */
1140
- fillMode?: 'solid' | 'gradient' | 'pattern' | 'image' | 'none';
1141
- /** Gradient fill stops (colours with positions). */
1142
- gradientFillStops?: Array<{
1143
- color: string;
1144
- position: number;
1145
- opacity?: number;
1146
- }>;
1147
- /** Gradient angle in degrees. */
1148
- gradientFillAngle?: number;
1149
- /** Gradient type: linear or radial. */
1150
- gradientFillType?: 'linear' | 'radial';
1151
- /** Path gradient sub-type. */
1152
- gradientFillPathType?: 'circle' | 'rect' | 'shape';
1153
- /** Focal point for radial gradients (0–1 fractions). */
1154
- gradientFillFocalPoint?: {
1155
- x: number;
1156
- y: number;
1157
- };
1158
- /** Raw fillToRect LTRB values (0–1 fractions) for gradient sizing. */
1159
- gradientFillFillToRect?: {
1160
- l: number;
1161
- t: number;
1162
- r: number;
1163
- b: number;
1164
- };
1165
- /** Pre-computed CSS gradient string for rendering. */
1166
- gradientFillCss?: string;
1167
- /** Pattern fill preset name (e.g. "ltDnDiag"). */
1168
- patternFillPreset?: string;
1169
- /** Pattern fill foreground colour. */
1170
- patternFillForeground?: string;
1171
- /** Pattern fill background colour. */
1172
- patternFillBackground?: string;
1173
- /**
1174
- * Image fill (`a:tcPr/a:blipFill`, CT_TableCellProperties). Resolved
1175
- * archive-relative path (or external `http(s):`/`data:` URL) for the
1176
- * cell's background image, from `a:blipFill/a:blip/@r:embed` (or
1177
- * `@r:link`). Present when `fillMode` is `'image'`.
1178
- *
1179
- * The parser resolves this synchronously (path only, no binary read);
1180
- * a viewer's load pipeline resolves it further to a displayable
1181
- * `data:`/`blob:` URL, written back to {@link backgroundImageFillData}.
1182
- */
1183
- backgroundImageFillPath?: string;
1184
- /**
1185
- * Displayable image data (`data:` or `blob:` URL) for an image cell
1186
- * fill, once resolved by the load pipeline. Renderers should prefer
1187
- * this over {@link backgroundImageFillPath} when both are present.
1188
- */
1189
- backgroundImageFillData?: string;
1190
- /**
1191
- * Cell 3D bevel + lighting from `a:tcPr/a:cell3D` (CT_Cell3D,
1192
- * ECMA-376 §21.1.3.1). Rendered as a CSS bevel treatment.
1193
- */
1194
- cell3D?: PptxTableCell3D;
1195
- /**
1196
- * `a:tcPr/@anchorCtr` - centre the text block in the direction
1197
- * perpendicular to the text flow (horizontal centring for horizontal text).
1198
- */
1199
- anchorCtr?: boolean;
1200
- /**
1201
- * `a:tcPr/@horzOverflow` (ST_TextHorzOverflowType): `clip` clips text at
1202
- * the cell edge, `overflow` (the default) lets it spill.
1203
- */
1204
- horzOverflow?: 'clip' | 'overflow';
1205
- }
1206
- /**
1207
- * Cell 3D bevel + lighting parsed from `a:tcPr/a:cell3D` (CT_Cell3D).
1208
- *
1209
- * Only the fields needed to render a plausible bevel treatment are captured;
1210
- * verbatim round-trip of the full node is handled separately by the save path.
1211
- *
1212
- * @example
1213
- * ```ts
1214
- * const c3d: PptxTableCell3D = {
1215
- * bevelWidth: 8,
1216
- * bevelHeight: 8,
1217
- * bevelPreset: 'circle',
1218
- * material: 'plastic',
1219
- * };
1220
- * // => satisfies PptxTableCell3D
1221
- * ```
1222
- */
1223
- interface PptxTableCell3D {
1224
- /** Bevel width in px (from `a:bevel@w`, EMU converted). */
1225
- bevelWidth?: number;
1226
- /** Bevel height in px (from `a:bevel@h`, EMU converted). */
1227
- bevelHeight?: number;
1228
- /** Bevel preset name (`a:bevel@prst`, e.g. `circle`, `relaxedInset`). */
1229
- bevelPreset?: string;
1230
- /** Preset material (`a:cell3D@prstMaterial`, e.g. `plastic`, `metal`). */
1231
- material?: string;
1232
- /** Light rig type (`a:lightRig@rig`, e.g. `threePt`, `soft`). */
1233
- lightRig?: string;
1234
- /** Light rig direction (`a:lightRig@dir`, e.g. `tl`, `t`, `tr`). */
1235
- lightRigDirection?: string;
1236
- }
1237
- /**
1238
- * One styled text run inside a table cell's `a:txBody`.
1239
- *
1240
- * `PptxTableCell.text` is a flat string and `PptxTableCell.style` describes
1241
- * only the FIRST run, so a cell mixing formats ("Revenue **grew 42%** last
1242
- * year") cannot be represented by those two alone. {@link PptxTableCell.runs}
1243
- * carries the full sequence, with paragraph and line breaks as marker entries
1244
- * so a renderer can walk it linearly.
1245
- *
1246
- * Structurally identical to `pptx-viewer-shared`'s `CellTextRun`, which every
1247
- * binding's table renderer already consumes.
1248
- *
1249
- * @example
1250
- * ```ts
1251
- * const runs: PptxTableCellTextRun[] = [
1252
- * { text: "Revenue " },
1253
- * { text: "grew 42%", bold: true, color: "#C00000" },
1254
- * ];
1255
- * // => satisfies PptxTableCellTextRun[]
1256
- * ```
1257
- */
1258
- interface PptxTableCellTextRun {
1259
- /** Run text. Empty for the break markers below. */
1260
- text: string;
1261
- /** This entry starts a new paragraph (`a:p` boundary) rather than carrying text. */
1262
- isParagraphBreak?: boolean;
1263
- /** This entry is a soft line break (`a:br`) rather than carrying text. */
1264
- isLineBreak?: boolean;
1265
- /** This entry carries an `a:fld` value rather than a literal `a:r`. */
1266
- isField?: true;
1267
- bold?: boolean;
1268
- italic?: boolean;
1269
- underline?: boolean;
1270
- strikethrough?: boolean;
1271
- /** Resolved run colour as a CSS colour string. */
1272
- color?: string;
1273
- /** Run font size in points (`a:rPr@sz` / 100). */
1274
- fontSize?: number;
1275
- /** Run font family from `a:rPr/a:latin@typeface` (or `a:ea` / `a:cs`). */
1276
- fontFamily?: string;
1277
- /** Run language from `a:rPr/@lang`, such as `ko-KR`. */
1278
- language?: string;
1279
- /**
1280
- * Run baseline shift from `a:rPr/@baseline`, in thousandths of a percent
1281
- * (`-25000` is a 25% subscript). Positive raises the run, negative lowers it.
1282
- */
1283
- baseline?: number;
1284
- /** Character spacing from `a:rPr/@spc`, in hundredths of a point. */
1285
- characterSpacing?: number;
1286
- }
1287
- /**
1288
- * One paragraph's own `a:pPr` layout inside a table cell: alignment,
1289
- * direction, left margin and first-line indent, line spacing, and space
1290
- * before and after. For an empty paragraph, also the size of its line from
1291
- * `a:endParaRPr`.
1292
- *
1293
- * The layout fields and units are the ones {@link TextStyle} uses for shape
1294
- * text (px for margins, indent and paragraph spacing; points for exact line
1295
- * spacing), so a renderer resolves both through the same paragraph helpers.
1296
- *
1297
- * @example
1298
- * ```ts
1299
- * const paragraph: PptxTableCellParagraph = {
1300
- * align: "right",
1301
- * paragraphMarginLeft: 12,
1302
- * lineSpacingExactPt: 9.6,
1303
- * };
1304
- * // => satisfies PptxTableCellParagraph
1305
- * ```
1306
- */
1307
- type PptxTableCellParagraph = Pick<TextStyle, 'align' | 'rtl' | 'paragraphMarginLeft' | 'paragraphIndent' | 'lineSpacing' | 'lineSpacingExactPt' | 'paragraphSpacingBefore' | 'paragraphSpacingAfter'> & {
1308
- /**
1309
- * For a paragraph with no run, field or break: the size of its line in
1310
- * points, from `a:endParaRPr@sz` (cell runs give their sizes in points too).
1311
- */
1312
- endParaFontSize?: number;
1313
- };
1314
- /**
1315
- * A single table cell with text content, optional style, and merge info.
1316
- *
1317
- * @example
1318
- * ```ts
1319
- * const cell: PptxTableCell = {
1320
- * text: "$1.5M",
1321
- * style: { bold: true, align: "right" },
1322
- * gridSpan: 1,
1323
- * };
1324
- * // => satisfies PptxTableCell
1325
- * ```
1326
- */
1327
- interface PptxTableCell {
1328
- text: string;
1329
- style?: PptxTableCellStyle;
1330
- /**
1331
- * Per-run formatting for the cell's text, when it has any beyond what
1332
- * {@link style} can express. Present only for cells whose `a:txBody`
1333
- * actually carries runs; renderers fall back to {@link text} when absent.
1334
- *
1335
- * Editing a cell's text invalidates these (the editor produces a plain
1336
- * string), so an edit path must clear them alongside setting `text`.
1337
- */
1338
- textRuns?: PptxTableCellTextRun[];
1339
- /**
1340
- * Each paragraph's own layout, one entry per `a:p` in source order (the
1341
- * paragraphs {@link textRuns} separates with `isParagraphBreak`). An entry
1342
- * is `{}` for a paragraph that sets none of it. Present only when some
1343
- * paragraph sets something. Editing the cell's text keeps only the first
1344
- * entry, as the rewritten `a:txBody` keeps only the first paragraph's
1345
- * `a:pPr`. Aligning the cell gives one entry per line of {@link text}
1346
- * instead; save writes as many as the cell has `a:p`.
1347
- */
1348
- paragraphs?: PptxTableCellParagraph[];
1349
- /** Column span (defaults to 1). */
1350
- gridSpan?: number;
1351
- /** Row span (defaults to 1). */
1352
- rowSpan?: number;
1353
- /** Whether this cell is merged vertically with the cell above. */
1354
- vMerge?: boolean;
1355
- /** Whether this cell is horizontally merged with the cell to the left (gridSpan continuation). */
1356
- hMerge?: boolean;
1357
- /**
1358
- * Opaque round-trip storage for `a:tcPr` attributes that don't yet have
1359
- * typed equivalents on {@link PptxTableCellStyle} (e.g. `horzOverflow`,
1360
- * `anchorCtr`, `headers`, `hideSlicers`, `slicerCacheId`). Keys are the
1361
- * raw XML attribute names without the `@_` prefix used by
1362
- * fast-xml-parser. Re-emitted verbatim by the save writer when present.
1363
- */
1364
- extraAttributes?: Record<string, string>;
1365
- }
1366
- /**
1367
- * A single table row with an optional height and an array of cells.
1368
- *
1369
- * @example
1370
- * ```ts
1371
- * const row: PptxTableRow = {
1372
- * height: 40,
1373
- * cells: [
1374
- * { text: "Name" },
1375
- * { text: "Score" },
1376
- * ],
1377
- * };
1378
- * // => satisfies PptxTableRow
1379
- * ```
1380
- */
1381
- interface PptxTableRow {
1382
- /** Row height in px. */
1383
- height?: number;
1384
- cells: PptxTableCell[];
1385
- }
1386
- /**
1387
- * Complete parsed table data for a {@link TablePptxElement}.
1388
- *
1389
- * Includes row/cell data, column widths, banding flags, and the applied
1390
- * table style ID.
1391
- *
1392
- * @example
1393
- * ```ts
1394
- * const data: PptxTableData = {
1395
- * rows: [
1396
- * { cells: [{ text: "Product" }, { text: "Revenue" }] },
1397
- * { cells: [{ text: "Widget A" }, { text: "$3.4M" }] },
1398
- * ],
1399
- * columnWidths: [0.6, 0.4],
1400
- * firstRowHeader: true,
1401
- * bandedRows: true,
1402
- * };
1403
- * // => satisfies PptxTableData
1404
- * ```
1405
- */
1406
- interface PptxTableData {
1407
- rows: PptxTableRow[];
1408
- /** Column widths as proportion of total (summing to 1). */
1409
- columnWidths: number[];
1410
- /** Whether the table has banded rows. */
1411
- bandedRows?: boolean;
1412
- /** Whether the first row is a header. */
1413
- firstRowHeader?: boolean;
1414
- /** Whether banded columns are enabled. */
1415
- bandedColumns?: boolean;
1416
- /** Whether the last row is styled as a total row. */
1417
- lastRow?: boolean;
1418
- /** Whether the first column is styled as a header column. */
1419
- firstCol?: boolean;
1420
- /** Whether the last column is styled specially. */
1421
- lastCol?: boolean;
1422
- /** Table style ID from `a:tblPr/a:tblStyle@val` or `a:tblPr@tblStyle`. */
1423
- tableStyleId?: string;
1424
- /**
1425
- * Set by a table style pick (which, like PowerPoint's, clears every cell's
1426
- * direct fill and borders): the next save drops the direct `a:tcPr` fills,
1427
- * lines and `a:cell3D` the cells' model styles no longer carry, even when
1428
- * `tableStyleId` ends up equal to the file's (the same style picked again,
1429
- * or a pick of B then back to A). Not read from or written to the file.
1430
- * It stays set after a save, which is harmless: a later save only removes
1431
- * children the model still has no value for.
1432
- */
1433
- clearDirectCellFormatting?: boolean;
1434
- /** Number of rows per banding group (default 1). */
1435
- bandRowCycle?: number;
1436
- /** Number of columns per banding group (default 1). */
1437
- bandColCycle?: number;
1438
- /** Right-to-left table layout from `a:tblPr/@rtl`. */
1439
- rtl?: boolean;
1440
- /**
1441
- * `a:tblPr`'s OWN fill (`CT_TableProperties` §21.1.3.15's
1442
- * `EG_FillProperties`), independent of any `a:tblStyleLst`-referenced style
1443
- * or that style's `a:tblBg`. Applied as the lowest-priority fill layer,
1444
- * beneath the table style's `wholeTbl` fill. Real PowerPoint decks route
1445
- * table appearance through `tableStyleId` instead, so this mainly matters
1446
- * for non-PowerPoint authoring tools (issue G6).
1447
- */
1448
- tableFill?: ParsedTableStyleFill;
1449
- /**
1450
- * `a:tblPr`'s own `a:effectLst` (or `a:effectDag`) effect chain,
1451
- * independent of the referenced table style, decomposed into a typed
1452
- * sequence of {@link ParsedTableStyleEffect} nodes (issue G6). Each node
1453
- * keeps its own XML verbatim for lossless round-trip; empty array is
1454
- * normalised to `undefined` by the parser so `tableEffects` is only ever
1455
- * present when there is at least one effect.
1456
- */
1457
- tableEffects?: ParsedTableStyleEffect[];
1458
- /**
1459
- * Table-cell-context default text size in points, resolved from the
1460
- * slide's master `p:otherStyle` (ECMA-376 §19.3.1.42 CT_TextListStyle,
1461
- * §19.3.1.52 for `p:txStyles`). PowerPoint sizes a table cell's text off
1462
- * this master default (commonly 18pt) whenever neither the run nor the
1463
- * (size-less) table style provides one; without it, cell text without an
1464
- * explicit `a:rPr@sz` fell back to the browser's own default font size
1465
- * (16px / 12pt) instead. A render-only hint: it is not part of any
1466
- * individual cell's parsed style and is never written back on save, so
1467
- * resaving an unstyled cell does not bake in an explicit size that was
1468
- * never authored. `undefined` when no master/otherStyle size resolves
1469
- * (renderers should leave the browser default in place in that case).
1470
- */
1471
- defaultCellFontSize?: number;
1472
- }
1473
- /**
1474
- * A single fill reference within a table style section.
1475
- *
1476
- * @example
1477
- * ```ts
1478
- * const fill: ParsedTableStyleFill = {
1479
- * schemeColor: "accent1",
1480
- * tint: 40000, // 40% tint
1481
- * };
1482
- * // => satisfies ParsedTableStyleFill
1483
- * ```
1484
- */
1485
- interface ParsedTableStyleFill {
1486
- /**
1487
- * Theme colour key (e.g. `accent1`, `dk1`). Empty string when the fill is a
1488
- * non-scheme fill (explicit sRGB, gradient, pattern, or none) that carries
1489
- * no theme colour reference; the renderer then resolves {@link color},
1490
- * {@link gradient}, {@link pattern}, or {@link noFill} instead.
1491
- */
1492
- schemeColor: string;
1493
- /** Tint value (0-100 000). */
1494
- tint?: number;
1495
- /** Shade value (0-100 000). */
1496
- shade?: number;
1497
- /**
1498
- * Alpha (opacity) value (0-100 000, where 100 000 is fully opaque) from an
1499
- * `a:alpha` child of `a:schemeClr`/`a:srgbClr`. Several built-in table
1500
- * styles (e.g. "Light Style 1/3", "Themed Style 1/2") band their rows with
1501
- * a partially transparent tint of the theme colour rather than a tint/shade
1502
- * blend.
1503
- */
1504
- alpha?: number;
1505
- /** Explicit sRGB hex colour (e.g. `#FF8800`) from `a:srgbClr`. */
1506
- color?: string;
1507
- /** The fill was `a:noFill`: renders transparent and clears lower layers. */
1508
- noFill?: boolean;
1509
- /** Gradient fill parsed from `a:gradFill`. */
1510
- gradient?: ParsedTableStyleGradient;
1511
- /** Preset pattern fill parsed from `a:pattFill`. */
1512
- pattern?: ParsedTableStylePattern;
1513
- /** Image texture fill parsed from `a:blipFill`. */
1514
- image?: ParsedTableStyleImage;
1515
- /**
1516
- * Set when the fill was resolved from `a:tcStyle/a:fillRef`: a JSON snapshot
1517
- * of the resolved fill (without this field). The save path compares it to
1518
- * tell an untouched reference from an edited fill.
1519
- */
1520
- fillRefSnapshot?: string;
1521
- }
1522
- /**
1523
- * An image texture fill parsed from a table style section's `a:blipFill`.
1524
- *
1525
- * `ppt/tableStyles.xml` is a presentation-level part parsed once (not
1526
- * per-slide), so this mirrors the per-CELL `a:tcPr/a:blipFill` two-field lazy
1527
- * pattern (`PptxTableCellStyle.backgroundImageFillPath` /
1528
- * `backgroundImageFillData`): `path` starts out as a raw archive-relative
1529
- * path (or an already-external `http(s):`/`data:` URL), and a load pipeline
1530
- * patches it to a displayable URL in `data` once resolved.
1531
- */
1532
- interface ParsedTableStyleImage {
1533
- /** Archive-relative path, or an already-displayable external/data URL. */
1534
- path?: string;
1535
- /** Displayable URL once a load pipeline has resolved `path`. */
1536
- data?: string;
1537
- }
1538
- /** A single colour stop within a {@link ParsedTableStyleGradient}. */
1539
- interface ParsedTableStyleGradientStop {
1540
- /** Stop position as a percentage (0-100). */
1541
- position: number;
1542
- /** Stop colour (scheme or explicit sRGB). */
1543
- fill: ParsedTableStyleFill;
1544
- }
1545
- /** A gradient fill parsed from a table style section's `a:gradFill`. */
1546
- interface ParsedTableStyleGradient {
1547
- /** Ordered colour stops. */
1548
- stops: ParsedTableStyleGradientStop[];
1549
- /** Linear gradient angle in degrees (from `a:lin@ang`, 60000ths -> deg). */
1550
- angle?: number;
1551
- /** Gradient family: linear (`a:lin`) or radial (`a:path`). */
1552
- type: 'linear' | 'radial';
1553
- }
1554
- /** A preset pattern fill parsed from a table style section's `a:pattFill`. */
1555
- interface ParsedTableStylePattern {
1556
- /** OOXML preset name (e.g. `ltDnDiag`) from `a:pattFill@prst`. */
1557
- preset: string;
1558
- /** Foreground colour (`a:fgClr`). */
1559
- foreground?: ParsedTableStyleFill;
1560
- /** Background colour (`a:bgClr`). */
1561
- background?: ParsedTableStyleFill;
1562
- }
1563
- /**
1564
- * A single entry in the parsed table style map.
1565
- *
1566
- * Contains fill colours for whole-table, banded rows/columns, first/last
1567
- * row, and first/last column sections.
1568
- *
1569
- * @example
1570
- * ```ts
1571
- * const entry: ParsedTableStyleEntry = {
1572
- * styleId: "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}",
1573
- * styleName: "Medium Style 2 - Accent 1",
1574
- * accentKey: "accent1",
1575
- * wholeTblFill: { schemeColor: "accent1", tint: 20000 },
1576
- * band1HFill: { schemeColor: "accent1", tint: 40000 },
1577
- * firstRowFill: { schemeColor: "accent1" },
1578
- * };
1579
- * // => satisfies ParsedTableStyleEntry
1580
- * ```
1581
- */
1582
- /** Text properties from a:tcTxStyle in a table style section. */
1583
- interface ParsedTableStyleText {
1584
- /** Font bold. */
1585
- bold?: boolean;
1586
- /** Font italic. */
1587
- italic?: boolean;
1588
- /** Font underline (from `a:tcTxStyle@u`, any value other than `none`). */
1589
- underline?: boolean;
1590
- /** Font colour as theme scheme key. */
1591
- fontSchemeColor?: string;
1592
- /** Font colour tint (0-100 000). */
1593
- fontTint?: number;
1594
- /** Font colour shade (0-100 000). */
1595
- fontShade?: number;
1596
- /** Explicit sRGB hex font colour (e.g. `#FF0000`) from `a:srgbClr`. */
1597
- fontColor?: string;
1598
- /** Typeface from `a:font@typeface` (latin font). */
1599
- fontFace?: string;
1600
- /** Font-collection index from `a:fontRef@idx` (`minor`, `major`, `none`). */
1601
- fontRefIdx?: string;
1602
- }
1603
- /**
1604
- * A single border side within a table style's `a:tcStyle/a:tcBdr`.
1605
- *
1606
- * Corresponds to one of `a:left`, `a:right`, `a:top`, `a:bottom`,
1607
- * `a:insideH`, `a:insideV`, `a:tl2br`, `a:tr2bl` (each a
1608
- * `CT_ThemeableLineStyle` wrapping an `a:ln`).
1609
- *
1610
- * @example
1611
- * ```ts
1612
- * const side: ParsedTableStyleBorder = {
1613
- * width: 1,
1614
- * dash: 'solid',
1615
- * fill: { schemeColor: 'lt1' },
1616
- * };
1617
- * // => satisfies ParsedTableStyleBorder
1618
- * ```
1619
- */
1620
- interface ParsedTableStyleBorder {
1621
- /** Line width in px (converted from the `a:ln@w` EMU value). */
1622
- width?: number;
1623
- /** OOXML `a:prstDash@val` (e.g. `solid`, `dash`, `sysDot`). */
1624
- dash?: string;
1625
- /** Compound line type from `a:ln@cmpd` (`sng`, `dbl`, `thickThin`, ...). */
1626
- compound?: string;
1627
- /** Border colour as a theme scheme fill (from `a:ln/a:solidFill/a:schemeClr`). */
1628
- fill?: ParsedTableStyleFill;
1629
- /** Explicit hex colour when the line used `a:srgbClr` (e.g. `#808080`). */
1630
- color?: string;
1631
- /** The line was `a:noFill` - an explicit "no border" that clears lower layers. */
1632
- noFill?: boolean;
1633
- /**
1634
- * Theme line-style reference (`<a:lnRef idx="N">`, the choice sibling of
1635
- * `a:ln`), as the "Themed Style" built-ins use. Set alone: the line's
1636
- * width, dash and colour come from the theme's `a:lnStyleLst[idx - 1]`
1637
- * with its `phClr` replaced by the reference's own colour.
1638
- */
1639
- lnRef?: ParsedTableFillRef;
1640
- }
1641
- /**
1642
- * The set of border sides parsed from a table style section's
1643
- * `a:tcStyle/a:tcBdr` element.
1644
- */
1645
- interface ParsedTableStyleBorders {
1646
- left?: ParsedTableStyleBorder;
1647
- right?: ParsedTableStyleBorder;
1648
- top?: ParsedTableStyleBorder;
1649
- bottom?: ParsedTableStyleBorder;
1650
- /** Interior horizontal borders between rows in the region. */
1651
- insideH?: ParsedTableStyleBorder;
1652
- /** Interior vertical borders between columns in the region. */
1653
- insideV?: ParsedTableStyleBorder;
1654
- /** Top-left to bottom-right diagonal. */
1655
- tl2br?: ParsedTableStyleBorder;
1656
- /**
1657
- * Top-right to bottom-left diagonal (`a:tr2bl`, ECMA-376's
1658
- * `CT_TableCellBorderStyle` sequence: left/right/top/bottom/insideH/
1659
- * insideV/tl2br/tr2bl). The field keeps its historical `bl2tr` spelling
1660
- * only in the sense that it names the same geometric anti-diagonal line
1661
- * (top-right-to-bottom-left and bottom-left-to-top-right describe one
1662
- * undirected diagonal); the parser accepts the real `a:tr2bl` element and,
1663
- * leniently, a legacy `a:bl2tr` this app previously wrote (issue G4).
1664
- */
1665
- tr2bl?: ParsedTableStyleBorder;
1666
- }
1667
- /**
1668
- * Table background style (CT_TableBackgroundStyle, ECMA-376 §21.1.3.7).
1669
- *
1670
- * Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`. Captures the
1671
- * resolved scheme-fill colour, an unresolved style-matrix `a:fillRef`, and a
1672
- * presence flag for effects (verbatim XML for the effect list is preserved
1673
- * separately by the save path).
1674
- */
1675
- interface ParsedTableBackground {
1676
- /** Solid fill (resolved from `a:fill > a:solidFill > a:schemeClr`). */
1677
- fill?: ParsedTableStyleFill;
1678
- /**
1679
- * Style-matrix fill reference (`<a:fillRef idx="N">...</a:fillRef>`),
1680
- * mutually exclusive with {@link fill} (`a:fill` is the choice sibling of
1681
- * `a:fillRef` in `CT_TableBackgroundStyle`).
1682
- */
1683
- fillRef?: ParsedTableFillRef;
1684
- /**
1685
- * Style-matrix effect reference (`<a:effectRef idx="N">...</a:effectRef>`,
1686
- * "Themed Style 1/2"): the theme's effect style (usually an outer shadow)
1687
- * drawn under the whole table.
1688
- */
1689
- effectRef?: ParsedTableFillRef;
1690
- /** The outer shadow {@link effectRef} resolves to against a theme (set at render time). */
1691
- shadow?: ParsedTableBackgroundShadow;
1692
- /** Has an `a:effectLst` child that should be round-tripped. */
1693
- hasEffectLst?: boolean;
1694
- }
1695
- /** The outer shadow a table style's `a:tblBg/a:effectRef` resolves to (px, colour as `#RRGGBB`). */
1696
- interface ParsedTableBackgroundShadow {
1697
- color: string;
1698
- /** 0..1. */
1699
- opacity: number;
1700
- blur: number;
1701
- offsetX: number;
1702
- offsetY: number;
1703
- }
1704
- interface ParsedTableStyleEntry {
1705
- styleId: string;
1706
- styleName?: string;
1707
- /** Dominant accent key derived from fills (e.g. `accent1`). */
1708
- accentKey?: string;
1709
- /** Table-level background (`<a:tblBg>`). */
1710
- tableBackground?: ParsedTableBackground;
1711
- wholeTblFill?: ParsedTableStyleFill;
1712
- band1HFill?: ParsedTableStyleFill;
1713
- band2HFill?: ParsedTableStyleFill;
1714
- band1VFill?: ParsedTableStyleFill;
1715
- band2VFill?: ParsedTableStyleFill;
1716
- firstRowFill?: ParsedTableStyleFill;
1717
- lastRowFill?: ParsedTableStyleFill;
1718
- firstColFill?: ParsedTableStyleFill;
1719
- lastColFill?: ParsedTableStyleFill;
1720
- /** Corner cell fills (`<a:seCell>`, `<a:swCell>`, `<a:neCell>`, `<a:nwCell>`). */
1721
- seCellFill?: ParsedTableStyleFill;
1722
- swCellFill?: ParsedTableStyleFill;
1723
- neCellFill?: ParsedTableStyleFill;
1724
- nwCellFill?: ParsedTableStyleFill;
1725
- /**
1726
- * Per-role border styling from `a:tcStyle/a:tcBdr`. These supply the
1727
- * gridlines/edges a styled table inherits from its table style when the
1728
- * cells carry no explicit per-cell `a:lnX` overrides.
1729
- */
1730
- wholeTblBorders?: ParsedTableStyleBorders;
1731
- firstRowBorders?: ParsedTableStyleBorders;
1732
- lastRowBorders?: ParsedTableStyleBorders;
1733
- firstColBorders?: ParsedTableStyleBorders;
1734
- lastColBorders?: ParsedTableStyleBorders;
1735
- band1HBorders?: ParsedTableStyleBorders;
1736
- band2HBorders?: ParsedTableStyleBorders;
1737
- band1VBorders?: ParsedTableStyleBorders;
1738
- band2VBorders?: ParsedTableStyleBorders;
1739
- seCellBorders?: ParsedTableStyleBorders;
1740
- swCellBorders?: ParsedTableStyleBorders;
1741
- neCellBorders?: ParsedTableStyleBorders;
1742
- nwCellBorders?: ParsedTableStyleBorders;
1743
- /** Per-role text styling from a:tcTxStyle. */
1744
- wholeTblText?: ParsedTableStyleText;
1745
- firstRowText?: ParsedTableStyleText;
1746
- lastRowText?: ParsedTableStyleText;
1747
- firstColText?: ParsedTableStyleText;
1748
- lastColText?: ParsedTableStyleText;
1749
- band1HText?: ParsedTableStyleText;
1750
- band2HText?: ParsedTableStyleText;
1751
- band1VText?: ParsedTableStyleText;
1752
- band2VText?: ParsedTableStyleText;
1753
- seCellText?: ParsedTableStyleText;
1754
- swCellText?: ParsedTableStyleText;
1755
- neCellText?: ParsedTableStyleText;
1756
- nwCellText?: ParsedTableStyleText;
1757
- /**
1758
- * Per-role 3D bevel + lighting from `a:tcStyle/a:cell3D` (CT_Cell3D),
1759
- * distinct from the per-cell `a:tcPr/a:cell3D` {@link PptxTableCellStyle}
1760
- * already supports. None of PowerPoint's 74 built-in gallery styles use
1761
- * this (0 hits in the built-in catalogue), so it only matters for a
1762
- * hand-authored or third-party table style.
1763
- */
1764
- wholeTblCell3D?: PptxTableCell3D;
1765
- firstRowCell3D?: PptxTableCell3D;
1766
- lastRowCell3D?: PptxTableCell3D;
1767
- firstColCell3D?: PptxTableCell3D;
1768
- lastColCell3D?: PptxTableCell3D;
1769
- band1HCell3D?: PptxTableCell3D;
1770
- band2HCell3D?: PptxTableCell3D;
1771
- band1VCell3D?: PptxTableCell3D;
1772
- band2VCell3D?: PptxTableCell3D;
1773
- seCellCell3D?: PptxTableCell3D;
1774
- swCellCell3D?: PptxTableCell3D;
1775
- neCellCell3D?: PptxTableCell3D;
1776
- nwCellCell3D?: PptxTableCell3D;
1777
- }
1778
- /**
1779
- * Map of GUID → table style entry.
1780
- *
1781
- * Parsed from `ppt/tableStyles.xml` and indexed by the style GUID
1782
- * referenced in `a:tblPr@tblStyle`.
1783
- *
1784
- * @example
1785
- * ```ts
1786
- * const styles: ParsedTableStyleMap = {
1787
- * "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}": {
1788
- * styleId: "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}",
1789
- * styleName: "Medium Style 2 - Accent 1",
1790
- * accentKey: "accent1",
1791
- * },
1792
- * };
1793
- * // => satisfies ParsedTableStyleMap
1794
- * ```
1795
- */
1796
- type ParsedTableStyleMap = Record<string, ParsedTableStyleEntry>;
1797
- export { PptxImageEffects as A, TableStyleSectionPatch as C, PptxBackgroundRemoval as D, ShapeStyle as E, PptxImagePrerenderedCorrections as M, PptxImageProperties as N, PptxBackgroundRemovalMark as O, ParsedTableStyleEffect as S, ResolvedStyleMatrix as T, PptxTableCellTextRun as _, ParsedTableStyleEntry as a, CreateTableStyleOptions as b, ParsedTableStyleGradientStop as c, ParsedTableStylePattern as d, ParsedTableStyleText as f, PptxTableCellStyle as g, PptxTableCellParagraph as h, ParsedTableStyleBorders as i, PptxImageLayout as j, PptxCropShape as k, ParsedTableStyleImage as l, PptxTableCell3D as m, ParsedTableBackgroundShadow as n, ParsedTableStyleFill as o, PptxTableCell as p, ParsedTableStyleBorder as r, ParsedTableStyleGradient as s, ParsedTableBackground as t, ParsedTableStyleMap as u, PptxTableData as v, PptxCustomDashSegment as w, ParsedTableFillRef as x, PptxTableRow as y };
1798
- //# sourceMappingURL=table-DUO1H9-r.d.ts.map