@nosto/search-js 2.1.1 → 2.1.2

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 { u as f } from "./jsxRuntime.module-Bzuv3cXw.js";
2
- import { u as a, a as l } from "./useLoadMore-SWC243j-.js";
2
+ import { u as a, a as l } from "./useLoadMore-1PzDu__A.js";
3
3
  import { p as d } from "./pick-DReBictn.js";
4
4
  import { useRef as m, useEffect as v } from "preact/hooks";
5
5
  import { Fragment as b } from "preact";
@@ -34,8 +34,8 @@ function f(e, r) {
34
34
  return !1;
35
35
  }
36
36
  export {
37
- o as a,
38
- i as b,
37
+ i as a,
38
+ o as b,
39
39
  a as d,
40
40
  f as i
41
41
  };
@@ -2,7 +2,7 @@ import { s as u } from "../index.es-B8mbAxS4.js";
2
2
  import { cloneElement as a } from "preact";
3
3
  import { r as s, i as c } from "../renderHeadless-BteGML1G.js";
4
4
  import { u as n } from "../jsxRuntime.module-Bzuv3cXw.js";
5
- import { c as l, S as m, C as f } from "../storeContext-hvRuqxMT.js";
5
+ import { c as l, S as m, C as f } from "../storeContext-jWZFJ8Kf.js";
6
6
  import { d as C, u as g } from "../baseConfig-C_tlTx1w.js";
7
7
  function E(t) {
8
8
  return t !== null && typeof t == "object" && "props" in t && typeof t.type == "string";
@@ -1,5 +1,5 @@
1
1
  import { u as t } from "../jsxRuntime.module-Bzuv3cXw.js";
2
- import { c as n, S as c, C as i } from "../storeContext-hvRuqxMT.js";
2
+ import { c as n, S as c, C as i } from "../storeContext-jWZFJ8Kf.js";
3
3
  import { d as s, u as f } from "../baseConfig-C_tlTx1w.js";
4
4
  const C = {
5
5
  ...s,
@@ -1,10 +1,10 @@
1
1
  import { i as l } from "../unique-Dwtu7vXB.js";
2
2
  import { u as r } from "../jsxRuntime.module-Bzuv3cXw.js";
3
- import { a as p, u as m } from "../useLoadMore-SWC243j-.js";
3
+ import { a as p, u as m } from "../useLoadMore-1PzDu__A.js";
4
4
  import { p as u } from "../pick-DReBictn.js";
5
- import { h as d, i as f, I as S } from "../InfiniteScrollWithObserver-_SDx8g70.js";
5
+ import { h as d, i as f, I as S } from "../InfiniteScrollWithObserver-DcV-Ny_9.js";
6
6
  import { Fragment as h } from "preact";
7
- import { S as O, a as W, c as A, d as B } from "../storeContext-hvRuqxMT.js";
7
+ import { S as O, a as W, c as A, d as B } from "../storeContext-jWZFJ8Kf.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,12 +1,12 @@
1
- import { u as F, b as R } from "../useLoadMore-SWC243j-.js";
2
- import { a as Y } from "../useLoadMore-SWC243j-.js";
3
- import { b } from "../isEqual-DvCrFxWE.js";
4
- import { useState as P, useMemo as z, useEffect as N, useCallback as M } from "preact/hooks";
1
+ import { u as F, b as R } from "../useLoadMore-1PzDu__A.js";
2
+ import { a as Y } from "../useLoadMore-1PzDu__A.js";
3
+ import { a as N } from "../isEqual-BzZ3d1JM.js";
4
+ import { useState as P, useMemo as z, useEffect as b, useCallback as M } from "preact/hooks";
5
5
  import { s as q } from "../index.es-B8mbAxS4.js";
6
6
  import { p as x } from "../parseNumber-QA48nJLp.js";
7
7
  function E(e) {
8
8
  const o = F((t) => t.response);
9
- return e && Array.isArray(e) || e && b(e) ? e : o;
9
+ return e && Array.isArray(e) || e && N(e) ? e : o;
10
10
  }
11
11
  function L(e) {
12
12
  var c;
@@ -81,7 +81,7 @@ function U(e) {
81
81
  }
82
82
  function _() {
83
83
  const [e, o] = P([]), [t, r] = P([]);
84
- return N(() => {
84
+ return b(() => {
85
85
  q(async (i) => {
86
86
  const { products: a, segments: c } = await i.getSearchSessionParams();
87
87
  o(c ?? []), r((a == null ? void 0 : a.personalizationBoost) ?? []);
@@ -1,5 +1,5 @@
1
- import { I as t, i as o } from "../InfiniteScrollWithObserver-_SDx8g70.js";
2
- import { g as s } from "../useLoadMore-SWC243j-.js";
1
+ import { I as t, i as o } from "../InfiniteScrollWithObserver-DcV-Ny_9.js";
2
+ import { g as s } from "../useLoadMore-1PzDu__A.js";
3
3
  export {
4
4
  t as InfiniteScrollWithObserver,
5
5
  s as getNextPageQuery,
@@ -1,5 +1,5 @@
1
1
  import { s as l } from "../index.es-B8mbAxS4.js";
2
- import { u as f, c as u, S, C as m } from "../storeContext-hvRuqxMT.js";
2
+ import { u as f, c as u, S, C as m } from "../storeContext-jWZFJ8Kf.js";
3
3
  import { r as g } from "../renderHeadless-BteGML1G.js";
4
4
  import { u as n } from "../jsxRuntime.module-Bzuv3cXw.js";
5
5
  import { d as C, u as d } from "../baseConfig-C_tlTx1w.js";
@@ -1,13 +1,13 @@
1
1
  import { createContext as c } from "preact";
2
2
  import { useContext as x } from "preact/hooks";
3
- import { a as u, i as h } from "./isEqual-DvCrFxWE.js";
4
- const w = c(null), v = () => {
5
- const t = x(w);
3
+ import { b as u, i as h } from "./isEqual-BzZ3d1JM.js";
4
+ const b = c(null), v = () => {
5
+ const t = x(b);
6
6
  if (!t)
7
7
  throw new Error("useConfig must be used within a ConfigProvider");
8
8
  return t;
9
9
  };
10
- function b(t, i = {}) {
10
+ function w(t, i = {}) {
11
11
  const a = /* @__PURE__ */ new Map();
12
12
  let o = u(t, i ?? {});
13
13
  const f = u(t, i);
@@ -50,13 +50,13 @@ const E = {
50
50
  initialized: !1
51
51
  };
52
52
  function q(t = {}) {
53
- return b(E, t);
53
+ return w(E, t);
54
54
  }
55
55
  const y = c(q());
56
56
  export {
57
- w as C,
57
+ b as C,
58
58
  y as S,
59
- b as a,
59
+ w as a,
60
60
  q as c,
61
61
  E as d,
62
62
  v as u
@@ -1,8 +1,8 @@
1
- import { u as I, S as k } from "./storeContext-hvRuqxMT.js";
1
+ import { u as I, S as k } from "./storeContext-jWZFJ8Kf.js";
2
2
  import { useContext as w, useMemo as v, useCallback as g, useState as M, useEffect as T } from "preact/hooks";
3
3
  import { s as A } from "./search-B0-bVNMy.js";
4
4
  import { u as R, a as f, m as N, i as Q } from "./unique-Dwtu7vXB.js";
5
- import { i as C, d as p } from "./isEqual-DvCrFxWE.js";
5
+ import { i as C, d as p } from "./isEqual-BzZ3d1JM.js";
6
6
  function E(e, r) {
7
7
  return {
8
8
  ...r,
@@ -1,5 +1,8 @@
1
1
  import { Simplify } from './simplify';
2
2
  import { Equals, Expect } from './types';
3
+ /**
4
+ * Merges multiple objects into one object.
5
+ */
3
6
  export declare function deepMerge<T extends unknown[]>(...objects: T): Merge<T>;
4
7
  export declare function deepMergePlain<T extends unknown[]>(...objects: T): PlainMerge<T>;
5
8
  type Merge<T, U = unknown> = Simplify<PlainMerge<T, U>>;
@@ -1 +1,4 @@
1
+ /**
2
+ * Compares two values for equality.
3
+ */
1
4
  export declare function isEqual(a: unknown, b: unknown): boolean;
@@ -1 +1,4 @@
1
+ /**
2
+ * Checks if a value is a plain object.
3
+ */
1
4
  export declare function isPlainObject<T = Record<string, unknown>>(value: unknown): value is T;
@@ -1,2 +1,5 @@
1
1
  import { Unfreeze } from './types';
2
+ /**
3
+ * Merges multiple arrays into one array.
4
+ */
2
5
  export declare function mergeArrays<T extends (unknown[] | readonly unknown[] | undefined | null)[]>(...objects: T): Unfreeze<T>[number];
@@ -1 +1,4 @@
1
+ /**
2
+ * Takes a value and returns it as a number if possible.
3
+ */
1
4
  export declare function parseNumber(value: unknown): number | undefined;
@@ -1 +1,4 @@
1
+ /**
2
+ * Measure the performance of a function.
3
+ */
1
4
  export declare function measure(name: string): () => void;
@@ -1 +1,4 @@
1
+ /**
2
+ * This function takes an array and returns a new array with only unique values.
3
+ */
1
4
  export declare function unique<T>(arr: T[]): T[];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../isEqual-DQXR__da.cjs"),r=require("../unique-CGVAnKZy.cjs"),i=require("../parseNumber-FsZ8w61u.cjs"),u=require("../pick-rYi1lc2m.cjs");exports.deepMerge=e.deepMerge;exports.deepMergePlain=e.deepMergePlain;exports.isEqual=e.isEqual;exports.isPlainObject=e.isPlainObject;exports.isBot=r.isBot;exports.measure=r.measure;exports.mergeArrays=r.mergeArrays;exports.unique=r.unique;exports.parseNumber=i.parseNumber;exports.pick=u.pick;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../isEqual-DQXR__da.cjs"),e=require("../unique-CGVAnKZy.cjs"),i=require("../parseNumber-FsZ8w61u.cjs"),u=require("../pick-rYi1lc2m.cjs");exports.deepMerge=r.deepMerge;exports.isEqual=r.isEqual;exports.isPlainObject=r.isPlainObject;exports.isBot=e.isBot;exports.measure=e.measure;exports.mergeArrays=e.mergeArrays;exports.unique=e.unique;exports.parseNumber=i.parseNumber;exports.pick=u.pick;
@@ -1,5 +1,5 @@
1
1
  /** @module utils */
2
- export { deepMerge, deepMergePlain, type MergeTests } from './src/deepMerge';
2
+ export { deepMerge, type MergeTests } from './src/deepMerge';
3
3
  export { isBot } from './src/isBot';
4
4
  export { isEqual } from './src/isEqual';
5
5
  export { isPlainObject } from './src/isPlainObject';
@@ -1,16 +1,15 @@
1
- import { d as r, a as s, i as p, b as i } from "../isEqual-DvCrFxWE.js";
2
- import { i as m, a as t, m as u, u as f } from "../unique-Dwtu7vXB.js";
3
- import { p as b } from "../parseNumber-QA48nJLp.js";
4
- import { p as g } from "../pick-DReBictn.js";
1
+ import { d as r, i as s, a as o } from "../isEqual-BzZ3d1JM.js";
2
+ import { i, a as m, m as t, u } from "../unique-Dwtu7vXB.js";
3
+ import { p as x } from "../parseNumber-QA48nJLp.js";
4
+ import { p as c } from "../pick-DReBictn.js";
5
5
  export {
6
6
  r as deepMerge,
7
- s as deepMergePlain,
8
- m as isBot,
9
- p as isEqual,
10
- i as isPlainObject,
11
- t as measure,
12
- u as mergeArrays,
13
- b as parseNumber,
14
- g as pick,
15
- f as unique
7
+ i as isBot,
8
+ s as isEqual,
9
+ o as isPlainObject,
10
+ m as measure,
11
+ t as mergeArrays,
12
+ x as parseNumber,
13
+ c as pick,
14
+ u as unique
16
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosto/search-js",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "files": [