@aic-kits/react-native 0.4.0 → 0.5.0

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,15 +1,4 @@
1
- import { useIntlState } from './state';
2
- export type IntlContextType = ReturnType<typeof useIntlState>;
3
- export declare const IntlContext: import("react").Context<{
4
- locale: string;
5
- locales: string[];
6
- messages: Record<string, string> | Record<string, import("react-intl").MessageFormatElement[]>;
7
- setLocale: import("react").Dispatch<import("react").SetStateAction<string>>;
8
- }>;
9
- export declare const useIntlContext: () => {
10
- locale: string;
11
- locales: string[];
12
- messages: Record<string, string> | Record<string, import("react-intl").MessageFormatElement[]>;
13
- setLocale: import("react").Dispatch<import("react").SetStateAction<string>>;
14
- };
1
+ import type { IntlState } from './state';
2
+ export declare const IntlContext: import("react").Context<IntlState>;
3
+ export declare const useIntlContext: () => IntlState;
15
4
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/utils/intl/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAE9D,eAAO,MAAM,WAAW;;;;;EAKtB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;CAAgC,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/utils/intl/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,WAAW,oCAOtB,CAAC;AAEH,eAAO,MAAM,cAAc,QAAO,SAAoC,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { createContext, useContext } from 'react';
2
- import { useIntlState } from './state';
3
2
  export const IntlContext = createContext({
4
3
  locale: '',
5
4
  locales: [],
6
5
  messages: {},
7
- setLocale: () => { },
6
+ setLocale: () => {
7
+ console.warn('Attempted to setLocale on the default IntlContext value.');
8
+ },
8
9
  });
9
10
  export const useIntlContext = () => useContext(IntlContext);
@@ -1,12 +1,14 @@
1
1
  import type { ResolvedIntlConfig } from '@formatjs/intl';
2
+ import type { Dispatch, SetStateAction } from 'react';
2
3
  export interface UseIntlStateParams {
3
4
  defaultLocale: ResolvedIntlConfig['locale'];
4
5
  locales: Array<ResolvedIntlConfig['locale']>;
5
6
  }
6
- export declare const useIntlState: (params: UseIntlStateParams) => {
7
- locale: string;
8
- locales: string[];
9
- messages: Record<string, string> | Record<string, import("react-intl").MessageFormatElement[]>;
10
- setLocale: import("react").Dispatch<import("react").SetStateAction<string>>;
11
- };
7
+ export interface IntlState {
8
+ locale: ResolvedIntlConfig['locale'];
9
+ locales: Array<ResolvedIntlConfig['locale']>;
10
+ messages: ResolvedIntlConfig['messages'];
11
+ setLocale: Dispatch<SetStateAction<ResolvedIntlConfig['locale']>>;
12
+ }
13
+ export declare const useIntlState: (params: UseIntlStateParams) => IntlState;
12
14
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/utils/intl/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAMzD,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,EAAE,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC9C;AAED,eAAO,MAAM,YAAY,GAAI,QAAQ,kBAAkB;;;;;CAmBtD,CAAC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/utils/intl/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAItD,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,EAAE,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,EAAE,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC7C,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACzC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;CACnE;AAED,eAAO,MAAM,YAAY,GAAI,QAAQ,kBAAkB,KAAG,SAmBzD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aic-kits/react-native",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -108,5 +108,5 @@
108
108
  "engines": {
109
109
  "node": ">=18"
110
110
  },
111
- "gitHead": "b579eb24795331f64da96f0d67eef5c93d0c23ca"
111
+ "gitHead": "02c7b78e9f62424d2ad39de427c72a6168ee6972"
112
112
  }