reacthub-pixitweenjs 0.2.3 → 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.
- package/.storybook/{main.js → main.ts} +9 -1
- package/.storybook/{preview.jsx → preview.tsx} +3 -7
- package/CHANGELOG.md +40 -0
- package/README.md +21 -2
- package/build-storybook.log +94 -0
- package/index.html +1 -1
- package/package.json +68 -36
- package/src/App.tsx +29 -0
- package/src/components/PixiAnimatedSprite/PixiAnimatedSprite.tsx +51 -0
- package/src/components/PixiAnimatedSprite/index.ts +2 -0
- package/src/components/PixiAudioSprite/PixiAudioSprite.stories.tsx +61 -0
- package/src/components/PixiAudioSprite/PixiAudioSprite.tsx +212 -0
- package/src/components/PixiAudioSprite/index.ts +1 -0
- package/src/components/PixiGifSprite/PixiGifSprite.stories.tsx +135 -0
- package/src/components/PixiGifSprite/PixiGifSprite.tsx +451 -0
- package/src/components/PixiGifSprite/index.ts +2 -0
- package/src/{stories/PixiImageSprite/PixiImageSprite.stories.js → components/PixiImageSprite/PixiImageSprite.stories.tsx} +36 -8
- package/src/components/PixiImageSprite/PixiImageSprite.tsx +340 -0
- package/src/components/PixiImageSprite/index.ts +1 -0
- package/src/components/PixiSVGSprite/PixiSvgPathSprite.stories.tsx +137 -0
- package/src/components/PixiSVGSprite/PixiSvgPathSprite.tsx +378 -0
- package/src/components/PixiSVGSprite/index.ts +1 -0
- package/src/components/PixiVideoSprite/PixiVideoSprite.stories.tsx +147 -0
- package/src/components/PixiVideoSprite/PixiVideoSprite.tsx +684 -0
- package/src/components/PixiVideoSprite/PixiVideoSpriteBackup.txt +755 -0
- package/src/components/PixiVideoSprite/index.ts +1 -0
- package/src/declare.module.ts +5 -0
- package/src/hooks/usePixiTransformer.tsx +168 -0
- package/src/index.ts +3 -0
- package/src/providers/GsapPixieContextProvider.tsx +251 -0
- package/src/providers/index.ts +1 -0
- package/src/reacthub-react-bindings.d.ts +27 -0
- package/src/types/transformation.tsx +13 -0
- package/src/utils/AppStateProvider.tsx +59 -0
- package/src/utils/AppStateStage.tsx +27 -0
- package/src/utils/AppWrapper.tsx +43 -0
- package/src/utils/ContextBridge.tsx +25 -0
- package/src/{providers/GsapAnim.jsx → utils/GsapAnim.tsx} +35 -4
- package/src/utils/PixiStage.tsx +29 -0
- package/src/utils/PixiTransformer.tsx +100 -0
- package/src/utils/VideoSeekBar.tsx +129 -0
- package/src/utils/useDebounce.tsx +15 -0
- package/src/utils/useDeepEffect.tsx +23 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +37 -0
- package/tsconfig.node.json +10 -0
- package/{vite.config.js → vite.config.ts} +4 -2
- package/vitest.config.ts +11 -0
- package/src/App.jsx +0 -35
- package/src/index.js +0 -3
- package/src/providers/ContextBridge.jsx +0 -67
- package/src/providers/GsapPixieContextProvider.jsx +0 -162
- package/src/providers/VideoSeekBar.jsx +0 -186
- package/src/providers/index.js +0 -3
- package/src/stories/PixiImageSprite/PixiImageSprite.jsx +0 -318
- package/src/stories/PixiImageSprite/index.js +0 -1
- /package/src/{main.jsx → main.tsx} +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @type { import('@storybook/react-vite').StorybookConfig } */
|
|
2
|
-
|
|
2
|
+
import type { StorybookConfig } from "@storybook/react-vite";
|
|
3
|
+
|
|
4
|
+
const config: StorybookConfig = {
|
|
3
5
|
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
|
4
6
|
staticDirs: ["../public"],
|
|
5
7
|
addons: [
|
|
@@ -19,5 +21,11 @@ const config = {
|
|
|
19
21
|
docs: {
|
|
20
22
|
autodocs: "tag",
|
|
21
23
|
},
|
|
24
|
+
core: {
|
|
25
|
+
builder: "@storybook/builder-vite",
|
|
26
|
+
},
|
|
27
|
+
async viteFinal(config) {
|
|
28
|
+
return config;
|
|
29
|
+
},
|
|
22
30
|
};
|
|
23
31
|
export default config;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AppWrapper } from "../src/utils/AppWrapper";
|
|
3
3
|
/** @type { import('@storybook/react').Preview } */
|
|
4
4
|
const preview = {
|
|
5
5
|
parameters: {
|
|
@@ -14,11 +14,7 @@ const preview = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export const decorators = [
|
|
17
|
-
(Story) => (
|
|
18
|
-
<App>
|
|
19
|
-
<Story />
|
|
20
|
-
</App>
|
|
21
|
-
),
|
|
17
|
+
(Story) => <AppWrapper>{Story({ appState: "x" })}</AppWrapper>,
|
|
22
18
|
];
|
|
23
19
|
|
|
24
20
|
export default preview;
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.2.5](https://github.com/khanzzirfan/reacthub-pixitweenjs/compare/v0.2.4...v0.2.5) (2023-08-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* audio sprite instance added ([be6333e](https://github.com/khanzzirfan/reacthub-pixitweenjs/commit/be6333e640b9449f3efa9afdb182aaa399344a65))
|
|
11
|
+
* Gif animation added to the library ([c4c5914](https://github.com/khanzzirfan/reacthub-pixitweenjs/commit/c4c5914069d5f1699d17a40167e3e928ccfd48bf))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* updated pixi svg sprite ([d462599](https://github.com/khanzzirfan/reacthub-pixitweenjs/commit/d462599b88f6151df32d9d4036d31bbb82236383))
|
|
17
|
+
* updated pixijs bindings and updated pixi libraries dependencies ([2d39ac7](https://github.com/khanzzirfan/reacthub-pixitweenjs/commit/2d39ac795a5a7d355d75642aa778b22c9a2ad2ce))
|
|
18
|
+
|
|
19
|
+
### [0.2.4](https://github.com/khanzzirfan/reacthub-gsap-pixiez/compare/v0.2.3...v0.2.4) (2023-07-23)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* image sprite component intialadded ([7d9c54e](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/7d9c54e90705ab778d1fc6abe4abc0021fd5f725))
|
|
25
|
+
* typescript initialized and converted all components ([e0ce358](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/e0ce358d3e99325413d3ab80121273e4ca5c1173))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* added state management to each story ([56f9da8](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/56f9da833d83fa532a5449e1bc595408d3d59168))
|
|
31
|
+
* added state management to each story ([5a1325c](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/5a1325c4c5c0369516ed4d77d5593d51ac8d32e4))
|
|
32
|
+
* applied transformers ([761f9a6](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/761f9a6daf859b6c9b48038d47e14d0b0171e01d))
|
|
33
|
+
* applied transformers ([6af3376](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/6af3376f9e45bbd148c6c2a6b10094866b062509))
|
|
34
|
+
* props updated ([dd7fd7b](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/dd7fd7b50b45d20efc8c9cf67d984da228905d38))
|
|
35
|
+
* props updated ([907b7f4](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/907b7f467fe051388d4fea7703611507e44a3dc4))
|
|
36
|
+
* props updated ([3ead9f5](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/3ead9f527a32258cbc05ac372600f3a44b51289a))
|
|
37
|
+
* props updated ([0579e77](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/0579e770b7e233b260243c5d764e1a061b638ead))
|
|
38
|
+
* props updated ([f0cda33](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/f0cda33fb5c7a3137d99277261a7f6ec83be61fd))
|
|
39
|
+
* story introduction ([554eeee](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/554eeee7c5c0ee346b6604f8b2c50070602779f2))
|
|
40
|
+
* story introduction ([a6e994d](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/a6e994db80719f96155155604f0d03ddbbd69a66))
|
|
41
|
+
* updated files ([47d34dd](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/47d34dd3357fb8f98f6a636536fb213ee1bd839b))
|
|
42
|
+
* updated storybook addons actions information ([5f3d377](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/5f3d377907be428a063b3032359604d5d31fb74e))
|
|
43
|
+
* updated storybook addons actions information ([81ad504](https://github.com/khanzzirfan/reacthub-gsap-pixiez/commit/81ad504226cd16efaed3c067d84e1df4bb89d6d5))
|
|
44
|
+
|
|
5
45
|
### [0.2.3](https://github.com/khanzzirfan/reacthub-gsap-pixiez/compare/v0.2.2...v0.2.3) (2023-07-20)
|
|
6
46
|
|
|
7
47
|
### [0.2.2](https://github.com/khanzzirfan/reacthub-gsap-pixiez/compare/v0.2.1...v0.2.2) (2023-07-20)
|
package/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
<h1 align="center">
|
|
3
2
|
Welcome to Reacthub PixiTweenJS
|
|
4
3
|
</h1>
|
|
@@ -13,9 +12,29 @@ To install the component packages using NPM/ Yarn:
|
|
|
13
12
|
yarn add reacthub-pixitweenjs
|
|
14
13
|
```
|
|
15
14
|
|
|
15
|
+
Make sure you install the devDependencies in your project.
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
npm install
|
|
19
|
+
"@pixi-essentials/react-bindings": "2.0.0",
|
|
20
|
+
"@pixi-essentials/transformer": "2.5.6",
|
|
21
|
+
"@pixi/assets": "6.5.9",
|
|
22
|
+
"@pixi/basis": "6.5.9",
|
|
23
|
+
"@pixi/filter-adjustment": "5.1.1",
|
|
24
|
+
"@pixi/gif": "1.1.3",
|
|
25
|
+
"@pixi/interaction": "6.5.9",
|
|
26
|
+
"@pixi/picture": "^3.0.3",
|
|
27
|
+
"@pixi/react": "7.0.0",
|
|
28
|
+
"@pixi/sound": "^4.3.1",
|
|
29
|
+
"pixi-filters": "5.1.1",
|
|
30
|
+
"pixi-svg": "3.2.0",
|
|
31
|
+
"pixi.js": "6.5.9",
|
|
32
|
+
```
|
|
33
|
+
|
|
16
34
|
## Description
|
|
35
|
+
|
|
17
36
|
PixiTweenJs is designed to help you build animated time-controlled canvas elements on web apps using extensible Pixijs Components underneath. The package composes the reacthub/pixitweenjs Web Component package. You can use these Web Components flexibly, either from npm packages, from the CDN, or you can bring it into your project to customize and extend it.
|
|
18
37
|
|
|
19
38
|
## Usage
|
|
20
|
-
Visit the storybook
|
|
21
39
|
|
|
40
|
+
Visit the [storybook](https://64b9d71094fa7aed0c7291cf-sinysbbbmx.chromatic.com/?path=/docs/components-imagesprite--docs)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
|
|
2
|
+
> reacthub-pixitweenjs@0.2.4 build-storybook
|
|
3
|
+
> storybook build
|
|
4
|
+
|
|
5
|
+
@storybook/cli v7.2.1
|
|
6
|
+
|
|
7
|
+
info => Cleaning outputDir: C:\Users\khanz\AppData\Local\Temp\chromatic--44868-JPYg4DLcQ0mH
|
|
8
|
+
info => Loading presets
|
|
9
|
+
info => Building manager..
|
|
10
|
+
info => Manager built (350 ms)
|
|
11
|
+
info => Copying static files: C:\code\Code\bitbuckets\storybook\reacthub-pixitweenjs\node_modules\@storybook\manager\static at C:\Users\khanz\AppData\Local\Temp\chromatic--44868-JPYg4DLcQ0mH\sb-common-assets
|
|
12
|
+
[36mvite v4.4.9 [32mbuilding for production...[36m[39m
|
|
13
|
+
|
|
14
|
+
./sb-common-assets/fonts.css doesn't exist at build time, it will remain unchanged to be resolved at runtime
|
|
15
|
+
transforming...
|
|
16
|
+
info => Copying static files: C:\code\Code\bitbuckets\storybook\reacthub-pixitweenjs\public at C:\Users\khanz\AppData\Local\Temp\chromatic--44868-JPYg4DLcQ0mH\
|
|
17
|
+
node_modules/telejson/dist/index.mjs (1394:15) Use of eval in "node_modules/telejson/dist/index.mjs" is strongly discouraged as it poses security risks and may cause issues with minification.
|
|
18
|
+
node_modules/telejson/dist/index.mjs (1397:18) Use of eval in "node_modules/telejson/dist/index.mjs" is strongly discouraged as it poses security risks and may cause issues with minification.
|
|
19
|
+
[32m✓[39m 2178 modules transformed.
|
|
20
|
+
rendering chunks...
|
|
21
|
+
computing gzip size...
|
|
22
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[32massets/direction-94a9917f.svg [39m[1m[2m 1.28 kB[22m[1m[22m[2m │ gzip: 0.71 kB[22m
|
|
23
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[32massets/flow-275142c6.svg [39m[1m[2m 1.39 kB[22m[1m[22m[2m │ gzip: 0.68 kB[22m
|
|
24
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[32massets/code-brackets-9ef6443e.svg [39m[1m[2m 1.46 kB[22m[1m[22m[2m │ gzip: 0.69 kB[22m
|
|
25
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[32massets/comments-f15a6837.svg [39m[1m[2m 1.53 kB[22m[1m[22m[2m │ gzip: 0.70 kB[22m
|
|
26
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[32massets/repo-fb4ece47.svg [39m[1m[2m 1.64 kB[22m[1m[22m[2m │ gzip: 0.83 kB[22m
|
|
27
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[32massets/plugin-57148314.svg [39m[1m[2m 2.17 kB[22m[1m[22m[2m │ gzip: 0.98 kB[22m
|
|
28
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[32massets/stackalt-2ad81543.svg [39m[1m[2m 2.55 kB[22m[1m[22m[2m │ gzip: 1.09 kB[22m
|
|
29
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[32massets/colors-ac9401f3.svg [39m[1m[2m 8.51 kB[22m[1m[22m[2m │ gzip: 3.61 kB[22m
|
|
30
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[32miframe.html [39m[1m[2m 12.74 kB[22m[1m[22m[2m │ gzip: 3.56 kB[22m
|
|
31
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-d475d2ea.js [39m[1m[2m 0.21 kB[22m[1m[22m[2m │ gzip: 0.17 kB[22m[2m │ map: 0.84 kB[22m
|
|
32
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-aefaebb0.js [39m[1m[2m 0.25 kB[22m[1m[22m[2m │ gzip: 0.20 kB[22m[2m │ map: 0.10 kB[22m
|
|
33
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/chunk-MSDTXLE7-e8876087.js [39m[1m[2m 0.33 kB[22m[1m[22m[2m │ gzip: 0.28 kB[22m[2m │ map: 1.29 kB[22m
|
|
34
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/extends-a5793c18.js [39m[1m[2m 0.46 kB[22m[1m[22m[2m │ gzip: 0.33 kB[22m[2m │ map: 2.00 kB[22m
|
|
35
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-e744116c.js [39m[1m[2m 0.53 kB[22m[1m[22m[2m │ gzip: 0.34 kB[22m[2m │ map: 4.29 kB[22m
|
|
36
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/WithTooltip-YBG737T3-8386b405.js [39m[1m[2m 0.54 kB[22m[1m[22m[2m │ gzip: 0.31 kB[22m[2m │ map: 0.11 kB[22m
|
|
37
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/syntaxhighlighter-4OVWVELQ-97d9e0b2.js [39m[1m[2m 0.56 kB[22m[1m[22m[2m │ gzip: 0.33 kB[22m[2m │ map: 0.12 kB[22m
|
|
38
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/react-18-0f8fd3cb.js [39m[1m[2m 0.59 kB[22m[1m[22m[2m │ gzip: 0.38 kB[22m[2m │ map: 2.65 kB[22m
|
|
39
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/preview-ddf73cda.js [39m[1m[2m 0.64 kB[22m[1m[22m[2m │ gzip: 0.38 kB[22m[2m │ map: 0.54 kB[22m
|
|
40
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/preview-5ef354f3.js [39m[1m[2m 0.69 kB[22m[1m[22m[2m │ gzip: 0.49 kB[22m[2m │ map: 3.93 kB[22m
|
|
41
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/_commonjsHelpers-de833af9.js [39m[1m[2m 0.75 kB[22m[1m[22m[2m │ gzip: 0.43 kB[22m[2m │ map: 0.11 kB[22m
|
|
42
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-356e4a49.js [39m[1m[2m 0.81 kB[22m[1m[22m[2m │ gzip: 0.51 kB[22m[2m │ map: 3.28 kB[22m
|
|
43
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-8d47fad6.js [39m[1m[2m 0.84 kB[22m[1m[22m[2m │ gzip: 0.55 kB[22m[2m │ map: 4.14 kB[22m
|
|
44
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/preview-b79ea209.js [39m[1m[2m 0.90 kB[22m[1m[22m[2m │ gzip: 0.60 kB[22m[2m │ map: 2.96 kB[22m
|
|
45
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/jsx-runtime-4ca860c5.js [39m[1m[2m 0.97 kB[22m[1m[22m[2m │ gzip: 0.61 kB[22m[2m │ map: 2.33 kB[22m
|
|
46
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/DocsRenderer-3PUGWF3O-731fd7e2.js [39m[1m[2m 1.40 kB[22m[1m[22m[2m │ gzip: 0.75 kB[22m[2m │ map: 2.60 kB[22m
|
|
47
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Installation-e42280fa.js [39m[1m[2m 1.80 kB[22m[1m[22m[2m │ gzip: 0.81 kB[22m[2m │ map: 2.48 kB[22m
|
|
48
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/preview-a60aa466.js [39m[1m[2m 2.40 kB[22m[1m[22m[2m │ gzip: 1.25 kB[22m[2m │ map: 11.11 kB[22m
|
|
49
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-d37d4223.js [39m[1m[2m 2.63 kB[22m[1m[22m[2m │ gzip: 1.30 kB[22m[2m │ map: 7.49 kB[22m
|
|
50
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Git-DZ2D5ZUL-6ca74cd2.js [39m[1m[2m 3.06 kB[22m[1m[22m[2m │ gzip: 1.00 kB[22m[2m │ map: 7.21 kB[22m
|
|
51
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/preview-770cc08b.js [39m[1m[2m 3.22 kB[22m[1m[22m[2m │ gzip: 1.39 kB[22m[2m │ map: 10.25 kB[22m
|
|
52
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/AppStateProvider-98b23489.js [39m[1m[2m 3.39 kB[22m[1m[22m[2m │ gzip: 1.45 kB[22m[2m │ map: 14.42 kB[22m
|
|
53
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Editing-7QFB6ZMG-a75b9a4e.js [39m[1m[2m 4.02 kB[22m[1m[22m[2m │ gzip: 1.12 kB[22m[2m │ map: 10.11 kB[22m
|
|
54
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/_getTag-0ebf12fe.js [39m[1m[2m 5.05 kB[22m[1m[22m[2m │ gzip: 2.30 kB[22m[2m │ map: 36.86 kB[22m
|
|
55
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/OS-YZ2Y4VYS-57059e39.js [39m[1m[2m 5.57 kB[22m[1m[22m[2m │ gzip: 2.20 kB[22m[2m │ map: 9.94 kB[22m
|
|
56
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Introduction-def93083.js [39m[1m[2m 5.60 kB[22m[1m[22m[2m │ gzip: 2.14 kB[22m[2m │ map: 7.06 kB[22m
|
|
57
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/iframe-d69fca24.js [39m[1m[2m 6.95 kB[22m[1m[22m[2m │ gzip: 1.98 kB[22m[2m │ map: 6.18 kB[22m
|
|
58
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-61bf1805.js [39m[1m[2m 7.21 kB[22m[1m[22m[2m │ gzip: 2.95 kB[22m[2m │ map: 15.75 kB[22m
|
|
59
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/People-OD4EV7WZ-e23c0f1f.js [39m[1m[2m 7.64 kB[22m[1m[22m[2m │ gzip: 2.20 kB[22m[2m │ map: 16.31 kB[22m
|
|
60
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/preview-d8c963a4.js [39m[1m[2m 7.67 kB[22m[1m[22m[2m │ gzip: 1.60 kB[22m[2m │ map: 14.23 kB[22m
|
|
61
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Documents-SGWAY3KW-a46f097b.js [39m[1m[2m 8.11 kB[22m[1m[22m[2m │ gzip: 1.61 kB[22m[2m │ map: 20.07 kB[22m
|
|
62
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/preview-25cb0eda.js [39m[1m[2m 8.33 kB[22m[1m[22m[2m │ gzip: 3.21 kB[22m[2m │ map: 29.44 kB[22m
|
|
63
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/PixiImageSprite.stories-7e5a4f44.js [39m[1m[2m 9.26 kB[22m[1m[22m[2m │ gzip: 2.66 kB[22m[2m │ map: 14.69 kB[22m
|
|
64
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Devices-SUYACUPO-5f5f7f3c.js [39m[1m[2m 11.12 kB[22m[1m[22m[2m │ gzip: 2.43 kB[22m[2m │ map: 24.80 kB[22m
|
|
65
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/_baseForOwn-bcc012ac.js [39m[1m[2m 12.26 kB[22m[1m[22m[2m │ gzip: 5.09 kB[22m[2m │ map: 97.95 kB[22m
|
|
66
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/PixiVideoSprite.stories-4587bff3.js [39m[1m[2m 13.85 kB[22m[1m[22m[2m │ gzip: 3.94 kB[22m[2m │ map: 31.90 kB[22m
|
|
67
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/GlobalScrollAreaStyles-4LLX2B3H-865623c6.js [39m[1m[2m 15.15 kB[22m[1m[22m[2m │ gzip: 2.85 kB[22m[2m │ map: 21.44 kB[22m
|
|
68
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Logos-SJTNNI74-dfca754f.js [39m[1m[2m 15.65 kB[22m[1m[22m[2m │ gzip: 5.34 kB[22m[2m │ map: 30.02 kB[22m
|
|
69
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Wayfinding-BB4H7CHP-0d20a672.js [39m[1m[2m 19.02 kB[22m[1m[22m[2m │ gzip: 3.75 kB[22m[2m │ map: 47.57 kB[22m
|
|
70
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Images-S2WTXNGG-1424b253.js [39m[1m[2m 20.72 kB[22m[1m[22m[2m │ gzip: 4.41 kB[22m[2m │ map: 49.06 kB[22m
|
|
71
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/preview-d06fc6bf.js [39m[1m[2m 21.08 kB[22m[1m[22m[2m │ gzip: 6.99 kB[22m[2m │ map: 68.34 kB[22m
|
|
72
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Communicate-7JXCND2Z-d3f800fa.js [39m[1m[2m 25.15 kB[22m[1m[22m[2m │ gzip: 6.58 kB[22m[2m │ map: 52.59 kB[22m
|
|
73
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/CRUD-I5EZL2FS-97d62e3d.js [39m[1m[2m 26.35 kB[22m[1m[22m[2m │ gzip: 5.92 kB[22m[2m │ map: 59.47 kB[22m
|
|
74
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/PixiGifSprite.stories-8b08b093.js [39m[1m[2m 26.94 kB[22m[1m[22m[2m │ gzip: 8.65 kB[22m[2m │ map: 78.57 kB[22m
|
|
75
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/OverlayScrollbars-OL4C4TVX-03af70e8.js [39m[1m[2m 28.95 kB[22m[1m[22m[2m │ gzip: 14.20 kB[22m[2m │ map: 108.16 kB[22m
|
|
76
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/PixiAudioSprite.stories-404cbd17.js [39m[1m[2m 29.91 kB[22m[1m[22m[2m │ gzip: 8.32 kB[22m[2m │ map: 99.78 kB[22m
|
|
77
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/Color-6VNJS4EI-223d643c.js [39m[1m[2m 31.16 kB[22m[1m[22m[2m │ gzip: 11.69 kB[22m[2m │ map: 112.86 kB[22m
|
|
78
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/GsapAnim-96ba73b9.js [39m[1m[2m 36.15 kB[22m[1m[22m[2m │ gzip: 9.84 kB[22m[2m │ map: 160.28 kB[22m
|
|
79
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/PixiSvgPathSprite.stories-4715883c.js [39m[1m[2m 46.25 kB[22m[1m[22m[2m │ gzip: 15.72 kB[22m[2m │ map: 175.56 kB[22m
|
|
80
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-52fb8234.js [39m[1m[2m 61.08 kB[22m[1m[22m[2m │ gzip: 16.39 kB[22m[2m │ map: 190.97 kB[22m
|
|
81
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/HTMLText-f020e808.js [39m[1m[2m 95.94 kB[22m[1m[22m[2m │ gzip: 28.08 kB[22m[2m │ map: 298.45 kB[22m
|
|
82
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-2801d3c9.js [39m[1m[2m134.11 kB[22m[1m[22m[2m │ gzip: 43.23 kB[22m[2m │ map: 328.91 kB[22m
|
|
83
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/config-d8b72d70.js [39m[1m[2m213.58 kB[22m[1m[22m[2m │ gzip: 66.40 kB[22m[2m │ map: 803.98 kB[22m
|
|
84
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/preview-d1ad52e5.js [39m[1m[2m303.45 kB[22m[1m[22m[2m │ gzip: 102.80 kB[22m[2m │ map: 1,477.73 kB[22m
|
|
85
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/module-28e6bed8.js [39m[1m[33m569.49 kB[39m[22m[2m │ gzip: 180.91 kB[22m[2m │ map: 1,986.99 kB[22m
|
|
86
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/formatter-ZNWCFYAW-da868a3a.js [39m[1m[33m601.74 kB[39m[22m[2m │ gzip: 185.08 kB[22m[2m │ map: 1,318.63 kB[22m
|
|
87
|
+
[2m../../../../../Users/khanz/AppData/Local/Temp/chromatic--44868-JPYg4DLcQ0mH/[22m[36massets/index-ab5a789e.js [39m[1m[33m640.33 kB[39m[22m[2m │ gzip: 195.67 kB[22m[2m │ map: 1,968.70 kB[22m
|
|
88
|
+
[33m
|
|
89
|
+
(!) Some chunks are larger than 500 kBs after minification. Consider:
|
|
90
|
+
- Using dynamic import() to code-split the application
|
|
91
|
+
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
|
|
92
|
+
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.[39m
|
|
93
|
+
[32m✓ built in 29.71s[39m
|
|
94
|
+
info => Output directory: C:\Users\khanz\AppData\Local\Temp\chromatic--44868-JPYg4DLcQ0mH
|
package/index.html
CHANGED
package/package.json
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reacthub-pixitweenjs",
|
|
3
|
-
"version": "0.2.
|
|
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-
|
|
9
|
+
"url": "https://github.com/khanzzirfan/reacthub-pixitweenjs"
|
|
10
10
|
},
|
|
11
11
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/khanzzirfan/reacthub-
|
|
12
|
+
"url": "https://github.com/khanzzirfan/reacthub-pixitweenjs"
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"react": "^18.2.0",
|
|
17
|
-
"react-dom": "^18.2.0"
|
|
18
|
-
},
|
|
19
15
|
"scripts": {
|
|
20
16
|
"dev": "vite",
|
|
21
|
-
"build": "vite build",
|
|
17
|
+
"build": "tsc && vite build",
|
|
18
|
+
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
19
|
+
"lint:fix": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
|
|
20
|
+
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md}\"",
|
|
22
21
|
"preview": "vite preview",
|
|
22
|
+
"test": "vitest",
|
|
23
23
|
"storybook": "storybook dev -p 6006",
|
|
24
24
|
"start": "npm run storybook",
|
|
25
25
|
"build-storybook": "storybook build",
|
|
26
26
|
"init-msw": "msw init public/",
|
|
27
|
-
"release": "standard-version --release-as patch &&npm publish"
|
|
27
|
+
"release": "standard-version --release-as patch &&npm publish",
|
|
28
|
+
"chromatic": "env-cmd -f .env.dev chromatic"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@chakra-ui/icons": "^2.0.15",
|
|
@@ -34,42 +35,73 @@
|
|
|
34
35
|
"@giphy/js-fetch-api": "^4.1.2",
|
|
35
36
|
"@giphy/js-types": "^4.1.0",
|
|
36
37
|
"@giphy/react-components": "^5.6.1",
|
|
37
|
-
"@pixi
|
|
38
|
-
"@pixi-
|
|
39
|
-
"@pixi/
|
|
40
|
-
"@pixi/basis": "6.5.9",
|
|
41
|
-
"@pixi/filter-adjustment": "5.1.1",
|
|
42
|
-
"@pixi/gif": "1.1.3",
|
|
43
|
-
"@pixi/interaction": "6.5.9",
|
|
44
|
-
"@pixi/picture": "^3.0.3",
|
|
45
|
-
"@pixi/react": "7.0.0",
|
|
46
|
-
"@pixi/sound": "^4.3.1",
|
|
38
|
+
"@pixi/assets": "^7.2.3",
|
|
39
|
+
"@pixi/filter-adjustment": "^5.1.1",
|
|
40
|
+
"@pixi/react": "~7.1.0",
|
|
47
41
|
"@react-gifs/tools": "^0.1.2",
|
|
48
|
-
"@storybook/addon-essentials": "^7.0
|
|
49
|
-
"@storybook/addon-interactions": "^7.0
|
|
50
|
-
"@storybook/addon-links": "^7.0
|
|
51
|
-
"@storybook/
|
|
42
|
+
"@storybook/addon-essentials": "^7.1.0",
|
|
43
|
+
"@storybook/addon-interactions": "^7.1.0",
|
|
44
|
+
"@storybook/addon-links": "^7.1.0",
|
|
45
|
+
"@storybook/addon-onboarding": "^1.0.7",
|
|
46
|
+
"@storybook/addon-styling": "^1.3.4",
|
|
47
|
+
"@storybook/blocks": "^7.1.0",
|
|
48
|
+
"@storybook/builder-vite": "^7.1.0",
|
|
52
49
|
"@storybook/jest": "^0.1.0",
|
|
53
|
-
"@storybook/react": "^7.0
|
|
54
|
-
"@storybook/react-vite": "^7.0
|
|
55
|
-
"@storybook/testing-library": "^0.0
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
50
|
+
"@storybook/react": "^7.1.0",
|
|
51
|
+
"@storybook/react-vite": "^7.1.0",
|
|
52
|
+
"@storybook/testing-library": "^0.2.0",
|
|
53
|
+
"@testing-library/dom": "^9.3.1",
|
|
54
|
+
"@testing-library/jest-dom": "^5.17.0",
|
|
55
|
+
"@testing-library/react": "^14.0.0",
|
|
56
|
+
"@types/dotenv": "^8.2.0",
|
|
57
|
+
"@types/howler": "^2.2.8",
|
|
58
|
+
"@types/react": "^18.2.15",
|
|
59
|
+
"@types/react-dom": "^18.2.7",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
61
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
62
|
+
"@vitejs/plugin-react": "^4.0.3",
|
|
63
|
+
"@vitejs/plugin-react-swc": "^3.3.2",
|
|
64
|
+
"chromatic": "^6.7.3",
|
|
65
|
+
"debug": "^4.3.4",
|
|
66
|
+
"dotenv": "^16.0.1",
|
|
67
|
+
"env-cmd": "^10.1.0",
|
|
68
|
+
"eslint": "^8.45.0",
|
|
69
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
70
|
+
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
71
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
72
|
+
"eslint-plugin-react-refresh": "^0.3.5",
|
|
73
|
+
"eslint-plugin-storybook": "^0.6.12",
|
|
59
74
|
"framer-motion": "^8.4.0",
|
|
75
|
+
"gifuct-js": "^2.1.2",
|
|
60
76
|
"gsap": "3.11.5",
|
|
77
|
+
"howler": "^2.2.3",
|
|
78
|
+
"jsdom": "^21.1.2",
|
|
61
79
|
"lodash": "4.17.21",
|
|
62
80
|
"msw": "^1.2.1",
|
|
63
81
|
"msw-storybook-addon": "^1.8.0",
|
|
64
|
-
"pixi-filters": "5.
|
|
65
|
-
"pixi-svg": "3.2.0",
|
|
66
|
-
"pixi.js": "
|
|
82
|
+
"pixi-filters": "^5.2.1",
|
|
83
|
+
"pixi-svg": "^3.2.0",
|
|
84
|
+
"pixi.js": "^7.2.3",
|
|
67
85
|
"prop-types": "^15.8.1",
|
|
86
|
+
"react": "^18.2.0",
|
|
68
87
|
"react-custom-events": "^1.1.1",
|
|
69
|
-
"react-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
88
|
+
"react-dom": "^18.2.0",
|
|
89
|
+
"react-fast-compare": "^3.2.0",
|
|
90
|
+
"reacthub-react-bindings": "latest",
|
|
72
91
|
"standard-version": "^9.5.0",
|
|
73
|
-
"
|
|
92
|
+
"storybook": "^7.1.0",
|
|
93
|
+
"storybook-react-context": "^0.6.0",
|
|
94
|
+
"stylelint": "^15.10.2",
|
|
95
|
+
"stylelint-config-standard": "^33.0.0",
|
|
96
|
+
"svgpath": "^2.6.0",
|
|
97
|
+
"typescript": "^5.1.6",
|
|
98
|
+
"typescript-plugin-css-modules": "^5.0.1",
|
|
99
|
+
"vite": "^4.4.4",
|
|
100
|
+
"vite-plugin-environment": "^1.1.3",
|
|
101
|
+
"vite-plugin-stylelint": "^4.3.0",
|
|
102
|
+
"vitest": "^0.30.1"
|
|
103
|
+
},
|
|
104
|
+
"dependencies": {
|
|
105
|
+
"@pixi/sound": "^5.2.1"
|
|
74
106
|
}
|
|
75
107
|
}
|
package/src/App.tsx
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import "./App.css";
|
|
3
|
+
|
|
4
|
+
function App() {
|
|
5
|
+
const [count, setCount] = useState(0);
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className="App">
|
|
9
|
+
<div>
|
|
10
|
+
<a href="https://vitejs.dev" target="_blank"></a>
|
|
11
|
+
<a href="https://reactjs.org" target="_blank"></a>
|
|
12
|
+
</div>
|
|
13
|
+
<h1>Vite + React</h1>
|
|
14
|
+
<div className="card">
|
|
15
|
+
<button onClick={() => setCount((count) => count + 1)}>
|
|
16
|
+
count is {count}
|
|
17
|
+
</button>
|
|
18
|
+
<p>
|
|
19
|
+
Edit <code>src/App.jsx</code> and save to test HMR
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
<p className="read-the-docs">
|
|
23
|
+
Click on the Vite and React logos to learn more
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default App;
|
|
@@ -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,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
|
+
};
|