@archbase/core 3.0.0 → 3.0.3

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 (36) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -4
  3. package/dist/context/ArchbaseAppContext.d.ts +1 -1
  4. package/dist/context/ArchbaseGlobalProvider.d.ts +1 -2
  5. package/dist/context/ArchbaseSimpleAppContext.d.ts +1 -1
  6. package/dist/errorboundary/ArchbaseErrorBoundary.d.ts +2 -2
  7. package/dist/errorboundary/ArchbaseErrorBoundaryContext.d.ts +1 -1
  8. package/dist/errorboundary/index.d.ts +6 -6
  9. package/dist/errorboundary/types.d.ts +1 -1
  10. package/dist/fallback/ArchbaseSafeMigrationWrapper.d.ts +2 -10
  11. package/dist/hooks/ArchbaseDepencyManager.d.ts +1 -55
  12. package/dist/hooks/lifecycle/index.d.ts +4 -4
  13. package/dist/hooks/useArchbasePassiveLayoutEffect.d.ts +1 -1
  14. package/dist/hooks/useArchbasePasswordRemember.d.ts +3 -3
  15. package/dist/hooks/useArchbaseResizeObserver.d.ts +1 -1
  16. package/dist/index.d.ts +1 -3
  17. package/dist/locales/config.d.ts +0 -3
  18. package/dist/locales/en/translation.json.d.ts +627 -0
  19. package/dist/locales/es/translation.json.d.ts +536 -0
  20. package/dist/locales/pt-BR/translation.json.d.ts +628 -0
  21. package/dist/rsql/parser/lexer/LexerProcessor.d.ts +2 -2
  22. package/dist/types/types.d.ts +1 -1
  23. package/dist/utils/deepFilter.d.ts +1 -1
  24. package/dist/utils/deepFind.d.ts +1 -1
  25. package/dist/utils/deepForEach.d.ts +1 -1
  26. package/dist/utils/deepMap.d.ts +1 -1
  27. package/dist/utils/filter.d.ts +1 -1
  28. package/dist/utils/getElementName.d.ts +1 -1
  29. package/dist/utils/groupByType.d.ts +1 -1
  30. package/dist/utils/hasChildren.d.ts +1 -1
  31. package/dist/utils/hasComplexChildren.d.ts +1 -1
  32. package/dist/utils/onlyText.d.ts +1 -1
  33. package/dist/utils/onlyValid.d.ts +1 -1
  34. package/dist/validator/ArchbaseValidator.d.ts +1 -1
  35. package/package.json +8 -7
  36. package/dist/archbase-core-3.0.0.tgz +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Edson Martins
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -6,6 +6,10 @@ Core utilities and foundation for Archbase React v3.
6
6
 
7
7
  ```bash
8
8
  npm install @archbase/core
9
+ # or
10
+ pnpm add @archbase/core
11
+ # or
12
+ yarn add @archbase/core
9
13
  ```
10
14
 
11
15
  ## Features
@@ -19,11 +23,11 @@ npm install @archbase/core
19
23
  ## Usage
20
24
 
21
25
  ```typescript
22
- import {
26
+ import {
23
27
  ArchbaseError,
24
28
  ArchbaseErrorBoundary,
25
29
  ArchbaseAppContext,
26
- withArchbaseErrorBoundary
30
+ withArchbaseErrorBoundary
27
31
  } from '@archbase/core';
28
32
 
29
33
  // Error Boundary
@@ -37,6 +41,10 @@ import {
37
41
  </ArchbaseAppContext.Provider>
38
42
  ```
39
43
 
40
- ## API Documentation
44
+ ## License
41
45
 
42
- Detailed API documentation coming soon...
46
+ MIT © Edson Martins
47
+
48
+ ## Documentation
49
+
50
+ For full documentation, visit [https://react.archbase.dev](https://react.archbase.dev)
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { Container } from 'inversify';
3
3
  import { MantineTheme, MantineColorScheme, MantineThemeOverride } from '@mantine/core';
4
4
  import { ArchbaseUser } from '../types';
@@ -1,7 +1,6 @@
1
1
  import { MantineThemeOverride } from '@mantine/core';
2
2
  import { i18n, ResourceLanguage } from 'i18next';
3
- import React from 'react';
4
- import '../locales/config';
3
+ import { default as React } from 'react';
5
4
  type ArchbaseThemeOverride = MantineThemeOverride;
6
5
  interface ArchbaseTranslationResource {
7
6
  [language: string]: ResourceLanguage;
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  export interface ArchbaseAppConfig {
3
3
  /** URL base da API */
4
4
  apiUrl?: string;
@@ -1,4 +1,4 @@
1
- import React, { Component, ErrorInfo } from 'react';
1
+ import { default as React, Component, ErrorInfo } from 'react';
2
2
  import { ArchbaseErrorBoundaryProps } from './types';
3
3
  type ArchbaseErrorBoundaryState = {
4
4
  didCatch: true;
@@ -16,6 +16,6 @@ export declare class ArchbaseErrorBoundary extends Component<ArchbaseErrorBounda
16
16
  resetErrorBoundary(...args: any[]): void;
17
17
  componentDidCatch(error: Error, info: ErrorInfo): void;
18
18
  componentDidUpdate(prevProps: ArchbaseErrorBoundaryProps, prevState: ArchbaseErrorBoundaryState): void;
19
- render(): React.FunctionComponentElement<React.ProviderProps<import("./ArchbaseErrorBoundaryContext").ArchbaseErrorBoundaryContextType>>;
19
+ render(): React.FunctionComponentElement<React.ProviderProps<import('./ArchbaseErrorBoundaryContext').ArchbaseErrorBoundaryContextType>>;
20
20
  }
21
21
  export {};
@@ -3,4 +3,4 @@ export type ArchbaseErrorBoundaryContextType = {
3
3
  error: any;
4
4
  resetErrorBoundary: (...args: any[]) => void;
5
5
  };
6
- export declare const ArchbaseErrorBoundaryContext: import("react").Context<ArchbaseErrorBoundaryContextType>;
6
+ export declare const ArchbaseErrorBoundaryContext: import('react').Context<ArchbaseErrorBoundaryContextType>;
@@ -1,6 +1,6 @@
1
- export * from "./ArchbaseErrorBoundary";
2
- export * from "./ArchbaseErrorBoundaryContext";
3
- export * from "./useArchbaseErrorBoundary";
4
- export * from "./withArchbaseErrorBoundary";
5
- export * from "./ArchbaseErrorFallback";
6
- export * from "./types";
1
+ export * from './ArchbaseErrorBoundary';
2
+ export * from './ArchbaseErrorBoundaryContext';
3
+ export * from './useArchbaseErrorBoundary';
4
+ export * from './withArchbaseErrorBoundary';
5
+ export * from './ArchbaseErrorFallback';
6
+ export * from './types';
@@ -1,4 +1,4 @@
1
- import { Component, ComponentType, ErrorInfo, FunctionComponent, PropsWithChildren, ReactElement, ReactNode } from "react";
1
+ import { Component, ComponentType, ErrorInfo, FunctionComponent, PropsWithChildren, ReactElement, ReactNode } from 'react';
2
2
  declare function FallbackRender(props: FallbackProps): ReactNode;
3
3
  export type FallbackProps = {
4
4
  error: any;
@@ -1,12 +1,4 @@
1
- /**
2
- * ArchbaseSafeMigrationWrapper
3
- *
4
- * Sistema de fallback seguro para migração V1/V2.
5
- * Garante que se V2 falhar, automaticamente volta para V1.
6
- *
7
- * ⚠️ CRITICAL: Este wrapper é obrigatório para todos os componentes migrados.
8
- */
9
- import React, { Component, ErrorInfo, ReactNode } from 'react';
1
+ import { default as React, Component, ErrorInfo, ReactNode } from 'react';
10
2
  interface Props {
11
3
  children: ReactNode;
12
4
  fallbackComponent: React.ComponentType<any>;
@@ -26,7 +18,7 @@ export declare class ArchbaseSafeMigrationWrapper extends Component<Props, State
26
18
  constructor(props: Props);
27
19
  static getDerivedStateFromError(error: Error): State;
28
20
  componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
29
- render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>>;
21
+ render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>> | import("react/jsx-runtime").JSX.Element;
30
22
  }
31
23
  /**
32
24
  * Hook para criar wrapper de migração segura
@@ -1,58 +1,4 @@
1
- /**
2
- * # ArchbaseDependencyProvider Component
3
- *
4
- * O `ArchbaseDependencyProvider` é um componente React que facilita a comunicação entre componentes em uma aplicação,
5
- * permitindo que se registrem como ouvintes de dependências específicas e sejam notificados sobre atualizações,
6
- * acompanhadas de dados relevantes.
7
- *
8
- * ## Uso
9
- *
10
- * Para utilizar, envolva os componentes com `ArchbaseDependencyProvider`. Dentro dos componentes filhos,
11
- * utilize o hook `useArchbaseDependency` para registrar ouvintes para dependências específicas ou para notificar
12
- * sobre atualizações de dependências.
13
- *
14
- * ## Exemplo
15
- *
16
- * ```jsx
17
- * import React from 'react';
18
- * import { ArchbaseDependencyProvider, useArchbaseDependency } from './ArchbaseDependencyManager';
19
- *
20
- * const App = () => (
21
- * <ArchbaseDependencyProvider>
22
- * <ChildComponent />
23
- * <SiblingComponent />
24
- * </ArchbaseDependencyProvider>
25
- * );
26
- *
27
- * const ChildComponent = () => {
28
- * const { registerListener } = useArchbaseDependency();
29
- *
30
- * useEffect(() => {
31
- * const handleDataChange = (newData, extra) => {
32
- * console.log('Data updated:', newData, 'Additional info:', extra);
33
- * };
34
- *
35
- * registerListener('key', handleDataChange);
36
- * }, []);
37
- *
38
- * return <div>Child Component</div>;
39
- * };
40
- *
41
- * const SiblingComponent = () => {
42
- * const { enqueueUpdate } = useArchbaseDependency();
43
- *
44
- * const updateData = () => {
45
- * enqueueUpdate('key', 'updatedValue', { extraData: 'extraInfo' });
46
- * };
47
- *
48
- * return <button onClick={updateData}>Update Data</button>;
49
- * };
50
- * ```
51
- *
52
- * Este exemplo mostra como `SiblingComponent` pode notificar `ChildComponent` sobre atualizações,
53
- * usando o `ArchbaseDependencyProvider` para gerenciar a dependência 'key' entre eles.
54
- */
55
- import React, { ReactNode } from 'react';
1
+ import { default as React, ReactNode } from 'react';
56
2
  type UpdateQueueItem = {
57
3
  key: string;
58
4
  value: any;
@@ -1,4 +1,4 @@
1
- import type { DependencyList, EffectCallback, FC } from 'react';
1
+ import { DependencyList, EffectCallback, FC } from 'react';
2
2
  type Props = Record<string, unknown>;
3
3
  type ShouldComponentUpdateHandler = (props: Props, nextProps: Props) => boolean;
4
4
  /**
@@ -30,15 +30,15 @@ declare function useArchbaseDidUpdate(handler: EffectCallback, deps?: Dependency
30
30
  * @param shouldComponentUpdateHandler comparator like the shouldComponentUpdate lifecycle.
31
31
  * @returns [PureComponent]
32
32
  */
33
- declare function useShouldComponentUpdate(Component: FC, shouldComponentUpdateHandler?: ShouldComponentUpdateHandler): import("react").NamedExoticComponent<{}>[];
33
+ declare function useShouldComponentUpdate(Component: FC, shouldComponentUpdateHandler?: ShouldComponentUpdateHandler): import('react').NamedExoticComponent<{}>[];
34
34
  /**
35
35
  * @alias useShouldComponentUpdate
36
36
  */
37
- declare function usePureComponent(Component: FC, shouldComponentUpdateHandler?: ShouldComponentUpdateHandler): import("react").NamedExoticComponent<{}>[];
37
+ declare function usePureComponent(Component: FC, shouldComponentUpdateHandler?: ShouldComponentUpdateHandler): import('react').NamedExoticComponent<{}>[];
38
38
  /**
39
39
  * @alias useShouldComponentUpdate but with diffrent pattern (HOC)!
40
40
  */
41
- declare function withShouldComponentUpdate(Component: FC): (shouldComponentUpdateHandler: ShouldComponentUpdateHandler) => import("react").NamedExoticComponent<{}>;
41
+ declare function withShouldComponentUpdate(Component: FC): (shouldComponentUpdateHandler: ShouldComponentUpdateHandler) => import('react').NamedExoticComponent<{}>;
42
42
  /**
43
43
  * Called immediately before a component is destroyed.
44
44
  * Perform any necessary cleanup in this method, such
@@ -1,3 +1,3 @@
1
- import React from 'react';
1
+ import { default as React } from 'react';
2
2
  declare const useArchbasePassiveLayoutEffect: typeof React.useEffect | typeof React.useLayoutEffect;
3
3
  export default useArchbasePassiveLayoutEffect;
@@ -3,9 +3,9 @@ export declare function useArchbasePasswordRemember(): {
3
3
  clearRememberMe: () => void;
4
4
  username: string;
5
5
  password: string;
6
- setRememberMe: import("react").Dispatch<import("react").SetStateAction<boolean>>;
7
- setUsername: import("react").Dispatch<import("react").SetStateAction<string>>;
8
- setPassword: import("react").Dispatch<import("react").SetStateAction<string>>;
6
+ setRememberMe: import('react').Dispatch<import('react').SetStateAction<boolean>>;
7
+ setUsername: import('react').Dispatch<import('react').SetStateAction<string>>;
8
+ setPassword: import('react').Dispatch<import('react').SetStateAction<string>>;
9
9
  saveCredentials: (user: string, pass: string, remember: boolean) => void;
10
10
  clearCredentials: () => void;
11
11
  };
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
1
  import { ResizeObserver as Polyfill, ResizeObserverEntry } from '@juggle/resize-observer';
2
+ import * as React from 'react';
3
3
  /**
4
4
  * A React hook that fires a callback whenever ResizeObserver detects a change to its size
5
5
  *
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import './errorboundary.scss';
2
- import './utils.scss';
3
1
  export * from './context';
4
2
  export { useArchbaseTranslation, archbaseI18next, getI18nextInstance } from './context/ArchbaseGlobalProvider';
5
3
  export * from './exceptions';
@@ -15,7 +13,7 @@ export * from './utils';
15
13
  export * from './types';
16
14
  export * from './types/filter';
17
15
  export * from './errorboundary';
18
- export * from "./utils/masker";
16
+ export * from './utils/masker';
19
17
  export { ArchbaseValidator } from './validator/ArchbaseValidator';
20
18
  export type { ValidationError, ValidatorOptions } from './validator';
21
19
  export * from './validator';
@@ -1,6 +1,3 @@
1
- import 'dayjs/locale/en';
2
- import 'dayjs/locale/es';
3
- import 'dayjs/locale/pt-br';
4
1
  export declare const archbaseTranslationResources: {
5
2
  en: {
6
3
  archbase: {