pptx-svelte-viewer 3.7.0 → 3.8.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/CHANGELOG.md +15 -0
- package/dist/{AiChatPanel-vYzaXNFz.js → AiChatPanel-ByiDm0_K.js} +1 -1
- package/dist/{export-xK6ID6BD.js → export-yk0mo1AN.js} +30716 -29091
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +387 -18
- package/dist/index.js +2 -2
- package/dist/pptx-svelte-viewer.css +1 -1
- package/dist/{translator-DWcErYB3.js → translator-Bb6pIYyq.js} +2 -23
- package/dist/viewer/editor/editor-format-mutations.d.ts +10 -6
- package/dist/viewer/editor/editor-format-mutations.d.ts.map +1 -1
- package/dist/viewer/editor/editor-state.svelte.d.ts +6 -0
- package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +425 -18
- package/dist/viewer/index.js +1 -1
- package/dist/viewer/presentation/animation-playback.svelte.d.ts.map +1 -1
- package/dist/viewer/render/smart-art-3d-view.d.ts.map +1 -1
- package/dist/viewer/render/smartart-view.d.ts +9 -6
- package/dist/viewer/render/smartart-view.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/i18n.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -571,6 +571,44 @@ interface PptxCustomPathProperties {
|
|
|
571
571
|
customGeometryTextRect?: CustomGeometryTextRect;
|
|
572
572
|
}
|
|
573
573
|
//#endregion
|
|
574
|
+
//#region src/core/types/color-ref.d.ts
|
|
575
|
+
/**
|
|
576
|
+
* Theme colour references: the typed counterpart of `<a:schemeClr>`.
|
|
577
|
+
*
|
|
578
|
+
* A colour picked from the theme palette is remembered as a scheme slot plus
|
|
579
|
+
* PowerPoint's luminance variants rather than as the sRGB it currently
|
|
580
|
+
* resolves to, so a later theme change re-colours the shape (and a saved file
|
|
581
|
+
* keeps `<a:schemeClr>` instead of a canonical `<a:srgbClr>`).
|
|
582
|
+
*
|
|
583
|
+
* @module types/color-ref
|
|
584
|
+
*/
|
|
585
|
+
/**
|
|
586
|
+
* The scheme slot names `a:schemeClr/@val` accepts (ECMA-376 `ST_SchemeColorIndex`).
|
|
587
|
+
* `bg1`/`tx1`/`bg2`/`tx2` are the colour-map aliases a slide resolves through
|
|
588
|
+
* `p:clrMap`; `phClr` is the placeholder colour used inside a theme's style
|
|
589
|
+
* matrix and is never chosen from a picker.
|
|
590
|
+
*/
|
|
591
|
+
type PptxThemeColorSchemeName = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'bg1' | 'tx1' | 'bg2' | 'tx2' | 'phClr';
|
|
592
|
+
/**
|
|
593
|
+
* A theme colour choice. Every transform is a 0..1 fraction of the OOXML
|
|
594
|
+
* percentage (`lumMod val="20000"` is `lumMod: 0.2`), matching how the parser
|
|
595
|
+
* reads them, and is applied in the order `a:schemeClr` children are written:
|
|
596
|
+
* `tint`, `shade`, `lumMod`, `lumOff`, `alpha`.
|
|
597
|
+
*/
|
|
598
|
+
interface PptxThemeColorRef {
|
|
599
|
+
scheme: PptxThemeColorSchemeName;
|
|
600
|
+
/** `a:lumMod`: multiply HSL luminance (PowerPoint's "Lighter/Darker" rows). */
|
|
601
|
+
lumMod?: number;
|
|
602
|
+
/** `a:lumOff`: add to HSL luminance after `lumMod` ("Lighter N%" rows). */
|
|
603
|
+
lumOff?: number;
|
|
604
|
+
/** `a:tint`: blend towards white. */
|
|
605
|
+
tint?: number;
|
|
606
|
+
/** `a:shade`: blend towards black. */
|
|
607
|
+
shade?: number;
|
|
608
|
+
/** `a:alpha`: opacity fraction (1 = opaque). */
|
|
609
|
+
alpha?: number;
|
|
610
|
+
}
|
|
611
|
+
//#endregion
|
|
574
612
|
//#region src/core/types/effect-dag.d.ts
|
|
575
613
|
type EffectDagBlendMode = 'darken' | 'lighten' | 'mult' | 'over' | 'screen';
|
|
576
614
|
type EffectDagContainerType = 'sib' | 'tree';
|
|
@@ -860,6 +898,15 @@ interface ShapeStyle {
|
|
|
860
898
|
* back to canonical `<a:srgbClr>`.
|
|
861
899
|
*/
|
|
862
900
|
fillColorXml?: XmlObject;
|
|
901
|
+
/**
|
|
902
|
+
* Typed theme colour reference for the fill, set when {@link fillColorXml}
|
|
903
|
+
* is a plain `a:schemeClr` (see `themeColorRefFromColorChoice`). When
|
|
904
|
+
* present it WINS on save: the writer emits `<a:schemeClr>` from this ref
|
|
905
|
+
* instead of the resolved {@link fillColor}, so the fill keeps following
|
|
906
|
+
* the theme palette after a later theme change. `undefined` means the fill
|
|
907
|
+
* is a plain hex (or a colour kind a ref cannot express).
|
|
908
|
+
*/
|
|
909
|
+
fillColorRef?: PptxThemeColorRef;
|
|
863
910
|
fillGradient?: string;
|
|
864
911
|
/** Original `gradFill` XML retained for unknown-child and extension round-tripping. */
|
|
865
912
|
fillGradientXml?: XmlObject;
|
|
@@ -894,6 +941,12 @@ interface ShapeStyle {
|
|
|
894
941
|
opacity?: number;
|
|
895
942
|
/** Raw XML colour node preserved for round-trip (e.g. a:schemeClr with transforms). */
|
|
896
943
|
originalColorXml?: XmlObject;
|
|
944
|
+
/**
|
|
945
|
+
* Typed theme colour reference for this stop, set when
|
|
946
|
+
* {@link originalColorXml} is a plain `a:schemeClr`. Wins on save, same
|
|
947
|
+
* as {@link ShapeStyle.fillColorRef}.
|
|
948
|
+
*/
|
|
949
|
+
colorRef?: PptxThemeColorRef;
|
|
897
950
|
}>;
|
|
898
951
|
fillGradientAngle?: number;
|
|
899
952
|
fillGradientType?: 'linear' | 'radial';
|
|
@@ -940,6 +993,12 @@ interface ShapeStyle {
|
|
|
940
993
|
* round-trip serialisation. See {@link fillColorXml} for the rationale.
|
|
941
994
|
*/
|
|
942
995
|
strokeColorXml?: XmlObject;
|
|
996
|
+
/**
|
|
997
|
+
* Typed theme colour reference for the outline, mirroring
|
|
998
|
+
* {@link fillColorRef}: set when {@link strokeColorXml} is a plain
|
|
999
|
+
* `a:schemeClr`, and wins on save.
|
|
1000
|
+
*/
|
|
1001
|
+
strokeColorRef?: PptxThemeColorRef;
|
|
943
1002
|
/**
|
|
944
1003
|
* Kind of fill painted on the outline (`a:ln` child). Distinguishes a solid
|
|
945
1004
|
* outline from a gradient/pattern/none outline so save can emit the correct
|
|
@@ -1443,6 +1502,15 @@ interface TextStyle {
|
|
|
1443
1502
|
* verbatim when the resolved {@link color} still matches this node.
|
|
1444
1503
|
*/
|
|
1445
1504
|
colorXml?: XmlObject;
|
|
1505
|
+
/**
|
|
1506
|
+
* Typed theme colour reference for the run's text colour, set when
|
|
1507
|
+
* {@link colorXml} is a plain `a:schemeClr` (see
|
|
1508
|
+
* `themeColorRefFromColorChoice`). When present it WINS on save: the
|
|
1509
|
+
* writer emits `<a:schemeClr>` from this ref instead of the resolved
|
|
1510
|
+
* {@link color}, so the text keeps following the theme palette after a
|
|
1511
|
+
* later theme change.
|
|
1512
|
+
*/
|
|
1513
|
+
colorRef?: PptxThemeColorRef;
|
|
1446
1514
|
align?: 'left' | 'center' | 'right' | 'justify' | 'justLow' | 'dist' | 'thaiDist';
|
|
1447
1515
|
/**
|
|
1448
1516
|
* Vertical text-box anchor (`a:bodyPr/@anchor`, `ST_TextAnchoringType`).
|
|
@@ -1868,6 +1936,12 @@ interface BulletInfo {
|
|
|
1868
1936
|
* identity rather than being flattened to `<a:srgbClr/>` on save.
|
|
1869
1937
|
*/
|
|
1870
1938
|
colorXml?: XmlObject;
|
|
1939
|
+
/**
|
|
1940
|
+
* Typed theme colour reference for the bullet colour, set when
|
|
1941
|
+
* {@link colorXml} is a plain `a:schemeClr`. Wins on save, same as
|
|
1942
|
+
* {@link TextStyle.colorRef}.
|
|
1943
|
+
*/
|
|
1944
|
+
colorRef?: PptxThemeColorRef;
|
|
1871
1945
|
/** True when `a:buNone` explicitly suppresses bullets. */
|
|
1872
1946
|
none?: boolean;
|
|
1873
1947
|
/** Picture bullet: relationship ID from `a:buBlip` → `a:blip[@r:embed]`. */
|
|
@@ -2479,6 +2553,39 @@ interface PptxChartStyleDefinition {
|
|
|
2479
2553
|
plotArea?: PptxChartStylePartEntry;
|
|
2480
2554
|
}
|
|
2481
2555
|
//#endregion
|
|
2556
|
+
//#region src/core/types/chart-title.d.ts
|
|
2557
|
+
/**
|
|
2558
|
+
* Chart title rich-text run type, split out of `types/chart.ts` (already at
|
|
2559
|
+
* the repo's file-size limit) to keep that module from growing further.
|
|
2560
|
+
*
|
|
2561
|
+
* @module pptx-types/chart-title
|
|
2562
|
+
*/
|
|
2563
|
+
/**
|
|
2564
|
+
* One run of a chart title's rich text (`c:title/c:tx/c:rich/a:p/a:r`).
|
|
2565
|
+
*
|
|
2566
|
+
* The flat `PptxChartData.title` field only ever captured the FIRST run's
|
|
2567
|
+
* text with no per-run formatting; `titleRuns` (when present) is the
|
|
2568
|
+
* lossless, multi-run replacement parsed from the same `c:rich` body. Absent
|
|
2569
|
+
* when the title has no rich text at all (an empty/auto title, or one
|
|
2570
|
+
* authored as a linked-cell reference).
|
|
2571
|
+
*/
|
|
2572
|
+
interface PptxChartTitleRun {
|
|
2573
|
+
/** This run's text (`a:t`). */
|
|
2574
|
+
text: string;
|
|
2575
|
+
/** `a:rPr/@_b`. */
|
|
2576
|
+
bold?: boolean;
|
|
2577
|
+
/** `a:rPr/@_i`. */
|
|
2578
|
+
italic?: boolean;
|
|
2579
|
+
/**
|
|
2580
|
+
* Font size in POINTS (`a:rPr/@_sz`, hundredths of a point / 100), matching
|
|
2581
|
+
* `PptxChartLegendTextStyle.fontSize`'s convention rather than the pixel
|
|
2582
|
+
* convention `TextStyle.fontSize` uses for slide text.
|
|
2583
|
+
*/
|
|
2584
|
+
fontSize?: number;
|
|
2585
|
+
/** Resolved hex colour (e.g. `"#FF0000"`) from `a:rPr/a:solidFill`. */
|
|
2586
|
+
color?: string;
|
|
2587
|
+
}
|
|
2588
|
+
//#endregion
|
|
2482
2589
|
//#region src/core/types/chart-user-shapes.d.ts
|
|
2483
2590
|
/**
|
|
2484
2591
|
* Types for chart drawing-overlay shapes (`c:userShapes`).
|
|
@@ -2627,6 +2734,10 @@ interface PptxChartTrendline {
|
|
|
2627
2734
|
displayRSq?: boolean;
|
|
2628
2735
|
displayEq?: boolean;
|
|
2629
2736
|
color?: string;
|
|
2737
|
+
/** Trendline width in points (`c:trendline/c:spPr/a:ln/@w`, EMU / 12700). */
|
|
2738
|
+
lineWidth?: number;
|
|
2739
|
+
/** Trendline dash style (`c:trendline/c:spPr/a:ln/a:prstDash/@val`). */
|
|
2740
|
+
lineDashStyle?: string;
|
|
2630
2741
|
label?: PptxChartTrendlineLabel | null;
|
|
2631
2742
|
}
|
|
2632
2743
|
/** Typed, commonly edited properties of `c:trendlineLbl`. */
|
|
@@ -2672,6 +2783,10 @@ interface PptxChartErrBars {
|
|
|
2672
2783
|
customMinus?: number[];
|
|
2673
2784
|
noEndCap?: boolean;
|
|
2674
2785
|
color?: string;
|
|
2786
|
+
/** Error-bar line width in points (`c:errBars/c:spPr/a:ln/@w`, EMU / 12700). */
|
|
2787
|
+
width?: number;
|
|
2788
|
+
/** Error-bar line dash style (`c:errBars/c:spPr/a:ln/a:prstDash/@val`). */
|
|
2789
|
+
dashStyle?: string;
|
|
2675
2790
|
}
|
|
2676
2791
|
/**
|
|
2677
2792
|
* Visibility flags for the chart data table (axes + legend keys).
|
|
@@ -2798,6 +2913,12 @@ interface PptxChartDataLabel {
|
|
|
2798
2913
|
* `.../a:p/a:pPr/a:defRPr` default-run-property style.
|
|
2799
2914
|
*/
|
|
2800
2915
|
txPr?: PptxChartLegendTextStyle;
|
|
2916
|
+
/**
|
|
2917
|
+
* This label's own shape formatting (`c:dLbl/c:spPr`): fill/line colour,
|
|
2918
|
+
* width, and dash style for the label's callout box, taking precedence
|
|
2919
|
+
* over any chart/series-level default when set.
|
|
2920
|
+
*/
|
|
2921
|
+
spPr?: PptxChartShapeProps;
|
|
2801
2922
|
}
|
|
2802
2923
|
/** Axis number format. */
|
|
2803
2924
|
interface PptxChartAxisNumFmt {
|
|
@@ -3361,6 +3482,16 @@ interface PptxChartDateCategories {
|
|
|
3361
3482
|
*/
|
|
3362
3483
|
interface PptxChartData {
|
|
3363
3484
|
title?: string;
|
|
3485
|
+
/**
|
|
3486
|
+
* Rich-text runs of the title, parsed from `c:title/c:tx/c:rich` (issue:
|
|
3487
|
+
* chart title rich text). Lossless multi-run alternative to the flat
|
|
3488
|
+
* {@link title}: when present, the writer serialises every run's own
|
|
3489
|
+
* bold/italic/size/color; when absent, save falls back to the flat
|
|
3490
|
+
* `title` path as before. Only populated for a classic (`c:`) chart's
|
|
3491
|
+
* rich (typed) title, not a ChartEx (`cx:`) title or one authored as a
|
|
3492
|
+
* linked-cell reference.
|
|
3493
|
+
*/
|
|
3494
|
+
titleRuns?: PptxChartTitleRun[];
|
|
3364
3495
|
chartType: PptxChartType;
|
|
3365
3496
|
categories: string[];
|
|
3366
3497
|
/**
|
|
@@ -3452,8 +3583,10 @@ interface PptxChartData {
|
|
|
3452
3583
|
chartRelationshipId?: string;
|
|
3453
3584
|
/** `null` explicitly removes an existing ChartML data table. */
|
|
3454
3585
|
dataTable?: PptxChartDataTable | null;
|
|
3455
|
-
dropLines
|
|
3456
|
-
|
|
3586
|
+
/** `null` explicitly removes an existing `c:dropLines` element. */
|
|
3587
|
+
dropLines?: PptxChartLineStyle | null;
|
|
3588
|
+
/** `null` explicitly removes an existing `c:hiLowLines` element. */
|
|
3589
|
+
hiLowLines?: PptxChartLineStyle | null;
|
|
3457
3590
|
/** `null` explicitly removes an existing up/down-bars container. */
|
|
3458
3591
|
upDownBars?: PptxChartUpDownBars | null;
|
|
3459
3592
|
axes?: PptxChartAxisFormatting[];
|
|
@@ -3568,10 +3701,13 @@ interface PptxChartData {
|
|
|
3568
3701
|
pivotFormats?: PptxChartPivotFormats | null;
|
|
3569
3702
|
/**
|
|
3570
3703
|
* Color-map override (`c:clrMapOvr`) carrying 12 attributes that
|
|
3571
|
-
* remap theme colour roles for this chart only.
|
|
3572
|
-
* `attribute
|
|
3704
|
+
* remap theme colour roles for this chart only. Modeled as a flat
|
|
3705
|
+
* `attribute -> value` map (e.g. `{ bg1: 'lt1', accent1: 'accent2' }`)
|
|
3706
|
+
* so unknown/future attributes round-trip without code changes.
|
|
3707
|
+
* `null` explicitly removes an existing `c:clrMapOvr`; an empty object
|
|
3708
|
+
* is treated the same as `null` on save.
|
|
3573
3709
|
*/
|
|
3574
|
-
clrMapOvr?: Record<string, string
|
|
3710
|
+
clrMapOvr?: Record<string, string> | null;
|
|
3575
3711
|
/**
|
|
3576
3712
|
* Whether the chart's own cached numeric values use the 1904 date epoch
|
|
3577
3713
|
* (`c:chartSpace/c:date1904/@val`). Independent of, and authoritative over,
|
|
@@ -4948,13 +5084,55 @@ interface PptxSmartArtData {
|
|
|
4948
5084
|
drawingDirty?: boolean;
|
|
4949
5085
|
}
|
|
4950
5086
|
//#endregion
|
|
4951
|
-
//#region src/core/types/table.d.ts
|
|
5087
|
+
//#region src/core/types/table-style-edit.d.ts
|
|
5088
|
+
/**
|
|
5089
|
+
* A `a:fillRef`/`a:lnRef`/`a:effectRef`-style style-matrix reference: an
|
|
5090
|
+
* index into the theme's format scheme (`a:fmtScheme/a:fillStyleLst`, 1-based
|
|
5091
|
+
* per ECMA-376 §20.1.4.1.12) plus an optional colour transform child.
|
|
5092
|
+
*
|
|
5093
|
+
* Distinct from an already-resolved {@link ParsedTableStyleFill}: a fill ref
|
|
5094
|
+
* points AT a theme style-matrix entry rather than carrying a colour choice
|
|
5095
|
+
* directly, though the two commonly appear together (`<a:fillRef idx="2">
|
|
5096
|
+
* <a:schemeClr val="accent1"/></a:fillRef>`).
|
|
5097
|
+
*
|
|
5098
|
+
* @example
|
|
5099
|
+
* ```ts
|
|
5100
|
+
* const ref: ParsedTableFillRef = { idx: 2, color: { schemeColor: 'accent1' } };
|
|
5101
|
+
* // => satisfies ParsedTableFillRef
|
|
5102
|
+
* ```
|
|
5103
|
+
*/
|
|
5104
|
+
interface ParsedTableFillRef {
|
|
5105
|
+
/** 1-based index into the theme format scheme's fill style list. */
|
|
5106
|
+
idx: number;
|
|
5107
|
+
/** Colour transform child (`a:schemeClr`/`a:srgbClr`) applied to the referenced style. */
|
|
5108
|
+
color?: ParsedTableStyleFill;
|
|
5109
|
+
}
|
|
4952
5110
|
/**
|
|
4953
|
-
*
|
|
4954
|
-
*
|
|
5111
|
+
* One leaf (or `effectDag`-wrapped) node of an `a:effectLst`/`a:effectDag`
|
|
5112
|
+
* effect chain, kept mostly opaque: {@link kind} names the OOXML element so a
|
|
5113
|
+
* consumer can recognise common effects (`outerShdw`, `glow`, `softEdge`,
|
|
5114
|
+
* `reflection`, `blur`, `innerShdw`, `prstShdw`, `fillOverlay`, `alphaModFix`,
|
|
5115
|
+
* `alphaInv`, `grayscl`, `biLevel`, `duotone`, `hsl`, `lum`, `tint`) without
|
|
5116
|
+
* this module re-deriving the full shape-effect taxonomy already modelled on
|
|
5117
|
+
* `ShapeStyle`; {@link xml} preserves the node verbatim for lossless re-emit.
|
|
4955
5118
|
*
|
|
4956
|
-
* @
|
|
5119
|
+
* @example
|
|
5120
|
+
* ```ts
|
|
5121
|
+
* const effect: ParsedTableStyleEffect = {
|
|
5122
|
+
* kind: 'outerShdw',
|
|
5123
|
+
* xml: { '@_blurRad': '40000', '@_dist': '20000', '@_dir': '5400000' },
|
|
5124
|
+
* };
|
|
5125
|
+
* // => satisfies ParsedTableStyleEffect
|
|
5126
|
+
* ```
|
|
4957
5127
|
*/
|
|
5128
|
+
interface ParsedTableStyleEffect {
|
|
5129
|
+
/** The OOXML element's local name, e.g. `outerShdw`, `glow`, `softEdge`. */
|
|
5130
|
+
kind: string;
|
|
5131
|
+
/** Verbatim XML node (attributes + children) for lossless round-trip. */
|
|
5132
|
+
xml: XmlObject;
|
|
5133
|
+
}
|
|
5134
|
+
//#endregion
|
|
5135
|
+
//#region src/core/types/table.d.ts
|
|
4958
5136
|
/**
|
|
4959
5137
|
* Per-cell visual style for a table cell.
|
|
4960
5138
|
*
|
|
@@ -4991,6 +5169,14 @@ interface PptxTableCellStyle {
|
|
|
4991
5169
|
* future expansion alongside the run-properties round-trip path.
|
|
4992
5170
|
*/
|
|
4993
5171
|
colorXml?: XmlObject;
|
|
5172
|
+
/**
|
|
5173
|
+
* Typed theme colour reference for the cell text colour, set when
|
|
5174
|
+
* {@link colorXml} is a plain `a:schemeClr`. Wins on save, mirroring
|
|
5175
|
+
* `TextStyle.colorRef`. Distinct from {@link ParsedTableStyleFill.schemeColor},
|
|
5176
|
+
* which describes a `ppt/tableStyles.xml` section fill rather than an
|
|
5177
|
+
* individual cell override.
|
|
5178
|
+
*/
|
|
5179
|
+
colorRef?: PptxThemeColorRef;
|
|
4994
5180
|
backgroundColor?: string;
|
|
4995
5181
|
/**
|
|
4996
5182
|
* Raw XML colour-choice node preserved from cell `a:tcPr/a:solidFill` for
|
|
@@ -4998,6 +5184,12 @@ interface PptxTableCellStyle {
|
|
|
4998
5184
|
* {@link backgroundColor} still matches the original colour.
|
|
4999
5185
|
*/
|
|
5000
5186
|
backgroundColorXml?: XmlObject;
|
|
5187
|
+
/**
|
|
5188
|
+
* Typed theme colour reference for the cell fill, set when
|
|
5189
|
+
* {@link backgroundColorXml} is a plain `a:schemeClr`. Wins on save,
|
|
5190
|
+
* mirroring `ShapeStyle.fillColorRef`.
|
|
5191
|
+
*/
|
|
5192
|
+
backgroundColorRef?: PptxThemeColorRef;
|
|
5001
5193
|
borderColor?: string;
|
|
5002
5194
|
/** Top border width in px. */
|
|
5003
5195
|
borderTopWidth?: number;
|
|
@@ -5311,12 +5503,14 @@ interface PptxTableData {
|
|
|
5311
5503
|
*/
|
|
5312
5504
|
tableFill?: ParsedTableStyleFill;
|
|
5313
5505
|
/**
|
|
5314
|
-
*
|
|
5315
|
-
* independent of the referenced table style
|
|
5316
|
-
*
|
|
5317
|
-
*
|
|
5506
|
+
* `a:tblPr`'s own `a:effectLst` (or `a:effectDag`) effect chain,
|
|
5507
|
+
* independent of the referenced table style, decomposed into a typed
|
|
5508
|
+
* sequence of {@link ParsedTableStyleEffect} nodes (issue G6). Each node
|
|
5509
|
+
* keeps its own XML verbatim for lossless round-trip; empty array is
|
|
5510
|
+
* normalised to `undefined` by the parser so `tableEffects` is only ever
|
|
5511
|
+
* present when there is at least one effect.
|
|
5318
5512
|
*/
|
|
5319
|
-
tableEffects?:
|
|
5513
|
+
tableEffects?: ParsedTableStyleEffect[];
|
|
5320
5514
|
}
|
|
5321
5515
|
/**
|
|
5322
5516
|
* A single fill reference within a table style section.
|
|
@@ -5492,13 +5686,20 @@ interface ParsedTableStyleBorders {
|
|
|
5492
5686
|
/**
|
|
5493
5687
|
* Table background style (CT_TableBackgroundStyle, ECMA-376 §21.1.3.7).
|
|
5494
5688
|
*
|
|
5495
|
-
* Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`.
|
|
5496
|
-
*
|
|
5497
|
-
*
|
|
5689
|
+
* Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`. Captures the
|
|
5690
|
+
* resolved scheme-fill colour, an unresolved style-matrix `a:fillRef`, and a
|
|
5691
|
+
* presence flag for effects (verbatim XML for the effect list is preserved
|
|
5692
|
+
* separately by the save path).
|
|
5498
5693
|
*/
|
|
5499
5694
|
interface ParsedTableBackground {
|
|
5500
5695
|
/** Solid fill (resolved from `a:fill > a:solidFill > a:schemeClr`). */
|
|
5501
5696
|
fill?: ParsedTableStyleFill;
|
|
5697
|
+
/**
|
|
5698
|
+
* Style-matrix fill reference (`<a:fillRef idx="N">...</a:fillRef>`),
|
|
5699
|
+
* mutually exclusive with {@link fill} (`a:fill` is the choice sibling of
|
|
5700
|
+
* `a:fillRef` in `CT_TableBackgroundStyle`).
|
|
5701
|
+
*/
|
|
5702
|
+
fillRef?: ParsedTableFillRef;
|
|
5502
5703
|
/** Has an `a:effectLst` child that should be round-tripped. */
|
|
5503
5704
|
hasEffectLst?: boolean;
|
|
5504
5705
|
}
|
|
@@ -5750,6 +5951,13 @@ interface TablePptxElement extends PptxElementBase {
|
|
|
5750
5951
|
type: 'table';
|
|
5751
5952
|
/** Parsed table cell data for editing. */
|
|
5752
5953
|
tableData?: PptxTableData;
|
|
5954
|
+
/**
|
|
5955
|
+
* Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`, the
|
|
5956
|
+
* same non-visual-properties attribute a picture's alt text comes from.
|
|
5957
|
+
*/
|
|
5958
|
+
altText?: string;
|
|
5959
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
5960
|
+
title?: string;
|
|
5753
5961
|
/**
|
|
5754
5962
|
* Unrecognised extensions captured from `a:graphicData/a:extLst` so they
|
|
5755
5963
|
* round-trip losslessly. See {@link PptxGraphicFrameExtension}.
|
|
@@ -5765,6 +5973,10 @@ interface TablePptxElement extends PptxElementBase {
|
|
|
5765
5973
|
interface ChartPptxElement extends PptxElementBase {
|
|
5766
5974
|
type: 'chart';
|
|
5767
5975
|
chartData?: PptxChartData;
|
|
5976
|
+
/** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
|
|
5977
|
+
altText?: string;
|
|
5978
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
5979
|
+
title?: string;
|
|
5768
5980
|
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
5769
5981
|
extensionXml?: PptxGraphicFrameExtension[];
|
|
5770
5982
|
}
|
|
@@ -5782,6 +5994,10 @@ interface ChartPptxElement extends PptxElementBase {
|
|
|
5782
5994
|
interface SmartArtPptxElement extends PptxElementBase {
|
|
5783
5995
|
type: 'smartArt';
|
|
5784
5996
|
smartArtData?: PptxSmartArtData;
|
|
5997
|
+
/** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
|
|
5998
|
+
altText?: string;
|
|
5999
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
6000
|
+
title?: string;
|
|
5785
6001
|
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
5786
6002
|
extensionXml?: PptxGraphicFrameExtension[];
|
|
5787
6003
|
}
|
|
@@ -5868,6 +6084,10 @@ interface OlePptxElement extends PptxElementBase {
|
|
|
5868
6084
|
* `false`; `undefined` means the source authored no explicit value.
|
|
5869
6085
|
*/
|
|
5870
6086
|
oleUpdateAutomatic?: boolean;
|
|
6087
|
+
/** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
|
|
6088
|
+
altText?: string;
|
|
6089
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
6090
|
+
title?: string;
|
|
5871
6091
|
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
5872
6092
|
extensionXml?: PptxGraphicFrameExtension[];
|
|
5873
6093
|
}
|
|
@@ -5959,6 +6179,15 @@ interface MediaPptxElement extends PptxElementBase {
|
|
|
5959
6179
|
* (`r:embed`). Defaults to embedded when undefined.
|
|
5960
6180
|
*/
|
|
5961
6181
|
isLinked?: boolean;
|
|
6182
|
+
/**
|
|
6183
|
+
* Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`.
|
|
6184
|
+
* Only populated for the `p:graphicFrame`-shaped (SDK-created) media
|
|
6185
|
+
* form; a `p:pic`-shaped media element's alt text is not currently
|
|
6186
|
+
* parsed (see `PptxHandlerRuntimePictureParsing.ts`).
|
|
6187
|
+
*/
|
|
6188
|
+
altText?: string;
|
|
6189
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. Same scope note as {@link altText}. */
|
|
6190
|
+
title?: string;
|
|
5962
6191
|
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
5963
6192
|
extensionXml?: PptxGraphicFrameExtension[];
|
|
5964
6193
|
}
|
|
@@ -6465,7 +6694,20 @@ interface PptxAnimationGraphicElementTarget {
|
|
|
6465
6694
|
seriesIdx?: number;
|
|
6466
6695
|
/** `@_categoryIdx`, 0-based category index, when the target is category-scoped. */
|
|
6467
6696
|
categoryIdx?: number;
|
|
6468
|
-
/**
|
|
6697
|
+
/**
|
|
6698
|
+
* `p:dgm/@_id` (CT_TLBuildDiagram, ECMA-376 S19.5.10): the diagram DATA MODEL
|
|
6699
|
+
* point id (`dgm:pt/@modelId`) this per-stage effect reveals, when a
|
|
6700
|
+
* `p:bldDgm` build authors one effect per node instead of a single staged
|
|
6701
|
+
* reveal. `dgm`-kind targets only; a `chart`-kind target never carries this.
|
|
6702
|
+
* Matches `PptxSmartArtNode.id` (parsed from the same `@modelId`), so a
|
|
6703
|
+
* diagram renderer can reveal the exact authored node.
|
|
6704
|
+
*/
|
|
6705
|
+
id?: string;
|
|
6706
|
+
/**
|
|
6707
|
+
* `@_bldStep`: `ST_TLChartBuildStep` (`category` / `categoryEl` / `series` /
|
|
6708
|
+
* `seriesEl`) for a `chart`-kind target, or `ST_TLDiagramBuildStep`
|
|
6709
|
+
* (`sp` / `bg`) for a `dgm`-kind target.
|
|
6710
|
+
*/
|
|
6469
6711
|
bldStep?: string;
|
|
6470
6712
|
}
|
|
6471
6713
|
/**
|
|
@@ -6915,6 +7157,34 @@ interface PptxNativeAnimation {
|
|
|
6915
7157
|
* `childStyle`, a legacy compatibility hint. Round-tripped only.
|
|
6916
7158
|
*/
|
|
6917
7159
|
cBhvrOverride?: 'normal' | 'childStyle';
|
|
7160
|
+
/**
|
|
7161
|
+
* `p:set` discrete attribute assignments composed alongside this effect
|
|
7162
|
+
* (ECMA-376 S19.5.79 CT_TLSetBehavior): an instantaneous (non-interpolated)
|
|
7163
|
+
* value change, as opposed to {@link attributeAnimations}'s `p:anim`
|
|
7164
|
+
* keyframe ramps. PowerPoint authors several font-style emphasis effects
|
|
7165
|
+
* this way (Bold Reveal, Underline, Bold Flash, Change Font Size), since
|
|
7166
|
+
* "on/off" or "size N" has nothing to interpolate. Not yet consulted by
|
|
7167
|
+
* shared playback (round-trip/typed-model only so far).
|
|
7168
|
+
*/
|
|
7169
|
+
setAnimations?: PptxSetAnimation[];
|
|
7170
|
+
}
|
|
7171
|
+
/**
|
|
7172
|
+
* One `p:set` discrete (non-interpolated) attribute assignment composed
|
|
7173
|
+
* alongside an authored effect. See {@link PptxNativeAnimation.setAnimations}.
|
|
7174
|
+
*
|
|
7175
|
+
* @see ECMA-376 S19.5.79 CT_TLSetBehavior
|
|
7176
|
+
*/
|
|
7177
|
+
interface PptxSetAnimation {
|
|
7178
|
+
/** Lowercased target attribute from `p:cBhvr/p:attrNameLst/p:attrName`. */
|
|
7179
|
+
attrName: string;
|
|
7180
|
+
/** Decoded value from `p:to` (same variant shape as a `p:tav/p:val`). */
|
|
7181
|
+
value: string | boolean | number;
|
|
7182
|
+
/** Discriminant indicating which `p:to` child carried the value. */
|
|
7183
|
+
valueType: 'str' | 'bool' | 'int' | 'flt' | 'clr';
|
|
7184
|
+
/** Duration from this behaviour's nested `p:cTn/@dur`. */
|
|
7185
|
+
durationMs?: number;
|
|
7186
|
+
/** Start offset from this behaviour's nested `p:stCondLst`. */
|
|
7187
|
+
delayMs?: number;
|
|
6918
7188
|
}
|
|
6919
7189
|
/**
|
|
6920
7190
|
* Parsed `p:animEffect/@filter` (+ `@transition`) descriptor. ECMA-376
|
|
@@ -7182,6 +7452,16 @@ interface PptxElementAnimation {
|
|
|
7182
7452
|
* OOXML equivalent and is not required for playback.
|
|
7183
7453
|
*/
|
|
7184
7454
|
soundFileName?: string;
|
|
7455
|
+
/**
|
|
7456
|
+
* Per-build-level timing template(s) from the {@link sequence}'s own
|
|
7457
|
+
* `p:bldP/p:tmplLst` (ECMA-376 §19.5.84), carried over from the loaded
|
|
7458
|
+
* `PptxNativeAnimation.buildTemplates` this element animation was derived
|
|
7459
|
+
* from so a full timing-tree rebuild (`PptxAnimationWriteService`'s
|
|
7460
|
+
* `buildTimingXml`, when the slide had no prior `p:timing`) can re-emit
|
|
7461
|
+
* them instead of silently dropping the deck's authored per-level
|
|
7462
|
+
* defaults. Absent when {@link sequence} carries no such template.
|
|
7463
|
+
*/
|
|
7464
|
+
buildTemplates?: PptxTimingTemplate[];
|
|
7185
7465
|
}
|
|
7186
7466
|
/**
|
|
7187
7467
|
* A read-only anchor representing one of the deck's own effect groups: a
|
|
@@ -8098,6 +8378,22 @@ interface PptxActiveXControl {
|
|
|
8098
8378
|
name?: string;
|
|
8099
8379
|
/** Shape ID this control is linked to (from @spid). */
|
|
8100
8380
|
shapeId?: string;
|
|
8381
|
+
/**
|
|
8382
|
+
* `p:control/@showAsIcon` (CT_Control, ECMA-376 S19.3.1.2): whether the
|
|
8383
|
+
* control renders as its static icon rather than its live appearance.
|
|
8384
|
+
* `undefined` when the source authored no explicit value (schema default
|
|
8385
|
+
* `false`).
|
|
8386
|
+
*/
|
|
8387
|
+
showAsIcon?: boolean;
|
|
8388
|
+
/**
|
|
8389
|
+
* `p:control/@imgW` in EMU (ST_PositiveCoordinate32): the width the host
|
|
8390
|
+
* reserves for the control's icon/preview image. Distinct from
|
|
8391
|
+
* {@link width}, which is the fallback `p:pic`'s own `a:ext/@cx` in px;
|
|
8392
|
+
* `imgW`/`imgH` are direct attributes on `p:control` itself.
|
|
8393
|
+
*/
|
|
8394
|
+
imgWidthEmu?: number;
|
|
8395
|
+
/** `p:control/@imgH` in EMU (ST_PositiveCoordinate32). @see imgWidthEmu */
|
|
8396
|
+
imgHeightEmu?: number;
|
|
8101
8397
|
/** X position (px) of the control's fallback picture, if present. */
|
|
8102
8398
|
x?: number;
|
|
8103
8399
|
/** Y position (px) of the control's fallback picture, if present. */
|
|
@@ -8554,6 +8850,34 @@ interface PptxPhotoAlbum {
|
|
|
8554
8850
|
layout?: string;
|
|
8555
8851
|
/** Frame style applied to each photo (e.g. "frameStyle1"). */
|
|
8556
8852
|
frame?: string;
|
|
8853
|
+
/**
|
|
8854
|
+
* `p:photoAlbum/@isPhoto` (ECMA-376 S19.2.1.27, CT_PhotoAlbum): whether
|
|
8855
|
+
* the pictures placed by the album wizard are real photographs, as
|
|
8856
|
+
* opposed to clip art or other embedded images. `undefined` when the
|
|
8857
|
+
* source authored no explicit value (schema default `false`); this is a
|
|
8858
|
+
* purely declarative wizard-provenance flag, not something this library
|
|
8859
|
+
* gates any layout/frame behaviour on.
|
|
8860
|
+
*/
|
|
8861
|
+
isPhoto?: boolean;
|
|
8862
|
+
}
|
|
8863
|
+
/**
|
|
8864
|
+
* A recognizer-owned `p:smartTags` reference from `presentation.xml`
|
|
8865
|
+
* (CT_SmartTags, ECMA-376 S19.2.1.42): a bare relationship id pointing at a
|
|
8866
|
+
* legacy Office "Smart Tags" recognizer part, distinct from the
|
|
8867
|
+
* user-authored `p:tags` construct (see {@link PptxTagCollection}).
|
|
8868
|
+
*
|
|
8869
|
+
* This library has no data model for recognizer part CONTENT (there is no
|
|
8870
|
+
* way to create, inspect, or edit one through the public API), so this type
|
|
8871
|
+
* only captures enough to preserve an authored reference losslessly: the
|
|
8872
|
+
* relationship id and, when resolvable, the target part path.
|
|
8873
|
+
*/
|
|
8874
|
+
interface PptxSmartTagsReference {
|
|
8875
|
+
/** Relationship id from `p:smartTags/@r:id`. */
|
|
8876
|
+
relId: string;
|
|
8877
|
+
/** Resolved ZIP path of the referenced recognizer part, when resolvable. */
|
|
8878
|
+
targetPath?: string;
|
|
8879
|
+
/** Raw `p:smartTags` XML retained for lossless round-trip. */
|
|
8880
|
+
rawXml?: XmlObject;
|
|
8557
8881
|
}
|
|
8558
8882
|
/**
|
|
8559
8883
|
* East Asian line-break (kinsoku) settings from `p:kinsoku` in `presentation.xml`.
|
|
@@ -8618,6 +8942,13 @@ interface PptxData {
|
|
|
8618
8942
|
themeOptions?: PptxThemeOption[];
|
|
8619
8943
|
/** Parsed table style definitions from `ppt/tableStyles.xml`. */
|
|
8620
8944
|
tableStyleMap?: ParsedTableStyleMap;
|
|
8945
|
+
/**
|
|
8946
|
+
* The current default table style GUID (`ppt/tableStyles.xml`'s
|
|
8947
|
+
* `a:tblStyleLst/@def`): the style PowerPoint applies to a newly inserted
|
|
8948
|
+
* table. Matches `PptxSaveOptions.tableStylesDefaultId` so a save call
|
|
8949
|
+
* that omits it can fall back to what was loaded.
|
|
8950
|
+
*/
|
|
8951
|
+
tableStylesDefaultId?: string;
|
|
8621
8952
|
/** Whether the presentation is password-protected. */
|
|
8622
8953
|
isPasswordProtected?: boolean;
|
|
8623
8954
|
/** Embedded font data (name + binary data URL) extracted from the presentation. */
|
|
@@ -8677,6 +9008,14 @@ interface PptxData {
|
|
|
8677
9008
|
modifyVerifier?: PptxModifyVerifier;
|
|
8678
9009
|
/** Photo album metadata from `p:photoAlbum` in `presentation.xml`. */
|
|
8679
9010
|
photoAlbum?: PptxPhotoAlbum;
|
|
9011
|
+
/**
|
|
9012
|
+
* Legacy Smart Tags recognizer reference from `p:smartTags` in
|
|
9013
|
+
* `presentation.xml`. Read-only: there is no data model for the
|
|
9014
|
+
* recognizer part's own content, so this exists to make the reference
|
|
9015
|
+
* inspectable and to prove it survives a save (the owning part and its
|
|
9016
|
+
* relationship are preserved passively, like any other unmodelled part).
|
|
9017
|
+
*/
|
|
9018
|
+
smartTags?: PptxSmartTagsReference;
|
|
8680
9019
|
/** East Asian line-break settings from `p:kinsoku` in `presentation.xml`. */
|
|
8681
9020
|
kinsoku?: PptxKinsoku;
|
|
8682
9021
|
/** Custom XML data parts from `customXml/` in the OPC package. */
|
|
@@ -8841,6 +9180,14 @@ type FillInput = {
|
|
|
8841
9180
|
type: 'solid';
|
|
8842
9181
|
color: string;
|
|
8843
9182
|
opacity?: number;
|
|
9183
|
+
/**
|
|
9184
|
+
* A theme colour to use instead of a plain hex. When set, the shape
|
|
9185
|
+
* saves as `<a:schemeClr>` (e.g. `{ scheme: 'accent1', lumMod: 0.8 }`
|
|
9186
|
+
* for "Accent 1, Lighter 80%") so it keeps following the theme after a
|
|
9187
|
+
* later theme change; `color` still supplies the immediate resolved
|
|
9188
|
+
* hex for renderers that read it directly.
|
|
9189
|
+
*/
|
|
9190
|
+
themeColorRef?: PptxThemeColorRef;
|
|
8844
9191
|
} | {
|
|
8845
9192
|
type: 'gradient';
|
|
8846
9193
|
/**
|
|
@@ -8876,6 +9223,8 @@ interface StrokeInput {
|
|
|
8876
9223
|
opacity?: number;
|
|
8877
9224
|
join?: 'round' | 'bevel' | 'miter';
|
|
8878
9225
|
cap?: 'flat' | 'rnd' | 'sq';
|
|
9226
|
+
/** A theme colour for the outline; see {@link FillInput}'s `themeColorRef`. */
|
|
9227
|
+
themeColorRef?: PptxThemeColorRef;
|
|
8879
9228
|
}
|
|
8880
9229
|
interface ShadowInput {
|
|
8881
9230
|
color?: string;
|
|
@@ -8892,6 +9241,8 @@ interface TextStyleInput {
|
|
|
8892
9241
|
underline?: boolean;
|
|
8893
9242
|
strikethrough?: boolean;
|
|
8894
9243
|
color?: string;
|
|
9244
|
+
/** A theme colour for the run; see {@link FillInput}'s `themeColorRef`. */
|
|
9245
|
+
themeColorRef?: PptxThemeColorRef;
|
|
8895
9246
|
alignment?: 'left' | 'center' | 'right' | 'justify';
|
|
8896
9247
|
verticalAlignment?: 'top' | 'middle' | 'bottom';
|
|
8897
9248
|
lineSpacing?: number;
|
|
@@ -9519,6 +9870,24 @@ interface PptxHandlerSaveOptions {
|
|
|
9519
9870
|
* part untouched.
|
|
9520
9871
|
*/
|
|
9521
9872
|
tableStyles?: ParsedTableStyleMap;
|
|
9873
|
+
/**
|
|
9874
|
+
* Set `ppt/tableStyles.xml`'s `<a:tblStyleLst @def>` to this style GUID
|
|
9875
|
+
* (normalised to uppercase-with-braces). `undefined` preserves the
|
|
9876
|
+
* existing default; there is no removal form (`@def` is required by the
|
|
9877
|
+
* schema and PowerPoint always points it at a real style). No-op when the
|
|
9878
|
+
* archive has no `ppt/tableStyles.xml`, same as {@link tableStyles}.
|
|
9879
|
+
*/
|
|
9880
|
+
tableStylesDefaultId?: string;
|
|
9881
|
+
/**
|
|
9882
|
+
* Style GUIDs to remove from `ppt/tableStyles.xml` entirely, kept as a
|
|
9883
|
+
* separate opt-in list rather than inferred from omission on
|
|
9884
|
+
* {@link tableStyles}: that map is documented as safe to pass a PARTIAL
|
|
9885
|
+
* edit (only the entries a caller actually touched), so treating every
|
|
9886
|
+
* GUID missing from it as "delete this" would silently destroy untouched
|
|
9887
|
+
* styles on an ordinary targeted edit. A GUID here that is also the
|
|
9888
|
+
* current (or newly requested) default is left in place and skipped.
|
|
9889
|
+
*/
|
|
9890
|
+
tableStylesToDelete?: string[];
|
|
9522
9891
|
/**
|
|
9523
9892
|
* Target output format.
|
|
9524
9893
|
* - `'pptx'` (default): Standard presentation.
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as e, G as a, J as t, K as o, Q as i, W as r, X as n, Y as l, Z as S, a as d, at as m, c as p, ct as T, dt as v, et as P, ft as g, it as u, l as h, lt as c, mt as A, nt as C, o as N, ot as f, pt as k, q as D, rt as E, s as x, st as b, t as B, tt as I, u as O, ut as _ } from "./export-
|
|
2
|
-
import { i as R } from "./translator-
|
|
1
|
+
import { $ as e, G as a, J as t, K as o, Q as i, W as r, X as n, Y as l, Z as S, a as d, at as m, c as p, ct as T, dt as v, et as P, ft as g, it as u, l as h, lt as c, mt as A, nt as C, o as N, ot as f, pt as k, q as D, rt as E, s as x, st as b, t as B, tt as I, u as O, ut as _ } from "./export-yk0mo1AN.js";
|
|
2
|
+
import { i as R } from "./translator-Bb6pIYyq.js";
|
|
3
3
|
import "./i18n.js";
|
|
4
4
|
export {
|
|
5
5
|
r as PPTX_OPEN_ACCEPT,
|