@webstudio-is/sdk-components-react-remix 0.268.0 → 0.269.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 +20 -27
- package/lib/types/link.d.ts +8 -0
- package/package.json +4 -4
package/lib/components.js
CHANGED
|
@@ -12,28 +12,21 @@ var Body = forwardRef(
|
|
|
12
12
|
Body.displayName = "Body";
|
|
13
13
|
|
|
14
14
|
// src/link.tsx
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
href === "" || href.startsWith("?") || href.startsWith("/") && href.startsWith(assetBaseUrl) === false
|
|
26
|
-
) {
|
|
27
|
-
return /* @__PURE__ */ jsx2(RemixLink, { ...props, to: href, ref, end: true });
|
|
28
|
-
}
|
|
29
|
-
const { prefetch, reloadDocument, replace, preventScrollReset, ...rest } = props;
|
|
30
|
-
return /* @__PURE__ */ jsx2(BaseLink, { ...rest, ref });
|
|
15
|
+
import {
|
|
16
|
+
Link as RemixLink,
|
|
17
|
+
useLocation,
|
|
18
|
+
useResolvedPath
|
|
19
|
+
} from "@remix-run/react";
|
|
20
|
+
import { createLink } from "@webstudio-is/sdk-components-react";
|
|
21
|
+
var Link = createLink({
|
|
22
|
+
Link: RemixLink,
|
|
23
|
+
useLocation,
|
|
24
|
+
useResolvedPath
|
|
31
25
|
});
|
|
32
|
-
Link.displayName = BaseLink.displayName;
|
|
33
26
|
|
|
34
27
|
// src/webhook-form.tsx
|
|
35
28
|
import {
|
|
36
|
-
forwardRef as
|
|
29
|
+
forwardRef as forwardRef2,
|
|
37
30
|
useRef,
|
|
38
31
|
useEffect
|
|
39
32
|
} from "react";
|
|
@@ -43,7 +36,7 @@ import {
|
|
|
43
36
|
formBotFieldName,
|
|
44
37
|
isBraveBrowser
|
|
45
38
|
} from "@webstudio-is/sdk/runtime";
|
|
46
|
-
import { jsx as
|
|
39
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
47
40
|
var useOnFetchEnd = (fetcher, handler) => {
|
|
48
41
|
const latestHandler = useRef(handler);
|
|
49
42
|
latestHandler.current = handler;
|
|
@@ -81,7 +74,7 @@ var isJSDom = () => {
|
|
|
81
74
|
const hasMatchMedia = matchAspectRatio && matchWidthHeight && !matchWidthHeightFail && matchLight !== matchDark;
|
|
82
75
|
return hasMatchMedia === false;
|
|
83
76
|
};
|
|
84
|
-
var WebhookForm =
|
|
77
|
+
var WebhookForm = forwardRef2(
|
|
85
78
|
({ children, action, method, state = "initial", onStateChange, ...rest }, ref) => {
|
|
86
79
|
const fetcher = useFetcher();
|
|
87
80
|
useOnFetchEnd(fetcher, (data) => {
|
|
@@ -108,7 +101,7 @@ var WebhookForm = forwardRef3(
|
|
|
108
101
|
ref,
|
|
109
102
|
onSubmit: handleSubmitAndAddHiddenJsField,
|
|
110
103
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ jsx2(
|
|
112
105
|
"input",
|
|
113
106
|
{
|
|
114
107
|
type: "hidden",
|
|
@@ -125,15 +118,15 @@ var WebhookForm = forwardRef3(
|
|
|
125
118
|
WebhookForm.displayName = "WebhookForm";
|
|
126
119
|
|
|
127
120
|
// src/remix-form.tsx
|
|
128
|
-
import { forwardRef as
|
|
121
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
129
122
|
import { Form } from "@remix-run/react";
|
|
130
|
-
import { jsx as
|
|
131
|
-
var RemixForm =
|
|
123
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
124
|
+
var RemixForm = forwardRef3(({ action, method, ...props }, ref) => {
|
|
132
125
|
if (method === "dialog") {
|
|
133
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ jsx3("form", { ...props, ref });
|
|
134
127
|
}
|
|
135
128
|
if (action === void 0 || action === "" || typeof action === "string" && action?.startsWith("/")) {
|
|
136
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ jsx3(
|
|
137
130
|
Form,
|
|
138
131
|
{
|
|
139
132
|
action,
|
|
@@ -144,7 +137,7 @@ var RemixForm = forwardRef4(({ action, method, ...props }, ref) => {
|
|
|
144
137
|
}
|
|
145
138
|
);
|
|
146
139
|
}
|
|
147
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ jsx3("form", { ...props, ref });
|
|
148
141
|
});
|
|
149
142
|
RemixForm.displayName = "Form";
|
|
150
143
|
export {
|
package/lib/types/link.d.ts
CHANGED
|
@@ -2,15 +2,23 @@ export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<O
|
|
|
2
2
|
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
3
3
|
download?: boolean;
|
|
4
4
|
prefetch?: "none" | "intent" | "render" | "viewport";
|
|
5
|
+
discover?: "render" | "none";
|
|
5
6
|
preventScrollReset?: boolean;
|
|
6
7
|
reloadDocument?: boolean;
|
|
7
8
|
replace?: boolean;
|
|
9
|
+
relative?: "route" | "path";
|
|
10
|
+
state?: unknown;
|
|
11
|
+
viewTransition?: boolean;
|
|
8
12
|
} & {
|
|
9
13
|
$webstudio$canvasOnly$assetId?: string | undefined;
|
|
10
14
|
}, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
|
|
11
15
|
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
12
16
|
prefetch?: "none" | "intent" | "render" | "viewport";
|
|
17
|
+
discover?: "render" | "none";
|
|
13
18
|
reloadDocument?: boolean;
|
|
14
19
|
replace?: boolean;
|
|
15
20
|
preventScrollReset?: boolean;
|
|
21
|
+
relative?: "route" | "path";
|
|
22
|
+
state?: unknown;
|
|
23
|
+
viewTransition?: boolean;
|
|
16
24
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
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.269.0",
|
|
4
4
|
"description": "Webstudio components for Remix",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"react-dom": "18.3.0-canary-14898b6a9-20240318"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@webstudio-is/react-sdk": "0.
|
|
29
|
-
"@webstudio-is/sdk
|
|
30
|
-
"@webstudio-is/sdk": "0.
|
|
28
|
+
"@webstudio-is/react-sdk": "0.269.0",
|
|
29
|
+
"@webstudio-is/sdk": "0.269.0",
|
|
30
|
+
"@webstudio-is/sdk-components-react": "0.269.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@remix-run/react": "^2.16.5",
|