reacthub-pixitweenjs 0.2.4 → 0.2.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.
Files changed (40) hide show
  1. package/.storybook/preview.tsx +6 -0
  2. package/CHANGELOG.md +27 -0
  3. package/README.md +1 -1
  4. package/build-storybook.log +79 -476
  5. package/package.json +29 -29
  6. package/src/components/PixiAnimatedSprite/PixiAnimatedSprite.tsx +51 -0
  7. package/src/components/PixiAnimatedSprite/index.ts +2 -0
  8. package/src/components/PixiAudioSprite/PixiAudioSprite.stories.tsx +61 -0
  9. package/src/components/PixiAudioSprite/PixiAudioSprite.tsx +202 -0
  10. package/src/components/PixiAudioSprite/index.ts +1 -0
  11. package/src/components/PixiGifSprite/PixiGifSprite.stories.tsx +135 -0
  12. package/src/components/PixiGifSprite/PixiGifSprite.tsx +372 -0
  13. package/src/components/PixiGifSprite/index.ts +2 -0
  14. package/src/components/PixiImageSprite/PixiImageSprite.stories.tsx +11 -0
  15. package/src/components/PixiImageSprite/PixiImageSprite.tsx +33 -70
  16. package/src/components/PixiSVGSprite/PixiSvgPathSprite.stories.tsx +137 -0
  17. package/src/components/PixiSVGSprite/PixiSvgPathSprite.tsx +346 -0
  18. package/src/components/PixiSVGSprite/index.ts +1 -0
  19. package/src/components/PixiTextSprite/PixiTextSprite.stories.tsx +176 -0
  20. package/src/components/PixiTextSprite/PixiTextSprite.tsx +540 -0
  21. package/src/components/PixiTextSprite/index.ts +1 -0
  22. package/src/components/PixiVideoSprite/PixiVideoSprite.stories.tsx +147 -0
  23. package/src/components/PixiVideoSprite/PixiVideoSprite.tsx +631 -0
  24. package/src/components/PixiVideoSprite/PixiVideoSpriteBackup.txt +755 -0
  25. package/src/components/PixiVideoSprite/index.ts +1 -0
  26. package/src/declare.module.ts +5 -0
  27. package/src/main.tsx +8 -7
  28. package/src/providers/GsapPixieContextProvider.tsx +102 -22
  29. package/src/reacthub-react-bindings.d.ts +27 -0
  30. package/src/stories/Installation.mdx +3 -3
  31. package/src/utils/AppStateProvider.tsx +18 -29
  32. package/src/utils/AppStateStage.tsx +1 -13
  33. package/src/utils/AppWrapper.tsx +4 -0
  34. package/src/utils/GsapAnim.tsx +1 -7
  35. package/src/utils/InteractionManager.tsx +36 -0
  36. package/src/utils/PixiStage.tsx +1 -5
  37. package/src/utils/PixiTransformer.tsx +165 -0
  38. package/src/utils/VideoSeekBar.tsx +35 -31
  39. package/src/utils/useDebounce.tsx +15 -0
  40. package/src/hooks/usePixiTransformer.tsx +0 -168
package/package.json CHANGED
@@ -1,18 +1,17 @@
1
1
  {
2
2
  "name": "reacthub-pixitweenjs",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
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,57 @@
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",
58
+ "@types/quill": "^2.0.10",
64
59
  "@types/react": "^18.2.15",
65
60
  "@types/react-dom": "^18.2.7",
66
61
  "@typescript-eslint/eslint-plugin": "^5.62.0",
67
62
  "@typescript-eslint/parser": "^5.62.0",
68
63
  "@vitejs/plugin-react": "^4.0.3",
69
64
  "@vitejs/plugin-react-swc": "^3.3.2",
70
- "@storybook/jest": "^0.1.0",
71
- "jsdom": "^21.1.2",
65
+ "@welldone-software/why-did-you-render": "^7.0.1",
66
+ "chromatic": "^6.7.3",
67
+ "debug": "^4.3.4",
68
+ "dotenv": "^16.0.1",
69
+ "env-cmd": "^10.1.0",
72
70
  "eslint": "^8.45.0",
73
71
  "eslint-config-airbnb": "^19.0.4",
74
72
  "eslint-config-airbnb-typescript": "^17.1.0",
75
73
  "eslint-plugin-react-hooks": "^4.6.0",
76
74
  "eslint-plugin-react-refresh": "^0.3.5",
77
75
  "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
76
  "framer-motion": "^8.4.0",
77
+ "gifuct-js": "^2.1.2",
84
78
  "gsap": "3.11.5",
79
+ "howler": "^2.2.3",
80
+ "jsdom": "^21.1.2",
85
81
  "lodash": "4.17.21",
86
82
  "msw": "^1.2.1",
87
83
  "msw-storybook-addon": "^1.8.0",
88
- "pixi-filters": "5.1.1",
89
- "pixi-svg": "3.2.0",
90
- "pixi.js": "6.5.9",
84
+ "pixi-filters": "^5.2.1",
85
+ "pixi-svg": "^3.2.0",
86
+ "pixi.js": "^7.2.3",
91
87
  "prop-types": "^15.8.1",
92
- "react-custom-events": "^1.1.1",
93
- "react-gsap": "^3.2.1",
88
+ "quill": "^1.3.7",
94
89
  "react": "^18.2.0",
90
+ "react-custom-events": "^1.1.1",
95
91
  "react-dom": "^18.2.0",
96
- "storybook-react-context": "^0.6.0",
92
+ "react-fast-compare": "^3.2.0",
93
+ "reacthub-react-bindings": "latest",
97
94
  "standard-version": "^9.5.0",
98
95
  "storybook": "^7.1.0",
96
+ "storybook-react-context": "^0.6.0",
99
97
  "stylelint": "^15.10.2",
100
- "stylelint-config-prettier": "^9.0.5",
101
- "stylelint-config-recommended-scss": "^11.0.0",
102
98
  "stylelint-config-standard": "^33.0.0",
99
+ "svgpath": "^2.6.0",
103
100
  "typescript": "^5.1.6",
104
101
  "typescript-plugin-css-modules": "^5.0.1",
105
102
  "vite": "^4.4.4",
106
103
  "vite-plugin-environment": "^1.1.3",
107
104
  "vite-plugin-stylelint": "^4.3.0",
108
105
  "vitest": "^0.30.1"
106
+ },
107
+ "dependencies": {
108
+ "@pixi/sound": "^5.2.1"
109
109
  }
110
110
  }
@@ -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,202 @@
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 } 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 [, 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 } = props;
65
+
66
+ const audioContainerRef = React.useRef<Sound>(null);
67
+
68
+ /** Adding custom event listners */
69
+ /** Event Listeneres */
70
+ useCustomEventListener(Events.PAUSE, () => {
71
+ console.log("pause event");
72
+ if (containerRef.current) {
73
+ // @ts-ignore
74
+ audioContainerRef.current?.pause();
75
+ audioStateRef.current.isPlaying = false;
76
+ }
77
+ });
78
+
79
+ const gsapOnStart = (startAt: number) => {
80
+ if (containerRef.current) {
81
+ console.log("audio gsapOnStart", startAt);
82
+ if (playerTimeRef.current >= startAt && playerTimeRef.current <= endAt) {
83
+ // @ts-ignore
84
+ audioContainerRef.current?.play({
85
+ volume: mute ? 0 : 1,
86
+ start: startAt,
87
+ end: endAt,
88
+ speed: speed || 1,
89
+ });
90
+ audioStateRef.current.isPlaying = true;
91
+ audioStateRef.current.completed = false;
92
+ }
93
+ }
94
+ };
95
+
96
+ const gsapOnComplete = () => {
97
+ if (containerRef.current) {
98
+ console.log("audio gsapOnStart", startAt);
99
+ // @ts-ignore
100
+ audioContainerRef.current?.stop();
101
+ audioStateRef.current.isPlaying = false;
102
+ audioStateRef.current.completed = true;
103
+ }
104
+ };
105
+
106
+ const gsapOnUpdate = (startAt: number) => {
107
+ if (
108
+ containerRef.current &&
109
+ !audioStateRef.current.isPlaying &&
110
+ !audioStateRef.current.completed
111
+ ) {
112
+ console.log("audio gsapOnUpdate", startAt);
113
+ // @ts-ignore
114
+ audioContainerRef.current?.refresh();
115
+ // @ts-ignore
116
+ audioContainerRef.current?.refreshPaused();
117
+
118
+ // @ts-ignore
119
+ audioContainerRef.current?.resume();
120
+ audioStateRef.current.isPlaying = true;
121
+ }
122
+ };
123
+
124
+ const onInterrupt = () => {};
125
+
126
+ useEffect(() => {
127
+ let ctx = gsap.context(() => {});
128
+ if (containerRef.current && tl.current) {
129
+ const data = {
130
+ duration: Number(endAt) - Number(startAt),
131
+ onStart: gsapOnStart,
132
+ onComplete: gsapOnComplete,
133
+ onStartParams: [startAt],
134
+ onCompleteParams: [],
135
+ onInterrupt: onInterrupt,
136
+ onUpdate: gsapOnUpdate,
137
+ onUpdateParams: [],
138
+ };
139
+ ctx = gsap.context(() => {
140
+ tl.current
141
+ .to(containerRef.current, { alpha: 1, duration: 0.01 }, startAt)
142
+ .from(imgGroupRef.current, { ...data }, startAt)
143
+ .to(
144
+ containerRef.current,
145
+ { alpha: 0, duration: 0.1 },
146
+ Number(endAt) - Number(0.1)
147
+ );
148
+ });
149
+ }
150
+ return () => ctx.revert(); // cleanup!
151
+ }, [startAt, endAt]);
152
+
153
+ React.useEffect(() => {
154
+ if (containerRef.current) {
155
+ setIsMounted(true);
156
+ }
157
+ }, []);
158
+
159
+ React.useEffect(() => {
160
+ if (containerRef.current && audioContainerRef.current) {
161
+ console.log("soundref", audioContainerRef.current);
162
+ // @ts-ignore
163
+ audioStateRef.current.mute = mute;
164
+ audioStateRef.current.speed = speed;
165
+ console.log("containerAudio", audioContainerRef.current.volume);
166
+ audioContainerRef.current.volume = mute ? 0 : 1;
167
+ }
168
+ }, [mute, speed]);
169
+
170
+ const onSoundLoaded = React.useCallback(
171
+ (_: any, sound: Sound | undefined) => {
172
+ //@ts-ignore
173
+ audioContainerRef.current = sound;
174
+ audioStateRef.current.loaded = true;
175
+ // const instance = sound.play();
176
+ },
177
+ []
178
+ );
179
+
180
+ React.useEffect(() => {
181
+ if (!isEmpty(src)) {
182
+ // @pixi/sound package usage
183
+ //@ts-ignore
184
+ audioContainerRef.current = Sound.from({
185
+ url: src,
186
+ preload: true,
187
+ singleInstance: true,
188
+ loaded: onSoundLoaded,
189
+ });
190
+ }
191
+ return () => {
192
+ // app.loader.reset();
193
+ };
194
+ }, [uniqueId, src, onSoundLoaded]);
195
+
196
+ return (
197
+ // @ts-ignore
198
+ <Container ref={containerRef}></Container>
199
+ );
200
+ };
201
+
202
+ 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
+ };