@ikas/storefront 0.0.164-alpha.2 → 0.0.164-alpha.3

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.
@@ -59,8 +59,8 @@ export default class CheckoutViewModel {
59
59
  get installmentExtraPrice(): number | undefined;
60
60
  get finalPrice(): number;
61
61
  get hasStockError(): boolean;
62
- get canProceedToShipping(): boolean;
63
- get canProceedToPayment(): boolean;
62
+ get canProceedToShipping(): boolean | undefined;
63
+ get canProceedToPayment(): boolean | undefined;
64
64
  get canPerformPayment(): boolean | undefined;
65
65
  saveCheckout: () => Promise<void>;
66
66
  checkStocks: () => Promise<void>;
package/build/index.es.js CHANGED
@@ -23718,10 +23718,10 @@ var CheckoutViewModel = /** @class */ (function () {
23718
23718
  Object.defineProperty(CheckoutViewModel.prototype, "canProceedToShipping", {
23719
23719
  // VALIDATIONS
23720
23720
  get: function () {
23721
- var _a;
23722
- return (this.checkout.shippingAddress.isValid &&
23721
+ var _a, _b;
23722
+ return (((_a = this.checkout.shippingAddress) === null || _a === void 0 ? void 0 : _a.isValid) &&
23723
23723
  this.checkout.hasValidCustomer &&
23724
- ((_a = this.error) === null || _a === void 0 ? void 0 : _a.type) !== ErrorType.NO_SHIPPING_ERROR);
23724
+ ((_b = this.error) === null || _b === void 0 ? void 0 : _b.type) !== ErrorType.NO_SHIPPING_ERROR);
23725
23725
  },
23726
23726
  enumerable: false,
23727
23727
  configurable: true
@@ -62456,7 +62456,7 @@ var _slug_ = /*#__PURE__*/Object.freeze({
62456
62456
  });
62457
62457
 
62458
62458
  var CheckoutPage = function (_a) {
62459
- var checkoutId = _a.checkoutId, checkoutSettingsStr = _a.checkoutSettingsStr, customizationProps = _a.customizationProps, configJson = _a.configJson, others = __rest(_a, ["checkoutId", "checkoutSettingsStr", "customizationProps", "configJson"]);
62459
+ var checkoutId = _a.checkoutId, editorCheckout = _a.editorCheckout, checkoutSettingsStr = _a.checkoutSettingsStr, customizationProps = _a.customizationProps, configJson = _a.configJson, others = __rest(_a, ["checkoutId", "editorCheckout", "checkoutSettingsStr", "customizationProps", "configJson"]);
62460
62460
  var router = useRouter();
62461
62461
  var _b = useState(), checkout = _b[0], setCheckout = _b[1];
62462
62462
  IkasStorefrontConfig.initWithJson(configJson);
@@ -62484,7 +62484,10 @@ var CheckoutPage = function (_a) {
62484
62484
  }, [customizationProps]);
62485
62485
  useEffect(function () {
62486
62486
  store.checkLocalization();
62487
- getCheckout();
62487
+ if (!editorCheckout)
62488
+ getCheckout();
62489
+ else
62490
+ setCheckout(editorCheckout);
62488
62491
  }, []);
62489
62492
  var getCheckout = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
62490
62493
  var checkout;
package/build/index.js CHANGED
@@ -23726,10 +23726,10 @@ var CheckoutViewModel = /** @class */ (function () {
23726
23726
  Object.defineProperty(CheckoutViewModel.prototype, "canProceedToShipping", {
23727
23727
  // VALIDATIONS
23728
23728
  get: function () {
23729
- var _a;
23730
- return (this.checkout.shippingAddress.isValid &&
23729
+ var _a, _b;
23730
+ return (((_a = this.checkout.shippingAddress) === null || _a === void 0 ? void 0 : _a.isValid) &&
23731
23731
  this.checkout.hasValidCustomer &&
23732
- ((_a = this.error) === null || _a === void 0 ? void 0 : _a.type) !== ErrorType.NO_SHIPPING_ERROR);
23732
+ ((_b = this.error) === null || _b === void 0 ? void 0 : _b.type) !== ErrorType.NO_SHIPPING_ERROR);
23733
23733
  },
23734
23734
  enumerable: false,
23735
23735
  configurable: true
@@ -62435,7 +62435,7 @@ var _slug_ = /*#__PURE__*/Object.freeze({
62435
62435
  });
62436
62436
 
62437
62437
  var CheckoutPage = function (_a) {
62438
- var checkoutId = _a.checkoutId, checkoutSettingsStr = _a.checkoutSettingsStr, customizationProps = _a.customizationProps, configJson = _a.configJson, others = __rest(_a, ["checkoutId", "checkoutSettingsStr", "customizationProps", "configJson"]);
62438
+ var checkoutId = _a.checkoutId, editorCheckout = _a.editorCheckout, checkoutSettingsStr = _a.checkoutSettingsStr, customizationProps = _a.customizationProps, configJson = _a.configJson, others = __rest(_a, ["checkoutId", "editorCheckout", "checkoutSettingsStr", "customizationProps", "configJson"]);
62439
62439
  var router$1 = router.useRouter();
62440
62440
  var _b = React.useState(), checkout = _b[0], setCheckout = _b[1];
62441
62441
  IkasStorefrontConfig.initWithJson(configJson);
@@ -62463,7 +62463,10 @@ var CheckoutPage = function (_a) {
62463
62463
  }, [customizationProps]);
62464
62464
  React.useEffect(function () {
62465
62465
  store.checkLocalization();
62466
- getCheckout();
62466
+ if (!editorCheckout)
62467
+ getCheckout();
62468
+ else
62469
+ setCheckout(editorCheckout);
62467
62470
  }, []);
62468
62471
  var getCheckout = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
62469
62472
  var checkout;
@@ -3,8 +3,10 @@ import * as React from "react";
3
3
  import { GetServerSideProps } from "next";
4
4
  import { ParsedUrlQuery } from "querystring";
5
5
  import { IkasCheckoutCustomizationProps } from "../../components/checkout/index";
6
+ import { IkasCheckout } from "../../models/index";
6
7
  declare type Props = {
7
8
  checkoutId: string;
9
+ editorCheckout?: IkasCheckout;
8
10
  checkoutSettingsStr: string | null;
9
11
  customizationProps: IkasCheckoutCustomizationProps;
10
12
  returnPolicy: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.164-alpha.2",
3
+ "version": "0.0.164-alpha.3",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",