@searchstax-inc/searchstudio-ux-react 0.3.16 → 0.3.18
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ct, { useState as q, useEffect as ee, useRef as Ot, createRef as tt } from "react";
|
|
2
|
-
var je = { exports: {} },
|
|
2
|
+
var je = { exports: {} }, he = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -12,7 +12,7 @@ var je = { exports: {} }, le = {};
|
|
|
12
12
|
var at;
|
|
13
13
|
function At() {
|
|
14
14
|
if (at)
|
|
15
|
-
return
|
|
15
|
+
return he;
|
|
16
16
|
at = 1;
|
|
17
17
|
var i = ct, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
18
|
function c(l, o, d) {
|
|
@@ -25,9 +25,9 @@ function At() {
|
|
|
25
25
|
g[f] === void 0 && (g[f] = o[f]);
|
|
26
26
|
return { $$typeof: e, type: l, key: m, ref: S, props: g, _owner: a.current };
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return he.Fragment = t, he.jsx = c, he.jsxs = c, he;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var ue = {};
|
|
31
31
|
/**
|
|
32
32
|
* @license React
|
|
33
33
|
* react-jsx-runtime.development.js
|
|
@@ -129,13 +129,13 @@ function Mt() {
|
|
|
129
129
|
}
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
var Y = Object.assign,
|
|
132
|
+
var Y = Object.assign, le = 0, Oe, Ae, Me, De, Ne, $e, qe;
|
|
133
133
|
function _e() {
|
|
134
134
|
}
|
|
135
135
|
_e.__reactDisabledLog = !0;
|
|
136
136
|
function lt() {
|
|
137
137
|
{
|
|
138
|
-
if (
|
|
138
|
+
if (le === 0) {
|
|
139
139
|
Oe = console.log, Ae = console.info, Me = console.warn, De = console.error, Ne = console.group, $e = console.groupCollapsed, qe = console.groupEnd;
|
|
140
140
|
var n = {
|
|
141
141
|
configurable: !0,
|
|
@@ -153,12 +153,12 @@ function Mt() {
|
|
|
153
153
|
groupEnd: n
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
le++;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
function ot() {
|
|
160
160
|
{
|
|
161
|
-
if (
|
|
161
|
+
if (le--, le === 0) {
|
|
162
162
|
var n = {
|
|
163
163
|
configurable: !0,
|
|
164
164
|
enumerable: !0,
|
|
@@ -188,7 +188,7 @@ function Mt() {
|
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
le < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
var Ce = E.ReactCurrentDispatcher, Se;
|
|
@@ -278,7 +278,7 @@ function Mt() {
|
|
|
278
278
|
} finally {
|
|
279
279
|
Le = !1, Ce.current = A, ot(), Error.prepareStackTrace = F;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
281
|
+
var se = n ? n.displayName || n.name : "", et = se ? fe(se) : "";
|
|
282
282
|
return typeof n == "function" && ve.set(n, et), et;
|
|
283
283
|
}
|
|
284
284
|
function ut(n, p, y) {
|
|
@@ -368,7 +368,7 @@ function Mt() {
|
|
|
368
368
|
if (ft(n))
|
|
369
369
|
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", mt(n)), Ve(n);
|
|
370
370
|
}
|
|
371
|
-
var
|
|
371
|
+
var oe = E.ReactCurrentOwner, vt = {
|
|
372
372
|
key: !0,
|
|
373
373
|
ref: !0,
|
|
374
374
|
__self: !0,
|
|
@@ -392,9 +392,9 @@ function Mt() {
|
|
|
392
392
|
return n.key !== void 0;
|
|
393
393
|
}
|
|
394
394
|
function bt(n, p) {
|
|
395
|
-
if (typeof n.ref == "string" &&
|
|
396
|
-
var y = Q(
|
|
397
|
-
ke[y] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', Q(
|
|
395
|
+
if (typeof n.ref == "string" && oe.current && p && oe.current.stateNode !== p) {
|
|
396
|
+
var y = Q(oe.current.type);
|
|
397
|
+
ke[y] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', Q(oe.current.type), n.ref), ke[y] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function Ct(n, p) {
|
|
@@ -463,11 +463,11 @@ function Mt() {
|
|
|
463
463
|
var H = typeof n == "function" ? n.displayName || n.name || "Unknown" : n;
|
|
464
464
|
w && Ct(I, H), V && St(I, H);
|
|
465
465
|
}
|
|
466
|
-
return Lt(n, w, V, F, L,
|
|
466
|
+
return Lt(n, w, V, F, L, oe.current, I);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var Re = E.ReactCurrentOwner, ze = E.ReactDebugCurrentFrame;
|
|
470
|
-
function
|
|
470
|
+
function ae(n) {
|
|
471
471
|
if (n) {
|
|
472
472
|
var p = n._owner, y = ye(n.type, n._source, p ? p.type : null);
|
|
473
473
|
ze.setExtraStackFrame(y);
|
|
@@ -525,7 +525,7 @@ Check the top-level render call using <` + y + ">.");
|
|
|
525
525
|
return;
|
|
526
526
|
Ye[y] = !0;
|
|
527
527
|
var L = "";
|
|
528
|
-
n && n._owner && n._owner !== Re.current && (L = " It was passed a child from " + Q(n._owner.type) + "."),
|
|
528
|
+
n && n._owner && n._owner !== Re.current && (L = " It was passed a child from " + Q(n._owner.type) + "."), ae(n), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', y, L), ae(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
function Xe(n, p) {
|
|
@@ -577,11 +577,11 @@ Check the top-level render call using <` + y + ">.");
|
|
|
577
577
|
for (var p = Object.keys(n.props), y = 0; y < p.length; y++) {
|
|
578
578
|
var L = p[y];
|
|
579
579
|
if (L !== "children" && L !== "key") {
|
|
580
|
-
|
|
580
|
+
ae(n), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", L), ae(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
n.ref !== null && (
|
|
584
|
+
n.ref !== null && (ae(n), T("Invalid attribute `ref` supplied to `React.Fragment`."), ae(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
function Ze(n, p, y, L, F, A) {
|
|
@@ -603,8 +603,8 @@ Check the top-level render call using <` + y + ">.");
|
|
|
603
603
|
if (z !== void 0)
|
|
604
604
|
if (L)
|
|
605
605
|
if (Te(z)) {
|
|
606
|
-
for (var
|
|
607
|
-
Xe(z[
|
|
606
|
+
for (var se = 0; se < z.length; se++)
|
|
607
|
+
Xe(z[se], n);
|
|
608
608
|
Object.freeze && Object.freeze(z);
|
|
609
609
|
} else
|
|
610
610
|
T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
@@ -621,8 +621,8 @@ Check the top-level render call using <` + y + ">.");
|
|
|
621
621
|
return Ze(n, p, y, !1);
|
|
622
622
|
}
|
|
623
623
|
var jt = Pt, Ft = It;
|
|
624
|
-
|
|
625
|
-
}()),
|
|
624
|
+
ue.Fragment = s, ue.jsx = jt, ue.jsxs = Ft;
|
|
625
|
+
}()), ue;
|
|
626
626
|
}
|
|
627
627
|
process.env.NODE_ENV === "production" ? je.exports = At() : je.exports = Mt();
|
|
628
628
|
var u = je.exports, Dt = Object.defineProperty, Nt = (i, e, t) => e in i ? Dt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, h = (i, e, t) => (Nt(i, typeof e != "symbol" ? e + "" : e, t), t), W = /* @__PURE__ */ ((i) => (i[i.mustache = 0] = "mustache", i[i.vue = 1] = "vue", i[i.react = 2] = "react", i[i.angular = 3] = "angular", i))(W || {});
|
|
@@ -1033,7 +1033,7 @@ class qt {
|
|
|
1033
1033
|
return (this.$cookiesDisabled.getValue() ?? !1) || !navigator.cookieEnabled;
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
|
-
class
|
|
1036
|
+
class de {
|
|
1037
1037
|
static combineResultsWithMetadata(e) {
|
|
1038
1038
|
const t = [], s = parseInt(e.response.start + "");
|
|
1039
1039
|
return parseInt(e.responseHeader.params.rows), e.response.docs.forEach((a, r) => {
|
|
@@ -1256,7 +1256,7 @@ class _t {
|
|
|
1256
1256
|
return e.indexOf("?") !== -1;
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
|
-
const
|
|
1259
|
+
const re = {
|
|
1260
1260
|
questionURL: "http://smartsearch-dev.searchstax.co/completion/?q=",
|
|
1261
1261
|
question: "I_AM_A_QUESTION",
|
|
1262
1262
|
notQuestion: "I_AM_NOT_A_QUESTION",
|
|
@@ -1320,7 +1320,7 @@ class Ht {
|
|
|
1320
1320
|
));
|
|
1321
1321
|
}
|
|
1322
1322
|
cacheFacetsCallback(e) {
|
|
1323
|
-
let t =
|
|
1323
|
+
let t = de.extractFacets(e);
|
|
1324
1324
|
this.dataLayer.setSearchFacetsCached(t);
|
|
1325
1325
|
}
|
|
1326
1326
|
search(e, t, s = !1, a = !1) {
|
|
@@ -1355,13 +1355,13 @@ class Ht {
|
|
|
1355
1355
|
startSSE(e, t) {
|
|
1356
1356
|
if (!this.dataLayer.turnAIAnswerGenerationOn || e === "*" || this.dataLayer.lastSearchValue === e || this.dataLayer.searchObject.facets.length > 0 || this.dataLayer.searchObject.page !== 1)
|
|
1357
1357
|
return;
|
|
1358
|
-
const s = new EventSource(
|
|
1358
|
+
const s = new EventSource(re.questionURL + e), a = this.dataLayer;
|
|
1359
1359
|
s.onmessage = function(r) {
|
|
1360
|
-
if (r.data ===
|
|
1360
|
+
if (r.data === re.question || r.data === re.notQuestion) {
|
|
1361
1361
|
a.setAnswerData("");
|
|
1362
1362
|
return;
|
|
1363
1363
|
}
|
|
1364
|
-
if (r.data ===
|
|
1364
|
+
if (r.data === re.close) {
|
|
1365
1365
|
s.close();
|
|
1366
1366
|
return;
|
|
1367
1367
|
}
|
|
@@ -1395,7 +1395,7 @@ class Ht {
|
|
|
1395
1395
|
return "&" + t.join("&");
|
|
1396
1396
|
}
|
|
1397
1397
|
}
|
|
1398
|
-
class
|
|
1398
|
+
class ie {
|
|
1399
1399
|
static trackClick(e) {
|
|
1400
1400
|
const t = {
|
|
1401
1401
|
key: e.trackApiKey,
|
|
@@ -1410,9 +1410,12 @@ class ue {
|
|
|
1410
1410
|
position: e.result.position,
|
|
1411
1411
|
language: e.language
|
|
1412
1412
|
};
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1413
|
+
return new Promise((s, a) => {
|
|
1414
|
+
const r = ["trackClick", t];
|
|
1415
|
+
t.key && this.msq().push(r, (function(c, l) {
|
|
1416
|
+
JSON.stringify(c) === JSON.stringify(t) && l ? s() : a();
|
|
1417
|
+
}).bind(this));
|
|
1418
|
+
});
|
|
1416
1419
|
}
|
|
1417
1420
|
static trackSearch(e) {
|
|
1418
1421
|
const t = {
|
|
@@ -1461,19 +1464,19 @@ class ue {
|
|
|
1461
1464
|
}, 0);
|
|
1462
1465
|
}
|
|
1463
1466
|
}
|
|
1464
|
-
h(
|
|
1467
|
+
h(ie, "subscribedToClickEvent", !1), h(ie, "msq", () => typeof window < "u" && window != null && window._msq ? window == null ? void 0 : window._msq : []);
|
|
1465
1468
|
/*!
|
|
1466
1469
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
1467
1470
|
* http://github.com/janl/mustache.js
|
|
1468
1471
|
*/
|
|
1469
|
-
var Bt = Object.prototype.toString,
|
|
1472
|
+
var Bt = Object.prototype.toString, ce = Array.isArray || function(i) {
|
|
1470
1473
|
return Bt.call(i) === "[object Array]";
|
|
1471
1474
|
};
|
|
1472
1475
|
function Fe(i) {
|
|
1473
1476
|
return typeof i == "function";
|
|
1474
1477
|
}
|
|
1475
1478
|
function Wt(i) {
|
|
1476
|
-
return
|
|
1479
|
+
return ce(i) ? "array" : typeof i;
|
|
1477
1480
|
}
|
|
1478
1481
|
function Pe(i) {
|
|
1479
1482
|
return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
@@ -1522,7 +1525,7 @@ function ta(i, e) {
|
|
|
1522
1525
|
}
|
|
1523
1526
|
var g, m, S;
|
|
1524
1527
|
function O(x) {
|
|
1525
|
-
if (typeof x == "string" && (x = x.split(Xt, 2)), !
|
|
1528
|
+
if (typeof x == "string" && (x = x.split(Xt, 2)), !ce(x) || x.length !== 2)
|
|
1526
1529
|
throw new Error("Invalid tags: " + x);
|
|
1527
1530
|
g = new RegExp(Pe(x[0]) + "\\s*"), m = new RegExp("\\s*" + Pe(x[1])), S = new RegExp("\\s*" + Pe("}" + x[1]));
|
|
1528
1531
|
}
|
|
@@ -1597,13 +1600,13 @@ pe.prototype.scanUntil = function(i) {
|
|
|
1597
1600
|
}
|
|
1598
1601
|
return this.pos += t.length, t;
|
|
1599
1602
|
};
|
|
1600
|
-
function
|
|
1603
|
+
function ne(i, e) {
|
|
1601
1604
|
this.view = i, this.cache = { ".": this.view }, this.parent = e;
|
|
1602
1605
|
}
|
|
1603
|
-
|
|
1604
|
-
return new
|
|
1606
|
+
ne.prototype.push = function(i) {
|
|
1607
|
+
return new ne(i, this);
|
|
1605
1608
|
};
|
|
1606
|
-
|
|
1609
|
+
ne.prototype.lookup = function(i) {
|
|
1607
1610
|
var e = this.cache, t;
|
|
1608
1611
|
if (e.hasOwnProperty(i))
|
|
1609
1612
|
t = e[i];
|
|
@@ -1646,7 +1649,7 @@ U.prototype.parse = function(i, e) {
|
|
|
1646
1649
|
return r == null && (r = ta(i, e), a && t.set(s, r)), r;
|
|
1647
1650
|
};
|
|
1648
1651
|
U.prototype.render = function(i, e, t, s) {
|
|
1649
|
-
var a = this.getConfigTags(s), r = this.parse(i, a), c = e instanceof
|
|
1652
|
+
var a = this.getConfigTags(s), r = this.parse(i, a), c = e instanceof ne ? e : new ne(e, void 0);
|
|
1650
1653
|
return this.renderTokens(r, c, t, i, s);
|
|
1651
1654
|
};
|
|
1652
1655
|
U.prototype.renderTokens = function(i, e, t, s, a) {
|
|
@@ -1660,7 +1663,7 @@ U.prototype.renderSection = function(i, e, t, s, a) {
|
|
|
1660
1663
|
return r.render(g, e, t, a);
|
|
1661
1664
|
}
|
|
1662
1665
|
if (l) {
|
|
1663
|
-
if (
|
|
1666
|
+
if (ce(l))
|
|
1664
1667
|
for (var d = 0, f = l.length; d < f; ++d)
|
|
1665
1668
|
c += this.renderTokens(i[4], e.push(l[d]), t, s, a);
|
|
1666
1669
|
else if (typeof l == "object" || typeof l == "string" || typeof l == "number")
|
|
@@ -1676,7 +1679,7 @@ U.prototype.renderSection = function(i, e, t, s, a) {
|
|
|
1676
1679
|
};
|
|
1677
1680
|
U.prototype.renderInverted = function(i, e, t, s, a) {
|
|
1678
1681
|
var r = e.lookup(i[1]);
|
|
1679
|
-
if (!r ||
|
|
1682
|
+
if (!r || ce(r) && r.length === 0)
|
|
1680
1683
|
return this.renderTokens(i[4], e, t, s, a);
|
|
1681
1684
|
};
|
|
1682
1685
|
U.prototype.indentPartial = function(i, e, t) {
|
|
@@ -1711,10 +1714,10 @@ U.prototype.rawValue = function(i) {
|
|
|
1711
1714
|
return i[1];
|
|
1712
1715
|
};
|
|
1713
1716
|
U.prototype.getConfigTags = function(i) {
|
|
1714
|
-
return
|
|
1717
|
+
return ce(i) ? i : i && typeof i == "object" ? i.tags : void 0;
|
|
1715
1718
|
};
|
|
1716
1719
|
U.prototype.getConfigEscape = function(i) {
|
|
1717
|
-
if (i && typeof i == "object" && !
|
|
1720
|
+
if (i && typeof i == "object" && !ce(i))
|
|
1718
1721
|
return i.escape;
|
|
1719
1722
|
};
|
|
1720
1723
|
var P = {
|
|
@@ -1756,7 +1759,7 @@ P.render = function(i, e, t, s) {
|
|
|
1756
1759
|
};
|
|
1757
1760
|
P.escape = Yt;
|
|
1758
1761
|
P.Scanner = pe;
|
|
1759
|
-
P.Context =
|
|
1762
|
+
P.Context = ne;
|
|
1760
1763
|
P.Writer = U;
|
|
1761
1764
|
const ra = {
|
|
1762
1765
|
main: {
|
|
@@ -1954,7 +1957,7 @@ const ra = {
|
|
|
1954
1957
|
},
|
|
1955
1958
|
relatedSearch: {
|
|
1956
1959
|
template: `
|
|
1957
|
-
<span class="searchstax-related-search searchstax-related-search-item" tabindex="0">
|
|
1960
|
+
<span class="searchstax-related-search searchstax-related-search-item" aria-label="Related search: {{related_search}}" tabindex="0">
|
|
1958
1961
|
{{ related_search }}{{^last}}<span>,</span>{{/last}}
|
|
1959
1962
|
</span>
|
|
1960
1963
|
`,
|
|
@@ -1967,10 +1970,10 @@ const ra = {
|
|
|
1967
1970
|
<a href="#searchstax-search-results" class="searchstax-skip">Skip to results section</a>
|
|
1968
1971
|
<h4 class="searchstax-feedback-container">
|
|
1969
1972
|
{{#hasResults}}
|
|
1970
|
-
|
|
1973
|
+
<span aria-live="polite"> Showing <b>{{startResultIndex}} - {{endResultIndex}}</b> </span> of <b>{{totalResults}}</b> results {{#searchTerm}} for "<b>{{searchTerm}}</b>" {{/searchTerm}}
|
|
1971
1974
|
<div class="searchstax-feedback-container-suggested">
|
|
1972
1975
|
{{#autoCorrectedQuery}}
|
|
1973
|
-
Search instead for <a href="#" class="searchstax-feedback-original-query">{{originalQuery}}</a>
|
|
1976
|
+
Search instead for <a href="#" aria-label="Search instead for: {{originalQuery}}" class="searchstax-feedback-original-query">{{originalQuery}}</a>
|
|
1974
1977
|
{{/autoCorrectedQuery}}
|
|
1975
1978
|
</div>
|
|
1976
1979
|
{{/hasResults}}
|
|
@@ -2021,7 +2024,7 @@ const ra = {
|
|
|
2021
2024
|
{{/ribbon}}
|
|
2022
2025
|
|
|
2023
2026
|
{{#thumbnail}}
|
|
2024
|
-
<img src="{{thumbnail}}" class="searchstax-thumbnail">
|
|
2027
|
+
<img src="{{thumbnail}}" alt="" class="searchstax-thumbnail">
|
|
2025
2028
|
{{/thumbnail}}
|
|
2026
2029
|
<div class="searchstax-search-result-title-container">
|
|
2027
2030
|
<h5 class="searchstax-search-result-title">{{title}}</h5>
|
|
@@ -2042,7 +2045,7 @@ const ra = {
|
|
|
2042
2045
|
{{#unmappedFields}}
|
|
2043
2046
|
{{#isImage}}
|
|
2044
2047
|
<div class="searchstax-search-result-image-container">
|
|
2045
|
-
<img src="{{value}}" class="searchstax-result-image">
|
|
2048
|
+
<img src="{{value}}" alt="" class="searchstax-result-image">
|
|
2046
2049
|
</div>
|
|
2047
2050
|
{{/isImage}}
|
|
2048
2051
|
{{^isImage}}
|
|
@@ -2063,7 +2066,7 @@ const ra = {
|
|
|
2063
2066
|
Showing <strong>no results</strong> for <strong>"{{ searchTerm }}"</strong>
|
|
2064
2067
|
<br>
|
|
2065
2068
|
{{#spellingSuggestion}}
|
|
2066
|
-
<span> Did you mean <a href="#" class="searchstax-suggestion-term" onclick="searchCallback('{{ spellingSuggestion }}')">{{ spellingSuggestion }}</a>?</span>
|
|
2069
|
+
<span> Did you mean <a href="#" class="searchstax-suggestion-term" onclick="searchCallback('{{ spellingSuggestion }}')" aria-label="suggested term: {{ spellingSuggestion }}">{{ spellingSuggestion }}</a>?</span>
|
|
2067
2070
|
{{/spellingSuggestion}}
|
|
2068
2071
|
</div>
|
|
2069
2072
|
<ul class="searchstax-no-results-list" aria-live="polite">
|
|
@@ -2148,21 +2151,23 @@ class ga {
|
|
|
2148
2151
|
}
|
|
2149
2152
|
}
|
|
2150
2153
|
}
|
|
2151
|
-
class
|
|
2154
|
+
class te {
|
|
2152
2155
|
static addAccessibilityNotificationContainerToBody() {
|
|
2153
2156
|
if (!document.getElementById("searchAccessibilityContainer")) {
|
|
2154
2157
|
const e = document.createElement("div");
|
|
2155
2158
|
e.setAttribute("aria-live", "polite"), e.setAttribute("id", "searchAccessibilityContainer"), document.body.appendChild(e);
|
|
2156
2159
|
}
|
|
2157
2160
|
}
|
|
2158
|
-
static setAccessibilityText(e) {
|
|
2161
|
+
static setAccessibilityText(e, t) {
|
|
2159
2162
|
this.addAccessibilityNotificationContainerToBody();
|
|
2160
|
-
const
|
|
2161
|
-
|
|
2162
|
-
const
|
|
2163
|
-
|
|
2164
|
-
const
|
|
2165
|
-
|
|
2163
|
+
const s = document.getElementById("searchAccessibility");
|
|
2164
|
+
s && s.remove();
|
|
2165
|
+
const a = document.createElement("span");
|
|
2166
|
+
a.setAttribute("id", "searchAccessibility"), a.innerHTML = e;
|
|
2167
|
+
const r = document.getElementById("searchAccessibilityContainer");
|
|
2168
|
+
r && setTimeout(() => {
|
|
2169
|
+
r.appendChild(a);
|
|
2170
|
+
}, t ?? 100);
|
|
2166
2171
|
}
|
|
2167
2172
|
}
|
|
2168
2173
|
class pa {
|
|
@@ -2341,7 +2346,7 @@ class pa {
|
|
|
2341
2346
|
onShowMoreLessClick(e, t, s) {
|
|
2342
2347
|
e.preventDefault();
|
|
2343
2348
|
const a = s ? this.facetPaginationStepMobile : this.facetPaginationStep, r = s ? this.facetLimits : this.facetLimitsMobile;
|
|
2344
|
-
r[t.name] === void 0 ? r[t.name] = a * 2 : r[t.name] <= t.values.length ? (
|
|
2349
|
+
r[t.name] === void 0 ? r[t.name] = a * 2 : r[t.name] <= t.values.length ? (te.setAccessibilityText(`More Facets shown for ${t.label}`), r[t.name] = r[t.name] + a) : (te.setAccessibilityText(`Less Facets shown for ${t.label}`), r[t.name] = a), this.generateTemplateData(s), this.renderMainTemplate(this.generateTemplateData());
|
|
2345
2350
|
}
|
|
2346
2351
|
renderMainTemplate(e, t) {
|
|
2347
2352
|
var s, a, r, c, l, o, d, f, g, m, S;
|
|
@@ -2778,7 +2783,7 @@ class ya {
|
|
|
2778
2783
|
);
|
|
2779
2784
|
for (let t = 0; t < e.length; t++) {
|
|
2780
2785
|
const s = e[t];
|
|
2781
|
-
t === this.selectedAutosuggestItem ? s.classList.add("active") : s.classList.remove("active");
|
|
2786
|
+
t === this.selectedAutosuggestItem ? (s.classList.add("active"), te.setAccessibilityText(`Selected suggestion: ${s.innerText}`)) : s.classList.remove("active");
|
|
2782
2787
|
}
|
|
2783
2788
|
}
|
|
2784
2789
|
}
|
|
@@ -2841,7 +2846,7 @@ class ya {
|
|
|
2841
2846
|
for (const a in s)
|
|
2842
2847
|
if (Object.prototype.hasOwnProperty.call(s, a)) {
|
|
2843
2848
|
const r = s[a];
|
|
2844
|
-
this.autosuggestResults = r, this.dataLayer.setAutosuggestResults(r), r.numFound > 0 ? r.suggestions.forEach((c) => {
|
|
2849
|
+
r.numFound ? te.setAccessibilityText("Suggestions are available. Use up and down arrows to navigate while focusing input.", 2e3) : te.setAccessibilityText("", 0), this.autosuggestResults = r, this.dataLayer.setAutosuggestResults(r), r.numFound > 0 ? r.suggestions.forEach((c) => {
|
|
2845
2850
|
this.autosuggestContainer && typeof document < "u" && this.autosuggestContainer.appendChild(
|
|
2846
2851
|
this.createAutosuggestItem(c)
|
|
2847
2852
|
);
|
|
@@ -2866,7 +2871,7 @@ class xa {
|
|
|
2866
2871
|
}
|
|
2867
2872
|
initializeSubscriptions() {
|
|
2868
2873
|
this.dataLayer.$searchObject.subscribe(() => {
|
|
2869
|
-
|
|
2874
|
+
te.setAccessibilityText("Searching...");
|
|
2870
2875
|
}), this.dataLayer.$searchResults.subscribe((e) => {
|
|
2871
2876
|
e && this.searchResultsContainer && this.renderResults(e);
|
|
2872
2877
|
});
|
|
@@ -2895,9 +2900,9 @@ class xa {
|
|
|
2895
2900
|
var t, s, a, r, c;
|
|
2896
2901
|
if (this.dataLayer.renderingEngine === W.mustache && this.searchResultsContainer)
|
|
2897
2902
|
if (this.removeLinkClickEvents(), e.length === 0)
|
|
2898
|
-
|
|
2903
|
+
te.setAccessibilityText("Search has no results"), this.renderNoResultsTemplate();
|
|
2899
2904
|
else {
|
|
2900
|
-
|
|
2905
|
+
te.setAccessibilityText(`Showing ${this.dataLayer.parsedData.startResultIndex} through ${this.dataLayer.parsedData.endResultIndex} results from ${this.dataLayer.parsedData.totalResults}. Press tab to navigate through results`);
|
|
2901
2906
|
const l = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.searchResultTemplate) == null ? void 0 : a.template) || ((r = b.searchResults.searchResultTemplate) == null ? void 0 : r.template), o = e.map((d) => P.render(l, d));
|
|
2902
2907
|
((c = this.config) == null ? void 0 : c.renderMethod) === "infiniteScroll" && this.dataLayer.searchObject.page > 1 ? this.searchResultsContainer.innerHTML += o.join("") : this.searchResultsContainer.innerHTML = o.join(""), this.searchResultLinks = Array.from(
|
|
2903
2908
|
this.searchResultsContainer.querySelectorAll(
|
|
@@ -3036,7 +3041,7 @@ class Sa {
|
|
|
3036
3041
|
this.parseAnswerResultsResponse.bind(this)
|
|
3037
3042
|
)));
|
|
3038
3043
|
}), this.dataLayer.$searchResults.subscribe((s) => {
|
|
3039
|
-
s && this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled &&
|
|
3044
|
+
s && this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled && ie.trackSearch({
|
|
3040
3045
|
...this.dataLayer.parsedData.trackingData,
|
|
3041
3046
|
impressions: this.dataLayer.searchResultsMetadata.impressions
|
|
3042
3047
|
});
|
|
@@ -3051,7 +3056,7 @@ class Sa {
|
|
|
3051
3056
|
}
|
|
3052
3057
|
initialize(e) {
|
|
3053
3058
|
var t, s;
|
|
3054
|
-
if (this.dataLayer = new qt("searchstax_session_id", e.sessionId), this.renderEngine && this.dataLayer.setRenderingEngine(this.renderEngine), this.handleHooks(), e.analyticsBaseUrl && typeof window < "u" && (window.analyticsBaseUrl = e.analyticsBaseUrl, window._msq = e._msq || [], this.attachAnalyticsScript(e.analyticsSrc)), e.turnAIAnswerGenerationOn === !0 && (this.dataLayer.turnAIAnswerGenerationOn = !0), e.autoCorrect === !1 && (this.dataLayer.autoCorrect = !1), this.dataLayer.searchstaxConfig || (this.dataLayer.setSearchstaxConfig(e), this.searchHelper = new Ht(
|
|
3059
|
+
if (this.dataLayer = new qt("searchstax_session_id", e.sessionId), this.renderEngine && this.dataLayer.setRenderingEngine(this.renderEngine), this.handleHooks(), e.analyticsBaseUrl && typeof window < "u" && (window.analyticsBaseUrl = e.analyticsBaseUrl, window._msq = e._msq || [], this.attachAnalyticsScript(e.analyticsSrc)), e.turnAIAnswerGenerationOn === !0 && (this.dataLayer.turnAIAnswerGenerationOn = !0), e.autoCorrect === !1 && (this.dataLayer.autoCorrect = !1), e.language && this.dataLayer.setLanguage(e.language), this.dataLayer.searchstaxConfig || (this.dataLayer.setSearchstaxConfig(e), this.searchHelper = new Ht(
|
|
3055
3060
|
{ ...e, sessionId: this.dataLayer.sessionId },
|
|
3056
3061
|
this.dataLayer
|
|
3057
3062
|
)), ((t = e.router) == null ? void 0 : t.enabled) === void 0 || ((s = e.router) == null ? void 0 : s.enabled) === !0) {
|
|
@@ -3099,7 +3104,7 @@ class Sa {
|
|
|
3099
3104
|
relatedSearch: r.related_search,
|
|
3100
3105
|
position: r.position
|
|
3101
3106
|
});
|
|
3102
|
-
this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled &&
|
|
3107
|
+
this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled && ie.trackRelatedSearches({
|
|
3103
3108
|
...this.dataLayer.parsedData.trackingData,
|
|
3104
3109
|
impressions: a
|
|
3105
3110
|
}), this.dataLayer.setSearchRelatedSearches(s);
|
|
@@ -3113,13 +3118,13 @@ class Sa {
|
|
|
3113
3118
|
parseSearchResultsResponse(e) {
|
|
3114
3119
|
var t, s;
|
|
3115
3120
|
this.handleRouter();
|
|
3116
|
-
let a =
|
|
3121
|
+
let a = de.combineResultsWithMetadata(e), r = de.extractFacets(e);
|
|
3117
3122
|
this.dataLayer.setSearchFacets(r), (s = (t = this.dataLayer.searchstaxConfig) == null ? void 0 : t.hooks) != null && s.afterSearch && (a = this.dataLayer.searchstaxConfig.hooks.afterSearch(a)), this.dataLayer.setSearchExternalPromotions(e.externalLinks ?? []);
|
|
3118
|
-
const c =
|
|
3123
|
+
const c = de.extractSearchResultsMetadata(e);
|
|
3119
3124
|
this.dataLayer.setSearchResultsMetadata(c), this.dataLayer.setSearchResults(a);
|
|
3120
3125
|
}
|
|
3121
3126
|
parseAnswerResultsResponse(e) {
|
|
3122
|
-
this.handleRouter(), e !==
|
|
3127
|
+
this.handleRouter(), e !== re.question && e !== re.notQuestion && this.dataLayer.setAnswerData(this.dataLayer.getAnswerData + e);
|
|
3123
3128
|
}
|
|
3124
3129
|
cacheFacets() {
|
|
3125
3130
|
var e;
|
|
@@ -3229,23 +3234,24 @@ class Sa {
|
|
|
3229
3234
|
(s = (t = this.dataLayer.searchInputConfig) == null ? void 0 : t.hooks) != null && s.beforeAutosuggest && (a = this.dataLayer.searchInputConfig.hooks.beforeAutosuggest(a)), a && a.term !== void 0 && a.queryParams !== void 0 && this.suggest(a.term, a.queryParams);
|
|
3230
3235
|
}
|
|
3231
3236
|
trackRelatedSearchClick(e) {
|
|
3232
|
-
this.dataLayer.searchResultsMetadata && this.dataLayer.searchRelatedSearches && !this.dataLayer.cookiesDisabled &&
|
|
3237
|
+
this.dataLayer.searchResultsMetadata && this.dataLayer.searchRelatedSearches && !this.dataLayer.cookiesDisabled && ie.trackRelatedSearchClick({
|
|
3233
3238
|
...this.dataLayer.parsedData.trackingData,
|
|
3234
3239
|
relatedSearch: e
|
|
3235
3240
|
});
|
|
3236
3241
|
}
|
|
3237
3242
|
executeLinkClick(e) {
|
|
3238
3243
|
var t, s;
|
|
3239
|
-
let a =
|
|
3244
|
+
let a = de.findResultByUniqueId(
|
|
3240
3245
|
e,
|
|
3241
3246
|
this.dataLayer.searchResults ?? []
|
|
3242
3247
|
);
|
|
3243
|
-
a && ((s = (t = this.searchResultsConfig) == null ? void 0 : t.hooks) != null && s.afterLinkClick && (a = this.searchResultsConfig.hooks.afterLinkClick(a)), a && this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled &&
|
|
3248
|
+
a && ((s = (t = this.searchResultsConfig) == null ? void 0 : t.hooks) != null && s.afterLinkClick && (a = this.searchResultsConfig.hooks.afterLinkClick(a)), a && this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled && ie.trackClick({
|
|
3244
3249
|
result: a,
|
|
3245
3250
|
...this.dataLayer.parsedData.trackingData
|
|
3246
|
-
})
|
|
3251
|
+
}).then(() => {
|
|
3247
3252
|
typeof window < "u" && (window.location.href = (a == null ? void 0 : a.url) ?? "");
|
|
3248
|
-
}
|
|
3253
|
+
}).catch(() => {
|
|
3254
|
+
}));
|
|
3249
3255
|
}
|
|
3250
3256
|
setPage(e) {
|
|
3251
3257
|
var t;
|
|
@@ -3544,7 +3550,7 @@ function wa(i) {
|
|
|
3544
3550
|
/* @__PURE__ */ u.jsxs(
|
|
3545
3551
|
"a",
|
|
3546
3552
|
{
|
|
3547
|
-
className:
|
|
3553
|
+
className: `searchstax-pagination-previous ${a.isFirstPage ? "disabled" : ""}`,
|
|
3548
3554
|
style: a != null && a.isFirstPage ? { pointerEvents: "none" } : {},
|
|
3549
3555
|
onClick: (g) => {
|
|
3550
3556
|
f(g);
|
|
@@ -3574,7 +3580,7 @@ function wa(i) {
|
|
|
3574
3580
|
/* @__PURE__ */ u.jsx(
|
|
3575
3581
|
"a",
|
|
3576
3582
|
{
|
|
3577
|
-
className:
|
|
3583
|
+
className: `searchstax-pagination-next ${a.isLastPage ? "disabled" : ""}`,
|
|
3578
3584
|
tabIndex: 0,
|
|
3579
3585
|
style: a != null && a.isLastPage ? { pointerEvents: "none" } : {},
|
|
3580
3586
|
onClick: (g) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searchstax-inc/searchstudio-ux-react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.18",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/@searchstax-inc/searchstudio-ux-react.cjs",
|
|
7
7
|
"module": "./dist/@searchstax-inc/searchstudio-ux-react.mjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"preview": "vite preview"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@searchstax-inc/searchstudio-ux-js": "npm:@searchstax-inc/searchstudio-ux-js@^0.6.
|
|
25
|
+
"@searchstax-inc/searchstudio-ux-js": "npm:@searchstax-inc/searchstudio-ux-js@^0.6.59",
|
|
26
26
|
"react": "^18.2.0",
|
|
27
27
|
"react-dom": "^18.2.0"
|
|
28
28
|
},
|