@lls/store 24.1.63-f76b7e8c → 24.1.63
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/lib/index.js +5 -24
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -747,12 +747,12 @@ import { makeEntitiesFilter } from "@lls/utils";
|
|
|
747
747
|
// src/selectors/crud.ts
|
|
748
748
|
init_define_import_meta();
|
|
749
749
|
import { createSearchSelector, makeGetAllEntities, makeGetEntityById } from "@lls/utils";
|
|
750
|
-
var crud = (entityName, { search:
|
|
750
|
+
var crud = (entityName, { search: search24 }) => {
|
|
751
751
|
const getElements = makeGetAllEntities(entityName);
|
|
752
752
|
const makeSearchElements = () => createSearchSelector(
|
|
753
753
|
getElements,
|
|
754
754
|
(_state, params) => params,
|
|
755
|
-
(elements, params) =>
|
|
755
|
+
(elements, params) => search24(params)(elements)
|
|
756
756
|
);
|
|
757
757
|
const methodName = `${entityName.charAt(0).toUpperCase()}${entityName.slice(1)}`;
|
|
758
758
|
const getElementById = makeGetEntityById(entityName);
|
|
@@ -761,7 +761,7 @@ var crud = (entityName, { search: search25 }) => {
|
|
|
761
761
|
[`search${methodName}`]: makeSearchElements(),
|
|
762
762
|
[`get${methodName.replace(/s$/, "")}`]: getElementById,
|
|
763
763
|
[`makeSearch${methodName}`]: makeSearchElements,
|
|
764
|
-
[`filter${methodName}`]:
|
|
764
|
+
[`filter${methodName}`]: search24
|
|
765
765
|
};
|
|
766
766
|
return back;
|
|
767
767
|
};
|
|
@@ -814,7 +814,7 @@ var search2 = ({
|
|
|
814
814
|
_2.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _2.sortBy(sortByQuery) : _2.identity
|
|
815
815
|
);
|
|
816
816
|
};
|
|
817
|
-
var { getBooks, getBook, searchBooks, makeSearchBooks
|
|
817
|
+
var { getBooks, getBook, searchBooks, makeSearchBooks } = crud("books", {
|
|
818
818
|
search: search2
|
|
819
819
|
});
|
|
820
820
|
var makeSearchValidBooks = () => createSearchSelector2(makeSearchBooks(), (books) => _2.filter({ valid: true, hasNewDesign: true }, books));
|
|
@@ -1244,20 +1244,6 @@ var { getTools, getTool, searchTools, makeSearchTools } = crud("tools", {
|
|
|
1244
1244
|
search: search23
|
|
1245
1245
|
});
|
|
1246
1246
|
|
|
1247
|
-
// src/selectors/builderIo.ts
|
|
1248
|
-
init_define_import_meta();
|
|
1249
|
-
import { makeEntitiesFilter as makeEntitiesFilter23 } from "@lls/utils";
|
|
1250
|
-
var search24 = ({ modelIds, subjects, schoolTypes }) => makeEntitiesFilter23(
|
|
1251
|
-
{
|
|
1252
|
-
modelId: modelIds
|
|
1253
|
-
},
|
|
1254
|
-
subjects && ((builderIo2) => !!builderIo2?.data?.subjects?.some((x) => subjects.includes(x))),
|
|
1255
|
-
schoolTypes && ((builderIo2) => !!builderIo2?.data?.schoolTypes?.some((x) => schoolTypes.includes(x)))
|
|
1256
|
-
);
|
|
1257
|
-
var { getBuilderIos, getBuilderIo, searchBuilderIos, makeSearchBuilderIos } = crud("builderIos", {
|
|
1258
|
-
search: search24
|
|
1259
|
-
});
|
|
1260
|
-
|
|
1261
1247
|
// src/reducers/entities.ts
|
|
1262
1248
|
init_define_import_meta();
|
|
1263
1249
|
import { makeReducer } from "@lls/utils";
|
|
@@ -1392,7 +1378,7 @@ var copyNotification = new import_normalizr.schema.Entity("copyNotifications");
|
|
|
1392
1378
|
var quote = new import_normalizr.schema.Entity("quotes");
|
|
1393
1379
|
var group = new import_normalizr.schema.Entity("groups");
|
|
1394
1380
|
var analytic = new import_normalizr.schema.Entity("analytics");
|
|
1395
|
-
var contact = new import_normalizr.schema.Entity("
|
|
1381
|
+
var contact = new import_normalizr.schema.Entity("contact");
|
|
1396
1382
|
var collection = new import_normalizr.schema.Entity("collections");
|
|
1397
1383
|
var sharedPage = new import_normalizr.schema.Entity("sharedPages");
|
|
1398
1384
|
var student = new import_normalizr.schema.Entity("students");
|
|
@@ -1562,14 +1548,11 @@ var normalizeData = _16.flow((data) => (0, import_normalizr.normalize)(data, que
|
|
|
1562
1548
|
export {
|
|
1563
1549
|
auth_default as authReducer,
|
|
1564
1550
|
entities_default as entitiesReducer,
|
|
1565
|
-
filterBooks,
|
|
1566
1551
|
filterPages,
|
|
1567
1552
|
getAllNews,
|
|
1568
1553
|
getAuth,
|
|
1569
1554
|
getBook,
|
|
1570
1555
|
getBooks,
|
|
1571
|
-
getBuilderIo,
|
|
1572
|
-
getBuilderIos,
|
|
1573
1556
|
getChapter,
|
|
1574
1557
|
getChapters,
|
|
1575
1558
|
getCollection,
|
|
@@ -1621,7 +1604,6 @@ export {
|
|
|
1621
1604
|
makeGetBook,
|
|
1622
1605
|
makeGetDraftPage,
|
|
1623
1606
|
makeSearchBooks,
|
|
1624
|
-
makeSearchBuilderIos,
|
|
1625
1607
|
makeSearchChapters,
|
|
1626
1608
|
makeSearchCollections,
|
|
1627
1609
|
makeSearchCommunityProjects,
|
|
@@ -1649,7 +1631,6 @@ export {
|
|
|
1649
1631
|
normalizeData,
|
|
1650
1632
|
querySchema,
|
|
1651
1633
|
searchBooks,
|
|
1652
|
-
searchBuilderIos,
|
|
1653
1634
|
searchChapters,
|
|
1654
1635
|
searchCollections,
|
|
1655
1636
|
searchCommunityProjects,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@lls/store",
|
|
3
3
|
"description": "model de donnée et selecteurs",
|
|
4
4
|
"homepage": "https://github.com/lelivrescolaire/monorepo/tree/dev/libs/store",
|
|
5
|
-
"version": "24.1.63
|
|
5
|
+
"version": "24.1.63",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./lib/builttypes/store/src/index.d.ts",
|
|
8
8
|
"exports": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"vite": "5.4.6",
|
|
42
42
|
"vite-tsconfig-paths": "4.3.2",
|
|
43
43
|
"vitest": "2.1.1",
|
|
44
|
-
"@lls/utils": "24.1.63
|
|
45
|
-
"@lls/vitescripts": "24.1.63
|
|
44
|
+
"@lls/utils": "24.1.63",
|
|
45
|
+
"@lls/vitescripts": "24.1.63"
|
|
46
46
|
},
|
|
47
47
|
"license": "ISC",
|
|
48
48
|
"dependencies": {
|