@zappar/zappar-cv 2.1.1-beta.0 → 2.1.1-beta.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 +11 -3
- package/README.md +2 -2
- package/lib/additional.d.ts +1 -0
- package/lib/gen/zappar-client.js +2 -1
- package/lib/gen/zappar-cwrap.js +4 -3
- package/lib/gen/zappar-native.d.ts +1 -1
- package/lib/gen/zappar-server.js +1 -1
- package/lib/gen/zappar.d.ts +1 -1
- package/lib/native.js +35 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/zappar-cv.js +110 -112
- package/lib/zappar-cv.wasm +0 -0
- package/package.json +1 -1
- package/umd/56.zappar-cv.js +1 -1
- package/umd/{70a4106e0fc426006459.wasm → 5749b2c77a081c5836b0.wasm} +0 -0
- package/umd/zappar-cv.js +1 -1
- package/umd/zappar-cv.worker.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# [2.1.0] - 2023-05-04
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
- Spanish, Portuguese and German translations for permissions screen
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## [2.0.2] - 2023-05-04
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Unique user calculation when using the Zapworks built-in analytics system
|
|
13
|
+
|
|
14
|
+
## [2.0.1] - 2023-03-24
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
9
17
|
|
|
10
|
-
-
|
|
18
|
+
- Workaround for bug in iOS Safari 16.4 that selects the wrong rear-facing camera on some devices
|
|
11
19
|
|
|
12
20
|
## [2.0.0] - 2022-08-23
|
|
13
21
|
|
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ npm i @zappar/zappar-cv
|
|
|
18
18
|
|
|
19
19
|
You can use our CDN from within your HTML:
|
|
20
20
|
```
|
|
21
|
-
<script src="https://libs.zappar.com/zappar-cv/2.1.1-beta.
|
|
21
|
+
<script src="https://libs.zappar.com/zappar-cv/2.1.1-beta.2/zappar-cv.js"></script>
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Or you can download and host our standalone JavaScript bundle:
|
|
25
|
-
[https://libs.zappar.com/zappar-cv/2.1.1-beta.
|
|
25
|
+
[https://libs.zappar.com/zappar-cv/2.1.1-beta.2/zappar-cv.zip](https://libs.zappar.com/zappar-cv/2.1.1-beta.2/zappar-cv.zip)
|
package/lib/additional.d.ts
CHANGED
package/lib/gen/zappar-client.js
CHANGED
|
@@ -29,9 +29,10 @@ export class zappar_client {
|
|
|
29
29
|
m.logLevel(level);
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
|
-
analytics_project_id_set: (id) => {
|
|
32
|
+
analytics_project_id_set: (id, uid) => {
|
|
33
33
|
this.serializer.sendMessage(31, m => {
|
|
34
34
|
m.string(id);
|
|
35
|
+
m.string(uid);
|
|
35
36
|
});
|
|
36
37
|
},
|
|
37
38
|
// #### pipeline ####
|
package/lib/gen/zappar-cwrap.js
CHANGED
|
@@ -4,7 +4,7 @@ export function getRuntimeObject(mod) {
|
|
|
4
4
|
"number"
|
|
5
5
|
]);
|
|
6
6
|
let analytics_project_id_set_wrapped = mod.cwrap("zappar_analytics_project_id_set", null, [
|
|
7
|
-
"string"
|
|
7
|
+
"string", "string"
|
|
8
8
|
]);
|
|
9
9
|
let pipeline_create_wrapped = mod.cwrap("zappar_pipeline_create", "number", []);
|
|
10
10
|
let pipeline_destroy_wrapped = mod.cwrap("zappar_pipeline_destroy", null, ["number"]);
|
|
@@ -195,9 +195,10 @@ export function getRuntimeObject(mod) {
|
|
|
195
195
|
let ret = log_level_set_wrapped(arg_level);
|
|
196
196
|
return ret;
|
|
197
197
|
},
|
|
198
|
-
analytics_project_id_set: (id) => {
|
|
198
|
+
analytics_project_id_set: (id, uid) => {
|
|
199
199
|
let arg_id = id;
|
|
200
|
-
let
|
|
200
|
+
let arg_uid = uid;
|
|
201
|
+
let ret = analytics_project_id_set_wrapped(arg_id, arg_uid);
|
|
201
202
|
return ret;
|
|
202
203
|
},
|
|
203
204
|
pipeline_create: () => {
|
|
@@ -91,7 +91,7 @@ export declare type zappar_instant_world_tracker_t = number & {
|
|
|
91
91
|
export interface zappar_cwrap {
|
|
92
92
|
log_level(): log_level_t;
|
|
93
93
|
log_level_set(level: log_level_t): void;
|
|
94
|
-
analytics_project_id_set(id: string): void;
|
|
94
|
+
analytics_project_id_set(id: string, uid: string): void;
|
|
95
95
|
pipeline_create(): zappar_pipeline_t;
|
|
96
96
|
pipeline_destroy(o: zappar_pipeline_t): void;
|
|
97
97
|
pipeline_frame_update(o: zappar_pipeline_t): void;
|
package/lib/gen/zappar-server.js
CHANGED
package/lib/gen/zappar.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export interface zappar {
|
|
|
58
58
|
permission_denied_any(): boolean;
|
|
59
59
|
permission_denied_camera(): boolean;
|
|
60
60
|
permission_denied_motion(): boolean;
|
|
61
|
-
analytics_project_id_set(id: string): void;
|
|
61
|
+
analytics_project_id_set(id: string, uid: string): void;
|
|
62
62
|
pipeline_create(): zappar_pipeline_t;
|
|
63
63
|
pipeline_destroy(o: zappar_pipeline_t): void;
|
|
64
64
|
pipeline_camera_frame_upload_gl(o: zappar_pipeline_t): void;
|
package/lib/native.js
CHANGED
|
@@ -40,10 +40,12 @@ export function initialize(opts) {
|
|
|
40
40
|
d: ab
|
|
41
41
|
}, [ab]);
|
|
42
42
|
});
|
|
43
|
+
const uid = getUID();
|
|
44
|
+
let hasPersistedUID = false;
|
|
43
45
|
if (window.location.hostname.toLowerCase().indexOf(".zappar.io") > 0 || window.location.hostname.toLowerCase().indexOf(".webar.run") > 0) {
|
|
44
46
|
let pathParts = window.location.pathname.split("/");
|
|
45
47
|
if (pathParts.length > 1 && pathParts[1].length > 0)
|
|
46
|
-
c.impl.analytics_project_id_set(".wiz" + pathParts[1]);
|
|
48
|
+
c.impl.analytics_project_id_set(".wiz" + pathParts[1], uid);
|
|
47
49
|
}
|
|
48
50
|
messageManager.onIncomingMessage.bind(msg => {
|
|
49
51
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -479,6 +481,16 @@ export function initialize(opts) {
|
|
|
479
481
|
}, html_element_source_create: (pipeline, elm) => HTMLElementSource.createVideoElementSource(pipeline, elm), html_element_source_start: o => { var _a; return (_a = HTMLElementSource.getVideoElementSource(o)) === null || _a === void 0 ? void 0 : _a.start(); }, html_element_source_pause: o => { var _a; return (_a = HTMLElementSource.getVideoElementSource(o)) === null || _a === void 0 ? void 0 : _a.pause(); }, html_element_source_destroy: o => { var _a; return (_a = HTMLElementSource.getVideoElementSource(o)) === null || _a === void 0 ? void 0 : _a.destroy(); }, sequence_source_create: p => SequenceSource.create(p), sequence_source_load_from_memory: (o, data) => { var _a; return (_a = SequenceSource.get(o)) === null || _a === void 0 ? void 0 : _a.loadFromMemory(data); }, sequence_source_pause: o => { var _a; return (_a = SequenceSource.get(o)) === null || _a === void 0 ? void 0 : _a.pause(); }, sequence_source_start: o => { var _a; return (_a = SequenceSource.get(o)) === null || _a === void 0 ? void 0 : _a.start(); }, sequence_source_max_playback_fps_set: (o, fps) => { var _a; return (_a = SequenceSource.get(o)) === null || _a === void 0 ? void 0 : _a.maxPlaybackFpsSet(fps); }, sequence_source_time_set: (o, t) => { var _a; return (_a = SequenceSource.get(o)) === null || _a === void 0 ? void 0 : _a.setTime(t); }, sequence_source_destroy: o => { var _a; return (_a = SequenceSource.get(o)) === null || _a === void 0 ? void 0 : _a.destroy(); }, permission_granted_all: permissionGrantedAll, permission_granted_camera: permissionGrantedCamera, permission_granted_motion: permissionGrantedMotion, permission_denied_any: permissionDeniedAny, permission_denied_camera: permissionDeniedCamera, permission_denied_motion: permissionDeniedMotion, permission_request_motion: permissionRequestMotion, permission_request_camera: permissionRequestCamera, permission_request_all: permissionRequestAll, permission_request_ui: permissionRequestUI, permission_request_ui_promise: permissionRequestUI, permission_denied_ui: permissionDeniedUI, browser_incompatible: compatibility.incompatible, browser_incompatible_ui: compatibility.incompatible_ui, log_level_set: l => {
|
|
480
482
|
setLogLevel(l);
|
|
481
483
|
c.impl.log_level_set(l);
|
|
484
|
+
}, cookies_permitted: p => {
|
|
485
|
+
if (p) {
|
|
486
|
+
if (!hasPersistedUID) {
|
|
487
|
+
persistUID(uid);
|
|
488
|
+
hasPersistedUID = true;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
deleteUID();
|
|
493
|
+
}
|
|
482
494
|
} });
|
|
483
495
|
return client;
|
|
484
496
|
}
|
|
@@ -490,3 +502,25 @@ function loadDefaultFaceModel(o) {
|
|
|
490
502
|
client === null || client === void 0 ? void 0 : client.face_tracker_model_load_from_memory(o, ab);
|
|
491
503
|
});
|
|
492
504
|
}
|
|
505
|
+
function getUID() {
|
|
506
|
+
let uid = window.localStorage.getItem('z_uar_lid');
|
|
507
|
+
if (uid === null) {
|
|
508
|
+
const destination = new Uint8Array(8);
|
|
509
|
+
window.crypto.getRandomValues(destination);
|
|
510
|
+
uid = '';
|
|
511
|
+
for (let i = 0; i < destination.byteLength; i++) {
|
|
512
|
+
const part = destination[i].toString(16);
|
|
513
|
+
if (part.length === 1)
|
|
514
|
+
uid += '0' + part;
|
|
515
|
+
else if (part.length === 2)
|
|
516
|
+
uid += part;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return uid;
|
|
520
|
+
}
|
|
521
|
+
function persistUID(u) {
|
|
522
|
+
window.localStorage.setItem('z_uar_lid', u);
|
|
523
|
+
}
|
|
524
|
+
function deleteUID() {
|
|
525
|
+
window.localStorage.removeItem('z_uar_lid');
|
|
526
|
+
}
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.1.1-beta.
|
|
1
|
+
export declare const VERSION = "2.1.1-beta.2";
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "2.1.1-beta.
|
|
1
|
+
export const VERSION = "2.1.1-beta.2";
|