@hotwax/dxp-components 1.2.1 → 1.3.0
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/lib/index.d.ts +2 -1
- package/lib/index.js +7 -2
- package/lib/store/productIdentification.js +4 -4
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { goToOms } from "./utils";
|
|
|
6
6
|
declare let loginContext: any;
|
|
7
7
|
declare let shopifyImgContext: any;
|
|
8
8
|
declare let appContext: any;
|
|
9
|
+
declare let productIdentificationContext: any;
|
|
9
10
|
export declare let dxpComponents: {
|
|
10
11
|
install(app: any, options: any): void;
|
|
11
12
|
};
|
|
12
|
-
export { useProductIdentificationStore, useAuthStore, Login, loginContext, shopifyImgContext, ShopifyImg, goToOms, appContext };
|
|
13
|
+
export { useProductIdentificationStore, useAuthStore, Login, loginContext, shopifyImgContext, ShopifyImg, goToOms, appContext, productIdentificationContext };
|
package/lib/index.js
CHANGED
|
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "goToOms", {
|
|
|
22
22
|
return _utils.goToOms;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
-
exports.shopifyImgContext = exports.loginContext = void 0;
|
|
25
|
+
exports.shopifyImgContext = exports.productIdentificationContext = exports.loginContext = void 0;
|
|
26
26
|
Object.defineProperty(exports, "useAuthStore", {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
get: function () {
|
|
@@ -52,8 +52,11 @@ exports.loginContext = loginContext;
|
|
|
52
52
|
let shopifyImgContext = {};
|
|
53
53
|
exports.shopifyImgContext = shopifyImgContext;
|
|
54
54
|
let appContext = {};
|
|
55
|
-
// executed on app initialization
|
|
56
55
|
exports.appContext = appContext;
|
|
56
|
+
let productIdentificationContext = {};
|
|
57
|
+
|
|
58
|
+
// executed on app initialization
|
|
59
|
+
exports.productIdentificationContext = productIdentificationContext;
|
|
57
60
|
let dxpComponents = {
|
|
58
61
|
install(app, options) {
|
|
59
62
|
exports.appContext = appContext = app;
|
|
@@ -67,6 +70,8 @@ let dxpComponents = {
|
|
|
67
70
|
loginContext.logout = options.logout;
|
|
68
71
|
loginContext.loader = options.loader;
|
|
69
72
|
shopifyImgContext.defaultImgUrl = options.defaultImgUrl;
|
|
73
|
+
productIdentificationContext.getProductIdentificationPref = options.getProductIdentificationPref;
|
|
74
|
+
productIdentificationContext.setProductIdentificationPref = options.setProductIdentificationPref;
|
|
70
75
|
}
|
|
71
76
|
};
|
|
72
77
|
exports.dxpComponents = dxpComponents;
|
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useProductIdentificationStore = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _index = require("../index");
|
|
8
8
|
var _pinia = require("pinia");
|
|
9
9
|
const useProductIdentificationStore = (0, _pinia.defineStore)('productIdentification', {
|
|
10
10
|
state: () => {
|
|
11
11
|
return {
|
|
12
12
|
productIdentificationPref: {
|
|
13
|
-
primaryId: '
|
|
13
|
+
primaryId: '',
|
|
14
14
|
secondaryId: ''
|
|
15
15
|
},
|
|
16
16
|
productIdentificationOptions: ["productId", "groupId", "groupName", "internalName", "parentProductName", "primaryProductCategoryName", "productId", "sku", "title", "SHOPIFY_PROD_SKU"]
|
|
@@ -31,7 +31,7 @@ const useProductIdentificationStore = (0, _pinia.defineStore)('productIdentifica
|
|
|
31
31
|
}
|
|
32
32
|
productIdentificationPref[id] = value;
|
|
33
33
|
try {
|
|
34
|
-
this.productIdentificationPref = await
|
|
34
|
+
this.productIdentificationPref = await _index.productIdentificationContext.setProductIdentificationPref(eComStoreId, productIdentificationPref);
|
|
35
35
|
} catch (err) {
|
|
36
36
|
console.log('error', err);
|
|
37
37
|
}
|
|
@@ -44,7 +44,7 @@ const useProductIdentificationStore = (0, _pinia.defineStore)('productIdentifica
|
|
|
44
44
|
secondaryId: ''
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
this.productIdentificationPref = await
|
|
47
|
+
this.productIdentificationPref = await _index.productIdentificationContext.getProductIdentificationPref(eComStoreId);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
});
|