@ai-matrx/capture 0.2.0 → 0.2.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/dist/react.d.cts CHANGED
@@ -240,6 +240,9 @@ interface CameraCaptureProps {
240
240
  preview: React__default.ReactNode;
241
241
  /** Session media — enables the package-owned filmstrip + viewer + editor. */
242
242
  media?: CaptureMediaSession;
243
+ /** Fires when the package review loop (viewer or editor) opens/closes over
244
+ * the live feed — hosts pause things that watch the feed (QR scanning). */
245
+ onReviewOpenChange?: (open: boolean) => void;
243
246
  /** Close affordance top-left; omitted = no close button. */
244
247
  onClose?: () => void;
245
248
  /** Body + actions for the camera-blocked iOS-style sheet. */
@@ -252,7 +255,7 @@ interface CameraCaptureProps {
252
255
  shutterDisabled?: boolean;
253
256
  slots?: CaptureCameraSlots;
254
257
  }
255
- declare function CameraCapture({ engine, cloud, mode, onModeChange, preview, media, onClose, blockedSheet, controlsHidden, shutterDisabled, slots, }: CameraCaptureProps): React__default.JSX.Element;
258
+ declare function CameraCapture({ engine, cloud, mode, onModeChange, preview, media, onReviewOpenChange, onClose, blockedSheet, controlsHidden, shutterDisabled, slots, }: CameraCaptureProps): React__default.JSX.Element;
256
259
 
257
260
  /**
258
261
  * CameraFeed — the package's live preview <video> for the default engine
package/dist/react.d.ts CHANGED
@@ -240,6 +240,9 @@ interface CameraCaptureProps {
240
240
  preview: React__default.ReactNode;
241
241
  /** Session media — enables the package-owned filmstrip + viewer + editor. */
242
242
  media?: CaptureMediaSession;
243
+ /** Fires when the package review loop (viewer or editor) opens/closes over
244
+ * the live feed — hosts pause things that watch the feed (QR scanning). */
245
+ onReviewOpenChange?: (open: boolean) => void;
243
246
  /** Close affordance top-left; omitted = no close button. */
244
247
  onClose?: () => void;
245
248
  /** Body + actions for the camera-blocked iOS-style sheet. */
@@ -252,7 +255,7 @@ interface CameraCaptureProps {
252
255
  shutterDisabled?: boolean;
253
256
  slots?: CaptureCameraSlots;
254
257
  }
255
- declare function CameraCapture({ engine, cloud, mode, onModeChange, preview, media, onClose, blockedSheet, controlsHidden, shutterDisabled, slots, }: CameraCaptureProps): React__default.JSX.Element;
258
+ declare function CameraCapture({ engine, cloud, mode, onModeChange, preview, media, onReviewOpenChange, onClose, blockedSheet, controlsHidden, shutterDisabled, slots, }: CameraCaptureProps): React__default.JSX.Element;
256
259
 
257
260
  /**
258
261
  * CameraFeed — the package's live preview <video> for the default engine
package/dist/react.js CHANGED
@@ -1271,6 +1271,7 @@ function CameraCapture({
1271
1271
  onModeChange,
1272
1272
  preview,
1273
1273
  media,
1274
+ onReviewOpenChange,
1274
1275
  onClose,
1275
1276
  blockedSheet,
1276
1277
  controlsHidden = false,
@@ -1288,6 +1289,10 @@ function CameraCapture({
1288
1289
  const [blockedDismissed, setBlockedDismissed] = useState5(false);
1289
1290
  const countdownRef = useRef3(null);
1290
1291
  const controls = useTrackControls(engine.stream);
1292
+ const reviewOpen = viewerKey !== null || editTarget !== null;
1293
+ useEffect5(() => {
1294
+ onReviewOpenChange?.(reviewOpen);
1295
+ }, [reviewOpen, onReviewOpenChange]);
1291
1296
  const clearCountdown = useCallback4(() => {
1292
1297
  if (countdownRef.current) clearInterval(countdownRef.current);
1293
1298
  countdownRef.current = null;