@camstack/addon-model-studio 1.1.158 → 1.1.159

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.
@@ -101,8 +101,11 @@ function w(n) {
101
101
  return t(r, i, i);
102
102
  }
103
103
  //#endregion
104
+ //#region ../ui-library/src/lib/responsive.ts
105
+ var T = "text-[10px] text-foreground-subtle";
106
+ //#endregion
104
107
  //#region ../ui-library/src/lib/cap-error.ts
105
- function T(e) {
108
+ function E(e) {
106
109
  if (typeof e != "object" || !e) return null;
107
110
  let t = Reflect.get(e, "data");
108
111
  if (typeof t == "object" && t) {
@@ -111,12 +114,9 @@ function T(e) {
111
114
  }
112
115
  return null;
113
116
  }
114
- function E(e) {
115
- let t = T(e);
117
+ function D(e) {
118
+ let t = E(e);
116
119
  return t === null ? (e instanceof Error ? e.message : String(e)).includes("provider not available") : t === "no-provider" || t === "node-offline";
117
120
  }
118
121
  //#endregion
119
- //#region ../ui-library/src/lib/responsive.ts
120
- var D = "text-[10px] text-foreground-subtle";
121
- //#endregion
122
- export { x as a, w as i, E as n, y as o, C as r, v as s, D as t };
122
+ export { x as a, w as i, T as n, y as o, C as r, v as s, D as t };
@@ -36,7 +36,7 @@ async function r() {
36
36
  }
37
37
  },
38
38
  "@camstack/types": {
39
- version: "1.2.234",
39
+ version: "1.2.235",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -81,7 +81,7 @@ async function r() {
81
81
  }
82
82
  },
83
83
  "@camstack/ui-library": {
84
- version: "1.2.190",
84
+ version: "1.2.191",
85
85
  scope: "default",
86
86
  shareConfig: {
87
87
  singleton: !0,
@@ -5884,7 +5884,7 @@ var ZodIssueCode = {
5884
5884
  var ZodFirstPartyTypeKind;
5885
5885
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5886
5886
  //#endregion
5887
- //#region ../types/dist/sleep-CopaBJss.mjs
5887
+ //#region ../types/dist/sleep-7AN_Txmu.mjs
5888
5888
  /**
5889
5889
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5890
5890
  * window to float samples (D455).
@@ -6084,12 +6084,6 @@ Object.fromEntries([
6084
6084
  icon: "circle-dot",
6085
6085
  order: 40
6086
6086
  },
6087
- {
6088
- id: "clips",
6089
- label: "Clips",
6090
- icon: "clapperboard",
6091
- order: 41
6092
- },
6093
6087
  {
6094
6088
  id: "engine",
6095
6089
  label: "Inference Engine",
@@ -24889,13 +24883,23 @@ DeviceType.Camera, method(object({
24889
24883
  until: number(),
24890
24884
  limit: number().int().positive().optional(),
24891
24885
  /**
24892
- * View filter over {@link ClipSourceSchema.source} values — the
24893
- * picker's selection, forwarded so a provider need not list what
24894
- * nobody is looking at. ABSENT means every source this camera has,
24895
- * which is the honest default for a surface whose whole point is that
24896
- * nothing is hidden (D554 3). A provider with one source ignores it.
24886
+ * WHICH provider to ask — the `addonId` a {@link ClipSourceSchema} row
24887
+ * carries, never a source id and never a list.
24888
+ *
24889
+ * Absent means the device's BOUND provider, which is CamStack on every
24890
+ * camera today because that is what `deviceManager.getBindings`
24891
+ * answers with. A provider the device is not bound to is refused by
24892
+ * name rather than answered by another one (D552's
24893
+ * `rejectUnresolvedAddonPin` rule).
24894
+ *
24895
+ * It replaced `sources?: string[]`, a VIEW filter over source ids that
24896
+ * assumed the answer was a fan-out over everything a camera has. The
24897
+ * operator settled otherwise on 2026-09-20 — *"il get videoclips
24898
+ * prendere un provider opzionale, di default va su camstack"*,
24899
+ * *"l'utilizzatore è uno solo"* — so the list is asked of one provider
24900
+ * at a time and there is nothing to filter out of it.
24897
24901
  */
24898
- sources: array(string()).optional()
24902
+ provider: string().optional()
24899
24903
  }), array(ClipSchema).readonly(), {
24900
24904
  kind: "query",
24901
24905
  auth: "protected"
@@ -5863,7 +5863,7 @@ var ZodIssueCode = {
5863
5863
  var ZodFirstPartyTypeKind;
5864
5864
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5865
5865
  //#endregion
5866
- //#region ../types/dist/sleep-CopaBJss.mjs
5866
+ //#region ../types/dist/sleep-7AN_Txmu.mjs
5867
5867
  /**
5868
5868
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5869
5869
  * window to float samples (D455).
@@ -6063,12 +6063,6 @@ Object.fromEntries([
6063
6063
  icon: "circle-dot",
6064
6064
  order: 40
6065
6065
  },
6066
- {
6067
- id: "clips",
6068
- label: "Clips",
6069
- icon: "clapperboard",
6070
- order: 41
6071
- },
6072
6066
  {
6073
6067
  id: "engine",
6074
6068
  label: "Inference Engine",
@@ -24868,13 +24862,23 @@ DeviceType.Camera, method(object({
24868
24862
  until: number(),
24869
24863
  limit: number().int().positive().optional(),
24870
24864
  /**
24871
- * View filter over {@link ClipSourceSchema.source} values — the
24872
- * picker's selection, forwarded so a provider need not list what
24873
- * nobody is looking at. ABSENT means every source this camera has,
24874
- * which is the honest default for a surface whose whole point is that
24875
- * nothing is hidden (D554 3). A provider with one source ignores it.
24865
+ * WHICH provider to ask — the `addonId` a {@link ClipSourceSchema} row
24866
+ * carries, never a source id and never a list.
24867
+ *
24868
+ * Absent means the device's BOUND provider, which is CamStack on every
24869
+ * camera today because that is what `deviceManager.getBindings`
24870
+ * answers with. A provider the device is not bound to is refused by
24871
+ * name rather than answered by another one (D552's
24872
+ * `rejectUnresolvedAddonPin` rule).
24873
+ *
24874
+ * It replaced `sources?: string[]`, a VIEW filter over source ids that
24875
+ * assumed the answer was a fan-out over everything a camera has. The
24876
+ * operator settled otherwise on 2026-09-20 — *"il get videoclips
24877
+ * prendere un provider opzionale, di default va su camstack"*,
24878
+ * *"l'utilizzatore è uno solo"* — so the list is asked of one provider
24879
+ * at a time and there is nothing to filter out of it.
24876
24880
  */
24877
- sources: array(string()).optional()
24881
+ provider: string().optional()
24878
24882
  }), array(ClipSchema).readonly(), {
24879
24883
  kind: "query",
24880
24884
  auth: "protected"
@@ -1,5 +1,5 @@
1
1
  import { h as e, l as t, u as n, y as r } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DJDHChgO.mjs";
2
- import { o as i, s as a } from "./responsive-DKi_zUXE.mjs";
2
+ import { o as i, s as a } from "./cap-error-DVLb2gz5.mjs";
3
3
  import { n as o, r as s, t as c } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-ds_Ehzaa.mjs";
4
4
  var l = a("chevron-down", [["path", {
5
5
  d: "m6 9 6 6 6-6",
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-BHgDHVD9.mjs";
1
+ import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DNIKrWko.mjs";
2
2
  export { t as get, e as init };
@@ -1,5 +1,5 @@
1
1
  import { c as e, h as t, p as n, y as r } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DJDHChgO.mjs";
2
- import { s as i } from "./responsive-DKi_zUXE.mjs";
2
+ import { s as i } from "./cap-error-DVLb2gz5.mjs";
3
3
  var a = i("camera", [["path", {
4
4
  d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
5
5
  key: "18u6gg"
@@ -1,4 +1,4 @@
1
- import { s as e } from "./responsive-DKi_zUXE.mjs";
1
+ import { s as e } from "./cap-error-DVLb2gz5.mjs";
2
2
  var t = e("eye-off", [
3
3
  ["path", {
4
4
  d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
@@ -1,4 +1,4 @@
1
- import { s as e } from "./responsive-DKi_zUXE.mjs";
1
+ import { s as e } from "./cap-error-DVLb2gz5.mjs";
2
2
  var t = e("trash-2", [
3
3
  ["path", {
4
4
  d: "M10 11v6",
@@ -2753,7 +2753,7 @@ async function rr(e) {
2753
2753
  }
2754
2754
  }
2755
2755
  async function ir() {
2756
- return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-Bc-pU5-a.mjs")).catch((e) => {
2756
+ return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-JG0cnfpo.mjs")).catch((e) => {
2757
2757
  throw tr = void 0, e;
2758
2758
  }), tr;
2759
2759
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-model-studio",
3
- "version": "1.1.158",
3
+ "version": "1.1.159",
4
4
  "description": "Custom detection model registry, conversion & distribution for CamStack",
5
5
  "keywords": [
6
6
  "camstack",
@@ -1,310 +0,0 @@
1
- import { c as e, h as t, m as n, p as r, u as i, y as a } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DJDHChgO.mjs";
2
- import { a as o, n as s, r as c, s as l, t as u } from "./responsive-DKi_zUXE.mjs";
3
- import { n as d, t as f } from "./player-overlays-BNT83Pmw.mjs";
4
- import { n as p, r as m, t as ee } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-ds_Ehzaa.mjs";
5
- import { MaskShapeCanvas as h } from "./MaskShapeCanvas-C4g96eMz.mjs";
6
- var g = l("grid-2x2", [
7
- ["path", {
8
- d: "M12 3v18",
9
- key: "108xh3"
10
- }],
11
- ["path", {
12
- d: "M3 12h18",
13
- key: "1i2n21"
14
- }],
15
- ["rect", {
16
- x: "3",
17
- y: "3",
18
- width: "18",
19
- height: "18",
20
- rx: "2",
21
- key: "h1oib"
22
- }]
23
- ]);
24
- //#endregion
25
- //#region ../ui-library/src/composites/cap-settings/MotionZonesSettings.tsx
26
- a();
27
- var _ = 110, v = "motion-zones", y = 0, b = [
28
- 1,
29
- 2,
30
- 3
31
- ], x = 1, S = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors", C = "rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";
32
- function w(e, t, n) {
33
- let r = t * n, i = Array.from({ length: r });
34
- for (let t = 0; t < r; t += 1) i[t] = e[t] === !0;
35
- return i;
36
- }
37
- function T(e, t) {
38
- if (e.length !== t.length) return !1;
39
- for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
40
- return !0;
41
- }
42
- function E(e, t) {
43
- return Math.ceil(e / t);
44
- }
45
- function D(e, t, n) {
46
- return Math.min(n - 1, Math.floor((e + .5) / t * n));
47
- }
48
- function O(e, t, n, r) {
49
- let i = E(t, r), a = E(n, r), o = Array.from({ length: i * a }, () => !1);
50
- for (let r = 0; r < n; r += 1) {
51
- let s = D(r, n, a);
52
- for (let n = 0; n < t; n += 1) e[r * t + n] === !0 && (o[s * i + D(n, t, i)] = !0);
53
- }
54
- return o;
55
- }
56
- function k(e, t, n, r) {
57
- let i = E(t, r), a = E(n, r), o = Array.from({ length: t * n }, () => !1);
58
- for (let r = 0; r < n; r += 1) {
59
- let s = D(r, n, a);
60
- for (let n = 0; n < t; n += 1) o[r * t + n] = e[s * i + D(n, t, i)] === !0;
61
- }
62
- return o;
63
- }
64
- function A({ deviceId: a }) {
65
- let l = c(o().trpcClient, a), [D, A] = t(null), [j, M] = t(!1), [N, P] = t(null), [F, I] = t(null), [L, R] = t(x), [z, B] = t(!1), [V, H] = t(!1), U = n(!1);
66
- i(() => {
67
- if (!l) return;
68
- let e = !1;
69
- return U.current = !1, A(null), M(!1), P(null), I(null), R(x), H(!1), (async () => {
70
- try {
71
- let t = await l.motionZones?.getOptions({});
72
- if (e) return;
73
- if (!t) throw Error("device proxy not ready");
74
- if (A(t), U.current) return;
75
- let n = await l.motionZones?.getStatus({});
76
- if (e) return;
77
- if (!n) throw Error("device proxy not ready");
78
- U.current = !0;
79
- let r = n.regions.find((e) => e.shape.kind === "grid"), i = w(r ? r.shape.cells : [], t.grid.width, t.grid.height);
80
- I(i), P(O(i, t.grid.width, t.grid.height, x));
81
- } catch (t) {
82
- if (e) return;
83
- s(t) ? M(!0) : console.error("Motion Zones load failed", t);
84
- }
85
- })(), () => {
86
- e = !0;
87
- };
88
- }, [l]);
89
- let W = D ? D.grid.width : 0, G = D ? D.grid.height : 0, K = E(W, L), q = E(G, L), J = r(() => N && D ? k(N, W, G, L) : null, [
90
- N,
91
- D,
92
- W,
93
- G,
94
- L
95
- ]), Y = r(() => J !== null && F !== null && !T(J, F), [J, F]), te = r(() => J ? J.reduce((e, t) => t ? e + 1 : e, 0) : 0, [J]), ne = W * G, X = K * q, Z = e((e) => {
96
- X > 0 && P(Array.from({ length: X }, () => e));
97
- }, [X]), re = e(() => {
98
- P((e) => e && e.map((e) => !e));
99
- }, []), ie = e(() => {
100
- F && D && P(O(F, W, G, L));
101
- }, [
102
- F,
103
- D,
104
- W,
105
- G,
106
- L
107
- ]), ae = e((e) => {
108
- e === L || !D || P((t) => {
109
- if (!t) return R(e), t;
110
- let n = O(k(t, W, G, L), W, G, e);
111
- return R(e), n;
112
- });
113
- }, [
114
- L,
115
- D,
116
- W,
117
- G
118
- ]), Q = r(() => D && N ? [{
119
- id: y,
120
- shape: {
121
- kind: "grid",
122
- gridWidth: K,
123
- gridHeight: q,
124
- cells: [...N]
125
- }
126
- }] : [], [
127
- D,
128
- N,
129
- K,
130
- q
131
- ]), $ = e((e, t) => {
132
- t.kind === "grid" && P(t.cells);
133
- }, []), oe = e(async () => {
134
- if (!(!l || !N || !D)) {
135
- B(!0);
136
- try {
137
- let e = k(N, D.grid.width, D.grid.height, L), t = {
138
- kind: "grid",
139
- gridWidth: D.grid.width,
140
- gridHeight: D.grid.height,
141
- cells: e
142
- };
143
- await l.motionZones?.setZone({ patch: { regions: [{
144
- id: y,
145
- enabled: !0,
146
- shape: t
147
- }] } });
148
- let n = await l.motionZones?.getStatus({});
149
- if (n) {
150
- let e = n.regions.find((e) => e.shape.kind === "grid"), t = w(e ? e.shape.cells : [], D.grid.width, D.grid.height);
151
- I(t), P(O(t, D.grid.width, D.grid.height, L));
152
- }
153
- } catch (e) {
154
- console.error("Motion Zones save failed", e);
155
- } finally {
156
- B(!1);
157
- }
158
- }
159
- }, [
160
- l,
161
- N,
162
- D,
163
- L
164
- ]);
165
- return f(r(() => V && !j && D && N ? {
166
- id: v,
167
- order: _,
168
- node: /* @__PURE__ */ p(h, {
169
- transparent: !0,
170
- items: Q,
171
- supportedShapes: ["grid"],
172
- grid: {
173
- width: K,
174
- height: q
175
- },
176
- selectedId: y,
177
- onSelect: () => {},
178
- onShapeChange: $,
179
- onDrawComplete: () => {},
180
- drawingKind: null
181
- })
182
- } : null, [
183
- V,
184
- j,
185
- D,
186
- N,
187
- Q,
188
- $,
189
- K,
190
- q
191
- ])), l ? /* @__PURE__ */ p(d, {
192
- title: "Motion Zones",
193
- icon: /* @__PURE__ */ p(g, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
194
- children: /* @__PURE__ */ p("div", {
195
- className: "flex flex-col gap-3",
196
- children: j ? /* @__PURE__ */ p("p", {
197
- className: `${u} leading-relaxed`,
198
- children: "This camera doesn't expose an on-board motion zones grid."
199
- }) : !j && D !== null && N !== null ? /* @__PURE__ */ m(ee, { children: [/* @__PURE__ */ m("p", {
200
- className: `${u} leading-relaxed`,
201
- children: [
202
- "Toggle ",
203
- /* @__PURE__ */ p("strong", {
204
- className: "text-foreground",
205
- children: "Edit grid"
206
- }),
207
- " to paint the region directly on the live frame, then ",
208
- /* @__PURE__ */ p("strong", {
209
- className: "text-foreground",
210
- children: "Save"
211
- }),
212
- " to push the mask to the camera. Pick a bigger",
213
- " ",
214
- /* @__PURE__ */ p("strong", {
215
- className: "text-foreground",
216
- children: "Cell size"
217
- }),
218
- " for quicker, broad-stroke painting — it's resampled to the camera's native ",
219
- D.grid.width,
220
- "×",
221
- D.grid.height,
222
- " grid on save (×1 is the finest)."
223
- ]
224
- }), /* @__PURE__ */ m("div", {
225
- className: "flex items-center gap-2 flex-wrap",
226
- children: [
227
- /* @__PURE__ */ p("button", {
228
- type: "button",
229
- onClick: () => H((e) => !e),
230
- disabled: z,
231
- "aria-pressed": V,
232
- className: V ? C : S,
233
- children: V ? "Done editing" : "Edit grid"
234
- }),
235
- /* @__PURE__ */ p("button", {
236
- type: "button",
237
- onClick: () => Z(!0),
238
- disabled: z,
239
- className: S,
240
- children: "All on"
241
- }),
242
- /* @__PURE__ */ p("button", {
243
- type: "button",
244
- onClick: () => Z(!1),
245
- disabled: z,
246
- className: S,
247
- children: "All off"
248
- }),
249
- /* @__PURE__ */ p("button", {
250
- type: "button",
251
- onClick: re,
252
- disabled: z,
253
- className: S,
254
- children: "Invert"
255
- }),
256
- /* @__PURE__ */ m("div", {
257
- className: "flex items-center gap-1 ml-1",
258
- role: "group",
259
- "aria-label": "Cell size",
260
- children: [/* @__PURE__ */ p("span", {
261
- className: `${u} mr-0.5`,
262
- children: "Cell size"
263
- }), b.map((e) => /* @__PURE__ */ m("button", {
264
- type: "button",
265
- onClick: () => ae(e),
266
- disabled: z,
267
- "aria-pressed": L === e,
268
- title: e === 1 ? `Camera grid ${W}×${G} (finest)` : `${E(W, e)}×${E(G, e)} painting grid · cells ×${e} bigger`,
269
- className: L === e ? C : S,
270
- children: ["×", e]
271
- }, e))]
272
- }),
273
- /* @__PURE__ */ m("span", {
274
- className: `${u} ml-1 tabular-nums`,
275
- children: [
276
- te,
277
- " / ",
278
- ne,
279
- " cells · ",
280
- D.grid.width,
281
- "×",
282
- D.grid.height,
283
- L === 1 ? "" : ` · paint ${K}×${q}`
284
- ]
285
- }),
286
- /* @__PURE__ */ p("span", { className: "flex-1" }),
287
- /* @__PURE__ */ p("button", {
288
- type: "button",
289
- onClick: ie,
290
- disabled: z || !Y,
291
- className: "rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",
292
- children: "Revert"
293
- }),
294
- /* @__PURE__ */ p("button", {
295
- type: "button",
296
- onClick: () => void oe(),
297
- disabled: z || !Y,
298
- className: C,
299
- children: z ? "Saving…" : "Save"
300
- })
301
- ]
302
- })] }) : /* @__PURE__ */ p("p", {
303
- className: `${u} leading-relaxed`,
304
- children: "Loading the camera's grid…"
305
- })
306
- })
307
- }) : null;
308
- }
309
- //#endregion
310
- export { A as MotionZonesSettings };