react-pdf-editor-1 1.2.44 → 1.2.45
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/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +15 -2
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -18,7 +18,8 @@ export const useCreateIframeAndLoadViewer = ({
|
|
|
18
18
|
notarySeal,
|
|
19
19
|
initialSigners,
|
|
20
20
|
modifiedUiElements,
|
|
21
|
-
textTagDefaults
|
|
21
|
+
textTagDefaults,
|
|
22
|
+
hideUndoRedoButtons
|
|
22
23
|
}) => {
|
|
23
24
|
const [internalIsReady, setInternalIsReady] = useState(false); // Add this state variable
|
|
24
25
|
const [selectedPages, setSelectedPages] = useState([]);
|
|
@@ -55,7 +56,7 @@ export const useCreateIframeAndLoadViewer = ({
|
|
|
55
56
|
// When the iframe is loaded, post the file to it
|
|
56
57
|
iframe.onload = function() {
|
|
57
58
|
const targetOrigin = window.location.origin;
|
|
58
|
-
const message = { files, fileName, tools, locale, licenseKey, mode, uuid, customData, initialAnnotations, notarySeal, initialSigners, modifiedUiElements, authInfo, defaultAnnotationEditorMode, textTagDefaults };
|
|
59
|
+
const message = { files, fileName, tools, locale, licenseKey, mode, uuid, customData, initialAnnotations, notarySeal, initialSigners, modifiedUiElements, authInfo, defaultAnnotationEditorMode, textTagDefaults, hideUndoRedoButtons };
|
|
59
60
|
|
|
60
61
|
// Set up a function to send the message
|
|
61
62
|
const sendMessage = () => {
|
|
@@ -195,6 +196,18 @@ export const useCreateIframeAndLoadViewer = ({
|
|
|
195
196
|
};
|
|
196
197
|
}, []);
|
|
197
198
|
|
|
199
|
+
useEffect(() => {
|
|
200
|
+
if (typeof hideUndoRedoButtons === 'undefined') {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (!internalIsReady) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
const iframeWin = document?.getElementById('webviewer-1')?.contentWindow;
|
|
208
|
+
iframeWin?.postMessage({ hideUndoRedoButtons }, window.location.origin);
|
|
209
|
+
}, [hideUndoRedoButtons, internalIsReady]);
|
|
210
|
+
|
|
198
211
|
const download = () => {
|
|
199
212
|
// @ts-ignore
|
|
200
213
|
var iframeWin = document?.getElementById('webviewer-1')?.contentWindow;
|