New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@zappar/zappar

Package Overview
Dependencies
Maintainers
10
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zappar/zappar - npm Package Compare versions

Comparing version 2.1.0-beta.1 to 2.2.0-beta.1

6

CHANGELOG.md
# Changelog
## [2.1.0] - 2023-03-08
### Changed
- Module is now built as `ESNext` (was `CommonJs`).
## [2.1.0] - 2023-02-06

@@ -4,0 +10,0 @@

3

lib/anchor.js

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,11 +0,8 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BarcodeFinder = void 0;
const event_1 = require("./event");
const zappar_cv_1 = require("@zappar/zappar-cv");
const zappar_1 = require("./zappar");
import { Event1 } from "./event";
import { barcode_format_t } from "@zappar/zappar-cv";
import { z } from "./zappar";
/**
* Detects barcodes in the images from the camera.
*/
class BarcodeFinder {
export class BarcodeFinder {
/**

@@ -20,3 +17,3 @@ * Constructs a new BarcodeFinder.

*/
this.onDetection = new event_1.Event1();
this.onDetection = new Event1();
this._lastDetected = [];

@@ -46,22 +43,22 @@ this._found = [];

this._pipeline._onFrameUpdateInternal.bind(this._frameUpdate);
this._z = zappar_1.z();
this._z = z();
this._impl = this._z.barcode_finder_create(this._pipeline._getImpl());
this._formats.push.apply(this._formats, [
zappar_cv_1.barcode_format_t.AZTEC,
zappar_cv_1.barcode_format_t.CODABAR,
zappar_cv_1.barcode_format_t.CODE_39,
zappar_cv_1.barcode_format_t.CODE_93,
zappar_cv_1.barcode_format_t.CODE_128,
zappar_cv_1.barcode_format_t.DATA_MATRIX,
zappar_cv_1.barcode_format_t.EAN_8,
zappar_cv_1.barcode_format_t.EAN_13,
zappar_cv_1.barcode_format_t.ITF,
zappar_cv_1.barcode_format_t.MAXICODE,
zappar_cv_1.barcode_format_t.PDF_417,
zappar_cv_1.barcode_format_t.QR_CODE,
zappar_cv_1.barcode_format_t.RSS_14,
zappar_cv_1.barcode_format_t.RSS_EXPANDED,
zappar_cv_1.barcode_format_t.UPC_A,
zappar_cv_1.barcode_format_t.UPC_E,
zappar_cv_1.barcode_format_t.UPC_EAN_EXTENSION
barcode_format_t.AZTEC,
barcode_format_t.CODABAR,
barcode_format_t.CODE_39,
barcode_format_t.CODE_93,
barcode_format_t.CODE_128,
barcode_format_t.DATA_MATRIX,
barcode_format_t.EAN_8,
barcode_format_t.EAN_13,
barcode_format_t.ITF,
barcode_format_t.MAXICODE,
barcode_format_t.PDF_417,
barcode_format_t.QR_CODE,
barcode_format_t.RSS_14,
barcode_format_t.RSS_EXPANDED,
barcode_format_t.UPC_A,
barcode_format_t.UPC_E,
barcode_format_t.UPC_EAN_EXTENSION
]);

@@ -109,2 +106,1 @@ }

}
exports.BarcodeFinder = BarcodeFinder;

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CameraSource = void 0;
const zappar_1 = require("./zappar");
import { z } from "./zappar";
/**

@@ -9,3 +6,3 @@ * Creates a source of frames from a device camera.

*/
class CameraSource {
export class CameraSource {
/**

@@ -18,3 +15,3 @@ * Constructs a new CameraSource.

constructor(pipeline, deviceId) {
this._z = zappar_1.z();
this._z = z();
this._impl = this._z.camera_source_create(pipeline._getImpl(), deviceId);

@@ -43,2 +40,1 @@ }

}
exports.CameraSource = CameraSource;

@@ -1,8 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Event1 = exports.Event = void 0;
/**
* A type-safe event handling class that multiple functions to be registered to be called when events are emitted.
*/
class Event {
export class Event {
constructor() {

@@ -37,3 +34,2 @@ this._funcs = [];

}
exports.Event = Event;
/**

@@ -45,3 +41,3 @@ * A type-safe event handling class that multiple functions to be registered to be called when events are emitted.

*/
class Event1 {
export class Event1 {
constructor() {

@@ -78,2 +74,1 @@ this._funcs = [];

}
exports.Event1 = Event1;

@@ -1,8 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FaceLandmark = exports.FaceLandmarkName = void 0;
const zappar_1 = require("./zappar");
const gl_matrix_1 = require("gl-matrix");
var zappar_cv_1 = require("@zappar/zappar-cv");
Object.defineProperty(exports, "FaceLandmarkName", { enumerable: true, get: function () { return zappar_cv_1.face_landmark_name_t; } });
import { z } from "./zappar";
import { mat4 } from "gl-matrix";
export { face_landmark_name_t as FaceLandmarkName } from "@zappar/zappar-cv";
/**

@@ -13,3 +9,3 @@ * Attaches content to a known point (landmark) on a face as it moves around in the camera view.

*/
class FaceLandmark {
export class FaceLandmark {
/**

@@ -26,4 +22,4 @@ * Constructs a new FaceLanmdmark.

*/
this.pose = gl_matrix_1.mat4.create();
this._z = zappar_1.z();
this.pose = mat4.create();
this._z = z();
this._impl = this._z.face_landmark_create(this._name);

@@ -63,2 +59,1 @@ }

}
exports.FaceLandmark = FaceLandmark;

@@ -1,2 +0,1 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -11,5 +10,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FaceMesh = void 0;
const zappar_1 = require("./zappar");
import { z } from "./zappar";
/**

@@ -19,3 +16,3 @@ * A mesh that fits to the user's face and deforms as the user's expression changes.

*/
class FaceMesh {
export class FaceMesh {
/**

@@ -26,3 +23,3 @@ * Constructs a new FaceMesh.

constructor() {
this._z = zappar_1.z();
this._z = z();
this._impl = this._z.face_mesh_create();

@@ -141,2 +138,1 @@ }

}
exports.FaceMesh = FaceMesh;

@@ -1,2 +0,1 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -11,6 +10,4 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FaceTracker = void 0;
const event_1 = require("./event");
const zappar_1 = require("./zappar");
import { Event, Event1 } from "./event";
import { z } from "./zappar";
/**

@@ -20,3 +17,3 @@ * Attaches content to a face as it moves around in the camera view.

*/
class FaceTracker {
export class FaceTracker {
/**

@@ -31,11 +28,11 @@ * Constructs a new FaceTracker

*/
this.onVisible = new event_1.Event1();
this.onVisible = new Event1();
/**
* Emitted when an anchor goes from being visible in the previous camera frame, to not being visible in the current frame.
*/
this.onNotVisible = new event_1.Event1();
this.onNotVisible = new Event1();
/**
* Emitted when a new anchor is created by the tracker.
*/
this.onNewAnchor = new event_1.Event1();
this.onNewAnchor = new Event1();
/**

@@ -64,4 +61,4 @@ * The set of currently visible anchors.

anchor = {
onVisible: new event_1.Event(),
onNotVisible: new event_1.Event(),
onVisible: new Event(),
onNotVisible: new Event(),
indx: 0,

@@ -103,3 +100,3 @@ id: id,

this._pipeline._onFrameUpdateInternal.bind(this._frameUpdate);
this._z = zappar_1.z();
this._z = z();
this._impl = this._z.face_tracker_create(this._pipeline._getImpl());

@@ -160,2 +157,1 @@ }

}
exports.FaceTracker = FaceTracker;

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HTMLElementSource = void 0;
const zappar_1 = require("./zappar");
import { z } from "./zappar";
/**

@@ -9,3 +6,3 @@ * Creates a source of frames from a HTML <video> or <img> element.

*/
class HTMLElementSource {
export class HTMLElementSource {
/**

@@ -17,3 +14,3 @@ * Constructs a new HTMLElementSource.

constructor(pipeline, element) {
this._z = zappar_1.z();
this._z = z();
this._impl = this._z.html_element_source_create(pipeline._getImpl(), element);

@@ -42,2 +39,1 @@ }

}
exports.HTMLElementSource = HTMLElementSource;

@@ -1,2 +0,1 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -11,6 +10,4 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageTargetPreview = exports.ImageTarget = exports.ImageTracker = void 0;
const event_1 = require("./event");
const zappar_1 = require("./zappar");
import { Event, Event1 } from "./event";
import { z } from "./zappar";
/**

@@ -20,3 +17,3 @@ * Attaches content to a known image as it moves around in the camera view.

*/
class ImageTracker {
export class ImageTracker {
/**

@@ -33,11 +30,11 @@ * Constructs a new ImageTracker

*/
this.onVisible = new event_1.Event1();
this.onVisible = new Event1();
/**
* Emitted when an anchor goes from being visible in the previous camera frame, to not being visible in the current frame.
*/
this.onNotVisible = new event_1.Event1();
this.onNotVisible = new Event1();
/**
* Emitted when a new anchor is created by the tracker.
*/
this.onNewAnchor = new event_1.Event1();
this.onNewAnchor = new Event1();
/**

@@ -66,4 +63,4 @@ * The set of currently visible anchors.

anchor = {
onVisible: new event_1.Event(),
onNotVisible: new event_1.Event(),
onVisible: new Event(),
onNotVisible: new Event(),
id: id,

@@ -99,3 +96,3 @@ poseCameraRelative: mirror => this._z.image_tracker_anchor_pose_camera_relative(this._impl, i, mirror === true),

this._pipeline._onFrameUpdateInternal.bind(this._frameUpdate);
this._z = zappar_1.z();
this._z = z();
this._impl = this._z.image_tracker_create(this._pipeline._getImpl());

@@ -153,7 +150,6 @@ if (targetFile)

}
exports.ImageTracker = ImageTracker;
/**
* A target image embedded with a target file.
*/
class ImageTarget {
export class ImageTarget {
constructor(_z, _impl, _indx) {

@@ -195,7 +191,6 @@ this._z = _z;

}
exports.ImageTarget = ImageTarget;
/**
* Stores a mesh that represents an image target.
*/
class ImageTargetPreview {
export class ImageTargetPreview {
constructor(_z, _impl, _indx) {

@@ -210,2 +205,1 @@ this._z = _z;

}
exports.ImageTargetPreview = ImageTargetPreview;

@@ -1,21 +0,7 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.setOptions = void 0;
const zappar_1 = require("./zappar");
__exportStar(require("./index"), exports);
import { setOptions as _setOptions } from "./zappar";
export * from "./index";
const _worker = new (require("worker-loader?inline=fallback!@zappar/zappar-cv/lib/worker").default)();
zappar_1.setOptions({ worker: _worker });
function setOptions(opts) {
zappar_1.setOptions(Object.assign(Object.assign({}, opts), { worker: opts.worker || _worker }));
_setOptions({ worker: _worker });
export function setOptions(opts) {
_setOptions(Object.assign(Object.assign({}, opts), { worker: opts.worker || _worker }));
}
exports.setOptions = setOptions;

@@ -1,47 +0,14 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadedPromise = exports.loaded = exports.browserIncompatibleUI = exports.browserIncompatible = exports.projectionMatrixFromCameraModel = exports.drawPlane = exports.invert = exports.cameraDefaultDeviceID = exports.Event1 = exports.Event = exports.logLevel = exports.setLogLevel = exports.LogLevel = exports.Permission = exports.permissionRequestUI = exports.permissionRequest = exports.permissionDenied = exports.permissionGranted = exports.permissionDeniedUI = exports.FaceLandmark = exports.FaceLandmarkName = exports.Pipeline = exports.SequenceSource = exports.HTMLElementSource = exports.CameraSource = exports.FaceMesh = exports.FaceTracker = exports.BarcodeFinder = exports.InstantWorldTracker = exports.ImageTracker = void 0;
var imagetracker_1 = require("./imagetracker");
Object.defineProperty(exports, "ImageTracker", { enumerable: true, get: function () { return imagetracker_1.ImageTracker; } });
var instantworldtracker_1 = require("./instantworldtracker");
Object.defineProperty(exports, "InstantWorldTracker", { enumerable: true, get: function () { return instantworldtracker_1.InstantWorldTracker; } });
var barcodefinder_1 = require("./barcodefinder");
Object.defineProperty(exports, "BarcodeFinder", { enumerable: true, get: function () { return barcodefinder_1.BarcodeFinder; } });
var facetracker_1 = require("./facetracker");
Object.defineProperty(exports, "FaceTracker", { enumerable: true, get: function () { return facetracker_1.FaceTracker; } });
var facemesh_1 = require("./facemesh");
Object.defineProperty(exports, "FaceMesh", { enumerable: true, get: function () { return facemesh_1.FaceMesh; } });
var camerasource_1 = require("./camerasource");
Object.defineProperty(exports, "CameraSource", { enumerable: true, get: function () { return camerasource_1.CameraSource; } });
var htmlelementsource_1 = require("./htmlelementsource");
Object.defineProperty(exports, "HTMLElementSource", { enumerable: true, get: function () { return htmlelementsource_1.HTMLElementSource; } });
var sequencesource_1 = require("./sequencesource");
Object.defineProperty(exports, "SequenceSource", { enumerable: true, get: function () { return sequencesource_1.SequenceSource; } });
var pipeline_1 = require("./pipeline");
Object.defineProperty(exports, "Pipeline", { enumerable: true, get: function () { return pipeline_1.Pipeline; } });
var facelandmark_1 = require("./facelandmark");
Object.defineProperty(exports, "FaceLandmarkName", { enumerable: true, get: function () { return facelandmark_1.FaceLandmarkName; } });
Object.defineProperty(exports, "FaceLandmark", { enumerable: true, get: function () { return facelandmark_1.FaceLandmark; } });
var permission_1 = require("./permission");
Object.defineProperty(exports, "permissionDeniedUI", { enumerable: true, get: function () { return permission_1.permissionDeniedUI; } });
Object.defineProperty(exports, "permissionGranted", { enumerable: true, get: function () { return permission_1.permissionGranted; } });
Object.defineProperty(exports, "permissionDenied", { enumerable: true, get: function () { return permission_1.permissionDenied; } });
Object.defineProperty(exports, "permissionRequest", { enumerable: true, get: function () { return permission_1.permissionRequest; } });
Object.defineProperty(exports, "permissionRequestUI", { enumerable: true, get: function () { return permission_1.permissionRequestUI; } });
Object.defineProperty(exports, "Permission", { enumerable: true, get: function () { return permission_1.Permission; } });
var loglevel_1 = require("./loglevel");
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return loglevel_1.LogLevel; } });
Object.defineProperty(exports, "setLogLevel", { enumerable: true, get: function () { return loglevel_1.setLogLevel; } });
Object.defineProperty(exports, "logLevel", { enumerable: true, get: function () { return loglevel_1.logLevel; } });
var event_1 = require("./event");
Object.defineProperty(exports, "Event", { enumerable: true, get: function () { return event_1.Event; } });
Object.defineProperty(exports, "Event1", { enumerable: true, get: function () { return event_1.Event1; } });
var zappar_1 = require("./zappar");
Object.defineProperty(exports, "cameraDefaultDeviceID", { enumerable: true, get: function () { return zappar_1.cameraDefaultDeviceID; } });
Object.defineProperty(exports, "invert", { enumerable: true, get: function () { return zappar_1.invert; } });
Object.defineProperty(exports, "drawPlane", { enumerable: true, get: function () { return zappar_1.drawPlane; } });
Object.defineProperty(exports, "projectionMatrixFromCameraModel", { enumerable: true, get: function () { return zappar_1.projectionMatrixFromCameraModel; } });
Object.defineProperty(exports, "browserIncompatible", { enumerable: true, get: function () { return zappar_1.browserIncompatible; } });
Object.defineProperty(exports, "browserIncompatibleUI", { enumerable: true, get: function () { return zappar_1.browserIncompatibleUI; } });
Object.defineProperty(exports, "loaded", { enumerable: true, get: function () { return zappar_1.loaded; } });
Object.defineProperty(exports, "loadedPromise", { enumerable: true, get: function () { return zappar_1.loadedPromise; } });
export { ImageTracker } from "./imagetracker";
export { InstantWorldTracker } from "./instantworldtracker";
export { BarcodeFinder } from "./barcodefinder";
export { FaceTracker } from "./facetracker";
export { FaceMesh } from "./facemesh";
export { CameraSource } from "./camerasource";
export { HTMLElementSource } from "./htmlelementsource";
export { SequenceSource } from "./sequencesource";
export { Pipeline } from "./pipeline";
export { FaceLandmarkName, FaceLandmark } from "./facelandmark";
export { permissionDeniedUI, permissionGranted, permissionDenied, permissionRequest, permissionRequestUI, Permission } from "./permission";
export { LogLevel, setLogLevel, logLevel } from "./loglevel";
export { Event, Event1 } from "./event";
export { cameraDefaultDeviceID, invert, drawPlane, projectionMatrixFromCameraModel, browserIncompatible, browserIncompatibleUI, loaded, loadedPromise } from "./zappar";

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstantWorldTracker = void 0;
const zappar_cv_1 = require("@zappar/zappar-cv");
const zappar_1 = require("./zappar");
import { instant_world_tracker_transform_orientation_t } from "@zappar/zappar-cv";
import { z } from "./zappar";
/**

@@ -10,3 +7,3 @@ * Attaches content to a point on a surface in front of the user as it moves around in the camera view.

*/
class InstantWorldTracker {
export class InstantWorldTracker {
/**

@@ -25,3 +22,3 @@ * Constructs a new InstantWorldTracker.

};
this._z = zappar_1.z();
this._z = z();
this._impl = this._z.instant_world_tracker_create(this._pipeline._getImpl());

@@ -59,5 +56,4 @@ }

setAnchorPoseFromCameraOffset(x, y, z, orientation) {
this._z.instant_world_tracker_anchor_pose_set_from_camera_offset(this._impl, x, y, z, orientation || zappar_cv_1.instant_world_tracker_transform_orientation_t.MINUS_Z_AWAY_FROM_USER);
this._z.instant_world_tracker_anchor_pose_set_from_camera_offset(this._impl, x, y, z, orientation || instant_world_tracker_transform_orientation_t.MINUS_Z_AWAY_FROM_USER);
}
}
exports.InstantWorldTracker = InstantWorldTracker;

@@ -1,20 +0,14 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setLogLevel = exports.logLevel = exports.LogLevel = void 0;
const zappar_1 = require("./zappar");
var zappar_cv_1 = require("@zappar/zappar-cv");
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return zappar_cv_1.log_level_t; } });
import { z } from "./zappar";
export { log_level_t as LogLevel } from "@zappar/zappar-cv";
/**
* @returns The granularity of logging emitted by the library.
*/
function logLevel() {
return zappar_1.z().log_level();
export function logLevel() {
return z().log_level();
}
exports.logLevel = logLevel;
/**
* Sets the granularity of logging emitted by the library.
*/
function setLogLevel(l) {
zappar_1.z().log_level_set(l);
export function setLogLevel(l) {
z().log_level_set(l);
}
exports.setLogLevel = setLogLevel;

@@ -1,2 +0,1 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -11,9 +10,7 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
Object.defineProperty(exports, "__esModule", { value: true });
exports.permissionDeniedUI = exports.permissionRequestUI = exports.permissionRequest = exports.permissionDenied = exports.permissionGranted = exports.Permission = void 0;
const zappar_1 = require("./zappar");
import { z } from "./zappar";
/**
* The permissions that may be requested.
*/
var Permission;
export var Permission;
(function (Permission) {

@@ -28,3 +25,3 @@ /**

Permission[Permission["MOTION"] = 1] = "MOTION";
})(Permission = exports.Permission || (exports.Permission = {}));
})(Permission || (Permission = {}));
/**

@@ -35,10 +32,9 @@ * Checks if the browser has currently granted relevant permissions.

*/
function permissionGranted(onlyPermsission) {
export function permissionGranted(onlyPermsission) {
switch (onlyPermsission) {
case Permission.CAMERA: return zappar_1.z().permission_granted_camera();
case Permission.MOTION: return zappar_1.z().permission_granted_motion();
default: return zappar_1.z().permission_granted_all();
case Permission.CAMERA: return z().permission_granted_camera();
case Permission.MOTION: return z().permission_granted_motion();
default: return z().permission_granted_all();
}
}
exports.permissionGranted = permissionGranted;
/**

@@ -49,10 +45,9 @@ * Checks if the browser has currently denied relevant permissions.

*/
function permissionDenied(onlyPermission) {
export function permissionDenied(onlyPermission) {
switch (onlyPermission) {
case Permission.CAMERA: return zappar_1.z().permission_denied_camera();
case Permission.MOTION: return zappar_1.z().permission_denied_motion();
default: return zappar_1.z().permission_denied_any();
case Permission.CAMERA: return z().permission_denied_camera();
case Permission.MOTION: return z().permission_denied_motion();
default: return z().permission_denied_any();
}
}
exports.permissionDenied = permissionDenied;
/**

@@ -66,12 +61,12 @@ * Requests the browser to grant relevant permissions.

*/
function permissionRequest(onlyPermission) {
export function permissionRequest(onlyPermission) {
switch (onlyPermission) {
case Permission.CAMERA:
zappar_1.z().permission_request_camera();
z().permission_request_camera();
break;
case Permission.MOTION:
zappar_1.z().permission_request_motion();
z().permission_request_motion();
break;
default:
zappar_1.z().permission_request_all();
z().permission_request_all();
break;

@@ -86,7 +81,7 @@ }

case Permission.CAMERA:
if (zappar_1.z().permission_granted_camera()) {
if (z().permission_granted_camera()) {
resolve(true);
return;
}
if (zappar_1.z().permission_denied_camera()) {
if (z().permission_denied_camera()) {
resolve(false);

@@ -97,7 +92,7 @@ return;

case Permission.MOTION:
if (zappar_1.z().permission_granted_motion()) {
if (z().permission_granted_motion()) {
resolve(true);
return;
}
if (zappar_1.z().permission_denied_motion()) {
if (z().permission_denied_motion()) {
resolve(false);

@@ -108,7 +103,7 @@ return;

default:
if (zappar_1.z().permission_granted_camera() && zappar_1.z().permission_granted_motion()) {
if (z().permission_granted_camera() && z().permission_granted_motion()) {
resolve(true);
return;
}
if (zappar_1.z().permission_denied_camera() || zappar_1.z().permission_denied_motion()) {
if (z().permission_denied_camera() || z().permission_denied_motion()) {
resolve(false);

@@ -122,3 +117,2 @@ return;

}
exports.permissionRequest = permissionRequest;
/**

@@ -128,17 +122,15 @@ * Shows Zappar's built-in UI to request camera and motion data permissions

*/
function permissionRequestUI() {
export function permissionRequestUI() {
return __awaiter(this, void 0, void 0, function* () {
return yield zappar_1.z().permission_request_ui_promise();
return yield z().permission_request_ui_promise();
});
}
exports.permissionRequestUI = permissionRequestUI;
/**
* Shows Zappar's built-in permission denied UI.
*/
function permissionDeniedUI() {
return zappar_1.z().permission_denied_ui();
export function permissionDeniedUI() {
return z().permission_denied_ui();
}
exports.permissionDeniedUI = permissionDeniedUI;
function _nextFrame() {
return new Promise(resolve => requestAnimationFrame(() => resolve()));
}

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Pipeline = void 0;
const zappar_1 = require("./zappar");
const event_1 = require("./event");
import { z } from "./zappar";
import { Event } from "./event";
/**

@@ -10,3 +7,3 @@ * Pipelines manage the flow of data coming in (i.e. the camera frames) through to the output from the different tracking types and computer vision algorithms.

*/
class Pipeline {
export class Pipeline {
/**

@@ -19,9 +16,9 @@ * Constructs a new Pipeline.

*/
this.onFrameUpdate = new event_1.Event();
this.onFrameUpdate = new Event();
/**
* @ignore
*/
this._onFrameUpdateInternal = new event_1.Event();
this._onFrameUpdateInternal = new Event();
this._lastFrameNumber = -1;
this._z = zappar_1.z();
this._z = z();
this._impl = this._z.pipeline_create();

@@ -232,2 +229,1 @@ }

}
exports.Pipeline = Pipeline;

@@ -1,2 +0,1 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -11,9 +10,7 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SequenceSource = void 0;
const zappar_1 = require("./zappar");
import { z } from "./zappar";
/**
* Plays back a previously recorded sequence of camera and motion data.
*/
class SequenceSource {
export class SequenceSource {
/**

@@ -24,3 +21,3 @@ * Constructs a new SequenceSource.

constructor(pipeline) {
this._z = zappar_1.z();
this._z = z();
this._impl = this._z.sequence_source_create(pipeline._getImpl());

@@ -69,2 +66,1 @@ }

}
exports.SequenceSource = SequenceSource;
/**
* SDK version.
*/
export declare const VERSION = "2.1.0-beta.1";
export declare const VERSION = "2.2.0-beta.1";

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
/**
* SDK version.
*/
exports.VERSION = "2.1.0-beta.1";
export const VERSION = "2.2.0-beta.1";

@@ -1,2 +0,1 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -11,10 +10,8 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadedPromise = exports.loaded = exports.browserIncompatibleUI = exports.browserIncompatible = exports.drawPlane = exports.projectionMatrixFromCameraModel = exports.invert = exports.cameraDefaultDeviceID = exports.z = exports.setOptions = void 0;
const zappar_cv_1 = require("@zappar/zappar-cv");
const gl_matrix_1 = require("gl-matrix");
const version_1 = require("./version");
import { initialize } from "@zappar/zappar-cv";
import { mat4 } from "gl-matrix";
import { VERSION } from "./version";
let _z;
let _options;
function setOptions(opts) {
export function setOptions(opts) {
if (_z)

@@ -24,14 +21,12 @@ console.warn("setOptions called after Zappar JS initialization");

}
exports.setOptions = setOptions;
/**
* @ignore
*/
function z() {
export function z() {
if (!_z) {
console.log(`Zappar JS v${version_1.VERSION}`);
_z = zappar_cv_1.initialize(_options);
console.log(`Zappar JS v${VERSION}`);
_z = initialize(_options);
}
return _z;
}
exports.z = z;
/**

@@ -43,6 +38,5 @@ * Gets the ID or the default rear- or user-facing camera.

*/
function cameraDefaultDeviceID(userFacing) {
export function cameraDefaultDeviceID(userFacing) {
return z().camera_default_device_id(userFacing || false);
}
exports.cameraDefaultDeviceID = cameraDefaultDeviceID;
/**

@@ -53,8 +47,7 @@ * Inverts a 4x4 Float32Array Matrix.

*/
function invert(m) {
const ret = gl_matrix_1.mat4.create();
gl_matrix_1.mat4.invert(ret, m);
export function invert(m) {
const ret = mat4.create();
mat4.invert(ret, m);
return ret;
}
exports.invert = invert;
/**

@@ -69,13 +62,11 @@ * Calculates the projection matrix from a given camera model (i.e. intrinsic camera parameters)

*/
function projectionMatrixFromCameraModel(model, renderWidth, renderHeight, zNear = 0.1, zFar = 100) {
export function projectionMatrixFromCameraModel(model, renderWidth, renderHeight, zNear = 0.1, zFar = 100) {
return z().projection_matrix_from_camera_model_ext(model, renderWidth, renderHeight, zNear, zFar);
}
exports.projectionMatrixFromCameraModel = projectionMatrixFromCameraModel;
/**
* @ignore
*/
function drawPlane(gl, projectionMatrix, cameraMatrix, targetMatrix, texture) {
export function drawPlane(gl, projectionMatrix, cameraMatrix, targetMatrix, texture) {
z().draw_plane(gl, projectionMatrix, cameraMatrix, targetMatrix, texture);
}
exports.drawPlane = drawPlane;
/**

@@ -85,6 +76,5 @@ * Detects if your page is running in a browser that's not supported

*/
function browserIncompatible() {
export function browserIncompatible() {
return z().browser_incompatible();
}
exports.browserIncompatible = browserIncompatible;
/**

@@ -95,6 +85,5 @@ * Shows a full-page dialog that informs the user they're using an unsupported browser,

*/
function browserIncompatibleUI() {
export function browserIncompatibleUI() {
z().browser_incompatible_ui();
}
exports.browserIncompatibleUI = browserIncompatibleUI;
/**

@@ -106,6 +95,5 @@ * Check if the Zappar library is fully loaded and ready to process data.

*/
function loaded() {
export function loaded() {
return z().loaded();
}
exports.loaded = loaded;
/**

@@ -117,3 +105,3 @@ * Gets a promise that resolves when the Zappar library is fully loaded and ready to process data.

*/
function loadedPromise() {
export function loadedPromise() {
return __awaiter(this, void 0, void 0, function* () {

@@ -127,5 +115,4 @@ while (true) {

}
exports.loadedPromise = loadedPromise;
function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
{
"name": "@zappar/zappar",
"version": "2.1.0-beta.1",
"version": "2.2.0-beta.1",
"description": "Zappar's computer vision for JavaScript, supporting image, face and instant world tracking, and barcode scanning.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -62,3 +62,3 @@ # Zappar for JavaScript/TypeScript

<!-- Added by: zapparadmin, at: Tue Feb 7 11:02:12 GMT 2023 -->
<!-- Added by: zapparadmin, at: Wed Feb 8 13:02:52 GMT 2023 -->

@@ -75,3 +75,3 @@ <!--te-->

Download the bundle from this link:
https://libs.zappar.com/zappar-js/2.1.0-beta.1/zappar-js.zip
https://libs.zappar.com/zappar-js/2.2.0-beta.1/zappar-js.zip

@@ -87,3 +87,3 @@ Unzip into your web project and reference from your HTML like this:

```html
<script src="https://libs.zappar.com/zappar-js/2.1.0-beta.1/zappar.js"></script>
<script src="https://libs.zappar.com/zappar-js/2.2.0-beta.1/zappar.js"></script>
```

@@ -90,0 +90,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc