diff --git a/apps/playground/package.json b/apps/playground/package.json index cee18ad7..84236c8b 100644 --- a/apps/playground/package.json +++ b/apps/playground/package.json @@ -12,10 +12,10 @@ "dependencies": { "@hookform/resolvers": "^3.3.4", "lucide-react": "^0.378.0", - "next": "15.0.0-canary.25", + "next": "15.0.0-canary.75", "next-safe-action": "workspace:*", - "react": "19.0.0-rc-6230622a1a-20240610", - "react-dom": "19.0.0-rc-6230622a1a-20240610", + "react": "19.0.0-rc-512b09b2-20240718", + "react-dom": "19.0.0-rc-512b09b2-20240718", "react-hook-form": "^7.51.4", "zod": "^3.23.6", "zod-form-data": "^2.0.2" @@ -26,7 +26,7 @@ "@types/react-dom": "18.3.0", "autoprefixer": "10.4.19", "eslint": "^8.57.0", - "eslint-config-next": "15.0.0-canary.25", + "eslint-config-next": "15.0.0-canary.75", "postcss": "8.4.38", "tailwindcss": "3.4.3", "typescript": "^5.5.3" diff --git a/packages/next-safe-action/src/hooks-utils.ts b/packages/next-safe-action/src/hooks-utils.ts index c1190ab0..7a9af7b4 100644 --- a/packages/next-safe-action/src/hooks-utils.ts +++ b/packages/next-safe-action/src/hooks-utils.ts @@ -2,7 +2,7 @@ import * as React from "react"; import {} from "react/experimental"; import type {} from "zod"; import type { InferIn, Schema } from "./adapters/types"; -import type { HookActionStatus, HookCallbacks, HookResult } from "./hooks.types"; +import type { HookActionStatus, HookBaseUtils, HookCallbacks, HookResult } from "./hooks.types"; export const getActionStatus = < ServerError, @@ -45,6 +45,27 @@ export const getActionShorthandStatusObject = (status: HookActionStatus) => { }; }; +export const useExecuteOnMount = ( + args: HookBaseUtils & { + executeFn: (input: S extends Schema ? InferIn : void) => void; + } +) => { + const mounted = React.useRef(false); + + React.useEffect(() => { + const t = setTimeout(() => { + if (args.executeOnMount && !mounted.current) { + args.executeFn(args.executeOnMount.input); + mounted.current = true; + } + }, args.executeOnMount?.delayMs ?? 0); + + return () => { + clearTimeout(t); + }; + }, [args]); +}; + export const useActionCallbacks = < ServerError, S extends Schema | undefined, diff --git a/packages/next-safe-action/src/hooks.ts b/packages/next-safe-action/src/hooks.ts index fe90e62d..0f23184b 100644 --- a/packages/next-safe-action/src/hooks.ts +++ b/packages/next-safe-action/src/hooks.ts @@ -7,8 +7,8 @@ import * as ReactDOM from "react-dom"; import {} from "react/experimental"; import type {} from "zod"; import type { InferIn, Schema } from "./adapters/types"; -import { getActionShorthandStatusObject, getActionStatus, useActionCallbacks } from "./hooks-utils"; -import type { HookCallbacks, HookResult, HookSafeActionFn } from "./hooks.types"; +import { getActionShorthandStatusObject, getActionStatus, useActionCallbacks, useExecuteOnMount } from "./hooks-utils"; +import type { HookBaseUtils, HookCallbacks, HookResult, HookSafeActionFn } from "./hooks.types"; import { isError } from "./utils"; // HOOKS @@ -16,7 +16,7 @@ import { isError } from "./utils"; /** * Use the action from a Client Component via hook. * @param safeActionFn The action function - * @param utils Optional callbacks + * @param utils Optional base utils and callbacks * * {@link https://next-safe-action.dev/docs/execution/hooks/useaction See docs for more information} */ @@ -29,7 +29,7 @@ export const useAction = < Data, >( safeActionFn: HookSafeActionFn, - utils?: HookCallbacks + utils?: HookBaseUtils & HookCallbacks ) => { const [, startTransition] = React.useTransition(); const [result, setResult] = React.useState>({}); @@ -105,11 +105,16 @@ export const useAction = < setResult({}); }, []); + useExecuteOnMount({ + executeOnMount: utils?.executeOnMount, + executeFn: execute, + }); + useActionCallbacks({ result: result ?? {}, input: clientInput as S extends Schema ? InferIn : undefined, status, - cb: utils, + cb: { onSuccess: utils?.onSuccess, onError: utils?.onError, onSettled: utils?.onSettled }, }); return { @@ -126,7 +131,7 @@ export const useAction = < /** * Use the action from a Client Component via hook, with optimistic data update. * @param safeActionFn The action function - * @param utils Required `currentData` and `updateFn` and optional callbacks + * @param utils Required `currentData` and `updateFn` and optional base utils and callbacks * * {@link https://next-safe-action.dev/docs/execution/hooks/useoptimisticaction See docs for more information} */ @@ -143,7 +148,8 @@ export const useOptimisticAction = < utils: { currentState: State; updateFn: (state: State, input: S extends Schema ? InferIn : undefined) => State; - } & HookCallbacks + } & HookBaseUtils & + HookCallbacks ) => { const [, startTransition] = React.useTransition(); const [result, setResult] = React.useState>({}); @@ -225,6 +231,11 @@ export const useOptimisticAction = < setResult({}); }, []); + useExecuteOnMount({ + executeOnMount: utils?.executeOnMount, + executeFn: execute, + }); + useActionCallbacks({ result: result ?? {}, input: clientInput as S extends Schema ? InferIn : undefined, diff --git a/packages/next-safe-action/src/hooks.types.ts b/packages/next-safe-action/src/hooks.types.ts index f285d5d5..486408db 100644 --- a/packages/next-safe-action/src/hooks.types.ts +++ b/packages/next-safe-action/src/hooks.types.ts @@ -2,6 +2,16 @@ import type { InferIn, Schema } from "./adapters/types"; import type { SafeActionResult } from "./index.types"; import type { MaybePromise, Prettify } from "./utils.types"; +/** + * Type of base utils object passed to `useAction`, `useOptimisticAction` and `useStateAction` hooks. + */ +export type HookBaseUtils = { + executeOnMount?: { + input: S extends Schema ? InferIn : undefined; + delayMs?: number; + }; +}; + /** * Type of `result` object returned by `useAction`, `useOptimisticAction` and `useStateAction` hooks. * If a server-client communication error occurs, `fetchError` will be set to the error message. diff --git a/packages/next-safe-action/src/stateful-hooks.ts b/packages/next-safe-action/src/stateful-hooks.ts index 7cc27398..77ad0b44 100644 --- a/packages/next-safe-action/src/stateful-hooks.ts +++ b/packages/next-safe-action/src/stateful-hooks.ts @@ -5,12 +5,12 @@ import * as ReactDOM from "react-dom"; import {} from "react/experimental"; import type {} from "zod"; import type { InferIn, Schema } from "./adapters/types"; -import { getActionShorthandStatusObject, getActionStatus, useActionCallbacks } from "./hooks-utils"; -import type { HookCallbacks, HookSafeStateActionFn } from "./hooks.types"; +import { getActionShorthandStatusObject, getActionStatus, useActionCallbacks, useExecuteOnMount } from "./hooks-utils"; +import type { HookBaseUtils, HookCallbacks, HookSafeStateActionFn } from "./hooks.types"; /** * Use the stateful action from a Client Component via hook. Used for actions defined with [`stateAction`](https://next-safe-action.dev/docs/safe-action-client/instance-methods#action--stateaction). * @param safeActionFn The action function - * @param utils Optional `initResult`, `permalink` and callbacks + * @param utils Optional `initResult`, `permalink`, base utils and callbacks * * {@link https://next-safe-action.dev/docs/execution/hooks/usestateaction See docs for more information} */ @@ -26,7 +26,8 @@ export const useStateAction = < utils?: { initResult?: Awaited>; permalink?: string; - } & HookCallbacks + } & HookBaseUtils & + HookCallbacks ) => { const [result, dispatcher, isExecuting] = React.useActionState( safeActionFn, @@ -34,6 +35,7 @@ export const useStateAction = < utils?.permalink ); const [isIdle, setIsIdle] = React.useState(true); + const [, startTransition] = React.useTransition(); const [clientInput, setClientInput] = React.useState : void>(); const status = getActionStatus({ isExecuting, @@ -43,7 +45,9 @@ export const useStateAction = < const execute = React.useCallback( (input: S extends Schema ? InferIn : void) => { - dispatcher(input as S extends Schema ? InferIn : undefined); + startTransition(() => { + dispatcher(input as S extends Schema ? InferIn : undefined); + }); ReactDOM.flushSync(() => { setIsIdle(false); @@ -53,6 +57,11 @@ export const useStateAction = < [dispatcher] ); + useExecuteOnMount({ + executeOnMount: utils?.executeOnMount, + executeFn: execute, + }); + useActionCallbacks({ result: result ?? {}, input: clientInput as S extends Schema ? InferIn : undefined, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69ddf7d3..d41bd22a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,25 +37,25 @@ importers: dependencies: '@hookform/resolvers': specifier: ^3.3.4 - version: 3.4.2(react-hook-form@7.51.5(react@19.0.0-rc-6230622a1a-20240610)) + version: 3.4.2(react-hook-form@7.51.5(react@19.0.0-rc-512b09b2-20240718)) lucide-react: specifier: ^0.378.0 - version: 0.378.0(react@19.0.0-rc-6230622a1a-20240610) + version: 0.378.0(react@19.0.0-rc-512b09b2-20240718) next: - specifier: 15.0.0-canary.25 - version: 15.0.0-canary.25(react-dom@19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610))(react@19.0.0-rc-6230622a1a-20240610) + specifier: 15.0.0-canary.75 + version: 15.0.0-canary.75(react-dom@19.0.0-rc-512b09b2-20240718(react@19.0.0-rc-512b09b2-20240718))(react@19.0.0-rc-512b09b2-20240718) next-safe-action: specifier: workspace:* version: link:../../packages/next-safe-action react: - specifier: 19.0.0-rc-6230622a1a-20240610 - version: 19.0.0-rc-6230622a1a-20240610 + specifier: 19.0.0-rc-512b09b2-20240718 + version: 19.0.0-rc-512b09b2-20240718 react-dom: - specifier: 19.0.0-rc-6230622a1a-20240610 - version: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) + specifier: 19.0.0-rc-512b09b2-20240718 + version: 19.0.0-rc-512b09b2-20240718(react@19.0.0-rc-512b09b2-20240718) react-hook-form: specifier: ^7.51.4 - version: 7.51.5(react@19.0.0-rc-6230622a1a-20240610) + version: 7.51.5(react@19.0.0-rc-512b09b2-20240718) zod: specifier: ^3.23.6 version: 3.23.8 @@ -79,8 +79,8 @@ importers: specifier: ^8.57.0 version: 8.57.0 eslint-config-next: - specifier: 15.0.0-canary.25 - version: 15.0.0-canary.25(eslint@8.57.0)(typescript@5.5.3) + specifier: 15.0.0-canary.75 + version: 15.0.0-canary.75(eslint@8.57.0)(typescript@5.5.3) postcss: specifier: 8.4.38 version: 8.4.38 @@ -723,11 +723,11 @@ packages: '@next/env@14.3.0-canary.42': resolution: {integrity: sha512-1WqxEMzSd9nULVLMy0ctLsX9T934jQDblMyO5SujzXURG4jCfZBJud4LNamU748Iu/s1ScR7PsDyPmR1wZlKeQ==} - '@next/env@15.0.0-canary.25': - resolution: {integrity: sha512-8dQIa9X7VHB85WnJi9A9omn/kiDEGeNfJXbYzXu6Ix/qGtT9SZiB77la8OrJ/7R+zZXeSTjDwufl0R8W7C8E7w==} + '@next/env@15.0.0-canary.75': + resolution: {integrity: sha512-sVRrLrZsNacn/S3Bp3uO3WSyMs+xJkQ6DRKwxPRto3tsoLit2jyoLnBjqs35gP4qlbXdoiEpC+MgGa0I2l44HQ==} - '@next/eslint-plugin-next@15.0.0-canary.25': - resolution: {integrity: sha512-gPSb0XaEuSeIJME7ews+z53cYpEgNyzxwmGVgKn5r9+RTTGhekf3pA5r3HBcpaRFiMv1FOp+0N5DCuPsO57oNQ==} + '@next/eslint-plugin-next@15.0.0-canary.75': + resolution: {integrity: sha512-DkIbyO2vyfxmCBiTPedkclyELSQGX5KNTcTYac7nrnYZPxVqC9WocJT7QJoeLpPIKrZBDDNl2XGYbNara04mZg==} '@next/swc-darwin-arm64@14.3.0-canary.42': resolution: {integrity: sha512-0FToZPLxC6QprBwHZMfEpVsvfWyD0owlh4/R3bYH8qJ/L+jFFwnrfE9TgQf+xQPQEps/9D5b4Z6yA70BKNaFiA==} @@ -735,8 +735,8 @@ packages: cpu: [arm64] os: [darwin] - '@next/swc-darwin-arm64@15.0.0-canary.25': - resolution: {integrity: sha512-Tkvg6yz2ajLibNGHhrqlfw7WZDsT7hybUOudJJzbyjvaeHGL8cyu7oV2hgPyo2zPva3y8Ah+BZqzZtCvq1Kz9g==} + '@next/swc-darwin-arm64@15.0.0-canary.75': + resolution: {integrity: sha512-Q5QJzdgitI7hyiJx9S+1mn5JxmbAdEfysritXnTBIXgSLmuwb+BIOn26yxwzg/RpFju7OiX5zuZB6tY9Uc8nsw==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -747,8 +747,8 @@ packages: cpu: [x64] os: [darwin] - '@next/swc-darwin-x64@15.0.0-canary.25': - resolution: {integrity: sha512-94JpNE8nlF47+2hRJsyBudKAMAb0ADPsGivbnGbtJxh6p91GHwDnOxAAkt0z97SYb/sYz3eZAFAmiWMX7vXgMw==} + '@next/swc-darwin-x64@15.0.0-canary.75': + resolution: {integrity: sha512-59dBcPrwOl2sd41LnWSAm48LkixbzyCIn4saaZ9eqW9zCst80PuqerI2oyPELPv38XpTomNTquEwIb60ZwUszQ==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -759,8 +759,8 @@ packages: cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-gnu@15.0.0-canary.25': - resolution: {integrity: sha512-5kWUZ4vDg5SqYysg//a8nfOBCzzi9zgyoa57s9NNBZtwjOVUbHjyY/h3Mjv7dNqDxccbQJLxnAbF/mj7b1va0w==} + '@next/swc-linux-arm64-gnu@15.0.0-canary.75': + resolution: {integrity: sha512-IQZcCOWCJhQzxz7cGONKWp11VStinWwz33AfVNwHMIx2+UVr2+BhaShVIsqa7PnFBY7DvXoQHJawK2suc0LMsw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -771,8 +771,8 @@ packages: cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-musl@15.0.0-canary.25': - resolution: {integrity: sha512-AeqbtTC97CKyIBBZsTdHZFaK/PziWim5hkafdDMnZ1JDYfZhXaVrab0txxCSPeZte9/uIar3ChuKSXA5pMN1sg==} + '@next/swc-linux-arm64-musl@15.0.0-canary.75': + resolution: {integrity: sha512-Ls8TRqkOiIgPZoDcsD6P8z4qgQu7kAeeDfXNDwYuT+wf91qH0rCwPt0mBpHxk1jjs7y0auQ82uJAjIXgp5kupw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -783,8 +783,8 @@ packages: cpu: [x64] os: [linux] - '@next/swc-linux-x64-gnu@15.0.0-canary.25': - resolution: {integrity: sha512-cKDMfFGl4YNQp+AeOhGEzTnSw8UUhwKuZ7WRp9Ukd6ZzXq+vcZArv6swKr9Otn/xIlpgF967Du8Ex+gWZhueyA==} + '@next/swc-linux-x64-gnu@15.0.0-canary.75': + resolution: {integrity: sha512-GONyJruBfUct03xyL+WzsgZQ9pd/z8jYRtYgdfavWJTvnj4a5s0L6ywZ31dzXIpPu8HyUV+IJeO9zWOn6GEufg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -795,8 +795,8 @@ packages: cpu: [x64] os: [linux] - '@next/swc-linux-x64-musl@15.0.0-canary.25': - resolution: {integrity: sha512-K2phG5jz8jc0mDspwrDsj4+3AWFyfJRp/0k1YDEsb9Fju8/AC1P3Xt2Gbk/4nYvTWmLaTxZst98V0vRq474Fbw==} + '@next/swc-linux-x64-musl@15.0.0-canary.75': + resolution: {integrity: sha512-qCGNY2ox1+KGv0t+6ODm5qvWTKjP36mkFiEhWeGk1P7jw1pV8rLenHo6dDD+v10A1C5oaq5UWNWFSdC7AIvh2Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -807,8 +807,8 @@ packages: cpu: [arm64] os: [win32] - '@next/swc-win32-arm64-msvc@15.0.0-canary.25': - resolution: {integrity: sha512-f6b9yjsmkEs3xHHC/7RSWHq3Tfrm82kZTN1map0LK8WkzYXOIlClhLUKk/eFySrIVxnepdko6x4RwKSRMe/NgQ==} + '@next/swc-win32-arm64-msvc@15.0.0-canary.75': + resolution: {integrity: sha512-NOgRVnEU5DG3CB/gssEOmuRva5kyzKW36iJmb7LQHMVShzi/lg0eZI9vfGcNS/NWhN1qlKoVhw0e9BEXEZkFNw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -819,8 +819,8 @@ packages: cpu: [ia32] os: [win32] - '@next/swc-win32-ia32-msvc@15.0.0-canary.25': - resolution: {integrity: sha512-izjTAciAGYc4DY7n0VQ0uhqiV+yBW3KsyQtt+h7Wjl7az328vpnZE3PZY1K+S2uKDZiufvC1Gm7BfoWkn7+aKA==} + '@next/swc-win32-ia32-msvc@15.0.0-canary.75': + resolution: {integrity: sha512-XLosgh64YZV83fgYPX5Rn38ocqRjHXbDWXtZ9Yhc4BfPZnE5OahNabJylaHyJRvbdj4JnCqfgjY/DJm5iWIf0g==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -831,8 +831,8 @@ packages: cpu: [x64] os: [win32] - '@next/swc-win32-x64-msvc@15.0.0-canary.25': - resolution: {integrity: sha512-yrmD5ANlZLJuXIuo27RpNkPIrEuYq1IKZT7SPuXRTsrocU4DzQp0yFx6N1oQN6r7PcRJiUGXIVjwTwcFQx850g==} + '@next/swc-win32-x64-msvc@15.0.0-canary.75': + resolution: {integrity: sha512-4vgzoMmqSM1PqmKKNpySnzzyRZsxRNHog43+qKN5l2oxWmITHeM2Vc98ThLm5lk/EJDsA4PQeN0XQ4sBHGRZFg==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -1043,9 +1043,15 @@ packages: resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} engines: {node: '>=18'} + '@swc/counter@0.1.3': + resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + '@swc/helpers@0.5.11': resolution: {integrity: sha512-YNlnKRWF2sVojTpIyzwou9XoTNbzbzONwRhOoniEioF1AtaitTvVZblaQRrAzChWQ1bLYyYSWzM18y4WwgzJ+A==} + '@swc/helpers@0.5.12': + resolution: {integrity: sha512-KMZNXiGibsW9kvZAO1Pam2JPTDBm+KSHMMHWdsyI/1DbIZjT2A6Gy3hblVXUMEDvUAKq+e0vL0X0o54owWji7g==} + '@szmarczak/http-timer@5.0.1': resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} @@ -1101,24 +1107,10 @@ packages: typescript: optional: true - '@typescript-eslint/parser@7.2.0': - resolution: {integrity: sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/scope-manager@7.10.0': resolution: {integrity: sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@7.2.0': - resolution: {integrity: sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==} - engines: {node: ^16.0.0 || >=18.0.0} - '@typescript-eslint/type-utils@7.10.0': resolution: {integrity: sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1133,10 +1125,6 @@ packages: resolution: {integrity: sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@7.2.0': - resolution: {integrity: sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==} - engines: {node: ^16.0.0 || >=18.0.0} - '@typescript-eslint/typescript-estree@7.10.0': resolution: {integrity: sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1146,15 +1134,6 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@7.2.0': - resolution: {integrity: sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/utils@7.10.0': resolution: {integrity: sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1165,10 +1144,6 @@ packages: resolution: {integrity: sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/visitor-keys@7.2.0': - resolution: {integrity: sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==} - engines: {node: ^16.0.0 || >=18.0.0} - '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -1766,8 +1741,8 @@ packages: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} - eslint-config-next@15.0.0-canary.25: - resolution: {integrity: sha512-IrxdkRxhQOQ88AIVfZ9owhsErhP2b2S7ItbClaSMOyplMTcTOuLW15kX3RcwX+MTd1Bqlstf8SBAXugw+zalSQ==} + eslint-config-next@15.0.0-canary.75: + resolution: {integrity: sha512-ccfLBYKsrUffAduX+933mH0Qm3DVWV/U7ELl2SQuiZth/A0jh7ZkgAlsXwwY56pZssXa3xdLyN+jFCGDvdvmmw==} peerDependencies: eslint: ^7.23.0 || ^8.0.0 typescript: '>=3.3.1' @@ -1905,6 +1880,10 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + fast-glob@3.3.1: + resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} + engines: {node: '>=8.6.0'} + fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} @@ -2077,11 +2056,6 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - glob@10.3.10: - resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==} - engines: {node: '>=16 || 14 >=14.17'} - hasBin: true - glob@10.4.1: resolution: {integrity: sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==} engines: {node: '>=16 || 14 >=14.18'} @@ -2454,10 +2428,6 @@ packages: iterator.prototype@1.1.2: resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==} - jackspeak@2.3.6: - resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} - engines: {node: '>=14'} - jackspeak@3.1.2: resolution: {integrity: sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==} engines: {node: '>=14'} @@ -2708,10 +2678,6 @@ packages: minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - minimatch@9.0.3: - resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} - engines: {node: '>=16 || 14 >=14.17'} - minimatch@9.0.4: resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} engines: {node: '>=16 || 14 >=14.17'} @@ -2770,9 +2736,9 @@ packages: sass: optional: true - next@15.0.0-canary.25: - resolution: {integrity: sha512-V5oSgHCh7V/iKviqa5yBfKWANTzn/efGkqlJ8JxkNA2aNANJGg4TuiSck8ADcbWKe1Gkghr8atOmiSf/GeNnTw==} - engines: {node: '>=18.17.0'} + next@15.0.0-canary.75: + resolution: {integrity: sha512-RJdWBrAt0CqyIEqHoz8MtJe6Mlttl8nArveh3+XTTGSCccedG+fiHWpzufgro1prVrItUAEu8yTtqENTDFLlvA==} + engines: {node: '>=18.18.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 @@ -3227,10 +3193,10 @@ packages: peerDependencies: react: ^18.3.1 - react-dom@19.0.0-rc-6230622a1a-20240610: - resolution: {integrity: sha512-56G4Pum5E7FeGL1rwHX5IxidSJxQnXP4yORRo0pVeOJuu5DQJvNKpUwmJoftMP/ez0AiglYTY77L2Gs8iyt1Hg==} + react-dom@19.0.0-rc-512b09b2-20240718: + resolution: {integrity: sha512-qoTgXrHKBldyVk06n+QXV4wDwUbpeYC3xT6FC6dFYAWas8qCXIdc/6teUQ0ztqc+b3JSMVGri9jjblPQ4AQgEg==} peerDependencies: - react: 19.0.0-rc-6230622a1a-20240610 + react: 19.0.0-rc-512b09b2-20240718 react-hook-form@7.51.5: resolution: {integrity: sha512-J2ILT5gWx1XUIJRETiA7M19iXHlG74+6O3KApzvqB/w8S5NQR7AbU8HVZrMALdmDgWpRPYiZJl0zx8Z4L2mP6Q==} @@ -3245,8 +3211,8 @@ packages: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} - react@19.0.0-rc-6230622a1a-20240610: - resolution: {integrity: sha512-SMgWGY//7nO7F3HMuBfmC15Cr4vTe2tlpSCATfnz/wymSftDOKUqc+0smjRhcUeCFCc1zhOAWJ+N//U5CrmOzQ==} + react@19.0.0-rc-512b09b2-20240718: + resolution: {integrity: sha512-gKw9eqT3aOciPZ9b/+H2MskyY/SQqp8jQogNqkGb33OkOWF68w9IhNO1V76awemeeClQO9zbUzPzsyyVFPkKcg==} engines: {node: '>=0.10.0'} read-cache@1.0.0: @@ -3385,8 +3351,8 @@ packages: scheduler@0.23.2: resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - scheduler@0.25.0-rc-6230622a1a-20240610: - resolution: {integrity: sha512-GTIQdJXthps5mgkIFo7yAq03M0QQYTfN8z+GrnMC/SCKFSuyFP5tk2BMaaWUsVy4u4r+dTLdiXH8JEivVls0Bw==} + scheduler@0.25.0-rc-512b09b2-20240718: + resolution: {integrity: sha512-Ebxs3JKGZ9yl0xTMmNKOFev9ZYZHOM6I5Ub2VxeyX5T0JRUkYOyiWTunOVnGPKFGYx+GvScAk4dTuwLgxUw1yg==} semantic-release@23.1.1: resolution: {integrity: sha512-qqJDBhbtHsjUEMsojWKGuL5lQFCJuPtiXKEIlFKyTzDDGTAE/oyvznaP8GeOr5PvcqBJ6LQz4JCENWPLeehSpA==} @@ -4301,9 +4267,9 @@ snapshots: '@eslint/js@9.3.0': {} - '@hookform/resolvers@3.4.2(react-hook-form@7.51.5(react@19.0.0-rc-6230622a1a-20240610))': + '@hookform/resolvers@3.4.2(react-hook-form@7.51.5(react@19.0.0-rc-512b09b2-20240718))': dependencies: - react-hook-form: 7.51.5(react@19.0.0-rc-6230622a1a-20240610) + react-hook-form: 7.51.5(react@19.0.0-rc-512b09b2-20240718) '@humanwhocodes/config-array@0.11.14': dependencies: @@ -4454,64 +4420,64 @@ snapshots: '@next/env@14.3.0-canary.42': {} - '@next/env@15.0.0-canary.25': {} + '@next/env@15.0.0-canary.75': {} - '@next/eslint-plugin-next@15.0.0-canary.25': + '@next/eslint-plugin-next@15.0.0-canary.75': dependencies: - glob: 10.3.10 + fast-glob: 3.3.1 '@next/swc-darwin-arm64@14.3.0-canary.42': optional: true - '@next/swc-darwin-arm64@15.0.0-canary.25': + '@next/swc-darwin-arm64@15.0.0-canary.75': optional: true '@next/swc-darwin-x64@14.3.0-canary.42': optional: true - '@next/swc-darwin-x64@15.0.0-canary.25': + '@next/swc-darwin-x64@15.0.0-canary.75': optional: true '@next/swc-linux-arm64-gnu@14.3.0-canary.42': optional: true - '@next/swc-linux-arm64-gnu@15.0.0-canary.25': + '@next/swc-linux-arm64-gnu@15.0.0-canary.75': optional: true '@next/swc-linux-arm64-musl@14.3.0-canary.42': optional: true - '@next/swc-linux-arm64-musl@15.0.0-canary.25': + '@next/swc-linux-arm64-musl@15.0.0-canary.75': optional: true '@next/swc-linux-x64-gnu@14.3.0-canary.42': optional: true - '@next/swc-linux-x64-gnu@15.0.0-canary.25': + '@next/swc-linux-x64-gnu@15.0.0-canary.75': optional: true '@next/swc-linux-x64-musl@14.3.0-canary.42': optional: true - '@next/swc-linux-x64-musl@15.0.0-canary.25': + '@next/swc-linux-x64-musl@15.0.0-canary.75': optional: true '@next/swc-win32-arm64-msvc@14.3.0-canary.42': optional: true - '@next/swc-win32-arm64-msvc@15.0.0-canary.25': + '@next/swc-win32-arm64-msvc@15.0.0-canary.75': optional: true '@next/swc-win32-ia32-msvc@14.3.0-canary.42': optional: true - '@next/swc-win32-ia32-msvc@15.0.0-canary.25': + '@next/swc-win32-ia32-msvc@15.0.0-canary.75': optional: true '@next/swc-win32-x64-msvc@14.3.0-canary.42': optional: true - '@next/swc-win32-x64-msvc@15.0.0-canary.25': + '@next/swc-win32-x64-msvc@15.0.0-canary.75': optional: true '@nodelib/fs.scandir@2.1.5': @@ -4729,10 +4695,16 @@ snapshots: '@sindresorhus/merge-streams@4.0.0': {} + '@swc/counter@0.1.3': {} + '@swc/helpers@0.5.11': dependencies: tslib: 2.6.2 + '@swc/helpers@0.5.12': + dependencies: + tslib: 2.6.2 + '@szmarczak/http-timer@5.0.1': dependencies: defer-to-connect: 2.0.1 @@ -4797,29 +4769,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3)': - dependencies: - '@typescript-eslint/scope-manager': 7.2.0 - '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.5.3) - '@typescript-eslint/visitor-keys': 7.2.0 - debug: 4.3.4 - eslint: 8.57.0 - optionalDependencies: - typescript: 5.5.3 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/scope-manager@7.10.0': dependencies: '@typescript-eslint/types': 7.10.0 '@typescript-eslint/visitor-keys': 7.10.0 - '@typescript-eslint/scope-manager@7.2.0': - dependencies: - '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/visitor-keys': 7.2.0 - '@typescript-eslint/type-utils@7.10.0(eslint@8.57.0)(typescript@5.5.3)': dependencies: '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.5.3) @@ -4834,8 +4788,6 @@ snapshots: '@typescript-eslint/types@7.10.0': {} - '@typescript-eslint/types@7.2.0': {} - '@typescript-eslint/typescript-estree@7.10.0(typescript@5.5.3)': dependencies: '@typescript-eslint/types': 7.10.0 @@ -4851,21 +4803,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.2.0(typescript@5.5.3)': - dependencies: - '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/visitor-keys': 7.2.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.5.3) - optionalDependencies: - typescript: 5.5.3 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/utils@7.10.0(eslint@8.57.0)(typescript@5.5.3)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) @@ -4882,11 +4819,6 @@ snapshots: '@typescript-eslint/types': 7.10.0 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@7.2.0': - dependencies: - '@typescript-eslint/types': 7.2.0 - eslint-visitor-keys: 3.4.3 - '@ungap/structured-clone@1.2.0': {} JSONStream@1.3.5: @@ -5631,15 +5563,16 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-config-next@15.0.0-canary.25(eslint@8.57.0)(typescript@5.5.3): + eslint-config-next@15.0.0-canary.75(eslint@8.57.0)(typescript@5.5.3): dependencies: - '@next/eslint-plugin-next': 15.0.0-canary.25 + '@next/eslint-plugin-next': 15.0.0-canary.75 '@rushstack/eslint-patch': 1.10.3 - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/eslint-plugin': 7.10.0(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/parser': 7.10.0(eslint@8.57.0)(typescript@5.5.3) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-react: 7.34.1(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) @@ -5663,13 +5596,13 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0): + eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 4.3.4 enhanced-resolve: 5.16.1 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.13.1 @@ -5680,18 +5613,18 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/parser': 7.10.0(eslint@8.57.0)(typescript@5.5.3) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -5701,7 +5634,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -5712,7 +5645,7 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/parser': 7.10.0(eslint@8.57.0)(typescript@5.5.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -5885,6 +5818,14 @@ snapshots: fast-deep-equal@3.1.3: {} + fast-glob@3.3.1: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.7 + fast-glob@3.3.2: dependencies: '@nodelib/fs.stat': 2.0.5 @@ -6079,14 +6020,6 @@ snapshots: dependencies: is-glob: 4.0.3 - glob@10.3.10: - dependencies: - foreground-child: 3.1.1 - jackspeak: 2.3.6 - minimatch: 9.0.4 - minipass: 7.1.2 - path-scurry: 1.11.1 - glob@10.4.1: dependencies: foreground-child: 3.1.1 @@ -6466,12 +6399,6 @@ snapshots: reflect.getprototypeof: 1.0.6 set-function-name: 2.0.2 - jackspeak@2.3.6: - dependencies: - '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - jackspeak@3.1.2: dependencies: '@isaacs/cliui': 8.0.2 @@ -6635,9 +6562,9 @@ snapshots: pseudomap: 1.0.2 yallist: 2.1.2 - lucide-react@0.378.0(react@19.0.0-rc-6230622a1a-20240610): + lucide-react@0.378.0(react@19.0.0-rc-512b09b2-20240718): dependencies: - react: 19.0.0-rc-6230622a1a-20240610 + react: 19.0.0-rc-512b09b2-20240718 marked-terminal@7.0.0(marked@12.0.2): dependencies: @@ -6678,10 +6605,6 @@ snapshots: dependencies: brace-expansion: 1.1.11 - minimatch@9.0.3: - dependencies: - brace-expansion: 2.0.1 - minimatch@9.0.4: dependencies: brace-expansion: 2.0.1 @@ -6738,27 +6661,28 @@ snapshots: - '@babel/core' - babel-plugin-macros - next@15.0.0-canary.25(react-dom@19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610))(react@19.0.0-rc-6230622a1a-20240610): + next@15.0.0-canary.75(react-dom@19.0.0-rc-512b09b2-20240718(react@19.0.0-rc-512b09b2-20240718))(react@19.0.0-rc-512b09b2-20240718): dependencies: - '@next/env': 15.0.0-canary.25 - '@swc/helpers': 0.5.11 + '@next/env': 15.0.0-canary.75 + '@swc/counter': 0.1.3 + '@swc/helpers': 0.5.12 busboy: 1.6.0 caniuse-lite: 1.0.30001623 graceful-fs: 4.2.11 postcss: 8.4.31 - react: 19.0.0-rc-6230622a1a-20240610 - react-dom: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) - styled-jsx: 5.1.6(react@19.0.0-rc-6230622a1a-20240610) + react: 19.0.0-rc-512b09b2-20240718 + react-dom: 19.0.0-rc-512b09b2-20240718(react@19.0.0-rc-512b09b2-20240718) + styled-jsx: 5.1.6(react@19.0.0-rc-512b09b2-20240718) optionalDependencies: - '@next/swc-darwin-arm64': 15.0.0-canary.25 - '@next/swc-darwin-x64': 15.0.0-canary.25 - '@next/swc-linux-arm64-gnu': 15.0.0-canary.25 - '@next/swc-linux-arm64-musl': 15.0.0-canary.25 - '@next/swc-linux-x64-gnu': 15.0.0-canary.25 - '@next/swc-linux-x64-musl': 15.0.0-canary.25 - '@next/swc-win32-arm64-msvc': 15.0.0-canary.25 - '@next/swc-win32-ia32-msvc': 15.0.0-canary.25 - '@next/swc-win32-x64-msvc': 15.0.0-canary.25 + '@next/swc-darwin-arm64': 15.0.0-canary.75 + '@next/swc-darwin-x64': 15.0.0-canary.75 + '@next/swc-linux-arm64-gnu': 15.0.0-canary.75 + '@next/swc-linux-arm64-musl': 15.0.0-canary.75 + '@next/swc-linux-x64-gnu': 15.0.0-canary.75 + '@next/swc-linux-x64-musl': 15.0.0-canary.75 + '@next/swc-win32-arm64-msvc': 15.0.0-canary.75 + '@next/swc-win32-ia32-msvc': 15.0.0-canary.75 + '@next/swc-win32-x64-msvc': 15.0.0-canary.75 sharp: 0.33.4 transitivePeerDependencies: - '@babel/core' @@ -7096,14 +7020,14 @@ snapshots: react: 18.3.1 scheduler: 0.23.2 - react-dom@19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610): + react-dom@19.0.0-rc-512b09b2-20240718(react@19.0.0-rc-512b09b2-20240718): dependencies: - react: 19.0.0-rc-6230622a1a-20240610 - scheduler: 0.25.0-rc-6230622a1a-20240610 + react: 19.0.0-rc-512b09b2-20240718 + scheduler: 0.25.0-rc-512b09b2-20240718 - react-hook-form@7.51.5(react@19.0.0-rc-6230622a1a-20240610): + react-hook-form@7.51.5(react@19.0.0-rc-512b09b2-20240718): dependencies: - react: 19.0.0-rc-6230622a1a-20240610 + react: 19.0.0-rc-512b09b2-20240718 react-is@16.13.1: {} @@ -7111,7 +7035,7 @@ snapshots: dependencies: loose-envify: 1.4.0 - react@19.0.0-rc-6230622a1a-20240610: {} + react@19.0.0-rc-512b09b2-20240718: {} read-cache@1.0.0: dependencies: @@ -7290,7 +7214,7 @@ snapshots: dependencies: loose-envify: 1.4.0 - scheduler@0.25.0-rc-6230622a1a-20240610: {} + scheduler@0.25.0-rc-512b09b2-20240718: {} semantic-release@23.1.1(typescript@5.5.3): dependencies: @@ -7552,10 +7476,10 @@ snapshots: client-only: 0.0.1 react: 18.3.1 - styled-jsx@5.1.6(react@19.0.0-rc-6230622a1a-20240610): + styled-jsx@5.1.6(react@19.0.0-rc-512b09b2-20240718): dependencies: client-only: 0.0.1 - react: 19.0.0-rc-6230622a1a-20240610 + react: 19.0.0-rc-512b09b2-20240718 sucrase@3.35.0: dependencies: diff --git a/website/docs/execution/hooks/hook-base-utils.md b/website/docs/execution/hooks/hook-base-utils.md new file mode 100644 index 00000000..db8cab54 --- /dev/null +++ b/website/docs/execution/hooks/hook-base-utils.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 4 +description: Hook base utilities shared by all hooks. +--- + +# Hook base utils + +Hook base utilities are a set of properties shared by all hooks. + +## `executeOnMount?` + +`executeOnMount` is an optional object that, if passed to the hook, will `execute` the action when the component is mounted. It expects an `input` property of the same type as the input of the action and an optional `delayMs` property, which is the number of milliseconds to wait before executing the action (defaults to 0). \ No newline at end of file diff --git a/website/docs/execution/hooks/hook-callbacks.md b/website/docs/execution/hooks/hook-callbacks.md index 71178eb1..261e1793 100644 --- a/website/docs/execution/hooks/hook-callbacks.md +++ b/website/docs/execution/hooks/hook-callbacks.md @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 5 description: Hook callbacks are a way to perform custom logic based on the current action execution status. --- diff --git a/website/docs/execution/hooks/useaction.md b/website/docs/execution/hooks/useaction.md index 8e763252..b6bb272a 100644 --- a/website/docs/execution/hooks/useaction.md +++ b/website/docs/execution/hooks/useaction.md @@ -66,7 +66,7 @@ As you can see, here we display a greet message after the action is performed, i | Name | Type | Purpose | | -------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ | | `safeActionFn` | [HookSafeActionFn](/docs/types#hooksafeactionfn) | This is the action that will be called when you use `execute` from hook's return object. | -| `utils?` | [HookCallbacks](/docs/types#hookcallbacks) | Optional callbacks. More information about them [here](/docs/execution/hooks/hook-callbacks). | +| `utils?` | [`HookBaseUtils`](/docs/types#hookbaseutils) `&` [`HookCallbacks`](/docs/types#hookcallbacks) | Optional [base utils](/docs/execution/hooks/hook-base-utils) and [callbacks](/docs/execution/hooks/hook-callbacks). | ### `useAction` return object diff --git a/website/docs/execution/hooks/useoptimisticaction.md b/website/docs/execution/hooks/useoptimisticaction.md index 2fc4b482..d2774973 100644 --- a/website/docs/execution/hooks/useoptimisticaction.md +++ b/website/docs/execution/hooks/useoptimisticaction.md @@ -118,7 +118,7 @@ export default function TodosBox({ todos }: Props) { | Name | Type | Purpose | | ----------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `safeActionFn` | [`HookSafeActionFn`](/docs/types#hooksafeactionfn) | This is the action that will be called when you use `execute` from hook's return object. | -| `utils` | `{ currentState: State; updateFn: (state: State, input: InferIn) => State }` `&` [`HookCallbacks`](/docs/types#hookcallbacks) | Object with required `currentState`, `updateFn` and optional callbacks. See below for more information. | +| `utils` | `{ currentState: State; updateFn: (state: State, input: InferIn) => State }` `&` [`HookBaseUtils`](/docs/types#hookbaseutils) `&` [`HookCallbacks`](/docs/types#hookcallbacks) | Object with required `currentState`, `updateFn` and optional base utils and callbacks. See below for more information. | `utils` properties in detail: @@ -126,7 +126,8 @@ export default function TodosBox({ todos }: Props) { | ----------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `currentState` | `State` (generic) | An optimistic state setter. This value should come from the parent Server Component. | | `updateFn` | `(state: State, input: InferIn) => State` | When you call the action via `execute`, this function determines how the optimistic state update is performed. Basically, here you define what happens **immediately** after `execute` is called, and before the actual result comes back from the server (after revalidation). | -| `{ onExecute?, onSuccess?, onError?, onSettled? }` | [`HookCallbacks`](/docs/types#hookcallbacks) | Optional callbacks. More information about them [here](/docs/execution/hooks/hook-callbacks). | +| \- | [`HookBaseUtils`](/docs/types#hookbaseutils) | Optional base utilities. More information about them [here](/docs/execution/hooks/hook-base-utils). | +| \- | [`HookCallbacks`](/docs/types#hookcallbacks) | Optional callbacks. More information about them [here](/docs/execution/hooks/hook-callbacks). | ### `useOptimisticAction` return object diff --git a/website/docs/execution/hooks/usestateaction.md b/website/docs/execution/hooks/usestateaction.md index 6c6a2d57..a7b6d3c5 100644 --- a/website/docs/execution/hooks/usestateaction.md +++ b/website/docs/execution/hooks/usestateaction.md @@ -91,7 +91,7 @@ export default function StatefulFormPage() { | Name | Type | Purpose | | ----------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `safeActionFn` | [`HookSafeStateActionFn`](/docs/types#hooksafestateactionfn) | This is the action that will be passed to React's `useActionState` hook. You can then all it with `execute` function from the hook's return object, that has the same signature as `safeActionFn`, minus the first argument (`prevResult`). | -| `utils` | `{ initResult: Awaited>; permalink?: string }` `&` [`HookCallbacks`](/docs/types#hookcallbacks) | Object with required `initResult` property and optional `permalink` and [callbacks](/docs/execution/hooks/hook-callbacks). Permalink usage is [explained in React docs](https://react.dev/reference/react/useActionState#parameters) for `useActionState` hook. | +| `utils` | `{ initResult: Awaited>; permalink?: string }` `&` [`HookBaseUtils`](/docs/types#hookbaseutils) `&` [`HookCallbacks`](/docs/types#hookcallbacks) | Object with required `initResult` property and optional `permalink`, [base utils](/docs/execution/hooks/hook-base-utils) and [callbacks](/docs/execution/hooks/hook-callbacks). Permalink usage is [explained in React docs](https://react.dev/reference/react/useActionState#parameters) for `useActionState` hook. | You can pass an optional initial result to `useStateAction`, with the `initResult` argument. If not passed, the init result will default to an empty object: `{}`. diff --git a/website/docs/types.md b/website/docs/types.md index 337413d5..7be406db 100644 --- a/website/docs/types.md +++ b/website/docs/types.md @@ -290,6 +290,19 @@ export type HandleBindArgsValidationErrorsShapeFn = { + executeOnMount?: { + input: S extends Schema ? InferIn : undefined; + delayMs?: number; + }; +}; +``` + ### `HookResult` Type of `result` object returned by `useAction`, `useOptimisticAction` and `useStateAction` hooks.