@corva/ui 3.79.0-8 → 3.79.0-9
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/cjs-bundle/permissions/withPermissionsHOC.js +1 -1
- package/cjs-bundle/permissions/withPermissionsHOC.js.map +1 -1
- package/mcp-server/server.mjs +1 -1
- package/package.json +1 -1
- package/permissions/__tests__/withPermissionsHOC.test.d.ts.map +1 -1
- package/permissions/withPermissionsHOC.d.ts.map +1 -1
- package/permissions/withPermissionsHOC.js +1 -1
- package/permissions/withPermissionsHOC.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("lodash"),t=require("./usePermissions.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("lodash"),t=require("react"),n=require("./usePermissions.js"),o=require("../components/LoadingIndicator/LoadingIndicator.js"),i=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(e);function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?s(Object(t),!0).forEach((function(r){c.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var f=i.jsx(o,{});exports.withPermissionsHOC=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(u){return function(c){var s=o.loader,p=void 0===s?f:s,d=o.skipLoading,O=void 0!==d&&d,b=Object.keys(e),j=n(b.map((function(r){var t=e[r];return"function"==typeof t?t(c):t}))),l=t.useRef(!1);if(!O&&!l.current&&r.some(j,"loading"))return p;l.current=!0;var v=b.reduce((function(e,r,t){return e[r]=j[t].active,e}),{});return i.jsx(u,a(a({},c),v))}}};
|
|
2
2
|
//# sourceMappingURL=withPermissionsHOC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPermissionsHOC.js","sources":["../../../src/permissions/withPermissionsHOC.js"],"sourcesContent":["import { some } from 'lodash';\n\nimport usePermissions from './usePermissions';\n\nimport LoadingIndicator from '~/components/LoadingIndicator';\n\nconst DEFAULT_LOADER = <LoadingIndicator />;\n\nexport const withPermissionsHOC =\n (propKeyToPermission, hocParams = {}) =>\n WrappedComponent =>\n props => {\n const { loader = DEFAULT_LOADER, skipLoading = false } = hocParams;\n\n const propKeys = Object.keys(propKeyToPermission);\n const permissions = usePermissions(\n propKeys.map(propKey => {\n const propValue = propKeyToPermission[propKey];\n\n return typeof propValue === 'function' ? propValue(props) : propValue;\n })\n );\n\n if (!skipLoading && some(permissions, 'loading')) return loader;\n\n const permissionsProps = propKeys.reduce((acc, curr, index) => {\n acc[curr] = permissions[index].active;\n return acc;\n }, {});\n\n return <WrappedComponent {...props} {...permissionsProps} />;\n };\n"],"names":["DEFAULT_LOADER","_jsx","jsx","LoadingIndicator","propKeyToPermission","hocParams","arguments","length","undefined","WrappedComponent","props","loader","_hocParams$loader","_hocParams$skipLoadin","skipLoading","propKeys","Object","keys","permissions","usePermissions","map","propKey","propValue","some","permissionsProps","reduce","acc","curr","index","active","_objectSpread"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withPermissionsHOC.js","sources":["../../../src/permissions/withPermissionsHOC.js"],"sourcesContent":["import { some } from 'lodash';\nimport { useRef } from 'react';\n\nimport usePermissions from './usePermissions';\n\nimport LoadingIndicator from '~/components/LoadingIndicator';\n\nconst DEFAULT_LOADER = <LoadingIndicator />;\n\nexport const withPermissionsHOC =\n (propKeyToPermission, hocParams = {}) =>\n WrappedComponent =>\n props => {\n const { loader = DEFAULT_LOADER, skipLoading = false } = hocParams;\n\n const propKeys = Object.keys(propKeyToPermission);\n const permissions = usePermissions(\n propKeys.map(propKey => {\n const propValue = propKeyToPermission[propKey];\n\n return typeof propValue === 'function' ? propValue(props) : propValue;\n })\n );\n\n // Only the first render waits for the checks. Later key changes (a permission derived from\n // props, e.g. per-dashboard update rights) would otherwise swap the mounted component for the\n // loader, unmounting everything it holds and re-running its effects on remount.\n const hasRenderedRef = useRef(false);\n if (!skipLoading && !hasRenderedRef.current && some(permissions, 'loading')) return loader;\n hasRenderedRef.current = true;\n\n const permissionsProps = propKeys.reduce((acc, curr, index) => {\n acc[curr] = permissions[index].active;\n return acc;\n }, {});\n\n return <WrappedComponent {...props} {...permissionsProps} />;\n };\n"],"names":["DEFAULT_LOADER","_jsx","jsx","LoadingIndicator","propKeyToPermission","hocParams","arguments","length","undefined","WrappedComponent","props","loader","_hocParams$loader","_hocParams$skipLoadin","skipLoading","propKeys","Object","keys","permissions","usePermissions","map","propKey","propValue","hasRenderedRef","useRef","current","some","permissionsProps","reduce","acc","curr","index","active","_objectSpread"],"mappings":"47BAOA,IAAMA,EAAiBC,EAACC,IAAAC,EAAmB,CAAA,8BAGzC,SAACC,GAAmB,IAAEC,EAAYC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAA,CAAA,EAAE,OACpC,SAAAG,GAAgB,OAChB,SAAAC,GACE,IAAyDL,EAAAA,EAAjDM,OAAAA,aAASX,EAAcY,EAAAC,EAA0BR,EAAxBS,YAAAA,cAAmBD,EAE9CE,EAAWC,OAAOC,KAAKb,GACvBc,EAAcC,EAClBJ,EAASK,KAAI,SAAAC,GACX,IAAMC,EAAYlB,EAAoBiB,GAEtC,MAA4B,mBAAdC,EAA2BA,EAAUZ,GAASY,CAC7D,KAMGC,EAAiBC,UAAO,GAC9B,IAAKV,IAAgBS,EAAeE,SAAWC,EAAIA,KAACR,EAAa,WAAY,OAAOP,EACpFY,EAAeE,SAAU,EAEzB,IAAME,EAAmBZ,EAASa,QAAO,SAACC,EAAKC,EAAMC,GAEnD,OADAF,EAAIC,GAAQZ,EAAYa,GAAOC,OACxBH,CACR,GAAE,CAAE,GAEL,OAAO5B,MAACQ,EAAgBwB,EAAAA,EAAA,CAAA,EAAKvB,GAAWiB,IACzC,CAAA"}
|
package/mcp-server/server.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPermissionsHOC.test.d.ts","sourceRoot":"","sources":["../../../src/permissions/__tests__/withPermissionsHOC.test.
|
|
1
|
+
{"version":3,"file":"withPermissionsHOC.test.d.ts","sourceRoot":"","sources":["../../../src/permissions/__tests__/withPermissionsHOC.test.jsx"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPermissionsHOC.d.ts","sourceRoot":"","sources":["../../src/permissions/withPermissionsHOC.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withPermissionsHOC.d.ts","sourceRoot":"","sources":["../../src/permissions/withPermissionsHOC.js"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB,8FA4B5B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/defineProperty";import{some as e}from"lodash";import t from"./usePermissions.js";import
|
|
1
|
+
import r from"@babel/runtime/helpers/defineProperty";import{some as e}from"lodash";import{useRef as t}from"react";import n from"./usePermissions.js";import o from"../components/LoadingIndicator/LoadingIndicator.js";import{jsx as i}from"react/jsx-runtime";function c(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var p=i(o,{}),f=function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(c){return function(f){var a=o.loader,s=void 0===a?p:a,m=o.skipLoading,O=void 0!==m&&m,b=Object.keys(r),d=n(b.map((function(e){var t=r[e];return"function"==typeof t?t(f):t}))),j=t(!1);if(!O&&!j.current&&e(d,"loading"))return s;j.current=!0;var l=b.reduce((function(r,e,t){return r[e]=d[t].active,r}),{});return i(c,u(u({},f),l))}}};export{f as withPermissionsHOC};
|
|
2
2
|
//# sourceMappingURL=withPermissionsHOC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPermissionsHOC.js","sources":["../../src/permissions/withPermissionsHOC.js"],"sourcesContent":["import { some } from 'lodash';\n\nimport usePermissions from './usePermissions';\n\nimport LoadingIndicator from '~/components/LoadingIndicator';\n\nconst DEFAULT_LOADER = <LoadingIndicator />;\n\nexport const withPermissionsHOC =\n (propKeyToPermission, hocParams = {}) =>\n WrappedComponent =>\n props => {\n const { loader = DEFAULT_LOADER, skipLoading = false } = hocParams;\n\n const propKeys = Object.keys(propKeyToPermission);\n const permissions = usePermissions(\n propKeys.map(propKey => {\n const propValue = propKeyToPermission[propKey];\n\n return typeof propValue === 'function' ? propValue(props) : propValue;\n })\n );\n\n if (!skipLoading && some(permissions, 'loading')) return loader;\n\n const permissionsProps = propKeys.reduce((acc, curr, index) => {\n acc[curr] = permissions[index].active;\n return acc;\n }, {});\n\n return <WrappedComponent {...props} {...permissionsProps} />;\n };\n"],"names":["DEFAULT_LOADER","_jsx","LoadingIndicator","withPermissionsHOC","propKeyToPermission","hocParams","arguments","length","undefined","WrappedComponent","props","loader","_hocParams$loader","_hocParams$skipLoadin","skipLoading","propKeys","Object","keys","permissions","usePermissions","map","propKey","propValue","some","permissionsProps","reduce","acc","curr","index","active","_objectSpread"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withPermissionsHOC.js","sources":["../../src/permissions/withPermissionsHOC.js"],"sourcesContent":["import { some } from 'lodash';\nimport { useRef } from 'react';\n\nimport usePermissions from './usePermissions';\n\nimport LoadingIndicator from '~/components/LoadingIndicator';\n\nconst DEFAULT_LOADER = <LoadingIndicator />;\n\nexport const withPermissionsHOC =\n (propKeyToPermission, hocParams = {}) =>\n WrappedComponent =>\n props => {\n const { loader = DEFAULT_LOADER, skipLoading = false } = hocParams;\n\n const propKeys = Object.keys(propKeyToPermission);\n const permissions = usePermissions(\n propKeys.map(propKey => {\n const propValue = propKeyToPermission[propKey];\n\n return typeof propValue === 'function' ? propValue(props) : propValue;\n })\n );\n\n // Only the first render waits for the checks. Later key changes (a permission derived from\n // props, e.g. per-dashboard update rights) would otherwise swap the mounted component for the\n // loader, unmounting everything it holds and re-running its effects on remount.\n const hasRenderedRef = useRef(false);\n if (!skipLoading && !hasRenderedRef.current && some(permissions, 'loading')) return loader;\n hasRenderedRef.current = true;\n\n const permissionsProps = propKeys.reduce((acc, curr, index) => {\n acc[curr] = permissions[index].active;\n return acc;\n }, {});\n\n return <WrappedComponent {...props} {...permissionsProps} />;\n };\n"],"names":["DEFAULT_LOADER","_jsx","LoadingIndicator","withPermissionsHOC","propKeyToPermission","hocParams","arguments","length","undefined","WrappedComponent","props","loader","_hocParams$loader","_hocParams$skipLoadin","skipLoading","propKeys","Object","keys","permissions","usePermissions","map","propKey","propValue","hasRenderedRef","useRef","current","some","permissionsProps","reduce","acc","curr","index","active","_objectSpread"],"mappings":"8zBAOA,IAAMA,EAAiBC,EAACC,EAAmB,CAAA,GAE9BC,EACX,SAACC,GAAmB,IAAEC,EAAYC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAA,CAAA,EAAE,OACpC,SAAAG,GAAgB,OAChB,SAAAC,GACE,IAAyDL,EAAAA,EAAjDM,OAAAA,aAASX,EAAcY,EAAAC,EAA0BR,EAAxBS,YAAAA,cAAmBD,EAE9CE,EAAWC,OAAOC,KAAKb,GACvBc,EAAcC,EAClBJ,EAASK,KAAI,SAAAC,GACX,IAAMC,EAAYlB,EAAoBiB,GAEtC,MAA4B,mBAAdC,EAA2BA,EAAUZ,GAASY,CAC7D,KAMGC,EAAiBC,GAAO,GAC9B,IAAKV,IAAgBS,EAAeE,SAAWC,EAAKR,EAAa,WAAY,OAAOP,EACpFY,EAAeE,SAAU,EAEzB,IAAME,EAAmBZ,EAASa,QAAO,SAACC,EAAKC,EAAMC,GAEnD,OADAF,EAAIC,GAAQZ,EAAYa,GAAOC,OACxBH,CACR,GAAE,CAAE,GAEL,OAAO5B,EAACQ,EAAgBwB,EAAAA,EAAA,CAAA,EAAKvB,GAAWiB,IACzC,CAAA"}
|