pptx-svelte-viewer 3.8.0 → 3.9.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 +13 -0
- package/dist/{AiChatPanel-ByiDm0_K.js → AiChatPanel-yqg_BJme.js} +1 -1
- package/dist/{export-yk0mo1AN.js → export-zAcr-4rr.js} +31869 -29511
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +150 -23
- package/dist/index.js +2 -2
- package/dist/pptx-svelte-viewer.css +1 -1
- package/dist/{translator-Bb6pIYyq.js → translator-Cxn32Y3A.js} +52 -4
- package/dist/viewer/ai/ai-bridge.d.ts +25 -1
- package/dist/viewer/ai/ai-bridge.d.ts.map +1 -1
- package/dist/viewer/collab/collaboration-deps.d.ts +8 -1
- package/dist/viewer/collab/collaboration-deps.d.ts.map +1 -1
- package/dist/viewer/collab/collaboration.svelte.d.ts.map +1 -1
- package/dist/viewer/components/chart-drag.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-document-lifecycle.d.ts.map +1 -1
- package/dist/viewer/editor/editor-document-state.d.ts +7 -2
- package/dist/viewer/editor/editor-document-state.d.ts.map +1 -1
- package/dist/viewer/editor/editor-state.svelte.d.ts +14 -1
- package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +234 -23
- package/dist/viewer/index.js +1 -1
- package/dist/viewer/state/create-viewer-state-ai.svelte.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state-collab.svelte.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state.svelte.d.ts.map +1 -1
- package/dist/viewer/state/inspector-deck.d.ts +12 -1
- package/dist/viewer/state/inspector-deck.d.ts.map +1 -1
- package/dist/viewer/state/presentation-loader.svelte.d.ts +8 -0
- package/dist/viewer/state/presentation-loader.svelte.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/i18n.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2394,7 +2394,38 @@ interface PptxChartDataPointPicture {
|
|
|
2394
2394
|
//#region src/core/types/chart-pivot-format.d.ts
|
|
2395
2395
|
interface PptxChartPivotFormat {
|
|
2396
2396
|
index: number;
|
|
2397
|
+
/**
|
|
2398
|
+
* Typed projection of `spPr` (fill/stroke colour, stroke width, dash
|
|
2399
|
+
* style). When the parser is given a colour resolver (the normal case: the
|
|
2400
|
+
* runtime always supplies one), both a literal `a:srgbClr` and an
|
|
2401
|
+
* `a:schemeClr` theme reference (with its `lumMod`/`lumOff`/`tint`/`shade`
|
|
2402
|
+
* modifiers) resolve to a hex colour here, the same theme +
|
|
2403
|
+
* `c:clrMapOvr` chain the rest of chart parsing uses. Without a resolver
|
|
2404
|
+
* (e.g. a hand-built `PptxChartPivotFormat` with no theme to resolve
|
|
2405
|
+
* against), only the literal case resolves. Either way the authored node
|
|
2406
|
+
* is byte-preserved through {@link shapePropertiesXml} until this field is
|
|
2407
|
+
* set to something that no longer matches what re-parses off the current
|
|
2408
|
+
* XML; setting it then re-derives `shapePropertiesXml` on save (merged
|
|
2409
|
+
* onto whatever was already authored, keeping an unrelated schemeClr
|
|
2410
|
+
* reference alive when the colour itself is unchanged) unless
|
|
2411
|
+
* `shapePropertiesXml` is set explicitly, which wins.
|
|
2412
|
+
*/
|
|
2413
|
+
shapeProperties?: PptxChartShapeProps;
|
|
2414
|
+
/**
|
|
2415
|
+
* Typed projection of `txPr`'s `a:p/a:pPr/a:defRPr` (size/bold/italic/
|
|
2416
|
+
* colour/family), the same shape a legend entry or data-table's text
|
|
2417
|
+
* override models. Colour resolution mirrors {@link shapeProperties}
|
|
2418
|
+
* (theme-resolved `schemeClr` when a colour resolver is supplied, literal
|
|
2419
|
+
* `srgbClr` otherwise). See {@link txPrXml} for the raw fallback.
|
|
2420
|
+
*/
|
|
2421
|
+
textStyle?: PptxChartLegendTextStyle;
|
|
2422
|
+
/**
|
|
2423
|
+
* Typed projection of `marker` (symbol/size/spPr). See {@link markerXml}
|
|
2424
|
+
* for the raw fallback.
|
|
2425
|
+
*/
|
|
2426
|
+
marker?: PptxChartMarker;
|
|
2397
2427
|
shapePropertiesXml?: XmlObject | null;
|
|
2428
|
+
txPrXml?: XmlObject | null;
|
|
2398
2429
|
markerXml?: XmlObject | null;
|
|
2399
2430
|
dataLabelXml?: XmlObject | null;
|
|
2400
2431
|
extensionListXml?: XmlObject | null;
|
|
@@ -2587,20 +2618,6 @@ interface PptxChartTitleRun {
|
|
|
2587
2618
|
}
|
|
2588
2619
|
//#endregion
|
|
2589
2620
|
//#region src/core/types/chart-user-shapes.d.ts
|
|
2590
|
-
/**
|
|
2591
|
-
* Types for chart drawing-overlay shapes (`c:userShapes`).
|
|
2592
|
-
*
|
|
2593
|
-
* A chart's `c:userShapes` element carries an `r:id` that references a
|
|
2594
|
-
* separate drawing part (`ppt/drawings/drawingN.xml`) whose root is a
|
|
2595
|
-
* `c:userShapes` element populated with `cdr:relSizeAnchor` /
|
|
2596
|
-
* `cdr:absSizeAnchor` wrappers around `sp` / `pic` / `cxnSp` shapes drawn on
|
|
2597
|
-
* top of the chart plot. These interfaces describe the parsed, renderable
|
|
2598
|
-
* overlay model. The raw reference is preserved separately on
|
|
2599
|
-
* {@link PptxChartData.userShapesXml} for verbatim round-trip save; this model
|
|
2600
|
-
* is render-only.
|
|
2601
|
-
*
|
|
2602
|
-
* @module pptx-types/chart-user-shapes
|
|
2603
|
-
*/
|
|
2604
2621
|
/** A single paragraph of overlay-shape text with light formatting. */
|
|
2605
2622
|
interface PptxChartUserShapeParagraph {
|
|
2606
2623
|
/** Joined run text of the paragraph. */
|
|
@@ -2616,6 +2633,80 @@ interface PptxChartUserShapeParagraph {
|
|
|
2616
2633
|
/** Paragraph alignment (`a:pPr/@algn`): left / centre / right. */
|
|
2617
2634
|
align?: 'l' | 'ctr' | 'r';
|
|
2618
2635
|
}
|
|
2636
|
+
/**
|
|
2637
|
+
* The DrawingML 2D group transform (`a:xfrm` inside `cdr:grpSpPr`) that
|
|
2638
|
+
* anchors a `grpSp`'s own box ({@link off}/{@link ext}) and establishes the
|
|
2639
|
+
* coordinate space its children are expressed in ({@link chOff}/{@link
|
|
2640
|
+
* chExt}), all in EMU. A child's position within the group is mapped into
|
|
2641
|
+
* the group's own box via
|
|
2642
|
+
* `frac = (child.off - chOff) / chExt`, then applied to the enclosing
|
|
2643
|
+
* anchor's box; see `flattenChartUserShapes` in
|
|
2644
|
+
* `chart-user-shapes-parser.ts`.
|
|
2645
|
+
*/
|
|
2646
|
+
interface PptxChartUserShapeGroupTransform {
|
|
2647
|
+
/** The group's own position in its parent's coordinate space, in EMU. */
|
|
2648
|
+
off: {
|
|
2649
|
+
x: number;
|
|
2650
|
+
y: number;
|
|
2651
|
+
};
|
|
2652
|
+
/** The group's own size in its parent's coordinate space, in EMU. */
|
|
2653
|
+
ext: {
|
|
2654
|
+
cx: number;
|
|
2655
|
+
cy: number;
|
|
2656
|
+
};
|
|
2657
|
+
/** Origin of the child coordinate space (`a:chOff`), in EMU. */
|
|
2658
|
+
chOff: {
|
|
2659
|
+
x: number;
|
|
2660
|
+
y: number;
|
|
2661
|
+
};
|
|
2662
|
+
/** Size of the child coordinate space (`a:chExt`), in EMU. */
|
|
2663
|
+
chExt: {
|
|
2664
|
+
cx: number;
|
|
2665
|
+
cy: number;
|
|
2666
|
+
};
|
|
2667
|
+
}
|
|
2668
|
+
/**
|
|
2669
|
+
* One shape grouped inside a `cdr:grpSp` (or a nested `cdr:grpSp` itself).
|
|
2670
|
+
* Unlike a top-level {@link PptxChartUserShape}, a group child has no
|
|
2671
|
+
* drawing anchor of its own: its position is expressed in its parent
|
|
2672
|
+
* group's child coordinate space via {@link off}/{@link ext} (EMU, read
|
|
2673
|
+
* from the child's own `a:xfrm`), not as a chart-relative fraction.
|
|
2674
|
+
*/
|
|
2675
|
+
interface PptxChartUserShapeGroupChild {
|
|
2676
|
+
/** Shape kind, same vocabulary as {@link PptxChartUserShape.kind}. */
|
|
2677
|
+
kind: 'sp' | 'cxnSp' | 'pic' | 'grpSp' | 'graphicFrame';
|
|
2678
|
+
/** Position within the parent group's child coordinate space, in EMU. */
|
|
2679
|
+
off: {
|
|
2680
|
+
x: number;
|
|
2681
|
+
y: number;
|
|
2682
|
+
};
|
|
2683
|
+
/** Size within the parent group's child coordinate space, in EMU. */
|
|
2684
|
+
ext: {
|
|
2685
|
+
cx: number;
|
|
2686
|
+
cy: number;
|
|
2687
|
+
};
|
|
2688
|
+
/** Preset geometry name (`a:prstGeom/@prst`), defaulting to `"rect"`. */
|
|
2689
|
+
prst?: string;
|
|
2690
|
+
/** Resolved solid-fill hex colour, when present. */
|
|
2691
|
+
fill?: string;
|
|
2692
|
+
/** Resolved line/stroke hex colour, when present. */
|
|
2693
|
+
stroke?: string;
|
|
2694
|
+
/** Line width in points (`a:ln/@w` divided by 12700), when present. */
|
|
2695
|
+
strokeWidth?: number;
|
|
2696
|
+
/** Text paragraphs of the shape's `txBody`, when present. */
|
|
2697
|
+
paragraphs?: PptxChartUserShapeParagraph[];
|
|
2698
|
+
/**
|
|
2699
|
+
* Verbatim source XML of a `pic`/`graphicFrame` child, or of this node
|
|
2700
|
+
* itself when `kind === 'grpSp'` and the nested group is untouched since
|
|
2701
|
+
* parse. See {@link PptxChartUserShape.rawXml}'s doc for the same
|
|
2702
|
+
* contract one level up.
|
|
2703
|
+
*/
|
|
2704
|
+
rawXml?: XmlObject;
|
|
2705
|
+
/** Present when `kind === 'grpSp'`: this nested group's own transform. */
|
|
2706
|
+
transform?: PptxChartUserShapeGroupTransform;
|
|
2707
|
+
/** Present when `kind === 'grpSp'`: this nested group's own children. */
|
|
2708
|
+
children?: PptxChartUserShapeGroupChild[];
|
|
2709
|
+
}
|
|
2619
2710
|
/**
|
|
2620
2711
|
* A parsed chart-overlay shape positioned by a drawing anchor.
|
|
2621
2712
|
*
|
|
@@ -2626,12 +2717,13 @@ interface PptxChartUserShapeParagraph {
|
|
|
2626
2717
|
interface PptxChartUserShape {
|
|
2627
2718
|
/**
|
|
2628
2719
|
* Shape kind: text/preset shape, connector, picture, a group of the
|
|
2629
|
-
* above (`grpSp`,
|
|
2630
|
-
*
|
|
2631
|
-
*
|
|
2632
|
-
*
|
|
2633
|
-
*
|
|
2634
|
-
*
|
|
2720
|
+
* above (`grpSp`, with its own {@link transform} and {@link children},
|
|
2721
|
+
* nested arbitrarily; use `flattenChartUserShapes` from
|
|
2722
|
+
* `chart-user-shapes-parser.ts` to get a flat, render-ready leaf list
|
|
2723
|
+
* with the group transform already applied), or a bare placeholder for
|
|
2724
|
+
* a `graphicFrame` anchor child (deep content such as a nested chart or
|
|
2725
|
+
* table is out of scope; it only keeps the anchor's space accounted for
|
|
2726
|
+
* instead of the whole overlay disappearing).
|
|
2635
2727
|
*/
|
|
2636
2728
|
kind: 'sp' | 'cxnSp' | 'pic' | 'grpSp' | 'graphicFrame';
|
|
2637
2729
|
/** Anchor kind that positioned the shape. */
|
|
@@ -2661,6 +2753,26 @@ interface PptxChartUserShape {
|
|
|
2661
2753
|
strokeWidth?: number;
|
|
2662
2754
|
/** Text paragraphs of the shape's `txBody`, when present. */
|
|
2663
2755
|
paragraphs?: PptxChartUserShapeParagraph[];
|
|
2756
|
+
/**
|
|
2757
|
+
* Verbatim source XML of a `pic` or `graphicFrame` anchor child (the
|
|
2758
|
+
* `cdr:pic` / `cdr:graphicFrame` node itself, not the enclosing anchor),
|
|
2759
|
+
* or of the `cdr:grpSp` node itself when `kind === 'grpSp'` and the
|
|
2760
|
+
* group is untouched since parse (byte-identical passthrough). None of
|
|
2761
|
+
* these three kinds have a reconstructable typed representation that is
|
|
2762
|
+
* guaranteed lossless (a picture's blip reference, a nested chart/table's
|
|
2763
|
+
* graphic content, or a group's exact child ordering/ids), so the
|
|
2764
|
+
* serializer re-emits this verbatim when present instead of a lossy
|
|
2765
|
+
* rebuild. Editing a shape inside a group (via the SDK's path-based
|
|
2766
|
+
* overlay operations) clears the group's `rawXml` so the serializer
|
|
2767
|
+
* regenerates it from {@link transform}/{@link children} instead. Absent
|
|
2768
|
+
* for `sp`/`cxnSp`, which round-trip losslessly through their typed
|
|
2769
|
+
* fields above.
|
|
2770
|
+
*/
|
|
2771
|
+
rawXml?: XmlObject;
|
|
2772
|
+
/** Present when `kind === 'grpSp'`: the group's own transform. */
|
|
2773
|
+
transform?: PptxChartUserShapeGroupTransform;
|
|
2774
|
+
/** Present when `kind === 'grpSp'`: the grouped children, nested arbitrarily. */
|
|
2775
|
+
children?: PptxChartUserShapeGroupChild[];
|
|
2664
2776
|
}
|
|
2665
2777
|
//#endregion
|
|
2666
2778
|
//#region src/core/types/chart.d.ts
|
|
@@ -5813,6 +5925,21 @@ interface PptxAccessibilityProperties {
|
|
|
5813
5925
|
*/
|
|
5814
5926
|
isDecorative?: boolean;
|
|
5815
5927
|
}
|
|
5928
|
+
/**
|
|
5929
|
+
* Accessibility description/title from `p:cNvPr/@descr` / `@title` on a
|
|
5930
|
+
* plain shape, text box or connector (`p:sp` / `p:cxnSp`). The same pair of
|
|
5931
|
+
* attributes already round-trips for a graphic frame (see
|
|
5932
|
+
* {@link TablePptxElement.altText}) and, `descr` only, for a picture
|
|
5933
|
+
* ({@link PptxImageProperties.altText}); this mixin extends it to the three
|
|
5934
|
+
* element kinds whose PowerPoint Alt Text pane data was previously dropped
|
|
5935
|
+
* on load because neither field existed on the model.
|
|
5936
|
+
*/
|
|
5937
|
+
interface PptxNonVisualDescription {
|
|
5938
|
+
/** `p:cNvPr/@descr`. */
|
|
5939
|
+
altText?: string;
|
|
5940
|
+
/** `p:cNvPr/@title`. */
|
|
5941
|
+
title?: string;
|
|
5942
|
+
}
|
|
5816
5943
|
/**
|
|
5817
5944
|
* `a:cNvPicPr/@preferRelativeResize` (issue G13), a picture-only non-visual
|
|
5818
5945
|
* property distinct from `a:picLocks`.
|
|
@@ -5845,7 +5972,7 @@ interface PptxPictureNonVisualProperties {
|
|
|
5845
5972
|
* // => satisfies TextPptxElement
|
|
5846
5973
|
* ```
|
|
5847
5974
|
*/
|
|
5848
|
-
interface TextPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties {
|
|
5975
|
+
interface TextPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxNonVisualDescription {
|
|
5849
5976
|
type: 'text';
|
|
5850
5977
|
}
|
|
5851
5978
|
/**
|
|
@@ -5863,7 +5990,7 @@ interface TextPptxElement extends PptxElementBase, PptxTextProperties, PptxShape
|
|
|
5863
5990
|
* // => satisfies ShapePptxElement
|
|
5864
5991
|
* ```
|
|
5865
5992
|
*/
|
|
5866
|
-
interface ShapePptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxCustomPathProperties, PptxAccessibilityProperties {
|
|
5993
|
+
interface ShapePptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxCustomPathProperties, PptxAccessibilityProperties, PptxNonVisualDescription {
|
|
5867
5994
|
type: 'shape';
|
|
5868
5995
|
}
|
|
5869
5996
|
/**
|
|
@@ -5885,7 +6012,7 @@ interface ShapePptxElement extends PptxElementBase, PptxTextProperties, PptxShap
|
|
|
5885
6012
|
* // => satisfies ConnectorPptxElement
|
|
5886
6013
|
* ```
|
|
5887
6014
|
*/
|
|
5888
|
-
interface ConnectorPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties {
|
|
6015
|
+
interface ConnectorPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxNonVisualDescription {
|
|
5889
6016
|
type: 'connector';
|
|
5890
6017
|
}
|
|
5891
6018
|
/**
|
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-zAcr-4rr.js";
|
|
2
|
+
import { i as R } from "./translator-Cxn32Y3A.js";
|
|
3
3
|
import "./i18n.js";
|
|
4
4
|
export {
|
|
5
5
|
r as PPTX_OPEN_ACCEPT,
|