@ikas/storefront 0.1.22-alpha.2 → 0.1.22-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.
- package/build/index.es.js +15 -2
- package/build/index.js +14 -1
- package/build/store/customer.d.ts +1 -0
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -2,9 +2,9 @@ import { makeAutoObservable, configure, makeObservable, observable, runInAction,
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path$1 from 'path';
|
|
4
4
|
import getConfig from 'next/config';
|
|
5
|
-
import React, { createElement, Fragment as Fragment$1, useEffect, useMemo,
|
|
6
|
-
import { observer } from 'mobx-react-lite';
|
|
5
|
+
import React, { createElement, Fragment as Fragment$1, useState, useEffect, useMemo, useRef, useCallback } from 'react';
|
|
7
6
|
import { useRouter } from 'next/router';
|
|
7
|
+
import { observer } from 'mobx-react-lite';
|
|
8
8
|
import Head from 'next/head';
|
|
9
9
|
import crypto$1 from 'crypto';
|
|
10
10
|
import NextImage from 'next/image';
|
|
@@ -33356,6 +33356,15 @@ var AnalyticsHead = function (_a) {
|
|
|
33356
33356
|
var AnalyticsBody = function () {
|
|
33357
33357
|
var gtmId = IkasStorefrontConfig.gtmId;
|
|
33358
33358
|
var fbpId = IkasStorefrontConfig.fbpId;
|
|
33359
|
+
var router = useRouter();
|
|
33360
|
+
var routeChangeListener = useState(function () { return function () {
|
|
33361
|
+
//@ts-ignore
|
|
33362
|
+
IkasStorefrontConfig.store.customerStore.routeChangeInit();
|
|
33363
|
+
}; })[0];
|
|
33364
|
+
useEffect(function () {
|
|
33365
|
+
router.events.on("routeChangeStart", routeChangeListener);
|
|
33366
|
+
return function () { return router.events.off("routeChangeStart", routeChangeListener); };
|
|
33367
|
+
}, []);
|
|
33359
33368
|
return (createElement(Fragment$1, null,
|
|
33360
33369
|
gtmId && (createElement("noscript", { dangerouslySetInnerHTML: {
|
|
33361
33370
|
__html: "<iframe src=\"https://www.googletagmanager.com/ns.html?id=" + gtmId + "\" height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe>",
|
|
@@ -33968,6 +33977,10 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
33968
33977
|
});
|
|
33969
33978
|
});
|
|
33970
33979
|
};
|
|
33980
|
+
IkasCustomerStore.prototype.routeChangeInit = function () {
|
|
33981
|
+
if (!this.customer)
|
|
33982
|
+
this.init();
|
|
33983
|
+
};
|
|
33971
33984
|
IkasCustomerStore.prototype.getCustomer = function () {
|
|
33972
33985
|
return __awaiter(this, void 0, void 0, function () {
|
|
33973
33986
|
var customer;
|
package/build/index.js
CHANGED
|
@@ -7,8 +7,8 @@ var fs = require('fs');
|
|
|
7
7
|
var path$1 = require('path');
|
|
8
8
|
var getConfig = require('next/config');
|
|
9
9
|
var React = require('react');
|
|
10
|
-
var mobxReactLite = require('mobx-react-lite');
|
|
11
10
|
var router = require('next/router');
|
|
11
|
+
var mobxReactLite = require('mobx-react-lite');
|
|
12
12
|
var Head = require('next/head');
|
|
13
13
|
var crypto$1 = require('crypto');
|
|
14
14
|
var NextImage = require('next/image');
|
|
@@ -33363,6 +33363,15 @@ var AnalyticsHead = function (_a) {
|
|
|
33363
33363
|
var AnalyticsBody = function () {
|
|
33364
33364
|
var gtmId = IkasStorefrontConfig.gtmId;
|
|
33365
33365
|
var fbpId = IkasStorefrontConfig.fbpId;
|
|
33366
|
+
var router$1 = router.useRouter();
|
|
33367
|
+
var routeChangeListener = React.useState(function () { return function () {
|
|
33368
|
+
//@ts-ignore
|
|
33369
|
+
IkasStorefrontConfig.store.customerStore.routeChangeInit();
|
|
33370
|
+
}; })[0];
|
|
33371
|
+
React.useEffect(function () {
|
|
33372
|
+
router$1.events.on("routeChangeStart", routeChangeListener);
|
|
33373
|
+
return function () { return router$1.events.off("routeChangeStart", routeChangeListener); };
|
|
33374
|
+
}, []);
|
|
33366
33375
|
return (React.createElement(React.Fragment, null,
|
|
33367
33376
|
gtmId && (React.createElement("noscript", { dangerouslySetInnerHTML: {
|
|
33368
33377
|
__html: "<iframe src=\"https://www.googletagmanager.com/ns.html?id=" + gtmId + "\" height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe>",
|
|
@@ -33975,6 +33984,10 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
33975
33984
|
});
|
|
33976
33985
|
});
|
|
33977
33986
|
};
|
|
33987
|
+
IkasCustomerStore.prototype.routeChangeInit = function () {
|
|
33988
|
+
if (!this.customer)
|
|
33989
|
+
this.init();
|
|
33990
|
+
};
|
|
33978
33991
|
IkasCustomerStore.prototype.getCustomer = function () {
|
|
33979
33992
|
return __awaiter(this, void 0, void 0, function () {
|
|
33980
33993
|
var customer;
|