@interactjs/reflow
Advanced tools
Comparing version 1.8.4 to 1.8.5
@@ -16,9 +16,9 @@ import Interactable from '@interactjs/core/Interactable'; | ||
declare module '@interactjs/core/InteractEvent' { | ||
enum EventPhase { | ||
Reflow = "reflow" | ||
interface PhaseMap { | ||
reflow?: true; | ||
} | ||
} | ||
export declare function install(scope: Scope): void; | ||
declare function reflow(interactable: Interactable, action: ActionProps, scope: Scope): Promise<Interactable>; | ||
declare function reflow<T extends Interact.ActionName>(interactable: Interactable, action: ActionProps<T>, scope: Scope): Promise<Interactable>; | ||
declare const _default: import("@interactjs/core/scope").Plugin; | ||
export default _default; |
16
index.js
import Interactable from "../core/Interactable.js"; | ||
import { EventPhase } from "../core/InteractEvent.js"; | ||
import { Interaction } from "../core/Interaction.js"; | ||
import { arr, extend, is, pointer as pointerUtils, rect as rectUtils, win } from "../utils/index.js"; | ||
EventPhase.Reflow = 'reflow'; | ||
export function install(scope) { | ||
const { | ||
actions, | ||
/** @lends Interactable */ | ||
// eslint-disable-next-line no-shadow | ||
Interactable | ||
} = scope; // add action reflow event types | ||
for (const actionName of actions.names) { | ||
actions.eventTypes.push(`${actionName}reflow`); | ||
} | ||
} = scope; | ||
scope.actions.phases.reflow = true; | ||
/** | ||
@@ -35,3 +28,2 @@ * ```js | ||
Interactable.prototype.reflow = function (action) { | ||
@@ -102,3 +94,3 @@ return reflow(this, action, scope); | ||
eventTarget: element, | ||
phase: EventPhase.Reflow | ||
phase: 'reflow' | ||
}; | ||
@@ -139,3 +131,3 @@ interaction.interactable = interactable; | ||
}, scope) => { | ||
if (interaction.pointerType === EventPhase.Reflow) { | ||
if (interaction.pointerType === 'reflow') { | ||
if (interaction._reflowResolve) { | ||
@@ -142,0 +134,0 @@ interaction._reflowResolve(); |
{ | ||
"name": "@interactjs/reflow", | ||
"version": "1.8.4", | ||
"version": "1.8.5", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"@interactjs/core": "1.8.4", | ||
"@interactjs/utils": "1.8.4" | ||
"@interactjs/core": "1.8.5", | ||
"@interactjs/utils": "1.8.5" | ||
}, | ||
"devDependencies": { | ||
"@interactjs/_dev": "1.8.4", | ||
"@interactjs/_dev": "1.8.5", | ||
"promise-polyfill": "latest" | ||
@@ -16,3 +16,3 @@ }, | ||
}, | ||
"gitHead": "bb6d3695" | ||
"gitHead": "1cc6d94c" | ||
} |
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
16368
145