@webstudio-is/react-sdk 0.5.0 → 0.5.1
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/arg-types/utils.d.ts +19 -1
- package/lib/arg-types/utils.d.ts.map +1 -1
- package/lib/arg-types/utils.js +7 -6
- package/lib/components/body.d.ts +3 -0
- package/lib/components/body.d.ts.map +1 -0
- package/lib/components/body.js +8 -0
- package/lib/components/body.props.json +2234 -0
- package/lib/components/body.stories.d.ts +7 -0
- package/lib/components/body.stories.d.ts.map +1 -0
- package/lib/components/body.stories.js +16 -0
- package/lib/components/body.ws.d.ts +5 -0
- package/lib/components/body.ws.d.ts.map +1 -0
- package/lib/components/body.ws.js +64 -0
- package/lib/components/bold.props.json +37 -7
- package/lib/components/bold.ws.d.ts +5 -0
- package/lib/components/bold.ws.d.ts.map +1 -0
- package/lib/components/bold.ws.js +14 -0
- package/lib/components/box.d.ts +7 -2
- package/lib/components/box.d.ts.map +1 -1
- package/lib/components/box.js +3 -2
- package/lib/components/box.props.json +102 -7
- package/lib/components/box.stories.d.ts +6 -2
- package/lib/components/box.stories.d.ts.map +1 -1
- package/lib/components/box.ws.d.ts +5 -0
- package/lib/components/box.ws.d.ts.map +1 -0
- package/lib/components/box.ws.js +21 -0
- package/lib/components/button.d.ts +1 -4
- package/lib/components/button.d.ts.map +1 -1
- package/lib/components/button.props.json +42 -8
- package/lib/components/button.ws.d.ts +5 -0
- package/lib/components/button.ws.d.ts.map +1 -0
- package/lib/components/button.ws.js +15 -0
- package/lib/components/component-type.d.ts +17 -0
- package/lib/components/component-type.d.ts.map +1 -0
- package/lib/components/component-type.js +28 -0
- package/lib/components/form.props.json +37 -7
- package/lib/components/form.ws.d.ts +5 -0
- package/lib/components/form.ws.d.ts.map +1 -0
- package/lib/components/form.ws.js +26 -0
- package/lib/components/heading.d.ts +2 -2
- package/lib/components/heading.d.ts.map +1 -1
- package/lib/components/heading.js +1 -4
- package/lib/components/heading.props.json +45 -8
- package/lib/components/heading.stories.d.ts +2 -2
- package/lib/components/heading.ws.d.ts +5 -0
- package/lib/components/heading.ws.d.ts.map +1 -0
- package/lib/components/heading.ws.js +15 -0
- package/lib/components/index.d.ts +11 -10
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +25 -23
- package/lib/components/index.test.d.ts +2 -0
- package/lib/components/index.test.d.ts.map +1 -0
- package/lib/components/index.test.js +33 -0
- package/lib/components/input.props.json +46 -8
- package/lib/components/input.ws.d.ts +5 -0
- package/lib/components/input.ws.d.ts.map +1 -0
- package/lib/components/input.ws.js +14 -0
- package/lib/components/italic.props.json +37 -7
- package/lib/components/italic.ws.d.ts +5 -0
- package/lib/components/italic.ws.d.ts.map +1 -0
- package/lib/components/italic.ws.js +14 -0
- package/lib/components/link.d.ts +2 -2
- package/lib/components/link.d.ts.map +1 -1
- package/lib/components/link.props.json +37 -7
- package/lib/components/link.stories.d.ts +6 -2
- package/lib/components/link.stories.d.ts.map +1 -1
- package/lib/components/link.ws.d.ts +5 -0
- package/lib/components/link.ws.d.ts.map +1 -0
- package/lib/components/link.ws.js +27 -0
- package/lib/components/meta.d.ts +1 -0
- package/lib/components/meta.d.ts.map +1 -1
- package/lib/components/meta.js +3 -1
- package/lib/components/paragraph.props.json +37 -7
- package/lib/components/paragraph.ws.d.ts +5 -0
- package/lib/components/paragraph.ws.d.ts.map +1 -0
- package/lib/components/paragraph.ws.js +15 -0
- package/lib/components/text-block.props.json +37 -7
- package/lib/components/text-block.ws.d.ts +5 -0
- package/lib/components/text-block.ws.d.ts.map +1 -0
- package/lib/components/text-block.ws.js +23 -0
- package/lib/css/get-browser-style.js +1 -1
- package/lib/css/keyword-values.d.ts.map +1 -1
- package/lib/css/keyword-values.js +1149 -396
- package/lib/css/properties.d.ts.map +1 -1
- package/lib/css/properties.js +3194 -3194
- package/lib/css/units.js +1 -1
- package/lib/db/instance.d.ts +5 -2
- package/lib/db/instance.d.ts.map +1 -1
- package/lib/db/instance.js +9 -1
- package/lib/db/types.d.ts +1 -2
- package/lib/db/types.d.ts.map +1 -1
- package/lib/pubsub/publish.js +1 -1
- package/lib/pubsub/subscribe.d.ts.map +1 -1
- package/lib/pubsub/subscribe.js +1 -2
- package/lib/stitches/css.d.ts.map +1 -1
- package/lib/stitches/css.js +1 -0
- package/lib/stitches/to-css.js +2 -3
- package/lib/tree/create-elements-tree.d.ts.map +1 -1
- package/lib/tree/create-elements-tree.js +43 -12
- package/lib/tree/root.js +3 -3
- package/lib/tree/wrapper-component.js +2 -2
- package/lib/user-props/all-user-props.d.ts.map +1 -1
- package/lib/user-props/all-user-props.js +5 -4
- package/lib/user-props/use-user-props.js +1 -1
- package/package.json +7 -9
- package/lib/prisma.server.d.ts +0 -3
- package/lib/prisma.server.d.ts.map +0 -1
- package/lib/prisma.server.js +0 -8
- package/prisma/schema.prisma +0 -71
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { Body as BodyPrimitive } from "./body";
|
|
4
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>, "key" | keyof React.HTMLAttributes<HTMLBodyElement>> & React.RefAttributes<HTMLBodyElement>>>;
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const Body: ComponentStory<typeof BodyPrimitive>;
|
|
7
|
+
//# sourceMappingURL=body.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body.stories.d.ts","sourceRoot":"","sources":["../../src/components/body.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,QAAQ,CAAC;;AAG/C,wBAIyC;AAEzC,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,OAAO,aAAa,CAErD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Body = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const body_1 = require("./body");
|
|
9
|
+
const body_props_json_1 = __importDefault(require("./body.props.json"));
|
|
10
|
+
exports.default = {
|
|
11
|
+
title: "Components/Body",
|
|
12
|
+
component: body_1.Body,
|
|
13
|
+
argTypes: body_props_json_1.default,
|
|
14
|
+
};
|
|
15
|
+
const Body = (args) => ((0, jsx_runtime_1.jsx)(body_1.Body, { ...args }));
|
|
16
|
+
exports.Body = Body;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body.ws.d.ts","sourceRoot":"","sources":["../../src/components/body.ws.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAoD9B,QAAA,MAAM,IAAI,EAAE,eAAe,CAAC,OAAO,IAAI,CAStC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const icons_1 = require("@webstudio-is/icons");
|
|
4
|
+
const body_1 = require("./body");
|
|
5
|
+
const defaultStyle = {
|
|
6
|
+
marginTop: {
|
|
7
|
+
type: "unit",
|
|
8
|
+
unit: "px",
|
|
9
|
+
value: 0,
|
|
10
|
+
},
|
|
11
|
+
marginRight: {
|
|
12
|
+
type: "unit",
|
|
13
|
+
unit: "px",
|
|
14
|
+
value: 0,
|
|
15
|
+
},
|
|
16
|
+
marginBottom: {
|
|
17
|
+
type: "unit",
|
|
18
|
+
unit: "px",
|
|
19
|
+
value: 0,
|
|
20
|
+
},
|
|
21
|
+
marginLeft: {
|
|
22
|
+
type: "unit",
|
|
23
|
+
unit: "px",
|
|
24
|
+
value: 0,
|
|
25
|
+
},
|
|
26
|
+
minHeight: {
|
|
27
|
+
type: "unit",
|
|
28
|
+
unit: "%",
|
|
29
|
+
value: 100,
|
|
30
|
+
},
|
|
31
|
+
backgroundColor: {
|
|
32
|
+
type: "keyword",
|
|
33
|
+
value: "white",
|
|
34
|
+
},
|
|
35
|
+
fontFamily: {
|
|
36
|
+
type: "keyword",
|
|
37
|
+
value: "Arial",
|
|
38
|
+
},
|
|
39
|
+
fontSize: {
|
|
40
|
+
type: "unit",
|
|
41
|
+
unit: "px",
|
|
42
|
+
value: 14,
|
|
43
|
+
},
|
|
44
|
+
lineHeight: {
|
|
45
|
+
type: "unit",
|
|
46
|
+
unit: "number",
|
|
47
|
+
value: 1.5,
|
|
48
|
+
},
|
|
49
|
+
color: {
|
|
50
|
+
type: "keyword",
|
|
51
|
+
value: "#232323",
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
const meta = {
|
|
55
|
+
Icon: icons_1.BodyIcon,
|
|
56
|
+
Component: body_1.Body,
|
|
57
|
+
canAcceptChildren: true,
|
|
58
|
+
isContentEditable: false,
|
|
59
|
+
label: "Body",
|
|
60
|
+
isInlineOnly: false,
|
|
61
|
+
isListed: false,
|
|
62
|
+
defaultStyle,
|
|
63
|
+
};
|
|
64
|
+
exports.default = meta;
|
|
@@ -447,7 +447,10 @@
|
|
|
447
447
|
"control": {
|
|
448
448
|
"type": "radio"
|
|
449
449
|
},
|
|
450
|
-
"options": [
|
|
450
|
+
"options": [
|
|
451
|
+
"yes",
|
|
452
|
+
"no"
|
|
453
|
+
]
|
|
451
454
|
},
|
|
452
455
|
"radioGroup": {
|
|
453
456
|
"defaultValue": null,
|
|
@@ -940,7 +943,10 @@
|
|
|
940
943
|
"control": {
|
|
941
944
|
"type": "radio"
|
|
942
945
|
},
|
|
943
|
-
"options": [
|
|
946
|
+
"options": [
|
|
947
|
+
"on",
|
|
948
|
+
"off"
|
|
949
|
+
]
|
|
944
950
|
},
|
|
945
951
|
"inputMode": {
|
|
946
952
|
"defaultValue": null,
|
|
@@ -1103,7 +1109,12 @@
|
|
|
1103
1109
|
"control": {
|
|
1104
1110
|
"type": "radio"
|
|
1105
1111
|
},
|
|
1106
|
-
"options": [
|
|
1112
|
+
"options": [
|
|
1113
|
+
"list",
|
|
1114
|
+
"none",
|
|
1115
|
+
"inline",
|
|
1116
|
+
"both"
|
|
1117
|
+
]
|
|
1107
1118
|
},
|
|
1108
1119
|
"aria-busy": {
|
|
1109
1120
|
"defaultValue": null,
|
|
@@ -1367,7 +1378,14 @@
|
|
|
1367
1378
|
"control": {
|
|
1368
1379
|
"type": "select"
|
|
1369
1380
|
},
|
|
1370
|
-
"options": [
|
|
1381
|
+
"options": [
|
|
1382
|
+
"link",
|
|
1383
|
+
"none",
|
|
1384
|
+
"copy",
|
|
1385
|
+
"execute",
|
|
1386
|
+
"move",
|
|
1387
|
+
"popup"
|
|
1388
|
+
]
|
|
1371
1389
|
},
|
|
1372
1390
|
"aria-errormessage": {
|
|
1373
1391
|
"defaultValue": null,
|
|
@@ -1644,7 +1662,11 @@
|
|
|
1644
1662
|
"control": {
|
|
1645
1663
|
"type": "radio"
|
|
1646
1664
|
},
|
|
1647
|
-
"options": [
|
|
1665
|
+
"options": [
|
|
1666
|
+
"off",
|
|
1667
|
+
"assertive",
|
|
1668
|
+
"polite"
|
|
1669
|
+
]
|
|
1648
1670
|
},
|
|
1649
1671
|
"aria-modal": {
|
|
1650
1672
|
"defaultValue": null,
|
|
@@ -1742,7 +1764,10 @@
|
|
|
1742
1764
|
"control": {
|
|
1743
1765
|
"type": "radio"
|
|
1744
1766
|
},
|
|
1745
|
-
"options": [
|
|
1767
|
+
"options": [
|
|
1768
|
+
"horizontal",
|
|
1769
|
+
"vertical"
|
|
1770
|
+
]
|
|
1746
1771
|
},
|
|
1747
1772
|
"aria-owns": {
|
|
1748
1773
|
"defaultValue": null,
|
|
@@ -2111,7 +2136,12 @@
|
|
|
2111
2136
|
"control": {
|
|
2112
2137
|
"type": "radio"
|
|
2113
2138
|
},
|
|
2114
|
-
"options": [
|
|
2139
|
+
"options": [
|
|
2140
|
+
"none",
|
|
2141
|
+
"ascending",
|
|
2142
|
+
"descending",
|
|
2143
|
+
"other"
|
|
2144
|
+
]
|
|
2115
2145
|
},
|
|
2116
2146
|
"aria-valuemax": {
|
|
2117
2147
|
"defaultValue": null,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bold.ws.d.ts","sourceRoot":"","sources":["../../src/components/bold.ws.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,QAAA,MAAM,IAAI,EAAE,eAAe,CAAC,OAAO,IAAI,CAQtC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const icons_1 = require("@webstudio-is/icons");
|
|
4
|
+
const bold_1 = require("./bold");
|
|
5
|
+
const meta = {
|
|
6
|
+
Icon: icons_1.FontBoldIcon,
|
|
7
|
+
Component: bold_1.Bold,
|
|
8
|
+
canAcceptChildren: false,
|
|
9
|
+
isContentEditable: false,
|
|
10
|
+
label: "Bold Text",
|
|
11
|
+
isInlineOnly: true,
|
|
12
|
+
isListed: false,
|
|
13
|
+
};
|
|
14
|
+
exports.default = meta;
|
package/lib/components/box.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
declare const defaultTag = "div";
|
|
3
|
+
declare type Props = ComponentProps<typeof defaultTag> & {
|
|
4
|
+
tag?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure";
|
|
5
|
+
};
|
|
6
|
+
export declare const Box: import("react").ForwardRefExoticComponent<Pick<Props, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "tag"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export {};
|
|
3
8
|
//# sourceMappingURL=box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/components/box.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/components/box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,QAAA,MAAM,UAAU,QAAQ,CAAC;AAGzB,aAAK,KAAK,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,GAAG;IAC/C,GAAG,CAAC,EACA,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,GACT,QAAQ,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,GAAG,8KAIf,CAAC"}
|
package/lib/components/box.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Box = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
4
|
const react_1 = require("react");
|
|
6
5
|
const defaultTag = "div";
|
|
7
|
-
exports.Box = (0, react_1.forwardRef)((
|
|
6
|
+
exports.Box = (0, react_1.forwardRef)(({ tag = defaultTag, ...props }, ref) => {
|
|
7
|
+
return (0, react_1.createElement)(tag, { ...props, ref });
|
|
8
|
+
});
|
|
8
9
|
exports.Box.displayName = "Box";
|
|
@@ -447,7 +447,10 @@
|
|
|
447
447
|
"control": {
|
|
448
448
|
"type": "radio"
|
|
449
449
|
},
|
|
450
|
-
"options": [
|
|
450
|
+
"options": [
|
|
451
|
+
"yes",
|
|
452
|
+
"no"
|
|
453
|
+
]
|
|
451
454
|
},
|
|
452
455
|
"radioGroup": {
|
|
453
456
|
"defaultValue": null,
|
|
@@ -940,7 +943,10 @@
|
|
|
940
943
|
"control": {
|
|
941
944
|
"type": "radio"
|
|
942
945
|
},
|
|
943
|
-
"options": [
|
|
946
|
+
"options": [
|
|
947
|
+
"on",
|
|
948
|
+
"off"
|
|
949
|
+
]
|
|
944
950
|
},
|
|
945
951
|
"inputMode": {
|
|
946
952
|
"defaultValue": null,
|
|
@@ -1103,7 +1109,12 @@
|
|
|
1103
1109
|
"control": {
|
|
1104
1110
|
"type": "radio"
|
|
1105
1111
|
},
|
|
1106
|
-
"options": [
|
|
1112
|
+
"options": [
|
|
1113
|
+
"list",
|
|
1114
|
+
"none",
|
|
1115
|
+
"inline",
|
|
1116
|
+
"both"
|
|
1117
|
+
]
|
|
1107
1118
|
},
|
|
1108
1119
|
"aria-busy": {
|
|
1109
1120
|
"defaultValue": null,
|
|
@@ -1367,7 +1378,14 @@
|
|
|
1367
1378
|
"control": {
|
|
1368
1379
|
"type": "select"
|
|
1369
1380
|
},
|
|
1370
|
-
"options": [
|
|
1381
|
+
"options": [
|
|
1382
|
+
"link",
|
|
1383
|
+
"none",
|
|
1384
|
+
"copy",
|
|
1385
|
+
"execute",
|
|
1386
|
+
"move",
|
|
1387
|
+
"popup"
|
|
1388
|
+
]
|
|
1371
1389
|
},
|
|
1372
1390
|
"aria-errormessage": {
|
|
1373
1391
|
"defaultValue": null,
|
|
@@ -1644,7 +1662,11 @@
|
|
|
1644
1662
|
"control": {
|
|
1645
1663
|
"type": "radio"
|
|
1646
1664
|
},
|
|
1647
|
-
"options": [
|
|
1665
|
+
"options": [
|
|
1666
|
+
"off",
|
|
1667
|
+
"assertive",
|
|
1668
|
+
"polite"
|
|
1669
|
+
]
|
|
1648
1670
|
},
|
|
1649
1671
|
"aria-modal": {
|
|
1650
1672
|
"defaultValue": null,
|
|
@@ -1742,7 +1764,10 @@
|
|
|
1742
1764
|
"control": {
|
|
1743
1765
|
"type": "radio"
|
|
1744
1766
|
},
|
|
1745
|
-
"options": [
|
|
1767
|
+
"options": [
|
|
1768
|
+
"horizontal",
|
|
1769
|
+
"vertical"
|
|
1770
|
+
]
|
|
1746
1771
|
},
|
|
1747
1772
|
"aria-owns": {
|
|
1748
1773
|
"defaultValue": null,
|
|
@@ -2111,7 +2136,12 @@
|
|
|
2111
2136
|
"control": {
|
|
2112
2137
|
"type": "radio"
|
|
2113
2138
|
},
|
|
2114
|
-
"options": [
|
|
2139
|
+
"options": [
|
|
2140
|
+
"none",
|
|
2141
|
+
"ascending",
|
|
2142
|
+
"descending",
|
|
2143
|
+
"other"
|
|
2144
|
+
]
|
|
2115
2145
|
},
|
|
2116
2146
|
"aria-valuemax": {
|
|
2117
2147
|
"defaultValue": null,
|
|
@@ -2200,5 +2230,70 @@
|
|
|
2200
2230
|
"control": {
|
|
2201
2231
|
"type": "text"
|
|
2202
2232
|
}
|
|
2233
|
+
},
|
|
2234
|
+
"tag": {
|
|
2235
|
+
"defaultValue": {
|
|
2236
|
+
"value": "div"
|
|
2237
|
+
},
|
|
2238
|
+
"description": "",
|
|
2239
|
+
"name": "tag",
|
|
2240
|
+
"declarations": [
|
|
2241
|
+
{
|
|
2242
|
+
"fileName": "src/components/box.tsx",
|
|
2243
|
+
"name": "TypeLiteral"
|
|
2244
|
+
}
|
|
2245
|
+
],
|
|
2246
|
+
"required": false,
|
|
2247
|
+
"type": {
|
|
2248
|
+
"name": "enum",
|
|
2249
|
+
"raw": "\"div\" | \"address\" | \"article\" | \"aside\" | \"figure\" | \"footer\" | \"header\" | \"main\" | \"nav\" | \"section\"",
|
|
2250
|
+
"value": [
|
|
2251
|
+
{
|
|
2252
|
+
"value": "\"div\""
|
|
2253
|
+
},
|
|
2254
|
+
{
|
|
2255
|
+
"value": "\"address\""
|
|
2256
|
+
},
|
|
2257
|
+
{
|
|
2258
|
+
"value": "\"article\""
|
|
2259
|
+
},
|
|
2260
|
+
{
|
|
2261
|
+
"value": "\"aside\""
|
|
2262
|
+
},
|
|
2263
|
+
{
|
|
2264
|
+
"value": "\"figure\""
|
|
2265
|
+
},
|
|
2266
|
+
{
|
|
2267
|
+
"value": "\"footer\""
|
|
2268
|
+
},
|
|
2269
|
+
{
|
|
2270
|
+
"value": "\"header\""
|
|
2271
|
+
},
|
|
2272
|
+
{
|
|
2273
|
+
"value": "\"main\""
|
|
2274
|
+
},
|
|
2275
|
+
{
|
|
2276
|
+
"value": "\"nav\""
|
|
2277
|
+
},
|
|
2278
|
+
{
|
|
2279
|
+
"value": "\"section\""
|
|
2280
|
+
}
|
|
2281
|
+
]
|
|
2282
|
+
},
|
|
2283
|
+
"control": {
|
|
2284
|
+
"type": "select"
|
|
2285
|
+
},
|
|
2286
|
+
"options": [
|
|
2287
|
+
"div",
|
|
2288
|
+
"address",
|
|
2289
|
+
"article",
|
|
2290
|
+
"aside",
|
|
2291
|
+
"figure",
|
|
2292
|
+
"footer",
|
|
2293
|
+
"header",
|
|
2294
|
+
"main",
|
|
2295
|
+
"nav",
|
|
2296
|
+
"section"
|
|
2297
|
+
]
|
|
2203
2298
|
}
|
|
2204
2299
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Pick<React.
|
|
3
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Pick<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
tag?: "address" | "article" | "aside" | "div" | "figure" | "footer" | "header" | "main" | "nav" | "section" | undefined;
|
|
5
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "tag"> & React.RefAttributes<HTMLDivElement>>>;
|
|
4
6
|
export default _default;
|
|
5
|
-
export declare const Box: ComponentStory<React.ForwardRefExoticComponent<Pick<React.
|
|
7
|
+
export declare const Box: ComponentStory<React.ForwardRefExoticComponent<Pick<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
tag?: "address" | "article" | "aside" | "div" | "figure" | "footer" | "header" | "main" | "nav" | "section" | undefined;
|
|
9
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "tag"> & React.RefAttributes<HTMLDivElement>>>;
|
|
6
10
|
//# sourceMappingURL=box.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.stories.d.ts","sourceRoot":"","sources":["../../src/components/box.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC
|
|
1
|
+
{"version":3,"file":"box.stories.d.ts","sourceRoot":"","sources":["../../src/components/box.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;;;;AAItE,wBAIwC;AASxC,eAAO,MAAM,GAAG;;sGAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box.ws.d.ts","sourceRoot":"","sources":["../../src/components/box.ws.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAS5B,QAAA,MAAM,IAAI,EAAE,eAAe,CAAC,OAAO,GAAG,CASrC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const icons_1 = require("@webstudio-is/icons");
|
|
4
|
+
const box_1 = require("./box");
|
|
5
|
+
const defaultStyle = {
|
|
6
|
+
boxSizing: {
|
|
7
|
+
type: "keyword",
|
|
8
|
+
value: "border-box",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
const meta = {
|
|
12
|
+
Icon: icons_1.SquareIcon,
|
|
13
|
+
Component: box_1.Box,
|
|
14
|
+
defaultStyle,
|
|
15
|
+
canAcceptChildren: true,
|
|
16
|
+
isContentEditable: false,
|
|
17
|
+
isInlineOnly: false,
|
|
18
|
+
isListed: true,
|
|
19
|
+
label: "Box",
|
|
20
|
+
};
|
|
21
|
+
exports.default = meta;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
declare const defaultTag = "button";
|
|
3
|
-
export declare type ButtonProps = ComponentProps<typeof defaultTag>;
|
|
1
|
+
import React from "react";
|
|
4
2
|
export declare const Button: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
export {};
|
|
6
3
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAMhF,eAAO,MAAM,MAAM,wOAElB,CAAC"}
|
|
@@ -298,7 +298,11 @@
|
|
|
298
298
|
"control": {
|
|
299
299
|
"type": "radio"
|
|
300
300
|
},
|
|
301
|
-
"options": [
|
|
301
|
+
"options": [
|
|
302
|
+
"button",
|
|
303
|
+
"submit",
|
|
304
|
+
"reset"
|
|
305
|
+
]
|
|
302
306
|
},
|
|
303
307
|
"value": {
|
|
304
308
|
"defaultValue": null,
|
|
@@ -704,7 +708,10 @@
|
|
|
704
708
|
"control": {
|
|
705
709
|
"type": "radio"
|
|
706
710
|
},
|
|
707
|
-
"options": [
|
|
711
|
+
"options": [
|
|
712
|
+
"yes",
|
|
713
|
+
"no"
|
|
714
|
+
]
|
|
708
715
|
},
|
|
709
716
|
"radioGroup": {
|
|
710
717
|
"defaultValue": null,
|
|
@@ -1197,7 +1204,10 @@
|
|
|
1197
1204
|
"control": {
|
|
1198
1205
|
"type": "radio"
|
|
1199
1206
|
},
|
|
1200
|
-
"options": [
|
|
1207
|
+
"options": [
|
|
1208
|
+
"on",
|
|
1209
|
+
"off"
|
|
1210
|
+
]
|
|
1201
1211
|
},
|
|
1202
1212
|
"inputMode": {
|
|
1203
1213
|
"defaultValue": null,
|
|
@@ -1360,7 +1370,12 @@
|
|
|
1360
1370
|
"control": {
|
|
1361
1371
|
"type": "radio"
|
|
1362
1372
|
},
|
|
1363
|
-
"options": [
|
|
1373
|
+
"options": [
|
|
1374
|
+
"list",
|
|
1375
|
+
"none",
|
|
1376
|
+
"inline",
|
|
1377
|
+
"both"
|
|
1378
|
+
]
|
|
1364
1379
|
},
|
|
1365
1380
|
"aria-busy": {
|
|
1366
1381
|
"defaultValue": null,
|
|
@@ -1624,7 +1639,14 @@
|
|
|
1624
1639
|
"control": {
|
|
1625
1640
|
"type": "select"
|
|
1626
1641
|
},
|
|
1627
|
-
"options": [
|
|
1642
|
+
"options": [
|
|
1643
|
+
"link",
|
|
1644
|
+
"none",
|
|
1645
|
+
"copy",
|
|
1646
|
+
"execute",
|
|
1647
|
+
"move",
|
|
1648
|
+
"popup"
|
|
1649
|
+
]
|
|
1628
1650
|
},
|
|
1629
1651
|
"aria-errormessage": {
|
|
1630
1652
|
"defaultValue": null,
|
|
@@ -1901,7 +1923,11 @@
|
|
|
1901
1923
|
"control": {
|
|
1902
1924
|
"type": "radio"
|
|
1903
1925
|
},
|
|
1904
|
-
"options": [
|
|
1926
|
+
"options": [
|
|
1927
|
+
"off",
|
|
1928
|
+
"assertive",
|
|
1929
|
+
"polite"
|
|
1930
|
+
]
|
|
1905
1931
|
},
|
|
1906
1932
|
"aria-modal": {
|
|
1907
1933
|
"defaultValue": null,
|
|
@@ -1999,7 +2025,10 @@
|
|
|
1999
2025
|
"control": {
|
|
2000
2026
|
"type": "radio"
|
|
2001
2027
|
},
|
|
2002
|
-
"options": [
|
|
2028
|
+
"options": [
|
|
2029
|
+
"horizontal",
|
|
2030
|
+
"vertical"
|
|
2031
|
+
]
|
|
2003
2032
|
},
|
|
2004
2033
|
"aria-owns": {
|
|
2005
2034
|
"defaultValue": null,
|
|
@@ -2368,7 +2397,12 @@
|
|
|
2368
2397
|
"control": {
|
|
2369
2398
|
"type": "radio"
|
|
2370
2399
|
},
|
|
2371
|
-
"options": [
|
|
2400
|
+
"options": [
|
|
2401
|
+
"none",
|
|
2402
|
+
"ascending",
|
|
2403
|
+
"descending",
|
|
2404
|
+
"other"
|
|
2405
|
+
]
|
|
2372
2406
|
},
|
|
2373
2407
|
"aria-valuemax": {
|
|
2374
2408
|
"defaultValue": null,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.ws.d.ts","sourceRoot":"","sources":["../../src/components/button.ws.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,IAAI,EAAE,eAAe,CAAC,OAAO,MAAM,CASxC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const icons_1 = require("@webstudio-is/icons");
|
|
4
|
+
const button_1 = require("./button");
|
|
5
|
+
const meta = {
|
|
6
|
+
Icon: icons_1.ButtonIcon,
|
|
7
|
+
Component: button_1.Button,
|
|
8
|
+
canAcceptChildren: false,
|
|
9
|
+
isContentEditable: true,
|
|
10
|
+
isInlineOnly: false,
|
|
11
|
+
isListed: true,
|
|
12
|
+
label: "Button",
|
|
13
|
+
children: ["Button text you can edit"],
|
|
14
|
+
};
|
|
15
|
+
exports.default = meta;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Style } from "../css";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { IconProps } from "@webstudio-is/icons";
|
|
5
|
+
export declare type WsComponentMeta<ComponentType> = {
|
|
6
|
+
Component: ComponentType;
|
|
7
|
+
Icon: React.FunctionComponent<IconProps>;
|
|
8
|
+
defaultStyle?: Style;
|
|
9
|
+
canAcceptChildren: boolean;
|
|
10
|
+
isContentEditable: boolean;
|
|
11
|
+
isInlineOnly: boolean;
|
|
12
|
+
isListed: boolean;
|
|
13
|
+
label: string;
|
|
14
|
+
children?: Array<string>;
|
|
15
|
+
};
|
|
16
|
+
export declare const WsComponentMetaSchema: z.ZodType<WsComponentMeta<unknown>, z.ZodTypeDef, WsComponentMeta<unknown>>;
|
|
17
|
+
//# sourceMappingURL=component-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-type.d.ts","sourceRoot":"","sources":["../../src/components/component-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,oBAAY,eAAe,CAAC,aAAa,IAAI;IAC3C,SAAS,EAAE,aAAa,CAAC;IACzB,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAG3B,iBAAiB,EAAE,OAAO,CAAC;IAE3B,YAAY,EAAE,OAAO,CAAC;IAEtB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,6EAoCM,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WsComponentMetaSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.WsComponentMetaSchema = zod_1.z.lazy(() => zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
Component: zod_1.z.any(),
|
|
8
|
+
Icon: zod_1.z.any(),
|
|
9
|
+
defaultStyle: zod_1.z.optional(zod_1.z.any()),
|
|
10
|
+
canAcceptChildren: zod_1.z.boolean(),
|
|
11
|
+
isContentEditable: zod_1.z.boolean(),
|
|
12
|
+
isInlineOnly: zod_1.z.boolean(),
|
|
13
|
+
isListed: zod_1.z.boolean(),
|
|
14
|
+
label: zod_1.z.string(),
|
|
15
|
+
children: zod_1.z.optional(zod_1.z.array(zod_1.z.string())),
|
|
16
|
+
})
|
|
17
|
+
// We need these restrictions because of the limitation of the current drag&drop implementation.
|
|
18
|
+
// Its position detection logic will be confused if drop target has `string` children.
|
|
19
|
+
.refine((val) => val.isContentEditable === false || val.canAcceptChildren === false, {
|
|
20
|
+
message: "Content editable componetns are not allowed to accept children via drag&drop, because they may have `string` children",
|
|
21
|
+
path: ["canAcceptChildren"],
|
|
22
|
+
})
|
|
23
|
+
.refine((val) => val.canAcceptChildren === false ||
|
|
24
|
+
val.children === undefined ||
|
|
25
|
+
val.children.every((child) => typeof child !== "string"), {
|
|
26
|
+
message: "Components that can accept children via drag&drop are not allowed to have `string` children",
|
|
27
|
+
path: ["children"],
|
|
28
|
+
}));
|