@ikas/storefront 0.2.0-alpha.10 → 0.2.0-alpha.12
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/api/checkout/__generated__/getCheckoutById.d.ts +4 -0
- package/build/api/checkout/__generated__/listPaymentGateway.d.ts +3 -1
- package/build/api/customer/__generated__/customerForgotPassword.d.ts +1 -0
- package/build/api/customer/__generated__/registerCustomer.d.ts +1 -0
- package/build/components/page/index.d.ts +0 -1
- package/build/index.es.js +246 -41
- package/build/index.js +246 -42
- package/build/models/data/cart/index.d.ts +1 -0
- package/build/models/data/index.d.ts +1 -1
- package/build/models/data/order/index.d.ts +1 -0
- package/build/models/data/order/line-item/index.d.ts +1 -0
- package/build/models/data/order-transaction/index.d.ts +1 -0
- package/build/models/data/product/variant/price/index.d.ts +1 -0
- package/build/models/data/product-option-set/index.d.ts +1 -1
- package/build/pages/editor.d.ts +0 -1
- package/build/pages/index.d.ts +20 -19
- package/build/providers/page-data-init.d.ts +1 -1
- package/build/providers/prop-value/checkout.d.ts +4 -0
- package/build/storefront/index.d.ts +2 -2
- package/build/utils/currency.d.ts +6 -0
- package/package.json +2 -5
|
@@ -18,6 +18,8 @@ export interface getCheckoutById_getCheckoutById_billingAddress_country {
|
|
|
18
18
|
code: string | null;
|
|
19
19
|
id: string | null;
|
|
20
20
|
name: string;
|
|
21
|
+
iso2: string | null;
|
|
22
|
+
iso3: string | null;
|
|
21
23
|
}
|
|
22
24
|
export interface getCheckoutById_getCheckoutById_billingAddress_district {
|
|
23
25
|
__typename: "OrderAddressDistrict";
|
|
@@ -69,6 +71,8 @@ export interface getCheckoutById_getCheckoutById_shippingAddress_country {
|
|
|
69
71
|
id: string | null;
|
|
70
72
|
code: string | null;
|
|
71
73
|
name: string;
|
|
74
|
+
iso2: string | null;
|
|
75
|
+
iso3: string | null;
|
|
72
76
|
}
|
|
73
77
|
export interface getCheckoutById_getCheckoutById_shippingAddress_district {
|
|
74
78
|
__typename: "OrderAddressDistrict";
|
|
@@ -14,7 +14,7 @@ export interface listPaymentGateway_listPaymentGateway_additionalPrices {
|
|
|
14
14
|
export interface listPaymentGateway_listPaymentGateway_translations {
|
|
15
15
|
__typename: "PaymentGatewayTranslation";
|
|
16
16
|
description: string | null;
|
|
17
|
-
locale: string;
|
|
17
|
+
locale: string | null;
|
|
18
18
|
name: string | null;
|
|
19
19
|
}
|
|
20
20
|
export interface listPaymentGateway_listPaymentGateway {
|
|
@@ -30,6 +30,8 @@ export interface listPaymentGateway_listPaymentGateway {
|
|
|
30
30
|
logoUrl: string | null;
|
|
31
31
|
additionalPrices: listPaymentGateway_listPaymentGateway_additionalPrices[] | null;
|
|
32
32
|
translations: listPaymentGateway_listPaymentGateway_translations[] | null;
|
|
33
|
+
supportedCurrencies: string[] | null;
|
|
34
|
+
availableCountries: string[] | null;
|
|
33
35
|
}
|
|
34
36
|
export interface listPaymentGateway {
|
|
35
37
|
listPaymentGateway: listPaymentGateway_listPaymentGateway[];
|
|
@@ -12,7 +12,6 @@ export declare type IkasPageProps = {
|
|
|
12
12
|
configJson: Record<string, any>;
|
|
13
13
|
reInitOnBrowser?: boolean;
|
|
14
14
|
addOgpMetas?: boolean;
|
|
15
|
-
components?: Record<string, any>;
|
|
16
15
|
};
|
|
17
16
|
export declare const IkasPage: React.FC<IkasPageProps>;
|
|
18
17
|
export declare const renderComponent: (pageComponentPropValue: IkasPageComponentPropValue, settings: IkasThemeSettings, index: number) => JSX.Element;
|
package/build/index.es.js
CHANGED
|
@@ -10952,8 +10952,9 @@ function setContext(setter) {
|
|
|
10952
10952
|
var IkasStorefrontConfig = /** @class */ (function () {
|
|
10953
10953
|
function IkasStorefrontConfig() {
|
|
10954
10954
|
}
|
|
10955
|
-
IkasStorefrontConfig.init = function (store, config, apiUrlOverride) {
|
|
10955
|
+
IkasStorefrontConfig.init = function (store, components, config, apiUrlOverride) {
|
|
10956
10956
|
IkasStorefrontConfig.store = store;
|
|
10957
|
+
IkasStorefrontConfig.components = components;
|
|
10957
10958
|
IkasStorefrontConfig.config = config;
|
|
10958
10959
|
IkasStorefrontConfig.apiUrlOverride = apiUrlOverride || null;
|
|
10959
10960
|
if (process.env.NEXT_PUBLIC_ENV === "local") {
|
|
@@ -11000,6 +11001,7 @@ var IkasStorefrontConfig = /** @class */ (function () {
|
|
|
11000
11001
|
: null,
|
|
11001
11002
|
};
|
|
11002
11003
|
};
|
|
11004
|
+
IkasStorefrontConfig.components = {};
|
|
11003
11005
|
IkasStorefrontConfig.config = {};
|
|
11004
11006
|
IkasStorefrontConfig.apiUrlOverride = null;
|
|
11005
11007
|
IkasStorefrontConfig.routings = [];
|
|
@@ -12092,15 +12094,214 @@ function tryForEach(items, callback, printErrors) {
|
|
|
12092
12094
|
});
|
|
12093
12095
|
}
|
|
12094
12096
|
|
|
12097
|
+
var format = function (p, n, x, s, c) {
|
|
12098
|
+
var re = "\\d(?=(\\d{" + (x || 3) + "})+" + (n > 0 ? "\\D" : "$") + ")", num = p.toFixed(Math.max(0, ~~n));
|
|
12099
|
+
return (c ? num.replace(".", c) : num).replace(new RegExp(re, "g"), "$&" + (s || ","));
|
|
12100
|
+
};
|
|
12101
|
+
/**
|
|
12102
|
+
*
|
|
12103
|
+
* @param price Price to format
|
|
12104
|
+
* @param currency Code for the currency, USD, EUR, TRY, etc..
|
|
12105
|
+
*/
|
|
12095
12106
|
var formatMoney = function (price, currency) {
|
|
12096
|
-
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12107
|
+
try {
|
|
12108
|
+
var symbol = getCurrencySymbol(currency);
|
|
12109
|
+
var decimalSeperator = ".";
|
|
12110
|
+
var sectionSeperator = ",";
|
|
12111
|
+
var decimalLength = 2;
|
|
12112
|
+
var sectionLength = 3;
|
|
12113
|
+
var formattedNumber = format(price, decimalLength, sectionLength, decimalSeperator, sectionSeperator);
|
|
12114
|
+
var parts = formattedNumber.split(decimalSeperator);
|
|
12115
|
+
if (parts[1] === "00")
|
|
12116
|
+
formattedNumber = parts[0];
|
|
12117
|
+
return symbol + " " + formattedNumber;
|
|
12118
|
+
}
|
|
12119
|
+
catch (err) {
|
|
12120
|
+
console.error(err);
|
|
12121
|
+
// Fallback
|
|
12122
|
+
var formatter = new Intl.NumberFormat(IkasStorefrontConfig.getCurrentLocale(), {
|
|
12123
|
+
style: "currency",
|
|
12124
|
+
currency: currency || "TRY",
|
|
12125
|
+
});
|
|
12126
|
+
return formatter.format(price);
|
|
12127
|
+
}
|
|
12128
|
+
};
|
|
12129
|
+
function getCurrencySymbol(currencyCode) {
|
|
12130
|
+
return CURRENCIES[currencyCode] || currencyCode;
|
|
12131
|
+
}
|
|
12132
|
+
var CURRENCIES = {
|
|
12133
|
+
TRY: "₺",
|
|
12134
|
+
USD: "$",
|
|
12135
|
+
EUR: "€",
|
|
12136
|
+
AZN: "₼",
|
|
12137
|
+
AED: "د.إ.",
|
|
12138
|
+
AFN: "؋",
|
|
12139
|
+
ALL: "L",
|
|
12140
|
+
AMD: "դր",
|
|
12141
|
+
ANG: "ƒ",
|
|
12142
|
+
AOA: "Kz",
|
|
12143
|
+
ARS: "$",
|
|
12144
|
+
AUD: "$",
|
|
12145
|
+
AWG: "ƒ",
|
|
12146
|
+
BAM: "КМ",
|
|
12147
|
+
BBD: "$",
|
|
12148
|
+
BDT: "৳",
|
|
12149
|
+
BGN: "лв.",
|
|
12150
|
+
BHD: "د.ب.",
|
|
12151
|
+
BIF: "FBu",
|
|
12152
|
+
BMD: "$",
|
|
12153
|
+
BND: "$",
|
|
12154
|
+
BOB: "Bs.",
|
|
12155
|
+
BRL: "R$",
|
|
12156
|
+
BSD: "$",
|
|
12157
|
+
BTN: "Nu.",
|
|
12158
|
+
BWP: "P",
|
|
12159
|
+
BYN: "руб.",
|
|
12160
|
+
BZD: "$",
|
|
12161
|
+
CAD: "$",
|
|
12162
|
+
CDF: "₣",
|
|
12163
|
+
CHF: "₣",
|
|
12164
|
+
CKD: "$",
|
|
12165
|
+
CLP: "$",
|
|
12166
|
+
CNY: "¥元",
|
|
12167
|
+
COP: "$",
|
|
12168
|
+
CRC: "₡",
|
|
12169
|
+
CUC: "$",
|
|
12170
|
+
CUP: "₱",
|
|
12171
|
+
CVE: "$",
|
|
12172
|
+
CZK: "Kč",
|
|
12173
|
+
DJF: "ف.ج.",
|
|
12174
|
+
DKK: "kr.",
|
|
12175
|
+
DOP: "$",
|
|
12176
|
+
DZD: "د.ج.",
|
|
12177
|
+
EGP: "ج.م.",
|
|
12178
|
+
EHP: "Ptas.",
|
|
12179
|
+
ERN: "ناكفا",
|
|
12180
|
+
ETB: "ብር",
|
|
12181
|
+
FJD: "$",
|
|
12182
|
+
FKP: "£",
|
|
12183
|
+
FOK: "kr",
|
|
12184
|
+
GBP: "£",
|
|
12185
|
+
GEL: "₾",
|
|
12186
|
+
GGP: "£",
|
|
12187
|
+
GHS: "₵",
|
|
12188
|
+
GIP: "£",
|
|
12189
|
+
GMD: "D",
|
|
12190
|
+
GNF: "FG",
|
|
12191
|
+
GTQ: "$",
|
|
12192
|
+
GYD: "$",
|
|
12193
|
+
HKD: "$",
|
|
12194
|
+
HNL: "L",
|
|
12195
|
+
HRK: "kn",
|
|
12196
|
+
HTG: "G",
|
|
12197
|
+
HUF: "Ft",
|
|
12198
|
+
IDR: "Rp",
|
|
12199
|
+
ILS: "₪",
|
|
12200
|
+
IMP: "£",
|
|
12201
|
+
INR: "₹",
|
|
12202
|
+
IQD: "د.ع.",
|
|
12203
|
+
IRR: "﷼",
|
|
12204
|
+
ISK: "kr",
|
|
12205
|
+
JEP: "£",
|
|
12206
|
+
JMD: "$",
|
|
12207
|
+
JOD: "د.أ.",
|
|
12208
|
+
JPY: "¥",
|
|
12209
|
+
KES: "KSh",
|
|
12210
|
+
KGS: "с",
|
|
12211
|
+
KHR: "៛",
|
|
12212
|
+
KID: "$",
|
|
12213
|
+
KMF: "CF",
|
|
12214
|
+
KPW: "₩",
|
|
12215
|
+
KRW: "₩",
|
|
12216
|
+
KWD: "د.ك.",
|
|
12217
|
+
KYD: "$",
|
|
12218
|
+
KZT: "₸",
|
|
12219
|
+
LAK: "₭",
|
|
12220
|
+
LBP: "ل.ل.",
|
|
12221
|
+
LKR: "රු or ரூ",
|
|
12222
|
+
LRD: "$",
|
|
12223
|
+
LSL: "L",
|
|
12224
|
+
LYD: "ل.د.",
|
|
12225
|
+
MAD: "د.م.",
|
|
12226
|
+
MDL: "L",
|
|
12227
|
+
MGA: "Ar",
|
|
12228
|
+
MKD: "ден",
|
|
12229
|
+
MMK: "Ks",
|
|
12230
|
+
MNT: "₮",
|
|
12231
|
+
MOP: "MOP$",
|
|
12232
|
+
MRU: "أ.م.",
|
|
12233
|
+
MUR: "रु ",
|
|
12234
|
+
MVR: ".ރ",
|
|
12235
|
+
MWK: "MK",
|
|
12236
|
+
MXN: "$",
|
|
12237
|
+
MYR: "RM",
|
|
12238
|
+
MZN: "MT",
|
|
12239
|
+
NAD: "$",
|
|
12240
|
+
NGN: "₦",
|
|
12241
|
+
NIO: "C$",
|
|
12242
|
+
NOK: "kr",
|
|
12243
|
+
NPR: "रू",
|
|
12244
|
+
NZD: "$",
|
|
12245
|
+
OMR: "ر.ع.",
|
|
12246
|
+
PAB: "B/.",
|
|
12247
|
+
PEN: "S/.",
|
|
12248
|
+
PGK: "K",
|
|
12249
|
+
PHP: "₱",
|
|
12250
|
+
PKR: "Rs",
|
|
12251
|
+
PLN: "zł",
|
|
12252
|
+
PND: "$",
|
|
12253
|
+
PRB: "р.",
|
|
12254
|
+
PYG: "₲",
|
|
12255
|
+
QAR: "ر.ق.",
|
|
12256
|
+
RON: "L",
|
|
12257
|
+
RSD: "дин",
|
|
12258
|
+
RUB: "₽",
|
|
12259
|
+
RWF: "R₣",
|
|
12260
|
+
SAR: "ر.س.",
|
|
12261
|
+
SBD: "$",
|
|
12262
|
+
SCR: "Rs",
|
|
12263
|
+
SDG: "ج.س.",
|
|
12264
|
+
SEK: "kr",
|
|
12265
|
+
SGD: "$",
|
|
12266
|
+
SHP: "£",
|
|
12267
|
+
SLL: "Le",
|
|
12268
|
+
SLS: "Sl",
|
|
12269
|
+
SOS: "Ssh",
|
|
12270
|
+
SRD: "$",
|
|
12271
|
+
SSP: "SS£",
|
|
12272
|
+
STN: "Db",
|
|
12273
|
+
SVC: "₡",
|
|
12274
|
+
SYP: "ل.س.",
|
|
12275
|
+
SZL: "L",
|
|
12276
|
+
THB: "฿",
|
|
12277
|
+
TJS: "SM",
|
|
12278
|
+
TMT: "T",
|
|
12279
|
+
TND: "د.ت.",
|
|
12280
|
+
TOP: "PT",
|
|
12281
|
+
TTD: "$",
|
|
12282
|
+
TVD: "$",
|
|
12283
|
+
TWD: "圓",
|
|
12284
|
+
TZS: "TSh",
|
|
12285
|
+
UAH: "грн",
|
|
12286
|
+
UGX: "Sh",
|
|
12287
|
+
UYU: "$",
|
|
12288
|
+
UZS: "сум",
|
|
12289
|
+
VED: "Bs.",
|
|
12290
|
+
VES: "Bs.F",
|
|
12291
|
+
VND: "₫",
|
|
12292
|
+
VUV: "VT",
|
|
12293
|
+
WST: "ST",
|
|
12294
|
+
XAF: "Fr.",
|
|
12295
|
+
XCD: "$",
|
|
12296
|
+
XOF: "₣",
|
|
12297
|
+
XPF: "₣",
|
|
12298
|
+
YER: "ر.ي.",
|
|
12299
|
+
ZAR: "R",
|
|
12300
|
+
ZMW: "ZK",
|
|
12301
|
+
ZWB: "",
|
|
12302
|
+
ZWL: "$",
|
|
12303
|
+
Abkhazia: "",
|
|
12304
|
+
Artsakh: "դր.",
|
|
12104
12305
|
};
|
|
12105
12306
|
|
|
12106
12307
|
/** `Object#toString` result references. */
|
|
@@ -19682,6 +19883,7 @@ var IkasOrderLineItem = /** @class */ (function () {
|
|
|
19682
19883
|
this.orderedAt = data.orderedAt || 0;
|
|
19683
19884
|
this.deleted = data.deleted || false;
|
|
19684
19885
|
this.currencyCode = data.currencyCode || "";
|
|
19886
|
+
this.currencySymbol = getCurrencySymbol(this.currencyCode);
|
|
19685
19887
|
this.discount = data.discount
|
|
19686
19888
|
? new IkasOrderLineDiscount(data.discount)
|
|
19687
19889
|
: undefined;
|
|
@@ -19792,6 +19994,7 @@ var IkasCart = /** @class */ (function () {
|
|
|
19792
19994
|
this.updatedAt = data.updatedAt || "";
|
|
19793
19995
|
this.dueDate = data.dueDate;
|
|
19794
19996
|
this.currencyCode = data.currencyCode || "";
|
|
19997
|
+
this.currencySymbol = getCurrencySymbol(this.currencyCode);
|
|
19795
19998
|
this.customerId = data.customerId;
|
|
19796
19999
|
this.itemCount = data.itemCount || 0;
|
|
19797
20000
|
this.items = data.items
|
|
@@ -19812,7 +20015,6 @@ var IkasCart = /** @class */ (function () {
|
|
|
19812
20015
|
get: function () {
|
|
19813
20016
|
var _a;
|
|
19814
20017
|
return (((_a = this.taxLines) === null || _a === void 0 ? void 0 : _a.reduce(function (total, current) { return total + current.price; }, 0)) || 0);
|
|
19815
|
-
// return this.items.reduce((total, current) => total + current.tax, 0);
|
|
19816
20018
|
},
|
|
19817
20019
|
enumerable: false,
|
|
19818
20020
|
configurable: true
|
|
@@ -20401,6 +20603,7 @@ var IkasOrder = /** @class */ (function () {
|
|
|
20401
20603
|
// this.totalDiscountPrice = data.totalDiscountPrice;
|
|
20402
20604
|
// this.totalWeight = data.totalWeight;
|
|
20403
20605
|
this.currencyCode = data.currencyCode;
|
|
20606
|
+
this.currencySymbol = getCurrencySymbol(this.currencyCode);
|
|
20404
20607
|
this.orderedAt = data.orderedAt;
|
|
20405
20608
|
this.cancelledAt = data.cancelledAt;
|
|
20406
20609
|
this.status = data.status;
|
|
@@ -20570,6 +20773,7 @@ var IkasProductPrice = /** @class */ (function () {
|
|
|
20570
20773
|
this.discountPrice =
|
|
20571
20774
|
data.discountPrice !== undefined ? data.discountPrice : null;
|
|
20572
20775
|
this.currency = data.currency || "";
|
|
20776
|
+
this.currencySymbol = getCurrencySymbol(this.currency);
|
|
20573
20777
|
makeAutoObservable(this);
|
|
20574
20778
|
}
|
|
20575
20779
|
Object.defineProperty(IkasProductPrice.prototype, "finalPrice", {
|
|
@@ -23752,6 +23956,9 @@ var IkasOrderTransaction = /** @class */ (function () {
|
|
|
23752
23956
|
this.checkoutId = data.checkoutId || null;
|
|
23753
23957
|
this.createdAt = data.createdAt || null;
|
|
23754
23958
|
this.currencyCode = data.currencyCode || null;
|
|
23959
|
+
this.currencySymbol = this.currencyCode
|
|
23960
|
+
? getCurrencySymbol(this.currencyCode)
|
|
23961
|
+
: null;
|
|
23755
23962
|
this.customerId = data.customerId || null;
|
|
23756
23963
|
this.error = data.error || null;
|
|
23757
23964
|
this.id = data.id || null;
|
|
@@ -27326,7 +27533,9 @@ var StorefrontEventPageType;
|
|
|
27326
27533
|
StorefrontEventPageType[StorefrontEventPageType["BLOG_CATEGORY"] = 20] = "BLOG_CATEGORY";
|
|
27327
27534
|
StorefrontEventPageType[StorefrontEventPageType["CHECKOUT"] = 21] = "CHECKOUT";
|
|
27328
27535
|
})(StorefrontEventPageType || (StorefrontEventPageType = {}));
|
|
27329
|
-
var ANALYTICS_URL =
|
|
27536
|
+
var ANALYTICS_URL = process.env.NEXT_PUBLIC_ANALYTICS_URL
|
|
27537
|
+
? process.env.NEXT_PUBLIC_ANALYTICS_URL + "/sendEvent"
|
|
27538
|
+
: "https://0.myikas.dev/sendEvent";
|
|
27330
27539
|
var IkasAnalytics = /** @class */ (function () {
|
|
27331
27540
|
function IkasAnalytics() {
|
|
27332
27541
|
}
|
|
@@ -41960,7 +42169,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
41960
42169
|
return __generator(this, function (_b) {
|
|
41961
42170
|
switch (_b.label) {
|
|
41962
42171
|
case 0:
|
|
41963
|
-
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 $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\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 $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\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 "])));
|
|
42172
|
+
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 $isAcceptMarketing: Boolean\n $locale: String\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\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 $isAcceptMarketing: Boolean\n $locale: String\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\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 "])));
|
|
41964
42173
|
_b.label = 1;
|
|
41965
42174
|
case 1:
|
|
41966
42175
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -41974,6 +42183,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
41974
42183
|
firstName: firstName,
|
|
41975
42184
|
lastName: lastName,
|
|
41976
42185
|
isAcceptMarketing: isAcceptMarketing,
|
|
42186
|
+
locale: IkasStorefrontConfig.getCurrentLocale(),
|
|
41977
42187
|
},
|
|
41978
42188
|
})];
|
|
41979
42189
|
case 2:
|
|
@@ -42034,7 +42244,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42034
42244
|
return __generator(this, function (_b) {
|
|
42035
42245
|
switch (_b.label) {
|
|
42036
42246
|
case 0:
|
|
42037
|
-
MUTATION = src(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation customerForgotPassword($email: String!) {\n customerForgotPassword(email: $email)\n }\n "], ["\n mutation customerForgotPassword($email: String!) {\n customerForgotPassword(email: $email)\n }\n "])));
|
|
42247
|
+
MUTATION = src(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "], ["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "])));
|
|
42038
42248
|
_b.label = 1;
|
|
42039
42249
|
case 1:
|
|
42040
42250
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42044,6 +42254,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42044
42254
|
mutation: MUTATION,
|
|
42045
42255
|
variables: {
|
|
42046
42256
|
email: email,
|
|
42257
|
+
locale: IkasStorefrontConfig.getCurrentLocale(),
|
|
42047
42258
|
},
|
|
42048
42259
|
})];
|
|
42049
42260
|
case 2:
|
|
@@ -45598,7 +45809,7 @@ var IkasPageDataInit = /** @class */ (function () {
|
|
|
45598
45809
|
|
|
45599
45810
|
var ThemeComponent = observer(function (_a) {
|
|
45600
45811
|
var pageComponentPropValue = _a.pageComponentPropValue, index = _a.index, settings = _a.settings;
|
|
45601
|
-
var store = IkasStorefrontConfig.store,
|
|
45812
|
+
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
45602
45813
|
var pageComponent = pageComponentPropValue.pageComponent;
|
|
45603
45814
|
var propValues = pageComponentPropValue.propValues;
|
|
45604
45815
|
var hasNullValue = computed(function () {
|
|
@@ -45609,14 +45820,9 @@ var ThemeComponent = observer(function (_a) {
|
|
|
45609
45820
|
}
|
|
45610
45821
|
});
|
|
45611
45822
|
});
|
|
45612
|
-
|
|
45613
|
-
console.error("Components for the page not found.");
|
|
45614
|
-
return null;
|
|
45615
|
-
}
|
|
45616
|
-
var Component = currentPageComponents[pageComponent.componentId];
|
|
45823
|
+
var Component = components[pageComponent.componentId];
|
|
45617
45824
|
if (!Component) {
|
|
45618
|
-
console.error("COMPONENT NOT FOUND!",
|
|
45619
|
-
return null;
|
|
45825
|
+
console.error("COMPONENT NOT FOUND!", pageComponent.id, pageComponent.componentId, components ? Object.keys(components) : []);
|
|
45620
45826
|
}
|
|
45621
45827
|
return (createElement("div", { id: index + "" }, hasNullValue.get() ? null : (createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store, pageSpecificData: IkasPageDataInit.pageSpecificData })))));
|
|
45622
45828
|
});
|
|
@@ -45832,9 +46038,8 @@ function createCategoryBreadcrumbSchema(category) {
|
|
|
45832
46038
|
}
|
|
45833
46039
|
|
|
45834
46040
|
var IkasPage = observer(function (_a) {
|
|
45835
|
-
var propValuesStr = _a.propValuesStr, pageType = _a.pageType, pageTitle = _a.pageTitle, pageDescription = _a.pageDescription, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettingsStr = _a.merchantSettingsStr, configJson = _a.configJson, reInitOnBrowser = _a.reInitOnBrowser, addOgpMetas = _a.addOgpMetas
|
|
46041
|
+
var propValuesStr = _a.propValuesStr, pageType = _a.pageType, pageTitle = _a.pageTitle, pageDescription = _a.pageDescription, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettingsStr = _a.merchantSettingsStr, configJson = _a.configJson, reInitOnBrowser = _a.reInitOnBrowser, addOgpMetas = _a.addOgpMetas;
|
|
45836
46042
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
45837
|
-
IkasStorefrontConfig.currentPageComponents = components;
|
|
45838
46043
|
var store = IkasStorefrontConfig.store;
|
|
45839
46044
|
store.currentPageType = pageType;
|
|
45840
46045
|
var router = useRouter();
|
|
@@ -58028,7 +58233,7 @@ function template_formatter (template) {
|
|
|
58028
58233
|
// The result is `{ text: '8 (80 )', caret: 4 }`.
|
|
58029
58234
|
//
|
|
58030
58235
|
|
|
58031
|
-
function format(value, caret, formatter) {
|
|
58236
|
+
function format$1(value, caret, formatter) {
|
|
58032
58237
|
if (typeof formatter === 'string') {
|
|
58033
58238
|
formatter = template_formatter(formatter);
|
|
58034
58239
|
}
|
|
@@ -58230,7 +58435,7 @@ function formatInputText(input, _parse, _format, operation, on_change) {
|
|
|
58230
58435
|
// (and reposition the caret accordingly)
|
|
58231
58436
|
|
|
58232
58437
|
|
|
58233
|
-
var formatted = format(value, caret, _format);
|
|
58438
|
+
var formatted = format$1(value, caret, _format);
|
|
58234
58439
|
var text = formatted.text;
|
|
58235
58440
|
caret = formatted.caret; // Set `<input/>` textual value manually
|
|
58236
58441
|
// to prevent React from resetting the caret position
|
|
@@ -63131,7 +63336,7 @@ function createInput$1(defaultMetadata) {
|
|
|
63131
63336
|
// Working around this issue with this simple hack.
|
|
63132
63337
|
|
|
63133
63338
|
if (newValue === value) {
|
|
63134
|
-
var newValueFormatted = format$
|
|
63339
|
+
var newValueFormatted = format$2(prefix, newValue, country, metadata);
|
|
63135
63340
|
|
|
63136
63341
|
if (newValueFormatted.indexOf(event.target.value) === 0) {
|
|
63137
63342
|
// Trim the last digit (or plus sign).
|
|
@@ -63144,7 +63349,7 @@ function createInput$1(defaultMetadata) {
|
|
|
63144
63349
|
|
|
63145
63350
|
return React.createElement(Input, _extends$2({}, rest, {
|
|
63146
63351
|
ref: ref,
|
|
63147
|
-
value: format$
|
|
63352
|
+
value: format$2(prefix, value, country, metadata),
|
|
63148
63353
|
onChange: _onChange
|
|
63149
63354
|
}));
|
|
63150
63355
|
}
|
|
@@ -63215,7 +63420,7 @@ function createInput$1(defaultMetadata) {
|
|
|
63215
63420
|
}
|
|
63216
63421
|
var InputBasic = createInput$1();
|
|
63217
63422
|
|
|
63218
|
-
function format$
|
|
63423
|
+
function format$2(prefix, value, country, metadata) {
|
|
63219
63424
|
return removeInputValuePrefix(formatIncompletePhoneNumber(prefix + value, country, metadata), prefix);
|
|
63220
63425
|
}
|
|
63221
63426
|
|
|
@@ -69042,7 +69247,7 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
69042
69247
|
});
|
|
69043
69248
|
}); };
|
|
69044
69249
|
this.listCountries = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
69045
|
-
var _a, countries, currentRouting_1, currentCountry;
|
|
69250
|
+
var _a, countries, currentRouting_1, otherRoutings_1, currentCountry;
|
|
69046
69251
|
var _this = this;
|
|
69047
69252
|
var _b, _c;
|
|
69048
69253
|
return __generator(this, function (_d) {
|
|
@@ -69062,6 +69267,13 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
69062
69267
|
if ((_c = currentRouting_1 === null || currentRouting_1 === void 0 ? void 0 : currentRouting_1.countryCodes) === null || _c === void 0 ? void 0 : _c.length) {
|
|
69063
69268
|
countries = countries.filter(function (c) { var _a; return c.iso2 && ((_a = currentRouting_1.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2)); });
|
|
69064
69269
|
}
|
|
69270
|
+
else {
|
|
69271
|
+
otherRoutings_1 = IkasStorefrontConfig.routings.filter(function (r) { return r.id !== IkasStorefrontConfig.storefrontRoutingId; });
|
|
69272
|
+
countries = countries.filter(function (c) {
|
|
69273
|
+
return c.iso2 &&
|
|
69274
|
+
!otherRoutings_1.some(function (otherRouting) { var _a; return (_a = otherRouting.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2); });
|
|
69275
|
+
});
|
|
69276
|
+
}
|
|
69065
69277
|
this.countries = countries;
|
|
69066
69278
|
if (this.countries.length === 1 && !this.country)
|
|
69067
69279
|
this.onCountryChange(this.countries[0].id);
|
|
@@ -71194,7 +71406,7 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
71194
71406
|
var _b, _c, _d;
|
|
71195
71407
|
var vm = _a.vm, pageComponent = _a.pageComponent;
|
|
71196
71408
|
var ref = useRef(null);
|
|
71197
|
-
var store = IkasStorefrontConfig.store,
|
|
71409
|
+
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
71198
71410
|
useEffect(function () {
|
|
71199
71411
|
vm.setComponentRef(ref.current, pageComponent);
|
|
71200
71412
|
}, []);
|
|
@@ -71210,11 +71422,7 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
71210
71422
|
var propValues = (_c = pageComponentPropValue.get()) === null || _c === void 0 ? void 0 : _c.propValues;
|
|
71211
71423
|
if (!propValues)
|
|
71212
71424
|
return null;
|
|
71213
|
-
|
|
71214
|
-
console.error("Components for the page not found.");
|
|
71215
|
-
return null;
|
|
71216
|
-
}
|
|
71217
|
-
var Component = currentPageComponents[pageComponent.componentId];
|
|
71425
|
+
var Component = components[pageComponent.componentId];
|
|
71218
71426
|
if (((_d = vm.page) === null || _d === void 0 ? void 0 : _d.type) === IkasThemePageType.CHECKOUT) {
|
|
71219
71427
|
//@ts-ignore
|
|
71220
71428
|
Component = IkasCheckoutPage$1;
|
|
@@ -71223,7 +71431,7 @@ var ThemeEditorComponent = observer(function (_a) {
|
|
|
71223
71431
|
cart: new IkasCart({
|
|
71224
71432
|
items: [
|
|
71225
71433
|
new IkasOrderLineItem({
|
|
71226
|
-
currencyCode: "
|
|
71434
|
+
currencyCode: "TRY",
|
|
71227
71435
|
finalPrice: 100,
|
|
71228
71436
|
finalPriceWithQuantity: 100,
|
|
71229
71437
|
price: 100,
|
|
@@ -72082,13 +72290,10 @@ var cart$1 = /*#__PURE__*/Object.freeze({
|
|
|
72082
72290
|
|
|
72083
72291
|
var IkasPageEditor$1 = dynamic(function () { return Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.IkasPageEditor; }); }, { ssr: false });
|
|
72084
72292
|
var Page$c = function (_a) {
|
|
72085
|
-
var configJson = _a.configJson
|
|
72293
|
+
var configJson = _a.configJson;
|
|
72086
72294
|
if (configJson) {
|
|
72087
72295
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
72088
72296
|
}
|
|
72089
|
-
if (components) {
|
|
72090
|
-
IkasStorefrontConfig.currentPageComponents = components;
|
|
72091
|
-
}
|
|
72092
72297
|
return createElement(IkasPageEditor$1, null);
|
|
72093
72298
|
};
|
|
72094
72299
|
var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -73528,4 +73733,4 @@ var en$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Ob
|
|
|
73528
73733
|
'default': en
|
|
73529
73734
|
}));
|
|
73530
73735
|
|
|
73531
|
-
export { AccountInfoForm, index$4 as AccountPage, AddressForm, addresses$1 as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$8 as BlogPage, _slug_$3 as BlogSlugPage, cart$1 as CartPage, checkout$1 as CheckoutPage, ContactForm, _slug_$1 as CustomPage, CustomerReviewForm, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts$1 as FavoriteProductsPage, ForgotPasswordForm, forgotPassword$1 as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasAttributeDetail, IkasAttributeList, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogCategoryList, IkasBlogCategoryListPropValue, IkasBlogCategoryListType, IkasBlogCategoryPropValue, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType,
|
|
73736
|
+
export { AccountInfoForm, index$4 as AccountPage, AddressForm, addresses$1 as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$8 as BlogPage, _slug_$3 as BlogSlugPage, cart$1 as CartPage, checkout$1 as CheckoutPage, ContactForm, _slug_$1 as CustomPage, CustomerReviewForm, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts$1 as FavoriteProductsPage, ForgotPasswordForm, forgotPassword$1 as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasAttributeDetail, IkasAttributeList, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogCategoryList, IkasBlogCategoryListPropValue, IkasBlogCategoryListType, IkasBlogCategoryPropValue, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutCustomer, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasCustomerReview, IkasCustomerReviewAPI, IkasCustomerReviewList, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderRefundSettings, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeType, IkasProductAttributeValue, IkasProductBackInStockReminderAPI, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductOption, IkasProductOptionDateSettings, IkasProductOptionFileSettings, IkasProductOptionSelectSettings, IkasProductOptionSelectType, IkasProductOptionSelectValue, IkasProductOptionSelectValueTranslations, IkasProductOptionSet, IkasProductOptionSetAPI, IkasProductOptionSetTranslations, IkasProductOptionTextSettings, IkasProductOptionTranslations, IkasProductOptionType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home$1 as IndexPage, LessThanRule, LoginForm, login$1 as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$1 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$6 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword$1 as RecoverPasswordPage, RegisterForm, register$1 as RegisterPage, RequiredRule, search$1 as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, createTranslationInputData, decodeBase64, findAllIndexes, formatDate, formatMoney, getCurrencySymbol, parseRangeStr, pascalCase, stringSorter, stringToSlug, tryForEach, useTranslation, validatePhoneNumber };
|
package/build/index.js
CHANGED
|
@@ -10969,8 +10969,9 @@ function setContext(setter) {
|
|
|
10969
10969
|
var IkasStorefrontConfig = /** @class */ (function () {
|
|
10970
10970
|
function IkasStorefrontConfig() {
|
|
10971
10971
|
}
|
|
10972
|
-
IkasStorefrontConfig.init = function (store, config, apiUrlOverride) {
|
|
10972
|
+
IkasStorefrontConfig.init = function (store, components, config, apiUrlOverride) {
|
|
10973
10973
|
IkasStorefrontConfig.store = store;
|
|
10974
|
+
IkasStorefrontConfig.components = components;
|
|
10974
10975
|
IkasStorefrontConfig.config = config;
|
|
10975
10976
|
IkasStorefrontConfig.apiUrlOverride = apiUrlOverride || null;
|
|
10976
10977
|
if (process.env.NEXT_PUBLIC_ENV === "local") {
|
|
@@ -11017,6 +11018,7 @@ var IkasStorefrontConfig = /** @class */ (function () {
|
|
|
11017
11018
|
: null,
|
|
11018
11019
|
};
|
|
11019
11020
|
};
|
|
11021
|
+
IkasStorefrontConfig.components = {};
|
|
11020
11022
|
IkasStorefrontConfig.config = {};
|
|
11021
11023
|
IkasStorefrontConfig.apiUrlOverride = null;
|
|
11022
11024
|
IkasStorefrontConfig.routings = [];
|
|
@@ -12109,15 +12111,214 @@ function tryForEach(items, callback, printErrors) {
|
|
|
12109
12111
|
});
|
|
12110
12112
|
}
|
|
12111
12113
|
|
|
12114
|
+
var format = function (p, n, x, s, c) {
|
|
12115
|
+
var re = "\\d(?=(\\d{" + (x || 3) + "})+" + (n > 0 ? "\\D" : "$") + ")", num = p.toFixed(Math.max(0, ~~n));
|
|
12116
|
+
return (c ? num.replace(".", c) : num).replace(new RegExp(re, "g"), "$&" + (s || ","));
|
|
12117
|
+
};
|
|
12118
|
+
/**
|
|
12119
|
+
*
|
|
12120
|
+
* @param price Price to format
|
|
12121
|
+
* @param currency Code for the currency, USD, EUR, TRY, etc..
|
|
12122
|
+
*/
|
|
12112
12123
|
var formatMoney = function (price, currency) {
|
|
12113
|
-
|
|
12114
|
-
|
|
12115
|
-
|
|
12116
|
-
|
|
12117
|
-
|
|
12118
|
-
|
|
12119
|
-
|
|
12120
|
-
|
|
12124
|
+
try {
|
|
12125
|
+
var symbol = getCurrencySymbol(currency);
|
|
12126
|
+
var decimalSeperator = ".";
|
|
12127
|
+
var sectionSeperator = ",";
|
|
12128
|
+
var decimalLength = 2;
|
|
12129
|
+
var sectionLength = 3;
|
|
12130
|
+
var formattedNumber = format(price, decimalLength, sectionLength, decimalSeperator, sectionSeperator);
|
|
12131
|
+
var parts = formattedNumber.split(decimalSeperator);
|
|
12132
|
+
if (parts[1] === "00")
|
|
12133
|
+
formattedNumber = parts[0];
|
|
12134
|
+
return symbol + " " + formattedNumber;
|
|
12135
|
+
}
|
|
12136
|
+
catch (err) {
|
|
12137
|
+
console.error(err);
|
|
12138
|
+
// Fallback
|
|
12139
|
+
var formatter = new Intl.NumberFormat(IkasStorefrontConfig.getCurrentLocale(), {
|
|
12140
|
+
style: "currency",
|
|
12141
|
+
currency: currency || "TRY",
|
|
12142
|
+
});
|
|
12143
|
+
return formatter.format(price);
|
|
12144
|
+
}
|
|
12145
|
+
};
|
|
12146
|
+
function getCurrencySymbol(currencyCode) {
|
|
12147
|
+
return CURRENCIES[currencyCode] || currencyCode;
|
|
12148
|
+
}
|
|
12149
|
+
var CURRENCIES = {
|
|
12150
|
+
TRY: "₺",
|
|
12151
|
+
USD: "$",
|
|
12152
|
+
EUR: "€",
|
|
12153
|
+
AZN: "₼",
|
|
12154
|
+
AED: "د.إ.",
|
|
12155
|
+
AFN: "؋",
|
|
12156
|
+
ALL: "L",
|
|
12157
|
+
AMD: "դր",
|
|
12158
|
+
ANG: "ƒ",
|
|
12159
|
+
AOA: "Kz",
|
|
12160
|
+
ARS: "$",
|
|
12161
|
+
AUD: "$",
|
|
12162
|
+
AWG: "ƒ",
|
|
12163
|
+
BAM: "КМ",
|
|
12164
|
+
BBD: "$",
|
|
12165
|
+
BDT: "৳",
|
|
12166
|
+
BGN: "лв.",
|
|
12167
|
+
BHD: "د.ب.",
|
|
12168
|
+
BIF: "FBu",
|
|
12169
|
+
BMD: "$",
|
|
12170
|
+
BND: "$",
|
|
12171
|
+
BOB: "Bs.",
|
|
12172
|
+
BRL: "R$",
|
|
12173
|
+
BSD: "$",
|
|
12174
|
+
BTN: "Nu.",
|
|
12175
|
+
BWP: "P",
|
|
12176
|
+
BYN: "руб.",
|
|
12177
|
+
BZD: "$",
|
|
12178
|
+
CAD: "$",
|
|
12179
|
+
CDF: "₣",
|
|
12180
|
+
CHF: "₣",
|
|
12181
|
+
CKD: "$",
|
|
12182
|
+
CLP: "$",
|
|
12183
|
+
CNY: "¥元",
|
|
12184
|
+
COP: "$",
|
|
12185
|
+
CRC: "₡",
|
|
12186
|
+
CUC: "$",
|
|
12187
|
+
CUP: "₱",
|
|
12188
|
+
CVE: "$",
|
|
12189
|
+
CZK: "Kč",
|
|
12190
|
+
DJF: "ف.ج.",
|
|
12191
|
+
DKK: "kr.",
|
|
12192
|
+
DOP: "$",
|
|
12193
|
+
DZD: "د.ج.",
|
|
12194
|
+
EGP: "ج.م.",
|
|
12195
|
+
EHP: "Ptas.",
|
|
12196
|
+
ERN: "ناكفا",
|
|
12197
|
+
ETB: "ብር",
|
|
12198
|
+
FJD: "$",
|
|
12199
|
+
FKP: "£",
|
|
12200
|
+
FOK: "kr",
|
|
12201
|
+
GBP: "£",
|
|
12202
|
+
GEL: "₾",
|
|
12203
|
+
GGP: "£",
|
|
12204
|
+
GHS: "₵",
|
|
12205
|
+
GIP: "£",
|
|
12206
|
+
GMD: "D",
|
|
12207
|
+
GNF: "FG",
|
|
12208
|
+
GTQ: "$",
|
|
12209
|
+
GYD: "$",
|
|
12210
|
+
HKD: "$",
|
|
12211
|
+
HNL: "L",
|
|
12212
|
+
HRK: "kn",
|
|
12213
|
+
HTG: "G",
|
|
12214
|
+
HUF: "Ft",
|
|
12215
|
+
IDR: "Rp",
|
|
12216
|
+
ILS: "₪",
|
|
12217
|
+
IMP: "£",
|
|
12218
|
+
INR: "₹",
|
|
12219
|
+
IQD: "د.ع.",
|
|
12220
|
+
IRR: "﷼",
|
|
12221
|
+
ISK: "kr",
|
|
12222
|
+
JEP: "£",
|
|
12223
|
+
JMD: "$",
|
|
12224
|
+
JOD: "د.أ.",
|
|
12225
|
+
JPY: "¥",
|
|
12226
|
+
KES: "KSh",
|
|
12227
|
+
KGS: "с",
|
|
12228
|
+
KHR: "៛",
|
|
12229
|
+
KID: "$",
|
|
12230
|
+
KMF: "CF",
|
|
12231
|
+
KPW: "₩",
|
|
12232
|
+
KRW: "₩",
|
|
12233
|
+
KWD: "د.ك.",
|
|
12234
|
+
KYD: "$",
|
|
12235
|
+
KZT: "₸",
|
|
12236
|
+
LAK: "₭",
|
|
12237
|
+
LBP: "ل.ل.",
|
|
12238
|
+
LKR: "රු or ரூ",
|
|
12239
|
+
LRD: "$",
|
|
12240
|
+
LSL: "L",
|
|
12241
|
+
LYD: "ل.د.",
|
|
12242
|
+
MAD: "د.م.",
|
|
12243
|
+
MDL: "L",
|
|
12244
|
+
MGA: "Ar",
|
|
12245
|
+
MKD: "ден",
|
|
12246
|
+
MMK: "Ks",
|
|
12247
|
+
MNT: "₮",
|
|
12248
|
+
MOP: "MOP$",
|
|
12249
|
+
MRU: "أ.م.",
|
|
12250
|
+
MUR: "रु ",
|
|
12251
|
+
MVR: ".ރ",
|
|
12252
|
+
MWK: "MK",
|
|
12253
|
+
MXN: "$",
|
|
12254
|
+
MYR: "RM",
|
|
12255
|
+
MZN: "MT",
|
|
12256
|
+
NAD: "$",
|
|
12257
|
+
NGN: "₦",
|
|
12258
|
+
NIO: "C$",
|
|
12259
|
+
NOK: "kr",
|
|
12260
|
+
NPR: "रू",
|
|
12261
|
+
NZD: "$",
|
|
12262
|
+
OMR: "ر.ع.",
|
|
12263
|
+
PAB: "B/.",
|
|
12264
|
+
PEN: "S/.",
|
|
12265
|
+
PGK: "K",
|
|
12266
|
+
PHP: "₱",
|
|
12267
|
+
PKR: "Rs",
|
|
12268
|
+
PLN: "zł",
|
|
12269
|
+
PND: "$",
|
|
12270
|
+
PRB: "р.",
|
|
12271
|
+
PYG: "₲",
|
|
12272
|
+
QAR: "ر.ق.",
|
|
12273
|
+
RON: "L",
|
|
12274
|
+
RSD: "дин",
|
|
12275
|
+
RUB: "₽",
|
|
12276
|
+
RWF: "R₣",
|
|
12277
|
+
SAR: "ر.س.",
|
|
12278
|
+
SBD: "$",
|
|
12279
|
+
SCR: "Rs",
|
|
12280
|
+
SDG: "ج.س.",
|
|
12281
|
+
SEK: "kr",
|
|
12282
|
+
SGD: "$",
|
|
12283
|
+
SHP: "£",
|
|
12284
|
+
SLL: "Le",
|
|
12285
|
+
SLS: "Sl",
|
|
12286
|
+
SOS: "Ssh",
|
|
12287
|
+
SRD: "$",
|
|
12288
|
+
SSP: "SS£",
|
|
12289
|
+
STN: "Db",
|
|
12290
|
+
SVC: "₡",
|
|
12291
|
+
SYP: "ل.س.",
|
|
12292
|
+
SZL: "L",
|
|
12293
|
+
THB: "฿",
|
|
12294
|
+
TJS: "SM",
|
|
12295
|
+
TMT: "T",
|
|
12296
|
+
TND: "د.ت.",
|
|
12297
|
+
TOP: "PT",
|
|
12298
|
+
TTD: "$",
|
|
12299
|
+
TVD: "$",
|
|
12300
|
+
TWD: "圓",
|
|
12301
|
+
TZS: "TSh",
|
|
12302
|
+
UAH: "грн",
|
|
12303
|
+
UGX: "Sh",
|
|
12304
|
+
UYU: "$",
|
|
12305
|
+
UZS: "сум",
|
|
12306
|
+
VED: "Bs.",
|
|
12307
|
+
VES: "Bs.F",
|
|
12308
|
+
VND: "₫",
|
|
12309
|
+
VUV: "VT",
|
|
12310
|
+
WST: "ST",
|
|
12311
|
+
XAF: "Fr.",
|
|
12312
|
+
XCD: "$",
|
|
12313
|
+
XOF: "₣",
|
|
12314
|
+
XPF: "₣",
|
|
12315
|
+
YER: "ر.ي.",
|
|
12316
|
+
ZAR: "R",
|
|
12317
|
+
ZMW: "ZK",
|
|
12318
|
+
ZWB: "",
|
|
12319
|
+
ZWL: "$",
|
|
12320
|
+
Abkhazia: "",
|
|
12321
|
+
Artsakh: "դր.",
|
|
12121
12322
|
};
|
|
12122
12323
|
|
|
12123
12324
|
/** `Object#toString` result references. */
|
|
@@ -19697,6 +19898,7 @@ var IkasOrderLineItem = /** @class */ (function () {
|
|
|
19697
19898
|
this.orderedAt = data.orderedAt || 0;
|
|
19698
19899
|
this.deleted = data.deleted || false;
|
|
19699
19900
|
this.currencyCode = data.currencyCode || "";
|
|
19901
|
+
this.currencySymbol = getCurrencySymbol(this.currencyCode);
|
|
19700
19902
|
this.discount = data.discount
|
|
19701
19903
|
? new IkasOrderLineDiscount(data.discount)
|
|
19702
19904
|
: undefined;
|
|
@@ -19807,6 +20009,7 @@ var IkasCart = /** @class */ (function () {
|
|
|
19807
20009
|
this.updatedAt = data.updatedAt || "";
|
|
19808
20010
|
this.dueDate = data.dueDate;
|
|
19809
20011
|
this.currencyCode = data.currencyCode || "";
|
|
20012
|
+
this.currencySymbol = getCurrencySymbol(this.currencyCode);
|
|
19810
20013
|
this.customerId = data.customerId;
|
|
19811
20014
|
this.itemCount = data.itemCount || 0;
|
|
19812
20015
|
this.items = data.items
|
|
@@ -19827,7 +20030,6 @@ var IkasCart = /** @class */ (function () {
|
|
|
19827
20030
|
get: function () {
|
|
19828
20031
|
var _a;
|
|
19829
20032
|
return (((_a = this.taxLines) === null || _a === void 0 ? void 0 : _a.reduce(function (total, current) { return total + current.price; }, 0)) || 0);
|
|
19830
|
-
// return this.items.reduce((total, current) => total + current.tax, 0);
|
|
19831
20033
|
},
|
|
19832
20034
|
enumerable: false,
|
|
19833
20035
|
configurable: true
|
|
@@ -20408,6 +20610,7 @@ var IkasOrder = /** @class */ (function () {
|
|
|
20408
20610
|
// this.totalDiscountPrice = data.totalDiscountPrice;
|
|
20409
20611
|
// this.totalWeight = data.totalWeight;
|
|
20410
20612
|
this.currencyCode = data.currencyCode;
|
|
20613
|
+
this.currencySymbol = getCurrencySymbol(this.currencyCode);
|
|
20411
20614
|
this.orderedAt = data.orderedAt;
|
|
20412
20615
|
this.cancelledAt = data.cancelledAt;
|
|
20413
20616
|
this.status = data.status;
|
|
@@ -20569,6 +20772,7 @@ var IkasProductPrice = /** @class */ (function () {
|
|
|
20569
20772
|
this.discountPrice =
|
|
20570
20773
|
data.discountPrice !== undefined ? data.discountPrice : null;
|
|
20571
20774
|
this.currency = data.currency || "";
|
|
20775
|
+
this.currencySymbol = getCurrencySymbol(this.currency);
|
|
20572
20776
|
mobx.makeAutoObservable(this);
|
|
20573
20777
|
}
|
|
20574
20778
|
Object.defineProperty(IkasProductPrice.prototype, "finalPrice", {
|
|
@@ -23745,6 +23949,9 @@ var IkasOrderTransaction = /** @class */ (function () {
|
|
|
23745
23949
|
this.checkoutId = data.checkoutId || null;
|
|
23746
23950
|
this.createdAt = data.createdAt || null;
|
|
23747
23951
|
this.currencyCode = data.currencyCode || null;
|
|
23952
|
+
this.currencySymbol = this.currencyCode
|
|
23953
|
+
? getCurrencySymbol(this.currencyCode)
|
|
23954
|
+
: null;
|
|
23748
23955
|
this.customerId = data.customerId || null;
|
|
23749
23956
|
this.error = data.error || null;
|
|
23750
23957
|
this.id = data.id || null;
|
|
@@ -27306,7 +27513,9 @@ var StorefrontEventPageType;
|
|
|
27306
27513
|
StorefrontEventPageType[StorefrontEventPageType["BLOG_CATEGORY"] = 20] = "BLOG_CATEGORY";
|
|
27307
27514
|
StorefrontEventPageType[StorefrontEventPageType["CHECKOUT"] = 21] = "CHECKOUT";
|
|
27308
27515
|
})(StorefrontEventPageType || (StorefrontEventPageType = {}));
|
|
27309
|
-
var ANALYTICS_URL =
|
|
27516
|
+
var ANALYTICS_URL = process.env.NEXT_PUBLIC_ANALYTICS_URL
|
|
27517
|
+
? process.env.NEXT_PUBLIC_ANALYTICS_URL + "/sendEvent"
|
|
27518
|
+
: "https://0.myikas.dev/sendEvent";
|
|
27310
27519
|
var IkasAnalytics = /** @class */ (function () {
|
|
27311
27520
|
function IkasAnalytics() {
|
|
27312
27521
|
}
|
|
@@ -41937,7 +42146,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
41937
42146
|
return __generator(this, function (_b) {
|
|
41938
42147
|
switch (_b.label) {
|
|
41939
42148
|
case 0:
|
|
41940
|
-
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 $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\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 $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\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 "])));
|
|
42149
|
+
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 $isAcceptMarketing: Boolean\n $locale: String\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\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 $isAcceptMarketing: Boolean\n $locale: String\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\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 "])));
|
|
41941
42150
|
_b.label = 1;
|
|
41942
42151
|
case 1:
|
|
41943
42152
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -41951,6 +42160,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
41951
42160
|
firstName: firstName,
|
|
41952
42161
|
lastName: lastName,
|
|
41953
42162
|
isAcceptMarketing: isAcceptMarketing,
|
|
42163
|
+
locale: IkasStorefrontConfig.getCurrentLocale(),
|
|
41954
42164
|
},
|
|
41955
42165
|
})];
|
|
41956
42166
|
case 2:
|
|
@@ -42011,7 +42221,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42011
42221
|
return __generator(this, function (_b) {
|
|
42012
42222
|
switch (_b.label) {
|
|
42013
42223
|
case 0:
|
|
42014
|
-
MUTATION = src(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation customerForgotPassword($email: String!) {\n customerForgotPassword(email: $email)\n }\n "], ["\n mutation customerForgotPassword($email: String!) {\n customerForgotPassword(email: $email)\n }\n "])));
|
|
42224
|
+
MUTATION = src(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "], ["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "])));
|
|
42015
42225
|
_b.label = 1;
|
|
42016
42226
|
case 1:
|
|
42017
42227
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42021,6 +42231,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42021
42231
|
mutation: MUTATION,
|
|
42022
42232
|
variables: {
|
|
42023
42233
|
email: email,
|
|
42234
|
+
locale: IkasStorefrontConfig.getCurrentLocale(),
|
|
42024
42235
|
},
|
|
42025
42236
|
})];
|
|
42026
42237
|
case 2:
|
|
@@ -45575,7 +45786,7 @@ var IkasPageDataInit = /** @class */ (function () {
|
|
|
45575
45786
|
|
|
45576
45787
|
var ThemeComponent = mobxReactLite.observer(function (_a) {
|
|
45577
45788
|
var pageComponentPropValue = _a.pageComponentPropValue, index = _a.index, settings = _a.settings;
|
|
45578
|
-
var store = IkasStorefrontConfig.store,
|
|
45789
|
+
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
45579
45790
|
var pageComponent = pageComponentPropValue.pageComponent;
|
|
45580
45791
|
var propValues = pageComponentPropValue.propValues;
|
|
45581
45792
|
var hasNullValue = mobx.computed(function () {
|
|
@@ -45586,14 +45797,9 @@ var ThemeComponent = mobxReactLite.observer(function (_a) {
|
|
|
45586
45797
|
}
|
|
45587
45798
|
});
|
|
45588
45799
|
});
|
|
45589
|
-
|
|
45590
|
-
console.error("Components for the page not found.");
|
|
45591
|
-
return null;
|
|
45592
|
-
}
|
|
45593
|
-
var Component = currentPageComponents[pageComponent.componentId];
|
|
45800
|
+
var Component = components[pageComponent.componentId];
|
|
45594
45801
|
if (!Component) {
|
|
45595
|
-
console.error("COMPONENT NOT FOUND!",
|
|
45596
|
-
return null;
|
|
45802
|
+
console.error("COMPONENT NOT FOUND!", pageComponent.id, pageComponent.componentId, components ? Object.keys(components) : []);
|
|
45597
45803
|
}
|
|
45598
45804
|
return (React.createElement("div", { id: index + "" }, hasNullValue.get() ? null : (React.createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store, pageSpecificData: IkasPageDataInit.pageSpecificData })))));
|
|
45599
45805
|
});
|
|
@@ -45809,9 +46015,8 @@ function createCategoryBreadcrumbSchema(category) {
|
|
|
45809
46015
|
}
|
|
45810
46016
|
|
|
45811
46017
|
var IkasPage = mobxReactLite.observer(function (_a) {
|
|
45812
|
-
var propValuesStr = _a.propValuesStr, pageType = _a.pageType, pageTitle = _a.pageTitle, pageDescription = _a.pageDescription, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettingsStr = _a.merchantSettingsStr, configJson = _a.configJson, reInitOnBrowser = _a.reInitOnBrowser, addOgpMetas = _a.addOgpMetas
|
|
46018
|
+
var propValuesStr = _a.propValuesStr, pageType = _a.pageType, pageTitle = _a.pageTitle, pageDescription = _a.pageDescription, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettingsStr = _a.merchantSettingsStr, configJson = _a.configJson, reInitOnBrowser = _a.reInitOnBrowser, addOgpMetas = _a.addOgpMetas;
|
|
45813
46019
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
45814
|
-
IkasStorefrontConfig.currentPageComponents = components;
|
|
45815
46020
|
var store = IkasStorefrontConfig.store;
|
|
45816
46021
|
store.currentPageType = pageType;
|
|
45817
46022
|
var router$1 = router.useRouter();
|
|
@@ -58005,7 +58210,7 @@ function template_formatter (template) {
|
|
|
58005
58210
|
// The result is `{ text: '8 (80 )', caret: 4 }`.
|
|
58006
58211
|
//
|
|
58007
58212
|
|
|
58008
|
-
function format(value, caret, formatter) {
|
|
58213
|
+
function format$1(value, caret, formatter) {
|
|
58009
58214
|
if (typeof formatter === 'string') {
|
|
58010
58215
|
formatter = template_formatter(formatter);
|
|
58011
58216
|
}
|
|
@@ -58207,7 +58412,7 @@ function formatInputText(input, _parse, _format, operation, on_change) {
|
|
|
58207
58412
|
// (and reposition the caret accordingly)
|
|
58208
58413
|
|
|
58209
58414
|
|
|
58210
|
-
var formatted = format(value, caret, _format);
|
|
58415
|
+
var formatted = format$1(value, caret, _format);
|
|
58211
58416
|
var text = formatted.text;
|
|
58212
58417
|
caret = formatted.caret; // Set `<input/>` textual value manually
|
|
58213
58418
|
// to prevent React from resetting the caret position
|
|
@@ -63108,7 +63313,7 @@ function createInput$1(defaultMetadata) {
|
|
|
63108
63313
|
// Working around this issue with this simple hack.
|
|
63109
63314
|
|
|
63110
63315
|
if (newValue === value) {
|
|
63111
|
-
var newValueFormatted = format$
|
|
63316
|
+
var newValueFormatted = format$2(prefix, newValue, country, metadata);
|
|
63112
63317
|
|
|
63113
63318
|
if (newValueFormatted.indexOf(event.target.value) === 0) {
|
|
63114
63319
|
// Trim the last digit (or plus sign).
|
|
@@ -63121,7 +63326,7 @@ function createInput$1(defaultMetadata) {
|
|
|
63121
63326
|
|
|
63122
63327
|
return React__default['default'].createElement(Input, _extends$2({}, rest, {
|
|
63123
63328
|
ref: ref,
|
|
63124
|
-
value: format$
|
|
63329
|
+
value: format$2(prefix, value, country, metadata),
|
|
63125
63330
|
onChange: _onChange
|
|
63126
63331
|
}));
|
|
63127
63332
|
}
|
|
@@ -63192,7 +63397,7 @@ function createInput$1(defaultMetadata) {
|
|
|
63192
63397
|
}
|
|
63193
63398
|
var InputBasic = createInput$1();
|
|
63194
63399
|
|
|
63195
|
-
function format$
|
|
63400
|
+
function format$2(prefix, value, country, metadata) {
|
|
63196
63401
|
return removeInputValuePrefix(formatIncompletePhoneNumber(prefix + value, country, metadata), prefix);
|
|
63197
63402
|
}
|
|
63198
63403
|
|
|
@@ -69019,7 +69224,7 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
69019
69224
|
});
|
|
69020
69225
|
}); };
|
|
69021
69226
|
this.listCountries = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
69022
|
-
var _a, countries, currentRouting_1, currentCountry;
|
|
69227
|
+
var _a, countries, currentRouting_1, otherRoutings_1, currentCountry;
|
|
69023
69228
|
var _this = this;
|
|
69024
69229
|
var _b, _c;
|
|
69025
69230
|
return __generator(this, function (_d) {
|
|
@@ -69039,6 +69244,13 @@ var AddressFormViewModel = /** @class */ (function () {
|
|
|
69039
69244
|
if ((_c = currentRouting_1 === null || currentRouting_1 === void 0 ? void 0 : currentRouting_1.countryCodes) === null || _c === void 0 ? void 0 : _c.length) {
|
|
69040
69245
|
countries = countries.filter(function (c) { var _a; return c.iso2 && ((_a = currentRouting_1.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2)); });
|
|
69041
69246
|
}
|
|
69247
|
+
else {
|
|
69248
|
+
otherRoutings_1 = IkasStorefrontConfig.routings.filter(function (r) { return r.id !== IkasStorefrontConfig.storefrontRoutingId; });
|
|
69249
|
+
countries = countries.filter(function (c) {
|
|
69250
|
+
return c.iso2 &&
|
|
69251
|
+
!otherRoutings_1.some(function (otherRouting) { var _a; return (_a = otherRouting.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2); });
|
|
69252
|
+
});
|
|
69253
|
+
}
|
|
69042
69254
|
this.countries = countries;
|
|
69043
69255
|
if (this.countries.length === 1 && !this.country)
|
|
69044
69256
|
this.onCountryChange(this.countries[0].id);
|
|
@@ -71171,7 +71383,7 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
|
|
|
71171
71383
|
var _b, _c, _d;
|
|
71172
71384
|
var vm = _a.vm, pageComponent = _a.pageComponent;
|
|
71173
71385
|
var ref = React.useRef(null);
|
|
71174
|
-
var store = IkasStorefrontConfig.store,
|
|
71386
|
+
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
71175
71387
|
React.useEffect(function () {
|
|
71176
71388
|
vm.setComponentRef(ref.current, pageComponent);
|
|
71177
71389
|
}, []);
|
|
@@ -71187,11 +71399,7 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
|
|
|
71187
71399
|
var propValues = (_c = pageComponentPropValue.get()) === null || _c === void 0 ? void 0 : _c.propValues;
|
|
71188
71400
|
if (!propValues)
|
|
71189
71401
|
return null;
|
|
71190
|
-
|
|
71191
|
-
console.error("Components for the page not found.");
|
|
71192
|
-
return null;
|
|
71193
|
-
}
|
|
71194
|
-
var Component = currentPageComponents[pageComponent.componentId];
|
|
71402
|
+
var Component = components[pageComponent.componentId];
|
|
71195
71403
|
if (((_d = vm.page) === null || _d === void 0 ? void 0 : _d.type) === exports.IkasThemePageType.CHECKOUT) {
|
|
71196
71404
|
//@ts-ignore
|
|
71197
71405
|
Component = IkasCheckoutPage$1;
|
|
@@ -71200,7 +71408,7 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
|
|
|
71200
71408
|
cart: new IkasCart({
|
|
71201
71409
|
items: [
|
|
71202
71410
|
new IkasOrderLineItem({
|
|
71203
|
-
currencyCode: "
|
|
71411
|
+
currencyCode: "TRY",
|
|
71204
71412
|
finalPrice: 100,
|
|
71205
71413
|
finalPriceWithQuantity: 100,
|
|
71206
71414
|
price: 100,
|
|
@@ -72059,13 +72267,10 @@ var cart$1 = /*#__PURE__*/Object.freeze({
|
|
|
72059
72267
|
|
|
72060
72268
|
var IkasPageEditor$1 = dynamic__default['default'](function () { return Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.IkasPageEditor; }); }, { ssr: false });
|
|
72061
72269
|
var Page$c = function (_a) {
|
|
72062
|
-
var configJson = _a.configJson
|
|
72270
|
+
var configJson = _a.configJson;
|
|
72063
72271
|
if (configJson) {
|
|
72064
72272
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
72065
72273
|
}
|
|
72066
|
-
if (components) {
|
|
72067
|
-
IkasStorefrontConfig.currentPageComponents = components;
|
|
72068
|
-
}
|
|
72069
72274
|
return React.createElement(IkasPageEditor$1, null);
|
|
72070
72275
|
};
|
|
72071
72276
|
var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -73552,7 +73757,6 @@ exports.IkasCategory = IkasCategory;
|
|
|
73552
73757
|
exports.IkasCategoryAPI = IkasCategoryAPI;
|
|
73553
73758
|
exports.IkasCategoryList = IkasCategoryList;
|
|
73554
73759
|
exports.IkasCategoryListPropValue = IkasCategoryListPropValue;
|
|
73555
|
-
exports.IkasCategoryPath = IkasCategoryPath;
|
|
73556
73760
|
exports.IkasCategoryPropValue = IkasCategoryPropValue;
|
|
73557
73761
|
exports.IkasCheckout = IkasCheckout;
|
|
73558
73762
|
exports.IkasCheckoutAPI = IkasCheckoutAPI;
|
|
@@ -73571,7 +73775,6 @@ exports.IkasCustomerReviewList = IkasCustomerReviewList;
|
|
|
73571
73775
|
exports.IkasDistrictAPI = IkasDistrictAPI;
|
|
73572
73776
|
exports.IkasFavoriteProduct = IkasFavoriteProduct;
|
|
73573
73777
|
exports.IkasFavoriteProductAPI = IkasFavoriteProductAPI;
|
|
73574
|
-
exports.IkasFilterCategory = IkasFilterCategory;
|
|
73575
73778
|
exports.IkasHTMLMetaData = IkasHTMLMetaData;
|
|
73576
73779
|
exports.IkasHTMLMetaDataAPI = IkasHTMLMetaDataAPI;
|
|
73577
73780
|
exports.IkasImage = IkasImage;
|
|
@@ -73652,6 +73855,7 @@ exports.decodeBase64 = decodeBase64;
|
|
|
73652
73855
|
exports.findAllIndexes = findAllIndexes;
|
|
73653
73856
|
exports.formatDate = formatDate;
|
|
73654
73857
|
exports.formatMoney = formatMoney;
|
|
73858
|
+
exports.getCurrencySymbol = getCurrencySymbol;
|
|
73655
73859
|
exports.parseRangeStr = parseRangeStr;
|
|
73656
73860
|
exports.pascalCase = pascalCase;
|
|
73657
73861
|
exports.stringSorter = stringSorter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./blog/index";
|
|
2
2
|
export { IkasBrand } from "./brand/index";
|
|
3
|
-
export { IkasCategory
|
|
3
|
+
export { IkasCategory } from "./category/index";
|
|
4
4
|
export * from "./checkout/index";
|
|
5
5
|
export type { IkasCity } from "./city/index";
|
|
6
6
|
export * from "./customer/address/index";
|
package/build/pages/editor.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
import { GetStaticProps } from "next";
|
|
3
3
|
declare type Props = {
|
|
4
4
|
configJson: Record<string, any>;
|
|
5
|
-
components?: Record<string, any>;
|
|
6
5
|
};
|
|
7
6
|
export declare const getStaticProps: GetStaticProps;
|
|
8
7
|
declare const _default: React.FunctionComponent<Props>;
|
package/build/pages/index.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import * as IndexPage from "./home";
|
|
2
|
+
import * as SlugPage from "./[slug]/index";
|
|
3
|
+
import * as CustomPage from "./pages/[slug]";
|
|
4
|
+
import * as CheckoutPage from "./checkout";
|
|
5
|
+
import * as AccountPage from "./account/index";
|
|
6
|
+
import * as AddressesPage from "./account/addresses";
|
|
7
|
+
import * as OrdersPage from "./account/orders/index";
|
|
8
|
+
import * as OrderDetailPage from "./account/orders/[id]";
|
|
9
|
+
import * as LoginPage from "./account/login";
|
|
10
|
+
import * as RegisterPage from "./account/register";
|
|
11
|
+
import * as ForgotPasswordPage from "./account/forgot-password";
|
|
12
|
+
import * as RecoverPasswordPage from "./account/recover-password";
|
|
13
|
+
import * as CartPage from "./cart";
|
|
14
|
+
import * as EditorPage from "./editor";
|
|
15
|
+
import * as FavoriteProductsPage from "./account/favorite-products";
|
|
16
|
+
import * as SearchPage from "./search";
|
|
17
|
+
import * as NotFoundPage from "./404";
|
|
18
|
+
import * as BlogPage from "./blog/index";
|
|
19
|
+
import * as BlogSlugPage from "./blog/[slug]";
|
|
20
|
+
export { IndexPage, SlugPage, CustomPage, CheckoutPage, AccountPage, AddressesPage, OrdersPage, OrderDetailPage, LoginPage, RegisterPage, ForgotPasswordPage, RecoverPasswordPage, CartPage, EditorPage, FavoriteProductsPage, SearchPage, NotFoundPage, BlogPage, BlogSlugPage, };
|
|
@@ -3,7 +3,7 @@ import { IkasCategoryListParams } from "../models/ui/category-list/index";
|
|
|
3
3
|
import { IkasAttributeList } from "../models/ui/product-attribute-list/index";
|
|
4
4
|
import { IkasProductListParams } from "../models/ui/product-list/index";
|
|
5
5
|
import { NextRouter } from "next/router";
|
|
6
|
-
import { IkasThemeSettings, IkasThemeComponentProp, IkasBrandListParams, IkasBrandList, IkasCategoryList, IkasProductList, IkasProductDetail, IkasAttributeDetail, IkasNavigationLink, IkasImage, IkasThemeCustomData, IkasComponentRenderer, IkasBlogListParams, IkasBlogList, IkasBlogCategoryListParams, IkasBlogCategoryList } from "../
|
|
6
|
+
import { IkasThemeSettings, IkasThemeComponentProp, IkasBrandListParams, IkasBrandList, IkasCategoryList, IkasProductList, IkasProductDetail, IkasAttributeDetail, IkasNavigationLink, IkasImage, IkasThemeCustomData, IkasComponentRenderer, IkasBlogListParams, IkasBlogList, IkasBlogCategoryListParams, IkasBlogCategoryList } from "../index";
|
|
7
7
|
import { IkasPageComponentPropValue } from "./page-data-get";
|
|
8
8
|
import { IkasAttributePropValueData } from "./prop-value/attribute";
|
|
9
9
|
import { IkasAttributeListPropValueData } from "./prop-value/attribute-list";
|
|
@@ -7,6 +7,7 @@ import { IkasBaseStore } from "../store/index";
|
|
|
7
7
|
import { IkasCustomerReviewSettings } from "../models/index";
|
|
8
8
|
export declare class IkasStorefrontConfig {
|
|
9
9
|
static store: IkasBaseStore;
|
|
10
|
+
static components: any;
|
|
10
11
|
static config: Record<string, any>;
|
|
11
12
|
static apiUrlOverride: string | null;
|
|
12
13
|
static domain: string;
|
|
@@ -27,8 +28,7 @@ export declare class IkasStorefrontConfig {
|
|
|
27
28
|
static isEditor: boolean;
|
|
28
29
|
static customerReviewSettings: IkasCustomerReviewSettings | null;
|
|
29
30
|
static productBackInStockSettings: IkasProductBackInStockSettings | null;
|
|
30
|
-
static
|
|
31
|
-
static init(store: IkasBaseStore, config: Record<string, any>, apiUrlOverride?: string): void;
|
|
31
|
+
static init(store: IkasBaseStore, components: any, config: Record<string, any>, apiUrlOverride?: string): void;
|
|
32
32
|
static initWithJson(json: Record<string, any>): void;
|
|
33
33
|
static getCurrentLocale(): string;
|
|
34
34
|
static getJson(): {
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.12",
|
|
4
4
|
"main": "./build/index.js",
|
|
5
5
|
"module": "./build/index.es.js",
|
|
6
6
|
"author": "Umut Ozan Yıldırım",
|
|
7
7
|
"license": "ISC",
|
|
8
|
-
"sideEffects": false,
|
|
9
8
|
"files": [
|
|
10
9
|
"/build"
|
|
11
10
|
],
|
|
12
11
|
"scripts": {
|
|
13
|
-
"build": "rm -rf build && rollup -c",
|
|
12
|
+
"build": "rm -rf ./build && rollup -c",
|
|
14
13
|
"prepare": "npm run build",
|
|
15
14
|
"lint": "eslint 'src/**/*.{js,ts,tsx}' --quiet --fix",
|
|
16
15
|
"test": "jest",
|
|
@@ -40,7 +39,6 @@
|
|
|
40
39
|
"@babel/core": "^7.11.6",
|
|
41
40
|
"@rollup/plugin-commonjs": "^17.1.0",
|
|
42
41
|
"@rollup/plugin-json": "^4.1.0",
|
|
43
|
-
"@rollup/plugin-multi-entry": "^4.1.0",
|
|
44
42
|
"@rollup/plugin-node-resolve": "^11.1.1",
|
|
45
43
|
"@testing-library/jest-dom": "^5.11.4",
|
|
46
44
|
"@testing-library/react": "^11.0.4",
|
|
@@ -82,7 +80,6 @@
|
|
|
82
80
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
83
81
|
"rollup-plugin-postcss": "^4.0.0",
|
|
84
82
|
"rollup-plugin-sass": "^1.2.2",
|
|
85
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
86
83
|
"rollup-plugin-typescript": "^1.0.1",
|
|
87
84
|
"rollup-plugin-typescript2": "^0.29.0",
|
|
88
85
|
"rollup-watch": "^4.3.1",
|