@webstudio-is/sdk-components-react 0.0.0-c575b54 → 0.0.0-ca00e2a

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.
Files changed (120) hide show
  1. package/lib/__generated__/blockquote.props.js +2 -512
  2. package/lib/__generated__/body.props.js +2 -506
  3. package/lib/__generated__/bold.props.js +2 -506
  4. package/lib/__generated__/box.props.js +3 -524
  5. package/lib/__generated__/button.props.js +2 -568
  6. package/lib/__generated__/checkbox.props.js +1 -662
  7. package/lib/__generated__/code-text.props.js +1 -504
  8. package/lib/__generated__/form.props.js +2 -554
  9. package/lib/__generated__/head-link.props.js +2 -618
  10. package/lib/__generated__/head-meta.props.js +2 -530
  11. package/lib/__generated__/head-slot.props.js +4 -0
  12. package/lib/__generated__/head-title.props.js +2 -506
  13. package/lib/__generated__/heading.props.js +3 -513
  14. package/lib/__generated__/html-embed.props.js +6 -1
  15. package/lib/__generated__/image.props.js +1 -581
  16. package/lib/__generated__/input.props.js +2 -694
  17. package/lib/__generated__/italic.props.js +2 -506
  18. package/lib/__generated__/label.props.js +2 -518
  19. package/lib/__generated__/link.props.js +4 -555
  20. package/lib/__generated__/list-item.props.js +2 -512
  21. package/lib/__generated__/list.props.js +1 -523
  22. package/lib/__generated__/markdown-embed.props.js +6 -1
  23. package/lib/__generated__/option.props.js +2 -530
  24. package/lib/__generated__/paragraph.props.js +2 -506
  25. package/lib/__generated__/radio-button.props.js +1 -662
  26. package/lib/__generated__/select.props.js +2 -554
  27. package/lib/__generated__/separator.props.js +2 -506
  28. package/lib/__generated__/span.props.js +2 -506
  29. package/lib/__generated__/subscript.props.js +2 -506
  30. package/lib/__generated__/superscript.props.js +2 -506
  31. package/lib/__generated__/text.props.js +3 -513
  32. package/lib/__generated__/textarea.props.js +2 -585
  33. package/lib/__generated__/time.props.js +3 -3
  34. package/lib/__generated__/video.props.js +4 -0
  35. package/lib/__generated__/vimeo-play-button.props.js +2 -567
  36. package/lib/__generated__/vimeo-preview-image.props.js +1 -580
  37. package/lib/__generated__/vimeo-spinner.props.js +2 -506
  38. package/lib/__generated__/vimeo.props.js +2 -505
  39. package/lib/__generated__/webhook-form.props.js +1 -557
  40. package/lib/__generated__/xml-node.props.js +8 -3
  41. package/lib/__generated__/xml-time.props.js +4 -3
  42. package/lib/__generated__/youtube.props.js +1 -498
  43. package/lib/blockquote.ws.js +14 -14
  44. package/lib/body.ws.js +4 -5
  45. package/lib/bold.ws.js +10 -11
  46. package/lib/box.js +9 -6
  47. package/lib/box.ws.js +38 -19
  48. package/lib/button.ws.js +8 -13
  49. package/lib/checkbox.template.js +1 -1
  50. package/lib/checkbox.ws.js +13 -18
  51. package/lib/code-text.ws.js +12 -13
  52. package/lib/components.js +6 -4
  53. package/lib/form.ws.js +9 -14
  54. package/lib/fragment.ws.js +2 -3
  55. package/lib/head-link.ws.js +7 -9
  56. package/lib/head-meta.ws.js +5 -7
  57. package/lib/head-slot.ws.js +7 -14
  58. package/lib/head-title.ws.js +7 -10
  59. package/lib/heading.js +9 -6
  60. package/lib/heading.ws.js +22 -18
  61. package/lib/html-embed.ws.js +22 -18
  62. package/lib/image.ws.js +3 -4
  63. package/lib/input.ws.js +8 -13
  64. package/lib/italic.ws.js +13 -14
  65. package/lib/label.ws.js +6 -11
  66. package/lib/link.ws.js +3 -7
  67. package/lib/list-item.ws.js +8 -15
  68. package/lib/list.ws.js +11 -12
  69. package/lib/markdown-embed.js +3 -3
  70. package/lib/markdown-embed.ws.js +12 -8
  71. package/lib/metas.js +6 -4
  72. package/lib/option.ws.js +3 -8
  73. package/lib/paragraph.ws.js +7 -11
  74. package/lib/props.js +4 -2
  75. package/lib/radio-button.template.js +1 -1
  76. package/lib/radio-button.ws.js +7 -12
  77. package/lib/rich-text-link.ws.js +4 -7
  78. package/lib/select.ws.js +8 -13
  79. package/lib/separator.ws.js +7 -8
  80. package/lib/shared/video.js +13 -0
  81. package/lib/slot.ws.js +2 -3
  82. package/lib/span.ws.js +8 -9
  83. package/lib/subscript.ws.js +4 -5
  84. package/lib/superscript.ws.js +8 -9
  85. package/lib/text.js +9 -7
  86. package/lib/text.ws.js +25 -18
  87. package/lib/textarea.ws.js +13 -14
  88. package/lib/time.ws.js +2 -3
  89. package/lib/types/box.d.ts +2 -3
  90. package/lib/types/components.d.ts +1 -0
  91. package/lib/types/head-title.ws.d.ts +1 -1
  92. package/lib/types/heading.d.ts +1 -2
  93. package/lib/types/html-embed.ws.d.ts +1 -1
  94. package/lib/types/markdown-embed.ws.d.ts +1 -1
  95. package/lib/types/metas.d.ts +1 -0
  96. package/lib/types/props.d.ts +1 -0
  97. package/lib/types/shared/video.d.ts +7 -0
  98. package/lib/types/text.d.ts +2 -3
  99. package/lib/types/video.d.ts +9 -0
  100. package/lib/types/video.ws.d.ts +3 -0
  101. package/lib/types/vimeo.d.ts +0 -6
  102. package/lib/video.js +53 -0
  103. package/lib/video.ws.js +47 -0
  104. package/lib/vimeo-play-button.js +4 -4
  105. package/lib/vimeo-play-button.ws.js +12 -19
  106. package/lib/vimeo-preview-image.js +5 -5
  107. package/lib/vimeo-preview-image.ws.js +7 -7
  108. package/lib/vimeo-spinner.js +1 -1
  109. package/lib/vimeo-spinner.ws.js +10 -11
  110. package/lib/vimeo.js +98 -99
  111. package/lib/vimeo.ws.js +16 -15
  112. package/lib/webhook-form.template.js +12 -12
  113. package/lib/webhook-form.ws.js +16 -13
  114. package/lib/xml-node.ws.js +4 -5
  115. package/lib/xml-time.ws.js +2 -3
  116. package/lib/youtube.js +152 -131
  117. package/lib/youtube.ws.js +20 -20
  118. package/package.json +13 -11
  119. package/lib/__generated__/head.props.js +0 -508
  120. /package/lib/types/__generated__/{head.props.d.ts → video.props.d.ts} +0 -0
@@ -2,19 +2,18 @@ import { SubscriptIcon as t } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as o } from "@webstudio-is/sdk";
3
3
  import { sub as r } from "@webstudio-is/sdk/normalize.css";
4
4
  import { props as s } from "./__generated__/subscript.props.js";
5
- const e = {
5
+ const p = {
6
6
  sub: r
7
- }, a = {
8
- type: "rich-text-child",
7
+ }, c = {
9
8
  label: "Subscript Text",
10
9
  icon: t,
11
10
  states: o,
12
- presetStyle: e
11
+ presetStyle: p
13
12
  }, l = {
14
13
  props: s,
15
14
  initialProps: ["id", "className"]
16
15
  };
17
16
  export {
18
- a as meta,
17
+ c as meta,
19
18
  l as propsMeta
20
19
  };
@@ -1,20 +1,19 @@
1
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";
2
+ import { defaultStates as o } from "@webstudio-is/sdk";
3
+ import { sup as r } from "@webstudio-is/sdk/normalize.css";
4
4
  import { props as p } from "./__generated__/superscript.props.js";
5
- const e = {
6
- sup: o
7
- }, a = {
8
- type: "rich-text-child",
5
+ const s = {
6
+ sup: r
7
+ }, c = {
9
8
  label: "Superscript Text",
10
9
  icon: t,
11
- states: r,
12
- presetStyle: e
10
+ states: o,
11
+ presetStyle: s
13
12
  }, l = {
14
13
  props: p,
15
14
  initialProps: ["id", "className"]
16
15
  };
17
16
  export {
18
- a as meta,
17
+ c as meta,
19
18
  l as propsMeta
20
19
  };
package/lib/text.js CHANGED
@@ -1,10 +1,12 @@
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 })
1
+ import { forwardRef as a, createElement as m } from "react";
2
+ import { getTagFromProps as f } from "@webstudio-is/sdk/runtime";
3
+ const g = "div", n = a(
4
+ ({ tag: e, ...t }, r) => {
5
+ const o = f(t) ?? e ?? g;
6
+ return m(o, { ...t, ref: r });
7
+ }
5
8
  );
6
- s.displayName = "Text";
9
+ n.displayName = "Text";
7
10
  export {
8
- s as Text,
9
- m as defaultTag
11
+ n as Text
10
12
  };
package/lib/text.ws.js CHANGED
@@ -1,25 +1,32 @@
1
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";
2
+ import { defaultStates as o } from "@webstudio-is/sdk";
3
+ import { div as e } from "@webstudio-is/sdk/normalize.css";
4
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",
5
+ const n = {
15
6
  icon: t,
16
- states: e,
17
- presetStyle: r
18
- }, c = {
19
- props: i,
20
- initialProps: ["id", "className", "tag"]
7
+ states: o,
8
+ presetStyle: {
9
+ div: [
10
+ ...e,
11
+ {
12
+ property: "min-height",
13
+ value: { type: "unit", unit: "em", value: 1 }
14
+ }
15
+ ]
16
+ }
17
+ }, m = {
18
+ props: {
19
+ ...i,
20
+ tag: {
21
+ required: !0,
22
+ control: "tag",
23
+ type: "string",
24
+ options: ["div", "cite", "figcaption", "span"]
25
+ }
26
+ },
27
+ initialProps: ["tag", "id", "className"]
21
28
  };
22
29
  export {
23
30
  n as meta,
24
- c as propsMeta
31
+ m as propsMeta
25
32
  };
@@ -1,10 +1,10 @@
1
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";
2
+ import { defaultStates as r } from "@webstudio-is/sdk";
3
+ import { textarea as o } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as t } from "./__generated__/textarea.props.js";
5
5
  const l = {
6
6
  textarea: [
7
- ...t,
7
+ ...o,
8
8
  // resize doesn't work well while on canvas
9
9
  { property: "resize", value: { type: "keyword", value: "none" } },
10
10
  {
@@ -12,20 +12,19 @@ const l = {
12
12
  value: { type: "keyword", value: "block" }
13
13
  }
14
14
  ]
15
- }, p = {
15
+ }, n = {
16
16
  category: "forms",
17
- type: "control",
18
17
  label: "Text Area",
19
18
  description: "A multi-line text input for collecting longer string data from your users.",
20
19
  icon: e,
21
20
  presetStyle: l,
22
21
  order: 4,
23
- constraints: {
24
- relation: "ancestor",
25
- component: { $nin: ["Button", "Link"] }
22
+ contentModel: {
23
+ category: "instance",
24
+ children: []
26
25
  },
27
26
  states: [
28
- ...o,
27
+ ...r,
29
28
  { selector: "::placeholder", label: "Placeholder" },
30
29
  { selector: ":valid", label: "Valid" },
31
30
  { selector: ":invalid", label: "Invalid" },
@@ -37,8 +36,8 @@ const l = {
37
36
  //{ selector: ":read-only", label: "Read Only" },
38
37
  //{ selector: ":read-write", label: "Read Write" },
39
38
  ]
40
- }, c = {
41
- props: r,
39
+ }, p = {
40
+ props: t,
42
41
  initialProps: [
43
42
  "id",
44
43
  "className",
@@ -50,6 +49,6 @@ const l = {
50
49
  ]
51
50
  };
52
51
  export {
53
- p as meta,
54
- c as propsMeta
52
+ n as meta,
53
+ p as propsMeta
55
54
  };
package/lib/time.ws.js CHANGED
@@ -6,16 +6,15 @@ const r = {
6
6
  time: a
7
7
  }, s = {
8
8
  category: "localization",
9
- type: "container",
10
9
  description: "Converts machine-readable date and time to a human-readable format.",
11
10
  icon: t,
12
11
  states: e,
13
12
  presetStyle: r
14
- }, c = {
13
+ }, l = {
15
14
  props: o,
16
15
  initialProps: ["datetime", "language", "country", "dateStyle", "timeStyle"]
17
16
  };
18
17
  export {
19
18
  s as meta,
20
- c as propsMeta
19
+ l as propsMeta
21
20
  };
@@ -1,8 +1,7 @@
1
1
  import { type ComponentProps } from "react";
2
- export declare const defaultTag = "div";
2
+ declare const defaultTag = "div";
3
3
  type Props = ComponentProps<typeof defaultTag> & {
4
- /** Use this property to change the HTML tag of this element to semantically structure and describe the content of a webpage. This can be important for accessibility tools and search engine optimization. */
5
- tag?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure";
4
+ tag?: string;
6
5
  };
7
6
  export declare const Box: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
8
7
  export {};
@@ -42,3 +42,4 @@ export { HeadSlot } from "./head-slot";
42
42
  export { HeadLink } from "./head-link";
43
43
  export { HeadMeta } from "./head-meta";
44
44
  export { HeadTitle } from "./head-title";
45
+ export { Video } from "./video";
@@ -1,3 +1,3 @@
1
- import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/sdk";
1
+ import type { WsComponentMeta, WsComponentPropsMeta } from "@webstudio-is/sdk";
2
2
  export declare const meta: WsComponentMeta;
3
3
  export declare const propsMeta: WsComponentPropsMeta;
@@ -1,8 +1,7 @@
1
1
  import { type ComponentProps } from "react";
2
2
  declare const defaultTag = "h1";
3
3
  type Props = ComponentProps<typeof defaultTag> & {
4
- /** Use HTML heading levels (h1-h6) to structure content hierarchically, with h1 as the main title and subsequent levels representing sub-sections. Maintain a logical order and avoid skipping levels to ensure consistent and meaningful organization. */
5
- tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
4
+ tag?: string;
6
5
  };
7
6
  export declare const Heading: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
8
7
  export {};
@@ -1,3 +1,3 @@
1
- import type { WsComponentMeta, WsComponentPropsMeta } from "@webstudio-is/sdk";
1
+ import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/sdk";
2
2
  export declare const meta: WsComponentMeta;
3
3
  export declare const propsMeta: WsComponentPropsMeta;
@@ -1,3 +1,3 @@
1
- import type { WsComponentMeta, WsComponentPropsMeta } from "@webstudio-is/sdk";
1
+ import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/sdk";
2
2
  export declare const meta: WsComponentMeta;
3
3
  export declare const propsMeta: WsComponentPropsMeta;
@@ -42,3 +42,4 @@ export { meta as HeadSlot } from "./head-slot.ws";
42
42
  export { meta as HeadLink } from "./head-link.ws";
43
43
  export { meta as HeadMeta } from "./head-meta.ws";
44
44
  export { meta as HeadTitle } from "./head-title.ws";
45
+ export { meta as Video } from "./video.ws";
@@ -42,3 +42,4 @@ export { propsMeta as HeadSlot } from "./head-slot.ws";
42
42
  export { propsMeta as HeadLink } from "./head-link.ws";
43
43
  export { propsMeta as HeadMeta } from "./head-meta.ws";
44
44
  export { propsMeta as HeadTitle } from "./head-title.ws";
45
+ export { propsMeta as Video } from "./video.ws";
@@ -0,0 +1,7 @@
1
+ export declare const requestFullscreen: (element: HTMLIFrameElement) => void;
2
+ export type PlayerStatus = "initial" | "loading" | "ready";
3
+ export declare const VideoContext: import("react").Context<{
4
+ previewImageUrl?: URL;
5
+ onInitPlayer: () => void;
6
+ status: PlayerStatus;
7
+ }>;
@@ -1,8 +1,7 @@
1
1
  import { type ComponentProps } from "react";
2
- export declare const defaultTag = "div";
2
+ declare const defaultTag = "div";
3
3
  type Props = ComponentProps<typeof defaultTag> & {
4
- /** Use this property to change the HTML tag of this element to semantically structure and describe the content of a webpage. This can be important for accessibility tools and search engine optimization. */
5
- tag?: "div" | "span" | "figcaption" | "cite";
4
+ tag?: string;
6
5
  };
7
6
  export declare const Text: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
8
7
  export {};
@@ -0,0 +1,9 @@
1
+ import type { Atom } from "nanostores";
2
+ export declare const defaultTag = "video";
3
+ export declare const Video: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLVideoElement> & import("react").VideoHTMLAttributes<HTMLVideoElement> & {
4
+ $progress?: Atom<number | undefined>;
5
+ $visible?: Atom<boolean>;
6
+ $timeline?: boolean;
7
+ } & {
8
+ $webstudio$canvasOnly$assetId?: string | undefined;
9
+ }, "ref"> & import("react").RefAttributes<HTMLVideoElement>>;
@@ -0,0 +1,3 @@
1
+ import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/sdk";
2
+ export declare const meta: WsComponentMeta;
3
+ export declare const propsMeta: WsComponentPropsMeta;
@@ -66,12 +66,6 @@ export type VimeoOptions = Omit<VimeoPlayerOptions, "dnt" | "interactive_params"
66
66
  /** Whether to display the video owner's portrait. Only works if either title or byline are also enabled */
67
67
  showPortrait?: VimeoPlayerOptions["portrait"];
68
68
  };
69
- type PlayerStatus = "initial" | "loading" | "ready";
70
- export declare const VimeoContext: import("react").Context<{
71
- previewImageUrl?: URL;
72
- onInitPlayer: () => void;
73
- status: PlayerStatus;
74
- }>;
75
69
  declare const defaultTag = "div";
76
70
  type Props = Omit<ComponentProps<typeof defaultTag>, keyof VimeoOptions> & VimeoOptions & {
77
71
  /**
package/lib/video.js ADDED
@@ -0,0 +1,53 @@
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import { forwardRef as V, useId as N, useContext as h, useEffect as x } from "react";
3
+ import { ReactSdkContext as I } from "@webstudio-is/react-sdk/runtime";
4
+ const c = "data-ws-video-id", S = {
5
+ HAVE_METADATA: 1
6
+ }, _ = V(
7
+ ({
8
+ $progress: n,
9
+ $visible: r,
10
+ $timeline: f,
11
+ $webstudio$canvasOnly$assetId: p,
12
+ children: l,
13
+ src: s,
14
+ ...b
15
+ }, m) => {
16
+ const a = N(), A = {
17
+ [c]: a
18
+ }, { assetBaseUrl: d } = h(I), T = s != null && s.startsWith(d) ? `/cgi/video/${s.slice(d.length)}` : s;
19
+ return x(() => {
20
+ if (n === void 0 || r === void 0)
21
+ return;
22
+ const e = document.querySelector(`[${c}="${a}"]`);
23
+ if (e === null || !(e instanceof HTMLVideoElement))
24
+ return;
25
+ if (e.play().catch(() => {
26
+ }), e.pause(), f)
27
+ return n.subscribe((t) => {
28
+ if (e.readyState < S.HAVE_METADATA || (e.paused || e.pause(), e.seeking))
29
+ return;
30
+ let u = e.duration;
31
+ Number.isNaN(u) || (Number.isFinite(u) || (u = 60), e.currentTime = (t ?? 0) * u);
32
+ });
33
+ let i = !1, o = !1;
34
+ const v = r.subscribe((t) => {
35
+ o = t, o === !1 && i === !1 && !e.loop && (e.currentTime = 0);
36
+ }), E = n.subscribe((t) => {
37
+ if (i && (t === void 0 || t === 0 || t === 1)) {
38
+ i = !1, e.pause(), o === !1 && i === !1 && !e.loop && (e.currentTime = 0);
39
+ return;
40
+ }
41
+ i || (i = !0, e.ended || e.play().catch(() => {
42
+ }));
43
+ });
44
+ return () => {
45
+ E(), v();
46
+ };
47
+ }, [n, f, r, a]), /* @__PURE__ */ y("video", { src: T, ...b, ...A, ref: m, children: l });
48
+ }
49
+ );
50
+ _.displayName = "Video";
51
+ export {
52
+ _ as Video
53
+ };
@@ -0,0 +1,47 @@
1
+ import { VideoIcon as e } from "@webstudio-is/icons/svg";
2
+ import "@webstudio-is/sdk";
3
+ import { props as o } from "./__generated__/video.props.js";
4
+ const i = {
5
+ icon: e,
6
+ contentModel: {
7
+ category: "instance",
8
+ children: []
9
+ },
10
+ presetStyle: {
11
+ video: [
12
+ {
13
+ property: "max-width",
14
+ value: { type: "unit", unit: "%", value: 100 }
15
+ }
16
+ ]
17
+ }
18
+ }, l = {
19
+ props: {
20
+ ...o,
21
+ // Automatically generated props don't have the right control.
22
+ src: {
23
+ type: "string",
24
+ control: "file",
25
+ label: "Source",
26
+ required: !1,
27
+ accept: ".mp4,.webm,.mpg,.mpeg,.mov"
28
+ }
29
+ },
30
+ initialProps: [
31
+ "id",
32
+ "className",
33
+ "width",
34
+ "height",
35
+ "src",
36
+ "autoPlay",
37
+ "controls",
38
+ "loop",
39
+ "muted",
40
+ "preload",
41
+ "playsInline"
42
+ ]
43
+ };
44
+ export {
45
+ i as meta,
46
+ l as propsMeta
47
+ };
@@ -1,12 +1,12 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { forwardRef as r, useContext as a, useCallback as m } from "react";
3
- import { VimeoContext as s } from "./vimeo.js";
3
+ import s from "await-interaction-response";
4
4
  import { Button as l } from "./button.js";
5
- import c from "await-interaction-response";
5
+ import { VideoContext as c } from "./shared/video.js";
6
6
  const f = r(
7
7
  (o, i) => {
8
- const t = a(s), n = m(async () => {
9
- await c(), t.onInitPlayer();
8
+ const t = a(c), n = m(async () => {
9
+ await s(), t.onInitPlayer();
10
10
  }, [t]);
11
11
  if (t.status === "initial")
12
12
  return /* @__PURE__ */ e(l, { ...o, onClick: n, ref: i });
@@ -2,30 +2,23 @@ import { defaultStates as t } from "@webstudio-is/sdk";
2
2
  import { ButtonElementIcon as o } from "@webstudio-is/icons/svg";
3
3
  import { button as e } from "@webstudio-is/sdk/normalize.css";
4
4
  import { props as n } from "./__generated__/vimeo-play-button.props.js";
5
- const r = {
6
- button: e
7
- }, p = {
5
+ const m = {
8
6
  category: "hidden",
9
- type: "container",
10
- constraints: [
11
- {
12
- relation: "ancestor",
13
- component: { $in: ["Vimeo", "YouTube"] }
14
- },
15
- {
16
- relation: "ancestor",
17
- component: { $neq: "Button" }
18
- }
19
- ],
20
7
  label: "Play Button",
21
8
  icon: o,
22
- presetStyle: r,
23
- states: t
24
- }, c = {
9
+ states: t,
10
+ contentModel: {
11
+ category: "none",
12
+ children: ["instance"]
13
+ },
14
+ presetStyle: {
15
+ button: e
16
+ }
17
+ }, p = {
25
18
  props: n,
26
19
  initialProps: ["id", "className"]
27
20
  };
28
21
  export {
29
- p as meta,
30
- c as propsMeta
22
+ m as meta,
23
+ p as propsMeta
31
24
  };
@@ -1,10 +1,10 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { forwardRef as i, useContext as t } from "react";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as m, useContext as t } from "react";
3
3
  import { Image as a } from "./image.js";
4
- import { VimeoContext as g } from "./vimeo.js";
5
- const n = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=", s = i(({ src: A, ...e }, o) => {
4
+ import { VideoContext as g } from "./shared/video.js";
5
+ const n = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=", s = m(({ src: A, ...e }, o) => {
6
6
  const r = t(g);
7
- return /* @__PURE__ */ m(
7
+ return /* @__PURE__ */ i(
8
8
  a,
9
9
  {
10
10
  ...e,
@@ -1,14 +1,14 @@
1
1
  import { meta as e, propsMeta as o } from "./image.ws.js";
2
2
  import { props as r } from "./__generated__/vimeo-preview-image.props.js";
3
- const i = {
3
+ const p = {
4
4
  ...e,
5
5
  category: "hidden",
6
6
  label: "Preview Image",
7
- constraints: {
8
- relation: "ancestor",
9
- component: { $in: ["Vimeo", "YouTube"] }
7
+ contentModel: {
8
+ category: "none",
9
+ children: []
10
10
  }
11
- }, p = {
11
+ }, i = {
12
12
  props: {
13
13
  ...r,
14
14
  // Automatically generated props don't have the right control.
@@ -22,6 +22,6 @@ const i = {
22
22
  initialProps: o.initialProps
23
23
  };
24
24
  export {
25
- i as meta,
26
- p as propsMeta
25
+ p as meta,
26
+ i as propsMeta
27
27
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { forwardRef as r, useContext as i } from "react";
3
- import { VimeoContext as n } from "./vimeo.js";
3
+ import { VideoContext as n } from "./shared/video.js";
4
4
  const m = r(
5
5
  (o, t) => {
6
6
  if (i(n).status === "loading")
@@ -2,24 +2,23 @@ import { defaultStates as o } from "@webstudio-is/sdk";
2
2
  import { div as t } from "@webstudio-is/sdk/normalize.css";
3
3
  import { BoxIcon as e } from "@webstudio-is/icons/svg";
4
4
  import { props as r } from "./__generated__/vimeo-spinner.props.js";
5
- const n = {
6
- div: t
7
- }, m = {
8
- type: "container",
9
- constraints: {
10
- relation: "ancestor",
11
- component: { $in: ["Vimeo", "YouTube"] }
12
- },
5
+ const s = {
13
6
  icon: e,
14
7
  states: o,
15
- presetStyle: n,
16
8
  category: "hidden",
17
- label: "Spinner"
9
+ label: "Spinner",
10
+ contentModel: {
11
+ category: "none",
12
+ children: ["instance"]
13
+ },
14
+ presetStyle: {
15
+ div: t
16
+ }
18
17
  }, c = {
19
18
  props: r,
20
19
  initialProps: ["id", "className"]
21
20
  };
22
21
  export {
23
- m as meta,
22
+ s as meta,
24
23
  c as propsMeta
25
24
  };