ooxml-core 1.26.0 → 1.27.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-CVYP5PAN.cjs → PptxHandler-6ZGALYYM.cjs} +2 -2
- package/dist/{PptxHandler-5QBRBXRX.mjs → PptxHandler-HEPPGI32.mjs} +2 -2
- package/dist/{PptxHandler-TOAD6P7N.mjs → PptxHandler-NO7MNGOW.mjs} +1 -1
- package/dist/{PresentationBuilder-M5UXW4AF.mjs → PresentationBuilder-BCDRASRT.mjs} +2 -2
- package/dist/{PresentationBuilder-RVQZCTIO.cjs → PresentationBuilder-HFGK2BWN.cjs} +4 -4
- package/dist/{PresentationBuilder-EBVNYMLE.mjs → PresentationBuilder-OQOZE76H.mjs} +1 -1
- package/dist/{chunk-KONCS53X.mjs → chunk-4SGBL2H4.mjs} +4 -4
- package/dist/{chunk-ZXPPM63Y.mjs → chunk-63GRFYAN.mjs} +1 -1
- package/dist/{chunk-K6OFJ5GJ.mjs → chunk-7E45SAZJ.mjs} +201 -175
- package/dist/{chunk-EBJ724RB.mjs → chunk-ANIFYTKH.mjs} +1 -1
- package/dist/{chunk-EEHK52XB.cjs → chunk-HYCOBPCC.cjs} +201 -175
- package/dist/{chunk-4IIR2QEH.mjs → chunk-KE2FUFIU.mjs} +202 -176
- package/dist/{chunk-DNYZX6YG.mjs → chunk-VRJOOHWV.mjs} +1 -1
- package/dist/pptx/automation/index.cjs +209 -182
- package/dist/pptx/automation/index.d.ts +3 -3
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{index-D3gKRIAi.d.ts → index-CbFowkp4.d.ts} +3 -3
- package/dist/pptx/chunks/{index-D3gKRIAi.d.ts.map → index-CbFowkp4.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-BOpULlxB.d.ts → index-D4FnOx6x.d.ts} +2 -2
- package/dist/pptx/chunks/{index-BOpULlxB.d.ts.map → index-D4FnOx6x.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-B94RKk84.d.ts → index-D8DNpc1X.d.ts} +14 -4
- package/dist/pptx/chunks/{index-B94RKk84.d.ts.map → index-D8DNpc1X.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +209 -182
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +1 -1
- package/dist/pptx/editor/render/slide-operations.mjs +1 -1
- package/dist/pptx/index.cjs +209 -182
- package/dist/pptx/index.d.ts +3 -3
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NS, 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, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseXml, elements, parseDataUrlToBytes, base64Decode, EMU_PER_PX, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, hasShapeProperties, ensureXmlChild, hasTextProperties, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, chartTrendlineType, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, ensureXmlChildren, TC_PR_BORDERS_ORDER, relAttr, buildXml, writeChartColorChoice, first, stripParentDirSegments, children, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, attr, childrenNamed, childNamed, parseCellAddress, readChartManualLayoutValues, worksheetData, formatCellAddress, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, backgroundStyleRefIsCurrent, backgroundRefNode, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, 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, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, deserializePptxFromJson, applyImportedPptxData, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, escAttr, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, effectChild, mergeEffectNode, mergeAttributeEffectNode, estimateMediaDurationMs, parseVmlElements, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, IncorrectPasswordError, applyThemeToData, detectFileFormat, parseOle2, decryptPptx, encryptPptx, escText, parseDrawingLineDash, 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, extractGuidFromPartName, deobfuscateFont, detectFontFormat, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, chartTrendlineKind, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtPresLayoutVars, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-
|
|
1
|
+
import { NS, 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, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseXml, elements, parseDataUrlToBytes, base64Decode, EMU_PER_PX, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, hasShapeProperties, ensureXmlChild, hasTextProperties, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, chartTrendlineType, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, ensureXmlChildren, TC_PR_BORDERS_ORDER, relAttr, buildXml, writeChartColorChoice, first, stripParentDirSegments, children, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, attr, childrenNamed, childNamed, parseCellAddress, readChartManualLayoutValues, worksheetData, formatCellAddress, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, backgroundStyleRefIsCurrent, backgroundRefNode, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, 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, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, deserializePptxFromJson, applyImportedPptxData, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, escAttr, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, effectChild, mergeEffectNode, mergeAttributeEffectNode, estimateMediaDurationMs, parseVmlElements, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, IncorrectPasswordError, applyThemeToData, detectFileFormat, parseOle2, decryptPptx, encryptPptx, escText, parseDrawingLineDash, 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, extractGuidFromPartName, deobfuscateFont, detectFontFormat, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, chartTrendlineKind, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtPresLayoutVars, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-VRJOOHWV.mjs';
|
|
2
2
|
import { openPptxZip, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, openZip, DEFAULT_MAX_UNCOMPRESSED_BYTES, guardZip, ZipBombError, MAX_ZIP_ENTRY_COUNT } from './chunk-JJ37PCNR.mjs';
|
|
3
3
|
import { resolveSmartArtLayoutCategory } from './chunk-3GXV5MPC.mjs';
|
|
4
4
|
import { cloneXmlObject, applySmartArtLayoutDefinition, cloneSlide, parseSmartArtLayoutDefinition } from './chunk-54S5A5PZ.mjs';
|
|
@@ -35776,7 +35776,10 @@ async function resolveBulletImage(imageRelId, slidePath, resolver) {
|
|
|
35776
35776
|
if (!target) {
|
|
35777
35777
|
return void 0;
|
|
35778
35778
|
}
|
|
35779
|
-
if (target.startsWith("http://") || target.startsWith("https://")
|
|
35779
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
35780
|
+
return resolver.allowExternalImages ? target : void 0;
|
|
35781
|
+
}
|
|
35782
|
+
if (target.startsWith("data:")) {
|
|
35780
35783
|
return target;
|
|
35781
35784
|
}
|
|
35782
35785
|
const imagePath = resolver.resolveImagePath(slidePath, target);
|
|
@@ -49859,6 +49862,152 @@ function applyCommonViewContainer(root, name, props) {
|
|
|
49859
49862
|
root[key2] = container;
|
|
49860
49863
|
}
|
|
49861
49864
|
|
|
49865
|
+
// pptx/core/core/runtime/chart-part-registration.ts
|
|
49866
|
+
var CHART_GRAPHIC_DATA_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
49867
|
+
var CHART_EX_GRAPHIC_DATA_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
49868
|
+
var NS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
49869
|
+
function asArray3(value) {
|
|
49870
|
+
if (value === void 0 || value === null) {
|
|
49871
|
+
return [];
|
|
49872
|
+
}
|
|
49873
|
+
return (Array.isArray(value) ? value : [value]).filter(
|
|
49874
|
+
(entry2) => Boolean(entry2) && typeof entry2 === "object"
|
|
49875
|
+
);
|
|
49876
|
+
}
|
|
49877
|
+
function nextFreeChartPartPath(zip, directory) {
|
|
49878
|
+
let n = 1;
|
|
49879
|
+
while (zip.file(`${directory}/chart${n}.xml`)) {
|
|
49880
|
+
n += 1;
|
|
49881
|
+
}
|
|
49882
|
+
return `${directory}/chart${n}.xml`;
|
|
49883
|
+
}
|
|
49884
|
+
function resolvePartTarget(fromPart, target) {
|
|
49885
|
+
if (target.startsWith("/")) {
|
|
49886
|
+
return target.slice(1);
|
|
49887
|
+
}
|
|
49888
|
+
const segments = fromPart.split("/").slice(0, -1);
|
|
49889
|
+
for (const segment of target.split("/")) {
|
|
49890
|
+
if (segment === "..") {
|
|
49891
|
+
segments.pop();
|
|
49892
|
+
} else if (segment !== "." && segment !== "") {
|
|
49893
|
+
segments.push(segment);
|
|
49894
|
+
}
|
|
49895
|
+
}
|
|
49896
|
+
return segments.join("/");
|
|
49897
|
+
}
|
|
49898
|
+
function relativePartTarget2(fromPart, toPart) {
|
|
49899
|
+
const from = fromPart.split("/").slice(0, -1);
|
|
49900
|
+
const to = toPart.split("/");
|
|
49901
|
+
let common = 0;
|
|
49902
|
+
while (common < from.length && common < to.length - 1 && from[common] === to[common]) {
|
|
49903
|
+
common += 1;
|
|
49904
|
+
}
|
|
49905
|
+
return [...from.slice(common).map(() => ".."), ...to.slice(common)].join("/");
|
|
49906
|
+
}
|
|
49907
|
+
async function ensureContentTypeOverride2(deps, partPath, contentType) {
|
|
49908
|
+
const xml = await deps.zip.file("[Content_Types].xml")?.async("string");
|
|
49909
|
+
if (!xml) {
|
|
49910
|
+
return;
|
|
49911
|
+
}
|
|
49912
|
+
const tree = deps.parser.parse(xml);
|
|
49913
|
+
const types = tree["Types"] ?? {};
|
|
49914
|
+
const overrides = asArray3(types["Override"]);
|
|
49915
|
+
const partName = `/${partPath}`;
|
|
49916
|
+
if (overrides.some((entry2) => String(entry2["@_PartName"]) === partName)) {
|
|
49917
|
+
return;
|
|
49918
|
+
}
|
|
49919
|
+
overrides.push({ "@_PartName": partName, "@_ContentType": contentType });
|
|
49920
|
+
types["Override"] = overrides;
|
|
49921
|
+
tree["Types"] = types;
|
|
49922
|
+
deps.zip.file("[Content_Types].xml", deps.builder.build(tree));
|
|
49923
|
+
}
|
|
49924
|
+
async function rewriteChartRelationship(deps, slidePath, rewrite) {
|
|
49925
|
+
const slash = slidePath.lastIndexOf("/");
|
|
49926
|
+
const relsPath2 = `${slidePath.slice(0, slash + 1)}_rels/${slidePath.slice(slash + 1)}.rels`;
|
|
49927
|
+
const xml = await deps.zip.file(relsPath2)?.async("string");
|
|
49928
|
+
if (!xml) {
|
|
49929
|
+
return void 0;
|
|
49930
|
+
}
|
|
49931
|
+
const tree = deps.parser.parse(xml);
|
|
49932
|
+
const root = tree["Relationships"];
|
|
49933
|
+
const relationships2 = asArray3(root?.["Relationship"]);
|
|
49934
|
+
const match = relationships2.find((rel) => String(rel["@_Id"]) === rewrite.relationshipId) ?? relationships2.find(
|
|
49935
|
+
(rel) => resolvePartTarget(slidePath, String(rel["@_Target"] ?? "")) === rewrite.oldPartPath
|
|
49936
|
+
);
|
|
49937
|
+
if (!match || !root) {
|
|
49938
|
+
return void 0;
|
|
49939
|
+
}
|
|
49940
|
+
match["@_Type"] = rewrite.relationshipType;
|
|
49941
|
+
match["@_Target"] = relativePartTarget2(slidePath, rewrite.newPartPath);
|
|
49942
|
+
delete match["@_TargetMode"];
|
|
49943
|
+
root["Relationship"] = relationships2.length === 1 ? relationships2[0] : relationships2;
|
|
49944
|
+
deps.zip.file(relsPath2, deps.builder.build(tree));
|
|
49945
|
+
return String(match["@_Id"]);
|
|
49946
|
+
}
|
|
49947
|
+
function rebindGraphicData(node, relationshipId, extended) {
|
|
49948
|
+
for (const key2 of Object.keys(node)) {
|
|
49949
|
+
delete node[key2];
|
|
49950
|
+
}
|
|
49951
|
+
node["@_uri"] = extended ? CHART_EX_GRAPHIC_DATA_URI : CHART_GRAPHIC_DATA_URI;
|
|
49952
|
+
if (extended) {
|
|
49953
|
+
node["cx:chart"] = {
|
|
49954
|
+
"@_xmlns:cx": CHART_EX_GRAPHIC_DATA_URI,
|
|
49955
|
+
"@_xmlns:r": NS_R,
|
|
49956
|
+
"@_r:id": relationshipId
|
|
49957
|
+
};
|
|
49958
|
+
} else {
|
|
49959
|
+
node["c:chart"] = {
|
|
49960
|
+
"@_xmlns:c": CHART_GRAPHIC_DATA_URI,
|
|
49961
|
+
"@_xmlns:r": NS_R,
|
|
49962
|
+
"@_r:id": relationshipId
|
|
49963
|
+
};
|
|
49964
|
+
}
|
|
49965
|
+
}
|
|
49966
|
+
function visitGraphicData(node, relationshipId, extended, getLocalName2) {
|
|
49967
|
+
if (!node || typeof node !== "object") {
|
|
49968
|
+
return 0;
|
|
49969
|
+
}
|
|
49970
|
+
if (Array.isArray(node)) {
|
|
49971
|
+
return node.reduce(
|
|
49972
|
+
(count2, entry2) => count2 + visitGraphicData(entry2, relationshipId, extended, getLocalName2),
|
|
49973
|
+
0
|
|
49974
|
+
);
|
|
49975
|
+
}
|
|
49976
|
+
const object = node;
|
|
49977
|
+
let count = 0;
|
|
49978
|
+
for (const key2 of Object.keys(object)) {
|
|
49979
|
+
if (key2.startsWith("@_")) {
|
|
49980
|
+
continue;
|
|
49981
|
+
}
|
|
49982
|
+
const value = object[key2];
|
|
49983
|
+
if (getLocalName2(key2) === "graphicData" && value && typeof value === "object") {
|
|
49984
|
+
for (const candidate of asArray3(value)) {
|
|
49985
|
+
const chartKey = Object.keys(candidate).find((k) => getLocalName2(k) === "chart");
|
|
49986
|
+
const chart = chartKey ? candidate[chartKey] : void 0;
|
|
49987
|
+
if (chart && String(chart["@_r:id"]) === relationshipId) {
|
|
49988
|
+
rebindGraphicData(candidate, relationshipId, extended);
|
|
49989
|
+
count += 1;
|
|
49990
|
+
}
|
|
49991
|
+
}
|
|
49992
|
+
continue;
|
|
49993
|
+
}
|
|
49994
|
+
count += visitGraphicData(value, relationshipId, extended, getLocalName2);
|
|
49995
|
+
}
|
|
49996
|
+
return count;
|
|
49997
|
+
}
|
|
49998
|
+
async function rewriteChartGraphicFrames(deps, slidePath, relationshipId, extended) {
|
|
49999
|
+
const xml = await deps.zip.file(slidePath)?.async("string");
|
|
50000
|
+
if (!xml) {
|
|
50001
|
+
return 0;
|
|
50002
|
+
}
|
|
50003
|
+
const tree = deps.parser.parse(xml);
|
|
50004
|
+
const count = visitGraphicData(tree, relationshipId, extended, deps.getLocalName);
|
|
50005
|
+
if (count > 0) {
|
|
50006
|
+
deps.zip.file(slidePath, deps.builder.build(tree));
|
|
50007
|
+
}
|
|
50008
|
+
return count;
|
|
50009
|
+
}
|
|
50010
|
+
|
|
49862
50011
|
// pptx/core/utils/chart-color-style-writer.ts
|
|
49863
50012
|
var METHODS = /* @__PURE__ */ new Set(["cycle", "withinLinear", "acrossLinear"]);
|
|
49864
50013
|
var COLOR_NAMES = /* @__PURE__ */ new Set(["scrgbClr", "srgbClr", "hslClr", "sysClr", "schemeClr", "prstClr"]);
|
|
@@ -49928,7 +50077,7 @@ function buildChartExLegend(legendPosition) {
|
|
|
49928
50077
|
// pptx/core/utils/chart-cx-generator.ts
|
|
49929
50078
|
var NS_CX = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
49930
50079
|
var NS_A = "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
49931
|
-
var
|
|
50080
|
+
var NS_R2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
49932
50081
|
var NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
49933
50082
|
function points4(values) {
|
|
49934
50083
|
return values.map((value, index) => ({ "@_idx": String(index), "#text": String(value) }));
|
|
@@ -50123,7 +50272,7 @@ function buildChartExSpaceXml(chartData) {
|
|
|
50123
50272
|
const chartSpace = {
|
|
50124
50273
|
"@_xmlns:cx": NS_CX,
|
|
50125
50274
|
"@_xmlns:a": NS_A,
|
|
50126
|
-
"@_xmlns:r":
|
|
50275
|
+
"@_xmlns:r": NS_R2,
|
|
50127
50276
|
"cx:chartData": {
|
|
50128
50277
|
"cx:data": chartData.series.map(
|
|
50129
50278
|
(series, index) => buildChartExData(chartData, series, index)
|
|
@@ -51686,7 +51835,7 @@ function buildGeneratedSeriesSpPr(series, family) {
|
|
|
51686
51835
|
// pptx/core/utils/chart-xml-generator.ts
|
|
51687
51836
|
var NS_C2 = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
51688
51837
|
var NS_A2 = "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
51689
|
-
var
|
|
51838
|
+
var NS_R3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
51690
51839
|
var CAT_AX_ID = 111111111;
|
|
51691
51840
|
var VAL_AX_ID = 222222222;
|
|
51692
51841
|
var SER_AX_ID = 333333333;
|
|
@@ -51892,7 +52041,7 @@ function buildChartSpaceXml(chartData) {
|
|
|
51892
52041
|
"c:chartSpace": {
|
|
51893
52042
|
"@_xmlns:c": NS_C2,
|
|
51894
52043
|
"@_xmlns:a": NS_A2,
|
|
51895
|
-
"@_xmlns:r":
|
|
52044
|
+
"@_xmlns:r": NS_R3,
|
|
51896
52045
|
"c:chart": chart
|
|
51897
52046
|
}
|
|
51898
52047
|
};
|
|
@@ -53941,7 +54090,7 @@ function buildTitleDefRPr(style, existing, resolveColor2) {
|
|
|
53941
54090
|
}
|
|
53942
54091
|
return rPr;
|
|
53943
54092
|
}
|
|
53944
|
-
function
|
|
54093
|
+
function asArray4(value) {
|
|
53945
54094
|
if (Array.isArray(value)) {
|
|
53946
54095
|
return value;
|
|
53947
54096
|
}
|
|
@@ -53960,7 +54109,7 @@ function applyRichTitleFont(title, style, getLocalName2, resolveColor2) {
|
|
|
53960
54109
|
return txKey;
|
|
53961
54110
|
}
|
|
53962
54111
|
const pKey = findKey19(rich, "p", getLocalName2) ?? "a:p";
|
|
53963
|
-
const paragraphs =
|
|
54112
|
+
const paragraphs = asArray4(rich[pKey]).map((para) => {
|
|
53964
54113
|
const next = { ...para };
|
|
53965
54114
|
const pPrKey = findKey19(next, "pPr", getLocalName2) ?? "a:pPr";
|
|
53966
54115
|
const pPr = { ...ensureXmlChildOrCreate(next, pPrKey, "first") };
|
|
@@ -53973,7 +54122,7 @@ function applyRichTitleFont(title, style, getLocalName2, resolveColor2) {
|
|
|
53973
54122
|
next[pPrKey] = pPr;
|
|
53974
54123
|
const rKey = findKey19(next, "r", getLocalName2);
|
|
53975
54124
|
if (rKey) {
|
|
53976
|
-
const runs =
|
|
54125
|
+
const runs = asArray4(next[rKey]).map((run2) => {
|
|
53977
54126
|
const rPrKey = findKey19(run2, "rPr", getLocalName2) ?? "a:rPr";
|
|
53978
54127
|
const existingRPr = run2[rPrKey] ?? {};
|
|
53979
54128
|
const nextRun = { ...run2 };
|
|
@@ -54337,7 +54486,7 @@ function saveChartPartThroughNeutral(xml, before, after) {
|
|
|
54337
54486
|
function findKey20(node, localName15, getLocalName2) {
|
|
54338
54487
|
return Object.keys(node).find((key2) => getLocalName2(key2) === localName15);
|
|
54339
54488
|
}
|
|
54340
|
-
function
|
|
54489
|
+
function asArray5(value) {
|
|
54341
54490
|
if (value === void 0 || value === null) {
|
|
54342
54491
|
return [];
|
|
54343
54492
|
}
|
|
@@ -54351,8 +54500,8 @@ function dimensionType(node) {
|
|
|
54351
54500
|
function replaceLevels(target, source, getLocalName2) {
|
|
54352
54501
|
const targetKey = findKey20(target, "lvl", getLocalName2) ?? "cx:lvl";
|
|
54353
54502
|
const sourceKey = findKey20(source, "lvl", getLocalName2);
|
|
54354
|
-
const oldLevels =
|
|
54355
|
-
const newLevels =
|
|
54503
|
+
const oldLevels = asArray5(target[targetKey]);
|
|
54504
|
+
const newLevels = asArray5(sourceKey ? source[sourceKey] : void 0).map((level, index) => {
|
|
54356
54505
|
const old = oldLevels[index];
|
|
54357
54506
|
if (!old) {
|
|
54358
54507
|
return level;
|
|
@@ -54371,8 +54520,8 @@ function replaceChartExDataDimensions(target, fresh, getLocalName2) {
|
|
|
54371
54520
|
for (const kind of ["strDim", "numDim"]) {
|
|
54372
54521
|
const targetKey = findKey20(target, kind, getLocalName2) ?? `cx:${kind}`;
|
|
54373
54522
|
const freshKey = findKey20(fresh, kind, getLocalName2);
|
|
54374
|
-
const existing =
|
|
54375
|
-
const incoming =
|
|
54523
|
+
const existing = asArray5(target[targetKey]);
|
|
54524
|
+
const incoming = asArray5(freshKey ? fresh[freshKey] : void 0);
|
|
54376
54525
|
for (const dimension of incoming) {
|
|
54377
54526
|
const wantedType = dimensionType(dimension);
|
|
54378
54527
|
let match = existing.find((candidate) => dimensionType(candidate) === wantedType);
|
|
@@ -54406,7 +54555,7 @@ function child13(node, localName15, getLocalName2) {
|
|
|
54406
54555
|
const value = key2 ? node[key2] : void 0;
|
|
54407
54556
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
54408
54557
|
}
|
|
54409
|
-
function
|
|
54558
|
+
function asArray6(value) {
|
|
54410
54559
|
if (value === void 0 || value === null) {
|
|
54411
54560
|
return [];
|
|
54412
54561
|
}
|
|
@@ -54588,7 +54737,7 @@ function chartExLayoutChanged(chartSpace, chartData, getLocalName2) {
|
|
|
54588
54737
|
getLocalName2
|
|
54589
54738
|
);
|
|
54590
54739
|
const seriesKey = region ? findKey21(region, "series", getLocalName2) : void 0;
|
|
54591
|
-
const first2 = region && seriesKey ?
|
|
54740
|
+
const first2 = region && seriesKey ? asArray6(region[seriesKey])[0] : void 0;
|
|
54592
54741
|
const existing = String(first2?.["@_layoutId"] ?? "").toLowerCase();
|
|
54593
54742
|
const series = chartData.series[0];
|
|
54594
54743
|
if (!existing || !series) {
|
|
@@ -54606,9 +54755,9 @@ function applyChartExUpdate(chartSpace, chartData, getLocalName2) {
|
|
|
54606
54755
|
const chartDataKey = findKey21(chartSpace, "chartData", getLocalName2);
|
|
54607
54756
|
const chartDataNode = (chartDataKey ? chartSpace[chartDataKey] : void 0) ?? {};
|
|
54608
54757
|
const dataKey = findKey21(chartDataNode, "data", getLocalName2) ?? "cx:data";
|
|
54609
|
-
const dataNodes =
|
|
54758
|
+
const dataNodes = asArray6(chartDataNode[dataKey]);
|
|
54610
54759
|
const seriesKey = findKey21(region, "series", getLocalName2) ?? "cx:series";
|
|
54611
|
-
const existing =
|
|
54760
|
+
const existing = asArray6(region[seriesKey]);
|
|
54612
54761
|
const updated = [];
|
|
54613
54762
|
chartData.series.forEach((series, index) => {
|
|
54614
54763
|
const node = existing[index];
|
|
@@ -54678,152 +54827,6 @@ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath,
|
|
|
54678
54827
|
);
|
|
54679
54828
|
}
|
|
54680
54829
|
|
|
54681
|
-
// pptx/core/core/runtime/chart-part-registration.ts
|
|
54682
|
-
var CHART_GRAPHIC_DATA_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
54683
|
-
var CHART_EX_GRAPHIC_DATA_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
|
|
54684
|
-
var NS_R3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
54685
|
-
function asArray6(value) {
|
|
54686
|
-
if (value === void 0 || value === null) {
|
|
54687
|
-
return [];
|
|
54688
|
-
}
|
|
54689
|
-
return (Array.isArray(value) ? value : [value]).filter(
|
|
54690
|
-
(entry2) => Boolean(entry2) && typeof entry2 === "object"
|
|
54691
|
-
);
|
|
54692
|
-
}
|
|
54693
|
-
function nextFreeChartPartPath(zip, directory) {
|
|
54694
|
-
let n = 1;
|
|
54695
|
-
while (zip.file(`${directory}/chart${n}.xml`)) {
|
|
54696
|
-
n += 1;
|
|
54697
|
-
}
|
|
54698
|
-
return `${directory}/chart${n}.xml`;
|
|
54699
|
-
}
|
|
54700
|
-
function resolvePartTarget(fromPart, target) {
|
|
54701
|
-
if (target.startsWith("/")) {
|
|
54702
|
-
return target.slice(1);
|
|
54703
|
-
}
|
|
54704
|
-
const segments = fromPart.split("/").slice(0, -1);
|
|
54705
|
-
for (const segment of target.split("/")) {
|
|
54706
|
-
if (segment === "..") {
|
|
54707
|
-
segments.pop();
|
|
54708
|
-
} else if (segment !== "." && segment !== "") {
|
|
54709
|
-
segments.push(segment);
|
|
54710
|
-
}
|
|
54711
|
-
}
|
|
54712
|
-
return segments.join("/");
|
|
54713
|
-
}
|
|
54714
|
-
function relativePartTarget2(fromPart, toPart) {
|
|
54715
|
-
const from = fromPart.split("/").slice(0, -1);
|
|
54716
|
-
const to = toPart.split("/");
|
|
54717
|
-
let common = 0;
|
|
54718
|
-
while (common < from.length && common < to.length - 1 && from[common] === to[common]) {
|
|
54719
|
-
common += 1;
|
|
54720
|
-
}
|
|
54721
|
-
return [...from.slice(common).map(() => ".."), ...to.slice(common)].join("/");
|
|
54722
|
-
}
|
|
54723
|
-
async function ensureContentTypeOverride2(deps, partPath, contentType) {
|
|
54724
|
-
const xml = await deps.zip.file("[Content_Types].xml")?.async("string");
|
|
54725
|
-
if (!xml) {
|
|
54726
|
-
return;
|
|
54727
|
-
}
|
|
54728
|
-
const tree = deps.parser.parse(xml);
|
|
54729
|
-
const types = tree["Types"] ?? {};
|
|
54730
|
-
const overrides = asArray6(types["Override"]);
|
|
54731
|
-
const partName = `/${partPath}`;
|
|
54732
|
-
if (overrides.some((entry2) => String(entry2["@_PartName"]) === partName)) {
|
|
54733
|
-
return;
|
|
54734
|
-
}
|
|
54735
|
-
overrides.push({ "@_PartName": partName, "@_ContentType": contentType });
|
|
54736
|
-
types["Override"] = overrides;
|
|
54737
|
-
tree["Types"] = types;
|
|
54738
|
-
deps.zip.file("[Content_Types].xml", deps.builder.build(tree));
|
|
54739
|
-
}
|
|
54740
|
-
async function rewriteChartRelationship(deps, slidePath, rewrite) {
|
|
54741
|
-
const slash = slidePath.lastIndexOf("/");
|
|
54742
|
-
const relsPath2 = `${slidePath.slice(0, slash + 1)}_rels/${slidePath.slice(slash + 1)}.rels`;
|
|
54743
|
-
const xml = await deps.zip.file(relsPath2)?.async("string");
|
|
54744
|
-
if (!xml) {
|
|
54745
|
-
return void 0;
|
|
54746
|
-
}
|
|
54747
|
-
const tree = deps.parser.parse(xml);
|
|
54748
|
-
const root = tree["Relationships"];
|
|
54749
|
-
const relationships2 = asArray6(root?.["Relationship"]);
|
|
54750
|
-
const match = relationships2.find((rel) => String(rel["@_Id"]) === rewrite.relationshipId) ?? relationships2.find(
|
|
54751
|
-
(rel) => resolvePartTarget(slidePath, String(rel["@_Target"] ?? "")) === rewrite.oldPartPath
|
|
54752
|
-
);
|
|
54753
|
-
if (!match || !root) {
|
|
54754
|
-
return void 0;
|
|
54755
|
-
}
|
|
54756
|
-
match["@_Type"] = rewrite.relationshipType;
|
|
54757
|
-
match["@_Target"] = relativePartTarget2(slidePath, rewrite.newPartPath);
|
|
54758
|
-
delete match["@_TargetMode"];
|
|
54759
|
-
root["Relationship"] = relationships2.length === 1 ? relationships2[0] : relationships2;
|
|
54760
|
-
deps.zip.file(relsPath2, deps.builder.build(tree));
|
|
54761
|
-
return String(match["@_Id"]);
|
|
54762
|
-
}
|
|
54763
|
-
function rebindGraphicData(node, relationshipId, extended) {
|
|
54764
|
-
for (const key2 of Object.keys(node)) {
|
|
54765
|
-
delete node[key2];
|
|
54766
|
-
}
|
|
54767
|
-
node["@_uri"] = extended ? CHART_EX_GRAPHIC_DATA_URI : CHART_GRAPHIC_DATA_URI;
|
|
54768
|
-
if (extended) {
|
|
54769
|
-
node["cx:chart"] = {
|
|
54770
|
-
"@_xmlns:cx": CHART_EX_GRAPHIC_DATA_URI,
|
|
54771
|
-
"@_xmlns:r": NS_R3,
|
|
54772
|
-
"@_r:id": relationshipId
|
|
54773
|
-
};
|
|
54774
|
-
} else {
|
|
54775
|
-
node["c:chart"] = {
|
|
54776
|
-
"@_xmlns:c": CHART_GRAPHIC_DATA_URI,
|
|
54777
|
-
"@_xmlns:r": NS_R3,
|
|
54778
|
-
"@_r:id": relationshipId
|
|
54779
|
-
};
|
|
54780
|
-
}
|
|
54781
|
-
}
|
|
54782
|
-
function visitGraphicData(node, relationshipId, extended, getLocalName2) {
|
|
54783
|
-
if (!node || typeof node !== "object") {
|
|
54784
|
-
return 0;
|
|
54785
|
-
}
|
|
54786
|
-
if (Array.isArray(node)) {
|
|
54787
|
-
return node.reduce(
|
|
54788
|
-
(count2, entry2) => count2 + visitGraphicData(entry2, relationshipId, extended, getLocalName2),
|
|
54789
|
-
0
|
|
54790
|
-
);
|
|
54791
|
-
}
|
|
54792
|
-
const object = node;
|
|
54793
|
-
let count = 0;
|
|
54794
|
-
for (const key2 of Object.keys(object)) {
|
|
54795
|
-
if (key2.startsWith("@_")) {
|
|
54796
|
-
continue;
|
|
54797
|
-
}
|
|
54798
|
-
const value = object[key2];
|
|
54799
|
-
if (getLocalName2(key2) === "graphicData" && value && typeof value === "object") {
|
|
54800
|
-
for (const candidate of asArray6(value)) {
|
|
54801
|
-
const chartKey = Object.keys(candidate).find((k) => getLocalName2(k) === "chart");
|
|
54802
|
-
const chart = chartKey ? candidate[chartKey] : void 0;
|
|
54803
|
-
if (chart && String(chart["@_r:id"]) === relationshipId) {
|
|
54804
|
-
rebindGraphicData(candidate, relationshipId, extended);
|
|
54805
|
-
count += 1;
|
|
54806
|
-
}
|
|
54807
|
-
}
|
|
54808
|
-
continue;
|
|
54809
|
-
}
|
|
54810
|
-
count += visitGraphicData(value, relationshipId, extended, getLocalName2);
|
|
54811
|
-
}
|
|
54812
|
-
return count;
|
|
54813
|
-
}
|
|
54814
|
-
async function rewriteChartGraphicFrames(deps, slidePath, relationshipId, extended) {
|
|
54815
|
-
const xml = await deps.zip.file(slidePath)?.async("string");
|
|
54816
|
-
if (!xml) {
|
|
54817
|
-
return 0;
|
|
54818
|
-
}
|
|
54819
|
-
const tree = deps.parser.parse(xml);
|
|
54820
|
-
const count = visitGraphicData(tree, relationshipId, extended, deps.getLocalName);
|
|
54821
|
-
if (count > 0) {
|
|
54822
|
-
deps.zip.file(slidePath, deps.builder.build(tree));
|
|
54823
|
-
}
|
|
54824
|
-
return count;
|
|
54825
|
-
}
|
|
54826
|
-
|
|
54827
54830
|
// pptx/core/core/runtime/chart-part-family-switch.ts
|
|
54828
54831
|
var CHART_EX_CONTENT_TYPE = "application/vnd.ms-office.chartex+xml";
|
|
54829
54832
|
var CHART_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml";
|
|
@@ -57731,18 +57734,22 @@ var PptxHandlerRuntime3 = class extends PptxHandlerRuntime2 {
|
|
|
57731
57734
|
* Write or remove a single `a:hlinkClick` / `a:hlinkHover` node on
|
|
57732
57735
|
* a `p:cNvPr` parent.
|
|
57733
57736
|
*/
|
|
57734
|
-
serializeSingleAction(cNvPr, nodeName, action,
|
|
57737
|
+
serializeSingleAction(cNvPr, nodeName, action, links) {
|
|
57735
57738
|
if (!action) {
|
|
57736
57739
|
delete cNvPr[nodeName];
|
|
57737
57740
|
return;
|
|
57738
57741
|
}
|
|
57739
57742
|
const node = {};
|
|
57743
|
+
const url = action.url?.trim() || (/^ppaction:\/\/hlinksldjump\b/iu.test(action.action ?? "") && typeof action.targetSlideIndex === "number" ? links.slideTargetAt?.(action.targetSlideIndex) : void 0);
|
|
57740
57744
|
let rId = action.rId;
|
|
57741
|
-
if (
|
|
57745
|
+
if (rId && url && links.getSlideRelationshipMap().get(rId) !== url) {
|
|
57746
|
+
rId = void 0;
|
|
57747
|
+
}
|
|
57748
|
+
if (!rId && url) {
|
|
57742
57749
|
const forceExternal = /^ppaction:\/\/(program|hlinkfile|hlinkpres)\b/iu.test(
|
|
57743
57750
|
action.action ?? ""
|
|
57744
57751
|
);
|
|
57745
|
-
rId = resolveHyperlinkRelationshipId(
|
|
57752
|
+
rId = links.resolveHyperlinkRelationshipId(url, forceExternal) ?? void 0;
|
|
57746
57753
|
}
|
|
57747
57754
|
node["@_r:id"] = rId ?? "";
|
|
57748
57755
|
if (action.action) {
|
|
@@ -57816,7 +57823,7 @@ var PptxHandlerRuntime3 = class extends PptxHandlerRuntime2 {
|
|
|
57816
57823
|
* the `a:hlinkClick` and `a:hlinkHover` nodes on the element's
|
|
57817
57824
|
* non-visual properties.
|
|
57818
57825
|
*/
|
|
57819
|
-
serializeElementActions(shape, el,
|
|
57826
|
+
serializeElementActions(shape, el, links) {
|
|
57820
57827
|
const key2 = this.getTreeBucketKeyForElementType(el.type);
|
|
57821
57828
|
const cNvPr = this.getCnvPrNode(shape, key2);
|
|
57822
57829
|
if (!cNvPr) {
|
|
@@ -57824,8 +57831,8 @@ var PptxHandlerRuntime3 = class extends PptxHandlerRuntime2 {
|
|
|
57824
57831
|
}
|
|
57825
57832
|
const actionClick = "actionClick" in el ? el.actionClick : void 0;
|
|
57826
57833
|
const actionHover = "actionHover" in el ? el.actionHover : void 0;
|
|
57827
|
-
this.serializeSingleAction(cNvPr, "a:hlinkClick", actionClick,
|
|
57828
|
-
this.serializeSingleAction(cNvPr, "a:hlinkHover", actionHover,
|
|
57834
|
+
this.serializeSingleAction(cNvPr, "a:hlinkClick", actionClick, links);
|
|
57835
|
+
this.serializeSingleAction(cNvPr, "a:hlinkHover", actionHover, links);
|
|
57829
57836
|
const isDecorative = "isDecorative" in el ? el.isDecorative : void 0;
|
|
57830
57837
|
serializeDecorativeExtension(cNvPr, isDecorative);
|
|
57831
57838
|
}
|
|
@@ -70754,7 +70761,7 @@ var PptxHandlerRuntime41 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
|
|
|
70754
70761
|
if (ctx.connectorShapeIds) {
|
|
70755
70762
|
applyConnectorShapeIds(shape, el, ctx.connectorShapeIds);
|
|
70756
70763
|
}
|
|
70757
|
-
this.serializeElementActions(shape, el, ctx
|
|
70764
|
+
this.serializeElementActions(shape, el, ctx);
|
|
70758
70765
|
this.serializeShapeLocks(shape, el);
|
|
70759
70766
|
this.applyHiddenToCnvPr(shape, el);
|
|
70760
70767
|
this.applyNameToCnvPr(shape, el);
|
|
@@ -71795,7 +71802,7 @@ var PptxHandlerRuntime42 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
|
|
|
71795
71802
|
* Process a single slide during save: update slide XML, process elements,
|
|
71796
71803
|
* rebuild shape tree, and persist relationships.
|
|
71797
71804
|
*/
|
|
71798
|
-
async processSlideForSave(slide, saveSession, constants) {
|
|
71805
|
+
async processSlideForSave(slide, saveSession, constants, slidePaths = []) {
|
|
71799
71806
|
if (this.canSkipSlideSave(slide)) {
|
|
71800
71807
|
return;
|
|
71801
71808
|
}
|
|
@@ -71980,6 +71987,10 @@ var PptxHandlerRuntime42 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
|
|
|
71980
71987
|
slideRelationshipRegistry,
|
|
71981
71988
|
resolveHyperlinkRelationshipId: (target, forceExternal) => slideRelationshipRegistry.resolveHyperlinkRelationshipId(target, forceExternal),
|
|
71982
71989
|
getSlideRelationshipMap: () => slideRelationshipRegistry.toRelationshipMap(),
|
|
71990
|
+
slideTargetAt: (index) => {
|
|
71991
|
+
const target = slidePaths[index];
|
|
71992
|
+
return target ? relativePartTarget2(slide.id, target) : void 0;
|
|
71993
|
+
},
|
|
71983
71994
|
resolvedMediaBytes,
|
|
71984
71995
|
saveSession,
|
|
71985
71996
|
slideImageRelationshipType: constants.slideImageRelationshipType,
|
|
@@ -74204,8 +74215,9 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
74204
74215
|
await this.ensureNotesMasterForAuthoredNotes(slides, saveConstants);
|
|
74205
74216
|
await this.ensureHandoutMasterInfrastructure(options?.handoutMaster, saveConstants);
|
|
74206
74217
|
this.templateElementBaselines.beginSave();
|
|
74218
|
+
const slidePaths = slides.map((slide) => slide.id);
|
|
74207
74219
|
for (const slide of slides) {
|
|
74208
|
-
await this.processSlideForSave(slide, saveSession, saveConstants);
|
|
74220
|
+
await this.processSlideForSave(slide, saveSession, saveConstants, slidePaths);
|
|
74209
74221
|
}
|
|
74210
74222
|
this.templateElementBaselines.commitSave();
|
|
74211
74223
|
const contentTypesXml3 = await this.zip.file("[Content_Types].xml")?.async("string");
|
|
@@ -74683,7 +74695,13 @@ var PptxHandlerRuntime55 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
74683
74695
|
if (posterRId && relsMap) {
|
|
74684
74696
|
const posterTarget = relsMap.get(posterRId);
|
|
74685
74697
|
if (posterTarget) {
|
|
74686
|
-
if (posterTarget.startsWith("http://") || posterTarget.startsWith("https://")
|
|
74698
|
+
if (posterTarget.startsWith("http://") || posterTarget.startsWith("https://")) {
|
|
74699
|
+
if (this.allowExternalImages === true) {
|
|
74700
|
+
posterImage = posterTarget;
|
|
74701
|
+
imagePath = posterTarget;
|
|
74702
|
+
imageData = posterTarget;
|
|
74703
|
+
}
|
|
74704
|
+
} else if (posterTarget.startsWith("data:")) {
|
|
74687
74705
|
posterImage = posterTarget;
|
|
74688
74706
|
imagePath = posterTarget;
|
|
74689
74707
|
imageData = posterTarget;
|
|
@@ -75813,7 +75831,12 @@ var PptxHandlerRuntime61 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
|
|
|
75813
75831
|
const slideRels = this.slideRelsMap.get(slidePath);
|
|
75814
75832
|
const target = slideRels?.get(relId);
|
|
75815
75833
|
if (target) {
|
|
75816
|
-
if (target.startsWith("http://") || target.startsWith("https://")
|
|
75834
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
75835
|
+
if (this.allowExternalImages === true) {
|
|
75836
|
+
imagePath = target;
|
|
75837
|
+
imageData = target;
|
|
75838
|
+
}
|
|
75839
|
+
} else if (target.startsWith("data:")) {
|
|
75817
75840
|
imagePath = target;
|
|
75818
75841
|
imageData = target;
|
|
75819
75842
|
} else {
|
|
@@ -76267,7 +76290,9 @@ var PptxHandlerRuntime63 = class extends PptxHandlerRuntime62 {
|
|
|
76267
76290
|
const target = slideRels?.get(imageRelId);
|
|
76268
76291
|
let imageDataUrl;
|
|
76269
76292
|
if (target) {
|
|
76270
|
-
if (target.startsWith("http://") || target.startsWith("https://")
|
|
76293
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
76294
|
+
imageDataUrl = this.allowExternalImages === true ? target : void 0;
|
|
76295
|
+
} else if (target.startsWith("data:")) {
|
|
76271
76296
|
imageDataUrl = target;
|
|
76272
76297
|
} else {
|
|
76273
76298
|
const imagePath = this.resolveImagePath(slidePath, target);
|
|
@@ -85573,6 +85598,7 @@ var PptxHandlerRuntime100 = class _PptxHandlerRuntime extends PptxHandlerRuntime
|
|
|
85573
85598
|
async enrichBulletPictureElementsWithEmbeddedData(elements2, slidePath) {
|
|
85574
85599
|
await enrichBulletPictureImages(elements2, slidePath, {
|
|
85575
85600
|
slideRelsMap: this.slideRelsMap,
|
|
85601
|
+
allowExternalImages: this.allowExternalImages === true,
|
|
85576
85602
|
resolveImagePath: (path3, target) => this.resolveImagePath(path3, target),
|
|
85577
85603
|
getImageData: (imagePath) => this.getImageData(imagePath)
|
|
85578
85604
|
});
|
|
@@ -21977,7 +21977,7 @@ function findTextBearingElementById(elements3, elementId) {
|
|
|
21977
21977
|
}
|
|
21978
21978
|
async function loadNestedDeck(pptxBytes) {
|
|
21979
21979
|
try {
|
|
21980
|
-
const { PptxHandler } = await import('./PptxHandler-
|
|
21980
|
+
const { PptxHandler } = await import('./PptxHandler-HEPPGI32.mjs');
|
|
21981
21981
|
const handler = new PptxHandler();
|
|
21982
21982
|
const data = await handler.load(pptxBytes.buffer.slice(0));
|
|
21983
21983
|
return { handler, slides: data.slides };
|