@webstudio-is/image 0.225.0 → 0.227.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/index.js CHANGED
@@ -209,10 +209,17 @@ var wsImageLoader = (props) => {
209
209
  }
210
210
  return resultUrl.href;
211
211
  };
212
+ var wsVideoLoader = ({ src }) => {
213
+ if (src.startsWith("/cgi/asset/")) {
214
+ src = src.slice("/cgi/asset/".length);
215
+ }
216
+ return `/cgi/video/${src}`;
217
+ };
212
218
  export {
213
219
  Image,
214
220
  allSizes,
215
221
  getImageAttributes,
216
222
  imagePlaceholderDataUrl,
217
- wsImageLoader
223
+ wsImageLoader,
224
+ wsVideoLoader
218
225
  };
@@ -4,3 +4,7 @@ import { type ImageLoader } from "./image-optimize";
4
4
  * https://developers.cloudflare.com/images/image-resizing/url-format/
5
5
  **/
6
6
  export declare const wsImageLoader: ImageLoader;
7
+ export type VideoLoader = (options: {
8
+ src: string;
9
+ }) => string;
10
+ export declare const wsVideoLoader: VideoLoader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/image",
3
- "version": "0.225.0",
3
+ "version": "0.227.0",
4
4
  "description": "Image optimization",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",