hasting-swatchcart-module 0.0.3 → 0.0.41

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,25 +1,26 @@
1
- import { jsx as r, Fragment as e, jsxs as u } from "react/jsx-runtime";
2
- import { useAppSelector as s } from "../src/app/store/store.js";
3
- import { EDataInputType as p } from "../src/features/DataAdapter/utils/types.js";
4
- import { MultiProductWrapper as c } from "../src/features/MultiProduct/ui/MultiProductWrapper/MultiProductWrapper.js";
5
- import { getIsOpenSidebar as f } from "../src/features/swatches/model/selectors.js";
1
+ import { jsx as r, jsxs as n, Fragment as u } from "react/jsx-runtime";
2
+ import s from "../src/app/providers/StoreProvider.js";
3
+ import { useAppSelector as c } from "../src/app/store/store.js";
4
+ import { EDataInputType as e } from "../src/features/DataAdapter/utils/types.js";
5
+ import { MultiProductWrapper as f } from "../src/features/MultiProduct/ui/MultiProductWrapper/MultiProductWrapper.js";
6
+ import { getIsOpenSidebar as d } from "../src/features/swatches/model/selectors.js";
6
7
  import { Swatches as a } from "../src/features/swatches/ui/Swatches.js";
7
- const O = ({
8
- isOpen: m,
8
+ const P = ({
9
+ isOpen: p,
9
10
  uiDataType: o,
10
- data: l,
11
+ data: m,
11
12
  onToggleSidebar: i,
12
13
  onSendData: t
13
14
  }) => {
14
- const n = s(f);
15
- return /* @__PURE__ */ r(e, { children: n ? /* @__PURE__ */ u(e, { children: [
16
- o === p.DATA_ALL_PRODUCT ? /* @__PURE__ */ r(c, { onSendData: t }) : null,
17
- o === p.UI ? /* @__PURE__ */ r(
15
+ const l = c(d);
16
+ return /* @__PURE__ */ r(s, { children: l ? /* @__PURE__ */ n(u, { children: [
17
+ o === e.DATA_ALL_PRODUCT ? /* @__PURE__ */ r(f, { onSendData: t }) : null,
18
+ o === e.UI ? /* @__PURE__ */ r(
18
19
  a,
19
20
  {
20
- isOpen: m,
21
+ isOpen: p,
21
22
  uiDataType: "UI",
22
- data: l,
23
+ data: m,
23
24
  onToggleSidebar: i,
24
25
  onSendData: t
25
26
  }
@@ -27,5 +28,5 @@ const O = ({
27
28
  ] }) : null });
28
29
  };
29
30
  export {
30
- O as SwatchModule
31
+ P as SwatchModule
31
32
  };
@@ -1,4 +1,4 @@
1
- import { isAction as P, isPlainObject as q, combineReducers as Z, applyMiddleware as ee, compose as A, createStore as te } from "../../../redux/dist/redux.js";
1
+ import { isPlainObject as P, combineReducers as Z, applyMiddleware as ee, compose as A, createStore as te, isAction as q } from "../../../redux/dist/redux.js";
2
2
  import { __DO_NOT_USE__ActionTypes as Ue } from "../../../redux/dist/redux.js";
3
3
  import { produce as B, isDraftable as W, isDraft as re } from "../../../immer/dist/immer.js";
4
4
  import { current as Ge, freeze as Xe } from "../../../immer/dist/immer.js";
@@ -29,7 +29,7 @@ function k(e, t) {
29
29
  payload: r[0]
30
30
  };
31
31
  }
32
- return n.toString = () => `${e}`, n.type = e, n.match = (r) => P(r) && r.type === e, n;
32
+ return n.toString = () => `${e}`, n.type = e, n.match = (r) => q(r) && r.type === e, n;
33
33
  }
34
34
  function ae(e) {
35
35
  return typeof e == "function" && "type" in e && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it
@@ -185,7 +185,7 @@ function le(e = {}) {
185
185
  }
186
186
  function H(e) {
187
187
  const t = typeof e;
188
- return e == null || t === "string" || t === "boolean" || t === "number" || Array.isArray(e) || q(e);
188
+ return e == null || t === "string" || t === "boolean" || t === "number" || Array.isArray(e) || P(e);
189
189
  }
190
190
  function j(e, t = "", n = H, r, s = [], c) {
191
191
  let i;
@@ -233,7 +233,7 @@ function fe(e = {}) {
233
233
  disableCache: d = !1
234
234
  } = e, o = !d && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;
235
235
  return (l) => (p) => (f) => {
236
- if (!P(f))
236
+ if (!q(f))
237
237
  return p(f);
238
238
  const m = p(f), g = U(i, "SerializableStateInvariantMiddleware");
239
239
  return !a && !(r.length && r.indexOf(f.type) !== -1) && g.measureTime(() => {
@@ -340,7 +340,7 @@ function Pe(e) {
340
340
  let a;
341
341
  if (typeof n == "function")
342
342
  a = n;
343
- else if (q(n))
343
+ else if (P(n))
344
344
  a = Z(n);
345
345
  else
346
346
  throw new Error(process.env.NODE_ENV === "production" ? w(1) : "`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");
@@ -864,13 +864,13 @@ export {
864
864
  j as findNonSerializableValue,
865
865
  w as formatProdErrorMessage,
866
866
  Xe as freeze,
867
- P as isAction,
867
+ q as isAction,
868
868
  ae as isActionCreator,
869
869
  Ne as isAnyOf,
870
870
  re as isDraft,
871
871
  ue as isImmutableDefault,
872
872
  H as isPlain,
873
- q as isPlainObject,
873
+ P as isPlainObject,
874
874
  Oe as miniSerializeError,
875
875
  De as nanoid,
876
876
  _e as unwrapResult
@@ -1,135 +1,246 @@
1
- import * as o from "react";
2
- import { w as D } from "../../../_virtual/with-selector.js";
3
- var T = /* @__PURE__ */ Symbol.for("react-redux-context"), V = typeof globalThis < "u" ? globalThis : (
1
+ import * as i from "react";
2
+ import { w as V } from "../../../_virtual/with-selector.js";
3
+ function T(n) {
4
+ n();
5
+ }
6
+ function L() {
7
+ let n = null, o = null;
8
+ return {
9
+ clear() {
10
+ n = null, o = null;
11
+ },
12
+ notify() {
13
+ T(() => {
14
+ let e = n;
15
+ for (; e; )
16
+ e.callback(), e = e.next;
17
+ });
18
+ },
19
+ get() {
20
+ const e = [];
21
+ let t = n;
22
+ for (; t; )
23
+ e.push(t), t = t.next;
24
+ return e;
25
+ },
26
+ subscribe(e) {
27
+ let t = !0;
28
+ const r = o = {
29
+ callback: e,
30
+ next: null,
31
+ prev: o
32
+ };
33
+ return r.prev ? r.prev.next = r : n = r, function() {
34
+ !t || n === null || (t = !1, r.next ? r.next.prev = r.prev : o = r.prev, r.prev ? r.prev.next = r.next : n = r.next);
35
+ };
36
+ }
37
+ };
38
+ }
39
+ var k = {
40
+ notify() {
41
+ },
42
+ get: () => []
43
+ };
44
+ function M(n, o) {
45
+ let e, t = k, r = 0, s = !1;
46
+ function f(w) {
47
+ u();
48
+ const g = t.subscribe(w);
49
+ let y = !1;
50
+ return () => {
51
+ y || (y = !0, g(), b());
52
+ };
53
+ }
54
+ function d() {
55
+ t.notify();
56
+ }
57
+ function c() {
58
+ a.onStateChange && a.onStateChange();
59
+ }
60
+ function p() {
61
+ return s;
62
+ }
63
+ function u() {
64
+ r++, e || (e = n.subscribe(c), t = L());
65
+ }
66
+ function b() {
67
+ r--, e && r === 0 && (e(), e = void 0, t.clear(), t = k);
68
+ }
69
+ function S() {
70
+ s || (s = !0, u());
71
+ }
72
+ function h() {
73
+ s && (s = !1, b());
74
+ }
75
+ const a = {
76
+ addNestedSub: f,
77
+ notifyNestedSubs: d,
78
+ handleChangeWrapper: c,
79
+ isSubscribed: p,
80
+ trySubscribe: S,
81
+ tryUnsubscribe: h,
82
+ getListeners: () => t
83
+ };
84
+ return a;
85
+ }
86
+ var j = () => typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", U = /* @__PURE__ */ j(), _ = () => typeof navigator < "u" && navigator.product === "ReactNative", H = /* @__PURE__ */ _(), I = () => U || H ? i.useLayoutEffect : i.useEffect, P = /* @__PURE__ */ I(), z = /* @__PURE__ */ Symbol.for("react-redux-context"), O = typeof globalThis < "u" ? globalThis : (
4
87
  /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
5
88
  {}
6
89
  );
7
- function j() {
8
- if (!o.createContext) return {};
9
- const e = V[T] ??= /* @__PURE__ */ new Map();
10
- let t = e.get(o.createContext);
11
- return t || (t = o.createContext(
90
+ function Y() {
91
+ if (!i.createContext) return {};
92
+ const n = O[z] ??= /* @__PURE__ */ new Map();
93
+ let o = n.get(i.createContext);
94
+ return o || (o = i.createContext(
12
95
  null
13
- ), process.env.NODE_ENV !== "production" && (t.displayName = "ReactRedux"), e.set(o.createContext, t)), t;
96
+ ), process.env.NODE_ENV !== "production" && (o.displayName = "ReactRedux"), n.set(i.createContext, o)), o;
97
+ }
98
+ var l = /* @__PURE__ */ Y();
99
+ function F(n) {
100
+ const { children: o, context: e, serverState: t, store: r } = n, s = i.useMemo(() => {
101
+ const c = M(r), p = {
102
+ store: r,
103
+ subscription: c,
104
+ getServerState: t ? () => t : void 0
105
+ };
106
+ if (process.env.NODE_ENV === "production")
107
+ return p;
108
+ {
109
+ const { identityFunctionCheck: u = "once", stabilityCheck: b = "once" } = n;
110
+ return /* @__PURE__ */ Object.assign(p, {
111
+ stabilityCheck: b,
112
+ identityFunctionCheck: u
113
+ });
114
+ }
115
+ }, [r, t]), f = i.useMemo(() => r.getState(), [r]);
116
+ P(() => {
117
+ const { subscription: c } = s;
118
+ return c.onStateChange = c.notifyNestedSubs, c.trySubscribe(), f !== r.getState() && c.notifyNestedSubs(), () => {
119
+ c.tryUnsubscribe(), c.onStateChange = void 0;
120
+ };
121
+ }, [s, f]);
122
+ const d = e || l;
123
+ return /* @__PURE__ */ i.createElement(d.Provider, { value: s }, o);
14
124
  }
15
- var s = /* @__PURE__ */ j();
16
- function h(e = s) {
125
+ var G = F;
126
+ function m(n = l) {
17
127
  return function() {
18
- const n = o.useContext(e);
19
- if (process.env.NODE_ENV !== "production" && !n)
128
+ const e = i.useContext(n);
129
+ if (process.env.NODE_ENV !== "production" && !e)
20
130
  throw new Error(
21
131
  "could not find react-redux context value; please ensure the component is wrapped in a <Provider>"
22
132
  );
23
- return n;
133
+ return e;
24
134
  };
25
135
  }
26
- var m = /* @__PURE__ */ h();
27
- function C(e = s) {
28
- const t = e === s ? m : (
136
+ var N = /* @__PURE__ */ m();
137
+ function R(n = l) {
138
+ const o = n === l ? N : (
29
139
  // @ts-ignore
30
- h(e)
31
- ), n = () => {
32
- const { store: r } = t();
33
- return r;
140
+ m(n)
141
+ ), e = () => {
142
+ const { store: t } = o();
143
+ return t;
34
144
  };
35
- return Object.assign(n, {
36
- withTypes: () => n
37
- }), n;
145
+ return Object.assign(e, {
146
+ withTypes: () => e
147
+ }), e;
38
148
  }
39
- var H = /* @__PURE__ */ C();
40
- function _(e = s) {
41
- const t = e === s ? H : C(e), n = () => t().dispatch;
42
- return Object.assign(n, {
43
- withTypes: () => n
44
- }), n;
149
+ var W = /* @__PURE__ */ R();
150
+ function A(n = l) {
151
+ const o = n === l ? W : R(n), e = () => o().dispatch;
152
+ return Object.assign(e, {
153
+ withTypes: () => e
154
+ }), e;
45
155
  }
46
- var F = /* @__PURE__ */ _(), z = (e, t) => e === t;
47
- function M(e = s) {
48
- const t = e === s ? m : h(e), n = (r, a = {}) => {
49
- const { equalityFn: f = z } = typeof a == "function" ? { equalityFn: a } : a;
156
+ var J = /* @__PURE__ */ A(), B = (n, o) => n === o;
157
+ function K(n = l) {
158
+ const o = n === l ? N : m(n), e = (t, r = {}) => {
159
+ const { equalityFn: s = B } = typeof r == "function" ? { equalityFn: r } : r;
50
160
  if (process.env.NODE_ENV !== "production") {
51
- if (!r)
161
+ if (!t)
52
162
  throw new Error("You must pass a selector to useSelector");
53
- if (typeof r != "function")
163
+ if (typeof t != "function")
54
164
  throw new Error("You must pass a function as a selector to useSelector");
55
- if (typeof f != "function")
165
+ if (typeof s != "function")
56
166
  throw new Error(
57
167
  "You must pass a function as an equality function to useSelector"
58
168
  );
59
169
  }
60
- const p = t(), { store: w, subscription: v, getServerState: g } = p, u = o.useRef(!0), k = o.useCallback(
170
+ const f = o(), { store: d, subscription: c, getServerState: p } = f, u = i.useRef(!0), b = i.useCallback(
61
171
  {
62
- [r.name](i) {
63
- const l = r(i);
172
+ [t.name](h) {
173
+ const a = t(h);
64
174
  if (process.env.NODE_ENV !== "production") {
65
- const { devModeChecks: E = {} } = typeof a == "function" ? {} : a, { identityFunctionCheck: b, stabilityCheck: R } = p, {
66
- identityFunctionCheck: y,
67
- stabilityCheck: S
175
+ const { devModeChecks: w = {} } = typeof r == "function" ? {} : r, { identityFunctionCheck: g, stabilityCheck: y } = f, {
176
+ identityFunctionCheck: C,
177
+ stabilityCheck: E
68
178
  } = {
69
- stabilityCheck: R,
70
- identityFunctionCheck: b,
71
- ...E
179
+ stabilityCheck: y,
180
+ identityFunctionCheck: g,
181
+ ...w
72
182
  };
73
- if (S === "always" || S === "once" && u.current) {
74
- const c = r(i);
75
- if (!f(l, c)) {
76
- let d;
183
+ if (E === "always" || E === "once" && u.current) {
184
+ const v = t(h);
185
+ if (!s(a, v)) {
186
+ let x;
77
187
  try {
78
188
  throw new Error();
79
- } catch (N) {
80
- ({ stack: d } = N);
189
+ } catch (D) {
190
+ ({ stack: x } = D);
81
191
  }
82
192
  console.warn(
83
- "Selector " + (r.name || "unknown") + ` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
193
+ "Selector " + (t.name || "unknown") + ` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
84
194
  Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,
85
195
  {
86
- state: i,
87
- selected: l,
88
- selected2: c,
89
- stack: d
196
+ state: h,
197
+ selected: a,
198
+ selected2: v,
199
+ stack: x
90
200
  }
91
201
  );
92
202
  }
93
203
  }
94
- if ((y === "always" || y === "once" && u.current) && l === i) {
95
- let c;
204
+ if ((C === "always" || C === "once" && u.current) && a === h) {
205
+ let v;
96
206
  try {
97
207
  throw new Error();
98
- } catch (d) {
99
- ({ stack: c } = d);
208
+ } catch (x) {
209
+ ({ stack: v } = x);
100
210
  }
101
211
  console.warn(
102
- "Selector " + (r.name || "unknown") + ` returned the root state when called. This can lead to unnecessary rerenders.
212
+ "Selector " + (t.name || "unknown") + ` returned the root state when called. This can lead to unnecessary rerenders.
103
213
  Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,
104
- { stack: c }
214
+ { stack: v }
105
215
  );
106
216
  }
107
217
  u.current && (u.current = !1);
108
218
  }
109
- return l;
219
+ return a;
110
220
  }
111
- }[r.name],
112
- [r]
113
- ), x = D.useSyncExternalStoreWithSelector(
114
- v.addNestedSub,
115
- w.getState,
116
- g || w.getState,
117
- k,
118
- f
221
+ }[t.name],
222
+ [t]
223
+ ), S = V.useSyncExternalStoreWithSelector(
224
+ c.addNestedSub,
225
+ d.getState,
226
+ p || d.getState,
227
+ b,
228
+ s
119
229
  );
120
- return o.useDebugValue(x), x;
230
+ return i.useDebugValue(S), S;
121
231
  };
122
- return Object.assign(n, {
123
- withTypes: () => n
124
- }), n;
232
+ return Object.assign(e, {
233
+ withTypes: () => e
234
+ }), e;
125
235
  }
126
- var I = /* @__PURE__ */ M();
236
+ var Q = /* @__PURE__ */ K();
127
237
  export {
128
- s as ReactReduxContext,
129
- _ as createDispatchHook,
130
- M as createSelectorHook,
131
- C as createStoreHook,
132
- F as useDispatch,
133
- I as useSelector,
134
- H as useStore
238
+ G as Provider,
239
+ l as ReactReduxContext,
240
+ A as createDispatchHook,
241
+ K as createSelectorHook,
242
+ R as createStoreHook,
243
+ J as useDispatch,
244
+ Q as useSelector,
245
+ W as useStore
135
246
  };
@@ -0,0 +1,7 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { Provider as t } from "../../../node_modules/react-redux/dist/react-redux.js";
3
+ import { store as e } from "../store/store.js";
4
+ const f = ({ children: r }) => /* @__PURE__ */ o(t, { store: e, children: r });
5
+ export {
6
+ f as default
7
+ };
@@ -1,14 +1,14 @@
1
- import { configureStore as o } from "../../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js";
2
- import { useSelector as t, useDispatch as r } from "../../../node_modules/react-redux/dist/react-redux.js";
3
- import p from "./rootReducer.js";
4
- const s = {}, { NODE_ENV: c } = s;
5
- o({
6
- reducer: p,
1
+ import { configureStore as t } from "../../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js";
2
+ import { useSelector as o, useDispatch as r } from "../../../node_modules/react-redux/dist/react-redux.js";
3
+ import s from "./rootReducer.js";
4
+ const p = {}, { NODE_ENV: c } = p, n = t({
5
+ reducer: s,
7
6
  middleware: (e) => e({ thunk: !0 }),
8
7
  devTools: c !== "production"
9
- });
10
- const n = r.withTypes(), _ = t.withTypes();
8
+ }), _ = r.withTypes(), d = o.withTypes();
11
9
  export {
12
- n as useAppDispatch,
13
- _ as useAppSelector
10
+ n as default,
11
+ n as store,
12
+ _ as useAppDispatch,
13
+ d as useAppSelector
14
14
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hasting-swatchcart-module",
3
3
  "private": false,
4
- "version": "0.0.3",
4
+ "version": "0.0.41",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",