@bluealba/pae-ui-react-core 4.0.1 → 4.1.0-develop-1295

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.
@@ -0,0 +1,30 @@
1
+ import { FC, ReactNode } from 'react';
2
+
3
+ /**
4
+ * Props for the FeatureFlagGuard component
5
+ */
6
+ export interface FeatureFlagGuardProps {
7
+ /**
8
+ * Name of the feature flag to check
9
+ */
10
+ flag: string;
11
+ /**
12
+ * Content to render when the flag is enabled (or disabled if inverted)
13
+ */
14
+ children: ReactNode;
15
+ /**
16
+ * Optional content to render when the flag is disabled (or enabled if inverted)
17
+ * If not provided, nothing will be rendered when the flag is disabled
18
+ */
19
+ fallback?: ReactNode;
20
+ /**
21
+ * Whether to invert the logic
22
+ * If true, children are shown when flag is disabled, fallback when enabled
23
+ * @default false
24
+ */
25
+ invert?: boolean;
26
+ }
27
+ /**
28
+ * Component for conditional rendering based on feature flags
29
+ */
30
+ export declare const FeatureFlagGuard: FC<FeatureFlagGuardProps>;
@@ -0,0 +1,3 @@
1
+ export { useFeatureFlags } from './useFeatureFlags';
2
+ export { useFeatureFlag } from './useFeatureFlag';
3
+ export { FeatureFlagGuard, type FeatureFlagGuardProps } from './FeatureFlagGuard';
@@ -0,0 +1 @@
1
+ export declare const useFeatureFlag: (flagName: string) => boolean;
@@ -0,0 +1 @@
1
+ export declare const useFeatureFlags: () => Record<string, boolean>;
@@ -14,5 +14,7 @@ export type ApplicationMenuItem = {
14
14
  operations?: string[];
15
15
  items?: AplicationMenuSubItem[];
16
16
  canCollapse?: boolean;
17
+ externalUrl?: string;
18
+ target?: '_self' | '_blank';
17
19
  };
18
20
  export type ApplicationMenu = ApplicationMenuItem[];
@@ -1,6 +1,5 @@
1
- import { ApplicationMenu } from './ApplicationMenu';
2
1
  import { PlatformApplication } from './PlatformApplication';
3
- import { Operation } from '@bluealba/pae-core';
2
+ import { ApplicationMenu } from './ApplicationMenu';
4
3
 
5
4
  type UseApplicationMenuReturnType = {
6
5
  loading: boolean;
@@ -8,4 +7,3 @@ type UseApplicationMenuReturnType = {
8
7
  };
9
8
  export declare const useApplicationMenu: (application: PlatformApplication | undefined) => UseApplicationMenuReturnType;
10
9
  export default useApplicationMenu;
11
- export declare const hasAccess: (authorizedOperations: Operation[]) => (operations: string[]) => boolean;
@@ -0,0 +1,11 @@
1
+ import { Operation } from '@bluealba/pae-core';
2
+ import { ApplicationMenu } from './ApplicationMenu';
3
+ import { PlatformApplication } from './PlatformApplication';
4
+
5
+ type UseModuleMenuReturnType = {
6
+ loading: boolean;
7
+ menu: ApplicationMenu;
8
+ };
9
+ export declare const useModuleMenu: (application: PlatformApplication | undefined) => UseModuleMenuReturnType;
10
+ export default useModuleMenu;
11
+ export declare const hasAccess: (authorizedOperations: Operation[]) => (operations: string[]) => boolean;
@@ -12,6 +12,7 @@ export { useApplications } from './applications/useApplications';
12
12
  export { useUIApplications } from './useUIApplications';
13
13
  export { useApplicationUIModule } from './applications/useApplicationUIModule';
14
14
  export { useApplicationIcon } from './applications/useApplicationIcon';
15
+ export { useModuleMenu } from './applications/useModuleMenu';
15
16
  export { useApplicationMenu } from './applications/useApplicationMenu';
16
17
  export { useCurrentApplicationName } from './applications/useCurrentApplicationName';
17
18
  export { useApplicationJSModule } from './applications/useApplicationJSModule';
@@ -9,3 +9,5 @@ export * from './components/common';
9
9
  export { default as initializeMicroFrontend } from './utils/initializeMicroFrontend';
10
10
  export * from './MicrofrontendProps';
11
11
  export { setupTestEnvironment } from './test-utils/setupTestEnvironment';
12
+ export * from './feature-flags';
13
+ export * from './rooms';
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { RoomUser } from '../types/rooms.types';
3
+
4
+ export interface RoomAvatarsProps {
5
+ users: RoomUser[];
6
+ maxVisible?: number;
7
+ size?: 'sm' | 'md' | 'lg';
8
+ overlap?: boolean;
9
+ className?: string;
10
+ onUserClick?: (user: RoomUser) => void;
11
+ }
12
+ export declare const RoomAvatars: React.FC<RoomAvatarsProps>;
@@ -0,0 +1,9 @@
1
+ import { ConnectionStatus, RoomUser } from '../types/rooms.types';
2
+
3
+ export interface RoomsContextValue {
4
+ status: ConnectionStatus;
5
+ joinRoom: (roomId: string) => void;
6
+ leaveRoom: (roomId: string) => void;
7
+ getRoomUsers: (roomId: string) => RoomUser[];
8
+ }
9
+ export declare const RoomsContext: import('react').Context<RoomsContextValue | null>;
@@ -0,0 +1,6 @@
1
+ import { RoomUser } from '../types/rooms.types';
2
+
3
+ export interface UseRoomReturn {
4
+ users: RoomUser[];
5
+ }
6
+ export declare function useRoom(roomId: string): UseRoomReturn;
@@ -0,0 +1,5 @@
1
+ export * from './types/rooms.types';
2
+ export * from './providers/RoomsProvider';
3
+ export * from './hooks/useRoom';
4
+ export * from './components/RoomAvatars';
5
+ export * from './utils/user-color.utils';
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface RoomsProviderProps {
4
+ children: React.ReactNode;
5
+ }
6
+ export declare const RoomsProvider: React.FC<RoomsProviderProps>;
@@ -0,0 +1,7 @@
1
+ export type ConnectionStatus = 'loading' | 'connected' | 'closed' | 'error';
2
+ export interface RoomUser {
3
+ username: string;
4
+ displayName: string;
5
+ rooms: string[];
6
+ color?: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ export declare const ROOMS_EVENTS: {
2
+ JOIN_ROOM: string;
3
+ LEAVE_ROOM: string;
4
+ USER_LIST: string;
5
+ };
@@ -0,0 +1 @@
1
+ export declare function generateUserColor(userId: string): string;
@@ -22,6 +22,7 @@ export type PAEState = {
22
22
  currentTenant?: Tenant;
23
23
  tenantConfig?: TenantConfig;
24
24
  platformVersion: string;
25
+ featureFlags: Record<string, boolean>;
25
26
  }
26
27
 
27
28
  export type PAECustomizationsLoadingState = BehaviorSubject<boolean | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluealba/pae-ui-react-core",
3
- "version": "4.0.1",
3
+ "version": "4.1.0-develop-1295",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",