Files
Foundry-VTT-Docker/resources/app/node_modules/@pixi/events/lib/FederatedEvent.mjs.map
2025-01-04 00:34:03 +01:00

1 line
8.4 KiB
Plaintext

{"version":3,"file":"FederatedEvent.mjs","sources":["../src/FederatedEvent.ts"],"sourcesContent":["import { Point } from '@pixi/core';\n\nimport type { EventBoundary } from './EventBoundary';\nimport type { FederatedEventTarget } from './FederatedEventTarget';\n\nexport interface PixiTouch extends Touch\n{\n button: number;\n buttons: number;\n isPrimary: boolean;\n width: number;\n height: number;\n tiltX: number;\n tiltY: number;\n pointerType: string;\n pointerId: number;\n pressure: number;\n twist: number;\n tangentialPressure: number;\n layerX: number;\n layerY: number;\n offsetX: number;\n offsetY: number;\n isNormalized: boolean;\n type: string;\n}\n\n/**\n * An DOM-compatible synthetic event implementation that is \"forwarded\" on behalf of an original\n * FederatedEvent or native {@link https://dom.spec.whatwg.org/#event Event}.\n * @memberof PIXI\n * @typeParam N - The type of native event held.\n */\nexport class FederatedEvent<N extends UIEvent | PixiTouch = UIEvent | PixiTouch> implements UIEvent\n{\n /** Flags whether this event bubbles. This will take effect only if it is set before propagation. */\n public bubbles = true;\n\n /** @deprecated since 7.0.0 */\n public cancelBubble = true;\n\n /**\n * Flags whether this event can be canceled using {@link PIXI.FederatedEvent.preventDefault}. This is always\n * false (for now).\n */\n public readonly cancelable = false;\n\n /**\n * Flag added for compatibility with DOM {@code Event}. It is not used in the Federated Events\n * API.\n * @see https://dom.spec.whatwg.org/#dom-event-composed\n */\n public readonly composed = false;\n\n /** The listeners of the event target that are being notified. */\n public currentTarget: FederatedEventTarget;\n\n /** Flags whether the default response of the user agent was prevent through this event. */\n public defaultPrevented = false;\n\n /**\n * The propagation phase.\n * @default {@link PIXI.FederatedEvent.NONE}\n */\n public eventPhase = FederatedEvent.prototype.NONE;\n\n /** Flags whether this is a user-trusted event */\n public isTrusted: boolean;\n\n /** @deprecated since 7.0.0 */\n public returnValue: boolean;\n\n /** @deprecated since 7.0.0 */\n public srcElement: EventTarget;\n\n /** The event target that this will be dispatched to. */\n public target: FederatedEventTarget;\n\n /** The timestamp of when the event was created. */\n public timeStamp: number;\n\n /** The type of event, e.g. {@code \"mouseup\"}. */\n public type: string;\n\n /** The native event that caused the foremost original event. */\n public nativeEvent: N;\n\n /** The original event that caused this event, if any. */\n public originalEvent: FederatedEvent<N>;\n\n /** Flags whether propagation was stopped. */\n public propagationStopped = false;\n\n /** Flags whether propagation was immediately stopped. */\n public propagationImmediatelyStopped = false;\n\n /** The composed path of the event's propagation. The {@code target} is at the end. */\n public path: FederatedEventTarget[];\n\n /** The {@link PIXI.EventBoundary} that manages this event. Null for root events. */\n public readonly manager: EventBoundary;\n\n /** Event-specific detail */\n public detail: number;\n\n /** The global Window object. */\n public view: WindowProxy;\n\n /**\n * Not supported.\n * @deprecated since 7.0.0\n */\n public which: number;\n\n /** The coordinates of the evnet relative to the nearest DOM layer. This is a non-standard property. */\n public layer: Point = new Point();\n\n /** @readonly */\n get layerX(): number { return this.layer.x; }\n\n /** @readonly */\n get layerY(): number { return this.layer.y; }\n\n /** The coordinates of the event relative to the DOM document. This is a non-standard property. */\n public page: Point = new Point();\n\n /** @readonly */\n get pageX(): number { return this.page.x; }\n\n /** @readonly */\n get pageY(): number { return this.page.y; }\n\n /**\n * @param manager - The event boundary which manages this event. Propagation can only occur\n * within the boundary's jurisdiction.\n */\n constructor(manager: EventBoundary)\n {\n this.manager = manager;\n }\n\n /**\n * Fallback for the deprecated @code{PIXI.InteractionEvent.data}.\n * @deprecated since 7.0.0\n */\n get data(): this\n {\n return this;\n }\n\n /** The propagation path for this event. Alias for {@link PIXI.EventBoundary.propagationPath}. */\n composedPath(): FederatedEventTarget[]\n {\n // Find the propagation path if it isn't cached or if the target has changed since since\n // the last evaluation.\n if (this.manager && (!this.path || this.path[this.path.length - 1] !== this.target))\n {\n this.path = this.target ? this.manager.propagationPath(this.target) : [];\n }\n\n return this.path;\n }\n\n /**\n * Unimplemented method included for implementing the DOM interface {@code Event}. It will throw an {@code Error}.\n * @deprecated\n * @param _type\n * @param _bubbles\n * @param _cancelable\n */\n initEvent(_type: string, _bubbles?: boolean, _cancelable?: boolean): void\n {\n throw new Error('initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.');\n }\n\n /**\n * Unimplemented method included for implementing the DOM interface {@code UIEvent}. It will throw an {@code Error}.\n * @deprecated\n * @param _typeArg\n * @param _bubblesArg\n * @param _cancelableArg\n * @param _viewArg\n * @param _detailArg\n */\n initUIEvent(_typeArg: string, _bubblesArg?: boolean, _cancelableArg?: boolean, _viewArg?: Window | null,\n _detailArg?: number): void\n {\n throw new Error('initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.');\n }\n\n /** Prevent default behavior of PixiJS and the user agent. */\n preventDefault(): void\n {\n if (this.nativeEvent instanceof Event && this.nativeEvent.cancelable)\n {\n this.nativeEvent.preventDefault();\n }\n\n this.defaultPrevented = true;\n }\n\n /**\n * Stop this event from propagating to any addition listeners, including on the\n * {@link PIXI.FederatedEventTarget.currentTarget currentTarget} and also the following\n * event targets on the propagation path.\n */\n stopImmediatePropagation(): void\n {\n this.propagationImmediatelyStopped = true;\n }\n\n /**\n * Stop this event from propagating to the next {@link PIXI.FederatedEventTarget}. The rest of the listeners\n * on the {@link PIXI.FederatedEventTarget.currentTarget currentTarget} will still be notified.\n */\n stopPropagation(): void\n {\n this.propagationStopped = true;\n }\n\n readonly NONE = 0;\n readonly CAPTURING_PHASE = 1;\n readonly AT_TARGET = 2;\n readonly BUBBLING_PHASE = 3;\n}\n"],"names":[],"mappings":";AAiCO,MAAM,eACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAsGI,YAAY,SACZ;AArGA,SAAO,UAAU,IAGjB,KAAO,eAAe,IAMtB,KAAgB,aAAa,IAO7B,KAAgB,WAAW,IAM3B,KAAO,mBAAmB,IAMnB,KAAA,aAAa,eAAe,UAAU,MA2B7C,KAAO,qBAAqB,IAG5B,KAAO,gCAAgC,IAqBhC,KAAA,QAAe,IAAI,SASnB,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