@artisan-commerce/analytics-web 0.2.0-canary.82 → 0.2.0-canary.83
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/dist/bundle.cjs.js +4 -3
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.esm.js +4 -3
- package/dist/bundle.esm.js.map +1 -1
- package/dist/bundle.umd.js +4 -3
- package/dist/bundle.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/bundle.d.ts
CHANGED
|
@@ -711,6 +711,7 @@ declare const Providers: {
|
|
|
711
711
|
* @property {boolean} debug Debug mode
|
|
712
712
|
* @property {boolean} shareArtisnAnalytics Share e-commerce analytics with Trade
|
|
713
713
|
* @property {InitAnalyticsConfigMeta} meta Commerce's metadata
|
|
714
|
+
* @property {function} onInit fires the callback once analytics are initialized
|
|
714
715
|
*/
|
|
715
716
|
interface InitAnalyticsConfig {
|
|
716
717
|
providers: AnalyticsProviderTypes[];
|
|
@@ -719,6 +720,7 @@ interface InitAnalyticsConfig {
|
|
|
719
720
|
debug?: boolean;
|
|
720
721
|
shareArtisnAnalytics?: boolean;
|
|
721
722
|
meta: InitAnalyticsConfigMeta;
|
|
723
|
+
onInit?: () => void;
|
|
722
724
|
}
|
|
723
725
|
/**
|
|
724
726
|
* Commerce's metadata
|
package/dist/bundle.esm.js
CHANGED
|
@@ -39,7 +39,7 @@ const getState$1 = () => {
|
|
|
39
39
|
|
|
40
40
|
var name = "@artisan-commerce/analytics-web";
|
|
41
41
|
var description = "Artisn commerce analytics web library";
|
|
42
|
-
var version = "0.2.0-canary.
|
|
42
|
+
var version = "0.2.0-canary.82";
|
|
43
43
|
var main = "./dist/bundle.cjs.js";
|
|
44
44
|
var module = "./dist/bundle.esm.js";
|
|
45
45
|
var types = "./dist/bundle.d.ts";
|
|
@@ -73,7 +73,7 @@ var dependencies = {
|
|
|
73
73
|
};
|
|
74
74
|
var devDependencies = {
|
|
75
75
|
"@artisan-commerce/products": "0.9.0-canary.54",
|
|
76
|
-
"@artisan-commerce/shopping-cart-core": "0.12.0-canary.
|
|
76
|
+
"@artisan-commerce/shopping-cart-core": "0.12.0-canary.79",
|
|
77
77
|
"@artisan-commerce/state": "0.3.0-canary.9",
|
|
78
78
|
"@artisan-commerce/types": "0.14.0-canary.38"
|
|
79
79
|
};
|
|
@@ -612,7 +612,7 @@ const initAnalytics = (config) => {
|
|
|
612
612
|
if (!checkUniqueProviderTrackerIds(providers)) {
|
|
613
613
|
return logMessage("Providers trackerId must be unique, check that no provider trackerId are repeated", "severe");
|
|
614
614
|
}
|
|
615
|
-
const _a = config, { meta } = _a, rest = __objRest$3V(_a, ["meta"]);
|
|
615
|
+
const _a = config, { meta, onInit } = _a, rest = __objRest$3V(_a, ["meta", "onInit"]);
|
|
616
616
|
const { platform = "web" } = meta;
|
|
617
617
|
const enhancedProviders = shareArtisnAnalytics ? [GlobalProvider.instance, ...providers] : providers;
|
|
618
618
|
const enhancedConfig = __spreadProps$2t(__spreadValues$3Y({}, rest), {
|
|
@@ -646,6 +646,7 @@ const initAnalytics = (config) => {
|
|
|
646
646
|
GlobalProvider.instance.updateConfig(globalProviderConfig);
|
|
647
647
|
GlobalProvider.instance.setVendors(allVendors);
|
|
648
648
|
setState({ initialized: true });
|
|
649
|
+
onInit == null ? void 0 : onInit();
|
|
649
650
|
};
|
|
650
651
|
|
|
651
652
|
var __defProp$3X = Object.defineProperty;
|