@zappar/zappar-cv 0.3.11 → 0.3.15

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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.15] - 2021-01-25
4
+
5
+ ### Fixed
6
+
7
+ - Issues on iPad Pro
8
+
9
+ ## [0.3.14] - 2021-10-25
10
+
11
+ ### Changed
12
+
13
+ - Pinned dependencies to exact versions
14
+
15
+ ## [0.3.13] - 2021-10-11
16
+
17
+ ### Fixed
18
+
19
+ - A broken licencing url.
20
+
21
+ ## [0.3.12] - 2021-09-28
22
+
23
+ ### Fixed
24
+
25
+ - Safari logo not appearing on incompatible browser screen
26
+ - Issues with iPad devices
27
+
3
28
  ## [0.3.11] - 2021-09-17
4
29
 
5
30
  ### Fixed
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/0.3.11/zappar-cv.js"></script>
21
+ <script src="https://libs.zappar.com/zappar-cv/0.3.15/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/0.3.11/zappar-cv.zip](https://libs.zappar.com/zappar-cv/0.3.11/zappar-cv.zip)
25
+ [https://libs.zappar.com/zappar-cv/0.3.15/zappar-cv.zip](https://libs.zappar.com/zappar-cv/0.3.15/zappar-cv.zip)
@@ -39,7 +39,7 @@ function getUnsupportedMessage() {
39
39
  background-repeat: no-repeat;
40
40
  }
41
41
  .zee-launcher-browser-safari .zee-launcher-browser-logo {
42
- background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg version='1.1' viewBox='0 0 211 211' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg transform='translate(-82 -146)' fill-rule='nonzero' stroke='%23fffffft' stroke-width='2'%3E%3Cpath d='m180 251.86c0-4.0385 2.9377-7.855 7.2552-7.855 3.9614 0 7.7448 2.8402 7.7448 7.145 0 4.0385-2.8487 7.855-7.1662 7.855-4.0059 0-7.8338-2.9734-7.8338-7.145zm112-0.35503c0 57.728-46.772 104.5-104.5 104.5s-104.5-46.772-104.5-104.5 46.772-104.5 104.5-104.5 104.5 46.772 104.5 104.5zm-12-1c0-51.649-41.851-93.5-93.5-93.5s-93.5 41.851-93.5 93.5 41.851 93.5 93.5 93.5 93.5-41.851 93.5-93.5zm-30.624 40.983c0 1.5095 5.4495 4.2768 6.8328 5.1154-11.486 17.401-29.26 29.938-49.423 34.928l-1.8444-7.757c-0.12576-1.0482-0.79646-1.174-1.7606-1.174-0.79646 0-1.2576 1.174-1.1737 1.7611l1.8444 7.8828c-5.5753 1.174-11.234 1.7611-16.935 1.7611-15.217 0-30.182-4.2768-43.177-12.202 0.71263-1.174 5.1141-7.5474 5.1141-8.4698 0-0.79666-0.71263-1.5095-1.5091-1.5095-1.6348 0-5.1141 6.9603-6.1621 8.344-17.522-11.615-30.182-29.602-35.044-50.148l8.0066-1.761c0.92222-0.25158 1.1737-0.92246 1.1737-1.7611 0-0.79667-1.1737-1.2579-1.8444-1.174l-7.8389 1.803c-1.048-5.3251-1.6348-10.692-1.6348-16.143 0-15.556 4.4015-30.86 12.66-43.984 1.1737 0.71281 6.749 4.5284 7.6712 4.5284 0.79646 0 1.5091-0.58702 1.5091-1.3837 0-1.6353-6.1621-4.7381-7.5455-5.7024 11.821-17.275 29.805-29.728 50.219-34.34l1.7606 7.757c0.25152 0.92246 0.92222 1.174 1.7606 1.174 0.83838 0 1.2576-1.174 1.1737-1.8449l-1.7606-7.6732c5.1141-0.92246 10.312-1.5095 15.552-1.5095 15.552 0 30.727 4.4026 43.973 12.663-0.79646 1.174-4.5273 6.6249-4.5273 7.5474 0 0.79667 0.58687 1.5095 1.3833 1.5095 1.6348 0 4.7369-6.0379 5.5753-7.4216 17.187 11.615 29.469 29.351 34.248 49.561l-6.4975 1.3837c-1.048 0.25158-1.1737 0.92246-1.1737 1.8449 0 0.79667 1.1737 1.2579 1.7606 1.174l6.6232-1.5095c1.048 5.3251 1.6348 10.776 1.6348 16.227 0 15.221-4.1919 30.189-12.073 43.062-1.1737-0.58702-6.0364-4.0672-6.9586-4.0672-0.8803 0-1.5929 0.71281-1.5929 1.5095zm-14.876-98.483c-5.2178 4.88-53.863 49.48-55.228 51.8l-38.772 64.2c5.0974-4.76 53.863-49.6 55.108-51.72l38.892-64.28z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
42
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg version='1.1' viewBox='0 0 211 211' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg transform='translate(-82 -146)' fill-rule='nonzero' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='m180 251.86c0-4.0385 2.9377-7.855 7.2552-7.855 3.9614 0 7.7448 2.8402 7.7448 7.145 0 4.0385-2.8487 7.855-7.1662 7.855-4.0059 0-7.8338-2.9734-7.8338-7.145zm112-0.35503c0 57.728-46.772 104.5-104.5 104.5s-104.5-46.772-104.5-104.5 46.772-104.5 104.5-104.5 104.5 46.772 104.5 104.5zm-12-1c0-51.649-41.851-93.5-93.5-93.5s-93.5 41.851-93.5 93.5 41.851 93.5 93.5 93.5 93.5-41.851 93.5-93.5zm-30.624 40.983c0 1.5095 5.4495 4.2768 6.8328 5.1154-11.486 17.401-29.26 29.938-49.423 34.928l-1.8444-7.757c-0.12576-1.0482-0.79646-1.174-1.7606-1.174-0.79646 0-1.2576 1.174-1.1737 1.7611l1.8444 7.8828c-5.5753 1.174-11.234 1.7611-16.935 1.7611-15.217 0-30.182-4.2768-43.177-12.202 0.71263-1.174 5.1141-7.5474 5.1141-8.4698 0-0.79666-0.71263-1.5095-1.5091-1.5095-1.6348 0-5.1141 6.9603-6.1621 8.344-17.522-11.615-30.182-29.602-35.044-50.148l8.0066-1.761c0.92222-0.25158 1.1737-0.92246 1.1737-1.7611 0-0.79667-1.1737-1.2579-1.8444-1.174l-7.8389 1.803c-1.048-5.3251-1.6348-10.692-1.6348-16.143 0-15.556 4.4015-30.86 12.66-43.984 1.1737 0.71281 6.749 4.5284 7.6712 4.5284 0.79646 0 1.5091-0.58702 1.5091-1.3837 0-1.6353-6.1621-4.7381-7.5455-5.7024 11.821-17.275 29.805-29.728 50.219-34.34l1.7606 7.757c0.25152 0.92246 0.92222 1.174 1.7606 1.174 0.83838 0 1.2576-1.174 1.1737-1.8449l-1.7606-7.6732c5.1141-0.92246 10.312-1.5095 15.552-1.5095 15.552 0 30.727 4.4026 43.973 12.663-0.79646 1.174-4.5273 6.6249-4.5273 7.5474 0 0.79667 0.58687 1.5095 1.3833 1.5095 1.6348 0 4.7369-6.0379 5.5753-7.4216 17.187 11.615 29.469 29.351 34.248 49.561l-6.4975 1.3837c-1.048 0.25158-1.1737 0.92246-1.1737 1.8449 0 0.79667 1.1737 1.2579 1.7606 1.174l6.6232-1.5095c1.048 5.3251 1.6348 10.776 1.6348 16.227 0 15.221-4.1919 30.189-12.073 43.062-1.1737-0.58702-6.0364-4.0672-6.9586-4.0672-0.8803 0-1.5929 0.71281-1.5929 1.5095zm-14.876-98.483c-5.2178 4.88-53.863 49.48-55.228 51.8l-38.772 64.2c5.0974-4.76 53.863-49.6 55.108-51.72l38.892-64.28z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
43
43
  }
44
44
  .zee-launcher-unsupported-message {
45
45
  text-align: center;
package/lib/profile.js CHANGED
@@ -26,41 +26,41 @@ let engine = (agent.getEngine().name || "unknown").toLowerCase();
26
26
  if (engine === "webkit" && os !== "ios") {
27
27
  exports.profile.deviceMotionMutliplier = 1.0;
28
28
  if (window.orientation !== undefined) {
29
- // iPad
30
- exports.profile.videoElementInDOM = true;
31
- exports.profile.showSafariPermissionsResetIfNecessary = true;
29
+ // iPad. The version number isn't reliable as it masquerades as MacOS
30
+ iDevice("15.0");
32
31
  }
33
32
  }
34
33
  if (engine === "webkit" && os === "ios") {
35
34
  exports.profile.deviceMotionMutliplier = 1.0;
36
- let version = agent.getOS().version;
37
- if (version) {
38
- let versionParts = version.split(".");
39
- if (versionParts.length >= 2) {
40
- const majorVersion = parseInt(versionParts[0]);
41
- const minorVersion = parseInt(versionParts[1]);
42
- if (majorVersion < 11 ||
43
- (majorVersion === 11 && minorVersion < 3)) {
44
- exports.profile.blacklisted = true;
45
- }
46
- if (majorVersion < 12 ||
47
- (majorVersion === 12 && minorVersion < 2)) {
48
- exports.profile.videoElementInDOM = true;
49
- }
50
- if ((majorVersion === 12 && minorVersion >= 2) || (majorVersion >= 13))
51
- exports.profile.showGyroPermissionsWarningIfNecessary = true;
52
- if (majorVersion >= 13) {
53
- exports.profile.showSafariPermissionsResetIfNecessary = true;
54
- }
55
- if (((majorVersion >= 12 && minorVersion > 1) || (majorVersion >= 13)) &&
56
- navigator.mediaDevices &&
57
- navigator.mediaDevices.getSupportedConstraints &&
58
- navigator.mediaDevices.getSupportedConstraints().frameRate) {
59
- exports.profile.requestHighFrameRate = true;
60
- // Avoid bug where iOS letterboxes 16:9 into 4:3 for high fps
61
- exports.profile.videoHeight = 360;
62
- exports.profile.dataHeight = 180;
63
- }
35
+ const version = agent.getOS().version || "15.0";
36
+ iDevice(version);
37
+ }
38
+ function iDevice(version) {
39
+ let versionParts = version.split(".");
40
+ if (versionParts.length >= 2) {
41
+ const majorVersion = parseInt(versionParts[0]);
42
+ const minorVersion = parseInt(versionParts[1]);
43
+ if (majorVersion < 11 ||
44
+ (majorVersion === 11 && minorVersion < 3)) {
45
+ exports.profile.blacklisted = true;
46
+ }
47
+ if (majorVersion < 12 ||
48
+ (majorVersion === 12 && minorVersion < 2)) {
49
+ exports.profile.videoElementInDOM = true;
50
+ }
51
+ if ((majorVersion === 12 && minorVersion >= 2) || (majorVersion >= 13))
52
+ exports.profile.showGyroPermissionsWarningIfNecessary = true;
53
+ if (majorVersion >= 13) {
54
+ exports.profile.showSafariPermissionsResetIfNecessary = true;
55
+ }
56
+ if (((majorVersion >= 12 && minorVersion > 1) || (majorVersion >= 13)) &&
57
+ navigator.mediaDevices &&
58
+ navigator.mediaDevices.getSupportedConstraints &&
59
+ navigator.mediaDevices.getSupportedConstraints().frameRate) {
60
+ exports.profile.requestHighFrameRate = true;
61
+ // Avoid bug where iOS letterboxes 16:9 into 4:3 for high fps
62
+ exports.profile.videoHeight = 360;
63
+ exports.profile.dataHeight = 180;
64
64
  }
65
65
  }
66
66
  }
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.3.11";
1
+ export declare const VERSION = "0.3.15";
package/lib/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "0.3.11";
4
+ exports.VERSION = "0.3.15";
package/lib/zcv.js CHANGED
@@ -25,8 +25,8 @@ k.memory;var b=c.buffer;a.byteLength<b.byteLength&&p("the new buffer in mergeMem
25
25
  !1;if(!(c.wasmMemory instanceof WebAssembly.Memory))return p("no native wasm Memory in use"),!1;a.memory=c.wasmMemory;h.global={NaN:NaN,Infinity:Infinity};h["global.Math"]=Math;h.env=a;db();if(c.instantiateWasm)try{return c.instantiateWasm(h,d)}catch(F){return p("Module.instantiateWasm callback failed with error: "+F),!1}c.wasmBinary||"function"!==typeof WebAssembly.instantiateStreaming||fb(f)||"function"!==typeof fetch?g(e):WebAssembly.instantiateStreaming(fetch(f,{credentials:"same-origin"}),h).then(e,
26
26
  function(a){p("wasm streaming compile failed: "+a);p("falling back to ArrayBuffer instantiation");g(e)});return{}}var e="zcv.wast",f="zcv.wasm",g="zcv.temp.asm.js";fb(e)||(e=ba(e));fb(f)||(f=ba(f));fb(g)||(g=ba(g));var h={global:null,env:null,asm2wasm:ka,parent:c},k=null;c.asmPreload=c.asm;var m=c.reallocBuffer;c.reallocBuffer=function(a){if("asmjs"===q)var b=m(a);else a:{a=Ba(a,c.usingWasm?ya:za);var d=c.buffer.byteLength;if(c.usingWasm)try{b=-1!==c.wasmMemory.grow((a-d)/65536)?c.buffer=c.wasmMemory.buffer:
27
27
  null;break a}catch(I){b=null;break a}b=void 0}return b};var q="";c.asm=function(a,b){if(!b.table){a=c.wasmTableSize;void 0===a&&(a=1024);var e=c.wasmMaxTableSize;b.table="object"===typeof WebAssembly&&"function"===typeof WebAssembly.Table?void 0!==e?new WebAssembly.Table({initial:a,maximum:e,element:"anyfunc"}):new WebAssembly.Table({initial:a,element:"anyfunc"}):Array(a);c.wasmTable=b.table}b.__memory_base||(b.__memory_base=c.STATIC_BASE);b.__table_base||(b.__table_base=0);b=d(b);assert(b,"no binaryen method succeeded.");
28
- return b}})();var gb=[function(){if(self.crypto&&self.crypto.getRandomValues){var a=new Uint32Array(1);self.crypto.getRandomValues(a);return a[0]}return 9007199254740991*Math.random()}];Ga=1024;u=Ga+432640;
29
- Ra.push({g:function(){hb()}},{g:function(){ib()}},{g:function(){jb()}},{g:function(){kb()}},{g:function(){lb()}},{g:function(){mb()}},{g:function(){nb()}},{g:function(){ob()}},{g:function(){pb()}},{g:function(){qb()}},{g:function(){rb()}},{g:function(){sb()}},{g:function(){tb()}},{g:function(){ub()}},{g:function(){vb()}},{g:function(){wb()}},{g:function(){xb()}},{g:function(){yb()}},{g:function(){zb()}},{g:function(){Ab()}},{g:function(){Bb()}});c.STATIC_BASE=Ga;c.STATIC_BUMP=432640;var Cb=u;u+=16;
28
+ return b}})();var gb=[function(){if(self.crypto&&self.crypto.getRandomValues){var a=new Uint32Array(1);self.crypto.getRandomValues(a);return a[0]}return 9007199254740991*Math.random()}];Ga=1024;u=Ga+432656;
29
+ Ra.push({g:function(){hb()}},{g:function(){ib()}},{g:function(){jb()}},{g:function(){kb()}},{g:function(){lb()}},{g:function(){mb()}},{g:function(){nb()}},{g:function(){ob()}},{g:function(){pb()}},{g:function(){qb()}},{g:function(){rb()}},{g:function(){sb()}},{g:function(){tb()}},{g:function(){ub()}},{g:function(){vb()}},{g:function(){wb()}},{g:function(){xb()}},{g:function(){yb()}},{g:function(){zb()}},{g:function(){Ab()}},{g:function(){Bb()}});c.STATIC_BASE=Ga;c.STATIC_BUMP=432656;var Cb=u;u+=16;
30
30
  var L={};
31
31
  function Db(a){if(Db.Da){var b=v[a>>2];var d=v[b>>2]}else Db.Da=!0,L.USER=L.LOGNAME="web_user",L.PATH="/",L.PWD="/",L.HOME="/home/web_user",L.LANG="C.UTF-8",L._=c.thisProgram,d=Ha?Va?M(1024):ea(1024):da(1024),b=Ha?Va?M(256):ea(256):da(256),v[b>>2]=d,v[a>>2]=b;a=[];var e=0,f;for(f in L)if("string"===typeof L[f]){var g=f+"="+L[f];a.push(g);e+=g.length}if(1024<e)throw Error("Environment size exceeded TOTAL_ENV_SIZE!");for(f=0;f<a.length;f++){e=g=a[f];for(var h=d,k=0;k<e.length;++k)D[h++>>0]=e.charCodeAt(k);
32
32
  D[h>>0]=0;v[b+4*f>>2]=d;d+=g.length+1}v[b+4*a.length>>2]=0}function O(){z()}function Eb(){return"undefined"!==typeof dateNow||self.performance&&self.performance.now}
package/lib/zcv.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zappar/zappar-cv",
3
- "version": "0.3.11",
3
+ "version": "0.3.15",
4
4
  "description": "Zappar's core computer vision library, supporting image, face and world tracking.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -10,8 +10,8 @@
10
10
  "build-module": "tsc",
11
11
  "test-module": "jest puppeteer/module",
12
12
  "test-standalone": "jest puppeteer/standalone",
13
- "tests": "webpack --config=webpack.tests.config.js --mode=development && webpack-dev-server --config=webpack.tests.config.js",
14
- "webpack-puppeteer": "webpack --config=webpack.config.puppeteer.js --mode=development && webpack-dev-server --config=webpack.config.puppeteer.js",
13
+ "tests": "webpack --config=webpack.tests.config.js --mode=development && webpack serve --config=webpack.tests.config.js",
14
+ "webpack-puppeteer": "webpack --config=webpack.config.puppeteer.js --mode=development && webpack serve --config=webpack.config.puppeteer.js",
15
15
  "standalone-test-serve": "concurrently 'zapworks serve --port 7010 umd' 'zapworks serve --port 7011 puppeteer-standalone-dist' || true",
16
16
  "standalone-test-serve2": "zapworks serve --port 7011 puppeteer-standalone-dist"
17
17
  },
@@ -25,36 +25,36 @@
25
25
  "upkg": "umd/zappar-cv.js",
26
26
  "license": "Proprietary",
27
27
  "devDependencies": {
28
- "@types/expect-puppeteer": "^4.4.5",
29
- "@types/jest-environment-puppeteer": "^4.4.1",
30
- "@types/node": "^14.14.7",
31
- "@types/pixelmatch": "^5.2.2",
32
- "@types/pngjs": "^6.0.0",
33
- "@types/puppeteer": "^5.4.3",
34
- "@zappar/zapworks-cli": "^0.6.17",
35
- "concurrently": "^5.3.0",
36
- "dat.gui": "^0.7.7",
37
- "html-webpack-plugin": "^4.5.0",
38
- "jest": "^26.6.3",
39
- "jest-puppeteer": "^4.4.0",
40
- "jsdoc": "^3.6.3",
41
- "pixelmatch": "^5.2.1",
42
- "pngjs": "^6.0.0",
43
- "puppeteer": "^7.1.0",
44
- "ts-jest": "^26.5.1",
45
- "ts-loader": "^8.0.11",
46
- "ts-node": "^9.1.1",
47
- "typescript": "^4.0.5",
48
- "webpack": "^4.41.5",
49
- "webpack-cli": "^3.3.10",
50
- "webpack-dev-server": "^3.11.0"
28
+ "@types/expect-puppeteer": "4.4.5",
29
+ "@types/jest-environment-puppeteer": "4.4.1",
30
+ "@types/node": "14.14.7",
31
+ "@types/pixelmatch": "5.2.2",
32
+ "@types/pngjs": "6.0.0",
33
+ "@types/puppeteer": "5.4.3",
34
+ "@zappar/zapworks-cli": "0.6.17",
35
+ "concurrently": "5.3.0",
36
+ "dat.gui": "0.7.7",
37
+ "html-webpack-plugin": "4.5.0",
38
+ "jest": "26.6.3",
39
+ "jest-puppeteer": "4.4.0",
40
+ "jsdoc": "3.6.3",
41
+ "pixelmatch": "5.2.1",
42
+ "pngjs": "6.0.0",
43
+ "puppeteer": "7.1.0",
44
+ "ts-jest": "26.5.1",
45
+ "ts-loader": "8.0.11",
46
+ "ts-node": "9.1.1",
47
+ "typescript": "4.0.5",
48
+ "webpack": "4.46.0",
49
+ "webpack-cli": "4.9.1",
50
+ "webpack-dev-server": "3.11.2"
51
51
  },
52
52
  "dependencies": {
53
- "@types/gl-matrix": "^2.4.5",
54
- "@types/ua-parser-js": "^0.7.33",
55
- "file-loader": "^6.2.0",
53
+ "@types/gl-matrix": "2.4.5",
54
+ "@types/ua-parser-js": "0.7.33",
55
+ "file-loader": "6.2.0",
56
56
  "gl-matrix": "3.1.0",
57
- "ua-parser-js": "^0.7.21",
58
- "worker-loader": "^3.0.5"
57
+ "ua-parser-js": "0.7.30",
58
+ "worker-loader": "3.0.5"
59
59
  }
60
60
  }