hasting-swatchcart-module 0.0.4 → 0.0.6
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 +7 -7
- package/dist/main.d.ts +1 -1
- package/dist/main.js +5 -1
- package/dist/src/app/store/rootReducer.js +8 -8
- package/dist/src/app/store/store.js +10 -10
- package/dist/src/features/Cart/model/cartSlice.js +1 -1
- package/dist/src/features/Cart/model/selectors.js +1 -1
- package/dist/src/features/MultiProduct/model/multiProductCartSlice.js +1 -1
- package/dist/src/features/MultiProduct/model/selectors.js +1 -1
- package/dist/src/features/swatches/model/swatchesSlice.js +28 -29
- package/dist/src/features/swatches/model/thunks.js +1 -1
- package/dist/store/LibraryProvider.d.ts +4 -0
- package/dist/store/LibraryProvider.js +9 -0
- package/dist/store/rootReducer.d.ts +11 -0
- package/dist/store/rootReducer.js +12 -0
- package/dist/store/store.d.ts +25 -0
- package/dist/store/store.js +17 -0
- package/dist/store/withStore.d.ts +2 -0
- package/dist/store/withStore.js +9 -0
- package/package.json +1 -1
- package/dist/_virtual/use-sync-external-store-with-selector.development.js +0 -4
- package/dist/_virtual/use-sync-external-store-with-selector.production.js +0 -4
- package/dist/_virtual/with-selector.js +0 -5
- package/dist/_virtual/with-selector2.js +0 -4
- package/dist/node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js +0 -877
- package/dist/node_modules/immer/dist/immer.js +0 -467
- package/dist/node_modules/react-redux/dist/react-redux.js +0 -246
- package/dist/node_modules/redux/dist/redux.js +0 -258
- package/dist/node_modules/redux-thunk/dist/redux-thunk.js +0 -8
- package/dist/node_modules/reselect/dist/reselect.js +0 -244
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +0 -66
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +0 -65
- package/dist/node_modules/use-sync-external-store/with-selector.js +0 -10
- package/dist/src/app/providers/StoreProvider.js +0 -7
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as r, jsxs as n, Fragment as u } from "react/jsx-runtime";
|
|
2
|
-
import s from "../src/app/
|
|
3
|
-
import { useAppSelector as c } from "../src/app/store/store.js";
|
|
2
|
+
import { useAppSelector as s } from "../src/app/store/store.js";
|
|
4
3
|
import { EDataInputType as e } from "../src/features/DataAdapter/utils/types.js";
|
|
5
|
-
import { MultiProductWrapper as
|
|
6
|
-
import { getIsOpenSidebar as
|
|
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";
|
|
7
6
|
import { Swatches as a } from "../src/features/swatches/ui/Swatches.js";
|
|
7
|
+
import { LibraryProvider as d } from "../store/LibraryProvider.js";
|
|
8
8
|
const P = ({
|
|
9
9
|
isOpen: p,
|
|
10
10
|
uiDataType: o,
|
|
@@ -12,9 +12,9 @@ const P = ({
|
|
|
12
12
|
onToggleSidebar: i,
|
|
13
13
|
onSendData: t
|
|
14
14
|
}) => {
|
|
15
|
-
const l =
|
|
16
|
-
return /* @__PURE__ */ r(
|
|
17
|
-
o === e.DATA_ALL_PRODUCT ? /* @__PURE__ */ r(
|
|
15
|
+
const l = s(f);
|
|
16
|
+
return /* @__PURE__ */ r(d, { children: l ? /* @__PURE__ */ n(u, { children: [
|
|
17
|
+
o === e.DATA_ALL_PRODUCT ? /* @__PURE__ */ r(c, { onSendData: t }) : null,
|
|
18
18
|
o === e.UI ? /* @__PURE__ */ r(
|
|
19
19
|
a,
|
|
20
20
|
{
|
package/dist/main.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { LibraryProvider as c } from "./store/LibraryProvider.js";
|
|
2
|
+
import { withStore as o } from "./store/withStore.js";
|
|
1
3
|
import { SwatchModule as r } from "./components/SwatchesModule.js";
|
|
4
|
+
const a = o(r);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
c as LibraryProvider,
|
|
7
|
+
a as SwatchModule
|
|
4
8
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const d =
|
|
6
|
-
swatches:
|
|
7
|
-
cart:
|
|
8
|
-
multiProductCart:
|
|
1
|
+
import { combineReducers as r } from "@reduxjs/toolkit";
|
|
2
|
+
import { swatchesReducer as t } from "../../features/swatches/model/swatchesSlice.js";
|
|
3
|
+
import { cartReducer as e } from "../../features/Cart/model/cartSlice.js";
|
|
4
|
+
import { multiProductCartReducer as o } from "../../features/MultiProduct/model/multiProductCartSlice.js";
|
|
5
|
+
const d = r({
|
|
6
|
+
swatches: t,
|
|
7
|
+
cart: e,
|
|
8
|
+
multiProductCart: o
|
|
9
9
|
});
|
|
10
10
|
export {
|
|
11
11
|
d as default
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { configureStore as
|
|
2
|
-
import { useSelector as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { configureStore as o } from "@reduxjs/toolkit";
|
|
2
|
+
import { useSelector as t, useDispatch as r } from "react-redux";
|
|
3
|
+
import p from "./rootReducer.js";
|
|
4
|
+
const s = {}, { NODE_ENV: c } = s;
|
|
5
|
+
o({
|
|
6
|
+
reducer: p,
|
|
6
7
|
middleware: (e) => e({ thunk: !0 }),
|
|
7
8
|
devTools: c !== "production"
|
|
8
|
-
})
|
|
9
|
+
});
|
|
10
|
+
const n = r.withTypes(), _ = t.withTypes();
|
|
9
11
|
export {
|
|
10
|
-
n as
|
|
11
|
-
|
|
12
|
-
_ as useAppDispatch,
|
|
13
|
-
d as useAppSelector
|
|
12
|
+
n as useAppDispatch,
|
|
13
|
+
_ as useAppSelector
|
|
14
14
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSlice as u } from "
|
|
1
|
+
import { createSlice as u } from "@reduxjs/toolkit";
|
|
2
2
|
import { MAX_SLOTS as l } from "../../../shared/constants/selectedMaterials.js";
|
|
3
3
|
const f = { items: [] }, b = (e) => e.reduce((t, m) => t + m.count, 0), o = u({
|
|
4
4
|
name: "cart",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSelector as e } from "
|
|
1
|
+
import { createSelector as e } from "@reduxjs/toolkit";
|
|
2
2
|
import { MAX_SLOTS as a } from "../../../shared/constants/selectedMaterials.js";
|
|
3
3
|
const c = (t) => t.cart.items, n = e(
|
|
4
4
|
c,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSlice as a } from "
|
|
1
|
+
import { createSlice as a } from "@reduxjs/toolkit";
|
|
2
2
|
const l = { items: [], activeMultiCartProduct: null };
|
|
3
3
|
function p(t, e, c) {
|
|
4
4
|
let i = t.items.find((d) => d.productId === e);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSelector as c } from "
|
|
1
|
+
import { createSelector as c } from "@reduxjs/toolkit";
|
|
2
2
|
const o = (t) => t.multiProductCart, a = (t) => t.multiProductCart.items, s = (t) => c(o, (e) => e.items.find((r) => r.productId === t)?.items ?? []), d = (t) => t.multiProductCart.activeMultiCartProduct;
|
|
3
3
|
export {
|
|
4
4
|
d as getActiveMultiCartProduct,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { createSlice as o } from "
|
|
1
|
+
import { createSlice as o, current as n } from "@reduxjs/toolkit";
|
|
2
2
|
import { SwatchesServices as c } from "../lib/SwatchesServices.js";
|
|
3
|
-
import { uniqueList as
|
|
3
|
+
import { uniqueList as u } from "../../../shared/utils/uniqueList.js";
|
|
4
4
|
import { getProductListThunk as i } from "./thunks.js";
|
|
5
|
-
import { current as u } from "../../../../node_modules/immer/dist/immer.js";
|
|
6
5
|
const p = {
|
|
7
6
|
isOpenSidebar: !0,
|
|
8
7
|
listAttributes: [],
|
|
@@ -28,7 +27,7 @@ const p = {
|
|
|
28
27
|
e.materialSelectState[l] = [];
|
|
29
28
|
return;
|
|
30
29
|
}
|
|
31
|
-
e.materialSelectState[l] =
|
|
30
|
+
e.materialSelectState[l] = u(a);
|
|
32
31
|
},
|
|
33
32
|
setPanelFilter(e, t) {
|
|
34
33
|
const l = t.payload.attributes;
|
|
@@ -52,7 +51,7 @@ const p = {
|
|
|
52
51
|
setSelectedMaterials(e, t) {
|
|
53
52
|
const { selectedMaterial: l } = t.payload;
|
|
54
53
|
if (!l) return;
|
|
55
|
-
const a =
|
|
54
|
+
const a = n(e.selectedMaterials), r = (s) => s.metadata?.label === l.metadata?.label && s.parentName === l.parentName;
|
|
56
55
|
a.some(r) ? e.selectedMaterials = a.filter((s) => !r(s)) : a.length < 5 && (e.selectedMaterials = [...a, l]);
|
|
57
56
|
},
|
|
58
57
|
resetSelectedMaterials(e) {
|
|
@@ -77,32 +76,32 @@ const p = {
|
|
|
77
76
|
t.isLoadingProductList = !1;
|
|
78
77
|
});
|
|
79
78
|
}
|
|
80
|
-
}),
|
|
79
|
+
}), P = d.reducer, {
|
|
81
80
|
// setListAttributes,
|
|
82
|
-
setMaterialSelect:
|
|
83
|
-
setAllMaterialsOptions:
|
|
84
|
-
setPanelFilter:
|
|
85
|
-
setSelectedMaterials:
|
|
86
|
-
toggleSidebar:
|
|
87
|
-
clearMaterialFilter:
|
|
88
|
-
clearAllMaterialFilters:
|
|
89
|
-
setSelectedProduct:
|
|
90
|
-
deleteSelectedProduct:
|
|
91
|
-
setIsOpenMultiProductCart:
|
|
92
|
-
resetSelectedMaterials:
|
|
81
|
+
setMaterialSelect: L,
|
|
82
|
+
setAllMaterialsOptions: h,
|
|
83
|
+
setPanelFilter: O,
|
|
84
|
+
setSelectedMaterials: b,
|
|
85
|
+
toggleSidebar: y,
|
|
86
|
+
clearMaterialFilter: C,
|
|
87
|
+
clearAllMaterialFilters: F,
|
|
88
|
+
setSelectedProduct: A,
|
|
89
|
+
deleteSelectedProduct: V,
|
|
90
|
+
setIsOpenMultiProductCart: w,
|
|
91
|
+
resetSelectedMaterials: x
|
|
93
92
|
} = d.actions;
|
|
94
93
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
F as clearAllMaterialFilters,
|
|
95
|
+
C as clearMaterialFilter,
|
|
96
|
+
V as deleteSelectedProduct,
|
|
97
|
+
x as resetSelectedMaterials,
|
|
98
|
+
h as setAllMaterialsOptions,
|
|
99
|
+
w as setIsOpenMultiProductCart,
|
|
100
|
+
L as setMaterialSelect,
|
|
101
|
+
O as setPanelFilter,
|
|
102
|
+
b as setSelectedMaterials,
|
|
103
|
+
A as setSelectedProduct,
|
|
104
|
+
P as swatchesReducer,
|
|
106
105
|
d as swatchesSlice,
|
|
107
|
-
|
|
106
|
+
y as toggleSidebar
|
|
108
107
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createAsyncThunk as o } from "
|
|
1
|
+
import { createAsyncThunk as o } from "@reduxjs/toolkit";
|
|
2
2
|
import { getProductListAPI as c, getSelectedProductAPI as n } from "../../MultiProduct/model/API/api.js";
|
|
3
3
|
const d = o("multiProducts/getProductListThunk", async (s, { rejectWithValue: t }) => {
|
|
4
4
|
try {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Provider as t } from "react-redux";
|
|
3
|
+
import { getStore as e } from "./store.js";
|
|
4
|
+
function p({ children: r }) {
|
|
5
|
+
return /* @__PURE__ */ o(t, { store: e(), children: r });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
p as LibraryProvider
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const rootReducer: import('redux').Reducer<{
|
|
2
|
+
swatches: import('../../src/features/swatches/model/types').ISwatchesSlice;
|
|
3
|
+
cart: import('../../src/features/Cart/model/types').CartState;
|
|
4
|
+
multiProductCart: import('../../src/features/MultiProduct/model/types').CartState;
|
|
5
|
+
}, import('redux').UnknownAction, Partial<{
|
|
6
|
+
swatches: import('../../src/features/swatches/model/types').ISwatchesSlice | undefined;
|
|
7
|
+
cart: import('../../src/features/Cart/model/types').CartState | undefined;
|
|
8
|
+
multiProductCart: import('../../src/features/MultiProduct/model/types').CartState | undefined;
|
|
9
|
+
}>>;
|
|
10
|
+
export type RootState = ReturnType<typeof rootReducer>;
|
|
11
|
+
export default rootReducer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { combineReducers as r } from "@reduxjs/toolkit";
|
|
2
|
+
import { swatchesReducer as t } from "../src/features/swatches/model/swatchesSlice.js";
|
|
3
|
+
import { cartReducer as e } from "../src/features/Cart/model/cartSlice.js";
|
|
4
|
+
import { multiProductCartReducer as o } from "../src/features/MultiProduct/model/multiProductCartSlice.js";
|
|
5
|
+
const d = r({
|
|
6
|
+
swatches: t,
|
|
7
|
+
cart: e,
|
|
8
|
+
multiProductCart: o
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
d as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const getStore: () => import('@reduxjs/toolkit').EnhancedStore<{
|
|
2
|
+
swatches: import('../../src/features/swatches/model/types').ISwatchesSlice;
|
|
3
|
+
cart: import('../../src/features/Cart/model/types').CartState;
|
|
4
|
+
multiProductCart: import('../../src/features/MultiProduct/model/types').CartState;
|
|
5
|
+
}, import('redux').UnknownAction, import('@reduxjs/toolkit').Tuple<[import('redux').StoreEnhancer<{
|
|
6
|
+
dispatch: import('redux-thunk').ThunkDispatch<{
|
|
7
|
+
swatches: import('../../src/features/swatches/model/types').ISwatchesSlice;
|
|
8
|
+
cart: import('../../src/features/Cart/model/types').CartState;
|
|
9
|
+
multiProductCart: import('../../src/features/MultiProduct/model/types').CartState;
|
|
10
|
+
}, undefined, import('redux').UnknownAction>;
|
|
11
|
+
}>, import('redux').StoreEnhancer]>>;
|
|
12
|
+
type AppStore = ReturnType<typeof getStore>;
|
|
13
|
+
export type AppDispatch = AppStore['dispatch'];
|
|
14
|
+
export type RootState = ReturnType<AppStore['getState']>;
|
|
15
|
+
export declare const useAppDispatch: import('react-redux').UseDispatch<import('redux-thunk').ThunkDispatch<{
|
|
16
|
+
swatches: import('../../src/features/swatches/model/types').ISwatchesSlice;
|
|
17
|
+
cart: import('../../src/features/Cart/model/types').CartState;
|
|
18
|
+
multiProductCart: import('../../src/features/MultiProduct/model/types').CartState;
|
|
19
|
+
}, undefined, import('redux').UnknownAction> & import('redux').Dispatch<import('redux').UnknownAction>>;
|
|
20
|
+
export declare const useAppSelector: import('react-redux').UseSelector<{
|
|
21
|
+
swatches: import('../../src/features/swatches/model/types').ISwatchesSlice;
|
|
22
|
+
cart: import('../../src/features/Cart/model/types').CartState;
|
|
23
|
+
multiProductCart: import('../../src/features/MultiProduct/model/types').CartState;
|
|
24
|
+
}>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { configureStore as t } from "@reduxjs/toolkit";
|
|
2
|
+
import { useDispatch as o, useSelector as i } from "react-redux";
|
|
3
|
+
import u from "./rootReducer.js";
|
|
4
|
+
let e = null;
|
|
5
|
+
function s() {
|
|
6
|
+
return t({
|
|
7
|
+
reducer: u,
|
|
8
|
+
devTools: !1,
|
|
9
|
+
middleware: (r) => r({ thunk: !0 })
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const l = () => (e || (e = s()), e);
|
|
13
|
+
o.withTypes();
|
|
14
|
+
i.withTypes();
|
|
15
|
+
export {
|
|
16
|
+
l as getStore
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { LibraryProvider as o } from "./LibraryProvider.js";
|
|
3
|
+
function m(r) {
|
|
4
|
+
const e = (i) => /* @__PURE__ */ t(o, { children: /* @__PURE__ */ t(r, { ...i }) });
|
|
5
|
+
return e.displayName = `withStore(${r.displayName || r.name || "Component"})`, e;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
m as withStore
|
|
9
|
+
};
|
package/package.json
CHANGED