mjolnir.js
Advanced tools
Comparing version 3.0.0-alpha.3 to 3.0.0-alpha.4
@@ -1,4 +0,4 @@ | ||
import { Recognizer } from './hammerjs'; | ||
import type { MjolnirEvent, MjolnirEventHandlers } from './types'; | ||
import { HandlerOptions } from './utils/event-registrar'; | ||
import { Recognizer } from "./hammerjs/index.js"; | ||
import type { MjolnirEvent, MjolnirEventHandlers } from "./types.js"; | ||
import { HandlerOptions } from "./utils/event-registrar.js"; | ||
type RecognizerConstructor = { | ||
@@ -5,0 +5,0 @@ new (options: any): Recognizer; |
// mjolnir.js | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) vis.gl contributors | ||
import { Manager as HammerManager } from './hammerjs'; | ||
import { WheelInput } from './inputs/wheel-input'; | ||
import { MoveInput } from './inputs/move-input'; | ||
import { KeyInput } from './inputs/key-input'; | ||
import { ContextmenuInput } from './inputs/contextmenu-input'; | ||
import { EventRegistrar } from './utils/event-registrar'; | ||
import { Manager as HammerManager } from "./hammerjs/index.js"; | ||
import { WheelInput } from "./inputs/wheel-input.js"; | ||
import { MoveInput } from "./inputs/move-input.js"; | ||
import { KeyInput } from "./inputs/key-input.js"; | ||
import { ContextmenuInput } from "./inputs/contextmenu-input.js"; | ||
import { EventRegistrar } from "./utils/event-registrar.js"; | ||
function normalizeRecognizer(item) { | ||
@@ -11,0 +11,0 @@ if ('recognizer' in item) { |
@@ -1,23 +0,23 @@ | ||
export { InputEvent } from './input/input-consts'; | ||
export { RecognizerState } from './recognizer/recognizer-state'; | ||
export { InputDirection } from './input/input-consts'; | ||
export { Manager } from './manager'; | ||
export { Input } from './input/input'; | ||
export { TouchAction } from './touchaction/touchaction'; | ||
export { PointerEventInput } from './inputs/pointerevent'; | ||
export { Recognizer } from './recognizer/recognizer'; | ||
export { AttrRecognizer } from './recognizers/attribute'; | ||
export { TapRecognizer as Tap } from './recognizers/tap'; | ||
export { PanRecognizer as Pan } from './recognizers/pan'; | ||
export { SwipeRecognizer as Swipe } from './recognizers/swipe'; | ||
export { PinchRecognizer as Pinch } from './recognizers/pinch'; | ||
export { RotateRecognizer as Rotate } from './recognizers/rotate'; | ||
export { PressRecognizer as Press } from './recognizers/press'; | ||
export type { HammerEvent, ManagerOptions } from './manager'; | ||
export type { TapRecognizerOptions } from './recognizers/tap'; | ||
export type { PanRecognizerOptions } from './recognizers/pan'; | ||
export type { SwipeRecognizerOptions } from './recognizers/swipe'; | ||
export type { PinchRecognizerOptions } from './recognizers/pinch'; | ||
export type { RotateRecognizerOptions } from './recognizers/rotate'; | ||
export type { PressRecognizerOptions } from './recognizers/press'; | ||
export { InputEvent } from "./input/input-consts.js"; | ||
export { RecognizerState } from "./recognizer/recognizer-state.js"; | ||
export { InputDirection } from "./input/input-consts.js"; | ||
export { Manager } from "./manager.js"; | ||
export { Input } from "./input/input.js"; | ||
export { TouchAction } from "./touchaction/touchaction.js"; | ||
export { PointerEventInput } from "./inputs/pointerevent.js"; | ||
export { Recognizer } from "./recognizer/recognizer.js"; | ||
export { AttrRecognizer } from "./recognizers/attribute.js"; | ||
export { TapRecognizer as Tap } from "./recognizers/tap.js"; | ||
export { PanRecognizer as Pan } from "./recognizers/pan.js"; | ||
export { SwipeRecognizer as Swipe } from "./recognizers/swipe.js"; | ||
export { PinchRecognizer as Pinch } from "./recognizers/pinch.js"; | ||
export { RotateRecognizer as Rotate } from "./recognizers/rotate.js"; | ||
export { PressRecognizer as Press } from "./recognizers/press.js"; | ||
export type { HammerEvent, ManagerOptions } from "./manager.js"; | ||
export type { TapRecognizerOptions } from "./recognizers/tap.js"; | ||
export type { PanRecognizerOptions } from "./recognizers/pan.js"; | ||
export type { SwipeRecognizerOptions } from "./recognizers/swipe.js"; | ||
export type { PinchRecognizerOptions } from "./recognizers/pinch.js"; | ||
export type { RotateRecognizerOptions } from "./recognizers/rotate.js"; | ||
export type { PressRecognizerOptions } from "./recognizers/press.js"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,16 +0,16 @@ | ||
export { InputEvent } from './input/input-consts'; | ||
export { RecognizerState } from './recognizer/recognizer-state'; | ||
export { InputDirection } from './input/input-consts'; | ||
export { Manager } from './manager'; | ||
export { Input } from './input/input'; | ||
export { TouchAction } from './touchaction/touchaction'; | ||
export { PointerEventInput } from './inputs/pointerevent'; | ||
export { Recognizer } from './recognizer/recognizer'; | ||
export { AttrRecognizer } from './recognizers/attribute'; | ||
export { TapRecognizer as Tap } from './recognizers/tap'; | ||
export { PanRecognizer as Pan } from './recognizers/pan'; | ||
export { SwipeRecognizer as Swipe } from './recognizers/swipe'; | ||
export { PinchRecognizer as Pinch } from './recognizers/pinch'; | ||
export { RotateRecognizer as Rotate } from './recognizers/rotate'; | ||
export { PressRecognizer as Press } from './recognizers/press'; | ||
export { InputEvent } from "./input/input-consts.js"; | ||
export { RecognizerState } from "./recognizer/recognizer-state.js"; | ||
export { InputDirection } from "./input/input-consts.js"; | ||
export { Manager } from "./manager.js"; | ||
export { Input } from "./input/input.js"; | ||
export { TouchAction } from "./touchaction/touchaction.js"; | ||
export { PointerEventInput } from "./inputs/pointerevent.js"; | ||
export { Recognizer } from "./recognizer/recognizer.js"; | ||
export { AttrRecognizer } from "./recognizers/attribute.js"; | ||
export { TapRecognizer as Tap } from "./recognizers/tap.js"; | ||
export { PanRecognizer as Pan } from "./recognizers/pan.js"; | ||
export { SwipeRecognizer as Swipe } from "./recognizers/swipe.js"; | ||
export { PinchRecognizer as Pinch } from "./recognizers/pinch.js"; | ||
export { RotateRecognizer as Rotate } from "./recognizers/rotate.js"; | ||
export { PressRecognizer as Press } from "./recognizers/press.js"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,3 @@ | ||
import type { Manager } from '../manager'; | ||
import type { RawInput, HammerInput } from './types'; | ||
import type { Manager } from "../manager.js"; | ||
import type { RawInput, HammerInput } from "./types.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * extend the data with some usable properties like scale, rotate, velocity etc |
@@ -1,12 +0,12 @@ | ||
import hasParent from '../utils/has-parent'; | ||
import { simpleCloneInputData } from './simple-clone-input-data'; | ||
import { getCenter } from './get-center'; | ||
import { getPointDistance } from './get-distance'; | ||
import { getPointAngle } from './get-angle'; | ||
import { getDirection } from './get-direction'; | ||
import { computeDeltaXY } from './get-delta-xy'; | ||
import { getVelocity } from './get-velocity'; | ||
import { getScale } from './get-scale'; | ||
import { getRotation } from './get-rotation'; | ||
import { computeIntervalInputData } from './compute-interval-input-data'; | ||
import hasParent from "../utils/has-parent.js"; | ||
import { simpleCloneInputData } from "./simple-clone-input-data.js"; | ||
import { getCenter } from "./get-center.js"; | ||
import { getPointDistance } from "./get-distance.js"; | ||
import { getPointAngle } from "./get-angle.js"; | ||
import { getDirection } from "./get-direction.js"; | ||
import { computeDeltaXY } from "./get-delta-xy.js"; | ||
import { getVelocity } from "./get-velocity.js"; | ||
import { getScale } from "./get-scale.js"; | ||
import { getRotation } from "./get-rotation.js"; | ||
import { computeIntervalInputData } from "./compute-interval-input-data.js"; | ||
/** | ||
@@ -13,0 +13,0 @@ * extend the data with some usable properties like scale, rotate, velocity etc |
@@ -1,2 +0,2 @@ | ||
import type { Session, HammerInput } from './types'; | ||
import type { Session, HammerInput } from "./types.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * velocity is calculated every x ms |
@@ -1,4 +0,4 @@ | ||
import { InputEvent, COMPUTE_INTERVAL } from './input-consts'; | ||
import { getVelocity } from './get-velocity'; | ||
import { getDirection } from './get-direction'; | ||
import { InputEvent, COMPUTE_INTERVAL } from "./input-consts.js"; | ||
import { getVelocity } from "./get-velocity.js"; | ||
import { getDirection } from "./get-direction.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * velocity is calculated every x ms |
@@ -1,2 +0,2 @@ | ||
import { Point, PointerEventLike } from './types'; | ||
import { Point, PointerEventLike } from "./types.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * calculate the angle between two coordinates |
@@ -1,2 +0,2 @@ | ||
import type { Point, PointerEventLike } from './types'; | ||
import type { Point, PointerEventLike } from "./types.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * get the center of all the pointers |
@@ -1,2 +0,2 @@ | ||
import type { RawInput, Session } from './types'; | ||
import type { RawInput, Session } from "./types.js"; | ||
/** Populates input.deltaX, input.deltaY */ | ||
@@ -3,0 +3,0 @@ export declare function computeDeltaXY(session: Session, input: RawInput): { |
@@ -1,2 +0,2 @@ | ||
import { InputEvent } from './input-consts'; | ||
import { InputEvent } from "./input-consts.js"; | ||
/** Populates input.deltaX, input.deltaY */ | ||
@@ -3,0 +3,0 @@ export function computeDeltaXY(session, input) { |
@@ -1,2 +0,2 @@ | ||
import { InputDirection } from './input-consts'; | ||
import { InputDirection } from "./input-consts.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * get the direction between two points |
@@ -1,2 +0,2 @@ | ||
import { InputDirection } from './input-consts'; | ||
import { InputDirection } from "./input-consts.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * get the direction between two points |
@@ -1,2 +0,2 @@ | ||
import type { Point, PointerEventLike } from './types'; | ||
import type { Point, PointerEventLike } from "./types.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * calculate the absolute distance between two points |
@@ -1,2 +0,2 @@ | ||
import { PointerEventLike } from './types'; | ||
import { PointerEventLike } from "./types.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * calculate the rotation degrees between two pointer sets |
@@ -1,2 +0,2 @@ | ||
import { getEventAngle } from './get-angle'; | ||
import { getEventAngle } from "./get-angle.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * calculate the rotation degrees between two pointer sets |
@@ -1,2 +0,2 @@ | ||
import type { PointerEventLike } from './types'; | ||
import type { PointerEventLike } from "./types.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * calculate the scale factor between two pointersets |
@@ -1,2 +0,2 @@ | ||
import { getEventDistance } from './get-distance'; | ||
import { getEventDistance } from "./get-distance.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * calculate the scale factor between two pointersets |
@@ -1,2 +0,2 @@ | ||
import type { Vector } from './types'; | ||
import type { Vector } from "./types.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * calculate the velocity between two points. unit is in px per ms. |
@@ -1,4 +0,4 @@ | ||
import { InputEvent } from './input-consts'; | ||
import type { Manager } from '../manager'; | ||
import type { RawInput } from './types'; | ||
import { InputEvent } from "./input-consts.js"; | ||
import type { Manager } from "../manager.js"; | ||
import type { RawInput } from "./types.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * handle input events |
@@ -1,3 +0,3 @@ | ||
import { InputEvent } from './input-consts'; | ||
import { computeInputData } from './compute-input-data'; | ||
import { InputEvent } from "./input-consts.js"; | ||
import { computeInputData } from "./compute-input-data.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * handle input events |
@@ -1,4 +0,4 @@ | ||
import { InputEvent } from './input-consts'; | ||
import type { RawInput } from './types'; | ||
import type { Manager } from '../manager'; | ||
import { InputEvent } from "./input-consts.js"; | ||
import type { RawInput } from "./types.js"; | ||
import type { Manager } from "../manager.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * create new input type manager |
@@ -1,4 +0,4 @@ | ||
import { addEventListeners, removeEventListeners } from '../utils/event-listeners'; | ||
import { getWindowForElement } from '../utils/get-window-for-element'; | ||
import { inputHandler } from './input-handler'; | ||
import { addEventListeners, removeEventListeners } from "../utils/event-listeners.js"; | ||
import { getWindowForElement } from "../utils/get-window-for-element.js"; | ||
import { inputHandler } from "./input-handler.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * create new input type manager |
@@ -1,2 +0,2 @@ | ||
import type { RawInput, SimpleInput } from './types'; | ||
import type { RawInput, SimpleInput } from "./types.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * create a simple clone from the input used for storage of firstInput and firstMultiple |
@@ -1,2 +0,2 @@ | ||
import { getCenter } from './get-center'; | ||
import { getCenter } from "./get-center.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * create a simple clone from the input used for storage of firstInput and firstMultiple |
@@ -1,3 +0,3 @@ | ||
import { InputEvent, InputDirection } from './input-consts'; | ||
import type { Recognizer } from '../recognizer/recognizer'; | ||
import { InputEvent, InputDirection } from "./input-consts.js"; | ||
import type { Recognizer } from "../recognizer/recognizer.js"; | ||
export type Point = { | ||
@@ -4,0 +4,0 @@ x: number; |
@@ -1,3 +0,3 @@ | ||
import { Input } from '../input/input'; | ||
import type { Manager } from '../manager'; | ||
import { Input } from "../input/input.js"; | ||
import type { Manager } from "../manager.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * Pointer events input |
@@ -1,3 +0,3 @@ | ||
import { InputEvent } from '../input/input-consts'; | ||
import { Input } from '../input/input'; | ||
import { InputEvent } from "../input/input-consts.js"; | ||
import { Input } from "../input/input.js"; | ||
const POINTER_INPUT_MAP = { | ||
@@ -4,0 +4,0 @@ pointerdown: InputEvent.Start, |
@@ -1,5 +0,5 @@ | ||
import { TouchAction } from './touchaction/touchaction'; | ||
import type { Input } from './input/input'; | ||
import type { Recognizer } from './recognizer/recognizer'; | ||
import type { Session, HammerInput } from './input/types'; | ||
import { TouchAction } from "./touchaction/touchaction.js"; | ||
import type { Input } from "./input/input.js"; | ||
import type { Recognizer } from "./recognizer/recognizer.js"; | ||
import type { Session, HammerInput } from "./input/types.js"; | ||
export type ManagerOptions = { | ||
@@ -6,0 +6,0 @@ /** |
@@ -1,6 +0,6 @@ | ||
import { TouchAction } from './touchaction/touchaction'; | ||
import { PointerEventInput } from './inputs/pointerevent'; | ||
import { splitStr } from './utils/split-str'; | ||
import { prefixed } from './utils/prefixed'; | ||
import { RecognizerState } from './recognizer/recognizer-state'; | ||
import { TouchAction } from "./touchaction/touchaction.js"; | ||
import { PointerEventInput } from "./inputs/pointerevent.js"; | ||
import { splitStr } from "./utils/split-str.js"; | ||
import { prefixed } from "./utils/prefixed.js"; | ||
import { RecognizerState } from "./recognizer/recognizer-state.js"; | ||
const STOP = 1; | ||
@@ -7,0 +7,0 @@ const FORCED_STOP = 2; |
@@ -1,4 +0,4 @@ | ||
import { RecognizerState } from './recognizer-state'; | ||
import type { Manager } from '../manager'; | ||
import type { HammerInput } from '../input/types'; | ||
import { RecognizerState } from "./recognizer-state.js"; | ||
import type { Manager } from "../manager.js"; | ||
import type { HammerInput } from "../input/types.js"; | ||
export type RecognizerOptions = { | ||
@@ -5,0 +5,0 @@ /** Name of the event */ |
@@ -1,4 +0,4 @@ | ||
import { RecognizerState } from './recognizer-state'; | ||
import { uniqueId } from '../utils/unique-id'; | ||
import { stateStr } from './state-str'; | ||
import { RecognizerState } from "./recognizer-state.js"; | ||
import { uniqueId } from "../utils/unique-id.js"; | ||
import { stateStr } from "./state-str.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * Recognizer flow explained; * |
@@ -1,2 +0,2 @@ | ||
import { RecognizerState } from './recognizer-state'; | ||
import { RecognizerState } from "./recognizer-state.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * get a usable string, used as event postfix |
@@ -1,2 +0,2 @@ | ||
import { RecognizerState } from './recognizer-state'; | ||
import { RecognizerState } from "./recognizer-state.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * get a usable string, used as event postfix |
@@ -1,3 +0,3 @@ | ||
import { Recognizer, RecognizerOptions } from '../recognizer/recognizer'; | ||
import type { HammerInput } from '../input/types'; | ||
import { Recognizer, RecognizerOptions } from "../recognizer/recognizer.js"; | ||
import type { HammerInput } from "../input/types.js"; | ||
type AttrRecognizerOptions = RecognizerOptions & { | ||
@@ -4,0 +4,0 @@ pointers: number; |
@@ -1,4 +0,4 @@ | ||
import { Recognizer } from '../recognizer/recognizer'; | ||
import { RecognizerState } from '../recognizer/recognizer-state'; | ||
import { InputEvent } from '../input/input-consts'; | ||
import { Recognizer } from "../recognizer/recognizer.js"; | ||
import { RecognizerState } from "../recognizer/recognizer-state.js"; | ||
import { InputEvent } from "../input/input-consts.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * This recognizer is just used as a base for the simple attribute recognizers. |
@@ -1,4 +0,4 @@ | ||
import { AttrRecognizer } from './attribute'; | ||
import { InputDirection } from '../input/input-consts'; | ||
import type { HammerInput } from '../input/types'; | ||
import { AttrRecognizer } from "./attribute.js"; | ||
import { InputDirection } from "../input/input-consts.js"; | ||
import type { HammerInput } from "../input/types.js"; | ||
export type PanRecognizerOptions = { | ||
@@ -5,0 +5,0 @@ /** Name of the event. |
@@ -1,5 +0,5 @@ | ||
import { AttrRecognizer } from './attribute'; | ||
import { InputDirection } from '../input/input-consts'; | ||
import { RecognizerState } from '../recognizer/recognizer-state'; | ||
import { TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y } from '../touchaction/touchaction-Consts'; | ||
import { AttrRecognizer } from "./attribute.js"; | ||
import { InputDirection } from "../input/input-consts.js"; | ||
import { RecognizerState } from "../recognizer/recognizer-state.js"; | ||
import { TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y } from "../touchaction/touchaction-Consts.js"; | ||
const EVENT_NAMES = ['', 'start', 'move', 'end', 'cancel', 'up', 'down', 'left', 'right']; | ||
@@ -6,0 +6,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { AttrRecognizer } from './attribute'; | ||
import type { HammerInput } from '../input/types'; | ||
import { AttrRecognizer } from "./attribute.js"; | ||
import type { HammerInput } from "../input/types.js"; | ||
export type PinchRecognizerOptions = { | ||
@@ -4,0 +4,0 @@ /** Name of the event. |
@@ -1,4 +0,4 @@ | ||
import { AttrRecognizer } from './attribute'; | ||
import { TOUCH_ACTION_NONE } from '../touchaction/touchaction-Consts'; | ||
import { RecognizerState } from '../recognizer/recognizer-state'; | ||
import { AttrRecognizer } from "./attribute.js"; | ||
import { TOUCH_ACTION_NONE } from "../touchaction/touchaction-Consts.js"; | ||
import { RecognizerState } from "../recognizer/recognizer-state.js"; | ||
const EVENT_NAMES = ['', 'start', 'move', 'end', 'cancel', 'in', 'out']; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import { Recognizer } from '../recognizer/recognizer'; | ||
import { RecognizerState } from '../recognizer/recognizer-state'; | ||
import { HammerInput } from '../input/types'; | ||
import { Recognizer } from "../recognizer/recognizer.js"; | ||
import { RecognizerState } from "../recognizer/recognizer-state.js"; | ||
import { HammerInput } from "../input/types.js"; | ||
export type PressRecognizerOptions = { | ||
@@ -5,0 +5,0 @@ /** Name of the event. |
/* global setTimeout, clearTimeout */ | ||
import { Recognizer } from '../recognizer/recognizer'; | ||
import { RecognizerState } from '../recognizer/recognizer-state'; | ||
import { TOUCH_ACTION_AUTO } from '../touchaction/touchaction-Consts'; | ||
import { InputEvent } from '../input/input-consts'; | ||
import { Recognizer } from "../recognizer/recognizer.js"; | ||
import { RecognizerState } from "../recognizer/recognizer-state.js"; | ||
import { TOUCH_ACTION_AUTO } from "../touchaction/touchaction-Consts.js"; | ||
import { InputEvent } from "../input/input-consts.js"; | ||
const EVENT_NAMES = ['', 'up']; | ||
@@ -7,0 +7,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { AttrRecognizer } from './attribute'; | ||
import type { HammerInput } from '../input/types'; | ||
import { AttrRecognizer } from "./attribute.js"; | ||
import type { HammerInput } from "../input/types.js"; | ||
export type RotateRecognizerOptions = { | ||
@@ -4,0 +4,0 @@ /** Name of the event. |
@@ -1,4 +0,4 @@ | ||
import { AttrRecognizer } from './attribute'; | ||
import { TOUCH_ACTION_NONE } from '../touchaction/touchaction-Consts'; | ||
import { RecognizerState } from '../recognizer/recognizer-state'; | ||
import { AttrRecognizer } from "./attribute.js"; | ||
import { TOUCH_ACTION_NONE } from "../touchaction/touchaction-Consts.js"; | ||
import { RecognizerState } from "../recognizer/recognizer-state.js"; | ||
const EVENT_NAMES = ['', 'start', 'move', 'end', 'cancel']; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import { AttrRecognizer } from './attribute'; | ||
import { InputDirection } from '../input/input-consts'; | ||
import type { HammerInput } from '../input/types'; | ||
import { AttrRecognizer } from "./attribute.js"; | ||
import { InputDirection } from "../input/input-consts.js"; | ||
import type { HammerInput } from "../input/types.js"; | ||
export type SwipeRecognizerOptions = { | ||
@@ -5,0 +5,0 @@ /** Name of the event. |
@@ -1,4 +0,4 @@ | ||
import { AttrRecognizer } from './attribute'; | ||
import { InputDirection, InputEvent } from '../input/input-consts'; | ||
import { PanRecognizer } from './pan'; | ||
import { AttrRecognizer } from "./attribute.js"; | ||
import { InputDirection, InputEvent } from "../input/input-consts.js"; | ||
import { PanRecognizer } from "./pan.js"; | ||
const EVENT_NAMES = ['', 'up', 'down', 'left', 'right']; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import { Recognizer } from '../recognizer/recognizer'; | ||
import { RecognizerState } from '../recognizer/recognizer-state'; | ||
import type { HammerInput } from '../input/types'; | ||
import { Recognizer } from "../recognizer/recognizer.js"; | ||
import { RecognizerState } from "../recognizer/recognizer-state.js"; | ||
import type { HammerInput } from "../input/types.js"; | ||
export type TapRecognizerOptions = { | ||
@@ -5,0 +5,0 @@ /** Name of the event. |
/* global setTimeout, clearTimeout */ | ||
import { Recognizer } from '../recognizer/recognizer'; | ||
import { TOUCH_ACTION_MANIPULATION } from '../touchaction/touchaction-Consts'; | ||
import { InputEvent } from '../input/input-consts'; | ||
import { RecognizerState } from '../recognizer/recognizer-state'; | ||
import { getPointDistance } from '../input/get-distance'; | ||
import { Recognizer } from "../recognizer/recognizer.js"; | ||
import { TOUCH_ACTION_MANIPULATION } from "../touchaction/touchaction-Consts.js"; | ||
import { InputEvent } from "../input/input-consts.js"; | ||
import { RecognizerState } from "../recognizer/recognizer-state.js"; | ||
import { getPointDistance } from "../input/get-distance.js"; | ||
/** | ||
@@ -8,0 +8,0 @@ * A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur |
@@ -1,2 +0,2 @@ | ||
import { TOUCH_ACTION_NONE, TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y, TOUCH_ACTION_MANIPULATION, TOUCH_ACTION_AUTO } from './touchaction-Consts'; | ||
import { TOUCH_ACTION_NONE, TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y, TOUCH_ACTION_MANIPULATION, TOUCH_ACTION_AUTO } from "./touchaction-Consts.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * when the touchActions are collected they are not a valid value, so we need to clean things up. * |
@@ -1,2 +0,2 @@ | ||
import type { Manager } from '../manager'; | ||
import type { Manager } from "../manager.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Touch Action |
@@ -1,3 +0,3 @@ | ||
import { TOUCH_ACTION_COMPUTE } from './touchaction-Consts'; | ||
import cleanTouchActions from './clean-touch-actions'; | ||
import { TOUCH_ACTION_COMPUTE } from "./touchaction-Consts.js"; | ||
import cleanTouchActions from "./clean-touch-actions.js"; | ||
/** | ||
@@ -4,0 +4,0 @@ * Touch Action |
@@ -1,2 +0,2 @@ | ||
import { splitStr } from './split-str'; | ||
import { splitStr } from "./split-str.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * addEventListener with multiple events at once |
@@ -1,6 +0,6 @@ | ||
export { EventManager } from './event-manager'; | ||
export { Recognizer, Pan, Rotate, Pinch, Swipe, Press, Tap, InputDirection, InputEvent } from './hammerjs'; | ||
export type { EventManagerOptions, RecognizerTuple } from './event-manager'; | ||
export type { MjolnirEvent, MjolnirGestureEvent, MjolnirKeyEvent, MjolnirWheelEvent, MjolnirPointerEvent } from './types'; | ||
export type { PanRecognizerOptions, RotateRecognizerOptions, PinchRecognizerOptions, SwipeRecognizerOptions, PressRecognizerOptions, TapRecognizerOptions } from './hammerjs'; | ||
export { EventManager } from "./event-manager.js"; | ||
export { Recognizer, Pan, Rotate, Pinch, Swipe, Press, Tap, InputDirection, InputEvent } from "./hammerjs/index.js"; | ||
export type { EventManagerOptions, RecognizerTuple } from "./event-manager.js"; | ||
export type { MjolnirEvent, MjolnirGestureEvent, MjolnirKeyEvent, MjolnirWheelEvent, MjolnirPointerEvent } from "./types.js"; | ||
export type { PanRecognizerOptions, RotateRecognizerOptions, PinchRecognizerOptions, SwipeRecognizerOptions, PressRecognizerOptions, TapRecognizerOptions } from "./hammerjs/index.js"; | ||
//# sourceMappingURL=index.d.ts.map |
// mjolnir.js | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) vis.gl contributors | ||
export { EventManager } from './event-manager'; | ||
export { Recognizer, Pan, Rotate, Pinch, Swipe, Press, Tap, InputDirection, InputEvent } from './hammerjs'; | ||
export { EventManager } from "./event-manager.js"; | ||
export { Recognizer, Pan, Rotate, Pinch, Swipe, Press, Tap, InputDirection, InputEvent } from "./hammerjs/index.js"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,3 @@ | ||
import type { MjolnirPointerEventRaw } from '../types'; | ||
import { Input, InputOptions } from './input'; | ||
import type { MjolnirPointerEventRaw } from "../types.js"; | ||
import { Input, InputOptions } from "./input.js"; | ||
export declare class ContextmenuInput extends Input<MjolnirPointerEventRaw, InputOptions> { | ||
@@ -4,0 +4,0 @@ constructor(element: HTMLElement, callback: (event: MjolnirPointerEventRaw) => void, options: InputOptions); |
// mjolnir.js | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) vis.gl contributors | ||
import { Input } from './input'; | ||
import { Input } from "./input.js"; | ||
export class ContextmenuInput extends Input { | ||
@@ -6,0 +6,0 @@ constructor(element, callback, options) { |
@@ -1,2 +0,2 @@ | ||
import type { MjolnirEventRaw } from '../types'; | ||
import type { MjolnirEventRaw } from "../types.js"; | ||
export interface InputOptions { | ||
@@ -3,0 +3,0 @@ enable?: boolean; |
@@ -1,3 +0,3 @@ | ||
import type { MjolnirKeyEventRaw } from '../types'; | ||
import { Input, InputOptions } from './input'; | ||
import type { MjolnirKeyEventRaw } from "../types.js"; | ||
import { Input, InputOptions } from "./input.js"; | ||
type KeyInputOptions = InputOptions & { | ||
@@ -4,0 +4,0 @@ tabIndex?: number; |
// mjolnir.js | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) vis.gl contributors | ||
import { Input } from './input'; | ||
import { Input } from "./input.js"; | ||
const KEY_EVENTS = ['keydown', 'keyup']; | ||
@@ -6,0 +6,0 @@ export class KeyInput extends Input { |
@@ -1,3 +0,3 @@ | ||
import type { MjolnirPointerEventRaw } from '../types'; | ||
import { Input, InputOptions } from './input'; | ||
import type { MjolnirPointerEventRaw } from "../types.js"; | ||
import { Input, InputOptions } from "./input.js"; | ||
type MoveEventType = 'pointermove' | 'pointerover' | 'pointerout' | 'pointerenter' | 'pointerleave'; | ||
@@ -4,0 +4,0 @@ /** |
// mjolnir.js | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) vis.gl contributors | ||
import { Input } from './input'; | ||
import { Input } from "./input.js"; | ||
const MOUSE_EVENTS = [ | ||
@@ -6,0 +6,0 @@ 'mousedown', |
@@ -1,3 +0,3 @@ | ||
import type { MjolnirWheelEventRaw } from '../types'; | ||
import { Input, InputOptions } from './input'; | ||
import type { MjolnirWheelEventRaw } from "../types.js"; | ||
import { Input, InputOptions } from "./input.js"; | ||
export declare class WheelInput extends Input<MjolnirWheelEventRaw, Required<InputOptions>> { | ||
@@ -4,0 +4,0 @@ constructor(element: HTMLElement, callback: (event: MjolnirWheelEventRaw) => void, options: InputOptions); |
// mjolnir.js | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) vis.gl contributors | ||
import { Input } from './input'; | ||
import { userAgent } from '../utils/globals'; | ||
import { Input } from "./input.js"; | ||
import { userAgent } from "../utils/globals.js"; | ||
const firefox = userAgent.indexOf('firefox') !== -1; | ||
@@ -7,0 +7,0 @@ // Constants for normalizing input delta |
@@ -1,2 +0,2 @@ | ||
import type { HammerEvent } from './hammerjs'; | ||
import type { HammerEvent } from "./hammerjs.js"; | ||
export type Point = { | ||
@@ -3,0 +3,0 @@ x: number; |
@@ -1,3 +0,3 @@ | ||
import type { EventManager } from '../event-manager'; | ||
import type { MjolnirEventRaw, MjolnirEventWrapper, MjolnirEvent, MjolnirEventHandler } from '../types'; | ||
import type { EventManager } from "../event-manager.js"; | ||
import type { MjolnirEventRaw, MjolnirEventWrapper, MjolnirEvent, MjolnirEventHandler } from "../types.js"; | ||
export type HandlerOptions = { | ||
@@ -4,0 +4,0 @@ /** Optional element from which the event is originated from. |
// mjolnir.js | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) vis.gl contributors | ||
import { whichButtons, getOffsetPosition } from './event-utils'; | ||
import { whichButtons, getOffsetPosition } from "./event-utils.js"; | ||
const DEFAULT_OPTIONS = { | ||
@@ -6,0 +6,0 @@ srcElement: 'root', |
@@ -1,2 +0,2 @@ | ||
import type { MjolnirEventRaw, Point } from '../types'; | ||
import type { MjolnirEventRaw, Point } from "../types.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Extract the involved mouse button |
{ | ||
"name": "mjolnir.js", | ||
"description": "An Event Manager", | ||
"version": "3.0.0-alpha.3", | ||
"version": "3.0.0-alpha.4", | ||
"type": "module", | ||
@@ -48,4 +48,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@vis.gl/dev-tools": "1.0.0-alpha.13", | ||
"@vis.gl/ts-plugins": "1.0.0-alpha.13", | ||
"@vis.gl/dev-tools": "1.0.0-alpha.18", | ||
"@vis.gl/ts-plugins": "1.0.0-alpha.18", | ||
"jsdom": "^16.0.0", | ||
@@ -52,0 +52,0 @@ "pre-commit": "^1.2.2", |
@@ -5,3 +5,3 @@ // mjolnir.js | ||
import {Manager as HammerManager, Recognizer} from './hammerjs'; | ||
import {Manager as HammerManager, Recognizer} from './hammerjs/index'; | ||
import type { | ||
@@ -8,0 +8,0 @@ MjolnirEventRaw, |
@@ -16,3 +16,3 @@ // mjolnir.js | ||
InputEvent | ||
} from './hammerjs'; | ||
} from './hammerjs/index'; | ||
@@ -36,2 +36,2 @@ // types | ||
TapRecognizerOptions | ||
} from './hammerjs'; | ||
} from './hammerjs/index'; |
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
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
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
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
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
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
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
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
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
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
520288