@zappar/zappar-cv 2.0.0-beta.9 → 2.1.0-beta.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.0] - 2023-02-06
4
+
5
+ ### Added
6
+ - Spanish, Portuguese and German translations for permissions screen
7
+
8
+ ### Changed
9
+
10
+ - Improvements to curved tracking
11
+
12
+ ## [2.0.0] - 2022-08-23
13
+
14
+ ### Added
15
+
16
+ - Greatly improved instant tracking.
17
+ - Introduced `SequenceSource` and pipeline functions to record and playback sequences of camera+motion data.
18
+ - Added support for curved tracking.
19
+ - Added support for fetching image element containing target image's embedded preview image.
20
+ - Improved GL state management.
21
+
22
+ ### Changed
23
+
24
+ - Migrated to Webpack 5 workers.
25
+
26
+ ### **Breaking:**
27
+
28
+ - Dropped support for webpack 4.
29
+
3
30
  ## [0.3.17] - 2022-07-21
4
31
 
5
32
  ### 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/2.0.0-beta.9/zappar-cv.js"></script>
21
+ <script src="https://libs.zappar.com/zappar-cv/2.1.0-beta.0/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.0.0-beta.9/zappar-cv.zip](https://libs.zappar.com/zappar-cv/2.0.0-beta.9/zappar-cv.zip)
25
+ [https://libs.zappar.com/zappar-cv/2.1.0-beta.0/zappar-cv.zip](https://libs.zappar.com/zappar-cv/2.1.0-beta.0/zappar-cv.zip)
package/lib/permission.js CHANGED
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { UAParser } from "ua-parser-js";
11
+ import { STRINGS, tr } from "./tr";
11
12
  let parser = new UAParser();
12
13
  let _permissionGrantedCamera = false;
13
14
  let _permissionGrantedMotion = false;
@@ -120,9 +121,9 @@ export function permissionRequestUI() {
120
121
  }
121
122
  </style>
122
123
  <div class="zappar-inner">
123
- <div class="zappar-title">Almost there...</div>
124
- <div class="zappar-text">In order to provide this augmented reality experience, we need access to your device's camera and motion sensors.</div>
125
- <button id="zappar-permission-request-button">Grant Access</button>
124
+ <div class="zappar-title">${tr(STRINGS.PermissionTitle)}</div>
125
+ <div class="zappar-text">${tr(STRINGS.PermissionDescription)}</div>
126
+ <button id="zappar-permission-request-button">${tr(STRINGS.PermissionButton)}</button>
126
127
  </div>
127
128
  `;
128
129
  document.body.append(div);
package/lib/pipeline.d.ts CHANGED
@@ -17,7 +17,7 @@ export declare class Pipeline {
17
17
  private cameraTokens;
18
18
  private nextCameraToken;
19
19
  private tokensInFlight;
20
- glContext: WebGLRenderingContext | undefined;
20
+ glContext: WebGLRenderingContext | WebGL2RenderingContext | undefined;
21
21
  private videoTextures;
22
22
  cameraPixelArrays: ArrayBuffer[];
23
23
  private _cameraDraw;
package/lib/tr.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export declare enum STRINGS {
2
+ PermissionTitle = 0,
3
+ PermissionDescription = 1,
4
+ PermissionButton = 2
5
+ }
6
+ export declare function tr(str: STRINGS): string;
package/lib/tr.js ADDED
@@ -0,0 +1,42 @@
1
+ export var STRINGS;
2
+ (function (STRINGS) {
3
+ STRINGS[STRINGS["PermissionTitle"] = 0] = "PermissionTitle";
4
+ STRINGS[STRINGS["PermissionDescription"] = 1] = "PermissionDescription";
5
+ STRINGS[STRINGS["PermissionButton"] = 2] = "PermissionButton";
6
+ })(STRINGS || (STRINGS = {}));
7
+ function parseLanguage(inp) {
8
+ const [lang, locale] = inp.toLowerCase().split("-");
9
+ return [lang, locale || ""];
10
+ }
11
+ const [lang, locale] = parseLanguage(navigator.language);
12
+ export function tr(str) {
13
+ switch (lang) {
14
+ case "es":
15
+ switch (str) {
16
+ case STRINGS.PermissionTitle: return "Ya casi...";
17
+ case STRINGS.PermissionDescription: return "Para brindar esta experiencia de realidad aumentada, necesitamos acceso a la cámara y los sensores de movimiento de su dispositivo.";
18
+ case STRINGS.PermissionButton: return "Permitir acceso";
19
+ }
20
+ break;
21
+ case "de":
22
+ switch (str) {
23
+ case STRINGS.PermissionTitle: return "Fast am Ziel..";
24
+ case STRINGS.PermissionDescription: return "Um dir dieses Augmented Reality Erlebnis zu liefern, brauchen wir Zugriff auf die Kamera und Bewegungssensoren deines Gerätes.";
25
+ case STRINGS.PermissionButton: return "Gewähre Zugriff";
26
+ }
27
+ break;
28
+ case "pt":
29
+ switch (str) {
30
+ case STRINGS.PermissionTitle: return "Está quase!";
31
+ case STRINGS.PermissionDescription: return "Esta experiência de realidade aumentada precisa de acesso à câmera e aos sensores de movimento deste dispositivo.";
32
+ case STRINGS.PermissionButton: return "Permitir acesso";
33
+ }
34
+ break;
35
+ }
36
+ switch (str) {
37
+ case STRINGS.PermissionTitle: return "Almost there...";
38
+ case STRINGS.PermissionDescription: return "In order to provide this augmented reality experience, we need access to your device's camera and motion sensors.";
39
+ case STRINGS.PermissionButton: return "Grant Access";
40
+ }
41
+ return "";
42
+ }
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "2.0.0-beta.9";
1
+ export declare const VERSION = "2.1.0-beta.0";
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "2.0.0-beta.9";
1
+ export const VERSION = "2.1.0-beta.0";
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zappar/zappar-cv",
3
- "version": "2.0.0-beta.9",
3
+ "version": "2.1.0-beta.0",
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",