@webstudio-is/sdk-components-react 0.96.0 → 0.97.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/components.js CHANGED
@@ -228,13 +228,9 @@ Form.displayName = "Form";
228
228
  // src/image.tsx
229
229
  import {
230
230
  forwardRef as forwardRef19,
231
- useMemo,
232
231
  useContext as useContext3
233
232
  } from "react";
234
- import {
235
- Image as WebstudioImage,
236
- createImageLoader
237
- } from "@webstudio-is/image";
233
+ import { Image as WebstudioImage } from "@webstudio-is/image";
238
234
  import {
239
235
  usePropAsset,
240
236
  getInstanceIdFromComponentProps as getInstanceIdFromComponentProps2,
@@ -266,13 +262,10 @@ var imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
266
262
  </svg>`)}`;
267
263
  var Image = forwardRef19(
268
264
  ({ loading = "lazy", ...props }, ref) => {
269
- const { imageBaseUrl } = useContext3(ReactSdkContext3);
265
+ const { imageLoader } = useContext3(ReactSdkContext3);
270
266
  const asset = usePropAsset(getInstanceIdFromComponentProps2(props), "src");
271
- const loader = useMemo(() => {
272
- return createImageLoader({ imageBaseUrl });
273
- }, [imageBaseUrl]);
274
267
  const src = asset?.name ?? props.src;
275
- if (asset == null || loader == null) {
268
+ if (asset == null) {
276
269
  return /* @__PURE__ */ jsx16(
277
270
  "img",
278
271
  {
@@ -289,7 +282,7 @@ var Image = forwardRef19(
289
282
  {
290
283
  loading,
291
284
  ...props,
292
- loader,
285
+ loader: imageLoader,
293
286
  src,
294
287
  ref
295
288
  },
@@ -395,7 +388,7 @@ import {
395
388
  useEffect as useEffect2,
396
389
  useContext as useContext4,
397
390
  createContext,
398
- useMemo as useMemo2
391
+ useMemo
399
392
  } from "react";
400
393
  import { ReactSdkContext as ReactSdkContext4 } from "@webstudio-is/react-sdk";
401
394
  import { shallowEqual } from "shallow-equal";
@@ -536,7 +529,7 @@ var useVimeo = ({
536
529
  setPreviewImageUrl(void 0);
537
530
  }, [renderer, showPreview, options.url, playerStatus]);
538
531
  const optionsRef = useRef2(options);
539
- const stableOptions = useMemo2(() => {
532
+ const stableOptions = useMemo(() => {
540
533
  if (shallowEqual(options, optionsRef.current) === false) {
541
534
  optionsRef.current = options;
542
535
  }
@@ -273,13 +273,13 @@ export declare const VimeoPreviewImage: import("react").ForwardRefExoticComponen
273
273
  height?: string | number | undefined;
274
274
  width?: string | number | undefined;
275
275
  src?: string | undefined;
276
- alt?: string | undefined;
277
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
278
276
  quality?: number | undefined;
279
277
  sizes?: string | undefined;
278
+ alt?: string | undefined;
280
279
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
281
280
  decoding?: "async" | "auto" | "sync" | undefined;
282
281
  loading?: "eager" | "lazy" | undefined;
282
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
283
283
  srcSet?: string | undefined;
284
284
  useMap?: string | undefined;
285
285
  optimize?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react",
3
- "version": "0.96.0",
3
+ "version": "0.97.0",
4
4
  "description": "Webstudio default library for react",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -40,10 +40,10 @@
40
40
  "@react-aria/utils": "^3.19.0",
41
41
  "colord": "^2.9.3",
42
42
  "shallow-equal": "^3.1.0",
43
- "@webstudio-is/css-vars": "^0.96.0",
44
- "@webstudio-is/icons": "^0.96.0",
45
- "@webstudio-is/image": "^0.96.0",
46
- "@webstudio-is/react-sdk": "^0.96.0"
43
+ "@webstudio-is/css-vars": "^0.97.0",
44
+ "@webstudio-is/icons": "^0.97.0",
45
+ "@webstudio-is/image": "^0.97.0",
46
+ "@webstudio-is/react-sdk": "^0.97.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@storybook/react": "^7.4.0",
@@ -52,7 +52,7 @@
52
52
  "react": "^18.2.0",
53
53
  "react-dom": "^18.2.0",
54
54
  "typescript": "5.2.2",
55
- "@webstudio-is/generate-arg-types": "^0.96.0",
55
+ "@webstudio-is/generate-arg-types": "^0.97.0",
56
56
  "@webstudio-is/storybook-config": "^0.0.0",
57
57
  "@webstudio-is/tsconfig": "^1.0.7"
58
58
  },