pptx-kit 0.2.0 → 0.3.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 +39 -0
- package/README.md +70 -34
- package/dist/index.d.ts +27 -4
- package/dist/index.js +151 -48
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +151 -48
- package/dist/node.js.map +1 -1
- package/package.json +1 -1
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PresentationData } from './index.js';
|
|
2
|
-
export { AllShapesEntry, AnimationEffect, AnimationOptions, ArrowOptions, BulletStyle, ChartAxisScaling, ChartDataLabelPosition, ChartDataLabels, ChartGrouping, ChartKind, ChartSeries, ChartSpec, ChartTextStyle, ChartTrendline, CommentAuthor, CommentPosition, CoreProperties, CustomGeometry, Emu, ExtendedProperties, GeomCommand, GeomPath, GeomPoint, GlowOptions, GradientFillOptions, GradientStop, ImageCrop, ImageFormat, IssueSeverity, LineDash, LineEndSize, LineEndType, MediaPart, PackagePartInfo, ParagraphAlignment, ParagraphProperties, PathFillMode, PatternFillOptions, PatternPreset, PresentationChartEntry, PresentationCommentEntry, PresentationFonts, PresentationHyperlinkEntry, PresentationImageEntry, PresentationInput, PresentationNotesEntry, PresentationSummary, PresentationTableEntry, PresentationTheme, PresentationThumbnail, PresetShape, SLIDE_SIZE_16_10, SLIDE_SIZE_16_9, SLIDE_SIZE_4_3, ShadowOptions, ShapeBounds, ShapeClickAction, ShapeEffect, ShapeEffectAny, ShapeFill, ShapeParagraphElement, ShapeStroke, SlideBackground, SlideChartData, SlideComment, SlideCommentData, SlideData, SlideInfo, SlideLayoutBackgroundShape, SlideLayoutData, SlideLayoutPlaceholder, SlideOutlineEntry, SlideSection, SlideShapeData, SlideSize, TableCellBorder, TableCellBorders, TableCellData, TableCellParagraph, TextAnchor, TextAutoFit, TextFormat, TextWrap, TransitionEffect, TransitionOptions, VERSION, 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 } from './index.js';
|
|
2
|
+
export { AllShapesEntry, AnimationEffect, AnimationOptions, ArrowOptions, BulletStyle, ChartAxisScaling, ChartDataLabelPosition, ChartDataLabels, ChartGrouping, ChartKind, ChartSeries, ChartSpec, ChartTextStyle, ChartTrendline, CommentAuthor, CommentPosition, CoreProperties, CustomGeometry, Emu, ExtendedProperties, GeomCommand, GeomPath, GeomPoint, GlowOptions, GradientFillOptions, GradientStop, ImageCrop, ImageFormat, IssueSeverity, LineDash, LineEndSize, LineEndType, MediaPart, PackagePartInfo, ParagraphAlignment, ParagraphProperties, PathFillMode, PatternFillOptions, PatternPreset, PresentationChartEntry, PresentationCommentEntry, PresentationFonts, PresentationHyperlinkEntry, PresentationImageEntry, PresentationInput, PresentationNotesEntry, PresentationSize, PresentationSummary, PresentationTableEntry, PresentationTheme, PresentationThumbnail, PresetShape, SLIDE_SIZE_16_10, SLIDE_SIZE_16_9, SLIDE_SIZE_4_3, ShadowOptions, ShapeBounds, ShapeClickAction, ShapeEffect, ShapeEffectAny, ShapeFill, ShapeParagraphElement, ShapeStroke, SlideBackground, SlideChartData, SlideComment, SlideCommentData, SlideData, SlideInfo, SlideLayoutBackgroundShape, SlideLayoutData, SlideLayoutPlaceholder, SlideOutlineEntry, SlideSection, SlideShapeData, SlideSize, TableCellBorder, TableCellBorders, TableCellData, TableCellParagraph, TextAnchor, TextAutoFit, TextFormat, TextWrap, TransitionEffect, TransitionOptions, VERSION, 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 } from './index.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Reads a `.pptx` from disk and returns a `PresentationData`. Convenience
|
package/dist/node.js
CHANGED
|
@@ -1071,6 +1071,67 @@ var OpcPackage = class _OpcPackage {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
};
|
|
1073
1073
|
|
|
1074
|
+
// src/internal/parts/blank-deck.ts
|
|
1075
|
+
var SLIDE_SIZE = {
|
|
1076
|
+
"16:9": { cx: 12192e3, cy: 6858e3, type: "screen16x9" },
|
|
1077
|
+
"4:3": { cx: 9144e3, cy: 6858e3, type: "screen4x3" }
|
|
1078
|
+
};
|
|
1079
|
+
var RELS_CONTENT_TYPE = "application/vnd.openxmlformats-package.relationships+xml";
|
|
1080
|
+
var PRESENTATION_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";
|
|
1081
|
+
var PRES_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.presProps+xml";
|
|
1082
|
+
var VIEW_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml";
|
|
1083
|
+
var SLIDE_MASTER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml";
|
|
1084
|
+
var SLIDE_LAYOUT_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
|
|
1085
|
+
var THEME_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.theme+xml";
|
|
1086
|
+
var CORE_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-package.core-properties+xml";
|
|
1087
|
+
var EXTENDED_PROPS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
|
1088
|
+
var XML_DECL = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';
|
|
1089
|
+
var RT = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
1090
|
+
var RT_PACKAGE = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
1091
|
+
var THEME_XML = `${XML_DECL}<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="1F497D"/></a:dk2><a:lt2><a:srgbClr val="EEECE1"/></a:lt2><a:accent1><a:srgbClr val="4F81BD"/></a:accent1><a:accent2><a:srgbClr val="C0504D"/></a:accent2><a:accent3><a:srgbClr val="9BBB59"/></a:accent3><a:accent4><a:srgbClr val="8064A2"/></a:accent4><a:accent5><a:srgbClr val="4BACC6"/></a:accent5><a:accent6><a:srgbClr val="F79646"/></a:accent6><a:hlink><a:srgbClr val="0000FF"/></a:hlink><a:folHlink><a:srgbClr val="800080"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="1"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/></a:theme>`;
|
|
1092
|
+
var SLIDE_MASTER_XML = `${XML_DECL}<p:sldMaster xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:bg><p:bgRef idx="1001"><a:schemeClr val="bg1"/></p:bgRef></p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title Placeholder 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="274638"/><a:ext cx="8229600" cy="1143000"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr"><a:normAutofit/></a:bodyPr><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Text Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1600200"/><a:ext cx="8229600" cy="4525963"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0"><a:normAutofit/></a:bodyPr><a:lstStyle/><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/><p:sldLayoutIdLst><p:sldLayoutId id="2147483649" r:id="rId1"/><p:sldLayoutId id="2147483650" r:id="rId2"/><p:sldLayoutId id="2147483651" r:id="rId3"/></p:sldLayoutIdLst><p:txStyles><p:titleStyle><a:lvl1pPr algn="ctr" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="0"/></a:spcBef><a:buNone/><a:defRPr sz="4400" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mj-lt"/><a:ea typeface="+mj-ea"/><a:cs typeface="+mj-cs"/></a:defRPr></a:lvl1pPr></p:titleStyle><p:bodyStyle><a:lvl1pPr marL="342900" indent="-342900" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\u2022"/><a:defRPr sz="3200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="742950" indent="-285750" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\u2013"/><a:defRPr sz="2800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="1143000" indent="-228600" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\u2022"/><a:defRPr sz="2400" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1600200" indent="-228600" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\u2013"/><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="2057400" indent="-228600" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="\xBB"/><a:defRPr sz="2000" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl5pPr></p:bodyStyle><p:otherStyle><a:defPPr><a:defRPr lang="en-US"/></a:defPPr><a:lvl1pPr marL="0" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl1pPr></p:otherStyle></p:txStyles></p:sldMaster>`;
|
|
1093
|
+
var LAYOUT_BLANK_XML = `${XML_DECL}<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="blank" preserve="1"><p:cSld name="Blank"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;
|
|
1094
|
+
var LAYOUT_TITLE_XML = `${XML_DECL}<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="title" preserve="1"><p:cSld name="Title Slide"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ctrTitle"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="2130425"/><a:ext cx="7772400" cy="1470025"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Subtitle 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="subTitle" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1371600" y="3886200"/><a:ext cx="6400800" cy="1752600"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master subtitle style</a:t></a:r><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;
|
|
1095
|
+
var LAYOUT_OBJ_XML = `${XML_DECL}<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="obj" preserve="1"><p:cSld name="Title and Content"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master title style</a:t></a:r><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Content Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US" smtClean="0"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;
|
|
1096
|
+
var buildPresentationXml = (size) => `${XML_DECL}<p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" saveSubsetFonts="1"><p:sldMasterIdLst><p:sldMasterId id="2147483648" r:id="rId1"/></p:sldMasterIdLst><p:sldSz cx="${size.cx}" cy="${size.cy}" type="${size.type}"/><p:notesSz cx="6858000" cy="9144000"/></p:presentation>`;
|
|
1097
|
+
var PRES_PROPS_XML = `${XML_DECL}<p:presentationPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"/>`;
|
|
1098
|
+
var VIEW_PROPS_XML = `${XML_DECL}<p:viewPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"/>`;
|
|
1099
|
+
var CORE_PROPS_XML = `${XML_DECL}<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title></dc:title><dc:creator>pptx-kit</dc:creator><cp:lastModifiedBy>pptx-kit</cp:lastModifiedBy></cp:coreProperties>`;
|
|
1100
|
+
var EXTENDED_PROPS_XML = `${XML_DECL}<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>pptx-kit</Application></Properties>`;
|
|
1101
|
+
var ROOT_RELS_XML = `${XML_DECL}<Relationships xmlns="${RT_PACKAGE}"><Relationship Id="rId1" Type="${RT}/officeDocument" Target="ppt/presentation.xml"/><Relationship Id="rId2" Type="${RT_PACKAGE}/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId3" Type="${RT}/extended-properties" Target="docProps/app.xml"/></Relationships>`;
|
|
1102
|
+
var PRES_RELS_XML = `${XML_DECL}<Relationships xmlns="${RT_PACKAGE}"><Relationship Id="rId1" Type="${RT}/slideMaster" Target="slideMasters/slideMaster1.xml"/><Relationship Id="rId2" Type="${RT}/theme" Target="theme/theme1.xml"/><Relationship Id="rId3" Type="${RT}/presProps" Target="presProps.xml"/><Relationship Id="rId4" Type="${RT}/viewProps" Target="viewProps.xml"/></Relationships>`;
|
|
1103
|
+
var MASTER_RELS_XML = `${XML_DECL}<Relationships xmlns="${RT_PACKAGE}"><Relationship Id="rId1" Type="${RT}/slideLayout" Target="../slideLayouts/slideLayout1.xml"/><Relationship Id="rId2" Type="${RT}/slideLayout" Target="../slideLayouts/slideLayout2.xml"/><Relationship Id="rId3" Type="${RT}/slideLayout" Target="../slideLayouts/slideLayout3.xml"/><Relationship Id="rId4" Type="${RT}/theme" Target="../theme/theme1.xml"/></Relationships>`;
|
|
1104
|
+
var LAYOUT_RELS_XML = `${XML_DECL}<Relationships xmlns="${RT_PACKAGE}"><Relationship Id="rId1" Type="${RT}/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>`;
|
|
1105
|
+
var TEXT_ENCODER2 = new TextEncoder();
|
|
1106
|
+
var encode2 = (s) => TEXT_ENCODER2.encode(s);
|
|
1107
|
+
var buildBlankDeck = (aspect) => {
|
|
1108
|
+
const pkg = OpcPackage.empty();
|
|
1109
|
+
const size = SLIDE_SIZE[aspect];
|
|
1110
|
+
const add = (name, contentType, xml) => {
|
|
1111
|
+
pkg.addPart(partName(name), contentType, encode2(xml));
|
|
1112
|
+
};
|
|
1113
|
+
const addRels = (name, xml) => {
|
|
1114
|
+
pkg.addPart(partName(name), RELS_CONTENT_TYPE, encode2(xml));
|
|
1115
|
+
};
|
|
1116
|
+
add("/ppt/presentation.xml", PRESENTATION_CONTENT_TYPE, buildPresentationXml(size));
|
|
1117
|
+
add("/ppt/presProps.xml", PRES_PROPS_CONTENT_TYPE, PRES_PROPS_XML);
|
|
1118
|
+
add("/ppt/viewProps.xml", VIEW_PROPS_CONTENT_TYPE, VIEW_PROPS_XML);
|
|
1119
|
+
add("/ppt/theme/theme1.xml", THEME_CONTENT_TYPE, THEME_XML);
|
|
1120
|
+
add("/ppt/slideMasters/slideMaster1.xml", SLIDE_MASTER_CONTENT_TYPE, SLIDE_MASTER_XML);
|
|
1121
|
+
add("/ppt/slideLayouts/slideLayout1.xml", SLIDE_LAYOUT_CONTENT_TYPE, LAYOUT_BLANK_XML);
|
|
1122
|
+
add("/ppt/slideLayouts/slideLayout2.xml", SLIDE_LAYOUT_CONTENT_TYPE, LAYOUT_TITLE_XML);
|
|
1123
|
+
add("/ppt/slideLayouts/slideLayout3.xml", SLIDE_LAYOUT_CONTENT_TYPE, LAYOUT_OBJ_XML);
|
|
1124
|
+
add("/docProps/core.xml", CORE_PROPS_CONTENT_TYPE, CORE_PROPS_XML);
|
|
1125
|
+
add("/docProps/app.xml", EXTENDED_PROPS_CONTENT_TYPE, EXTENDED_PROPS_XML);
|
|
1126
|
+
addRels("/_rels/.rels", ROOT_RELS_XML);
|
|
1127
|
+
addRels("/ppt/_rels/presentation.xml.rels", PRES_RELS_XML);
|
|
1128
|
+
addRels("/ppt/slideMasters/_rels/slideMaster1.xml.rels", MASTER_RELS_XML);
|
|
1129
|
+
addRels("/ppt/slideLayouts/_rels/slideLayout1.xml.rels", LAYOUT_RELS_XML);
|
|
1130
|
+
addRels("/ppt/slideLayouts/_rels/slideLayout2.xml.rels", LAYOUT_RELS_XML);
|
|
1131
|
+
addRels("/ppt/slideLayouts/_rels/slideLayout3.xml.rels", LAYOUT_RELS_XML);
|
|
1132
|
+
return pkg;
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1074
1135
|
// src/api/_internal-symbols.ts
|
|
1075
1136
|
var INTERNAL_PACKAGE = /* @__PURE__ */ Symbol.for("pptx-kit.package");
|
|
1076
1137
|
var SLIDE_PART_NAME = /* @__PURE__ */ Symbol.for("pptx-kit.slide.partName");
|
|
@@ -1103,8 +1164,9 @@ var loadPresentation = async (input) => {
|
|
|
1103
1164
|
const pkg = OpcPackage.load(bytes);
|
|
1104
1165
|
return { [INTERNAL_PACKAGE]: pkg, _slidesCache: null };
|
|
1105
1166
|
};
|
|
1106
|
-
var createPresentation = () => {
|
|
1107
|
-
const
|
|
1167
|
+
var createPresentation = (options = {}) => {
|
|
1168
|
+
const aspect = options.size ?? "16:9";
|
|
1169
|
+
const pkg = buildBlankDeck(aspect);
|
|
1108
1170
|
return { [INTERNAL_PACKAGE]: pkg, _slidesCache: null };
|
|
1109
1171
|
};
|
|
1110
1172
|
var savePresentation = (pres) => {
|
|
@@ -1598,6 +1660,10 @@ var parseColor2 = (value) => {
|
|
|
1598
1660
|
if (/^[0-9A-Fa-f]{6}$/.test(hex)) return { kind: "srgb", hex: hex.toUpperCase() };
|
|
1599
1661
|
return null;
|
|
1600
1662
|
};
|
|
1663
|
+
var parseSrgbHex = (value) => {
|
|
1664
|
+
const hex = value.startsWith("#") ? value.slice(1) : value;
|
|
1665
|
+
return /^[0-9A-Fa-f]{6}$/.test(hex) ? hex.toUpperCase() : null;
|
|
1666
|
+
};
|
|
1601
1667
|
var buildColorElement = (value) => {
|
|
1602
1668
|
const parsed = parseColor2(value);
|
|
1603
1669
|
if (parsed === null) throw new Error(`unrecognized color: ${value}`);
|
|
@@ -2881,26 +2947,28 @@ var equalShares = (total, n) => {
|
|
|
2881
2947
|
};
|
|
2882
2948
|
var buildTable = (opts) => {
|
|
2883
2949
|
const rows = opts.rows;
|
|
2884
|
-
if (rows.length === 0) throw new Error("
|
|
2950
|
+
if (rows.length === 0) throw new Error("addSlideTable: at least one row is required");
|
|
2885
2951
|
const colCount = rows[0]?.length ?? 0;
|
|
2886
|
-
if (colCount === 0) throw new Error("
|
|
2952
|
+
if (colCount === 0) throw new Error("addSlideTable: at least one column is required");
|
|
2887
2953
|
for (let i = 0; i < rows.length; i++) {
|
|
2888
2954
|
const r2 = rows[i];
|
|
2889
|
-
if (!r2) throw new Error(`
|
|
2955
|
+
if (!r2) throw new Error(`addSlideTable: row ${i} is missing`);
|
|
2890
2956
|
if (r2.length !== colCount) {
|
|
2891
2957
|
throw new Error(
|
|
2892
|
-
`
|
|
2958
|
+
`addSlideTable: row ${i} has ${r2.length} cells; expected ${colCount} to match row 0`
|
|
2893
2959
|
);
|
|
2894
2960
|
}
|
|
2895
2961
|
}
|
|
2896
2962
|
const colWidths = opts.colWidths ?? equalShares(opts.w, colCount);
|
|
2897
2963
|
if (colWidths.length !== colCount) {
|
|
2898
|
-
throw new Error(
|
|
2964
|
+
throw new Error(
|
|
2965
|
+
`addSlideTable: colWidths has ${colWidths.length} entries; expected ${colCount}`
|
|
2966
|
+
);
|
|
2899
2967
|
}
|
|
2900
2968
|
const rowHeights = opts.rowHeights ?? equalShares(opts.h, rows.length);
|
|
2901
2969
|
if (rowHeights.length !== rows.length) {
|
|
2902
2970
|
throw new Error(
|
|
2903
|
-
`
|
|
2971
|
+
`addSlideTable: rowHeights has ${rowHeights.length} entries; expected ${rows.length}`
|
|
2904
2972
|
);
|
|
2905
2973
|
}
|
|
2906
2974
|
const name = opts.name ?? `Table ${opts.id}`;
|
|
@@ -3425,10 +3493,10 @@ var buildCommentListDoc = (comments) => {
|
|
|
3425
3493
|
|
|
3426
3494
|
// src/api/fn/_helpers.ts
|
|
3427
3495
|
var TEXT_DECODER2 = new TextDecoder();
|
|
3428
|
-
var
|
|
3496
|
+
var TEXT_ENCODER3 = new TextEncoder();
|
|
3429
3497
|
var decode2 = (b) => TEXT_DECODER2.decode(b);
|
|
3430
|
-
var
|
|
3431
|
-
var
|
|
3498
|
+
var encode3 = (s) => TEXT_ENCODER3.encode(s);
|
|
3499
|
+
var SLIDE_LAYOUT_CONTENT_TYPE2 = "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
|
|
3432
3500
|
var SLIDE_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml";
|
|
3433
3501
|
var PRES_PART_NAME = partName("/ppt/presentation.xml");
|
|
3434
3502
|
var NAME_PRESENTATION2 = qname("p", "presentation", NS.pml);
|
|
@@ -3445,7 +3513,7 @@ var commitSlideData = (slide) => {
|
|
|
3445
3513
|
const xml = serializeXml(slide[SLIDE_DOCUMENT]);
|
|
3446
3514
|
const part = slide[INTERNAL_PACKAGE].getPart(slide[SLIDE_PART_NAME]);
|
|
3447
3515
|
if (!part) throw new Error(`slide part missing: ${slide[SLIDE_PART_NAME]}`);
|
|
3448
|
-
part.data =
|
|
3516
|
+
part.data = encode3(xml);
|
|
3449
3517
|
};
|
|
3450
3518
|
var refreshSlideData = (slide) => {
|
|
3451
3519
|
const fresh = readSlidePart(slide[SLIDE_DOCUMENT].root);
|
|
@@ -3533,7 +3601,7 @@ var setOpcDefault = (pkg, extension, contentType) => {
|
|
|
3533
3601
|
};
|
|
3534
3602
|
|
|
3535
3603
|
// src/api/fn/theme.ts
|
|
3536
|
-
var
|
|
3604
|
+
var THEME_CONTENT_TYPE2 = "application/vnd.openxmlformats-officedocument.theme+xml";
|
|
3537
3605
|
var NAME_THEME_ELEMENTS = qname("a", "themeElements", NS.dml);
|
|
3538
3606
|
var NAME_CLR_SCHEME = qname("a", "clrScheme", NS.dml);
|
|
3539
3607
|
var NAME_SRGB_CLR3 = qname("a", "srgbClr", NS.dml);
|
|
@@ -3555,7 +3623,7 @@ var readSchemeSlot = (parent, local) => {
|
|
|
3555
3623
|
};
|
|
3556
3624
|
var getPresentationTheme = (pres) => {
|
|
3557
3625
|
const pkg = pres[INTERNAL_PACKAGE];
|
|
3558
|
-
const themePart = pkg.parts.filter((p) => p.contentType ===
|
|
3626
|
+
const themePart = pkg.parts.filter((p) => p.contentType === THEME_CONTENT_TYPE2).sort((a2, b) => a2.name.localeCompare(b.name))[0];
|
|
3559
3627
|
if (!themePart) return null;
|
|
3560
3628
|
const root = parseXml(decode2(themePart.data)).root;
|
|
3561
3629
|
const themeElements = firstChildElement(root, NAME_THEME_ELEMENTS);
|
|
@@ -3588,7 +3656,7 @@ var readTypeface = (parent, local) => {
|
|
|
3588
3656
|
};
|
|
3589
3657
|
var getPresentationFonts = (pres) => {
|
|
3590
3658
|
const pkg = pres[INTERNAL_PACKAGE];
|
|
3591
|
-
const themePart = pkg.parts.filter((p) => p.contentType ===
|
|
3659
|
+
const themePart = pkg.parts.filter((p) => p.contentType === THEME_CONTENT_TYPE2).sort((a2, b) => a2.name.localeCompare(b.name))[0];
|
|
3592
3660
|
if (!themePart) return null;
|
|
3593
3661
|
const root = parseXml(decode2(themePart.data)).root;
|
|
3594
3662
|
const themeElements = firstChildElement(root, NAME_THEME_ELEMENTS);
|
|
@@ -3630,7 +3698,7 @@ var loadAuthorList = (pkg) => {
|
|
|
3630
3698
|
};
|
|
3631
3699
|
var writeAuthorList = (pkg, authors) => {
|
|
3632
3700
|
const doc = buildCommentAuthorListDoc(authors);
|
|
3633
|
-
const bytes =
|
|
3701
|
+
const bytes = encode3(serializeXml(doc));
|
|
3634
3702
|
const existing = pkg.getPart(COMMENT_AUTHORS_PART_NAME);
|
|
3635
3703
|
if (existing !== null) {
|
|
3636
3704
|
existing.data = bytes;
|
|
@@ -3677,7 +3745,7 @@ var writeCommentsForSlide = (slide, comments) => {
|
|
|
3677
3745
|
return;
|
|
3678
3746
|
}
|
|
3679
3747
|
const doc = buildCommentListDoc(comments);
|
|
3680
|
-
const bytes =
|
|
3748
|
+
const bytes = encode3(serializeXml(doc));
|
|
3681
3749
|
const existing = pkg.getPart(commentsName);
|
|
3682
3750
|
if (existing !== null) {
|
|
3683
3751
|
existing.data = bytes;
|
|
@@ -5882,8 +5950,8 @@ var readChartSpec = (root) => {
|
|
|
5882
5950
|
};
|
|
5883
5951
|
|
|
5884
5952
|
// src/internal/chartml/embedded-xlsx.ts
|
|
5885
|
-
var
|
|
5886
|
-
var
|
|
5953
|
+
var TEXT_ENCODER4 = new TextEncoder();
|
|
5954
|
+
var encode4 = (s) => TEXT_ENCODER4.encode(s);
|
|
5887
5955
|
var xmlEscape = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
5888
5956
|
var colLetter = (col) => {
|
|
5889
5957
|
let n = col;
|
|
@@ -5931,11 +5999,11 @@ var buildEmbeddedXlsx = (seriesNames, rows) => {
|
|
|
5931
5999
|
const rootRelsXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>';
|
|
5932
6000
|
const contentTypesXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/></Types>';
|
|
5933
6001
|
return writeZip([
|
|
5934
|
-
{ name: "[Content_Types].xml", data:
|
|
5935
|
-
{ name: "_rels/.rels", data:
|
|
5936
|
-
{ name: "xl/workbook.xml", data:
|
|
5937
|
-
{ name: "xl/_rels/workbook.xml.rels", data:
|
|
5938
|
-
{ name: "xl/worksheets/sheet1.xml", data:
|
|
6002
|
+
{ name: "[Content_Types].xml", data: encode4(contentTypesXml) },
|
|
6003
|
+
{ name: "_rels/.rels", data: encode4(rootRelsXml) },
|
|
6004
|
+
{ name: "xl/workbook.xml", data: encode4(workbookXml) },
|
|
6005
|
+
{ name: "xl/_rels/workbook.xml.rels", data: encode4(workbookRelsXml) },
|
|
6006
|
+
{ name: "xl/worksheets/sheet1.xml", data: encode4(sheetXml) }
|
|
5939
6007
|
]);
|
|
5940
6008
|
};
|
|
5941
6009
|
|
|
@@ -5993,7 +6061,41 @@ var buildChartGraphicFrame = (opts) => {
|
|
|
5993
6061
|
const graphic = elem(NAME_GRAPHIC2, { children: [graphicData] });
|
|
5994
6062
|
return elem(NAME_GRAPHIC_FRAME2, { children: [nvGraphicFramePr, xfrm, graphic] });
|
|
5995
6063
|
};
|
|
6064
|
+
var checkChartColor = (value, label) => {
|
|
6065
|
+
if (value === null || value === void 0) return;
|
|
6066
|
+
if (parseSrgbHex(value) === null) {
|
|
6067
|
+
throw new Error(
|
|
6068
|
+
`${label}: invalid chart color ${JSON.stringify(value)} \u2014 expected an sRGB hex like "#4472C4" or "4472C4"`
|
|
6069
|
+
);
|
|
6070
|
+
}
|
|
6071
|
+
};
|
|
6072
|
+
var validateChartSpecColors = (spec) => {
|
|
6073
|
+
checkChartColor(spec.plotAreaFill, "addSlideChart: plotAreaFill");
|
|
6074
|
+
checkChartColor(spec.plotAreaStrokeColor, "addSlideChart: plotAreaStrokeColor");
|
|
6075
|
+
checkChartColor(spec.chartAreaFill, "addSlideChart: chartAreaFill");
|
|
6076
|
+
checkChartColor(spec.chartAreaStrokeColor, "addSlideChart: chartAreaStrokeColor");
|
|
6077
|
+
checkChartColor(spec.valueAxisMajorGridlineColor, "addSlideChart: valueAxisMajorGridlineColor");
|
|
6078
|
+
checkChartColor(spec.valueAxisMinorGridlineColor, "addSlideChart: valueAxisMinorGridlineColor");
|
|
6079
|
+
checkChartColor(
|
|
6080
|
+
spec.categoryAxisMajorGridlineColor,
|
|
6081
|
+
"addSlideChart: categoryAxisMajorGridlineColor"
|
|
6082
|
+
);
|
|
6083
|
+
checkChartColor(
|
|
6084
|
+
spec.categoryAxisMinorGridlineColor,
|
|
6085
|
+
"addSlideChart: categoryAxisMinorGridlineColor"
|
|
6086
|
+
);
|
|
6087
|
+
checkChartColor(spec.valueAxisLineColor, "addSlideChart: valueAxisLineColor");
|
|
6088
|
+
checkChartColor(spec.categoryAxisLineColor, "addSlideChart: categoryAxisLineColor");
|
|
6089
|
+
spec.series.forEach((series, i) => {
|
|
6090
|
+
checkChartColor(series.color, `addSlideChart: series[${i}].color`);
|
|
6091
|
+
checkChartColor(series.trendline?.color, `addSlideChart: series[${i}].trendline.color`);
|
|
6092
|
+
series.pointColors?.forEach((c2, j) => {
|
|
6093
|
+
checkChartColor(c2, `addSlideChart: series[${i}].pointColors[${j}]`);
|
|
6094
|
+
});
|
|
6095
|
+
});
|
|
6096
|
+
};
|
|
5996
6097
|
var addSlideChart = (slide, opts) => {
|
|
6098
|
+
validateChartSpecColors(opts.spec);
|
|
5997
6099
|
const pkg = slide[INTERNAL_PACKAGE];
|
|
5998
6100
|
const chartN = allocateChartIndex(pkg);
|
|
5999
6101
|
const chartPartName = partName(`/ppt/charts/chart${chartN}.xml`);
|
|
@@ -6007,7 +6109,7 @@ var addSlideChart = (slide, opts) => {
|
|
|
6007
6109
|
xlsxRows
|
|
6008
6110
|
);
|
|
6009
6111
|
const chartDoc = buildChartSpaceDoc(opts.spec);
|
|
6010
|
-
const chartBytes =
|
|
6112
|
+
const chartBytes = encode3(serializeXml(chartDoc));
|
|
6011
6113
|
pkg.addPart(chartPartName, CHART_CONTENT_TYPE, chartBytes);
|
|
6012
6114
|
pkg.addPart(xlsxPartName, EMBEDDED_XLSX_CONTENT_TYPE, xlsxBytes);
|
|
6013
6115
|
setOpcDefault(pkg, "rels", "application/vnd.openxmlformats-package.relationships+xml");
|
|
@@ -6060,6 +6162,7 @@ var resolveChartPartName = (slide, shape) => {
|
|
|
6060
6162
|
return { partName: partNameValue, rId };
|
|
6061
6163
|
};
|
|
6062
6164
|
var setChartSpec = (chart, spec) => {
|
|
6165
|
+
validateChartSpecColors(spec);
|
|
6063
6166
|
const slide = chart.shape[SHAPE_SLIDE];
|
|
6064
6167
|
const pkg = slide[INTERNAL_PACKAGE];
|
|
6065
6168
|
const resolved = resolveChartPartName(slide, chart.shape);
|
|
@@ -6067,7 +6170,7 @@ var setChartSpec = (chart, spec) => {
|
|
|
6067
6170
|
throw new Error("setChartSpec: shape is not a chart graphic frame");
|
|
6068
6171
|
}
|
|
6069
6172
|
const doc = buildChartSpaceDoc(spec);
|
|
6070
|
-
const chartBytes =
|
|
6173
|
+
const chartBytes = encode3(serializeXml(doc));
|
|
6071
6174
|
const chartPart = pkg.getPart(resolved.partName);
|
|
6072
6175
|
if (!chartPart) {
|
|
6073
6176
|
throw new Error(`setChartSpec: chart part ${resolved.partName} not found`);
|
|
@@ -6656,7 +6759,7 @@ var getSlideLayouts = (pres) => {
|
|
|
6656
6759
|
const pkg = pres[INTERNAL_PACKAGE];
|
|
6657
6760
|
const out = [];
|
|
6658
6761
|
for (const part of pkg.parts) {
|
|
6659
|
-
if (part.contentType !==
|
|
6762
|
+
if (part.contentType !== SLIDE_LAYOUT_CONTENT_TYPE2) continue;
|
|
6660
6763
|
const root = parseXml(decode2(part.data)).root;
|
|
6661
6764
|
out.push({
|
|
6662
6765
|
[LAYOUT_PART_NAME]: part.name,
|
|
@@ -6750,7 +6853,7 @@ var getCoreProperties = (pres) => {
|
|
|
6750
6853
|
category: read(NS_CORE_PROPS, "category")
|
|
6751
6854
|
};
|
|
6752
6855
|
};
|
|
6753
|
-
var
|
|
6856
|
+
var CORE_PROPS_CONTENT_TYPE2 = "application/vnd.openxmlformats-package.core-properties+xml";
|
|
6754
6857
|
var CORE_PROP_FIELDS = [
|
|
6755
6858
|
{ key: "title", uri: NS_DC, prefix: "dc", local: "title" },
|
|
6756
6859
|
{ key: "subject", uri: NS_DC, prefix: "dc", local: "subject" },
|
|
@@ -6806,16 +6909,16 @@ var setCoreProperties = (pres, values) => {
|
|
|
6806
6909
|
root.children.push(elem(name, { children: [text(value)] }));
|
|
6807
6910
|
}
|
|
6808
6911
|
}
|
|
6809
|
-
const bytes =
|
|
6912
|
+
const bytes = encode3(serializeXml(doc));
|
|
6810
6913
|
if (part) {
|
|
6811
6914
|
part.data = bytes;
|
|
6812
6915
|
return;
|
|
6813
6916
|
}
|
|
6814
6917
|
pkg.contentTypes.overrides.push({
|
|
6815
6918
|
partName: CORE_PROPS_PART_NAME,
|
|
6816
|
-
contentType:
|
|
6919
|
+
contentType: CORE_PROPS_CONTENT_TYPE2
|
|
6817
6920
|
});
|
|
6818
|
-
pkg.addPart(CORE_PROPS_PART_NAME,
|
|
6921
|
+
pkg.addPart(CORE_PROPS_PART_NAME, CORE_PROPS_CONTENT_TYPE2, bytes);
|
|
6819
6922
|
const rootRels = pkg.rootRels() ?? emptyRels();
|
|
6820
6923
|
const rId = nextRelId(rootRels.items.map((r2) => r2.id));
|
|
6821
6924
|
rootRels.items.push({
|
|
@@ -6879,7 +6982,7 @@ var setExtendedProperties = (pres, values) => {
|
|
|
6879
6982
|
doc.root.children.push(elem(name, { children: [text(value)] }));
|
|
6880
6983
|
}
|
|
6881
6984
|
}
|
|
6882
|
-
part.data =
|
|
6985
|
+
part.data = encode3(serializeXml(doc));
|
|
6883
6986
|
};
|
|
6884
6987
|
|
|
6885
6988
|
// src/api/fn/thumbnail.ts
|
|
@@ -9049,7 +9152,7 @@ var setSlideNotes = (slide, value) => {
|
|
|
9049
9152
|
const txBody = firstChildElement(child, qname("p", "txBody", NS.pml));
|
|
9050
9153
|
if (!txBody) continue;
|
|
9051
9154
|
setTextBody(txBody, value);
|
|
9052
|
-
part.data =
|
|
9155
|
+
part.data = encode3(serializeXml(doc2));
|
|
9053
9156
|
return;
|
|
9054
9157
|
}
|
|
9055
9158
|
throw new Error("notesSlide has no body placeholder to fill");
|
|
@@ -9069,7 +9172,7 @@ var setSlideNotes = (slide, value) => {
|
|
|
9069
9172
|
pkg.addPart(
|
|
9070
9173
|
notesName,
|
|
9071
9174
|
"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",
|
|
9072
|
-
|
|
9175
|
+
encode3(serializeXml(doc))
|
|
9073
9176
|
);
|
|
9074
9177
|
const notesRels = emptyRels();
|
|
9075
9178
|
const slideBase = slide[SLIDE_PART_NAME].split("/").pop() ?? "slide.xml";
|
|
@@ -9159,7 +9262,7 @@ var setSlideSize = (pres, opts) => {
|
|
|
9159
9262
|
}
|
|
9160
9263
|
sldSz.attrs = [attr(ATTR_CX9, String(opts.width)), attr(ATTR_CY9, String(opts.height))];
|
|
9161
9264
|
if (opts.type !== void 0) sldSz.attrs.push(attr(ATTR_TYPE8, opts.type));
|
|
9162
|
-
presPart.data =
|
|
9265
|
+
presPart.data = encode3(serializeXml(doc));
|
|
9163
9266
|
};
|
|
9164
9267
|
var SLIDE_SIZE_4_3 = {
|
|
9165
9268
|
width: emu(9144e3),
|
|
@@ -12461,7 +12564,7 @@ var getSlideLayoutCount = (pres) => {
|
|
|
12461
12564
|
const pkg = pres[INTERNAL_PACKAGE];
|
|
12462
12565
|
let n = 0;
|
|
12463
12566
|
for (const part of pkg.parts) {
|
|
12464
|
-
if (part.contentType ===
|
|
12567
|
+
if (part.contentType === SLIDE_LAYOUT_CONTENT_TYPE2) n++;
|
|
12465
12568
|
}
|
|
12466
12569
|
return n;
|
|
12467
12570
|
};
|
|
@@ -12684,7 +12787,7 @@ var replaceTokensInPresentation = (pres, tokens) => {
|
|
|
12684
12787
|
const doc = parseXml(decode2(part.data));
|
|
12685
12788
|
const n = replaceTokensInTree(doc.root, tokens);
|
|
12686
12789
|
if (n > 0) {
|
|
12687
|
-
part.data =
|
|
12790
|
+
part.data = encode3(serializeXml(doc));
|
|
12688
12791
|
count += n;
|
|
12689
12792
|
}
|
|
12690
12793
|
}
|
|
@@ -12699,7 +12802,7 @@ var replaceTextInPresentation = (pres, from, to) => {
|
|
|
12699
12802
|
const doc = parseXml(decode2(part.data));
|
|
12700
12803
|
const n = replaceTextInTree(doc.root, from, to);
|
|
12701
12804
|
if (n > 0) {
|
|
12702
|
-
part.data =
|
|
12805
|
+
part.data = encode3(serializeXml(doc));
|
|
12703
12806
|
count += n;
|
|
12704
12807
|
}
|
|
12705
12808
|
}
|
|
@@ -12836,7 +12939,7 @@ var setSlideSections = (pres, sections) => {
|
|
|
12836
12939
|
doc.root.children = doc.root.children.filter((c2) => c2 !== extLst);
|
|
12837
12940
|
}
|
|
12838
12941
|
}
|
|
12839
|
-
presPart.data =
|
|
12942
|
+
presPart.data = encode3(serializeXml(doc));
|
|
12840
12943
|
return;
|
|
12841
12944
|
}
|
|
12842
12945
|
const sectionLst = ensureSectionLst(doc.root);
|
|
@@ -12855,7 +12958,7 @@ var setSlideSections = (pres, sections) => {
|
|
|
12855
12958
|
children: [elem(NAME_P14_SLD_ID_LST, { children: sldIds })]
|
|
12856
12959
|
});
|
|
12857
12960
|
});
|
|
12858
|
-
presPart.data =
|
|
12961
|
+
presPart.data = encode3(serializeXml(doc));
|
|
12859
12962
|
};
|
|
12860
12963
|
|
|
12861
12964
|
// src/api/fn/slide-deck.ts
|
|
@@ -12964,7 +13067,7 @@ var addSlide = (pres, options) => {
|
|
|
12964
13067
|
const layoutSpTree = firstChildElement(layoutCsld, NAME_SP_TREE4);
|
|
12965
13068
|
if (!layoutSpTree) throw new Error(`layout ${layoutPartName} missing <p:spTree>`);
|
|
12966
13069
|
const slideDoc = buildSlideFromLayout(layoutSpTree);
|
|
12967
|
-
const slideBytes =
|
|
13070
|
+
const slideBytes = encode3(serializeXml(slideDoc));
|
|
12968
13071
|
pkg.addPart(newSlidePartName, SLIDE_CONTENT_TYPE, slideBytes);
|
|
12969
13072
|
const slideRels = emptyRels();
|
|
12970
13073
|
slideRels.items.push({
|
|
@@ -12988,7 +13091,7 @@ var addSlide = (pres, options) => {
|
|
|
12988
13091
|
attrs: [attr(ATTR_ID13, String(newSldId)), attr(ATTR_R_ID3, newRId)]
|
|
12989
13092
|
})
|
|
12990
13093
|
);
|
|
12991
|
-
presPart.data =
|
|
13094
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
12992
13095
|
pres._slidesCache = null;
|
|
12993
13096
|
const slides = getSlides(pres);
|
|
12994
13097
|
const last = slides[slides.length - 1];
|
|
@@ -13023,7 +13126,7 @@ var removeSlide = (pres, slide) => {
|
|
|
13023
13126
|
return getAttrValue(c2, ATTR_R_ID3) !== removedRel.id;
|
|
13024
13127
|
});
|
|
13025
13128
|
}
|
|
13026
|
-
presPart.data =
|
|
13129
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
13027
13130
|
pkg.removePart(relsPartNameFor(slidePartName));
|
|
13028
13131
|
pkg.removePart(slidePartName);
|
|
13029
13132
|
pres._slidesCache = null;
|
|
@@ -13066,7 +13169,7 @@ var sortSlides = (pres, compareFn) => {
|
|
|
13066
13169
|
(c2) => !(c2.kind === "element" && c2.name.namespaceURI === NS.pml && c2.name.localName === "sldId")
|
|
13067
13170
|
);
|
|
13068
13171
|
sldIdLst.children = [...nonSldIdChildren, ...newOrder];
|
|
13069
|
-
presPart.data =
|
|
13172
|
+
presPart.data = encode3(serializeXml(doc));
|
|
13070
13173
|
pres._slidesCache = null;
|
|
13071
13174
|
};
|
|
13072
13175
|
var reverseSlides = (pres) => {
|
|
@@ -13118,7 +13221,7 @@ var moveSlide = (pres, slide, toIndex) => {
|
|
|
13118
13221
|
remaining.splice(insertAt, 0, target);
|
|
13119
13222
|
}
|
|
13120
13223
|
sldIdLst.children = remaining;
|
|
13121
|
-
presPart.data =
|
|
13224
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
13122
13225
|
pres._slidesCache = null;
|
|
13123
13226
|
};
|
|
13124
13227
|
var duplicateSlide = (pres, slide) => {
|
|
@@ -13152,7 +13255,7 @@ var duplicateSlide = (pres, slide) => {
|
|
|
13152
13255
|
attrs: [attr(ATTR_ID13, String(newSldId)), attr(ATTR_R_ID3, newRId)]
|
|
13153
13256
|
})
|
|
13154
13257
|
);
|
|
13155
|
-
presPart.data =
|
|
13258
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
13156
13259
|
pres._slidesCache = null;
|
|
13157
13260
|
const slides = getSlides(pres);
|
|
13158
13261
|
const dup = slides[slides.length - 1];
|
|
@@ -13250,7 +13353,7 @@ var importSlide = (targetPres, sourceSlide, targetLayout) => {
|
|
|
13250
13353
|
attrs: [attr(ATTR_ID13, String(newSldId)), attr(ATTR_R_ID3, newRId)]
|
|
13251
13354
|
})
|
|
13252
13355
|
);
|
|
13253
|
-
presPart.data =
|
|
13356
|
+
presPart.data = encode3(serializeXml(presDoc));
|
|
13254
13357
|
targetPres._slidesCache = null;
|
|
13255
13358
|
const slides = getSlides(targetPres);
|
|
13256
13359
|
const last = slides[slides.length - 1];
|
|
@@ -13270,7 +13373,7 @@ var mergePresentations = (targetPres, sourcePres, targetLayout) => {
|
|
|
13270
13373
|
};
|
|
13271
13374
|
|
|
13272
13375
|
// src/api/index.ts
|
|
13273
|
-
var VERSION = "0.
|
|
13376
|
+
var VERSION = "0.3.0" ;
|
|
13274
13377
|
|
|
13275
13378
|
// src/node.ts
|
|
13276
13379
|
var loadPresentationFile = async (path) => {
|