@r2u/javascript-ar-sdk 6.22.0 → 6.22.2
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/ar.bundle.js +1 -1
- package/dist/assets/icons.js +18 -0
- package/dist/assets/icons.js.map +1 -0
- package/dist/components/Modal/Canvas/index.js +11 -0
- package/dist/components/Modal/Canvas/index.js.map +1 -0
- package/dist/components/Modal/Canvas/styles.js +34 -0
- package/dist/components/Modal/Canvas/styles.js.map +1 -0
- package/dist/components/Modal/Context.js +27 -0
- package/dist/components/Modal/Context.js.map +1 -0
- package/dist/components/Modal/Feedback/Confirm.js +16 -0
- package/dist/components/Modal/Feedback/Confirm.js.map +1 -0
- package/dist/components/Modal/Feedback/Main.js +16 -0
- package/dist/components/Modal/Feedback/Main.js.map +1 -0
- package/dist/components/Modal/Feedback/index.js +31 -0
- package/dist/components/Modal/Feedback/index.js.map +1 -0
- package/dist/components/Modal/Feedback/styles.js +100 -0
- package/dist/components/Modal/Feedback/styles.js.map +1 -0
- package/dist/components/Modal/Instructions/index.js +50 -0
- package/dist/components/Modal/Instructions/index.js.map +1 -0
- package/dist/components/Modal/Instructions/styles.js +137 -0
- package/dist/components/Modal/Instructions/styles.js.map +1 -0
- package/dist/components/Modal/InstructionsAmericanas/index.js +50 -0
- package/dist/components/Modal/InstructionsAmericanas/index.js.map +1 -0
- package/dist/components/Modal/InstructionsAmericanas/styles.js +116 -0
- package/dist/components/Modal/InstructionsAmericanas/styles.js.map +1 -0
- package/dist/components/Modal/InstructionsMolduraMinuto/index.js +103 -0
- package/dist/components/Modal/InstructionsMolduraMinuto/index.js.map +1 -0
- package/dist/components/Modal/InstructionsMolduraMinuto/styles.js +77 -0
- package/dist/components/Modal/InstructionsMolduraMinuto/styles.js.map +1 -0
- package/dist/components/Modal/InstructionsYDigital/index.js +50 -0
- package/dist/components/Modal/InstructionsYDigital/index.js.map +1 -0
- package/dist/components/Modal/InstructionsYDigital/styles.js +137 -0
- package/dist/components/Modal/InstructionsYDigital/styles.js.map +1 -0
- package/dist/components/Modal/InstructionsYDigitalVideo/index.js +44 -0
- package/dist/components/Modal/InstructionsYDigitalVideo/index.js.map +1 -0
- package/dist/components/Modal/InstructionsYDigitalVideo/styles.js +137 -0
- package/dist/components/Modal/InstructionsYDigitalVideo/styles.js.map +1 -0
- package/dist/components/Modal/Social/index.js +20 -0
- package/dist/components/Modal/Social/index.js.map +1 -0
- package/dist/components/Modal/Social/styles.js +85 -0
- package/dist/components/Modal/Social/styles.js.map +1 -0
- package/dist/components/Modal/Viewer/index.js +26 -0
- package/dist/components/Modal/Viewer/index.js.map +1 -0
- package/dist/components/Modal/Viewer/styles.js +56 -0
- package/dist/components/Modal/Viewer/styles.js.map +1 -0
- package/dist/components/Modal/ViewerFull/index.js +15 -0
- package/dist/components/Modal/ViewerFull/index.js.map +1 -0
- package/dist/components/Modal/ViewerFull/styles.js +12 -0
- package/dist/components/Modal/ViewerFull/styles.js.map +1 -0
- package/dist/components/R2UModelViewer/ProgressBar/index.js +9 -0
- package/dist/components/R2UModelViewer/ProgressBar/index.js.map +1 -0
- package/dist/components/R2UModelViewer/ProgressBar/styles.js +54 -0
- package/dist/components/R2UModelViewer/ProgressBar/styles.js.map +1 -0
- package/dist/components/R2UModelViewer/ProgressBar/types.js +1 -0
- package/dist/components/R2UModelViewer/ProgressBar/types.js.map +1 -0
- package/dist/components/R2UModelViewer/index.js +63 -0
- package/dist/components/R2UModelViewer/index.js.map +1 -0
- package/dist/components/R2UModelViewer/styles.js +128 -0
- package/dist/components/R2UModelViewer/styles.js.map +1 -0
- package/dist/components/WaterMark/index.js +9 -0
- package/dist/components/WaterMark/index.js.map +1 -0
- package/dist/components/WaterMark/styles.js +26 -0
- package/dist/components/WaterMark/styles.js.map +1 -0
- package/dist/config/i18n.js +69 -0
- package/dist/config/i18n.js.map +1 -0
- package/dist/error/ViewerError.js +7 -0
- package/dist/error/ViewerError.js.map +1 -0
- package/dist/fonts/index.js +9 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/{src/index.d.ts → index.d.ts} +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -0
- package/dist/init.bundle.js +1 -1
- package/dist/locales/en/translation.json +36 -0
- package/dist/methods/analytics.js +17 -0
- package/dist/methods/analytics.js.map +1 -0
- package/dist/methods/ar.js +372 -0
- package/dist/methods/ar.js.map +1 -0
- package/dist/methods/config.js +40 -0
- package/dist/methods/config.js.map +1 -0
- package/dist/methods/init.js +51 -0
- package/dist/methods/init.js.map +1 -0
- package/dist/methods/qrCode.js +48 -0
- package/dist/methods/qrCode.js.map +1 -0
- package/dist/{src/methods → methods}/sku.d.ts +1 -1
- package/dist/methods/sku.js +47 -0
- package/dist/methods/sku.js.map +1 -0
- package/dist/methods/types.js +1 -0
- package/dist/methods/types.js.map +1 -0
- package/dist/methods/viewer.js +310 -0
- package/dist/methods/viewer.js.map +1 -0
- package/dist/screens/Fallback/index.js +22 -0
- package/dist/screens/Fallback/index.js.map +1 -0
- package/dist/{src/screens → screens}/Feedback/index.d.ts +1 -1
- package/dist/screens/Feedback/index.js +21 -0
- package/dist/screens/Feedback/index.js.map +1 -0
- package/dist/{src/screens → screens}/Instructions/index.d.ts +1 -1
- package/dist/screens/Instructions/index.js +48 -0
- package/dist/screens/Instructions/index.js.map +1 -0
- package/dist/screens/Social/index.js +9 -0
- package/dist/screens/Social/index.js.map +1 -0
- package/dist/services/analytics.js +219 -0
- package/dist/services/analytics.js.map +1 -0
- package/dist/services/constants.js +65 -0
- package/dist/services/constants.js.map +1 -0
- package/dist/services/cookies.js +19 -0
- package/dist/services/cookies.js.map +1 -0
- package/dist/services/customer.js +17 -0
- package/dist/services/customer.js.map +1 -0
- package/dist/services/customization.js +73 -0
- package/dist/services/customization.js.map +1 -0
- package/dist/services/product.js +49 -0
- package/dist/services/product.js.map +1 -0
- package/dist/services/requests.js +55 -0
- package/dist/services/requests.js.map +1 -0
- package/dist/sku.bundle.js +1 -1
- package/dist/{src/state.d.ts → state.d.ts} +1 -1
- package/dist/state.js +23 -0
- package/dist/state.js.map +1 -0
- package/dist/types/Viewer.js +1 -0
- package/dist/types/Viewer.js.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/sortCustomization.js +10 -0
- package/dist/utils/sortCustomization.js.map +1 -0
- package/dist/{vendors.fe050b32669a2a3c34a3.bundle.js → vendors.7d567adcf040d43f7345.bundle.js} +1 -1
- package/package.json +5 -3
- /package/dist/{src/assets → assets}/icons.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Canvas/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Canvas/styles.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Context.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Feedback/Confirm.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Feedback/Main.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Feedback/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Feedback/styles.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Instructions/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Instructions/styles.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/InstructionsAmericanas/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/InstructionsAmericanas/styles.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/InstructionsMolduraMinuto/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/InstructionsMolduraMinuto/styles.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/InstructionsYDigital/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/InstructionsYDigital/styles.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/InstructionsYDigitalVideo/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/InstructionsYDigitalVideo/styles.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Social/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Social/styles.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Viewer/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/Viewer/styles.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/ViewerFull/index.d.ts +0 -0
- /package/dist/{src/components → components}/Modal/ViewerFull/styles.d.ts +0 -0
- /package/dist/{src/components → components}/R2UModelViewer/ProgressBar/index.d.ts +0 -0
- /package/dist/{src/components → components}/R2UModelViewer/ProgressBar/styles.d.ts +0 -0
- /package/dist/{src/components → components}/R2UModelViewer/ProgressBar/types.d.ts +0 -0
- /package/dist/{src/components → components}/R2UModelViewer/index.d.ts +0 -0
- /package/dist/{src/components → components}/R2UModelViewer/styles.d.ts +0 -0
- /package/dist/{src/components → components}/WaterMark/index.d.ts +0 -0
- /package/dist/{src/components → components}/WaterMark/styles.d.ts +0 -0
- /package/dist/{src/config → config}/i18n.d.ts +0 -0
- /package/dist/{src/error → error}/ViewerError.d.ts +0 -0
- /package/dist/{src/fonts → fonts}/index.d.ts +0 -0
- /package/dist/{src/methods → methods}/analytics.d.ts +0 -0
- /package/dist/{src/methods → methods}/ar.d.ts +0 -0
- /package/dist/{src/methods → methods}/config.d.ts +0 -0
- /package/dist/{src/methods → methods}/init.d.ts +0 -0
- /package/dist/{src/methods → methods}/qrCode.d.ts +0 -0
- /package/dist/{src/methods → methods}/types.d.ts +0 -0
- /package/dist/{src/methods → methods}/viewer.d.ts +0 -0
- /package/dist/{src/screens → screens}/Fallback/index.d.ts +0 -0
- /package/dist/{src/screens → screens}/Social/index.d.ts +0 -0
- /package/dist/{src/services → services}/analytics.d.ts +0 -0
- /package/dist/{src/services → services}/constants.d.ts +0 -0
- /package/dist/{src/services → services}/cookies.d.ts +0 -0
- /package/dist/{src/services → services}/customer.d.ts +0 -0
- /package/dist/{src/services → services}/customization.d.ts +0 -0
- /package/dist/{src/services → services}/product.d.ts +0 -0
- /package/dist/{src/services → services}/requests.d.ts +0 -0
- /package/dist/{src/types → types}/Viewer.d.ts +0 -0
- /package/dist/{src/types → types}/index.d.ts +0 -0
- /package/dist/{src/utils → utils}/sortCustomization.d.ts +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon } from './styles';
|
|
3
|
+
const WaterMark = ({ position }) => {
|
|
4
|
+
return (React.createElement(Icon, { position: position },
|
|
5
|
+
React.createElement("a", { href: "https://r2u.io", target: "_blank", rel: "noopener noreferrer" },
|
|
6
|
+
React.createElement("img", { alt: "" }))));
|
|
7
|
+
};
|
|
8
|
+
export default WaterMark;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/WaterMark/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAM/B,MAAM,SAAS,GAAoB,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IACzD,OAAO,CACL,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ;QACtB,2BAAG,IAAI,EAAC,gBAAgB,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB;YAChE,6BAAK,GAAG,EAAC,EAAE,GAAG,CACZ,CACC,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
export const Icon = styled.div `
|
|
4
|
+
a {
|
|
5
|
+
content: url('https://sdk.r2u.io/assets/r2u-icon-gray.svg');
|
|
6
|
+
height: 22px;
|
|
7
|
+
position: absolute;
|
|
8
|
+
z-index: 999999;
|
|
9
|
+
margin: 10px;
|
|
10
|
+
${(props) => {
|
|
11
|
+
const position = props.position ? props.position.toLowerCase() : '';
|
|
12
|
+
return css `
|
|
13
|
+
${position.includes('left') && 'left: 0;'}
|
|
14
|
+
${position.includes('right') && 'right: 0;'}
|
|
15
|
+
${position.includes('bottom') && 'bottom: 0;'}
|
|
16
|
+
${position.includes('top') && 'top: 0;'}
|
|
17
|
+
${position.includes('center') && 'left: 0; right: 0; margin: auto;'}
|
|
18
|
+
${position.includes('absolute') && 'position: absolute;'}
|
|
19
|
+
`;
|
|
20
|
+
}};
|
|
21
|
+
}
|
|
22
|
+
a:hover {
|
|
23
|
+
content: url('https://sdk.r2u.io/assets/r2u-icon.svg');
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/WaterMark/styles.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAM/C,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAgB;;;;;;;MAOxC,CAAC,KAAK,EAAE,EAAE;IACV,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACnE,OAAO,GAAG,CAAA;UACN,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,UAAU;UACvC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,WAAW;UACzC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,YAAY;UAC3C,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS;UACrC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,kCAAkC;UACjE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,qBAAqB;OACzD,CAAA;AACH,CAAC;;;;;CAKJ,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import i18next from 'i18next';
|
|
11
|
+
import ChainedBackend from 'i18next-chained-backend';
|
|
12
|
+
import HttpBackend from 'i18next-http-backend';
|
|
13
|
+
import LocalStorageBackend from 'i18next-localstorage-backend';
|
|
14
|
+
import { getRoute } from '../services/requests';
|
|
15
|
+
import state from '../state';
|
|
16
|
+
export const i18nInstance = i18next.createInstance();
|
|
17
|
+
export const init = ({ language }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
const customerLng = state.customer.language;
|
|
19
|
+
const customerNS = state.customer.slug;
|
|
20
|
+
const lng = language || customerLng || 'en';
|
|
21
|
+
const route = getRoute();
|
|
22
|
+
// const nsFileExists = await fileExists(
|
|
23
|
+
// `${route}/locales/${lng}/${customerNS}.json`
|
|
24
|
+
// )
|
|
25
|
+
const nsFileExists = false;
|
|
26
|
+
const defaultNS = nsFileExists ? customerNS : 'translation';
|
|
27
|
+
const ns = ['translation', ...(nsFileExists ? [customerNS] : [])];
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
i18nInstance.use(ChainedBackend).init({
|
|
30
|
+
debug: process.env.NODE_ENV === 'development',
|
|
31
|
+
react: {
|
|
32
|
+
useSuspense: false,
|
|
33
|
+
},
|
|
34
|
+
lng,
|
|
35
|
+
fallbackLng: false,
|
|
36
|
+
supportedLngs: ['pt', 'en', 'es'],
|
|
37
|
+
ns,
|
|
38
|
+
defaultNS,
|
|
39
|
+
fallbackNS: 'translation',
|
|
40
|
+
load: 'currentOnly',
|
|
41
|
+
preload: [lng],
|
|
42
|
+
interpolation: {
|
|
43
|
+
escapeValue: false,
|
|
44
|
+
},
|
|
45
|
+
backend: {
|
|
46
|
+
backends: [LocalStorageBackend, HttpBackend],
|
|
47
|
+
backendOptions: [
|
|
48
|
+
{
|
|
49
|
+
prefix: 'i18next_res_r2u_sdk_',
|
|
50
|
+
enabled: process.env.NODE_ENV !== 'development',
|
|
51
|
+
expirationTime: 7 * 24 * 60 * 60 * 1000,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
loadPath: `${route}/locales/{{lng}}/{{ns}}.json`,
|
|
55
|
+
allowMultiloading: true,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
}, (err) => {
|
|
60
|
+
if (err)
|
|
61
|
+
reject(new Error('R2U - Translation init failed'));
|
|
62
|
+
resolve();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
export default {
|
|
67
|
+
init,
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/config/i18n.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,cAAc,MAAM,yBAAyB,CAAA;AACpD,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAC9C,OAAO,mBAAmB,MAAM,8BAA8B,CAAA;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,MAAM,UAAU,CAAA;AAc5B,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,EAAE,CAAA;AAEpD,MA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,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;wBAC/C,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;qBACxC;oBACD;wBACE,QAAQ,EAAE,GAAG,KAAK,8BAA8B;wBAChD,iBAAiB,EAAE,IAAI;qBACxB;iBACF;aACF;SACF,EACD,CAAC,GAAG,EAAE,EAAE;YACN,IAAI,GAAG;gBAAE,MAAM,CAAC,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAA;YAC3D,OAAO,EAAE,CAAA;QACX,CAAC,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA,CAAA;AAED,eAAe;IACb,IAAI;CACL,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewerError.js","sourceRoot":"","sources":["../../src/error/ViewerError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fonts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,MAAM,MAAM,cAAc,CAAA;AAEjC,eAAe,iBAAiB,CAAA;;;eAGjB,MAAM;;CAEpB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CallToAction } from '@r2u/react-ar-components';
|
|
2
2
|
import { SKUHandler, ViewerProps } from './methods/types';
|
|
3
|
-
import { Product } from '
|
|
3
|
+
import { Product } from './services/product';
|
|
4
4
|
import { ViewerFunctions } from './methods/viewer';
|
|
5
5
|
export default interface R2U {
|
|
6
6
|
init: (params: {
|
package/dist/index.js
CHANGED
|
@@ -1 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
const init = (params) => import(/* webpackChunkName: "init" */ './methods/init').then((Init) => Init.default(params));
|
|
2
|
+
const config = {
|
|
3
|
+
changeLanguage: (language) => import(/* webpackChunkName: "./config" */ './methods/config').then((Config) => Config.default.changeLanguage(language)),
|
|
4
|
+
};
|
|
5
|
+
const ar = {
|
|
6
|
+
open: (params) => import(/* webpackChunkName: "ar" */ './methods/ar').then((Ar) => Ar.default.open(params)),
|
|
7
|
+
attach: (params) => import(/* webpackChunkName: "ar" */ './methods/ar').then((Ar) => Ar.default.attach(params)),
|
|
8
|
+
getLink: (sku) => import(/* webpackChunkName: "ar" */ './methods/ar').then((Ar) => Ar.default.getLink(sku)),
|
|
9
|
+
};
|
|
10
|
+
const sku = {
|
|
11
|
+
isActive: (sku) => import(/* webpackChunkName: "sku" */ './methods/sku').then((Sku) => Sku.default.isActive(sku)),
|
|
12
|
+
getData: (sku) => import(/* webpackChunkName: "sku" */ './methods/sku').then((Sku) => Sku.default.getData(sku)),
|
|
13
|
+
};
|
|
14
|
+
const viewer = {
|
|
15
|
+
create: (params) => import(/* webpackChunkName: "viewer" */ './methods/viewer').then((Viewer) => Viewer.default.create(params)),
|
|
16
|
+
};
|
|
17
|
+
const analytics = {
|
|
18
|
+
send: (params) => import(/* webpackChunkName: "analytics" */ './methods/analytics').then((Analytics) => Analytics.default.send(params)),
|
|
19
|
+
};
|
|
20
|
+
const qrCode = {
|
|
21
|
+
create: (params) => import(/* webpackChunkName: "qrCode" */ './methods/qrCode').then((QrCode) => QrCode.default.create(params)),
|
|
22
|
+
};
|
|
23
|
+
export { init, sku, ar, viewer, analytics, qrCode, config };
|
|
24
|
+
document.dispatchEvent(new CustomEvent('r2u-sdk-loaded'));
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6EA,MAAM,IAAI,GAAG,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=t(660),o=t(2297),c=t(2367),l=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};const u=i.Z.createInstance();n.ZP={init:({language:e})=>l(void 0,void 0,void 0,(function*(){const n=c.Z.customer.language,t=(c.Z.customer.slug,e||n||"en"),i=(0,o.Bv)(),l=["translation"];return new Promise(((e,n)=>{u.use(a.Z).init({debug:!1,react:{useSuspense:!1},lng:t,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:l,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[t],interpolation:{escapeValue:!1},backend:{backends:[s.Z,r.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${i}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(t=>{t&&n(new Error("R2U - Translation init failed")),e()}))}))}))}},6526:function(e,n,t){t.r(n),t.d(n,{default:function(){return l}});var i=t(2367),a=t(7374),r=t(2297),s=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};var o=t(6504),c=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};function l({customerId:e,language:n,analyticsParams:t={dataLayerIntegration:!0,sessionDuration:30},refreshCache:l=!1}){return c(this,void 0,void 0,(function*(){if(!/^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)/i.test(e)&&!/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(e))throw new Error(`Invalid customer '${e}'`);i.Z.init=!0,i.Z.refreshCache=l;const c=yield function(e){return s(this,void 0,void 0,(function*(){return yield(0,r.U2)(`/customers/${e}`)}))}(e),u=yield(0,a.ZP)({client:e,dataLayerIntegration:t.dataLayerIntegration,sessionDurationMinutes:t.sessionDuration});i.Z.analytics=u,i.Z.customer=c,yield Promise.all([o.ZP.init({language:n})])}))}},7374:function(e,n,t){t.d(n,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return f},KN:function(){return b},fQ:function(){return g},hN:function(){return v},lY:function(){return y},G0:function(){return w},fm:function(){return m}});var i=t(2085),a=t(5877),r=t(2367),s=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>r.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>r.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>r.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>r.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>r.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>r.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>r.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{r.Z.analytics.webxrSet(i.D1.session_id,(0,a.v4)())},setCompatible:e=>{r.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([r.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),r.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{r.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{r.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{r.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{r.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{r.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{r.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{r.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},f={onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},v=e=>{r.Z.analytics.set(i.MB.sku,e)},y=e=>{r.Z.analytics.set(i.MB.manufacturer_id,e)},w=e=>{r.Z.analytics.set(i.MB.is_active_3d,`${e}`),r.Z.analytics.send({event:i.U3.product_page_view})},b=e=>{r.Z.analytics.set(i.MB.experiment_id,e)},g=e=>{r.Z.analytics.set(i.MB.variation_id,e)},m=()=>s(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return r.Z.analytics.set(i.MB.fingerprint,e),e}));n.ZP=({client:e,dataLayerIntegration:n,sessionDurationMinutes:t,info:a={}})=>s(void 0,void 0,void 0,(function*(){const r={version:"6.22.0",gcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportEvent",webxrGcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportWebXREvent",debug:!!new URLSearchParams(window.location.search).get("realidade-aumentada-debug"),sessionDurationMinutes:t,dataLayerIntegration:n},s=new i.ZP(r,Object.assign(Object.assign({},a),{[i.MB.client]:e}));return yield s.init(),s}))},2297:function(e,n,t){t.d(n,{U2:function(){return s},v_:function(){return o},Bv:function(){return c}});var i=t(2367),a=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};const r="https://api.r2u.io";function s(e){return a(this,void 0,void 0,(function*(){const n={};i.Z.refreshCache&&(n["Cache-Control"]="max-age=0");return(yield fetch(`${r}${e}`,{method:"get",headers:n})).json()}))}function o(e,n){return a(this,void 0,void 0,(function*(){return(yield fetch(`${r}${e}`,{method:"POST",body:JSON.stringify(n)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,n){const t={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,n)=>{},send:({event:e,data:n,scope:t})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};n.Z=t},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.22.0","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=development","build":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=production","clean":"rm -rf dist/ public/dist/","test":"jest --config ./jest.config.js","stage":"yarn build:dev && gsutil -m cp -R ./public gs://r2u-integrations-bucket/_staging/sdk/","prettier":"prettier --write src","lint":"eslint \\"./src/**/*.{js,ts,tsx}\\"","eject":"rescripts eject"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"dependencies":{"@r2u/analytics":"^4.3.3","@r2u/react-ar-components":"^5.4.16","@r2u/viewer":"^1.12.3","@types/react-slick":"^0.23.10","i18next":"^20.2.1","i18next-chained-backend":"^2.1.0","i18next-http-backend":"^1.2.1","i18next-localstorage-backend":"^3.1.2","qrcode.react":"^1.0.1","querystring":"^0.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-i18next":"^11.8.13","react-shadow":"^19.0.2","react-slick":"^0.29.0","styled-components":"^5.2.3"},"devDependencies":{"@fingerprintjs/fingerprintjs":"^3.3.0","@growthbook/growthbook":"^0.12.0","@types/jest":"^26.0.15","@types/node":"^13.11.1","@types/qrcode.react":"^1.0.1","@types/react":"^16.9.33","@types/react-dom":"^16.9.6","@types/styled-components":"^5.1.9","@typescript-eslint/eslint-plugin":"^2.3.1","@typescript-eslint/parser":"^2.3.1","eslint":"^7.22.0","eslint-config-prettier":"^6.12.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^8.0.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.1.1","eslint-plugin-react":"^7.14.3","eslint-plugin-standard":"^4.0.0","file-loader":"^6.2.0","jest":"^24.9.0","prettier":"^2.1.2","process":"^0.11.10","three":"^0.131.2","ts-jest":"^26.4.4","ts-loader":"^8.0.17","tsconfig-paths-webpack-plugin":"^3.5.1","typescript":"^3.8.3","util":"^0.12.3","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0","webpack-dev-server":"3.10.3"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')}}]);
|
|
1
|
+
"use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[410],{6504:function(e,n,t){t.d(n,{f2:function(){return u}});var i=t(8665),a=t(1580),s=t(5538),r=t(660),o=t(2297),c=t(2367),l=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const u=i.Z.createInstance();n.ZP={init:({language:e})=>l(void 0,void 0,void 0,(function*(){const n=c.Z.customer.language,t=(c.Z.customer.slug,e||n||"en"),i=(0,o.Bv)(),l=["translation"];return new Promise(((e,n)=>{u.use(a.Z).init({debug:!1,react:{useSuspense:!1},lng:t,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:l,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[t],interpolation:{escapeValue:!1},backend:{backends:[r.Z,s.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${i}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(t=>{t&&n(new Error("R2U - Translation init failed")),e()}))}))}))}},6526:function(e,n,t){t.r(n),t.d(n,{default:function(){return l}});var i=t(2367),a=t(7374),s=t(2297),r=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};var o=t(6504),c=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};function l({customerId:e,language:n,analyticsParams:t={dataLayerIntegration:!0,sessionDuration:30},refreshCache:l=!1}){return c(this,void 0,void 0,(function*(){if(!/^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)/i.test(e)&&!/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(e))throw new Error(`Invalid customer '${e}'`);i.Z.init=!0,i.Z.refreshCache=l;const c=yield function(e){return r(this,void 0,void 0,(function*(){return yield(0,s.U2)(`/customers/${e}`)}))}(e),u=yield(0,a.ZP)({client:e,dataLayerIntegration:t.dataLayerIntegration,sessionDurationMinutes:t.sessionDuration});i.Z.analytics=u,i.Z.customer=c,yield Promise.all([o.ZP.init({language:n})])}))}},7374:function(e,n,t){t.d(n,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return f},KN:function(){return w},fQ:function(){return g},hN:function(){return y},lY:function(){return v},G0:function(){return b},fm:function(){return m}});var i=t(2085),a=t(5877),s=t(2367),r=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>s.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>s.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>s.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>s.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>s.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>s.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>s.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{s.Z.analytics.webxrSet(i.D1.session_id,(0,a.v4)())},setCompatible:e=>{s.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([s.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),s.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{s.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{s.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{s.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{s.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{s.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{s.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{s.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},f={onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},y=e=>{s.Z.analytics.set(i.MB.sku,e)},v=e=>{s.Z.analytics.set(i.MB.manufacturer_id,e)},b=e=>{s.Z.analytics.set(i.MB.is_active_3d,`${e}`),s.Z.analytics.send({event:i.U3.product_page_view})},w=e=>{s.Z.analytics.set(i.MB.experiment_id,e)},g=e=>{s.Z.analytics.set(i.MB.variation_id,e)},m=()=>r(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return s.Z.analytics.set(i.MB.fingerprint,e),e}));n.ZP=({client:e,dataLayerIntegration:n,sessionDurationMinutes:t,info:a={}})=>r(void 0,void 0,void 0,(function*(){const s={version:"6.22.2",gcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportEvent",webxrGcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportWebXREvent",debug:!!new URLSearchParams(window.location.search).get("realidade-aumentada-debug"),sessionDurationMinutes:t,dataLayerIntegration:n},r=new i.ZP(s,Object.assign(Object.assign({},a),{[i.MB.client]:e}));return yield r.init(),r}))},2297:function(e,n,t){t.d(n,{U2:function(){return r},v_:function(){return o},Bv:function(){return c}});var i=t(2367),a=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const s="https://api.r2u.io";function r(e){return a(this,void 0,void 0,(function*(){const n={};i.Z.refreshCache&&(n["Cache-Control"]="max-age=0");return(yield fetch(`${s}${e}`,{method:"get",headers:n})).json()}))}function o(e,n){return a(this,void 0,void 0,(function*(){return(yield fetch(`${s}${e}`,{method:"POST",body:JSON.stringify(n)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,n){const t={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,n)=>{},send:({event:e,data:n,scope:t})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};n.Z=t},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.22.2","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=development && yarn build:types","build":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=production && yarn build:types","build:types":"tsc && npx tsc-alias","clean":"rm -rf dist/ public/dist/","test":"jest --config ./jest.config.js","stage":"yarn build:dev && gsutil -m cp -R ./public gs://r2u-integrations-bucket/_staging/sdk/","prettier":"prettier --write src","lint":"eslint \\"./src/**/*.{js,ts,tsx}\\"","eject":"rescripts eject"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"dependencies":{"@r2u/analytics":"^4.3.3","@r2u/react-ar-components":"^5.4.16","@r2u/viewer":"^1.12.3","@types/react-slick":"^0.23.10","i18next":"^20.2.1","i18next-chained-backend":"^2.1.0","i18next-http-backend":"^1.2.1","i18next-localstorage-backend":"^3.1.2","qrcode.react":"^1.0.1","querystring":"^0.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-i18next":"^11.8.13","react-shadow":"^19.0.2","react-slick":"^0.29.0","styled-components":"^5.2.3"},"devDependencies":{"@fingerprintjs/fingerprintjs":"^3.3.0","@growthbook/growthbook":"^0.12.0","@types/jest":"^26.0.15","@types/node":"^13.11.1","@types/qrcode.react":"^1.0.1","@types/react":"^16.9.33","@types/react-dom":"^16.9.6","@types/styled-components":"^5.1.9","@typescript-eslint/eslint-plugin":"^2.3.1","@typescript-eslint/parser":"^2.3.1","eslint":"^7.22.0","eslint-config-prettier":"^6.12.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^8.0.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.1.1","eslint-plugin-react":"^7.14.3","eslint-plugin-standard":"^4.0.0","file-loader":"^6.2.0","jest":"^24.9.0","prettier":"^2.1.2","process":"^0.11.10","three":"^0.131.2","ts-jest":"^26.4.4","ts-loader":"^8.0.17","tsc-alias":"^1.8.11","tsconfig-paths-webpack-plugin":"^3.5.1","typescript":"^3.8.3","util":"^0.12.3","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0","webpack-dev-server":"3.10.3"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')}}]);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"instructions": {
|
|
3
|
+
"handMove": "Hold and drag the product to move",
|
|
4
|
+
"handRotate": "Hold the product with two fingers to rotate",
|
|
5
|
+
"text": "Place the product in your surroundings to check all dimensions",
|
|
6
|
+
"button": "Check this product in your space!",
|
|
7
|
+
"loading": "Loading ..."
|
|
8
|
+
},
|
|
9
|
+
"fallback": {
|
|
10
|
+
"viewer": {
|
|
11
|
+
"title": "Augmented Reality will soon be available",
|
|
12
|
+
"topText": "Sorry... we are still building an Augmented Reality experience compatible with your device. Soon, you will be able to use this functionality to test our products.",
|
|
13
|
+
"bottomText": "Meanwhile, you can check every detail of this product in our 3D model above."
|
|
14
|
+
},
|
|
15
|
+
"social": {
|
|
16
|
+
"title": "To open this experience, please open this page on your browser",
|
|
17
|
+
"text": "Click on the menu button located at the top right corner of the screen and select the option to open in the browser.",
|
|
18
|
+
"button": "OK"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"feedback": {
|
|
22
|
+
"main": {
|
|
23
|
+
"title": "Were you able to visualize and interact with this product?",
|
|
24
|
+
"button": "Close"
|
|
25
|
+
},
|
|
26
|
+
"confirm": {
|
|
27
|
+
"title": "Thank you for your feedback!",
|
|
28
|
+
"text": "We are always improving so you can have the best experience",
|
|
29
|
+
"button": "Finish"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"callToAction": {
|
|
33
|
+
"visit": "Visit"
|
|
34
|
+
},
|
|
35
|
+
"poweredBy": "powered by"
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import state from '../state';
|
|
11
|
+
function send({ event, data, scope }) {
|
|
12
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
state.analytics.send({ event, data, scope });
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export default { send };
|
|
17
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/methods/analytics.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,UAAU,CAAA;AAG5B,SAAe,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAmB;;QACzD,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IAC9C,CAAC;CAAA;AAED,eAAe,EAAE,IAAI,EAAE,CAAA"}
|