@ikas/storefront 0.0.54 → 0.0.56

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.
Files changed (28) hide show
  1. package/build/api/brand/__generated__/listProductBrand.d.ts +1 -1
  2. package/build/api/cart/__generated__/getCart.d.ts +2 -2
  3. package/build/api/cart/__generated__/saveItemToCart.d.ts +2 -2
  4. package/build/api/category/__generated__/listCategory.d.ts +2 -1
  5. package/build/api/checkout/__generated__/getCheckoutByCartId.d.ts +1 -1
  6. package/build/api/checkout/__generated__/getCheckoutById.d.ts +3 -3
  7. package/build/api/checkout/__generated__/listPaymentGateway.d.ts +1 -1
  8. package/build/api/checkout/__generated__/saveCheckout.d.ts +1 -1
  9. package/build/api/city/__generated__/listCity.d.ts +1 -1
  10. package/build/api/country/__generated__/listCountry.d.ts +1 -1
  11. package/build/api/customer/__generated__/customerLogin.d.ts +2 -2
  12. package/build/api/customer/__generated__/getCustomerOrders.d.ts +3 -3
  13. package/build/api/customer/__generated__/getMyCustomer.d.ts +2 -2
  14. package/build/api/customer/__generated__/listOrderTransactions.d.ts +1 -1
  15. package/build/api/customer/__generated__/registerCustomer.d.ts +2 -2
  16. package/build/api/customer/__generated__/saveMyCustomer.d.ts +2 -2
  17. package/build/api/district/__generated__/listDistrict.d.ts +1 -1
  18. package/build/api/favorite-product/__generated__/listFavoriteProducts.d.ts +1 -1
  19. package/build/api/product/__generated__/listProduct.d.ts +2 -2
  20. package/build/api/product-attribute/__generated__/listProductAttribute.d.ts +2 -2
  21. package/build/api/state/__generated__/listState.d.ts +1 -1
  22. package/build/api/stock-location/__generated__/listStockLocation.d.ts +1 -1
  23. package/build/api/storefront/__generated__/getStorefront.d.ts +2 -2
  24. package/build/api/variant-type/__generated__/listVariantType.d.ts +2 -2
  25. package/build/components/image/index.d.ts +33 -1
  26. package/build/index.es.js +65 -15
  27. package/build/index.js +65 -15
  28. package/package.json +3 -3
@@ -10,7 +10,7 @@ export interface listProductBrand_listProductBrand_data_metaData {
10
10
  }
11
11
  export interface listProductBrand_listProductBrand_data {
12
12
  __typename: "ProductBrand";
13
- id: string | null;
13
+ id: string;
14
14
  name: string;
15
15
  imageId: string | null;
16
16
  metaData: listProductBrand_listProductBrand_data_metaData | null;
@@ -32,7 +32,7 @@ export interface getCart_getCart_items {
32
32
  discount: getCart_getCart_items_discount | null;
33
33
  discountPrice: number | null;
34
34
  finalPrice: number | null;
35
- id: string | null;
35
+ id: string;
36
36
  originalOrderLineItemId: string | null;
37
37
  price: number;
38
38
  quantity: number;
@@ -50,7 +50,7 @@ export interface getCart_getCart {
50
50
  currencyCode: string | null;
51
51
  customerId: string | null;
52
52
  dueDate: any;
53
- id: string | null;
53
+ id: string;
54
54
  itemCount: number;
55
55
  items: getCart_getCart_items[];
56
56
  merchantId: string;
@@ -33,7 +33,7 @@ export interface saveItemToCart_saveItemToCart_items {
33
33
  discount: saveItemToCart_saveItemToCart_items_discount | null;
34
34
  discountPrice: number | null;
35
35
  finalPrice: number | null;
36
- id: string | null;
36
+ id: string;
37
37
  originalOrderLineItemId: string | null;
38
38
  price: number;
39
39
  quantity: number;
@@ -46,7 +46,7 @@ export interface saveItemToCart_saveItemToCart_items {
46
46
  }
47
47
  export interface saveItemToCart_saveItemToCart {
48
48
  __typename: "Cart";
49
- id: string | null;
49
+ id: string;
50
50
  createdAt: any | null;
51
51
  updatedAt: any | null;
52
52
  dueDate: any;
@@ -10,7 +10,7 @@ export interface listCategory_listCategory_data_metaData {
10
10
  }
11
11
  export interface listCategory_listCategory_data {
12
12
  __typename: "Category";
13
- id: string | null;
13
+ id: string;
14
14
  createdAt: any | null;
15
15
  updatedAt: any | null;
16
16
  deleted: boolean | null;
@@ -18,6 +18,7 @@ export interface listCategory_listCategory_data {
18
18
  parentId: string | null;
19
19
  imageId: string | null;
20
20
  metaData: listCategory_listCategory_data_metaData | null;
21
+ categoryPath: string[] | null;
21
22
  }
22
23
  export interface listCategory_listCategory {
23
24
  __typename: "CategoryPaginationResponse";
@@ -1,6 +1,6 @@
1
1
  export interface getCheckoutByCartId_getCheckoutByCartId {
2
2
  __typename: "Checkout";
3
- id: string | null;
3
+ id: string;
4
4
  }
5
5
  export interface getCheckoutByCartId {
6
6
  getCheckoutByCartId: getCheckoutByCartId_getCheckoutByCartId;
@@ -138,7 +138,7 @@ export interface getCheckoutById_getCheckoutById_cart_items {
138
138
  discount: getCheckoutById_getCheckoutById_cart_items_discount | null;
139
139
  discountPrice: number | null;
140
140
  finalPrice: number | null;
141
- id: string | null;
141
+ id: string;
142
142
  originalOrderLineItemId: string | null;
143
143
  price: number;
144
144
  quantity: number;
@@ -156,7 +156,7 @@ export interface getCheckoutById_getCheckoutById_cart {
156
156
  currencyCode: string | null;
157
157
  customerId: string | null;
158
158
  dueDate: any;
159
- id: string | null;
159
+ id: string;
160
160
  itemCount: number;
161
161
  items: getCheckoutById_getCheckoutById_cart_items[];
162
162
  merchantId: string;
@@ -182,7 +182,7 @@ export interface getCheckoutById_getCheckoutById {
182
182
  createdAt: any | null;
183
183
  customer: getCheckoutById_getCheckoutById_customer | null;
184
184
  deleted: boolean | null;
185
- id: string | null;
185
+ id: string;
186
186
  merchantId: string;
187
187
  orderId: string | null;
188
188
  orderNumber: string | null;
@@ -8,7 +8,7 @@ export interface listPaymentGateway_listPaymentGateway {
8
8
  __typename: "PaymentGateway";
9
9
  paymentMethods: listPaymentGateway_listPaymentGateway_paymentMethods[];
10
10
  paymentMethodType: PaymentMethodEnum;
11
- id: string | null;
11
+ id: string;
12
12
  name: string;
13
13
  testMode: boolean | null;
14
14
  }
@@ -1,7 +1,7 @@
1
1
  import { SaveCheckoutInput } from "../../../__generated__/global-types";
2
2
  export interface saveCheckout_saveCheckout {
3
3
  __typename: "Checkout";
4
- id: string | null;
4
+ id: string;
5
5
  }
6
6
  export interface saveCheckout {
7
7
  saveCheckout: saveCheckout_saveCheckout;
@@ -1,7 +1,7 @@
1
1
  import { StringFilterInput } from "../../../__generated__/global-types";
2
2
  export interface listCity_listCity {
3
3
  __typename: "City";
4
- id: string | null;
4
+ id: string;
5
5
  name: string;
6
6
  order: number | null;
7
7
  }
@@ -5,7 +5,7 @@ export interface listCountry_listCountry_locationTranslations {
5
5
  }
6
6
  export interface listCountry_listCountry {
7
7
  __typename: "Country";
8
- id: string | null;
8
+ id: string;
9
9
  name: string;
10
10
  iso3: string | null;
11
11
  phoneCode: string | null;
@@ -31,7 +31,7 @@ export interface customerLogin_customerLogin_customer_addresses {
31
31
  company: string | null;
32
32
  country: customerLogin_customerLogin_customer_addresses_country;
33
33
  district: customerLogin_customerLogin_customer_addresses_district | null;
34
- id: string | null;
34
+ id: string;
35
35
  firstName: string;
36
36
  isDefault: boolean | null;
37
37
  lastName: string;
@@ -43,7 +43,7 @@ export interface customerLogin_customerLogin_customer_addresses {
43
43
  }
44
44
  export interface customerLogin_customerLogin_customer {
45
45
  __typename: "Customer";
46
- id: string | null;
46
+ id: string;
47
47
  isEmailVerified: boolean | null;
48
48
  isPhoneVerified: boolean | null;
49
49
  lastName: string | null;
@@ -95,7 +95,7 @@ export interface getCustomerOrders_getCustomerOrders_orderLineItems {
95
95
  discount: getCustomerOrders_getCustomerOrders_orderLineItems_discount | null;
96
96
  discountPrice: number | null;
97
97
  finalPrice: number | null;
98
- id: string | null;
98
+ id: string;
99
99
  originalOrderLineItemId: string | null;
100
100
  price: number;
101
101
  quantity: number;
@@ -121,7 +121,7 @@ export interface getCustomerOrders_getCustomerOrders_orderPackages {
121
121
  orderPackageNumber: string;
122
122
  orderPackageFulfillStatus: OrderPackageFulfillStatusEnum;
123
123
  orderLineItemIds: string[];
124
- id: string | null;
124
+ id: string;
125
125
  deleted: boolean | null;
126
126
  createdAt: any | null;
127
127
  }
@@ -188,7 +188,7 @@ export interface getCustomerOrders_getCustomerOrders {
188
188
  currencyRates: getCustomerOrders_getCustomerOrders_currencyRates[];
189
189
  customer: getCustomerOrders_getCustomerOrders_customer | null;
190
190
  deleted: boolean | null;
191
- id: string | null;
191
+ id: string;
192
192
  merchantId: string;
193
193
  note: string | null;
194
194
  orderedAt: any | null;
@@ -31,7 +31,7 @@ export interface getMyCustomer_getMyCustomer_addresses {
31
31
  company: string | null;
32
32
  country: getMyCustomer_getMyCustomer_addresses_country;
33
33
  district: getMyCustomer_getMyCustomer_addresses_district | null;
34
- id: string | null;
34
+ id: string;
35
35
  firstName: string;
36
36
  isDefault: boolean | null;
37
37
  lastName: string;
@@ -44,7 +44,7 @@ export interface getMyCustomer_getMyCustomer_addresses {
44
44
  }
45
45
  export interface getMyCustomer_getMyCustomer {
46
46
  __typename: "Customer";
47
- id: string | null;
47
+ id: string;
48
48
  isEmailVerified: boolean | null;
49
49
  isPhoneVerified: boolean | null;
50
50
  lastName: string | null;
@@ -31,7 +31,7 @@ export interface listOrderTransactions_listOrderTransactions {
31
31
  customerId: string | null;
32
32
  deleted: boolean | null;
33
33
  error: listOrderTransactions_listOrderTransactions_error | null;
34
- id: string | null;
34
+ id: string;
35
35
  orderId: string | null;
36
36
  paymentGatewayId: string;
37
37
  paymentGatewayName: string;
@@ -31,7 +31,7 @@ export interface registerCustomer_registerCustomer_customer_addresses {
31
31
  company: string | null;
32
32
  country: registerCustomer_registerCustomer_customer_addresses_country;
33
33
  district: registerCustomer_registerCustomer_customer_addresses_district | null;
34
- id: string | null;
34
+ id: string;
35
35
  firstName: string;
36
36
  isDefault: boolean | null;
37
37
  lastName: string;
@@ -43,7 +43,7 @@ export interface registerCustomer_registerCustomer_customer_addresses {
43
43
  }
44
44
  export interface registerCustomer_registerCustomer_customer {
45
45
  __typename: "Customer";
46
- id: string | null;
46
+ id: string;
47
47
  isEmailVerified: boolean | null;
48
48
  isPhoneVerified: boolean | null;
49
49
  lastName: string | null;
@@ -31,7 +31,7 @@ export interface saveMyCustomer_saveMyCustomer_addresses {
31
31
  company: string | null;
32
32
  country: saveMyCustomer_saveMyCustomer_addresses_country;
33
33
  district: saveMyCustomer_saveMyCustomer_addresses_district | null;
34
- id: string | null;
34
+ id: string;
35
35
  firstName: string;
36
36
  isDefault: boolean | null;
37
37
  lastName: string;
@@ -44,7 +44,7 @@ export interface saveMyCustomer_saveMyCustomer_addresses {
44
44
  }
45
45
  export interface saveMyCustomer_saveMyCustomer {
46
46
  __typename: "Customer";
47
- id: string | null;
47
+ id: string;
48
48
  isEmailVerified: boolean | null;
49
49
  isPhoneVerified: boolean | null;
50
50
  lastName: string | null;
@@ -1,7 +1,7 @@
1
1
  import { StringFilterInput } from "../../../__generated__/global-types";
2
2
  export interface listDistrict_listDistrict {
3
3
  __typename: "District";
4
- id: string | null;
4
+ id: string;
5
5
  name: string;
6
6
  }
7
7
  export interface listDistrict {
@@ -1,6 +1,6 @@
1
1
  export interface listFavoriteProducts_listFavoriteProducts {
2
2
  __typename: "CustomerFavoriteProduct";
3
- id: string | null;
3
+ id: string;
4
4
  createdAt: any | null;
5
5
  updatedAt: any | null;
6
6
  deleted: boolean | null;
@@ -40,7 +40,7 @@ export interface listProduct_listProduct_data_variants_prices {
40
40
  }
41
41
  export interface listProduct_listProduct_data_variants {
42
42
  __typename: "Variant";
43
- id: string | null;
43
+ id: string;
44
44
  createdAt: any | null;
45
45
  updatedAt: any | null;
46
46
  deleted: boolean | null;
@@ -60,7 +60,7 @@ export interface listProduct_listProduct_data_attributes {
60
60
  }
61
61
  export interface listProduct_listProduct_data {
62
62
  __typename: "Product";
63
- id: string | null;
63
+ id: string;
64
64
  createdAt: any | null;
65
65
  updatedAt: any | null;
66
66
  deleted: boolean | null;
@@ -1,7 +1,7 @@
1
1
  import { StringFilterInput, ProductAttributeTypeEnum } from "../../../__generated__/global-types";
2
2
  export interface listProductAttribute_listProductAttribute_options {
3
3
  __typename: "ProductAttributeOption";
4
- id: string | null;
4
+ id: string;
5
5
  createdAt: any | null;
6
6
  updatedAt: any | null;
7
7
  deleted: boolean | null;
@@ -9,7 +9,7 @@ export interface listProductAttribute_listProductAttribute_options {
9
9
  }
10
10
  export interface listProductAttribute_listProductAttribute {
11
11
  __typename: "ProductAttribute";
12
- id: string | null;
12
+ id: string;
13
13
  createdAt: any | null;
14
14
  updatedAt: any | null;
15
15
  deleted: boolean | null;
@@ -1,7 +1,7 @@
1
1
  import { StringFilterInput } from "../../../__generated__/global-types";
2
2
  export interface listState_listState {
3
3
  __typename: "State";
4
- id: string | null;
4
+ id: string;
5
5
  name: string;
6
6
  stateCode: string | null;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  export interface listStockLocation_listStockLocation {
2
2
  __typename: "StockLocation";
3
- id: string | null;
3
+ id: string;
4
4
  }
5
5
  export interface listStockLocation {
6
6
  listStockLocation: listStockLocation_listStockLocation[];
@@ -1,6 +1,6 @@
1
1
  export interface getStorefront_getStorefront_regions {
2
2
  __typename: "StorefrontRegion";
3
- id: string | null;
3
+ id: string;
4
4
  locale: string;
5
5
  privacyPolicy: string | null;
6
6
  returnPolicy: string | null;
@@ -8,7 +8,7 @@ export interface getStorefront_getStorefront_regions {
8
8
  }
9
9
  export interface getStorefront_getStorefront {
10
10
  __typename: "Storefront";
11
- id: string | null;
11
+ id: string;
12
12
  name: string;
13
13
  themeId: string;
14
14
  themeVersionId: string;
@@ -1,7 +1,7 @@
1
1
  import { StringFilterInput, VariantSelectionTypeEnum } from "../../../__generated__/global-types";
2
2
  export interface listVariantType_listVariantType_values {
3
3
  __typename: "VariantValue";
4
- id: string | null;
4
+ id: string;
5
5
  createdAt: any | null;
6
6
  updatedAt: any | null;
7
7
  deleted: boolean | null;
@@ -11,7 +11,7 @@ export interface listVariantType_listVariantType_values {
11
11
  }
12
12
  export interface listVariantType_listVariantType {
13
13
  __typename: "VariantType";
14
- id: string | null;
14
+ id: string;
15
15
  createdAt: any | null;
16
16
  updatedAt: any | null;
17
17
  deleted: boolean | null;
@@ -1,3 +1,35 @@
1
1
  import * as React from "react";
2
- import { ImageProps } from "next/image";
2
+ import { ImageLoader } from "next/image";
3
+ import { IkasImage } from "../../models/index";
3
4
  export declare const Image: React.FC<ImageProps>;
5
+ declare const VALID_LAYOUT_VALUES: readonly [
6
+ "fill",
7
+ "fixed",
8
+ "intrinsic",
9
+ "responsive",
10
+ undefined
11
+ ];
12
+ declare type LayoutValue = typeof VALID_LAYOUT_VALUES[number];
13
+ declare type ImgElementStyle = NonNullable<JSX.IntrinsicElements["img"]["style"]>;
14
+ declare type ImageProps = Omit<JSX.IntrinsicElements["img"], "src" | "srcSet" | "ref" | "width" | "height" | "loading" | "style"> & {
15
+ loader?: ImageLoader;
16
+ priority?: boolean;
17
+ loading?: "lazy" | "eager" | undefined;
18
+ objectFit?: ImgElementStyle["objectFit"];
19
+ objectPosition?: ImgElementStyle["objectPosition"];
20
+ image: IkasImage;
21
+ sizes: string;
22
+ } & ({
23
+ width?: never;
24
+ height?: never;
25
+ unsized: true;
26
+ } | {
27
+ width?: never;
28
+ height?: never;
29
+ layout: "fill";
30
+ } | {
31
+ width: number | string;
32
+ height: number | string;
33
+ layout?: Exclude<LayoutValue, "fill">;
34
+ });
35
+ export {};
package/build/index.es.js CHANGED
@@ -12356,17 +12356,14 @@ var IkasImage = /** @class */ (function () {
12356
12356
  });
12357
12357
  Object.defineProperty(IkasImage.prototype, "src", {
12358
12358
  get: function () {
12359
- return this.getSrc(1920);
12359
+ return this.getSrc(1080);
12360
12360
  },
12361
12361
  enumerable: false,
12362
12362
  configurable: true
12363
12363
  });
12364
12364
  Object.defineProperty(IkasImage.prototype, "thumbnailSrc", {
12365
12365
  get: function () {
12366
- if (this.id.includes("/"))
12367
- return "" + process.env.NEXT_PUBLIC_IMG_BASE_URL + this.id + "/128/128/img.webp";
12368
- var merchantId = decodeBase64(this.editorApiKey || IkasStorefrontConfig.config.apiKey || "");
12369
- return "" + process.env.NEXT_PUBLIC_IMG_BASE_URL + merchantId + "/" + this.id + "/128/128/img.webp";
12366
+ return this.getSrc(180);
12370
12367
  },
12371
12368
  enumerable: false,
12372
12369
  configurable: true
@@ -21784,14 +21781,14 @@ var IkasCategoryAPI = /** @class */ (function () {
21784
21781
  }
21785
21782
  IkasCategoryAPI.listCategories = function (params) {
21786
21783
  return __awaiter(this, void 0, void 0, function () {
21787
- var LIST_QUERY, _a, data, errors, count, categories, err_1;
21784
+ var LIST_QUERY, _a, data, errors, count, categories, _loop_1, this_1, i, err_1, err_2;
21788
21785
  return __generator(this, function (_b) {
21789
21786
  switch (_b.label) {
21790
21787
  case 0:
21791
- LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "])));
21788
+ LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "])));
21792
21789
  _b.label = 1;
21793
21790
  case 1:
21794
- _b.trys.push([1, 3, , 4]);
21791
+ _b.trys.push([1, 10, , 11]);
21795
21792
  return [4 /*yield*/, apollo
21796
21793
  .getClient()
21797
21794
  .query({
@@ -21831,18 +21828,66 @@ var IkasCategoryAPI = /** @class */ (function () {
21831
21828
  image: c.imageId ? new IkasImage(c.imageId) : undefined,
21832
21829
  });
21833
21830
  });
21834
- return [2 /*return*/, {
21835
- categories: categories,
21836
- count: count,
21837
- }];
21831
+ _b.label = 3;
21838
21832
  case 3:
21833
+ _b.trys.push([3, 8, , 9]);
21834
+ _loop_1 = function (i) {
21835
+ var categoryPath, path_1, listCategoriesResult_1;
21836
+ return __generator(this, function (_a) {
21837
+ switch (_a.label) {
21838
+ case 0:
21839
+ categoryPath = data.listCategory.data[i].categoryPath;
21840
+ if (!(categoryPath && categoryPath.length)) return [3 /*break*/, 2];
21841
+ path_1 = [];
21842
+ return [4 /*yield*/, this_1.listCategories({
21843
+ idList: categoryPath,
21844
+ })];
21845
+ case 1:
21846
+ listCategoriesResult_1 = _a.sent();
21847
+ categoryPath.forEach(function (categoryId) {
21848
+ var _a;
21849
+ var category = listCategoriesResult_1.categories.find(function (c) { return c.id === categoryId; });
21850
+ path_1.push(new IkasCategoryPath({
21851
+ id: category.id,
21852
+ name: category.name,
21853
+ slug: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.slug,
21854
+ }));
21855
+ });
21856
+ categories[i].path = path_1;
21857
+ _a.label = 2;
21858
+ case 2: return [2 /*return*/];
21859
+ }
21860
+ });
21861
+ };
21862
+ this_1 = this;
21863
+ i = 0;
21864
+ _b.label = 4;
21865
+ case 4:
21866
+ if (!(i < data.listCategory.data.length)) return [3 /*break*/, 7];
21867
+ return [5 /*yield**/, _loop_1(i)];
21868
+ case 5:
21869
+ _b.sent();
21870
+ _b.label = 6;
21871
+ case 6:
21872
+ i++;
21873
+ return [3 /*break*/, 4];
21874
+ case 7: return [3 /*break*/, 9];
21875
+ case 8:
21839
21876
  err_1 = _b.sent();
21840
21877
  console.log(err_1);
21878
+ return [3 /*break*/, 9];
21879
+ case 9: return [2 /*return*/, {
21880
+ categories: categories,
21881
+ count: count,
21882
+ }];
21883
+ case 10:
21884
+ err_2 = _b.sent();
21885
+ console.log(err_2);
21841
21886
  return [2 /*return*/, {
21842
21887
  categories: [],
21843
21888
  count: 0,
21844
21889
  }];
21845
- case 4: return [2 /*return*/];
21890
+ case 11: return [2 /*return*/];
21846
21891
  }
21847
21892
  });
21848
21893
  });
@@ -27152,8 +27197,13 @@ var pageStyle$1 = {
27152
27197
  justifyContent: "space-between",
27153
27198
  };
27154
27199
 
27155
- var Image = function (props) {
27156
- return createElement(Image$1, __assign({}, props, { unoptimized: true, quality: 100 }));
27200
+ var Image = function (_a) {
27201
+ var image = _a.image, others = __rest(_a, ["image"]);
27202
+ var loader = function (_a) {
27203
+ var width = _a.width;
27204
+ return image.getSrc(width);
27205
+ };
27206
+ return (createElement(Image$1, __assign({}, others, { loader: loader, quality: 100, src: image.src })));
27157
27207
  };
27158
27208
 
27159
27209
  var GTMHead = function (_a) {
package/build/index.js CHANGED
@@ -12368,17 +12368,14 @@ var IkasImage = /** @class */ (function () {
12368
12368
  });
12369
12369
  Object.defineProperty(IkasImage.prototype, "src", {
12370
12370
  get: function () {
12371
- return this.getSrc(1920);
12371
+ return this.getSrc(1080);
12372
12372
  },
12373
12373
  enumerable: false,
12374
12374
  configurable: true
12375
12375
  });
12376
12376
  Object.defineProperty(IkasImage.prototype, "thumbnailSrc", {
12377
12377
  get: function () {
12378
- if (this.id.includes("/"))
12379
- return "" + process.env.NEXT_PUBLIC_IMG_BASE_URL + this.id + "/128/128/img.webp";
12380
- var merchantId = decodeBase64(this.editorApiKey || IkasStorefrontConfig.config.apiKey || "");
12381
- return "" + process.env.NEXT_PUBLIC_IMG_BASE_URL + merchantId + "/" + this.id + "/128/128/img.webp";
12378
+ return this.getSrc(180);
12382
12379
  },
12383
12380
  enumerable: false,
12384
12381
  configurable: true
@@ -21762,14 +21759,14 @@ var IkasCategoryAPI = /** @class */ (function () {
21762
21759
  }
21763
21760
  IkasCategoryAPI.listCategories = function (params) {
21764
21761
  return __awaiter(this, void 0, void 0, function () {
21765
- var LIST_QUERY, _a, data, errors, count, categories, err_1;
21762
+ var LIST_QUERY, _a, data, errors, count, categories, _loop_1, this_1, i, err_1, err_2;
21766
21763
  return __generator(this, function (_b) {
21767
21764
  switch (_b.label) {
21768
21765
  case 0:
21769
- LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "])));
21766
+ LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "])));
21770
21767
  _b.label = 1;
21771
21768
  case 1:
21772
- _b.trys.push([1, 3, , 4]);
21769
+ _b.trys.push([1, 10, , 11]);
21773
21770
  return [4 /*yield*/, apollo
21774
21771
  .getClient()
21775
21772
  .query({
@@ -21809,18 +21806,66 @@ var IkasCategoryAPI = /** @class */ (function () {
21809
21806
  image: c.imageId ? new IkasImage(c.imageId) : undefined,
21810
21807
  });
21811
21808
  });
21812
- return [2 /*return*/, {
21813
- categories: categories,
21814
- count: count,
21815
- }];
21809
+ _b.label = 3;
21816
21810
  case 3:
21811
+ _b.trys.push([3, 8, , 9]);
21812
+ _loop_1 = function (i) {
21813
+ var categoryPath, path_1, listCategoriesResult_1;
21814
+ return __generator(this, function (_a) {
21815
+ switch (_a.label) {
21816
+ case 0:
21817
+ categoryPath = data.listCategory.data[i].categoryPath;
21818
+ if (!(categoryPath && categoryPath.length)) return [3 /*break*/, 2];
21819
+ path_1 = [];
21820
+ return [4 /*yield*/, this_1.listCategories({
21821
+ idList: categoryPath,
21822
+ })];
21823
+ case 1:
21824
+ listCategoriesResult_1 = _a.sent();
21825
+ categoryPath.forEach(function (categoryId) {
21826
+ var _a;
21827
+ var category = listCategoriesResult_1.categories.find(function (c) { return c.id === categoryId; });
21828
+ path_1.push(new IkasCategoryPath({
21829
+ id: category.id,
21830
+ name: category.name,
21831
+ slug: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.slug,
21832
+ }));
21833
+ });
21834
+ categories[i].path = path_1;
21835
+ _a.label = 2;
21836
+ case 2: return [2 /*return*/];
21837
+ }
21838
+ });
21839
+ };
21840
+ this_1 = this;
21841
+ i = 0;
21842
+ _b.label = 4;
21843
+ case 4:
21844
+ if (!(i < data.listCategory.data.length)) return [3 /*break*/, 7];
21845
+ return [5 /*yield**/, _loop_1(i)];
21846
+ case 5:
21847
+ _b.sent();
21848
+ _b.label = 6;
21849
+ case 6:
21850
+ i++;
21851
+ return [3 /*break*/, 4];
21852
+ case 7: return [3 /*break*/, 9];
21853
+ case 8:
21817
21854
  err_1 = _b.sent();
21818
21855
  console.log(err_1);
21856
+ return [3 /*break*/, 9];
21857
+ case 9: return [2 /*return*/, {
21858
+ categories: categories,
21859
+ count: count,
21860
+ }];
21861
+ case 10:
21862
+ err_2 = _b.sent();
21863
+ console.log(err_2);
21819
21864
  return [2 /*return*/, {
21820
21865
  categories: [],
21821
21866
  count: 0,
21822
21867
  }];
21823
- case 4: return [2 /*return*/];
21868
+ case 11: return [2 /*return*/];
21824
21869
  }
21825
21870
  });
21826
21871
  });
@@ -27130,8 +27175,13 @@ var pageStyle$1 = {
27130
27175
  justifyContent: "space-between",
27131
27176
  };
27132
27177
 
27133
- var Image = function (props) {
27134
- return React.createElement(Image__default['default'], __assign({}, props, { unoptimized: true, quality: 100 }));
27178
+ var Image = function (_a) {
27179
+ var image = _a.image, others = __rest(_a, ["image"]);
27180
+ var loader = function (_a) {
27181
+ var width = _a.width;
27182
+ return image.getSrc(width);
27183
+ };
27184
+ return (React.createElement(Image__default['default'], __assign({}, others, { loader: loader, quality: 100, src: image.src })));
27135
27185
  };
27136
27186
 
27137
27187
  var GTMHead = function (_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",
@@ -18,7 +18,7 @@
18
18
  "peerDependencies": {
19
19
  "mobx": "^6.1.3",
20
20
  "mobx-react-lite": "^3.1.5",
21
- "next": "10.0.3",
21
+ "next": "10.0.6",
22
22
  "react": "17.0.1",
23
23
  "react-dom": "17.0.1"
24
24
  },
@@ -68,7 +68,7 @@
68
68
  "jest": "^26.4.2",
69
69
  "mobx": "^6.1.3",
70
70
  "mobx-react-lite": "^3.1.5",
71
- "next": "10.0.3",
71
+ "next": "10.0.6",
72
72
  "node-sass": "^5.0.0",
73
73
  "postcss": "^8.2.4",
74
74
  "prettier": "^2.2.1",