pptx-react-viewer 4.48.0 → 4.49.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 +20 -0
- package/dist/{chunk-5FAX7F3O.js → chunk-2ZXXHNNR.js} +218 -276
- package/dist/chunk-2ZXXHNNR.js.br +0 -0
- package/dist/chunk-2ZXXHNNR.js.gz +0 -0
- package/dist/{chunk-JKZNL6HP.js → chunk-ME5QRTVS.js} +33 -57
- package/dist/chunk-ME5QRTVS.js.br +0 -0
- package/dist/chunk-ME5QRTVS.js.gz +0 -0
- package/dist/{chunk-H7JRMKYC.mjs → chunk-YKLL2Z33.mjs} +100 -158
- package/dist/chunk-YKLL2Z33.mjs.br +0 -0
- package/dist/chunk-YKLL2Z33.mjs.gz +0 -0
- package/dist/{chunk-JHQHAO43.mjs → chunk-Z62JFXMZ.mjs} +34 -58
- package/dist/chunk-Z62JFXMZ.mjs.br +0 -0
- package/dist/chunk-Z62JFXMZ.mjs.gz +0 -0
- package/dist/index.js +22 -22
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +80 -80
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +1 -1
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.js +17 -17
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +2 -2
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +3 -3
- package/dist/chunk-5FAX7F3O.js.br +0 -0
- package/dist/chunk-5FAX7F3O.js.gz +0 -0
- package/dist/chunk-H7JRMKYC.mjs.br +0 -0
- package/dist/chunk-H7JRMKYC.mjs.gz +0 -0
- package/dist/chunk-JHQHAO43.mjs.br +0 -0
- package/dist/chunk-JHQHAO43.mjs.gz +0 -0
- package/dist/chunk-JKZNL6HP.js.br +0 -0
- package/dist/chunk-JKZNL6HP.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -7556,6 +7556,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
7556
7556
|
const { default: html2canvasPro } = await import('html2canvas-pro');
|
|
7557
7557
|
return html2canvasPro(element, {
|
|
7558
7558
|
...options,
|
|
7559
|
+
// Clone only the captured element's branch: html2canvas would copy the whole page.
|
|
7560
|
+
ignoreElements: pptx.html2canvasCaptureScope(element, options.ignoreElements),
|
|
7559
7561
|
onclone: async (doc, clonedEl) => {
|
|
7560
7562
|
await pptx.prepareHtml2CanvasClone(element, doc, clonedEl);
|
|
7561
7563
|
if (typeof userOnClone === "function") {
|
|
@@ -13183,73 +13185,47 @@ function useReadOnlyRecommendationState(content) {
|
|
|
13183
13185
|
() => pptx.readOnlyRecommendation(void 0)
|
|
13184
13186
|
);
|
|
13185
13187
|
const [modifyVerifier, setModifyVerifier] = React17.useState(void 0);
|
|
13186
|
-
const [
|
|
13187
|
-
const
|
|
13188
|
-
const
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
setPasswordPromptOpen(false);
|
|
13195
|
-
setPasswordError(null);
|
|
13196
|
-
setCheckingPassword(false);
|
|
13197
|
-
}, [content]);
|
|
13198
|
-
const unlock = React17.useCallback(() => {
|
|
13199
|
-
setEditAnywayActive(true);
|
|
13200
|
-
setBannerHidden(true);
|
|
13201
|
-
setPasswordPromptOpen(false);
|
|
13202
|
-
setPasswordError(null);
|
|
13203
|
-
}, []);
|
|
13204
|
-
const editAnyway = React17.useCallback(() => {
|
|
13205
|
-
if (recommendation.requiresPassword) {
|
|
13206
|
-
setPasswordPromptOpen(true);
|
|
13207
|
-
setPasswordError(null);
|
|
13208
|
-
return;
|
|
13209
|
-
}
|
|
13210
|
-
unlock();
|
|
13211
|
-
}, [recommendation.requiresPassword, unlock]);
|
|
13212
|
-
const dismiss = React17.useCallback(() => {
|
|
13213
|
-
setBannerHidden(true);
|
|
13214
|
-
}, []);
|
|
13215
|
-
const cancelPasswordPrompt = React17.useCallback(() => {
|
|
13216
|
-
setPasswordPromptOpen(false);
|
|
13217
|
-
setPasswordError(null);
|
|
13218
|
-
}, []);
|
|
13219
|
-
const submitPassword = React17.useCallback(
|
|
13220
|
-
async (password) => {
|
|
13221
|
-
setCheckingPassword(true);
|
|
13222
|
-
try {
|
|
13223
|
-
const result = await pptx.checkModifyPassword(modifyVerifier, password);
|
|
13224
|
-
if (result.ok) {
|
|
13225
|
-
unlock();
|
|
13226
|
-
} else {
|
|
13227
|
-
setPasswordError(result.reason);
|
|
13228
|
-
}
|
|
13229
|
-
} finally {
|
|
13230
|
-
setCheckingPassword(false);
|
|
13188
|
+
const [session, setSession] = React17.useState(pptx.INITIAL_READ_ONLY_SESSION);
|
|
13189
|
+
const latestSession = React17.useRef(session);
|
|
13190
|
+
const store = React17.useMemo(
|
|
13191
|
+
() => ({
|
|
13192
|
+
get: () => latestSession.current,
|
|
13193
|
+
set: (next) => {
|
|
13194
|
+
latestSession.current = next;
|
|
13195
|
+
setSession(next);
|
|
13231
13196
|
}
|
|
13232
|
-
},
|
|
13233
|
-
|
|
13234
|
-
|
|
13197
|
+
}),
|
|
13198
|
+
[]
|
|
13199
|
+
);
|
|
13200
|
+
const actions = React17.useMemo(
|
|
13201
|
+
() => pptx.readOnlySessionActions(store, {
|
|
13202
|
+
recommendation: () => recommendation,
|
|
13203
|
+
modifyVerifier: () => modifyVerifier
|
|
13204
|
+
}),
|
|
13205
|
+
[store, recommendation, modifyVerifier]
|
|
13235
13206
|
);
|
|
13207
|
+
React17.useEffect(() => {
|
|
13208
|
+
pptx.applyReadOnlySessionEvent(store, { type: "reset" });
|
|
13209
|
+
}, [content, store]);
|
|
13236
13210
|
return {
|
|
13237
13211
|
recommendation,
|
|
13238
13212
|
setRecommendation,
|
|
13239
13213
|
setModifyVerifier,
|
|
13240
13214
|
/** Whether the viewer's `canEdit` should be forced off. */
|
|
13241
|
-
locked: recommendation
|
|
13242
|
-
bannerVisible: recommendation
|
|
13243
|
-
|
|
13244
|
-
|
|
13215
|
+
locked: pptx.readOnlyLocked(recommendation, session),
|
|
13216
|
+
bannerVisible: pptx.readOnlyBannerVisible(recommendation, session),
|
|
13217
|
+
/** The banner's "Edit anyway": opens the password prompt when one is required, else unlocks. */
|
|
13218
|
+
editAnyway: actions.editAnyway,
|
|
13219
|
+
dismiss: actions.dismiss,
|
|
13245
13220
|
/** Whether the inline password prompt should render in place of the banner's buttons. */
|
|
13246
|
-
passwordPromptOpen,
|
|
13221
|
+
passwordPromptOpen: session.passwordPromptOpen,
|
|
13247
13222
|
/** Reason the last password attempt failed, or null before any attempt / after success. */
|
|
13248
|
-
passwordError,
|
|
13223
|
+
passwordError: session.passwordError,
|
|
13249
13224
|
/** True while `submitPassword`'s check is in flight (disables the form). */
|
|
13250
|
-
checkingPassword,
|
|
13251
|
-
|
|
13252
|
-
|
|
13225
|
+
checkingPassword: session.checkingPassword,
|
|
13226
|
+
/** Check `password` against the deck's `modifyVerifier`; unlocks on a match. */
|
|
13227
|
+
submitPassword: actions.submitPassword,
|
|
13228
|
+
cancelPasswordPrompt: actions.cancelPassword
|
|
13253
13229
|
};
|
|
13254
13230
|
}
|
|
13255
13231
|
function useViewPreferencesSync(input) {
|
|
Binary file
|
|
Binary file
|