ooxml-core 1.45.0 → 1.47.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/dist/PptxHandler-JX62VKU4.cjs +14 -0
- package/dist/{PptxHandler-FXLXIOLT.mjs → PptxHandler-NXHZ6ITL.mjs} +2 -2
- package/dist/PptxHandler-SUGLNSZI.mjs +5 -0
- package/dist/{PresentationBuilder-CSKLG64K.cjs → PresentationBuilder-IK6NIK6T.cjs} +6 -6
- package/dist/{PresentationBuilder-DDYHRV26.mjs → PresentationBuilder-LHQ333UL.mjs} +3 -3
- package/dist/{PresentationBuilder-3FKFRSSV.mjs → PresentationBuilder-URSPID7L.mjs} +2 -2
- package/dist/automation/index.cjs +12 -7
- package/dist/automation/index.mjs +12 -7
- package/dist/chart/edit/group-options.d.ts +4 -0
- package/dist/chart/edit/group-options.d.ts.map +1 -1
- package/dist/chart/edit/new-chart-minimal.d.ts +13 -0
- package/dist/chart/edit/new-chart-minimal.d.ts.map +1 -0
- package/dist/chart/edit/new-chart.d.ts +34 -1
- package/dist/chart/edit/new-chart.d.ts.map +1 -1
- package/dist/chart/edit/secondary-axis.d.ts +8 -1
- package/dist/chart/edit/secondary-axis.d.ts.map +1 -1
- package/dist/chart/edit/type.d.ts +2 -0
- package/dist/chart/edit/type.d.ts.map +1 -1
- package/dist/chart/index.cjs +414 -263
- package/dist/chart/index.mjs +412 -264
- package/dist/{chunk-YBSNMVSN.cjs → chunk-4GPLQEEC.cjs} +1604 -1324
- package/dist/{chunk-U5BXJQZG.mjs → chunk-553WFEHD.mjs} +332 -53
- package/dist/{chunk-RVYGAYCP.mjs → chunk-5HNRZOBX.mjs} +1 -1
- package/dist/{chunk-VKFKEVHK.mjs → chunk-6MU4WKHS.mjs} +1 -1
- package/dist/{chunk-GXYK3H4O.mjs → chunk-7L6ZAA5Y.mjs} +82 -17
- package/dist/{chunk-3J6VIKLP.cjs → chunk-APCA7N6Q.cjs} +3 -3
- package/dist/{chunk-IPV3J3I5.mjs → chunk-DEDK2J57.mjs} +68 -1
- package/dist/{chunk-7T3SJQA6.cjs → chunk-E5TGYYKO.cjs} +1 -0
- package/dist/{chunk-R7NS42KQ.mjs → chunk-FKU2Z6ZB.mjs} +1 -1
- package/dist/{chunk-GGJUWJXB.mjs → chunk-QHR726W3.mjs} +1 -1
- package/dist/{chunk-XTUX5RMG.cjs → chunk-T4BVZTII.cjs} +9 -9
- package/dist/{chunk-QZPOPUI5.cjs → chunk-WFN6ZU7N.cjs} +69 -0
- package/dist/{chunk-LCXBTJXE.mjs → chunk-XVEJS7HN.mjs} +5 -5
- package/dist/{chunk-CVJX6NNO.mjs → chunk-Z734BYYR.mjs} +334 -54
- package/dist/{chunk-OORQCSVA.mjs → chunk-ZLUHU2SU.mjs} +1 -0
- package/dist/docx/index.cjs +300 -144
- package/dist/docx/index.mjs +300 -144
- package/dist/index.cjs +484 -333
- package/dist/index.mjs +484 -333
- package/dist/pptx/automation/index.cjs +2207 -1825
- package/dist/pptx/automation/index.d.ts +4 -4
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts → index--HBUyILF.d.ts} +5 -5
- package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts.map → index--HBUyILF.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-DGKI80Hj.d.ts → index-BDVzSboe.d.ts} +71 -7
- package/dist/pptx/chunks/{index-DGKI80Hj.d.ts.map → index-BDVzSboe.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-jdZUtLGB.d.ts → index-Dr3iIPt9.d.ts} +3 -3
- package/dist/pptx/chunks/{index-jdZUtLGB.d.ts.map → index-Dr3iIPt9.d.ts.map} +1 -1
- package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts → text-operations-CVHXOSit.d.ts} +18 -3
- package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts.map → text-operations-CVHXOSit.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +608 -226
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +1 -0
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +4 -4
- package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-reconcile.cjs +8 -8
- package/dist/pptx/editor/render/collaboration-reconcile.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-sync.cjs +14 -14
- package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-sync.mjs +1 -1
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/index.cjs +2605 -2226
- package/dist/pptx/index.d.ts +5 -5
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/xlsx/index.cjs +12 -7
- package/dist/xlsx/index.mjs +12 -7
- package/dist/xlsx/ui/index.cjs +12 -7
- package/dist/xlsx/ui/index.mjs +12 -7
- package/package.json +1 -1
- package/dist/PptxHandler-3RDVJFQV.cjs +0 -14
- package/dist/PptxHandler-EI6DMHPM.mjs +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_ROW_HEIGHT_EMU, createDefaultXmlCell, tableCellTextBodyMatches } from './chunk-
|
|
2
|
-
import { NS, RELATIONSHIP_TYPES, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, themeColorRefFromColorChoice, formatAutoNumberMarker, readText3DValues, cloneXmlObject, readScene3DValues, parseParagraphSpacingPx, parseOoxmlPercent, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, orderedPathCommandEntries, ooxmlArcToSvg, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, nextRelationshipId, remapElementShapeIds, normalizeCustomShowIds, mapCustomShowActions, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, openPptxZip, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, parseRelationships, resolvePartPath, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, LN_CHILD_ORDER, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, ensureXmlChild, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, readCommentMentions, rebaseCommentMentions, applyCommentMentions, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, drawingLineXml, parseDrawingTextBody, parseXml, parseDrawingFill, parseDrawingLine, first, buildXml, setDrawingFillXml, fillElementOf, patchDrawingLine, elements, drawingFillXml, applyChartManualLayout, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, drawingColorXml, applyDiagramRelationshipIds, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, customGeometryPathsToXml, ensureArrayValue, lookupPresetShape, writeShapeEffects, SHAPE_STYLE_ORDER, CAMERA_PRESETS, LIGHT_RIGS, LIGHT_DIRECTIONS, roundCoordinate, scaleVectorToIntegers, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, restorePathListCommandOrder, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, reorderObjectKeysByLocalName, getSignaturePathsToStrip, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, mergeSmartArtPointXml, mergeSmartArtConnectionXml, withDiagramPictureSources, diagramPictureRelationships, applySmartArtLayoutDefinition, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseDiagramDataModel, DEFAULT_GENERATED_DIAGRAM_SCHEME, previewDiagramLayout, parseDiagramColors, resolveDrawingColor, children, parseDrawingRichTextBody, writeGeneratedDiagramDrawing, descendants, GENERATED_DIAGRAM_CACHE_NS, generatedDrawingDigest, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, resolveThemeFillStyle, resolveThemeLineStyle, resolveThemeEffectStyle, relAttr, ensureXmlChildren, TC_PR_BORDERS_ORDER, writeChartColorChoice, relationshipsPartFor, stripParentDirSegments, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, openZip, attr, parseDrawingEffects, drawingEffectsXml, readChartManualLayoutValues, buildEffectDagTreeFromXml, appendInSchemaOrder, RUN_PROPERTIES_ORDER, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, picturePercentage, ARTISTIC_PRIMARY_ATTRIBUTE, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, readPictureEffect,
|
|
1
|
+
import { DEFAULT_ROW_HEIGHT_EMU, createDefaultXmlCell, tableCellTextBodyMatches } from './chunk-6MU4WKHS.mjs';
|
|
2
|
+
import { NS, RELATIONSHIP_TYPES, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, themeColorRefFromColorChoice, formatAutoNumberMarker, readText3DValues, cloneXmlObject, readScene3DValues, parseParagraphSpacingPx, parseOoxmlPercent, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, orderedPathCommandEntries, ooxmlArcToSvg, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, nextRelationshipId, remapElementShapeIds, normalizeCustomShowIds, mapCustomShowActions, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, openPptxZip, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, parseRelationships, resolvePartPath, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, LN_CHILD_ORDER, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, ensureXmlChild, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, ooxmlGradientAngleToCssDegrees, serializeTabStop, readCommentMentions, rebaseCommentMentions, applyCommentMentions, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, drawingLineXml, parseDrawingTextBody, parseXml, parseDrawingFill, parseDrawingLine, first, buildXml, setDrawingFillXml, fillElementOf, patchDrawingLine, elements, drawingFillXml, applyChartManualLayout, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, drawingColorXml, applyDiagramRelationshipIds, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, customGeometryPathsToXml, ensureArrayValue, lookupPresetShape, writeShapeEffects, SHAPE_STYLE_ORDER, CAMERA_PRESETS, LIGHT_RIGS, LIGHT_DIRECTIONS, roundCoordinate, scaleVectorToIntegers, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, restorePathListCommandOrder, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, reorderObjectKeysByLocalName, getSignaturePathsToStrip, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, mergeSmartArtPointXml, mergeSmartArtConnectionXml, withDiagramPictureSources, diagramPictureRelationships, applySmartArtLayoutDefinition, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseDiagramDataModel, DEFAULT_GENERATED_DIAGRAM_SCHEME, previewDiagramLayout, parseDiagramColors, resolveDrawingColor, children, parseDrawingRichTextBody, writeGeneratedDiagramDrawing, descendants, GENERATED_DIAGRAM_CACHE_NS, generatedDrawingDigest, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, resolveThemeFillStyle, resolveThemeLineStyle, resolveThemeEffectStyle, relAttr, ensureXmlChildren, TC_PR_BORDERS_ORDER, writeChartColorChoice, relationshipsPartFor, stripParentDirSegments, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, openZip, attr, parseDrawingEffects, drawingEffectsXml, readChartManualLayoutValues, buildEffectDagTreeFromXml, appendInSchemaOrder, RUN_PROPERTIES_ORDER, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, picturePercentage, ARTISTIC_PRIMARY_ATTRIBUTE, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, readPictureEffect, isAlternateContentChoiceSupported, detectStrictConformance, normalizeStrictXml, relayoutSmartArt, patchDrawingColorIn, themeColorRefToSolidFillWithOpacity, FONT_ADVANCE_TABLES, DEFAULT_FONT_ADVANCE_TABLE, measureTextWidth, applyDrawingColorTransforms, applyThemeToData, detectFileFormat, parseOle2, EncryptedFileError, decryptPptx, encryptPptx, MAX_ZIP_ENTRY_COUNT, DEFAULT_MAX_UNCOMPRESSED_BYTES, encodeXmlAttributeValue, encodeXmlTextValue, cssDegreesToOoxmlGradientAngle, svgToCustomGeometryPaths, IncorrectPasswordError, patchPictureEffects, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, supportsChartGradientFill, DEFAULT_CHART_GRADIENT_ANGLE, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, stripXmlOrderMarkers, normalizeStShapeType, applyCustomShows, applySections, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, backgroundStyleRefIsCurrent, backgroundRefNode, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, xmlAttrBool, detectOleObjectType, inferOleExtensionFromTarget, backgroundStylePreset, isDarkColorMap, backgroundStyleColorMap, reResolveElementsForColorMapChange, deriveSlideTitles, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, parseSlideDrawingGuides, slideBackgroundStyleRefFromNode, cloneSlide, parseDrawingFraction, scrgbLinearToSrgb8, parseDrawingHueDegrees, hslToRgb, themeColorRefToXml, effectChild, mergeEffectNode, mergeAttributeEffectNode, parseDrawingLineDash, findThemeEffectScheme, wrapFormatSchemeXml, effectIsPurelyStyleMatrix, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, estimateMediaDurationMs, parseVmlElements, parseLineSpacingMultiplier, parseLineSpacingExactPt, formatSchemeKey, buildRelationshipsXml, loadThemeVariants, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, guardZip, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, themeColorRefFromSchemeClr, ZipBombError, parseKinsoku, deobfuscateFont, detectFontFormat, parseDataTable, parseChartAxes, parseBubbleChartOptions, extractGuidFromPartName, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, extractCxSeriesColor, parseCxDataLabels, parseCxRegionMapOptions, parseCxAxes, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtLayoutDefinition, decodeBase64, parseSmartArtPresLayoutVars, parseDrawingColorIn, parseSmartArtConnection, connectionLabel, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, resolveDiagramLayoutCategory, captureDiagramPictures, parseDiagramDrawing, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, collectTransitionText, parseSmartArtQuickStyleLabels, parseDiagramQuickStyle, parseDiagramLayoutSummary, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, blendColorOntoWhite } from './chunk-DEDK2J57.mjs';
|
|
3
3
|
import { hasShapeProperties, hasTextProperties } from './chunk-GXHKNSZX.mjs';
|
|
4
4
|
import { EMU_PER_PX, EMU_PER_PIXEL, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, OOXML_PERCENT_UNITS, EMU_PER_POINT } from './chunk-CA7KCNL3.mjs';
|
|
5
5
|
import JSZip2 from 'jszip';
|
|
@@ -375,6 +375,7 @@ var SLIDE_FIELD_KIND = {
|
|
|
375
375
|
backgroundImage: "scalar",
|
|
376
376
|
backgroundImageProperties: "complex",
|
|
377
377
|
backgroundGradient: "scalar",
|
|
378
|
+
backgroundGradientFill: "complex",
|
|
378
379
|
backgroundStyleRef: "complex",
|
|
379
380
|
backgroundPattern: "complex",
|
|
380
381
|
backgroundShadeToTitle: "scalar",
|
|
@@ -5182,7 +5183,15 @@ var PptxSlideBackgroundBuilder = class {
|
|
|
5182
5183
|
init.reportUnsupportedBackground?.(rawBackgroundImage);
|
|
5183
5184
|
}
|
|
5184
5185
|
}
|
|
5185
|
-
if (backgroundProperties["a:blipFill"] === void 0 &&
|
|
5186
|
+
if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundGradient) {
|
|
5187
|
+
const gradFill2 = init.buildBackgroundGradientFill?.();
|
|
5188
|
+
if (gradFill2) {
|
|
5189
|
+
backgroundProperties["a:gradFill"] = gradFill2;
|
|
5190
|
+
} else if (!hasBackgroundColor && !hasBackgroundImage) {
|
|
5191
|
+
init.reportUnsupportedGradient?.();
|
|
5192
|
+
}
|
|
5193
|
+
}
|
|
5194
|
+
if (backgroundProperties["a:blipFill"] === void 0 && backgroundProperties["a:gradFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
|
|
5186
5195
|
backgroundProperties["a:solidFill"] = {
|
|
5187
5196
|
"a:srgbClr": {
|
|
5188
5197
|
"@_val": init.slide.backgroundColor.replace("#", "").toUpperCase()
|
|
@@ -9844,8 +9853,8 @@ function decodeAinkInk(inkRoot) {
|
|
|
9844
9853
|
if (raw2.length === 0) {
|
|
9845
9854
|
return 2;
|
|
9846
9855
|
}
|
|
9847
|
-
const
|
|
9848
|
-
return Number.isFinite(
|
|
9856
|
+
const num3 = Number(raw2);
|
|
9857
|
+
return Number.isFinite(num3) && num3 > 0 ? num3 : 2;
|
|
9849
9858
|
})();
|
|
9850
9859
|
const traces = ensureArrayLike3(inkRoot["aink:trace"]);
|
|
9851
9860
|
for (const trace of traces) {
|
|
@@ -11868,9 +11877,9 @@ async function ensureCustomPropertiesPackagingArtifacts(context) {
|
|
|
11868
11877
|
let maxId = 0;
|
|
11869
11878
|
for (const rel of rels) {
|
|
11870
11879
|
const id = String(rel?.["@_Id"] || "");
|
|
11871
|
-
const
|
|
11872
|
-
if (Number.isFinite(
|
|
11873
|
-
maxId =
|
|
11880
|
+
const num3 = Number.parseInt(id.replace(/^rId/, ""), 10);
|
|
11881
|
+
if (Number.isFinite(num3) && num3 > maxId) {
|
|
11882
|
+
maxId = num3;
|
|
11874
11883
|
}
|
|
11875
11884
|
}
|
|
11876
11885
|
rels.push({
|
|
@@ -11940,11 +11949,11 @@ var PptxDocumentPropertiesUpdater = class {
|
|
|
11940
11949
|
this.context = context;
|
|
11941
11950
|
}
|
|
11942
11951
|
async updateOnSave(slides, options2) {
|
|
11943
|
-
await this.updateCoreProperties(options2?.coreProperties);
|
|
11952
|
+
await this.updateCoreProperties(options2?.coreProperties, options2?.fixedDate);
|
|
11944
11953
|
await this.updateAppProperties(slides, options2?.appProperties);
|
|
11945
11954
|
await this.updateCustomProperties(options2?.customProperties);
|
|
11946
11955
|
}
|
|
11947
|
-
async updateCoreProperties(overrides) {
|
|
11956
|
+
async updateCoreProperties(overrides, fixedDate) {
|
|
11948
11957
|
const coreFile = this.context.zip.file("docProps/core.xml");
|
|
11949
11958
|
if (!coreFile) {
|
|
11950
11959
|
return;
|
|
@@ -11953,7 +11962,12 @@ var PptxDocumentPropertiesUpdater = class {
|
|
|
11953
11962
|
const coreXml = await coreFile.async("string");
|
|
11954
11963
|
const core = applyCoreOverrides(parseCoreProperties(coreXml), overrides);
|
|
11955
11964
|
const revision = Number.parseInt(core.revision?.trim() ?? "", 10);
|
|
11956
|
-
const next = {
|
|
11965
|
+
const next = fixedDate ? {
|
|
11966
|
+
...core,
|
|
11967
|
+
revision: overrides?.revision ?? "1",
|
|
11968
|
+
created: overrides?.created ?? formatW3cdtf(fixedDate),
|
|
11969
|
+
modified: overrides?.modified ?? formatW3cdtf(fixedDate)
|
|
11970
|
+
} : {
|
|
11957
11971
|
...core,
|
|
11958
11972
|
revision: String(Number.isFinite(revision) && revision >= 0 ? revision + 1 : 1),
|
|
11959
11973
|
modified: formatW3cdtf(/* @__PURE__ */ new Date())
|
|
@@ -42484,7 +42498,7 @@ var SWITCHABLE = {
|
|
|
42484
42498
|
stock: false,
|
|
42485
42499
|
surface: true
|
|
42486
42500
|
};
|
|
42487
|
-
function
|
|
42501
|
+
function chartGroupElement(kind, is3D) {
|
|
42488
42502
|
const match = Object.entries(CHART_GROUP_ELEMENTS).find(
|
|
42489
42503
|
([, value]) => value.kind === kind && value.is3D === is3D
|
|
42490
42504
|
);
|
|
@@ -42500,7 +42514,7 @@ function groupingFor(element2, grouping) {
|
|
|
42500
42514
|
var horizontalBars = (group) => group.kind === "bar" && group.barDirection === "bar";
|
|
42501
42515
|
function newGroup(base, target, series) {
|
|
42502
42516
|
const is3D = target.is3D ?? (base.is3D && SWITCHABLE[target.kind] === true);
|
|
42503
|
-
const element2 =
|
|
42517
|
+
const element2 = chartGroupElement(target.kind, is3D);
|
|
42504
42518
|
const group = { kind: target.kind, element: element2, is3D, series, axisIds: [] };
|
|
42505
42519
|
const allowed = GROUP_FIELDS[element2] ?? [];
|
|
42506
42520
|
for (const key2 of allowed)
|
|
@@ -42675,6 +42689,11 @@ var RANGES = {
|
|
|
42675
42689
|
firstSliceAngle: [0, 360],
|
|
42676
42690
|
holeSize: [1, 90]
|
|
42677
42691
|
};
|
|
42692
|
+
function assertChartGroupOption(key2, value) {
|
|
42693
|
+
const [min, max] = RANGES[key2];
|
|
42694
|
+
if (!Number.isInteger(value) || value < min || value > max)
|
|
42695
|
+
throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
|
|
42696
|
+
}
|
|
42678
42697
|
function setChartGroupOptions(space, seriesIndex, edit) {
|
|
42679
42698
|
return editChartSpace(space, (draft) => {
|
|
42680
42699
|
const { group } = chartSeriesEntryAt(draft, seriesIndex);
|
|
@@ -42687,9 +42706,7 @@ function setChartGroupOptions(space, seriesIndex, edit) {
|
|
|
42687
42706
|
delete group[key2];
|
|
42688
42707
|
continue;
|
|
42689
42708
|
}
|
|
42690
|
-
|
|
42691
|
-
if (!Number.isInteger(value) || value < min || value > max)
|
|
42692
|
-
throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
|
|
42709
|
+
assertChartGroupOption(key2, value);
|
|
42693
42710
|
group[key2] = value;
|
|
42694
42711
|
}
|
|
42695
42712
|
});
|
|
@@ -54731,6 +54748,43 @@ function applyCommonViewContainer(root, name, props) {
|
|
|
54731
54748
|
root[key2] = container;
|
|
54732
54749
|
}
|
|
54733
54750
|
|
|
54751
|
+
// pptx/core/utils/slide-background-gradient.ts
|
|
54752
|
+
var num2 = (value) => String(Number(value.toFixed(3)));
|
|
54753
|
+
function cssColor(color3, opacity2) {
|
|
54754
|
+
if (opacity2 === void 0 || opacity2 >= 1) {
|
|
54755
|
+
return color3;
|
|
54756
|
+
}
|
|
54757
|
+
const hex3 = color3.replace("#", "");
|
|
54758
|
+
const channel = (index) => Number.parseInt(hex3.slice(index, index + 2), 16);
|
|
54759
|
+
return `rgba(${channel(0)}, ${channel(2)}, ${channel(4)}, ${num2(opacity2)})`;
|
|
54760
|
+
}
|
|
54761
|
+
function slideBackgroundGradientCss(gradient) {
|
|
54762
|
+
const stops = (gradient.fillGradientStops ?? []).map((stop) => `${cssColor(stop.color, stop.opacity)} ${num2(stop.position)}%`).join(", ");
|
|
54763
|
+
if (gradient.fillGradientType !== "radial") {
|
|
54764
|
+
const angle = ooxmlGradientAngleToCssDegrees(gradient.fillGradientAngle ?? 0);
|
|
54765
|
+
return `linear-gradient(${num2(angle)}deg, ${stops})`;
|
|
54766
|
+
}
|
|
54767
|
+
const focus = gradient.fillGradientFillToRect;
|
|
54768
|
+
const cx = focus ? (focus.l + (1 - focus.r)) / 2 * 100 : 50;
|
|
54769
|
+
const cy = focus ? (focus.t + (1 - focus.b)) / 2 * 100 : 50;
|
|
54770
|
+
const at = `at ${num2(cx)}% ${num2(cy)}%`;
|
|
54771
|
+
switch (gradient.fillGradientPathType) {
|
|
54772
|
+
case "rect":
|
|
54773
|
+
return `radial-gradient(${num2(Math.max(cx, 100 - cx))}% ${num2(Math.max(cy, 100 - cy))}% ${at}, ${stops})`;
|
|
54774
|
+
case "shape":
|
|
54775
|
+
return `radial-gradient(farthest-side ${at}, ${stops})`;
|
|
54776
|
+
default:
|
|
54777
|
+
return `radial-gradient(circle ${at}, ${stops})`;
|
|
54778
|
+
}
|
|
54779
|
+
}
|
|
54780
|
+
function slideBackgroundGradientToWrite(slide) {
|
|
54781
|
+
const gradient = slide.backgroundGradientFill;
|
|
54782
|
+
if (!gradient || !slide.backgroundGradient) {
|
|
54783
|
+
return void 0;
|
|
54784
|
+
}
|
|
54785
|
+
return slide.backgroundGradient === slideBackgroundGradientCss(gradient) ? gradient : void 0;
|
|
54786
|
+
}
|
|
54787
|
+
|
|
54734
54788
|
// pptx/core/core/runtime/chart-part-registration.ts
|
|
54735
54789
|
var CHART_GRAPHIC_DATA_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
54736
54790
|
var CHART_EX_GRAPHIC_DATA_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
@@ -56359,8 +56413,8 @@ function authoredValue(node) {
|
|
|
56359
56413
|
return void 0;
|
|
56360
56414
|
}
|
|
56361
56415
|
const raw2 = node["@_val"];
|
|
56362
|
-
const
|
|
56363
|
-
return Number.isFinite(
|
|
56416
|
+
const num3 = raw2 === void 0 || raw2 === null || raw2 === "" ? NaN : Number.parseFloat(String(raw2));
|
|
56417
|
+
return Number.isFinite(num3) ? num3 : void 0;
|
|
56364
56418
|
}
|
|
56365
56419
|
function applyChartGroupOptionsToXml(container, containerLocal, chartData, getLocalName2) {
|
|
56366
56420
|
let changed = false;
|
|
@@ -62417,6 +62471,17 @@ function applyImageAlphaEffects(blip, effects2, parseColor) {
|
|
|
62417
62471
|
);
|
|
62418
62472
|
}
|
|
62419
62473
|
|
|
62474
|
+
// pptx/core/core/runtime/blip-extension-order.ts
|
|
62475
|
+
function keepExtensionListLast(blip) {
|
|
62476
|
+
const key2 = Object.keys(blip).find((candidate) => candidate.split(":").at(-1) === "extLst");
|
|
62477
|
+
if (key2 === void 0) {
|
|
62478
|
+
return;
|
|
62479
|
+
}
|
|
62480
|
+
const value = blip[key2];
|
|
62481
|
+
delete blip[key2];
|
|
62482
|
+
blip[key2] = value;
|
|
62483
|
+
}
|
|
62484
|
+
|
|
62420
62485
|
// pptx/core/core/runtime/image-color-effects.ts
|
|
62421
62486
|
var localName13 = (key2) => key2.split(":").at(-1) ?? key2;
|
|
62422
62487
|
function child16(parent, name) {
|
|
@@ -68917,11 +68982,31 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
|
|
|
68917
68982
|
* default) is correct at depth 0. See `group-xfrm-preservation.ts`'s
|
|
68918
68983
|
* module doc for why a nested group must not re-derive this itself.
|
|
68919
68984
|
*/
|
|
68985
|
+
/**
|
|
68986
|
+
* `PptxHandlerSaveOptions.fixedDate` of the save in progress: set, the save
|
|
68987
|
+
* mints reproducible ids and names (new table columns' `a16:colId`, the
|
|
68988
|
+
* fallback name of a new group) instead of random or time-based ones.
|
|
68989
|
+
*/
|
|
68990
|
+
saveFixedDate;
|
|
68991
|
+
/**
|
|
68992
|
+
* The `p:cNvPr/@name` of a group with neither a name nor one from its
|
|
68993
|
+
* file: its element id, or for a reproducible save (`fixedDate`), which
|
|
68994
|
+
* must not depend on the time-based ids of elements made in code,
|
|
68995
|
+
* `Group <shape id>` as PowerPoint names groups.
|
|
68996
|
+
*/
|
|
68997
|
+
groupFallbackName(group) {
|
|
68998
|
+
return this.saveFixedDate ? `Group ${group.shapeId ?? ""}`.trim() : group.id;
|
|
68999
|
+
}
|
|
68920
69000
|
buildGroupShapeXml(group, ctx, ownEmuOverride) {
|
|
68921
69001
|
if (group.rawXml && group.children.length === 0) {
|
|
68922
69002
|
return {
|
|
68923
69003
|
...group.rawXml,
|
|
68924
|
-
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
69004
|
+
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
69005
|
+
group.rawXml,
|
|
69006
|
+
group.name,
|
|
69007
|
+
this.groupFallbackName(group),
|
|
69008
|
+
group.shapeId
|
|
69009
|
+
)
|
|
68925
69010
|
};
|
|
68926
69011
|
}
|
|
68927
69012
|
const EMU = _PptxHandlerRuntime.EMU_PER_PX;
|
|
@@ -68930,7 +69015,12 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
|
|
|
68930
69015
|
const xfrm = buildGroupTransformXml(group, EMU, ownEmuOverride, rewrap);
|
|
68931
69016
|
const childSpace = group;
|
|
68932
69017
|
const grpXml2 = {
|
|
68933
|
-
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
69018
|
+
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
69019
|
+
rawGroupXml,
|
|
69020
|
+
group.name,
|
|
69021
|
+
this.groupFallbackName(group),
|
|
69022
|
+
group.shapeId
|
|
69023
|
+
),
|
|
68934
69024
|
"p:grpSpPr": buildGroupPropertiesXml(rawGroupXml, xfrm)
|
|
68935
69025
|
};
|
|
68936
69026
|
const rawExtLst = rawGroupXml?.["p:extLst"];
|
|
@@ -69140,6 +69230,7 @@ var PptxHandlerRuntime16 = class extends PptxHandlerRuntime15 {
|
|
|
69140
69230
|
delete blip["a:blur"];
|
|
69141
69231
|
}
|
|
69142
69232
|
applyA14ImageExtension(blip, nextEffects);
|
|
69233
|
+
keepExtensionListLast(blip);
|
|
69143
69234
|
}
|
|
69144
69235
|
normalizePresetGeometry(shapeType) {
|
|
69145
69236
|
return this.elementXmlBuilder.normalizePresetGeometry(shapeType);
|
|
@@ -71738,7 +71829,15 @@ function slideContainsA16Element(node) {
|
|
|
71738
71829
|
function randomColumnId() {
|
|
71739
71830
|
return String(Math.floor(Math.random() * 4294967295));
|
|
71740
71831
|
}
|
|
71741
|
-
function
|
|
71832
|
+
function deterministicColumnId(index) {
|
|
71833
|
+
let hash2 = 2166136261;
|
|
71834
|
+
for (const ch of `a16:colId:${index}`) {
|
|
71835
|
+
hash2 ^= ch.charCodeAt(0);
|
|
71836
|
+
hash2 = Math.imul(hash2, 16777619) >>> 0;
|
|
71837
|
+
}
|
|
71838
|
+
return String(hash2);
|
|
71839
|
+
}
|
|
71840
|
+
function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn, newColumnId = randomColumnId) {
|
|
71742
71841
|
const existingXmlRows = ensureArrayFn(tbl["a:tr"]);
|
|
71743
71842
|
const existingGridCols = ensureArrayFn(
|
|
71744
71843
|
tbl["a:tblGrid"]?.["a:gridCol"]
|
|
@@ -71769,7 +71868,7 @@ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
|
|
|
71769
71868
|
// `ensureA16NamespaceOnSlideRoot`; emitting it here too is
|
|
71770
71869
|
// schema-redundant and PowerPoint flags it.
|
|
71771
71870
|
"a16:colId": {
|
|
71772
|
-
"@_val": existingColIds[i] ||
|
|
71871
|
+
"@_val": existingColIds[i] || newColumnId(i)
|
|
71773
71872
|
}
|
|
71774
71873
|
}
|
|
71775
71874
|
}
|
|
@@ -72020,7 +72119,8 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
72020
72119
|
tbl,
|
|
72021
72120
|
tableData,
|
|
72022
72121
|
_PptxHandlerRuntime.EMU_PER_PX,
|
|
72023
|
-
this.ensureArray.bind(this)
|
|
72122
|
+
this.ensureArray.bind(this),
|
|
72123
|
+
this.saveFixedDate ? deterministicColumnId : void 0
|
|
72024
72124
|
);
|
|
72025
72125
|
const rebuiltRows = this.ensureArray(tbl["a:tr"]);
|
|
72026
72126
|
for (let rIdx = 0; rIdx < tableData.rows.length; rIdx++) {
|
|
@@ -74555,9 +74655,9 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
74555
74655
|
let maxId = 0;
|
|
74556
74656
|
for (const rel of relationships2) {
|
|
74557
74657
|
const id = String(rel?.["@_Id"] || "");
|
|
74558
|
-
const
|
|
74559
|
-
if (Number.isFinite(
|
|
74560
|
-
maxId =
|
|
74658
|
+
const num3 = parseInt(id.replace(/^rId/u, ""), 10);
|
|
74659
|
+
if (Number.isFinite(num3) && num3 > maxId) {
|
|
74660
|
+
maxId = num3;
|
|
74561
74661
|
}
|
|
74562
74662
|
}
|
|
74563
74663
|
const existingFontTargets = /* @__PURE__ */ new Set();
|
|
@@ -74700,9 +74800,9 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
74700
74800
|
let maxId = 0;
|
|
74701
74801
|
for (const rel of relationships2) {
|
|
74702
74802
|
const id = String(rel?.["@_Id"] || "");
|
|
74703
|
-
const
|
|
74704
|
-
if (Number.isFinite(
|
|
74705
|
-
maxId =
|
|
74803
|
+
const num3 = parseInt(id.replace(/^rId/u, ""), 10);
|
|
74804
|
+
if (Number.isFinite(num3) && num3 > maxId) {
|
|
74805
|
+
maxId = num3;
|
|
74706
74806
|
}
|
|
74707
74807
|
}
|
|
74708
74808
|
relationships2.push({
|
|
@@ -79047,6 +79147,16 @@ var PptxHandlerRuntime42 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
|
|
|
79047
79147
|
message: `Slide background image could not be embedded and was preserved as-is or omitted: ${imageUrl.slice(0, 120)}`,
|
|
79048
79148
|
scope: "save",
|
|
79049
79149
|
slideId: slide.id
|
|
79150
|
+
}),
|
|
79151
|
+
buildBackgroundGradientFill: () => {
|
|
79152
|
+
const gradient = slideBackgroundGradientToWrite(slide);
|
|
79153
|
+
return gradient ? this.buildGradientFillXml({ fillMode: "gradient", ...gradient }) : void 0;
|
|
79154
|
+
},
|
|
79155
|
+
reportUnsupportedGradient: () => this.compatibilityService.reportWarning({
|
|
79156
|
+
code: "SAVE_BACKGROUND_GRADIENT_UNSUPPORTED",
|
|
79157
|
+
message: "Slide background gradient has no structured form (backgroundGradientFill) matching its CSS gradient and could not be written; the slide was saved without a background of its own.",
|
|
79158
|
+
scope: "save",
|
|
79159
|
+
slideId: slide.id
|
|
79050
79160
|
})
|
|
79051
79161
|
});
|
|
79052
79162
|
this.slideCommentPartWriter.writeComments({
|
|
@@ -81291,6 +81401,7 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
81291
81401
|
/** One save, with the package to itself; callers go through {@link save}. */
|
|
81292
81402
|
async saveNow(slides, options2) {
|
|
81293
81403
|
validateSlideGeometry(slides);
|
|
81404
|
+
this.saveFixedDate = validFixedDate(options2?.fixedDate);
|
|
81294
81405
|
const templates = [
|
|
81295
81406
|
...options2?.slideMasters ?? [],
|
|
81296
81407
|
...options2?.slideLayouts ?? [],
|
|
@@ -81481,7 +81592,8 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
81481
81592
|
await this.documentPropertiesUpdater.updateOnSave(slides, {
|
|
81482
81593
|
coreProperties: options2?.coreProperties,
|
|
81483
81594
|
appProperties: options2?.appProperties,
|
|
81484
|
-
customProperties: options2?.customProperties
|
|
81595
|
+
customProperties: options2?.customProperties,
|
|
81596
|
+
fixedDate: this.saveFixedDate
|
|
81485
81597
|
});
|
|
81486
81598
|
await this.applyTagCollectionChanges(options2?.tags);
|
|
81487
81599
|
await this.applyNotesMasterChanges(options2?.notesMaster);
|
|
@@ -81525,6 +81637,11 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
81525
81637
|
delete this.zip.files[name];
|
|
81526
81638
|
}
|
|
81527
81639
|
}
|
|
81640
|
+
if (this.saveFixedDate) {
|
|
81641
|
+
for (const file of Object.values(this.zip.files)) {
|
|
81642
|
+
file.date = this.saveFixedDate;
|
|
81643
|
+
}
|
|
81644
|
+
}
|
|
81528
81645
|
return await this.zip.generateAsync({
|
|
81529
81646
|
type: "uint8array",
|
|
81530
81647
|
compression: "DEFLATE",
|
|
@@ -81609,6 +81726,15 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
81609
81726
|
this.zip.file(relsPath2, this.builder.build(relsData));
|
|
81610
81727
|
}
|
|
81611
81728
|
};
|
|
81729
|
+
function validFixedDate(date) {
|
|
81730
|
+
if (date === void 0) {
|
|
81731
|
+
return void 0;
|
|
81732
|
+
}
|
|
81733
|
+
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
81734
|
+
throw new RangeError("PptxHandlerSaveOptions.fixedDate must be a valid Date");
|
|
81735
|
+
}
|
|
81736
|
+
return date;
|
|
81737
|
+
}
|
|
81612
81738
|
|
|
81613
81739
|
// pptx/core/core/runtime/PptxHandlerRuntimeElementParsing.ts
|
|
81614
81740
|
var SPECIAL_PLACEHOLDER_TYPES = /* @__PURE__ */ new Set(["dt", "ftr", "hdr", "sldnum"]);
|
|
@@ -91070,8 +91196,8 @@ function parseNumberVal(node) {
|
|
|
91070
91196
|
if (raw2 === void 0 || raw2 === null || raw2 === "") {
|
|
91071
91197
|
return void 0;
|
|
91072
91198
|
}
|
|
91073
|
-
const
|
|
91074
|
-
return Number.isFinite(
|
|
91199
|
+
const num3 = Number.parseFloat(String(raw2));
|
|
91200
|
+
return Number.isFinite(num3) ? num3 : void 0;
|
|
91075
91201
|
}
|
|
91076
91202
|
var PptxHandlerRuntime93 = class extends PptxHandlerRuntime92 {
|
|
91077
91203
|
/**
|
|
@@ -93538,12 +93664,12 @@ var PptxHandlerRuntime103 = class extends PptxHandlerRuntime102 {
|
|
|
93538
93664
|
* in-memory format schemes of the masters on those parts and, when the deck's part is among
|
|
93539
93665
|
* them, the deck's.
|
|
93540
93666
|
*/
|
|
93541
|
-
async writeFormatScheme(
|
|
93667
|
+
async writeFormatScheme(elementFor, themePaths) {
|
|
93542
93668
|
const deckBefore = this.getThemeFormatScheme();
|
|
93543
93669
|
const replaced = /* @__PURE__ */ new Map();
|
|
93544
93670
|
const schemes = /* @__PURE__ */ new Map();
|
|
93545
93671
|
const written = await this.rewriteThemeParts(themePaths, (data, path3) => {
|
|
93546
|
-
const element2 =
|
|
93672
|
+
const element2 = elementFor(path3);
|
|
93547
93673
|
const elements2 = data["a:theme"]?.["a:themeElements"];
|
|
93548
93674
|
if (!element2 || !elements2) {
|
|
93549
93675
|
return false;
|
|
@@ -93581,7 +93707,7 @@ var PptxHandlerRuntime103 = class extends PptxHandlerRuntime102 {
|
|
|
93581
93707
|
this.themeFormatScheme = deck;
|
|
93582
93708
|
this.heldFormatSchemes.holdParts(
|
|
93583
93709
|
deck,
|
|
93584
|
-
new Map(written.map((path3) => [path3,
|
|
93710
|
+
new Map(written.map((path3) => [path3, elementFor(path3)]))
|
|
93585
93711
|
);
|
|
93586
93712
|
}
|
|
93587
93713
|
return this.getThemeFormatScheme();
|
|
@@ -97641,6 +97767,80 @@ var PptxHandler = class extends PptxHandlerCore {
|
|
|
97641
97767
|
}
|
|
97642
97768
|
};
|
|
97643
97769
|
|
|
97770
|
+
// pptx/core/builders/sdk/background-gradient-input.ts
|
|
97771
|
+
var HEX = /^#?[0-9a-f]{6}$/iu;
|
|
97772
|
+
var PATHS = /* @__PURE__ */ new Set(["circle", "rect", "shape"]);
|
|
97773
|
+
var WHERE = "BackgroundInput";
|
|
97774
|
+
function finite3(name, value, min, max) {
|
|
97775
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
97776
|
+
throw new RangeError(`${WHERE}.${name} must be a finite number, got ${String(value)}`);
|
|
97777
|
+
}
|
|
97778
|
+
if (min !== void 0 && value < min || max !== void 0 && value > max) {
|
|
97779
|
+
throw new RangeError(`${WHERE}.${name} must be between ${min} and ${max}, got ${value}`);
|
|
97780
|
+
}
|
|
97781
|
+
return value;
|
|
97782
|
+
}
|
|
97783
|
+
function stopsOf(input) {
|
|
97784
|
+
if (!Array.isArray(input.stops) || input.stops.length < 2) {
|
|
97785
|
+
throw new RangeError(`${WHERE}.stops needs at least two stops (a:gsLst)`);
|
|
97786
|
+
}
|
|
97787
|
+
return input.stops.map((stop, index) => {
|
|
97788
|
+
if (typeof stop.color !== "string" || !HEX.test(stop.color)) {
|
|
97789
|
+
throw new RangeError(
|
|
97790
|
+
`${WHERE}.stops[${index}].color must be #RRGGBB, got ${String(stop.color)}`
|
|
97791
|
+
);
|
|
97792
|
+
}
|
|
97793
|
+
const position3 = finite3(`stops[${index}].position`, stop.position, 0, 1);
|
|
97794
|
+
const opacity2 = stop.opacity === void 0 ? void 0 : finite3(`stops[${index}].opacity`, stop.opacity, 0, 1);
|
|
97795
|
+
return {
|
|
97796
|
+
color: `#${stop.color.replace("#", "").toUpperCase()}`,
|
|
97797
|
+
// The shape gradient model keeps positions in percent.
|
|
97798
|
+
position: position3 * 100,
|
|
97799
|
+
...opacity2 !== void 0 ? { opacity: opacity2 } : {}
|
|
97800
|
+
};
|
|
97801
|
+
});
|
|
97802
|
+
}
|
|
97803
|
+
function mapBackgroundGradientInput(input) {
|
|
97804
|
+
const fillGradientStops = stopsOf(input);
|
|
97805
|
+
let gradient;
|
|
97806
|
+
if (input.path !== void 0) {
|
|
97807
|
+
if (!PATHS.has(input.path)) {
|
|
97808
|
+
throw new RangeError(
|
|
97809
|
+
`${WHERE}.path must be circle, rect or shape, got ${String(input.path)}`
|
|
97810
|
+
);
|
|
97811
|
+
}
|
|
97812
|
+
if (input.angle !== void 0) {
|
|
97813
|
+
throw new RangeError(`${WHERE}.angle applies to a linear gradient, not a path one`);
|
|
97814
|
+
}
|
|
97815
|
+
const focus = input.focus ?? { l: 0.5, t: 0.5, r: 0.5, b: 0.5 };
|
|
97816
|
+
gradient = {
|
|
97817
|
+
fillGradientType: "radial",
|
|
97818
|
+
fillGradientPathType: input.path,
|
|
97819
|
+
fillGradientStops,
|
|
97820
|
+
fillGradientFillToRect: {
|
|
97821
|
+
l: finite3("focus.l", focus.l),
|
|
97822
|
+
t: finite3("focus.t", focus.t),
|
|
97823
|
+
r: finite3("focus.r", focus.r),
|
|
97824
|
+
b: finite3("focus.b", focus.b)
|
|
97825
|
+
}
|
|
97826
|
+
};
|
|
97827
|
+
} else {
|
|
97828
|
+
if (input.focus !== void 0) {
|
|
97829
|
+
throw new RangeError(`${WHERE}.focus needs a path gradient`);
|
|
97830
|
+
}
|
|
97831
|
+
const cssAngle = finite3("angle", input.angle ?? 180);
|
|
97832
|
+
gradient = {
|
|
97833
|
+
fillGradientType: "linear",
|
|
97834
|
+
fillGradientAngle: cssDegreesToOoxmlGradientAngle(cssAngle),
|
|
97835
|
+
fillGradientStops
|
|
97836
|
+
};
|
|
97837
|
+
}
|
|
97838
|
+
return {
|
|
97839
|
+
backgroundGradient: slideBackgroundGradientCss(gradient),
|
|
97840
|
+
backgroundGradientFill: gradient
|
|
97841
|
+
};
|
|
97842
|
+
}
|
|
97843
|
+
|
|
97644
97844
|
// pptx/core/builders/sdk/chart-gradient-input.ts
|
|
97645
97845
|
var HEX_COLOR2 = /^#?[0-9a-f]{6}$/iu;
|
|
97646
97846
|
var FULL_TURN = 360;
|
|
@@ -97909,6 +98109,48 @@ function applyChartInputLayout(element2, input) {
|
|
|
97909
98109
|
}
|
|
97910
98110
|
}
|
|
97911
98111
|
|
|
98112
|
+
// pptx/core/builders/sdk/picture-effects-input.ts
|
|
98113
|
+
function pictureEffectsFromInput(options2) {
|
|
98114
|
+
const { opacity: opacity2, brightness, contrast } = options2 ?? {};
|
|
98115
|
+
if (opacity2 !== void 0 && !(opacity2 >= 0 && opacity2 <= 1)) {
|
|
98116
|
+
throw new RangeError(`ImageOptions.opacity must be between 0 and 1, got ${opacity2}`);
|
|
98117
|
+
}
|
|
98118
|
+
const patch = {};
|
|
98119
|
+
if (opacity2 !== void 0 && opacity2 < 1) {
|
|
98120
|
+
patch.alpha = opacity2;
|
|
98121
|
+
}
|
|
98122
|
+
if (brightness !== void 0) {
|
|
98123
|
+
patch.brightness = brightness / 100;
|
|
98124
|
+
}
|
|
98125
|
+
if (contrast !== void 0) {
|
|
98126
|
+
patch.contrast = contrast / 100;
|
|
98127
|
+
}
|
|
98128
|
+
if (Object.keys(patch).length === 0) {
|
|
98129
|
+
return void 0;
|
|
98130
|
+
}
|
|
98131
|
+
let patched;
|
|
98132
|
+
try {
|
|
98133
|
+
patched = patchPictureEffects([], patch);
|
|
98134
|
+
} catch (error) {
|
|
98135
|
+
throw new RangeError(
|
|
98136
|
+
`ImageOptions.brightness and contrast must be finite percentages from -100 to 100 (${String(error)})`
|
|
98137
|
+
);
|
|
98138
|
+
}
|
|
98139
|
+
let effects2;
|
|
98140
|
+
for (const effect of patched) {
|
|
98141
|
+
effects2 ??= {};
|
|
98142
|
+
if (effect.kind === "alphaModFix") {
|
|
98143
|
+
effects2.alphaModFix = effect.amount * 100;
|
|
98144
|
+
} else if (effect.kind === "luminance") {
|
|
98145
|
+
effects2.lum = {
|
|
98146
|
+
...effect.brightness !== void 0 ? { bright: effect.brightness * 100 } : {},
|
|
98147
|
+
...effect.contrast !== void 0 ? { contrast: effect.contrast * 100 } : {}
|
|
98148
|
+
};
|
|
98149
|
+
}
|
|
98150
|
+
}
|
|
98151
|
+
return effects2;
|
|
98152
|
+
}
|
|
98153
|
+
|
|
97912
98154
|
// pptx/core/builders/sdk/shape-style-input.ts
|
|
97913
98155
|
var DASH_UNITS_PER_WIDTH = 1e5;
|
|
97914
98156
|
var MITER_UNITS_PER_RATIO = 1e5;
|
|
@@ -98535,12 +98777,13 @@ function createConnectorElement(options2) {
|
|
|
98535
98777
|
function createImageElement(source, options2) {
|
|
98536
98778
|
const p = pos("image", options2);
|
|
98537
98779
|
const isDataUrl = source.startsWith("data:");
|
|
98780
|
+
const imageEffects = pictureEffectsFromInput(options2);
|
|
98538
98781
|
return {
|
|
98539
98782
|
type: "image",
|
|
98540
98783
|
id: generateId("img"),
|
|
98541
98784
|
...p,
|
|
98542
98785
|
rotation: options2?.rotation,
|
|
98543
|
-
|
|
98786
|
+
...imageEffects ? { imageEffects } : {},
|
|
98544
98787
|
imagePath: isDataUrl ? void 0 : source,
|
|
98545
98788
|
imageData: isDataUrl ? source : void 0,
|
|
98546
98789
|
altText: options2?.altText,
|
|
@@ -98812,12 +99055,12 @@ var SlideBuilder = class {
|
|
|
98812
99055
|
switch (bg.type) {
|
|
98813
99056
|
case "solid":
|
|
98814
99057
|
this.slide.backgroundColor = bg.color;
|
|
99058
|
+
delete this.slide.backgroundGradient;
|
|
99059
|
+
delete this.slide.backgroundGradientFill;
|
|
98815
99060
|
break;
|
|
98816
|
-
case "gradient":
|
|
98817
|
-
|
|
98818
|
-
this.slide.backgroundGradient = `linear-gradient(${bg.angle ?? 180}deg, ${stops})`;
|
|
99061
|
+
case "gradient":
|
|
99062
|
+
Object.assign(this.slide, mapBackgroundGradientInput(bg));
|
|
98819
99063
|
break;
|
|
98820
|
-
}
|
|
98821
99064
|
case "image":
|
|
98822
99065
|
this.slide.backgroundImage = bg.source;
|
|
98823
99066
|
break;
|
|
@@ -99072,6 +99315,56 @@ ${phShapes}
|
|
|
99072
99315
|
</p:sldLayout>`;
|
|
99073
99316
|
}
|
|
99074
99317
|
|
|
99318
|
+
// pptx/core/builders/sdk/presentation-app-properties.ts
|
|
99319
|
+
var INPUT_FIELDS = /* @__PURE__ */ new Set([
|
|
99320
|
+
"application",
|
|
99321
|
+
"appVersion",
|
|
99322
|
+
"presentationFormat",
|
|
99323
|
+
"company",
|
|
99324
|
+
"manager",
|
|
99325
|
+
"template"
|
|
99326
|
+
]);
|
|
99327
|
+
var APP_VERSION = /^\d+\.\d{4}$/u;
|
|
99328
|
+
function blankAppXml(slideCount) {
|
|
99329
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
99330
|
+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
|
|
99331
|
+
xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
|
|
99332
|
+
<Application>pptx-viewer-sdk</Application>
|
|
99333
|
+
<Slides>${slideCount}</Slides>
|
|
99334
|
+
<ScaleCrop>false</ScaleCrop>
|
|
99335
|
+
<LinksUpToDate>false</LinksUpToDate>
|
|
99336
|
+
<SharedDoc>false</SharedDoc>
|
|
99337
|
+
<HyperlinksChanged>false</HyperlinksChanged>
|
|
99338
|
+
<AppVersion>1.0000</AppVersion>
|
|
99339
|
+
</Properties>`;
|
|
99340
|
+
}
|
|
99341
|
+
function validate(input) {
|
|
99342
|
+
for (const [field, value] of Object.entries(input)) {
|
|
99343
|
+
if (!INPUT_FIELDS.has(field)) {
|
|
99344
|
+
throw new RangeError(
|
|
99345
|
+
`appProperties.${field} cannot be set when a presentation is created; it takes ${[...INPUT_FIELDS].join(", ")} (counts are computed on save)`
|
|
99346
|
+
);
|
|
99347
|
+
}
|
|
99348
|
+
if (value !== void 0 && typeof value !== "string") {
|
|
99349
|
+
throw new RangeError(`appProperties.${field} must be a string`);
|
|
99350
|
+
}
|
|
99351
|
+
}
|
|
99352
|
+
const version = input.appVersion?.trim();
|
|
99353
|
+
if (version && !APP_VERSION.test(version)) {
|
|
99354
|
+
throw new RangeError(
|
|
99355
|
+
`appProperties.appVersion must be digits, a dot and four digits (e.g. "16.0000"), got "${input.appVersion}"`
|
|
99356
|
+
);
|
|
99357
|
+
}
|
|
99358
|
+
}
|
|
99359
|
+
function newPresentationAppXml(slideCount, input) {
|
|
99360
|
+
const xml = blankAppXml(slideCount);
|
|
99361
|
+
if (input === void 0) {
|
|
99362
|
+
return xml;
|
|
99363
|
+
}
|
|
99364
|
+
validate(input);
|
|
99365
|
+
return writeAppProperties(applyAppOverrides(parseAppProperties(xml), input), xml);
|
|
99366
|
+
}
|
|
99367
|
+
|
|
99075
99368
|
// pptx/core/builders/sdk/standard-layout-placeholders.ts
|
|
99076
99369
|
function standardLayoutPlaceholders(type, width, height) {
|
|
99077
99370
|
if (type === "blank") return [];
|
|
@@ -99429,19 +99722,6 @@ function corePropsXml(title, creator) {
|
|
|
99429
99722
|
<dcterms:modified xsi:type="dcterms:W3CDTF">${now}</dcterms:modified>
|
|
99430
99723
|
</cp:coreProperties>`;
|
|
99431
99724
|
}
|
|
99432
|
-
function appPropsXml(slideCount) {
|
|
99433
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
99434
|
-
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
|
|
99435
|
-
xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
|
|
99436
|
-
<Application>pptx-viewer-sdk</Application>
|
|
99437
|
-
<Slides>${slideCount}</Slides>
|
|
99438
|
-
<ScaleCrop>false</ScaleCrop>
|
|
99439
|
-
<LinksUpToDate>false</LinksUpToDate>
|
|
99440
|
-
<SharedDoc>false</SharedDoc>
|
|
99441
|
-
<HyperlinksChanged>false</HyperlinksChanged>
|
|
99442
|
-
<AppVersion>1.0000</AppVersion>
|
|
99443
|
-
</Properties>`;
|
|
99444
|
-
}
|
|
99445
99725
|
async function buildBlankPresentationArchive(options2) {
|
|
99446
99726
|
const width = options2?.width ?? DEFAULT_WIDTH;
|
|
99447
99727
|
const height = options2?.height ?? DEFAULT_HEIGHT;
|
|
@@ -99483,7 +99763,7 @@ async function buildBlankPresentationArchive(options2) {
|
|
|
99483
99763
|
zip.file("ppt/viewProps.xml", viewPropsXml());
|
|
99484
99764
|
zip.file("ppt/tableStyles.xml", tableStylesXml());
|
|
99485
99765
|
zip.file("docProps/core.xml", corePropsXml(options2?.title, options2?.creator));
|
|
99486
|
-
zip.file("docProps/app.xml",
|
|
99766
|
+
zip.file("docProps/app.xml", newPresentationAppXml(initialSlideCount, options2?.appProperties));
|
|
99487
99767
|
return zip.generateAsync({ type: "arraybuffer" });
|
|
99488
99768
|
}
|
|
99489
99769
|
var PresentationBuilder = class {
|