@bendyline/squisq-video-react 2.4.21 → 2.4.23

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.
@@ -317,6 +317,7 @@ function VideoExportModal({
317
317
  ]);
318
318
  const [saving, setSaving] = useState(false);
319
319
  const [saveError, setSaveError] = useState(null);
320
+ const [savedOutput, setSavedOutput] = useState(null);
320
321
  const handleSave = useCallback(async () => {
321
322
  if (!downloadUrl || !outputBlob) return;
322
323
  const ts = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
@@ -329,11 +330,12 @@ function VideoExportModal({
329
330
  document.body.appendChild(a);
330
331
  a.click();
331
332
  document.body.removeChild(a);
333
+ setSavedOutput(outputBlob);
332
334
  return;
333
335
  }
334
336
  setSaving(true);
335
337
  try {
336
- await saveOutput(outputBlob, filename);
338
+ if (await saveOutput(outputBlob, filename) !== false) setSavedOutput(outputBlob);
337
339
  } catch (caught) {
338
340
  setSaveError(caught instanceof Error ? caught.message : "The export could not be saved.");
339
341
  } finally {
@@ -349,10 +351,11 @@ function VideoExportModal({
349
351
  onClose();
350
352
  }, [state, cancelExport, resetExport, onClose]);
351
353
  const isExporting = state === "preparing" || state === "capturing" || state === "encoding";
354
+ const escapeCloses = !preparingEdits && (state === "idle" || state === "error" || state === "complete" && outputBlob !== null && savedOutput === outputBlob);
352
355
  useModalDialog({
353
356
  rootRef: overlayRef,
354
357
  dialogRef,
355
- closeOnEscape: false,
358
+ closeOnEscape: escapeCloses,
356
359
  onClose: handleClose
357
360
  });
358
361
  return /* @__PURE__ */ jsx(
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  VideoExportButton,
3
3
  VideoExportModal
4
- } from "../chunk-WGHDQUGC.js";
4
+ } from "../chunk-TUZLVOSP.js";
5
5
  import {
6
6
  CoverImageExportModal,
7
7
  coverImageFilename,
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  VideoExportButton,
3
3
  VideoExportModal
4
- } from "./chunk-WGHDQUGC.js";
4
+ } from "./chunk-TUZLVOSP.js";
5
5
  import {
6
6
  CoverImageExportModal,
7
7
  coverImageFilename,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-video-react",
3
- "version": "2.4.21",
3
+ "version": "2.4.23",
4
4
  "description": "React components for browser-based MP4 and animated-GIF export of Squisq documents",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -77,9 +77,9 @@
77
77
  "react-dom": "^18.0.0 || ^19.0.0"
78
78
  },
79
79
  "dependencies": {
80
- "@bendyline/squisq": "2.11.15",
81
- "@bendyline/squisq-video": "2.3.19",
82
- "@bendyline/squisq-react": "2.11.17",
80
+ "@bendyline/squisq": "2.11.17",
81
+ "@bendyline/squisq-video": "2.3.21",
82
+ "@bendyline/squisq-react": "2.11.19",
83
83
  "@ffmpeg/core": "0.12.9",
84
84
  "@ffmpeg/ffmpeg": "0.12.15",
85
85
  "@ffmpeg/util": "0.12.2",