reacthub-pixitweenjs 0.2.10 → 0.2.12

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/dist/index.es.js +3586 -3583
  2. package/dist/index.umd.js +78 -78
  3. package/package.json +4 -1
  4. package/.storybook/main.ts +0 -31
  5. package/.storybook/preview.tsx +0 -26
  6. package/CHANGELOG.md +0 -100
  7. package/build-storybook.log +0 -94
  8. package/index.html +0 -13
  9. package/public/vite.svg +0 -1
  10. package/src/App.css +0 -42
  11. package/src/App.tsx +0 -29
  12. package/src/assets/font/OpenSans-Light-webfont.eot +0 -0
  13. package/src/assets/font/OpenSans-Light-webfont.svg +0 -252
  14. package/src/assets/font/OpenSans-Light-webfont.ttf +0 -0
  15. package/src/assets/font/OpenSans-Light-webfont.woff +0 -0
  16. package/src/assets/font/OpenSans-Regular-webfont.eot +0 -0
  17. package/src/assets/font/OpenSans-Regular-webfont.svg +0 -252
  18. package/src/assets/font/OpenSans-Regular-webfont.ttf +0 -0
  19. package/src/assets/font/OpenSans-Regular-webfont.woff +0 -0
  20. package/src/assets/icon/percolate.eot +0 -0
  21. package/src/assets/icon/percolate.svg +0 -139
  22. package/src/assets/icon/percolate.ttf +0 -0
  23. package/src/assets/icon/percolate.woff +0 -0
  24. package/src/assets/react.svg +0 -1
  25. package/src/components/PixiAnimatedSprite/PixiAnimatedSprite.tsx +0 -51
  26. package/src/components/PixiAnimatedSprite/index.ts +0 -2
  27. package/src/components/PixiAudioSprite/PixiAudioSprite.stories.tsx +0 -61
  28. package/src/components/PixiAudioSprite/PixiAudioSprite.tsx +0 -202
  29. package/src/components/PixiAudioSprite/index.ts +0 -1
  30. package/src/components/PixiGifSprite/PixiGifSprite.stories.tsx +0 -172
  31. package/src/components/PixiGifSprite/PixiGifSprite.tsx +0 -420
  32. package/src/components/PixiGifSprite/index.ts +0 -2
  33. package/src/components/PixiImageSprite/PixiImageSprite.stories.tsx +0 -220
  34. package/src/components/PixiImageSprite/PixiImageSprite.tsx +0 -60
  35. package/src/components/PixiImageSprite/index.ts +0 -1
  36. package/src/components/PixiSVGSprite/PixiSvgPathSprite.stories.tsx +0 -174
  37. package/src/components/PixiSVGSprite/PixiSvgPathSprite.tsx +0 -158
  38. package/src/components/PixiSVGSprite/index.ts +0 -1
  39. package/src/components/PixiTextSprite/PixiTextSprite.stories.tsx +0 -228
  40. package/src/components/PixiTextSprite/PixiTextSprite.tsx +0 -361
  41. package/src/components/PixiTextSprite/index.ts +0 -1
  42. package/src/components/PixiVideoSprite/PixiVideoSprite.stories.tsx +0 -186
  43. package/src/components/PixiVideoSprite/PixiVideoSprite.tsx +0 -595
  44. package/src/components/PixiVideoSprite/PixiVideoSpriteBackup.txt +0 -755
  45. package/src/components/PixiVideoSprite/index.ts +0 -1
  46. package/src/components/index.ts +0 -7
  47. package/src/declare.module.ts +0 -5
  48. package/src/hocs/AbstractContainer.tsx +0 -199
  49. package/src/hocs/WithFilterContainer.tsx +0 -159
  50. package/src/index.css +0 -457
  51. package/src/index.ts +0 -3
  52. package/src/main.tsx +0 -11
  53. package/src/providers/GsapPixieContextProvider.tsx +0 -245
  54. package/src/providers/index.ts +0 -1
  55. package/src/reacthub-react-bindings.d.ts +0 -27
  56. package/src/stories/Installation.mdx +0 -40
  57. package/src/stories/Introduction.mdx +0 -140
  58. package/src/stories/assets/code-brackets.svg +0 -1
  59. package/src/stories/assets/colors.svg +0 -1
  60. package/src/stories/assets/comments.svg +0 -1
  61. package/src/stories/assets/direction.svg +0 -1
  62. package/src/stories/assets/flow.svg +0 -1
  63. package/src/stories/assets/plugin.svg +0 -1
  64. package/src/stories/assets/repo.svg +0 -1
  65. package/src/stories/assets/stackalt.svg +0 -1
  66. package/src/types/Animations.tsx +0 -41
  67. package/src/types/BaseProps.tsx +0 -56
  68. package/src/types/BlendModes.tsx +0 -19
  69. package/src/types/Effects.tsx +0 -11
  70. package/src/types/transformation.tsx +0 -13
  71. package/src/utils/AppStateProvider.tsx +0 -59
  72. package/src/utils/AppStateStage.tsx +0 -15
  73. package/src/utils/AppWrapper.tsx +0 -47
  74. package/src/utils/ContextBridge.tsx +0 -25
  75. package/src/utils/GsapAnim.tsx +0 -107
  76. package/src/utils/InteractionManager.tsx +0 -36
  77. package/src/utils/PixiStage.tsx +0 -29
  78. package/src/utils/PixiTransformer.tsx +0 -165
  79. package/src/utils/VideoSeekBar.tsx +0 -122
  80. package/src/utils/useDebounce.tsx +0 -15
  81. package/src/utils/useDeepEffect.tsx +0 -23
  82. package/src/vite-env.d.ts +0 -1
  83. package/tsconfig.json +0 -37
  84. package/tsconfig.node.json +0 -10
  85. package/vite.config.ts +0 -39
  86. package/vitest.config.ts +0 -11
@@ -1,595 +0,0 @@
1
- import * as React from "react";
2
- import { useContext, useEffect, useRef, useState } from "react";
3
- // @ts-ignore
4
- import PropTypes from "prop-types";
5
- import { useCustomEventListener } from "react-custom-events";
6
- import {
7
- GsapPixieContext,
8
- Events,
9
- } from "../../providers/GsapPixieContextProvider";
10
- import { Sprite, Container, withFilters } from "@pixi/react";
11
- import { AdjustmentFilter } from "@pixi/filter-adjustment";
12
- import * as PIXI from "pixi.js";
13
- import gsap from "gsap";
14
- import PixiTransformer from "../../utils/PixiTransformer";
15
-
16
- // @ts-ignore
17
- import isEmpty from "lodash/isEmpty";
18
- import { getAnimByName } from "../../utils/GsapAnim";
19
- import { TransformationEnd } from "../../types/transformation";
20
-
21
- type PixiVideoSpriteProps = {
22
- uniqueId: string;
23
- src: string;
24
- startAt: number;
25
- endAt: number;
26
- frameStartAt: number;
27
- frameEndAt: number;
28
- mute: boolean;
29
- locked: boolean;
30
- initialAlpha: number;
31
- transformation: {
32
- x: number;
33
- y: number;
34
- width: number;
35
- height: number;
36
- anchor: number;
37
- rotation?: number;
38
- alpha?: number;
39
- scale?: number | [number, number];
40
- tint?: number;
41
- blendMode?: number;
42
- animation?: string;
43
- colorCorrection?: {
44
- enabled?: boolean;
45
- temperature?: number;
46
- hue?: number;
47
- contrast?: number;
48
- saturation?: number;
49
- exposure?: number;
50
- reset?: boolean;
51
- sharpness?: number;
52
- value?: number;
53
- levels?: number;
54
- luminance?: number;
55
- enhance?: number;
56
- blurRadius?: number;
57
- red?: number;
58
- green?: number;
59
- blue?: number;
60
- alpha?: number;
61
- scaleInput?: number;
62
- };
63
- effect?: string;
64
- };
65
- pointerdown?: () => void;
66
- pointerup?: () => void;
67
- mousedown?: () => void;
68
- mouseup?: () => void;
69
- pointerover?: () => void;
70
- mouseover?: () => void;
71
- mouseout?: () => void;
72
- applyTransformer?: boolean;
73
- onAnchorTransformationEnd?: (endData: any) => void;
74
- };
75
-
76
- interface VideoState {
77
- isPlaying: boolean;
78
- progress: number;
79
- speed: number;
80
- isMuted: boolean;
81
- isWaiting: boolean;
82
- loaded: boolean;
83
- size: { width: number; height: number };
84
- isDragging: boolean;
85
- }
86
-
87
- const Filters = withFilters(Container, {
88
- blur: PIXI.filters.BlurFilter,
89
- adjust: AdjustmentFilter,
90
- matrix: PIXI.filters.ColorMatrixFilter,
91
- });
92
-
93
- /** CYAN Filters */
94
- const CYAN = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
95
-
96
- const initialState: VideoState = {
97
- isPlaying: false,
98
- progress: 0,
99
- speed: 1,
100
- isMuted: false,
101
- isWaiting: false,
102
- loaded: false,
103
- size: { width: 50, height: 50 },
104
- isDragging: false,
105
- };
106
-
107
- const PixiVideoSprite: React.FC<PixiVideoSpriteProps> = (props) => {
108
- //// State
109
- const [isMounted, setIsMounted] = React.useState(false);
110
- /// const [isTransformerDragging, setIsTransformerDragging] = useState(false);
111
- const [, setIsMouseOverTransformer] = useState(false);
112
- const [, setVideoState] = React.useState({
113
- isWaiting: false,
114
- isStalled: false,
115
- });
116
- const [videoTexture, setVideoTexture] =
117
- React.useState<PIXI.Texture<PIXI.Resource>>();
118
- const [isDragging, setIsDragging] = useState(false);
119
-
120
- //// Refs
121
- const imageRef = useRef<PIXI.Sprite>(null);
122
- const containerRef = useRef<PIXI.Container>(null);
123
- const parentNode = useRef<PIXI.Container>(null);
124
- const imgGroupRef = useRef<PIXI.Container>(null);
125
- const transformerRef = useRef<PIXI.Container>(null);
126
- const videoElement = useRef<HTMLVideoElement>(null);
127
- const videoStateRef = useRef<VideoState>(initialState);
128
-
129
- //// Context
130
- const {
131
- tl,
132
- playerTimeRef,
133
- isDragging: gsapDragging,
134
- } = useContext(GsapPixieContext);
135
-
136
- // console log draggging
137
- /// 1001
138
- // console.log("contxt Values", tl);
139
- const {
140
- uniqueId,
141
- mute = false,
142
- locked = false,
143
- src,
144
- startAt,
145
- endAt,
146
- frameStartAt,
147
- frameEndAt,
148
- initialAlpha,
149
- transformation: {
150
- x,
151
- y,
152
- width,
153
- height,
154
- scale,
155
- rotation,
156
- animation,
157
- colorCorrection,
158
- effect,
159
- },
160
- pointerdown,
161
- pointerup,
162
- mousedown,
163
- mouseup,
164
- pointerover,
165
- mouseover,
166
- mouseout,
167
- applyTransformer,
168
- onAnchorTransformationEnd,
169
- } = props;
170
-
171
- const videoUrl = src || "";
172
-
173
- // color corrections
174
- const {
175
- contrast = 1,
176
- saturation = 1,
177
- exposure = 1,
178
- blurRadius = 0,
179
- alpha = 1,
180
- } = colorCorrection || {};
181
-
182
- /** adjustment filter */
183
- const adjustments = {
184
- brightness: exposure,
185
- contrast,
186
- saturation,
187
- alpha,
188
- };
189
-
190
- /** handle on tranformer onchange */
191
- const handleOnTransformChange = React.useCallback(() => {
192
- setIsDragging(true);
193
- }, []);
194
-
195
- // transformer to handle sprite transformation
196
- const handleOnTransformEnd = React.useCallback(
197
- (endData: TransformationEnd) => {
198
- console.log("changeEnd", endData);
199
- if (onAnchorTransformationEnd) {
200
- console.log("running onAnchorTransformationEnd");
201
- onAnchorTransformationEnd(endData);
202
- }
203
- },
204
- []
205
- );
206
-
207
- /**Adding this alternative workaround to work with mov/mk4 video types */
208
- const videoSrcElement = React.useMemo(() => {
209
- const element = document.createElement("video");
210
- element.src = src;
211
- element.crossOrigin = "Anonymus";
212
- element.autoplay = false;
213
- element.currentTime = 0.0001;
214
- return element;
215
- }, [src]);
216
-
217
- /** Adding custom event listners */
218
- /** Event Listeneres */
219
- useCustomEventListener(Events.PAUSE, (data) => {
220
- console.log("pause event", data);
221
- if (videoElement.current) {
222
- const vid = videoElement.current;
223
- const isVidPlaying =
224
- vid.currentTime > 0 &&
225
- !vid.paused &&
226
- !vid.ended &&
227
- vid.readyState > vid.HAVE_CURRENT_DATA;
228
- if (isVidPlaying) videoElement.current.pause();
229
- videoStateRef.current.isPlaying = false;
230
- }
231
- });
232
-
233
- // /** stop video playing when gsapDragging is true */
234
- React.useEffect(() => {
235
- console.log("current", videoElement.current, gsapDragging);
236
- if (videoElement.current) {
237
- if (gsapDragging) {
238
- videoElement.current.pause();
239
- videoStateRef.current.isPlaying = false;
240
- videoStateRef.current.isDragging = true;
241
- } else {
242
- videoStateRef.current.isDragging = false;
243
- }
244
- }
245
- }, [gsapDragging]);
246
-
247
- /** Gsap Start and Stop Events */
248
- const gsapOnStart = (startAt: number) => {
249
- if (videoElement.current) {
250
- console.log("video gsapOnStart", playerTimeRef.current, gsapDragging);
251
-
252
- // check the start and end times are between the playerTimeRef.current to start video;
253
- if (
254
- playerTimeRef.current >= startAt &&
255
- playerTimeRef.current <= endAt &&
256
- !gsapDragging
257
- ) {
258
- videoElement.current.currentTime =
259
- Number(frameStartAt) || Number(startAt);
260
- videoElement.current.play();
261
- videoStateRef.current.isPlaying = true;
262
- }
263
- }
264
- };
265
-
266
- const gsapOnComplete = () => {
267
- console.log("onComplete triggered");
268
- if (videoElement.current) {
269
- const vid = videoElement.current;
270
- const isVidPlaying =
271
- vid.currentTime > 0 &&
272
- !vid.paused &&
273
- !vid.ended &&
274
- vid.readyState > vid.HAVE_CURRENT_DATA;
275
- ///if (!isVidPlaying) videoElement.current.play();
276
- if (isVidPlaying) videoElement.current.pause();
277
- videoStateRef.current.isPlaying = false;
278
- }
279
- };
280
-
281
- const onInterrupt = () => {
282
- // console.log('interrupting', refId);
283
- };
284
-
285
- const onUpdate = () => {
286
- if (videoElement.current) {
287
- // console.log(
288
- // "currenttime vs player reftime",
289
- // videoElement.current.currentTime,
290
- // playerTimeRef.current
291
- // );
292
- const absDiff = Math.abs(
293
- videoElement.current.currentTime - playerTimeRef.current
294
- );
295
-
296
- const vid = videoElement.current;
297
- const isVidPlaying =
298
- vid.currentTime > 0 &&
299
- !vid.paused &&
300
- !vid.ended &&
301
- vid.readyState > vid.HAVE_CURRENT_DATA;
302
-
303
- if (videoStateRef.current.isDragging) {
304
- console.log("video updating", playerTimeRef.current);
305
- videoElement.current.currentTime = playerTimeRef.current;
306
- videoElement.current.play();
307
- setTimeout(() => {
308
- videoStateRef.current.isPlaying = false;
309
- if (videoElement.current) videoElement.current.pause();
310
- }, 55);
311
- videoStateRef.current.isPlaying = false;
312
- } else if (!videoStateRef.current.isPlaying) {
313
- // if (!isVidPlaying) videoElement.current.play();
314
- // videoStateRef.current.isPlaying = true;
315
- // let the video play and update current time
316
- // videoElement.current.currentTime = playerTimeRef.current;
317
- if (!isVidPlaying) videoElement.current.play();
318
- videoStateRef.current.isPlaying = true;
319
- } else if (absDiff > 0.3) {
320
- // videoElement.current.currentTime = playerTimeRef.current;
321
- // if (!isVidPlaying) videoElement.current.play();
322
- // videoStateRef.current.isPlaying = true;
323
- }
324
- }
325
- };
326
-
327
- useEffect(() => {
328
- let ctx = gsap.context(() => {});
329
- if (containerRef.current && tl.current) {
330
- const data = {
331
- duration: Number(endAt) - Number(startAt),
332
- onStart: gsapOnStart,
333
- onComplete: gsapOnComplete,
334
- onStartParams: [startAt],
335
- onCompleteParams: [],
336
- onInterrupt: onInterrupt,
337
- onUpdate: onUpdate,
338
- onUpdateParams: [],
339
- };
340
-
341
- const ease = getAnimByName(animation || "None");
342
- ctx = gsap.context(() => {
343
- if (!isEmpty(ease.from)) {
344
- tl.current
345
- .from(containerRef.current, { ...ease.from }, startAt)
346
- .to(imgGroupRef.current, { alpha: 1, duration: 0.2 }, startAt)
347
- .from(imgGroupRef.current, { ...data }, startAt)
348
- .to(containerRef.current, { alpha: 0, duration: 0.2 }, endAt - 0.2);
349
- } else if (!isEmpty(ease.to)) {
350
- tl.current
351
- .to(
352
- containerRef.current,
353
- { alpha: 1, duration: 0.2, ...ease.to },
354
- startAt
355
- )
356
- .from(imgGroupRef.current, { ...data }, startAt)
357
- .to(containerRef.current, { alpha: 0, duration: 0.2 }, endAt - 0.2);
358
- } else if (!isEmpty(ease.fromTo)) {
359
- tl.current
360
- .fromTo(
361
- containerRef.current,
362
- ease.fromTo?.from,
363
- ease.fromTo?.to,
364
- startAt
365
- )
366
- .from(imgGroupRef.current, { ...data }, startAt)
367
- .to(containerRef.current, { alpha: 0, duration: 0.2 }, endAt - 0.2);
368
- } else {
369
- tl.current
370
- .to(containerRef.current, { alpha: 1, duration: 0.01 }, startAt)
371
- .from(imgGroupRef.current, { ...data }, startAt)
372
- .to(
373
- containerRef.current,
374
- { alpha: 0, duration: 0.1 },
375
- Number(endAt) - Number(0.1)
376
- );
377
- }
378
- });
379
- }
380
- return () => ctx.revert(); // cleanup!
381
- }, [animation, startAt, endAt]);
382
-
383
- React.useEffect(() => {
384
- if (containerRef.current) {
385
- setIsMounted(true);
386
- }
387
- }, []);
388
-
389
- React.useEffect(() => {
390
- if (videoElement.current) {
391
- videoElement.current.muted = mute;
392
- }
393
- }, [mute]);
394
-
395
- // stop playing video while isDragging and gsapDragging
396
- React.useEffect(() => {
397
- if (videoElement.current) {
398
- const vid = videoElement.current;
399
- const isVidPlaying =
400
- vid.currentTime > 0 &&
401
- !vid.paused &&
402
- !vid.ended &&
403
- vid.readyState > vid.HAVE_CURRENT_DATA;
404
- if (isVidPlaying && (isDragging || gsapDragging)) {
405
- videoElement.current.pause();
406
- videoStateRef.current.isPlaying = false;
407
- }
408
- }
409
- }, [isDragging, gsapDragging]);
410
-
411
- // load // load meta // load seek through
412
- React.useEffect(() => {
413
- const minStartAt =
414
- Math.round((Number(frameStartAt) + Number.EPSILON) * 100) / 100;
415
- const onload = function () {
416
- if (videoElement.current) {
417
- videoElement.current.currentTime = minStartAt;
418
- }
419
- };
420
-
421
- const onEnd = function () {
422
- //dispatchState({ isPlaying: false });
423
- if (videoElement.current) {
424
- const vid = videoElement.current;
425
- const isVidPlaying =
426
- vid.currentTime > 0 &&
427
- !vid.paused &&
428
- !vid.ended &&
429
- vid.readyState > vid.HAVE_CURRENT_DATA;
430
-
431
- if (isVidPlaying) {
432
- videoElement.current.pause();
433
- }
434
- }
435
- setVideoState({ isWaiting: false, isStalled: false });
436
- };
437
-
438
- const onLoadStart = function () {
439
- //dispatchState({ isWaiting: true, isStalled: false });
440
- if (videoElement.current) {
441
- videoElement.current.pause();
442
- }
443
- setVideoState({ isWaiting: true, isStalled: false });
444
- };
445
-
446
- const onCanPlayThrough = function () {
447
- //dispatchState({ isWaiting: false, isStalled: false });
448
- setVideoState({ isWaiting: false, isStalled: false });
449
- };
450
-
451
- const onStalled = function () {
452
- //dispatchState({ isStalled: true });
453
- setVideoState({ isWaiting: false, isStalled: true });
454
- };
455
-
456
- // create a new Sprite using the video texture (yes it's that easy)
457
- const stAt =
458
- Math.round((Number(frameStartAt) + Number.EPSILON) * 100) / 100;
459
- const endAt = Math.round((Number(frameEndAt) + Number.EPSILON) * 100) / 100;
460
- const urlWithTimestamp = `${videoUrl}#t=${stAt},${endAt}`;
461
- /// const urlWithQuery = `${videoUrl}?t=${stAt},${endAt}`;
462
-
463
- console.log("urlTimestap", urlWithTimestamp);
464
- /// const texture =
465
- PIXI.Texture.fromLoader(videoSrcElement, urlWithTimestamp, uniqueId, {
466
- pixiIdPrefix: uniqueId,
467
- resourceOptions: {
468
- autoPlay: false,
469
- crossorigin: "Anonymus",
470
- updateFPS: 30,
471
- },
472
- }).then((texture) => {
473
- if (!texture) return;
474
- // texture.baseTexture.resource.source.currentSrc = urlWithTimestamp;
475
- setVideoTexture(texture);
476
- // @ts-ignore
477
- console.log(texture.baseTexture.resource.source);
478
- // @ts-ignore
479
- videoElement.current = texture.baseTexture.resource.source;
480
- // @ts-ignore
481
- videoElement.current.id = uniqueId;
482
- // @ts-ignore
483
- videoElement.current.addEventListener("loadedmetadata", onload);
484
- // @ts-ignore
485
- videoElement.current.addEventListener("ended", onEnd);
486
- // @ts-ignore
487
- videoElement.current.addEventListener("loadstart", onLoadStart);
488
- // @ts-ignore
489
- videoElement.current.addEventListener("canplaythrough", onCanPlayThrough);
490
- // @ts-ignore
491
- videoElement.current.addEventListener("stalled", onStalled);
492
- });
493
-
494
- return () => {
495
- // @ts-ignore
496
- videoElement.current.removeEventListener("loadedmetadata", onload);
497
- // @ts-ignore
498
- videoElement.current.removeEventListener("ended", onEnd);
499
- // @ts-ignore
500
- videoElement.current.removeEventListener("loadstart", onLoadStart);
501
- // @ts-ignore
502
- videoElement.current.removeEventListener(
503
- "canplaythrough",
504
- onCanPlayThrough
505
- );
506
- // @ts-ignore
507
- videoElement.current.removeEventListener("stalled", onStalled);
508
- };
509
- // create a new Sprite using the video texture (yes it's that easy)
510
- // const videoSprite = new PIXI.Sprite(texture);
511
- }, [videoUrl, uniqueId, frameStartAt, frameEndAt, videoSrcElement]);
512
-
513
- return (
514
- // @ts-ignore
515
- <Container ref={parentNode}>
516
- {/* @ts-ignore */}
517
- {/* @ts-ignore */}
518
- <Container
519
- ref={containerRef}
520
- alpha={initialAlpha}
521
- position={[x, y]}
522
- pivot={[x, y]}
523
- width={width}
524
- height={height}
525
- >
526
- <Filters
527
- scale={1}
528
- blur={{ blur: blurRadius, quality: 4 }}
529
- adjust={adjustments}
530
- apply={({ matrix }: { matrix: any }) => {
531
- if (effect === "BlackAndWhite") {
532
- matrix.desaturate();
533
- } else if (effect === "Sepia") {
534
- matrix.sepia();
535
- } else if (effect === "RetroVintage") {
536
- matrix.negative();
537
- } else if (effect === "NightVision") {
538
- matrix.negative();
539
- } else if (effect === "Normal") {
540
- matrix.reset();
541
- }
542
- }}
543
- matrix={{
544
- enabled: true,
545
- // @ts-ignore
546
- matrix: CYAN,
547
- }}
548
- >
549
- {/* @ts-ignore */}
550
- <Container ref={imgGroupRef}>
551
- {videoTexture && (
552
- <Sprite
553
- texture={videoTexture}
554
- width={width}
555
- height={height}
556
- anchor={0.5}
557
- x={x}
558
- y={y}
559
- {...(!locked &&
560
- !isDragging && {
561
- interactive: true,
562
- buttonMode: true,
563
- pointerdown: pointerdown,
564
- pointerover: pointerover,
565
- pointerout: mouseout,
566
- mousedown: mousedown,
567
- mouseover: mouseover,
568
- mouseout: mouseout,
569
- mouseup: mouseup,
570
- pointerup: pointerup,
571
- })}
572
- ref={imageRef}
573
- scale={scale}
574
- rotation={rotation}
575
- />
576
- )}
577
- </Container>
578
- </Filters>
579
- </Container>
580
- {applyTransformer && (
581
- <PixiTransformer
582
- pixiTransformerRef={transformerRef}
583
- imageRef={containerRef}
584
- isMounted={isMounted}
585
- transformCommit={handleOnTransformEnd}
586
- transformChange={handleOnTransformChange}
587
- mouseoverEvent={setIsMouseOverTransformer}
588
- uniqueId={uniqueId}
589
- />
590
- )}
591
- </Container>
592
- );
593
- };
594
-
595
- export default PixiVideoSprite;