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.
- package/dist/components/SwatchesModule.js +16 -15
- package/dist/node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js +7 -7
- package/dist/node_modules/react-redux/dist/react-redux.js +195 -84
- package/dist/src/app/providers/StoreProvider.js +7 -0
- package/dist/src/app/store/store.js +10 -10
- package/package.json +1 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsx as r,
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
|
8
|
-
isOpen:
|
|
8
|
+
const P = ({
|
|
9
|
+
isOpen: p,
|
|
9
10
|
uiDataType: o,
|
|
10
|
-
data:
|
|
11
|
+
data: m,
|
|
11
12
|
onToggleSidebar: i,
|
|
12
13
|
onSendData: t
|
|
13
14
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */ r(
|
|
16
|
-
o ===
|
|
17
|
-
o ===
|
|
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:
|
|
21
|
+
isOpen: p,
|
|
21
22
|
uiDataType: "UI",
|
|
22
|
-
data:
|
|
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
|
-
|
|
31
|
+
P as SwatchModule
|
|
31
32
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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) =>
|
|
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) ||
|
|
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 (!
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import { w as
|
|
3
|
-
|
|
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
|
|
8
|
-
if (!
|
|
9
|
-
const
|
|
10
|
-
let
|
|
11
|
-
return
|
|
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" && (
|
|
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
|
|
16
|
-
function
|
|
125
|
+
var G = F;
|
|
126
|
+
function m(n = l) {
|
|
17
127
|
return function() {
|
|
18
|
-
const
|
|
19
|
-
if (process.env.NODE_ENV !== "production" && !
|
|
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
|
|
133
|
+
return e;
|
|
24
134
|
};
|
|
25
135
|
}
|
|
26
|
-
var
|
|
27
|
-
function
|
|
28
|
-
const
|
|
136
|
+
var N = /* @__PURE__ */ m();
|
|
137
|
+
function R(n = l) {
|
|
138
|
+
const o = n === l ? N : (
|
|
29
139
|
// @ts-ignore
|
|
30
|
-
|
|
31
|
-
),
|
|
32
|
-
const { store:
|
|
33
|
-
return
|
|
140
|
+
m(n)
|
|
141
|
+
), e = () => {
|
|
142
|
+
const { store: t } = o();
|
|
143
|
+
return t;
|
|
34
144
|
};
|
|
35
|
-
return Object.assign(
|
|
36
|
-
withTypes: () =>
|
|
37
|
-
}),
|
|
145
|
+
return Object.assign(e, {
|
|
146
|
+
withTypes: () => e
|
|
147
|
+
}), e;
|
|
38
148
|
}
|
|
39
|
-
var
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
return Object.assign(
|
|
43
|
-
withTypes: () =>
|
|
44
|
-
}),
|
|
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
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
const { equalityFn:
|
|
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 (!
|
|
161
|
+
if (!t)
|
|
52
162
|
throw new Error("You must pass a selector to useSelector");
|
|
53
|
-
if (typeof
|
|
163
|
+
if (typeof t != "function")
|
|
54
164
|
throw new Error("You must pass a function as a selector to useSelector");
|
|
55
|
-
if (typeof
|
|
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
|
|
170
|
+
const f = o(), { store: d, subscription: c, getServerState: p } = f, u = i.useRef(!0), b = i.useCallback(
|
|
61
171
|
{
|
|
62
|
-
[
|
|
63
|
-
const
|
|
172
|
+
[t.name](h) {
|
|
173
|
+
const a = t(h);
|
|
64
174
|
if (process.env.NODE_ENV !== "production") {
|
|
65
|
-
const { devModeChecks:
|
|
66
|
-
identityFunctionCheck:
|
|
67
|
-
stabilityCheck:
|
|
175
|
+
const { devModeChecks: w = {} } = typeof r == "function" ? {} : r, { identityFunctionCheck: g, stabilityCheck: y } = f, {
|
|
176
|
+
identityFunctionCheck: C,
|
|
177
|
+
stabilityCheck: E
|
|
68
178
|
} = {
|
|
69
|
-
stabilityCheck:
|
|
70
|
-
identityFunctionCheck:
|
|
71
|
-
...
|
|
179
|
+
stabilityCheck: y,
|
|
180
|
+
identityFunctionCheck: g,
|
|
181
|
+
...w
|
|
72
182
|
};
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
76
|
-
let
|
|
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 (
|
|
80
|
-
({ stack:
|
|
189
|
+
} catch (D) {
|
|
190
|
+
({ stack: x } = D);
|
|
81
191
|
}
|
|
82
192
|
console.warn(
|
|
83
|
-
"Selector " + (
|
|
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:
|
|
87
|
-
selected:
|
|
88
|
-
selected2:
|
|
89
|
-
stack:
|
|
196
|
+
state: h,
|
|
197
|
+
selected: a,
|
|
198
|
+
selected2: v,
|
|
199
|
+
stack: x
|
|
90
200
|
}
|
|
91
201
|
);
|
|
92
202
|
}
|
|
93
203
|
}
|
|
94
|
-
if ((
|
|
95
|
-
let
|
|
204
|
+
if ((C === "always" || C === "once" && u.current) && a === h) {
|
|
205
|
+
let v;
|
|
96
206
|
try {
|
|
97
207
|
throw new Error();
|
|
98
|
-
} catch (
|
|
99
|
-
({ stack:
|
|
208
|
+
} catch (x) {
|
|
209
|
+
({ stack: v } = x);
|
|
100
210
|
}
|
|
101
211
|
console.warn(
|
|
102
|
-
"Selector " + (
|
|
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:
|
|
214
|
+
{ stack: v }
|
|
105
215
|
);
|
|
106
216
|
}
|
|
107
217
|
u.current && (u.current = !1);
|
|
108
218
|
}
|
|
109
|
-
return
|
|
219
|
+
return a;
|
|
110
220
|
}
|
|
111
|
-
}[
|
|
112
|
-
[
|
|
113
|
-
),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
|
230
|
+
return i.useDebugValue(S), S;
|
|
121
231
|
};
|
|
122
|
-
return Object.assign(
|
|
123
|
-
withTypes: () =>
|
|
124
|
-
}),
|
|
232
|
+
return Object.assign(e, {
|
|
233
|
+
withTypes: () => e
|
|
234
|
+
}), e;
|
|
125
235
|
}
|
|
126
|
-
var
|
|
236
|
+
var Q = /* @__PURE__ */ K();
|
|
127
237
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
|
2
|
-
import { useSelector as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
|
|
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
|
|
13
|
-
|
|
10
|
+
n as default,
|
|
11
|
+
n as store,
|
|
12
|
+
_ as useAppDispatch,
|
|
13
|
+
d as useAppSelector
|
|
14
14
|
};
|