reacthub-pixitweenjs 0.2.4 → 0.2.5

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build-storybook.log +79 -476
  3. package/package.json +26 -29
  4. package/src/components/PixiAnimatedSprite/PixiAnimatedSprite.tsx +51 -0
  5. package/src/components/PixiAnimatedSprite/index.ts +2 -0
  6. package/src/components/PixiAudioSprite/PixiAudioSprite.stories.tsx +61 -0
  7. package/src/components/PixiAudioSprite/PixiAudioSprite.tsx +212 -0
  8. package/src/components/PixiAudioSprite/index.ts +1 -0
  9. package/src/components/PixiGifSprite/PixiGifSprite.stories.tsx +135 -0
  10. package/src/components/PixiGifSprite/PixiGifSprite.tsx +451 -0
  11. package/src/components/PixiGifSprite/index.ts +2 -0
  12. package/src/components/PixiImageSprite/PixiImageSprite.stories.tsx +11 -0
  13. package/src/components/PixiImageSprite/PixiImageSprite.tsx +30 -36
  14. package/src/components/PixiSVGSprite/PixiSvgPathSprite.stories.tsx +137 -0
  15. package/src/components/PixiSVGSprite/PixiSvgPathSprite.tsx +378 -0
  16. package/src/components/PixiSVGSprite/index.ts +1 -0
  17. package/src/components/PixiVideoSprite/PixiVideoSprite.stories.tsx +147 -0
  18. package/src/components/PixiVideoSprite/PixiVideoSprite.tsx +684 -0
  19. package/src/components/PixiVideoSprite/PixiVideoSpriteBackup.txt +755 -0
  20. package/src/components/PixiVideoSprite/index.ts +1 -0
  21. package/src/declare.module.ts +5 -0
  22. package/src/providers/GsapPixieContextProvider.tsx +94 -8
  23. package/src/reacthub-react-bindings.d.ts +27 -0
  24. package/src/utils/AppStateProvider.tsx +15 -26
  25. package/src/utils/AppStateStage.tsx +1 -1
  26. package/src/utils/PixiStage.tsx +1 -5
  27. package/src/utils/PixiTransformer.tsx +100 -0
  28. package/src/utils/VideoSeekBar.tsx +34 -23
  29. package/src/utils/useDebounce.tsx +15 -0
package/package.json CHANGED
@@ -1,18 +1,17 @@
1
1
  {
2
2
  "name": "reacthub-pixitweenjs",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "reacthub-pixitweenjs is a library that provides a powerful combination of React, PixiJS, GSAP, and image manipulation capabilities in a timeline sequence. With this library, you can easily create stunning animations and interactive graphics for your React applications",
5
5
  "author": "khanzzirfan",
6
6
  "type": "module",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/khanzzirfan/reacthub-gsap-pixiez"
9
+ "url": "https://github.com/khanzzirfan/reacthub-pixitweenjs"
10
10
  },
11
11
  "bugs": {
12
- "url": "https://github.com/khanzzirfan/reacthub-gsap-pixiez/issues"
12
+ "url": "https://github.com/khanzzirfan/reacthub-pixitweenjs"
13
13
  },
14
14
  "license": "MIT",
15
- "dependencies": {},
16
15
  "scripts": {
17
16
  "dev": "vite",
18
17
  "build": "tsc && vite build",
@@ -36,16 +35,9 @@
36
35
  "@giphy/js-fetch-api": "^4.1.2",
37
36
  "@giphy/js-types": "^4.1.0",
38
37
  "@giphy/react-components": "^5.6.1",
39
- "@pixi-essentials/react-bindings": "2.0.0",
40
- "@pixi-essentials/transformer": "2.5.6",
41
- "@pixi/assets": "6.5.9",
42
- "@pixi/basis": "6.5.9",
43
- "@pixi/filter-adjustment": "5.1.1",
44
- "@pixi/gif": "1.1.3",
45
- "@pixi/interaction": "6.5.9",
46
- "@pixi/picture": "^3.0.3",
47
- "@pixi/react": "7.0.0",
48
- "@pixi/sound": "^4.3.1",
38
+ "@pixi/assets": "^7.2.3",
39
+ "@pixi/filter-adjustment": "^5.1.1",
40
+ "@pixi/react": "~7.1.0",
49
41
  "@react-gifs/tools": "^0.1.2",
50
42
  "@storybook/addon-essentials": "^7.1.0",
51
43
  "@storybook/addon-interactions": "^7.1.0",
@@ -54,6 +46,7 @@
54
46
  "@storybook/addon-styling": "^1.3.4",
55
47
  "@storybook/blocks": "^7.1.0",
56
48
  "@storybook/builder-vite": "^7.1.0",
49
+ "@storybook/jest": "^0.1.0",
57
50
  "@storybook/react": "^7.1.0",
58
51
  "@storybook/react-vite": "^7.1.0",
59
52
  "@storybook/testing-library": "^0.2.0",
@@ -61,50 +54,54 @@
61
54
  "@testing-library/jest-dom": "^5.17.0",
62
55
  "@testing-library/react": "^14.0.0",
63
56
  "@types/dotenv": "^8.2.0",
57
+ "@types/howler": "^2.2.8",
64
58
  "@types/react": "^18.2.15",
65
59
  "@types/react-dom": "^18.2.7",
66
60
  "@typescript-eslint/eslint-plugin": "^5.62.0",
67
61
  "@typescript-eslint/parser": "^5.62.0",
68
62
  "@vitejs/plugin-react": "^4.0.3",
69
63
  "@vitejs/plugin-react-swc": "^3.3.2",
70
- "@storybook/jest": "^0.1.0",
71
- "jsdom": "^21.1.2",
64
+ "chromatic": "^6.7.3",
65
+ "debug": "^4.3.4",
66
+ "dotenv": "^16.0.1",
67
+ "env-cmd": "^10.1.0",
72
68
  "eslint": "^8.45.0",
73
69
  "eslint-config-airbnb": "^19.0.4",
74
70
  "eslint-config-airbnb-typescript": "^17.1.0",
75
71
  "eslint-plugin-react-hooks": "^4.6.0",
76
72
  "eslint-plugin-react-refresh": "^0.3.5",
77
73
  "eslint-plugin-storybook": "^0.6.12",
78
- "react-fast-compare": "^3.2.0",
79
- "chromatic": "^6.7.3",
80
- "debug": "^4.3.4",
81
- "dotenv": "^16.0.1",
82
- "env-cmd": "^10.1.0",
83
74
  "framer-motion": "^8.4.0",
75
+ "gifuct-js": "^2.1.2",
84
76
  "gsap": "3.11.5",
77
+ "howler": "^2.2.3",
78
+ "jsdom": "^21.1.2",
85
79
  "lodash": "4.17.21",
86
80
  "msw": "^1.2.1",
87
81
  "msw-storybook-addon": "^1.8.0",
88
- "pixi-filters": "5.1.1",
89
- "pixi-svg": "3.2.0",
90
- "pixi.js": "6.5.9",
82
+ "pixi-filters": "^5.2.1",
83
+ "pixi-svg": "^3.2.0",
84
+ "pixi.js": "^7.2.3",
91
85
  "prop-types": "^15.8.1",
92
- "react-custom-events": "^1.1.1",
93
- "react-gsap": "^3.2.1",
94
86
  "react": "^18.2.0",
87
+ "react-custom-events": "^1.1.1",
95
88
  "react-dom": "^18.2.0",
96
- "storybook-react-context": "^0.6.0",
89
+ "react-fast-compare": "^3.2.0",
90
+ "reacthub-react-bindings": "latest",
97
91
  "standard-version": "^9.5.0",
98
92
  "storybook": "^7.1.0",
93
+ "storybook-react-context": "^0.6.0",
99
94
  "stylelint": "^15.10.2",
100
- "stylelint-config-prettier": "^9.0.5",
101
- "stylelint-config-recommended-scss": "^11.0.0",
102
95
  "stylelint-config-standard": "^33.0.0",
96
+ "svgpath": "^2.6.0",
103
97
  "typescript": "^5.1.6",
104
98
  "typescript-plugin-css-modules": "^5.0.1",
105
99
  "vite": "^4.4.4",
106
100
  "vite-plugin-environment": "^1.1.3",
107
101
  "vite-plugin-stylelint": "^4.3.0",
108
102
  "vitest": "^0.30.1"
103
+ },
104
+ "dependencies": {
105
+ "@pixi/sound": "^5.2.1"
109
106
  }
110
107
  }
@@ -0,0 +1,51 @@
1
+ import * as React from "react";
2
+ import { AnimatedSprite as ReactPixiAnimatedSprite } from "@pixi/react";
3
+ import * as PIXI from "pixi.js";
4
+
5
+ type PixiAnimatedSpriteProps = {
6
+ forwardRef: any;
7
+ isPlaying: boolean;
8
+ images?: string[] | undefined;
9
+ initialFrame?: number | undefined;
10
+ scale?: number | [number, number];
11
+ x: number;
12
+ y: number;
13
+ width?: number;
14
+ height?: number;
15
+ anchor?: number;
16
+ rotation?: number;
17
+ alpha?: number;
18
+ animationSpeed?: number;
19
+ textures?: PIXI.Texture[] | undefined;
20
+ loop?: boolean;
21
+ onComplete?: () => void;
22
+ onFrameChange?: (currentFrame: number) => void;
23
+ };
24
+
25
+ const PixiAnimatedSpriteComp = ({
26
+ isPlaying,
27
+ forwardRef,
28
+ ...props
29
+ }: PixiAnimatedSpriteProps) => {
30
+ const animationSprite = React.useRef<any>(null);
31
+
32
+ React.useImperativeHandle(forwardRef, () => animationSprite.current!, [
33
+ animationSprite,
34
+ ]);
35
+
36
+ React.useEffect(() => {
37
+ if (animationSprite.current === null) return;
38
+ const sprite = animationSprite.current;
39
+ sprite[isPlaying ? "gotoAndPlay" : "gotoAndStop"](sprite.currentFrame);
40
+ }, [isPlaying]);
41
+
42
+ return (
43
+ <ReactPixiAnimatedSprite
44
+ ref={animationSprite}
45
+ {...props}
46
+ isPlaying={isPlaying}
47
+ />
48
+ );
49
+ };
50
+ const PixiAnimatedSprite = React.memo(PixiAnimatedSpriteComp);
51
+ export default PixiAnimatedSprite;
@@ -0,0 +1,2 @@
1
+ export { default as PixiAnimatedSprite } from "./PixiAnimatedSprite";
2
+ // Path: src\components\PixiAnimatedSprite\index.ts
@@ -0,0 +1,61 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { PixiAudioSprite } from ".";
3
+ import { AppStateContextProvider } from "../../utils/AppStateProvider";
4
+
5
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
6
+ const meta = {
7
+ title: "Components/AudioSprite",
8
+ component: PixiAudioSprite,
9
+
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ uniqueId: {
13
+ control: "text",
14
+ description: "uniqueId of the sprite",
15
+ },
16
+ src: {
17
+ control: "text",
18
+ description: "source of the image",
19
+ },
20
+ startAt: { control: "number", description: "startAt" },
21
+ endAt: { control: "number", description: "endAt" },
22
+ mute: { control: "boolean", description: "mute" },
23
+ speed: { control: "number", description: "speed" },
24
+ },
25
+ } satisfies Meta<typeof PixiAudioSprite>;
26
+
27
+ export default meta;
28
+ type Story = StoryObj<typeof meta>;
29
+
30
+ // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
31
+ export const Normal: Story = {
32
+ render: (args: any) => (
33
+ <AppStateContextProvider {...args}>
34
+ <PixiAudioSprite {...args} />
35
+ </AppStateContextProvider>
36
+ ),
37
+ args: {
38
+ uniqueId: "audio001", // uniqueId of the sprite
39
+ src: "https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/public%2Firfan%40trolio.com%2F6472d56e805c3bffc3cded33%2Fvideos%2F8Qq3DKrGnQ%2Fpiano2-CoolEdit.mp3",
40
+ startAt: 0,
41
+ endAt: 5,
42
+ mute: false,
43
+ speed: 1,
44
+ },
45
+ };
46
+
47
+ export const Customized: Story = {
48
+ render: (args: any) => (
49
+ <AppStateContextProvider {...args}>
50
+ <PixiAudioSprite {...args} />
51
+ </AppStateContextProvider>
52
+ ),
53
+ args: {
54
+ uniqueId: "audio002", // uniqueId of the sprite
55
+ src: "https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/public%2Firfan%40trolio.com%2F6472d56e805c3bffc3cded33%2Fvideos%2F8Qq3DKrGnQ%2Fpiano2-CoolEdit.mp3",
56
+ startAt: 0,
57
+ endAt: 5,
58
+ mute: true,
59
+ speed: 1,
60
+ },
61
+ };
@@ -0,0 +1,212 @@
1
+ import * as React from "react";
2
+ import { useContext, useEffect, useRef } from "react";
3
+ // @ts-ignore
4
+ import PropTypes from "prop-types";
5
+ import {
6
+ GsapPixieContext,
7
+ Events,
8
+ } from "../../providers/GsapPixieContextProvider";
9
+ import { Container, useApp } from "@pixi/react";
10
+ import { useCustomEventListener } from "react-custom-events";
11
+ import gsap from "gsap";
12
+ import { Sound } from "@pixi/sound";
13
+ import * as PIXI from "pixi.js";
14
+ // @ts-ignore
15
+ import isEmpty from "lodash/isEmpty";
16
+
17
+ type PixiAudioSpriteProps = {
18
+ uniqueId: string;
19
+ src: string;
20
+ startAt: number;
21
+ endAt: number;
22
+ mute: boolean;
23
+ speed: number;
24
+ };
25
+ interface AudioState {
26
+ isPlaying: boolean;
27
+ progress: number;
28
+ speed: number;
29
+ mute: boolean;
30
+ isWaiting: boolean;
31
+ loaded: boolean;
32
+ size: { width: number; height: number };
33
+ isDragging: boolean;
34
+ completed?: boolean;
35
+ }
36
+
37
+ const PixiAudioSprite: React.FC<PixiAudioSpriteProps> = (props) => {
38
+ const initialState: AudioState = {
39
+ isPlaying: false,
40
+ progress: 0,
41
+ speed: 1,
42
+ mute: false,
43
+ isWaiting: false,
44
+ loaded: false,
45
+ size: { width: 50, height: 50 },
46
+ isDragging: false,
47
+ };
48
+ //// State
49
+ const [isMounted, setIsMounted] = React.useState(false);
50
+
51
+ const audioStateRef = useRef<AudioState>(initialState);
52
+
53
+ console.log("allProps", props);
54
+ //// Refs
55
+ const containerRef = useRef<PIXI.Container>(null);
56
+ const imgGroupRef = useRef<PIXI.Container>(null);
57
+
58
+ //// Context
59
+ //// Context
60
+ const { tl, playerTimeRef } = useContext(GsapPixieContext);
61
+
62
+ /// 1001
63
+ // console.log("contxt Values", tl);
64
+ const { uniqueId, src, startAt, endAt, mute, speed, ...restProps } = props;
65
+
66
+ const app = useApp();
67
+ const audioContainerRef = React.useRef<Sound>(null);
68
+
69
+ /** Adding custom event listners */
70
+ /** Event Listeneres */
71
+ useCustomEventListener(Events.PAUSE, () => {
72
+ console.log("pause event");
73
+ if (containerRef.current) {
74
+ // @ts-ignore
75
+ audioContainerRef.current?.pause();
76
+ audioStateRef.current.isPlaying = false;
77
+ }
78
+ });
79
+
80
+ const gsapOnStart = (startAt: number) => {
81
+ if (containerRef.current) {
82
+ console.log("audio gsapOnStart", startAt);
83
+ if (playerTimeRef.current >= startAt && playerTimeRef.current <= endAt) {
84
+ // @ts-ignore
85
+ audioContainerRef.current?.play({
86
+ volume: mute ? 0 : 1,
87
+ start: startAt,
88
+ end: endAt,
89
+ speed: speed || 1,
90
+ });
91
+ audioStateRef.current.isPlaying = true;
92
+ audioStateRef.current.completed = false;
93
+ }
94
+ }
95
+ };
96
+
97
+ const gsapOnPause = (startAt: number) => {
98
+ if (containerRef.current) {
99
+ console.log("audio gsapOnStart", startAt);
100
+ // @ts-ignore
101
+ audioContainerRef.current?.pause();
102
+ audioStateRef.current.isPlaying = false;
103
+ }
104
+ };
105
+
106
+ const gsapOnComplete = () => {
107
+ if (containerRef.current) {
108
+ console.log("audio gsapOnStart", startAt);
109
+ // @ts-ignore
110
+ audioContainerRef.current?.stop();
111
+ audioStateRef.current.isPlaying = false;
112
+ audioStateRef.current.completed = true;
113
+ }
114
+ };
115
+
116
+ const gsapOnUpdate = (startAt: number) => {
117
+ if (
118
+ containerRef.current &&
119
+ !audioStateRef.current.isPlaying &&
120
+ !audioStateRef.current.completed
121
+ ) {
122
+ console.log("audio gsapOnUpdate", startAt);
123
+ // @ts-ignore
124
+ audioContainerRef.current?.refresh();
125
+ // @ts-ignore
126
+ audioContainerRef.current?.refreshPaused();
127
+
128
+ // @ts-ignore
129
+ audioContainerRef.current?.resume();
130
+ audioStateRef.current.isPlaying = true;
131
+ }
132
+ };
133
+
134
+ const onInterrupt = (startAt: number) => {};
135
+
136
+ useEffect(() => {
137
+ let ctx = gsap.context(() => {});
138
+ if (containerRef.current && tl.current) {
139
+ const data = {
140
+ duration: Number(endAt) - Number(startAt),
141
+ onStart: gsapOnStart,
142
+ onComplete: gsapOnComplete,
143
+ onStartParams: [startAt],
144
+ onCompleteParams: [],
145
+ onInterrupt: onInterrupt,
146
+ onUpdate: gsapOnUpdate,
147
+ onUpdateParams: [],
148
+ };
149
+ ctx = gsap.context(() => {
150
+ tl.current
151
+ .to(containerRef.current, { alpha: 1, duration: 0.01 }, startAt)
152
+ .from(imgGroupRef.current, { ...data }, startAt)
153
+ .to(
154
+ containerRef.current,
155
+ { alpha: 0, duration: 0.1 },
156
+ Number(endAt) - Number(0.1)
157
+ );
158
+ });
159
+ }
160
+ return () => ctx.revert(); // cleanup!
161
+ }, [startAt, endAt]);
162
+
163
+ React.useEffect(() => {
164
+ if (containerRef.current) {
165
+ setIsMounted(true);
166
+ }
167
+ }, []);
168
+
169
+ React.useEffect(() => {
170
+ if (containerRef.current && audioContainerRef.current) {
171
+ console.log("soundref", audioContainerRef.current);
172
+ // @ts-ignore
173
+ audioStateRef.current.mute = mute;
174
+ audioStateRef.current.speed = speed;
175
+ console.log("containerAudio", audioContainerRef.current.volume);
176
+ audioContainerRef.current.volume = mute ? 0 : 1;
177
+ }
178
+ }, [mute, speed]);
179
+
180
+ const onSoundLoaded = React.useCallback(
181
+ (err: any, sound: Sound | undefined) => {
182
+ //@ts-ignore
183
+ audioContainerRef.current = sound;
184
+ audioStateRef.current.loaded = true;
185
+ // const instance = sound.play();
186
+ },
187
+ []
188
+ );
189
+
190
+ React.useEffect(() => {
191
+ if (!isEmpty(src)) {
192
+ // @pixi/sound package usage
193
+ //@ts-ignore
194
+ audioContainerRef.current = Sound.from({
195
+ url: src,
196
+ preload: true,
197
+ singleInstance: true,
198
+ loaded: onSoundLoaded,
199
+ });
200
+ }
201
+ return () => {
202
+ // app.loader.reset();
203
+ };
204
+ }, [uniqueId, src, onSoundLoaded]);
205
+
206
+ return (
207
+ // @ts-ignore
208
+ <Container ref={containerRef}></Container>
209
+ );
210
+ };
211
+
212
+ export default PixiAudioSprite;
@@ -0,0 +1 @@
1
+ export { default as PixiAudioSprite } from "./PixiAudioSprite";
@@ -0,0 +1,135 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { PixiGifSprite } from ".";
3
+ import { AppStateContextProvider } from "../../utils/AppStateProvider";
4
+
5
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
6
+ const meta = {
7
+ title: "Components/GifSprite",
8
+ component: PixiGifSprite,
9
+
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ uniqueId: {
13
+ control: "text",
14
+ description: "uniqueId of the sprite",
15
+ },
16
+ src: {
17
+ control: "text",
18
+ description: "source of the image",
19
+ },
20
+ transformation: {
21
+ control: "object",
22
+ description: "transformation of the sprite",
23
+ x: { control: "number", description: "x position of the sprite" },
24
+ y: { control: "number", description: "y position of the sprite" },
25
+ width: { control: "number", description: "width of the sprite" },
26
+ height: { control: "number", description: "height of the sprite" },
27
+ anchor: { control: "number", description: "anchor of the sprite" },
28
+ rotation: { control: "number", description: "rotation of the sprite" },
29
+ alpha: {
30
+ control: "number",
31
+ min: 0,
32
+ max: 1,
33
+ description: "alpha of the sprite",
34
+ },
35
+ scale: { control: "number", description: "scale of the sprite" },
36
+ tint: { control: "number", description: "tint of the sprite" },
37
+ blendMode: { control: "number", description: "blendMode of the sprite" },
38
+ colorCorrection: {
39
+ control: "object",
40
+ description: "colorCorrection of the sprite",
41
+ brightness: {
42
+ control: "number",
43
+ description: "brightness of the sprite",
44
+ },
45
+ contrast: { control: "number", description: "contrast of the sprite" },
46
+ saturation: {
47
+ control: "number",
48
+ description: "saturation of the sprite",
49
+ },
50
+ alpha: { control: "number", description: "alpha of the sprite" },
51
+ },
52
+ },
53
+ applyTransformer: { control: "boolean", description: "applyTransformer" },
54
+ startAt: { control: "number", description: "startAt" },
55
+ endAt: { control: "number", description: "endAt" },
56
+ initialAlpha: {
57
+ control: "number",
58
+ min: 0,
59
+ max: 1,
60
+ description: "sprite initial alpha value (default 1)",
61
+ },
62
+ onAnchorTransformationEnd: {
63
+ action: "onAnchorTransformationEnd",
64
+ description:
65
+ "on transforamtion end the event is fire callback with latest sprite transformation properties.",
66
+ },
67
+ pointerdown: {
68
+ action: "pointerdown",
69
+ description: "pointerdown event",
70
+ },
71
+ pointerup: {
72
+ action: "pointerup",
73
+ description: "pointerup event",
74
+ },
75
+ mousedown: {
76
+ action: "mousedown",
77
+ description: "mousedown event",
78
+ },
79
+ mouseup: {
80
+ action: "mouseup",
81
+ description: "mouseup event",
82
+ },
83
+ pointerover: {
84
+ action: "pointerover",
85
+ description: "pointerover event",
86
+ },
87
+ mouseover: {
88
+ action: "mouseover",
89
+ description: "mouseover event",
90
+ },
91
+ mouseout: {
92
+ action: "mouseout",
93
+ description: "mouseout event",
94
+ },
95
+ pointerout: {
96
+ action: "pointerout",
97
+ description: "pointerout event",
98
+ },
99
+ },
100
+ } satisfies Meta<typeof PixiGifSprite>;
101
+
102
+ export default meta;
103
+ type Story = StoryObj<typeof meta>;
104
+
105
+ // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
106
+ export const Normal: Story = {
107
+ render: (args: any) => (
108
+ <AppStateContextProvider {...args}>
109
+ <PixiGifSprite {...args} />
110
+ </AppStateContextProvider>
111
+ ),
112
+ args: {
113
+ uniqueId: "suryaGify001", // uniqueId of the sprite
114
+ src: "https://media.giphy.com/media/5VKbvrjxpVJCM/giphy.gif",
115
+ locked: false,
116
+ loop: false,
117
+ transformation: {
118
+ x: 100,
119
+ y: 100,
120
+ width: 150,
121
+ height: 150,
122
+ anchor: 0.5,
123
+ rotation: 0,
124
+ alpha: 1,
125
+ scale: 1,
126
+ tint: 0xffffff,
127
+ blendMode: 0,
128
+ colorCorrection: {},
129
+ },
130
+ applyTransformer: false,
131
+ startAt: 0,
132
+ endAt: 4,
133
+ initialAlpha: 1,
134
+ },
135
+ };