pptx-react-viewer 2.18.0 → 2.19.1
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 +712 -0
- package/dist/{AiChatPanel-SSSBERWJ.mjs → AiChatPanel-GRAIPSG3.mjs} +4 -4
- package/dist/AiChatPanel-GRAIPSG3.mjs.br +0 -0
- package/dist/AiChatPanel-GRAIPSG3.mjs.gz +0 -0
- package/dist/{AiChatPanel-UN5DHPZY.js → AiChatPanel-JSTZ6W7R.js} +24 -24
- package/dist/AiChatPanel-JSTZ6W7R.js.br +0 -0
- package/dist/AiChatPanel-JSTZ6W7R.js.gz +0 -0
- package/dist/{Model3DScene-LYEESYAI.mjs → Model3DScene-FXDA7OII.mjs} +1 -1
- package/dist/Model3DScene-FXDA7OII.mjs.br +0 -0
- package/dist/Model3DScene-FXDA7OII.mjs.gz +0 -0
- package/dist/{Model3DScene-4RPYKC2I.js → Model3DScene-WLRZXJHN.js} +2 -2
- package/dist/Model3DScene-WLRZXJHN.js.br +0 -0
- package/dist/Model3DScene-WLRZXJHN.js.gz +0 -0
- package/dist/{PowerPointViewer-Cf4YHjdF.d.ts → PowerPointViewer-DVFkeluD.d.ts} +2 -2
- package/dist/PowerPointViewer-DVFkeluD.d.ts.map +1 -0
- package/dist/{audience-content-store-CyS0oP6t.d.ts → audience-content-store-ChVOSdBh.d.ts} +2 -2
- package/dist/{audience-content-store-CyS0oP6t.d.ts.map → audience-content-store-ChVOSdBh.d.ts.map} +1 -1
- package/dist/{chunk-QUB5OSKY.mjs → chunk-5ZQ3ZQ3M.mjs} +71 -125
- package/dist/chunk-5ZQ3ZQ3M.mjs.br +0 -0
- package/dist/chunk-5ZQ3ZQ3M.mjs.gz +0 -0
- package/dist/{chunk-O7FTUUXP.mjs → chunk-B55E3KXL.mjs} +210 -92
- package/dist/chunk-B55E3KXL.mjs.br +0 -0
- package/dist/chunk-B55E3KXL.mjs.gz +0 -0
- package/dist/{chunk-7XF6S4AM.mjs → chunk-KQGS6A5J.mjs} +1 -1
- package/dist/chunk-KQGS6A5J.mjs.br +0 -0
- package/dist/chunk-KQGS6A5J.mjs.gz +0 -0
- package/dist/{chunk-ASKYZ5ZY.js → chunk-LMTUC7U7.js} +440 -494
- package/dist/chunk-LMTUC7U7.js.br +0 -0
- package/dist/chunk-LMTUC7U7.js.gz +0 -0
- package/dist/{chunk-RTUGI4HQ.js → chunk-MVKRI3CZ.js} +9 -0
- package/dist/chunk-MVKRI3CZ.js.br +0 -0
- package/dist/chunk-MVKRI3CZ.js.gz +0 -0
- package/dist/{chunk-4LWGAVAP.js → chunk-PIJAFM4B.js} +197 -2425
- package/dist/chunk-PIJAFM4B.js.br +0 -0
- package/dist/chunk-PIJAFM4B.js.gz +0 -0
- package/dist/{chunk-GODW6RNR.mjs → chunk-PNR3J26S.mjs} +1173 -1051
- package/dist/chunk-PNR3J26S.mjs.br +0 -0
- package/dist/chunk-PNR3J26S.mjs.gz +0 -0
- package/dist/{chunk-MAVLV56S.js → chunk-SCGIXXN5.js} +3 -3
- package/dist/chunk-SCGIXXN5.js.br +0 -0
- package/dist/chunk-SCGIXXN5.js.gz +0 -0
- package/dist/{chunk-SNL6LBRX.mjs → chunk-SQJBFMEX.mjs} +9 -0
- package/dist/chunk-SQJBFMEX.mjs.br +0 -0
- package/dist/chunk-SQJBFMEX.mjs.gz +0 -0
- package/dist/{chunk-WVDM36ZM.js → chunk-T7BIRNE4.js} +1185 -1067
- package/dist/chunk-T7BIRNE4.js.br +0 -0
- package/dist/chunk-T7BIRNE4.js.gz +0 -0
- package/dist/{chunk-ICZDMFF2.js → chunk-TPC65IB2.js} +1219 -1101
- package/dist/chunk-TPC65IB2.js.br +0 -0
- package/dist/chunk-TPC65IB2.js.gz +0 -0
- package/dist/{chunk-BZOL6FXF.mjs → chunk-WGXQXHCS.mjs} +52 -2280
- package/dist/chunk-WGXQXHCS.mjs.br +0 -0
- package/dist/chunk-WGXQXHCS.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +38 -1
- package/dist/index.js +47 -47
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +102 -15
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/{types-C_CTI-QE.d.ts → types-TCH6icpi.d.ts} +23 -1
- package/dist/{types-C_CTI-QE.d.ts.map → types-TCH6icpi.d.ts.map} +1 -1
- package/dist/{useViewerBuildingBlocks-DItilDbP.d.ts → useViewerBuildingBlocks-BKb0qs1j.d.ts} +20 -4
- package/dist/{useViewerBuildingBlocks-DItilDbP.d.ts.map → useViewerBuildingBlocks-BKb0qs1j.d.ts.map} +1 -1
- package/dist/viewer/index.d.ts +38 -1
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-SSSBERWJ.mjs.br +0 -0
- package/dist/AiChatPanel-SSSBERWJ.mjs.gz +0 -0
- package/dist/AiChatPanel-UN5DHPZY.js.br +0 -0
- package/dist/AiChatPanel-UN5DHPZY.js.gz +0 -0
- package/dist/Model3DScene-4RPYKC2I.js.br +0 -0
- package/dist/Model3DScene-4RPYKC2I.js.gz +0 -0
- package/dist/Model3DScene-LYEESYAI.mjs.br +0 -0
- package/dist/Model3DScene-LYEESYAI.mjs.gz +0 -0
- package/dist/PowerPointViewer-Cf4YHjdF.d.ts.map +0 -1
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js +0 -78
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js.gz +0 -0
- package/dist/SurfaceChart3DScene-JR62SOYO.mjs +0 -76
- package/dist/SurfaceChart3DScene-JR62SOYO.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JR62SOYO.mjs.gz +0 -0
- package/dist/chunk-4LWGAVAP.js.br +0 -0
- package/dist/chunk-4LWGAVAP.js.gz +0 -0
- package/dist/chunk-7XF6S4AM.mjs.br +0 -0
- package/dist/chunk-7XF6S4AM.mjs.gz +0 -0
- package/dist/chunk-ASKYZ5ZY.js.br +0 -0
- package/dist/chunk-ASKYZ5ZY.js.gz +0 -0
- package/dist/chunk-BZOL6FXF.mjs.br +0 -0
- package/dist/chunk-BZOL6FXF.mjs.gz +0 -0
- package/dist/chunk-GODW6RNR.mjs.br +0 -0
- package/dist/chunk-GODW6RNR.mjs.gz +0 -0
- package/dist/chunk-ICZDMFF2.js.br +0 -0
- package/dist/chunk-ICZDMFF2.js.gz +0 -0
- package/dist/chunk-MAVLV56S.js.br +0 -0
- package/dist/chunk-MAVLV56S.js.gz +0 -0
- package/dist/chunk-O7FTUUXP.mjs.br +0 -0
- package/dist/chunk-O7FTUUXP.mjs.gz +0 -0
- package/dist/chunk-QUB5OSKY.mjs.br +0 -0
- package/dist/chunk-QUB5OSKY.mjs.gz +0 -0
- package/dist/chunk-RTUGI4HQ.js.br +0 -0
- package/dist/chunk-RTUGI4HQ.js.gz +0 -0
- package/dist/chunk-SNL6LBRX.mjs.br +0 -0
- package/dist/chunk-SNL6LBRX.mjs.gz +0 -0
- package/dist/chunk-WVDM36ZM.js.br +0 -0
- package/dist/chunk-WVDM36ZM.js.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { deckIdFromBridge, isAiAvailable, createAiChatSession, toolCanvasTarget, createChatHistoryStore, focusTargetChips, isTwoTableFocus, humanizeDiffLine, buildDeckContext, describeToolActivity, summarizeToolArgs, toolLabel } from './chunk-
|
|
2
|
-
import { cn } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { deckIdFromBridge, isAiAvailable, createAiChatSession, toolCanvasTarget, createChatHistoryStore, focusTargetChips, isTwoTableFocus, humanizeDiffLine, buildDeckContext, describeToolActivity, summarizeToolArgs, toolLabel } from './chunk-KQGS6A5J.mjs';
|
|
2
|
+
import { cn } from './chunk-WGXQXHCS.mjs';
|
|
3
|
+
import './chunk-SQJBFMEX.mjs';
|
|
4
|
+
import './chunk-PNR3J26S.mjs';
|
|
5
5
|
import './chunk-XGB3TDIC.mjs';
|
|
6
6
|
import { useMemo, useRef, useState, useEffect, useReducer, useCallback } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var chunkSCGIXXN5_js = require('./chunk-SCGIXXN5.js');
|
|
4
|
+
var chunkPIJAFM4B_js = require('./chunk-PIJAFM4B.js');
|
|
5
|
+
require('./chunk-MVKRI3CZ.js');
|
|
6
|
+
require('./chunk-T7BIRNE4.js');
|
|
7
7
|
require('./chunk-4VNS5WPM.js');
|
|
8
8
|
var react = require('react');
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
@@ -23,7 +23,7 @@ function useAiChat(bridge, config) {
|
|
|
23
23
|
setInitError(void 0);
|
|
24
24
|
void (async () => {
|
|
25
25
|
try {
|
|
26
|
-
const available = await
|
|
26
|
+
const available = await chunkSCGIXXN5_js.isAiAvailable();
|
|
27
27
|
if (cancelled) {
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
@@ -31,7 +31,7 @@ function useAiChat(bridge, config) {
|
|
|
31
31
|
setState("unavailable");
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
const built = await
|
|
34
|
+
const built = await chunkSCGIXXN5_js.createAiChatSession(bridge, configRef.current);
|
|
35
35
|
if (cancelled) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -137,7 +137,7 @@ function withDeckContext(inner, bridge, strategy) {
|
|
|
137
137
|
}
|
|
138
138
|
let context = "";
|
|
139
139
|
try {
|
|
140
|
-
context = await
|
|
140
|
+
context = await chunkSCGIXXN5_js.buildDeckContext(bridge, { strategy, focus: {} });
|
|
141
141
|
} catch {
|
|
142
142
|
context = "";
|
|
143
143
|
}
|
|
@@ -200,7 +200,7 @@ function useAiConversation(useChat, session, config, bridge, options = {}) {
|
|
|
200
200
|
continue;
|
|
201
201
|
}
|
|
202
202
|
seen.add(call.toolCallId);
|
|
203
|
-
onToolTargetRef.current?.(
|
|
203
|
+
onToolTargetRef.current?.(chunkSCGIXXN5_js.toolCanvasTarget(call.toolName, call.input));
|
|
204
204
|
}
|
|
205
205
|
}, [chat.messages]);
|
|
206
206
|
const send = react.useCallback(
|
|
@@ -276,7 +276,7 @@ function deriveTitle(messages) {
|
|
|
276
276
|
}
|
|
277
277
|
function useAiHistory(input) {
|
|
278
278
|
const { deckId, messages, setMessages } = input;
|
|
279
|
-
const store = react.useMemo(() => input.store ??
|
|
279
|
+
const store = react.useMemo(() => input.store ?? chunkSCGIXXN5_js.createChatHistoryStore(), [input.store]);
|
|
280
280
|
const [activeChatId, setActiveChatId] = react.useState(newChatId);
|
|
281
281
|
const [chats, setChats] = react.useState([]);
|
|
282
282
|
const createdAtRef = react.useRef(Date.now());
|
|
@@ -419,7 +419,7 @@ function AiComposer({
|
|
|
419
419
|
disabled: value.trim().length === 0,
|
|
420
420
|
title: t("pptx.ai.send"),
|
|
421
421
|
"aria-label": t("pptx.ai.send"),
|
|
422
|
-
className:
|
|
422
|
+
className: chunkPIJAFM4B_js.cn(
|
|
423
423
|
"shrink-0 rounded-sm p-1.5 transition-colors",
|
|
424
424
|
value.trim().length === 0 ? "text-muted-foreground/50" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
425
425
|
),
|
|
@@ -445,15 +445,15 @@ function AiFocusBar({
|
|
|
445
445
|
onClearPicks
|
|
446
446
|
}) {
|
|
447
447
|
const { t } = reactI18next.useTranslation();
|
|
448
|
-
const chips =
|
|
449
|
-
const twoTables =
|
|
448
|
+
const chips = chunkSCGIXXN5_js.focusTargetChips(targets, slides);
|
|
449
|
+
const twoTables = chunkSCGIXXN5_js.isTwoTableFocus(targets, slides);
|
|
450
450
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-border bg-secondary/30", children: [
|
|
451
451
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1 px-2.5 py-1.5", children: [
|
|
452
452
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("pptx.ai.focusScope") }),
|
|
453
453
|
chips.map((chip) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
454
454
|
"span",
|
|
455
455
|
{
|
|
456
|
-
className:
|
|
456
|
+
className: chunkPIJAFM4B_js.cn(
|
|
457
457
|
"inline-flex max-w-[10rem] items-center rounded-full px-2 py-0.5 text-[11px]",
|
|
458
458
|
hasPicks || isPinned ? "bg-primary/15 text-primary" : "bg-muted text-muted-foreground"
|
|
459
459
|
),
|
|
@@ -486,7 +486,7 @@ function AiFocusBar({
|
|
|
486
486
|
title: t("pptx.ai.pickElement"),
|
|
487
487
|
"aria-label": t("pptx.ai.pickAria"),
|
|
488
488
|
"aria-pressed": pickMode,
|
|
489
|
-
className:
|
|
489
|
+
className: chunkPIJAFM4B_js.cn(
|
|
490
490
|
"rounded-sm p-1",
|
|
491
491
|
pickMode ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent"
|
|
492
492
|
),
|
|
@@ -565,7 +565,7 @@ function AiHistoryList({ chats, activeChatId, onResume, onDelete }) {
|
|
|
565
565
|
{
|
|
566
566
|
type: "button",
|
|
567
567
|
onClick: () => onResume(chat.id),
|
|
568
|
-
className:
|
|
568
|
+
className: chunkPIJAFM4B_js.cn(
|
|
569
569
|
"flex min-w-0 flex-1 items-start gap-2 rounded-sm px-2 py-1.5 text-left hover:bg-accent",
|
|
570
570
|
chat.id === activeChatId && "bg-accent/60"
|
|
571
571
|
),
|
|
@@ -720,26 +720,26 @@ function AiToolCallCard({ part }) {
|
|
|
720
720
|
const failed = part.state === "output-error";
|
|
721
721
|
const done = part.state === "output-available";
|
|
722
722
|
const running = !failed && !done;
|
|
723
|
-
const activity =
|
|
723
|
+
const activity = chunkSCGIXXN5_js.describeToolActivity(part.toolName, part.input, running ? "present" : "past");
|
|
724
724
|
const Icon = ICONS[activity.icon] ?? lu.LuWrench;
|
|
725
|
-
const rawSummary =
|
|
725
|
+
const rawSummary = chunkSCGIXXN5_js.summarizeToolArgs(part.input);
|
|
726
726
|
const statusLabel = failed ? t("pptx.ai.toolFailed") : done ? t("pptx.ai.toolDone") : t("pptx.ai.toolRunning");
|
|
727
727
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[12px]", children: [
|
|
728
728
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
729
729
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
730
730
|
Icon,
|
|
731
731
|
{
|
|
732
|
-
className:
|
|
732
|
+
className: chunkPIJAFM4B_js.cn(
|
|
733
733
|
"w-3.5 h-3.5 shrink-0",
|
|
734
734
|
failed ? "text-destructive" : "text-muted-foreground"
|
|
735
735
|
)
|
|
736
736
|
}
|
|
737
737
|
),
|
|
738
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
738
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkPIJAFM4B_js.cn("truncate", failed ? "text-destructive" : "text-foreground"), children: activity.label }),
|
|
739
739
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
740
740
|
"span",
|
|
741
741
|
{
|
|
742
|
-
className:
|
|
742
|
+
className: chunkPIJAFM4B_js.cn(
|
|
743
743
|
"ml-auto inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[10px]",
|
|
744
744
|
failed ? "bg-destructive/15 text-destructive" : done ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"
|
|
745
745
|
),
|
|
@@ -756,7 +756,7 @@ function AiToolCallCard({ part }) {
|
|
|
756
756
|
rawSummary && /* @__PURE__ */ jsxRuntime.jsxs("details", { className: "group mt-0.5 pl-5", children: [
|
|
757
757
|
/* @__PURE__ */ jsxRuntime.jsx("summary", { className: "cursor-pointer list-none text-[10px] text-muted-foreground/70 hover:text-muted-foreground", children: t("pptx.ai.toolDetails") }),
|
|
758
758
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-0.5 break-words font-mono text-[10px] text-muted-foreground/80", children: [
|
|
759
|
-
|
|
759
|
+
chunkSCGIXXN5_js.toolLabel(part.toolName),
|
|
760
760
|
": ",
|
|
761
761
|
rawSummary
|
|
762
762
|
] })
|
|
@@ -787,7 +787,7 @@ function AiMessageList({ messages, isStreaming, bridge }) {
|
|
|
787
787
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
788
788
|
"div",
|
|
789
789
|
{
|
|
790
|
-
className:
|
|
790
|
+
className: chunkPIJAFM4B_js.cn(
|
|
791
791
|
"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
|
|
792
792
|
isUser ? "bg-secondary text-muted-foreground" : "bg-primary/15 text-primary"
|
|
793
793
|
),
|
|
@@ -834,7 +834,7 @@ function AiMessageList({ messages, isStreaming, bridge }) {
|
|
|
834
834
|
}
|
|
835
835
|
function AiProposalCard({ proposal, onAccept, onReject }) {
|
|
836
836
|
const { t } = reactI18next.useTranslation();
|
|
837
|
-
const lines = proposal.summary.map(
|
|
837
|
+
const lines = proposal.summary.map(chunkSCGIXXN5_js.humanizeDiffLine);
|
|
838
838
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border border-primary/40 bg-primary/5 p-2.5", children: [
|
|
839
839
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-primary", children: t("pptx.ai.proposedChange") }),
|
|
840
840
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[12px] font-medium text-foreground", children: proposal.label }),
|
|
@@ -1042,7 +1042,7 @@ function AiChatPanel({
|
|
|
1042
1042
|
}) {
|
|
1043
1043
|
const { t } = reactI18next.useTranslation();
|
|
1044
1044
|
const { state, session, initError } = useAiChat(bridge, config);
|
|
1045
|
-
const deckId = react.useMemo(() =>
|
|
1045
|
+
const deckId = react.useMemo(() => chunkSCGIXXN5_js.deckIdFromBridge(bridge), [bridge]);
|
|
1046
1046
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1047
1047
|
"div",
|
|
1048
1048
|
{
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkT7BIRNE4_js = require('./chunk-T7BIRNE4.js');
|
|
4
4
|
require('./chunk-4VNS5WPM.js');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -14,7 +14,7 @@ function Model3DScene({ modelUrl, interactive, width, height }) {
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
let disposed = false;
|
|
17
|
-
void
|
|
17
|
+
void chunkT7BIRNE4_js.mountModel3D(container, modelUrl, { width, height, interactive }).then((handle) => {
|
|
18
18
|
if (disposed) {
|
|
19
19
|
handle.dispose();
|
|
20
20
|
} else {
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as PowerPointViewerHandle, p as PowerPointViewerProps } from "./types-
|
|
1
|
+
import { f as PowerPointViewerHandle, p as PowerPointViewerProps } from "./types-TCH6icpi.js";
|
|
2
2
|
import { PptxAnimationPreset, PptxNativeAnimation } from "pptx-viewer-core";
|
|
3
3
|
import "pptx-viewer-shared";
|
|
4
4
|
import React from "react";
|
|
@@ -18,4 +18,4 @@ declare function getAnimationInitialStyle(preset: PptxAnimationPreset | undefine
|
|
|
18
18
|
declare const PowerPointViewer: import("react").ForwardRefExoticComponent<PowerPointViewerProps & import("react").RefAttributes<PowerPointViewerHandle>>;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { getAnimationInitialStyle as n, PowerPointViewer as t };
|
|
21
|
-
//# sourceMappingURL=PowerPointViewer-
|
|
21
|
+
//# sourceMappingURL=PowerPointViewer-DVFkeluD.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PowerPointViewer-DVFkeluD.d.ts","names":[],"sources":["../src/viewer/utils/animation-effects.ts","../src/viewer/PowerPointViewer.tsx"],"mappings":";;;;;iBAmBgB,yBACf,QAAQ,iCACR,kBAAkB,sBAChB,MAAM;;;;;;;;;;;;cC8FI,kCAAgB,0BAAA,wCAAA,cAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CollaborationConfig$1, D as UserPresence, E as ConnectionStatus, w as CollaborationContextValue } from "./types-
|
|
1
|
+
import { C as CollaborationConfig$1, D as UserPresence, E as ConnectionStatus, w as CollaborationContextValue } from "./types-TCH6icpi.js";
|
|
2
2
|
import { PptxData, PptxElement, PptxHandler, PptxSlide, PptxThemeColorScheme, PptxThemeFontScheme, PptxThemePreset } from "pptx-viewer-core";
|
|
3
3
|
import { CollaborationConfig, CollaborationLivePatcher, PresentationSnapshot, clearAudienceContent, loadAudienceContent, storeAudienceContent } from "pptx-viewer-shared";
|
|
4
4
|
import { RefObject } from "react";
|
|
@@ -383,4 +383,4 @@ interface UsePresenterWindowResult {
|
|
|
383
383
|
declare function usePresenterWindow(input: UsePresenterWindowInput): UsePresenterWindowResult;
|
|
384
384
|
//#endregion
|
|
385
385
|
export { usePresenceTracking as C, ThemeSwitchingResult as D, useYjsProvider as E, UseThemeSwitchingInput as O, UsePresenceTrackingResult as S, UseYjsProviderResult as T, UseCollaborativeHistoryResult as _, UsePresenterWindowResult as a, useCollaborativeState as b, usePresenterWindow as c, useFollowMode as d, UseBroadcastFollowerInput as f, UseCollaborativeHistoryInput as g, useYjsDocumentSync as h, UsePresenterWindowInput as i, useThemeSwitching as k, UseFollowModeInput as l, UseYjsDocumentSyncInput as m, loadAudienceContent as n, isAudienceTab as o, useBroadcastFollower as p, storeAudienceContent as r, parseAudienceNonce as s, clearAudienceContent as t, UseFollowModeResult as u, useCollaborativeHistory as v, UseYjsProviderInput as w, UsePresenceTrackingInput as x, UseCollaborativeStateInput as y };
|
|
386
|
-
//# sourceMappingURL=audience-content-store-
|
|
386
|
+
//# sourceMappingURL=audience-content-store-ChVOSdBh.d.ts.map
|
package/dist/{audience-content-store-CyS0oP6t.d.ts.map → audience-content-store-ChVOSdBh.d.ts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audience-content-store-
|
|
1
|
+
{"version":3,"file":"audience-content-store-ChVOSdBh.d.ts","names":[],"sources":["../src/viewer/hooks/useThemeSwitching.ts","../../../node_modules/.bun/lib0@0.2.117/node_modules/lib0/observable.d.ts","../../../node_modules/.bun/y-protocols@1.0.7+48ebd0cf55a3d4ab/node_modules/y-protocols/awareness.d.ts","../src/viewer/hooks/collaboration/useYjsProvider.ts","../src/viewer/hooks/collaboration/usePresenceTracking.ts","../src/viewer/hooks/collaboration/useCollaborativeState.ts","../src/viewer/hooks/collaboration/useCollaborativeHistory.ts","../src/viewer/hooks/collaboration/useYjsDocumentSync.ts","../src/viewer/hooks/collaboration/useBroadcastFollower.ts","../src/viewer/hooks/collaboration/useFollowMode.ts","../src/viewer/hooks/presentation-mode/usePresenterWindow.ts"],"x_google_ignoreList":[1,2],"mappings":";;;;;;;UAqBiB;;EAEhB,YAAY,UAAU;;EAEtB,MAAM;;EAEN,eAAe,SAAS;;EAExB,kBAAkB,QAAQ;;UAGV;;EAEhB,kBAAkB;;;;;EAMlB,iBAAiB,QAAQ,oBAAoB;;;;;EAM7C,iBACC,aAAa,sBACb,aAAa,qBACb,uBACI;;;;;EAML,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCA,kBAAkB,OAAO,yBAAyB;;;;;;;;;cCrCrD,WAAW;;;;;EAKpB,YAAY,IAAI;;;;;EAKhB,GAAG,MAAM,GAAG,GAAG;;;;;EAKf,KAAK,MAAM,GAAG,GAAG;;;;;EAKjB,IAAI,MAAM,GAAG,GAAG;;;;;;;;;;EAUhB,KAAK,MAAM,GAAG,MAAM;EACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;cC3DS,kBAAkB;;;;EAI3B,YAAY,KAAK,EAAE;EACnB,KAAK,EAAE;;;;EAIP;;;;;EAKA,QAAQ;KACH;;;;;EAKL,MAAM,YAAY;EAClB;;;;EAIA;KACK;;;;;EAKL,cAAc;KACT;;;;;;EAML,mBAAmB,eAAe;;;;EAIlC,aAAa;KACR;;;KASG;EACR;;;;EAIA;;;;UC9Ba;;;;;;EAMhB,SAAS;;UAGO;;EAEhB,QAAQ;;EAER,WAAW;;EAEX,KAAK;;EAEL;;;;;;;;;EASA;;EAEA;;;;;;;;;;;;;iBAkBe,iBAAiB,UAAU,sBAAsB;;;UChFhD;EAChB,WAAW;EACX;EACA;EACA;EACA;;EAEA;EACA;EACA;;UAGgB;;EAEhB,aAAa;;EAEb,oBAAoB,QAAQ,QAAQ,KAAK;;iBAO1B,sBACf,WACA,eACA,UACA,WACA,YACA,MACA,aACA,gBACE,2BAA2B;;;UC3Bb;;;;;;;EAOhB,SAAS;EACT;EACA;;iBAOe,wBACf,QACA,aACA,gBACE,6BAA6B;;;UCvBf;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;UAGgB;;EAEhB;;EAEA;;EAEA;;EAEA;;iBAOe,0BACf,eAAe,gBACf,YACA,YACA,SACA,WACE,+BAA+B;;;UC1BjB;;EAEhB,KAAK;;EAEL,QAAQ;;EAER,2BAA2B,eAAe;;EAE1C,WAAW,MAAM,SAAS,MAAM,eAAe;;EAE/C;;;;;;;EAOA;;EAEA,SAAS,KAAK;;;;;EAKd,uBAAuB;;;;;;;;EAQvB;;iBAGe,qBACf,KACA,QACA,2BACA,WACA,aACA,UACA,QACA,gBACA,eACE;;;UCtDc;;EAEhB,QAAQ;;EAER;;EAEA,sBAAsB;;EAEtB;;;;;EAKA;;iBAOe,uBACf,QACA,kBACA,qBACA,YACA,UACE;;;UCzBc;;EAEhB,QAAQ;;EAER;;EAEA,sBAAsB;;EAEtB;;UAGgB;;EAEhB;;EAEA,aAAa;;iBAOE,gBACf,QACA,kBACA,qBACA,cACE,qBAAqB;;;;;;;iBCgBR;;iBAkDA;UAQC;EAChB;EACA;;EAEA,UAAU,cAAc;EACxB,UAAU;;UAGM;EAChB;EACA;EACA;EACA,sBAAsB;EACtB,sBAAsB,UAAU;EAChC,oBAAoB;;iBAOL,mBAAmB,OAAO,0BAA0B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, executeMediaCommand, buildPdfFromImageData, buildNotesPdf, EMU_PER_PX, GRID_SIZE, DEFAULT_TEXT_FONT_SIZE } from './chunk-
|
|
2
|
-
import { translationsEn } from './chunk-
|
|
3
|
-
import { TOOLBAR_TABS, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createPresenceProjector, BROADCAST_THROTTLE_MS, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, sanitizeColor, cloneTemplateElementsBySlideId, cloneSlide, createWheelStepBuffer, createViewerZoomStore, clampZoomScale, mapEditingWheel, PresentationAnimationController, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, createPresenterShowGuard, attachPresentationVisibilityPause, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, findInSlides, applyFindReplacements, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, collectMediaElements, collectImagePaths, partitionTemplateElements, resolveAuthoredCustomShowId, buildInitialGuides, EncryptedFileError, shouldWriteAutosaveSnapshot, saveAutosaveSnapshot, autosaveSnapshotMark, updateMasterViewElement, isTemplateElementId, hasShapeProperties, hasTextProperties, getInlineEditorSelection, applyStyleToSelectedSegments, setPendingSelectionRestore, applyCaseTransformToSegments, transformTextCase, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, normalizeColorsForCapture, preprocessCssForCapture, downloadBlob, sanitizeDownloadFilename, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, recordProgressPercent, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, comparePresentation, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, detectTouchDevice, detectOrientation, isMobileViewport, MOBILE_BREAKPOINT, TABLET_BREAKPOINT, describeFontEmbedding, mayLeaveSlideShow, stopAllPersistentAudio, remapTextToSegments, guidePxToEmu, buildSaveSlides, embeddedFontSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, shouldLoopContinuously, applyRehearsalTimings, copyFormatFromElement, applyFormatToElement, mapEditorKey, isEditorTextInputTarget, createViewerOptionsStore, readSlidesFromYDoc, reconcileSlidesInYDoc, LOCAL_SYNC_ORIGIN, observeYDocSlides, shouldAutoFollowBroadcaster, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, scopeLayoutOptionsToSlide, openPptxFile, readBackstageRecentFile, isActionHidden, canInteractWithElement, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, savedPresentationFileName, generatePackageReadme, presentationBaseName, exportDeckJson, groupElements, generateElementId, makeCloneId, ungroupElements, alignElements, distributeElements, bringForward, sendBackward, bringToFront, sendToBack, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, mergeShapes, mapPresentationKey, lastShowSlideIndex, firstShowSlideIndex, mapPresentationWheel, buildPrintDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, buildThemeColorMap, reResolveSlideColors, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, runPresentationAction, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, canvasToJpegData, downloadDataUrl, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, encodeGif, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, cloneElementForPaste, computeScrollDelta, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, rerouteConnectorsForMovedElements, applyReroutedConnectors, SvgExporter, buildPrintHtmlDocument, deleteTableColumn, rebuildTableStructureInRawXml, insertTableColumn, deleteTableRow, insertTableRow, updateCellTextStyleInRawXml, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, isPpactionUrl, parsePpactionUrl, safeOpenUrl, ACTION_BUTTON_PRESETS, elementActionToPptxAction, buildSmartArtPresetData, computeSnapToShape, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, applyResize, snapBoxToGrid, applyMotionPathPreset } from './chunk-
|
|
1
|
+
import { cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, executeMediaCommand, buildPdfFromImageData, buildNotesPdf, EMU_PER_PX, GRID_SIZE, DEFAULT_TEXT_FONT_SIZE } from './chunk-WGXQXHCS.mjs';
|
|
2
|
+
import { translationsEn } from './chunk-SQJBFMEX.mjs';
|
|
3
|
+
import { TOOLBAR_TABS, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createPresenceProjector, BROADCAST_THROTTLE_MS, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, sanitizeColor, cloneTemplateElementsBySlideId, cloneSlide, createWheelStepBuffer, createViewerZoomStore, clampZoomScale, mapEditingWheel, PresentationAnimationController, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, createPresenterShowGuard, attachPresentationVisibilityPause, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, findInSlides, applyFindReplacements, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, collectMediaElements, collectImagePaths, partitionTemplateElements, resolveAuthoredCustomShowId, buildInitialGuides, EncryptedFileError, resolveAutosaveIntervalMs, shouldWriteAutosaveSnapshot, saveAutosaveSnapshot, autosaveSnapshotMark, updateMasterViewElement, isTemplateElementId, hasShapeProperties, hasTextProperties, getInlineEditorSelection, applyStyleToSelectedSegments, setPendingSelectionRestore, applyCaseTransformToSegments, transformTextCase, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, normalizeColorsForCapture, preprocessCssForCapture, downloadBlob, sanitizeDownloadFilename, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, recordProgressPercent, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, comparePresentation, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, detectTouchDevice, detectOrientation, isMobileViewport, MOBILE_BREAKPOINT, TABLET_BREAKPOINT, describeFontEmbedding, mayLeaveSlideShow, stopAllPersistentAudio, remapTextToSegments, guidePxToEmu, buildSaveSlides, embeddedFontSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, shouldProbeAutosaveRecovery, probeAutosaveRecovery, acceptAutosaveRecovery, discardAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, copyFormatFromElement, applyFormatToElement, mapEditorKey, isEditorTextInputTarget, createViewerOptionsStore, readSlidesFromYDoc, reconcileSlidesInYDoc, LOCAL_SYNC_ORIGIN, observeYDocSlides, shouldAutoFollowBroadcaster, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, scopeLayoutOptionsToSlide, openPptxFile, readBackstageRecentFile, isActionHidden, canInteractWithElement, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, savedPresentationFileName, generatePackageReadme, presentationBaseName, exportDeckJson, groupElements, generateElementId, makeCloneId, ungroupElements, alignElements, distributeElements, bringForward, sendBackward, bringToFront, sendToBack, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, mergeShapes, mapPresentationKey, lastShowSlideIndex, firstShowSlideIndex, mapPresentationWheel, buildPrintDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, buildThemeColorMap, reResolveSlideColors, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, runPresentationAction, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, canvasToJpegData, downloadDataUrl, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, encodeGif, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, cloneElementForPaste, computeScrollDelta, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, rerouteConnectorsForMovedElements, applyReroutedConnectors, SvgExporter, buildPrintHtmlDocument, deleteTableColumn, rebuildTableStructureInRawXml, insertTableColumn, deleteTableRow, insertTableRow, updateCellTextStyleInRawXml, setCellText, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, isPpactionUrl, parsePpactionUrl, safeOpenUrl, ACTION_BUTTON_PRESETS, elementActionToPptxAction, buildSmartArtPresetData, computeSnapToShape, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, applyResize, snapBoxToGrid, applyMotionPathPreset } from './chunk-PNR3J26S.mjs';
|
|
4
4
|
import { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect, useSyncExternalStore, useImperativeHandle } from 'react';
|
|
5
5
|
import JSZip from 'jszip';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
@@ -473,6 +473,14 @@ function useSheetDismissDrag(onClose, threshold = 120) {
|
|
|
473
473
|
};
|
|
474
474
|
}
|
|
475
475
|
var DEFAULT_MAX_HISTORY_ENTRIES = 120;
|
|
476
|
+
function serializeDocument(snapshot) {
|
|
477
|
+
return JSON.stringify({
|
|
478
|
+
width: snapshot.width,
|
|
479
|
+
height: snapshot.height,
|
|
480
|
+
slides: snapshot.slides,
|
|
481
|
+
templateElementsBySlideId: snapshot.templateElementsBySlideId
|
|
482
|
+
});
|
|
483
|
+
}
|
|
476
484
|
function useEditorHistory(input) {
|
|
477
485
|
const {
|
|
478
486
|
slides,
|
|
@@ -575,7 +583,7 @@ function useEditorHistory(input) {
|
|
|
575
583
|
isApplyingHistoryRef.current = true;
|
|
576
584
|
const nextSnapshot = cloneHistorySnapshot(previousSnapshot);
|
|
577
585
|
lastHistorySnapshotRef.current = cloneHistorySnapshot(nextSnapshot);
|
|
578
|
-
lastHistorySerializedRef.current =
|
|
586
|
+
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
579
587
|
applyHistorySnapshot(nextSnapshot);
|
|
580
588
|
updateHistoryAvailability();
|
|
581
589
|
unlockHistoryTracking();
|
|
@@ -597,7 +605,7 @@ function useEditorHistory(input) {
|
|
|
597
605
|
isApplyingHistoryRef.current = true;
|
|
598
606
|
const targetSnapshot = cloneHistorySnapshot(nextSnapshot);
|
|
599
607
|
lastHistorySnapshotRef.current = cloneHistorySnapshot(targetSnapshot);
|
|
600
|
-
lastHistorySerializedRef.current =
|
|
608
|
+
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
601
609
|
applyHistorySnapshot(targetSnapshot);
|
|
602
610
|
updateHistoryAvailability();
|
|
603
611
|
unlockHistoryTracking();
|
|
@@ -616,7 +624,7 @@ function useEditorHistory(input) {
|
|
|
616
624
|
if (initialSnapshot) {
|
|
617
625
|
const clonedInitial = cloneHistorySnapshot(initialSnapshot);
|
|
618
626
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
619
|
-
lastHistorySerializedRef.current =
|
|
627
|
+
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
620
628
|
} else {
|
|
621
629
|
lastHistorySnapshotRef.current = null;
|
|
622
630
|
lastHistorySerializedRef.current = "";
|
|
@@ -648,8 +656,15 @@ function useEditorHistory(input) {
|
|
|
648
656
|
return;
|
|
649
657
|
}
|
|
650
658
|
const snapshot = buildHistorySnapshot();
|
|
651
|
-
const serialized =
|
|
659
|
+
const serialized = serializeDocument(snapshot);
|
|
652
660
|
if (serialized === lastHistorySerializedRef.current) {
|
|
661
|
+
const previous = lastHistorySnapshotRef.current;
|
|
662
|
+
if (previous && previous.activeSlideIndex !== snapshot.activeSlideIndex) {
|
|
663
|
+
lastHistorySnapshotRef.current = {
|
|
664
|
+
...previous,
|
|
665
|
+
activeSlideIndex: snapshot.activeSlideIndex
|
|
666
|
+
};
|
|
667
|
+
}
|
|
653
668
|
lastCheapHashRef.current = cheapHash;
|
|
654
669
|
return;
|
|
655
670
|
}
|
|
@@ -3983,24 +3998,12 @@ function useLoadContent({
|
|
|
3983
3998
|
}, [content]);
|
|
3984
3999
|
return { handlerRef };
|
|
3985
4000
|
}
|
|
3986
|
-
|
|
3987
|
-
// src/viewer/hooks/useAutosave-helpers.ts
|
|
3988
|
-
var DEFAULT_AUTOSAVE_INTERVAL_SECONDS = 120;
|
|
3989
|
-
var MIN_AUTOSAVE_INTERVAL_SECONDS = 10;
|
|
3990
|
-
function computeAutosaveIntervalMs(intervalSeconds) {
|
|
3991
|
-
return Math.max(intervalSeconds, MIN_AUTOSAVE_INTERVAL_SECONDS) * 1e3;
|
|
3992
|
-
}
|
|
3993
|
-
|
|
3994
|
-
// src/viewer/hooks/useAutosave.ts
|
|
3995
4001
|
function useAutosave(input) {
|
|
3996
|
-
const {
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
enabled = true,
|
|
4002
|
-
getChangeSources
|
|
4003
|
-
} = input;
|
|
4002
|
+
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4003
|
+
const intervalMs = resolveAutosaveIntervalMs({
|
|
4004
|
+
hostIntervalMs: input.intervalMs,
|
|
4005
|
+
optionsIntervalSeconds: input.intervalSeconds
|
|
4006
|
+
});
|
|
4004
4007
|
const [autosaveStatus, setAutosaveStatus] = useState({
|
|
4005
4008
|
state: "idle"
|
|
4006
4009
|
});
|
|
@@ -4071,12 +4074,11 @@ function useAutosave(input) {
|
|
|
4071
4074
|
return;
|
|
4072
4075
|
}
|
|
4073
4076
|
setAutosaveStatus((prev) => prev.state === "disabled" ? { state: "idle" } : prev);
|
|
4074
|
-
const ms = computeAutosaveIntervalMs(intervalSeconds);
|
|
4075
4077
|
const id = setInterval(() => {
|
|
4076
4078
|
void doAutosave({ polled: true });
|
|
4077
|
-
},
|
|
4079
|
+
}, intervalMs);
|
|
4078
4080
|
return () => clearInterval(id);
|
|
4079
|
-
}, [enabled, filePath,
|
|
4081
|
+
}, [enabled, filePath, intervalMs, doAutosave]);
|
|
4080
4082
|
return {
|
|
4081
4083
|
autosaveStatus,
|
|
4082
4084
|
triggerAutosave: () => doAutosave()
|
|
@@ -6493,16 +6495,7 @@ function createTableStructHandlers(input) {
|
|
|
6493
6495
|
}
|
|
6494
6496
|
const updates = {};
|
|
6495
6497
|
if (el.tableData) {
|
|
6496
|
-
|
|
6497
|
-
if (ri !== rowIndex) {
|
|
6498
|
-
return row;
|
|
6499
|
-
}
|
|
6500
|
-
return {
|
|
6501
|
-
...row,
|
|
6502
|
-
cells: row.cells.map((cell, ci) => ci !== colIndex ? cell : { ...cell, text })
|
|
6503
|
-
};
|
|
6504
|
-
});
|
|
6505
|
-
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6498
|
+
updates.tableData = setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6506
6499
|
}
|
|
6507
6500
|
if (el.rawXml) {
|
|
6508
6501
|
const newRawXml = updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
@@ -8731,102 +8724,52 @@ function useSerialize(input) {
|
|
|
8731
8724
|
purpose
|
|
8732
8725
|
]);
|
|
8733
8726
|
}
|
|
8734
|
-
|
|
8735
|
-
// src/viewer/hooks/useRecoveryDetection-helpers.ts
|
|
8736
|
-
function shouldCheckRecovery(input) {
|
|
8737
|
-
const { alreadyChecked, filePath, loading, error, slideCount } = input;
|
|
8738
|
-
if (alreadyChecked) {
|
|
8739
|
-
return false;
|
|
8740
|
-
}
|
|
8741
|
-
if (!filePath) {
|
|
8742
|
-
return false;
|
|
8743
|
-
}
|
|
8744
|
-
if (loading) {
|
|
8745
|
-
return false;
|
|
8746
|
-
}
|
|
8747
|
-
if (error) {
|
|
8748
|
-
return false;
|
|
8749
|
-
}
|
|
8750
|
-
if (slideCount === 0) {
|
|
8751
|
-
return false;
|
|
8752
|
-
}
|
|
8753
|
-
return true;
|
|
8754
|
-
}
|
|
8755
|
-
var RECOVERY_WINDOW_MS = 24 * 60 * 60 * 1e3;
|
|
8756
|
-
function isRecentRecovery(timestamp, now) {
|
|
8757
|
-
return now - timestamp < RECOVERY_WINDOW_MS;
|
|
8758
|
-
}
|
|
8759
|
-
function hasRecentRecoveryVersion(versions, now) {
|
|
8760
|
-
if (versions.length === 0) {
|
|
8761
|
-
return false;
|
|
8762
|
-
}
|
|
8763
|
-
return isRecentRecovery(versions[0].timestamp, now);
|
|
8764
|
-
}
|
|
8765
|
-
|
|
8766
|
-
// src/viewer/hooks/useRecoveryDetection.ts
|
|
8767
|
-
var DB_NAME = "pptx-viewer-autosave";
|
|
8768
|
-
var DB_VERSION = 1;
|
|
8769
|
-
var STORE_NAME = "recoveryVersions";
|
|
8770
|
-
function openAutosaveDb() {
|
|
8771
|
-
return new Promise((resolve, reject) => {
|
|
8772
|
-
const req = indexedDB.open(DB_NAME, DB_VERSION);
|
|
8773
|
-
req.onupgradeneeded = () => {
|
|
8774
|
-
const db = req.result;
|
|
8775
|
-
if (!db.objectStoreNames.contains(STORE_NAME)) {
|
|
8776
|
-
db.createObjectStore(STORE_NAME, { keyPath: "key" });
|
|
8777
|
-
}
|
|
8778
|
-
};
|
|
8779
|
-
req.onsuccess = () => resolve(req.result);
|
|
8780
|
-
req.onerror = () => reject(req.error);
|
|
8781
|
-
});
|
|
8782
|
-
}
|
|
8783
|
-
async function getRecoveryVersion(filePath) {
|
|
8784
|
-
try {
|
|
8785
|
-
const db = await openAutosaveDb();
|
|
8786
|
-
return new Promise((resolve) => {
|
|
8787
|
-
const tx = db.transaction(STORE_NAME, "readonly");
|
|
8788
|
-
const store = tx.objectStore(STORE_NAME);
|
|
8789
|
-
const req = store.get(filePath);
|
|
8790
|
-
req.onsuccess = () => {
|
|
8791
|
-
db.close();
|
|
8792
|
-
resolve(req.result);
|
|
8793
|
-
};
|
|
8794
|
-
req.onerror = () => {
|
|
8795
|
-
db.close();
|
|
8796
|
-
resolve(void 0);
|
|
8797
|
-
};
|
|
8798
|
-
});
|
|
8799
|
-
} catch {
|
|
8800
|
-
return void 0;
|
|
8801
|
-
}
|
|
8802
|
-
}
|
|
8803
8727
|
function useRecoveryDetection(input) {
|
|
8804
|
-
const { filePath, loading, error, slideCount,
|
|
8728
|
+
const { filePath, loading, error, slideCount, autosaveAllowed = true } = input;
|
|
8805
8729
|
const recoveryCheckedRef = useRef(false);
|
|
8730
|
+
const recordRef = useRef(null);
|
|
8731
|
+
const [prompt, setPrompt] = useState(null);
|
|
8732
|
+
const onRestore = input.onRestore;
|
|
8733
|
+
const openVersionHistory = input.openVersionHistory;
|
|
8806
8734
|
useEffect(() => {
|
|
8807
|
-
if (!
|
|
8735
|
+
if (!shouldProbeAutosaveRecovery({
|
|
8808
8736
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8809
8737
|
filePath,
|
|
8810
8738
|
loading,
|
|
8811
8739
|
error,
|
|
8812
|
-
slideCount
|
|
8740
|
+
slideCount,
|
|
8741
|
+
autosaveAllowed
|
|
8813
8742
|
})) {
|
|
8814
8743
|
return;
|
|
8815
8744
|
}
|
|
8816
8745
|
recoveryCheckedRef.current = true;
|
|
8817
|
-
if (typeof indexedDB === "undefined") {
|
|
8818
|
-
return;
|
|
8819
|
-
}
|
|
8820
8746
|
void (async () => {
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
openVersionHistory();
|
|
8825
|
-
}
|
|
8826
|
-
} catch {
|
|
8747
|
+
const offer = await probeAutosaveRecovery(filePath);
|
|
8748
|
+
if (!offer) {
|
|
8749
|
+
return;
|
|
8827
8750
|
}
|
|
8751
|
+
recordRef.current = offer.record;
|
|
8752
|
+
setPrompt(offer.prompt);
|
|
8753
|
+
openVersionHistory?.();
|
|
8828
8754
|
})();
|
|
8829
|
-
}, [filePath, loading, error, slideCount, openVersionHistory]);
|
|
8755
|
+
}, [filePath, loading, error, slideCount, autosaveAllowed, openVersionHistory]);
|
|
8756
|
+
const restore = useCallback(() => {
|
|
8757
|
+
const record = recordRef.current;
|
|
8758
|
+
setPrompt(null);
|
|
8759
|
+
if (record && onRestore) {
|
|
8760
|
+
onRestore(acceptAutosaveRecovery(record));
|
|
8761
|
+
}
|
|
8762
|
+
recordRef.current = null;
|
|
8763
|
+
}, [onRestore]);
|
|
8764
|
+
const discard = useCallback(() => {
|
|
8765
|
+
const record = recordRef.current;
|
|
8766
|
+
setPrompt(null);
|
|
8767
|
+
recordRef.current = null;
|
|
8768
|
+
if (record) {
|
|
8769
|
+
void discardAutosaveRecovery(record);
|
|
8770
|
+
}
|
|
8771
|
+
}, []);
|
|
8772
|
+
return { prompt, restore, discard };
|
|
8830
8773
|
}
|
|
8831
8774
|
function usePresentationSetup(input) {
|
|
8832
8775
|
const {
|
|
@@ -9437,7 +9380,7 @@ function useContentLifecycle(input) {
|
|
|
9437
9380
|
content,
|
|
9438
9381
|
filePath,
|
|
9439
9382
|
autosaveEnabled = true,
|
|
9440
|
-
|
|
9383
|
+
autosaveIntervalMs,
|
|
9441
9384
|
embedFonts = true,
|
|
9442
9385
|
slides,
|
|
9443
9386
|
state,
|
|
@@ -9521,7 +9464,7 @@ function useContentLifecycle(input) {
|
|
|
9521
9464
|
filePath,
|
|
9522
9465
|
serializeSlides: serializeForRecovery,
|
|
9523
9466
|
enabled: autosaveEnabled,
|
|
9524
|
-
...
|
|
9467
|
+
...autosaveIntervalMs === void 0 ? {} : { intervalMs: autosaveIntervalMs },
|
|
9525
9468
|
// Everything `serializeForRecovery` reads that changes by REASSIGNMENT,
|
|
9526
9469
|
// so a poll that finds all of them unchanged can skip re-serializing a
|
|
9527
9470
|
// deck it has already snapshotted. The two refs are read by `.current`
|
|
@@ -9721,7 +9664,8 @@ function useViewerIntegration(input) {
|
|
|
9721
9664
|
content,
|
|
9722
9665
|
filePath,
|
|
9723
9666
|
autosaveEnabled,
|
|
9724
|
-
|
|
9667
|
+
autosaveAllowed = true,
|
|
9668
|
+
autosaveIntervalMs,
|
|
9725
9669
|
canEdit,
|
|
9726
9670
|
mode,
|
|
9727
9671
|
slides,
|
|
@@ -9777,7 +9721,7 @@ function useViewerIntegration(input) {
|
|
|
9777
9721
|
content,
|
|
9778
9722
|
filePath,
|
|
9779
9723
|
autosaveEnabled,
|
|
9780
|
-
|
|
9724
|
+
autosaveIntervalMs,
|
|
9781
9725
|
// The File > Fonts toggle, finally reaching a save call.
|
|
9782
9726
|
embedFonts: dialogs.embedFontsEnabled,
|
|
9783
9727
|
slides,
|
|
@@ -9821,12 +9765,13 @@ function useViewerIntegration(input) {
|
|
|
9821
9765
|
setMode: state.setMode,
|
|
9822
9766
|
setSlides: state.setSlides
|
|
9823
9767
|
});
|
|
9824
|
-
useRecoveryDetection({
|
|
9768
|
+
const recovery = useRecoveryDetection({
|
|
9825
9769
|
filePath,
|
|
9826
9770
|
loading,
|
|
9827
9771
|
error,
|
|
9828
9772
|
slideCount: slides.length,
|
|
9829
|
-
|
|
9773
|
+
autosaveAllowed,
|
|
9774
|
+
onRestore: setContent
|
|
9830
9775
|
});
|
|
9831
9776
|
useImperativeHandle(
|
|
9832
9777
|
ref,
|
|
@@ -10034,6 +9979,7 @@ function useViewerIntegration(input) {
|
|
|
10034
9979
|
handleEnterPresenterView,
|
|
10035
9980
|
handleEnterRehearsalMode,
|
|
10036
9981
|
autosaveStatus,
|
|
9982
|
+
recovery,
|
|
10037
9983
|
isEncryptedDialogOpen,
|
|
10038
9984
|
setIsEncryptedDialogOpen,
|
|
10039
9985
|
handlerRef,
|
|
Binary file
|
|
Binary file
|