@webstudio-is/sdk-components-react-remix 0.167.0 → 0.173.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/lib/components.js +1 -3
- package/lib/types/form-handlers/src/shared.d.ts +1 -5
- package/lib/types/sdk-components-react-remix/src/body.d.ts +0 -1
- package/lib/types/sdk-components-react-remix/src/link.d.ts +6 -7
- package/lib/types/sdk-components-react-remix/src/remix-form.d.ts +1 -2
- package/lib/types/sdk-components-react-remix/src/rich-text-link.d.ts +6 -7
- package/lib/types/sdk-components-react-remix/src/shared/remix-link.d.ts +6 -7
- package/lib/types/sdk-components-react-remix/src/webhook-form.d.ts +2 -3
- package/package.json +8 -10
package/lib/components.js
CHANGED
|
@@ -53,7 +53,6 @@ import {
|
|
|
53
53
|
} from "react";
|
|
54
54
|
import { useFetcher } from "@remix-run/react";
|
|
55
55
|
import { formIdFieldName as formIdFieldName2 } from "@webstudio-is/form-handlers";
|
|
56
|
-
import { getInstanceIdFromComponentProps } from "@webstudio-is/react-sdk";
|
|
57
56
|
|
|
58
57
|
// ../form-handlers/src/shared.ts
|
|
59
58
|
var formHiddenFieldPrefix = "ws--form";
|
|
@@ -102,7 +101,6 @@ var isJSDom = () => {
|
|
|
102
101
|
var WebhookForm = forwardRef3(
|
|
103
102
|
({ children, action, method, state = "initial", onStateChange, ...rest }, ref) => {
|
|
104
103
|
const fetcher = useFetcher();
|
|
105
|
-
const instanceId = getInstanceIdFromComponentProps(rest);
|
|
106
104
|
useOnFetchEnd(fetcher, (data) => {
|
|
107
105
|
const state2 = data?.success === true ? "success" : "error";
|
|
108
106
|
onStateChange?.(state2);
|
|
@@ -123,7 +121,7 @@ var WebhookForm = forwardRef3(
|
|
|
123
121
|
ref,
|
|
124
122
|
onSubmit: handleSubmitAndAddHiddenJsField,
|
|
125
123
|
children: [
|
|
126
|
-
/* @__PURE__ */ jsx3("input", { type: "hidden", name: formIdFieldName2, value:
|
|
124
|
+
/* @__PURE__ */ jsx3("input", { type: "hidden", name: formIdFieldName2, value: action }),
|
|
127
125
|
children
|
|
128
126
|
]
|
|
129
127
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
export declare const formIdFieldName = "ws--form-id";
|
|
2
2
|
export declare const formBotFieldName = "ws--form-bot";
|
|
3
3
|
export type FormInfo = {
|
|
4
|
-
|
|
4
|
+
formId: string;
|
|
5
5
|
pageUrl: string;
|
|
6
6
|
formData: FormData;
|
|
7
7
|
toEmail: string;
|
|
8
8
|
fromEmail: string;
|
|
9
|
-
action: string | null;
|
|
10
|
-
method: "get" | "post";
|
|
11
9
|
};
|
|
12
10
|
export type EmailInfo = {
|
|
13
11
|
from: string;
|
|
@@ -23,8 +21,6 @@ export type Result = {
|
|
|
23
21
|
success: false;
|
|
24
22
|
errors: string[];
|
|
25
23
|
};
|
|
26
|
-
/** Returns form entries that should be send in email: removes `File` entries and `formId` */
|
|
27
|
-
export declare const getFormEntries: (formData: FormData) => [string, string][];
|
|
28
24
|
export declare const formToEmail: ({ formData, pageUrl, toEmail, fromEmail, }: FormInfo) => EmailInfo;
|
|
29
25
|
export declare const getResponseBody: (response: Response) => Promise<{
|
|
30
26
|
text: string;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target"> & {
|
|
3
|
-
target?: "_self" | "_blank" | "_parent" | "_top"
|
|
2
|
+
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
4
3
|
}, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
|
|
5
|
-
target?: "_self" | "_blank" | "_parent" | "_top"
|
|
6
|
-
prefetch?: "none" | "intent" | "render" | "viewport"
|
|
7
|
-
reloadDocument?: boolean
|
|
8
|
-
replace?: boolean
|
|
9
|
-
preventScrollReset?: boolean
|
|
4
|
+
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
5
|
+
prefetch?: "none" | "intent" | "render" | "viewport";
|
|
6
|
+
reloadDocument?: boolean;
|
|
7
|
+
replace?: boolean;
|
|
8
|
+
preventScrollReset?: boolean;
|
|
10
9
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type FormProps } from "@remix-run/react";
|
|
3
2
|
export declare const defaultTag = "form";
|
|
4
3
|
export declare const RemixForm: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & Pick<FormProps, "encType"> & {
|
|
5
|
-
method?: "
|
|
4
|
+
method?: Lowercase<NonNullable<FormProps["method"]>>;
|
|
6
5
|
}, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const RichTextLink: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target"> & {
|
|
3
|
-
target?: "_self" | "_blank" | "_parent" | "_top"
|
|
2
|
+
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
4
3
|
}, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
|
|
5
|
-
target?: "_self" | "_blank" | "_parent" | "_top"
|
|
6
|
-
prefetch?: "none" | "intent" | "render" | "viewport"
|
|
7
|
-
reloadDocument?: boolean
|
|
8
|
-
replace?: boolean
|
|
9
|
-
preventScrollReset?: boolean
|
|
4
|
+
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
5
|
+
prefetch?: "none" | "intent" | "render" | "viewport";
|
|
6
|
+
reloadDocument?: boolean;
|
|
7
|
+
replace?: boolean;
|
|
8
|
+
preventScrollReset?: boolean;
|
|
10
9
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { Link } from "@webstudio-is/sdk-components-react";
|
|
3
2
|
export declare const wrapLinkComponent: (BaseLink: typeof Link) => import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target"> & {
|
|
4
|
-
target?: "_self" | "_blank" | "_parent" | "_top"
|
|
3
|
+
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
5
4
|
}, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
|
|
6
|
-
target?: "_self" | "_blank" | "_parent" | "_top"
|
|
7
|
-
prefetch?: "none" | "intent" | "render" | "viewport"
|
|
8
|
-
reloadDocument?: boolean
|
|
9
|
-
replace?: boolean
|
|
10
|
-
preventScrollReset?: boolean
|
|
5
|
+
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
6
|
+
prefetch?: "none" | "intent" | "render" | "viewport";
|
|
7
|
+
reloadDocument?: boolean;
|
|
8
|
+
replace?: boolean;
|
|
9
|
+
preventScrollReset?: boolean;
|
|
11
10
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type FormProps } from "@remix-run/react";
|
|
3
2
|
export declare const defaultTag = "form";
|
|
4
3
|
type State = "initial" | "success" | "error";
|
|
5
4
|
export declare const WebhookForm: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & {
|
|
6
5
|
/** Use this property to reveal the Success and Error states on the canvas so they can be styled. The Initial state is displayed when the page first opens. The Success and Error states are displayed depending on whether the Form submits successfully or unsuccessfully. */
|
|
7
|
-
state?: State
|
|
6
|
+
state?: State;
|
|
8
7
|
encType?: FormProps["encType"];
|
|
9
|
-
onStateChange?: (
|
|
8
|
+
onStateChange?: (state: State) => void;
|
|
10
9
|
}, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
|
|
11
10
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react-remix",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.173.0",
|
|
4
4
|
"description": "Webstudio components for Remix",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -35,28 +35,26 @@
|
|
|
35
35
|
"react-dom": "18.3.0-canary-14898b6a9-20240318"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@webstudio-is/form-handlers": "0.
|
|
39
|
-
"@webstudio-is/
|
|
40
|
-
"@webstudio-is/
|
|
41
|
-
"@webstudio-is/react
|
|
38
|
+
"@webstudio-is/form-handlers": "0.173.0",
|
|
39
|
+
"@webstudio-is/icons": "0.173.0",
|
|
40
|
+
"@webstudio-is/react-sdk": "0.173.0",
|
|
41
|
+
"@webstudio-is/sdk-components-react": "0.173.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@remix-run/react": "^2.
|
|
44
|
+
"@remix-run/react": "^2.10.3",
|
|
45
45
|
"@types/node": "^20.12.7",
|
|
46
46
|
"@types/react": "^18.2.70",
|
|
47
47
|
"@types/react-dom": "^18.2.25",
|
|
48
48
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
49
49
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
50
|
-
"typescript": "5.
|
|
50
|
+
"typescript": "5.5.2",
|
|
51
51
|
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
52
52
|
"@webstudio-is/tsconfig": "1.0.7"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
|
-
"dev": "rm -rf lib && esbuild 'src/**/*.ts' 'src/**/*.tsx' --outdir=lib --watch",
|
|
56
55
|
"build": "rm -rf lib && esbuild src/components.ts src/metas.ts src/props.ts --outdir=lib --bundle --format=esm --packages=external",
|
|
57
56
|
"build:args": "NODE_OPTIONS=--conditions=webstudio generate-arg-types './src/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.ts' && prettier --write \"**/*.props.ts\"",
|
|
58
57
|
"dts": "tsc --project tsconfig.dts.json",
|
|
59
|
-
"typecheck": "tsc"
|
|
60
|
-
"checks": "pnpm typecheck"
|
|
58
|
+
"typecheck": "tsc"
|
|
61
59
|
}
|
|
62
60
|
}
|