@searchspring/snap-preact 0.61.0 → 0.61.2
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.
|
@@ -170,11 +170,11 @@ var RecommendationInstantiator = /** @class */ (function () {
|
|
|
170
170
|
scriptContextProfiles = elemContext.profiles;
|
|
171
171
|
scriptContextGlobals_1 = elemContext.globals;
|
|
172
172
|
requestGlobals_1 = __assign({}, defined({
|
|
173
|
-
blockedItems: scriptContextGlobals_1.blockedItems,
|
|
174
|
-
filters: scriptContextGlobals_1.filters,
|
|
175
|
-
cart: scriptContextGlobals_1.cart && getArrayFunc(scriptContextGlobals_1.cart),
|
|
176
|
-
products: scriptContextGlobals_1.products,
|
|
177
|
-
shopper: (_a = scriptContextGlobals_1.shopper) === null || _a === void 0 ? void 0 : _a.id,
|
|
173
|
+
blockedItems: scriptContextGlobals_1 === null || scriptContextGlobals_1 === void 0 ? void 0 : scriptContextGlobals_1.blockedItems,
|
|
174
|
+
filters: scriptContextGlobals_1 === null || scriptContextGlobals_1 === void 0 ? void 0 : scriptContextGlobals_1.filters,
|
|
175
|
+
cart: (scriptContextGlobals_1 === null || scriptContextGlobals_1 === void 0 ? void 0 : scriptContextGlobals_1.cart) && getArrayFunc(scriptContextGlobals_1.cart),
|
|
176
|
+
products: scriptContextGlobals_1 === null || scriptContextGlobals_1 === void 0 ? void 0 : scriptContextGlobals_1.products,
|
|
177
|
+
shopper: (_a = scriptContextGlobals_1 === null || scriptContextGlobals_1 === void 0 ? void 0 : scriptContextGlobals_1.shopper) === null || _a === void 0 ? void 0 : _a.id,
|
|
178
178
|
batchId: Math.random(),
|
|
179
179
|
}));
|
|
180
180
|
targetsArr_1 = [];
|
|
@@ -196,7 +196,7 @@ var RecommendationInstantiator = /** @class */ (function () {
|
|
|
196
196
|
return __generator(this, function (_d) {
|
|
197
197
|
if (((_a = target.profile) === null || _a === void 0 ? void 0 : _a.profile) || ((_b = target.profile) === null || _b === void 0 ? void 0 : _b.tag)) {
|
|
198
198
|
profileRequestGlobals = __assign(__assign({}, requestGlobals_1), { profile: (_c = target.profile) === null || _c === void 0 ? void 0 : _c.options, tag: target.profile.tag || target.profile.profile });
|
|
199
|
-
profileContext = (0, deepmerge_1.default)(this.context, { globals: scriptContextGlobals_1, profile: target.profile });
|
|
199
|
+
profileContext = (0, deepmerge_1.default)(this.context, defined({ globals: scriptContextGlobals_1, profile: target.profile }));
|
|
200
200
|
if (elemContext.custom) {
|
|
201
201
|
profileContext.custom = elemContext.custom;
|
|
202
202
|
}
|
|
@@ -216,7 +216,7 @@ var RecommendationInstantiator = /** @class */ (function () {
|
|
|
216
216
|
blockedItems: blockedItems,
|
|
217
217
|
profile: options,
|
|
218
218
|
}));
|
|
219
|
-
readyTheController(this, elem, elemContext, profileCount, originalElem, profileRequestGlobals);
|
|
219
|
+
readyTheController(this, elem, (0, deepmerge_1.default)(this.context, elemContext), profileCount, originalElem, profileRequestGlobals);
|
|
220
220
|
}
|
|
221
221
|
return [2 /*return*/];
|
|
222
222
|
});
|
|
@@ -83,11 +83,11 @@ export class RecommendationInstantiator {
|
|
|
83
83
|
// grab from globals
|
|
84
84
|
const requestGlobals = {
|
|
85
85
|
...defined({
|
|
86
|
-
blockedItems: scriptContextGlobals
|
|
87
|
-
filters: scriptContextGlobals
|
|
88
|
-
cart: scriptContextGlobals
|
|
89
|
-
products: scriptContextGlobals
|
|
90
|
-
shopper: scriptContextGlobals
|
|
86
|
+
blockedItems: scriptContextGlobals?.blockedItems,
|
|
87
|
+
filters: scriptContextGlobals?.filters,
|
|
88
|
+
cart: scriptContextGlobals?.cart && getArrayFunc(scriptContextGlobals.cart),
|
|
89
|
+
products: scriptContextGlobals?.products,
|
|
90
|
+
shopper: scriptContextGlobals?.shopper?.id,
|
|
91
91
|
batchId: Math.random(),
|
|
92
92
|
}),
|
|
93
93
|
};
|
|
@@ -111,7 +111,7 @@ export class RecommendationInstantiator {
|
|
|
111
111
|
profile: target.profile?.options,
|
|
112
112
|
tag: target.profile.tag || target.profile.profile, // have to support both tag and profile due to having profile at release, but will favor tag
|
|
113
113
|
};
|
|
114
|
-
const profileContext = deepmerge(this.context, { globals: scriptContextGlobals, profile: target.profile });
|
|
114
|
+
const profileContext = deepmerge(this.context, defined({ globals: scriptContextGlobals, profile: target.profile }));
|
|
115
115
|
if (elemContext.custom) {
|
|
116
116
|
profileContext.custom = elemContext.custom;
|
|
117
117
|
}
|
|
@@ -133,7 +133,7 @@ export class RecommendationInstantiator {
|
|
|
133
133
|
profile: options,
|
|
134
134
|
}),
|
|
135
135
|
};
|
|
136
|
-
readyTheController(this, elem, elemContext, profileCount, originalElem, profileRequestGlobals);
|
|
136
|
+
readyTheController(this, elem, deepmerge(this.context, elemContext), profileCount, originalElem, profileRequestGlobals);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searchspring/snap-preact",
|
|
3
|
-
"version": "0.61.
|
|
3
|
+
"version": "0.61.2",
|
|
4
4
|
"description": "Snap Preact",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"test:watch": "jest --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@searchspring/snap-client": "^0.61.
|
|
24
|
-
"@searchspring/snap-controller": "^0.61.
|
|
25
|
-
"@searchspring/snap-event-manager": "^0.61.
|
|
26
|
-
"@searchspring/snap-logger": "^0.61.
|
|
27
|
-
"@searchspring/snap-platforms": "^0.61.
|
|
28
|
-
"@searchspring/snap-preact-components": "^0.61.
|
|
29
|
-
"@searchspring/snap-profiler": "^0.61.
|
|
30
|
-
"@searchspring/snap-store-mobx": "^0.61.
|
|
31
|
-
"@searchspring/snap-toolbox": "^0.61.
|
|
32
|
-
"@searchspring/snap-tracker": "^0.61.
|
|
33
|
-
"@searchspring/snap-url-manager": "^0.61.
|
|
23
|
+
"@searchspring/snap-client": "^0.61.2",
|
|
24
|
+
"@searchspring/snap-controller": "^0.61.2",
|
|
25
|
+
"@searchspring/snap-event-manager": "^0.61.2",
|
|
26
|
+
"@searchspring/snap-logger": "^0.61.2",
|
|
27
|
+
"@searchspring/snap-platforms": "^0.61.2",
|
|
28
|
+
"@searchspring/snap-preact-components": "^0.61.2",
|
|
29
|
+
"@searchspring/snap-profiler": "^0.61.2",
|
|
30
|
+
"@searchspring/snap-store-mobx": "^0.61.2",
|
|
31
|
+
"@searchspring/snap-toolbox": "^0.61.2",
|
|
32
|
+
"@searchspring/snap-tracker": "^0.61.2",
|
|
33
|
+
"@searchspring/snap-url-manager": "^0.61.2",
|
|
34
34
|
"deepmerge": "4.3.1",
|
|
35
35
|
"intersection-observer": "0.12.0",
|
|
36
36
|
"is-plain-object": "5.0.0"
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"files": [
|
|
44
44
|
"dist/**/*"
|
|
45
45
|
],
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "4fec7f7a6f0d26750a150b3a0208ac946fbba765"
|
|
47
47
|
}
|