@gisce/react-ooui 2.91.0-alpha.2 → 2.91.0-alpha.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"usePermissions.d.ts","sourceRoot":"","sources":["../../src/hooks/usePermissions.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpE,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAE7D,eAAO,MAAM,cAAc;8BAcd,MAAM,eACA,cAAc,EAAE,KAC5B,QAAQ,cAAc,CAAC;;CA8B7B,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE,cAAc,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,mBAAmB,qCAI7B,0BAA0B,KAAG,yBAsD/B,CAAC"}
1
+ {"version":3,"file":"usePermissions.d.ts","sourceRoot":"","sources":["../../src/hooks/usePermissions.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpE,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAE7D,eAAO,MAAM,cAAc;8BAcd,MAAM,eACA,cAAc,EAAE,KAC5B,QAAQ,cAAc,CAAC;;CA+B7B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE,cAAc,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,mBAAmB,qCAI7B,0BAA0B,KAAG,yBAsD/B,CAAC"}
@@ -11717,16 +11717,18 @@ const Bn = Nt(ey), Un = (t) => {
11717
11717
  }, []), { checkPermissions: E(
11718
11718
  async (r, o) => {
11719
11719
  try {
11720
- const i = o.map(async (c) => {
11721
- const d = await t({
11722
- model: r,
11723
- type: c
11724
- });
11725
- return { permission: c, hasPermission: d };
11726
- }), a = await Promise.all(i), l = {};
11727
- return a.forEach(({ permission: c, hasPermission: d }) => {
11728
- l[c] = d;
11729
- }), l;
11720
+ const i = await t({
11721
+ model: r,
11722
+ type: o
11723
+ });
11724
+ if (typeof i == "boolean") {
11725
+ const l = {};
11726
+ return l[o[0]] = i, l;
11727
+ }
11728
+ const a = {};
11729
+ return o.forEach((l) => {
11730
+ a[l] = i[l] || !1;
11731
+ }), a;
11730
11732
  } catch (i) {
11731
11733
  throw console.error("Error checking permissions:", i), i;
11732
11734
  }