@void/react 1.6.1 → 1.6.2
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/index.d.mts +4 -4
- package/dist/index.mjs +2 -2
- package/dist/runtime/pages-client.d.mts +1 -0
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, ButtonHTMLAttributes, Context, FormHTMLAttributes, JSX, ReactElement, ReactNode } from "react";
|
|
2
|
-
import { ActionClient, BaseLinkProps, FormMethod, FormModel, FormState, IslandFormState, NavigationState, VoidActionError, VoidRouter } from "void/pages-client";
|
|
2
|
+
import { ActionClient, BaseLinkProps, FormMethod, FormModel, FormState, IslandFormState, NavigationState, VoidActionError, VoidActionError as VoidActionError$1, VoidRouter, isCallSiteActionError, isVoidActionError } from "void/pages-client";
|
|
3
3
|
import { CloudContextVariables, InferProps } from "void";
|
|
4
4
|
import { ActionFormOptions, ActionUrl, ResolveActionBody } from "void/routes";
|
|
5
5
|
type FormProps = Omit<FormHTMLAttributes<HTMLFormElement>, "action" | "onSubmit" | "method" | "onError"> & {
|
|
6
6
|
form: FormModel<[FormData]>;
|
|
7
7
|
method?: FormMethod;
|
|
8
|
-
renderError?: (error: VoidActionError) => ReactNode;
|
|
8
|
+
renderError?: (error: VoidActionError$1) => ReactNode;
|
|
9
9
|
};
|
|
10
10
|
export declare function Form({ form, method, renderError, children, ...props }: FormProps): ReactElement;
|
|
11
11
|
type LinkProps = BaseLinkProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof BaseLinkProps> & Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof BaseLinkProps>;
|
|
@@ -25,7 +25,7 @@ type FormOptions = {
|
|
|
25
25
|
resetOnSuccess?: boolean;
|
|
26
26
|
preserveScroll?: boolean;
|
|
27
27
|
onSuccess?: () => void | Promise<void>;
|
|
28
|
-
onError?: (error: Record<string, string> | VoidActionError) => void | Promise<void>;
|
|
28
|
+
onError?: (error: Record<string, string> | VoidActionError$1) => void | Promise<void>;
|
|
29
29
|
};
|
|
30
30
|
export declare function useForm<U extends ActionUrl & string>(url: U, defaults: ResolveActionBody<U>, options?: ActionFormOptions<U> & Pick<FormOptions, "onSuccess" | "onError" | "preserveScroll">): FormReturn<ResolveActionBody<U>>;
|
|
31
31
|
export declare function useNavigation(): NavigationState;
|
|
@@ -46,4 +46,4 @@ export declare const RouterContext: Context<VoidRouter | null>;
|
|
|
46
46
|
export declare const NavigationContext: Context<NavigationState>;
|
|
47
47
|
export declare const FrontmatterContext: Context<Record<string, unknown>>;
|
|
48
48
|
export type Deferred<T> = Promise<T>;
|
|
49
|
-
export type
|
|
49
|
+
export { type InferProps, type VoidActionError, isCallSiteActionError, isVoidActionError };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as RouterContext, i as ParamsContext, n as FrontmatterContext, o as SharedContext, r as NavigationContext, t as ErrorsContext } from "./context-BQpawTZc.mjs";
|
|
2
2
|
import { n as setActionRouter, t as action } from "./action-CyCVdW12.mjs";
|
|
3
3
|
import { useActionState, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
-
import { cloneFormValue, formErrorMessage, formRetryMessage, formSubmissionBlocked, getValidationErrors, handleLinkClick, interpolateRouteParams, isAbortError, isEqualFormValue, linkActiveAttributes, linkPendingAttributes, linkPrefetchStrategies, observeLinkVisible, parseFormResetArgs, prefetchLink, resolveLink, scheduleFormRetry, ssrProxy, submitAction, submitIslandAction } from "void/pages-client";
|
|
4
|
+
import { cloneFormValue, formErrorMessage, formRetryMessage, formSubmissionBlocked, getValidationErrors, handleLinkClick, interpolateRouteParams, isAbortError, isCallSiteActionError, isEqualFormValue, isVoidActionError, linkActiveAttributes, linkPendingAttributes, linkPrefetchStrategies, observeLinkVisible, parseFormResetArgs, prefetchLink, resolveLink, scheduleFormRetry, ssrProxy, submitAction, submitIslandAction } from "void/pages-client";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
// src/runtime/form.tsx
|
|
7
7
|
function Form({ form, method = "post", renderError, children, ...props }) {
|
|
@@ -437,4 +437,4 @@ function useIslandForm(defaults) {
|
|
|
437
437
|
delete: (url) => submit(url, "DELETE")
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
|
-
export { ErrorsContext, Form, FrontmatterContext, Link, NavigationContext, ParamsContext, RouterContext, SharedContext, action, setActionRouter, useForm, useIslandForm, useNavigation, useParams, useRouter, useShared };
|
|
440
|
+
export { ErrorsContext, Form, FrontmatterContext, Link, NavigationContext, ParamsContext, RouterContext, SharedContext, action, isCallSiteActionError, isVoidActionError, setActionRouter, useForm, useIslandForm, useNavigation, useParams, useRouter, useShared };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@void/react",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "React pages, server rendering, forms, and navigation for Void.",
|
|
5
5
|
"homepage": "https://void.cloud",
|
|
6
6
|
"bugs": {
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"react-dom": "^19.3.1",
|
|
51
51
|
"vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
|
|
52
52
|
"vite-plus": "1.4.0",
|
|
53
|
-
"void": "1.6.
|
|
53
|
+
"void": "1.6.2"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": "^19.0.0",
|
|
57
57
|
"react-dom": "^19.0.0",
|
|
58
58
|
"vite": "^8.0.0",
|
|
59
|
-
"void": "1.6.
|
|
59
|
+
"void": "1.6.2"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "vp pack",
|