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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkHWJKBKCW_cjs = require('./chunk-HWJKBKCW.cjs');
|
|
3
4
|
var pptx = require('ooxml-core/pptx');
|
|
4
5
|
var chart = require('ooxml-core/chart');
|
|
5
6
|
var color = require('ooxml-core/color');
|
|
6
7
|
var diagram = require('ooxml-core/diagram');
|
|
7
8
|
var regionMap = require('ooxml-core/chart/region-map');
|
|
8
9
|
|
|
9
|
-
// src/pptx/render/chart-font.ts
|
|
10
10
|
var CHART_PX_PER_PT = 4 / 3;
|
|
11
11
|
function chartFontPx(sizePt) {
|
|
12
12
|
return sizePt * CHART_PX_PER_PT;
|
|
@@ -151,6 +151,57 @@ function upsertDataPoint(dataPoints, point) {
|
|
|
151
151
|
return next;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
// src/pptx/render/dash-pattern.ts
|
|
155
|
+
var PRESET_PATTERNS = {
|
|
156
|
+
dash: [4, 3],
|
|
157
|
+
dot: [1, 3],
|
|
158
|
+
lgDash: [8, 3],
|
|
159
|
+
dashDot: [4, 3, 1, 3],
|
|
160
|
+
lgDashDot: [8, 3, 1, 3],
|
|
161
|
+
lgDashDotDot: [8, 3, 1, 3, 1, 3],
|
|
162
|
+
sysDash: [3, 1],
|
|
163
|
+
sysDot: [1, 1],
|
|
164
|
+
sysDashDot: [3, 1, 1, 1],
|
|
165
|
+
sysDashDotDot: [3, 1, 1, 1, 1, 1]
|
|
166
|
+
};
|
|
167
|
+
var CUSTOM_DASH_UNIT = 1e5;
|
|
168
|
+
var FALLBACK_CUSTOM_PATTERN = [3, 2];
|
|
169
|
+
function dashPenWidth(strokeWidth) {
|
|
170
|
+
if (!Number.isFinite(strokeWidth) || strokeWidth <= 1) return 1;
|
|
171
|
+
return Math.max(1, Math.ceil(strokeWidth - 0.5));
|
|
172
|
+
}
|
|
173
|
+
function dashPatternUnits(dashType, customSegments) {
|
|
174
|
+
if (!dashType || dashType === "solid") return void 0;
|
|
175
|
+
if (dashType === "custom") {
|
|
176
|
+
const pattern = (customSegments ?? []).flatMap((seg) => [
|
|
177
|
+
Math.max(0, seg.dash) / CUSTOM_DASH_UNIT,
|
|
178
|
+
Math.max(0, seg.space) / CUSTOM_DASH_UNIT
|
|
179
|
+
]);
|
|
180
|
+
return pattern.some((n) => n > 0) ? pattern : FALLBACK_CUSTOM_PATTERN;
|
|
181
|
+
}
|
|
182
|
+
return PRESET_PATTERNS[dashType];
|
|
183
|
+
}
|
|
184
|
+
function isDashedStroke(dashType) {
|
|
185
|
+
return dashType !== void 0 && dashType !== "solid" && dashType !== "";
|
|
186
|
+
}
|
|
187
|
+
function capCompensatedDashArray(pattern, strokeWidth, lineCap) {
|
|
188
|
+
const pen = dashPenWidth(strokeWidth);
|
|
189
|
+
const round = lineCap === "rnd";
|
|
190
|
+
const out = [];
|
|
191
|
+
for (let i = 0; i < pattern.length; i += 1) {
|
|
192
|
+
const len = (pattern[i] ?? 0) * pen;
|
|
193
|
+
if (!round) {
|
|
194
|
+
out.push(len);
|
|
195
|
+
} else if (i % 2 === 0) {
|
|
196
|
+
out.push(Math.max(0, len - pen));
|
|
197
|
+
} else {
|
|
198
|
+
const dash = (pattern[i - 1] ?? 0) * pen;
|
|
199
|
+
out.push(len + (dash - Math.max(0, dash - pen)));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return out.map((n) => Number(n.toFixed(4))).join(" ");
|
|
203
|
+
}
|
|
204
|
+
|
|
154
205
|
// src/pptx/constants.ts
|
|
155
206
|
var DEFAULT_CANVAS_WIDTH = 1280;
|
|
156
207
|
var DEFAULT_CANVAS_HEIGHT = 720;
|
|
@@ -163,15 +214,2430 @@ var DEFAULT_TEXT_FONT_SIZE = 24;
|
|
|
163
214
|
var DEFAULT_BODY_INSET_LR_PX = 91440 / 9525;
|
|
164
215
|
var DEFAULT_BODY_INSET_TB_PX = 45720 / 9525;
|
|
165
216
|
|
|
217
|
+
// src/pptx/render/chart-format/chart-area-outer-effects.ts
|
|
218
|
+
var PX_PER_PT = 96 / 72;
|
|
219
|
+
function chartAreaEffectStyle(data) {
|
|
220
|
+
const format = data?.elementFormats?.chartArea;
|
|
221
|
+
const effects = format && !format.reset ? format.effects : void 0;
|
|
222
|
+
if (!effects || !effects.shadow && !(effects.glow && effects.glow.radius > 0)) {
|
|
223
|
+
return void 0;
|
|
224
|
+
}
|
|
225
|
+
const fill = format?.fill?.kind ?? (data?.style?.chartAreaFill === "none" ? "none" : "automatic");
|
|
226
|
+
const line2 = format?.line?.kind ?? (data?.style?.chartAreaBorder ? "solid" : "automatic");
|
|
227
|
+
if (fill === "none" && line2 !== "solid" && line2 !== "gradient") {
|
|
228
|
+
return void 0;
|
|
229
|
+
}
|
|
230
|
+
const style = {};
|
|
231
|
+
if (effects.shadow) {
|
|
232
|
+
const s = effects.shadow;
|
|
233
|
+
style.shadowColor = s.color;
|
|
234
|
+
style.shadowOpacity = 1 - (s.transparency ?? 0) / 100;
|
|
235
|
+
style.shadowBlur = s.blur * PX_PER_PT;
|
|
236
|
+
style.shadowDistance = s.distance * PX_PER_PT;
|
|
237
|
+
style.shadowAngle = s.angle;
|
|
238
|
+
style.outerShadowXml = {};
|
|
239
|
+
}
|
|
240
|
+
if (effects.glow && effects.glow.radius > 0) {
|
|
241
|
+
style.glowColor = effects.glow.color;
|
|
242
|
+
style.glowRadius = effects.glow.radius * PX_PER_PT;
|
|
243
|
+
style.glowOpacity = 1 - (effects.glow.transparency ?? 0) / 100;
|
|
244
|
+
}
|
|
245
|
+
return style;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// src/pptx/render/effect-profile.ts
|
|
249
|
+
var SHADOW_BLUR_TO_CSS = 0.654;
|
|
250
|
+
var GLOW_GROW_FRACTION = 0.417;
|
|
251
|
+
var GLOW_SIGMA_FRACTION = 1 / 6;
|
|
252
|
+
function shadowBlurToCss(blurRadius) {
|
|
253
|
+
return Math.max(0, blurRadius) * SHADOW_BLUR_TO_CSS;
|
|
254
|
+
}
|
|
255
|
+
function glowCssLengths(radius) {
|
|
256
|
+
const r = Math.max(0, radius);
|
|
257
|
+
return { spread: r * GLOW_GROW_FRACTION, blur: r * GLOW_SIGMA_FRACTION * 2 };
|
|
258
|
+
}
|
|
259
|
+
var GLOW_FILTER_LAYERS = 3;
|
|
260
|
+
var GLOW_FILTER_BLUR_FRACTION = 0.38;
|
|
261
|
+
function glowFilterLengths(radius) {
|
|
262
|
+
const blur = Math.max(0, radius) * GLOW_FILTER_BLUR_FRACTION;
|
|
263
|
+
return Array.from({ length: GLOW_FILTER_LAYERS }, () => Math.round(blur * 100) / 100);
|
|
264
|
+
}
|
|
265
|
+
var TEXT_SHADOW_BLUR_TO_CSS = 0.72;
|
|
266
|
+
|
|
267
|
+
// src/pptx/render/reflection.ts
|
|
268
|
+
function clampUnit(value) {
|
|
269
|
+
return value < 0 ? 0 : value > 1 ? 1 : value;
|
|
270
|
+
}
|
|
271
|
+
var ALGN_TRANSFORM_ORIGIN = {
|
|
272
|
+
tl: "left top",
|
|
273
|
+
t: "center top",
|
|
274
|
+
tr: "right top",
|
|
275
|
+
l: "left top",
|
|
276
|
+
ctr: "center top",
|
|
277
|
+
r: "right top",
|
|
278
|
+
bl: "left bottom",
|
|
279
|
+
b: "center bottom",
|
|
280
|
+
br: "right bottom"
|
|
281
|
+
};
|
|
282
|
+
function buildReflectionMaskGradient(cssAngleDeg, startOpacity, endOpacity, fadeLength, blurRadius, holdPx) {
|
|
283
|
+
const effectiveFadeLength = fadeLength + blurRadius * 2;
|
|
284
|
+
const midOpacity = (startOpacity + endOpacity) / 2;
|
|
285
|
+
const midPoint = Math.round(effectiveFadeLength * 0.5);
|
|
286
|
+
const holdStop = holdPx > 0 ? `, rgba(0,0,0,${startOpacity}) ${holdPx}px` : "";
|
|
287
|
+
if (blurRadius > 0) {
|
|
288
|
+
return `linear-gradient(${cssAngleDeg}deg, rgba(0,0,0,${startOpacity}) 0px${holdStop}, rgba(0,0,0,${midOpacity}) ${midPoint}px, rgba(0,0,0,${endOpacity}) ${effectiveFadeLength}px)`;
|
|
289
|
+
}
|
|
290
|
+
return `linear-gradient(${cssAngleDeg}deg, rgba(0,0,0,${startOpacity}) 0px${holdStop}, rgba(0,0,0,${endOpacity}) ${fadeLength}px)`;
|
|
291
|
+
}
|
|
292
|
+
function getReflectionWrapperStyle(style, elementHeight) {
|
|
293
|
+
if (!style) {
|
|
294
|
+
return void 0;
|
|
295
|
+
}
|
|
296
|
+
const hasReflection = typeof style.reflectionStartOpacity === "number" && style.reflectionStartOpacity > 0 || typeof style.reflectionDistance === "number" && style.reflectionDistance > 0 || typeof style.reflectionBlurRadius === "number" && style.reflectionBlurRadius > 0;
|
|
297
|
+
if (!hasReflection) {
|
|
298
|
+
return void 0;
|
|
299
|
+
}
|
|
300
|
+
const distance = style.reflectionDistance ?? 0;
|
|
301
|
+
const startOpacity = clampUnit(
|
|
302
|
+
typeof style.reflectionStartOpacity === "number" ? style.reflectionStartOpacity : 0.5
|
|
303
|
+
);
|
|
304
|
+
const endOpacity = clampUnit(
|
|
305
|
+
typeof style.reflectionEndOpacity === "number" ? style.reflectionEndOpacity : 0
|
|
306
|
+
);
|
|
307
|
+
const fadeLength = typeof style.reflectionEndPosition === "number" ? Math.round(style.reflectionEndPosition * Math.max(elementHeight, 1)) : 100;
|
|
308
|
+
const blurRadius = typeof style.reflectionBlurRadius === "number" ? Math.max(0, style.reflectionBlurRadius) : 0;
|
|
309
|
+
const holdPx = typeof style.reflectionStartPosition === "number" && style.reflectionStartPosition > 0 ? Math.round(Math.min(clampUnit(style.reflectionStartPosition) * fadeLength, fadeLength - 1)) : 0;
|
|
310
|
+
const fadeDirectionDeg = style.reflectionFadeDirection ?? 90;
|
|
311
|
+
const cssAngleDeg = ((fadeDirectionDeg + 90) % 360 + 360) % 360;
|
|
312
|
+
const scaleX = (style.reflectionScaleX ?? 1e5) / 1e5;
|
|
313
|
+
const scaleY = (style.reflectionScaleY ?? -1e5) / 1e5;
|
|
314
|
+
const skewX = (style.reflectionSkewX ?? 0) / 6e4;
|
|
315
|
+
const skewY = (style.reflectionSkewY ?? 0) / 6e4;
|
|
316
|
+
const rotation = (style.reflectionRotation ?? 0) / 6e4;
|
|
317
|
+
const transformParts = [`scale(${scaleX}, ${scaleY})`];
|
|
318
|
+
if (skewX !== 0 || skewY !== 0) {
|
|
319
|
+
transformParts.push(`skew(${skewX}deg, ${skewY}deg)`);
|
|
320
|
+
}
|
|
321
|
+
if (rotation !== 0) {
|
|
322
|
+
transformParts.push(`rotate(${rotation}deg)`);
|
|
323
|
+
}
|
|
324
|
+
const maskImage = buildReflectionMaskGradient(
|
|
325
|
+
cssAngleDeg,
|
|
326
|
+
startOpacity,
|
|
327
|
+
endOpacity,
|
|
328
|
+
fadeLength,
|
|
329
|
+
blurRadius,
|
|
330
|
+
holdPx
|
|
331
|
+
);
|
|
332
|
+
return {
|
|
333
|
+
position: "absolute",
|
|
334
|
+
left: "0",
|
|
335
|
+
top: `calc(100% + ${Math.round(distance)}px)`,
|
|
336
|
+
width: "100%",
|
|
337
|
+
height: "100%",
|
|
338
|
+
transform: transformParts.join(" "),
|
|
339
|
+
transformOrigin: ALGN_TRANSFORM_ORIGIN[style.reflectionAlignment ?? "ctr"] ?? "center top",
|
|
340
|
+
maskImage,
|
|
341
|
+
WebkitMaskImage: maskImage,
|
|
342
|
+
pointerEvents: "none"
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
function getTextReflectionWrapperStyle(style, elementHeight) {
|
|
346
|
+
if (!style?.textReflection) {
|
|
347
|
+
return void 0;
|
|
348
|
+
}
|
|
349
|
+
return getReflectionWrapperStyle(
|
|
350
|
+
{
|
|
351
|
+
reflectionStartOpacity: style.textReflectionStartOpacity ?? 0.5,
|
|
352
|
+
reflectionEndOpacity: style.textReflectionEndOpacity ?? 0,
|
|
353
|
+
reflectionDistance: style.textReflectionOffset ?? 0,
|
|
354
|
+
reflectionBlurRadius: style.textReflectionBlur ?? 0,
|
|
355
|
+
reflectionFadeDirection: style.textReflectionFadeDirection,
|
|
356
|
+
reflectionScaleX: style.textReflectionScaleX,
|
|
357
|
+
reflectionScaleY: style.textReflectionScaleY,
|
|
358
|
+
reflectionSkewX: style.textReflectionSkewX,
|
|
359
|
+
reflectionSkewY: style.textReflectionSkewY,
|
|
360
|
+
reflectionRotation: style.textReflectionRotation,
|
|
361
|
+
reflectionAlignment: style.textReflectionAlignment
|
|
362
|
+
},
|
|
363
|
+
elementHeight
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
function resolveLiveCustomGeometryPath(element) {
|
|
367
|
+
const el = element;
|
|
368
|
+
if (!el.pathData || !el.pathWidth || !el.pathHeight) {
|
|
369
|
+
return void 0;
|
|
370
|
+
}
|
|
371
|
+
const overrides = el.shapeAdjustments;
|
|
372
|
+
if (overrides && Object.keys(overrides).length > 0 && el.customGeometryRawData) {
|
|
373
|
+
const live = pptx.evaluateCustomGeometryPathData(
|
|
374
|
+
el.customGeometryRawData,
|
|
375
|
+
el.pathWidth,
|
|
376
|
+
el.pathHeight,
|
|
377
|
+
overrides
|
|
378
|
+
);
|
|
379
|
+
if (live) {
|
|
380
|
+
return live;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return { pathData: el.pathData, pathWidth: el.pathWidth, pathHeight: el.pathHeight };
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// src/pptx/render/shape-geometry.ts
|
|
387
|
+
function getResolvedShapeClipPathFor(shapeType, width, height, adjustments) {
|
|
388
|
+
if (!shapeType) {
|
|
389
|
+
return void 0;
|
|
390
|
+
}
|
|
391
|
+
if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
|
|
392
|
+
return pptx.getShapeClipPath(shapeType);
|
|
393
|
+
}
|
|
394
|
+
if (adjustments && Object.keys(adjustments).length > 0) {
|
|
395
|
+
const adjusted = pptx.getAdjustmentAwareClipPath(shapeType, width, height, adjustments);
|
|
396
|
+
if (adjusted !== void 0) {
|
|
397
|
+
return adjusted;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
const fromPreset = pptx.getShapeClipPathFromPreset(shapeType, width, height, adjustments);
|
|
401
|
+
if (fromPreset !== void 0) {
|
|
402
|
+
return fromPreset;
|
|
403
|
+
}
|
|
404
|
+
const cloud = pptx.getCloudPathForRendering(shapeType, width, height);
|
|
405
|
+
if (cloud !== void 0) {
|
|
406
|
+
return cloud;
|
|
407
|
+
}
|
|
408
|
+
return pptx.getShapeClipPath(shapeType);
|
|
409
|
+
}
|
|
410
|
+
function buildCustomGeometryClipPath(pathData, pathWidth, pathHeight, elemWidth, elemHeight) {
|
|
411
|
+
if (!pathData || !Number.isFinite(pathWidth) || !Number.isFinite(pathHeight) || pathWidth <= 0 || pathHeight <= 0 || !Number.isFinite(elemWidth) || !Number.isFinite(elemHeight) || elemWidth <= 0 || elemHeight <= 0) {
|
|
412
|
+
return void 0;
|
|
413
|
+
}
|
|
414
|
+
const sx = elemWidth / pathWidth;
|
|
415
|
+
const sy = elemHeight / pathHeight;
|
|
416
|
+
const round = (n) => {
|
|
417
|
+
const r = Math.round(n * 100) / 100;
|
|
418
|
+
return Object.is(r, -0) ? "0" : String(r);
|
|
419
|
+
};
|
|
420
|
+
const tokens = pathData.match(/[MLCQZAHVmlcqzahv][^MLCQZAHVmlcqzahv]*/g) ?? [];
|
|
421
|
+
const out = [];
|
|
422
|
+
for (const token of tokens) {
|
|
423
|
+
const cmd = token[0];
|
|
424
|
+
const upper = cmd.toUpperCase();
|
|
425
|
+
if (upper === "Z") {
|
|
426
|
+
out.push("Z");
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
const nums = (token.slice(1).match(/-?[\d.]+(?:e-?\d+)?/gi) ?? []).map(Number);
|
|
430
|
+
if (upper === "A") {
|
|
431
|
+
const parts = [];
|
|
432
|
+
for (let i = 0; i + 6 < nums.length; i += 7) {
|
|
433
|
+
parts.push(
|
|
434
|
+
round(nums[i] * sx),
|
|
435
|
+
round(nums[i + 1] * sy),
|
|
436
|
+
String(nums[i + 2]),
|
|
437
|
+
String(nums[i + 3]),
|
|
438
|
+
String(nums[i + 4]),
|
|
439
|
+
round(nums[i + 5] * sx),
|
|
440
|
+
round(nums[i + 6] * sy)
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
out.push(`A ${parts.join(" ")}`);
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
const scaled = nums.map((n, i) => round(n * (i % 2 === 0 ? sx : sy)));
|
|
447
|
+
out.push(`${upper} ${scaled.join(" ")}`);
|
|
448
|
+
}
|
|
449
|
+
if (out.length === 0) {
|
|
450
|
+
return void 0;
|
|
451
|
+
}
|
|
452
|
+
return `path('${out.join(" ")}')`;
|
|
453
|
+
}
|
|
454
|
+
function getResolvedShapeClipPath(element, width, height) {
|
|
455
|
+
const w = typeof width === "number" ? width : element.width;
|
|
456
|
+
const h = typeof height === "number" ? height : element.height;
|
|
457
|
+
const live = resolveLiveCustomGeometryPath(element);
|
|
458
|
+
if (live) {
|
|
459
|
+
const customClip = buildCustomGeometryClipPath(
|
|
460
|
+
live.pathData,
|
|
461
|
+
live.pathWidth,
|
|
462
|
+
live.pathHeight,
|
|
463
|
+
w,
|
|
464
|
+
h
|
|
465
|
+
);
|
|
466
|
+
if (customClip) {
|
|
467
|
+
return customClip;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
const shapeType = element.shapeType;
|
|
471
|
+
if (!shapeType) {
|
|
472
|
+
return void 0;
|
|
473
|
+
}
|
|
474
|
+
const adjustments = element.shapeAdjustments;
|
|
475
|
+
return getResolvedShapeClipPathFor(shapeType, w, h, adjustments);
|
|
476
|
+
}
|
|
477
|
+
var IDENTITY_RECT_PRESETS = /* @__PURE__ */ new Set(["rect", "flowchartprocess"]);
|
|
478
|
+
function isIdentityRectClip(element) {
|
|
479
|
+
const custom = element;
|
|
480
|
+
if (custom.pathData && custom.pathWidth && custom.pathHeight) {
|
|
481
|
+
return false;
|
|
482
|
+
}
|
|
483
|
+
const shapeType = element.shapeType;
|
|
484
|
+
return shapeType !== void 0 && IDENTITY_RECT_PRESETS.has(shapeType.toLowerCase());
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// src/pptx/render/connector-style.ts
|
|
488
|
+
var COMPOUND_BANDS = {
|
|
489
|
+
dbl: [1 / 3, 1 / 3, 1 / 3],
|
|
490
|
+
thickThin: [0.6, 0.2, 0.2],
|
|
491
|
+
thinThick: [0.2, 0.2, 0.6],
|
|
492
|
+
tri: [1 / 6, 1 / 6, 1 / 3, 1 / 6, 1 / 6]
|
|
493
|
+
};
|
|
494
|
+
function compoundStrands(compoundLine) {
|
|
495
|
+
const bands = compoundLine ? COMPOUND_BANDS[compoundLine] : void 0;
|
|
496
|
+
if (!bands) {
|
|
497
|
+
return void 0;
|
|
498
|
+
}
|
|
499
|
+
const strands = [];
|
|
500
|
+
let edge = -0.5;
|
|
501
|
+
bands.forEach((band2, index) => {
|
|
502
|
+
if (index % 2 === 0) {
|
|
503
|
+
strands.push([edge + band2 / 2, band2]);
|
|
504
|
+
}
|
|
505
|
+
edge += band2;
|
|
506
|
+
});
|
|
507
|
+
return strands;
|
|
508
|
+
}
|
|
509
|
+
function getCompoundLineOffsets(compoundLine, strokeWidth) {
|
|
510
|
+
const base = Math.max(strokeWidth, 1);
|
|
511
|
+
const exact = (value) => Math.round(value * 1e6) / 1e6 + 0;
|
|
512
|
+
return compoundStrands(compoundLine)?.map(([offset]) => exact(offset * base)) ?? [0];
|
|
513
|
+
}
|
|
514
|
+
function getCompoundLineWidths(compoundLine, strokeWidth) {
|
|
515
|
+
const base = Math.max(strokeWidth, 1);
|
|
516
|
+
return compoundStrands(compoundLine)?.map(([, width]) => width * base) ?? [base];
|
|
517
|
+
}
|
|
518
|
+
function connectorStrandScreenWidth(widths, strokeWidth, idx) {
|
|
519
|
+
return widths.length > 1 ? chunkHWJKBKCW_cjs.screenBorderWidth(widths[idx] ?? strokeWidth) : chunkHWJKBKCW_cjs.screenStrokeWidth(strokeWidth, 1);
|
|
520
|
+
}
|
|
521
|
+
function svgLineCap(lineCap, dashed = false) {
|
|
522
|
+
switch (lineCap) {
|
|
523
|
+
case "flat":
|
|
524
|
+
return "butt";
|
|
525
|
+
case "sq":
|
|
526
|
+
return dashed ? "butt" : "square";
|
|
527
|
+
case "rnd":
|
|
528
|
+
return "round";
|
|
529
|
+
default:
|
|
530
|
+
return "butt";
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function connectorKind(shapeType) {
|
|
534
|
+
const t = (shapeType ?? "").toLowerCase();
|
|
535
|
+
if (t.includes("bentconnector")) {
|
|
536
|
+
return "bent";
|
|
537
|
+
}
|
|
538
|
+
if (t.includes("curvedconnector")) {
|
|
539
|
+
return "curved";
|
|
540
|
+
}
|
|
541
|
+
return "straight";
|
|
542
|
+
}
|
|
543
|
+
function connectorNeedsPath(shapeType) {
|
|
544
|
+
return connectorKind(shapeType) !== "straight";
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// src/pptx/render/device-pixel-exact.ts
|
|
548
|
+
var EMU_PER_PX = 9525;
|
|
549
|
+
var EMU_PER_MASTER_UNIT = 1587.5;
|
|
550
|
+
var MASTER_UNITS_PER_PX = EMU_PER_PX / EMU_PER_MASTER_UNIT;
|
|
551
|
+
function exactPx(model, emu) {
|
|
552
|
+
if (typeof emu !== "number" || !Number.isFinite(emu)) {
|
|
553
|
+
return model;
|
|
554
|
+
}
|
|
555
|
+
return Math.round(emu / EMU_PER_PX) === Math.round(model) ? Math.round(emu / EMU_PER_MASTER_UNIT) / MASTER_UNITS_PER_PX : model;
|
|
556
|
+
}
|
|
557
|
+
function exactDeviceBox(element) {
|
|
558
|
+
return {
|
|
559
|
+
x: exactPx(element.x, element.xEmu),
|
|
560
|
+
y: exactPx(element.y, element.yEmu),
|
|
561
|
+
width: exactPx(element.width, element.widthEmu),
|
|
562
|
+
height: exactPx(element.height, element.heightEmu)
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// src/pptx/render/device-pixel-group.ts
|
|
567
|
+
var parents = /* @__PURE__ */ new WeakMap();
|
|
568
|
+
function registerGroupChildren(group) {
|
|
569
|
+
if (group.type !== "group") {
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
for (const child of group.children) {
|
|
573
|
+
parents.set(child, group);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
var EMU_PER_PX2 = 9525;
|
|
577
|
+
function exactOrigin(group) {
|
|
578
|
+
const emuX = group.xEmu;
|
|
579
|
+
const emuY = group.yEmu;
|
|
580
|
+
return {
|
|
581
|
+
x: typeof emuX === "number" && Math.round(emuX / EMU_PER_PX2) === Math.round(group.x) ? emuX / EMU_PER_PX2 : group.x,
|
|
582
|
+
y: typeof emuY === "number" && Math.round(emuY / EMU_PER_PX2) === Math.round(group.y) ? emuY / EMU_PER_PX2 : group.y
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
function snapPlacement(element) {
|
|
586
|
+
const own = exactDeviceBox(element);
|
|
587
|
+
let group = parents.get(element);
|
|
588
|
+
if (!group) {
|
|
589
|
+
return { x: element.x, y: element.y, exact: own };
|
|
590
|
+
}
|
|
591
|
+
let shownX = 0;
|
|
592
|
+
let shownY = 0;
|
|
593
|
+
let trueX = 0;
|
|
594
|
+
let trueY = 0;
|
|
595
|
+
for (let depth = 0; group && depth < 64; depth++) {
|
|
596
|
+
if (group.rotation || group.flipHorizontal || group.flipVertical) {
|
|
597
|
+
return void 0;
|
|
598
|
+
}
|
|
599
|
+
const origin = exactOrigin(group);
|
|
600
|
+
shownX += group.x;
|
|
601
|
+
shownY += group.y;
|
|
602
|
+
trueX += origin.x;
|
|
603
|
+
trueY += origin.y;
|
|
604
|
+
group = parents.get(group);
|
|
605
|
+
}
|
|
606
|
+
return {
|
|
607
|
+
// Chromium snaps an inline `<svg>` root (every stroke overlay and connector)
|
|
608
|
+
// to a whole stage pixel, so that is where the painted stroke really starts.
|
|
609
|
+
x: Math.round(shownX + element.x),
|
|
610
|
+
y: Math.round(shownY + element.y),
|
|
611
|
+
exact: {
|
|
612
|
+
x: trueX + element.x,
|
|
613
|
+
y: trueY + element.y,
|
|
614
|
+
width: element.width,
|
|
615
|
+
height: element.height
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// src/pptx/render/connector-markers.ts
|
|
621
|
+
var ARROW_MARKER_SIZE = { sm: 2, med: 3, lg: 5 };
|
|
622
|
+
function markerPath(type, arrowWidth, arrowLength) {
|
|
623
|
+
const markerWidth = ARROW_MARKER_SIZE[arrowLength ?? "med"] ?? 3;
|
|
624
|
+
const markerHeight = ARROW_MARKER_SIZE[arrowWidth ?? "med"] ?? 3;
|
|
625
|
+
const box = { markerWidth, markerHeight, refX: 10 };
|
|
626
|
+
switch (type) {
|
|
627
|
+
case "diamond":
|
|
628
|
+
return { shape: "path", d: "M5 0 L10 5 L5 10 L0 5 Z", ...box, refX: 5 };
|
|
629
|
+
case "oval":
|
|
630
|
+
return { shape: "circle", ...box, refX: 5 };
|
|
631
|
+
case "stealth":
|
|
632
|
+
return { shape: "path", d: "M0 0 L10 5 L0 10 L3 5 Z", ...box };
|
|
633
|
+
case "arrow":
|
|
634
|
+
return { shape: "path", d: "M1 1 L9 5 L1 9", strokeOnly: true, ...box, refX: 9 };
|
|
635
|
+
// triangle / fallback
|
|
636
|
+
default:
|
|
637
|
+
return { shape: "path", d: "M0 0 L10 5 L0 10 Z", ...box };
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
function normalizeArrow(a) {
|
|
641
|
+
return a && a !== "none" ? a : void 0;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// src/pptx/render/stroke-paint.ts
|
|
645
|
+
function hasStrokePaint(style) {
|
|
646
|
+
if (!style || Math.max(0, style.strokeWidth ?? 0) <= 0) {
|
|
647
|
+
return false;
|
|
648
|
+
}
|
|
649
|
+
return style.strokeColor !== void 0 || style.strokeFillMode !== void 0;
|
|
650
|
+
}
|
|
651
|
+
function paintedStrokeWidth(style) {
|
|
652
|
+
return hasStrokePaint(style) ? Math.max(0, style?.strokeWidth ?? 0) : 0;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// src/pptx/render/custom-path-markers.ts
|
|
656
|
+
function isArrowedCustomPath(element) {
|
|
657
|
+
if (element.type !== "shape" || !element.pathData || !element.pathWidth || !element.pathHeight) {
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
const style = element.shapeStyle;
|
|
661
|
+
if (!hasStrokePaint(style) || (style?.strokeWidth ?? 0) <= 0) return false;
|
|
662
|
+
return !/[zZ]/u.test(element.pathData) && (style?.fillMode === "none" || style?.fillColor === "transparent") && Boolean(normalizeArrow(style?.connectorStartArrow) || normalizeArrow(style?.connectorEndArrow));
|
|
663
|
+
}
|
|
664
|
+
function buildCustomPathMarkers(element, stroke) {
|
|
665
|
+
if (!isArrowedCustomPath(element) || !pptx.hasShapeProperties(element)) return void 0;
|
|
666
|
+
const style = element.shapeStyle ?? {};
|
|
667
|
+
const seed = [...element.id].map((char) => char.codePointAt(0).toString(16)).join("-");
|
|
668
|
+
const markup = [];
|
|
669
|
+
const add = (end2) => {
|
|
670
|
+
const arrow = normalizeArrow(style[`connector${end2}Arrow`]);
|
|
671
|
+
if (!arrow) return void 0;
|
|
672
|
+
const shape = markerPath(
|
|
673
|
+
arrow,
|
|
674
|
+
style[`connector${end2}ArrowWidth`],
|
|
675
|
+
style[`connector${end2}ArrowLength`]
|
|
676
|
+
);
|
|
677
|
+
const id = `freeform-${seed}-${end2}`;
|
|
678
|
+
const color = escapeSvgAttr(stroke);
|
|
679
|
+
const body = shape.shape === "circle" ? `<circle cx="5" cy="5" r="4" fill="${color}"/>` : `<path d="${escapeSvgAttr(shape.d ?? "")}" fill="${shape.strokeOnly ? "none" : color}"${shape.strokeOnly ? ` stroke="${color}"` : ""}/>`;
|
|
680
|
+
markup.push(
|
|
681
|
+
`<marker id="${id}" viewBox="0 0 10 10" refX="${shape.refX}" refY="5" markerWidth="${shape.markerWidth}" markerHeight="${shape.markerHeight}" markerUnits="strokeWidth" orient="auto-start-reverse" preserveAspectRatio="none">${body}</marker>`
|
|
682
|
+
);
|
|
683
|
+
return `url(#${id})`;
|
|
684
|
+
};
|
|
685
|
+
const start = add("Start");
|
|
686
|
+
const end = add("End");
|
|
687
|
+
return { markup: markup.join(""), start, end };
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// src/pptx/render/dash-path-start.ts
|
|
691
|
+
var ARGS_PER_COMMAND = { M: 2, L: 2, C: 6, Q: 4, A: 7 };
|
|
692
|
+
var COUNTER_CLOCKWISE_PRESETS = /* @__PURE__ */ new Set(["ellipse", "oval", "flowchartconnector"]);
|
|
693
|
+
function parseFigure(d) {
|
|
694
|
+
const tokens = d.match(/[A-Za-z]|-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/giu);
|
|
695
|
+
if (!tokens) return void 0;
|
|
696
|
+
let start;
|
|
697
|
+
const segments = [];
|
|
698
|
+
let closed = false;
|
|
699
|
+
let cmd = "";
|
|
700
|
+
let i = 0;
|
|
701
|
+
while (i < tokens.length) {
|
|
702
|
+
const token = tokens[i];
|
|
703
|
+
if (/^[A-Za-z]$/u.test(token)) {
|
|
704
|
+
cmd = token;
|
|
705
|
+
i += 1;
|
|
706
|
+
if (cmd === "Z") {
|
|
707
|
+
closed = true;
|
|
708
|
+
if (i < tokens.length) return void 0;
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
const count = ARGS_PER_COMMAND[cmd];
|
|
713
|
+
if (count === void 0 || closed) return void 0;
|
|
714
|
+
const args = tokens.slice(i, i + count).map(Number);
|
|
715
|
+
i += count;
|
|
716
|
+
if (args.length < count || args.some((n) => !Number.isFinite(n))) return void 0;
|
|
717
|
+
const end = [args[count - 2], args[count - 1]];
|
|
718
|
+
if (cmd === "M") {
|
|
719
|
+
if (start) return void 0;
|
|
720
|
+
start = end;
|
|
721
|
+
} else {
|
|
722
|
+
if (!start) return void 0;
|
|
723
|
+
segments.push({ cmd, args, end });
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
return start && closed && segments.length > 0 ? { start, segments, closed } : void 0;
|
|
727
|
+
}
|
|
728
|
+
var num = (n) => String(Number(n.toFixed(5)));
|
|
729
|
+
function writeSegment(segment) {
|
|
730
|
+
return `${segment.cmd} ${segment.args.map(num).join(" ")}`;
|
|
731
|
+
}
|
|
732
|
+
function reverseSegments(figure) {
|
|
733
|
+
const points = [figure.start, ...figure.segments.map((s) => s.end)];
|
|
734
|
+
const out = [];
|
|
735
|
+
for (let i = figure.segments.length - 1; i >= 0; i -= 1) {
|
|
736
|
+
const segment = figure.segments[i];
|
|
737
|
+
const to = points[i];
|
|
738
|
+
const a = segment.args;
|
|
739
|
+
if (segment.cmd === "L") {
|
|
740
|
+
out.push(`L ${num(to[0])} ${num(to[1])}`);
|
|
741
|
+
} else if (segment.cmd === "C") {
|
|
742
|
+
const c = a;
|
|
743
|
+
out.push(`C ${[c[2], c[3], c[0], c[1], to[0], to[1]].map(num).join(" ")}`);
|
|
744
|
+
} else if (segment.cmd === "Q") {
|
|
745
|
+
out.push(`Q ${[a[0], a[1], to[0], to[1]].map((n) => num(n)).join(" ")}`);
|
|
746
|
+
} else {
|
|
747
|
+
const sweep = a[4] === 0 ? 1 : 0;
|
|
748
|
+
out.push(
|
|
749
|
+
`A ${[a[0], a[1], a[2], a[3], sweep, to[0], to[1]].map((n) => num(n)).join(" ")}`
|
|
750
|
+
);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
return out;
|
|
754
|
+
}
|
|
755
|
+
function dashStartPathData(d, shapeType) {
|
|
756
|
+
const figure = parseFigure(d);
|
|
757
|
+
if (!figure) return d;
|
|
758
|
+
const lastEnd = figure.segments[figure.segments.length - 1].end;
|
|
759
|
+
const selfClosing = Math.abs(lastEnd[0] - figure.start[0]) < 1e-3 && Math.abs(lastEnd[1] - figure.start[1]) < 1e-3;
|
|
760
|
+
if (selfClosing) {
|
|
761
|
+
if (!COUNTER_CLOCKWISE_PRESETS.has((shapeType ?? "").toLowerCase())) return d;
|
|
762
|
+
return `M ${num(figure.start[0])} ${num(figure.start[1])} ${reverseSegments(figure).join(" ")} Z`;
|
|
763
|
+
}
|
|
764
|
+
return [
|
|
765
|
+
`M ${num(lastEnd[0])} ${num(lastEnd[1])}`,
|
|
766
|
+
`L ${num(figure.start[0])} ${num(figure.start[1])}`,
|
|
767
|
+
...figure.segments.map(writeSegment),
|
|
768
|
+
"Z"
|
|
769
|
+
].join(" ");
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// src/pptx/render/stroke-clip-edge.ts
|
|
773
|
+
var ROUND_JOIN_STEPS = 8;
|
|
774
|
+
var fmt = (n) => String(Math.round(n * 1e3) / 1e3);
|
|
775
|
+
function signedArea(pts) {
|
|
776
|
+
let area = 0;
|
|
777
|
+
for (let k = 0; k < pts.length; k++) {
|
|
778
|
+
const a = pts[k];
|
|
779
|
+
const b = pts[(k + 1) % pts.length];
|
|
780
|
+
area += a[0] * b[1] - b[0] * a[1];
|
|
781
|
+
}
|
|
782
|
+
return area;
|
|
783
|
+
}
|
|
784
|
+
function offsetRing(pts, half, join, away) {
|
|
785
|
+
let last = [0, 0];
|
|
786
|
+
const normals = pts.map((a, k) => {
|
|
787
|
+
const b = pts[(k + 1) % pts.length];
|
|
788
|
+
const len = Math.hypot(b[0] - a[0], b[1] - a[1]);
|
|
789
|
+
if (len >= 1e-6) {
|
|
790
|
+
last = [away * -(b[1] - a[1]) / len, away * (b[0] - a[0]) / len];
|
|
791
|
+
}
|
|
792
|
+
return last;
|
|
793
|
+
});
|
|
794
|
+
const ring = [];
|
|
795
|
+
for (let k = 0; k < pts.length; k++) {
|
|
796
|
+
const v = pts[k];
|
|
797
|
+
const n1 = normals[(k - 1 + pts.length) % pts.length];
|
|
798
|
+
const n2 = normals[k];
|
|
799
|
+
const p1 = [v[0] + n1[0] * half, v[1] + n1[1] * half];
|
|
800
|
+
const p2 = [v[0] + n2[0] * half, v[1] + n2[1] * half];
|
|
801
|
+
const cosHalf = Math.sqrt(Math.max(0, (1 + n1[0] * n2[0] + n1[1] * n2[1]) / 2));
|
|
802
|
+
const bx = n1[0] + n2[0];
|
|
803
|
+
const by = n1[1] + n2[1];
|
|
804
|
+
const blen = Math.hypot(bx, by);
|
|
805
|
+
const miter = cosHalf > 1e-6 && blen > 1e-9 ? [v[0] + bx / blen * (half / cosHalf), v[1] + by / blen * (half / cosHalf)] : void 0;
|
|
806
|
+
const turn = n1[0] * n2[1] - n1[1] * n2[0];
|
|
807
|
+
const opensOutward = away * turn < 0;
|
|
808
|
+
if (!opensOutward || Math.abs(turn) < 1e-9) {
|
|
809
|
+
ring.push(miter ?? p2);
|
|
810
|
+
} else if (join.join === "miter" && miter && 1 / cosHalf <= join.miterLimit) {
|
|
811
|
+
ring.push(miter);
|
|
812
|
+
} else if (join.join === "round") {
|
|
813
|
+
const a1 = Math.atan2(n1[1], n1[0]);
|
|
814
|
+
let sweep = Math.atan2(n2[1], n2[0]) - a1;
|
|
815
|
+
while (sweep > Math.PI) sweep -= 2 * Math.PI;
|
|
816
|
+
while (sweep < -Math.PI) sweep += 2 * Math.PI;
|
|
817
|
+
for (let i = 0; i <= ROUND_JOIN_STEPS; i++) {
|
|
818
|
+
const t = a1 + sweep * i / ROUND_JOIN_STEPS;
|
|
819
|
+
ring.push([v[0] + Math.cos(t) * half, v[1] + Math.sin(t) * half]);
|
|
820
|
+
}
|
|
821
|
+
} else {
|
|
822
|
+
ring.push(p1, p2);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
return ring;
|
|
826
|
+
}
|
|
827
|
+
function outerStrokeEdgePath(d, strokeWidth, join) {
|
|
828
|
+
if (!(strokeWidth > 0)) {
|
|
829
|
+
return void 0;
|
|
830
|
+
}
|
|
831
|
+
const subpaths = flattenPath(d);
|
|
832
|
+
if (!subpaths || subpaths.length === 0) {
|
|
833
|
+
return void 0;
|
|
834
|
+
}
|
|
835
|
+
const reference = Math.sign(signedArea(subpaths[0])) || 1;
|
|
836
|
+
return subpaths.filter((sub) => sub.length > 2).map((sub) => {
|
|
837
|
+
const sign = Math.sign(signedArea(sub)) || reference;
|
|
838
|
+
const away = sign > 0 ? -1 : 1;
|
|
839
|
+
const ring = offsetRing(
|
|
840
|
+
sub,
|
|
841
|
+
strokeWidth / 2,
|
|
842
|
+
join,
|
|
843
|
+
sign === reference ? away : away === 1 ? -1 : 1
|
|
844
|
+
);
|
|
845
|
+
return `M ${ring.map(([x, y]) => `${fmt(x)} ${fmt(y)}`).join(" L ")} Z`;
|
|
846
|
+
}).join(" ");
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// src/pptx/render/stroke-compound-strands.ts
|
|
850
|
+
var fmt2 = (n) => String(Math.round(n * 1e3) / 1e3);
|
|
851
|
+
function offsetPolyline(points, distance) {
|
|
852
|
+
const normals = points.slice(1).map((b, k) => {
|
|
853
|
+
const a = points[k] ?? b;
|
|
854
|
+
const len = Math.hypot(b[0] - a[0], b[1] - a[1]) || 1;
|
|
855
|
+
return [-(b[1] - a[1]) / len, (b[0] - a[0]) / len];
|
|
856
|
+
});
|
|
857
|
+
return points.map((p, k) => {
|
|
858
|
+
const n1 = normals[Math.max(0, k - 1)] ?? [0, 0];
|
|
859
|
+
const n2 = normals[Math.min(normals.length - 1, k)] ?? n1;
|
|
860
|
+
const bx = n1[0] + n2[0];
|
|
861
|
+
const by = n1[1] + n2[1];
|
|
862
|
+
const blen = Math.hypot(bx, by);
|
|
863
|
+
const cos = blen / 2;
|
|
864
|
+
const reach = cos > 0.25 ? distance / cos : distance;
|
|
865
|
+
return blen > 1e-9 ? [p[0] + bx / blen * reach, p[1] + by / blen * reach] : p;
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
function compoundStrandPath(d, offset, join) {
|
|
869
|
+
const subpaths = flattenPath(d);
|
|
870
|
+
if (!subpaths || subpaths.length === 0) {
|
|
871
|
+
return void 0;
|
|
872
|
+
}
|
|
873
|
+
const closedCount = (d.match(/[zZ]/gu) ?? []).length;
|
|
874
|
+
return subpaths.map((sub, index) => {
|
|
875
|
+
const closed = index < closedCount;
|
|
876
|
+
const points = closed ? offsetRing(sub, Math.abs(offset), join, offset < 0 ? -1 : 1) : offsetPolyline(sub, offset);
|
|
877
|
+
const body = points.map(([x, y]) => `${fmt2(x)} ${fmt2(y)}`).join(" L ");
|
|
878
|
+
return `M ${body}${closed ? " Z" : ""}`;
|
|
879
|
+
}).join(" ");
|
|
880
|
+
}
|
|
881
|
+
function traceCompoundStrands(strands, d, join) {
|
|
882
|
+
if (strands.length < 2) {
|
|
883
|
+
return [...strands];
|
|
884
|
+
}
|
|
885
|
+
return strands.map((strand) => {
|
|
886
|
+
if (strand.offset === 0 || strand.d !== void 0) {
|
|
887
|
+
return strand;
|
|
888
|
+
}
|
|
889
|
+
const traced = compoundStrandPath(d, strand.offset, join);
|
|
890
|
+
return traced ? { ...strand, d: traced, offset: 0 } : strand;
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
function getStrokeOnlyPresetPaths(element) {
|
|
894
|
+
if (element.type !== "shape" || !pptx.hasShapeProperties(element)) {
|
|
895
|
+
return void 0;
|
|
896
|
+
}
|
|
897
|
+
const shapeType = element.shapeType;
|
|
898
|
+
if (!shapeType || shapeType === "custom") {
|
|
899
|
+
return void 0;
|
|
900
|
+
}
|
|
901
|
+
if (element.pathData) {
|
|
902
|
+
return void 0;
|
|
903
|
+
}
|
|
904
|
+
const result = pptx.evaluatePresetShape(
|
|
905
|
+
shapeType,
|
|
906
|
+
Math.max(element.width, 0),
|
|
907
|
+
Math.max(element.height, 0),
|
|
908
|
+
element.shapeAdjustments
|
|
909
|
+
);
|
|
910
|
+
if (!result || !result.fillNone) {
|
|
911
|
+
return void 0;
|
|
912
|
+
}
|
|
913
|
+
const drawable = result.paths.filter((path) => path.d !== "");
|
|
914
|
+
return drawable.length > 0 ? drawable : void 0;
|
|
915
|
+
}
|
|
916
|
+
function isStrokeOnlyPresetElement(element) {
|
|
917
|
+
return getStrokeOnlyPresetPaths(element) !== void 0;
|
|
918
|
+
}
|
|
919
|
+
function strokeOnlyPresetPathData(element) {
|
|
920
|
+
const paths = getStrokeOnlyPresetPaths(element);
|
|
921
|
+
if (!paths) {
|
|
922
|
+
return void 0;
|
|
923
|
+
}
|
|
924
|
+
const stroked = paths.filter((path) => path.stroke !== false).map((path) => path.d);
|
|
925
|
+
return stroked.length > 0 ? stroked.join(" ") : void 0;
|
|
926
|
+
}
|
|
927
|
+
function getSplitStrokePresetPaths(element) {
|
|
928
|
+
if (element.type !== "shape" || !pptx.hasShapeProperties(element) || element.pathData) {
|
|
929
|
+
return void 0;
|
|
930
|
+
}
|
|
931
|
+
const shapeType = element.shapeType;
|
|
932
|
+
if (!shapeType || shapeType === "custom") {
|
|
933
|
+
return void 0;
|
|
934
|
+
}
|
|
935
|
+
const result = pptx.evaluatePresetShape(
|
|
936
|
+
shapeType,
|
|
937
|
+
Math.max(element.width, 0),
|
|
938
|
+
Math.max(element.height, 0),
|
|
939
|
+
element.shapeAdjustments
|
|
940
|
+
);
|
|
941
|
+
if (!result || result.fillNone || !result.paths.some((path) => path.stroke === false)) {
|
|
942
|
+
return void 0;
|
|
943
|
+
}
|
|
944
|
+
return result.paths;
|
|
945
|
+
}
|
|
946
|
+
function splitStrokePresetPathData(element) {
|
|
947
|
+
const stroked = getSplitStrokePresetPaths(element)?.filter(
|
|
948
|
+
(path) => path.stroke !== false && path.d !== ""
|
|
949
|
+
);
|
|
950
|
+
return stroked && stroked.length > 0 ? stroked.map((path) => path.d).join(" ") : void 0;
|
|
951
|
+
}
|
|
952
|
+
var NO_STROKE = {
|
|
953
|
+
borderWidth: 0,
|
|
954
|
+
cssBorderWidth: "0px",
|
|
955
|
+
borderStyle: void 0,
|
|
956
|
+
borderColor: void 0,
|
|
957
|
+
border: void 0,
|
|
958
|
+
strokeLinejoin: void 0,
|
|
959
|
+
strokeLinecap: void 0,
|
|
960
|
+
strokeMiterlimit: void 0
|
|
961
|
+
};
|
|
962
|
+
function svgLineJoin(join) {
|
|
963
|
+
switch (join) {
|
|
964
|
+
case "round":
|
|
965
|
+
return "round";
|
|
966
|
+
case "bevel":
|
|
967
|
+
return "bevel";
|
|
968
|
+
case "miter":
|
|
969
|
+
return "miter";
|
|
970
|
+
default:
|
|
971
|
+
return void 0;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
function svgStrokeLineCap(cap) {
|
|
975
|
+
switch (cap) {
|
|
976
|
+
case "rnd":
|
|
977
|
+
return "round";
|
|
978
|
+
case "sq":
|
|
979
|
+
return "square";
|
|
980
|
+
case "flat":
|
|
981
|
+
return "butt";
|
|
982
|
+
default:
|
|
983
|
+
return void 0;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
function strokeMiterLimit(style) {
|
|
987
|
+
if (style?.lineJoin !== "miter" || typeof style.miterLimit !== "number") {
|
|
988
|
+
return void 0;
|
|
989
|
+
}
|
|
990
|
+
if (!Number.isFinite(style.miterLimit)) {
|
|
991
|
+
return void 0;
|
|
992
|
+
}
|
|
993
|
+
return Math.max(style.miterLimit / 1e5, 1);
|
|
994
|
+
}
|
|
995
|
+
function getComputedStrokeStyle(element) {
|
|
996
|
+
if (!pptx.hasShapeProperties(element)) {
|
|
997
|
+
return NO_STROKE;
|
|
998
|
+
}
|
|
999
|
+
const style = element.shapeStyle;
|
|
1000
|
+
const width = suppressesCssBorder(element) ? 0 : paintedStrokeWidth(style);
|
|
1001
|
+
const joins = {
|
|
1002
|
+
strokeLinejoin: svgLineJoin(style?.lineJoin),
|
|
1003
|
+
strokeLinecap: svgStrokeLineCap(style?.lineCap),
|
|
1004
|
+
strokeMiterlimit: strokeMiterLimit(style)
|
|
1005
|
+
};
|
|
1006
|
+
if (width <= 0 || !style) {
|
|
1007
|
+
return { ...NO_STROKE, ...joins };
|
|
1008
|
+
}
|
|
1009
|
+
const borderWidth = width;
|
|
1010
|
+
const borderStyle = getCssBorderDashStyle(
|
|
1011
|
+
normalizeStrokeDashType(style.strokeDash),
|
|
1012
|
+
style.compoundLine
|
|
1013
|
+
);
|
|
1014
|
+
const rawColor = style.strokeColor ?? DEFAULT_STROKE_COLOR;
|
|
1015
|
+
const borderColor = style.strokeOpacity === void 0 ? rawColor : color.colorWithOpacity(color.normalizeHexColor(rawColor, DEFAULT_STROKE_COLOR), style.strokeOpacity);
|
|
1016
|
+
return {
|
|
1017
|
+
borderWidth,
|
|
1018
|
+
cssBorderWidth: chunkHWJKBKCW_cjs.screenBorderWidth(borderWidth),
|
|
1019
|
+
borderStyle,
|
|
1020
|
+
borderColor,
|
|
1021
|
+
border: chunkHWJKBKCW_cjs.screenBorder(borderWidth, borderStyle ?? "solid", borderColor),
|
|
1022
|
+
...joins
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
// src/pptx/render/svg-gradient-rect-path.ts
|
|
1027
|
+
function buildRectPathGradientDef(stops, id, focalPoint, fillToRect) {
|
|
1028
|
+
const rectStops = stops.map((stop) => ({
|
|
1029
|
+
position: Math.round(stop.offset * 100 * 1e4) / 1e4,
|
|
1030
|
+
color: stop.color,
|
|
1031
|
+
...typeof stop.opacity === "number" ? { opacity: stop.opacity } : {}
|
|
1032
|
+
}));
|
|
1033
|
+
const markup = diagram.buildRectPathGradientExactSvg(rectStops, focalPoint, fillToRect);
|
|
1034
|
+
return { kind: "rectPath", id, href: `data:image/svg+xml,${encodeURIComponent(markup)}` };
|
|
1035
|
+
}
|
|
1036
|
+
function rectPathGradientMarkup(def) {
|
|
1037
|
+
const id = escapeSvgAttr(def.id);
|
|
1038
|
+
const href = escapeSvgAttr(def.href);
|
|
1039
|
+
return `<pattern id="${id}" patternUnits="objectBoundingBox" patternContentUnits="objectBoundingBox" width="1" height="1"><image href="${href}" x="0" y="0" width="1" height="1" preserveAspectRatio="none"/></pattern>`;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
// src/pptx/render/svg-stroke-pattern-paint.ts
|
|
1043
|
+
function buildSvgStrokePatternDef(style, elementId) {
|
|
1044
|
+
if (!style || style.strokeFillMode !== "pattern" || !style.strokePatternPreset) {
|
|
1045
|
+
return void 0;
|
|
1046
|
+
}
|
|
1047
|
+
const fg = color.normalizeHexColor(style.strokeColor, "#000000");
|
|
1048
|
+
const bg = color.normalizeHexColor(style.strokePatternBackgroundColor, "#ffffff");
|
|
1049
|
+
const tile = getPatternTile(style.strokePatternPreset, fg, bg);
|
|
1050
|
+
if (!tile) {
|
|
1051
|
+
return void 0;
|
|
1052
|
+
}
|
|
1053
|
+
const markup = `<svg xmlns="http://www.w3.org/2000/svg" width="${tile.w}" height="${tile.h}">${tile.inner}</svg>`;
|
|
1054
|
+
return {
|
|
1055
|
+
kind: "pattern",
|
|
1056
|
+
id: svgGradientId(elementId, "strokepat"),
|
|
1057
|
+
width: tile.w,
|
|
1058
|
+
height: tile.h,
|
|
1059
|
+
href: `data:image/svg+xml,${encodeURIComponent(markup)}`
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
// src/pptx/render/svg-gradient-paint.ts
|
|
1064
|
+
function round4(value) {
|
|
1065
|
+
return Math.round(value * 1e4) / 1e4;
|
|
1066
|
+
}
|
|
1067
|
+
function svgGradientId(elementId, suffix = "grad") {
|
|
1068
|
+
const seed = String(elementId).replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
1069
|
+
return `pptx-${suffix}-${seed}`;
|
|
1070
|
+
}
|
|
1071
|
+
function toSvgStops(stops) {
|
|
1072
|
+
const sanitized = sanitizeGradientStops(stops);
|
|
1073
|
+
return (color.officeTwoStopGradientStops(sanitized) ?? sanitized).map((stop) => ({
|
|
1074
|
+
offset: round4(stop.position / 100),
|
|
1075
|
+
color: stop.color,
|
|
1076
|
+
...typeof stop.opacity === "number" ? { opacity: round4(stop.opacity) } : {}
|
|
1077
|
+
}));
|
|
1078
|
+
}
|
|
1079
|
+
function linearEndpoints(angleDegrees) {
|
|
1080
|
+
const radians = angleDegrees * Math.PI / 180;
|
|
1081
|
+
const dx = Math.cos(radians);
|
|
1082
|
+
const dy = Math.sin(radians);
|
|
1083
|
+
const span = (Math.abs(dx) + Math.abs(dy)) / 2;
|
|
1084
|
+
return {
|
|
1085
|
+
x1: round4(0.5 - dx * span),
|
|
1086
|
+
y1: round4(0.5 - dy * span),
|
|
1087
|
+
x2: round4(0.5 + dx * span),
|
|
1088
|
+
y2: round4(0.5 + dy * span)
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
function buildFromSource(source, id) {
|
|
1092
|
+
const { stops } = source;
|
|
1093
|
+
if (stops.length === 0) {
|
|
1094
|
+
return void 0;
|
|
1095
|
+
}
|
|
1096
|
+
if ((source.type || "linear") === "radial") {
|
|
1097
|
+
if ((source.pathType || "circle") === "rect") {
|
|
1098
|
+
return buildRectPathGradientDef(stops, id, source.focalPoint, source.fillToRect);
|
|
1099
|
+
}
|
|
1100
|
+
const { cx, cy } = computeGradientCenter(source.fillToRect, source.focalPoint);
|
|
1101
|
+
const fx = cx / 100;
|
|
1102
|
+
const fy = cy / 100;
|
|
1103
|
+
const r = Math.hypot(Math.max(fx, 1 - fx), Math.max(fy, 1 - fy));
|
|
1104
|
+
return { kind: "radial", id, cx: round4(fx), cy: round4(fy), r: round4(r), stops };
|
|
1105
|
+
}
|
|
1106
|
+
const angle = typeof source.angle === "number" && Number.isFinite(source.angle) ? source.angle : 90;
|
|
1107
|
+
return { kind: "linear", id, ...linearEndpoints(angle), stops };
|
|
1108
|
+
}
|
|
1109
|
+
function buildSvgGradientDef(style, elementId) {
|
|
1110
|
+
if (!style || style.fillMode !== "gradient") {
|
|
1111
|
+
return void 0;
|
|
1112
|
+
}
|
|
1113
|
+
return buildFromSource(
|
|
1114
|
+
{
|
|
1115
|
+
stops: toSvgStops(style.fillGradientStops),
|
|
1116
|
+
type: style.fillGradientType,
|
|
1117
|
+
pathType: style.fillGradientPathType,
|
|
1118
|
+
angle: style.fillGradientAngle,
|
|
1119
|
+
fillToRect: style.fillGradientFillToRect,
|
|
1120
|
+
focalPoint: style.fillGradientFocalPoint
|
|
1121
|
+
},
|
|
1122
|
+
svgGradientId(elementId)
|
|
1123
|
+
);
|
|
1124
|
+
}
|
|
1125
|
+
function buildSvgStrokeGradientDef(style, elementId) {
|
|
1126
|
+
if (!style || style.strokeFillMode !== "gradient") {
|
|
1127
|
+
return void 0;
|
|
1128
|
+
}
|
|
1129
|
+
return buildFromSource(
|
|
1130
|
+
{
|
|
1131
|
+
stops: toSvgStops(style.strokeGradientStops),
|
|
1132
|
+
type: style.strokeGradientType,
|
|
1133
|
+
pathType: style.strokeGradientPathType,
|
|
1134
|
+
angle: style.strokeGradientAngle
|
|
1135
|
+
},
|
|
1136
|
+
svgGradientId(elementId, "stroke")
|
|
1137
|
+
);
|
|
1138
|
+
}
|
|
1139
|
+
function svgGradientFillRef(def) {
|
|
1140
|
+
return `url(#${def.id})`;
|
|
1141
|
+
}
|
|
1142
|
+
function numAttr(value) {
|
|
1143
|
+
return escapeSvgAttr(String(Number.isFinite(value) ? value : 0));
|
|
1144
|
+
}
|
|
1145
|
+
function svgGradientMarkup(def) {
|
|
1146
|
+
if (def.kind === "rectPath") {
|
|
1147
|
+
return rectPathGradientMarkup(def);
|
|
1148
|
+
}
|
|
1149
|
+
const id = escapeSvgAttr(def.id);
|
|
1150
|
+
const stops = def.stops.map(
|
|
1151
|
+
(stop) => `<stop offset="${numAttr(stop.offset)}" stop-color="${escapeSvgAttr(stop.color)}"${typeof stop.opacity === "number" ? ` stop-opacity="${numAttr(stop.opacity)}"` : ""}/>`
|
|
1152
|
+
).join("");
|
|
1153
|
+
if (def.kind === "radial") {
|
|
1154
|
+
return `<radialGradient id="${id}" cx="${numAttr(def.cx)}" cy="${numAttr(def.cy)}" r="${numAttr(def.r)}">${stops}</radialGradient>`;
|
|
1155
|
+
}
|
|
1156
|
+
return `<linearGradient id="${id}" x1="${numAttr(def.x1)}" y1="${numAttr(def.y1)}" x2="${numAttr(def.x2)}" y2="${numAttr(def.y2)}">${stops}</linearGradient>`;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
// src/pptx/render/stroke-outline.ts
|
|
1160
|
+
var DEFAULT_OPEN_PRESET_STROKE_WIDTH = 2;
|
|
1161
|
+
function isPatternPaint(paint) {
|
|
1162
|
+
return paint?.kind === "pattern";
|
|
1163
|
+
}
|
|
1164
|
+
function outlinePathData(clipPath, width, height) {
|
|
1165
|
+
if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
|
|
1166
|
+
return void 0;
|
|
1167
|
+
}
|
|
1168
|
+
const rect = `M 0 0 L ${width} 0 L ${width} ${height} L 0 ${height} Z`;
|
|
1169
|
+
if (!clipPath) {
|
|
1170
|
+
return rect;
|
|
1171
|
+
}
|
|
1172
|
+
const asPath = /^path\('(.*)'\)$/su.exec(clipPath.trim());
|
|
1173
|
+
if (asPath) {
|
|
1174
|
+
return asPath[1];
|
|
1175
|
+
}
|
|
1176
|
+
const asPolygon = /^polygon\((.*)\)$/su.exec(clipPath.trim());
|
|
1177
|
+
if (asPolygon) {
|
|
1178
|
+
const points = asPolygon[1].split(",").map((pair) => pair.trim().split(/\s+/u)).filter((parts) => parts.length === 2).map(([rawX, rawY]) => {
|
|
1179
|
+
const toPx = (token, extent) => token.endsWith("%") ? Number.parseFloat(token) / 100 * extent : Number.parseFloat(token);
|
|
1180
|
+
return [toPx(rawX, width), toPx(rawY, height)];
|
|
1181
|
+
}).filter(([x, y]) => Number.isFinite(x) && Number.isFinite(y));
|
|
1182
|
+
if (points.length < 3) {
|
|
1183
|
+
return rect;
|
|
1184
|
+
}
|
|
1185
|
+
const [first, ...rest] = points;
|
|
1186
|
+
return `M ${first[0]} ${first[1]} ${rest.map(([x, y]) => `L ${x} ${y}`).join(" ")} Z`;
|
|
1187
|
+
}
|
|
1188
|
+
return rect;
|
|
1189
|
+
}
|
|
1190
|
+
var WEDGE_CALLOUT_PRESET_NAMES = /* @__PURE__ */ new Set([
|
|
1191
|
+
"wedgerectcallout",
|
|
1192
|
+
"wedgeroundrectcallout",
|
|
1193
|
+
"wedgeellipsecallout"
|
|
1194
|
+
]);
|
|
1195
|
+
function isWedgeCalloutPresetShape(shapeType) {
|
|
1196
|
+
return typeof shapeType === "string" && WEDGE_CALLOUT_PRESET_NAMES.has(shapeType.toLowerCase());
|
|
1197
|
+
}
|
|
1198
|
+
function clipPathPolygonPoints(clipPath, width, height) {
|
|
1199
|
+
const asPolygon = /^polygon\((.*)\)$/su.exec(clipPath.trim());
|
|
1200
|
+
if (!asPolygon) {
|
|
1201
|
+
return [];
|
|
1202
|
+
}
|
|
1203
|
+
const toPx = (token, extent) => token.endsWith("%") ? Number.parseFloat(token) / 100 * extent : Number.parseFloat(token);
|
|
1204
|
+
return asPolygon[1].split(",").map((pair) => pair.trim().split(/\s+/u)).filter((parts) => parts.length === 2).map(([rawX, rawY]) => [toPx(rawX, width), toPx(rawY, height)]).filter(([x, y]) => Number.isFinite(x) && Number.isFinite(y));
|
|
1205
|
+
}
|
|
1206
|
+
function getPresetShapeVectorGeometry(shapeType, width, height, adjustments) {
|
|
1207
|
+
const normalizedWidth = Math.max(Number.isFinite(width) ? width : 0, 1);
|
|
1208
|
+
const normalizedHeight = Math.max(Number.isFinite(height) ? height : 0, 1);
|
|
1209
|
+
const clipPath = getResolvedShapeClipPathFor(
|
|
1210
|
+
shapeType,
|
|
1211
|
+
normalizedWidth,
|
|
1212
|
+
normalizedHeight,
|
|
1213
|
+
adjustments
|
|
1214
|
+
);
|
|
1215
|
+
const d = outlinePathData(clipPath, normalizedWidth, normalizedHeight);
|
|
1216
|
+
if (!d) {
|
|
1217
|
+
return void 0;
|
|
1218
|
+
}
|
|
1219
|
+
let minX = 0;
|
|
1220
|
+
let minY = 0;
|
|
1221
|
+
let maxX = normalizedWidth;
|
|
1222
|
+
let maxY = normalizedHeight;
|
|
1223
|
+
for (const [x, y] of clipPath ? clipPathPolygonPoints(clipPath, normalizedWidth, normalizedHeight) : []) {
|
|
1224
|
+
minX = Math.min(minX, x);
|
|
1225
|
+
minY = Math.min(minY, y);
|
|
1226
|
+
maxX = Math.max(maxX, x);
|
|
1227
|
+
maxY = Math.max(maxY, y);
|
|
1228
|
+
}
|
|
1229
|
+
return {
|
|
1230
|
+
d,
|
|
1231
|
+
minX,
|
|
1232
|
+
minY,
|
|
1233
|
+
maxX,
|
|
1234
|
+
maxY,
|
|
1235
|
+
viewWidth: Math.max(maxX - minX, 1),
|
|
1236
|
+
viewHeight: Math.max(maxY - minY, 1)
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
function outlineStrands(compoundLine, strokeWidth) {
|
|
1240
|
+
const offsets = getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
1241
|
+
if (offsets.length <= 1) {
|
|
1242
|
+
return [{ strokeWidth, cssStrokeWidth: chunkHWJKBKCW_cjs.screenStrokeWidth(strokeWidth), offset: 0 }];
|
|
1243
|
+
}
|
|
1244
|
+
const widths = getCompoundLineWidths(compoundLine, strokeWidth);
|
|
1245
|
+
return offsets.map((offset, idx) => {
|
|
1246
|
+
const width = widths[idx] ?? strokeWidth;
|
|
1247
|
+
return { strokeWidth: width, cssStrokeWidth: chunkHWJKBKCW_cjs.screenBorderWidth(width), offset };
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
function needsCenteredStrokeOverlay(element, style, declaredWidth) {
|
|
1251
|
+
if (!style || declaredWidth <= 0 || element.type === "connector" || !hasStrokePaint(style)) {
|
|
1252
|
+
return false;
|
|
1253
|
+
}
|
|
1254
|
+
const shapeType = pptx.getShapeType(element.shapeType);
|
|
1255
|
+
if (shapeType === "line") {
|
|
1256
|
+
return false;
|
|
1257
|
+
}
|
|
1258
|
+
return style.lineAlignment !== "in";
|
|
1259
|
+
}
|
|
1260
|
+
function clipEdgeBleed(element, d, style) {
|
|
1261
|
+
if ((style?.strokeOpacity ?? 1) < 1 || element.type === "picture" || element.type === "image" || isArrowedCustomPath(element) || // A silhouette shape keeps no clip on its container (its fill is the SVG
|
|
1262
|
+
// overlay's), so there is no cut to cover; and the filter shadows the painted
|
|
1263
|
+
// alpha, which the hairline would thicken (a hollow triangle's shadow read
|
|
1264
|
+
// 25 % darker than PowerPoint's).
|
|
1265
|
+
usesSilhouetteEffects(element)) {
|
|
1266
|
+
return void 0;
|
|
1267
|
+
}
|
|
1268
|
+
const width = straddlingStrokeWidth(element);
|
|
1269
|
+
const shapeType = pptx.getShapeType(element.shapeType);
|
|
1270
|
+
if (width <= 0 || shapeType === "roundRect" || shapeType === "ellipse" || isIdentityRectClip(element) || getResolvedShapeClipPath(element) === void 0) {
|
|
1271
|
+
return void 0;
|
|
1272
|
+
}
|
|
1273
|
+
const edge = outerStrokeEdgePath(d, width, outlineStrokeJoin(element));
|
|
1274
|
+
return edge ? {
|
|
1275
|
+
d: edge,
|
|
1276
|
+
strokeWidth: 1,
|
|
1277
|
+
cssStrokeWidth: `max(1px, calc(2 * var(${chunkHWJKBKCW_cjs.DEVICE_PX_VAR}, 0px)))`,
|
|
1278
|
+
offset: 0
|
|
1279
|
+
} : void 0;
|
|
1280
|
+
}
|
|
1281
|
+
function insetLineOnClippedShape(element, style, declaredWidth) {
|
|
1282
|
+
if (!style || style.lineAlignment !== "in" || declaredWidth <= 0 || element.type === "connector" || element.type === "picture" || element.type === "image" || !hasStrokePaint(style)) {
|
|
1283
|
+
return false;
|
|
1284
|
+
}
|
|
1285
|
+
const shapeType = pptx.getShapeType(element.shapeType);
|
|
1286
|
+
if (shapeType === "line" || shapeType === "roundRect" || shapeType === "ellipse") {
|
|
1287
|
+
return false;
|
|
1288
|
+
}
|
|
1289
|
+
return !isIdentityRectClip(element) && getResolvedShapeClipPath(element) !== void 0;
|
|
1290
|
+
}
|
|
1291
|
+
function straddlingStrokeWidth(element) {
|
|
1292
|
+
if (!pptx.hasShapeProperties(element)) {
|
|
1293
|
+
return 0;
|
|
1294
|
+
}
|
|
1295
|
+
const style = element.shapeStyle;
|
|
1296
|
+
const width = Math.max(0, style?.strokeWidth ?? 0);
|
|
1297
|
+
if (!needsCenteredStrokeOverlay(element, style, width)) {
|
|
1298
|
+
return 0;
|
|
1299
|
+
}
|
|
1300
|
+
const dash = normalizeStrokeDashType(style?.strokeDash);
|
|
1301
|
+
return !dash || dash === "solid" ? width : 0;
|
|
1302
|
+
}
|
|
1303
|
+
function outlineStrokeJoin(element) {
|
|
1304
|
+
const style = pptx.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
1305
|
+
const join = style?.lineJoin === "bevel" ? "bevel" : style?.lineJoin === "miter" ? "miter" : "round";
|
|
1306
|
+
return { join, miterLimit: strokeMiterLimit(style) ?? 4 };
|
|
1307
|
+
}
|
|
1308
|
+
function snapTransform(element, isOpenPreset, strokeWidth) {
|
|
1309
|
+
if (element.rotation) {
|
|
1310
|
+
return void 0;
|
|
1311
|
+
}
|
|
1312
|
+
const place = snapPlacement(element);
|
|
1313
|
+
if (!place) {
|
|
1314
|
+
return void 0;
|
|
1315
|
+
}
|
|
1316
|
+
const shapeType = pptx.getShapeType(element.shapeType);
|
|
1317
|
+
if (isOpenPreset) {
|
|
1318
|
+
if (shapeType !== "line") {
|
|
1319
|
+
return void 0;
|
|
1320
|
+
}
|
|
1321
|
+
const axis = element.height === 0 ? "h" : element.width === 0 ? "v" : void 0;
|
|
1322
|
+
return axis ? chunkHWJKBKCW_cjs.snappedStrokeTransform(axis, place.x, place.y, strokeWidth, void 0, place.exact) : void 0;
|
|
1323
|
+
}
|
|
1324
|
+
return shapeType === "rect" ? chunkHWJKBKCW_cjs.snappedStrokeTransform(
|
|
1325
|
+
"box",
|
|
1326
|
+
place.x,
|
|
1327
|
+
place.y,
|
|
1328
|
+
strokeWidth,
|
|
1329
|
+
{ width: element.width, height: element.height },
|
|
1330
|
+
place.exact
|
|
1331
|
+
) : void 0;
|
|
1332
|
+
}
|
|
1333
|
+
function buildStrokeOutline(element) {
|
|
1334
|
+
if (!pptx.hasShapeProperties(element)) {
|
|
1335
|
+
return void 0;
|
|
1336
|
+
}
|
|
1337
|
+
const style = element.shapeStyle;
|
|
1338
|
+
const declaredWidth = Math.max(0, style?.strokeWidth ?? 0);
|
|
1339
|
+
const openPresetD = strokeOnlyPresetPathData(element);
|
|
1340
|
+
if (!openPresetD && (!style || declaredWidth <= 0)) {
|
|
1341
|
+
return void 0;
|
|
1342
|
+
}
|
|
1343
|
+
const paint = style && declaredWidth > 0 ? buildSvgStrokeGradientDef(style, element.id) ?? buildSvgStrokePatternDef(style, element.id) : void 0;
|
|
1344
|
+
const splitD = !openPresetD && declaredWidth > 0 ? splitStrokePresetPathData(element) : void 0;
|
|
1345
|
+
const ownPathD = openPresetD ?? splitD;
|
|
1346
|
+
const insetOnClip = !ownPathD && insetLineOnClippedShape(element, style, declaredWidth);
|
|
1347
|
+
const centeredFlatStroke = !paint && !ownPathD && (isArrowedCustomPath(element) || needsCenteredStrokeOverlay(element, style, declaredWidth));
|
|
1348
|
+
if (!paint && !ownPathD && !centeredFlatStroke && !insetOnClip) {
|
|
1349
|
+
return void 0;
|
|
1350
|
+
}
|
|
1351
|
+
const d = ownPathD ?? outlinePathData(getResolvedShapeClipPath(element), element.width, element.height);
|
|
1352
|
+
if (!d) {
|
|
1353
|
+
return void 0;
|
|
1354
|
+
}
|
|
1355
|
+
const lineWidth = declaredWidth > 0 ? declaredWidth : DEFAULT_OPEN_PRESET_STROKE_WIDTH;
|
|
1356
|
+
const strokeWidth = insetOnClip ? lineWidth * 2 : lineWidth;
|
|
1357
|
+
const stroke = paint ? svgGradientFillRef(paint) : color.colorWithOpacity(style?.strokeColor ?? DEFAULT_STROKE_COLOR, style?.strokeOpacity);
|
|
1358
|
+
const strands = traceCompoundStrands(
|
|
1359
|
+
outlineStrands(style?.compoundLine, strokeWidth),
|
|
1360
|
+
d,
|
|
1361
|
+
outlineStrokeJoin(element)
|
|
1362
|
+
);
|
|
1363
|
+
const bleed = !ownPathD ? clipEdgeBleed(element, d, style) : void 0;
|
|
1364
|
+
const snap = paint || strands.length !== 1 ? void 0 : snapTransform(element, !!openPresetD, strokeWidth);
|
|
1365
|
+
const snapped = snap ? strands.map((strand) => ({ ...strand, cssTransform: snap })) : strands;
|
|
1366
|
+
const dashStartD = !ownPathD && isDashedStroke(style?.strokeDash) ? dashStartPathData(d, element.shapeType) : d;
|
|
1367
|
+
return {
|
|
1368
|
+
markers: buildCustomPathMarkers(element, stroke),
|
|
1369
|
+
d: dashStartD,
|
|
1370
|
+
paint,
|
|
1371
|
+
stroke,
|
|
1372
|
+
strokeWidth,
|
|
1373
|
+
strands: bleed ? [...snapped, bleed] : snapped,
|
|
1374
|
+
dashArray: getSvgStrokeDasharray(
|
|
1375
|
+
normalizeStrokeDashType(style?.strokeDash),
|
|
1376
|
+
Math.max(lineWidth, 1),
|
|
1377
|
+
style?.customDashSegments,
|
|
1378
|
+
style?.lineCap
|
|
1379
|
+
),
|
|
1380
|
+
lineCap: svgLineCap(style?.lineCap, isDashedStroke(style?.strokeDash)),
|
|
1381
|
+
lineJoin: outlineStrokeJoin(element).join
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
function strokeOutlineViewBox(element) {
|
|
1385
|
+
const width = Math.max(element.width, 0);
|
|
1386
|
+
const height = Math.max(element.height, 0);
|
|
1387
|
+
if (width < 1 || height < 1) {
|
|
1388
|
+
return void 0;
|
|
1389
|
+
}
|
|
1390
|
+
return `0 0 ${width} ${height}`;
|
|
1391
|
+
}
|
|
1392
|
+
function suppressesCssBorder(element) {
|
|
1393
|
+
return buildStrokeOutline(element) !== void 0;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
// src/pptx/render/stroke-clip-outset.ts
|
|
1397
|
+
var SVG_DEFAULT_JOIN = { join: "miter", miterLimit: 4 };
|
|
1398
|
+
var ROUND_JOIN_STEPS2 = 16;
|
|
1399
|
+
var CURVE_STEPS = 16;
|
|
1400
|
+
function flattenArc(from, rx, ry, rotationDeg, largeArc, sweep, to) {
|
|
1401
|
+
if (rx === 0 || ry === 0 || from[0] === to[0] && from[1] === to[1]) {
|
|
1402
|
+
return [to];
|
|
1403
|
+
}
|
|
1404
|
+
const phi = rotationDeg * Math.PI / 180;
|
|
1405
|
+
const cosPhi = Math.cos(phi);
|
|
1406
|
+
const sinPhi = Math.sin(phi);
|
|
1407
|
+
const dx = (from[0] - to[0]) / 2;
|
|
1408
|
+
const dy = (from[1] - to[1]) / 2;
|
|
1409
|
+
const x1 = cosPhi * dx + sinPhi * dy;
|
|
1410
|
+
const y1 = -sinPhi * dx + cosPhi * dy;
|
|
1411
|
+
let radiusX = Math.abs(rx);
|
|
1412
|
+
let radiusY = Math.abs(ry);
|
|
1413
|
+
const lambda = x1 * x1 / (radiusX * radiusX) + y1 * y1 / (radiusY * radiusY);
|
|
1414
|
+
if (lambda > 1) {
|
|
1415
|
+
const scale = Math.sqrt(lambda);
|
|
1416
|
+
radiusX *= scale;
|
|
1417
|
+
radiusY *= scale;
|
|
1418
|
+
}
|
|
1419
|
+
const numerator = radiusX * radiusX * radiusY * radiusY - radiusX * radiusX * y1 * y1 - radiusY * radiusY * x1 * x1;
|
|
1420
|
+
const denominator = radiusX * radiusX * y1 * y1 + radiusY * radiusY * x1 * x1;
|
|
1421
|
+
const coefficient = (largeArc === sweep ? -1 : 1) * Math.sqrt(Math.max(0, numerator / denominator));
|
|
1422
|
+
const cxp = coefficient * radiusX * y1 / radiusY;
|
|
1423
|
+
const cyp = -coefficient * radiusY * x1 / radiusX;
|
|
1424
|
+
const cx = cosPhi * cxp - sinPhi * cyp + (from[0] + to[0]) / 2;
|
|
1425
|
+
const cy = sinPhi * cxp + cosPhi * cyp + (from[1] + to[1]) / 2;
|
|
1426
|
+
const angle = (ux, uy, vx, vy) => {
|
|
1427
|
+
const sign = ux * vy - uy * vx < 0 ? -1 : 1;
|
|
1428
|
+
const dot = (ux * vx + uy * vy) / (Math.hypot(ux, uy) * Math.hypot(vx, vy));
|
|
1429
|
+
return sign * Math.acos(Math.max(-1, Math.min(1, dot)));
|
|
1430
|
+
};
|
|
1431
|
+
const theta1 = angle(1, 0, (x1 - cxp) / radiusX, (y1 - cyp) / radiusY);
|
|
1432
|
+
let delta = angle(
|
|
1433
|
+
(x1 - cxp) / radiusX,
|
|
1434
|
+
(y1 - cyp) / radiusY,
|
|
1435
|
+
(-x1 - cxp) / radiusX,
|
|
1436
|
+
(-y1 - cyp) / radiusY
|
|
1437
|
+
);
|
|
1438
|
+
if (!sweep && delta > 0) {
|
|
1439
|
+
delta -= 2 * Math.PI;
|
|
1440
|
+
} else if (sweep && delta < 0) {
|
|
1441
|
+
delta += 2 * Math.PI;
|
|
1442
|
+
}
|
|
1443
|
+
const out = [];
|
|
1444
|
+
for (let step = 1; step <= CURVE_STEPS; step++) {
|
|
1445
|
+
const t = theta1 + delta * step / CURVE_STEPS;
|
|
1446
|
+
const px2 = radiusX * Math.cos(t);
|
|
1447
|
+
const py = radiusY * Math.sin(t);
|
|
1448
|
+
out.push([cosPhi * px2 - sinPhi * py + cx, sinPhi * px2 + cosPhi * py + cy]);
|
|
1449
|
+
}
|
|
1450
|
+
return out;
|
|
1451
|
+
}
|
|
1452
|
+
function flattenPath(d) {
|
|
1453
|
+
const tokens = d.match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/giu);
|
|
1454
|
+
if (!tokens) {
|
|
1455
|
+
return void 0;
|
|
1456
|
+
}
|
|
1457
|
+
const subpaths = [];
|
|
1458
|
+
let current = [];
|
|
1459
|
+
let pos = [0, 0];
|
|
1460
|
+
let start = [0, 0];
|
|
1461
|
+
let i = 0;
|
|
1462
|
+
let command = "";
|
|
1463
|
+
const num3 = () => Number.parseFloat(tokens[i++] ?? "NaN");
|
|
1464
|
+
while (i < tokens.length) {
|
|
1465
|
+
const token = tokens[i];
|
|
1466
|
+
if (/^[A-Za-z]$/u.test(token)) {
|
|
1467
|
+
command = token;
|
|
1468
|
+
i++;
|
|
1469
|
+
if (command === "Z" || command === "z") {
|
|
1470
|
+
if (current.length > 1) {
|
|
1471
|
+
subpaths.push(current);
|
|
1472
|
+
}
|
|
1473
|
+
current = [];
|
|
1474
|
+
pos = start;
|
|
1475
|
+
continue;
|
|
1476
|
+
}
|
|
1477
|
+
} else if (command === "M") {
|
|
1478
|
+
command = "L";
|
|
1479
|
+
}
|
|
1480
|
+
switch (command) {
|
|
1481
|
+
case "M":
|
|
1482
|
+
if (current.length > 1) {
|
|
1483
|
+
subpaths.push(current);
|
|
1484
|
+
}
|
|
1485
|
+
pos = [num3(), num3()];
|
|
1486
|
+
start = pos;
|
|
1487
|
+
current = [pos];
|
|
1488
|
+
break;
|
|
1489
|
+
case "L":
|
|
1490
|
+
pos = [num3(), num3()];
|
|
1491
|
+
current.push(pos);
|
|
1492
|
+
break;
|
|
1493
|
+
case "H":
|
|
1494
|
+
pos = [num3(), pos[1]];
|
|
1495
|
+
current.push(pos);
|
|
1496
|
+
break;
|
|
1497
|
+
case "V":
|
|
1498
|
+
pos = [pos[0], num3()];
|
|
1499
|
+
current.push(pos);
|
|
1500
|
+
break;
|
|
1501
|
+
case "C": {
|
|
1502
|
+
const p1 = [num3(), num3()];
|
|
1503
|
+
const p2 = [num3(), num3()];
|
|
1504
|
+
const p3 = [num3(), num3()];
|
|
1505
|
+
for (let step = 1; step <= CURVE_STEPS; step++) {
|
|
1506
|
+
const t = step / CURVE_STEPS;
|
|
1507
|
+
const u = 1 - t;
|
|
1508
|
+
current.push([
|
|
1509
|
+
u * u * u * pos[0] + 3 * u * u * t * p1[0] + 3 * u * t * t * p2[0] + t * t * t * p3[0],
|
|
1510
|
+
u * u * u * pos[1] + 3 * u * u * t * p1[1] + 3 * u * t * t * p2[1] + t * t * t * p3[1]
|
|
1511
|
+
]);
|
|
1512
|
+
}
|
|
1513
|
+
pos = p3;
|
|
1514
|
+
break;
|
|
1515
|
+
}
|
|
1516
|
+
case "Q": {
|
|
1517
|
+
const p1 = [num3(), num3()];
|
|
1518
|
+
const p2 = [num3(), num3()];
|
|
1519
|
+
for (let step = 1; step <= CURVE_STEPS; step++) {
|
|
1520
|
+
const t = step / CURVE_STEPS;
|
|
1521
|
+
const u = 1 - t;
|
|
1522
|
+
current.push([
|
|
1523
|
+
u * u * pos[0] + 2 * u * t * p1[0] + t * t * p2[0],
|
|
1524
|
+
u * u * pos[1] + 2 * u * t * p1[1] + t * t * p2[1]
|
|
1525
|
+
]);
|
|
1526
|
+
}
|
|
1527
|
+
pos = p2;
|
|
1528
|
+
break;
|
|
1529
|
+
}
|
|
1530
|
+
case "A": {
|
|
1531
|
+
const rx = num3();
|
|
1532
|
+
const ry = num3();
|
|
1533
|
+
const rotation = num3();
|
|
1534
|
+
const largeArc = num3() !== 0;
|
|
1535
|
+
const sweep = num3() !== 0;
|
|
1536
|
+
const to = [num3(), num3()];
|
|
1537
|
+
current.push(...flattenArc(pos, rx, ry, rotation, largeArc, sweep, to));
|
|
1538
|
+
pos = to;
|
|
1539
|
+
break;
|
|
1540
|
+
}
|
|
1541
|
+
default:
|
|
1542
|
+
return void 0;
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
if (current.length > 1) {
|
|
1546
|
+
subpaths.push(current);
|
|
1547
|
+
}
|
|
1548
|
+
return subpaths.every((sub) => sub.every(([x, y]) => Number.isFinite(x) && Number.isFinite(y))) ? subpaths : void 0;
|
|
1549
|
+
}
|
|
1550
|
+
var fmt3 = (n) => String(Math.round(n * 1e3) / 1e3);
|
|
1551
|
+
function outsetClipPathForStroke(clipPath, strokeWidth, width, height, join = SVG_DEFAULT_JOIN) {
|
|
1552
|
+
if (!(strokeWidth > 0)) {
|
|
1553
|
+
return clipPath;
|
|
1554
|
+
}
|
|
1555
|
+
const d = outlinePathData(clipPath, width, height);
|
|
1556
|
+
const subpaths = d ? flattenPath(d) : void 0;
|
|
1557
|
+
if (!d || !subpaths || subpaths.length === 0) {
|
|
1558
|
+
return clipPath;
|
|
1559
|
+
}
|
|
1560
|
+
const half = strokeWidth / 2;
|
|
1561
|
+
const signedArea2 = (pts) => {
|
|
1562
|
+
let area = 0;
|
|
1563
|
+
for (let k = 0; k < pts.length; k++) {
|
|
1564
|
+
const a = pts[k];
|
|
1565
|
+
const b = pts[(k + 1) % pts.length];
|
|
1566
|
+
area += a[0] * b[1] - b[0] * a[1];
|
|
1567
|
+
}
|
|
1568
|
+
return area;
|
|
1569
|
+
};
|
|
1570
|
+
const reference = Math.sign(signedArea2(subpaths[0])) || 1;
|
|
1571
|
+
const quads = [];
|
|
1572
|
+
const push = (poly) => {
|
|
1573
|
+
const wound = Math.sign(signedArea2(poly)) === reference ? poly : [...poly].reverse();
|
|
1574
|
+
quads.push(`M ${wound.map(([x, y]) => `${fmt3(x)} ${fmt3(y)}`).join(" L ")} Z`);
|
|
1575
|
+
};
|
|
1576
|
+
for (const sub of subpaths) {
|
|
1577
|
+
const pts = sub;
|
|
1578
|
+
let last = [0, 0];
|
|
1579
|
+
const normals = pts.map((a, k) => {
|
|
1580
|
+
const b = pts[(k + 1) % pts.length];
|
|
1581
|
+
const len = Math.hypot(b[0] - a[0], b[1] - a[1]);
|
|
1582
|
+
if (len >= 1e-6) {
|
|
1583
|
+
last = [-(b[1] - a[1]) / len, (b[0] - a[0]) / len];
|
|
1584
|
+
}
|
|
1585
|
+
return last;
|
|
1586
|
+
});
|
|
1587
|
+
for (let k = 0; k < pts.length; k++) {
|
|
1588
|
+
const a = pts[k];
|
|
1589
|
+
const b = pts[(k + 1) % pts.length];
|
|
1590
|
+
const [nx, ny] = normals[k];
|
|
1591
|
+
push([
|
|
1592
|
+
[a[0] + nx * half, a[1] + ny * half],
|
|
1593
|
+
[b[0] + nx * half, b[1] + ny * half],
|
|
1594
|
+
[b[0] - nx * half, b[1] - ny * half],
|
|
1595
|
+
[a[0] - nx * half, a[1] - ny * half]
|
|
1596
|
+
]);
|
|
1597
|
+
push(joinPiece(b, normals[k], normals[(k + 1) % pts.length]));
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
function joinPiece(v, n1, n2) {
|
|
1601
|
+
if (join.join === "round") {
|
|
1602
|
+
const r = half / Math.cos(Math.PI / ROUND_JOIN_STEPS2);
|
|
1603
|
+
return Array.from({ length: ROUND_JOIN_STEPS2 }, (_, i) => {
|
|
1604
|
+
const t = 2 * Math.PI * i / ROUND_JOIN_STEPS2;
|
|
1605
|
+
return [v[0] + r * Math.cos(t), v[1] + r * Math.sin(t)];
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
const turn = n1[0] * n2[1] - n1[1] * n2[0];
|
|
1609
|
+
if (Math.abs(turn) < 1e-9) {
|
|
1610
|
+
return [v, v, v, v];
|
|
1611
|
+
}
|
|
1612
|
+
const side = turn > 0 ? -1 : 1;
|
|
1613
|
+
const p1 = [v[0] + side * n1[0] * half, v[1] + side * n1[1] * half];
|
|
1614
|
+
const p2 = [v[0] + side * n2[0] * half, v[1] + side * n2[1] * half];
|
|
1615
|
+
const cosHalf = Math.sqrt(Math.max(0, (1 + n1[0] * n2[0] + n1[1] * n2[1]) / 2));
|
|
1616
|
+
if (join.join === "miter" && cosHalf > 0 && 1 / cosHalf <= join.miterLimit) {
|
|
1617
|
+
const bx = n1[0] + n2[0];
|
|
1618
|
+
const by = n1[1] + n2[1];
|
|
1619
|
+
const blen = Math.hypot(bx, by);
|
|
1620
|
+
const reach = half / cosHalf / blen;
|
|
1621
|
+
return [v, p1, [v[0] + side * bx * reach, v[1] + side * by * reach], p2];
|
|
1622
|
+
}
|
|
1623
|
+
return [v, p1, p2, p2];
|
|
1624
|
+
}
|
|
1625
|
+
return `path('${d} ${quads.join(" ")}')`;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
// src/pptx/render/shape-geometry-base.ts
|
|
1629
|
+
var CYLINDER_RADIUS = "48% / 12%";
|
|
1630
|
+
var MIN_ROUND_RECT_RADIUS_PX = 0.01;
|
|
1631
|
+
function resolveBaseShapeGeometry(element) {
|
|
1632
|
+
const shapeType = pptx.getShapeType(element.shapeType);
|
|
1633
|
+
if (element.type === "connector" || shapeType === "connector") {
|
|
1634
|
+
return { kind: "bare" };
|
|
1635
|
+
}
|
|
1636
|
+
if (isStrokeOnlyPresetElement(element) || isArrowedCustomPath(element)) {
|
|
1637
|
+
return { kind: "strokeOnly" };
|
|
1638
|
+
}
|
|
1639
|
+
if (shapeType === "roundRect" && pptx.hasShapeProperties(element)) {
|
|
1640
|
+
const radiusPx = pptx.getRoundRectRadiusPx(element);
|
|
1641
|
+
return radiusPx > MIN_ROUND_RECT_RADIUS_PX ? { kind: "borderRadius", radius: `${radiusPx}px` } : { kind: "none" };
|
|
1642
|
+
}
|
|
1643
|
+
if (shapeType === "ellipse") {
|
|
1644
|
+
return { kind: "borderRadius", radius: "50%" };
|
|
1645
|
+
}
|
|
1646
|
+
const clipPath = isIdentityRectClip(element) ? void 0 : getResolvedShapeClipPath(element);
|
|
1647
|
+
if (clipPath) {
|
|
1648
|
+
const stroke = straddlingStrokeWidth(element);
|
|
1649
|
+
return {
|
|
1650
|
+
kind: "clipPath",
|
|
1651
|
+
clipPath: stroke > 0 ? outsetClipPathForStroke(
|
|
1652
|
+
clipPath,
|
|
1653
|
+
stroke,
|
|
1654
|
+
element.width,
|
|
1655
|
+
element.height,
|
|
1656
|
+
outlineStrokeJoin(element)
|
|
1657
|
+
) : clipPath
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
if (shapeType === "line") {
|
|
1661
|
+
const authored = element.shapeStyle?.strokeWidth;
|
|
1662
|
+
return { kind: "lineEdge", strokeWidth: Math.max(Math.max(0, authored ?? 0), 2) };
|
|
1663
|
+
}
|
|
1664
|
+
if (shapeType === "cylinder") {
|
|
1665
|
+
return { kind: "borderRadius", radius: CYLINDER_RADIUS };
|
|
1666
|
+
}
|
|
1667
|
+
return { kind: "none" };
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
// src/pptx/render/silhouette-morph-registry.ts
|
|
1671
|
+
var entries = /* @__PURE__ */ new Map();
|
|
1672
|
+
function registerSilhouetteMorph(elementId, own, out, size) {
|
|
1673
|
+
entries.set(elementId, { params: own, ...size, own: JSON.stringify(own), out });
|
|
1674
|
+
}
|
|
1675
|
+
function silhouetteMorphEntry(elementId) {
|
|
1676
|
+
return entries.get(elementId);
|
|
1677
|
+
}
|
|
1678
|
+
function silhouetteMorphFor(elementId, own) {
|
|
1679
|
+
const entry = entries.get(elementId);
|
|
1680
|
+
return entry && entry.own === JSON.stringify(own) ? entry.out : void 0;
|
|
1681
|
+
}
|
|
1682
|
+
function paintedSize(element) {
|
|
1683
|
+
return {
|
|
1684
|
+
width: Math.max(element.width, 0),
|
|
1685
|
+
height: Math.max(element.height, 0)
|
|
1686
|
+
};
|
|
1687
|
+
}
|
|
1688
|
+
function needsPerSubpathPaint(subpaths) {
|
|
1689
|
+
return subpaths.some(
|
|
1690
|
+
(sp) => sp.fillMode !== void 0 && sp.fillMode !== "norm" || sp.stroke === false
|
|
1691
|
+
);
|
|
1692
|
+
}
|
|
1693
|
+
function asSubpathCapable(element) {
|
|
1694
|
+
if (element.type === "shape" || element.type === "image" || element.type === "picture") {
|
|
1695
|
+
return element;
|
|
1696
|
+
}
|
|
1697
|
+
return void 0;
|
|
1698
|
+
}
|
|
1699
|
+
function getSubpathGeometry(element, force = false) {
|
|
1700
|
+
const slots = asSubpathCapable(element);
|
|
1701
|
+
if (!slots) {
|
|
1702
|
+
return void 0;
|
|
1703
|
+
}
|
|
1704
|
+
if (slots.pathData && slots.pathWidth && slots.pathHeight) {
|
|
1705
|
+
const structured = pptx.evaluateCustomGeometryPaths(
|
|
1706
|
+
slots.customGeometryRawData,
|
|
1707
|
+
slots.pathWidth,
|
|
1708
|
+
slots.pathHeight,
|
|
1709
|
+
slots.shapeAdjustments
|
|
1710
|
+
) ?? slots.customGeometryPaths;
|
|
1711
|
+
if (!structured || structured.length === 0) {
|
|
1712
|
+
return void 0;
|
|
1713
|
+
}
|
|
1714
|
+
const subpaths2 = pptx.customGeometryPathsToSvgSubpaths(
|
|
1715
|
+
structured,
|
|
1716
|
+
slots.pathWidth,
|
|
1717
|
+
slots.pathHeight
|
|
1718
|
+
);
|
|
1719
|
+
return force || needsPerSubpathPaint(subpaths2) ? { subpaths: subpaths2, width: slots.pathWidth, height: slots.pathHeight } : void 0;
|
|
1720
|
+
}
|
|
1721
|
+
if (!slots.shapeType) {
|
|
1722
|
+
return void 0;
|
|
1723
|
+
}
|
|
1724
|
+
const { width, height } = paintedSize(element);
|
|
1725
|
+
const result = pptx.evaluatePresetShape(slots.shapeType, width, height, slots.shapeAdjustments);
|
|
1726
|
+
if (!result || result.fillNone || result.paths.length === 0) {
|
|
1727
|
+
return void 0;
|
|
1728
|
+
}
|
|
1729
|
+
const subpaths = result.paths.map((p) => ({
|
|
1730
|
+
d: p.d,
|
|
1731
|
+
fillMode: p.fill,
|
|
1732
|
+
stroke: p.stroke
|
|
1733
|
+
}));
|
|
1734
|
+
return force || needsPerSubpathPaint(subpaths) ? { subpaths, width, height } : void 0;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
// src/pptx/render/silhouette-effects.ts
|
|
1738
|
+
var DEFAULT_SHADOW = "#000000";
|
|
1739
|
+
var DEFAULT_GLOW = "#ffff00";
|
|
1740
|
+
var GLOW_RING_STEPS = 24;
|
|
1741
|
+
var GLOW_INNER_RING_STEPS = 12;
|
|
1742
|
+
function unit(value) {
|
|
1743
|
+
return Math.min(1, Math.max(0, value));
|
|
1744
|
+
}
|
|
1745
|
+
function hex(value, fallback) {
|
|
1746
|
+
if (!value || value === "transparent") {
|
|
1747
|
+
return fallback;
|
|
1748
|
+
}
|
|
1749
|
+
const candidate = value.startsWith("#") ? value : `#${value}`;
|
|
1750
|
+
return /^#[0-9A-Fa-f]{6}$/u.test(candidate) ? candidate : fallback;
|
|
1751
|
+
}
|
|
1752
|
+
function finite(value) {
|
|
1753
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
1754
|
+
}
|
|
1755
|
+
function getSilhouetteFilterId(elementId) {
|
|
1756
|
+
return `shape-fx-${elementId.replace(/[^A-Za-z0-9_.-]/gu, "_")}`;
|
|
1757
|
+
}
|
|
1758
|
+
function resolveOuterShadowLayers(style, rotation) {
|
|
1759
|
+
const layers = [];
|
|
1760
|
+
if (style.shadows && style.shadows.length > 0) {
|
|
1761
|
+
for (const shadow of style.shadows) {
|
|
1762
|
+
if (!shadow.color || shadow.color === "transparent") {
|
|
1763
|
+
continue;
|
|
1764
|
+
}
|
|
1765
|
+
const angle = (shadow.angle ?? 0) * Math.PI / 180;
|
|
1766
|
+
const distance = shadow.distance ?? 0;
|
|
1767
|
+
layers.push({
|
|
1768
|
+
offsetX: Math.cos(angle) * distance,
|
|
1769
|
+
offsetY: Math.sin(angle) * distance,
|
|
1770
|
+
blur: Math.max(0, shadow.blur ?? 6),
|
|
1771
|
+
color: hex(shadow.color, DEFAULT_SHADOW),
|
|
1772
|
+
opacity: unit(shadow.opacity ?? 0.35)
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
return layers;
|
|
1776
|
+
}
|
|
1777
|
+
if (!style.shadowColor || style.shadowColor === "transparent") {
|
|
1778
|
+
return layers;
|
|
1779
|
+
}
|
|
1780
|
+
const ooxml = style.outerShadowXml !== void 0;
|
|
1781
|
+
let offsetX;
|
|
1782
|
+
let offsetY;
|
|
1783
|
+
if (finite(style.shadowAngle) && finite(style.shadowDistance)) {
|
|
1784
|
+
const angle = style.shadowRotateWithShape === false && typeof rotation === "number" ? style.shadowAngle - rotation : style.shadowAngle;
|
|
1785
|
+
offsetX = Math.cos(angle * Math.PI / 180) * style.shadowDistance;
|
|
1786
|
+
offsetY = Math.sin(angle * Math.PI / 180) * style.shadowDistance;
|
|
1787
|
+
} else {
|
|
1788
|
+
offsetX = finite(style.shadowOffsetX) ? style.shadowOffsetX : ooxml ? 0 : 4;
|
|
1789
|
+
offsetY = finite(style.shadowOffsetY) ? style.shadowOffsetY : ooxml ? 0 : 4;
|
|
1790
|
+
}
|
|
1791
|
+
const rawBlur = finite(style.shadowBlur) ? Math.max(0, style.shadowBlur) : ooxml ? 0 : 6;
|
|
1792
|
+
layers.push({
|
|
1793
|
+
offsetX,
|
|
1794
|
+
offsetY,
|
|
1795
|
+
blur: ooxml ? shadowBlurToCss(rawBlur) : rawBlur,
|
|
1796
|
+
color: hex(style.shadowColor, DEFAULT_SHADOW),
|
|
1797
|
+
opacity: finite(style.shadowOpacity) ? unit(style.shadowOpacity) : ooxml ? 1 : 0.35
|
|
1798
|
+
});
|
|
1799
|
+
return layers;
|
|
1800
|
+
}
|
|
1801
|
+
function resolveGlow(style) {
|
|
1802
|
+
if (!style.glowColor || style.glowColor === "transparent" || !style.glowRadius) {
|
|
1803
|
+
return void 0;
|
|
1804
|
+
}
|
|
1805
|
+
if (!(style.glowRadius > 0)) {
|
|
1806
|
+
return void 0;
|
|
1807
|
+
}
|
|
1808
|
+
const { spread, blur } = glowCssLengths(style.glowRadius);
|
|
1809
|
+
return {
|
|
1810
|
+
spread,
|
|
1811
|
+
blur,
|
|
1812
|
+
color: hex(style.glowColor, DEFAULT_GLOW),
|
|
1813
|
+
opacity: finite(style.glowOpacity) ? unit(style.glowOpacity) : 0.75
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
function resolveInnerShadow(style) {
|
|
1817
|
+
if (!style.innerShadowColor || style.innerShadowColor === "transparent") {
|
|
1818
|
+
return void 0;
|
|
1819
|
+
}
|
|
1820
|
+
return {
|
|
1821
|
+
offsetX: finite(style.innerShadowOffsetX) ? style.innerShadowOffsetX : 0,
|
|
1822
|
+
offsetY: finite(style.innerShadowOffsetY) ? style.innerShadowOffsetY : 0,
|
|
1823
|
+
blur: shadowBlurToCss(finite(style.innerShadowBlur) ? Math.max(0, style.innerShadowBlur) : 6),
|
|
1824
|
+
color: hex(style.innerShadowColor, DEFAULT_SHADOW),
|
|
1825
|
+
opacity: finite(style.innerShadowOpacity) ? unit(style.innerShadowOpacity) : 0.5
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
function paintsNoFill(style) {
|
|
1829
|
+
return !style || !style.fillColor || style.fillColor === "transparent" || style.fillMode === "none";
|
|
1830
|
+
}
|
|
1831
|
+
function overlayCanPaintFill(style) {
|
|
1832
|
+
const mode = style?.fillMode;
|
|
1833
|
+
return mode === void 0 || mode === "solid" || mode === "none";
|
|
1834
|
+
}
|
|
1835
|
+
function isLayerFillMode(style) {
|
|
1836
|
+
const mode = style?.fillMode;
|
|
1837
|
+
return mode === "gradient" || mode === "pattern" || mode === "image";
|
|
1838
|
+
}
|
|
1839
|
+
function getSilhouetteEffectParams(element) {
|
|
1840
|
+
if (element.type !== "shape" || !pptx.hasShapeProperties(element)) {
|
|
1841
|
+
return void 0;
|
|
1842
|
+
}
|
|
1843
|
+
const style = element.shapeStyle;
|
|
1844
|
+
if (!style) {
|
|
1845
|
+
return void 0;
|
|
1846
|
+
}
|
|
1847
|
+
const shadows = resolveOuterShadowLayers(style, element.rotation);
|
|
1848
|
+
const glow = resolveGlow(style);
|
|
1849
|
+
const innerShadow = resolveInnerShadow(style);
|
|
1850
|
+
if (shadows.length === 0 && !glow && !innerShadow) {
|
|
1851
|
+
return void 0;
|
|
1852
|
+
}
|
|
1853
|
+
if (style.lineShadowColor || style.lineGlowColor || style.shape3d || style.scene3d) {
|
|
1854
|
+
return void 0;
|
|
1855
|
+
}
|
|
1856
|
+
const layerFill = isLayerFillMode(style);
|
|
1857
|
+
if (!layerFill && !overlayCanPaintFill(style)) {
|
|
1858
|
+
return void 0;
|
|
1859
|
+
}
|
|
1860
|
+
const geometry = resolveBaseShapeGeometry(element);
|
|
1861
|
+
if (layerFill && geometry.kind !== "clipPath") {
|
|
1862
|
+
return void 0;
|
|
1863
|
+
}
|
|
1864
|
+
if (geometry.kind === "bare" || geometry.kind === "strokeOnly" || geometry.kind === "lineEdge") {
|
|
1865
|
+
return void 0;
|
|
1866
|
+
}
|
|
1867
|
+
const translucent = typeof style.fillOpacity === "number" && style.fillOpacity < 0.999;
|
|
1868
|
+
if (geometry.kind !== "clipPath" && !paintsNoFill(style) && !translucent) {
|
|
1869
|
+
return void 0;
|
|
1870
|
+
}
|
|
1871
|
+
if (geometry.kind === "clipPath" && !layerFill && !paintsNoFill(style) && !getSubpathGeometry(element, true)) {
|
|
1872
|
+
return void 0;
|
|
1873
|
+
}
|
|
1874
|
+
const inner = innerShadow && geometry.kind === "clipPath" && !paintsNoFill(style) ? innerShadow : void 0;
|
|
1875
|
+
if (shadows.length === 0 && !glow && !inner) {
|
|
1876
|
+
return void 0;
|
|
1877
|
+
}
|
|
1878
|
+
return { shadows, ...glow ? { glow } : {}, ...inner ? { inner } : {} };
|
|
1879
|
+
}
|
|
1880
|
+
function px(value) {
|
|
1881
|
+
return String(Math.round(value * 100) / 100);
|
|
1882
|
+
}
|
|
1883
|
+
function scaledAlpha(input, result, opacity) {
|
|
1884
|
+
return `<feComponentTransfer in="${input}" result="${result}"><feFuncA type="linear" slope="${px(opacity)}"/></feComponentTransfer>`;
|
|
1885
|
+
}
|
|
1886
|
+
var MORPH_PROGRESS_VAR = "--pptx-morph-p";
|
|
1887
|
+
function flood(color, result, opacity, side) {
|
|
1888
|
+
if (!side) {
|
|
1889
|
+
return `<feFlood flood-color="${color}" result="${result}"/>`;
|
|
1890
|
+
}
|
|
1891
|
+
const k = side === "out" ? `(1 - var(${MORPH_PROGRESS_VAR}, 1))` : `var(${MORPH_PROGRESS_VAR}, 1)`;
|
|
1892
|
+
return `<feFlood flood-color="${color}" flood-opacity="${side === "out" ? 0 : px(opacity)}" style="flood-opacity:calc(${px(opacity)} * ${k})" result="${result}"/>`;
|
|
1893
|
+
}
|
|
1894
|
+
function alpha(input, result, opacity, side) {
|
|
1895
|
+
return side ? { markup: "", mask: input } : { markup: scaledAlpha(input, result, opacity), mask: result };
|
|
1896
|
+
}
|
|
1897
|
+
function glowMarkup(glow, tag, side) {
|
|
1898
|
+
const parts = [];
|
|
1899
|
+
const names = [];
|
|
1900
|
+
const ring = (radius, steps, ringTag) => {
|
|
1901
|
+
for (let i = 0; i < steps; i++) {
|
|
1902
|
+
const angle = 2 * Math.PI * i / steps;
|
|
1903
|
+
const name = `${tag}${ringTag}${i}`;
|
|
1904
|
+
names.push(name);
|
|
1905
|
+
parts.push(
|
|
1906
|
+
`<feOffset in="SourceAlpha" dx="${px(Math.cos(angle) * radius)}" dy="${px(Math.sin(angle) * radius)}" result="${name}"/>`
|
|
1907
|
+
);
|
|
1908
|
+
}
|
|
1909
|
+
};
|
|
1910
|
+
if (glow.spread > 0.01) {
|
|
1911
|
+
ring(glow.spread, GLOW_RING_STEPS, "gr");
|
|
1912
|
+
ring(glow.spread / 2, GLOW_INNER_RING_STEPS, "gi");
|
|
1913
|
+
}
|
|
1914
|
+
const merge = [
|
|
1915
|
+
...names.map((n) => `<feMergeNode in="${n}"/>`),
|
|
1916
|
+
'<feMergeNode in="SourceAlpha"/>'
|
|
1917
|
+
];
|
|
1918
|
+
parts.push(`<feMerge result="${tag}glowGrown">${merge.join("")}</feMerge>`);
|
|
1919
|
+
parts.push(
|
|
1920
|
+
`<feGaussianBlur in="${tag}glowGrown" stdDeviation="${px(glow.blur / 2)}" result="${tag}glowBlur"/>`
|
|
1921
|
+
);
|
|
1922
|
+
const scaled = alpha(`${tag}glowBlur`, `${tag}glowMask`, glow.opacity, side);
|
|
1923
|
+
parts.push(
|
|
1924
|
+
scaled.markup,
|
|
1925
|
+
flood(glow.color, `${tag}glowColor`, glow.opacity, side),
|
|
1926
|
+
`<feComposite in="${tag}glowColor" in2="${scaled.mask}" operator="in" result="${tag}glowLayer"/>`
|
|
1927
|
+
);
|
|
1928
|
+
return parts.join("");
|
|
1929
|
+
}
|
|
1930
|
+
function effectReach(params) {
|
|
1931
|
+
let reach = 0;
|
|
1932
|
+
for (const s of params.shadows) {
|
|
1933
|
+
reach = Math.max(reach, Math.hypot(s.offsetX, s.offsetY) + 1.5 * s.blur);
|
|
1934
|
+
}
|
|
1935
|
+
if (params.glow) {
|
|
1936
|
+
reach = Math.max(reach, params.glow.spread + 1.5 * params.glow.blur);
|
|
1937
|
+
}
|
|
1938
|
+
if (params.inner) {
|
|
1939
|
+
reach = Math.max(
|
|
1940
|
+
reach,
|
|
1941
|
+
Math.hypot(params.inner.offsetX, params.inner.offsetY) + 1.5 * params.inner.blur
|
|
1942
|
+
);
|
|
1943
|
+
}
|
|
1944
|
+
return reach;
|
|
1945
|
+
}
|
|
1946
|
+
function effectLayers(params, tag, side) {
|
|
1947
|
+
const out = { parts: [], glow: [], shadows: [], inner: [] };
|
|
1948
|
+
if (params.glow) {
|
|
1949
|
+
out.parts.push(glowMarkup(params.glow, tag, side));
|
|
1950
|
+
out.glow.push(`${tag}glowLayer`);
|
|
1951
|
+
}
|
|
1952
|
+
params.shadows.forEach((s, i) => {
|
|
1953
|
+
const name = `${tag}shadow${i}`;
|
|
1954
|
+
const scaled = alpha(`${name}Off`, `${name}Mask`, s.opacity, side);
|
|
1955
|
+
out.parts.push(
|
|
1956
|
+
`<feGaussianBlur in="SourceAlpha" stdDeviation="${px(s.blur / 2)}" result="${name}Blur"/>`,
|
|
1957
|
+
`<feOffset in="${name}Blur" dx="${px(s.offsetX)}" dy="${px(s.offsetY)}" result="${name}Off"/>`,
|
|
1958
|
+
scaled.markup,
|
|
1959
|
+
flood(s.color, `${name}Color`, s.opacity, side),
|
|
1960
|
+
`<feComposite in="${name}Color" in2="${scaled.mask}" operator="in" result="${name}"/>`
|
|
1961
|
+
);
|
|
1962
|
+
out.shadows.push(name);
|
|
1963
|
+
});
|
|
1964
|
+
if (params.inner) {
|
|
1965
|
+
const i = params.inner;
|
|
1966
|
+
const name = `${tag}inner`;
|
|
1967
|
+
const scaled = alpha(`${name}Blur`, `${name}Mask`, i.opacity, side);
|
|
1968
|
+
out.parts.push(
|
|
1969
|
+
`<feComponentTransfer in="SourceAlpha" result="${name}Inv"><feFuncA type="table" tableValues="1 0"/></feComponentTransfer>`,
|
|
1970
|
+
`<feOffset in="${name}Inv" dx="${px(-i.offsetX)}" dy="${px(-i.offsetY)}" result="${name}Off"/>`,
|
|
1971
|
+
`<feGaussianBlur in="${name}Off" stdDeviation="${px(i.blur / 2)}" result="${name}Blur"/>`,
|
|
1972
|
+
scaled.markup,
|
|
1973
|
+
flood(i.color, `${name}Flood`, i.opacity, side),
|
|
1974
|
+
`<feComposite in="${name}Flood" in2="${scaled.mask}" operator="in" result="${name}Color"/>`,
|
|
1975
|
+
`<feComposite in="${name}Color" in2="SourceAlpha" operator="in" result="${name}Layer"/>`
|
|
1976
|
+
);
|
|
1977
|
+
out.inner.push(`${name}Layer`);
|
|
1978
|
+
}
|
|
1979
|
+
return out;
|
|
1980
|
+
}
|
|
1981
|
+
function pairLayers(a, b, tag, parts) {
|
|
1982
|
+
const names = [];
|
|
1983
|
+
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
|
1984
|
+
const x = a[i];
|
|
1985
|
+
const y = b[i];
|
|
1986
|
+
if (x && y) {
|
|
1987
|
+
parts.push(
|
|
1988
|
+
`<feComposite in="${x}" in2="${y}" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="${tag}${i}"/>`
|
|
1989
|
+
);
|
|
1990
|
+
names.push(`${tag}${i}`);
|
|
1991
|
+
} else {
|
|
1992
|
+
names.push(x ?? y);
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
return names;
|
|
1996
|
+
}
|
|
1997
|
+
function buildSilhouetteFilterMarkup(filterId, width, height, params, outgoing) {
|
|
1998
|
+
const pad = Math.ceil(Math.max(effectReach(params), outgoing ? effectReach(outgoing) : 0)) + 4;
|
|
1999
|
+
const parts = [
|
|
2000
|
+
`<filter id="${filterId}" filterUnits="userSpaceOnUse" x="${-pad}" y="${-pad}" width="${px(Math.max(width, 1) + 2 * pad)}" height="${px(Math.max(height, 1) + 2 * pad)}" color-interpolation-filters="sRGB">`
|
|
2001
|
+
];
|
|
2002
|
+
const into = effectLayers(params, "", outgoing ? "in" : void 0);
|
|
2003
|
+
parts.push(...into.parts);
|
|
2004
|
+
let { glow, shadows, inner } = into;
|
|
2005
|
+
if (outgoing) {
|
|
2006
|
+
const out = effectLayers(outgoing, "o", "out");
|
|
2007
|
+
parts.push(...out.parts);
|
|
2008
|
+
glow = pairLayers(out.glow, into.glow, "sumglow", parts);
|
|
2009
|
+
shadows = pairLayers(out.shadows, into.shadows, "sumshadow", parts);
|
|
2010
|
+
inner = pairLayers(out.inner, into.inner, "suminner", parts);
|
|
2011
|
+
}
|
|
2012
|
+
const stack = [...glow, ...[...shadows].reverse()];
|
|
2013
|
+
parts.push(
|
|
2014
|
+
`<feMerge>${[...stack, "SourceGraphic", ...inner].map((n) => `<feMergeNode in="${n}"/>`).join("")}</feMerge>`,
|
|
2015
|
+
"</filter>"
|
|
2016
|
+
);
|
|
2017
|
+
return parts.join("");
|
|
2018
|
+
}
|
|
2019
|
+
function getSilhouetteEffects(element) {
|
|
2020
|
+
const params = getSilhouetteEffectParams(element);
|
|
2021
|
+
if (!params) {
|
|
2022
|
+
return void 0;
|
|
2023
|
+
}
|
|
2024
|
+
const filterId = getSilhouetteFilterId(element.id);
|
|
2025
|
+
return {
|
|
2026
|
+
filterId,
|
|
2027
|
+
cssReference: `url(#${filterId})`,
|
|
2028
|
+
filterMarkup: buildSilhouetteFilterMarkup(
|
|
2029
|
+
filterId,
|
|
2030
|
+
element.width,
|
|
2031
|
+
element.height,
|
|
2032
|
+
params,
|
|
2033
|
+
silhouetteMorphFor(element.id, params)
|
|
2034
|
+
),
|
|
2035
|
+
paintsInnerShadow: params.inner !== void 0
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
function silhouetteFillsOverlay(element) {
|
|
2039
|
+
if (!usesSilhouetteEffects(element) || !pptx.hasShapeProperties(element)) {
|
|
2040
|
+
return false;
|
|
2041
|
+
}
|
|
2042
|
+
return resolveBaseShapeGeometry(element).kind === "clipPath" && !paintsNoFill(element.shapeStyle) && !isLayerFillMode(element.shapeStyle);
|
|
2043
|
+
}
|
|
2044
|
+
function silhouetteFillsLayer(element) {
|
|
2045
|
+
return pptx.hasShapeProperties(element) && isLayerFillMode(element.shapeStyle) && usesSilhouetteEffects(element);
|
|
2046
|
+
}
|
|
2047
|
+
function usesSilhouetteEffects(element) {
|
|
2048
|
+
return getSilhouetteEffectParams(element) !== void 0;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
// src/pptx/render/visual-effects.ts
|
|
2052
|
+
var DEFAULT_SHADOW_COLOR = "#000000";
|
|
2053
|
+
var DEFAULT_GLOW_COLOR = "#ffff00";
|
|
2054
|
+
function escapeSvgAttr(value) {
|
|
2055
|
+
return String(value).replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
2056
|
+
}
|
|
2057
|
+
function clampUnitInterval(value) {
|
|
2058
|
+
return Math.min(1, Math.max(0, value));
|
|
2059
|
+
}
|
|
2060
|
+
function normalizeHexColor2(value, fallback) {
|
|
2061
|
+
if (!value || value === "transparent") {
|
|
2062
|
+
return fallback;
|
|
2063
|
+
}
|
|
2064
|
+
const candidate = value.startsWith("#") ? value : `#${value}`;
|
|
2065
|
+
return /^#[0-9A-Fa-f]{6}$/u.test(candidate) ? candidate : fallback;
|
|
2066
|
+
}
|
|
2067
|
+
function hexToRgbChannels(color) {
|
|
2068
|
+
const normalized = color.replace("#", "");
|
|
2069
|
+
if (!/^[0-9a-fA-F]{6}$/u.test(normalized)) {
|
|
2070
|
+
return null;
|
|
2071
|
+
}
|
|
2072
|
+
return {
|
|
2073
|
+
r: Number.parseInt(normalized.slice(0, 2), 16),
|
|
2074
|
+
g: Number.parseInt(normalized.slice(2, 4), 16),
|
|
2075
|
+
b: Number.parseInt(normalized.slice(4, 6), 16)
|
|
2076
|
+
};
|
|
2077
|
+
}
|
|
2078
|
+
function colorWithOpacity2(color, opacity) {
|
|
2079
|
+
if (opacity === void 0) {
|
|
2080
|
+
return color;
|
|
2081
|
+
}
|
|
2082
|
+
const rgb = hexToRgbChannels(color);
|
|
2083
|
+
if (!rgb) {
|
|
2084
|
+
return color;
|
|
2085
|
+
}
|
|
2086
|
+
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${clampUnitInterval(opacity)})`;
|
|
2087
|
+
}
|
|
2088
|
+
function getOuterShadowCss(style, context) {
|
|
2089
|
+
if (!style?.shadowColor || style.shadowColor === "transparent") {
|
|
2090
|
+
return void 0;
|
|
2091
|
+
}
|
|
2092
|
+
const usesOoxmlDefaults = style.outerShadowXml !== void 0;
|
|
2093
|
+
let offsetX;
|
|
2094
|
+
let offsetY;
|
|
2095
|
+
if (typeof style.shadowAngle === "number" && typeof style.shadowDistance === "number") {
|
|
2096
|
+
const angle = style.shadowRotateWithShape === false && typeof context?.rotation === "number" ? style.shadowAngle - context.rotation : style.shadowAngle;
|
|
2097
|
+
const angleRad = angle * Math.PI / 180;
|
|
2098
|
+
offsetX = Math.cos(angleRad) * style.shadowDistance;
|
|
2099
|
+
offsetY = Math.sin(angleRad) * style.shadowDistance;
|
|
2100
|
+
} else {
|
|
2101
|
+
offsetX = typeof style.shadowOffsetX === "number" && Number.isFinite(style.shadowOffsetX) ? style.shadowOffsetX : usesOoxmlDefaults ? 0 : 4;
|
|
2102
|
+
offsetY = typeof style.shadowOffsetY === "number" && Number.isFinite(style.shadowOffsetY) ? style.shadowOffsetY : usesOoxmlDefaults ? 0 : 4;
|
|
2103
|
+
}
|
|
2104
|
+
const rawBlur = typeof style.shadowBlur === "number" && Number.isFinite(style.shadowBlur) ? Math.max(0, style.shadowBlur) : usesOoxmlDefaults ? 0 : 6;
|
|
2105
|
+
const blur = usesOoxmlDefaults ? shadowBlurToCss(rawBlur) : rawBlur;
|
|
2106
|
+
const opacity = typeof style.shadowOpacity === "number" && Number.isFinite(style.shadowOpacity) ? clampUnitInterval(style.shadowOpacity) : usesOoxmlDefaults ? 1 : 0.35;
|
|
2107
|
+
const spread = getShadowScaleSpread(style.shadowScaleX, style.shadowScaleY, blur);
|
|
2108
|
+
const color = colorWithOpacity2(
|
|
2109
|
+
normalizeHexColor2(style.shadowColor, DEFAULT_SHADOW_COLOR),
|
|
2110
|
+
opacity
|
|
2111
|
+
);
|
|
2112
|
+
const geometry = `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px`;
|
|
2113
|
+
return spread === 0 ? `${geometry} ${color}` : `${geometry} ${spread}px ${color}`;
|
|
2114
|
+
}
|
|
2115
|
+
function getCompositeOuterShadowFilterCss(style, context) {
|
|
2116
|
+
if (!style) {
|
|
2117
|
+
return void 0;
|
|
2118
|
+
}
|
|
2119
|
+
const usesOoxmlDefaults = style.outerShadowXml !== void 0;
|
|
2120
|
+
const shadows = style.shadows && style.shadows.length > 0 ? style.shadows : style.shadowColor && style.shadowColor !== "transparent" ? [
|
|
2121
|
+
{
|
|
2122
|
+
angle: style.shadowAngle,
|
|
2123
|
+
distance: style.shadowDistance,
|
|
2124
|
+
offsetX: style.shadowOffsetX,
|
|
2125
|
+
offsetY: style.shadowOffsetY,
|
|
2126
|
+
blur: style.shadowBlur,
|
|
2127
|
+
color: style.shadowColor,
|
|
2128
|
+
opacity: style.shadowOpacity
|
|
2129
|
+
}
|
|
2130
|
+
] : [];
|
|
2131
|
+
const parts = [];
|
|
2132
|
+
for (const shadow of shadows) {
|
|
2133
|
+
if (!shadow.color || shadow.color === "transparent") {
|
|
2134
|
+
continue;
|
|
2135
|
+
}
|
|
2136
|
+
let offsetX;
|
|
2137
|
+
let offsetY;
|
|
2138
|
+
if (typeof shadow.angle === "number" && typeof shadow.distance === "number") {
|
|
2139
|
+
const angle = style.shadowRotateWithShape === false && typeof context?.rotation === "number" ? shadow.angle - context.rotation : shadow.angle;
|
|
2140
|
+
const angleRad = angle * Math.PI / 180;
|
|
2141
|
+
offsetX = Math.cos(angleRad) * shadow.distance;
|
|
2142
|
+
offsetY = Math.sin(angleRad) * shadow.distance;
|
|
2143
|
+
} else {
|
|
2144
|
+
offsetX = typeof shadow.offsetX === "number" && Number.isFinite(shadow.offsetX) ? shadow.offsetX : usesOoxmlDefaults ? 0 : 4;
|
|
2145
|
+
offsetY = typeof shadow.offsetY === "number" && Number.isFinite(shadow.offsetY) ? shadow.offsetY : usesOoxmlDefaults ? 0 : 4;
|
|
2146
|
+
}
|
|
2147
|
+
const rawBlur = typeof shadow.blur === "number" && Number.isFinite(shadow.blur) ? Math.max(0, shadow.blur) : usesOoxmlDefaults ? 0 : 6;
|
|
2148
|
+
const blur = usesOoxmlDefaults ? shadowBlurToCss(rawBlur) : rawBlur;
|
|
2149
|
+
const opacity = typeof shadow.opacity === "number" && Number.isFinite(shadow.opacity) ? clampUnitInterval(shadow.opacity) : usesOoxmlDefaults ? 1 : 0.35;
|
|
2150
|
+
const color = colorWithOpacity2(normalizeHexColor2(shadow.color, DEFAULT_SHADOW_COLOR), opacity);
|
|
2151
|
+
parts.push(
|
|
2152
|
+
`drop-shadow(${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${color})`
|
|
2153
|
+
);
|
|
2154
|
+
}
|
|
2155
|
+
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
2156
|
+
}
|
|
2157
|
+
function getShadowScaleSpread(scaleX, scaleY, blur) {
|
|
2158
|
+
const sx = typeof scaleX === "number" && Number.isFinite(scaleX) ? scaleX / 1e5 : 1;
|
|
2159
|
+
const sy = typeof scaleY === "number" && Number.isFinite(scaleY) ? scaleY / 1e5 : 1;
|
|
2160
|
+
const avgScale = (sx + sy) / 2;
|
|
2161
|
+
if (avgScale === 1) {
|
|
2162
|
+
return 0;
|
|
2163
|
+
}
|
|
2164
|
+
const base = Math.max(blur, 4);
|
|
2165
|
+
return Math.round(base * (avgScale - 1));
|
|
2166
|
+
}
|
|
2167
|
+
function getInnerShadowCss(style) {
|
|
2168
|
+
if (!style?.innerShadowColor || style.innerShadowColor === "transparent") {
|
|
2169
|
+
return void 0;
|
|
2170
|
+
}
|
|
2171
|
+
const offsetX = typeof style.innerShadowOffsetX === "number" && Number.isFinite(style.innerShadowOffsetX) ? style.innerShadowOffsetX : 0;
|
|
2172
|
+
const offsetY = typeof style.innerShadowOffsetY === "number" && Number.isFinite(style.innerShadowOffsetY) ? style.innerShadowOffsetY : 0;
|
|
2173
|
+
const blur = typeof style.innerShadowBlur === "number" && Number.isFinite(style.innerShadowBlur) ? Math.max(0, style.innerShadowBlur) : 6;
|
|
2174
|
+
const opacity = typeof style.innerShadowOpacity === "number" && Number.isFinite(style.innerShadowOpacity) ? clampUnitInterval(style.innerShadowOpacity) : 0.5;
|
|
2175
|
+
return `inset ${Math.round(-offsetX) + 0}px ${Math.round(-offsetY) + 0}px ${Math.round(shadowBlurToCss(blur))}px ${colorWithOpacity2(
|
|
2176
|
+
normalizeHexColor2(style.innerShadowColor, DEFAULT_SHADOW_COLOR),
|
|
2177
|
+
opacity
|
|
2178
|
+
)}`;
|
|
2179
|
+
}
|
|
2180
|
+
function getMultiLayerShadowCss(style) {
|
|
2181
|
+
if (!style?.shadows || style.shadows.length === 0) {
|
|
2182
|
+
return void 0;
|
|
2183
|
+
}
|
|
2184
|
+
const parts = [];
|
|
2185
|
+
for (const shadow of style.shadows) {
|
|
2186
|
+
if (!shadow.color || shadow.color === "transparent") {
|
|
2187
|
+
continue;
|
|
2188
|
+
}
|
|
2189
|
+
const angleRad = (shadow.angle ?? 0) * Math.PI / 180;
|
|
2190
|
+
const dist = shadow.distance ?? 0;
|
|
2191
|
+
const offsetX = Math.round(Math.cos(angleRad) * dist);
|
|
2192
|
+
const offsetY = Math.round(Math.sin(angleRad) * dist);
|
|
2193
|
+
const blur = Math.round(Math.max(0, shadow.blur ?? 6));
|
|
2194
|
+
const opacity = clampUnitInterval(shadow.opacity ?? 0.35);
|
|
2195
|
+
const color = colorWithOpacity2(normalizeHexColor2(shadow.color, DEFAULT_SHADOW_COLOR), opacity);
|
|
2196
|
+
parts.push(`${offsetX}px ${offsetY}px ${blur}px ${color}`);
|
|
2197
|
+
}
|
|
2198
|
+
return parts.length > 0 ? parts.join(", ") : void 0;
|
|
2199
|
+
}
|
|
2200
|
+
function getGlowBoxShadowCss(color, radius, opacity) {
|
|
2201
|
+
if (!color || color === "transparent" || !radius || radius <= 0) {
|
|
2202
|
+
return void 0;
|
|
2203
|
+
}
|
|
2204
|
+
const baseOpacity = typeof opacity === "number" ? clampUnitInterval(opacity) : 0.75;
|
|
2205
|
+
const normalizedColor = normalizeHexColor2(color, DEFAULT_GLOW_COLOR);
|
|
2206
|
+
const { spread, blur } = glowCssLengths(radius);
|
|
2207
|
+
const glowColor = colorWithOpacity2(normalizedColor, baseOpacity);
|
|
2208
|
+
return `0 0 ${Math.round(blur * 10) / 10}px ${Math.round(spread * 10) / 10}px ${glowColor}`;
|
|
2209
|
+
}
|
|
2210
|
+
function getBoxShadowCss(style, options = {}, context) {
|
|
2211
|
+
if (!style) {
|
|
2212
|
+
return void 0;
|
|
2213
|
+
}
|
|
2214
|
+
const parts = [];
|
|
2215
|
+
const multiLayer = options.includeOuter === false ? void 0 : getMultiLayerShadowCss(style);
|
|
2216
|
+
if (multiLayer) {
|
|
2217
|
+
parts.push(multiLayer);
|
|
2218
|
+
} else if (options.includeOuter !== false) {
|
|
2219
|
+
const outer = getOuterShadowCss(style, context);
|
|
2220
|
+
if (outer) {
|
|
2221
|
+
parts.push(outer);
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
const inner = options.includeInner === false ? void 0 : getInnerShadowCss(style);
|
|
2225
|
+
if (inner) {
|
|
2226
|
+
parts.push(inner);
|
|
2227
|
+
}
|
|
2228
|
+
if (options.includeGlow !== false) {
|
|
2229
|
+
const glow = getGlowBoxShadowCss(style.glowColor, style.glowRadius, style.glowOpacity);
|
|
2230
|
+
if (glow) {
|
|
2231
|
+
parts.push(glow);
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
return parts.length > 0 ? parts.join(", ") : void 0;
|
|
2235
|
+
}
|
|
2236
|
+
var buildShadowCssFromShapeStyle = getOuterShadowCss;
|
|
2237
|
+
var buildInnerShadowCssFromShapeStyle = getInnerShadowCss;
|
|
2238
|
+
var buildMultiLayerShadowCss = getMultiLayerShadowCss;
|
|
2239
|
+
var buildGlowBoxShadow = getGlowBoxShadowCss;
|
|
2240
|
+
function getLineShadowParams(style) {
|
|
2241
|
+
if (!style?.lineShadowColor || style.lineShadowColor === "transparent") {
|
|
2242
|
+
return void 0;
|
|
2243
|
+
}
|
|
2244
|
+
return {
|
|
2245
|
+
offsetX: typeof style.lineShadowOffsetX === "number" ? style.lineShadowOffsetX : 2,
|
|
2246
|
+
offsetY: typeof style.lineShadowOffsetY === "number" ? style.lineShadowOffsetY : 2,
|
|
2247
|
+
blur: typeof style.lineShadowBlur === "number" ? Math.max(0, style.lineShadowBlur) : 4,
|
|
2248
|
+
color: normalizeHexColor2(style.lineShadowColor, DEFAULT_SHADOW_COLOR),
|
|
2249
|
+
opacity: typeof style.lineShadowOpacity === "number" ? clampUnitInterval(style.lineShadowOpacity) : 0.35
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
function getLineShadowCss(style) {
|
|
2253
|
+
const p = getLineShadowParams(style);
|
|
2254
|
+
if (!p) {
|
|
2255
|
+
return void 0;
|
|
2256
|
+
}
|
|
2257
|
+
return `${Math.round(p.offsetX)}px ${Math.round(p.offsetY)}px ${Math.round(
|
|
2258
|
+
p.blur
|
|
2259
|
+
)}px ${colorWithOpacity2(p.color, p.opacity)}`;
|
|
2260
|
+
}
|
|
2261
|
+
function getLineGlowFilterCss(style) {
|
|
2262
|
+
if (!style?.lineGlowColor || style.lineGlowColor === "transparent" || !style.lineGlowRadius) {
|
|
2263
|
+
return void 0;
|
|
2264
|
+
}
|
|
2265
|
+
const glowOpacity = typeof style.lineGlowOpacity === "number" ? style.lineGlowOpacity : 0.75;
|
|
2266
|
+
const glowRad = Math.round(Math.max(0, style.lineGlowRadius));
|
|
2267
|
+
const glowCol = colorWithOpacity2(
|
|
2268
|
+
normalizeHexColor2(style.lineGlowColor, DEFAULT_GLOW_COLOR),
|
|
2269
|
+
glowOpacity
|
|
2270
|
+
);
|
|
2271
|
+
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2272
|
+
}
|
|
2273
|
+
var buildLineShadowCss = getLineShadowCss;
|
|
2274
|
+
var buildLineGlowFilter = getLineGlowFilterCss;
|
|
2275
|
+
function getEffectDagCssFilter(style, elementId) {
|
|
2276
|
+
if (!style) {
|
|
2277
|
+
return void 0;
|
|
2278
|
+
}
|
|
2279
|
+
const filters = [];
|
|
2280
|
+
if (style.dagGrayscale) {
|
|
2281
|
+
filters.push("grayscale(1)");
|
|
2282
|
+
}
|
|
2283
|
+
if (typeof style.dagBiLevel === "number") {
|
|
2284
|
+
const thresh = Math.max(0, Math.min(100, style.dagBiLevel));
|
|
2285
|
+
filters.push(thresh > 50 ? "contrast(1000)" : "contrast(0.01)");
|
|
2286
|
+
}
|
|
2287
|
+
if (typeof style.dagLumBrightness === "number" || typeof style.dagLumContrast === "number") {
|
|
2288
|
+
const bright = style.dagLumBrightness ?? 0;
|
|
2289
|
+
const contrast = style.dagLumContrast ?? 0;
|
|
2290
|
+
if (bright !== 0) {
|
|
2291
|
+
filters.push(`brightness(${1 + bright / 100})`);
|
|
2292
|
+
}
|
|
2293
|
+
if (contrast !== 0) {
|
|
2294
|
+
filters.push(`contrast(${1 + contrast / 100})`);
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
if (typeof style.dagHslHue === "number" && style.dagHslHue !== 0) {
|
|
2298
|
+
filters.push(`hue-rotate(${style.dagHslHue}deg)`);
|
|
2299
|
+
}
|
|
2300
|
+
if (typeof style.dagHslSaturation === "number" && style.dagHslSaturation !== 100) {
|
|
2301
|
+
filters.push(`saturate(${style.dagHslSaturation / 100})`);
|
|
2302
|
+
}
|
|
2303
|
+
if (typeof style.dagHslLuminance === "number" && style.dagHslLuminance !== 0) {
|
|
2304
|
+
filters.push(`brightness(${1 + style.dagHslLuminance / 100})`);
|
|
2305
|
+
}
|
|
2306
|
+
if (typeof style.dagAlphaModFix === "number") {
|
|
2307
|
+
const alpha2 = clampUnitInterval(style.dagAlphaModFix / 100);
|
|
2308
|
+
filters.push(`opacity(${alpha2})`);
|
|
2309
|
+
}
|
|
2310
|
+
if (typeof style.dagTintHue === "number" || typeof style.dagTintAmount === "number") {
|
|
2311
|
+
const hue = style.dagTintHue ?? 0;
|
|
2312
|
+
const amt = Math.max(0, Math.min(100, style.dagTintAmount ?? 50));
|
|
2313
|
+
filters.push(`sepia(${amt / 100}) hue-rotate(${hue}deg)`);
|
|
2314
|
+
}
|
|
2315
|
+
if (style.dagDuotone && elementId) {
|
|
2316
|
+
filters.push(`url(#${getDuotoneFilterId(elementId)})`);
|
|
2317
|
+
}
|
|
2318
|
+
return filters.length > 0 ? filters.join(" ") : void 0;
|
|
2319
|
+
}
|
|
2320
|
+
var getEffectDagFilter = getEffectDagCssFilter;
|
|
2321
|
+
function hasEffectDagProperties(style) {
|
|
2322
|
+
if (!style) {
|
|
2323
|
+
return false;
|
|
2324
|
+
}
|
|
2325
|
+
return Boolean(
|
|
2326
|
+
style.dagGrayscale || typeof style.dagBiLevel === "number" || typeof style.dagLumBrightness === "number" || typeof style.dagLumContrast === "number" || typeof style.dagHslHue === "number" || typeof style.dagHslSaturation === "number" || typeof style.dagHslLuminance === "number" || typeof style.dagAlphaModFix === "number" || typeof style.dagTintHue === "number" || typeof style.dagTintAmount === "number" || style.dagDuotone || style.dagFillOverlayBlend || style.dagFillOverlayColor
|
|
2327
|
+
);
|
|
2328
|
+
}
|
|
2329
|
+
function getEffectFilterCss(style, elementId, options = {}) {
|
|
2330
|
+
if (!style) {
|
|
2331
|
+
return void 0;
|
|
2332
|
+
}
|
|
2333
|
+
const parts = [];
|
|
2334
|
+
if (options.glow !== false && style.glowColor && style.glowColor !== "transparent" && style.glowRadius) {
|
|
2335
|
+
const glowOpacity = typeof style.glowOpacity === "number" ? style.glowOpacity : 0.75;
|
|
2336
|
+
const glowCol = colorWithOpacity2(
|
|
2337
|
+
normalizeHexColor2(style.glowColor, DEFAULT_GLOW_COLOR),
|
|
2338
|
+
glowOpacity
|
|
2339
|
+
);
|
|
2340
|
+
for (const blur of glowFilterLengths(style.glowRadius)) {
|
|
2341
|
+
parts.push(`drop-shadow(0 0 ${blur}px ${glowCol})`);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
if (typeof style.softEdgeRadius === "number" && style.softEdgeRadius > 0) {
|
|
2345
|
+
if (elementId) {
|
|
2346
|
+
parts.push(`url(#${getSoftEdgeFilterId(elementId)})`);
|
|
2347
|
+
} else {
|
|
2348
|
+
parts.push(`blur(${Math.min(2, Math.round(style.softEdgeRadius))}px)`);
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
if (typeof style.blurRadius === "number" && style.blurRadius > 0) {
|
|
2352
|
+
parts.push(`blur(${Math.round(style.blurRadius)}px)`);
|
|
2353
|
+
}
|
|
2354
|
+
const dagFilter = getEffectDagCssFilter(style, elementId);
|
|
2355
|
+
if (dagFilter) {
|
|
2356
|
+
parts.push(dagFilter);
|
|
2357
|
+
}
|
|
2358
|
+
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
2359
|
+
}
|
|
2360
|
+
function getEffectDagOpacity(style) {
|
|
2361
|
+
if (!style || typeof style.dagAlphaModFix !== "number") {
|
|
2362
|
+
return void 0;
|
|
2363
|
+
}
|
|
2364
|
+
return clampUnitInterval(style.dagAlphaModFix / 100);
|
|
2365
|
+
}
|
|
2366
|
+
function getEffectDagBlendMode(blend) {
|
|
2367
|
+
switch (blend) {
|
|
2368
|
+
case "mult":
|
|
2369
|
+
return "multiply";
|
|
2370
|
+
case "screen":
|
|
2371
|
+
return "screen";
|
|
2372
|
+
case "darken":
|
|
2373
|
+
return "darken";
|
|
2374
|
+
case "lighten":
|
|
2375
|
+
return "lighten";
|
|
2376
|
+
default:
|
|
2377
|
+
return void 0;
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
function getEffectDagFillOverlay(style) {
|
|
2381
|
+
if (!style?.dagFillOverlayColor || style.dagFillOverlayColor === "transparent") {
|
|
2382
|
+
return void 0;
|
|
2383
|
+
}
|
|
2384
|
+
const blendMode = getEffectDagBlendMode(style.dagFillOverlayBlend) ?? "normal";
|
|
2385
|
+
const color = colorWithOpacity2(
|
|
2386
|
+
normalizeHexColor2(style.dagFillOverlayColor, DEFAULT_SHADOW_COLOR),
|
|
2387
|
+
style.dagFillOverlayOpacity
|
|
2388
|
+
);
|
|
2389
|
+
return { color, blendMode };
|
|
2390
|
+
}
|
|
2391
|
+
function getShapeFillOverlay(style) {
|
|
2392
|
+
if (!style?.shapeFillOverlayColor || style.shapeFillOverlayColor === "transparent") {
|
|
2393
|
+
return void 0;
|
|
2394
|
+
}
|
|
2395
|
+
const blendMode = getEffectDagBlendMode(style.shapeFillOverlayBlend) ?? "normal";
|
|
2396
|
+
const color = colorWithOpacity2(
|
|
2397
|
+
normalizeHexColor2(style.shapeFillOverlayColor, DEFAULT_SHADOW_COLOR),
|
|
2398
|
+
style.shapeFillOverlayOpacity
|
|
2399
|
+
);
|
|
2400
|
+
return { color, blendMode };
|
|
2401
|
+
}
|
|
2402
|
+
function getDuotoneFilterId(elementId) {
|
|
2403
|
+
return `dag-duotone-${elementId}`;
|
|
2404
|
+
}
|
|
2405
|
+
function getDuotoneSvgFilter(style, elementId) {
|
|
2406
|
+
if (!style?.dagDuotone) {
|
|
2407
|
+
return void 0;
|
|
2408
|
+
}
|
|
2409
|
+
const id = getDuotoneFilterId(elementId);
|
|
2410
|
+
const c1 = color.hexToRgbUnit(style.dagDuotone.color1);
|
|
2411
|
+
const c2 = color.hexToRgbUnit(style.dagDuotone.color2);
|
|
2412
|
+
const grayscaleMatrix = [
|
|
2413
|
+
0.2126,
|
|
2414
|
+
0.7152,
|
|
2415
|
+
0.0722,
|
|
2416
|
+
0,
|
|
2417
|
+
0,
|
|
2418
|
+
0.2126,
|
|
2419
|
+
0.7152,
|
|
2420
|
+
0.0722,
|
|
2421
|
+
0,
|
|
2422
|
+
0,
|
|
2423
|
+
0.2126,
|
|
2424
|
+
0.7152,
|
|
2425
|
+
0.0722,
|
|
2426
|
+
0,
|
|
2427
|
+
0,
|
|
2428
|
+
0,
|
|
2429
|
+
0,
|
|
2430
|
+
0,
|
|
2431
|
+
1,
|
|
2432
|
+
0
|
|
2433
|
+
].join(" ");
|
|
2434
|
+
const slopeR = c2.r - c1.r;
|
|
2435
|
+
const slopeG = c2.g - c1.g;
|
|
2436
|
+
const slopeB = c2.b - c1.b;
|
|
2437
|
+
const filterMarkup = [
|
|
2438
|
+
`<filter id="${escapeSvgAttr(id)}" color-interpolation-filters="sRGB">`,
|
|
2439
|
+
`<feColorMatrix type="matrix" values="${grayscaleMatrix}"/>`,
|
|
2440
|
+
`<feComponentTransfer>`,
|
|
2441
|
+
`<feFuncR type="linear" slope="${slopeR}" intercept="${c1.r}"/>`,
|
|
2442
|
+
`<feFuncG type="linear" slope="${slopeG}" intercept="${c1.g}"/>`,
|
|
2443
|
+
`<feFuncB type="linear" slope="${slopeB}" intercept="${c1.b}"/>`,
|
|
2444
|
+
`</feComponentTransfer>`,
|
|
2445
|
+
`</filter>`
|
|
2446
|
+
].join("");
|
|
2447
|
+
return { id, cssReference: `url(#${id})`, filterMarkup };
|
|
2448
|
+
}
|
|
2449
|
+
function getSoftEdgeFilterId(elementId) {
|
|
2450
|
+
return `soft-edge-${elementId}`;
|
|
2451
|
+
}
|
|
2452
|
+
var SOFT_EDGE_ERODE_FACTOR = 0.9;
|
|
2453
|
+
var SOFT_EDGE_BLUR_FACTOR = 0.3;
|
|
2454
|
+
function getSoftEdgeSvgFilter(style, elementId) {
|
|
2455
|
+
if (!style || typeof style.softEdgeRadius !== "number" || style.softEdgeRadius <= 0) {
|
|
2456
|
+
return void 0;
|
|
2457
|
+
}
|
|
2458
|
+
const id = getSoftEdgeFilterId(elementId);
|
|
2459
|
+
const radius = style.softEdgeRadius;
|
|
2460
|
+
const erode = (radius * SOFT_EDGE_ERODE_FACTOR).toFixed(2);
|
|
2461
|
+
const blur = (radius * SOFT_EDGE_BLUR_FACTOR).toFixed(2);
|
|
2462
|
+
const filterMarkup = [
|
|
2463
|
+
`<filter id="${escapeSvgAttr(id)}" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">`,
|
|
2464
|
+
`<feMorphology in="SourceAlpha" operator="erode" radius="${erode}" result="softEdgeEroded"/>`,
|
|
2465
|
+
`<feGaussianBlur in="softEdgeEroded" stdDeviation="${blur}" result="softEdgeAlpha"/>`,
|
|
2466
|
+
`<feComposite in="SourceGraphic" in2="softEdgeAlpha" operator="in"/>`,
|
|
2467
|
+
`</filter>`
|
|
2468
|
+
].join("");
|
|
2469
|
+
return { id, cssReference: `url(#${id})`, filterMarkup };
|
|
2470
|
+
}
|
|
2471
|
+
function getShapeEffectFilterDefs(element) {
|
|
2472
|
+
const softEdge = getSoftEdgeSvgFilter(getEffectStyleSource(element), element.id);
|
|
2473
|
+
const silhouette = getSilhouetteEffects(element);
|
|
2474
|
+
if (!softEdge && !silhouette) {
|
|
2475
|
+
return void 0;
|
|
2476
|
+
}
|
|
2477
|
+
const base = softEdge ?? {
|
|
2478
|
+
id: silhouette?.filterId ?? "",
|
|
2479
|
+
cssReference: silhouette?.cssReference ?? "",
|
|
2480
|
+
filterMarkup: ""
|
|
2481
|
+
};
|
|
2482
|
+
return {
|
|
2483
|
+
...base,
|
|
2484
|
+
filterMarkup: `${softEdge?.filterMarkup ?? ""}${silhouette?.filterMarkup ?? ""}`
|
|
2485
|
+
};
|
|
2486
|
+
}
|
|
2487
|
+
function getDuotoneSvgFilterMarkup(filterId, color1, color2) {
|
|
2488
|
+
const c1 = color.hexToRgbUnit(color1);
|
|
2489
|
+
const c2 = color.hexToRgbUnit(color2);
|
|
2490
|
+
const grayscaleMatrix = [
|
|
2491
|
+
0.2126,
|
|
2492
|
+
0.7152,
|
|
2493
|
+
0.0722,
|
|
2494
|
+
0,
|
|
2495
|
+
0,
|
|
2496
|
+
0.2126,
|
|
2497
|
+
0.7152,
|
|
2498
|
+
0.0722,
|
|
2499
|
+
0,
|
|
2500
|
+
0,
|
|
2501
|
+
0.2126,
|
|
2502
|
+
0.7152,
|
|
2503
|
+
0.0722,
|
|
2504
|
+
0,
|
|
2505
|
+
0,
|
|
2506
|
+
0,
|
|
2507
|
+
0,
|
|
2508
|
+
0,
|
|
2509
|
+
1,
|
|
2510
|
+
0
|
|
2511
|
+
].join(" ");
|
|
2512
|
+
const slopeR = c2.r - c1.r;
|
|
2513
|
+
const slopeG = c2.g - c1.g;
|
|
2514
|
+
const slopeB = c2.b - c1.b;
|
|
2515
|
+
return [
|
|
2516
|
+
`<svg width="0" height="0" style="position:absolute;overflow:hidden" aria-hidden="true">`,
|
|
2517
|
+
`<defs>`,
|
|
2518
|
+
`<filter id="${escapeSvgAttr(filterId)}" color-interpolation-filters="sRGB">`,
|
|
2519
|
+
`<feColorMatrix type="matrix" values="${grayscaleMatrix}"/>`,
|
|
2520
|
+
`<feComponentTransfer>`,
|
|
2521
|
+
`<feFuncR type="linear" slope="${slopeR}" intercept="${c1.r}"/>`,
|
|
2522
|
+
`<feFuncG type="linear" slope="${slopeG}" intercept="${c1.g}"/>`,
|
|
2523
|
+
`<feFuncB type="linear" slope="${slopeB}" intercept="${c1.b}"/>`,
|
|
2524
|
+
`</feComponentTransfer>`,
|
|
2525
|
+
`</filter>`,
|
|
2526
|
+
`</defs>`,
|
|
2527
|
+
`</svg>`
|
|
2528
|
+
].join("");
|
|
2529
|
+
}
|
|
2530
|
+
function getEffectStyleSource(element) {
|
|
2531
|
+
if ("shapeStyle" in element) {
|
|
2532
|
+
return element.shapeStyle;
|
|
2533
|
+
}
|
|
2534
|
+
if (element.type === "chart") {
|
|
2535
|
+
return chartAreaEffectStyle(element.chartData);
|
|
2536
|
+
}
|
|
2537
|
+
return element.type === "group" ? element.groupEffectStyle : void 0;
|
|
2538
|
+
}
|
|
2539
|
+
function getComputedEffectStyle(element, options = {}) {
|
|
2540
|
+
const style = getEffectStyleSource(element);
|
|
2541
|
+
const result = {};
|
|
2542
|
+
if (!style) {
|
|
2543
|
+
return result;
|
|
2544
|
+
}
|
|
2545
|
+
const paintsLineEffectsItself = element.type === "connector" || pptx.getShapeType("shapeType" in element ? element.shapeType : void 0) === "connector";
|
|
2546
|
+
const shadowsCompositePixels = element.type === "group" || element.type === "text" || element.type === "image" || element.type === "picture";
|
|
2547
|
+
const compositeShadow = shadowsCompositePixels ? getCompositeOuterShadowFilterCss(style, { rotation: element.rotation }) : void 0;
|
|
2548
|
+
const silhouette = shadowsCompositePixels ? void 0 : getSilhouetteEffects(element);
|
|
2549
|
+
const boxShadow = shadowsCompositePixels ? void 0 : getBoxShadowCss(
|
|
2550
|
+
style,
|
|
2551
|
+
{
|
|
2552
|
+
includeGlow: silhouette ? false : options.includeGlowBoxShadow,
|
|
2553
|
+
includeOuter: !silhouette,
|
|
2554
|
+
includeInner: !silhouette?.paintsInnerShadow
|
|
2555
|
+
},
|
|
2556
|
+
{ rotation: element.rotation }
|
|
2557
|
+
);
|
|
2558
|
+
const lineShadow = paintsLineEffectsItself ? void 0 : getLineShadowCss(style);
|
|
2559
|
+
const shadowParts = [boxShadow, lineShadow].filter(
|
|
2560
|
+
(part) => part !== void 0 && part !== ""
|
|
2561
|
+
);
|
|
2562
|
+
if (shadowParts.length > 0) {
|
|
2563
|
+
result.boxShadow = shadowParts.join(", ");
|
|
2564
|
+
}
|
|
2565
|
+
const glowInBoxShadow = !shadowsCompositePixels && (options.includeGlowBoxShadow !== false || silhouette !== void 0);
|
|
2566
|
+
const filter = getEffectFilterCss(style, element.id, { glow: !glowInBoxShadow });
|
|
2567
|
+
const lineGlow = paintsLineEffectsItself ? void 0 : getLineGlowFilterCss(style);
|
|
2568
|
+
const filterParts = [silhouette?.cssReference, compositeShadow, filter, lineGlow].filter(
|
|
2569
|
+
(part) => part !== void 0 && part !== ""
|
|
2570
|
+
);
|
|
2571
|
+
if (filterParts.length > 0) {
|
|
2572
|
+
result.filter = filterParts.join(" ");
|
|
2573
|
+
}
|
|
2574
|
+
const reflection = getReflectionWrapperStyle(style, element.height);
|
|
2575
|
+
if (reflection) {
|
|
2576
|
+
result.reflection = reflection;
|
|
2577
|
+
}
|
|
2578
|
+
const opacity = getEffectDagOpacity(style);
|
|
2579
|
+
if (opacity !== void 0) {
|
|
2580
|
+
result.opacity = opacity;
|
|
2581
|
+
}
|
|
2582
|
+
const overlay = getEffectDagFillOverlay(style) ?? getShapeFillOverlay(style);
|
|
2583
|
+
if (overlay) {
|
|
2584
|
+
result.fillOverlay = overlay;
|
|
2585
|
+
} else {
|
|
2586
|
+
const blend = getEffectDagBlendMode(style.dagFillOverlayBlend);
|
|
2587
|
+
if (blend) {
|
|
2588
|
+
result.mixBlendMode = blend;
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
if (style.blurGrow && typeof style.blurRadius === "number" && style.blurRadius > 0) {
|
|
2592
|
+
result.overflowVisible = true;
|
|
2593
|
+
}
|
|
2594
|
+
return result;
|
|
2595
|
+
}
|
|
2596
|
+
function hasImageEffects(element) {
|
|
2597
|
+
return pptx.isImageLikeElement(element) && Boolean(element.imageEffects);
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
// src/pptx/render/gradient-svg-image.ts
|
|
2601
|
+
function num2(value) {
|
|
2602
|
+
return String(Math.round(value * 1e4) / 1e4);
|
|
2603
|
+
}
|
|
2604
|
+
function stopMarkup(stops) {
|
|
2605
|
+
return stops.map(
|
|
2606
|
+
(stop) => `<stop offset="${num2(Math.min(Math.max(stop.position, 0), 100) / 100)}" stop-color="${escapeSvgAttr(
|
|
2607
|
+
stop.color
|
|
2608
|
+
)}"${typeof stop.opacity === "number" ? ` stop-opacity="${num2(stop.opacity)}"` : ""}/>`
|
|
2609
|
+
).join("");
|
|
2610
|
+
}
|
|
2611
|
+
function toCssUrl(svg) {
|
|
2612
|
+
return `url("data:image/svg+xml,${encodeURIComponent(svg).replace(/[()]/gu, (c) => c === "(" ? "%28" : "%29")}")`;
|
|
2613
|
+
}
|
|
2614
|
+
function buildScaledLinearGradientImage(stops, ooxmlAngleDegrees) {
|
|
2615
|
+
const radians = ooxmlAngleDegrees * Math.PI / 180;
|
|
2616
|
+
const dx = Math.cos(radians);
|
|
2617
|
+
const dy = Math.sin(radians);
|
|
2618
|
+
const span = (Math.abs(dx) + Math.abs(dy)) / 2;
|
|
2619
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1" preserveAspectRatio="none"><defs><linearGradient id="g" x1="${num2(0.5 - dx * span)}" y1="${num2(0.5 - dy * span)}" x2="${num2(
|
|
2620
|
+
0.5 + dx * span
|
|
2621
|
+
)}" y2="${num2(0.5 + dy * span)}">${stopMarkup(stops)}</linearGradient></defs><rect width="1" height="1" fill="url(#g)"/></svg>`;
|
|
2622
|
+
return toCssUrl(svg);
|
|
2623
|
+
}
|
|
2624
|
+
function buildFocalCircleGradientImage(stops, fx, fy, width, height) {
|
|
2625
|
+
const radius = Math.hypot(width, height) / 2;
|
|
2626
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${num2(width)} ${num2(height)}" preserveAspectRatio="none"><defs><radialGradient id="g" gradientUnits="userSpaceOnUse" cx="${num2(width / 2)}" cy="${num2(
|
|
2627
|
+
height / 2
|
|
2628
|
+
)}" r="${num2(radius)}" fx="${num2(fx * width)}" fy="${num2(fy * height)}">${stopMarkup(stops)}</radialGradient></defs><rect width="${num2(width)}" height="${num2(height)}" fill="url(#g)"/></svg>`;
|
|
2629
|
+
return toCssUrl(svg);
|
|
2630
|
+
}
|
|
2631
|
+
|
|
166
2632
|
// src/pptx/render/vector-subpath-paint.ts
|
|
167
2633
|
function toHexByte(value) {
|
|
168
2634
|
const clamped = Math.max(0, Math.min(255, Math.round(value)));
|
|
169
2635
|
return clamped.toString(16).padStart(2, "0");
|
|
170
2636
|
}
|
|
171
|
-
function shiftHex(
|
|
172
|
-
const channels = color.hexToRgbChannels(
|
|
2637
|
+
function shiftHex(hex2, factor, towardsWhite) {
|
|
2638
|
+
const channels = color.hexToRgbChannels(hex2);
|
|
173
2639
|
if (!channels) {
|
|
174
|
-
return
|
|
2640
|
+
return hex2;
|
|
175
2641
|
}
|
|
176
2642
|
const shift = (c) => towardsWhite ? c + (255 - c) * factor : c * (1 - factor);
|
|
177
2643
|
return `#${toHexByte(shift(channels.r))}${toHexByte(shift(channels.g))}${toHexByte(shift(channels.b))}`;
|
|
@@ -202,75 +2668,53 @@ function buildSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
202
2668
|
}
|
|
203
2669
|
|
|
204
2670
|
// src/pptx/render/subpath-fill-overlay.ts
|
|
205
|
-
function
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
2671
|
+
function hasReproducibleFillMode(element) {
|
|
2672
|
+
if (!pptx.hasShapeProperties(element)) {
|
|
2673
|
+
return false;
|
|
2674
|
+
}
|
|
2675
|
+
const mode = element.shapeStyle?.fillMode;
|
|
2676
|
+
return mode === void 0 || mode === "solid" || mode === "none";
|
|
210
2677
|
}
|
|
211
|
-
function
|
|
212
|
-
return
|
|
213
|
-
(sp) => sp.fillMode !== void 0 && sp.fillMode !== "norm" || sp.stroke === false
|
|
214
|
-
);
|
|
2678
|
+
function suppressesCssFill(element) {
|
|
2679
|
+
return hasReproducibleFillMode(element) && getSubpathGeometry(element, silhouetteFillsOverlay(element)) !== void 0;
|
|
215
2680
|
}
|
|
216
|
-
function
|
|
217
|
-
|
|
218
|
-
|
|
2681
|
+
function shadeVeil(mode, opacity) {
|
|
2682
|
+
const strength = mode === "lighten" || mode === "darken" ? 0.4 : mode === "lightenLess" || mode === "darkenLess" ? 0.2 : 0;
|
|
2683
|
+
if (strength === 0) {
|
|
2684
|
+
return void 0;
|
|
219
2685
|
}
|
|
220
|
-
|
|
2686
|
+
const channel = mode?.startsWith("lighten") ? 255 : 0;
|
|
2687
|
+
return `rgba(${channel},${channel},${channel},${Math.round(strength * opacity * 1e3) / 1e3})`;
|
|
221
2688
|
}
|
|
222
|
-
function
|
|
223
|
-
|
|
224
|
-
if (!slots) {
|
|
2689
|
+
function buildShadingOverlay(element) {
|
|
2690
|
+
if (!pptx.hasShapeProperties(element)) {
|
|
225
2691
|
return void 0;
|
|
226
2692
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
slots.customGeometryRawData,
|
|
230
|
-
slots.pathWidth,
|
|
231
|
-
slots.pathHeight,
|
|
232
|
-
slots.shapeAdjustments
|
|
233
|
-
) ?? slots.customGeometryPaths;
|
|
234
|
-
if (!structured || structured.length === 0) {
|
|
235
|
-
return void 0;
|
|
236
|
-
}
|
|
237
|
-
const subpaths2 = pptx.customGeometryPathsToSvgSubpaths(
|
|
238
|
-
structured,
|
|
239
|
-
slots.pathWidth,
|
|
240
|
-
slots.pathHeight
|
|
241
|
-
);
|
|
242
|
-
return needsPerSubpathPaint(subpaths2) ? { subpaths: subpaths2, width: slots.pathWidth, height: slots.pathHeight } : void 0;
|
|
243
|
-
}
|
|
244
|
-
if (!slots.shapeType) {
|
|
2693
|
+
const ss = element.shapeStyle;
|
|
2694
|
+
if (ss?.fillMode !== "gradient" && ss?.fillMode !== "pattern" && ss?.fillMode !== "image") {
|
|
245
2695
|
return void 0;
|
|
246
2696
|
}
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
if (!result || result.fillNone || result.paths.length === 0) {
|
|
2697
|
+
const geometry = getSubpathGeometry(element);
|
|
2698
|
+
if (!geometry) {
|
|
250
2699
|
return void 0;
|
|
251
2700
|
}
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
2701
|
+
const opacity = ss.fillOpacity ?? 1;
|
|
2702
|
+
const paints2 = geometry.subpaths.map((subpath) => ({
|
|
2703
|
+
d: subpath.d,
|
|
2704
|
+
fill: shadeVeil(subpath.fillMode, opacity) ?? "none",
|
|
2705
|
+
stroked: subpath.stroke !== false
|
|
256
2706
|
}));
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
function hasReproducibleFillMode(element) {
|
|
260
|
-
if (!pptx.hasShapeProperties(element)) {
|
|
261
|
-
return false;
|
|
2707
|
+
if (paints2.every((paint) => paint.fill === "none")) {
|
|
2708
|
+
return void 0;
|
|
262
2709
|
}
|
|
263
|
-
|
|
264
|
-
return mode === void 0 || mode === "solid" || mode === "none";
|
|
265
|
-
}
|
|
266
|
-
function suppressesCssFill(element) {
|
|
267
|
-
return hasReproducibleFillMode(element) && getSubpathGeometry(element) !== void 0;
|
|
2710
|
+
return { paints: paints2, viewBoxWidth: geometry.width, viewBoxHeight: geometry.height };
|
|
268
2711
|
}
|
|
269
2712
|
function buildSubpathFillOverlay(element) {
|
|
270
2713
|
if (!hasReproducibleFillMode(element)) {
|
|
271
|
-
return
|
|
2714
|
+
return buildShadingOverlay(element);
|
|
272
2715
|
}
|
|
273
|
-
const
|
|
2716
|
+
const silhouette = silhouetteFillsOverlay(element);
|
|
2717
|
+
const geometry = getSubpathGeometry(element, silhouette);
|
|
274
2718
|
if (!geometry) {
|
|
275
2719
|
return void 0;
|
|
276
2720
|
}
|
|
@@ -280,7 +2724,8 @@ function buildSubpathFillOverlay(element) {
|
|
|
280
2724
|
return {
|
|
281
2725
|
paints: buildSubpathPaints(geometry.subpaths, hasFill, fillColor, ss?.fillOpacity),
|
|
282
2726
|
viewBoxWidth: geometry.width,
|
|
283
|
-
viewBoxHeight: geometry.height
|
|
2727
|
+
viewBoxHeight: geometry.height,
|
|
2728
|
+
...silhouette ? { silhouette: true } : {}
|
|
284
2729
|
};
|
|
285
2730
|
}
|
|
286
2731
|
function clampCropValue(value) {
|
|
@@ -336,16 +2781,20 @@ function computeGradientCenter(fillToRect, focalPoint) {
|
|
|
336
2781
|
}
|
|
337
2782
|
return { cx: 50, cy: 50 };
|
|
338
2783
|
}
|
|
339
|
-
function buildCirclePathGradient(stops, focalPoint, fillToRect) {
|
|
2784
|
+
function buildCirclePathGradient(stops, focalPoint, fillToRect, bounds) {
|
|
340
2785
|
const stopStr = stops.map(toCssGradientStop).join(", ");
|
|
341
2786
|
const { cx, cy } = computeGradientCenter(fillToRect, focalPoint);
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
2787
|
+
if (Math.abs(cx - 50) < 0.5 && Math.abs(cy - 50) < 0.5) {
|
|
2788
|
+
return `radial-gradient(circle farthest-corner at 50% 50%, ${stopStr})`;
|
|
2789
|
+
}
|
|
2790
|
+
const { width, height } = bounds ?? {};
|
|
2791
|
+
if (typeof width === "number" && typeof height === "number" && width > 0 && height > 0) {
|
|
2792
|
+
return buildFocalCircleGradientImage(stops, cx / 100, cy / 100, width, height);
|
|
347
2793
|
}
|
|
348
|
-
|
|
2794
|
+
const posX = `${Math.round(cx)}%`;
|
|
2795
|
+
const posY = `${Math.round(cy)}%`;
|
|
2796
|
+
const radius = Math.round(Math.max(cx, 100 - cx, cy, 100 - cy));
|
|
2797
|
+
return `radial-gradient(ellipse ${radius}% ${radius}% at ${posX} ${posY}, ${stopStr})`;
|
|
349
2798
|
}
|
|
350
2799
|
function buildRectPathGradient(stops, focalPoint, fillToRect) {
|
|
351
2800
|
return diagram.buildRectPathGradientImage(stops, focalPoint, fillToRect);
|
|
@@ -447,6 +2896,16 @@ function adjustLinearGradientAngle(angle, gradient, context) {
|
|
|
447
2896
|
}
|
|
448
2897
|
return result;
|
|
449
2898
|
}
|
|
2899
|
+
function isStretchedLinear(gradient, angle, context) {
|
|
2900
|
+
const { width, height } = context ?? {};
|
|
2901
|
+
if (gradient.fillGradientScaled === false || !width || !height) {
|
|
2902
|
+
return false;
|
|
2903
|
+
}
|
|
2904
|
+
if (Math.abs(width - height) < 0.5) {
|
|
2905
|
+
return false;
|
|
2906
|
+
}
|
|
2907
|
+
return Math.abs(angle % 90) > 0.01 && Math.abs(angle % 90 - 90) > 0.01;
|
|
2908
|
+
}
|
|
450
2909
|
function buildGradientCss(gradient, context) {
|
|
451
2910
|
if (!gradient || gradient.fillMode !== "gradient") {
|
|
452
2911
|
return void 0;
|
|
@@ -455,21 +2914,25 @@ function buildGradientCss(gradient, context) {
|
|
|
455
2914
|
if (sanitized.length === 0) {
|
|
456
2915
|
return gradient.fillGradient;
|
|
457
2916
|
}
|
|
458
|
-
const stops = color.
|
|
2917
|
+
const stops = color.officeGradientStops(sanitized);
|
|
459
2918
|
const gradientType = gradient.fillGradientType || "linear";
|
|
460
2919
|
if (gradientType === "radial") {
|
|
461
2920
|
const pathType = gradient.fillGradientPathType || "circle";
|
|
462
2921
|
const fp = gradient.fillGradientFocalPoint;
|
|
463
2922
|
const ftr = gradient.fillGradientFillToRect;
|
|
464
|
-
if (pathType === "rect") {
|
|
2923
|
+
if (pathType === "rect" || pathType === "shape" && context?.rectangular) {
|
|
465
2924
|
return buildRectPathGradient(stops, fp, ftr);
|
|
466
2925
|
}
|
|
467
2926
|
if (pathType === "shape") {
|
|
468
2927
|
return buildShapePathGradient(stops, fp, ftr);
|
|
469
2928
|
}
|
|
470
|
-
return buildCirclePathGradient(stops, fp, ftr);
|
|
2929
|
+
return buildCirclePathGradient(stops, fp, ftr, context);
|
|
471
2930
|
}
|
|
472
2931
|
const normalizedAngle = typeof gradient.fillGradientAngle === "number" && Number.isFinite(gradient.fillGradientAngle) ? gradient.fillGradientAngle : 90;
|
|
2932
|
+
const flipped = gradient.fillGradientFlip && gradient.fillGradientFlip !== "none";
|
|
2933
|
+
if (isStretchedLinear(gradient, normalizedAngle, context) && !flipped && gradient.fillGradientRotWithShape !== false) {
|
|
2934
|
+
return buildScaledLinearGradientImage(stops, normalizedAngle);
|
|
2935
|
+
}
|
|
473
2936
|
const effectiveAngle = convertOoxmlAngleToCss(
|
|
474
2937
|
adjustLinearGradientAngle(normalizedAngle, gradient, context)
|
|
475
2938
|
);
|
|
@@ -839,7 +3302,7 @@ function getComputedFillStyle(element, parentGroupFill) {
|
|
|
839
3302
|
if (!ss) {
|
|
840
3303
|
return {};
|
|
841
3304
|
}
|
|
842
|
-
if (suppressesCssFill(element)) {
|
|
3305
|
+
if (suppressesCssFill(element) || silhouetteFillsLayer(element)) {
|
|
843
3306
|
return { backgroundColor: "transparent" };
|
|
844
3307
|
}
|
|
845
3308
|
if (ss.fillMode === "group") {
|
|
@@ -861,7 +3324,8 @@ function resolveComputedFill(ss, element) {
|
|
|
861
3324
|
const geometry = {
|
|
862
3325
|
rotation: element.rotation,
|
|
863
3326
|
width: element.width,
|
|
864
|
-
height: element.height
|
|
3327
|
+
height: element.height,
|
|
3328
|
+
rectangular: element.type === "shape" && pptx.getShapeType(element.shapeType) === "rect"
|
|
865
3329
|
};
|
|
866
3330
|
const gradient = buildGradientCss(ss, geometry) ?? (ss.fillMode === "gradient" ? ss.fillGradient : void 0);
|
|
867
3331
|
if (gradient) {
|
|
@@ -883,8 +3347,8 @@ function resolveComputedFill(ss, element) {
|
|
|
883
3347
|
backgroundRepeat: tileRect.backgroundRepeat
|
|
884
3348
|
};
|
|
885
3349
|
}
|
|
886
|
-
const
|
|
887
|
-
if (
|
|
3350
|
+
const isSvgImage = gradient.startsWith("url(");
|
|
3351
|
+
if (isSvgImage) {
|
|
888
3352
|
return {
|
|
889
3353
|
backgroundImage: gradient,
|
|
890
3354
|
backgroundSize: "100% 100%",
|
|
@@ -987,36 +3451,9 @@ function getCompoundLineStyle(compoundLine, strokeColor, strokeWidth) {
|
|
|
987
3451
|
borderStyle: "double"
|
|
988
3452
|
};
|
|
989
3453
|
}
|
|
990
|
-
function getSvgStrokeDasharray(dashType, strokeWidth, customDashSegments) {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
}
|
|
994
|
-
const stroke = Math.max(strokeWidth, 1);
|
|
995
|
-
if (dashType === "custom" && customDashSegments && customDashSegments.length > 0) {
|
|
996
|
-
return customDashSegments.flatMap((seg) => [seg.dash / 1e3 * stroke, seg.space / 1e3 * stroke]).join(" ");
|
|
997
|
-
}
|
|
998
|
-
switch (dashType) {
|
|
999
|
-
case "dot":
|
|
1000
|
-
case "sysDot":
|
|
1001
|
-
return `${stroke} ${stroke * 2}`;
|
|
1002
|
-
case "dash":
|
|
1003
|
-
case "sysDash":
|
|
1004
|
-
return `${stroke * 4} ${stroke * 2}`;
|
|
1005
|
-
case "lgDash":
|
|
1006
|
-
return `${stroke * 7} ${stroke * 2.5}`;
|
|
1007
|
-
case "dashDot":
|
|
1008
|
-
case "sysDashDot":
|
|
1009
|
-
return `${stroke * 4} ${stroke * 2} ${stroke} ${stroke * 2}`;
|
|
1010
|
-
case "lgDashDot":
|
|
1011
|
-
return `${stroke * 7} ${stroke * 2.5} ${stroke} ${stroke * 2.5}`;
|
|
1012
|
-
case "lgDashDotDot":
|
|
1013
|
-
case "sysDashDotDot":
|
|
1014
|
-
return `${stroke * 7} ${stroke * 2.5} ${stroke} ${stroke * 2} ${stroke} ${stroke * 2}`;
|
|
1015
|
-
case "custom":
|
|
1016
|
-
return `${stroke * 3} ${stroke * 2}`;
|
|
1017
|
-
default:
|
|
1018
|
-
return void 0;
|
|
1019
|
-
}
|
|
3454
|
+
function getSvgStrokeDasharray(dashType, strokeWidth, customDashSegments, lineCap) {
|
|
3455
|
+
const pattern = dashPatternUnits(dashType, customDashSegments);
|
|
3456
|
+
return pattern ? capCompensatedDashArray(pattern, strokeWidth, lineCap) : void 0;
|
|
1020
3457
|
}
|
|
1021
3458
|
function getElementTransform(element) {
|
|
1022
3459
|
const transforms = [];
|
|
@@ -1086,10 +3523,10 @@ function parseDrawingPercent(value) {
|
|
|
1086
3523
|
}
|
|
1087
3524
|
|
|
1088
3525
|
// src/pptx/render/connector-dash.ts
|
|
1089
|
-
function buildDashArray(dash, strokeWidth, customDashSegments) {
|
|
3526
|
+
function buildDashArray(dash, strokeWidth, customDashSegments, lineCap) {
|
|
1090
3527
|
const segments = customDashSegments && customDashSegments.length > 0 ? customDashSegments.map((seg) => ({ dash: seg.dash, space: seg.space })) : void 0;
|
|
1091
3528
|
const dashType = segments ? "custom" : normalizeStrokeDashType(dash);
|
|
1092
|
-
return getSvgStrokeDasharray(dashType, strokeWidth, segments);
|
|
3529
|
+
return getSvgStrokeDasharray(dashType, strokeWidth, segments, lineCap);
|
|
1093
3530
|
}
|
|
1094
3531
|
|
|
1095
3532
|
// src/pptx/render/chart-legend-swatch.ts
|
|
@@ -1754,7 +4191,7 @@ function shadowMarkup(shapes, shadow) {
|
|
|
1754
4191
|
).join("");
|
|
1755
4192
|
return `<filter id="${id}" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="${r2(blur)}"/></filter><g filter="url(#${id})" opacity="${r2(opacityOf(shadow.transparency))}" transform="translate(${r2(dist * Math.cos(rad))} ${r2(dist * Math.sin(rad))})">${body}</g>`;
|
|
1756
4193
|
}
|
|
1757
|
-
function
|
|
4194
|
+
function glowMarkup2(shapes, glow) {
|
|
1758
4195
|
const id = uid("g");
|
|
1759
4196
|
const radius = ptToPx(glow.radius);
|
|
1760
4197
|
const color = safeColor(glow.color, "#FFFFFF");
|
|
@@ -1778,7 +4215,7 @@ function effectsBehind(shapes, effects) {
|
|
|
1778
4215
|
if (!effects || shapes.length === 0) {
|
|
1779
4216
|
return "";
|
|
1780
4217
|
}
|
|
1781
|
-
return (effects.shadow ? shadowMarkup(shapes, effects.shadow) : "") + (effects.glow && effects.glow.radius > 0 ?
|
|
4218
|
+
return (effects.shadow ? shadowMarkup(shapes, effects.shadow) : "") + (effects.glow && effects.glow.radius > 0 ? glowMarkup2(shapes, effects.glow) : "");
|
|
1782
4219
|
}
|
|
1783
4220
|
function paintedShapes(shapes, paint, softEdge) {
|
|
1784
4221
|
const inner = shapes.map(paint).join("");
|
|
@@ -2009,9 +4446,9 @@ function needsLineDecoration(line2) {
|
|
|
2009
4446
|
function arrowHead(type, tip, ux, uy, width, paint) {
|
|
2010
4447
|
const length = Math.max(6, width * 3);
|
|
2011
4448
|
const half = Math.max(3, width * 1.5);
|
|
2012
|
-
const
|
|
4449
|
+
const px2 = -uy;
|
|
2013
4450
|
const py = ux;
|
|
2014
|
-
const at = (along, across) => `${r23(tip.x + ux * along +
|
|
4451
|
+
const at = (along, across) => `${r23(tip.x + ux * along + px2 * across)},${r23(tip.y + uy * along + py * across)}`;
|
|
2015
4452
|
switch (type) {
|
|
2016
4453
|
case "triangle":
|
|
2017
4454
|
return `<polygon points="${at(0, 0)} ${at(-length, half)} ${at(-length, -half)}" fill="${paint}"/>`;
|
|
@@ -3217,8 +5654,8 @@ function ribbonExtrusion(prims, depth) {
|
|
|
3217
5654
|
}
|
|
3218
5655
|
function shiftPoints(points, dx, dy) {
|
|
3219
5656
|
return points.trim().split(/\s+/u).map((pair) => {
|
|
3220
|
-
const [
|
|
3221
|
-
return `${
|
|
5657
|
+
const [px2, py] = pair.split(",").map(Number);
|
|
5658
|
+
return `${px2 + dx},${py + dy}`;
|
|
3222
5659
|
}).join(" ");
|
|
3223
5660
|
}
|
|
3224
5661
|
function applyChart3DDepth(vm, chartType, view3D, surfaces, grouping, pieCenter, picture) {
|
|
@@ -3326,16 +5763,16 @@ var DISPLAY_UNIT_LABELS = {
|
|
|
3326
5763
|
billions: "Billions",
|
|
3327
5764
|
trillions: "Trillions"
|
|
3328
5765
|
};
|
|
3329
|
-
function getDisplayUnitDivisor(
|
|
3330
|
-
if (!
|
|
5766
|
+
function getDisplayUnitDivisor(unit2, customValue) {
|
|
5767
|
+
if (!unit2) {
|
|
3331
5768
|
return 1;
|
|
3332
5769
|
}
|
|
3333
|
-
if (
|
|
5770
|
+
if (unit2 === "custom" && customValue) {
|
|
3334
5771
|
return customValue;
|
|
3335
5772
|
}
|
|
3336
|
-
return DISPLAY_UNIT_DIVISORS[
|
|
5773
|
+
return DISPLAY_UNIT_DIVISORS[unit2] ?? 1;
|
|
3337
5774
|
}
|
|
3338
|
-
function getDisplayUnitLabel(
|
|
5775
|
+
function getDisplayUnitLabel(unit2, customLabel) {
|
|
3339
5776
|
if (typeof customLabel === "string") {
|
|
3340
5777
|
return customLabel;
|
|
3341
5778
|
}
|
|
@@ -3345,10 +5782,10 @@ function getDisplayUnitLabel(unit, customLabel) {
|
|
|
3345
5782
|
if (customLabel?.text) {
|
|
3346
5783
|
return customLabel.text;
|
|
3347
5784
|
}
|
|
3348
|
-
if (!
|
|
5785
|
+
if (!unit2 || unit2 === "custom") {
|
|
3349
5786
|
return "";
|
|
3350
5787
|
}
|
|
3351
|
-
return DISPLAY_UNIT_LABELS[
|
|
5788
|
+
return DISPLAY_UNIT_LABELS[unit2] ?? "";
|
|
3352
5789
|
}
|
|
3353
5790
|
function formatAxisValueWithUnits(value, axis) {
|
|
3354
5791
|
if (!axis?.displayUnits) {
|
|
@@ -3594,9 +6031,9 @@ function resolveMarkerLabelPlacement(chartData, series, pointIndex, point, frame
|
|
|
3594
6031
|
}
|
|
3595
6032
|
|
|
3596
6033
|
// src/pptx/render/chart-label-measure.ts
|
|
3597
|
-
var
|
|
3598
|
-
var DATA_LABEL_PAD_X = 3 *
|
|
3599
|
-
var DATA_LABEL_PAD_Y = 1.5 *
|
|
6034
|
+
var PX_PER_PT2 = 4 / 3;
|
|
6035
|
+
var DATA_LABEL_PAD_X = 3 * PX_PER_PT2;
|
|
6036
|
+
var DATA_LABEL_PAD_Y = 1.5 * PX_PER_PT2;
|
|
3600
6037
|
var DATA_LABEL_LINE_HEIGHT = 1.2207;
|
|
3601
6038
|
var ASCENT = 0.952;
|
|
3602
6039
|
var injected;
|
|
@@ -3670,7 +6107,7 @@ function calloutPoints(box, target) {
|
|
|
3670
6107
|
[x, y + h]
|
|
3671
6108
|
];
|
|
3672
6109
|
if (!target) {
|
|
3673
|
-
return corners.map(([
|
|
6110
|
+
return corners.map(([px2, py]) => `${r25(px2)},${r25(py)}`).join(" ");
|
|
3674
6111
|
}
|
|
3675
6112
|
const below = target.y > y + h;
|
|
3676
6113
|
const above = target.y < y;
|
|
@@ -3719,7 +6156,7 @@ function calloutPoints(box, target) {
|
|
|
3719
6156
|
[x, cy - base / 4]
|
|
3720
6157
|
);
|
|
3721
6158
|
}
|
|
3722
|
-
return pts.map(([
|
|
6159
|
+
return pts.map(([px2, py]) => `${r25(px2)},${r25(py)}`).join(" ");
|
|
3723
6160
|
}
|
|
3724
6161
|
function calloutLabelLift(chartData, series, fontSize, moved) {
|
|
3725
6162
|
const opts = series.dataLabelOptions ?? chartData.style?.dataLabels;
|
|
@@ -5615,12 +8052,12 @@ function buildDateAxisPlan(chartData, layout, selectedAxis, axisY) {
|
|
|
5615
8052
|
const x = serialToX(value, min, max, layout);
|
|
5616
8053
|
return axis.orientation === "maxMin" ? layout.plotLeft + layout.plotWidth - (x - layout.plotLeft) : x;
|
|
5617
8054
|
});
|
|
5618
|
-
const
|
|
8055
|
+
const unit2 = axis.majorTimeUnit ?? axis.baseTimeUnit ?? "days";
|
|
5619
8056
|
const ticks = chart.calendarTicks(
|
|
5620
8057
|
min,
|
|
5621
8058
|
max,
|
|
5622
8059
|
dates.date1904 ?? false,
|
|
5623
|
-
|
|
8060
|
+
unit2,
|
|
5624
8061
|
Math.max(1, axis.majorUnit ?? 1)
|
|
5625
8062
|
);
|
|
5626
8063
|
const y = axisY ?? (axis.axPos === "t" ? layout.plotTop : layout.plotBottom);
|
|
@@ -5643,7 +8080,7 @@ function buildDateAxisPlan(chartData, layout, selectedAxis, axisY) {
|
|
|
5643
8080
|
y: labelsAbove ? labelY - offset : labelY + offset,
|
|
5644
8081
|
text: chart.formatDate(
|
|
5645
8082
|
chart.excelSerialToDate(serial5, dates.date1904),
|
|
5646
|
-
|
|
8083
|
+
unit2,
|
|
5647
8084
|
axis.numFmt?.formatCode ?? dates.formatCode
|
|
5648
8085
|
),
|
|
5649
8086
|
...chartAxisTextStyle(axis),
|
|
@@ -5674,7 +8111,7 @@ function buildDateAxisPlan(chartData, layout, selectedAxis, axisY) {
|
|
|
5674
8111
|
});
|
|
5675
8112
|
}
|
|
5676
8113
|
if (!axis.deleted && axis.minorTickMark && axis.minorTickMark !== "none") {
|
|
5677
|
-
const minorUnit = axis.minorTimeUnit ?? axis.baseTimeUnit ??
|
|
8114
|
+
const minorUnit = axis.minorTimeUnit ?? axis.baseTimeUnit ?? unit2;
|
|
5678
8115
|
for (const serial5 of chart.calendarTicks(
|
|
5679
8116
|
min,
|
|
5680
8117
|
max,
|
|
@@ -5825,25 +8262,25 @@ function wrapTextByEstimatedWidth(text, maxWidth, fontSize, options = {}) {
|
|
|
5825
8262
|
}
|
|
5826
8263
|
let current = "";
|
|
5827
8264
|
let pendingWhitespace = false;
|
|
5828
|
-
for (const
|
|
5829
|
-
if (/^\s+$/u.test(
|
|
8265
|
+
for (const unit2 of estimatedWrapUnits(paragraph)) {
|
|
8266
|
+
if (/^\s+$/u.test(unit2)) {
|
|
5830
8267
|
pendingWhitespace = current.length > 0;
|
|
5831
8268
|
continue;
|
|
5832
8269
|
}
|
|
5833
8270
|
const separator = pendingWhitespace && current.length > 0 ? " " : "";
|
|
5834
|
-
const candidate = `${current}${separator}${
|
|
8271
|
+
const candidate = `${current}${separator}${unit2}`;
|
|
5835
8272
|
if (current.length === 0 || estimatedTextWidth(Array.from(candidate), fontSize) <= maxWidth) {
|
|
5836
8273
|
current = candidate;
|
|
5837
8274
|
pendingWhitespace = false;
|
|
5838
8275
|
continue;
|
|
5839
8276
|
}
|
|
5840
|
-
if (HANGING_PUNCTUATION_RE.test(
|
|
5841
|
-
current +=
|
|
8277
|
+
if (HANGING_PUNCTUATION_RE.test(unit2)) {
|
|
8278
|
+
current += unit2;
|
|
5842
8279
|
pendingWhitespace = false;
|
|
5843
8280
|
continue;
|
|
5844
8281
|
}
|
|
5845
8282
|
lines.push(current);
|
|
5846
|
-
current =
|
|
8283
|
+
current = unit2;
|
|
5847
8284
|
pendingWhitespace = false;
|
|
5848
8285
|
}
|
|
5849
8286
|
const completed = current.trimEnd();
|
|
@@ -7318,22 +9755,22 @@ function applyParetoConversion(data) {
|
|
|
7318
9755
|
]
|
|
7319
9756
|
};
|
|
7320
9757
|
}
|
|
7321
|
-
function orderParetoEntries(
|
|
7322
|
-
return [...
|
|
9758
|
+
function orderParetoEntries(entries2) {
|
|
9759
|
+
return [...entries2].sort(
|
|
7323
9760
|
(left, right) => Math.max(right.value, 0) - Math.max(left.value, 0) || left.sourcePointIndex - right.sourcePointIndex
|
|
7324
9761
|
);
|
|
7325
9762
|
}
|
|
7326
|
-
function buildParetoPrimitives(
|
|
7327
|
-
const total =
|
|
9763
|
+
function buildParetoPrimitives(entries2, layout, series, seriesIndex) {
|
|
9764
|
+
const total = entries2.reduce((sum, entry) => sum + Math.max(entry.value, 0), 0);
|
|
7328
9765
|
if (total <= 0) {
|
|
7329
9766
|
return [];
|
|
7330
9767
|
}
|
|
7331
9768
|
let cumulative = 0;
|
|
7332
|
-
const points =
|
|
9769
|
+
const points = entries2.map((entry, displayIndex) => {
|
|
7333
9770
|
cumulative += Math.max(entry.value, 0);
|
|
7334
|
-
const percentage = displayIndex ===
|
|
9771
|
+
const percentage = displayIndex === entries2.length - 1 ? 100 : cumulative / total * 100;
|
|
7335
9772
|
return {
|
|
7336
|
-
x: layout.plotLeft + layout.plotWidth * (displayIndex + 0.5) /
|
|
9773
|
+
x: layout.plotLeft + layout.plotWidth * (displayIndex + 0.5) / entries2.length,
|
|
7337
9774
|
y: layout.plotBottom - layout.plotHeight * percentage / 100,
|
|
7338
9775
|
pointIndex: entry.sourcePointIndex
|
|
7339
9776
|
};
|
|
@@ -7419,9 +9856,9 @@ function buildHistogramViewModel(element, chartData, categoryLabels) {
|
|
|
7419
9856
|
value,
|
|
7420
9857
|
label: categoryLabels[index] ?? ""
|
|
7421
9858
|
}))).map((entry, sourcePointIndex) => ({ ...entry, sourcePointIndex }));
|
|
7422
|
-
const
|
|
7423
|
-
const values =
|
|
7424
|
-
const labels =
|
|
9859
|
+
const entries2 = paretoIndex >= 0 ? orderParetoEntries(baseEntries) : baseEntries;
|
|
9860
|
+
const values = entries2.map((entry) => entry.value);
|
|
9861
|
+
const labels = entries2.map((entry) => entry.label);
|
|
7425
9862
|
const range = distributionRange([{ name: series?.name ?? "", values }]);
|
|
7426
9863
|
const bars = computeHistogramBars(
|
|
7427
9864
|
values,
|
|
@@ -7444,14 +9881,14 @@ function buildHistogramViewModel(element, chartData, categoryLabels) {
|
|
|
7444
9881
|
part: {
|
|
7445
9882
|
role: "dataPoint",
|
|
7446
9883
|
seriesIndex: histogramIndex,
|
|
7447
|
-
pointIndex:
|
|
9884
|
+
pointIndex: entries2[displayIndex]?.sourcePointIndex ?? displayIndex
|
|
7448
9885
|
}
|
|
7449
9886
|
}
|
|
7450
9887
|
})
|
|
7451
9888
|
);
|
|
7452
9889
|
if (paretoIndex >= 0) {
|
|
7453
9890
|
primitives.push(
|
|
7454
|
-
...buildParetoPrimitives(
|
|
9891
|
+
...buildParetoPrimitives(entries2, layout, chartData.series[paretoIndex], paretoIndex)
|
|
7455
9892
|
);
|
|
7456
9893
|
}
|
|
7457
9894
|
const dataLabels = chartData.style?.hasDataLabels ? bars.map((bar, index) => ({
|
|
@@ -7466,7 +9903,7 @@ function buildHistogramViewModel(element, chartData, categoryLabels) {
|
|
|
7466
9903
|
resolveDataLabelTextStyle(
|
|
7467
9904
|
chartData,
|
|
7468
9905
|
series,
|
|
7469
|
-
|
|
9906
|
+
entries2[index]?.sourcePointIndex ?? index
|
|
7470
9907
|
)
|
|
7471
9908
|
) : {}
|
|
7472
9909
|
})) : [];
|
|
@@ -7826,11 +10263,11 @@ function splitLabelLines(label) {
|
|
|
7826
10263
|
}
|
|
7827
10264
|
|
|
7828
10265
|
// src/pptx/render/chart-legend-entries.ts
|
|
7829
|
-
function applyLegendEntryOverrides(legend,
|
|
7830
|
-
if ((!
|
|
10266
|
+
function applyLegendEntryOverrides(legend, entries2, defaultTextStyle) {
|
|
10267
|
+
if ((!entries2 || entries2.length === 0) && !defaultTextStyle) {
|
|
7831
10268
|
return legend;
|
|
7832
10269
|
}
|
|
7833
|
-
const byIndex = new Map((
|
|
10270
|
+
const byIndex = new Map((entries2 ?? []).map((entry) => [entry.index, entry]));
|
|
7834
10271
|
const result = [];
|
|
7835
10272
|
legend.forEach((item, index) => {
|
|
7836
10273
|
const override = byIndex.get(index);
|
|
@@ -8082,11 +10519,11 @@ var AXIS_LABEL_COLOR = "#64748b";
|
|
|
8082
10519
|
var ZERO_LINE_COLOR = "#94a3b8";
|
|
8083
10520
|
var TICK_COUNT3 = 5;
|
|
8084
10521
|
function axisTickValues(range) {
|
|
8085
|
-
const
|
|
8086
|
-
if (
|
|
8087
|
-
const steps = Math.round((range.max - range.min) /
|
|
10522
|
+
const unit2 = range.majorUnit;
|
|
10523
|
+
if (unit2 !== void 0 && Number.isFinite(unit2) && unit2 > 0 && !range.logScale) {
|
|
10524
|
+
const steps = Math.round((range.max - range.min) / unit2);
|
|
8088
10525
|
if (steps >= 1 && steps <= 100) {
|
|
8089
|
-
return Array.from({ length: steps + 1 }, (_unused, index) => range.min +
|
|
10526
|
+
return Array.from({ length: steps + 1 }, (_unused, index) => range.min + unit2 * index);
|
|
8090
10527
|
}
|
|
8091
10528
|
}
|
|
8092
10529
|
return Array.from(
|
|
@@ -9097,19 +11534,19 @@ function seriesXValues(chartData, series) {
|
|
|
9097
11534
|
return fromCategories.length > 0 ? fromCategories : void 0;
|
|
9098
11535
|
}
|
|
9099
11536
|
function computeScatterXDomain(perSeriesXValues) {
|
|
9100
|
-
const
|
|
11537
|
+
const finite2 = [];
|
|
9101
11538
|
for (const values of perSeriesXValues) {
|
|
9102
11539
|
for (const value of values ?? []) {
|
|
9103
11540
|
if (Number.isFinite(value)) {
|
|
9104
|
-
|
|
11541
|
+
finite2.push(value);
|
|
9105
11542
|
}
|
|
9106
11543
|
}
|
|
9107
11544
|
}
|
|
9108
|
-
if (
|
|
11545
|
+
if (finite2.length === 0) {
|
|
9109
11546
|
return void 0;
|
|
9110
11547
|
}
|
|
9111
|
-
const min = Math.min(...
|
|
9112
|
-
return { min, span: Math.max(Math.max(...
|
|
11548
|
+
const min = Math.min(...finite2);
|
|
11549
|
+
return { min, span: Math.max(Math.max(...finite2) - min, 1) };
|
|
9113
11550
|
}
|
|
9114
11551
|
function computeScatterDots(values, maxXIndex, layout, range, xValues, xDomain) {
|
|
9115
11552
|
const finiteX = xValues?.slice(0, values.length).filter(Number.isFinite), minX = xDomain ? xDomain.min : finiteX?.length ? Math.min(...finiteX) : 0, spanX = xDomain ? xDomain.span : finiteX?.length ? Math.max(Math.max(...finiteX) - minX, 1) : maxXIndex;
|
|
@@ -9644,8 +12081,8 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
|
|
|
9644
12081
|
const resolve2 = (label) => regions.find(
|
|
9645
12082
|
(r) => r.entityId === label || r.code === label || r.name.toLowerCase() === label.toLowerCase()
|
|
9646
12083
|
)?.code ?? regionMap.resolveRegionCode(label);
|
|
9647
|
-
const
|
|
9648
|
-
const values =
|
|
12084
|
+
const entries2 = regionMap.buildRegionMapEntries(categories, series?.values ?? [], options, resolve2);
|
|
12085
|
+
const values = entries2.map((entry) => entry.value);
|
|
9649
12086
|
const finiteVals = values.filter((v) => Number.isFinite(v));
|
|
9650
12087
|
const minVal = finiteVals.length > 0 ? Math.min(...finiteVals) : 0;
|
|
9651
12088
|
const maxVal = finiteVals.length > 0 ? Math.max(...finiteVals) : 1;
|
|
@@ -9658,7 +12095,7 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
|
|
|
9658
12095
|
const colorScale = valueColorStops ? regionMap.buildValueColorScale(valueColorStops) : (t) => regionMap.sequentialColorScale(t, series?.color ?? "#4472C4");
|
|
9659
12096
|
const regionValueMap = /* @__PURE__ */ new Map();
|
|
9660
12097
|
const unmatchedRows = [];
|
|
9661
|
-
for (const entry of
|
|
12098
|
+
for (const entry of entries2) {
|
|
9662
12099
|
if (entry.code !== void 0) {
|
|
9663
12100
|
regionValueMap.set(entry.code, {
|
|
9664
12101
|
value: entry.value,
|
|
@@ -10432,10 +12869,18 @@ Object.defineProperty(exports, "hexToRgbChannels", {
|
|
|
10432
12869
|
enumerable: true,
|
|
10433
12870
|
get: function () { return color.hexToRgbChannels; }
|
|
10434
12871
|
});
|
|
12872
|
+
Object.defineProperty(exports, "hexToRgbUnit", {
|
|
12873
|
+
enumerable: true,
|
|
12874
|
+
get: function () { return color.hexToRgbUnit; }
|
|
12875
|
+
});
|
|
10435
12876
|
Object.defineProperty(exports, "normalizeHexColor", {
|
|
10436
12877
|
enumerable: true,
|
|
10437
12878
|
get: function () { return color.normalizeHexColor; }
|
|
10438
12879
|
});
|
|
12880
|
+
Object.defineProperty(exports, "buildRectPathGradientExactSvg", {
|
|
12881
|
+
enumerable: true,
|
|
12882
|
+
get: function () { return diagram.buildRectPathGradientExactSvg; }
|
|
12883
|
+
});
|
|
10439
12884
|
Object.defineProperty(exports, "buildRectPathGradientImage", {
|
|
10440
12885
|
enumerable: true,
|
|
10441
12886
|
get: function () { return diagram.buildRectPathGradientImage; }
|
|
@@ -10501,9 +12946,11 @@ exports.HYPERLINK_COLOR = HYPERLINK_COLOR;
|
|
|
10501
12946
|
exports.LEGACY_CHART_TITLE_BAND_PX = LEGACY_CHART_TITLE_BAND_PX;
|
|
10502
12947
|
exports.LEGEND_LINE_SWATCH_WIDTH = LEGEND_LINE_SWATCH_WIDTH;
|
|
10503
12948
|
exports.LEGEND_MARKER_RADIUS = LEGEND_MARKER_RADIUS;
|
|
12949
|
+
exports.MORPH_PROGRESS_VAR = MORPH_PROGRESS_VAR;
|
|
10504
12950
|
exports.OOXML_PATTERN_PRESETS = OOXML_PATTERN_PRESETS;
|
|
10505
12951
|
exports.PIE_AUTO_INSET_PX = PIE_AUTO_INSET_PX;
|
|
10506
12952
|
exports.TEXT_ORIENTATION_IDENTITY = TEXT_ORIENTATION_IDENTITY;
|
|
12953
|
+
exports.TEXT_SHADOW_BLUR_TO_CSS = TEXT_SHADOW_BLUR_TO_CSS;
|
|
10507
12954
|
exports.ZERO_LINE_COLOR = ZERO_LINE_COLOR;
|
|
10508
12955
|
exports.adjustFillForMode = adjustFillForMode;
|
|
10509
12956
|
exports.applyDataPointPictureFills = applyDataPointPictureFills;
|
|
@@ -10518,16 +12965,23 @@ exports.buildChartViewModel = buildChartViewModel;
|
|
|
10518
12965
|
exports.buildCirclePathGradient = buildCirclePathGradient;
|
|
10519
12966
|
exports.buildComboViewModel = buildComboViewModel;
|
|
10520
12967
|
exports.buildCssGradientFromShapeStyle = buildCssGradientFromShapeStyle;
|
|
12968
|
+
exports.buildCustomGeometryClipPath = buildCustomGeometryClipPath;
|
|
12969
|
+
exports.buildCustomPathMarkers = buildCustomPathMarkers;
|
|
10521
12970
|
exports.buildDashArray = buildDashArray;
|
|
10522
12971
|
exports.buildDataLabelText = buildDataLabelText;
|
|
10523
12972
|
exports.buildFallbackViewModel = buildFallbackViewModel;
|
|
10524
12973
|
exports.buildFunnelViewModel = buildFunnelViewModel;
|
|
12974
|
+
exports.buildGlowBoxShadow = buildGlowBoxShadow;
|
|
10525
12975
|
exports.buildGradientCss = buildGradientCss;
|
|
10526
12976
|
exports.buildGridlinesAndLabels = buildGridlinesAndLabels;
|
|
10527
12977
|
exports.buildHistogramViewModel = buildHistogramViewModel;
|
|
12978
|
+
exports.buildInnerShadowCssFromShapeStyle = buildInnerShadowCssFromShapeStyle;
|
|
10528
12979
|
exports.buildLegend = buildLegend;
|
|
12980
|
+
exports.buildLineGlowFilter = buildLineGlowFilter;
|
|
10529
12981
|
exports.buildLineLegendSwatch = buildLineLegendSwatch;
|
|
12982
|
+
exports.buildLineShadowCss = buildLineShadowCss;
|
|
10530
12983
|
exports.buildMarkTooltip = buildMarkTooltip;
|
|
12984
|
+
exports.buildMultiLayerShadowCss = buildMultiLayerShadowCss;
|
|
10531
12985
|
exports.buildPatternFill = buildPatternFill;
|
|
10532
12986
|
exports.buildPatternFillCss = buildPatternFillCss;
|
|
10533
12987
|
exports.buildPieViewModel = buildPieViewModel;
|
|
@@ -10537,19 +12991,26 @@ exports.buildRectPathGradient = buildRectPathGradient;
|
|
|
10537
12991
|
exports.buildReflectedGradientStops = buildReflectedGradientStops;
|
|
10538
12992
|
exports.buildRegionMapViewModel = buildRegionMapViewModel;
|
|
10539
12993
|
exports.buildSecondaryAxis = buildSecondaryAxis;
|
|
12994
|
+
exports.buildShadowCssFromShapeStyle = buildShadowCssFromShapeStyle;
|
|
10540
12995
|
exports.buildShapePathGradient = buildShapePathGradient;
|
|
12996
|
+
exports.buildSilhouetteFilterMarkup = buildSilhouetteFilterMarkup;
|
|
10541
12997
|
exports.buildStockCloseLabel = buildStockCloseLabel;
|
|
10542
12998
|
exports.buildStockViewModel = buildStockViewModel;
|
|
12999
|
+
exports.buildStrokeOutline = buildStrokeOutline;
|
|
10543
13000
|
exports.buildSubpathFillOverlay = buildSubpathFillOverlay;
|
|
10544
13001
|
exports.buildSubpathPaints = buildSubpathPaints;
|
|
10545
13002
|
exports.buildSunburstViewModel = buildSunburstViewModel;
|
|
10546
13003
|
exports.buildSurfaceViewModel = buildSurfaceViewModel;
|
|
13004
|
+
exports.buildSvgGradientDef = buildSvgGradientDef;
|
|
13005
|
+
exports.buildSvgStrokeGradientDef = buildSvgStrokeGradientDef;
|
|
13006
|
+
exports.buildSvgStrokePatternDef = buildSvgStrokePatternDef;
|
|
10547
13007
|
exports.buildTreemapViewModel = buildTreemapViewModel;
|
|
10548
13008
|
exports.buildTrendlineLegendSwatch = buildTrendlineLegendSwatch;
|
|
10549
13009
|
exports.buildValueAxisGridlinesAndLabels = buildValueAxisGridlinesAndLabels;
|
|
10550
13010
|
exports.buildWaterfallViewModel = buildWaterfallViewModel;
|
|
10551
13011
|
exports.buildZeroLine = buildZeroLine;
|
|
10552
13012
|
exports.canvasFontFamily = canvasFontFamily;
|
|
13013
|
+
exports.capCompensatedDashArray = capCompensatedDashArray;
|
|
10553
13014
|
exports.chartAreaCornerRadius = chartAreaCornerRadius;
|
|
10554
13015
|
exports.chartAreaFill = chartAreaFill;
|
|
10555
13016
|
exports.chartAxisIndex = chartAxisIndex;
|
|
@@ -10569,6 +13030,7 @@ exports.clampCropValue = clampCropValue;
|
|
|
10569
13030
|
exports.clearBarFacePicturePixelCache = clearBarFacePicturePixelCache;
|
|
10570
13031
|
exports.clipStackedSegment = clipStackedSegment;
|
|
10571
13032
|
exports.collapseChartTitleRunsForEdit = collapseChartTitleRunsForEdit;
|
|
13033
|
+
exports.compoundStrandPath = compoundStrandPath;
|
|
10572
13034
|
exports.computeAxisTitlePrimitives = computeAxisTitlePrimitives;
|
|
10573
13035
|
exports.computeBarRects = computeBarRects;
|
|
10574
13036
|
exports.computeBoxWhiskerGeometry = computeBoxWhiskerGeometry;
|
|
@@ -10596,67 +13058,130 @@ exports.computeSunburstArcs = computeSunburstArcs;
|
|
|
10596
13058
|
exports.computeTrendlinePrimitives = computeTrendlinePrimitives;
|
|
10597
13059
|
exports.computeValueRange = computeValueRange;
|
|
10598
13060
|
exports.computeValueRange2 = computeValueRange2;
|
|
13061
|
+
exports.connectorKind = connectorKind;
|
|
13062
|
+
exports.connectorNeedsPath = connectorNeedsPath;
|
|
13063
|
+
exports.connectorStrandScreenWidth = connectorStrandScreenWidth;
|
|
10599
13064
|
exports.convertOoxmlAngleToCss = convertOoxmlAngleToCss;
|
|
10600
13065
|
exports.createArrayBufferCopy = createArrayBufferCopy;
|
|
10601
13066
|
exports.cumulativePercentOfTotal = cumulativePercentOfTotal;
|
|
13067
|
+
exports.dashPatternUnits = dashPatternUnits;
|
|
13068
|
+
exports.dashPenWidth = dashPenWidth;
|
|
13069
|
+
exports.dashStartPathData = dashStartPathData;
|
|
10602
13070
|
exports.dataLabelBox = dataLabelBox;
|
|
10603
13071
|
exports.dataLabelBoxSize = dataLabelBoxSize;
|
|
10604
13072
|
exports.dataLabelFontOverride = dataLabelFontOverride;
|
|
10605
13073
|
exports.decodeFirstPixelColor = decodeFirstPixelColor;
|
|
10606
13074
|
exports.ensureBarFacePicturePixelSampled = ensureBarFacePicturePixelSampled;
|
|
13075
|
+
exports.escapeSvgAttr = escapeSvgAttr;
|
|
10607
13076
|
exports.estimateChartTextWidth = estimateChartTextWidth;
|
|
10608
13077
|
exports.estimateTextWidth = estimateTextWidth;
|
|
10609
13078
|
exports.findDataPoint = findDataPoint;
|
|
10610
13079
|
exports.findPointLabel = findPointLabel;
|
|
10611
13080
|
exports.findValueAxis = findValueAxis;
|
|
10612
13081
|
exports.fitTitleBand = fitTitleBand;
|
|
13082
|
+
exports.flattenPath = flattenPath;
|
|
10613
13083
|
exports.formatAxisValue = formatAxisValue;
|
|
10614
13084
|
exports.formatAxisValue2 = formatAxisValue2;
|
|
10615
13085
|
exports.formatAxisValueWithUnits = formatAxisValueWithUnits;
|
|
10616
13086
|
exports.getBarFacePicturePixelSampleVersion = getBarFacePicturePixelSampleVersion;
|
|
13087
|
+
exports.getBoxShadowCss = getBoxShadowCss;
|
|
10617
13088
|
exports.getCachedBarFacePicturePixelColor = getCachedBarFacePicturePixelColor;
|
|
13089
|
+
exports.getCompositeOuterShadowFilterCss = getCompositeOuterShadowFilterCss;
|
|
10618
13090
|
exports.getCompoundLineBorderWidth = getCompoundLineBorderWidth;
|
|
10619
13091
|
exports.getCompoundLineBoxShadow = getCompoundLineBoxShadow;
|
|
13092
|
+
exports.getCompoundLineOffsets = getCompoundLineOffsets;
|
|
10620
13093
|
exports.getCompoundLineStyle = getCompoundLineStyle;
|
|
13094
|
+
exports.getCompoundLineWidths = getCompoundLineWidths;
|
|
13095
|
+
exports.getComputedEffectStyle = getComputedEffectStyle;
|
|
10621
13096
|
exports.getComputedFillStyle = getComputedFillStyle;
|
|
13097
|
+
exports.getComputedStrokeStyle = getComputedStrokeStyle;
|
|
10622
13098
|
exports.getCssBorderDashStyle = getCssBorderDashStyle;
|
|
10623
13099
|
exports.getDisplayUnitDivisor = getDisplayUnitDivisor;
|
|
10624
13100
|
exports.getDisplayUnitLabel = getDisplayUnitLabel;
|
|
13101
|
+
exports.getDuotoneFilterId = getDuotoneFilterId;
|
|
13102
|
+
exports.getDuotoneSvgFilter = getDuotoneSvgFilter;
|
|
13103
|
+
exports.getDuotoneSvgFilterMarkup = getDuotoneSvgFilterMarkup;
|
|
13104
|
+
exports.getEffectDagBlendMode = getEffectDagBlendMode;
|
|
13105
|
+
exports.getEffectDagCssFilter = getEffectDagCssFilter;
|
|
13106
|
+
exports.getEffectDagFillOverlay = getEffectDagFillOverlay;
|
|
13107
|
+
exports.getEffectDagFilter = getEffectDagFilter;
|
|
13108
|
+
exports.getEffectDagOpacity = getEffectDagOpacity;
|
|
13109
|
+
exports.getEffectFilterCss = getEffectFilterCss;
|
|
13110
|
+
exports.getEffectStyleSource = getEffectStyleSource;
|
|
10625
13111
|
exports.getElementOrientationMatrix = getElementOrientationMatrix;
|
|
10626
13112
|
exports.getElementTransform = getElementTransform;
|
|
10627
13113
|
exports.getElementTransformWithoutRotation = getElementTransformWithoutRotation;
|
|
13114
|
+
exports.getGlowBoxShadowCss = getGlowBoxShadowCss;
|
|
10628
13115
|
exports.getGradientTileFlipCss = getGradientTileFlipCss;
|
|
10629
13116
|
exports.getGradientTileRectCss = getGradientTileRectCss;
|
|
13117
|
+
exports.getInnerShadowCss = getInnerShadowCss;
|
|
13118
|
+
exports.getLineGlowFilterCss = getLineGlowFilterCss;
|
|
13119
|
+
exports.getLineShadowCss = getLineShadowCss;
|
|
13120
|
+
exports.getLineShadowParams = getLineShadowParams;
|
|
13121
|
+
exports.getMultiLayerShadowCss = getMultiLayerShadowCss;
|
|
13122
|
+
exports.getOuterShadowCss = getOuterShadowCss;
|
|
10630
13123
|
exports.getPatternSvg = getPatternSvg;
|
|
10631
13124
|
exports.getPatternTile = getPatternTile;
|
|
10632
13125
|
exports.getPptxRenderCacheEpoch = getPptxRenderCacheEpoch;
|
|
13126
|
+
exports.getPresetShapeVectorGeometry = getPresetShapeVectorGeometry;
|
|
10633
13127
|
exports.getPrimaryValueAxis = getPrimaryValueAxis;
|
|
10634
13128
|
exports.getPrimaryValueAxisId = getPrimaryValueAxisId;
|
|
13129
|
+
exports.getReflectionWrapperStyle = getReflectionWrapperStyle;
|
|
13130
|
+
exports.getResolvedShapeClipPath = getResolvedShapeClipPath;
|
|
13131
|
+
exports.getResolvedShapeClipPathFor = getResolvedShapeClipPathFor;
|
|
10635
13132
|
exports.getSecondaryCategoryAxis = getSecondaryCategoryAxis;
|
|
10636
13133
|
exports.getSecondaryValueAxis = getSecondaryValueAxis;
|
|
10637
13134
|
exports.getSecondaryValueAxisId = getSecondaryValueAxisId;
|
|
13135
|
+
exports.getShapeEffectFilterDefs = getShapeEffectFilterDefs;
|
|
13136
|
+
exports.getShapeFillOverlay = getShapeFillOverlay;
|
|
13137
|
+
exports.getSilhouetteEffectParams = getSilhouetteEffectParams;
|
|
13138
|
+
exports.getSilhouetteEffects = getSilhouetteEffects;
|
|
13139
|
+
exports.getSilhouetteFilterId = getSilhouetteFilterId;
|
|
13140
|
+
exports.getSoftEdgeFilterId = getSoftEdgeFilterId;
|
|
13141
|
+
exports.getSoftEdgeSvgFilter = getSoftEdgeSvgFilter;
|
|
13142
|
+
exports.getSplitStrokePresetPaths = getSplitStrokePresetPaths;
|
|
13143
|
+
exports.getStrokeOnlyPresetPaths = getStrokeOnlyPresetPaths;
|
|
10638
13144
|
exports.getSvgStrokeDasharray = getSvgStrokeDasharray;
|
|
10639
13145
|
exports.getTextCompensationTransform = getTextCompensationTransform;
|
|
13146
|
+
exports.getTextReflectionWrapperStyle = getTextReflectionWrapperStyle;
|
|
13147
|
+
exports.glowFilterLengths = glowFilterLengths;
|
|
13148
|
+
exports.hasEffectDagProperties = hasEffectDagProperties;
|
|
13149
|
+
exports.hasImageEffects = hasImageEffects;
|
|
10640
13150
|
exports.hasSecondaryCategoryAxis = hasSecondaryCategoryAxis;
|
|
10641
13151
|
exports.hasSecondaryValueAxis = hasSecondaryValueAxis;
|
|
13152
|
+
exports.hasStrokePaint = hasStrokePaint;
|
|
10642
13153
|
exports.invalidatePptxRenderCacheEpoch = invalidatePptxRenderCacheEpoch;
|
|
13154
|
+
exports.isArrowedCustomPath = isArrowedCustomPath;
|
|
13155
|
+
exports.isDashedStroke = isDashedStroke;
|
|
13156
|
+
exports.isIdentityRectClip = isIdentityRectClip;
|
|
10643
13157
|
exports.isParetoChart = isParetoChart;
|
|
13158
|
+
exports.isPatternPaint = isPatternPaint;
|
|
10644
13159
|
exports.isPrimaryCategoryAxisAtTop = isPrimaryCategoryAxisAtTop;
|
|
10645
13160
|
exports.isSeriesOnSecondaryAxis = isSeriesOnSecondaryAxis;
|
|
13161
|
+
exports.isStrokeOnlyPresetElement = isStrokeOnlyPresetElement;
|
|
10646
13162
|
exports.isTextOrientationMatrix = isTextOrientationMatrix;
|
|
13163
|
+
exports.isWedgeCalloutPresetShape = isWedgeCalloutPresetShape;
|
|
10647
13164
|
exports.linePointsToSvgString = linePointsToSvgString;
|
|
10648
13165
|
exports.manualLayoutOf = manualLayoutOf;
|
|
10649
13166
|
exports.manualLegendAnchor = manualLegendAnchor;
|
|
10650
13167
|
exports.manualTitleAnchor = manualTitleAnchor;
|
|
13168
|
+
exports.markerPath = markerPath;
|
|
10651
13169
|
exports.measureChartTextWidth = measureChartTextWidth;
|
|
10652
13170
|
exports.multiplyTextOrientationMatrices = multiplyTextOrientationMatrices;
|
|
13171
|
+
exports.normalizeArrow = normalizeArrow;
|
|
10653
13172
|
exports.normalizeStrokeDashType = normalizeStrokeDashType;
|
|
10654
13173
|
exports.orderParetoEntries = orderParetoEntries;
|
|
13174
|
+
exports.outlinePathData = outlinePathData;
|
|
13175
|
+
exports.outlineStrokeJoin = outlineStrokeJoin;
|
|
13176
|
+
exports.outsetClipPathForStroke = outsetClipPathForStroke;
|
|
13177
|
+
exports.paintedStrokeWidth = paintedStrokeWidth;
|
|
10655
13178
|
exports.paletteColor = paletteColor;
|
|
10656
13179
|
exports.paletteColor2 = paletteColor2;
|
|
10657
13180
|
exports.parseDrawingPercent = parseDrawingPercent;
|
|
10658
13181
|
exports.plotAreaFill = plotAreaFill;
|
|
10659
13182
|
exports.primaryValueAxis = primaryValueAxis;
|
|
13183
|
+
exports.registerGroupChildren = registerGroupChildren;
|
|
13184
|
+
exports.registerSilhouetteMorph = registerSilhouetteMorph;
|
|
10660
13185
|
exports.reserveLegendSpace = reserveLegendSpace;
|
|
10661
13186
|
exports.resetBarFacePicturePixelCacheForTests = resetBarFacePicturePixelCacheForTests;
|
|
10662
13187
|
exports.resolveActiveDataPointPicture = resolveActiveDataPointPicture;
|
|
@@ -10664,12 +13189,14 @@ exports.resolveBarFacePicturePixelColor = resolveBarFacePicturePixelColor;
|
|
|
10664
13189
|
exports.resolveBarFaceTargets = resolveBarFaceTargets;
|
|
10665
13190
|
exports.resolveBarLabelAnchor = resolveBarLabelAnchor;
|
|
10666
13191
|
exports.resolveBarLabelPlacement = resolveBarLabelPlacement;
|
|
13192
|
+
exports.resolveBaseShapeGeometry = resolveBaseShapeGeometry;
|
|
10667
13193
|
exports.resolveCategoryLabels = resolveCategoryLabels;
|
|
10668
13194
|
exports.resolveChartKind = resolveChartKind;
|
|
10669
13195
|
exports.resolveChartPalette = resolveChartPalette;
|
|
10670
13196
|
exports.resolveChartStyleDefaults = resolveChartStyleDefaults;
|
|
10671
13197
|
exports.resolveChartTitleRunSpans = resolveChartTitleRunSpans;
|
|
10672
13198
|
exports.resolveChartTitleTextStyle = resolveChartTitleTextStyle;
|
|
13199
|
+
exports.resolveComputedFill = resolveComputedFill;
|
|
10673
13200
|
exports.resolveDataLabelContent = resolveDataLabelContent;
|
|
10674
13201
|
exports.resolveDataLabelTextStyle = resolveDataLabelTextStyle;
|
|
10675
13202
|
exports.resolveDataPointExplosion = resolveDataPointExplosion;
|
|
@@ -10678,12 +13205,16 @@ exports.resolveDataPointMarker = resolveDataPointMarker;
|
|
|
10678
13205
|
exports.resolveDataPointPictureFill = resolveDataPointPictureFill;
|
|
10679
13206
|
exports.resolveDisplayedChartType = resolveDisplayedChartType;
|
|
10680
13207
|
exports.resolveExtrusionFaceFill = resolveExtrusionFaceFill;
|
|
13208
|
+
exports.resolveGlow = resolveGlow;
|
|
13209
|
+
exports.resolveInnerShadow = resolveInnerShadow;
|
|
10681
13210
|
exports.resolveLabelPosition = resolveLabelPosition;
|
|
10682
13211
|
exports.resolveLegendAnchorPosition = resolveLegendAnchorPosition;
|
|
10683
13212
|
exports.resolveLegendPlacement = resolveLegendPlacement;
|
|
10684
13213
|
exports.resolveLegendSwatchKind = resolveLegendSwatchKind;
|
|
13214
|
+
exports.resolveLiveCustomGeometryPath = resolveLiveCustomGeometryPath;
|
|
10685
13215
|
exports.resolveMarkerLabelAnchor = resolveMarkerLabelAnchor;
|
|
10686
13216
|
exports.resolveMarkerLabelPlacement = resolveMarkerLabelPlacement;
|
|
13217
|
+
exports.resolveOuterShadowLayers = resolveOuterShadowLayers;
|
|
10687
13218
|
exports.resolveUntargetedBarFaceFill = resolveUntargetedBarFaceFill;
|
|
10688
13219
|
exports.resolveVaryColorFill = resolveVaryColorFill;
|
|
10689
13220
|
exports.sanitizeGradientStops = sanitizeGradientStops;
|
|
@@ -10693,17 +13224,32 @@ exports.seriesXValues = seriesXValues;
|
|
|
10693
13224
|
exports.setBoundedRenderCache = setBoundedRenderCache;
|
|
10694
13225
|
exports.setChartTextMeasurer = setChartTextMeasurer;
|
|
10695
13226
|
exports.shouldRenderMajorGridlines = shouldRenderMajorGridlines;
|
|
13227
|
+
exports.silhouetteFillsLayer = silhouetteFillsLayer;
|
|
13228
|
+
exports.silhouetteFillsOverlay = silhouetteFillsOverlay;
|
|
13229
|
+
exports.silhouetteMorphEntry = silhouetteMorphEntry;
|
|
13230
|
+
exports.snapPlacement = snapPlacement;
|
|
10696
13231
|
exports.splitLabelLines = splitLabelLines;
|
|
10697
13232
|
exports.splitSeriesByAxis = splitSeriesByAxis;
|
|
13233
|
+
exports.splitStrokePresetPathData = splitStrokePresetPathData;
|
|
10698
13234
|
exports.stackedBarWidth = stackedBarWidth;
|
|
10699
13235
|
exports.stackedSegmentExtent = stackedSegmentExtent;
|
|
13236
|
+
exports.straddlingStrokeWidth = straddlingStrokeWidth;
|
|
13237
|
+
exports.strokeMiterLimit = strokeMiterLimit;
|
|
13238
|
+
exports.strokeOnlyPresetPathData = strokeOnlyPresetPathData;
|
|
13239
|
+
exports.strokeOutlineViewBox = strokeOutlineViewBox;
|
|
10700
13240
|
exports.subscribeBarFacePicturePixelSamples = subscribeBarFacePicturePixelSamples;
|
|
13241
|
+
exports.suppressesCssBorder = suppressesCssBorder;
|
|
10701
13242
|
exports.suppressesCssFill = suppressesCssFill;
|
|
10702
13243
|
exports.surfaceColor = surfaceColor;
|
|
13244
|
+
exports.svgGradientFillRef = svgGradientFillRef;
|
|
13245
|
+
exports.svgGradientId = svgGradientId;
|
|
13246
|
+
exports.svgGradientMarkup = svgGradientMarkup;
|
|
13247
|
+
exports.svgLineCap = svgLineCap;
|
|
10703
13248
|
exports.titleBaselineFor = titleBaselineFor;
|
|
10704
13249
|
exports.toCssGradientStop = toCssGradientStop;
|
|
10705
13250
|
exports.unitsCaptionOffset = unitsCaptionOffset;
|
|
10706
13251
|
exports.upsertDataPoint = upsertDataPoint;
|
|
13252
|
+
exports.usesSilhouetteEffects = usesSilhouetteEffects;
|
|
10707
13253
|
exports.valueToY = valueToY;
|
|
10708
13254
|
exports.valueToY2 = valueToY2;
|
|
10709
13255
|
exports.withChartTitleBand = withChartTitleBand;
|