@webstudio-is/sdk-components-react 0.94.0 → 0.96.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 +754 -33
- package/lib/metas.js +3635 -33
- package/lib/props.js +16274 -33
- package/package.json +14 -11
- package/lib/__generated__/blockquote.props.js +0 -514
- package/lib/__generated__/body.props.js +0 -508
- package/lib/__generated__/bold.props.js +0 -508
- package/lib/__generated__/box.props.js +0 -527
- package/lib/__generated__/button.props.js +0 -564
- package/lib/__generated__/checkbox.props.js +0 -666
- package/lib/__generated__/code-text.props.js +0 -508
- package/lib/__generated__/form.props.js +0 -556
- package/lib/__generated__/fragment.props.js +0 -2
- package/lib/__generated__/heading.props.js +0 -516
- package/lib/__generated__/html-embed.props.js +0 -9
- package/lib/__generated__/image.props.js +0 -581
- package/lib/__generated__/input.props.js +0 -673
- package/lib/__generated__/italic.props.js +0 -508
- package/lib/__generated__/label.props.js +0 -520
- package/lib/__generated__/link.props.js +0 -562
- package/lib/__generated__/list-item.props.js +0 -508
- package/lib/__generated__/list.props.js +0 -534
- package/lib/__generated__/paragraph.props.js +0 -508
- package/lib/__generated__/radio-button.props.js +0 -666
- package/lib/__generated__/rich-text-link.props.js +0 -562
- package/lib/__generated__/separator.props.js +0 -508
- package/lib/__generated__/slot.props.js +0 -2
- package/lib/__generated__/span.props.js +0 -508
- package/lib/__generated__/subscript.props.js +0 -508
- package/lib/__generated__/superscript.props.js +0 -508
- package/lib/__generated__/text.props.js +0 -516
- package/lib/__generated__/textarea.props.js +0 -575
- package/lib/__generated__/vimeo-play-button.props.js +0 -563
- package/lib/__generated__/vimeo-preview-image.props.js +0 -580
- package/lib/__generated__/vimeo-spinner.props.js +0 -508
- package/lib/__generated__/vimeo.props.js +0 -665
- package/lib/blockquote.js +0 -12
- package/lib/blockquote.stories.js +0 -11
- package/lib/blockquote.ws.js +0 -75
- package/lib/body.js +0 -6
- package/lib/body.stories.js +0 -11
- package/lib/body.ws.js +0 -31
- package/lib/bold.js +0 -6
- package/lib/bold.stories.js +0 -11
- package/lib/bold.ws.js +0 -21
- package/lib/box.js +0 -12
- package/lib/box.stories.js +0 -11
- package/lib/box.ws.js +0 -44
- package/lib/button.js +0 -8
- package/lib/button.stories.js +0 -11
- package/lib/button.ws.js +0 -36
- package/lib/checkbox.js +0 -6
- package/lib/checkbox.ws.js +0 -57
- package/lib/code-text.js +0 -10
- package/lib/code-text.stories.js +0 -11
- package/lib/code-text.ws.js +0 -54
- package/lib/form.js +0 -6
- package/lib/form.stories.js +0 -11
- package/lib/form.ws.js +0 -63
- package/lib/fragment.js +0 -7
- package/lib/fragment.ws.js +0 -10
- package/lib/heading.js +0 -12
- package/lib/heading.stories.js +0 -11
- package/lib/heading.ws.js +0 -37
- package/lib/html-embed.js +0 -63
- package/lib/html-embed.stories.js +0 -11
- package/lib/html-embed.ws.js +0 -28
- package/lib/image.js +0 -74
- package/lib/image.stories.js +0 -7
- package/lib/image.ws.js +0 -48
- package/lib/input.js +0 -6
- package/lib/input.stories.js +0 -9
- package/lib/input.ws.js +0 -43
- package/lib/italic.js +0 -6
- package/lib/italic.stories.js +0 -11
- package/lib/italic.ws.js +0 -27
- package/lib/label.js +0 -6
- package/lib/label.ws.js +0 -40
- package/lib/link.js +0 -33
- package/lib/link.stories.js +0 -11
- package/lib/link.ws.js +0 -60
- package/lib/list-item.js +0 -12
- package/lib/list-item.stories.js +0 -11
- package/lib/list-item.ws.js +0 -32
- package/lib/list.js +0 -12
- package/lib/list.stories.js +0 -13
- package/lib/list.ws.js +0 -53
- package/lib/paragraph.js +0 -6
- package/lib/paragraph.stories.js +0 -11
- package/lib/paragraph.ws.js +0 -32
- package/lib/radio-button.js +0 -6
- package/lib/radio-button.ws.js +0 -58
- package/lib/rich-text-link.js +0 -6
- package/lib/rich-text-link.stories.js +0 -11
- package/lib/rich-text-link.ws.js +0 -9
- package/lib/separator.js +0 -12
- package/lib/separator.stories.js +0 -7
- package/lib/separator.ws.js +0 -50
- package/lib/slot.js +0 -14
- package/lib/slot.stories.js +0 -11
- package/lib/slot.ws.js +0 -14
- package/lib/span.js +0 -6
- package/lib/span.stories.js +0 -11
- package/lib/span.ws.js +0 -21
- package/lib/subscript.js +0 -6
- package/lib/subscript.stories.js +0 -11
- package/lib/subscript.ws.js +0 -21
- package/lib/superscript.js +0 -6
- package/lib/superscript.stories.js +0 -11
- package/lib/superscript.ws.js +0 -21
- package/lib/text.js +0 -12
- package/lib/text.stories.js +0 -11
- package/lib/text.ws.js +0 -37
- package/lib/textarea.js +0 -6
- package/lib/textarea.ws.js +0 -44
- package/lib/vimeo-play-button.js +0 -19
- package/lib/vimeo-play-button.stories.js +0 -11
- package/lib/vimeo-play-button.ws.js +0 -25
- package/lib/vimeo-preview-image.js +0 -21
- package/lib/vimeo-preview-image.stories.js +0 -11
- package/lib/vimeo-preview-image.ws.js +0 -19
- package/lib/vimeo-spinner.js +0 -18
- package/lib/vimeo-spinner.stories.js +0 -11
- package/lib/vimeo-spinner.ws.js +0 -23
- package/lib/vimeo.js +0 -279
- package/lib/vimeo.stories.js +0 -11
- package/lib/vimeo.ws.js +0 -327
package/lib/radio-button.ws.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { RadioCheckedIcon } from "@webstudio-is/icons/svg";
|
|
3
|
-
import {
|
|
4
|
-
defaultStates
|
|
5
|
-
} from "@webstudio-is/react-sdk";
|
|
6
|
-
import { input } from "@webstudio-is/react-sdk/css-normalize";
|
|
7
|
-
import { props } from "./__generated__/radio-button.props";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
input: [
|
|
10
|
-
...input,
|
|
11
|
-
{
|
|
12
|
-
property: "marginRight",
|
|
13
|
-
value: { type: "unit", unit: "em", value: 0.5 }
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
};
|
|
17
|
-
export const meta = {
|
|
18
|
-
category: "forms",
|
|
19
|
-
invalidAncestors: ["Button"],
|
|
20
|
-
type: "control",
|
|
21
|
-
label: "Radio",
|
|
22
|
-
description: "Use within a form to allow your users to select a single option from a set of mutually exclusive choices. Group multiple radios by matching their \u201CName\u201D properties.",
|
|
23
|
-
icon: RadioCheckedIcon,
|
|
24
|
-
presetStyle,
|
|
25
|
-
order: 5,
|
|
26
|
-
states: [
|
|
27
|
-
...defaultStates,
|
|
28
|
-
{ selector: ":checked", label: "Checked" },
|
|
29
|
-
{ selector: ":required", label: "Required" },
|
|
30
|
-
{ selector: ":optional", label: "Optional" }
|
|
31
|
-
// Additional states will go into submenu
|
|
32
|
-
//{ selector: ":disabled", label: "Disabled" },
|
|
33
|
-
//{ selector: ":enabled", label: "Enabled" },
|
|
34
|
-
//{ selector: ":read-only", label: "Read Only" },
|
|
35
|
-
//{ selector: ":read-write", label: "Read Write" },
|
|
36
|
-
],
|
|
37
|
-
template: [
|
|
38
|
-
{
|
|
39
|
-
type: "instance",
|
|
40
|
-
component: "Label",
|
|
41
|
-
label: "Radio Field",
|
|
42
|
-
children: [
|
|
43
|
-
{ type: "instance", component: "RadioButton", props: [], children: [] },
|
|
44
|
-
{
|
|
45
|
-
type: "instance",
|
|
46
|
-
component: "Text",
|
|
47
|
-
label: "Radio Label",
|
|
48
|
-
props: [{ type: "string", name: "tag", value: "span" }],
|
|
49
|
-
children: [{ type: "text", value: "Radio" }]
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
};
|
|
55
|
-
export const propsMeta = {
|
|
56
|
-
props,
|
|
57
|
-
initialProps: ["id", "name"]
|
|
58
|
-
};
|
package/lib/rich-text-link.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import { Link } from "./link";
|
|
5
|
-
export const RichTextLink = forwardRef((props, ref) => /* @__PURE__ */ jsx(Link, { ...props, ref }));
|
|
6
|
-
RichTextLink.displayName = "RichTextLink";
|
package/lib/rich-text-link.ws.js
DELETED
package/lib/separator.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import {
|
|
3
|
-
forwardRef,
|
|
4
|
-
createElement
|
|
5
|
-
} from "react";
|
|
6
|
-
export const defaultTag = "hr";
|
|
7
|
-
export const Separator = forwardRef(
|
|
8
|
-
(props, ref) => {
|
|
9
|
-
return createElement(defaultTag, { ...props, ref });
|
|
10
|
-
}
|
|
11
|
-
);
|
|
12
|
-
Separator.displayName = "Separator";
|
package/lib/separator.stories.js
DELETED
package/lib/separator.ws.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { DashIcon } from "@webstudio-is/icons/svg";
|
|
3
|
-
import {
|
|
4
|
-
defaultStates
|
|
5
|
-
} from "@webstudio-is/react-sdk";
|
|
6
|
-
import { hr } from "@webstudio-is/react-sdk/css-normalize";
|
|
7
|
-
import { props } from "./__generated__/separator.props";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
hr: [
|
|
10
|
-
...hr,
|
|
11
|
-
{
|
|
12
|
-
property: "height",
|
|
13
|
-
value: { type: "keyword", value: "1px" }
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
property: "backgroundColor",
|
|
17
|
-
value: { type: "keyword", value: "gray" }
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
property: "borderTopStyle",
|
|
21
|
-
value: { type: "keyword", value: "none" }
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
property: "borderRightStyle",
|
|
25
|
-
value: { type: "keyword", value: "none" }
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
property: "borderLeftStyle",
|
|
29
|
-
value: { type: "keyword", value: "none" }
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
property: "borderBottomStyle",
|
|
33
|
-
value: { type: "keyword", value: "none" }
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
};
|
|
37
|
-
export const meta = {
|
|
38
|
-
category: "general",
|
|
39
|
-
type: "embed",
|
|
40
|
-
label: "Separator",
|
|
41
|
-
description: "Used to visually divide sections of content, helping to improve readability and organization within a webpage.",
|
|
42
|
-
icon: DashIcon,
|
|
43
|
-
states: defaultStates,
|
|
44
|
-
presetStyle,
|
|
45
|
-
order: 5
|
|
46
|
-
};
|
|
47
|
-
export const propsMeta = {
|
|
48
|
-
props,
|
|
49
|
-
initialProps: ["id"]
|
|
50
|
-
};
|
package/lib/slot.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
export const Slot = forwardRef((props, ref) => {
|
|
5
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
-
"div",
|
|
7
|
-
{
|
|
8
|
-
...props,
|
|
9
|
-
ref,
|
|
10
|
-
style: { display: props.children ? "contents" : "block" }
|
|
11
|
-
}
|
|
12
|
-
);
|
|
13
|
-
});
|
|
14
|
-
Slot.displayName = "Slot";
|
package/lib/slot.stories.js
DELETED
package/lib/slot.ws.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { SlotComponentIcon } from "@webstudio-is/icons/svg";
|
|
3
|
-
export const meta = {
|
|
4
|
-
category: "general",
|
|
5
|
-
type: "container",
|
|
6
|
-
label: "Slot",
|
|
7
|
-
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.",
|
|
8
|
-
icon: SlotComponentIcon,
|
|
9
|
-
stylable: false,
|
|
10
|
-
order: 6
|
|
11
|
-
};
|
|
12
|
-
export const propsMeta = {
|
|
13
|
-
props: {}
|
|
14
|
-
};
|
package/lib/span.js
DELETED
package/lib/span.stories.js
DELETED
package/lib/span.ws.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { PaintBrushIcon } from "@webstudio-is/icons/svg";
|
|
3
|
-
import {
|
|
4
|
-
defaultStates
|
|
5
|
-
} from "@webstudio-is/react-sdk";
|
|
6
|
-
import { span } from "@webstudio-is/react-sdk/css-normalize";
|
|
7
|
-
import { props } from "./__generated__/span.props";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
span
|
|
10
|
-
};
|
|
11
|
-
export const meta = {
|
|
12
|
-
type: "rich-text-child",
|
|
13
|
-
label: "Text",
|
|
14
|
-
icon: PaintBrushIcon,
|
|
15
|
-
states: defaultStates,
|
|
16
|
-
presetStyle
|
|
17
|
-
};
|
|
18
|
-
export const propsMeta = {
|
|
19
|
-
props,
|
|
20
|
-
initialProps: ["id"]
|
|
21
|
-
};
|
package/lib/subscript.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
export const defaultTag = "sub";
|
|
5
|
-
export const Subscript = forwardRef((props, ref) => /* @__PURE__ */ jsx("sub", { ...props, ref }));
|
|
6
|
-
Subscript.displayName = "Subscript";
|
package/lib/subscript.stories.js
DELETED
package/lib/subscript.ws.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { SubscriptIcon } from "@webstudio-is/icons/svg";
|
|
3
|
-
import {
|
|
4
|
-
defaultStates
|
|
5
|
-
} from "@webstudio-is/react-sdk";
|
|
6
|
-
import { sub } from "@webstudio-is/react-sdk/css-normalize";
|
|
7
|
-
import { props } from "./__generated__/subscript.props";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
sub
|
|
10
|
-
};
|
|
11
|
-
export const meta = {
|
|
12
|
-
type: "rich-text-child",
|
|
13
|
-
label: "Subscript Text",
|
|
14
|
-
icon: SubscriptIcon,
|
|
15
|
-
states: defaultStates,
|
|
16
|
-
presetStyle
|
|
17
|
-
};
|
|
18
|
-
export const propsMeta = {
|
|
19
|
-
props,
|
|
20
|
-
initialProps: ["id"]
|
|
21
|
-
};
|
package/lib/superscript.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { Superscript as SuperscriptPrimitive } from "./superscript";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/Superscript",
|
|
5
|
-
component: SuperscriptPrimitive
|
|
6
|
-
};
|
|
7
|
-
export const Superscript = {
|
|
8
|
-
args: {
|
|
9
|
-
children: "some superscript text"
|
|
10
|
-
}
|
|
11
|
-
};
|
package/lib/superscript.ws.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { SuperscriptIcon } from "@webstudio-is/icons/svg";
|
|
3
|
-
import {
|
|
4
|
-
defaultStates
|
|
5
|
-
} from "@webstudio-is/react-sdk";
|
|
6
|
-
import { sup } from "@webstudio-is/react-sdk/css-normalize";
|
|
7
|
-
import { props } from "./__generated__/superscript.props";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
sup
|
|
10
|
-
};
|
|
11
|
-
export const meta = {
|
|
12
|
-
type: "rich-text-child",
|
|
13
|
-
label: "Superscript Text",
|
|
14
|
-
icon: SuperscriptIcon,
|
|
15
|
-
states: defaultStates,
|
|
16
|
-
presetStyle
|
|
17
|
-
};
|
|
18
|
-
export const propsMeta = {
|
|
19
|
-
props,
|
|
20
|
-
initialProps: ["id"]
|
|
21
|
-
};
|
package/lib/text.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import {
|
|
3
|
-
createElement,
|
|
4
|
-
forwardRef
|
|
5
|
-
} from "react";
|
|
6
|
-
export const defaultTag = "div";
|
|
7
|
-
export const Text = forwardRef(
|
|
8
|
-
({ tag = defaultTag, ...props }, ref) => {
|
|
9
|
-
return createElement(tag, { ...props, ref });
|
|
10
|
-
}
|
|
11
|
-
);
|
|
12
|
-
Text.displayName = "Text";
|
package/lib/text.stories.js
DELETED
package/lib/text.ws.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { TextIcon } from "@webstudio-is/icons/svg";
|
|
3
|
-
import {
|
|
4
|
-
defaultStates
|
|
5
|
-
} from "@webstudio-is/react-sdk";
|
|
6
|
-
import { div } from "@webstudio-is/react-sdk/css-normalize";
|
|
7
|
-
import { props } from "./__generated__/text.props";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
div: [
|
|
10
|
-
...div,
|
|
11
|
-
{
|
|
12
|
-
property: "minHeight",
|
|
13
|
-
value: { type: "unit", unit: "em", value: 1 }
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
};
|
|
17
|
-
export const meta = {
|
|
18
|
-
category: "text",
|
|
19
|
-
type: "container",
|
|
20
|
-
label: "Text",
|
|
21
|
-
description: "A generic container for any text content that is not a heading or a link.",
|
|
22
|
-
icon: TextIcon,
|
|
23
|
-
states: defaultStates,
|
|
24
|
-
presetStyle,
|
|
25
|
-
template: [
|
|
26
|
-
{
|
|
27
|
-
type: "instance",
|
|
28
|
-
component: "Text",
|
|
29
|
-
children: [{ type: "text", value: "The text you can edit" }]
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
order: 0
|
|
33
|
-
};
|
|
34
|
-
export const propsMeta = {
|
|
35
|
-
props,
|
|
36
|
-
initialProps: ["id", "tag"]
|
|
37
|
-
};
|
package/lib/textarea.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
export const defaultTag = "textarea";
|
|
5
|
-
export const Textarea = forwardRef(({ children: _children, ...props }, ref) => /* @__PURE__ */ jsx("textarea", { ...props, ref }));
|
|
6
|
-
Textarea.displayName = "Textarea";
|
package/lib/textarea.ws.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { FormTextAreaIcon } from "@webstudio-is/icons/svg";
|
|
3
|
-
import {
|
|
4
|
-
defaultStates
|
|
5
|
-
} from "@webstudio-is/react-sdk";
|
|
6
|
-
import { textarea } from "@webstudio-is/react-sdk/css-normalize";
|
|
7
|
-
import { props } from "./__generated__/textarea.props";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
textarea: [
|
|
10
|
-
...textarea,
|
|
11
|
-
// resize doesn't work well while on canvas
|
|
12
|
-
{ property: "resize", value: { type: "keyword", value: "none" } },
|
|
13
|
-
{
|
|
14
|
-
property: "display",
|
|
15
|
-
value: { type: "keyword", value: "block" }
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
};
|
|
19
|
-
export const meta = {
|
|
20
|
-
category: "forms",
|
|
21
|
-
type: "control",
|
|
22
|
-
label: "Text Area",
|
|
23
|
-
description: "A multi-line text input for collecting longer string data from your users.",
|
|
24
|
-
icon: FormTextAreaIcon,
|
|
25
|
-
presetStyle,
|
|
26
|
-
order: 4,
|
|
27
|
-
states: [
|
|
28
|
-
...defaultStates,
|
|
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
|
-
};
|
|
41
|
-
export const propsMeta = {
|
|
42
|
-
props,
|
|
43
|
-
initialProps: ["id", "name", "placeholder", "required", "autoFocus"]
|
|
44
|
-
};
|
package/lib/vimeo-play-button.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
forwardRef,
|
|
5
|
-
useContext
|
|
6
|
-
} from "react";
|
|
7
|
-
import { VimeoContext } from "./vimeo";
|
|
8
|
-
import { Button, defaultTag } from "./button";
|
|
9
|
-
export { defaultTag };
|
|
10
|
-
export const VimeoPlayButton = forwardRef(
|
|
11
|
-
(props, ref) => {
|
|
12
|
-
const vimeoContext = useContext(VimeoContext);
|
|
13
|
-
if (vimeoContext.status !== "initial") {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ jsx(Button, { ...props, onClick: vimeoContext.onInitPlayer, ref });
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
VimeoPlayButton.displayName = "VimeoPlayButton";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { VimeoPlayButton as VimeoPlayButtonPrimitive } from "./vimeo-play-button";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/Vimeo Play Button",
|
|
5
|
-
component: VimeoPlayButtonPrimitive
|
|
6
|
-
};
|
|
7
|
-
export const VimeoPlayButton = {
|
|
8
|
-
args: {
|
|
9
|
-
style: { minHeight: 20, outline: "1px solid black" }
|
|
10
|
-
}
|
|
11
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import {
|
|
3
|
-
defaultStates
|
|
4
|
-
} from "@webstudio-is/react-sdk";
|
|
5
|
-
import { props } from "./__generated__/vimeo-play-button.props";
|
|
6
|
-
import { ButtonElementIcon } from "@webstudio-is/icons/svg";
|
|
7
|
-
import { button } from "@webstudio-is/react-sdk/css-normalize";
|
|
8
|
-
import { defaultTag } from "./vimeo-play-button";
|
|
9
|
-
const presetStyle = {
|
|
10
|
-
button
|
|
11
|
-
};
|
|
12
|
-
export const meta = {
|
|
13
|
-
category: "hidden",
|
|
14
|
-
type: "container",
|
|
15
|
-
invalidAncestors: ["Button"],
|
|
16
|
-
requiredAncestors: ["Vimeo"],
|
|
17
|
-
label: "Play Button",
|
|
18
|
-
icon: ButtonElementIcon,
|
|
19
|
-
presetStyle,
|
|
20
|
-
states: defaultStates
|
|
21
|
-
};
|
|
22
|
-
export const propsMeta = {
|
|
23
|
-
props,
|
|
24
|
-
initialProps: ["id"]
|
|
25
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
forwardRef,
|
|
5
|
-
useContext
|
|
6
|
-
} from "react";
|
|
7
|
-
import { Image, defaultTag } from "./image";
|
|
8
|
-
import { VimeoContext } from "./vimeo";
|
|
9
|
-
const base64Preview = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=`;
|
|
10
|
-
export const VimeoPreviewImage = forwardRef(({ src, ...rest }, ref) => {
|
|
11
|
-
const vimeoContext = useContext(VimeoContext);
|
|
12
|
-
return /* @__PURE__ */ jsx(
|
|
13
|
-
Image,
|
|
14
|
-
{
|
|
15
|
-
...rest,
|
|
16
|
-
src: String(vimeoContext.previewImageUrl ?? src ?? base64Preview),
|
|
17
|
-
ref
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
});
|
|
21
|
-
VimeoPreviewImage.displayName = "VimeoPreviewImage";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { VimeoPreviewImage as VimeoPreviewImagePrimitive } from "./vimeo-preview-image";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/Vimeo Preview Image",
|
|
5
|
-
component: VimeoPreviewImagePrimitive
|
|
6
|
-
};
|
|
7
|
-
export const VimeoPreviewImage = {
|
|
8
|
-
args: {
|
|
9
|
-
style: { minHeight: 20, outline: "1px solid black" }
|
|
10
|
-
}
|
|
11
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import {
|
|
3
|
-
} from "@webstudio-is/react-sdk";
|
|
4
|
-
import {
|
|
5
|
-
propsOverrides as imagePropsOverrides,
|
|
6
|
-
propsMeta as imagePropsMeta,
|
|
7
|
-
meta as imageMeta
|
|
8
|
-
} from "./image.ws";
|
|
9
|
-
import { props } from "./__generated__/vimeo-preview-image.props";
|
|
10
|
-
export const meta = {
|
|
11
|
-
...imageMeta,
|
|
12
|
-
category: "hidden",
|
|
13
|
-
label: "Preview Image",
|
|
14
|
-
requiredAncestors: ["Vimeo"]
|
|
15
|
-
};
|
|
16
|
-
export const propsMeta = {
|
|
17
|
-
props: { ...props, ...imagePropsOverrides },
|
|
18
|
-
initialProps: imagePropsMeta.initialProps
|
|
19
|
-
};
|
package/lib/vimeo-spinner.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
forwardRef,
|
|
5
|
-
useContext
|
|
6
|
-
} from "react";
|
|
7
|
-
import { VimeoContext } from "./vimeo";
|
|
8
|
-
const defaultTag = "div";
|
|
9
|
-
export const VimeoSpinner = forwardRef(
|
|
10
|
-
(props, ref) => {
|
|
11
|
-
const vimeoContext = useContext(VimeoContext);
|
|
12
|
-
if (vimeoContext.status !== "initialized") {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
return /* @__PURE__ */ jsx("div", { ...props, ref });
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
VimeoSpinner.displayName = "VimeoSpinner";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { VimeoSpinner as VimeoSpinnerPrimitive } from "./vimeo-spinner";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/Vimeo Spinner",
|
|
5
|
-
component: VimeoSpinnerPrimitive
|
|
6
|
-
};
|
|
7
|
-
export const VimeoSpinner = {
|
|
8
|
-
args: {
|
|
9
|
-
style: { minHeight: 20, outline: "1px solid black" }
|
|
10
|
-
}
|
|
11
|
-
};
|
package/lib/vimeo-spinner.ws.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import {
|
|
3
|
-
defaultStates
|
|
4
|
-
} from "@webstudio-is/react-sdk";
|
|
5
|
-
import { props } from "./__generated__/vimeo-spinner.props";
|
|
6
|
-
import { div } from "@webstudio-is/react-sdk/css-normalize";
|
|
7
|
-
import { BoxIcon } from "@webstudio-is/icons/svg";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
div
|
|
10
|
-
};
|
|
11
|
-
export const meta = {
|
|
12
|
-
type: "container",
|
|
13
|
-
icon: BoxIcon,
|
|
14
|
-
states: defaultStates,
|
|
15
|
-
presetStyle,
|
|
16
|
-
category: "hidden",
|
|
17
|
-
label: "Spinner",
|
|
18
|
-
requiredAncestors: ["Vimeo"]
|
|
19
|
-
};
|
|
20
|
-
export const propsMeta = {
|
|
21
|
-
props,
|
|
22
|
-
initialProps: ["id"]
|
|
23
|
-
};
|