ooxml-core 1.44.0 → 1.46.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-FZ43IJFP.mjs +5 -0
- package/dist/{PptxHandler-3VAVJDFB.mjs → PptxHandler-HWEOIHEA.mjs} +2 -2
- package/dist/PptxHandler-XAUKKK36.cjs +14 -0
- package/dist/{PresentationBuilder-KHL6GONR.cjs → PresentationBuilder-2BCCMZW7.cjs} +6 -6
- package/dist/{PresentationBuilder-7LJMTRJ6.mjs → PresentationBuilder-66RV4F45.mjs} +2 -2
- package/dist/{PresentationBuilder-PY2GB4IG.mjs → PresentationBuilder-AFD72LIG.mjs} +3 -3
- package/dist/automation/index.cjs +22 -8
- package/dist/automation/index.mjs +22 -8
- package/dist/chart/edit/fill.d.ts +6 -2
- package/dist/chart/edit/fill.d.ts.map +1 -1
- 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 +426 -266
- package/dist/chart/index.mjs +424 -267
- package/dist/{chunk-3J6VIKLP.cjs → chunk-5TOVSCVT.cjs} +3 -3
- package/dist/{chunk-4LEVL6ZW.mjs → chunk-E2TTMUKU.mjs} +681 -142
- package/dist/{chunk-7T3SJQA6.cjs → chunk-E5TGYYKO.cjs} +1 -0
- package/dist/{chunk-VKFKEVHK.mjs → chunk-EI6555OK.mjs} +1 -1
- package/dist/{chunk-R7NS42KQ.mjs → chunk-FKU2Z6ZB.mjs} +1 -1
- package/dist/{chunk-243ZYX2B.mjs → chunk-G6LEU3Y5.mjs} +1 -1
- package/dist/{chunk-JHYU7HGG.mjs → chunk-H43QQVJU.mjs} +1 -1
- package/dist/{chunk-HLYOHD2Z.mjs → chunk-HH3AYM63.mjs} +664 -146
- package/dist/{chunk-RNZQ2OU4.cjs → chunk-IBRV3AK3.cjs} +1930 -1412
- package/dist/{chunk-WEAWSXUX.mjs → chunk-L6MJGE3Q.mjs} +4 -4
- package/dist/{chunk-IPV3J3I5.mjs → chunk-LXVE2VKR.mjs} +4 -1
- package/dist/{chunk-QZPOPUI5.cjs → chunk-QUAFASFC.cjs} +4 -0
- package/dist/{chunk-XTUX5RMG.cjs → chunk-T4BVZTII.cjs} +9 -9
- package/dist/{chunk-KCDLTVUI.mjs → chunk-X2DC7XRL.mjs} +17 -16
- 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 +496 -336
- package/dist/index.mjs +496 -336
- package/dist/pptx/automation/index.cjs +879 -310
- package/dist/pptx/automation/index.d.ts +6 -6
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{elements-PBugbKtv.d.ts → elements-B4Z6N-Gz.d.ts} +4 -477
- package/dist/pptx/chunks/elements-B4Z6N-Gz.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-CCJiD-Bm.d.ts → index-BPGaFlm5.d.ts} +6 -6
- package/dist/pptx/chunks/{index-CCJiD-Bm.d.ts.map → index-BPGaFlm5.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-Bj-hur0D.d.ts → index-D4-WJQ1r.d.ts} +4 -4
- package/dist/pptx/chunks/{index-Bj-hur0D.d.ts.map → index-D4-WJQ1r.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-CGNb1TV9.d.ts → index-DtFoPmk7.d.ts} +108 -10
- package/dist/pptx/chunks/index-DtFoPmk7.d.ts.map +1 -0
- package/dist/pptx/chunks/{table-C7ITXL3Y.d.ts → table-BfgZfw5R.d.ts} +488 -4
- package/dist/pptx/chunks/table-BfgZfw5R.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-BNJr7aGa.d.ts → text-operations-CVHXOSit.d.ts} +19 -4
- package/dist/pptx/chunks/{text-operations-BNJr7aGa.d.ts.map → text-operations-CVHXOSit.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +832 -263
- 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/editor/render/table-layout.d.ts +1 -1
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
- package/dist/pptx/index.cjs +909 -315
- package/dist/pptx/index.d.ts +7 -7
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/xlsx/index.cjs +22 -8
- package/dist/xlsx/index.mjs +22 -8
- package/dist/xlsx/ui/index.cjs +22 -8
- package/dist/xlsx/ui/index.mjs +22 -8
- package/package.json +1 -1
- package/dist/PptxHandler-V23RDNEX.cjs +0 -14
- package/dist/PptxHandler-WB3KL2WH.mjs +0 -5
- package/dist/pptx/chunks/elements-PBugbKtv.d.ts.map +0 -1
- package/dist/pptx/chunks/index-CGNb1TV9.d.ts.map +0 -1
- package/dist/pptx/chunks/table-C7ITXL3Y.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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, formatAutoNumberMarker, readText3DValues, readScene3DValues, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, nextRelationshipId, remapElementShapeIds, normalizeCustomShowIds, mapCustomShowActions, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, parseRelationships, resolvePartPath, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, EMU_PER_PX, 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, hasShapeProperties, ensureXmlChild, hasTextProperties, 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, chartTrendlineType, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, drawingColorXml, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, CAMERA_PRESETS, LIGHT_RIGS, LIGHT_DIRECTIONS, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, reorderObjectKeysByLocalName, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, withDiagramPictureSources, diagramPictureRelationships, 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, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, formatCellAddress, childrenNamed, childNamed, parseCellAddress, attr, parseDrawingEffects, drawingEffectsXml, readChartManualLayoutValues, worksheetData, buildEffectDagTreeFromXml, appendInSchemaOrder, RUN_PROPERTIES_ORDER, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, picturePercentage, ARTISTIC_PRIMARY_ATTRIBUTE, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, readPictureEffect,
|
|
1
|
+
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, formatAutoNumberMarker, readText3DValues, readScene3DValues, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, nextRelationshipId, remapElementShapeIds, normalizeCustomShowIds, mapCustomShowActions, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, parseRelationships, resolvePartPath, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, EMU_PER_PX, 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, hasShapeProperties, ensureXmlChild, hasTextProperties, 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, chartTrendlineType, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, drawingColorXml, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, CAMERA_PRESETS, LIGHT_RIGS, LIGHT_DIRECTIONS, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, reorderObjectKeysByLocalName, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, withDiagramPictureSources, diagramPictureRelationships, 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, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, formatCellAddress, childrenNamed, childNamed, parseCellAddress, attr, parseDrawingEffects, drawingEffectsXml, readChartManualLayoutValues, worksheetData, buildEffectDagTreeFromXml, appendInSchemaOrder, RUN_PROPERTIES_ORDER, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, picturePercentage, ARTISTIC_PRIMARY_ATTRIBUTE, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, readPictureEffect, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, 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, deriveSlideTitles, parseSlideDrawingGuides, slideBackgroundStyleRefFromNode, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, encodeXmlAttributeValue, encodeXmlTextValue, stripXmlOrderMarkers, CHART_ERROR_VALUE_TYPES, CHART_ERROR_BAR_TYPES, CHART_ERROR_BAR_DIRECTIONS, patchDrawingColorIn, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, parsePptxJson, pptxDataFromJsonDocument, applyImportedPptxData, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, escAttr, buildRelationshipsXml, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, effectChild, mergeEffectNode, mergeAttributeEffectNode, parseDrawingLineDash, estimateMediaDurationMs, parseVmlElements, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, IncorrectPasswordError, applyThemeToData, detectFileFormat, parseOle2, decryptPptx, encryptPptx, cssDegreesToOoxmlGradientAngle, escText, parseLineSpacingMultiplier, parseLineSpacingExactPt, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, PML_XMLNS, solidFill, esc, OOXML_PERCENT_UNITS, backgroundStylePreset, isDarkColorMap, backgroundStyleColorMap, reResolveElementsForColorMapChange, findThemeEffectScheme, wrapFormatSchemeXml, effectIsPurelyStyleMatrix, emu, formatSchemeKey, gradFill, loadThemeVariants, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, parseKinsoku, deobfuscateFont, detectFontFormat, parseDataTable, parseChartAxes, parseBubbleChartOptions, extractGuidFromPartName, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, extractCxSeriesColor, parseCxDataLabels, parseCxRegionMapOptions, parseCxAxes, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, chartTrendlineKind, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, decodeBase64, parseSmartArtPresLayoutVars, parseDrawingColorIn, parseSmartArtConnection, connectionLabel, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, captureDiagramPictures, parseDiagramDrawing, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, collectTransitionText, parseSmartArtQuickStyleLabels, parseDiagramQuickStyle, parseDiagramLayoutSummary, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-X2DC7XRL.mjs';
|
|
2
2
|
import { openPptxZip, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, openZip, MAX_ZIP_ENTRY_COUNT, DEFAULT_MAX_UNCOMPRESSED_BYTES, guardZip, ZipBombError } from './chunk-EYCM7RVL.mjs';
|
|
3
3
|
import { resolveSmartArtLayoutCategory } from './chunk-2N7RZQLC.mjs';
|
|
4
4
|
import { cloneXmlObject, applySmartArtLayoutDefinition, cloneSlide, parseSmartArtLayoutDefinition } from './chunk-VDUNZTJC.mjs';
|
|
@@ -494,7 +494,7 @@ function scan(xml) {
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
var escapeText = (text) => text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\r/g, "
");
|
|
497
|
-
var qualifiedName = (xml,
|
|
497
|
+
var qualifiedName = (xml, span2) => /^<([^\s/>]+)/.exec(xml.slice(span2.start, span2.openEnd))?.[1] ?? "";
|
|
498
498
|
var PartPatch = class {
|
|
499
499
|
constructor(xml, rootElement) {
|
|
500
500
|
this.xml = xml;
|
|
@@ -521,9 +521,9 @@ var PartPatch = class {
|
|
|
521
521
|
this.edits.push({ start, end, text, seq: this.seq++ });
|
|
522
522
|
}
|
|
523
523
|
span(element2) {
|
|
524
|
-
const
|
|
525
|
-
if (!
|
|
526
|
-
return
|
|
524
|
+
const span2 = this.spans.get(element2);
|
|
525
|
+
if (!span2) throw new Error("Element is not a child of the patched root");
|
|
526
|
+
return span2;
|
|
527
527
|
}
|
|
528
528
|
/** The prefix bound to `ns` on the root, declaring `preferred` for it when none is. */
|
|
529
529
|
prefix(ns, preferred) {
|
|
@@ -543,20 +543,20 @@ var PartPatch = class {
|
|
|
543
543
|
}
|
|
544
544
|
/** Replaces the element's content, keeping its start tag (and attributes) as written. */
|
|
545
545
|
setContent(element2, content2) {
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
this.add(
|
|
549
|
-
else this.add(
|
|
546
|
+
const span2 = this.span(element2);
|
|
547
|
+
if (span2.selfClosing)
|
|
548
|
+
this.add(span2.openEnd - 2, span2.openEnd, `>${content2}</${qualifiedName(this.xml, span2)}>`);
|
|
549
|
+
else this.add(span2.openEnd, span2.closeStart, content2);
|
|
550
550
|
}
|
|
551
551
|
/** Adds ` name="value"` text to the element's start tag. */
|
|
552
552
|
addAttribute(element2, attribute2) {
|
|
553
|
-
const
|
|
554
|
-
const at =
|
|
553
|
+
const span2 = this.span(element2);
|
|
554
|
+
const at = span2.openEnd - (span2.selfClosing ? 2 : 1);
|
|
555
555
|
this.add(at, at, attribute2);
|
|
556
556
|
}
|
|
557
557
|
remove(element2) {
|
|
558
|
-
const
|
|
559
|
-
this.add(
|
|
558
|
+
const span2 = this.span(element2);
|
|
559
|
+
this.add(span2.start, span2.end, "");
|
|
560
560
|
}
|
|
561
561
|
/** Inserts `markup` before `before`, or as the root's last child. */
|
|
562
562
|
insert(markup, before) {
|
|
@@ -4094,7 +4094,15 @@ var PptxSlideBackgroundBuilder = class {
|
|
|
4094
4094
|
init.reportUnsupportedBackground?.(rawBackgroundImage);
|
|
4095
4095
|
}
|
|
4096
4096
|
}
|
|
4097
|
-
if (backgroundProperties["a:blipFill"] === void 0 &&
|
|
4097
|
+
if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundGradient) {
|
|
4098
|
+
const gradFill2 = init.buildBackgroundGradientFill?.();
|
|
4099
|
+
if (gradFill2) {
|
|
4100
|
+
backgroundProperties["a:gradFill"] = gradFill2;
|
|
4101
|
+
} else if (!hasBackgroundColor && !hasBackgroundImage) {
|
|
4102
|
+
init.reportUnsupportedGradient?.();
|
|
4103
|
+
}
|
|
4104
|
+
}
|
|
4105
|
+
if (backgroundProperties["a:blipFill"] === void 0 && backgroundProperties["a:gradFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
|
|
4098
4106
|
backgroundProperties["a:solidFill"] = {
|
|
4099
4107
|
"a:srgbClr": {
|
|
4100
4108
|
"@_val": init.slide.backgroundColor.replace("#", "").toUpperCase()
|
|
@@ -7018,6 +7026,10 @@ function applyCellFillStyle(cellProperties, style, context, slidePath) {
|
|
|
7018
7026
|
}
|
|
7019
7027
|
return hasStyle;
|
|
7020
7028
|
}
|
|
7029
|
+
function presetDashValue(value) {
|
|
7030
|
+
const text = typeof value === "string" || typeof value === "number" ? String(value) : "";
|
|
7031
|
+
return text ? text : void 0;
|
|
7032
|
+
}
|
|
7021
7033
|
function applyCellBorderStyle(cellProperties, style, context) {
|
|
7022
7034
|
if (!cellProperties) {
|
|
7023
7035
|
return false;
|
|
@@ -7055,13 +7067,13 @@ function applyCellBorderStyle(cellProperties, style, context) {
|
|
|
7055
7067
|
style[`${prefix}Color`] = color2;
|
|
7056
7068
|
hasStyle = true;
|
|
7057
7069
|
}
|
|
7058
|
-
const
|
|
7059
|
-
if (
|
|
7060
|
-
|
|
7061
|
-
if (
|
|
7062
|
-
style[`${prefix}
|
|
7063
|
-
hasStyle = true;
|
|
7070
|
+
const dash = parseDrawingLineDash(node, presetDashValue);
|
|
7071
|
+
if (dash.strokeDash) {
|
|
7072
|
+
style[`${prefix}Dash`] = dash.strokeDash;
|
|
7073
|
+
if (dash.strokeDash === "custom") {
|
|
7074
|
+
style[`${prefix}DashSegments`] = dash.customDashSegments;
|
|
7064
7075
|
}
|
|
7076
|
+
hasStyle = true;
|
|
7065
7077
|
}
|
|
7066
7078
|
}
|
|
7067
7079
|
const firstBorderColor = style.borderTopColor || style.borderBottomColor || style.borderLeftColor || style.borderRightColor;
|
|
@@ -8752,8 +8764,8 @@ function decodeAinkInk(inkRoot) {
|
|
|
8752
8764
|
if (raw2.length === 0) {
|
|
8753
8765
|
return 2;
|
|
8754
8766
|
}
|
|
8755
|
-
const
|
|
8756
|
-
return Number.isFinite(
|
|
8767
|
+
const num3 = Number(raw2);
|
|
8768
|
+
return Number.isFinite(num3) && num3 > 0 ? num3 : 2;
|
|
8757
8769
|
})();
|
|
8758
8770
|
const traces = ensureArrayLike3(inkRoot["aink:trace"]);
|
|
8759
8771
|
for (const trace of traces) {
|
|
@@ -10776,9 +10788,9 @@ async function ensureCustomPropertiesPackagingArtifacts(context) {
|
|
|
10776
10788
|
let maxId = 0;
|
|
10777
10789
|
for (const rel of rels) {
|
|
10778
10790
|
const id = String(rel?.["@_Id"] || "");
|
|
10779
|
-
const
|
|
10780
|
-
if (Number.isFinite(
|
|
10781
|
-
maxId =
|
|
10791
|
+
const num3 = Number.parseInt(id.replace(/^rId/, ""), 10);
|
|
10792
|
+
if (Number.isFinite(num3) && num3 > maxId) {
|
|
10793
|
+
maxId = num3;
|
|
10782
10794
|
}
|
|
10783
10795
|
}
|
|
10784
10796
|
rels.push({
|
|
@@ -10848,11 +10860,11 @@ var PptxDocumentPropertiesUpdater = class {
|
|
|
10848
10860
|
this.context = context;
|
|
10849
10861
|
}
|
|
10850
10862
|
async updateOnSave(slides, options2) {
|
|
10851
|
-
await this.updateCoreProperties(options2?.coreProperties);
|
|
10863
|
+
await this.updateCoreProperties(options2?.coreProperties, options2?.fixedDate);
|
|
10852
10864
|
await this.updateAppProperties(slides, options2?.appProperties);
|
|
10853
10865
|
await this.updateCustomProperties(options2?.customProperties);
|
|
10854
10866
|
}
|
|
10855
|
-
async updateCoreProperties(overrides) {
|
|
10867
|
+
async updateCoreProperties(overrides, fixedDate) {
|
|
10856
10868
|
const coreFile = this.context.zip.file("docProps/core.xml");
|
|
10857
10869
|
if (!coreFile) {
|
|
10858
10870
|
return;
|
|
@@ -10861,7 +10873,12 @@ var PptxDocumentPropertiesUpdater = class {
|
|
|
10861
10873
|
const coreXml = await coreFile.async("string");
|
|
10862
10874
|
const core = applyCoreOverrides(parseCoreProperties(coreXml), overrides);
|
|
10863
10875
|
const revision = Number.parseInt(core.revision?.trim() ?? "", 10);
|
|
10864
|
-
const next = {
|
|
10876
|
+
const next = fixedDate ? {
|
|
10877
|
+
...core,
|
|
10878
|
+
revision: overrides?.revision ?? "1",
|
|
10879
|
+
created: overrides?.created ?? formatW3cdtf(fixedDate),
|
|
10880
|
+
modified: overrides?.modified ?? formatW3cdtf(fixedDate)
|
|
10881
|
+
} : {
|
|
10865
10882
|
...core,
|
|
10866
10883
|
revision: String(Number.isFinite(revision) && revision >= 0 ? revision + 1 : 1),
|
|
10867
10884
|
modified: formatW3cdtf(/* @__PURE__ */ new Date())
|
|
@@ -40481,7 +40498,16 @@ function repaintSeriesForFamily(series, toLine) {
|
|
|
40481
40498
|
shape2.fill = structuredClone(shape2.line.fill);
|
|
40482
40499
|
}
|
|
40483
40500
|
function clearPointPaint(series, key2) {
|
|
40484
|
-
|
|
40501
|
+
const emptied2 = (part) => Object.keys(part).every((name) => name === "sourceXml");
|
|
40502
|
+
for (const point of series.dataPoints) {
|
|
40503
|
+
if (!point.spPr) continue;
|
|
40504
|
+
delete point.spPr[key2];
|
|
40505
|
+
if (point.spPr.line && emptied2(point.spPr.line)) delete point.spPr.line;
|
|
40506
|
+
if (emptied2(point.spPr)) delete point.spPr;
|
|
40507
|
+
}
|
|
40508
|
+
series.dataPoints = series.dataPoints.filter(
|
|
40509
|
+
(point) => Object.keys(point).some((name) => name !== "index")
|
|
40510
|
+
);
|
|
40485
40511
|
}
|
|
40486
40512
|
function setChartSeriesFill(space, index, fill3) {
|
|
40487
40513
|
return editChartSpace(space, (draft) => {
|
|
@@ -40490,7 +40516,7 @@ function setChartSeriesFill(space, index, fill3) {
|
|
|
40490
40516
|
clearPointPaint(series, "fill");
|
|
40491
40517
|
});
|
|
40492
40518
|
}
|
|
40493
|
-
function setChartSeriesColor(space, index, color2) {
|
|
40519
|
+
function setChartSeriesColor(space, index, color2, options2 = {}) {
|
|
40494
40520
|
return editChartSpace(space, (draft) => {
|
|
40495
40521
|
const { series } = chartSeriesEntryAt(draft, index);
|
|
40496
40522
|
const shape2 = series.spPr ??= {};
|
|
@@ -40500,7 +40526,7 @@ function setChartSeriesColor(space, index, color2) {
|
|
|
40500
40526
|
const fill3 = color2 ? { kind: "solid", color: withAlphaOf(color2, previous) } : void 0;
|
|
40501
40527
|
if (line) assignOrDelete(shape2.line ??= {}, "fill", fill3);
|
|
40502
40528
|
else assignOrDelete(shape2, "fill", fill3);
|
|
40503
|
-
clearPointPaint(series, line ? "line" : "fill");
|
|
40529
|
+
if (!options2.keepPointColors) clearPointPaint(series, line ? "line" : "fill");
|
|
40504
40530
|
});
|
|
40505
40531
|
}
|
|
40506
40532
|
|
|
@@ -41792,7 +41818,7 @@ var SWITCHABLE = {
|
|
|
41792
41818
|
stock: false,
|
|
41793
41819
|
surface: true
|
|
41794
41820
|
};
|
|
41795
|
-
function
|
|
41821
|
+
function chartGroupElement(kind, is3D) {
|
|
41796
41822
|
const match = Object.entries(CHART_GROUP_ELEMENTS).find(
|
|
41797
41823
|
([, value]) => value.kind === kind && value.is3D === is3D
|
|
41798
41824
|
);
|
|
@@ -41808,7 +41834,7 @@ function groupingFor(element2, grouping) {
|
|
|
41808
41834
|
var horizontalBars = (group) => group.kind === "bar" && group.barDirection === "bar";
|
|
41809
41835
|
function newGroup(base, target, series) {
|
|
41810
41836
|
const is3D = target.is3D ?? (base.is3D && SWITCHABLE[target.kind] === true);
|
|
41811
|
-
const element2 =
|
|
41837
|
+
const element2 = chartGroupElement(target.kind, is3D);
|
|
41812
41838
|
const group = { kind: target.kind, element: element2, is3D, series, axisIds: [] };
|
|
41813
41839
|
const allowed = GROUP_FIELDS[element2] ?? [];
|
|
41814
41840
|
for (const key2 of allowed)
|
|
@@ -41983,6 +42009,11 @@ var RANGES = {
|
|
|
41983
42009
|
firstSliceAngle: [0, 360],
|
|
41984
42010
|
holeSize: [1, 90]
|
|
41985
42011
|
};
|
|
42012
|
+
function assertChartGroupOption(key2, value) {
|
|
42013
|
+
const [min, max] = RANGES[key2];
|
|
42014
|
+
if (!Number.isInteger(value) || value < min || value > max)
|
|
42015
|
+
throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
|
|
42016
|
+
}
|
|
41986
42017
|
function setChartGroupOptions(space, seriesIndex, edit) {
|
|
41987
42018
|
return editChartSpace(space, (draft) => {
|
|
41988
42019
|
const { group } = chartSeriesEntryAt(draft, seriesIndex);
|
|
@@ -41995,9 +42026,7 @@ function setChartGroupOptions(space, seriesIndex, edit) {
|
|
|
41995
42026
|
delete group[key2];
|
|
41996
42027
|
continue;
|
|
41997
42028
|
}
|
|
41998
|
-
|
|
41999
|
-
if (!Number.isInteger(value) || value < min || value > max)
|
|
42000
|
-
throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
|
|
42029
|
+
assertChartGroupOption(key2, value);
|
|
42001
42030
|
group[key2] = value;
|
|
42002
42031
|
}
|
|
42003
42032
|
});
|
|
@@ -50141,16 +50170,16 @@ function tableToShapeGroup(tableData, bounds) {
|
|
|
50141
50170
|
const y = bounds.y + rowIndex * rowHeightEmu;
|
|
50142
50171
|
let colIndex = 0;
|
|
50143
50172
|
for (const cell2 of row.cells) {
|
|
50144
|
-
const
|
|
50173
|
+
const span2 = Math.max(1, cell2.gridSpan ?? 1);
|
|
50145
50174
|
if (cell2.vMerge) {
|
|
50146
50175
|
vMergeActive[colIndex] = true;
|
|
50147
|
-
colIndex +=
|
|
50176
|
+
colIndex += span2;
|
|
50148
50177
|
continue;
|
|
50149
50178
|
}
|
|
50150
50179
|
vMergeActive[colIndex] = false;
|
|
50151
50180
|
if (!cell2.hMerge) {
|
|
50152
50181
|
const x = colStartX[colIndex] ?? bounds.x;
|
|
50153
|
-
const w = colEmuWidths.slice(colIndex, colIndex +
|
|
50182
|
+
const w = colEmuWidths.slice(colIndex, colIndex + span2).reduce((s, v) => s + v, 0);
|
|
50154
50183
|
children6.push({
|
|
50155
50184
|
kind: "shape",
|
|
50156
50185
|
spt: 1,
|
|
@@ -50164,7 +50193,7 @@ function tableToShapeGroup(tableData, bounds) {
|
|
|
50164
50193
|
text: { textType: 4, paragraphs: cellParagraphs(cell2.text) }
|
|
50165
50194
|
});
|
|
50166
50195
|
}
|
|
50167
|
-
colIndex +=
|
|
50196
|
+
colIndex += span2;
|
|
50168
50197
|
}
|
|
50169
50198
|
});
|
|
50170
50199
|
return { kind: "group", anchor: bounds, children: children6 };
|
|
@@ -54039,6 +54068,43 @@ function applyCommonViewContainer(root, name, props) {
|
|
|
54039
54068
|
root[key2] = container;
|
|
54040
54069
|
}
|
|
54041
54070
|
|
|
54071
|
+
// pptx/core/utils/slide-background-gradient.ts
|
|
54072
|
+
var num2 = (value) => String(Number(value.toFixed(3)));
|
|
54073
|
+
function cssColor(color2, opacity2) {
|
|
54074
|
+
if (opacity2 === void 0 || opacity2 >= 1) {
|
|
54075
|
+
return color2;
|
|
54076
|
+
}
|
|
54077
|
+
const hex3 = color2.replace("#", "");
|
|
54078
|
+
const channel = (index) => Number.parseInt(hex3.slice(index, index + 2), 16);
|
|
54079
|
+
return `rgba(${channel(0)}, ${channel(2)}, ${channel(4)}, ${num2(opacity2)})`;
|
|
54080
|
+
}
|
|
54081
|
+
function slideBackgroundGradientCss(gradient) {
|
|
54082
|
+
const stops = (gradient.fillGradientStops ?? []).map((stop) => `${cssColor(stop.color, stop.opacity)} ${num2(stop.position)}%`).join(", ");
|
|
54083
|
+
if (gradient.fillGradientType !== "radial") {
|
|
54084
|
+
const angle = ooxmlGradientAngleToCssDegrees(gradient.fillGradientAngle ?? 0);
|
|
54085
|
+
return `linear-gradient(${num2(angle)}deg, ${stops})`;
|
|
54086
|
+
}
|
|
54087
|
+
const focus = gradient.fillGradientFillToRect;
|
|
54088
|
+
const cx = focus ? (focus.l + (1 - focus.r)) / 2 * 100 : 50;
|
|
54089
|
+
const cy = focus ? (focus.t + (1 - focus.b)) / 2 * 100 : 50;
|
|
54090
|
+
const at = `at ${num2(cx)}% ${num2(cy)}%`;
|
|
54091
|
+
switch (gradient.fillGradientPathType) {
|
|
54092
|
+
case "rect":
|
|
54093
|
+
return `radial-gradient(${num2(Math.max(cx, 100 - cx))}% ${num2(Math.max(cy, 100 - cy))}% ${at}, ${stops})`;
|
|
54094
|
+
case "shape":
|
|
54095
|
+
return `radial-gradient(farthest-side ${at}, ${stops})`;
|
|
54096
|
+
default:
|
|
54097
|
+
return `radial-gradient(circle ${at}, ${stops})`;
|
|
54098
|
+
}
|
|
54099
|
+
}
|
|
54100
|
+
function slideBackgroundGradientToWrite(slide) {
|
|
54101
|
+
const gradient = slide.backgroundGradientFill;
|
|
54102
|
+
if (!gradient || !slide.backgroundGradient) {
|
|
54103
|
+
return void 0;
|
|
54104
|
+
}
|
|
54105
|
+
return slide.backgroundGradient === slideBackgroundGradientCss(gradient) ? gradient : void 0;
|
|
54106
|
+
}
|
|
54107
|
+
|
|
54042
54108
|
// pptx/core/core/runtime/chart-part-registration.ts
|
|
54043
54109
|
var CHART_GRAPHIC_DATA_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
54044
54110
|
var CHART_EX_GRAPHIC_DATA_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
@@ -55667,8 +55733,8 @@ function authoredValue(node) {
|
|
|
55667
55733
|
return void 0;
|
|
55668
55734
|
}
|
|
55669
55735
|
const raw2 = node["@_val"];
|
|
55670
|
-
const
|
|
55671
|
-
return Number.isFinite(
|
|
55736
|
+
const num3 = raw2 === void 0 || raw2 === null || raw2 === "" ? NaN : Number.parseFloat(String(raw2));
|
|
55737
|
+
return Number.isFinite(num3) ? num3 : void 0;
|
|
55672
55738
|
}
|
|
55673
55739
|
function applyChartGroupOptionsToXml(container, containerLocal, chartData, getLocalName2) {
|
|
55674
55740
|
let changed = false;
|
|
@@ -59878,6 +59944,11 @@ function planNeutralChartChrome(before, probe, edits) {
|
|
|
59878
59944
|
}
|
|
59879
59945
|
|
|
59880
59946
|
// pptx/core/utils/chart-neutral-save-points.ts
|
|
59947
|
+
var emptied = (part) => Object.keys(part).every((key2) => key2 === "sourceXml");
|
|
59948
|
+
function pointShape(shape2) {
|
|
59949
|
+
if (shape2.line && emptied(shape2.line)) delete shape2.line;
|
|
59950
|
+
return emptied(shape2) ? null : shape2;
|
|
59951
|
+
}
|
|
59881
59952
|
function pointEdit(edits, seriesIndex, old, next) {
|
|
59882
59953
|
for (const key2 of ["picture", "impliedPicture", "uniqueId"])
|
|
59883
59954
|
if (!same4(old?.[key2], next[key2])) return false;
|
|
@@ -59900,6 +59971,7 @@ function pointEdit(edits, seriesIndex, old, next) {
|
|
|
59900
59971
|
) ?? null
|
|
59901
59972
|
});
|
|
59902
59973
|
}
|
|
59974
|
+
if (edit.spPr) edit.spPr = pointShape(edit.spPr);
|
|
59903
59975
|
if (!same4(old?.marker, next.marker)) {
|
|
59904
59976
|
if (!next.marker) edit.marker = null;
|
|
59905
59977
|
else {
|
|
@@ -60154,7 +60226,9 @@ function planNeutralChartSeriesColors(before, probe, edits) {
|
|
|
60154
60226
|
const value = series.color?.replace(/^#/, "");
|
|
60155
60227
|
if (value !== void 0 && !/^[\da-f]{6}$/i.test(value)) return;
|
|
60156
60228
|
edits.push(
|
|
60157
|
-
(space) => setChartSeriesColor(space, index, value ? { kind: "srgb", value, transforms: [] } : null
|
|
60229
|
+
(space) => setChartSeriesColor(space, index, value ? { kind: "srgb", value, transforms: [] } : null, {
|
|
60230
|
+
keepPointColors: true
|
|
60231
|
+
})
|
|
60158
60232
|
);
|
|
60159
60233
|
if (previous.color === void 0) delete series.color;
|
|
60160
60234
|
else series.color = previous.color;
|
|
@@ -66925,6 +66999,17 @@ var CHART_GRAPHIC_DATA_URI2 = "http://schemas.openxmlformats.org/drawingml/2006/
|
|
|
66925
66999
|
var CHART_EX_GRAPHIC_DATA_URI2 = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
66926
67000
|
var CHART_NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
66927
67001
|
var CHART_NS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
67002
|
+
function tableGridXml(el, widthEmu) {
|
|
67003
|
+
const fractions = el.tableData?.columnWidths ?? [];
|
|
67004
|
+
if (fractions.length === 0 || !(widthEmu > 0)) {
|
|
67005
|
+
return {};
|
|
67006
|
+
}
|
|
67007
|
+
const widths = fractions.map((fraction) => Math.max(0, Math.round(fraction * widthEmu)));
|
|
67008
|
+
const last = widths.length - 1;
|
|
67009
|
+
widths[last] = Math.max(0, (widths[last] ?? 0) + widthEmu - widths.reduce((a, b) => a + b, 0));
|
|
67010
|
+
const cols = widths.map((w) => ({ "@_w": String(w) }));
|
|
67011
|
+
return { "a:gridCol": cols.length === 1 ? cols[0] : cols };
|
|
67012
|
+
}
|
|
66928
67013
|
function buildTableGraphicFrameXml(el, emuPerPx) {
|
|
66929
67014
|
el.locks = { noGrouping: true, ...el.locks };
|
|
66930
67015
|
const offX = String(Math.round(el.x * emuPerPx));
|
|
@@ -66955,7 +67040,7 @@ function buildTableGraphicFrameXml(el, emuPerPx) {
|
|
|
66955
67040
|
"@_uri": "http://schemas.openxmlformats.org/drawingml/2006/table",
|
|
66956
67041
|
"a:tbl": {
|
|
66957
67042
|
"a:tblPr": tblPr,
|
|
66958
|
-
"a:tblGrid":
|
|
67043
|
+
"a:tblGrid": tableGridXml(el, Number(extCx))
|
|
66959
67044
|
}
|
|
66960
67045
|
}
|
|
66961
67046
|
}
|
|
@@ -67301,11 +67386,31 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
|
|
|
67301
67386
|
* default) is correct at depth 0. See `group-xfrm-preservation.ts`'s
|
|
67302
67387
|
* module doc for why a nested group must not re-derive this itself.
|
|
67303
67388
|
*/
|
|
67389
|
+
/**
|
|
67390
|
+
* `PptxHandlerSaveOptions.fixedDate` of the save in progress: set, the save
|
|
67391
|
+
* mints reproducible ids and names (new table columns' `a16:colId`, the
|
|
67392
|
+
* fallback name of a new group) instead of random or time-based ones.
|
|
67393
|
+
*/
|
|
67394
|
+
saveFixedDate;
|
|
67395
|
+
/**
|
|
67396
|
+
* The `p:cNvPr/@name` of a group with neither a name nor one from its
|
|
67397
|
+
* file: its element id, or for a reproducible save (`fixedDate`), which
|
|
67398
|
+
* must not depend on the time-based ids of elements made in code,
|
|
67399
|
+
* `Group <shape id>` as PowerPoint names groups.
|
|
67400
|
+
*/
|
|
67401
|
+
groupFallbackName(group) {
|
|
67402
|
+
return this.saveFixedDate ? `Group ${group.shapeId ?? ""}`.trim() : group.id;
|
|
67403
|
+
}
|
|
67304
67404
|
buildGroupShapeXml(group, ctx, ownEmuOverride) {
|
|
67305
67405
|
if (group.rawXml && group.children.length === 0) {
|
|
67306
67406
|
return {
|
|
67307
67407
|
...group.rawXml,
|
|
67308
|
-
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
67408
|
+
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
67409
|
+
group.rawXml,
|
|
67410
|
+
group.name,
|
|
67411
|
+
this.groupFallbackName(group),
|
|
67412
|
+
group.shapeId
|
|
67413
|
+
)
|
|
67309
67414
|
};
|
|
67310
67415
|
}
|
|
67311
67416
|
const EMU = _PptxHandlerRuntime.EMU_PER_PX;
|
|
@@ -67314,7 +67419,12 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
|
|
|
67314
67419
|
const xfrm = buildGroupTransformXml(group, EMU, ownEmuOverride, rewrap);
|
|
67315
67420
|
const childSpace = group;
|
|
67316
67421
|
const grpXml2 = {
|
|
67317
|
-
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
67422
|
+
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
67423
|
+
rawGroupXml,
|
|
67424
|
+
group.name,
|
|
67425
|
+
this.groupFallbackName(group),
|
|
67426
|
+
group.shapeId
|
|
67427
|
+
),
|
|
67318
67428
|
"p:grpSpPr": buildGroupPropertiesXml(rawGroupXml, xfrm)
|
|
67319
67429
|
};
|
|
67320
67430
|
const rawExtLst = rawGroupXml?.["p:extLst"];
|
|
@@ -69089,12 +69199,86 @@ var NON_MATERIALIZED_PLACEHOLDER_TYPES = /* @__PURE__ */ new Set([
|
|
|
69089
69199
|
"sldimg"
|
|
69090
69200
|
]);
|
|
69091
69201
|
|
|
69202
|
+
// pptx/core/core/runtime/table-cell-border-save.ts
|
|
69203
|
+
function cellEdges(style) {
|
|
69204
|
+
return [
|
|
69205
|
+
{
|
|
69206
|
+
xmlKey: "a:lnT",
|
|
69207
|
+
width: style.borderTopWidth,
|
|
69208
|
+
color: style.borderTopColor,
|
|
69209
|
+
dash: style.borderTopDash,
|
|
69210
|
+
segments: style.borderTopDashSegments
|
|
69211
|
+
},
|
|
69212
|
+
{
|
|
69213
|
+
xmlKey: "a:lnB",
|
|
69214
|
+
width: style.borderBottomWidth,
|
|
69215
|
+
color: style.borderBottomColor,
|
|
69216
|
+
dash: style.borderBottomDash,
|
|
69217
|
+
segments: style.borderBottomDashSegments
|
|
69218
|
+
},
|
|
69219
|
+
{
|
|
69220
|
+
xmlKey: "a:lnL",
|
|
69221
|
+
width: style.borderLeftWidth,
|
|
69222
|
+
color: style.borderLeftColor,
|
|
69223
|
+
dash: style.borderLeftDash,
|
|
69224
|
+
segments: style.borderLeftDashSegments
|
|
69225
|
+
},
|
|
69226
|
+
{
|
|
69227
|
+
xmlKey: "a:lnR",
|
|
69228
|
+
width: style.borderRightWidth,
|
|
69229
|
+
color: style.borderRightColor,
|
|
69230
|
+
dash: style.borderRightDash,
|
|
69231
|
+
segments: style.borderRightDashSegments
|
|
69232
|
+
}
|
|
69233
|
+
];
|
|
69234
|
+
}
|
|
69235
|
+
function writeEdgeDash(ln, edge) {
|
|
69236
|
+
if (edge.dash === void 0 || edge.dash === "") {
|
|
69237
|
+
return;
|
|
69238
|
+
}
|
|
69239
|
+
if (edge.dash === "solid") {
|
|
69240
|
+
delete ln["a:prstDash"];
|
|
69241
|
+
delete ln["a:custDash"];
|
|
69242
|
+
return;
|
|
69243
|
+
}
|
|
69244
|
+
if (edge.dash === "custom") {
|
|
69245
|
+
if (edge.segments && edge.segments.length > 0) {
|
|
69246
|
+
applyDrawingLineDash(ln, { strokeDash: "custom", customDashSegments: edge.segments });
|
|
69247
|
+
}
|
|
69248
|
+
return;
|
|
69249
|
+
}
|
|
69250
|
+
applyDrawingLineDash(ln, { strokeDash: edge.dash });
|
|
69251
|
+
}
|
|
69252
|
+
function writeCellEdgeBorders(tcPr, style, emuPerPx) {
|
|
69253
|
+
for (const edge of cellEdges(style)) {
|
|
69254
|
+
if (edge.width === void 0 && edge.color === void 0 && edge.dash === void 0) {
|
|
69255
|
+
continue;
|
|
69256
|
+
}
|
|
69257
|
+
const existing = tcPr[edge.xmlKey];
|
|
69258
|
+
const ln = existing && typeof existing === "object" ? existing : {};
|
|
69259
|
+
if (edge.width !== void 0) {
|
|
69260
|
+
ln["@_w"] = String(Math.round(edge.width * emuPerPx));
|
|
69261
|
+
}
|
|
69262
|
+
if (edge.color) {
|
|
69263
|
+
delete ln["a:noFill"];
|
|
69264
|
+
delete ln["a:gradFill"];
|
|
69265
|
+
delete ln["a:pattFill"];
|
|
69266
|
+
ln["a:solidFill"] = {
|
|
69267
|
+
"a:srgbClr": { "@_val": edge.color.replace("#", "") }
|
|
69268
|
+
};
|
|
69269
|
+
}
|
|
69270
|
+
writeEdgeDash(ln, edge);
|
|
69271
|
+
tcPr[edge.xmlKey] = reorderObjectKeys(ln, LN_CHILD_ORDER);
|
|
69272
|
+
}
|
|
69273
|
+
}
|
|
69274
|
+
|
|
69092
69275
|
// pptx/core/core/runtime/table-cell-save-helpers.ts
|
|
69093
69276
|
function writeCellFill(tcPr, style, resolveColorXml) {
|
|
69094
69277
|
if (style.fillMode === "gradient" && style.gradientFillStops && style.gradientFillStops.length > 0) {
|
|
69095
69278
|
delete tcPr["a:solidFill"];
|
|
69096
69279
|
delete tcPr["a:pattFill"];
|
|
69097
69280
|
delete tcPr["a:blipFill"];
|
|
69281
|
+
delete tcPr["a:noFill"];
|
|
69098
69282
|
const stops = style.gradientFillStops.map((stop) => {
|
|
69099
69283
|
const posRaw = typeof stop.position === "number" ? stop.position : 0;
|
|
69100
69284
|
const position3 = Math.round(Math.max(0, Math.min(1, posRaw / 100)) * 1e5);
|
|
@@ -69146,6 +69330,7 @@ function writeCellFill(tcPr, style, resolveColorXml) {
|
|
|
69146
69330
|
delete tcPr["a:solidFill"];
|
|
69147
69331
|
delete tcPr["a:gradFill"];
|
|
69148
69332
|
delete tcPr["a:blipFill"];
|
|
69333
|
+
delete tcPr["a:noFill"];
|
|
69149
69334
|
const pattXml = {
|
|
69150
69335
|
"@_prst": style.patternFillPreset
|
|
69151
69336
|
};
|
|
@@ -69169,10 +69354,12 @@ function writeCellFill(tcPr, style, resolveColorXml) {
|
|
|
69169
69354
|
delete tcPr["a:gradFill"];
|
|
69170
69355
|
delete tcPr["a:pattFill"];
|
|
69171
69356
|
delete tcPr["a:blipFill"];
|
|
69357
|
+
tcPr["a:noFill"] = tcPr["a:noFill"] ?? {};
|
|
69172
69358
|
} else if (style.fillMode !== "image" && style.backgroundColor) {
|
|
69173
69359
|
delete tcPr["a:gradFill"];
|
|
69174
69360
|
delete tcPr["a:pattFill"];
|
|
69175
69361
|
delete tcPr["a:blipFill"];
|
|
69362
|
+
delete tcPr["a:noFill"];
|
|
69176
69363
|
const resolvedOriginal = style.backgroundColorXml && resolveColorXml ? resolveColorXml(style.backgroundColorXml) : void 0;
|
|
69177
69364
|
tcPr["a:solidFill"] = serializeColorChoiceWithRef(
|
|
69178
69365
|
style.backgroundColorRef,
|
|
@@ -69479,53 +69666,7 @@ var PptxHandlerRuntime22 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
69479
69666
|
pPr["@_algn"] = token2;
|
|
69480
69667
|
}
|
|
69481
69668
|
}
|
|
69482
|
-
|
|
69483
|
-
{
|
|
69484
|
-
xmlKey: "a:lnT",
|
|
69485
|
-
width: style.borderTopWidth,
|
|
69486
|
-
color: style.borderTopColor,
|
|
69487
|
-
dash: style.borderTopDash
|
|
69488
|
-
},
|
|
69489
|
-
{
|
|
69490
|
-
xmlKey: "a:lnB",
|
|
69491
|
-
width: style.borderBottomWidth,
|
|
69492
|
-
color: style.borderBottomColor,
|
|
69493
|
-
dash: style.borderBottomDash
|
|
69494
|
-
},
|
|
69495
|
-
{
|
|
69496
|
-
xmlKey: "a:lnL",
|
|
69497
|
-
width: style.borderLeftWidth,
|
|
69498
|
-
color: style.borderLeftColor,
|
|
69499
|
-
dash: style.borderLeftDash
|
|
69500
|
-
},
|
|
69501
|
-
{
|
|
69502
|
-
xmlKey: "a:lnR",
|
|
69503
|
-
width: style.borderRightWidth,
|
|
69504
|
-
color: style.borderRightColor,
|
|
69505
|
-
dash: style.borderRightDash
|
|
69506
|
-
}
|
|
69507
|
-
];
|
|
69508
|
-
for (const edge of borderEdges) {
|
|
69509
|
-
if (edge.width !== void 0 || edge.color !== void 0 || edge.dash !== void 0) {
|
|
69510
|
-
if (!tcPr[edge.xmlKey]) {
|
|
69511
|
-
tcPr[edge.xmlKey] = {};
|
|
69512
|
-
}
|
|
69513
|
-
const ln = tcPr[edge.xmlKey];
|
|
69514
|
-
if (edge.width !== void 0) {
|
|
69515
|
-
ln["@_w"] = String(Math.round(edge.width * _PptxHandlerRuntime.EMU_PER_PX));
|
|
69516
|
-
}
|
|
69517
|
-
if (edge.color) {
|
|
69518
|
-
ln["a:solidFill"] = {
|
|
69519
|
-
"a:srgbClr": { "@_val": edge.color.replace("#", "") }
|
|
69520
|
-
};
|
|
69521
|
-
}
|
|
69522
|
-
if (edge.dash && edge.dash !== "solid") {
|
|
69523
|
-
ln["a:prstDash"] = { "@_val": edge.dash };
|
|
69524
|
-
} else if (edge.dash === "solid") {
|
|
69525
|
-
delete ln["a:prstDash"];
|
|
69526
|
-
}
|
|
69527
|
-
}
|
|
69528
|
-
}
|
|
69669
|
+
writeCellEdgeBorders(tcPr, style, _PptxHandlerRuntime.EMU_PER_PX);
|
|
69529
69670
|
const emuPerPx = _PptxHandlerRuntime.EMU_PER_PX;
|
|
69530
69671
|
if (style.marginLeft !== void 0) {
|
|
69531
69672
|
tcPr["@_marL"] = String(Math.round(style.marginLeft * emuPerPx));
|
|
@@ -69890,10 +70031,13 @@ var FILL_KEYS = [
|
|
|
69890
70031
|
"a:grpFill"
|
|
69891
70032
|
];
|
|
69892
70033
|
var LINE_KEYS = [
|
|
69893
|
-
["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash"]],
|
|
69894
|
-
["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash"]],
|
|
69895
|
-
["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash"]],
|
|
69896
|
-
[
|
|
70034
|
+
["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash", "borderLeftDashSegments"]],
|
|
70035
|
+
["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash", "borderRightDashSegments"]],
|
|
70036
|
+
["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash", "borderTopDashSegments"]],
|
|
70037
|
+
[
|
|
70038
|
+
"a:lnB",
|
|
70039
|
+
["borderBottomWidth", "borderBottomColor", "borderBottomDash", "borderBottomDashSegments"]
|
|
70040
|
+
],
|
|
69897
70041
|
["a:lnTlToBr", ["borderDiagDownWidth", "borderDiagDownColor"]],
|
|
69898
70042
|
["a:lnBlToTr", ["borderDiagUpWidth", "borderDiagUpColor"]]
|
|
69899
70043
|
];
|
|
@@ -70178,7 +70322,15 @@ function slideContainsA16Element(node) {
|
|
|
70178
70322
|
function randomColumnId() {
|
|
70179
70323
|
return String(Math.floor(Math.random() * 4294967295));
|
|
70180
70324
|
}
|
|
70181
|
-
function
|
|
70325
|
+
function deterministicColumnId(index) {
|
|
70326
|
+
let hash2 = 2166136261;
|
|
70327
|
+
for (const ch of `a16:colId:${index}`) {
|
|
70328
|
+
hash2 ^= ch.charCodeAt(0);
|
|
70329
|
+
hash2 = Math.imul(hash2, 16777619) >>> 0;
|
|
70330
|
+
}
|
|
70331
|
+
return String(hash2);
|
|
70332
|
+
}
|
|
70333
|
+
function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn, newColumnId = randomColumnId) {
|
|
70182
70334
|
const existingXmlRows = ensureArrayFn(tbl["a:tr"]);
|
|
70183
70335
|
const existingGridCols = ensureArrayFn(
|
|
70184
70336
|
tbl["a:tblGrid"]?.["a:gridCol"]
|
|
@@ -70209,7 +70361,7 @@ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
|
|
|
70209
70361
|
// `ensureA16NamespaceOnSlideRoot`; emitting it here too is
|
|
70210
70362
|
// schema-redundant and PowerPoint flags it.
|
|
70211
70363
|
"a16:colId": {
|
|
70212
|
-
"@_val": existingColIds[i] ||
|
|
70364
|
+
"@_val": existingColIds[i] || newColumnId(i)
|
|
70213
70365
|
}
|
|
70214
70366
|
}
|
|
70215
70367
|
}
|
|
@@ -70397,8 +70549,8 @@ function cells(row) {
|
|
|
70397
70549
|
return ensureArray11(row["a:tc"]);
|
|
70398
70550
|
}
|
|
70399
70551
|
function promoteTextBody(source, next, removed, survivor, axis) {
|
|
70400
|
-
const
|
|
70401
|
-
if (!source?.text || !next || !removed || !survivor || source.hMerge || source.vMerge || (source[
|
|
70552
|
+
const span2 = axis === "row" ? "rowSpan" : "gridSpan";
|
|
70553
|
+
if (!source?.text || !next || !removed || !survivor || source.hMerge || source.vMerge || (source[span2] ?? 1) <= 1 || next.hMerge || next.vMerge || (next[span2] ?? 1) !== (source[span2] ?? 1) - 1) {
|
|
70402
70554
|
return;
|
|
70403
70555
|
}
|
|
70404
70556
|
if (removed["a:txBody"] !== void 0) {
|
|
@@ -70904,7 +71056,8 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
70904
71056
|
tbl,
|
|
70905
71057
|
tableData,
|
|
70906
71058
|
_PptxHandlerRuntime.EMU_PER_PX,
|
|
70907
|
-
this.ensureArray.bind(this)
|
|
71059
|
+
this.ensureArray.bind(this),
|
|
71060
|
+
this.saveFixedDate ? deterministicColumnId : void 0
|
|
70908
71061
|
);
|
|
70909
71062
|
const rebuiltRows = this.ensureArray(tbl["a:tr"]);
|
|
70910
71063
|
for (let rIdx = 0; rIdx < tableData.rows.length; rIdx++) {
|
|
@@ -73439,9 +73592,9 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
73439
73592
|
let maxId = 0;
|
|
73440
73593
|
for (const rel of relationships2) {
|
|
73441
73594
|
const id = String(rel?.["@_Id"] || "");
|
|
73442
|
-
const
|
|
73443
|
-
if (Number.isFinite(
|
|
73444
|
-
maxId =
|
|
73595
|
+
const num3 = parseInt(id.replace(/^rId/u, ""), 10);
|
|
73596
|
+
if (Number.isFinite(num3) && num3 > maxId) {
|
|
73597
|
+
maxId = num3;
|
|
73445
73598
|
}
|
|
73446
73599
|
}
|
|
73447
73600
|
const existingFontTargets = /* @__PURE__ */ new Set();
|
|
@@ -73584,9 +73737,9 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
73584
73737
|
let maxId = 0;
|
|
73585
73738
|
for (const rel of relationships2) {
|
|
73586
73739
|
const id = String(rel?.["@_Id"] || "");
|
|
73587
|
-
const
|
|
73588
|
-
if (Number.isFinite(
|
|
73589
|
-
maxId =
|
|
73740
|
+
const num3 = parseInt(id.replace(/^rId/u, ""), 10);
|
|
73741
|
+
if (Number.isFinite(num3) && num3 > maxId) {
|
|
73742
|
+
maxId = num3;
|
|
73590
73743
|
}
|
|
73591
73744
|
}
|
|
73592
73745
|
relationships2.push({
|
|
@@ -77931,6 +78084,16 @@ var PptxHandlerRuntime42 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
|
|
|
77931
78084
|
message: `Slide background image could not be embedded and was preserved as-is or omitted: ${imageUrl.slice(0, 120)}`,
|
|
77932
78085
|
scope: "save",
|
|
77933
78086
|
slideId: slide.id
|
|
78087
|
+
}),
|
|
78088
|
+
buildBackgroundGradientFill: () => {
|
|
78089
|
+
const gradient = slideBackgroundGradientToWrite(slide);
|
|
78090
|
+
return gradient ? this.buildGradientFillXml({ fillMode: "gradient", ...gradient }) : void 0;
|
|
78091
|
+
},
|
|
78092
|
+
reportUnsupportedGradient: () => this.compatibilityService.reportWarning({
|
|
78093
|
+
code: "SAVE_BACKGROUND_GRADIENT_UNSUPPORTED",
|
|
78094
|
+
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.",
|
|
78095
|
+
scope: "save",
|
|
78096
|
+
slideId: slide.id
|
|
77934
78097
|
})
|
|
77935
78098
|
});
|
|
77936
78099
|
this.slideCommentPartWriter.writeComments({
|
|
@@ -80175,6 +80338,7 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
80175
80338
|
/** One save, with the package to itself; callers go through {@link save}. */
|
|
80176
80339
|
async saveNow(slides, options2) {
|
|
80177
80340
|
validateSlideGeometry(slides);
|
|
80341
|
+
this.saveFixedDate = validFixedDate(options2?.fixedDate);
|
|
80178
80342
|
const templates = [
|
|
80179
80343
|
...options2?.slideMasters ?? [],
|
|
80180
80344
|
...options2?.slideLayouts ?? [],
|
|
@@ -80365,7 +80529,8 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
80365
80529
|
await this.documentPropertiesUpdater.updateOnSave(slides, {
|
|
80366
80530
|
coreProperties: options2?.coreProperties,
|
|
80367
80531
|
appProperties: options2?.appProperties,
|
|
80368
|
-
customProperties: options2?.customProperties
|
|
80532
|
+
customProperties: options2?.customProperties,
|
|
80533
|
+
fixedDate: this.saveFixedDate
|
|
80369
80534
|
});
|
|
80370
80535
|
await this.applyTagCollectionChanges(options2?.tags);
|
|
80371
80536
|
await this.applyNotesMasterChanges(options2?.notesMaster);
|
|
@@ -80409,6 +80574,11 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
80409
80574
|
delete this.zip.files[name];
|
|
80410
80575
|
}
|
|
80411
80576
|
}
|
|
80577
|
+
if (this.saveFixedDate) {
|
|
80578
|
+
for (const file of Object.values(this.zip.files)) {
|
|
80579
|
+
file.date = this.saveFixedDate;
|
|
80580
|
+
}
|
|
80581
|
+
}
|
|
80412
80582
|
return await this.zip.generateAsync({
|
|
80413
80583
|
type: "uint8array",
|
|
80414
80584
|
compression: "DEFLATE",
|
|
@@ -80493,6 +80663,15 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
80493
80663
|
this.zip.file(relsPath2, this.builder.build(relsData));
|
|
80494
80664
|
}
|
|
80495
80665
|
};
|
|
80666
|
+
function validFixedDate(date) {
|
|
80667
|
+
if (date === void 0) {
|
|
80668
|
+
return void 0;
|
|
80669
|
+
}
|
|
80670
|
+
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
80671
|
+
throw new RangeError("PptxHandlerSaveOptions.fixedDate must be a valid Date");
|
|
80672
|
+
}
|
|
80673
|
+
return date;
|
|
80674
|
+
}
|
|
80496
80675
|
|
|
80497
80676
|
// pptx/core/core/runtime/PptxHandlerRuntimeElementParsing.ts
|
|
80498
80677
|
var SPECIAL_PLACEHOLDER_TYPES = /* @__PURE__ */ new Set(["dt", "ftr", "hdr", "sldnum"]);
|
|
@@ -89949,8 +90128,8 @@ function parseNumberVal(node) {
|
|
|
89949
90128
|
if (raw2 === void 0 || raw2 === null || raw2 === "") {
|
|
89950
90129
|
return void 0;
|
|
89951
90130
|
}
|
|
89952
|
-
const
|
|
89953
|
-
return Number.isFinite(
|
|
90131
|
+
const num3 = Number.parseFloat(String(raw2));
|
|
90132
|
+
return Number.isFinite(num3) ? num3 : void 0;
|
|
89954
90133
|
}
|
|
89955
90134
|
var PptxHandlerRuntime93 = class extends PptxHandlerRuntime92 {
|
|
89956
90135
|
/**
|
|
@@ -92417,12 +92596,12 @@ var PptxHandlerRuntime103 = class extends PptxHandlerRuntime102 {
|
|
|
92417
92596
|
* in-memory format schemes of the masters on those parts and, when the deck's part is among
|
|
92418
92597
|
* them, the deck's.
|
|
92419
92598
|
*/
|
|
92420
|
-
async writeFormatScheme(
|
|
92599
|
+
async writeFormatScheme(elementFor, themePaths) {
|
|
92421
92600
|
const deckBefore = this.getThemeFormatScheme();
|
|
92422
92601
|
const replaced = /* @__PURE__ */ new Map();
|
|
92423
92602
|
const schemes = /* @__PURE__ */ new Map();
|
|
92424
92603
|
const written = await this.rewriteThemeParts(themePaths, (data, path3) => {
|
|
92425
|
-
const element2 =
|
|
92604
|
+
const element2 = elementFor(path3);
|
|
92426
92605
|
const elements2 = data["a:theme"]?.["a:themeElements"];
|
|
92427
92606
|
if (!element2 || !elements2) {
|
|
92428
92607
|
return false;
|
|
@@ -92460,7 +92639,7 @@ var PptxHandlerRuntime103 = class extends PptxHandlerRuntime102 {
|
|
|
92460
92639
|
this.themeFormatScheme = deck;
|
|
92461
92640
|
this.heldFormatSchemes.holdParts(
|
|
92462
92641
|
deck,
|
|
92463
|
-
new Map(written.map((path3) => [path3,
|
|
92642
|
+
new Map(written.map((path3) => [path3, elementFor(path3)]))
|
|
92464
92643
|
);
|
|
92465
92644
|
}
|
|
92466
92645
|
return this.getThemeFormatScheme();
|
|
@@ -96704,6 +96883,80 @@ var PptxHandler = class extends PptxHandlerCore {
|
|
|
96704
96883
|
}
|
|
96705
96884
|
};
|
|
96706
96885
|
|
|
96886
|
+
// pptx/core/builders/sdk/background-gradient-input.ts
|
|
96887
|
+
var HEX = /^#?[0-9a-f]{6}$/iu;
|
|
96888
|
+
var PATHS = /* @__PURE__ */ new Set(["circle", "rect", "shape"]);
|
|
96889
|
+
var WHERE = "BackgroundInput";
|
|
96890
|
+
function finite3(name, value, min, max) {
|
|
96891
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
96892
|
+
throw new RangeError(`${WHERE}.${name} must be a finite number, got ${String(value)}`);
|
|
96893
|
+
}
|
|
96894
|
+
if (min !== void 0 && value < min || max !== void 0 && value > max) {
|
|
96895
|
+
throw new RangeError(`${WHERE}.${name} must be between ${min} and ${max}, got ${value}`);
|
|
96896
|
+
}
|
|
96897
|
+
return value;
|
|
96898
|
+
}
|
|
96899
|
+
function stopsOf(input) {
|
|
96900
|
+
if (!Array.isArray(input.stops) || input.stops.length < 2) {
|
|
96901
|
+
throw new RangeError(`${WHERE}.stops needs at least two stops (a:gsLst)`);
|
|
96902
|
+
}
|
|
96903
|
+
return input.stops.map((stop, index) => {
|
|
96904
|
+
if (typeof stop.color !== "string" || !HEX.test(stop.color)) {
|
|
96905
|
+
throw new RangeError(
|
|
96906
|
+
`${WHERE}.stops[${index}].color must be #RRGGBB, got ${String(stop.color)}`
|
|
96907
|
+
);
|
|
96908
|
+
}
|
|
96909
|
+
const position3 = finite3(`stops[${index}].position`, stop.position, 0, 1);
|
|
96910
|
+
const opacity2 = stop.opacity === void 0 ? void 0 : finite3(`stops[${index}].opacity`, stop.opacity, 0, 1);
|
|
96911
|
+
return {
|
|
96912
|
+
color: `#${stop.color.replace("#", "").toUpperCase()}`,
|
|
96913
|
+
// The shape gradient model keeps positions in percent.
|
|
96914
|
+
position: position3 * 100,
|
|
96915
|
+
...opacity2 !== void 0 ? { opacity: opacity2 } : {}
|
|
96916
|
+
};
|
|
96917
|
+
});
|
|
96918
|
+
}
|
|
96919
|
+
function mapBackgroundGradientInput(input) {
|
|
96920
|
+
const fillGradientStops = stopsOf(input);
|
|
96921
|
+
let gradient;
|
|
96922
|
+
if (input.path !== void 0) {
|
|
96923
|
+
if (!PATHS.has(input.path)) {
|
|
96924
|
+
throw new RangeError(
|
|
96925
|
+
`${WHERE}.path must be circle, rect or shape, got ${String(input.path)}`
|
|
96926
|
+
);
|
|
96927
|
+
}
|
|
96928
|
+
if (input.angle !== void 0) {
|
|
96929
|
+
throw new RangeError(`${WHERE}.angle applies to a linear gradient, not a path one`);
|
|
96930
|
+
}
|
|
96931
|
+
const focus = input.focus ?? { l: 0.5, t: 0.5, r: 0.5, b: 0.5 };
|
|
96932
|
+
gradient = {
|
|
96933
|
+
fillGradientType: "radial",
|
|
96934
|
+
fillGradientPathType: input.path,
|
|
96935
|
+
fillGradientStops,
|
|
96936
|
+
fillGradientFillToRect: {
|
|
96937
|
+
l: finite3("focus.l", focus.l),
|
|
96938
|
+
t: finite3("focus.t", focus.t),
|
|
96939
|
+
r: finite3("focus.r", focus.r),
|
|
96940
|
+
b: finite3("focus.b", focus.b)
|
|
96941
|
+
}
|
|
96942
|
+
};
|
|
96943
|
+
} else {
|
|
96944
|
+
if (input.focus !== void 0) {
|
|
96945
|
+
throw new RangeError(`${WHERE}.focus needs a path gradient`);
|
|
96946
|
+
}
|
|
96947
|
+
const cssAngle = finite3("angle", input.angle ?? 180);
|
|
96948
|
+
gradient = {
|
|
96949
|
+
fillGradientType: "linear",
|
|
96950
|
+
fillGradientAngle: cssDegreesToOoxmlGradientAngle(cssAngle),
|
|
96951
|
+
fillGradientStops
|
|
96952
|
+
};
|
|
96953
|
+
}
|
|
96954
|
+
return {
|
|
96955
|
+
backgroundGradient: slideBackgroundGradientCss(gradient),
|
|
96956
|
+
backgroundGradientFill: gradient
|
|
96957
|
+
};
|
|
96958
|
+
}
|
|
96959
|
+
|
|
96707
96960
|
// pptx/core/builders/sdk/chart-gradient-input.ts
|
|
96708
96961
|
var HEX_COLOR2 = /^#?[0-9a-f]{6}$/iu;
|
|
96709
96962
|
var FULL_TURN = 360;
|
|
@@ -96883,6 +97136,27 @@ function applyChartAreaFormatInput(chartData, area, input) {
|
|
|
96883
97136
|
}
|
|
96884
97137
|
}
|
|
96885
97138
|
|
|
97139
|
+
// pptx/core/builders/sdk/chart-series-point-paint.ts
|
|
97140
|
+
function paintsLine2(data, series) {
|
|
97141
|
+
const type = series.seriesChartType ?? data.chartType;
|
|
97142
|
+
if (type === "radar") return data.radarStyle !== "filled";
|
|
97143
|
+
return isLineDrawnChartType(type);
|
|
97144
|
+
}
|
|
97145
|
+
function clearChartSeriesPointPaint(data, series) {
|
|
97146
|
+
if (!series.dataPoints) return;
|
|
97147
|
+
const line = paintsLine2(data, series);
|
|
97148
|
+
for (const point of series.dataPoints) {
|
|
97149
|
+
if (!line) delete point.gradientFill;
|
|
97150
|
+
if (!point.spPr) continue;
|
|
97151
|
+
const keys = line ? ["strokeColor", "strokeWidth", "strokeDashStyle", "lineNoFill"] : ["fillColor"];
|
|
97152
|
+
for (const key2 of keys) delete point.spPr[key2];
|
|
97153
|
+
if (Object.keys(point.spPr).length === 0) delete point.spPr;
|
|
97154
|
+
}
|
|
97155
|
+
series.dataPoints = series.dataPoints.filter(
|
|
97156
|
+
(point) => Object.entries(point).some(([name, value]) => name !== "idx" && value !== void 0)
|
|
97157
|
+
);
|
|
97158
|
+
}
|
|
97159
|
+
|
|
96886
97160
|
// pptx/core/builders/sdk/chart-operations.ts
|
|
96887
97161
|
function ensureChartData(element2) {
|
|
96888
97162
|
if (!element2.chartData) {
|
|
@@ -97070,6 +97344,7 @@ function setChartSeriesColor2(element2, seriesIndex, color2) {
|
|
|
97070
97344
|
validateSeriesIndex(element2, seriesIndex);
|
|
97071
97345
|
const series = element2.chartData.series[seriesIndex];
|
|
97072
97346
|
Reflect.deleteProperty(series, "gradientFill");
|
|
97347
|
+
clearChartSeriesPointPaint(element2.chartData, series);
|
|
97073
97348
|
if (!color2) {
|
|
97074
97349
|
series.color = void 0;
|
|
97075
97350
|
return;
|
|
@@ -97498,6 +97773,269 @@ function buildShapeStyle(opts) {
|
|
|
97498
97773
|
return Object.keys(parts).length > 0 ? parts : void 0;
|
|
97499
97774
|
}
|
|
97500
97775
|
|
|
97776
|
+
// pptx/core/builders/sdk/table-border-input.ts
|
|
97777
|
+
var MAX_DASH_UNITS = 2147483647;
|
|
97778
|
+
var EDGES = [
|
|
97779
|
+
["top", "borderTop"],
|
|
97780
|
+
["right", "borderRight"],
|
|
97781
|
+
["bottom", "borderBottom"],
|
|
97782
|
+
["left", "borderLeft"]
|
|
97783
|
+
];
|
|
97784
|
+
function borderDashSegments(edge, lengths, width) {
|
|
97785
|
+
const name = `TableCellInput.borders.${edge}.dash`;
|
|
97786
|
+
if (lengths.length === 0) {
|
|
97787
|
+
throw new RangeError(`${name} must give at least one length`);
|
|
97788
|
+
}
|
|
97789
|
+
if (lengths.some((n) => !Number.isFinite(n) || n <= 0)) {
|
|
97790
|
+
throw new RangeError(`${name} lengths must be finite and above 0, got [${lengths.join(", ")}]`);
|
|
97791
|
+
}
|
|
97792
|
+
const segments = customDashSegments([...lengths], width !== void 0 && width > 0 ? width : 1);
|
|
97793
|
+
if (segments.some((s) => s.dash <= 0 || s.space <= 0)) {
|
|
97794
|
+
throw new RangeError(`${name} has a length too short to write: [${lengths.join(", ")}]`);
|
|
97795
|
+
}
|
|
97796
|
+
if (segments.some((s) => s.dash > MAX_DASH_UNITS || s.space > MAX_DASH_UNITS)) {
|
|
97797
|
+
throw new RangeError(`${name} has a length too long to write: [${lengths.join(", ")}]`);
|
|
97798
|
+
}
|
|
97799
|
+
return segments;
|
|
97800
|
+
}
|
|
97801
|
+
function edgeStyle(edge, prefix, input) {
|
|
97802
|
+
if (input.width !== void 0 && (!Number.isFinite(input.width) || input.width < 0)) {
|
|
97803
|
+
throw new RangeError(
|
|
97804
|
+
`TableCellInput.borders.${edge}.width must be a finite width of 0 or more, got ${input.width}`
|
|
97805
|
+
);
|
|
97806
|
+
}
|
|
97807
|
+
const out = {};
|
|
97808
|
+
if (input.width !== void 0) out[`${prefix}Width`] = input.width;
|
|
97809
|
+
if (input.color !== void 0) out[`${prefix}Color`] = input.color;
|
|
97810
|
+
if (Array.isArray(input.dash)) {
|
|
97811
|
+
out[`${prefix}Dash`] = "custom";
|
|
97812
|
+
out[`${prefix}DashSegments`] = borderDashSegments(edge, input.dash, input.width);
|
|
97813
|
+
} else if (input.dash !== void 0) {
|
|
97814
|
+
if (input.dash === "custom") {
|
|
97815
|
+
throw new RangeError(`TableCellInput.borders.${edge}.dash: give 'custom' as a length list`);
|
|
97816
|
+
}
|
|
97817
|
+
out[`${prefix}Dash`] = input.dash;
|
|
97818
|
+
}
|
|
97819
|
+
return out;
|
|
97820
|
+
}
|
|
97821
|
+
function tableCellBorderStyle(borders) {
|
|
97822
|
+
if (!borders) {
|
|
97823
|
+
return {};
|
|
97824
|
+
}
|
|
97825
|
+
const out = {};
|
|
97826
|
+
for (const [edge, prefix] of EDGES) {
|
|
97827
|
+
const own = borders[edge];
|
|
97828
|
+
const input = borders.all || own ? { ...borders.all, ...own } : void 0;
|
|
97829
|
+
if (input) {
|
|
97830
|
+
Object.assign(out, edgeStyle(own ? edge : "all", prefix, input));
|
|
97831
|
+
}
|
|
97832
|
+
}
|
|
97833
|
+
return out;
|
|
97834
|
+
}
|
|
97835
|
+
|
|
97836
|
+
// pptx/core/builders/sdk/table-cell-input.ts
|
|
97837
|
+
function refuseGradientExtras(fill3) {
|
|
97838
|
+
const radial = fill3.path !== void 0 || fill3.gradientType === "radial";
|
|
97839
|
+
const unsupported3 = [
|
|
97840
|
+
fill3.tile !== void 0 ? "tile" : void 0,
|
|
97841
|
+
fill3.scaled === false ? "scaled: false" : void 0,
|
|
97842
|
+
fill3.rotWithShape !== void 0 ? "rotWithShape" : void 0,
|
|
97843
|
+
fill3.focus !== void 0 && !radial ? "focus on a linear gradient" : void 0
|
|
97844
|
+
].filter((name) => name !== void 0);
|
|
97845
|
+
if (unsupported3.length > 0) {
|
|
97846
|
+
throw new RangeError(
|
|
97847
|
+
`TableCellInput.fill: ${unsupported3.join(", ")} cannot be written on a table cell`
|
|
97848
|
+
);
|
|
97849
|
+
}
|
|
97850
|
+
if (fill3.stops.length === 0) {
|
|
97851
|
+
throw new RangeError("TableCellInput.fill: a gradient needs at least one stop");
|
|
97852
|
+
}
|
|
97853
|
+
}
|
|
97854
|
+
function tableCellFillStyle(fill3) {
|
|
97855
|
+
switch (fill3?.type) {
|
|
97856
|
+
case void 0:
|
|
97857
|
+
return {};
|
|
97858
|
+
case "solid":
|
|
97859
|
+
if (fill3.opacity !== void 0 && fill3.opacity !== 1) {
|
|
97860
|
+
throw new RangeError(
|
|
97861
|
+
`TableCellInput.fill.opacity cannot be written on a table cell, got ${fill3.opacity}`
|
|
97862
|
+
);
|
|
97863
|
+
}
|
|
97864
|
+
return {
|
|
97865
|
+
fillMode: "solid",
|
|
97866
|
+
backgroundColor: fill3.color,
|
|
97867
|
+
...fill3.themeColorRef ? { backgroundColorRef: fill3.themeColorRef } : {}
|
|
97868
|
+
};
|
|
97869
|
+
case "gradient": {
|
|
97870
|
+
refuseGradientExtras(fill3);
|
|
97871
|
+
const radial = fill3.path !== void 0 || fill3.gradientType === "radial";
|
|
97872
|
+
return {
|
|
97873
|
+
fillMode: "gradient",
|
|
97874
|
+
gradientFillType: radial ? "radial" : "linear",
|
|
97875
|
+
gradientFillAngle: fill3.angle ?? 0,
|
|
97876
|
+
gradientFillStops: fill3.stops.map((stop) => ({
|
|
97877
|
+
color: stop.color,
|
|
97878
|
+
position: stop.position,
|
|
97879
|
+
...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
|
|
97880
|
+
})),
|
|
97881
|
+
...radial ? { gradientFillPathType: fill3.path ?? "circle" } : {},
|
|
97882
|
+
...fill3.focus ? { gradientFillFillToRect: { ...fill3.focus } } : {}
|
|
97883
|
+
};
|
|
97884
|
+
}
|
|
97885
|
+
case "pattern":
|
|
97886
|
+
if (!fill3.preset) {
|
|
97887
|
+
throw new RangeError("TableCellInput.fill: a pattern fill needs a preset");
|
|
97888
|
+
}
|
|
97889
|
+
return {
|
|
97890
|
+
fillMode: "pattern",
|
|
97891
|
+
patternFillPreset: fill3.preset,
|
|
97892
|
+
...fill3.foreground !== void 0 ? { patternFillForeground: fill3.foreground } : {},
|
|
97893
|
+
...fill3.background !== void 0 ? { patternFillBackground: fill3.background } : {}
|
|
97894
|
+
};
|
|
97895
|
+
case "image":
|
|
97896
|
+
throw new RangeError("TableCellInput.fill: an image fill cannot be written on a table cell");
|
|
97897
|
+
case "none":
|
|
97898
|
+
return { fillMode: "none" };
|
|
97899
|
+
}
|
|
97900
|
+
}
|
|
97901
|
+
function tableCellTextStyle(style) {
|
|
97902
|
+
const out = {};
|
|
97903
|
+
if (style?.fontSize !== void 0) out.fontSize = style.fontSize;
|
|
97904
|
+
if (style?.bold !== void 0) out.bold = style.bold;
|
|
97905
|
+
if (style?.italic !== void 0) out.italic = style.italic;
|
|
97906
|
+
if (style?.color !== void 0) out.color = style.color;
|
|
97907
|
+
if (style?.alignment !== void 0) out.align = style.alignment;
|
|
97908
|
+
return out;
|
|
97909
|
+
}
|
|
97910
|
+
function tableCellStyle(cell2) {
|
|
97911
|
+
const style = {
|
|
97912
|
+
...tableCellTextStyle(cell2.style),
|
|
97913
|
+
...tableCellFillStyle(cell2.fill),
|
|
97914
|
+
...tableCellBorderStyle(cell2.borders)
|
|
97915
|
+
};
|
|
97916
|
+
return cell2.style || Object.keys(style).length > 0 ? style : void 0;
|
|
97917
|
+
}
|
|
97918
|
+
|
|
97919
|
+
// pptx/core/builders/sdk/table-merge-input.ts
|
|
97920
|
+
function span(value, name) {
|
|
97921
|
+
if (value === void 0) {
|
|
97922
|
+
return 1;
|
|
97923
|
+
}
|
|
97924
|
+
if (!Number.isInteger(value) || value < 1) {
|
|
97925
|
+
throw new RangeError(`TableCellInput.${name} must be a whole number from 1, got ${value}`);
|
|
97926
|
+
}
|
|
97927
|
+
return value;
|
|
97928
|
+
}
|
|
97929
|
+
function placeTableCells(input) {
|
|
97930
|
+
const rowCount = input.rows.length;
|
|
97931
|
+
const slots = input.rows.map(() => []);
|
|
97932
|
+
input.rows.forEach((row, ri) => {
|
|
97933
|
+
const rowSlots = slots[ri] ?? [];
|
|
97934
|
+
let ci = 0;
|
|
97935
|
+
for (const cell2 of row.cells) {
|
|
97936
|
+
while (rowSlots[ci]) {
|
|
97937
|
+
ci += 1;
|
|
97938
|
+
}
|
|
97939
|
+
const colSpan = span(cell2.gridSpan, "gridSpan");
|
|
97940
|
+
const rowSpan = span(cell2.rowSpan, "rowSpan");
|
|
97941
|
+
if (ri + rowSpan > rowCount) {
|
|
97942
|
+
throw new RangeError(
|
|
97943
|
+
`A cell in row ${ri} spans ${rowSpan} rows, past the table's ${rowCount} rows`
|
|
97944
|
+
);
|
|
97945
|
+
}
|
|
97946
|
+
for (let dr = 0; dr < rowSpan; dr++) {
|
|
97947
|
+
for (let dc = 0; dc < colSpan; dc++) {
|
|
97948
|
+
const target = slots[ri + dr] ?? [];
|
|
97949
|
+
if (target[ci + dc]) {
|
|
97950
|
+
throw new RangeError(
|
|
97951
|
+
`A cell in row ${ri} overlaps the merge covering row ${ri + dr}, column ${ci + dc}`
|
|
97952
|
+
);
|
|
97953
|
+
}
|
|
97954
|
+
target[ci + dc] = dr === 0 && dc === 0 ? { cell: cell2 } : { hMerge: dc > 0, vMerge: dr > 0 };
|
|
97955
|
+
}
|
|
97956
|
+
}
|
|
97957
|
+
ci += colSpan;
|
|
97958
|
+
}
|
|
97959
|
+
});
|
|
97960
|
+
const widest = Math.max(...slots.map((row) => row.length), 1);
|
|
97961
|
+
const declared = input.columnWidths?.length;
|
|
97962
|
+
if (declared !== void 0 && widest > declared) {
|
|
97963
|
+
throw new RangeError(`A row takes ${widest} columns, but columnWidths gives ${declared}`);
|
|
97964
|
+
}
|
|
97965
|
+
const columnCount = declared ?? widest;
|
|
97966
|
+
return {
|
|
97967
|
+
columnCount,
|
|
97968
|
+
rows: slots.map(
|
|
97969
|
+
(row) => Array.from({ length: columnCount }, (_, ci) => row[ci] ?? { cell: { text: "" } })
|
|
97970
|
+
)
|
|
97971
|
+
};
|
|
97972
|
+
}
|
|
97973
|
+
function columnFractions(columnWidths, columnCount) {
|
|
97974
|
+
if (!columnWidths) {
|
|
97975
|
+
return Array.from({ length: columnCount }, () => 1 / columnCount);
|
|
97976
|
+
}
|
|
97977
|
+
if (columnWidths.length !== columnCount) {
|
|
97978
|
+
throw new RangeError(
|
|
97979
|
+
`columnWidths gives ${columnWidths.length} widths for a table of ${columnCount} columns`
|
|
97980
|
+
);
|
|
97981
|
+
}
|
|
97982
|
+
if (columnWidths.some((w) => !Number.isFinite(w) || w < 0)) {
|
|
97983
|
+
throw new RangeError("columnWidths must be finite widths of 0 or more");
|
|
97984
|
+
}
|
|
97985
|
+
const sum = columnWidths.reduce((a, b) => a + b, 0);
|
|
97986
|
+
if (sum <= 0) {
|
|
97987
|
+
throw new RangeError("columnWidths must not all be 0");
|
|
97988
|
+
}
|
|
97989
|
+
return columnWidths.map((w) => w / sum);
|
|
97990
|
+
}
|
|
97991
|
+
|
|
97992
|
+
// pptx/core/builders/sdk/text-segment-style.ts
|
|
97993
|
+
var RUN_KEYS = [
|
|
97994
|
+
"fontFamily",
|
|
97995
|
+
"fontSize",
|
|
97996
|
+
"bold",
|
|
97997
|
+
"italic",
|
|
97998
|
+
"underline",
|
|
97999
|
+
"strikethrough",
|
|
98000
|
+
"color",
|
|
98001
|
+
"colorRef",
|
|
98002
|
+
"characterSpacing",
|
|
98003
|
+
"hyperlink",
|
|
98004
|
+
"hyperlinkAction",
|
|
98005
|
+
"hyperlinkTargetSlideIndex",
|
|
98006
|
+
"hyperlinkTooltip",
|
|
98007
|
+
"align"
|
|
98008
|
+
];
|
|
98009
|
+
function elementStyleForSegments(textStyle, segments) {
|
|
98010
|
+
const styled = segments.filter((segment) => !segment.isParagraphBreak);
|
|
98011
|
+
const first2 = styled[0]?.style;
|
|
98012
|
+
if (!first2) {
|
|
98013
|
+
return textStyle;
|
|
98014
|
+
}
|
|
98015
|
+
const next = { ...textStyle };
|
|
98016
|
+
for (const key2 of RUN_KEYS) {
|
|
98017
|
+
const value = first2[key2];
|
|
98018
|
+
if (!styled.every((segment) => sameValue2(segment.style?.[key2], value))) {
|
|
98019
|
+
continue;
|
|
98020
|
+
}
|
|
98021
|
+
if (value === void 0) {
|
|
98022
|
+
delete next[key2];
|
|
98023
|
+
} else {
|
|
98024
|
+
next[key2] = value;
|
|
98025
|
+
}
|
|
98026
|
+
}
|
|
98027
|
+
return next;
|
|
98028
|
+
}
|
|
98029
|
+
function sameValue2(a, b) {
|
|
98030
|
+
if (a === b) {
|
|
98031
|
+
return true;
|
|
98032
|
+
}
|
|
98033
|
+
if (a && b && typeof a === "object" && typeof b === "object") {
|
|
98034
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
98035
|
+
}
|
|
98036
|
+
return false;
|
|
98037
|
+
}
|
|
98038
|
+
|
|
97501
98039
|
// pptx/core/builders/sdk/ElementFactory.ts
|
|
97502
98040
|
var idCounter = 0;
|
|
97503
98041
|
function generateId(prefix) {
|
|
@@ -97620,6 +98158,7 @@ function createTextElement(text, options2) {
|
|
|
97620
98158
|
verticalAlignment: options2?.verticalAlignment,
|
|
97621
98159
|
lineSpacing: options2?.lineSpacing
|
|
97622
98160
|
};
|
|
98161
|
+
const textSegments = buildTextSegments(text, textStyleBase);
|
|
97623
98162
|
return {
|
|
97624
98163
|
type: "text",
|
|
97625
98164
|
id: generateId("txt"),
|
|
@@ -97627,8 +98166,8 @@ function createTextElement(text, options2) {
|
|
|
97627
98166
|
rotation: options2?.rotation,
|
|
97628
98167
|
opacity: options2?.opacity,
|
|
97629
98168
|
text: plainText,
|
|
97630
|
-
textStyle: mapTextStyleInput(textStyleBase),
|
|
97631
|
-
textSegments
|
|
98169
|
+
textStyle: elementStyleForSegments(mapTextStyleInput(textStyleBase), textSegments),
|
|
98170
|
+
textSegments,
|
|
97632
98171
|
shapeStyle: buildShapeStyle(effectInputs(options2, options2?.fill))
|
|
97633
98172
|
};
|
|
97634
98173
|
}
|
|
@@ -97708,32 +98247,30 @@ function createImageElement(source, options2) {
|
|
|
97708
98247
|
cropBottom: options2?.cropBottom
|
|
97709
98248
|
};
|
|
97710
98249
|
}
|
|
98250
|
+
function createTableCell(cellInput) {
|
|
98251
|
+
return {
|
|
98252
|
+
text: cellInput.text,
|
|
98253
|
+
gridSpan: cellInput.gridSpan,
|
|
98254
|
+
rowSpan: cellInput.rowSpan,
|
|
98255
|
+
style: tableCellStyle(cellInput)
|
|
98256
|
+
};
|
|
98257
|
+
}
|
|
97711
98258
|
function createTableElement(input, options2) {
|
|
97712
|
-
const
|
|
98259
|
+
const grid = input.fillMergedCells ? placeTableCells(input) : void 0;
|
|
98260
|
+
const numCols = grid?.columnCount ?? Math.max(...input.rows.map((r) => r.cells.length), 1);
|
|
97713
98261
|
const rowHeight = input.rows.length > 0 ? Math.max(30, Math.floor(200 / input.rows.length)) : 30;
|
|
97714
98262
|
const totalHeight = options2?.height ?? Math.max(100, input.rows.length * rowHeight);
|
|
97715
98263
|
const p = pos("table", { ...options2, height: totalHeight });
|
|
97716
|
-
|
|
97717
|
-
|
|
97718
|
-
const sum = input.columnWidths.reduce((a, b) => a + b, 0);
|
|
97719
|
-
colWidths = input.columnWidths.map((w) => w / sum);
|
|
97720
|
-
} else {
|
|
97721
|
-
colWidths = Array(numCols).fill(1 / numCols);
|
|
97722
|
-
}
|
|
97723
|
-
const rows = input.rows.map((rowInput) => ({
|
|
98264
|
+
const colWidths = columnFractions(input.columnWidths, numCols);
|
|
98265
|
+
const rows = input.rows.map((rowInput, ri) => ({
|
|
97724
98266
|
height: rowInput.height ?? rowHeight,
|
|
97725
|
-
cells:
|
|
97726
|
-
|
|
97727
|
-
|
|
97728
|
-
|
|
97729
|
-
|
|
97730
|
-
|
|
97731
|
-
|
|
97732
|
-
italic: cellInput.style.italic,
|
|
97733
|
-
color: cellInput.style.color,
|
|
97734
|
-
align: cellInput.style.alignment
|
|
97735
|
-
} : void 0
|
|
97736
|
-
}))
|
|
98267
|
+
cells: grid ? (grid.rows[ri] ?? []).map(
|
|
98268
|
+
(slot2) => slot2.cell ? createTableCell(slot2.cell) : {
|
|
98269
|
+
text: "",
|
|
98270
|
+
...slot2.hMerge ? { hMerge: true } : {},
|
|
98271
|
+
...slot2.vMerge ? { vMerge: true } : {}
|
|
98272
|
+
}
|
|
98273
|
+
) : rowInput.cells.map(createTableCell)
|
|
97737
98274
|
}));
|
|
97738
98275
|
const tableData = {
|
|
97739
98276
|
rows,
|
|
@@ -97748,7 +98285,9 @@ function createTableElement(input, options2) {
|
|
|
97748
98285
|
// Accent 1 unless the caller picked a style. This is decided at
|
|
97749
98286
|
// creation time so the save pipeline never has to invent a style for
|
|
97750
98287
|
// loaded tables that legitimately have none.
|
|
97751
|
-
|
|
98288
|
+
// `style: 'none'` (or '') opts out, so the cells' own formatting is not
|
|
98289
|
+
// painted over by the theme banding.
|
|
98290
|
+
tableStyleId: input.style === "none" ? void 0 : input.style ?? DEFAULT_POWERPOINT_TABLE_STYLE_ID
|
|
97752
98291
|
};
|
|
97753
98292
|
return {
|
|
97754
98293
|
type: "table",
|
|
@@ -97970,12 +98509,12 @@ var SlideBuilder = class {
|
|
|
97970
98509
|
switch (bg.type) {
|
|
97971
98510
|
case "solid":
|
|
97972
98511
|
this.slide.backgroundColor = bg.color;
|
|
98512
|
+
delete this.slide.backgroundGradient;
|
|
98513
|
+
delete this.slide.backgroundGradientFill;
|
|
97973
98514
|
break;
|
|
97974
|
-
case "gradient":
|
|
97975
|
-
|
|
97976
|
-
this.slide.backgroundGradient = `linear-gradient(${bg.angle ?? 180}deg, ${stops})`;
|
|
98515
|
+
case "gradient":
|
|
98516
|
+
Object.assign(this.slide, mapBackgroundGradientInput(bg));
|
|
97977
98517
|
break;
|
|
97978
|
-
}
|
|
97979
98518
|
case "image":
|
|
97980
98519
|
this.slide.backgroundImage = bg.source;
|
|
97981
98520
|
break;
|