ooxml-core 1.41.0 → 1.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/{PptxHandler-3AGIITR7.mjs → PptxHandler-3VAVJDFB.mjs} +2 -2
- package/dist/PptxHandler-V23RDNEX.cjs +14 -0
- package/dist/PptxHandler-WB3KL2WH.mjs +5 -0
- package/dist/{PresentationBuilder-JNID4B4Z.mjs → PresentationBuilder-7LJMTRJ6.mjs} +2 -2
- package/dist/{PresentationBuilder-MZBKYOYD.cjs → PresentationBuilder-KHL6GONR.cjs} +6 -6
- package/dist/{PresentationBuilder-5DPKFUXP.mjs → PresentationBuilder-PY2GB4IG.mjs} +3 -3
- package/dist/automation/index.cjs +79 -91
- package/dist/automation/index.mjs +79 -91
- package/dist/chart/index.cjs +12 -9
- package/dist/chart/index.mjs +12 -9
- package/dist/{chunk-ZYCBJKAE.mjs → chunk-243ZYX2B.mjs} +1 -1
- package/dist/{chunk-LRBWCRQ3.cjs → chunk-3J6VIKLP.cjs} +3 -3
- package/dist/{chunk-DD7COXWR.mjs → chunk-4LEVL6ZW.mjs} +30 -13
- package/dist/chunk-CODMW5KF.cjs +110 -0
- package/dist/{chunk-HTELXT2N.mjs → chunk-HLYOHD2Z.mjs} +30 -12
- package/dist/{chunk-P3WAKBVS.mjs → chunk-IPV3J3I5.mjs} +82 -90
- package/dist/{chunk-6LGRRQ3K.mjs → chunk-JHYU7HGG.mjs} +1 -1
- package/dist/{chunk-JXR6YWBW.mjs → chunk-KCDLTVUI.mjs} +125 -126
- package/dist/chunk-O3YGBYGZ.mjs +104 -0
- package/dist/{chunk-75KBNUKS.cjs → chunk-QZPOPUI5.cjs} +82 -89
- package/dist/{chunk-3BIFRTU4.cjs → chunk-RNZQ2OU4.cjs} +1294 -1276
- package/dist/{chunk-UE23HF2N.mjs → chunk-VKFKEVHK.mjs} +1 -1
- package/dist/{chunk-KKVD3R6O.mjs → chunk-WEAWSXUX.mjs} +4 -4
- package/dist/diagram/index.cjs +499 -370
- package/dist/diagram/index.d.ts +1 -0
- package/dist/diagram/index.d.ts.map +1 -1
- package/dist/diagram/index.mjs +495 -371
- package/dist/docx/embedded.cjs +67 -89
- package/dist/docx/embedded.mjs +67 -89
- package/dist/docx/index.cjs +125 -110
- package/dist/docx/index.mjs +125 -110
- package/dist/docx/layout/index.cjs +257 -110
- package/dist/docx/layout/index.d.ts +1 -0
- package/dist/docx/layout/index.d.ts.map +1 -1
- package/dist/docx/layout/index.mjs +257 -111
- package/dist/docx/layout/webfont-runs.d.ts +5 -0
- package/dist/docx/layout/webfont-runs.d.ts.map +1 -0
- package/dist/docx/load/index.cjs +67 -89
- package/dist/docx/load/index.mjs +67 -89
- package/dist/docx/shape-svg.d.ts.map +1 -1
- package/dist/docx/ui/index.cjs +79 -98
- package/dist/docx/ui/index.mjs +79 -98
- package/dist/drawingml/dash-pattern.d.ts +61 -0
- package/dist/drawingml/dash-pattern.d.ts.map +1 -0
- package/dist/drawingml/index.cjs +249 -43
- package/dist/drawingml/index.d.ts +3 -0
- package/dist/drawingml/index.d.ts.map +1 -1
- package/dist/drawingml/index.mjs +241 -44
- package/dist/drawingml/rect-path-gradient.d.ts +5 -0
- package/dist/drawingml/rect-path-gradient.d.ts.map +1 -1
- package/dist/drawingml/shape-path-gradient.d.ts +57 -0
- package/dist/drawingml/shape-path-gradient.d.ts.map +1 -0
- package/dist/geometry/index.cjs +68 -90
- package/dist/geometry/index.mjs +68 -90
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts +2 -2
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts.map +1 -1
- package/dist/index.cjs +2937 -493
- package/dist/index.mjs +2937 -493
- package/dist/pptx/automation/index.cjs +366 -197
- package/dist/pptx/automation/index.d.ts +11 -17
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +156 -71
- package/dist/pptx/chunks/{elements-6BMEOo7i.d.ts → elements-PBugbKtv.d.ts} +3 -873
- package/dist/pptx/chunks/elements-PBugbKtv.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-BbXLv6As.d.ts → index-Bj-hur0D.d.ts} +4 -4
- package/dist/pptx/chunks/{index-BbXLv6As.d.ts.map → index-Bj-hur0D.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-DvN0TkJJ.d.ts → index-CCJiD-Bm.d.ts} +14 -10
- package/dist/pptx/chunks/index-CCJiD-Bm.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-Dija_Wth.d.ts → index-CGNb1TV9.d.ts} +22 -4
- package/dist/pptx/chunks/index-CGNb1TV9.d.ts.map +1 -0
- package/dist/pptx/chunks/table-C7ITXL3Y.d.ts +875 -0
- package/dist/pptx/chunks/table-C7ITXL3Y.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-DorONr3h.d.ts → text-operations-BNJr7aGa.d.ts} +3 -2
- package/dist/pptx/chunks/text-operations-BNJr7aGa.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +180 -102
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +69 -91
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/editor/render/table-data-grid-ops.cjs +5 -5
- package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
- package/dist/pptx/editor/render/table-layout.cjs +6 -6
- package/dist/pptx/editor/render/table-layout.d.ts +8 -37
- package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-layout.mjs +1 -1
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
- package/dist/pptx/index.cjs +225 -135
- package/dist/pptx/index.d.ts +6 -5
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/teams/index.cjs +136 -91
- package/dist/teams/index.mjs +136 -91
- package/dist/text/css-font-family.d.ts.map +1 -1
- package/dist/text/font-metrics/design-advances.generated.d.ts +3 -1
- package/dist/text/font-metrics/design-advances.generated.d.ts.map +1 -1
- package/dist/text/index.cjs +2252 -0
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.mjs +2231 -1
- package/dist/text/metric-font-family.d.ts.map +1 -1
- package/dist/text/webfonts/font-weight-names.d.ts +66 -0
- package/dist/text/webfonts/font-weight-names.d.ts.map +1 -0
- package/dist/text/webfonts/google-fonts-catalogue.d.ts +14 -0
- package/dist/text/webfonts/google-fonts-catalogue.d.ts.map +1 -0
- package/dist/text/webfonts/google-fonts-lookup.d.ts +7 -0
- package/dist/text/webfonts/google-fonts-lookup.d.ts.map +1 -0
- package/dist/text/webfonts/google-fonts-request.d.ts +57 -0
- package/dist/text/webfonts/google-fonts-request.d.ts.map +1 -0
- package/dist/text/webfonts/index.d.ts +12 -0
- package/dist/text/webfonts/index.d.ts.map +1 -0
- package/dist/text/webfonts/metric-clones.d.ts +17 -0
- package/dist/text/webfonts/metric-clones.d.ts.map +1 -0
- package/dist/text/webfonts/webfont-faces.d.ts +24 -0
- package/dist/text/webfonts/webfont-faces.d.ts.map +1 -0
- package/dist/visio/index.cjs +64 -0
- package/dist/visio/index.d.ts +1 -0
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +64 -1
- package/dist/visio/ui/index.cjs +8 -0
- package/dist/visio/ui/index.mjs +8 -0
- package/dist/visio/webfont-runs.d.ts +27 -0
- package/dist/visio/webfont-runs.d.ts.map +1 -0
- package/dist/xlsx/collab/index.cjs +67 -89
- package/dist/xlsx/collab/index.mjs +67 -89
- package/dist/xlsx/index.cjs +2253 -118
- package/dist/xlsx/index.mjs +2249 -119
- package/dist/xlsx/layout/font-stack.d.ts +8 -0
- package/dist/xlsx/layout/font-stack.d.ts.map +1 -0
- package/dist/xlsx/layout/index.d.ts +3 -1
- package/dist/xlsx/layout/index.d.ts.map +1 -1
- package/dist/xlsx/layout/shape-paint.d.ts.map +1 -1
- package/dist/xlsx/layout/shape-view.d.ts.map +1 -1
- package/dist/xlsx/layout/style-view.d.ts +2 -0
- package/dist/xlsx/layout/style-view.d.ts.map +1 -1
- package/dist/xlsx/layout/webfont-runs.d.ts +11 -0
- package/dist/xlsx/layout/webfont-runs.d.ts.map +1 -0
- package/dist/xlsx/load/index.cjs +67 -89
- package/dist/xlsx/load/index.mjs +67 -89
- package/dist/xlsx/ui/commands/util.d.ts.map +1 -1
- package/dist/xlsx/ui/context.d.ts +5 -0
- package/dist/xlsx/ui/context.d.ts.map +1 -1
- package/dist/xlsx/ui/grid/cell-paint.d.ts +3 -2
- package/dist/xlsx/ui/grid/cell-paint.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +2093 -102
- package/dist/xlsx/ui/index.mjs +2093 -103
- package/package.json +1 -1
- package/dist/PptxHandler-EL4E4SPH.mjs +0 -5
- package/dist/PptxHandler-OIZ3R3DJ.cjs +0 -14
- package/dist/chunk-3IT6ZD7K.mjs +0 -213
- package/dist/chunk-FRUB573B.cjs +0 -219
- package/dist/pptx/chunks/elements-6BMEOo7i.d.ts.map +0 -1
- package/dist/pptx/chunks/index-Dija_Wth.d.ts.map +0 -1
- package/dist/pptx/chunks/index-DvN0TkJJ.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-DorONr3h.d.ts.map +0 -1
|
@@ -0,0 +1,875 @@
|
|
|
1
|
+
import { i as TextStyle, k as XmlObject } from "./text-t_wJ2OwM.js";
|
|
2
|
+
import { t as PptxThemeColorRef } from "./color-ref-CwUQoKPJ.js";
|
|
3
|
+
/**
|
|
4
|
+
* A `a:fillRef`/`a:lnRef`/`a:effectRef`-style style-matrix reference: an
|
|
5
|
+
* index into the theme's format scheme (`a:fmtScheme/a:fillStyleLst`, 1-based
|
|
6
|
+
* per ECMA-376 §20.1.4.1.12) plus an optional colour transform child.
|
|
7
|
+
*
|
|
8
|
+
* Distinct from an already-resolved {@link ParsedTableStyleFill}: a fill ref
|
|
9
|
+
* points AT a theme style-matrix entry rather than carrying a colour choice
|
|
10
|
+
* directly, though the two commonly appear together (`<a:fillRef idx="2">
|
|
11
|
+
* <a:schemeClr val="accent1"/></a:fillRef>`).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const ref: ParsedTableFillRef = { idx: 2, color: { schemeColor: 'accent1' } };
|
|
16
|
+
* // => satisfies ParsedTableFillRef
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
interface ParsedTableFillRef {
|
|
20
|
+
/** 1-based index into the theme format scheme's fill style list. */
|
|
21
|
+
idx: number;
|
|
22
|
+
/** Colour transform child (`a:schemeClr`/`a:srgbClr`) applied to the referenced style. */
|
|
23
|
+
color?: ParsedTableStyleFill;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One leaf (or `effectDag`-wrapped) node of an `a:effectLst`/`a:effectDag`
|
|
27
|
+
* effect chain, kept mostly opaque: {@link kind} names the OOXML element so a
|
|
28
|
+
* consumer can recognise common effects (`outerShdw`, `glow`, `softEdge`,
|
|
29
|
+
* `reflection`, `blur`, `innerShdw`, `prstShdw`, `fillOverlay`, `alphaModFix`,
|
|
30
|
+
* `alphaInv`, `grayscl`, `biLevel`, `duotone`, `hsl`, `lum`, `tint`) without
|
|
31
|
+
* this module re-deriving the full shape-effect taxonomy already modelled on
|
|
32
|
+
* `ShapeStyle`; {@link xml} preserves the node verbatim for lossless re-emit.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const effect: ParsedTableStyleEffect = {
|
|
37
|
+
* kind: 'outerShdw',
|
|
38
|
+
* xml: { '@_blurRad': '40000', '@_dist': '20000', '@_dir': '5400000' },
|
|
39
|
+
* };
|
|
40
|
+
* // => satisfies ParsedTableStyleEffect
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
interface ParsedTableStyleEffect {
|
|
44
|
+
/** The OOXML element's local name, e.g. `outerShdw`, `glow`, `softEdge`. */
|
|
45
|
+
kind: string;
|
|
46
|
+
/** Verbatim XML node (attributes + children) for lossless round-trip. */
|
|
47
|
+
xml: XmlObject;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A patch to apply to ONE `CT_TableStyle` section (`a:wholeTbl`, `a:band1H`,
|
|
51
|
+
* `a:firstRow`, a corner cell, ...) when editing an existing table style.
|
|
52
|
+
* Every field is independently optional: an absent field leaves that facet
|
|
53
|
+
* of the section untouched, `null` (currently only supported for
|
|
54
|
+
* {@link fill}/{@link text}/{@link borders}/{@link cell3D} at the top level)
|
|
55
|
+
* is not accepted here (delete a whole style with
|
|
56
|
+
* `deleteTableStyleFromMap` / `tableStylesToDelete` instead of clearing every
|
|
57
|
+
* facet of every section).
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const patch: TableStyleSectionPatch = {
|
|
62
|
+
* fill: { schemeColor: 'accent2', tint: 40000 },
|
|
63
|
+
* text: { bold: true },
|
|
64
|
+
* };
|
|
65
|
+
* // => satisfies TableStyleSectionPatch
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
interface TableStyleSectionPatch {
|
|
69
|
+
fill?: ParsedTableStyleFill;
|
|
70
|
+
text?: ParsedTableStyleText;
|
|
71
|
+
borders?: ParsedTableStyleBorders;
|
|
72
|
+
cell3D?: PptxTableCell3D;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Options for creating a brand-new `a:tblStyle` entry with
|
|
76
|
+
* `createTableStyleEntry` (`packages/core/.../table-style-editor.ts`).
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const opts: CreateTableStyleOptions = { styleName: 'My Custom Style' };
|
|
81
|
+
* // => satisfies CreateTableStyleOptions
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
interface CreateTableStyleOptions {
|
|
85
|
+
/** Display name for the new style (`a:tblStyle/@styleName`). */
|
|
86
|
+
styleName: string;
|
|
87
|
+
/**
|
|
88
|
+
* An existing entry to deep-clone section-by-section as the starting
|
|
89
|
+
* point (all fill/text/border/cell3D/background sections), with a fresh
|
|
90
|
+
* `styleId` substituted in. Omit for a blank style with no sections.
|
|
91
|
+
*/
|
|
92
|
+
basedOn?: ParsedTableStyleEntry;
|
|
93
|
+
/**
|
|
94
|
+
* Explicit style GUID (braced, e.g. `{...}`). When omitted a new GUID is
|
|
95
|
+
* generated (`globalThis.crypto.randomUUID()` when available).
|
|
96
|
+
*/
|
|
97
|
+
styleId?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Per-cell visual style for a table cell.
|
|
101
|
+
*
|
|
102
|
+
* All fields are optional - unset values inherit from the table style.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* const header: PptxTableCellStyle = {
|
|
107
|
+
* bold: true,
|
|
108
|
+
* fontSize: 14,
|
|
109
|
+
* color: "#FFFFFF",
|
|
110
|
+
* backgroundColor: "#0055AA",
|
|
111
|
+
* align: "center",
|
|
112
|
+
* };
|
|
113
|
+
* // => satisfies PptxTableCellStyle
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
interface PptxTableCellStyle {
|
|
117
|
+
/** Font size in points (`a:rPr@sz / 100`). */
|
|
118
|
+
fontSize?: number;
|
|
119
|
+
bold?: boolean;
|
|
120
|
+
italic?: boolean;
|
|
121
|
+
underline?: boolean;
|
|
122
|
+
color?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Font family from the first run's `a:rPr/a:latin@typeface` (falling back to
|
|
125
|
+
* `a:ea` / `a:cs`). Per-run families live on {@link PptxTableCellTextRun}.
|
|
126
|
+
*/
|
|
127
|
+
fontFamily?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Raw XML colour-choice node preserved from `a:tc/a:txBody/.../a:rPr/a:solidFill`
|
|
130
|
+
* for round-trip serialisation. Currently unused by the cell-level writer
|
|
131
|
+
* (cell text colour falls through `writeCellTextFormatting`), reserved for
|
|
132
|
+
* future expansion alongside the run-properties round-trip path.
|
|
133
|
+
*/
|
|
134
|
+
colorXml?: XmlObject;
|
|
135
|
+
/**
|
|
136
|
+
* Typed theme colour reference for the cell text colour, set when
|
|
137
|
+
* {@link colorXml} is a plain `a:schemeClr`. Wins on save, mirroring
|
|
138
|
+
* `TextStyle.colorRef`. Distinct from {@link ParsedTableStyleFill.schemeColor},
|
|
139
|
+
* which describes a `ppt/tableStyles.xml` section fill rather than an
|
|
140
|
+
* individual cell override.
|
|
141
|
+
*/
|
|
142
|
+
colorRef?: PptxThemeColorRef;
|
|
143
|
+
backgroundColor?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Raw XML colour-choice node preserved from cell `a:tcPr/a:solidFill` for
|
|
146
|
+
* round-trip serialisation. Re-emitted verbatim when the resolved
|
|
147
|
+
* {@link backgroundColor} still matches the original colour.
|
|
148
|
+
*/
|
|
149
|
+
backgroundColorXml?: XmlObject;
|
|
150
|
+
/**
|
|
151
|
+
* Typed theme colour reference for the cell fill, set when
|
|
152
|
+
* {@link backgroundColorXml} is a plain `a:schemeClr`. Wins on save,
|
|
153
|
+
* mirroring `ShapeStyle.fillColorRef`.
|
|
154
|
+
*/
|
|
155
|
+
backgroundColorRef?: PptxThemeColorRef;
|
|
156
|
+
borderColor?: string;
|
|
157
|
+
/** Top border width in px. */
|
|
158
|
+
borderTopWidth?: number;
|
|
159
|
+
/** Bottom border width in px. */
|
|
160
|
+
borderBottomWidth?: number;
|
|
161
|
+
/** Left border width in px. */
|
|
162
|
+
borderLeftWidth?: number;
|
|
163
|
+
/** Right border width in px. */
|
|
164
|
+
borderRightWidth?: number;
|
|
165
|
+
/** Top border color as hex. */
|
|
166
|
+
borderTopColor?: string;
|
|
167
|
+
/** Bottom border color as hex. */
|
|
168
|
+
borderBottomColor?: string;
|
|
169
|
+
/** Left border color as hex. */
|
|
170
|
+
borderLeftColor?: string;
|
|
171
|
+
/** Right border color as hex. */
|
|
172
|
+
borderRightColor?: string;
|
|
173
|
+
align?: TextStyle['align'];
|
|
174
|
+
vAlign?: 'top' | 'middle' | 'bottom';
|
|
175
|
+
/** Text direction from `a:tcPr/@vert` (spec values from CT_TextVerticalType). */
|
|
176
|
+
textDirection?: 'vert' | 'vert270' | 'eaVert' | 'wordArtVert' | 'wordArtVertRtl' | 'mongolianVert';
|
|
177
|
+
/** Cell left margin in px (from a:tcPr > a:tcMar > a:marL). */
|
|
178
|
+
marginLeft?: number;
|
|
179
|
+
/** Cell right margin in px. */
|
|
180
|
+
marginRight?: number;
|
|
181
|
+
/** Cell top margin in px. */
|
|
182
|
+
marginTop?: number;
|
|
183
|
+
/** Cell bottom margin in px. */
|
|
184
|
+
marginBottom?: number;
|
|
185
|
+
/** Diagonal border top-left to bottom-right color. */
|
|
186
|
+
borderDiagDownColor?: string;
|
|
187
|
+
/** Diagonal border top-left to bottom-right width in px. */
|
|
188
|
+
borderDiagDownWidth?: number;
|
|
189
|
+
/** Diagonal border bottom-left to top-right color. */
|
|
190
|
+
borderDiagUpColor?: string;
|
|
191
|
+
/** Diagonal border bottom-left to top-right width in px. */
|
|
192
|
+
borderDiagUpWidth?: number;
|
|
193
|
+
/** Table cell border dash style (legacy single value). */
|
|
194
|
+
borderDash?: string;
|
|
195
|
+
/** Per-edge border dash styles. */
|
|
196
|
+
borderTopDash?: string;
|
|
197
|
+
borderBottomDash?: string;
|
|
198
|
+
borderLeftDash?: string;
|
|
199
|
+
borderRightDash?: string;
|
|
200
|
+
/** Cell text shadow colour. */
|
|
201
|
+
textShadowColor?: string;
|
|
202
|
+
/** Cell text shadow blur radius in px. */
|
|
203
|
+
textShadowBlur?: number;
|
|
204
|
+
/** Cell text shadow horizontal offset in px. */
|
|
205
|
+
textShadowOffsetX?: number;
|
|
206
|
+
/** Cell text shadow vertical offset in px. */
|
|
207
|
+
textShadowOffsetY?: number;
|
|
208
|
+
/** Cell text shadow opacity (0-1). */
|
|
209
|
+
textShadowOpacity?: number;
|
|
210
|
+
/** Cell text glow colour. */
|
|
211
|
+
textGlowColor?: string;
|
|
212
|
+
/** Cell text glow radius in px. */
|
|
213
|
+
textGlowRadius?: number;
|
|
214
|
+
/** Cell text glow opacity (0-1). */
|
|
215
|
+
textGlowOpacity?: number;
|
|
216
|
+
/** Cell fill mode: solid, gradient, pattern, image, or none. */
|
|
217
|
+
fillMode?: 'solid' | 'gradient' | 'pattern' | 'image' | 'none';
|
|
218
|
+
/** Gradient fill stops (colours with positions). */
|
|
219
|
+
gradientFillStops?: Array<{
|
|
220
|
+
color: string;
|
|
221
|
+
position: number;
|
|
222
|
+
opacity?: number;
|
|
223
|
+
}>;
|
|
224
|
+
/** Gradient angle in degrees. */
|
|
225
|
+
gradientFillAngle?: number;
|
|
226
|
+
/** Gradient type: linear or radial. */
|
|
227
|
+
gradientFillType?: 'linear' | 'radial';
|
|
228
|
+
/** Path gradient sub-type. */
|
|
229
|
+
gradientFillPathType?: 'circle' | 'rect' | 'shape';
|
|
230
|
+
/** Focal point for radial gradients (0–1 fractions). */
|
|
231
|
+
gradientFillFocalPoint?: {
|
|
232
|
+
x: number;
|
|
233
|
+
y: number;
|
|
234
|
+
};
|
|
235
|
+
/** Raw fillToRect LTRB values (0–1 fractions) for gradient sizing. */
|
|
236
|
+
gradientFillFillToRect?: {
|
|
237
|
+
l: number;
|
|
238
|
+
t: number;
|
|
239
|
+
r: number;
|
|
240
|
+
b: number;
|
|
241
|
+
};
|
|
242
|
+
/** Pre-computed CSS gradient string for rendering. */
|
|
243
|
+
gradientFillCss?: string;
|
|
244
|
+
/** Pattern fill preset name (e.g. "ltDnDiag"). */
|
|
245
|
+
patternFillPreset?: string;
|
|
246
|
+
/** Pattern fill foreground colour. */
|
|
247
|
+
patternFillForeground?: string;
|
|
248
|
+
/** Pattern fill background colour. */
|
|
249
|
+
patternFillBackground?: string;
|
|
250
|
+
/**
|
|
251
|
+
* Image fill (`a:tcPr/a:blipFill`, CT_TableCellProperties). Resolved
|
|
252
|
+
* archive-relative path (or external `http(s):`/`data:` URL) for the
|
|
253
|
+
* cell's background image, from `a:blipFill/a:blip/@r:embed` (or
|
|
254
|
+
* `@r:link`). Present when `fillMode` is `'image'`.
|
|
255
|
+
*
|
|
256
|
+
* The parser resolves this synchronously (path only, no binary read);
|
|
257
|
+
* a viewer's load pipeline resolves it further to a displayable
|
|
258
|
+
* `data:`/`blob:` URL, written back to {@link backgroundImageFillData}.
|
|
259
|
+
*/
|
|
260
|
+
backgroundImageFillPath?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Displayable image data (`data:` or `blob:` URL) for an image cell
|
|
263
|
+
* fill, once resolved by the load pipeline. Renderers should prefer
|
|
264
|
+
* this over {@link backgroundImageFillPath} when both are present.
|
|
265
|
+
*/
|
|
266
|
+
backgroundImageFillData?: string;
|
|
267
|
+
/**
|
|
268
|
+
* Cell 3D bevel + lighting from `a:tcPr/a:cell3D` (CT_Cell3D,
|
|
269
|
+
* ECMA-376 §21.1.3.1). Rendered as a CSS bevel treatment.
|
|
270
|
+
*/
|
|
271
|
+
cell3D?: PptxTableCell3D;
|
|
272
|
+
/**
|
|
273
|
+
* `a:tcPr/@anchorCtr` - centre the text block in the direction
|
|
274
|
+
* perpendicular to the text flow (horizontal centring for horizontal text).
|
|
275
|
+
*/
|
|
276
|
+
anchorCtr?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* `a:tcPr/@horzOverflow` (ST_TextHorzOverflowType): `clip` clips text at
|
|
279
|
+
* the cell edge, `overflow` (the default) lets it spill.
|
|
280
|
+
*/
|
|
281
|
+
horzOverflow?: 'clip' | 'overflow';
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Cell 3D bevel + lighting parsed from `a:tcPr/a:cell3D` (CT_Cell3D).
|
|
285
|
+
*
|
|
286
|
+
* Only the fields needed to render a plausible bevel treatment are captured;
|
|
287
|
+
* verbatim round-trip of the full node is handled separately by the save path.
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```ts
|
|
291
|
+
* const c3d: PptxTableCell3D = {
|
|
292
|
+
* bevelWidth: 8,
|
|
293
|
+
* bevelHeight: 8,
|
|
294
|
+
* bevelPreset: 'circle',
|
|
295
|
+
* material: 'plastic',
|
|
296
|
+
* };
|
|
297
|
+
* // => satisfies PptxTableCell3D
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
interface PptxTableCell3D {
|
|
301
|
+
/** Bevel width in px (from `a:bevel@w`, EMU converted). */
|
|
302
|
+
bevelWidth?: number;
|
|
303
|
+
/** Bevel height in px (from `a:bevel@h`, EMU converted). */
|
|
304
|
+
bevelHeight?: number;
|
|
305
|
+
/** Bevel preset name (`a:bevel@prst`, e.g. `circle`, `relaxedInset`). */
|
|
306
|
+
bevelPreset?: string;
|
|
307
|
+
/** Preset material (`a:cell3D@prstMaterial`, e.g. `plastic`, `metal`). */
|
|
308
|
+
material?: string;
|
|
309
|
+
/** Light rig type (`a:lightRig@rig`, e.g. `threePt`, `soft`). */
|
|
310
|
+
lightRig?: string;
|
|
311
|
+
/** Light rig direction (`a:lightRig@dir`, e.g. `tl`, `t`, `tr`). */
|
|
312
|
+
lightRigDirection?: string;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* One styled text run inside a table cell's `a:txBody`.
|
|
316
|
+
*
|
|
317
|
+
* `PptxTableCell.text` is a flat string and `PptxTableCell.style` describes
|
|
318
|
+
* only the FIRST run, so a cell mixing formats ("Revenue **grew 42%** last
|
|
319
|
+
* year") cannot be represented by those two alone. {@link PptxTableCell.runs}
|
|
320
|
+
* carries the full sequence, with paragraph and line breaks as marker entries
|
|
321
|
+
* so a renderer can walk it linearly.
|
|
322
|
+
*
|
|
323
|
+
* Structurally identical to `pptx-viewer-shared`'s `CellTextRun`, which every
|
|
324
|
+
* binding's table renderer already consumes.
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```ts
|
|
328
|
+
* const runs: PptxTableCellTextRun[] = [
|
|
329
|
+
* { text: "Revenue " },
|
|
330
|
+
* { text: "grew 42%", bold: true, color: "#C00000" },
|
|
331
|
+
* ];
|
|
332
|
+
* // => satisfies PptxTableCellTextRun[]
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
335
|
+
interface PptxTableCellTextRun {
|
|
336
|
+
/** Run text. Empty for the break markers below. */
|
|
337
|
+
text: string;
|
|
338
|
+
/** This entry starts a new paragraph (`a:p` boundary) rather than carrying text. */
|
|
339
|
+
isParagraphBreak?: boolean;
|
|
340
|
+
/** This entry is a soft line break (`a:br`) rather than carrying text. */
|
|
341
|
+
isLineBreak?: boolean;
|
|
342
|
+
/** This entry carries an `a:fld` value rather than a literal `a:r`. */
|
|
343
|
+
isField?: true;
|
|
344
|
+
bold?: boolean;
|
|
345
|
+
italic?: boolean;
|
|
346
|
+
underline?: boolean;
|
|
347
|
+
strikethrough?: boolean;
|
|
348
|
+
/** Resolved run colour as a CSS colour string. */
|
|
349
|
+
color?: string;
|
|
350
|
+
/** Run font size in points (`a:rPr@sz` / 100). */
|
|
351
|
+
fontSize?: number;
|
|
352
|
+
/** Run font family from `a:rPr/a:latin@typeface` (or `a:ea` / `a:cs`). */
|
|
353
|
+
fontFamily?: string;
|
|
354
|
+
/** Run language from `a:rPr/@lang`, such as `ko-KR`. */
|
|
355
|
+
language?: string;
|
|
356
|
+
/**
|
|
357
|
+
* Run baseline shift from `a:rPr/@baseline`, in thousandths of a percent
|
|
358
|
+
* (`-25000` is a 25% subscript). Positive raises the run, negative lowers it.
|
|
359
|
+
*/
|
|
360
|
+
baseline?: number;
|
|
361
|
+
/** Character spacing from `a:rPr/@spc`, in hundredths of a point. */
|
|
362
|
+
characterSpacing?: number;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* One paragraph's own `a:pPr` layout inside a table cell: alignment,
|
|
366
|
+
* direction, left margin and first-line indent, line spacing, and space
|
|
367
|
+
* before and after. For an empty paragraph, also the size of its line from
|
|
368
|
+
* `a:endParaRPr`.
|
|
369
|
+
*
|
|
370
|
+
* The layout fields and units are the ones {@link TextStyle} uses for shape
|
|
371
|
+
* text (px for margins, indent and paragraph spacing; points for exact line
|
|
372
|
+
* spacing), so a renderer resolves both through the same paragraph helpers.
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* ```ts
|
|
376
|
+
* const paragraph: PptxTableCellParagraph = {
|
|
377
|
+
* align: "right",
|
|
378
|
+
* paragraphMarginLeft: 12,
|
|
379
|
+
* lineSpacingExactPt: 9.6,
|
|
380
|
+
* };
|
|
381
|
+
* // => satisfies PptxTableCellParagraph
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
type PptxTableCellParagraph = Pick<TextStyle, 'align' | 'rtl' | 'paragraphMarginLeft' | 'paragraphIndent' | 'lineSpacing' | 'lineSpacingExactPt' | 'paragraphSpacingBefore' | 'paragraphSpacingAfter'> & {
|
|
385
|
+
/**
|
|
386
|
+
* For a paragraph with no run, field or break: the size of its line in
|
|
387
|
+
* points, from `a:endParaRPr@sz` (cell runs give their sizes in points too).
|
|
388
|
+
*/
|
|
389
|
+
endParaFontSize?: number;
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* A single table cell with text content, optional style, and merge info.
|
|
393
|
+
*
|
|
394
|
+
* @example
|
|
395
|
+
* ```ts
|
|
396
|
+
* const cell: PptxTableCell = {
|
|
397
|
+
* text: "$1.5M",
|
|
398
|
+
* style: { bold: true, align: "right" },
|
|
399
|
+
* gridSpan: 1,
|
|
400
|
+
* };
|
|
401
|
+
* // => satisfies PptxTableCell
|
|
402
|
+
* ```
|
|
403
|
+
*/
|
|
404
|
+
interface PptxTableCell {
|
|
405
|
+
text: string;
|
|
406
|
+
style?: PptxTableCellStyle;
|
|
407
|
+
/**
|
|
408
|
+
* Per-run formatting for the cell's text, when it has any beyond what
|
|
409
|
+
* {@link style} can express. Present only for cells whose `a:txBody`
|
|
410
|
+
* actually carries runs; renderers fall back to {@link text} when absent.
|
|
411
|
+
*
|
|
412
|
+
* Editing a cell's text invalidates these (the editor produces a plain
|
|
413
|
+
* string), so an edit path must clear them alongside setting `text`.
|
|
414
|
+
*/
|
|
415
|
+
textRuns?: PptxTableCellTextRun[];
|
|
416
|
+
/**
|
|
417
|
+
* Each paragraph's own layout, one entry per `a:p` in source order (the
|
|
418
|
+
* paragraphs {@link textRuns} separates with `isParagraphBreak`). An entry
|
|
419
|
+
* is `{}` for a paragraph that sets none of it. Present only when some
|
|
420
|
+
* paragraph sets something. Editing the cell's text keeps only the first
|
|
421
|
+
* entry, as the rewritten `a:txBody` keeps only the first paragraph's
|
|
422
|
+
* `a:pPr`. Aligning the cell gives one entry per line of {@link text}
|
|
423
|
+
* instead; save writes as many as the cell has `a:p`.
|
|
424
|
+
*/
|
|
425
|
+
paragraphs?: PptxTableCellParagraph[];
|
|
426
|
+
/** Column span (defaults to 1). */
|
|
427
|
+
gridSpan?: number;
|
|
428
|
+
/** Row span (defaults to 1). */
|
|
429
|
+
rowSpan?: number;
|
|
430
|
+
/** Whether this cell is merged vertically with the cell above. */
|
|
431
|
+
vMerge?: boolean;
|
|
432
|
+
/** Whether this cell is horizontally merged with the cell to the left (gridSpan continuation). */
|
|
433
|
+
hMerge?: boolean;
|
|
434
|
+
/**
|
|
435
|
+
* Opaque round-trip storage for `a:tcPr` attributes that don't yet have
|
|
436
|
+
* typed equivalents on {@link PptxTableCellStyle} (e.g. `horzOverflow`,
|
|
437
|
+
* `anchorCtr`, `headers`, `hideSlicers`, `slicerCacheId`). Keys are the
|
|
438
|
+
* raw XML attribute names without the `@_` prefix used by
|
|
439
|
+
* fast-xml-parser. Re-emitted verbatim by the save writer when present.
|
|
440
|
+
*/
|
|
441
|
+
extraAttributes?: Record<string, string>;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* A single table row with an optional height and an array of cells.
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
* ```ts
|
|
448
|
+
* const row: PptxTableRow = {
|
|
449
|
+
* height: 40,
|
|
450
|
+
* cells: [
|
|
451
|
+
* { text: "Name" },
|
|
452
|
+
* { text: "Score" },
|
|
453
|
+
* ],
|
|
454
|
+
* };
|
|
455
|
+
* // => satisfies PptxTableRow
|
|
456
|
+
* ```
|
|
457
|
+
*/
|
|
458
|
+
interface PptxTableRow {
|
|
459
|
+
/** Row height in px. */
|
|
460
|
+
height?: number;
|
|
461
|
+
cells: PptxTableCell[];
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Complete parsed table data for a {@link TablePptxElement}.
|
|
465
|
+
*
|
|
466
|
+
* Includes row/cell data, column widths, banding flags, and the applied
|
|
467
|
+
* table style ID.
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* ```ts
|
|
471
|
+
* const data: PptxTableData = {
|
|
472
|
+
* rows: [
|
|
473
|
+
* { cells: [{ text: "Product" }, { text: "Revenue" }] },
|
|
474
|
+
* { cells: [{ text: "Widget A" }, { text: "$3.4M" }] },
|
|
475
|
+
* ],
|
|
476
|
+
* columnWidths: [0.6, 0.4],
|
|
477
|
+
* firstRowHeader: true,
|
|
478
|
+
* bandedRows: true,
|
|
479
|
+
* };
|
|
480
|
+
* // => satisfies PptxTableData
|
|
481
|
+
* ```
|
|
482
|
+
*/
|
|
483
|
+
interface PptxTableData {
|
|
484
|
+
rows: PptxTableRow[];
|
|
485
|
+
/** Column widths as proportion of total (summing to 1). */
|
|
486
|
+
columnWidths: number[];
|
|
487
|
+
/** Whether the table has banded rows. */
|
|
488
|
+
bandedRows?: boolean;
|
|
489
|
+
/** Whether the first row is a header. */
|
|
490
|
+
firstRowHeader?: boolean;
|
|
491
|
+
/** Whether banded columns are enabled. */
|
|
492
|
+
bandedColumns?: boolean;
|
|
493
|
+
/** Whether the last row is styled as a total row. */
|
|
494
|
+
lastRow?: boolean;
|
|
495
|
+
/** Whether the first column is styled as a header column. */
|
|
496
|
+
firstCol?: boolean;
|
|
497
|
+
/** Whether the last column is styled specially. */
|
|
498
|
+
lastCol?: boolean;
|
|
499
|
+
/** Table style ID from `a:tblPr/a:tblStyle@val` or `a:tblPr@tblStyle`. */
|
|
500
|
+
tableStyleId?: string;
|
|
501
|
+
/**
|
|
502
|
+
* Set by a table style pick (which, like PowerPoint's, clears every cell's
|
|
503
|
+
* direct fill and borders): the next save drops the direct `a:tcPr` fills,
|
|
504
|
+
* lines and `a:cell3D` the cells' model styles no longer carry, even when
|
|
505
|
+
* `tableStyleId` ends up equal to the file's (the same style picked again,
|
|
506
|
+
* or a pick of B then back to A). Not read from or written to the file.
|
|
507
|
+
* It stays set after a save, which is harmless: a later save only removes
|
|
508
|
+
* children the model still has no value for.
|
|
509
|
+
*/
|
|
510
|
+
clearDirectCellFormatting?: boolean;
|
|
511
|
+
/** Number of rows per banding group (default 1). */
|
|
512
|
+
bandRowCycle?: number;
|
|
513
|
+
/** Number of columns per banding group (default 1). */
|
|
514
|
+
bandColCycle?: number;
|
|
515
|
+
/** Right-to-left table layout from `a:tblPr/@rtl`. */
|
|
516
|
+
rtl?: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* `a:tblPr`'s OWN fill (`CT_TableProperties` §21.1.3.15's
|
|
519
|
+
* `EG_FillProperties`), independent of any `a:tblStyleLst`-referenced style
|
|
520
|
+
* or that style's `a:tblBg`. Applied as the lowest-priority fill layer,
|
|
521
|
+
* beneath the table style's `wholeTbl` fill. Real PowerPoint decks route
|
|
522
|
+
* table appearance through `tableStyleId` instead, so this mainly matters
|
|
523
|
+
* for non-PowerPoint authoring tools (issue G6).
|
|
524
|
+
*/
|
|
525
|
+
tableFill?: ParsedTableStyleFill;
|
|
526
|
+
/**
|
|
527
|
+
* `a:tblPr`'s own `a:effectLst` (or `a:effectDag`) effect chain,
|
|
528
|
+
* independent of the referenced table style, decomposed into a typed
|
|
529
|
+
* sequence of {@link ParsedTableStyleEffect} nodes (issue G6). Each node
|
|
530
|
+
* keeps its own XML verbatim for lossless round-trip; empty array is
|
|
531
|
+
* normalised to `undefined` by the parser so `tableEffects` is only ever
|
|
532
|
+
* present when there is at least one effect.
|
|
533
|
+
*/
|
|
534
|
+
tableEffects?: ParsedTableStyleEffect[];
|
|
535
|
+
/**
|
|
536
|
+
* Table-cell-context default text size in points, resolved from the
|
|
537
|
+
* slide's master `p:otherStyle` (ECMA-376 §19.3.1.42 CT_TextListStyle,
|
|
538
|
+
* §19.3.1.52 for `p:txStyles`). PowerPoint sizes a table cell's text off
|
|
539
|
+
* this master default (commonly 18pt) whenever neither the run nor the
|
|
540
|
+
* (size-less) table style provides one; without it, cell text without an
|
|
541
|
+
* explicit `a:rPr@sz` fell back to the browser's own default font size
|
|
542
|
+
* (16px / 12pt) instead. A render-only hint: it is not part of any
|
|
543
|
+
* individual cell's parsed style and is never written back on save, so
|
|
544
|
+
* resaving an unstyled cell does not bake in an explicit size that was
|
|
545
|
+
* never authored. `undefined` when no master/otherStyle size resolves
|
|
546
|
+
* (renderers should leave the browser default in place in that case).
|
|
547
|
+
*/
|
|
548
|
+
defaultCellFontSize?: number;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* A single fill reference within a table style section.
|
|
552
|
+
*
|
|
553
|
+
* @example
|
|
554
|
+
* ```ts
|
|
555
|
+
* const fill: ParsedTableStyleFill = {
|
|
556
|
+
* schemeColor: "accent1",
|
|
557
|
+
* tint: 40000, // 40% tint
|
|
558
|
+
* };
|
|
559
|
+
* // => satisfies ParsedTableStyleFill
|
|
560
|
+
* ```
|
|
561
|
+
*/
|
|
562
|
+
interface ParsedTableStyleFill {
|
|
563
|
+
/**
|
|
564
|
+
* Theme colour key (e.g. `accent1`, `dk1`). Empty string when the fill is a
|
|
565
|
+
* non-scheme fill (explicit sRGB, gradient, pattern, or none) that carries
|
|
566
|
+
* no theme colour reference; the renderer then resolves {@link color},
|
|
567
|
+
* {@link gradient}, {@link pattern}, or {@link noFill} instead.
|
|
568
|
+
*/
|
|
569
|
+
schemeColor: string;
|
|
570
|
+
/** Tint value (0-100 000). */
|
|
571
|
+
tint?: number;
|
|
572
|
+
/** Shade value (0-100 000). */
|
|
573
|
+
shade?: number;
|
|
574
|
+
/**
|
|
575
|
+
* Alpha (opacity) value (0-100 000, where 100 000 is fully opaque) from an
|
|
576
|
+
* `a:alpha` child of `a:schemeClr`/`a:srgbClr`. Several built-in table
|
|
577
|
+
* styles (e.g. "Light Style 1/3", "Themed Style 1/2") band their rows with
|
|
578
|
+
* a partially transparent tint of the theme colour rather than a tint/shade
|
|
579
|
+
* blend.
|
|
580
|
+
*/
|
|
581
|
+
alpha?: number;
|
|
582
|
+
/** Explicit sRGB hex colour (e.g. `#FF8800`) from `a:srgbClr`. */
|
|
583
|
+
color?: string;
|
|
584
|
+
/** The fill was `a:noFill`: renders transparent and clears lower layers. */
|
|
585
|
+
noFill?: boolean;
|
|
586
|
+
/** Gradient fill parsed from `a:gradFill`. */
|
|
587
|
+
gradient?: ParsedTableStyleGradient;
|
|
588
|
+
/** Preset pattern fill parsed from `a:pattFill`. */
|
|
589
|
+
pattern?: ParsedTableStylePattern;
|
|
590
|
+
/** Image texture fill parsed from `a:blipFill`. */
|
|
591
|
+
image?: ParsedTableStyleImage;
|
|
592
|
+
/**
|
|
593
|
+
* Set when the fill was resolved from `a:tcStyle/a:fillRef`: a JSON snapshot
|
|
594
|
+
* of the resolved fill (without this field). The save path compares it to
|
|
595
|
+
* tell an untouched reference from an edited fill.
|
|
596
|
+
*/
|
|
597
|
+
fillRefSnapshot?: string;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* An image texture fill parsed from a table style section's `a:blipFill`.
|
|
601
|
+
*
|
|
602
|
+
* `ppt/tableStyles.xml` is a presentation-level part parsed once (not
|
|
603
|
+
* per-slide), so this mirrors the per-CELL `a:tcPr/a:blipFill` two-field lazy
|
|
604
|
+
* pattern (`PptxTableCellStyle.backgroundImageFillPath` /
|
|
605
|
+
* `backgroundImageFillData`): `path` starts out as a raw archive-relative
|
|
606
|
+
* path (or an already-external `http(s):`/`data:` URL), and a load pipeline
|
|
607
|
+
* patches it to a displayable URL in `data` once resolved.
|
|
608
|
+
*/
|
|
609
|
+
interface ParsedTableStyleImage {
|
|
610
|
+
/** Archive-relative path, or an already-displayable external/data URL. */
|
|
611
|
+
path?: string;
|
|
612
|
+
/** Displayable URL once a load pipeline has resolved `path`. */
|
|
613
|
+
data?: string;
|
|
614
|
+
}
|
|
615
|
+
/** A single colour stop within a {@link ParsedTableStyleGradient}. */
|
|
616
|
+
interface ParsedTableStyleGradientStop {
|
|
617
|
+
/** Stop position as a percentage (0-100). */
|
|
618
|
+
position: number;
|
|
619
|
+
/** Stop colour (scheme or explicit sRGB). */
|
|
620
|
+
fill: ParsedTableStyleFill;
|
|
621
|
+
}
|
|
622
|
+
/** A gradient fill parsed from a table style section's `a:gradFill`. */
|
|
623
|
+
interface ParsedTableStyleGradient {
|
|
624
|
+
/** Ordered colour stops. */
|
|
625
|
+
stops: ParsedTableStyleGradientStop[];
|
|
626
|
+
/** Linear gradient angle in degrees (from `a:lin@ang`, 60000ths -> deg). */
|
|
627
|
+
angle?: number;
|
|
628
|
+
/** Gradient family: linear (`a:lin`) or radial (`a:path`). */
|
|
629
|
+
type: 'linear' | 'radial';
|
|
630
|
+
}
|
|
631
|
+
/** A preset pattern fill parsed from a table style section's `a:pattFill`. */
|
|
632
|
+
interface ParsedTableStylePattern {
|
|
633
|
+
/** OOXML preset name (e.g. `ltDnDiag`) from `a:pattFill@prst`. */
|
|
634
|
+
preset: string;
|
|
635
|
+
/** Foreground colour (`a:fgClr`). */
|
|
636
|
+
foreground?: ParsedTableStyleFill;
|
|
637
|
+
/** Background colour (`a:bgClr`). */
|
|
638
|
+
background?: ParsedTableStyleFill;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* A single entry in the parsed table style map.
|
|
642
|
+
*
|
|
643
|
+
* Contains fill colours for whole-table, banded rows/columns, first/last
|
|
644
|
+
* row, and first/last column sections.
|
|
645
|
+
*
|
|
646
|
+
* @example
|
|
647
|
+
* ```ts
|
|
648
|
+
* const entry: ParsedTableStyleEntry = {
|
|
649
|
+
* styleId: "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}",
|
|
650
|
+
* styleName: "Medium Style 2 - Accent 1",
|
|
651
|
+
* accentKey: "accent1",
|
|
652
|
+
* wholeTblFill: { schemeColor: "accent1", tint: 20000 },
|
|
653
|
+
* band1HFill: { schemeColor: "accent1", tint: 40000 },
|
|
654
|
+
* firstRowFill: { schemeColor: "accent1" },
|
|
655
|
+
* };
|
|
656
|
+
* // => satisfies ParsedTableStyleEntry
|
|
657
|
+
* ```
|
|
658
|
+
*/
|
|
659
|
+
/** Text properties from a:tcTxStyle in a table style section. */
|
|
660
|
+
interface ParsedTableStyleText {
|
|
661
|
+
/** Font bold. */
|
|
662
|
+
bold?: boolean;
|
|
663
|
+
/** Font italic. */
|
|
664
|
+
italic?: boolean;
|
|
665
|
+
/** Font underline (from `a:tcTxStyle@u`, any value other than `none`). */
|
|
666
|
+
underline?: boolean;
|
|
667
|
+
/** Font colour as theme scheme key. */
|
|
668
|
+
fontSchemeColor?: string;
|
|
669
|
+
/** Font colour tint (0-100 000). */
|
|
670
|
+
fontTint?: number;
|
|
671
|
+
/** Font colour shade (0-100 000). */
|
|
672
|
+
fontShade?: number;
|
|
673
|
+
/** Explicit sRGB hex font colour (e.g. `#FF0000`) from `a:srgbClr`. */
|
|
674
|
+
fontColor?: string;
|
|
675
|
+
/** Typeface from `a:font@typeface` (latin font). */
|
|
676
|
+
fontFace?: string;
|
|
677
|
+
/** Font-collection index from `a:fontRef@idx` (`minor`, `major`, `none`). */
|
|
678
|
+
fontRefIdx?: string;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* A single border side within a table style's `a:tcStyle/a:tcBdr`.
|
|
682
|
+
*
|
|
683
|
+
* Corresponds to one of `a:left`, `a:right`, `a:top`, `a:bottom`,
|
|
684
|
+
* `a:insideH`, `a:insideV`, `a:tl2br`, `a:tr2bl` (each a
|
|
685
|
+
* `CT_ThemeableLineStyle` wrapping an `a:ln`).
|
|
686
|
+
*
|
|
687
|
+
* @example
|
|
688
|
+
* ```ts
|
|
689
|
+
* const side: ParsedTableStyleBorder = {
|
|
690
|
+
* width: 1,
|
|
691
|
+
* dash: 'solid',
|
|
692
|
+
* fill: { schemeColor: 'lt1' },
|
|
693
|
+
* };
|
|
694
|
+
* // => satisfies ParsedTableStyleBorder
|
|
695
|
+
* ```
|
|
696
|
+
*/
|
|
697
|
+
interface ParsedTableStyleBorder {
|
|
698
|
+
/** Line width in px (converted from the `a:ln@w` EMU value). */
|
|
699
|
+
width?: number;
|
|
700
|
+
/** OOXML `a:prstDash@val` (e.g. `solid`, `dash`, `sysDot`). */
|
|
701
|
+
dash?: string;
|
|
702
|
+
/** Compound line type from `a:ln@cmpd` (`sng`, `dbl`, `thickThin`, ...). */
|
|
703
|
+
compound?: string;
|
|
704
|
+
/** Border colour as a theme scheme fill (from `a:ln/a:solidFill/a:schemeClr`). */
|
|
705
|
+
fill?: ParsedTableStyleFill;
|
|
706
|
+
/** Explicit hex colour when the line used `a:srgbClr` (e.g. `#808080`). */
|
|
707
|
+
color?: string;
|
|
708
|
+
/** The line was `a:noFill` - an explicit "no border" that clears lower layers. */
|
|
709
|
+
noFill?: boolean;
|
|
710
|
+
/**
|
|
711
|
+
* Theme line-style reference (`<a:lnRef idx="N">`, the choice sibling of
|
|
712
|
+
* `a:ln`), as the "Themed Style" built-ins use. Set alone: the line's
|
|
713
|
+
* width, dash and colour come from the theme's `a:lnStyleLst[idx - 1]`
|
|
714
|
+
* with its `phClr` replaced by the reference's own colour.
|
|
715
|
+
*/
|
|
716
|
+
lnRef?: ParsedTableFillRef;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* The set of border sides parsed from a table style section's
|
|
720
|
+
* `a:tcStyle/a:tcBdr` element.
|
|
721
|
+
*/
|
|
722
|
+
interface ParsedTableStyleBorders {
|
|
723
|
+
left?: ParsedTableStyleBorder;
|
|
724
|
+
right?: ParsedTableStyleBorder;
|
|
725
|
+
top?: ParsedTableStyleBorder;
|
|
726
|
+
bottom?: ParsedTableStyleBorder;
|
|
727
|
+
/** Interior horizontal borders between rows in the region. */
|
|
728
|
+
insideH?: ParsedTableStyleBorder;
|
|
729
|
+
/** Interior vertical borders between columns in the region. */
|
|
730
|
+
insideV?: ParsedTableStyleBorder;
|
|
731
|
+
/** Top-left to bottom-right diagonal. */
|
|
732
|
+
tl2br?: ParsedTableStyleBorder;
|
|
733
|
+
/**
|
|
734
|
+
* Top-right to bottom-left diagonal (`a:tr2bl`, ECMA-376's
|
|
735
|
+
* `CT_TableCellBorderStyle` sequence: left/right/top/bottom/insideH/
|
|
736
|
+
* insideV/tl2br/tr2bl). The field keeps its historical `bl2tr` spelling
|
|
737
|
+
* only in the sense that it names the same geometric anti-diagonal line
|
|
738
|
+
* (top-right-to-bottom-left and bottom-left-to-top-right describe one
|
|
739
|
+
* undirected diagonal); the parser accepts the real `a:tr2bl` element and,
|
|
740
|
+
* leniently, a legacy `a:bl2tr` this app previously wrote (issue G4).
|
|
741
|
+
*/
|
|
742
|
+
tr2bl?: ParsedTableStyleBorder;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Table background style (CT_TableBackgroundStyle, ECMA-376 §21.1.3.7).
|
|
746
|
+
*
|
|
747
|
+
* Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`. Captures the
|
|
748
|
+
* resolved scheme-fill colour, an unresolved style-matrix `a:fillRef`, and a
|
|
749
|
+
* presence flag for effects (verbatim XML for the effect list is preserved
|
|
750
|
+
* separately by the save path).
|
|
751
|
+
*/
|
|
752
|
+
interface ParsedTableBackground {
|
|
753
|
+
/** Solid fill (resolved from `a:fill > a:solidFill > a:schemeClr`). */
|
|
754
|
+
fill?: ParsedTableStyleFill;
|
|
755
|
+
/**
|
|
756
|
+
* Style-matrix fill reference (`<a:fillRef idx="N">...</a:fillRef>`),
|
|
757
|
+
* mutually exclusive with {@link fill} (`a:fill` is the choice sibling of
|
|
758
|
+
* `a:fillRef` in `CT_TableBackgroundStyle`).
|
|
759
|
+
*/
|
|
760
|
+
fillRef?: ParsedTableFillRef;
|
|
761
|
+
/**
|
|
762
|
+
* Style-matrix effect reference (`<a:effectRef idx="N">...</a:effectRef>`,
|
|
763
|
+
* "Themed Style 1/2"): the theme's effect style (usually an outer shadow)
|
|
764
|
+
* drawn under the whole table.
|
|
765
|
+
*/
|
|
766
|
+
effectRef?: ParsedTableFillRef;
|
|
767
|
+
/** The outer shadow {@link effectRef} resolves to against a theme (set at render time). */
|
|
768
|
+
shadow?: ParsedTableBackgroundShadow;
|
|
769
|
+
/** Has an `a:effectLst` child that should be round-tripped. */
|
|
770
|
+
hasEffectLst?: boolean;
|
|
771
|
+
}
|
|
772
|
+
/** The outer shadow a table style's `a:tblBg/a:effectRef` resolves to (px, colour as `#RRGGBB`). */
|
|
773
|
+
interface ParsedTableBackgroundShadow {
|
|
774
|
+
color: string;
|
|
775
|
+
/** 0..1. */
|
|
776
|
+
opacity: number;
|
|
777
|
+
blur: number;
|
|
778
|
+
offsetX: number;
|
|
779
|
+
offsetY: number;
|
|
780
|
+
}
|
|
781
|
+
interface ParsedTableStyleEntry {
|
|
782
|
+
styleId: string;
|
|
783
|
+
styleName?: string;
|
|
784
|
+
/** Dominant accent key derived from fills (e.g. `accent1`). */
|
|
785
|
+
accentKey?: string;
|
|
786
|
+
/** Table-level background (`<a:tblBg>`). */
|
|
787
|
+
tableBackground?: ParsedTableBackground;
|
|
788
|
+
wholeTblFill?: ParsedTableStyleFill;
|
|
789
|
+
band1HFill?: ParsedTableStyleFill;
|
|
790
|
+
band2HFill?: ParsedTableStyleFill;
|
|
791
|
+
band1VFill?: ParsedTableStyleFill;
|
|
792
|
+
band2VFill?: ParsedTableStyleFill;
|
|
793
|
+
firstRowFill?: ParsedTableStyleFill;
|
|
794
|
+
lastRowFill?: ParsedTableStyleFill;
|
|
795
|
+
firstColFill?: ParsedTableStyleFill;
|
|
796
|
+
lastColFill?: ParsedTableStyleFill;
|
|
797
|
+
/** Corner cell fills (`<a:seCell>`, `<a:swCell>`, `<a:neCell>`, `<a:nwCell>`). */
|
|
798
|
+
seCellFill?: ParsedTableStyleFill;
|
|
799
|
+
swCellFill?: ParsedTableStyleFill;
|
|
800
|
+
neCellFill?: ParsedTableStyleFill;
|
|
801
|
+
nwCellFill?: ParsedTableStyleFill;
|
|
802
|
+
/**
|
|
803
|
+
* Per-role border styling from `a:tcStyle/a:tcBdr`. These supply the
|
|
804
|
+
* gridlines/edges a styled table inherits from its table style when the
|
|
805
|
+
* cells carry no explicit per-cell `a:lnX` overrides.
|
|
806
|
+
*/
|
|
807
|
+
wholeTblBorders?: ParsedTableStyleBorders;
|
|
808
|
+
firstRowBorders?: ParsedTableStyleBorders;
|
|
809
|
+
lastRowBorders?: ParsedTableStyleBorders;
|
|
810
|
+
firstColBorders?: ParsedTableStyleBorders;
|
|
811
|
+
lastColBorders?: ParsedTableStyleBorders;
|
|
812
|
+
band1HBorders?: ParsedTableStyleBorders;
|
|
813
|
+
band2HBorders?: ParsedTableStyleBorders;
|
|
814
|
+
band1VBorders?: ParsedTableStyleBorders;
|
|
815
|
+
band2VBorders?: ParsedTableStyleBorders;
|
|
816
|
+
seCellBorders?: ParsedTableStyleBorders;
|
|
817
|
+
swCellBorders?: ParsedTableStyleBorders;
|
|
818
|
+
neCellBorders?: ParsedTableStyleBorders;
|
|
819
|
+
nwCellBorders?: ParsedTableStyleBorders;
|
|
820
|
+
/** Per-role text styling from a:tcTxStyle. */
|
|
821
|
+
wholeTblText?: ParsedTableStyleText;
|
|
822
|
+
firstRowText?: ParsedTableStyleText;
|
|
823
|
+
lastRowText?: ParsedTableStyleText;
|
|
824
|
+
firstColText?: ParsedTableStyleText;
|
|
825
|
+
lastColText?: ParsedTableStyleText;
|
|
826
|
+
band1HText?: ParsedTableStyleText;
|
|
827
|
+
band2HText?: ParsedTableStyleText;
|
|
828
|
+
band1VText?: ParsedTableStyleText;
|
|
829
|
+
band2VText?: ParsedTableStyleText;
|
|
830
|
+
seCellText?: ParsedTableStyleText;
|
|
831
|
+
swCellText?: ParsedTableStyleText;
|
|
832
|
+
neCellText?: ParsedTableStyleText;
|
|
833
|
+
nwCellText?: ParsedTableStyleText;
|
|
834
|
+
/**
|
|
835
|
+
* Per-role 3D bevel + lighting from `a:tcStyle/a:cell3D` (CT_Cell3D),
|
|
836
|
+
* distinct from the per-cell `a:tcPr/a:cell3D` {@link PptxTableCellStyle}
|
|
837
|
+
* already supports. None of PowerPoint's 74 built-in gallery styles use
|
|
838
|
+
* this (0 hits in the built-in catalogue), so it only matters for a
|
|
839
|
+
* hand-authored or third-party table style.
|
|
840
|
+
*/
|
|
841
|
+
wholeTblCell3D?: PptxTableCell3D;
|
|
842
|
+
firstRowCell3D?: PptxTableCell3D;
|
|
843
|
+
lastRowCell3D?: PptxTableCell3D;
|
|
844
|
+
firstColCell3D?: PptxTableCell3D;
|
|
845
|
+
lastColCell3D?: PptxTableCell3D;
|
|
846
|
+
band1HCell3D?: PptxTableCell3D;
|
|
847
|
+
band2HCell3D?: PptxTableCell3D;
|
|
848
|
+
band1VCell3D?: PptxTableCell3D;
|
|
849
|
+
band2VCell3D?: PptxTableCell3D;
|
|
850
|
+
seCellCell3D?: PptxTableCell3D;
|
|
851
|
+
swCellCell3D?: PptxTableCell3D;
|
|
852
|
+
neCellCell3D?: PptxTableCell3D;
|
|
853
|
+
nwCellCell3D?: PptxTableCell3D;
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Map of GUID → table style entry.
|
|
857
|
+
*
|
|
858
|
+
* Parsed from `ppt/tableStyles.xml` and indexed by the style GUID
|
|
859
|
+
* referenced in `a:tblPr@tblStyle`.
|
|
860
|
+
*
|
|
861
|
+
* @example
|
|
862
|
+
* ```ts
|
|
863
|
+
* const styles: ParsedTableStyleMap = {
|
|
864
|
+
* "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}": {
|
|
865
|
+
* styleId: "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}",
|
|
866
|
+
* styleName: "Medium Style 2 - Accent 1",
|
|
867
|
+
* accentKey: "accent1",
|
|
868
|
+
* },
|
|
869
|
+
* };
|
|
870
|
+
* // => satisfies ParsedTableStyleMap
|
|
871
|
+
* ```
|
|
872
|
+
*/
|
|
873
|
+
type ParsedTableStyleMap = Record<string, ParsedTableStyleEntry>;
|
|
874
|
+
export { TableStyleSectionPatch as C, ParsedTableStyleEffect as S, 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, 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, ParsedTableFillRef as x, PptxTableRow as y };
|
|
875
|
+
//# sourceMappingURL=table-C7ITXL3Y.d.ts.map
|