@webstudio-is/sdk-components-react-remix 0.129.0 → 0.131.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/metas.js +6 -20
- package/lib/props.js +106 -12
- package/package.json +8 -8
package/lib/metas.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/body.ws.
|
|
1
|
+
// src/body.ws.ts
|
|
2
2
|
import { Body } from "@webstudio-is/sdk-components-react/metas";
|
|
3
3
|
import { Body as Body2 } from "@webstudio-is/sdk-components-react/props";
|
|
4
4
|
|
|
@@ -586,33 +586,19 @@ var propsMeta = {
|
|
|
586
586
|
required: false
|
|
587
587
|
}
|
|
588
588
|
},
|
|
589
|
-
initialProps: ["id", "href", "target", "prefetch"]
|
|
589
|
+
initialProps: ["id", "className", "href", "target", "prefetch"]
|
|
590
590
|
};
|
|
591
591
|
|
|
592
|
-
// src/rich-text-link.ws.
|
|
592
|
+
// src/rich-text-link.ws.ts
|
|
593
593
|
import { RichTextLink } from "@webstudio-is/sdk-components-react/metas";
|
|
594
594
|
|
|
595
|
-
// src/form.ws.
|
|
596
|
-
import {
|
|
597
|
-
import { form } from "@webstudio-is/react-sdk/css-normalize";
|
|
595
|
+
// src/form.ws.ts
|
|
596
|
+
import { Form as baseMeta } from "@webstudio-is/sdk-components-react/metas";
|
|
598
597
|
import {
|
|
599
598
|
showAttribute
|
|
600
599
|
} from "@webstudio-is/react-sdk";
|
|
601
|
-
var presetStyle = {
|
|
602
|
-
form: [
|
|
603
|
-
...form,
|
|
604
|
-
{ property: "minHeight", value: { type: "unit", unit: "px", value: 20 } }
|
|
605
|
-
]
|
|
606
|
-
};
|
|
607
600
|
var meta = {
|
|
608
|
-
|
|
609
|
-
type: "container",
|
|
610
|
-
invalidAncestors: ["Form"],
|
|
611
|
-
label: "Form",
|
|
612
|
-
description: "Collect information from your users using validation rules.",
|
|
613
|
-
icon: FormIcon,
|
|
614
|
-
presetStyle,
|
|
615
|
-
order: 0,
|
|
601
|
+
...baseMeta,
|
|
616
602
|
states: [
|
|
617
603
|
{ selector: "[data-state=error]", label: "Error" },
|
|
618
604
|
{ selector: "[data-state=success]", label: "Success" }
|
package/lib/props.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/body.ws.
|
|
1
|
+
// src/body.ws.ts
|
|
2
2
|
import { Body } from "@webstudio-is/sdk-components-react/metas";
|
|
3
3
|
import { Body as Body2 } from "@webstudio-is/sdk-components-react/props";
|
|
4
4
|
|
|
@@ -586,16 +586,15 @@ var propsMeta = {
|
|
|
586
586
|
required: false
|
|
587
587
|
}
|
|
588
588
|
},
|
|
589
|
-
initialProps: ["id", "href", "target", "prefetch"]
|
|
589
|
+
initialProps: ["id", "className", "href", "target", "prefetch"]
|
|
590
590
|
};
|
|
591
591
|
|
|
592
|
-
// src/rich-text-link.ws.
|
|
592
|
+
// src/rich-text-link.ws.ts
|
|
593
593
|
import { RichTextLink } from "@webstudio-is/sdk-components-react/metas";
|
|
594
594
|
var propsMeta2 = propsMeta;
|
|
595
595
|
|
|
596
|
-
// src/form.ws.
|
|
597
|
-
import {
|
|
598
|
-
import { form } from "@webstudio-is/react-sdk/css-normalize";
|
|
596
|
+
// src/form.ws.ts
|
|
597
|
+
import { Form as baseMeta } from "@webstudio-is/sdk-components-react/metas";
|
|
599
598
|
import {
|
|
600
599
|
showAttribute
|
|
601
600
|
} from "@webstudio-is/react-sdk";
|
|
@@ -1170,16 +1169,111 @@ var props2 = {
|
|
|
1170
1169
|
vocab: { required: false, control: "text", type: "string" }
|
|
1171
1170
|
};
|
|
1172
1171
|
|
|
1173
|
-
// src/form.ws.
|
|
1174
|
-
var
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
{
|
|
1172
|
+
// src/form.ws.ts
|
|
1173
|
+
var meta = {
|
|
1174
|
+
...baseMeta,
|
|
1175
|
+
states: [
|
|
1176
|
+
{ selector: "[data-state=error]", label: "Error" },
|
|
1177
|
+
{ selector: "[data-state=success]", label: "Success" }
|
|
1178
|
+
],
|
|
1179
|
+
template: [
|
|
1180
|
+
{
|
|
1181
|
+
type: "instance",
|
|
1182
|
+
component: "Form",
|
|
1183
|
+
variables: {
|
|
1184
|
+
formState: { initialValue: "initial" }
|
|
1185
|
+
},
|
|
1186
|
+
props: [
|
|
1187
|
+
{
|
|
1188
|
+
type: "expression",
|
|
1189
|
+
name: "state",
|
|
1190
|
+
code: "formState"
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
type: "action",
|
|
1194
|
+
name: "onStateChange",
|
|
1195
|
+
value: [
|
|
1196
|
+
{ type: "execute", args: ["state"], code: `formState = state` }
|
|
1197
|
+
]
|
|
1198
|
+
}
|
|
1199
|
+
],
|
|
1200
|
+
children: [
|
|
1201
|
+
{
|
|
1202
|
+
type: "instance",
|
|
1203
|
+
label: "Form Content",
|
|
1204
|
+
component: "Box",
|
|
1205
|
+
props: [
|
|
1206
|
+
{
|
|
1207
|
+
type: "expression",
|
|
1208
|
+
name: showAttribute,
|
|
1209
|
+
code: "formState === 'initial' || formState === 'error'"
|
|
1210
|
+
}
|
|
1211
|
+
],
|
|
1212
|
+
children: [
|
|
1213
|
+
{
|
|
1214
|
+
type: "instance",
|
|
1215
|
+
component: "Label",
|
|
1216
|
+
children: [{ type: "text", value: "Name" }]
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
type: "instance",
|
|
1220
|
+
component: "Input",
|
|
1221
|
+
props: [{ type: "string", name: "name", value: "name" }],
|
|
1222
|
+
children: []
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
type: "instance",
|
|
1226
|
+
component: "Label",
|
|
1227
|
+
children: [{ type: "text", value: "Email" }]
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
type: "instance",
|
|
1231
|
+
component: "Input",
|
|
1232
|
+
props: [{ type: "string", name: "name", value: "email" }],
|
|
1233
|
+
children: []
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
type: "instance",
|
|
1237
|
+
component: "Button",
|
|
1238
|
+
children: [{ type: "text", value: "Submit" }]
|
|
1239
|
+
}
|
|
1240
|
+
]
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
type: "instance",
|
|
1244
|
+
label: "Success Message",
|
|
1245
|
+
component: "Box",
|
|
1246
|
+
props: [
|
|
1247
|
+
{
|
|
1248
|
+
type: "expression",
|
|
1249
|
+
name: showAttribute,
|
|
1250
|
+
code: "formState === 'success'"
|
|
1251
|
+
}
|
|
1252
|
+
],
|
|
1253
|
+
children: [
|
|
1254
|
+
{ type: "text", value: "Thank you for getting in touch!" }
|
|
1255
|
+
]
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
type: "instance",
|
|
1259
|
+
label: "Error Message",
|
|
1260
|
+
component: "Box",
|
|
1261
|
+
props: [
|
|
1262
|
+
{
|
|
1263
|
+
type: "expression",
|
|
1264
|
+
name: showAttribute,
|
|
1265
|
+
code: "formState === 'error'"
|
|
1266
|
+
}
|
|
1267
|
+
],
|
|
1268
|
+
children: [{ type: "text", value: "Sorry, something went wrong." }]
|
|
1269
|
+
}
|
|
1270
|
+
]
|
|
1271
|
+
}
|
|
1178
1272
|
]
|
|
1179
1273
|
};
|
|
1180
1274
|
var propsMeta3 = {
|
|
1181
1275
|
props: props2,
|
|
1182
|
-
initialProps: ["id", "state", "action"]
|
|
1276
|
+
initialProps: ["id", "className", "state", "action"]
|
|
1183
1277
|
};
|
|
1184
1278
|
export {
|
|
1185
1279
|
Body2 as Body,
|
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.131.0",
|
|
4
4
|
"description": "Webstudio components for Remix",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"react-dom": "^18.2.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@webstudio-is/form-handlers": "0.
|
|
42
|
-
"@webstudio-is/icons": "0.
|
|
43
|
-
"@webstudio-is/react-sdk": "0.
|
|
44
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
41
|
+
"@webstudio-is/form-handlers": "0.131.0",
|
|
42
|
+
"@webstudio-is/icons": "0.131.0",
|
|
43
|
+
"@webstudio-is/react-sdk": "0.131.0",
|
|
44
|
+
"@webstudio-is/sdk-components-react": "0.131.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@remix-run/react": "^1.19.2",
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"react": "^18.2.0",
|
|
51
51
|
"react-dom": "^18.2.0",
|
|
52
52
|
"typescript": "5.2.2",
|
|
53
|
-
"@webstudio-is/
|
|
54
|
-
"@webstudio-is/
|
|
53
|
+
"@webstudio-is/tsconfig": "1.0.7",
|
|
54
|
+
"@webstudio-is/generate-arg-types": "0.131.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"dev": "rm -rf lib && esbuild 'src/**/*.ts' 'src/**/*.tsx' --outdir=lib --watch",
|
|
58
58
|
"build": "rm -rf lib && esbuild src/components.ts src/metas.ts src/props.ts --outdir=lib --bundle --format=esm --packages=external",
|
|
59
|
-
"build:args": "NODE_OPTIONS=--conditions=webstudio generate-arg-types './src/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.
|
|
59
|
+
"build:args": "NODE_OPTIONS=--conditions=webstudio generate-arg-types './src/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.ts' && prettier --write \"**/*.props.ts\"",
|
|
60
60
|
"dts": "tsc --project tsconfig.dts.json",
|
|
61
61
|
"typecheck": "tsc",
|
|
62
62
|
"checks": "pnpm typecheck"
|