react-pixi-fiber 1.0.4 → 1.0.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.
- package/cjs/react-pixi-fiber.development.js +36 -2
- package/cjs/react-pixi-fiber.production.min.js +2 -2
- package/cjs/react-pixi-fiber.production.min.js.map +1 -1
- package/es/react-pixi-fiber.development.js +36 -2
- package/es/react-pixi-fiber.production.min.js +2 -2
- package/es/react-pixi-fiber.production.min.js.map +1 -1
- package/index.d.ts +13 -2
- package/package.json +1 -1
- package/src/PixiProperty.js +32 -0
- package/src/possibleStandardNames.js +32 -0
- package/umd/react-pixi-fiber.development.js +36 -2
- package/umd/react-pixi-fiber.production.min.js +2 -2
- package/umd/react-pixi-fiber.production.min.js.map +1 -1
- package/CHANGELOG.md +0 -555
package/index.d.ts
CHANGED
|
@@ -12,7 +12,13 @@ declare module "react-pixi-fiber" {
|
|
|
12
12
|
// shipped in pixi.js@5.3.0. We want to support earlier versions of PixiJS as well so we need this hack for now.
|
|
13
13
|
// @ts-ignore TS2694
|
|
14
14
|
type InteractionCompatibility = Exclude<keyof typeof PIXI.interaction, number | symbol>;
|
|
15
|
-
|
|
15
|
+
// Returns either real keys of `PIXI.InteractionEvent` (if it exists) or generic `string` (if it doesn't exist).
|
|
16
|
+
// `PIXI.InteractionEvent` was removed in pixi.js@7.0.0.
|
|
17
|
+
// @ts-ignore TS2694
|
|
18
|
+
type InteractionEventCompatibility = Exclude<keyof typeof PIXI.InteractionEvent, number | symbol>;
|
|
19
|
+
type InteractionEvent = string extends InteractionEventCompatibility
|
|
20
|
+
? never
|
|
21
|
+
: string extends InteractionCompatibility
|
|
16
22
|
// @ts-ignore TS2694
|
|
17
23
|
? PIXI.InteractionEvent
|
|
18
24
|
// @ts-ignore TS2694
|
|
@@ -99,7 +105,12 @@ declare module "react-pixi-fiber" {
|
|
|
99
105
|
*/
|
|
100
106
|
|
|
101
107
|
// Extra properties to add to allow us to set event handlers using props.
|
|
102
|
-
export type InteractiveComponent =
|
|
108
|
+
export type InteractiveComponent =
|
|
109
|
+
InteractionEvent extends never
|
|
110
|
+
// pixi.js >= 7
|
|
111
|
+
? { }
|
|
112
|
+
// pixi.js <= 6
|
|
113
|
+
: { [P in InteractionEventTypes]?: (event: InteractionEvent) => void };
|
|
103
114
|
|
|
104
115
|
/**
|
|
105
116
|
* Base components
|
package/package.json
CHANGED
package/src/PixiProperty.js
CHANGED
|
@@ -167,6 +167,7 @@ export const customProperties = {};
|
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
[
|
|
170
|
+
// pixi.js < 7.0
|
|
170
171
|
"added",
|
|
171
172
|
"click",
|
|
172
173
|
"mousedown",
|
|
@@ -194,6 +195,37 @@ export const customProperties = {};
|
|
|
194
195
|
"touchendoutside",
|
|
195
196
|
"touchmove",
|
|
196
197
|
"touchstart",
|
|
198
|
+
// pixi.js >= 7.1
|
|
199
|
+
"onclick",
|
|
200
|
+
"onmousedown",
|
|
201
|
+
"onmouseenter",
|
|
202
|
+
"onmouseleave",
|
|
203
|
+
"onmousemove",
|
|
204
|
+
"onmouseout",
|
|
205
|
+
"onmouseover",
|
|
206
|
+
"onmouseup",
|
|
207
|
+
"onmouseupoutside",
|
|
208
|
+
"onpointercancel",
|
|
209
|
+
"onpointerdown",
|
|
210
|
+
"onpointerenter",
|
|
211
|
+
"onpointerleave",
|
|
212
|
+
"onpointermove",
|
|
213
|
+
"onpointerout",
|
|
214
|
+
"onpointerover",
|
|
215
|
+
"onpointertap",
|
|
216
|
+
"onpointerup",
|
|
217
|
+
"onpointerupoutside",
|
|
218
|
+
"onrightclick",
|
|
219
|
+
"onrightdown",
|
|
220
|
+
"onrightup",
|
|
221
|
+
"onrightupoutside",
|
|
222
|
+
"ontap",
|
|
223
|
+
"ontouchcancel",
|
|
224
|
+
"ontouchend",
|
|
225
|
+
"ontouchendoutside",
|
|
226
|
+
"ontouchmove",
|
|
227
|
+
"ontouchstart",
|
|
228
|
+
"onwheel",
|
|
197
229
|
].forEach(name => {
|
|
198
230
|
properties[name] = new PropertyInfoRecord(name, CALLBACK);
|
|
199
231
|
});
|
|
@@ -3,6 +3,7 @@ import { TYPES } from "./types";
|
|
|
3
3
|
|
|
4
4
|
// http://pixijs.download/release/docs/PIXI.DisplayObject.html
|
|
5
5
|
const eventsStandardNames = {
|
|
6
|
+
// pixi.js < 7.0
|
|
6
7
|
added: "added",
|
|
7
8
|
click: "click",
|
|
8
9
|
mousedown: "mousedown",
|
|
@@ -30,6 +31,37 @@ const eventsStandardNames = {
|
|
|
30
31
|
touchendoutside: "touchendoutside",
|
|
31
32
|
touchmove: "touchmove",
|
|
32
33
|
touchstart: "touchstart",
|
|
34
|
+
// pixi.js >= 7.1
|
|
35
|
+
onclick: "onclick",
|
|
36
|
+
onmousedown: "onmousedown",
|
|
37
|
+
onmouseenter: "onmouseenter",
|
|
38
|
+
onmouseleave: "onmouseleave",
|
|
39
|
+
onmousemove: "onmousemove",
|
|
40
|
+
onmouseout: "onmouseout",
|
|
41
|
+
onmouseover: "onmouseover",
|
|
42
|
+
onmouseup: "onmouseup",
|
|
43
|
+
onmouseupoutside: "onmouseupoutside",
|
|
44
|
+
onpointercancel: "onpointercancel",
|
|
45
|
+
onpointerdown: "onpointerdown",
|
|
46
|
+
onpointerenter: "onpointerenter",
|
|
47
|
+
onpointerleave: "onpointerleave",
|
|
48
|
+
onpointermove: "onpointermove",
|
|
49
|
+
onpointerout: "onpointerout",
|
|
50
|
+
onpointerover: "onpointerover",
|
|
51
|
+
onpointertap: "onpointertap",
|
|
52
|
+
onpointerup: "onpointerup",
|
|
53
|
+
onpointerupoutside: "onpointerupoutside",
|
|
54
|
+
onrightclick: "onrightclick",
|
|
55
|
+
onrightdown: "onrightdown",
|
|
56
|
+
onrightup: "onrightup",
|
|
57
|
+
onrightupoutside: "onrightupoutside",
|
|
58
|
+
ontap: "ontap",
|
|
59
|
+
ontouchcancel: "ontouchcancel",
|
|
60
|
+
ontouchend: "ontouchend",
|
|
61
|
+
ontouchendoutside: "ontouchendoutside",
|
|
62
|
+
ontouchmove: "ontouchmove",
|
|
63
|
+
ontouchstart: "ontouchstart",
|
|
64
|
+
onwheel: "onwheel",
|
|
33
65
|
};
|
|
34
66
|
|
|
35
67
|
// http://pixijs.download/release/docs/PIXI.DisplayObject.html
|
|
@@ -455,6 +455,7 @@
|
|
|
455
455
|
var _possibleStandardName;
|
|
456
456
|
|
|
457
457
|
var eventsStandardNames = {
|
|
458
|
+
// pixi.js < 7.0
|
|
458
459
|
added: "added",
|
|
459
460
|
click: "click",
|
|
460
461
|
mousedown: "mousedown",
|
|
@@ -481,7 +482,38 @@
|
|
|
481
482
|
touchend: "touchend",
|
|
482
483
|
touchendoutside: "touchendoutside",
|
|
483
484
|
touchmove: "touchmove",
|
|
484
|
-
touchstart: "touchstart"
|
|
485
|
+
touchstart: "touchstart",
|
|
486
|
+
// pixi.js >= 7.1
|
|
487
|
+
onclick: "onclick",
|
|
488
|
+
onmousedown: "onmousedown",
|
|
489
|
+
onmouseenter: "onmouseenter",
|
|
490
|
+
onmouseleave: "onmouseleave",
|
|
491
|
+
onmousemove: "onmousemove",
|
|
492
|
+
onmouseout: "onmouseout",
|
|
493
|
+
onmouseover: "onmouseover",
|
|
494
|
+
onmouseup: "onmouseup",
|
|
495
|
+
onmouseupoutside: "onmouseupoutside",
|
|
496
|
+
onpointercancel: "onpointercancel",
|
|
497
|
+
onpointerdown: "onpointerdown",
|
|
498
|
+
onpointerenter: "onpointerenter",
|
|
499
|
+
onpointerleave: "onpointerleave",
|
|
500
|
+
onpointermove: "onpointermove",
|
|
501
|
+
onpointerout: "onpointerout",
|
|
502
|
+
onpointerover: "onpointerover",
|
|
503
|
+
onpointertap: "onpointertap",
|
|
504
|
+
onpointerup: "onpointerup",
|
|
505
|
+
onpointerupoutside: "onpointerupoutside",
|
|
506
|
+
onrightclick: "onrightclick",
|
|
507
|
+
onrightdown: "onrightdown",
|
|
508
|
+
onrightup: "onrightup",
|
|
509
|
+
onrightupoutside: "onrightupoutside",
|
|
510
|
+
ontap: "ontap",
|
|
511
|
+
ontouchcancel: "ontouchcancel",
|
|
512
|
+
ontouchend: "ontouchend",
|
|
513
|
+
ontouchendoutside: "ontouchendoutside",
|
|
514
|
+
ontouchmove: "ontouchmove",
|
|
515
|
+
ontouchstart: "ontouchstart",
|
|
516
|
+
onwheel: "onwheel"
|
|
485
517
|
}; // http://pixijs.download/release/docs/PIXI.DisplayObject.html
|
|
486
518
|
|
|
487
519
|
var displayObjectStandardNames = _objectSpread2(_objectSpread2({}, eventsStandardNames), {}, {
|
|
@@ -829,7 +861,9 @@
|
|
|
829
861
|
["anchor", "pivot", "position", "scale", "skew", "tilePosition", "tileScale"].forEach(function (name) {
|
|
830
862
|
properties[name] = new PropertyInfoRecord(name, VECTOR);
|
|
831
863
|
});
|
|
832
|
-
[
|
|
864
|
+
[// pixi.js < 7.0
|
|
865
|
+
"added", "click", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "mouseupoutside", "pointercancel", "pointerdown", "pointermove", "pointerout", "pointerover", "pointertap", "pointerup", "pointerupoutside", "removed", "rightclick", "rightdown", "rightup", "rightupoutside", "tap", "touchcancel", "touchend", "touchendoutside", "touchmove", "touchstart", // pixi.js >= 7.1
|
|
866
|
+
"onclick", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmouseupoutside", "onpointercancel", "onpointerdown", "onpointerenter", "onpointerleave", "onpointermove", "onpointerout", "onpointerover", "onpointertap", "onpointerup", "onpointerupoutside", "onrightclick", "onrightdown", "onrightup", "onrightupoutside", "ontap", "ontouchcancel", "ontouchend", "ontouchendoutside", "ontouchmove", "ontouchstart", "onwheel"].forEach(function (name) {
|
|
833
867
|
properties[name] = new PropertyInfoRecord(name, CALLBACK);
|
|
834
868
|
});
|
|
835
869
|
|