zakeke-configurator-react 0.0.203 → 0.0.204
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/declarations/composer/Module/src/components/tryon/tryOnModels.d.ts +1 -1
- package/dist/declarations/composer/Module/src/components/tryon/tryOnViewer.d.ts +1 -1
- package/dist/declarations/composer/Module/src/environment.d.ts +5 -2
- package/dist/declarations/composer/Module/src/state/boot.d.ts +5 -3
- package/dist/declarations/composer/Module/src/state/providerValue.d.ts +2 -0
- package/dist/index.js +92 -85
- package/package.json +1 -1
|
@@ -53,7 +53,7 @@ export interface TryOnProviderProps {
|
|
|
53
53
|
onReady?: () => void;
|
|
54
54
|
onLoaded?: () => void;
|
|
55
55
|
onClose?: () => void;
|
|
56
|
-
onPDUpdated
|
|
56
|
+
onPDUpdated?: (pd: number) => void;
|
|
57
57
|
onWebcamError: () => void;
|
|
58
58
|
}
|
|
59
59
|
export interface PupillaryDistanceProviderProps {
|
|
@@ -23,7 +23,7 @@ export interface TryOnViewProps {
|
|
|
23
23
|
onReady?: () => void;
|
|
24
24
|
onLoaded?: () => void;
|
|
25
25
|
onClose: () => void;
|
|
26
|
-
onPDUpdated
|
|
26
|
+
onPDUpdated?: (pd: number) => void;
|
|
27
27
|
onWebcamError: () => void;
|
|
28
28
|
}
|
|
29
29
|
export declare const TryOnView: FunctionComponent<TryOnViewProps>;
|
|
@@ -71,6 +71,7 @@ export declare class ZakekeEnvironment {
|
|
|
71
71
|
currentAttributesSelection: Object | null;
|
|
72
72
|
currentCompositionInfo: CurrentCompositionInfo | null;
|
|
73
73
|
private copyrightMessageLocalStorageKey;
|
|
74
|
+
private isPupillaryDistanceMandatory;
|
|
74
75
|
sellerSettings: SellerSettings | null;
|
|
75
76
|
get internalProduct(): MPlaza.Model | null;
|
|
76
77
|
get internalScene(): Zakeke.Scene | null;
|
|
@@ -107,7 +108,7 @@ export declare class ZakekeEnvironment {
|
|
|
107
108
|
visibleEventMessages: VisibleEventMessage[];
|
|
108
109
|
tryOnProductSettings: TryOnProduct | null;
|
|
109
110
|
tryOnSellerSettings: TryOnSeller | null;
|
|
110
|
-
|
|
111
|
+
pdSettings: number;
|
|
111
112
|
isInfoPointContentVisible: boolean;
|
|
112
113
|
private internalTranslations;
|
|
113
114
|
private integrationVersion;
|
|
@@ -317,9 +318,11 @@ export declare class ZakekeEnvironment {
|
|
|
317
318
|
get canUseTryOn(): boolean;
|
|
318
319
|
get canUsePD(): boolean;
|
|
319
320
|
get isVisibleMeshShownForTryOn(): boolean;
|
|
321
|
+
get isMandatoryPD(): boolean;
|
|
320
322
|
get isTryOnMeshVisible(): boolean;
|
|
321
323
|
get tryOnMeshVisibleSettings(): TryOnGenericFineTuningSettings | undefined;
|
|
322
|
-
setPDDistance: (distance: number) =>
|
|
324
|
+
setPDDistance: (distance: number) => void;
|
|
325
|
+
pdDistance: () => number;
|
|
323
326
|
exportTryOnMesh: () => Promise<Blob | null>;
|
|
324
327
|
getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
|
|
325
328
|
tryOnCountView: (sellerID: number, providerID: number, modeChosen: TryOnMode) => Promise<void>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import { BootParameters } from '..';
|
|
3
|
-
|
|
3
|
+
export interface BootProps {
|
|
4
4
|
parameters?: BootParameters | null;
|
|
5
|
-
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const Boot: FC<BootProps>;
|
|
6
8
|
export default Boot;
|
|
@@ -195,7 +195,9 @@ export interface Zakeke {
|
|
|
195
195
|
canUsePD: boolean;
|
|
196
196
|
getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
|
|
197
197
|
isTryOnMeshVisible: boolean;
|
|
198
|
+
isMandatoryPD: boolean;
|
|
198
199
|
isVisibleMeshShownForTryOn: boolean;
|
|
199
200
|
setPDDistance: (distance: number) => void;
|
|
201
|
+
pdDistance: () => number;
|
|
200
202
|
}
|
|
201
203
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -61291,6 +61291,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
61291
61291
|
/* harmony import */ var _tryOnModels__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../tryOnModels */ "./src/components/tryon/tryOnModels.ts");
|
|
61292
61292
|
/* harmony import */ var _hooks_tryonContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../hooks/tryonContext */ "./src/hooks/tryonContext.ts");
|
|
61293
61293
|
/* harmony import */ var _tryOnFrame__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../tryOnFrame */ "./src/components/tryon/tryOnFrame.tsx");
|
|
61294
|
+
/* harmony import */ var _state_provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../state/provider */ "./src/state/provider.tsx");
|
|
61294
61295
|
var _templateObject,
|
|
61295
61296
|
_this = undefined;
|
|
61296
61297
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
@@ -61312,6 +61313,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
61312
61313
|
|
|
61313
61314
|
|
|
61314
61315
|
|
|
61316
|
+
|
|
61315
61317
|
// #region interfaces
|
|
61316
61318
|
var MazingTryOnBaseReceivedMessage = {
|
|
61317
61319
|
WaitingAuthentication: 'WAITING_AUTH',
|
|
@@ -61475,6 +61477,10 @@ var MazingPupillaryDistance = function MazingPupillaryDistance(props) {
|
|
|
61475
61477
|
var _useZakekeTryOn2 = (0,_hooks_tryonContext__WEBPACK_IMPORTED_MODULE_3__.useZakekeTryOn)(),
|
|
61476
61478
|
tryon = _useZakekeTryOn2.tryon,
|
|
61477
61479
|
setTryon = _useZakekeTryOn2.setTryon;
|
|
61480
|
+
var internalState = (0,_state_provider__WEBPACK_IMPORTED_MODULE_5__.useInternalState)();
|
|
61481
|
+
var stateRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(internalState);
|
|
61482
|
+
stateRef.current = internalState;
|
|
61483
|
+
var store = stateRef.current.state.environment;
|
|
61478
61484
|
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
|
61479
61485
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
61480
61486
|
frameWindow = _useState10[0],
|
|
@@ -61522,6 +61528,7 @@ var MazingPupillaryDistance = function MazingPupillaryDistance(props) {
|
|
|
61522
61528
|
(_props$onLoaded3 = props.onLoaded) === null || _props$onLoaded3 === void 0 ? void 0 : _props$onLoaded3.call(props);
|
|
61523
61529
|
break;
|
|
61524
61530
|
case MazingPupillaryDistanceStateReceivedMessage.PDUpdated:
|
|
61531
|
+
store.setPDDistance(pdState.value.pd);
|
|
61525
61532
|
(_props$onPDUpdated2 = props.onPDUpdated) === null || _props$onPDUpdated2 === void 0 ? void 0 : _props$onPDUpdated2.call(props, pdState.value.pd);
|
|
61526
61533
|
break;
|
|
61527
61534
|
case MazingPupillaryDistanceStateReceivedMessage.PDDataNotFoundError:
|
|
@@ -61911,6 +61918,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
61911
61918
|
_defineProperty(this, "currentAttributesSelection", null);
|
|
61912
61919
|
_defineProperty(this, "currentCompositionInfo", null);
|
|
61913
61920
|
_defineProperty(this, "copyrightMessageLocalStorageKey", '');
|
|
61921
|
+
_defineProperty(this, "isPupillaryDistanceMandatory", false);
|
|
61914
61922
|
_defineProperty(this, "sellerSettings", null);
|
|
61915
61923
|
_defineProperty(this, "themeCompositions", null);
|
|
61916
61924
|
_defineProperty(this, "currency", 'EUR');
|
|
@@ -61941,7 +61949,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
61941
61949
|
_defineProperty(this, "visibleEventMessages", []);
|
|
61942
61950
|
_defineProperty(this, "tryOnProductSettings", null);
|
|
61943
61951
|
_defineProperty(this, "tryOnSellerSettings", null);
|
|
61944
|
-
_defineProperty(this, "pdSettings",
|
|
61952
|
+
_defineProperty(this, "pdSettings", -1);
|
|
61945
61953
|
_defineProperty(this, "isInfoPointContentVisible", false);
|
|
61946
61954
|
_defineProperty(this, "internalTranslations", {
|
|
61947
61955
|
statics: [],
|
|
@@ -62484,7 +62492,8 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
62484
62492
|
*/
|
|
62485
62493
|
_defineProperty(this, "boot", /*#__PURE__*/function () {
|
|
62486
62494
|
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(parameters) {
|
|
62487
|
-
var
|
|
62495
|
+
var _this$zkScene2, _this$zkScene2$getTry, _tryOnSettings$typeSe;
|
|
62496
|
+
var staticTranslations, dynamicTranslations, composerModels, promises, tryOnSettings;
|
|
62488
62497
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
62489
62498
|
while (1) switch (_context15.prev = _context15.next) {
|
|
62490
62499
|
case 0:
|
|
@@ -62659,10 +62668,12 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
62659
62668
|
return _this.viewer.loadSceneFromModelAsync(_this.zkProduct, _this.zkScene);
|
|
62660
62669
|
case 55:
|
|
62661
62670
|
if (_this.settings.brand) _this.viewer.createBrandLogoButton();
|
|
62671
|
+
tryOnSettings = (_this$zkScene2 = _this.zkScene) === null || _this$zkScene2 === void 0 ? void 0 : (_this$zkScene2$getTry = _this$zkScene2.getTryOnSettings) === null || _this$zkScene2$getTry === void 0 ? void 0 : _this$zkScene2$getTry.call(_this$zkScene2);
|
|
62672
|
+
if (tryOnSettings !== null && tryOnSettings !== void 0 && (_tryOnSettings$typeSe = tryOnSettings.typeSettings) !== null && _tryOnSettings$typeSe !== void 0 && _tryOnSettings$typeSe.mandatoryPD) _this.isPupillaryDistanceMandatory = true;
|
|
62662
62673
|
_this.trigger('change');
|
|
62663
|
-
_context15.next =
|
|
62674
|
+
_context15.next = 61;
|
|
62664
62675
|
return _this.handleSceneLoaded();
|
|
62665
|
-
case
|
|
62676
|
+
case 61:
|
|
62666
62677
|
case "end":
|
|
62667
62678
|
return _context15.stop();
|
|
62668
62679
|
}
|
|
@@ -64104,7 +64115,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
64104
64115
|
}());
|
|
64105
64116
|
_defineProperty(this, "addToCart", /*#__PURE__*/function () {
|
|
64106
64117
|
var _ref39 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(additionalProperties, onBeforeSendDataToParent, legacyScreenshot, nftForm) {
|
|
64107
|
-
var _this$
|
|
64118
|
+
var _this$zkScene3;
|
|
64108
64119
|
var compositionClientPreviews, sortedBuyScreenshotCameras, buyScreenshotCameras, _iterator6, _step6, camera, preview, formData, file, previewCameraFile;
|
|
64109
64120
|
return _regeneratorRuntime().wrap(function _callee38$(_context39) {
|
|
64110
64121
|
while (1) switch (_context39.prev = _context39.next) {
|
|
@@ -64116,7 +64127,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
64116
64127
|
_this.composition.set('compositionClientPreviews', []);
|
|
64117
64128
|
compositionClientPreviews = [];
|
|
64118
64129
|
sortedBuyScreenshotCameras = [];
|
|
64119
|
-
buyScreenshotCameras = (_this$
|
|
64130
|
+
buyScreenshotCameras = (_this$zkScene3 = _this.zkScene) === null || _this$zkScene3 === void 0 ? void 0 : _this$zkScene3.get('cameraLocations').filter(function (x) {
|
|
64120
64131
|
var _x$get;
|
|
64121
64132
|
return ((_x$get = x.get('name')) === null || _x$get === void 0 ? void 0 : _x$get.toLowerCase().indexOf('buy_screenshot_camera_')) !== -1;
|
|
64122
64133
|
});
|
|
@@ -64974,8 +64985,8 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
64974
64985
|
}());
|
|
64975
64986
|
// AR - Augmented Reality
|
|
64976
64987
|
_defineProperty(this, "isSceneArOnTheFly", function () {
|
|
64977
|
-
var _this$
|
|
64978
|
-
if (_this.viewer) return (_this$
|
|
64988
|
+
var _this$zkScene4;
|
|
64989
|
+
if (_this.viewer) return (_this$zkScene4 = _this.zkScene) === null || _this$zkScene4 === void 0 ? void 0 : _this$zkScene4.getAROnTheFly();
|
|
64979
64990
|
return false;
|
|
64980
64991
|
});
|
|
64981
64992
|
_defineProperty(this, "isArDeviceCompliant", function () {
|
|
@@ -65030,10 +65041,10 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
65030
65041
|
return false;
|
|
65031
65042
|
});
|
|
65032
65043
|
_defineProperty(this, "getPregeneratedARUrl", function (fileType) {
|
|
65033
|
-
var _this$
|
|
65034
|
-
return (_this$
|
|
65044
|
+
var _this$zkScene5, _this$zkScene5$get, _this$zkScene5$get$fi;
|
|
65045
|
+
return (_this$zkScene5 = _this.zkScene) === null || _this$zkScene5 === void 0 ? void 0 : (_this$zkScene5$get = _this$zkScene5.get('arFiles')) === null || _this$zkScene5$get === void 0 ? void 0 : (_this$zkScene5$get$fi = _this$zkScene5$get.find(function (x) {
|
|
65035
65046
|
return x.get('fileType') == fileType;
|
|
65036
|
-
})) === null || _this$
|
|
65047
|
+
})) === null || _this$zkScene5$get$fi === void 0 ? void 0 : _this$zkScene5$get$fi.get('url');
|
|
65037
65048
|
});
|
|
65038
65049
|
_defineProperty(this, "getQrCodeArUrl", /*#__PURE__*/function () {
|
|
65039
65050
|
var _ref62 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(device) {
|
|
@@ -65409,13 +65420,13 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
65409
65420
|
});
|
|
65410
65421
|
_defineProperty(this, "saveComposition", /*#__PURE__*/function () {
|
|
65411
65422
|
var _ref66 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(customPreviewSize, legacyScreenshot, isSharing) {
|
|
65412
|
-
var _this$
|
|
65423
|
+
var _this$zkScene6, _customPreviewSize$cu, _customPreviewSize$cu2;
|
|
65413
65424
|
var buyScreenshotCamera, data, design, designItems, itemsNotPlaceholders, nonStaticElementsCount;
|
|
65414
65425
|
return _regeneratorRuntime().wrap(function _callee65$(_context66) {
|
|
65415
65426
|
while (1) switch (_context66.prev = _context66.next) {
|
|
65416
65427
|
case 0:
|
|
65417
65428
|
console.log('Saving...');
|
|
65418
|
-
buyScreenshotCamera = (_this$
|
|
65429
|
+
buyScreenshotCamera = (_this$zkScene6 = _this.zkScene) === null || _this$zkScene6 === void 0 ? void 0 : _this$zkScene6.get('cameraLocations').find(function (x) {
|
|
65419
65430
|
var _x$get2;
|
|
65420
65431
|
return ((_x$get2 = x.get('name')) === null || _x$get2 === void 0 ? void 0 : _x$get2.toLowerCase()) === 'buy_screenshot_camera';
|
|
65421
65432
|
});
|
|
@@ -65816,63 +65827,53 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
65816
65827
|
return _ref75.apply(this, arguments);
|
|
65817
65828
|
};
|
|
65818
65829
|
}());
|
|
65819
|
-
_defineProperty(this, "setPDDistance",
|
|
65820
|
-
|
|
65821
|
-
|
|
65822
|
-
|
|
65823
|
-
|
|
65824
|
-
|
|
65825
|
-
|
|
65826
|
-
case "end":
|
|
65827
|
-
return _context77.stop();
|
|
65828
|
-
}
|
|
65829
|
-
}, _callee75);
|
|
65830
|
-
}));
|
|
65831
|
-
return function (_x72) {
|
|
65832
|
-
return _ref76.apply(this, arguments);
|
|
65833
|
-
};
|
|
65834
|
-
}());
|
|
65835
|
-
_defineProperty(this, "exportTryOnMesh", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76() {
|
|
65830
|
+
_defineProperty(this, "setPDDistance", function (distance) {
|
|
65831
|
+
_this.pdSettings = distance;
|
|
65832
|
+
});
|
|
65833
|
+
_defineProperty(this, "pdDistance", function () {
|
|
65834
|
+
return _this.pdSettings;
|
|
65835
|
+
});
|
|
65836
|
+
_defineProperty(this, "exportTryOnMesh", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75() {
|
|
65836
65837
|
var tryOnMesh;
|
|
65837
|
-
return _regeneratorRuntime().wrap(function
|
|
65838
|
-
while (1) switch (
|
|
65838
|
+
return _regeneratorRuntime().wrap(function _callee75$(_context77) {
|
|
65839
|
+
while (1) switch (_context77.prev = _context77.next) {
|
|
65839
65840
|
case 0:
|
|
65840
65841
|
if (_this.zkScene) {
|
|
65841
|
-
|
|
65842
|
+
_context77.next = 2;
|
|
65842
65843
|
break;
|
|
65843
65844
|
}
|
|
65844
|
-
return
|
|
65845
|
+
return _context77.abrupt("return", null);
|
|
65845
65846
|
case 2:
|
|
65846
65847
|
if (_this.viewer) {
|
|
65847
|
-
|
|
65848
|
+
_context77.next = 4;
|
|
65848
65849
|
break;
|
|
65849
65850
|
}
|
|
65850
|
-
return
|
|
65851
|
+
return _context77.abrupt("return", null);
|
|
65851
65852
|
case 4:
|
|
65852
65853
|
tryOnMesh = _this.viewer.getTryOnMeshVisible();
|
|
65853
65854
|
if (tryOnMesh) {
|
|
65854
|
-
|
|
65855
|
+
_context77.next = 7;
|
|
65855
65856
|
break;
|
|
65856
65857
|
}
|
|
65857
|
-
return
|
|
65858
|
+
return _context77.abrupt("return", null);
|
|
65858
65859
|
case 7:
|
|
65859
|
-
return
|
|
65860
|
+
return _context77.abrupt("return", _this.viewer.exportMeshToGLBBlob(tryOnMesh.id));
|
|
65860
65861
|
case 8:
|
|
65861
65862
|
case "end":
|
|
65862
|
-
return
|
|
65863
|
+
return _context77.stop();
|
|
65863
65864
|
}
|
|
65864
|
-
},
|
|
65865
|
+
}, _callee75);
|
|
65865
65866
|
})));
|
|
65866
65867
|
_defineProperty(this, "getTryOnSettings", function () {
|
|
65867
65868
|
if (_this.zkScene) return _this.zkScene.getTryOnSettings();
|
|
65868
65869
|
return undefined;
|
|
65869
65870
|
});
|
|
65870
65871
|
_defineProperty(this, "tryOnCountView", /*#__PURE__*/function () {
|
|
65871
|
-
var
|
|
65872
|
-
return _regeneratorRuntime().wrap(function
|
|
65873
|
-
while (1) switch (
|
|
65872
|
+
var _ref77 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(sellerID, providerID, modeChosen) {
|
|
65873
|
+
return _regeneratorRuntime().wrap(function _callee76$(_context78) {
|
|
65874
|
+
while (1) switch (_context78.prev = _context78.next) {
|
|
65874
65875
|
case 0:
|
|
65875
|
-
|
|
65876
|
+
_context78.next = 2;
|
|
65876
65877
|
return _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post(Zakeke.config.tryOnApiUrl + 'tryoncount/view', {
|
|
65877
65878
|
sellerID: sellerID,
|
|
65878
65879
|
providerID: providerID,
|
|
@@ -65880,12 +65881,12 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
65880
65881
|
});
|
|
65881
65882
|
case 2:
|
|
65882
65883
|
case "end":
|
|
65883
|
-
return
|
|
65884
|
+
return _context78.stop();
|
|
65884
65885
|
}
|
|
65885
|
-
},
|
|
65886
|
+
}, _callee76);
|
|
65886
65887
|
}));
|
|
65887
|
-
return function (_x73, _x74
|
|
65888
|
-
return
|
|
65888
|
+
return function (_x72, _x73, _x74) {
|
|
65889
|
+
return _ref77.apply(this, arguments);
|
|
65889
65890
|
};
|
|
65890
65891
|
}());
|
|
65891
65892
|
}
|
|
@@ -66013,34 +66014,34 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
66013
66014
|
}, {
|
|
66014
66015
|
key: "selectOptionsbyPrompt",
|
|
66015
66016
|
value: function () {
|
|
66016
|
-
var _selectOptionsbyPrompt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
66017
|
+
var _selectOptionsbyPrompt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(prompt) {
|
|
66017
66018
|
var _this$product2,
|
|
66018
66019
|
_this3 = this;
|
|
66019
66020
|
var response, _iterator12, _step12, _loop10;
|
|
66020
|
-
return _regeneratorRuntime().wrap(function
|
|
66021
|
-
while (1) switch (
|
|
66021
|
+
return _regeneratorRuntime().wrap(function _callee77$(_context80) {
|
|
66022
|
+
while (1) switch (_context80.prev = _context80.next) {
|
|
66022
66023
|
case 0:
|
|
66023
66024
|
if (prompt) {
|
|
66024
|
-
|
|
66025
|
+
_context80.next = 2;
|
|
66025
66026
|
break;
|
|
66026
66027
|
}
|
|
66027
66028
|
throw new Error('Invalid prompt');
|
|
66028
66029
|
case 2:
|
|
66029
|
-
|
|
66030
|
+
_context80.next = 4;
|
|
66030
66031
|
return _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.get(Zakeke.config.baseApiUrl + 'ai/configuration-by-prompt', {
|
|
66031
66032
|
params: {
|
|
66032
66033
|
productId: (_this$product2 = this.product) === null || _this$product2 === void 0 ? void 0 : _this$product2.id
|
|
66033
66034
|
}
|
|
66034
66035
|
});
|
|
66035
66036
|
case 4:
|
|
66036
|
-
response =
|
|
66037
|
+
response = _context80.sent.data;
|
|
66037
66038
|
_iterator12 = _createForOfIteratorHelper(response);
|
|
66038
|
-
|
|
66039
|
+
_context80.prev = 6;
|
|
66039
66040
|
_loop10 = /*#__PURE__*/_regeneratorRuntime().mark(function _loop10() {
|
|
66040
66041
|
var _this3$groups$flatMap;
|
|
66041
66042
|
var _step12$value, attributeName, optionName, optionId;
|
|
66042
|
-
return _regeneratorRuntime().wrap(function _loop10$(
|
|
66043
|
-
while (1) switch (
|
|
66043
|
+
return _regeneratorRuntime().wrap(function _loop10$(_context79) {
|
|
66044
|
+
while (1) switch (_context79.prev = _context79.next) {
|
|
66044
66045
|
case 0:
|
|
66045
66046
|
_step12$value = _slicedToArray(_step12.value, 2), attributeName = _step12$value[0], optionName = _step12$value[1];
|
|
66046
66047
|
optionId = (_this3$groups$flatMap = _this3.groups.flatMap(function (x) {
|
|
@@ -66055,38 +66056,38 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
66055
66056
|
}
|
|
66056
66057
|
case 3:
|
|
66057
66058
|
case "end":
|
|
66058
|
-
return
|
|
66059
|
+
return _context79.stop();
|
|
66059
66060
|
}
|
|
66060
66061
|
}, _loop10);
|
|
66061
66062
|
});
|
|
66062
66063
|
_iterator12.s();
|
|
66063
66064
|
case 9:
|
|
66064
66065
|
if ((_step12 = _iterator12.n()).done) {
|
|
66065
|
-
|
|
66066
|
+
_context80.next = 13;
|
|
66066
66067
|
break;
|
|
66067
66068
|
}
|
|
66068
|
-
return
|
|
66069
|
+
return _context80.delegateYield(_loop10(), "t0", 11);
|
|
66069
66070
|
case 11:
|
|
66070
|
-
|
|
66071
|
+
_context80.next = 9;
|
|
66071
66072
|
break;
|
|
66072
66073
|
case 13:
|
|
66073
|
-
|
|
66074
|
+
_context80.next = 18;
|
|
66074
66075
|
break;
|
|
66075
66076
|
case 15:
|
|
66076
|
-
|
|
66077
|
-
|
|
66078
|
-
_iterator12.e(
|
|
66077
|
+
_context80.prev = 15;
|
|
66078
|
+
_context80.t1 = _context80["catch"](6);
|
|
66079
|
+
_iterator12.e(_context80.t1);
|
|
66079
66080
|
case 18:
|
|
66080
|
-
|
|
66081
|
+
_context80.prev = 18;
|
|
66081
66082
|
_iterator12.f();
|
|
66082
|
-
return
|
|
66083
|
+
return _context80.finish(18);
|
|
66083
66084
|
case 21:
|
|
66084
66085
|
case "end":
|
|
66085
|
-
return
|
|
66086
|
+
return _context80.stop();
|
|
66086
66087
|
}
|
|
66087
|
-
},
|
|
66088
|
+
}, _callee77, this, [[6, 15, 18, 21]]);
|
|
66088
66089
|
}));
|
|
66089
|
-
function selectOptionsbyPrompt(
|
|
66090
|
+
function selectOptionsbyPrompt(_x75) {
|
|
66090
66091
|
return _selectOptionsbyPrompt.apply(this, arguments);
|
|
66091
66092
|
}
|
|
66092
66093
|
return selectOptionsbyPrompt;
|
|
@@ -66100,8 +66101,8 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
66100
66101
|
}, {
|
|
66101
66102
|
key: "getCameraByName",
|
|
66102
66103
|
value: function getCameraByName(name) {
|
|
66103
|
-
var _this$
|
|
66104
|
-
var location = (_this$
|
|
66104
|
+
var _this$zkScene7;
|
|
66105
|
+
var location = (_this$zkScene7 = this.zkScene) === null || _this$zkScene7 === void 0 ? void 0 : _this$zkScene7.get('cameraLocations').find(function (x) {
|
|
66105
66106
|
return x.get('name') == name;
|
|
66106
66107
|
});
|
|
66107
66108
|
return location;
|
|
@@ -66156,13 +66157,13 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
66156
66157
|
}, {
|
|
66157
66158
|
key: "addItemText",
|
|
66158
66159
|
value: function () {
|
|
66159
|
-
var _addItemText = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
66160
|
+
var _addItemText = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(settings, areaId) {
|
|
66160
66161
|
var font;
|
|
66161
|
-
return _regeneratorRuntime().wrap(function
|
|
66162
|
-
while (1) switch (
|
|
66162
|
+
return _regeneratorRuntime().wrap(function _callee78$(_context81) {
|
|
66163
|
+
while (1) switch (_context81.prev = _context81.next) {
|
|
66163
66164
|
case 0:
|
|
66164
66165
|
if (!this.viewer) {
|
|
66165
|
-
|
|
66166
|
+
_context81.next = 12;
|
|
66166
66167
|
break;
|
|
66167
66168
|
}
|
|
66168
66169
|
// First download the font
|
|
@@ -66170,32 +66171,32 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
66170
66171
|
return x.name === settings.fontFamily;
|
|
66171
66172
|
});
|
|
66172
66173
|
if (!font) {
|
|
66173
|
-
|
|
66174
|
+
_context81.next = 9;
|
|
66174
66175
|
break;
|
|
66175
66176
|
}
|
|
66176
|
-
|
|
66177
|
+
_context81.next = 5;
|
|
66177
66178
|
return (0,_fontsManager__WEBPACK_IMPORTED_MODULE_6__.loadFonts)([font]);
|
|
66178
66179
|
case 5:
|
|
66179
66180
|
this.viewer.addDesignItemText(_objectSpread(_objectSpread({}, settings), {}, {
|
|
66180
66181
|
content: settings.text
|
|
66181
66182
|
}), areaId);
|
|
66182
66183
|
this.renderDesign();
|
|
66183
|
-
|
|
66184
|
+
_context81.next = 10;
|
|
66184
66185
|
break;
|
|
66185
66186
|
case 9:
|
|
66186
66187
|
console.warn("No font found for ".concat(settings.fontFamily));
|
|
66187
66188
|
case 10:
|
|
66188
|
-
|
|
66189
|
+
_context81.next = 13;
|
|
66189
66190
|
break;
|
|
66190
66191
|
case 12:
|
|
66191
66192
|
throw 'Called add item text but no viewer or viewer not ready';
|
|
66192
66193
|
case 13:
|
|
66193
66194
|
case "end":
|
|
66194
|
-
return
|
|
66195
|
+
return _context81.stop();
|
|
66195
66196
|
}
|
|
66196
|
-
},
|
|
66197
|
+
}, _callee78, this);
|
|
66197
66198
|
}));
|
|
66198
|
-
function addItemText(
|
|
66199
|
+
function addItemText(_x76, _x77) {
|
|
66199
66200
|
return _addItemText.apply(this, arguments);
|
|
66200
66201
|
}
|
|
66201
66202
|
return addItemText;
|
|
@@ -66288,6 +66289,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
66288
66289
|
var _this$viewer4;
|
|
66289
66290
|
return (_this$viewer4 = this.viewer) === null || _this$viewer4 === void 0 ? void 0 : _this$viewer4.isTryOnMeshVisibleEnabledToShow();
|
|
66290
66291
|
}
|
|
66292
|
+
}, {
|
|
66293
|
+
key: "isMandatoryPD",
|
|
66294
|
+
get: function get() {
|
|
66295
|
+
return this.isPupillaryDistanceMandatory;
|
|
66296
|
+
}
|
|
66291
66297
|
}, {
|
|
66292
66298
|
key: "isTryOnMeshVisible",
|
|
66293
66299
|
get: function get() {
|
|
@@ -68292,7 +68298,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
68292
68298
|
|
|
68293
68299
|
|
|
68294
68300
|
|
|
68295
|
-
|
|
68296
68301
|
// Handle boot when provider is ready
|
|
68297
68302
|
var Boot = function Boot(_ref) {
|
|
68298
68303
|
var parameters = _ref.parameters,
|
|
@@ -68753,8 +68758,10 @@ var createProviderValue = function createProviderValue(state, dispatch) {
|
|
|
68753
68758
|
canUseTryOn: state.environment.canUseTryOn,
|
|
68754
68759
|
canUsePD: state.environment.canUsePD,
|
|
68755
68760
|
isTryOnMeshVisible: state.environment.isTryOnMeshVisible,
|
|
68761
|
+
isMandatoryPD: state.environment.isMandatoryPD,
|
|
68756
68762
|
getTryOnSettings: state.environment.getTryOnSettings.bind(state.environment),
|
|
68757
68763
|
setPDDistance: state.environment.setPDDistance.bind(state.environment),
|
|
68764
|
+
pdDistance: state.environment.pdDistance,
|
|
68758
68765
|
setCameraLocked: state.environment.setCameraLocked.bind(state.environment),
|
|
68759
68766
|
getTemplateUploadRestrictictions: state.environment.getTemplateUploadRestrictictions.bind(state.environment),
|
|
68760
68767
|
getShareCompositionUrl: state.environment.getShareCompositionUrl.bind(state.environment),
|