@camera.ui/sdk 0.0.18 → 0.0.19

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/index.d.ts CHANGED
@@ -3135,7 +3135,7 @@ declare abstract class Sensor<TProperties extends object, TStorage extends objec
3135
3135
  * Helper for `reportDetections(detected, detections?)` flows.
3136
3136
  *
3137
3137
  * - If `detected === false` → returns `[]` (clear).
3138
- * - If `detected === true` and `detections` has items → returns them as-is.
3138
+ * - If `detected === true` and `detections` has items → returns them, substituting a full-frame box where missing.
3139
3139
  * - If `detected === true` and `detections` is missing/empty → returns a single
3140
3140
  * synthesized full-frame detection with the given `fallbackLabel` and any
3141
3141
  * `fallbackExtra` fields (used for type-specific properties like `attribute`,
@@ -233,7 +233,7 @@ export class Sensor {
233
233
  * Helper for `reportDetections(detected, detections?)` flows.
234
234
  *
235
235
  * - If `detected === false` → returns `[]` (clear).
236
- * - If `detected === true` and `detections` has items → returns them as-is.
236
+ * - If `detected === true` and `detections` has items → returns them, substituting a full-frame box where missing.
237
237
  * - If `detected === true` and `detections` is missing/empty → returns a single
238
238
  * synthesized full-frame detection with the given `fallbackLabel` and any
239
239
  * `fallbackExtra` fields (used for type-specific properties like `attribute`,
@@ -257,8 +257,12 @@ export class Sensor {
257
257
  _normalizeReportedDetections(detected, detections, fallbackLabel, fallbackExtra) {
258
258
  if (!detected)
259
259
  return [];
260
- if (detections && detections.length > 0)
261
- return detections;
260
+ if (detections && detections.length > 0) {
261
+ // Smart-camera plugins (Ring, Reolink, ...) report labels without
262
+ // coordinates, while downstream consumers (detection coordinator, zone
263
+ // matching) require a box on every detection — substitute full-frame.
264
+ return detections.map((detection) => (detection.box ? detection : { ...detection, box: { x: 0, y: 0, width: 1, height: 1 } }));
265
+ }
262
266
  return [
263
267
  {
264
268
  label: fallbackLabel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/sdk",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "camera.ui sdk",
5
5
  "exports": {
6
6
  ".": {