@remotion/gif 3.0.4 → 3.0.7

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/dist/Gif.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { RemotionGifProps } from './props';
3
2
  export declare const Gif: (props: RemotionGifProps) => JSX.Element;
4
- //# sourceMappingURL=Gif.d.ts.map
package/dist/Gif.js CHANGED
@@ -12,4 +12,3 @@ const Gif = (props) => {
12
12
  return (0, jsx_runtime_1.jsx)(GifForDevelopment_1.GifForDevelopment, { ...props }, void 0);
13
13
  };
14
14
  exports.Gif = Gif;
15
- //# sourceMappingURL=Gif.js.map
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
2
  import { RemotionGifProps } from './props';
3
3
  export declare const GifForDevelopment: React.ForwardRefExoticComponent<RemotionGifProps & React.RefAttributes<HTMLCanvasElement>>;
4
- //# sourceMappingURL=GifForDevelopment.d.ts.map
@@ -8,8 +8,9 @@ const react_1 = require("react");
8
8
  const useCurrentGifIndex_1 = require("./useCurrentGifIndex");
9
9
  const cache = new lru_map_1.LRUMap(30);
10
10
  exports.GifForDevelopment = (0, react_1.forwardRef)(({ src, width, height, onError, onLoad, fit = 'fill', ...props }, ref) => {
11
+ const resolvedSrc = new URL(src, window.location.origin).href;
11
12
  const [state, update] = (0, react_1.useState)(() => {
12
- const parsedGif = cache.get(src);
13
+ const parsedGif = cache.get(resolvedSrc);
13
14
  if (parsedGif === undefined) {
14
15
  return {
15
16
  delays: [],
@@ -21,7 +22,7 @@ exports.GifForDevelopment = (0, react_1.forwardRef)(({ src, width, height, onErr
21
22
  return parsedGif;
22
23
  });
23
24
  // skip loading if frames exist
24
- (0, tools_1.useWorkerParser)(Boolean(state.frames.length) || src, (info) => {
25
+ (0, tools_1.useWorkerParser)(Boolean(state.frames.length) || resolvedSrc, (info) => {
25
26
  if ('error' in info) {
26
27
  if (onError) {
27
28
  onError(info.error);
@@ -32,11 +33,10 @@ exports.GifForDevelopment = (0, react_1.forwardRef)(({ src, width, height, onErr
32
33
  }
33
34
  else {
34
35
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(info);
35
- cache.set(src, info);
36
+ cache.set(resolvedSrc, info);
36
37
  update(info);
37
38
  }
38
39
  });
39
40
  const index = (0, useCurrentGifIndex_1.useCurrentGifIndex)(state.delays);
40
41
  return ((0, jsx_runtime_1.jsx)(tools_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width !== null && width !== void 0 ? width : state.width, height: height !== null && height !== void 0 ? height : state.height, ...props, ref: ref }, void 0));
41
42
  });
42
- //# sourceMappingURL=GifForDevelopment.js.map
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
2
  import { RemotionGifProps } from './props';
3
3
  export declare const GifForRendering: React.ForwardRefExoticComponent<RemotionGifProps & React.RefAttributes<HTMLCanvasElement>>;
4
- //# sourceMappingURL=GifForRendering.d.ts.map
@@ -7,15 +7,16 @@ const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
8
  const useCurrentGifIndex_1 = require("./useCurrentGifIndex");
9
9
  exports.GifForRendering = (0, react_1.forwardRef)(({ src, width, height, onLoad, onError, fit = 'fill', ...props }, ref) => {
10
+ const resolvedSrc = new URL(src, window.location.origin).href;
10
11
  const [state, update] = (0, react_1.useState)({
11
12
  delays: [],
12
13
  frames: [],
13
14
  width: 0,
14
15
  height: 0,
15
16
  });
16
- const [id] = (0, react_1.useState)(() => (0, remotion_1.delayRender)(`Rendering <Gif/> with src="${src}"`));
17
+ const [id] = (0, react_1.useState)(() => (0, remotion_1.delayRender)(`Rendering <Gif/> with src="${resolvedSrc}"`));
17
18
  const index = (0, useCurrentGifIndex_1.useCurrentGifIndex)(state.delays);
18
- (0, tools_1.useParser)(src, (info) => {
19
+ (0, tools_1.useParser)(resolvedSrc, (info) => {
19
20
  if ('error' in info) {
20
21
  if (onError) {
21
22
  onError(info.error);
@@ -32,4 +33,3 @@ exports.GifForRendering = (0, react_1.forwardRef)(({ src, width, height, onLoad,
32
33
  });
33
34
  return ((0, jsx_runtime_1.jsx)(tools_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width !== null && width !== void 0 ? width : state.width, height: height !== null && height !== void 0 ? height : state.height, ...props, ref: ref }, void 0));
34
35
  });
35
- //# sourceMappingURL=GifForRendering.js.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from './Gif';
2
2
  export * from './props';
3
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -12,4 +12,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./Gif"), exports);
14
14
  __exportStar(require("./props"), exports);
15
- //# sourceMappingURL=index.js.map
package/dist/props.d.ts CHANGED
@@ -20,4 +20,3 @@ export declare type GifState = {
20
20
  width: number;
21
21
  height: number;
22
22
  };
23
- //# sourceMappingURL=props.d.ts.map
package/dist/props.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=props.js.map
@@ -1,3 +1,2 @@
1
1
  declare function useCurrentGifIndex(delays: number[]): number;
2
2
  export { useCurrentGifIndex };
3
- //# sourceMappingURL=useCurrentGifIndex.d.ts.map
@@ -26,4 +26,3 @@ function useCurrentGifIndex(delays) {
26
26
  return index;
27
27
  }
28
28
  exports.useCurrentGifIndex = useCurrentGifIndex;
29
- //# sourceMappingURL=useCurrentGifIndex.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/gif",
3
- "version": "3.0.4",
3
+ "version": "3.0.7",
4
4
  "description": "Gif component for remotion",
5
5
  "sideEffects": false,
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@react-gifs/tools": "0.1.2",
25
25
  "lru_map": "0.4.1",
26
- "remotion": "3.0.4"
26
+ "remotion": "3.0.7"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@jonny/eslint-config": "3.0.259",
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "fe6cd08c090ed8aa6c2a1b610851c0ab97749a2c"
57
+ "gitHead": "e44469b9a64608db9bec219339bf93a0ac6e9655"
58
58
  }