react-gif-timeline 0.0.1 → 0.0.2

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/index.d.ts CHANGED
@@ -15,6 +15,8 @@ interface GifTimelineResult {
15
15
  canvasRef: RefObject<HTMLCanvasElement | null>;
16
16
  currentFrame: number;
17
17
  totalFrames: number;
18
+ width: number;
19
+ height: number;
18
20
  isLoaded: boolean;
19
21
  error: string | null;
20
22
  isTransitioning: boolean;
package/dist/index.js CHANGED
@@ -45,8 +45,6 @@ function initCanvas(canvas, width, height) {
45
45
  const dpr = window.devicePixelRatio || 1;
46
46
  canvas.width = width * dpr;
47
47
  canvas.height = height * dpr;
48
- canvas.style.width = `${width}px`;
49
- canvas.style.height = `${height}px`;
50
48
  const ctx = canvas.getContext("2d");
51
49
  ctx.scale(dpr, dpr);
52
50
  }
@@ -218,6 +216,8 @@ function useGifTimeline(options) {
218
216
  canvasRef,
219
217
  currentFrame,
220
218
  totalFrames: gifDataRef.current?.frames.length ?? 0,
219
+ width: gifDataRef.current?.width ?? 0,
220
+ height: gifDataRef.current?.height ?? 0,
221
221
  isLoaded,
222
222
  error,
223
223
  isTransitioning,
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "react-gif-timeline",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Control GIF animation timelines with React state — map anchor frames to states and animate between them.",
5
5
  "sideEffects": false,
6
- "workspaces": ["demo"],
6
+ "workspaces": [
7
+ "demo"
8
+ ],
7
9
  "license": "MIT",
8
10
  "type": "module",
9
11
  "types": "./dist/index.d.ts",