@microblink/camera-manager 7.0.0-next.8 → 7.0.0
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/camera-manager.js +1645 -1024
- package/package.json +5 -5
- package/types/core/Camera.d.ts +40 -2
- package/types/core/Camera.d.ts.map +1 -1
- package/types/core/CameraManager.d.ts +42 -39
- package/types/core/CameraManager.d.ts.map +1 -1
- package/types/core/VideoFrameProcessor.d.ts +61 -0
- package/types/core/VideoFrameProcessor.d.ts.map +1 -0
- package/types/core/cameraManagerStore.d.ts +2 -1
- package/types/core/cameraManagerStore.d.ts.map +1 -1
- package/types/core/cameraNames.d.ts.map +1 -1
- package/types/core/cameraUtils.d.ts +14 -7
- package/types/core/cameraUtils.d.ts.map +1 -1
- package/types/core/utils.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/index.rollup.d.ts +182 -42
- package/types/media-mock/MediaMocker.d.ts +4 -779
- package/types/media-mock/MediaMocker.d.ts.map +1 -1
- package/types/media-mock/createInputDeviceInfo.d.ts.map +1 -1
- package/types/media-mock/fake-devices.d.ts +1 -788
- package/types/media-mock/fake-devices.d.ts.map +1 -1
- package/types/media-mock/fakeDevices/SamsungS21FE.d.ts +6 -0
- package/types/media-mock/fakeDevices/SamsungS21FE.d.ts.map +1 -0
- package/types/media-mock/fakeDevices/iPhone15.d.ts +6 -0
- package/types/media-mock/fakeDevices/iPhone15.d.ts.map +1 -0
- package/types/media-mock/fakeDevices/iPhoneSE.d.ts +9 -0
- package/types/media-mock/fakeDevices/iPhoneSE.d.ts.map +1 -0
- package/types/media-mock/utils.d.ts +4 -0
- package/types/media-mock/utils.d.ts.map +1 -1
- package/types/ui/CameraErrorModal.d.ts +7 -0
- package/types/ui/CameraErrorModal.d.ts.map +1 -0
- package/types/ui/CameraSelector.d.ts.map +1 -1
- package/types/ui/CameraUiStoreContext.d.ts +15 -2
- package/types/ui/CameraUiStoreContext.d.ts.map +1 -1
- package/types/ui/CaptureScreen.d.ts +2 -0
- package/types/ui/CaptureScreen.d.ts.map +1 -1
- package/types/ui/Header.d.ts.map +1 -1
- package/types/ui/RootComponent.d.ts.map +1 -1
- package/types/ui/SolidShadowRoot.d.ts +1 -12
- package/types/ui/SolidShadowRoot.d.ts.map +1 -1
- package/types/ui/createCameraManagerUi.d.ts +16 -8
- package/types/ui/createCameraManagerUi.d.ts.map +1 -1
- package/types/ui/determineFitMode.d.ts +35 -0
- package/types/ui/determineFitMode.d.ts.map +1 -0
- package/types/ui/determineFitMode.test.d.ts +5 -0
- package/types/ui/determineFitMode.test.d.ts.map +1 -0
- package/types/ui/getVisibleVideoArea.d.ts +10 -0
- package/types/ui/getVisibleVideoArea.d.ts.map +1 -0
- package/types/ui/getVisibleVideoArea.test.d.ts +5 -0
- package/types/ui/getVisibleVideoArea.test.d.ts.map +1 -0
- package/types/ui/locales/en.d.ts +7 -1
- package/types/ui/locales/en.d.ts.map +1 -1
- package/types/ui/zustandRefStore.d.ts +2 -0
- package/types/ui/zustandRefStore.d.ts.map +1 -1
- package/types/core/createCustomImageData.d.ts +0 -14
- package/types/core/createCustomImageData.d.ts.map +0 -1
- package/types/core/imageDataUtils.d.ts +0 -6
- package/types/core/imageDataUtils.d.ts.map +0 -1
- package/types/core/videoToImageData.d.ts +0 -5
- package/types/core/videoToImageData.d.ts.map +0 -1
- package/types/ui/ErrorAlert.d.ts +0 -8
- package/types/ui/ErrorAlert.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-devices.d.ts","sourceRoot":"","sources":["../../src/media-mock/fake-devices.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"fake-devices.d.ts","sourceRoot":"","sources":["../../src/media-mock/fake-devices.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,QAAQ,CAAC,CAAC;IACrE,kBAAkB,EAAE,UAAU,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACnE,kBAAkB,EAAE,UAAU,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACpE,kBAAkB,EAAE,UAAU,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAIzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SamsungS21FE.d.ts","sourceRoot":"","sources":["../../../src/media-mock/fakeDevices/SamsungS21FE.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,eAAO,MAAM,gBAAgB,EAAE,UAue9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iPhone15.d.ts","sourceRoot":"","sources":["../../../src/media-mock/fakeDevices/iPhone15.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,eAAO,MAAM,YAAY,EAAE,UA+M1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iPhoneSE.d.ts","sourceRoot":"","sources":["../../../src/media-mock/fakeDevices/iPhoneSE.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,UAyG1B,CAAC"}
|
|
@@ -2,4 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2025 Microblink Ltd. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
export declare const getFPSFromConstraints: (constraints: MediaStreamConstraints) => number;
|
|
5
|
+
export declare const getResolutionFromConstraints: (constraints: MediaStreamConstraints) => {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
5
9
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/media-mock/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/media-mock/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,qBAAqB,GAChC,aAAa,sBAAsB,KAClC,MAOF,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,aAAa,sBAAsB,KAClC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAkBjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CameraErrorModal.d.ts","sourceRoot":"","sources":["../../src/ui/CameraErrorModal.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAQ,MAAM,UAAU,CAAC;AAK3C,QAAA,MAAM,gBAAgB,EAAE,SA0BvB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraSelector.d.ts","sourceRoot":"","sources":["../../src/ui/CameraSelector.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,SAAS,EAA6B,MAAM,UAAU,CAAC;AAahE,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"CameraSelector.d.ts","sourceRoot":"","sources":["../../src/ui/CameraSelector.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,SAAS,EAA6B,MAAM,UAAU,CAAC;AAahE,eAAO,MAAM,cAAc,EAAE,SA0J5B,CAAC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
import { ParentComponent } from "solid-js";
|
|
5
5
|
import { MountableElement } from "solid-js/web";
|
|
6
6
|
import { CameraManager } from "../core/CameraManager";
|
|
7
|
-
|
|
7
|
+
import { DismountCallback } from "./createCameraManagerUi";
|
|
8
|
+
declare function createCameraManagerSolidStore(): {
|
|
8
9
|
(): import("solid-js").Accessor<import("..").CameraManagerStore>;
|
|
9
10
|
<U>(selector: (state: import("..").CameraManagerStore) => U, equals?: ((a: U, b: U) => boolean) | undefined): U extends (U extends (...args: any[]) => any ? U : never) ? U : import("solid-js").Accessor<U>;
|
|
10
11
|
} & Omit<import("zustand/vanilla").StoreApi<import("..").CameraManagerStore>, "subscribe"> & {
|
|
@@ -16,18 +17,30 @@ declare const cameraManagerSolidStore: {
|
|
|
16
17
|
} | undefined): () => void;
|
|
17
18
|
};
|
|
18
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* !IMPORTANT: this is not a reactive store. It's just a plain javascript object exposed
|
|
22
|
+
* as a context. The store is `cameraManagerSolidStore`, and it doesn't have anything
|
|
23
|
+
* related to the Camera Manager UI component
|
|
24
|
+
*/
|
|
19
25
|
export type CameraUiStore = {
|
|
20
26
|
/** Function which will dismount the component */
|
|
21
27
|
dismountCameraUi: () => void;
|
|
22
28
|
cameraManager: CameraManager;
|
|
23
29
|
/** This is the camera manager zustand store converted to SolidJS' signal store via `solid-zustand` */
|
|
24
|
-
cameraManagerSolidStore: typeof
|
|
30
|
+
cameraManagerSolidStore: ReturnType<typeof createCameraManagerSolidStore>;
|
|
25
31
|
mountTarget: MountableElement;
|
|
32
|
+
showMirrorCameraButton: boolean;
|
|
33
|
+
/** Sets a callback to be called when the component is unmounted.
|
|
34
|
+
* Returns a cleanup function that removes the callback when called.
|
|
35
|
+
*/
|
|
36
|
+
addOnDismountCallback: (fn: DismountCallback) => () => void;
|
|
26
37
|
};
|
|
27
38
|
export declare const CameraUiStoreProvider: ParentComponent<{
|
|
28
39
|
dismountCameraUi: () => void;
|
|
29
40
|
cameraManager: CameraManager;
|
|
30
41
|
mountTarget: MountableElement;
|
|
42
|
+
showMirrorCameraButton: boolean;
|
|
43
|
+
addOnDismountCallback: (fn: DismountCallback) => () => void;
|
|
31
44
|
}>;
|
|
32
45
|
export declare function useCameraUiStore(): CameraUiStore;
|
|
33
46
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraUiStoreContext.d.ts","sourceRoot":"","sources":["../../src/ui/CameraUiStoreContext.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGL,eAAe,EAEhB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CameraUiStoreContext.d.ts","sourceRoot":"","sources":["../../src/ui/CameraUiStoreContext.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGL,eAAe,EAEhB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,iBAAS,6BAA6B;;;;;;;;;;;EAErC;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,sGAAsG;IACtG,uBAAuB,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;IAC1E,WAAW,EAAE,gBAAgB,CAAC;IAC9B,sBAAsB,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,qBAAqB,EAAE,CAAC,EAAE,EAAE,gBAAgB,KAAK,MAAM,IAAI,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAAe,CAAC;IAClD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,sBAAsB,EAAE,OAAO,CAAC;IAChC,qBAAqB,EAAE,CAAC,EAAE,EAAE,gBAAgB,KAAK,MAAM,IAAI,CAAC;CAC7D,CA6BA,CAAC;AAEF,wBAAgB,gBAAgB,kBAO/B"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2025 Microblink Ltd. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { Component } from "solid-js";
|
|
5
|
+
export declare const CAPTURE_SCREEN_SHADOW_ROOT_HOST_ID = "capture-screen-host";
|
|
6
|
+
export type FitMode = "contain" | "cover";
|
|
5
7
|
export declare const CaptureScreen: Component;
|
|
6
8
|
export declare const CaptureScreenPortalled: Component;
|
|
7
9
|
//# sourceMappingURL=CaptureScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptureScreen.d.ts","sourceRoot":"","sources":["../../src/ui/CaptureScreen.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"CaptureScreen.d.ts","sourceRoot":"","sources":["../../src/ui/CaptureScreen.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,SAAS,EAMV,MAAM,UAAU,CAAC;AAwBlB,eAAO,MAAM,kCAAkC,wBAAwB,CAAC;AAExE,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1C,eAAO,MAAM,aAAa,EAAE,SA+J3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,SA4DpC,CAAC"}
|
package/types/ui/Header.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/ui/Header.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAA8B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/ui/Header.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAA8B,MAAM,UAAU,CAAC;AAajE,eAAO,MAAM,MAAM,EAAE,SAoGpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootComponent.d.ts","sourceRoot":"","sources":["../../src/ui/RootComponent.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"RootComponent.d.ts","sourceRoot":"","sources":["../../src/ui/RootComponent.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAMrC,QAAA,MAAM,aAAa,EAAE,SAcpB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -5,17 +5,6 @@ import { JSX, ParentComponent } from "solid-js";
|
|
|
5
5
|
export declare const SolidShadowRoot: ParentComponent<{
|
|
6
6
|
/** Disables shadow root, mostly useful for debugging */
|
|
7
7
|
disableShadowRoot?: boolean;
|
|
8
|
-
class?: string | undefined;
|
|
9
|
-
style?: JSX.CSSProperties | string;
|
|
10
8
|
getRef?: (el: HTMLDivElement) => void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* A declarative shadow root component
|
|
14
|
-
*
|
|
15
|
-
* Hooks into SolidJS' Portal's `useShadow` prop
|
|
16
|
-
* to handle shadow DOM and the component lifecycle
|
|
17
|
-
*
|
|
18
|
-
* @deprecated
|
|
19
|
-
*/
|
|
20
|
-
export declare const SolidShadowRootWithPortal: ParentComponent;
|
|
9
|
+
} & JSX.HTMLAttributes<HTMLDivElement>>;
|
|
21
10
|
//# sourceMappingURL=SolidShadowRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidShadowRoot.d.ts","sourceRoot":"","sources":["../../src/ui/SolidShadowRoot.tsx"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"SolidShadowRoot.d.ts","sourceRoot":"","sources":["../../src/ui/SolidShadowRoot.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAY,GAAG,EAAE,eAAe,EAAoB,MAAM,UAAU,CAAC;AAE5E,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C;IACE,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,cAAc,KAAK,IAAI,CAAC;CACvC,GAAG,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,CA2BvC,CAAC"}
|
|
@@ -5,17 +5,18 @@ import { SetStoreFunction } from "solid-js/store";
|
|
|
5
5
|
import { CameraManager } from "../core/CameraManager";
|
|
6
6
|
import { CameraUiLocalizationStrings } from "./LocalizationContext";
|
|
7
7
|
export declare const MOUNT_POINT_ID = "camera-manager-mount-point";
|
|
8
|
-
import "
|
|
8
|
+
import { Owner } from "solid-js";
|
|
9
|
+
import "virtual:uno.css";
|
|
9
10
|
export type CameraManagerComponent = {
|
|
10
11
|
cameraManager: CameraManager;
|
|
11
12
|
/** Updates the localization strings */
|
|
12
13
|
updateLocalization: SetStoreFunction<CameraUiLocalizationStrings>;
|
|
13
14
|
/** Dismounts the component from the DOM and unloads the SDK */
|
|
14
15
|
dismount: () => void;
|
|
15
|
-
/** Sets a callback to be called when the component is unmounted
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
/** Sets a callback to be called when the component is unmounted.
|
|
17
|
+
* Returns a cleanup function that removes the callback when called.
|
|
18
|
+
*/
|
|
19
|
+
addOnDismountCallback: (fn: DismountCallback) => () => void;
|
|
19
20
|
/**
|
|
20
21
|
* The feedback layer node that can be used to append custom feedback elements
|
|
21
22
|
*/
|
|
@@ -24,11 +25,18 @@ export type CameraManagerComponent = {
|
|
|
24
25
|
* The overlay layer node that can be used to append custom overlay elements
|
|
25
26
|
*/
|
|
26
27
|
overlayLayerNode: HTMLDivElement;
|
|
28
|
+
/**
|
|
29
|
+
* https://docs.solidjs.com/reference/reactive-utilities/get-owner
|
|
30
|
+
*/
|
|
31
|
+
owner: Owner;
|
|
32
|
+
};
|
|
33
|
+
export type DismountCallback = () => void;
|
|
34
|
+
export type CameraManagerUiOptions = {
|
|
35
|
+
localizationStrings?: Partial<CameraUiLocalizationStrings>;
|
|
36
|
+
showMirrorCameraButton?: boolean;
|
|
27
37
|
};
|
|
28
|
-
type DismountCallback = () => void;
|
|
29
38
|
/**
|
|
30
39
|
* Creates a new Camera Manager UI component.
|
|
31
40
|
*/
|
|
32
|
-
export declare function createCameraManagerUi(cameraManager: CameraManager, target?: HTMLElement): Promise<CameraManagerComponent>;
|
|
33
|
-
export {};
|
|
41
|
+
export declare function createCameraManagerUi(cameraManager: CameraManager, target?: HTMLElement, { localizationStrings, showMirrorCameraButton, }?: CameraManagerUiOptions): Promise<CameraManagerComponent>;
|
|
34
42
|
//# sourceMappingURL=createCameraManagerUi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCameraManagerUi.d.ts","sourceRoot":"","sources":["../../src/ui/createCameraManagerUi.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,
|
|
1
|
+
{"version":3,"file":"createCameraManagerUi.d.ts","sourceRoot":"","sources":["../../src/ui/createCameraManagerUi.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EACL,2BAA2B,EAE5B,MAAM,uBAAuB,CAAC;AAI/B,eAAO,MAAM,cAAc,+BAA+B,CAAC;AAG3D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,uCAAuC;IACvC,kBAAkB,EAAE,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;IAClE,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,qBAAqB,EAAE,CAAC,EAAE,EAAE,gBAAgB,KAAK,MAAM,IAAI,CAAC;IAC5D;;OAEG;IACH,iBAAiB,EAAE,cAAc,CAAC;IAClC;;OAEG;IACH,gBAAgB,EAAE,cAAc,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC;AAE1C,MAAM,MAAM,sBAAsB,GAAG;IACnC,mBAAmB,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC3D,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,aAAa,EAC5B,MAAM,CAAC,EAAE,WAAW,EACpB,EACE,mBAAmB,EACnB,sBAA8B,GAC/B,GAAE,sBAA2B,mCAoM/B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Microblink Ltd. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { FitMode } from "./CaptureScreen";
|
|
5
|
+
/**
|
|
6
|
+
* Determine the fit mode for the video element based on the container and video dimensions.
|
|
7
|
+
* `cover` is only used when the cropped fraction is less than 10%.
|
|
8
|
+
*
|
|
9
|
+
* When using object-fit: cover, the video is scaled by
|
|
10
|
+
* `s = max(Cw / Vw, Ch / Vh)`
|
|
11
|
+
* so that one dimension exactly fills the container while the other overflows.
|
|
12
|
+
* The overflowing dimension is then centered and cropped.
|
|
13
|
+
*
|
|
14
|
+
* For the dimension that overflows:
|
|
15
|
+
* - If width is the dominant factor `(Cw/Vw > Ch/Vh)`, then
|
|
16
|
+
* - `visible dimension = s * Vh` (actual scaled video height)
|
|
17
|
+
* - `visible fraction = containerHeight / (s * Vh)`
|
|
18
|
+
* - `croppedFraction = 1 - (containerHeight / (s * Vh))`
|
|
19
|
+
*
|
|
20
|
+
* - Otherwise, if height is dominant, then
|
|
21
|
+
* - `visible dimension = s * Vw` (actual scaled video width)
|
|
22
|
+
* - `visible fraction = containerWidth / (s * Vw)`
|
|
23
|
+
* - `croppedFraction = 1 - (containerWidth / (s * Vw))`
|
|
24
|
+
*
|
|
25
|
+
* The croppedFraction represents the relative amount (fraction) of the video that is cropped
|
|
26
|
+
* along the overflowing dimension. We choose "cover" only when the croppedFraction is below 10%.
|
|
27
|
+
*
|
|
28
|
+
* @param Cw container width
|
|
29
|
+
* @param Ch container height
|
|
30
|
+
* @param Vw video width
|
|
31
|
+
* @param Vh video height
|
|
32
|
+
* @returns `FitMode` ("cover" or "contain")
|
|
33
|
+
*/
|
|
34
|
+
export declare const determineFitMode: (Cw: number, Ch: number, Vw: number, Vh: number) => FitMode;
|
|
35
|
+
//# sourceMappingURL=determineFitMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"determineFitMode.d.ts","sourceRoot":"","sources":["../../src/ui/determineFitMode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,gBAAgB,GAC3B,IAAI,MAAM,EACV,IAAI,MAAM,EACV,IAAI,MAAM,EACV,IAAI,MAAM,KACT,OA+BF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"determineFitMode.test.d.ts","sourceRoot":"","sources":["../../src/ui/determineFitMode.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Microblink Ltd. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { ExtractionArea } from "../core/VideoFrameProcessor";
|
|
5
|
+
/**
|
|
6
|
+
* Compute the visible portion of the video (in the video’s natural coordinate space)
|
|
7
|
+
* when rendered with object-fit: cover.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getVisibleVideoArea(containerWidth: number, containerHeight: number, videoWidth: number, videoHeight: number): ExtractionArea;
|
|
10
|
+
//# sourceMappingURL=getVisibleVideoArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVisibleVideoArea.d.ts","sourceRoot":"","sources":["../../src/ui/getVisibleVideoArea.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,cAAc,CA0BhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVisibleVideoArea.test.d.ts","sourceRoot":"","sources":["../../src/ui/getVisibleVideoArea.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/types/ui/locales/en.d.ts
CHANGED
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare const _default: {
|
|
5
5
|
readonly selected_camera: "Selected camera";
|
|
6
|
+
readonly loading_cameras: "Loading cameras...";
|
|
7
|
+
readonly select_a_camera: "Select a camera";
|
|
6
8
|
readonly select_camera: "Select camera";
|
|
7
9
|
readonly close: "Close";
|
|
8
10
|
readonly torch: "Torch";
|
|
9
11
|
readonly mirror_camera: "Mirror camera";
|
|
10
|
-
readonly
|
|
12
|
+
readonly scan_document: "Scan a document";
|
|
13
|
+
readonly camera_error_title: "Camera permission required";
|
|
14
|
+
readonly camera_error_details: "Please allow camera access in your browser and try again.";
|
|
15
|
+
readonly camera_error_cancel_btn: "Cancel";
|
|
16
|
+
readonly camera_error_primary_btn: "Retry";
|
|
11
17
|
};
|
|
12
18
|
export default _default;
|
|
13
19
|
//# sourceMappingURL=en.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/ui/locales/en.ts"],"names":[],"mappings":"AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/ui/locales/en.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;AAEH,wBAcW"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2025 Microblink Ltd. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
+
import { Owner } from "solid-js";
|
|
4
5
|
export type CameraUiRefs = {
|
|
5
6
|
feedbackLayer: HTMLDivElement;
|
|
6
7
|
overlayLayer: HTMLDivElement;
|
|
8
|
+
owner: Owner;
|
|
7
9
|
};
|
|
8
10
|
export declare const cameraUiRefStore: Omit<import("zustand/vanilla").StoreApi<CameraUiRefs>, "subscribe"> & {
|
|
9
11
|
subscribe: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zustandRefStore.d.ts","sourceRoot":"","sources":["../../src/ui/zustandRefStore.tsx"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"zustandRefStore.d.ts","sourceRoot":"","sources":["../../src/ui/zustandRefStore.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,EAAE,cAAc,CAAC;IAC9B,YAAY,EAAE,cAAc,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAUF,eAAO,MAAM,gBAAgB;;;;;;;;CAG5B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;CAAqC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Microblink Ltd. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* fix for postmessage performance
|
|
6
|
-
* https://bugs.chromium.org/p/chromium/issues/detail?id=1439768&q=&can=4
|
|
7
|
-
*/
|
|
8
|
-
export declare function createCustomImageData(imageData: ImageData): {
|
|
9
|
-
data: Uint8ClampedArray<ArrayBufferLike>;
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
colorSpace: PredefinedColorSpace;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=createCustomImageData.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createCustomImageData.d.ts","sourceRoot":"","sources":["../../src/core/createCustomImageData.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS;;;;;EASzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imageDataUtils.d.ts","sourceRoot":"","sources":["../../src/core/imageDataUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,cAAc,cAAe,SAAS,WAclD,CAAC;AAEF,eAAO,MAAM,0BAA0B,YAAa,MAAM,WACR,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"videoToImageData.d.ts","sourceRoot":"","sources":["../../src/core/videoToImageData.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,UAAQ,aA6BxE"}
|
package/types/ui/ErrorAlert.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorAlert.d.ts","sourceRoot":"","sources":["../../src/ui/ErrorAlert.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAQ,MAAM,UAAU,CAAC;AAG3C,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd,CA4BA,CAAC"}
|