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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-pdf-editor-1",
3
- "version": "1.2.44",
3
+ "version": "1.2.45",
4
4
  "description": "## Core",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.d.ts CHANGED
@@ -16,6 +16,7 @@ declare module 'pdf_editor_aleon35_react_plugin' {
16
16
  mode?: "split" | "regular",
17
17
  fileName?: string;
18
18
  onFileFailed?: (message: string) => void;
19
+ hideUndoRedoButtons?: boolean;
19
20
  }
20
21
  ) => {
21
22
  combineFiles: () => void;
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;