ablok-components 0.3.134 → 0.3.137

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.
@@ -2,6 +2,6 @@ import e from "../../../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./base-camera.vue_vue_type_script_setup_true_lang.js";
3
3
  /* empty css */
4
4
  //#region src/components/molecules/base-camera/base-camera.vue
5
- var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-6eb2389c"]]);
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-bdd9593d"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -119,6 +119,14 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
119
119
  type: StringConstructor;
120
120
  default: string;
121
121
  };
122
+ screenFlashFullscreen: {
123
+ type: BooleanConstructor;
124
+ default: boolean;
125
+ };
126
+ enableTorch: {
127
+ type: BooleanConstructor;
128
+ default: boolean;
129
+ };
122
130
  enableShutterAnimation: {
123
131
  type: BooleanConstructor;
124
132
  default: boolean;
@@ -137,6 +145,9 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
137
145
  permission: import('../../../../vue/dist/vue.esm-bundler.js').ComputedRef<import('../../../utilities/camera/types').CameraPermission>;
138
146
  zoom: import('../../../../vue/dist/vue.esm-bundler.js').ComputedRef<number>;
139
147
  zoomCapability: import('../../../../vue/dist/vue.esm-bundler.js').ComputedRef<import('../../../utilities/camera/types').ZoomCapability | null>;
148
+ torch: import('../../../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
149
+ torchCapability: import('../../../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
150
+ canLockExposure: import('../../../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
140
151
  isLive: import('../../../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
141
152
  isPaused: import('../../../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
142
153
  isStarting: import('../../../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
@@ -151,6 +162,8 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
151
162
  selectDevice: (deviceId: string) => Promise<boolean>;
152
163
  setResolution: (r: Resolution) => Promise<boolean>;
153
164
  setZoom: (z: number) => Promise<boolean>;
165
+ setTorch: (on: boolean) => Promise<boolean>;
166
+ setExposureLocked: (locked: boolean) => Promise<boolean>;
154
167
  refreshDevices: () => Promise<void>;
155
168
  bindVideo: (el: HTMLVideoElement | null) => void;
156
169
  };
@@ -279,6 +292,14 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
279
292
  type: StringConstructor;
280
293
  default: string;
281
294
  };
295
+ screenFlashFullscreen: {
296
+ type: BooleanConstructor;
297
+ default: boolean;
298
+ };
299
+ enableTorch: {
300
+ type: BooleanConstructor;
301
+ default: boolean;
302
+ };
282
303
  enableShutterAnimation: {
283
304
  type: BooleanConstructor;
284
305
  default: boolean;
@@ -309,6 +330,8 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
309
330
  enableControls: boolean;
310
331
  enableScreenFlash: boolean;
311
332
  screenFlashColor: string;
333
+ screenFlashFullscreen: boolean;
334
+ enableTorch: boolean;
312
335
  enableShutterAnimation: boolean;
313
336
  }, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {}, any>;
314
337
  declare const _default: typeof __VLS_export;
@@ -3,50 +3,50 @@ import t from "../input-dropdown/input-dropdown.js";
3
3
  import { captureFrame as n, exportCanvas as r } from "../../../utilities/camera/capture.js";
4
4
  import { useCamera as i } from "../../../composables/useCamera.js";
5
5
  import a from "../camera-preview/camera-preview.js";
6
- import ee from "../../atoms/zoom-slider/zoom-slider.js";
7
- import o from "../../../assets/img/guide.js";
8
- import { Transition as te, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, normalizeStyle as ne, onMounted as m, onScopeDispose as re, openBlock as h, ref as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
6
+ import o from "../../atoms/zoom-slider/zoom-slider.js";
7
+ import s from "../../../assets/img/guide.js";
8
+ import { Teleport as c, Transition as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineComponent as g, normalizeClass as ee, normalizeStyle as te, onMounted as ne, onScopeDispose as re, openBlock as _, ref as v, toDisplayString as y, unref as b, watch as x, withCtx as S } from "vue";
9
9
  //#region src/components/molecules/base-camera/base-camera.vue?vue&type=script&setup=true&lang.ts
10
10
  var ie = {
11
11
  class: "base-camera position-relative w-100 user-select-none",
12
12
  "data-bs-theme": "dark"
13
- }, ae = ["src"], oe = { class: "position-absolute top-0 start-0 end-0 d-flex justify-content-between align-items-start p-2 gap-2" }, se = { key: 1 }, ce = ["disabled"], le = {
13
+ }, C = ["src"], ae = { class: "position-absolute top-0 start-0 end-0 d-flex align-items-start p-2 gap-2 base-camera__top-bar" }, oe = { class: "base-camera__select-col" }, se = { key: 1 }, ce = { class: "d-flex align-items-center ms-auto gap-2" }, le = ["aria-label"], ue = ["disabled"], de = {
14
14
  key: 1,
15
15
  class: "position-absolute top-0 start-0 w-100 h-100 d-flex flex-column align-items-center justify-content-center text-center p-3 bg-black bg-opacity-50"
16
- }, ue = {
16
+ }, fe = {
17
17
  key: 0,
18
18
  class: "spinner-border text-light",
19
19
  role: "status"
20
- }, de = {
20
+ }, pe = {
21
21
  key: 1,
22
22
  class: "alert alert-danger py-2 px-3 mb-0 small"
23
- }, fe = { class: "mb-2" }, pe = { class: "position-absolute bottom-0 start-0 end-0 p-3 d-flex flex-column gap-2 align-items-center" }, me = {
23
+ }, me = { class: "mb-2" }, he = { class: "position-absolute bottom-0 start-0 end-0 p-3 d-flex flex-column gap-2 align-items-center" }, ge = {
24
24
  key: 0,
25
25
  class: "d-flex align-items-center justify-content-center gap-4 w-100"
26
- }, he = ["disabled", "aria-label"], ge = {
26
+ }, _e = ["disabled", "aria-label"], ve = {
27
27
  key: 0,
28
28
  viewBox: "0 0 24 24",
29
29
  width: "22",
30
30
  height: "22",
31
31
  fill: "currentColor",
32
32
  "aria-hidden": "true"
33
- }, _e = {
33
+ }, ye = {
34
34
  key: 1,
35
35
  viewBox: "0 0 24 24",
36
36
  width: "22",
37
37
  height: "22",
38
38
  fill: "currentColor",
39
39
  "aria-hidden": "true"
40
- }, ve = ["disabled"], ye = ["aria-label"], be = {
40
+ }, be = ["disabled"], xe = {
41
41
  key: 2,
42
42
  class: "base-camera__countdown-overlay",
43
43
  role: "status",
44
44
  "aria-live": "polite",
45
45
  "aria-atomic": "true"
46
- }, x = ["data-countdown"], S = {
46
+ }, Se = ["data-countdown"], Ce = {
47
47
  key: 0,
48
48
  class: "base-camera__zoom"
49
- }, C = /*@__PURE__*/ p({
49
+ }, we = 200, w = /*@__PURE__*/ g({
50
50
  __name: "base-camera",
51
51
  props: {
52
52
  modelValue: { type: null },
@@ -154,7 +154,7 @@ var ie = {
154
154
  },
155
155
  guideSrc: {
156
156
  type: String,
157
- default: o
157
+ default: s
158
158
  },
159
159
  enableControls: {
160
160
  type: Boolean,
@@ -168,6 +168,14 @@ var ie = {
168
168
  type: String,
169
169
  default: "#FFFFFF"
170
170
  },
171
+ screenFlashFullscreen: {
172
+ type: Boolean,
173
+ default: !1
174
+ },
175
+ enableTorch: {
176
+ type: Boolean,
177
+ default: !0
178
+ },
171
179
  enableShutterAnimation: {
172
180
  type: Boolean,
173
181
  default: !0
@@ -180,226 +188,245 @@ var ie = {
180
188
  "error",
181
189
  "state"
182
190
  ],
183
- setup(o, { expose: p, emit: C }) {
184
- let w = o, T = C, E = g(null), D = s(() => E.value?.videoEl ?? null), O = s(() => w.resolutions[w.ratio] ?? {
191
+ setup(s, { expose: g, emit: w }) {
192
+ let T = s, E = w, D = v(null), O = u(() => D.value?.videoEl ?? null), k = u(() => T.resolutions[T.ratio] ?? {
185
193
  width: 720,
186
194
  height: 960
187
- }), k = i({
188
- preferredFacing: w.defaultRearCamera ? "environment" : "user",
189
- resolution: O.value,
190
- videoRef: D,
191
- onWarning: (e) => T("error", e)
192
- }), A = s(() => w.enableMirrorCamera && k.activeFacing.value !== "environment"), j = s(() => w.enableSelectDevice && k.devices.value.length > 1), M = s(() => w.enableSwitchCamera && k.canSwitch.value), N = s(() => w.enableZoomSlider && k.zoomCapability.value !== null), P = s(() => k.isLive.value || k.isPaused.value), F = g(!1), I = g(0), L = g(!1), R = g(0), z = g(!1), B = g(0), V = g(w.enableScreenFlash);
193
- y(() => w.enableScreenFlash, (e) => {
194
- V.value = e;
195
+ }), A = i({
196
+ preferredFacing: T.defaultRearCamera ? "environment" : "user",
197
+ resolution: k.value,
198
+ videoRef: O,
199
+ onWarning: (e) => E("error", e)
200
+ }), j = u(() => T.enableMirrorCamera && A.activeFacing.value !== "environment"), Te = u(() => T.enableSelectDevice && A.devices.value.length > 1), Ee = u(() => T.enableSwitchCamera && A.canSwitch.value), De = u(() => T.enableZoomSlider && A.zoomCapability.value !== null), M = u(() => A.isLive.value || A.isPaused.value), N = v(!1), P = v(0), F = v(!1), I = v(0), L = v(!1), R = v(0), z = v(T.enableScreenFlash);
201
+ x(() => T.enableScreenFlash, (e) => {
202
+ z.value = e;
195
203
  });
196
- let H = null, U = null, W = null, G = null, K = null, q = null, J = null, Y = !1, X = g(w.zoom);
197
- y(() => w.zoom, (e) => {
198
- X.value = e;
199
- }), y(X, (e) => {
200
- k.setZoom(e), e !== w.zoom && T("update:zoom", e);
201
- }), y(k.zoom, (e) => {
202
- k.zoomCapability.value && e !== X.value && (X.value = e);
203
- }), y(k.zoomCapability, (e) => {
204
- e && k.setZoom(X.value);
205
- }), y(k.state, (e) => T("state", e)), y(k.error, (e) => {
206
- e && T("error", e);
207
- }), y(O, (e) => void k.setResolution(e)), m(() => {
208
- w.autoStart && k.start();
204
+ let B = null, V = null, H = null, U = null, W = null, G = null, K = null, q = null, J = !1, Y = v(T.zoom);
205
+ x(() => T.zoom, (e) => {
206
+ Y.value = e;
207
+ }), x(Y, (e) => {
208
+ A.setZoom(e), e !== T.zoom && E("update:zoom", e);
209
+ }), x(A.zoom, (e) => {
210
+ A.zoomCapability.value && e !== Y.value && (Y.value = e);
211
+ }), x(A.zoomCapability, (e) => {
212
+ e && A.setZoom(Y.value);
213
+ }), x(A.state, (e) => E("state", e)), x(A.error, (e) => {
214
+ e && E("error", e);
215
+ }), x(k, (e) => void A.setResolution(e)), ne(() => {
216
+ T.autoStart && A.start();
209
217
  }), re(() => {
210
- Y = !0, U && clearTimeout(U), W && clearTimeout(W), G && clearTimeout(G), U = null, W = null, G = null, J?.(!1), J = null, Z(), I.value = 0, L.value = !1, z.value = !1;
218
+ J = !0, V && clearTimeout(V), H && clearTimeout(H), W && clearTimeout(W), V = null, H = null, W = null, q?.(!1), q = null, X(), Z(), P.value = 0, F.value = !1, L.value = !1;
211
219
  });
212
- function xe() {
213
- w.enableShutterAnimation && (W && clearTimeout(W), R.value++, L.value = !0, W = setTimeout(() => {
214
- W = null, L.value = !1;
215
- }, 650));
220
+ function X() {
221
+ H && clearTimeout(H), H = null, F.value = !1, U?.(), U = null;
222
+ }
223
+ function Oe() {
224
+ if (!T.enableShutterAnimation) return Promise.resolve();
225
+ X(), I.value++, F.value = !0;
226
+ let e = new Promise((e) => {
227
+ U = e;
228
+ });
229
+ return H = setTimeout(X, 650), e;
216
230
  }
217
231
  function Z() {
218
- K && clearTimeout(K), K = null, q?.(), q = null;
232
+ G && clearTimeout(G), G = null, K?.(), K = null;
219
233
  }
220
- function Q() {
221
- if (!V.value) return {
234
+ function ke() {
235
+ if (!z.value) return {
222
236
  peak: Promise.resolve(),
223
237
  faded: Promise.resolve()
224
238
  };
225
- G && clearTimeout(G), Z(), B.value++, z.value = !0;
239
+ W && clearTimeout(W), Z(), R.value++, L.value = !0;
226
240
  let e = new Promise((e) => {
227
- q = e;
241
+ K = e;
228
242
  });
229
- return G = setTimeout(() => {
230
- G = null, z.value = !1, K = setTimeout(Z, 400);
243
+ return W = setTimeout(() => {
244
+ W = null, L.value = !1, G = setTimeout(Z, 400);
231
245
  }, 350), {
232
246
  peak: new Promise((e) => setTimeout(e, 120)),
233
247
  faded: e
234
248
  };
235
249
  }
236
- async function Se() {
237
- let e = D.value;
238
- if (!e || !P.value || F.value) return null;
239
- F.value = !0;
250
+ function Ae(e) {
251
+ return new Promise((t) => setTimeout(t, e));
252
+ }
253
+ async function je() {
254
+ let e = O.value;
255
+ if (!e || !M.value || N.value) return null;
256
+ N.value = !0;
257
+ let t = T.enableTorch && A.torchCapability.value, i = !1, a = !1;
240
258
  try {
241
- let t = Q();
242
- if (await t.peak, Y || !P.value) return null;
243
- let i = n(e, {
244
- width: O.value.width,
245
- height: O.value.height,
246
- mirror: A.value,
247
- filter: w.filter,
248
- tintColor: w.tintColor,
249
- tintIntensity: w.tintIntensity
250
- });
251
- xe();
252
- let a = await r(i, { asBlob: w.emitBlob });
253
- return await t.faded, Y ? null : (T("update:modelValue", a), T("capture", a, i), a);
259
+ t ? (i = await A.setTorch(!0), i && await Ae(we)) : z.value && (a = await A.setExposureLocked(!0));
260
+ let o = ke();
261
+ if (await o.peak, J || !M.value) return null;
262
+ let s = n(e, {
263
+ width: k.value.width,
264
+ height: k.value.height,
265
+ mirror: j.value,
266
+ filter: T.filter,
267
+ tintColor: T.tintColor,
268
+ tintIntensity: T.tintIntensity
269
+ }), c = Oe(), l = await r(s, { asBlob: T.emitBlob });
270
+ return await Promise.all([o.faded, c]), J ? null : (E("update:modelValue", l), E("capture", l, s), l);
254
271
  } finally {
255
- F.value = !1;
272
+ i && A.setTorch(!1), a && A.setExposureLocked(!1), N.value = !1;
256
273
  }
257
274
  }
258
- function Ce() {
275
+ function Q() {
259
276
  return new Promise((e) => {
260
- J = e, U = setTimeout(() => {
261
- U = null, J = null, e(!0);
277
+ q = e, V = setTimeout(() => {
278
+ V = null, q = null, e(!0);
262
279
  }, 1e3);
263
280
  });
264
281
  }
265
- async function we() {
266
- let e = Number.isFinite(w.countdown) ? Math.max(0, Math.floor(w.countdown)) : 0;
267
- for (let t = e; t > 0; t--) if (I.value = t, !await Ce()) return null;
268
- return I.value = 0, Y ? null : Se();
282
+ async function Me() {
283
+ let e = Number.isFinite(T.countdown) ? Math.max(0, Math.floor(T.countdown)) : 0;
284
+ for (let t = e; t > 0; t--) if (P.value = t, !await Q()) return null;
285
+ return P.value = 0, J ? null : je();
269
286
  }
270
287
  function $() {
271
- return H || (!D.value || !P.value ? Promise.resolve(null) : (H = we().finally(() => {
272
- I.value = 0, H = null;
273
- }), H));
288
+ return B || (!O.value || !M.value ? Promise.resolve(null) : (B = Me().finally(() => {
289
+ P.value = 0, B = null;
290
+ }), B));
274
291
  }
275
- function Te(e) {
292
+ function Ne(e) {
276
293
  let t = e.target.value;
277
- t && k.selectDevice(t);
294
+ t && A.selectDevice(t);
278
295
  }
279
- function Ee(e, t) {
296
+ function Pe(e, t) {
280
297
  if (e.label) return e.label;
281
298
  let n = e.facing === "user" ? "Front" : e.facing === "environment" ? "Back" : "";
282
299
  return n ? `${n} camera` : `Camera ${t + 1}`;
283
300
  }
284
- return p({
301
+ return g({
285
302
  onCapture: $,
286
- camera: k,
287
- zoom: X
288
- }), (n, r) => (h(), u("div", ie, [f(a, {
303
+ camera: A,
304
+ zoom: Y
305
+ }), (n, r) => (_(), p("div", ie, [h(a, {
289
306
  ref_key: "previewRef",
290
- ref: E,
291
- ratio: o.ratio,
292
- resolutions: o.resolutions,
293
- mirror: A.value,
294
- filter: o.filter,
295
- "tint-color": o.tintColor,
296
- "tint-intensity": o.tintIntensity
307
+ ref: D,
308
+ ratio: s.ratio,
309
+ resolutions: s.resolutions,
310
+ mirror: j.value,
311
+ filter: s.filter,
312
+ "tint-color": s.tintColor,
313
+ "tint-intensity": s.tintIntensity
297
314
  }, {
298
- default: b(() => [
299
- o.enableGuide && o.guideSrc ? (h(), u("img", {
315
+ default: S(() => [
316
+ s.enableGuide && s.guideSrc ? (_(), p("img", {
300
317
  key: 0,
301
- src: o.guideSrc,
318
+ src: s.guideSrc,
302
319
  class: "position-absolute top-0 start-0 w-100 h-100 base-camera__guide",
303
320
  alt: "",
304
321
  "aria-hidden": "true"
305
- }, null, 8, ae)) : l("", !0),
306
- d("div", oe, [j.value && v(k).activeDeviceId ? (h(), c(t, {
322
+ }, null, 8, C)) : f("", !0),
323
+ m("div", ae, [m("div", oe, [Te.value && b(A).activeDeviceId ? (_(), d(t, {
307
324
  key: 0,
308
325
  class: "base-camera__select",
309
- modelValue: v(k).activeDeviceId.value,
310
- "onUpdate:modelValue": r[0] ||= (e) => v(k).activeDeviceId.value = e,
311
- disabled: v(k).isStarting.value,
326
+ modelValue: b(A).activeDeviceId.value,
327
+ "onUpdate:modelValue": r[0] ||= (e) => b(A).activeDeviceId.value = e,
328
+ disabled: b(A).isStarting.value,
312
329
  "aria-label": "Select camera",
313
- onChange: Te,
314
- options: v(k).devices.value.map((e, t) => ({
330
+ onChange: Ne,
331
+ options: b(A).devices.value.map((e, t) => ({
315
332
  value: e.deviceId,
316
- text: Ee(e, t)
317
- }))
333
+ text: Pe(e, t)
334
+ })),
335
+ variant: "dark"
318
336
  }, null, 8, [
319
337
  "modelValue",
320
338
  "disabled",
321
339
  "options"
322
- ])) : (h(), u("span", se)), M.value ? (h(), u("button", {
323
- key: 2,
340
+ ])) : (_(), p("span", se))]), m("div", ce, [s.enableScreenFlash ? (_(), p("button", {
341
+ key: 0,
324
342
  type: "button",
325
- class: "btn d-grid place-content-center px-2",
326
- disabled: v(k).isStarting.value,
343
+ class: "btn btn-dark bg-opacity-50 base-camera__icon-btn",
344
+ "aria-label": z.value ? "Flash On" : "Flash Off",
345
+ onClick: r[1] ||= (e) => z.value = !z.value
346
+ }, [z.value ? (_(), d(e, {
347
+ key: 0,
348
+ symbol: "zap"
349
+ })) : (_(), d(e, {
350
+ key: 1,
351
+ symbol: "zap-off"
352
+ }))], 8, le)) : f("", !0), Ee.value ? (_(), p("button", {
353
+ key: 1,
354
+ type: "button",
355
+ class: "btn btn-dark bg-opacity-50 base-camera__icon-btn",
356
+ disabled: b(A).isStarting.value,
327
357
  "aria-label": "Switch camera",
328
- onClick: r[1] ||= (e) => v(k).switchCamera()
329
- }, [f(e, { symbol: "switch-camera" })], 8, ce)) : l("", !0)]),
330
- v(k).isStarting.value || v(k).state.value === "error" || v(k).state.value === "idle" && !o.autoStart ? (h(), u("div", le, [v(k).isStarting.value ? (h(), u("div", ue, [...r[8] ||= [d("span", { class: "visually-hidden" }, "Starting camera…", -1)]])) : v(k).state.value === "error" ? (h(), u("div", de, [d("div", fe, _(v(k).error.value?.message ?? "Camera error"), 1), v(k).error.value?.code !== "not-allowed" && v(k).error.value?.code !== "unsupported" ? (h(), u("button", {
358
+ onClick: r[2] ||= (e) => b(A).switchCamera()
359
+ }, [h(e, { symbol: "switch-camera" })], 8, ue)) : f("", !0)])]),
360
+ b(A).isStarting.value || b(A).state.value === "error" || b(A).state.value === "idle" && !s.autoStart ? (_(), p("div", de, [b(A).isStarting.value ? (_(), p("div", fe, [...r[9] ||= [m("span", { class: "visually-hidden" }, "Starting camera…", -1)]])) : b(A).state.value === "error" ? (_(), p("div", pe, [m("div", me, y(b(A).error.value?.message ?? "Camera error"), 1), b(A).error.value?.code !== "not-allowed" && b(A).error.value?.code !== "unsupported" ? (_(), p("button", {
331
361
  key: 0,
332
362
  type: "button",
333
363
  class: "btn btn-sm btn-outline-light",
334
- onClick: r[2] ||= (e) => v(k).start()
335
- }, " Retry ")) : l("", !0)])) : (h(), u("button", {
364
+ onClick: r[3] ||= (e) => b(A).start()
365
+ }, " Retry ")) : f("", !0)])) : (_(), p("button", {
336
366
  key: 2,
337
367
  type: "button",
338
368
  class: "btn btn-light",
339
- onClick: r[3] ||= (e) => v(k).start()
340
- }, "Start camera"))])) : l("", !0),
341
- d("div", pe, [o.enableControls ? (h(), u("div", me, [
342
- d("button", {
369
+ onClick: r[4] ||= (e) => b(A).start()
370
+ }, "Start camera"))])) : f("", !0),
371
+ m("div", he, [s.enableControls ? (_(), p("div", ge, [
372
+ m("button", {
343
373
  type: "button",
344
374
  class: "btn btn-dark bg-opacity-50 rounded-circle base-camera__icon-btn",
345
- disabled: v(k).isStarting.value,
346
- "aria-label": v(k).isLive.value ? "Pause" : "Start",
347
- onClick: r[4] ||= (e) => v(k).toggle()
348
- }, [v(k).isLive.value ? (h(), u("svg", ge, [...r[9] ||= [d("rect", {
375
+ disabled: b(A).isStarting.value,
376
+ "aria-label": b(A).isLive.value ? "Pause" : "Start",
377
+ onClick: r[5] ||= (e) => b(A).toggle()
378
+ }, [b(A).isLive.value ? (_(), p("svg", ve, [...r[10] ||= [m("rect", {
349
379
  x: "6",
350
380
  y: "5",
351
381
  width: "4",
352
382
  height: "14",
353
383
  rx: "1"
354
- }, null, -1), d("rect", {
384
+ }, null, -1), m("rect", {
355
385
  x: "14",
356
386
  y: "5",
357
387
  width: "4",
358
388
  height: "14",
359
389
  rx: "1"
360
- }, null, -1)]])) : (h(), u("svg", _e, [...r[10] ||= [d("path", { d: "M8 5v14l11-7z" }, null, -1)]]))], 8, he),
361
- d("button", {
390
+ }, null, -1)]])) : (_(), p("svg", ye, [...r[11] ||= [m("path", { d: "M8 5v14l11-7z" }, null, -1)]]))], 8, _e),
391
+ m("button", {
362
392
  type: "button",
363
393
  class: "btn btn-light rounded-circle base-camera__shutter",
364
- disabled: !P.value || F.value || I.value > 0,
394
+ disabled: !M.value || N.value || P.value > 0,
365
395
  "aria-label": "Capture photo",
366
- onClick: r[5] ||= (e) => $()
367
- }, [...r[11] ||= [d("span", { class: "base-camera__shutter-inner" }, null, -1)]], 8, ve),
368
- d("button", {
396
+ onClick: r[6] ||= (e) => $()
397
+ }, [...r[12] ||= [m("span", { class: "base-camera__shutter-inner" }, null, -1)]], 8, be),
398
+ m("button", {
369
399
  type: "button",
370
400
  class: "btn btn-dark bg-opacity-50 rounded-circle base-camera__icon-btn",
371
- "aria-label": V.value ? "Flash On" : "Flash Off",
372
- onClick: r[6] ||= (e) => V.value = !V.value
373
- }, [V.value ? (h(), c(e, {
374
- key: 0,
375
- symbol: "zap"
376
- })) : (h(), c(e, {
377
- key: 1,
378
- symbol: "zap-off"
379
- }))], 8, ye)
380
- ])) : l("", !0)]),
381
- I.value ? (h(), u("div", be, [(h(), u("p", {
382
- key: I.value,
401
+ "aria-label": "Stop camera",
402
+ onClick: r[7] ||= (e) => b(A).stop()
403
+ }, [h(e, { symbol: "x" })])
404
+ ])) : f("", !0)]),
405
+ P.value ? (_(), p("div", xe, [(_(), p("p", {
406
+ key: P.value,
383
407
  class: "base-camera__countdown",
384
- "data-countdown": I.value
385
- }, _(I.value), 9, x))])) : l("", !0),
386
- L.value ? (h(), u("div", {
387
- key: R.value,
408
+ "data-countdown": P.value
409
+ }, y(P.value), 9, Se))])) : f("", !0),
410
+ F.value ? (_(), p("div", {
411
+ key: I.value,
388
412
  class: "base-camera__shutter-effect",
389
413
  "aria-hidden": "true"
390
- }, [...r[12] ||= [d("span", { class: "base-camera__shutter-aperture" }, null, -1)]])) : l("", !0),
391
- f(te, {
414
+ }, [...r[13] ||= [m("span", { class: "base-camera__shutter-aperture" }, null, -1)]])) : f("", !0),
415
+ (_(), d(c, {
416
+ to: "body",
417
+ disabled: !s.screenFlashFullscreen
418
+ }, [h(l, {
392
419
  name: "base-camera-flash",
393
420
  onAfterLeave: Z
394
421
  }, {
395
- default: b(() => [z.value ? (h(), u("div", {
396
- key: B.value,
397
- class: "base-camera__screen-flash",
398
- style: ne({ background: o.screenFlashColor }),
422
+ default: S(() => [L.value ? (_(), p("div", {
423
+ key: R.value,
424
+ class: ee(["base-camera__screen-flash", { "base-camera__screen-flash--fullscreen": s.screenFlashFullscreen }]),
425
+ style: te({ background: s.screenFlashColor }),
399
426
  "aria-hidden": "true"
400
- }, null, 4)) : l("", !0)]),
427
+ }, null, 6)) : f("", !0)]),
401
428
  _: 1
402
- })
429
+ })], 8, ["disabled"]))
403
430
  ]),
404
431
  _: 1
405
432
  }, 8, [
@@ -409,19 +436,19 @@ var ie = {
409
436
  "filter",
410
437
  "tint-color",
411
438
  "tint-intensity"
412
- ]), N.value ? (h(), u("div", S, [f(ee, {
413
- modelValue: X.value,
414
- "onUpdate:modelValue": r[7] ||= (e) => X.value = e,
415
- min: v(k).zoomCapability.value.min,
416
- max: v(k).zoomCapability.value.max,
417
- step: v(k).zoomCapability.value.step
439
+ ]), De.value ? (_(), p("div", Ce, [h(o, {
440
+ modelValue: Y.value,
441
+ "onUpdate:modelValue": r[8] ||= (e) => Y.value = e,
442
+ min: b(A).zoomCapability.value.min,
443
+ max: b(A).zoomCapability.value.max,
444
+ step: b(A).zoomCapability.value.step
418
445
  }, null, 8, [
419
446
  "modelValue",
420
447
  "min",
421
448
  "max",
422
449
  "step"
423
- ])])) : l("", !0)]));
450
+ ])])) : f("", !0)]));
424
451
  }
425
452
  });
426
453
  //#endregion
427
- export { C as default };
454
+ export { w as default };
@@ -116,7 +116,7 @@ var b = ["id"], x = ["for", "innerHTML"], S = { class: "dropdown" }, C = { class
116
116
  role: "button",
117
117
  type: "button",
118
118
  title: L.value,
119
- class: "btn dropdown-toggle",
119
+ class: u(["btn dropdown-toggle", { [`btn-${e.variant}`]: e.variant }]),
120
120
  color: e.color,
121
121
  outlined: e.outlined,
122
122
  disabled: e.disabled
@@ -133,6 +133,7 @@ var b = ["id"], x = ["for", "innerHTML"], S = { class: "dropdown" }, C = { class
133
133
  }, 8, [
134
134
  "id",
135
135
  "title",
136
+ "class",
136
137
  "color",
137
138
  "outlined",
138
139
  "disabled"
@@ -17,6 +17,9 @@ export declare function useCamera(options?: UseCameraOptions): {
17
17
  permission: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<import('../utilities/camera/types').CameraPermission>;
18
18
  zoom: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<number>;
19
19
  zoomCapability: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<import('../utilities/camera/types').ZoomCapability | null>;
20
+ torch: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
21
+ torchCapability: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
22
+ canLockExposure: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
20
23
  isLive: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
21
24
  isPaused: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
22
25
  isStarting: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<boolean>;
@@ -31,6 +34,8 @@ export declare function useCamera(options?: UseCameraOptions): {
31
34
  selectDevice: (deviceId: string) => Promise<boolean>;
32
35
  setResolution: (r: Resolution) => Promise<boolean>;
33
36
  setZoom: (z: number) => Promise<boolean>;
37
+ setTorch: (on: boolean) => Promise<boolean>;
38
+ setExposureLocked: (locked: boolean) => Promise<boolean>;
34
39
  refreshDevices: () => Promise<void>;
35
40
  bindVideo: (el: HTMLVideoElement | null) => void;
36
41
  };
@@ -22,6 +22,9 @@ function a(a = {}) {
22
22
  permission: t(() => l.value.permission),
23
23
  zoom: t(() => l.value.zoom),
24
24
  zoomCapability: t(() => l.value.zoomCapability),
25
+ torch: t(() => l.value.torch),
26
+ torchCapability: t(() => l.value.torchCapability),
27
+ canLockExposure: t(() => l.value.canLockExposure),
25
28
  isLive: t(() => l.value.state === "live"),
26
29
  isPaused: t(() => l.value.state === "paused"),
27
30
  isStarting: t(() => l.value.state === "starting"),
@@ -36,6 +39,8 @@ function a(a = {}) {
36
39
  selectDevice: (e) => c.selectDevice(e),
37
40
  setResolution: (e) => c.setResolution(e),
38
41
  setZoom: (e) => c.setZoom(e),
42
+ setTorch: (e) => c.setTorch(e),
43
+ setExposureLocked: (e) => c.setExposureLocked(e),
39
44
  refreshDevices: () => c.refreshDevices(),
40
45
  bindVideo: (e) => c.attachVideo(e)
41
46
  };