dinocollab-core 2.0.3 → 2.0.5

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 (99) hide show
  1. package/dist/api-context.d.ts +2 -0
  2. package/dist/api-context.js +2 -0
  3. package/dist/api-context.mjs +2 -0
  4. package/dist/components/image-with-fallback.js +1 -1
  5. package/dist/components/image-with-fallback.js.map +1 -1
  6. package/dist/components.d.ts +2 -0
  7. package/dist/components.js +2 -0
  8. package/dist/components.mjs +2 -0
  9. package/dist/data-view.d.ts +2 -0
  10. package/dist/data-view.js +2 -0
  11. package/dist/data-view.mjs +2 -0
  12. package/dist/form.d.ts +2 -0
  13. package/dist/form.js +2 -0
  14. package/dist/form.mjs +2 -0
  15. package/dist/hooks/check-scrolled.js +2 -0
  16. package/dist/hooks/check-scrolled.js.map +1 -0
  17. package/dist/hooks/debounce.js +2 -0
  18. package/dist/hooks/debounce.js.map +1 -0
  19. package/dist/hooks/index.js +1 -1
  20. package/dist/hooks/index.js.map +1 -1
  21. package/dist/hooks/use-fetch-data.js +2 -0
  22. package/dist/hooks/use-fetch-data.js.map +1 -0
  23. package/dist/hooks.d.ts +2 -0
  24. package/dist/hooks.js +2 -0
  25. package/dist/hooks.mjs +2 -0
  26. package/dist/http-service.d.ts +2 -0
  27. package/dist/http-service.js +2 -0
  28. package/dist/http-service.mjs +2 -0
  29. package/dist/mfe-shared/auth.js +1 -1
  30. package/dist/mfe-shared/auth.js.map +1 -1
  31. package/dist/mfe-shared/auth.ssr.js +1 -1
  32. package/dist/mfe-shared/auth.ssr.js.map +1 -1
  33. package/dist/mfe-shared/auth.types.js.map +1 -1
  34. package/dist/mfe-shared/cart.js +1 -1
  35. package/dist/mfe-shared/cart.js.map +1 -1
  36. package/dist/mfe-shared/cart.ssr.js +1 -1
  37. package/dist/mfe-shared/cart.ssr.js.map +1 -1
  38. package/dist/mfe-shared/hydration-helper.js +1 -1
  39. package/dist/mfe-shared/hydration-helper.js.map +1 -1
  40. package/dist/mfe-shared/index.js +1 -1
  41. package/dist/mfe-shared/mfe-bridge.js.map +1 -1
  42. package/dist/mfe-shared/navigation.js +1 -1
  43. package/dist/mfe-shared/navigation.js.map +1 -1
  44. package/dist/mfe-shared.d.ts +2 -0
  45. package/dist/mfe-shared.js +2 -0
  46. package/dist/mfe-shared.mjs +2 -0
  47. package/dist/redux.d.ts +2 -0
  48. package/dist/redux.js +2 -0
  49. package/dist/redux.mjs +2 -0
  50. package/dist/table-grid.d.ts +2 -0
  51. package/dist/table-grid.js +2 -0
  52. package/dist/table-grid.mjs +2 -0
  53. package/dist/table.d.ts +2 -0
  54. package/dist/table.js +2 -0
  55. package/dist/table.mjs +2 -0
  56. package/dist/types/hooks/check-scrolled.d.ts +3 -0
  57. package/dist/types/hooks/debounce.d.ts +1 -0
  58. package/dist/types/hooks/index.d.ts +4 -4
  59. package/dist/types/hooks/use-fetch-data.d.ts +11 -0
  60. package/dist/types/mfe-shared/auth.d.ts +16 -11
  61. package/dist/types/mfe-shared/auth.ssr.d.ts +7 -7
  62. package/dist/types/mfe-shared/auth.types.d.ts +4 -4
  63. package/dist/types/mfe-shared/cart.d.ts +2 -2
  64. package/dist/types/mfe-shared/cart.debug.d.ts +2 -2
  65. package/dist/types/mfe-shared/hydration-helper.d.ts +4 -4
  66. package/dist/types/mfe-shared/index.d.ts +9 -7
  67. package/dist/types/mfe-shared/mfe-bridge.d.ts +4 -4
  68. package/dist/types/mfe-shared/navigation.d.ts +2 -2
  69. package/dist/types/mfe-shared/types.d.ts +4 -4
  70. package/dist/utils.d.ts +2 -0
  71. package/dist/utils.js +2 -0
  72. package/dist/utils.mjs +2 -0
  73. package/package.json +90 -8
  74. package/dist/mfe-auth/auth-enums.js +0 -2
  75. package/dist/mfe-auth/auth-enums.js.map +0 -1
  76. package/dist/mfe-auth/auth-mfe-manager.js +0 -2
  77. package/dist/mfe-auth/auth-mfe-manager.js.map +0 -1
  78. package/dist/mfe-auth/auth-mfe-provider.js +0 -2
  79. package/dist/mfe-auth/auth-mfe-provider.js.map +0 -1
  80. package/dist/mfe-auth/auth-types.js +0 -2
  81. package/dist/mfe-auth/auth-types.js.map +0 -1
  82. package/dist/mfe-auth/index.js +0 -2
  83. package/dist/mfe-auth/index.js.map +0 -1
  84. package/dist/mfe-auth/micro-frontend-auth-hooks.js +0 -2
  85. package/dist/mfe-auth/micro-frontend-auth-hooks.js.map +0 -1
  86. package/dist/types/mfe-auth/auth-enums.d.ts +0 -40
  87. package/dist/types/mfe-auth/auth-mfe-manager.d.ts +0 -68
  88. package/dist/types/mfe-auth/auth-mfe-provider.d.ts +0 -19
  89. package/dist/types/mfe-auth/auth-types.d.ts +0 -33
  90. package/dist/types/mfe-auth/index.d.ts +0 -6
  91. package/dist/types/mfe-auth/micro-frontend-auth-hooks.d.ts +0 -164
  92. package/dist/types/mfe-navigate/index.d.ts +0 -2
  93. package/dist/types/mfe-navigate/mfe-navigate.debug.d.ts +0 -4
  94. package/dist/types/mfe-navigate/mfe-navigate.remote.d.ts +0 -11
  95. package/dist/types/mfe-navigate/nextjs/index.d.ts +0 -1
  96. package/dist/types/mfe-navigate/nextjs/provider.d.ts +0 -2
  97. package/dist/types/mfe-navigate/react/index.d.ts +0 -1
  98. package/dist/types/mfe-navigate/react/provider.d.ts +0 -3
  99. package/dist/types/mfe-navigate/types.d.ts +0 -13
package/dist/table.mjs ADDED
@@ -0,0 +1,2 @@
1
+ // Re-export from table submodule (ESM)
2
+ export * from './table/index.js';
@@ -0,0 +1,3 @@
1
+ export declare const useCheckScrolled: () => {
2
+ isScrolled: boolean;
3
+ };
@@ -0,0 +1 @@
1
+ export declare const useDebounce: <T>(value: T, delay: number) => T;
@@ -1,4 +1,4 @@
1
- export declare const useCheckScrolled: () => {
2
- isScrolled: boolean;
3
- };
4
- export declare const useDebounce: <T>(value: T, delay: number) => T;
1
+ export { useCheckScrolled } from './check-scrolled';
2
+ export { useDebounce } from './debounce';
3
+ export { useFetchData, errorMessageHandler } from './use-fetch-data';
4
+ export type { FetcherFunction } from './use-fetch-data';
@@ -0,0 +1,11 @@
1
+ export declare const errorMessageHandler: (error: any, options?: {
2
+ message?: string;
3
+ logAll?: boolean;
4
+ }) => {
5
+ isAbortError: boolean;
6
+ };
7
+ export type FetcherFunction<T> = (signal?: AbortSignal) => Promise<T>;
8
+ export declare function useFetchData<T, F extends FetcherFunction<T>>(fetcher: F): {
9
+ data: Awaited<ReturnType<F>> | undefined;
10
+ loading: boolean;
11
+ };
@@ -1,19 +1,25 @@
1
1
  import React from 'react';
2
- import { AuthState, User } from './auth.types';
3
- interface ILoginParams {
2
+ import { IAuthState, IUser } from './auth.types';
3
+ /**
4
+ * Login parameters structure
5
+ */
6
+ export interface ILoginParams {
4
7
  username: string;
5
8
  password: string;
6
9
  }
7
- interface ILoginResponse {
10
+ /**
11
+ * Login response structure
12
+ */
13
+ export interface ILoginResponse {
8
14
  isAuthenticated: boolean;
9
- user?: User;
15
+ user?: IUser;
10
16
  error?: string;
11
17
  }
12
- export interface IAuthProviderProps {
18
+ export interface IMfeAuthProviderProps {
13
19
  children?: React.ReactNode;
14
20
  onLogin?: (params: ILoginParams) => Promise<ILoginResponse | void>;
15
21
  onLogout?: () => Promise<boolean | void>;
16
- initialState?: AuthState;
22
+ initialState?: IAuthState;
17
23
  authData?: {
18
24
  id?: string;
19
25
  displayName?: string;
@@ -22,7 +28,7 @@ export interface IAuthProviderProps {
22
28
  roles?: string[];
23
29
  [key: string]: any;
24
30
  };
25
- onAuthChange?: (callback: (newState: AuthState) => void) => () => void;
31
+ onAuthChange?: (callback: (newState: IAuthState) => void) => () => void;
26
32
  }
27
33
  /**
28
34
  * AuthProvider - Component for Host application
@@ -32,14 +38,13 @@ export interface IAuthProviderProps {
32
38
  *
33
39
  * Host can customize login/logout behavior by providing custom handlers.
34
40
  */
35
- export declare const AuthProvider: React.FC<IAuthProviderProps>;
36
- export declare function useAuth(): {
41
+ export declare const MfeAuthProvider: React.FC<IMfeAuthProviderProps>;
42
+ export declare function useMfeAuth(): {
37
43
  login: (username: string, password: string) => void;
38
44
  logout: () => void;
39
45
  isAuthenticated: boolean;
40
46
  isLoading: boolean;
41
- user: User | null;
47
+ user: IUser | null;
42
48
  error: string | null;
43
49
  serverRendered?: boolean | undefined;
44
50
  };
45
- export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AuthState, User } from './auth.types';
3
- import { type IAuthProviderProps } from './auth';
2
+ import { IAuthState, IUser } from './auth.types';
3
+ import { type IMfeAuthProviderProps } from './auth';
4
4
  /**
5
5
  * Props for the SSR-compatible auth provider
6
6
  */
@@ -8,9 +8,9 @@ interface ISsrAuthProviderProps {
8
8
  /** Content to render */
9
9
  children: React.ReactNode;
10
10
  /** Initial auth state for SSR */
11
- initialAuthState?: AuthState;
11
+ initialAuthState?: IAuthState;
12
12
  /** User data for initial state */
13
- userData?: User;
13
+ userData?: IUser;
14
14
  /** Custom auth data to be passed to AuthProvider */
15
15
  authData?: {
16
16
  id?: string;
@@ -21,11 +21,11 @@ interface ISsrAuthProviderProps {
21
21
  [key: string]: any;
22
22
  };
23
23
  /** Custom login handler */
24
- onLogin?: IAuthProviderProps['onLogin'];
24
+ onLogin?: IMfeAuthProviderProps['onLogin'];
25
25
  /** Custom logout handler */
26
- onLogout?: IAuthProviderProps['onLogout'];
26
+ onLogout?: IMfeAuthProviderProps['onLogout'];
27
27
  /** Auth state change subscription */
28
- onAuthChange?: IAuthProviderProps['onAuthChange'];
28
+ onAuthChange?: IMfeAuthProviderProps['onAuthChange'];
29
29
  }
30
30
  /**
31
31
  * Auth provider component that supports SSR
@@ -7,7 +7,7 @@
7
7
  /**
8
8
  * User data structure
9
9
  */
10
- export type User = {
10
+ export type IUser = {
11
11
  /** Unique identifier for the user */
12
12
  id: string;
13
13
  /** User's display name */
@@ -22,13 +22,13 @@ export type User = {
22
22
  /**
23
23
  * Authentication state structure
24
24
  */
25
- export type AuthState = {
25
+ export type IAuthState = {
26
26
  /** Whether the user is currently authenticated */
27
27
  isAuthenticated: boolean;
28
28
  /** Whether an authentication operation is in progress */
29
29
  isLoading: boolean;
30
30
  /** The authenticated user, or null if not authenticated */
31
- user: User | null;
31
+ user: IUser | null;
32
32
  /** Error message if authentication failed, or null */
33
33
  error: string | null;
34
34
  /** Whether the auth state was rendered on the server */
@@ -50,4 +50,4 @@ export declare const AUTH_CHANNELS: {
50
50
  /**
51
51
  * Default authentication state - unauthenticated, not loading, no user, no error
52
52
  */
53
- export declare const INITIAL_AUTH_STATE: AuthState;
53
+ export declare const INITIAL_AUTH_STATE: IAuthState;
@@ -40,7 +40,7 @@ export interface ICartItem {
40
40
  * - Listen for cart events (add, remove, clear, update)
41
41
  * - Provide current cart state
42
42
  */
43
- export declare const useCartStore: () => {
43
+ export declare const useMfeCartStore: () => {
44
44
  items: ICartItem[];
45
45
  totalItems: number;
46
46
  };
@@ -51,7 +51,7 @@ export declare const useCartStore: () => {
51
51
  * - Use mfeEventBridge to communicate with other microFEs
52
52
  * - Provide add, remove, clear, and update actions
53
53
  */
54
- export declare const useCartActions: () => {
54
+ export declare const useMfeCartActions: () => {
55
55
  addToCart: (item: ICartItem) => void;
56
56
  removeFromCart: (itemId: number) => void;
57
57
  clearCart: () => void;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- interface DebugPanelProps {
2
+ interface IDebugPanelProps {
3
3
  title?: string;
4
4
  style?: React.CSSProperties;
5
5
  channelPrefix?: string;
6
6
  }
7
- export declare const MfeCartDebugPanel: React.FC<DebugPanelProps>;
7
+ export declare const MfeCartDebugPanel: React.FC<IDebugPanelProps>;
8
8
  export default MfeCartDebugPanel;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  /**
3
3
  * Hydration state for components
4
4
  */
5
- export declare enum HydrationState {
5
+ export declare enum IHydrationState {
6
6
  /** Component is rendering on the server */
7
7
  SERVER = "server",
8
8
  /** Component is in the process of hydrating on the client */
@@ -13,7 +13,7 @@ export declare enum HydrationState {
13
13
  /**
14
14
  * Props for the HydrationGuard component
15
15
  */
16
- export interface HydrationGuardProps {
16
+ export interface IHydrationGuardProps {
17
17
  /** Content to render */
18
18
  children: React.ReactNode;
19
19
  /** Optional fallback content to show during server rendering */
@@ -33,7 +33,7 @@ export interface HydrationGuardProps {
33
33
  * and client-side hydration, allowing different content to be shown during
34
34
  * different stages of the hydration process.
35
35
  */
36
- export declare const HydrationGuard: React.FC<HydrationGuardProps>;
36
+ export declare const HydrationGuard: React.FC<IHydrationGuardProps>;
37
37
  /**
38
38
  * Hook to get the current hydration state
39
39
  *
@@ -43,4 +43,4 @@ export declare const HydrationGuard: React.FC<HydrationGuardProps>;
43
43
  * @param hydrationDelay Optional delay before considering the component hydrated
44
44
  * @returns Current hydration state
45
45
  */
46
- export declare const useHydration: (hydrationDelay?: number) => HydrationState;
46
+ export declare const useHydration: (hydrationDelay?: number) => IHydrationState;
@@ -5,17 +5,19 @@
5
5
  * Only the public API is exported here, internal implementation details are hidden.
6
6
  */
7
7
  export { mfeBridge } from './mfe-bridge';
8
- export { AuthProvider, type IAuthProviderProps } from './auth';
9
- export { useAuth } from './auth';
10
- export { type AuthState, type User } from './auth.types';
8
+ export { MfeAuthProvider } from './auth';
9
+ export type { IMfeAuthProviderProps, ILoginParams, ILoginResponse } from './auth';
10
+ export { useMfeAuth } from './auth';
11
+ export type { IAuthState, IUser } from './auth.types';
11
12
  export { AUTH_CHANNELS } from './auth.types';
12
13
  export { SsrAuthProvider } from './auth.ssr';
13
- export { useCartStore, useCartActions } from './cart';
14
+ export { useMfeCartStore, useMfeCartActions } from './cart';
14
15
  export type { ICartItem } from './cart';
15
16
  export { CART_CHANNELS } from './cart';
16
17
  export { SsrCartProvider } from './cart.ssr';
17
- export { useMfeNavigate, MfeLink, MfeNavigateReactProvider } from './navigation';
18
- export type { IMfeNavigate, IMfeLinkProps } from './navigation';
18
+ export { useMfeNavigate, MfeLink, MfeNavigateProvider } from './navigation';
19
+ export type { IMfeNavigate, IMfeLinkProps, NavigateFunction, AppSite, IMfeNavigateProviderProps } from './navigation';
19
20
  export { NAVIGATION_CHANNELS } from './navigation';
20
21
  export { isBrowser } from './environment';
21
- export { HydrationGuard } from './hydration-helper';
22
+ export { HydrationGuard, useHydration } from './hydration-helper';
23
+ export type { IHydrationState } from './hydration-helper';
@@ -2,12 +2,12 @@
2
2
  * Callback function type for event subscribers
3
3
  * @template T Type of payload data
4
4
  */
5
- type Callback<T = any> = (payload: T) => void;
5
+ type ICallback<T = any> = (payload: T) => void;
6
6
  /**
7
7
  * Middleware function type for intercepting events
8
8
  * @returns boolean|void Return false to cancel event propagation
9
9
  */
10
- type Middleware = (channel: string, payload: any) => boolean | void;
10
+ type IMiddleware = (channel: string, payload: any) => boolean | void;
11
11
  /**
12
12
  * MfeBridge - Event-based communication system for micro-frontends
13
13
  *
@@ -24,7 +24,7 @@ declare class MfeBridge {
24
24
  * @param callback Function to call when an event occurs on this channel
25
25
  * @returns Unsubscribe function to remove the event listener
26
26
  */
27
- subscribe<T = any>(channel: string, callback: Callback<T>): () => void;
27
+ subscribe<T = any>(channel: string, callback: ICallback<T>): () => void;
28
28
  /**
29
29
  * Publish an event to a specific channel
30
30
  * @template T Type of payload data
@@ -36,7 +36,7 @@ declare class MfeBridge {
36
36
  * Add middleware to intercept events before they're published
37
37
  * @param middleware Function that can inspect or modify events
38
38
  */
39
- use(middleware: Middleware): void;
39
+ use(middleware: IMiddleware): void;
40
40
  /**
41
41
  * Remove all middleware
42
42
  */
@@ -25,7 +25,7 @@ export interface IMfeLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorEleme
25
25
  }
26
26
  export declare const MfeLink: FC<IMfeLinkProps>;
27
27
  export type NavigateFunction<O = any> = (path: string, options?: O) => void;
28
- export interface IMfeNavigateReactProviderProps {
28
+ export interface IMfeNavigateProviderProps {
29
29
  navigate: NavigateFunction;
30
30
  }
31
- export declare const MfeNavigateReactProvider: FC<IMfeNavigateReactProviderProps>;
31
+ export declare const MfeNavigateProvider: FC<IMfeNavigateProviderProps>;
@@ -4,8 +4,8 @@
4
4
  * This file is used to re-export all types from the library
5
5
  * to ensure they're available to consumers.
6
6
  */
7
- export * from './auth.types';
8
- export type { IAuthProviderProps } from './auth';
9
- export type { HydrationState } from './hydration-helper';
10
- export type { AppSite, IMfeNavigate, IMfeNavigateHref, IMfeLinkProps, NavigateFunction, IMfeNavigateReactProviderProps } from './navigation';
7
+ export type { IAuthState, IUser } from './auth.types';
8
+ export type { IMfeAuthProviderProps as IAuthProviderProps, ILoginParams, ILoginResponse } from './auth';
11
9
  export type { ICartItem } from './cart';
10
+ export type { AppSite, IMfeNavigate, IMfeNavigateHref, IMfeLinkProps, NavigateFunction, IMfeNavigateProviderProps as IMfeNavigateReactProviderProps } from './navigation';
11
+ export type { IHydrationState } from './hydration-helper';
@@ -0,0 +1,2 @@
1
+ // Re-export types from utils submodule
2
+ export * from './types/utils/index';
package/dist/utils.js ADDED
@@ -0,0 +1,2 @@
1
+ // Re-export from utils submodule
2
+ module.exports = require('./utils/index.js');
package/dist/utils.mjs ADDED
@@ -0,0 +1,2 @@
1
+ // Re-export from utils submodule (ESM)
2
+ export * from './utils/index.js';
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "dinocollab-core",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/types/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "scripts": {
10
- "build": "npx rimraf dist && rollup -c",
10
+ "build": "npx rimraf dist && rollup -c && node create-proxy-files.js",
11
11
  "build:watch": "rollup -c -w",
12
- "build:analyze": "npx rimraf dist && rollup -c",
12
+ "build:analyze": "npx rimraf dist && rollup -c && node create-proxy-files.js",
13
13
  "calc-size": "node calc-build-size.js"
14
14
  },
15
15
  "bin": {
@@ -21,37 +21,73 @@
21
21
  ],
22
22
  "typesVersions": {
23
23
  "*": {
24
+ ".": [
25
+ "./dist/types/index.d.ts"
26
+ ],
24
27
  "api-context": [
28
+ "./dist/api-context.d.ts"
29
+ ],
30
+ "./api-context": [
25
31
  "./dist/types/api-context/index.d.ts"
26
32
  ],
27
33
  "components": [
34
+ "./dist/components.d.ts"
35
+ ],
36
+ "./components": [
28
37
  "./dist/types/components/index.d.ts"
29
38
  ],
30
39
  "data-view": [
40
+ "./dist/data-view.d.ts"
41
+ ],
42
+ "./data-view": [
31
43
  "./dist/types/data-view/index.d.ts"
32
44
  ],
33
45
  "form": [
46
+ "./dist/form.d.ts"
47
+ ],
48
+ "./form": [
34
49
  "./dist/types/form/index.d.ts"
35
50
  ],
36
51
  "hooks": [
52
+ "./dist/hooks.d.ts"
53
+ ],
54
+ "./hooks": [
37
55
  "./dist/types/hooks/index.d.ts"
38
56
  ],
39
57
  "http-service": [
58
+ "./dist/http-service.d.ts"
59
+ ],
60
+ "./http-service": [
40
61
  "./dist/types/http-service/index.d.ts"
41
62
  ],
42
63
  "mfe-shared": [
64
+ "./dist/mfe-shared.d.ts"
65
+ ],
66
+ "./mfe-shared": [
43
67
  "./dist/types/mfe-shared/index.d.ts"
44
68
  ],
45
69
  "redux": [
70
+ "./dist/redux.d.ts"
71
+ ],
72
+ "./redux": [
46
73
  "./dist/types/redux/index.d.ts"
47
74
  ],
48
75
  "table": [
76
+ "./dist/table.d.ts"
77
+ ],
78
+ "./table": [
49
79
  "./dist/types/table/index.d.ts"
50
80
  ],
51
81
  "table-grid": [
82
+ "./dist/table-grid.d.ts"
83
+ ],
84
+ "./table-grid": [
52
85
  "./dist/types/table-grid/index.d.ts"
53
86
  ],
54
87
  "utils": [
88
+ "./dist/utils.d.ts"
89
+ ],
90
+ "./utils": [
55
91
  "./dist/types/utils/index.d.ts"
56
92
  ]
57
93
  }
@@ -59,52 +95,98 @@
59
95
  "exports": {
60
96
  ".": {
61
97
  "import": "./dist/index.js",
98
+ "require": "./dist/index.js",
62
99
  "types": "./dist/types/index.d.ts"
63
100
  },
64
101
  "./api-context": {
65
102
  "import": "./dist/api-context/index.js",
103
+ "require": "./dist/api-context/index.js",
66
104
  "types": "./dist/types/api-context/index.d.ts"
67
105
  },
106
+ "./api-context.js": "./dist/api-context.js",
107
+ "./api-context.mjs": "./dist/api-context.mjs",
108
+ "./api-context.d.ts": "./dist/api-context.d.ts",
68
109
  "./components": {
69
110
  "import": "./dist/components/index.js",
111
+ "require": "./dist/components/index.js",
70
112
  "types": "./dist/types/components/index.d.ts"
71
113
  },
114
+ "./components.js": "./dist/components.js",
115
+ "./components.mjs": "./dist/components.mjs",
116
+ "./components.d.ts": "./dist/components.d.ts",
72
117
  "./data-view": {
73
118
  "import": "./dist/data-view/index.js",
119
+ "require": "./dist/data-view/index.js",
74
120
  "types": "./dist/types/data-view/index.d.ts"
75
121
  },
122
+ "./data-view.js": "./dist/data-view.js",
123
+ "./data-view.mjs": "./dist/data-view.mjs",
124
+ "./data-view.d.ts": "./dist/data-view.d.ts",
76
125
  "./form": {
77
126
  "import": "./dist/form/index.js",
127
+ "require": "./dist/form/index.js",
78
128
  "types": "./dist/types/form/index.d.ts"
79
129
  },
130
+ "./form.js": "./dist/form.js",
131
+ "./form.mjs": "./dist/form.mjs",
132
+ "./form.d.ts": "./dist/form.d.ts",
80
133
  "./hooks": {
81
134
  "import": "./dist/hooks/index.js",
135
+ "require": "./dist/hooks/index.js",
82
136
  "types": "./dist/types/hooks/index.d.ts"
83
137
  },
138
+ "./hooks.js": "./dist/hooks.js",
139
+ "./hooks.mjs": "./dist/hooks.mjs",
140
+ "./hooks.d.ts": "./dist/hooks.d.ts",
84
141
  "./http-service": {
85
142
  "import": "./dist/http-service/index.js",
143
+ "require": "./dist/http-service/index.js",
86
144
  "types": "./dist/types/http-service/index.d.ts"
87
145
  },
146
+ "./http-service.js": "./dist/http-service.js",
147
+ "./http-service.mjs": "./dist/http-service.mjs",
148
+ "./http-service.d.ts": "./dist/http-service.d.ts",
88
149
  "./mfe-shared": {
89
150
  "import": "./dist/mfe-shared/index.js",
151
+ "require": "./dist/mfe-shared/index.js",
90
152
  "types": "./dist/types/mfe-shared/index.d.ts"
91
153
  },
92
- "./utils": {
93
- "import": "./dist/utils/index.js",
94
- "types": "./dist/types/utils/index.d.ts"
95
- },
154
+ "./mfe-shared.js": "./dist/mfe-shared.js",
155
+ "./mfe-shared.mjs": "./dist/mfe-shared.mjs",
156
+ "./mfe-shared.d.ts": "./dist/mfe-shared.d.ts",
96
157
  "./redux": {
97
158
  "import": "./dist/redux/index.js",
159
+ "require": "./dist/redux/index.js",
98
160
  "types": "./dist/types/redux/index.d.ts"
99
161
  },
162
+ "./redux.js": "./dist/redux.js",
163
+ "./redux.mjs": "./dist/redux.mjs",
164
+ "./redux.d.ts": "./dist/redux.d.ts",
100
165
  "./table": {
101
166
  "import": "./dist/table/index.js",
167
+ "require": "./dist/table/index.js",
102
168
  "types": "./dist/types/table/index.d.ts"
103
169
  },
170
+ "./table.js": "./dist/table.js",
171
+ "./table.mjs": "./dist/table.mjs",
172
+ "./table.d.ts": "./dist/table.d.ts",
104
173
  "./table-grid": {
105
174
  "import": "./dist/table-grid/index.js",
175
+ "require": "./dist/table-grid/index.js",
106
176
  "types": "./dist/types/table-grid/index.d.ts"
107
- }
177
+ },
178
+ "./table-grid.js": "./dist/table-grid.js",
179
+ "./table-grid.mjs": "./dist/table-grid.mjs",
180
+ "./table-grid.d.ts": "./dist/table-grid.d.ts",
181
+ "./utils": {
182
+ "import": "./dist/utils/index.js",
183
+ "require": "./dist/utils/index.js",
184
+ "types": "./dist/types/utils/index.d.ts"
185
+ },
186
+ "./utils.js": "./dist/utils.js",
187
+ "./utils.mjs": "./dist/utils.mjs",
188
+ "./utils.d.ts": "./dist/utils.d.ts",
189
+ "./package.json": "./package.json"
108
190
  },
109
191
  "keywords": [],
110
192
  "author": "@dinocollab",
@@ -1,2 +0,0 @@
1
- var E,A;!function(E){E.UNAUTHENTICATED="UNAUTHENTICATED",E.AUTHENTICATED="AUTHENTICATED",E.AUTHENTICATING="AUTHENTICATING",E.LOADING="LOADING",E.ERROR="ERROR"}(E||(E={})),function(E){E.DASHBOARD="DASHBOARD",E.PROFILE="PROFILE",E.SETTINGS="SETTINGS",E.MEDIA_STORE="MEDIA_STORE",E.APP_HEADER="APP_HEADER",E.APP_FOOTER="APP_FOOTER",E.VIDEO_GROUP="VIDEO_GROUP",E.TRACK_GROUP="TRACK_GROUP",E.GENERIC="GENERIC"}(A||(A={}));export{E as AuthStatus,A as MicroFrontendType};
2
- //# sourceMappingURL=auth-enums.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-enums.js","sources":["../../src/mfe-auth/auth-enums.ts"],"sourcesContent":["/**\r\n * Authentication Status Enumeration\r\n * Defines possible states of user authentication\r\n */\r\nexport enum AuthStatus {\r\n /** User is not authenticated */\r\n UNAUTHENTICATED = 'UNAUTHENTICATED',\r\n\r\n /** User is successfully authenticated */\r\n AUTHENTICATED = 'AUTHENTICATED',\r\n\r\n /** Authentication process is in progress */\r\n AUTHENTICATING = 'AUTHENTICATING',\r\n\r\n /** Loading authentication state or user data */\r\n LOADING = 'LOADING',\r\n\r\n /** Authentication error occurred */\r\n ERROR = 'ERROR'\r\n}\r\n\r\n/**\r\n * Micro Frontend Type Enumeration\r\n * Identifies different types of micro frontend components\r\n */\r\nexport enum MicroFrontendType {\r\n /** Main dashboard component */\r\n DASHBOARD = 'DASHBOARD',\r\n\r\n /** User profile component */\r\n PROFILE = 'PROFILE',\r\n\r\n /** Settings and configuration component */\r\n SETTINGS = 'SETTINGS',\r\n\r\n /** Media store and gallery component */\r\n MEDIA_STORE = 'MEDIA_STORE',\r\n\r\n /** Application header component */\r\n APP_HEADER = 'APP_HEADER',\r\n\r\n /** Application footer component */\r\n APP_FOOTER = 'APP_FOOTER',\r\n\r\n /** Video player and gallery component */\r\n VIDEO_GROUP = 'VIDEO_GROUP',\r\n\r\n /** Audio track and playlist component */\r\n TRACK_GROUP = 'TRACK_GROUP',\r\n\r\n /** Generic or custom micro frontend component */\r\n GENERIC = 'GENERIC'\r\n}\r\n"],"names":["AuthStatus","MicroFrontendType"],"mappings":"IAIYA,EAqBAC,GArBZ,SAAYD,GAEVA,EAAA,gBAAA,kBAGAA,EAAA,cAAA,gBAGAA,EAAA,eAAA,iBAGAA,EAAA,QAAA,UAGAA,EAAA,MAAA,OACD,CAfD,CAAYA,IAAAA,EAeX,CAAA,IAMD,SAAYC,GAEVA,EAAA,UAAA,YAGAA,EAAA,QAAA,UAGAA,EAAA,SAAA,WAGAA,EAAA,YAAA,cAGAA,EAAA,WAAA,aAGAA,EAAA,WAAA,aAGAA,EAAA,YAAA,cAGAA,EAAA,YAAA,cAGAA,EAAA,QAAA,SACD,CA3BD,CAAYA,IAAAA,EA2BX,CAAA"}
@@ -1,2 +0,0 @@
1
- import{createClass as t,objectSpread2 as e,classCallCheck as n,defineProperty as i}from"../_virtual/_rollupPluginBabelHelpers.js";import{defaultAuthData as a}from"./auth-types.js";var s=function(){function s(){n(this,s),i(this,"authData",a),i(this,"listeners",new Map),i(this,"isInitialized",!1),this.initializeGlobalWindow(),this.setupEventListeners()}return t(s,[{key:"initializeGlobalWindow",value:function(){var t=this;"undefined"!=typeof window&&(window.__AUTH_MFE__={getAuthData:function(){return t.authData},setAuthData:function(e){return t.updateAuthData(e)},subscribe:function(e,n){return t.subscribe(e,n)},unsubscribe:function(e,n){return t.unsubscribe(e,n)},version:"1.0.0"},this.isInitialized=!0)}},{key:"setupEventListeners",value:function(){"undefined"!=typeof window&&(window.addEventListener("auth:request",this.handleAuthRequest.bind(this)),window.addEventListener("auth:login",this.handleLoginRequest.bind(this)),window.addEventListener("auth:logout",this.handleLogoutRequest.bind(this)))}},{key:"handleAuthRequest",value:function(t){var n=(t.detail||{}).microFrontendId;n&&window.dispatchEvent(new CustomEvent("auth:response",{detail:e(e({},this.authData),{},{microFrontendId:n,timestamp:Date.now()})}))}},{key:"handleLoginRequest",value:function(t){var e=(t.detail||{}).microFrontendId;window.dispatchEvent(new CustomEvent("auth:hostLogin",{detail:{microFrontendId:e,timestamp:Date.now()}}))}},{key:"handleLogoutRequest",value:function(t){var e=(t.detail||{}).microFrontendId;window.dispatchEvent(new CustomEvent("auth:hostLogout",{detail:{microFrontendId:e,timestamp:Date.now()}}))}},{key:"updateAuthData",value:function(t){var n=this;this.authData=e(e(e({},this.authData),t),{},{timestamp:Date.now()}),this.listeners.forEach((function(t,i){t.forEach((function(t){try{t(e(e({},n.authData),{},{microFrontendId:i}))}catch(t){console.error("Auth MFE: Error notifying ".concat(i,":"),t)}}))})),window.dispatchEvent(new CustomEvent("auth:stateChanged",{detail:this.authData}))}},{key:"subscribe",value:function(t,n){this.listeners.has(t)||this.listeners.set(t,[]),this.listeners.get(t).push(n),n(e(e({},this.authData),{},{microFrontendId:t}))}},{key:"unsubscribe",value:function(t,e){var n=this.listeners.get(t);if(n){var i=n.indexOf(e);i>-1&&n.splice(i,1),0===n.length&&this.listeners.delete(t)}}},{key:"getAuthData",value:function(){return e({},this.authData)}},{key:"isReady",value:function(){return this.isInitialized&&"undefined"!=typeof window&&!!window.__AUTH_MFE__}},{key:"getDebugInfo",value:function(){return{isInitialized:this.isInitialized,authData:this.authData,subscriberCount:Array.from(this.listeners.values()).reduce((function(t,e){return t+e.length}),0),subscribers:Array.from(this.listeners.keys()),windowAvailable:"undefined"!=typeof window,globalObjectAvailable:"undefined"!=typeof window&&!!window.__AUTH_MFE__}}}],[{key:"getInstance",value:function(){return s.instance||(s.instance=new s),s.instance}}])}();export{s as default};
2
- //# sourceMappingURL=auth-mfe-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-mfe-manager.js","sources":["../../src/mfe-auth/auth-mfe-manager.ts"],"sourcesContent":["import { AuthEventData, AuthEventListener, defaultAuthData } from './auth-types'\r\n\r\n/**\r\n * Global Authentication Manager for Module Federation\r\n * Manages authentication state across host and micro frontend applications\r\n */\r\nclass AuthMFEManager {\r\n private static instance: AuthMFEManager\r\n private authData: AuthEventData = defaultAuthData\r\n private listeners: Map<string, AuthEventListener[]> = new Map()\r\n private isInitialized = false\r\n\r\n private constructor() {\r\n this.initializeGlobalWindow()\r\n this.setupEventListeners()\r\n }\r\n\r\n /**\r\n * Get singleton instance\r\n */\r\n static getInstance(): AuthMFEManager {\r\n if (!AuthMFEManager.instance) {\r\n AuthMFEManager.instance = new AuthMFEManager()\r\n }\r\n return AuthMFEManager.instance\r\n }\r\n\r\n /**\r\n * Initialize global window object for cross-component communication\r\n */\r\n private initializeGlobalWindow(): void {\r\n if (typeof window !== 'undefined') {\r\n ;(window as any).__AUTH_MFE__ = {\r\n getAuthData: () => this.authData,\r\n setAuthData: (data: AuthEventData) => this.updateAuthData(data),\r\n subscribe: (microFrontendId: string, callback: AuthEventListener) => this.subscribe(microFrontendId, callback),\r\n unsubscribe: (microFrontendId: string, callback: AuthEventListener) => this.unsubscribe(microFrontendId, callback),\r\n version: '1.0.0'\r\n }\r\n this.isInitialized = true\r\n }\r\n }\r\n\r\n /**\r\n * Setup event listeners for authentication events\r\n */\r\n private setupEventListeners(): void {\r\n if (typeof window === 'undefined') return\r\n\r\n // Listen for auth requests from micro frontends\r\n window.addEventListener('auth:request', this.handleAuthRequest.bind(this) as EventListener)\r\n\r\n // Listen for login/logout requests\r\n window.addEventListener('auth:login', this.handleLoginRequest.bind(this) as EventListener)\r\n window.addEventListener('auth:logout', this.handleLogoutRequest.bind(this) as EventListener)\r\n }\r\n\r\n /**\r\n * Handle authentication state requests\r\n */\r\n private handleAuthRequest(event: Event): void {\r\n const customEvent = event as CustomEvent\r\n const { microFrontendId } = customEvent.detail || {}\r\n\r\n if (microFrontendId) {\r\n // Send current auth state to requesting micro frontend\r\n window.dispatchEvent(\r\n new CustomEvent('auth:response', {\r\n detail: { ...this.authData, microFrontendId, timestamp: Date.now() }\r\n })\r\n )\r\n }\r\n }\r\n\r\n /**\r\n * Handle login requests from micro frontends\r\n */\r\n private handleLoginRequest(event: Event): void {\r\n const customEvent = event as CustomEvent\r\n const { microFrontendId } = customEvent.detail || {}\r\n\r\n // Dispatch to host application\r\n window.dispatchEvent(\r\n new CustomEvent('auth:hostLogin', {\r\n detail: { microFrontendId, timestamp: Date.now() }\r\n })\r\n )\r\n }\r\n\r\n /**\r\n * Handle logout requests from micro frontends\r\n */\r\n private handleLogoutRequest(event: Event): void {\r\n const customEvent = event as CustomEvent\r\n const { microFrontendId } = customEvent.detail || {}\r\n\r\n // Dispatch to host application\r\n window.dispatchEvent(\r\n new CustomEvent('auth:hostLogout', {\r\n detail: { microFrontendId, timestamp: Date.now() }\r\n })\r\n )\r\n }\r\n\r\n /**\r\n * Update authentication data and notify all subscribers\r\n */\r\n updateAuthData(newData: Partial<AuthEventData>): void {\r\n this.authData = { ...this.authData, ...newData, timestamp: Date.now() }\r\n\r\n // Notify all subscribed micro frontends\r\n this.listeners.forEach((callbacks, microFrontendId) => {\r\n callbacks.forEach((callback) => {\r\n try {\r\n callback({ ...this.authData, microFrontendId })\r\n } catch (error) {\r\n console.error(`Auth MFE: Error notifying ${microFrontendId}:`, error)\r\n }\r\n })\r\n })\r\n\r\n // Broadcast to all components via custom event\r\n window.dispatchEvent(new CustomEvent('auth:stateChanged', { detail: this.authData }))\r\n }\r\n\r\n /**\r\n * Subscribe to authentication changes\r\n */\r\n subscribe(microFrontendId: string, callback: AuthEventListener): void {\r\n if (!this.listeners.has(microFrontendId)) {\r\n this.listeners.set(microFrontendId, [])\r\n }\r\n this.listeners.get(microFrontendId)!.push(callback)\r\n\r\n // Immediately provide current auth state\r\n callback({ ...this.authData, microFrontendId })\r\n }\r\n\r\n /**\r\n * Unsubscribe from authentication changes\r\n */\r\n unsubscribe(microFrontendId: string, callback: AuthEventListener): void {\r\n const callbacks = this.listeners.get(microFrontendId)\r\n if (callbacks) {\r\n const index = callbacks.indexOf(callback)\r\n if (index > -1) {\r\n callbacks.splice(index, 1)\r\n }\r\n\r\n // Clean up empty listener arrays\r\n if (callbacks.length === 0) {\r\n this.listeners.delete(microFrontendId)\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Get current authentication data\r\n */\r\n getAuthData(): AuthEventData {\r\n return { ...this.authData }\r\n }\r\n\r\n /**\r\n * Check if manager is initialized\r\n */\r\n isReady(): boolean {\r\n return this.isInitialized && typeof window !== 'undefined' && !!(window as any).__AUTH_MFE__\r\n }\r\n\r\n /**\r\n * Get debug information\r\n */\r\n getDebugInfo() {\r\n return {\r\n isInitialized: this.isInitialized,\r\n authData: this.authData,\r\n subscriberCount: Array.from(this.listeners.values()).reduce((sum, arr) => sum + arr.length, 0),\r\n subscribers: Array.from(this.listeners.keys()),\r\n windowAvailable: typeof window !== 'undefined',\r\n globalObjectAvailable: typeof window !== 'undefined' && !!(window as any).__AUTH_MFE__\r\n }\r\n }\r\n}\r\n\r\nexport default AuthMFEManager\r\n"],"names":["AuthMFEManager","_classCallCheck","_defineProperty","defaultAuthData","this","Map","initializeGlobalWindow","setupEventListeners","_createClass","key","value","_this","window","__AUTH_MFE__","getAuthData","authData","setAuthData","data","updateAuthData","subscribe","microFrontendId","callback","unsubscribe","version","isInitialized","addEventListener","handleAuthRequest","bind","handleLoginRequest","handleLogoutRequest","event","detail","dispatchEvent","CustomEvent","_objectSpread","timestamp","Date","now","newData","_this2","listeners","forEach","callbacks","error","console","concat","has","set","get","push","index","indexOf","splice","length","subscriberCount","Array","from","values","reduce","sum","arr","subscribers","keys","windowAvailable","globalObjectAvailable","instance"],"mappings":"oLAEA,IAIMA,EAAc,WAMlB,SAAAA,IAAAC,OAAAD,GAAAE,kBAJkCC,GAAeD,EACKE,KAAA,YAAA,IAAIC,KAAKH,wBACvC,GAGtBE,KAAKE,yBACLF,KAAKG,qBACP,CAEA,OAAAC,EAAAR,EAAA,CAAA,CAAAS,IAAA,yBAAAC,MAaQ,WAAsB,IAAAC,EAAAP,KACN,oBAAXQ,SACPA,OAAeC,aAAe,CAC9BC,YAAa,WAAF,OAAQH,EAAKI,QAAQ,EAChCC,YAAa,SAACC,GAAmB,OAAKN,EAAKO,eAAeD,EAAK,EAC/DE,UAAW,SAACC,E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KpD,KAAKoC,UAAUsB,QACvCC,gBAAmC,oBAAXnD,OACxBoD,sBAAyC,oBAAXpD,UAA6BA,OAAeC,aAE9E,IAAC,CAAA,CAAAJ,IAAA,cAAAC,MAlKD,WAIE,OAHKV,EAAeiE,WAClBjE,EAAeiE,SAAW,IAAIjE,GAEzBA,EAAeiE,QACxB,IAAC,CAnBiB"}
@@ -1,2 +0,0 @@
1
- import{slicedToArray as e,asyncToGenerator as t,regenerator as n,objectSpread2 as r}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsx as a,Fragment as o,jsxs as i}from"react/jsx-runtime";import{useState as s,useCallback as u,useEffect as d}from"react";import{authService as c}from"partner-oidc-auth";import{AuthStatus as l}from"./auth-enums.js";import{defaultAuthData as v}from"./auth-types.js";import m from"./auth-mfe-manager.js";var f=function(i){var f=i.children,p=s(v),h=e(p,2);h[0];var g=h[1],w=s(!0),E=e(w,2);E[0];var U=E[1],A=m.getInstance(),b=u(t(n().m((function e(){var t,r,a,o,i;return n().w((function(e){for(;;)switch(e.n){case 0:return e.p=0,U(!0),e.n=1,c.isAuthenticated();case 1:if(!e.v){e.n=3;break}return e.n=2,c.getUser();case 2:t=e.v,r={status:l.AUTHENTICATED,email:(null==t?void 0:t.email)||"Unknown Email",displayName:(null==t?void 0:t.name)||"Unknown User",avatar:(null==t?void 0:t.picture)||"Unknown Avatar",timestamp:Date.now()},g(r),A.updateAuthData(r),e.n=4;break;case 3:a={status:l.UNAUTHENTICATED,timestamp:Date.now()},g(a),A.updateAuthData(a);case 4:e.n=6;break;case 5:e.p=5,i=e.v,console.error("Auth MFE: Failed to initialize authentication:",i),o={status:l.ERROR,error:i instanceof Error?i.message:"Authentication initialization failed",timestamp:Date.now()},g(o),A.updateAuthData(o);case 6:return e.p=6,U(!1),e.f(6);case 7:return e.a(2)}}),e,null,[[0,5,6,7]])}))),[A]),D=u(t(n().m((function e(){var t,a;return n().w((function(e){for(;;)switch(e.n){case 0:return e.p=0,g((function(e){return r(r({},e),{},{status:l.AUTHENTICATING,timestamp:Date.now()})})),e.n=1,c.signIn({returnUrl:c.getReturnUrl()});case 1:e.n=3;break;case 2:e.p=2,a=e.v,console.error("Auth MFE: Login failed:",a),t={status:l.ERROR,error:a instanceof Error?a.message:"Login failed",timestamp:Date.now()},g(t),A.updateAuthData(t);case 3:return e.a(2)}}),e,null,[[0,2]])}))),[A]),T=u(t(n().m((function e(){var t,r,a;return n().w((function(e){for(;;)switch(e.n){case 0:return e.p=0,e.n=1,c.signOut({returnUrl:c.getReturnUrl()});case 1:t={status:l.UNAUTHENTICATED,timestamp:Date.now()},g(t),A.updateAuthData(t),e.n=3;break;case 2:e.p=2,a=e.v,console.error("Auth MFE: Logout failed:",a),r={status:l.UNAUTHENTICATED,error:a instanceof Error?a.message:"Logout failed",timestamp:Date.now()},g(r),A.updateAuthData(r);case 3:return e.a(2)}}),e,null,[[0,2]])}))),[A]);return d((function(){b()}),[b]),d((function(){var e=function(){return D()},t=function(){return T()};return window.addEventListener("auth:hostLogin",e),window.addEventListener("auth:hostLogout",t),function(){window.removeEventListener("auth:hostLogin",e),window.removeEventListener("auth:hostLogout",t)}}),[D,T]),d((function(){var e=function(){b()};return c.userManager&&(c.userManager.events.addUserLoaded(e),c.userManager.events.addUserUnloaded(e),c.userManager.events.addUserSignedOut(e)),function(){c.userManager&&(c.userManager.events.removeUserLoaded(e),c.userManager.events.removeUserUnloaded(e),c.userManager.events.removeUserSignedOut(e))}}),[b]),a(o,{children:f})},p=function(t){var n,o,u,c=t.position,l=void 0===c?{bottom:"60px",left:"10px"}:c,v=s({}),f=e(v,2),p=f[0],h=f[1],g=m.getInstance();return d((function(){var e=function(){h(g.getDebugInfo())};e();var t=function(){return e()};window.addEventListener("auth:stateChanged",t);var n=setInterval(e,2e3);return function(){window.removeEventListener("auth:stateChanged",t),clearInterval(n)}}),[g]),"production"===process.env.NODE_ENV?null:i("div",{style:r({position:"fixed",background:"rgba(0, 0, 0, 0.9)",color:"white",padding:"10px",borderRadius:"5px",fontSize:"12px",fontFamily:"monospace",maxWidth:"300px",zIndex:9999},l),children:[a("div",{style:{fontWeight:"bold",marginBottom:"5px"},children:"🔐 Auth MFE Debug (Host)"}),i("div",{children:["Status: ",null===(n=p.authData)||void 0===n?void 0:n.status]}),i("div",{children:["User: ",(null===(o=p.authData)||void 0===o?void 0:o.displayName)||"None"]}),i("div",{children:["Subscribers: ",p.subscriberCount]}),i("div",{children:["MFEs: ",(null===(u=p.subscribers)||void 0===u?void 0:u.join(", "))||"None"]}),i("div",{children:["Global Ready: ",p.globalObjectAvailable?"✅":"❌"]}),i("div",{children:["Initialized: ",p.isInitialized?"✅":"❌"]})]})};export{p as AuthMFEProviderDebug,f as default};
2
- //# sourceMappingURL=auth-mfe-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-mfe-provider.js","sources":["../../src/mfe-auth/auth-mfe-provider.tsx"],"sourcesContent":["import React, { useEffect, useState, useCallback, CSSProperties, FC } from 'react'\r\nimport { authService } from 'partner-oidc-auth'\r\nimport { AuthStatus } from './auth-enums'\r\nimport { AuthEventData, defaultAuthData } from './auth-types'\r\nimport AuthMFEManager from './auth-mfe-manager'\r\n\r\nexport interface AuthMFEProviderProps {\r\n children: React.ReactNode\r\n}\r\n\r\n/**\r\n * Authentication MFE Provider Component\r\n * Provides authentication state management for the host application\r\n * Handles communication with micro frontends via global window object\r\n */\r\nconst AuthMFEProvider: FC<AuthMFEProviderProps> = ({ children }) => {\r\n const [authData, setAuthData] = useState<AuthEventData>(defaultAuthData)\r\n const [isLoading, setIsLoading] = useState(true)\r\n\r\n // Get the auth manager instance\r\n const authManager = AuthMFEManager.getInstance()\r\n\r\n /**\r\n * Initialize authentication state from auth service\r\n */\r\n const initializeAuth = useCallback(async () => {\r\n try {\r\n setIsLoading(true)\r\n\r\n // Check if user is already authenticated\r\n const isAuthenticated = await authService.isAuthenticated()\r\n\r\n if (isAuthenticated) {\r\n const user = await authService.getUser()\r\n const newAuthData: AuthEventData = {\r\n status: AuthStatus.AUTHENTICATED,\r\n email: user?.email || 'Unknown Email',\r\n displayName: user?.name || 'Unknown User',\r\n avatar: user?.picture || 'Unknown Avatar',\r\n timestamp: Date.now()\r\n }\r\n\r\n setAuthData(newAuthData)\r\n authManager.updateAuthData(newAuthData)\r\n } else {\r\n const unauthenticatedData: AuthEventData = {\r\n status: AuthStatus.UNAUTHENTICATED,\r\n timestamp: Date.now()\r\n }\r\n\r\n setAuthData(unauthenticatedData)\r\n authManager.updateAuthData(unauthenticatedData)\r\n }\r\n } catch (error) {\r\n console.error('Auth MFE: Failed to initialize authentication:', error)\r\n const errorData: AuthEventData = {\r\n status: AuthStatus.ERROR,\r\n error: error instanceof Error ? error.message : 'Authentication initialization failed',\r\n timestamp: Date.now()\r\n }\r\n\r\n setAuthData(errorData)\r\n authManager.updateAuthData(errorData)\r\n } finally {\r\n setIsLoading(false)\r\n }\r\n }, [authManager])\r\n\r\n /**\r\n * Handle login requests from micro frontends\r\n */\r\n const handleLoginRequest = useCallback(async () => {\r\n try {\r\n setAuthData((prev) => ({\r\n ...prev,\r\n status: AuthStatus.AUTHENTICATING,\r\n timestamp: Date.now()\r\n }))\r\n\r\n await authService.signIn({ returnUrl: authService.getReturnUrl() })\r\n // Auth state will be updated by the redirect callback\r\n } catch (error) {\r\n console.error('Auth MFE: Login failed:', error)\r\n const errorData: AuthEventData = {\r\n status: AuthStatus.ERROR,\r\n error: error instanceof Error ? error.message : 'Login failed',\r\n timestamp: Date.now()\r\n }\r\n\r\n setAuthData(errorData)\r\n authManager.updateAuthData(errorData)\r\n }\r\n }, [authManager])\r\n\r\n /**\r\n * Handle logout requests from micro frontends\r\n */\r\n const handleLogoutRequest = useCallback(async () => {\r\n try {\r\n await authService.signOut({ returnUrl: authService.getReturnUrl() })\r\n\r\n const loggedOutData: AuthEventData = {\r\n status: AuthStatus.UNAUTHENTICATED,\r\n timestamp: Date.now()\r\n }\r\n\r\n setAuthData(loggedOutData)\r\n authManager.updateAuthData(loggedOutData)\r\n } catch (error) {\r\n console.error('Auth MFE: Logout failed:', error)\r\n // Even if logout fails, treat as logged out\r\n const loggedOutData: AuthEventData = {\r\n status: AuthStatus.UNAUTHENTICATED,\r\n error: error instanceof Error ? error.message : 'Logout failed',\r\n timestamp: Date.now()\r\n }\r\n\r\n setAuthData(loggedOutData)\r\n authManager.updateAuthData(loggedOutData)\r\n }\r\n }, [authManager])\r\n\r\n // Initialize authentication on mount\r\n useEffect(() => {\r\n initializeAuth()\r\n }, [initializeAuth])\r\n\r\n // Listen for host authentication events\r\n useEffect(() => {\r\n const handleHostLogin = () => handleLoginRequest()\r\n const handleHostLogout = () => handleLogoutRequest()\r\n\r\n window.addEventListener('auth:hostLogin', handleHostLogin)\r\n window.addEventListener('auth:hostLogout', handleHostLogout)\r\n\r\n return () => {\r\n window.removeEventListener('auth:hostLogin', handleHostLogin)\r\n window.removeEventListener('auth:hostLogout', handleHostLogout)\r\n }\r\n }, [handleLoginRequest, handleLogoutRequest])\r\n\r\n // Listen for auth service changes (e.g., from redirect callbacks)\r\n useEffect(() => {\r\n const handleAuthChange = () => {\r\n // Re-initialize auth state when auth service state changes\r\n initializeAuth()\r\n }\r\n\r\n // Listen for user loaded events from oidc-client\r\n if (authService.userManager) {\r\n authService.userManager.events.addUserLoaded(handleAuthChange)\r\n authService.userManager.events.addUserUnloaded(handleAuthChange)\r\n authService.userManager.events.addUserSignedOut(handleAuthChange)\r\n }\r\n\r\n return () => {\r\n if (authService.userManager) {\r\n authService.userManager.events.removeUserLoaded(handleAuthChange)\r\n authService.userManager.events.removeUserUnloaded(handleAuthChange)\r\n authService.userManager.events.removeUserSignedOut(handleAuthChange)\r\n }\r\n }\r\n }, [initializeAuth])\r\n\r\n return <>{children}</>\r\n}\r\n\r\nexport default AuthMFEProvider\r\n\r\nexport interface IAuthMFEProviderDebugProps {\r\n position?: Pick<CSSProperties, 'top' | 'left' | 'right' | 'bottom'>\r\n}\r\n\r\n/**\r\n * Debug component to show current authentication state\r\n * Only renders in development mode\r\n */\r\nexport const AuthMFEProviderDebug: FC<IAuthMFEProviderDebugProps> = (props) => {\r\n const { position = { bottom: '60px', left: '10px' } } = props\r\n const [debugInfo, setDebugInfo] = useState<any>({})\r\n const authManager = AuthMFEManager.getInstance()\r\n\r\n useEffect(() => {\r\n const updateDebugInfo = () => {\r\n setDebugInfo(authManager.getDebugInfo())\r\n }\r\n\r\n updateDebugInfo()\r\n\r\n // Update debug info when auth state changes\r\n const handleAuthChange = () => updateDebugInfo()\r\n window.addEventListener('auth:stateChanged', handleAuthChange)\r\n\r\n const interval = setInterval(updateDebugInfo, 2000) // Update every 2 seconds\r\n\r\n return () => {\r\n window.removeEventListener('auth:stateChanged', handleAuthChange)\r\n clearInterval(interval)\r\n }\r\n }, [authManager])\r\n\r\n // Only show in development\r\n if (process.env.NODE_ENV === 'production') {\r\n return null\r\n }\r\n\r\n return (\r\n <div\r\n style={{\r\n position: 'fixed',\r\n background: 'rgba(0, 0, 0, 0.9)',\r\n color: 'white',\r\n padding: '10px',\r\n borderRadius: '5px',\r\n fontSize: '12px',\r\n fontFamily: 'monospace',\r\n maxWidth: '300px',\r\n zIndex: 9999,\r\n ...position\r\n }}\r\n >\r\n <div style={{ fontWeight: 'bold', marginBottom: '5px' }}>🔐 Auth MFE Debug (Host)</div>\r\n <div>Status: {debugInfo.authData?.status}</div>\r\n <div>User: {debugInfo.authData?.displayName || 'None'}</div>\r\n <div>Subscribers: {debugInfo.subscriberCount}</div>\r\n <div>MFEs: {debugInfo.subscribers?.join(', ') || 'None'}</div>\r\n <div>Global Ready: {debugInfo.globalObjectAvailable ? '✅' : '❌'}</div>\r\n <div>Initialized: {debugInfo.isInitialized ? '✅' : '❌'}</div>\r\n </div>\r\n )\r\n}\r\n"],"names":["AuthMFEProvider","_ref","children","_useState","useState","defaultAuthData","_useState2","_slicedToArray","setAuthData","_useState3","_useState4","setIsLoading","authManager","AuthMFEManager","getInstance","initializeAuth","useCallback","_asyncToGenerator","_regenerator","m","_callee","user","newAuthData","unauthenticatedData","errorData","_t","w","_context","n","p","authService","isAuthenticated","v","getUser","status","AuthStatus","AUTHENTICATED","email","displayName","name","avatar","picture","timestamp","Date","now","updateAuthData","UNAUTHENTICATED","console","error","ERROR","Error","message","f","a","handleLoginRequest","_callee2","_t2","_context2","prev","_objectSpread","AUTHENTICATING","signIn","returnUrl","getReturnUrl","handleLogoutRequest","_callee3","loggedOutData","_loggedOutData","_t3","_context3","signOut","useEffect","handleHostLogin","handleHostLogout","window","addEventListener","removeEventListener","handleAuthChange","userManager","events","addUserLoaded","addUserUnloaded","addUserSignedOut","removeUserLoaded","removeUserUnloaded","removeUserSignedOut","_jsx","_Fragment","AuthMFEProviderDebug","props","_debugInfo$authData","_debugInfo$authData2","_debugInfo$subscriber","_props$position","position","bottom","left","_useState5","_useState6","debugInfo","setDebugInfo","updateDebugInfo","getDebugInfo","interval","setInterval","clearInterval","process","env","NODE_ENV","_jsxs","style","background","color","padding","borderRadius","fontSize","fontFamily","maxWidth","zIndex","fontWeight","marginBottom","authData","subscriberCount","subscribers","join","globalObjectAvailable","isInitialized"],"mappings":"wbAeA,IAAMA,EAA4C,SAA7BC,GAA8C,IAAdC,EAAQD,EAARC,SACnDC,EAAgCC,EAAwBC,GAAgBC,EAAAC,EAAAJ,EAAA,GAAzDG,EAAA,GAAEE,IAAAA,EAAWF,EAAA,GAC5BG,EAAkCL,GAAS,GAAKM,EAAAH,EAAAE,EAAA,GAAhCC,EAAA,GAAEC,IAAAA,EAAYD,EAAA,GAGxBE,EAAcC,EAAeC,cAK7BC,EAAiBC,EAAWC,EAAAC,IAAAC,GAAC,SAAAC,IAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAP,IAAAQ,GAAA,SAAAC,GAAA,cAAAA,EAAAC,GAAA,KAAA,EAI/B,OAJ+BD,EAAAE,EAAA,EAE/BlB,GAAa,GAEbgB,EAAAC,EAAA,EAC8BE,EAAYC,kBAAiB,KAAA,EAAtC,IAAAJ,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AGyB,eAAzB8F,QAAQC,IAAIC,SACP,KAIPC,EACE,MAAA,CAAAC,MAAKnD,EAAA,CACHmC,SAAU,QACViB,WAAY,qBACZC,MAAO,QACPC,QAAS,OACTC,aAAc,MACdC,SAAU,OACVC,WAAY,YACZC,SAAU,QACVC,OAAQ,MACLxB,GACJ5F,SAAA,CAEDoF,SAAKwB,MAAO,CAAES,WAAY,OAAQC,aAAc,OAAOtH,SAAA,6BACvD2G,EAAc,MAAA,CAAA3G,SAAA,CAAA,WAAkBwF,QAAlBA,EAAAS,EAAUsB,gBAAV/B,IAAkBA,OAAlBA,EAAAA,EAAoBxD,UAClC2E,EAAY,MAAA,CAAA3G,SAAA,CAAA,kBAAAyF,EAAAQ,EAAUsB,gBAAQ,IAAA9B,OAAA,EAAlBA,EAAoBrD,cAAe,UAC/CuE,EAAmB,MAAA,CAAA3G,SAAA,CAAA,gBAAAiG,EAAUuB,mBAC7Bb,EAAY,MAAA,CAAA3G,SAAA,CAAA,kBAAA0F,EAAAO,EAAUwB,mBAAW,IAAA/B,OAAA,EAArBA,EAAuBgC,KAAK,QAAS,UACjDf,EAAA,MAAA,CAAA3G,SAAA,CAAA,iBAAoBiG,EAAU0B,sBAAwB,IAAM,OAC5DhB,EAAA,MAAA,CAAA3G,SAAA,CAAA,gBAAmBiG,EAAU2B,cAAgB,IAAM,SAGzD"}
@@ -1,2 +0,0 @@
1
- import{AuthStatus as t}from"./auth-enums.js";var a={status:t.UNAUTHENTICATED,timestamp:Date.now()};export{a as defaultAuthData};
2
- //# sourceMappingURL=auth-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-types.js","sources":["../../src/mfe-auth/auth-types.ts"],"sourcesContent":["import { AuthStatus } from './auth-enums'\r\n\r\n/**\r\n * Authentication Event Data Interface\r\n * Structure for communication between host and micro frontends\r\n */\r\nexport interface AuthEventData {\r\n /** Current authentication status */\r\n status: AuthStatus\r\n \r\n /** User display name (if authenticated) */\r\n displayName?: string\r\n \r\n /** User avatar URL (if authenticated) */\r\n avatar?: string\r\n \r\n /** Unique user identifier (if authenticated) */\r\n userId?: string\r\n \r\n /** User email address (if authenticated) */\r\n email?: string\r\n \r\n /** Additional user profile data */\r\n profile?: Record<string, any>\r\n \r\n /** Error message (if status is ERROR) */\r\n error?: string\r\n \r\n /** Timestamp of the authentication event */\r\n timestamp: number\r\n \r\n /** Source micro frontend identifier */\r\n microFrontendId?: string\r\n}\r\n\r\n/**\r\n * Authentication Event Listener Type\r\n */\r\nexport type AuthEventListener = (data: AuthEventData) => void\r\n\r\n/**\r\n * Default authentication data for unauthenticated state\r\n */\r\nexport const defaultAuthData: AuthEventData = {\r\n status: AuthStatus.UNAUTHENTICATED,\r\n timestamp: Date.now()\r\n}\r\n"],"names":["defaultAuthData","status","AuthStatus","UNAUTHENTICATED","timestamp","Date","now"],"mappings":"6CA2CO,IAAMA,EAAiC,CAC5CC,OAAQC,EAAWC,gBACnBC,UAAWC,KAAKC"}