ooxml-core 1.47.0 → 1.48.1
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-6UQWMUVU.cjs +14 -0
- package/dist/{PptxHandler-NXHZ6ITL.mjs → PptxHandler-PLSH2BAS.mjs} +2 -2
- package/dist/PptxHandler-QLKZVYCG.mjs +5 -0
- package/dist/{PresentationBuilder-URSPID7L.mjs → PresentationBuilder-3QXOJNRO.mjs} +2 -2
- package/dist/{PresentationBuilder-IK6NIK6T.cjs → PresentationBuilder-CRBFFHNW.cjs} +6 -6
- package/dist/{PresentationBuilder-LHQ333UL.mjs → PresentationBuilder-DQ3XFU4R.mjs} +3 -3
- package/dist/{chunk-QHR726W3.mjs → chunk-32K7JG2Z.mjs} +1 -1
- package/dist/{chunk-APCA7N6Q.cjs → chunk-7RCBSNXT.cjs} +3 -3
- package/dist/{chunk-6MU4WKHS.mjs → chunk-CXIDPUT6.mjs} +1 -1
- package/dist/{chunk-553WFEHD.mjs → chunk-EKEE6BTU.mjs} +638 -50
- package/dist/{chunk-XVEJS7HN.mjs → chunk-IKFTITJ7.mjs} +4 -4
- package/dist/{chunk-7L6ZAA5Y.mjs → chunk-K5G6MV37.mjs} +2 -2
- package/dist/{chunk-4GPLQEEC.cjs → chunk-RRA262A6.cjs} +1926 -1326
- package/dist/{chunk-5HNRZOBX.mjs → chunk-WAYEYX4G.mjs} +1 -1
- package/dist/{chunk-Z734BYYR.mjs → chunk-WLKOLTBH.mjs} +653 -53
- package/dist/pptx/automation/index.cjs +45094 -44442
- package/dist/pptx/automation/index.d.ts +5 -12
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/element-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/element-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/export-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/export-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/index.d.ts +8 -8
- package/dist/pptx/automation/schemas/index.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/json-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/json-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/layout-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/layout-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/lock-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/lock-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/ole-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/ole-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/section-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/section-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/slide-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/slide-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/template-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/template-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/theme-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/theme-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/validation-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/validation-schemas.d.ts.map +1 -1
- package/dist/pptx/chunks/color-primitives-DHyz14D9.d.ts +151 -0
- package/dist/pptx/chunks/color-primitives-DHyz14D9.d.ts.map +1 -0
- package/dist/pptx/chunks/{index--HBUyILF.d.ts → index-7tA9HqRL.d.ts} +10060 -1223
- package/dist/pptx/chunks/index-7tA9HqRL.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-Dr3iIPt9.d.ts → index-CAzt1jbx.d.ts} +4 -5
- package/dist/pptx/chunks/index-CAzt1jbx.d.ts.map +1 -0
- package/dist/pptx/chunks/{schemas-LHsDbVOw.d.ts → index-CyAgQ2zG.d.ts} +6 -2
- package/dist/pptx/chunks/index-CyAgQ2zG.d.ts.map +1 -0
- package/dist/pptx/chunks/index-cJSPBkU1.d.ts +185 -0
- package/dist/pptx/chunks/index-cJSPBkU1.d.ts.map +1 -0
- package/dist/pptx/chunks/index-cr_sgz1w.d.ts +94 -0
- package/dist/pptx/chunks/index-cr_sgz1w.d.ts.map +1 -0
- package/dist/pptx/chunks/presentation-Be108jrz.d.ts +12521 -0
- package/dist/pptx/chunks/presentation-Be108jrz.d.ts.map +1 -0
- package/dist/pptx/chunks/{inspection-status-TKac7eqb.d.ts → signature-inspection-status-TKac7eqb.d.ts} +1 -1
- package/dist/pptx/chunks/signature-inspection-status-TKac7eqb.d.ts.map +1 -0
- package/dist/pptx/chunks/text-operations-a1cqBYk9.d.ts +111 -0
- package/dist/pptx/chunks/text-operations-a1cqBYk9.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +746 -94
- package/dist/pptx/cli/index.d.ts +17 -1
- package/dist/pptx/cli/index.d.ts.map +1 -1
- 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/ai/table-merge.d.ts +16 -0
- package/dist/pptx/editor/ai/table-merge.d.ts.map +1 -1
- package/dist/pptx/editor/loader/element-patch-walker.d.ts +15 -0
- package/dist/pptx/editor/loader/element-patch-walker.d.ts.map +1 -1
- package/dist/pptx/editor/loader/lazy-image-resolution.d.ts +15 -0
- package/dist/pptx/editor/loader/lazy-image-resolution.d.ts.map +1 -1
- package/dist/pptx/editor/loader/load-content-helpers.d.ts +7 -0
- package/dist/pptx/editor/loader/load-content-helpers.d.ts.map +1 -1
- package/dist/pptx/editor/loader/table-style-image-paths.d.ts +20 -0
- package/dist/pptx/editor/loader/table-style-image-paths.d.ts.map +1 -1
- package/dist/pptx/editor/loader/text-fill-image-paths.d.ts +19 -0
- package/dist/pptx/editor/loader/text-fill-image-paths.d.ts.map +1 -1
- package/dist/pptx/editor/render/bullet-autonum.d.ts +14 -0
- package/dist/pptx/editor/render/bullet-list.d.ts +8 -0
- package/dist/pptx/editor/render/bullet-list.d.ts.map +1 -1
- package/dist/pptx/editor/render/bullet-toggle.d.ts +4 -0
- package/dist/pptx/editor/render/bullet-toggle.d.ts.map +1 -1
- package/dist/pptx/editor/render/chart-user-shape-edit.d.ts +12 -0
- package/dist/pptx/editor/render/chart-user-shape-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/clone.d.ts +20 -0
- package/dist/pptx/editor/render/clone.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-assets.d.ts +17 -0
- package/dist/pptx/editor/render/collaboration-live-patch-target.d.ts +9 -0
- package/dist/pptx/editor/render/collaboration-live-patch-target.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-reconcile.d.ts +21 -0
- package/dist/pptx/editor/render/collaboration-reconcile.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-sync.d.ts +32 -4
- package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-text-codec.d.ts +33 -2
- package/dist/pptx/editor/render/collaboration-text-codec.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-merge.d.ts +36 -2
- package/dist/pptx/editor/render/collaboration-text-merge.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-native-edit.d.ts +2 -2
- package/dist/pptx/editor/render/collaboration-text-positions.d.ts +34 -2
- package/dist/pptx/editor/render/collaboration-text-positions.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-projection.d.ts +1 -1
- package/dist/pptx/editor/render/collaboration-text-session-apply.d.ts +3 -3
- package/dist/pptx/editor/render/collaboration-text-session-delta.d.ts +36 -2
- package/dist/pptx/editor/render/collaboration-text-session-delta.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-session-paragraph.d.ts +1 -1
- package/dist/pptx/editor/render/collaboration-text-session.d.ts +40 -2
- package/dist/pptx/editor/render/collaboration-text-session.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-snapshot-positions.d.ts +2 -2
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.d.ts +14 -0
- package/dist/pptx/editor/render/custom-show-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/deck-save-encryption.d.ts +24 -0
- package/dist/pptx/editor/render/deck-save-encryption.d.ts.map +1 -1
- package/dist/pptx/editor/render/element-locks.d.ts +25 -0
- package/dist/pptx/editor/render/element-locks.d.ts.map +1 -1
- package/dist/pptx/editor/render/element-operations.d.ts +11 -0
- package/dist/pptx/editor/render/element-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/element.d.ts +12 -0
- package/dist/pptx/editor/render/element.d.ts.map +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.d.ts +8 -2
- package/dist/pptx/editor/render/find-replace.d.ts.map +1 -1
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/font-family-update.d.ts +32 -1
- package/dist/pptx/editor/render/font-family-update.d.ts.map +1 -1
- package/dist/pptx/editor/render/group-drill.d.ts +26 -0
- package/dist/pptx/editor/render/group-drill.d.ts.map +1 -1
- package/dist/pptx/editor/render/group-ops.d.ts +24 -0
- package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +21 -1
- package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts.map +1 -1
- package/dist/pptx/editor/render/remap-text.d.ts +5 -0
- package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
- package/dist/pptx/editor/render/section-operations.d.ts +14 -0
- package/dist/pptx/editor/render/section-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-background-patch.d.ts +15 -0
- package/dist/pptx/editor/render/slide-background-patch.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.d.ts +12 -0
- package/dist/pptx/editor/render/slide-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/editor/render/slide-search.d.ts +6 -0
- package/dist/pptx/editor/render/slide-search.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-size-rescale.d.ts +18 -0
- package/dist/pptx/editor/render/slide-size-rescale.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-transition-edits.d.ts +15 -0
- package/dist/pptx/editor/render/slide-transition-edits.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-cell-edit.d.ts +8 -0
- package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-cell-merge.d.ts +15 -0
- package/dist/pptx/editor/render/table-cell-merge.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-data-grid-ops.d.ts +26 -0
- package/dist/pptx/editor/render/table-data-grid-ops.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-layout.d.ts +3 -1
- package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-merge.d.ts +16 -0
- package/dist/pptx/editor/render/table-merge.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-editor-descriptor.d.ts +13 -0
- package/dist/pptx/editor/render/table-style-editor-descriptor.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-editor-edit.d.ts +13 -0
- package/dist/pptx/editor/render/table-style-editor-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-editor-parts.d.ts +10 -0
- package/dist/pptx/editor/render/table-style-editor-parts.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-map-edits.d.ts +20 -0
- package/dist/pptx/editor/render/table-style-map-edits.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-content-style.d.ts +2 -1
- package/dist/pptx/editor/render/text-content-style.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +2 -2
- package/dist/pptx/editor/render/text-segment-paragraph-break.d.ts +23 -0
- package/dist/pptx/editor/render/text-segment-paragraph-break.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +20 -2
- package/dist/pptx/editor/render/text-style-scope.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-theme.d.ts +11 -0
- package/dist/pptx/editor/render/text-theme.d.ts.map +1 -1
- package/dist/pptx/editor/render/theme-editor-presets.d.ts +9 -0
- package/dist/pptx/editor/render/theme-editor-presets.d.ts.map +1 -1
- package/dist/pptx/editor/render/update-text-segment-style.d.ts +2 -1
- package/dist/pptx/editor/render/update-text-segment-style.d.ts.map +1 -1
- package/dist/pptx/index.cjs +34610 -33974
- package/dist/pptx/index.d.ts +24 -10
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +17 -1
- package/dist/pptx/node/index.d.ts.map +1 -1
- package/dist/pptx/signature-node/index.d.ts +8 -1
- package/dist/pptx/signature-node/index.d.ts.map +1 -1
- package/dist/pptx/smartart-layouts/index.d.ts +8 -1
- package/dist/pptx/smartart-layouts/index.d.ts.map +1 -1
- package/dist/pptx/ui/index.d.ts +2 -0
- package/dist/pptx/ui/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/PptxHandler-JX62VKU4.cjs +0 -14
- package/dist/PptxHandler-SUGLNSZI.mjs +0 -5
- package/dist/pptx/chunks/collaboration-text-codec-1VmwD3yq.d.ts +0 -34
- package/dist/pptx/chunks/collaboration-text-codec-1VmwD3yq.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-merge-B-tth-0W.d.ts +0 -19
- package/dist/pptx/chunks/collaboration-text-merge-B-tth-0W.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-positions-D-1Jo1Fz.d.ts +0 -34
- package/dist/pptx/chunks/collaboration-text-positions-D-1Jo1Fz.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-session-CWHTaWF4.d.ts +0 -41
- package/dist/pptx/chunks/collaboration-text-session-CWHTaWF4.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-session-delta-Dxzybssp.d.ts +0 -37
- package/dist/pptx/chunks/collaboration-text-session-delta-Dxzybssp.d.ts.map +0 -1
- package/dist/pptx/chunks/elements-B4Z6N-Gz.d.ts +0 -3993
- package/dist/pptx/chunks/elements-B4Z6N-Gz.d.ts.map +0 -1
- package/dist/pptx/chunks/index--HBUyILF.d.ts.map +0 -1
- package/dist/pptx/chunks/index-BDVzSboe.d.ts +0 -9746
- package/dist/pptx/chunks/index-BDVzSboe.d.ts.map +0 -1
- package/dist/pptx/chunks/index-Dr3iIPt9.d.ts.map +0 -1
- package/dist/pptx/chunks/inspection-status-TKac7eqb.d.ts.map +0 -1
- package/dist/pptx/chunks/schemas-LHsDbVOw.d.ts.map +0 -1
- package/dist/pptx/chunks/smart-art-DB37AsFP.d.ts +0 -1817
- package/dist/pptx/chunks/smart-art-DB37AsFP.d.ts.map +0 -1
- package/dist/pptx/chunks/table-BfgZfw5R.d.ts +0 -1359
- package/dist/pptx/chunks/table-BfgZfw5R.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-CVHXOSit.d.ts +0 -3363
- package/dist/pptx/chunks/text-operations-CVHXOSit.d.ts.map +0 -1
- package/dist/pptx/chunks/text-t_wJ2OwM.d.ts +0 -1452
- package/dist/pptx/chunks/text-t_wJ2OwM.d.ts.map +0 -1
- /package/dist/{chunk-WFN6ZU7N.cjs → chunk-HBQBS7PO.cjs} +0 -0
- /package/dist/{chunk-DEDK2J57.mjs → chunk-I5REMIZR.mjs} +0 -0
package/dist/pptx/cli/index.cjs
CHANGED
|
@@ -35289,13 +35289,13 @@ function resolveDrawingColor(color3, theme, options2) {
|
|
|
35289
35289
|
}
|
|
35290
35290
|
let { r, g: g3, b } = rgb;
|
|
35291
35291
|
const find = (name) => color3.transforms.find((entry2) => entry2.name === name)?.value;
|
|
35292
|
-
const
|
|
35293
|
-
if (
|
|
35292
|
+
const has3 = (name) => color3.transforms.some((entry2) => entry2.name === name);
|
|
35293
|
+
if (has3("comp")) {
|
|
35294
35294
|
const hsl = rgbToHsl(r, g3, b);
|
|
35295
35295
|
({ r, g: g3, b } = hslToRgb((hsl.h + 180) % 360, hsl.s, hsl.l));
|
|
35296
35296
|
}
|
|
35297
|
-
if (
|
|
35298
|
-
if (
|
|
35297
|
+
if (has3("inv")) [r, g3, b] = [255 - r, 255 - g3, 255 - b];
|
|
35298
|
+
if (has3("gray")) r = g3 = b = Math.round(0.299 * r + 0.587 * g3 + 0.114 * b);
|
|
35299
35299
|
const shade = parseDrawingPercent(find("shade"));
|
|
35300
35300
|
if (shade !== void 0) {
|
|
35301
35301
|
r = linearToSrgb255(srgb255ToLinear(r) * shade);
|
|
@@ -35308,7 +35308,7 @@ function resolveDrawingColor(color3, theme, options2) {
|
|
|
35308
35308
|
g3 = linearToSrgb255(1 - (1 - srgb255ToLinear(g3)) * tint);
|
|
35309
35309
|
b = linearToSrgb255(1 - (1 - srgb255ToLinear(b)) * tint);
|
|
35310
35310
|
}
|
|
35311
|
-
if (["hue", "hueMod", "hueOff", "sat", "satMod", "satOff", "lum", "lumMod", "lumOff"].some(
|
|
35311
|
+
if (["hue", "hueMod", "hueOff", "sat", "satMod", "satOff", "lum", "lumMod", "lumOff"].some(has3)) {
|
|
35312
35312
|
const hsl = rgbToHsl(r, g3, b);
|
|
35313
35313
|
const wrap2 = (degrees) => (degrees % 360 + 360) % 360;
|
|
35314
35314
|
const hueAbs = parseDrawingHueDegrees(find("hue"));
|
|
@@ -45779,6 +45779,22 @@ var init_ole2_parser = __esm({
|
|
|
45779
45779
|
}
|
|
45780
45780
|
});
|
|
45781
45781
|
|
|
45782
|
+
// pptx/core/utils/modify-verifier-codec.ts
|
|
45783
|
+
function base64Encode2(bytes) {
|
|
45784
|
+
if (typeof Buffer !== "undefined") {
|
|
45785
|
+
return Buffer.from(bytes).toString("base64");
|
|
45786
|
+
}
|
|
45787
|
+
let binary = "";
|
|
45788
|
+
for (let i2 = 0; i2 < bytes.length; i2++) {
|
|
45789
|
+
binary += String.fromCharCode(bytes[i2]);
|
|
45790
|
+
}
|
|
45791
|
+
return btoa(binary);
|
|
45792
|
+
}
|
|
45793
|
+
var init_modify_verifier_codec = __esm({
|
|
45794
|
+
"pptx/core/utils/modify-verifier-codec.ts"() {
|
|
45795
|
+
}
|
|
45796
|
+
});
|
|
45797
|
+
|
|
45782
45798
|
// pptx/core/utils/signature-detection.ts
|
|
45783
45799
|
var init_signature_detection = __esm({
|
|
45784
45800
|
"pptx/core/utils/signature-detection.ts"() {
|
|
@@ -61332,6 +61348,216 @@ var init_chart_layout_operations = __esm({
|
|
|
61332
61348
|
}
|
|
61333
61349
|
});
|
|
61334
61350
|
|
|
61351
|
+
// pptx/core/builders/sdk/picture-layout-input.ts
|
|
61352
|
+
function finite4(where, name, value) {
|
|
61353
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
61354
|
+
throw new RangeError(`${where}.${name} must be a finite number, got ${String(value)}`);
|
|
61355
|
+
}
|
|
61356
|
+
return value;
|
|
61357
|
+
}
|
|
61358
|
+
function tileLayout(where, tile) {
|
|
61359
|
+
const scale = (name) => {
|
|
61360
|
+
const value = finite4(where, `tile.${name}`, tile[name] ?? 1);
|
|
61361
|
+
if (value <= 0) {
|
|
61362
|
+
throw new RangeError(`${where}.tile.${name} must be above 0, got ${value}`);
|
|
61363
|
+
}
|
|
61364
|
+
return value;
|
|
61365
|
+
};
|
|
61366
|
+
const flip = tile.flip ?? "none";
|
|
61367
|
+
if (!FLIPS.has(flip)) {
|
|
61368
|
+
throw new RangeError(`${where}.tile.flip must be none, x, y or xy, got ${String(flip)}`);
|
|
61369
|
+
}
|
|
61370
|
+
const alignment = tile.alignment ?? "tl";
|
|
61371
|
+
if (!ALIGNMENTS.has(alignment)) {
|
|
61372
|
+
throw new RangeError(
|
|
61373
|
+
`${where}.tile.alignment must be one of ${[...ALIGNMENTS].join(", ")}, got ${String(alignment)}`
|
|
61374
|
+
);
|
|
61375
|
+
}
|
|
61376
|
+
return {
|
|
61377
|
+
tileOffsetX: finite4(where, "tile.offsetX", tile.offsetX ?? 0),
|
|
61378
|
+
tileOffsetY: finite4(where, "tile.offsetY", tile.offsetY ?? 0),
|
|
61379
|
+
tileScaleX: scale("scaleX"),
|
|
61380
|
+
tileScaleY: scale("scaleY"),
|
|
61381
|
+
tileFlip: flip,
|
|
61382
|
+
tileAlignment: alignment
|
|
61383
|
+
};
|
|
61384
|
+
}
|
|
61385
|
+
function fillRectLayout(where, rect2) {
|
|
61386
|
+
const inset = (name) => {
|
|
61387
|
+
const value = finite4(where, `fillRect.${name}`, rect2[name]);
|
|
61388
|
+
if (Math.abs(value) > MAX_INSET) {
|
|
61389
|
+
throw new RangeError(
|
|
61390
|
+
`${where}.fillRect.${name} must be between -${MAX_INSET} and ${MAX_INSET}, got ${value}`
|
|
61391
|
+
);
|
|
61392
|
+
}
|
|
61393
|
+
return value;
|
|
61394
|
+
};
|
|
61395
|
+
const layout = {
|
|
61396
|
+
fillRectLeft: inset("l"),
|
|
61397
|
+
fillRectTop: inset("t"),
|
|
61398
|
+
fillRectRight: inset("r"),
|
|
61399
|
+
fillRectBottom: inset("b")
|
|
61400
|
+
};
|
|
61401
|
+
if (layout.fillRectLeft + layout.fillRectRight >= 1) {
|
|
61402
|
+
throw new RangeError(`${where}.fillRect.l + r must be below 1, which leaves no picture`);
|
|
61403
|
+
}
|
|
61404
|
+
if (layout.fillRectTop + layout.fillRectBottom >= 1) {
|
|
61405
|
+
throw new RangeError(`${where}.fillRect.t + b must be below 1, which leaves no picture`);
|
|
61406
|
+
}
|
|
61407
|
+
return layout;
|
|
61408
|
+
}
|
|
61409
|
+
function mapPictureLayoutInput(where, input) {
|
|
61410
|
+
const { mode, tile, fillRect } = input;
|
|
61411
|
+
if (mode !== void 0 && mode !== "stretch" && mode !== "tile") {
|
|
61412
|
+
throw new RangeError(`${where}.mode must be 'stretch' or 'tile', got ${String(mode)}`);
|
|
61413
|
+
}
|
|
61414
|
+
if (tile && fillRect) {
|
|
61415
|
+
throw new RangeError(`${where} takes a tile or a fillRect, not both`);
|
|
61416
|
+
}
|
|
61417
|
+
if (tile && mode === "stretch") {
|
|
61418
|
+
throw new RangeError(`${where}.tile needs mode 'tile', got 'stretch'`);
|
|
61419
|
+
}
|
|
61420
|
+
if (fillRect && mode === "tile") {
|
|
61421
|
+
throw new RangeError(`${where}.fillRect needs mode 'stretch', got 'tile'`);
|
|
61422
|
+
}
|
|
61423
|
+
if (tile || mode === "tile") {
|
|
61424
|
+
return tileLayout(where, tile ?? {});
|
|
61425
|
+
}
|
|
61426
|
+
return fillRect ? fillRectLayout(where, fillRect) : void 0;
|
|
61427
|
+
}
|
|
61428
|
+
var FLIPS, ALIGNMENTS, MAX_INSET;
|
|
61429
|
+
var init_picture_layout_input = __esm({
|
|
61430
|
+
"pptx/core/builders/sdk/picture-layout-input.ts"() {
|
|
61431
|
+
FLIPS = /* @__PURE__ */ new Set(["none", "x", "y", "xy"]);
|
|
61432
|
+
ALIGNMENTS = /* @__PURE__ */ new Set([
|
|
61433
|
+
"tl",
|
|
61434
|
+
"t",
|
|
61435
|
+
"tr",
|
|
61436
|
+
"l",
|
|
61437
|
+
"ctr",
|
|
61438
|
+
"r",
|
|
61439
|
+
"bl",
|
|
61440
|
+
"b",
|
|
61441
|
+
"br"
|
|
61442
|
+
]);
|
|
61443
|
+
MAX_INSET = 10;
|
|
61444
|
+
}
|
|
61445
|
+
});
|
|
61446
|
+
|
|
61447
|
+
// pptx/core/builders/sdk/link-input.ts
|
|
61448
|
+
function mapLinkToAction(link) {
|
|
61449
|
+
if (!link) {
|
|
61450
|
+
return void 0;
|
|
61451
|
+
}
|
|
61452
|
+
const tooltip = link.tooltip !== void 0 ? { tooltip: link.tooltip } : {};
|
|
61453
|
+
if ("url" in link) {
|
|
61454
|
+
return { url: assertUrl(link.url), ...tooltip };
|
|
61455
|
+
}
|
|
61456
|
+
assertSlideIndex(link.slideIndex);
|
|
61457
|
+
return { action: SLIDE_JUMP_ACTION, targetSlideIndex: link.slideIndex, ...tooltip };
|
|
61458
|
+
}
|
|
61459
|
+
function mapLinkToRunStyle(link) {
|
|
61460
|
+
if (!link) {
|
|
61461
|
+
return {};
|
|
61462
|
+
}
|
|
61463
|
+
const tooltip = link.tooltip !== void 0 ? { hyperlinkTooltip: link.tooltip } : {};
|
|
61464
|
+
if ("url" in link) {
|
|
61465
|
+
return { hyperlink: assertUrl(link.url), ...tooltip };
|
|
61466
|
+
}
|
|
61467
|
+
assertSlideIndex(link.slideIndex);
|
|
61468
|
+
return {
|
|
61469
|
+
hyperlink: SLIDE_JUMP_ACTION,
|
|
61470
|
+
hyperlinkAction: SLIDE_JUMP_ACTION,
|
|
61471
|
+
hyperlinkTargetSlideIndex: link.slideIndex,
|
|
61472
|
+
...tooltip
|
|
61473
|
+
};
|
|
61474
|
+
}
|
|
61475
|
+
function assertUrl(url) {
|
|
61476
|
+
if (typeof url !== "string" || url.trim() === "") {
|
|
61477
|
+
throw new RangeError("LinkInput.url must be a non-empty address");
|
|
61478
|
+
}
|
|
61479
|
+
return url;
|
|
61480
|
+
}
|
|
61481
|
+
function assertSlideIndex(index) {
|
|
61482
|
+
if (!Number.isInteger(index) || index < 0) {
|
|
61483
|
+
throw new RangeError(`LinkInput.slideIndex must be a 0-based slide position, got ${index}`);
|
|
61484
|
+
}
|
|
61485
|
+
}
|
|
61486
|
+
var SLIDE_JUMP_ACTION;
|
|
61487
|
+
var init_link_input = __esm({
|
|
61488
|
+
"pptx/core/builders/sdk/link-input.ts"() {
|
|
61489
|
+
SLIDE_JUMP_ACTION = "ppaction://hlinksldjump";
|
|
61490
|
+
}
|
|
61491
|
+
});
|
|
61492
|
+
|
|
61493
|
+
// pptx/core/core/runtime/picture-svg-blip.ts
|
|
61494
|
+
function addSvgBlipExtension(picture, relationshipId2) {
|
|
61495
|
+
const blipFill = picture["p:blipFill"];
|
|
61496
|
+
const blip = blipFill?.["a:blip"];
|
|
61497
|
+
if (!blip || typeof blip !== "object") {
|
|
61498
|
+
return;
|
|
61499
|
+
}
|
|
61500
|
+
const ext = {
|
|
61501
|
+
"@_uri": SVG_BLIP_EXT_URI,
|
|
61502
|
+
"asvg:svgBlip": { "@_xmlns:asvg": SVG_NS2, "@_r:embed": relationshipId2 }
|
|
61503
|
+
};
|
|
61504
|
+
const extLst = blip["a:extLst"] ?? {};
|
|
61505
|
+
const existing = extLst["a:ext"];
|
|
61506
|
+
const list3 = existing === void 0 ? [] : Array.isArray(existing) ? existing : [existing];
|
|
61507
|
+
extLst["a:ext"] = list3.length === 0 ? ext : [...list3, ext];
|
|
61508
|
+
blip["a:extLst"] = extLst;
|
|
61509
|
+
}
|
|
61510
|
+
var SVG_BLIP_EXT_URI, SVG_NS2, TRANSPARENT_PNG_DATA_URL;
|
|
61511
|
+
var init_picture_svg_blip = __esm({
|
|
61512
|
+
"pptx/core/core/runtime/picture-svg-blip.ts"() {
|
|
61513
|
+
SVG_BLIP_EXT_URI = "{96DAC541-7B7A-43D3-8B79-37D633B846F1}";
|
|
61514
|
+
SVG_NS2 = "http://schemas.microsoft.com/office/drawing/2016/SVG/main";
|
|
61515
|
+
TRANSPARENT_PNG_DATA_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNgAAIAAAUAAen63NgAAAAASUVORK5CYII=";
|
|
61516
|
+
}
|
|
61517
|
+
});
|
|
61518
|
+
|
|
61519
|
+
// pptx/core/builders/sdk/svg-picture-input.ts
|
|
61520
|
+
function svgPictureSource(source2, svgFallback) {
|
|
61521
|
+
if (svgFallback !== void 0 && SVG_DATA_URL.test(svgFallback)) {
|
|
61522
|
+
throw new RangeError("ImageOptions.svgFallback must be a raster image, not SVG");
|
|
61523
|
+
}
|
|
61524
|
+
const match = SVG_DATA_URL.exec(source2);
|
|
61525
|
+
if (!match?.groups) {
|
|
61526
|
+
if (svgFallback !== void 0) {
|
|
61527
|
+
throw new RangeError("ImageOptions.svgFallback applies only to an SVG data URL source");
|
|
61528
|
+
}
|
|
61529
|
+
return void 0;
|
|
61530
|
+
}
|
|
61531
|
+
const params = match.groups["params"] ?? "";
|
|
61532
|
+
const payload = match.groups["payload"] ?? "";
|
|
61533
|
+
const base64 = /;base64$/iu.test(params);
|
|
61534
|
+
const text2 = base64 ? decodeBase64Text(payload) : decodeURIComponent(payload);
|
|
61535
|
+
if (!/<svg[\s>]/iu.test(text2)) {
|
|
61536
|
+
throw new RangeError("An SVG picture source must hold an <svg> element");
|
|
61537
|
+
}
|
|
61538
|
+
return {
|
|
61539
|
+
svgData: base64 ? `data:image/svg+xml;base64,${payload.replace(/\s+/gu, "")}` : `data:image/svg+xml;base64,${base64Encode2(new TextEncoder().encode(text2))}`,
|
|
61540
|
+
raster: svgFallback ?? TRANSPARENT_PNG_DATA_URL
|
|
61541
|
+
};
|
|
61542
|
+
}
|
|
61543
|
+
function decodeBase64Text(payload) {
|
|
61544
|
+
try {
|
|
61545
|
+
const binary = atob(payload.replace(/\s+/gu, ""));
|
|
61546
|
+
const bytes = Uint8Array.from(binary, (ch) => ch.charCodeAt(0));
|
|
61547
|
+
return new TextDecoder().decode(bytes);
|
|
61548
|
+
} catch {
|
|
61549
|
+
throw new RangeError("An SVG picture source has base64 data that cannot be read");
|
|
61550
|
+
}
|
|
61551
|
+
}
|
|
61552
|
+
var SVG_DATA_URL;
|
|
61553
|
+
var init_svg_picture_input = __esm({
|
|
61554
|
+
"pptx/core/builders/sdk/svg-picture-input.ts"() {
|
|
61555
|
+
init_picture_svg_blip();
|
|
61556
|
+
init_modify_verifier_codec();
|
|
61557
|
+
SVG_DATA_URL = /^data:image\/svg\+xml(?<params>[^,]*),(?<payload>[\s\S]*)$/iu;
|
|
61558
|
+
}
|
|
61559
|
+
});
|
|
61560
|
+
|
|
61335
61561
|
// pptx/core/builders/sdk/picture-effects-input.ts
|
|
61336
61562
|
function pictureEffectsFromInput(options2) {
|
|
61337
61563
|
const { opacity: opacity2, brightness, contrast } = options2 ?? {};
|
|
@@ -61415,12 +61641,18 @@ function mapFillToShapeStyle(fill3) {
|
|
|
61415
61641
|
...fill3.foreground !== void 0 ? { fillColor: fill3.foreground } : {},
|
|
61416
61642
|
fillPatternBackgroundColor: fill3.background
|
|
61417
61643
|
};
|
|
61418
|
-
case "image":
|
|
61644
|
+
case "image": {
|
|
61645
|
+
if (typeof fill3.url !== "string" || !fill3.url.startsWith("data:")) {
|
|
61646
|
+
throw new RangeError("FillInput.url of an image fill must be a data: URL");
|
|
61647
|
+
}
|
|
61648
|
+
const layout = mapPictureLayoutInput("FillInput", fill3);
|
|
61419
61649
|
return {
|
|
61420
61650
|
fillMode: "image",
|
|
61421
61651
|
fillImageUrl: fill3.url,
|
|
61422
|
-
fillImageMode:
|
|
61652
|
+
fillImageMode: layout?.tileScaleX !== void 0 ? "tile" : "stretch",
|
|
61653
|
+
...layout ? { fillImageLayout: layout } : {}
|
|
61423
61654
|
};
|
|
61655
|
+
}
|
|
61424
61656
|
case "none":
|
|
61425
61657
|
return { fillMode: "none" };
|
|
61426
61658
|
default:
|
|
@@ -61549,6 +61781,7 @@ function buildShapeStyle(opts) {
|
|
|
61549
61781
|
var DASH_UNITS_PER_WIDTH, MITER_UNITS_PER_RATIO;
|
|
61550
61782
|
var init_shape_style_input = __esm({
|
|
61551
61783
|
"pptx/core/builders/sdk/shape-style-input.ts"() {
|
|
61784
|
+
init_picture_layout_input();
|
|
61552
61785
|
DASH_UNITS_PER_WIDTH = 1e5;
|
|
61553
61786
|
MITER_UNITS_PER_RATIO = 1e5;
|
|
61554
61787
|
}
|
|
@@ -61785,6 +62018,67 @@ var init_table_merge_input = __esm({
|
|
|
61785
62018
|
}
|
|
61786
62019
|
});
|
|
61787
62020
|
|
|
62021
|
+
// pptx/core/builders/sdk/text-body-input.ts
|
|
62022
|
+
function mapTextBodyInput(input) {
|
|
62023
|
+
const style = {};
|
|
62024
|
+
if (!input) {
|
|
62025
|
+
return style;
|
|
62026
|
+
}
|
|
62027
|
+
const { insets, autoFit, wrap: wrap2 } = input;
|
|
62028
|
+
for (const side of Object.keys(INSET_FIELDS)) {
|
|
62029
|
+
const value = insets?.[side];
|
|
62030
|
+
if (value === void 0) {
|
|
62031
|
+
continue;
|
|
62032
|
+
}
|
|
62033
|
+
if (!Number.isFinite(value) || Math.abs(value * EMU_PER_PX8) > MAX_INSET_EMU) {
|
|
62034
|
+
throw new RangeError(`insets.${side} must be a finite px length, got ${value}`);
|
|
62035
|
+
}
|
|
62036
|
+
style[INSET_FIELDS[side]] = value;
|
|
62037
|
+
}
|
|
62038
|
+
if (autoFit !== void 0) {
|
|
62039
|
+
const mapped = AUTO_FIT[autoFit];
|
|
62040
|
+
if (!mapped) {
|
|
62041
|
+
throw new RangeError(
|
|
62042
|
+
`autoFit must be 'none', 'shrinkText' or 'resizeShape', got ${String(autoFit)}`
|
|
62043
|
+
);
|
|
62044
|
+
}
|
|
62045
|
+
Object.assign(style, mapped);
|
|
62046
|
+
}
|
|
62047
|
+
if (wrap2 !== void 0) {
|
|
62048
|
+
style.textWrap = wrap2 ? "square" : "none";
|
|
62049
|
+
}
|
|
62050
|
+
return style;
|
|
62051
|
+
}
|
|
62052
|
+
function characterSpacingToSpc(px2) {
|
|
62053
|
+
const spc = Math.round(px2 * 75);
|
|
62054
|
+
if (!Number.isFinite(px2) || Math.abs(spc) > MAX_SPC) {
|
|
62055
|
+
throw new RangeError(`characterSpacing must be a finite px length, got ${px2}`);
|
|
62056
|
+
}
|
|
62057
|
+
return spc;
|
|
62058
|
+
}
|
|
62059
|
+
var EMU_PER_PX8, MAX_INSET_EMU, MAX_SPC, INSET_FIELDS, AUTO_FIT;
|
|
62060
|
+
var init_text_body_input = __esm({
|
|
62061
|
+
"pptx/core/builders/sdk/text-body-input.ts"() {
|
|
62062
|
+
EMU_PER_PX8 = 9525;
|
|
62063
|
+
MAX_INSET_EMU = 51206400;
|
|
62064
|
+
MAX_SPC = 4e5;
|
|
62065
|
+
INSET_FIELDS = {
|
|
62066
|
+
left: "bodyInsetLeft",
|
|
62067
|
+
top: "bodyInsetTop",
|
|
62068
|
+
right: "bodyInsetRight",
|
|
62069
|
+
bottom: "bodyInsetBottom"
|
|
62070
|
+
};
|
|
62071
|
+
AUTO_FIT = {
|
|
62072
|
+
// The model's `autoFitMode` names read the other way round: `'normal'` is
|
|
62073
|
+
// `a:normAutofit` (PowerPoint shrinks the text on overflow) and `'shrink'`
|
|
62074
|
+
// is `a:spAutoFit` (the shape grows to fit the text).
|
|
62075
|
+
shrinkText: { autoFit: true, autoFitMode: "normal" },
|
|
62076
|
+
resizeShape: { autoFit: true, autoFitMode: "shrink" },
|
|
62077
|
+
none: { autoFit: false, autoFitMode: "none" }
|
|
62078
|
+
};
|
|
62079
|
+
}
|
|
62080
|
+
});
|
|
62081
|
+
|
|
61788
62082
|
// pptx/core/builders/sdk/text-segment-style.ts
|
|
61789
62083
|
function elementStyleForSegments(textStyle, segments) {
|
|
61790
62084
|
const styled = segments.filter((segment) => !segment.isParagraphBreak);
|
|
@@ -61897,6 +62191,12 @@ function mapTextStyleInput(opts) {
|
|
|
61897
62191
|
if (opts.spaceAfter !== void 0) {
|
|
61898
62192
|
ts.paragraphSpacingAfter = opts.spaceAfter;
|
|
61899
62193
|
}
|
|
62194
|
+
if (opts.characterSpacing !== void 0) {
|
|
62195
|
+
ts.characterSpacing = characterSpacingToSpc(opts.characterSpacing);
|
|
62196
|
+
}
|
|
62197
|
+
if (opts.link !== void 0) {
|
|
62198
|
+
Object.assign(ts, mapLinkToRunStyle(opts.link));
|
|
62199
|
+
}
|
|
61900
62200
|
return ts;
|
|
61901
62201
|
}
|
|
61902
62202
|
function buildTextSegments(input, baseStyle) {
|
|
@@ -61921,6 +62221,34 @@ function buildTextSegments(input, baseStyle) {
|
|
|
61921
62221
|
style: { ...base, ...mapTextStyleInput(seg.style) }
|
|
61922
62222
|
}));
|
|
61923
62223
|
}
|
|
62224
|
+
function flipsOf(options2) {
|
|
62225
|
+
return {
|
|
62226
|
+
...options2?.flipHorizontal ? { flipHorizontal: true } : {},
|
|
62227
|
+
...options2?.flipVertical ? { flipVertical: true } : {}
|
|
62228
|
+
};
|
|
62229
|
+
}
|
|
62230
|
+
function applyShapeText(el, options2) {
|
|
62231
|
+
const text2 = options2?.text;
|
|
62232
|
+
if (!text2 || text2.length === 0) {
|
|
62233
|
+
const body = mapTextBodyInput(options2);
|
|
62234
|
+
if (Object.keys(body).length > 0) {
|
|
62235
|
+
el.text = "";
|
|
62236
|
+
el.textStyle = body;
|
|
62237
|
+
}
|
|
62238
|
+
return;
|
|
62239
|
+
}
|
|
62240
|
+
const textSegments = buildTextSegments(text2, options2.textStyle);
|
|
62241
|
+
el.text = typeof text2 === "string" ? text2 : text2.map((s) => s.text).join("");
|
|
62242
|
+
el.textStyle = {
|
|
62243
|
+
...elementStyleForSegments(mapTextStyleInput(options2.textStyle), textSegments),
|
|
62244
|
+
...mapTextBodyInput(options2)
|
|
62245
|
+
};
|
|
62246
|
+
el.textSegments = textSegments;
|
|
62247
|
+
}
|
|
62248
|
+
function withAction(link) {
|
|
62249
|
+
const actionClick = mapLinkToAction(link);
|
|
62250
|
+
return actionClick ? { actionClick } : {};
|
|
62251
|
+
}
|
|
61924
62252
|
function pos(type, opts) {
|
|
61925
62253
|
const d = DEFAULTS[type];
|
|
61926
62254
|
return {
|
|
@@ -61951,32 +62279,35 @@ function createTextElement(text2, options2) {
|
|
|
61951
62279
|
id: generateId("txt"),
|
|
61952
62280
|
...p2,
|
|
61953
62281
|
rotation: options2?.rotation,
|
|
62282
|
+
...flipsOf(options2),
|
|
61954
62283
|
opacity: options2?.opacity,
|
|
61955
62284
|
text: plainText,
|
|
61956
|
-
textStyle:
|
|
62285
|
+
textStyle: {
|
|
62286
|
+
...elementStyleForSegments(mapTextStyleInput(textStyleBase), textSegments),
|
|
62287
|
+
...mapTextBodyInput(options2)
|
|
62288
|
+
},
|
|
61957
62289
|
textSegments,
|
|
61958
|
-
shapeStyle: buildShapeStyle(effectInputs(options2, options2?.fill))
|
|
62290
|
+
shapeStyle: buildShapeStyle(effectInputs(options2, options2?.fill)),
|
|
62291
|
+
...withAction(options2?.link)
|
|
61959
62292
|
};
|
|
61960
62293
|
}
|
|
61961
|
-
function createShapeElement(shapeType, options2) {
|
|
62294
|
+
function createShapeElement(shapeType, options2, defaults) {
|
|
61962
62295
|
const p2 = pos("shape", options2);
|
|
61963
62296
|
const el = {
|
|
61964
62297
|
type: "shape",
|
|
61965
62298
|
id: generateId("shp"),
|
|
61966
62299
|
...p2,
|
|
61967
62300
|
rotation: options2?.rotation,
|
|
62301
|
+
...flipsOf(options2),
|
|
61968
62302
|
opacity: options2?.opacity,
|
|
61969
62303
|
shapeType,
|
|
61970
62304
|
shapeAdjustments: options2?.adjustments,
|
|
61971
62305
|
shapeStyle: buildShapeStyle(
|
|
61972
|
-
effectInputs(options2, options2?.fill ??
|
|
61973
|
-
)
|
|
62306
|
+
effectInputs(options2, options2?.fill ?? defaults?.fill ?? DEFAULT_SHAPE_FILL)
|
|
62307
|
+
),
|
|
62308
|
+
...withAction(options2?.link)
|
|
61974
62309
|
};
|
|
61975
|
-
|
|
61976
|
-
el.text = options2.text;
|
|
61977
|
-
el.textStyle = mapTextStyleInput(options2.textStyle);
|
|
61978
|
-
el.textSegments = buildTextSegments(options2.text, options2.textStyle);
|
|
61979
|
-
}
|
|
62310
|
+
applyShapeText(el, options2);
|
|
61980
62311
|
return el;
|
|
61981
62312
|
}
|
|
61982
62313
|
function createConnectorElement(options2) {
|
|
@@ -62012,12 +62343,20 @@ function createConnectorElement(options2) {
|
|
|
62012
62343
|
id: generateId("cxn"),
|
|
62013
62344
|
...p2,
|
|
62014
62345
|
rotation: options2?.rotation,
|
|
62346
|
+
...flipsOf(options2),
|
|
62015
62347
|
shapeType: connType,
|
|
62016
62348
|
shapeStyle: style
|
|
62017
62349
|
};
|
|
62018
62350
|
}
|
|
62019
62351
|
function createImageElement(source2, options2) {
|
|
62020
62352
|
const p2 = pos("image", options2);
|
|
62353
|
+
const svg = svgPictureSource(source2, options2?.svgFallback);
|
|
62354
|
+
if (svg) {
|
|
62355
|
+
const { svgFallback: _raster, ...rest } = options2 ?? {};
|
|
62356
|
+
const svgPicture = createImageElement(svg.raster, rest);
|
|
62357
|
+
svgPicture.svgData = svg.svgData;
|
|
62358
|
+
return svgPicture;
|
|
62359
|
+
}
|
|
62021
62360
|
const isDataUrl = source2.startsWith("data:");
|
|
62022
62361
|
const imageEffects = pictureEffectsFromInput(options2);
|
|
62023
62362
|
return {
|
|
@@ -62025,6 +62364,7 @@ function createImageElement(source2, options2) {
|
|
|
62025
62364
|
id: generateId("img"),
|
|
62026
62365
|
...p2,
|
|
62027
62366
|
rotation: options2?.rotation,
|
|
62367
|
+
...flipsOf(options2),
|
|
62028
62368
|
...imageEffects ? { imageEffects } : {},
|
|
62029
62369
|
imagePath: isDataUrl ? void 0 : source2,
|
|
62030
62370
|
imageData: isDataUrl ? source2 : void 0,
|
|
@@ -62032,7 +62372,12 @@ function createImageElement(source2, options2) {
|
|
|
62032
62372
|
cropLeft: options2?.cropLeft,
|
|
62033
62373
|
cropTop: options2?.cropTop,
|
|
62034
62374
|
cropRight: options2?.cropRight,
|
|
62035
|
-
cropBottom: options2?.cropBottom
|
|
62375
|
+
cropBottom: options2?.cropBottom,
|
|
62376
|
+
...mapPictureLayoutInput("ImageOptions", {
|
|
62377
|
+
tile: options2?.tile,
|
|
62378
|
+
fillRect: options2?.fillRect
|
|
62379
|
+
}),
|
|
62380
|
+
...withAction(options2?.link)
|
|
62036
62381
|
};
|
|
62037
62382
|
}
|
|
62038
62383
|
function createTableCell(cellInput) {
|
|
@@ -62137,6 +62482,7 @@ function createMediaElement(mediaType, source2, options2) {
|
|
|
62137
62482
|
id: generateId("med"),
|
|
62138
62483
|
...p2,
|
|
62139
62484
|
rotation: options2?.rotation,
|
|
62485
|
+
...flipsOf(options2),
|
|
62140
62486
|
mediaType,
|
|
62141
62487
|
mediaPath: isDataUrl ? void 0 : source2,
|
|
62142
62488
|
mediaData: isDataUrl ? source2 : void 0,
|
|
@@ -62155,6 +62501,7 @@ function createGroupElement(children16, options2) {
|
|
|
62155
62501
|
id: generateId("grp"),
|
|
62156
62502
|
...p2,
|
|
62157
62503
|
rotation: options2?.rotation,
|
|
62504
|
+
...flipsOf(options2),
|
|
62158
62505
|
children: children16
|
|
62159
62506
|
};
|
|
62160
62507
|
}
|
|
@@ -62168,6 +62515,7 @@ function createFreeformElement(pathData, options2) {
|
|
|
62168
62515
|
id: generateId("frm"),
|
|
62169
62516
|
...p2,
|
|
62170
62517
|
rotation: options2?.rotation,
|
|
62518
|
+
...flipsOf(options2),
|
|
62171
62519
|
opacity: options2?.opacity,
|
|
62172
62520
|
shapeType: "custom",
|
|
62173
62521
|
pathData,
|
|
@@ -62177,25 +62525,26 @@ function createFreeformElement(pathData, options2) {
|
|
|
62177
62525
|
shapeStyle: buildShapeStyle({
|
|
62178
62526
|
...effectInputs(options2, options2?.fill ?? { type: "none" }),
|
|
62179
62527
|
stroke: options2?.stroke ?? { color: "#000000", width: 2 }
|
|
62180
|
-
})
|
|
62528
|
+
}),
|
|
62529
|
+
...withAction(options2?.link)
|
|
62181
62530
|
};
|
|
62182
|
-
|
|
62183
|
-
el.text = options2.text;
|
|
62184
|
-
el.textStyle = mapTextStyleInput(options2.textStyle);
|
|
62185
|
-
el.textSegments = buildTextSegments(options2.text, options2.textStyle);
|
|
62186
|
-
}
|
|
62531
|
+
applyShapeText(el, options2);
|
|
62187
62532
|
return el;
|
|
62188
62533
|
}
|
|
62189
|
-
var idCounter, DEFAULTS;
|
|
62534
|
+
var idCounter, DEFAULTS, DEFAULT_SHAPE_FILL;
|
|
62190
62535
|
var init_ElementFactory = __esm({
|
|
62191
62536
|
"pptx/core/builders/sdk/ElementFactory.ts"() {
|
|
62192
62537
|
init_table_style_defaults();
|
|
62193
62538
|
init_custom_geometry();
|
|
62194
62539
|
init_chart_gradient_input();
|
|
62195
62540
|
init_chart_layout_operations();
|
|
62541
|
+
init_picture_layout_input();
|
|
62542
|
+
init_link_input();
|
|
62543
|
+
init_svg_picture_input();
|
|
62196
62544
|
init_picture_effects_input();
|
|
62197
62545
|
init_table_cell_input();
|
|
62198
62546
|
init_table_merge_input();
|
|
62547
|
+
init_text_body_input();
|
|
62199
62548
|
init_text_segment_style();
|
|
62200
62549
|
init_shape_style_input();
|
|
62201
62550
|
idCounter = 0;
|
|
@@ -62209,6 +62558,7 @@ var init_ElementFactory = __esm({
|
|
|
62209
62558
|
media: { x: 100, y: 100, width: 480, height: 270 },
|
|
62210
62559
|
group: { x: 0, y: 0, width: 600, height: 400 }
|
|
62211
62560
|
};
|
|
62561
|
+
DEFAULT_SHAPE_FILL = { type: "solid", color: "#4472C4" };
|
|
62212
62562
|
}
|
|
62213
62563
|
});
|
|
62214
62564
|
|
|
@@ -62224,9 +62574,12 @@ var init_SlideBuilder = __esm({
|
|
|
62224
62574
|
* @param layoutPath - Optional layout archive path.
|
|
62225
62575
|
* @param layoutName - Optional layout display name.
|
|
62226
62576
|
* @param handler - Loaded deck context for placeholder geometry and text styles.
|
|
62577
|
+
* @param shapeDefaults - What `addShape` uses for an omitted option
|
|
62578
|
+
* (`PresentationOptions.shapeDefaults`).
|
|
62227
62579
|
*/
|
|
62228
|
-
constructor(slideNumber, layoutPath, layoutName, handler) {
|
|
62580
|
+
constructor(slideNumber, layoutPath, layoutName, handler, shapeDefaults) {
|
|
62229
62581
|
this.handler = handler;
|
|
62582
|
+
this.shapeDefaults = shapeDefaults;
|
|
62230
62583
|
this.slide = {
|
|
62231
62584
|
id: `slide${slideNumber}`,
|
|
62232
62585
|
rId: `rId${slideNumber + 1}`,
|
|
@@ -62237,6 +62590,7 @@ var init_SlideBuilder = __esm({
|
|
|
62237
62590
|
};
|
|
62238
62591
|
}
|
|
62239
62592
|
handler;
|
|
62593
|
+
shapeDefaults;
|
|
62240
62594
|
slide;
|
|
62241
62595
|
/** Add a text box to the slide. */
|
|
62242
62596
|
addText(text2, options2) {
|
|
@@ -62284,7 +62638,7 @@ var init_SlideBuilder = __esm({
|
|
|
62284
62638
|
}
|
|
62285
62639
|
/** Add a shape to the slide. */
|
|
62286
62640
|
addShape(shapeType, options2) {
|
|
62287
|
-
this.slide.elements.push(createShapeElement(shapeType, options2));
|
|
62641
|
+
this.slide.elements.push(createShapeElement(shapeType, options2, this.shapeDefaults));
|
|
62288
62642
|
return this;
|
|
62289
62643
|
}
|
|
62290
62644
|
/** Add a connector (line) to the slide. */
|
|
@@ -63197,7 +63551,7 @@ var init_PresentationBuilder = __esm({
|
|
|
63197
63551
|
const layoutIdx = STANDARD_LAYOUTS.findIndex((l) => l.name === layoutName) + 1 || 7;
|
|
63198
63552
|
const layoutPath = `ppt/slideLayouts/slideLayout${layoutIdx}.xml`;
|
|
63199
63553
|
const resolvedName = layoutName ?? STANDARD_LAYOUTS[layoutIdx - 1]?.name ?? "Blank";
|
|
63200
|
-
return new SlideBuilder(slideNum, layoutPath, resolvedName, handler);
|
|
63554
|
+
return new SlideBuilder(slideNum, layoutPath, resolvedName, handler, options2?.shapeDefaults);
|
|
63201
63555
|
};
|
|
63202
63556
|
return { handler, data, createSlide };
|
|
63203
63557
|
}
|
|
@@ -64223,19 +64577,19 @@ function serializePlaceholderLevelStyle(style, existing) {
|
|
|
64223
64577
|
attrEdits.algn = ALIGN_TO_XML[style.alignment] ?? style.alignment;
|
|
64224
64578
|
}
|
|
64225
64579
|
if (style.marginLeft !== void 0) {
|
|
64226
|
-
attrEdits.marL = String(Math.round(style.marginLeft *
|
|
64580
|
+
attrEdits.marL = String(Math.round(style.marginLeft * EMU_PER_PX9));
|
|
64227
64581
|
}
|
|
64228
64582
|
if (style.marginRight !== void 0) {
|
|
64229
|
-
attrEdits.marR = String(Math.round(style.marginRight *
|
|
64583
|
+
attrEdits.marR = String(Math.round(style.marginRight * EMU_PER_PX9));
|
|
64230
64584
|
}
|
|
64231
64585
|
if (style.indent !== void 0) {
|
|
64232
|
-
attrEdits.indent = String(Math.round(style.indent *
|
|
64586
|
+
attrEdits.indent = String(Math.round(style.indent * EMU_PER_PX9));
|
|
64233
64587
|
}
|
|
64234
64588
|
if (style.rtl !== void 0) {
|
|
64235
64589
|
attrEdits.rtl = style.rtl ? "1" : "0";
|
|
64236
64590
|
}
|
|
64237
64591
|
if (style.defaultTabSize !== void 0) {
|
|
64238
|
-
attrEdits.defTabSz = String(Math.round(style.defaultTabSize *
|
|
64592
|
+
attrEdits.defTabSz = String(Math.round(style.defaultTabSize * EMU_PER_PX9));
|
|
64239
64593
|
}
|
|
64240
64594
|
if (style.eaLineBreak !== void 0) {
|
|
64241
64595
|
attrEdits.eaLnBrk = style.eaLineBreak ? "1" : "0";
|
|
@@ -64374,13 +64728,13 @@ function preservedIfStillCurrent(preserved, hex3) {
|
|
|
64374
64728
|
}
|
|
64375
64729
|
return preserved;
|
|
64376
64730
|
}
|
|
64377
|
-
var
|
|
64731
|
+
var EMU_PER_PX9, PT_HUNDREDTHS_PER_PX, ALIGN_TO_XML, LEVEL_PPR_CHILD_ORDER, DEF_RPR_CHILD_ORDER, FILL_VARIANTS;
|
|
64378
64732
|
var init_placeholder_level_style_serializer = __esm({
|
|
64379
64733
|
"pptx/core/utils/placeholder-level-style-serializer.ts"() {
|
|
64380
64734
|
init_color_xml_preservation();
|
|
64381
64735
|
init_ordered_xml_merge();
|
|
64382
64736
|
init_tab_stops();
|
|
64383
|
-
|
|
64737
|
+
EMU_PER_PX9 = 9525;
|
|
64384
64738
|
PT_HUNDREDTHS_PER_PX = 75;
|
|
64385
64739
|
ALIGN_TO_XML = {
|
|
64386
64740
|
left: "l",
|
|
@@ -68997,41 +69351,41 @@ function parseBorderSide(side) {
|
|
|
68997
69351
|
}
|
|
68998
69352
|
const ln = typeof side["a:ln"] === "object" ? side["a:ln"] : {};
|
|
68999
69353
|
const border = {};
|
|
69000
|
-
let
|
|
69354
|
+
let has3 = false;
|
|
69001
69355
|
if (ln["a:noFill"] !== void 0) {
|
|
69002
69356
|
border.noFill = true;
|
|
69003
|
-
|
|
69357
|
+
has3 = true;
|
|
69004
69358
|
}
|
|
69005
69359
|
const widthEmu = parseInt(String(ln["@_w"] || "0"), 10);
|
|
69006
69360
|
if (widthEmu > 0) {
|
|
69007
69361
|
border.width = Math.max(1, Math.round(widthEmu / EMU_PER_PIXEL3));
|
|
69008
|
-
|
|
69362
|
+
has3 = true;
|
|
69009
69363
|
}
|
|
69010
69364
|
const prstDash = ln["a:prstDash"];
|
|
69011
69365
|
const dashVal = prstDash ? String(prstDash["@_val"] || "").trim() : "";
|
|
69012
69366
|
if (dashVal) {
|
|
69013
69367
|
border.dash = dashVal;
|
|
69014
|
-
|
|
69368
|
+
has3 = true;
|
|
69015
69369
|
}
|
|
69016
69370
|
const cmpd = String(ln["@_cmpd"] || "").trim();
|
|
69017
69371
|
if (cmpd && cmpd !== "sng") {
|
|
69018
69372
|
border.compound = cmpd;
|
|
69019
|
-
|
|
69373
|
+
has3 = true;
|
|
69020
69374
|
}
|
|
69021
69375
|
const solidFill3 = ln["a:solidFill"];
|
|
69022
69376
|
const fill3 = parseSolidFillStyle(solidFill3);
|
|
69023
69377
|
if (fill3) {
|
|
69024
69378
|
border.fill = fill3;
|
|
69025
|
-
|
|
69379
|
+
has3 = true;
|
|
69026
69380
|
} else {
|
|
69027
69381
|
const srgb2 = solidFill3?.["a:srgbClr"];
|
|
69028
69382
|
const hex3 = srgb2 ? String(srgb2["@_val"] || "").trim() : "";
|
|
69029
69383
|
if (hex3) {
|
|
69030
69384
|
border.color = hex3.startsWith("#") ? hex3 : `#${hex3}`;
|
|
69031
|
-
|
|
69385
|
+
has3 = true;
|
|
69032
69386
|
}
|
|
69033
69387
|
}
|
|
69034
|
-
return
|
|
69388
|
+
return has3 ? border : void 0;
|
|
69035
69389
|
}
|
|
69036
69390
|
function parseTableStyleBorders(tcStyle) {
|
|
69037
69391
|
const tcBdr = tcStyle?.["a:tcBdr"];
|
|
@@ -69039,16 +69393,16 @@ function parseTableStyleBorders(tcStyle) {
|
|
|
69039
69393
|
return void 0;
|
|
69040
69394
|
}
|
|
69041
69395
|
const result = {};
|
|
69042
|
-
let
|
|
69396
|
+
let has3 = false;
|
|
69043
69397
|
for (const name of BORDER_SIDES) {
|
|
69044
69398
|
const node = tcBdr[`a:${name}`] ?? (name === "tr2bl" ? tcBdr["a:bl2tr"] : void 0);
|
|
69045
69399
|
const border = parseBorderSide(node);
|
|
69046
69400
|
if (border) {
|
|
69047
69401
|
result[name] = border;
|
|
69048
|
-
|
|
69402
|
+
has3 = true;
|
|
69049
69403
|
}
|
|
69050
69404
|
}
|
|
69051
|
-
return
|
|
69405
|
+
return has3 ? result : void 0;
|
|
69052
69406
|
}
|
|
69053
69407
|
function parseTableStyleSectionCell3D(tcStyle) {
|
|
69054
69408
|
const cell3DNode = tcStyle?.["a:cell3D"];
|
|
@@ -71996,6 +72350,25 @@ var init_PptxLoadDataBuilder = __esm({
|
|
|
71996
72350
|
});
|
|
71997
72351
|
|
|
71998
72352
|
// pptx/core/core/builders/PptxSaveSessionBuilder.ts
|
|
72353
|
+
function fnv1a(bytes) {
|
|
72354
|
+
let hash2 = 2166136261;
|
|
72355
|
+
for (const byte of bytes) {
|
|
72356
|
+
hash2 ^= byte;
|
|
72357
|
+
hash2 = Math.imul(hash2, 16777619) >>> 0;
|
|
72358
|
+
}
|
|
72359
|
+
return hash2;
|
|
72360
|
+
}
|
|
72361
|
+
function sameBytes(a, b) {
|
|
72362
|
+
if (a.length !== b.length) {
|
|
72363
|
+
return false;
|
|
72364
|
+
}
|
|
72365
|
+
for (let i2 = 0; i2 < a.length; i2++) {
|
|
72366
|
+
if (a[i2] !== b[i2]) {
|
|
72367
|
+
return false;
|
|
72368
|
+
}
|
|
72369
|
+
}
|
|
72370
|
+
return true;
|
|
72371
|
+
}
|
|
71999
72372
|
var PptxSaveState, PptxSaveStateBuilder;
|
|
72000
72373
|
var init_PptxSaveSessionBuilder = __esm({
|
|
72001
72374
|
"pptx/core/core/builders/PptxSaveSessionBuilder.ts"() {
|
|
@@ -72007,6 +72380,8 @@ var init_PptxSaveSessionBuilder = __esm({
|
|
|
72007
72380
|
emuPerPx;
|
|
72008
72381
|
usedSlideNumbers = /* @__PURE__ */ new Set();
|
|
72009
72382
|
usedMediaPaths = /* @__PURE__ */ new Set();
|
|
72383
|
+
/** New pictures' media parts in this save, by content (see `mediaPathForContent`). */
|
|
72384
|
+
newMediaByContent = /* @__PURE__ */ new Map();
|
|
72010
72385
|
usedInkPaths = /* @__PURE__ */ new Set();
|
|
72011
72386
|
maxInkPartIndex = 0;
|
|
72012
72387
|
existingCommentPaths = /* @__PURE__ */ new Set();
|
|
@@ -72047,6 +72422,23 @@ var init_PptxSaveSessionBuilder = __esm({
|
|
|
72047
72422
|
this.usedMediaPaths.add(filePath);
|
|
72048
72423
|
return filePath;
|
|
72049
72424
|
}
|
|
72425
|
+
/**
|
|
72426
|
+
* The media part for a NEW picture's bytes: the part an identical picture
|
|
72427
|
+
* already got in this save, or a fresh one. Pictures loaded from the deck
|
|
72428
|
+
* keep their own parts and never come through here.
|
|
72429
|
+
*/
|
|
72430
|
+
mediaPathForContent(bytes, extension) {
|
|
72431
|
+
const key2 = `${extension.toLowerCase()}:${bytes.length}:${fnv1a(bytes)}`;
|
|
72432
|
+
const candidates = this.newMediaByContent.get(key2) ?? [];
|
|
72433
|
+
const same8 = candidates.find((candidate) => sameBytes(candidate.bytes, bytes));
|
|
72434
|
+
if (same8) {
|
|
72435
|
+
return { path: same8.path, reused: true };
|
|
72436
|
+
}
|
|
72437
|
+
const path4 = this.nextMediaPath(extension);
|
|
72438
|
+
candidates.push({ bytes, path: path4 });
|
|
72439
|
+
this.newMediaByContent.set(key2, candidates);
|
|
72440
|
+
return { path: path4, reused: false };
|
|
72441
|
+
}
|
|
72050
72442
|
getUsedMediaPaths() {
|
|
72051
72443
|
return this.usedMediaPaths;
|
|
72052
72444
|
}
|
|
@@ -107647,8 +108039,8 @@ function titleText(title) {
|
|
|
107647
108039
|
}
|
|
107648
108040
|
function scalingFromNeutral(axis, out) {
|
|
107649
108041
|
const { scaling } = axis;
|
|
107650
|
-
setOrRemove(out, "min",
|
|
107651
|
-
setOrRemove(out, "max",
|
|
108042
|
+
setOrRemove(out, "min", finite5(scaling.min));
|
|
108043
|
+
setOrRemove(out, "max", finite5(scaling.max));
|
|
107652
108044
|
const logBase = scaling.logBase !== void 0 && scaling.logBase > 0 ? scaling.logBase : void 0;
|
|
107653
108045
|
setOrRemove(out, "logBase", logBase);
|
|
107654
108046
|
setOrRemove(out, "logScale", logBase !== void 0 ? true : void 0);
|
|
@@ -107660,7 +108052,7 @@ function labelsFromNeutral(axis, out) {
|
|
|
107660
108052
|
setOrRemove(out, "minorTickMark", oneOf(TICK_MARKS2, axis.minorTickMark));
|
|
107661
108053
|
setOrRemove(out, "tickLblPos", oneOf(["high", "low", "nextTo", "none"], axis.tickLabelPosition));
|
|
107662
108054
|
setOrRemove(out, "crosses", oneOf(["autoZero", "min", "max"], axis.crosses));
|
|
107663
|
-
setOrRemove(out, "crossesAt",
|
|
108055
|
+
setOrRemove(out, "crossesAt", finite5(axis.crossesAt));
|
|
107664
108056
|
const valueAxis = type === "valAx";
|
|
107665
108057
|
const categoryOrDate = type === "catAx" || type === "dateAx";
|
|
107666
108058
|
const skips = type === "catAx" || type === "serAx";
|
|
@@ -107714,8 +108106,8 @@ function axisFromNeutral(axis, out) {
|
|
|
107714
108106
|
setOrRemove(out, "displayUnits", custom ? "custom" : builtIn);
|
|
107715
108107
|
setOrRemove(out, "displayUnitsValue", custom || void 0);
|
|
107716
108108
|
}
|
|
107717
|
-
setOrRemove(out, "majorUnit",
|
|
107718
|
-
setOrRemove(out, "minorUnit",
|
|
108109
|
+
setOrRemove(out, "majorUnit", finite5(axis.majorUnit));
|
|
108110
|
+
setOrRemove(out, "minorUnit", finite5(axis.minorUnit));
|
|
107719
108111
|
setOrRemove(
|
|
107720
108112
|
out,
|
|
107721
108113
|
"baseTimeUnit",
|
|
@@ -107736,12 +108128,12 @@ function axesFromNeutral(axes, styled) {
|
|
|
107736
108128
|
);
|
|
107737
108129
|
});
|
|
107738
108130
|
}
|
|
107739
|
-
var oneOf,
|
|
108131
|
+
var oneOf, finite5, positiveInteger, TICK_MARKS2, TIME_UNITS2, BUILT_IN_UNITS2;
|
|
107740
108132
|
var init_chart_from_neutral_axes = __esm({
|
|
107741
108133
|
"pptx/core/utils/chart-from-neutral-axes.ts"() {
|
|
107742
108134
|
init_chart_from_neutral_labels();
|
|
107743
108135
|
oneOf = (values, value) => value !== void 0 && values.includes(value) ? value : void 0;
|
|
107744
|
-
|
|
108136
|
+
finite5 = (value) => value !== void 0 && Number.isFinite(value) ? value : void 0;
|
|
107745
108137
|
positiveInteger = (value) => value !== void 0 && Number.isInteger(value) && value > 0 ? value : void 0;
|
|
107746
108138
|
TICK_MARKS2 = ["cross", "in", "none", "out"];
|
|
107747
108139
|
TIME_UNITS2 = ["days", "months", "years"];
|
|
@@ -126985,26 +127377,26 @@ function buildImgEffects(effects2) {
|
|
|
126985
127377
|
if (effects2.backgroundRemoval) {
|
|
126986
127378
|
out.push({ "a14:backgroundRemoval": buildBackgroundRemovalNode(effects2.backgroundRemoval) });
|
|
126987
127379
|
}
|
|
126988
|
-
if (
|
|
127380
|
+
if (finite6(effects2.sharpenSoften?.amount)) {
|
|
126989
127381
|
out.push({ "a14:sharpenSoften": { "@_amount": round4(effects2.sharpenSoften.amount) } });
|
|
126990
127382
|
}
|
|
126991
127383
|
const bc = effects2.brightnessContrast;
|
|
126992
|
-
if (bc && (
|
|
127384
|
+
if (bc && (finite6(bc.bright) || finite6(bc.contrast))) {
|
|
126993
127385
|
const node = {};
|
|
126994
|
-
if (
|
|
127386
|
+
if (finite6(bc.bright)) {
|
|
126995
127387
|
node["@_bright"] = round4(bc.bright);
|
|
126996
127388
|
}
|
|
126997
|
-
if (
|
|
127389
|
+
if (finite6(bc.contrast)) {
|
|
126998
127390
|
node["@_contrast"] = round4(bc.contrast);
|
|
126999
127391
|
}
|
|
127000
127392
|
out.push({ "a14:brightnessContrast": node });
|
|
127001
127393
|
}
|
|
127002
|
-
if (
|
|
127394
|
+
if (finite6(effects2.colorTemperature?.colorTemp)) {
|
|
127003
127395
|
out.push({
|
|
127004
127396
|
"a14:colorTemperature": { "@_colorTemp": round4(effects2.colorTemperature.colorTemp) }
|
|
127005
127397
|
});
|
|
127006
127398
|
}
|
|
127007
|
-
if (
|
|
127399
|
+
if (finite6(effects2.colorSaturation?.sat)) {
|
|
127008
127400
|
out.push({ "a14:saturation": { "@_sat": round4(effects2.colorSaturation.sat) } });
|
|
127009
127401
|
}
|
|
127010
127402
|
const artistic = a14ArtisticElementName(effects2.artisticEffect);
|
|
@@ -127054,7 +127446,7 @@ function applyA14ImageExtension(blip, effects2) {
|
|
|
127054
127446
|
extLst[extKey] = entries.length === 1 ? entries[0] : entries;
|
|
127055
127447
|
blip[extLstKey] = extLst;
|
|
127056
127448
|
}
|
|
127057
|
-
var GALLERY_TO_A14, round4,
|
|
127449
|
+
var GALLERY_TO_A14, round4, finite6;
|
|
127058
127450
|
var init_image_a14_effects_writer = __esm({
|
|
127059
127451
|
"pptx/core/core/runtime/image-a14-effects-writer.ts"() {
|
|
127060
127452
|
init_image_a14_effects();
|
|
@@ -127087,7 +127479,7 @@ var init_image_a14_effects_writer = __esm({
|
|
|
127087
127479
|
watercolorSponge: "artisticWatercolorSponge"
|
|
127088
127480
|
};
|
|
127089
127481
|
round4 = (value) => String(Math.round(value));
|
|
127090
|
-
|
|
127482
|
+
finite6 = (value) => typeof value === "number" && Number.isFinite(value);
|
|
127091
127483
|
}
|
|
127092
127484
|
});
|
|
127093
127485
|
|
|
@@ -127809,16 +128201,16 @@ function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spac
|
|
|
127809
128201
|
paragraphProps["@_rtl"] = textStyle.rtl ? "1" : "0";
|
|
127810
128202
|
}
|
|
127811
128203
|
if (typeof textStyle?.paragraphMarginLeft === "number" && Number.isFinite(textStyle.paragraphMarginLeft) && owns("paragraphMarginLeft")) {
|
|
127812
|
-
paragraphProps["@_marL"] = String(Math.round(textStyle.paragraphMarginLeft *
|
|
128204
|
+
paragraphProps["@_marL"] = String(Math.round(textStyle.paragraphMarginLeft * EMU_PER_PX10));
|
|
127813
128205
|
}
|
|
127814
128206
|
if (typeof textStyle?.paragraphMarginRight === "number" && Number.isFinite(textStyle.paragraphMarginRight) && owns("paragraphMarginRight")) {
|
|
127815
|
-
paragraphProps["@_marR"] = String(Math.round(textStyle.paragraphMarginRight *
|
|
128207
|
+
paragraphProps["@_marR"] = String(Math.round(textStyle.paragraphMarginRight * EMU_PER_PX10));
|
|
127816
128208
|
}
|
|
127817
128209
|
if (typeof textStyle?.paragraphIndent === "number" && Number.isFinite(textStyle.paragraphIndent) && owns("paragraphIndent")) {
|
|
127818
|
-
paragraphProps["@_indent"] = String(Math.round(textStyle.paragraphIndent *
|
|
128210
|
+
paragraphProps["@_indent"] = String(Math.round(textStyle.paragraphIndent * EMU_PER_PX10));
|
|
127819
128211
|
}
|
|
127820
128212
|
if (typeof textStyle?.defaultTabSize === "number" && Number.isFinite(textStyle.defaultTabSize) && owns("defaultTabSize")) {
|
|
127821
|
-
paragraphProps["@_defTabSz"] = String(Math.round(textStyle.defaultTabSize *
|
|
128213
|
+
paragraphProps["@_defTabSz"] = String(Math.round(textStyle.defaultTabSize * EMU_PER_PX10));
|
|
127822
128214
|
}
|
|
127823
128215
|
if (textStyle?.eaLineBreak !== void 0 && owns("eaLineBreak")) {
|
|
127824
128216
|
paragraphProps["@_eaLnBrk"] = textStyle.eaLineBreak ? "1" : "0";
|
|
@@ -127948,7 +128340,7 @@ function assembleParagraphXml(runs, paragraphProps, endParaRunProperties, markup
|
|
|
127948
128340
|
}
|
|
127949
128341
|
return paragraph2;
|
|
127950
128342
|
}
|
|
127951
|
-
var
|
|
128343
|
+
var EMU_PER_PX10;
|
|
127952
128344
|
var init_PptxHandlerRuntimeSaveParagraphHelpers = __esm({
|
|
127953
128345
|
"pptx/core/core/runtime/PptxHandlerRuntimeSaveParagraphHelpers.ts"() {
|
|
127954
128346
|
init_units2();
|
|
@@ -127957,7 +128349,7 @@ var init_PptxHandlerRuntimeSaveParagraphHelpers = __esm({
|
|
|
127957
128349
|
init_tab_stops();
|
|
127958
128350
|
init_paragraph_child_assembly();
|
|
127959
128351
|
init_uniform_segment_overrides();
|
|
127960
|
-
|
|
128352
|
+
EMU_PER_PX10 = EMU_PER_PIXEL;
|
|
127961
128353
|
}
|
|
127962
128354
|
});
|
|
127963
128355
|
|
|
@@ -129382,17 +129774,37 @@ var init_PptxHandlerRuntimeElementActions = __esm({
|
|
|
129382
129774
|
init_PptxHandlerRuntimeTableStyles();
|
|
129383
129775
|
init_shape_lock_containers();
|
|
129384
129776
|
PptxHandlerRuntime3 = class extends PptxHandlerRuntime2 {
|
|
129777
|
+
/**
|
|
129778
|
+
* Report a slide jump whose index names no slide of the deck being saved.
|
|
129779
|
+
* It is not written: PowerPoint does not open a file with a slide jump that
|
|
129780
|
+
* has no slide relationship.
|
|
129781
|
+
*/
|
|
129782
|
+
reportMissingSlideJumpTarget(elementId, index) {
|
|
129783
|
+
this.compatibilityService?.reportWarning({
|
|
129784
|
+
code: "SAVE_SLIDE_JUMP_TARGET_MISSING",
|
|
129785
|
+
message: `A slide jump to slide index ${index} has no such slide in the saved deck; the link was not written.`,
|
|
129786
|
+
severity: "warning",
|
|
129787
|
+
scope: "element",
|
|
129788
|
+
...elementId ? { elementId } : {}
|
|
129789
|
+
});
|
|
129790
|
+
}
|
|
129385
129791
|
/**
|
|
129386
129792
|
* Write or remove a single `a:hlinkClick` / `a:hlinkHover` node on
|
|
129387
129793
|
* a `p:cNvPr` parent.
|
|
129388
129794
|
*/
|
|
129389
|
-
serializeSingleAction(cNvPr, nodeName, action, links) {
|
|
129795
|
+
serializeSingleAction(cNvPr, nodeName, action, links, elementId) {
|
|
129390
129796
|
if (!action) {
|
|
129391
129797
|
delete cNvPr[nodeName];
|
|
129392
129798
|
return;
|
|
129393
129799
|
}
|
|
129394
129800
|
const node = {};
|
|
129395
|
-
const
|
|
129801
|
+
const slideJumpIndex = /^ppaction:\/\/hlinksldjump\b/iu.test(action.action ?? "") && typeof action.targetSlideIndex === "number" ? action.targetSlideIndex : void 0;
|
|
129802
|
+
const url = action.url?.trim() || (slideJumpIndex !== void 0 ? links.slideTargetAt?.(slideJumpIndex) : void 0);
|
|
129803
|
+
if (!url && slideJumpIndex !== void 0 && links.slideTargetAt) {
|
|
129804
|
+
this.reportMissingSlideJumpTarget(elementId, slideJumpIndex);
|
|
129805
|
+
delete cNvPr[nodeName];
|
|
129806
|
+
return;
|
|
129807
|
+
}
|
|
129396
129808
|
let rId = action.rId;
|
|
129397
129809
|
if (rId && url && links.getSlideRelationshipMap().get(rId) !== url) {
|
|
129398
129810
|
rId = void 0;
|
|
@@ -129483,8 +129895,8 @@ var init_PptxHandlerRuntimeElementActions = __esm({
|
|
|
129483
129895
|
}
|
|
129484
129896
|
const actionClick = "actionClick" in el ? el.actionClick : void 0;
|
|
129485
129897
|
const actionHover = "actionHover" in el ? el.actionHover : void 0;
|
|
129486
|
-
this.serializeSingleAction(cNvPr, "a:hlinkClick", actionClick, links);
|
|
129487
|
-
this.serializeSingleAction(cNvPr, "a:hlinkHover", actionHover, links);
|
|
129898
|
+
this.serializeSingleAction(cNvPr, "a:hlinkClick", actionClick, links, el.id);
|
|
129899
|
+
this.serializeSingleAction(cNvPr, "a:hlinkHover", actionHover, links, el.id);
|
|
129488
129900
|
const isDecorative = "isDecorative" in el ? el.isDecorative : void 0;
|
|
129489
129901
|
serializeDecorativeExtension(cNvPr, isDecorative);
|
|
129490
129902
|
}
|
|
@@ -131520,12 +131932,12 @@ function buildTextRunEffectListXml(style, parseColor) {
|
|
|
131520
131932
|
}
|
|
131521
131933
|
if (hasTextBlur) {
|
|
131522
131934
|
effectLst["a:blur"] = {
|
|
131523
|
-
"@_rad": String(Math.round((style.textBlurRadius ?? 0) *
|
|
131935
|
+
"@_rad": String(Math.round((style.textBlurRadius ?? 0) * EMU_PER_PX11))
|
|
131524
131936
|
};
|
|
131525
131937
|
}
|
|
131526
131938
|
if (hasTextSoftEdge) {
|
|
131527
131939
|
effectLst["a:softEdge"] = {
|
|
131528
|
-
"@_rad": String(Math.round((style.textSoftEdgeRadius ?? 0) *
|
|
131940
|
+
"@_rad": String(Math.round((style.textSoftEdgeRadius ?? 0) * EMU_PER_PX11))
|
|
131529
131941
|
};
|
|
131530
131942
|
}
|
|
131531
131943
|
if (hasTextAlphaModFix) {
|
|
@@ -131567,8 +131979,8 @@ function buildOuterShadowNode(style) {
|
|
|
131567
131979
|
const oy = style.textShadowOffsetY ?? 0;
|
|
131568
131980
|
const { distance, directionDegrees } = shadowOffsetToDistanceAndDirection(ox, oy);
|
|
131569
131981
|
return {
|
|
131570
|
-
"@_blurRad": String(Math.round((style.textShadowBlur ?? 4) *
|
|
131571
|
-
"@_dist": String(Math.round(distance *
|
|
131982
|
+
"@_blurRad": String(Math.round((style.textShadowBlur ?? 4) * EMU_PER_PX11)),
|
|
131983
|
+
"@_dist": String(Math.round(distance * EMU_PER_PX11)),
|
|
131572
131984
|
"@_dir": positiveFixedAngleAttribute(directionDegrees),
|
|
131573
131985
|
"a:srgbClr": buildShadowColorNode(style.textShadowColor || "#000000", style.textShadowOpacity)
|
|
131574
131986
|
};
|
|
@@ -131580,8 +131992,8 @@ function buildInnerShadowNode(style, parseColor) {
|
|
|
131580
131992
|
const fallbackHex = style.textInnerShadowColor || "#000000";
|
|
131581
131993
|
const resolvedOriginal = style.textInnerShadowColorXml ? parseColor?.(style.textInnerShadowColorXml) : void 0;
|
|
131582
131994
|
return {
|
|
131583
|
-
"@_blurRad": String(Math.round((style.textInnerShadowBlur ?? 3) *
|
|
131584
|
-
"@_dist": String(Math.round(distance *
|
|
131995
|
+
"@_blurRad": String(Math.round((style.textInnerShadowBlur ?? 3) * EMU_PER_PX11)),
|
|
131996
|
+
"@_dist": String(Math.round(distance * EMU_PER_PX11)),
|
|
131585
131997
|
"@_dir": positiveFixedAngleAttribute(directionDegrees),
|
|
131586
131998
|
...serializeColorChoiceWithRef(
|
|
131587
131999
|
style.textInnerShadowColorRef,
|
|
@@ -131597,7 +132009,7 @@ function buildPresetShadowNode(style) {
|
|
|
131597
132009
|
"@_prst": style.textPresetShadowName
|
|
131598
132010
|
};
|
|
131599
132011
|
if (typeof style.textPresetShadowDistance === "number") {
|
|
131600
|
-
node["@_dist"] = String(Math.round(style.textPresetShadowDistance *
|
|
132012
|
+
node["@_dist"] = String(Math.round(style.textPresetShadowDistance * EMU_PER_PX11));
|
|
131601
132013
|
}
|
|
131602
132014
|
if (typeof style.textPresetShadowDirection === "number") {
|
|
131603
132015
|
node["@_dir"] = positiveFixedAngleAttribute(style.textPresetShadowDirection);
|
|
@@ -131614,7 +132026,7 @@ function buildGlowNode(style, parseColor) {
|
|
|
131614
132026
|
const fallbackHex = style.textGlowColor || "#ffff00";
|
|
131615
132027
|
const resolvedOriginal = style.textGlowColorXml ? parseColor?.(style.textGlowColorXml) : void 0;
|
|
131616
132028
|
return {
|
|
131617
|
-
"@_rad": String(Math.round((style.textGlowRadius ?? 6) *
|
|
132029
|
+
"@_rad": String(Math.round((style.textGlowRadius ?? 6) * EMU_PER_PX11)),
|
|
131618
132030
|
...serializeColorChoiceWithRef(
|
|
131619
132031
|
style.textGlowColorRef,
|
|
131620
132032
|
style.textGlowColorXml,
|
|
@@ -131627,7 +132039,7 @@ function buildGlowNode(style, parseColor) {
|
|
|
131627
132039
|
function buildReflectionNode(style) {
|
|
131628
132040
|
const refl = {};
|
|
131629
132041
|
if (typeof style.textReflectionBlur === "number") {
|
|
131630
|
-
refl["@_blurRad"] = String(Math.round(style.textReflectionBlur *
|
|
132042
|
+
refl["@_blurRad"] = String(Math.round(style.textReflectionBlur * EMU_PER_PX11));
|
|
131631
132043
|
}
|
|
131632
132044
|
if (typeof style.textReflectionStartOpacity === "number") {
|
|
131633
132045
|
refl["@_stA"] = String(Math.round(style.textReflectionStartOpacity * 1e5));
|
|
@@ -131639,7 +132051,7 @@ function buildReflectionNode(style) {
|
|
|
131639
132051
|
refl["@_endPos"] = String(Math.round(style.textReflectionEndPosition * 1e5));
|
|
131640
132052
|
}
|
|
131641
132053
|
if (typeof style.textReflectionOffset === "number") {
|
|
131642
|
-
refl["@_dist"] = String(Math.round(style.textReflectionOffset *
|
|
132054
|
+
refl["@_dist"] = String(Math.round(style.textReflectionOffset * EMU_PER_PX11));
|
|
131643
132055
|
}
|
|
131644
132056
|
if (typeof style.textReflectionDirection === "number") {
|
|
131645
132057
|
refl["@_dir"] = positiveFixedAngleAttribute(style.textReflectionDirection);
|
|
@@ -131694,12 +132106,12 @@ function buildClrChangeNode(style) {
|
|
|
131694
132106
|
}
|
|
131695
132107
|
};
|
|
131696
132108
|
}
|
|
131697
|
-
var
|
|
132109
|
+
var EMU_PER_PX11;
|
|
131698
132110
|
var init_text_run_effect_xml_builder = __esm({
|
|
131699
132111
|
"pptx/core/core/runtime/text-run-effect-xml-builder.ts"() {
|
|
131700
132112
|
init_color_xml_preservation();
|
|
131701
132113
|
init_positive_fixed_angle();
|
|
131702
|
-
|
|
132114
|
+
EMU_PER_PX11 = 9525;
|
|
131703
132115
|
}
|
|
131704
132116
|
});
|
|
131705
132117
|
|
|
@@ -140415,6 +140827,58 @@ var init_PptxHandlerRuntimeSaveEffectsWriter = __esm({
|
|
|
140415
140827
|
}
|
|
140416
140828
|
});
|
|
140417
140829
|
|
|
140830
|
+
// pptx/core/core/runtime/run-slide-jump-targets.ts
|
|
140831
|
+
function withRunSlideJumpTarget(style, slideTargetAt, onMissing) {
|
|
140832
|
+
if (!style || !slideTargetAt) {
|
|
140833
|
+
return style;
|
|
140834
|
+
}
|
|
140835
|
+
const index = style.hyperlinkTargetSlideIndex;
|
|
140836
|
+
if (typeof index !== "number" || style.hyperlinkRId) {
|
|
140837
|
+
return style;
|
|
140838
|
+
}
|
|
140839
|
+
const hyperlink = style.hyperlink?.trim();
|
|
140840
|
+
if (hyperlink && !hyperlink.startsWith("ppaction://")) {
|
|
140841
|
+
return style;
|
|
140842
|
+
}
|
|
140843
|
+
if (style.hyperlinkAction && style.hyperlinkAction !== SLIDE_JUMP_ACTION2) {
|
|
140844
|
+
return style;
|
|
140845
|
+
}
|
|
140846
|
+
const target = slideTargetAt(index);
|
|
140847
|
+
if (!target) {
|
|
140848
|
+
onMissing?.(index);
|
|
140849
|
+
const {
|
|
140850
|
+
hyperlink: _hyperlink,
|
|
140851
|
+
hyperlinkAction: _action,
|
|
140852
|
+
hyperlinkTargetSlideIndex: _index,
|
|
140853
|
+
hyperlinkTooltip: _tooltip,
|
|
140854
|
+
...rest
|
|
140855
|
+
} = style;
|
|
140856
|
+
return rest;
|
|
140857
|
+
}
|
|
140858
|
+
return { ...style, hyperlink: target, hyperlinkAction: SLIDE_JUMP_ACTION2 };
|
|
140859
|
+
}
|
|
140860
|
+
function withSegmentSlideJumpTargets(segments, slideTargetAt, onMissing) {
|
|
140861
|
+
if (!segments || !slideTargetAt) {
|
|
140862
|
+
return segments;
|
|
140863
|
+
}
|
|
140864
|
+
let changed = false;
|
|
140865
|
+
const next = segments.map((segment) => {
|
|
140866
|
+
const style = withRunSlideJumpTarget(segment.style, slideTargetAt, onMissing);
|
|
140867
|
+
if (style === segment.style) {
|
|
140868
|
+
return segment;
|
|
140869
|
+
}
|
|
140870
|
+
changed = true;
|
|
140871
|
+
return { ...segment, style };
|
|
140872
|
+
});
|
|
140873
|
+
return changed ? next : segments;
|
|
140874
|
+
}
|
|
140875
|
+
var SLIDE_JUMP_ACTION2;
|
|
140876
|
+
var init_run_slide_jump_targets = __esm({
|
|
140877
|
+
"pptx/core/core/runtime/run-slide-jump-targets.ts"() {
|
|
140878
|
+
SLIDE_JUMP_ACTION2 = "ppaction://hlinksldjump";
|
|
140879
|
+
}
|
|
140880
|
+
});
|
|
140881
|
+
|
|
140418
140882
|
// pptx/core/core/runtime/PptxHandlerRuntimeSaveTextWriter.ts
|
|
140419
140883
|
function firstWarpGuideName(preset) {
|
|
140420
140884
|
return preset !== void 0 && ADJ1_WARP_PRESETS.has(preset) ? "adj1" : "adj";
|
|
@@ -140429,6 +140893,7 @@ var init_PptxHandlerRuntimeSaveTextWriter = __esm({
|
|
|
140429
140893
|
init_element_paragraph_geometry();
|
|
140430
140894
|
init_paragraph_scoped_segment_state();
|
|
140431
140895
|
init_PptxHandlerRuntimeSaveEffectsWriter();
|
|
140896
|
+
init_run_slide_jump_targets();
|
|
140432
140897
|
init_PptxHandlerRuntimeSaveParagraphHelpers();
|
|
140433
140898
|
ADJ1_WARP_PRESETS = /* @__PURE__ */ new Set([
|
|
140434
140899
|
"textWave1",
|
|
@@ -140450,7 +140915,7 @@ var init_PptxHandlerRuntimeSaveTextWriter = __esm({
|
|
|
140450
140915
|
* text chains), and delegates paragraph creation to
|
|
140451
140916
|
* `createParagraphsFromTextContent`.
|
|
140452
140917
|
*/
|
|
140453
|
-
applyTextBodyContent(shape2, el, resolveHyperlinkRelationshipId, getSlideRelationshipMap) {
|
|
140918
|
+
applyTextBodyContent(shape2, el, resolveHyperlinkRelationshipId, getSlideRelationshipMap, slideTargetAt) {
|
|
140454
140919
|
const hasEditableTextContent = typeof el.text === "string" || (el.textSegments?.length ?? 0) > 0;
|
|
140455
140920
|
if (!hasEditableTextContent) {
|
|
140456
140921
|
return;
|
|
@@ -140573,10 +141038,15 @@ var init_PptxHandlerRuntimeSaveTextWriter = __esm({
|
|
|
140573
141038
|
);
|
|
140574
141039
|
}
|
|
140575
141040
|
txBody["a:bodyPr"] = bodyPr;
|
|
141041
|
+
const onMissing = (index) => this.reportMissingSlideJumpTarget(el.id, index);
|
|
140576
141042
|
txBody["a:p"] = this.createParagraphsFromTextContent(
|
|
140577
141043
|
textValueForSave,
|
|
140578
|
-
|
|
140579
|
-
|
|
141044
|
+
withRunSlideJumpTarget(
|
|
141045
|
+
this.routeElementParagraphGeometry(txBody, el.textStyle),
|
|
141046
|
+
slideTargetAt,
|
|
141047
|
+
onMissing
|
|
141048
|
+
),
|
|
141049
|
+
withSegmentSlideJumpTargets(textSegmentsForSave, slideTargetAt, onMissing),
|
|
140580
141050
|
resolveHyperlinkRelationshipId
|
|
140581
141051
|
);
|
|
140582
141052
|
}
|
|
@@ -140693,6 +141163,101 @@ var init_save_picture_geometry_gate = __esm({
|
|
|
140693
141163
|
}
|
|
140694
141164
|
});
|
|
140695
141165
|
|
|
141166
|
+
// pptx/core/core/runtime/save-picture-fill.ts
|
|
141167
|
+
function drawingPictureLayout(layout, emuPerPx) {
|
|
141168
|
+
const offset = (px2) => px2 === void 0 ? void 0 : Math.round(px2 * emuPerPx);
|
|
141169
|
+
if ([
|
|
141170
|
+
layout.tileOffsetX,
|
|
141171
|
+
layout.tileOffsetY,
|
|
141172
|
+
layout.tileScaleX,
|
|
141173
|
+
layout.tileScaleY,
|
|
141174
|
+
layout.tileFlip,
|
|
141175
|
+
layout.tileAlignment
|
|
141176
|
+
].some(has2)) {
|
|
141177
|
+
const tile = {};
|
|
141178
|
+
const offsetX = offset(layout.tileOffsetX);
|
|
141179
|
+
const offsetY = offset(layout.tileOffsetY);
|
|
141180
|
+
if (offsetX !== void 0) tile.offsetXEmu = offsetX;
|
|
141181
|
+
if (offsetY !== void 0) tile.offsetYEmu = offsetY;
|
|
141182
|
+
if (layout.tileScaleX !== void 0) tile.scaleX = layout.tileScaleX;
|
|
141183
|
+
if (layout.tileScaleY !== void 0) tile.scaleY = layout.tileScaleY;
|
|
141184
|
+
if (layout.tileFlip !== void 0) tile.flip = layout.tileFlip;
|
|
141185
|
+
if (layout.tileAlignment !== void 0) tile.alignment = layout.tileAlignment;
|
|
141186
|
+
return { tile };
|
|
141187
|
+
}
|
|
141188
|
+
if ([layout.fillRectLeft, layout.fillRectTop, layout.fillRectRight, layout.fillRectBottom].some(has2)) {
|
|
141189
|
+
return {
|
|
141190
|
+
fillRect: {
|
|
141191
|
+
l: layout.fillRectLeft ?? 0,
|
|
141192
|
+
t: layout.fillRectTop ?? 0,
|
|
141193
|
+
r: layout.fillRectRight ?? 0,
|
|
141194
|
+
b: layout.fillRectBottom ?? 0
|
|
141195
|
+
}
|
|
141196
|
+
};
|
|
141197
|
+
}
|
|
141198
|
+
return void 0;
|
|
141199
|
+
}
|
|
141200
|
+
function blipFillXml(relId, layout, parse) {
|
|
141201
|
+
const xml = drawingFillXml({ kind: "picture", relId, layout }) ?? "";
|
|
141202
|
+
const node = parse(xml)["a:blipFill"];
|
|
141203
|
+
delete node["@_xmlns:a"];
|
|
141204
|
+
delete node["@_xmlns:r"];
|
|
141205
|
+
return node;
|
|
141206
|
+
}
|
|
141207
|
+
function checkedBlipFill(relId, layout, ctx) {
|
|
141208
|
+
try {
|
|
141209
|
+
return blipFillXml(relId, layout, ctx.parse);
|
|
141210
|
+
} catch (error) {
|
|
141211
|
+
if (!(error instanceof RangeError)) {
|
|
141212
|
+
throw error;
|
|
141213
|
+
}
|
|
141214
|
+
ctx.warn(
|
|
141215
|
+
"SAVE_PICTURE_LAYOUT_INVALID",
|
|
141216
|
+
`Picture tile or fill rectangle could not be written (${error.message}); the picture is stretched over its frame instead.`
|
|
141217
|
+
);
|
|
141218
|
+
const { rotWithShape } = layout;
|
|
141219
|
+
return blipFillXml(relId, rotWithShape === void 0 ? {} : { rotWithShape }, ctx.parse);
|
|
141220
|
+
}
|
|
141221
|
+
}
|
|
141222
|
+
function writeNewShapePictureFill(spPr, style, ctx) {
|
|
141223
|
+
const relId = style.fillImageUrl ? ctx.embed(style.fillImageUrl) : void 0;
|
|
141224
|
+
if (!relId) {
|
|
141225
|
+
ctx.warn(
|
|
141226
|
+
"SAVE_SHAPE_PICTURE_FILL_UNSUPPORTED",
|
|
141227
|
+
"Shape picture fill could not be embedded (it needs a data: URL); the shape was saved without a fill."
|
|
141228
|
+
);
|
|
141229
|
+
return;
|
|
141230
|
+
}
|
|
141231
|
+
const layout = {
|
|
141232
|
+
...drawingPictureLayout(style.fillImageLayout ?? {}, ctx.emuPerPx),
|
|
141233
|
+
rotWithShape: style.fillImageRotWithShape ?? true
|
|
141234
|
+
};
|
|
141235
|
+
setFillChoice(spPr, "a:blipFill", checkedBlipFill(relId, layout, ctx));
|
|
141236
|
+
}
|
|
141237
|
+
function applyNewPictureLayout(blipFill, layout, ctx) {
|
|
141238
|
+
const drawingLayout = drawingPictureLayout(layout, ctx.emuPerPx);
|
|
141239
|
+
const relId = blipFill["a:blip"]?.["@_r:embed"];
|
|
141240
|
+
if (!drawingLayout || typeof relId !== "string") {
|
|
141241
|
+
return;
|
|
141242
|
+
}
|
|
141243
|
+
const built = checkedBlipFill(relId, drawingLayout, ctx);
|
|
141244
|
+
delete blipFill["a:stretch"];
|
|
141245
|
+
delete blipFill["a:tile"];
|
|
141246
|
+
for (const key2 of ["a:tile", "a:stretch"]) {
|
|
141247
|
+
if (built[key2] !== void 0) {
|
|
141248
|
+
blipFill[key2] = built[key2];
|
|
141249
|
+
}
|
|
141250
|
+
}
|
|
141251
|
+
}
|
|
141252
|
+
var has2;
|
|
141253
|
+
var init_save_picture_fill = __esm({
|
|
141254
|
+
"pptx/core/core/runtime/save-picture-fill.ts"() {
|
|
141255
|
+
init_write_fill();
|
|
141256
|
+
init_fill_choice_group();
|
|
141257
|
+
has2 = (value) => value !== void 0;
|
|
141258
|
+
}
|
|
141259
|
+
});
|
|
141260
|
+
|
|
140696
141261
|
// pptx/core/core/runtime/PptxHandlerRuntimeSaveElementEmbedding.ts
|
|
140697
141262
|
function getMediaReferenceContainer(shape2) {
|
|
140698
141263
|
if (!shape2) {
|
|
@@ -140714,9 +141279,11 @@ var init_PptxHandlerRuntimeSaveElementEmbedding = __esm({
|
|
|
140714
141279
|
init_diagram_relationship_ids();
|
|
140715
141280
|
init_drawing_media_reference();
|
|
140716
141281
|
init_xml_access();
|
|
141282
|
+
init_picture_svg_blip();
|
|
140717
141283
|
init_PptxHandlerRuntimeSaveTextWriter();
|
|
140718
141284
|
init_save_picture_geometry_gate();
|
|
140719
|
-
|
|
141285
|
+
init_save_picture_fill();
|
|
141286
|
+
PptxHandlerRuntime32 = class _PptxHandlerRuntime extends PptxHandlerRuntime31 {
|
|
140720
141287
|
/** Serialize table, chart, and SmartArt data when applicable. */
|
|
140721
141288
|
applyDataSerialization(shape2, el, slideId) {
|
|
140722
141289
|
if (el.type === "table" && "tableData" in el && el.tableData) {
|
|
@@ -140803,15 +141370,29 @@ var init_PptxHandlerRuntimeSaveElementEmbedding = __esm({
|
|
|
140803
141370
|
if (parsedImage) {
|
|
140804
141371
|
let targetImagePath = el.imagePath;
|
|
140805
141372
|
if (!targetImagePath) {
|
|
140806
|
-
|
|
140807
|
-
|
|
141373
|
+
const media = ctx.saveSession.mediaPathForContent(parsedImage.bytes, parsedImage.extension);
|
|
141374
|
+
targetImagePath = media.path;
|
|
140808
141375
|
const relativeMediaPath = targetImagePath.replace(/^ppt\//u, "../");
|
|
140809
|
-
ctx.slideRelationships.
|
|
140810
|
-
"@
|
|
140811
|
-
|
|
140812
|
-
|
|
140813
|
-
|
|
141376
|
+
const existingRelationshipId = media.reused ? ctx.slideRelationships.find(
|
|
141377
|
+
(rel) => rel["@_Type"] === ctx.slideImageRelationshipType && rel["@_Target"] === relativeMediaPath
|
|
141378
|
+
)?.["@_Id"] : void 0;
|
|
141379
|
+
const relationshipId2 = typeof existingRelationshipId === "string" ? existingRelationshipId : ctx.slideRelationshipRegistry.nextRelationshipId();
|
|
141380
|
+
if (relationshipId2 !== existingRelationshipId) {
|
|
141381
|
+
ctx.slideRelationships.push({
|
|
141382
|
+
"@_Id": relationshipId2,
|
|
141383
|
+
"@_Type": ctx.slideImageRelationshipType,
|
|
141384
|
+
"@_Target": relativeMediaPath
|
|
141385
|
+
});
|
|
141386
|
+
}
|
|
140814
141387
|
shape2 = this.createPictureXml(el, relationshipId2);
|
|
141388
|
+
this.embedNewSvgVariant(el, shape2, ctx);
|
|
141389
|
+
const blipFill = shape2["p:blipFill"];
|
|
141390
|
+
if (blipFill) {
|
|
141391
|
+
applyNewPictureLayout(blipFill, el, this.pictureFillSaveContext(el, ctx));
|
|
141392
|
+
}
|
|
141393
|
+
if (media.reused) {
|
|
141394
|
+
return shape2;
|
|
141395
|
+
}
|
|
140815
141396
|
}
|
|
140816
141397
|
if (targetImagePath) {
|
|
140817
141398
|
const targetExt = targetImagePath.toLowerCase().match(/\.(?<ext>[^./\\]+)$/u)?.groups?.["ext"];
|
|
@@ -140832,6 +141413,71 @@ var init_PptxHandlerRuntimeSaveElementEmbedding = __esm({
|
|
|
140832
141413
|
}
|
|
140833
141414
|
return shape2;
|
|
140834
141415
|
}
|
|
141416
|
+
/** Add an image relationship from the slide to `mediaPath`; its id. */
|
|
141417
|
+
addSlideImageRelationship(mediaPath, ctx) {
|
|
141418
|
+
const relationshipId2 = ctx.slideRelationshipRegistry.nextRelationshipId();
|
|
141419
|
+
ctx.slideRelationships.push({
|
|
141420
|
+
"@_Id": relationshipId2,
|
|
141421
|
+
"@_Type": ctx.slideImageRelationshipType,
|
|
141422
|
+
"@_Target": mediaPath.replace(/^ppt\//u, "../")
|
|
141423
|
+
});
|
|
141424
|
+
return relationshipId2;
|
|
141425
|
+
}
|
|
141426
|
+
/** What the picture-fill writers need, bound to `el` on the slide being saved. */
|
|
141427
|
+
pictureFillSaveContext(el, ctx) {
|
|
141428
|
+
return {
|
|
141429
|
+
emuPerPx: _PptxHandlerRuntime.EMU_PER_PX,
|
|
141430
|
+
parse: (xml) => this.parser.parse(xml),
|
|
141431
|
+
embed: (dataUrl) => {
|
|
141432
|
+
const parsed = this.parseDataUrlToBytes(dataUrl);
|
|
141433
|
+
if (!parsed) {
|
|
141434
|
+
return void 0;
|
|
141435
|
+
}
|
|
141436
|
+
const mediaPath = ctx.saveSession.nextMediaPath(parsed.extension);
|
|
141437
|
+
this.zip.file(mediaPath, parsed.bytes);
|
|
141438
|
+
return this.addSlideImageRelationship(mediaPath, ctx);
|
|
141439
|
+
},
|
|
141440
|
+
warn: (code, message) => this.compatibilityService.reportWarning({
|
|
141441
|
+
code,
|
|
141442
|
+
message,
|
|
141443
|
+
scope: "element",
|
|
141444
|
+
slideId: ctx.slide.id,
|
|
141445
|
+
elementId: el.id
|
|
141446
|
+
})
|
|
141447
|
+
};
|
|
141448
|
+
}
|
|
141449
|
+
/**
|
|
141450
|
+
* For a new SVG picture (`svgData` without a part yet), write the SVG part
|
|
141451
|
+
* and point the blip's `asvg:svgBlip` extension at it; the blip itself
|
|
141452
|
+
* embeds the raster (`imageData`).
|
|
141453
|
+
*/
|
|
141454
|
+
embedNewSvgVariant(el, picture, ctx) {
|
|
141455
|
+
const svgData = el.svgData;
|
|
141456
|
+
if (!svgData || el.svgPath) {
|
|
141457
|
+
return;
|
|
141458
|
+
}
|
|
141459
|
+
const parsed = this.parseDataUrlToBytes(svgData);
|
|
141460
|
+
if (!parsed || parsed.extension.toLowerCase() !== "svg") {
|
|
141461
|
+
return;
|
|
141462
|
+
}
|
|
141463
|
+
const media = ctx.saveSession.mediaPathForContent(parsed.bytes, "svg");
|
|
141464
|
+
const target = media.path.replace(/^ppt\//u, "../");
|
|
141465
|
+
const existing = media.reused ? ctx.slideRelationships.find(
|
|
141466
|
+
(rel) => rel["@_Type"] === ctx.slideImageRelationshipType && rel["@_Target"] === target
|
|
141467
|
+
)?.["@_Id"] : void 0;
|
|
141468
|
+
const relationshipId2 = typeof existing === "string" ? existing : ctx.slideRelationshipRegistry.nextRelationshipId();
|
|
141469
|
+
if (relationshipId2 !== existing) {
|
|
141470
|
+
ctx.slideRelationships.push({
|
|
141471
|
+
"@_Id": relationshipId2,
|
|
141472
|
+
"@_Type": ctx.slideImageRelationshipType,
|
|
141473
|
+
"@_Target": target
|
|
141474
|
+
});
|
|
141475
|
+
}
|
|
141476
|
+
if (!media.reused) {
|
|
141477
|
+
this.zip.file(media.path, parsed.bytes);
|
|
141478
|
+
}
|
|
141479
|
+
addSvgBlipExtension(picture, relationshipId2);
|
|
141480
|
+
}
|
|
140835
141481
|
/** Embed media data and manage relationships for media elements. */
|
|
140836
141482
|
processMediaEmbedding(mediaElement, shape2, ctx) {
|
|
140837
141483
|
const mediaType = mediaElement.mediaType === "audio" ? "audio" : "video";
|
|
@@ -142199,6 +142845,7 @@ var init_PptxHandlerRuntimeSaveElementWriter = __esm({
|
|
|
142199
142845
|
init_xml_access();
|
|
142200
142846
|
init_xml_reorder();
|
|
142201
142847
|
init_PptxHandlerRuntimeSaveContentPartInk();
|
|
142848
|
+
init_save_picture_fill();
|
|
142202
142849
|
init_PptxHandlerRuntimeSaveShapeXml();
|
|
142203
142850
|
init_template_group_node();
|
|
142204
142851
|
PptxHandlerRuntime41 = class _PptxHandlerRuntime extends PptxHandlerRuntime40 {
|
|
@@ -142610,6 +143257,10 @@ var init_PptxHandlerRuntimeSaveElementWriter = __esm({
|
|
|
142610
143257
|
}
|
|
142611
143258
|
if (!shape2 && (el.type === "text" || el.type === "shape")) {
|
|
142612
143259
|
shape2 = this.createElementXml(el);
|
|
143260
|
+
const spPr = ensureXmlChild(shape2, "p:spPr");
|
|
143261
|
+
if (spPr && el.shapeStyle?.fillMode === "image") {
|
|
143262
|
+
writeNewShapePictureFill(spPr, el.shapeStyle, this.pictureFillSaveContext(el, ctx));
|
|
143263
|
+
}
|
|
142613
143264
|
}
|
|
142614
143265
|
if (!shape2 && el.type === "connector") {
|
|
142615
143266
|
shape2 = this.createConnectorXml(el);
|
|
@@ -142722,7 +143373,8 @@ var init_PptxHandlerRuntimeSaveElementWriter = __esm({
|
|
|
142722
143373
|
shape2,
|
|
142723
143374
|
el,
|
|
142724
143375
|
ctx.resolveHyperlinkRelationshipId,
|
|
142725
|
-
ctx.getSlideRelationshipMap
|
|
143376
|
+
ctx.getSlideRelationshipMap,
|
|
143377
|
+
ctx.slideTargetAt
|
|
142726
143378
|
);
|
|
142727
143379
|
}
|
|
142728
143380
|
this.applyDataSerialization(shape2, el, ctx.slide.id);
|