@ikas/storefront 4.0.0-alpha.22 → 4.0.0-alpha.24
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.24",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "Umut Ozan Yıldırım",
|
|
6
6
|
"license": "ISC",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"libphonenumber-js": "^1.10.6"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@ikas/storefront-api": "^4.0.0-alpha.
|
|
28
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
29
|
-
"@ikas/storefront-model-functions": "^4.0.0-alpha.
|
|
30
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
31
|
-
"@ikas/storefront-providers": "^4.0.0-alpha.
|
|
27
|
+
"@ikas/storefront-api": "^4.0.0-alpha.24",
|
|
28
|
+
"@ikas/storefront-config": "^4.0.0-alpha.24",
|
|
29
|
+
"@ikas/storefront-model-functions": "^4.0.0-alpha.24",
|
|
30
|
+
"@ikas/storefront-models": "^4.0.0-alpha.24",
|
|
31
|
+
"@ikas/storefront-providers": "^4.0.0-alpha.24",
|
|
32
32
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
33
33
|
"@rollup/plugin-json": "^4.1.0",
|
|
34
34
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"html-react-parser": "^1.4.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@ikas/storefront-api": "^4.0.0-alpha.
|
|
56
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
57
|
-
"@ikas/storefront-model-functions": "^4.0.0-alpha.
|
|
58
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
59
|
-
"@ikas/storefront-providers": "^4.0.0-alpha.
|
|
55
|
+
"@ikas/storefront-api": "^4.0.0-alpha.24",
|
|
56
|
+
"@ikas/storefront-config": "^4.0.0-alpha.24",
|
|
57
|
+
"@ikas/storefront-model-functions": "^4.0.0-alpha.24",
|
|
58
|
+
"@ikas/storefront-models": "^4.0.0-alpha.24",
|
|
59
|
+
"@ikas/storefront-providers": "^4.0.0-alpha.24",
|
|
60
60
|
"mobx": "^6.1.3",
|
|
61
61
|
"mobx-react-lite": "^3.1.5",
|
|
62
62
|
"next": "12.0.7",
|
|
@@ -19,6 +19,7 @@ import { ThemeComponent } from "./ThemeComponent";
|
|
|
19
19
|
import { IkasBaseStore } from "../../store";
|
|
20
20
|
import { initIkasEvents } from "../../analytics/events";
|
|
21
21
|
import { IkasPageDataInit } from "../../page-data-init";
|
|
22
|
+
import { setAPIClientConfig } from "@ikas/storefront-api";
|
|
22
23
|
|
|
23
24
|
export type IkasPageProps = {
|
|
24
25
|
propValues: IkasPageComponentPropValue[];
|
|
@@ -55,15 +56,16 @@ export const IkasPage: React.FC<IkasPageProps> = observer(
|
|
|
55
56
|
productReviewSummary,
|
|
56
57
|
}) => {
|
|
57
58
|
const router = useRouter();
|
|
58
|
-
const store = IkasBaseStore.getInstance();
|
|
59
|
-
store.router = router;
|
|
60
59
|
|
|
61
60
|
IkasStorefrontConfig.init({
|
|
62
61
|
...configJson,
|
|
63
62
|
currentPageComponents: components,
|
|
64
63
|
});
|
|
65
64
|
IkasBaseStore.getInstance().router = router;
|
|
65
|
+
setAPIClientConfig();
|
|
66
66
|
|
|
67
|
+
const store = IkasBaseStore.getInstance();
|
|
68
|
+
store.router = router;
|
|
67
69
|
store.currentPageType = pageType;
|
|
68
70
|
|
|
69
71
|
const [isBrowser, setIsBrowser] = React.useState(false);
|
|
@@ -23,7 +23,7 @@ import HtmlMetaDataStore from "../../store/html-meta-data";
|
|
|
23
23
|
import BlogStore from "../../store/blog";
|
|
24
24
|
import RaffleStore from "../../store/raffle";
|
|
25
25
|
import ProductStore from "../../store/product";
|
|
26
|
-
import {
|
|
26
|
+
import { setAPIClientConfig } from "@ikas/storefront-api";
|
|
27
27
|
|
|
28
28
|
const PACKAGE_VERSION = "2.0.20";
|
|
29
29
|
// import { version as PACKAGE_VERSION } from "../../../package.json";
|
|
@@ -536,8 +536,6 @@ export default class IkasPageEditorViewModel {
|
|
|
536
536
|
|
|
537
537
|
// Message Handlers
|
|
538
538
|
|
|
539
|
-
static setAPIClientConfig() {}
|
|
540
|
-
|
|
541
539
|
handleUpdateFrameData = async (data: any) => {
|
|
542
540
|
this.theme = new IkasThemeJson(data.theme);
|
|
543
541
|
this.page = this.theme?.pages.find((p) => p.id === data.selectedPage.id);
|
|
@@ -573,17 +571,7 @@ export default class IkasPageEditorViewModel {
|
|
|
573
571
|
cdnUrl: data.cdnUrl,
|
|
574
572
|
});
|
|
575
573
|
|
|
576
|
-
|
|
577
|
-
IkasAPIClientConfig.HEADERS = {
|
|
578
|
-
"x-api-key": IkasStorefrontConfig.getApiKey() || "",
|
|
579
|
-
"x-sfid": IkasStorefrontConfig.getStorefrontId() || "",
|
|
580
|
-
"x-sfrid": IkasStorefrontConfig.getStorefrontRoutingId() || "",
|
|
581
|
-
};
|
|
582
|
-
|
|
583
|
-
if (IkasStorefrontConfig.getCustomerToken()) {
|
|
584
|
-
IkasAPIClientConfig.TOKEN =
|
|
585
|
-
IkasStorefrontConfig.getCustomerToken() || "";
|
|
586
|
-
}
|
|
574
|
+
setAPIClientConfig();
|
|
587
575
|
}
|
|
588
576
|
|
|
589
577
|
// (window as any).editorApiKey = data.apiKey;
|
package/src/pages/checkout.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import IkasCheckoutPage, {
|
|
|
9
9
|
import { useRouter } from "next/router.js";
|
|
10
10
|
import { FullscreenLoading } from "../components/checkout/components/fullscreen-loading";
|
|
11
11
|
import { CheckoutStep } from "../components/checkout/model";
|
|
12
|
-
import { getCartById } from "@ikas/storefront-api";
|
|
12
|
+
import { getCartById, setAPIClientConfig } from "@ikas/storefront-api";
|
|
13
13
|
import { IkasStorefrontConfig } from "@ikas/storefront-config";
|
|
14
14
|
import { IkasBaseStore } from "..";
|
|
15
15
|
import { IkasCheckout, IkasCheckoutSettings } from "../models/data";
|
|
@@ -35,6 +35,7 @@ const CheckoutPage: React.FC<Props> = ({
|
|
|
35
35
|
const [checkout, setCheckout] = React.useState<IkasCheckout | undefined>();
|
|
36
36
|
|
|
37
37
|
IkasStorefrontConfig.init(configJson);
|
|
38
|
+
setAPIClientConfig();
|
|
38
39
|
|
|
39
40
|
React.useEffect(() => {
|
|
40
41
|
setCustomizationProps(customizationProps);
|