@saykit/react 0.2.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.
package/dist/client.d.mts CHANGED
@@ -1,7 +1,5 @@
1
- import * as _$react from "react";
2
1
  import { PropsWithChildren } from "react";
3
2
  import { ReadonlySay, Say } from "saykit";
4
-
5
3
  //#region src/runtime/client.d.ts
6
4
  type SayRef = {
7
5
  current: ReadonlySay | null;
@@ -13,14 +11,10 @@ type SayRef = {
13
11
  * @param props.locale The current locale
14
12
  * @param props.messages The current messages for the locale
15
13
  */
16
- declare function SayProvider({
17
- locale,
18
- messages,
19
- children
20
- }: PropsWithChildren<{
14
+ declare function SayProvider({ locale, messages, children }: PropsWithChildren<{
21
15
  locale: string;
22
16
  messages: Say.Messages;
23
- }>): _$react.FunctionComponentElement<_$react.ProviderProps<SayRef>>;
17
+ }>): import("react").FunctionComponentElement<import("react").ProviderProps<SayRef>>;
24
18
  /**
25
19
  * Get the current {@link Say} **client** instance.
26
20
  * Must be called within a {@link SayProvider}.
package/dist/index.d.mts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { PropsWithChildren, ReactElement, ReactNode } from "react";
2
2
  import { Disallow, NumeralOptions, SelectOptions } from "saykit";
3
-
4
3
  //#region src/types.d.ts
5
- type PropsWithJSXSafeKeys<T> = { [K in keyof T as K extends number | `${number}${string}` ? `_${K}` : K extends `_${number}${string}` ? never : K]: T[K] };
4
+ type PropsWithJSXSafeKeys<T> = { [K in keyof T as K extends number | `${number}${string}` ? `_${K}` : K extends `_${number}${string}` ? never : K]: T[K]; };
6
5
  //#endregion
7
6
  //#region src/runtime/index.d.ts
8
7
  /**
package/dist/server.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import * as _$react from "react";
2
1
  import { ReactNode } from "react";
3
2
  import { ReadonlySay, Say } from "saykit";
3
+ import "server-only";
4
4
  //#region src/runtime/server.d.ts
5
5
  /**
6
6
  * Set the current {@link Say} **server** instance.
@@ -24,7 +24,7 @@ declare function getSay(): ReadonlySay;
24
24
  *
25
25
  * @returns A {@link withSay} higher-order component factory
26
26
  */
27
- declare function unstable_createWithSay(say: Say): <P = unknown>(Component: (props: PropsWithSay<P>) => ReactNode, getLocale: (props: P) => string | Promise<string>) => (props: P) => Promise<_$react.FunctionComponentElement<PropsWithSay<P>>>;
27
+ declare function unstable_createWithSay(say: Say): <P = unknown>(Component: (props: PropsWithSay<P>) => ReactNode, getLocale: (props: P) => string | Promise<string>) => (props: P) => Promise<import("react").FunctionComponentElement<PropsWithSay<P>>>;
28
28
  type PropsWithSay<P = unknown> = P & {
29
29
  locale: string;
30
30
  messages: Say.Messages;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saykit/react",
3
- "version": "0.2.0",
3
+ "version": "0.5.0",
4
4
  "description": "React integration for saykit, i18n hooks and components",
5
5
  "keywords": [
6
6
  "i18n",
@@ -27,7 +27,7 @@
27
27
  ".": {
28
28
  "types": "./dist/index.d.mts",
29
29
  "react-server": "./dist/index.server.mjs",
30
- "default": "./dist/index.client.mjs"
30
+ "default": "./dist/index.mjs"
31
31
  },
32
32
  "./client": {
33
33
  "types": "./dist/client.d.mts",
@@ -48,9 +48,9 @@
48
48
  "devDependencies": {
49
49
  "@types/react": "^19.2.17",
50
50
  "@types/react-dom": "^19.2.3",
51
- "react": "^19.2.7",
52
- "react-dom": "^19.2.7",
53
- "saykit": "^0.2.0"
51
+ "react": "^19.2.8",
52
+ "react-dom": "^19.2.8",
53
+ "saykit": "^0.5.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "react": "*",
File without changes