@ai-matrx/capture 0.5.0 → 0.5.2

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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog — @ai-matrx/capture
2
2
 
3
+ ## 0.5.2 — 2026-09-01
4
+
5
+ - `CameraCapture` no longer wraps the injected recents thumbnail in its Open-library button. Persisted-media error fallbacks may own remedy buttons (for example, Copy URL); those controls now remain valid siblings, act without also opening the library, and the non-interactive thumbnail area still opens the library.
6
+ - Added an exact fail-first regression covering the real `InlineMediaRef` error-panel shape and preventing nested interactive markup from returning.
7
+
3
8
  ## 0.1.0 — 2026-08-29
4
9
 
5
10
  Initial extraction from matrx-frontend `features/capture-camera/` (the iPhone-style rebuild of the commerce intake camera, generalized):
@@ -127,3 +132,25 @@ The injected-engine seam is unchanged: hosts with their own cross-feature
127
132
  media runtime (matrx-frontend's lease manager) still inject a
128
133
  `CaptureCameraEngine`; their adapters now import the package's crop /
129
134
  classification / flip helpers instead of carrying twins.
135
+
136
+ ### Consumer action (C28)
137
+
138
+ - **Host engine adapters**: delete local copies of the aspect crop, the
139
+ NotAllowedError/SecurityError classification, and the flip-cycling
140
+ algorithm — import `cropBlobToAspect`, `classifyCameraBlockReason`,
141
+ `nextCameraDevice`, `PHOTO_JPEG_QUALITY` from `@ai-matrx/capture/react`.
142
+ Any remaining adapter line must be lease-runtime identity wiring with a
143
+ C22 justification. (matrx-frontend: done same-session.)
144
+ - **Host cloud-library sheets**: replace bespoke tiled-gallery chrome with
145
+ the package `CloudLibrarySheet` — the host supplies
146
+ `items: CaptureCloudLibraryItem[]` (own thumbnail nodes), `loading`,
147
+ `onOpenItem`, optional `onUpload` (v3 in-library door). (matrx-frontend:
148
+ host copy collapsed to a data wrapper, consumer props unchanged.)
149
+ - **Runtime-less hosts**: adopt the rewritten `useDefaultCaptureEngine`
150
+ (now returns `DefaultCaptureEngine` = engine + `flash` +
151
+ `capturePhotoWith`; new options `mode`, `fileNamePrefix`, `onError`).
152
+ No breaking signature change — existing options still work.
153
+ - **`DefaultEngineOptions` behavior delta**: video capture callbacks now
154
+ fire with warm-mic-managed audio and the combined permission prompt;
155
+ hosts that suppressed their own double-prompt workarounds can delete
156
+ them.
package/dist/index.d.cts CHANGED
@@ -33,8 +33,8 @@ type CaptureAspect = "full" | "4:3" | "1:1" | "16:9";
33
33
  */
34
34
  interface CaptureCloudPort {
35
35
  /** Content of the bottom-left recents thumbnail (latest cloud/session
36
- * media). Null renders the placeholder the button still opens the
37
- * library. */
36
+ * media). Null renders the placeholder. Non-interactive thumbnail space
37
+ * opens the library; any injected remedy control owns its own action. */
38
38
  recentsThumb: React.ReactNode;
39
39
  /** Opens the host's cloud media library (tiled gallery). */
40
40
  onOpenLibrary: () => void;
package/dist/index.d.ts CHANGED
@@ -33,8 +33,8 @@ type CaptureAspect = "full" | "4:3" | "1:1" | "16:9";
33
33
  */
34
34
  interface CaptureCloudPort {
35
35
  /** Content of the bottom-left recents thumbnail (latest cloud/session
36
- * media). Null renders the placeholder the button still opens the
37
- * library. */
36
+ * media). Null renders the placeholder. Non-interactive thumbnail space
37
+ * opens the library; any injected remedy control owns its own action. */
38
38
  recentsThumb: React.ReactNode;
39
39
  /** Opens the host's cloud media library (tiled gallery). */
40
40
  onOpenLibrary: () => void;
package/dist/react.cjs CHANGED
@@ -1553,6 +1553,18 @@ function CameraCapture({
1553
1553
  const [timerSetting, setTimerSetting] = (0, import_react5.useState)(0);
1554
1554
  const [aspect, setAspect] = (0, import_react5.useState)("full");
1555
1555
  const [exposureOpen, setExposureOpen] = (0, import_react5.useState)(false);
1556
+ const openLibraryFromRecents = (0, import_react5.useCallback)(
1557
+ (event) => {
1558
+ const target = event.target;
1559
+ if (target instanceof Element && target.closest(
1560
+ "button, a, input, select, textarea, [role='button'], [role='link']"
1561
+ )) {
1562
+ return;
1563
+ }
1564
+ cloud.onOpenLibrary();
1565
+ },
1566
+ [cloud]
1567
+ );
1556
1568
  const [countdown, setCountdown] = (0, import_react5.useState)(null);
1557
1569
  const [blockedDismissed, setBlockedDismissed] = (0, import_react5.useState)(false);
1558
1570
  const countdownRef = (0, import_react5.useRef)(null);
@@ -1800,16 +1812,26 @@ function CameraCapture({
1800
1812
  slots.modeRowTrailing && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "shrink-0", children: slots.modeRowTrailing })
1801
1813
  ] }),
1802
1814
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between px-2 pb-1.5 pt-0.5", children: [
1803
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex w-14 justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1804
- "button",
1805
- {
1806
- type: "button",
1807
- onClick: cloud.onOpenLibrary,
1808
- "aria-label": "Open your media library",
1809
- className: "h-11 w-11 touch-manipulation overflow-hidden rounded-xl bg-white/10 ring-1 ring-white/25 transition-transform active:scale-95",
1810
- children: cloud.recentsThumb ?? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "block h-full w-full bg-white/5" })
1811
- }
1812
- ) }),
1815
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex w-14 justify-start", children: [
1816
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1817
+ "div",
1818
+ {
1819
+ onClick: openLibraryFromRecents,
1820
+ className: "h-11 w-11 touch-manipulation overflow-hidden rounded-xl bg-white/10 ring-1 ring-white/25 transition-transform active:scale-95",
1821
+ children: cloud.recentsThumb ?? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "block h-full w-full bg-white/5" })
1822
+ }
1823
+ ),
1824
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1825
+ "button",
1826
+ {
1827
+ type: "button",
1828
+ onClick: cloud.onOpenLibrary,
1829
+ "aria-label": "Open your media library",
1830
+ className: "sr-only",
1831
+ children: "Open your media library"
1832
+ }
1833
+ )
1834
+ ] }),
1813
1835
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1814
1836
  ShutterButton,
1815
1837
  {