@webstudio-is/sdk-components-react 0.198.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.
Files changed (43) hide show
  1. package/lib/__generated__/head-link.props.js +620 -0
  2. package/lib/__generated__/head-meta.props.js +532 -0
  3. package/lib/__generated__/head-title.props.js +508 -0
  4. package/lib/__generated__/head.props.js +508 -0
  5. package/lib/code-text.ws.js +1 -1
  6. package/lib/components.js +52 -44
  7. package/lib/head-link.js +23 -0
  8. package/lib/head-link.ws.js +20 -0
  9. package/lib/head-meta.js +23 -0
  10. package/lib/head-meta.ws.js +20 -0
  11. package/lib/head-slot.js +54 -0
  12. package/lib/head-slot.template.js +15 -0
  13. package/lib/head-slot.ws.js +26 -0
  14. package/lib/head-title.js +23 -0
  15. package/lib/head-title.ws.js +19 -0
  16. package/lib/hooks.js +3 -2
  17. package/lib/html-embed.ws.js +1 -1
  18. package/lib/metas.js +50 -42
  19. package/lib/props.js +40 -32
  20. package/lib/separator.ws.js +1 -1
  21. package/lib/slot.ws.js +1 -1
  22. package/lib/templates.js +18 -16
  23. package/lib/types/__generated__/head-link.props.d.ts +2 -0
  24. package/lib/types/__generated__/head-meta.props.d.ts +2 -0
  25. package/lib/types/__generated__/head-slot.props.d.ts +2 -0
  26. package/lib/types/__generated__/head-title.props.d.ts +2 -0
  27. package/lib/types/__generated__/head.props.d.ts +2 -0
  28. package/lib/types/components.d.ts +4 -0
  29. package/lib/types/head-link.d.ts +8 -0
  30. package/lib/types/head-link.ws.d.ts +3 -0
  31. package/lib/types/head-meta.d.ts +2 -0
  32. package/lib/types/head-meta.ws.d.ts +3 -0
  33. package/lib/types/head-slot.d.ts +9 -0
  34. package/lib/types/head-slot.template.d.ts +2 -0
  35. package/lib/types/head-slot.ws.d.ts +3 -0
  36. package/lib/types/head-title.d.ts +2 -0
  37. package/lib/types/head-title.ws.d.ts +3 -0
  38. package/lib/types/metas.d.ts +4 -0
  39. package/lib/types/props.d.ts +4 -0
  40. package/lib/types/templates.d.ts +1 -0
  41. package/lib/xml-node.js +51 -39
  42. package/lib/youtube.ws.js +1 -1
  43. package/package.json +7 -7
package/lib/xml-node.js CHANGED
@@ -1,48 +1,60 @@
1
- import { jsxs as n, jsx as p } from "react/jsx-runtime";
2
- import { ReactSdkContext as y, xmlNodeTagSuffix as g } from "@webstudio-is/react-sdk/runtime";
3
- import { forwardRef as u, useContext as x, createElement as b, Children as h } from "react";
4
- const N = u(
5
- ({ tag: a = "", children: e, ...o }, c) => {
6
- const { renderer: f } = x(y), s = Object.entries(o).filter(
7
- ([t]) => t.startsWith("data-") === !1 && t.startsWith("aria-") === !1
8
- ).filter(([t]) => t !== "tabIndex").filter(([, t]) => typeof t != "function"), r = a.replace(/^[^\p{L}_]+/u, "").replaceAll(/[^\p{L}\p{N}\-._:]+/gu, "").trim();
9
- if (f === void 0) {
10
- const t = Object.fromEntries(s);
11
- return b(
12
- `${r}${g}`,
13
- t,
14
- e
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 i = h.toArray(e), l = i.length > 0 && i.every((t) => typeof t == "string"), m = s.map(
18
- ([t, d]) => `${t}=${JSON.stringify(d)}`
19
- );
20
- return /* @__PURE__ */ n("div", { ...o, children: [
21
- /* @__PURE__ */ n("span", { style: { color: "rgb(16, 23, 233)" }, children: [
22
- "<",
23
- [r, ...m].join(" "),
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
- i.length > 0 && /* @__PURE__ */ p(
27
- "div",
28
- {
29
- ref: c,
30
- style: {
31
- display: l ? "inline" : "block",
32
- marginLeft: l ? 0 : "1rem"
33
- },
34
- children: e
35
- }
36
- ),
37
- /* @__PURE__ */ n("span", { style: { color: "rgb(16, 23, 233)" }, children: [
38
- "</",
39
- r,
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
- N.displayName = "XmlNode";
57
+ j.displayName = "XmlNode";
46
58
  export {
47
- N as XmlNode
59
+ j as XmlNode
48
60
  };
package/lib/youtube.ws.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Youtube1cIcon as o } from "@webstudio-is/icons/svg";
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.198.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.198.0",
53
- "@webstudio-is/react-sdk": "0.198.0",
54
- "@webstudio-is/sdk": "0.198.0",
55
- "@webstudio-is/image": "0.198.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,10 +60,10 @@
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": "^2.1.8",
63
+ "vitest": "^3.0.2",
64
64
  "@webstudio-is/generate-arg-types": "0.0.0",
65
65
  "@webstudio-is/sdk-cli": "0.94.0",
66
- "@webstudio-is/template": "0.198.0",
66
+ "@webstudio-is/template": "0.199.0",
67
67
  "@webstudio-is/tsconfig": "1.0.7"
68
68
  },
69
69
  "scripts": {