@lls/store 24.1.59-d1bfe110 → 24.1.59-e4bc5c16
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 +24 -339
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -198,7 +198,7 @@ var require_lib = __commonJS({
|
|
|
198
198
|
for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
199
199
|
memoizeOptionsFromArgs[_key - 1] = arguments[_key];
|
|
200
200
|
}
|
|
201
|
-
var
|
|
201
|
+
var createSelector3 = function createSelector4() {
|
|
202
202
|
for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
203
203
|
funcs[_key2] = arguments[_key2];
|
|
204
204
|
}
|
|
@@ -247,13 +247,13 @@ var require_lib = __commonJS({
|
|
|
247
247
|
});
|
|
248
248
|
return selector;
|
|
249
249
|
};
|
|
250
|
-
return
|
|
250
|
+
return createSelector3;
|
|
251
251
|
}
|
|
252
|
-
var
|
|
253
|
-
exports.createSelector =
|
|
252
|
+
var createSelector2 = /* @__PURE__ */ createSelectorCreator(_defaultMemoize.defaultMemoize);
|
|
253
|
+
exports.createSelector = createSelector2;
|
|
254
254
|
var createStructuredSelector = function createStructuredSelector2(selectors, selectorCreator) {
|
|
255
255
|
if (selectorCreator === void 0) {
|
|
256
|
-
selectorCreator =
|
|
256
|
+
selectorCreator = createSelector2;
|
|
257
257
|
}
|
|
258
258
|
if (typeof selectors !== "object") {
|
|
259
259
|
throw new Error("createStructuredSelector expects first argument to be an object " + ("where each property is a selector, instead received a " + typeof selectors));
|
|
@@ -741,12 +741,12 @@ import _ from "lodash/fp.js";
|
|
|
741
741
|
// src/selectors/crud.ts
|
|
742
742
|
init_define_import_meta();
|
|
743
743
|
import { createSearchSelector, makeGetAllEntities, makeGetEntityById } from "@lls/utils";
|
|
744
|
-
var crud = (entityName, { search:
|
|
744
|
+
var crud = (entityName, { search: search9 }) => {
|
|
745
745
|
const getElements = makeGetAllEntities(entityName);
|
|
746
746
|
const makeSearchElements = () => createSearchSelector(
|
|
747
747
|
getElements,
|
|
748
748
|
(_state, params) => params,
|
|
749
|
-
(elements, params) =>
|
|
749
|
+
(elements, params) => search9(params)(elements)
|
|
750
750
|
);
|
|
751
751
|
const methodName = `${entityName.charAt(0).toUpperCase()}${entityName.slice(1)}`;
|
|
752
752
|
const getElementById = makeGetEntityById(entityName);
|
|
@@ -989,7 +989,7 @@ import { createSearchSelector as createSearchSelector4, filterEntitiesSimpleFiel
|
|
|
989
989
|
import _10 from "lodash/fp.js";
|
|
990
990
|
var getCopyNotifications = makeGetAllEntities3("copyNotifications");
|
|
991
991
|
var makeSearchCopyNotifications = () => createSearchSelector4(
|
|
992
|
-
[getCurrentUser, getCopyNotifications, (
|
|
992
|
+
[getCurrentUser, getCopyNotifications, (_14, params) => params],
|
|
993
993
|
(currentUser, copyNotifications, { pageIds, read }) => _10.flow(
|
|
994
994
|
_10.get("copyNotifications"),
|
|
995
995
|
(ids) => _10.flow(
|
|
@@ -1001,268 +1001,10 @@ var makeSearchCopyNotifications = () => createSearchSelector4(
|
|
|
1001
1001
|
);
|
|
1002
1002
|
var searchCopyNotifications = makeSearchCopyNotifications();
|
|
1003
1003
|
|
|
1004
|
-
// src/selectors/drawerNotification.ts
|
|
1005
|
-
init_define_import_meta();
|
|
1006
|
-
import { createSearchSelector as createSearchSelector5, filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues8, makeGetAllEntities as makeGetAllEntities4 } from "@lls/utils";
|
|
1007
|
-
import _11 from "lodash/fp.js";
|
|
1008
|
-
var getDrawerNotifications = makeGetAllEntities4("drawerNotifications");
|
|
1009
|
-
var makeSearchDrawerNotifications = () => createSearchSelector5(
|
|
1010
|
-
[getCurrentUser, getDrawerNotifications, (_25, params) => params],
|
|
1011
|
-
(currentUser, drawerNotifications, { read, pageIds }) => _11.flow(
|
|
1012
|
-
_11.get("drawerNotifications"),
|
|
1013
|
-
(ids) => _11.flow(
|
|
1014
|
-
filterEntitiesSimpleFieldByValues8("id", ids),
|
|
1015
|
-
filterEntitiesSimpleFieldByValues8("read", _11.isNil(read) ? void 0 : [read]),
|
|
1016
|
-
filterEntitiesSimpleFieldByValues8("page", pageIds)
|
|
1017
|
-
)(drawerNotifications)
|
|
1018
|
-
)(currentUser)
|
|
1019
|
-
);
|
|
1020
|
-
var searchDrawerNotifications = makeSearchDrawerNotifications();
|
|
1021
|
-
|
|
1022
|
-
// src/selectors/faq.ts
|
|
1023
|
-
init_define_import_meta();
|
|
1024
|
-
import { makeGetAllEntities as makeGetAllEntities5 } from "@lls/utils";
|
|
1025
|
-
var getFaqs = makeGetAllEntities5("faq");
|
|
1026
|
-
|
|
1027
|
-
// src/selectors/garDivision.ts
|
|
1028
|
-
init_define_import_meta();
|
|
1029
|
-
import _12 from "lodash/fp.js";
|
|
1030
|
-
var search9 = (_params) => _12.identity;
|
|
1031
|
-
var { getGarDivisions, getGarDivision, searchGarDivisions, makeSearchGarDivisions } = crud("garDivisions", {
|
|
1032
|
-
search: search9
|
|
1033
|
-
});
|
|
1034
|
-
|
|
1035
|
-
// src/selectors/group.ts
|
|
1036
|
-
init_define_import_meta();
|
|
1037
|
-
var import_reselect2 = __toESM(require_lib(), 1);
|
|
1038
|
-
import { filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues9 } from "@lls/utils";
|
|
1039
|
-
import _13 from "lodash/fp.js";
|
|
1040
|
-
var search10 = ({ ownerIds }) => _13.flow(filterEntitiesSimpleFieldByValues9("owner", ownerIds), _13.orderBy("createdAt", ["desc"]));
|
|
1041
|
-
var { getGroups, getGroup, searchGroups, makeSearchGroups } = crud("groups", {
|
|
1042
|
-
search: search10
|
|
1043
|
-
});
|
|
1044
|
-
var getUserGroups = (0, import_reselect2.createSelector)(
|
|
1045
|
-
[getGroups, getCurrentUser],
|
|
1046
|
-
(groups, currentUser) => search10({ ownerIds: [currentUser?.id] })(groups)
|
|
1047
|
-
);
|
|
1048
|
-
|
|
1049
|
-
// src/selectors/level.ts
|
|
1050
|
-
init_define_import_meta();
|
|
1051
|
-
var import_reselect3 = __toESM(require_lib(), 1);
|
|
1052
|
-
import { filterEntitiesSimpleFieldByValue as filterEntitiesSimpleFieldByValue2, filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues10 } from "@lls/utils";
|
|
1053
|
-
import _14 from "lodash/fp.js";
|
|
1054
|
-
var search11 = ({
|
|
1055
|
-
ids,
|
|
1056
|
-
slugs,
|
|
1057
|
-
isPreSchool,
|
|
1058
|
-
isMiddleSchool,
|
|
1059
|
-
isHighSchool,
|
|
1060
|
-
isProHighSchool,
|
|
1061
|
-
isGenHighSchool,
|
|
1062
|
-
isElementarySchool
|
|
1063
|
-
}) => _14.flow(
|
|
1064
|
-
filterEntitiesSimpleFieldByValues10("id", ids),
|
|
1065
|
-
filterEntitiesSimpleFieldByValues10("slug", slugs),
|
|
1066
|
-
filterEntitiesSimpleFieldByValue2("isPreSchool", isPreSchool),
|
|
1067
|
-
filterEntitiesSimpleFieldByValue2("isMiddleSchool", isMiddleSchool),
|
|
1068
|
-
filterEntitiesSimpleFieldByValue2("isHighSchool", isHighSchool),
|
|
1069
|
-
filterEntitiesSimpleFieldByValue2("isProHighSchool", isProHighSchool),
|
|
1070
|
-
filterEntitiesSimpleFieldByValue2("isGenHighSchool", isGenHighSchool),
|
|
1071
|
-
filterEntitiesSimpleFieldByValue2("isElementarySchool", isElementarySchool),
|
|
1072
|
-
_14.orderBy("order", "desc")
|
|
1073
|
-
);
|
|
1074
|
-
var crudLevels = crud("levels", { search: search11 });
|
|
1075
|
-
var { getLevel, searchLevels, makeSearchLevels } = crudLevels;
|
|
1076
|
-
var getLevels = (0, import_reselect3.createSelector)(crudLevels.getLevels, _14.orderBy("order", "desc"));
|
|
1077
|
-
|
|
1078
|
-
// src/selectors/mainNotification.ts
|
|
1079
|
-
init_define_import_meta();
|
|
1080
|
-
var import_reselect4 = __toESM(require_lib(), 1);
|
|
1081
|
-
import { filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues11, makeGetAllEntities as makeGetAllEntities6 } from "@lls/utils";
|
|
1082
|
-
import _15 from "lodash/fp.js";
|
|
1083
|
-
var getAllMainNotifications = makeGetAllEntities6("mainNotifications");
|
|
1084
|
-
var search12 = ({ ids }) => _15.flow(filterEntitiesSimpleFieldByValues11("id", ids));
|
|
1085
|
-
var getMainNotifications = (0, import_reselect4.createSelector)(
|
|
1086
|
-
[_15.flow(getCurrentUser, _15.get("mainNotifications")), getAllMainNotifications],
|
|
1087
|
-
(userNotifications, notifications) => search12({ ids: userNotifications })(notifications)
|
|
1088
|
-
);
|
|
1089
|
-
|
|
1090
|
-
// src/selectors/news.ts
|
|
1091
|
-
init_define_import_meta();
|
|
1092
|
-
import { filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues12 } from "@lls/utils";
|
|
1093
|
-
var search13 = ({ ids }) => filterEntitiesSimpleFieldByValues12("id", ids);
|
|
1094
|
-
var {
|
|
1095
|
-
getNews: getAllNews,
|
|
1096
|
-
getNew: getNews,
|
|
1097
|
-
searchNews,
|
|
1098
|
-
makeSearchNews
|
|
1099
|
-
} = crud("news", {
|
|
1100
|
-
search: search13
|
|
1101
|
-
});
|
|
1102
|
-
|
|
1103
|
-
// src/selectors/panorama.ts
|
|
1104
|
-
init_define_import_meta();
|
|
1105
|
-
import { makeGetEntityById as makeGetEntityById4 } from "@lls/utils";
|
|
1106
|
-
var getPanorama = makeGetEntityById4("panoramas");
|
|
1107
|
-
|
|
1108
|
-
// src/selectors/premiumResource.ts
|
|
1109
|
-
init_define_import_meta();
|
|
1110
|
-
import { filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues13 } from "@lls/utils";
|
|
1111
|
-
var search14 = ({ bookIds }) => filterEntitiesSimpleFieldByValues13("book", bookIds);
|
|
1112
|
-
var { getPremiumResources, getPremiumResource, searchPremiumResources, makeSearchPremiumResources } = crud(
|
|
1113
|
-
"premiumResources",
|
|
1114
|
-
{
|
|
1115
|
-
search: search14
|
|
1116
|
-
}
|
|
1117
|
-
);
|
|
1118
|
-
|
|
1119
|
-
// src/selectors/product.ts
|
|
1120
|
-
init_define_import_meta();
|
|
1121
|
-
import _16 from "lodash/fp.js";
|
|
1122
|
-
import {
|
|
1123
|
-
createSearchSelector as createSearchSelector6,
|
|
1124
|
-
filterEntitiesArrayFieldByValues as filterEntitiesArrayFieldByValues5,
|
|
1125
|
-
filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues14,
|
|
1126
|
-
makeGetAllEntities as makeGetAllEntities7
|
|
1127
|
-
} from "@lls/utils";
|
|
1128
|
-
var getProducts = makeGetAllEntities7("products");
|
|
1129
|
-
var search15 = ({
|
|
1130
|
-
ids,
|
|
1131
|
-
eans,
|
|
1132
|
-
isAdoptant,
|
|
1133
|
-
isSupportPlus,
|
|
1134
|
-
levelIds,
|
|
1135
|
-
subjectIds,
|
|
1136
|
-
productTypes
|
|
1137
|
-
}) => {
|
|
1138
|
-
return _16.flow(
|
|
1139
|
-
(products, books) => levelIds || subjectIds ? filterEntitiesArrayFieldByValues5("books", _16.map("id", books))(products) : products,
|
|
1140
|
-
filterEntitiesSimpleFieldByValues14("id", ids),
|
|
1141
|
-
filterEntitiesSimpleFieldByValues14("ean", eans),
|
|
1142
|
-
filterEntitiesSimpleFieldByValues14("isAdoptant", _16.isBoolean(isAdoptant) ? [isAdoptant] : void 0),
|
|
1143
|
-
filterEntitiesSimpleFieldByValues14("isSupportPlus", _16.isBoolean(isSupportPlus) ? [isSupportPlus] : void 0),
|
|
1144
|
-
filterEntitiesSimpleFieldByValues14("productType", productTypes)
|
|
1145
|
-
);
|
|
1146
|
-
};
|
|
1147
|
-
var searchBooks2 = makeSearchBooks();
|
|
1148
|
-
var searchProducts = createSearchSelector6(
|
|
1149
|
-
getProducts,
|
|
1150
|
-
(state, { levelIds, subjectIds }) => searchBooks2(state, { levelIds, subjectIds }),
|
|
1151
|
-
(_state, params) => params,
|
|
1152
|
-
(products, books, params) => search15(params)(products, books)
|
|
1153
|
-
);
|
|
1154
|
-
|
|
1155
|
-
// src/selectors/resource.ts
|
|
1156
|
-
init_define_import_meta();
|
|
1157
|
-
import { filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues15 } from "@lls/utils";
|
|
1158
|
-
import _17 from "lodash/fp.js";
|
|
1159
|
-
var search16 = ({ chapterIds }) => _17.flow(filterEntitiesSimpleFieldByValues15("chapter", chapterIds));
|
|
1160
|
-
var { getResources, getResource, searchResources, makeSearchResources } = crud("resources", {
|
|
1161
|
-
search: search16
|
|
1162
|
-
});
|
|
1163
|
-
|
|
1164
|
-
// src/selectors/schoolType.ts
|
|
1165
|
-
init_define_import_meta();
|
|
1166
|
-
import { filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues16 } from "@lls/utils";
|
|
1167
|
-
var search17 = ({ slugs }) => filterEntitiesSimpleFieldByValues16("slug", slugs);
|
|
1168
|
-
var { getSchoolTypes, getSchoolType, searchSchoolTypes, makeSearchSchoolTypes } = crud("schoolTypes", {
|
|
1169
|
-
search: search17
|
|
1170
|
-
});
|
|
1171
|
-
|
|
1172
|
-
// src/selectors/sharedPage.ts
|
|
1173
|
-
init_define_import_meta();
|
|
1174
|
-
import { createSearchSelector as createSearchSelector7, filterEntitiesSimpleFieldByValue as filterEntitiesSimpleFieldByValue3, filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues17 } from "@lls/utils";
|
|
1175
|
-
import _18 from "lodash/fp.js";
|
|
1176
|
-
var search18 = ({
|
|
1177
|
-
parentIds,
|
|
1178
|
-
userIds,
|
|
1179
|
-
bookIds,
|
|
1180
|
-
isCreatedFromScratch,
|
|
1181
|
-
isLearningAssessment,
|
|
1182
|
-
ids
|
|
1183
|
-
}) => _18.flow(
|
|
1184
|
-
filterEntitiesSimpleFieldByValues17("id", ids),
|
|
1185
|
-
filterEntitiesSimpleFieldByValues17("parent", parentIds),
|
|
1186
|
-
filterEntitiesSimpleFieldByValues17("user", userIds),
|
|
1187
|
-
filterEntitiesSimpleFieldByValues17("book", bookIds),
|
|
1188
|
-
filterEntitiesSimpleFieldByValue3("isLearningAssessment", isLearningAssessment),
|
|
1189
|
-
filterEntitiesSimpleFieldByValue3("isCreatedFromScratch", isCreatedFromScratch)
|
|
1190
|
-
);
|
|
1191
|
-
var { getSharedPages, getSharedPage, searchSharedPages, makeSearchSharedPages } = crud("sharedPages", {
|
|
1192
|
-
search: search18
|
|
1193
|
-
});
|
|
1194
|
-
var searchCurrentUserSharedPages = createSearchSelector7(
|
|
1195
|
-
(state) => _18.flow(getCurrentUser, _18.getOr([], "sharedPages"))(state),
|
|
1196
|
-
getSharedPages,
|
|
1197
|
-
(_25, params) => params,
|
|
1198
|
-
(sharedUserPageIds, sharedPages, params) => search18({ ...params, ids: _18.intersection(sharedUserPageIds, params.ids || sharedUserPageIds) })(sharedPages)
|
|
1199
|
-
);
|
|
1200
|
-
|
|
1201
|
-
// src/selectors/student.ts
|
|
1202
|
-
init_define_import_meta();
|
|
1203
|
-
import { filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues18 } from "@lls/utils";
|
|
1204
|
-
var search19 = ({ ids }) => filterEntitiesSimpleFieldByValues18("id", ids);
|
|
1205
|
-
var { getStudents, getStudent, searchStudents, makeSearchStudents } = crud("students", {
|
|
1206
|
-
search: search19
|
|
1207
|
-
});
|
|
1208
|
-
|
|
1209
|
-
// src/selectors/subject.ts
|
|
1210
|
-
init_define_import_meta();
|
|
1211
|
-
import {
|
|
1212
|
-
filterEntitiesArrayFieldByValues as filterEntitiesArrayFieldByValues6,
|
|
1213
|
-
filterEntitiesFieldExists as filterEntitiesFieldExists2,
|
|
1214
|
-
filterEntitiesSimpleFieldByValue as filterEntitiesSimpleFieldByValue4,
|
|
1215
|
-
filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues19,
|
|
1216
|
-
limitToTeacherSubjects
|
|
1217
|
-
} from "@lls/utils";
|
|
1218
|
-
import _19 from "lodash/fp.js";
|
|
1219
|
-
var search20 = ({
|
|
1220
|
-
ids,
|
|
1221
|
-
slugs,
|
|
1222
|
-
isTeacherSubject,
|
|
1223
|
-
hasNewsletterUrl,
|
|
1224
|
-
schoolTypes,
|
|
1225
|
-
hasBooks,
|
|
1226
|
-
names
|
|
1227
|
-
}) => _19.flow(
|
|
1228
|
-
filterEntitiesSimpleFieldByValues19("id", ids),
|
|
1229
|
-
filterEntitiesSimpleFieldByValues19("slug", slugs),
|
|
1230
|
-
filterEntitiesSimpleFieldByValues19("name", names),
|
|
1231
|
-
filterEntitiesSimpleFieldByValue4("hasBooks", hasBooks),
|
|
1232
|
-
filterEntitiesArrayFieldByValues6("schoolTypes", schoolTypes),
|
|
1233
|
-
(subjects) => _19.isNil(isTeacherSubject) ? subjects : limitToTeacherSubjects(subjects),
|
|
1234
|
-
filterEntitiesFieldExists2("newsletterUrl", hasNewsletterUrl)
|
|
1235
|
-
);
|
|
1236
|
-
var { getSubjects, getSubject, searchSubjects, makeSearchSubjects } = crud("subjects", {
|
|
1237
|
-
search: search20
|
|
1238
|
-
});
|
|
1239
|
-
|
|
1240
|
-
// src/selectors/teacher.ts
|
|
1241
|
-
init_define_import_meta();
|
|
1242
|
-
import { filterEntitiesArrayFieldByValues as filterEntitiesArrayFieldByValues7, filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues20 } from "@lls/utils";
|
|
1243
|
-
import _20 from "lodash/fp.js";
|
|
1244
|
-
var search21 = ({ ids, schoolIds }) => _20.flow(filterEntitiesSimpleFieldByValues20("id", ids), filterEntitiesArrayFieldByValues7("schools", schoolIds));
|
|
1245
|
-
var { getTeachers, getTeacher, searchTeachers, makeSearchTeachers } = crud("teachers", {
|
|
1246
|
-
search: search21
|
|
1247
|
-
});
|
|
1248
|
-
|
|
1249
|
-
// src/selectors/tool.ts
|
|
1250
|
-
init_define_import_meta();
|
|
1251
|
-
import { filterEntitiesArrayFieldByValues as filterEntitiesArrayFieldByValues8, filterEntitiesSimpleFieldByValues as filterEntitiesSimpleFieldByValues21 } from "@lls/utils";
|
|
1252
|
-
import _21 from "lodash/fp.js";
|
|
1253
|
-
var search22 = ({ ids, locked, bookIds }) => _21.flow(
|
|
1254
|
-
filterEntitiesSimpleFieldByValues21("id", ids),
|
|
1255
|
-
filterEntitiesSimpleFieldByValues21("locked", _21.isNil(locked) ? void 0 : [locked]),
|
|
1256
|
-
filterEntitiesArrayFieldByValues8("books", bookIds)
|
|
1257
|
-
);
|
|
1258
|
-
var { getTools, getTool, searchTools, makeSearchTools } = crud("tools", {
|
|
1259
|
-
search: search22
|
|
1260
|
-
});
|
|
1261
|
-
|
|
1262
1004
|
// src/reducers/entities.ts
|
|
1263
1005
|
init_define_import_meta();
|
|
1264
1006
|
import { makeReducer } from "@lls/utils";
|
|
1265
|
-
import
|
|
1007
|
+
import _11 from "lodash/fp.js";
|
|
1266
1008
|
|
|
1267
1009
|
// src/actions/index.ts
|
|
1268
1010
|
init_define_import_meta();
|
|
@@ -1285,23 +1027,23 @@ var resetAuth = makeActionCreator(actionTypes.RESET_AUTH);
|
|
|
1285
1027
|
// src/reducers/entities.ts
|
|
1286
1028
|
var deleteEntityReducer = (state, payload) => {
|
|
1287
1029
|
const { path } = payload;
|
|
1288
|
-
return
|
|
1030
|
+
return _11.omit(path, state);
|
|
1289
1031
|
};
|
|
1290
1032
|
var updateEntityReducer = (state, payload) => {
|
|
1291
1033
|
const { path, entity } = payload;
|
|
1292
|
-
const currentEntity =
|
|
1293
|
-
return
|
|
1034
|
+
const currentEntity = _11.get(path, state);
|
|
1035
|
+
return _11.set(path, _11.merge(currentEntity, entity), state);
|
|
1294
1036
|
};
|
|
1295
1037
|
var setEntityReducer = (state, payload) => {
|
|
1296
1038
|
const { path, entity } = payload;
|
|
1297
|
-
return
|
|
1039
|
+
return _11.set(path, entity, state);
|
|
1298
1040
|
};
|
|
1299
1041
|
var shallowAssign = (old, next, transform) => {
|
|
1300
1042
|
let updated = false;
|
|
1301
|
-
const merged =
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
if (
|
|
1043
|
+
const merged = _11.flow(
|
|
1044
|
+
_11.toPairs,
|
|
1045
|
+
_11.reduce((memo, [key, val]) => {
|
|
1046
|
+
if (_11.isEmpty(val)) return memo;
|
|
1305
1047
|
if (!old[key]) {
|
|
1306
1048
|
updated = true;
|
|
1307
1049
|
memo[key] = val;
|
|
@@ -1314,7 +1056,7 @@ var shallowAssign = (old, next, transform) => {
|
|
|
1314
1056
|
return memo;
|
|
1315
1057
|
}
|
|
1316
1058
|
return memo;
|
|
1317
|
-
},
|
|
1059
|
+
}, _11.clone(old))
|
|
1318
1060
|
)(next);
|
|
1319
1061
|
return updated ? merged : old;
|
|
1320
1062
|
};
|
|
@@ -1323,7 +1065,7 @@ var setEntitiesReducer = (state, payload) => {
|
|
|
1323
1065
|
return shallowAssign(
|
|
1324
1066
|
entityKind,
|
|
1325
1067
|
nextEntityKind,
|
|
1326
|
-
(oldEntity, nextEntity) =>
|
|
1068
|
+
(oldEntity, nextEntity) => _11.isEqual(oldEntity, nextEntity) ? oldEntity : _11.assign(oldEntity, nextEntity)
|
|
1327
1069
|
);
|
|
1328
1070
|
});
|
|
1329
1071
|
};
|
|
@@ -1341,7 +1083,7 @@ var entities_default = entities;
|
|
|
1341
1083
|
// src/reducers/auth.ts
|
|
1342
1084
|
init_define_import_meta();
|
|
1343
1085
|
import { makeReducer as makeReducer2 } from "@lls/utils";
|
|
1344
|
-
import
|
|
1086
|
+
import _12 from "lodash/fp.js";
|
|
1345
1087
|
var initialState = {
|
|
1346
1088
|
id: void 0,
|
|
1347
1089
|
role: null,
|
|
@@ -1354,15 +1096,15 @@ var initialState = {
|
|
|
1354
1096
|
llsUserId: null
|
|
1355
1097
|
};
|
|
1356
1098
|
var auth = makeReducer2(initialState, {
|
|
1357
|
-
[actionTypes.SET_AUTH]:
|
|
1358
|
-
[actionTypes.RESET_AUTH]:
|
|
1099
|
+
[actionTypes.SET_AUTH]: _12.assign,
|
|
1100
|
+
[actionTypes.RESET_AUTH]: _12.constant(initialState)
|
|
1359
1101
|
});
|
|
1360
1102
|
var auth_default = auth;
|
|
1361
1103
|
|
|
1362
1104
|
// src/schema/index.ts
|
|
1363
1105
|
init_define_import_meta();
|
|
1364
1106
|
var import_normalizr = __toESM(require_normalizr(), 1);
|
|
1365
|
-
import
|
|
1107
|
+
import _13 from "lodash/fp.js";
|
|
1366
1108
|
var document = new import_normalizr.schema.Entity("documents", {}, { idAttribute: "resourceId" });
|
|
1367
1109
|
var subject = new import_normalizr.schema.Entity("subjects");
|
|
1368
1110
|
var level = new import_normalizr.schema.Entity("levels");
|
|
@@ -1549,11 +1291,10 @@ var querySchema = {
|
|
|
1549
1291
|
}
|
|
1550
1292
|
}
|
|
1551
1293
|
};
|
|
1552
|
-
var normalizeData =
|
|
1294
|
+
var normalizeData = _13.flow((data) => (0, import_normalizr.normalize)(data, querySchema));
|
|
1553
1295
|
export {
|
|
1554
1296
|
auth_default as authReducer,
|
|
1555
1297
|
entities_default as entitiesReducer,
|
|
1556
|
-
getAllNews,
|
|
1557
1298
|
getBook,
|
|
1558
1299
|
getBooks,
|
|
1559
1300
|
getChapter,
|
|
@@ -1567,39 +1308,11 @@ export {
|
|
|
1567
1308
|
getCurrentUser,
|
|
1568
1309
|
getDraftPage,
|
|
1569
1310
|
getDraftPages,
|
|
1570
|
-
getFaqs,
|
|
1571
|
-
getGarDivision,
|
|
1572
|
-
getGarDivisions,
|
|
1573
|
-
getGroup,
|
|
1574
|
-
getGroups,
|
|
1575
|
-
getLevel,
|
|
1576
|
-
getLevels,
|
|
1577
|
-
getMainNotifications,
|
|
1578
|
-
getNews,
|
|
1579
1311
|
getPage,
|
|
1580
1312
|
getPages,
|
|
1581
|
-
getPanorama,
|
|
1582
|
-
getPremiumResource,
|
|
1583
|
-
getPremiumResources,
|
|
1584
|
-
getProducts,
|
|
1585
|
-
getResource,
|
|
1586
|
-
getResources,
|
|
1587
1313
|
getSchool,
|
|
1588
|
-
getSchoolType,
|
|
1589
|
-
getSchoolTypes,
|
|
1590
1314
|
getSchools,
|
|
1591
|
-
getSharedPage,
|
|
1592
|
-
getSharedPages,
|
|
1593
|
-
getStudent,
|
|
1594
|
-
getStudents,
|
|
1595
|
-
getSubject,
|
|
1596
|
-
getSubjects,
|
|
1597
|
-
getTeacher,
|
|
1598
|
-
getTeachers,
|
|
1599
|
-
getTool,
|
|
1600
|
-
getTools,
|
|
1601
1315
|
getUser,
|
|
1602
|
-
getUserGroups,
|
|
1603
1316
|
getUsers,
|
|
1604
1317
|
makeGetBook,
|
|
1605
1318
|
makeGetDraftPage,
|
|
@@ -1610,22 +1323,9 @@ export {
|
|
|
1610
1323
|
makeSearchContacts,
|
|
1611
1324
|
makeSearchCopyNotifications,
|
|
1612
1325
|
makeSearchDraftPages,
|
|
1613
|
-
makeSearchDrawerNotifications,
|
|
1614
|
-
makeSearchGarDivisions,
|
|
1615
|
-
makeSearchGroups,
|
|
1616
|
-
makeSearchLevels,
|
|
1617
1326
|
makeSearchModifiedPages,
|
|
1618
|
-
makeSearchNews,
|
|
1619
1327
|
makeSearchPages,
|
|
1620
|
-
makeSearchPremiumResources,
|
|
1621
|
-
makeSearchResources,
|
|
1622
|
-
makeSearchSchoolTypes,
|
|
1623
1328
|
makeSearchSchools,
|
|
1624
|
-
makeSearchSharedPages,
|
|
1625
|
-
makeSearchStudents,
|
|
1626
|
-
makeSearchSubjects,
|
|
1627
|
-
makeSearchTeachers,
|
|
1628
|
-
makeSearchTools,
|
|
1629
1329
|
makeSearchUsers,
|
|
1630
1330
|
makeSearchValidBooks,
|
|
1631
1331
|
normalizeData,
|
|
@@ -1636,25 +1336,10 @@ export {
|
|
|
1636
1336
|
searchCommunityProjects,
|
|
1637
1337
|
searchContacts,
|
|
1638
1338
|
searchCopyNotifications,
|
|
1639
|
-
searchCurrentUserSharedPages,
|
|
1640
1339
|
searchDraftPages,
|
|
1641
|
-
searchDrawerNotifications,
|
|
1642
|
-
searchGarDivisions,
|
|
1643
|
-
searchGroups,
|
|
1644
|
-
searchLevels,
|
|
1645
1340
|
searchModifiedPages,
|
|
1646
|
-
searchNews,
|
|
1647
1341
|
searchPages,
|
|
1648
|
-
searchPremiumResources,
|
|
1649
|
-
searchProducts,
|
|
1650
|
-
searchResources,
|
|
1651
|
-
searchSchoolTypes,
|
|
1652
1342
|
searchSchools,
|
|
1653
|
-
searchSharedPages,
|
|
1654
|
-
searchStudents,
|
|
1655
|
-
searchSubjects,
|
|
1656
|
-
searchTeachers,
|
|
1657
|
-
searchTools,
|
|
1658
1343
|
searchUsers,
|
|
1659
1344
|
searchValidBooks,
|
|
1660
1345
|
setEntitiesReducer
|
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.59-
|
|
5
|
+
"version": "24.1.59-e4bc5c16",
|
|
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.3.3",
|
|
42
42
|
"vite-tsconfig-paths": "4.3.2",
|
|
43
43
|
"vitest": "2.0.0",
|
|
44
|
-
"@lls/utils": "24.1.59-
|
|
45
|
-
"@lls/vitescripts": "24.1.59-
|
|
44
|
+
"@lls/utils": "24.1.59-e4bc5c16",
|
|
45
|
+
"@lls/vitescripts": "24.1.59-e4bc5c16"
|
|
46
46
|
},
|
|
47
47
|
"license": "ISC",
|
|
48
48
|
"dependencies": {
|