reacthub-pixitweenjs 0.2.9 → 0.2.11

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 (86) hide show
  1. package/package.json +4 -1
  2. package/.storybook/main.ts +0 -31
  3. package/.storybook/preview.tsx +0 -26
  4. package/CHANGELOG.md +0 -98
  5. package/build-storybook.log +0 -94
  6. package/index.html +0 -13
  7. package/public/vite.svg +0 -1
  8. package/src/App.css +0 -42
  9. package/src/App.tsx +0 -29
  10. package/src/assets/font/OpenSans-Light-webfont.eot +0 -0
  11. package/src/assets/font/OpenSans-Light-webfont.svg +0 -252
  12. package/src/assets/font/OpenSans-Light-webfont.ttf +0 -0
  13. package/src/assets/font/OpenSans-Light-webfont.woff +0 -0
  14. package/src/assets/font/OpenSans-Regular-webfont.eot +0 -0
  15. package/src/assets/font/OpenSans-Regular-webfont.svg +0 -252
  16. package/src/assets/font/OpenSans-Regular-webfont.ttf +0 -0
  17. package/src/assets/font/OpenSans-Regular-webfont.woff +0 -0
  18. package/src/assets/icon/percolate.eot +0 -0
  19. package/src/assets/icon/percolate.svg +0 -139
  20. package/src/assets/icon/percolate.ttf +0 -0
  21. package/src/assets/icon/percolate.woff +0 -0
  22. package/src/assets/react.svg +0 -1
  23. package/src/components/PixiAnimatedSprite/PixiAnimatedSprite.tsx +0 -51
  24. package/src/components/PixiAnimatedSprite/index.ts +0 -2
  25. package/src/components/PixiAudioSprite/PixiAudioSprite.stories.tsx +0 -61
  26. package/src/components/PixiAudioSprite/PixiAudioSprite.tsx +0 -202
  27. package/src/components/PixiAudioSprite/index.ts +0 -1
  28. package/src/components/PixiGifSprite/PixiGifSprite.stories.tsx +0 -172
  29. package/src/components/PixiGifSprite/PixiGifSprite.tsx +0 -420
  30. package/src/components/PixiGifSprite/index.ts +0 -2
  31. package/src/components/PixiImageSprite/PixiImageSprite.stories.tsx +0 -220
  32. package/src/components/PixiImageSprite/PixiImageSprite.tsx +0 -60
  33. package/src/components/PixiImageSprite/index.ts +0 -1
  34. package/src/components/PixiSVGSprite/PixiSvgPathSprite.stories.tsx +0 -174
  35. package/src/components/PixiSVGSprite/PixiSvgPathSprite.tsx +0 -158
  36. package/src/components/PixiSVGSprite/index.ts +0 -1
  37. package/src/components/PixiTextSprite/PixiTextSprite.stories.tsx +0 -228
  38. package/src/components/PixiTextSprite/PixiTextSprite.tsx +0 -361
  39. package/src/components/PixiTextSprite/index.ts +0 -1
  40. package/src/components/PixiVideoSprite/PixiVideoSprite.stories.tsx +0 -186
  41. package/src/components/PixiVideoSprite/PixiVideoSprite.tsx +0 -595
  42. package/src/components/PixiVideoSprite/PixiVideoSpriteBackup.txt +0 -755
  43. package/src/components/PixiVideoSprite/index.ts +0 -1
  44. package/src/components/index.ts +0 -7
  45. package/src/declare.module.ts +0 -5
  46. package/src/hocs/AbstractContainer.tsx +0 -199
  47. package/src/hocs/WithFilterContainer.tsx +0 -159
  48. package/src/index.css +0 -457
  49. package/src/index.ts +0 -3
  50. package/src/main.tsx +0 -11
  51. package/src/providers/GsapPixieContextProvider.tsx +0 -245
  52. package/src/providers/index.ts +0 -1
  53. package/src/reacthub-react-bindings.d.ts +0 -27
  54. package/src/stories/Installation.mdx +0 -40
  55. package/src/stories/Introduction.mdx +0 -140
  56. package/src/stories/assets/code-brackets.svg +0 -1
  57. package/src/stories/assets/colors.svg +0 -1
  58. package/src/stories/assets/comments.svg +0 -1
  59. package/src/stories/assets/direction.svg +0 -1
  60. package/src/stories/assets/flow.svg +0 -1
  61. package/src/stories/assets/plugin.svg +0 -1
  62. package/src/stories/assets/repo.svg +0 -1
  63. package/src/stories/assets/stackalt.svg +0 -1
  64. package/src/types/Animations.tsx +0 -41
  65. package/src/types/BaseProps.tsx +0 -56
  66. package/src/types/BlendModes.tsx +0 -19
  67. package/src/types/Effects.tsx +0 -11
  68. package/src/types/transformation.tsx +0 -13
  69. package/src/utils/AppStateProvider.tsx +0 -59
  70. package/src/utils/AppStateStage.tsx +0 -15
  71. package/src/utils/AppWrapper.tsx +0 -47
  72. package/src/utils/ContextBridge.tsx +0 -25
  73. package/src/utils/GsapAnim.tsx +0 -107
  74. package/src/utils/InteractionManager.tsx +0 -36
  75. package/src/utils/PixiStage.tsx +0 -29
  76. package/src/utils/PixiTransformer.tsx +0 -165
  77. package/src/utils/VideoSeekBar.tsx +0 -122
  78. package/src/utils/useDebounce.tsx +0 -15
  79. package/src/utils/useDeepEffect.tsx +0 -23
  80. package/src/vite-env.d.ts +0 -1
  81. package/tsconfig.json +0 -37
  82. package/tsconfig.node.json +0 -10
  83. package/vite.config.ts +0 -39
  84. package/vitest.config.ts +0 -11
  85. /package/dist/{reacthub-pixitweenjs.es.js → index.es.js} +0 -0
  86. /package/dist/{reacthub-pixitweenjs.umd.js → index.umd.js} +0 -0
@@ -1,174 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { PixiSvgPathSprite } 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/SvgSprite",
8
- component: PixiSvgPathSprite,
9
-
10
- tags: ["autodocs"],
11
- argTypes: {
12
- uniqueId: {
13
- control: "text",
14
- description: "uniqueId of the sprite",
15
- },
16
- path: {
17
- control: "text",
18
- description: "source of the svg path",
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
- },
72
- } satisfies Meta<typeof PixiSvgPathSprite>;
73
-
74
- export default meta;
75
- type Story = StoryObj<typeof meta>;
76
-
77
- // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
78
- export const Normal: Story = {
79
- render: (args: any) => (
80
- <AppStateContextProvider {...args}>
81
- <PixiSvgPathSprite {...args} />
82
- </AppStateContextProvider>
83
- ),
84
- args: {
85
- uniqueId: "svg001", // uniqueId of the sprite
86
- path: "M 100 100 L 300 100 L 200 300 z",
87
- applyTransformer: false,
88
- startAt: 0,
89
- endAt: 10,
90
- transformation: {
91
- x: 200,
92
- y: 200,
93
- width: 200,
94
- height: 200,
95
- anchor: 0.5,
96
- rotation: 0,
97
- alpha: 1,
98
- scale: 1,
99
- tint: 0xffffff,
100
- blendMode: 0,
101
- colorCorrection: {},
102
- fill: "#FFC0CB",
103
- },
104
- initialAlpha: 1,
105
- },
106
- };
107
-
108
- export const FadeIn: Story = {
109
- render: (args: any) => (
110
- <AppStateContextProvider {...args}>
111
- <PixiSvgPathSprite {...args} />
112
- </AppStateContextProvider>
113
- ),
114
- args: {
115
- uniqueId: "surya002", // uniqueId of the sprite
116
- path: "M 100, 100 m -75, 0 a 75,75 0 1,0 150,0 a 75,75 0 1,0 -150,0",
117
- applyTransformer: false,
118
- startAt: 0,
119
- endAt: 10,
120
- transformation: {
121
- x: 200,
122
- y: 200,
123
- width: 200,
124
- height: 200,
125
- anchor: 0.5,
126
- rotation: 0,
127
- alpha: 1,
128
- scale: 1,
129
- tint: 0xffffff,
130
- blendMode: 0,
131
- animation: "FADE_IN",
132
- colorCorrection: {},
133
- fill: "#fe2c54",
134
- },
135
- initialAlpha: 0,
136
- },
137
- };
138
-
139
- // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
140
- export const Filters: Story = {
141
- render: (args: any) => (
142
- <AppStateContextProvider {...args}>
143
- <PixiSvgPathSprite {...args} />
144
- </AppStateContextProvider>
145
- ),
146
- args: {
147
- uniqueId: "svgfilters001", // uniqueId of the sprite
148
- path: "M 100 100 L 300 100 L 200 300 z",
149
- applyTransformer: false,
150
- startAt: 0,
151
- endAt: 10,
152
- transformation: {
153
- x: 200,
154
- y: 200,
155
- width: 200,
156
- height: 200,
157
- anchor: 0.5,
158
- rotation: 0,
159
- alpha: 1,
160
- scale: 1,
161
- tint: 0xffffff,
162
- blendMode: 0,
163
- colorCorrection: {
164
- enabled: true,
165
- contrast: 1,
166
- saturation: 2,
167
- exposure: 1,
168
- blurRadius: 3,
169
- },
170
- fill: "#FFC0CB",
171
- },
172
- initialAlpha: 1,
173
- },
174
- };
@@ -1,158 +0,0 @@
1
- import * as React from "react";
2
- import { useRef } from "react";
3
- // @ts-ignore
4
- import PropTypes from "prop-types";
5
- import { Sprite, Container, useApp } from "@pixi/react";
6
- import * as PIXI from "pixi.js";
7
- import { SVG } from "pixi-svg";
8
- // @ts-ignore
9
- import svgpath from "svgpath";
10
- // @ts-ignore
11
- import isEmpty from "lodash/isEmpty";
12
- import { PixiBaseSpriteProps } from "../../types/BaseProps";
13
- import AbstractContainer from "../../hocs/AbstractContainer";
14
- import { Effects } from "../../types/Effects";
15
-
16
- interface PixiSvgPathSpriteProps extends PixiBaseSpriteProps {
17
- uniqueId: string;
18
- path: string;
19
- startAt: number;
20
- endAt: number;
21
- initialAlpha: number;
22
- transformation: {
23
- x: number;
24
- y: number;
25
- width: number;
26
- height: number;
27
- anchor: number;
28
- rotation?: number;
29
- alpha?: number;
30
- scale?: number | [number, number];
31
- tint?: number;
32
- blendMode?: number;
33
- animation?: string;
34
- fill?: string;
35
- fontWeight?: string;
36
- fontStyle?: string;
37
- stroke?: string;
38
- strokeWidth?: number;
39
- blurRadius?: number;
40
- colorCorrection?: {
41
- enabled?: boolean;
42
- temperature?: number;
43
- hue?: number;
44
- contrast?: number;
45
- saturation?: number;
46
- exposure?: number;
47
- reset?: boolean;
48
- sharpness?: number;
49
- value?: number;
50
- levels?: number;
51
- luminance?: number;
52
- enhance?: number;
53
- blurRadius?: number;
54
- red?: number;
55
- green?: number;
56
- blue?: number;
57
- alpha?: number;
58
- scaleInput?: number;
59
- };
60
- effect?: Effects;
61
- };
62
- pointerdown?: () => void;
63
- pointerup?: () => void;
64
- mousedown?: () => void;
65
- mouseup?: () => void;
66
- pointerover?: () => void;
67
- mouseover?: () => void;
68
- mouseout?: () => void;
69
- applyTransformer?: boolean;
70
- onAnchorTransformationEnd?: (endData: any) => void;
71
- }
72
-
73
- const PixiSvgPathSprite: React.FC<PixiSvgPathSpriteProps> = (props) => {
74
- //// State
75
- const [texture, setTexture] = React.useState<any>(null);
76
-
77
- //// Refs
78
- const imageRef = useRef<PIXI.Sprite>(null);
79
- const parentNode = useRef<PIXI.Container>(null);
80
- const imgGroupRef = useRef<PIXI.Container>(null);
81
-
82
- //// Context
83
-
84
- /// 1001
85
- // console.log("contxt Values", tl);
86
- const {
87
- path,
88
- transformation: {
89
- x,
90
- y,
91
- width,
92
- height,
93
- anchor,
94
- fill,
95
- stroke = "none",
96
- strokeWidth = 0,
97
- },
98
- pointerdown,
99
- pointerup,
100
- mousedown,
101
- mouseup,
102
- pointerover,
103
- mouseover,
104
- mouseout,
105
- } = props;
106
-
107
- const app = useApp();
108
-
109
- // const fillColor = PIXI.utils.string2hex(fill || "#262730");
110
-
111
- React.useEffect(() => {
112
- const transformedPath = svgpath(path).scale(5).translate(0, 0).toString();
113
- // console.log('path', path);
114
- // console.log('transformedPath', transformedPath);
115
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}">
116
- <path stroke="${stroke}" stroke-width="${strokeWidth}" fill="${fill}" d="${transformedPath}">
117
- </path>
118
- </svg>`;
119
-
120
- const svgObject = new SVG(svg);
121
- const tex = app.renderer.generateTexture(svgObject);
122
- setTexture(tex);
123
- return () => {
124
- // removeTransformer();
125
- };
126
- }, [app, path, stroke, strokeWidth, fill]);
127
-
128
- return (
129
- <AbstractContainer {...props}>
130
- <Container ref={parentNode}>
131
- <Container ref={imgGroupRef}>
132
- {texture && (
133
- <Sprite
134
- texture={texture}
135
- width={width}
136
- height={height}
137
- anchor={anchor}
138
- ref={imageRef}
139
- x={x}
140
- y={y}
141
- // @ts-ignore
142
- interactive={true}
143
- pointerdown={pointerdown}
144
- pointerup={pointerup}
145
- pointerover={pointerover}
146
- mousedown={mousedown}
147
- mouseup={mouseup}
148
- mouseover={mouseover}
149
- mouseout={mouseout}
150
- />
151
- )}
152
- </Container>
153
- </Container>
154
- </AbstractContainer>
155
- );
156
- };
157
-
158
- export default PixiSvgPathSprite;
@@ -1 +0,0 @@
1
- export { default as PixiSvgPathSprite } from "./PixiSvgPathSprite";
@@ -1,228 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { PixiTextSprite } 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/TextSprite",
8
- component: PixiTextSprite,
9
-
10
- tags: ["autodocs"],
11
- argTypes: {
12
- uniqueId: {
13
- control: "text",
14
- description: "uniqueId of the sprite",
15
- },
16
- text: {
17
- control: "text",
18
- description: "Text to be displayed",
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
-
72
- pointerup: {
73
- action: "pointerup",
74
- description: "pointerup event",
75
- },
76
- onTextUpdate: {
77
- action: "onTextUpdate",
78
- description: "onTextUpdate event",
79
- },
80
- },
81
- } satisfies Meta<typeof PixiTextSprite>;
82
-
83
- export default meta;
84
- type Story = StoryObj<typeof meta>;
85
-
86
- // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
87
- export const Normal: Story = {
88
- render: (args: any) => (
89
- <AppStateContextProvider {...args}>
90
- <PixiTextSprite {...args} />
91
- </AppStateContextProvider>
92
- ),
93
- args: {
94
- uniqueId: "TextSpritexx001", // uniqueId of the sprite
95
- text: "Hello Welcome to PixiJS",
96
- locked: false,
97
- applyTransformer: false,
98
- transformation: {
99
- x: 200,
100
- y: 200,
101
- width: 200,
102
- height: 200,
103
- anchor: 0.5,
104
- rotation: 0,
105
- alpha: 1,
106
- scale: 1,
107
- blendMode: 0,
108
- colorCorrection: {},
109
- fill: "#00ff99",
110
- fontSize: 80,
111
- fontFamily: "Arial",
112
- align: "center",
113
- stroke: "#522d2d",
114
- strokeThickness: 0,
115
- letterSpacing: 0,
116
- lineHeight: 0,
117
- dropShadow: false,
118
- dropShadowColor: "#522d2d",
119
- dropShadowBlur: 0,
120
- wordWrap: false,
121
- wordWrapWidth: 5000000,
122
- padding: 10,
123
- textBaseline: "alphabetic",
124
- trim: false,
125
- },
126
- startAt: 0,
127
- endAt: 10,
128
- initialAlpha: 1,
129
- },
130
- };
131
-
132
- export const FadeIn: Story = {
133
- render: (args: any) => (
134
- <AppStateContextProvider {...args}>
135
- <PixiTextSprite {...args} />
136
- </AppStateContextProvider>
137
- ),
138
- args: {
139
- uniqueId: "TextSprite001", // uniqueId of the sprite
140
- text: "Hello Welcome to PixiJS",
141
- locked: false,
142
- applyTransformer: false,
143
- transformation: {
144
- x: 200,
145
- y: 200,
146
- width: 200,
147
- height: 200,
148
- anchor: 0.5,
149
- rotation: 0,
150
- alpha: 1,
151
- scale: 1,
152
- tint: 0xffffff,
153
- blendMode: 0,
154
- colorCorrection: {},
155
- fill: "#00ff99",
156
- fontSize: 20,
157
- fontFamily: "Arial",
158
- align: "center",
159
- stroke: 0x000000,
160
- strokeThickness: 0,
161
- letterSpacing: 0,
162
- lineHeight: 0,
163
- dropShadow: false,
164
- dropShadowColor: 0x000000,
165
- dropShadowBlur: 0,
166
- wordWrap: false,
167
- wordWrapWidth: 100,
168
- padding: 0,
169
- textBaseline: "alphabetic",
170
- trim: false,
171
- },
172
- startAt: 0,
173
- endAt: 10,
174
- initialAlpha: 0,
175
- },
176
- };
177
-
178
- // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
179
- export const Filters: Story = {
180
- render: (args: any) => (
181
- <AppStateContextProvider {...args}>
182
- <PixiTextSprite {...args} />
183
- </AppStateContextProvider>
184
- ),
185
- args: {
186
- uniqueId: "TextSpritexx001", // uniqueId of the sprite
187
- text: "Hello Welcome to PixiJS",
188
- locked: false,
189
- applyTransformer: false,
190
- transformation: {
191
- x: 200,
192
- y: 200,
193
- width: 200,
194
- height: 200,
195
- anchor: 0.5,
196
- rotation: 0,
197
- alpha: 1,
198
- scale: 1,
199
- blendMode: 0,
200
- colorCorrection: {
201
- enabled: true,
202
- contrast: 2,
203
- saturation: 2,
204
- exposure: 2,
205
- blurRadius: 1,
206
- },
207
- fill: "#00ff99",
208
- fontSize: 80,
209
- fontFamily: "Arial",
210
- align: "center",
211
- stroke: "#522d2d",
212
- strokeThickness: 0,
213
- letterSpacing: 0,
214
- lineHeight: 0,
215
- dropShadow: false,
216
- dropShadowColor: "#522d2d",
217
- dropShadowBlur: 0,
218
- wordWrap: false,
219
- wordWrapWidth: 5000000,
220
- padding: 10,
221
- textBaseline: "alphabetic",
222
- trim: false,
223
- },
224
- startAt: 0,
225
- endAt: 10,
226
- initialAlpha: 1,
227
- },
228
- };