@strapi/plugin-users-permissions 5.0.0-beta.15 → 5.0.0-beta.17

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.
Files changed (40) hide show
  1. package/admin/src/components/Permissions/PermissionRow/CheckboxWrapper.jsx +3 -2
  2. package/admin/src/components/Permissions/PermissionRow/SubCategory.jsx +2 -2
  3. package/admin/src/pages/EmailTemplates/components/EmailTable.jsx +17 -12
  4. package/admin/src/pages/Providers/index.jsx +1 -1
  5. package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +6 -5
  6. package/dist/_chunks/{index-Dn02HqR-.js → index-B3Yss4_X.js} +8 -8
  7. package/dist/_chunks/{index-Dn02HqR-.js.map → index-B3Yss4_X.js.map} +1 -1
  8. package/dist/_chunks/{index-BmKoOPi2.mjs → index-B6yBcJnO.mjs} +11 -9
  9. package/dist/_chunks/index-B6yBcJnO.mjs.map +1 -0
  10. package/dist/_chunks/{index-e_o9V2Wo.mjs → index-BAJGMzXv.mjs} +4 -4
  11. package/dist/_chunks/index-BAJGMzXv.mjs.map +1 -0
  12. package/dist/_chunks/{index-CaRLqKnp.js → index-BaDNXywU.js} +11 -9
  13. package/dist/_chunks/index-BaDNXywU.js.map +1 -0
  14. package/dist/_chunks/{index-CdoferYp.mjs → index-BjBAUX-X.mjs} +2 -2
  15. package/dist/_chunks/{index-CdoferYp.mjs.map → index-BjBAUX-X.mjs.map} +1 -1
  16. package/dist/_chunks/{index-CksPZFrJ.js → index-CSTRwxO1.js} +8 -8
  17. package/dist/_chunks/index-CSTRwxO1.js.map +1 -0
  18. package/dist/_chunks/{index-C16Q3b-4.mjs → index-CU8gSdhZ.mjs} +8 -8
  19. package/dist/_chunks/index-CU8gSdhZ.mjs.map +1 -0
  20. package/dist/_chunks/{index-CdFgSV2w.js → index-CyFC4O8A.js} +8 -8
  21. package/dist/_chunks/index-CyFC4O8A.js.map +1 -0
  22. package/dist/_chunks/{index-CXQHoG6E.mjs → index-Cz5OWx31.mjs} +8 -8
  23. package/dist/_chunks/{index-CXQHoG6E.mjs.map → index-Cz5OWx31.mjs.map} +1 -1
  24. package/dist/_chunks/{index-DLg3QAaR.js → index-DJ9BXKML.js} +2 -2
  25. package/dist/_chunks/{index-DLg3QAaR.js.map → index-DJ9BXKML.js.map} +1 -1
  26. package/dist/_chunks/{index-IU9ZrCxt-C2hh56U0.mjs → index-Hmzyjkc3-BHUgmsKx.mjs} +86 -76
  27. package/dist/_chunks/index-Hmzyjkc3-BHUgmsKx.mjs.map +1 -0
  28. package/dist/_chunks/{index-IU9ZrCxt-DDk7Gyez.js → index-Hmzyjkc3-qR3QHvSP.js} +87 -77
  29. package/dist/_chunks/index-Hmzyjkc3-qR3QHvSP.js.map +1 -0
  30. package/dist/admin/index.js +1 -1
  31. package/dist/admin/index.mjs +1 -1
  32. package/package.json +4 -4
  33. package/dist/_chunks/index-BmKoOPi2.mjs.map +0 -1
  34. package/dist/_chunks/index-C16Q3b-4.mjs.map +0 -1
  35. package/dist/_chunks/index-CaRLqKnp.js.map +0 -1
  36. package/dist/_chunks/index-CdFgSV2w.js.map +0 -1
  37. package/dist/_chunks/index-CksPZFrJ.js.map +0 -1
  38. package/dist/_chunks/index-IU9ZrCxt-C2hh56U0.mjs.map +0 -1
  39. package/dist/_chunks/index-IU9ZrCxt-DDk7Gyez.js.map +0 -1
  40. package/dist/_chunks/index-e_o9V2Wo.mjs.map +0 -1
@@ -14,6 +14,8 @@ const reactDom = require("react-dom");
14
14
  const createNextState2 = require("immer");
15
15
  const reactRedux = require("react-redux");
16
16
  const pipe = require("lodash/fp/pipe");
17
+ const clone = require("lodash/clone");
18
+ const toPath = require("lodash/toPath");
17
19
  const isEqual = require("lodash/isEqual");
18
20
  require("lodash/defaultsDeep");
19
21
  const styledComponents = require("styled-components");
@@ -22,8 +24,6 @@ require("lodash/get");
22
24
  require("lodash/set");
23
25
  require("lodash/camelCase");
24
26
  const yup = require("yup");
25
- const clone = require("lodash/clone");
26
- const toPath = require("lodash/toPath");
27
27
  require("lodash/omit");
28
28
  require("formik");
29
29
  require("lodash/throttle");
@@ -49,10 +49,10 @@ function _interopNamespace(e) {
49
49
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
50
50
  const createNextState2__default = /* @__PURE__ */ _interopDefault(createNextState2);
51
51
  const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
52
- const isEqual__default = /* @__PURE__ */ _interopDefault(isEqual);
53
- const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
54
52
  const clone__default = /* @__PURE__ */ _interopDefault(clone);
55
53
  const toPath__default = /* @__PURE__ */ _interopDefault(toPath);
54
+ const isEqual__default = /* @__PURE__ */ _interopDefault(isEqual);
55
+ const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
56
56
  function getDefaultExportFromCjs(x) {
57
57
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
58
58
  }
@@ -8559,6 +8559,10 @@ function createContext(rootComponentName, defaultContext) {
8559
8559
  return [Provider2, useContext];
8560
8560
  }
8561
8561
  createContext("StrapiApp");
8562
+ const STORAGE_KEYS$1 = {
8563
+ TOKEN: "jwtToken",
8564
+ USER: "userInfo"
8565
+ };
8562
8566
  const THEME_LOCAL_STORAGE_KEY = "STRAPI_THEME";
8563
8567
  const LANGUAGE_LOCAL_STORAGE_KEY = "strapi-admin-language";
8564
8568
  const adminSlice = createSlice({
@@ -8573,7 +8577,8 @@ const adminSlice = createSlice({
8573
8577
  theme: {
8574
8578
  availableThemes: [],
8575
8579
  currentTheme: localStorage.getItem(THEME_LOCAL_STORAGE_KEY) || "system"
8576
- }
8580
+ },
8581
+ token: null
8577
8582
  };
8578
8583
  },
8579
8584
  reducers: {
@@ -8588,6 +8593,25 @@ const adminSlice = createSlice({
8588
8593
  state.language.locale = action.payload;
8589
8594
  window.localStorage.setItem(LANGUAGE_LOCAL_STORAGE_KEY, action.payload);
8590
8595
  document.documentElement.setAttribute("lang", action.payload);
8596
+ },
8597
+ setToken(state, action) {
8598
+ state.token = action.payload;
8599
+ },
8600
+ login(state, action) {
8601
+ const { token, persist } = action.payload;
8602
+ if (!persist) {
8603
+ window.sessionStorage.setItem(STORAGE_KEYS$1.TOKEN, JSON.stringify(token));
8604
+ } else {
8605
+ window.localStorage.setItem(STORAGE_KEYS$1.TOKEN, JSON.stringify(token));
8606
+ }
8607
+ state.token = token;
8608
+ },
8609
+ logout(state) {
8610
+ state.token = null;
8611
+ window.localStorage.removeItem(STORAGE_KEYS$1.TOKEN);
8612
+ window.localStorage.removeItem(STORAGE_KEYS$1.USER);
8613
+ window.sessionStorage.removeItem(STORAGE_KEYS$1.TOKEN);
8614
+ window.sessionStorage.removeItem(STORAGE_KEYS$1.USER);
8591
8615
  }
8592
8616
  }
8593
8617
  });
@@ -8764,6 +8788,46 @@ React__namespace.createContext({
8764
8788
  toggleNotification: () => {
8765
8789
  }
8766
8790
  });
8791
+ function getIn(obj, key, def, pathStartIndex = 0) {
8792
+ const path = toPath__default.default(key);
8793
+ while (obj && pathStartIndex < path.length) {
8794
+ obj = obj[path[pathStartIndex++]];
8795
+ }
8796
+ if (pathStartIndex !== path.length && !obj) {
8797
+ return def;
8798
+ }
8799
+ return obj === void 0 ? def : obj;
8800
+ }
8801
+ const isObject = (obj) => obj !== null && typeof obj === "object" && !Array.isArray(obj);
8802
+ const isInteger = (obj) => String(Math.floor(Number(obj))) === obj;
8803
+ function setIn(obj, path, value) {
8804
+ const res = clone__default.default(obj);
8805
+ let resVal = res;
8806
+ let i = 0;
8807
+ const pathArray = toPath__default.default(path);
8808
+ for (; i < pathArray.length - 1; i++) {
8809
+ const currentPath = pathArray[i];
8810
+ const currentObj = getIn(obj, pathArray.slice(0, i + 1));
8811
+ if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {
8812
+ resVal = resVal[currentPath] = clone__default.default(currentObj);
8813
+ } else {
8814
+ const nextPath = pathArray[i + 1];
8815
+ resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
8816
+ }
8817
+ }
8818
+ if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {
8819
+ return obj;
8820
+ }
8821
+ if (value === void 0) {
8822
+ delete resVal[pathArray[i]];
8823
+ } else {
8824
+ resVal[pathArray[i]] = value;
8825
+ }
8826
+ if (i === 0 && value === void 0) {
8827
+ delete res[pathArray[i]];
8828
+ }
8829
+ return res;
8830
+ }
8767
8831
  const [AppInfoProvider, useAppInfo] = createContext("AppInfo", {});
8768
8832
  const TrackingContext = React__namespace.createContext({
8769
8833
  uuid: false
@@ -10118,46 +10182,6 @@ const Layouts = {
10118
10182
  Action: ActionLayout,
10119
10183
  Content: ContentLayout
10120
10184
  };
10121
- function getIn(obj, key, def, pathStartIndex = 0) {
10122
- const path = toPath__default.default(key);
10123
- while (obj && pathStartIndex < path.length) {
10124
- obj = obj[path[pathStartIndex++]];
10125
- }
10126
- if (pathStartIndex !== path.length && !obj) {
10127
- return def;
10128
- }
10129
- return obj === void 0 ? def : obj;
10130
- }
10131
- const isObject = (obj) => obj !== null && typeof obj === "object" && !Array.isArray(obj);
10132
- const isInteger = (obj) => String(Math.floor(Number(obj))) === obj;
10133
- function setIn(obj, path, value) {
10134
- const res = clone__default.default(obj);
10135
- let resVal = res;
10136
- let i = 0;
10137
- const pathArray = toPath__default.default(path);
10138
- for (; i < pathArray.length - 1; i++) {
10139
- const currentPath = pathArray[i];
10140
- const currentObj = getIn(obj, pathArray.slice(0, i + 1));
10141
- if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {
10142
- resVal = resVal[currentPath] = clone__default.default(currentObj);
10143
- } else {
10144
- const nextPath = pathArray[i + 1];
10145
- resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
10146
- }
10147
- }
10148
- if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {
10149
- return obj;
10150
- }
10151
- if (value === void 0) {
10152
- delete resVal[pathArray[i]];
10153
- } else {
10154
- resVal[pathArray[i]] = value;
10155
- }
10156
- if (i === 0 && value === void 0) {
10157
- delete res[pathArray[i]];
10158
- }
10159
- return res;
10160
- }
10161
10185
  const ERR_MSG = "The Form Component has not been initialised, ensure you are using this hook within a Form component";
10162
10186
  const [FormProvider, useForm] = createContext("Form", {
10163
10187
  disabled: false,
@@ -10507,7 +10531,7 @@ const reducer = (state, action) => createNextState2.produce(state, (draft) => {
10507
10531
  draft.values = setIn(
10508
10532
  state.values,
10509
10533
  action.payload.field,
10510
- newValue.length > 0 ? newValue : void 0
10534
+ newValue.length > 0 ? newValue : []
10511
10535
  );
10512
10536
  break;
10513
10537
  }
@@ -10537,36 +10561,14 @@ const useField = (path) => {
10537
10561
  (state) => getIn(state.values, path)
10538
10562
  );
10539
10563
  const handleChange = useForm("useField", (state) => state.onChange);
10540
- const formatNestedErrorMessages = (stateErrors) => {
10541
- const nestedErrors = {};
10542
- Object.entries(stateErrors).forEach(([key, value2]) => {
10543
- let current = nestedErrors;
10544
- const pathParts = key.split(".");
10545
- pathParts.forEach((part, index) => {
10546
- const isLastPart = index === pathParts.length - 1;
10547
- if (isLastPart) {
10548
- if (typeof value2 === "string") {
10549
- current[part] = value2;
10550
- } else if (isErrorMessageDescriptor(value2)) {
10551
- current[part] = formatMessage(value2);
10552
- } else {
10553
- setIn(current, part, value2);
10554
- }
10555
- } else {
10556
- if (!current[part]) {
10557
- const isArray2 = !isNaN(Number(pathParts[index + 1]));
10558
- current[part] = isArray2 ? [] : {};
10559
- }
10560
- current = current[part];
10561
- }
10562
- });
10563
- });
10564
- return nestedErrors;
10565
- };
10566
- const error = useForm(
10567
- "useField",
10568
- (state) => getIn(formatNestedErrorMessages(state.errors), path)
10569
- );
10564
+ const error = useForm("useField", (state) => {
10565
+ const error2 = getIn(state.errors, path);
10566
+ if (isErrorMessageDescriptor(error2)) {
10567
+ const { values, ...message } = error2;
10568
+ return formatMessage(message, values);
10569
+ }
10570
+ return error2;
10571
+ });
10570
10572
  return {
10571
10573
  initialValue,
10572
10574
  /**
@@ -11228,6 +11230,14 @@ yup__namespace.object().shape({
11228
11230
  [adminApi.reducerPath]: adminApi.reducer,
11229
11231
  admin_app: reducer$1
11230
11232
  });
11233
+ styledComponents.styled(icons.WarningCircle)`
11234
+ width: 24px;
11235
+ height: 24px;
11236
+
11237
+ path {
11238
+ fill: ${({ theme }) => theme.colors.danger600};
11239
+ }
11240
+ `;
11231
11241
  React__namespace.memo(
11232
11242
  ({ description, id, props, update }) => {
11233
11243
  const comp = description(props);
@@ -11500,4 +11510,4 @@ adminApi.enhanceEndpoints({
11500
11510
  });
11501
11511
  exports.Layouts = Layouts;
11502
11512
  exports.useTracking = useTracking;
11503
- //# sourceMappingURL=index-IU9ZrCxt-DDk7Gyez.js.map
11513
+ //# sourceMappingURL=index-Hmzyjkc3-qR3QHvSP.js.map