pptx-kit 0.3.0 → 0.4.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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # pptx-kit
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9809441: Chart label fonts, table cell merging, and aspect-ratio-preserving image placement
8
+
9
+ **`ChartTextStyle.font`** — chart titles, axis titles, axis tick labels,
10
+ legends, and data labels now accept a font face
11
+ (`titleStyle: { font: 'Yu Gothic' }`). The builder writes both
12
+ `<a:latin typeface>` and `<a:ea typeface>` so CJK families render
13
+ correctly in PowerPoint, and `getSlideCharts` / `getShapeChartSpec` read
14
+ the face back for round-trips. Works through both `addSlideChart` and
15
+ `setChartSpec`. (The SVG preview keeps its fixed substitution font set —
16
+ authored chart faces affect the emitted PPTX, not the preview raster.)
17
+
18
+ **`mergeTableCells(table, { row, col, rowSpan, colSpan })`** — the write
19
+ counterpart to `getTableCellSpan`. Merges a rectangular block into its
20
+ top-left anchor, emitting `gridSpan` / `rowSpan` on the anchor and
21
+ `hMerge` / `vMerge` on the covered cells per ECMA-376 §21.1.3.18.
22
+ Out-of-range blocks, 1×1 blocks, and overlaps with existing merges are
23
+ rejected with descriptive errors before anything is mutated.
24
+
25
+ **`fit: 'contain'` on `addSlideImage` / `setShapeImage`** — preserve the
26
+ image's aspect ratio instead of stretching to the target box. `'contain'`
27
+ inscribes and centers the image (natural size read from the PNG / JPEG
28
+ header); other formats fall back to the default `'fill'` (the existing
29
+ stretch behavior) rather than erroring. On `setShapeImage`,
30
+ `fit: 'contain'` re-fits the replacement image inside the picture's
31
+ current box.
32
+
3
33
  ## 0.3.0
4
34
 
5
35
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -1847,14 +1847,29 @@ declare const getCommentPosition: (comment: SlideCommentData) => CommentPosition
1847
1847
  */
1848
1848
  declare const getCommentSlide: (comment: SlideCommentData) => SlideData;
1849
1849
 
1850
+ /**
1851
+ * How an image fills its target box:
1852
+ *
1853
+ * - `'fill'` — stretch to the exact `w × h`, ignoring aspect ratio
1854
+ * (the historical behavior, and the default for back-compat).
1855
+ * - `'contain'` — scale to fit inside the box preserving aspect ratio,
1856
+ * then center the result. The box's empty margins stay transparent.
1857
+ */
1858
+ type ImageFit = 'fill' | 'contain';
1850
1859
  /**
1851
1860
  * Replaces a picture's media with `bytes`. Same-format replacements
1852
1861
  * write in place; cross-format replacements allocate a new media part
1853
- * and repoint the rel. The original geometry — crop, sizing, transform —
1854
- * is preserved.
1862
+ * and repoint the rel. The geometry — crop, transform — is preserved.
1863
+ *
1864
+ * Pass `options.fit: 'contain'` to re-fit the picture's extent to the
1865
+ * replacement image's aspect ratio, inscribed and centered in the shape's
1866
+ * current `(off, ext)` box. The default `'fill'` leaves the extent as-is
1867
+ * (the historical behavior). When the new image's natural size can't be
1868
+ * measured (non-PNG/JPEG), `'contain'` is a no-op rather than an error.
1855
1869
  */
1856
1870
  declare const setShapeImage: (shape: SlideShapeData, bytes: Uint8Array, options?: {
1857
1871
  format?: ImageFormat;
1872
+ fit?: ImageFit;
1858
1873
  }) => void;
1859
1874
 
1860
1875
  /** What clicking the shape should do. */
@@ -2153,6 +2168,14 @@ type ChartGrouping = 'clustered' | 'stacked' | 'percentStacked' | 'standard';
2153
2168
  * renderer's default for this label position."
2154
2169
  */
2155
2170
  interface ChartTextStyle {
2171
+ /**
2172
+ * Font face applied to both the latin and east-asian typeface slots —
2173
+ * `<a:rPr><a:latin typeface="…"/><a:ea typeface="…"/>`. East-asian is
2174
+ * set alongside latin so a Japanese / CJK family (e.g. `'Yu Gothic'`)
2175
+ * renders the labels instead of the renderer's latin-only fallback.
2176
+ * Mirrors the latin/ea pairing PowerPoint emits for CJK chart fonts.
2177
+ */
2178
+ readonly font?: string;
2156
2179
  /** Font size in points. From `<a:rPr sz="N"/>` where N is in 100ths of a pt. */
2157
2180
  readonly sizePt?: number;
2158
2181
  /** Bold flag from `<a:rPr b="1"/>`. */
@@ -2830,6 +2853,34 @@ declare const getTableCellSpan: (cell: TableCellData) => {
2830
2853
  hMerge: boolean;
2831
2854
  vMerge: boolean;
2832
2855
  };
2856
+ /**
2857
+ * Merges a rectangular block of table cells into a single visual cell.
2858
+ *
2859
+ * The block's top-left cell `(row, col)` becomes the anchor and carries
2860
+ * `gridSpan` (= `colSpan`) / `rowSpan`; the cells it covers are marked
2861
+ * `hMerge` / `vMerge` per ECMA-376 §21.1.3.18 (`CT_TableCell`) so the
2862
+ * grid stays rectangular while PowerPoint paints only the anchor. This
2863
+ * is the write counterpart to {@link getTableCellSpan}.
2864
+ *
2865
+ * Constraints, enforced loudly (these are authoring-boundary inputs):
2866
+ *
2867
+ * - `rowSpan` / `colSpan` must be ≥ 1, and at least one must be > 1
2868
+ * (a 1×1 "merge" is a no-op the caller didn't mean).
2869
+ * - The block must lie fully inside the table grid.
2870
+ * - No cell in the block may already participate in another merge —
2871
+ * overlapping merges corrupt the grid and trip PowerPoint's repair
2872
+ * dialog. Split the existing merge first.
2873
+ *
2874
+ * The anchor cell's text is preserved; covered cells keep their own
2875
+ * `<a:txBody>` in the XML (PowerPoint ignores it while the merge marker
2876
+ * is set) so the operation stays losslessly reversible.
2877
+ */
2878
+ declare const mergeTableCells: (table: SlideShapeData, block: {
2879
+ readonly row: number;
2880
+ readonly col: number;
2881
+ readonly rowSpan: number;
2882
+ readonly colSpan: number;
2883
+ }) => void;
2833
2884
  /**
2834
2885
  * One side of a cell's border, as read from `<a:tcPr><a:ln{L|R|T|B}>`.
2835
2886
  * `widthEmu` is the line width in EMU; `color` is `#RRGGBB` or `null`
@@ -3945,6 +3996,13 @@ declare const addSlideTable: (slide: SlideData, opts: {
3945
3996
  * rel, and appends a `<p:pic>` element to the slide's `<p:spTree>`.
3946
3997
  *
3947
3998
  * Format is detected from magic bytes; pass `opts.format` to override.
3999
+ *
4000
+ * `opts.fit` controls how the image fills the `w × h` box. `'fill'` (the
4001
+ * default) stretches to the exact box, ignoring aspect ratio. `'contain'`
4002
+ * scales the image to fit inside the box preserving its aspect ratio and
4003
+ * centers it — measured from the PNG / JPEG header. For other formats (or
4004
+ * an unreadable header) `'contain'` falls back to `'fill'` rather than
4005
+ * erroring, since the natural size is unknown.
3948
4006
  */
3949
4007
  declare const addSlideImage: (slide: SlideData, bytes: Uint8Array, opts: {
3950
4008
  x: Emu;
@@ -3953,6 +4011,7 @@ declare const addSlideImage: (slide: SlideData, bytes: Uint8Array, opts: {
3953
4011
  h: Emu;
3954
4012
  format?: ImageFormat;
3955
4013
  name?: string;
4014
+ fit?: ImageFit;
3956
4015
  }) => SlideShapeData;
3957
4016
 
3958
4017
  /** PowerPoint's user-visible layout name. */
@@ -5115,4 +5174,4 @@ declare const SLIDE_SIZE_16_10: SlideSize;
5115
5174
 
5116
5175
  declare const VERSION: string;
5117
5176
 
5118
- export { type AllShapesEntry, type AnimationEffect, type AnimationOptions, type ArrowOptions, type BulletStyle, type ChartAxisScaling, type ChartDataLabelPosition, type ChartDataLabels, type ChartGrouping, type ChartKind, type ChartSeries, type ChartSpec, type ChartTextStyle, type ChartTrendline, type CommentAuthor, type CommentPosition, type CoreProperties, type CustomGeometry, type Emu, type ExtendedProperties, type GeomCommand, type GeomPath, type GeomPoint, type GlowOptions, type GradientFillOptions, type GradientStop, type ImageCrop, type ImageFormat, type IssueSeverity, type LineDash, type LineEndSize, type LineEndType, type MediaPart, type PackagePartInfo, type ParagraphAlignment, type ParagraphProperties, type PathFillMode, type PatternFillOptions, type PatternPreset, type PresentationChartEntry, type PresentationCommentEntry, type PresentationData, type PresentationFonts, type PresentationHyperlinkEntry, type PresentationImageEntry, type PresentationInput, type PresentationNotesEntry, type PresentationSize, type PresentationSummary, type PresentationTableEntry, type PresentationTheme, type PresentationThumbnail, type PresetShape, SLIDE_SIZE_16_10, SLIDE_SIZE_16_9, SLIDE_SIZE_4_3, type ShadowOptions, type ShapeBounds, type ShapeClickAction, type ShapeEffect, type ShapeEffectAny, type ShapeFill, type ShapeParagraphElement, type ShapeStroke, type SlideBackground, type SlideChartData, type SlideComment, type SlideCommentData, type SlideData, type SlideInfo, type SlideLayoutBackgroundShape, type SlideLayoutData, type SlideLayoutPlaceholder, type SlideOutlineEntry, type SlideSection, type SlideShapeData, type SlideSize, type TableCellBorder, type TableCellBorders, type TableCellData, type TableCellParagraph, type TextAnchor, type TextAutoFit, type TextFormat, type TextWrap, type TransitionEffect, type TransitionOptions, VERSION, type ValidationIssue, _internalPackageOf, addBlankSlide, addContentSlide, addSectionHeaderSlide, addSlide, addSlideAt, addSlideChart, addSlideComment, addSlideImage, addSlideLine, addSlideShape, addSlideTable, addSlideTextBox, addTitleSlide, appendShapeText, appendSlideNotes, bringShapeForward, bringShapeToFront, centerShapeOnSlide, clearAllHyperlinks, clearAllSlideComments, clearAllSlideNotes, clearShapeEffects, clearShapeFill, clearShapeStroke, clearSlideAnimations, clearSlideBackground, clearSlideComments, clearSlideHyperlinks, clearSlideShapes, clearSlideTransition, clearTableCellFill, cm, compactPackage, copyShape, createPresentation, duplicateSlide, duplicateSlideAt, emu, findChartByKind, findChartsBySeriesName, findChartsWithDataLabels, findChartsWithTrendlines, findCommentAuthorByName, findCommentsAfter, findCommentsBefore, findCommentsByAuthor, findCommentsByText, findEmptyPlaceholders, findFlippedShapes, findLayoutsWithPlaceholderType, findOverlappingShapePairs, findShapeById, findShapeByName, findShapeByText, findShapeInPresentation, findShapesAtPoint, findShapesByEffect, findShapesByHyperlink, findShapesByKind, findShapesByName, findShapesByPreset, findShapesByText, findShapesInRect, findShapesOutsideCanvas, findShapesWithAnimation, findShapesWithHyperlinks, findSlideByPartName, findSlideByText, findSlideByTitle, findSlideLayout, findSlideLayoutByPartName, findSlideLayoutByType, findSlidePlaceholder, findSlidePlaceholderByIdx, findSlidePlaceholders, findSlidesByHyperlink, findSlidesByLayoutName, findSlidesByLayoutPartName, findSlidesByLayoutType, findSlidesByNotes, findSlidesByText, findSlidesWithChartKind, findSlidesWithChartTrendlines, findSlidesWithCommentsByAuthor, getAllCharts, getAllComments, getAllHyperlinks, getAllImages, getAllNotes, getAllShapes, getAllTables, getCommentAuthor, getCommentAuthors, getCommentDate, getCommentPosition, getCommentSlide, getCommentText, getCommentsSortedByDate, getCoreProperties, getDistinctHyperlinkUrls, getEmptySlides, getExtendedProperties, getGroupChildren, getGroupTransform, getHiddenSlides, getMaxShapeId, getMaxShapeIdInPresentation, getMediaParts, getOrphanMediaPartNames, getOutlineText, getPackageSize, getParagraphAlignment, getParagraphBullet, getParagraphBulletImageBytes, getParagraphBulletStyle, getParagraphIndent, getParagraphLevel, getParagraphLineSpacing, getParagraphPropertiesEffective, getParagraphSpacing, getPresentationChartCountsBySlide, getPresentationChartKindCounts, getPresentationCommentCountsByAuthor, getPresentationCommentCountsBySlide, getPresentationCommenters, getPresentationCreated, getPresentationFonts, getPresentationHyperlinkCountsBySlide, getPresentationImageCountsBySlide, getPresentationModified, getPresentationNotesLength, getPresentationNotesLengthsBySlide, getPresentationNotesText, getPresentationShapeCountsBySlide, getPresentationSummary, getPresentationTableCountsBySlide, getPresentationText, getPresentationTextLength, getPresentationTextLengthsBySlide, getPresentationTheme, getShapeAdjustValues, getShapeAltTitle, getShapeAnimation, getShapeAt, getShapeBodyPrEffective, getShapeBounds, getShapeBoundsResolved, getShapeCenter, getShapeChartCategories, getShapeChartKind, getShapeChartSeriesNames, getShapeChartSeriesValues, getShapeChartSpec, getShapeClickAction, getShapeCustomGeometry, getShapeDescription, getShapeEffect, getShapeEffects, getShapeEffectsEffective, getShapeFill, getShapeFillColor, getShapeFillColorResolved, getShapeFillEffective, getShapeFlip, getShapeGradientFill, getShapeGradientFillEffective, getShapeHyperlink, getShapeHyperlinkTooltip, getShapeId, getShapeImageBiLevelThreshold, getShapeImageBrightness, getShapeImageBytes, getShapeImageContrast, getShapeImageCrop, getShapeImageDuotone, getShapeImageFillBytes, getShapeImageFormat, getShapeImageLinkUrl, getShapeImageOpacity, getShapeImagePartName, getShapeIndex, getShapeKind, getShapeName, getShapeParagraphCount, getShapeParagraphElements, getShapePatternFill, getShapePlaceholderIdx, getShapePlaceholderType, getShapePosition, getShapePreset, getShapeRotation, getShapeRunClickAction, getShapeRunCount, getShapeRunFormat, getShapeRunFormatEffective, getShapeRunHyperlink, getShapeRunHyperlinkTooltip, getShapeRunText, getShapeSize, getShapeSlide, getShapeStroke, getShapeStrokeArrow, getShapeStrokeCap, getShapeStrokeColor, getShapeStrokeColorResolved, getShapeStrokeCompound, getShapeStrokeDash, getShapeStrokeEffective, getShapeStrokeJoin, getShapeStrokeWidth, getShapeText, getShapeTextAnchor, getShapeTextAutoFit, getShapeTextAutoFitParams, getShapeTextBodyRotationDeg, getShapeTextColumns, getShapeTextDirection, getShapeTextMargins, getShapeTextWrap, getShapeXmlString, getShapeZIndex, getShapesBounds, getSlideAt, getSlideBackground, getSlideBackgroundGradientFill, getSlideBackgroundImageBytes, getSlideBackgroundPatternFill, getSlideBody, getSlideCharts, getSlideColorMapOverride, getSlideCommentAuthors, getSlideComments, getSlideCount, getSlideIndex, getSlideInfo, getSlideLayout, getSlideLayoutBackground, getSlideLayoutBackgroundGradientFill, getSlideLayoutBackgroundImageBytes, getSlideLayoutBackgroundPatternFill, getSlideLayoutBackgroundShapes, getSlideLayoutCount, getSlideLayoutName, getSlideLayoutPartName, getSlideLayoutPlaceholders, getSlideLayoutShapes, getSlideLayoutType, getSlideLayoutUsageCounts, getSlideLayoutUsageCountsByType, getSlideLayouts, getSlideMasterBackground, getSlideMasterBackgroundGradientFill, getSlideMasterBackgroundImageBytes, getSlideMasterBackgroundPatternFill, getSlideMasterCount, getSlideMasterPartName, getSlideMasterPartNames, getSlideMasterShapes, getSlideMasterUsageCounts, getSlideMediaPartNames, getSlideNotes, getSlideNotesLength, getSlideOutline, getSlidePartName, getSlideSections, getSlideShapes, getSlideSize, getSlideTables, getSlideText, getSlideTextLength, getSlideTitle, getSlideTransition, getSlideXmlString, getSlides, getSlidesByLayout, getSlidesWithCharts, getSlidesWithComments, getSlidesWithEmptyPlaceholders, getSlidesWithHyperlinks, getSlidesWithImages, getSlidesWithNotes, getSlidesWithOverlap, getSlidesWithTables, getTableCell, getTableCellAlignment, getTableCellAnchor, getTableCellBorders, getTableCellFill, getTableCellMargins, getTableCellParagraphs, getTableCellPosition, getTableCellSpan, getTableCellText, getTableCellTextDirection, getTableCells, getTableColumnWidths, getTableDimensions, getTableRowHeights, getTableSize, getTableStyleFlags, getTableStyleId, getThumbnail, getUnusedSlideLayouts, getUnusedSlideMasters, getVisibleSlides, hasShapeImage, hasShapeText, hasSlideNotes, importSlide, inches, incrementRevision, insertTableColumn, insertTableRow, isChartShape, isParagraphBulletPicture, isShapeHidden, isShapeImageGrayscale, isShapePlaceholder, isShapeTextBox, isSlideHidden, isTableShape, listPackageParts, loadPresentation, mergePresentations, mm, moveSlide, pointInShape, pt, readPackagePart, removeShape, removeSlide, removeSlideComment, removeSlideNotes, removeTableColumn, removeTableRow, removeThumbnail, renameShape, replaceHyperlink, replaceTextInNotes, replaceTextInPresentation, replaceTextInSlide, replaceTextInSlideNotes, replaceTokensInPresentation, replaceTokensInSlide, resolveDrawingColor, reverseSlides, savePresentation, searchSlides, sendShapeBackward, sendShapeToBack, setChartSpec, setCoreProperties, setExtendedProperties, setMediaPartBytes, setParagraphAlignment, setParagraphBullet, setParagraphLevel, setParagraphSpacing, setShapeAlignment, setShapeAltTitle, setShapeAnimation, setShapeBounds, setShapeBullets, setShapeClickAction, setShapeDescription, setShapeFill, setShapeFlip, setShapeGlow, setShapeGradientFill, setShapeHidden, setShapeHyperlink, setShapeImage, setShapeImageBrightness, setShapeImageContrast, setShapeImageCrop, setShapeImageFill, setShapeImageOpacity, setShapeNoFill, setShapeNoStroke, setShapePatternFill, setShapePosition, setShapeRotation, setShapeRunFormat, setShapeRunHyperlink, setShapeRunText, setShapeShadow, setShapeSize, setShapeStroke, setShapeStrokeArrow, setShapeStrokeCap, setShapeStrokeCompound, setShapeStrokeDash, setShapeStrokeJoin, setShapeText, setShapeTextAnchor, setShapeTextAutoFit, setShapeTextBodyRotationDeg, setShapeTextColumns, setShapeTextDirection, setShapeTextFormat, setShapeTextMargins, setShapeTextWrap, setShapeZIndex, setSlideBackground, setSlideBackgroundImage, setSlideBody, setSlideHidden, setSlideLayout, setSlideNotes, setSlidePlaceholders, setSlideSections, setSlideSize, setSlideTitle, setSlideTransition, setTableCellAlignment, setTableCellAnchor, setTableCellBorders, setTableCellFill, setTableCellMargins, setTableCellText, setTableCellTextDirection, setTableCellTextFormat, setTableColumnWidth, setTableRowHeight, setTableStyleFlags, setTableStyleId, setThumbnail, shapesOverlap, slideHasAnimations, slidesUsingMediaPart, sortSlides, swapSlides, touchModified, translateShapes, validatePresentation };
5177
+ export { type AllShapesEntry, type AnimationEffect, type AnimationOptions, type ArrowOptions, type BulletStyle, type ChartAxisScaling, type ChartDataLabelPosition, type ChartDataLabels, type ChartGrouping, type ChartKind, type ChartSeries, type ChartSpec, type ChartTextStyle, type ChartTrendline, type CommentAuthor, type CommentPosition, type CoreProperties, type CustomGeometry, type Emu, type ExtendedProperties, type GeomCommand, type GeomPath, type GeomPoint, type GlowOptions, type GradientFillOptions, type GradientStop, type ImageCrop, type ImageFit, type ImageFormat, type IssueSeverity, type LineDash, type LineEndSize, type LineEndType, type MediaPart, type PackagePartInfo, type ParagraphAlignment, type ParagraphProperties, type PathFillMode, type PatternFillOptions, type PatternPreset, type PresentationChartEntry, type PresentationCommentEntry, type PresentationData, type PresentationFonts, type PresentationHyperlinkEntry, type PresentationImageEntry, type PresentationInput, type PresentationNotesEntry, type PresentationSize, type PresentationSummary, type PresentationTableEntry, type PresentationTheme, type PresentationThumbnail, type PresetShape, SLIDE_SIZE_16_10, SLIDE_SIZE_16_9, SLIDE_SIZE_4_3, type ShadowOptions, type ShapeBounds, type ShapeClickAction, type ShapeEffect, type ShapeEffectAny, type ShapeFill, type ShapeParagraphElement, type ShapeStroke, type SlideBackground, type SlideChartData, type SlideComment, type SlideCommentData, type SlideData, type SlideInfo, type SlideLayoutBackgroundShape, type SlideLayoutData, type SlideLayoutPlaceholder, type SlideOutlineEntry, type SlideSection, type SlideShapeData, type SlideSize, type TableCellBorder, type TableCellBorders, type TableCellData, type TableCellParagraph, type TextAnchor, type TextAutoFit, type TextFormat, type TextWrap, type TransitionEffect, type TransitionOptions, VERSION, type ValidationIssue, _internalPackageOf, addBlankSlide, addContentSlide, addSectionHeaderSlide, addSlide, addSlideAt, addSlideChart, addSlideComment, addSlideImage, addSlideLine, addSlideShape, addSlideTable, addSlideTextBox, addTitleSlide, appendShapeText, appendSlideNotes, bringShapeForward, bringShapeToFront, centerShapeOnSlide, clearAllHyperlinks, clearAllSlideComments, clearAllSlideNotes, clearShapeEffects, clearShapeFill, clearShapeStroke, clearSlideAnimations, clearSlideBackground, clearSlideComments, clearSlideHyperlinks, clearSlideShapes, clearSlideTransition, clearTableCellFill, cm, compactPackage, copyShape, createPresentation, duplicateSlide, duplicateSlideAt, emu, findChartByKind, findChartsBySeriesName, findChartsWithDataLabels, findChartsWithTrendlines, findCommentAuthorByName, findCommentsAfter, findCommentsBefore, findCommentsByAuthor, findCommentsByText, findEmptyPlaceholders, findFlippedShapes, findLayoutsWithPlaceholderType, findOverlappingShapePairs, findShapeById, findShapeByName, findShapeByText, findShapeInPresentation, findShapesAtPoint, findShapesByEffect, findShapesByHyperlink, findShapesByKind, findShapesByName, findShapesByPreset, findShapesByText, findShapesInRect, findShapesOutsideCanvas, findShapesWithAnimation, findShapesWithHyperlinks, findSlideByPartName, findSlideByText, findSlideByTitle, findSlideLayout, findSlideLayoutByPartName, findSlideLayoutByType, findSlidePlaceholder, findSlidePlaceholderByIdx, findSlidePlaceholders, findSlidesByHyperlink, findSlidesByLayoutName, findSlidesByLayoutPartName, findSlidesByLayoutType, findSlidesByNotes, findSlidesByText, findSlidesWithChartKind, findSlidesWithChartTrendlines, findSlidesWithCommentsByAuthor, getAllCharts, getAllComments, getAllHyperlinks, getAllImages, getAllNotes, getAllShapes, getAllTables, getCommentAuthor, getCommentAuthors, getCommentDate, getCommentPosition, getCommentSlide, getCommentText, getCommentsSortedByDate, getCoreProperties, getDistinctHyperlinkUrls, getEmptySlides, getExtendedProperties, getGroupChildren, getGroupTransform, getHiddenSlides, getMaxShapeId, getMaxShapeIdInPresentation, getMediaParts, getOrphanMediaPartNames, getOutlineText, getPackageSize, getParagraphAlignment, getParagraphBullet, getParagraphBulletImageBytes, getParagraphBulletStyle, getParagraphIndent, getParagraphLevel, getParagraphLineSpacing, getParagraphPropertiesEffective, getParagraphSpacing, getPresentationChartCountsBySlide, getPresentationChartKindCounts, getPresentationCommentCountsByAuthor, getPresentationCommentCountsBySlide, getPresentationCommenters, getPresentationCreated, getPresentationFonts, getPresentationHyperlinkCountsBySlide, getPresentationImageCountsBySlide, getPresentationModified, getPresentationNotesLength, getPresentationNotesLengthsBySlide, getPresentationNotesText, getPresentationShapeCountsBySlide, getPresentationSummary, getPresentationTableCountsBySlide, getPresentationText, getPresentationTextLength, getPresentationTextLengthsBySlide, getPresentationTheme, getShapeAdjustValues, getShapeAltTitle, getShapeAnimation, getShapeAt, getShapeBodyPrEffective, getShapeBounds, getShapeBoundsResolved, getShapeCenter, getShapeChartCategories, getShapeChartKind, getShapeChartSeriesNames, getShapeChartSeriesValues, getShapeChartSpec, getShapeClickAction, getShapeCustomGeometry, getShapeDescription, getShapeEffect, getShapeEffects, getShapeEffectsEffective, getShapeFill, getShapeFillColor, getShapeFillColorResolved, getShapeFillEffective, getShapeFlip, getShapeGradientFill, getShapeGradientFillEffective, getShapeHyperlink, getShapeHyperlinkTooltip, getShapeId, getShapeImageBiLevelThreshold, getShapeImageBrightness, getShapeImageBytes, getShapeImageContrast, getShapeImageCrop, getShapeImageDuotone, getShapeImageFillBytes, getShapeImageFormat, getShapeImageLinkUrl, getShapeImageOpacity, getShapeImagePartName, getShapeIndex, getShapeKind, getShapeName, getShapeParagraphCount, getShapeParagraphElements, getShapePatternFill, getShapePlaceholderIdx, getShapePlaceholderType, getShapePosition, getShapePreset, getShapeRotation, getShapeRunClickAction, getShapeRunCount, getShapeRunFormat, getShapeRunFormatEffective, getShapeRunHyperlink, getShapeRunHyperlinkTooltip, getShapeRunText, getShapeSize, getShapeSlide, getShapeStroke, getShapeStrokeArrow, getShapeStrokeCap, getShapeStrokeColor, getShapeStrokeColorResolved, getShapeStrokeCompound, getShapeStrokeDash, getShapeStrokeEffective, getShapeStrokeJoin, getShapeStrokeWidth, getShapeText, getShapeTextAnchor, getShapeTextAutoFit, getShapeTextAutoFitParams, getShapeTextBodyRotationDeg, getShapeTextColumns, getShapeTextDirection, getShapeTextMargins, getShapeTextWrap, getShapeXmlString, getShapeZIndex, getShapesBounds, getSlideAt, getSlideBackground, getSlideBackgroundGradientFill, getSlideBackgroundImageBytes, getSlideBackgroundPatternFill, getSlideBody, getSlideCharts, getSlideColorMapOverride, getSlideCommentAuthors, getSlideComments, getSlideCount, getSlideIndex, getSlideInfo, getSlideLayout, getSlideLayoutBackground, getSlideLayoutBackgroundGradientFill, getSlideLayoutBackgroundImageBytes, getSlideLayoutBackgroundPatternFill, getSlideLayoutBackgroundShapes, getSlideLayoutCount, getSlideLayoutName, getSlideLayoutPartName, getSlideLayoutPlaceholders, getSlideLayoutShapes, getSlideLayoutType, getSlideLayoutUsageCounts, getSlideLayoutUsageCountsByType, getSlideLayouts, getSlideMasterBackground, getSlideMasterBackgroundGradientFill, getSlideMasterBackgroundImageBytes, getSlideMasterBackgroundPatternFill, getSlideMasterCount, getSlideMasterPartName, getSlideMasterPartNames, getSlideMasterShapes, getSlideMasterUsageCounts, getSlideMediaPartNames, getSlideNotes, getSlideNotesLength, getSlideOutline, getSlidePartName, getSlideSections, getSlideShapes, getSlideSize, getSlideTables, getSlideText, getSlideTextLength, getSlideTitle, getSlideTransition, getSlideXmlString, getSlides, getSlidesByLayout, getSlidesWithCharts, getSlidesWithComments, getSlidesWithEmptyPlaceholders, getSlidesWithHyperlinks, getSlidesWithImages, getSlidesWithNotes, getSlidesWithOverlap, getSlidesWithTables, getTableCell, getTableCellAlignment, getTableCellAnchor, getTableCellBorders, getTableCellFill, getTableCellMargins, getTableCellParagraphs, getTableCellPosition, getTableCellSpan, getTableCellText, getTableCellTextDirection, getTableCells, getTableColumnWidths, getTableDimensions, getTableRowHeights, getTableSize, getTableStyleFlags, getTableStyleId, getThumbnail, getUnusedSlideLayouts, getUnusedSlideMasters, getVisibleSlides, hasShapeImage, hasShapeText, hasSlideNotes, importSlide, inches, incrementRevision, insertTableColumn, insertTableRow, isChartShape, isParagraphBulletPicture, isShapeHidden, isShapeImageGrayscale, isShapePlaceholder, isShapeTextBox, isSlideHidden, isTableShape, listPackageParts, loadPresentation, mergePresentations, mergeTableCells, mm, moveSlide, pointInShape, pt, readPackagePart, removeShape, removeSlide, removeSlideComment, removeSlideNotes, removeTableColumn, removeTableRow, removeThumbnail, renameShape, replaceHyperlink, replaceTextInNotes, replaceTextInPresentation, replaceTextInSlide, replaceTextInSlideNotes, replaceTokensInPresentation, replaceTokensInSlide, resolveDrawingColor, reverseSlides, savePresentation, searchSlides, sendShapeBackward, sendShapeToBack, setChartSpec, setCoreProperties, setExtendedProperties, setMediaPartBytes, setParagraphAlignment, setParagraphBullet, setParagraphLevel, setParagraphSpacing, setShapeAlignment, setShapeAltTitle, setShapeAnimation, setShapeBounds, setShapeBullets, setShapeClickAction, setShapeDescription, setShapeFill, setShapeFlip, setShapeGlow, setShapeGradientFill, setShapeHidden, setShapeHyperlink, setShapeImage, setShapeImageBrightness, setShapeImageContrast, setShapeImageCrop, setShapeImageFill, setShapeImageOpacity, setShapeNoFill, setShapeNoStroke, setShapePatternFill, setShapePosition, setShapeRotation, setShapeRunFormat, setShapeRunHyperlink, setShapeRunText, setShapeShadow, setShapeSize, setShapeStroke, setShapeStrokeArrow, setShapeStrokeCap, setShapeStrokeCompound, setShapeStrokeDash, setShapeStrokeJoin, setShapeText, setShapeTextAnchor, setShapeTextAutoFit, setShapeTextBodyRotationDeg, setShapeTextColumns, setShapeTextDirection, setShapeTextFormat, setShapeTextMargins, setShapeTextWrap, setShapeZIndex, setSlideBackground, setSlideBackgroundImage, setSlideBody, setSlideHidden, setSlideLayout, setSlideNotes, setSlidePlaceholders, setSlideSections, setSlideSize, setSlideTitle, setSlideTransition, setTableCellAlignment, setTableCellAnchor, setTableCellBorders, setTableCellFill, setTableCellMargins, setTableCellText, setTableCellTextDirection, setTableCellTextFormat, setTableColumnWidth, setTableRowHeight, setTableStyleFlags, setTableStyleId, setThumbnail, shapesOverlap, slideHasAnimations, slidesUsingMediaPart, sortSlides, swapSlides, touchModified, translateShapes, validatePresentation };
package/dist/index.js CHANGED
@@ -850,6 +850,50 @@ var detectImageFormat = (bytes) => {
850
850
  if (/<svg[\s>]/.test(head)) return "svg";
851
851
  return null;
852
852
  };
853
+ var readUint16Be = (bytes, at) => bytes[at] << 8 | bytes[at + 1];
854
+ var readUint32Be = (bytes, at) => (
855
+ // `>>> 0` keeps the result an unsigned 32-bit int (a 4-byte PNG dimension
856
+ // with the high bit set would otherwise read as negative).
857
+ (bytes[at] << 24 | bytes[at + 1] << 16 | bytes[at + 2] << 8 | bytes[at + 3]) >>> 0
858
+ );
859
+ var pngSize = (bytes) => {
860
+ if (bytes.length < 24) return null;
861
+ const width = readUint32Be(bytes, 16);
862
+ const height = readUint32Be(bytes, 20);
863
+ if (width <= 0 || height <= 0) return null;
864
+ return { width, height };
865
+ };
866
+ var JPEG_SOF_EXCLUDED = /* @__PURE__ */ new Set([196, 200, 204]);
867
+ var jpegSize = (bytes) => {
868
+ let offset = 2;
869
+ while (offset + 9 < bytes.length) {
870
+ if (bytes[offset] !== 255) {
871
+ offset++;
872
+ continue;
873
+ }
874
+ const marker = bytes[offset + 1];
875
+ if (marker === 255 || marker >= 208 && marker <= 217 || marker === 1) {
876
+ offset += 2;
877
+ continue;
878
+ }
879
+ const segmentLength = readUint16Be(bytes, offset + 2);
880
+ if (segmentLength < 2) return null;
881
+ if (marker >= 192 && marker <= 207 && !JPEG_SOF_EXCLUDED.has(marker)) {
882
+ const height = readUint16Be(bytes, offset + 5);
883
+ const width = readUint16Be(bytes, offset + 7);
884
+ if (width <= 0 || height <= 0) return null;
885
+ return { width, height };
886
+ }
887
+ offset += 2 + segmentLength;
888
+ }
889
+ return null;
890
+ };
891
+ var readImagePixelSize = (bytes) => {
892
+ const format = detectImageFormat(bytes);
893
+ if (format === "png") return pngSize(bytes);
894
+ if (format === "jpeg") return jpegSize(bytes);
895
+ return null;
896
+ };
853
897
  var extensionForFormat = (format) => {
854
898
  switch (format) {
855
899
  case "jpeg":
@@ -3972,6 +4016,15 @@ var getCommentPosition = (comment2) => comment2[COMMENT_SNAPSHOT].position;
3972
4016
  var getCommentSlide = (comment2) => comment2[COMMENT_SLIDE];
3973
4017
 
3974
4018
  // src/api/fn/shape-image.ts
4019
+ var fitImageRect = (box, fit, naturalSize) => {
4020
+ if (fit === "fill" || naturalSize === null) return box;
4021
+ const scale = Math.min(box.w / naturalSize.width, box.h / naturalSize.height);
4022
+ const w = Math.round(naturalSize.width * scale);
4023
+ const h = Math.round(naturalSize.height * scale);
4024
+ const x = box.x + Math.round((box.w - w) / 2);
4025
+ const y = box.y + Math.round((box.h - h) / 2);
4026
+ return { x, y, w, h };
4027
+ };
3975
4028
  var setShapeImage = (shape, bytes, options = {}) => {
3976
4029
  if (shape[SHAPE_SNAPSHOT].kind !== "picture") {
3977
4030
  throw new Error(
@@ -4004,27 +4057,43 @@ var setShapeImage = (shape, bytes, options = {}) => {
4004
4057
  if (!part) throw new Error(`media part missing: ${mediaName}`);
4005
4058
  part.data = bytes;
4006
4059
  part.contentType = newContentType;
4007
- return;
4008
- }
4009
- let nextN = 1;
4010
- const mediaPathRegex = /^\/ppt\/media\/image(\d+)\./;
4011
- for (const p of pkg.parts) {
4012
- const m = p.name.match(mediaPathRegex);
4013
- if (m?.[1] !== void 0) {
4014
- const num = Number.parseInt(m[1], 10);
4015
- if (Number.isFinite(num) && num >= nextN) nextN = num + 1;
4060
+ } else {
4061
+ let nextN = 1;
4062
+ const mediaPathRegex = /^\/ppt\/media\/image(\d+)\./;
4063
+ for (const p of pkg.parts) {
4064
+ const m = p.name.match(mediaPathRegex);
4065
+ if (m?.[1] !== void 0) {
4066
+ const num = Number.parseInt(m[1], 10);
4067
+ if (Number.isFinite(num) && num >= nextN) nextN = num + 1;
4068
+ }
4069
+ }
4070
+ const newPartName = partName(`/ppt/media/image${nextN}.${newExtension}`);
4071
+ const hasDefault = pkg.contentTypes.defaults.some(
4072
+ (d) => d.extension.toLowerCase() === newExtension
4073
+ );
4074
+ if (!hasDefault) {
4075
+ pkg.contentTypes.defaults.push({ extension: newExtension, contentType: newContentType });
4076
+ }
4077
+ pkg.addPart(newPartName, newContentType, bytes);
4078
+ rel.target = `../media/image${nextN}.${newExtension}`;
4079
+ pkg.setRels(slide[SLIDE_PART_NAME], rels);
4080
+ }
4081
+ if (options.fit === "contain") {
4082
+ const pos = readPosition(shape[SHAPE_ELEMENT], "picture");
4083
+ const size = readSize2(shape[SHAPE_ELEMENT], "picture");
4084
+ const natural = readImagePixelSize(bytes);
4085
+ if (pos !== null && size !== null && natural !== null) {
4086
+ const fitted = fitImageRect(
4087
+ { x: pos.x, y: pos.y, w: size.w, h: size.h },
4088
+ "contain",
4089
+ natural
4090
+ );
4091
+ setPosition(shape[SHAPE_ELEMENT], "picture", fitted.x, fitted.y);
4092
+ setSize(shape[SHAPE_ELEMENT], "picture", fitted.w, fitted.h);
4093
+ commitSlideData(slide);
4094
+ refreshSlideData(slide);
4016
4095
  }
4017
4096
  }
4018
- const newPartName = partName(`/ppt/media/image${nextN}.${newExtension}`);
4019
- const hasDefault = pkg.contentTypes.defaults.some(
4020
- (d) => d.extension.toLowerCase() === newExtension
4021
- );
4022
- if (!hasDefault) {
4023
- pkg.contentTypes.defaults.push({ extension: newExtension, contentType: newContentType });
4024
- }
4025
- pkg.addPart(newPartName, newContentType, bytes);
4026
- rel.target = `../media/image${nextN}.${newExtension}`;
4027
- pkg.setRels(slide[SLIDE_PART_NAME], rels);
4028
4097
  };
4029
4098
 
4030
4099
  // src/api/fn/shape-click-action.ts
@@ -4666,6 +4735,11 @@ var rPrAttrsFromStyle = (style) => {
4666
4735
  })
4667
4736
  );
4668
4737
  }
4738
+ if (style?.font !== void 0) {
4739
+ const typeface = attr(qname("", "typeface", ""), style.font);
4740
+ children.push(elem(a("latin"), { attrs: [typeface] }));
4741
+ children.push(elem(a("ea"), { attrs: [typeface] }));
4742
+ }
4669
4743
  return { attrs, children };
4670
4744
  };
4671
4745
  var titleElement = (title, style, rotationDeg) => {
@@ -5148,7 +5222,10 @@ var NAME_A_RPR = qname("a", "rPr", NS_A2);
5148
5222
  var NAME_A_DEF_RPR = qname("a", "defRPr", NS_A2);
5149
5223
  var NAME_A_PPR = qname("a", "pPr", NS_A2);
5150
5224
  var NAME_A_SRGB = qname("a", "srgbClr", NS_A2);
5225
+ var NAME_A_LATIN = qname("a", "latin", NS_A2);
5226
+ var ATTR_TYPEFACE2 = qname("", "typeface", "");
5151
5227
  var readRunStyle = (rPr) => {
5228
+ let font;
5152
5229
  let sizePt;
5153
5230
  let bold;
5154
5231
  let italic;
@@ -5170,10 +5247,16 @@ var readRunStyle = (rPr) => {
5170
5247
  if (v !== null) color = `#${v.toUpperCase()}`;
5171
5248
  }
5172
5249
  }
5173
- if (sizePt === void 0 && bold === void 0 && italic === void 0 && color === void 0) {
5250
+ const latin = firstChildElement(rPr, NAME_A_LATIN);
5251
+ if (latin) {
5252
+ const tf = getAttrValue(latin, ATTR_TYPEFACE2);
5253
+ if (tf !== null && tf !== "") font = tf;
5254
+ }
5255
+ if (font === void 0 && sizePt === void 0 && bold === void 0 && italic === void 0 && color === void 0) {
5174
5256
  return void 0;
5175
5257
  }
5176
5258
  return {
5259
+ ...font !== void 0 ? { font } : {},
5177
5260
  ...sizePt !== void 0 ? { sizePt } : {},
5178
5261
  ...bold !== void 0 ? { bold } : {},
5179
5262
  ...italic !== void 0 ? { italic } : {},
@@ -7309,6 +7392,78 @@ var getTableCellSpan = (cell) => {
7309
7392
  vMerge: vm === "1" || vm === "true"
7310
7393
  };
7311
7394
  };
7395
+ var ATTR_GRID_SPAN = qname("", "gridSpan", "");
7396
+ var ATTR_ROW_SPAN = qname("", "rowSpan", "");
7397
+ var ATTR_H_MERGE = qname("", "hMerge", "");
7398
+ var ATTR_V_MERGE = qname("", "vMerge", "");
7399
+ var setSpanAttr = (tc, name, value) => {
7400
+ tc.attrs = tc.attrs.filter(
7401
+ (a2) => !(a2.name.namespaceURI === "" && a2.name.localName === name.localName)
7402
+ );
7403
+ tc.attrs.push(attr(name, value));
7404
+ };
7405
+ var cellIsMergedAlready = (tc) => {
7406
+ const gs = getAttrValue(tc, ATTR_GRID_SPAN);
7407
+ const rs = getAttrValue(tc, ATTR_ROW_SPAN);
7408
+ const hm = getAttrValue(tc, ATTR_H_MERGE);
7409
+ const vm = getAttrValue(tc, ATTR_V_MERGE);
7410
+ return gs !== null && Number.parseInt(gs, 10) > 1 || rs !== null && Number.parseInt(rs, 10) > 1 || hm === "1" || hm === "true" || vm === "1" || vm === "true";
7411
+ };
7412
+ var mergeTableCells = (table, block) => {
7413
+ const { row, col, rowSpan, colSpan } = block;
7414
+ if (!Number.isInteger(rowSpan) || !Number.isInteger(colSpan) || rowSpan < 1 || colSpan < 1) {
7415
+ throw new RangeError(
7416
+ `mergeTableCells: rowSpan / colSpan must be integers \u2265 1 (got ${rowSpan} \xD7 ${colSpan})`
7417
+ );
7418
+ }
7419
+ if (rowSpan === 1 && colSpan === 1) {
7420
+ throw new RangeError("mergeTableCells: a 1\xD71 block is not a merge");
7421
+ }
7422
+ if (!Number.isInteger(row) || !Number.isInteger(col) || row < 0 || col < 0) {
7423
+ throw new RangeError(
7424
+ `mergeTableCells: row / col must be non-negative integers (got ${row}, ${col})`
7425
+ );
7426
+ }
7427
+ const cells = getTableCells(table);
7428
+ const lastRow = row + rowSpan - 1;
7429
+ const lastCol = col + colSpan - 1;
7430
+ if (lastRow >= cells.length) {
7431
+ throw new RangeError(
7432
+ `mergeTableCells: block rows ${row}..${lastRow} exceed table height ${cells.length}`
7433
+ );
7434
+ }
7435
+ for (let r2 = row; r2 <= lastRow; r2++) {
7436
+ const rowCellsArr = cells[r2];
7437
+ if (lastCol >= rowCellsArr.length) {
7438
+ throw new RangeError(
7439
+ `mergeTableCells: block cols ${col}..${lastCol} exceed row ${r2} width ${rowCellsArr.length}`
7440
+ );
7441
+ }
7442
+ }
7443
+ for (let r2 = row; r2 <= lastRow; r2++) {
7444
+ for (let c2 = col; c2 <= lastCol; c2++) {
7445
+ if (cellIsMergedAlready(cells[r2][c2][CELL_ELEMENT])) {
7446
+ throw new Error(
7447
+ `mergeTableCells: cell (${r2}, ${c2}) is already part of a merge; split it before re-merging`
7448
+ );
7449
+ }
7450
+ }
7451
+ }
7452
+ for (let r2 = row; r2 <= lastRow; r2++) {
7453
+ for (let c2 = col; c2 <= lastCol; c2++) {
7454
+ const tc = cells[r2][c2][CELL_ELEMENT];
7455
+ if (r2 === row && c2 === col) {
7456
+ if (colSpan > 1) setSpanAttr(tc, ATTR_GRID_SPAN, String(colSpan));
7457
+ if (rowSpan > 1) setSpanAttr(tc, ATTR_ROW_SPAN, String(rowSpan));
7458
+ continue;
7459
+ }
7460
+ if (c2 > col) setSpanAttr(tc, ATTR_H_MERGE, "1");
7461
+ if (r2 > row) setSpanAttr(tc, ATTR_V_MERGE, "1");
7462
+ }
7463
+ }
7464
+ commitSlideData(table[SHAPE_SLIDE]);
7465
+ refreshSlideData(table[SHAPE_SLIDE]);
7466
+ };
7312
7467
  var getTableCellBorders = (pres, cell) => {
7313
7468
  const tcPr = firstChildElement(cell[CELL_ELEMENT], NAME_A_TC_PR);
7314
7469
  const theme = getPresentationTheme(pres);
@@ -12513,14 +12668,19 @@ var addSlideImage = (slide, bytes, opts) => {
12513
12668
  targetMode: "Internal"
12514
12669
  });
12515
12670
  pkg.setRels(slide[SLIDE_PART_NAME], rels);
12671
+ const rect = fitImageRect(
12672
+ { x: opts.x, y: opts.y, w: opts.w, h: opts.h },
12673
+ opts.fit ?? "fill",
12674
+ readImagePixelSize(bytes)
12675
+ );
12516
12676
  const pic = buildPicture({
12517
12677
  id: nextShapeId(slide),
12518
12678
  ...opts.name !== void 0 ? { name: opts.name } : {},
12519
12679
  rEmbed: newRId,
12520
- x: opts.x,
12521
- y: opts.y,
12522
- w: opts.w,
12523
- h: opts.h
12680
+ x: rect.x,
12681
+ y: rect.y,
12682
+ w: rect.w,
12683
+ h: rect.h
12524
12684
  });
12525
12685
  return appendAndReturnNewShape(slide, pic);
12526
12686
  };
@@ -13370,8 +13530,8 @@ var mergePresentations = (targetPres, sourcePres, targetLayout) => {
13370
13530
  };
13371
13531
 
13372
13532
  // src/api/index.ts
13373
- var VERSION = "0.3.0" ;
13533
+ var VERSION = "0.4.0" ;
13374
13534
 
13375
- export { SLIDE_SIZE_16_10, SLIDE_SIZE_16_9, SLIDE_SIZE_4_3, VERSION, _internalPackageOf, addBlankSlide, addContentSlide, addSectionHeaderSlide, addSlide, addSlideAt, addSlideChart, addSlideComment, addSlideImage, addSlideLine, addSlideShape, addSlideTable, addSlideTextBox, addTitleSlide, appendShapeText, appendSlideNotes, bringShapeForward, bringShapeToFront, centerShapeOnSlide, clearAllHyperlinks, clearAllSlideComments, clearAllSlideNotes, clearShapeEffects, clearShapeFill, clearShapeStroke, clearSlideAnimations, clearSlideBackground, clearSlideComments, clearSlideHyperlinks, clearSlideShapes, clearSlideTransition, clearTableCellFill, cm, compactPackage, copyShape, createPresentation, duplicateSlide, duplicateSlideAt, emu, findChartByKind, findChartsBySeriesName, findChartsWithDataLabels, findChartsWithTrendlines, findCommentAuthorByName, findCommentsAfter, findCommentsBefore, findCommentsByAuthor, findCommentsByText, findEmptyPlaceholders, findFlippedShapes, findLayoutsWithPlaceholderType, findOverlappingShapePairs, findShapeById, findShapeByName, findShapeByText, findShapeInPresentation, findShapesAtPoint, findShapesByEffect, findShapesByHyperlink, findShapesByKind, findShapesByName, findShapesByPreset, findShapesByText, findShapesInRect, findShapesOutsideCanvas, findShapesWithAnimation, findShapesWithHyperlinks, findSlideByPartName, findSlideByText, findSlideByTitle, findSlideLayout, findSlideLayoutByPartName, findSlideLayoutByType, findSlidePlaceholder, findSlidePlaceholderByIdx, findSlidePlaceholders, findSlidesByHyperlink, findSlidesByLayoutName, findSlidesByLayoutPartName, findSlidesByLayoutType, findSlidesByNotes, findSlidesByText, findSlidesWithChartKind, findSlidesWithChartTrendlines, findSlidesWithCommentsByAuthor, getAllCharts, getAllComments, getAllHyperlinks, getAllImages, getAllNotes, getAllShapes, getAllTables, getCommentAuthor, getCommentAuthors, getCommentDate, getCommentPosition, getCommentSlide, getCommentText, getCommentsSortedByDate, getCoreProperties, getDistinctHyperlinkUrls, getEmptySlides, getExtendedProperties, getGroupChildren, getGroupTransform, getHiddenSlides, getMaxShapeId, getMaxShapeIdInPresentation, getMediaParts, getOrphanMediaPartNames, getOutlineText, getPackageSize, getParagraphAlignment, getParagraphBullet, getParagraphBulletImageBytes, getParagraphBulletStyle, getParagraphIndent, getParagraphLevel, getParagraphLineSpacing, getParagraphPropertiesEffective, getParagraphSpacing, getPresentationChartCountsBySlide, getPresentationChartKindCounts, getPresentationCommentCountsByAuthor, getPresentationCommentCountsBySlide, getPresentationCommenters, getPresentationCreated, getPresentationFonts, getPresentationHyperlinkCountsBySlide, getPresentationImageCountsBySlide, getPresentationModified, getPresentationNotesLength, getPresentationNotesLengthsBySlide, getPresentationNotesText, getPresentationShapeCountsBySlide, getPresentationSummary, getPresentationTableCountsBySlide, getPresentationText, getPresentationTextLength, getPresentationTextLengthsBySlide, getPresentationTheme, getShapeAdjustValues, getShapeAltTitle, getShapeAnimation, getShapeAt, getShapeBodyPrEffective, getShapeBounds, getShapeBoundsResolved, getShapeCenter, getShapeChartCategories, getShapeChartKind, getShapeChartSeriesNames, getShapeChartSeriesValues, getShapeChartSpec, getShapeClickAction, getShapeCustomGeometry, getShapeDescription, getShapeEffect, getShapeEffects, getShapeEffectsEffective, getShapeFill, getShapeFillColor, getShapeFillColorResolved, getShapeFillEffective, getShapeFlip, getShapeGradientFill, getShapeGradientFillEffective, getShapeHyperlink, getShapeHyperlinkTooltip, getShapeId, getShapeImageBiLevelThreshold, getShapeImageBrightness, getShapeImageBytes, getShapeImageContrast, getShapeImageCrop, getShapeImageDuotone, getShapeImageFillBytes, getShapeImageFormat, getShapeImageLinkUrl, getShapeImageOpacity, getShapeImagePartName, getShapeIndex, getShapeKind, getShapeName, getShapeParagraphCount, getShapeParagraphElements, getShapePatternFill, getShapePlaceholderIdx, getShapePlaceholderType, getShapePosition, getShapePreset, getShapeRotation, getShapeRunClickAction, getShapeRunCount, getShapeRunFormat, getShapeRunFormatEffective, getShapeRunHyperlink, getShapeRunHyperlinkTooltip, getShapeRunText, getShapeSize, getShapeSlide, getShapeStroke, getShapeStrokeArrow, getShapeStrokeCap, getShapeStrokeColor, getShapeStrokeColorResolved, getShapeStrokeCompound, getShapeStrokeDash, getShapeStrokeEffective, getShapeStrokeJoin, getShapeStrokeWidth, getShapeText, getShapeTextAnchor, getShapeTextAutoFit, getShapeTextAutoFitParams, getShapeTextBodyRotationDeg, getShapeTextColumns, getShapeTextDirection, getShapeTextMargins, getShapeTextWrap, getShapeXmlString, getShapeZIndex, getShapesBounds, getSlideAt, getSlideBackground, getSlideBackgroundGradientFill, getSlideBackgroundImageBytes, getSlideBackgroundPatternFill, getSlideBody, getSlideCharts, getSlideColorMapOverride, getSlideCommentAuthors, getSlideComments, getSlideCount, getSlideIndex, getSlideInfo, getSlideLayout, getSlideLayoutBackground, getSlideLayoutBackgroundGradientFill, getSlideLayoutBackgroundImageBytes, getSlideLayoutBackgroundPatternFill, getSlideLayoutBackgroundShapes, getSlideLayoutCount, getSlideLayoutName, getSlideLayoutPartName, getSlideLayoutPlaceholders, getSlideLayoutShapes, getSlideLayoutType, getSlideLayoutUsageCounts, getSlideLayoutUsageCountsByType, getSlideLayouts, getSlideMasterBackground, getSlideMasterBackgroundGradientFill, getSlideMasterBackgroundImageBytes, getSlideMasterBackgroundPatternFill, getSlideMasterCount, getSlideMasterPartName, getSlideMasterPartNames, getSlideMasterShapes, getSlideMasterUsageCounts, getSlideMediaPartNames, getSlideNotes, getSlideNotesLength, getSlideOutline, getSlidePartName, getSlideSections, getSlideShapes, getSlideSize, getSlideTables, getSlideText, getSlideTextLength, getSlideTitle, getSlideTransition, getSlideXmlString, getSlides, getSlidesByLayout, getSlidesWithCharts, getSlidesWithComments, getSlidesWithEmptyPlaceholders, getSlidesWithHyperlinks, getSlidesWithImages, getSlidesWithNotes, getSlidesWithOverlap, getSlidesWithTables, getTableCell, getTableCellAlignment, getTableCellAnchor, getTableCellBorders, getTableCellFill, getTableCellMargins, getTableCellParagraphs, getTableCellPosition, getTableCellSpan, getTableCellText, getTableCellTextDirection, getTableCells, getTableColumnWidths, getTableDimensions, getTableRowHeights, getTableSize, getTableStyleFlags, getTableStyleId, getThumbnail, getUnusedSlideLayouts, getUnusedSlideMasters, getVisibleSlides, hasShapeImage, hasShapeText, hasSlideNotes, importSlide, inches, incrementRevision, insertTableColumn, insertTableRow, isChartShape, isParagraphBulletPicture, isShapeHidden, isShapeImageGrayscale, isShapePlaceholder, isShapeTextBox, isSlideHidden, isTableShape, listPackageParts, loadPresentation, mergePresentations, mm, moveSlide, pointInShape, pt, readPackagePart, removeShape, removeSlide, removeSlideComment, removeSlideNotes, removeTableColumn, removeTableRow, removeThumbnail, renameShape, replaceHyperlink, replaceTextInNotes, replaceTextInPresentation, replaceTextInSlide, replaceTextInSlideNotes, replaceTokensInPresentation, replaceTokensInSlide, resolveDrawingColor, reverseSlides, savePresentation, searchSlides, sendShapeBackward, sendShapeToBack, setChartSpec, setCoreProperties, setExtendedProperties, setMediaPartBytes, setParagraphAlignment, setParagraphBullet, setParagraphLevel, setParagraphSpacing, setShapeAlignment, setShapeAltTitle, setShapeAnimation, setShapeBounds, setShapeBullets, setShapeClickAction, setShapeDescription, setShapeFill, setShapeFlip, setShapeGlow, setShapeGradientFill, setShapeHidden, setShapeHyperlink, setShapeImage, setShapeImageBrightness, setShapeImageContrast, setShapeImageCrop, setShapeImageFill, setShapeImageOpacity, setShapeNoFill, setShapeNoStroke, setShapePatternFill, setShapePosition, setShapeRotation, setShapeRunFormat, setShapeRunHyperlink, setShapeRunText, setShapeShadow, setShapeSize, setShapeStroke, setShapeStrokeArrow, setShapeStrokeCap, setShapeStrokeCompound, setShapeStrokeDash, setShapeStrokeJoin, setShapeText, setShapeTextAnchor, setShapeTextAutoFit, setShapeTextBodyRotationDeg, setShapeTextColumns, setShapeTextDirection, setShapeTextFormat, setShapeTextMargins, setShapeTextWrap, setShapeZIndex, setSlideBackground, setSlideBackgroundImage, setSlideBody, setSlideHidden, setSlideLayout, setSlideNotes, setSlidePlaceholders, setSlideSections, setSlideSize, setSlideTitle, setSlideTransition, setTableCellAlignment, setTableCellAnchor, setTableCellBorders, setTableCellFill, setTableCellMargins, setTableCellText, setTableCellTextDirection, setTableCellTextFormat, setTableColumnWidth, setTableRowHeight, setTableStyleFlags, setTableStyleId, setThumbnail, shapesOverlap, slideHasAnimations, slidesUsingMediaPart, sortSlides, swapSlides, touchModified, translateShapes, validatePresentation };
13535
+ export { SLIDE_SIZE_16_10, SLIDE_SIZE_16_9, SLIDE_SIZE_4_3, VERSION, _internalPackageOf, addBlankSlide, addContentSlide, addSectionHeaderSlide, addSlide, addSlideAt, addSlideChart, addSlideComment, addSlideImage, addSlideLine, addSlideShape, addSlideTable, addSlideTextBox, addTitleSlide, appendShapeText, appendSlideNotes, bringShapeForward, bringShapeToFront, centerShapeOnSlide, clearAllHyperlinks, clearAllSlideComments, clearAllSlideNotes, clearShapeEffects, clearShapeFill, clearShapeStroke, clearSlideAnimations, clearSlideBackground, clearSlideComments, clearSlideHyperlinks, clearSlideShapes, clearSlideTransition, clearTableCellFill, cm, compactPackage, copyShape, createPresentation, duplicateSlide, duplicateSlideAt, emu, findChartByKind, findChartsBySeriesName, findChartsWithDataLabels, findChartsWithTrendlines, findCommentAuthorByName, findCommentsAfter, findCommentsBefore, findCommentsByAuthor, findCommentsByText, findEmptyPlaceholders, findFlippedShapes, findLayoutsWithPlaceholderType, findOverlappingShapePairs, findShapeById, findShapeByName, findShapeByText, findShapeInPresentation, findShapesAtPoint, findShapesByEffect, findShapesByHyperlink, findShapesByKind, findShapesByName, findShapesByPreset, findShapesByText, findShapesInRect, findShapesOutsideCanvas, findShapesWithAnimation, findShapesWithHyperlinks, findSlideByPartName, findSlideByText, findSlideByTitle, findSlideLayout, findSlideLayoutByPartName, findSlideLayoutByType, findSlidePlaceholder, findSlidePlaceholderByIdx, findSlidePlaceholders, findSlidesByHyperlink, findSlidesByLayoutName, findSlidesByLayoutPartName, findSlidesByLayoutType, findSlidesByNotes, findSlidesByText, findSlidesWithChartKind, findSlidesWithChartTrendlines, findSlidesWithCommentsByAuthor, getAllCharts, getAllComments, getAllHyperlinks, getAllImages, getAllNotes, getAllShapes, getAllTables, getCommentAuthor, getCommentAuthors, getCommentDate, getCommentPosition, getCommentSlide, getCommentText, getCommentsSortedByDate, getCoreProperties, getDistinctHyperlinkUrls, getEmptySlides, getExtendedProperties, getGroupChildren, getGroupTransform, getHiddenSlides, getMaxShapeId, getMaxShapeIdInPresentation, getMediaParts, getOrphanMediaPartNames, getOutlineText, getPackageSize, getParagraphAlignment, getParagraphBullet, getParagraphBulletImageBytes, getParagraphBulletStyle, getParagraphIndent, getParagraphLevel, getParagraphLineSpacing, getParagraphPropertiesEffective, getParagraphSpacing, getPresentationChartCountsBySlide, getPresentationChartKindCounts, getPresentationCommentCountsByAuthor, getPresentationCommentCountsBySlide, getPresentationCommenters, getPresentationCreated, getPresentationFonts, getPresentationHyperlinkCountsBySlide, getPresentationImageCountsBySlide, getPresentationModified, getPresentationNotesLength, getPresentationNotesLengthsBySlide, getPresentationNotesText, getPresentationShapeCountsBySlide, getPresentationSummary, getPresentationTableCountsBySlide, getPresentationText, getPresentationTextLength, getPresentationTextLengthsBySlide, getPresentationTheme, getShapeAdjustValues, getShapeAltTitle, getShapeAnimation, getShapeAt, getShapeBodyPrEffective, getShapeBounds, getShapeBoundsResolved, getShapeCenter, getShapeChartCategories, getShapeChartKind, getShapeChartSeriesNames, getShapeChartSeriesValues, getShapeChartSpec, getShapeClickAction, getShapeCustomGeometry, getShapeDescription, getShapeEffect, getShapeEffects, getShapeEffectsEffective, getShapeFill, getShapeFillColor, getShapeFillColorResolved, getShapeFillEffective, getShapeFlip, getShapeGradientFill, getShapeGradientFillEffective, getShapeHyperlink, getShapeHyperlinkTooltip, getShapeId, getShapeImageBiLevelThreshold, getShapeImageBrightness, getShapeImageBytes, getShapeImageContrast, getShapeImageCrop, getShapeImageDuotone, getShapeImageFillBytes, getShapeImageFormat, getShapeImageLinkUrl, getShapeImageOpacity, getShapeImagePartName, getShapeIndex, getShapeKind, getShapeName, getShapeParagraphCount, getShapeParagraphElements, getShapePatternFill, getShapePlaceholderIdx, getShapePlaceholderType, getShapePosition, getShapePreset, getShapeRotation, getShapeRunClickAction, getShapeRunCount, getShapeRunFormat, getShapeRunFormatEffective, getShapeRunHyperlink, getShapeRunHyperlinkTooltip, getShapeRunText, getShapeSize, getShapeSlide, getShapeStroke, getShapeStrokeArrow, getShapeStrokeCap, getShapeStrokeColor, getShapeStrokeColorResolved, getShapeStrokeCompound, getShapeStrokeDash, getShapeStrokeEffective, getShapeStrokeJoin, getShapeStrokeWidth, getShapeText, getShapeTextAnchor, getShapeTextAutoFit, getShapeTextAutoFitParams, getShapeTextBodyRotationDeg, getShapeTextColumns, getShapeTextDirection, getShapeTextMargins, getShapeTextWrap, getShapeXmlString, getShapeZIndex, getShapesBounds, getSlideAt, getSlideBackground, getSlideBackgroundGradientFill, getSlideBackgroundImageBytes, getSlideBackgroundPatternFill, getSlideBody, getSlideCharts, getSlideColorMapOverride, getSlideCommentAuthors, getSlideComments, getSlideCount, getSlideIndex, getSlideInfo, getSlideLayout, getSlideLayoutBackground, getSlideLayoutBackgroundGradientFill, getSlideLayoutBackgroundImageBytes, getSlideLayoutBackgroundPatternFill, getSlideLayoutBackgroundShapes, getSlideLayoutCount, getSlideLayoutName, getSlideLayoutPartName, getSlideLayoutPlaceholders, getSlideLayoutShapes, getSlideLayoutType, getSlideLayoutUsageCounts, getSlideLayoutUsageCountsByType, getSlideLayouts, getSlideMasterBackground, getSlideMasterBackgroundGradientFill, getSlideMasterBackgroundImageBytes, getSlideMasterBackgroundPatternFill, getSlideMasterCount, getSlideMasterPartName, getSlideMasterPartNames, getSlideMasterShapes, getSlideMasterUsageCounts, getSlideMediaPartNames, getSlideNotes, getSlideNotesLength, getSlideOutline, getSlidePartName, getSlideSections, getSlideShapes, getSlideSize, getSlideTables, getSlideText, getSlideTextLength, getSlideTitle, getSlideTransition, getSlideXmlString, getSlides, getSlidesByLayout, getSlidesWithCharts, getSlidesWithComments, getSlidesWithEmptyPlaceholders, getSlidesWithHyperlinks, getSlidesWithImages, getSlidesWithNotes, getSlidesWithOverlap, getSlidesWithTables, getTableCell, getTableCellAlignment, getTableCellAnchor, getTableCellBorders, getTableCellFill, getTableCellMargins, getTableCellParagraphs, getTableCellPosition, getTableCellSpan, getTableCellText, getTableCellTextDirection, getTableCells, getTableColumnWidths, getTableDimensions, getTableRowHeights, getTableSize, getTableStyleFlags, getTableStyleId, getThumbnail, getUnusedSlideLayouts, getUnusedSlideMasters, getVisibleSlides, hasShapeImage, hasShapeText, hasSlideNotes, importSlide, inches, incrementRevision, insertTableColumn, insertTableRow, isChartShape, isParagraphBulletPicture, isShapeHidden, isShapeImageGrayscale, isShapePlaceholder, isShapeTextBox, isSlideHidden, isTableShape, listPackageParts, loadPresentation, mergePresentations, mergeTableCells, mm, moveSlide, pointInShape, pt, readPackagePart, removeShape, removeSlide, removeSlideComment, removeSlideNotes, removeTableColumn, removeTableRow, removeThumbnail, renameShape, replaceHyperlink, replaceTextInNotes, replaceTextInPresentation, replaceTextInSlide, replaceTextInSlideNotes, replaceTokensInPresentation, replaceTokensInSlide, resolveDrawingColor, reverseSlides, savePresentation, searchSlides, sendShapeBackward, sendShapeToBack, setChartSpec, setCoreProperties, setExtendedProperties, setMediaPartBytes, setParagraphAlignment, setParagraphBullet, setParagraphLevel, setParagraphSpacing, setShapeAlignment, setShapeAltTitle, setShapeAnimation, setShapeBounds, setShapeBullets, setShapeClickAction, setShapeDescription, setShapeFill, setShapeFlip, setShapeGlow, setShapeGradientFill, setShapeHidden, setShapeHyperlink, setShapeImage, setShapeImageBrightness, setShapeImageContrast, setShapeImageCrop, setShapeImageFill, setShapeImageOpacity, setShapeNoFill, setShapeNoStroke, setShapePatternFill, setShapePosition, setShapeRotation, setShapeRunFormat, setShapeRunHyperlink, setShapeRunText, setShapeShadow, setShapeSize, setShapeStroke, setShapeStrokeArrow, setShapeStrokeCap, setShapeStrokeCompound, setShapeStrokeDash, setShapeStrokeJoin, setShapeText, setShapeTextAnchor, setShapeTextAutoFit, setShapeTextBodyRotationDeg, setShapeTextColumns, setShapeTextDirection, setShapeTextFormat, setShapeTextMargins, setShapeTextWrap, setShapeZIndex, setSlideBackground, setSlideBackgroundImage, setSlideBody, setSlideHidden, setSlideLayout, setSlideNotes, setSlidePlaceholders, setSlideSections, setSlideSize, setSlideTitle, setSlideTransition, setTableCellAlignment, setTableCellAnchor, setTableCellBorders, setTableCellFill, setTableCellMargins, setTableCellText, setTableCellTextDirection, setTableCellTextFormat, setTableColumnWidth, setTableRowHeight, setTableStyleFlags, setTableStyleId, setThumbnail, shapesOverlap, slideHasAnimations, slidesUsingMediaPart, sortSlides, swapSlides, touchModified, translateShapes, validatePresentation };
13376
13536
  //# sourceMappingURL=index.js.map
13377
13537
  //# sourceMappingURL=index.js.map