@webstudio-is/sdk-components-react 0.225.0 → 0.226.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/video.js CHANGED
@@ -1,50 +1,50 @@
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";
1
+ import { jsx as E } from "react/jsx-runtime";
2
+ import { forwardRef as y, useId as V, useContext as N, useEffect as x } from "react";
3
3
  import { ReactSdkContext as I } from "@webstudio-is/react-sdk/runtime";
4
4
  const c = "data-ws-video-id", S = {
5
5
  HAVE_METADATA: 1
6
- }, _ = V(
6
+ }, _ = y(
7
7
  ({
8
- $progress: n,
9
- $visible: r,
10
- $timeline: f,
11
- $webstudio$canvasOnly$assetId: p,
8
+ $progress: r,
9
+ $visible: n,
10
+ $timeline: a,
11
+ $webstudio$canvasOnly$assetId: w,
12
12
  children: l,
13
- src: s,
13
+ src: d,
14
14
  ...b
15
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;
16
+ const o = V(), A = {
17
+ [c]: o
18
+ }, { videoLoader: f } = N(I), T = d && f ? f({ src: d }) : void 0;
19
19
  return x(() => {
20
- if (n === void 0 || r === void 0)
20
+ if (r === void 0 || n === void 0)
21
21
  return;
22
- const e = document.querySelector(`[${c}="${a}"]`);
22
+ const e = document.querySelector(`[${c}="${o}"]`);
23
23
  if (e === null || !(e instanceof HTMLVideoElement))
24
24
  return;
25
25
  if (e.play().catch(() => {
26
- }), e.pause(), f)
27
- return n.subscribe((t) => {
26
+ }), e.pause(), a)
27
+ return r.subscribe((t) => {
28
28
  if (e.readyState < S.HAVE_METADATA || (e.paused || e.pause(), e.seeking))
29
29
  return;
30
- let u = e.duration;
31
- Number.isNaN(u) || (Number.isFinite(u) || (u = 60), e.currentTime = (t ?? 0) * u);
30
+ let s = e.duration;
31
+ Number.isNaN(s) || (Number.isFinite(s) || (s = 60), e.currentTime = (t ?? 0) * s);
32
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) => {
33
+ let i = !1, u = !1;
34
+ const v = n.subscribe((t) => {
35
+ u = t, u === !1 && i === !1 && !e.loop && (e.currentTime = 0);
36
+ }), p = r.subscribe((t) => {
37
37
  if (i && (t === void 0 || t === 0 || t === 1)) {
38
- i = !1, e.pause(), o === !1 && i === !1 && !e.loop && (e.currentTime = 0);
38
+ i = !1, e.pause(), u === !1 && i === !1 && !e.loop && (e.currentTime = 0);
39
39
  return;
40
40
  }
41
41
  i || (i = !0, e.ended || e.play().catch(() => {
42
42
  }));
43
43
  });
44
44
  return () => {
45
- E(), v();
45
+ p(), v();
46
46
  };
47
- }, [n, f, r, a]), /* @__PURE__ */ y("video", { src: T, ...b, ...A, ref: m, children: l });
47
+ }, [r, a, n, o]), /* @__PURE__ */ E("video", { src: T, ...b, ...A, ref: m, children: l });
48
48
  }
49
49
  );
50
50
  _.displayName = "Video";
package/lib/xml-node.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsxs as t, jsx as r, Fragment as u } from "react/jsx-runtime";
1
+ import { jsxs as r, jsx as t, Fragment as u } from "react/jsx-runtime";
2
2
  import { ReactSdkContext as g, xmlNodeTagSuffix as x } from "@webstudio-is/react-sdk/runtime";
3
3
  import { forwardRef as b, useContext as C, createElement as N, Children as F } from "react";
4
4
  const j = b(
@@ -14,38 +14,39 @@ const j = b(
14
14
  l
15
15
  );
16
16
  }
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: [
17
+ const n = F.toArray(l), a = n.length > 0 && n.every((e) => typeof e == "string"), m = (e) => e.map(([f, h], y) => /* @__PURE__ */ r("span", { children: [
18
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: [
19
+ /* @__PURE__ */ t("span", { style: { color: "#FF0000" }, children: f }),
20
+ /* @__PURE__ */ t("span", { style: { color: "#000000" }, children: "=" }),
21
+ /* @__PURE__ */ r("span", { style: { color: "#0000FF" }, children: [
22
22
  '"',
23
23
  h,
24
24
  '"'
25
25
  ] })
26
26
  ] }, y));
27
- return /* @__PURE__ */ t("div", { ...i, style: { backgroundColor: "rgba(255,255,255,1)" }, children: [
28
- /* @__PURE__ */ t("span", { children: [
29
- /* @__PURE__ */ t("span", { style: { color: "#800000" }, children: [
27
+ return /* @__PURE__ */ r("div", { ...i, style: { backgroundColor: "rgba(255,255,255,1)" }, children: [
28
+ /* @__PURE__ */ r("span", { children: [
29
+ /* @__PURE__ */ r("span", { style: { color: "#800000" }, children: [
30
30
  "<",
31
31
  s
32
32
  ] }),
33
33
  o.length > 0 && m(o),
34
- n.length === 0 ? /* @__PURE__ */ r("span", { style: { color: "#800000" }, children: "/>" }) : /* @__PURE__ */ r("span", { style: { color: "#800000" }, children: ">" })
34
+ n.length === 0 ? /* @__PURE__ */ t("span", { style: { color: "#800000" }, children: "/>" }) : /* @__PURE__ */ t("span", { style: { color: "#800000" }, children: ">" })
35
35
  ] }),
36
- n.length > 0 && /* @__PURE__ */ t(u, { children: [
37
- /* @__PURE__ */ r(
36
+ n.length > 0 && /* @__PURE__ */ r(u, { children: [
37
+ /* @__PURE__ */ t(
38
38
  "div",
39
39
  {
40
40
  ref: d,
41
41
  style: {
42
42
  display: a ? "inline" : "block",
43
- marginLeft: a ? 0 : "1rem"
43
+ marginLeft: a ? 0 : "1rem",
44
+ color: "#000000"
44
45
  },
45
46
  children: l
46
47
  }
47
48
  ),
48
- /* @__PURE__ */ t("span", { style: { color: "#800000" }, children: [
49
+ /* @__PURE__ */ r("span", { style: { color: "#800000" }, children: [
49
50
  "</",
50
51
  s,
51
52
  ">"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react",
3
- "version": "0.225.0",
3
+ "version": "0.226.0",
4
4
  "description": "Webstudio default library for react",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -44,10 +44,10 @@
44
44
  "colord": "^2.9.3",
45
45
  "micromark": "^4.0.2",
46
46
  "micromark-extension-gfm-table": "^2.1.1",
47
- "@webstudio-is/icons": "0.225.0",
48
- "@webstudio-is/sdk": "0.225.0",
49
- "@webstudio-is/image": "0.225.0",
50
- "@webstudio-is/react-sdk": "0.225.0"
47
+ "@webstudio-is/icons": "0.226.0",
48
+ "@webstudio-is/sdk": "0.226.0",
49
+ "@webstudio-is/image": "0.226.0",
50
+ "@webstudio-is/react-sdk": "0.226.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@testing-library/dom": "^10.4.0",
@@ -58,9 +58,9 @@
58
58
  "react": "18.3.0-canary-14898b6a9-20240318",
59
59
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
60
60
  "vitest": "^3.1.2",
61
- "@webstudio-is/generate-arg-types": "0.0.0",
62
61
  "@webstudio-is/sdk-cli": "0.94.0",
63
- "@webstudio-is/template": "0.225.0",
62
+ "@webstudio-is/generate-arg-types": "0.0.0",
63
+ "@webstudio-is/template": "0.226.0",
64
64
  "@webstudio-is/tsconfig": "1.0.7"
65
65
  },
66
66
  "scripts": {