@srsergio/taptapp-ar 1.0.69 → 1.0.71
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/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/react/types.d.ts +2 -1
- package/dist/react/types.js +6 -4
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/react/types.ts +9 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from "./react/types.js";
|
|
2
|
+
export * from "./react/TaptappAR.js";
|
|
3
|
+
export * from "./react/use-ar.js";
|
|
2
4
|
export * from "./compiler/offline-compiler.js";
|
|
3
5
|
export { Controller } from "./compiler/controller.js";
|
|
4
6
|
export { SimpleAR } from "./compiler/simple-ar.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from "./react/types.js";
|
|
2
|
+
export * from "./react/TaptappAR.js";
|
|
3
|
+
export * from "./react/use-ar.js";
|
|
2
4
|
export * from "./compiler/offline-compiler.js";
|
|
3
5
|
export { Controller } from "./compiler/controller.js";
|
|
4
6
|
export { SimpleAR } from "./compiler/simple-ar.js";
|
package/dist/react/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface ARConfig {
|
|
|
9
9
|
}
|
|
10
10
|
export interface ARDataItem {
|
|
11
11
|
id: string;
|
|
12
|
-
type: "photos" | "videoNative" | "ar";
|
|
12
|
+
type: "photos" | "videoNative" | "ar" | "imageOverlay";
|
|
13
13
|
images?: {
|
|
14
14
|
image: string;
|
|
15
15
|
fileId: string;
|
|
@@ -18,5 +18,6 @@ export interface ARDataItem {
|
|
|
18
18
|
scale?: number;
|
|
19
19
|
width?: number;
|
|
20
20
|
height?: number;
|
|
21
|
+
fileId?: string;
|
|
21
22
|
}
|
|
22
23
|
export declare function mapDataToPropsConfig(data: any[]): 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
3
|
const video = data.find((item) => item.type === "videoNative");
|
|
4
|
+
const imageOverlay = data.find((item) => item.type === "imageOverlay");
|
|
4
5
|
const ar = data.find((item) => item.type === "ar");
|
|
6
|
+
const overlay = video || imageOverlay;
|
|
5
7
|
return {
|
|
6
8
|
cardId: photos?.id || "",
|
|
7
9
|
targetImageSrc: photos?.images?.[0]?.image || "",
|
|
8
10
|
targetTaarSrc: ar?.url || "",
|
|
9
|
-
videoSrc:
|
|
10
|
-
videoWidth:
|
|
11
|
-
videoHeight:
|
|
12
|
-
scale:
|
|
11
|
+
videoSrc: overlay?.url || "",
|
|
12
|
+
videoWidth: overlay?.width || 0,
|
|
13
|
+
videoHeight: overlay?.height || 0,
|
|
14
|
+
scale: overlay?.scale || 1,
|
|
13
15
|
};
|
|
14
16
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from "./react/types.js";
|
|
2
|
+
export * from "./react/TaptappAR.js";
|
|
3
|
+
export * from "./react/use-ar.js";
|
|
2
4
|
export * from "./compiler/offline-compiler.js";
|
|
3
5
|
export { Controller } from "./compiler/controller.js";
|
|
4
6
|
export { SimpleAR } from "./compiler/simple-ar.js";
|
package/src/react/types.ts
CHANGED
|
@@ -10,26 +10,30 @@ export interface ARConfig {
|
|
|
10
10
|
|
|
11
11
|
export interface ARDataItem {
|
|
12
12
|
id: string;
|
|
13
|
-
type: "photos" | "videoNative" | "ar";
|
|
13
|
+
type: "photos" | "videoNative" | "ar" | "imageOverlay";
|
|
14
14
|
images?: { image: string; fileId: string }[];
|
|
15
15
|
url?: string;
|
|
16
16
|
scale?: number;
|
|
17
17
|
width?: number;
|
|
18
18
|
height?: number;
|
|
19
|
+
fileId?: string;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export function mapDataToPropsConfig(data: any[]): ARConfig {
|
|
22
23
|
const photos = data.find((item) => item.type === "photos");
|
|
23
24
|
const video = data.find((item) => item.type === "videoNative");
|
|
25
|
+
const imageOverlay = data.find((item) => item.type === "imageOverlay");
|
|
24
26
|
const ar = data.find((item) => item.type === "ar");
|
|
25
27
|
|
|
28
|
+
const overlay = video || imageOverlay;
|
|
29
|
+
|
|
26
30
|
return {
|
|
27
31
|
cardId: photos?.id || "",
|
|
28
32
|
targetImageSrc: photos?.images?.[0]?.image || "",
|
|
29
33
|
targetTaarSrc: ar?.url || "",
|
|
30
|
-
videoSrc:
|
|
31
|
-
videoWidth:
|
|
32
|
-
videoHeight:
|
|
33
|
-
scale:
|
|
34
|
+
videoSrc: overlay?.url || "",
|
|
35
|
+
videoWidth: overlay?.width || 0,
|
|
36
|
+
videoHeight: overlay?.height || 0,
|
|
37
|
+
scale: overlay?.scale || 1,
|
|
34
38
|
};
|
|
35
39
|
}
|