@searchstax-inc/searchstudio-ux-react 0.3.17 → 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: {} }, oe = {};
|
|
|
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,
|
|
@@ -1464,19 +1464,19 @@ class re {
|
|
|
1464
1464
|
}, 0);
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
|
-
h(
|
|
1467
|
+
h(ie, "subscribedToClickEvent", !1), h(ie, "msq", () => typeof window < "u" && window != null && window._msq ? window == null ? void 0 : window._msq : []);
|
|
1468
1468
|
/*!
|
|
1469
1469
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
1470
1470
|
* http://github.com/janl/mustache.js
|
|
1471
1471
|
*/
|
|
1472
|
-
var Bt = Object.prototype.toString,
|
|
1472
|
+
var Bt = Object.prototype.toString, ce = Array.isArray || function(i) {
|
|
1473
1473
|
return Bt.call(i) === "[object Array]";
|
|
1474
1474
|
};
|
|
1475
1475
|
function Fe(i) {
|
|
1476
1476
|
return typeof i == "function";
|
|
1477
1477
|
}
|
|
1478
1478
|
function Wt(i) {
|
|
1479
|
-
return
|
|
1479
|
+
return ce(i) ? "array" : typeof i;
|
|
1480
1480
|
}
|
|
1481
1481
|
function Pe(i) {
|
|
1482
1482
|
return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
@@ -1525,7 +1525,7 @@ function ta(i, e) {
|
|
|
1525
1525
|
}
|
|
1526
1526
|
var g, m, S;
|
|
1527
1527
|
function O(x) {
|
|
1528
|
-
if (typeof x == "string" && (x = x.split(Xt, 2)), !
|
|
1528
|
+
if (typeof x == "string" && (x = x.split(Xt, 2)), !ce(x) || x.length !== 2)
|
|
1529
1529
|
throw new Error("Invalid tags: " + x);
|
|
1530
1530
|
g = new RegExp(Pe(x[0]) + "\\s*"), m = new RegExp("\\s*" + Pe(x[1])), S = new RegExp("\\s*" + Pe("}" + x[1]));
|
|
1531
1531
|
}
|
|
@@ -1600,13 +1600,13 @@ pe.prototype.scanUntil = function(i) {
|
|
|
1600
1600
|
}
|
|
1601
1601
|
return this.pos += t.length, t;
|
|
1602
1602
|
};
|
|
1603
|
-
function
|
|
1603
|
+
function ne(i, e) {
|
|
1604
1604
|
this.view = i, this.cache = { ".": this.view }, this.parent = e;
|
|
1605
1605
|
}
|
|
1606
|
-
|
|
1607
|
-
return new
|
|
1606
|
+
ne.prototype.push = function(i) {
|
|
1607
|
+
return new ne(i, this);
|
|
1608
1608
|
};
|
|
1609
|
-
|
|
1609
|
+
ne.prototype.lookup = function(i) {
|
|
1610
1610
|
var e = this.cache, t;
|
|
1611
1611
|
if (e.hasOwnProperty(i))
|
|
1612
1612
|
t = e[i];
|
|
@@ -1649,7 +1649,7 @@ U.prototype.parse = function(i, e) {
|
|
|
1649
1649
|
return r == null && (r = ta(i, e), a && t.set(s, r)), r;
|
|
1650
1650
|
};
|
|
1651
1651
|
U.prototype.render = function(i, e, t, s) {
|
|
1652
|
-
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);
|
|
1653
1653
|
return this.renderTokens(r, c, t, i, s);
|
|
1654
1654
|
};
|
|
1655
1655
|
U.prototype.renderTokens = function(i, e, t, s, a) {
|
|
@@ -1663,7 +1663,7 @@ U.prototype.renderSection = function(i, e, t, s, a) {
|
|
|
1663
1663
|
return r.render(g, e, t, a);
|
|
1664
1664
|
}
|
|
1665
1665
|
if (l) {
|
|
1666
|
-
if (
|
|
1666
|
+
if (ce(l))
|
|
1667
1667
|
for (var d = 0, f = l.length; d < f; ++d)
|
|
1668
1668
|
c += this.renderTokens(i[4], e.push(l[d]), t, s, a);
|
|
1669
1669
|
else if (typeof l == "object" || typeof l == "string" || typeof l == "number")
|
|
@@ -1679,7 +1679,7 @@ U.prototype.renderSection = function(i, e, t, s, a) {
|
|
|
1679
1679
|
};
|
|
1680
1680
|
U.prototype.renderInverted = function(i, e, t, s, a) {
|
|
1681
1681
|
var r = e.lookup(i[1]);
|
|
1682
|
-
if (!r ||
|
|
1682
|
+
if (!r || ce(r) && r.length === 0)
|
|
1683
1683
|
return this.renderTokens(i[4], e, t, s, a);
|
|
1684
1684
|
};
|
|
1685
1685
|
U.prototype.indentPartial = function(i, e, t) {
|
|
@@ -1714,10 +1714,10 @@ U.prototype.rawValue = function(i) {
|
|
|
1714
1714
|
return i[1];
|
|
1715
1715
|
};
|
|
1716
1716
|
U.prototype.getConfigTags = function(i) {
|
|
1717
|
-
return
|
|
1717
|
+
return ce(i) ? i : i && typeof i == "object" ? i.tags : void 0;
|
|
1718
1718
|
};
|
|
1719
1719
|
U.prototype.getConfigEscape = function(i) {
|
|
1720
|
-
if (i && typeof i == "object" && !
|
|
1720
|
+
if (i && typeof i == "object" && !ce(i))
|
|
1721
1721
|
return i.escape;
|
|
1722
1722
|
};
|
|
1723
1723
|
var P = {
|
|
@@ -1759,7 +1759,7 @@ P.render = function(i, e, t, s) {
|
|
|
1759
1759
|
};
|
|
1760
1760
|
P.escape = Yt;
|
|
1761
1761
|
P.Scanner = pe;
|
|
1762
|
-
P.Context =
|
|
1762
|
+
P.Context = ne;
|
|
1763
1763
|
P.Writer = U;
|
|
1764
1764
|
const ra = {
|
|
1765
1765
|
main: {
|
|
@@ -1957,7 +1957,7 @@ const ra = {
|
|
|
1957
1957
|
},
|
|
1958
1958
|
relatedSearch: {
|
|
1959
1959
|
template: `
|
|
1960
|
-
<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">
|
|
1961
1961
|
{{ related_search }}{{^last}}<span>,</span>{{/last}}
|
|
1962
1962
|
</span>
|
|
1963
1963
|
`,
|
|
@@ -1970,10 +1970,10 @@ const ra = {
|
|
|
1970
1970
|
<a href="#searchstax-search-results" class="searchstax-skip">Skip to results section</a>
|
|
1971
1971
|
<h4 class="searchstax-feedback-container">
|
|
1972
1972
|
{{#hasResults}}
|
|
1973
|
-
|
|
1973
|
+
<span aria-live="polite"> Showing <b>{{startResultIndex}} - {{endResultIndex}}</b> </span> of <b>{{totalResults}}</b> results {{#searchTerm}} for "<b>{{searchTerm}}</b>" {{/searchTerm}}
|
|
1974
1974
|
<div class="searchstax-feedback-container-suggested">
|
|
1975
1975
|
{{#autoCorrectedQuery}}
|
|
1976
|
-
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>
|
|
1977
1977
|
{{/autoCorrectedQuery}}
|
|
1978
1978
|
</div>
|
|
1979
1979
|
{{/hasResults}}
|
|
@@ -2024,7 +2024,7 @@ const ra = {
|
|
|
2024
2024
|
{{/ribbon}}
|
|
2025
2025
|
|
|
2026
2026
|
{{#thumbnail}}
|
|
2027
|
-
<img src="{{thumbnail}}" class="searchstax-thumbnail">
|
|
2027
|
+
<img src="{{thumbnail}}" alt="" class="searchstax-thumbnail">
|
|
2028
2028
|
{{/thumbnail}}
|
|
2029
2029
|
<div class="searchstax-search-result-title-container">
|
|
2030
2030
|
<h5 class="searchstax-search-result-title">{{title}}</h5>
|
|
@@ -2045,7 +2045,7 @@ const ra = {
|
|
|
2045
2045
|
{{#unmappedFields}}
|
|
2046
2046
|
{{#isImage}}
|
|
2047
2047
|
<div class="searchstax-search-result-image-container">
|
|
2048
|
-
<img src="{{value}}" class="searchstax-result-image">
|
|
2048
|
+
<img src="{{value}}" alt="" class="searchstax-result-image">
|
|
2049
2049
|
</div>
|
|
2050
2050
|
{{/isImage}}
|
|
2051
2051
|
{{^isImage}}
|
|
@@ -2066,7 +2066,7 @@ const ra = {
|
|
|
2066
2066
|
Showing <strong>no results</strong> for <strong>"{{ searchTerm }}"</strong>
|
|
2067
2067
|
<br>
|
|
2068
2068
|
{{#spellingSuggestion}}
|
|
2069
|
-
<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>
|
|
2070
2070
|
{{/spellingSuggestion}}
|
|
2071
2071
|
</div>
|
|
2072
2072
|
<ul class="searchstax-no-results-list" aria-live="polite">
|
|
@@ -2151,21 +2151,23 @@ class ga {
|
|
|
2151
2151
|
}
|
|
2152
2152
|
}
|
|
2153
2153
|
}
|
|
2154
|
-
class
|
|
2154
|
+
class te {
|
|
2155
2155
|
static addAccessibilityNotificationContainerToBody() {
|
|
2156
2156
|
if (!document.getElementById("searchAccessibilityContainer")) {
|
|
2157
2157
|
const e = document.createElement("div");
|
|
2158
2158
|
e.setAttribute("aria-live", "polite"), e.setAttribute("id", "searchAccessibilityContainer"), document.body.appendChild(e);
|
|
2159
2159
|
}
|
|
2160
2160
|
}
|
|
2161
|
-
static setAccessibilityText(e) {
|
|
2161
|
+
static setAccessibilityText(e, t) {
|
|
2162
2162
|
this.addAccessibilityNotificationContainerToBody();
|
|
2163
|
-
const
|
|
2164
|
-
|
|
2165
|
-
const
|
|
2166
|
-
|
|
2167
|
-
const
|
|
2168
|
-
|
|
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);
|
|
2169
2171
|
}
|
|
2170
2172
|
}
|
|
2171
2173
|
class pa {
|
|
@@ -2344,7 +2346,7 @@ class pa {
|
|
|
2344
2346
|
onShowMoreLessClick(e, t, s) {
|
|
2345
2347
|
e.preventDefault();
|
|
2346
2348
|
const a = s ? this.facetPaginationStepMobile : this.facetPaginationStep, r = s ? this.facetLimits : this.facetLimitsMobile;
|
|
2347
|
-
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());
|
|
2348
2350
|
}
|
|
2349
2351
|
renderMainTemplate(e, t) {
|
|
2350
2352
|
var s, a, r, c, l, o, d, f, g, m, S;
|
|
@@ -2781,7 +2783,7 @@ class ya {
|
|
|
2781
2783
|
);
|
|
2782
2784
|
for (let t = 0; t < e.length; t++) {
|
|
2783
2785
|
const s = e[t];
|
|
2784
|
-
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");
|
|
2785
2787
|
}
|
|
2786
2788
|
}
|
|
2787
2789
|
}
|
|
@@ -2844,7 +2846,7 @@ class ya {
|
|
|
2844
2846
|
for (const a in s)
|
|
2845
2847
|
if (Object.prototype.hasOwnProperty.call(s, a)) {
|
|
2846
2848
|
const r = s[a];
|
|
2847
|
-
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) => {
|
|
2848
2850
|
this.autosuggestContainer && typeof document < "u" && this.autosuggestContainer.appendChild(
|
|
2849
2851
|
this.createAutosuggestItem(c)
|
|
2850
2852
|
);
|
|
@@ -2869,7 +2871,7 @@ class xa {
|
|
|
2869
2871
|
}
|
|
2870
2872
|
initializeSubscriptions() {
|
|
2871
2873
|
this.dataLayer.$searchObject.subscribe(() => {
|
|
2872
|
-
|
|
2874
|
+
te.setAccessibilityText("Searching...");
|
|
2873
2875
|
}), this.dataLayer.$searchResults.subscribe((e) => {
|
|
2874
2876
|
e && this.searchResultsContainer && this.renderResults(e);
|
|
2875
2877
|
});
|
|
@@ -2898,9 +2900,9 @@ class xa {
|
|
|
2898
2900
|
var t, s, a, r, c;
|
|
2899
2901
|
if (this.dataLayer.renderingEngine === W.mustache && this.searchResultsContainer)
|
|
2900
2902
|
if (this.removeLinkClickEvents(), e.length === 0)
|
|
2901
|
-
|
|
2903
|
+
te.setAccessibilityText("Search has no results"), this.renderNoResultsTemplate();
|
|
2902
2904
|
else {
|
|
2903
|
-
|
|
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`);
|
|
2904
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));
|
|
2905
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(
|
|
2906
2908
|
this.searchResultsContainer.querySelectorAll(
|
|
@@ -3039,7 +3041,7 @@ class Sa {
|
|
|
3039
3041
|
this.parseAnswerResultsResponse.bind(this)
|
|
3040
3042
|
)));
|
|
3041
3043
|
}), this.dataLayer.$searchResults.subscribe((s) => {
|
|
3042
|
-
s && this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled &&
|
|
3044
|
+
s && this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled && ie.trackSearch({
|
|
3043
3045
|
...this.dataLayer.parsedData.trackingData,
|
|
3044
3046
|
impressions: this.dataLayer.searchResultsMetadata.impressions
|
|
3045
3047
|
});
|
|
@@ -3054,7 +3056,7 @@ class Sa {
|
|
|
3054
3056
|
}
|
|
3055
3057
|
initialize(e) {
|
|
3056
3058
|
var t, s;
|
|
3057
|
-
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(
|
|
3058
3060
|
{ ...e, sessionId: this.dataLayer.sessionId },
|
|
3059
3061
|
this.dataLayer
|
|
3060
3062
|
)), ((t = e.router) == null ? void 0 : t.enabled) === void 0 || ((s = e.router) == null ? void 0 : s.enabled) === !0) {
|
|
@@ -3102,7 +3104,7 @@ class Sa {
|
|
|
3102
3104
|
relatedSearch: r.related_search,
|
|
3103
3105
|
position: r.position
|
|
3104
3106
|
});
|
|
3105
|
-
this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled &&
|
|
3107
|
+
this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled && ie.trackRelatedSearches({
|
|
3106
3108
|
...this.dataLayer.parsedData.trackingData,
|
|
3107
3109
|
impressions: a
|
|
3108
3110
|
}), this.dataLayer.setSearchRelatedSearches(s);
|
|
@@ -3116,13 +3118,13 @@ class Sa {
|
|
|
3116
3118
|
parseSearchResultsResponse(e) {
|
|
3117
3119
|
var t, s;
|
|
3118
3120
|
this.handleRouter();
|
|
3119
|
-
let a =
|
|
3121
|
+
let a = de.combineResultsWithMetadata(e), r = de.extractFacets(e);
|
|
3120
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 ?? []);
|
|
3121
|
-
const c =
|
|
3123
|
+
const c = de.extractSearchResultsMetadata(e);
|
|
3122
3124
|
this.dataLayer.setSearchResultsMetadata(c), this.dataLayer.setSearchResults(a);
|
|
3123
3125
|
}
|
|
3124
3126
|
parseAnswerResultsResponse(e) {
|
|
3125
|
-
this.handleRouter(), e !==
|
|
3127
|
+
this.handleRouter(), e !== re.question && e !== re.notQuestion && this.dataLayer.setAnswerData(this.dataLayer.getAnswerData + e);
|
|
3126
3128
|
}
|
|
3127
3129
|
cacheFacets() {
|
|
3128
3130
|
var e;
|
|
@@ -3232,18 +3234,18 @@ class Sa {
|
|
|
3232
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);
|
|
3233
3235
|
}
|
|
3234
3236
|
trackRelatedSearchClick(e) {
|
|
3235
|
-
this.dataLayer.searchResultsMetadata && this.dataLayer.searchRelatedSearches && !this.dataLayer.cookiesDisabled &&
|
|
3237
|
+
this.dataLayer.searchResultsMetadata && this.dataLayer.searchRelatedSearches && !this.dataLayer.cookiesDisabled && ie.trackRelatedSearchClick({
|
|
3236
3238
|
...this.dataLayer.parsedData.trackingData,
|
|
3237
3239
|
relatedSearch: e
|
|
3238
3240
|
});
|
|
3239
3241
|
}
|
|
3240
3242
|
executeLinkClick(e) {
|
|
3241
3243
|
var t, s;
|
|
3242
|
-
let a =
|
|
3244
|
+
let a = de.findResultByUniqueId(
|
|
3243
3245
|
e,
|
|
3244
3246
|
this.dataLayer.searchResults ?? []
|
|
3245
3247
|
);
|
|
3246
|
-
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({
|
|
3247
3249
|
result: a,
|
|
3248
3250
|
...this.dataLayer.parsedData.trackingData
|
|
3249
3251
|
}).then(() => {
|
|
@@ -3548,7 +3550,7 @@ function wa(i) {
|
|
|
3548
3550
|
/* @__PURE__ */ u.jsxs(
|
|
3549
3551
|
"a",
|
|
3550
3552
|
{
|
|
3551
|
-
className:
|
|
3553
|
+
className: `searchstax-pagination-previous ${a.isFirstPage ? "disabled" : ""}`,
|
|
3552
3554
|
style: a != null && a.isFirstPage ? { pointerEvents: "none" } : {},
|
|
3553
3555
|
onClick: (g) => {
|
|
3554
3556
|
f(g);
|
|
@@ -3578,7 +3580,7 @@ function wa(i) {
|
|
|
3578
3580
|
/* @__PURE__ */ u.jsx(
|
|
3579
3581
|
"a",
|
|
3580
3582
|
{
|
|
3581
|
-
className:
|
|
3583
|
+
className: `searchstax-pagination-next ${a.isLastPage ? "disabled" : ""}`,
|
|
3582
3584
|
tabIndex: 0,
|
|
3583
3585
|
style: a != null && a.isLastPage ? { pointerEvents: "none" } : {},
|
|
3584
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
|
},
|