@ikas/storefront 0.0.161-alpha.18 → 0.0.161-alpha.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/build/__generated__/global-types.d.ts +0 -2
- package/build/api/customer/__generated__/registerCustomer.d.ts +0 -1
- package/build/api/customer/index.d.ts +1 -1
- package/build/index.es.js +57 -153
- package/build/index.js +57 -153
- package/build/models/ui/validator/form/register.d.ts +0 -3
- package/build/pages/editor.d.ts +0 -2
- package/build/store/customer.d.ts +1 -1
- package/build/utils/settings.d.ts +11 -47
- package/package.json +1 -3
|
@@ -221,7 +221,6 @@ export declare enum ProductFilterDisplayTypeEnum {
|
|
|
221
221
|
export declare enum ProductFilterSortTypeEnum {
|
|
222
222
|
ALPHABETICAL_ASC = "ALPHABETICAL_ASC",
|
|
223
223
|
ALPHABETICAL_DESC = "ALPHABETICAL_DESC",
|
|
224
|
-
CUSTOM_SORT = "CUSTOM_SORT",
|
|
225
224
|
PRODUCT_COUNT_ASC = "PRODUCT_COUNT_ASC",
|
|
226
225
|
PRODUCT_COUNT_DESC = "PRODUCT_COUNT_DESC"
|
|
227
226
|
}
|
|
@@ -263,7 +262,6 @@ export declare enum SortByDirectionEnum {
|
|
|
263
262
|
export declare enum SortByTypeEnum {
|
|
264
263
|
CREATED_AT = "CREATED_AT",
|
|
265
264
|
DISCOUNT_RATIO = "DISCOUNT_RATIO",
|
|
266
|
-
MANUAL_SORT = "MANUAL_SORT",
|
|
267
265
|
NAME = "NAME",
|
|
268
266
|
PRICE = "PRICE"
|
|
269
267
|
}
|
|
@@ -9,7 +9,7 @@ export declare class IkasCustomerAPI {
|
|
|
9
9
|
token: string;
|
|
10
10
|
tokenExpiry: number;
|
|
11
11
|
} | undefined>;
|
|
12
|
-
static register(email: string, password: string, firstName: string, lastName: string
|
|
12
|
+
static register(email: string, password: string, firstName: string, lastName: string): Promise<{
|
|
13
13
|
customer: IkasCustomer;
|
|
14
14
|
__typename: "CustomerLoginResponse";
|
|
15
15
|
token: string;
|
package/build/index.es.js
CHANGED
|
@@ -7,7 +7,6 @@ import Link from 'next/link';
|
|
|
7
7
|
import NextImage from 'next/image';
|
|
8
8
|
import fs from 'fs';
|
|
9
9
|
import getConfig from 'next/config';
|
|
10
|
-
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
|
|
11
10
|
import dynamic from 'next/dynamic';
|
|
12
11
|
import Error$1 from 'next/error';
|
|
13
12
|
|
|
@@ -23548,11 +23547,11 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
23548
23547
|
}
|
|
23549
23548
|
});
|
|
23550
23549
|
}); };
|
|
23551
|
-
this.register = function (firstName, lastName, email, password
|
|
23550
|
+
this.register = function (firstName, lastName, email, password) { return __awaiter(_this, void 0, void 0, function () {
|
|
23552
23551
|
var response;
|
|
23553
23552
|
return __generator(this, function (_a) {
|
|
23554
23553
|
switch (_a.label) {
|
|
23555
|
-
case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName
|
|
23554
|
+
case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName)];
|
|
23556
23555
|
case 1:
|
|
23557
23556
|
response = _a.sent();
|
|
23558
23557
|
if (response) {
|
|
@@ -27626,7 +27625,6 @@ var ProductFilterSortTypeEnum;
|
|
|
27626
27625
|
(function (ProductFilterSortTypeEnum) {
|
|
27627
27626
|
ProductFilterSortTypeEnum["ALPHABETICAL_ASC"] = "ALPHABETICAL_ASC";
|
|
27628
27627
|
ProductFilterSortTypeEnum["ALPHABETICAL_DESC"] = "ALPHABETICAL_DESC";
|
|
27629
|
-
ProductFilterSortTypeEnum["CUSTOM_SORT"] = "CUSTOM_SORT";
|
|
27630
27628
|
ProductFilterSortTypeEnum["PRODUCT_COUNT_ASC"] = "PRODUCT_COUNT_ASC";
|
|
27631
27629
|
ProductFilterSortTypeEnum["PRODUCT_COUNT_DESC"] = "PRODUCT_COUNT_DESC";
|
|
27632
27630
|
})(ProductFilterSortTypeEnum || (ProductFilterSortTypeEnum = {}));
|
|
@@ -27673,7 +27671,6 @@ var SortByTypeEnum;
|
|
|
27673
27671
|
(function (SortByTypeEnum) {
|
|
27674
27672
|
SortByTypeEnum["CREATED_AT"] = "CREATED_AT";
|
|
27675
27673
|
SortByTypeEnum["DISCOUNT_RATIO"] = "DISCOUNT_RATIO";
|
|
27676
|
-
SortByTypeEnum["MANUAL_SORT"] = "MANUAL_SORT";
|
|
27677
27674
|
SortByTypeEnum["NAME"] = "NAME";
|
|
27678
27675
|
SortByTypeEnum["PRICE"] = "PRICE";
|
|
27679
27676
|
})(SortByTypeEnum || (SortByTypeEnum = {}));
|
|
@@ -29676,7 +29673,6 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29676
29673
|
lastName: "",
|
|
29677
29674
|
email: "",
|
|
29678
29675
|
password: "",
|
|
29679
|
-
isMarketingAccepted: false,
|
|
29680
29676
|
};
|
|
29681
29677
|
this.onFirstNameChange = function (value) {
|
|
29682
29678
|
_this.firstName = value;
|
|
@@ -29776,16 +29772,6 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29776
29772
|
enumerable: false,
|
|
29777
29773
|
configurable: true
|
|
29778
29774
|
});
|
|
29779
|
-
Object.defineProperty(RegisterForm.prototype, "isMarketingAccepted", {
|
|
29780
|
-
get: function () {
|
|
29781
|
-
return this.model.isMarketingAccepted;
|
|
29782
|
-
},
|
|
29783
|
-
set: function (value) {
|
|
29784
|
-
this.model.isMarketingAccepted = value;
|
|
29785
|
-
},
|
|
29786
|
-
enumerable: false,
|
|
29787
|
-
configurable: true
|
|
29788
|
-
});
|
|
29789
29775
|
Object.defineProperty(RegisterForm.prototype, "hasError", {
|
|
29790
29776
|
get: function () {
|
|
29791
29777
|
return this.validator.hasError;
|
|
@@ -29851,7 +29837,7 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29851
29837
|
_b.label = 2;
|
|
29852
29838
|
case 2:
|
|
29853
29839
|
_b.trys.push([2, 4, , 5]);
|
|
29854
|
-
return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password
|
|
29840
|
+
return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password)];
|
|
29855
29841
|
case 3:
|
|
29856
29842
|
isRegisterSuccess = _b.sent();
|
|
29857
29843
|
if (isRegisterSuccess) {
|
|
@@ -34366,13 +34352,13 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
34366
34352
|
});
|
|
34367
34353
|
});
|
|
34368
34354
|
};
|
|
34369
|
-
IkasCustomerAPI.register = function (email, password, firstName, lastName
|
|
34355
|
+
IkasCustomerAPI.register = function (email, password, firstName, lastName) {
|
|
34370
34356
|
return __awaiter(this, void 0, void 0, function () {
|
|
34371
34357
|
var MUTATION, _a, data, errors, err_2;
|
|
34372
34358
|
return __generator(this, function (_b) {
|
|
34373
34359
|
switch (_b.label) {
|
|
34374
34360
|
case 0:
|
|
34375
|
-
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n
|
|
34361
|
+
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
|
|
34376
34362
|
_b.label = 1;
|
|
34377
34363
|
case 1:
|
|
34378
34364
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -34385,7 +34371,6 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
34385
34371
|
password: password,
|
|
34386
34372
|
firstName: firstName,
|
|
34387
34373
|
lastName: lastName,
|
|
34388
|
-
isAcceptMarketing: isAcceptMarketing,
|
|
34389
34374
|
},
|
|
34390
34375
|
})];
|
|
34391
34376
|
case 2:
|
|
@@ -37682,30 +37667,6 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
37682
37667
|
Image: Image
|
|
37683
37668
|
});
|
|
37684
37669
|
|
|
37685
|
-
/**
|
|
37686
|
-
* Creates a duplicate-free version of an array, using
|
|
37687
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
37688
|
-
* for equality comparisons, in which only the first occurrence of each element
|
|
37689
|
-
* is kept. The order of result values is determined by the order they occur
|
|
37690
|
-
* in the array.
|
|
37691
|
-
*
|
|
37692
|
-
* @static
|
|
37693
|
-
* @memberOf _
|
|
37694
|
-
* @since 0.1.0
|
|
37695
|
-
* @category Array
|
|
37696
|
-
* @param {Array} array The array to inspect.
|
|
37697
|
-
* @returns {Array} Returns the new duplicate free array.
|
|
37698
|
-
* @example
|
|
37699
|
-
*
|
|
37700
|
-
* _.uniq([2, 1, 2]);
|
|
37701
|
-
* // => [2, 1]
|
|
37702
|
-
*/
|
|
37703
|
-
function uniq(array) {
|
|
37704
|
-
return (array && array.length) ? _baseUniq(array) : [];
|
|
37705
|
-
}
|
|
37706
|
-
|
|
37707
|
-
var uniq_1 = uniq;
|
|
37708
|
-
|
|
37709
37670
|
var IkasStorefrontLocalization = /** @class */ (function () {
|
|
37710
37671
|
function IkasStorefrontLocalization(data) {
|
|
37711
37672
|
this.id = data.id || "";
|
|
@@ -37944,7 +37905,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37944
37905
|
id: storefront.salesChannelId,
|
|
37945
37906
|
}),
|
|
37946
37907
|
routing: storefront.routings.length
|
|
37947
|
-
? storefront.routings.find(function (r) { return
|
|
37908
|
+
? storefront.routings.find(function (r) { return !r.path && !r.domain; }) ||
|
|
37948
37909
|
storefront.routings[0]
|
|
37949
37910
|
: new IkasStorefrontRouting({}),
|
|
37950
37911
|
favicon: localTheme.settings.favicon,
|
|
@@ -37992,13 +37953,12 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37992
37953
|
});
|
|
37993
37954
|
}); });
|
|
37994
37955
|
};
|
|
37995
|
-
SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes
|
|
37956
|
+
SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes) {
|
|
37996
37957
|
var _a;
|
|
37997
37958
|
return __awaiter(this, void 0, void 0, function () {
|
|
37998
|
-
var isLocal, locale,
|
|
37999
|
-
|
|
38000
|
-
|
|
38001
|
-
switch (_f.label) {
|
|
37959
|
+
var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider;
|
|
37960
|
+
return __generator(this, function (_b) {
|
|
37961
|
+
switch (_b.label) {
|
|
38002
37962
|
case 0:
|
|
38003
37963
|
isLocal = process.env.NEXT_PUBLIC_ENV === "local";
|
|
38004
37964
|
locale = isLocal ? "en" : context.locale;
|
|
@@ -38008,10 +37968,9 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
38008
37968
|
notFound: true,
|
|
38009
37969
|
}];
|
|
38010
37970
|
}
|
|
38011
|
-
serverRuntimeConfig = getConfig().serverRuntimeConfig;
|
|
38012
37971
|
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
38013
37972
|
case 1:
|
|
38014
|
-
settings =
|
|
37973
|
+
settings = _b.sent();
|
|
38015
37974
|
if (!settings ||
|
|
38016
37975
|
!settings.storefront.mainStorefrontThemeId ||
|
|
38017
37976
|
!settings.storefront.salesChannelId) {
|
|
@@ -38035,67 +37994,31 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
38035
37994
|
IkasStorefrontConfig.stockPreference = stockPreference || null;
|
|
38036
37995
|
provider = new IkasPageDataProvider(themeLocalization.themeJson, context.params, pageType);
|
|
38037
37996
|
provider.possiblePageTypes = possiblePageTypes;
|
|
38038
|
-
if (!!isEditor) return [3 /*break*/, 3];
|
|
38039
37997
|
return [4 /*yield*/, provider.getPageData()];
|
|
38040
37998
|
case 2:
|
|
38041
|
-
|
|
38042
|
-
_f.label = 3;
|
|
38043
|
-
case 3:
|
|
37999
|
+
_b.sent();
|
|
38044
38000
|
if (!provider.page) {
|
|
38045
|
-
|
|
38046
|
-
|
|
38047
|
-
|
|
38048
|
-
|
|
38049
|
-
}];
|
|
38001
|
+
return [2 /*return*/, {
|
|
38002
|
+
props: {},
|
|
38003
|
+
notFound: true,
|
|
38004
|
+
}];
|
|
38050
38005
|
}
|
|
38051
|
-
|
|
38052
|
-
|
|
38053
|
-
|
|
38054
|
-
|
|
38055
|
-
|
|
38056
|
-
|
|
38057
|
-
|
|
38058
|
-
defaultRoutingLocale = routing.locale;
|
|
38059
|
-
if (!isServer) return [3 /*break*/, 5];
|
|
38060
|
-
_d = {};
|
|
38061
|
-
_b = [{}];
|
|
38062
|
-
return [4 /*yield*/, serverSideTranslations(routing.locale, componentDirs, isLocal
|
|
38063
|
-
? undefined
|
|
38064
|
-
: {
|
|
38065
|
-
i18n: {
|
|
38066
|
-
locales: routingLocales,
|
|
38067
|
-
defaultLocale: defaultRoutingLocale,
|
|
38068
|
-
},
|
|
38069
|
-
serializeConfig: false,
|
|
38070
|
-
localePath: nextI18nConf.localePath,
|
|
38071
|
-
})];
|
|
38072
|
-
case 4: return [2 /*return*/, (_d.props = __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_f.sent())])), provider.nextPageData.props]),
|
|
38073
|
-
_d)];
|
|
38074
|
-
case 5:
|
|
38075
|
-
_e = {};
|
|
38076
|
-
_c = [{}];
|
|
38077
|
-
return [4 /*yield*/, serverSideTranslations(routing.locale, componentDirs, isLocal
|
|
38078
|
-
? undefined
|
|
38079
|
-
: {
|
|
38080
|
-
i18n: {
|
|
38081
|
-
locales: routingLocales,
|
|
38082
|
-
defaultLocale: defaultRoutingLocale,
|
|
38083
|
-
},
|
|
38084
|
-
serializeConfig: false,
|
|
38085
|
-
localePath: nextI18nConf.localePath,
|
|
38086
|
-
})];
|
|
38087
|
-
case 6: return [2 /*return*/, (_e.props = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), provider.nextPageData.props]),
|
|
38088
|
-
_e.revalidate = 60,
|
|
38089
|
-
_e)];
|
|
38006
|
+
if (isServer)
|
|
38007
|
+
return [2 /*return*/, provider.nextPageData];
|
|
38008
|
+
else
|
|
38009
|
+
return [2 /*return*/, {
|
|
38010
|
+
props: provider.nextPageData.props,
|
|
38011
|
+
revalidate: 60,
|
|
38012
|
+
}];
|
|
38090
38013
|
}
|
|
38091
38014
|
});
|
|
38092
38015
|
});
|
|
38093
38016
|
};
|
|
38094
|
-
SettingsHelper.getStaticProps = function (context, pageType, possiblePageTypes
|
|
38017
|
+
SettingsHelper.getStaticProps = function (context, pageType, possiblePageTypes) {
|
|
38095
38018
|
return __awaiter(this, void 0, void 0, function () {
|
|
38096
38019
|
return __generator(this, function (_a) {
|
|
38097
38020
|
switch (_a.label) {
|
|
38098
|
-
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType, possiblePageTypes
|
|
38021
|
+
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType, possiblePageTypes)];
|
|
38099
38022
|
case 1: return [2 /*return*/, _a.sent()];
|
|
38100
38023
|
}
|
|
38101
38024
|
});
|
|
@@ -38325,17 +38248,16 @@ var CheckoutPage = function (_a) {
|
|
|
38325
38248
|
};
|
|
38326
38249
|
var _id_ = observer(CheckoutPage);
|
|
38327
38250
|
var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38328
|
-
var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect, checkout, checkoutSettings
|
|
38329
|
-
var
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
switch (_d.label) {
|
|
38251
|
+
var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect, checkout, checkoutSettings;
|
|
38252
|
+
var _a;
|
|
38253
|
+
return __generator(this, function (_b) {
|
|
38254
|
+
switch (_b.label) {
|
|
38333
38255
|
case 0:
|
|
38334
38256
|
id = context.query.id;
|
|
38335
38257
|
locale = context.locale || context.defaultLocale || "en";
|
|
38336
38258
|
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
38337
38259
|
case 1:
|
|
38338
|
-
settings =
|
|
38260
|
+
settings = _b.sent();
|
|
38339
38261
|
// TODO maybe remove this and convert this page to static
|
|
38340
38262
|
if (!settings ||
|
|
38341
38263
|
!settings.storefront.mainStorefrontThemeId ||
|
|
@@ -38351,7 +38273,7 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
38351
38273
|
IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
|
|
38352
38274
|
IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
|
|
38353
38275
|
IkasStorefrontConfig.priceListId = routing.priceListId || undefined;
|
|
38354
|
-
IkasStorefrontConfig.stockLocationIds = (
|
|
38276
|
+
IkasStorefrontConfig.stockLocationIds = (_a = salesChannel.stockLocations) === null || _a === void 0 ? void 0 : _a.map(function (sl) { return sl.id; });
|
|
38355
38277
|
IkasStorefrontConfig.routings = storefront.routings;
|
|
38356
38278
|
IkasStorefrontConfig.paymentGateways = salesChannel.paymentGateways || [];
|
|
38357
38279
|
IkasStorefrontConfig.gtmId = storefront.gtmId || undefined;
|
|
@@ -38367,33 +38289,24 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
38367
38289
|
}
|
|
38368
38290
|
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
|
|
38369
38291
|
case 2:
|
|
38370
|
-
checkout =
|
|
38371
|
-
if (!checkout) return [3 /*break*/,
|
|
38292
|
+
checkout = _b.sent();
|
|
38293
|
+
if (!checkout) return [3 /*break*/, 4];
|
|
38372
38294
|
return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
|
|
38373
38295
|
case 3:
|
|
38374
|
-
checkoutSettings =
|
|
38375
|
-
|
|
38376
|
-
|
|
38377
|
-
|
|
38378
|
-
|
|
38379
|
-
|
|
38380
|
-
|
|
38381
|
-
|
|
38382
|
-
|
|
38383
|
-
|
|
38384
|
-
|
|
38385
|
-
|
|
38386
|
-
|
|
38387
|
-
|
|
38388
|
-
defaultLocale: defaultRoutingLocale,
|
|
38389
|
-
},
|
|
38390
|
-
serializeConfig: false,
|
|
38391
|
-
localePath: nextI18nConf.localePath,
|
|
38392
|
-
})];
|
|
38393
|
-
case 4: return [2 /*return*/, (_b.props = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_d.sent())])), { checkoutStr: JSON.stringify(checkout), checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
|
|
38394
|
-
: null, configJson: IkasStorefrontConfig.getJson(), returnPolicy: themeLocalization.returnPolicy || "", privacyPolicy: themeLocalization.privacyPolicy || "", termsOfService: themeLocalization.termsOfService || "", queryParams: context.query }]),
|
|
38395
|
-
_b)];
|
|
38396
|
-
case 5: return [2 /*return*/, redirect()];
|
|
38296
|
+
checkoutSettings = _b.sent();
|
|
38297
|
+
return [2 /*return*/, {
|
|
38298
|
+
props: {
|
|
38299
|
+
checkoutStr: JSON.stringify(checkout),
|
|
38300
|
+
checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
|
|
38301
|
+
: null,
|
|
38302
|
+
configJson: IkasStorefrontConfig.getJson(),
|
|
38303
|
+
returnPolicy: themeLocalization.returnPolicy || "",
|
|
38304
|
+
privacyPolicy: themeLocalization.privacyPolicy || "",
|
|
38305
|
+
termsOfService: themeLocalization.termsOfService || "",
|
|
38306
|
+
queryParams: context.query,
|
|
38307
|
+
},
|
|
38308
|
+
}];
|
|
38309
|
+
case 4: return [2 /*return*/, redirect()];
|
|
38397
38310
|
}
|
|
38398
38311
|
});
|
|
38399
38312
|
}); };
|
|
@@ -38628,19 +38541,10 @@ var IkasPageEditor$1 = dynamic(function () { return Promise.resolve().then(funct
|
|
|
38628
38541
|
var Page$c = function () {
|
|
38629
38542
|
return createElement(IkasPageEditor$1, null);
|
|
38630
38543
|
};
|
|
38631
|
-
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38632
|
-
return __generator(this, function (_a) {
|
|
38633
|
-
switch (_a.label) {
|
|
38634
|
-
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, undefined, undefined, true)];
|
|
38635
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
38636
|
-
}
|
|
38637
|
-
});
|
|
38638
|
-
}); };
|
|
38639
38544
|
var editor = observer(Page$c);
|
|
38640
38545
|
|
|
38641
38546
|
var editor$1 = /*#__PURE__*/Object.freeze({
|
|
38642
38547
|
__proto__: null,
|
|
38643
|
-
getStaticProps: getStaticProps$b,
|
|
38644
38548
|
'default': editor
|
|
38645
38549
|
});
|
|
38646
38550
|
|
|
@@ -38653,7 +38557,7 @@ var Page$d = function (_a) {
|
|
|
38653
38557
|
}, [propValuesStr]);
|
|
38654
38558
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
38655
38559
|
};
|
|
38656
|
-
var getStaticProps$
|
|
38560
|
+
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38657
38561
|
return __generator(this, function (_a) {
|
|
38658
38562
|
switch (_a.label) {
|
|
38659
38563
|
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.FAVORITE_PRODUCTS)];
|
|
@@ -38665,7 +38569,7 @@ var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38665
38569
|
var favoriteProducts = /*#__PURE__*/Object.freeze({
|
|
38666
38570
|
__proto__: null,
|
|
38667
38571
|
'default': Page$d,
|
|
38668
|
-
getStaticProps: getStaticProps$
|
|
38572
|
+
getStaticProps: getStaticProps$b
|
|
38669
38573
|
});
|
|
38670
38574
|
|
|
38671
38575
|
var Page$e = function (_a) {
|
|
@@ -38685,7 +38589,7 @@ var Page$e = function (_a) {
|
|
|
38685
38589
|
}, [isBrowser, propValuesStr]);
|
|
38686
38590
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
38687
38591
|
};
|
|
38688
|
-
var getStaticProps$
|
|
38592
|
+
var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38689
38593
|
return __generator(this, function (_a) {
|
|
38690
38594
|
switch (_a.label) {
|
|
38691
38595
|
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.SEARCH)];
|
|
@@ -38697,7 +38601,7 @@ var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38697
38601
|
var search = /*#__PURE__*/Object.freeze({
|
|
38698
38602
|
__proto__: null,
|
|
38699
38603
|
'default': Page$e,
|
|
38700
|
-
getStaticProps: getStaticProps$
|
|
38604
|
+
getStaticProps: getStaticProps$c
|
|
38701
38605
|
});
|
|
38702
38606
|
|
|
38703
38607
|
var Page$f = function (_a) {
|
|
@@ -38711,7 +38615,7 @@ var Page$f = function (_a) {
|
|
|
38711
38615
|
}, [propValuesStr]);
|
|
38712
38616
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
38713
38617
|
};
|
|
38714
|
-
var getStaticProps$
|
|
38618
|
+
var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38715
38619
|
var props;
|
|
38716
38620
|
return __generator(this, function (_a) {
|
|
38717
38621
|
switch (_a.label) {
|
|
@@ -38733,7 +38637,7 @@ var getStaticProps$e = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38733
38637
|
var _404 = /*#__PURE__*/Object.freeze({
|
|
38734
38638
|
__proto__: null,
|
|
38735
38639
|
'default': Page$f,
|
|
38736
|
-
getStaticProps: getStaticProps$
|
|
38640
|
+
getStaticProps: getStaticProps$d
|
|
38737
38641
|
});
|
|
38738
38642
|
|
|
38739
38643
|
var Page$g = function (_a) {
|
|
@@ -38745,7 +38649,7 @@ var Page$g = function (_a) {
|
|
|
38745
38649
|
}, [propValuesStr]);
|
|
38746
38650
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
38747
38651
|
};
|
|
38748
|
-
var getStaticProps$
|
|
38652
|
+
var getStaticProps$e = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38749
38653
|
return __generator(this, function (_a) {
|
|
38750
38654
|
switch (_a.label) {
|
|
38751
38655
|
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.BLOG_INDEX)];
|
|
@@ -38757,7 +38661,7 @@ var getStaticProps$f = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38757
38661
|
var index$5 = /*#__PURE__*/Object.freeze({
|
|
38758
38662
|
__proto__: null,
|
|
38759
38663
|
'default': Page$g,
|
|
38760
|
-
getStaticProps: getStaticProps$
|
|
38664
|
+
getStaticProps: getStaticProps$e
|
|
38761
38665
|
});
|
|
38762
38666
|
|
|
38763
38667
|
var Page$h = function (_a) {
|
|
@@ -38786,7 +38690,7 @@ var getStaticPaths$2 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38786
38690
|
}];
|
|
38787
38691
|
});
|
|
38788
38692
|
}); };
|
|
38789
|
-
var getStaticProps$
|
|
38693
|
+
var getStaticProps$f = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38790
38694
|
return __generator(this, function (_a) {
|
|
38791
38695
|
switch (_a.label) {
|
|
38792
38696
|
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, undefined, [
|
|
@@ -38802,7 +38706,7 @@ var _slug_$2 = /*#__PURE__*/Object.freeze({
|
|
|
38802
38706
|
__proto__: null,
|
|
38803
38707
|
'default': _slug_$1,
|
|
38804
38708
|
getStaticPaths: getStaticPaths$2,
|
|
38805
|
-
getStaticProps: getStaticProps$
|
|
38709
|
+
getStaticProps: getStaticProps$f
|
|
38806
38710
|
});
|
|
38807
38711
|
|
|
38808
38712
|
/**
|
package/build/index.js
CHANGED
|
@@ -11,7 +11,6 @@ var Link = require('next/link');
|
|
|
11
11
|
var NextImage = require('next/image');
|
|
12
12
|
var fs = require('fs');
|
|
13
13
|
var getConfig = require('next/config');
|
|
14
|
-
var serverSideTranslations = require('next-i18next/serverSideTranslations');
|
|
15
14
|
var dynamic = require('next/dynamic');
|
|
16
15
|
var Error$1 = require('next/error');
|
|
17
16
|
|
|
@@ -23554,11 +23553,11 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
23554
23553
|
}
|
|
23555
23554
|
});
|
|
23556
23555
|
}); };
|
|
23557
|
-
this.register = function (firstName, lastName, email, password
|
|
23556
|
+
this.register = function (firstName, lastName, email, password) { return __awaiter(_this, void 0, void 0, function () {
|
|
23558
23557
|
var response;
|
|
23559
23558
|
return __generator(this, function (_a) {
|
|
23560
23559
|
switch (_a.label) {
|
|
23561
|
-
case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName
|
|
23560
|
+
case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName)];
|
|
23562
23561
|
case 1:
|
|
23563
23562
|
response = _a.sent();
|
|
23564
23563
|
if (response) {
|
|
@@ -27607,7 +27606,6 @@ var ProductFilterSortTypeEnum;
|
|
|
27607
27606
|
(function (ProductFilterSortTypeEnum) {
|
|
27608
27607
|
ProductFilterSortTypeEnum["ALPHABETICAL_ASC"] = "ALPHABETICAL_ASC";
|
|
27609
27608
|
ProductFilterSortTypeEnum["ALPHABETICAL_DESC"] = "ALPHABETICAL_DESC";
|
|
27610
|
-
ProductFilterSortTypeEnum["CUSTOM_SORT"] = "CUSTOM_SORT";
|
|
27611
27609
|
ProductFilterSortTypeEnum["PRODUCT_COUNT_ASC"] = "PRODUCT_COUNT_ASC";
|
|
27612
27610
|
ProductFilterSortTypeEnum["PRODUCT_COUNT_DESC"] = "PRODUCT_COUNT_DESC";
|
|
27613
27611
|
})(ProductFilterSortTypeEnum || (ProductFilterSortTypeEnum = {}));
|
|
@@ -27654,7 +27652,6 @@ var SortByTypeEnum;
|
|
|
27654
27652
|
(function (SortByTypeEnum) {
|
|
27655
27653
|
SortByTypeEnum["CREATED_AT"] = "CREATED_AT";
|
|
27656
27654
|
SortByTypeEnum["DISCOUNT_RATIO"] = "DISCOUNT_RATIO";
|
|
27657
|
-
SortByTypeEnum["MANUAL_SORT"] = "MANUAL_SORT";
|
|
27658
27655
|
SortByTypeEnum["NAME"] = "NAME";
|
|
27659
27656
|
SortByTypeEnum["PRICE"] = "PRICE";
|
|
27660
27657
|
})(SortByTypeEnum || (SortByTypeEnum = {}));
|
|
@@ -29654,7 +29651,6 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29654
29651
|
lastName: "",
|
|
29655
29652
|
email: "",
|
|
29656
29653
|
password: "",
|
|
29657
|
-
isMarketingAccepted: false,
|
|
29658
29654
|
};
|
|
29659
29655
|
this.onFirstNameChange = function (value) {
|
|
29660
29656
|
_this.firstName = value;
|
|
@@ -29754,16 +29750,6 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29754
29750
|
enumerable: false,
|
|
29755
29751
|
configurable: true
|
|
29756
29752
|
});
|
|
29757
|
-
Object.defineProperty(RegisterForm.prototype, "isMarketingAccepted", {
|
|
29758
|
-
get: function () {
|
|
29759
|
-
return this.model.isMarketingAccepted;
|
|
29760
|
-
},
|
|
29761
|
-
set: function (value) {
|
|
29762
|
-
this.model.isMarketingAccepted = value;
|
|
29763
|
-
},
|
|
29764
|
-
enumerable: false,
|
|
29765
|
-
configurable: true
|
|
29766
|
-
});
|
|
29767
29753
|
Object.defineProperty(RegisterForm.prototype, "hasError", {
|
|
29768
29754
|
get: function () {
|
|
29769
29755
|
return this.validator.hasError;
|
|
@@ -29829,7 +29815,7 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29829
29815
|
_b.label = 2;
|
|
29830
29816
|
case 2:
|
|
29831
29817
|
_b.trys.push([2, 4, , 5]);
|
|
29832
|
-
return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password
|
|
29818
|
+
return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password)];
|
|
29833
29819
|
case 3:
|
|
29834
29820
|
isRegisterSuccess = _b.sent();
|
|
29835
29821
|
if (isRegisterSuccess) {
|
|
@@ -34343,13 +34329,13 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
34343
34329
|
});
|
|
34344
34330
|
});
|
|
34345
34331
|
};
|
|
34346
|
-
IkasCustomerAPI.register = function (email, password, firstName, lastName
|
|
34332
|
+
IkasCustomerAPI.register = function (email, password, firstName, lastName) {
|
|
34347
34333
|
return __awaiter(this, void 0, void 0, function () {
|
|
34348
34334
|
var MUTATION, _a, data, errors, err_2;
|
|
34349
34335
|
return __generator(this, function (_b) {
|
|
34350
34336
|
switch (_b.label) {
|
|
34351
34337
|
case 0:
|
|
34352
|
-
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n
|
|
34338
|
+
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
|
|
34353
34339
|
_b.label = 1;
|
|
34354
34340
|
case 1:
|
|
34355
34341
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -34362,7 +34348,6 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
34362
34348
|
password: password,
|
|
34363
34349
|
firstName: firstName,
|
|
34364
34350
|
lastName: lastName,
|
|
34365
|
-
isAcceptMarketing: isAcceptMarketing,
|
|
34366
34351
|
},
|
|
34367
34352
|
})];
|
|
34368
34353
|
case 2:
|
|
@@ -37659,30 +37644,6 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
37659
37644
|
Image: Image
|
|
37660
37645
|
});
|
|
37661
37646
|
|
|
37662
|
-
/**
|
|
37663
|
-
* Creates a duplicate-free version of an array, using
|
|
37664
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
37665
|
-
* for equality comparisons, in which only the first occurrence of each element
|
|
37666
|
-
* is kept. The order of result values is determined by the order they occur
|
|
37667
|
-
* in the array.
|
|
37668
|
-
*
|
|
37669
|
-
* @static
|
|
37670
|
-
* @memberOf _
|
|
37671
|
-
* @since 0.1.0
|
|
37672
|
-
* @category Array
|
|
37673
|
-
* @param {Array} array The array to inspect.
|
|
37674
|
-
* @returns {Array} Returns the new duplicate free array.
|
|
37675
|
-
* @example
|
|
37676
|
-
*
|
|
37677
|
-
* _.uniq([2, 1, 2]);
|
|
37678
|
-
* // => [2, 1]
|
|
37679
|
-
*/
|
|
37680
|
-
function uniq(array) {
|
|
37681
|
-
return (array && array.length) ? _baseUniq(array) : [];
|
|
37682
|
-
}
|
|
37683
|
-
|
|
37684
|
-
var uniq_1 = uniq;
|
|
37685
|
-
|
|
37686
37647
|
var IkasStorefrontLocalization = /** @class */ (function () {
|
|
37687
37648
|
function IkasStorefrontLocalization(data) {
|
|
37688
37649
|
this.id = data.id || "";
|
|
@@ -37921,7 +37882,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37921
37882
|
id: storefront.salesChannelId,
|
|
37922
37883
|
}),
|
|
37923
37884
|
routing: storefront.routings.length
|
|
37924
|
-
? storefront.routings.find(function (r) { return
|
|
37885
|
+
? storefront.routings.find(function (r) { return !r.path && !r.domain; }) ||
|
|
37925
37886
|
storefront.routings[0]
|
|
37926
37887
|
: new IkasStorefrontRouting({}),
|
|
37927
37888
|
favicon: localTheme.settings.favicon,
|
|
@@ -37969,13 +37930,12 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37969
37930
|
});
|
|
37970
37931
|
}); });
|
|
37971
37932
|
};
|
|
37972
|
-
SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes
|
|
37933
|
+
SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes) {
|
|
37973
37934
|
var _a;
|
|
37974
37935
|
return __awaiter(this, void 0, void 0, function () {
|
|
37975
|
-
var isLocal, locale,
|
|
37976
|
-
|
|
37977
|
-
|
|
37978
|
-
switch (_f.label) {
|
|
37936
|
+
var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider;
|
|
37937
|
+
return __generator(this, function (_b) {
|
|
37938
|
+
switch (_b.label) {
|
|
37979
37939
|
case 0:
|
|
37980
37940
|
isLocal = process.env.NEXT_PUBLIC_ENV === "local";
|
|
37981
37941
|
locale = isLocal ? "en" : context.locale;
|
|
@@ -37985,10 +37945,9 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37985
37945
|
notFound: true,
|
|
37986
37946
|
}];
|
|
37987
37947
|
}
|
|
37988
|
-
serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
|
|
37989
37948
|
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
37990
37949
|
case 1:
|
|
37991
|
-
settings =
|
|
37950
|
+
settings = _b.sent();
|
|
37992
37951
|
if (!settings ||
|
|
37993
37952
|
!settings.storefront.mainStorefrontThemeId ||
|
|
37994
37953
|
!settings.storefront.salesChannelId) {
|
|
@@ -38012,67 +37971,31 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
38012
37971
|
IkasStorefrontConfig.stockPreference = stockPreference || null;
|
|
38013
37972
|
provider = new IkasPageDataProvider(themeLocalization.themeJson, context.params, pageType);
|
|
38014
37973
|
provider.possiblePageTypes = possiblePageTypes;
|
|
38015
|
-
if (!!isEditor) return [3 /*break*/, 3];
|
|
38016
37974
|
return [4 /*yield*/, provider.getPageData()];
|
|
38017
37975
|
case 2:
|
|
38018
|
-
|
|
38019
|
-
_f.label = 3;
|
|
38020
|
-
case 3:
|
|
37976
|
+
_b.sent();
|
|
38021
37977
|
if (!provider.page) {
|
|
38022
|
-
|
|
38023
|
-
|
|
38024
|
-
|
|
38025
|
-
|
|
38026
|
-
}];
|
|
37978
|
+
return [2 /*return*/, {
|
|
37979
|
+
props: {},
|
|
37980
|
+
notFound: true,
|
|
37981
|
+
}];
|
|
38027
37982
|
}
|
|
38028
|
-
|
|
38029
|
-
|
|
38030
|
-
|
|
38031
|
-
|
|
38032
|
-
|
|
38033
|
-
|
|
38034
|
-
|
|
38035
|
-
defaultRoutingLocale = routing.locale;
|
|
38036
|
-
if (!isServer) return [3 /*break*/, 5];
|
|
38037
|
-
_d = {};
|
|
38038
|
-
_b = [{}];
|
|
38039
|
-
return [4 /*yield*/, serverSideTranslations.serverSideTranslations(routing.locale, componentDirs, isLocal
|
|
38040
|
-
? undefined
|
|
38041
|
-
: {
|
|
38042
|
-
i18n: {
|
|
38043
|
-
locales: routingLocales,
|
|
38044
|
-
defaultLocale: defaultRoutingLocale,
|
|
38045
|
-
},
|
|
38046
|
-
serializeConfig: false,
|
|
38047
|
-
localePath: nextI18nConf.localePath,
|
|
38048
|
-
})];
|
|
38049
|
-
case 4: return [2 /*return*/, (_d.props = __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_f.sent())])), provider.nextPageData.props]),
|
|
38050
|
-
_d)];
|
|
38051
|
-
case 5:
|
|
38052
|
-
_e = {};
|
|
38053
|
-
_c = [{}];
|
|
38054
|
-
return [4 /*yield*/, serverSideTranslations.serverSideTranslations(routing.locale, componentDirs, isLocal
|
|
38055
|
-
? undefined
|
|
38056
|
-
: {
|
|
38057
|
-
i18n: {
|
|
38058
|
-
locales: routingLocales,
|
|
38059
|
-
defaultLocale: defaultRoutingLocale,
|
|
38060
|
-
},
|
|
38061
|
-
serializeConfig: false,
|
|
38062
|
-
localePath: nextI18nConf.localePath,
|
|
38063
|
-
})];
|
|
38064
|
-
case 6: return [2 /*return*/, (_e.props = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), provider.nextPageData.props]),
|
|
38065
|
-
_e.revalidate = 60,
|
|
38066
|
-
_e)];
|
|
37983
|
+
if (isServer)
|
|
37984
|
+
return [2 /*return*/, provider.nextPageData];
|
|
37985
|
+
else
|
|
37986
|
+
return [2 /*return*/, {
|
|
37987
|
+
props: provider.nextPageData.props,
|
|
37988
|
+
revalidate: 60,
|
|
37989
|
+
}];
|
|
38067
37990
|
}
|
|
38068
37991
|
});
|
|
38069
37992
|
});
|
|
38070
37993
|
};
|
|
38071
|
-
SettingsHelper.getStaticProps = function (context, pageType, possiblePageTypes
|
|
37994
|
+
SettingsHelper.getStaticProps = function (context, pageType, possiblePageTypes) {
|
|
38072
37995
|
return __awaiter(this, void 0, void 0, function () {
|
|
38073
37996
|
return __generator(this, function (_a) {
|
|
38074
37997
|
switch (_a.label) {
|
|
38075
|
-
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType, possiblePageTypes
|
|
37998
|
+
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType, possiblePageTypes)];
|
|
38076
37999
|
case 1: return [2 /*return*/, _a.sent()];
|
|
38077
38000
|
}
|
|
38078
38001
|
});
|
|
@@ -38302,17 +38225,16 @@ var CheckoutPage = function (_a) {
|
|
|
38302
38225
|
};
|
|
38303
38226
|
var _id_ = mobxReactLite.observer(CheckoutPage);
|
|
38304
38227
|
var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38305
|
-
var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect, checkout, checkoutSettings
|
|
38306
|
-
var
|
|
38307
|
-
|
|
38308
|
-
|
|
38309
|
-
switch (_d.label) {
|
|
38228
|
+
var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect, checkout, checkoutSettings;
|
|
38229
|
+
var _a;
|
|
38230
|
+
return __generator(this, function (_b) {
|
|
38231
|
+
switch (_b.label) {
|
|
38310
38232
|
case 0:
|
|
38311
38233
|
id = context.query.id;
|
|
38312
38234
|
locale = context.locale || context.defaultLocale || "en";
|
|
38313
38235
|
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
38314
38236
|
case 1:
|
|
38315
|
-
settings =
|
|
38237
|
+
settings = _b.sent();
|
|
38316
38238
|
// TODO maybe remove this and convert this page to static
|
|
38317
38239
|
if (!settings ||
|
|
38318
38240
|
!settings.storefront.mainStorefrontThemeId ||
|
|
@@ -38328,7 +38250,7 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
38328
38250
|
IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
|
|
38329
38251
|
IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
|
|
38330
38252
|
IkasStorefrontConfig.priceListId = routing.priceListId || undefined;
|
|
38331
|
-
IkasStorefrontConfig.stockLocationIds = (
|
|
38253
|
+
IkasStorefrontConfig.stockLocationIds = (_a = salesChannel.stockLocations) === null || _a === void 0 ? void 0 : _a.map(function (sl) { return sl.id; });
|
|
38332
38254
|
IkasStorefrontConfig.routings = storefront.routings;
|
|
38333
38255
|
IkasStorefrontConfig.paymentGateways = salesChannel.paymentGateways || [];
|
|
38334
38256
|
IkasStorefrontConfig.gtmId = storefront.gtmId || undefined;
|
|
@@ -38344,33 +38266,24 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
38344
38266
|
}
|
|
38345
38267
|
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
|
|
38346
38268
|
case 2:
|
|
38347
|
-
checkout =
|
|
38348
|
-
if (!checkout) return [3 /*break*/,
|
|
38269
|
+
checkout = _b.sent();
|
|
38270
|
+
if (!checkout) return [3 /*break*/, 4];
|
|
38349
38271
|
return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
|
|
38350
38272
|
case 3:
|
|
38351
|
-
checkoutSettings =
|
|
38352
|
-
|
|
38353
|
-
|
|
38354
|
-
|
|
38355
|
-
|
|
38356
|
-
|
|
38357
|
-
|
|
38358
|
-
|
|
38359
|
-
|
|
38360
|
-
|
|
38361
|
-
|
|
38362
|
-
|
|
38363
|
-
|
|
38364
|
-
|
|
38365
|
-
defaultLocale: defaultRoutingLocale,
|
|
38366
|
-
},
|
|
38367
|
-
serializeConfig: false,
|
|
38368
|
-
localePath: nextI18nConf.localePath,
|
|
38369
|
-
})];
|
|
38370
|
-
case 4: return [2 /*return*/, (_b.props = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_d.sent())])), { checkoutStr: JSON.stringify(checkout), checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
|
|
38371
|
-
: null, configJson: IkasStorefrontConfig.getJson(), returnPolicy: themeLocalization.returnPolicy || "", privacyPolicy: themeLocalization.privacyPolicy || "", termsOfService: themeLocalization.termsOfService || "", queryParams: context.query }]),
|
|
38372
|
-
_b)];
|
|
38373
|
-
case 5: return [2 /*return*/, redirect()];
|
|
38273
|
+
checkoutSettings = _b.sent();
|
|
38274
|
+
return [2 /*return*/, {
|
|
38275
|
+
props: {
|
|
38276
|
+
checkoutStr: JSON.stringify(checkout),
|
|
38277
|
+
checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
|
|
38278
|
+
: null,
|
|
38279
|
+
configJson: IkasStorefrontConfig.getJson(),
|
|
38280
|
+
returnPolicy: themeLocalization.returnPolicy || "",
|
|
38281
|
+
privacyPolicy: themeLocalization.privacyPolicy || "",
|
|
38282
|
+
termsOfService: themeLocalization.termsOfService || "",
|
|
38283
|
+
queryParams: context.query,
|
|
38284
|
+
},
|
|
38285
|
+
}];
|
|
38286
|
+
case 4: return [2 /*return*/, redirect()];
|
|
38374
38287
|
}
|
|
38375
38288
|
});
|
|
38376
38289
|
}); };
|
|
@@ -38605,19 +38518,10 @@ var IkasPageEditor$1 = dynamic__default['default'](function () { return Promise.
|
|
|
38605
38518
|
var Page$c = function () {
|
|
38606
38519
|
return React.createElement(IkasPageEditor$1, null);
|
|
38607
38520
|
};
|
|
38608
|
-
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38609
|
-
return __generator(this, function (_a) {
|
|
38610
|
-
switch (_a.label) {
|
|
38611
|
-
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, undefined, undefined, true)];
|
|
38612
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
38613
|
-
}
|
|
38614
|
-
});
|
|
38615
|
-
}); };
|
|
38616
38521
|
var editor = mobxReactLite.observer(Page$c);
|
|
38617
38522
|
|
|
38618
38523
|
var editor$1 = /*#__PURE__*/Object.freeze({
|
|
38619
38524
|
__proto__: null,
|
|
38620
|
-
getStaticProps: getStaticProps$b,
|
|
38621
38525
|
'default': editor
|
|
38622
38526
|
});
|
|
38623
38527
|
|
|
@@ -38630,7 +38534,7 @@ var Page$d = function (_a) {
|
|
|
38630
38534
|
}, [propValuesStr]);
|
|
38631
38535
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
38632
38536
|
};
|
|
38633
|
-
var getStaticProps$
|
|
38537
|
+
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38634
38538
|
return __generator(this, function (_a) {
|
|
38635
38539
|
switch (_a.label) {
|
|
38636
38540
|
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.FAVORITE_PRODUCTS)];
|
|
@@ -38642,7 +38546,7 @@ var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38642
38546
|
var favoriteProducts = /*#__PURE__*/Object.freeze({
|
|
38643
38547
|
__proto__: null,
|
|
38644
38548
|
'default': Page$d,
|
|
38645
|
-
getStaticProps: getStaticProps$
|
|
38549
|
+
getStaticProps: getStaticProps$b
|
|
38646
38550
|
});
|
|
38647
38551
|
|
|
38648
38552
|
var Page$e = function (_a) {
|
|
@@ -38662,7 +38566,7 @@ var Page$e = function (_a) {
|
|
|
38662
38566
|
}, [isBrowser, propValuesStr]);
|
|
38663
38567
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
38664
38568
|
};
|
|
38665
|
-
var getStaticProps$
|
|
38569
|
+
var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38666
38570
|
return __generator(this, function (_a) {
|
|
38667
38571
|
switch (_a.label) {
|
|
38668
38572
|
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.SEARCH)];
|
|
@@ -38674,7 +38578,7 @@ var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38674
38578
|
var search = /*#__PURE__*/Object.freeze({
|
|
38675
38579
|
__proto__: null,
|
|
38676
38580
|
'default': Page$e,
|
|
38677
|
-
getStaticProps: getStaticProps$
|
|
38581
|
+
getStaticProps: getStaticProps$c
|
|
38678
38582
|
});
|
|
38679
38583
|
|
|
38680
38584
|
var Page$f = function (_a) {
|
|
@@ -38688,7 +38592,7 @@ var Page$f = function (_a) {
|
|
|
38688
38592
|
}, [propValuesStr]);
|
|
38689
38593
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
38690
38594
|
};
|
|
38691
|
-
var getStaticProps$
|
|
38595
|
+
var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38692
38596
|
var props;
|
|
38693
38597
|
return __generator(this, function (_a) {
|
|
38694
38598
|
switch (_a.label) {
|
|
@@ -38710,7 +38614,7 @@ var getStaticProps$e = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38710
38614
|
var _404 = /*#__PURE__*/Object.freeze({
|
|
38711
38615
|
__proto__: null,
|
|
38712
38616
|
'default': Page$f,
|
|
38713
|
-
getStaticProps: getStaticProps$
|
|
38617
|
+
getStaticProps: getStaticProps$d
|
|
38714
38618
|
});
|
|
38715
38619
|
|
|
38716
38620
|
var Page$g = function (_a) {
|
|
@@ -38722,7 +38626,7 @@ var Page$g = function (_a) {
|
|
|
38722
38626
|
}, [propValuesStr]);
|
|
38723
38627
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
38724
38628
|
};
|
|
38725
|
-
var getStaticProps$
|
|
38629
|
+
var getStaticProps$e = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38726
38630
|
return __generator(this, function (_a) {
|
|
38727
38631
|
switch (_a.label) {
|
|
38728
38632
|
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.BLOG_INDEX)];
|
|
@@ -38734,7 +38638,7 @@ var getStaticProps$f = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38734
38638
|
var index$5 = /*#__PURE__*/Object.freeze({
|
|
38735
38639
|
__proto__: null,
|
|
38736
38640
|
'default': Page$g,
|
|
38737
|
-
getStaticProps: getStaticProps$
|
|
38641
|
+
getStaticProps: getStaticProps$e
|
|
38738
38642
|
});
|
|
38739
38643
|
|
|
38740
38644
|
var Page$h = function (_a) {
|
|
@@ -38763,7 +38667,7 @@ var getStaticPaths$2 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
38763
38667
|
}];
|
|
38764
38668
|
});
|
|
38765
38669
|
}); };
|
|
38766
|
-
var getStaticProps$
|
|
38670
|
+
var getStaticProps$f = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38767
38671
|
return __generator(this, function (_a) {
|
|
38768
38672
|
switch (_a.label) {
|
|
38769
38673
|
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, undefined, [
|
|
@@ -38779,7 +38683,7 @@ var _slug_$2 = /*#__PURE__*/Object.freeze({
|
|
|
38779
38683
|
__proto__: null,
|
|
38780
38684
|
'default': _slug_$1,
|
|
38781
38685
|
getStaticPaths: getStaticPaths$2,
|
|
38782
|
-
getStaticProps: getStaticProps$
|
|
38686
|
+
getStaticProps: getStaticProps$f
|
|
38783
38687
|
});
|
|
38784
38688
|
|
|
38785
38689
|
/**
|
|
@@ -12,7 +12,6 @@ declare type RegisterFormModel = {
|
|
|
12
12
|
lastName: string;
|
|
13
13
|
email: string;
|
|
14
14
|
password: string;
|
|
15
|
-
isMarketingAccepted?: boolean;
|
|
16
15
|
};
|
|
17
16
|
export declare class RegisterForm {
|
|
18
17
|
private model;
|
|
@@ -27,8 +26,6 @@ export declare class RegisterForm {
|
|
|
27
26
|
set email(value: string);
|
|
28
27
|
get password(): string;
|
|
29
28
|
set password(value: string);
|
|
30
|
-
get isMarketingAccepted(): boolean | undefined;
|
|
31
|
-
set isMarketingAccepted(value: boolean | undefined);
|
|
32
29
|
get hasError(): boolean;
|
|
33
30
|
get firstNameErrorMessage(): string | undefined;
|
|
34
31
|
get lastNameErrorMessage(): string | undefined;
|
package/build/pages/editor.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class IkasCustomerStore {
|
|
|
15
15
|
get canCreateEmailSubscription(): boolean;
|
|
16
16
|
get customerConsentGranted(): boolean;
|
|
17
17
|
login: (email: string, password: string) => Promise<boolean>;
|
|
18
|
-
register: (firstName: string, lastName: string, email: string, password: string
|
|
18
|
+
register: (firstName: string, lastName: string, email: string, password: string) => Promise<boolean>;
|
|
19
19
|
saveContactForm: (input: SaveContactForm) => Promise<boolean | undefined>;
|
|
20
20
|
checkEmail: (email: string) => Promise<boolean>;
|
|
21
21
|
forgotPassword: (email: string) => Promise<boolean>;
|
|
@@ -12,11 +12,7 @@ export declare class SettingsHelper {
|
|
|
12
12
|
static readLocalTheme(): Promise<IkasTheme>;
|
|
13
13
|
static readSettingsFile(): Promise<any>;
|
|
14
14
|
static getSettings(locale: string): Promise<SettingsData | null>;
|
|
15
|
-
static getPageData(context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>, isServer: boolean, pageType?: IkasThemePageType, possiblePageTypes?: IkasThemePageType[]
|
|
16
|
-
props: {};
|
|
17
|
-
notFound: boolean;
|
|
18
|
-
revalidate?: undefined;
|
|
19
|
-
} | {
|
|
15
|
+
static getPageData(context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>, isServer: boolean, pageType?: IkasThemePageType, possiblePageTypes?: IkasThemePageType[]): Promise<{
|
|
20
16
|
props: {
|
|
21
17
|
propValuesStr: string;
|
|
22
18
|
pageSpecificDataStr: string;
|
|
@@ -37,13 +33,10 @@ export declare class SettingsHelper {
|
|
|
37
33
|
favicon: any;
|
|
38
34
|
stockPreference: IkasThemeStockPreference;
|
|
39
35
|
};
|
|
40
|
-
_nextI18Next: {
|
|
41
|
-
initialI18nStore: any;
|
|
42
|
-
initialLocale: string;
|
|
43
|
-
userConfig: import("next-i18next").UserConfig | null;
|
|
44
|
-
};
|
|
45
36
|
};
|
|
46
|
-
|
|
37
|
+
} | {
|
|
38
|
+
props: {};
|
|
39
|
+
notFound: boolean;
|
|
47
40
|
revalidate?: undefined;
|
|
48
41
|
} | {
|
|
49
42
|
props: {
|
|
@@ -66,20 +59,11 @@ export declare class SettingsHelper {
|
|
|
66
59
|
favicon: any;
|
|
67
60
|
stockPreference: IkasThemeStockPreference;
|
|
68
61
|
};
|
|
69
|
-
_nextI18Next: {
|
|
70
|
-
initialI18nStore: any;
|
|
71
|
-
initialLocale: string;
|
|
72
|
-
userConfig: import("next-i18next").UserConfig | null;
|
|
73
|
-
};
|
|
74
62
|
};
|
|
75
63
|
revalidate: number;
|
|
76
64
|
notFound?: undefined;
|
|
77
65
|
}>;
|
|
78
|
-
static getStaticProps(context: GetStaticPropsContext<ParsedUrlQuery>, pageType?: IkasThemePageType, possiblePageTypes?: IkasThemePageType[]
|
|
79
|
-
props: {};
|
|
80
|
-
notFound: boolean;
|
|
81
|
-
revalidate?: undefined;
|
|
82
|
-
} | {
|
|
66
|
+
static getStaticProps(context: GetStaticPropsContext<ParsedUrlQuery>, pageType?: IkasThemePageType, possiblePageTypes?: IkasThemePageType[]): Promise<{
|
|
83
67
|
props: {
|
|
84
68
|
propValuesStr: string;
|
|
85
69
|
pageSpecificDataStr: string;
|
|
@@ -100,13 +84,10 @@ export declare class SettingsHelper {
|
|
|
100
84
|
favicon: any;
|
|
101
85
|
stockPreference: IkasThemeStockPreference;
|
|
102
86
|
};
|
|
103
|
-
_nextI18Next: {
|
|
104
|
-
initialI18nStore: any;
|
|
105
|
-
initialLocale: string;
|
|
106
|
-
userConfig: import("next-i18next").UserConfig | null;
|
|
107
|
-
};
|
|
108
87
|
};
|
|
109
|
-
|
|
88
|
+
} | {
|
|
89
|
+
props: {};
|
|
90
|
+
notFound: boolean;
|
|
110
91
|
revalidate?: undefined;
|
|
111
92
|
} | {
|
|
112
93
|
props: {
|
|
@@ -129,20 +110,11 @@ export declare class SettingsHelper {
|
|
|
129
110
|
favicon: any;
|
|
130
111
|
stockPreference: IkasThemeStockPreference;
|
|
131
112
|
};
|
|
132
|
-
_nextI18Next: {
|
|
133
|
-
initialI18nStore: any;
|
|
134
|
-
initialLocale: string;
|
|
135
|
-
userConfig: import("next-i18next").UserConfig | null;
|
|
136
|
-
};
|
|
137
113
|
};
|
|
138
114
|
revalidate: number;
|
|
139
115
|
notFound?: undefined;
|
|
140
116
|
}>;
|
|
141
117
|
static getServerSideProps(context: GetServerSidePropsContext<ParsedUrlQuery>, pageType?: IkasThemePageType): Promise<{
|
|
142
|
-
props: {};
|
|
143
|
-
notFound: boolean;
|
|
144
|
-
revalidate?: undefined;
|
|
145
|
-
} | {
|
|
146
118
|
props: {
|
|
147
119
|
propValuesStr: string;
|
|
148
120
|
pageSpecificDataStr: string;
|
|
@@ -163,13 +135,10 @@ export declare class SettingsHelper {
|
|
|
163
135
|
favicon: any;
|
|
164
136
|
stockPreference: IkasThemeStockPreference;
|
|
165
137
|
};
|
|
166
|
-
_nextI18Next: {
|
|
167
|
-
initialI18nStore: any;
|
|
168
|
-
initialLocale: string;
|
|
169
|
-
userConfig: import("next-i18next").UserConfig | null;
|
|
170
|
-
};
|
|
171
138
|
};
|
|
172
|
-
|
|
139
|
+
} | {
|
|
140
|
+
props: {};
|
|
141
|
+
notFound: boolean;
|
|
173
142
|
revalidate?: undefined;
|
|
174
143
|
} | {
|
|
175
144
|
props: {
|
|
@@ -192,11 +161,6 @@ export declare class SettingsHelper {
|
|
|
192
161
|
favicon: any;
|
|
193
162
|
stockPreference: IkasThemeStockPreference;
|
|
194
163
|
};
|
|
195
|
-
_nextI18Next: {
|
|
196
|
-
initialI18nStore: any;
|
|
197
|
-
initialLocale: string;
|
|
198
|
-
userConfig: import("next-i18next").UserConfig | null;
|
|
199
|
-
};
|
|
200
164
|
};
|
|
201
165
|
revalidate: number;
|
|
202
166
|
notFound?: undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "0.0.161-alpha.
|
|
3
|
+
"version": "0.0.161-alpha.2",
|
|
4
4
|
"main": "./build/index.js",
|
|
5
5
|
"module": "./build/index.es.js",
|
|
6
6
|
"author": "Umut Ozan Yıldırım",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"mobx": "^6.1.3",
|
|
20
20
|
"mobx-react-lite": "^3.1.5",
|
|
21
21
|
"next": "10.0.6",
|
|
22
|
-
"next-i18next": "^8.5.5",
|
|
23
22
|
"react": "17.0.1",
|
|
24
23
|
"react-dom": "17.0.1"
|
|
25
24
|
},
|
|
@@ -71,7 +70,6 @@
|
|
|
71
70
|
"mobx": "^6.1.3",
|
|
72
71
|
"mobx-react-lite": "^3.1.5",
|
|
73
72
|
"next": "10.0.6",
|
|
74
|
-
"next-i18next": "^8.5.5",
|
|
75
73
|
"node-sass": "^5.0.0",
|
|
76
74
|
"postcss": "^8.2.4",
|
|
77
75
|
"prettier": "^2.2.1",
|