@searchspring/snap-preact 0.20.5 → 0.22.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/dist/cjs/Instantiators/RecommendationInstantiator.js +8 -4
- package/dist/cjs/Snap.js +17 -13
- package/dist/cjs/components/BranchOverride.js +3 -3
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/polyfills/polyfills.js +5 -1
- package/dist/esm/Instantiators/RecommendationInstantiator.js +2 -2
- package/dist/esm/Snap.js +11 -11
- package/dist/esm/components/BranchOverride.js +3 -3
- package/package.json +11 -11
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -85,8 +89,8 @@ var deepmerge_1 = __importDefault(require("deepmerge"));
|
|
|
85
89
|
var snap_toolbox_1 = require("@searchspring/snap-toolbox");
|
|
86
90
|
var RecommendationInstantiator = /** @class */ (function () {
|
|
87
91
|
function RecommendationInstantiator(config, _a, context) {
|
|
88
|
-
var _this = this;
|
|
89
92
|
var client = _a.client, logger = _a.logger, tracker = _a.tracker;
|
|
93
|
+
var _this = this;
|
|
90
94
|
var _b;
|
|
91
95
|
this.controllers = {};
|
|
92
96
|
this.uses = [];
|
|
@@ -132,7 +136,7 @@ var RecommendationInstantiator = /** @class */ (function () {
|
|
|
132
136
|
switch (_g.label) {
|
|
133
137
|
case 0:
|
|
134
138
|
contextGlobals = {};
|
|
135
|
-
elemContext = (0, snap_toolbox_1.getContext)(['shopperId', 'shopper', 'product', 'seed', 'options', 'profile'], elem);
|
|
139
|
+
elemContext = (0, snap_toolbox_1.getContext)(['shopperId', 'shopper', 'product', 'seed', 'options', 'profile', 'custom'], elem);
|
|
136
140
|
context = (0, deepmerge_1.default)(this.context, elemContext);
|
|
137
141
|
shopper = context.shopper, shopperId = context.shopperId, product = context.product, seed = context.seed, options = context.options;
|
|
138
142
|
/*
|
|
@@ -219,7 +223,7 @@ var RecommendationInstantiator = /** @class */ (function () {
|
|
|
219
223
|
return [2 /*return*/];
|
|
220
224
|
}
|
|
221
225
|
setTimeout(function () {
|
|
222
|
-
(0, preact_1.render)((0, jsx_runtime_1.jsx)(RecommendationsComponent, { controller: recs }
|
|
226
|
+
(0, preact_1.render)((0, jsx_runtime_1.jsx)(RecommendationsComponent, { controller: recs }), injectedElem);
|
|
223
227
|
});
|
|
224
228
|
return [2 /*return*/];
|
|
225
229
|
}
|
package/dist/cjs/Snap.js
CHANGED
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -91,7 +95,7 @@ var DynamicImportNames;
|
|
|
91
95
|
var Snap = /** @class */ (function () {
|
|
92
96
|
function Snap(config) {
|
|
93
97
|
var _this = this;
|
|
94
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
98
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
95
99
|
this.getInstantiator = function (id) {
|
|
96
100
|
return _this._instantiatorPromises[id] || Promise.reject("getInstantiator could not find instantiator with id: ".concat(id));
|
|
97
101
|
};
|
|
@@ -202,7 +206,7 @@ var Snap = /** @class */ (function () {
|
|
|
202
206
|
case 0: return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require('./components/BranchOverride')); })];
|
|
203
207
|
case 1:
|
|
204
208
|
BranchOverride = (_a.sent()).BranchOverride;
|
|
205
|
-
(0, preact_1.render)((0, jsx_runtime_1.jsx)(BranchOverride, { branch: branchParam_1, cookieName: BRANCH_COOKIE, bundleUrl: src_1 }
|
|
209
|
+
(0, preact_1.render)((0, jsx_runtime_1.jsx)(BranchOverride, { branch: branchParam_1, cookieName: BRANCH_COOKIE, bundleUrl: src_1 }), elem);
|
|
206
210
|
return [2 /*return*/];
|
|
207
211
|
}
|
|
208
212
|
});
|
|
@@ -267,7 +271,7 @@ var Snap = /** @class */ (function () {
|
|
|
267
271
|
case 2:
|
|
268
272
|
Component_1 = _a.sent();
|
|
269
273
|
setTimeout(function () {
|
|
270
|
-
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Component_1, __assign({ controller: _this.controllers[controller.config.id] }, target.props)
|
|
274
|
+
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Component_1, __assign({ controller: _this.controllers[controller.config.id] }, target.props)), elem);
|
|
271
275
|
});
|
|
272
276
|
return [3 /*break*/, 4];
|
|
273
277
|
case 3:
|
|
@@ -300,7 +304,7 @@ var Snap = /** @class */ (function () {
|
|
|
300
304
|
case 1:
|
|
301
305
|
Skeleton_1 = _a.sent();
|
|
302
306
|
setTimeout(function () {
|
|
303
|
-
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Skeleton_1, {}
|
|
307
|
+
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Skeleton_1, {}), elem);
|
|
304
308
|
});
|
|
305
309
|
_a.label = 2;
|
|
306
310
|
case 2:
|
|
@@ -345,7 +349,7 @@ var Snap = /** @class */ (function () {
|
|
|
345
349
|
case 1:
|
|
346
350
|
Component = (_a.sent());
|
|
347
351
|
setTimeout(function () {
|
|
348
|
-
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Component, __assign({ controller: _this.controllers[controller.config.id], input: originalElem }, target.props)
|
|
352
|
+
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Component, __assign({ controller: _this.controllers[controller.config.id], input: originalElem }, target.props)), elem);
|
|
349
353
|
});
|
|
350
354
|
return [2 /*return*/];
|
|
351
355
|
}
|
|
@@ -425,7 +429,7 @@ var Snap = /** @class */ (function () {
|
|
|
425
429
|
case 1:
|
|
426
430
|
Component = _a.sent();
|
|
427
431
|
setTimeout(function () {
|
|
428
|
-
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Component, __assign({ controller: _this.controllers[controller.config.id] }, target.props)
|
|
432
|
+
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Component, __assign({ controller: _this.controllers[controller.config.id] }, target.props)), elem);
|
|
429
433
|
});
|
|
430
434
|
return [2 /*return*/];
|
|
431
435
|
}
|
|
@@ -493,7 +497,7 @@ var Snap = /** @class */ (function () {
|
|
|
493
497
|
case 1:
|
|
494
498
|
Component = _a.sent();
|
|
495
499
|
setTimeout(function () {
|
|
496
|
-
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Component, __assign({ controller: _this.controllers[controller.config.id] }, target.props)
|
|
500
|
+
(0, preact_1.render)((0, jsx_runtime_1.jsx)(Component, __assign({ controller: _this.controllers[controller.config.id] }, target.props)), elem);
|
|
497
501
|
});
|
|
498
502
|
return [2 /*return*/];
|
|
499
503
|
}
|
|
@@ -539,15 +543,15 @@ var Snap = /** @class */ (function () {
|
|
|
539
543
|
}
|
|
540
544
|
}
|
|
541
545
|
});
|
|
542
|
-
if ((_l = config === null ||
|
|
546
|
+
if ((_m = (_l = this.config) === null || _l === void 0 ? void 0 : _l.instantiators) === null || _m === void 0 ? void 0 : _m.recommendation) {
|
|
543
547
|
try {
|
|
544
548
|
this._instantiatorPromises.recommendations = Promise.resolve().then(function () { return __importStar(require('./Instantiators/RecommendationInstantiator')); }).then(function (_a) {
|
|
545
549
|
var _b, _c, _d, _e, _f, _g;
|
|
546
550
|
var RecommendationInstantiator = _a.RecommendationInstantiator;
|
|
547
|
-
return new RecommendationInstantiator(config.instantiators.recommendation, {
|
|
548
|
-
client: ((_c = (_b = config.instantiators.recommendation) === null || _b === void 0 ? void 0 : _b.services) === null || _c === void 0 ? void 0 : _c.client) || _this.client,
|
|
549
|
-
tracker: ((_e = (_d = config.instantiators.recommendation) === null || _d === void 0 ? void 0 : _d.services) === null || _e === void 0 ? void 0 : _e.tracker) || _this.tracker,
|
|
550
|
-
logger: ((_g = (_f = config.instantiators.recommendation) === null || _f === void 0 ? void 0 : _f.services) === null || _g === void 0 ? void 0 : _g.logger) || _this.logger,
|
|
551
|
+
return new RecommendationInstantiator(_this.config.instantiators.recommendation, {
|
|
552
|
+
client: ((_c = (_b = _this.config.instantiators.recommendation) === null || _b === void 0 ? void 0 : _b.services) === null || _c === void 0 ? void 0 : _c.client) || _this.client,
|
|
553
|
+
tracker: ((_e = (_d = _this.config.instantiators.recommendation) === null || _d === void 0 ? void 0 : _d.services) === null || _e === void 0 ? void 0 : _e.tracker) || _this.tracker,
|
|
554
|
+
logger: ((_g = (_f = _this.config.instantiators.recommendation) === null || _f === void 0 ? void 0 : _f.services) === null || _g === void 0 ? void 0 : _g.logger) || _this.logger,
|
|
551
555
|
}, _this.context);
|
|
552
556
|
});
|
|
553
557
|
}
|
|
@@ -217,7 +217,7 @@ var BranchOverride = function (props) {
|
|
|
217
217
|
popup.style.right = '-1px';
|
|
218
218
|
popup.style.height = '120px';
|
|
219
219
|
popup.style.cursor = 'auto';
|
|
220
|
-
} }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ style: "padding: 10px; position: relative; background: ".concat(themes[themeName].top.background, "; border-bottom: ").concat(themes[themeName].top.border, "; margin-bottom: 10px;") }, { children: [(0, jsx_runtime_1.jsx)("img", { src: themes[themeName].top.logo.src, style: "display: inline-block; height: 30px; vertical-align: middle;" }
|
|
220
|
+
} }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ style: "padding: 10px; position: relative; background: ".concat(themes[themeName].top.background, "; border-bottom: ").concat(themes[themeName].top.border, "; margin-bottom: 10px;") }, { children: [(0, jsx_runtime_1.jsx)("img", { src: themes[themeName].top.logo.src, style: "display: inline-block; height: 30px; vertical-align: middle;" }), (0, jsx_runtime_1.jsx)("div", __assign({ style: "display: inline-block; float: right; padding: 5px; cursor: pointer;", onClick: function (e) {
|
|
221
221
|
e.preventDefault();
|
|
222
222
|
e.stopPropagation();
|
|
223
223
|
var popup = document.querySelector('.ss__branch-override');
|
|
@@ -225,13 +225,13 @@ var BranchOverride = function (props) {
|
|
|
225
225
|
popup.style.right = '-316px';
|
|
226
226
|
popup.style.height = '50px';
|
|
227
227
|
popup.style.cursor = 'pointer';
|
|
228
|
-
} }, { children: (0, jsx_runtime_1.jsx)("svg", __assign({ viewBox: "0 0 56 56", xmlns: "http://www.w3.org/2000/svg", width: "18px", height: "18px" }, { children: (0, jsx_runtime_1.jsx)("path", { fill: themes[themeName].top.close.fill, d: icons['close-thin'] }
|
|
228
|
+
} }, { children: (0, jsx_runtime_1.jsx)("svg", __assign({ viewBox: "0 0 56 56", xmlns: "http://www.w3.org/2000/svg", width: "18px", height: "18px" }, { children: (0, jsx_runtime_1.jsx)("path", { fill: themes[themeName].top.close.fill, d: icons['close-thin'] }) })) })), (0, jsx_runtime_1.jsx)("div", __assign({ style: "border-radius: 5px; padding: 6px; height: 100%; line-height: 14px; text-align: center; cursor: pointer; font-size: 10px; border: ".concat(themes[themeName].top.button.border, "; float: right; margin-right: 14px;"), onClick: function (e) {
|
|
229
229
|
e.preventDefault();
|
|
230
230
|
e.stopPropagation();
|
|
231
231
|
snap_toolbox_1.cookies.unset(props.cookieName);
|
|
232
232
|
var urlState = (0, snap_toolbox_1.url)(window.location.href);
|
|
233
233
|
delete urlState.params.query['branch'];
|
|
234
234
|
window.location.href = urlState.url();
|
|
235
|
-
} }, { children: themes[themeName].top.button.content })
|
|
235
|
+
} }, { children: themes[themeName].top.button.content }))] })), (0, jsx_runtime_1.jsxs)("div", __assign({ style: "padding: 0px 15px; font-size: 12px;" }, { children: [(0, jsx_runtime_1.jsx)("span", __assign({ style: "font-weight: bold; font-style: ".concat(themes[themeName].details.branch.style, "; color: ").concat(themes[themeName].details.branch.color, "; font-size: 14px; line-height: 20px; display: inline-block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;") }, { children: details == 'failure' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("svg", __assign({ style: "margin-right: 10px;", viewBox: "0 0 56 56", xmlns: "http://www.w3.org/2000/svg", width: "18px", height: "18px" }, { children: (0, jsx_runtime_1.jsx)("path", { fill: themes[themeName].details.branch.color, d: icons['warn'] }) })), "Branch not found!"] })) : (props.branch) })), (0, jsx_runtime_1.jsx)("span", __assign({ style: "float: right; font-style: italic; color: ".concat(themes[themeName].details.additional.color, "; font-size: 12px; line-height: 20px;") }, { children: (details === null || details === void 0 ? void 0 : details.lastModified) || props.branch })), (0, jsx_runtime_1.jsx)("br", {}), themes[themeName].details.content] }))] }))));
|
|
236
236
|
};
|
|
237
237
|
exports.BranchOverride = BranchOverride;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -43,7 +43,7 @@ export class RecommendationInstantiator {
|
|
|
43
43
|
},
|
|
44
44
|
], async (target, injectedElem, elem) => {
|
|
45
45
|
const contextGlobals = {};
|
|
46
|
-
const elemContext = getContext(['shopperId', 'shopper', 'product', 'seed', 'options', 'profile'], elem);
|
|
46
|
+
const elemContext = getContext(['shopperId', 'shopper', 'product', 'seed', 'options', 'profile', 'custom'], elem);
|
|
47
47
|
const context = deepmerge(this.context, elemContext);
|
|
48
48
|
const { shopper, shopperId, product, seed, options } = context;
|
|
49
49
|
/*
|
|
@@ -126,7 +126,7 @@ export class RecommendationInstantiator {
|
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
setTimeout(() => {
|
|
129
|
-
render(_jsx(RecommendationsComponent, { controller: recs }
|
|
129
|
+
render(_jsx(RecommendationsComponent, { controller: recs }), injectedElem);
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
132
|
}
|
package/dist/esm/Snap.js
CHANGED
|
@@ -119,7 +119,7 @@ export class Snap {
|
|
|
119
119
|
},
|
|
120
120
|
], async (target, elem) => {
|
|
121
121
|
const BranchOverride = (await import('./components/BranchOverride')).BranchOverride;
|
|
122
|
-
render(_jsx(BranchOverride, { branch: branchParam, cookieName: BRANCH_COOKIE, bundleUrl: src }
|
|
122
|
+
render(_jsx(BranchOverride, { branch: branchParam, cookieName: BRANCH_COOKIE, bundleUrl: src }), elem);
|
|
123
123
|
});
|
|
124
124
|
// prevent further instantiation of config
|
|
125
125
|
return;
|
|
@@ -171,7 +171,7 @@ export class Snap {
|
|
|
171
171
|
try {
|
|
172
172
|
const Component = await target.component();
|
|
173
173
|
setTimeout(() => {
|
|
174
|
-
render(_jsx(Component, { controller: this.controllers[controller.config.id], ...target.props }
|
|
174
|
+
render(_jsx(Component, { controller: this.controllers[controller.config.id], ...target.props }), elem);
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
catch (err) {
|
|
@@ -226,7 +226,7 @@ The error above happened in the following targeter in the Snap Config`, target);
|
|
|
226
226
|
if (target.skeleton) {
|
|
227
227
|
const Skeleton = await target.skeleton();
|
|
228
228
|
setTimeout(() => {
|
|
229
|
-
render(_jsx(Skeleton, {}
|
|
229
|
+
render(_jsx(Skeleton, {}), elem);
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
targetFunction(target, elem, originalElem);
|
|
@@ -257,7 +257,7 @@ The error above happened in the following targeter in the Snap Config`, target);
|
|
|
257
257
|
onTarget && onTarget(target, elem, originalElem);
|
|
258
258
|
const Component = (await target.component());
|
|
259
259
|
setTimeout(() => {
|
|
260
|
-
render(_jsx(Component, { controller: this.controllers[controller.config.id], input: originalElem, ...target.props }
|
|
260
|
+
render(_jsx(Component, { controller: this.controllers[controller.config.id], input: originalElem, ...target.props }), elem);
|
|
261
261
|
});
|
|
262
262
|
};
|
|
263
263
|
if (!controller?.targeters || controller?.targeters.length === 0) {
|
|
@@ -316,7 +316,7 @@ The error above happened in the following targeter in the Snap Config`, target);
|
|
|
316
316
|
onTarget && onTarget(target, elem, originalElem);
|
|
317
317
|
const Component = await target.component();
|
|
318
318
|
setTimeout(() => {
|
|
319
|
-
render(_jsx(Component, { controller: this.controllers[controller.config.id], ...target.props }
|
|
319
|
+
render(_jsx(Component, { controller: this.controllers[controller.config.id], ...target.props }), elem);
|
|
320
320
|
});
|
|
321
321
|
};
|
|
322
322
|
if (!controller?.targeters || controller?.targeters.length === 0) {
|
|
@@ -360,7 +360,7 @@ The error above happened in the following targeter in the Snap Config`, target);
|
|
|
360
360
|
onTarget && onTarget(target, elem, originalElem);
|
|
361
361
|
const Component = await target.component();
|
|
362
362
|
setTimeout(() => {
|
|
363
|
-
render(_jsx(Component, { controller: this.controllers[controller.config.id], ...target.props }
|
|
363
|
+
render(_jsx(Component, { controller: this.controllers[controller.config.id], ...target.props }), elem);
|
|
364
364
|
});
|
|
365
365
|
};
|
|
366
366
|
if (!controller?.targeters || controller?.targeters.length === 0) {
|
|
@@ -390,13 +390,13 @@ The error above happened in the following targeter in the Snap Config`, target);
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
});
|
|
393
|
-
if (config?.instantiators?.recommendation) {
|
|
393
|
+
if (this.config?.instantiators?.recommendation) {
|
|
394
394
|
try {
|
|
395
395
|
this._instantiatorPromises.recommendations = import('./Instantiators/RecommendationInstantiator').then(({ RecommendationInstantiator }) => {
|
|
396
|
-
return new RecommendationInstantiator(config.instantiators.recommendation, {
|
|
397
|
-
client: config.instantiators.recommendation?.services?.client || this.client,
|
|
398
|
-
tracker: config.instantiators.recommendation?.services?.tracker || this.tracker,
|
|
399
|
-
logger: config.instantiators.recommendation?.services?.logger || this.logger,
|
|
396
|
+
return new RecommendationInstantiator(this.config.instantiators.recommendation, {
|
|
397
|
+
client: this.config.instantiators.recommendation?.services?.client || this.client,
|
|
398
|
+
tracker: this.config.instantiators.recommendation?.services?.tracker || this.tracker,
|
|
399
|
+
logger: this.config.instantiators.recommendation?.services?.logger || this.logger,
|
|
400
400
|
}, this.context);
|
|
401
401
|
});
|
|
402
402
|
}
|
|
@@ -153,7 +153,7 @@ export const BranchOverride = (props) => {
|
|
|
153
153
|
popup.style.right = '-1px';
|
|
154
154
|
popup.style.height = '120px';
|
|
155
155
|
popup.style.cursor = 'auto';
|
|
156
|
-
}, children: [_jsxs("div", { style: `padding: 10px; position: relative; background: ${themes[themeName].top.background}; border-bottom: ${themes[themeName].top.border}; margin-bottom: 10px;`, children: [_jsx("img", { src: themes[themeName].top.logo.src, style: `display: inline-block; height: 30px; vertical-align: middle;` }
|
|
156
|
+
}, children: [_jsxs("div", { style: `padding: 10px; position: relative; background: ${themes[themeName].top.background}; border-bottom: ${themes[themeName].top.border}; margin-bottom: 10px;`, children: [_jsx("img", { src: themes[themeName].top.logo.src, style: `display: inline-block; height: 30px; vertical-align: middle;` }), _jsx("div", { style: "display: inline-block; float: right; padding: 5px; cursor: pointer;", onClick: (e) => {
|
|
157
157
|
e.preventDefault();
|
|
158
158
|
e.stopPropagation();
|
|
159
159
|
const popup = document.querySelector('.ss__branch-override');
|
|
@@ -161,12 +161,12 @@ export const BranchOverride = (props) => {
|
|
|
161
161
|
popup.style.right = '-316px';
|
|
162
162
|
popup.style.height = '50px';
|
|
163
163
|
popup.style.cursor = 'pointer';
|
|
164
|
-
}, children: _jsx("svg", { viewBox: "0 0 56 56", xmlns: "http://www.w3.org/2000/svg", width: "18px", height: "18px", children: _jsx("path", { fill: themes[themeName].top.close.fill, d: icons['close-thin'] }
|
|
164
|
+
}, children: _jsx("svg", { viewBox: "0 0 56 56", xmlns: "http://www.w3.org/2000/svg", width: "18px", height: "18px", children: _jsx("path", { fill: themes[themeName].top.close.fill, d: icons['close-thin'] }) }) }), _jsx("div", { style: `border-radius: 5px; padding: 6px; height: 100%; line-height: 14px; text-align: center; cursor: pointer; font-size: 10px; border: ${themes[themeName].top.button.border}; float: right; margin-right: 14px;`, onClick: (e) => {
|
|
165
165
|
e.preventDefault();
|
|
166
166
|
e.stopPropagation();
|
|
167
167
|
cookies.unset(props.cookieName);
|
|
168
168
|
const urlState = url(window.location.href);
|
|
169
169
|
delete urlState.params.query['branch'];
|
|
170
170
|
window.location.href = urlState.url();
|
|
171
|
-
}, children: themes[themeName].top.button.content }
|
|
171
|
+
}, children: themes[themeName].top.button.content })] }), _jsxs("div", { style: "padding: 0px 15px; font-size: 12px;", children: [_jsx("span", { style: `font-weight: bold; font-style: ${themes[themeName].details.branch.style}; color: ${themes[themeName].details.branch.color}; font-size: 14px; line-height: 20px; display: inline-block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`, children: details == 'failure' ? (_jsxs(_Fragment, { children: [_jsx("svg", { style: "margin-right: 10px;", viewBox: "0 0 56 56", xmlns: "http://www.w3.org/2000/svg", width: "18px", height: "18px", children: _jsx("path", { fill: themes[themeName].details.branch.color, d: icons['warn'] }) }), "Branch not found!"] })) : (props.branch) }), _jsx("span", { style: `float: right; font-style: italic; color: ${themes[themeName].details.additional.color}; font-size: 12px; line-height: 20px;`, children: details?.lastModified || props.branch }), _jsx("br", {}), themes[themeName].details.content] })] })));
|
|
172
172
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searchspring/snap-preact",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Snap Preact",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"test:watch": "jest --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@searchspring/snap-client": "^0.
|
|
24
|
-
"@searchspring/snap-controller": "^0.
|
|
25
|
-
"@searchspring/snap-event-manager": "^0.
|
|
26
|
-
"@searchspring/snap-logger": "^0.
|
|
27
|
-
"@searchspring/snap-profiler": "^0.
|
|
28
|
-
"@searchspring/snap-store-mobx": "^0.
|
|
29
|
-
"@searchspring/snap-toolbox": "^0.
|
|
30
|
-
"@searchspring/snap-tracker": "^0.
|
|
31
|
-
"@searchspring/snap-url-manager": "^0.
|
|
23
|
+
"@searchspring/snap-client": "^0.22.0",
|
|
24
|
+
"@searchspring/snap-controller": "^0.22.0",
|
|
25
|
+
"@searchspring/snap-event-manager": "^0.22.0",
|
|
26
|
+
"@searchspring/snap-logger": "^0.22.0",
|
|
27
|
+
"@searchspring/snap-profiler": "^0.22.0",
|
|
28
|
+
"@searchspring/snap-store-mobx": "^0.22.0",
|
|
29
|
+
"@searchspring/snap-toolbox": "^0.22.0",
|
|
30
|
+
"@searchspring/snap-tracker": "^0.22.0",
|
|
31
|
+
"@searchspring/snap-url-manager": "^0.22.0",
|
|
32
32
|
"deepmerge": "^4.2.2",
|
|
33
33
|
"intersection-observer": "^0.12.0"
|
|
34
34
|
},
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"files": [
|
|
40
40
|
"dist/**/*"
|
|
41
41
|
],
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "e75d852fd1750840d7c851172bbfd5f66e8ace1e"
|
|
43
43
|
}
|