zakeke-configurator-react 0.0.147 → 0.0.148
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.js +15 -41
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25265,7 +25265,7 @@ class ZakekeEnvironment {
|
|
|
25265
25265
|
quote.compositionDocID = this.composition.get('docID');
|
|
25266
25266
|
quote.modelPrice = (_c = (yield this.integration.getPrice(this.composition, this.zkCurrentTemplate, this.zkProduct, this.platformAttributesSelection, 0, this.settings.additionalFeatures.prices3dConfigurator, this.settings.isPricingAdvancedEnabled, 1))) !== null && _c !== void 0 ? _c : 0;
|
|
25267
25267
|
quote.variantName = (_e = this.product.name) !== null && _e !== void 0 ? _e : '';
|
|
25268
|
-
const quoteCreated = (yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post('quotes', quote)).data;
|
|
25268
|
+
const quoteCreated = (yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post(Zakeke.config.baseApiUrl + 'quotes', quote)).data;
|
|
25269
25269
|
return quoteCreated;
|
|
25270
25270
|
});
|
|
25271
25271
|
this.getTranslations = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -25327,14 +25327,8 @@ class ZakekeEnvironment {
|
|
|
25327
25327
|
this.eventMessages = this.settings.eventMessages.map((message) => ___WEBPACK_IMPORTED_MODULE_1__.EventMessage.fromMessage(message));
|
|
25328
25328
|
this.trigger('change');
|
|
25329
25329
|
this.translations = yield this.getTranslations();
|
|
25330
|
-
const staticTranslations = new Map(this.translations.statics.map((staticTranslation) => [
|
|
25331
|
-
|
|
25332
|
-
staticTranslation.localization,
|
|
25333
|
-
]));
|
|
25334
|
-
const dynamicTranslations = new Map(this.translations.dynamics.map((staticTranslation) => [
|
|
25335
|
-
staticTranslation.original,
|
|
25336
|
-
staticTranslation.localization,
|
|
25337
|
-
]));
|
|
25330
|
+
const staticTranslations = new Map(this.translations.statics.map((staticTranslation) => [staticTranslation.original, staticTranslation.localization]));
|
|
25331
|
+
const dynamicTranslations = new Map(this.translations.dynamics.map((staticTranslation) => [staticTranslation.original, staticTranslation.localization]));
|
|
25338
25332
|
this.publicTranslations = {
|
|
25339
25333
|
statics: staticTranslations,
|
|
25340
25334
|
dynamics: dynamicTranslations,
|
|
@@ -25345,9 +25339,7 @@ class ZakekeEnvironment {
|
|
|
25345
25339
|
this.zkScene = composerModels.get('scene');
|
|
25346
25340
|
this.zkProduct = composerModels.get('model');
|
|
25347
25341
|
this.product = _models__WEBPACK_IMPORTED_MODULE_11__.Product.fromProduct(this.zkProduct);
|
|
25348
|
-
this.quantityRule = this.zkProduct.get('quantityRule')
|
|
25349
|
-
? _models__WEBPACK_IMPORTED_MODULE_11__.ProductQuantityRule.fromQuantityRule(this.zkProduct.get('quantityRule'))
|
|
25350
|
-
: null;
|
|
25342
|
+
this.quantityRule = this.zkProduct.get('quantityRule') ? _models__WEBPACK_IMPORTED_MODULE_11__.ProductQuantityRule.fromQuantityRule(this.zkProduct.get('quantityRule')) : null;
|
|
25351
25343
|
this.integration = yield (0,_integrations_Helpers__WEBPACK_IMPORTED_MODULE_9__.integrationFor)(this.platform);
|
|
25352
25344
|
this.sellerSettings = yield this.getSellerSetting();
|
|
25353
25345
|
if (!this.zkScene)
|
|
@@ -25459,10 +25451,7 @@ class ZakekeEnvironment {
|
|
|
25459
25451
|
const option = attr.get('options').find((x) => x.get('optionID') == currentOption.get('optionID'));
|
|
25460
25452
|
if (option && attr.get('enabled')) {
|
|
25461
25453
|
isOptionEnabled = this.isOptionEnabled(currentOption.get('optionID'));
|
|
25462
|
-
label =
|
|
25463
|
-
group.get('groupID') !== -1
|
|
25464
|
-
? _helpers__WEBPACK_IMPORTED_MODULE_7__.T._d(group.get('name')) + ' ' + _helpers__WEBPACK_IMPORTED_MODULE_7__.T._d(currentAttr.get('name'))
|
|
25465
|
-
: _helpers__WEBPACK_IMPORTED_MODULE_7__.T._d(currentAttr.get('name'));
|
|
25454
|
+
label = group.get('groupID') !== -1 ? _helpers__WEBPACK_IMPORTED_MODULE_7__.T._d(group.get('name')) + ' ' + _helpers__WEBPACK_IMPORTED_MODULE_7__.T._d(currentAttr.get('name')) : _helpers__WEBPACK_IMPORTED_MODULE_7__.T._d(currentAttr.get('name'));
|
|
25466
25455
|
recapProps[`${label}`] = {
|
|
25467
25456
|
groupDisplayOrder: (_a = currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.get('displayOrder')) !== null && _a !== void 0 ? _a : 0,
|
|
25468
25457
|
stepDisplayOrder: (_b = currentStep === null || currentStep === void 0 ? void 0 : currentStep.get('displayOrder')) !== null && _b !== void 0 ? _b : 0,
|
|
@@ -25903,8 +25892,7 @@ class ZakekeEnvironment {
|
|
|
25903
25892
|
let attributePlatformSelection = this.platformAttributesSelection.find((selection) => {
|
|
25904
25893
|
return (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.matchCodes)(selection.attributeCode, attribute.get('attributeCode'));
|
|
25905
25894
|
});
|
|
25906
|
-
if (attributePlatformSelection &&
|
|
25907
|
-
(0,_helpers__WEBPACK_IMPORTED_MODULE_7__.matchCodes)(attributePlatformSelection.optionCode, option.get('optionCode'))) {
|
|
25895
|
+
if (attributePlatformSelection && (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.matchCodes)(attributePlatformSelection.optionCode, option.get('optionCode'))) {
|
|
25908
25896
|
attributePlatformSelection.optionIsEnabled = isEnabled;
|
|
25909
25897
|
}
|
|
25910
25898
|
}
|
|
@@ -25986,10 +25974,7 @@ class ZakekeEnvironment {
|
|
|
25986
25974
|
attribute.code = zakekeAttribute.get('attributeCode');
|
|
25987
25975
|
attribute.name = zakekeAttribute.get('name') || '';
|
|
25988
25976
|
attribute.description = zakekeAttribute.get('description') || '';
|
|
25989
|
-
attribute.optionShapeType =
|
|
25990
|
-
zakekeAttribute.get('optionPreviewShapeID') == 1
|
|
25991
|
-
? _models__WEBPACK_IMPORTED_MODULE_11__.AttributeOptionShapeType.Round
|
|
25992
|
-
: _models__WEBPACK_IMPORTED_MODULE_11__.AttributeOptionShapeType.Square;
|
|
25977
|
+
attribute.optionShapeType = zakekeAttribute.get('optionPreviewShapeID') == 1 ? _models__WEBPACK_IMPORTED_MODULE_11__.AttributeOptionShapeType.Round : _models__WEBPACK_IMPORTED_MODULE_11__.AttributeOptionShapeType.Square;
|
|
25993
25978
|
attribute.displayOrder = zakekeAttribute.get('displayOrder');
|
|
25994
25979
|
attribute.enabled = attributeSelection.get('enabled');
|
|
25995
25980
|
attribute.groupId = zakekeAttribute.get('groupID');
|
|
@@ -26024,10 +26009,7 @@ class ZakekeEnvironment {
|
|
|
26024
26009
|
return attribute;
|
|
26025
26010
|
};
|
|
26026
26011
|
this.createOptionFromSelection = (optionSelection) => {
|
|
26027
|
-
var zakekeOption = this.zkProduct.get('attributes')
|
|
26028
|
-
.get(optionSelection.get('attributeID'))
|
|
26029
|
-
.get('options')
|
|
26030
|
-
.get(optionSelection.get('optionID'));
|
|
26012
|
+
var zakekeOption = this.zkProduct.get('attributes').get(optionSelection.get('attributeID')).get('options').get(optionSelection.get('optionID'));
|
|
26031
26013
|
var option = new _models__WEBPACK_IMPORTED_MODULE_11__.Option();
|
|
26032
26014
|
option.id = zakekeOption.get('optionID');
|
|
26033
26015
|
option.guid = zakekeOption.get('optionGuid');
|
|
@@ -26197,9 +26179,7 @@ class ZakekeEnvironment {
|
|
|
26197
26179
|
const unselectedOptionsActions = this.selection.getAttributeUnselectedOptionsSceneActions(attributeId);
|
|
26198
26180
|
yield this.viewer.prefetchDataForUnselectedOptionsAsync(unselectedOptionsActions);
|
|
26199
26181
|
const attribute = this.zkProduct.get('attributes').find((attribute) => attribute.get('attributeID') == attributeId);
|
|
26200
|
-
if (attribute &&
|
|
26201
|
-
attribute.get('sceneCameraLocationID') &&
|
|
26202
|
-
attribute.get('sceneCameraLocationID') != Zakeke.getEmptyUUID()) {
|
|
26182
|
+
if (attribute && attribute.get('sceneCameraLocationID') && attribute.get('sceneCameraLocationID') != Zakeke.getEmptyUUID()) {
|
|
26203
26183
|
this.viewer.setCameraLocation(attribute.get('sceneCameraLocationID'));
|
|
26204
26184
|
this.lastCameraLocation = attribute.get('sceneCameraLocationID');
|
|
26205
26185
|
}
|
|
@@ -26228,7 +26208,7 @@ class ZakekeEnvironment {
|
|
|
26228
26208
|
const formData = new FormData();
|
|
26229
26209
|
const file = this.base64StringToFile(preview, camera + '.png');
|
|
26230
26210
|
formData.set('file', file);
|
|
26231
|
-
const previewCameraFile = (yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post('designs/upload-client-preview', formData)).data;
|
|
26211
|
+
const previewCameraFile = (yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post(Zakeke.config.baseApiUrl + 'designs/upload-client-preview', formData)).data;
|
|
26232
26212
|
compositionClientPreviews.push({
|
|
26233
26213
|
fileObjectID: previewCameraFile.id,
|
|
26234
26214
|
cameraName: camera.get('name'),
|
|
@@ -26299,11 +26279,7 @@ class ZakekeEnvironment {
|
|
|
26299
26279
|
}
|
|
26300
26280
|
};
|
|
26301
26281
|
this.openSecondScreen = () => {
|
|
26302
|
-
const url = Zakeke.config.baseUrl +
|
|
26303
|
-
'en/SecondScreen?token=' +
|
|
26304
|
-
this.token +
|
|
26305
|
-
'&modelID=' +
|
|
26306
|
-
this.zkProduct.get('modelID');
|
|
26282
|
+
const url = Zakeke.config.baseUrl + 'en/SecondScreen?token=' + this.token + '&modelID=' + this.zkProduct.get('modelID');
|
|
26307
26283
|
window.open(url);
|
|
26308
26284
|
};
|
|
26309
26285
|
this.extendedUpdate = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -26461,7 +26437,7 @@ class ZakekeEnvironment {
|
|
|
26461
26437
|
});
|
|
26462
26438
|
this.createImageFromUrl = (url) => __awaiter(this, void 0, void 0, function* () {
|
|
26463
26439
|
if (this.viewer) {
|
|
26464
|
-
const result = (yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post('images/import/url', {
|
|
26440
|
+
const result = (yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post(Zakeke.config.baseApiUrl + 'images/import/url', {
|
|
26465
26441
|
url,
|
|
26466
26442
|
})).data;
|
|
26467
26443
|
return result;
|
|
@@ -26611,7 +26587,7 @@ class ZakekeEnvironment {
|
|
|
26611
26587
|
});
|
|
26612
26588
|
this.getOnlineScreenshot = (width, height, legacyScreenshot, backgroundColor, padding = 30) => __awaiter(this, void 0, void 0, function* () {
|
|
26613
26589
|
const preview = yield this.getScreenshot(width, height, legacyScreenshot, backgroundColor, padding);
|
|
26614
|
-
const { url: originalUrl } = (yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post('designs/save-share-preview', { preview })).data;
|
|
26590
|
+
const { url: originalUrl } = (yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post(Zakeke.config.baseApiUrl + 'designs/save-share-preview', { preview })).data;
|
|
26615
26591
|
const rewrittenUrl = this.rewriteShareUrl(originalUrl);
|
|
26616
26592
|
return {
|
|
26617
26593
|
originalUrl,
|
|
@@ -26760,7 +26736,7 @@ class ZakekeEnvironment {
|
|
|
26760
26736
|
if (!this.zkProduct || this.isViewerMode)
|
|
26761
26737
|
return;
|
|
26762
26738
|
try {
|
|
26763
|
-
yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post('viewscount/addview', {
|
|
26739
|
+
yield _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post(Zakeke.config.baseApiUrl + 'viewscount/addview', {
|
|
26764
26740
|
productID: this.zkProduct.get('modelID'),
|
|
26765
26741
|
environment: this.zkProduct.get('environment'),
|
|
26766
26742
|
ecommerceID: this.settings.ecommerceID,
|
|
@@ -27060,9 +27036,7 @@ class ZakekeEnvironment {
|
|
|
27060
27036
|
// The attributes in a step must have the group ID too or the group selection will be empty
|
|
27061
27037
|
for (var i = 0; i < this.zkProduct.get('attributes').length; i++) {
|
|
27062
27038
|
let zakekeAttribute = this.zkProduct.get('attributes').at(i);
|
|
27063
|
-
let attributeSelection = groupSelection
|
|
27064
|
-
.get('attributes')
|
|
27065
|
-
.find((attr) => attr.get('attributeID') == zakekeAttribute.get('attributeID'));
|
|
27039
|
+
let attributeSelection = groupSelection.get('attributes').find((attr) => attr.get('attributeID') == zakekeAttribute.get('attributeID'));
|
|
27066
27040
|
if (attributeSelection && zakekeAttribute.get('stepID') == zkStep.id) {
|
|
27067
27041
|
let attribute = this.createAttributeFromSelection(attributeSelection);
|
|
27068
27042
|
step.attributes.push(attribute);
|