@nosto/search-js 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{InfiniteScrollWithObserver-CQV1s264.js → InfiniteScrollWithObserver-BsydJKFj.js} +25 -25
- package/dist/InfiniteScrollWithObserver-wzwXCrZ7.cjs +1 -0
- package/dist/baseConfig-CTN0CcW-.js +48 -0
- package/dist/baseConfig-KREDcxnC.cjs +1 -0
- package/dist/eventBusSubscribe-B75y7otR.cjs +1 -0
- package/dist/eventBusSubscribe-Cxw0xUAm.js +25 -0
- package/dist/{unique-DnsrXjFL.js → isBot-C58Y7eiv.js} +12 -34
- package/dist/{unique-C8Ij1UVz.cjs → isBot-CheH1DcZ.cjs} +1 -1
- package/dist/preact/autocomplete/autocomplete.cjs.js +1 -0
- package/dist/preact/autocomplete/autocomplete.d.ts +5 -0
- package/dist/preact/autocomplete/autocomplete.es.js +49 -0
- package/dist/preact/{src/config/pages/autocomplete/config.d.ts → autocomplete/src/AutocompleteConfig.d.ts} +5 -5
- package/dist/preact/{src/config/pages/autocomplete/provider.d.ts → autocomplete/src/AutocompletePageProvider.d.ts} +2 -2
- package/dist/preact/{src → autocomplete/src}/components/AutocompleteElement.d.ts +2 -2
- package/dist/preact/category/category.cjs.js +1 -0
- package/dist/preact/category/category.d.ts +3 -0
- package/dist/preact/category/category.es.js +25 -0
- package/dist/preact/{src/config/pages/category/config.d.ts → category/src/CategoryConfig.d.ts} +5 -5
- package/dist/preact/{src/config/pages/category/provider.d.ts → category/src/CategoryPageProvider.d.ts} +2 -2
- package/dist/preact/common/common.cjs.js +1 -0
- package/dist/preact/{common.d.ts → common/common.d.ts} +3 -3
- package/dist/preact/{common.es.js → common/common.es.js} +6 -6
- package/dist/preact/{src → common/src}/actions/newSearch.d.ts +2 -2
- package/dist/preact/{src → common/src}/actions/replaceFilter.d.ts +1 -1
- package/dist/preact/{src → common/src}/actions/toggleProductFilter.d.ts +1 -1
- package/dist/preact/{src → common/src}/actions/updateSearch.d.ts +2 -2
- package/dist/preact/{src/search/defaults.d.ts → common/src/actions/withDefaultQuery.d.ts} +2 -4
- package/dist/preact/{src/config/base → common/src/config}/baseConfig.d.ts +1 -2
- package/dist/preact/common/src/config/config.d.ts +4 -0
- package/dist/preact/common/src/config/configContext.d.ts +6 -0
- package/dist/preact/common/src/store/components/StoreActionsListener.d.ts +1 -0
- package/dist/preact/{src/api → common/src}/types.d.ts +6 -0
- package/dist/preact/events/events.cjs.js +1 -0
- package/dist/preact/events/events.d.ts +3 -0
- package/dist/preact/events/events.es.js +23 -0
- package/dist/preact/events/src/eventBusDispatch.d.ts +10 -0
- package/dist/preact/events/src/eventBusSubscribe.d.ts +8 -0
- package/dist/preact/events/src/types.d.ts +26 -0
- package/dist/preact/hooks/hooks.cjs.js +1 -0
- package/dist/preact/hooks/hooks.d.ts +18 -0
- package/dist/preact/{hooks.es.js → hooks/hooks.es.js} +96 -95
- package/dist/preact/{src/hooks → hooks/src}/useNostoAppState.d.ts +1 -1
- package/dist/preact/legacy/legacy.cjs.js +1 -0
- package/dist/preact/legacy/legacy.d.ts +6 -0
- package/dist/preact/legacy/legacy.es.js +10 -0
- package/dist/preact/serp/serp.cjs.js +1 -0
- package/dist/preact/serp/serp.d.ts +4 -0
- package/dist/preact/serp/serp.es.js +39 -0
- package/dist/preact/{src/config/pages/serp/config.d.ts → serp/src/SerpConfig.d.ts} +5 -5
- package/dist/preact/{src/config/pages/serp/provider.d.ts → serp/src/SerpPageProvider.d.ts} +2 -2
- package/dist/preact/{src → serp/src}/components/SerpElement.d.ts +2 -2
- package/dist/unique-3gEanSFU.cjs +1 -0
- package/dist/unique-DxrT0M20.js +39 -0
- package/dist/useActions-B-wWOcHo.cjs +1 -0
- package/dist/useActions-BIIcXXS6.js +229 -0
- package/dist/useLoadMore-BWgWw24W.cjs +1 -0
- package/dist/useLoadMore-Dw7GDu8a.js +31 -0
- package/dist/utils/utils.cjs.js +1 -1
- package/dist/utils/utils.es.js +6 -6
- package/package.json +39 -33
- package/dist/InfiniteScrollWithObserver-DwzgJMlG.cjs +0 -1
- package/dist/baseConfig-BFFqFSg5.cjs +0 -1
- package/dist/baseConfig-Bafl02NY.js +0 -21
- package/dist/configContext-BR7w4VlU.cjs +0 -1
- package/dist/configContext-GuZOIX3o.js +0 -63
- package/dist/deepMerge-CZwCJzEe.js +0 -17
- package/dist/deepMerge-lDscDfII.cjs +0 -1
- package/dist/preact/autocomplete.cjs.js +0 -1
- package/dist/preact/autocomplete.d.ts +0 -5
- package/dist/preact/autocomplete.es.js +0 -46
- package/dist/preact/category.cjs.js +0 -1
- package/dist/preact/category.d.ts +0 -3
- package/dist/preact/category.es.js +0 -22
- package/dist/preact/common.cjs.js +0 -1
- package/dist/preact/hooks.cjs.js +0 -1
- package/dist/preact/hooks.d.ts +0 -18
- package/dist/preact/legacy.cjs.js +0 -1
- package/dist/preact/legacy.d.ts +0 -6
- package/dist/preact/legacy.es.js +0 -9
- package/dist/preact/preact.d.ts +0 -30
- package/dist/preact/serp.cjs.js +0 -1
- package/dist/preact/serp.d.ts +0 -4
- package/dist/preact/serp.es.js +0 -36
- package/dist/preact/src/actions/types.d.ts +0 -6
- package/dist/preact/src/config/config.d.ts +0 -4
- package/dist/preact/src/config/configContext.d.ts +0 -6
- package/dist/useLoadMore-Cflxq0FH.cjs +0 -1
- package/dist/useLoadMore-D9uu2DBj.js +0 -198
- /package/dist/preact/{src → autocomplete/src}/components/SearchInput.d.ts +0 -0
- /package/dist/preact/{src/components → autocomplete/src}/types.d.ts +0 -0
- /package/dist/preact/{src → common/src}/components/BaseElement.d.ts +0 -0
- /package/dist/preact/{src → common/src}/components/InfiniteScroll/InfiniteScroll.d.ts +0 -0
- /package/dist/preact/{src → common/src}/components/InfiniteScroll/InfiniteScrollWithLink.d.ts +0 -0
- /package/dist/preact/{src → common/src}/components/InfiniteScroll/InfiniteScrollWithObserver.d.ts +0 -0
- /package/dist/preact/{src → common/src}/components/InfiniteScroll/LoadMoreLink.d.ts +0 -0
- /package/dist/preact/{src → common/src}/components/InfiniteScroll/utils.d.ts +0 -0
- /package/dist/preact/{src → common/src/store}/store.d.ts +0 -0
- /package/dist/preact/{src → common/src/store}/storeContext.d.ts +0 -0
- /package/dist/preact/{src → common/src/store}/storeExtensions.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/types.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useActions.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useCheckClientScript.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useDecoratedSearchResults.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useFacet.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useFacets.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useLoadMore/getNextPageQuery.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useLoadMore/useLoadMore.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/usePagination.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/usePersonalization.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useProductFilters/useProductFilters.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useProductFilters/useProductFiltersUtils.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useRange.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useRangeSelector.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useResponse.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useSelectedFiltersCount.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useSizeOptions.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useSort/useSort.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useSort/utils.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useSpeechToText.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useSwatches/aggregateSwatches.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useSwatches/applySelectionStates.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useSwatches/sortOptions.d.ts +0 -0
- /package/dist/preact/{src/hooks → hooks/src}/useSwatches/useSwatches.d.ts +0 -0
package/dist/{InfiniteScrollWithObserver-CQV1s264.js → InfiniteScrollWithObserver-BsydJKFj.js}
RENAMED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { u as y } from "./jsxRuntime.module-Bzuv3cXw.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as x, u as U } from "./useLoadMore-Dw7GDu8a.js";
|
|
3
3
|
import { i as I } from "./logger-DVwg4Wor.js";
|
|
4
4
|
import { p as A } from "./pick-DReBictn.js";
|
|
5
5
|
import { Component as c, options as l, createElement as v, Fragment as d, toChildArray as h } from "preact";
|
|
6
6
|
import { useRef as M, useEffect as W } from "preact/hooks";
|
|
7
7
|
function V(e, r) {
|
|
8
|
+
const t = r.products?.total ?? 0, o = e.products?.from ?? 0, n = e.products?.size ?? 0;
|
|
9
|
+
return t > 0 && t > o + n;
|
|
10
|
+
}
|
|
11
|
+
function ne() {
|
|
12
|
+
return !!(window.IntersectionObserver && window.IntersectionObserverEntry && "intersectionRatio" in window.IntersectionObserverEntry.prototype);
|
|
13
|
+
}
|
|
14
|
+
function H(e, r) {
|
|
8
15
|
for (var t in r) e[t] = r[t];
|
|
9
16
|
return e;
|
|
10
17
|
}
|
|
@@ -16,7 +23,7 @@ function m(e, r) {
|
|
|
16
23
|
function b(e, r) {
|
|
17
24
|
this.props = e, this.context = r;
|
|
18
25
|
}
|
|
19
|
-
function
|
|
26
|
+
function j(e, r) {
|
|
20
27
|
function t(n) {
|
|
21
28
|
var i = this.props.ref, u = i == n.ref;
|
|
22
29
|
return !u && i && (i.call ? i(null) : i.current = null), r ? !r(this.props, n) || !u : m(this.props, n);
|
|
@@ -33,18 +40,18 @@ var g = l.__b;
|
|
|
33
40
|
l.__b = function(e) {
|
|
34
41
|
e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), g && g(e);
|
|
35
42
|
};
|
|
36
|
-
var
|
|
43
|
+
var z = l.__e;
|
|
37
44
|
l.__e = function(e, r, t, o) {
|
|
38
45
|
if (e.then) {
|
|
39
46
|
for (var n, i = r; i = i.__; ) if ((n = i.__c) && n.__c) return r.__e == null && (r.__e = t.__e, r.__k = t.__k), n.__c(e, r);
|
|
40
47
|
}
|
|
41
|
-
|
|
48
|
+
z(e, r, t, o);
|
|
42
49
|
};
|
|
43
50
|
var k = l.unmount;
|
|
44
51
|
function S(e, r, t) {
|
|
45
52
|
return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(o) {
|
|
46
53
|
typeof o.__c == "function" && o.__c();
|
|
47
|
-
}), e.__c.__H = null), (e =
|
|
54
|
+
}), e.__c.__H = null), (e = H({}, e)).__c != null && (e.__c.__P === t && (e.__c.__P = r), e.__c = null), e.__k = e.__k && e.__k.map(function(o) {
|
|
48
55
|
return S(o, r, t);
|
|
49
56
|
})), e;
|
|
50
57
|
}
|
|
@@ -124,7 +131,7 @@ var O = function(e, r, t) {
|
|
|
124
131
|
O(e, t, r);
|
|
125
132
|
});
|
|
126
133
|
};
|
|
127
|
-
var
|
|
134
|
+
var B = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, L = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, q = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, D = /[A-Z0-9]/g, F = typeof document < "u", T = function(e) {
|
|
128
135
|
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
|
|
129
136
|
};
|
|
130
137
|
c.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
|
|
@@ -135,18 +142,18 @@ c.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveP
|
|
|
135
142
|
} });
|
|
136
143
|
});
|
|
137
144
|
var w = l.event;
|
|
138
|
-
function T() {
|
|
139
|
-
}
|
|
140
145
|
function $() {
|
|
141
|
-
return this.cancelBubble;
|
|
142
146
|
}
|
|
143
147
|
function Z() {
|
|
148
|
+
return this.cancelBubble;
|
|
149
|
+
}
|
|
150
|
+
function G() {
|
|
144
151
|
return this.defaultPrevented;
|
|
145
152
|
}
|
|
146
153
|
l.event = function(e) {
|
|
147
|
-
return w && (e = w(e)), e.persist =
|
|
154
|
+
return w && (e = w(e)), e.persist = $, e.isPropagationStopped = Z, e.isDefaultPrevented = G, e.nativeEvent = e;
|
|
148
155
|
};
|
|
149
|
-
var
|
|
156
|
+
var J = { enumerable: !1, configurable: !0, get: function() {
|
|
150
157
|
return this.class;
|
|
151
158
|
} }, P = l.vnode;
|
|
152
159
|
l.vnode = function(e) {
|
|
@@ -154,17 +161,17 @@ l.vnode = function(e) {
|
|
|
154
161
|
var t = r.props, o = r.type, n = {}, i = o.indexOf("-") === -1;
|
|
155
162
|
for (var u in t) {
|
|
156
163
|
var _ = t[u];
|
|
157
|
-
if (!(u === "value" && "defaultValue" in t && _ == null ||
|
|
164
|
+
if (!(u === "value" && "defaultValue" in t && _ == null || F && u === "children" && o === "noscript" || u === "class" || u === "className")) {
|
|
158
165
|
var a = u.toLowerCase();
|
|
159
|
-
u === "defaultValue" && "value" in t && t.value == null ? u = "value" : u === "download" && _ === !0 ? _ = "" : a === "translate" && _ === "no" ? _ = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? u = "ondblclick" : a !== "onchange" || o !== "input" && o !== "textarea" ||
|
|
166
|
+
u === "defaultValue" && "value" in t && t.value == null ? u = "value" : u === "download" && _ === !0 ? _ = "" : a === "translate" && _ === "no" ? _ = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? u = "ondblclick" : a !== "onchange" || o !== "input" && o !== "textarea" || T(t.type) ? a === "onfocus" ? u = "onfocusin" : a === "onblur" ? u = "onfocusout" : q.test(u) && (u = a) : a = u = "oninput" : i && L.test(u) ? u = u.replace(D, "-$&").toLowerCase() : _ === null && (_ = void 0), a === "oninput" && n[u = a] && (u = "oninputCapture"), n[u] = _;
|
|
160
167
|
}
|
|
161
168
|
}
|
|
162
169
|
o == "select" && n.multiple && Array.isArray(n.value) && (n.value = h(t.children).forEach(function(s) {
|
|
163
170
|
s.props.selected = n.value.indexOf(s.props.value) != -1;
|
|
164
171
|
})), o == "select" && n.defaultValue != null && (n.value = h(t.children).forEach(function(s) {
|
|
165
172
|
s.props.selected = n.multiple ? n.defaultValue.indexOf(s.props.value) != -1 : n.defaultValue == s.props.value;
|
|
166
|
-
})), t.class && !t.className ? (n.class = t.class, Object.defineProperty(n, "className",
|
|
167
|
-
}(e), e.$$typeof =
|
|
173
|
+
})), t.class && !t.className ? (n.class = t.class, Object.defineProperty(n, "className", J)) : (t.className && !t.class || t.class && t.className) && (n.class = n.className = t.className), r.props = n;
|
|
174
|
+
}(e), e.$$typeof = B, P && P(e);
|
|
168
175
|
};
|
|
169
176
|
var E = l.__r;
|
|
170
177
|
l.__r = function(e) {
|
|
@@ -176,18 +183,11 @@ l.diffed = function(e) {
|
|
|
176
183
|
var r = e.props, t = e.__e;
|
|
177
184
|
t != null && e.type === "textarea" && "value" in r && r.value !== t.value && (t.value = r.value == null ? "" : r.value);
|
|
178
185
|
};
|
|
179
|
-
function J(e, r) {
|
|
180
|
-
const t = r.products?.total ?? 0, o = e.products?.from ?? 0, n = e.products?.size ?? 0;
|
|
181
|
-
return t > 0 && t > o + n;
|
|
182
|
-
}
|
|
183
|
-
function ne() {
|
|
184
|
-
return !!(window.IntersectionObserver && window.IntersectionObserverEntry && "intersectionRatio" in window.IntersectionObserverEntry.prototype);
|
|
185
|
-
}
|
|
186
186
|
function K({ children: e, pageSize: r, observerOptions: t }) {
|
|
187
187
|
const o = M(null), { query: n, response: i } = x((_) => A(_, "query", "response")), { loadMore: u } = U(r);
|
|
188
188
|
return W(() => {
|
|
189
189
|
let _, a;
|
|
190
|
-
return
|
|
190
|
+
return V(n, i) && (_ = o.current, a = new IntersectionObserver((s) => {
|
|
191
191
|
s[0]?.isIntersecting && u();
|
|
192
192
|
}, t), _ && a.observe(_)), () => {
|
|
193
193
|
_ && a.unobserve(_);
|
|
@@ -197,9 +197,9 @@ function K({ children: e, pageSize: r, observerOptions: t }) {
|
|
|
197
197
|
/* @__PURE__ */ y("div", { ref: o, style: { height: "1px" } })
|
|
198
198
|
] });
|
|
199
199
|
}
|
|
200
|
-
const ue =
|
|
200
|
+
const ue = j(K, I);
|
|
201
201
|
export {
|
|
202
202
|
ue as I,
|
|
203
|
-
|
|
203
|
+
V as h,
|
|
204
204
|
ne as i
|
|
205
205
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const v=require("./jsxRuntime.module-B3sGoTIU.cjs"),d=require("./useLoadMore-BWgWw24W.cjs"),N=require("./logger-BcHMZObS.cjs"),x=require("./pick-rYi1lc2m.cjs"),u=require("preact"),h=require("preact/hooks");function E(e,r){const t=r.products?.total??0,o=e.products?.from??0,n=e.products?.size??0;return t>0&&t>o+n}function A(){return!!(window.IntersectionObserver&&window.IntersectionObserverEntry&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)}function M(e,r){for(var t in r)e[t]=r[t];return e}function f(e,r){for(var t in e)if(t!=="__source"&&!(t in r))return!0;for(var o in r)if(o!=="__source"&&e[o]!==r[o])return!0;return!1}function m(e,r){this.props=e,this.context=r}function U(e,r){function t(n){var s=this.props.ref,i=s==n.ref;return!i&&s&&(s.call?s(null):s.current=null),r?!r(this.props,n)||!i:f(this.props,n)}function o(n){return this.shouldComponentUpdate=t,u.createElement(e,n)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(m.prototype=new u.Component).isPureReactComponent=!0,m.prototype.shouldComponentUpdate=function(e,r){return f(this.props,e)||f(this.state,r)};var y=u.options.__b;u.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),y&&y(e)};var q=u.options.__e;u.options.__e=function(e,r,t,o){if(e.then){for(var n,s=r;s=s.__;)if((n=s.__c)&&n.__c)return r.__e==null&&(r.__e=t.__e,r.__k=t.__k),n.__c(e,r)}q(e,r,t,o)};var b=u.options.unmount;function P(e,r,t){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=M({},e)).__c!=null&&(e.__c.__P===t&&(e.__c.__P=r),e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return P(o,r,t)})),e}function R(e,r,t){return e&&t&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return R(o,r,t)}),e.__c&&e.__c.__P===r&&(e.__e&&t.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=t)),e}function p(){this.__u=0,this.o=null,this.__b=null}function S(e){var r=e.__.__c;return r&&r.__a&&r.__a(e)}function c(){this.i=null,this.l=null}u.options.unmount=function(e){var r=e.__c;r&&r.__R&&r.__R(),r&&32&e.__u&&(e.type=null),b&&b(e)},(p.prototype=new u.Component).__c=function(e,r){var t=r.__c,o=this;o.o==null&&(o.o=[]),o.o.push(t);var n=S(o.__v),s=!1,i=function(){s||(s=!0,t.__R=null,n?n(_):_())};t.__R=i;var _=function(){if(!--o.__u){if(o.state.__a){var l=o.state.__a;o.__v.__k[0]=R(l,l.__c.__P,l.__c.__O)}var a;for(o.setState({__a:o.__b=null});a=o.o.pop();)a.forceUpdate()}};o.__u++||32&r.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(i,i)},p.prototype.componentWillUnmount=function(){this.o=[]},p.prototype.render=function(e,r){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=P(this.__b,t,o.__O=o.__P)}this.__b=null}var n=r.__a&&u.createElement(u.Fragment,null,e.fallback);return n&&(n.__u&=-33),[u.createElement(u.Fragment,null,r.__a?null:e.children),n]};var g=function(e,r,t){if(++t[1]===t[0]&&e.l.delete(r),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(t=e.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;e.i=t=t[2]}};(c.prototype=new u.Component).__a=function(e){var r=this,t=S(r.__v),o=r.l.get(e);return o[0]++,function(n){var s=function(){r.props.revealOrder?(o.push(n),g(r,e,o)):n()};t?t(s):s()}},c.prototype.render=function(e){this.i=null,this.l=new Map;var r=u.toChildArray(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&r.reverse();for(var t=r.length;t--;)this.l.set(r[t],this.i=[1,0,this.i]);return e.children},c.prototype.componentDidUpdate=c.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(r,t){g(e,t,r)})};var I=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,W=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,V=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,j=/[A-Z0-9]/g,F=typeof document<"u",H=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};u.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(u.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(r){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:r})}})});var k=u.options.event;function L(){}function z(){return this.cancelBubble}function B(){return this.defaultPrevented}u.options.event=function(e){return k&&(e=k(e)),e.persist=L,e.isPropagationStopped=z,e.isDefaultPrevented=B,e.nativeEvent=e};var D={enumerable:!1,configurable:!0,get:function(){return this.class}},O=u.options.vnode;u.options.vnode=function(e){typeof e.type=="string"&&function(r){var t=r.props,o=r.type,n={},s=o.indexOf("-")===-1;for(var i in t){var _=t[i];if(!(i==="value"&&"defaultValue"in t&&_==null||F&&i==="children"&&o==="noscript"||i==="class"||i==="className")){var l=i.toLowerCase();i==="defaultValue"&&"value"in t&&t.value==null?i="value":i==="download"&&_===!0?_="":l==="translate"&&_==="no"?_=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?i="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||H(t.type)?l==="onfocus"?i="onfocusin":l==="onblur"?i="onfocusout":V.test(i)&&(i=l):l=i="oninput":s&&W.test(i)?i=i.replace(j,"-$&").toLowerCase():_===null&&(_=void 0),l==="oninput"&&n[i=l]&&(i="oninputCapture"),n[i]=_}}o=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=u.toChildArray(t.children).forEach(function(a){a.props.selected=n.value.indexOf(a.props.value)!=-1})),o=="select"&&n.defaultValue!=null&&(n.value=u.toChildArray(t.children).forEach(function(a){a.props.selected=n.multiple?n.defaultValue.indexOf(a.props.value)!=-1:n.defaultValue==a.props.value})),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",D)):(t.className&&!t.class||t.class&&t.className)&&(n.class=n.className=t.className),r.props=n}(e),e.$$typeof=I,O&&O(e)};var C=u.options.__r;u.options.__r=function(e){C&&C(e),e.__c};var w=u.options.diffed;u.options.diffed=function(e){w&&w(e);var r=e.props,t=e.__e;t!=null&&e.type==="textarea"&&"value"in r&&r.value!==t.value&&(t.value=r.value==null?"":r.value)};function T({children:e,pageSize:r,observerOptions:t}){const o=h.useRef(null),{query:n,response:s}=d.useNostoAppState(_=>x.pick(_,"query","response")),{loadMore:i}=d.useLoadMore(r);return h.useEffect(()=>{let _,l;return E(n,s)&&(_=o.current,l=new IntersectionObserver(a=>{a[0]?.isIntersecting&&i()},t),_&&l.observe(_)),()=>{_&&l.unobserve(_)}},[s]),v.u(u.Fragment,{children:[e,v.u("div",{ref:o,style:{height:"1px"}})]})}const $=U(T,N.isEqual);exports.InfiniteScrollWithObserver=$;exports.hasMoreResults=E;exports.intersectionObserverSupported=A;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { e as i, b as n } from "./useActions-BIIcXXS6.js";
|
|
2
|
+
import { u as r } from "./eventBusSubscribe-Cxw0xUAm.js";
|
|
3
|
+
import { s as c } from "./index.es-B8mbAxS4.js";
|
|
4
|
+
import { l as u } from "./logger-DVwg4Wor.js";
|
|
5
|
+
import { useEffect as l } from "preact/hooks";
|
|
6
|
+
function S() {
|
|
7
|
+
const { pageType: t } = i(), o = n();
|
|
8
|
+
return r({
|
|
9
|
+
event: "actions/newSearch",
|
|
10
|
+
callback: (e) => {
|
|
11
|
+
t === e.targetStore && o.newSearch(e.query, e.options);
|
|
12
|
+
}
|
|
13
|
+
}), r({
|
|
14
|
+
event: "actions/updateSearch",
|
|
15
|
+
callback: (e) => {
|
|
16
|
+
t === e.targetStore && o.updateSearch(e.query, e.options);
|
|
17
|
+
}
|
|
18
|
+
}), r({
|
|
19
|
+
event: "actions/replaceFilter",
|
|
20
|
+
callback: (e) => {
|
|
21
|
+
t === e.targetStore && o.replaceFilter(e.field, e.value);
|
|
22
|
+
}
|
|
23
|
+
}), r({
|
|
24
|
+
event: "actions/toggleProductFilter",
|
|
25
|
+
callback: (e) => {
|
|
26
|
+
t === e.targetStore && o.toggleProductFilter(e.field, e.value, e.active);
|
|
27
|
+
}
|
|
28
|
+
}), null;
|
|
29
|
+
}
|
|
30
|
+
function v() {
|
|
31
|
+
l(() => {
|
|
32
|
+
const t = window.setTimeout(() => {
|
|
33
|
+
u.error("Nosto client script has not loaded after 3 seconds.");
|
|
34
|
+
}, 3e3);
|
|
35
|
+
c(() => {
|
|
36
|
+
window.clearTimeout(t);
|
|
37
|
+
});
|
|
38
|
+
}, []);
|
|
39
|
+
}
|
|
40
|
+
const b = {
|
|
41
|
+
defaultCurrency: "EUR",
|
|
42
|
+
queryModifications: (t) => t
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
S,
|
|
46
|
+
b as d,
|
|
47
|
+
v as u
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./useActions-B-wWOcHo.cjs"),r=require("./eventBusSubscribe-B75y7otR.cjs"),c=require("./index.es-DlUp67LT.cjs"),o=require("./logger-BcHMZObS.cjs"),u=require("preact/hooks");function s(){const{pageType:t}=i.useConfig(),n=i.useActions();return r.useEventBusSubscribe({event:"actions/newSearch",callback:e=>{t===e.targetStore&&n.newSearch(e.query,e.options)}}),r.useEventBusSubscribe({event:"actions/updateSearch",callback:e=>{t===e.targetStore&&n.updateSearch(e.query,e.options)}}),r.useEventBusSubscribe({event:"actions/replaceFilter",callback:e=>{t===e.targetStore&&n.replaceFilter(e.field,e.value)}}),r.useEventBusSubscribe({event:"actions/toggleProductFilter",callback:e=>{t===e.targetStore&&n.toggleProductFilter(e.field,e.value,e.active)}}),null}function l(){u.useEffect(()=>{const t=window.setTimeout(()=>{o.logger.error("Nosto client script has not loaded after 3 seconds.")},3e3);c.s(()=>{window.clearTimeout(t)})},[])}const a={defaultCurrency:"EUR",queryModifications:t=>t};exports.StoreActionsListener=s;exports.defaultBaseConfig=a;exports.useCheckClientScript=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("preact/hooks"),c=({event:s,callback:o})=>{const e=t=>{const n=t.detail;o(n)};return window.addEventListener(`@nosto/search-js/${s}`,e),()=>{window.removeEventListener(`@nosto/search-js/${s}`,e)}},i=({event:s,callback:o})=>{const e=r.useCallback(t=>{const n=t.detail;o(n)},[o]);r.useEffect(()=>(window.addEventListener(`@nosto/search-js/${s}`,e),()=>{window.removeEventListener(`@nosto/search-js/${s}`,e)}),[s,e])};exports.subscribeToNostoEvent=c;exports.useEventBusSubscribe=i;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useCallback as r, useEffect as a } from "preact/hooks";
|
|
2
|
+
const c = ({ event: s, callback: o }) => {
|
|
3
|
+
const e = (n) => {
|
|
4
|
+
const t = n.detail;
|
|
5
|
+
o(t);
|
|
6
|
+
};
|
|
7
|
+
return window.addEventListener(`@nosto/search-js/${s}`, e), () => {
|
|
8
|
+
window.removeEventListener(`@nosto/search-js/${s}`, e);
|
|
9
|
+
};
|
|
10
|
+
}, d = ({ event: s, callback: o }) => {
|
|
11
|
+
const e = r(
|
|
12
|
+
(n) => {
|
|
13
|
+
const t = n.detail;
|
|
14
|
+
o(t);
|
|
15
|
+
},
|
|
16
|
+
[o]
|
|
17
|
+
);
|
|
18
|
+
a(() => (window.addEventListener(`@nosto/search-js/${s}`, e), () => {
|
|
19
|
+
window.removeEventListener(`@nosto/search-js/${s}`, e);
|
|
20
|
+
}), [s, e]);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
c as s,
|
|
24
|
+
d as u
|
|
25
|
+
};
|
|
@@ -1,42 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
3
|
-
if (
|
|
4
|
-
return
|
|
1
|
+
var r = " daum[ /]| deusu/| yadirectfetcher|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\btime/|\\||^<|^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|^{{.*}}$|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|firephp|functionize|gomezagent|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|ips-agent|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|perl|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/", t = /bot|crawl|http|lighthouse|scan|search|spider/i, e;
|
|
2
|
+
function o() {
|
|
3
|
+
if (e instanceof RegExp)
|
|
4
|
+
return e;
|
|
5
5
|
try {
|
|
6
|
-
|
|
6
|
+
e = new RegExp(r, "i");
|
|
7
7
|
} catch {
|
|
8
|
-
|
|
8
|
+
e = t;
|
|
9
9
|
}
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
function c(e) {
|
|
13
|
-
return !!e && i().test(e);
|
|
14
|
-
}
|
|
15
|
-
function p() {
|
|
16
|
-
return c(navigator.userAgent);
|
|
17
|
-
}
|
|
18
|
-
function u(...e) {
|
|
19
|
-
if (!e.every((r) => r == null))
|
|
20
|
-
return e.filter((r) => Array.isArray(r)).reduce((r, o) => r.concat(o), []);
|
|
10
|
+
return e;
|
|
21
11
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const r = `${t}${e}`;
|
|
25
|
-
window.performance?.mark(`${r}.start`);
|
|
12
|
+
function s(a) {
|
|
13
|
+
return !!a && o().test(a);
|
|
26
14
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
window.performance?.mark(`${r}.end`), window.performance?.measure(r, `${r}.start`, `${r}.end`);
|
|
30
|
-
}
|
|
31
|
-
function m(e) {
|
|
32
|
-
return d(e), () => l(e);
|
|
33
|
-
}
|
|
34
|
-
function h(e) {
|
|
35
|
-
return Array.from(new Set(e));
|
|
15
|
+
function i() {
|
|
16
|
+
return s(navigator.userAgent);
|
|
36
17
|
}
|
|
37
18
|
export {
|
|
38
|
-
|
|
39
|
-
p as i,
|
|
40
|
-
u as m,
|
|
41
|
-
h as u
|
|
19
|
+
i
|
|
42
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var r=" daum[ /]| deusu/| yadirectfetcher|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\btime/|\\||^<|^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|^{{.*}}$|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|firephp|functionize|gomezagent|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|ips-agent|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|perl|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/",t=/bot|crawl|http|lighthouse|scan|search|spider/i,e;function o(){if(e instanceof RegExp)return e;try{e=new RegExp(r,"i")}catch{e=t}return e}function s(a){return!!a&&o().test(a)}function i(){return s(navigator.userAgent)}exports.isBot=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../jsxRuntime.module-B3sGoTIU.cjs"),i=require("../../useActions-B-wWOcHo.cjs"),s=require("../../baseConfig-KREDcxnC.cjs"),a=require("../../index.es-DlUp67LT.cjs"),p=require("../../BaseElement-Ds4INJSy.cjs"),m=require("preact/hooks"),d={...s.defaultBaseConfig,memoryCache:!1};function f(e){return{pageType:"autocomplete",...d,...e}}function C({config:e,store:t,children:o}){const n=t??i.createStore();return s.useCheckClientScript(),r.u(i.ConfigContext,{value:f(e),children:r.u(i.StoreContext,{value:n,children:[r.u(s.StoreActionsListener,{}),o]})})}function g({children:e,hit:t,as:o,componentProps:n}){const u=m.useCallback(()=>{t&&"productId"in t&&a.s(c=>c.recordSearchClick("autocomplete",t))},[t]);return r.u(p.BaseElement,{onClick:u,as:o,componentProps:n,children:e})}function S({as:e,componentProps:t,onSearchInput:o,children:n}){const u={...t,onInput:l=>{o(l.target)}},c=e??"input";return e||(u.type="search"),r.u(c,{...u,children:n})}exports.AutocompleteElement=g;exports.AutocompletePageProvider=C;exports.SearchInput=S;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @module preact/autocomplete */
|
|
2
|
+
export type { PublicAutocompleteConfig as AutocompleteConfig } from './src/AutocompleteConfig.ts';
|
|
3
|
+
export { AutocompletePageProvider } from './src/AutocompletePageProvider.tsx';
|
|
4
|
+
export { AutocompleteElement, type AutocompleteElementProps } from './src/components/AutocompleteElement.tsx';
|
|
5
|
+
export { SearchInput } from './src/components/SearchInput.tsx';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { u as n } from "../../jsxRuntime.module-Bzuv3cXw.js";
|
|
2
|
+
import { c as m, S as i, C as p } from "../../useActions-BIIcXXS6.js";
|
|
3
|
+
import { d as s, u as l, S as f } from "../../baseConfig-CTN0CcW-.js";
|
|
4
|
+
import { s as C } from "../../index.es-B8mbAxS4.js";
|
|
5
|
+
import { B as d } from "../../BaseElement-fZSwbg09.js";
|
|
6
|
+
import { useCallback as S } from "preact/hooks";
|
|
7
|
+
const g = {
|
|
8
|
+
...s,
|
|
9
|
+
memoryCache: !1
|
|
10
|
+
};
|
|
11
|
+
function k(e) {
|
|
12
|
+
return {
|
|
13
|
+
pageType: "autocomplete",
|
|
14
|
+
...g,
|
|
15
|
+
...e
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function I({ config: e, store: t, children: o }) {
|
|
19
|
+
const r = t ?? m();
|
|
20
|
+
return l(), /* @__PURE__ */ n(p, { value: k(e), children: /* @__PURE__ */ n(i, { value: r, children: [
|
|
21
|
+
/* @__PURE__ */ n(f, {}),
|
|
22
|
+
o
|
|
23
|
+
] }) });
|
|
24
|
+
}
|
|
25
|
+
function P({
|
|
26
|
+
children: e,
|
|
27
|
+
hit: t,
|
|
28
|
+
as: o,
|
|
29
|
+
componentProps: r
|
|
30
|
+
}) {
|
|
31
|
+
const c = S(() => {
|
|
32
|
+
t && "productId" in t && C((a) => a.recordSearchClick("autocomplete", t));
|
|
33
|
+
}, [t]);
|
|
34
|
+
return /* @__PURE__ */ n(d, { onClick: c, as: o, componentProps: r, children: e });
|
|
35
|
+
}
|
|
36
|
+
function E({ as: e, componentProps: t, onSearchInput: o, children: r }) {
|
|
37
|
+
const c = {
|
|
38
|
+
...t,
|
|
39
|
+
onInput: (u) => {
|
|
40
|
+
o(u.target);
|
|
41
|
+
}
|
|
42
|
+
}, a = e ?? "input";
|
|
43
|
+
return e || (c.type = "search"), /* @__PURE__ */ n(a, { ...c, children: r });
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
P as AutocompleteElement,
|
|
47
|
+
I as AutocompletePageProvider,
|
|
48
|
+
E as SearchInput
|
|
49
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseConfig } from '../../
|
|
1
|
+
import { BaseConfig } from '../../common/src/config/baseConfig';
|
|
2
2
|
export declare const defaultAutocompleteConfig: {
|
|
3
3
|
memoryCache: false;
|
|
4
4
|
defaultCurrency: string;
|
|
@@ -13,11 +13,11 @@ export interface AutocompleteConfig extends BaseConfig {
|
|
|
13
13
|
}
|
|
14
14
|
export type PublicAutocompleteConfig = Omit<AutocompleteConfig, keyof typeof defaultAutocompleteConfig | "pageType"> & Partial<Pick<AutocompleteConfig, keyof typeof defaultAutocompleteConfig>>;
|
|
15
15
|
export declare function makeAutocompleteConfig(config: PublicAutocompleteConfig): {
|
|
16
|
-
search?: import('
|
|
17
|
-
onBeforeSearch?: ((context: import('
|
|
18
|
-
onSearchError?: ((error: unknown, query: import('@nosto/nosto-js/client').SearchQuery, options: import('
|
|
16
|
+
search?: import('../../../core/src/types').SearchOptions | undefined;
|
|
17
|
+
onBeforeSearch?: ((context: import('../../common/src/types').ActionContext, options: import('../../../core/src/types').SearchOptions) => void) | undefined;
|
|
18
|
+
onSearchError?: ((error: unknown, query: import('@nosto/nosto-js/client').SearchQuery, options: import('../../../core/src/types').SearchOptions, pageType: import('../../common/src/types').PageType) => void) | undefined;
|
|
19
19
|
defaultCurrency: string;
|
|
20
|
-
queryModifications: (query: import('@nosto/nosto-js/client').SearchQuery, pageType: import('
|
|
20
|
+
queryModifications: (query: import('@nosto/nosto-js/client').SearchQuery, pageType: import('../../common/src/types').PageType | undefined) => import('@nosto/nosto-js/client').SearchQuery;
|
|
21
21
|
memoryCache: boolean;
|
|
22
22
|
pageType: "autocomplete";
|
|
23
23
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Store } from '
|
|
1
|
+
import { Store } from '../../common/src/store/store';
|
|
2
2
|
import { ComponentChildren } from 'preact';
|
|
3
|
-
import { PublicAutocompleteConfig } from './
|
|
3
|
+
import { PublicAutocompleteConfig } from './AutocompleteConfig';
|
|
4
4
|
type AutocompleteProps = {
|
|
5
5
|
config: PublicAutocompleteConfig;
|
|
6
6
|
store?: Store;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AsComponent, BaseElementProps } from '
|
|
2
|
-
import { KeywordHit, ProductHit } from '
|
|
1
|
+
import { AsComponent, BaseElementProps } from '../../../common/src/components/BaseElement';
|
|
2
|
+
import { KeywordHit, ProductHit } from '../types';
|
|
3
3
|
export type AutocompleteElementProps<C extends AsComponent> = Omit<BaseElementProps<C>, "onClick"> & {
|
|
4
4
|
hit: ProductHit | KeywordHit;
|
|
5
5
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../jsxRuntime.module-B3sGoTIU.cjs"),r=require("../../useActions-B-wWOcHo.cjs"),o=require("../../baseConfig-KREDcxnC.cjs"),u={...o.defaultBaseConfig,persistentSearchCache:!1,preservePageScroll:!1};function c(e){return{pageType:"category",...u,...e}}function s({config:e,store:n,children:a}){const i=n??r.createStore();return o.useCheckClientScript(),t.u(r.ConfigContext,{value:c(e),children:t.u(r.StoreContext,{value:i,children:[t.u(o.StoreActionsListener,{}),a]})})}exports.CategoryPageProvider=s;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { u as t } from "../../jsxRuntime.module-Bzuv3cXw.js";
|
|
2
|
+
import { c as n, S as i, C as s } from "../../useActions-BIIcXXS6.js";
|
|
3
|
+
import { d as c, u as f, S as C } from "../../baseConfig-CTN0CcW-.js";
|
|
4
|
+
const l = {
|
|
5
|
+
...c,
|
|
6
|
+
persistentSearchCache: !1,
|
|
7
|
+
preservePageScroll: !1
|
|
8
|
+
};
|
|
9
|
+
function u(e) {
|
|
10
|
+
return {
|
|
11
|
+
pageType: "category",
|
|
12
|
+
...l,
|
|
13
|
+
...e
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function m({ config: e, store: r, children: o }) {
|
|
17
|
+
const a = r ?? n();
|
|
18
|
+
return f(), /* @__PURE__ */ t(s, { value: u(e), children: /* @__PURE__ */ t(i, { value: a, children: [
|
|
19
|
+
/* @__PURE__ */ t(C, {}),
|
|
20
|
+
o
|
|
21
|
+
] }) });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
m as CategoryPageProvider
|
|
25
|
+
};
|
package/dist/preact/{src/config/pages/category/config.d.ts → category/src/CategoryConfig.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseConfig } from '../../
|
|
1
|
+
import { BaseConfig } from '../../common/src/config/baseConfig';
|
|
2
2
|
export declare const defaultCategoryConfig: {
|
|
3
3
|
persistentSearchCache: false;
|
|
4
4
|
preservePageScroll: false;
|
|
@@ -25,12 +25,12 @@ export interface CategoryConfig extends BaseConfig {
|
|
|
25
25
|
}
|
|
26
26
|
export type PublicCategoryConfig = Omit<CategoryConfig, keyof typeof defaultCategoryConfig | "pageType"> & Partial<Pick<CategoryConfig, keyof typeof defaultCategoryConfig>>;
|
|
27
27
|
export declare function makeCategoryConfig(config: PublicCategoryConfig): {
|
|
28
|
-
search?: import('
|
|
29
|
-
onBeforeSearch?: ((context: import('
|
|
30
|
-
onSearchError?: ((error: unknown, query: import('@nosto/nosto-js/client').SearchQuery, options: import('
|
|
28
|
+
search?: import('../../../core/src/types').SearchOptions | undefined;
|
|
29
|
+
onBeforeSearch?: ((context: import('../../common/src/types').ActionContext, options: import('../../../core/src/types').SearchOptions) => void) | undefined;
|
|
30
|
+
onSearchError?: ((error: unknown, query: import('@nosto/nosto-js/client').SearchQuery, options: import('../../../core/src/types').SearchOptions, pageType: import('../../common/src/types').PageType) => void) | undefined;
|
|
31
31
|
defaultCurrency: string;
|
|
32
|
-
queryModifications: (query: import('@nosto/nosto-js/client').SearchQuery, pageType: import('../../../api/types').PageType | undefined) => import('@nosto/nosto-js/client').SearchQuery;
|
|
33
32
|
persistentSearchCache: boolean;
|
|
34
33
|
preservePageScroll: boolean;
|
|
34
|
+
queryModifications: (query: import('@nosto/nosto-js/client').SearchQuery, pageType: import('../../common/src/types').PageType | undefined) => import('@nosto/nosto-js/client').SearchQuery;
|
|
35
35
|
pageType: "category";
|
|
36
36
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Store } from '
|
|
1
|
+
import { Store } from '../../common/src/store/store';
|
|
2
2
|
import { ComponentChildren } from 'preact';
|
|
3
|
-
import { PublicCategoryConfig } from './
|
|
3
|
+
import { PublicCategoryConfig } from './CategoryConfig';
|
|
4
4
|
type CategoryProps = {
|
|
5
5
|
config: PublicCategoryConfig;
|
|
6
6
|
store?: Store;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../isBot-CheH1DcZ.cjs"),t=require("../../jsxRuntime.module-B3sGoTIU.cjs"),s=require("../../useLoadMore-BWgWw24W.cjs"),p=require("../../pick-rYi1lc2m.cjs"),n=require("../../InfiniteScrollWithObserver-wzwXCrZ7.cjs"),q=require("preact"),r=require("../../useActions-B-wWOcHo.cjs");function b({pageSize:o}){const{loadMore:e}=s.useLoadMore(o);return t.u("button",{onClick:e,children:"More results"})}function c({children:o,loadMoreComponent:e,pageSize:i}){const{loading:u,query:l,response:a}=s.useNostoAppState(S=>p.pick(S,"loading","query","response")),d=!u&&n.hasMoreResults(l,a);return t.u(q.Fragment,{children:[o,d&&(e?t.u(e,{pageSize:i}):t.u(b,{pageSize:i}))]})}const M=!f.isBot()&&n.intersectionObserverSupported()?n.InfiniteScrollWithObserver:c;exports.StoreContext=r.StoreContext;exports.createExtendableStore=r.createExtendableStore;exports.createStore=r.createStore;exports.defaultState=r.defaultState;exports.InfiniteScroll=M;exports.InfiniteScrollWithLink=c;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @module preact/common */
|
|
2
2
|
export { InfiniteScroll, type InfiniteScrollProps } from './src/components/InfiniteScroll/InfiniteScroll';
|
|
3
3
|
export { InfiniteScrollWithLink } from './src/components/InfiniteScroll/InfiniteScrollWithLink';
|
|
4
|
-
export { createStore, defaultState, type State, type Store } from './src/store';
|
|
5
|
-
export { StoreContext } from './src/storeContext';
|
|
6
|
-
export { createExtendableStore, type ExtendedStore } from './src/storeExtensions';
|
|
4
|
+
export { createStore, defaultState, type State, type Store } from './src/store/store';
|
|
5
|
+
export { StoreContext } from './src/store/storeContext';
|
|
6
|
+
export { createExtendableStore, type ExtendedStore } from './src/store/storeExtensions';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as l } from "
|
|
2
|
-
import { u as r } from "
|
|
3
|
-
import {
|
|
4
|
-
import { p as u } from "
|
|
5
|
-
import { h as d, i as f, I as S } from "
|
|
1
|
+
import { i as l } from "../../isBot-C58Y7eiv.js";
|
|
2
|
+
import { u as r } from "../../jsxRuntime.module-Bzuv3cXw.js";
|
|
3
|
+
import { u as p, a as m } from "../../useLoadMore-Dw7GDu8a.js";
|
|
4
|
+
import { p as u } from "../../pick-DReBictn.js";
|
|
5
|
+
import { h as d, i as f, I as S } from "../../InfiniteScrollWithObserver-BsydJKFj.js";
|
|
6
6
|
import { Fragment as h } from "preact";
|
|
7
|
-
import { S as O, a as W, c as A, d as B } from "
|
|
7
|
+
import { S as O, a as W, c as A, d as B } from "../../useActions-BIIcXXS6.js";
|
|
8
8
|
function M({ pageSize: e }) {
|
|
9
9
|
const { loadMore: o } = p(e);
|
|
10
10
|
return /* @__PURE__ */ r("button", { onClick: o, children: "More results" });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchOptions } from '
|
|
1
|
+
import { SearchOptions } from '../../../../core/src/types';
|
|
2
2
|
import { SearchQuery } from '@nosto/nosto-js/client';
|
|
3
|
-
import { ActionContext } from '
|
|
3
|
+
import { ActionContext } from '../types';
|
|
4
4
|
export declare function newSearch(context: ActionContext, query: SearchQuery, options?: SearchOptions): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InputSearchRangeFilter } from '@nosto/nosto-js/client';
|
|
2
|
-
import { ActionContext } from '
|
|
2
|
+
import { ActionContext } from '../types';
|
|
3
3
|
export declare function replaceFilter(context: ActionContext, field: string, value: InputSearchRangeFilter | string | undefined): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActionContext } from '
|
|
1
|
+
import { ActionContext } from '../types';
|
|
2
2
|
export declare function toggleProductFilter(context: ActionContext, field: string, value: string, active: boolean): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchOptions } from '
|
|
1
|
+
import { SearchOptions } from '../../../../core/src/types';
|
|
2
2
|
import { SearchQuery } from '@nosto/nosto-js/client';
|
|
3
|
-
import { ActionContext } from '
|
|
3
|
+
import { ActionContext } from '../types';
|
|
4
4
|
export declare function updateSearch(context: ActionContext, query: SearchQuery, options?: SearchOptions): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SearchQuery } from '@nosto/nosto-js/client';
|
|
2
|
-
import { PageType } from '../
|
|
3
|
-
export declare function
|
|
2
|
+
import { PageType } from '../types';
|
|
3
|
+
export declare function withDefaultQuery(pageType: PageType, query: SearchQuery): {
|
|
4
4
|
keywords?: import('@nosto/nosto-js/client').InputSearchQuery["keywords"] & {
|
|
5
5
|
fields: string[];
|
|
6
6
|
facets: string[];
|
|
@@ -41,5 +41,3 @@ export declare function applyQueryDefaults(pageType: PageType, query: SearchQuer
|
|
|
41
41
|
time?: number | undefined;
|
|
42
42
|
name?: string;
|
|
43
43
|
};
|
|
44
|
-
export declare const defaultProductFields: string[];
|
|
45
|
-
export declare const defaultKeywordFields: string[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SearchOptions } from '../../../../core/src/types';
|
|
2
2
|
import { SearchQuery } from '@nosto/nosto-js/client';
|
|
3
|
-
import { ActionContext } from '
|
|
4
|
-
import { PageType } from '../../api/types';
|
|
3
|
+
import { ActionContext, PageType } from '../types';
|
|
5
4
|
export declare const defaultBaseConfig: {
|
|
6
5
|
defaultCurrency: string;
|
|
7
6
|
queryModifications: (query: SearchQuery) => SearchQuery;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AutocompleteConfig } from '../../../autocomplete/src/AutocompleteConfig';
|
|
2
|
+
import { CategoryConfig } from '../../../category/src/CategoryConfig';
|
|
3
|
+
import { SerpConfig } from '../../../serp/src/SerpConfig';
|
|
4
|
+
export type Config = SerpConfig | CategoryConfig | AutocompleteConfig;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Config } from './config';
|
|
2
|
+
export declare const ConfigContext: import('preact').Context<Config | null>;
|
|
3
|
+
export declare const useConfig: () => Config;
|
|
4
|
+
export declare const useSerpConfig: () => import('../../../serp/src/SerpConfig').SerpConfig;
|
|
5
|
+
export declare const useCategoryConfig: () => import('../../../category/src/CategoryConfig').CategoryConfig;
|
|
6
|
+
export declare const useAutocompleteConfig: () => import('../../../autocomplete/src/AutocompleteConfig').AutocompleteConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function StoreActionsListener(): null;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { SearchQuery } from '@nosto/nosto-js/client';
|
|
2
|
+
import { Store } from '../common';
|
|
3
|
+
import { Config } from './config/config';
|
|
2
4
|
export type PageType = "search" | "category" | "autocomplete";
|
|
3
5
|
export type MaybeProvider<T> = T | (() => T);
|
|
4
6
|
export type QueryProvider = MaybeProvider<Partial<SearchQuery>>;
|
|
7
|
+
export type ActionContext = {
|
|
8
|
+
store: Store;
|
|
9
|
+
config: Config;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("preact/hooks"),t=require("../../eventBusSubscribe-B75y7otR.cjs"),o=({event:s,params:e})=>{window.dispatchEvent(new CustomEvent(`@nosto/search-js/${s}`,{detail:e}))},n=({event:s})=>u.useCallback(e=>{o({event:s,params:e})},[s]);exports.subscribeToNostoEvent=t.subscribeToNostoEvent;exports.useEventBusSubscribe=t.useEventBusSubscribe;exports.dispatchNostoEvent=o;exports.useEventBusDispatch=n;
|