ooxml-ui 1.44.0 → 1.45.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/README.md +4 -0
- package/dist/base.d.ts +1 -0
- package/dist/chart/format-pane-3d.d.ts +1 -0
- package/dist/chart/format-pane-advanced-intent.d.ts +1 -0
- package/dist/chart/format-pane-analysis.d.ts +1 -0
- package/dist/chart/format-pane-axis.d.ts +1 -0
- package/dist/chart/format-pane-common.d.ts +1 -0
- package/dist/chart/format-pane-effects.d.ts +1 -0
- package/dist/chart/format-pane-fields.d.ts +1 -0
- package/dist/chart/format-pane-fill-kinds.d.ts +1 -0
- package/dist/chart/format-pane-fill-line.d.ts +1 -0
- package/dist/chart/format-pane-locales/es.d.ts +1 -0
- package/dist/chart/format-pane-model.d.ts +1 -0
- package/dist/chart/format-pane-options.d.ts +1 -0
- package/dist/chart/format-pane-space.d.ts +1 -0
- package/dist/chart/format-pane-text.d.ts +1 -0
- package/dist/chart/format-pane-types.d.ts +1 -0
- package/dist/chart/format-pane-view.d.ts +1 -0
- package/dist/chrome/find-bar.d.ts +2 -1
- package/dist/{chunk-NH5ZSZMI.js → chunk-2YRHRV4H.js} +1 -1
- package/dist/{chunk-JWBWLGEY.js → chunk-LPI7LT4B.js} +2 -2
- package/dist/{chunk-2ZYRZANE.js → chunk-MWDG776V.js} +1 -1
- package/dist/{chunk-I57TCM2Q.js → chunk-UEFVC6V4.js} +1 -1
- package/dist/{chunk-M4ARYL3L.js → chunk-ZTLP52FH.js} +1 -1
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +1 -1
- package/dist/docx.js +4 -4
- package/dist/embedding/region-host.d.ts +1 -0
- package/dist/files/save-progress-label.d.ts +1 -0
- package/dist/fonts/custom-fonts.d.ts +1 -0
- package/dist/form/color-swatches.d.ts +1 -0
- package/dist/image-native-size.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/picture-artistic-filters.d.ts +1 -0
- package/dist/picture-artistic-preview.d.ts +1 -0
- package/dist/picture-paint.d.ts +1 -0
- package/dist/pptx/{chart-3d-view-scene-D6OJTZYC.mjs → chart-3d-view-scene-7LIMCTEM.mjs} +3 -3
- package/dist/pptx/{chart-3d-view-scene-PC2RUBL4.cjs → chart-3d-view-scene-RCWYLVC3.cjs} +38 -38
- package/dist/pptx/{chunk-W2QJX2ON.mjs → chunk-2P6TH4ZE.mjs} +3 -0
- package/dist/pptx/{chunk-H6M3FKNG.mjs → chunk-3DJZBAQ2.mjs} +1 -1
- package/dist/pptx/{chunk-BNPTGOEZ.mjs → chunk-6JTQ7AG6.mjs} +3 -3
- package/dist/pptx/{chunk-LK35P6RE.cjs → chunk-CWBVJ4DC.cjs} +1043 -427
- package/dist/pptx/{chunk-HWJKBKCW.cjs → chunk-FI2ATACZ.cjs} +3 -3
- package/dist/pptx/{chunk-EDIAPF6J.mjs → chunk-G5NEBI7N.mjs} +3 -3
- package/dist/pptx/{chunk-HB6CH2FF.cjs → chunk-GYI2TFSW.cjs} +3 -3
- package/dist/pptx/{chunk-D3DQS2J2.mjs → chunk-HGT3CA36.mjs} +796 -200
- package/dist/pptx/{chunk-2SO3BL67.cjs → chunk-HTFYAGHG.cjs} +238 -87
- package/dist/pptx/{chunk-2GDYTHUY.cjs → chunk-LOUVYGWX.cjs} +12 -12
- package/dist/pptx/{chunk-ZH35NTNU.cjs → chunk-MZCAYJ7H.cjs} +49 -49
- package/dist/pptx/{chunk-KYTG7WNC.mjs → chunk-S6P7UWGZ.mjs} +2 -2
- package/dist/pptx/{chunk-ZHVKGGLQ.cjs → chunk-UFJBHFSD.cjs} +3 -0
- package/dist/pptx/{chunk-TDALHSYV.mjs → chunk-XL5AF4U3.mjs} +211 -73
- package/dist/pptx/dom/elements/connector.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +458 -449
- package/dist/pptx/dom/index.mjs +32 -23
- package/dist/pptx/export/html2canvas-clone.cjs +7 -7
- package/dist/pptx/export/html2canvas-clone.mjs +2 -2
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3547 -3459
- package/dist/pptx/index.mjs +6 -6
- package/dist/pptx/render/chart-combo-stock.cjs +4 -4
- package/dist/pptx/render/chart-combo-stock.mjs +2 -2
- package/dist/pptx/render/chart-overlays.cjs +8 -8
- package/dist/pptx/render/chart-overlays.mjs +2 -2
- package/dist/pptx/render/chart-surface-treemap.cjs +5 -5
- package/dist/pptx/render/chart-surface-treemap.mjs +2 -2
- package/dist/pptx/render/chart-view-model.cjs +45 -45
- package/dist/pptx/render/chart-view-model.mjs +2 -2
- package/dist/pptx/render/chart-waterfall-map.cjs +7 -7
- package/dist/pptx/render/chart-waterfall-map.mjs +2 -2
- package/dist/pptx/render/connector-dash.d.ts +15 -0
- package/dist/pptx/render/connector-dash.d.ts.map +1 -1
- package/dist/pptx/render/connector-path.d.ts +1 -1
- package/dist/pptx/render/connector-path.d.ts.map +1 -1
- package/dist/pptx/render/customization/customization-controller.d.ts +8 -0
- package/dist/pptx/render/customization/customization-controller.d.ts.map +1 -1
- package/dist/pptx/render/dash-pattern.d.ts +5 -56
- package/dist/pptx/render/dash-pattern.d.ts.map +1 -1
- package/dist/pptx/render/dash-square-cap.d.ts +34 -0
- package/dist/pptx/render/dash-square-cap.d.ts.map +1 -0
- package/dist/pptx/render/deck-webfont-outlines.d.ts +25 -0
- package/dist/pptx/render/deck-webfont-outlines.d.ts.map +1 -0
- package/dist/pptx/render/deck-webfont-readiness.d.ts +59 -0
- package/dist/pptx/render/deck-webfont-readiness.d.ts.map +1 -0
- package/dist/pptx/render/device-pixel-stroke.d.ts +1 -1
- package/dist/pptx/render/device-pixel-stroke.d.ts.map +1 -1
- package/dist/pptx/render/fill-style.d.ts +6 -0
- package/dist/pptx/render/fill-style.d.ts.map +1 -1
- package/dist/pptx/render/google-webfonts.d.ts +11 -1
- package/dist/pptx/render/google-webfonts.d.ts.map +1 -1
- package/dist/pptx/render/gradient-svg-image.d.ts +9 -0
- package/dist/pptx/render/gradient-svg-image.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +4 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/options/font-download-policy.d.ts +52 -0
- package/dist/pptx/render/options/font-download-policy.d.ts.map +1 -0
- package/dist/pptx/render/options/index.d.ts +1 -0
- package/dist/pptx/render/options/index.d.ts.map +1 -1
- package/dist/pptx/render/options/viewer-options-tabs-advanced.d.ts.map +1 -1
- package/dist/pptx/render/options/viewer-options.d.ts +2 -0
- package/dist/pptx/render/options/viewer-options.d.ts.map +1 -1
- package/dist/pptx/render/paragraph-baseline.d.ts +13 -2
- package/dist/pptx/render/paragraph-baseline.d.ts.map +1 -1
- package/dist/pptx/render/paragraph-run-build.d.ts.map +1 -1
- package/dist/pptx/render/paragraph-trailing-break.d.ts +15 -0
- package/dist/pptx/render/paragraph-trailing-break.d.ts.map +1 -0
- package/dist/pptx/render/shape-path-gradient-fill.d.ts +20 -0
- package/dist/pptx/render/shape-path-gradient-fill.d.ts.map +1 -0
- package/dist/pptx/render/silhouette-effects.d.ts.map +1 -1
- package/dist/pptx/render/stroke-outline.d.ts.map +1 -1
- package/dist/pptx/render/svg-attr-escape.d.ts +30 -0
- package/dist/pptx/render/svg-attr-escape.d.ts.map +1 -0
- package/dist/pptx/render/svg-gradient-paint.d.ts +6 -1
- package/dist/pptx/render/svg-gradient-paint.d.ts.map +1 -1
- package/dist/pptx/render/table-cell-baseline.d.ts +2 -1
- package/dist/pptx/render/table-cell-baseline.d.ts.map +1 -1
- package/dist/pptx/render/table-cell-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/text-body-top-snap.d.ts +43 -0
- package/dist/pptx/render/text-body-top-snap.d.ts.map +1 -0
- package/dist/pptx/render/text-design-tracking.d.ts +20 -0
- package/dist/pptx/render/text-design-tracking.d.ts.map +1 -0
- package/dist/pptx/render/text-line-height.d.ts +8 -0
- package/dist/pptx/render/text-line-height.d.ts.map +1 -1
- package/dist/pptx/render/text-metric-tracking.d.ts.map +1 -1
- package/dist/pptx/render/text-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-arch-fit.d.ts +51 -0
- package/dist/pptx/render/text-warp-arch-fit.d.ts.map +1 -0
- package/dist/pptx/render/text-warp-arch.d.ts +53 -13
- package/dist/pptx/render/text-warp-arch.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-measure.d.ts +5 -0
- package/dist/pptx/render/text-warp-envelope-measure.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-outline-webfont-fetch.d.ts.map +1 -1
- package/dist/pptx/render/text-warp.d.ts +3 -1
- package/dist/pptx/render/text-warp.d.ts.map +1 -1
- package/dist/pptx/render/visual-effects.d.ts +2 -21
- package/dist/pptx/render/visual-effects.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-55QCEISC.cjs → smartart-insert-preview-R7USUBIX.cjs} +8 -8
- package/dist/pptx/{smartart-insert-preview-GPBTE3HU.mjs → smartart-insert-preview-ZKVFXFSI.mjs} +7 -7
- package/dist/render-cache.d.ts +1 -0
- package/dist/ribbon/ribbon-group.d.ts +2 -1
- package/dist/ribbon/svg-preview.d.ts +1 -0
- package/dist/teams.js +2 -2
- package/dist/theme-bridge.d.ts +1 -0
- package/dist/theme.d.ts +1 -0
- package/dist/visio.js +23 -6
- package/dist/xlsx.js +7 -7
- package/package.json +2 -2
package/dist/pptx/dom/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkMZCAYJ7H_cjs = require('../chunk-MZCAYJ7H.cjs');
|
|
4
|
+
var chunkCWBVJ4DC_cjs = require('../chunk-CWBVJ4DC.cjs');
|
|
5
|
+
var chunkLOUVYGWX_cjs = require('../chunk-LOUVYGWX.cjs');
|
|
6
6
|
require('../chunk-XOAXPD2W.cjs');
|
|
7
7
|
require('../chunk-W3X2UVYQ.cjs');
|
|
8
8
|
require('../chunk-WSTWYZFM.cjs');
|
|
@@ -22,12 +22,12 @@ require('../chunk-FFWLDANS.cjs');
|
|
|
22
22
|
require('../chunk-ZJFN5POF.cjs');
|
|
23
23
|
require('../chunk-OJFD3SHS.cjs');
|
|
24
24
|
require('../chunk-USBRSEJK.cjs');
|
|
25
|
-
var
|
|
25
|
+
var chunkHTFYAGHG_cjs = require('../chunk-HTFYAGHG.cjs');
|
|
26
26
|
var chunkFOE75Z6N_cjs = require('../chunk-FOE75Z6N.cjs');
|
|
27
27
|
var chunkNTXHQHCS_cjs = require('../chunk-NTXHQHCS.cjs');
|
|
28
|
-
require('../chunk-
|
|
28
|
+
require('../chunk-GYI2TFSW.cjs');
|
|
29
29
|
require('../chunk-G4WRLFMJ.cjs');
|
|
30
|
-
var
|
|
30
|
+
var chunkFI2ATACZ_cjs = require('../chunk-FI2ATACZ.cjs');
|
|
31
31
|
require('../chunk-HJ3JZXOL.cjs');
|
|
32
32
|
require('../chunk-73IDQGYI.cjs');
|
|
33
33
|
var chunk3CYWRMYZ_cjs = require('../chunk-3CYWRMYZ.cjs');
|
|
@@ -37,21 +37,21 @@ require('../chunk-UPN5FFKP.cjs');
|
|
|
37
37
|
require('../chunk-FQUX6AUU.cjs');
|
|
38
38
|
require('../chunk-XZSGVMRN.cjs');
|
|
39
39
|
var chunkU47LRWDT_cjs = require('../chunk-U47LRWDT.cjs');
|
|
40
|
-
var
|
|
40
|
+
var chunkUFJBHFSD_cjs = require('../chunk-UFJBHFSD.cjs');
|
|
41
41
|
require('../chunk-3RIGT7H6.cjs');
|
|
42
42
|
require('../chunk-PBZWDEXQ.cjs');
|
|
43
43
|
var pptx = require('ooxml-core/pptx');
|
|
44
44
|
|
|
45
45
|
// src/pptx/dom/activex-controls-overlay.ts
|
|
46
46
|
function buildActiveXControlsOverlay(doc, controls, canvasSize) {
|
|
47
|
-
const overlay =
|
|
47
|
+
const overlay = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-activex-overlay", {
|
|
48
48
|
position: "absolute",
|
|
49
49
|
inset: "0",
|
|
50
50
|
pointerEvents: "none",
|
|
51
51
|
zIndex: "40"
|
|
52
52
|
});
|
|
53
53
|
controls.forEach((control, index) => {
|
|
54
|
-
const view =
|
|
54
|
+
const view = chunkCWBVJ4DC_cjs.getActiveXControlOverlayView(control, canvasSize, index);
|
|
55
55
|
const style = {
|
|
56
56
|
position: "absolute",
|
|
57
57
|
left: `${view.left}px`,
|
|
@@ -60,7 +60,7 @@ function buildActiveXControlsOverlay(doc, controls, canvasSize) {
|
|
|
60
60
|
height: `${view.height}px`
|
|
61
61
|
};
|
|
62
62
|
if (view.className === "image" && view.imageUrl) {
|
|
63
|
-
const img =
|
|
63
|
+
const img = chunkMZCAYJ7H_cjs.createEl(doc, "img", "pptxv-activex-overlay-image", style);
|
|
64
64
|
img.src = view.imageUrl;
|
|
65
65
|
img.alt = view.label;
|
|
66
66
|
img.setAttribute("draggable", "false");
|
|
@@ -68,7 +68,7 @@ function buildActiveXControlsOverlay(doc, controls, canvasSize) {
|
|
|
68
68
|
overlay.appendChild(img);
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const badge =
|
|
71
|
+
const badge = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-activex-overlay-placeholder", style);
|
|
72
72
|
badge.title = `ActiveX control: ${view.label} (interactive controls are not supported in the viewer)`;
|
|
73
73
|
badge.textContent = view.label;
|
|
74
74
|
overlay.appendChild(badge);
|
|
@@ -81,25 +81,25 @@ function appendCommentMarkers(doc, stage, comments, canvasSize, t, onMarkerClick
|
|
|
81
81
|
if (comments.length === 0) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
const overlay =
|
|
84
|
+
const overlay = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-comment-markers", {
|
|
85
85
|
position: "absolute",
|
|
86
86
|
inset: "0",
|
|
87
87
|
pointerEvents: "none",
|
|
88
88
|
zIndex: "45"
|
|
89
89
|
});
|
|
90
|
-
const markers =
|
|
90
|
+
const markers = chunkCWBVJ4DC_cjs.buildCommentMarkers(
|
|
91
91
|
comments,
|
|
92
92
|
canvasSize.width,
|
|
93
93
|
canvasSize.height,
|
|
94
94
|
t("pptx.comments.unknownAuthor")
|
|
95
95
|
);
|
|
96
96
|
for (const marker of markers) {
|
|
97
|
-
const dot =
|
|
97
|
+
const dot = chunkMZCAYJ7H_cjs.createEl(doc, "button", "pptxv-comment-marker", {
|
|
98
98
|
position: "absolute",
|
|
99
|
-
left: `${marker.x -
|
|
100
|
-
top: `${marker.y -
|
|
101
|
-
width: `${
|
|
102
|
-
height: `${
|
|
99
|
+
left: `${marker.x - chunkCWBVJ4DC_cjs.COMMENT_MARKER_SIZE / 2}px`,
|
|
100
|
+
top: `${marker.y - chunkCWBVJ4DC_cjs.COMMENT_MARKER_SIZE / 2}px`,
|
|
101
|
+
width: `${chunkCWBVJ4DC_cjs.COMMENT_MARKER_SIZE}px`,
|
|
102
|
+
height: `${chunkCWBVJ4DC_cjs.COMMENT_MARKER_SIZE}px`,
|
|
103
103
|
display: "flex",
|
|
104
104
|
alignItems: "center",
|
|
105
105
|
justifyContent: "center",
|
|
@@ -166,7 +166,7 @@ function merge3dStyle(base, computed) {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
function getShapeFillStrokeStyle(el, animatesFill, animatesStroke) {
|
|
169
|
-
const frame =
|
|
169
|
+
const frame = chunkCWBVJ4DC_cjs.getFrameEffectStyle(el);
|
|
170
170
|
if (frame) {
|
|
171
171
|
return { ...frame };
|
|
172
172
|
}
|
|
@@ -176,13 +176,13 @@ function getShapeFillStrokeStyle(el, animatesFill, animatesStroke) {
|
|
|
176
176
|
const ss = el.shapeStyle;
|
|
177
177
|
const style = {};
|
|
178
178
|
if (ss) {
|
|
179
|
-
const fill = animatesFill ? void 0 :
|
|
179
|
+
const fill = animatesFill ? void 0 : chunkHTFYAGHG_cjs.getComputedFillStyle(el);
|
|
180
180
|
for (const [key, value] of Object.entries(fill ?? {})) {
|
|
181
181
|
if (value !== void 0) {
|
|
182
182
|
style[key] = value;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
const stroke =
|
|
185
|
+
const stroke = chunkHTFYAGHG_cjs.getComputedStrokeStyle(el);
|
|
186
186
|
if (stroke.borderWidth > 0) {
|
|
187
187
|
if (animatesStroke) {
|
|
188
188
|
style["borderWidth"] = stroke.cssBorderWidth;
|
|
@@ -201,7 +201,7 @@ function getShapeFillStrokeStyle(el, animatesFill, animatesStroke) {
|
|
|
201
201
|
style["strokeMiterlimit"] = stroke.strokeMiterlimit;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
const fx =
|
|
204
|
+
const fx = chunkHTFYAGHG_cjs.getComputedEffectStyle(el);
|
|
205
205
|
if (fx.boxShadow) {
|
|
206
206
|
style["boxShadow"] = fx.boxShadow;
|
|
207
207
|
}
|
|
@@ -218,11 +218,11 @@ function getShapeFillStrokeStyle(el, animatesFill, animatesStroke) {
|
|
|
218
218
|
if (fx.overflowVisible) {
|
|
219
219
|
style["overflow"] = "visible";
|
|
220
220
|
}
|
|
221
|
-
merge3dStyle(style,
|
|
222
|
-
if (
|
|
221
|
+
merge3dStyle(style, chunkCWBVJ4DC_cjs.getComputed3dStyle(el));
|
|
222
|
+
if (chunkCWBVJ4DC_cjs.passesClicksThroughBox(el)) {
|
|
223
223
|
style["pointerEvents"] = "none";
|
|
224
224
|
}
|
|
225
|
-
const geometry =
|
|
225
|
+
const geometry = chunkCWBVJ4DC_cjs.resolveShapeGeometry(el);
|
|
226
226
|
switch (geometry.kind) {
|
|
227
227
|
case "bare":
|
|
228
228
|
style["backgroundColor"] = "transparent";
|
|
@@ -242,10 +242,10 @@ function getShapeFillStrokeStyle(el, animatesFill, animatesStroke) {
|
|
|
242
242
|
case "lineEdge":
|
|
243
243
|
style["backgroundColor"] = "transparent";
|
|
244
244
|
style["border"] = "none";
|
|
245
|
-
style["borderTop"] =
|
|
245
|
+
style["borderTop"] = chunkFI2ATACZ_cjs.screenBorder(
|
|
246
246
|
geometry.strokeWidth,
|
|
247
|
-
|
|
248
|
-
el.shapeStyle?.strokeColor ??
|
|
247
|
+
chunkHTFYAGHG_cjs.getCssBorderDashStyle(el.shapeStyle?.strokeDash),
|
|
248
|
+
el.shapeStyle?.strokeColor ?? chunkHTFYAGHG_cjs.DEFAULT_STROKE_COLOR
|
|
249
249
|
);
|
|
250
250
|
return style;
|
|
251
251
|
default:
|
|
@@ -256,17 +256,17 @@ function getTextBlockStyle(el) {
|
|
|
256
256
|
if (!pptx.hasTextProperties(el)) {
|
|
257
257
|
return {};
|
|
258
258
|
}
|
|
259
|
-
const base =
|
|
260
|
-
fallbackColor:
|
|
259
|
+
const base = chunkCWBVJ4DC_cjs.buildTextBlockStyle(el, {
|
|
260
|
+
fallbackColor: chunkHTFYAGHG_cjs.DEFAULT_TEXT_COLOR,
|
|
261
261
|
bodyLayout: true,
|
|
262
262
|
pxLengths: true
|
|
263
263
|
});
|
|
264
|
-
const scene3d =
|
|
264
|
+
const scene3d = chunkCWBVJ4DC_cjs.buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height });
|
|
265
265
|
if (!scene3d) {
|
|
266
266
|
return base;
|
|
267
267
|
}
|
|
268
268
|
const merged = { ...base, ...scene3d };
|
|
269
|
-
const transform =
|
|
269
|
+
const transform = chunkMZCAYJ7H_cjs.composeTransforms(base.transform, scene3d.transform);
|
|
270
270
|
if (transform !== void 0) {
|
|
271
271
|
merged.transform = transform;
|
|
272
272
|
}
|
|
@@ -278,7 +278,7 @@ var subscriptions = /* @__PURE__ */ new WeakMap();
|
|
|
278
278
|
function subscribeChartPixelRepaint(container, repaint) {
|
|
279
279
|
const entry = { container, unsubscribe: () => {
|
|
280
280
|
} };
|
|
281
|
-
entry.unsubscribe =
|
|
281
|
+
entry.unsubscribe = chunkHTFYAGHG_cjs.subscribeBarFacePicturePixelSamples(() => {
|
|
282
282
|
if (!entry.container.isConnected) {
|
|
283
283
|
disposeChartPixelSubscriptions(entry.container);
|
|
284
284
|
return;
|
|
@@ -354,7 +354,7 @@ function renderSlideStage(options) {
|
|
|
354
354
|
const { document: doc, slide, canvasSize, mediaDataUrls, registry, t } = options;
|
|
355
355
|
const scale = options.scale ?? 1;
|
|
356
356
|
const interactive = options.interactive ?? false;
|
|
357
|
-
const stage =
|
|
357
|
+
const stage = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-stage", {
|
|
358
358
|
width: `${canvasSize.width}px`,
|
|
359
359
|
height: `${canvasSize.height}px`,
|
|
360
360
|
transform: `scale(${scale})`,
|
|
@@ -370,8 +370,8 @@ function renderSlideStage(options) {
|
|
|
370
370
|
"--pptx-slide-h": `${canvasSize.height}px`,
|
|
371
371
|
"--pptxv-grid-size": `${options.gridSpacingPx ?? 10}px`,
|
|
372
372
|
// One device pixel in slide px: thin strokes stay visible on screen.
|
|
373
|
-
...
|
|
374
|
-
...
|
|
373
|
+
...chunkFI2ATACZ_cjs.deviceStrokeStageStyle(scale),
|
|
374
|
+
...chunkCWBVJ4DC_cjs.getSlideBackgroundStyle(slide, { widthPx: canvasSize.width, heightPx: canvasSize.height })
|
|
375
375
|
});
|
|
376
376
|
if (interactive || options.reading) {
|
|
377
377
|
stage.setAttribute("role", "region");
|
|
@@ -412,10 +412,10 @@ function renderSlideStage(options) {
|
|
|
412
412
|
chartPartSelection: options.chartPartSelection,
|
|
413
413
|
onChartPartSelect: options.onChartPartSelect,
|
|
414
414
|
selectedElementIds: options.selectedElementIds,
|
|
415
|
-
edgeBleeds:
|
|
415
|
+
edgeBleeds: chunkCWBVJ4DC_cjs.resolveStageEdgeBleeds(void 0, slide, options.selectedElementIds),
|
|
416
416
|
registry,
|
|
417
417
|
renderElement(element, zIndex) {
|
|
418
|
-
if (!
|
|
418
|
+
if (!chunkCWBVJ4DC_cjs.isElementRendered(element)) {
|
|
419
419
|
return null;
|
|
420
420
|
}
|
|
421
421
|
const node = registry.resolve(element.type)(element, zIndex, context);
|
|
@@ -427,10 +427,10 @@ function renderSlideStage(options) {
|
|
|
427
427
|
}
|
|
428
428
|
node.setAttribute("data-pptx-element", "true");
|
|
429
429
|
}
|
|
430
|
-
if (node && element.type !== "text" && element.type !== "shape" && element.type !== "connector" &&
|
|
431
|
-
const hitTargetStyle =
|
|
430
|
+
if (node && element.type !== "text" && element.type !== "shape" && element.type !== "connector" && chunkCWBVJ4DC_cjs.shouldRenderHitTarget(interactive, options.presenting ?? false)) {
|
|
431
|
+
const hitTargetStyle = chunkCWBVJ4DC_cjs.elementHitTargetStyle(element);
|
|
432
432
|
if (hitTargetStyle) {
|
|
433
|
-
const hitTarget =
|
|
433
|
+
const hitTarget = chunkMZCAYJ7H_cjs.createEl(doc, "div", void 0, hitTargetStyle);
|
|
434
434
|
hitTarget.setAttribute("aria-hidden", "true");
|
|
435
435
|
hitTarget.setAttribute("data-pptx-hit-target", "true");
|
|
436
436
|
node.appendChild(hitTarget);
|
|
@@ -448,12 +448,12 @@ function renderSlideStage(options) {
|
|
|
448
448
|
}
|
|
449
449
|
});
|
|
450
450
|
if (interactive || options.reading) {
|
|
451
|
-
|
|
451
|
+
chunkCWBVJ4DC_cjs.applyRenderedElementAccessibility(stage, slide.elements, {
|
|
452
452
|
presenting: options.presenting ?? false
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
455
|
if (interactive) {
|
|
456
|
-
|
|
456
|
+
chunkCWBVJ4DC_cjs.applyElementActionAffordances(
|
|
457
457
|
stage,
|
|
458
458
|
slide.elements.filter(
|
|
459
459
|
(element) => options.templateEditing || !chunk3CYWRMYZ_cjs.isTemplateElementId(element.id)
|
|
@@ -461,7 +461,7 @@ function renderSlideStage(options) {
|
|
|
461
461
|
{
|
|
462
462
|
canInteract: true,
|
|
463
463
|
presenting: options.presenting ?? false,
|
|
464
|
-
labels:
|
|
464
|
+
labels: chunkCWBVJ4DC_cjs.actionAffordanceLabels((key) => t(key))
|
|
465
465
|
}
|
|
466
466
|
);
|
|
467
467
|
}
|
|
@@ -538,13 +538,13 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
538
538
|
if (!context.selectedElementIds?.has(element.id)) {
|
|
539
539
|
return;
|
|
540
540
|
}
|
|
541
|
-
|
|
542
|
-
container.classList.add(
|
|
541
|
+
chunkLOUVYGWX_cjs.ensureChartInteractionStyles();
|
|
542
|
+
container.classList.add(chunkLOUVYGWX_cjs.CHART_INTERACTIVE_CLASS);
|
|
543
543
|
let active = null;
|
|
544
544
|
let activeMark = null;
|
|
545
545
|
let selected = context.chartPartSelection?.elementId === element.id ? context.chartPartSelection.part : null;
|
|
546
546
|
let badge = null;
|
|
547
|
-
|
|
547
|
+
chunkLOUVYGWX_cjs.applyChartPartHighlight(container, selected);
|
|
548
548
|
const showBadge = (text) => {
|
|
549
549
|
if (!badge) {
|
|
550
550
|
badge = container.ownerDocument.createElement("div");
|
|
@@ -568,26 +568,26 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
568
568
|
if (!rect) {
|
|
569
569
|
return;
|
|
570
570
|
}
|
|
571
|
-
const step2 =
|
|
571
|
+
const step2 = chunkCWBVJ4DC_cjs.advanceChartMarkDrag(activeMark, event.clientX, event.clientY, rect);
|
|
572
572
|
if (!step2) {
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
575
|
repaint(step2.chartData);
|
|
576
|
-
|
|
577
|
-
showBadge(
|
|
576
|
+
chunkLOUVYGWX_cjs.applyChartPartHighlight(container, selected);
|
|
577
|
+
showBadge(chunkHTFYAGHG_cjs.formatAxisValue(step2.value));
|
|
578
578
|
return;
|
|
579
579
|
}
|
|
580
580
|
if (!active) {
|
|
581
581
|
return;
|
|
582
582
|
}
|
|
583
583
|
const height = container.querySelector("svg")?.getBoundingClientRect().height ?? 0;
|
|
584
|
-
const step =
|
|
584
|
+
const step = chunkLOUVYGWX_cjs.advanceChartValueDrag(active, event.clientY, height);
|
|
585
585
|
if (!step) {
|
|
586
586
|
return;
|
|
587
587
|
}
|
|
588
588
|
repaint(step.chartData);
|
|
589
|
-
|
|
590
|
-
showBadge(
|
|
589
|
+
chunkLOUVYGWX_cjs.applyChartPartHighlight(container, selected);
|
|
590
|
+
showBadge(chunkHTFYAGHG_cjs.formatAxisValue(step.value));
|
|
591
591
|
};
|
|
592
592
|
const onUp = () => {
|
|
593
593
|
if (active || activeMark) {
|
|
@@ -613,12 +613,12 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
613
613
|
}
|
|
614
614
|
if ((finished?.moved || finishedMark?.moved) && chart.chartData) {
|
|
615
615
|
repaint(chart.chartData);
|
|
616
|
-
|
|
616
|
+
chunkLOUVYGWX_cjs.applyChartPartHighlight(container, selected);
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
const openTitleEditor = createChartTitleEditor(container, (value) => {
|
|
620
620
|
if (chart.chartData) {
|
|
621
|
-
context.onChartPointChange?.(element,
|
|
621
|
+
context.onChartPointChange?.(element, chunkLOUVYGWX_cjs.withChartTitle(chart.chartData, value));
|
|
622
622
|
}
|
|
623
623
|
});
|
|
624
624
|
const requestFormat = (event, open) => {
|
|
@@ -627,7 +627,7 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
627
627
|
bubbles: true,
|
|
628
628
|
detail: {
|
|
629
629
|
elementId: element.id,
|
|
630
|
-
target:
|
|
630
|
+
target: chunkCWBVJ4DC_cjs.chartFormatTargetFromEvent(event, container, chart),
|
|
631
631
|
open
|
|
632
632
|
}
|
|
633
633
|
})
|
|
@@ -650,19 +650,19 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
650
650
|
});
|
|
651
651
|
container.addEventListener("pointerdown", (event) => {
|
|
652
652
|
requestFormat(event, false);
|
|
653
|
-
const part =
|
|
653
|
+
const part = chunkLOUVYGWX_cjs.findChartPartTarget(event.target);
|
|
654
654
|
if (!part || !chart.chartData) {
|
|
655
655
|
return;
|
|
656
656
|
}
|
|
657
657
|
event.stopPropagation();
|
|
658
658
|
selected = part;
|
|
659
|
-
|
|
659
|
+
chunkLOUVYGWX_cjs.applyChartPartHighlight(container, selected);
|
|
660
660
|
context.onChartPartSelect?.(element, part);
|
|
661
|
-
const vm =
|
|
661
|
+
const vm = chunkHTFYAGHG_cjs.buildChartViewModel(chart);
|
|
662
662
|
let captured = false;
|
|
663
|
-
const chartKind =
|
|
663
|
+
const chartKind = chunkHTFYAGHG_cjs.resolveChartKind(chart.chartData.chartType ?? "bar");
|
|
664
664
|
if (part.pointIndex !== void 0 && chartKind !== "unsupported") {
|
|
665
|
-
const markGeometry =
|
|
665
|
+
const markGeometry = chunkLOUVYGWX_cjs.buildChartMarkDragGeometry({
|
|
666
666
|
kind: chartKind,
|
|
667
667
|
element: chart,
|
|
668
668
|
chartData: chart.chartData,
|
|
@@ -670,7 +670,7 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
670
670
|
seriesIndex: part.seriesIndex,
|
|
671
671
|
pointIndex: part.pointIndex
|
|
672
672
|
});
|
|
673
|
-
const startedMark =
|
|
673
|
+
const startedMark = chunkCWBVJ4DC_cjs.beginChartMarkDrag({
|
|
674
674
|
part,
|
|
675
675
|
geometry: markGeometry,
|
|
676
676
|
chartData: chart.chartData,
|
|
@@ -685,7 +685,7 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
687
|
if (!captured) {
|
|
688
|
-
const started =
|
|
688
|
+
const started = chunkLOUVYGWX_cjs.beginChartValueDrag({
|
|
689
689
|
part,
|
|
690
690
|
viewModel: vm,
|
|
691
691
|
chartData: chart.chartData,
|
|
@@ -714,17 +714,17 @@ function attachChartEditing(container, element, context, repaint) {
|
|
|
714
714
|
// src/pptx/dom/elements/chart.ts
|
|
715
715
|
var renderChartElement = (element, zIndex, context) => {
|
|
716
716
|
const wrapper = renderChartSvgElement(element, zIndex, context);
|
|
717
|
-
const spec = wrapper ?
|
|
717
|
+
const spec = wrapper ? chunkCWBVJ4DC_cjs.resolveChartThreeViewSpec(element, chunkMZCAYJ7H_cjs.rendering3DFlagsOf(context)) : null;
|
|
718
718
|
if (!wrapper || !spec) {
|
|
719
719
|
return wrapper;
|
|
720
720
|
}
|
|
721
|
-
const view =
|
|
721
|
+
const view = chunkMZCAYJ7H_cjs.mountThreeViewInto(context.document, wrapper, {
|
|
722
722
|
spec,
|
|
723
|
-
interactive:
|
|
724
|
-
selectedPart:
|
|
723
|
+
interactive: chunkMZCAYJ7H_cjs.isChart3DEditable(element, context),
|
|
724
|
+
selectedPart: chunkMZCAYJ7H_cjs.selectedChartPartOf(element, context),
|
|
725
725
|
textStyle: context.presentationStates?.get(element.id)?.textStyle
|
|
726
726
|
});
|
|
727
|
-
|
|
727
|
+
chunkMZCAYJ7H_cjs.wireChartThreeViewEvents(view, element, context, wrapper);
|
|
728
728
|
return wrapper;
|
|
729
729
|
};
|
|
730
730
|
var renderChartSvgElement = (element, zIndex, context) => {
|
|
@@ -732,21 +732,21 @@ var renderChartSvgElement = (element, zIndex, context) => {
|
|
|
732
732
|
return null;
|
|
733
733
|
}
|
|
734
734
|
const doc = context.document;
|
|
735
|
-
const container =
|
|
735
|
+
const container = chunkMZCAYJ7H_cjs.createEl(
|
|
736
736
|
doc,
|
|
737
737
|
"div",
|
|
738
738
|
"pptxv-element pptxv-chart",
|
|
739
739
|
// The chart area's outer shadow and glow sit on the frame, outside the chart.
|
|
740
|
-
{ ...
|
|
740
|
+
{ ...chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex), ...chunkCWBVJ4DC_cjs.getFrameEffectStyle(element) }
|
|
741
741
|
);
|
|
742
742
|
container.dataset.elementId = element.id;
|
|
743
743
|
const animationState = context.presentationStates?.get(element.id);
|
|
744
|
-
const chartData = element.chartData ?
|
|
744
|
+
const chartData = element.chartData ? chunkCWBVJ4DC_cjs.resolveRevealedChartData(element.chartData, animationState) : element.chartData;
|
|
745
745
|
if (!chartData || chartData.series.length === 0) {
|
|
746
746
|
container.appendChild(renderChartPlaceholder(doc, chartData?.chartType ?? "bar", context.t));
|
|
747
747
|
return container;
|
|
748
748
|
}
|
|
749
|
-
const kind =
|
|
749
|
+
const kind = chunkHTFYAGHG_cjs.resolveChartKind(chartData.chartType ?? "bar");
|
|
750
750
|
if (kind === "unsupported") {
|
|
751
751
|
container.appendChild(renderChartPlaceholder(doc, chartData.chartType, context.t));
|
|
752
752
|
return container;
|
|
@@ -759,9 +759,9 @@ var renderChartSvgElement = (element, zIndex, context) => {
|
|
|
759
759
|
};
|
|
760
760
|
target.querySelector("svg")?.remove();
|
|
761
761
|
target.appendChild(
|
|
762
|
-
|
|
762
|
+
chunkLOUVYGWX_cjs.renderChartViewModelSvg(
|
|
763
763
|
doc,
|
|
764
|
-
|
|
764
|
+
chunkHTFYAGHG_cjs.buildChartViewModel(themedElement),
|
|
765
765
|
preserveAspectRatio,
|
|
766
766
|
(key) => context.t(key)
|
|
767
767
|
)
|
|
@@ -773,10 +773,10 @@ var renderChartSvgElement = (element, zIndex, context) => {
|
|
|
773
773
|
return container;
|
|
774
774
|
};
|
|
775
775
|
function resolveChartPalette2(chartData) {
|
|
776
|
-
return
|
|
776
|
+
return chunkHTFYAGHG_cjs.resolveChartPalette(chartData);
|
|
777
777
|
}
|
|
778
778
|
function renderChartPlaceholder(doc, chartType, t) {
|
|
779
|
-
const placeholder =
|
|
779
|
+
const placeholder = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-placeholder pptxv-chart-placeholder", {
|
|
780
780
|
display: "flex",
|
|
781
781
|
alignItems: "center",
|
|
782
782
|
justifyContent: "center",
|
|
@@ -788,7 +788,7 @@ function renderChartPlaceholder(doc, chartType, t) {
|
|
|
788
788
|
border: "1px dashed #cbd5e1",
|
|
789
789
|
boxSizing: "border-box"
|
|
790
790
|
});
|
|
791
|
-
placeholder.textContent =
|
|
791
|
+
placeholder.textContent = chunkCWBVJ4DC_cjs.chartPlaceholderLabel(chartType, (key, params) => t(key, params));
|
|
792
792
|
return placeholder;
|
|
793
793
|
}
|
|
794
794
|
|
|
@@ -807,19 +807,19 @@ function appendRunContent(doc, host, run) {
|
|
|
807
807
|
}
|
|
808
808
|
function appendTabLines(doc, host, lines) {
|
|
809
809
|
lines.forEach((line, li) => {
|
|
810
|
-
const lineHost =
|
|
810
|
+
const lineHost = chunkMZCAYJ7H_cjs.createEl(doc, "span", void 0, {
|
|
811
811
|
display: "inline-block",
|
|
812
812
|
whiteSpace: "nowrap"
|
|
813
813
|
});
|
|
814
814
|
for (const piece of line.pieces) {
|
|
815
815
|
if (piece.leaderStyle) {
|
|
816
|
-
const leader =
|
|
816
|
+
const leader = chunkMZCAYJ7H_cjs.createEl(doc, "span", void 0, piece.leaderStyle);
|
|
817
817
|
leader.setAttribute("aria-hidden", "true");
|
|
818
818
|
leader.textContent = piece.leaderText ?? "";
|
|
819
819
|
lineHost.appendChild(leader);
|
|
820
820
|
}
|
|
821
821
|
for (const word of piece.words ?? [piece]) {
|
|
822
|
-
const textSpan =
|
|
822
|
+
const textSpan = chunkMZCAYJ7H_cjs.createEl(doc, "span", void 0, word.style);
|
|
823
823
|
textSpan.textContent = word.text;
|
|
824
824
|
lineHost.appendChild(textSpan);
|
|
825
825
|
}
|
|
@@ -833,7 +833,7 @@ function appendTabLines(doc, host, lines) {
|
|
|
833
833
|
function appendStyledPieces(doc, host, pieces) {
|
|
834
834
|
for (const piece of pieces) {
|
|
835
835
|
if (piece.style) {
|
|
836
|
-
const span =
|
|
836
|
+
const span = chunkMZCAYJ7H_cjs.createEl(doc, "span", void 0, piece.style);
|
|
837
837
|
span.textContent = piece.text;
|
|
838
838
|
host.appendChild(span);
|
|
839
839
|
} else {
|
|
@@ -846,16 +846,16 @@ function appendStyledPieces(doc, host, pieces) {
|
|
|
846
846
|
var NEWLINE_RUN = "\n";
|
|
847
847
|
function createRunBaseNode(doc, run) {
|
|
848
848
|
if (run.equation) {
|
|
849
|
-
const host =
|
|
850
|
-
const math =
|
|
849
|
+
const host = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-inline-equation", run.style);
|
|
850
|
+
const math = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-equation-math", {
|
|
851
851
|
display: "inline-block",
|
|
852
852
|
verticalAlign: "middle",
|
|
853
853
|
fontFamily: "'Cambria Math', 'STIX Two Math', serif"
|
|
854
854
|
});
|
|
855
|
-
math.innerHTML =
|
|
855
|
+
math.innerHTML = chunkCWBVJ4DC_cjs.runEquationMathMl(run.equation);
|
|
856
856
|
host.appendChild(math);
|
|
857
857
|
if (run.equation.number) {
|
|
858
|
-
const number =
|
|
858
|
+
const number = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-equation-number", {
|
|
859
859
|
whiteSpace: "nowrap",
|
|
860
860
|
marginInlineStart: "0.5em"
|
|
861
861
|
});
|
|
@@ -864,8 +864,8 @@ function createRunBaseNode(doc, run) {
|
|
|
864
864
|
}
|
|
865
865
|
return host;
|
|
866
866
|
}
|
|
867
|
-
if (run.hyperlink &&
|
|
868
|
-
const link =
|
|
867
|
+
if (run.hyperlink && chunkCWBVJ4DC_cjs.isRunHyperlinkClickable(run.hyperlink)) {
|
|
868
|
+
const link = chunkMZCAYJ7H_cjs.createEl(doc, "a", "pptxv-link", run.style);
|
|
869
869
|
link.setAttribute("data-pptx-hyperlink", run.hyperlink.url);
|
|
870
870
|
link.setAttribute("role", "link");
|
|
871
871
|
link.tabIndex = 0;
|
|
@@ -881,13 +881,13 @@ function createRunBaseNode(doc, run) {
|
|
|
881
881
|
}
|
|
882
882
|
if (run.ruby) {
|
|
883
883
|
const ruby = doc.createElement("ruby");
|
|
884
|
-
|
|
884
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(ruby, run.style);
|
|
885
885
|
appendRunContent(doc, ruby, run);
|
|
886
886
|
const openParen = doc.createElement("rp");
|
|
887
887
|
openParen.textContent = "(";
|
|
888
888
|
ruby.appendChild(openParen);
|
|
889
889
|
const annotation = doc.createElement("rt");
|
|
890
|
-
|
|
890
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(annotation, run.ruby.style);
|
|
891
891
|
annotation.textContent = run.ruby.text;
|
|
892
892
|
ruby.appendChild(annotation);
|
|
893
893
|
const closeParen = doc.createElement("rp");
|
|
@@ -895,8 +895,8 @@ function createRunBaseNode(doc, run) {
|
|
|
895
895
|
ruby.appendChild(closeParen);
|
|
896
896
|
return ruby;
|
|
897
897
|
}
|
|
898
|
-
const span =
|
|
899
|
-
|
|
898
|
+
const span = chunkMZCAYJ7H_cjs.createEl(doc, "span");
|
|
899
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(span, run.style);
|
|
900
900
|
appendRunContent(doc, span, run);
|
|
901
901
|
return span;
|
|
902
902
|
}
|
|
@@ -905,22 +905,22 @@ function createRunNode(doc, run) {
|
|
|
905
905
|
if (!run.reflection) {
|
|
906
906
|
return base;
|
|
907
907
|
}
|
|
908
|
-
const wrapper =
|
|
908
|
+
const wrapper = chunkMZCAYJ7H_cjs.createEl(doc, "span", void 0, {
|
|
909
909
|
position: "relative",
|
|
910
910
|
display: "inline-block"
|
|
911
911
|
});
|
|
912
912
|
wrapper.appendChild(base);
|
|
913
|
-
const mirror =
|
|
913
|
+
const mirror = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-text-reflection", { ...run.reflection });
|
|
914
914
|
mirror.setAttribute("aria-hidden", "true");
|
|
915
|
-
const mirrorInner =
|
|
916
|
-
|
|
915
|
+
const mirrorInner = chunkMZCAYJ7H_cjs.createEl(doc, "span");
|
|
916
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(mirrorInner, run.style);
|
|
917
917
|
appendRunContent(doc, mirrorInner, run);
|
|
918
918
|
mirror.appendChild(mirrorInner);
|
|
919
919
|
wrapper.appendChild(mirror);
|
|
920
920
|
return wrapper;
|
|
921
921
|
}
|
|
922
922
|
function renderTextBlock(doc, paragraphs, textStyle, build) {
|
|
923
|
-
const block =
|
|
923
|
+
const block = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-text", textStyle);
|
|
924
924
|
for (const para of paragraphs) {
|
|
925
925
|
const paraStyle = {
|
|
926
926
|
// This paragraph's own `text-align` / BiDi `direction` / kinsoku rules,
|
|
@@ -942,13 +942,13 @@ function renderTextBlock(doc, paragraphs, textStyle, build) {
|
|
|
942
942
|
if (para.strutFontSizePx !== void 0) {
|
|
943
943
|
paraStyle.fontSize = `${para.strutFontSizePx}px`;
|
|
944
944
|
}
|
|
945
|
-
const p =
|
|
945
|
+
const p = chunkMZCAYJ7H_cjs.createEl(doc, "p", "pptxv-para", paraStyle);
|
|
946
946
|
if (para.textIndentPx !== void 0) {
|
|
947
947
|
p.style.textIndent = `${para.textIndentPx}px`;
|
|
948
948
|
}
|
|
949
949
|
const picture = para.bulletPicture;
|
|
950
950
|
if (picture?.src) {
|
|
951
|
-
const image =
|
|
951
|
+
const image = chunkMZCAYJ7H_cjs.createEl(doc, "img", "pptxv-bullet-image", {
|
|
952
952
|
width: `${picture.sizePx}px`,
|
|
953
953
|
height: `${picture.sizePx}px`,
|
|
954
954
|
display: "inline-block",
|
|
@@ -961,15 +961,15 @@ function renderTextBlock(doc, paragraphs, textStyle, build) {
|
|
|
961
961
|
image.setAttribute("draggable", "false");
|
|
962
962
|
p.appendChild(image);
|
|
963
963
|
} else if (para.bulletMarker !== void 0) {
|
|
964
|
-
const bullet =
|
|
965
|
-
|
|
964
|
+
const bullet = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-bullet");
|
|
965
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(bullet, para.bulletStyle);
|
|
966
966
|
if (para.bulletPicture) {
|
|
967
967
|
bullet.setAttribute("aria-label", para.bulletPicture.accessibleLabel);
|
|
968
968
|
}
|
|
969
969
|
bullet.textContent = para.bulletMarker;
|
|
970
970
|
p.appendChild(bullet);
|
|
971
971
|
}
|
|
972
|
-
const spec = build ?
|
|
972
|
+
const spec = build ? chunkCWBVJ4DC_cjs.buildTextBuildSpec(
|
|
973
973
|
build.elementId,
|
|
974
974
|
paragraphs.indexOf(para),
|
|
975
975
|
para.runs.filter((run) => run.text !== NEWLINE_RUN).map((run) => ({ text: run.text, style: run.style })),
|
|
@@ -977,8 +977,8 @@ function renderTextBlock(doc, paragraphs, textStyle, build) {
|
|
|
977
977
|
) : void 0;
|
|
978
978
|
if (spec && spec.granularity !== "paragraph") {
|
|
979
979
|
for (const span of spec.spans ?? []) {
|
|
980
|
-
const node =
|
|
981
|
-
|
|
980
|
+
const node = chunkMZCAYJ7H_cjs.createEl(doc, "span");
|
|
981
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(node, { ...span.style ?? {}, ...chunkCWBVJ4DC_cjs.textBuildSpanStyle(span) });
|
|
982
982
|
if (span.animId) {
|
|
983
983
|
node.setAttribute("data-anim-id", span.animId);
|
|
984
984
|
}
|
|
@@ -990,8 +990,8 @@ function renderTextBlock(doc, paragraphs, textStyle, build) {
|
|
|
990
990
|
}
|
|
991
991
|
let runHost = p;
|
|
992
992
|
if (spec) {
|
|
993
|
-
const wrapper =
|
|
994
|
-
|
|
993
|
+
const wrapper = chunkMZCAYJ7H_cjs.createEl(doc, "span");
|
|
994
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(wrapper, chunkCWBVJ4DC_cjs.textBuildSpanStyle(spec));
|
|
995
995
|
if (spec.animId) {
|
|
996
996
|
wrapper.setAttribute("data-anim-id", spec.animId);
|
|
997
997
|
}
|
|
@@ -1018,9 +1018,9 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1018
1018
|
const doc = context.document;
|
|
1019
1019
|
const ss = pptx.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
1020
1020
|
const strokeWidth = Math.max(0, ss?.strokeWidth ?? 2);
|
|
1021
|
-
const strokeColor = ss?.strokeColor ??
|
|
1021
|
+
const strokeColor = ss?.strokeColor ?? chunkHTFYAGHG_cjs.DEFAULT_STROKE_COLOR;
|
|
1022
1022
|
const strokeOpacity = ss?.strokeOpacity ?? 1;
|
|
1023
|
-
const dashArray =
|
|
1023
|
+
const dashArray = chunkHTFYAGHG_cjs.buildDashArray(
|
|
1024
1024
|
ss?.strokeDash,
|
|
1025
1025
|
strokeWidth,
|
|
1026
1026
|
ss?.customDashSegments,
|
|
@@ -1028,7 +1028,7 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1028
1028
|
);
|
|
1029
1029
|
const w = Math.max(element.width, 1);
|
|
1030
1030
|
const h = Math.max(element.height, 1);
|
|
1031
|
-
const wrapper =
|
|
1031
|
+
const wrapper = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-element pptxv-connector", {
|
|
1032
1032
|
position: "absolute",
|
|
1033
1033
|
left: `${element.x}px`,
|
|
1034
1034
|
top: `${element.y}px`,
|
|
@@ -1052,18 +1052,18 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1052
1052
|
if (element.hidden) {
|
|
1053
1053
|
wrapper.style.display = "none";
|
|
1054
1054
|
}
|
|
1055
|
-
const lineGlow =
|
|
1055
|
+
const lineGlow = chunkHTFYAGHG_cjs.getLineGlowFilterCss(ss);
|
|
1056
1056
|
if (lineGlow) {
|
|
1057
1057
|
wrapper.style.filter = lineGlow;
|
|
1058
1058
|
}
|
|
1059
|
-
const svg =
|
|
1059
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", { width: w, height: h, viewBox: `0 0 ${w} ${h}` });
|
|
1060
1060
|
svg.setAttribute("style", "overflow:visible;display:block");
|
|
1061
1061
|
const seed = element.id.replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
1062
|
-
const defs =
|
|
1063
|
-
const lineShadow =
|
|
1062
|
+
const defs = chunkMZCAYJ7H_cjs.createSvgEl(doc, "defs");
|
|
1063
|
+
const lineShadow = chunkHTFYAGHG_cjs.getLineShadowParams(ss);
|
|
1064
1064
|
const shadowId = lineShadow ? `${seed}-line-shadow` : void 0;
|
|
1065
1065
|
if (lineShadow && shadowId) {
|
|
1066
|
-
const filter =
|
|
1066
|
+
const filter = chunkMZCAYJ7H_cjs.createSvgEl(doc, "filter", {
|
|
1067
1067
|
id: shadowId,
|
|
1068
1068
|
x: "-50%",
|
|
1069
1069
|
y: "-50%",
|
|
@@ -1071,7 +1071,7 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1071
1071
|
height: "200%"
|
|
1072
1072
|
});
|
|
1073
1073
|
filter.appendChild(
|
|
1074
|
-
|
|
1074
|
+
chunkMZCAYJ7H_cjs.createSvgEl(doc, "feDropShadow", {
|
|
1075
1075
|
dx: lineShadow.offsetX,
|
|
1076
1076
|
dy: lineShadow.offsetY,
|
|
1077
1077
|
stdDeviation: lineShadow.blur / 2,
|
|
@@ -1081,8 +1081,8 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1081
1081
|
);
|
|
1082
1082
|
defs.appendChild(filter);
|
|
1083
1083
|
}
|
|
1084
|
-
const startArrow =
|
|
1085
|
-
const endArrow =
|
|
1084
|
+
const startArrow = chunkHTFYAGHG_cjs.normalizeArrow(ss?.connectorStartArrow);
|
|
1085
|
+
const endArrow = chunkHTFYAGHG_cjs.normalizeArrow(ss?.connectorEndArrow);
|
|
1086
1086
|
const startMarkerId = startArrow ? `${seed}-start` : void 0;
|
|
1087
1087
|
const endMarkerId = endArrow ? `${seed}-end` : void 0;
|
|
1088
1088
|
if (startArrow && startMarkerId) {
|
|
@@ -1105,10 +1105,10 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1105
1105
|
svg.appendChild(defs);
|
|
1106
1106
|
}
|
|
1107
1107
|
const compound = ss?.compoundLine;
|
|
1108
|
-
const offsets =
|
|
1109
|
-
const widths =
|
|
1108
|
+
const offsets = chunkHTFYAGHG_cjs.getCompoundLineOffsets(compound, strokeWidth);
|
|
1109
|
+
const widths = chunkHTFYAGHG_cjs.getCompoundLineWidths(compound, strokeWidth);
|
|
1110
1110
|
const shapeType = pptx.hasShapeProperties(element) ? element.shapeType : void 0;
|
|
1111
|
-
const usePath =
|
|
1111
|
+
const usePath = chunkHTFYAGHG_cjs.connectorNeedsPath(shapeType) && pptx.hasShapeProperties(element);
|
|
1112
1112
|
const pathData = usePath ? pptx.getConnectorPathGeometry(element).pathData : void 0;
|
|
1113
1113
|
const rw = Math.max(element.width, 0);
|
|
1114
1114
|
const rh = Math.max(element.height, 0);
|
|
@@ -1116,18 +1116,25 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1116
1116
|
const y1 = element.flipVertical ? rh : 0;
|
|
1117
1117
|
const x2 = element.flipHorizontal ? 0 : rw;
|
|
1118
1118
|
const y2 = element.flipVertical ? 0 : rh;
|
|
1119
|
-
const snapTransform =
|
|
1120
|
-
const hit =
|
|
1119
|
+
const snapTransform = chunkCWBVJ4DC_cjs.connectorSnapTransform(element, !usePath, offsets.length, strokeWidth);
|
|
1120
|
+
const hit = chunkMZCAYJ7H_cjs.createSvgEl(doc, "path", {
|
|
1121
1121
|
class: "pptxv-connector-hit",
|
|
1122
1122
|
d: pathData ?? `M${x1},${y1} L${x2},${y2}`,
|
|
1123
1123
|
fill: "none",
|
|
1124
1124
|
stroke: "transparent",
|
|
1125
|
-
"stroke-width":
|
|
1125
|
+
"stroke-width": chunkCWBVJ4DC_cjs.connectorHitStrokeWidth(strokeWidth),
|
|
1126
1126
|
"stroke-linecap": "round",
|
|
1127
1127
|
"stroke-linejoin": "round"
|
|
1128
1128
|
});
|
|
1129
1129
|
hit.style.pointerEvents = "stroke";
|
|
1130
1130
|
svg.appendChild(hit);
|
|
1131
|
+
const cappedD = chunkHTFYAGHG_cjs.connectorSquareCapPath(
|
|
1132
|
+
pathData ?? `M${x1},${y1} L${x2},${y2}`,
|
|
1133
|
+
ss,
|
|
1134
|
+
strokeWidth,
|
|
1135
|
+
offsets.length > 1 || startMarkerId !== void 0 || endMarkerId !== void 0
|
|
1136
|
+
);
|
|
1137
|
+
const paintD = cappedD ?? pathData;
|
|
1131
1138
|
offsets.forEach((offset, idx) => {
|
|
1132
1139
|
const strandWidth = Math.max(widths[idx] ?? strokeWidth, 1);
|
|
1133
1140
|
const stroke = {
|
|
@@ -1136,15 +1143,15 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1136
1143
|
"stroke-width": strandWidth,
|
|
1137
1144
|
"stroke-opacity": strokeOpacity,
|
|
1138
1145
|
"stroke-dasharray": dashArray,
|
|
1139
|
-
"stroke-linecap":
|
|
1146
|
+
"stroke-linecap": chunkHTFYAGHG_cjs.svgLineCap(ss?.lineCap, dashArray !== void 0),
|
|
1140
1147
|
"marker-start": idx === 0 && startMarkerId ? `url(#${startMarkerId})` : void 0,
|
|
1141
1148
|
"marker-end": idx === offsets.length - 1 && endMarkerId ? `url(#${endMarkerId})` : void 0,
|
|
1142
1149
|
filter: shadowId ? `url(#${shadowId})` : void 0
|
|
1143
1150
|
};
|
|
1144
1151
|
let node;
|
|
1145
|
-
if (
|
|
1146
|
-
node =
|
|
1147
|
-
d:
|
|
1152
|
+
if (paintD !== void 0) {
|
|
1153
|
+
node = chunkMZCAYJ7H_cjs.createSvgEl(doc, "path", {
|
|
1154
|
+
d: paintD,
|
|
1148
1155
|
fill: "none",
|
|
1149
1156
|
"stroke-linejoin": "round",
|
|
1150
1157
|
...stroke
|
|
@@ -1153,7 +1160,7 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1153
1160
|
node.style.transform = `translate(0, ${offset}px)`;
|
|
1154
1161
|
}
|
|
1155
1162
|
} else {
|
|
1156
|
-
node =
|
|
1163
|
+
node = chunkMZCAYJ7H_cjs.createSvgEl(doc, "line", {
|
|
1157
1164
|
x1,
|
|
1158
1165
|
y1: y1 + offset,
|
|
1159
1166
|
x2,
|
|
@@ -1162,7 +1169,7 @@ var renderConnectorElement = (element, zIndex, context) => {
|
|
|
1162
1169
|
});
|
|
1163
1170
|
}
|
|
1164
1171
|
node.setAttribute("data-pptx-line", "");
|
|
1165
|
-
node.style.setProperty("stroke-width",
|
|
1172
|
+
node.style.setProperty("stroke-width", chunkHTFYAGHG_cjs.connectorStrandScreenWidth(widths, strokeWidth, idx));
|
|
1166
1173
|
if (snapTransform) {
|
|
1167
1174
|
node.style.transform = snapTransform;
|
|
1168
1175
|
}
|
|
@@ -1176,7 +1183,7 @@ function appendConnectorLabel(wrapper, element, context) {
|
|
|
1176
1183
|
if (!pptx.hasTextProperties(element)) {
|
|
1177
1184
|
return;
|
|
1178
1185
|
}
|
|
1179
|
-
const paragraphs =
|
|
1186
|
+
const paragraphs = chunkCWBVJ4DC_cjs.buildParagraphs(element, context.fieldContext);
|
|
1180
1187
|
if (!paragraphs.some((paragraph) => paragraph.runs.length > 0)) {
|
|
1181
1188
|
return;
|
|
1182
1189
|
}
|
|
@@ -1196,8 +1203,8 @@ function appendConnectorLabel(wrapper, element, context) {
|
|
|
1196
1203
|
}
|
|
1197
1204
|
function buildMarker(context, id, arrow, strokeColor, size) {
|
|
1198
1205
|
const doc = context.document;
|
|
1199
|
-
const shape =
|
|
1200
|
-
const marker =
|
|
1206
|
+
const shape = chunkHTFYAGHG_cjs.markerPath(arrow, size.width, size.length);
|
|
1207
|
+
const marker = chunkMZCAYJ7H_cjs.createSvgEl(doc, "marker", {
|
|
1201
1208
|
id,
|
|
1202
1209
|
viewBox: "0 0 10 10",
|
|
1203
1210
|
refX: shape.refX,
|
|
@@ -1209,11 +1216,11 @@ function buildMarker(context, id, arrow, strokeColor, size) {
|
|
|
1209
1216
|
preserveAspectRatio: "none"
|
|
1210
1217
|
});
|
|
1211
1218
|
if (shape.shape === "circle") {
|
|
1212
|
-
marker.appendChild(
|
|
1219
|
+
marker.appendChild(chunkMZCAYJ7H_cjs.createSvgEl(doc, "circle", { cx: 5, cy: 5, r: 4, fill: strokeColor }));
|
|
1213
1220
|
} else if (shape.strokeOnly) {
|
|
1214
|
-
marker.appendChild(
|
|
1221
|
+
marker.appendChild(chunkMZCAYJ7H_cjs.createSvgEl(doc, "path", { d: shape.d, fill: "none", stroke: strokeColor }));
|
|
1215
1222
|
} else {
|
|
1216
|
-
marker.appendChild(
|
|
1223
|
+
marker.appendChild(chunkMZCAYJ7H_cjs.createSvgEl(doc, "path", { d: shape.d, fill: strokeColor }));
|
|
1217
1224
|
}
|
|
1218
1225
|
return marker;
|
|
1219
1226
|
}
|
|
@@ -1252,13 +1259,13 @@ function stripAbuttingEdgeBleeds(root) {
|
|
|
1252
1259
|
// src/pptx/dom/elements/ink-stroke-svg.ts
|
|
1253
1260
|
function buildStrokeSvg(doc, view, replay) {
|
|
1254
1261
|
if (view.nibMarks) {
|
|
1255
|
-
const g =
|
|
1262
|
+
const g = chunkMZCAYJ7H_cjs.createSvgEl(doc, "g", {
|
|
1256
1263
|
opacity: view.opacity,
|
|
1257
1264
|
...view.blendMode === "multiply" ? { style: "mix-blend-mode: multiply" } : {}
|
|
1258
1265
|
});
|
|
1259
1266
|
for (const m of view.nibMarks) {
|
|
1260
1267
|
g.appendChild(
|
|
1261
|
-
|
|
1268
|
+
chunkMZCAYJ7H_cjs.createSvgEl(doc, "ellipse", {
|
|
1262
1269
|
cx: m.cx,
|
|
1263
1270
|
cy: m.cy,
|
|
1264
1271
|
rx: m.rPerp,
|
|
@@ -1271,16 +1278,16 @@ function buildStrokeSvg(doc, view, replay) {
|
|
|
1271
1278
|
return g;
|
|
1272
1279
|
}
|
|
1273
1280
|
if (view.circles) {
|
|
1274
|
-
const g =
|
|
1281
|
+
const g = chunkMZCAYJ7H_cjs.createSvgEl(doc, "g", {
|
|
1275
1282
|
opacity: view.opacity,
|
|
1276
1283
|
...view.blendMode === "multiply" ? { style: "mix-blend-mode: multiply" } : {}
|
|
1277
1284
|
});
|
|
1278
1285
|
for (const c of view.circles) {
|
|
1279
|
-
g.appendChild(
|
|
1286
|
+
g.appendChild(chunkMZCAYJ7H_cjs.createSvgEl(doc, "circle", { cx: c.cx, cy: c.cy, r: c.r, fill: view.color }));
|
|
1280
1287
|
}
|
|
1281
1288
|
return g;
|
|
1282
1289
|
}
|
|
1283
|
-
const path =
|
|
1290
|
+
const path = chunkMZCAYJ7H_cjs.createSvgEl(doc, "path", {
|
|
1284
1291
|
d: view.d,
|
|
1285
1292
|
fill: "none",
|
|
1286
1293
|
stroke: view.color,
|
|
@@ -1308,24 +1315,24 @@ var renderContentPartElement = (element, zIndex, context) => {
|
|
|
1308
1315
|
return null;
|
|
1309
1316
|
}
|
|
1310
1317
|
const doc = context.document;
|
|
1311
|
-
const el =
|
|
1318
|
+
const el = chunkMZCAYJ7H_cjs.createEl(
|
|
1312
1319
|
doc,
|
|
1313
1320
|
"div",
|
|
1314
1321
|
"pptxv-element pptxv-contentpart",
|
|
1315
|
-
|
|
1322
|
+
chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex)
|
|
1316
1323
|
);
|
|
1317
1324
|
el.dataset.elementId = element.id;
|
|
1318
1325
|
const strokes = element.inkStrokes;
|
|
1319
1326
|
if (!strokes || strokes.length === 0) {
|
|
1320
1327
|
el.classList.add("pptxv-placeholder");
|
|
1321
|
-
const label =
|
|
1328
|
+
const label = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-placeholder-label");
|
|
1322
1329
|
label.textContent = context.t("pptx.ink.contentPartFallback");
|
|
1323
1330
|
el.appendChild(label);
|
|
1324
1331
|
return el;
|
|
1325
1332
|
}
|
|
1326
1333
|
const w = Math.max(element.width, 1);
|
|
1327
1334
|
const h = Math.max(element.height, 1);
|
|
1328
|
-
const svg =
|
|
1335
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", {
|
|
1329
1336
|
viewBox: `0 0 ${w} ${h}`,
|
|
1330
1337
|
preserveAspectRatio: "none"
|
|
1331
1338
|
});
|
|
@@ -1333,7 +1340,7 @@ var renderContentPartElement = (element, zIndex, context) => {
|
|
|
1333
1340
|
svg.setAttribute("style", "width:100%;height:100%;pointer-events:none;display:block");
|
|
1334
1341
|
const replayStyles = context.presenting ? chunkNTXHQHCS_cjs.getContentPartReplayStyles(strokes) : [];
|
|
1335
1342
|
if (context.presenting) {
|
|
1336
|
-
const keyframes =
|
|
1343
|
+
const keyframes = chunkMZCAYJ7H_cjs.createSvgEl(doc, "style");
|
|
1337
1344
|
keyframes.textContent = chunkNTXHQHCS_cjs.INK_REPLAY_KEYFRAMES;
|
|
1338
1345
|
svg.appendChild(keyframes);
|
|
1339
1346
|
}
|
|
@@ -1345,33 +1352,33 @@ var renderContentPartElement = (element, zIndex, context) => {
|
|
|
1345
1352
|
return el;
|
|
1346
1353
|
};
|
|
1347
1354
|
function renderEquations(element, context) {
|
|
1348
|
-
if (!pptx.hasTextProperties(element) || !
|
|
1355
|
+
if (!pptx.hasTextProperties(element) || !chunkCWBVJ4DC_cjs.isEquationOnlyText(element.textSegments)) {
|
|
1349
1356
|
return null;
|
|
1350
1357
|
}
|
|
1351
1358
|
const equations = (element.textSegments ?? []).filter((segment) => segment.equationXml);
|
|
1352
1359
|
if (equations.length === 0) {
|
|
1353
1360
|
return null;
|
|
1354
1361
|
}
|
|
1355
|
-
const wrapper =
|
|
1362
|
+
const wrapper = chunkMZCAYJ7H_cjs.createEl(context.document, "div", "pptxv-equations", chunkCWBVJ4DC_cjs.buildEquationBlockStyle(getTextBlockStyle(element)));
|
|
1356
1363
|
for (const segment of equations) {
|
|
1357
|
-
const mathml =
|
|
1364
|
+
const mathml = chunkCWBVJ4DC_cjs.convertOmmlToMathMl(segment.equationXml);
|
|
1358
1365
|
if (!mathml) {
|
|
1359
1366
|
continue;
|
|
1360
1367
|
}
|
|
1361
|
-
const row =
|
|
1368
|
+
const row = chunkMZCAYJ7H_cjs.createEl(context.document, "span", "pptxv-equation", {
|
|
1362
1369
|
display: "flex",
|
|
1363
1370
|
alignItems: "center",
|
|
1364
1371
|
justifyContent: "center",
|
|
1365
1372
|
width: "100%"
|
|
1366
1373
|
});
|
|
1367
|
-
const math =
|
|
1374
|
+
const math = chunkMZCAYJ7H_cjs.createEl(context.document, "span", "pptxv-equation-math", {
|
|
1368
1375
|
flex: 1,
|
|
1369
1376
|
textAlign: "center"
|
|
1370
1377
|
});
|
|
1371
|
-
math.innerHTML =
|
|
1378
|
+
math.innerHTML = chunkCWBVJ4DC_cjs.sanitizeMathMl(mathml);
|
|
1372
1379
|
row.appendChild(math);
|
|
1373
1380
|
if (segment.equationNumber) {
|
|
1374
|
-
const number =
|
|
1381
|
+
const number = chunkMZCAYJ7H_cjs.createEl(context.document, "span", "pptxv-equation-number", {
|
|
1375
1382
|
whiteSpace: "nowrap"
|
|
1376
1383
|
});
|
|
1377
1384
|
number.textContent = `(${segment.equationNumber})`;
|
|
@@ -1385,8 +1392,8 @@ function renderExtrusionOverlay(doc, element) {
|
|
|
1385
1392
|
if (!pptx.hasShapeProperties(element)) {
|
|
1386
1393
|
return null;
|
|
1387
1394
|
}
|
|
1388
|
-
const fill =
|
|
1389
|
-
const data =
|
|
1395
|
+
const fill = chunkHTFYAGHG_cjs.getComputedFillStyle(element)?.backgroundColor;
|
|
1396
|
+
const data = chunkCWBVJ4DC_cjs.build3DExtrusionData(
|
|
1390
1397
|
element.shapeStyle?.shape3d,
|
|
1391
1398
|
element.shapeStyle?.scene3d,
|
|
1392
1399
|
fill,
|
|
@@ -1396,11 +1403,11 @@ function renderExtrusionOverlay(doc, element) {
|
|
|
1396
1403
|
if (!data.hasExtrusion || data.panels.length === 0) {
|
|
1397
1404
|
return null;
|
|
1398
1405
|
}
|
|
1399
|
-
const wrapper =
|
|
1406
|
+
const wrapper = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-extrusion-3d", toCss(data.wrapperStyle));
|
|
1400
1407
|
wrapper.setAttribute("aria-hidden", "true");
|
|
1401
1408
|
for (const panel of data.panels) {
|
|
1402
1409
|
wrapper.appendChild(
|
|
1403
|
-
|
|
1410
|
+
chunkMZCAYJ7H_cjs.createEl(
|
|
1404
1411
|
doc,
|
|
1405
1412
|
"div",
|
|
1406
1413
|
`pptxv-extrusion-3d-panel pptxv-extrusion-3d-panel--${panel.side}`,
|
|
@@ -1410,7 +1417,7 @@ function renderExtrusionOverlay(doc, element) {
|
|
|
1410
1417
|
}
|
|
1411
1418
|
if (data.materialOverlay) {
|
|
1412
1419
|
wrapper.appendChild(
|
|
1413
|
-
|
|
1420
|
+
chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-extrusion-3d-material", {
|
|
1414
1421
|
position: "absolute",
|
|
1415
1422
|
inset: 0,
|
|
1416
1423
|
backgroundImage: data.materialOverlay,
|
|
@@ -1448,18 +1455,18 @@ function appendOwnReflection(doc, host, element, mediaDataUrls, suppressOwnRefle
|
|
|
1448
1455
|
if (suppressOwnReflection) {
|
|
1449
1456
|
return;
|
|
1450
1457
|
}
|
|
1451
|
-
const wrapperStyle =
|
|
1458
|
+
const wrapperStyle = chunkHTFYAGHG_cjs.getComputedEffectStyle(element).reflection;
|
|
1452
1459
|
if (!wrapperStyle) {
|
|
1453
1460
|
return;
|
|
1454
1461
|
}
|
|
1455
|
-
const layer =
|
|
1462
|
+
const layer = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-reflection", { ...wrapperStyle });
|
|
1456
1463
|
layer.setAttribute("aria-hidden", "true");
|
|
1457
1464
|
layer.appendChild(buildReflectionMirrorContent(doc, element, mediaDataUrls, void 0, true));
|
|
1458
1465
|
host.appendChild(layer);
|
|
1459
1466
|
}
|
|
1460
1467
|
function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFill, suppressOwnReflection = false) {
|
|
1461
1468
|
if (element.type === "group") {
|
|
1462
|
-
const wrap =
|
|
1469
|
+
const wrap = chunkMZCAYJ7H_cjs.createEl(doc, "div", void 0, {
|
|
1463
1470
|
position: "relative",
|
|
1464
1471
|
width: "100%",
|
|
1465
1472
|
height: "100%",
|
|
@@ -1472,9 +1479,9 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1472
1479
|
if (groupFilterDefs) {
|
|
1473
1480
|
wrap.appendChild(groupFilterDefs);
|
|
1474
1481
|
}
|
|
1475
|
-
const childParentFill =
|
|
1482
|
+
const childParentFill = chunkCWBVJ4DC_cjs.getGroupChildParentFill(element, parentGroupFill);
|
|
1476
1483
|
for (const child of element.children ?? []) {
|
|
1477
|
-
const childWrap =
|
|
1484
|
+
const childWrap = chunkMZCAYJ7H_cjs.createEl(doc, "div", void 0, chunkCWBVJ4DC_cjs.getContainerStyle(child, 0));
|
|
1478
1485
|
childWrap.appendChild(
|
|
1479
1486
|
buildReflectionMirrorContent(doc, child, mediaDataUrls, childParentFill)
|
|
1480
1487
|
);
|
|
@@ -1483,12 +1490,12 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1483
1490
|
appendOwnReflection(doc, wrap, element, mediaDataUrls, suppressOwnReflection);
|
|
1484
1491
|
return wrap;
|
|
1485
1492
|
}
|
|
1486
|
-
const box =
|
|
1493
|
+
const box = chunkMZCAYJ7H_cjs.createEl(doc, "div", void 0, {
|
|
1487
1494
|
width: "100%",
|
|
1488
1495
|
height: "100%",
|
|
1489
1496
|
...getShapeFillStrokeStyle(element)
|
|
1490
1497
|
});
|
|
1491
|
-
const inheritedFill =
|
|
1498
|
+
const inheritedFill = chunkCWBVJ4DC_cjs.resolveGroupChildFill(element, parentGroupFill);
|
|
1492
1499
|
if (inheritedFill) {
|
|
1493
1500
|
applyInheritedFill(box, inheritedFill);
|
|
1494
1501
|
}
|
|
@@ -1513,12 +1520,12 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1513
1520
|
box.appendChild(gradientOutline);
|
|
1514
1521
|
}
|
|
1515
1522
|
if (pptx.isImageLikeElement(element)) {
|
|
1516
|
-
const src =
|
|
1523
|
+
const src = chunkCWBVJ4DC_cjs.getImageSrc(element, new Map(mediaDataUrls));
|
|
1517
1524
|
if (src) {
|
|
1518
|
-
const img =
|
|
1525
|
+
const img = chunkMZCAYJ7H_cjs.createEl(doc, "img", void 0, {
|
|
1519
1526
|
width: "100%",
|
|
1520
1527
|
height: "100%",
|
|
1521
|
-
...
|
|
1528
|
+
...chunkCWBVJ4DC_cjs.getImageFitStyle(element)
|
|
1522
1529
|
});
|
|
1523
1530
|
img.setAttribute("src", src);
|
|
1524
1531
|
img.setAttribute("alt", "");
|
|
@@ -1528,7 +1535,7 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1528
1535
|
appendOwnReflection(doc, box, element, mediaDataUrls, suppressOwnReflection);
|
|
1529
1536
|
return box;
|
|
1530
1537
|
}
|
|
1531
|
-
const paragraphs =
|
|
1538
|
+
const paragraphs = chunkCWBVJ4DC_cjs.buildParagraphs(element);
|
|
1532
1539
|
const hasText = paragraphs.some((p) => p.runs.length > 0 || p.bulletMarker !== void 0);
|
|
1533
1540
|
if (hasText) {
|
|
1534
1541
|
box.appendChild(renderTextBlock(doc, paragraphs, getTextBlockStyle(element)));
|
|
@@ -1540,29 +1547,29 @@ function buildReflectionMirrorContent(doc, element, mediaDataUrls, parentGroupFi
|
|
|
1540
1547
|
// src/pptx/dom/elements/shape-filter-defs.ts
|
|
1541
1548
|
var OUTLINE_SVG_STYLE = "position:absolute;inset:0;width:100%;height:100%;min-width:1px;min-height:1px;overflow:visible;pointer-events:none";
|
|
1542
1549
|
function renderShapeFilterDefs(doc, element) {
|
|
1543
|
-
const style =
|
|
1550
|
+
const style = chunkHTFYAGHG_cjs.getEffectStyleSource(element);
|
|
1544
1551
|
if (!style) {
|
|
1545
1552
|
return null;
|
|
1546
1553
|
}
|
|
1547
1554
|
const markups = [];
|
|
1548
|
-
const duotone =
|
|
1555
|
+
const duotone = chunkHTFYAGHG_cjs.getDuotoneSvgFilter(style, element.id);
|
|
1549
1556
|
if (duotone) {
|
|
1550
1557
|
markups.push(duotone.filterMarkup);
|
|
1551
1558
|
}
|
|
1552
|
-
const effectDefs =
|
|
1559
|
+
const effectDefs = chunkHTFYAGHG_cjs.getShapeEffectFilterDefs(element);
|
|
1553
1560
|
if (effectDefs) {
|
|
1554
1561
|
markups.push(effectDefs.filterMarkup);
|
|
1555
1562
|
}
|
|
1556
|
-
const bevelLighting =
|
|
1563
|
+
const bevelLighting = chunkCWBVJ4DC_cjs.getBevelLightingSvgFilter(element);
|
|
1557
1564
|
if (bevelLighting) {
|
|
1558
1565
|
markups.push(bevelLighting.filterMarkup);
|
|
1559
1566
|
}
|
|
1560
1567
|
if (markups.length === 0) {
|
|
1561
1568
|
return null;
|
|
1562
1569
|
}
|
|
1563
|
-
const svg =
|
|
1570
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", { width: 0, height: 0, "aria-hidden": "true" });
|
|
1564
1571
|
svg.setAttribute("style", "position:absolute;width:0;height:0;overflow:hidden");
|
|
1565
|
-
const defs =
|
|
1572
|
+
const defs = chunkMZCAYJ7H_cjs.createSvgEl(doc, "defs");
|
|
1566
1573
|
defs.innerHTML = markups.join("");
|
|
1567
1574
|
svg.appendChild(defs);
|
|
1568
1575
|
return svg;
|
|
@@ -1571,11 +1578,11 @@ function renderShapeFillOverlay(doc, element) {
|
|
|
1571
1578
|
if (!pptx.hasShapeProperties(element)) {
|
|
1572
1579
|
return null;
|
|
1573
1580
|
}
|
|
1574
|
-
const overlay =
|
|
1581
|
+
const overlay = chunkHTFYAGHG_cjs.getComputedEffectStyle(element).fillOverlay;
|
|
1575
1582
|
if (!overlay) {
|
|
1576
1583
|
return null;
|
|
1577
1584
|
}
|
|
1578
|
-
const layer =
|
|
1585
|
+
const layer = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-fill-overlay", {
|
|
1579
1586
|
position: "absolute",
|
|
1580
1587
|
inset: 0,
|
|
1581
1588
|
background: overlay.color,
|
|
@@ -1586,27 +1593,27 @@ function renderShapeFillOverlay(doc, element) {
|
|
|
1586
1593
|
return layer;
|
|
1587
1594
|
}
|
|
1588
1595
|
function renderReflectionOverlay(doc, element, mediaDataUrls) {
|
|
1589
|
-
const wrapperStyle =
|
|
1596
|
+
const wrapperStyle = chunkHTFYAGHG_cjs.getComputedEffectStyle(element).reflection;
|
|
1590
1597
|
if (!wrapperStyle) {
|
|
1591
1598
|
return null;
|
|
1592
1599
|
}
|
|
1593
|
-
const layer =
|
|
1600
|
+
const layer = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-reflection", { ...wrapperStyle });
|
|
1594
1601
|
layer.setAttribute("aria-hidden", "true");
|
|
1595
1602
|
layer.appendChild(buildReflectionMirrorContent(doc, element, mediaDataUrls, void 0, true));
|
|
1596
1603
|
return layer;
|
|
1597
1604
|
}
|
|
1598
1605
|
function renderHollowHitOutline(doc, element) {
|
|
1599
|
-
const hit =
|
|
1606
|
+
const hit = chunkCWBVJ4DC_cjs.buildHollowHitOutline(element);
|
|
1600
1607
|
if (!hit) {
|
|
1601
1608
|
return null;
|
|
1602
1609
|
}
|
|
1603
|
-
const svg =
|
|
1610
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", {
|
|
1604
1611
|
"aria-hidden": "true",
|
|
1605
|
-
viewBox:
|
|
1612
|
+
viewBox: chunkHTFYAGHG_cjs.strokeOutlineViewBox(element),
|
|
1606
1613
|
preserveAspectRatio: "none"
|
|
1607
1614
|
});
|
|
1608
1615
|
svg.setAttribute("style", OUTLINE_SVG_STYLE);
|
|
1609
|
-
const path =
|
|
1616
|
+
const path = chunkMZCAYJ7H_cjs.createSvgEl(doc, "path", {
|
|
1610
1617
|
d: hit.d,
|
|
1611
1618
|
fill: hit.fill,
|
|
1612
1619
|
stroke: hit.stroke,
|
|
@@ -1615,27 +1622,27 @@ function renderHollowHitOutline(doc, element) {
|
|
|
1615
1622
|
path.setAttribute("style", `pointer-events:${hit.pointerEvents}`);
|
|
1616
1623
|
svg.appendChild(path);
|
|
1617
1624
|
if (hit.textCss) {
|
|
1618
|
-
const style =
|
|
1625
|
+
const style = chunkMZCAYJ7H_cjs.createSvgEl(doc, "style", {});
|
|
1619
1626
|
style.textContent = hit.textCss;
|
|
1620
1627
|
svg.appendChild(style);
|
|
1621
1628
|
}
|
|
1622
1629
|
return svg;
|
|
1623
1630
|
}
|
|
1624
1631
|
function renderShapeFillLayer(doc, element) {
|
|
1625
|
-
const layer =
|
|
1632
|
+
const layer = chunkCWBVJ4DC_cjs.getSilhouetteFillLayer(element);
|
|
1626
1633
|
if (!layer) {
|
|
1627
1634
|
return null;
|
|
1628
1635
|
}
|
|
1629
|
-
const div =
|
|
1636
|
+
const div = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptx-vanilla-silhouette-fill", { ...layer.style });
|
|
1630
1637
|
div.setAttribute("aria-hidden", "true");
|
|
1631
1638
|
return div;
|
|
1632
1639
|
}
|
|
1633
1640
|
function renderShapeSubpathFillOverlay(doc, element) {
|
|
1634
|
-
const overlay =
|
|
1641
|
+
const overlay = chunkHTFYAGHG_cjs.buildSubpathFillOverlay(element);
|
|
1635
1642
|
if (!overlay) {
|
|
1636
1643
|
return null;
|
|
1637
1644
|
}
|
|
1638
|
-
const svg =
|
|
1645
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", {
|
|
1639
1646
|
class: "pptx-vanilla-subpath-fill",
|
|
1640
1647
|
"aria-hidden": "true",
|
|
1641
1648
|
viewBox: `0 0 ${overlay.viewBoxWidth} ${overlay.viewBoxHeight}`,
|
|
@@ -1646,34 +1653,34 @@ function renderShapeSubpathFillOverlay(doc, element) {
|
|
|
1646
1653
|
svg.setAttribute("data-pptx-silhouette-fill", "");
|
|
1647
1654
|
}
|
|
1648
1655
|
for (const paint of overlay.paints) {
|
|
1649
|
-
const path =
|
|
1656
|
+
const path = chunkMZCAYJ7H_cjs.createSvgEl(doc, "path", { d: paint.d, fill: paint.fill, stroke: "none" });
|
|
1650
1657
|
svg.appendChild(path);
|
|
1651
1658
|
}
|
|
1652
1659
|
return svg;
|
|
1653
1660
|
}
|
|
1654
1661
|
function renderStrokeOutline(doc, element) {
|
|
1655
|
-
const outline =
|
|
1662
|
+
const outline = chunkHTFYAGHG_cjs.buildStrokeOutline(element);
|
|
1656
1663
|
if (!outline) {
|
|
1657
1664
|
return null;
|
|
1658
1665
|
}
|
|
1659
|
-
const svg =
|
|
1666
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", {
|
|
1660
1667
|
class: "pptx-vanilla-gradient-outline",
|
|
1661
1668
|
"data-pptx-outline": "",
|
|
1662
1669
|
"aria-hidden": "true",
|
|
1663
|
-
viewBox:
|
|
1670
|
+
viewBox: chunkHTFYAGHG_cjs.strokeOutlineViewBox(element),
|
|
1664
1671
|
preserveAspectRatio: "none"
|
|
1665
1672
|
});
|
|
1666
1673
|
svg.setAttribute("style", OUTLINE_SVG_STYLE);
|
|
1667
1674
|
if (outline.paint) {
|
|
1668
|
-
const defs =
|
|
1669
|
-
if (
|
|
1670
|
-
const pattern =
|
|
1675
|
+
const defs = chunkMZCAYJ7H_cjs.createSvgEl(doc, "defs");
|
|
1676
|
+
if (chunkHTFYAGHG_cjs.isPatternPaint(outline.paint)) {
|
|
1677
|
+
const pattern = chunkMZCAYJ7H_cjs.createSvgEl(doc, "pattern", {
|
|
1671
1678
|
id: outline.paint.id,
|
|
1672
1679
|
width: outline.paint.width,
|
|
1673
1680
|
height: outline.paint.height,
|
|
1674
1681
|
patternUnits: "userSpaceOnUse"
|
|
1675
1682
|
});
|
|
1676
|
-
const image =
|
|
1683
|
+
const image = chunkMZCAYJ7H_cjs.createSvgEl(doc, "image", {
|
|
1677
1684
|
href: outline.paint.href,
|
|
1678
1685
|
width: outline.paint.width,
|
|
1679
1686
|
height: outline.paint.height
|
|
@@ -1681,12 +1688,12 @@ function renderStrokeOutline(doc, element) {
|
|
|
1681
1688
|
pattern.appendChild(image);
|
|
1682
1689
|
defs.appendChild(pattern);
|
|
1683
1690
|
} else {
|
|
1684
|
-
defs.innerHTML =
|
|
1691
|
+
defs.innerHTML = chunkHTFYAGHG_cjs.svgGradientMarkup(outline.paint);
|
|
1685
1692
|
}
|
|
1686
1693
|
svg.appendChild(defs);
|
|
1687
1694
|
}
|
|
1688
1695
|
for (const strand of outline.strands) {
|
|
1689
|
-
const path =
|
|
1696
|
+
const path = chunkMZCAYJ7H_cjs.createSvgEl(doc, "path", {
|
|
1690
1697
|
d: strand.d ?? outline.d,
|
|
1691
1698
|
fill: "none",
|
|
1692
1699
|
stroke: outline.stroke,
|
|
@@ -1707,7 +1714,7 @@ function renderStrokeOutline(doc, element) {
|
|
|
1707
1714
|
svg.appendChild(path);
|
|
1708
1715
|
}
|
|
1709
1716
|
if (outline.markers) {
|
|
1710
|
-
const defs =
|
|
1717
|
+
const defs = chunkMZCAYJ7H_cjs.createSvgEl(doc, "defs");
|
|
1711
1718
|
defs.innerHTML = outline.markers.markup;
|
|
1712
1719
|
svg.prepend(defs);
|
|
1713
1720
|
const path = svg.querySelector(":scope > path");
|
|
@@ -1743,14 +1750,14 @@ function indexRenderedNodes(root) {
|
|
|
1743
1750
|
return byId;
|
|
1744
1751
|
}
|
|
1745
1752
|
function paintInheritedFill(node, element, parentGroupFill) {
|
|
1746
|
-
const inherited =
|
|
1753
|
+
const inherited = chunkCWBVJ4DC_cjs.resolveGroupChildFill(element, parentGroupFill);
|
|
1747
1754
|
if (inherited) {
|
|
1748
1755
|
applyGroupChildFill(node, inherited);
|
|
1749
1756
|
}
|
|
1750
1757
|
if (element.type !== "group") {
|
|
1751
1758
|
return;
|
|
1752
1759
|
}
|
|
1753
|
-
const childFill =
|
|
1760
|
+
const childFill = chunkCWBVJ4DC_cjs.getGroupChildParentFill(element, parentGroupFill);
|
|
1754
1761
|
if (!childFill) {
|
|
1755
1762
|
return;
|
|
1756
1763
|
}
|
|
@@ -1763,8 +1770,8 @@ function paintInheritedFill(node, element, parentGroupFill) {
|
|
|
1763
1770
|
}
|
|
1764
1771
|
}
|
|
1765
1772
|
var renderGroupElement = (element, zIndex, context) => {
|
|
1766
|
-
const el =
|
|
1767
|
-
...
|
|
1773
|
+
const el = chunkMZCAYJ7H_cjs.createEl(context.document, "div", "pptxv-element pptxv-group", {
|
|
1774
|
+
...chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex),
|
|
1768
1775
|
// A group paints no fill/outline of its own, but `p:grpSpPr/a:effectLst`
|
|
1769
1776
|
// DOES carry a shadow/glow/soft-edge for the group's own composite
|
|
1770
1777
|
// raster (see shared `getComputedEffectStyle`), expressed as `filter` /
|
|
@@ -1781,7 +1788,7 @@ var renderGroupElement = (element, zIndex, context) => {
|
|
|
1781
1788
|
el.appendChild(reflection);
|
|
1782
1789
|
}
|
|
1783
1790
|
if (element.type === "group" && element.children?.length) {
|
|
1784
|
-
const parentGroupFill =
|
|
1791
|
+
const parentGroupFill = chunkCWBVJ4DC_cjs.getGroupChildParentFill(element);
|
|
1785
1792
|
element.children.forEach((child, index) => {
|
|
1786
1793
|
const childEl = context.renderElement(child, index);
|
|
1787
1794
|
if (childEl) {
|
|
@@ -1796,20 +1803,20 @@ var renderGroupElement = (element, zIndex, context) => {
|
|
|
1796
1803
|
// src/pptx/dom/elements/image.ts
|
|
1797
1804
|
var renderImageElement = (element, zIndex, context) => {
|
|
1798
1805
|
const doc = context.document;
|
|
1799
|
-
const geometry = element.type === "image" || element.type === "picture" ?
|
|
1806
|
+
const geometry = element.type === "image" || element.type === "picture" ? chunkCWBVJ4DC_cjs.resolveShapeGeometry(element) : void 0;
|
|
1800
1807
|
const geometryClipPath = geometry?.kind === "clipPath" ? geometry.clipPath : void 0;
|
|
1801
|
-
const cropShapeClipPath = element.type === "image" || element.type === "picture" ?
|
|
1802
|
-
const layers =
|
|
1803
|
-
overflow:
|
|
1808
|
+
const cropShapeClipPath = element.type === "image" || element.type === "picture" ? chunkCWBVJ4DC_cjs.getCropShapeClipPath(element.cropShape, element.width, element.height) : void 0;
|
|
1809
|
+
const layers = chunkCWBVJ4DC_cjs.getPictureFrameLayers(element, {
|
|
1810
|
+
overflow: chunkCWBVJ4DC_cjs.getImageOverflow(element),
|
|
1804
1811
|
borderRadius: geometry?.kind === "borderRadius" ? geometry.radius : void 0,
|
|
1805
1812
|
clipPath: geometryClipPath ?? cropShapeClipPath
|
|
1806
1813
|
});
|
|
1807
|
-
const el =
|
|
1808
|
-
...
|
|
1814
|
+
const el = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-element pptxv-image", {
|
|
1815
|
+
...chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex),
|
|
1809
1816
|
...layers.box
|
|
1810
1817
|
});
|
|
1811
1818
|
el.dataset.elementId = element.id;
|
|
1812
|
-
const surface = layers.surface ?
|
|
1819
|
+
const surface = layers.surface ? chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-image-surface", layers.surface) : el;
|
|
1813
1820
|
if (surface !== el) {
|
|
1814
1821
|
el.appendChild(surface);
|
|
1815
1822
|
const outline = renderStrokeOutline(doc, element);
|
|
@@ -1817,36 +1824,36 @@ var renderImageElement = (element, zIndex, context) => {
|
|
|
1817
1824
|
el.appendChild(outline);
|
|
1818
1825
|
}
|
|
1819
1826
|
}
|
|
1820
|
-
const src =
|
|
1827
|
+
const src = chunkCWBVJ4DC_cjs.getImageSrc(element, new Map(context.mediaDataUrls));
|
|
1821
1828
|
if (!src) {
|
|
1822
1829
|
return el;
|
|
1823
1830
|
}
|
|
1824
|
-
const fx =
|
|
1831
|
+
const fx = chunkCWBVJ4DC_cjs.getComputedImageStyle(element);
|
|
1825
1832
|
for (const f of fx.svgFilters) {
|
|
1826
|
-
const svg =
|
|
1833
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", { width: 0, height: 0, "aria-hidden": "true" });
|
|
1827
1834
|
svg.setAttribute("style", "position:absolute;width:0;height:0;overflow:hidden");
|
|
1828
|
-
const defs =
|
|
1829
|
-
const filter =
|
|
1830
|
-
|
|
1835
|
+
const defs = chunkMZCAYJ7H_cjs.createSvgEl(doc, "defs");
|
|
1836
|
+
const filter = chunkMZCAYJ7H_cjs.createSvgEl(doc, "filter");
|
|
1837
|
+
chunkMZCAYJ7H_cjs.setSvgAttrs(filter, { id: f.id, "color-interpolation-filters": "sRGB" });
|
|
1831
1838
|
filter.innerHTML = f.markup;
|
|
1832
1839
|
defs.appendChild(filter);
|
|
1833
1840
|
svg.appendChild(defs);
|
|
1834
1841
|
surface.appendChild(svg);
|
|
1835
1842
|
}
|
|
1836
1843
|
const reflection = renderReflectionOverlay(doc, element, context.mediaDataUrls);
|
|
1837
|
-
const tiling =
|
|
1844
|
+
const tiling = chunkCWBVJ4DC_cjs.getImageTilingStyle(element, chunkCWBVJ4DC_cjs.getCachedNativeImageSize(src));
|
|
1838
1845
|
if (tiling) {
|
|
1839
|
-
const tile =
|
|
1846
|
+
const tile = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-image-tile", tiling);
|
|
1840
1847
|
if (fx.filter) {
|
|
1841
1848
|
tile.style.filter = fx.filter;
|
|
1842
1849
|
}
|
|
1843
1850
|
if (fx.opacity !== void 0) {
|
|
1844
1851
|
tile.style.opacity = String(fx.opacity);
|
|
1845
1852
|
}
|
|
1846
|
-
if (!
|
|
1847
|
-
void
|
|
1853
|
+
if (!chunkCWBVJ4DC_cjs.getCachedNativeImageSize(src)) {
|
|
1854
|
+
void chunkCWBVJ4DC_cjs.probeNativeImageSize(src).then((size) => {
|
|
1848
1855
|
if (size) {
|
|
1849
|
-
|
|
1856
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(tile, chunkCWBVJ4DC_cjs.getImageTilingStyle(element, size) ?? {});
|
|
1850
1857
|
}
|
|
1851
1858
|
return void 0;
|
|
1852
1859
|
});
|
|
@@ -1857,9 +1864,9 @@ var renderImageElement = (element, zIndex, context) => {
|
|
|
1857
1864
|
}
|
|
1858
1865
|
return el;
|
|
1859
1866
|
}
|
|
1860
|
-
const fit =
|
|
1861
|
-
const fillCounterTransform =
|
|
1862
|
-
const img =
|
|
1867
|
+
const fit = chunkCWBVJ4DC_cjs.getImageFitStyle(element);
|
|
1868
|
+
const fillCounterTransform = chunkCWBVJ4DC_cjs.getImageFillCounterTransform(element, Boolean(fit.transform));
|
|
1869
|
+
const img = chunkMZCAYJ7H_cjs.createEl(doc, "img", void 0, {
|
|
1863
1870
|
...fit,
|
|
1864
1871
|
display: "block",
|
|
1865
1872
|
...fillCounterTransform ? { transform: fillCounterTransform, transformOrigin: "center" } : {}
|
|
@@ -1877,17 +1884,17 @@ var renderImageElement = (element, zIndex, context) => {
|
|
|
1877
1884
|
if (element.type === "image" || element.type === "picture") {
|
|
1878
1885
|
const clrChange = element.imageEffects?.clrChange;
|
|
1879
1886
|
if (clrChange) {
|
|
1880
|
-
void
|
|
1887
|
+
void chunkCWBVJ4DC_cjs.resolveColorChangedImageSource(src, clrChange).then((resolved) => {
|
|
1881
1888
|
if (img.src === src || img.getAttribute("src") === src) {
|
|
1882
1889
|
img.src = resolved;
|
|
1883
1890
|
}
|
|
1884
1891
|
return void 0;
|
|
1885
1892
|
});
|
|
1886
1893
|
}
|
|
1887
|
-
const wash =
|
|
1894
|
+
const wash = chunkCWBVJ4DC_cjs.getImageColorWashStyle(element.imageEffects?.colorWash);
|
|
1888
1895
|
if (wash) {
|
|
1889
1896
|
surface.appendChild(
|
|
1890
|
-
|
|
1897
|
+
chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-image-color-wash", {
|
|
1891
1898
|
position: "absolute",
|
|
1892
1899
|
inset: "0",
|
|
1893
1900
|
pointerEvents: "none",
|
|
@@ -1909,11 +1916,11 @@ var renderInkElement = (element, zIndex, context) => {
|
|
|
1909
1916
|
return null;
|
|
1910
1917
|
}
|
|
1911
1918
|
const doc = context.document;
|
|
1912
|
-
const wrapper =
|
|
1919
|
+
const wrapper = chunkMZCAYJ7H_cjs.createEl(
|
|
1913
1920
|
doc,
|
|
1914
1921
|
"div",
|
|
1915
1922
|
"pptxv-element pptxv-ink",
|
|
1916
|
-
|
|
1923
|
+
chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex)
|
|
1917
1924
|
);
|
|
1918
1925
|
wrapper.dataset.elementId = element.id;
|
|
1919
1926
|
const paths = element.inkPaths;
|
|
@@ -1922,7 +1929,7 @@ var renderInkElement = (element, zIndex, context) => {
|
|
|
1922
1929
|
}
|
|
1923
1930
|
const w = Math.max(element.width, 1);
|
|
1924
1931
|
const h = Math.max(element.height, 1);
|
|
1925
|
-
const svg =
|
|
1932
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", {
|
|
1926
1933
|
viewBox: `0 0 ${w} ${h}`,
|
|
1927
1934
|
preserveAspectRatio: "none"
|
|
1928
1935
|
});
|
|
@@ -1930,11 +1937,11 @@ var renderInkElement = (element, zIndex, context) => {
|
|
|
1930
1937
|
svg.setAttribute("style", "width:100%;height:100%;pointer-events:none;display:block");
|
|
1931
1938
|
const replayStyles = context.presenting ? chunkNTXHQHCS_cjs.getInkReplayStyles(element) : [];
|
|
1932
1939
|
if (context.presenting) {
|
|
1933
|
-
const keyframes =
|
|
1940
|
+
const keyframes = chunkMZCAYJ7H_cjs.createSvgEl(doc, "style");
|
|
1934
1941
|
keyframes.textContent = chunkNTXHQHCS_cjs.INK_REPLAY_KEYFRAMES;
|
|
1935
1942
|
svg.appendChild(keyframes);
|
|
1936
1943
|
}
|
|
1937
|
-
const views =
|
|
1944
|
+
const views = chunkCWBVJ4DC_cjs.buildInkGroupStrokes(element, { color: chunkHTFYAGHG_cjs.DEFAULT_STROKE_COLOR, width: 1 });
|
|
1938
1945
|
for (const [i, view] of views.entries()) {
|
|
1939
1946
|
svg.appendChild(buildStrokeSvg(doc, view, replayStyles[i]));
|
|
1940
1947
|
}
|
|
@@ -1957,7 +1964,7 @@ function mediaFullscreenResetStyle(baseStyle) {
|
|
|
1957
1964
|
};
|
|
1958
1965
|
}
|
|
1959
1966
|
function buildFullscreenStopButton(doc, label, onStop) {
|
|
1960
|
-
const button =
|
|
1967
|
+
const button = chunkMZCAYJ7H_cjs.createEl(doc, "button", "pptxv-media-fullscreen-stop", {
|
|
1961
1968
|
position: "absolute",
|
|
1962
1969
|
bottom: "12px",
|
|
1963
1970
|
right: "12px",
|
|
@@ -1973,14 +1980,14 @@ function buildFullscreenStopButton(doc, label, onStop) {
|
|
|
1973
1980
|
button.type = "button";
|
|
1974
1981
|
button.setAttribute("aria-label", label);
|
|
1975
1982
|
button.addEventListener("click", onStop);
|
|
1976
|
-
const icon =
|
|
1983
|
+
const icon = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", {
|
|
1977
1984
|
width: 18,
|
|
1978
1985
|
height: 18,
|
|
1979
1986
|
viewBox: "0 0 24 24",
|
|
1980
1987
|
fill: "currentColor",
|
|
1981
1988
|
stroke: "none"
|
|
1982
1989
|
});
|
|
1983
|
-
icon.appendChild(
|
|
1990
|
+
icon.appendChild(chunkMZCAYJ7H_cjs.createSvgEl(doc, "rect", { x: 6, y: 6, width: 12, height: 12, rx: 1 }));
|
|
1984
1991
|
button.appendChild(icon);
|
|
1985
1992
|
return button;
|
|
1986
1993
|
}
|
|
@@ -1988,12 +1995,12 @@ function wireMediaFullscreenOverlay(doc, container, mediaNode, element, context,
|
|
|
1988
1995
|
let stopButton = null;
|
|
1989
1996
|
const update = (playing) => {
|
|
1990
1997
|
const input = { fullScreen: element.fullScreen, presenting: context.presenting, playing };
|
|
1991
|
-
const active =
|
|
1992
|
-
|
|
1998
|
+
const active = chunkCWBVJ4DC_cjs.isMediaFullscreenActive(input);
|
|
1999
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(
|
|
1993
2000
|
container,
|
|
1994
|
-
active ?
|
|
2001
|
+
active ? chunkCWBVJ4DC_cjs.MEDIA_FULLSCREEN_OVERLAY_STYLE : mediaFullscreenResetStyle(baseStyle)
|
|
1995
2002
|
);
|
|
1996
|
-
if (
|
|
2003
|
+
if (chunkCWBVJ4DC_cjs.shouldShowMediaFullscreenStopButton(input)) {
|
|
1997
2004
|
if (!stopButton) {
|
|
1998
2005
|
stopButton = buildFullscreenStopButton(
|
|
1999
2006
|
doc,
|
|
@@ -2018,12 +2025,12 @@ function wireMediaFullscreenOverlay(doc, container, mediaNode, element, context,
|
|
|
2018
2025
|
|
|
2019
2026
|
// src/pptx/dom/elements/media.ts
|
|
2020
2027
|
function applyMediaPresentingState(el, presenting, playback) {
|
|
2021
|
-
|
|
2028
|
+
chunkCWBVJ4DC_cjs.applyMediaPlaybackAttributes(el, playback);
|
|
2022
2029
|
if (presenting) {
|
|
2023
|
-
|
|
2024
|
-
|
|
2030
|
+
chunkCWBVJ4DC_cjs.startMediaAutoplay(el, { trimStartMs: playback.trimStartMs });
|
|
2031
|
+
chunkCWBVJ4DC_cjs.scheduleMediaTrimAndFade(el, {
|
|
2025
2032
|
...playback,
|
|
2026
|
-
volume:
|
|
2033
|
+
volume: chunkCWBVJ4DC_cjs.mediaPlaybackAttributes(playback).volume
|
|
2027
2034
|
});
|
|
2028
2035
|
} else if (!el.paused) {
|
|
2029
2036
|
el.pause();
|
|
@@ -2033,31 +2040,31 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2033
2040
|
if (element.type !== "media") {
|
|
2034
2041
|
return null;
|
|
2035
2042
|
}
|
|
2036
|
-
const surface =
|
|
2043
|
+
const surface = chunkCWBVJ4DC_cjs.mediaSurfaceOf({
|
|
2037
2044
|
interactive: context.interactive === true || context.reading === true,
|
|
2038
2045
|
presenting: context.presenting
|
|
2039
2046
|
});
|
|
2040
|
-
const showTransport =
|
|
2047
|
+
const showTransport = chunkCWBVJ4DC_cjs.mediaTransportVisible({
|
|
2041
2048
|
...surface,
|
|
2042
2049
|
canvasTransport: context.reading === true
|
|
2043
2050
|
});
|
|
2044
2051
|
const attachAuthoringBar = (host, media) => {
|
|
2045
|
-
if (
|
|
2046
|
-
|
|
2052
|
+
if (chunkCWBVJ4DC_cjs.mediaControlBarEnabled({ ...surface, reading: context.reading === true })) {
|
|
2053
|
+
chunkCWBVJ4DC_cjs.attachMediaControlBar(host, media, {
|
|
2047
2054
|
t: context.t,
|
|
2048
2055
|
selected: context.selectedElementIds?.has(element.id) === true
|
|
2049
2056
|
});
|
|
2050
2057
|
}
|
|
2051
2058
|
};
|
|
2052
2059
|
const doc = context.document;
|
|
2053
|
-
const baseStyle =
|
|
2054
|
-
const el =
|
|
2060
|
+
const baseStyle = chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex);
|
|
2061
|
+
const el = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-element pptxv-media", baseStyle);
|
|
2055
2062
|
el.dataset.elementId = element.id;
|
|
2056
2063
|
const mediaSrc = element.mediaData ?? (element.mediaPath ? context.mediaDataUrls.get(element.mediaPath) : void 0);
|
|
2057
|
-
const posterSrc =
|
|
2058
|
-
const onlineVideoEmbedUrl =
|
|
2064
|
+
const posterSrc = chunkCWBVJ4DC_cjs.getImageSrc(element, new Map(context.mediaDataUrls));
|
|
2065
|
+
const onlineVideoEmbedUrl = chunkCWBVJ4DC_cjs.getOnlineVideoEmbed(element)?.embedUrl;
|
|
2059
2066
|
if (onlineVideoEmbedUrl && element.mediaType === "video") {
|
|
2060
|
-
const iframe =
|
|
2067
|
+
const iframe = chunkMZCAYJ7H_cjs.createEl(doc, "iframe", "pptxv-media-video pptxv-media-iframe", {
|
|
2061
2068
|
width: "100%",
|
|
2062
2069
|
height: "100%",
|
|
2063
2070
|
border: "0",
|
|
@@ -2065,14 +2072,14 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2065
2072
|
});
|
|
2066
2073
|
iframe.src = onlineVideoEmbedUrl;
|
|
2067
2074
|
iframe.title = context.t("pptx.media.onlineVideoTitle");
|
|
2068
|
-
iframe.allow =
|
|
2069
|
-
iframe.sandbox.value =
|
|
2075
|
+
iframe.allow = chunkCWBVJ4DC_cjs.ONLINE_VIDEO_IFRAME_ALLOW;
|
|
2076
|
+
iframe.sandbox.value = chunkCWBVJ4DC_cjs.ONLINE_VIDEO_IFRAME_SANDBOX;
|
|
2070
2077
|
iframe.allowFullscreen = true;
|
|
2071
2078
|
el.appendChild(iframe);
|
|
2072
2079
|
return el;
|
|
2073
2080
|
}
|
|
2074
2081
|
if (mediaSrc && element.mediaType === "video") {
|
|
2075
|
-
const video =
|
|
2082
|
+
const video = chunkMZCAYJ7H_cjs.createEl(doc, "video", "pptxv-media-video", {
|
|
2076
2083
|
width: "100%",
|
|
2077
2084
|
height: "100%",
|
|
2078
2085
|
objectFit: "contain",
|
|
@@ -2092,13 +2099,13 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2092
2099
|
return el;
|
|
2093
2100
|
}
|
|
2094
2101
|
if (mediaSrc && element.mediaType === "audio") {
|
|
2095
|
-
const audio =
|
|
2102
|
+
const audio = chunkMZCAYJ7H_cjs.createEl(doc, "audio", "pptxv-media-audio", { width: "100%" });
|
|
2096
2103
|
audio.src = mediaSrc;
|
|
2097
2104
|
audio.controls = showTransport;
|
|
2098
2105
|
el.appendChild(audio);
|
|
2099
|
-
if (context.presenting &&
|
|
2106
|
+
if (context.presenting && chunkCWBVJ4DC_cjs.registerCrossSlideAudio(element, mediaSrc)) {
|
|
2100
2107
|
audio.muted = true;
|
|
2101
|
-
|
|
2108
|
+
chunkCWBVJ4DC_cjs.applyMediaPlaybackAttributes(audio, element);
|
|
2102
2109
|
return el;
|
|
2103
2110
|
}
|
|
2104
2111
|
applyMediaPresentingState(audio, context.presenting, element);
|
|
@@ -2106,14 +2113,14 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2106
2113
|
wireMediaFullscreenOverlay(doc, el, audio, element, context, baseStyle);
|
|
2107
2114
|
return el;
|
|
2108
2115
|
}
|
|
2109
|
-
const fallback =
|
|
2116
|
+
const fallback = chunkCWBVJ4DC_cjs.mediaFallbackVisual(surface, {
|
|
2110
2117
|
hasPoster: Boolean(posterSrc),
|
|
2111
2118
|
missing: element.mediaMissing === true
|
|
2112
2119
|
});
|
|
2113
|
-
const icon =
|
|
2114
|
-
const labelKey =
|
|
2120
|
+
const icon = chunkCWBVJ4DC_cjs.mediaFallbackIcon(fallback, element.mediaType);
|
|
2121
|
+
const labelKey = chunkCWBVJ4DC_cjs.mediaFallbackLabelKey(fallback, element.mediaType);
|
|
2115
2122
|
if (fallback.poster && posterSrc) {
|
|
2116
|
-
const img =
|
|
2123
|
+
const img = chunkMZCAYJ7H_cjs.createEl(doc, "img", "pptxv-media-poster", {
|
|
2117
2124
|
width: "100%",
|
|
2118
2125
|
height: "100%",
|
|
2119
2126
|
objectFit: "contain",
|
|
@@ -2125,14 +2132,14 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2125
2132
|
img.setAttribute("draggable", "false");
|
|
2126
2133
|
el.appendChild(img);
|
|
2127
2134
|
if (fallback.badge !== "none") {
|
|
2128
|
-
const badge =
|
|
2135
|
+
const badge = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-media-badge");
|
|
2129
2136
|
if (fallback.badge === "missing") {
|
|
2130
2137
|
badge.classList.add("pptxv-media-badge-missing");
|
|
2131
2138
|
}
|
|
2132
|
-
badge.setAttribute(
|
|
2139
|
+
badge.setAttribute(chunkCWBVJ4DC_cjs.MEDIA_CHROME_ATTRIBUTE, fallback.badge);
|
|
2133
2140
|
badge.appendChild(buildIcon(doc, icon));
|
|
2134
2141
|
if (labelKey !== void 0 && fallback.badge === "missing") {
|
|
2135
|
-
const text =
|
|
2142
|
+
const text = chunkMZCAYJ7H_cjs.createEl(doc, "span");
|
|
2136
2143
|
text.textContent = context.t(labelKey);
|
|
2137
2144
|
badge.appendChild(text);
|
|
2138
2145
|
}
|
|
@@ -2142,12 +2149,12 @@ var renderMediaElement = (element, zIndex, context) => {
|
|
|
2142
2149
|
}
|
|
2143
2150
|
if (fallback.placeholder !== "none") {
|
|
2144
2151
|
el.classList.add("pptxv-placeholder", "pptxv-media-placeholder");
|
|
2145
|
-
el.setAttribute(
|
|
2152
|
+
el.setAttribute(chunkCWBVJ4DC_cjs.MEDIA_CHROME_ATTRIBUTE, fallback.placeholder);
|
|
2146
2153
|
if (icon.length > 0) {
|
|
2147
2154
|
el.appendChild(buildIcon(doc, icon));
|
|
2148
2155
|
}
|
|
2149
2156
|
if (labelKey !== void 0) {
|
|
2150
|
-
const label =
|
|
2157
|
+
const label = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-placeholder-label");
|
|
2151
2158
|
label.textContent = context.t(labelKey);
|
|
2152
2159
|
el.appendChild(label);
|
|
2153
2160
|
}
|
|
@@ -2174,11 +2181,11 @@ var renderModel3dElement = (element, zIndex, context) => {
|
|
|
2174
2181
|
return null;
|
|
2175
2182
|
}
|
|
2176
2183
|
const doc = context.document;
|
|
2177
|
-
const el =
|
|
2184
|
+
const el = chunkMZCAYJ7H_cjs.createEl(
|
|
2178
2185
|
doc,
|
|
2179
2186
|
"div",
|
|
2180
2187
|
"pptxv-element pptxv-model3d",
|
|
2181
|
-
|
|
2188
|
+
chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex)
|
|
2182
2189
|
);
|
|
2183
2190
|
el.dataset.elementId = element.id;
|
|
2184
2191
|
const label = context.t("pptx.model3d.label");
|
|
@@ -2191,7 +2198,7 @@ var renderModel3dElement = (element, zIndex, context) => {
|
|
|
2191
2198
|
return el;
|
|
2192
2199
|
};
|
|
2193
2200
|
function buildPoster(doc, src, alt) {
|
|
2194
|
-
const img =
|
|
2201
|
+
const img = chunkMZCAYJ7H_cjs.createEl(doc, "img", "pptxv-model3d-poster", {
|
|
2195
2202
|
width: "100%",
|
|
2196
2203
|
height: "100%",
|
|
2197
2204
|
objectFit: "contain",
|
|
@@ -2205,7 +2212,7 @@ function buildPoster(doc, src, alt) {
|
|
|
2205
2212
|
return img;
|
|
2206
2213
|
}
|
|
2207
2214
|
function buildPlaceholder(doc, label) {
|
|
2208
|
-
const box =
|
|
2215
|
+
const box = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-model3d-placeholder", {
|
|
2209
2216
|
width: "100%",
|
|
2210
2217
|
height: "100%",
|
|
2211
2218
|
display: "flex",
|
|
@@ -2219,7 +2226,7 @@ function buildPlaceholder(doc, label) {
|
|
|
2219
2226
|
borderRadius: "4px",
|
|
2220
2227
|
boxSizing: "border-box"
|
|
2221
2228
|
});
|
|
2222
|
-
const icon =
|
|
2229
|
+
const icon = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", {
|
|
2223
2230
|
width: 24,
|
|
2224
2231
|
height: 24,
|
|
2225
2232
|
viewBox: "0 0 24 24",
|
|
@@ -2232,20 +2239,20 @@ function buildPlaceholder(doc, label) {
|
|
|
2232
2239
|
icon.setAttribute("class", "pptxv-model3d-icon");
|
|
2233
2240
|
icon.setAttribute("style", "margin-bottom:4px;color:#d1d5db");
|
|
2234
2241
|
icon.appendChild(
|
|
2235
|
-
|
|
2242
|
+
chunkMZCAYJ7H_cjs.createSvgEl(doc, "path", {
|
|
2236
2243
|
d: "M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"
|
|
2237
2244
|
})
|
|
2238
2245
|
);
|
|
2239
|
-
icon.appendChild(
|
|
2240
|
-
icon.appendChild(
|
|
2246
|
+
icon.appendChild(chunkMZCAYJ7H_cjs.createSvgEl(doc, "polyline", { points: "3.27 6.96 12 12.01 20.73 6.96" }));
|
|
2247
|
+
icon.appendChild(chunkMZCAYJ7H_cjs.createSvgEl(doc, "line", { x1: 12, y1: 22.08, x2: 12, y2: 12 }));
|
|
2241
2248
|
box.appendChild(icon);
|
|
2242
|
-
const text =
|
|
2249
|
+
const text = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-model3d-label");
|
|
2243
2250
|
text.textContent = label;
|
|
2244
2251
|
box.appendChild(text);
|
|
2245
2252
|
return box;
|
|
2246
2253
|
}
|
|
2247
2254
|
function buildViewButton(doc, root, poster, element, context) {
|
|
2248
|
-
const button =
|
|
2255
|
+
const button = chunkMZCAYJ7H_cjs.createEl(doc, "button", "pptxv-model3d-view", {
|
|
2249
2256
|
position: "absolute",
|
|
2250
2257
|
bottom: "4px",
|
|
2251
2258
|
right: "4px",
|
|
@@ -2280,7 +2287,7 @@ function buildViewButton(doc, root, poster, element, context) {
|
|
|
2280
2287
|
button.remove();
|
|
2281
2288
|
return;
|
|
2282
2289
|
}
|
|
2283
|
-
const sceneHost =
|
|
2290
|
+
const sceneHost = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-model3d-scene", {
|
|
2284
2291
|
position: "absolute",
|
|
2285
2292
|
inset: 0,
|
|
2286
2293
|
willChange: "transform"
|
|
@@ -2308,15 +2315,15 @@ function buildViewButton(doc, root, poster, element, context) {
|
|
|
2308
2315
|
|
|
2309
2316
|
// src/pptx/dom/elements/ole-icons.ts
|
|
2310
2317
|
function buildOleIcon(doc, type, color) {
|
|
2311
|
-
const svg =
|
|
2318
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", {
|
|
2312
2319
|
width: 36,
|
|
2313
2320
|
height: 36,
|
|
2314
2321
|
viewBox: "0 0 24 24",
|
|
2315
2322
|
fill: "none",
|
|
2316
2323
|
"aria-hidden": "true"
|
|
2317
2324
|
});
|
|
2318
|
-
for (const shape of
|
|
2319
|
-
const node =
|
|
2325
|
+
for (const shape of chunkCWBVJ4DC_cjs.getOleIconShapes(type)) {
|
|
2326
|
+
const node = chunkMZCAYJ7H_cjs.createSvgEl(doc, shape.tag, shape.attrs);
|
|
2320
2327
|
if (shape.tag === "text") {
|
|
2321
2328
|
node.setAttribute("fill", color);
|
|
2322
2329
|
node.textContent = shape.text ?? "";
|
|
@@ -2334,21 +2341,21 @@ var renderOleElement = (element, zIndex, context) => {
|
|
|
2334
2341
|
return null;
|
|
2335
2342
|
}
|
|
2336
2343
|
const doc = context.document;
|
|
2337
|
-
const oleType =
|
|
2338
|
-
const typeColor =
|
|
2339
|
-
const typeLabel =
|
|
2340
|
-
const el =
|
|
2344
|
+
const oleType = chunkCWBVJ4DC_cjs.resolveOleType(element);
|
|
2345
|
+
const typeColor = chunkCWBVJ4DC_cjs.getOleTypeColor(oleType);
|
|
2346
|
+
const typeLabel = chunkCWBVJ4DC_cjs.getOleTypeLabel(oleType);
|
|
2347
|
+
const el = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-element pptxv-ole", chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex));
|
|
2341
2348
|
el.dataset.elementId = element.id;
|
|
2342
2349
|
el.setAttribute("role", "group");
|
|
2343
|
-
el.setAttribute("aria-label",
|
|
2350
|
+
el.setAttribute("aria-label", chunkCWBVJ4DC_cjs.getOleAriaLabel(element));
|
|
2344
2351
|
el.title = infoLines(element, typeLabel).join("\n");
|
|
2345
2352
|
if (element.previewImageData) {
|
|
2346
|
-
el.appendChild(buildPreview(doc, element, typeColor,
|
|
2353
|
+
el.appendChild(buildPreview(doc, element, typeColor, chunkCWBVJ4DC_cjs.getOleBadgeLabel(oleType)));
|
|
2347
2354
|
} else {
|
|
2348
2355
|
el.appendChild(buildPlaceholder2(doc, element, oleType, typeColor, typeLabel));
|
|
2349
2356
|
}
|
|
2350
|
-
const showActions =
|
|
2351
|
-
|
|
2357
|
+
const showActions = chunkCWBVJ4DC_cjs.oleActionsVisible(
|
|
2358
|
+
chunkCWBVJ4DC_cjs.mediaSurfaceOf({
|
|
2352
2359
|
interactive: context.interactive === true,
|
|
2353
2360
|
presenting: context.presenting
|
|
2354
2361
|
})
|
|
@@ -2382,7 +2389,7 @@ function infoLines(el, typeLabel) {
|
|
|
2382
2389
|
if (name) {
|
|
2383
2390
|
lines.push(name);
|
|
2384
2391
|
}
|
|
2385
|
-
const size =
|
|
2392
|
+
const size = chunkCWBVJ4DC_cjs.formatBytes(el.oleEmbeddedByteSize);
|
|
2386
2393
|
if (size) {
|
|
2387
2394
|
lines.push(size);
|
|
2388
2395
|
}
|
|
@@ -2392,12 +2399,12 @@ function infoLines(el, typeLabel) {
|
|
|
2392
2399
|
return lines;
|
|
2393
2400
|
}
|
|
2394
2401
|
function buildPreview(doc, el, typeColor, badgeLabel) {
|
|
2395
|
-
const preview =
|
|
2402
|
+
const preview = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-ole-preview", {
|
|
2396
2403
|
position: "relative",
|
|
2397
2404
|
width: "100%",
|
|
2398
2405
|
height: "100%"
|
|
2399
2406
|
});
|
|
2400
|
-
const img =
|
|
2407
|
+
const img = chunkMZCAYJ7H_cjs.createEl(doc, "img", "pptxv-ole-img", {
|
|
2401
2408
|
width: "100%",
|
|
2402
2409
|
height: "100%",
|
|
2403
2410
|
objectFit: "contain",
|
|
@@ -2406,19 +2413,19 @@ function buildPreview(doc, el, typeColor, badgeLabel) {
|
|
|
2406
2413
|
display: "block"
|
|
2407
2414
|
});
|
|
2408
2415
|
img.src = el.previewImageData ?? "";
|
|
2409
|
-
img.alt =
|
|
2416
|
+
img.alt = chunkCWBVJ4DC_cjs.getOleAriaLabel(el);
|
|
2410
2417
|
img.draggable = false;
|
|
2411
2418
|
preview.appendChild(img);
|
|
2412
|
-
const badge =
|
|
2419
|
+
const badge = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", { width: 24, height: 24, viewBox: "0 0 24 24" });
|
|
2413
2420
|
badge.setAttribute("class", "pptxv-ole-badge");
|
|
2414
2421
|
badge.setAttribute(
|
|
2415
2422
|
"style",
|
|
2416
2423
|
"position:absolute;bottom:4px;right:4px;z-index:10;pointer-events:none"
|
|
2417
2424
|
);
|
|
2418
2425
|
badge.appendChild(
|
|
2419
|
-
|
|
2426
|
+
chunkMZCAYJ7H_cjs.createSvgEl(doc, "rect", { x: 2, y: 2, width: 20, height: 20, rx: 3, fill: typeColor })
|
|
2420
2427
|
);
|
|
2421
|
-
const badgeText =
|
|
2428
|
+
const badgeText = chunkMZCAYJ7H_cjs.createSvgEl(doc, "text", {
|
|
2422
2429
|
x: 12,
|
|
2423
2430
|
y: 16,
|
|
2424
2431
|
"text-anchor": "middle",
|
|
@@ -2432,8 +2439,8 @@ function buildPreview(doc, el, typeColor, badgeLabel) {
|
|
|
2432
2439
|
return preview;
|
|
2433
2440
|
}
|
|
2434
2441
|
function buildPlaceholder2(doc, el, oleType, typeColor, typeLabel) {
|
|
2435
|
-
const box =
|
|
2436
|
-
...
|
|
2442
|
+
const box = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-ole-placeholder", {
|
|
2443
|
+
...chunkCWBVJ4DC_cjs.getPlaceholderStyle(oleType),
|
|
2437
2444
|
width: "100%",
|
|
2438
2445
|
height: "100%",
|
|
2439
2446
|
display: "flex",
|
|
@@ -2444,7 +2451,7 @@ function buildPlaceholder2(doc, el, oleType, typeColor, typeLabel) {
|
|
|
2444
2451
|
boxSizing: "border-box"
|
|
2445
2452
|
});
|
|
2446
2453
|
box.appendChild(buildOleIcon(doc, oleType, typeColor));
|
|
2447
|
-
const name =
|
|
2454
|
+
const name = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-ole-name", {
|
|
2448
2455
|
marginTop: "8px",
|
|
2449
2456
|
fontSize: "12px",
|
|
2450
2457
|
fontWeight: 500,
|
|
@@ -2454,10 +2461,10 @@ function buildPlaceholder2(doc, el, oleType, typeColor, typeLabel) {
|
|
|
2454
2461
|
whiteSpace: "nowrap",
|
|
2455
2462
|
color: typeColor
|
|
2456
2463
|
});
|
|
2457
|
-
name.textContent =
|
|
2464
|
+
name.textContent = chunkCWBVJ4DC_cjs.getOleDisplayName(el);
|
|
2458
2465
|
box.appendChild(name);
|
|
2459
2466
|
if (el.fileName) {
|
|
2460
|
-
const sublabel =
|
|
2467
|
+
const sublabel = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-ole-sublabel", {
|
|
2461
2468
|
marginTop: "2px",
|
|
2462
2469
|
fontSize: "10px",
|
|
2463
2470
|
color: "rgba(0,0,0,0.45)",
|
|
@@ -2487,7 +2494,7 @@ var ACTION_STYLE = {
|
|
|
2487
2494
|
function buildActionBar(doc, el, typeLabel, context) {
|
|
2488
2495
|
const data = el.oleEmbeddedData ?? "";
|
|
2489
2496
|
const downloadName = el.oleEmbeddedFileName ?? el.fileName ?? typeLabel;
|
|
2490
|
-
const bar =
|
|
2497
|
+
const bar = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-ole-actions", {
|
|
2491
2498
|
position: "absolute",
|
|
2492
2499
|
left: 0,
|
|
2493
2500
|
right: 0,
|
|
@@ -2506,9 +2513,9 @@ function buildActionBar(doc, el, typeLabel, context) {
|
|
|
2506
2513
|
for (const type of ["pointerdown", "mousedown", "click"]) {
|
|
2507
2514
|
bar.addEventListener(type, (event) => event.stopPropagation());
|
|
2508
2515
|
}
|
|
2509
|
-
const size =
|
|
2516
|
+
const size = chunkCWBVJ4DC_cjs.formatBytes(el.oleEmbeddedByteSize);
|
|
2510
2517
|
if (size) {
|
|
2511
|
-
const meta =
|
|
2518
|
+
const meta = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-ole-meta", {
|
|
2512
2519
|
marginRight: "auto",
|
|
2513
2520
|
color: "rgba(0,0,0,0.55)",
|
|
2514
2521
|
overflow: "hidden",
|
|
@@ -2518,7 +2525,7 @@ function buildActionBar(doc, el, typeLabel, context) {
|
|
|
2518
2525
|
meta.textContent = size;
|
|
2519
2526
|
bar.appendChild(meta);
|
|
2520
2527
|
}
|
|
2521
|
-
const download =
|
|
2528
|
+
const download = chunkMZCAYJ7H_cjs.createEl(doc, "a", "pptxv-ole-action", ACTION_STYLE);
|
|
2522
2529
|
download.href = data;
|
|
2523
2530
|
download.download = downloadName;
|
|
2524
2531
|
const downloadTitle = context.t("pptx.ole.downloadName", { name: downloadName });
|
|
@@ -2526,14 +2533,14 @@ function buildActionBar(doc, el, typeLabel, context) {
|
|
|
2526
2533
|
download.title = downloadTitle;
|
|
2527
2534
|
download.textContent = context.t("pptx.ole.download");
|
|
2528
2535
|
bar.appendChild(download);
|
|
2529
|
-
if (
|
|
2530
|
-
const open =
|
|
2536
|
+
if (chunkCWBVJ4DC_cjs.isBrowserOpenableMime(el.oleEmbeddedMimeType)) {
|
|
2537
|
+
const open = chunkMZCAYJ7H_cjs.createEl(doc, "button", "pptxv-ole-action", ACTION_STYLE);
|
|
2531
2538
|
open.type = "button";
|
|
2532
2539
|
const openTitle = context.t("pptx.ole.openName", { name: downloadName });
|
|
2533
2540
|
open.setAttribute("aria-label", openTitle);
|
|
2534
2541
|
open.title = openTitle;
|
|
2535
2542
|
open.textContent = context.t("pptx.ole.open");
|
|
2536
|
-
open.addEventListener("click", () =>
|
|
2543
|
+
open.addEventListener("click", () => chunkCWBVJ4DC_cjs.openUrlInNewTab(data));
|
|
2537
2544
|
bar.appendChild(open);
|
|
2538
2545
|
}
|
|
2539
2546
|
return bar;
|
|
@@ -2541,16 +2548,16 @@ function buildActionBar(doc, el, typeLabel, context) {
|
|
|
2541
2548
|
|
|
2542
2549
|
// src/pptx/dom/elements/placeholder.ts
|
|
2543
2550
|
var renderPlaceholderElement = (element, zIndex, context) => {
|
|
2544
|
-
const el =
|
|
2551
|
+
const el = chunkMZCAYJ7H_cjs.createEl(
|
|
2545
2552
|
context.document,
|
|
2546
2553
|
"div",
|
|
2547
2554
|
"pptxv-element pptxv-placeholder",
|
|
2548
|
-
|
|
2555
|
+
chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex)
|
|
2549
2556
|
);
|
|
2550
2557
|
el.dataset.elementId = element.id;
|
|
2551
2558
|
el.dataset.elementType = element.type;
|
|
2552
|
-
const label =
|
|
2553
|
-
label.textContent =
|
|
2559
|
+
const label = chunkMZCAYJ7H_cjs.createEl(context.document, "div", "pptxv-placeholder-label");
|
|
2560
|
+
label.textContent = chunkUFJBHFSD_cjs.keyToLabel(element.type);
|
|
2554
2561
|
el.appendChild(label);
|
|
2555
2562
|
return el;
|
|
2556
2563
|
};
|
|
@@ -2561,7 +2568,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2561
2568
|
return null;
|
|
2562
2569
|
}
|
|
2563
2570
|
const doc = context.document;
|
|
2564
|
-
const summaryView =
|
|
2571
|
+
const summaryView = chunkCWBVJ4DC_cjs.buildSummaryZoomView(
|
|
2565
2572
|
element,
|
|
2566
2573
|
(index) => {
|
|
2567
2574
|
const slide = context.slides?.[index];
|
|
@@ -2577,19 +2584,19 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2577
2584
|
(key, params) => context.t(key, params)
|
|
2578
2585
|
);
|
|
2579
2586
|
if (summaryView) {
|
|
2580
|
-
const root =
|
|
2587
|
+
const root = chunkMZCAYJ7H_cjs.createEl(
|
|
2581
2588
|
doc,
|
|
2582
2589
|
"div",
|
|
2583
2590
|
"pptxv-element pptxv-zoom pptxv-summary-zoom",
|
|
2584
|
-
|
|
2591
|
+
chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex)
|
|
2585
2592
|
);
|
|
2586
|
-
const content =
|
|
2593
|
+
const content = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-summary-zoom-content", summaryView.containerStyle);
|
|
2587
2594
|
root.dataset.elementId = element.id;
|
|
2588
2595
|
root.dataset.zoomType = "summary";
|
|
2589
2596
|
root.setAttribute("role", "group");
|
|
2590
2597
|
root.setAttribute("aria-label", summaryView.ariaLabel);
|
|
2591
2598
|
for (const tile2 of summaryView.tiles) {
|
|
2592
|
-
const tileElement =
|
|
2599
|
+
const tileElement = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-summary-zoom-tile", {
|
|
2593
2600
|
...tile2.style,
|
|
2594
2601
|
backgroundColor: tile2.backgroundColor,
|
|
2595
2602
|
overflow: "hidden",
|
|
@@ -2623,22 +2630,22 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2623
2630
|
});
|
|
2624
2631
|
}
|
|
2625
2632
|
if (tile2.imageSrc) {
|
|
2626
|
-
const image =
|
|
2633
|
+
const image = chunkMZCAYJ7H_cjs.createEl(doc, "img");
|
|
2627
2634
|
image.src = tile2.imageSrc;
|
|
2628
2635
|
image.alt = tile2.ariaLabel;
|
|
2629
2636
|
image.setAttribute("draggable", "false");
|
|
2630
2637
|
image.style.cssText = "width:100%;height:100%;object-fit:contain";
|
|
2631
2638
|
tileElement.appendChild(image);
|
|
2632
2639
|
} else {
|
|
2633
|
-
const label =
|
|
2640
|
+
const label = chunkMZCAYJ7H_cjs.createEl(doc, "div");
|
|
2634
2641
|
label.textContent = tile2.label;
|
|
2635
|
-
const slideLabel =
|
|
2642
|
+
const slideLabel = chunkMZCAYJ7H_cjs.createEl(doc, "div");
|
|
2636
2643
|
slideLabel.textContent = tile2.slideLabel;
|
|
2637
2644
|
tileElement.append(label, slideLabel);
|
|
2638
2645
|
}
|
|
2639
2646
|
content.appendChild(tileElement);
|
|
2640
2647
|
}
|
|
2641
|
-
const badge2 =
|
|
2648
|
+
const badge2 = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-zoom-badge");
|
|
2642
2649
|
badge2.textContent = context.t("pptx.zoom.summaryZoom");
|
|
2643
2650
|
content.appendChild(badge2);
|
|
2644
2651
|
root.appendChild(content);
|
|
@@ -2648,7 +2655,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2648
2655
|
const target = element.targetSlideIndex ?? 0;
|
|
2649
2656
|
const targetSlide = context.slides?.[target];
|
|
2650
2657
|
const interactive = context.presenting && context.onZoomClick !== void 0;
|
|
2651
|
-
const el =
|
|
2658
|
+
const el = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-element pptxv-zoom", chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex));
|
|
2652
2659
|
el.dataset.elementId = element.id;
|
|
2653
2660
|
el.dataset.zoomType = zoomType;
|
|
2654
2661
|
el.dataset.zoomTarget = String(target);
|
|
@@ -2658,7 +2665,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2658
2665
|
el.tabIndex = 0;
|
|
2659
2666
|
el.style.cursor = "pointer";
|
|
2660
2667
|
const activate = () => {
|
|
2661
|
-
const zoomTarget =
|
|
2668
|
+
const zoomTarget = chunkCWBVJ4DC_cjs.resolveZoomNavigationTarget(element);
|
|
2662
2669
|
if (zoomTarget) {
|
|
2663
2670
|
context.onZoomClick?.(zoomTarget, context.currentSlideIndex ?? 0);
|
|
2664
2671
|
}
|
|
@@ -2683,7 +2690,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2683
2690
|
section: element.targetSectionId
|
|
2684
2691
|
}) : context.t("pptx.zoom.ariaLabel", { number: target + 1 })
|
|
2685
2692
|
);
|
|
2686
|
-
const tile =
|
|
2693
|
+
const tile = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-zoom-tile", {
|
|
2687
2694
|
position: "relative",
|
|
2688
2695
|
width: "100%",
|
|
2689
2696
|
height: "100%",
|
|
@@ -2692,7 +2699,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2692
2699
|
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
|
|
2693
2700
|
});
|
|
2694
2701
|
if (element.imageData) {
|
|
2695
|
-
const img =
|
|
2702
|
+
const img = chunkMZCAYJ7H_cjs.createEl(doc, "img", "pptxv-zoom-img", {
|
|
2696
2703
|
width: "100%",
|
|
2697
2704
|
height: "100%",
|
|
2698
2705
|
objectFit: "contain",
|
|
@@ -2715,7 +2722,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2715
2722
|
)
|
|
2716
2723
|
);
|
|
2717
2724
|
}
|
|
2718
|
-
const badge =
|
|
2725
|
+
const badge = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-zoom-badge", {
|
|
2719
2726
|
position: "absolute",
|
|
2720
2727
|
bottom: "4px",
|
|
2721
2728
|
right: "4px",
|
|
@@ -2733,7 +2740,7 @@ var renderZoomElement = (element, zIndex, context) => {
|
|
|
2733
2740
|
return el;
|
|
2734
2741
|
};
|
|
2735
2742
|
function buildThumbnail(doc, slideNumber, sectionText, backgroundColor, t) {
|
|
2736
|
-
const box =
|
|
2743
|
+
const box = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-zoom-thumbnail", {
|
|
2737
2744
|
width: "100%",
|
|
2738
2745
|
height: "100%",
|
|
2739
2746
|
display: "flex",
|
|
@@ -2744,7 +2751,7 @@ function buildThumbnail(doc, slideNumber, sectionText, backgroundColor, t) {
|
|
|
2744
2751
|
border: "1px solid rgba(0, 0, 0, 0.1)",
|
|
2745
2752
|
boxSizing: "border-box"
|
|
2746
2753
|
});
|
|
2747
|
-
const slideLabel =
|
|
2754
|
+
const slideLabel = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-zoom-slide-label", {
|
|
2748
2755
|
fontSize: "14px",
|
|
2749
2756
|
fontWeight: 600,
|
|
2750
2757
|
color: "rgba(0, 0, 0, 0.5)",
|
|
@@ -2753,7 +2760,7 @@ function buildThumbnail(doc, slideNumber, sectionText, backgroundColor, t) {
|
|
|
2753
2760
|
slideLabel.textContent = t("pptx.notes.slideN", { n: slideNumber });
|
|
2754
2761
|
box.appendChild(slideLabel);
|
|
2755
2762
|
if (sectionText) {
|
|
2756
|
-
const sectionLabel =
|
|
2763
|
+
const sectionLabel = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-zoom-section-label", {
|
|
2757
2764
|
fontSize: "10px",
|
|
2758
2765
|
color: "rgba(0, 0, 0, 0.4)"
|
|
2759
2766
|
});
|
|
@@ -2772,7 +2779,7 @@ function registerExtraRenderers(registry) {
|
|
|
2772
2779
|
|
|
2773
2780
|
// src/pptx/dom/elements/register-rich-media.ts
|
|
2774
2781
|
function registerRichMediaRenderers(registry) {
|
|
2775
|
-
registry.register("smartArt",
|
|
2782
|
+
registry.register("smartArt", chunkMZCAYJ7H_cjs.renderSmartArtElement);
|
|
2776
2783
|
registry.register("media", renderMediaElement);
|
|
2777
2784
|
registry.register("ink", renderInkElement);
|
|
2778
2785
|
registry.register("ole", renderOleElement);
|
|
@@ -2808,10 +2815,10 @@ function enableTableResize(container, table, element, context) {
|
|
|
2808
2815
|
for (const handle of [...colHandles, ...rowHandles]) {
|
|
2809
2816
|
handle.remove();
|
|
2810
2817
|
}
|
|
2811
|
-
const crossings =
|
|
2818
|
+
const crossings = chunkCWBVJ4DC_cjs.computeTableMergeCrossings(tableData.rows, tableData.columnWidths.length);
|
|
2812
2819
|
const rowBounds = measureRowBoundaries(table);
|
|
2813
|
-
colHandles =
|
|
2814
|
-
const handle =
|
|
2820
|
+
colHandles = chunkCWBVJ4DC_cjs.computeColumnBoundaries(tableData.columnWidths).map((leftPct, i) => {
|
|
2821
|
+
const handle = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-table-resize-col", {
|
|
2815
2822
|
position: "absolute",
|
|
2816
2823
|
top: "0",
|
|
2817
2824
|
bottom: "0",
|
|
@@ -2820,14 +2827,14 @@ function enableTableResize(container, table, element, context) {
|
|
|
2820
2827
|
zIndex: "10",
|
|
2821
2828
|
pointerEvents: "none"
|
|
2822
2829
|
});
|
|
2823
|
-
const segments =
|
|
2830
|
+
const segments = chunkCWBVJ4DC_cjs.columnHandleSegments(
|
|
2824
2831
|
crossings.columns[i] ?? [],
|
|
2825
2832
|
rowBounds,
|
|
2826
2833
|
table.offsetHeight
|
|
2827
2834
|
);
|
|
2828
2835
|
for (const { top, height } of segments) {
|
|
2829
2836
|
handle.appendChild(
|
|
2830
|
-
|
|
2837
|
+
chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-table-resize-segment", {
|
|
2831
2838
|
position: "absolute",
|
|
2832
2839
|
left: "0",
|
|
2833
2840
|
right: "0",
|
|
@@ -2841,7 +2848,7 @@ function enableTableResize(container, table, element, context) {
|
|
|
2841
2848
|
return handle;
|
|
2842
2849
|
});
|
|
2843
2850
|
rowHandles = rowBounds.map((topPx, i) => {
|
|
2844
|
-
const handle =
|
|
2851
|
+
const handle = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-table-resize-row", {
|
|
2845
2852
|
position: "absolute",
|
|
2846
2853
|
left: "0",
|
|
2847
2854
|
right: "0",
|
|
@@ -2850,10 +2857,10 @@ function enableTableResize(container, table, element, context) {
|
|
|
2850
2857
|
zIndex: "10",
|
|
2851
2858
|
pointerEvents: "none"
|
|
2852
2859
|
});
|
|
2853
|
-
const segments =
|
|
2860
|
+
const segments = chunkCWBVJ4DC_cjs.rowHandleSegments(crossings.rows[i] ?? [], tableData.columnWidths);
|
|
2854
2861
|
for (const { leftPct, widthPct } of segments) {
|
|
2855
2862
|
handle.appendChild(
|
|
2856
|
-
|
|
2863
|
+
chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-table-resize-segment", {
|
|
2857
2864
|
position: "absolute",
|
|
2858
2865
|
top: "0",
|
|
2859
2866
|
bottom: "0",
|
|
@@ -2894,14 +2901,14 @@ function enableTableResize(container, table, element, context) {
|
|
|
2894
2901
|
const deltaProp = (event.clientX - active.startPos) / (rect.width || 1);
|
|
2895
2902
|
context.onTableResizeColumns?.(
|
|
2896
2903
|
element,
|
|
2897
|
-
|
|
2904
|
+
chunkCWBVJ4DC_cjs.computeResizedColumnWidths(active.initialWidths, active.index, deltaProp)
|
|
2898
2905
|
);
|
|
2899
2906
|
} else if (event.clientY !== active.startPos && active.type === "row") {
|
|
2900
2907
|
const deltaY = event.clientY - active.startPos;
|
|
2901
2908
|
context.onTableResizeRow?.(
|
|
2902
2909
|
element,
|
|
2903
2910
|
active.index,
|
|
2904
|
-
|
|
2911
|
+
chunkCWBVJ4DC_cjs.computeResizedRowHeight(active.initialRowHeight ?? chunkCWBVJ4DC_cjs.DEFAULT_ROW_HEIGHT, deltaY)
|
|
2905
2912
|
);
|
|
2906
2913
|
}
|
|
2907
2914
|
drawHandles();
|
|
@@ -2910,13 +2917,13 @@ function enableTableResize(container, table, element, context) {
|
|
|
2910
2917
|
const rect = container.getBoundingClientRect();
|
|
2911
2918
|
const localX = event.clientX - rect.left;
|
|
2912
2919
|
const localY = event.clientY - rect.top;
|
|
2913
|
-
const scaleY =
|
|
2914
|
-
const crossings =
|
|
2920
|
+
const scaleY = chunkCWBVJ4DC_cjs.getTableResizeScale(rect.height, container.offsetHeight);
|
|
2921
|
+
const crossings = chunkCWBVJ4DC_cjs.computeTableMergeCrossings(tableData.rows, tableData.columnWidths.length);
|
|
2915
2922
|
const rowBounds = measureRowBoundaries(table);
|
|
2916
|
-
const colBoundaries =
|
|
2923
|
+
const colBoundaries = chunkCWBVJ4DC_cjs.computeColumnBoundaries(tableData.columnWidths);
|
|
2917
2924
|
for (let i = 0; i < colBoundaries.length; i++) {
|
|
2918
2925
|
const boundaryX = colBoundaries[i] / 100 * rect.width;
|
|
2919
|
-
if (Math.abs(localX - boundaryX) <= HANDLE_ZONE && !
|
|
2926
|
+
if (Math.abs(localX - boundaryX) <= HANDLE_ZONE && !chunkCWBVJ4DC_cjs.isColumnBoundaryMergedAt(crossings, i, rowBounds, localY / scaleY)) {
|
|
2920
2927
|
event.preventDefault();
|
|
2921
2928
|
event.stopPropagation();
|
|
2922
2929
|
doc.body.style.cursor = "col-resize";
|
|
@@ -2934,7 +2941,7 @@ function enableTableResize(container, table, element, context) {
|
|
|
2934
2941
|
}
|
|
2935
2942
|
}
|
|
2936
2943
|
for (let i = 0; i < rowBounds.length; i++) {
|
|
2937
|
-
if (Math.abs(localY - rowBounds[i] * scaleY) <= HANDLE_ZONE && !
|
|
2944
|
+
if (Math.abs(localY - rowBounds[i] * scaleY) <= HANDLE_ZONE && !chunkCWBVJ4DC_cjs.isRowBoundaryMergedAt(crossings, i, tableData.columnWidths, localX / (rect.width || 1))) {
|
|
2938
2945
|
event.preventDefault();
|
|
2939
2946
|
event.stopPropagation();
|
|
2940
2947
|
const tr = table.querySelectorAll("tbody > tr")[i];
|
|
@@ -2945,7 +2952,7 @@ function enableTableResize(container, table, element, context) {
|
|
|
2945
2952
|
index: i,
|
|
2946
2953
|
startPos: event.clientY,
|
|
2947
2954
|
handleEl: rowHandles[i] ?? container,
|
|
2948
|
-
initialRowHeight: tr?.offsetHeight ??
|
|
2955
|
+
initialRowHeight: tr?.offsetHeight ?? chunkCWBVJ4DC_cjs.DEFAULT_ROW_HEIGHT
|
|
2949
2956
|
};
|
|
2950
2957
|
win.addEventListener("mousemove", onMouseMove);
|
|
2951
2958
|
win.addEventListener("mouseup", onMouseUp);
|
|
@@ -2971,23 +2978,23 @@ var renderTableElement = (element, zIndex, context) => {
|
|
|
2971
2978
|
fontScheme: context.fontScheme,
|
|
2972
2979
|
formatScheme: context.formatScheme
|
|
2973
2980
|
};
|
|
2974
|
-
const container =
|
|
2981
|
+
const container = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-element pptxv-table", {
|
|
2975
2982
|
// The table style's drop shadow (Themed Style 1/2) sits on the clipping frame.
|
|
2976
|
-
...
|
|
2977
|
-
...
|
|
2983
|
+
...chunkCWBVJ4DC_cjs.tableFrameCss(tableData, styleContext),
|
|
2984
|
+
...chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex),
|
|
2978
2985
|
overflow: "hidden"
|
|
2979
2986
|
});
|
|
2980
2987
|
container.dataset.elementId = element.id;
|
|
2981
|
-
const table =
|
|
2988
|
+
const table = chunkMZCAYJ7H_cjs.createEl(doc, "table", "pptxv-table-grid", {
|
|
2982
2989
|
width: "100%",
|
|
2983
2990
|
height: "100%",
|
|
2984
2991
|
borderCollapse: "collapse",
|
|
2985
2992
|
tableLayout: "fixed",
|
|
2986
2993
|
// Load-bearing: an unstyled cell otherwise inherits the HOST chrome's
|
|
2987
2994
|
// font stack; all five bindings declare the same shared default here.
|
|
2988
|
-
fontFamily:
|
|
2995
|
+
fontFamily: chunkHTFYAGHG_cjs.DEFAULT_FONT_FAMILY,
|
|
2989
2996
|
// `a:tblPr@rtl`: mirrors the column order for right-to-left decks.
|
|
2990
|
-
...
|
|
2997
|
+
...chunkCWBVJ4DC_cjs.tableContainerCss(tableData)
|
|
2991
2998
|
});
|
|
2992
2999
|
appendColgroup(doc, table, tableData.columnWidths);
|
|
2993
3000
|
const tbody = doc.createElement("tbody");
|
|
@@ -3049,13 +3056,13 @@ function renderCell(doc, tableData, cell, rowIndex, cellIndex, rowCount, columnC
|
|
|
3049
3056
|
if (cell.rowSpan && cell.rowSpan > 1) {
|
|
3050
3057
|
td.rowSpan = cell.rowSpan;
|
|
3051
3058
|
}
|
|
3052
|
-
const style =
|
|
3059
|
+
const style = chunkCWBVJ4DC_cjs.tableCellCss(
|
|
3053
3060
|
tableData,
|
|
3054
3061
|
cell,
|
|
3055
3062
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
3056
3063
|
styleContext
|
|
3057
3064
|
);
|
|
3058
|
-
const patternFill = cell.style ?
|
|
3065
|
+
const patternFill = cell.style ? chunkCWBVJ4DC_cjs.cellPatternFillCss(cell.style) : null;
|
|
3059
3066
|
if (patternFill) {
|
|
3060
3067
|
delete style["backgroundColor"];
|
|
3061
3068
|
delete style["background"];
|
|
@@ -3066,9 +3073,9 @@ function renderCell(doc, tableData, cell, rowIndex, cellIndex, rowCount, columnC
|
|
|
3066
3073
|
style["backgroundColor"] = patternFill.backgroundColor;
|
|
3067
3074
|
}
|
|
3068
3075
|
}
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
const diagonals =
|
|
3076
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(td, CELL_BASE_STYLE);
|
|
3077
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(td, style);
|
|
3078
|
+
const diagonals = chunkCWBVJ4DC_cjs.getCellDiagonalBorders(
|
|
3072
3079
|
cell.style,
|
|
3073
3080
|
tableData,
|
|
3074
3081
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3081,17 +3088,17 @@ function renderCell(doc, tableData, cell, rowIndex, cellIndex, rowCount, columnC
|
|
|
3081
3088
|
return td;
|
|
3082
3089
|
}
|
|
3083
3090
|
function diagonalLine(doc, x1, y1, x2, y2, stroke, width) {
|
|
3084
|
-
const line =
|
|
3085
|
-
line.style.setProperty("stroke-width",
|
|
3091
|
+
const line = chunkMZCAYJ7H_cjs.createSvgEl(doc, "line", { x1, y1, x2, y2, stroke, "stroke-width": width });
|
|
3092
|
+
line.style.setProperty("stroke-width", chunkFI2ATACZ_cjs.screenStrokeWidth(width));
|
|
3086
3093
|
return line;
|
|
3087
3094
|
}
|
|
3088
3095
|
function renderDiagonalOverlay(doc, diagonals) {
|
|
3089
|
-
const svg =
|
|
3096
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(doc, "svg", {
|
|
3090
3097
|
class: "pptxv-table-diag",
|
|
3091
3098
|
"aria-hidden": "true",
|
|
3092
3099
|
preserveAspectRatio: "none"
|
|
3093
3100
|
});
|
|
3094
|
-
|
|
3101
|
+
chunkMZCAYJ7H_cjs.applyStyleMap(svg, {
|
|
3095
3102
|
position: "absolute",
|
|
3096
3103
|
inset: 0,
|
|
3097
3104
|
width: "100%",
|
|
@@ -3112,10 +3119,10 @@ function renderDiagonalOverlay(doc, diagonals) {
|
|
|
3112
3119
|
return svg;
|
|
3113
3120
|
}
|
|
3114
3121
|
function appendCellText(doc, td, cell, cellCss, defaultFontPt) {
|
|
3115
|
-
const blocks =
|
|
3122
|
+
const blocks = chunkCWBVJ4DC_cjs.cellParagraphBlocks(cell, { cellCss, defaultFontPt });
|
|
3116
3123
|
if (blocks) {
|
|
3117
3124
|
for (const block of blocks) {
|
|
3118
|
-
const div =
|
|
3125
|
+
const div = chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-table-para", { display: "block", ...block.css });
|
|
3119
3126
|
appendRuns(doc, div, block.runs, cellCss);
|
|
3120
3127
|
td.appendChild(div);
|
|
3121
3128
|
}
|
|
@@ -3124,7 +3131,7 @@ function appendCellText(doc, td, cell, cellCss, defaultFontPt) {
|
|
|
3124
3131
|
const richCell = cell;
|
|
3125
3132
|
const textRuns = richCell.textRuns && richCell.textRuns.length > 0 ? richCell.textRuns : null;
|
|
3126
3133
|
if (!textRuns) {
|
|
3127
|
-
const span =
|
|
3134
|
+
const span = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-table-text", { position: "relative" });
|
|
3128
3135
|
span.textContent = cell.text || " ";
|
|
3129
3136
|
td.appendChild(span);
|
|
3130
3137
|
return;
|
|
@@ -3132,7 +3139,7 @@ function appendCellText(doc, td, cell, cellCss, defaultFontPt) {
|
|
|
3132
3139
|
for (const run of textRuns) {
|
|
3133
3140
|
if (run.isParagraphBreak) {
|
|
3134
3141
|
td.appendChild(
|
|
3135
|
-
|
|
3142
|
+
chunkMZCAYJ7H_cjs.createEl(doc, "div", "pptxv-table-para-break", { display: "block", height: 0 })
|
|
3136
3143
|
);
|
|
3137
3144
|
continue;
|
|
3138
3145
|
}
|
|
@@ -3145,9 +3152,9 @@ function appendRuns(doc, parent, runs, cellCss) {
|
|
|
3145
3152
|
parent.appendChild(doc.createElement("br"));
|
|
3146
3153
|
continue;
|
|
3147
3154
|
}
|
|
3148
|
-
const span =
|
|
3155
|
+
const span = chunkMZCAYJ7H_cjs.createEl(doc, "span", "pptxv-table-run", {
|
|
3149
3156
|
position: "relative",
|
|
3150
|
-
...
|
|
3157
|
+
...chunkCWBVJ4DC_cjs.cellRunStyle(run, cellCss)
|
|
3151
3158
|
});
|
|
3152
3159
|
span.textContent = run.text;
|
|
3153
3160
|
parent.appendChild(span);
|
|
@@ -3161,8 +3168,8 @@ function registerTableChartRenderers(registry) {
|
|
|
3161
3168
|
}
|
|
3162
3169
|
|
|
3163
3170
|
// src/pptx/dom/glyph-outline-cache.ts
|
|
3164
|
-
var glyphOutlineFontCache = new
|
|
3165
|
-
var getGlyphOutline =
|
|
3171
|
+
var glyphOutlineFontCache = new chunkCWBVJ4DC_cjs.GlyphOutlineFontCache();
|
|
3172
|
+
var getGlyphOutline = chunkCWBVJ4DC_cjs.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
3166
3173
|
|
|
3167
3174
|
// src/pptx/dom/elements/text-warp.ts
|
|
3168
3175
|
function renderWarpedText(element, context) {
|
|
@@ -3174,16 +3181,16 @@ function renderWarpedText(element, context) {
|
|
|
3174
3181
|
if (!preset || preset === "textNoShape") {
|
|
3175
3182
|
return null;
|
|
3176
3183
|
}
|
|
3177
|
-
const paragraphs =
|
|
3184
|
+
const paragraphs = chunkCWBVJ4DC_cjs.groupIntoParagraphs(element);
|
|
3178
3185
|
if (paragraphs.length === 0) {
|
|
3179
3186
|
return null;
|
|
3180
3187
|
}
|
|
3181
|
-
if (!
|
|
3182
|
-
const transform =
|
|
3188
|
+
if (!chunkCWBVJ4DC_cjs.shouldUseSvgWarp(preset)) {
|
|
3189
|
+
const transform = chunkCWBVJ4DC_cjs.getWarpCssTransform(preset, style?.textWarpAdj, style?.textWarpAdj2);
|
|
3183
3190
|
if (!transform) {
|
|
3184
3191
|
return null;
|
|
3185
3192
|
}
|
|
3186
|
-
const text =
|
|
3193
|
+
const text = chunkMZCAYJ7H_cjs.createEl(context.document, "div", "pptxv-wordart", {
|
|
3187
3194
|
width: "100%",
|
|
3188
3195
|
height: "100%",
|
|
3189
3196
|
display: "flex",
|
|
@@ -3201,14 +3208,14 @@ function renderWarpedText(element, context) {
|
|
|
3201
3208
|
if (style?.fontSize) {
|
|
3202
3209
|
text.style.fontSize = `${style.fontSize}px`;
|
|
3203
3210
|
}
|
|
3204
|
-
const fontWeight =
|
|
3211
|
+
const fontWeight = chunkCWBVJ4DC_cjs.fontWeightAttribute(style?.fontFamily, style?.bold);
|
|
3205
3212
|
if (fontWeight) {
|
|
3206
3213
|
text.style.fontWeight = fontWeight;
|
|
3207
3214
|
}
|
|
3208
3215
|
text.textContent = paragraphs.map((p) => p.segments.map((s) => s.text).join("")).join("\n");
|
|
3209
3216
|
return text;
|
|
3210
3217
|
}
|
|
3211
|
-
if (
|
|
3218
|
+
if (chunkCWBVJ4DC_cjs.hasGlyphEnvelope(preset)) {
|
|
3212
3219
|
return renderGlyphWarp(element, paragraphs, context);
|
|
3213
3220
|
}
|
|
3214
3221
|
return renderPathWarp(element, paragraphs, context);
|
|
@@ -3217,7 +3224,7 @@ function segmentFont(segment, elementStyle) {
|
|
|
3217
3224
|
const s = segment.style ?? {};
|
|
3218
3225
|
const family = s.fontFamily || elementStyle.fontFamily;
|
|
3219
3226
|
return {
|
|
3220
|
-
fontFamily: family ? pptx.getSubstituteFontFamily(family) :
|
|
3227
|
+
fontFamily: family ? pptx.getSubstituteFontFamily(family) : chunkHTFYAGHG_cjs.DEFAULT_FONT_FAMILY,
|
|
3221
3228
|
fontSizePx: s.fontSize ?? elementStyle.fontSize ?? 18,
|
|
3222
3229
|
bold: s.bold ?? elementStyle.bold,
|
|
3223
3230
|
italic: s.italic ?? elementStyle.italic
|
|
@@ -3228,13 +3235,13 @@ function renderGlyphWarp(element, paragraphs, context) {
|
|
|
3228
3235
|
const preset = style.textWarpPreset;
|
|
3229
3236
|
const width = Math.max(element.width, 1);
|
|
3230
3237
|
const height = Math.max(element.height, 1);
|
|
3231
|
-
const svg =
|
|
3238
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "svg", {
|
|
3232
3239
|
viewBox: `0 0 ${width} ${height}`,
|
|
3233
3240
|
"aria-hidden": "true"
|
|
3234
3241
|
});
|
|
3235
3242
|
svg.setAttribute("class", "pptxv-wordart");
|
|
3236
3243
|
svg.setAttribute("style", "position:absolute;inset:0;width:100%;height:100%;overflow:visible");
|
|
3237
|
-
const perLine =
|
|
3244
|
+
const perLine = chunkCWBVJ4DC_cjs.buildGlyphEnvelopeBlock(
|
|
3238
3245
|
preset,
|
|
3239
3246
|
paragraphs.map(
|
|
3240
3247
|
(paragraph) => paragraph.segments.map((seg, i) => ({
|
|
@@ -3255,7 +3262,7 @@ function renderGlyphWarp(element, paragraphs, context) {
|
|
|
3255
3262
|
const segments = paragraph.segments;
|
|
3256
3263
|
const glyphs = perLine[lineIndex] ?? [];
|
|
3257
3264
|
glyphs.forEach((g, glyphIndex) => {
|
|
3258
|
-
const paint =
|
|
3265
|
+
const paint = chunkCWBVJ4DC_cjs.resolveWarpRunPaint(segments[g.segmentIndex], style);
|
|
3259
3266
|
const fill = paint.fill;
|
|
3260
3267
|
const textAttrs = {
|
|
3261
3268
|
fill,
|
|
@@ -3266,12 +3273,12 @@ function renderGlyphWarp(element, paragraphs, context) {
|
|
|
3266
3273
|
"text-decoration": paint.textDecoration
|
|
3267
3274
|
};
|
|
3268
3275
|
if (g.outlinePath) {
|
|
3269
|
-
const path =
|
|
3276
|
+
const path = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "path", { d: g.outlinePath, fill });
|
|
3270
3277
|
svg.appendChild(path);
|
|
3271
3278
|
return;
|
|
3272
3279
|
}
|
|
3273
3280
|
if (!g.slices || g.slices.length <= 1) {
|
|
3274
|
-
const text =
|
|
3281
|
+
const text = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "text", {
|
|
3275
3282
|
x: g.x,
|
|
3276
3283
|
y: g.y,
|
|
3277
3284
|
transform: g.transform,
|
|
@@ -3281,17 +3288,17 @@ function renderGlyphWarp(element, paragraphs, context) {
|
|
|
3281
3288
|
svg.appendChild(text);
|
|
3282
3289
|
return;
|
|
3283
3290
|
}
|
|
3284
|
-
const group =
|
|
3291
|
+
const group = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "g", {
|
|
3285
3292
|
"data-glyph-slices": g.slices.length
|
|
3286
3293
|
});
|
|
3287
3294
|
g.slices.forEach((slice, sliceIndex) => {
|
|
3288
3295
|
const clipId = `${element.id.replace(/[^a-zA-Z0-9_-]/gu, "_")}-warp-l${lineIndex}-g${glyphIndex}-s${sliceIndex}`;
|
|
3289
|
-
const clipPath =
|
|
3296
|
+
const clipPath = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "clipPath", {
|
|
3290
3297
|
id: clipId,
|
|
3291
3298
|
clipPathUnits: "userSpaceOnUse"
|
|
3292
3299
|
});
|
|
3293
3300
|
clipPath.appendChild(
|
|
3294
|
-
|
|
3301
|
+
chunkMZCAYJ7H_cjs.createSvgEl(context.document, "rect", {
|
|
3295
3302
|
x: slice.clipX0,
|
|
3296
3303
|
y: -1e5,
|
|
3297
3304
|
width: slice.clipX1 - slice.clipX0,
|
|
@@ -3299,7 +3306,7 @@ function renderGlyphWarp(element, paragraphs, context) {
|
|
|
3299
3306
|
})
|
|
3300
3307
|
);
|
|
3301
3308
|
group.appendChild(clipPath);
|
|
3302
|
-
const text =
|
|
3309
|
+
const text = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "text", {
|
|
3303
3310
|
x: g.x,
|
|
3304
3311
|
y: g.y,
|
|
3305
3312
|
transform: slice.transform,
|
|
@@ -3317,48 +3324,50 @@ function renderGlyphWarp(element, paragraphs, context) {
|
|
|
3317
3324
|
function renderPathWarp(element, paragraphs, context) {
|
|
3318
3325
|
const style = element.textStyle;
|
|
3319
3326
|
const preset = style.textWarpPreset;
|
|
3320
|
-
const svg =
|
|
3327
|
+
const svg = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "svg", {
|
|
3321
3328
|
viewBox: `0 0 ${Math.max(element.width, 1)} ${Math.max(element.height, 1)}`,
|
|
3322
3329
|
preserveAspectRatio: "none",
|
|
3323
3330
|
"aria-hidden": "true"
|
|
3324
3331
|
});
|
|
3325
3332
|
svg.setAttribute("class", "pptxv-wordart");
|
|
3326
3333
|
svg.setAttribute("style", "position:absolute;inset:0;width:100%;height:100%;overflow:visible");
|
|
3327
|
-
const defs =
|
|
3334
|
+
const defs = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "defs");
|
|
3335
|
+
const layouts = chunkCWBVJ4DC_cjs.warpParagraphLayouts(
|
|
3336
|
+
preset,
|
|
3337
|
+
element.width,
|
|
3338
|
+
element.height,
|
|
3339
|
+
paragraphs,
|
|
3340
|
+
style.textWarpAdj,
|
|
3341
|
+
style.textWarpAdj2,
|
|
3342
|
+
style
|
|
3343
|
+
);
|
|
3328
3344
|
paragraphs.forEach((paragraph, index) => {
|
|
3329
3345
|
const id = `${element.id.replace(/[^a-zA-Z0-9_-]/gu, "_")}-warp-${index}`;
|
|
3330
3346
|
defs.appendChild(
|
|
3331
|
-
|
|
3347
|
+
chunkMZCAYJ7H_cjs.createSvgEl(context.document, "path", {
|
|
3332
3348
|
id,
|
|
3333
|
-
d:
|
|
3334
|
-
preset,
|
|
3335
|
-
element.width,
|
|
3336
|
-
element.height,
|
|
3337
|
-
index,
|
|
3338
|
-
paragraphs.length,
|
|
3339
|
-
style.textWarpAdj,
|
|
3340
|
-
style.textWarpAdj2
|
|
3341
|
-
)
|
|
3349
|
+
d: layouts[index]?.d
|
|
3342
3350
|
})
|
|
3343
3351
|
);
|
|
3344
|
-
const text =
|
|
3352
|
+
const text = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "text", {
|
|
3345
3353
|
fill: style.color ?? "#000000",
|
|
3346
|
-
"font-family": style.fontFamily ? pptx.getSubstituteFontFamily(style.fontFamily) :
|
|
3354
|
+
"font-family": style.fontFamily ? pptx.getSubstituteFontFamily(style.fontFamily) : chunkHTFYAGHG_cjs.DEFAULT_FONT_FAMILY,
|
|
3347
3355
|
"font-size": style.fontSize ?? 18,
|
|
3348
|
-
"font-weight":
|
|
3349
|
-
"font-style":
|
|
3356
|
+
"font-weight": chunkCWBVJ4DC_cjs.fontWeightAttribute(style.fontFamily, style.bold),
|
|
3357
|
+
"font-style": chunkCWBVJ4DC_cjs.resolveFontItalic(style.fontFamily, style.italic) ? "italic" : void 0
|
|
3350
3358
|
});
|
|
3351
|
-
const textPath =
|
|
3359
|
+
const textPath = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "textPath", {
|
|
3352
3360
|
href: `#${id}`,
|
|
3353
3361
|
startOffset: "50%",
|
|
3354
3362
|
"text-anchor": "middle"
|
|
3355
3363
|
});
|
|
3364
|
+
const fit = layouts[index]?.fitScale ?? 1;
|
|
3356
3365
|
for (const segment of paragraph.segments) {
|
|
3357
|
-
const paint =
|
|
3358
|
-
const tspan =
|
|
3366
|
+
const paint = chunkCWBVJ4DC_cjs.resolveWarpRunPaint(segment, style);
|
|
3367
|
+
const tspan = chunkMZCAYJ7H_cjs.createSvgEl(context.document, "tspan", {
|
|
3359
3368
|
fill: paint.fill,
|
|
3360
3369
|
"font-family": paint.fontFamily,
|
|
3361
|
-
"font-size": paint.fontSizePx,
|
|
3370
|
+
"font-size": paint.fontSizePx * fit,
|
|
3362
3371
|
"font-weight": paint.fontWeight ?? "normal",
|
|
3363
3372
|
"font-style": paint.fontStyle ?? "normal",
|
|
3364
3373
|
"text-decoration": paint.textDecoration
|
|
@@ -3375,9 +3384,9 @@ function renderPathWarp(element, paragraphs, context) {
|
|
|
3375
3384
|
|
|
3376
3385
|
// src/pptx/dom/elements/text-shape.ts
|
|
3377
3386
|
var renderTextShapeElement = (element, zIndex, context) => {
|
|
3378
|
-
const container =
|
|
3387
|
+
const container = chunkCWBVJ4DC_cjs.getContainerStyle(element, zIndex);
|
|
3379
3388
|
const animState = context.presentationStates?.get(element.id);
|
|
3380
|
-
const background =
|
|
3389
|
+
const background = chunkCWBVJ4DC_cjs.getBackgroundAnimationState(element, context.presentationStates);
|
|
3381
3390
|
const visualState = background ?? animState;
|
|
3382
3391
|
const shape = getShapeFillStrokeStyle(
|
|
3383
3392
|
element,
|
|
@@ -3385,27 +3394,27 @@ var renderTextShapeElement = (element, zIndex, context) => {
|
|
|
3385
3394
|
visualState?.animatesStroke
|
|
3386
3395
|
);
|
|
3387
3396
|
const merged = { ...container, ...shape };
|
|
3388
|
-
const bleedPatch =
|
|
3397
|
+
const bleedPatch = chunkCWBVJ4DC_cjs.abuttingEdgeBleedStyle(element, context.edgeBleeds?.get(element.id), merged);
|
|
3389
3398
|
const beforeBleed = { ...merged };
|
|
3390
3399
|
Object.assign(merged, bleedPatch);
|
|
3391
|
-
const transform =
|
|
3400
|
+
const transform = chunkMZCAYJ7H_cjs.composeTransforms(container["transform"], shape["transform"]);
|
|
3392
3401
|
if (transform !== void 0) {
|
|
3393
3402
|
merged["transform"] = transform;
|
|
3394
3403
|
}
|
|
3395
|
-
const layers =
|
|
3396
|
-
const el =
|
|
3404
|
+
const layers = chunkCWBVJ4DC_cjs.getBackgroundAnimationLayers(element, merged, background);
|
|
3405
|
+
const el = chunkMZCAYJ7H_cjs.createEl(context.document, "div", "pptxv-element pptxv-shape", layers.box);
|
|
3397
3406
|
el.dataset.elementId = element.id;
|
|
3398
3407
|
markAbuttingEdgeBleed(el, bleedPatch, beforeBleed);
|
|
3399
|
-
const paint = layers.paint ?
|
|
3408
|
+
const paint = layers.paint ? chunkMZCAYJ7H_cjs.createEl(context.document, "div", void 0, layers.paint) : el;
|
|
3400
3409
|
if (paint !== el) {
|
|
3401
3410
|
paint.dataset.animId = layers.targetId;
|
|
3402
3411
|
paint.dataset.pptxAnimationLayer = "background";
|
|
3403
3412
|
el.appendChild(paint);
|
|
3404
3413
|
}
|
|
3405
3414
|
if (context.interactive && !context.presenting) {
|
|
3406
|
-
const hitTargetStyle =
|
|
3415
|
+
const hitTargetStyle = chunkCWBVJ4DC_cjs.elementHitTargetStyle(element);
|
|
3407
3416
|
if (hitTargetStyle) {
|
|
3408
|
-
const hitTarget =
|
|
3417
|
+
const hitTarget = chunkMZCAYJ7H_cjs.createEl(context.document, "div", void 0, hitTargetStyle);
|
|
3409
3418
|
hitTarget.setAttribute("aria-hidden", "true");
|
|
3410
3419
|
hitTarget.setAttribute("data-pptx-hit-target", "true");
|
|
3411
3420
|
el.appendChild(hitTarget);
|
|
@@ -3450,8 +3459,8 @@ var renderTextShapeElement = (element, zIndex, context) => {
|
|
|
3450
3459
|
} else if (warped) {
|
|
3451
3460
|
el.appendChild(warped);
|
|
3452
3461
|
} else {
|
|
3453
|
-
const linkedSegments =
|
|
3454
|
-
const paragraphs =
|
|
3462
|
+
const linkedSegments = chunkCWBVJ4DC_cjs.getOverflowSegments(element, context.slide?.elements);
|
|
3463
|
+
const paragraphs = chunkCWBVJ4DC_cjs.buildParagraphs(element, context.fieldContext, linkedSegments);
|
|
3455
3464
|
const hasText = paragraphs.some((p) => p.runs.length > 0 || p.bulletMarker !== void 0);
|
|
3456
3465
|
if (hasText) {
|
|
3457
3466
|
el.appendChild(
|
|
@@ -3462,9 +3471,9 @@ var renderTextShapeElement = (element, zIndex, context) => {
|
|
|
3462
3471
|
);
|
|
3463
3472
|
} else {
|
|
3464
3473
|
const mode = context.interactive && !context.presenting ? "edit" : "present";
|
|
3465
|
-
const prompt =
|
|
3474
|
+
const prompt = chunkCWBVJ4DC_cjs.placeholderPromptDescriptor(element, mode);
|
|
3466
3475
|
if (prompt) {
|
|
3467
|
-
const hint =
|
|
3476
|
+
const hint = chunkMZCAYJ7H_cjs.createEl(context.document, "div", "pptxv-placeholder-prompt", {
|
|
3468
3477
|
...getTextBlockStyle(element),
|
|
3469
3478
|
...prompt.style
|
|
3470
3479
|
});
|
|
@@ -3478,7 +3487,7 @@ var renderTextShapeElement = (element, zIndex, context) => {
|
|
|
3478
3487
|
|
|
3479
3488
|
// src/pptx/dom/elements/index.ts
|
|
3480
3489
|
function createDefaultRegistry() {
|
|
3481
|
-
const registry =
|
|
3490
|
+
const registry = chunkMZCAYJ7H_cjs.createElementRendererRegistry();
|
|
3482
3491
|
registry.register("text", renderTextShapeElement);
|
|
3483
3492
|
registry.register("shape", renderTextShapeElement);
|
|
3484
3493
|
registry.register("image", renderImageElement);
|
|
@@ -3528,8 +3537,8 @@ async function loadPresentation(buffer, options) {
|
|
|
3528
3537
|
digitalSignatureCount: parsed.digitalSignatureCount ?? 0,
|
|
3529
3538
|
isPasswordProtected: parsed.isPasswordProtected ?? false,
|
|
3530
3539
|
canvasSize: {
|
|
3531
|
-
width: parsed.width ??
|
|
3532
|
-
height: parsed.height ??
|
|
3540
|
+
width: parsed.width ?? chunkHTFYAGHG_cjs.DEFAULT_CANVAS_WIDTH,
|
|
3541
|
+
height: parsed.height ?? chunkHTFYAGHG_cjs.DEFAULT_CANVAS_HEIGHT
|
|
3533
3542
|
},
|
|
3534
3543
|
mediaDataUrls,
|
|
3535
3544
|
colorScheme: parsed.theme?.colorScheme,
|
|
@@ -3630,119 +3639,119 @@ async function resolveImageUrls(handler, slides) {
|
|
|
3630
3639
|
|
|
3631
3640
|
Object.defineProperty(exports, "SMARTART_SVG_STYLE", {
|
|
3632
3641
|
enumerable: true,
|
|
3633
|
-
get: function () { return
|
|
3642
|
+
get: function () { return chunkMZCAYJ7H_cjs.SMARTART_SVG_STYLE; }
|
|
3634
3643
|
});
|
|
3635
3644
|
Object.defineProperty(exports, "appendSvgTextLines", {
|
|
3636
3645
|
enumerable: true,
|
|
3637
|
-
get: function () { return
|
|
3646
|
+
get: function () { return chunkMZCAYJ7H_cjs.appendSvgTextLines; }
|
|
3638
3647
|
});
|
|
3639
3648
|
Object.defineProperty(exports, "applyStyleMap", {
|
|
3640
3649
|
enumerable: true,
|
|
3641
|
-
get: function () { return
|
|
3650
|
+
get: function () { return chunkMZCAYJ7H_cjs.applyStyleMap; }
|
|
3642
3651
|
});
|
|
3643
3652
|
Object.defineProperty(exports, "applyThreeViewTextStyle", {
|
|
3644
3653
|
enumerable: true,
|
|
3645
|
-
get: function () { return
|
|
3654
|
+
get: function () { return chunkMZCAYJ7H_cjs.applyThreeViewTextStyle; }
|
|
3646
3655
|
});
|
|
3647
3656
|
Object.defineProperty(exports, "buildSmartArtFallbackSvg", {
|
|
3648
3657
|
enumerable: true,
|
|
3649
|
-
get: function () { return
|
|
3658
|
+
get: function () { return chunkMZCAYJ7H_cjs.buildSmartArtFallbackSvg; }
|
|
3650
3659
|
});
|
|
3651
3660
|
Object.defineProperty(exports, "buildSmartArtInsertPreview", {
|
|
3652
3661
|
enumerable: true,
|
|
3653
|
-
get: function () { return
|
|
3662
|
+
get: function () { return chunkMZCAYJ7H_cjs.buildSmartArtInsertPreview; }
|
|
3654
3663
|
});
|
|
3655
3664
|
Object.defineProperty(exports, "buildSvgGradientDefs", {
|
|
3656
3665
|
enumerable: true,
|
|
3657
|
-
get: function () { return
|
|
3666
|
+
get: function () { return chunkMZCAYJ7H_cjs.buildSvgGradientDefs; }
|
|
3658
3667
|
});
|
|
3659
3668
|
Object.defineProperty(exports, "collectThreeViews", {
|
|
3660
3669
|
enumerable: true,
|
|
3661
|
-
get: function () { return
|
|
3670
|
+
get: function () { return chunkMZCAYJ7H_cjs.collectThreeViews; }
|
|
3662
3671
|
});
|
|
3663
3672
|
Object.defineProperty(exports, "composeTransforms", {
|
|
3664
3673
|
enumerable: true,
|
|
3665
|
-
get: function () { return
|
|
3674
|
+
get: function () { return chunkMZCAYJ7H_cjs.composeTransforms; }
|
|
3666
3675
|
});
|
|
3667
3676
|
Object.defineProperty(exports, "createEl", {
|
|
3668
3677
|
enumerable: true,
|
|
3669
|
-
get: function () { return
|
|
3678
|
+
get: function () { return chunkMZCAYJ7H_cjs.createEl; }
|
|
3670
3679
|
});
|
|
3671
3680
|
Object.defineProperty(exports, "createElementRendererRegistry", {
|
|
3672
3681
|
enumerable: true,
|
|
3673
|
-
get: function () { return
|
|
3682
|
+
get: function () { return chunkMZCAYJ7H_cjs.createElementRendererRegistry; }
|
|
3674
3683
|
});
|
|
3675
3684
|
Object.defineProperty(exports, "createSvgEl", {
|
|
3676
3685
|
enumerable: true,
|
|
3677
|
-
get: function () { return
|
|
3686
|
+
get: function () { return chunkMZCAYJ7H_cjs.createSvgEl; }
|
|
3678
3687
|
});
|
|
3679
3688
|
Object.defineProperty(exports, "enableSmartArtEditing", {
|
|
3680
3689
|
enumerable: true,
|
|
3681
|
-
get: function () { return
|
|
3690
|
+
get: function () { return chunkMZCAYJ7H_cjs.enableSmartArtEditing; }
|
|
3682
3691
|
});
|
|
3683
3692
|
Object.defineProperty(exports, "isChart3DEditable", {
|
|
3684
3693
|
enumerable: true,
|
|
3685
|
-
get: function () { return
|
|
3694
|
+
get: function () { return chunkMZCAYJ7H_cjs.isChart3DEditable; }
|
|
3686
3695
|
});
|
|
3687
3696
|
Object.defineProperty(exports, "mountThreeViewInto", {
|
|
3688
3697
|
enumerable: true,
|
|
3689
|
-
get: function () { return
|
|
3698
|
+
get: function () { return chunkMZCAYJ7H_cjs.mountThreeViewInto; }
|
|
3690
3699
|
});
|
|
3691
3700
|
Object.defineProperty(exports, "renderSmartArt3DElement", {
|
|
3692
3701
|
enumerable: true,
|
|
3693
|
-
get: function () { return
|
|
3702
|
+
get: function () { return chunkMZCAYJ7H_cjs.renderSmartArt3DElement; }
|
|
3694
3703
|
});
|
|
3695
3704
|
Object.defineProperty(exports, "renderSmartArtElement", {
|
|
3696
3705
|
enumerable: true,
|
|
3697
|
-
get: function () { return
|
|
3706
|
+
get: function () { return chunkMZCAYJ7H_cjs.renderSmartArtElement; }
|
|
3698
3707
|
});
|
|
3699
3708
|
Object.defineProperty(exports, "renderSmartArtSvg", {
|
|
3700
3709
|
enumerable: true,
|
|
3701
|
-
get: function () { return
|
|
3710
|
+
get: function () { return chunkMZCAYJ7H_cjs.renderSmartArtSvg; }
|
|
3702
3711
|
});
|
|
3703
3712
|
Object.defineProperty(exports, "rendering3DFlagsOf", {
|
|
3704
3713
|
enumerable: true,
|
|
3705
|
-
get: function () { return
|
|
3714
|
+
get: function () { return chunkMZCAYJ7H_cjs.rendering3DFlagsOf; }
|
|
3706
3715
|
});
|
|
3707
3716
|
Object.defineProperty(exports, "selectedChartPartOf", {
|
|
3708
3717
|
enumerable: true,
|
|
3709
|
-
get: function () { return
|
|
3718
|
+
get: function () { return chunkMZCAYJ7H_cjs.selectedChartPartOf; }
|
|
3710
3719
|
});
|
|
3711
3720
|
Object.defineProperty(exports, "setSvgAttrs", {
|
|
3712
3721
|
enumerable: true,
|
|
3713
|
-
get: function () { return
|
|
3722
|
+
get: function () { return chunkMZCAYJ7H_cjs.setSvgAttrs; }
|
|
3714
3723
|
});
|
|
3715
3724
|
Object.defineProperty(exports, "takeReusableThreeView", {
|
|
3716
3725
|
enumerable: true,
|
|
3717
|
-
get: function () { return
|
|
3726
|
+
get: function () { return chunkMZCAYJ7H_cjs.takeReusableThreeView; }
|
|
3718
3727
|
});
|
|
3719
3728
|
Object.defineProperty(exports, "wireChartThreeViewEvents", {
|
|
3720
3729
|
enumerable: true,
|
|
3721
|
-
get: function () { return
|
|
3730
|
+
get: function () { return chunkMZCAYJ7H_cjs.wireChartThreeViewEvents; }
|
|
3722
3731
|
});
|
|
3723
3732
|
Object.defineProperty(exports, "withReusableThreeViews", {
|
|
3724
3733
|
enumerable: true,
|
|
3725
|
-
get: function () { return
|
|
3734
|
+
get: function () { return chunkMZCAYJ7H_cjs.withReusableThreeViews; }
|
|
3726
3735
|
});
|
|
3727
3736
|
Object.defineProperty(exports, "buildEmbeddedFontStyles", {
|
|
3728
3737
|
enumerable: true,
|
|
3729
|
-
get: function () { return
|
|
3738
|
+
get: function () { return chunkCWBVJ4DC_cjs.buildEmbeddedFontStyles; }
|
|
3730
3739
|
});
|
|
3731
3740
|
Object.defineProperty(exports, "buildFieldSubstitutionContext", {
|
|
3732
3741
|
enumerable: true,
|
|
3733
|
-
get: function () { return
|
|
3742
|
+
get: function () { return chunkCWBVJ4DC_cjs.buildFieldSubstitutionContext; }
|
|
3734
3743
|
});
|
|
3735
3744
|
Object.defineProperty(exports, "releasePptxRenderCaches", {
|
|
3736
3745
|
enumerable: true,
|
|
3737
|
-
get: function () { return
|
|
3746
|
+
get: function () { return chunkCWBVJ4DC_cjs.releasePptxRenderCaches; }
|
|
3738
3747
|
});
|
|
3739
3748
|
Object.defineProperty(exports, "renderChartViewModelSvg", {
|
|
3740
3749
|
enumerable: true,
|
|
3741
|
-
get: function () { return
|
|
3750
|
+
get: function () { return chunkLOUVYGWX_cjs.renderChartViewModelSvg; }
|
|
3742
3751
|
});
|
|
3743
3752
|
Object.defineProperty(exports, "createTranslator", {
|
|
3744
3753
|
enumerable: true,
|
|
3745
|
-
get: function () { return
|
|
3754
|
+
get: function () { return chunkUFJBHFSD_cjs.createTranslator; }
|
|
3746
3755
|
});
|
|
3747
3756
|
exports.CHART_FORMAT_REQUEST_EVENT = CHART_FORMAT_REQUEST_EVENT;
|
|
3748
3757
|
exports.appendCommentMarkers = appendCommentMarkers;
|