@0xchain/i18n 1.1.0-beta.4 → 1.1.0-beta.40

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present 0xchain
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/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { Link as o, getPathname as m, redirect as a, usePathname as i, useRouter as n } from "./navigation.js";
2
- import { routing as u } from "./routing.js";
1
+ import { Link, getPathname, redirect, usePathname, useRouter } from "./navigation.js";
2
+ import { routing } from "./routing.js";
3
3
  import "./request.js";
4
- import { middleware as f } from "./middleware.js";
4
+ import { middleware } from "./middleware.js";
5
5
  export {
6
- o as Link,
7
- m as getPathname,
8
- f as middleware,
9
- a as redirect,
10
- u as routing,
11
- i as usePathname,
12
- n as useRouter
6
+ Link,
7
+ getPathname,
8
+ middleware,
9
+ redirect,
10
+ routing,
11
+ usePathname,
12
+ useRouter
13
13
  };
@@ -1,9 +1,9 @@
1
- import e from "next-intl/middleware";
2
- import { routing as o } from "./routing.js";
3
- const t = e(o);
4
- function m(r) {
5
- return t(r);
1
+ import createMiddleware from "next-intl/middleware";
2
+ import { routing } from "./routing.js";
3
+ const i18n = createMiddleware(routing);
4
+ function middleware(request) {
5
+ return i18n(request);
6
6
  }
7
7
  export {
8
- m as middleware
8
+ middleware
9
9
  };
@@ -1,4 +1,3 @@
1
- import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime';
2
1
  export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
3
2
  id?: string | undefined | undefined;
4
3
  target?: import('react').HTMLAttributeAnchorTarget | undefined;
@@ -7,8 +6,6 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
7
6
  style?: import('react').CSSProperties | undefined;
8
7
  title?: string | undefined | undefined;
9
8
  locale?: import('next-intl').Locale | undefined;
10
- onError?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
11
- children?: import('react').ReactNode;
12
9
  ref?: import('react').Ref<HTMLAnchorElement> | undefined;
13
10
  prefix?: string | undefined | undefined;
14
11
  key?: import('react').Key | null | undefined;
@@ -18,12 +15,10 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
18
15
  passHref?: boolean | undefined;
19
16
  prefetch?: boolean | "auto" | null | undefined;
20
17
  legacyBehavior?: boolean | undefined;
21
- onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
22
- onTouchStart?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
23
- onClick?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
24
18
  onNavigate?: ((event: {
25
19
  preventDefault: () => void;
26
20
  }) => void) | undefined;
21
+ transitionTypes?: string[] | undefined;
27
22
  download?: any;
28
23
  hrefLang?: string | undefined | undefined;
29
24
  media?: string | undefined | undefined;
@@ -80,7 +75,6 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
80
75
  is?: string | undefined | undefined;
81
76
  exportparts?: string | undefined | undefined;
82
77
  part?: string | undefined | undefined;
83
- tw?: string | undefined;
84
78
  "aria-activedescendant"?: string | undefined | undefined;
85
79
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
86
80
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
@@ -134,6 +128,8 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
134
128
  "aria-valuemin"?: number | undefined | undefined;
135
129
  "aria-valuenow"?: number | undefined | undefined;
136
130
  "aria-valuetext"?: string | undefined | undefined;
131
+ href: string | import('url').UrlObject;
132
+ children?: import('react').ReactNode;
137
133
  dangerouslySetInnerHTML?: {
138
134
  __html: string | TrustedHTML;
139
135
  } | undefined | undefined;
@@ -153,20 +149,21 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
153
149
  onFocusCapture?: import('react').FocusEventHandler<HTMLAnchorElement> | undefined;
154
150
  onBlur?: import('react').FocusEventHandler<HTMLAnchorElement> | undefined;
155
151
  onBlurCapture?: import('react').FocusEventHandler<HTMLAnchorElement> | undefined;
156
- onChange?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
157
- onChangeCapture?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
152
+ onChange?: import('react').ChangeEventHandler<HTMLAnchorElement, Element> | undefined;
153
+ onChangeCapture?: import('react').ChangeEventHandler<HTMLAnchorElement, Element> | undefined;
158
154
  onBeforeInput?: import('react').InputEventHandler<HTMLAnchorElement> | undefined;
159
- onBeforeInputCapture?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
160
- onInput?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
161
- onInputCapture?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
162
- onReset?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
163
- onResetCapture?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
164
- onSubmit?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
165
- onSubmitCapture?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
166
- onInvalid?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
167
- onInvalidCapture?: import('react').FormEventHandler<HTMLAnchorElement> | undefined;
155
+ onBeforeInputCapture?: import('react').InputEventHandler<HTMLAnchorElement> | undefined;
156
+ onInput?: import('react').InputEventHandler<HTMLAnchorElement> | undefined;
157
+ onInputCapture?: import('react').InputEventHandler<HTMLAnchorElement> | undefined;
158
+ onReset?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
159
+ onResetCapture?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
160
+ onSubmit?: import('react').SubmitEventHandler<HTMLAnchorElement> | undefined;
161
+ onSubmitCapture?: import('react').SubmitEventHandler<HTMLAnchorElement> | undefined;
162
+ onInvalid?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
163
+ onInvalidCapture?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
168
164
  onLoad?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
169
165
  onLoadCapture?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
166
+ onError?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
170
167
  onErrorCapture?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
171
168
  onKeyDown?: import('react').KeyboardEventHandler<HTMLAnchorElement> | undefined;
172
169
  onKeyDownCapture?: import('react').KeyboardEventHandler<HTMLAnchorElement> | undefined;
@@ -220,6 +217,7 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
220
217
  onWaitingCapture?: import('react').ReactEventHandler<HTMLAnchorElement> | undefined;
221
218
  onAuxClick?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
222
219
  onAuxClickCapture?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
220
+ onClick?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
223
221
  onClickCapture?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
224
222
  onContextMenu?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
225
223
  onContextMenuCapture?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
@@ -243,6 +241,7 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
243
241
  onDropCapture?: import('react').DragEventHandler<HTMLAnchorElement> | undefined;
244
242
  onMouseDown?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
245
243
  onMouseDownCapture?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
244
+ onMouseEnter?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
246
245
  onMouseLeave?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
247
246
  onMouseMove?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
248
247
  onMouseMoveCapture?: import('react').MouseEventHandler<HTMLAnchorElement> | undefined;
@@ -260,6 +259,7 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
260
259
  onTouchEndCapture?: import('react').TouchEventHandler<HTMLAnchorElement> | undefined;
261
260
  onTouchMove?: import('react').TouchEventHandler<HTMLAnchorElement> | undefined;
262
261
  onTouchMoveCapture?: import('react').TouchEventHandler<HTMLAnchorElement> | undefined;
262
+ onTouchStart?: import('react').TouchEventHandler<HTMLAnchorElement> | undefined;
263
263
  onTouchStartCapture?: import('react').TouchEventHandler<HTMLAnchorElement> | undefined;
264
264
  onPointerDown?: import('react').PointerEventHandler<HTMLAnchorElement> | undefined;
265
265
  onPointerDownCapture?: import('react').PointerEventHandler<HTMLAnchorElement> | undefined;
@@ -301,8 +301,9 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
301
301
  onTransitionRunCapture?: import('react').TransitionEventHandler<HTMLAnchorElement> | undefined;
302
302
  onTransitionStart?: import('react').TransitionEventHandler<HTMLAnchorElement> | undefined;
303
303
  onTransitionStartCapture?: import('react').TransitionEventHandler<HTMLAnchorElement> | undefined;
304
- href: string | import('url').UrlObject;
305
- }, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>, usePathname: () => string, getPathname: (args: {
304
+ }, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
305
+ export declare const usePathname: () => string;
306
+ export declare const getPathname: (args: {
306
307
  href: string | {
307
308
  pathname: string;
308
309
  query?: import('next-intl/navigation').QueryParams;
@@ -310,6 +311,36 @@ export declare const Link: import('react').ForwardRefExoticComponent<Omit<{
310
311
  locale: import('next-intl').Locale;
311
312
  forcePrefix?: boolean;
312
313
  }) => string;
313
- export declare const redirect: any;
314
- export declare const useRouter: () => AppRouterInstance;
314
+ export declare const redirect: (args: {
315
+ href: string | {
316
+ pathname: string;
317
+ query?: import('next-intl/navigation').QueryParams;
318
+ };
319
+ locale: import('next-intl').Locale;
320
+ forcePrefix?: boolean;
321
+ }, type?: import('next/dist/client/components/redirect-error').RedirectType | undefined) => never;
322
+ export declare const useRouter: () => {
323
+ push: (href: string | {
324
+ pathname: string;
325
+ query?: import('next-intl/navigation').QueryParams;
326
+ }, options?: (Partial<import('next/dist/shared/lib/app-router-context.shared-runtime').NavigateOptions> & {
327
+ locale?: import('next-intl').Locale;
328
+ }) | undefined) => void;
329
+ replace: (href: string | {
330
+ pathname: string;
331
+ query?: import('next-intl/navigation').QueryParams;
332
+ }, options?: (Partial<import('next/dist/shared/lib/app-router-context.shared-runtime').NavigateOptions> & {
333
+ locale?: import('next-intl').Locale;
334
+ }) | undefined) => void;
335
+ prefetch: (href: string | {
336
+ pathname: string;
337
+ query?: import('next-intl/navigation').QueryParams;
338
+ }, options?: (Partial<import('next/dist/shared/lib/app-router-context.shared-runtime').PrefetchOptions> & {
339
+ locale?: import('next-intl').Locale;
340
+ }) | undefined) => void;
341
+ back(): void;
342
+ forward(): void;
343
+ refresh(): void;
344
+ experimental_gesturePush?(href: string, options?: import('next/dist/shared/lib/app-router-context.shared-runtime').NavigateOptions): void;
345
+ };
315
346
  //# sourceMappingURL=navigation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAMhG,eAAO,MAAO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAAE,WAAW,gBAAE,WAAW;;;;;;;YAAc,CAAC;AAC3D,eAAO,MAAM,QAAQ,EAAE,GAAyB,CAAC;AACjD,eAAO,MAAM,SAAS,EAAE,MAAM,iBAAwC,CAAC"}
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6DAAkB,CAAC;AACpC,eAAO,MAAM,WAAW,cAAyB,CAAC;AAClD,eAAO,MAAM,WAAW;;;;;;;YAAyB,CAAC;AAClD,eAAO,MAAM,QAAQ;;;;;;;iGAAsB,CAAC;AAC5C,eAAO,MAAM,SAAS;;;;;cAC4/yB,CAAC;;;;;;cAAuxC,CAAC;;;;;;cAAwxC,CAAC;;;;;;CADvh4B,CAAC"}
@@ -1,10 +1,15 @@
1
- import { createNavigation as e } from "next-intl/navigation";
2
- import { routing as o } from "./routing.js";
3
- const t = e(o), { Link: i, usePathname: a, getPathname: c } = t, s = t.redirect, m = t.useRouter;
1
+ import { createNavigation } from "next-intl/navigation";
2
+ import { routing } from "./routing.js";
3
+ const navigation = createNavigation(routing);
4
+ const Link = navigation.Link;
5
+ const usePathname = navigation.usePathname;
6
+ const getPathname = navigation.getPathname;
7
+ const redirect = navigation.redirect;
8
+ const useRouter = navigation.useRouter;
4
9
  export {
5
- i as Link,
6
- c as getPathname,
7
- s as redirect,
8
- a as usePathname,
9
- m as useRouter
10
+ Link,
11
+ getPathname,
12
+ redirect,
13
+ usePathname,
14
+ useRouter
10
15
  };
@@ -0,0 +1,3 @@
1
+ export { NextIntlClientProvider, useFormatter, useLocale, useMessages, useNow, useTimeZone, useTranslations, } from 'next-intl';
2
+ export type { AbstractIntlMessages } from 'next-intl';
3
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,EACN,WAAW,EACX,eAAe,GAChB,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
package/dist/react.js ADDED
@@ -0,0 +1,10 @@
1
+ import { NextIntlClientProvider, useFormatter, useLocale, useMessages, useNow, useTimeZone, useTranslations } from "next-intl";
2
+ export {
3
+ NextIntlClientProvider,
4
+ useFormatter,
5
+ useLocale,
6
+ useMessages,
7
+ useNow,
8
+ useTimeZone,
9
+ useTranslations
10
+ };