@searchcraft/javascript-sdk 0.10.6 → 0.10.7
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/components/index.d.ts +11 -4
- package/dist/components/index.js +4 -4
- package/dist/components/{p-b54873ff.js → p-062d6b80.js} +122 -110
- package/dist/components/p-062d6b80.js.map +1 -0
- package/dist/components/{p-f2976b33.js → p-274c5cc8.js} +2 -2
- package/dist/components/{p-f2976b33.js.map → p-274c5cc8.js.map} +1 -1
- package/dist/components/{p-2735dceb.js → p-320e3895.js} +2 -2
- package/dist/components/{p-2735dceb.js.map → p-320e3895.js.map} +1 -1
- package/dist/components/{p-a7d611cd.js → p-acab4d41.js} +2 -2
- package/dist/components/{p-a7d611cd.js.map → p-acab4d41.js.map} +1 -1
- package/dist/components/{p-6e5ed641.js → p-adc6236e.js} +80 -35
- package/dist/components/p-adc6236e.js.map +1 -0
- package/dist/components/{p-aba24c85.js → p-b01f8216.js} +11 -11
- package/dist/components/p-b01f8216.js.map +1 -0
- package/dist/components/{p-9f4c50ed.js → p-b4cac872.js} +2 -2
- package/dist/components/{p-9f4c50ed.js.map → p-b4cac872.js.map} +1 -1
- package/dist/components/{p-b194d081.js → p-e99cd628.js} +2 -2
- package/dist/components/{p-b194d081.js.map → p-e99cd628.js.map} +1 -1
- package/dist/components/{p-75134ca7.js → p-ea48ccae.js} +2 -2
- package/dist/components/{p-75134ca7.js.map → p-ea48ccae.js.map} +1 -1
- package/dist/components/searchcraft-ad.js +1 -1
- package/dist/components/searchcraft-facet-list.js +1 -1
- package/dist/components/searchcraft-filter-panel.js +3 -3
- package/dist/components/searchcraft-input-form.js +1 -1
- package/dist/components/searchcraft-pagination.js +1 -1
- package/dist/components/searchcraft-popover-button.js +1 -1
- package/dist/components/searchcraft-popover-footer.js +1 -1
- package/dist/components/searchcraft-popover-form.js +6 -6
- package/dist/components/searchcraft-popover-list-item.js +1 -1
- package/dist/components/searchcraft-popover-list-view.js +1 -1
- package/dist/components/searchcraft-results-info.js +1 -1
- package/dist/components/searchcraft-search-result.js +1 -1
- package/dist/components/searchcraft-search-results-per-page.js +1 -1
- package/dist/components/searchcraft-search-results.js +10 -10
- package/dist/components/searchcraft-search-results.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/hydrate/index.js +144 -99
- package/dist/hydrate/index.mjs +144 -99
- package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +22 -2
- package/dist/types/components.d.ts +8 -2
- package/package.json +3 -3
- package/dist/components/p-6e5ed641.js.map +0 -1
- package/dist/components/p-aba24c85.js.map +0 -1
- package/dist/components/p-b54873ff.js.map +0 -1
package/dist/hydrate/index.mjs
CHANGED
|
@@ -3179,7 +3179,7 @@ Object.keys(react).forEach(function (k) {
|
|
|
3179
3179
|
var B = Object.defineProperty;
|
|
3180
3180
|
var N = (a, e, n) => e in a ? B(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n;
|
|
3181
3181
|
var h = (a, e, n) => N(a, typeof e != "symbol" ? e + "" : e, n);
|
|
3182
|
-
var
|
|
3182
|
+
var D = /* @__PURE__ */ ((a) => (a[a.DEBUG = 0] = "DEBUG", a[a.INFO = 1] = "INFO", a[a.WARN = 2] = "WARN", a[a.ERROR = 3] = "ERROR", a))(D || {});
|
|
3183
3183
|
class pe {
|
|
3184
3184
|
constructor(e) {
|
|
3185
3185
|
h(this, "logLevel");
|
|
@@ -3187,7 +3187,7 @@ class pe {
|
|
|
3187
3187
|
this.logLevel = e.logLevel || 1, this.logFormatter = e.logFormatter || this.defaultFormatter;
|
|
3188
3188
|
}
|
|
3189
3189
|
defaultFormatter(e, n) {
|
|
3190
|
-
return `[${
|
|
3190
|
+
return `[${D[e]}] ${( new Date()).toISOString()}: ${n}`;
|
|
3191
3191
|
}
|
|
3192
3192
|
debug(e) {
|
|
3193
3193
|
this.logLevel <= 0 && console.log(this.logFormatter(0, e));
|
|
@@ -3218,7 +3218,7 @@ class pe {
|
|
|
3218
3218
|
}
|
|
3219
3219
|
}
|
|
3220
3220
|
}
|
|
3221
|
-
function
|
|
3221
|
+
function w(a, e, n, r) {
|
|
3222
3222
|
return new (n || (n = Promise))(function(o, i) {
|
|
3223
3223
|
function t(s) {
|
|
3224
3224
|
try {
|
|
@@ -3243,7 +3243,7 @@ function y(a, e, n, r) {
|
|
|
3243
3243
|
l((r = r.apply(a, [])).next());
|
|
3244
3244
|
});
|
|
3245
3245
|
}
|
|
3246
|
-
function
|
|
3246
|
+
function y(a, e) {
|
|
3247
3247
|
var n, r, o, i, t = { label: 0, sent: function() {
|
|
3248
3248
|
if (1 & o[0]) throw o[1];
|
|
3249
3249
|
return o[1];
|
|
@@ -3302,17 +3302,17 @@ function w(a, e) {
|
|
|
3302
3302
|
};
|
|
3303
3303
|
}
|
|
3304
3304
|
}
|
|
3305
|
-
var S = { exclude: [] },
|
|
3306
|
-
typeof window < "u" && (
|
|
3305
|
+
var S = { exclude: [] }, U = {}, v = function(a, e) {
|
|
3306
|
+
typeof window < "u" && (U[a] = e);
|
|
3307
3307
|
};
|
|
3308
|
-
function
|
|
3308
|
+
function I(a) {
|
|
3309
3309
|
return a ^= a >>> 16, a = Math.imul(a, 2246822507), a ^= a >>> 13, a = Math.imul(a, 3266489909), (a ^= a >>> 16) >>> 0;
|
|
3310
3310
|
}
|
|
3311
3311
|
var m = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
|
|
3312
3312
|
function p(a, e) {
|
|
3313
3313
|
return a << e | a >>> 32 - e;
|
|
3314
3314
|
}
|
|
3315
|
-
function
|
|
3315
|
+
function R(a, e) {
|
|
3316
3316
|
var n;
|
|
3317
3317
|
if (e === void 0 && (e = 0), e = e ? 0 | e : 0, typeof a == "string" && (n = a, a = new TextEncoder().encode(n).buffer), !(a instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string");
|
|
3318
3318
|
var r = new Uint32Array([e, e, e, e]);
|
|
@@ -3356,7 +3356,7 @@ function _(a, e) {
|
|
|
3356
3356
|
s[0] = s[0] ^ c[0] << 0, s[0] = Math.imul(s[0], m[0]), s[0] = p(s[0], 15), s[0] = Math.imul(s[0], m[1]), t[0] = t[0] ^ s[0];
|
|
3357
3357
|
}
|
|
3358
3358
|
}(a, r), function(i, t) {
|
|
3359
|
-
t[0] = t[0] ^ i.byteLength, t[1] = t[1] ^ i.byteLength, t[2] = t[2] ^ i.byteLength, t[3] = t[3] ^ i.byteLength, t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0, t[0] =
|
|
3359
|
+
t[0] = t[0] ^ i.byteLength, t[1] = t[1] ^ i.byteLength, t[2] = t[2] ^ i.byteLength, t[3] = t[3] ^ i.byteLength, t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0, t[0] = I(t[0]), t[1] = I(t[1]), t[2] = I(t[2]), t[3] = I(t[3]), t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0;
|
|
3360
3360
|
}(a, r);
|
|
3361
3361
|
var o = new Uint8Array(r.buffer);
|
|
3362
3362
|
return Array.from(o).map(function(i) {
|
|
@@ -3367,7 +3367,7 @@ function H(a) {
|
|
|
3367
3367
|
for (var e = 0, n = 0; n < a.length; ++n) e += Math.abs(a[n]);
|
|
3368
3368
|
return e;
|
|
3369
3369
|
}
|
|
3370
|
-
function
|
|
3370
|
+
function L(a, e, n) {
|
|
3371
3371
|
for (var r = [], o = 0; o < a[0].data.length; o++) {
|
|
3372
3372
|
for (var i = [], t = 0; t < a.length; t++) i.push(a[t].data[o]);
|
|
3373
3373
|
r.push(Q(i));
|
|
@@ -3383,7 +3383,7 @@ function Q(a) {
|
|
|
3383
3383
|
for (var i in e) e[i] > e[o] && (o = parseInt(i, 10));
|
|
3384
3384
|
return o;
|
|
3385
3385
|
}
|
|
3386
|
-
function
|
|
3386
|
+
function A() {
|
|
3387
3387
|
if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
|
|
3388
3388
|
for (var a = navigator.userAgent, e = { Edg: "Edge", OPR: "Opera" }, n = 0, r = [/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/]; n < r.length; n++) {
|
|
3389
3389
|
var o = r[n], i = a.match(o);
|
|
@@ -3392,8 +3392,8 @@ function C() {
|
|
|
3392
3392
|
return { name: "unknown", version: "unknown" };
|
|
3393
3393
|
}
|
|
3394
3394
|
v("audio", function() {
|
|
3395
|
-
return
|
|
3396
|
-
return
|
|
3395
|
+
return w(this, void 0, void 0, function() {
|
|
3396
|
+
return y(this, function(a) {
|
|
3397
3397
|
return [2, new Promise(function(e, n) {
|
|
3398
3398
|
try {
|
|
3399
3399
|
var r = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 5e3, 44100), o = r.createBufferSource(), i = r.createOscillator();
|
|
@@ -3409,14 +3409,14 @@ v("audio", function() {
|
|
|
3409
3409
|
});
|
|
3410
3410
|
});
|
|
3411
3411
|
});
|
|
3412
|
-
var K =
|
|
3413
|
-
|
|
3412
|
+
var K = A().name !== "SamsungBrowser" ? 1 : 3, k = 280, F = 20;
|
|
3413
|
+
A().name != "Firefox" && v("canvas", function() {
|
|
3414
3414
|
return document.createElement("canvas").getContext("2d"), new Promise(function(a) {
|
|
3415
3415
|
var e = Array.from({ length: K }, function() {
|
|
3416
3416
|
return function() {
|
|
3417
3417
|
var n = document.createElement("canvas"), r = n.getContext("2d");
|
|
3418
3418
|
if (!r) return new ImageData(1, 1);
|
|
3419
|
-
n.width =
|
|
3419
|
+
n.width = k, n.height = F;
|
|
3420
3420
|
var o = r.createLinearGradient(0, 0, n.width, n.height);
|
|
3421
3421
|
o.addColorStop(0, "red"), o.addColorStop(0.16666666666666666, "orange"), o.addColorStop(0.3333333333333333, "yellow"), o.addColorStop(0.5, "green"), o.addColorStop(0.6666666666666666, "blue"), o.addColorStop(0.8333333333333334, "indigo"), o.addColorStop(1, "violet"), r.fillStyle = o, r.fillRect(0, 0, n.width, n.height);
|
|
3422
3422
|
var i = "Random Text WMwmil10Oo";
|
|
@@ -3425,11 +3425,11 @@ C().name != "Firefox" && v("canvas", function() {
|
|
|
3425
3425
|
return t;
|
|
3426
3426
|
}();
|
|
3427
3427
|
});
|
|
3428
|
-
a({ commonImageDataHash:
|
|
3428
|
+
a({ commonImageDataHash: R(L(e, k, F).data.toString()).toString() });
|
|
3429
3429
|
});
|
|
3430
3430
|
});
|
|
3431
|
-
var
|
|
3432
|
-
function
|
|
3431
|
+
var M, X = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], J = ["monospace", "sans-serif", "serif"];
|
|
3432
|
+
function O(a, e) {
|
|
3433
3433
|
if (!a) throw new Error("Canvas context not supported");
|
|
3434
3434
|
return a.font = "72px ".concat(e), a.measureText("WwMmLli0Oo").width;
|
|
3435
3435
|
}
|
|
@@ -3491,15 +3491,15 @@ function ne() {
|
|
|
3491
3491
|
}
|
|
3492
3492
|
return 0;
|
|
3493
3493
|
}
|
|
3494
|
-
|
|
3494
|
+
A().name != "Firefox" && v("fonts", function() {
|
|
3495
3495
|
var a = this;
|
|
3496
3496
|
return new Promise(function(e, n) {
|
|
3497
3497
|
try {
|
|
3498
3498
|
(function(r) {
|
|
3499
3499
|
var o;
|
|
3500
|
-
|
|
3500
|
+
w(this, void 0, void 0, function() {
|
|
3501
3501
|
var i, t, u;
|
|
3502
|
-
return
|
|
3502
|
+
return y(this, function(l) {
|
|
3503
3503
|
switch (l.label) {
|
|
3504
3504
|
case 0:
|
|
3505
3505
|
return document.body ? [3, 2] : [4, (s = 50, new Promise(function(g) {
|
|
@@ -3518,13 +3518,13 @@ C().name != "Firefox" && v("fonts", function() {
|
|
|
3518
3518
|
});
|
|
3519
3519
|
})(function(r) {
|
|
3520
3520
|
var o = r.iframe;
|
|
3521
|
-
return
|
|
3521
|
+
return w(a, void 0, void 0, function() {
|
|
3522
3522
|
var i, t, u, l;
|
|
3523
|
-
return
|
|
3523
|
+
return y(this, function(s) {
|
|
3524
3524
|
return i = o.createElement("canvas"), t = i.getContext("2d"), u = J.map(function(c) {
|
|
3525
|
-
return
|
|
3525
|
+
return O(t, c);
|
|
3526
3526
|
}), l = {}, X.forEach(function(c) {
|
|
3527
|
-
var g =
|
|
3527
|
+
var g = O(t, c);
|
|
3528
3528
|
u.includes(g) || (l[c] = g);
|
|
3529
3529
|
}), e(l), [2];
|
|
3530
3530
|
});
|
|
@@ -3544,17 +3544,17 @@ C().name != "Firefox" && v("fonts", function() {
|
|
|
3544
3544
|
a({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
3545
3545
|
});
|
|
3546
3546
|
}), v("permissions", function() {
|
|
3547
|
-
return
|
|
3547
|
+
return w(this, void 0, void 0, function() {
|
|
3548
3548
|
var a;
|
|
3549
|
-
return
|
|
3550
|
-
return
|
|
3549
|
+
return y(this, function(e) {
|
|
3550
|
+
return M = (S == null ? void 0 : S.permissions_to_check) || ["accelerometer", "accessibility", "accessibility-events", "ambient-light-sensor", "background-fetch", "background-sync", "bluetooth", "camera", "clipboard-read", "clipboard-write", "device-info", "display-capture", "gyroscope", "geolocation", "local-fonts", "magnetometer", "microphone", "midi", "nfc", "notifications", "payment-handler", "persistent-storage", "push", "speaker", "storage-access", "top-level-storage-access", "window-management", "query"], a = Array.from({ length: (S == null ? void 0 : S.retries) || 3 }, function() {
|
|
3551
3551
|
return function() {
|
|
3552
|
-
return
|
|
3552
|
+
return w(this, void 0, void 0, function() {
|
|
3553
3553
|
var n, r, o, i, t;
|
|
3554
|
-
return
|
|
3554
|
+
return y(this, function(u) {
|
|
3555
3555
|
switch (u.label) {
|
|
3556
3556
|
case 0:
|
|
3557
|
-
n = {}, r = 0, o =
|
|
3557
|
+
n = {}, r = 0, o = M, u.label = 1;
|
|
3558
3558
|
case 1:
|
|
3559
3559
|
if (!(r < o.length)) return [3, 6];
|
|
3560
3560
|
i = o[r], u.label = 2;
|
|
@@ -3573,7 +3573,7 @@ C().name != "Firefox" && v("fonts", function() {
|
|
|
3573
3573
|
});
|
|
3574
3574
|
}();
|
|
3575
3575
|
}), [2, Promise.all(a).then(function(n) {
|
|
3576
|
-
return ee(n,
|
|
3576
|
+
return ee(n, M);
|
|
3577
3577
|
})];
|
|
3578
3578
|
});
|
|
3579
3579
|
});
|
|
@@ -3592,15 +3592,15 @@ C().name != "Firefox" && v("fonts", function() {
|
|
|
3592
3592
|
});
|
|
3593
3593
|
}), v("system", function() {
|
|
3594
3594
|
return new Promise(function(a) {
|
|
3595
|
-
var e =
|
|
3595
|
+
var e = A();
|
|
3596
3596
|
a({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion: ne() });
|
|
3597
3597
|
});
|
|
3598
3598
|
});
|
|
3599
|
-
var f, re =
|
|
3599
|
+
var f, re = A().name !== "SamsungBrowser" ? 1 : 3, d = null;
|
|
3600
3600
|
v("webgl", function() {
|
|
3601
|
-
return
|
|
3601
|
+
return w(this, void 0, void 0, function() {
|
|
3602
3602
|
var a;
|
|
3603
|
-
return
|
|
3603
|
+
return y(this, function(e) {
|
|
3604
3604
|
typeof document < "u" && ((f = document.createElement("canvas")).width = 200, f.height = 100, d = f.getContext("webgl"));
|
|
3605
3605
|
try {
|
|
3606
3606
|
if (!d) throw new Error("WebGL not supported");
|
|
@@ -3630,19 +3630,19 @@ v("webgl", function() {
|
|
|
3630
3630
|
var g = c * s;
|
|
3631
3631
|
l[4 * c] = 0, l[4 * c + 1] = 0, l[4 * c + 2] = Math.cos(g) * (f.width / 2), l[4 * c + 3] = Math.sin(g) * (f.height / 2);
|
|
3632
3632
|
}
|
|
3633
|
-
var
|
|
3634
|
-
d.bindBuffer(d.ARRAY_BUFFER,
|
|
3635
|
-
var
|
|
3636
|
-
d.enableVertexAttribArray(
|
|
3637
|
-
var
|
|
3638
|
-
return d.readPixels(0, 0, f.width, f.height, d.RGBA, d.UNSIGNED_BYTE,
|
|
3633
|
+
var T = d.createBuffer();
|
|
3634
|
+
d.bindBuffer(d.ARRAY_BUFFER, T), d.bufferData(d.ARRAY_BUFFER, l, d.STATIC_DRAW);
|
|
3635
|
+
var E = d.getAttribLocation(t, "position");
|
|
3636
|
+
d.enableVertexAttribArray(E), d.vertexAttribPointer(E, 2, d.FLOAT, !1, 0, 0), d.viewport(0, 0, f.width, f.height), d.clearColor(0, 0, 0, 1), d.clear(d.COLOR_BUFFER_BIT), d.drawArrays(d.LINES, 0, 2 * u);
|
|
3637
|
+
var P = new Uint8ClampedArray(f.width * f.height * 4);
|
|
3638
|
+
return d.readPixels(0, 0, f.width, f.height, d.RGBA, d.UNSIGNED_BYTE, P), new ImageData(P, f.width, f.height);
|
|
3639
3639
|
} catch {
|
|
3640
3640
|
return new ImageData(1, 1);
|
|
3641
3641
|
} finally {
|
|
3642
3642
|
d && (d.bindBuffer(d.ARRAY_BUFFER, null), d.useProgram(null), d.viewport(0, 0, d.drawingBufferWidth, d.drawingBufferHeight), d.clearColor(0, 0, 0, 0));
|
|
3643
3643
|
}
|
|
3644
3644
|
}();
|
|
3645
|
-
}), [2, { commonImageHash:
|
|
3645
|
+
}), [2, { commonImageHash: R(L(a, f.width, f.height).data.toString()).toString() }];
|
|
3646
3646
|
} catch {
|
|
3647
3647
|
return [2, { webgl: "unsupported" }];
|
|
3648
3648
|
}
|
|
@@ -3656,8 +3656,8 @@ var b = function(a, e, n, r) {
|
|
|
3656
3656
|
return i * o;
|
|
3657
3657
|
};
|
|
3658
3658
|
v("math", function() {
|
|
3659
|
-
return
|
|
3660
|
-
return
|
|
3659
|
+
return w(void 0, void 0, void 0, function() {
|
|
3660
|
+
return y(this, function(a) {
|
|
3661
3661
|
return [2, { acos: Math.acos(0.5), asin: b(Math.asin, -1, 1, 97), atan: b(Math.atan, -1, 1, 97), cos: b(Math.cos, 0, Math.PI, 97), cosh: Math.cosh(9 / 7), e: Math.E, largeCos: Math.cos(1e20), largeSin: Math.sin(1e20), largeTan: Math.tan(1e20), log: Math.log(1e3), pi: Math.PI, sin: b(Math.sin, -Math.PI, Math.PI, 97), sinh: b(Math.sinh, -9 / 7, 7 / 9, 97), sqrt: Math.sqrt(2), tan: b(Math.tan, 0, 2 * Math.PI, 97), tanh: b(Math.tanh, -9 / 7, 7 / 9, 97) }];
|
|
3662
3662
|
});
|
|
3663
3663
|
});
|
|
@@ -3714,7 +3714,7 @@ const searchcraftStore = zustand.createStore((_set, get) => {
|
|
|
3714
3714
|
},
|
|
3715
3715
|
init: (core, debug = false) => {
|
|
3716
3716
|
const logger = debug
|
|
3717
|
-
? new pe({ logLevel:
|
|
3717
|
+
? new pe({ logLevel: D.DEBUG })
|
|
3718
3718
|
: undefined;
|
|
3719
3719
|
const state = functions.set({
|
|
3720
3720
|
core,
|
|
@@ -3752,12 +3752,12 @@ const searchcraftStore = zustand.createStore((_set, get) => {
|
|
|
3752
3752
|
},
|
|
3753
3753
|
search: async () => {
|
|
3754
3754
|
const state = get();
|
|
3755
|
-
state.logger?.log(
|
|
3755
|
+
state.logger?.log(D.INFO, `Starting search with search term: "${state.searchTerm}"`);
|
|
3756
3756
|
if (!state.core) {
|
|
3757
3757
|
throw new Error('Searchcraft instance is not initialized.');
|
|
3758
3758
|
}
|
|
3759
3759
|
if (!state.searchTerm.trim()) {
|
|
3760
|
-
state.logger?.log(
|
|
3760
|
+
state.logger?.log(D.INFO, 'No search request was made: search term was empty.');
|
|
3761
3761
|
functions.set({
|
|
3762
3762
|
searchClientResponseItems: [],
|
|
3763
3763
|
searchResultsCount: 0,
|
|
@@ -3797,8 +3797,8 @@ const searchcraftStore = zustand.createStore((_set, get) => {
|
|
|
3797
3797
|
searchClientRequest: request,
|
|
3798
3798
|
};
|
|
3799
3799
|
});
|
|
3800
|
-
state.logger?.log(
|
|
3801
|
-
state.logger?.log(
|
|
3800
|
+
state.logger?.log(D.DEBUG, `Search results: ${JSON.stringify(items)}`);
|
|
3801
|
+
state.logger?.log(D.DEBUG, `Facets from response: ${JSON.stringify(facets)}`);
|
|
3802
3802
|
},
|
|
3803
3803
|
setInitialSearchClientResponseItemsFromResponse: (request, response, items) => {
|
|
3804
3804
|
const state = get();
|
|
@@ -3815,11 +3815,11 @@ const searchcraftStore = zustand.createStore((_set, get) => {
|
|
|
3815
3815
|
searchClientRequest: request,
|
|
3816
3816
|
};
|
|
3817
3817
|
});
|
|
3818
|
-
state.logger?.log(
|
|
3818
|
+
state.logger?.log(D.DEBUG, `Search results: ${JSON.stringify(items)}`);
|
|
3819
3819
|
},
|
|
3820
3820
|
setInitialQuery: async (query) => {
|
|
3821
3821
|
const state = functions.set({ initialQuery: query });
|
|
3822
|
-
state.logger?.log(
|
|
3822
|
+
state.logger?.log(D.INFO, `Starting search with query: "${state.initialQuery}"`);
|
|
3823
3823
|
if (!state.core) {
|
|
3824
3824
|
throw new Error('Searchcraft instance is not initialized.');
|
|
3825
3825
|
}
|
|
@@ -6900,40 +6900,99 @@ class SearchcraftPopoverListItemAd {
|
|
|
6900
6900
|
}
|
|
6901
6901
|
adSource = 'Custom';
|
|
6902
6902
|
adClientResponseItem;
|
|
6903
|
-
|
|
6903
|
+
/**
|
|
6904
|
+
* Where the ad is being rendered within the search results div.
|
|
6905
|
+
* Lifecycle behavior differs for ads being rendered in different positions,
|
|
6906
|
+
* so we need to be able to handle all of those cases.
|
|
6907
|
+
*/
|
|
6908
|
+
renderPosition = 'interstitial';
|
|
6904
6909
|
searchTerm;
|
|
6905
6910
|
isSearchInProgress = false;
|
|
6911
|
+
searchResultCount = 0;
|
|
6906
6912
|
get hostElement() { return getElement(this); }
|
|
6907
6913
|
core;
|
|
6908
6914
|
intersectionObserver;
|
|
6909
6915
|
storeUnsubscribe;
|
|
6910
6916
|
adContainerRenderedTimeout;
|
|
6911
|
-
isComponentConnected =
|
|
6917
|
+
isComponentConnected = false;
|
|
6918
|
+
timeTaken;
|
|
6919
|
+
adContainerId = '';
|
|
6920
|
+
/**
|
|
6921
|
+
* Handles when an ad container is first rendered.
|
|
6922
|
+
* Core emits an ad_container_rendered event and performs ad client side effects
|
|
6923
|
+
*
|
|
6924
|
+
*/
|
|
6925
|
+
handleAdRendered() {
|
|
6926
|
+
this.adContainerId = nanoid();
|
|
6927
|
+
if (this.isComponentConnected && this.searchResultCount > 0) {
|
|
6928
|
+
clearTimeout(this.adContainerRenderedTimeout);
|
|
6929
|
+
this.adContainerRenderedTimeout = setTimeout(() => {
|
|
6930
|
+
this.core?.handleAdContainerRendered({
|
|
6931
|
+
adClientResponseItem: this.adClientResponseItem,
|
|
6932
|
+
adContainerId: this.adContainerId,
|
|
6933
|
+
adSource: this.adSource,
|
|
6934
|
+
searchTerm: this.searchTerm || '',
|
|
6935
|
+
});
|
|
6936
|
+
}, this.core?.config?.adContainerRenderedDebounceDelay || 300);
|
|
6937
|
+
}
|
|
6938
|
+
}
|
|
6939
|
+
handleAdViewed() {
|
|
6940
|
+
this.core?.handleAdContainerViewed({
|
|
6941
|
+
adClientResponseItem: this.adClientResponseItem,
|
|
6942
|
+
adContainerId: this.adContainerId,
|
|
6943
|
+
adSource: this.adSource,
|
|
6944
|
+
searchTerm: this.searchTerm || '',
|
|
6945
|
+
});
|
|
6946
|
+
}
|
|
6947
|
+
/**
|
|
6948
|
+
* Things to do when there's a new incoming search request.
|
|
6949
|
+
*/
|
|
6950
|
+
handleNewIncomingSearchRequest(state) {
|
|
6951
|
+
const request = state.searchClientRequest;
|
|
6952
|
+
if (request && typeof request === 'object') {
|
|
6953
|
+
this.searchTerm = request.searchTerm;
|
|
6954
|
+
}
|
|
6955
|
+
this.searchResultCount = state.searchClientResponseItems.length;
|
|
6956
|
+
this.handleAdRendered();
|
|
6957
|
+
this.startIntersectionObserver();
|
|
6958
|
+
}
|
|
6912
6959
|
connectedCallback() {
|
|
6913
6960
|
const currentState = searchcraftStore.getState();
|
|
6961
|
+
this.isComponentConnected = true;
|
|
6914
6962
|
this.core = currentState.core;
|
|
6915
|
-
this.searchTerm = currentState.searchTerm;
|
|
6916
6963
|
this.isSearchInProgress = currentState.isSearchInProgress;
|
|
6964
|
+
this.searchResultCount = currentState.searchClientResponseItems.length;
|
|
6965
|
+
this.timeTaken = currentState.searchResponseTimeTaken;
|
|
6966
|
+
const request = currentState.searchClientRequest;
|
|
6967
|
+
if (request && typeof request === 'object') {
|
|
6968
|
+
this.searchTerm = request.searchTerm;
|
|
6969
|
+
}
|
|
6970
|
+
/**
|
|
6971
|
+
* Interstial ads have a different lifecycle, where we need handle an incoming search
|
|
6972
|
+
* request immediately, because they are rendered alongside the search results.
|
|
6973
|
+
*/
|
|
6974
|
+
if (this.renderPosition === 'interstitial') {
|
|
6975
|
+
this.handleNewIncomingSearchRequest(currentState);
|
|
6976
|
+
}
|
|
6917
6977
|
// Subscribes to store changes (for search term).
|
|
6918
6978
|
this.storeUnsubscribe = searchcraftStore.subscribe((state) => {
|
|
6919
|
-
this.
|
|
6979
|
+
if (this.timeTaken !== state.searchResponseTimeTaken) {
|
|
6980
|
+
this.handleNewIncomingSearchRequest(state);
|
|
6981
|
+
}
|
|
6982
|
+
this.timeTaken = state.searchResponseTimeTaken;
|
|
6920
6983
|
this.isSearchInProgress = state.isSearchInProgress;
|
|
6921
6984
|
});
|
|
6922
6985
|
}
|
|
6923
|
-
|
|
6986
|
+
startIntersectionObserver() {
|
|
6987
|
+
this.intersectionObserver?.disconnect();
|
|
6924
6988
|
/**
|
|
6925
6989
|
* Handles when an ad container is viewable within the document,
|
|
6926
6990
|
* Core emits an ad_container_viewed event and performs ad client side effects
|
|
6927
6991
|
*/
|
|
6928
6992
|
if (this.hostElement) {
|
|
6929
6993
|
this.intersectionObserver = new IntersectionObserver(([entry]) => {
|
|
6930
|
-
if (entry?.isIntersecting &&
|
|
6931
|
-
this.
|
|
6932
|
-
adClientResponseItem: this.adClientResponseItem,
|
|
6933
|
-
adContainerId: this.adContainerId,
|
|
6934
|
-
adSource: this.adSource,
|
|
6935
|
-
searchTerm: this.searchTerm || '',
|
|
6936
|
-
});
|
|
6994
|
+
if (entry?.isIntersecting && this.searchResultCount > 0) {
|
|
6995
|
+
this.handleAdViewed();
|
|
6937
6996
|
}
|
|
6938
6997
|
}, { threshold: 0 });
|
|
6939
6998
|
this.intersectionObserver.observe(this.hostElement);
|
|
@@ -6973,26 +7032,10 @@ class SearchcraftPopoverListItemAd {
|
|
|
6973
7032
|
return (hAsync("div", { id: `searchcraft-native-ad-${this.adContainerId}`, class: classNames('searchcraft-ad', nativoClassName), "data-searchcraft-ad-container-id": this.adContainerId }));
|
|
6974
7033
|
}
|
|
6975
7034
|
render() {
|
|
6976
|
-
// Don't render ads
|
|
6977
|
-
if (this.
|
|
7035
|
+
// Don't render ads if no search results
|
|
7036
|
+
if (this.searchResultCount === 0) {
|
|
6978
7037
|
return;
|
|
6979
7038
|
}
|
|
6980
|
-
/**
|
|
6981
|
-
* Handles when an ad container is first rendered.
|
|
6982
|
-
* Core emits an ad_container_rendered event and performs ad client side effects
|
|
6983
|
-
*
|
|
6984
|
-
*/
|
|
6985
|
-
if (this.isComponentConnected) {
|
|
6986
|
-
clearTimeout(this.adContainerRenderedTimeout);
|
|
6987
|
-
this.adContainerRenderedTimeout = setTimeout(() => {
|
|
6988
|
-
this.core?.handleAdContainerRendered({
|
|
6989
|
-
adClientResponseItem: this.adClientResponseItem,
|
|
6990
|
-
adContainerId: this.adContainerId,
|
|
6991
|
-
adSource: this.adSource,
|
|
6992
|
-
searchTerm: this.searchTerm || '',
|
|
6993
|
-
});
|
|
6994
|
-
}, this.core?.config?.adContainerRenderedDebounceDelay || 500);
|
|
6995
|
-
}
|
|
6996
7039
|
switch (this.adSource) {
|
|
6997
7040
|
case 'adMarketplace':
|
|
6998
7041
|
return this.renderADMAd();
|
|
@@ -7010,9 +7053,11 @@ class SearchcraftPopoverListItemAd {
|
|
|
7010
7053
|
"$members$": {
|
|
7011
7054
|
"adSource": [1, "ad-source"],
|
|
7012
7055
|
"adClientResponseItem": [16],
|
|
7013
|
-
"
|
|
7056
|
+
"renderPosition": [1, "render-position"],
|
|
7014
7057
|
"searchTerm": [32],
|
|
7015
|
-
"isSearchInProgress": [32]
|
|
7058
|
+
"isSearchInProgress": [32],
|
|
7059
|
+
"searchResultCount": [32],
|
|
7060
|
+
"adContainerId": [32]
|
|
7016
7061
|
},
|
|
7017
7062
|
"$listeners$": undefined,
|
|
7018
7063
|
"$lazyBundleId$": "-",
|
|
@@ -7049,7 +7094,7 @@ class SearchcraftPopoverListView {
|
|
|
7049
7094
|
searchResultsPerPage;
|
|
7050
7095
|
config = searchcraftStore.getState().core?.config;
|
|
7051
7096
|
renderWithADMAds() {
|
|
7052
|
-
return (hAsync("div", { class: 'searchcraft-popover-list-view' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { adClientResponseItem: item,
|
|
7097
|
+
return (hAsync("div", { class: 'searchcraft-popover-list-view' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { adClientResponseItem: item, adSource: 'adMarketplace', key: item.id, renderPosition: 'top' }))), this.searchClientResponseItems?.map((item, index) => (hAsync("searchcraft-popover-list-item", { item: item, key: item.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + index })))));
|
|
7053
7098
|
}
|
|
7054
7099
|
renderWithCustomAds() {
|
|
7055
7100
|
const itemsToRender = [];
|
|
@@ -7060,7 +7105,7 @@ class SearchcraftPopoverListView {
|
|
|
7060
7105
|
const searchItems = this.searchClientResponseItems || [];
|
|
7061
7106
|
// Renders ads at beginning
|
|
7062
7107
|
for (let n = 0; n < adStartQuantity; n++) {
|
|
7063
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom',
|
|
7108
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom', key: `${n}-ad`, renderPosition: 'top' }));
|
|
7064
7109
|
}
|
|
7065
7110
|
// Renders search results + interstitial ads
|
|
7066
7111
|
searchItems.forEach((item, index) => {
|
|
@@ -7069,14 +7114,14 @@ class SearchcraftPopoverListView {
|
|
|
7069
7114
|
index + interstitialInterval < searchItems.length &&
|
|
7070
7115
|
index >= interstitialInterval) {
|
|
7071
7116
|
for (let n = 0; n < interstitialQuantity; n++) {
|
|
7072
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom',
|
|
7117
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
|
|
7073
7118
|
}
|
|
7074
7119
|
}
|
|
7075
7120
|
itemsToRender.push(hAsync("searchcraft-popover-list-item", { item: item, key: item.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + index }));
|
|
7076
7121
|
});
|
|
7077
7122
|
// Renders ads at end
|
|
7078
7123
|
for (let n = 0; n < adEndQuantity; n++) {
|
|
7079
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom',
|
|
7124
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom', key: `${n}-ad`, renderPosition: 'bottom' }));
|
|
7080
7125
|
}
|
|
7081
7126
|
return hAsync("div", { class: 'searchcraft-popover-list-view' }, itemsToRender);
|
|
7082
7127
|
}
|
|
@@ -7090,7 +7135,7 @@ class SearchcraftPopoverListView {
|
|
|
7090
7135
|
const searchItems = this.searchClientResponseItems || [];
|
|
7091
7136
|
// Renders ads at beginning
|
|
7092
7137
|
for (let n = 0; n < adStartQuantity; n++) {
|
|
7093
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo',
|
|
7138
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'top' }));
|
|
7094
7139
|
}
|
|
7095
7140
|
// Renders search results + interstitial ads
|
|
7096
7141
|
searchItems.forEach((item, index) => {
|
|
@@ -7099,14 +7144,14 @@ class SearchcraftPopoverListView {
|
|
|
7099
7144
|
index + interstitialInterval < searchItems.length &&
|
|
7100
7145
|
index >= interstitialInterval) {
|
|
7101
7146
|
for (let n = 0; n < interstitialQuantity; n++) {
|
|
7102
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo',
|
|
7147
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
|
|
7103
7148
|
}
|
|
7104
7149
|
}
|
|
7105
7150
|
itemsToRender.push(hAsync("searchcraft-popover-list-item", { item: item, key: item.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + index }));
|
|
7106
7151
|
});
|
|
7107
7152
|
// Renders ads at end
|
|
7108
7153
|
for (let n = 0; n < adEndQuantity; n++) {
|
|
7109
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo',
|
|
7154
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'bottom' }));
|
|
7110
7155
|
}
|
|
7111
7156
|
return hAsync("div", { class: 'searchcraft-popover-list-view' }, itemsToRender);
|
|
7112
7157
|
}
|
|
@@ -7463,7 +7508,7 @@ class SearchcraftSearchResults {
|
|
|
7463
7508
|
: this.initialSearchClientResponseItems?.length
|
|
7464
7509
|
? this.initialSearchClientResponseItems
|
|
7465
7510
|
: [];
|
|
7466
|
-
return (hAsync("div", { class: 'searchcraft-search-results' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { adSource: 'adMarketplace', adClientResponseItem: item,
|
|
7511
|
+
return (hAsync("div", { class: 'searchcraft-search-results' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { adSource: 'adMarketplace', adClientResponseItem: item, key: item.id, renderPosition: 'top' }))), items.map((item, index) => (hAsync("searchcraft-search-result", { key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
|
|
7467
7512
|
}
|
|
7468
7513
|
renderWithCustomAds() {
|
|
7469
7514
|
const itemsToRender = [];
|
|
@@ -7478,7 +7523,7 @@ class SearchcraftSearchResults {
|
|
|
7478
7523
|
: [];
|
|
7479
7524
|
// Renders ads at beginning
|
|
7480
7525
|
for (let n = 0; n < adStartQuantity; n++) {
|
|
7481
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom',
|
|
7526
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom', key: `${n}-ad`, renderPosition: 'top' }));
|
|
7482
7527
|
}
|
|
7483
7528
|
// Renders search results + interstitial ads
|
|
7484
7529
|
items.forEach((item, index) => {
|
|
@@ -7487,14 +7532,14 @@ class SearchcraftSearchResults {
|
|
|
7487
7532
|
index + interstitialInterval < items.length &&
|
|
7488
7533
|
index >= interstitialInterval) {
|
|
7489
7534
|
for (let n = 0; n < interstitialQuantity; n++) {
|
|
7490
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom',
|
|
7535
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
|
|
7491
7536
|
}
|
|
7492
7537
|
}
|
|
7493
7538
|
itemsToRender.push(hAsync("searchcraft-search-result", { key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
|
|
7494
7539
|
});
|
|
7495
7540
|
// Renders ads at end
|
|
7496
7541
|
for (let n = 0; n < adEndQuantity; n++) {
|
|
7497
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom',
|
|
7542
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Custom', key: `${n}-ad`, renderPosition: 'bottom' }));
|
|
7498
7543
|
}
|
|
7499
7544
|
return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
|
|
7500
7545
|
}
|
|
@@ -7512,7 +7557,7 @@ class SearchcraftSearchResults {
|
|
|
7512
7557
|
: [];
|
|
7513
7558
|
// Renders ads at beginning
|
|
7514
7559
|
for (let n = 0; n < adStartQuantity; n++) {
|
|
7515
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo',
|
|
7560
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'top' }));
|
|
7516
7561
|
}
|
|
7517
7562
|
// Renders search results + interstitial ads
|
|
7518
7563
|
items.forEach((item, index) => {
|
|
@@ -7521,14 +7566,14 @@ class SearchcraftSearchResults {
|
|
|
7521
7566
|
index + interstitialInterval < items.length &&
|
|
7522
7567
|
index >= interstitialInterval) {
|
|
7523
7568
|
for (let n = 0; n < interstitialQuantity; n++) {
|
|
7524
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo',
|
|
7569
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
|
|
7525
7570
|
}
|
|
7526
7571
|
}
|
|
7527
7572
|
itemsToRender.push(hAsync("searchcraft-search-result", { key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
|
|
7528
7573
|
});
|
|
7529
7574
|
// Renders ads at end
|
|
7530
7575
|
for (let n = 0; n < adEndQuantity; n++) {
|
|
7531
|
-
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo',
|
|
7576
|
+
itemsToRender.push(hAsync("searchcraft-ad", { adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'bottom' }));
|
|
7532
7577
|
}
|
|
7533
7578
|
return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
|
|
7534
7579
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AdClientResponseItem, SearchcraftAdSource } from '@searchcraft/core';
|
|
2
|
+
import { type SearchcraftState } from "../../store/index";
|
|
2
3
|
/**
|
|
3
4
|
* An inline ad meant to be rendered in a list of search results.
|
|
4
5
|
*
|
|
@@ -7,17 +8,36 @@ import type { AdClientResponseItem, SearchcraftAdSource } from '@searchcraft/cor
|
|
|
7
8
|
export declare class SearchcraftPopoverListItemAd {
|
|
8
9
|
adSource: SearchcraftAdSource;
|
|
9
10
|
adClientResponseItem?: AdClientResponseItem;
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Where the ad is being rendered within the search results div.
|
|
13
|
+
* Lifecycle behavior differs for ads being rendered in different positions,
|
|
14
|
+
* so we need to be able to handle all of those cases.
|
|
15
|
+
*/
|
|
16
|
+
renderPosition: 'interstitial' | 'top' | 'bottom';
|
|
11
17
|
searchTerm?: string;
|
|
12
18
|
isSearchInProgress: boolean;
|
|
19
|
+
searchResultCount: number;
|
|
13
20
|
hostElement?: HTMLElement;
|
|
14
21
|
private core?;
|
|
15
22
|
private intersectionObserver?;
|
|
16
23
|
private storeUnsubscribe?;
|
|
17
24
|
private adContainerRenderedTimeout?;
|
|
18
25
|
private isComponentConnected;
|
|
26
|
+
private timeTaken?;
|
|
27
|
+
adContainerId: string;
|
|
28
|
+
/**
|
|
29
|
+
* Handles when an ad container is first rendered.
|
|
30
|
+
* Core emits an ad_container_rendered event and performs ad client side effects
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
handleAdRendered(): void;
|
|
34
|
+
handleAdViewed(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Things to do when there's a new incoming search request.
|
|
37
|
+
*/
|
|
38
|
+
handleNewIncomingSearchRequest(state: SearchcraftState): void;
|
|
19
39
|
connectedCallback(): void;
|
|
20
|
-
|
|
40
|
+
startIntersectionObserver(): void;
|
|
21
41
|
disconnectedCallback(): void;
|
|
22
42
|
renderADMAd(): any;
|
|
23
43
|
renderCustomAd(): any;
|