@srsergio/taptapp-ar 1.0.56 → 1.0.58
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/react/types.d.ts +5 -2
- package/dist/react/types.js +7 -5
- package/package.json +1 -1
- package/src/react/types.ts +12 -7
package/dist/react/types.d.ts
CHANGED
|
@@ -3,20 +3,23 @@ export interface ARConfig {
|
|
|
3
3
|
targetImageSrc: string;
|
|
4
4
|
targetTaarSrc: string;
|
|
5
5
|
videoSrc: string;
|
|
6
|
+
overlaySrc: string;
|
|
6
7
|
videoWidth: number;
|
|
7
8
|
videoHeight: number;
|
|
8
9
|
scale: number;
|
|
10
|
+
overlayType: "video" | "image";
|
|
9
11
|
}
|
|
10
12
|
export interface ARDataItem {
|
|
11
13
|
id: string;
|
|
12
|
-
type: "photos" | "videoNative" | "ar";
|
|
14
|
+
type: "photos" | "videoNative" | "ar" | "imageOverlay";
|
|
13
15
|
images?: {
|
|
14
16
|
image: string;
|
|
15
17
|
fileId: string;
|
|
16
18
|
}[];
|
|
17
19
|
url?: string;
|
|
20
|
+
fileId?: string;
|
|
18
21
|
scale?: number;
|
|
19
22
|
width?: number;
|
|
20
23
|
height?: number;
|
|
21
24
|
}
|
|
22
|
-
export declare function mapDataToPropsConfig(data:
|
|
25
|
+
export declare function mapDataToPropsConfig(data: ARDataItem[]): ARConfig;
|
package/dist/react/types.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
export function mapDataToPropsConfig(data) {
|
|
2
2
|
const photos = data.find((item) => item.type === "photos");
|
|
3
|
-
const
|
|
3
|
+
const overlay = data.find((item) => item.type === "videoNative" || item.type === "imageOverlay");
|
|
4
4
|
const ar = data.find((item) => item.type === "ar");
|
|
5
5
|
return {
|
|
6
6
|
cardId: photos?.id || "",
|
|
7
7
|
targetImageSrc: photos?.images?.[0]?.image || "",
|
|
8
8
|
targetTaarSrc: ar?.url || "",
|
|
9
|
-
videoSrc:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
videoSrc: overlay?.url || "",
|
|
10
|
+
overlaySrc: overlay?.url || "",
|
|
11
|
+
videoWidth: overlay?.width || 0,
|
|
12
|
+
videoHeight: overlay?.height || 0,
|
|
13
|
+
scale: overlay?.scale || 1,
|
|
14
|
+
overlayType: overlay?.type === "videoNative" ? "video" : "image",
|
|
13
15
|
};
|
|
14
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@srsergio/taptapp-ar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"author": "Sergio Lazaro <srsergiolazaro@gmail.com>",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"description": "Ultra-fast, lightweight Augmented Reality Image Tracking SDK for the web. Features an optimized offline compiler, React components, and compatibility with Three.js/A-Frame. No heavy ML frameworks required.",
|
package/src/react/types.ts
CHANGED
|
@@ -3,33 +3,38 @@ export interface ARConfig {
|
|
|
3
3
|
targetImageSrc: string;
|
|
4
4
|
targetTaarSrc: string;
|
|
5
5
|
videoSrc: string;
|
|
6
|
+
overlaySrc: string; // Alias for preloading/compatibility
|
|
6
7
|
videoWidth: number;
|
|
7
8
|
videoHeight: number;
|
|
8
9
|
scale: number;
|
|
10
|
+
overlayType: "video" | "image";
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export interface ARDataItem {
|
|
12
14
|
id: string;
|
|
13
|
-
type: "photos" | "videoNative" | "ar";
|
|
15
|
+
type: "photos" | "videoNative" | "ar" | "imageOverlay";
|
|
14
16
|
images?: { image: string; fileId: string }[];
|
|
15
17
|
url?: string;
|
|
18
|
+
fileId?: string;
|
|
16
19
|
scale?: number;
|
|
17
20
|
width?: number;
|
|
18
21
|
height?: number;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
export function mapDataToPropsConfig(data:
|
|
24
|
+
export function mapDataToPropsConfig(data: ARDataItem[]): ARConfig {
|
|
22
25
|
const photos = data.find((item) => item.type === "photos");
|
|
23
|
-
const
|
|
26
|
+
const overlay = data.find((item) => item.type === "videoNative" || item.type === "imageOverlay");
|
|
24
27
|
const ar = data.find((item) => item.type === "ar");
|
|
25
28
|
|
|
26
29
|
return {
|
|
27
30
|
cardId: photos?.id || "",
|
|
28
31
|
targetImageSrc: photos?.images?.[0]?.image || "",
|
|
29
32
|
targetTaarSrc: ar?.url || "",
|
|
30
|
-
videoSrc:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
videoSrc: overlay?.url || "",
|
|
34
|
+
overlaySrc: overlay?.url || "",
|
|
35
|
+
videoWidth: overlay?.width || 0,
|
|
36
|
+
videoHeight: overlay?.height || 0,
|
|
37
|
+
scale: overlay?.scale || 1,
|
|
38
|
+
overlayType: overlay?.type === "videoNative" ? "video" : "image",
|
|
34
39
|
};
|
|
35
40
|
}
|