@strapi/plugin-users-permissions 5.0.0-beta.16 → 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 (36) hide show
  1. package/admin/src/components/Permissions/PermissionRow/SubCategory.jsx +2 -2
  2. package/admin/src/pages/Providers/index.jsx +1 -1
  3. package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +1 -1
  4. package/dist/_chunks/{index-GRvR2Ufg.js → index-B3Yss4_X.js} +8 -8
  5. package/dist/_chunks/{index-GRvR2Ufg.js.map → index-B3Yss4_X.js.map} +1 -1
  6. package/dist/_chunks/{index-Bk2QJpV0.mjs → index-B6yBcJnO.mjs} +3 -3
  7. package/dist/_chunks/index-B6yBcJnO.mjs.map +1 -0
  8. package/dist/_chunks/{index-B38p2u_S.mjs → index-BAJGMzXv.mjs} +4 -4
  9. package/dist/_chunks/index-BAJGMzXv.mjs.map +1 -0
  10. package/dist/_chunks/{index-Cl-Izig3.js → index-BaDNXywU.js} +3 -3
  11. package/dist/_chunks/index-BaDNXywU.js.map +1 -0
  12. package/dist/_chunks/{index-B4UZW3Xs.mjs → index-BjBAUX-X.mjs} +2 -2
  13. package/dist/_chunks/{index-B4UZW3Xs.mjs.map → index-BjBAUX-X.mjs.map} +1 -1
  14. package/dist/_chunks/{index-D650mZNK.js → index-CSTRwxO1.js} +8 -8
  15. package/dist/_chunks/index-CSTRwxO1.js.map +1 -0
  16. package/dist/_chunks/{index-DGmf44kb.mjs → index-CU8gSdhZ.mjs} +3 -3
  17. package/dist/_chunks/{index-DGmf44kb.mjs.map → index-CU8gSdhZ.mjs.map} +1 -1
  18. package/dist/_chunks/{index-D_FhYNtQ.js → index-CyFC4O8A.js} +4 -4
  19. package/dist/_chunks/{index-D_FhYNtQ.js.map → index-CyFC4O8A.js.map} +1 -1
  20. package/dist/_chunks/{index-txiSTl89.mjs → index-Cz5OWx31.mjs} +8 -8
  21. package/dist/_chunks/{index-txiSTl89.mjs.map → index-Cz5OWx31.mjs.map} +1 -1
  22. package/dist/_chunks/{index--gftNN7z.js → index-DJ9BXKML.js} +2 -2
  23. package/dist/_chunks/{index--gftNN7z.js.map → index-DJ9BXKML.js.map} +1 -1
  24. package/dist/_chunks/{index-3zwKJbP6-CFuKTauZ.mjs → index-Hmzyjkc3-BHUgmsKx.mjs} +52 -74
  25. package/dist/_chunks/index-Hmzyjkc3-BHUgmsKx.mjs.map +1 -0
  26. package/dist/_chunks/{index-3zwKJbP6-D4dU4aLL.js → index-Hmzyjkc3-qR3QHvSP.js} +54 -76
  27. package/dist/_chunks/index-Hmzyjkc3-qR3QHvSP.js.map +1 -0
  28. package/dist/admin/index.js +1 -1
  29. package/dist/admin/index.mjs +1 -1
  30. package/package.json +4 -4
  31. package/dist/_chunks/index-3zwKJbP6-CFuKTauZ.mjs.map +0 -1
  32. package/dist/_chunks/index-3zwKJbP6-D4dU4aLL.js.map +0 -1
  33. package/dist/_chunks/index-B38p2u_S.mjs.map +0 -1
  34. package/dist/_chunks/index-Bk2QJpV0.mjs.map +0 -1
  35. package/dist/_chunks/index-Cl-Izig3.js.map +0 -1
  36. package/dist/_chunks/index-D650mZNK.js.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
  }
@@ -8788,6 +8788,46 @@ React__namespace.createContext({
8788
8788
  toggleNotification: () => {
8789
8789
  }
8790
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
+ }
8791
8831
  const [AppInfoProvider, useAppInfo] = createContext("AppInfo", {});
8792
8832
  const TrackingContext = React__namespace.createContext({
8793
8833
  uuid: false
@@ -10142,46 +10182,6 @@ const Layouts = {
10142
10182
  Action: ActionLayout,
10143
10183
  Content: ContentLayout
10144
10184
  };
10145
- function getIn(obj, key, def, pathStartIndex = 0) {
10146
- const path = toPath__default.default(key);
10147
- while (obj && pathStartIndex < path.length) {
10148
- obj = obj[path[pathStartIndex++]];
10149
- }
10150
- if (pathStartIndex !== path.length && !obj) {
10151
- return def;
10152
- }
10153
- return obj === void 0 ? def : obj;
10154
- }
10155
- const isObject = (obj) => obj !== null && typeof obj === "object" && !Array.isArray(obj);
10156
- const isInteger = (obj) => String(Math.floor(Number(obj))) === obj;
10157
- function setIn(obj, path, value) {
10158
- const res = clone__default.default(obj);
10159
- let resVal = res;
10160
- let i = 0;
10161
- const pathArray = toPath__default.default(path);
10162
- for (; i < pathArray.length - 1; i++) {
10163
- const currentPath = pathArray[i];
10164
- const currentObj = getIn(obj, pathArray.slice(0, i + 1));
10165
- if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {
10166
- resVal = resVal[currentPath] = clone__default.default(currentObj);
10167
- } else {
10168
- const nextPath = pathArray[i + 1];
10169
- resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
10170
- }
10171
- }
10172
- if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {
10173
- return obj;
10174
- }
10175
- if (value === void 0) {
10176
- delete resVal[pathArray[i]];
10177
- } else {
10178
- resVal[pathArray[i]] = value;
10179
- }
10180
- if (i === 0 && value === void 0) {
10181
- delete res[pathArray[i]];
10182
- }
10183
- return res;
10184
- }
10185
10185
  const ERR_MSG = "The Form Component has not been initialised, ensure you are using this hook within a Form component";
10186
10186
  const [FormProvider, useForm] = createContext("Form", {
10187
10187
  disabled: false,
@@ -10531,7 +10531,7 @@ const reducer = (state, action) => createNextState2.produce(state, (draft) => {
10531
10531
  draft.values = setIn(
10532
10532
  state.values,
10533
10533
  action.payload.field,
10534
- newValue.length > 0 ? newValue : void 0
10534
+ newValue.length > 0 ? newValue : []
10535
10535
  );
10536
10536
  break;
10537
10537
  }
@@ -10561,36 +10561,14 @@ const useField = (path) => {
10561
10561
  (state) => getIn(state.values, path)
10562
10562
  );
10563
10563
  const handleChange = useForm("useField", (state) => state.onChange);
10564
- const formatNestedErrorMessages = (stateErrors) => {
10565
- const nestedErrors = {};
10566
- Object.entries(stateErrors).forEach(([key, value2]) => {
10567
- let current = nestedErrors;
10568
- const pathParts = key.split(".");
10569
- pathParts.forEach((part, index) => {
10570
- const isLastPart = index === pathParts.length - 1;
10571
- if (isLastPart) {
10572
- if (typeof value2 === "string") {
10573
- current[part] = value2;
10574
- } else if (isErrorMessageDescriptor(value2)) {
10575
- current[part] = formatMessage(value2);
10576
- } else {
10577
- setIn(current, part, value2);
10578
- }
10579
- } else {
10580
- if (!current[part]) {
10581
- const isArray2 = !isNaN(Number(pathParts[index + 1]));
10582
- current[part] = isArray2 ? [] : {};
10583
- }
10584
- current = current[part];
10585
- }
10586
- });
10587
- });
10588
- return nestedErrors;
10589
- };
10590
- const error = useForm(
10591
- "useField",
10592
- (state) => getIn(formatNestedErrorMessages(state.errors), path)
10593
- );
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
+ });
10594
10572
  return {
10595
10573
  initialValue,
10596
10574
  /**
@@ -11532,4 +11510,4 @@ adminApi.enhanceEndpoints({
11532
11510
  });
11533
11511
  exports.Layouts = Layouts;
11534
11512
  exports.useTracking = useTracking;
11535
- //# sourceMappingURL=index-3zwKJbP6-D4dU4aLL.js.map
11513
+ //# sourceMappingURL=index-Hmzyjkc3-qR3QHvSP.js.map