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,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-EI6555OK.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, 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-LXVE2VKR.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",
|
|
@@ -1210,7 +1211,7 @@ function scan(xml) {
|
|
|
1210
1211
|
}
|
|
1211
1212
|
}
|
|
1212
1213
|
var escapeText = (text) => text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\r/g, "
");
|
|
1213
|
-
var qualifiedName = (xml,
|
|
1214
|
+
var qualifiedName = (xml, span2) => /^<([^\s/>]+)/.exec(xml.slice(span2.start, span2.openEnd))?.[1] ?? "";
|
|
1214
1215
|
var PartPatch = class {
|
|
1215
1216
|
constructor(xml, rootElement) {
|
|
1216
1217
|
this.xml = xml;
|
|
@@ -1237,9 +1238,9 @@ var PartPatch = class {
|
|
|
1237
1238
|
this.edits.push({ start, end, text, seq: this.seq++ });
|
|
1238
1239
|
}
|
|
1239
1240
|
span(element2) {
|
|
1240
|
-
const
|
|
1241
|
-
if (!
|
|
1242
|
-
return
|
|
1241
|
+
const span2 = this.spans.get(element2);
|
|
1242
|
+
if (!span2) throw new Error("Element is not a child of the patched root");
|
|
1243
|
+
return span2;
|
|
1243
1244
|
}
|
|
1244
1245
|
/** The prefix bound to `ns` on the root, declaring `preferred` for it when none is. */
|
|
1245
1246
|
prefix(ns, preferred) {
|
|
@@ -1259,20 +1260,20 @@ var PartPatch = class {
|
|
|
1259
1260
|
}
|
|
1260
1261
|
/** Replaces the element's content, keeping its start tag (and attributes) as written. */
|
|
1261
1262
|
setContent(element2, content2) {
|
|
1262
|
-
const
|
|
1263
|
-
if (
|
|
1264
|
-
this.add(
|
|
1265
|
-
else this.add(
|
|
1263
|
+
const span2 = this.span(element2);
|
|
1264
|
+
if (span2.selfClosing)
|
|
1265
|
+
this.add(span2.openEnd - 2, span2.openEnd, `>${content2}</${qualifiedName(this.xml, span2)}>`);
|
|
1266
|
+
else this.add(span2.openEnd, span2.closeStart, content2);
|
|
1266
1267
|
}
|
|
1267
1268
|
/** Adds ` name="value"` text to the element's start tag. */
|
|
1268
1269
|
addAttribute(element2, attribute2) {
|
|
1269
|
-
const
|
|
1270
|
-
const at =
|
|
1270
|
+
const span2 = this.span(element2);
|
|
1271
|
+
const at = span2.openEnd - (span2.selfClosing ? 2 : 1);
|
|
1271
1272
|
this.add(at, at, attribute2);
|
|
1272
1273
|
}
|
|
1273
1274
|
remove(element2) {
|
|
1274
|
-
const
|
|
1275
|
-
this.add(
|
|
1275
|
+
const span2 = this.span(element2);
|
|
1276
|
+
this.add(span2.start, span2.end, "");
|
|
1276
1277
|
}
|
|
1277
1278
|
/** Inserts `markup` before `before`, or as the root's last child. */
|
|
1278
1279
|
insert(markup, before) {
|
|
@@ -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()
|
|
@@ -8106,6 +8115,10 @@ function applyCellFillStyle(cellProperties, style, context, slidePath) {
|
|
|
8106
8115
|
}
|
|
8107
8116
|
return hasStyle;
|
|
8108
8117
|
}
|
|
8118
|
+
function presetDashValue(value) {
|
|
8119
|
+
const text = typeof value === "string" || typeof value === "number" ? String(value) : "";
|
|
8120
|
+
return text ? text : void 0;
|
|
8121
|
+
}
|
|
8109
8122
|
function applyCellBorderStyle(cellProperties, style, context) {
|
|
8110
8123
|
if (!cellProperties) {
|
|
8111
8124
|
return false;
|
|
@@ -8143,13 +8156,13 @@ function applyCellBorderStyle(cellProperties, style, context) {
|
|
|
8143
8156
|
style[`${prefix}Color`] = color3;
|
|
8144
8157
|
hasStyle = true;
|
|
8145
8158
|
}
|
|
8146
|
-
const
|
|
8147
|
-
if (
|
|
8148
|
-
|
|
8149
|
-
if (
|
|
8150
|
-
style[`${prefix}
|
|
8151
|
-
hasStyle = true;
|
|
8159
|
+
const dash = parseDrawingLineDash(node, presetDashValue);
|
|
8160
|
+
if (dash.strokeDash) {
|
|
8161
|
+
style[`${prefix}Dash`] = dash.strokeDash;
|
|
8162
|
+
if (dash.strokeDash === "custom") {
|
|
8163
|
+
style[`${prefix}DashSegments`] = dash.customDashSegments;
|
|
8152
8164
|
}
|
|
8165
|
+
hasStyle = true;
|
|
8153
8166
|
}
|
|
8154
8167
|
}
|
|
8155
8168
|
const firstBorderColor = style.borderTopColor || style.borderBottomColor || style.borderLeftColor || style.borderRightColor;
|
|
@@ -9840,8 +9853,8 @@ function decodeAinkInk(inkRoot) {
|
|
|
9840
9853
|
if (raw2.length === 0) {
|
|
9841
9854
|
return 2;
|
|
9842
9855
|
}
|
|
9843
|
-
const
|
|
9844
|
-
return Number.isFinite(
|
|
9856
|
+
const num3 = Number(raw2);
|
|
9857
|
+
return Number.isFinite(num3) && num3 > 0 ? num3 : 2;
|
|
9845
9858
|
})();
|
|
9846
9859
|
const traces = ensureArrayLike3(inkRoot["aink:trace"]);
|
|
9847
9860
|
for (const trace of traces) {
|
|
@@ -11864,9 +11877,9 @@ async function ensureCustomPropertiesPackagingArtifacts(context) {
|
|
|
11864
11877
|
let maxId = 0;
|
|
11865
11878
|
for (const rel of rels) {
|
|
11866
11879
|
const id = String(rel?.["@_Id"] || "");
|
|
11867
|
-
const
|
|
11868
|
-
if (Number.isFinite(
|
|
11869
|
-
maxId =
|
|
11880
|
+
const num3 = Number.parseInt(id.replace(/^rId/, ""), 10);
|
|
11881
|
+
if (Number.isFinite(num3) && num3 > maxId) {
|
|
11882
|
+
maxId = num3;
|
|
11870
11883
|
}
|
|
11871
11884
|
}
|
|
11872
11885
|
rels.push({
|
|
@@ -11936,11 +11949,11 @@ var PptxDocumentPropertiesUpdater = class {
|
|
|
11936
11949
|
this.context = context;
|
|
11937
11950
|
}
|
|
11938
11951
|
async updateOnSave(slides, options2) {
|
|
11939
|
-
await this.updateCoreProperties(options2?.coreProperties);
|
|
11952
|
+
await this.updateCoreProperties(options2?.coreProperties, options2?.fixedDate);
|
|
11940
11953
|
await this.updateAppProperties(slides, options2?.appProperties);
|
|
11941
11954
|
await this.updateCustomProperties(options2?.customProperties);
|
|
11942
11955
|
}
|
|
11943
|
-
async updateCoreProperties(overrides) {
|
|
11956
|
+
async updateCoreProperties(overrides, fixedDate) {
|
|
11944
11957
|
const coreFile = this.context.zip.file("docProps/core.xml");
|
|
11945
11958
|
if (!coreFile) {
|
|
11946
11959
|
return;
|
|
@@ -11949,7 +11962,12 @@ var PptxDocumentPropertiesUpdater = class {
|
|
|
11949
11962
|
const coreXml = await coreFile.async("string");
|
|
11950
11963
|
const core = applyCoreOverrides(parseCoreProperties(coreXml), overrides);
|
|
11951
11964
|
const revision = Number.parseInt(core.revision?.trim() ?? "", 10);
|
|
11952
|
-
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
|
+
} : {
|
|
11953
11971
|
...core,
|
|
11954
11972
|
revision: String(Number.isFinite(revision) && revision >= 0 ? revision + 1 : 1),
|
|
11955
11973
|
modified: formatW3cdtf(/* @__PURE__ */ new Date())
|
|
@@ -41160,7 +41178,16 @@ function repaintSeriesForFamily(series, toLine) {
|
|
|
41160
41178
|
shape2.fill = structuredClone(shape2.line.fill);
|
|
41161
41179
|
}
|
|
41162
41180
|
function clearPointPaint(series, key2) {
|
|
41163
|
-
|
|
41181
|
+
const emptied2 = (part) => Object.keys(part).every((name) => name === "sourceXml");
|
|
41182
|
+
for (const point of series.dataPoints) {
|
|
41183
|
+
if (!point.spPr) continue;
|
|
41184
|
+
delete point.spPr[key2];
|
|
41185
|
+
if (point.spPr.line && emptied2(point.spPr.line)) delete point.spPr.line;
|
|
41186
|
+
if (emptied2(point.spPr)) delete point.spPr;
|
|
41187
|
+
}
|
|
41188
|
+
series.dataPoints = series.dataPoints.filter(
|
|
41189
|
+
(point) => Object.keys(point).some((name) => name !== "index")
|
|
41190
|
+
);
|
|
41164
41191
|
}
|
|
41165
41192
|
function setChartSeriesFill(space, index, fill3) {
|
|
41166
41193
|
return editChartSpace(space, (draft) => {
|
|
@@ -41169,7 +41196,7 @@ function setChartSeriesFill(space, index, fill3) {
|
|
|
41169
41196
|
clearPointPaint(series, "fill");
|
|
41170
41197
|
});
|
|
41171
41198
|
}
|
|
41172
|
-
function setChartSeriesColor(space, index, color3) {
|
|
41199
|
+
function setChartSeriesColor(space, index, color3, options2 = {}) {
|
|
41173
41200
|
return editChartSpace(space, (draft) => {
|
|
41174
41201
|
const { series } = chartSeriesEntryAt(draft, index);
|
|
41175
41202
|
const shape2 = series.spPr ??= {};
|
|
@@ -41179,7 +41206,7 @@ function setChartSeriesColor(space, index, color3) {
|
|
|
41179
41206
|
const fill3 = color3 ? { kind: "solid", color: withAlphaOf(color3, previous) } : void 0;
|
|
41180
41207
|
if (line) assignOrDelete(shape2.line ??= {}, "fill", fill3);
|
|
41181
41208
|
else assignOrDelete(shape2, "fill", fill3);
|
|
41182
|
-
clearPointPaint(series, line ? "line" : "fill");
|
|
41209
|
+
if (!options2.keepPointColors) clearPointPaint(series, line ? "line" : "fill");
|
|
41183
41210
|
});
|
|
41184
41211
|
}
|
|
41185
41212
|
|
|
@@ -42471,7 +42498,7 @@ var SWITCHABLE = {
|
|
|
42471
42498
|
stock: false,
|
|
42472
42499
|
surface: true
|
|
42473
42500
|
};
|
|
42474
|
-
function
|
|
42501
|
+
function chartGroupElement(kind, is3D) {
|
|
42475
42502
|
const match = Object.entries(CHART_GROUP_ELEMENTS).find(
|
|
42476
42503
|
([, value]) => value.kind === kind && value.is3D === is3D
|
|
42477
42504
|
);
|
|
@@ -42487,7 +42514,7 @@ function groupingFor(element2, grouping) {
|
|
|
42487
42514
|
var horizontalBars = (group) => group.kind === "bar" && group.barDirection === "bar";
|
|
42488
42515
|
function newGroup(base, target, series) {
|
|
42489
42516
|
const is3D = target.is3D ?? (base.is3D && SWITCHABLE[target.kind] === true);
|
|
42490
|
-
const element2 =
|
|
42517
|
+
const element2 = chartGroupElement(target.kind, is3D);
|
|
42491
42518
|
const group = { kind: target.kind, element: element2, is3D, series, axisIds: [] };
|
|
42492
42519
|
const allowed = GROUP_FIELDS[element2] ?? [];
|
|
42493
42520
|
for (const key2 of allowed)
|
|
@@ -42662,6 +42689,11 @@ var RANGES = {
|
|
|
42662
42689
|
firstSliceAngle: [0, 360],
|
|
42663
42690
|
holeSize: [1, 90]
|
|
42664
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
|
+
}
|
|
42665
42697
|
function setChartGroupOptions(space, seriesIndex, edit) {
|
|
42666
42698
|
return editChartSpace(space, (draft) => {
|
|
42667
42699
|
const { group } = chartSeriesEntryAt(draft, seriesIndex);
|
|
@@ -42674,9 +42706,7 @@ function setChartGroupOptions(space, seriesIndex, edit) {
|
|
|
42674
42706
|
delete group[key2];
|
|
42675
42707
|
continue;
|
|
42676
42708
|
}
|
|
42677
|
-
|
|
42678
|
-
if (!Number.isInteger(value) || value < min || value > max)
|
|
42679
|
-
throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
|
|
42709
|
+
assertChartGroupOption(key2, value);
|
|
42680
42710
|
group[key2] = value;
|
|
42681
42711
|
}
|
|
42682
42712
|
});
|
|
@@ -50820,16 +50850,16 @@ function tableToShapeGroup(tableData, bounds) {
|
|
|
50820
50850
|
const y = bounds.y + rowIndex * rowHeightEmu;
|
|
50821
50851
|
let colIndex = 0;
|
|
50822
50852
|
for (const cell2 of row.cells) {
|
|
50823
|
-
const
|
|
50853
|
+
const span2 = Math.max(1, cell2.gridSpan ?? 1);
|
|
50824
50854
|
if (cell2.vMerge) {
|
|
50825
50855
|
vMergeActive[colIndex] = true;
|
|
50826
|
-
colIndex +=
|
|
50856
|
+
colIndex += span2;
|
|
50827
50857
|
continue;
|
|
50828
50858
|
}
|
|
50829
50859
|
vMergeActive[colIndex] = false;
|
|
50830
50860
|
if (!cell2.hMerge) {
|
|
50831
50861
|
const x = colStartX[colIndex] ?? bounds.x;
|
|
50832
|
-
const w = colEmuWidths.slice(colIndex, colIndex +
|
|
50862
|
+
const w = colEmuWidths.slice(colIndex, colIndex + span2).reduce((s, v) => s + v, 0);
|
|
50833
50863
|
children6.push({
|
|
50834
50864
|
kind: "shape",
|
|
50835
50865
|
spt: 1,
|
|
@@ -50843,7 +50873,7 @@ function tableToShapeGroup(tableData, bounds) {
|
|
|
50843
50873
|
text: { textType: 4, paragraphs: cellParagraphs(cell2.text) }
|
|
50844
50874
|
});
|
|
50845
50875
|
}
|
|
50846
|
-
colIndex +=
|
|
50876
|
+
colIndex += span2;
|
|
50847
50877
|
}
|
|
50848
50878
|
});
|
|
50849
50879
|
return { kind: "group", anchor: bounds, children: children6 };
|
|
@@ -54718,6 +54748,43 @@ function applyCommonViewContainer(root, name, props) {
|
|
|
54718
54748
|
root[key2] = container;
|
|
54719
54749
|
}
|
|
54720
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
|
+
|
|
54721
54788
|
// pptx/core/core/runtime/chart-part-registration.ts
|
|
54722
54789
|
var CHART_GRAPHIC_DATA_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
54723
54790
|
var CHART_EX_GRAPHIC_DATA_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
@@ -56346,8 +56413,8 @@ function authoredValue(node) {
|
|
|
56346
56413
|
return void 0;
|
|
56347
56414
|
}
|
|
56348
56415
|
const raw2 = node["@_val"];
|
|
56349
|
-
const
|
|
56350
|
-
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;
|
|
56351
56418
|
}
|
|
56352
56419
|
function applyChartGroupOptionsToXml(container, containerLocal, chartData, getLocalName2) {
|
|
56353
56420
|
let changed = false;
|
|
@@ -60539,6 +60606,11 @@ function planNeutralChartChrome(before, probe, edits) {
|
|
|
60539
60606
|
}
|
|
60540
60607
|
|
|
60541
60608
|
// pptx/core/utils/chart-neutral-save-points.ts
|
|
60609
|
+
var emptied = (part) => Object.keys(part).every((key2) => key2 === "sourceXml");
|
|
60610
|
+
function pointShape(shape2) {
|
|
60611
|
+
if (shape2.line && emptied(shape2.line)) delete shape2.line;
|
|
60612
|
+
return emptied(shape2) ? null : shape2;
|
|
60613
|
+
}
|
|
60542
60614
|
function pointEdit(edits, seriesIndex, old, next) {
|
|
60543
60615
|
for (const key2 of ["picture", "impliedPicture", "uniqueId"])
|
|
60544
60616
|
if (!same4(old?.[key2], next[key2])) return false;
|
|
@@ -60561,6 +60633,7 @@ function pointEdit(edits, seriesIndex, old, next) {
|
|
|
60561
60633
|
) ?? null
|
|
60562
60634
|
});
|
|
60563
60635
|
}
|
|
60636
|
+
if (edit.spPr) edit.spPr = pointShape(edit.spPr);
|
|
60564
60637
|
if (!same4(old?.marker, next.marker)) {
|
|
60565
60638
|
if (!next.marker) edit.marker = null;
|
|
60566
60639
|
else {
|
|
@@ -60815,7 +60888,9 @@ function planNeutralChartSeriesColors(before, probe, edits) {
|
|
|
60815
60888
|
const value = series.color?.replace(/^#/, "");
|
|
60816
60889
|
if (value !== void 0 && !/^[\da-f]{6}$/i.test(value)) return;
|
|
60817
60890
|
edits.push(
|
|
60818
|
-
(space) => setChartSeriesColor(space, index, value ? { kind: "srgb", value, transforms: [] } : null
|
|
60891
|
+
(space) => setChartSeriesColor(space, index, value ? { kind: "srgb", value, transforms: [] } : null, {
|
|
60892
|
+
keepPointColors: true
|
|
60893
|
+
})
|
|
60819
60894
|
);
|
|
60820
60895
|
if (previous.color === void 0) delete series.color;
|
|
60821
60896
|
else series.color = previous.color;
|
|
@@ -63665,8 +63740,8 @@ function renderBars(element2, x, y, w, h) {
|
|
|
63665
63740
|
const values = chartValues(element2);
|
|
63666
63741
|
const min = Math.min(0, ...values);
|
|
63667
63742
|
const max = Math.max(0, ...values);
|
|
63668
|
-
const
|
|
63669
|
-
const zeroY = y + max /
|
|
63743
|
+
const span2 = max - min || 1;
|
|
63744
|
+
const zeroY = y + max / span2 * h;
|
|
63670
63745
|
const categoryCount = Math.max(
|
|
63671
63746
|
data.categories.length,
|
|
63672
63747
|
...data.series.map((s) => s.values.length),
|
|
@@ -63677,7 +63752,7 @@ function renderBars(element2, x, y, w, h) {
|
|
|
63677
63752
|
const parts = [`<line x1="${x}" y1="${zeroY}" x2="${x + w}" y2="${zeroY}" stroke="#666666" />`];
|
|
63678
63753
|
data.series.forEach((series, seriesIndex) => {
|
|
63679
63754
|
series.values.forEach((value, categoryIndex) => {
|
|
63680
|
-
const valueY = y + (max - value) /
|
|
63755
|
+
const valueY = y + (max - value) / span2 * h;
|
|
63681
63756
|
parts.push(
|
|
63682
63757
|
`<rect data-chart-mark="bar" x="${x + categoryIndex * clusterWidth + clusterWidth * 0.14 + seriesIndex * barWidth}" y="${Math.min(valueY, zeroY)}" width="${Math.max(barWidth - 1, 1)}" height="${Math.max(Math.abs(zeroY - valueY), 0.5)}" fill="${esc3(color2(series, seriesIndex))}" />`
|
|
63683
63758
|
);
|
|
@@ -63690,10 +63765,10 @@ function renderLines(element2, x, y, w, h) {
|
|
|
63690
63765
|
const values = chartValues(element2);
|
|
63691
63766
|
const min = Math.min(...values);
|
|
63692
63767
|
const max = Math.max(...values);
|
|
63693
|
-
const
|
|
63768
|
+
const span2 = max - min || 1;
|
|
63694
63769
|
return data.series.map((series, seriesIndex) => {
|
|
63695
63770
|
const denominator = Math.max(series.values.length - 1, 1);
|
|
63696
|
-
const points7 = series.values.map((value, index) => `${x + index / denominator * w},${y + (max - value) /
|
|
63771
|
+
const points7 = series.values.map((value, index) => `${x + index / denominator * w},${y + (max - value) / span2 * h}`).join(" ");
|
|
63697
63772
|
return `<polyline data-chart-mark="line" points="${points7}" fill="none" stroke="${esc3(color2(series, seriesIndex))}" stroke-width="2" />`;
|
|
63698
63773
|
}).join("");
|
|
63699
63774
|
}
|
|
@@ -68509,6 +68584,17 @@ var CHART_GRAPHIC_DATA_URI2 = "http://schemas.openxmlformats.org/drawingml/2006/
|
|
|
68509
68584
|
var CHART_EX_GRAPHIC_DATA_URI2 = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
68510
68585
|
var CHART_NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
68511
68586
|
var CHART_NS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
68587
|
+
function tableGridXml(el, widthEmu) {
|
|
68588
|
+
const fractions = el.tableData?.columnWidths ?? [];
|
|
68589
|
+
if (fractions.length === 0 || !(widthEmu > 0)) {
|
|
68590
|
+
return {};
|
|
68591
|
+
}
|
|
68592
|
+
const widths = fractions.map((fraction) => Math.max(0, Math.round(fraction * widthEmu)));
|
|
68593
|
+
const last = widths.length - 1;
|
|
68594
|
+
widths[last] = Math.max(0, (widths[last] ?? 0) + widthEmu - widths.reduce((a, b) => a + b, 0));
|
|
68595
|
+
const cols = widths.map((w) => ({ "@_w": String(w) }));
|
|
68596
|
+
return { "a:gridCol": cols.length === 1 ? cols[0] : cols };
|
|
68597
|
+
}
|
|
68512
68598
|
function buildTableGraphicFrameXml(el, emuPerPx) {
|
|
68513
68599
|
el.locks = { noGrouping: true, ...el.locks };
|
|
68514
68600
|
const offX = String(Math.round(el.x * emuPerPx));
|
|
@@ -68539,7 +68625,7 @@ function buildTableGraphicFrameXml(el, emuPerPx) {
|
|
|
68539
68625
|
"@_uri": "http://schemas.openxmlformats.org/drawingml/2006/table",
|
|
68540
68626
|
"a:tbl": {
|
|
68541
68627
|
"a:tblPr": tblPr,
|
|
68542
|
-
"a:tblGrid":
|
|
68628
|
+
"a:tblGrid": tableGridXml(el, Number(extCx))
|
|
68543
68629
|
}
|
|
68544
68630
|
}
|
|
68545
68631
|
}
|
|
@@ -68885,11 +68971,31 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
|
|
|
68885
68971
|
* default) is correct at depth 0. See `group-xfrm-preservation.ts`'s
|
|
68886
68972
|
* module doc for why a nested group must not re-derive this itself.
|
|
68887
68973
|
*/
|
|
68974
|
+
/**
|
|
68975
|
+
* `PptxHandlerSaveOptions.fixedDate` of the save in progress: set, the save
|
|
68976
|
+
* mints reproducible ids and names (new table columns' `a16:colId`, the
|
|
68977
|
+
* fallback name of a new group) instead of random or time-based ones.
|
|
68978
|
+
*/
|
|
68979
|
+
saveFixedDate;
|
|
68980
|
+
/**
|
|
68981
|
+
* The `p:cNvPr/@name` of a group with neither a name nor one from its
|
|
68982
|
+
* file: its element id, or for a reproducible save (`fixedDate`), which
|
|
68983
|
+
* must not depend on the time-based ids of elements made in code,
|
|
68984
|
+
* `Group <shape id>` as PowerPoint names groups.
|
|
68985
|
+
*/
|
|
68986
|
+
groupFallbackName(group) {
|
|
68987
|
+
return this.saveFixedDate ? `Group ${group.shapeId ?? ""}`.trim() : group.id;
|
|
68988
|
+
}
|
|
68888
68989
|
buildGroupShapeXml(group, ctx, ownEmuOverride) {
|
|
68889
68990
|
if (group.rawXml && group.children.length === 0) {
|
|
68890
68991
|
return {
|
|
68891
68992
|
...group.rawXml,
|
|
68892
|
-
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
68993
|
+
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
68994
|
+
group.rawXml,
|
|
68995
|
+
group.name,
|
|
68996
|
+
this.groupFallbackName(group),
|
|
68997
|
+
group.shapeId
|
|
68998
|
+
)
|
|
68893
68999
|
};
|
|
68894
69000
|
}
|
|
68895
69001
|
const EMU = _PptxHandlerRuntime.EMU_PER_PX;
|
|
@@ -68898,7 +69004,12 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
|
|
|
68898
69004
|
const xfrm = buildGroupTransformXml(group, EMU, ownEmuOverride, rewrap);
|
|
68899
69005
|
const childSpace = group;
|
|
68900
69006
|
const grpXml2 = {
|
|
68901
|
-
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
69007
|
+
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
69008
|
+
rawGroupXml,
|
|
69009
|
+
group.name,
|
|
69010
|
+
this.groupFallbackName(group),
|
|
69011
|
+
group.shapeId
|
|
69012
|
+
),
|
|
68902
69013
|
"p:grpSpPr": buildGroupPropertiesXml(rawGroupXml, xfrm)
|
|
68903
69014
|
};
|
|
68904
69015
|
const rawExtLst = rawGroupXml?.["p:extLst"];
|
|
@@ -70673,12 +70784,86 @@ var NON_MATERIALIZED_PLACEHOLDER_TYPES = /* @__PURE__ */ new Set([
|
|
|
70673
70784
|
"sldimg"
|
|
70674
70785
|
]);
|
|
70675
70786
|
|
|
70787
|
+
// pptx/core/core/runtime/table-cell-border-save.ts
|
|
70788
|
+
function cellEdges(style) {
|
|
70789
|
+
return [
|
|
70790
|
+
{
|
|
70791
|
+
xmlKey: "a:lnT",
|
|
70792
|
+
width: style.borderTopWidth,
|
|
70793
|
+
color: style.borderTopColor,
|
|
70794
|
+
dash: style.borderTopDash,
|
|
70795
|
+
segments: style.borderTopDashSegments
|
|
70796
|
+
},
|
|
70797
|
+
{
|
|
70798
|
+
xmlKey: "a:lnB",
|
|
70799
|
+
width: style.borderBottomWidth,
|
|
70800
|
+
color: style.borderBottomColor,
|
|
70801
|
+
dash: style.borderBottomDash,
|
|
70802
|
+
segments: style.borderBottomDashSegments
|
|
70803
|
+
},
|
|
70804
|
+
{
|
|
70805
|
+
xmlKey: "a:lnL",
|
|
70806
|
+
width: style.borderLeftWidth,
|
|
70807
|
+
color: style.borderLeftColor,
|
|
70808
|
+
dash: style.borderLeftDash,
|
|
70809
|
+
segments: style.borderLeftDashSegments
|
|
70810
|
+
},
|
|
70811
|
+
{
|
|
70812
|
+
xmlKey: "a:lnR",
|
|
70813
|
+
width: style.borderRightWidth,
|
|
70814
|
+
color: style.borderRightColor,
|
|
70815
|
+
dash: style.borderRightDash,
|
|
70816
|
+
segments: style.borderRightDashSegments
|
|
70817
|
+
}
|
|
70818
|
+
];
|
|
70819
|
+
}
|
|
70820
|
+
function writeEdgeDash(ln, edge) {
|
|
70821
|
+
if (edge.dash === void 0 || edge.dash === "") {
|
|
70822
|
+
return;
|
|
70823
|
+
}
|
|
70824
|
+
if (edge.dash === "solid") {
|
|
70825
|
+
delete ln["a:prstDash"];
|
|
70826
|
+
delete ln["a:custDash"];
|
|
70827
|
+
return;
|
|
70828
|
+
}
|
|
70829
|
+
if (edge.dash === "custom") {
|
|
70830
|
+
if (edge.segments && edge.segments.length > 0) {
|
|
70831
|
+
applyDrawingLineDash(ln, { strokeDash: "custom", customDashSegments: edge.segments });
|
|
70832
|
+
}
|
|
70833
|
+
return;
|
|
70834
|
+
}
|
|
70835
|
+
applyDrawingLineDash(ln, { strokeDash: edge.dash });
|
|
70836
|
+
}
|
|
70837
|
+
function writeCellEdgeBorders(tcPr, style, emuPerPx) {
|
|
70838
|
+
for (const edge of cellEdges(style)) {
|
|
70839
|
+
if (edge.width === void 0 && edge.color === void 0 && edge.dash === void 0) {
|
|
70840
|
+
continue;
|
|
70841
|
+
}
|
|
70842
|
+
const existing = tcPr[edge.xmlKey];
|
|
70843
|
+
const ln = existing && typeof existing === "object" ? existing : {};
|
|
70844
|
+
if (edge.width !== void 0) {
|
|
70845
|
+
ln["@_w"] = String(Math.round(edge.width * emuPerPx));
|
|
70846
|
+
}
|
|
70847
|
+
if (edge.color) {
|
|
70848
|
+
delete ln["a:noFill"];
|
|
70849
|
+
delete ln["a:gradFill"];
|
|
70850
|
+
delete ln["a:pattFill"];
|
|
70851
|
+
ln["a:solidFill"] = {
|
|
70852
|
+
"a:srgbClr": { "@_val": edge.color.replace("#", "") }
|
|
70853
|
+
};
|
|
70854
|
+
}
|
|
70855
|
+
writeEdgeDash(ln, edge);
|
|
70856
|
+
tcPr[edge.xmlKey] = reorderObjectKeys(ln, LN_CHILD_ORDER);
|
|
70857
|
+
}
|
|
70858
|
+
}
|
|
70859
|
+
|
|
70676
70860
|
// pptx/core/core/runtime/table-cell-save-helpers.ts
|
|
70677
70861
|
function writeCellFill(tcPr, style, resolveColorXml) {
|
|
70678
70862
|
if (style.fillMode === "gradient" && style.gradientFillStops && style.gradientFillStops.length > 0) {
|
|
70679
70863
|
delete tcPr["a:solidFill"];
|
|
70680
70864
|
delete tcPr["a:pattFill"];
|
|
70681
70865
|
delete tcPr["a:blipFill"];
|
|
70866
|
+
delete tcPr["a:noFill"];
|
|
70682
70867
|
const stops = style.gradientFillStops.map((stop) => {
|
|
70683
70868
|
const posRaw = typeof stop.position === "number" ? stop.position : 0;
|
|
70684
70869
|
const position3 = Math.round(Math.max(0, Math.min(1, posRaw / 100)) * 1e5);
|
|
@@ -70730,6 +70915,7 @@ function writeCellFill(tcPr, style, resolveColorXml) {
|
|
|
70730
70915
|
delete tcPr["a:solidFill"];
|
|
70731
70916
|
delete tcPr["a:gradFill"];
|
|
70732
70917
|
delete tcPr["a:blipFill"];
|
|
70918
|
+
delete tcPr["a:noFill"];
|
|
70733
70919
|
const pattXml = {
|
|
70734
70920
|
"@_prst": style.patternFillPreset
|
|
70735
70921
|
};
|
|
@@ -70753,10 +70939,12 @@ function writeCellFill(tcPr, style, resolveColorXml) {
|
|
|
70753
70939
|
delete tcPr["a:gradFill"];
|
|
70754
70940
|
delete tcPr["a:pattFill"];
|
|
70755
70941
|
delete tcPr["a:blipFill"];
|
|
70942
|
+
tcPr["a:noFill"] = tcPr["a:noFill"] ?? {};
|
|
70756
70943
|
} else if (style.fillMode !== "image" && style.backgroundColor) {
|
|
70757
70944
|
delete tcPr["a:gradFill"];
|
|
70758
70945
|
delete tcPr["a:pattFill"];
|
|
70759
70946
|
delete tcPr["a:blipFill"];
|
|
70947
|
+
delete tcPr["a:noFill"];
|
|
70760
70948
|
const resolvedOriginal = style.backgroundColorXml && resolveColorXml ? resolveColorXml(style.backgroundColorXml) : void 0;
|
|
70761
70949
|
tcPr["a:solidFill"] = serializeColorChoiceWithRef(
|
|
70762
70950
|
style.backgroundColorRef,
|
|
@@ -70973,53 +71161,7 @@ var PptxHandlerRuntime22 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
70973
71161
|
pPr["@_algn"] = token2;
|
|
70974
71162
|
}
|
|
70975
71163
|
}
|
|
70976
|
-
|
|
70977
|
-
{
|
|
70978
|
-
xmlKey: "a:lnT",
|
|
70979
|
-
width: style.borderTopWidth,
|
|
70980
|
-
color: style.borderTopColor,
|
|
70981
|
-
dash: style.borderTopDash
|
|
70982
|
-
},
|
|
70983
|
-
{
|
|
70984
|
-
xmlKey: "a:lnB",
|
|
70985
|
-
width: style.borderBottomWidth,
|
|
70986
|
-
color: style.borderBottomColor,
|
|
70987
|
-
dash: style.borderBottomDash
|
|
70988
|
-
},
|
|
70989
|
-
{
|
|
70990
|
-
xmlKey: "a:lnL",
|
|
70991
|
-
width: style.borderLeftWidth,
|
|
70992
|
-
color: style.borderLeftColor,
|
|
70993
|
-
dash: style.borderLeftDash
|
|
70994
|
-
},
|
|
70995
|
-
{
|
|
70996
|
-
xmlKey: "a:lnR",
|
|
70997
|
-
width: style.borderRightWidth,
|
|
70998
|
-
color: style.borderRightColor,
|
|
70999
|
-
dash: style.borderRightDash
|
|
71000
|
-
}
|
|
71001
|
-
];
|
|
71002
|
-
for (const edge of borderEdges) {
|
|
71003
|
-
if (edge.width !== void 0 || edge.color !== void 0 || edge.dash !== void 0) {
|
|
71004
|
-
if (!tcPr[edge.xmlKey]) {
|
|
71005
|
-
tcPr[edge.xmlKey] = {};
|
|
71006
|
-
}
|
|
71007
|
-
const ln = tcPr[edge.xmlKey];
|
|
71008
|
-
if (edge.width !== void 0) {
|
|
71009
|
-
ln["@_w"] = String(Math.round(edge.width * _PptxHandlerRuntime.EMU_PER_PX));
|
|
71010
|
-
}
|
|
71011
|
-
if (edge.color) {
|
|
71012
|
-
ln["a:solidFill"] = {
|
|
71013
|
-
"a:srgbClr": { "@_val": edge.color.replace("#", "") }
|
|
71014
|
-
};
|
|
71015
|
-
}
|
|
71016
|
-
if (edge.dash && edge.dash !== "solid") {
|
|
71017
|
-
ln["a:prstDash"] = { "@_val": edge.dash };
|
|
71018
|
-
} else if (edge.dash === "solid") {
|
|
71019
|
-
delete ln["a:prstDash"];
|
|
71020
|
-
}
|
|
71021
|
-
}
|
|
71022
|
-
}
|
|
71164
|
+
writeCellEdgeBorders(tcPr, style, _PptxHandlerRuntime.EMU_PER_PX);
|
|
71023
71165
|
const emuPerPx = _PptxHandlerRuntime.EMU_PER_PX;
|
|
71024
71166
|
if (style.marginLeft !== void 0) {
|
|
71025
71167
|
tcPr["@_marL"] = String(Math.round(style.marginLeft * emuPerPx));
|
|
@@ -71384,10 +71526,13 @@ var FILL_KEYS = [
|
|
|
71384
71526
|
"a:grpFill"
|
|
71385
71527
|
];
|
|
71386
71528
|
var LINE_KEYS = [
|
|
71387
|
-
["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash"]],
|
|
71388
|
-
["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash"]],
|
|
71389
|
-
["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash"]],
|
|
71390
|
-
[
|
|
71529
|
+
["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash", "borderLeftDashSegments"]],
|
|
71530
|
+
["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash", "borderRightDashSegments"]],
|
|
71531
|
+
["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash", "borderTopDashSegments"]],
|
|
71532
|
+
[
|
|
71533
|
+
"a:lnB",
|
|
71534
|
+
["borderBottomWidth", "borderBottomColor", "borderBottomDash", "borderBottomDashSegments"]
|
|
71535
|
+
],
|
|
71391
71536
|
["a:lnTlToBr", ["borderDiagDownWidth", "borderDiagDownColor"]],
|
|
71392
71537
|
["a:lnBlToTr", ["borderDiagUpWidth", "borderDiagUpColor"]]
|
|
71393
71538
|
];
|
|
@@ -71672,7 +71817,15 @@ function slideContainsA16Element(node) {
|
|
|
71672
71817
|
function randomColumnId() {
|
|
71673
71818
|
return String(Math.floor(Math.random() * 4294967295));
|
|
71674
71819
|
}
|
|
71675
|
-
function
|
|
71820
|
+
function deterministicColumnId(index) {
|
|
71821
|
+
let hash2 = 2166136261;
|
|
71822
|
+
for (const ch of `a16:colId:${index}`) {
|
|
71823
|
+
hash2 ^= ch.charCodeAt(0);
|
|
71824
|
+
hash2 = Math.imul(hash2, 16777619) >>> 0;
|
|
71825
|
+
}
|
|
71826
|
+
return String(hash2);
|
|
71827
|
+
}
|
|
71828
|
+
function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn, newColumnId = randomColumnId) {
|
|
71676
71829
|
const existingXmlRows = ensureArrayFn(tbl["a:tr"]);
|
|
71677
71830
|
const existingGridCols = ensureArrayFn(
|
|
71678
71831
|
tbl["a:tblGrid"]?.["a:gridCol"]
|
|
@@ -71703,7 +71856,7 @@ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
|
|
|
71703
71856
|
// `ensureA16NamespaceOnSlideRoot`; emitting it here too is
|
|
71704
71857
|
// schema-redundant and PowerPoint flags it.
|
|
71705
71858
|
"a16:colId": {
|
|
71706
|
-
"@_val": existingColIds[i] ||
|
|
71859
|
+
"@_val": existingColIds[i] || newColumnId(i)
|
|
71707
71860
|
}
|
|
71708
71861
|
}
|
|
71709
71862
|
}
|
|
@@ -71954,7 +72107,8 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
71954
72107
|
tbl,
|
|
71955
72108
|
tableData,
|
|
71956
72109
|
_PptxHandlerRuntime.EMU_PER_PX,
|
|
71957
|
-
this.ensureArray.bind(this)
|
|
72110
|
+
this.ensureArray.bind(this),
|
|
72111
|
+
this.saveFixedDate ? deterministicColumnId : void 0
|
|
71958
72112
|
);
|
|
71959
72113
|
const rebuiltRows = this.ensureArray(tbl["a:tr"]);
|
|
71960
72114
|
for (let rIdx = 0; rIdx < tableData.rows.length; rIdx++) {
|
|
@@ -74489,9 +74643,9 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
74489
74643
|
let maxId = 0;
|
|
74490
74644
|
for (const rel of relationships2) {
|
|
74491
74645
|
const id = String(rel?.["@_Id"] || "");
|
|
74492
|
-
const
|
|
74493
|
-
if (Number.isFinite(
|
|
74494
|
-
maxId =
|
|
74646
|
+
const num3 = parseInt(id.replace(/^rId/u, ""), 10);
|
|
74647
|
+
if (Number.isFinite(num3) && num3 > maxId) {
|
|
74648
|
+
maxId = num3;
|
|
74495
74649
|
}
|
|
74496
74650
|
}
|
|
74497
74651
|
const existingFontTargets = /* @__PURE__ */ new Set();
|
|
@@ -74634,9 +74788,9 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
74634
74788
|
let maxId = 0;
|
|
74635
74789
|
for (const rel of relationships2) {
|
|
74636
74790
|
const id = String(rel?.["@_Id"] || "");
|
|
74637
|
-
const
|
|
74638
|
-
if (Number.isFinite(
|
|
74639
|
-
maxId =
|
|
74791
|
+
const num3 = parseInt(id.replace(/^rId/u, ""), 10);
|
|
74792
|
+
if (Number.isFinite(num3) && num3 > maxId) {
|
|
74793
|
+
maxId = num3;
|
|
74640
74794
|
}
|
|
74641
74795
|
}
|
|
74642
74796
|
relationships2.push({
|
|
@@ -78981,6 +79135,16 @@ var PptxHandlerRuntime42 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
|
|
|
78981
79135
|
message: `Slide background image could not be embedded and was preserved as-is or omitted: ${imageUrl.slice(0, 120)}`,
|
|
78982
79136
|
scope: "save",
|
|
78983
79137
|
slideId: slide.id
|
|
79138
|
+
}),
|
|
79139
|
+
buildBackgroundGradientFill: () => {
|
|
79140
|
+
const gradient = slideBackgroundGradientToWrite(slide);
|
|
79141
|
+
return gradient ? this.buildGradientFillXml({ fillMode: "gradient", ...gradient }) : void 0;
|
|
79142
|
+
},
|
|
79143
|
+
reportUnsupportedGradient: () => this.compatibilityService.reportWarning({
|
|
79144
|
+
code: "SAVE_BACKGROUND_GRADIENT_UNSUPPORTED",
|
|
79145
|
+
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.",
|
|
79146
|
+
scope: "save",
|
|
79147
|
+
slideId: slide.id
|
|
78984
79148
|
})
|
|
78985
79149
|
});
|
|
78986
79150
|
this.slideCommentPartWriter.writeComments({
|
|
@@ -81225,6 +81389,7 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
81225
81389
|
/** One save, with the package to itself; callers go through {@link save}. */
|
|
81226
81390
|
async saveNow(slides, options2) {
|
|
81227
81391
|
validateSlideGeometry(slides);
|
|
81392
|
+
this.saveFixedDate = validFixedDate(options2?.fixedDate);
|
|
81228
81393
|
const templates = [
|
|
81229
81394
|
...options2?.slideMasters ?? [],
|
|
81230
81395
|
...options2?.slideLayouts ?? [],
|
|
@@ -81415,7 +81580,8 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
81415
81580
|
await this.documentPropertiesUpdater.updateOnSave(slides, {
|
|
81416
81581
|
coreProperties: options2?.coreProperties,
|
|
81417
81582
|
appProperties: options2?.appProperties,
|
|
81418
|
-
customProperties: options2?.customProperties
|
|
81583
|
+
customProperties: options2?.customProperties,
|
|
81584
|
+
fixedDate: this.saveFixedDate
|
|
81419
81585
|
});
|
|
81420
81586
|
await this.applyTagCollectionChanges(options2?.tags);
|
|
81421
81587
|
await this.applyNotesMasterChanges(options2?.notesMaster);
|
|
@@ -81459,6 +81625,11 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
81459
81625
|
delete this.zip.files[name];
|
|
81460
81626
|
}
|
|
81461
81627
|
}
|
|
81628
|
+
if (this.saveFixedDate) {
|
|
81629
|
+
for (const file of Object.values(this.zip.files)) {
|
|
81630
|
+
file.date = this.saveFixedDate;
|
|
81631
|
+
}
|
|
81632
|
+
}
|
|
81462
81633
|
return await this.zip.generateAsync({
|
|
81463
81634
|
type: "uint8array",
|
|
81464
81635
|
compression: "DEFLATE",
|
|
@@ -81543,6 +81714,15 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
81543
81714
|
this.zip.file(relsPath2, this.builder.build(relsData));
|
|
81544
81715
|
}
|
|
81545
81716
|
};
|
|
81717
|
+
function validFixedDate(date) {
|
|
81718
|
+
if (date === void 0) {
|
|
81719
|
+
return void 0;
|
|
81720
|
+
}
|
|
81721
|
+
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
81722
|
+
throw new RangeError("PptxHandlerSaveOptions.fixedDate must be a valid Date");
|
|
81723
|
+
}
|
|
81724
|
+
return date;
|
|
81725
|
+
}
|
|
81546
81726
|
|
|
81547
81727
|
// pptx/core/core/runtime/PptxHandlerRuntimeElementParsing.ts
|
|
81548
81728
|
var SPECIAL_PLACEHOLDER_TYPES = /* @__PURE__ */ new Set(["dt", "ftr", "hdr", "sldnum"]);
|
|
@@ -91004,8 +91184,8 @@ function parseNumberVal(node) {
|
|
|
91004
91184
|
if (raw2 === void 0 || raw2 === null || raw2 === "") {
|
|
91005
91185
|
return void 0;
|
|
91006
91186
|
}
|
|
91007
|
-
const
|
|
91008
|
-
return Number.isFinite(
|
|
91187
|
+
const num3 = Number.parseFloat(String(raw2));
|
|
91188
|
+
return Number.isFinite(num3) ? num3 : void 0;
|
|
91009
91189
|
}
|
|
91010
91190
|
var PptxHandlerRuntime93 = class extends PptxHandlerRuntime92 {
|
|
91011
91191
|
/**
|
|
@@ -93472,12 +93652,12 @@ var PptxHandlerRuntime103 = class extends PptxHandlerRuntime102 {
|
|
|
93472
93652
|
* in-memory format schemes of the masters on those parts and, when the deck's part is among
|
|
93473
93653
|
* them, the deck's.
|
|
93474
93654
|
*/
|
|
93475
|
-
async writeFormatScheme(
|
|
93655
|
+
async writeFormatScheme(elementFor, themePaths) {
|
|
93476
93656
|
const deckBefore = this.getThemeFormatScheme();
|
|
93477
93657
|
const replaced = /* @__PURE__ */ new Map();
|
|
93478
93658
|
const schemes = /* @__PURE__ */ new Map();
|
|
93479
93659
|
const written = await this.rewriteThemeParts(themePaths, (data, path3) => {
|
|
93480
|
-
const element2 =
|
|
93660
|
+
const element2 = elementFor(path3);
|
|
93481
93661
|
const elements2 = data["a:theme"]?.["a:themeElements"];
|
|
93482
93662
|
if (!element2 || !elements2) {
|
|
93483
93663
|
return false;
|
|
@@ -93515,7 +93695,7 @@ var PptxHandlerRuntime103 = class extends PptxHandlerRuntime102 {
|
|
|
93515
93695
|
this.themeFormatScheme = deck;
|
|
93516
93696
|
this.heldFormatSchemes.holdParts(
|
|
93517
93697
|
deck,
|
|
93518
|
-
new Map(written.map((path3) => [path3,
|
|
93698
|
+
new Map(written.map((path3) => [path3, elementFor(path3)]))
|
|
93519
93699
|
);
|
|
93520
93700
|
}
|
|
93521
93701
|
return this.getThemeFormatScheme();
|
|
@@ -97575,6 +97755,80 @@ var PptxHandler = class extends PptxHandlerCore {
|
|
|
97575
97755
|
}
|
|
97576
97756
|
};
|
|
97577
97757
|
|
|
97758
|
+
// pptx/core/builders/sdk/background-gradient-input.ts
|
|
97759
|
+
var HEX = /^#?[0-9a-f]{6}$/iu;
|
|
97760
|
+
var PATHS = /* @__PURE__ */ new Set(["circle", "rect", "shape"]);
|
|
97761
|
+
var WHERE = "BackgroundInput";
|
|
97762
|
+
function finite3(name, value, min, max) {
|
|
97763
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
97764
|
+
throw new RangeError(`${WHERE}.${name} must be a finite number, got ${String(value)}`);
|
|
97765
|
+
}
|
|
97766
|
+
if (min !== void 0 && value < min || max !== void 0 && value > max) {
|
|
97767
|
+
throw new RangeError(`${WHERE}.${name} must be between ${min} and ${max}, got ${value}`);
|
|
97768
|
+
}
|
|
97769
|
+
return value;
|
|
97770
|
+
}
|
|
97771
|
+
function stopsOf(input) {
|
|
97772
|
+
if (!Array.isArray(input.stops) || input.stops.length < 2) {
|
|
97773
|
+
throw new RangeError(`${WHERE}.stops needs at least two stops (a:gsLst)`);
|
|
97774
|
+
}
|
|
97775
|
+
return input.stops.map((stop, index) => {
|
|
97776
|
+
if (typeof stop.color !== "string" || !HEX.test(stop.color)) {
|
|
97777
|
+
throw new RangeError(
|
|
97778
|
+
`${WHERE}.stops[${index}].color must be #RRGGBB, got ${String(stop.color)}`
|
|
97779
|
+
);
|
|
97780
|
+
}
|
|
97781
|
+
const position3 = finite3(`stops[${index}].position`, stop.position, 0, 1);
|
|
97782
|
+
const opacity2 = stop.opacity === void 0 ? void 0 : finite3(`stops[${index}].opacity`, stop.opacity, 0, 1);
|
|
97783
|
+
return {
|
|
97784
|
+
color: `#${stop.color.replace("#", "").toUpperCase()}`,
|
|
97785
|
+
// The shape gradient model keeps positions in percent.
|
|
97786
|
+
position: position3 * 100,
|
|
97787
|
+
...opacity2 !== void 0 ? { opacity: opacity2 } : {}
|
|
97788
|
+
};
|
|
97789
|
+
});
|
|
97790
|
+
}
|
|
97791
|
+
function mapBackgroundGradientInput(input) {
|
|
97792
|
+
const fillGradientStops = stopsOf(input);
|
|
97793
|
+
let gradient;
|
|
97794
|
+
if (input.path !== void 0) {
|
|
97795
|
+
if (!PATHS.has(input.path)) {
|
|
97796
|
+
throw new RangeError(
|
|
97797
|
+
`${WHERE}.path must be circle, rect or shape, got ${String(input.path)}`
|
|
97798
|
+
);
|
|
97799
|
+
}
|
|
97800
|
+
if (input.angle !== void 0) {
|
|
97801
|
+
throw new RangeError(`${WHERE}.angle applies to a linear gradient, not a path one`);
|
|
97802
|
+
}
|
|
97803
|
+
const focus = input.focus ?? { l: 0.5, t: 0.5, r: 0.5, b: 0.5 };
|
|
97804
|
+
gradient = {
|
|
97805
|
+
fillGradientType: "radial",
|
|
97806
|
+
fillGradientPathType: input.path,
|
|
97807
|
+
fillGradientStops,
|
|
97808
|
+
fillGradientFillToRect: {
|
|
97809
|
+
l: finite3("focus.l", focus.l),
|
|
97810
|
+
t: finite3("focus.t", focus.t),
|
|
97811
|
+
r: finite3("focus.r", focus.r),
|
|
97812
|
+
b: finite3("focus.b", focus.b)
|
|
97813
|
+
}
|
|
97814
|
+
};
|
|
97815
|
+
} else {
|
|
97816
|
+
if (input.focus !== void 0) {
|
|
97817
|
+
throw new RangeError(`${WHERE}.focus needs a path gradient`);
|
|
97818
|
+
}
|
|
97819
|
+
const cssAngle = finite3("angle", input.angle ?? 180);
|
|
97820
|
+
gradient = {
|
|
97821
|
+
fillGradientType: "linear",
|
|
97822
|
+
fillGradientAngle: cssDegreesToOoxmlGradientAngle(cssAngle),
|
|
97823
|
+
fillGradientStops
|
|
97824
|
+
};
|
|
97825
|
+
}
|
|
97826
|
+
return {
|
|
97827
|
+
backgroundGradient: slideBackgroundGradientCss(gradient),
|
|
97828
|
+
backgroundGradientFill: gradient
|
|
97829
|
+
};
|
|
97830
|
+
}
|
|
97831
|
+
|
|
97578
97832
|
// pptx/core/builders/sdk/chart-gradient-input.ts
|
|
97579
97833
|
var HEX_COLOR2 = /^#?[0-9a-f]{6}$/iu;
|
|
97580
97834
|
var FULL_TURN = 360;
|
|
@@ -98013,6 +98267,269 @@ function buildShapeStyle(opts) {
|
|
|
98013
98267
|
return Object.keys(parts).length > 0 ? parts : void 0;
|
|
98014
98268
|
}
|
|
98015
98269
|
|
|
98270
|
+
// pptx/core/builders/sdk/table-border-input.ts
|
|
98271
|
+
var MAX_DASH_UNITS = 2147483647;
|
|
98272
|
+
var EDGES = [
|
|
98273
|
+
["top", "borderTop"],
|
|
98274
|
+
["right", "borderRight"],
|
|
98275
|
+
["bottom", "borderBottom"],
|
|
98276
|
+
["left", "borderLeft"]
|
|
98277
|
+
];
|
|
98278
|
+
function borderDashSegments(edge, lengths, width) {
|
|
98279
|
+
const name = `TableCellInput.borders.${edge}.dash`;
|
|
98280
|
+
if (lengths.length === 0) {
|
|
98281
|
+
throw new RangeError(`${name} must give at least one length`);
|
|
98282
|
+
}
|
|
98283
|
+
if (lengths.some((n) => !Number.isFinite(n) || n <= 0)) {
|
|
98284
|
+
throw new RangeError(`${name} lengths must be finite and above 0, got [${lengths.join(", ")}]`);
|
|
98285
|
+
}
|
|
98286
|
+
const segments = customDashSegments([...lengths], width !== void 0 && width > 0 ? width : 1);
|
|
98287
|
+
if (segments.some((s) => s.dash <= 0 || s.space <= 0)) {
|
|
98288
|
+
throw new RangeError(`${name} has a length too short to write: [${lengths.join(", ")}]`);
|
|
98289
|
+
}
|
|
98290
|
+
if (segments.some((s) => s.dash > MAX_DASH_UNITS || s.space > MAX_DASH_UNITS)) {
|
|
98291
|
+
throw new RangeError(`${name} has a length too long to write: [${lengths.join(", ")}]`);
|
|
98292
|
+
}
|
|
98293
|
+
return segments;
|
|
98294
|
+
}
|
|
98295
|
+
function edgeStyle(edge, prefix, input) {
|
|
98296
|
+
if (input.width !== void 0 && (!Number.isFinite(input.width) || input.width < 0)) {
|
|
98297
|
+
throw new RangeError(
|
|
98298
|
+
`TableCellInput.borders.${edge}.width must be a finite width of 0 or more, got ${input.width}`
|
|
98299
|
+
);
|
|
98300
|
+
}
|
|
98301
|
+
const out = {};
|
|
98302
|
+
if (input.width !== void 0) out[`${prefix}Width`] = input.width;
|
|
98303
|
+
if (input.color !== void 0) out[`${prefix}Color`] = input.color;
|
|
98304
|
+
if (Array.isArray(input.dash)) {
|
|
98305
|
+
out[`${prefix}Dash`] = "custom";
|
|
98306
|
+
out[`${prefix}DashSegments`] = borderDashSegments(edge, input.dash, input.width);
|
|
98307
|
+
} else if (input.dash !== void 0) {
|
|
98308
|
+
if (input.dash === "custom") {
|
|
98309
|
+
throw new RangeError(`TableCellInput.borders.${edge}.dash: give 'custom' as a length list`);
|
|
98310
|
+
}
|
|
98311
|
+
out[`${prefix}Dash`] = input.dash;
|
|
98312
|
+
}
|
|
98313
|
+
return out;
|
|
98314
|
+
}
|
|
98315
|
+
function tableCellBorderStyle(borders) {
|
|
98316
|
+
if (!borders) {
|
|
98317
|
+
return {};
|
|
98318
|
+
}
|
|
98319
|
+
const out = {};
|
|
98320
|
+
for (const [edge, prefix] of EDGES) {
|
|
98321
|
+
const own = borders[edge];
|
|
98322
|
+
const input = borders.all || own ? { ...borders.all, ...own } : void 0;
|
|
98323
|
+
if (input) {
|
|
98324
|
+
Object.assign(out, edgeStyle(own ? edge : "all", prefix, input));
|
|
98325
|
+
}
|
|
98326
|
+
}
|
|
98327
|
+
return out;
|
|
98328
|
+
}
|
|
98329
|
+
|
|
98330
|
+
// pptx/core/builders/sdk/table-cell-input.ts
|
|
98331
|
+
function refuseGradientExtras(fill3) {
|
|
98332
|
+
const radial = fill3.path !== void 0 || fill3.gradientType === "radial";
|
|
98333
|
+
const unsupported3 = [
|
|
98334
|
+
fill3.tile !== void 0 ? "tile" : void 0,
|
|
98335
|
+
fill3.scaled === false ? "scaled: false" : void 0,
|
|
98336
|
+
fill3.rotWithShape !== void 0 ? "rotWithShape" : void 0,
|
|
98337
|
+
fill3.focus !== void 0 && !radial ? "focus on a linear gradient" : void 0
|
|
98338
|
+
].filter((name) => name !== void 0);
|
|
98339
|
+
if (unsupported3.length > 0) {
|
|
98340
|
+
throw new RangeError(
|
|
98341
|
+
`TableCellInput.fill: ${unsupported3.join(", ")} cannot be written on a table cell`
|
|
98342
|
+
);
|
|
98343
|
+
}
|
|
98344
|
+
if (fill3.stops.length === 0) {
|
|
98345
|
+
throw new RangeError("TableCellInput.fill: a gradient needs at least one stop");
|
|
98346
|
+
}
|
|
98347
|
+
}
|
|
98348
|
+
function tableCellFillStyle(fill3) {
|
|
98349
|
+
switch (fill3?.type) {
|
|
98350
|
+
case void 0:
|
|
98351
|
+
return {};
|
|
98352
|
+
case "solid":
|
|
98353
|
+
if (fill3.opacity !== void 0 && fill3.opacity !== 1) {
|
|
98354
|
+
throw new RangeError(
|
|
98355
|
+
`TableCellInput.fill.opacity cannot be written on a table cell, got ${fill3.opacity}`
|
|
98356
|
+
);
|
|
98357
|
+
}
|
|
98358
|
+
return {
|
|
98359
|
+
fillMode: "solid",
|
|
98360
|
+
backgroundColor: fill3.color,
|
|
98361
|
+
...fill3.themeColorRef ? { backgroundColorRef: fill3.themeColorRef } : {}
|
|
98362
|
+
};
|
|
98363
|
+
case "gradient": {
|
|
98364
|
+
refuseGradientExtras(fill3);
|
|
98365
|
+
const radial = fill3.path !== void 0 || fill3.gradientType === "radial";
|
|
98366
|
+
return {
|
|
98367
|
+
fillMode: "gradient",
|
|
98368
|
+
gradientFillType: radial ? "radial" : "linear",
|
|
98369
|
+
gradientFillAngle: fill3.angle ?? 0,
|
|
98370
|
+
gradientFillStops: fill3.stops.map((stop) => ({
|
|
98371
|
+
color: stop.color,
|
|
98372
|
+
position: stop.position,
|
|
98373
|
+
...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
|
|
98374
|
+
})),
|
|
98375
|
+
...radial ? { gradientFillPathType: fill3.path ?? "circle" } : {},
|
|
98376
|
+
...fill3.focus ? { gradientFillFillToRect: { ...fill3.focus } } : {}
|
|
98377
|
+
};
|
|
98378
|
+
}
|
|
98379
|
+
case "pattern":
|
|
98380
|
+
if (!fill3.preset) {
|
|
98381
|
+
throw new RangeError("TableCellInput.fill: a pattern fill needs a preset");
|
|
98382
|
+
}
|
|
98383
|
+
return {
|
|
98384
|
+
fillMode: "pattern",
|
|
98385
|
+
patternFillPreset: fill3.preset,
|
|
98386
|
+
...fill3.foreground !== void 0 ? { patternFillForeground: fill3.foreground } : {},
|
|
98387
|
+
...fill3.background !== void 0 ? { patternFillBackground: fill3.background } : {}
|
|
98388
|
+
};
|
|
98389
|
+
case "image":
|
|
98390
|
+
throw new RangeError("TableCellInput.fill: an image fill cannot be written on a table cell");
|
|
98391
|
+
case "none":
|
|
98392
|
+
return { fillMode: "none" };
|
|
98393
|
+
}
|
|
98394
|
+
}
|
|
98395
|
+
function tableCellTextStyle(style) {
|
|
98396
|
+
const out = {};
|
|
98397
|
+
if (style?.fontSize !== void 0) out.fontSize = style.fontSize;
|
|
98398
|
+
if (style?.bold !== void 0) out.bold = style.bold;
|
|
98399
|
+
if (style?.italic !== void 0) out.italic = style.italic;
|
|
98400
|
+
if (style?.color !== void 0) out.color = style.color;
|
|
98401
|
+
if (style?.alignment !== void 0) out.align = style.alignment;
|
|
98402
|
+
return out;
|
|
98403
|
+
}
|
|
98404
|
+
function tableCellStyle(cell2) {
|
|
98405
|
+
const style = {
|
|
98406
|
+
...tableCellTextStyle(cell2.style),
|
|
98407
|
+
...tableCellFillStyle(cell2.fill),
|
|
98408
|
+
...tableCellBorderStyle(cell2.borders)
|
|
98409
|
+
};
|
|
98410
|
+
return cell2.style || Object.keys(style).length > 0 ? style : void 0;
|
|
98411
|
+
}
|
|
98412
|
+
|
|
98413
|
+
// pptx/core/builders/sdk/table-merge-input.ts
|
|
98414
|
+
function span(value, name) {
|
|
98415
|
+
if (value === void 0) {
|
|
98416
|
+
return 1;
|
|
98417
|
+
}
|
|
98418
|
+
if (!Number.isInteger(value) || value < 1) {
|
|
98419
|
+
throw new RangeError(`TableCellInput.${name} must be a whole number from 1, got ${value}`);
|
|
98420
|
+
}
|
|
98421
|
+
return value;
|
|
98422
|
+
}
|
|
98423
|
+
function placeTableCells(input) {
|
|
98424
|
+
const rowCount = input.rows.length;
|
|
98425
|
+
const slots = input.rows.map(() => []);
|
|
98426
|
+
input.rows.forEach((row, ri) => {
|
|
98427
|
+
const rowSlots = slots[ri] ?? [];
|
|
98428
|
+
let ci = 0;
|
|
98429
|
+
for (const cell2 of row.cells) {
|
|
98430
|
+
while (rowSlots[ci]) {
|
|
98431
|
+
ci += 1;
|
|
98432
|
+
}
|
|
98433
|
+
const colSpan = span(cell2.gridSpan, "gridSpan");
|
|
98434
|
+
const rowSpan = span(cell2.rowSpan, "rowSpan");
|
|
98435
|
+
if (ri + rowSpan > rowCount) {
|
|
98436
|
+
throw new RangeError(
|
|
98437
|
+
`A cell in row ${ri} spans ${rowSpan} rows, past the table's ${rowCount} rows`
|
|
98438
|
+
);
|
|
98439
|
+
}
|
|
98440
|
+
for (let dr = 0; dr < rowSpan; dr++) {
|
|
98441
|
+
for (let dc = 0; dc < colSpan; dc++) {
|
|
98442
|
+
const target = slots[ri + dr] ?? [];
|
|
98443
|
+
if (target[ci + dc]) {
|
|
98444
|
+
throw new RangeError(
|
|
98445
|
+
`A cell in row ${ri} overlaps the merge covering row ${ri + dr}, column ${ci + dc}`
|
|
98446
|
+
);
|
|
98447
|
+
}
|
|
98448
|
+
target[ci + dc] = dr === 0 && dc === 0 ? { cell: cell2 } : { hMerge: dc > 0, vMerge: dr > 0 };
|
|
98449
|
+
}
|
|
98450
|
+
}
|
|
98451
|
+
ci += colSpan;
|
|
98452
|
+
}
|
|
98453
|
+
});
|
|
98454
|
+
const widest = Math.max(...slots.map((row) => row.length), 1);
|
|
98455
|
+
const declared = input.columnWidths?.length;
|
|
98456
|
+
if (declared !== void 0 && widest > declared) {
|
|
98457
|
+
throw new RangeError(`A row takes ${widest} columns, but columnWidths gives ${declared}`);
|
|
98458
|
+
}
|
|
98459
|
+
const columnCount = declared ?? widest;
|
|
98460
|
+
return {
|
|
98461
|
+
columnCount,
|
|
98462
|
+
rows: slots.map(
|
|
98463
|
+
(row) => Array.from({ length: columnCount }, (_, ci) => row[ci] ?? { cell: { text: "" } })
|
|
98464
|
+
)
|
|
98465
|
+
};
|
|
98466
|
+
}
|
|
98467
|
+
function columnFractions(columnWidths, columnCount) {
|
|
98468
|
+
if (!columnWidths) {
|
|
98469
|
+
return Array.from({ length: columnCount }, () => 1 / columnCount);
|
|
98470
|
+
}
|
|
98471
|
+
if (columnWidths.length !== columnCount) {
|
|
98472
|
+
throw new RangeError(
|
|
98473
|
+
`columnWidths gives ${columnWidths.length} widths for a table of ${columnCount} columns`
|
|
98474
|
+
);
|
|
98475
|
+
}
|
|
98476
|
+
if (columnWidths.some((w) => !Number.isFinite(w) || w < 0)) {
|
|
98477
|
+
throw new RangeError("columnWidths must be finite widths of 0 or more");
|
|
98478
|
+
}
|
|
98479
|
+
const sum = columnWidths.reduce((a, b) => a + b, 0);
|
|
98480
|
+
if (sum <= 0) {
|
|
98481
|
+
throw new RangeError("columnWidths must not all be 0");
|
|
98482
|
+
}
|
|
98483
|
+
return columnWidths.map((w) => w / sum);
|
|
98484
|
+
}
|
|
98485
|
+
|
|
98486
|
+
// pptx/core/builders/sdk/text-segment-style.ts
|
|
98487
|
+
var RUN_KEYS = [
|
|
98488
|
+
"fontFamily",
|
|
98489
|
+
"fontSize",
|
|
98490
|
+
"bold",
|
|
98491
|
+
"italic",
|
|
98492
|
+
"underline",
|
|
98493
|
+
"strikethrough",
|
|
98494
|
+
"color",
|
|
98495
|
+
"colorRef",
|
|
98496
|
+
"characterSpacing",
|
|
98497
|
+
"hyperlink",
|
|
98498
|
+
"hyperlinkAction",
|
|
98499
|
+
"hyperlinkTargetSlideIndex",
|
|
98500
|
+
"hyperlinkTooltip",
|
|
98501
|
+
"align"
|
|
98502
|
+
];
|
|
98503
|
+
function elementStyleForSegments(textStyle, segments) {
|
|
98504
|
+
const styled = segments.filter((segment) => !segment.isParagraphBreak);
|
|
98505
|
+
const first2 = styled[0]?.style;
|
|
98506
|
+
if (!first2) {
|
|
98507
|
+
return textStyle;
|
|
98508
|
+
}
|
|
98509
|
+
const next = { ...textStyle };
|
|
98510
|
+
for (const key2 of RUN_KEYS) {
|
|
98511
|
+
const value = first2[key2];
|
|
98512
|
+
if (!styled.every((segment) => sameValue2(segment.style?.[key2], value))) {
|
|
98513
|
+
continue;
|
|
98514
|
+
}
|
|
98515
|
+
if (value === void 0) {
|
|
98516
|
+
delete next[key2];
|
|
98517
|
+
} else {
|
|
98518
|
+
next[key2] = value;
|
|
98519
|
+
}
|
|
98520
|
+
}
|
|
98521
|
+
return next;
|
|
98522
|
+
}
|
|
98523
|
+
function sameValue2(a, b) {
|
|
98524
|
+
if (a === b) {
|
|
98525
|
+
return true;
|
|
98526
|
+
}
|
|
98527
|
+
if (a && b && typeof a === "object" && typeof b === "object") {
|
|
98528
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
98529
|
+
}
|
|
98530
|
+
return false;
|
|
98531
|
+
}
|
|
98532
|
+
|
|
98016
98533
|
// pptx/core/builders/sdk/ElementFactory.ts
|
|
98017
98534
|
var idCounter = 0;
|
|
98018
98535
|
function generateId(prefix) {
|
|
@@ -98132,6 +98649,7 @@ function createTextElement(text, options2) {
|
|
|
98132
98649
|
verticalAlignment: options2?.verticalAlignment,
|
|
98133
98650
|
lineSpacing: options2?.lineSpacing
|
|
98134
98651
|
};
|
|
98652
|
+
const textSegments = buildTextSegments(text, textStyleBase);
|
|
98135
98653
|
return {
|
|
98136
98654
|
type: "text",
|
|
98137
98655
|
id: generateId("txt"),
|
|
@@ -98139,8 +98657,8 @@ function createTextElement(text, options2) {
|
|
|
98139
98657
|
rotation: options2?.rotation,
|
|
98140
98658
|
opacity: options2?.opacity,
|
|
98141
98659
|
text: plainText,
|
|
98142
|
-
textStyle: mapTextStyleInput(textStyleBase),
|
|
98143
|
-
textSegments
|
|
98660
|
+
textStyle: elementStyleForSegments(mapTextStyleInput(textStyleBase), textSegments),
|
|
98661
|
+
textSegments,
|
|
98144
98662
|
shapeStyle: buildShapeStyle(effectInputs(options2, options2?.fill))
|
|
98145
98663
|
};
|
|
98146
98664
|
}
|
|
@@ -98220,32 +98738,30 @@ function createImageElement(source, options2) {
|
|
|
98220
98738
|
cropBottom: options2?.cropBottom
|
|
98221
98739
|
};
|
|
98222
98740
|
}
|
|
98741
|
+
function createTableCell(cellInput) {
|
|
98742
|
+
return {
|
|
98743
|
+
text: cellInput.text,
|
|
98744
|
+
gridSpan: cellInput.gridSpan,
|
|
98745
|
+
rowSpan: cellInput.rowSpan,
|
|
98746
|
+
style: tableCellStyle(cellInput)
|
|
98747
|
+
};
|
|
98748
|
+
}
|
|
98223
98749
|
function createTableElement(input, options2) {
|
|
98224
|
-
const
|
|
98750
|
+
const grid = input.fillMergedCells ? placeTableCells(input) : void 0;
|
|
98751
|
+
const numCols = grid?.columnCount ?? Math.max(...input.rows.map((r) => r.cells.length), 1);
|
|
98225
98752
|
const rowHeight = input.rows.length > 0 ? Math.max(30, Math.floor(200 / input.rows.length)) : 30;
|
|
98226
98753
|
const totalHeight = options2?.height ?? Math.max(100, input.rows.length * rowHeight);
|
|
98227
98754
|
const p = pos("table", { ...options2, height: totalHeight });
|
|
98228
|
-
|
|
98229
|
-
|
|
98230
|
-
const sum = input.columnWidths.reduce((a, b) => a + b, 0);
|
|
98231
|
-
colWidths = input.columnWidths.map((w) => w / sum);
|
|
98232
|
-
} else {
|
|
98233
|
-
colWidths = Array(numCols).fill(1 / numCols);
|
|
98234
|
-
}
|
|
98235
|
-
const rows = input.rows.map((rowInput) => ({
|
|
98755
|
+
const colWidths = columnFractions(input.columnWidths, numCols);
|
|
98756
|
+
const rows = input.rows.map((rowInput, ri) => ({
|
|
98236
98757
|
height: rowInput.height ?? rowHeight,
|
|
98237
|
-
cells:
|
|
98238
|
-
|
|
98239
|
-
|
|
98240
|
-
|
|
98241
|
-
|
|
98242
|
-
|
|
98243
|
-
|
|
98244
|
-
italic: cellInput.style.italic,
|
|
98245
|
-
color: cellInput.style.color,
|
|
98246
|
-
align: cellInput.style.alignment
|
|
98247
|
-
} : void 0
|
|
98248
|
-
}))
|
|
98758
|
+
cells: grid ? (grid.rows[ri] ?? []).map(
|
|
98759
|
+
(slot2) => slot2.cell ? createTableCell(slot2.cell) : {
|
|
98760
|
+
text: "",
|
|
98761
|
+
...slot2.hMerge ? { hMerge: true } : {},
|
|
98762
|
+
...slot2.vMerge ? { vMerge: true } : {}
|
|
98763
|
+
}
|
|
98764
|
+
) : rowInput.cells.map(createTableCell)
|
|
98249
98765
|
}));
|
|
98250
98766
|
const tableData = {
|
|
98251
98767
|
rows,
|
|
@@ -98260,7 +98776,9 @@ function createTableElement(input, options2) {
|
|
|
98260
98776
|
// Accent 1 unless the caller picked a style. This is decided at
|
|
98261
98777
|
// creation time so the save pipeline never has to invent a style for
|
|
98262
98778
|
// loaded tables that legitimately have none.
|
|
98263
|
-
|
|
98779
|
+
// `style: 'none'` (or '') opts out, so the cells' own formatting is not
|
|
98780
|
+
// painted over by the theme banding.
|
|
98781
|
+
tableStyleId: input.style === "none" ? void 0 : input.style ?? DEFAULT_POWERPOINT_TABLE_STYLE_ID
|
|
98264
98782
|
};
|
|
98265
98783
|
return {
|
|
98266
98784
|
type: "table",
|
|
@@ -98482,12 +99000,12 @@ var SlideBuilder = class {
|
|
|
98482
99000
|
switch (bg.type) {
|
|
98483
99001
|
case "solid":
|
|
98484
99002
|
this.slide.backgroundColor = bg.color;
|
|
99003
|
+
delete this.slide.backgroundGradient;
|
|
99004
|
+
delete this.slide.backgroundGradientFill;
|
|
98485
99005
|
break;
|
|
98486
|
-
case "gradient":
|
|
98487
|
-
|
|
98488
|
-
this.slide.backgroundGradient = `linear-gradient(${bg.angle ?? 180}deg, ${stops})`;
|
|
99006
|
+
case "gradient":
|
|
99007
|
+
Object.assign(this.slide, mapBackgroundGradientInput(bg));
|
|
98489
99008
|
break;
|
|
98490
|
-
}
|
|
98491
99009
|
case "image":
|
|
98492
99010
|
this.slide.backgroundImage = bg.source;
|
|
98493
99011
|
break;
|