@webstudio-is/sdk-components-react 0.192.0 → 0.194.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/body.ws.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BodyIcon as o } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as t } from "@webstudio-is/react-sdk";
3
3
  import { body as e } from "@webstudio-is/sdk/normalize.css";
4
- import { props as a } from "./__generated__/body.props.js";
5
- const r = {
4
+ import { props as r } from "./__generated__/body.props.js";
5
+ const a = {
6
6
  body: [
7
7
  ...e,
8
8
  {
@@ -14,17 +14,16 @@ const r = {
14
14
  value: { type: "keyword", value: "grayscale" }
15
15
  }
16
16
  ]
17
- }, l = {
17
+ }, m = {
18
18
  type: "container",
19
19
  icon: o,
20
20
  states: t,
21
- presetStyle: r,
22
- detachable: !1
23
- }, m = {
24
- props: a,
21
+ presetStyle: a
22
+ }, y = {
23
+ props: r,
25
24
  initialProps: ["id", "className"]
26
25
  };
27
26
  export {
28
- l as meta,
29
- m as propsMeta
27
+ m as meta,
28
+ y as propsMeta
30
29
  };
package/lib/image.js CHANGED
@@ -1,40 +1,38 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { forwardRef as v, useContext as x } from "react";
3
- import { Image as y } from "@webstudio-is/image";
4
- import { ReactSdkContext as I } from "@webstudio-is/react-sdk/runtime";
5
- const p = v(
1
+ import { jsx as g } from "react/jsx-runtime";
2
+ import { forwardRef as l, useContext as u } from "react";
3
+ import { Image as v } from "@webstudio-is/image";
4
+ import { ReactSdkContext as x } from "@webstudio-is/react-sdk/runtime";
5
+ const y = l(
6
6
  ({
7
- loading: s = "lazy",
8
- width: r,
9
- height: a,
10
- optimize: o = !0,
11
- decoding: d,
7
+ loading: a = "lazy",
8
+ width: e,
9
+ height: r,
10
+ optimize: m = !0,
11
+ decoding: c,
12
12
  // @todo: it's a hack made for the builder and should't be in the runtime at all.
13
- $webstudio$canvasOnly$assetId: f,
14
- ...t
15
- }, l) => {
16
- const e = String(t.src ?? ""), { imageLoader: N, renderer: g, assetBaseUrl: m } = x(I);
17
- let c = d, n = e;
18
- g === "canvas" && (s = "eager", c = "sync", n = f ?? e, r !== void 0 && a !== void 0 && Number.isNaN(r) && Number.isNaN(a) && (o = !1, r = void 0, a = void 0));
19
- let i = e;
20
- return e.startsWith(m) && (i = e.slice(m.length)), /* @__PURE__ */ u(
21
- y,
13
+ $webstudio$canvasOnly$assetId: d,
14
+ ...s
15
+ }, f) => {
16
+ const o = String(s.src ?? ""), { imageLoader: i, renderer: N } = u(x);
17
+ let n = c, t = o;
18
+ return N === "canvas" && (a = "eager", n = "sync", t = d ?? o, e !== void 0 && r !== void 0 && Number.isNaN(e) && Number.isNaN(r) && (m = !1, e = void 0, r = void 0)), /* @__PURE__ */ g(
19
+ v,
22
20
  {
23
- loading: s,
24
- decoding: c,
25
- optimize: o,
26
- width: r,
27
- height: a,
28
- ...t,
29
- loader: N,
30
- src: i,
31
- ref: l
21
+ loading: a,
22
+ decoding: n,
23
+ optimize: m,
24
+ width: e,
25
+ height: r,
26
+ ...s,
27
+ loader: i,
28
+ src: o,
29
+ ref: f
32
30
  },
33
- n
31
+ t
34
32
  );
35
33
  }
36
34
  );
37
- p.displayName = "Image";
35
+ y.displayName = "Image";
38
36
  export {
39
- p as Image
37
+ y as Image
40
38
  };
@@ -4,11 +4,14 @@ import { li as o } from "@webstudio-is/sdk/normalize.css";
4
4
  import { props as i } from "./__generated__/list-item.props.js";
5
5
  const n = {
6
6
  li: o
7
- }, m = {
7
+ }, c = {
8
8
  category: "general",
9
9
  type: "container",
10
10
  constraints: {
11
- relation: "parent",
11
+ // cannot use parent relation here
12
+ // because list item can be put inside of collection or slot
13
+ // perhaps can be eventually fixed with tag matchers
14
+ relation: "ancestor",
12
15
  component: { $eq: "List" }
13
16
  },
14
17
  description: "Adds a new item to an existing list.",
@@ -29,11 +32,11 @@ const n = {
29
32
  ]
30
33
  }
31
34
  ]
32
- }, c = {
35
+ }, m = {
33
36
  props: i,
34
37
  initialProps: ["id", "className"]
35
38
  };
36
39
  export {
37
- m as meta,
38
- c as propsMeta
40
+ c as meta,
41
+ m as propsMeta
39
42
  };
@@ -1,12 +1,15 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as e, useContext as n } from "react";
3
- import { VimeoContext as m } from "./vimeo.js";
4
- import { Button as a } from "./button.js";
5
- const f = e(
6
- (o, r) => {
7
- const t = n(m);
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as r, useContext as a, useCallback as m } from "react";
3
+ import { VimeoContext as s } from "./vimeo.js";
4
+ import { Button as l } from "./button.js";
5
+ import c from "await-interaction-response";
6
+ const f = r(
7
+ (o, i) => {
8
+ const t = a(s), n = m(async () => {
9
+ await c(), t.onInitPlayer();
10
+ }, [t]);
8
11
  if (t.status === "initial")
9
- return /* @__PURE__ */ i(a, { ...o, onClick: t.onInitPlayer, ref: r });
12
+ return /* @__PURE__ */ e(l, { ...o, onClick: n, ref: i });
10
13
  }
11
14
  );
12
15
  f.displayName = "VimeoPlayButton";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react",
3
- "version": "0.192.0",
3
+ "version": "0.194.0",
4
4
  "description": "Webstudio default library for react",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -42,10 +42,11 @@
42
42
  "@react-aria/utils": "^3.25.3",
43
43
  "colord": "^2.9.3",
44
44
  "micromark": "^4.0.0",
45
- "@webstudio-is/icons": "0.192.0",
46
- "@webstudio-is/react-sdk": "0.192.0",
47
- "@webstudio-is/sdk": "0.192.0",
48
- "@webstudio-is/image": "0.192.0"
45
+ "await-interaction-response": "^0.0.2",
46
+ "@webstudio-is/icons": "0.194.0",
47
+ "@webstudio-is/image": "0.194.0",
48
+ "@webstudio-is/sdk": "0.194.0",
49
+ "@webstudio-is/react-sdk": "0.194.0"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@testing-library/react": "^14.2.2",
@@ -54,8 +55,8 @@
54
55
  "react": "18.3.0-canary-14898b6a9-20240318",
55
56
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
56
57
  "vitest": "^2.1.8",
57
- "@webstudio-is/tsconfig": "1.0.7",
58
- "@webstudio-is/generate-arg-types": "0.0.0"
58
+ "@webstudio-is/generate-arg-types": "0.0.0",
59
+ "@webstudio-is/tsconfig": "1.0.7"
59
60
  },
60
61
  "scripts": {
61
62
  "build": "vite build --config ../../vite.sdk-components.config.ts",