@remotion/gif 3.0.3 → 3.0.6

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.3",
3
+ "version": "3.0.6",
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.3"
26
+ "remotion": "3.0.6"
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": "dfff8f066b552a84c3583931ed6f04536b8dc485"
57
+ "gitHead": "507118b6edd67a8e749a81ae19237a55682cd378"
58
58
  }
package/dist/Gif.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Gif.d.ts","sourceRoot":"","sources":["../src/Gif.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,GAAG,UAAW,gBAAgB,gBAM1C,CAAC"}
package/dist/Gif.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Gif.js","sourceRoot":"","sources":["../src/Gif.tsx"],"names":[],"mappings":";;;;AACA,uCAAmC;AACnC,2DAAsD;AACtD,uDAAkD;AAG3C,MAAM,GAAG,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC9C,IAAI,oBAAS,CAAC,sBAAsB,EAAE,KAAK,WAAW,EAAE;QACvD,OAAO,uBAAC,iCAAe,OAAK,KAAK,WAAI,CAAC;KACtC;IAED,OAAO,uBAAC,qCAAiB,OAAK,KAAK,WAAI,CAAC;AACzC,CAAC,CAAC;AANW,QAAA,GAAG,OAMd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GifForDevelopment.d.ts","sourceRoot":"","sources":["../src/GifForDevelopment.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAW,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAKnD,eAAO,MAAM,iBAAiB,4FAoD5B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GifForDevelopment.js","sourceRoot":"","sources":["../src/GifForDevelopment.tsx"],"names":[],"mappings":";;;;AAAA,6CAA0D;AAC1D,qCAA+B;AAC/B,iCAAkD;AAElD,6DA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AE/C,OAAO,CACN,uBAAC,cAAM,IACN,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,KAAK,CAAC,KAAK,EAC3B,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,KAAK,CAAC,MAAM,KAC1B,KAAK,EACT,GAAG,EAAE,GAAG,WACP,CACF,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GifForRendering.d.ts","sourceRoot":"","sources":["../src/GifForRendering.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAW,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAGnD,eAAO,MAAM,eAAe,4FA8C3B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GifForRendering.js","sourceRoot":"","sources":["../src/GifForRendering.tsx"],"names":[],"mappings":";;;;AAAA,6CAAoD;AACpD,iCAAkD;AAClD,uCAAqD;AAErD,6DAAwD;AAE3C,QAAA,eAAe,GAAG,IAAA,kBAAU,EACxC,CAAC,EAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,MAAM,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE;IACtE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAA,gBAAQ,EAAW;QAC1C,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;KACT,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,EAAE,CAC1B,IAAA,sBAAW,EAAC,8BAA8B,GAAG,GAAG,CAAC,CACjD,CAAC;IAEF,MAAM,KAAK,GAAG,IAAA,uCAAkB,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE/C,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;QACvB,IAAI,OAAO,IAAI,IAAI,EAAE;YACpB,IAAI,OAAO,EAAE;gBACZ,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACpB;iBAAM;gBACN,OAAO,CAAC,KAAK,CACZ,oBAAoB,EACpB,IAAI,CAAC,KAAK,EACV,2EAA2E,CAC3E,CAAC;aACF;SACD;aAAM;YACN,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,IAAI,CAAC,CAAC;YACf,MAAM,CAAC,IAAI,CAAC,CAAC;SACb;QAED,IAAA,yBAAc,EAAC,EAAE,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,OAAO,CACN,uBAAC,cAAM,IACN,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,KAAK,CAAC,KAAK,EAC3B,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,KAAK,CAAC,MAAM,KAC1B,KAAK,EACT,GAAG,EAAE,GAAG,WACP,CACF,CAAC;AACH,CAAC,CACD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsB;AACtB,0CAAwB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":";AAAA,oBAAY,gBAAgB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE;QACf,MAAM,EAAE,IAAI,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,MAAM,EAAE,SAAS,EAAE,CAAC;KACpB,KAAK,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,GAAG,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACnC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC5B,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf,CAAC"}
package/dist/props.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"props.js","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCurrentGifIndex.d.ts","sourceRoot":"","sources":["../src/useCurrentGifIndex.tsx"],"names":[],"mappings":"AAGA,iBAAS,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CA2BpD;AAED,OAAO,EAAC,kBAAkB,EAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCurrentGifIndex.js","sourceRoot":"","sources":["../src/useCurrentGifIndex.tsx"],"names":[],"mappings":";;;AAAA,iCAA8B;AAC9B,uCAAoD;AAEpD,SAAS,kBAAkB,CAAC,MAAgB;IAC3C,MAAM,YAAY,GAAG,IAAA,0BAAe,GAAE,CAAC;IACvC,MAAM,WAAW,GAAG,oBAAS,CA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