@webstudio-is/sdk-components-react 0.197.0 → 0.199.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/__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/code-text.ws.js +1 -1
- package/lib/components.js +52 -44
- package/lib/head-link.js +23 -0
- package/lib/head-link.ws.js +20 -0
- package/lib/head-meta.js +23 -0
- package/lib/head-meta.ws.js +20 -0
- package/lib/head-slot.js +54 -0
- package/lib/head-slot.template.js +15 -0
- package/lib/head-slot.ws.js +26 -0
- package/lib/head-title.js +23 -0
- package/lib/head-title.ws.js +19 -0
- package/lib/hooks.js +3 -2
- package/lib/html-embed.ws.js +1 -1
- package/lib/metas.js +50 -42
- package/lib/props.js +40 -32
- package/lib/separator.ws.js +1 -1
- package/lib/slot.ws.js +1 -1
- package/lib/templates.js +18 -16
- 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/components.d.ts +4 -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/metas.d.ts +4 -0
- package/lib/types/props.d.ts +4 -0
- package/lib/types/templates.d.ts +1 -0
- package/lib/types/webhook-form.d.ts +1 -0
- package/lib/vimeo.template.js +3 -3
- package/lib/xml-node.js +51 -39
- package/lib/youtube.template.js +15 -15
- package/lib/youtube.ws.js +1 -1
- package/package.json +9 -7
package/lib/vimeo.template.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { SpinnerIcon as r, PlayIcon as
|
|
2
|
+
import { SpinnerIcon as r, PlayIcon as n } from "@webstudio-is/icons/svg";
|
|
3
3
|
import { $ as e, css as o } from "@webstudio-is/template";
|
|
4
4
|
const p = {
|
|
5
5
|
category: "media",
|
|
@@ -20,7 +20,7 @@ const p = {
|
|
|
20
20
|
"ws:style": o`
|
|
21
21
|
position: absolute;
|
|
22
22
|
object-fit: cover;
|
|
23
|
-
object-position:
|
|
23
|
+
object-position: center;
|
|
24
24
|
width: 100%;
|
|
25
25
|
height: 100%;
|
|
26
26
|
border-radius: 20px;
|
|
@@ -79,7 +79,7 @@ const p = {
|
|
|
79
79
|
height: 60px;
|
|
80
80
|
`,
|
|
81
81
|
"aria-hidden": !0,
|
|
82
|
-
children: /* @__PURE__ */ t(e.HtmlEmbed, { "ws:label": "Play SVG", code:
|
|
82
|
+
children: /* @__PURE__ */ t(e.HtmlEmbed, { "ws:label": "Play SVG", code: n })
|
|
83
83
|
}
|
|
84
84
|
)
|
|
85
85
|
}
|
package/lib/xml-node.js
CHANGED
|
@@ -1,48 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ReactSdkContext as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
const
|
|
5
|
-
({ tag:
|
|
6
|
-
const { renderer:
|
|
7
|
-
([
|
|
8
|
-
).filter(([
|
|
9
|
-
if (
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
`${
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsxs as t, jsx as r, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import { ReactSdkContext as g, xmlNodeTagSuffix as x } from "@webstudio-is/react-sdk/runtime";
|
|
3
|
+
import { forwardRef as b, useContext as N, createElement as C, Children as F } from "react";
|
|
4
|
+
const j = b(
|
|
5
|
+
({ tag: c = "", children: l, ...i }, d) => {
|
|
6
|
+
const { renderer: p } = N(g), o = Object.entries(i).filter(
|
|
7
|
+
([e]) => e.startsWith("data-") === !1 && e.startsWith("aria-") === !1
|
|
8
|
+
).filter(([e]) => e.toLowerCase() !== "tabindex").filter(([, e]) => typeof e != "function"), s = c.replace(/^[^\p{L}_]+/u, "").replaceAll(/[^\p{L}\p{N}\-._:]+/gu, "").trim();
|
|
9
|
+
if (p === void 0) {
|
|
10
|
+
const e = Object.fromEntries(o);
|
|
11
|
+
return C(
|
|
12
|
+
`${s}${x}`,
|
|
13
|
+
e,
|
|
14
|
+
l
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"
|
|
17
|
+
const n = F.toArray(l), a = n.length > 0 && n.every((e) => typeof e == "string"), m = (e) => e.map(([f, h], y) => /* @__PURE__ */ t("span", { children: [
|
|
18
|
+
" ",
|
|
19
|
+
/* @__PURE__ */ r("span", { style: { color: "#FF0000" }, children: f }),
|
|
20
|
+
/* @__PURE__ */ r("span", { style: { color: "#000000" }, children: "=" }),
|
|
21
|
+
/* @__PURE__ */ t("span", { style: { color: "#0000FF" }, children: [
|
|
22
|
+
'"',
|
|
23
|
+
h,
|
|
24
|
+
'"'
|
|
25
|
+
] })
|
|
26
|
+
] }, y));
|
|
27
|
+
return /* @__PURE__ */ t("div", { ...i, children: [
|
|
28
|
+
/* @__PURE__ */ t("span", { children: [
|
|
29
|
+
/* @__PURE__ */ t("span", { style: { color: "#800000" }, children: [
|
|
30
|
+
"<",
|
|
31
|
+
s
|
|
32
|
+
] }),
|
|
33
|
+
o.length > 0 && m(o),
|
|
34
|
+
n.length === 0 ? /* @__PURE__ */ r("span", { style: { color: "#800000" }, children: "/>" }) : /* @__PURE__ */ r("span", { style: { color: "#800000" }, children: ">" })
|
|
25
35
|
] }),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
n.length > 0 && /* @__PURE__ */ t(u, { children: [
|
|
37
|
+
/* @__PURE__ */ r(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref: d,
|
|
41
|
+
style: {
|
|
42
|
+
display: a ? "inline" : "block",
|
|
43
|
+
marginLeft: a ? 0 : "1rem"
|
|
44
|
+
},
|
|
45
|
+
children: l
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ t("span", { style: { color: "#800000" }, children: [
|
|
49
|
+
"</",
|
|
50
|
+
s,
|
|
51
|
+
">"
|
|
52
|
+
] })
|
|
41
53
|
] })
|
|
42
54
|
] });
|
|
43
55
|
}
|
|
44
56
|
);
|
|
45
|
-
|
|
57
|
+
j.displayName = "XmlNode";
|
|
46
58
|
export {
|
|
47
|
-
|
|
59
|
+
j as XmlNode
|
|
48
60
|
};
|
package/lib/youtube.template.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { SpinnerIcon as r, PlayIcon as l } from "@webstudio-is/icons/svg";
|
|
3
|
-
import { $ as e, css as
|
|
3
|
+
import { $ as e, css as o } from "@webstudio-is/template";
|
|
4
4
|
const p = {
|
|
5
5
|
label: "YouTube",
|
|
6
6
|
category: "media",
|
|
@@ -10,34 +10,34 @@ const p = {
|
|
|
10
10
|
e.YouTube,
|
|
11
11
|
{
|
|
12
12
|
"ws:label": "YouTube",
|
|
13
|
-
"ws:style":
|
|
13
|
+
"ws:style": o`
|
|
14
14
|
position: relative;
|
|
15
15
|
aspect-ratio: 640/360;
|
|
16
16
|
width: 100%;
|
|
17
17
|
`,
|
|
18
18
|
children: [
|
|
19
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ t(
|
|
20
20
|
e.VimeoPreviewImage,
|
|
21
21
|
{
|
|
22
22
|
"ws:label": "Preview Image",
|
|
23
|
-
"ws:style":
|
|
23
|
+
"ws:style": o`
|
|
24
24
|
position: absolute;
|
|
25
25
|
object-fit: cover;
|
|
26
|
-
object-position:
|
|
26
|
+
object-position: center;
|
|
27
27
|
width: 100%;
|
|
28
28
|
height: 100%;
|
|
29
29
|
border-radius: 20px;
|
|
30
30
|
`,
|
|
31
|
-
alt: "
|
|
31
|
+
alt: "YouTube video preview image",
|
|
32
32
|
sizes: "100vw",
|
|
33
33
|
optimize: !0
|
|
34
34
|
}
|
|
35
35
|
),
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ t(
|
|
37
37
|
e.VimeoSpinner,
|
|
38
38
|
{
|
|
39
39
|
"ws:label": "Spinner",
|
|
40
|
-
"ws:style":
|
|
40
|
+
"ws:style": o`
|
|
41
41
|
position: absolute;
|
|
42
42
|
top: 50%;
|
|
43
43
|
left: 50%;
|
|
@@ -46,14 +46,14 @@ const p = {
|
|
|
46
46
|
margin-top: -35px;
|
|
47
47
|
margin-left: -35px;
|
|
48
48
|
`,
|
|
49
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ t(e.HtmlEmbed, { "ws:label": "Spinner SVG", code: r })
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ t(
|
|
53
53
|
e.VimeoPlayButton,
|
|
54
54
|
{
|
|
55
55
|
"ws:label": "Play Button",
|
|
56
|
-
"ws:style":
|
|
56
|
+
"ws:style": o`
|
|
57
57
|
position: absolute;
|
|
58
58
|
width: 140px;
|
|
59
59
|
height: 80px;
|
|
@@ -74,16 +74,16 @@ const p = {
|
|
|
74
74
|
}
|
|
75
75
|
`,
|
|
76
76
|
"aria-label": "Play button",
|
|
77
|
-
children: /* @__PURE__ */
|
|
77
|
+
children: /* @__PURE__ */ t(
|
|
78
78
|
e.Box,
|
|
79
79
|
{
|
|
80
80
|
"ws:label": "Play Icon",
|
|
81
|
-
"ws:style":
|
|
81
|
+
"ws:style": o`
|
|
82
82
|
width: 60px;
|
|
83
83
|
height: 60px;
|
|
84
84
|
`,
|
|
85
85
|
"aria-hidden": !0,
|
|
86
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ t(e.HtmlEmbed, { "ws:label": "Play SVG", code: l })
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
}
|
package/lib/youtube.ws.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { YoutubeIcon as o } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
3
3
|
import { div as e } from "@webstudio-is/sdk/normalize.css";
|
|
4
4
|
import { props as n } from "./__generated__/youtube.props.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.199.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.1",
|
|
51
51
|
"micromark-extension-gfm-table": "^2.1.0",
|
|
52
|
-
"@webstudio-is/icons": "0.
|
|
53
|
-
"@webstudio-is/react-sdk": "0.
|
|
54
|
-
"@webstudio-is/image": "0.
|
|
55
|
-
"@webstudio-is/sdk": "0.
|
|
52
|
+
"@webstudio-is/icons": "0.199.0",
|
|
53
|
+
"@webstudio-is/react-sdk": "0.199.0",
|
|
54
|
+
"@webstudio-is/image": "0.199.0",
|
|
55
|
+
"@webstudio-is/sdk": "0.199.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@testing-library/react": "^14.2.2",
|
|
@@ -60,14 +60,16 @@
|
|
|
60
60
|
"@types/react-dom": "^18.2.25",
|
|
61
61
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
62
62
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
63
|
-
"vitest": "^
|
|
63
|
+
"vitest": "^3.0.2",
|
|
64
64
|
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
65
|
-
"@webstudio-is/
|
|
65
|
+
"@webstudio-is/sdk-cli": "0.94.0",
|
|
66
|
+
"@webstudio-is/template": "0.199.0",
|
|
66
67
|
"@webstudio-is/tsconfig": "1.0.7"
|
|
67
68
|
},
|
|
68
69
|
"scripts": {
|
|
69
70
|
"build": "vite build --config ../../vite.sdk-components.config.ts",
|
|
70
71
|
"build:args": "NODE_OPTIONS=--conditions=webstudio generate-arg-types './src/*.tsx !./src/*.stories.tsx !./src/*.test.{ts,tsx} !./src/*.ws.ts !./src/*.ws.ts !./src/*.template.tsx' && prettier --write \"**/*.props.ts\"",
|
|
72
|
+
"build:stories": "webstudio-sdk generate-stories && prettier --write \"src/__generated__/*.stories.tsx\"",
|
|
71
73
|
"dts": "tsc --project tsconfig.dts.json",
|
|
72
74
|
"test": "vitest run",
|
|
73
75
|
"typecheck": "tsc"
|