@pixi/events
Advanced tools
Comparing version 7.1.0 to 7.1.1
@@ -5,5 +5,6 @@ declare namespace GlobalMixins | ||
type FederatedEventTarget = import('@pixi/events').FederatedEventTarget; | ||
type IFederatedDisplayObject = import('@pixi/events').IFederatedDisplayObject; | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
interface DisplayObject extends FederatedEventTarget | ||
interface DisplayObject extends Omit<FederatedEventTarget, keyof IFederatedDisplayObject>, IFederatedDisplayObject | ||
{ | ||
@@ -10,0 +11,0 @@ |
@@ -573,2 +573,10 @@ import { Point, utils } from '@pixi/core'; | ||
/** | ||
* Fired when a pointer device (usually a mouse) is moved globally over the scene. | ||
* DisplayObject's `interactive` property must be set to `true` to fire event. | ||
* | ||
* These events are propagating from the {@link PIXI.EventSystem EventSystem} in @pixi/events. | ||
* @event PIXI.DisplayObject#globalmousemove | ||
* @param {PIXI.FederatedPointerEvent} event - Event | ||
*/ | ||
/** | ||
* Fired when a pointer device (usually a mouse) is moved while over the display object. | ||
@@ -730,2 +738,10 @@ * DisplayObject's `interactive` property must be set to `true` to fire event. | ||
/** | ||
* Fired when a pointer device is moved globally over the scene. | ||
* DisplayObject's `interactive` property must be set to `true` to fire event. | ||
* | ||
* These events are propagating from the {@link PIXI.EventSystem EventSystem} in @pixi/events. | ||
* @event PIXI.DisplayObject#globalpointermove | ||
* @param {PIXI.FederatedPointerEvent} event - Event | ||
*/ | ||
/** | ||
* Fired when a pointer device is moved while over the display object. | ||
@@ -882,2 +898,10 @@ * DisplayObject's `interactive` property must be set to `true` to fire event. | ||
/** | ||
* Fired when a touch point is moved globally over the scene. | ||
* DisplayObject's `interactive` property must be set to `true` to fire event. | ||
* | ||
* These events are propagating from the {@link PIXI.EventSystem EventSystem} in @pixi/events. | ||
* @event PIXI.DisplayObject#globaltouchmove | ||
* @param {PIXI.FederatedPointerEvent} event - Event | ||
*/ | ||
/** | ||
* Fired when a touch point is moved along the display object. | ||
@@ -884,0 +908,0 @@ * DisplayObject's `interactive` property must be set to `true` to fire event. |
@@ -210,3 +210,3 @@ 'use strict'; | ||
const outTarget = this.findMountedTarget(trackingData.overTargets); | ||
if (trackingData.overTargets && outTarget !== e.target) { | ||
if (trackingData.overTargets?.length > 0 && outTarget !== e.target) { | ||
const outType = from.type === "mousemove" ? "mouseout" : "pointerout"; | ||
@@ -260,6 +260,10 @@ const outEvent = this.createPointerEvent(from, outType, outTarget); | ||
this[propagationMethod](e, "pointermove"); | ||
if (e.pointerType === "touch") | ||
this.all(e, "globalpointermove"); | ||
if (e.pointerType === "touch") { | ||
this[propagationMethod](e, "touchmove"); | ||
this.all(e, "globaltouchmove"); | ||
} | ||
if (isMouse) { | ||
this[propagationMethod](e, "mousemove"); | ||
this.all(e, "globalmousemove"); | ||
this.cursor = e.target?.cursor; | ||
@@ -266,0 +270,0 @@ } |
@@ -35,4 +35,12 @@ import type { FederatedPointerEvent } from './FederatedPointerEvent'; | ||
}; | ||
export declare type GlobalFederatedEventMap = { | ||
globalmousemove: FederatedPointerEvent; | ||
globalpointermove: FederatedPointerEvent; | ||
globaltouchmove: FederatedPointerEvent; | ||
}; | ||
export declare type AllFederatedEventMap = FederatedEventMap & GlobalFederatedEventMap; | ||
export declare type FederatedEventEmitterTypes = { | ||
[K in keyof FederatedEventMap as K | `${K}capture`]: [event: FederatedEventMap[K]]; | ||
} & { | ||
[K in keyof GlobalFederatedEventMap]: [event: GlobalFederatedEventMap[K]]; | ||
}; |
import type { utils } from '@pixi/core'; | ||
import type { FederatedEventMap } from './FederatedEventMap'; | ||
import type { AllFederatedEventMap } from './FederatedEventMap'; | ||
import type { FederatedPointerEvent } from './FederatedPointerEvent'; | ||
@@ -38,4 +38,6 @@ import type { FederatedWheelEvent } from './FederatedWheelEvent'; | ||
onmouseleave: FederatedEventHandler | null; | ||
/** Handler for 'mouseover' event */ | ||
/** Handler for 'mousemove' event */ | ||
onmousemove: FederatedEventHandler | null; | ||
/** Handler for 'globalmousemove' event */ | ||
onglobalmousemove: FederatedEventHandler | null; | ||
/** Handler for 'mouseout' event */ | ||
@@ -59,2 +61,4 @@ onmouseout: FederatedEventHandler | null; | ||
onpointermove: FederatedEventHandler | null; | ||
/** Handler for 'globalpointermove' event */ | ||
onglobalpointermove: FederatedEventHandler | null; | ||
/** Handler for 'pointerout' event */ | ||
@@ -88,2 +92,4 @@ onpointerout: FederatedEventHandler | null; | ||
ontouchmove: FederatedEventHandler | null; | ||
/** Handler for 'globaltouchmove' event */ | ||
onglobaltouchmove: FederatedEventHandler | null; | ||
/** Handler for 'touchstart' event */ | ||
@@ -97,5 +103,5 @@ ontouchstart: FederatedEventHandler | null; | ||
export interface IFederatedDisplayObject extends Omit<FederatedEventTarget, 'parent' | 'children' | keyof utils.EventEmitter | 'cursor'> { | ||
addEventListener<K extends keyof FederatedEventMap>(type: K, listener: (e: FederatedEventMap[K]) => any, options?: AddListenerOptions): void; | ||
addEventListener<K extends keyof AllFederatedEventMap>(type: K, listener: (e: AllFederatedEventMap[K]) => any, options?: AddListenerOptions): void; | ||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: AddListenerOptions): void; | ||
removeEventListener<K extends keyof FederatedEventMap>(type: K, listener: (e: FederatedEventMap[K]) => any, options?: RemoveListenerOptions): void; | ||
removeEventListener<K extends keyof AllFederatedEventMap>(type: K, listener: (e: AllFederatedEventMap[K]) => any, options?: RemoveListenerOptions): void; | ||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: RemoveListenerOptions): void; | ||
@@ -102,0 +108,0 @@ } |
@@ -14,2 +14,3 @@ 'use strict'; | ||
onmousemove: null, | ||
onglobalmousemove: null, | ||
onmouseout: null, | ||
@@ -24,2 +25,3 @@ onmouseover: null, | ||
onpointermove: null, | ||
onglobalpointermove: null, | ||
onpointerout: null, | ||
@@ -39,2 +41,3 @@ onpointerover: null, | ||
ontouchmove: null, | ||
onglobaltouchmove: null, | ||
ontouchstart: null, | ||
@@ -41,0 +44,0 @@ onwheel: null, |
{ | ||
"name": "@pixi/events", | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"main": "lib/index.js", | ||
@@ -49,3 +49,3 @@ "module": "lib/index.mjs", | ||
], | ||
"gitHead": "4079e92895ecb692afe9f0b15d3e48ee40852ada" | ||
"gitHead": "99b26d1d5a18760019b034c69c5979ca5e6c536b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
517874
3917