@webstudio-is/sdk-components-react 0.0.0-021f2d4
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/LICENSE +661 -0
- package/README.md +3 -0
- package/lib/__generated__/blockquote.props.js +514 -0
- package/lib/__generated__/body.props.js +508 -0
- package/lib/__generated__/bold.props.js +508 -0
- package/lib/__generated__/box.props.js +527 -0
- package/lib/__generated__/button.props.js +570 -0
- package/lib/__generated__/checkbox.props.js +672 -0
- package/lib/__generated__/code-text.props.js +509 -0
- package/lib/__generated__/form.props.js +556 -0
- package/lib/__generated__/head-link.props.js +620 -0
- package/lib/__generated__/head-meta.props.js +532 -0
- package/lib/__generated__/head-title.props.js +508 -0
- package/lib/__generated__/head.props.js +508 -0
- package/lib/__generated__/heading.props.js +516 -0
- package/lib/__generated__/html-embed.props.js +13 -0
- package/lib/__generated__/image.props.js +593 -0
- package/lib/__generated__/input.props.js +696 -0
- package/lib/__generated__/italic.props.js +508 -0
- package/lib/__generated__/label.props.js +520 -0
- package/lib/__generated__/link.props.js +578 -0
- package/lib/__generated__/list-item.props.js +514 -0
- package/lib/__generated__/list.props.js +534 -0
- package/lib/__generated__/markdown-embed.props.js +7 -0
- package/lib/__generated__/option.props.js +532 -0
- package/lib/__generated__/paragraph.props.js +508 -0
- package/lib/__generated__/radio-button.props.js +672 -0
- package/lib/__generated__/select.props.js +556 -0
- package/lib/__generated__/separator.props.js +508 -0
- package/lib/__generated__/span.props.js +508 -0
- package/lib/__generated__/subscript.props.js +508 -0
- package/lib/__generated__/superscript.props.js +508 -0
- package/lib/__generated__/text.props.js +516 -0
- package/lib/__generated__/textarea.props.js +587 -0
- package/lib/__generated__/time.props.js +312 -0
- package/lib/__generated__/vimeo-play-button.props.js +569 -0
- package/lib/__generated__/vimeo-preview-image.props.js +591 -0
- package/lib/__generated__/vimeo-spinner.props.js +508 -0
- package/lib/__generated__/vimeo.props.js +673 -0
- package/lib/__generated__/webhook-form.props.js +569 -0
- package/lib/__generated__/xml-node.props.js +21 -0
- package/lib/__generated__/xml-time.props.js +18 -0
- package/lib/__generated__/youtube.props.js +665 -0
- package/lib/blockquote.js +9 -0
- package/lib/blockquote.template.js +11 -0
- package/lib/blockquote.ws.js +63 -0
- package/lib/body.js +7 -0
- package/lib/body.ws.js +29 -0
- package/lib/bold.js +7 -0
- package/lib/bold.ws.js +20 -0
- package/lib/box.js +9 -0
- package/lib/box.ws.js +31 -0
- package/lib/button.js +9 -0
- package/lib/button.template.js +11 -0
- package/lib/button.ws.js +27 -0
- package/lib/checkbox.js +15 -0
- package/lib/checkbox.template.js +14 -0
- package/lib/checkbox.ws.js +38 -0
- package/lib/code-text.js +10 -0
- package/lib/code-text.ws.js +59 -0
- package/lib/components.js +89 -0
- package/lib/content-embed.template.js +83 -0
- package/lib/form.js +7 -0
- package/lib/form.ws.js +30 -0
- package/lib/fragment.js +7 -0
- package/lib/fragment.ws.js +10 -0
- package/lib/head-link.js +23 -0
- package/lib/head-link.ws.js +19 -0
- package/lib/head-meta.js +23 -0
- package/lib/head-meta.ws.js +19 -0
- package/lib/head-slot.js +54 -0
- package/lib/head-slot.template.js +15 -0
- package/lib/head-slot.ws.js +25 -0
- package/lib/head-title.js +23 -0
- package/lib/head-title.ws.js +18 -0
- package/lib/heading.js +9 -0
- package/lib/heading.template.js +11 -0
- package/lib/heading.ws.js +28 -0
- package/lib/home_wsKvRSqvkajPPBeycZ-C8.svg +3 -0
- package/lib/hooks.js +6 -0
- package/lib/html-embed-patchers.js +29 -0
- package/lib/html-embed.js +112 -0
- package/lib/html-embed.ws.js +46 -0
- package/lib/image.js +38 -0
- package/lib/image.ws.js +60 -0
- package/lib/input.js +17 -0
- package/lib/input.ws.js +54 -0
- package/lib/italic.js +7 -0
- package/lib/italic.ws.js +26 -0
- package/lib/label.js +7 -0
- package/lib/label.template.js +10 -0
- package/lib/label.ws.js +27 -0
- package/lib/link.js +15 -0
- package/lib/link.template.js +11 -0
- package/lib/link.ws.js +47 -0
- package/lib/list-item.js +9 -0
- package/lib/list-item.template.js +11 -0
- package/lib/list-item.ws.js +26 -0
- package/lib/list.js +6 -0
- package/lib/list.template.js +15 -0
- package/lib/list.ws.js +48 -0
- package/lib/markdown-embed.js +19 -0
- package/lib/markdown-embed.template.js +75 -0
- package/lib/markdown-embed.ws.js +33 -0
- package/lib/metas.js +90 -0
- package/lib/option.js +7 -0
- package/lib/option.ws.js +44 -0
- package/lib/paragraph.js +7 -0
- package/lib/paragraph.template.js +11 -0
- package/lib/paragraph.ws.js +23 -0
- package/lib/props.js +90 -0
- package/lib/radio-button.js +15 -0
- package/lib/radio-button.template.js +14 -0
- package/lib/radio-button.ws.js +40 -0
- package/lib/rich-text-link.ws.js +9 -0
- package/lib/select.js +19 -0
- package/lib/select.template.js +16 -0
- package/lib/select.ws.js +44 -0
- package/lib/separator.js +9 -0
- package/lib/separator.ws.js +48 -0
- package/lib/slot.js +14 -0
- package/lib/slot.ws.js +14 -0
- package/lib/span.js +7 -0
- package/lib/span.ws.js +20 -0
- package/lib/subscript.js +7 -0
- package/lib/subscript.ws.js +20 -0
- package/lib/superscript.js +7 -0
- package/lib/superscript.ws.js +20 -0
- package/lib/templates.js +38 -0
- package/lib/text.js +10 -0
- package/lib/text.template.js +11 -0
- package/lib/text.ws.js +25 -0
- package/lib/textarea.js +7 -0
- package/lib/textarea.ws.js +55 -0
- package/lib/time.js +319 -0
- package/lib/time.ws.js +21 -0
- package/lib/types/__generated__/blockquote.props.d.ts +2 -0
- package/lib/types/__generated__/body.props.d.ts +2 -0
- package/lib/types/__generated__/bold.props.d.ts +2 -0
- package/lib/types/__generated__/box.props.d.ts +2 -0
- package/lib/types/__generated__/button.props.d.ts +2 -0
- package/lib/types/__generated__/checkbox.props.d.ts +2 -0
- package/lib/types/__generated__/code-text.props.d.ts +2 -0
- package/lib/types/__generated__/form.props.d.ts +2 -0
- package/lib/types/__generated__/fragment.props.d.ts +2 -0
- package/lib/types/__generated__/head-link.props.d.ts +2 -0
- package/lib/types/__generated__/head-meta.props.d.ts +2 -0
- package/lib/types/__generated__/head-slot.props.d.ts +2 -0
- package/lib/types/__generated__/head-title.props.d.ts +2 -0
- package/lib/types/__generated__/head.props.d.ts +2 -0
- package/lib/types/__generated__/heading.props.d.ts +2 -0
- package/lib/types/__generated__/html-embed.props.d.ts +2 -0
- package/lib/types/__generated__/image.props.d.ts +2 -0
- package/lib/types/__generated__/input.props.d.ts +2 -0
- package/lib/types/__generated__/italic.props.d.ts +2 -0
- package/lib/types/__generated__/label.props.d.ts +2 -0
- package/lib/types/__generated__/link.props.d.ts +2 -0
- package/lib/types/__generated__/list-item.props.d.ts +2 -0
- package/lib/types/__generated__/list.props.d.ts +2 -0
- package/lib/types/__generated__/markdown-embed.props.d.ts +2 -0
- package/lib/types/__generated__/option.props.d.ts +2 -0
- package/lib/types/__generated__/paragraph.props.d.ts +2 -0
- package/lib/types/__generated__/radio-button.props.d.ts +2 -0
- package/lib/types/__generated__/rich-text-link.props.d.ts +2 -0
- package/lib/types/__generated__/select.props.d.ts +2 -0
- package/lib/types/__generated__/separator.props.d.ts +2 -0
- package/lib/types/__generated__/slot.props.d.ts +2 -0
- package/lib/types/__generated__/span.props.d.ts +2 -0
- package/lib/types/__generated__/subscript.props.d.ts +2 -0
- package/lib/types/__generated__/superscript.props.d.ts +2 -0
- package/lib/types/__generated__/text.props.d.ts +2 -0
- package/lib/types/__generated__/textarea.props.d.ts +2 -0
- package/lib/types/__generated__/time.props.d.ts +2 -0
- package/lib/types/__generated__/vimeo-play-button.props.d.ts +2 -0
- package/lib/types/__generated__/vimeo-preview-image.props.d.ts +2 -0
- package/lib/types/__generated__/vimeo-spinner.props.d.ts +2 -0
- package/lib/types/__generated__/vimeo.props.d.ts +2 -0
- package/lib/types/__generated__/webhook-form.props.d.ts +2 -0
- package/lib/types/__generated__/xml-node.props.d.ts +2 -0
- package/lib/types/__generated__/xml-time.props.d.ts +2 -0
- package/lib/types/__generated__/youtube.props.d.ts +2 -0
- package/lib/types/blockquote.d.ts +2 -0
- package/lib/types/blockquote.template.d.ts +2 -0
- package/lib/types/blockquote.ws.d.ts +3 -0
- package/lib/types/body.d.ts +2 -0
- package/lib/types/body.ws.d.ts +3 -0
- package/lib/types/bold.d.ts +2 -0
- package/lib/types/bold.ws.d.ts +3 -0
- package/lib/types/box.d.ts +8 -0
- package/lib/types/box.ws.d.ts +3 -0
- package/lib/types/button.d.ts +2 -0
- package/lib/types/button.template.d.ts +2 -0
- package/lib/types/button.ws.d.ts +3 -0
- package/lib/types/checkbox.d.ts +4 -0
- package/lib/types/checkbox.template.d.ts +2 -0
- package/lib/types/checkbox.ws.d.ts +3 -0
- package/lib/types/code-text.d.ts +4 -0
- package/lib/types/code-text.ws.d.ts +3 -0
- package/lib/types/components.d.ts +44 -0
- package/lib/types/content-embed.template.d.ts +2 -0
- package/lib/types/form.d.ts +2 -0
- package/lib/types/form.ws.d.ts +3 -0
- package/lib/types/fragment.d.ts +6 -0
- package/lib/types/fragment.ws.d.ts +3 -0
- package/lib/types/head-link.d.ts +8 -0
- package/lib/types/head-link.ws.d.ts +3 -0
- package/lib/types/head-meta.d.ts +2 -0
- package/lib/types/head-meta.ws.d.ts +3 -0
- package/lib/types/head-slot.d.ts +9 -0
- package/lib/types/head-slot.template.d.ts +2 -0
- package/lib/types/head-slot.ws.d.ts +3 -0
- package/lib/types/head-title.d.ts +2 -0
- package/lib/types/head-title.ws.d.ts +3 -0
- package/lib/types/heading.d.ts +8 -0
- package/lib/types/heading.template.d.ts +2 -0
- package/lib/types/heading.ws.d.ts +3 -0
- package/lib/types/hooks.d.ts +2 -0
- package/lib/types/html-embed-patchers.d.ts +2 -0
- package/lib/types/html-embed.d.ts +12 -0
- package/lib/types/html-embed.test.d.ts +1 -0
- package/lib/types/html-embed.ws.d.ts +3 -0
- package/lib/types/image.d.ts +8 -0
- package/lib/types/image.ws.d.ts +3 -0
- package/lib/types/input.d.ts +4 -0
- package/lib/types/input.ws.d.ts +3 -0
- package/lib/types/italic.d.ts +2 -0
- package/lib/types/italic.ws.d.ts +3 -0
- package/lib/types/label.d.ts +2 -0
- package/lib/types/label.template.d.ts +2 -0
- package/lib/types/label.ws.d.ts +3 -0
- package/lib/types/link.d.ts +11 -0
- package/lib/types/link.template.d.ts +2 -0
- package/lib/types/link.ws.d.ts +3 -0
- package/lib/types/list-item.d.ts +2 -0
- package/lib/types/list-item.template.d.ts +2 -0
- package/lib/types/list-item.ws.d.ts +3 -0
- package/lib/types/list.d.ts +10 -0
- package/lib/types/list.template.d.ts +2 -0
- package/lib/types/list.ws.d.ts +3 -0
- package/lib/types/markdown-embed.d.ts +7 -0
- package/lib/types/markdown-embed.template.d.ts +2 -0
- package/lib/types/markdown-embed.ws.d.ts +3 -0
- package/lib/types/metas.d.ts +44 -0
- package/lib/types/option.d.ts +2 -0
- package/lib/types/option.ws.d.ts +3 -0
- package/lib/types/paragraph.d.ts +2 -0
- package/lib/types/paragraph.template.d.ts +2 -0
- package/lib/types/paragraph.ws.d.ts +3 -0
- package/lib/types/props.d.ts +44 -0
- package/lib/types/radio-button.d.ts +4 -0
- package/lib/types/radio-button.template.d.ts +2 -0
- package/lib/types/radio-button.ws.d.ts +3 -0
- package/lib/types/rich-text-link.d.ts +1 -0
- package/lib/types/rich-text-link.ws.d.ts +3 -0
- package/lib/types/select.d.ts +4 -0
- package/lib/types/select.template.d.ts +2 -0
- package/lib/types/select.ws.d.ts +3 -0
- package/lib/types/separator.d.ts +2 -0
- package/lib/types/separator.ws.d.ts +3 -0
- package/lib/types/slot.d.ts +6 -0
- package/lib/types/slot.ws.d.ts +3 -0
- package/lib/types/span.d.ts +2 -0
- package/lib/types/span.ws.d.ts +3 -0
- package/lib/types/subscript.d.ts +2 -0
- package/lib/types/subscript.ws.d.ts +3 -0
- package/lib/types/superscript.d.ts +2 -0
- package/lib/types/superscript.ws.d.ts +3 -0
- package/lib/types/templates.d.ts +18 -0
- package/lib/types/test-utils/cartesian.d.ts +2 -0
- package/lib/types/text.d.ts +8 -0
- package/lib/types/text.template.d.ts +2 -0
- package/lib/types/text.ws.d.ts +3 -0
- package/lib/types/textarea.d.ts +2 -0
- package/lib/types/textarea.ws.d.ts +3 -0
- package/lib/types/time.d.ts +18 -0
- package/lib/types/time.test.d.ts +1 -0
- package/lib/types/time.ws.d.ts +3 -0
- package/lib/types/vimeo-play-button.d.ts +3 -0
- package/lib/types/vimeo-play-button.ws.d.ts +3 -0
- package/lib/types/vimeo-preview-image.d.ts +284 -0
- package/lib/types/vimeo-preview-image.ws.d.ts +3 -0
- package/lib/types/vimeo-spinner.d.ts +1 -0
- package/lib/types/vimeo-spinner.ws.d.ts +3 -0
- package/lib/types/vimeo.d.ts +85 -0
- package/lib/types/vimeo.template.d.ts +2 -0
- package/lib/types/vimeo.ws.d.ts +3 -0
- package/lib/types/webhook-form.d.ts +9 -0
- package/lib/types/webhook-form.template.d.ts +2 -0
- package/lib/types/webhook-form.ws.d.ts +3 -0
- package/lib/types/xml-node.d.ts +13 -0
- package/lib/types/xml-node.ws.d.ts +3 -0
- package/lib/types/xml-time.d.ts +6 -0
- package/lib/types/xml-time.ws.d.ts +3 -0
- package/lib/types/youtube.d.ts +143 -0
- package/lib/types/youtube.template.d.ts +2 -0
- package/lib/types/youtube.ws.d.ts +3 -0
- package/lib/vimeo-play-button.js +18 -0
- package/lib/vimeo-play-button.ws.js +31 -0
- package/lib/vimeo-preview-image.js +19 -0
- package/lib/vimeo-preview-image.ws.js +27 -0
- package/lib/vimeo-spinner.js +13 -0
- package/lib/vimeo-spinner.ws.js +25 -0
- package/lib/vimeo.js +216 -0
- package/lib/vimeo.template.js +93 -0
- package/lib/vimeo.ws.js +40 -0
- package/lib/webhook-form.js +9 -0
- package/lib/webhook-form.template.js +49 -0
- package/lib/webhook-form.ws.js +26 -0
- package/lib/xml-node.js +60 -0
- package/lib/xml-node.ws.js +16 -0
- package/lib/xml-time.js +25 -0
- package/lib/xml-time.ws.js +16 -0
- package/lib/youtube.js +206 -0
- package/lib/youtube.template.js +97 -0
- package/lib/youtube.ws.js +51 -0
- package/package.json +77 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RadioCheckedIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
3
|
+
import { radio as o } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as r } from "./__generated__/radio-button.props.js";
|
|
5
|
+
const i = {
|
|
6
|
+
input: [
|
|
7
|
+
...o,
|
|
8
|
+
{
|
|
9
|
+
property: "marginRight",
|
|
10
|
+
value: { type: "unit", unit: "em", value: 0.5 }
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}, p = {
|
|
14
|
+
constraints: {
|
|
15
|
+
relation: "ancestor",
|
|
16
|
+
component: { $nin: ["Button", "Link"] }
|
|
17
|
+
},
|
|
18
|
+
type: "control",
|
|
19
|
+
label: "Radio",
|
|
20
|
+
icon: e,
|
|
21
|
+
presetStyle: i,
|
|
22
|
+
states: [
|
|
23
|
+
...t,
|
|
24
|
+
{ selector: ":checked", label: "Checked" },
|
|
25
|
+
{ selector: ":required", label: "Required" },
|
|
26
|
+
{ selector: ":optional", label: "Optional" }
|
|
27
|
+
// Additional states will go into submenu
|
|
28
|
+
//{ selector: ":disabled", label: "Disabled" },
|
|
29
|
+
//{ selector: ":enabled", label: "Enabled" },
|
|
30
|
+
//{ selector: ":read-only", label: "Read Only" },
|
|
31
|
+
//{ selector: ":read-write", label: "Read Write" },
|
|
32
|
+
]
|
|
33
|
+
}, s = {
|
|
34
|
+
props: r,
|
|
35
|
+
initialProps: ["id", "className", "name", "value", "required", "checked"]
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
p as meta,
|
|
39
|
+
s as propsMeta
|
|
40
|
+
};
|
package/lib/select.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import "@webstudio-is/react-sdk/runtime";
|
|
3
|
+
import { forwardRef as r } from "react";
|
|
4
|
+
const s = r(({ value: o, defaultValue: t, ...e }, n) => /* @__PURE__ */ c("select", { ...e, defaultValue: o ?? t, ref: n }));
|
|
5
|
+
s.displayName = "Select";
|
|
6
|
+
const l = {
|
|
7
|
+
onNavigatorUnselect: (o, t) => {
|
|
8
|
+
for (const e of t.instancePath)
|
|
9
|
+
e.component === "Option" && o.setMemoryProp(e, "selected", void 0);
|
|
10
|
+
},
|
|
11
|
+
onNavigatorSelect: (o, t) => {
|
|
12
|
+
for (const e of t.instancePath)
|
|
13
|
+
e.component === "Option" && o.setMemoryProp(e, "selected", !0);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
s as Select,
|
|
18
|
+
l as hooksSelect
|
|
19
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { $ as e } from "@webstudio-is/template";
|
|
3
|
+
const n = {
|
|
4
|
+
category: "forms",
|
|
5
|
+
description: "A drop-down menu for users to select a single option from a predefined list.",
|
|
6
|
+
order: 4,
|
|
7
|
+
template: /* @__PURE__ */ t(e.Select, { children: [
|
|
8
|
+
/* @__PURE__ */ o(e.Option, { label: "Please choose an option", value: "" }),
|
|
9
|
+
/* @__PURE__ */ o(e.Option, { label: "Option A", value: "a" }),
|
|
10
|
+
/* @__PURE__ */ o(e.Option, { label: "Option B", value: "b" }),
|
|
11
|
+
/* @__PURE__ */ o(e.Option, { label: "Option C", value: "c" })
|
|
12
|
+
] })
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
n as meta
|
|
16
|
+
};
|
package/lib/select.ws.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SelectIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
3
|
+
import { select as l } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as o } from "./__generated__/select.props.js";
|
|
5
|
+
const r = {
|
|
6
|
+
select: [
|
|
7
|
+
...l,
|
|
8
|
+
{
|
|
9
|
+
property: "display",
|
|
10
|
+
value: { type: "keyword", value: "block" }
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}, c = {
|
|
14
|
+
constraints: {
|
|
15
|
+
relation: "ancestor",
|
|
16
|
+
component: { $nin: ["Button", "Link"] }
|
|
17
|
+
},
|
|
18
|
+
type: "container",
|
|
19
|
+
icon: e,
|
|
20
|
+
presetStyle: r,
|
|
21
|
+
states: [
|
|
22
|
+
...t,
|
|
23
|
+
{ selector: "::placeholder", label: "Placeholder" },
|
|
24
|
+
{ selector: ":valid", label: "Valid" },
|
|
25
|
+
{ selector: ":invalid", label: "Invalid" },
|
|
26
|
+
{ selector: ":required", label: "Required" },
|
|
27
|
+
{ selector: ":optional", label: "Optional" }
|
|
28
|
+
]
|
|
29
|
+
}, p = {
|
|
30
|
+
props: o,
|
|
31
|
+
initialProps: [
|
|
32
|
+
"id",
|
|
33
|
+
"className",
|
|
34
|
+
"name",
|
|
35
|
+
"value",
|
|
36
|
+
"multiple",
|
|
37
|
+
"required",
|
|
38
|
+
"autoFocus"
|
|
39
|
+
]
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
c as meta,
|
|
43
|
+
p as propsMeta
|
|
44
|
+
};
|
package/lib/separator.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { MinusIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as o } from "@webstudio-is/sdk";
|
|
3
|
+
import { hr as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as t } from "./__generated__/separator.props.js";
|
|
5
|
+
const p = {
|
|
6
|
+
hr: [
|
|
7
|
+
...r,
|
|
8
|
+
{
|
|
9
|
+
property: "height",
|
|
10
|
+
value: { type: "keyword", value: "1px" }
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
property: "backgroundColor",
|
|
14
|
+
value: { type: "keyword", value: "gray" }
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
property: "borderTopStyle",
|
|
18
|
+
value: { type: "keyword", value: "none" }
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
property: "borderRightStyle",
|
|
22
|
+
value: { type: "keyword", value: "none" }
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
property: "borderLeftStyle",
|
|
26
|
+
value: { type: "keyword", value: "none" }
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
property: "borderBottomStyle",
|
|
30
|
+
value: { type: "keyword", value: "none" }
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}, n = {
|
|
34
|
+
category: "general",
|
|
35
|
+
type: "embed",
|
|
36
|
+
description: "Used to visually divide sections of content, helping to improve readability and organization within a webpage.",
|
|
37
|
+
icon: e,
|
|
38
|
+
states: o,
|
|
39
|
+
presetStyle: p,
|
|
40
|
+
order: 3
|
|
41
|
+
}, d = {
|
|
42
|
+
props: t,
|
|
43
|
+
initialProps: ["id", "className"]
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
n as meta,
|
|
47
|
+
d as propsMeta
|
|
48
|
+
};
|
package/lib/slot.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as e } from "react";
|
|
3
|
+
const l = e((o, t) => /* @__PURE__ */ r(
|
|
4
|
+
"div",
|
|
5
|
+
{
|
|
6
|
+
...o,
|
|
7
|
+
ref: t,
|
|
8
|
+
style: { display: o.children ? "contents" : "block" }
|
|
9
|
+
}
|
|
10
|
+
));
|
|
11
|
+
l.displayName = "Slot";
|
|
12
|
+
export {
|
|
13
|
+
l as Slot
|
|
14
|
+
};
|
package/lib/slot.ws.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SlotComponentIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
const e = {
|
|
3
|
+
category: "general",
|
|
4
|
+
type: "container",
|
|
5
|
+
description: "Slot is a container for content that you want to reference across the project. Changes made to a Slot's children will be reflected in all other instances of that Slot.",
|
|
6
|
+
icon: t,
|
|
7
|
+
order: 5
|
|
8
|
+
}, n = {
|
|
9
|
+
props: {}
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
e as meta,
|
|
13
|
+
n as propsMeta
|
|
14
|
+
};
|
package/lib/span.js
ADDED
package/lib/span.ws.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PaintBrushIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as o } from "@webstudio-is/sdk";
|
|
3
|
+
import { span as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as e } from "./__generated__/span.props.js";
|
|
5
|
+
const s = {
|
|
6
|
+
span: r
|
|
7
|
+
}, c = {
|
|
8
|
+
type: "rich-text-child",
|
|
9
|
+
label: "Text",
|
|
10
|
+
icon: t,
|
|
11
|
+
states: o,
|
|
12
|
+
presetStyle: s
|
|
13
|
+
}, n = {
|
|
14
|
+
props: e,
|
|
15
|
+
initialProps: ["id", "className"]
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
c as meta,
|
|
19
|
+
n as propsMeta
|
|
20
|
+
};
|
package/lib/subscript.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SubscriptIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as o } from "@webstudio-is/sdk";
|
|
3
|
+
import { sub as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as s } from "./__generated__/subscript.props.js";
|
|
5
|
+
const e = {
|
|
6
|
+
sub: r
|
|
7
|
+
}, a = {
|
|
8
|
+
type: "rich-text-child",
|
|
9
|
+
label: "Subscript Text",
|
|
10
|
+
icon: t,
|
|
11
|
+
states: o,
|
|
12
|
+
presetStyle: e
|
|
13
|
+
}, l = {
|
|
14
|
+
props: s,
|
|
15
|
+
initialProps: ["id", "className"]
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
a as meta,
|
|
19
|
+
l as propsMeta
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SuperscriptIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as r } from "@webstudio-is/sdk";
|
|
3
|
+
import { sup as o } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as p } from "./__generated__/superscript.props.js";
|
|
5
|
+
const e = {
|
|
6
|
+
sup: o
|
|
7
|
+
}, a = {
|
|
8
|
+
type: "rich-text-child",
|
|
9
|
+
label: "Superscript Text",
|
|
10
|
+
icon: t,
|
|
11
|
+
states: r,
|
|
12
|
+
presetStyle: e
|
|
13
|
+
}, l = {
|
|
14
|
+
props: p,
|
|
15
|
+
initialProps: ["id", "className"]
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
a as meta,
|
|
19
|
+
l as propsMeta
|
|
20
|
+
};
|
package/lib/templates.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { meta as o } from "./content-embed.template.js";
|
|
2
|
+
import { meta as m } from "./markdown-embed.template.js";
|
|
3
|
+
import { meta as s } from "./text.template.js";
|
|
4
|
+
import { meta as p } from "./heading.template.js";
|
|
5
|
+
import { meta as n } from "./paragraph.template.js";
|
|
6
|
+
import { meta as i } from "./link.template.js";
|
|
7
|
+
import { meta as u } from "./button.template.js";
|
|
8
|
+
import { meta as l } from "./webhook-form.template.js";
|
|
9
|
+
import { meta as c } from "./blockquote.template.js";
|
|
10
|
+
import { meta as g } from "./list.template.js";
|
|
11
|
+
import { meta as C } from "./list-item.template.js";
|
|
12
|
+
import { meta as H } from "./label.template.js";
|
|
13
|
+
import { meta as T } from "./radio-button.template.js";
|
|
14
|
+
import { meta as w } from "./checkbox.template.js";
|
|
15
|
+
import { meta as I } from "./vimeo.template.js";
|
|
16
|
+
import { meta as P } from "./youtube.template.js";
|
|
17
|
+
import { meta as V } from "./select.template.js";
|
|
18
|
+
import { meta as j } from "./head-slot.template.js";
|
|
19
|
+
export {
|
|
20
|
+
c as Blockquote,
|
|
21
|
+
u as Button,
|
|
22
|
+
w as Checkbox,
|
|
23
|
+
o as ContentEmbed,
|
|
24
|
+
l as Form,
|
|
25
|
+
j as HeadSlot,
|
|
26
|
+
p as Heading,
|
|
27
|
+
H as Label,
|
|
28
|
+
i as Link,
|
|
29
|
+
g as List,
|
|
30
|
+
C as ListItem,
|
|
31
|
+
m as MarkdownEmbed,
|
|
32
|
+
n as Paragraph,
|
|
33
|
+
T as RadioButton,
|
|
34
|
+
V as Select,
|
|
35
|
+
s as Text,
|
|
36
|
+
I as Vimeo,
|
|
37
|
+
P as YouTube
|
|
38
|
+
};
|
package/lib/text.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f } from "react";
|
|
3
|
+
const m = "div", s = f(
|
|
4
|
+
({ tag: t = m, children: o, ...r }, a) => /* @__PURE__ */ e(t, { ...r, ref: a, children: o })
|
|
5
|
+
);
|
|
6
|
+
s.displayName = "Text";
|
|
7
|
+
export {
|
|
8
|
+
s as Text,
|
|
9
|
+
m as defaultTag
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { $ as t, PlaceholderValue as o } from "@webstudio-is/template";
|
|
3
|
+
const a = {
|
|
4
|
+
category: "typography",
|
|
5
|
+
description: "A generic container for any text content that is not a heading or a link.",
|
|
6
|
+
order: 0,
|
|
7
|
+
template: /* @__PURE__ */ e(t.Text, { children: new o("The text you can edit") })
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
a as meta
|
|
11
|
+
};
|
package/lib/text.ws.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TextIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as e } from "@webstudio-is/sdk";
|
|
3
|
+
import { div as o } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as i } from "./__generated__/text.props.js";
|
|
5
|
+
const r = {
|
|
6
|
+
div: [
|
|
7
|
+
...o,
|
|
8
|
+
{
|
|
9
|
+
property: "minHeight",
|
|
10
|
+
value: { type: "unit", unit: "em", value: 1 }
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}, n = {
|
|
14
|
+
type: "container",
|
|
15
|
+
icon: t,
|
|
16
|
+
states: e,
|
|
17
|
+
presetStyle: r
|
|
18
|
+
}, c = {
|
|
19
|
+
props: i,
|
|
20
|
+
initialProps: ["id", "className", "tag"]
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
n as meta,
|
|
24
|
+
c as propsMeta
|
|
25
|
+
};
|
package/lib/textarea.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
const f = d(({ children: i, value: e, defaultValue: r, ...a }, t) => /* @__PURE__ */ o("textarea", { ...a, defaultValue: e ?? r, ref: t }));
|
|
4
|
+
f.displayName = "Textarea";
|
|
5
|
+
export {
|
|
6
|
+
f as Textarea
|
|
7
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { FormTextAreaIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as o } from "@webstudio-is/sdk";
|
|
3
|
+
import { textarea as t } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as r } from "./__generated__/textarea.props.js";
|
|
5
|
+
const l = {
|
|
6
|
+
textarea: [
|
|
7
|
+
...t,
|
|
8
|
+
// resize doesn't work well while on canvas
|
|
9
|
+
{ property: "resize", value: { type: "keyword", value: "none" } },
|
|
10
|
+
{
|
|
11
|
+
property: "display",
|
|
12
|
+
value: { type: "keyword", value: "block" }
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}, p = {
|
|
16
|
+
category: "forms",
|
|
17
|
+
type: "control",
|
|
18
|
+
label: "Text Area",
|
|
19
|
+
description: "A multi-line text input for collecting longer string data from your users.",
|
|
20
|
+
icon: e,
|
|
21
|
+
presetStyle: l,
|
|
22
|
+
order: 4,
|
|
23
|
+
constraints: {
|
|
24
|
+
relation: "ancestor",
|
|
25
|
+
component: { $nin: ["Button", "Link"] }
|
|
26
|
+
},
|
|
27
|
+
states: [
|
|
28
|
+
...o,
|
|
29
|
+
{ selector: "::placeholder", label: "Placeholder" },
|
|
30
|
+
{ selector: ":valid", label: "Valid" },
|
|
31
|
+
{ selector: ":invalid", label: "Invalid" },
|
|
32
|
+
{ selector: ":required", label: "Required" },
|
|
33
|
+
{ selector: ":optional", label: "Optional" }
|
|
34
|
+
// Additional states will go into submenu
|
|
35
|
+
//{ selector: ":disabled", label: "Disabled" },
|
|
36
|
+
//{ selector: ":enabled", label: "Enabled" },
|
|
37
|
+
//{ selector: ":read-only", label: "Read Only" },
|
|
38
|
+
//{ selector: ":read-write", label: "Read Write" },
|
|
39
|
+
]
|
|
40
|
+
}, c = {
|
|
41
|
+
props: r,
|
|
42
|
+
initialProps: [
|
|
43
|
+
"id",
|
|
44
|
+
"className",
|
|
45
|
+
"name",
|
|
46
|
+
"value",
|
|
47
|
+
"placeholder",
|
|
48
|
+
"required",
|
|
49
|
+
"autoFocus"
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
p as meta,
|
|
54
|
+
c as propsMeta
|
|
55
|
+
};
|