@webstudio-is/sdk-components-react-remix 0.163.0 → 0.168.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 CHANGED
@@ -23,7 +23,10 @@ var wrapLinkComponent = (BaseLink3) => {
23
23
  const Component = forwardRef2((props, ref) => {
24
24
  const { assetBaseUrl, renderer } = useContext(ReactSdkContext);
25
25
  const href = String(props.href ?? "");
26
- if (href === "" || href.startsWith("/") && href.startsWith(assetBaseUrl) === false) {
26
+ if (
27
+ // remix appends ?index in runtime but not in ssr
28
+ href === "" || href.startsWith("?") || href.startsWith("#") || href.startsWith("/") && href.startsWith(assetBaseUrl) === false
29
+ ) {
27
30
  if (renderer !== "canvas" && renderer !== "preview") {
28
31
  return /* @__PURE__ */ jsx2(RemixLink, { ...props, to: href, ref });
29
32
  }
@@ -130,12 +133,19 @@ var WebhookForm = forwardRef3(
130
133
  WebhookForm.displayName = "WebhookForm";
131
134
 
132
135
  // src/remix-form.tsx
133
- import { forwardRef as forwardRef4 } from "react";
136
+ import {
137
+ forwardRef as forwardRef4,
138
+ useContext as useContext2
139
+ } from "react";
134
140
  import { Form } from "@remix-run/react";
141
+ import { ReactSdkContext as ReactSdkContext2 } from "@webstudio-is/react-sdk";
135
142
  import { jsx as jsx4 } from "react/jsx-runtime";
136
143
  var RemixForm = forwardRef4((props, ref) => {
144
+ const { renderer } = useContext2(ReactSdkContext2);
137
145
  if (props.action === void 0 || props.action === "" || props.action?.startsWith("/")) {
138
- return /* @__PURE__ */ jsx4(Form, { ...props, ref });
146
+ if (renderer !== "canvas" && renderer !== "preview") {
147
+ return /* @__PURE__ */ jsx4(Form, { ...props, ref });
148
+ }
139
149
  }
140
150
  return /* @__PURE__ */ jsx4("form", { ...props, ref });
141
151
  });
package/lib/metas.js CHANGED
@@ -639,7 +639,7 @@ var meta = {
639
639
  {
640
640
  type: "instance",
641
641
  component: "Label",
642
- children: [{ type: "text", value: "Name" }]
642
+ children: [{ type: "text", value: "Name", placeholder: true }]
643
643
  },
644
644
  {
645
645
  type: "instance",
@@ -650,7 +650,7 @@ var meta = {
650
650
  {
651
651
  type: "instance",
652
652
  component: "Label",
653
- children: [{ type: "text", value: "Email" }]
653
+ children: [{ type: "text", value: "Email", placeholder: true }]
654
654
  },
655
655
  {
656
656
  type: "instance",
@@ -661,7 +661,7 @@ var meta = {
661
661
  {
662
662
  type: "instance",
663
663
  component: "Button",
664
- children: [{ type: "text", value: "Submit" }]
664
+ children: [{ type: "text", value: "Submit", placeholder: true }]
665
665
  }
666
666
  ]
667
667
  },
@@ -677,7 +677,11 @@ var meta = {
677
677
  }
678
678
  ],
679
679
  children: [
680
- { type: "text", value: "Thank you for getting in touch!" }
680
+ {
681
+ type: "text",
682
+ value: "Thank you for getting in touch!",
683
+ placeholder: true
684
+ }
681
685
  ]
682
686
  },
683
687
  {
@@ -691,7 +695,13 @@ var meta = {
691
695
  code: "formState === 'error'"
692
696
  }
693
697
  ],
694
- children: [{ type: "text", value: "Sorry, something went wrong." }]
698
+ children: [
699
+ {
700
+ type: "text",
701
+ value: "Sorry, something went wrong.",
702
+ placeholder: true
703
+ }
704
+ ]
695
705
  }
696
706
  ]
697
707
  }
package/lib/props.js CHANGED
@@ -1205,7 +1205,7 @@ var meta = {
1205
1205
  {
1206
1206
  type: "instance",
1207
1207
  component: "Label",
1208
- children: [{ type: "text", value: "Name" }]
1208
+ children: [{ type: "text", value: "Name", placeholder: true }]
1209
1209
  },
1210
1210
  {
1211
1211
  type: "instance",
@@ -1216,7 +1216,7 @@ var meta = {
1216
1216
  {
1217
1217
  type: "instance",
1218
1218
  component: "Label",
1219
- children: [{ type: "text", value: "Email" }]
1219
+ children: [{ type: "text", value: "Email", placeholder: true }]
1220
1220
  },
1221
1221
  {
1222
1222
  type: "instance",
@@ -1227,7 +1227,7 @@ var meta = {
1227
1227
  {
1228
1228
  type: "instance",
1229
1229
  component: "Button",
1230
- children: [{ type: "text", value: "Submit" }]
1230
+ children: [{ type: "text", value: "Submit", placeholder: true }]
1231
1231
  }
1232
1232
  ]
1233
1233
  },
@@ -1243,7 +1243,11 @@ var meta = {
1243
1243
  }
1244
1244
  ],
1245
1245
  children: [
1246
- { type: "text", value: "Thank you for getting in touch!" }
1246
+ {
1247
+ type: "text",
1248
+ value: "Thank you for getting in touch!",
1249
+ placeholder: true
1250
+ }
1247
1251
  ]
1248
1252
  },
1249
1253
  {
@@ -1257,7 +1261,13 @@ var meta = {
1257
1261
  code: "formState === 'error'"
1258
1262
  }
1259
1263
  ],
1260
- children: [{ type: "text", value: "Sorry, something went wrong." }]
1264
+ children: [
1265
+ {
1266
+ type: "text",
1267
+ value: "Sorry, something went wrong.",
1268
+ placeholder: true
1269
+ }
1270
+ ]
1261
1271
  }
1262
1272
  ]
1263
1273
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react-remix",
3
- "version": "0.163.0",
3
+ "version": "0.168.0",
4
4
  "description": "Webstudio components for Remix",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -30,26 +30,26 @@
30
30
  }
31
31
  },
32
32
  "peerDependencies": {
33
- "@remix-run/react": "^2.9.1",
33
+ "@remix-run/react": "^2.9.2",
34
34
  "react": "18.3.0-canary-14898b6a9-20240318",
35
35
  "react-dom": "18.3.0-canary-14898b6a9-20240318"
36
36
  },
37
37
  "dependencies": {
38
- "@webstudio-is/form-handlers": "0.163.0",
39
- "@webstudio-is/icons": "0.163.0",
40
- "@webstudio-is/react-sdk": "0.163.0",
41
- "@webstudio-is/sdk-components-react": "0.163.0"
38
+ "@webstudio-is/form-handlers": "0.168.0",
39
+ "@webstudio-is/icons": "0.168.0",
40
+ "@webstudio-is/react-sdk": "0.168.0",
41
+ "@webstudio-is/sdk-components-react": "0.168.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@remix-run/react": "^2.9.1",
44
+ "@remix-run/react": "^2.9.2",
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
50
  "typescript": "5.4.5",
51
- "@webstudio-is/generate-arg-types": "0.0.0",
52
- "@webstudio-is/tsconfig": "1.0.7"
51
+ "@webstudio-is/tsconfig": "1.0.7",
52
+ "@webstudio-is/generate-arg-types": "0.0.0"
53
53
  },
54
54
  "scripts": {
55
55
  "dev": "rm -rf lib && esbuild 'src/**/*.ts' 'src/**/*.tsx' --outdir=lib --watch",