wcz-layout 7.0.0 → 7.0.2

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":"UseUser-Cgnr4DWh.js","sources":["../src/contexts/NotificationContext.tsx","../src/hooks/UseUser.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { AlertColor } from \"@mui/material/Alert\";\n\nexport interface NotificationOptions {\n severity?: AlertColor;\n autoHideDuration?: number;\n}\n\nexport interface NotificationContextValue {\n notify: (message: string, options?: NotificationOptions) => void;\n}\n\nexport const NotificationContext = createContext<NotificationContextValue | null>(null);\n","import type { AuthenticationResult, EventMessage } from \"@azure/msal-browser\";\r\nimport { EventType } from \"@azure/msal-browser\";\r\nimport { useEffect, useState } from \"react\";\r\nimport { pca } from \"~/lib/auth/msalClient\";\r\nimport { buildUser, decodeJwt } from \"~/lib/utils\";\r\nimport type { User } from \"~/models/User\";\r\n\r\nexport const useUser = () => {\r\n const [user, setUser] = useState<User | null>(null);\r\n\r\n const processAccount = () => {\r\n const account = pca.getActiveAccount();\r\n if (account?.idToken) {\r\n const claims = decodeJwt(account.idToken);\r\n const builtUser = buildUser(claims);\r\n setUser(builtUser);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n processAccount();\r\n\r\n const callbackId = pca.addEventCallback((event: EventMessage) => {\r\n if (event.eventType === EventType.ACQUIRE_TOKEN_SUCCESS) {\r\n const payload = event.payload as AuthenticationResult;\r\n if (payload.account) {\r\n pca.setActiveAccount(payload.account);\r\n processAccount();\r\n }\r\n }\r\n });\r\n\r\n return () => {\r\n if (callbackId) {\r\n pca.removeEventCallback(callbackId);\r\n }\r\n };\r\n }, [processAccount]);\r\n\r\n return user;\r\n};\r\n"],"names":["NotificationContext","createContext","useUser","$","_c","user","setUser","useState","t0","Symbol","for","account","pca","getActiveAccount","idToken","claims","decodeJwt","builtUser","buildUser","processAccount","t1","t2","callbackId","addEventCallback","event","eventType","EventType","ACQUIRE_TOKEN_SUCCESS","payload","setActiveAccount","removeEventCallback","useEffect"],"mappings":";;;;AAYO,MAAMA,IAAsBC,EAA+C,IAAI,GCLzEC,IAAUA,MAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,CAAA,GACnB,CAAAC,GAAAC,CAAA,IAAwBC,EAAsB,IAAI;AAAE,MAAAC;AAAA,EAAAL,EAAA,CAAA,MAAAM,uBAAAC,IAAA,2BAAA,KAE7BF,IAAAA,MAAA;AACnB,UAAAG,IAAgBC,EAAGC,iBAAAA;AACnB,QAAIF,GAAOG,SAAS;AAChB,YAAAC,IAAeC,EAAUL,EAAOG,OAAQ,GACxCG,IAAkBC,EAAUH,CAAM;AAClCT,MAAAA,EAAQW,CAAS;AAAA,IAAC;AAAA,EACrB,GACJd,OAAAK,KAAAA,IAAAL,EAAA,CAAA;AAPD,QAAAgB,IAAuBX;AAOrB,MAAAY,GAAAC;AAAA,SAAAlB,EAAA,CAAA,MAAAM,uBAAAC,IAAA,2BAAA,KAEQU,IAAAA,MAAA;AACND,IAAAA,EAAAA;AAEA,UAAAG,IAAmBV,EAAGW,iBAAkBC,CAAAA,MAAA;AACpC,UAAIA,EAAKC,cAAeC,EAASC,uBAAsB;AACnD,cAAAC,IAAgBJ,EAAKI;AACrB,QAAIA,EAAOjB,YACPC,EAAGiB,iBAAkBD,EAAOjB,OAAQ,GACpCQ,EAAAA;AAAAA,MACH;AAAA,IACJ,CACJ;AAAE,WAEI,MAAA;AACH,MAAIG,KACAV,EAAGkB,oBAAqBR,CAAU;AAAA,IACrC;AAAA,EACJ,GACFD,IAAA,CAACF,CAAc,GAAChB,OAAAiB,GAAAjB,OAAAkB,MAAAD,IAAAjB,EAAA,CAAA,GAAAkB,IAAAlB,EAAA,CAAA,IAlBnB4B,EAAUX,GAkBPC,CAAgB,GAEZhB;AAAI;"}
1
+ {"version":3,"file":"UseUser-Cgnr4DWh.js","sources":["../src/contexts/NotificationContext.tsx","../src/hooks/UseUser.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { AlertColor } from \"@mui/material/Alert\";\n\nexport interface NotificationOptions {\n severity?: AlertColor;\n autoHideDuration?: number;\n}\n\nexport interface NotificationContextValue {\n notify: (message: string, options?: NotificationOptions) => void;\n}\n\nexport const NotificationContext = createContext<NotificationContextValue | null>(null);\n","import { EventType } from \"@azure/msal-browser\";\r\nimport { useEffect, useState } from \"react\";\r\nimport type { AuthenticationResult, EventMessage } from \"@azure/msal-browser\";\r\nimport type { User } from \"~/models/User\";\r\nimport { pca } from \"~/lib/auth/msalClient\";\r\nimport { buildUser, decodeJwt } from \"~/lib/utils\";\r\n\r\nexport const useUser = () => {\r\n const [user, setUser] = useState<User | null>(null);\r\n\r\n const processAccount = () => {\r\n const account = pca.getActiveAccount();\r\n if (account?.idToken) {\r\n const claims = decodeJwt(account.idToken);\r\n const builtUser = buildUser(claims);\r\n setUser(builtUser);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n processAccount();\r\n\r\n const callbackId = pca.addEventCallback((event: EventMessage) => {\r\n if (event.eventType === EventType.ACQUIRE_TOKEN_SUCCESS) {\r\n const payload = event.payload as AuthenticationResult;\r\n if (payload.account) {\r\n pca.setActiveAccount(payload.account);\r\n processAccount();\r\n }\r\n }\r\n });\r\n\r\n return () => {\r\n if (callbackId) {\r\n pca.removeEventCallback(callbackId);\r\n }\r\n };\r\n }, [processAccount]);\r\n\r\n return user;\r\n};\r\n"],"names":["NotificationContext","createContext","useUser","$","_c","user","setUser","useState","t0","Symbol","for","account","pca","getActiveAccount","idToken","claims","decodeJwt","builtUser","buildUser","processAccount","t1","t2","callbackId","addEventCallback","event","eventType","EventType","ACQUIRE_TOKEN_SUCCESS","payload","setActiveAccount","removeEventCallback","useEffect"],"mappings":";;;;AAYO,MAAMA,IAAsBC,EAA+C,IAAI,GCLzEC,IAAUA,MAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,CAAA,GACnB,CAAAC,GAAAC,CAAA,IAAwBC,EAAsB,IAAI;AAAE,MAAAC;AAAA,EAAAL,EAAA,CAAA,MAAAM,uBAAAC,IAAA,2BAAA,KAE7BF,IAAAA,MAAA;AACnB,UAAAG,IAAgBC,EAAGC,iBAAAA;AACnB,QAAIF,GAAOG,SAAS;AAChB,YAAAC,IAAeC,EAAUL,EAAOG,OAAQ,GACxCG,IAAkBC,EAAUH,CAAM;AAClCT,MAAAA,EAAQW,CAAS;AAAA,IAAC;AAAA,EACrB,GACJd,OAAAK,KAAAA,IAAAL,EAAA,CAAA;AAPD,QAAAgB,IAAuBX;AAOrB,MAAAY,GAAAC;AAAA,SAAAlB,EAAA,CAAA,MAAAM,uBAAAC,IAAA,2BAAA,KAEQU,IAAAA,MAAA;AACND,IAAAA,EAAAA;AAEA,UAAAG,IAAmBV,EAAGW,iBAAkBC,CAAAA,MAAA;AACpC,UAAIA,EAAKC,cAAeC,EAASC,uBAAsB;AACnD,cAAAC,IAAgBJ,EAAKI;AACrB,QAAIA,EAAOjB,YACPC,EAAGiB,iBAAkBD,EAAOjB,OAAQ,GACpCQ,EAAAA;AAAAA,MACH;AAAA,IACJ,CACJ;AAAE,WAEI,MAAA;AACH,MAAIG,KACAV,EAAGkB,oBAAqBR,CAAU;AAAA,IACrC;AAAA,EACJ,GACFD,IAAA,CAACF,CAAc,GAAChB,OAAAiB,GAAAjB,OAAAkB,MAAAD,IAAAjB,EAAA,CAAA,GAAAkB,IAAAlB,EAAA,CAAA,IAlBnB4B,EAAUX,GAkBPC,CAAgB,GAEZhB;AAAI;"}
@@ -1,6 +1,6 @@
1
+ import { Navigation } from '../../models/Navigation';
1
2
  import { FC, ReactNode } from 'react';
2
3
  import { LayoutOptions } from '../../models/LayoutOptions';
3
- import { Navigation } from '../../models/Navigation';
4
4
  interface LayoutProps {
5
5
  navigation: Navigation | undefined;
6
6
  options: LayoutOptions | undefined;
@@ -0,0 +1,11 @@
1
+ import { FC } from 'react';
2
+ import { Navigation } from '../../../models/Navigation';
3
+ interface NavigationContentProps {
4
+ navigation: Navigation;
5
+ collapsed: boolean;
6
+ expanded: boolean;
7
+ setExpanded: (open: boolean) => void;
8
+ showPermanent: boolean;
9
+ }
10
+ export declare const NavigationContent: FC<NavigationContentProps>;
11
+ export {};