ooxml-ui 1.9.0 → 1.10.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/{chunk-SNV6YKPC.js → chunk-HZSYGNNB.js} +2 -1
- package/dist/{chunk-SKYBYVYH.js → chunk-IXLJNVUD.js} +1 -1
- package/dist/{chunk-PH7IBZOZ.js → chunk-WMGMZIMM.js} +1 -1
- package/dist/docx/print-border-width.d.ts +2 -0
- package/dist/docx/print-table.d.ts +1 -1
- package/dist/docx.js +93 -8
- package/dist/index.js +3 -3
- package/dist/pptx/ai/index.cjs +2 -2
- package/dist/pptx/ai/index.mjs +1 -1
- package/dist/pptx/{chunk-F7BBPOVJ.mjs → chunk-5AD3V3PA.mjs} +1 -0
- package/dist/pptx/{chunk-BPAA5FSB.mjs → chunk-6B3UUVRS.mjs} +1 -1
- package/dist/pptx/{chunk-KBCKCW5M.mjs → chunk-6NFW2AQA.mjs} +682 -481
- package/dist/pptx/chunk-EYPNQ3FG.cjs +59 -0
- package/dist/pptx/chunk-FFIYFHBO.mjs +55 -0
- package/dist/pptx/{chunk-HWW2UVUP.cjs → chunk-JRCK6CFI.cjs} +19 -9
- package/dist/pptx/{chunk-MKVKISFW.mjs → chunk-OBRLAW6C.mjs} +1 -1
- package/dist/pptx/{chunk-BFZDO2DY.cjs → chunk-OCNECNJS.cjs} +785 -550
- package/dist/pptx/{chunk-Y4LTLCQP.cjs → chunk-OJFD3SHS.cjs} +26 -47
- package/dist/pptx/{chunk-7KPDES3X.mjs → chunk-PMURSMHH.mjs} +6 -35
- package/dist/pptx/{chunk-PKDISDDZ.cjs → chunk-TSSWTBJQ.cjs} +2 -2
- package/dist/pptx/{chunk-SABFKDRM.mjs → chunk-WFEN6SHA.mjs} +19 -10
- package/dist/pptx/{chunk-UEF4BFW4.cjs → chunk-XFQ2RD4I.cjs} +7 -7
- package/dist/pptx/{chunk-QVYJB7G2.cjs → chunk-Y7CDPPMZ.cjs} +1 -0
- package/dist/pptx/dom/elements/text-shape.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +228 -218
- package/dist/pptx/dom/index.mjs +29 -19
- package/dist/pptx/dom/load-presentation.d.ts +1 -0
- package/dist/pptx/dom/load-presentation.d.ts.map +1 -1
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en-galleries.d.ts.map +1 -1
- package/dist/pptx/index.cjs +2889 -2825
- package/dist/pptx/index.mjs +7 -7
- package/dist/pptx/render/animation-after-effect-authoring.d.ts +1 -38
- package/dist/pptx/render/animation-after-effect-authoring.d.ts.map +1 -1
- package/dist/pptx/render/animation-after-effect.d.ts +2 -2
- package/dist/pptx/render/animation-after-effect.d.ts.map +1 -1
- package/dist/pptx/render/animation-authoring.cjs +39 -39
- package/dist/pptx/render/animation-authoring.d.ts +2 -11
- package/dist/pptx/render/animation-authoring.d.ts.map +1 -1
- package/dist/pptx/render/animation-authoring.mjs +1 -1
- package/dist/pptx/render/animation-opacity-playback.d.ts +9 -0
- package/dist/pptx/render/animation-opacity-playback.d.ts.map +1 -0
- package/dist/pptx/render/animation-opacity-style.d.ts +6 -0
- package/dist/pptx/render/animation-opacity-style.d.ts.map +1 -0
- package/dist/pptx/render/animation-playback-engine.d.ts +1 -1
- package/dist/pptx/render/animation-playback-engine.d.ts.map +1 -1
- package/dist/pptx/render/animation-playback-seek.d.ts.map +1 -1
- package/dist/pptx/render/animation-playback-steps.d.ts.map +1 -1
- package/dist/pptx/render/animation-timeline-engine.d.ts +4 -0
- package/dist/pptx/render/animation-timeline-engine.d.ts.map +1 -1
- package/dist/pptx/render/animation-timeline-group.d.ts +2 -0
- package/dist/pptx/render/animation-timeline-group.d.ts.map +1 -1
- package/dist/pptx/render/animation-timeline-regular-step.d.ts.map +1 -1
- package/dist/pptx/render/animation-timeline-rows.d.ts.map +1 -1
- package/dist/pptx/render/animation-timeline-sequence-builder.d.ts.map +1 -1
- package/dist/pptx/render/animation-timeline-step-effect.d.ts +2 -1
- package/dist/pptx/render/animation-timeline-step-effect.d.ts.map +1 -1
- package/dist/pptx/render/animation-timeline-step.d.ts +3 -1
- package/dist/pptx/render/animation-timeline-step.d.ts.map +1 -1
- package/dist/pptx/render/background-animation-layers.d.ts +12 -0
- package/dist/pptx/render/background-animation-layers.d.ts.map +1 -0
- package/dist/pptx/render/customization/customization-resolve-ribbon.d.ts.map +1 -1
- package/dist/pptx/render/customization/ribbon-control-catalog-tail.d.ts +6 -0
- package/dist/pptx/render/customization/ribbon-control-catalog-tail.d.ts.map +1 -1
- package/dist/pptx/render/customization/ribbon-control-catalog.d.ts +6 -0
- package/dist/pptx/render/customization/ribbon-control-catalog.d.ts.map +1 -1
- package/dist/pptx/render/field-context.d.ts +2 -0
- package/dist/pptx/render/field-context.d.ts.map +1 -1
- package/dist/pptx/render/font-family-update.d.ts +45 -0
- package/dist/pptx/render/font-family-update.d.ts.map +1 -0
- package/dist/pptx/render/format-painter.cjs +6 -6
- package/dist/pptx/render/format-painter.mjs +3 -3
- package/dist/pptx/render/index.d.ts +3 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inline-selection-utils.d.ts +2 -1
- package/dist/pptx/render/inline-selection-utils.d.ts.map +1 -1
- package/dist/pptx/render/inspector-helpers.cjs +17 -13
- package/dist/pptx/render/inspector-helpers.d.ts +8 -0
- package/dist/pptx/render/inspector-helpers.d.ts.map +1 -1
- package/dist/pptx/render/inspector-helpers.mjs +2 -2
- package/dist/pptx/render/picture-frame.d.ts +20 -0
- package/dist/pptx/render/picture-frame.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-animations-state.cjs +6 -6
- package/dist/pptx/render/ribbon-animations-state.mjs +2 -2
- package/dist/pptx/render/ribbon-galleries/gallery-placements.d.ts +3 -3
- package/dist/pptx/render/ribbon-galleries/gallery-placements.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/table-style-tile-svg.d.ts +21 -6
- package/dist/pptx/render/ribbon-galleries/table-style-tile-svg.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/table-styles-gallery.d.ts +3 -1
- package/dist/pptx/render/ribbon-galleries/table-styles-gallery.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-home-crop.d.ts +37 -0
- package/dist/pptx/render/ribbon-home-crop.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-home-families-objects.d.ts +5 -2
- package/dist/pptx/render/ribbon-home-families-objects.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-home-spec.d.ts +1 -1
- package/dist/pptx/render/ribbon-home-spec.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-home-state-extras.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-home-state.d.ts +1 -0
- package/dist/pptx/render/ribbon-home-state.d.ts.map +1 -1
- package/dist/pptx/render/text-block-style.d.ts.map +1 -1
- package/dist/pptx/render/text-field-substitution.d.ts +12 -0
- package/dist/pptx/render/text-field-substitution.d.ts.map +1 -1
- package/dist/pptx/render/text-style-update.d.ts.map +1 -1
- package/dist/pptx/render/update-text-segment-style.d.ts +7 -1
- package/dist/pptx/render/update-text-segment-style.d.ts.map +1 -1
- package/dist/pptx/web-components/index.d.ts.map +1 -1
- package/dist/pptx/web-components/ribbon-home-styles.d.ts +1 -1
- package/dist/pptx/web-components/ribbon-home-styles.d.ts.map +1 -1
- package/dist/pptx/web-components/ribbon-home.d.ts +2 -0
- package/dist/pptx/web-components/ribbon-home.d.ts.map +1 -1
- package/dist/{presentation-preview-HF3GZ2VD.js → presentation-preview-VIIU7E2S.js} +1 -1
- package/dist/teams.js +2 -2
- package/dist/xlsx/dialogs/pivot-values.d.ts +10 -0
- package/dist/xlsx.js +147 -12
- package/package.json +2 -2
- package/dist/pptx/chunk-CENGE3TZ.mjs +0 -10
- package/dist/pptx/chunk-OGJRSAGH.cjs +0 -12
package/dist/pptx/dom/index.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOCNECNJS_cjs = require('../chunk-OCNECNJS.cjs');
|
|
4
4
|
require('../chunk-WSTWYZFM.cjs');
|
|
5
5
|
var chunk2JEQHIAL_cjs = require('../chunk-2JEQHIAL.cjs');
|
|
6
6
|
require('../chunk-IOR4KOGN.cjs');
|
|
7
7
|
require('../chunk-X7FS7XHU.cjs');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-XFQ2RD4I.cjs');
|
|
9
9
|
require('../chunk-52LKIMK3.cjs');
|
|
10
10
|
var chunkK3S2A64B_cjs = require('../chunk-K3S2A64B.cjs');
|
|
11
11
|
require('../chunk-XOAXPD2W.cjs');
|
|
12
12
|
require('../chunk-P27CIE4O.cjs');
|
|
13
13
|
require('../chunk-BSGCZ4JZ.cjs');
|
|
14
|
-
require('../chunk-
|
|
14
|
+
require('../chunk-TSSWTBJQ.cjs');
|
|
15
15
|
require('../chunk-IOOI63TH.cjs');
|
|
16
16
|
require('../chunk-ZJFN5POF.cjs');
|
|
17
|
-
require('../chunk-
|
|
17
|
+
require('../chunk-JRCK6CFI.cjs');
|
|
18
18
|
require('../chunk-WB25PCHQ.cjs');
|
|
19
19
|
require('../chunk-W3X2UVYQ.cjs');
|
|
20
20
|
var chunkVFPVEVF4_cjs = require('../chunk-VFPVEVF4.cjs');
|
|
@@ -29,12 +29,12 @@ require('../chunk-X4FNVH7J.cjs');
|
|
|
29
29
|
require('../chunk-FGKPZFLL.cjs');
|
|
30
30
|
require('../chunk-UPN5FFKP.cjs');
|
|
31
31
|
require('../chunk-FQUX6AUU.cjs');
|
|
32
|
-
require('../chunk-
|
|
32
|
+
require('../chunk-OJFD3SHS.cjs');
|
|
33
33
|
require('../chunk-USBRSEJK.cjs');
|
|
34
34
|
require('../chunk-47FYJVMH.cjs');
|
|
35
35
|
var chunkU47LRWDT_cjs = require('../chunk-U47LRWDT.cjs');
|
|
36
|
-
var
|
|
37
|
-
require('../chunk-
|
|
36
|
+
var chunkY7CDPPMZ_cjs = require('../chunk-Y7CDPPMZ.cjs');
|
|
37
|
+
require('../chunk-EYPNQ3FG.cjs');
|
|
38
38
|
require('../chunk-HJ3JZXOL.cjs');
|
|
39
39
|
require('../chunk-EW5DW5KR.cjs');
|
|
40
40
|
var pptx = require('ooxml-core/pptx');
|
|
@@ -95,7 +95,7 @@ function buildActiveXControlsOverlay(doc, controls, canvasSize) {
|
|
|
95
95
|
zIndex: "40"
|
|
96
96
|
});
|
|
97
97
|
controls.forEach((control, index) => {
|
|
98
|
-
const view =
|
|
98
|
+
const view = chunkOCNECNJS_cjs.getActiveXControlOverlayView(control, canvasSize, index);
|
|
99
99
|
const style = {
|
|
100
100
|
position: "absolute",
|
|
101
101
|
left: `${view.left}px`,
|
|
@@ -131,7 +131,7 @@ function appendCommentMarkers(doc, stage, comments, canvasSize, t, onMarkerClick
|
|
|
131
131
|
pointerEvents: "none",
|
|
132
132
|
zIndex: "45"
|
|
133
133
|
});
|
|
134
|
-
const markers =
|
|
134
|
+
const markers = chunkOCNECNJS_cjs.buildCommentMarkers(
|
|
135
135
|
comments,
|
|
136
136
|
canvasSize.width,
|
|
137
137
|
canvasSize.height,
|
|
@@ -140,10 +140,10 @@ function appendCommentMarkers(doc, stage, comments, canvasSize, t, onMarkerClick
|
|
|
140
140
|
for (const marker of markers) {
|
|
141
141
|
const dot = createEl(doc, "button", "pptxv-comment-marker", {
|
|
142
142
|
position: "absolute",
|
|
143
|
-
left: `${marker.x -
|
|
144
|
-
top: `${marker.y -
|
|
145
|
-
width: `${
|
|
146
|
-
height: `${
|
|
143
|
+
left: `${marker.x - chunkOCNECNJS_cjs.COMMENT_MARKER_SIZE / 2}px`,
|
|
144
|
+
top: `${marker.y - chunkOCNECNJS_cjs.COMMENT_MARKER_SIZE / 2}px`,
|
|
145
|
+
width: `${chunkOCNECNJS_cjs.COMMENT_MARKER_SIZE}px`,
|
|
146
|
+
height: `${chunkOCNECNJS_cjs.COMMENT_MARKER_SIZE}px`,
|
|
147
147
|
display: "flex",
|
|
148
148
|
alignItems: "center",
|
|
149
149
|
justifyContent: "center",
|
|
@@ -211,7 +211,7 @@ function merge3dStyle(base, computed) {
|
|
|
211
211
|
}
|
|
212
212
|
function getShapeFillStrokeStyle(el, animatesFill, animatesStroke) {
|
|
213
213
|
if (el.type === "group") {
|
|
214
|
-
const fx2 =
|
|
214
|
+
const fx2 = chunkOCNECNJS_cjs.getComputedEffectStyle(el);
|
|
215
215
|
const groupStyle = {};
|
|
216
216
|
if (fx2.filter) {
|
|
217
217
|
groupStyle.filter = fx2.filter;
|
|
@@ -233,7 +233,7 @@ function getShapeFillStrokeStyle(el, animatesFill, animatesStroke) {
|
|
|
233
233
|
style[key] = value;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
const stroke =
|
|
236
|
+
const stroke = chunkOCNECNJS_cjs.getComputedStrokeStyle(el);
|
|
237
237
|
if (stroke.borderWidth > 0) {
|
|
238
238
|
if (animatesStroke) {
|
|
239
239
|
style["borderWidth"] = stroke.cssBorderWidth;
|
|
@@ -252,7 +252,7 @@ function getShapeFillStrokeStyle(el, animatesFill, animatesStroke) {
|
|
|
252
252
|
style["strokeMiterlimit"] = stroke.strokeMiterlimit;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
const fx =
|
|
255
|
+
const fx = chunkOCNECNJS_cjs.getComputedEffectStyle(el);
|
|
256
256
|
if (fx.boxShadow) {
|
|
257
257
|
style["boxShadow"] = fx.boxShadow;
|
|
258
258
|
}
|
|
@@ -269,11 +269,11 @@ function getShapeFillStrokeStyle(el, animatesFill, animatesStroke) {
|
|
|
269
269
|
if (fx.overflowVisible) {
|
|
270
270
|
style["overflow"] = "visible";
|
|
271
271
|
}
|
|
272
|
-
merge3dStyle(style,
|
|
273
|
-
if (
|
|
272
|
+
merge3dStyle(style, chunkOCNECNJS_cjs.getComputed3dStyle(el));
|
|
273
|
+
if (chunkOCNECNJS_cjs.isHollowShapeElement(el)) {
|
|
274
274
|
style["pointerEvents"] = "none";
|
|
275
275
|
}
|
|
276
|
-
const geometry =
|
|
276
|
+
const geometry = chunkOCNECNJS_cjs.resolveShapeGeometry(el);
|
|
277
277
|
switch (geometry.kind) {
|
|
278
278
|
case "bare":
|
|
279
279
|
style["backgroundColor"] = "transparent";
|
|
@@ -307,12 +307,12 @@ function getTextBlockStyle(el) {
|
|
|
307
307
|
if (!pptx.hasTextProperties(el)) {
|
|
308
308
|
return {};
|
|
309
309
|
}
|
|
310
|
-
const base =
|
|
310
|
+
const base = chunkOCNECNJS_cjs.buildTextBlockStyle(el, {
|
|
311
311
|
fallbackColor: chunkVFPVEVF4_cjs.DEFAULT_TEXT_COLOR,
|
|
312
312
|
bodyLayout: true,
|
|
313
313
|
pxLengths: true
|
|
314
314
|
});
|
|
315
|
-
const scene3d =
|
|
315
|
+
const scene3d = chunkOCNECNJS_cjs.buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height });
|
|
316
316
|
if (!scene3d) {
|
|
317
317
|
return base;
|
|
318
318
|
}
|
|
@@ -417,7 +417,7 @@ function renderSlideStage(options) {
|
|
|
417
417
|
"--pptxv-grid-size": `${options.gridSpacingPx ?? 10}px`,
|
|
418
418
|
// One device pixel in slide px: thin strokes stay visible on screen.
|
|
419
419
|
...chunk526IHNIH_cjs.deviceStrokeStageStyle(scale),
|
|
420
|
-
...
|
|
420
|
+
...chunkOCNECNJS_cjs.getSlideBackgroundStyle(slide, { widthPx: canvasSize.width, heightPx: canvasSize.height })
|
|
421
421
|
});
|
|
422
422
|
if (interactive || options.reading) {
|
|
423
423
|
stage.setAttribute("role", "region");
|
|
@@ -458,19 +458,19 @@ function renderSlideStage(options) {
|
|
|
458
458
|
selectedElementIds: options.selectedElementIds,
|
|
459
459
|
registry,
|
|
460
460
|
renderElement(element, zIndex) {
|
|
461
|
-
if (!
|
|
461
|
+
if (!chunkOCNECNJS_cjs.isElementRendered(element)) {
|
|
462
462
|
return null;
|
|
463
463
|
}
|
|
464
464
|
const node = registry.resolve(element.type)(element, zIndex, context);
|
|
465
465
|
if (node && interactive && "setAttribute" in node) {
|
|
466
|
-
const templateLocked =
|
|
466
|
+
const templateLocked = chunkOCNECNJS_cjs.isTemplateElementId(element.id) && !options.templateEditing;
|
|
467
467
|
if (templateLocked) {
|
|
468
468
|
node.style.pointerEvents = "none";
|
|
469
469
|
}
|
|
470
470
|
node.setAttribute("data-pptx-element", "true");
|
|
471
471
|
}
|
|
472
|
-
if (node && element.type !== "text" && element.type !== "shape" && element.type !== "connector" &&
|
|
473
|
-
const hitTargetStyle =
|
|
472
|
+
if (node && element.type !== "text" && element.type !== "shape" && element.type !== "connector" && chunkOCNECNJS_cjs.shouldRenderHitTarget(interactive, options.presenting ?? false)) {
|
|
473
|
+
const hitTargetStyle = chunkOCNECNJS_cjs.elementHitTargetStyle(element);
|
|
474
474
|
if (hitTargetStyle) {
|
|
475
475
|
const hitTarget = createEl(doc, "div", void 0, hitTargetStyle);
|
|
476
476
|
hitTarget.setAttribute("aria-hidden", "true");
|
|
@@ -489,20 +489,20 @@ function renderSlideStage(options) {
|
|
|
489
489
|
}
|
|
490
490
|
});
|
|
491
491
|
if (interactive || options.reading) {
|
|
492
|
-
|
|
492
|
+
chunkOCNECNJS_cjs.applyRenderedElementAccessibility(stage, slide.elements, {
|
|
493
493
|
presenting: options.presenting ?? false
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
if (interactive) {
|
|
497
|
-
|
|
497
|
+
chunkOCNECNJS_cjs.applyElementActionAffordances(
|
|
498
498
|
stage,
|
|
499
499
|
slide.elements.filter(
|
|
500
|
-
(element) => options.templateEditing || !
|
|
500
|
+
(element) => options.templateEditing || !chunkOCNECNJS_cjs.isTemplateElementId(element.id)
|
|
501
501
|
),
|
|
502
502
|
{
|
|
503
503
|
canInteract: true,
|
|
504
504
|
presenting: options.presenting ?? false,
|
|
505
|
-
labels:
|
|
505
|
+
labels: chunkOCNECNJS_cjs.actionAffordanceLabels((key) => t(key))
|
|
506
506
|
}
|
|
507
507
|
);
|
|
508
508
|
}
|
|
@@ -558,7 +558,7 @@ function createChartTitleEditor(container, onCommit) {
|
|
|
558
558
|
|
|
559
559
|
// src/pptx/dom/elements/chart-editable.ts
|
|
560
560
|
function attachChartEditing(container, element, context, repaint) {
|
|
561
|
-
if (element.type !== "chart" || !context.interactive || !context.onChartPointChange || !
|
|
561
|
+
if (element.type !== "chart" || !context.interactive || !context.onChartPointChange || !chunkOCNECNJS_cjs.canDrillDown(element)) {
|
|
562
562
|
return;
|
|
563
563
|
}
|
|
564
564
|
const chart = element;
|
|
@@ -598,7 +598,7 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
598
598
|
if (!rect) {
|
|
599
599
|
return;
|
|
600
600
|
}
|
|
601
|
-
const step2 =
|
|
601
|
+
const step2 = chunkOCNECNJS_cjs.advanceChartMarkDrag(activeMark, event.clientX, event.clientY, rect);
|
|
602
602
|
if (!step2) {
|
|
603
603
|
return;
|
|
604
604
|
}
|
|
@@ -688,7 +688,7 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
688
688
|
seriesIndex: part.seriesIndex,
|
|
689
689
|
pointIndex: part.pointIndex
|
|
690
690
|
});
|
|
691
|
-
const startedMark =
|
|
691
|
+
const startedMark = chunkOCNECNJS_cjs.beginChartMarkDrag({
|
|
692
692
|
part,
|
|
693
693
|
geometry: markGeometry,
|
|
694
694
|
chartData: chart.chartData,
|
|
@@ -780,7 +780,7 @@ function mountThreeViewInto(doc, wrapper, options) {
|
|
|
780
780
|
return view;
|
|
781
781
|
}
|
|
782
782
|
function isChart3DEditable(element, context) {
|
|
783
|
-
return element.type === "chart" && Boolean(context.interactive) && Boolean(context.onChartPointChange) && Boolean(context.selectedElementIds?.has(element.id)) &&
|
|
783
|
+
return element.type === "chart" && Boolean(context.interactive) && Boolean(context.onChartPointChange) && Boolean(context.selectedElementIds?.has(element.id)) && chunkOCNECNJS_cjs.canDrillDown(element);
|
|
784
784
|
}
|
|
785
785
|
function selectedChartPartOf(element, context) {
|
|
786
786
|
return context.chartPartSelection?.elementId === element.id ? context.chartPartSelection.part : null;
|
|
@@ -822,13 +822,13 @@ function wireChartThreeViewEvents(view, element, context, badgeHost) {
|
|
|
822
822
|
const listeners = new AbortController();
|
|
823
823
|
chartViewListeners.set(view, listeners);
|
|
824
824
|
view.addEventListener(
|
|
825
|
-
|
|
826
|
-
(event) =>
|
|
825
|
+
chunkOCNECNJS_cjs.THREE_VIEW_EVENTS.select,
|
|
826
|
+
(event) => chunkOCNECNJS_cjs.applyChart3DSelect(bridge, event.detail.part),
|
|
827
827
|
{ signal: listeners.signal }
|
|
828
828
|
);
|
|
829
829
|
view.addEventListener(
|
|
830
|
-
|
|
831
|
-
(event) =>
|
|
830
|
+
chunkOCNECNJS_cjs.THREE_VIEW_EVENTS.drag,
|
|
831
|
+
(event) => chunkOCNECNJS_cjs.applyChart3DDrag(bridge, event.detail),
|
|
832
832
|
{ signal: listeners.signal }
|
|
833
833
|
);
|
|
834
834
|
}
|
|
@@ -842,7 +842,7 @@ function applyThreeViewTextStyle(el, style) {
|
|
|
842
842
|
// src/pptx/dom/elements/chart.ts
|
|
843
843
|
var renderChartElement = (element, zIndex, context) => {
|
|
844
844
|
const wrapper = renderChartSvgElement(element, zIndex, context);
|
|
845
|
-
const spec = wrapper ?
|
|
845
|
+
const spec = wrapper ? chunkOCNECNJS_cjs.resolveChartThreeViewSpec(element, rendering3DFlagsOf(context)) : null;
|
|
846
846
|
if (!wrapper || !spec) {
|
|
847
847
|
return wrapper;
|
|
848
848
|
}
|
|
@@ -864,11 +864,11 @@ var renderChartSvgElement = (element, zIndex, context) => {
|
|
|
864
864
|
doc,
|
|
865
865
|
"div",
|
|
866
866
|
"pptxv-element pptxv-chart",
|
|
867
|
-
|
|
867
|
+
chunkOCNECNJS_cjs.getContainerStyle(element, zIndex)
|
|
868
868
|
);
|
|
869
869
|
container.dataset.elementId = element.id;
|
|
870
870
|
const animationState = context.presentationStates?.get(element.id);
|
|
871
|
-
const chartData = element.chartData ?
|
|
871
|
+
const chartData = element.chartData ? chunkOCNECNJS_cjs.resolveRevealedChartData(element.chartData, animationState) : element.chartData;
|
|
872
872
|
if (!chartData || chartData.series.length === 0) {
|
|
873
873
|
container.appendChild(renderChartPlaceholder(doc, chartData?.chartType ?? "bar", context.t));
|
|
874
874
|
return container;
|
|
@@ -916,7 +916,7 @@ function renderChartPlaceholder(doc, chartType, t) {
|
|
|
916
916
|
border: "1px dashed #cbd5e1",
|
|
917
917
|
boxSizing: "border-box"
|
|
918
918
|
});
|
|
919
|
-
placeholder.textContent =
|
|
919
|
+
placeholder.textContent = chunkOCNECNJS_cjs.chartPlaceholderLabel(chartType, (key, params) => t(key, params));
|
|
920
920
|
return placeholder;
|
|
921
921
|
}
|
|
922
922
|
|
|
@@ -980,7 +980,7 @@ function createRunBaseNode(doc, run) {
|
|
|
980
980
|
verticalAlign: "middle",
|
|
981
981
|
fontFamily: "'Cambria Math', 'STIX Two Math', serif"
|
|
982
982
|
});
|
|
983
|
-
math.innerHTML =
|
|
983
|
+
math.innerHTML = chunkOCNECNJS_cjs.runEquationMathMl(run.equation);
|
|
984
984
|
host.appendChild(math);
|
|
985
985
|
if (run.equation.number) {
|
|
986
986
|
const number = createEl(doc, "span", "pptxv-equation-number", {
|
|
@@ -992,7 +992,7 @@ function createRunBaseNode(doc, run) {
|
|
|
992
992
|
}
|
|
993
993
|
return host;
|
|
994
994
|
}
|
|
995
|
-
if (run.hyperlink &&
|
|
995
|
+
if (run.hyperlink && chunkOCNECNJS_cjs.isRunHyperlinkClickable(run.hyperlink)) {
|
|
996
996
|
const link = createEl(doc, "a", "pptxv-link", run.style);
|
|
997
997
|
link.setAttribute("data-pptx-hyperlink", run.hyperlink.url);
|
|
998
998
|
link.setAttribute("role", "link");
|
|
@@ -1097,7 +1097,7 @@ function renderTextBlock(doc, paragraphs, textStyle, build) {
|
|
|
1097
1097
|
bullet.textContent = para.bulletMarker;
|
|
1098
1098
|
p.appendChild(bullet);
|
|
1099
1099
|
}
|
|
1100
|
-
const spec = build ?
|
|
1100
|
+
const spec = build ? chunkOCNECNJS_cjs.buildTextBuildSpec(
|
|
1101
1101
|
build.elementId,
|
|
1102
1102
|
paragraphs.indexOf(para),
|
|
1103
1103
|
para.runs.filter((run) => run.text !== NEWLINE_RUN).map((run) => ({ text: run.text, style: run.style })),
|
|
@@ -1106,7 +1106,7 @@ function renderTextBlock(doc, paragraphs, textStyle, build) {
|
|
|
1106
1106
|
if (spec && spec.granularity !== "paragraph") {
|
|
1107
1107
|
for (const span of spec.spans ?? []) {
|
|
1108
1108
|
const node = createEl(doc, "span");
|
|
1109
|
-
applyStyleMap(node, { ...span.style ?? {}, ...
|
|
1109
|
+
applyStyleMap(node, { ...span.style ?? {}, ...chunkOCNECNJS_cjs.textBuildSpanStyle(span) });
|
|
1110
1110
|
if (span.animId) {
|
|
1111
1111
|
node.setAttribute("data-anim-id", span.animId);
|
|
1112
1112
|
}
|
|
@@ -1119,7 +1119,7 @@ function renderTextBlock(doc, paragraphs, textStyle, build) {
|
|
|
1119
1119
|
let runHost = p;
|
|
1120
1120
|
if (spec) {
|
|
1121
1121
|
const wrapper = createEl(doc, "span");
|
|
1122
|
-
applyStyleMap(wrapper,
|
|
1122
|
+
applyStyleMap(wrapper, chunkOCNECNJS_cjs.textBuildSpanStyle(spec));
|
|
1123
1123
|
if (spec.animId) {
|
|
1124
1124
|
wrapper.setAttribute("data-anim-id", spec.animId);
|
|
1125
1125
|
}
|
|
@@ -1175,7 +1175,7 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1175
1175
|
if (element.hidden) {
|
|
1176
1176
|
wrapper.style.display = "none";
|
|
1177
1177
|
}
|
|
1178
|
-
const lineGlow =
|
|
1178
|
+
const lineGlow = chunkOCNECNJS_cjs.getLineGlowFilterCss(ss);
|
|
1179
1179
|
if (lineGlow) {
|
|
1180
1180
|
wrapper.style.filter = lineGlow;
|
|
1181
1181
|
}
|
|
@@ -1183,7 +1183,7 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1183
1183
|
svg.setAttribute("style", "overflow:visible;display:block");
|
|
1184
1184
|
const seed = element.id.replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
1185
1185
|
const defs = createSvgEl(doc, "defs");
|
|
1186
|
-
const lineShadow =
|
|
1186
|
+
const lineShadow = chunkOCNECNJS_cjs.getLineShadowParams(ss);
|
|
1187
1187
|
const shadowId = lineShadow ? `${seed}-line-shadow` : void 0;
|
|
1188
1188
|
if (lineShadow && shadowId) {
|
|
1189
1189
|
const filter = createSvgEl(doc, "filter", {
|
|
@@ -1204,8 +1204,8 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1204
1204
|
);
|
|
1205
1205
|
defs.appendChild(filter);
|
|
1206
1206
|
}
|
|
1207
|
-
const startArrow =
|
|
1208
|
-
const endArrow =
|
|
1207
|
+
const startArrow = chunkOCNECNJS_cjs.normalizeArrow(ss?.connectorStartArrow);
|
|
1208
|
+
const endArrow = chunkOCNECNJS_cjs.normalizeArrow(ss?.connectorEndArrow);
|
|
1209
1209
|
const startMarkerId = startArrow ? `${seed}-start` : void 0;
|
|
1210
1210
|
const endMarkerId = endArrow ? `${seed}-end` : void 0;
|
|
1211
1211
|
if (startArrow && startMarkerId) {
|
|
@@ -1228,10 +1228,10 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1228
1228
|
svg.appendChild(defs);
|
|
1229
1229
|
}
|
|
1230
1230
|
const compound = ss?.compoundLine;
|
|
1231
|
-
const offsets =
|
|
1232
|
-
const widths =
|
|
1231
|
+
const offsets = chunkOCNECNJS_cjs.getCompoundLineOffsets(compound, strokeWidth);
|
|
1232
|
+
const widths = chunkOCNECNJS_cjs.getCompoundLineWidths(compound, strokeWidth);
|
|
1233
1233
|
const shapeType = pptx.hasShapeProperties(element) ? element.shapeType : void 0;
|
|
1234
|
-
const usePath =
|
|
1234
|
+
const usePath = chunkOCNECNJS_cjs.connectorNeedsPath(shapeType) && pptx.hasShapeProperties(element);
|
|
1235
1235
|
const pathData = usePath ? pptx.getConnectorPathGeometry(element).pathData : void 0;
|
|
1236
1236
|
const x1 = element.flipHorizontal ? w : 0;
|
|
1237
1237
|
const y1 = element.flipVertical ? h : 0;
|
|
@@ -1242,7 +1242,7 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1242
1242
|
d: pathData ?? `M${x1},${y1} L${x2},${y2}`,
|
|
1243
1243
|
fill: "none",
|
|
1244
1244
|
stroke: "transparent",
|
|
1245
|
-
"stroke-width":
|
|
1245
|
+
"stroke-width": chunkOCNECNJS_cjs.connectorHitStrokeWidth(strokeWidth),
|
|
1246
1246
|
"stroke-linecap": "round",
|
|
1247
1247
|
"stroke-linejoin": "round"
|
|
1248
1248
|
});
|
|
@@ -1292,7 +1292,7 @@ function appendConnectorLabel(wrapper, element, context) {
|
|
|
1292
1292
|
if (!pptx.hasTextProperties(element)) {
|
|
1293
1293
|
return;
|
|
1294
1294
|
}
|
|
1295
|
-
const paragraphs =
|
|
1295
|
+
const paragraphs = chunkOCNECNJS_cjs.buildParagraphs(element, context.fieldContext);
|
|
1296
1296
|
if (!paragraphs.some((paragraph) => paragraph.runs.length > 0)) {
|
|
1297
1297
|
return;
|
|
1298
1298
|
}
|
|
@@ -1312,7 +1312,7 @@ function appendConnectorLabel(wrapper, element, context) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
function buildMarker(context, id, arrow, strokeColor, size) {
|
|
1314
1314
|
const doc = context.document;
|
|
1315
|
-
const shape =
|
|
1315
|
+
const shape = chunkOCNECNJS_cjs.markerPath(arrow, size.width, size.length);
|
|
1316
1316
|
const marker = createSvgEl(doc, "marker", {
|
|
1317
1317
|
id,
|
|
1318
1318
|
viewBox: "0 0 10 10",
|
|
@@ -1396,7 +1396,7 @@ var renderContentPartElement = (element, zIndex, context) => {
|
|
|
1396
1396
|
doc,
|
|
1397
1397
|
"div",
|
|
1398
1398
|
"pptxv-element pptxv-contentpart",
|
|
1399
|
-
|
|
1399
|
+
chunkOCNECNJS_cjs.getContainerStyle(element, zIndex)
|
|
1400
1400
|
);
|
|
1401
1401
|
el.dataset.elementId = element.id;
|
|
1402
1402
|
const strokes = element.inkStrokes;
|
|
@@ -1429,7 +1429,7 @@ var renderContentPartElement = (element, zIndex, context) => {
|
|
|
1429
1429
|
return el;
|
|
1430
1430
|
};
|
|
1431
1431
|
function renderEquations(element, context) {
|
|
1432
|
-
if (!pptx.hasTextProperties(element) || !
|
|
1432
|
+
if (!pptx.hasTextProperties(element) || !chunkOCNECNJS_cjs.isEquationOnlyText(element.textSegments)) {
|
|
1433
1433
|
return null;
|
|
1434
1434
|
}
|
|
1435
1435
|
const equations = (element.textSegments ?? []).filter((segment) => segment.equationXml);
|
|
@@ -1443,7 +1443,7 @@ function renderEquations(element, context) {
|
|
|
1443
1443
|
fontFamily: "'Cambria Math', 'STIX Two Math', serif"
|
|
1444
1444
|
});
|
|
1445
1445
|
for (const segment of equations) {
|
|
1446
|
-
const mathml =
|
|
1446
|
+
const mathml = chunkOCNECNJS_cjs.convertOmmlToMathMl(segment.equationXml);
|
|
1447
1447
|
if (!mathml) {
|
|
1448
1448
|
continue;
|
|
1449
1449
|
}
|
|
@@ -1457,7 +1457,7 @@ function renderEquations(element, context) {
|
|
|
1457
1457
|
flex: 1,
|
|
1458
1458
|
textAlign: "center"
|
|
1459
1459
|
});
|
|
1460
|
-
math.innerHTML =
|
|
1460
|
+
math.innerHTML = chunkOCNECNJS_cjs.sanitizeMathMl(mathml);
|
|
1461
1461
|
row.appendChild(math);
|
|
1462
1462
|
if (segment.equationNumber) {
|
|
1463
1463
|
const number = createEl(context.document, "span", "pptxv-equation-number", {
|
|
@@ -1475,7 +1475,7 @@ function renderExtrusionOverlay(doc, element) {
|
|
|
1475
1475
|
return null;
|
|
1476
1476
|
}
|
|
1477
1477
|
const fill = chunkVFPVEVF4_cjs.getComputedFillStyle(element)?.backgroundColor;
|
|
1478
|
-
const data =
|
|
1478
|
+
const data = chunkOCNECNJS_cjs.build3DExtrusionData(
|
|
1479
1479
|
element.shapeStyle?.shape3d,
|
|
1480
1480
|
element.shapeStyle?.scene3d,
|
|
1481
1481
|
fill,
|
|
@@ -1537,7 +1537,7 @@ function appendOwnReflection(doc, host, element, mediaDataUrls, suppressOwnRefle
|
|
|
1537
1537
|
if (suppressOwnReflection) {
|
|
1538
1538
|
return;
|
|
1539
1539
|
}
|
|
1540
|
-
const wrapperStyle =
|
|
1540
|
+
const wrapperStyle = chunkOCNECNJS_cjs.getComputedEffectStyle(element).reflection;
|
|
1541
1541
|
if (!wrapperStyle) {
|
|
1542
1542
|
return;
|
|
1543
1543
|
}
|
|
@@ -1561,9 +1561,9 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1561
1561
|
if (groupFilterDefs) {
|
|
1562
1562
|
wrap.appendChild(groupFilterDefs);
|
|
1563
1563
|
}
|
|
1564
|
-
const childParentFill =
|
|
1564
|
+
const childParentFill = chunkOCNECNJS_cjs.getGroupChildParentFill(element, parentGroupFill);
|
|
1565
1565
|
for (const child of element.children ?? []) {
|
|
1566
|
-
const childWrap = createEl(doc, "div", void 0,
|
|
1566
|
+
const childWrap = createEl(doc, "div", void 0, chunkOCNECNJS_cjs.getContainerStyle(child, 0));
|
|
1567
1567
|
childWrap.appendChild(
|
|
1568
1568
|
buildReflectionMirrorContent(doc, child, mediaDataUrls, childParentFill)
|
|
1569
1569
|
);
|
|
@@ -1577,7 +1577,7 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1577
1577
|
height: "100%",
|
|
1578
1578
|
...getShapeFillStrokeStyle(element)
|
|
1579
1579
|
});
|
|
1580
|
-
const inheritedFill =
|
|
1580
|
+
const inheritedFill = chunkOCNECNJS_cjs.resolveGroupChildFill(element, parentGroupFill);
|
|
1581
1581
|
if (inheritedFill) {
|
|
1582
1582
|
applyInheritedFill(box, inheritedFill);
|
|
1583
1583
|
}
|
|
@@ -1598,12 +1598,12 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1598
1598
|
box.appendChild(gradientOutline);
|
|
1599
1599
|
}
|
|
1600
1600
|
if (pptx.isImageLikeElement(element)) {
|
|
1601
|
-
const src =
|
|
1601
|
+
const src = chunkOCNECNJS_cjs.getImageSrc(element, new Map(mediaDataUrls));
|
|
1602
1602
|
if (src) {
|
|
1603
1603
|
const img = createEl(doc, "img", void 0, {
|
|
1604
1604
|
width: "100%",
|
|
1605
1605
|
height: "100%",
|
|
1606
|
-
...
|
|
1606
|
+
...chunkOCNECNJS_cjs.getImageFitStyle(element)
|
|
1607
1607
|
});
|
|
1608
1608
|
img.setAttribute("src", src);
|
|
1609
1609
|
img.setAttribute("alt", "");
|
|
@@ -1613,7 +1613,7 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1613
1613
|
appendOwnReflection(doc, box, element, mediaDataUrls, suppressOwnReflection);
|
|
1614
1614
|
return box;
|
|
1615
1615
|
}
|
|
1616
|
-
const paragraphs =
|
|
1616
|
+
const paragraphs = chunkOCNECNJS_cjs.buildParagraphs(element);
|
|
1617
1617
|
const hasText = paragraphs.some((p) => p.runs.length > 0 || p.bulletMarker !== void 0);
|
|
1618
1618
|
if (hasText) {
|
|
1619
1619
|
box.appendChild(renderTextBlock(doc, paragraphs, getTextBlockStyle(element)));
|
|
@@ -1625,20 +1625,20 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1625
1625
|
// src/pptx/dom/elements/shape-filter-defs.ts
|
|
1626
1626
|
var OUTLINE_SVG_STYLE = "position:absolute;inset:0;width:100%;height:100%;min-width:1px;min-height:1px;overflow:visible;pointer-events:none";
|
|
1627
1627
|
function renderShapeFilterDefs(doc, element) {
|
|
1628
|
-
const style =
|
|
1628
|
+
const style = chunkOCNECNJS_cjs.getEffectStyleSource(element);
|
|
1629
1629
|
if (!style) {
|
|
1630
1630
|
return null;
|
|
1631
1631
|
}
|
|
1632
1632
|
const markups = [];
|
|
1633
|
-
const duotone =
|
|
1633
|
+
const duotone = chunkOCNECNJS_cjs.getDuotoneSvgFilter(style, element.id);
|
|
1634
1634
|
if (duotone) {
|
|
1635
1635
|
markups.push(duotone.filterMarkup);
|
|
1636
1636
|
}
|
|
1637
|
-
const softEdge =
|
|
1637
|
+
const softEdge = chunkOCNECNJS_cjs.getSoftEdgeSvgFilter(style, element.id);
|
|
1638
1638
|
if (softEdge) {
|
|
1639
1639
|
markups.push(softEdge.filterMarkup);
|
|
1640
1640
|
}
|
|
1641
|
-
const bevelLighting =
|
|
1641
|
+
const bevelLighting = chunkOCNECNJS_cjs.getBevelLightingSvgFilter(element);
|
|
1642
1642
|
if (bevelLighting) {
|
|
1643
1643
|
markups.push(bevelLighting.filterMarkup);
|
|
1644
1644
|
}
|
|
@@ -1656,7 +1656,7 @@ function renderShapeFillOverlay(doc, element) {
|
|
|
1656
1656
|
if (!pptx.hasShapeProperties(element)) {
|
|
1657
1657
|
return null;
|
|
1658
1658
|
}
|
|
1659
|
-
const overlay =
|
|
1659
|
+
const overlay = chunkOCNECNJS_cjs.getComputedEffectStyle(element).fillOverlay;
|
|
1660
1660
|
if (!overlay) {
|
|
1661
1661
|
return null;
|
|
1662
1662
|
}
|
|
@@ -1671,7 +1671,7 @@ function renderShapeFillOverlay(doc, element) {
|
|
|
1671
1671
|
return layer;
|
|
1672
1672
|
}
|
|
1673
1673
|
function renderReflectionOverlay(doc, element, mediaDataUrls) {
|
|
1674
|
-
const wrapperStyle =
|
|
1674
|
+
const wrapperStyle = chunkOCNECNJS_cjs.getComputedEffectStyle(element).reflection;
|
|
1675
1675
|
if (!wrapperStyle) {
|
|
1676
1676
|
return null;
|
|
1677
1677
|
}
|
|
@@ -1681,13 +1681,13 @@ function renderReflectionOverlay(doc, element, mediaDataUrls) {
|
|
|
1681
1681
|
return layer;
|
|
1682
1682
|
}
|
|
1683
1683
|
function renderHollowHitOutline(doc, element) {
|
|
1684
|
-
const hit =
|
|
1684
|
+
const hit = chunkOCNECNJS_cjs.buildHollowHitOutline(element);
|
|
1685
1685
|
if (!hit) {
|
|
1686
1686
|
return null;
|
|
1687
1687
|
}
|
|
1688
1688
|
const svg = createSvgEl(doc, "svg", {
|
|
1689
1689
|
"aria-hidden": "true",
|
|
1690
|
-
viewBox:
|
|
1690
|
+
viewBox: chunkOCNECNJS_cjs.strokeOutlineViewBox(element),
|
|
1691
1691
|
preserveAspectRatio: "none"
|
|
1692
1692
|
});
|
|
1693
1693
|
svg.setAttribute("style", OUTLINE_SVG_STYLE);
|
|
@@ -1720,20 +1720,20 @@ function renderShapeSubpathFillOverlay(doc, element) {
|
|
|
1720
1720
|
return svg;
|
|
1721
1721
|
}
|
|
1722
1722
|
function renderStrokeOutline(doc, element) {
|
|
1723
|
-
const outline =
|
|
1723
|
+
const outline = chunkOCNECNJS_cjs.buildStrokeOutline(element);
|
|
1724
1724
|
if (!outline) {
|
|
1725
1725
|
return null;
|
|
1726
1726
|
}
|
|
1727
1727
|
const svg = createSvgEl(doc, "svg", {
|
|
1728
1728
|
class: "pptx-vanilla-gradient-outline",
|
|
1729
1729
|
"aria-hidden": "true",
|
|
1730
|
-
viewBox:
|
|
1730
|
+
viewBox: chunkOCNECNJS_cjs.strokeOutlineViewBox(element),
|
|
1731
1731
|
preserveAspectRatio: "none"
|
|
1732
1732
|
});
|
|
1733
1733
|
svg.setAttribute("style", OUTLINE_SVG_STYLE);
|
|
1734
1734
|
if (outline.paint) {
|
|
1735
1735
|
const defs = createSvgEl(doc, "defs");
|
|
1736
|
-
if (
|
|
1736
|
+
if (chunkOCNECNJS_cjs.isPatternPaint(outline.paint)) {
|
|
1737
1737
|
const pattern = createSvgEl(doc, "pattern", {
|
|
1738
1738
|
id: outline.paint.id,
|
|
1739
1739
|
width: outline.paint.width,
|
|
@@ -1748,7 +1748,7 @@ function renderStrokeOutline(doc, element) {
|
|
|
1748
1748
|
pattern.appendChild(image);
|
|
1749
1749
|
defs.appendChild(pattern);
|
|
1750
1750
|
} else {
|
|
1751
|
-
defs.innerHTML =
|
|
1751
|
+
defs.innerHTML = chunkOCNECNJS_cjs.svgGradientMarkup(outline.paint);
|
|
1752
1752
|
}
|
|
1753
1753
|
svg.appendChild(defs);
|
|
1754
1754
|
}
|
|
@@ -1799,14 +1799,14 @@ function indexRenderedNodes(root) {
|
|
|
1799
1799
|
return byId;
|
|
1800
1800
|
}
|
|
1801
1801
|
function paintInheritedFill(node, element, parentGroupFill) {
|
|
1802
|
-
const inherited =
|
|
1802
|
+
const inherited = chunkOCNECNJS_cjs.resolveGroupChildFill(element, parentGroupFill);
|
|
1803
1803
|
if (inherited) {
|
|
1804
1804
|
applyGroupChildFill(node, inherited);
|
|
1805
1805
|
}
|
|
1806
1806
|
if (element.type !== "group") {
|
|
1807
1807
|
return;
|
|
1808
1808
|
}
|
|
1809
|
-
const childFill =
|
|
1809
|
+
const childFill = chunkOCNECNJS_cjs.getGroupChildParentFill(element, parentGroupFill);
|
|
1810
1810
|
if (!childFill) {
|
|
1811
1811
|
return;
|
|
1812
1812
|
}
|
|
@@ -1820,7 +1820,7 @@ function paintInheritedFill(node, element, parentGroupFill) {
|
|
|
1820
1820
|
}
|
|
1821
1821
|
var renderGroupElement = (element, zIndex, context) => {
|
|
1822
1822
|
const el = createEl(context.document, "div", "pptxv-element pptxv-group", {
|
|
1823
|
-
...
|
|
1823
|
+
...chunkOCNECNJS_cjs.getContainerStyle(element, zIndex),
|
|
1824
1824
|
// A group paints no fill/outline of its own, but `p:grpSpPr/a:effectLst`
|
|
1825
1825
|
// DOES carry a shadow/glow/soft-edge for the group's own composite
|
|
1826
1826
|
// raster (see shared `getComputedEffectStyle`), expressed as `filter` /
|
|
@@ -1837,7 +1837,7 @@ var renderGroupElement = (element, zIndex, context) => {
|
|
|
1837
1837
|
el.appendChild(reflection);
|
|
1838
1838
|
}
|
|
1839
1839
|
if (element.type === "group" && element.children?.length) {
|
|
1840
|
-
const parentGroupFill =
|
|
1840
|
+
const parentGroupFill = chunkOCNECNJS_cjs.getGroupChildParentFill(element);
|
|
1841
1841
|
element.children.forEach((child, index) => {
|
|
1842
1842
|
const childEl = context.renderElement(child, index);
|
|
1843
1843
|
if (childEl) {
|
|
@@ -1852,16 +1852,16 @@ var renderGroupElement = (element, zIndex, context) => {
|
|
|
1852
1852
|
// src/pptx/dom/elements/image.ts
|
|
1853
1853
|
var renderImageElement = (element, zIndex, context) => {
|
|
1854
1854
|
const doc = context.document;
|
|
1855
|
-
const geometry = element.type === "image" || element.type === "picture" ?
|
|
1855
|
+
const geometry = element.type === "image" || element.type === "picture" ? chunkOCNECNJS_cjs.resolveShapeGeometry(element) : void 0;
|
|
1856
1856
|
const geometryClipPath = geometry?.kind === "clipPath" ? geometry.clipPath : void 0;
|
|
1857
|
-
const cropShapeClipPath = element.type === "image" || element.type === "picture" ?
|
|
1858
|
-
const layers =
|
|
1859
|
-
overflow:
|
|
1857
|
+
const cropShapeClipPath = element.type === "image" || element.type === "picture" ? chunkOCNECNJS_cjs.getCropShapeClipPath(element.cropShape, element.width, element.height) : void 0;
|
|
1858
|
+
const layers = chunkOCNECNJS_cjs.getPictureFrameLayers(element, {
|
|
1859
|
+
overflow: chunkOCNECNJS_cjs.getImageOverflow(element),
|
|
1860
1860
|
borderRadius: geometry?.kind === "borderRadius" ? geometry.radius : void 0,
|
|
1861
1861
|
clipPath: geometryClipPath ?? cropShapeClipPath
|
|
1862
1862
|
});
|
|
1863
1863
|
const el = createEl(doc, "div", "pptxv-element pptxv-image", {
|
|
1864
|
-
...
|
|
1864
|
+
...chunkOCNECNJS_cjs.getContainerStyle(element, zIndex),
|
|
1865
1865
|
...layers.box
|
|
1866
1866
|
});
|
|
1867
1867
|
el.dataset.elementId = element.id;
|
|
@@ -1873,11 +1873,11 @@ var renderImageElement = (element, zIndex, context) => {
|
|
|
1873
1873
|
el.appendChild(outline);
|
|
1874
1874
|
}
|
|
1875
1875
|
}
|
|
1876
|
-
const src =
|
|
1876
|
+
const src = chunkOCNECNJS_cjs.getImageSrc(element, new Map(context.mediaDataUrls));
|
|
1877
1877
|
if (!src) {
|
|
1878
1878
|
return el;
|
|
1879
1879
|
}
|
|
1880
|
-
const fx =
|
|
1880
|
+
const fx = chunkOCNECNJS_cjs.getComputedImageStyle(element);
|
|
1881
1881
|
for (const f of fx.svgFilters) {
|
|
1882
1882
|
const svg = createSvgEl(doc, "svg", { width: 0, height: 0, "aria-hidden": "true" });
|
|
1883
1883
|
svg.setAttribute("style", "position:absolute;width:0;height:0;overflow:hidden");
|
|
@@ -1890,7 +1890,7 @@ var renderImageElement = (element, zIndex, context) => {
|
|
|
1890
1890
|
surface.appendChild(svg);
|
|
1891
1891
|
}
|
|
1892
1892
|
const reflection = renderReflectionOverlay(doc, element, context.mediaDataUrls);
|
|
1893
|
-
const tiling =
|
|
1893
|
+
const tiling = chunkOCNECNJS_cjs.getImageTilingStyle(element, chunkOCNECNJS_cjs.getCachedNativeImageSize(src));
|
|
1894
1894
|
if (tiling) {
|
|
1895
1895
|
const tile = createEl(doc, "div", "pptxv-image-tile", tiling);
|
|
1896
1896
|
if (fx.filter) {
|
|
@@ -1899,10 +1899,10 @@ var renderImageElement = (element, zIndex, context) => {
|
|
|
1899
1899
|
if (fx.opacity !== void 0) {
|
|
1900
1900
|
tile.style.opacity = String(fx.opacity);
|
|
1901
1901
|
}
|
|
1902
|
-
if (!
|
|
1903
|
-
void
|
|
1902
|
+
if (!chunkOCNECNJS_cjs.getCachedNativeImageSize(src)) {
|
|
1903
|
+
void chunkOCNECNJS_cjs.probeNativeImageSize(src).then((size) => {
|
|
1904
1904
|
if (size) {
|
|
1905
|
-
applyStyleMap(tile,
|
|
1905
|
+
applyStyleMap(tile, chunkOCNECNJS_cjs.getImageTilingStyle(element, size) ?? {});
|
|
1906
1906
|
}
|
|
1907
1907
|
return void 0;
|
|
1908
1908
|
});
|
|
@@ -1913,8 +1913,8 @@ var renderImageElement = (element, zIndex, context) => {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
return el;
|
|
1915
1915
|
}
|
|
1916
|
-
const fit =
|
|
1917
|
-
const fillCounterTransform =
|
|
1916
|
+
const fit = chunkOCNECNJS_cjs.getImageFitStyle(element);
|
|
1917
|
+
const fillCounterTransform = chunkOCNECNJS_cjs.getImageFillCounterTransform(element, Boolean(fit.transform));
|
|
1918
1918
|
const img = createEl(doc, "img", void 0, {
|
|
1919
1919
|
...fit,
|
|
1920
1920
|
display: "block",
|
|
@@ -1933,14 +1933,14 @@ var renderImageElement = (element, zIndex, context) => {
|
|
|
1933
1933
|
if (element.type === "image" || element.type === "picture") {
|
|
1934
1934
|
const clrChange = element.imageEffects?.clrChange;
|
|
1935
1935
|
if (clrChange) {
|
|
1936
|
-
void
|
|
1936
|
+
void chunkOCNECNJS_cjs.resolveColorChangedImageSource(src, clrChange).then((resolved) => {
|
|
1937
1937
|
if (img.src === src || img.getAttribute("src") === src) {
|
|
1938
1938
|
img.src = resolved;
|
|
1939
1939
|
}
|
|
1940
1940
|
return void 0;
|
|
1941
1941
|
});
|
|
1942
1942
|
}
|
|
1943
|
-
const wash =
|
|
1943
|
+
const wash = chunkOCNECNJS_cjs.getImageColorWashStyle(element.imageEffects?.colorWash);
|
|
1944
1944
|
if (wash) {
|
|
1945
1945
|
surface.appendChild(
|
|
1946
1946
|
createEl(doc, "div", "pptxv-image-color-wash", {
|
|
@@ -1969,7 +1969,7 @@ var renderInkElement = (element, zIndex, context) => {
|
|
|
1969
1969
|
doc,
|
|
1970
1970
|
"div",
|
|
1971
1971
|
"pptxv-element pptxv-ink",
|
|
1972
|
-
|
|
1972
|
+
chunkOCNECNJS_cjs.getContainerStyle(element, zIndex)
|
|
1973
1973
|
);
|
|
1974
1974
|
wrapper.dataset.elementId = element.id;
|
|
1975
1975
|
const paths = element.inkPaths;
|
|
@@ -1990,7 +1990,7 @@ var renderInkElement = (element, zIndex, context) => {
|
|
|
1990
1990
|
keyframes.textContent = chunkNTXHQHCS_cjs.INK_REPLAY_KEYFRAMES;
|
|
1991
1991
|
svg.appendChild(keyframes);
|
|
1992
1992
|
}
|
|
1993
|
-
const views =
|
|
1993
|
+
const views = chunkOCNECNJS_cjs.buildInkGroupStrokes(element, { color: chunkVFPVEVF4_cjs.DEFAULT_STROKE_COLOR, width: 1 });
|
|
1994
1994
|
for (const [i, view] of views.entries()) {
|
|
1995
1995
|
svg.appendChild(buildStrokeSvg(doc, view, replayStyles[i]));
|
|
1996
1996
|
}
|
|
@@ -2044,12 +2044,12 @@ function wireMediaFullscreenOverlay(doc, container, mediaNode, element, context,
|
|
|
2044
2044
|
let stopButton = null;
|
|
2045
2045
|
const update = (playing) => {
|
|
2046
2046
|
const input = { fullScreen: element.fullScreen, presenting: context.presenting, playing };
|
|
2047
|
-
const active =
|
|
2047
|
+
const active = chunkOCNECNJS_cjs.isMediaFullscreenActive(input);
|
|
2048
2048
|
applyStyleMap(
|
|
2049
2049
|
container,
|
|
2050
|
-
active ?
|
|
2050
|
+
active ? chunkOCNECNJS_cjs.MEDIA_FULLSCREEN_OVERLAY_STYLE : mediaFullscreenResetStyle(baseStyle)
|
|
2051
2051
|
);
|
|
2052
|
-
if (
|
|
2052
|
+
if (chunkOCNECNJS_cjs.shouldShowMediaFullscreenStopButton(input)) {
|
|
2053
2053
|
if (!stopButton) {
|
|
2054
2054
|
stopButton = buildFullscreenStopButton(
|
|
2055
2055
|
doc,
|
|
@@ -2074,12 +2074,12 @@ function wireMediaFullscreenOverlay(doc, container, mediaNode, element, context,
|
|
|
2074
2074
|
|
|
2075
2075
|
// src/pptx/dom/elements/media.ts
|
|
2076
2076
|
function applyMediaPresentingState(el, presenting, playback) {
|
|
2077
|
-
|
|
2077
|
+
chunkOCNECNJS_cjs.applyMediaPlaybackAttributes(el, playback);
|
|
2078
2078
|
if (presenting) {
|
|
2079
|
-
|
|
2080
|
-
|
|
2079
|
+
chunkOCNECNJS_cjs.startMediaAutoplay(el, { trimStartMs: playback.trimStartMs });
|
|
2080
|
+
chunkOCNECNJS_cjs.scheduleMediaTrimAndFade(el, {
|
|
2081
2081
|
...playback,
|
|
2082
|
-
volume:
|
|
2082
|
+
volume: chunkOCNECNJS_cjs.mediaPlaybackAttributes(playback).volume
|
|
2083
2083
|
});
|
|
2084
2084
|
} else if (!el.paused) {
|
|
2085
2085
|
el.pause();
|
|
@@ -2089,18 +2089,18 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2089
2089
|
if (element.type !== "media") {
|
|
2090
2090
|
return null;
|
|
2091
2091
|
}
|
|
2092
|
-
const surface =
|
|
2092
|
+
const surface = chunkOCNECNJS_cjs.mediaSurfaceOf({
|
|
2093
2093
|
interactive: context.interactive === true || context.reading === true,
|
|
2094
2094
|
presenting: context.presenting
|
|
2095
2095
|
});
|
|
2096
|
-
const showTransport =
|
|
2096
|
+
const showTransport = chunkOCNECNJS_cjs.mediaTransportVisible({ ...surface, canvasTransport: true });
|
|
2097
2097
|
const doc = context.document;
|
|
2098
|
-
const baseStyle =
|
|
2098
|
+
const baseStyle = chunkOCNECNJS_cjs.getContainerStyle(element, zIndex);
|
|
2099
2099
|
const el = createEl(doc, "div", "pptxv-element pptxv-media", baseStyle);
|
|
2100
2100
|
el.dataset.elementId = element.id;
|
|
2101
2101
|
const mediaSrc = element.mediaData ?? (element.mediaPath ? context.mediaDataUrls.get(element.mediaPath) : void 0);
|
|
2102
|
-
const posterSrc =
|
|
2103
|
-
const onlineVideoEmbedUrl =
|
|
2102
|
+
const posterSrc = chunkOCNECNJS_cjs.getImageSrc(element, new Map(context.mediaDataUrls));
|
|
2103
|
+
const onlineVideoEmbedUrl = chunkOCNECNJS_cjs.getOnlineVideoEmbed(element)?.embedUrl;
|
|
2104
2104
|
if (onlineVideoEmbedUrl && element.mediaType === "video") {
|
|
2105
2105
|
const iframe = createEl(doc, "iframe", "pptxv-media-video pptxv-media-iframe", {
|
|
2106
2106
|
width: "100%",
|
|
@@ -2110,8 +2110,8 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2110
2110
|
});
|
|
2111
2111
|
iframe.src = onlineVideoEmbedUrl;
|
|
2112
2112
|
iframe.title = context.t("pptx.media.onlineVideoTitle");
|
|
2113
|
-
iframe.allow =
|
|
2114
|
-
iframe.sandbox.value =
|
|
2113
|
+
iframe.allow = chunkOCNECNJS_cjs.ONLINE_VIDEO_IFRAME_ALLOW;
|
|
2114
|
+
iframe.sandbox.value = chunkOCNECNJS_cjs.ONLINE_VIDEO_IFRAME_SANDBOX;
|
|
2115
2115
|
iframe.allowFullscreen = true;
|
|
2116
2116
|
el.appendChild(iframe);
|
|
2117
2117
|
return el;
|
|
@@ -2140,21 +2140,21 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2140
2140
|
audio.src = mediaSrc;
|
|
2141
2141
|
audio.controls = showTransport;
|
|
2142
2142
|
el.appendChild(audio);
|
|
2143
|
-
if (context.presenting &&
|
|
2143
|
+
if (context.presenting && chunkOCNECNJS_cjs.registerCrossSlideAudio(element, mediaSrc)) {
|
|
2144
2144
|
audio.muted = true;
|
|
2145
|
-
|
|
2145
|
+
chunkOCNECNJS_cjs.applyMediaPlaybackAttributes(audio, element);
|
|
2146
2146
|
return el;
|
|
2147
2147
|
}
|
|
2148
2148
|
applyMediaPresentingState(audio, context.presenting, element);
|
|
2149
2149
|
wireMediaFullscreenOverlay(doc, el, audio, element, context, baseStyle);
|
|
2150
2150
|
return el;
|
|
2151
2151
|
}
|
|
2152
|
-
const fallback =
|
|
2152
|
+
const fallback = chunkOCNECNJS_cjs.mediaFallbackVisual(surface, {
|
|
2153
2153
|
hasPoster: Boolean(posterSrc),
|
|
2154
2154
|
missing: element.mediaMissing === true
|
|
2155
2155
|
});
|
|
2156
|
-
const icon =
|
|
2157
|
-
const labelKey =
|
|
2156
|
+
const icon = chunkOCNECNJS_cjs.mediaFallbackIcon(fallback, element.mediaType);
|
|
2157
|
+
const labelKey = chunkOCNECNJS_cjs.mediaFallbackLabelKey(fallback, element.mediaType);
|
|
2158
2158
|
if (fallback.poster && posterSrc) {
|
|
2159
2159
|
const img = createEl(doc, "img", "pptxv-media-poster", {
|
|
2160
2160
|
width: "100%",
|
|
@@ -2172,7 +2172,7 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2172
2172
|
if (fallback.badge === "missing") {
|
|
2173
2173
|
badge.classList.add("pptxv-media-badge-missing");
|
|
2174
2174
|
}
|
|
2175
|
-
badge.setAttribute(
|
|
2175
|
+
badge.setAttribute(chunkOCNECNJS_cjs.MEDIA_CHROME_ATTRIBUTE, fallback.badge);
|
|
2176
2176
|
badge.appendChild(buildIcon(doc, icon));
|
|
2177
2177
|
if (labelKey !== void 0 && fallback.badge === "missing") {
|
|
2178
2178
|
const text = createEl(doc, "span");
|
|
@@ -2185,7 +2185,7 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2185
2185
|
}
|
|
2186
2186
|
if (fallback.placeholder !== "none") {
|
|
2187
2187
|
el.classList.add("pptxv-placeholder", "pptxv-media-placeholder");
|
|
2188
|
-
el.setAttribute(
|
|
2188
|
+
el.setAttribute(chunkOCNECNJS_cjs.MEDIA_CHROME_ATTRIBUTE, fallback.placeholder);
|
|
2189
2189
|
if (icon.length > 0) {
|
|
2190
2190
|
el.appendChild(buildIcon(doc, icon));
|
|
2191
2191
|
}
|
|
@@ -2221,7 +2221,7 @@ var renderModel3dElement = (element, zIndex, context) => {
|
|
|
2221
2221
|
doc,
|
|
2222
2222
|
"div",
|
|
2223
2223
|
"pptxv-element pptxv-model3d",
|
|
2224
|
-
|
|
2224
|
+
chunkOCNECNJS_cjs.getContainerStyle(element, zIndex)
|
|
2225
2225
|
);
|
|
2226
2226
|
el.dataset.elementId = element.id;
|
|
2227
2227
|
const label = context.t("pptx.model3d.label");
|
|
@@ -2358,7 +2358,7 @@ function buildOleIcon(doc, type, color) {
|
|
|
2358
2358
|
fill: "none",
|
|
2359
2359
|
"aria-hidden": "true"
|
|
2360
2360
|
});
|
|
2361
|
-
for (const shape of
|
|
2361
|
+
for (const shape of chunkOCNECNJS_cjs.getOleIconShapes(type)) {
|
|
2362
2362
|
const node = createSvgEl(doc, shape.tag, shape.attrs);
|
|
2363
2363
|
if (shape.tag === "text") {
|
|
2364
2364
|
node.setAttribute("fill", color);
|
|
@@ -2377,21 +2377,21 @@ var renderOleElement = (element, zIndex, context) => {
|
|
|
2377
2377
|
return null;
|
|
2378
2378
|
}
|
|
2379
2379
|
const doc = context.document;
|
|
2380
|
-
const oleType =
|
|
2381
|
-
const typeColor =
|
|
2382
|
-
const typeLabel =
|
|
2383
|
-
const el = createEl(doc, "div", "pptxv-element pptxv-ole",
|
|
2380
|
+
const oleType = chunkOCNECNJS_cjs.resolveOleType(element);
|
|
2381
|
+
const typeColor = chunkOCNECNJS_cjs.getOleTypeColor(oleType);
|
|
2382
|
+
const typeLabel = chunkOCNECNJS_cjs.getOleTypeLabel(oleType);
|
|
2383
|
+
const el = createEl(doc, "div", "pptxv-element pptxv-ole", chunkOCNECNJS_cjs.getContainerStyle(element, zIndex));
|
|
2384
2384
|
el.dataset.elementId = element.id;
|
|
2385
2385
|
el.setAttribute("role", "group");
|
|
2386
|
-
el.setAttribute("aria-label",
|
|
2386
|
+
el.setAttribute("aria-label", chunkOCNECNJS_cjs.getOleAriaLabel(element));
|
|
2387
2387
|
el.title = infoLines(element, typeLabel).join("\n");
|
|
2388
2388
|
if (element.previewImageData) {
|
|
2389
|
-
el.appendChild(buildPreview(doc, element, typeColor,
|
|
2389
|
+
el.appendChild(buildPreview(doc, element, typeColor, chunkOCNECNJS_cjs.getOleBadgeLabel(oleType)));
|
|
2390
2390
|
} else {
|
|
2391
2391
|
el.appendChild(buildPlaceholder2(doc, element, oleType, typeColor, typeLabel));
|
|
2392
2392
|
}
|
|
2393
|
-
const showActions =
|
|
2394
|
-
|
|
2393
|
+
const showActions = chunkOCNECNJS_cjs.oleActionsVisible(
|
|
2394
|
+
chunkOCNECNJS_cjs.mediaSurfaceOf({
|
|
2395
2395
|
interactive: context.interactive === true,
|
|
2396
2396
|
presenting: context.presenting
|
|
2397
2397
|
})
|
|
@@ -2407,7 +2407,7 @@ function infoLines(el, typeLabel) {
|
|
|
2407
2407
|
if (name) {
|
|
2408
2408
|
lines.push(name);
|
|
2409
2409
|
}
|
|
2410
|
-
const size =
|
|
2410
|
+
const size = chunkOCNECNJS_cjs.formatBytes(el.oleEmbeddedByteSize);
|
|
2411
2411
|
if (size) {
|
|
2412
2412
|
lines.push(size);
|
|
2413
2413
|
}
|
|
@@ -2431,7 +2431,7 @@ function buildPreview(doc, el, typeColor, badgeLabel) {
|
|
|
2431
2431
|
display: "block"
|
|
2432
2432
|
});
|
|
2433
2433
|
img.src = el.previewImageData ?? "";
|
|
2434
|
-
img.alt =
|
|
2434
|
+
img.alt = chunkOCNECNJS_cjs.getOleAriaLabel(el);
|
|
2435
2435
|
img.draggable = false;
|
|
2436
2436
|
preview.appendChild(img);
|
|
2437
2437
|
const badge = createSvgEl(doc, "svg", { width: 24, height: 24, viewBox: "0 0 24 24" });
|
|
@@ -2458,7 +2458,7 @@ function buildPreview(doc, el, typeColor, badgeLabel) {
|
|
|
2458
2458
|
}
|
|
2459
2459
|
function buildPlaceholder2(doc, el, oleType, typeColor, typeLabel) {
|
|
2460
2460
|
const box = createEl(doc, "div", "pptxv-ole-placeholder", {
|
|
2461
|
-
...
|
|
2461
|
+
...chunkOCNECNJS_cjs.getPlaceholderStyle(oleType),
|
|
2462
2462
|
width: "100%",
|
|
2463
2463
|
height: "100%",
|
|
2464
2464
|
display: "flex",
|
|
@@ -2479,7 +2479,7 @@ function buildPlaceholder2(doc, el, oleType, typeColor, typeLabel) {
|
|
|
2479
2479
|
whiteSpace: "nowrap",
|
|
2480
2480
|
color: typeColor
|
|
2481
2481
|
});
|
|
2482
|
-
name.textContent =
|
|
2482
|
+
name.textContent = chunkOCNECNJS_cjs.getOleDisplayName(el);
|
|
2483
2483
|
box.appendChild(name);
|
|
2484
2484
|
if (el.fileName) {
|
|
2485
2485
|
const sublabel = createEl(doc, "span", "pptxv-ole-sublabel", {
|
|
@@ -2531,7 +2531,7 @@ function buildActionBar(doc, el, typeLabel, context) {
|
|
|
2531
2531
|
for (const type of ["pointerdown", "mousedown", "click"]) {
|
|
2532
2532
|
bar.addEventListener(type, (event) => event.stopPropagation());
|
|
2533
2533
|
}
|
|
2534
|
-
const size =
|
|
2534
|
+
const size = chunkOCNECNJS_cjs.formatBytes(el.oleEmbeddedByteSize);
|
|
2535
2535
|
if (size) {
|
|
2536
2536
|
const meta = createEl(doc, "span", "pptxv-ole-meta", {
|
|
2537
2537
|
marginRight: "auto",
|
|
@@ -2551,14 +2551,14 @@ function buildActionBar(doc, el, typeLabel, context) {
|
|
|
2551
2551
|
download.title = downloadTitle;
|
|
2552
2552
|
download.textContent = context.t("pptx.ole.download");
|
|
2553
2553
|
bar.appendChild(download);
|
|
2554
|
-
if (
|
|
2554
|
+
if (chunkOCNECNJS_cjs.isBrowserOpenableMime(el.oleEmbeddedMimeType)) {
|
|
2555
2555
|
const open = createEl(doc, "button", "pptxv-ole-action", ACTION_STYLE);
|
|
2556
2556
|
open.type = "button";
|
|
2557
2557
|
const openTitle = context.t("pptx.ole.openName", { name: downloadName });
|
|
2558
2558
|
open.setAttribute("aria-label", openTitle);
|
|
2559
2559
|
open.title = openTitle;
|
|
2560
2560
|
open.textContent = context.t("pptx.ole.open");
|
|
2561
|
-
open.addEventListener("click", () =>
|
|
2561
|
+
open.addEventListener("click", () => chunkOCNECNJS_cjs.openUrlInNewTab(data));
|
|
2562
2562
|
bar.appendChild(open);
|
|
2563
2563
|
}
|
|
2564
2564
|
return bar;
|
|
@@ -2570,12 +2570,12 @@ var renderPlaceholderElement = (element, zIndex, context) => {
|
|
|
2570
2570
|
context.document,
|
|
2571
2571
|
"div",
|
|
2572
2572
|
"pptxv-element pptxv-placeholder",
|
|
2573
|
-
|
|
2573
|
+
chunkOCNECNJS_cjs.getContainerStyle(element, zIndex)
|
|
2574
2574
|
);
|
|
2575
2575
|
el.dataset.elementId = element.id;
|
|
2576
2576
|
el.dataset.elementType = element.type;
|
|
2577
2577
|
const label = createEl(context.document, "div", "pptxv-placeholder-label");
|
|
2578
|
-
label.textContent =
|
|
2578
|
+
label.textContent = chunkY7CDPPMZ_cjs.keyToLabel(element.type);
|
|
2579
2579
|
el.appendChild(label);
|
|
2580
2580
|
return el;
|
|
2581
2581
|
};
|
|
@@ -2586,7 +2586,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2586
2586
|
return null;
|
|
2587
2587
|
}
|
|
2588
2588
|
const doc = context.document;
|
|
2589
|
-
const summaryView =
|
|
2589
|
+
const summaryView = chunkOCNECNJS_cjs.buildSummaryZoomView(
|
|
2590
2590
|
element,
|
|
2591
2591
|
(index) => {
|
|
2592
2592
|
const slide = context.slides?.[index];
|
|
@@ -2606,7 +2606,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2606
2606
|
doc,
|
|
2607
2607
|
"div",
|
|
2608
2608
|
"pptxv-element pptxv-zoom pptxv-summary-zoom",
|
|
2609
|
-
|
|
2609
|
+
chunkOCNECNJS_cjs.getContainerStyle(element, zIndex)
|
|
2610
2610
|
);
|
|
2611
2611
|
const content = createEl(doc, "div", "pptxv-summary-zoom-content", summaryView.containerStyle);
|
|
2612
2612
|
root.dataset.elementId = element.id;
|
|
@@ -2673,7 +2673,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2673
2673
|
const target = element.targetSlideIndex ?? 0;
|
|
2674
2674
|
const targetSlide = context.slides?.[target];
|
|
2675
2675
|
const interactive = context.presenting && context.onZoomClick !== void 0;
|
|
2676
|
-
const el = createEl(doc, "div", "pptxv-element pptxv-zoom",
|
|
2676
|
+
const el = createEl(doc, "div", "pptxv-element pptxv-zoom", chunkOCNECNJS_cjs.getContainerStyle(element, zIndex));
|
|
2677
2677
|
el.dataset.elementId = element.id;
|
|
2678
2678
|
el.dataset.zoomType = zoomType;
|
|
2679
2679
|
el.dataset.zoomTarget = String(target);
|
|
@@ -2683,7 +2683,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2683
2683
|
el.tabIndex = 0;
|
|
2684
2684
|
el.style.cursor = "pointer";
|
|
2685
2685
|
const activate = () => {
|
|
2686
|
-
const zoomTarget =
|
|
2686
|
+
const zoomTarget = chunkOCNECNJS_cjs.resolveZoomNavigationTarget(element);
|
|
2687
2687
|
if (zoomTarget) {
|
|
2688
2688
|
context.onZoomClick?.(zoomTarget, context.currentSlideIndex ?? 0);
|
|
2689
2689
|
}
|
|
@@ -2798,7 +2798,7 @@ function registerExtraRenderers(registry) {
|
|
|
2798
2798
|
// src/pptx/dom/elements/smartart-3d.ts
|
|
2799
2799
|
var renderSmartArt3DElement = (element, zIndex, context) => {
|
|
2800
2800
|
const wrapper = renderSmartArtSvg(element, zIndex, context);
|
|
2801
|
-
const spec = wrapper ?
|
|
2801
|
+
const spec = wrapper ? chunkOCNECNJS_cjs.resolveSmartArtThreeViewSpec(element, context.smartArt3D) : null;
|
|
2802
2802
|
if (!wrapper || !spec) {
|
|
2803
2803
|
return wrapper;
|
|
2804
2804
|
}
|
|
@@ -2808,18 +2808,18 @@ var renderSmartArt3DElement = (element, zIndex, context) => {
|
|
|
2808
2808
|
textStyle: context.presentationStates?.get(element.id)?.textStyle
|
|
2809
2809
|
});
|
|
2810
2810
|
if (context.onSmartArtNodeTextChange && context.interactive && !context.presenting) {
|
|
2811
|
-
const layer = renderSmartArtSvg(
|
|
2811
|
+
const layer = renderSmartArtSvg(chunkOCNECNJS_cjs.elementInLocalFrame(element), 0, context);
|
|
2812
2812
|
if (layer) {
|
|
2813
2813
|
layer.classList.add("pptxv-smartart-3d-edit-layer");
|
|
2814
2814
|
layer.setAttribute("data-smartart-3d-edit-layer", "true");
|
|
2815
|
-
|
|
2815
|
+
chunkOCNECNJS_cjs.stripEditLayerMarkers(layer);
|
|
2816
2816
|
layer.setAttribute("aria-hidden", "true");
|
|
2817
2817
|
Object.assign(layer.style, { position: "absolute", inset: "0", zIndex: "1" });
|
|
2818
2818
|
for (const svg of layer.querySelectorAll("svg")) {
|
|
2819
2819
|
svg.style.opacity = "0";
|
|
2820
2820
|
}
|
|
2821
2821
|
wrapper.appendChild(layer);
|
|
2822
|
-
|
|
2822
|
+
chunkOCNECNJS_cjs.routeEditLayerPointerToNodes(layer);
|
|
2823
2823
|
}
|
|
2824
2824
|
}
|
|
2825
2825
|
return wrapper;
|
|
@@ -2832,7 +2832,7 @@ function nodeTarget(target) {
|
|
|
2832
2832
|
}
|
|
2833
2833
|
function enableSmartArtEditing(chrome, element, context) {
|
|
2834
2834
|
const data = element.smartArtData;
|
|
2835
|
-
if (!data || !context.onSmartArtNodeTextChange && !context.onSmartArtNodeFillChange || !
|
|
2835
|
+
if (!data || !context.onSmartArtNodeTextChange && !context.onSmartArtNodeFillChange || !chunkOCNECNJS_cjs.canDrillDown(element)) {
|
|
2836
2836
|
return;
|
|
2837
2837
|
}
|
|
2838
2838
|
let editor = null;
|
|
@@ -2854,8 +2854,8 @@ function enableSmartArtEditing(chrome, element, context) {
|
|
|
2854
2854
|
}
|
|
2855
2855
|
event.stopPropagation();
|
|
2856
2856
|
const textNode = target.querySelector("text");
|
|
2857
|
-
const textRect = textNode ?
|
|
2858
|
-
const rect = textRect && textRect.width > 0 ? textRect :
|
|
2857
|
+
const textRect = textNode ? chunkOCNECNJS_cjs.measureSvgViewportRect(textNode) : null;
|
|
2858
|
+
const rect = textRect && textRect.width > 0 ? textRect : chunkOCNECNJS_cjs.measureSvgViewportRect(target);
|
|
2859
2859
|
if (!rect) {
|
|
2860
2860
|
return;
|
|
2861
2861
|
}
|
|
@@ -2879,7 +2879,7 @@ function enableSmartArtEditing(chrome, element, context) {
|
|
|
2879
2879
|
textAlign: "center"
|
|
2880
2880
|
});
|
|
2881
2881
|
editor = input;
|
|
2882
|
-
input.value =
|
|
2882
|
+
input.value = chunkOCNECNJS_cjs.findSmartArtNodeText(data, nodeId) ?? "";
|
|
2883
2883
|
const commit = () => {
|
|
2884
2884
|
if (input !== editor) {
|
|
2885
2885
|
return;
|
|
@@ -2911,7 +2911,7 @@ function enableSmartArtEditing(chrome, element, context) {
|
|
|
2911
2911
|
}
|
|
2912
2912
|
cancelHide();
|
|
2913
2913
|
swatches?.remove();
|
|
2914
|
-
const rect =
|
|
2914
|
+
const rect = chunkOCNECNJS_cjs.measureSvgViewportRect(target);
|
|
2915
2915
|
if (!rect) {
|
|
2916
2916
|
return;
|
|
2917
2917
|
}
|
|
@@ -2930,7 +2930,7 @@ function enableSmartArtEditing(chrome, element, context) {
|
|
|
2930
2930
|
});
|
|
2931
2931
|
swatches.setAttribute("role", "group");
|
|
2932
2932
|
swatches.setAttribute("aria-label", context.t("pptx.smartArt.fillColor"));
|
|
2933
|
-
for (const color of
|
|
2933
|
+
for (const color of chunkOCNECNJS_cjs.resolvePalette(data).slice(0, 6)) {
|
|
2934
2934
|
const button = createEl(chrome.ownerDocument, "button", "", {
|
|
2935
2935
|
width: "18px",
|
|
2936
2936
|
height: "18px",
|
|
@@ -3029,7 +3029,7 @@ function buildSmartArtFallbackSvg(doc, layout, a11yNodes = [], nodeIds = []) {
|
|
|
3029
3029
|
svg.setAttribute("class", "pptxv-smartart-svg");
|
|
3030
3030
|
svg.setAttribute("style", SMARTART_SVG_STYLE);
|
|
3031
3031
|
for (const conn of layout.connectors) {
|
|
3032
|
-
const paint =
|
|
3032
|
+
const paint = chunkOCNECNJS_cjs.smartArtConnectorPaint(conn);
|
|
3033
3033
|
svg.appendChild(
|
|
3034
3034
|
createSvgEl(doc, "path", {
|
|
3035
3035
|
d: paint.d,
|
|
@@ -3088,7 +3088,7 @@ function buildFallbackNode(doc, node, shadowFilter, a11yLabel, nodeId) {
|
|
|
3088
3088
|
})
|
|
3089
3089
|
);
|
|
3090
3090
|
}
|
|
3091
|
-
const label =
|
|
3091
|
+
const label = chunkOCNECNJS_cjs.smartArtNodeLabel(node);
|
|
3092
3092
|
if (label.visible) {
|
|
3093
3093
|
appendSvgTextLines(doc, g, {
|
|
3094
3094
|
lines: label.lines,
|
|
@@ -3124,41 +3124,41 @@ var renderSmartArtSvg = (element, zIndex, context) => {
|
|
|
3124
3124
|
doc,
|
|
3125
3125
|
"div",
|
|
3126
3126
|
"pptxv-element pptxv-smartart",
|
|
3127
|
-
|
|
3127
|
+
chunkOCNECNJS_cjs.getContainerStyle(element, zIndex)
|
|
3128
3128
|
);
|
|
3129
3129
|
wrapper.dataset.elementId = element.id;
|
|
3130
3130
|
wrapper.dataset.testid = `smartart-${data?.layout ?? "diagram"}`;
|
|
3131
|
-
const chrome = createEl(doc, "div", "pptxv-smartart-chrome",
|
|
3131
|
+
const chrome = createEl(doc, "div", "pptxv-smartart-chrome", chunkOCNECNJS_cjs.buildChromeStyle(data?.chrome));
|
|
3132
3132
|
chrome.style.position = "relative";
|
|
3133
3133
|
wrapper.appendChild(chrome);
|
|
3134
3134
|
if (data) {
|
|
3135
|
-
const a11y =
|
|
3135
|
+
const a11y = chunkOCNECNJS_cjs.buildSmartArtA11y(data);
|
|
3136
3136
|
chrome.setAttribute("role", "img");
|
|
3137
3137
|
chrome.setAttribute("aria-label", a11y.label);
|
|
3138
3138
|
}
|
|
3139
3139
|
const nodes = data?.nodes ?? [];
|
|
3140
3140
|
const drawingShapes = data?.drawingShapes ?? [];
|
|
3141
3141
|
const animationState = context.presentationStates?.get(element.id);
|
|
3142
|
-
const { nodes: revealedNodesFull } =
|
|
3142
|
+
const { nodes: revealedNodesFull } = chunkOCNECNJS_cjs.resolveRevealedSmartArtNodes(
|
|
3143
3143
|
nodes,
|
|
3144
3144
|
animationState,
|
|
3145
3145
|
data?.presLayoutVars
|
|
3146
3146
|
);
|
|
3147
3147
|
if (data && drawingShapes.length > 0) {
|
|
3148
|
-
const revealedShapes =
|
|
3148
|
+
const revealedShapes = chunkOCNECNJS_cjs.resolveRevealedDrawingShapes(drawingShapes, nodes, animationState);
|
|
3149
3149
|
chrome.appendChild(
|
|
3150
|
-
buildDrawingShapesSvg(doc, element.id, data,
|
|
3150
|
+
buildDrawingShapesSvg(doc, element.id, data, chunkOCNECNJS_cjs.buildSmartArtA11y(data).nodes, revealedShapes)
|
|
3151
3151
|
);
|
|
3152
3152
|
enableSmartArtEditing(chrome, element, context);
|
|
3153
3153
|
return wrapper;
|
|
3154
3154
|
}
|
|
3155
3155
|
if (data && nodes.length > 0) {
|
|
3156
3156
|
const revealedNodes = revealedNodesFull;
|
|
3157
|
-
const layout =
|
|
3157
|
+
const layout = chunkOCNECNJS_cjs.computeSmartArtElementLayout(
|
|
3158
3158
|
data,
|
|
3159
3159
|
revealedNodes,
|
|
3160
3160
|
{ width: element.width, height: element.height },
|
|
3161
|
-
|
|
3161
|
+
chunkOCNECNJS_cjs.resolvePalette(data),
|
|
3162
3162
|
data.style ?? "flat",
|
|
3163
3163
|
element.id
|
|
3164
3164
|
);
|
|
@@ -3166,8 +3166,8 @@ var renderSmartArtSvg = (element, zIndex, context) => {
|
|
|
3166
3166
|
buildSmartArtFallbackSvg(
|
|
3167
3167
|
doc,
|
|
3168
3168
|
layout,
|
|
3169
|
-
|
|
3170
|
-
|
|
3169
|
+
chunkOCNECNJS_cjs.buildSmartArtA11y(data).nodes,
|
|
3170
|
+
chunkOCNECNJS_cjs.flattenNodes(revealedNodes).map((node) => node.id)
|
|
3171
3171
|
)
|
|
3172
3172
|
);
|
|
3173
3173
|
enableSmartArtEditing(chrome, element, context);
|
|
@@ -3190,17 +3190,17 @@ var renderSmartArtSvg = (element, zIndex, context) => {
|
|
|
3190
3190
|
function buildDrawingShapesSvg(doc, elementId, data, a11yNodes, revealedShapes) {
|
|
3191
3191
|
const allShapes = data.drawingShapes ?? [];
|
|
3192
3192
|
const style = data.style ?? "flat";
|
|
3193
|
-
const viewBox =
|
|
3194
|
-
const rendered =
|
|
3193
|
+
const viewBox = chunkOCNECNJS_cjs.computeDrawingViewBox(allShapes);
|
|
3194
|
+
const rendered = chunkOCNECNJS_cjs.projectDrawingShapes(
|
|
3195
3195
|
elementId,
|
|
3196
3196
|
revealedShapes,
|
|
3197
3197
|
viewBox,
|
|
3198
|
-
|
|
3198
|
+
chunkOCNECNJS_cjs.resolvePalette(data),
|
|
3199
3199
|
style
|
|
3200
3200
|
);
|
|
3201
|
-
const shadow =
|
|
3201
|
+
const shadow = chunkOCNECNJS_cjs.styleShadowFilter(style);
|
|
3202
3202
|
const labelsById = new Map(a11yNodes.map((node) => [node.id, node.label]));
|
|
3203
|
-
const nodeIds =
|
|
3203
|
+
const nodeIds = chunkOCNECNJS_cjs.resolveRevealedDrawingShapeNodeIds(allShapes, revealedShapes, data.nodes);
|
|
3204
3204
|
const svg = createSvgEl(doc, "svg", {
|
|
3205
3205
|
viewBox: `0 0 ${viewBox.width} ${viewBox.height}`,
|
|
3206
3206
|
preserveAspectRatio: "xMidYMid meet"
|
|
@@ -3335,9 +3335,9 @@ function enableTableResize(container, table, element, context) {
|
|
|
3335
3335
|
for (const handle of [...colHandles, ...rowHandles]) {
|
|
3336
3336
|
handle.remove();
|
|
3337
3337
|
}
|
|
3338
|
-
const crossings =
|
|
3338
|
+
const crossings = chunkOCNECNJS_cjs.computeTableMergeCrossings(tableData.rows, tableData.columnWidths.length);
|
|
3339
3339
|
const rowBounds = measureRowBoundaries(table);
|
|
3340
|
-
colHandles =
|
|
3340
|
+
colHandles = chunkOCNECNJS_cjs.computeColumnBoundaries(tableData.columnWidths).map((leftPct, i) => {
|
|
3341
3341
|
const handle = createEl(doc, "div", "pptxv-table-resize-col", {
|
|
3342
3342
|
position: "absolute",
|
|
3343
3343
|
top: "0",
|
|
@@ -3347,7 +3347,7 @@ function enableTableResize(container, table, element, context) {
|
|
|
3347
3347
|
zIndex: "10",
|
|
3348
3348
|
pointerEvents: "none"
|
|
3349
3349
|
});
|
|
3350
|
-
const segments =
|
|
3350
|
+
const segments = chunkOCNECNJS_cjs.columnHandleSegments(
|
|
3351
3351
|
crossings.columns[i] ?? [],
|
|
3352
3352
|
rowBounds,
|
|
3353
3353
|
table.offsetHeight
|
|
@@ -3377,7 +3377,7 @@ function enableTableResize(container, table, element, context) {
|
|
|
3377
3377
|
zIndex: "10",
|
|
3378
3378
|
pointerEvents: "none"
|
|
3379
3379
|
});
|
|
3380
|
-
const segments =
|
|
3380
|
+
const segments = chunkOCNECNJS_cjs.rowHandleSegments(crossings.rows[i] ?? [], tableData.columnWidths);
|
|
3381
3381
|
for (const { leftPct, widthPct } of segments) {
|
|
3382
3382
|
handle.appendChild(
|
|
3383
3383
|
createEl(doc, "div", "pptxv-table-resize-segment", {
|
|
@@ -3421,14 +3421,14 @@ function enableTableResize(container, table, element, context) {
|
|
|
3421
3421
|
const deltaProp = (event.clientX - active.startPos) / (rect.width || 1);
|
|
3422
3422
|
context.onTableResizeColumns?.(
|
|
3423
3423
|
element,
|
|
3424
|
-
|
|
3424
|
+
chunkOCNECNJS_cjs.computeResizedColumnWidths(active.initialWidths, active.index, deltaProp)
|
|
3425
3425
|
);
|
|
3426
3426
|
} else if (event.clientY !== active.startPos && active.type === "row") {
|
|
3427
3427
|
const deltaY = event.clientY - active.startPos;
|
|
3428
3428
|
context.onTableResizeRow?.(
|
|
3429
3429
|
element,
|
|
3430
3430
|
active.index,
|
|
3431
|
-
|
|
3431
|
+
chunkOCNECNJS_cjs.computeResizedRowHeight(active.initialRowHeight ?? chunkOCNECNJS_cjs.DEFAULT_ROW_HEIGHT, deltaY)
|
|
3432
3432
|
);
|
|
3433
3433
|
}
|
|
3434
3434
|
drawHandles();
|
|
@@ -3437,13 +3437,13 @@ function enableTableResize(container, table, element, context) {
|
|
|
3437
3437
|
const rect = container.getBoundingClientRect();
|
|
3438
3438
|
const localX = event.clientX - rect.left;
|
|
3439
3439
|
const localY = event.clientY - rect.top;
|
|
3440
|
-
const scaleY =
|
|
3441
|
-
const crossings =
|
|
3440
|
+
const scaleY = chunkOCNECNJS_cjs.getTableResizeScale(rect.height, container.offsetHeight);
|
|
3441
|
+
const crossings = chunkOCNECNJS_cjs.computeTableMergeCrossings(tableData.rows, tableData.columnWidths.length);
|
|
3442
3442
|
const rowBounds = measureRowBoundaries(table);
|
|
3443
|
-
const colBoundaries =
|
|
3443
|
+
const colBoundaries = chunkOCNECNJS_cjs.computeColumnBoundaries(tableData.columnWidths);
|
|
3444
3444
|
for (let i = 0; i < colBoundaries.length; i++) {
|
|
3445
3445
|
const boundaryX = colBoundaries[i] / 100 * rect.width;
|
|
3446
|
-
if (Math.abs(localX - boundaryX) <= HANDLE_ZONE && !
|
|
3446
|
+
if (Math.abs(localX - boundaryX) <= HANDLE_ZONE && !chunkOCNECNJS_cjs.isColumnBoundaryMergedAt(crossings, i, rowBounds, localY / scaleY)) {
|
|
3447
3447
|
event.preventDefault();
|
|
3448
3448
|
event.stopPropagation();
|
|
3449
3449
|
doc.body.style.cursor = "col-resize";
|
|
@@ -3461,7 +3461,7 @@ function enableTableResize(container, table, element, context) {
|
|
|
3461
3461
|
}
|
|
3462
3462
|
}
|
|
3463
3463
|
for (let i = 0; i < rowBounds.length; i++) {
|
|
3464
|
-
if (Math.abs(localY - rowBounds[i] * scaleY) <= HANDLE_ZONE && !
|
|
3464
|
+
if (Math.abs(localY - rowBounds[i] * scaleY) <= HANDLE_ZONE && !chunkOCNECNJS_cjs.isRowBoundaryMergedAt(crossings, i, tableData.columnWidths, localX / (rect.width || 1))) {
|
|
3465
3465
|
event.preventDefault();
|
|
3466
3466
|
event.stopPropagation();
|
|
3467
3467
|
const tr = table.querySelectorAll("tbody > tr")[i];
|
|
@@ -3472,7 +3472,7 @@ function enableTableResize(container, table, element, context) {
|
|
|
3472
3472
|
index: i,
|
|
3473
3473
|
startPos: event.clientY,
|
|
3474
3474
|
handleEl: rowHandles[i] ?? container,
|
|
3475
|
-
initialRowHeight: tr?.offsetHeight ??
|
|
3475
|
+
initialRowHeight: tr?.offsetHeight ?? chunkOCNECNJS_cjs.DEFAULT_ROW_HEIGHT
|
|
3476
3476
|
};
|
|
3477
3477
|
win.addEventListener("mousemove", onMouseMove);
|
|
3478
3478
|
win.addEventListener("mouseup", onMouseUp);
|
|
@@ -3493,7 +3493,7 @@ var renderTableElement = (element, zIndex, context) => {
|
|
|
3493
3493
|
}
|
|
3494
3494
|
const doc = context.document;
|
|
3495
3495
|
const container = createEl(doc, "div", "pptxv-element pptxv-table", {
|
|
3496
|
-
...
|
|
3496
|
+
...chunkOCNECNJS_cjs.getContainerStyle(element, zIndex),
|
|
3497
3497
|
overflow: "hidden"
|
|
3498
3498
|
});
|
|
3499
3499
|
container.dataset.elementId = element.id;
|
|
@@ -3506,7 +3506,7 @@ var renderTableElement = (element, zIndex, context) => {
|
|
|
3506
3506
|
// font stack; all five bindings declare the same shared default here.
|
|
3507
3507
|
fontFamily: chunkVFPVEVF4_cjs.DEFAULT_FONT_FAMILY,
|
|
3508
3508
|
// `a:tblPr@rtl`: mirrors the column order for right-to-left decks.
|
|
3509
|
-
...
|
|
3509
|
+
...chunkOCNECNJS_cjs.tableContainerCss(tableData)
|
|
3510
3510
|
});
|
|
3511
3511
|
appendColgroup(doc, table, tableData.columnWidths);
|
|
3512
3512
|
const tbody = doc.createElement("tbody");
|
|
@@ -3567,13 +3567,13 @@ function renderCell(doc, tableData, cell, rowIndex, cellIndex, rowCount, columnC
|
|
|
3567
3567
|
if (cell.rowSpan && cell.rowSpan > 1) {
|
|
3568
3568
|
td.rowSpan = cell.rowSpan;
|
|
3569
3569
|
}
|
|
3570
|
-
const style =
|
|
3570
|
+
const style = chunkOCNECNJS_cjs.tableCellCss(
|
|
3571
3571
|
tableData,
|
|
3572
3572
|
cell,
|
|
3573
3573
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
3574
3574
|
styleContext
|
|
3575
3575
|
);
|
|
3576
|
-
const patternFill = cell.style ?
|
|
3576
|
+
const patternFill = cell.style ? chunkOCNECNJS_cjs.cellPatternFillCss(cell.style) : null;
|
|
3577
3577
|
if (patternFill) {
|
|
3578
3578
|
delete style["backgroundColor"];
|
|
3579
3579
|
delete style["background"];
|
|
@@ -3586,7 +3586,7 @@ function renderCell(doc, tableData, cell, rowIndex, cellIndex, rowCount, columnC
|
|
|
3586
3586
|
}
|
|
3587
3587
|
applyStyleMap(td, CELL_BASE_STYLE);
|
|
3588
3588
|
applyStyleMap(td, style);
|
|
3589
|
-
const diagonals =
|
|
3589
|
+
const diagonals = chunkOCNECNJS_cjs.getCellDiagonalBorders(
|
|
3590
3590
|
cell.style,
|
|
3591
3591
|
tableData,
|
|
3592
3592
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3630,7 +3630,7 @@ function renderDiagonalOverlay(doc, diagonals) {
|
|
|
3630
3630
|
return svg;
|
|
3631
3631
|
}
|
|
3632
3632
|
function appendCellText(doc, td, cell) {
|
|
3633
|
-
const blocks =
|
|
3633
|
+
const blocks = chunkOCNECNJS_cjs.cellParagraphBlocks(cell);
|
|
3634
3634
|
if (blocks) {
|
|
3635
3635
|
for (const block of blocks) {
|
|
3636
3636
|
const div = createEl(doc, "div", "pptxv-table-para", { display: "block", ...block.css });
|
|
@@ -3665,7 +3665,7 @@ function appendRuns(doc, parent, runs) {
|
|
|
3665
3665
|
}
|
|
3666
3666
|
const span = createEl(doc, "span", "pptxv-table-run", {
|
|
3667
3667
|
position: "relative",
|
|
3668
|
-
...
|
|
3668
|
+
...chunkOCNECNJS_cjs.cellRunStyle(run)
|
|
3669
3669
|
});
|
|
3670
3670
|
span.textContent = run.text;
|
|
3671
3671
|
parent.appendChild(span);
|
|
@@ -3679,8 +3679,8 @@ function registerTableChartRenderers(registry) {
|
|
|
3679
3679
|
}
|
|
3680
3680
|
|
|
3681
3681
|
// src/pptx/dom/glyph-outline-cache.ts
|
|
3682
|
-
var glyphOutlineFontCache = new
|
|
3683
|
-
var getGlyphOutline =
|
|
3682
|
+
var glyphOutlineFontCache = new chunkOCNECNJS_cjs.GlyphOutlineFontCache();
|
|
3683
|
+
var getGlyphOutline = chunkOCNECNJS_cjs.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
3684
3684
|
|
|
3685
3685
|
// src/pptx/dom/elements/text-warp.ts
|
|
3686
3686
|
function renderWarpedText(element, context) {
|
|
@@ -3692,12 +3692,12 @@ function renderWarpedText(element, context) {
|
|
|
3692
3692
|
if (!preset || preset === "textNoShape" || preset === "textPlain") {
|
|
3693
3693
|
return null;
|
|
3694
3694
|
}
|
|
3695
|
-
const paragraphs =
|
|
3695
|
+
const paragraphs = chunkOCNECNJS_cjs.groupIntoParagraphs(element);
|
|
3696
3696
|
if (paragraphs.length === 0) {
|
|
3697
3697
|
return null;
|
|
3698
3698
|
}
|
|
3699
|
-
if (!
|
|
3700
|
-
const transform =
|
|
3699
|
+
if (!chunkOCNECNJS_cjs.shouldUseSvgWarp(preset)) {
|
|
3700
|
+
const transform = chunkOCNECNJS_cjs.getWarpCssTransform(preset, style?.textWarpAdj, style?.textWarpAdj2);
|
|
3701
3701
|
if (!transform) {
|
|
3702
3702
|
return null;
|
|
3703
3703
|
}
|
|
@@ -3725,7 +3725,7 @@ function renderWarpedText(element, context) {
|
|
|
3725
3725
|
text.textContent = paragraphs.map((p) => p.segments.map((s) => s.text).join("")).join("\n");
|
|
3726
3726
|
return text;
|
|
3727
3727
|
}
|
|
3728
|
-
if (
|
|
3728
|
+
if (chunkOCNECNJS_cjs.hasGlyphEnvelope(preset)) {
|
|
3729
3729
|
return renderGlyphWarp(element, paragraphs, context);
|
|
3730
3730
|
}
|
|
3731
3731
|
return renderPathWarp(element, paragraphs, context);
|
|
@@ -3751,7 +3751,7 @@ function renderGlyphWarp(element, paragraphs, context) {
|
|
|
3751
3751
|
});
|
|
3752
3752
|
svg.setAttribute("class", "pptxv-wordart");
|
|
3753
3753
|
svg.setAttribute("style", "position:absolute;inset:0;width:100%;height:100%;overflow:visible");
|
|
3754
|
-
const perLine =
|
|
3754
|
+
const perLine = chunkOCNECNJS_cjs.buildGlyphEnvelopeBlock(
|
|
3755
3755
|
preset,
|
|
3756
3756
|
paragraphs.map(
|
|
3757
3757
|
(paragraph) => paragraph.segments.map((seg, i) => ({
|
|
@@ -3846,7 +3846,7 @@ function renderPathWarp(element, paragraphs, context) {
|
|
|
3846
3846
|
defs.appendChild(
|
|
3847
3847
|
createSvgEl(context.document, "path", {
|
|
3848
3848
|
id,
|
|
3849
|
-
d:
|
|
3849
|
+
d: chunkOCNECNJS_cjs.buildWarpPath(
|
|
3850
3850
|
preset,
|
|
3851
3851
|
element.width,
|
|
3852
3852
|
element.height,
|
|
@@ -3879,22 +3879,31 @@ function renderPathWarp(element, paragraphs, context) {
|
|
|
3879
3879
|
|
|
3880
3880
|
// src/pptx/dom/elements/text-shape.ts
|
|
3881
3881
|
var renderTextShapeElement = (element, zIndex, context) => {
|
|
3882
|
-
const container =
|
|
3882
|
+
const container = chunkOCNECNJS_cjs.getContainerStyle(element, zIndex);
|
|
3883
3883
|
const animState = context.presentationStates?.get(element.id);
|
|
3884
|
+
const background = chunkOCNECNJS_cjs.getBackgroundAnimationState(element, context.presentationStates);
|
|
3885
|
+
const visualState = background ?? animState;
|
|
3884
3886
|
const shape = getShapeFillStrokeStyle(
|
|
3885
3887
|
element,
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
+
visualState?.animatesFill,
|
|
3889
|
+
visualState?.animatesStroke
|
|
3888
3890
|
);
|
|
3889
3891
|
const merged = { ...container, ...shape };
|
|
3890
3892
|
const transform = composeTransforms(container["transform"], shape["transform"]);
|
|
3891
3893
|
if (transform !== void 0) {
|
|
3892
3894
|
merged["transform"] = transform;
|
|
3893
3895
|
}
|
|
3894
|
-
const
|
|
3896
|
+
const layers = chunkOCNECNJS_cjs.getBackgroundAnimationLayers(element, merged, background);
|
|
3897
|
+
const el = createEl(context.document, "div", "pptxv-element pptxv-shape", layers.box);
|
|
3895
3898
|
el.dataset.elementId = element.id;
|
|
3899
|
+
const paint = layers.paint ? createEl(context.document, "div", void 0, layers.paint) : el;
|
|
3900
|
+
if (paint !== el) {
|
|
3901
|
+
paint.dataset.animId = layers.targetId;
|
|
3902
|
+
paint.dataset.pptxAnimationLayer = "background";
|
|
3903
|
+
el.appendChild(paint);
|
|
3904
|
+
}
|
|
3896
3905
|
if (context.interactive && !context.presenting) {
|
|
3897
|
-
const hitTargetStyle =
|
|
3906
|
+
const hitTargetStyle = chunkOCNECNJS_cjs.elementHitTargetStyle(element);
|
|
3898
3907
|
if (hitTargetStyle) {
|
|
3899
3908
|
const hitTarget = createEl(context.document, "div", void 0, hitTargetStyle);
|
|
3900
3909
|
hitTarget.setAttribute("aria-hidden", "true");
|
|
@@ -3904,31 +3913,31 @@ var renderTextShapeElement = (element, zIndex, context) => {
|
|
|
3904
3913
|
}
|
|
3905
3914
|
const subpathFill = renderShapeSubpathFillOverlay(context.document, element);
|
|
3906
3915
|
if (subpathFill) {
|
|
3907
|
-
|
|
3916
|
+
paint.appendChild(subpathFill);
|
|
3908
3917
|
}
|
|
3909
3918
|
const extrusion = renderExtrusionOverlay(context.document, element);
|
|
3910
3919
|
if (extrusion) {
|
|
3911
|
-
|
|
3920
|
+
paint.appendChild(extrusion);
|
|
3912
3921
|
}
|
|
3913
3922
|
const filterDefs = renderShapeFilterDefs(context.document, element);
|
|
3914
3923
|
if (filterDefs) {
|
|
3915
|
-
|
|
3924
|
+
paint.appendChild(filterDefs);
|
|
3916
3925
|
}
|
|
3917
3926
|
const fillOverlay = renderShapeFillOverlay(context.document, element);
|
|
3918
3927
|
if (fillOverlay) {
|
|
3919
|
-
|
|
3928
|
+
paint.appendChild(fillOverlay);
|
|
3920
3929
|
}
|
|
3921
3930
|
const gradientOutline = renderStrokeOutline(context.document, element);
|
|
3922
3931
|
if (gradientOutline) {
|
|
3923
|
-
|
|
3932
|
+
paint.appendChild(gradientOutline);
|
|
3924
3933
|
}
|
|
3925
3934
|
const hollowHit = renderHollowHitOutline(context.document, element);
|
|
3926
3935
|
if (hollowHit) {
|
|
3927
|
-
|
|
3936
|
+
paint.appendChild(hollowHit);
|
|
3928
3937
|
}
|
|
3929
3938
|
const reflection = renderReflectionOverlay(context.document, element, context.mediaDataUrls);
|
|
3930
3939
|
if (reflection) {
|
|
3931
|
-
|
|
3940
|
+
paint.appendChild(reflection);
|
|
3932
3941
|
}
|
|
3933
3942
|
const equation = renderEquations(element, context);
|
|
3934
3943
|
const warped = equation ? null : renderWarpedText(element, context);
|
|
@@ -3937,8 +3946,8 @@ var renderTextShapeElement = (element, zIndex, context) => {
|
|
|
3937
3946
|
} else if (warped) {
|
|
3938
3947
|
el.appendChild(warped);
|
|
3939
3948
|
} else {
|
|
3940
|
-
const linkedSegments =
|
|
3941
|
-
const paragraphs =
|
|
3949
|
+
const linkedSegments = chunkOCNECNJS_cjs.getOverflowSegments(element, context.slide?.elements);
|
|
3950
|
+
const paragraphs = chunkOCNECNJS_cjs.buildParagraphs(element, context.fieldContext, linkedSegments);
|
|
3942
3951
|
const hasText = paragraphs.some((p) => p.runs.length > 0 || p.bulletMarker !== void 0);
|
|
3943
3952
|
if (hasText) {
|
|
3944
3953
|
el.appendChild(
|
|
@@ -3949,7 +3958,7 @@ var renderTextShapeElement = (element, zIndex, context) => {
|
|
|
3949
3958
|
);
|
|
3950
3959
|
} else {
|
|
3951
3960
|
const mode = context.interactive && !context.presenting ? "edit" : "present";
|
|
3952
|
-
const prompt =
|
|
3961
|
+
const prompt = chunkOCNECNJS_cjs.placeholderPromptDescriptor(element, mode);
|
|
3953
3962
|
if (prompt) {
|
|
3954
3963
|
const hint = createEl(context.document, "div", "pptxv-placeholder-prompt", {
|
|
3955
3964
|
...getTextBlockStyle(element),
|
|
@@ -4002,6 +4011,7 @@ async function loadPresentation(buffer, options) {
|
|
|
4002
4011
|
presentationProperties: parsed.presentationProperties ?? {},
|
|
4003
4012
|
viewProperties: parsed.viewProperties,
|
|
4004
4013
|
headerFooter: parsed.headerFooter ?? {},
|
|
4014
|
+
firstSlideNumber: parsed.firstSlideNumber,
|
|
4005
4015
|
coreProperties: parsed.coreProperties,
|
|
4006
4016
|
appProperties: parsed.appProperties,
|
|
4007
4017
|
customProperties: parsed.customProperties ?? [],
|
|
@@ -4114,11 +4124,11 @@ async function resolveImageUrls(handler, slides) {
|
|
|
4114
4124
|
|
|
4115
4125
|
Object.defineProperty(exports, "buildEmbeddedFontStyles", {
|
|
4116
4126
|
enumerable: true,
|
|
4117
|
-
get: function () { return
|
|
4127
|
+
get: function () { return chunkOCNECNJS_cjs.buildEmbeddedFontStyles; }
|
|
4118
4128
|
});
|
|
4119
4129
|
Object.defineProperty(exports, "buildFieldSubstitutionContext", {
|
|
4120
4130
|
enumerable: true,
|
|
4121
|
-
get: function () { return
|
|
4131
|
+
get: function () { return chunkOCNECNJS_cjs.buildFieldSubstitutionContext; }
|
|
4122
4132
|
});
|
|
4123
4133
|
Object.defineProperty(exports, "renderChartViewModelSvg", {
|
|
4124
4134
|
enumerable: true,
|
|
@@ -4126,7 +4136,7 @@ Object.defineProperty(exports, "renderChartViewModelSvg", {
|
|
|
4126
4136
|
});
|
|
4127
4137
|
Object.defineProperty(exports, "createTranslator", {
|
|
4128
4138
|
enumerable: true,
|
|
4129
|
-
get: function () { return
|
|
4139
|
+
get: function () { return chunkY7CDPPMZ_cjs.createTranslator; }
|
|
4130
4140
|
});
|
|
4131
4141
|
exports.SMARTART_SVG_STYLE = SMARTART_SVG_STYLE;
|
|
4132
4142
|
exports.appendCommentMarkers = appendCommentMarkers;
|