@webstudio-is/sdk-components-react-remix 0.174.0 → 0.179.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.
Files changed (24) hide show
  1. package/lib/components.js +4 -11
  2. package/lib/metas.js +8 -1
  3. package/lib/props.js +9 -1
  4. package/lib/types/{sdk-components-react-remix/src/link.d.ts → link.d.ts} +4 -1
  5. package/lib/types/{sdk-components-react-remix/src/remix-form.d.ts → remix-form.d.ts} +2 -1
  6. package/lib/types/{sdk-components-react-remix/src/rich-text-link.d.ts → rich-text-link.d.ts} +4 -1
  7. package/lib/types/{sdk-components-react-remix/src/shared → shared}/remix-link.d.ts +4 -1
  8. package/lib/types/{sdk-components-react-remix/src/webhook-form.d.ts → webhook-form.d.ts} +2 -1
  9. package/package.json +6 -6
  10. package/lib/types/form-handlers/src/shared.d.ts +0 -29
  11. /package/lib/types/{sdk-components-react-remix/src/__generated__ → __generated__}/body.props.d.ts +0 -0
  12. /package/lib/types/{sdk-components-react-remix/src/__generated__ → __generated__}/link.props.d.ts +0 -0
  13. /package/lib/types/{sdk-components-react-remix/src/__generated__ → __generated__}/remix-form.props.d.ts +0 -0
  14. /package/lib/types/{sdk-components-react-remix/src/__generated__ → __generated__}/rich-text-link.props.d.ts +0 -0
  15. /package/lib/types/{sdk-components-react-remix/src/__generated__ → __generated__}/webhook-form.props.d.ts +0 -0
  16. /package/lib/types/{sdk-components-react-remix/src/body.d.ts → body.d.ts} +0 -0
  17. /package/lib/types/{sdk-components-react-remix/src/body.ws.d.ts → body.ws.d.ts} +0 -0
  18. /package/lib/types/{sdk-components-react-remix/src/components.d.ts → components.d.ts} +0 -0
  19. /package/lib/types/{sdk-components-react-remix/src/link.ws.d.ts → link.ws.d.ts} +0 -0
  20. /package/lib/types/{sdk-components-react-remix/src/metas.d.ts → metas.d.ts} +0 -0
  21. /package/lib/types/{sdk-components-react-remix/src/props.d.ts → props.d.ts} +0 -0
  22. /package/lib/types/{sdk-components-react-remix/src/remix-form.ws.d.ts → remix-form.ws.d.ts} +0 -0
  23. /package/lib/types/{sdk-components-react-remix/src/rich-text-link.ws.d.ts → rich-text-link.ws.d.ts} +0 -0
  24. /package/lib/types/{sdk-components-react-remix/src/webhook-form.ws.d.ts → webhook-form.ws.d.ts} +0 -0
package/lib/components.js CHANGED
@@ -17,7 +17,7 @@ import { Link as BaseLink } from "@webstudio-is/sdk-components-react";
17
17
  // src/shared/remix-link.tsx
18
18
  import { forwardRef as forwardRef2, useContext } from "react";
19
19
  import { NavLink as RemixLink } from "@remix-run/react";
20
- import { ReactSdkContext } from "@webstudio-is/react-sdk";
20
+ import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";
21
21
  import { jsx as jsx2 } from "react/jsx-runtime";
22
22
  var wrapLinkComponent = (BaseLink3) => {
23
23
  const Component = forwardRef2((props, ref) => {
@@ -52,14 +52,7 @@ import {
52
52
  useEffect
53
53
  } from "react";
54
54
  import { useFetcher } from "@remix-run/react";
55
- import { formIdFieldName as formIdFieldName2 } from "@webstudio-is/form-handlers";
56
-
57
- // ../form-handlers/src/shared.ts
58
- var formHiddenFieldPrefix = "ws--form";
59
- var formIdFieldName = `${formHiddenFieldPrefix}-id`;
60
- var formBotFieldName = `${formHiddenFieldPrefix}-bot`;
61
-
62
- // src/webhook-form.tsx
55
+ import { formIdFieldName, formBotFieldName } from "@webstudio-is/sdk";
63
56
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
64
57
  var useOnFetchEnd = (fetcher, handler) => {
65
58
  const latestHandler = useRef(handler);
@@ -125,7 +118,7 @@ var WebhookForm = forwardRef3(
125
118
  "input",
126
119
  {
127
120
  type: "hidden",
128
- name: formIdFieldName2,
121
+ name: formIdFieldName,
129
122
  value: action?.toString()
130
123
  }
131
124
  ),
@@ -143,7 +136,7 @@ import {
143
136
  useContext as useContext2
144
137
  } from "react";
145
138
  import { Form } from "@remix-run/react";
146
- import { ReactSdkContext as ReactSdkContext2 } from "@webstudio-is/react-sdk";
139
+ import { ReactSdkContext as ReactSdkContext2 } from "@webstudio-is/react-sdk/runtime";
147
140
  import { jsx as jsx4 } from "react/jsx-runtime";
148
141
  var RemixForm = forwardRef4(({ action, ...props }, ref) => {
149
142
  const { renderer } = useContext2(ReactSdkContext2);
package/lib/metas.js CHANGED
@@ -376,12 +376,19 @@ var props = {
376
376
  },
377
377
  datatype: { required: false, control: "text", type: "string" },
378
378
  defaultChecked: { required: false, control: "boolean", type: "boolean" },
379
+ defaultValue: { required: false, control: "text", type: "string" },
379
380
  dir: {
380
381
  required: false,
381
382
  control: "text",
382
383
  type: "string",
383
384
  description: "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)"
384
385
  },
386
+ download: {
387
+ required: false,
388
+ control: "boolean",
389
+ type: "boolean",
390
+ description: "Indicates that the hyperlink is to be used for downloading a resource."
391
+ },
385
392
  draggable: {
386
393
  required: false,
387
394
  control: "boolean",
@@ -579,7 +586,7 @@ var propsMeta = {
579
586
  required: false
580
587
  }
581
588
  },
582
- initialProps: ["id", "className", "href", "target", "prefetch"]
589
+ initialProps: ["id", "className", "href", "target", "prefetch", "download"]
583
590
  };
584
591
 
585
592
  // src/rich-text-link.ws.ts
package/lib/props.js CHANGED
@@ -376,12 +376,19 @@ var props = {
376
376
  },
377
377
  datatype: { required: false, control: "text", type: "string" },
378
378
  defaultChecked: { required: false, control: "boolean", type: "boolean" },
379
+ defaultValue: { required: false, control: "text", type: "string" },
379
380
  dir: {
380
381
  required: false,
381
382
  control: "text",
382
383
  type: "string",
383
384
  description: "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)"
384
385
  },
386
+ download: {
387
+ required: false,
388
+ control: "boolean",
389
+ type: "boolean",
390
+ description: "Indicates that the hyperlink is to be used for downloading a resource."
391
+ },
385
392
  draggable: {
386
393
  required: false,
387
394
  control: "boolean",
@@ -579,7 +586,7 @@ var propsMeta = {
579
586
  required: false
580
587
  }
581
588
  },
582
- initialProps: ["id", "className", "href", "target", "prefetch"]
589
+ initialProps: ["id", "className", "href", "target", "prefetch", "download"]
583
590
  };
584
591
 
585
592
  // src/rich-text-link.ws.ts
@@ -984,6 +991,7 @@ var props2 = {
984
991
  },
985
992
  datatype: { required: false, control: "text", type: "string" },
986
993
  defaultChecked: { required: false, control: "boolean", type: "boolean" },
994
+ defaultValue: { required: false, control: "text", type: "string" },
987
995
  dir: {
988
996
  required: false,
989
997
  control: "text",
@@ -1,5 +1,8 @@
1
- export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target"> & {
1
+ export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target" | "download"> & {
2
2
  target?: "_self" | "_blank" | "_parent" | "_top";
3
+ download?: boolean;
4
+ } & {
5
+ $webstudio$canvasOnly$assetId?: string | undefined;
3
6
  }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
4
7
  target?: "_self" | "_blank" | "_parent" | "_top";
5
8
  prefetch?: "none" | "intent" | "render" | "viewport";
@@ -1,5 +1,6 @@
1
1
  import { type FormProps } from "@remix-run/react";
2
2
  export declare const defaultTag = "form";
3
- export declare const RemixForm: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & Pick<FormProps, "encType"> & {
3
+ export declare const RemixForm: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "action"> & Pick<FormProps, "encType"> & {
4
4
  method?: Lowercase<NonNullable<FormProps["method"]>>;
5
+ action?: string;
5
6
  }, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
@@ -1,5 +1,8 @@
1
- export declare const RichTextLink: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target"> & {
1
+ export declare const RichTextLink: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target" | "download"> & {
2
2
  target?: "_self" | "_blank" | "_parent" | "_top";
3
+ download?: boolean;
4
+ } & {
5
+ $webstudio$canvasOnly$assetId?: string | undefined;
3
6
  }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
4
7
  target?: "_self" | "_blank" | "_parent" | "_top";
5
8
  prefetch?: "none" | "intent" | "render" | "viewport";
@@ -1,6 +1,9 @@
1
1
  import type { Link } from "@webstudio-is/sdk-components-react";
2
- export declare const wrapLinkComponent: (BaseLink: typeof Link) => import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target"> & {
2
+ export declare const wrapLinkComponent: (BaseLink: typeof Link) => import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target" | "download"> & {
3
3
  target?: "_self" | "_blank" | "_parent" | "_top";
4
+ download?: boolean;
5
+ } & {
6
+ $webstudio$canvasOnly$assetId?: string | undefined;
4
7
  }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
5
8
  target?: "_self" | "_blank" | "_parent" | "_top";
6
9
  prefetch?: "none" | "intent" | "render" | "viewport";
@@ -1,10 +1,11 @@
1
1
  import { type FormProps } from "@remix-run/react";
2
2
  export declare const defaultTag = "form";
3
3
  type State = "initial" | "success" | "error";
4
- export declare const WebhookForm: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & {
4
+ export declare const WebhookForm: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "action"> & {
5
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. */
6
6
  state?: State;
7
7
  encType?: FormProps["encType"];
8
8
  onStateChange?: (state: State) => void;
9
+ action?: string;
9
10
  }, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
10
11
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react-remix",
3
- "version": "0.174.0",
3
+ "version": "0.179.0",
4
4
  "description": "Webstudio components for Remix",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -35,13 +35,13 @@
35
35
  "react-dom": "18.3.0-canary-14898b6a9-20240318"
36
36
  },
37
37
  "dependencies": {
38
- "@webstudio-is/form-handlers": "0.174.0",
39
- "@webstudio-is/react-sdk": "0.174.0",
40
- "@webstudio-is/icons": "0.174.0",
41
- "@webstudio-is/sdk-components-react": "0.174.0"
38
+ "@webstudio-is/icons": "0.179.0",
39
+ "@webstudio-is/sdk": "0.179.0",
40
+ "@webstudio-is/react-sdk": "0.179.0",
41
+ "@webstudio-is/sdk-components-react": "0.179.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@remix-run/react": "^2.10.3",
44
+ "@remix-run/react": "^2.11.0",
45
45
  "@types/node": "^20.12.7",
46
46
  "@types/react": "^18.2.70",
47
47
  "@types/react-dom": "^18.2.25",
@@ -1,29 +0,0 @@
1
- export declare const formIdFieldName = "ws--form-id";
2
- export declare const formBotFieldName = "ws--form-bot";
3
- export type FormInfo = {
4
- formId: string;
5
- pageUrl: string;
6
- formData: FormData;
7
- toEmail: string;
8
- fromEmail: string;
9
- };
10
- export type EmailInfo = {
11
- from: string;
12
- to: string;
13
- txt: string;
14
- /** Only the body content, requers wrapping into `<!DOCTYPE html><html><body>...</body></html>` */
15
- html: string;
16
- subject: string;
17
- };
18
- export type Result = {
19
- success: true;
20
- } | {
21
- success: false;
22
- errors: string[];
23
- };
24
- export declare const formToEmail: ({ formData, pageUrl, toEmail, fromEmail, }: FormInfo) => EmailInfo;
25
- export declare const getResponseBody: (response: Response) => Promise<{
26
- text: string;
27
- json?: Record<string, unknown>;
28
- }>;
29
- export declare const getErrors: (json: Record<string, unknown> | undefined) => string[] | undefined;