aquasis-fe-components 1.7.7 → 1.7.8

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 { Component, ReactNode } from 'react';
2
+ interface ReduxErrorBoundaryProps {
3
+ children: ReactNode;
4
+ fallback: ReactNode;
5
+ }
6
+ interface ReduxErrorBoundaryState {
7
+ hasError: boolean;
8
+ }
9
+ /**
10
+ * Error boundary component to catch Redux connection errors
11
+ *
12
+ * This component catches errors that occur when trying to connect to Redux
13
+ * and renders a fallback component instead. It's specifically designed to
14
+ * handle "react-redux context value" errors that occur when no Redux
15
+ * provider is available in the component tree.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <ReduxErrorBoundary fallback={<StandaloneComponent {...props} />}>
20
+ * <ConnectedComponent {...props} />
21
+ * </ReduxErrorBoundary>
22
+ * ```
23
+ */
24
+ export declare class ReduxErrorBoundary extends Component<ReduxErrorBoundaryProps, ReduxErrorBoundaryState> {
25
+ constructor(props: ReduxErrorBoundaryProps);
26
+ static getDerivedStateFromError(): ReduxErrorBoundaryState;
27
+ componentDidCatch(error: Error, errorInfo: any): void;
28
+ render(): ReactNode;
29
+ }
30
+ export default ReduxErrorBoundary;
@@ -1,6 +1,4 @@
1
- import { FlagType } from '../types/app';
2
1
  import { RcFile } from 'antd/es/upload';
3
- export declare const getInitLanguage: () => FlagType;
4
2
  export declare const getCurrTenantId: () => string;
5
3
  export declare const getCurrAppId: () => string;
6
4
  export declare function getCookie<T>(key: string): T;
@@ -1,12 +1,10 @@
1
1
  import { Themes } from '../enums/app';
2
2
  import { AppDispatch, RootState } from '../store';
3
3
  import { ColorsThemeKey } from '../themes';
4
- import { FlagType } from '../types/app';
5
4
  import { TypedUseSelectorHook } from 'react-redux';
6
5
  type DispatchFunc = () => AppDispatch;
7
6
  export declare const useAppDispatch: DispatchFunc;
8
7
  export declare const useAppSelector: TypedUseSelectorHook<RootState>;
9
- export declare const useGetLanguage: () => FlagType;
10
8
  export declare const useGetTheme: () => Themes;
11
9
  export declare const useGetColorTheme: () => {
12
10
  getColor: (attribute: keyof ColorsThemeKey) => string;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Hook to detect if Redux Provider is available in the component tree
3
+ *
4
+ * This hook returns false by default since we'll handle Redux connection
5
+ * errors at the component level instead of trying to detect the provider.
6
+ *
7
+ * @returns boolean - always returns false for now
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const MyComponent = () => {
12
+ * const hasReduxProvider = useCheckReduxProvider();
13
+ *
14
+ * if (hasReduxProvider) {
15
+ * // Component is wrapped in Redux Provider
16
+ * return <ConnectedComponent />;
17
+ * } else {
18
+ * // No Redux Provider, use standalone version
19
+ * return <StandaloneComponent />;
20
+ * }
21
+ * };
22
+ * ```
23
+ */
24
+ export declare const useCheckReduxProvider: () => boolean;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { ConnectedHelpdesk as Helpdesk } from './lib/Helpdesk/HelpdeskConnector';
2
- import { LanguageSwitcherConnector as LanguageSwitcher } from './lib/LanguageSwitcher/LanguageSwitcherConnector';
3
- import { ReleaseNotesConnector as ReleaseNote } from './lib/ReleaseNote/ReleaseNoteConnector';
4
- import { UserModalConnector as UserModal } from './lib/UserModal/UserModalConnector';
1
+ import { HelpdeskComponent as Helpdesk } from './lib/Helpdesk/HelpdeskConnector';
2
+ import { LanguageSwitcherComponent as LanguageSwitcher } from './lib/LanguageSwitcher/LanguageSwitcherConnector';
3
+ import { ReleaseNoteComponent as ReleaseNote } from './lib/ReleaseNote/ReleaseNoteConnector';
4
+ import { UserModalComponent as UserModal } from './lib/UserModal/UserModalConnector';
5
5
  import { default as i18n } from './i18n';
6
6
  export type * from './types/app';
7
7
  export type * from './types/helpdesk';
@@ -1,9 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { HelpdeskProps } from './index';
3
- declare const ConnectedHelpdesk: import('react-redux').ConnectedComponent<FC<HelpdeskProps>, {
4
- size?: import('antd/es/button').ButtonSize;
5
- placement?: import('antd/es/tooltip').TooltipPlacement | undefined;
6
- context?: import('react').Context<import('react-redux').ReactReduxContextValue<any, import('redux').UnknownAction> | null> | undefined;
7
- store?: import('redux').Store | undefined;
8
- }>;
9
- export { ConnectedHelpdesk };
3
+ declare const HelpdeskComponent: FC<HelpdeskProps>;
4
+ export { HelpdeskComponent };
@@ -1,5 +1,7 @@
1
1
  type Props = {
2
+ appName: string;
3
+ groupId?: number;
2
4
  onCancel?: () => void;
3
5
  };
4
- export declare const HelpdeskContent: ({ onCancel }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const HelpdeskContent: ({ onCancel, appName, groupId }: Props) => import("react/jsx-runtime").JSX.Element;
5
7
  export {};
@@ -4,5 +4,7 @@ import { FC, PropsWithChildren } from 'react';
4
4
  export interface HelpdeskProps {
5
5
  size?: SizeType;
6
6
  placement?: PopoverProps["placement"];
7
+ appName: string;
8
+ groupId?: number;
7
9
  }
8
10
  export declare const Helpdesk: FC<PropsWithChildren<HelpdeskProps>>;
@@ -1,8 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { LanguageSwitcherProps } from '.';
3
- declare const LanguageSwitcherConnector: import('react-redux').ConnectedComponent<FC<LanguageSwitcherProps>, {
4
- onlyFlag?: boolean | undefined;
5
- context?: import('react').Context<import('react-redux').ReactReduxContextValue<any, import('redux').UnknownAction> | null> | undefined;
6
- store?: import('redux').Store | undefined;
7
- }>;
8
- export { LanguageSwitcherConnector };
3
+ declare const LanguageSwitcherComponent: FC<LanguageSwitcherProps>;
4
+ export { LanguageSwitcherComponent };
@@ -1,14 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { ReleaseNoteProps } from '.';
3
- declare const ReleaseNotesConnector: import('react-redux').ConnectedComponent<FC<ReleaseNoteProps>, {
4
- addBtnLabel?: string | undefined;
5
- addBtnTooltipText?: string | undefined;
6
- release2edit?: import('../..').IReleaseNote | undefined;
7
- beforeOpenModal?: (() => void) | undefined;
8
- beforeCloseModal?: (() => void) | undefined;
9
- afterSubmit?: (() => void) | undefined;
10
- showAddBtn?: boolean | undefined;
11
- context?: import('react').Context<import('react-redux').ReactReduxContextValue<any, import('redux').UnknownAction> | null> | undefined;
12
- store?: import('redux').Store | undefined;
13
- }>;
14
- export { ReleaseNotesConnector };
3
+ declare const ReleaseNoteComponent: FC<ReleaseNoteProps>;
4
+ export { ReleaseNoteComponent };
@@ -1,11 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { UserModalProps } from '.';
3
- declare const UserModalConnector: import('react-redux').ConnectedComponent<FC<UserModalProps>, {
4
- user: import('../..').IUser;
5
- onCancel: () => void;
6
- isLoading?: boolean | undefined;
7
- isOpen: boolean;
8
- context?: import('react').Context<import('react-redux').ReactReduxContextValue<any, import('redux').UnknownAction> | null> | undefined;
9
- store?: import('redux').Store | undefined;
10
- }>;
11
- export { UserModalConnector };
3
+ declare const UserModalComponent: FC<UserModalProps>;
4
+ export { UserModalComponent };
@@ -31,6 +31,7 @@ export interface TicketField {
31
31
  }
32
32
  export interface CreateTicketPayload extends HelpdeskFormValues {
33
33
  appName: string;
34
+ group_id?: number;
34
35
  }
35
36
  export interface HelpdeskError {
36
37
  description: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aquasis-fe-components",
3
3
  "private": false,
4
- "version": "1.7.7",
4
+ "version": "1.7.8",
5
5
  "type": "module",
6
6
  "license": "ISC",
7
7
  "author": "Ewerton Souza",