@webstudio-is/sdk-components-react 0.212.0 → 0.214.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/bold.ws.js +3 -3
- package/lib/head-link.ws.js +9 -9
- package/lib/head-meta.ws.js +3 -3
- package/lib/head-slot.ws.js +6 -12
- package/lib/head-title.ws.js +5 -5
- package/lib/html-embed.ws.js +23 -18
- package/lib/italic.ws.js +5 -5
- package/lib/markdown-embed.ws.js +12 -7
- package/lib/rich-text-link.ws.js +6 -6
- package/lib/span.ws.js +5 -5
- package/lib/subscript.ws.js +5 -5
- package/lib/superscript.ws.js +9 -9
- package/lib/types/html-embed.ws.d.ts +1 -1
- package/lib/types/markdown-embed.ws.d.ts +1 -1
- package/lib/vimeo-play-button.ws.js +10 -16
- package/lib/vimeo-preview-image.ws.js +7 -7
- package/lib/vimeo-spinner.ws.js +13 -13
- package/lib/vimeo.ws.js +20 -15
- package/lib/youtube.js +94 -92
- package/lib/youtube.ws.js +24 -19
- package/package.json +7 -7
package/lib/bold.ws.js
CHANGED
|
@@ -5,16 +5,16 @@ import { props as r } from "./__generated__/bold.props.js";
|
|
|
5
5
|
const p = {
|
|
6
6
|
b: e
|
|
7
7
|
}, l = {
|
|
8
|
-
type: "
|
|
8
|
+
type: "container",
|
|
9
9
|
label: "Bold Text",
|
|
10
10
|
icon: t,
|
|
11
11
|
states: o,
|
|
12
12
|
presetStyle: p
|
|
13
|
-
},
|
|
13
|
+
}, n = {
|
|
14
14
|
props: r,
|
|
15
15
|
initialProps: ["id", "className"]
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
18
|
l as meta,
|
|
19
|
-
|
|
19
|
+
n as propsMeta
|
|
20
20
|
};
|
package/lib/head-link.ws.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ResourceIcon as
|
|
1
|
+
import { ResourceIcon as e } from "@webstudio-is/icons/svg";
|
|
2
2
|
import "@webstudio-is/sdk";
|
|
3
|
-
import { props as
|
|
3
|
+
import { props as o } from "./__generated__/head-link.props.js";
|
|
4
4
|
const p = {
|
|
5
5
|
category: "hidden",
|
|
6
|
-
icon:
|
|
6
|
+
icon: e,
|
|
7
7
|
type: "embed",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
contentModel: {
|
|
9
|
+
category: "none",
|
|
10
|
+
children: ["empty"]
|
|
11
11
|
}
|
|
12
|
-
},
|
|
13
|
-
props:
|
|
12
|
+
}, c = {
|
|
13
|
+
props: o,
|
|
14
14
|
initialProps: ["rel", "hrefLang", "href", "type", "as"]
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
17
|
p as meta,
|
|
18
|
-
|
|
18
|
+
c as propsMeta
|
|
19
19
|
};
|
package/lib/head-meta.ws.js
CHANGED
package/lib/head-slot.ws.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { HeaderIcon as
|
|
1
|
+
import { HeaderIcon as e } from "@webstudio-is/icons/svg";
|
|
2
2
|
import "@webstudio-is/sdk";
|
|
3
3
|
import { props as t } from "./__generated__/head.props.js";
|
|
4
4
|
const r = {
|
|
5
|
-
icon:
|
|
5
|
+
icon: e,
|
|
6
6
|
type: "container",
|
|
7
7
|
description: "Inserts children into the head of the document",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
relation: "child",
|
|
15
|
-
component: { $in: ["HeadLink", "HeadMeta", "HeadTitle"] }
|
|
16
|
-
}
|
|
17
|
-
]
|
|
8
|
+
contentModel: {
|
|
9
|
+
category: "instance",
|
|
10
|
+
children: ["HeadLink", "HeadMeta", "HeadTitle"]
|
|
11
|
+
}
|
|
18
12
|
}, a = {
|
|
19
13
|
props: t,
|
|
20
14
|
initialProps: []
|
package/lib/head-title.ws.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { WindowTitleIcon as o } from "@webstudio-is/icons/svg";
|
|
2
2
|
import "@webstudio-is/sdk";
|
|
3
3
|
import { props as t } from "./__generated__/head-title.props.js";
|
|
4
|
-
const
|
|
4
|
+
const c = {
|
|
5
5
|
category: "hidden",
|
|
6
6
|
icon: o,
|
|
7
7
|
type: "container",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
contentModel: {
|
|
9
|
+
category: "none",
|
|
10
|
+
children: ["text"]
|
|
11
11
|
}
|
|
12
12
|
}, i = {
|
|
13
13
|
props: t
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
c as meta,
|
|
17
17
|
i as propsMeta
|
|
18
18
|
};
|
package/lib/html-embed.ws.js
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import { EmbedIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { descendantComponent as n } from "@webstudio-is/sdk";
|
|
2
3
|
import { props as e } from "./__generated__/html-embed.props.js";
|
|
3
|
-
const
|
|
4
|
-
div: [
|
|
5
|
-
{
|
|
6
|
-
property: "display",
|
|
7
|
-
value: { type: "keyword", value: "contents" }
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
property: "white-space-collapse",
|
|
11
|
-
value: { type: "keyword", value: "collapse" }
|
|
12
|
-
}
|
|
13
|
-
]
|
|
14
|
-
}, a = {
|
|
4
|
+
const r = {
|
|
15
5
|
category: "general",
|
|
16
|
-
type: "
|
|
6
|
+
type: "container",
|
|
17
7
|
label: "HTML Embed",
|
|
18
8
|
description: "Used to add HTML code to the page, such as an SVG or script.",
|
|
19
9
|
icon: t,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
order: 2,
|
|
11
|
+
contentModel: {
|
|
12
|
+
category: "instance",
|
|
13
|
+
children: [n]
|
|
14
|
+
},
|
|
15
|
+
presetStyle: {
|
|
16
|
+
div: [
|
|
17
|
+
{
|
|
18
|
+
property: "display",
|
|
19
|
+
value: { type: "keyword", value: "contents" }
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
property: "white-space-collapse",
|
|
23
|
+
value: { type: "keyword", value: "collapse" }
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}, c = {
|
|
23
28
|
props: {
|
|
24
29
|
...e,
|
|
25
30
|
clientOnly: {
|
|
@@ -41,6 +46,6 @@ const i = {
|
|
|
41
46
|
initialProps: ["className", "clientOnly", "executeScriptOnCanvas"]
|
|
42
47
|
};
|
|
43
48
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
r as meta,
|
|
50
|
+
c as propsMeta
|
|
46
51
|
};
|
package/lib/italic.ws.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TextItalicIcon as t } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { defaultStates as e } from "@webstudio-is/sdk";
|
|
3
3
|
import { i as o } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
-
import { props as
|
|
5
|
-
const
|
|
4
|
+
import { props as r } from "./__generated__/italic.props.js";
|
|
5
|
+
const i = {
|
|
6
6
|
i: [
|
|
7
7
|
...o,
|
|
8
8
|
{
|
|
@@ -11,13 +11,13 @@ const r = {
|
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}, c = {
|
|
14
|
-
type: "
|
|
14
|
+
type: "container",
|
|
15
15
|
label: "Italic Text",
|
|
16
16
|
icon: t,
|
|
17
17
|
states: e,
|
|
18
|
-
presetStyle:
|
|
18
|
+
presetStyle: i
|
|
19
19
|
}, m = {
|
|
20
|
-
props:
|
|
20
|
+
props: r,
|
|
21
21
|
initialProps: ["id", "className"]
|
|
22
22
|
};
|
|
23
23
|
export {
|
package/lib/markdown-embed.ws.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { MarkdownEmbedIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { descendantComponent as o } from "@webstudio-is/sdk";
|
|
3
|
+
import { props as t } from "./__generated__/markdown-embed.props.js";
|
|
4
|
+
const a = {
|
|
5
|
+
type: "container",
|
|
5
6
|
icon: e,
|
|
7
|
+
contentModel: {
|
|
8
|
+
category: "instance",
|
|
9
|
+
children: [o]
|
|
10
|
+
},
|
|
6
11
|
presetStyle: {
|
|
7
12
|
div: [
|
|
8
13
|
{
|
|
@@ -15,9 +20,9 @@ const t = {
|
|
|
15
20
|
}
|
|
16
21
|
]
|
|
17
22
|
}
|
|
18
|
-
},
|
|
23
|
+
}, c = {
|
|
19
24
|
props: {
|
|
20
|
-
...
|
|
25
|
+
...t,
|
|
21
26
|
code: {
|
|
22
27
|
required: !0,
|
|
23
28
|
control: "code",
|
|
@@ -28,6 +33,6 @@ const t = {
|
|
|
28
33
|
initialProps: ["className"]
|
|
29
34
|
};
|
|
30
35
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
a as meta,
|
|
37
|
+
c as propsMeta
|
|
33
38
|
};
|
package/lib/rich-text-link.ws.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { meta as t, propsMeta as
|
|
2
|
-
const
|
|
1
|
+
import { meta as t, propsMeta as a } from "./link.ws.js";
|
|
2
|
+
const o = {
|
|
3
3
|
...t,
|
|
4
|
-
type: "
|
|
5
|
-
},
|
|
4
|
+
type: "container"
|
|
5
|
+
}, p = a;
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
o as meta,
|
|
8
|
+
p as propsMeta
|
|
9
9
|
};
|
package/lib/span.ws.js
CHANGED
|
@@ -4,17 +4,17 @@ import { span as r } from "@webstudio-is/sdk/normalize.css";
|
|
|
4
4
|
import { props as e } from "./__generated__/span.props.js";
|
|
5
5
|
const s = {
|
|
6
6
|
span: r
|
|
7
|
-
},
|
|
8
|
-
type: "
|
|
7
|
+
}, n = {
|
|
8
|
+
type: "container",
|
|
9
9
|
label: "Text",
|
|
10
10
|
icon: t,
|
|
11
11
|
states: o,
|
|
12
12
|
presetStyle: s
|
|
13
|
-
},
|
|
13
|
+
}, c = {
|
|
14
14
|
props: e,
|
|
15
15
|
initialProps: ["id", "className"]
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
n as meta,
|
|
19
|
+
c as propsMeta
|
|
20
20
|
};
|
package/lib/subscript.ws.js
CHANGED
|
@@ -4,17 +4,17 @@ import { sub as r } from "@webstudio-is/sdk/normalize.css";
|
|
|
4
4
|
import { props as s } from "./__generated__/subscript.props.js";
|
|
5
5
|
const e = {
|
|
6
6
|
sub: r
|
|
7
|
-
},
|
|
8
|
-
type: "
|
|
7
|
+
}, c = {
|
|
8
|
+
type: "container",
|
|
9
9
|
label: "Subscript Text",
|
|
10
10
|
icon: t,
|
|
11
11
|
states: o,
|
|
12
12
|
presetStyle: e
|
|
13
|
-
},
|
|
13
|
+
}, n = {
|
|
14
14
|
props: s,
|
|
15
15
|
initialProps: ["id", "className"]
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
c as meta,
|
|
19
|
+
n as propsMeta
|
|
20
20
|
};
|
package/lib/superscript.ws.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { SuperscriptIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
-
import { defaultStates as
|
|
3
|
-
import { sup as
|
|
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
5
|
const e = {
|
|
6
|
-
sup:
|
|
7
|
-
},
|
|
8
|
-
type: "
|
|
6
|
+
sup: r
|
|
7
|
+
}, c = {
|
|
8
|
+
type: "container",
|
|
9
9
|
label: "Superscript Text",
|
|
10
10
|
icon: t,
|
|
11
|
-
states:
|
|
11
|
+
states: o,
|
|
12
12
|
presetStyle: e
|
|
13
|
-
},
|
|
13
|
+
}, n = {
|
|
14
14
|
props: p,
|
|
15
15
|
initialProps: ["id", "className"]
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
c as meta,
|
|
19
|
+
n as propsMeta
|
|
20
20
|
};
|
|
@@ -2,30 +2,24 @@ 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
|
|
6
|
-
button: e
|
|
7
|
-
}, p = {
|
|
5
|
+
const s = {
|
|
8
6
|
category: "hidden",
|
|
9
7
|
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
8
|
label: "Play Button",
|
|
21
9
|
icon: o,
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
states: t,
|
|
11
|
+
contentModel: {
|
|
12
|
+
category: "none",
|
|
13
|
+
children: ["instance"]
|
|
14
|
+
},
|
|
15
|
+
presetStyle: {
|
|
16
|
+
button: e
|
|
17
|
+
}
|
|
24
18
|
}, c = {
|
|
25
19
|
props: n,
|
|
26
20
|
initialProps: ["id", "className"]
|
|
27
21
|
};
|
|
28
22
|
export {
|
|
29
|
-
|
|
23
|
+
s as meta,
|
|
30
24
|
c as propsMeta
|
|
31
25
|
};
|
|
@@ -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
|
|
3
|
+
const a = {
|
|
4
4
|
...e,
|
|
5
5
|
category: "hidden",
|
|
6
6
|
label: "Preview Image",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
contentModel: {
|
|
8
|
+
category: "none",
|
|
9
|
+
children: ["empty"]
|
|
10
10
|
}
|
|
11
|
-
},
|
|
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
|
-
|
|
26
|
-
|
|
25
|
+
a as meta,
|
|
26
|
+
i as propsMeta
|
|
27
27
|
};
|
package/lib/vimeo-spinner.ws.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defaultStates as
|
|
2
|
-
import { div as
|
|
1
|
+
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
2
|
+
import { div as o } 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
|
|
6
|
-
div: t
|
|
7
|
-
}, m = {
|
|
5
|
+
const s = {
|
|
8
6
|
type: "container",
|
|
9
|
-
constraints: {
|
|
10
|
-
relation: "ancestor",
|
|
11
|
-
component: { $in: ["Vimeo", "YouTube"] }
|
|
12
|
-
},
|
|
13
7
|
icon: e,
|
|
14
|
-
states:
|
|
15
|
-
presetStyle: n,
|
|
8
|
+
states: t,
|
|
16
9
|
category: "hidden",
|
|
17
|
-
label: "Spinner"
|
|
10
|
+
label: "Spinner",
|
|
11
|
+
contentModel: {
|
|
12
|
+
category: "none",
|
|
13
|
+
children: ["instance"]
|
|
14
|
+
},
|
|
15
|
+
presetStyle: {
|
|
16
|
+
div: o
|
|
17
|
+
}
|
|
18
18
|
}, c = {
|
|
19
19
|
props: r,
|
|
20
20
|
initialProps: ["id", "className"]
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
s as meta,
|
|
24
24
|
c as propsMeta
|
|
25
25
|
};
|
package/lib/vimeo.ws.js
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { VimeoIcon as o } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
3
|
-
import { div as
|
|
4
|
-
import { props as
|
|
5
|
-
const
|
|
6
|
-
div: i
|
|
7
|
-
}, c = {
|
|
3
|
+
import { div as e } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as i } from "./__generated__/vimeo.props.js";
|
|
5
|
+
const m = {
|
|
8
6
|
type: "container",
|
|
9
7
|
icon: o,
|
|
10
8
|
states: t,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
contentModel: {
|
|
10
|
+
category: "instance",
|
|
11
|
+
children: [
|
|
12
|
+
"instance",
|
|
13
|
+
"VimeoSpinner",
|
|
14
|
+
"VimeoPlayButton",
|
|
15
|
+
"VimeoPreviewImage"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
presetStyle: {
|
|
19
|
+
div: e
|
|
15
20
|
}
|
|
16
|
-
},
|
|
21
|
+
}, r = [
|
|
17
22
|
"id",
|
|
18
23
|
"className",
|
|
19
24
|
"url",
|
|
@@ -31,11 +36,11 @@ const r = {
|
|
|
31
36
|
"showControls",
|
|
32
37
|
"controlsColor",
|
|
33
38
|
"playsinline"
|
|
34
|
-
],
|
|
35
|
-
props:
|
|
36
|
-
initialProps:
|
|
39
|
+
], p = {
|
|
40
|
+
props: i,
|
|
41
|
+
initialProps: r
|
|
37
42
|
};
|
|
38
43
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
m as meta,
|
|
45
|
+
p as propsMeta
|
|
41
46
|
};
|
package/lib/youtube.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as u, jsxs as E, Fragment as O } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as x, useState as p, useContext as S, useRef as T, useEffect as
|
|
2
|
+
import { forwardRef as x, useState as p, useContext as S, useRef as T, useEffect as y } from "react";
|
|
3
3
|
import { ReactSdkContext as A } from "@webstudio-is/react-sdk/runtime";
|
|
4
4
|
import { VimeoContext as N, requestFullscreen as P } from "./vimeo.js";
|
|
5
5
|
const U = "https://www.youtube-nocookie.com", V = "https://www.youtube.com", j = "https://img.youtube.com", L = (e) => {
|
|
@@ -12,9 +12,9 @@ const U = "https://www.youtube-nocookie.com", V = "https://www.youtube.com", j =
|
|
|
12
12
|
}
|
|
13
13
|
}, D = (e, t) => {
|
|
14
14
|
var o, n;
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
r.pathname = `/embed/${
|
|
15
|
+
const s = L(e.url), r = new URL(t);
|
|
16
|
+
if (s)
|
|
17
|
+
r.pathname = `/embed/${s}`;
|
|
18
18
|
else if (e.url)
|
|
19
19
|
try {
|
|
20
20
|
const c = new URL(e.url);
|
|
@@ -22,77 +22,79 @@ const U = "https://www.youtube-nocookie.com", V = "https://www.youtube.com", j =
|
|
|
22
22
|
} catch {
|
|
23
23
|
}
|
|
24
24
|
const i = Object.keys(e), a = {};
|
|
25
|
+
a.autoplay = "1";
|
|
25
26
|
for (const c of i)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
27
|
+
if (e[c] !== void 0)
|
|
28
|
+
switch (c) {
|
|
29
|
+
case "autoplay":
|
|
30
|
+
e.autoplay && e.muted === void 0 && (a.mute = "1");
|
|
31
|
+
break;
|
|
32
|
+
case "muted":
|
|
33
|
+
a.mute = e.muted ? "1" : "0";
|
|
34
|
+
break;
|
|
35
|
+
case "showControls":
|
|
36
|
+
a.controls = e.showControls ? "1" : "0";
|
|
37
|
+
break;
|
|
38
|
+
case "showRelatedVideos":
|
|
39
|
+
a.rel = e.showRelatedVideos ? "1" : "0";
|
|
40
|
+
break;
|
|
41
|
+
case "keyboard":
|
|
42
|
+
a.keyboard = e.keyboard ? "1" : "0";
|
|
43
|
+
break;
|
|
44
|
+
case "loop":
|
|
45
|
+
a.loop = e.loop ? "1" : "0", e.loop && (e.playlist ?? "").trim() === "" && (a.playlist = s);
|
|
46
|
+
break;
|
|
47
|
+
case "inline":
|
|
48
|
+
a.playsinline = e.inline ? "1" : "0";
|
|
49
|
+
break;
|
|
50
|
+
case "allowFullscreen":
|
|
51
|
+
a.fs = e.allowFullscreen ? "1" : "0";
|
|
52
|
+
break;
|
|
53
|
+
case "captionLanguage":
|
|
54
|
+
a.cc_lang_pref = e.captionLanguage;
|
|
55
|
+
break;
|
|
56
|
+
case "showCaptions":
|
|
57
|
+
a.cc_load_policy = e.showCaptions ? "1" : "0";
|
|
58
|
+
break;
|
|
59
|
+
case "showAnnotations":
|
|
60
|
+
a.iv_load_policy = e.showAnnotations ? "1" : "3";
|
|
61
|
+
break;
|
|
62
|
+
case "startTime":
|
|
63
|
+
a.start = (o = e.startTime) == null ? void 0 : o.toString();
|
|
64
|
+
break;
|
|
65
|
+
case "endTime":
|
|
66
|
+
a.end = (n = e.endTime) == null ? void 0 : n.toString();
|
|
67
|
+
break;
|
|
68
|
+
case "disableKeyboard":
|
|
69
|
+
a.disablekb = e.disableKeyboard ? "1" : "0";
|
|
70
|
+
break;
|
|
71
|
+
case "language":
|
|
72
|
+
a.hl = e.language;
|
|
73
|
+
break;
|
|
74
|
+
case "listId":
|
|
75
|
+
a.list = e.listId;
|
|
76
|
+
break;
|
|
77
|
+
case "listType":
|
|
78
|
+
a.listType = e.listType;
|
|
79
|
+
break;
|
|
80
|
+
case "color":
|
|
81
|
+
a.color = e.color;
|
|
82
|
+
break;
|
|
83
|
+
case "origin":
|
|
84
|
+
a.origin = e.origin;
|
|
85
|
+
break;
|
|
86
|
+
case "referrer":
|
|
87
|
+
a.widget_referrer = e.referrer;
|
|
88
|
+
break;
|
|
89
|
+
case "playlist":
|
|
90
|
+
a.playlist = e.playlist;
|
|
91
|
+
break;
|
|
92
|
+
case "enablejsapi":
|
|
93
|
+
a.enablejsapi = e.enablejsapi ? "1" : "0";
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
return Object.entries(a).forEach(([c, l]) => {
|
|
97
|
+
l !== void 0 && r.searchParams.append(c, l.toString());
|
|
96
98
|
}), r.toString();
|
|
97
99
|
}, R = (e) => {
|
|
98
100
|
const t = document.createElement("link");
|
|
@@ -111,22 +113,22 @@ const F = (e) => {
|
|
|
111
113
|
}, Y = (e) => new URL(`${j}/vi/${e}/maxresdefault.jpg`), K = () => /* @__PURE__ */ u("div", { className: "flex w-full h-full items-center justify-center text-lg", children: 'Open the "Settings" panel and paste a video URL, e.g. https://youtube.com/watch?v=dQw4w9WgXcQ' }), M = ({
|
|
112
114
|
title: e,
|
|
113
115
|
status: t,
|
|
114
|
-
loading:
|
|
116
|
+
loading: s,
|
|
115
117
|
videoUrl: r,
|
|
116
118
|
previewImageUrl: i,
|
|
117
119
|
autoplay: a,
|
|
118
120
|
inline: o,
|
|
119
121
|
renderer: n,
|
|
120
122
|
showPreview: c,
|
|
121
|
-
onStatusChange:
|
|
123
|
+
onStatusChange: l,
|
|
122
124
|
onPreviewImageUrlChange: d
|
|
123
125
|
}) => {
|
|
124
|
-
const [
|
|
125
|
-
return
|
|
126
|
-
a && n !== "canvas" && t === "initial" &&
|
|
127
|
-
}, [a, t, n,
|
|
126
|
+
const [h, m] = p(0), b = T(null);
|
|
127
|
+
return y(() => {
|
|
128
|
+
a && n !== "canvas" && t === "initial" && l("loading");
|
|
129
|
+
}, [a, t, n, l]), y(() => {
|
|
128
130
|
n !== "canvas" && F(r);
|
|
129
|
-
}, [n, r]),
|
|
131
|
+
}, [n, r]), y(() => {
|
|
130
132
|
const f = L(r);
|
|
131
133
|
if (!f || !c) {
|
|
132
134
|
d(void 0);
|
|
@@ -139,19 +141,19 @@ const F = (e) => {
|
|
|
139
141
|
ref: b,
|
|
140
142
|
title: e,
|
|
141
143
|
src: r,
|
|
142
|
-
loading:
|
|
144
|
+
loading: s,
|
|
143
145
|
allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",
|
|
144
146
|
allowFullScreen: !0,
|
|
145
147
|
style: {
|
|
146
148
|
position: "absolute",
|
|
147
149
|
width: "100%",
|
|
148
150
|
height: "100%",
|
|
149
|
-
opacity:
|
|
151
|
+
opacity: h,
|
|
150
152
|
transition: "opacity 1s",
|
|
151
153
|
border: "none"
|
|
152
154
|
},
|
|
153
155
|
onLoad: () => {
|
|
154
|
-
|
|
156
|
+
l("ready"), m(1), !o && !a && b.current && P(b.current);
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
);
|
|
@@ -159,29 +161,29 @@ const F = (e) => {
|
|
|
159
161
|
({
|
|
160
162
|
url: e,
|
|
161
163
|
loading: t = "lazy",
|
|
162
|
-
autoplay:
|
|
164
|
+
autoplay: s,
|
|
163
165
|
showPreview: r,
|
|
164
166
|
showAnnotations: i,
|
|
165
167
|
showCaptions: a,
|
|
166
168
|
showControls: o,
|
|
167
169
|
allowFullscreen: n,
|
|
168
170
|
keyboard: c,
|
|
169
|
-
children:
|
|
171
|
+
children: l,
|
|
170
172
|
privacyEnhancedMode: d,
|
|
171
|
-
inline:
|
|
173
|
+
inline: h = !1,
|
|
172
174
|
...m
|
|
173
175
|
}, b) => {
|
|
174
176
|
const [f, g] = p("initial"), [w, C] = p(), { renderer: k } = S(A), I = d ?? !0 ? U : V, v = D(
|
|
175
177
|
{
|
|
176
178
|
...m,
|
|
177
|
-
inline:
|
|
179
|
+
inline: h,
|
|
178
180
|
url: e,
|
|
179
181
|
keyboard: c,
|
|
180
182
|
showAnnotations: i,
|
|
181
183
|
showCaptions: a,
|
|
182
184
|
allowFullscreen: n,
|
|
183
185
|
showControls: o,
|
|
184
|
-
autoplay:
|
|
186
|
+
autoplay: s,
|
|
185
187
|
enablejsapi: !1
|
|
186
188
|
},
|
|
187
189
|
I
|
|
@@ -197,16 +199,16 @@ const F = (e) => {
|
|
|
197
199
|
}
|
|
198
200
|
},
|
|
199
201
|
children: /* @__PURE__ */ u("div", { ...m, ref: b, children: v ? /* @__PURE__ */ E(O, { children: [
|
|
200
|
-
|
|
202
|
+
l,
|
|
201
203
|
/* @__PURE__ */ u(
|
|
202
204
|
M,
|
|
203
205
|
{
|
|
204
206
|
title: m.title,
|
|
205
|
-
autoplay:
|
|
207
|
+
autoplay: s,
|
|
206
208
|
videoUrl: v,
|
|
207
209
|
previewImageUrl: w,
|
|
208
210
|
loading: t,
|
|
209
|
-
inline:
|
|
211
|
+
inline: h,
|
|
210
212
|
showPreview: r,
|
|
211
213
|
renderer: k,
|
|
212
214
|
status: f,
|
package/lib/youtube.ws.js
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { YoutubeIcon as
|
|
2
|
-
import { defaultStates as
|
|
3
|
-
import { div as
|
|
4
|
-
import { props as
|
|
5
|
-
const
|
|
6
|
-
div: e
|
|
7
|
-
}, c = {
|
|
1
|
+
import { YoutubeIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as o } from "@webstudio-is/sdk";
|
|
3
|
+
import { div as t } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as i } from "./__generated__/youtube.props.js";
|
|
5
|
+
const p = {
|
|
8
6
|
type: "container",
|
|
9
|
-
icon:
|
|
10
|
-
states:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
icon: e,
|
|
8
|
+
states: o,
|
|
9
|
+
contentModel: {
|
|
10
|
+
category: "instance",
|
|
11
|
+
children: [
|
|
12
|
+
"instance",
|
|
13
|
+
"VimeoSpinner",
|
|
14
|
+
"VimeoPlayButton",
|
|
15
|
+
"VimeoPreviewImage"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
presetStyle: {
|
|
19
|
+
div: t
|
|
15
20
|
}
|
|
16
|
-
},
|
|
21
|
+
}, n = [
|
|
17
22
|
"id",
|
|
18
23
|
"className",
|
|
19
24
|
"url",
|
|
@@ -41,11 +46,11 @@ const i = {
|
|
|
41
46
|
"language",
|
|
42
47
|
"color",
|
|
43
48
|
"playlist"
|
|
44
|
-
],
|
|
45
|
-
props:
|
|
46
|
-
initialProps:
|
|
49
|
+
], c = {
|
|
50
|
+
props: i,
|
|
51
|
+
initialProps: n
|
|
47
52
|
};
|
|
48
53
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
p as meta,
|
|
55
|
+
c as propsMeta
|
|
51
56
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.214.0",
|
|
4
4
|
"description": "Webstudio default library for react",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"colord": "^2.9.3",
|
|
50
50
|
"micromark": "^4.0.2",
|
|
51
51
|
"micromark-extension-gfm-table": "^2.1.1",
|
|
52
|
-
"@webstudio-is/icons": "0.
|
|
53
|
-
"@webstudio-is/react-sdk": "0.
|
|
54
|
-
"@webstudio-is/
|
|
55
|
-
"@webstudio-is/
|
|
52
|
+
"@webstudio-is/icons": "0.214.0",
|
|
53
|
+
"@webstudio-is/react-sdk": "0.214.0",
|
|
54
|
+
"@webstudio-is/image": "0.214.0",
|
|
55
|
+
"@webstudio-is/sdk": "0.214.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@testing-library/dom": "^10.4.0",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
64
64
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
65
65
|
"vitest": "^3.0.8",
|
|
66
|
-
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
67
66
|
"@webstudio-is/sdk-cli": "0.94.0",
|
|
68
|
-
"@webstudio-is/
|
|
67
|
+
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
68
|
+
"@webstudio-is/template": "0.214.0",
|
|
69
69
|
"@webstudio-is/tsconfig": "1.0.7"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|