ooxml-ui 1.43.0 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.d.ts +0 -1
- package/dist/chart/format-pane-3d.d.ts +0 -1
- package/dist/chart/format-pane-advanced-intent.d.ts +0 -1
- package/dist/chart/format-pane-analysis.d.ts +0 -1
- package/dist/chart/format-pane-axis.d.ts +0 -1
- package/dist/chart/format-pane-common.d.ts +0 -1
- package/dist/chart/format-pane-effects.d.ts +0 -1
- package/dist/chart/format-pane-fields.d.ts +0 -1
- package/dist/chart/format-pane-fill-kinds.d.ts +0 -1
- package/dist/chart/format-pane-fill-line.d.ts +0 -1
- package/dist/chart/format-pane-locales/es.d.ts +0 -1
- package/dist/chart/format-pane-model.d.ts +0 -1
- package/dist/chart/format-pane-options.d.ts +0 -1
- package/dist/chart/format-pane-space.d.ts +0 -1
- package/dist/chart/format-pane-text.d.ts +0 -1
- package/dist/chart/format-pane-types.d.ts +0 -1
- package/dist/chart/format-pane-view.d.ts +0 -1
- package/dist/chrome/find-bar.d.ts +1 -2
- package/dist/controls.d.ts +0 -1
- package/dist/embedding/region-host.d.ts +0 -1
- package/dist/files/save-progress-label.d.ts +0 -1
- package/dist/fonts/custom-fonts.d.ts +0 -1
- package/dist/form/color-swatches.d.ts +0 -1
- package/dist/image-native-size.d.ts +0 -1
- package/dist/picture-artistic-filters.d.ts +0 -1
- package/dist/picture-artistic-preview.d.ts +0 -1
- package/dist/picture-paint.d.ts +0 -1
- package/dist/pptx/{chart-3d-view-scene-CGLU6ISD.mjs → chart-3d-view-scene-D6OJTZYC.mjs} +3 -2
- package/dist/pptx/{chart-3d-view-scene-C7QUQTXD.cjs → chart-3d-view-scene-PC2RUBL4.cjs} +38 -37
- package/dist/pptx/{chunk-JP26TA3Q.cjs → chunk-2GDYTHUY.cjs} +12 -12
- package/dist/pptx/{chunk-YZWKNFPU.cjs → chunk-2SO3BL67.cjs} +2706 -160
- package/dist/pptx/{chunk-5BINBXFV.mjs → chunk-BNPTGOEZ.mjs} +3 -3
- package/dist/pptx/{chunk-7FTP7OOA.mjs → chunk-D3DQS2J2.mjs} +6767 -6987
- package/dist/pptx/chunk-EDIAPF6J.mjs +135 -0
- package/dist/pptx/{chunk-DH6EKOVI.mjs → chunk-H6M3FKNG.mjs} +1 -1
- package/dist/pptx/{chunk-CK6RYGB4.cjs → chunk-HB6CH2FF.cjs} +3 -126
- package/dist/pptx/chunk-HWJKBKCW.cjs +147 -0
- package/dist/pptx/{chunk-BA4CJI4U.mjs → chunk-KYTG7WNC.mjs} +3 -115
- package/dist/pptx/{chunk-P4NVINSK.cjs → chunk-LK35P6RE.cjs} +5329 -5606
- package/dist/pptx/{chunk-TW5UQCZS.mjs → chunk-TDALHSYV.mjs} +2605 -168
- package/dist/pptx/{chunk-UGSMMZU6.cjs → chunk-ZH35NTNU.cjs} +49 -49
- package/dist/pptx/dom/elements/connector.d.ts.map +1 -1
- package/dist/pptx/dom/elements/equation.d.ts.map +1 -1
- package/dist/pptx/dom/elements/media.d.ts.map +1 -1
- package/dist/pptx/dom/elements/ole.d.ts.map +1 -1
- package/dist/pptx/dom/elements/reflection-mirror-content.d.ts.map +1 -1
- package/dist/pptx/dom/elements/shape-filter-defs.d.ts +5 -0
- package/dist/pptx/dom/elements/shape-filter-defs.d.ts.map +1 -1
- package/dist/pptx/dom/elements/table.d.ts.map +1 -1
- package/dist/pptx/dom/elements/text-shape.d.ts.map +1 -1
- package/dist/pptx/dom/elements/text-warp.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +524 -446
- package/dist/pptx/dom/index.mjs +114 -37
- package/dist/pptx/export/html2canvas-clone.cjs +7 -6
- package/dist/pptx/export/html2canvas-clone.mjs +2 -1
- package/dist/pptx/index.cjs +3828 -3663
- package/dist/pptx/index.mjs +5 -4
- package/dist/pptx/render/chart-combo-stock.cjs +4 -3
- package/dist/pptx/render/chart-combo-stock.mjs +2 -1
- package/dist/pptx/render/chart-overlays.cjs +8 -7
- package/dist/pptx/render/chart-overlays.mjs +2 -1
- package/dist/pptx/render/chart-surface-treemap.cjs +5 -4
- package/dist/pptx/render/chart-surface-treemap.mjs +2 -1
- package/dist/pptx/render/chart-view-model.cjs +45 -44
- package/dist/pptx/render/chart-view-model.mjs +2 -1
- package/dist/pptx/render/chart-waterfall-map.cjs +7 -6
- package/dist/pptx/render/chart-waterfall-map.mjs +2 -1
- package/dist/pptx/render/connector-dash.d.ts +2 -1
- 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/connector-style.d.ts +4 -2
- package/dist/pptx/render/connector-style.d.ts.map +1 -1
- package/dist/pptx/render/dash-path-start.d.ts +38 -0
- package/dist/pptx/render/dash-path-start.d.ts.map +1 -0
- package/dist/pptx/render/dash-pattern.d.ts +61 -0
- package/dist/pptx/render/dash-pattern.d.ts.map +1 -0
- package/dist/pptx/render/device-pixel-exact.d.ts +34 -0
- package/dist/pptx/render/device-pixel-exact.d.ts.map +1 -0
- package/dist/pptx/render/device-pixel-group.d.ts +42 -0
- package/dist/pptx/render/device-pixel-group.d.ts.map +1 -0
- package/dist/pptx/render/device-pixel-stroke.d.ts +21 -3
- package/dist/pptx/render/device-pixel-stroke.d.ts.map +1 -1
- package/dist/pptx/render/element-style-transform.d.ts +6 -5
- package/dist/pptx/render/element-style-transform.d.ts.map +1 -1
- package/dist/pptx/render/embedded-fonts-sheet.d.ts +6 -0
- package/dist/pptx/render/embedded-fonts-sheet.d.ts.map +1 -1
- package/dist/pptx/render/equation-box-style.d.ts +23 -0
- package/dist/pptx/render/equation-box-style.d.ts.map +1 -0
- package/dist/pptx/render/fill-style.d.ts +16 -1
- package/dist/pptx/render/fill-style.d.ts.map +1 -1
- package/dist/pptx/render/font-line-gap.d.ts +0 -18
- package/dist/pptx/render/font-line-gap.d.ts.map +1 -1
- package/dist/pptx/render/gradient-svg-image.d.ts +20 -0
- package/dist/pptx/render/gradient-svg-image.d.ts.map +1 -0
- package/dist/pptx/render/group-fill.d.ts.map +1 -1
- package/dist/pptx/render/hollow-shape-hit-test.d.ts +23 -1
- package/dist/pptx/render/hollow-shape-hit-test.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +11 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/linked-text-box-overflow.d.ts +20 -5
- package/dist/pptx/render/linked-text-box-overflow.d.ts.map +1 -1
- package/dist/pptx/render/media-control-bar.d.ts +41 -0
- package/dist/pptx/render/media-control-bar.d.ts.map +1 -0
- package/dist/pptx/render/media-playback.d.ts +6 -6
- package/dist/pptx/render/media-playback.d.ts.map +1 -1
- package/dist/pptx/render/morph-animation.d.ts.map +1 -1
- package/dist/pptx/render/morph-carry.d.ts.map +1 -1
- package/dist/pptx/render/morph-connector-carry.d.ts +43 -0
- package/dist/pptx/render/morph-connector-carry.d.ts.map +1 -0
- package/dist/pptx/render/morph-effect-carry.d.ts +2 -0
- package/dist/pptx/render/morph-effect-carry.d.ts.map +1 -1
- package/dist/pptx/render/morph-effect-silhouette.d.ts +23 -0
- package/dist/pptx/render/morph-effect-silhouette.d.ts.map +1 -0
- package/dist/pptx/render/morph-geometry-key.d.ts.map +1 -1
- package/dist/pptx/render/morph-line-carry.d.ts +27 -0
- package/dist/pptx/render/morph-line-carry.d.ts.map +1 -1
- package/dist/pptx/render/morph-line-ends.d.ts +27 -0
- package/dist/pptx/render/morph-line-ends.d.ts.map +1 -0
- package/dist/pptx/render/morph-line-reach.d.ts +72 -0
- package/dist/pptx/render/morph-line-reach.d.ts.map +1 -0
- package/dist/pptx/render/morph-overlay-order.d.ts.map +1 -1
- package/dist/pptx/render/morph-plan-css.d.ts +0 -7
- package/dist/pptx/render/morph-plan-css.d.ts.map +1 -1
- package/dist/pptx/render/morph-predicates.d.ts.map +1 -1
- package/dist/pptx/render/morph-shape-carry.d.ts.map +1 -1
- package/dist/pptx/render/paragraph-baseline.d.ts +33 -0
- package/dist/pptx/render/paragraph-baseline.d.ts.map +1 -1
- package/dist/pptx/render/path-gradient-rect.d.ts +1 -1
- package/dist/pptx/render/path-gradient-rect.d.ts.map +1 -1
- package/dist/pptx/render/shape-geometry-base.d.ts +73 -0
- package/dist/pptx/render/shape-geometry-base.d.ts.map +1 -0
- package/dist/pptx/render/shape-geometry-cascade.d.ts +7 -37
- package/dist/pptx/render/shape-geometry-cascade.d.ts.map +1 -1
- package/dist/pptx/render/silhouette-effects.d.ts +118 -0
- package/dist/pptx/render/silhouette-effects.d.ts.map +1 -0
- package/dist/pptx/render/silhouette-fill-layer.d.ts +19 -0
- package/dist/pptx/render/silhouette-fill-layer.d.ts.map +1 -0
- package/dist/pptx/render/silhouette-morph-refresh.d.ts +6 -0
- package/dist/pptx/render/silhouette-morph-refresh.d.ts.map +1 -0
- package/dist/pptx/render/silhouette-morph-registry.d.ts +36 -0
- package/dist/pptx/render/silhouette-morph-registry.d.ts.map +1 -0
- package/dist/pptx/render/stroke-only-preset.d.ts +22 -0
- package/dist/pptx/render/stroke-only-preset.d.ts.map +1 -1
- package/dist/pptx/render/stroke-outline.d.ts.map +1 -1
- package/dist/pptx/render/subpath-fill-overlay.d.ts +11 -5
- package/dist/pptx/render/subpath-fill-overlay.d.ts.map +1 -1
- package/dist/pptx/render/subpath-geometry.d.ts +38 -0
- package/dist/pptx/render/subpath-geometry.d.ts.map +1 -0
- package/dist/pptx/render/svg-gradient-paint.d.ts.map +1 -1
- package/dist/pptx/render/svg-id-scope.d.ts +8 -0
- package/dist/pptx/render/svg-id-scope.d.ts.map +1 -0
- package/dist/pptx/render/table-cell-baseline.d.ts +36 -0
- package/dist/pptx/render/table-cell-baseline.d.ts.map +1 -0
- package/dist/pptx/render/table-cell-border-inset.d.ts +21 -0
- package/dist/pptx/render/table-cell-border-inset.d.ts.map +1 -0
- package/dist/pptx/render/table-cell-css.d.ts.map +1 -1
- package/dist/pptx/render/table-cell-paragraphs.d.ts +13 -1
- package/dist/pptx/render/table-cell-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/table-style-bg-settle.d.ts +43 -0
- package/dist/pptx/render/table-style-bg-settle.d.ts.map +1 -0
- package/dist/pptx/render/table-style-bg-span.d.ts +26 -0
- package/dist/pptx/render/table-style-bg-span.d.ts.map +1 -0
- package/dist/pptx/render/table-style-borders.d.ts.map +1 -1
- package/dist/pptx/render/table-style-builtins-data.d.ts +1 -1
- package/dist/pptx/render/table-style-builtins-data.d.ts.map +1 -1
- package/dist/pptx/render/table-style-fill.d.ts.map +1 -1
- package/dist/pptx/render/table-style-shadow.d.ts +20 -0
- package/dist/pptx/render/table-style-shadow.d.ts.map +1 -0
- package/dist/pptx/render/table-style-theme-refs.d.ts.map +1 -1
- package/dist/pptx/render/table-style.d.ts +9 -0
- package/dist/pptx/render/table-style.d.ts.map +1 -1
- package/dist/pptx/render/text-block-style.d.ts +5 -0
- package/dist/pptx/render/text-block-style.d.ts.map +1 -1
- package/dist/pptx/render/text-paragraphs.d.ts +11 -1
- package/dist/pptx/render/text-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-arch.d.ts +25 -0
- package/dist/pptx/render/text-warp-arch.d.ts.map +1 -0
- package/dist/pptx/render/text-warp-closed-paths.d.ts +53 -0
- package/dist/pptx/render/text-warp-closed-paths.d.ts.map +1 -0
- package/dist/pptx/render/text-warp-envelope-curves.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-map.d.ts +12 -0
- package/dist/pptx/render/text-warp-envelope-map.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-glyph-outline.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-polygon-clip.d.ts +21 -0
- package/dist/pptx/render/text-warp-polygon-clip.d.ts.map +1 -0
- package/dist/pptx/render/text-warp-preset-definitions-extra.d.ts +21 -0
- package/dist/pptx/render/text-warp-preset-definitions-extra.d.ts.map +1 -0
- package/dist/pptx/render/text-warp-preset-definitions.d.ts +19 -0
- package/dist/pptx/render/text-warp-preset-definitions.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-preset-sampler.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-run-paint.d.ts +19 -0
- package/dist/pptx/render/text-warp-run-paint.d.ts.map +1 -0
- package/dist/pptx/render/text-warp.d.ts.map +1 -1
- package/dist/pptx/render/visual-effects.d.ts +9 -0
- package/dist/pptx/render/visual-effects.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-UP6DYY42.cjs → smartart-insert-preview-55QCEISC.cjs} +7 -6
- package/dist/pptx/{smartart-insert-preview-DXFDFDSC.mjs → smartart-insert-preview-GPBTE3HU.mjs} +6 -5
- package/dist/render-cache.d.ts +0 -1
- package/dist/ribbon/ribbon-group.d.ts +1 -2
- package/dist/ribbon/svg-preview.d.ts +0 -1
- package/dist/theme-bridge.d.ts +0 -1
- package/dist/theme.d.ts +0 -1
- package/package.json +2 -2
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// src/pptx/render/device-pixel-stroke.ts
|
|
2
|
+
var DEVICE_PX_VAR = "--pptx-device-px";
|
|
3
|
+
var DEVICE_PIXEL_RATIO_VAR = "--pptx-dpr";
|
|
4
|
+
function cssPx(width) {
|
|
5
|
+
const rounded = Number(width.toFixed(4));
|
|
6
|
+
return `${rounded > 0 ? rounded : 1e-4}px`;
|
|
7
|
+
}
|
|
8
|
+
var STEP = `max(var(${DEVICE_PX_VAR}, 0px), 0.001px)`;
|
|
9
|
+
function quantizedWidth(widthExpr) {
|
|
10
|
+
return `max(${STEP}, round(${widthExpr}, ${STEP}))`;
|
|
11
|
+
}
|
|
12
|
+
function screenStrokeWidth(width, minOutsideStage = 0) {
|
|
13
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
14
|
+
return "0px";
|
|
15
|
+
}
|
|
16
|
+
const quantized = quantizedWidth(cssPx(width));
|
|
17
|
+
return minOutsideStage > 0 ? `max(${quantized}, ${outsideStageFloor(minOutsideStage)})` : quantized;
|
|
18
|
+
}
|
|
19
|
+
function outsideStageFloor(min) {
|
|
20
|
+
const dp = `var(${DEVICE_PX_VAR}, 1000px)`;
|
|
21
|
+
const px = cssPx(min);
|
|
22
|
+
return `max(clamp(0px, calc(${dp} - 100px), ${px}), clamp(0px, calc((0.001px - ${dp}) * 1000), ${px}))`;
|
|
23
|
+
}
|
|
24
|
+
function snappedStrokeShift(coord, width) {
|
|
25
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0 || !Number.isFinite(coord)) {
|
|
26
|
+
return "0px";
|
|
27
|
+
}
|
|
28
|
+
const at = `${Number(coord.toFixed(4))}px`;
|
|
29
|
+
const full = quantizedWidth(cssPx(width));
|
|
30
|
+
return `calc(round(${at}, ${STEP}) - round(down, calc(${full} / 2), ${STEP}) + ${full} / 2 - ${at})`;
|
|
31
|
+
}
|
|
32
|
+
function snappedStrokeTransform(axis, x, y, width, size, exact) {
|
|
33
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
34
|
+
return void 0;
|
|
35
|
+
}
|
|
36
|
+
const ex = exact?.x ?? x;
|
|
37
|
+
const ey = exact?.y ?? y;
|
|
38
|
+
const dx = axis === "h" ? "0px" : nearEdgeShift(x, ex, width);
|
|
39
|
+
const dy = axis === "v" ? "0px" : nearEdgeShift(y, ey, width);
|
|
40
|
+
const translate = `translate(${dx}, ${dy})`;
|
|
41
|
+
if (axis !== "box" || !size) {
|
|
42
|
+
return translate;
|
|
43
|
+
}
|
|
44
|
+
const sx = farEdgeScale(ex, exact?.width ?? size.width, size.width, width);
|
|
45
|
+
const sy = farEdgeScale(ey, exact?.height ?? size.height, size.height, width);
|
|
46
|
+
return sx === "1" && sy === "1" ? translate : `${translate} scale(${sx}, ${sy})`;
|
|
47
|
+
}
|
|
48
|
+
function nearEdgeShift(coord, exact, width) {
|
|
49
|
+
const shift = snappedStrokeShift(exact, width);
|
|
50
|
+
const offset = Number((exact - coord).toFixed(4));
|
|
51
|
+
return offset === 0 ? shift : `calc(${shift} + ${offset}px)`;
|
|
52
|
+
}
|
|
53
|
+
function farEdgeScale(exact, exactExtent, modelExtent, width) {
|
|
54
|
+
if (!Number.isFinite(exact) || !Number.isFinite(exactExtent) || !Number.isFinite(modelExtent) || modelExtent <= 0) {
|
|
55
|
+
return "1";
|
|
56
|
+
}
|
|
57
|
+
const near = snappedStrokeShift(exact, width);
|
|
58
|
+
const far = snappedStrokeShift(exact + exactExtent, width);
|
|
59
|
+
return `calc((${Number(exactExtent.toFixed(4))}px + ${far} - ${near}) / ${Number(modelExtent.toFixed(4))}px)`;
|
|
60
|
+
}
|
|
61
|
+
function screenBorderWidth(width) {
|
|
62
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
63
|
+
return "0px";
|
|
64
|
+
}
|
|
65
|
+
return `max(${cssPx(width)}, var(${DEVICE_PX_VAR}, 0px))`;
|
|
66
|
+
}
|
|
67
|
+
function screenBorder(width, style, color) {
|
|
68
|
+
return `${screenBorderWidth(width)} ${style ?? "solid"} ${color}`;
|
|
69
|
+
}
|
|
70
|
+
var watchedWindows = /* @__PURE__ */ new WeakSet();
|
|
71
|
+
function watchDevicePixelRatio(win = typeof window === "undefined" ? void 0 : window) {
|
|
72
|
+
if (!win || watchedWindows.has(win)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const style = win.document?.documentElement?.style;
|
|
76
|
+
if (!style) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
watchedWindows.add(win);
|
|
80
|
+
const publish = () => {
|
|
81
|
+
const ratio = win.devicePixelRatio;
|
|
82
|
+
const safe = typeof ratio === "number" && Number.isFinite(ratio) && ratio > 0 ? ratio : 1;
|
|
83
|
+
style.setProperty(DEVICE_PIXEL_RATIO_VAR, String(safe));
|
|
84
|
+
win.matchMedia?.(`(resolution: ${safe}dppx)`).addEventListener?.("change", publish, {
|
|
85
|
+
once: true
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
publish();
|
|
89
|
+
}
|
|
90
|
+
function deviceStrokeStageStyle(scale) {
|
|
91
|
+
if (!Number.isFinite(scale) || scale <= 0) {
|
|
92
|
+
return {};
|
|
93
|
+
}
|
|
94
|
+
watchDevicePixelRatio();
|
|
95
|
+
return {
|
|
96
|
+
[DEVICE_PX_VAR]: `calc(1px / (${Number(scale.toFixed(6))} * var(${DEVICE_PIXEL_RATIO_VAR}, 1)))`
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
var CARRIER_SELECTOR = `[style*="${DEVICE_PX_VAR}:"]`;
|
|
100
|
+
function carriers(root) {
|
|
101
|
+
const nested = [...root.querySelectorAll(CARRIER_SELECTOR)];
|
|
102
|
+
return root.closest(CARRIER_SELECTOR) ? [root, ...nested.filter((el) => el !== root)] : nested;
|
|
103
|
+
}
|
|
104
|
+
function neutralizeDeviceStrokes(root) {
|
|
105
|
+
for (const el of carriers(root)) {
|
|
106
|
+
el.style?.setProperty(DEVICE_PX_VAR, "0px");
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function withAuthoredStrokeWidths(root, read) {
|
|
110
|
+
const saved = carriers(root).map((el) => ({
|
|
111
|
+
el,
|
|
112
|
+
hadStyle: el.hasAttribute("style"),
|
|
113
|
+
value: el.style?.getPropertyValue(DEVICE_PX_VAR) ?? "",
|
|
114
|
+
priority: el.style?.getPropertyPriority(DEVICE_PX_VAR) ?? ""
|
|
115
|
+
}));
|
|
116
|
+
for (const { el } of saved) {
|
|
117
|
+
el.style?.setProperty(DEVICE_PX_VAR, "0px");
|
|
118
|
+
}
|
|
119
|
+
try {
|
|
120
|
+
return read();
|
|
121
|
+
} finally {
|
|
122
|
+
for (const { el, hadStyle, value, priority } of saved) {
|
|
123
|
+
if (value) {
|
|
124
|
+
el.style?.setProperty(DEVICE_PX_VAR, value, priority);
|
|
125
|
+
} else {
|
|
126
|
+
el.style?.removeProperty(DEVICE_PX_VAR);
|
|
127
|
+
}
|
|
128
|
+
if (!hadStyle && !el.getAttribute("style")) {
|
|
129
|
+
el.removeAttribute("style");
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { DEVICE_PIXEL_RATIO_VAR, DEVICE_PX_VAR, deviceStrokeStageStyle, neutralizeDeviceStrokes, screenBorder, screenBorderWidth, screenStrokeWidth, snappedStrokeShift, snappedStrokeTransform, watchDevicePixelRatio, withAuthoredStrokeWidths };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computePlotLayout, radarAngle, computeStackedSeriesPlots, computeLayoutOptions, computeStackedValueRangeForAxis, primaryValueAxis, valueToY2, collapseChartTitleRunsForEdit, computePieLayout, computeChartLegendLayout, buildMarkTooltip, formatAxisValueWithUnits, axisTickValues } from './chunk-
|
|
1
|
+
import { computePlotLayout, radarAngle, computeStackedSeriesPlots, computeLayoutOptions, computeStackedValueRangeForAxis, primaryValueAxis, valueToY2, collapseChartTitleRunsForEdit, computePieLayout, computeChartLegendLayout, buildMarkTooltip, formatAxisValueWithUnits, axisTickValues } from './chunk-TDALHSYV.mjs';
|
|
2
2
|
|
|
3
3
|
// src/pptx/render/chart-interaction-radar.ts
|
|
4
4
|
function buildRadarDragGeometry(element, chartData, categoryLabels, pointIndex) {
|
|
@@ -1,127 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkG4WRLFMJ_cjs = require('./chunk-G4WRLFMJ.cjs');
|
|
4
|
+
var chunkHWJKBKCW_cjs = require('./chunk-HWJKBKCW.cjs');
|
|
4
5
|
var chunkHJ3JZXOL_cjs = require('./chunk-HJ3JZXOL.cjs');
|
|
5
6
|
|
|
6
|
-
// src/pptx/render/device-pixel-stroke.ts
|
|
7
|
-
var DEVICE_PX_VAR = "--pptx-device-px";
|
|
8
|
-
var DEVICE_PIXEL_RATIO_VAR = "--pptx-dpr";
|
|
9
|
-
function cssPx(width) {
|
|
10
|
-
const rounded = Number(width.toFixed(4));
|
|
11
|
-
return `${rounded > 0 ? rounded : 1e-4}px`;
|
|
12
|
-
}
|
|
13
|
-
var STEP = `max(var(${DEVICE_PX_VAR}, 0px), 0.001px)`;
|
|
14
|
-
function quantizedWidth(widthExpr) {
|
|
15
|
-
return `max(${STEP}, round(${widthExpr}, ${STEP}))`;
|
|
16
|
-
}
|
|
17
|
-
function screenStrokeWidth(width, minOutsideStage = 0) {
|
|
18
|
-
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
19
|
-
return "0px";
|
|
20
|
-
}
|
|
21
|
-
const quantized = quantizedWidth(cssPx(width));
|
|
22
|
-
return minOutsideStage > 0 ? `max(${quantized}, ${outsideStageFloor(minOutsideStage)})` : quantized;
|
|
23
|
-
}
|
|
24
|
-
function outsideStageFloor(min) {
|
|
25
|
-
const dp = `var(${DEVICE_PX_VAR}, 1000px)`;
|
|
26
|
-
const px = cssPx(min);
|
|
27
|
-
return `max(clamp(0px, calc(${dp} - 100px), ${px}), clamp(0px, calc((0.001px - ${dp}) * 1000), ${px}))`;
|
|
28
|
-
}
|
|
29
|
-
function snappedStrokeShift(coord, width) {
|
|
30
|
-
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0 || !Number.isFinite(coord)) {
|
|
31
|
-
return "0px";
|
|
32
|
-
}
|
|
33
|
-
const at = `${Number(coord.toFixed(4))}px`;
|
|
34
|
-
const full = quantizedWidth(cssPx(width));
|
|
35
|
-
return `calc(round(${at}, ${STEP}) - round(down, calc(${full} / 2), ${STEP}) + ${full} / 2 - ${at})`;
|
|
36
|
-
}
|
|
37
|
-
function snappedStrokeTransform(axis, x, y, width) {
|
|
38
|
-
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
39
|
-
return void 0;
|
|
40
|
-
}
|
|
41
|
-
const dx = axis === "h" ? "0px" : snappedStrokeShift(x, width);
|
|
42
|
-
const dy = axis === "v" ? "0px" : snappedStrokeShift(y, width);
|
|
43
|
-
return `translate(${dx}, ${dy})`;
|
|
44
|
-
}
|
|
45
|
-
function screenBorderWidth(width) {
|
|
46
|
-
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
47
|
-
return "0px";
|
|
48
|
-
}
|
|
49
|
-
return `max(${cssPx(width)}, var(${DEVICE_PX_VAR}, 0px))`;
|
|
50
|
-
}
|
|
51
|
-
function screenBorder(width, style, color) {
|
|
52
|
-
return `${screenBorderWidth(width)} ${style ?? "solid"} ${color}`;
|
|
53
|
-
}
|
|
54
|
-
var watchedWindows = /* @__PURE__ */ new WeakSet();
|
|
55
|
-
function watchDevicePixelRatio(win = typeof window === "undefined" ? void 0 : window) {
|
|
56
|
-
if (!win || watchedWindows.has(win)) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const style = win.document?.documentElement?.style;
|
|
60
|
-
if (!style) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
watchedWindows.add(win);
|
|
64
|
-
const publish = () => {
|
|
65
|
-
const ratio = win.devicePixelRatio;
|
|
66
|
-
const safe = typeof ratio === "number" && Number.isFinite(ratio) && ratio > 0 ? ratio : 1;
|
|
67
|
-
style.setProperty(DEVICE_PIXEL_RATIO_VAR, String(safe));
|
|
68
|
-
win.matchMedia?.(`(resolution: ${safe}dppx)`).addEventListener?.("change", publish, {
|
|
69
|
-
once: true
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
publish();
|
|
73
|
-
}
|
|
74
|
-
function deviceStrokeStageStyle(scale) {
|
|
75
|
-
if (!Number.isFinite(scale) || scale <= 0) {
|
|
76
|
-
return {};
|
|
77
|
-
}
|
|
78
|
-
watchDevicePixelRatio();
|
|
79
|
-
return {
|
|
80
|
-
[DEVICE_PX_VAR]: `calc(1px / (${Number(scale.toFixed(6))} * var(${DEVICE_PIXEL_RATIO_VAR}, 1)))`
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
var CARRIER_SELECTOR = `[style*="${DEVICE_PX_VAR}:"]`;
|
|
84
|
-
function carriers(root) {
|
|
85
|
-
const nested = [...root.querySelectorAll(CARRIER_SELECTOR)];
|
|
86
|
-
return root.closest(CARRIER_SELECTOR) ? [root, ...nested.filter((el) => el !== root)] : nested;
|
|
87
|
-
}
|
|
88
|
-
function neutralizeDeviceStrokes(root) {
|
|
89
|
-
for (const el of carriers(root)) {
|
|
90
|
-
el.style?.setProperty(DEVICE_PX_VAR, "0px");
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function withAuthoredStrokeWidths(root, read) {
|
|
94
|
-
const saved = carriers(root).map((el) => ({
|
|
95
|
-
el,
|
|
96
|
-
hadStyle: el.hasAttribute("style"),
|
|
97
|
-
value: el.style?.getPropertyValue(DEVICE_PX_VAR) ?? "",
|
|
98
|
-
priority: el.style?.getPropertyPriority(DEVICE_PX_VAR) ?? ""
|
|
99
|
-
}));
|
|
100
|
-
for (const { el } of saved) {
|
|
101
|
-
el.style?.setProperty(DEVICE_PX_VAR, "0px");
|
|
102
|
-
}
|
|
103
|
-
try {
|
|
104
|
-
return read();
|
|
105
|
-
} finally {
|
|
106
|
-
for (const { el, hadStyle, value, priority } of saved) {
|
|
107
|
-
if (value) {
|
|
108
|
-
el.style?.setProperty(DEVICE_PX_VAR, value, priority);
|
|
109
|
-
} else {
|
|
110
|
-
el.style?.removeProperty(DEVICE_PX_VAR);
|
|
111
|
-
}
|
|
112
|
-
if (!hadStyle && !el.getAttribute("style")) {
|
|
113
|
-
el.removeAttribute("style");
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
7
|
// src/pptx/render/export-clone.ts
|
|
120
8
|
function isExportIgnoredElement(element) {
|
|
121
9
|
return element.getAttribute("data-export-ignore") === "true";
|
|
122
10
|
}
|
|
123
11
|
function prepareExportClone(root) {
|
|
124
|
-
neutralizeDeviceStrokes(root);
|
|
12
|
+
chunkHWJKBKCW_cjs.neutralizeDeviceStrokes(root);
|
|
125
13
|
for (const overlay of root.querySelectorAll('[data-export-ignore="true"]')) {
|
|
126
14
|
overlay.remove();
|
|
127
15
|
}
|
|
@@ -146,7 +34,7 @@ async function loadChart3DThree() {
|
|
|
146
34
|
|
|
147
35
|
// src/pptx/three-view/scene-registry.ts
|
|
148
36
|
var loaders = {
|
|
149
|
-
chart: async () => (await import('./chart-3d-view-scene-
|
|
37
|
+
chart: async () => (await import('./chart-3d-view-scene-PC2RUBL4.cjs')).mountChart3DView,
|
|
150
38
|
smartart: async () => (await import('./view-scene-4ZFUCP6S.cjs')).mountSmartArt3DView
|
|
151
39
|
};
|
|
152
40
|
async function loadThreeViewScene(kind) {
|
|
@@ -1069,8 +957,6 @@ function pinCapturedSize(original, clonedEl) {
|
|
|
1069
957
|
}
|
|
1070
958
|
|
|
1071
959
|
exports.CLONE_STYLE_SHEET_TIMEOUT_MS = CLONE_STYLE_SHEET_TIMEOUT_MS;
|
|
1072
|
-
exports.DEVICE_PIXEL_RATIO_VAR = DEVICE_PIXEL_RATIO_VAR;
|
|
1073
|
-
exports.DEVICE_PX_VAR = DEVICE_PX_VAR;
|
|
1074
960
|
exports.MAX_DEVICE_PIXEL_RATIO = MAX_DEVICE_PIXEL_RATIO;
|
|
1075
961
|
exports.THREE_VIEW_MARKER_ATTR = THREE_VIEW_MARKER_ATTR;
|
|
1076
962
|
exports.THREE_VIEW_SETTLE_TIMEOUT_MS = THREE_VIEW_SETTLE_TIMEOUT_MS;
|
|
@@ -1079,7 +965,6 @@ exports.THREE_VIEW_TAG = THREE_VIEW_TAG;
|
|
|
1079
965
|
exports.clonedStyleSheetsLoaded = clonedStyleSheetsLoaded;
|
|
1080
966
|
exports.computeThreeViewSize = computeThreeViewSize;
|
|
1081
967
|
exports.defineThreeViewElement = defineThreeViewElement;
|
|
1082
|
-
exports.deviceStrokeStageStyle = deviceStrokeStageStyle;
|
|
1083
968
|
exports.flatten3dTransform = flatten3dTransform;
|
|
1084
969
|
exports.flatten3dTransforms = flatten3dTransforms;
|
|
1085
970
|
exports.flattenBackdropFilter = flattenBackdropFilter;
|
|
@@ -1087,7 +972,6 @@ exports.flattenMixBlendMode = flattenMixBlendMode;
|
|
|
1087
972
|
exports.has3dTransform = has3dTransform;
|
|
1088
973
|
exports.html2canvasCaptureScope = html2canvasCaptureScope;
|
|
1089
974
|
exports.isExportIgnoredElement = isExportIgnoredElement;
|
|
1090
|
-
exports.neutralizeDeviceStrokes = neutralizeDeviceStrokes;
|
|
1091
975
|
exports.parseBlurValue = parseBlurValue;
|
|
1092
976
|
exports.pinCapturedSize = pinCapturedSize;
|
|
1093
977
|
exports.prepareExportClone = prepareExportClone;
|
|
@@ -1095,12 +979,5 @@ exports.prepareHtml2CanvasClone = prepareHtml2CanvasClone;
|
|
|
1095
979
|
exports.preprocessCssForCapture = preprocessCssForCapture;
|
|
1096
980
|
exports.removeUnsupportedFeatures = removeUnsupportedFeatures;
|
|
1097
981
|
exports.resolveCustomProperties = resolveCustomProperties;
|
|
1098
|
-
exports.screenBorder = screenBorder;
|
|
1099
|
-
exports.screenBorderWidth = screenBorderWidth;
|
|
1100
|
-
exports.screenStrokeWidth = screenStrokeWidth;
|
|
1101
982
|
exports.settleThreeViews = settleThreeViews;
|
|
1102
|
-
exports.snappedStrokeShift = snappedStrokeShift;
|
|
1103
|
-
exports.snappedStrokeTransform = snappedStrokeTransform;
|
|
1104
983
|
exports.snapshotThreeViewsIntoClone = snapshotThreeViewsIntoClone;
|
|
1105
|
-
exports.watchDevicePixelRatio = watchDevicePixelRatio;
|
|
1106
|
-
exports.withAuthoredStrokeWidths = withAuthoredStrokeWidths;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/pptx/render/device-pixel-stroke.ts
|
|
4
|
+
var DEVICE_PX_VAR = "--pptx-device-px";
|
|
5
|
+
var DEVICE_PIXEL_RATIO_VAR = "--pptx-dpr";
|
|
6
|
+
function cssPx(width) {
|
|
7
|
+
const rounded = Number(width.toFixed(4));
|
|
8
|
+
return `${rounded > 0 ? rounded : 1e-4}px`;
|
|
9
|
+
}
|
|
10
|
+
var STEP = `max(var(${DEVICE_PX_VAR}, 0px), 0.001px)`;
|
|
11
|
+
function quantizedWidth(widthExpr) {
|
|
12
|
+
return `max(${STEP}, round(${widthExpr}, ${STEP}))`;
|
|
13
|
+
}
|
|
14
|
+
function screenStrokeWidth(width, minOutsideStage = 0) {
|
|
15
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
16
|
+
return "0px";
|
|
17
|
+
}
|
|
18
|
+
const quantized = quantizedWidth(cssPx(width));
|
|
19
|
+
return minOutsideStage > 0 ? `max(${quantized}, ${outsideStageFloor(minOutsideStage)})` : quantized;
|
|
20
|
+
}
|
|
21
|
+
function outsideStageFloor(min) {
|
|
22
|
+
const dp = `var(${DEVICE_PX_VAR}, 1000px)`;
|
|
23
|
+
const px = cssPx(min);
|
|
24
|
+
return `max(clamp(0px, calc(${dp} - 100px), ${px}), clamp(0px, calc((0.001px - ${dp}) * 1000), ${px}))`;
|
|
25
|
+
}
|
|
26
|
+
function snappedStrokeShift(coord, width) {
|
|
27
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0 || !Number.isFinite(coord)) {
|
|
28
|
+
return "0px";
|
|
29
|
+
}
|
|
30
|
+
const at = `${Number(coord.toFixed(4))}px`;
|
|
31
|
+
const full = quantizedWidth(cssPx(width));
|
|
32
|
+
return `calc(round(${at}, ${STEP}) - round(down, calc(${full} / 2), ${STEP}) + ${full} / 2 - ${at})`;
|
|
33
|
+
}
|
|
34
|
+
function snappedStrokeTransform(axis, x, y, width, size, exact) {
|
|
35
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
const ex = exact?.x ?? x;
|
|
39
|
+
const ey = exact?.y ?? y;
|
|
40
|
+
const dx = axis === "h" ? "0px" : nearEdgeShift(x, ex, width);
|
|
41
|
+
const dy = axis === "v" ? "0px" : nearEdgeShift(y, ey, width);
|
|
42
|
+
const translate = `translate(${dx}, ${dy})`;
|
|
43
|
+
if (axis !== "box" || !size) {
|
|
44
|
+
return translate;
|
|
45
|
+
}
|
|
46
|
+
const sx = farEdgeScale(ex, exact?.width ?? size.width, size.width, width);
|
|
47
|
+
const sy = farEdgeScale(ey, exact?.height ?? size.height, size.height, width);
|
|
48
|
+
return sx === "1" && sy === "1" ? translate : `${translate} scale(${sx}, ${sy})`;
|
|
49
|
+
}
|
|
50
|
+
function nearEdgeShift(coord, exact, width) {
|
|
51
|
+
const shift = snappedStrokeShift(exact, width);
|
|
52
|
+
const offset = Number((exact - coord).toFixed(4));
|
|
53
|
+
return offset === 0 ? shift : `calc(${shift} + ${offset}px)`;
|
|
54
|
+
}
|
|
55
|
+
function farEdgeScale(exact, exactExtent, modelExtent, width) {
|
|
56
|
+
if (!Number.isFinite(exact) || !Number.isFinite(exactExtent) || !Number.isFinite(modelExtent) || modelExtent <= 0) {
|
|
57
|
+
return "1";
|
|
58
|
+
}
|
|
59
|
+
const near = snappedStrokeShift(exact, width);
|
|
60
|
+
const far = snappedStrokeShift(exact + exactExtent, width);
|
|
61
|
+
return `calc((${Number(exactExtent.toFixed(4))}px + ${far} - ${near}) / ${Number(modelExtent.toFixed(4))}px)`;
|
|
62
|
+
}
|
|
63
|
+
function screenBorderWidth(width) {
|
|
64
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
65
|
+
return "0px";
|
|
66
|
+
}
|
|
67
|
+
return `max(${cssPx(width)}, var(${DEVICE_PX_VAR}, 0px))`;
|
|
68
|
+
}
|
|
69
|
+
function screenBorder(width, style, color) {
|
|
70
|
+
return `${screenBorderWidth(width)} ${style ?? "solid"} ${color}`;
|
|
71
|
+
}
|
|
72
|
+
var watchedWindows = /* @__PURE__ */ new WeakSet();
|
|
73
|
+
function watchDevicePixelRatio(win = typeof window === "undefined" ? void 0 : window) {
|
|
74
|
+
if (!win || watchedWindows.has(win)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const style = win.document?.documentElement?.style;
|
|
78
|
+
if (!style) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
watchedWindows.add(win);
|
|
82
|
+
const publish = () => {
|
|
83
|
+
const ratio = win.devicePixelRatio;
|
|
84
|
+
const safe = typeof ratio === "number" && Number.isFinite(ratio) && ratio > 0 ? ratio : 1;
|
|
85
|
+
style.setProperty(DEVICE_PIXEL_RATIO_VAR, String(safe));
|
|
86
|
+
win.matchMedia?.(`(resolution: ${safe}dppx)`).addEventListener?.("change", publish, {
|
|
87
|
+
once: true
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
publish();
|
|
91
|
+
}
|
|
92
|
+
function deviceStrokeStageStyle(scale) {
|
|
93
|
+
if (!Number.isFinite(scale) || scale <= 0) {
|
|
94
|
+
return {};
|
|
95
|
+
}
|
|
96
|
+
watchDevicePixelRatio();
|
|
97
|
+
return {
|
|
98
|
+
[DEVICE_PX_VAR]: `calc(1px / (${Number(scale.toFixed(6))} * var(${DEVICE_PIXEL_RATIO_VAR}, 1)))`
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
var CARRIER_SELECTOR = `[style*="${DEVICE_PX_VAR}:"]`;
|
|
102
|
+
function carriers(root) {
|
|
103
|
+
const nested = [...root.querySelectorAll(CARRIER_SELECTOR)];
|
|
104
|
+
return root.closest(CARRIER_SELECTOR) ? [root, ...nested.filter((el) => el !== root)] : nested;
|
|
105
|
+
}
|
|
106
|
+
function neutralizeDeviceStrokes(root) {
|
|
107
|
+
for (const el of carriers(root)) {
|
|
108
|
+
el.style?.setProperty(DEVICE_PX_VAR, "0px");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function withAuthoredStrokeWidths(root, read) {
|
|
112
|
+
const saved = carriers(root).map((el) => ({
|
|
113
|
+
el,
|
|
114
|
+
hadStyle: el.hasAttribute("style"),
|
|
115
|
+
value: el.style?.getPropertyValue(DEVICE_PX_VAR) ?? "",
|
|
116
|
+
priority: el.style?.getPropertyPriority(DEVICE_PX_VAR) ?? ""
|
|
117
|
+
}));
|
|
118
|
+
for (const { el } of saved) {
|
|
119
|
+
el.style?.setProperty(DEVICE_PX_VAR, "0px");
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
return read();
|
|
123
|
+
} finally {
|
|
124
|
+
for (const { el, hadStyle, value, priority } of saved) {
|
|
125
|
+
if (value) {
|
|
126
|
+
el.style?.setProperty(DEVICE_PX_VAR, value, priority);
|
|
127
|
+
} else {
|
|
128
|
+
el.style?.removeProperty(DEVICE_PX_VAR);
|
|
129
|
+
}
|
|
130
|
+
if (!hadStyle && !el.getAttribute("style")) {
|
|
131
|
+
el.removeAttribute("style");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
exports.DEVICE_PIXEL_RATIO_VAR = DEVICE_PIXEL_RATIO_VAR;
|
|
138
|
+
exports.DEVICE_PX_VAR = DEVICE_PX_VAR;
|
|
139
|
+
exports.deviceStrokeStageStyle = deviceStrokeStageStyle;
|
|
140
|
+
exports.neutralizeDeviceStrokes = neutralizeDeviceStrokes;
|
|
141
|
+
exports.screenBorder = screenBorder;
|
|
142
|
+
exports.screenBorderWidth = screenBorderWidth;
|
|
143
|
+
exports.screenStrokeWidth = screenStrokeWidth;
|
|
144
|
+
exports.snappedStrokeShift = snappedStrokeShift;
|
|
145
|
+
exports.snappedStrokeTransform = snappedStrokeTransform;
|
|
146
|
+
exports.watchDevicePixelRatio = watchDevicePixelRatio;
|
|
147
|
+
exports.withAuthoredStrokeWidths = withAuthoredStrokeWidths;
|
|
@@ -1,119 +1,7 @@
|
|
|
1
1
|
import { overflowCanvasCss, hasThreeViewOverflow, MAX_VIEW_PIXELS, NO_THREE_VIEW_OVERFLOW, getThreeRendererHost, overflowPixelSize, threeViewOverflowChanged } from './chunk-2V5ATMMB.mjs';
|
|
2
|
+
import { neutralizeDeviceStrokes } from './chunk-EDIAPF6J.mjs';
|
|
2
3
|
import { normalizeColorsForCapture } from './chunk-7JBQPQ6G.mjs';
|
|
3
4
|
|
|
4
|
-
// src/pptx/render/device-pixel-stroke.ts
|
|
5
|
-
var DEVICE_PX_VAR = "--pptx-device-px";
|
|
6
|
-
var DEVICE_PIXEL_RATIO_VAR = "--pptx-dpr";
|
|
7
|
-
function cssPx(width) {
|
|
8
|
-
const rounded = Number(width.toFixed(4));
|
|
9
|
-
return `${rounded > 0 ? rounded : 1e-4}px`;
|
|
10
|
-
}
|
|
11
|
-
var STEP = `max(var(${DEVICE_PX_VAR}, 0px), 0.001px)`;
|
|
12
|
-
function quantizedWidth(widthExpr) {
|
|
13
|
-
return `max(${STEP}, round(${widthExpr}, ${STEP}))`;
|
|
14
|
-
}
|
|
15
|
-
function screenStrokeWidth(width, minOutsideStage = 0) {
|
|
16
|
-
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
17
|
-
return "0px";
|
|
18
|
-
}
|
|
19
|
-
const quantized = quantizedWidth(cssPx(width));
|
|
20
|
-
return minOutsideStage > 0 ? `max(${quantized}, ${outsideStageFloor(minOutsideStage)})` : quantized;
|
|
21
|
-
}
|
|
22
|
-
function outsideStageFloor(min) {
|
|
23
|
-
const dp = `var(${DEVICE_PX_VAR}, 1000px)`;
|
|
24
|
-
const px = cssPx(min);
|
|
25
|
-
return `max(clamp(0px, calc(${dp} - 100px), ${px}), clamp(0px, calc((0.001px - ${dp}) * 1000), ${px}))`;
|
|
26
|
-
}
|
|
27
|
-
function snappedStrokeShift(coord, width) {
|
|
28
|
-
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0 || !Number.isFinite(coord)) {
|
|
29
|
-
return "0px";
|
|
30
|
-
}
|
|
31
|
-
const at = `${Number(coord.toFixed(4))}px`;
|
|
32
|
-
const full = quantizedWidth(cssPx(width));
|
|
33
|
-
return `calc(round(${at}, ${STEP}) - round(down, calc(${full} / 2), ${STEP}) + ${full} / 2 - ${at})`;
|
|
34
|
-
}
|
|
35
|
-
function snappedStrokeTransform(axis, x, y, width) {
|
|
36
|
-
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
37
|
-
return void 0;
|
|
38
|
-
}
|
|
39
|
-
const dx = axis === "h" ? "0px" : snappedStrokeShift(x, width);
|
|
40
|
-
const dy = axis === "v" ? "0px" : snappedStrokeShift(y, width);
|
|
41
|
-
return `translate(${dx}, ${dy})`;
|
|
42
|
-
}
|
|
43
|
-
function screenBorderWidth(width) {
|
|
44
|
-
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) {
|
|
45
|
-
return "0px";
|
|
46
|
-
}
|
|
47
|
-
return `max(${cssPx(width)}, var(${DEVICE_PX_VAR}, 0px))`;
|
|
48
|
-
}
|
|
49
|
-
function screenBorder(width, style, color) {
|
|
50
|
-
return `${screenBorderWidth(width)} ${style ?? "solid"} ${color}`;
|
|
51
|
-
}
|
|
52
|
-
var watchedWindows = /* @__PURE__ */ new WeakSet();
|
|
53
|
-
function watchDevicePixelRatio(win = typeof window === "undefined" ? void 0 : window) {
|
|
54
|
-
if (!win || watchedWindows.has(win)) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const style = win.document?.documentElement?.style;
|
|
58
|
-
if (!style) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
watchedWindows.add(win);
|
|
62
|
-
const publish = () => {
|
|
63
|
-
const ratio = win.devicePixelRatio;
|
|
64
|
-
const safe = typeof ratio === "number" && Number.isFinite(ratio) && ratio > 0 ? ratio : 1;
|
|
65
|
-
style.setProperty(DEVICE_PIXEL_RATIO_VAR, String(safe));
|
|
66
|
-
win.matchMedia?.(`(resolution: ${safe}dppx)`).addEventListener?.("change", publish, {
|
|
67
|
-
once: true
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
publish();
|
|
71
|
-
}
|
|
72
|
-
function deviceStrokeStageStyle(scale) {
|
|
73
|
-
if (!Number.isFinite(scale) || scale <= 0) {
|
|
74
|
-
return {};
|
|
75
|
-
}
|
|
76
|
-
watchDevicePixelRatio();
|
|
77
|
-
return {
|
|
78
|
-
[DEVICE_PX_VAR]: `calc(1px / (${Number(scale.toFixed(6))} * var(${DEVICE_PIXEL_RATIO_VAR}, 1)))`
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
var CARRIER_SELECTOR = `[style*="${DEVICE_PX_VAR}:"]`;
|
|
82
|
-
function carriers(root) {
|
|
83
|
-
const nested = [...root.querySelectorAll(CARRIER_SELECTOR)];
|
|
84
|
-
return root.closest(CARRIER_SELECTOR) ? [root, ...nested.filter((el) => el !== root)] : nested;
|
|
85
|
-
}
|
|
86
|
-
function neutralizeDeviceStrokes(root) {
|
|
87
|
-
for (const el of carriers(root)) {
|
|
88
|
-
el.style?.setProperty(DEVICE_PX_VAR, "0px");
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function withAuthoredStrokeWidths(root, read) {
|
|
92
|
-
const saved = carriers(root).map((el) => ({
|
|
93
|
-
el,
|
|
94
|
-
hadStyle: el.hasAttribute("style"),
|
|
95
|
-
value: el.style?.getPropertyValue(DEVICE_PX_VAR) ?? "",
|
|
96
|
-
priority: el.style?.getPropertyPriority(DEVICE_PX_VAR) ?? ""
|
|
97
|
-
}));
|
|
98
|
-
for (const { el } of saved) {
|
|
99
|
-
el.style?.setProperty(DEVICE_PX_VAR, "0px");
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
return read();
|
|
103
|
-
} finally {
|
|
104
|
-
for (const { el, hadStyle, value, priority } of saved) {
|
|
105
|
-
if (value) {
|
|
106
|
-
el.style?.setProperty(DEVICE_PX_VAR, value, priority);
|
|
107
|
-
} else {
|
|
108
|
-
el.style?.removeProperty(DEVICE_PX_VAR);
|
|
109
|
-
}
|
|
110
|
-
if (!hadStyle && !el.getAttribute("style")) {
|
|
111
|
-
el.removeAttribute("style");
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
5
|
// src/pptx/render/export-clone.ts
|
|
118
6
|
function isExportIgnoredElement(element) {
|
|
119
7
|
return element.getAttribute("data-export-ignore") === "true";
|
|
@@ -144,7 +32,7 @@ async function loadChart3DThree() {
|
|
|
144
32
|
|
|
145
33
|
// src/pptx/three-view/scene-registry.ts
|
|
146
34
|
var loaders = {
|
|
147
|
-
chart: async () => (await import('./chart-3d-view-scene-
|
|
35
|
+
chart: async () => (await import('./chart-3d-view-scene-D6OJTZYC.mjs')).mountChart3DView,
|
|
148
36
|
smartart: async () => (await import('./view-scene-GHBN7QMR.mjs')).mountSmartArt3DView
|
|
149
37
|
};
|
|
150
38
|
async function loadThreeViewScene(kind) {
|
|
@@ -1066,4 +954,4 @@ function pinCapturedSize(original, clonedEl) {
|
|
|
1066
954
|
});
|
|
1067
955
|
}
|
|
1068
956
|
|
|
1069
|
-
export { CLONE_STYLE_SHEET_TIMEOUT_MS,
|
|
957
|
+
export { CLONE_STYLE_SHEET_TIMEOUT_MS, MAX_DEVICE_PIXEL_RATIO, THREE_VIEW_MARKER_ATTR, THREE_VIEW_SETTLE_TIMEOUT_MS, THREE_VIEW_SNAPSHOT_ATTR, THREE_VIEW_TAG, clonedStyleSheetsLoaded, computeThreeViewSize, defineThreeViewElement, flatten3dTransform, flatten3dTransforms, flattenBackdropFilter, flattenMixBlendMode, has3dTransform, html2canvasCaptureScope, isExportIgnoredElement, parseBlurValue, pinCapturedSize, prepareExportClone, prepareHtml2CanvasClone, preprocessCssForCapture, removeUnsupportedFeatures, resolveCustomProperties, settleThreeViews, snapshotThreeViewsIntoClone };
|