pptx-react-viewer 4.66.0 → 4.68.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/CHANGELOG.md +38 -0
- package/README.md +10 -0
- package/dist/{AiChatPanel-JKWJQX4N.mjs → AiChatPanel-E7CJSTW7.mjs} +1 -1
- package/dist/AiChatPanel-E7CJSTW7.mjs.br +0 -0
- package/dist/AiChatPanel-E7CJSTW7.mjs.gz +0 -0
- package/dist/{AiChatPanel-DL7EBR2V.js → AiChatPanel-PLQ3NBTK.js} +19 -19
- package/dist/AiChatPanel-PLQ3NBTK.js.br +0 -0
- package/dist/AiChatPanel-PLQ3NBTK.js.gz +0 -0
- package/dist/ai.js +2 -2
- package/dist/ai.js.br +0 -0
- package/dist/ai.js.gz +0 -0
- package/dist/ai.mjs +1 -1
- package/dist/ai.mjs.br +0 -0
- package/dist/ai.mjs.gz +0 -0
- package/dist/{chunk-DORVZDQT.mjs → chunk-BJLJJUP3.mjs} +25 -11
- package/dist/chunk-BJLJJUP3.mjs.br +0 -0
- package/dist/chunk-BJLJJUP3.mjs.gz +0 -0
- package/dist/{chunk-A4K2TM2K.mjs → chunk-FBSPQYRE.mjs} +4 -1
- package/dist/chunk-FBSPQYRE.mjs.br +0 -0
- package/dist/{chunk-A4K2TM2K.mjs.gz → chunk-FBSPQYRE.mjs.gz} +0 -0
- package/dist/{chunk-ZRU67AVX.mjs → chunk-GG4I3L2W.mjs} +165 -135
- package/dist/chunk-GG4I3L2W.mjs.br +0 -0
- package/dist/chunk-GG4I3L2W.mjs.gz +0 -0
- package/dist/{chunk-SLFVXZHA.mjs → chunk-JZE6BORE.mjs} +1 -1
- package/dist/chunk-JZE6BORE.mjs.br +0 -0
- package/dist/chunk-JZE6BORE.mjs.gz +0 -0
- package/dist/{chunk-UC57KUGO.js → chunk-LVEFHZ76.js} +1 -1
- package/dist/chunk-LVEFHZ76.js.br +0 -0
- package/dist/chunk-LVEFHZ76.js.gz +0 -0
- package/dist/{chunk-YQ67KAQR.js → chunk-NRTPKXZX.js} +364 -334
- package/dist/chunk-NRTPKXZX.js.br +0 -0
- package/dist/chunk-NRTPKXZX.js.gz +0 -0
- package/dist/{chunk-73S5EOD3.js → chunk-P2COO2QO.js} +4 -1
- package/dist/chunk-P2COO2QO.js.br +0 -0
- package/dist/{chunk-73S5EOD3.js.gz → chunk-P2COO2QO.js.gz} +0 -0
- package/dist/{chunk-QLXYEA54.js → chunk-Q5QEVT54.js} +581 -567
- package/dist/chunk-Q5QEVT54.js.br +0 -0
- package/dist/chunk-Q5QEVT54.js.gz +0 -0
- package/dist/i18n/de.cjs +3 -0
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +3 -0
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +3 -0
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +3 -0
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +3 -0
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +3 -0
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +3 -0
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +3 -0
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +27 -27
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +9 -2
- package/dist/internals.js +81 -81
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +2 -2
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +4 -1
- package/dist/viewer/index.js +21 -21
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +4 -4
- package/dist/AiChatPanel-DL7EBR2V.js.br +0 -0
- package/dist/AiChatPanel-DL7EBR2V.js.gz +0 -0
- package/dist/AiChatPanel-JKWJQX4N.mjs.br +0 -0
- package/dist/AiChatPanel-JKWJQX4N.mjs.gz +0 -0
- package/dist/chunk-73S5EOD3.js.br +0 -0
- package/dist/chunk-A4K2TM2K.mjs.br +0 -0
- package/dist/chunk-DORVZDQT.mjs.br +0 -0
- package/dist/chunk-DORVZDQT.mjs.gz +0 -0
- package/dist/chunk-QLXYEA54.js.br +0 -0
- package/dist/chunk-QLXYEA54.js.gz +0 -0
- package/dist/chunk-SLFVXZHA.mjs.br +0 -0
- package/dist/chunk-SLFVXZHA.mjs.gz +0 -0
- package/dist/chunk-UC57KUGO.js.br +0 -0
- package/dist/chunk-UC57KUGO.js.gz +0 -0
- package/dist/chunk-YQ67KAQR.js.br +0 -0
- package/dist/chunk-YQ67KAQR.js.gz +0 -0
- package/dist/chunk-ZRU67AVX.mjs.br +0 -0
- package/dist/chunk-ZRU67AVX.mjs.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkP2COO2QO_js = require('./chunk-P2COO2QO.js');
|
|
4
4
|
var pptx = require('ooxml-ui/pptx');
|
|
5
5
|
var React17 = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -604,9 +604,9 @@ function differsOnlyInMasterSet(previous, next) {
|
|
|
604
604
|
}
|
|
605
605
|
function recordExplicitSlideUpdate(history, previous, before, label) {
|
|
606
606
|
if (previous && serializeHistoryDocument(previous) !== serializeHistoryDocument(before)) {
|
|
607
|
-
history.record(
|
|
607
|
+
history.record(chunkP2COO2QO_js.cloneHistorySnapshot(previous), previous.actionLabel);
|
|
608
608
|
}
|
|
609
|
-
history.record({ ...
|
|
609
|
+
history.record({ ...chunkP2COO2QO_js.cloneHistorySnapshot(before), actionLabel: label }, label);
|
|
610
610
|
}
|
|
611
611
|
var POLL_INTERVAL_MS = 16;
|
|
612
612
|
function usePointerReleaseWakeup(hasActivePointerInteraction) {
|
|
@@ -688,8 +688,8 @@ function useEditorHistory(input) {
|
|
|
688
688
|
width: canvasSize.width,
|
|
689
689
|
height: canvasSize.height,
|
|
690
690
|
activeSlideIndex,
|
|
691
|
-
slides: slides.map(
|
|
692
|
-
templateElementsBySlideId:
|
|
691
|
+
slides: slides.map(chunkP2COO2QO_js.cloneSlide),
|
|
692
|
+
templateElementsBySlideId: chunkP2COO2QO_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
693
693
|
...recordedTheme ? { theme: recordedTheme } : {},
|
|
694
694
|
...actionLabel ? { actionLabel } : {}
|
|
695
695
|
};
|
|
@@ -703,9 +703,9 @@ function useEditorHistory(input) {
|
|
|
703
703
|
width: snapshot.width,
|
|
704
704
|
height: snapshot.height
|
|
705
705
|
});
|
|
706
|
-
setSlides(snapshot.slides.map(
|
|
706
|
+
setSlides(snapshot.slides.map(chunkP2COO2QO_js.cloneSlide));
|
|
707
707
|
setTemplateElementsBySlideId(
|
|
708
|
-
|
|
708
|
+
chunkP2COO2QO_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
709
709
|
);
|
|
710
710
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
711
711
|
setSelectedElementIds([]);
|
|
@@ -771,8 +771,8 @@ function useEditorHistory(input) {
|
|
|
771
771
|
return;
|
|
772
772
|
}
|
|
773
773
|
isApplyingHistoryRef.current = true;
|
|
774
|
-
const nextSnapshot =
|
|
775
|
-
lastHistorySnapshotRef.current =
|
|
774
|
+
const nextSnapshot = chunkP2COO2QO_js.cloneHistorySnapshot(result.snapshot);
|
|
775
|
+
lastHistorySnapshotRef.current = chunkP2COO2QO_js.cloneHistorySnapshot(nextSnapshot);
|
|
776
776
|
lastHistorySerializedRef.current = serializeHistoryDocument(nextSnapshot);
|
|
777
777
|
applyHistorySnapshot(nextSnapshot);
|
|
778
778
|
restoreTheme(currentSnapshot, nextSnapshot);
|
|
@@ -796,8 +796,8 @@ function useEditorHistory(input) {
|
|
|
796
796
|
return;
|
|
797
797
|
}
|
|
798
798
|
isApplyingHistoryRef.current = true;
|
|
799
|
-
const targetSnapshot =
|
|
800
|
-
lastHistorySnapshotRef.current =
|
|
799
|
+
const targetSnapshot = chunkP2COO2QO_js.cloneHistorySnapshot(result.snapshot);
|
|
800
|
+
lastHistorySnapshotRef.current = chunkP2COO2QO_js.cloneHistorySnapshot(targetSnapshot);
|
|
801
801
|
lastHistorySerializedRef.current = serializeHistoryDocument(targetSnapshot);
|
|
802
802
|
applyHistorySnapshot(targetSnapshot);
|
|
803
803
|
restoreTheme(currentSnapshot, targetSnapshot);
|
|
@@ -815,7 +815,7 @@ function useEditorHistory(input) {
|
|
|
815
815
|
(initialSnapshot) => {
|
|
816
816
|
history.clear();
|
|
817
817
|
if (initialSnapshot) {
|
|
818
|
-
const clonedInitial =
|
|
818
|
+
const clonedInitial = chunkP2COO2QO_js.cloneHistorySnapshot(initialSnapshot);
|
|
819
819
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
820
820
|
lastHistorySerializedRef.current = serializeHistoryDocument(clonedInitial);
|
|
821
821
|
} else {
|
|
@@ -889,16 +889,16 @@ function useEditorHistory(input) {
|
|
|
889
889
|
slides
|
|
890
890
|
]);
|
|
891
891
|
const commitSlides = (nextSlides, label, beforeSlides = slides, nextSlideMasters) => {
|
|
892
|
-
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(
|
|
892
|
+
const before = { ...buildHistorySnapshot(), slides: beforeSlides.map(chunkP2COO2QO_js.cloneSlide) };
|
|
893
893
|
const { theme: beforeTheme, ...unthemed } = before;
|
|
894
894
|
const afterTheme = nextSlideMasters ? pptx.historyTheme(theme, nextSlideMasters) : beforeTheme;
|
|
895
895
|
const after = {
|
|
896
896
|
...unthemed,
|
|
897
|
-
slides: nextSlides.map(
|
|
897
|
+
slides: nextSlides.map(chunkP2COO2QO_js.cloneSlide),
|
|
898
898
|
...afterTheme ? { theme: afterTheme } : {}
|
|
899
899
|
};
|
|
900
900
|
recordExplicitSlideUpdate(history, lastHistorySnapshotRef.current, before, label);
|
|
901
|
-
lastHistorySnapshotRef.current =
|
|
901
|
+
lastHistorySnapshotRef.current = chunkP2COO2QO_js.cloneHistorySnapshot(after);
|
|
902
902
|
lastHistorySerializedRef.current = serializeHistoryDocument(after);
|
|
903
903
|
isApplyingHistoryRef.current = false;
|
|
904
904
|
setSlides(nextSlides);
|
|
@@ -1092,22 +1092,22 @@ function useZoomViewport({
|
|
|
1092
1092
|
selectedElements.forEach((element) => {
|
|
1093
1093
|
minX = Math.min(minX, element.x);
|
|
1094
1094
|
minY = Math.min(minY, element.y);
|
|
1095
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
1096
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
1095
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkP2COO2QO_js.MIN_ELEMENT_SIZE));
|
|
1096
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkP2COO2QO_js.MIN_ELEMENT_SIZE));
|
|
1097
1097
|
});
|
|
1098
1098
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
1099
1099
|
return;
|
|
1100
1100
|
}
|
|
1101
1101
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
1102
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
1103
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
1102
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkP2COO2QO_js.MIN_ELEMENT_SIZE);
|
|
1103
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkP2COO2QO_js.MIN_ELEMENT_SIZE);
|
|
1104
1104
|
const availableWidth = Math.max(
|
|
1105
|
-
effectiveEditorDimensions.width -
|
|
1106
|
-
|
|
1105
|
+
effectiveEditorDimensions.width - chunkP2COO2QO_js.ZOOM_TO_SELECTION_PADDING,
|
|
1106
|
+
chunkP2COO2QO_js.MIN_ELEMENT_SIZE
|
|
1107
1107
|
);
|
|
1108
1108
|
const availableHeight = Math.max(
|
|
1109
|
-
effectiveEditorDimensions.height -
|
|
1110
|
-
|
|
1109
|
+
effectiveEditorDimensions.height - chunkP2COO2QO_js.ZOOM_TO_SELECTION_PADDING,
|
|
1110
|
+
chunkP2COO2QO_js.MIN_ELEMENT_SIZE
|
|
1111
1111
|
);
|
|
1112
1112
|
const targetEditorScale = Math.min(
|
|
1113
1113
|
availableWidth / boundsWidth,
|
|
@@ -4022,12 +4022,13 @@ function useViewerCoreState(_input) {
|
|
|
4022
4022
|
React17.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
4023
4023
|
const [mode, setMode] = React17.useState("edit");
|
|
4024
4024
|
const [loading, setLoading] = React17.useState(true);
|
|
4025
|
+
const [fontProgress, setFontProgress] = React17.useState(null);
|
|
4025
4026
|
const [error, setError] = React17.useState(null);
|
|
4026
4027
|
const { slides, setSlides, slidesRef } = useSlideState();
|
|
4027
4028
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = React17.useState({});
|
|
4028
4029
|
const [canvasSize, setCanvasSize] = React17.useState({
|
|
4029
|
-
width:
|
|
4030
|
-
height:
|
|
4030
|
+
width: chunkP2COO2QO_js.DEFAULT_CANVAS_WIDTH,
|
|
4031
|
+
height: chunkP2COO2QO_js.DEFAULT_CANVAS_HEIGHT
|
|
4031
4032
|
});
|
|
4032
4033
|
const [slideSizeEmu, setSlideSizeEmu] = React17.useState();
|
|
4033
4034
|
const [activeSlideIndex, setActiveSlideIndex] = React17.useState(0);
|
|
@@ -4124,6 +4125,8 @@ function useViewerCoreState(_input) {
|
|
|
4124
4125
|
setMode,
|
|
4125
4126
|
loading,
|
|
4126
4127
|
setLoading,
|
|
4128
|
+
fontProgress,
|
|
4129
|
+
setFontProgress,
|
|
4127
4130
|
error,
|
|
4128
4131
|
setError,
|
|
4129
4132
|
slides,
|
|
@@ -4363,6 +4366,98 @@ function useViewerState(input) {
|
|
|
4363
4366
|
var glyphOutlineFontCache = /* @__PURE__ */ new pptx.GlyphOutlineFontCache();
|
|
4364
4367
|
var getGlyphOutline = /* @__PURE__ */ pptx.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
4365
4368
|
|
|
4369
|
+
// src/viewer/hooks/useFontInjection.ts
|
|
4370
|
+
var EMBEDDED_FONTS_STYLE_ID = "pptx-embedded-fonts";
|
|
4371
|
+
var GOOGLE_FONTS_LINK_ID = "pptx-google-fonts";
|
|
4372
|
+
var SYMBOL_FONTS_STYLE_ID = "pptx-symbol-font-fallback";
|
|
4373
|
+
var SYMBOL_FONT_FAMILIES = [
|
|
4374
|
+
"Wingdings",
|
|
4375
|
+
"Wingdings 2",
|
|
4376
|
+
"Wingdings 3",
|
|
4377
|
+
"Symbol",
|
|
4378
|
+
"Webdings"
|
|
4379
|
+
];
|
|
4380
|
+
var FONT_NAME_UNSAFE_CHARS = /["\\\n\r;}<>]/u;
|
|
4381
|
+
function useFontInjection({
|
|
4382
|
+
embeddedFonts,
|
|
4383
|
+
slides,
|
|
4384
|
+
googleFonts
|
|
4385
|
+
}) {
|
|
4386
|
+
const googleFontsBase = pptx.resolveGoogleFontsCss2Base(googleFonts);
|
|
4387
|
+
React17.useEffect(() => {
|
|
4388
|
+
if (!embeddedFonts.length) {
|
|
4389
|
+
return;
|
|
4390
|
+
}
|
|
4391
|
+
const sheet = pptx.createEmbeddedFontsSheet(document, EMBEDDED_FONTS_STYLE_ID);
|
|
4392
|
+
sheet.set(embeddedFonts);
|
|
4393
|
+
return () => sheet.dispose();
|
|
4394
|
+
}, [embeddedFonts]);
|
|
4395
|
+
const referencedFamilies = React17.useMemo(() => pptx.collectReferencedFontFamilies(slides), [slides]);
|
|
4396
|
+
React17.useEffect(() => {
|
|
4397
|
+
let cancelled = false;
|
|
4398
|
+
void pptx.resolveGoogleWebfontHref(slides, embeddedFonts, void 0, googleFontsBase).then(
|
|
4399
|
+
(href) => {
|
|
4400
|
+
if (cancelled) {
|
|
4401
|
+
return null;
|
|
4402
|
+
}
|
|
4403
|
+
pptx.syncGoogleWebfontStylesheet(document, GOOGLE_FONTS_LINK_ID, href);
|
|
4404
|
+
return href;
|
|
4405
|
+
}
|
|
4406
|
+
);
|
|
4407
|
+
return () => {
|
|
4408
|
+
cancelled = true;
|
|
4409
|
+
};
|
|
4410
|
+
}, [embeddedFonts, slides, googleFontsBase]);
|
|
4411
|
+
React17.useEffect(() => () => document.getElementById(GOOGLE_FONTS_LINK_ID)?.remove(), []);
|
|
4412
|
+
const [, setOutlineFontsTick] = React17.useState(0);
|
|
4413
|
+
React17.useEffect(() => {
|
|
4414
|
+
let cancelled = false;
|
|
4415
|
+
void pptx.loadDeckWebfontOutlines({
|
|
4416
|
+
slides,
|
|
4417
|
+
embeddedFonts,
|
|
4418
|
+
googleFontsBase,
|
|
4419
|
+
cache: glyphOutlineFontCache,
|
|
4420
|
+
isCancelled: () => cancelled
|
|
4421
|
+
}).then((registered) => {
|
|
4422
|
+
if (registered && !cancelled) {
|
|
4423
|
+
setOutlineFontsTick((tick) => tick + 1);
|
|
4424
|
+
}
|
|
4425
|
+
return void 0;
|
|
4426
|
+
});
|
|
4427
|
+
return () => {
|
|
4428
|
+
cancelled = true;
|
|
4429
|
+
};
|
|
4430
|
+
}, [embeddedFonts, slides, googleFontsBase]);
|
|
4431
|
+
React17.useEffect(() => {
|
|
4432
|
+
const neededSymbolFonts = SYMBOL_FONT_FAMILIES.filter((f) => referencedFamilies.has(f));
|
|
4433
|
+
if (neededSymbolFonts.length === 0) {
|
|
4434
|
+
return;
|
|
4435
|
+
}
|
|
4436
|
+
const styleEl = document.createElement("style");
|
|
4437
|
+
styleEl.id = SYMBOL_FONTS_STYLE_ID;
|
|
4438
|
+
const rules = neededSymbolFonts.flatMap((font) => {
|
|
4439
|
+
if (typeof font !== "string" || FONT_NAME_UNSAFE_CHARS.test(font)) {
|
|
4440
|
+
return [];
|
|
4441
|
+
}
|
|
4442
|
+
return [
|
|
4443
|
+
`@font-face {
|
|
4444
|
+
font-family: "${font}";
|
|
4445
|
+
src: local("${font}"), local("${font} Regular");
|
|
4446
|
+
font-display: swap;
|
|
4447
|
+
}`
|
|
4448
|
+
];
|
|
4449
|
+
}).join("\n");
|
|
4450
|
+
styleEl.textContent = rules;
|
|
4451
|
+
document.head.appendChild(styleEl);
|
|
4452
|
+
return () => {
|
|
4453
|
+
const existing = document.getElementById(SYMBOL_FONTS_STYLE_ID);
|
|
4454
|
+
if (existing) {
|
|
4455
|
+
document.head.removeChild(existing);
|
|
4456
|
+
}
|
|
4457
|
+
};
|
|
4458
|
+
}, [referencedFamilies]);
|
|
4459
|
+
}
|
|
4460
|
+
|
|
4366
4461
|
// src/viewer/hooks/useLoadContent.ts
|
|
4367
4462
|
function useLoadContent({
|
|
4368
4463
|
content,
|
|
@@ -4406,6 +4501,8 @@ function useLoadContent({
|
|
|
4406
4501
|
setModifyVerifier,
|
|
4407
4502
|
setCompatToasts,
|
|
4408
4503
|
setLoading,
|
|
4504
|
+
setFontProgress,
|
|
4505
|
+
googleFonts,
|
|
4409
4506
|
setError,
|
|
4410
4507
|
setIsDirty,
|
|
4411
4508
|
setIsEncrypted,
|
|
@@ -4419,7 +4516,9 @@ function useLoadContent({
|
|
|
4419
4516
|
initialSlideRef.current = initialSlide;
|
|
4420
4517
|
const limitsRef = React17.useRef(limits);
|
|
4421
4518
|
limitsRef.current = limits;
|
|
4422
|
-
const
|
|
4519
|
+
const googleFontsRef = React17.useRef(googleFonts);
|
|
4520
|
+
googleFontsRef.current = googleFonts;
|
|
4521
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
4423
4522
|
const translateRef = React17.useRef(t);
|
|
4424
4523
|
translateRef.current = t;
|
|
4425
4524
|
const originalBufferRef = React17.useRef(null);
|
|
@@ -4437,6 +4536,7 @@ function useLoadContent({
|
|
|
4437
4536
|
(async () => {
|
|
4438
4537
|
try {
|
|
4439
4538
|
setLoading(true);
|
|
4539
|
+
setFontProgress?.(null);
|
|
4440
4540
|
setError(null);
|
|
4441
4541
|
const buffer = content instanceof Uint8Array ? content.buffer.slice(content.byteOffset, content.byteOffset + content.byteLength) : content;
|
|
4442
4542
|
originalBufferRef.current = buffer instanceof ArrayBuffer ? buffer : null;
|
|
@@ -4447,13 +4547,35 @@ function useLoadContent({
|
|
|
4447
4547
|
);
|
|
4448
4548
|
}
|
|
4449
4549
|
const previousHandler = handlerRef.current;
|
|
4550
|
+
let webfonts;
|
|
4551
|
+
const startWebfonts = (deckSlides, deckEmbeddedFonts) => {
|
|
4552
|
+
if (typeof document === "undefined" || cancelled || token !== renderTokenRef.current) {
|
|
4553
|
+
return;
|
|
4554
|
+
}
|
|
4555
|
+
webfonts = pptx.prepareDeckWebfonts({
|
|
4556
|
+
document,
|
|
4557
|
+
linkId: GOOGLE_FONTS_LINK_ID,
|
|
4558
|
+
slides: chunkP2COO2QO_js.partitionTemplateElements(deckSlides).slides,
|
|
4559
|
+
embeddedFonts: deckEmbeddedFonts,
|
|
4560
|
+
googleFontsBase: pptx.resolveGoogleFontsCss2Base(googleFontsRef.current),
|
|
4561
|
+
onProgress: (progress) => {
|
|
4562
|
+
if (!cancelled && token === renderTokenRef.current) {
|
|
4563
|
+
setFontProgress?.(progress);
|
|
4564
|
+
}
|
|
4565
|
+
}
|
|
4566
|
+
});
|
|
4567
|
+
};
|
|
4450
4568
|
const parsed = await handler.load(buffer, {
|
|
4451
4569
|
allowExternalImages,
|
|
4452
|
-
limits: limitsRef.current
|
|
4570
|
+
limits: limitsRef.current,
|
|
4571
|
+
onSlidesParsed: (deck) => startWebfonts([...deck.slides], [...deck.embeddedFonts])
|
|
4453
4572
|
});
|
|
4454
4573
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4455
4574
|
return;
|
|
4456
4575
|
}
|
|
4576
|
+
if (!webfonts) {
|
|
4577
|
+
startWebfonts(parsed.slides, parsed.embeddedFonts ?? []);
|
|
4578
|
+
}
|
|
4457
4579
|
const mediaElements = [];
|
|
4458
4580
|
for (const slide of parsed.slides) {
|
|
4459
4581
|
pptx.collectMediaElements(slide.elements, mediaElements);
|
|
@@ -4504,6 +4626,8 @@ function useLoadContent({
|
|
|
4504
4626
|
nextSlides,
|
|
4505
4627
|
(path) => handler.getImageData(path)
|
|
4506
4628
|
);
|
|
4629
|
+
const partition = chunkP2COO2QO_js.partitionTemplateElements(nextSlides);
|
|
4630
|
+
await webfonts;
|
|
4507
4631
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4508
4632
|
return;
|
|
4509
4633
|
}
|
|
@@ -4519,12 +4643,11 @@ function useLoadContent({
|
|
|
4519
4643
|
}
|
|
4520
4644
|
resources.commit();
|
|
4521
4645
|
handlerRef.current = handler;
|
|
4522
|
-
const partition = chunk73S5EOD3_js.partitionTemplateElements(nextSlides);
|
|
4523
4646
|
setSlides(partition.slides);
|
|
4524
4647
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4525
4648
|
setCanvasSize({
|
|
4526
|
-
width: parsed.width ??
|
|
4527
|
-
height: parsed.height ??
|
|
4649
|
+
width: parsed.width ?? chunkP2COO2QO_js.DEFAULT_CANVAS_WIDTH,
|
|
4650
|
+
height: parsed.height ?? chunkP2COO2QO_js.DEFAULT_CANVAS_HEIGHT
|
|
4528
4651
|
});
|
|
4529
4652
|
setSlideSizeEmu(
|
|
4530
4653
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4600,6 +4723,7 @@ function useLoadContent({
|
|
|
4600
4723
|
} finally {
|
|
4601
4724
|
resources.releaseIfUncommitted();
|
|
4602
4725
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4726
|
+
setFontProgress?.(null);
|
|
4603
4727
|
setLoading(false);
|
|
4604
4728
|
}
|
|
4605
4729
|
}
|
|
@@ -4940,7 +5064,7 @@ function useElementOperations(input) {
|
|
|
4940
5064
|
);
|
|
4941
5065
|
return;
|
|
4942
5066
|
}
|
|
4943
|
-
if (
|
|
5067
|
+
if (chunkP2COO2QO_js.isTemplateElementId(elementId)) {
|
|
4944
5068
|
const slideId = activeSlide?.id;
|
|
4945
5069
|
if (slideId) {
|
|
4946
5070
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -5227,8 +5351,8 @@ function createCanvasGestures(getInput, frames = animationFrames) {
|
|
|
5227
5351
|
}
|
|
5228
5352
|
function paintResize(resize, transform) {
|
|
5229
5353
|
const { x, y } = transform;
|
|
5230
|
-
const width = Math.max(transform.width,
|
|
5231
|
-
const height = Math.max(transform.height,
|
|
5354
|
+
const width = Math.max(transform.width, chunkP2COO2QO_js.MIN_ELEMENT_SIZE);
|
|
5355
|
+
const height = Math.max(transform.height, chunkP2COO2QO_js.MIN_ELEMENT_SIZE);
|
|
5232
5356
|
resize.lastX = x;
|
|
5233
5357
|
resize.lastY = y;
|
|
5234
5358
|
resize.lastWidth = transform.width;
|
|
@@ -5285,7 +5409,7 @@ function createCanvasGestures(getInput, frames = animationFrames) {
|
|
|
5285
5409
|
getGridSize: () => getInput().gridSpacingPx,
|
|
5286
5410
|
getSnapToShape: () => getInput().snapToShape,
|
|
5287
5411
|
getGuides: () => getInput().guides.map(({ axis, position }) => ({ axis, position })),
|
|
5288
|
-
getMinSize: () =>
|
|
5412
|
+
getMinSize: () => chunkP2COO2QO_js.MIN_ELEMENT_SIZE,
|
|
5289
5413
|
getSnapExcludeIds: () => armed?.kind === "move" ? Object.keys(armed.drag.startPositionsById) : [],
|
|
5290
5414
|
getStageOrigin: () => {
|
|
5291
5415
|
const rect = getInput().canvasStageRef.current?.getBoundingClientRect();
|
|
@@ -5366,7 +5490,7 @@ function commitMove(input, drag) {
|
|
|
5366
5490
|
const start = drag.startPositionsById[el.id];
|
|
5367
5491
|
return start ? { ...el, x: start.x + dx, y: start.y + dy } : el;
|
|
5368
5492
|
});
|
|
5369
|
-
return
|
|
5493
|
+
return chunkP2COO2QO_js.applyReroutedConnectors(moved, chunkP2COO2QO_js.rerouteConnectorsForMovedElements(moved, movedIds));
|
|
5370
5494
|
};
|
|
5371
5495
|
if (input.editTemplateMode) {
|
|
5372
5496
|
const slideId = input.activeSlide?.id;
|
|
@@ -5397,8 +5521,8 @@ function commitResize(input, resize) {
|
|
|
5397
5521
|
if (i !== input.activeSlideIndex) {
|
|
5398
5522
|
return s;
|
|
5399
5523
|
}
|
|
5400
|
-
const rerouted =
|
|
5401
|
-
return rerouted.length === 0 ? s : { ...s, elements:
|
|
5524
|
+
const rerouted = chunkP2COO2QO_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
5525
|
+
return rerouted.length === 0 ? s : { ...s, elements: chunkP2COO2QO_js.applyReroutedConnectors(s.elements, rerouted) };
|
|
5402
5526
|
})
|
|
5403
5527
|
);
|
|
5404
5528
|
}
|
|
@@ -6233,7 +6357,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6233
6357
|
return;
|
|
6234
6358
|
}
|
|
6235
6359
|
const resolved = resolveHyperlinkEditResult(data);
|
|
6236
|
-
if (resolved.url && !
|
|
6360
|
+
if (resolved.url && !chunkP2COO2QO_js.isUrlSafe(resolved.url)) {
|
|
6237
6361
|
return;
|
|
6238
6362
|
}
|
|
6239
6363
|
const actionClick = {
|
|
@@ -6279,7 +6403,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6279
6403
|
if (!activeSlide) {
|
|
6280
6404
|
return;
|
|
6281
6405
|
}
|
|
6282
|
-
const preset =
|
|
6406
|
+
const preset = chunkP2COO2QO_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
6283
6407
|
if (!preset) {
|
|
6284
6408
|
return;
|
|
6285
6409
|
}
|
|
@@ -6366,7 +6490,7 @@ function useInsertElements(input) {
|
|
|
6366
6490
|
width: 300,
|
|
6367
6491
|
height: 60,
|
|
6368
6492
|
text: "",
|
|
6369
|
-
textStyle: { fontSize:
|
|
6493
|
+
textStyle: { fontSize: chunkP2COO2QO_js.DEFAULT_TEXT_FONT_SIZE }
|
|
6370
6494
|
});
|
|
6371
6495
|
};
|
|
6372
6496
|
const handleAddShape = () => {
|
|
@@ -6388,7 +6512,7 @@ function useInsertElements(input) {
|
|
|
6388
6512
|
}
|
|
6389
6513
|
});
|
|
6390
6514
|
};
|
|
6391
|
-
const handleAddTable = (rows =
|
|
6515
|
+
const handleAddTable = (rows = chunkP2COO2QO_js.DEFAULT_TABLE_ROWS, columns = chunkP2COO2QO_js.DEFAULT_TABLE_COLUMNS) => {
|
|
6392
6516
|
if (!activeSlide) {
|
|
6393
6517
|
return;
|
|
6394
6518
|
}
|
|
@@ -6562,7 +6686,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6562
6686
|
history
|
|
6563
6687
|
} = input;
|
|
6564
6688
|
const updateElementsOwning = (elementId, updater) => {
|
|
6565
|
-
if (editTemplateMode && !
|
|
6689
|
+
if (editTemplateMode && !chunkP2COO2QO_js.isTemplateElementId(elementId)) {
|
|
6566
6690
|
ops.updateSlides(
|
|
6567
6691
|
(prev) => prev.map(
|
|
6568
6692
|
(slide, index) => index === activeSlideIndex ? { ...slide, elements: updater(slide.elements) } : slide
|
|
@@ -6596,9 +6720,9 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6596
6720
|
return;
|
|
6597
6721
|
}
|
|
6598
6722
|
const group = selectedElement;
|
|
6599
|
-
const intoTemplate =
|
|
6723
|
+
const intoTemplate = chunkP2COO2QO_js.isTemplateElementId(group.id);
|
|
6600
6724
|
const childIds = group.children.map(
|
|
6601
|
-
(child) => intoTemplate ?
|
|
6725
|
+
(child) => intoTemplate ? chunkP2COO2QO_js.makeCloneId(true, child.id || group.id) : child.id || pptx.generateElementId()
|
|
6602
6726
|
);
|
|
6603
6727
|
const { elements, childIds: usedIds } = pptx.ungroupElements(
|
|
6604
6728
|
ops.activeElements,
|
|
@@ -7034,7 +7158,7 @@ function createTableMergeHandlers(input) {
|
|
|
7034
7158
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
7035
7159
|
return;
|
|
7036
7160
|
}
|
|
7037
|
-
const newTableData =
|
|
7161
|
+
const newTableData = chunkP2COO2QO_js.mergeCells(
|
|
7038
7162
|
[
|
|
7039
7163
|
{ row: rowIndex, col: columnIndex },
|
|
7040
7164
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -7042,7 +7166,7 @@ function createTableMergeHandlers(input) {
|
|
|
7042
7166
|
td
|
|
7043
7167
|
);
|
|
7044
7168
|
const updates = { tableData: newTableData };
|
|
7045
|
-
const newRawXml =
|
|
7169
|
+
const newRawXml = chunkP2COO2QO_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7046
7170
|
if (newRawXml) {
|
|
7047
7171
|
updates.rawXml = newRawXml;
|
|
7048
7172
|
}
|
|
@@ -7068,7 +7192,7 @@ function createTableMergeHandlers(input) {
|
|
|
7068
7192
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
7069
7193
|
return;
|
|
7070
7194
|
}
|
|
7071
|
-
const newTableData =
|
|
7195
|
+
const newTableData = chunkP2COO2QO_js.mergeCells(
|
|
7072
7196
|
[
|
|
7073
7197
|
{ row: rowIndex, col: columnIndex },
|
|
7074
7198
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -7076,7 +7200,7 @@ function createTableMergeHandlers(input) {
|
|
|
7076
7200
|
td
|
|
7077
7201
|
);
|
|
7078
7202
|
const updates = { tableData: newTableData };
|
|
7079
|
-
const newRawXml =
|
|
7203
|
+
const newRawXml = chunkP2COO2QO_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7080
7204
|
if (newRawXml) {
|
|
7081
7205
|
updates.rawXml = newRawXml;
|
|
7082
7206
|
}
|
|
@@ -7091,9 +7215,9 @@ function createTableMergeHandlers(input) {
|
|
|
7091
7215
|
return;
|
|
7092
7216
|
}
|
|
7093
7217
|
const td = selectedElement.tableData;
|
|
7094
|
-
const newTableData =
|
|
7218
|
+
const newTableData = chunkP2COO2QO_js.mergeCells(ts.selectedCells, td);
|
|
7095
7219
|
const updates = { tableData: newTableData };
|
|
7096
|
-
const newRawXml =
|
|
7220
|
+
const newRawXml = chunkP2COO2QO_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7097
7221
|
if (newRawXml) {
|
|
7098
7222
|
updates.rawXml = newRawXml;
|
|
7099
7223
|
}
|
|
@@ -7110,9 +7234,9 @@ function createTableMergeHandlers(input) {
|
|
|
7110
7234
|
}
|
|
7111
7235
|
const { rowIndex, columnIndex } = ts;
|
|
7112
7236
|
const td = selectedElement.tableData;
|
|
7113
|
-
const newTableData =
|
|
7237
|
+
const newTableData = chunkP2COO2QO_js.splitCell(rowIndex, columnIndex, td);
|
|
7114
7238
|
const updates = { tableData: newTableData };
|
|
7115
|
-
const newRawXml =
|
|
7239
|
+
const newRawXml = chunkP2COO2QO_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7116
7240
|
if (newRawXml) {
|
|
7117
7241
|
updates.rawXml = newRawXml;
|
|
7118
7242
|
}
|
|
@@ -7147,7 +7271,7 @@ function createTableStructHandlers(input) {
|
|
|
7147
7271
|
updates.tableData = pptx.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
7148
7272
|
}
|
|
7149
7273
|
if (el.rawXml) {
|
|
7150
|
-
const newRawXml =
|
|
7274
|
+
const newRawXml = chunkP2COO2QO_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
7151
7275
|
if (newRawXml) {
|
|
7152
7276
|
updates.rawXml = newRawXml;
|
|
7153
7277
|
}
|
|
@@ -7171,7 +7295,7 @@ function createTableStructHandlers(input) {
|
|
|
7171
7295
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
7172
7296
|
const updates = {};
|
|
7173
7297
|
if (selectedElement.rawXml) {
|
|
7174
|
-
const newRawXml =
|
|
7298
|
+
const newRawXml = chunkP2COO2QO_js.updateCellTextStyleInRawXml(
|
|
7175
7299
|
selectedElement,
|
|
7176
7300
|
rowIndex,
|
|
7177
7301
|
colIndex,
|
|
@@ -7349,7 +7473,7 @@ function useExportSaveAs(input) {
|
|
|
7349
7473
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7350
7474
|
const slideSize = pptx.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7351
7475
|
const data = {
|
|
7352
|
-
slides:
|
|
7476
|
+
slides: chunkP2COO2QO_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7353
7477
|
width: canvasSize.width,
|
|
7354
7478
|
height: canvasSize.height,
|
|
7355
7479
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7512,7 +7636,7 @@ async function captureSlidesAsPngDataUrls(slideStageRef, slideIndices, setActive
|
|
|
7512
7636
|
}
|
|
7513
7637
|
function tilesToPdfPage(tilesResult) {
|
|
7514
7638
|
return tilesResult.tiles.map((tile) => ({
|
|
7515
|
-
image:
|
|
7639
|
+
image: chunkP2COO2QO_js.canvasToJpegData(tile.canvas),
|
|
7516
7640
|
placement: pptx.placeTileOnPage(
|
|
7517
7641
|
tile,
|
|
7518
7642
|
tilesResult.fullWidth,
|
|
@@ -7545,7 +7669,7 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7545
7669
|
if (pages.length === 0) {
|
|
7546
7670
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7547
7671
|
}
|
|
7548
|
-
const pdfBlobUrl =
|
|
7672
|
+
const pdfBlobUrl = chunkP2COO2QO_js.buildPdfFromTiledImageData(pages);
|
|
7549
7673
|
pptx.downloadDataUrl(pdfBlobUrl, filename);
|
|
7550
7674
|
}
|
|
7551
7675
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
@@ -7575,7 +7699,7 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7575
7699
|
if (pages.length === 0) {
|
|
7576
7700
|
throw new Error(i18n.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7577
7701
|
}
|
|
7578
|
-
const pdfDataUrl =
|
|
7702
|
+
const pdfDataUrl = chunkP2COO2QO_js.buildNotesPdf(pages);
|
|
7579
7703
|
pptx.downloadDataUrl(pdfDataUrl, filename);
|
|
7580
7704
|
}
|
|
7581
7705
|
async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
@@ -8153,13 +8277,13 @@ function usePrintHandlers(input) {
|
|
|
8153
8277
|
const { slides, activeSlideIndex, canvasStageRef, setActiveSlideIndex, canvasSize } = input;
|
|
8154
8278
|
const handoutMaster = input.handoutMaster ?? input.pptxData?.handoutMaster;
|
|
8155
8279
|
const [isPrintDialogOpen, setIsPrintDialogOpen] = React17.useState(false);
|
|
8156
|
-
const { t } =
|
|
8280
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
8157
8281
|
const viewerOptions = useViewerOptionsContext();
|
|
8158
8282
|
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * pptx.resolveImageResolutionScale(viewerOptions);
|
|
8159
8283
|
const handlePrint = () => {
|
|
8160
8284
|
setIsPrintDialogOpen(true);
|
|
8161
8285
|
};
|
|
8162
|
-
const deckSlides = () => input.templateElementsBySlideId ?
|
|
8286
|
+
const deckSlides = () => input.templateElementsBySlideId ? chunkP2COO2QO_js.buildSaveSlides(slides, input.templateElementsBySlideId) : slides;
|
|
8163
8287
|
const plan = (settings, deck) => pptx.planPrintJob(settings, {
|
|
8164
8288
|
slides: deck,
|
|
8165
8289
|
activeSlideIndex,
|
|
@@ -8574,7 +8698,7 @@ function usePropertyHandlers(input) {
|
|
|
8574
8698
|
width: canvasSize.width,
|
|
8575
8699
|
height: canvasSize.height
|
|
8576
8700
|
};
|
|
8577
|
-
setCompareResult(
|
|
8701
|
+
setCompareResult(chunkP2COO2QO_js.comparePresentation(cur, other));
|
|
8578
8702
|
setIsComparePanelOpen(true);
|
|
8579
8703
|
} catch (err) {
|
|
8580
8704
|
console.warn("Compare failed:", err);
|
|
@@ -8627,7 +8751,7 @@ function usePropertyHandlers(input) {
|
|
|
8627
8751
|
};
|
|
8628
8752
|
}
|
|
8629
8753
|
function useDialogCustomShows(input) {
|
|
8630
|
-
const { t } =
|
|
8754
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
8631
8755
|
const {
|
|
8632
8756
|
activeSlide,
|
|
8633
8757
|
customShows,
|
|
@@ -8952,7 +9076,7 @@ function useViewerDialogs(input) {
|
|
|
8952
9076
|
};
|
|
8953
9077
|
}
|
|
8954
9078
|
function computeGridSpacingPx(documentGridSpacing) {
|
|
8955
|
-
return pptx.computeGridSpacingPx(documentGridSpacing,
|
|
9079
|
+
return pptx.computeGridSpacingPx(documentGridSpacing, chunkP2COO2QO_js.GRID_SIZE);
|
|
8956
9080
|
}
|
|
8957
9081
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8958
9082
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
@@ -8961,7 +9085,7 @@ function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, pre
|
|
|
8961
9085
|
}
|
|
8962
9086
|
function computeSlideSectionGroups(slides, sections) {
|
|
8963
9087
|
return pptx.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8964
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
9088
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkP2COO2QO_js.UNGROUPED_SECTION_ID : chunkP2COO2QO_js.DEFAULT_SECTION_GROUP_ID),
|
|
8965
9089
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8966
9090
|
slideIndexes: group.slideIndexes,
|
|
8967
9091
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8980,7 +9104,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8980
9104
|
});
|
|
8981
9105
|
}
|
|
8982
9106
|
function useDerivedSlideState(input) {
|
|
8983
|
-
const { t } =
|
|
9107
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
8984
9108
|
const {
|
|
8985
9109
|
slides,
|
|
8986
9110
|
sections,
|
|
@@ -9006,10 +9130,10 @@ function useDerivedSlideState(input) {
|
|
|
9006
9130
|
);
|
|
9007
9131
|
const slideSectionGroups = React17.useMemo(
|
|
9008
9132
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
9009
|
-
if (group.id ===
|
|
9133
|
+
if (group.id === chunkP2COO2QO_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
9010
9134
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
9011
9135
|
}
|
|
9012
|
-
if (group.id ===
|
|
9136
|
+
if (group.id === chunkP2COO2QO_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
9013
9137
|
return { ...group, label: t("pptx.sections.slides") };
|
|
9014
9138
|
}
|
|
9015
9139
|
return group;
|
|
@@ -9116,7 +9240,7 @@ function useAnnotationHandlers(input) {
|
|
|
9116
9240
|
if (nextMode === "present") {
|
|
9117
9241
|
presentation.enterPresentMode();
|
|
9118
9242
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
9119
|
-
|
|
9243
|
+
chunkP2COO2QO_js.stopAllPersistentAudio();
|
|
9120
9244
|
if (promptKeepInkAnnotations) {
|
|
9121
9245
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
9122
9246
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -9126,7 +9250,7 @@ function useAnnotationHandlers(input) {
|
|
|
9126
9250
|
}
|
|
9127
9251
|
} else {
|
|
9128
9252
|
if (mode === "present") {
|
|
9129
|
-
|
|
9253
|
+
chunkP2COO2QO_js.stopAllPersistentAudio();
|
|
9130
9254
|
}
|
|
9131
9255
|
setMode(nextMode);
|
|
9132
9256
|
}
|
|
@@ -9294,7 +9418,7 @@ function useSerialize(input) {
|
|
|
9294
9418
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
9295
9419
|
};
|
|
9296
9420
|
});
|
|
9297
|
-
const slidesToSave =
|
|
9421
|
+
const slidesToSave = chunkP2COO2QO_js.buildSaveSlides(slidesWithGuides, pending.templateElementsBySlideId);
|
|
9298
9422
|
const saveOptions = pptx.buildDeckSaveOptions({
|
|
9299
9423
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
9300
9424
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
@@ -9439,7 +9563,7 @@ function usePresentationSetup(input) {
|
|
|
9439
9563
|
return;
|
|
9440
9564
|
}
|
|
9441
9565
|
if (mode === "present" && nextMode !== "present") {
|
|
9442
|
-
|
|
9566
|
+
chunkP2COO2QO_js.stopAllPersistentAudio();
|
|
9443
9567
|
stopAnimationSound();
|
|
9444
9568
|
const exitHandler = exitModeHandlerRef.current;
|
|
9445
9569
|
if (exitHandler) {
|
|
@@ -9560,7 +9684,7 @@ function useCanvasImagePaste(input) {
|
|
|
9560
9684
|
);
|
|
9561
9685
|
}
|
|
9562
9686
|
function formatPatchFor(element, format) {
|
|
9563
|
-
const updated =
|
|
9687
|
+
const updated = chunkP2COO2QO_js.applyFormatToElement(element, format);
|
|
9564
9688
|
const updates = {};
|
|
9565
9689
|
if (pptx$1.hasShapeProperties(updated)) {
|
|
9566
9690
|
updates.shapeStyle = updated.shapeStyle;
|
|
@@ -9583,7 +9707,7 @@ function useFormatPainterEditing(input) {
|
|
|
9583
9707
|
const prevFormatPainterRef = React17.useRef(false);
|
|
9584
9708
|
React17.useEffect(() => {
|
|
9585
9709
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9586
|
-
copiedFormatRef.current =
|
|
9710
|
+
copiedFormatRef.current = chunkP2COO2QO_js.copyFormatFromElement(selectedElement);
|
|
9587
9711
|
} else if (!formatPainterActive) {
|
|
9588
9712
|
copiedFormatRef.current = null;
|
|
9589
9713
|
}
|
|
@@ -10110,125 +10234,6 @@ function useIOHandlers(input) {
|
|
|
10110
10234
|
});
|
|
10111
10235
|
return { exportHandlers, printHandlers, themeHandlers, propertyHandlers };
|
|
10112
10236
|
}
|
|
10113
|
-
var EMBEDDED_FONTS_STYLE_ID = "pptx-embedded-fonts";
|
|
10114
|
-
var GOOGLE_FONTS_LINK_ID = "pptx-google-fonts";
|
|
10115
|
-
var SYMBOL_FONTS_STYLE_ID = "pptx-symbol-font-fallback";
|
|
10116
|
-
var SYMBOL_FONT_FAMILIES = [
|
|
10117
|
-
"Wingdings",
|
|
10118
|
-
"Wingdings 2",
|
|
10119
|
-
"Wingdings 3",
|
|
10120
|
-
"Symbol",
|
|
10121
|
-
"Webdings"
|
|
10122
|
-
];
|
|
10123
|
-
var FONT_NAME_UNSAFE_CHARS = /["\\\n\r;}<>]/u;
|
|
10124
|
-
function useFontInjection({
|
|
10125
|
-
embeddedFonts,
|
|
10126
|
-
slides,
|
|
10127
|
-
googleFonts
|
|
10128
|
-
}) {
|
|
10129
|
-
const googleFontsBase = pptx.resolveGoogleFontsCss2Base(googleFonts);
|
|
10130
|
-
React17.useEffect(() => {
|
|
10131
|
-
if (!embeddedFonts.length) {
|
|
10132
|
-
return;
|
|
10133
|
-
}
|
|
10134
|
-
const sheet = pptx.createEmbeddedFontsSheet(document, EMBEDDED_FONTS_STYLE_ID);
|
|
10135
|
-
sheet.set(embeddedFonts);
|
|
10136
|
-
return () => sheet.dispose();
|
|
10137
|
-
}, [embeddedFonts]);
|
|
10138
|
-
const referencedFamilies = React17.useMemo(() => pptx.collectReferencedFontFamilies(slides), [slides]);
|
|
10139
|
-
React17.useEffect(() => {
|
|
10140
|
-
let cancelled = false;
|
|
10141
|
-
void pptx.resolveGoogleWebfontHref(slides, embeddedFonts, void 0, googleFontsBase).then(
|
|
10142
|
-
(href) => {
|
|
10143
|
-
if (cancelled) {
|
|
10144
|
-
return null;
|
|
10145
|
-
}
|
|
10146
|
-
pptx.syncGoogleWebfontStylesheet(document, GOOGLE_FONTS_LINK_ID, href);
|
|
10147
|
-
return href;
|
|
10148
|
-
}
|
|
10149
|
-
);
|
|
10150
|
-
return () => {
|
|
10151
|
-
cancelled = true;
|
|
10152
|
-
};
|
|
10153
|
-
}, [embeddedFonts, slides, googleFontsBase]);
|
|
10154
|
-
React17.useEffect(() => () => document.getElementById(GOOGLE_FONTS_LINK_ID)?.remove(), []);
|
|
10155
|
-
const [, setOutlineFontsTick] = React17.useState(0);
|
|
10156
|
-
React17.useEffect(() => {
|
|
10157
|
-
let cancelled = false;
|
|
10158
|
-
const referenced = pptx.collectReferencedFontFamilies(slides);
|
|
10159
|
-
const candidates = pptx.selectGoogleWebfontFamilies(
|
|
10160
|
-
referenced,
|
|
10161
|
-
pptx.selectTrustedEmbeddedFonts(embeddedFonts).map((font) => font.name)
|
|
10162
|
-
);
|
|
10163
|
-
if (candidates.length === 0) {
|
|
10164
|
-
return;
|
|
10165
|
-
}
|
|
10166
|
-
void pptx.resolveGoogleWebfontHref(slides, embeddedFonts, void 0, googleFontsBase).then(
|
|
10167
|
-
async (href) => {
|
|
10168
|
-
if (cancelled || !href) {
|
|
10169
|
-
return;
|
|
10170
|
-
}
|
|
10171
|
-
const boldItalicVariants = [
|
|
10172
|
-
{ bold: false, italic: false },
|
|
10173
|
-
{ bold: true, italic: false }
|
|
10174
|
-
];
|
|
10175
|
-
let registeredAny = false;
|
|
10176
|
-
for (const family of candidates) {
|
|
10177
|
-
for (const variant of boldItalicVariants) {
|
|
10178
|
-
if (cancelled) {
|
|
10179
|
-
return;
|
|
10180
|
-
}
|
|
10181
|
-
const bytes = await pptx.fetchGoogleWebfontOutlineBytes(
|
|
10182
|
-
href,
|
|
10183
|
-
family,
|
|
10184
|
-
variant.bold,
|
|
10185
|
-
variant.italic,
|
|
10186
|
-
fetch
|
|
10187
|
-
);
|
|
10188
|
-
if (bytes && glyphOutlineFontCache.registerFontBytes(family, variant.bold, variant.italic, bytes)) {
|
|
10189
|
-
registeredAny = true;
|
|
10190
|
-
}
|
|
10191
|
-
}
|
|
10192
|
-
}
|
|
10193
|
-
if (registeredAny && !cancelled) {
|
|
10194
|
-
setOutlineFontsTick((tick) => tick + 1);
|
|
10195
|
-
}
|
|
10196
|
-
return void 0;
|
|
10197
|
-
}
|
|
10198
|
-
);
|
|
10199
|
-
return () => {
|
|
10200
|
-
cancelled = true;
|
|
10201
|
-
};
|
|
10202
|
-
}, [embeddedFonts, slides, googleFontsBase]);
|
|
10203
|
-
React17.useEffect(() => {
|
|
10204
|
-
const neededSymbolFonts = SYMBOL_FONT_FAMILIES.filter((f) => referencedFamilies.has(f));
|
|
10205
|
-
if (neededSymbolFonts.length === 0) {
|
|
10206
|
-
return;
|
|
10207
|
-
}
|
|
10208
|
-
const styleEl = document.createElement("style");
|
|
10209
|
-
styleEl.id = SYMBOL_FONTS_STYLE_ID;
|
|
10210
|
-
const rules = neededSymbolFonts.flatMap((font) => {
|
|
10211
|
-
if (typeof font !== "string" || FONT_NAME_UNSAFE_CHARS.test(font)) {
|
|
10212
|
-
return [];
|
|
10213
|
-
}
|
|
10214
|
-
return [
|
|
10215
|
-
`@font-face {
|
|
10216
|
-
font-family: "${font}";
|
|
10217
|
-
src: local("${font}"), local("${font} Regular");
|
|
10218
|
-
font-display: swap;
|
|
10219
|
-
}`
|
|
10220
|
-
];
|
|
10221
|
-
}).join("\n");
|
|
10222
|
-
styleEl.textContent = rules;
|
|
10223
|
-
document.head.appendChild(styleEl);
|
|
10224
|
-
return () => {
|
|
10225
|
-
const existing = document.getElementById(SYMBOL_FONTS_STYLE_ID);
|
|
10226
|
-
if (existing) {
|
|
10227
|
-
document.head.removeChild(existing);
|
|
10228
|
-
}
|
|
10229
|
-
};
|
|
10230
|
-
}, [referencedFamilies]);
|
|
10231
|
-
}
|
|
10232
10237
|
function useContentLifecycle(input) {
|
|
10233
10238
|
const {
|
|
10234
10239
|
content,
|
|
@@ -10295,6 +10300,8 @@ function useContentLifecycle(input) {
|
|
|
10295
10300
|
setModifyVerifier,
|
|
10296
10301
|
setCompatToasts,
|
|
10297
10302
|
setLoading: state.setLoading,
|
|
10303
|
+
setFontProgress: state.setFontProgress,
|
|
10304
|
+
googleFonts,
|
|
10298
10305
|
setError: state.setError,
|
|
10299
10306
|
setIsDirty: state.setIsDirty,
|
|
10300
10307
|
setIsEncrypted: setIsEncryptedDialogOpen,
|
|
@@ -11172,7 +11179,7 @@ function useCollaborationWriteBack(input) {
|
|
|
11172
11179
|
getSourceBytes: () => latest.current.getSourceBytes?.() ?? null,
|
|
11173
11180
|
getSaveOptions: () => latest.current.getSaveOptions?.(),
|
|
11174
11181
|
getTemplateElements: () => latest.current.templateElementsBySlideId,
|
|
11175
|
-
mergeTemplateElements:
|
|
11182
|
+
mergeTemplateElements: chunkP2COO2QO_js.buildSaveSlides,
|
|
11176
11183
|
onWriteBackStatus: () => latest.current.onWriteBackStatus?.(
|
|
11177
11184
|
pptx.writeBackReport(latest.current.config, created.getState())
|
|
11178
11185
|
)
|
|
@@ -11729,8 +11736,8 @@ function useTouchGestures(input) {
|
|
|
11729
11736
|
}
|
|
11730
11737
|
const recognizer = pptx.createTouchGestureRecognizer({
|
|
11731
11738
|
getScale: () => scaleRef.current,
|
|
11732
|
-
minScale:
|
|
11733
|
-
maxScale:
|
|
11739
|
+
minScale: chunkP2COO2QO_js.MIN_ZOOM_SCALE,
|
|
11740
|
+
maxScale: chunkP2COO2QO_js.MAX_ZOOM_SCALE,
|
|
11734
11741
|
callbacks: {
|
|
11735
11742
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
11736
11743
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -11866,9 +11873,9 @@ function buildCanvasProps(input) {
|
|
|
11866
11873
|
}
|
|
11867
11874
|
};
|
|
11868
11875
|
const handleHyperlinkClick = (url, target) => {
|
|
11869
|
-
if (
|
|
11876
|
+
if (chunkP2COO2QO_js.isPpactionUrl(url)) {
|
|
11870
11877
|
if (mode === "present") {
|
|
11871
|
-
const parsed =
|
|
11878
|
+
const parsed = chunkP2COO2QO_js.parsePpactionUrl(url);
|
|
11872
11879
|
if (parsed) {
|
|
11873
11880
|
presentation.handlePresentationAction({
|
|
11874
11881
|
action: parsed.action,
|
|
@@ -12360,7 +12367,7 @@ function buildToolbarProps(input) {
|
|
|
12360
12367
|
markDirty: history.markDirty
|
|
12361
12368
|
}),
|
|
12362
12369
|
formatPainterActive: s.formatPainterActive,
|
|
12363
|
-
canActivateFormatPainter:
|
|
12370
|
+
canActivateFormatPainter: chunkP2COO2QO_js.hasCopyableFormat(selectedElement),
|
|
12364
12371
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
12365
12372
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
12366
12373
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -12885,17 +12892,20 @@ function useViewPreferencesSync(input) {
|
|
|
12885
12892
|
function useViewerBuildingBlocksState(input) {
|
|
12886
12893
|
const { core, content, canEdit, filePath, autosaveEnabled, userName, handle, setContent } = input;
|
|
12887
12894
|
const { initialSlide, googleFonts, listConversionScope, allowExternalContent, limits } = input;
|
|
12888
|
-
const
|
|
12895
|
+
const hostLockedRef = React17.useRef(false);
|
|
12889
12896
|
const { optionsStore } = core;
|
|
12897
|
+
const fontDownloadLock = pptx.hostFontDownloadLock(googleFonts);
|
|
12890
12898
|
React17.useLayoutEffect(() => {
|
|
12891
|
-
|
|
12899
|
+
const anyLock = allowExternalContent !== void 0 || fontDownloadLock !== void 0;
|
|
12900
|
+
if (!anyLock && !hostLockedRef.current) {
|
|
12892
12901
|
return;
|
|
12893
12902
|
}
|
|
12894
|
-
|
|
12903
|
+
hostLockedRef.current = anyLock;
|
|
12904
|
+
const locked = pptx.lockExternalContentSetting({}, allowExternalContent);
|
|
12895
12905
|
optionsStore.setConstraints({
|
|
12896
|
-
locked: pptx.
|
|
12906
|
+
locked: fontDownloadLock === void 0 ? locked : { ...locked, [pptx.FONT_DOWNLOAD_SETTING_ID]: fontDownloadLock }
|
|
12897
12907
|
});
|
|
12898
|
-
}, [optionsStore, allowExternalContent]);
|
|
12908
|
+
}, [optionsStore, allowExternalContent, fontDownloadLock]);
|
|
12899
12909
|
const {
|
|
12900
12910
|
onContentChange,
|
|
12901
12911
|
onDirtyChange,
|
|
@@ -12997,7 +13007,8 @@ function useViewerBuildingBlocksState(input) {
|
|
|
12997
13007
|
filePath,
|
|
12998
13008
|
autosaveEnabled,
|
|
12999
13009
|
initialSlide,
|
|
13000
|
-
googleFonts,
|
|
13010
|
+
// Host `googleFonts` first, else Trust Center > "Download fonts", as in `PowerPointViewer`.
|
|
13011
|
+
googleFonts: pptx.resolveEffectiveGoogleFonts(googleFonts, viewerOptions),
|
|
13001
13012
|
limits,
|
|
13002
13013
|
// Trust Center > "Allow external content": same gate `PowerPointViewer`
|
|
13003
13014
|
// applies, so the headless building-blocks API loads http(s) images
|
|
@@ -13085,7 +13096,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
13085
13096
|
} = input;
|
|
13086
13097
|
const collaborationConfig = pptx.resolveCollaborationConfig(input.collaboration);
|
|
13087
13098
|
const [collaborationReadOnly, setCollaborationReadOnly] = React17.useState(Boolean(collaborationConfig));
|
|
13088
|
-
const { t } =
|
|
13099
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
13089
13100
|
const [content, setContent] = React17.useState(incomingContent ?? null);
|
|
13090
13101
|
const [loadOrigin, setLoadOrigin] = React17.useState("bootstrap");
|
|
13091
13102
|
React17.useEffect(() => {
|
|
@@ -13287,23 +13298,23 @@ function ColorChangedImage({
|
|
|
13287
13298
|
className,
|
|
13288
13299
|
alt
|
|
13289
13300
|
}) {
|
|
13290
|
-
const tolerance = tolerancePct ??
|
|
13291
|
-
const cacheKey =
|
|
13301
|
+
const tolerance = tolerancePct ?? chunkP2COO2QO_js.DEFAULT_COLOR_CHANGE_TOLERANCE;
|
|
13302
|
+
const cacheKey = chunkP2COO2QO_js.buildCacheKey(
|
|
13292
13303
|
src,
|
|
13293
13304
|
clrChange.clrFrom,
|
|
13294
13305
|
clrChange.clrTo,
|
|
13295
13306
|
tolerance,
|
|
13296
13307
|
Boolean(clrChange.clrToTransparent)
|
|
13297
13308
|
);
|
|
13298
|
-
const cached =
|
|
13309
|
+
const cached = chunkP2COO2QO_js.getCachedResult(cacheKey);
|
|
13299
13310
|
const [processedSrc, setProcessedSrc] = React17.useState(cached ?? null);
|
|
13300
13311
|
React17.useEffect(() => {
|
|
13301
|
-
if (
|
|
13302
|
-
setProcessedSrc(
|
|
13312
|
+
if (chunkP2COO2QO_js.getCachedResult(cacheKey)) {
|
|
13313
|
+
setProcessedSrc(chunkP2COO2QO_js.getCachedResult(cacheKey) ?? null);
|
|
13303
13314
|
return;
|
|
13304
13315
|
}
|
|
13305
13316
|
let cancelled = false;
|
|
13306
|
-
|
|
13317
|
+
chunkP2COO2QO_js.applyColorChange(
|
|
13307
13318
|
src,
|
|
13308
13319
|
clrChange.clrFrom,
|
|
13309
13320
|
clrChange.clrTo,
|
|
@@ -13311,7 +13322,7 @@ function ColorChangedImage({
|
|
|
13311
13322
|
Boolean(clrChange.clrToTransparent)
|
|
13312
13323
|
).then((result) => {
|
|
13313
13324
|
if (!cancelled) {
|
|
13314
|
-
|
|
13325
|
+
chunkP2COO2QO_js.setCachedResult(cacheKey, result.dataUrl);
|
|
13315
13326
|
setProcessedSrc(result.dataUrl);
|
|
13316
13327
|
}
|
|
13317
13328
|
return void 0;
|
|
@@ -13403,7 +13414,7 @@ function TiledImageLayer({
|
|
|
13403
13414
|
cancelled = true;
|
|
13404
13415
|
};
|
|
13405
13416
|
}, [src]);
|
|
13406
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...
|
|
13417
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...chunkP2COO2QO_js.getImageTilingStyle(element, nativeSize), ...style } });
|
|
13407
13418
|
}
|
|
13408
13419
|
function renderImageEffectDefinitions(element, excludeDuotone = false) {
|
|
13409
13420
|
return pptx.getImageSvgFilters(element).filter((definition) => !excludeDuotone || definition.id !== `duotone-${element.id}`).map((definition) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13472,7 +13483,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13472
13483
|
...filter ? { filter } : {},
|
|
13473
13484
|
...opacity !== void 0 ? { opacity } : {}
|
|
13474
13485
|
};
|
|
13475
|
-
if (
|
|
13486
|
+
if (chunkP2COO2QO_js.isImageTiled(el)) {
|
|
13476
13487
|
const tileSrc = imgSrc(el);
|
|
13477
13488
|
if (!tileSrc) {
|
|
13478
13489
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-gray-500 bg-gray-100", children: "Image" });
|
|
@@ -13494,9 +13505,9 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13494
13505
|
pptx$1.isImageLikeElement(el) ? el.imageEffects?.colorWash : void 0
|
|
13495
13506
|
);
|
|
13496
13507
|
const clrChange = "imageEffects" in el ? el.imageEffects?.clrChange : void 0;
|
|
13497
|
-
const duotoneColors =
|
|
13508
|
+
const duotoneColors = chunkP2COO2QO_js.getDuotoneColors(el);
|
|
13498
13509
|
const useDuotoneCanvas = Boolean(duotoneColors && !clrChange);
|
|
13499
|
-
const filterForImg = useDuotoneCanvas ?
|
|
13510
|
+
const filterForImg = useDuotoneCanvas ? chunkP2COO2QO_js.getImageEffectsFilter(el, { excludeDuotone: true }) : filter;
|
|
13500
13511
|
const canvasEffectStyles = {
|
|
13501
13512
|
...filterForImg ? { filter: filterForImg } : {},
|
|
13502
13513
|
...opacity !== void 0 ? { opacity } : {}
|
|
@@ -13572,10 +13583,10 @@ function SlideBackgroundImageLayer({
|
|
|
13572
13583
|
style: { zIndex: 0 },
|
|
13573
13584
|
children: renderImg(
|
|
13574
13585
|
backgroundElement,
|
|
13575
|
-
|
|
13576
|
-
|
|
13586
|
+
chunkP2COO2QO_js.getImageRenderStyle(backgroundElement),
|
|
13587
|
+
chunkP2COO2QO_js.getImageEffectsFilter(backgroundElement),
|
|
13577
13588
|
"",
|
|
13578
|
-
|
|
13589
|
+
chunkP2COO2QO_js.getImageEffectsOpacity(backgroundElement)
|
|
13579
13590
|
)
|
|
13580
13591
|
}
|
|
13581
13592
|
);
|
|
@@ -13846,7 +13857,7 @@ function ChartElementView({
|
|
|
13846
13857
|
onUpdateElement,
|
|
13847
13858
|
animationState
|
|
13848
13859
|
}) {
|
|
13849
|
-
const { t } =
|
|
13860
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
13850
13861
|
const wrapperRef = React17.useRef(null);
|
|
13851
13862
|
const { selection, setSelection } = useChartPartSelection();
|
|
13852
13863
|
const [titleDraft, setTitleDraft] = React17.useState(null);
|
|
@@ -13861,7 +13872,7 @@ function ChartElementView({
|
|
|
13861
13872
|
pptx.getBarFacePicturePixelSampleVersion
|
|
13862
13873
|
);
|
|
13863
13874
|
const viewModel = React17.useMemo(() => {
|
|
13864
|
-
return canEdit ?
|
|
13875
|
+
return canEdit ? chunkP2COO2QO_js.buildReactChartViewModel(element) : null;
|
|
13865
13876
|
}, [canEdit, element, barFacePictureSampleVersion]);
|
|
13866
13877
|
React17.useEffect(pptx.ensureChartInteractionStyles, []);
|
|
13867
13878
|
React17.useEffect(() => {
|
|
@@ -13966,9 +13977,9 @@ function ChartElementView({
|
|
|
13966
13977
|
textStyle: animationState?.textStyle,
|
|
13967
13978
|
onSelect: chart3D.onSelect,
|
|
13968
13979
|
onDrag: chart3D.onDrag,
|
|
13969
|
-
children:
|
|
13980
|
+
children: chunkP2COO2QO_js.renderChartElement(renderedElement, (key) => t(key))
|
|
13970
13981
|
}
|
|
13971
|
-
) :
|
|
13982
|
+
) : chunkP2COO2QO_js.renderChartElement(renderedElement, (key) => t(key)),
|
|
13972
13983
|
dragValue !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-1 right-1 z-10 rounded bg-primary/90 px-1.5 py-0.5 text-[10px] font-medium text-white pointer-events-none", children: pptx.formatAxisValue(dragValue) }),
|
|
13973
13984
|
titleDraft !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13974
13985
|
"input",
|
|
@@ -13996,7 +14007,7 @@ function ChartElementView({
|
|
|
13996
14007
|
);
|
|
13997
14008
|
}
|
|
13998
14009
|
function useActionAffordance(element, canInteract) {
|
|
13999
|
-
const { t } =
|
|
14010
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
14000
14011
|
pptx.ensureActionAffordanceStyles();
|
|
14001
14012
|
return React17.useMemo(
|
|
14002
14013
|
() => pptx.resolveElementActionAffordance(element, {
|
|
@@ -14274,7 +14285,7 @@ function ResizeHandles({
|
|
|
14274
14285
|
nonRotationTransform,
|
|
14275
14286
|
onRotate
|
|
14276
14287
|
}) {
|
|
14277
|
-
const { t } =
|
|
14288
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
14278
14289
|
const rotateRef = useRotateHandlePlacement(elementId, Boolean(onRotate));
|
|
14279
14290
|
const peStyle = forcePointerEvents ? { ...HANDLE_TOUCH_ACTION, pointerEvents: "auto" } : HANDLE_TOUCH_ACTION;
|
|
14280
14291
|
const resizeStyle = { ...HANDLE_TOUCH_ACTION, pointerEvents: "none" };
|
|
@@ -14307,7 +14318,7 @@ function ResizeHandles({
|
|
|
14307
14318
|
"aria-label": t("pptx.selectionOverlay.resize", { handle }),
|
|
14308
14319
|
"data-pptx-handle-kind": "resize",
|
|
14309
14320
|
"data-pptx-compact": true,
|
|
14310
|
-
className:
|
|
14321
|
+
className: chunkP2COO2QO_js.cn(
|
|
14311
14322
|
"absolute z-10 group border-0 bg-transparent p-0",
|
|
14312
14323
|
RESIZE_DEFAULT_CLASSES,
|
|
14313
14324
|
posClass,
|
|
@@ -14333,7 +14344,7 @@ function ResizeHandles({
|
|
|
14333
14344
|
"div",
|
|
14334
14345
|
{
|
|
14335
14346
|
"data-pptx-handle-hit": true,
|
|
14336
|
-
className:
|
|
14347
|
+
className: chunkP2COO2QO_js.cn(
|
|
14337
14348
|
"absolute -inset-px pointer-events-auto [--pptx-handle-hit-inset:-1px]",
|
|
14338
14349
|
corner ? "max-md:-inset-1.5 max-md:[--pptx-handle-hit-inset:-6px]" : "max-md:-inset-2 max-md:[--pptx-handle-hit-inset:-8px]"
|
|
14339
14350
|
),
|
|
@@ -14354,7 +14365,7 @@ function ResizeHandles({
|
|
|
14354
14365
|
"aria-label": t("pptx.selectionOverlay.rotate"),
|
|
14355
14366
|
"data-pptx-handle-kind": "rotate",
|
|
14356
14367
|
"data-pptx-compact": true,
|
|
14357
|
-
className:
|
|
14368
|
+
className: chunkP2COO2QO_js.cn(
|
|
14358
14369
|
"absolute left-1/2 top-0 -translate-x-1/2 -translate-y-1/2 z-20 border-0 bg-transparent p-0 cursor-grab active:cursor-grabbing",
|
|
14359
14370
|
ROTATE_DEFAULT_CLASSES
|
|
14360
14371
|
),
|
|
@@ -14431,10 +14442,10 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14431
14442
|
const svgHeight = Math.max(el.height, 1);
|
|
14432
14443
|
const ss = shapeEl?.shapeStyle;
|
|
14433
14444
|
const strokeWidth = Math.max(0, ss?.strokeWidth ?? 2);
|
|
14434
|
-
const strokeColor =
|
|
14435
|
-
const strokePaint =
|
|
14436
|
-
const dashType =
|
|
14437
|
-
const dashArray =
|
|
14445
|
+
const strokeColor = chunkP2COO2QO_js.normalizeHexColor(ss?.strokeColor, chunkP2COO2QO_js.DEFAULT_STROKE_COLOR);
|
|
14446
|
+
const strokePaint = chunkP2COO2QO_js.colorWithOpacity(strokeColor, ss?.strokeOpacity);
|
|
14447
|
+
const dashType = chunkP2COO2QO_js.normalizeStrokeDashType(ss?.strokeDash);
|
|
14448
|
+
const dashArray = chunkP2COO2QO_js.getSvgStrokeDasharray(
|
|
14438
14449
|
dashType,
|
|
14439
14450
|
Math.max(strokeWidth, 1),
|
|
14440
14451
|
ss?.customDashSegments,
|
|
@@ -14446,14 +14457,14 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14446
14457
|
const markerSeed = el.id.replace(/[^a-zA-Z0-9_-]/gu, "_");
|
|
14447
14458
|
const startMarkerId = `${markerSeed}-sel-start`;
|
|
14448
14459
|
const endMarkerId = `${markerSeed}-sel-end`;
|
|
14449
|
-
const compoundOffsets =
|
|
14450
|
-
const compoundWidths =
|
|
14460
|
+
const compoundOffsets = chunkP2COO2QO_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
14461
|
+
const compoundWidths = chunkP2COO2QO_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
14451
14462
|
const strokeCap = pptx.svgLineCap(ss?.lineCap, dashArray !== void 0);
|
|
14452
14463
|
const textEl = pptx$1.hasTextProperties(el) ? el : void 0;
|
|
14453
14464
|
const connectorText = textEl?.text?.trim() ?? "";
|
|
14454
14465
|
const connectorTextSegments = textEl?.textSegments;
|
|
14455
14466
|
const connectorTextStyle = textEl?.textStyle;
|
|
14456
|
-
const pathGeometry = shapeEl ?
|
|
14467
|
+
const pathGeometry = shapeEl ? chunkP2COO2QO_js.getConnectorPathGeometry(shapeEl) : {
|
|
14457
14468
|
pathData: `M 0 0 L ${viewWidth} ${viewHeight}`,
|
|
14458
14469
|
startX: 0,
|
|
14459
14470
|
startY: 0,
|
|
@@ -14461,6 +14472,12 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14461
14472
|
endY: viewHeight
|
|
14462
14473
|
};
|
|
14463
14474
|
const hitTargetWidth = Math.max(strokeWidth * 3, 14);
|
|
14475
|
+
const paintPathData = pptx.connectorSquareCapPath(
|
|
14476
|
+
pathGeometry.pathData,
|
|
14477
|
+
ss,
|
|
14478
|
+
strokeWidth,
|
|
14479
|
+
compoundOffsets.length > 1 || !!startArrow && startArrow !== "none" || !!endArrow && endArrow !== "none"
|
|
14480
|
+
) ?? pathGeometry.pathData;
|
|
14464
14481
|
const snapTransform = pptx.connectorSnapTransform(
|
|
14465
14482
|
el,
|
|
14466
14483
|
!pptx.connectorNeedsPath(shapeEl?.shapeType),
|
|
@@ -14468,16 +14485,16 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14468
14485
|
strokeWidth
|
|
14469
14486
|
);
|
|
14470
14487
|
const selColor = selClr === "blue-400" ? "#60a5fa" : "#3b82f6";
|
|
14471
|
-
const lineShadow =
|
|
14472
|
-
const lineGlow =
|
|
14488
|
+
const lineShadow = chunkP2COO2QO_js.buildLineShadowCss(el);
|
|
14489
|
+
const lineGlow = chunkP2COO2QO_js.buildLineGlowFilter(el);
|
|
14473
14490
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14474
14491
|
"div",
|
|
14475
14492
|
{
|
|
14476
14493
|
"data-pptx-element": "true",
|
|
14477
14494
|
"data-element-id": el.id,
|
|
14478
|
-
role:
|
|
14479
|
-
"aria-label":
|
|
14480
|
-
"aria-roledescription":
|
|
14495
|
+
role: chunkP2COO2QO_js.getAriaRole(el, { actionable: false }),
|
|
14496
|
+
"aria-label": chunkP2COO2QO_js.getAriaLabel(el),
|
|
14497
|
+
"aria-roledescription": chunkP2COO2QO_js.getAriaRoleDescription(el),
|
|
14481
14498
|
"aria-selected": isSelected ? true : void 0,
|
|
14482
14499
|
className: "absolute",
|
|
14483
14500
|
style: {
|
|
@@ -14510,14 +14527,14 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14510
14527
|
style: { overflow: "visible", pointerEvents: "none" },
|
|
14511
14528
|
children: [
|
|
14512
14529
|
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
14513
|
-
|
|
14530
|
+
chunkP2COO2QO_js.renderConnectorMarker(
|
|
14514
14531
|
startMarkerId,
|
|
14515
14532
|
startArrow,
|
|
14516
14533
|
strokePaint,
|
|
14517
14534
|
ss?.connectorStartArrowWidth,
|
|
14518
14535
|
ss?.connectorStartArrowLength
|
|
14519
14536
|
),
|
|
14520
|
-
|
|
14537
|
+
chunkP2COO2QO_js.renderConnectorMarker(
|
|
14521
14538
|
endMarkerId,
|
|
14522
14539
|
endArrow,
|
|
14523
14540
|
strokePaint,
|
|
@@ -14585,7 +14602,7 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17__default.default.memo
|
|
|
14585
14602
|
"path",
|
|
14586
14603
|
{
|
|
14587
14604
|
"data-pptx-line": "",
|
|
14588
|
-
d:
|
|
14605
|
+
d: paintPathData,
|
|
14589
14606
|
fill: "none",
|
|
14590
14607
|
stroke: strokePaint,
|
|
14591
14608
|
strokeWidth: Math.max(compoundWidths[idx] ?? strokeWidth, 1),
|
|
@@ -14727,14 +14744,14 @@ function getElementInteractionProps({
|
|
|
14727
14744
|
};
|
|
14728
14745
|
}
|
|
14729
14746
|
function renderDagDuotoneFilterForElement(el) {
|
|
14730
|
-
if (!
|
|
14747
|
+
if (!chunkP2COO2QO_js.hasDagDuotoneEffect(el)) {
|
|
14731
14748
|
return null;
|
|
14732
14749
|
}
|
|
14733
14750
|
const duotone = el.shapeStyle?.dagDuotone;
|
|
14734
14751
|
if (!duotone) {
|
|
14735
14752
|
return null;
|
|
14736
14753
|
}
|
|
14737
|
-
return
|
|
14754
|
+
return chunkP2COO2QO_js.renderDagDuotoneSvgFilter(el.id, duotone.color1, duotone.color2);
|
|
14738
14755
|
}
|
|
14739
14756
|
function getContainerStyle({
|
|
14740
14757
|
el,
|
|
@@ -14762,10 +14779,10 @@ function getContainerStyle({
|
|
|
14762
14779
|
top: isFullscreenMedia ? fs.top : el.y,
|
|
14763
14780
|
width: isFullscreenMedia ? fs.width : painted.width,
|
|
14764
14781
|
...heightStyle,
|
|
14765
|
-
transform: isFullscreenMedia ? fs.transform :
|
|
14782
|
+
transform: isFullscreenMedia ? fs.transform : chunkP2COO2QO_js.getElementTransform(el),
|
|
14766
14783
|
transformOrigin: "center",
|
|
14767
14784
|
overflow: overflowValue,
|
|
14768
|
-
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ?
|
|
14785
|
+
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ? chunkP2COO2QO_js.getCropShapeClipPath(el) : void 0,
|
|
14769
14786
|
zIndex: isFullscreenMedia ? fs.zIndex : zIndex,
|
|
14770
14787
|
visibility: animationState?.visible === false ? "hidden" : "visible",
|
|
14771
14788
|
animation: animationState?.cssAnimation,
|
|
@@ -14810,9 +14827,9 @@ function getContainerStyle({
|
|
|
14810
14827
|
function shapeParams(element) {
|
|
14811
14828
|
const style = pptx$1.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
14812
14829
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
14813
|
-
const strokeColor =
|
|
14814
|
-
const fillColor =
|
|
14815
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
14830
|
+
const strokeColor = chunkP2COO2QO_js.normalizeHexColor(style?.strokeColor, chunkP2COO2QO_js.DEFAULT_STROKE_COLOR);
|
|
14831
|
+
const fillColor = chunkP2COO2QO_js.normalizeHexColor(style?.fillColor, chunkP2COO2QO_js.DEFAULT_FILL_COLOR);
|
|
14832
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkP2COO2QO_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
14816
14833
|
return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
|
|
14817
14834
|
}
|
|
14818
14835
|
var Extrusion3DOverlayMemo = /* @__PURE__ */ React17__default.default.memo(
|
|
@@ -14925,14 +14942,14 @@ function ShapeEffectOverlay({
|
|
|
14925
14942
|
const hollowHit = pptx.buildHollowHitOutline(element);
|
|
14926
14943
|
const fillLayer = pptx.getSilhouetteFillLayer(element);
|
|
14927
14944
|
const overlayFill = pptx.buildSubpathFillOverlay(element);
|
|
14928
|
-
const subpathFill = overlayFill?.silhouette && (
|
|
14945
|
+
const subpathFill = overlayFill?.silhouette && (chunkP2COO2QO_js.rendersCustomVectorPath(element) || chunkP2COO2QO_js.rendersWedgeCalloutVector(element)) ? void 0 : overlayFill;
|
|
14929
14946
|
if (!overlay && !softEdge && !bevelLightingFilter && !strokeOutline && !hollowHit && !subpathFill && !fillLayer && !reflection) {
|
|
14930
14947
|
return null;
|
|
14931
14948
|
}
|
|
14932
14949
|
const fillOverlayStyle = overlay ? {
|
|
14933
14950
|
position: "absolute",
|
|
14934
14951
|
inset: 0,
|
|
14935
|
-
...pptx$1.isImageLikeElement(element) ?
|
|
14952
|
+
...pptx$1.isImageLikeElement(element) ? chunkP2COO2QO_js.getImageSurfaceMaskStyle(element) : {},
|
|
14936
14953
|
background: overlay.color,
|
|
14937
14954
|
mixBlendMode: overlay.blendMode,
|
|
14938
14955
|
pointerEvents: "none"
|
|
@@ -15151,10 +15168,10 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15151
15168
|
const backgroundAnimationState = pptx.getBackgroundAnimationState(el, presentationElementStates);
|
|
15152
15169
|
const effectPlacement = pptx.getShapeEffectLayerPlacement(el);
|
|
15153
15170
|
const visualAnimationState = backgroundAnimationState ?? animationState;
|
|
15154
|
-
const isTxt =
|
|
15171
|
+
const isTxt = chunkP2COO2QO_js.isEditableTextElement(el) && allow.textEditable;
|
|
15155
15172
|
const txtSE = pptx$1.hasTextProperties(el) ? el.textStyle : void 0;
|
|
15156
15173
|
const textStyleOverrideCss = pptx.buildTextStyleOverrideCss(el.id, visualAnimationState?.textStyle);
|
|
15157
|
-
const ss =
|
|
15174
|
+
const ss = chunkP2COO2QO_js.getShapeVisualStyle(
|
|
15158
15175
|
el,
|
|
15159
15176
|
hf,
|
|
15160
15177
|
fc,
|
|
@@ -15163,9 +15180,9 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15163
15180
|
visualAnimationState?.animatesFill,
|
|
15164
15181
|
visualAnimationState?.animatesStroke
|
|
15165
15182
|
);
|
|
15166
|
-
const ts =
|
|
15183
|
+
const ts = chunkP2COO2QO_js.getTextStyleForElement(el, chunkP2COO2QO_js.DEFAULT_TEXT_COLOR);
|
|
15167
15184
|
const isImg = el.type === "picture" || el.type === "image";
|
|
15168
|
-
const vs =
|
|
15185
|
+
const vs = chunkP2COO2QO_js.renderVectorShape(
|
|
15169
15186
|
el,
|
|
15170
15187
|
isImg ? false : hf,
|
|
15171
15188
|
fc,
|
|
@@ -15175,10 +15192,10 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15175
15192
|
visualAnimationState?.animatesStroke
|
|
15176
15193
|
);
|
|
15177
15194
|
const isModel3D = el.type === "model3d";
|
|
15178
|
-
const isConn =
|
|
15195
|
+
const isConn = chunkP2COO2QO_js.isConnectorOrLineElement(el);
|
|
15179
15196
|
const shapeStyle3d = pptx$1.hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
15180
15197
|
const extrusionData = React17.useMemo(
|
|
15181
|
-
() =>
|
|
15198
|
+
() => chunkP2COO2QO_js.build3DExtrusionData(shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height),
|
|
15182
15199
|
[shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height]
|
|
15183
15200
|
);
|
|
15184
15201
|
const actionAffordance = useActionAffordance(el, canInteract);
|
|
@@ -15269,7 +15286,7 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15269
15286
|
"aria-hidden": aria.hidden ? true : void 0,
|
|
15270
15287
|
"aria-selected": isSelected ? true : void 0,
|
|
15271
15288
|
tabIndex: isFocusable ? 0 : -1,
|
|
15272
|
-
className:
|
|
15289
|
+
className: chunkP2COO2QO_js.cn(
|
|
15273
15290
|
"absolute",
|
|
15274
15291
|
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",
|
|
15275
15292
|
cur,
|
|
@@ -15349,9 +15366,9 @@ var ElementRenderer = /* @__PURE__ */ React17__default.default.memo(
|
|
|
15349
15366
|
txtSE,
|
|
15350
15367
|
txtS: ts,
|
|
15351
15368
|
vecShape: backgroundAnimationState && !isImg ? null : vs,
|
|
15352
|
-
imgStyle:
|
|
15353
|
-
imgFilter:
|
|
15354
|
-
imgOpacity:
|
|
15369
|
+
imgStyle: chunkP2COO2QO_js.getImageRenderStyle(el),
|
|
15370
|
+
imgFilter: chunkP2COO2QO_js.getImageEffectsFilter(el),
|
|
15371
|
+
imgOpacity: chunkP2COO2QO_js.getImageEffectsOpacity(el),
|
|
15355
15372
|
imgAlt: imageAltText,
|
|
15356
15373
|
isTxtEl: isTxt,
|
|
15357
15374
|
media: mediaDataUrls,
|
|
@@ -15488,10 +15505,10 @@ function renderStrokeView(view, pressureSensitive, replayStyle, key) {
|
|
|
15488
15505
|
}
|
|
15489
15506
|
function renderInk(el, options) {
|
|
15490
15507
|
const replay = options?.replay ?? false;
|
|
15491
|
-
const strokes =
|
|
15508
|
+
const strokes = chunkP2COO2QO_js.buildInkGroupStrokes(el, { color: "#000", width: 3 });
|
|
15492
15509
|
strokes.some((s) => s.circles || s.nibMarks);
|
|
15493
15510
|
const pressureSensitive = options?.pressureSensitive;
|
|
15494
|
-
const replayStyles = replay ?
|
|
15511
|
+
const replayStyles = replay ? chunkP2COO2QO_js.getInkReplayStyles(el, options?.replayConfig) : null;
|
|
15495
15512
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15496
15513
|
"svg",
|
|
15497
15514
|
{
|
|
@@ -15499,7 +15516,7 @@ function renderInk(el, options) {
|
|
|
15499
15516
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15500
15517
|
preserveAspectRatio: "none",
|
|
15501
15518
|
children: [
|
|
15502
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15519
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkP2COO2QO_js.INK_REPLAY_KEYFRAMES }),
|
|
15503
15520
|
strokes.map(
|
|
15504
15521
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-ink-${i}`)
|
|
15505
15522
|
)
|
|
@@ -15510,7 +15527,7 @@ function renderInk(el, options) {
|
|
|
15510
15527
|
function renderGroup(children, parentGroupFill) {
|
|
15511
15528
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full pointer-events-none", children: pptx.filterRenderedElements(children).map((c, childIndex) => {
|
|
15512
15529
|
const { hf, fc, sw, sc } = shapeParams(c);
|
|
15513
|
-
const baseSs =
|
|
15530
|
+
const baseSs = chunkP2COO2QO_js.getShapeVisualStyle(c, hf, fc, sw, sc);
|
|
15514
15531
|
const inheritedFill = pptx.resolveGroupChildFill(c, parentGroupFill);
|
|
15515
15532
|
const ss = inheritedFill ? {
|
|
15516
15533
|
...baseSs,
|
|
@@ -15521,9 +15538,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15521
15538
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
15522
15539
|
} : baseSs;
|
|
15523
15540
|
const isI = c.type === "picture" || c.type === "image";
|
|
15524
|
-
const vs =
|
|
15525
|
-
const ts =
|
|
15526
|
-
const isTxt =
|
|
15541
|
+
const vs = chunkP2COO2QO_js.renderVectorShape(c, isI ? false : hf, fc, sw, sc);
|
|
15542
|
+
const ts = chunkP2COO2QO_js.getTextStyleForElement(c, chunkP2COO2QO_js.DEFAULT_TEXT_COLOR);
|
|
15543
|
+
const isTxt = chunkP2COO2QO_js.isEditableTextElement(c);
|
|
15527
15544
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15528
15545
|
"div",
|
|
15529
15546
|
{
|
|
@@ -15532,9 +15549,9 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15532
15549
|
style: {
|
|
15533
15550
|
left: c.x,
|
|
15534
15551
|
top: c.y,
|
|
15535
|
-
width: Math.max(c.width,
|
|
15536
|
-
height: Math.max(c.height,
|
|
15537
|
-
transform:
|
|
15552
|
+
width: Math.max(c.width, chunkP2COO2QO_js.MIN_ELEMENT_SIZE),
|
|
15553
|
+
height: Math.max(c.height, chunkP2COO2QO_js.MIN_ELEMENT_SIZE),
|
|
15554
|
+
transform: chunkP2COO2QO_js.getElementTransform(c),
|
|
15538
15555
|
transformOrigin: "center",
|
|
15539
15556
|
...ss,
|
|
15540
15557
|
...isI ? {
|
|
@@ -15559,8 +15576,8 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15559
15576
|
// A nested group: recurse, chaining the inherited fill so a
|
|
15560
15577
|
// `grpFill` shape under a fill-less sub-group still paints.
|
|
15561
15578
|
renderGroup(c.children, pptx.getGroupChildParentFill(c, parentGroupFill))
|
|
15562
|
-
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
15563
|
-
|
|
15579
|
+
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkP2COO2QO_js.getImageSurfaceStyle(c), children: [
|
|
15580
|
+
chunkP2COO2QO_js.isImageTiled(c) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15564
15581
|
TiledImageLayer,
|
|
15565
15582
|
{
|
|
15566
15583
|
element: c,
|
|
@@ -15573,7 +15590,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15573
15590
|
src: "svgData" in c && c.svgData ? c.svgData : c.imageData,
|
|
15574
15591
|
alt: i18n.translationsEn["pptx.ink.groupChildAlt"],
|
|
15575
15592
|
className: "pointer-events-none select-none",
|
|
15576
|
-
style:
|
|
15593
|
+
style: chunkP2COO2QO_js.getImageRenderStyle(c),
|
|
15577
15594
|
draggable: false
|
|
15578
15595
|
}
|
|
15579
15596
|
),
|
|
@@ -15585,7 +15602,7 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15585
15602
|
{
|
|
15586
15603
|
className: "relative z-10 w-full h-full pointer-events-none whitespace-pre-wrap break-words leading-[1.3]",
|
|
15587
15604
|
style: ts,
|
|
15588
|
-
children:
|
|
15605
|
+
children: chunkP2COO2QO_js.renderTextSegments(c, chunkP2COO2QO_js.DEFAULT_TEXT_COLOR)
|
|
15589
15606
|
}
|
|
15590
15607
|
) : null
|
|
15591
15608
|
] })
|
|
@@ -15599,8 +15616,8 @@ function renderContentPart(el, options) {
|
|
|
15599
15616
|
if (el.inkStrokes && el.inkStrokes.length > 0) {
|
|
15600
15617
|
const replay = options?.replay ?? false;
|
|
15601
15618
|
const pressureSensitive = options?.pressureSensitive ?? true;
|
|
15602
|
-
const strokes =
|
|
15603
|
-
const replayStyles = replay ?
|
|
15619
|
+
const strokes = chunkP2COO2QO_js.buildContentPartStrokes(el);
|
|
15620
|
+
const replayStyles = replay ? chunkP2COO2QO_js.getContentPartReplayStyles(el.inkStrokes, options?.replayConfig) : null;
|
|
15604
15621
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15605
15622
|
"svg",
|
|
15606
15623
|
{
|
|
@@ -15608,7 +15625,7 @@ function renderContentPart(el, options) {
|
|
|
15608
15625
|
viewBox: `0 0 ${Math.max(el.width, 1)} ${Math.max(el.height, 1)}`,
|
|
15609
15626
|
preserveAspectRatio: "none",
|
|
15610
15627
|
children: [
|
|
15611
|
-
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children:
|
|
15628
|
+
replay && /* @__PURE__ */ jsxRuntime.jsx("style", { children: chunkP2COO2QO_js.INK_REPLAY_KEYFRAMES }),
|
|
15612
15629
|
strokes.map(
|
|
15613
15630
|
(s, i) => renderStrokeView(s, pressureSensitive, replayStyles?.[i], `${el.id}-cp-ink-${i}`)
|
|
15614
15631
|
)
|
|
@@ -15835,9 +15852,9 @@ function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
|
15835
15852
|
collaboration: connected,
|
|
15836
15853
|
model: pptx.createInlineListModelObserver(element),
|
|
15837
15854
|
activationSelection,
|
|
15838
|
-
children: seed && !connected ?
|
|
15855
|
+
children: seed && !connected ? chunkP2COO2QO_js.renderTextSegments(
|
|
15839
15856
|
element,
|
|
15840
|
-
|
|
15857
|
+
chunkP2COO2QO_js.DEFAULT_TEXT_COLOR,
|
|
15841
15858
|
void 0,
|
|
15842
15859
|
void 0,
|
|
15843
15860
|
void 0,
|
|
@@ -16073,8 +16090,8 @@ function InlineTextEditor({
|
|
|
16073
16090
|
pending.endOffset
|
|
16074
16091
|
);
|
|
16075
16092
|
});
|
|
16076
|
-
const warpStyle =
|
|
16077
|
-
const compensationTransform =
|
|
16093
|
+
const warpStyle = chunkP2COO2QO_js.getTextWarpStyle(textStyleRaw);
|
|
16094
|
+
const compensationTransform = chunkP2COO2QO_js.getTextCompensationTransform(element);
|
|
16078
16095
|
const warpTransform = warpStyle?.transform;
|
|
16079
16096
|
const mergedTransform = [compensationTransform, warpTransform].filter(Boolean).join(" ") || void 0;
|
|
16080
16097
|
const wrapperStyle = {
|
|
@@ -16082,7 +16099,7 @@ function InlineTextEditor({
|
|
|
16082
16099
|
...textStyle,
|
|
16083
16100
|
...warpStyle,
|
|
16084
16101
|
transform: mergedTransform,
|
|
16085
|
-
transformOrigin: warpStyle?.transformOrigin || (compensationTransform ?
|
|
16102
|
+
transformOrigin: warpStyle?.transformOrigin || (compensationTransform ? chunkP2COO2QO_js.getTextCompensationOrigin(element) : "center")
|
|
16086
16103
|
};
|
|
16087
16104
|
const nextInlineStyleValue = (property) => {
|
|
16088
16105
|
if (!pptx$1.hasTextProperties(element)) {
|
|
@@ -16157,7 +16174,7 @@ function InlineTextEditor({
|
|
|
16157
16174
|
const text = e.clipboardData.getData("text/plain");
|
|
16158
16175
|
document.execCommand("insertText", false, text);
|
|
16159
16176
|
},
|
|
16160
|
-
children: list.seed ? list.children : seed.hasRichSegments ?
|
|
16177
|
+
children: list.seed ? list.children : seed.hasRichSegments ? chunkP2COO2QO_js.renderTextSegments(element, chunkP2COO2QO_js.DEFAULT_TEXT_COLOR) : seed.initialText
|
|
16161
16178
|
},
|
|
16162
16179
|
list.seed?.paragraphs[0].token ?? "plain"
|
|
16163
16180
|
);
|
|
@@ -16322,7 +16339,7 @@ function OleActionFooter({
|
|
|
16322
16339
|
info,
|
|
16323
16340
|
showActions
|
|
16324
16341
|
}) {
|
|
16325
|
-
const { t } =
|
|
16342
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
16326
16343
|
if (!showActions || !info.canDownload || !el.oleEmbeddedData) {
|
|
16327
16344
|
return null;
|
|
16328
16345
|
}
|
|
@@ -16431,7 +16448,7 @@ function SmartArtInlineNodeEditor({
|
|
|
16431
16448
|
onCommit,
|
|
16432
16449
|
onCancel
|
|
16433
16450
|
}) {
|
|
16434
|
-
const { t } =
|
|
16451
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
16435
16452
|
const ref = React17__default.default.useRef(null);
|
|
16436
16453
|
const [value, setValue] = React17__default.default.useState(initialText);
|
|
16437
16454
|
const settled = React17__default.default.useRef(false);
|
|
@@ -17059,7 +17076,7 @@ function SmartArtRendererImpl({
|
|
|
17059
17076
|
onUpdateElement,
|
|
17060
17077
|
animationState
|
|
17061
17078
|
}) {
|
|
17062
|
-
const { t } =
|
|
17079
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
17063
17080
|
if (element.type !== "smartArt" || !element.smartArtData) {
|
|
17064
17081
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17065
17082
|
"div",
|
|
@@ -17305,7 +17322,7 @@ function groupIntoParagraphs(element, fieldContext) {
|
|
|
17305
17322
|
element,
|
|
17306
17323
|
fieldContext ? (seg) => {
|
|
17307
17324
|
if (seg.fieldType) {
|
|
17308
|
-
const substituted =
|
|
17325
|
+
const substituted = chunkP2COO2QO_js.substituteFieldText(
|
|
17309
17326
|
seg.text,
|
|
17310
17327
|
seg.fieldType,
|
|
17311
17328
|
fieldContext,
|
|
@@ -17331,16 +17348,16 @@ function getAlignmentProps(align) {
|
|
|
17331
17348
|
return { startOffset: "0%", textAnchor: "start" };
|
|
17332
17349
|
}
|
|
17333
17350
|
}
|
|
17334
|
-
function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
17351
|
+
function getSegmentTspanProps(segment, element, fallbackColor, fitScale = 1) {
|
|
17335
17352
|
const paint = pptx.resolveWarpRunPaint(
|
|
17336
17353
|
segment,
|
|
17337
17354
|
element.textStyle,
|
|
17338
17355
|
fallbackColor,
|
|
17339
|
-
|
|
17356
|
+
chunkP2COO2QO_js.DEFAULT_TEXT_FONT_SIZE
|
|
17340
17357
|
);
|
|
17341
17358
|
return {
|
|
17342
17359
|
fill: paint.fill,
|
|
17343
|
-
fontSize: paint.fontSizePx,
|
|
17360
|
+
fontSize: paint.fontSizePx * fitScale,
|
|
17344
17361
|
fontWeight: paint.fontWeight ?? "normal",
|
|
17345
17362
|
fontStyle: paint.fontStyle ?? "normal",
|
|
17346
17363
|
fontFamily: paint.fontFamily,
|
|
@@ -17351,8 +17368,8 @@ function resolveSegmentFont(segment, element) {
|
|
|
17351
17368
|
const s = segment.style || {};
|
|
17352
17369
|
const family = s.fontFamily || element.textStyle?.fontFamily;
|
|
17353
17370
|
return {
|
|
17354
|
-
fontFamily: family ? pptx$1.getSubstituteFontFamily(family) :
|
|
17355
|
-
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ??
|
|
17371
|
+
fontFamily: family ? pptx$1.getSubstituteFontFamily(family) : chunkP2COO2QO_js.DEFAULT_FONT_FAMILY,
|
|
17372
|
+
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ?? chunkP2COO2QO_js.DEFAULT_TEXT_FONT_SIZE,
|
|
17356
17373
|
bold: s.bold ?? element.textStyle?.bold,
|
|
17357
17374
|
italic: s.italic ?? element.textStyle?.italic
|
|
17358
17375
|
};
|
|
@@ -17435,15 +17452,14 @@ function WarpedText({
|
|
|
17435
17452
|
if (paragraphs.length === 0) {
|
|
17436
17453
|
return null;
|
|
17437
17454
|
}
|
|
17438
|
-
const lineCount = paragraphs.length;
|
|
17439
17455
|
const pathIdPrefix = `warp-${element.id}`;
|
|
17440
17456
|
const warpAdj = textEl.textStyle?.textWarpAdj;
|
|
17441
17457
|
const warpAdj2 = textEl.textStyle?.textWarpAdj2;
|
|
17442
17458
|
const align = textEl.textStyle?.align ?? "center";
|
|
17443
17459
|
const { startOffset, textAnchor } = getAlignmentProps(align);
|
|
17444
|
-
const baseFontSize = textEl.textStyle?.fontSize ??
|
|
17445
|
-
const baseFontFamily = textEl.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(textEl.textStyle.fontFamily) :
|
|
17446
|
-
const baseFill =
|
|
17460
|
+
const baseFontSize = textEl.textStyle?.fontSize ?? chunkP2COO2QO_js.DEFAULT_TEXT_FONT_SIZE;
|
|
17461
|
+
const baseFontFamily = textEl.textStyle?.fontFamily ? pptx$1.getSubstituteFontFamily(textEl.textStyle.fontFamily) : chunkP2COO2QO_js.DEFAULT_FONT_FAMILY;
|
|
17462
|
+
const baseFill = chunkP2COO2QO_js.normalizeHexColor(textEl.textStyle?.color, fallbackColor);
|
|
17447
17463
|
if (pptx.hasGlyphEnvelope(preset)) {
|
|
17448
17464
|
const perLine = pptx.buildGlyphEnvelopeBlock(
|
|
17449
17465
|
preset,
|
|
@@ -17488,6 +17504,15 @@ function WarpedText({
|
|
|
17488
17504
|
}
|
|
17489
17505
|
);
|
|
17490
17506
|
}
|
|
17507
|
+
const layouts = pptx.warpParagraphLayouts(
|
|
17508
|
+
preset,
|
|
17509
|
+
width,
|
|
17510
|
+
height,
|
|
17511
|
+
paragraphs,
|
|
17512
|
+
warpAdj,
|
|
17513
|
+
warpAdj2,
|
|
17514
|
+
textEl.textStyle
|
|
17515
|
+
);
|
|
17491
17516
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17492
17517
|
"svg",
|
|
17493
17518
|
{
|
|
@@ -17507,7 +17532,7 @@ function WarpedText({
|
|
|
17507
17532
|
"path",
|
|
17508
17533
|
{
|
|
17509
17534
|
id: `${pathIdPrefix}-${i}`,
|
|
17510
|
-
d:
|
|
17535
|
+
d: layouts[i]?.d,
|
|
17511
17536
|
fill: "none"
|
|
17512
17537
|
},
|
|
17513
17538
|
`${pathIdPrefix}-def-${i}`
|
|
@@ -17529,7 +17554,12 @@ function WarpedText({
|
|
|
17529
17554
|
children: para.segments.map((seg, segIdx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17530
17555
|
"tspan",
|
|
17531
17556
|
{
|
|
17532
|
-
...getSegmentTspanProps(
|
|
17557
|
+
...getSegmentTspanProps(
|
|
17558
|
+
seg,
|
|
17559
|
+
textEl,
|
|
17560
|
+
fallbackColor,
|
|
17561
|
+
layouts[paraIdx]?.fitScale ?? 1
|
|
17562
|
+
),
|
|
17533
17563
|
children: seg.text
|
|
17534
17564
|
},
|
|
17535
17565
|
`${pathIdPrefix}-ts-${paraIdx}-${segIdx}`
|
|
@@ -17592,7 +17622,7 @@ function renderEquationBox(el, interactive) {
|
|
|
17592
17622
|
}
|
|
17593
17623
|
const style = pptx.buildEquationBlockStyle(
|
|
17594
17624
|
pptx.buildTextBlockStyle(el, {
|
|
17595
|
-
fallbackColor:
|
|
17625
|
+
fallbackColor: chunkP2COO2QO_js.DEFAULT_TEXT_COLOR,
|
|
17596
17626
|
bodyLayout: true,
|
|
17597
17627
|
pxLengths: true
|
|
17598
17628
|
})
|
|
@@ -17600,7 +17630,7 @@ function renderEquationBox(el, interactive) {
|
|
|
17600
17630
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17601
17631
|
"div",
|
|
17602
17632
|
{
|
|
17603
|
-
className:
|
|
17633
|
+
className: chunkP2COO2QO_js.cn("relative z-10 w-full h-full", interactive ? "" : "pointer-events-none"),
|
|
17604
17634
|
style,
|
|
17605
17635
|
children: equations
|
|
17606
17636
|
}
|
|
@@ -17626,7 +17656,7 @@ function renderTextElementBody(options) {
|
|
|
17626
17656
|
const useSvgWarp = pptx.shouldUseSvgWarp(
|
|
17627
17657
|
pptx$1.hasTextProperties(el) ? el.textStyle?.textWarpPreset : void 0
|
|
17628
17658
|
);
|
|
17629
|
-
const scene3dStyle = pptx$1.hasTextProperties(el) ?
|
|
17659
|
+
const scene3dStyle = pptx$1.hasTextProperties(el) ? chunkP2COO2QO_js.buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height }) : void 0;
|
|
17630
17660
|
const rotationTransform = pptx.getTextBodyRotationTransform(el);
|
|
17631
17661
|
const compensation = pptx.getTextCompensationStyle(el);
|
|
17632
17662
|
const composedTransform = [rotationTransform, compensation?.transform, scene3dStyle?.transform].filter(Boolean).join(" ") || void 0;
|
|
@@ -17659,18 +17689,18 @@ function renderTextElementBody(options) {
|
|
|
17659
17689
|
shouldRenderText && !equationBox && (useSvgWarp ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17660
17690
|
"div",
|
|
17661
17691
|
{
|
|
17662
|
-
className:
|
|
17692
|
+
className: chunkP2COO2QO_js.cn(
|
|
17663
17693
|
"relative z-10 w-full h-full",
|
|
17664
17694
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17665
17695
|
),
|
|
17666
|
-
style: { ...
|
|
17696
|
+
style: { ...chunkP2COO2QO_js.getTextLayoutStyle(el), ...transformStyle },
|
|
17667
17697
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17668
17698
|
WarpedText,
|
|
17669
17699
|
{
|
|
17670
17700
|
element: el,
|
|
17671
17701
|
width: el.width,
|
|
17672
17702
|
height: el.height,
|
|
17673
|
-
fallbackColor:
|
|
17703
|
+
fallbackColor: chunkP2COO2QO_js.DEFAULT_TEXT_COLOR,
|
|
17674
17704
|
findHighlights: findHl,
|
|
17675
17705
|
fieldContext
|
|
17676
17706
|
}
|
|
@@ -17679,19 +17709,19 @@ function renderTextElementBody(options) {
|
|
|
17679
17709
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17680
17710
|
"div",
|
|
17681
17711
|
{
|
|
17682
|
-
className:
|
|
17712
|
+
className: chunkP2COO2QO_js.cn(
|
|
17683
17713
|
"relative z-10 w-full h-full whitespace-pre-wrap break-words leading-[1.3]",
|
|
17684
17714
|
onHyperlinkClick ? "" : "pointer-events-none"
|
|
17685
17715
|
),
|
|
17686
17716
|
style: {
|
|
17687
|
-
...
|
|
17717
|
+
...chunkP2COO2QO_js.getTextLayoutStyle(el),
|
|
17688
17718
|
...txtS,
|
|
17689
|
-
...
|
|
17719
|
+
...chunkP2COO2QO_js.getTextWarpStyle(txtSE),
|
|
17690
17720
|
...transformStyle
|
|
17691
17721
|
},
|
|
17692
|
-
children:
|
|
17722
|
+
children: chunkP2COO2QO_js.renderTextSegments(
|
|
17693
17723
|
el,
|
|
17694
|
-
|
|
17724
|
+
chunkP2COO2QO_js.DEFAULT_TEXT_COLOR,
|
|
17695
17725
|
void 0,
|
|
17696
17726
|
findHl,
|
|
17697
17727
|
onHyperlinkClick,
|
|
@@ -17712,7 +17742,7 @@ function ZoomElementRenderer({
|
|
|
17712
17742
|
onZoomClick,
|
|
17713
17743
|
sourceSlideIndex
|
|
17714
17744
|
}) {
|
|
17715
|
-
const { t } =
|
|
17745
|
+
const { t } = chunkP2COO2QO_js.useTranslation();
|
|
17716
17746
|
const summaryView = pptx.buildSummaryZoomView(
|
|
17717
17747
|
element,
|
|
17718
17748
|
(index) => {
|
|
@@ -18010,7 +18040,7 @@ function renderBody(options) {
|
|
|
18010
18040
|
);
|
|
18011
18041
|
}
|
|
18012
18042
|
if (isImg) {
|
|
18013
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style:
|
|
18043
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 pointer-events-none", style: chunkP2COO2QO_js.getImageSurfaceStyle(el), children: [
|
|
18014
18044
|
renderImg(el, imgStyle, imgFilter, imgAlt, imgOpacity),
|
|
18015
18045
|
vecShape ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0", children: vecShape }) : null
|
|
18016
18046
|
] });
|
|
@@ -18027,7 +18057,7 @@ function renderBody(options) {
|
|
|
18027
18057
|
textDirection: txtSE?.textDirection,
|
|
18028
18058
|
textStyle: txtS,
|
|
18029
18059
|
textStyleRaw: txtSE,
|
|
18030
|
-
layoutStyle:
|
|
18060
|
+
layoutStyle: chunkP2COO2QO_js.getTextLayoutStyle(el),
|
|
18031
18061
|
element: el,
|
|
18032
18062
|
onCommit,
|
|
18033
18063
|
onCancel,
|
|
@@ -18038,7 +18068,7 @@ function renderBody(options) {
|
|
|
18038
18068
|
] });
|
|
18039
18069
|
}
|
|
18040
18070
|
if (el.type === "table") {
|
|
18041
|
-
return
|
|
18071
|
+
return chunkP2COO2QO_js.renderTableElement(el, txtS, {
|
|
18042
18072
|
editable: isSel,
|
|
18043
18073
|
selectedCell: isSel ? tableSt : null,
|
|
18044
18074
|
onSelectCell: onCellSel,
|
|
@@ -18071,7 +18101,7 @@ function renderBody(options) {
|
|
|
18071
18101
|
);
|
|
18072
18102
|
}
|
|
18073
18103
|
if (el.type === "media") {
|
|
18074
|
-
return
|
|
18104
|
+
return chunkP2COO2QO_js.renderMediaElement(el, media, {
|
|
18075
18105
|
// Present mode autoplays every media element on the active slide,
|
|
18076
18106
|
// not only ones persisted with their own `autoPlay` flag (matching
|
|
18077
18107
|
// the other four bindings' unconditional `presenting`-gated
|
|
@@ -18127,27 +18157,27 @@ function renderBody(options) {
|
|
|
18127
18157
|
}
|
|
18128
18158
|
return renderGroup(el.children, pptx.getGroupChildParentFill(el));
|
|
18129
18159
|
}
|
|
18130
|
-
if (
|
|
18131
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
18160
|
+
if (chunkP2COO2QO_js.shouldRenderFallbackLabel(el, isTxtEl)) {
|
|
18161
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkP2COO2QO_js.getElementLabel(el) });
|
|
18132
18162
|
}
|
|
18133
18163
|
return renderTextElementBody(options);
|
|
18134
18164
|
}
|
|
18135
18165
|
function defaultTextColorForFill(fillColor) {
|
|
18136
18166
|
const hex = String(fillColor ?? "").replace(/^#/u, "");
|
|
18137
18167
|
if (!/^[0-9a-f]{6}$/iu.test(hex)) {
|
|
18138
|
-
return
|
|
18168
|
+
return chunkP2COO2QO_js.DEFAULT_TEXT_COLOR;
|
|
18139
18169
|
}
|
|
18140
18170
|
const channels = [0, 2, 4].map((offset) => Number.parseInt(hex.slice(offset, offset + 2), 16) / 255).map((channel) => channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4);
|
|
18141
18171
|
const luminance = channels[0] * 0.2126 + channels[1] * 0.7152 + channels[2] * 0.0722;
|
|
18142
|
-
return luminance > 0.179 ?
|
|
18172
|
+
return luminance > 0.179 ? chunkP2COO2QO_js.DEFAULT_TEXT_COLOR : "#ffffff";
|
|
18143
18173
|
}
|
|
18144
18174
|
function getStaticElementVisualState(element, parentGroupFill) {
|
|
18145
18175
|
const style = pptx$1.hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
18146
|
-
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(
|
|
18147
|
-
const fill =
|
|
18176
|
+
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(chunkP2COO2QO_js.buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
18177
|
+
const fill = chunkP2COO2QO_js.normalizeHexColor(style?.fillColor, chunkP2COO2QO_js.DEFAULT_FILL_COLOR);
|
|
18148
18178
|
const strokeWidth = pptx.paintedStrokeWidth(style);
|
|
18149
|
-
const stroke =
|
|
18150
|
-
const baseVisualStyle =
|
|
18179
|
+
const stroke = chunkP2COO2QO_js.normalizeHexColor(style?.strokeColor, chunkP2COO2QO_js.DEFAULT_STROKE_COLOR);
|
|
18180
|
+
const baseVisualStyle = chunkP2COO2QO_js.getShapeVisualStyle(element, hasFill, fill, strokeWidth, stroke);
|
|
18151
18181
|
const inheritedFill = pptx.resolveGroupChildFill(element, parentGroupFill);
|
|
18152
18182
|
const visualStyle = inheritedFill ? {
|
|
18153
18183
|
...baseVisualStyle,
|
|
@@ -18157,9 +18187,9 @@ function getStaticElementVisualState(element, parentGroupFill) {
|
|
|
18157
18187
|
backgroundSize: inheritedFill.backgroundSize,
|
|
18158
18188
|
backgroundPosition: inheritedFill.backgroundPosition
|
|
18159
18189
|
} : baseVisualStyle;
|
|
18160
|
-
const textStyle =
|
|
18190
|
+
const textStyle = chunkP2COO2QO_js.getTextStyleForElement(
|
|
18161
18191
|
element,
|
|
18162
|
-
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) :
|
|
18192
|
+
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) : chunkP2COO2QO_js.DEFAULT_TEXT_COLOR
|
|
18163
18193
|
);
|
|
18164
18194
|
const isImage = element.type === "picture" || element.type === "image";
|
|
18165
18195
|
const letsTextOverflow = pptx$1.hasTextProperties(element) && Boolean(element.text?.trim());
|
|
@@ -18184,7 +18214,7 @@ function getStaticElementInteractionState(element, hasActionHandler, exposeEleme
|
|
|
18184
18214
|
return { action, isActionable, contractRole };
|
|
18185
18215
|
}
|
|
18186
18216
|
function getStaticElementWrapperClassName(element, visual, positioned, isActionable) {
|
|
18187
|
-
const overflowClass = visual.isImage || visual.strokeWidth > 0 || element.type === "group" ||
|
|
18217
|
+
const overflowClass = visual.isImage || visual.strokeWidth > 0 || element.type === "group" || chunkP2COO2QO_js.isConnectorOrLineElement(element) || visual.isCallout || visual.letsTextOverflow ? "" : "overflow-hidden";
|
|
18188
18218
|
const pointerClass = isActionable ? "pointer-events-auto cursor-pointer" : "pointer-events-none";
|
|
18189
18219
|
return `${positioned ? "absolute" : "relative"} ${overflowClass} ${pointerClass}`;
|
|
18190
18220
|
}
|
|
@@ -18267,7 +18297,7 @@ function StaticElementRendererImpl({
|
|
|
18267
18297
|
top: positioned ? element.y : void 0,
|
|
18268
18298
|
width: positioned ? Math.max(element.width, 1) : "100%",
|
|
18269
18299
|
height: positioned ? Math.max(element.height, 1) : "100%",
|
|
18270
|
-
transform: positioned ?
|
|
18300
|
+
transform: positioned ? chunkP2COO2QO_js.getElementTransform(element) : void 0,
|
|
18271
18301
|
transformOrigin: "center",
|
|
18272
18302
|
zIndex,
|
|
18273
18303
|
...visualStyle,
|
|
@@ -18310,18 +18340,18 @@ function StaticElementRendererImpl({
|
|
|
18310
18340
|
spellCheck: false,
|
|
18311
18341
|
txtSE: pptx$1.hasTextProperties(element) ? element.textStyle : void 0,
|
|
18312
18342
|
txtS: textStyle,
|
|
18313
|
-
vecShape:
|
|
18343
|
+
vecShape: chunkP2COO2QO_js.renderVectorShape(
|
|
18314
18344
|
element,
|
|
18315
18345
|
isImage ? false : hasFill,
|
|
18316
18346
|
fill,
|
|
18317
18347
|
strokeWidth,
|
|
18318
18348
|
stroke
|
|
18319
18349
|
),
|
|
18320
|
-
imgStyle: imageAnimation ? { ...
|
|
18321
|
-
imgFilter:
|
|
18322
|
-
imgOpacity:
|
|
18350
|
+
imgStyle: imageAnimation ? { ...chunkP2COO2QO_js.getImageRenderStyle(element), animation: imageAnimation } : chunkP2COO2QO_js.getImageRenderStyle(element),
|
|
18351
|
+
imgFilter: chunkP2COO2QO_js.getImageEffectsFilter(element),
|
|
18352
|
+
imgOpacity: chunkP2COO2QO_js.getImageEffectsOpacity(element),
|
|
18323
18353
|
imgAlt: "",
|
|
18324
|
-
isTxtEl:
|
|
18354
|
+
isTxtEl: chunkP2COO2QO_js.isEditableTextElement(element),
|
|
18325
18355
|
media: mediaDataUrls,
|
|
18326
18356
|
tableSt: null,
|
|
18327
18357
|
isSel: false,
|
|
@@ -18369,7 +18399,7 @@ function SlideLayer({
|
|
|
18369
18399
|
style: {
|
|
18370
18400
|
width: safeWidth,
|
|
18371
18401
|
height: safeHeight,
|
|
18372
|
-
backgroundColor: slide.backgroundColor ?
|
|
18402
|
+
backgroundColor: slide.backgroundColor ? chunkP2COO2QO_js.normalizeHexColor(slide.backgroundColor, "#ffffff") : "#ffffff",
|
|
18373
18403
|
backgroundImage: slide.backgroundImage ? `url(${slide.backgroundImage})` : slide.backgroundGradient ? slide.backgroundGradient : void 0,
|
|
18374
18404
|
backgroundSize: slide.backgroundImage ? "cover" : void 0,
|
|
18375
18405
|
backgroundPosition: slide.backgroundImage ? "center" : void 0
|